@asgardeo/react 0.14.0 → 0.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +584 -543
- package/dist/cjs/index.js.map +4 -4
- package/dist/components/primitives/Icons/ArrowRightLeft.d.ts +29 -0
- package/dist/index.js +585 -545
- package/dist/index.js.map +4 -4
- package/package.json +2 -2
package/dist/cjs/index.js
CHANGED
|
@@ -8002,14 +8002,40 @@ var ArrowLeftRight = ({ color = "currentColor", size = 24 }) => /* @__PURE__ */
|
|
|
8002
8002
|
ArrowLeftRight.displayName = "ArrowLeftRight";
|
|
8003
8003
|
var ArrowLeftRight_default = ArrowLeftRight;
|
|
8004
8004
|
|
|
8005
|
+
// src/components/primitives/Icons/ArrowRightLeft.tsx
|
|
8006
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
8007
|
+
var ArrowRightLeft = ({ color = "currentColor", size = 24 }) => /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
|
8008
|
+
"svg",
|
|
8009
|
+
{
|
|
8010
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
8011
|
+
width: size,
|
|
8012
|
+
height: size,
|
|
8013
|
+
viewBox: "0 0 24 24",
|
|
8014
|
+
fill: "none",
|
|
8015
|
+
stroke: color,
|
|
8016
|
+
strokeWidth: "2",
|
|
8017
|
+
strokeLinecap: "round",
|
|
8018
|
+
strokeLinejoin: "round",
|
|
8019
|
+
children: [
|
|
8020
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("path", { d: "m16 3 4 4-4 4" }),
|
|
8021
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("path", { d: "M20 7H4" }),
|
|
8022
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("path", { d: "m8 21-4-4 4-4" }),
|
|
8023
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("path", { d: "M4 17h16" })
|
|
8024
|
+
]
|
|
8025
|
+
}
|
|
8026
|
+
);
|
|
8027
|
+
ArrowRightLeft.displayName = "ArrowRightLeft";
|
|
8028
|
+
var ArrowRightLeft_default = ArrowRightLeft;
|
|
8029
|
+
|
|
8005
8030
|
// src/components/primitives/Icons/flowIconRegistry.tsx
|
|
8006
8031
|
var flowIconRegistry = {
|
|
8007
|
-
ArrowLeftRight: ArrowLeftRight_default
|
|
8032
|
+
ArrowLeftRight: ArrowLeftRight_default,
|
|
8033
|
+
ArrowRightLeft: ArrowRightLeft_default
|
|
8008
8034
|
};
|
|
8009
8035
|
var flowIconRegistry_default = flowIconRegistry;
|
|
8010
8036
|
|
|
8011
8037
|
// src/components/presentation/auth/AuthOptionFactory.tsx
|
|
8012
|
-
var
|
|
8038
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
8013
8039
|
var logger5 = (0, import_browser50.createPackageComponentLogger)(
|
|
8014
8040
|
"@asgardeo/react",
|
|
8015
8041
|
"AuthOptionFactory"
|
|
@@ -8050,11 +8076,11 @@ var getTypographyVariant = (variant) => {
|
|
|
8050
8076
|
};
|
|
8051
8077
|
return variantMap[variant] || "h3";
|
|
8052
8078
|
};
|
|
8053
|
-
var matchesSocialProvider = (actionId, eventType, buttonText, provider, authType,
|
|
8079
|
+
var matchesSocialProvider = (actionId, eventType, buttonText, provider, authType, _componentVariant) => {
|
|
8054
8080
|
const providerId = `${provider}_auth`;
|
|
8055
8081
|
const providerMatches = actionId === providerId || eventType === providerId;
|
|
8056
|
-
if (
|
|
8057
|
-
return
|
|
8082
|
+
if (buttonText.toLowerCase().includes(provider)) {
|
|
8083
|
+
return true;
|
|
8058
8084
|
}
|
|
8059
8085
|
if (authType === "signup") {
|
|
8060
8086
|
return providerMatches || buttonText.toLowerCase().includes(provider);
|
|
@@ -8108,27 +8134,27 @@ var createAuthComponentFromFlow = (component, formValues, touchedFields, formErr
|
|
|
8108
8134
|
}
|
|
8109
8135
|
};
|
|
8110
8136
|
if (matchesSocialProvider(actionId, eventType, buttonText, "google", authType, componentVariant)) {
|
|
8111
|
-
return /* @__PURE__ */ (0,
|
|
8137
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(GoogleButton_default, { onClick: handleClick, className: options.buttonClassName }, key);
|
|
8112
8138
|
}
|
|
8113
8139
|
if (matchesSocialProvider(actionId, eventType, buttonText, "github", authType, componentVariant)) {
|
|
8114
|
-
return /* @__PURE__ */ (0,
|
|
8140
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(GitHubButton_default, { onClick: handleClick, className: options.buttonClassName }, key);
|
|
8115
8141
|
}
|
|
8116
8142
|
if (matchesSocialProvider(actionId, eventType, buttonText, "facebook", authType, componentVariant)) {
|
|
8117
|
-
return /* @__PURE__ */ (0,
|
|
8143
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(FacebookButton_default, { onClick: handleClick, className: options.buttonClassName }, key);
|
|
8118
8144
|
}
|
|
8119
8145
|
if (matchesSocialProvider(actionId, eventType, buttonText, "microsoft", authType, componentVariant)) {
|
|
8120
|
-
return /* @__PURE__ */ (0,
|
|
8146
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(MicrosoftButton_default, { onClick: handleClick, className: options.buttonClassName }, key);
|
|
8121
8147
|
}
|
|
8122
8148
|
if (matchesSocialProvider(actionId, eventType, buttonText, "linkedin", authType, componentVariant)) {
|
|
8123
|
-
return /* @__PURE__ */ (0,
|
|
8149
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(LinkedInButton_default, { onClick: handleClick, className: options.buttonClassName }, key);
|
|
8124
8150
|
}
|
|
8125
8151
|
if (matchesSocialProvider(actionId, eventType, buttonText, "ethereum", authType, componentVariant)) {
|
|
8126
|
-
return /* @__PURE__ */ (0,
|
|
8152
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(SignInWithEthereumButton_default, { onClick: handleClick, className: options.buttonClassName }, key);
|
|
8127
8153
|
}
|
|
8128
8154
|
if (actionId === "prompt_mobile" || eventType === "prompt_mobile") {
|
|
8129
|
-
return /* @__PURE__ */ (0,
|
|
8155
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(SmsOtpButton_default, { onClick: handleClick, className: options.buttonClassName }, key);
|
|
8130
8156
|
}
|
|
8131
|
-
const startIconEl = component.startIcon ? /* @__PURE__ */ (0,
|
|
8157
|
+
const startIconEl = component.startIcon ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
8132
8158
|
"img",
|
|
8133
8159
|
{
|
|
8134
8160
|
src: component.startIcon,
|
|
@@ -8137,7 +8163,7 @@ var createAuthComponentFromFlow = (component, formValues, touchedFields, formErr
|
|
|
8137
8163
|
style: { height: "1.25em", objectFit: "contain", width: "1.25em" }
|
|
8138
8164
|
}
|
|
8139
8165
|
) : null;
|
|
8140
|
-
const endIconEl = component.endIcon ? /* @__PURE__ */ (0,
|
|
8166
|
+
const endIconEl = component.endIcon ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
8141
8167
|
"img",
|
|
8142
8168
|
{
|
|
8143
8169
|
src: component.endIcon,
|
|
@@ -8146,7 +8172,7 @@ var createAuthComponentFromFlow = (component, formValues, touchedFields, formErr
|
|
|
8146
8172
|
style: { height: "1.25em", objectFit: "contain", width: "1.25em" }
|
|
8147
8173
|
}
|
|
8148
8174
|
) : null;
|
|
8149
|
-
return /* @__PURE__ */ (0,
|
|
8175
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
8150
8176
|
Button_default,
|
|
8151
8177
|
{
|
|
8152
8178
|
fullWidth: true,
|
|
@@ -8165,10 +8191,10 @@ var createAuthComponentFromFlow = (component, formValues, touchedFields, formErr
|
|
|
8165
8191
|
}
|
|
8166
8192
|
case import_browser50.EmbeddedFlowComponentTypeV2.Text: {
|
|
8167
8193
|
const variant = getTypographyVariant(component.variant);
|
|
8168
|
-
return /* @__PURE__ */ (0,
|
|
8194
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Typography_default, { variant, children: resolve(component.label) }, key);
|
|
8169
8195
|
}
|
|
8170
8196
|
case import_browser50.EmbeddedFlowComponentTypeV2.Divider: {
|
|
8171
|
-
return /* @__PURE__ */ (0,
|
|
8197
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Divider_default, { children: resolve(component.label) || "" }, key);
|
|
8172
8198
|
}
|
|
8173
8199
|
case import_browser50.EmbeddedFlowComponentTypeV2.Select: {
|
|
8174
8200
|
const identifier = component.ref;
|
|
@@ -8179,7 +8205,7 @@ var createAuthComponentFromFlow = (component, formValues, touchedFields, formErr
|
|
|
8179
8205
|
label: typeof opt === "string" ? opt : String(opt.label ?? opt.value ?? ""),
|
|
8180
8206
|
value: typeof opt === "string" ? opt : String(opt.value ?? "")
|
|
8181
8207
|
}));
|
|
8182
|
-
return /* @__PURE__ */ (0,
|
|
8208
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
8183
8209
|
Select_default,
|
|
8184
8210
|
{
|
|
8185
8211
|
name: identifier,
|
|
@@ -8214,12 +8240,12 @@ var createAuthComponentFromFlow = (component, formValues, touchedFields, formErr
|
|
|
8214
8240
|
}
|
|
8215
8241
|
)
|
|
8216
8242
|
).filter(Boolean);
|
|
8217
|
-
return /* @__PURE__ */ (0,
|
|
8243
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("form", { id: component.id, children: blockComponents }, key);
|
|
8218
8244
|
}
|
|
8219
8245
|
return null;
|
|
8220
8246
|
}
|
|
8221
8247
|
case import_browser50.EmbeddedFlowComponentTypeV2.RichText: {
|
|
8222
|
-
return /* @__PURE__ */ (0,
|
|
8248
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
8223
8249
|
"div",
|
|
8224
8250
|
{
|
|
8225
8251
|
className: richTextClass,
|
|
@@ -8229,15 +8255,17 @@ var createAuthComponentFromFlow = (component, formValues, touchedFields, formErr
|
|
|
8229
8255
|
);
|
|
8230
8256
|
}
|
|
8231
8257
|
case import_browser50.EmbeddedFlowComponentTypeV2.Image: {
|
|
8232
|
-
|
|
8258
|
+
const explicitHeight = resolve(component.height?.toString());
|
|
8259
|
+
const explicitWidth = resolve(component.width?.toString());
|
|
8260
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
8233
8261
|
ImageComponent_default,
|
|
8234
8262
|
{
|
|
8235
8263
|
component: {
|
|
8236
8264
|
config: {
|
|
8237
8265
|
alt: resolve(component.alt) || resolve(component.label) || "Image",
|
|
8238
|
-
height:
|
|
8266
|
+
height: explicitHeight || (options.inStack ? "50" : "auto"),
|
|
8239
8267
|
src: resolve(component.src),
|
|
8240
|
-
width:
|
|
8268
|
+
width: explicitWidth || (options.inStack ? "50" : "100%")
|
|
8241
8269
|
}
|
|
8242
8270
|
},
|
|
8243
8271
|
formErrors: void 0,
|
|
@@ -8259,7 +8287,7 @@ var createAuthComponentFromFlow = (component, formValues, touchedFields, formErr
|
|
|
8259
8287
|
logger5.warn(`Unknown icon name: "${iconName}". Skipping render.`);
|
|
8260
8288
|
return null;
|
|
8261
8289
|
}
|
|
8262
|
-
return /* @__PURE__ */ (0,
|
|
8290
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(IconComponent, { size: component.size || 24, color: component.color || "currentColor" }, key);
|
|
8263
8291
|
}
|
|
8264
8292
|
case import_browser50.EmbeddedFlowComponentTypeV2.Stack: {
|
|
8265
8293
|
const direction = component.direction || "row";
|
|
@@ -8286,11 +8314,12 @@ var createAuthComponentFromFlow = (component, formValues, touchedFields, formErr
|
|
|
8286
8314
|
authType,
|
|
8287
8315
|
{
|
|
8288
8316
|
...options,
|
|
8317
|
+
inStack: true,
|
|
8289
8318
|
key: childComponent.id || `${component.id}_${index}`
|
|
8290
8319
|
}
|
|
8291
8320
|
)
|
|
8292
8321
|
) : [];
|
|
8293
|
-
return /* @__PURE__ */ (0,
|
|
8322
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { style: stackStyle, children: stackChildren }, key);
|
|
8294
8323
|
}
|
|
8295
8324
|
default:
|
|
8296
8325
|
logger5.warn(`Unsupported component type: ${component.type}. Skipping render.`);
|
|
@@ -8347,7 +8376,7 @@ var renderInviteUserComponents = (components, formValues, touchedFields, formErr
|
|
|
8347
8376
|
).filter(Boolean);
|
|
8348
8377
|
|
|
8349
8378
|
// src/components/presentation/auth/SignIn/v2/BaseSignIn.tsx
|
|
8350
|
-
var
|
|
8379
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
8351
8380
|
var BaseSignInContent2 = ({
|
|
8352
8381
|
components = [],
|
|
8353
8382
|
onSubmit,
|
|
@@ -8555,13 +8584,13 @@ var BaseSignInContent2 = ({
|
|
|
8555
8584
|
},
|
|
8556
8585
|
values: formValues
|
|
8557
8586
|
};
|
|
8558
|
-
return /* @__PURE__ */ (0,
|
|
8587
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: containerClasses, "data-testid": "asgardeo-signin", children: children(renderProps) });
|
|
8559
8588
|
}
|
|
8560
8589
|
if (isLoading) {
|
|
8561
|
-
return /* @__PURE__ */ (0,
|
|
8590
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Card_default, { className: (0, import_css37.cx)(containerClasses, styles.card), "data-testid": "asgardeo-signin", variant, children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Card_default.Content, { children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { style: { display: "flex", justifyContent: "center", padding: "2rem" }, children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Spinner_default, {}) }) }) });
|
|
8562
8591
|
}
|
|
8563
8592
|
if (!components || components.length === 0) {
|
|
8564
|
-
return /* @__PURE__ */ (0,
|
|
8593
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Card_default, { className: (0, import_css37.cx)(containerClasses, styles.card), "data-testid": "asgardeo-signin", variant, children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Card_default.Content, { children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Alert_default, { variant: "warning", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Typography_default, { variant: "body1", children: t("errors.signin.components.not.available") }) }) }) });
|
|
8565
8594
|
}
|
|
8566
8595
|
const {
|
|
8567
8596
|
title: rawTitle,
|
|
@@ -8570,46 +8599,46 @@ var BaseSignInContent2 = ({
|
|
|
8570
8599
|
} = getAuthComponentHeadings_default(components, flowTitle, flowSubtitle, void 0, void 0);
|
|
8571
8600
|
const title = (0, import_browser51.resolveVars)(rawTitle, { meta, t });
|
|
8572
8601
|
const subtitle = (0, import_browser51.resolveVars)(rawSubtitle, { meta, t });
|
|
8573
|
-
return /* @__PURE__ */ (0,
|
|
8574
|
-
(showTitle || showSubtitle) && /* @__PURE__ */ (0,
|
|
8575
|
-
showTitle && /* @__PURE__ */ (0,
|
|
8576
|
-
showSubtitle && /* @__PURE__ */ (0,
|
|
8602
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(Card_default, { className: (0, import_css37.cx)(containerClasses, styles.card), "data-testid": "asgardeo-signin", variant, children: [
|
|
8603
|
+
(showTitle || showSubtitle) && /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(Card_default.Header, { className: styles.header, children: [
|
|
8604
|
+
showTitle && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Card_default.Title, { level: 2, className: styles.title, children: title }),
|
|
8605
|
+
showSubtitle && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Typography_default, { variant: "body1", className: styles.subtitle, children: subtitle })
|
|
8577
8606
|
] }),
|
|
8578
|
-
/* @__PURE__ */ (0,
|
|
8579
|
-
externalError && /* @__PURE__ */ (0,
|
|
8580
|
-
flowMessages && flowMessages.length > 0 && /* @__PURE__ */ (0,
|
|
8607
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(Card_default.Content, { children: [
|
|
8608
|
+
externalError && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: styles.flowMessagesContainer, children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Alert_default, { variant: "error", className: (0, import_css37.cx)(styles.flowMessageItem, messageClasses), children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Alert_default.Description, { children: externalError.message }) }) }),
|
|
8609
|
+
flowMessages && flowMessages.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: styles.flowMessagesContainer, children: flowMessages.map((message, index) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
8581
8610
|
Alert_default,
|
|
8582
8611
|
{
|
|
8583
8612
|
variant: message.type === "error" ? "error" : "info",
|
|
8584
8613
|
className: (0, import_css37.cx)(styles.flowMessageItem, messageClasses),
|
|
8585
|
-
children: /* @__PURE__ */ (0,
|
|
8614
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Alert_default.Description, { children: message.message })
|
|
8586
8615
|
},
|
|
8587
8616
|
index
|
|
8588
8617
|
)) }),
|
|
8589
|
-
/* @__PURE__ */ (0,
|
|
8618
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: styles.contentContainer, children: componentsWithoutHeadings && renderComponents(componentsWithoutHeadings) })
|
|
8590
8619
|
] })
|
|
8591
8620
|
] });
|
|
8592
8621
|
};
|
|
8593
8622
|
var BaseSignIn2 = ({ preferences, showLogo = true, ...rest }) => {
|
|
8594
8623
|
const { theme } = useTheme_default();
|
|
8595
8624
|
const styles = BaseSignIn_styles_default(theme, theme.vars.colors.text.primary);
|
|
8596
|
-
const content = /* @__PURE__ */ (0,
|
|
8597
|
-
showLogo && /* @__PURE__ */ (0,
|
|
8598
|
-
/* @__PURE__ */ (0,
|
|
8625
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { children: [
|
|
8626
|
+
showLogo && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: styles.logoContainer, children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Logo_default, { size: "large" }) }),
|
|
8627
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(FlowProvider_default, { children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(BaseSignInContent2, { showLogo, ...rest }) })
|
|
8599
8628
|
] });
|
|
8600
8629
|
if (!preferences) return content;
|
|
8601
|
-
return /* @__PURE__ */ (0,
|
|
8630
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(ComponentPreferencesContext_default.Provider, { value: preferences, children: content });
|
|
8602
8631
|
};
|
|
8603
8632
|
var BaseSignIn_default2 = BaseSignIn2;
|
|
8604
8633
|
|
|
8605
8634
|
// src/components/presentation/auth/SignIn/BaseSignIn.tsx
|
|
8606
|
-
var
|
|
8635
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
8607
8636
|
var BaseSignIn3 = (props) => {
|
|
8608
8637
|
const { platform } = useAsgardeo_default();
|
|
8609
8638
|
if (platform === import_browser52.Platform.AsgardeoV2) {
|
|
8610
|
-
return /* @__PURE__ */ (0,
|
|
8639
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(BaseSignIn_default2, { ...props });
|
|
8611
8640
|
}
|
|
8612
|
-
return /* @__PURE__ */ (0,
|
|
8641
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(BaseSignIn_default, { ...props });
|
|
8613
8642
|
};
|
|
8614
8643
|
var BaseSignIn_default3 = BaseSignIn3;
|
|
8615
8644
|
|
|
@@ -8894,7 +8923,7 @@ var handlePasskeyAuthentication = async (challengeData) => {
|
|
|
8894
8923
|
};
|
|
8895
8924
|
|
|
8896
8925
|
// src/components/presentation/auth/SignIn/v2/SignIn.tsx
|
|
8897
|
-
var
|
|
8926
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
8898
8927
|
var SignIn = ({
|
|
8899
8928
|
className,
|
|
8900
8929
|
preferences,
|
|
@@ -9231,9 +9260,9 @@ var SignIn = ({
|
|
|
9231
9260
|
meta,
|
|
9232
9261
|
onSubmit: handleSubmit
|
|
9233
9262
|
};
|
|
9234
|
-
return /* @__PURE__ */ (0,
|
|
9263
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_jsx_runtime66.Fragment, { children: children(renderProps) });
|
|
9235
9264
|
}
|
|
9236
|
-
return /* @__PURE__ */ (0,
|
|
9265
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
9237
9266
|
BaseSignIn_default2,
|
|
9238
9267
|
{
|
|
9239
9268
|
components,
|
|
@@ -9251,7 +9280,7 @@ var SignIn = ({
|
|
|
9251
9280
|
var SignIn_default = SignIn;
|
|
9252
9281
|
|
|
9253
9282
|
// src/components/presentation/auth/SignIn/SignIn.tsx
|
|
9254
|
-
var
|
|
9283
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
9255
9284
|
var SignIn2 = ({ className, size = "medium", children, preferences, ...rest }) => {
|
|
9256
9285
|
const { signIn, afterSignInUrl, isInitialized, isLoading, platform } = useAsgardeo_default();
|
|
9257
9286
|
const handleInitialize = async () => await signIn({ response_mode: "direct" });
|
|
@@ -9268,7 +9297,7 @@ var SignIn2 = ({ className, size = "medium", children, preferences, ...rest }) =
|
|
|
9268
9297
|
}
|
|
9269
9298
|
};
|
|
9270
9299
|
if (platform === import_browser56.Platform.AsgardeoV2) {
|
|
9271
|
-
return /* @__PURE__ */ (0,
|
|
9300
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
9272
9301
|
SignIn_default,
|
|
9273
9302
|
{
|
|
9274
9303
|
className,
|
|
@@ -9281,7 +9310,7 @@ var SignIn2 = ({ className, size = "medium", children, preferences, ...rest }) =
|
|
|
9281
9310
|
}
|
|
9282
9311
|
);
|
|
9283
9312
|
}
|
|
9284
|
-
return /* @__PURE__ */ (0,
|
|
9313
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
9285
9314
|
BaseSignIn_default3,
|
|
9286
9315
|
{
|
|
9287
9316
|
isLoading: isLoading || !isInitialized,
|
|
@@ -9369,13 +9398,13 @@ var DateInput = ({
|
|
|
9369
9398
|
var DateInput_default = DateInput;
|
|
9370
9399
|
|
|
9371
9400
|
// src/components/adapters/DividerComponent.tsx
|
|
9372
|
-
var
|
|
9401
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
9373
9402
|
var DividerComponent = ({ component }) => {
|
|
9374
9403
|
const { theme } = useTheme_default();
|
|
9375
9404
|
const config = component.config || {};
|
|
9376
9405
|
const text = config["text"] || "";
|
|
9377
9406
|
const variant = component.variant?.toLowerCase() || "horizontal";
|
|
9378
|
-
return /* @__PURE__ */ (0,
|
|
9407
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
9379
9408
|
Divider_default,
|
|
9380
9409
|
{
|
|
9381
9410
|
orientation: variant === "vertical" ? "vertical" : "horizontal",
|
|
@@ -9416,7 +9445,7 @@ var EmailInput = ({
|
|
|
9416
9445
|
var EmailInput_default = EmailInput;
|
|
9417
9446
|
|
|
9418
9447
|
// src/components/adapters/FormContainer.tsx
|
|
9419
|
-
var
|
|
9448
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
9420
9449
|
var FormContainer = (props) => {
|
|
9421
9450
|
const { component } = props;
|
|
9422
9451
|
if (component.components && component.components.length > 0) {
|
|
@@ -9429,14 +9458,14 @@ var FormContainer = (props) => {
|
|
|
9429
9458
|
props.onSubmit(submitButton, props.formValues);
|
|
9430
9459
|
}
|
|
9431
9460
|
};
|
|
9432
|
-
return /* @__PURE__ */ (0,
|
|
9461
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("form", { onSubmit: handleFormSubmit, style: { display: "flex", flexDirection: "column" }, children: component.components.map(
|
|
9433
9462
|
(childComponent) => createSignUpComponent({
|
|
9434
9463
|
...props,
|
|
9435
9464
|
component: childComponent
|
|
9436
9465
|
})
|
|
9437
9466
|
) }, component.id);
|
|
9438
9467
|
}
|
|
9439
|
-
return /* @__PURE__ */ (0,
|
|
9468
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", {}, component.id);
|
|
9440
9469
|
};
|
|
9441
9470
|
var FormContainer_default = FormContainer;
|
|
9442
9471
|
|
|
@@ -9562,7 +9591,7 @@ var SelectInput = ({
|
|
|
9562
9591
|
var SelectInput_default = SelectInput;
|
|
9563
9592
|
|
|
9564
9593
|
// src/components/adapters/SubmitButton.tsx
|
|
9565
|
-
var
|
|
9594
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
9566
9595
|
var ButtonComponent = ({
|
|
9567
9596
|
component,
|
|
9568
9597
|
isLoading,
|
|
@@ -9584,6 +9613,7 @@ var ButtonComponent = ({
|
|
|
9584
9613
|
case "TEXT":
|
|
9585
9614
|
return { color: "primary", variant: "text" };
|
|
9586
9615
|
case "SOCIAL":
|
|
9616
|
+
case "OUTLINED":
|
|
9587
9617
|
return { color: "primary", variant: "outline" };
|
|
9588
9618
|
default:
|
|
9589
9619
|
return { color: "primary", variant: "solid" };
|
|
@@ -9595,7 +9625,7 @@ var ButtonComponent = ({
|
|
|
9595
9625
|
onSubmit(component);
|
|
9596
9626
|
}
|
|
9597
9627
|
};
|
|
9598
|
-
return /* @__PURE__ */ (0,
|
|
9628
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
9599
9629
|
Button_default,
|
|
9600
9630
|
{
|
|
9601
9631
|
type: buttonType === "submit" ? "submit" : "button",
|
|
@@ -9606,7 +9636,7 @@ var ButtonComponent = ({
|
|
|
9606
9636
|
onClick: buttonType !== "submit" ? handleClick : void 0,
|
|
9607
9637
|
className: buttonClassName,
|
|
9608
9638
|
style: { width: "100%" },
|
|
9609
|
-
children: isLoading ? /* @__PURE__ */ (0,
|
|
9639
|
+
children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(Spinner_default, { size: "small" }) : buttonText
|
|
9610
9640
|
},
|
|
9611
9641
|
component.id
|
|
9612
9642
|
);
|
|
@@ -9614,7 +9644,7 @@ var ButtonComponent = ({
|
|
|
9614
9644
|
var SubmitButton_default = ButtonComponent;
|
|
9615
9645
|
|
|
9616
9646
|
// src/components/adapters/TelephoneInput.tsx
|
|
9617
|
-
var
|
|
9647
|
+
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
9618
9648
|
var TelephoneInput = ({
|
|
9619
9649
|
component,
|
|
9620
9650
|
formValues,
|
|
@@ -9627,7 +9657,7 @@ var TelephoneInput = ({
|
|
|
9627
9657
|
const fieldName = config["identifier"] || config["name"] || component.id;
|
|
9628
9658
|
const value = formValues[fieldName] || "";
|
|
9629
9659
|
const error = touchedFields[fieldName] ? formErrors[fieldName] : void 0;
|
|
9630
|
-
return /* @__PURE__ */ (0,
|
|
9660
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
9631
9661
|
TextField_default,
|
|
9632
9662
|
{
|
|
9633
9663
|
name: fieldName,
|
|
@@ -9675,7 +9705,7 @@ var TextInput = ({
|
|
|
9675
9705
|
var TextInput_default = TextInput;
|
|
9676
9706
|
|
|
9677
9707
|
// src/components/adapters/Typography.tsx
|
|
9678
|
-
var
|
|
9708
|
+
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
9679
9709
|
var TypographyComponent = ({ component }) => {
|
|
9680
9710
|
const { theme } = useTheme_default();
|
|
9681
9711
|
const config = component.config || {};
|
|
@@ -9716,7 +9746,7 @@ var TypographyComponent = ({ component }) => {
|
|
|
9716
9746
|
default:
|
|
9717
9747
|
typographyVariant = "body1";
|
|
9718
9748
|
}
|
|
9719
|
-
return /* @__PURE__ */ (0,
|
|
9749
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
9720
9750
|
Typography_default,
|
|
9721
9751
|
{
|
|
9722
9752
|
variant: typographyVariant,
|
|
@@ -9729,69 +9759,69 @@ var TypographyComponent = ({ component }) => {
|
|
|
9729
9759
|
var Typography_default2 = TypographyComponent;
|
|
9730
9760
|
|
|
9731
9761
|
// src/components/presentation/auth/SignUp/v1/SignUpOptionFactory.tsx
|
|
9732
|
-
var
|
|
9762
|
+
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
9733
9763
|
var createSignUpComponent = ({ component, onSubmit, ...rest }) => {
|
|
9734
9764
|
switch (component.type) {
|
|
9735
9765
|
case import_browser64.EmbeddedFlowComponentType.Typography:
|
|
9736
|
-
return /* @__PURE__ */ (0,
|
|
9766
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Typography_default2, { component, onSubmit, ...rest });
|
|
9737
9767
|
case import_browser64.EmbeddedFlowComponentType.Input: {
|
|
9738
9768
|
const inputVariant = component.variant?.toUpperCase();
|
|
9739
9769
|
const inputType = component.config["type"]?.toLowerCase();
|
|
9740
9770
|
if (inputVariant === "EMAIL" || inputType === "email") {
|
|
9741
|
-
return /* @__PURE__ */ (0,
|
|
9771
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(EmailInput_default, { component, onSubmit, ...rest });
|
|
9742
9772
|
}
|
|
9743
9773
|
if (inputVariant === "PASSWORD" || inputType === "password") {
|
|
9744
|
-
return /* @__PURE__ */ (0,
|
|
9774
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(PasswordInput_default, { component, onSubmit, ...rest });
|
|
9745
9775
|
}
|
|
9746
9776
|
if (inputVariant === "TELEPHONE" || inputType === "tel") {
|
|
9747
|
-
return /* @__PURE__ */ (0,
|
|
9777
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(TelephoneInput_default, { component, onSubmit, ...rest });
|
|
9748
9778
|
}
|
|
9749
9779
|
if (inputVariant === "NUMBER" || inputType === "number") {
|
|
9750
|
-
return /* @__PURE__ */ (0,
|
|
9780
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(NumberInput_default, { component, onSubmit, ...rest });
|
|
9751
9781
|
}
|
|
9752
9782
|
if (inputVariant === "DATE" || inputType === "date") {
|
|
9753
|
-
return /* @__PURE__ */ (0,
|
|
9783
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(DateInput_default, { component, onSubmit, ...rest });
|
|
9754
9784
|
}
|
|
9755
9785
|
if (inputVariant === "CHECKBOX" || inputType === "checkbox") {
|
|
9756
|
-
return /* @__PURE__ */ (0,
|
|
9786
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(CheckboxInput_default, { component, onSubmit, ...rest });
|
|
9757
9787
|
}
|
|
9758
|
-
return /* @__PURE__ */ (0,
|
|
9788
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(TextInput_default, { component, onSubmit, ...rest });
|
|
9759
9789
|
}
|
|
9760
9790
|
case import_browser64.EmbeddedFlowComponentType.Button: {
|
|
9761
9791
|
const buttonVariant = component.variant?.toUpperCase();
|
|
9762
9792
|
const buttonText = component.config["text"] || component.config["label"] || "";
|
|
9763
9793
|
if (buttonVariant === "SOCIAL") {
|
|
9764
9794
|
if (buttonText.toLowerCase().includes("google")) {
|
|
9765
|
-
return /* @__PURE__ */ (0,
|
|
9795
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(GoogleButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
|
|
9766
9796
|
}
|
|
9767
9797
|
if (buttonText.toLowerCase().includes("github")) {
|
|
9768
|
-
return /* @__PURE__ */ (0,
|
|
9798
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(GitHubButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
|
|
9769
9799
|
}
|
|
9770
9800
|
if (buttonText.toLowerCase().includes("microsoft")) {
|
|
9771
|
-
return /* @__PURE__ */ (0,
|
|
9801
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(MicrosoftButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
|
|
9772
9802
|
}
|
|
9773
9803
|
if (buttonText.toLowerCase().includes("facebook")) {
|
|
9774
|
-
return /* @__PURE__ */ (0,
|
|
9804
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(FacebookButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
|
|
9775
9805
|
}
|
|
9776
9806
|
if (buttonText.toLowerCase().includes("linkedin")) {
|
|
9777
|
-
return /* @__PURE__ */ (0,
|
|
9807
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(LinkedInButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
|
|
9778
9808
|
}
|
|
9779
9809
|
if (buttonText.toLowerCase().includes("ethereum")) {
|
|
9780
|
-
return /* @__PURE__ */ (0,
|
|
9810
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(SignInWithEthereumButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
|
|
9781
9811
|
}
|
|
9782
9812
|
}
|
|
9783
|
-
return /* @__PURE__ */ (0,
|
|
9813
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(SubmitButton_default, { component, onSubmit, ...rest });
|
|
9784
9814
|
}
|
|
9785
9815
|
case import_browser64.EmbeddedFlowComponentType.Form:
|
|
9786
|
-
return /* @__PURE__ */ (0,
|
|
9816
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(FormContainer_default, { component, onSubmit, ...rest });
|
|
9787
9817
|
case import_browser64.EmbeddedFlowComponentType.Select:
|
|
9788
|
-
return /* @__PURE__ */ (0,
|
|
9818
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(SelectInput_default, { component, onSubmit, ...rest });
|
|
9789
9819
|
case import_browser64.EmbeddedFlowComponentType.Divider:
|
|
9790
|
-
return /* @__PURE__ */ (0,
|
|
9820
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(DividerComponent_default, { component, onSubmit, ...rest });
|
|
9791
9821
|
case import_browser64.EmbeddedFlowComponentType.Image:
|
|
9792
|
-
return /* @__PURE__ */ (0,
|
|
9822
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(ImageComponent_default, { component, onSubmit, ...rest });
|
|
9793
9823
|
default:
|
|
9794
|
-
return /* @__PURE__ */ (0,
|
|
9824
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", {});
|
|
9795
9825
|
}
|
|
9796
9826
|
};
|
|
9797
9827
|
var createSignUpOptionFromComponent = (component, formValues, touchedFields, formErrors, isLoading, isFormValid, onInputChange, options) => createSignUpComponent({
|
|
@@ -9960,7 +9990,7 @@ var useStyles17 = (theme, colorScheme) => (0, import_react66.useMemo)(() => {
|
|
|
9960
9990
|
var BaseSignUp_styles_default = useStyles17;
|
|
9961
9991
|
|
|
9962
9992
|
// src/components/presentation/auth/SignUp/v1/BaseSignUp.tsx
|
|
9963
|
-
var
|
|
9993
|
+
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
9964
9994
|
var logger6 = (0, import_browser65.createPackageComponentLogger)(
|
|
9965
9995
|
"@asgardeo/react",
|
|
9966
9996
|
"BaseSignUp"
|
|
@@ -10363,42 +10393,42 @@ var BaseSignUpContent = ({
|
|
|
10363
10393
|
validateForm,
|
|
10364
10394
|
values: formValues
|
|
10365
10395
|
};
|
|
10366
|
-
return /* @__PURE__ */ (0,
|
|
10396
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: containerClasses, children: children(renderProps) });
|
|
10367
10397
|
}
|
|
10368
10398
|
if (!isFlowInitialized && isLoading) {
|
|
10369
|
-
return /* @__PURE__ */ (0,
|
|
10399
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Card_default, { className: (0, import_css39.cx)(containerClasses, styles.card), variant, children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Card_default.Content, { children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: styles.loadingContainer, children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Spinner_default, { size: "medium" }) }) }) });
|
|
10370
10400
|
}
|
|
10371
10401
|
if (!currentFlow) {
|
|
10372
|
-
return /* @__PURE__ */ (0,
|
|
10373
|
-
/* @__PURE__ */ (0,
|
|
10374
|
-
/* @__PURE__ */ (0,
|
|
10402
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Card_default, { className: (0, import_css39.cx)(containerClasses, styles.card), variant, children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Card_default.Content, { children: /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(Alert_default, { variant: "error", className: errorClasses, children: [
|
|
10403
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Alert_default.Title, { children: t("errors.heading") }),
|
|
10404
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Alert_default.Description, { children: t("errors.signup.flow.initialization.failure") })
|
|
10375
10405
|
] }) }) });
|
|
10376
10406
|
}
|
|
10377
|
-
return /* @__PURE__ */ (0,
|
|
10378
|
-
(showTitle || showSubtitle) && /* @__PURE__ */ (0,
|
|
10379
|
-
showTitle && /* @__PURE__ */ (0,
|
|
10380
|
-
showSubtitle && /* @__PURE__ */ (0,
|
|
10407
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(Card_default, { className: (0, import_css39.cx)(containerClasses, styles.card), variant, children: [
|
|
10408
|
+
(showTitle || showSubtitle) && /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(Card_default.Header, { className: styles.header, children: [
|
|
10409
|
+
showTitle && /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Card_default.Title, { level: 2, className: styles.title, children: flowTitle || t("signup.heading") }),
|
|
10410
|
+
showSubtitle && /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Typography_default, { variant: "body1", className: styles.subtitle, children: flowSubtitle || t("signup.subheading") })
|
|
10381
10411
|
] }),
|
|
10382
|
-
/* @__PURE__ */ (0,
|
|
10383
|
-
flowMessages && flowMessages.length > 0 && /* @__PURE__ */ (0,
|
|
10412
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(Card_default.Content, { children: [
|
|
10413
|
+
flowMessages && flowMessages.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: styles.flowMessagesContainer, children: flowMessages.map((message, index) => /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
10384
10414
|
Alert_default,
|
|
10385
10415
|
{
|
|
10386
10416
|
variant: message.type?.toLowerCase() === "error" ? "error" : "info",
|
|
10387
10417
|
className: (0, import_css39.cx)(styles.flowMessageItem, messageClasses),
|
|
10388
|
-
children: /* @__PURE__ */ (0,
|
|
10418
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Alert_default.Description, { children: message.message })
|
|
10389
10419
|
},
|
|
10390
10420
|
message.id || index
|
|
10391
10421
|
)) }),
|
|
10392
|
-
/* @__PURE__ */ (0,
|
|
10422
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: styles.contentContainer, children: currentFlow.data?.components && currentFlow.data.components.length > 0 ? renderComponents(currentFlow.data.components) : /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Alert_default, { variant: "warning", children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Typography_default, { variant: "body1", children: t("errors.signup.components.not.available") }) }) })
|
|
10393
10423
|
] })
|
|
10394
10424
|
] });
|
|
10395
10425
|
};
|
|
10396
10426
|
var BaseSignUp = ({ showLogo = true, ...rest }) => {
|
|
10397
10427
|
const { theme, colorScheme } = useTheme_default();
|
|
10398
10428
|
const styles = BaseSignUp_styles_default(theme, colorScheme);
|
|
10399
|
-
return /* @__PURE__ */ (0,
|
|
10400
|
-
showLogo && /* @__PURE__ */ (0,
|
|
10401
|
-
/* @__PURE__ */ (0,
|
|
10429
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { children: [
|
|
10430
|
+
showLogo && /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: styles.logoContainer, children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Logo_default, { size: "large" }) }),
|
|
10431
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(FlowProvider_default, { children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(BaseSignUpContent, { showLogo, ...rest }) })
|
|
10402
10432
|
] });
|
|
10403
10433
|
};
|
|
10404
10434
|
var BaseSignUp_default = BaseSignUp;
|
|
@@ -10407,7 +10437,7 @@ var BaseSignUp_default = BaseSignUp;
|
|
|
10407
10437
|
var import_browser66 = require("@asgardeo/browser");
|
|
10408
10438
|
var import_css40 = require("@emotion/css");
|
|
10409
10439
|
var import_react68 = require("react");
|
|
10410
|
-
var
|
|
10440
|
+
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
10411
10441
|
var logger7 = (0, import_browser66.createPackageComponentLogger)(
|
|
10412
10442
|
"@asgardeo/react",
|
|
10413
10443
|
"BaseSignUp"
|
|
@@ -10911,15 +10941,15 @@ var BaseSignUpContent2 = ({
|
|
|
10911
10941
|
},
|
|
10912
10942
|
values: formValues
|
|
10913
10943
|
};
|
|
10914
|
-
return /* @__PURE__ */ (0,
|
|
10944
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { className: containerClasses, children: children(renderProps) });
|
|
10915
10945
|
}
|
|
10916
10946
|
if (!isFlowInitialized && isLoading) {
|
|
10917
|
-
return /* @__PURE__ */ (0,
|
|
10947
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Card_default, { className: (0, import_css40.cx)(containerClasses, styles.card), variant, children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Card_default.Content, { children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { className: styles.loadingContainer, children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Spinner_default, { size: "medium" }) }) }) });
|
|
10918
10948
|
}
|
|
10919
10949
|
if (!currentFlow) {
|
|
10920
|
-
return /* @__PURE__ */ (0,
|
|
10921
|
-
/* @__PURE__ */ (0,
|
|
10922
|
-
/* @__PURE__ */ (0,
|
|
10950
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Card_default, { className: (0, import_css40.cx)(containerClasses, styles.card), variant, children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Card_default.Content, { children: /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(Alert_default, { variant: "error", className: errorClasses, children: [
|
|
10951
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Alert_default.Title, { children: t("errors.heading") }),
|
|
10952
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Alert_default.Description, { children: t("errors.signup.flow.initialization.failure") })
|
|
10923
10953
|
] }) }) });
|
|
10924
10954
|
}
|
|
10925
10955
|
const componentsToRender = currentFlow.data?.components || [];
|
|
@@ -10930,46 +10960,46 @@ var BaseSignUpContent2 = ({
|
|
|
10930
10960
|
t("signup.heading"),
|
|
10931
10961
|
t("signup.subheading")
|
|
10932
10962
|
);
|
|
10933
|
-
return /* @__PURE__ */ (0,
|
|
10934
|
-
(showTitle || showSubtitle) && /* @__PURE__ */ (0,
|
|
10935
|
-
showTitle && /* @__PURE__ */ (0,
|
|
10936
|
-
showSubtitle && /* @__PURE__ */ (0,
|
|
10963
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(Card_default, { className: (0, import_css40.cx)(containerClasses, styles.card), variant, children: [
|
|
10964
|
+
(showTitle || showSubtitle) && /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(Card_default.Header, { className: styles.header, children: [
|
|
10965
|
+
showTitle && /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Card_default.Title, { level: 2, className: styles.title, children: title }),
|
|
10966
|
+
showSubtitle && /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Typography_default, { variant: "body1", className: styles.subtitle, children: subtitle })
|
|
10937
10967
|
] }),
|
|
10938
|
-
/* @__PURE__ */ (0,
|
|
10939
|
-
externalError && /* @__PURE__ */ (0,
|
|
10940
|
-
flowMessages && flowMessages.length > 0 && /* @__PURE__ */ (0,
|
|
10968
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(Card_default.Content, { children: [
|
|
10969
|
+
externalError && /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { className: styles.flowMessagesContainer, children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Alert_default, { variant: "error", className: (0, import_css40.cx)(styles.flowMessageItem, messageClasses), children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Alert_default.Description, { children: externalError.message }) }) }),
|
|
10970
|
+
flowMessages && flowMessages.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { className: styles.flowMessagesContainer, children: flowMessages.map((message, index) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
10941
10971
|
Alert_default,
|
|
10942
10972
|
{
|
|
10943
10973
|
variant: message.type?.toLowerCase() === "error" ? "error" : "info",
|
|
10944
10974
|
className: (0, import_css40.cx)(styles.flowMessageItem, messageClasses),
|
|
10945
|
-
children: /* @__PURE__ */ (0,
|
|
10975
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Alert_default.Description, { children: message.message })
|
|
10946
10976
|
},
|
|
10947
10977
|
message.id || index
|
|
10948
10978
|
)) }),
|
|
10949
|
-
/* @__PURE__ */ (0,
|
|
10979
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { className: styles.contentContainer, children: componentsWithoutHeadings && componentsWithoutHeadings.length > 0 ? renderComponents(componentsWithoutHeadings) : /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Alert_default, { variant: "warning", children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Typography_default, { variant: "body1", children: t("errors.signup.components.not.available") }) }) })
|
|
10950
10980
|
] })
|
|
10951
10981
|
] });
|
|
10952
10982
|
};
|
|
10953
10983
|
var BaseSignUp2 = ({ preferences, showLogo = true, ...rest }) => {
|
|
10954
10984
|
const { theme, colorScheme } = useTheme_default();
|
|
10955
10985
|
const styles = BaseSignUp_styles_default(theme, colorScheme);
|
|
10956
|
-
const content = /* @__PURE__ */ (0,
|
|
10957
|
-
showLogo && /* @__PURE__ */ (0,
|
|
10958
|
-
/* @__PURE__ */ (0,
|
|
10986
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("div", { children: [
|
|
10987
|
+
showLogo && /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { className: styles.logoContainer, children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Logo_default, { size: "large" }) }),
|
|
10988
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(FlowProvider_default, { children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(BaseSignUpContent2, { showLogo, ...rest }) })
|
|
10959
10989
|
] });
|
|
10960
10990
|
if (!preferences) return content;
|
|
10961
|
-
return /* @__PURE__ */ (0,
|
|
10991
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ComponentPreferencesContext_default.Provider, { value: preferences, children: content });
|
|
10962
10992
|
};
|
|
10963
10993
|
var BaseSignUp_default2 = BaseSignUp2;
|
|
10964
10994
|
|
|
10965
10995
|
// src/components/presentation/auth/SignUp/BaseSignUp.tsx
|
|
10966
|
-
var
|
|
10996
|
+
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
10967
10997
|
var BaseSignUp3 = (props) => {
|
|
10968
10998
|
const { platform } = useAsgardeo_default();
|
|
10969
10999
|
if (platform === import_browser67.Platform.AsgardeoV2) {
|
|
10970
|
-
return /* @__PURE__ */ (0,
|
|
11000
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(BaseSignUp_default2, { ...props });
|
|
10971
11001
|
}
|
|
10972
|
-
return /* @__PURE__ */ (0,
|
|
11002
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(BaseSignUp_default, { ...props });
|
|
10973
11003
|
};
|
|
10974
11004
|
var BaseSignUp_default3 = BaseSignUp3;
|
|
10975
11005
|
|
|
@@ -10978,7 +11008,7 @@ var import_browser70 = require("@asgardeo/browser");
|
|
|
10978
11008
|
|
|
10979
11009
|
// src/components/presentation/auth/SignUp/v1/SignUp.tsx
|
|
10980
11010
|
var import_browser68 = require("@asgardeo/browser");
|
|
10981
|
-
var
|
|
11011
|
+
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
10982
11012
|
var SignUp = ({
|
|
10983
11013
|
className,
|
|
10984
11014
|
size = "medium",
|
|
@@ -11007,7 +11037,7 @@ var SignUp = ({
|
|
|
11007
11037
|
window.location.href = response.data.redirectURL;
|
|
11008
11038
|
}
|
|
11009
11039
|
};
|
|
11010
|
-
return /* @__PURE__ */ (0,
|
|
11040
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
11011
11041
|
BaseSignUp_default,
|
|
11012
11042
|
{
|
|
11013
11043
|
afterSignUpUrl,
|
|
@@ -11030,7 +11060,7 @@ var SignUp_default = SignUp;
|
|
|
11030
11060
|
|
|
11031
11061
|
// src/components/presentation/auth/SignUp/v2/SignUp.tsx
|
|
11032
11062
|
var import_browser69 = require("@asgardeo/browser");
|
|
11033
|
-
var
|
|
11063
|
+
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
11034
11064
|
var SignUp2 = ({
|
|
11035
11065
|
className,
|
|
11036
11066
|
size = "medium",
|
|
@@ -11068,7 +11098,7 @@ var SignUp2 = ({
|
|
|
11068
11098
|
window.location.href = response.data.redirectURL;
|
|
11069
11099
|
}
|
|
11070
11100
|
};
|
|
11071
|
-
return /* @__PURE__ */ (0,
|
|
11101
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
11072
11102
|
BaseSignUp_default2,
|
|
11073
11103
|
{
|
|
11074
11104
|
afterSignUpUrl,
|
|
@@ -11090,13 +11120,13 @@ var SignUp2 = ({
|
|
|
11090
11120
|
var SignUp_default2 = SignUp2;
|
|
11091
11121
|
|
|
11092
11122
|
// src/components/presentation/auth/SignUp/SignUp.tsx
|
|
11093
|
-
var
|
|
11123
|
+
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
11094
11124
|
var SignUp3 = (props) => {
|
|
11095
11125
|
const { platform } = useAsgardeo_default();
|
|
11096
11126
|
if (platform === import_browser70.Platform.AsgardeoV2) {
|
|
11097
|
-
return /* @__PURE__ */ (0,
|
|
11127
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(SignUp_default2, { ...props });
|
|
11098
11128
|
}
|
|
11099
|
-
return /* @__PURE__ */ (0,
|
|
11129
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(SignUp_default, { ...props });
|
|
11100
11130
|
};
|
|
11101
11131
|
var SignUp_default3 = SignUp3;
|
|
11102
11132
|
|
|
@@ -11149,7 +11179,7 @@ var useStyles18 = (theme, colorScheme) => (0, import_react69.useMemo)(() => {
|
|
|
11149
11179
|
var BaseInviteUser_styles_default = useStyles18;
|
|
11150
11180
|
|
|
11151
11181
|
// src/components/presentation/auth/InviteUser/v2/BaseInviteUser.tsx
|
|
11152
|
-
var
|
|
11182
|
+
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
11153
11183
|
var BaseInviteUser = ({
|
|
11154
11184
|
onInitialize,
|
|
11155
11185
|
onSubmit,
|
|
@@ -11453,28 +11483,28 @@ var BaseInviteUser = ({
|
|
|
11453
11483
|
values: formValues
|
|
11454
11484
|
};
|
|
11455
11485
|
if (children) {
|
|
11456
|
-
return /* @__PURE__ */ (0,
|
|
11486
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className, children: children(renderProps) });
|
|
11457
11487
|
}
|
|
11458
11488
|
if (!isInitialized) {
|
|
11459
|
-
return /* @__PURE__ */ (0,
|
|
11489
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Card_default, { className: (0, import_css42.cx)(className, styles.card), variant, children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Card_default.Content, { children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { style: { display: "flex", justifyContent: "center", padding: "2rem" }, children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Spinner_default, { size: "medium" }) }) }) });
|
|
11460
11490
|
}
|
|
11461
11491
|
if (!isFlowInitialized && isLoading) {
|
|
11462
|
-
return /* @__PURE__ */ (0,
|
|
11492
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Card_default, { className: (0, import_css42.cx)(className, styles.card), variant, children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Card_default.Content, { children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { style: { display: "flex", justifyContent: "center", padding: "2rem" }, children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Spinner_default, { size: "medium" }) }) }) });
|
|
11463
11493
|
}
|
|
11464
11494
|
if (!currentFlow && apiError) {
|
|
11465
|
-
return /* @__PURE__ */ (0,
|
|
11466
|
-
/* @__PURE__ */ (0,
|
|
11467
|
-
/* @__PURE__ */ (0,
|
|
11495
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Card_default, { className: (0, import_css42.cx)(className, styles.card), variant, children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Card_default.Content, { children: /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(Alert_default, { variant: "error", children: [
|
|
11496
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Alert_default.Title, { children: "Error" }),
|
|
11497
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Alert_default.Description, { children: apiError.message })
|
|
11468
11498
|
] }) }) });
|
|
11469
11499
|
}
|
|
11470
11500
|
if (isInviteGenerated && inviteLink) {
|
|
11471
|
-
return /* @__PURE__ */ (0,
|
|
11472
|
-
/* @__PURE__ */ (0,
|
|
11473
|
-
/* @__PURE__ */ (0,
|
|
11474
|
-
/* @__PURE__ */ (0,
|
|
11475
|
-
/* @__PURE__ */ (0,
|
|
11476
|
-
/* @__PURE__ */ (0,
|
|
11477
|
-
/* @__PURE__ */ (0,
|
|
11501
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(Card_default, { className: (0, import_css42.cx)(className, styles.card), variant, children: [
|
|
11502
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Card_default.Header, { className: styles.header, children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Card_default.Title, { level: 2, className: styles.title, children: "Invite Link Generated!" }) }),
|
|
11503
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(Card_default.Content, { children: [
|
|
11504
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Alert_default, { variant: "success", children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Alert_default.Description, { children: "Share this link with the user to complete their registration." }) }),
|
|
11505
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { style: { marginTop: "1rem" }, children: [
|
|
11506
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Typography_default, { variant: "body2", style: { marginBottom: "0.5rem" }, children: "Invite Link" }),
|
|
11507
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(
|
|
11478
11508
|
"div",
|
|
11479
11509
|
{
|
|
11480
11510
|
style: {
|
|
@@ -11487,26 +11517,26 @@ var BaseInviteUser = ({
|
|
|
11487
11517
|
wordBreak: "break-all"
|
|
11488
11518
|
},
|
|
11489
11519
|
children: [
|
|
11490
|
-
/* @__PURE__ */ (0,
|
|
11491
|
-
/* @__PURE__ */ (0,
|
|
11520
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Typography_default, { variant: "body2", style: { flex: 1 }, children: inviteLink }),
|
|
11521
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Button_default, { variant: "outline", size: "small", onClick: copyInviteLink, children: inviteLinkCopied ? "Copied!" : "Copy" })
|
|
11492
11522
|
]
|
|
11493
11523
|
}
|
|
11494
11524
|
)
|
|
11495
11525
|
] }),
|
|
11496
|
-
/* @__PURE__ */ (0,
|
|
11526
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { style: { display: "flex", gap: "0.5rem", marginTop: "1.5rem" }, children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Button_default, { variant: "outline", onClick: resetFlow, children: "Invite Another User" }) })
|
|
11497
11527
|
] })
|
|
11498
11528
|
] });
|
|
11499
11529
|
}
|
|
11500
|
-
return /* @__PURE__ */ (0,
|
|
11501
|
-
(showTitle || showSubtitle) && (title || subtitle) && /* @__PURE__ */ (0,
|
|
11502
|
-
showTitle && title && /* @__PURE__ */ (0,
|
|
11503
|
-
showSubtitle && subtitle && /* @__PURE__ */ (0,
|
|
11530
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(Card_default, { className: (0, import_css42.cx)(className, styles.card), variant, children: [
|
|
11531
|
+
(showTitle || showSubtitle) && (title || subtitle) && /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(Card_default.Header, { className: styles.header, children: [
|
|
11532
|
+
showTitle && title && /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Card_default.Title, { level: 2, className: styles.title, children: title }),
|
|
11533
|
+
showSubtitle && subtitle && /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Typography_default, { variant: "body1", className: styles.subtitle, children: subtitle })
|
|
11504
11534
|
] }),
|
|
11505
|
-
/* @__PURE__ */ (0,
|
|
11506
|
-
apiError && /* @__PURE__ */ (0,
|
|
11507
|
-
/* @__PURE__ */ (0,
|
|
11508
|
-
componentsWithoutHeadings && componentsWithoutHeadings.length > 0 ? renderComponents(componentsWithoutHeadings) : !isLoading && /* @__PURE__ */ (0,
|
|
11509
|
-
isLoading && /* @__PURE__ */ (0,
|
|
11535
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(Card_default.Content, { children: [
|
|
11536
|
+
apiError && /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { style: { marginBottom: "1rem" }, children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Alert_default, { variant: "error", children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Alert_default.Description, { children: apiError.message }) }) }),
|
|
11537
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { children: [
|
|
11538
|
+
componentsWithoutHeadings && componentsWithoutHeadings.length > 0 ? renderComponents(componentsWithoutHeadings) : !isLoading && /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Alert_default, { variant: "warning", children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Typography_default, { variant: "body1", children: "No form components available" }) }),
|
|
11539
|
+
isLoading && /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { style: { display: "flex", justifyContent: "center", padding: "1rem" }, children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Spinner_default, { size: "small" }) })
|
|
11510
11540
|
] })
|
|
11511
11541
|
] })
|
|
11512
11542
|
] });
|
|
@@ -11514,7 +11544,7 @@ var BaseInviteUser = ({
|
|
|
11514
11544
|
var BaseInviteUser_default = BaseInviteUser;
|
|
11515
11545
|
|
|
11516
11546
|
// src/components/presentation/auth/InviteUser/v2/InviteUser.tsx
|
|
11517
|
-
var
|
|
11547
|
+
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
11518
11548
|
var InviteUser = ({
|
|
11519
11549
|
onInviteLinkGenerated,
|
|
11520
11550
|
onError,
|
|
@@ -11558,7 +11588,7 @@ var InviteUser = ({
|
|
|
11558
11588
|
});
|
|
11559
11589
|
return response.data;
|
|
11560
11590
|
};
|
|
11561
|
-
return /* @__PURE__ */ (0,
|
|
11591
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
11562
11592
|
BaseInviteUser_default,
|
|
11563
11593
|
{
|
|
11564
11594
|
onInitialize: handleInitialize,
|
|
@@ -11626,7 +11656,7 @@ var useStyles19 = (theme, colorScheme) => (0, import_react71.useMemo)(() => {
|
|
|
11626
11656
|
var BaseAcceptInvite_styles_default = useStyles19;
|
|
11627
11657
|
|
|
11628
11658
|
// src/components/presentation/auth/AcceptInvite/v2/BaseAcceptInvite.tsx
|
|
11629
|
-
var
|
|
11659
|
+
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
11630
11660
|
var BaseAcceptInvite = ({
|
|
11631
11661
|
flowId,
|
|
11632
11662
|
inviteToken,
|
|
@@ -11955,50 +11985,50 @@ var BaseAcceptInvite = ({
|
|
|
11955
11985
|
values: formValues
|
|
11956
11986
|
};
|
|
11957
11987
|
if (children) {
|
|
11958
|
-
return /* @__PURE__ */ (0,
|
|
11988
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className, children: children(renderProps) });
|
|
11959
11989
|
}
|
|
11960
11990
|
if (isValidatingToken) {
|
|
11961
|
-
return /* @__PURE__ */ (0,
|
|
11962
|
-
/* @__PURE__ */ (0,
|
|
11963
|
-
/* @__PURE__ */ (0,
|
|
11991
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Card_default, { className: (0, import_css44.cx)(className, styles.card), variant, children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Card_default.Content, { children: /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { style: { alignItems: "center", display: "flex", flexDirection: "column", gap: "1rem", padding: "2rem" }, children: [
|
|
11992
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Spinner_default, { size: "medium" }),
|
|
11993
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Typography_default, { variant: "body1", children: "Validating your invite link..." })
|
|
11964
11994
|
] }) }) });
|
|
11965
11995
|
}
|
|
11966
11996
|
if (isTokenInvalid) {
|
|
11967
|
-
return /* @__PURE__ */ (0,
|
|
11968
|
-
/* @__PURE__ */ (0,
|
|
11969
|
-
/* @__PURE__ */ (0,
|
|
11970
|
-
/* @__PURE__ */ (0,
|
|
11971
|
-
/* @__PURE__ */ (0,
|
|
11972
|
-
/* @__PURE__ */ (0,
|
|
11997
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(Card_default, { className: (0, import_css44.cx)(className, styles.card), variant, children: [
|
|
11998
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Card_default.Header, { className: styles.header, children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Card_default.Title, { level: 2, className: styles.title, children: "Invalid Invite Link" }) }),
|
|
11999
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(Card_default.Content, { children: [
|
|
12000
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(Alert_default, { variant: "error", children: [
|
|
12001
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Alert_default.Title, { children: "Unable to verify invite" }),
|
|
12002
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Alert_default.Description, { children: apiError?.message || "This invite link is invalid or has expired. Please contact your administrator for a new invite." })
|
|
11973
12003
|
] }),
|
|
11974
|
-
onGoToSignIn && /* @__PURE__ */ (0,
|
|
12004
|
+
onGoToSignIn && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { style: { display: "flex", justifyContent: "center", marginTop: "1.5rem" }, children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Button_default, { variant: "outline", onClick: onGoToSignIn, children: "Go to Sign In" }) })
|
|
11975
12005
|
] })
|
|
11976
12006
|
] });
|
|
11977
12007
|
}
|
|
11978
12008
|
if (isComplete) {
|
|
11979
|
-
return /* @__PURE__ */ (0,
|
|
11980
|
-
/* @__PURE__ */ (0,
|
|
11981
|
-
/* @__PURE__ */ (0,
|
|
11982
|
-
/* @__PURE__ */ (0,
|
|
11983
|
-
onGoToSignIn && /* @__PURE__ */ (0,
|
|
12009
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(Card_default, { className: (0, import_css44.cx)(className, styles.card), variant, children: [
|
|
12010
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Card_default.Header, { className: styles.header, children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Card_default.Title, { level: 2, className: styles.title, children: "Account Setup Complete!" }) }),
|
|
12011
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(Card_default.Content, { children: [
|
|
12012
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Alert_default, { variant: "success", children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Alert_default.Description, { children: "Your account has been successfully set up. You can now sign in with your credentials." }) }),
|
|
12013
|
+
onGoToSignIn && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { style: { display: "flex", justifyContent: "center", marginTop: "1.5rem" }, children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Button_default, { variant: "solid", color: "primary", onClick: onGoToSignIn, children: "Sign In" }) })
|
|
11984
12014
|
] })
|
|
11985
12015
|
] });
|
|
11986
12016
|
}
|
|
11987
|
-
return /* @__PURE__ */ (0,
|
|
11988
|
-
(showTitle || showSubtitle) && (title || subtitle) && /* @__PURE__ */ (0,
|
|
11989
|
-
showTitle && title && /* @__PURE__ */ (0,
|
|
11990
|
-
showSubtitle && subtitle && /* @__PURE__ */ (0,
|
|
12017
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(Card_default, { className: (0, import_css44.cx)(className, styles.card), variant, children: [
|
|
12018
|
+
(showTitle || showSubtitle) && (title || subtitle) && /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(Card_default.Header, { className: styles.header, children: [
|
|
12019
|
+
showTitle && title && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Card_default.Title, { level: 2, className: styles.title, children: title }),
|
|
12020
|
+
showSubtitle && subtitle && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Typography_default, { variant: "body1", className: styles.subtitle, children: subtitle })
|
|
11991
12021
|
] }),
|
|
11992
|
-
/* @__PURE__ */ (0,
|
|
11993
|
-
apiError && /* @__PURE__ */ (0,
|
|
11994
|
-
/* @__PURE__ */ (0,
|
|
11995
|
-
componentsWithoutHeadings && componentsWithoutHeadings.length > 0 ? renderComponents(componentsWithoutHeadings) : !isLoading && /* @__PURE__ */ (0,
|
|
11996
|
-
isLoading && /* @__PURE__ */ (0,
|
|
12022
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(Card_default.Content, { children: [
|
|
12023
|
+
apiError && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { style: { marginBottom: "1rem" }, children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Alert_default, { variant: "error", children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Alert_default.Description, { children: apiError.message }) }) }),
|
|
12024
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { children: [
|
|
12025
|
+
componentsWithoutHeadings && componentsWithoutHeadings.length > 0 ? renderComponents(componentsWithoutHeadings) : !isLoading && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Alert_default, { variant: "warning", children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Typography_default, { variant: "body1", children: "No form components available" }) }),
|
|
12026
|
+
isLoading && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { style: { display: "flex", justifyContent: "center", padding: "1rem" }, children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Spinner_default, { size: "small" }) })
|
|
11997
12027
|
] }),
|
|
11998
|
-
onGoToSignIn && /* @__PURE__ */ (0,
|
|
12028
|
+
onGoToSignIn && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { style: { marginTop: "1.5rem", textAlign: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(Typography_default, { variant: "body2", children: [
|
|
11999
12029
|
"Already have an account?",
|
|
12000
12030
|
" ",
|
|
12001
|
-
/* @__PURE__ */ (0,
|
|
12031
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Button_default, { variant: "text", onClick: onGoToSignIn, style: { minWidth: "auto", padding: 0 }, children: "Sign In" })
|
|
12002
12032
|
] }) })
|
|
12003
12033
|
] })
|
|
12004
12034
|
] });
|
|
@@ -12006,7 +12036,7 @@ var BaseAcceptInvite = ({
|
|
|
12006
12036
|
var BaseAcceptInvite_default = BaseAcceptInvite;
|
|
12007
12037
|
|
|
12008
12038
|
// src/components/presentation/auth/AcceptInvite/v2/AcceptInvite.tsx
|
|
12009
|
-
var
|
|
12039
|
+
var import_jsx_runtime83 = require("react/jsx-runtime");
|
|
12010
12040
|
var getUrlParams = () => {
|
|
12011
12041
|
if (typeof window === "undefined") {
|
|
12012
12042
|
return {};
|
|
@@ -12062,7 +12092,7 @@ var AcceptInvite = ({
|
|
|
12062
12092
|
}
|
|
12063
12093
|
return response.json();
|
|
12064
12094
|
};
|
|
12065
|
-
return /* @__PURE__ */ (0,
|
|
12095
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
12066
12096
|
BaseAcceptInvite_default,
|
|
12067
12097
|
{
|
|
12068
12098
|
flowId,
|
|
@@ -12173,45 +12203,45 @@ var Callback = ({ onNavigate, onError }) => {
|
|
|
12173
12203
|
};
|
|
12174
12204
|
|
|
12175
12205
|
// src/components/presentation/User/BaseUser.tsx
|
|
12176
|
-
var
|
|
12206
|
+
var import_jsx_runtime84 = require("react/jsx-runtime");
|
|
12177
12207
|
var BaseUser = ({ user, children, fallback = null }) => {
|
|
12178
12208
|
if (!user) {
|
|
12179
|
-
return /* @__PURE__ */ (0,
|
|
12209
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_jsx_runtime84.Fragment, { children: fallback });
|
|
12180
12210
|
}
|
|
12181
|
-
return /* @__PURE__ */ (0,
|
|
12211
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_jsx_runtime84.Fragment, { children: children(user) });
|
|
12182
12212
|
};
|
|
12183
12213
|
BaseUser.displayName = "BaseUser";
|
|
12184
12214
|
var BaseUser_default = BaseUser;
|
|
12185
12215
|
|
|
12186
12216
|
// src/components/presentation/User/User.tsx
|
|
12187
|
-
var
|
|
12217
|
+
var import_jsx_runtime85 = require("react/jsx-runtime");
|
|
12188
12218
|
var User5 = ({ children, fallback = null }) => {
|
|
12189
12219
|
const { user } = useAsgardeo_default();
|
|
12190
|
-
return /* @__PURE__ */ (0,
|
|
12220
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(BaseUser_default, { user, fallback, children });
|
|
12191
12221
|
};
|
|
12192
12222
|
User5.displayName = "User";
|
|
12193
12223
|
var User_default = User5;
|
|
12194
12224
|
|
|
12195
12225
|
// src/components/presentation/Organization/BaseOrganization.tsx
|
|
12196
|
-
var
|
|
12226
|
+
var import_jsx_runtime86 = require("react/jsx-runtime");
|
|
12197
12227
|
var BaseOrganization = ({
|
|
12198
12228
|
children,
|
|
12199
12229
|
fallback = null,
|
|
12200
12230
|
organization
|
|
12201
12231
|
}) => {
|
|
12202
12232
|
if (!organization) {
|
|
12203
|
-
return /* @__PURE__ */ (0,
|
|
12233
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_jsx_runtime86.Fragment, { children: fallback });
|
|
12204
12234
|
}
|
|
12205
|
-
return /* @__PURE__ */ (0,
|
|
12235
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_jsx_runtime86.Fragment, { children: children(organization) });
|
|
12206
12236
|
};
|
|
12207
12237
|
BaseOrganization.displayName = "BaseOrganization";
|
|
12208
12238
|
var BaseOrganization_default = BaseOrganization;
|
|
12209
12239
|
|
|
12210
12240
|
// src/components/presentation/Organization/Organization.tsx
|
|
12211
|
-
var
|
|
12241
|
+
var import_jsx_runtime87 = require("react/jsx-runtime");
|
|
12212
12242
|
var Organization5 = ({ children, fallback = null }) => {
|
|
12213
12243
|
const { currentOrganization } = useOrganization_default();
|
|
12214
|
-
return /* @__PURE__ */ (0,
|
|
12244
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(BaseOrganization_default, { organization: currentOrganization, fallback, children });
|
|
12215
12245
|
};
|
|
12216
12246
|
Organization5.displayName = "Organization";
|
|
12217
12247
|
var Organization_default = Organization5;
|
|
@@ -12550,7 +12580,7 @@ var useStyles21 = (theme, colorScheme, size, variant, backgroundColor) => (0, im
|
|
|
12550
12580
|
var Avatar_styles_default = useStyles21;
|
|
12551
12581
|
|
|
12552
12582
|
// src/components/primitives/Avatar/Avatar.tsx
|
|
12553
|
-
var
|
|
12583
|
+
var import_jsx_runtime88 = require("react/jsx-runtime");
|
|
12554
12584
|
var Avatar = ({
|
|
12555
12585
|
alt = "User avatar",
|
|
12556
12586
|
background = "random",
|
|
@@ -12597,7 +12627,7 @@ var Avatar = ({
|
|
|
12597
12627
|
const getInitials = (fullName) => fullName.split(" ").map((part) => part[0]).slice(0, 2).join("").toUpperCase();
|
|
12598
12628
|
const renderContent = () => {
|
|
12599
12629
|
if (imageUrl) {
|
|
12600
|
-
return /* @__PURE__ */ (0,
|
|
12630
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
12601
12631
|
"img",
|
|
12602
12632
|
{
|
|
12603
12633
|
src: imageUrl,
|
|
@@ -12610,19 +12640,19 @@ var Avatar = ({
|
|
|
12610
12640
|
return getInitials(name);
|
|
12611
12641
|
}
|
|
12612
12642
|
if (isLoading) {
|
|
12613
|
-
return /* @__PURE__ */ (0,
|
|
12643
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: (0, import_css47.cx)((0, import_browser76.withVendorCSSClassPrefix)((0, import_browser76.bem)("avatar", "skeleton")), styles["skeleton"]) });
|
|
12614
12644
|
}
|
|
12615
|
-
return /* @__PURE__ */ (0,
|
|
12645
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
12616
12646
|
"svg",
|
|
12617
12647
|
{
|
|
12618
12648
|
xmlns: "http://www.w3.org/2000/svg",
|
|
12619
12649
|
viewBox: "0 0 640 640",
|
|
12620
12650
|
className: (0, import_css47.cx)((0, import_browser76.withVendorCSSClassPrefix)((0, import_browser76.bem)("avatar", "icon")), styles["icon"]),
|
|
12621
|
-
children: /* @__PURE__ */ (0,
|
|
12651
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("path", { d: "M240 192C240 147.8 275.8 112 320 112C364.2 112 400 147.8 400 192C400 236.2 364.2 272 320 272C275.8 272 240 236.2 240 192zM448 192C448 121.3 390.7 64 320 64C249.3 64 192 121.3 192 192C192 262.7 249.3 320 320 320C390.7 320 448 262.7 448 192zM144 544C144 473.3 201.3 416 272 416L368 416C438.7 416 496 473.3 496 544L496 552C496 565.3 506.7 576 520 576C533.3 576 544 565.3 544 552L544 544C544 446.8 465.2 368 368 368L272 368C174.8 368 96 446.8 96 544L96 552C96 565.3 106.7 576 120 576C133.3 576 144 565.3 144 552L144 544z" })
|
|
12622
12652
|
}
|
|
12623
12653
|
);
|
|
12624
12654
|
};
|
|
12625
|
-
return /* @__PURE__ */ (0,
|
|
12655
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
12626
12656
|
"div",
|
|
12627
12657
|
{
|
|
12628
12658
|
className: (0, import_css47.cx)(
|
|
@@ -12709,8 +12739,8 @@ var useStyles22 = (theme, colorScheme) => (0, import_react78.useMemo)(() => {
|
|
|
12709
12739
|
var Dialog_styles_default = useStyles22;
|
|
12710
12740
|
|
|
12711
12741
|
// src/components/primitives/Icons/LogOut.tsx
|
|
12712
|
-
var
|
|
12713
|
-
var LogOut = (props) => /* @__PURE__ */ (0,
|
|
12742
|
+
var import_jsx_runtime89 = require("react/jsx-runtime");
|
|
12743
|
+
var LogOut = (props) => /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(
|
|
12714
12744
|
"svg",
|
|
12715
12745
|
{
|
|
12716
12746
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -12724,17 +12754,17 @@ var LogOut = (props) => /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(
|
|
|
12724
12754
|
strokeLinejoin: "round",
|
|
12725
12755
|
...props,
|
|
12726
12756
|
children: [
|
|
12727
|
-
/* @__PURE__ */ (0,
|
|
12728
|
-
/* @__PURE__ */ (0,
|
|
12729
|
-
/* @__PURE__ */ (0,
|
|
12757
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("path", { d: "m16 17 5-5-5-5" }),
|
|
12758
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("path", { d: "M21 12H9" }),
|
|
12759
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("path", { d: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" })
|
|
12730
12760
|
]
|
|
12731
12761
|
}
|
|
12732
12762
|
);
|
|
12733
12763
|
var LogOut_default = LogOut;
|
|
12734
12764
|
|
|
12735
12765
|
// src/components/primitives/Icons/Plus.tsx
|
|
12736
|
-
var
|
|
12737
|
-
var Plus = (props) => /* @__PURE__ */ (0,
|
|
12766
|
+
var import_jsx_runtime90 = require("react/jsx-runtime");
|
|
12767
|
+
var Plus = (props) => /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
12738
12768
|
"svg",
|
|
12739
12769
|
{
|
|
12740
12770
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -12748,16 +12778,16 @@ var Plus = (props) => /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(
|
|
|
12748
12778
|
strokeLinejoin: "round",
|
|
12749
12779
|
...props,
|
|
12750
12780
|
children: [
|
|
12751
|
-
/* @__PURE__ */ (0,
|
|
12752
|
-
/* @__PURE__ */ (0,
|
|
12781
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("path", { d: "M5 12h14" }),
|
|
12782
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("path", { d: "M12 5v14" })
|
|
12753
12783
|
]
|
|
12754
12784
|
}
|
|
12755
12785
|
);
|
|
12756
12786
|
var Plus_default = Plus;
|
|
12757
12787
|
|
|
12758
12788
|
// src/components/primitives/Icons/User.tsx
|
|
12759
|
-
var
|
|
12760
|
-
var User7 = (props) => /* @__PURE__ */ (0,
|
|
12789
|
+
var import_jsx_runtime91 = require("react/jsx-runtime");
|
|
12790
|
+
var User7 = (props) => /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(
|
|
12761
12791
|
"svg",
|
|
12762
12792
|
{
|
|
12763
12793
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -12771,16 +12801,16 @@ var User7 = (props) => /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
|
12771
12801
|
strokeLinejoin: "round",
|
|
12772
12802
|
...props,
|
|
12773
12803
|
children: [
|
|
12774
|
-
/* @__PURE__ */ (0,
|
|
12775
|
-
/* @__PURE__ */ (0,
|
|
12804
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)("path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" }),
|
|
12805
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)("circle", { cx: "12", cy: "7", r: "4" })
|
|
12776
12806
|
]
|
|
12777
12807
|
}
|
|
12778
12808
|
);
|
|
12779
12809
|
var User_default2 = User7;
|
|
12780
12810
|
|
|
12781
12811
|
// src/components/primitives/Icons/X.tsx
|
|
12782
|
-
var
|
|
12783
|
-
var X = (props) => /* @__PURE__ */ (0,
|
|
12812
|
+
var import_jsx_runtime92 = require("react/jsx-runtime");
|
|
12813
|
+
var X = (props) => /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(
|
|
12784
12814
|
"svg",
|
|
12785
12815
|
{
|
|
12786
12816
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -12794,15 +12824,15 @@ var X = (props) => /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(
|
|
|
12794
12824
|
strokeLinejoin: "round",
|
|
12795
12825
|
...props,
|
|
12796
12826
|
children: [
|
|
12797
|
-
/* @__PURE__ */ (0,
|
|
12798
|
-
/* @__PURE__ */ (0,
|
|
12827
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)("path", { d: "M18 6 6 18" }),
|
|
12828
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)("path", { d: "m6 6 12 12" })
|
|
12799
12829
|
]
|
|
12800
12830
|
}
|
|
12801
12831
|
);
|
|
12802
12832
|
var X_default = X;
|
|
12803
12833
|
|
|
12804
12834
|
// src/components/primitives/Dialog/Dialog.tsx
|
|
12805
|
-
var
|
|
12835
|
+
var import_jsx_runtime93 = require("react/jsx-runtime");
|
|
12806
12836
|
function useDialog({
|
|
12807
12837
|
initialOpen = false,
|
|
12808
12838
|
open: controlledOpen,
|
|
@@ -12848,7 +12878,7 @@ var useDialogContext = () => {
|
|
|
12848
12878
|
};
|
|
12849
12879
|
function Dialog({ children, ...options }) {
|
|
12850
12880
|
const dialog = useDialog(options);
|
|
12851
|
-
return /* @__PURE__ */ (0,
|
|
12881
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(DialogContext.Provider, { value: dialog, children });
|
|
12852
12882
|
}
|
|
12853
12883
|
var DialogTrigger = (0, import_react80.forwardRef)(
|
|
12854
12884
|
({ children, asChild = false, ...props }, propRef) => {
|
|
@@ -12866,7 +12896,7 @@ var DialogTrigger = (0, import_react80.forwardRef)(
|
|
|
12866
12896
|
})
|
|
12867
12897
|
);
|
|
12868
12898
|
}
|
|
12869
|
-
return /* @__PURE__ */ (0,
|
|
12899
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("button", { ref, "data-state": context.open ? "open" : "closed", ...context.getReferenceProps(props), children });
|
|
12870
12900
|
}
|
|
12871
12901
|
);
|
|
12872
12902
|
var DialogContent = (0, import_react80.forwardRef)(
|
|
@@ -12876,12 +12906,12 @@ var DialogContent = (0, import_react80.forwardRef)(
|
|
|
12876
12906
|
const styles = Dialog_styles_default(theme, colorScheme);
|
|
12877
12907
|
const ref = (0, import_react79.useMergeRefs)([context.refs.setFloating, propRef]);
|
|
12878
12908
|
if (!floatingContext.open) return null;
|
|
12879
|
-
return /* @__PURE__ */ (0,
|
|
12909
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_react79.FloatingPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
12880
12910
|
import_react79.FloatingOverlay,
|
|
12881
12911
|
{
|
|
12882
12912
|
className: (0, import_css49.cx)((0, import_browser77.withVendorCSSClassPrefix)((0, import_browser77.bem)("dialog", "overlay")), styles["overlay"]),
|
|
12883
12913
|
lockScroll: true,
|
|
12884
|
-
children: /* @__PURE__ */ (0,
|
|
12914
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_react79.FloatingFocusManager, { context: floatingContext, initialFocus: -1, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
12885
12915
|
"div",
|
|
12886
12916
|
{
|
|
12887
12917
|
ref,
|
|
@@ -12908,8 +12938,8 @@ var DialogHeading = (0, import_react80.forwardRef)(
|
|
|
12908
12938
|
context.setLabelId(void 0);
|
|
12909
12939
|
};
|
|
12910
12940
|
}, [id, context.setLabelId]);
|
|
12911
|
-
return /* @__PURE__ */ (0,
|
|
12912
|
-
/* @__PURE__ */ (0,
|
|
12941
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: (0, import_css49.cx)((0, import_browser77.withVendorCSSClassPrefix)((0, import_browser77.bem)("dialog", "header")), styles["header"]), children: [
|
|
12942
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
12913
12943
|
"h2",
|
|
12914
12944
|
{
|
|
12915
12945
|
...props,
|
|
@@ -12919,7 +12949,7 @@ var DialogHeading = (0, import_react80.forwardRef)(
|
|
|
12919
12949
|
children
|
|
12920
12950
|
}
|
|
12921
12951
|
),
|
|
12922
|
-
/* @__PURE__ */ (0,
|
|
12952
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
12923
12953
|
Button_default,
|
|
12924
12954
|
{
|
|
12925
12955
|
color: "tertiary",
|
|
@@ -12930,7 +12960,7 @@ var DialogHeading = (0, import_react80.forwardRef)(
|
|
|
12930
12960
|
context.setOpen(false);
|
|
12931
12961
|
},
|
|
12932
12962
|
"aria-label": "Close",
|
|
12933
|
-
children: /* @__PURE__ */ (0,
|
|
12963
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(X_default, { width: 16, height: 16 })
|
|
12934
12964
|
}
|
|
12935
12965
|
)
|
|
12936
12966
|
] });
|
|
@@ -12948,7 +12978,7 @@ var DialogDescription = (0, import_react80.forwardRef)(
|
|
|
12948
12978
|
context.setDescriptionId(void 0);
|
|
12949
12979
|
};
|
|
12950
12980
|
}, [id, context.setDescriptionId]);
|
|
12951
|
-
return /* @__PURE__ */ (0,
|
|
12981
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
12952
12982
|
"p",
|
|
12953
12983
|
{
|
|
12954
12984
|
...props,
|
|
@@ -12977,7 +13007,7 @@ var DialogClose = (0, import_react80.forwardRef)(
|
|
|
12977
13007
|
onClick: handleClick
|
|
12978
13008
|
});
|
|
12979
13009
|
}
|
|
12980
|
-
return /* @__PURE__ */ (0,
|
|
13010
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
12981
13011
|
Button_default,
|
|
12982
13012
|
{
|
|
12983
13013
|
...props,
|
|
@@ -13100,7 +13130,7 @@ var useStyles23 = (theme, colorScheme, disabled, hasError, canAddMore, canRemove
|
|
|
13100
13130
|
var MultiInput_styles_default = useStyles23;
|
|
13101
13131
|
|
|
13102
13132
|
// src/components/primitives/MultiInput/MultiInput.tsx
|
|
13103
|
-
var
|
|
13133
|
+
var import_jsx_runtime94 = require("react/jsx-runtime");
|
|
13104
13134
|
var MultiInput = ({
|
|
13105
13135
|
label,
|
|
13106
13136
|
error,
|
|
@@ -13123,8 +13153,8 @@ var MultiInput = ({
|
|
|
13123
13153
|
const canAddMore = !maxFields || values.length < maxFields;
|
|
13124
13154
|
const canRemove = values.length > minFields;
|
|
13125
13155
|
const styles = MultiInput_styles_default(theme, colorScheme, !!disabled, !!error, canAddMore, canRemove);
|
|
13126
|
-
const PlusIcon = ({ iconClassName }) => /* @__PURE__ */ (0,
|
|
13127
|
-
const BinIcon = ({ iconClassName }) => /* @__PURE__ */ (0,
|
|
13156
|
+
const PlusIcon = ({ iconClassName }) => /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", className: (0, import_css51.cx)(styles["icon"], iconClassName), children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("path", { d: "M12 5v14M5 12h14" }) });
|
|
13157
|
+
const BinIcon = ({ iconClassName }) => /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", className: (0, import_css51.cx)(styles["icon"], iconClassName), children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("path", { d: "M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2m3 0v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6h14ZM10 11v6M14 11v6" }) });
|
|
13128
13158
|
const handleAddValue = (0, import_react82.useCallback)(
|
|
13129
13159
|
(newValue) => {
|
|
13130
13160
|
if (newValue.trim() !== "" && (!maxFields || values.length < maxFields)) {
|
|
@@ -13168,9 +13198,9 @@ var MultiInput = ({
|
|
|
13168
13198
|
};
|
|
13169
13199
|
switch (fieldType) {
|
|
13170
13200
|
case "DATE_TIME":
|
|
13171
|
-
return /* @__PURE__ */ (0,
|
|
13201
|
+
return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(DatePicker_default, { ...commonProps });
|
|
13172
13202
|
case "BOOLEAN":
|
|
13173
|
-
return /* @__PURE__ */ (0,
|
|
13203
|
+
return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
13174
13204
|
Checkbox_default,
|
|
13175
13205
|
{
|
|
13176
13206
|
...commonProps,
|
|
@@ -13179,7 +13209,7 @@ var MultiInput = ({
|
|
|
13179
13209
|
}
|
|
13180
13210
|
);
|
|
13181
13211
|
default:
|
|
13182
|
-
return /* @__PURE__ */ (0,
|
|
13212
|
+
return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(TextField_default, { ...commonProps, type });
|
|
13183
13213
|
}
|
|
13184
13214
|
},
|
|
13185
13215
|
[placeholder, disabled, startIcon, endIcon, error, fieldType, type]
|
|
@@ -13191,7 +13221,7 @@ var MultiInput = ({
|
|
|
13191
13221
|
setCurrentInputValue("");
|
|
13192
13222
|
}
|
|
13193
13223
|
}, [currentInputValue, handleAddValue]);
|
|
13194
|
-
return /* @__PURE__ */ (0,
|
|
13224
|
+
return /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(
|
|
13195
13225
|
FormControl_default,
|
|
13196
13226
|
{
|
|
13197
13227
|
error,
|
|
@@ -13199,27 +13229,27 @@ var MultiInput = ({
|
|
|
13199
13229
|
className: (0, import_css51.cx)((0, import_browser78.withVendorCSSClassPrefix)((0, import_browser78.bem)("multi-input")), className),
|
|
13200
13230
|
style,
|
|
13201
13231
|
children: [
|
|
13202
|
-
label && /* @__PURE__ */ (0,
|
|
13203
|
-
/* @__PURE__ */ (0,
|
|
13204
|
-
/* @__PURE__ */ (0,
|
|
13232
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(InputLabel_default, { required, error: !!error, children: label }),
|
|
13233
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: (0, import_css51.cx)((0, import_browser78.withVendorCSSClassPrefix)((0, import_browser78.bem)("multi-input", "container")), styles["container"]), children: [
|
|
13234
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)("div", { className: (0, import_css51.cx)((0, import_browser78.withVendorCSSClassPrefix)((0, import_browser78.bem)("multi-input", "input-row")), styles["inputRow"]), children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("div", { className: (0, import_css51.cx)((0, import_browser78.withVendorCSSClassPrefix)((0, import_browser78.bem)("multi-input", "input-wrapper")), styles["inputWrapper"]), children: renderInputField(
|
|
13205
13235
|
currentInputValue,
|
|
13206
13236
|
setCurrentInputValue,
|
|
13207
|
-
canAddMore ? /* @__PURE__ */ (0,
|
|
13237
|
+
canAddMore ? /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(PlusIcon, { iconClassName: styles["plusIcon"] }) : void 0,
|
|
13208
13238
|
canAddMore ? handleInputSubmit : void 0
|
|
13209
13239
|
) }) }),
|
|
13210
|
-
values.length > 0 && /* @__PURE__ */ (0,
|
|
13240
|
+
values.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("div", { className: (0, import_css51.cx)((0, import_browser78.withVendorCSSClassPrefix)((0, import_browser78.bem)("multi-input", "list-container")), styles["listContainer"]), children: values.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(
|
|
13211
13241
|
"div",
|
|
13212
13242
|
{
|
|
13213
13243
|
className: (0, import_css51.cx)((0, import_browser78.withVendorCSSClassPrefix)((0, import_browser78.bem)("multi-input", "list-item")), styles["listItem"]),
|
|
13214
13244
|
children: [
|
|
13215
|
-
/* @__PURE__ */ (0,
|
|
13245
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
13216
13246
|
"span",
|
|
13217
13247
|
{
|
|
13218
13248
|
className: (0, import_css51.cx)((0, import_browser78.withVendorCSSClassPrefix)((0, import_browser78.bem)("multi-input", "list-item-text")), styles["listItemText"]),
|
|
13219
13249
|
children: value
|
|
13220
13250
|
}
|
|
13221
13251
|
),
|
|
13222
|
-
canRemove && /* @__PURE__ */ (0,
|
|
13252
|
+
canRemove && /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
13223
13253
|
"button",
|
|
13224
13254
|
{
|
|
13225
13255
|
type: "button",
|
|
@@ -13230,7 +13260,7 @@ var MultiInput = ({
|
|
|
13230
13260
|
styles["removeButton"]
|
|
13231
13261
|
),
|
|
13232
13262
|
title: "Remove value",
|
|
13233
|
-
children: /* @__PURE__ */ (0,
|
|
13263
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(BinIcon, { iconClassName: styles["icon"] })
|
|
13234
13264
|
}
|
|
13235
13265
|
)
|
|
13236
13266
|
]
|
|
@@ -13245,7 +13275,7 @@ var MultiInput = ({
|
|
|
13245
13275
|
var MultiInput_default = MultiInput;
|
|
13246
13276
|
|
|
13247
13277
|
// src/components/presentation/UserProfile/BaseUserProfile.tsx
|
|
13248
|
-
var
|
|
13278
|
+
var import_jsx_runtime95 = require("react/jsx-runtime");
|
|
13249
13279
|
var fieldsToSkip = [
|
|
13250
13280
|
"roles.default",
|
|
13251
13281
|
"active",
|
|
@@ -13307,7 +13337,7 @@ var BaseUserProfile = ({
|
|
|
13307
13337
|
},
|
|
13308
13338
|
[showFields, hideFields]
|
|
13309
13339
|
);
|
|
13310
|
-
const PencilIcon = () => /* @__PURE__ */ (0,
|
|
13340
|
+
const PencilIcon = () => /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
|
|
13311
13341
|
"svg",
|
|
13312
13342
|
{
|
|
13313
13343
|
width: "16",
|
|
@@ -13318,7 +13348,7 @@ var BaseUserProfile = ({
|
|
|
13318
13348
|
strokeWidth: "2",
|
|
13319
13349
|
strokeLinecap: "round",
|
|
13320
13350
|
strokeLinejoin: "round",
|
|
13321
|
-
children: /* @__PURE__ */ (0,
|
|
13351
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("path", { d: "M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z" })
|
|
13322
13352
|
}
|
|
13323
13353
|
);
|
|
13324
13354
|
const toggleFieldEdit = (0, import_react83.useCallback)((fieldName) => {
|
|
@@ -13348,12 +13378,12 @@ var BaseUserProfile = ({
|
|
|
13348
13378
|
const styles = BaseUserProfile_styles_default(theme, colorScheme);
|
|
13349
13379
|
const ObjectDisplay = ({ data }) => {
|
|
13350
13380
|
if (!data || typeof data !== "object") return null;
|
|
13351
|
-
return /* @__PURE__ */ (0,
|
|
13352
|
-
/* @__PURE__ */ (0,
|
|
13381
|
+
return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("table", { className: styles.value, children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("tbody", { children: Object.entries(data).map(([key, value]) => /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("tr", { children: [
|
|
13382
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("td", { className: styles.objectKey, children: /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("strong", { children: [
|
|
13353
13383
|
formatLabel(key),
|
|
13354
13384
|
":"
|
|
13355
13385
|
] }) }),
|
|
13356
|
-
/* @__PURE__ */ (0,
|
|
13386
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("td", { className: styles.objectValue, children: typeof value === "object" ? /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(ObjectDisplay, { data: value }) : String(value) })
|
|
13357
13387
|
] }, key)) }) });
|
|
13358
13388
|
};
|
|
13359
13389
|
function set(obj, path, value) {
|
|
@@ -13428,7 +13458,7 @@ var BaseUserProfile = ({
|
|
|
13428
13458
|
const { value, displayName, description, name, type, required, mutability, subAttributes, multiValued } = schema;
|
|
13429
13459
|
const label = displayName || description || name || "";
|
|
13430
13460
|
if (subAttributes && Array.isArray(subAttributes)) {
|
|
13431
|
-
return /* @__PURE__ */ (0,
|
|
13461
|
+
return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_jsx_runtime95.Fragment, { children: subAttributes.map((subAttr, index) => {
|
|
13432
13462
|
let displayValue2;
|
|
13433
13463
|
if (Array.isArray(subAttr.value)) {
|
|
13434
13464
|
displayValue2 = subAttr.value.map((item) => typeof item === "object" ? JSON.stringify(item) : String(item)).join(", ");
|
|
@@ -13437,9 +13467,9 @@ var BaseUserProfile = ({
|
|
|
13437
13467
|
} else {
|
|
13438
13468
|
displayValue2 = String(subAttr.value);
|
|
13439
13469
|
}
|
|
13440
|
-
return /* @__PURE__ */ (0,
|
|
13441
|
-
/* @__PURE__ */ (0,
|
|
13442
|
-
/* @__PURE__ */ (0,
|
|
13470
|
+
return /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("div", { className: styles.field, children: [
|
|
13471
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("span", { className: styles.label, children: subAttr.displayName || subAttr.description || "" }),
|
|
13472
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { className: styles.value, children: displayValue2 })
|
|
13443
13473
|
] }, index);
|
|
13444
13474
|
}) });
|
|
13445
13475
|
}
|
|
@@ -13463,9 +13493,9 @@ var BaseUserProfile = ({
|
|
|
13463
13493
|
} else {
|
|
13464
13494
|
fieldValues = [];
|
|
13465
13495
|
}
|
|
13466
|
-
return /* @__PURE__ */ (0,
|
|
13467
|
-
/* @__PURE__ */ (0,
|
|
13468
|
-
/* @__PURE__ */ (0,
|
|
13496
|
+
return /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(import_jsx_runtime95.Fragment, { children: [
|
|
13497
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("span", { className: styles.label, children: label }),
|
|
13498
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { className: styles.value, children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
|
|
13469
13499
|
MultiInput_default,
|
|
13470
13500
|
{
|
|
13471
13501
|
values: fieldValues,
|
|
@@ -13496,9 +13526,9 @@ var BaseUserProfile = ({
|
|
|
13496
13526
|
} else {
|
|
13497
13527
|
displayValue2 = "-";
|
|
13498
13528
|
}
|
|
13499
|
-
return /* @__PURE__ */ (0,
|
|
13500
|
-
/* @__PURE__ */ (0,
|
|
13501
|
-
/* @__PURE__ */ (0,
|
|
13529
|
+
return /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(import_jsx_runtime95.Fragment, { children: [
|
|
13530
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("span", { className: styles.label, children: label }),
|
|
13531
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { className: (0, import_css52.cx)(styles.value, !hasValues ? styles.valuePlaceholder : ""), children: !hasValues && isEditable2 && onStartEdit ? /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
|
|
13502
13532
|
Button_default,
|
|
13503
13533
|
{
|
|
13504
13534
|
onClick: onStartEdit,
|
|
@@ -13513,7 +13543,7 @@ var BaseUserProfile = ({
|
|
|
13513
13543
|
] });
|
|
13514
13544
|
}
|
|
13515
13545
|
if (type === "COMPLEX" && typeof value === "object") {
|
|
13516
|
-
return /* @__PURE__ */ (0,
|
|
13546
|
+
return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(ObjectDisplay, { data: value });
|
|
13517
13547
|
}
|
|
13518
13548
|
if (isEditing && onEditValue && mutability !== "READ_ONLY" && !readonlyFields.includes(name || "")) {
|
|
13519
13549
|
let fieldValue;
|
|
@@ -13535,13 +13565,13 @@ var BaseUserProfile = ({
|
|
|
13535
13565
|
let field;
|
|
13536
13566
|
switch (type) {
|
|
13537
13567
|
case "STRING":
|
|
13538
|
-
field = /* @__PURE__ */ (0,
|
|
13568
|
+
field = /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(TextField_default, { ...commonProps });
|
|
13539
13569
|
break;
|
|
13540
13570
|
case "DATE_TIME":
|
|
13541
|
-
field = /* @__PURE__ */ (0,
|
|
13571
|
+
field = /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(DatePicker_default, { ...commonProps });
|
|
13542
13572
|
break;
|
|
13543
13573
|
case "BOOLEAN":
|
|
13544
|
-
field = /* @__PURE__ */ (0,
|
|
13574
|
+
field = /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
|
|
13545
13575
|
Checkbox_default,
|
|
13546
13576
|
{
|
|
13547
13577
|
...commonProps,
|
|
@@ -13553,7 +13583,7 @@ var BaseUserProfile = ({
|
|
|
13553
13583
|
);
|
|
13554
13584
|
break;
|
|
13555
13585
|
case "COMPLEX":
|
|
13556
|
-
field = /* @__PURE__ */ (0,
|
|
13586
|
+
field = /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
|
|
13557
13587
|
"textarea",
|
|
13558
13588
|
{
|
|
13559
13589
|
value: fieldValue,
|
|
@@ -13565,11 +13595,11 @@ var BaseUserProfile = ({
|
|
|
13565
13595
|
);
|
|
13566
13596
|
break;
|
|
13567
13597
|
default:
|
|
13568
|
-
field = /* @__PURE__ */ (0,
|
|
13598
|
+
field = /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(TextField_default, { ...commonProps });
|
|
13569
13599
|
}
|
|
13570
|
-
return /* @__PURE__ */ (0,
|
|
13571
|
-
/* @__PURE__ */ (0,
|
|
13572
|
-
/* @__PURE__ */ (0,
|
|
13600
|
+
return /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(import_jsx_runtime95.Fragment, { children: [
|
|
13601
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("span", { className: styles.label, children: label }),
|
|
13602
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { className: styles.value, children: field })
|
|
13573
13603
|
] });
|
|
13574
13604
|
}
|
|
13575
13605
|
const hasValue = value !== void 0 && value !== null && value !== "";
|
|
@@ -13582,9 +13612,9 @@ var BaseUserProfile = ({
|
|
|
13582
13612
|
} else {
|
|
13583
13613
|
displayValue = "-";
|
|
13584
13614
|
}
|
|
13585
|
-
return /* @__PURE__ */ (0,
|
|
13586
|
-
/* @__PURE__ */ (0,
|
|
13587
|
-
/* @__PURE__ */ (0,
|
|
13615
|
+
return /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(import_jsx_runtime95.Fragment, { children: [
|
|
13616
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("span", { className: styles.label, children: label }),
|
|
13617
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { className: (0, import_css52.cx)(styles.value, !hasValue ? styles.valuePlaceholder : ""), children: !hasValue && isEditable && onStartEdit ? /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
|
|
13588
13618
|
Button_default,
|
|
13589
13619
|
{
|
|
13590
13620
|
onClick: onStartEdit,
|
|
@@ -13607,8 +13637,8 @@ var BaseUserProfile = ({
|
|
|
13607
13637
|
if (!shouldShow) {
|
|
13608
13638
|
return null;
|
|
13609
13639
|
}
|
|
13610
|
-
return /* @__PURE__ */ (0,
|
|
13611
|
-
/* @__PURE__ */ (0,
|
|
13640
|
+
return /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("div", { className: styles.field, children: [
|
|
13641
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { className: styles.fieldInner, children: renderSchemaField(
|
|
13612
13642
|
schema,
|
|
13613
13643
|
isFieldEditing,
|
|
13614
13644
|
(value) => {
|
|
@@ -13618,10 +13648,10 @@ var BaseUserProfile = ({
|
|
|
13618
13648
|
},
|
|
13619
13649
|
() => toggleFieldEdit(schema.name)
|
|
13620
13650
|
) }),
|
|
13621
|
-
editable && schema.mutability !== "READ_ONLY" && !isReadonlyField && /* @__PURE__ */ (0,
|
|
13622
|
-
isFieldEditing && /* @__PURE__ */ (0,
|
|
13623
|
-
/* @__PURE__ */ (0,
|
|
13624
|
-
/* @__PURE__ */ (0,
|
|
13651
|
+
editable && schema.mutability !== "READ_ONLY" && !isReadonlyField && /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("div", { className: styles.fieldActions, children: [
|
|
13652
|
+
isFieldEditing && /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(import_jsx_runtime95.Fragment, { children: [
|
|
13653
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Button_default, { size: "small", color: "primary", variant: "solid", onClick: () => handleFieldSave(schema), children: "Save" }),
|
|
13654
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
|
|
13625
13655
|
Button_default,
|
|
13626
13656
|
{
|
|
13627
13657
|
size: "small",
|
|
@@ -13632,7 +13662,7 @@ var BaseUserProfile = ({
|
|
|
13632
13662
|
}
|
|
13633
13663
|
)
|
|
13634
13664
|
] }),
|
|
13635
|
-
!isFieldEditing && hasValue && /* @__PURE__ */ (0,
|
|
13665
|
+
!isFieldEditing && hasValue && /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
|
|
13636
13666
|
Button_default,
|
|
13637
13667
|
{
|
|
13638
13668
|
size: "small",
|
|
@@ -13641,7 +13671,7 @@ var BaseUserProfile = ({
|
|
|
13641
13671
|
onClick: () => toggleFieldEdit(schema.name),
|
|
13642
13672
|
title: "Edit",
|
|
13643
13673
|
className: styles.editButton,
|
|
13644
|
-
children: /* @__PURE__ */ (0,
|
|
13674
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(PencilIcon, {})
|
|
13645
13675
|
}
|
|
13646
13676
|
)
|
|
13647
13677
|
] })
|
|
@@ -13664,9 +13694,9 @@ var BaseUserProfile = ({
|
|
|
13664
13694
|
if (!shouldShowField(key)) return false;
|
|
13665
13695
|
return value !== void 0 && value !== "" && value !== null;
|
|
13666
13696
|
}).sort(([a], [b]) => a.localeCompare(b));
|
|
13667
|
-
return /* @__PURE__ */ (0,
|
|
13668
|
-
/* @__PURE__ */ (0,
|
|
13669
|
-
/* @__PURE__ */ (0,
|
|
13697
|
+
return /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(import_jsx_runtime95.Fragment, { children: [
|
|
13698
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("div", { className: styles.profileSummary, children: [
|
|
13699
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
|
|
13670
13700
|
Avatar,
|
|
13671
13701
|
{
|
|
13672
13702
|
imageUrl: getMappedUserProfileValue_default("picture", mergedMappings, currentUser),
|
|
@@ -13676,32 +13706,32 @@ var BaseUserProfile = ({
|
|
|
13676
13706
|
isLoading
|
|
13677
13707
|
}
|
|
13678
13708
|
),
|
|
13679
|
-
/* @__PURE__ */ (0,
|
|
13680
|
-
getMappedUserProfileValue_default("email", mergedMappings, currentUser) && /* @__PURE__ */ (0,
|
|
13709
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Typography_default, { variant: "h3", fontWeight: "medium", children: displayName }),
|
|
13710
|
+
getMappedUserProfileValue_default("email", mergedMappings, currentUser) && /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Typography_default, { variant: "body2", color: "textSecondary", children: getMappedUserProfileValue_default("email", mergedMappings, currentUser) })
|
|
13681
13711
|
] }),
|
|
13682
|
-
/* @__PURE__ */ (0,
|
|
13683
|
-
profileEntries.map(([key, value], index) => /* @__PURE__ */ (0,
|
|
13684
|
-
/* @__PURE__ */ (0,
|
|
13685
|
-
/* @__PURE__ */ (0,
|
|
13686
|
-
/* @__PURE__ */ (0,
|
|
13712
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Divider_default, {}),
|
|
13713
|
+
profileEntries.map(([key, value], index) => /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("div", { children: [
|
|
13714
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("div", { className: styles.sectionRow, children: [
|
|
13715
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { className: styles.sectionLabel, children: formatLabel(key) }),
|
|
13716
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { className: styles.sectionValue, children: typeof value === "object" ? /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(ObjectDisplay, { data: value }) : String(value) })
|
|
13687
13717
|
] }),
|
|
13688
|
-
index < profileEntries.length - 1 && /* @__PURE__ */ (0,
|
|
13718
|
+
index < profileEntries.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Divider_default, {})
|
|
13689
13719
|
] }, key))
|
|
13690
13720
|
] });
|
|
13691
13721
|
};
|
|
13692
|
-
const profileContent = /* @__PURE__ */ (0,
|
|
13693
|
-
error && /* @__PURE__ */ (0,
|
|
13722
|
+
const profileContent = /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(Card_default, { className: containerClasses, children: [
|
|
13723
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(
|
|
13694
13724
|
Alert_default,
|
|
13695
13725
|
{
|
|
13696
13726
|
variant: "error",
|
|
13697
13727
|
className: (0, import_css52.cx)((0, import_browser79.withVendorCSSClassPrefix)((0, import_browser79.bem)("user-profile", "alert")), styles.alert),
|
|
13698
13728
|
children: [
|
|
13699
|
-
/* @__PURE__ */ (0,
|
|
13700
|
-
/* @__PURE__ */ (0,
|
|
13729
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Alert_default.Title, { children: t("errors.heading") || "Error" }),
|
|
13730
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Alert_default.Description, { children: error })
|
|
13701
13731
|
]
|
|
13702
13732
|
}
|
|
13703
13733
|
),
|
|
13704
|
-
schemas && schemas.length > 0 && /* @__PURE__ */ (0,
|
|
13734
|
+
schemas && schemas.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { className: styles.header, children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
|
|
13705
13735
|
Avatar,
|
|
13706
13736
|
{
|
|
13707
13737
|
imageUrl: getMappedUserProfileValue_default("picture", mergedMappings, currentUser),
|
|
@@ -13711,7 +13741,7 @@ var BaseUserProfile = ({
|
|
|
13711
13741
|
isLoading
|
|
13712
13742
|
}
|
|
13713
13743
|
) }),
|
|
13714
|
-
/* @__PURE__ */ (0,
|
|
13744
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { className: styles.infoContainer, children: schemas && schemas.length > 0 ? schemas.filter((schema) => {
|
|
13715
13745
|
if (!schema.name || !shouldShowField(schema.name)) return false;
|
|
13716
13746
|
if (!editable) {
|
|
13717
13747
|
const value = flattenedProfile && schema.name ? flattenedProfile[schema.name] : void 0;
|
|
@@ -13728,13 +13758,13 @@ var BaseUserProfile = ({
|
|
|
13728
13758
|
...schema,
|
|
13729
13759
|
value
|
|
13730
13760
|
};
|
|
13731
|
-
return /* @__PURE__ */ (0,
|
|
13761
|
+
return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { className: styles.info, children: renderUserInfo(schemaWithValue) }, schema.name || index);
|
|
13732
13762
|
}) : renderProfileWithoutSchemas() })
|
|
13733
13763
|
] });
|
|
13734
13764
|
if (mode === "popup") {
|
|
13735
|
-
return /* @__PURE__ */ (0,
|
|
13736
|
-
/* @__PURE__ */ (0,
|
|
13737
|
-
/* @__PURE__ */ (0,
|
|
13765
|
+
return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(Dialog_default.Content, { children: [
|
|
13766
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Dialog_default.Heading, { children: title ?? t("user.profile.heading") }),
|
|
13767
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { className: styles.popup, children: profileContent })
|
|
13738
13768
|
] }) });
|
|
13739
13769
|
}
|
|
13740
13770
|
return profileContent;
|
|
@@ -13773,7 +13803,7 @@ var updateMeProfile = async ({ fetcher, instanceId = 0, ...requestConfig }) => {
|
|
|
13773
13803
|
var updateMeProfile_default = updateMeProfile;
|
|
13774
13804
|
|
|
13775
13805
|
// src/components/presentation/UserProfile/UserProfile.tsx
|
|
13776
|
-
var
|
|
13806
|
+
var import_jsx_runtime96 = require("react/jsx-runtime");
|
|
13777
13807
|
var UserProfile3 = ({ preferences, ...rest }) => {
|
|
13778
13808
|
const { baseUrl, instanceId } = useAsgardeo_default();
|
|
13779
13809
|
const { profile, flattenedProfile, schemas, onUpdateProfile } = useUser_default();
|
|
@@ -13792,7 +13822,7 @@ var UserProfile3 = ({ preferences, ...rest }) => {
|
|
|
13792
13822
|
setError(message);
|
|
13793
13823
|
}
|
|
13794
13824
|
};
|
|
13795
|
-
return /* @__PURE__ */ (0,
|
|
13825
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
13796
13826
|
BaseUserProfile_default,
|
|
13797
13827
|
{
|
|
13798
13828
|
profile,
|
|
@@ -14003,7 +14033,7 @@ var useStyles24 = (theme, colorScheme) => (0, import_react85.useMemo)(() => {
|
|
|
14003
14033
|
var BaseUserDropdown_styles_default = useStyles24;
|
|
14004
14034
|
|
|
14005
14035
|
// src/components/presentation/UserDropdown/BaseUserDropdown.tsx
|
|
14006
|
-
var
|
|
14036
|
+
var import_jsx_runtime97 = require("react/jsx-runtime");
|
|
14007
14037
|
var BaseUserDropdown = ({
|
|
14008
14038
|
fallback = null,
|
|
14009
14039
|
className = "",
|
|
@@ -14055,14 +14085,14 @@ var BaseUserDropdown = ({
|
|
|
14055
14085
|
const defaultMenuItems = [];
|
|
14056
14086
|
if (onManageProfile) {
|
|
14057
14087
|
defaultMenuItems.push({
|
|
14058
|
-
icon: /* @__PURE__ */ (0,
|
|
14088
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(User_default2, { width: "16", height: "16" }),
|
|
14059
14089
|
label: "Manage Profile",
|
|
14060
14090
|
onClick: onManageProfile
|
|
14061
14091
|
});
|
|
14062
14092
|
}
|
|
14063
14093
|
if (onSignOut) {
|
|
14064
14094
|
defaultMenuItems.push({
|
|
14065
|
-
icon: /* @__PURE__ */ (0,
|
|
14095
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(LogOut_default, { width: "16", height: "16" }),
|
|
14066
14096
|
label: "Sign Out",
|
|
14067
14097
|
onClick: onSignOut
|
|
14068
14098
|
});
|
|
@@ -14074,8 +14104,8 @@ var BaseUserDropdown = ({
|
|
|
14074
14104
|
}
|
|
14075
14105
|
allMenuItems.push(...defaultMenuItems);
|
|
14076
14106
|
}
|
|
14077
|
-
return /* @__PURE__ */ (0,
|
|
14078
|
-
/* @__PURE__ */ (0,
|
|
14107
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: (0, import_css54.cx)((0, import_browser82.withVendorCSSClassPrefix)("user-dropdown"), className), children: [
|
|
14108
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(
|
|
14079
14109
|
Button_default,
|
|
14080
14110
|
{
|
|
14081
14111
|
ref: refs.setReference,
|
|
@@ -14086,7 +14116,7 @@ var BaseUserDropdown = ({
|
|
|
14086
14116
|
"data-testid": "asgardeo-user-dropdown-trigger",
|
|
14087
14117
|
...getReferenceProps(),
|
|
14088
14118
|
children: [
|
|
14089
|
-
/* @__PURE__ */ (0,
|
|
14119
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
14090
14120
|
Avatar,
|
|
14091
14121
|
{
|
|
14092
14122
|
imageUrl: getMappedUserProfileValue_default("picture", mergedMappings, user),
|
|
@@ -14095,7 +14125,7 @@ var BaseUserDropdown = ({
|
|
|
14095
14125
|
alt: `${getDisplayName_default(mergedMappings, user)}'s avatar`
|
|
14096
14126
|
}
|
|
14097
14127
|
),
|
|
14098
|
-
showTriggerLabel && /* @__PURE__ */ (0,
|
|
14128
|
+
showTriggerLabel && /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
14099
14129
|
Typography_default,
|
|
14100
14130
|
{
|
|
14101
14131
|
variant: "body2",
|
|
@@ -14106,7 +14136,7 @@ var BaseUserDropdown = ({
|
|
|
14106
14136
|
]
|
|
14107
14137
|
}
|
|
14108
14138
|
),
|
|
14109
|
-
isOpen && /* @__PURE__ */ (0,
|
|
14139
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_react86.FloatingPortal, { id: portalId, children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_react86.FloatingFocusManager, { context, modal: false, initialFocus: -1, children: /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(
|
|
14110
14140
|
"div",
|
|
14111
14141
|
{
|
|
14112
14142
|
ref: refs.setFloating,
|
|
@@ -14119,8 +14149,8 @@ var BaseUserDropdown = ({
|
|
|
14119
14149
|
},
|
|
14120
14150
|
...getFloatingProps(),
|
|
14121
14151
|
children: [
|
|
14122
|
-
/* @__PURE__ */ (0,
|
|
14123
|
-
/* @__PURE__ */ (0,
|
|
14152
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: (0, import_css54.cx)((0, import_browser82.withVendorCSSClassPrefix)("user-dropdown__header"), styles["dropdownHeader"]), children: [
|
|
14153
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
14124
14154
|
Avatar,
|
|
14125
14155
|
{
|
|
14126
14156
|
imageUrl: getMappedUserProfileValue_default("picture", mergedMappings, user),
|
|
@@ -14129,8 +14159,8 @@ var BaseUserDropdown = ({
|
|
|
14129
14159
|
alt: `${getDisplayName_default(mergedMappings, user)}'s avatar`
|
|
14130
14160
|
}
|
|
14131
14161
|
),
|
|
14132
|
-
/* @__PURE__ */ (0,
|
|
14133
|
-
/* @__PURE__ */ (0,
|
|
14162
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: (0, import_css54.cx)((0, import_browser82.withVendorCSSClassPrefix)("user-dropdown__header-info"), styles["headerInfo"]), children: [
|
|
14163
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
14134
14164
|
Typography_default,
|
|
14135
14165
|
{
|
|
14136
14166
|
noWrap: true,
|
|
@@ -14140,7 +14170,7 @@ var BaseUserDropdown = ({
|
|
|
14140
14170
|
children: getDisplayName_default(mergedMappings, user)
|
|
14141
14171
|
}
|
|
14142
14172
|
),
|
|
14143
|
-
/* @__PURE__ */ (0,
|
|
14173
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
14144
14174
|
Typography_default,
|
|
14145
14175
|
{
|
|
14146
14176
|
noWrap: true,
|
|
@@ -14152,9 +14182,9 @@ var BaseUserDropdown = ({
|
|
|
14152
14182
|
)
|
|
14153
14183
|
] })
|
|
14154
14184
|
] }),
|
|
14155
|
-
/* @__PURE__ */ (0,
|
|
14185
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: (0, import_css54.cx)((0, import_browser82.withVendorCSSClassPrefix)("user-dropdown__menu"), styles["dropdownMenu"]), children: allMenuItems.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { children: (() => {
|
|
14156
14186
|
if (item.label === "") {
|
|
14157
|
-
return /* @__PURE__ */ (0,
|
|
14187
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
14158
14188
|
"div",
|
|
14159
14189
|
{
|
|
14160
14190
|
className: (0, import_css54.cx)((0, import_browser82.withVendorCSSClassPrefix)("user-dropdown__menu-divider"), styles["divider"])
|
|
@@ -14162,7 +14192,7 @@ var BaseUserDropdown = ({
|
|
|
14162
14192
|
);
|
|
14163
14193
|
}
|
|
14164
14194
|
if (item.href) {
|
|
14165
|
-
return /* @__PURE__ */ (0,
|
|
14195
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(
|
|
14166
14196
|
"a",
|
|
14167
14197
|
{
|
|
14168
14198
|
href: item.href,
|
|
@@ -14179,12 +14209,12 @@ var BaseUserDropdown = ({
|
|
|
14179
14209
|
onBlur: () => setHoveredItemIndex(null),
|
|
14180
14210
|
children: [
|
|
14181
14211
|
item.icon,
|
|
14182
|
-
/* @__PURE__ */ (0,
|
|
14212
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("span", { children: item.label })
|
|
14183
14213
|
]
|
|
14184
14214
|
}
|
|
14185
14215
|
);
|
|
14186
14216
|
}
|
|
14187
|
-
return /* @__PURE__ */ (0,
|
|
14217
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
14188
14218
|
Button_default,
|
|
14189
14219
|
{
|
|
14190
14220
|
onClick: () => handleMenuItemClick(item),
|
|
@@ -14211,7 +14241,7 @@ var BaseUserDropdown_default = BaseUserDropdown;
|
|
|
14211
14241
|
|
|
14212
14242
|
// src/components/presentation/UserDropdown/UserDropdown.tsx
|
|
14213
14243
|
var import_react88 = require("react");
|
|
14214
|
-
var
|
|
14244
|
+
var import_jsx_runtime98 = require("react/jsx-runtime");
|
|
14215
14245
|
var UserDropdown = ({
|
|
14216
14246
|
children,
|
|
14217
14247
|
renderTrigger,
|
|
@@ -14243,14 +14273,14 @@ var UserDropdown = ({
|
|
|
14243
14273
|
user
|
|
14244
14274
|
};
|
|
14245
14275
|
if (children) {
|
|
14246
|
-
return /* @__PURE__ */ (0,
|
|
14276
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(import_jsx_runtime98.Fragment, { children: [
|
|
14247
14277
|
children(renderProps),
|
|
14248
|
-
/* @__PURE__ */ (0,
|
|
14278
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(UserProfile_default, { mode: "popup", open: isProfileOpen, onOpenChange: setIsProfileOpen })
|
|
14249
14279
|
] });
|
|
14250
14280
|
}
|
|
14251
14281
|
if (renderTrigger || renderDropdown) {
|
|
14252
|
-
return /* @__PURE__ */ (0,
|
|
14253
|
-
renderTrigger ? renderTrigger(renderProps) : /* @__PURE__ */ (0,
|
|
14282
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(import_jsx_runtime98.Fragment, { children: [
|
|
14283
|
+
renderTrigger ? renderTrigger(renderProps) : /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
14254
14284
|
BaseUserDropdown,
|
|
14255
14285
|
{
|
|
14256
14286
|
user,
|
|
@@ -14260,11 +14290,11 @@ var UserDropdown = ({
|
|
|
14260
14290
|
...rest
|
|
14261
14291
|
}
|
|
14262
14292
|
),
|
|
14263
|
-
/* @__PURE__ */ (0,
|
|
14293
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(UserProfile_default, { mode: "popup", open: isProfileOpen, onOpenChange: setIsProfileOpen })
|
|
14264
14294
|
] });
|
|
14265
14295
|
}
|
|
14266
|
-
return /* @__PURE__ */ (0,
|
|
14267
|
-
/* @__PURE__ */ (0,
|
|
14296
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(import_jsx_runtime98.Fragment, { children: [
|
|
14297
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
14268
14298
|
BaseUserDropdown,
|
|
14269
14299
|
{
|
|
14270
14300
|
user,
|
|
@@ -14274,7 +14304,7 @@ var UserDropdown = ({
|
|
|
14274
14304
|
...rest
|
|
14275
14305
|
}
|
|
14276
14306
|
),
|
|
14277
|
-
isProfileOpen && /* @__PURE__ */ (0,
|
|
14307
|
+
isProfileOpen && /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(UserProfile_default, { mode: "popup", open: isProfileOpen, onOpenChange: setIsProfileOpen })
|
|
14278
14308
|
] });
|
|
14279
14309
|
};
|
|
14280
14310
|
var UserDropdown_default = UserDropdown;
|
|
@@ -14510,9 +14540,9 @@ var useStyles25 = (theme, colorScheme) => (0, import_react89.useMemo)(() => {
|
|
|
14510
14540
|
var BaseOrganizationSwitcher_styles_default = useStyles25;
|
|
14511
14541
|
|
|
14512
14542
|
// src/components/primitives/Icons/Building.tsx
|
|
14513
|
-
var
|
|
14514
|
-
var Building = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */ (0,
|
|
14515
|
-
/* @__PURE__ */ (0,
|
|
14543
|
+
var import_jsx_runtime99 = require("react/jsx-runtime");
|
|
14544
|
+
var Building = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)("svg", { width, height, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
14545
|
+
/* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
|
|
14516
14546
|
"path",
|
|
14517
14547
|
{
|
|
14518
14548
|
d: "M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",
|
|
@@ -14522,30 +14552,30 @@ var Building = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PU
|
|
|
14522
14552
|
strokeLinejoin: "round"
|
|
14523
14553
|
}
|
|
14524
14554
|
),
|
|
14525
|
-
/* @__PURE__ */ (0,
|
|
14526
|
-
/* @__PURE__ */ (0,
|
|
14527
|
-
/* @__PURE__ */ (0,
|
|
14528
|
-
/* @__PURE__ */ (0,
|
|
14529
|
-
/* @__PURE__ */ (0,
|
|
14530
|
-
/* @__PURE__ */ (0,
|
|
14555
|
+
/* @__PURE__ */ (0, import_jsx_runtime99.jsx)("path", { d: "M6 12h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
14556
|
+
/* @__PURE__ */ (0, import_jsx_runtime99.jsx)("path", { d: "M6 8h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
14557
|
+
/* @__PURE__ */ (0, import_jsx_runtime99.jsx)("path", { d: "M14 8h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
14558
|
+
/* @__PURE__ */ (0, import_jsx_runtime99.jsx)("path", { d: "M14 12h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
14559
|
+
/* @__PURE__ */ (0, import_jsx_runtime99.jsx)("path", { d: "M6 18h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
14560
|
+
/* @__PURE__ */ (0, import_jsx_runtime99.jsx)("path", { d: "M14 18h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
14531
14561
|
] });
|
|
14532
14562
|
Building.displayName = "Building";
|
|
14533
14563
|
var Building_default = Building;
|
|
14534
14564
|
|
|
14535
14565
|
// src/components/primitives/Icons/Check.tsx
|
|
14536
|
-
var
|
|
14537
|
-
var Check = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */ (0,
|
|
14566
|
+
var import_jsx_runtime100 = require("react/jsx-runtime");
|
|
14567
|
+
var Check = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("svg", { width, height, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("path", { d: "M20 6 9 17l-5-5", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
14538
14568
|
Check.displayName = "Check";
|
|
14539
14569
|
var Check_default = Check;
|
|
14540
14570
|
|
|
14541
14571
|
// src/components/primitives/Icons/ChevronDown.tsx
|
|
14542
|
-
var
|
|
14543
|
-
var ChevronDown = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */ (0,
|
|
14572
|
+
var import_jsx_runtime101 = require("react/jsx-runtime");
|
|
14573
|
+
var ChevronDown = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("svg", { width, height, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("path", { d: "m6 9 6 6 6-6", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
14544
14574
|
ChevronDown.displayName = "ChevronDown";
|
|
14545
14575
|
var ChevronDown_default = ChevronDown;
|
|
14546
14576
|
|
|
14547
14577
|
// src/components/presentation/OrganizationSwitcher/BaseOrganizationSwitcher.tsx
|
|
14548
|
-
var
|
|
14578
|
+
var import_jsx_runtime102 = require("react/jsx-runtime");
|
|
14549
14579
|
var BaseOrganizationSwitcher = ({
|
|
14550
14580
|
organizations,
|
|
14551
14581
|
currentOrganization,
|
|
@@ -14600,8 +14630,8 @@ var BaseOrganizationSwitcher = ({
|
|
|
14600
14630
|
const switchableOrganizations = organizations.filter(
|
|
14601
14631
|
(org) => org.id !== currentOrganization?.id
|
|
14602
14632
|
);
|
|
14603
|
-
const defaultRenderOrganization2 = (organization, isSelected) => /* @__PURE__ */ (0,
|
|
14604
|
-
/* @__PURE__ */ (0,
|
|
14633
|
+
const defaultRenderOrganization2 = (organization, isSelected) => /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(import_jsx_runtime102.Fragment, { children: [
|
|
14634
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
|
|
14605
14635
|
Avatar,
|
|
14606
14636
|
{
|
|
14607
14637
|
variant: "square",
|
|
@@ -14611,24 +14641,24 @@ var BaseOrganizationSwitcher = ({
|
|
|
14611
14641
|
alt: `${organization.name} avatar`
|
|
14612
14642
|
}
|
|
14613
14643
|
),
|
|
14614
|
-
/* @__PURE__ */ (0,
|
|
14615
|
-
/* @__PURE__ */ (0,
|
|
14616
|
-
/* @__PURE__ */ (0,
|
|
14617
|
-
showMemberCount && organization.memberCount !== void 0 && /* @__PURE__ */ (0,
|
|
14644
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("div", { className: (0, import_css56.cx)(styles["organizationInfo"]), children: [
|
|
14645
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)(Typography_default, { variant: "body2", fontWeight: "medium", className: (0, import_css56.cx)(styles["organizationName"]), children: organization.name }),
|
|
14646
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("div", { className: (0, import_css56.cx)(styles["organizationMeta"]), children: [
|
|
14647
|
+
showMemberCount && organization.memberCount !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("span", { children: [
|
|
14618
14648
|
organization.memberCount,
|
|
14619
14649
|
" ",
|
|
14620
14650
|
organization.memberCount === 1 ? t("organization.switcher.member") : t("organization.switcher.members")
|
|
14621
14651
|
] }),
|
|
14622
|
-
showRole && organization.role && showMemberCount && organization.memberCount !== void 0 && /* @__PURE__ */ (0,
|
|
14623
|
-
showRole && organization.role && /* @__PURE__ */ (0,
|
|
14652
|
+
showRole && organization.role && showMemberCount && organization.memberCount !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("span", { children: " \u2022 " }),
|
|
14653
|
+
showRole && organization.role && /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("span", { className: (0, import_css56.cx)(styles["roleCapitalized"]), children: organization.role })
|
|
14624
14654
|
] })
|
|
14625
14655
|
] }),
|
|
14626
|
-
isSelected && /* @__PURE__ */ (0,
|
|
14656
|
+
isSelected && /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(Check_default, { width: "16", height: "16", color: theme.vars.colors.text.primary })
|
|
14627
14657
|
] });
|
|
14628
|
-
const defaultRenderLoading2 = () => /* @__PURE__ */ (0,
|
|
14629
|
-
const defaultRenderError2 = (errorMessage) => /* @__PURE__ */ (0,
|
|
14630
|
-
return /* @__PURE__ */ (0,
|
|
14631
|
-
/* @__PURE__ */ (0,
|
|
14658
|
+
const defaultRenderLoading2 = () => /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { className: (0, import_css56.cx)(styles["loadingContainer"]), children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(Typography_default, { variant: "caption", className: (0, import_css56.cx)(styles["loadingText"]), children: t("organization.switcher.loading.placeholder.organizations") }) });
|
|
14659
|
+
const defaultRenderError2 = (errorMessage) => /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { className: (0, import_css56.cx)(styles["errorContainer"]), children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(Typography_default, { variant: "caption", className: (0, import_css56.cx)(styles["errorText"]), children: errorMessage }) });
|
|
14660
|
+
return /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("div", { className: (0, import_css56.cx)(styles["root"], className), style, children: [
|
|
14661
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(
|
|
14632
14662
|
Button_default,
|
|
14633
14663
|
{
|
|
14634
14664
|
ref: refs.setReference,
|
|
@@ -14638,8 +14668,8 @@ var BaseOrganizationSwitcher = ({
|
|
|
14638
14668
|
size: "medium",
|
|
14639
14669
|
...getReferenceProps(),
|
|
14640
14670
|
children: [
|
|
14641
|
-
currentOrganization ? /* @__PURE__ */ (0,
|
|
14642
|
-
/* @__PURE__ */ (0,
|
|
14671
|
+
currentOrganization ? /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(import_jsx_runtime102.Fragment, { children: [
|
|
14672
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
|
|
14643
14673
|
Avatar,
|
|
14644
14674
|
{
|
|
14645
14675
|
variant: "square",
|
|
@@ -14649,16 +14679,16 @@ var BaseOrganizationSwitcher = ({
|
|
|
14649
14679
|
alt: `${currentOrganization.name} avatar`
|
|
14650
14680
|
}
|
|
14651
14681
|
),
|
|
14652
|
-
showTriggerLabel && /* @__PURE__ */ (0,
|
|
14653
|
-
] }) : /* @__PURE__ */ (0,
|
|
14654
|
-
/* @__PURE__ */ (0,
|
|
14655
|
-
showTriggerLabel && /* @__PURE__ */ (0,
|
|
14682
|
+
showTriggerLabel && /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(Typography_default, { variant: "body2", className: (0, import_css56.cx)(styles["triggerLabel"]), children: currentOrganization.name })
|
|
14683
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(import_jsx_runtime102.Fragment, { children: [
|
|
14684
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)(Building_default, { width: avatarSize, height: avatarSize }),
|
|
14685
|
+
showTriggerLabel && /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(Typography_default, { variant: "body2", className: (0, import_css56.cx)(styles["triggerLabel"]), children: t("elements.fields.organization.select.label") })
|
|
14656
14686
|
] }),
|
|
14657
|
-
/* @__PURE__ */ (0,
|
|
14687
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)("span", { style: { display: "inline-flex", transform: isRTL ? "scaleX(-1)" : "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(ChevronDown_default, { width: "16", height: "16" }) })
|
|
14658
14688
|
]
|
|
14659
14689
|
}
|
|
14660
14690
|
),
|
|
14661
|
-
isOpen && /* @__PURE__ */ (0,
|
|
14691
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(import_react90.FloatingPortal, { id: portalId, children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(import_react90.FloatingFocusManager, { context, modal: false, initialFocus: -1, children: /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(
|
|
14662
14692
|
"div",
|
|
14663
14693
|
{
|
|
14664
14694
|
ref: refs.setFloating,
|
|
@@ -14666,8 +14696,8 @@ var BaseOrganizationSwitcher = ({
|
|
|
14666
14696
|
style: floatingStyles,
|
|
14667
14697
|
...getFloatingProps(),
|
|
14668
14698
|
children: [
|
|
14669
|
-
currentOrganization && /* @__PURE__ */ (0,
|
|
14670
|
-
/* @__PURE__ */ (0,
|
|
14699
|
+
currentOrganization && /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("div", { className: (0, import_css56.cx)(styles["header"]), children: [
|
|
14700
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
|
|
14671
14701
|
Avatar,
|
|
14672
14702
|
{
|
|
14673
14703
|
variant: "square",
|
|
@@ -14677,10 +14707,10 @@ var BaseOrganizationSwitcher = ({
|
|
|
14677
14707
|
alt: `${currentOrganization.name} avatar`
|
|
14678
14708
|
}
|
|
14679
14709
|
),
|
|
14680
|
-
/* @__PURE__ */ (0,
|
|
14681
|
-
/* @__PURE__ */ (0,
|
|
14682
|
-
/* @__PURE__ */ (0,
|
|
14683
|
-
showMemberCount && currentOrganization.memberCount !== void 0 && /* @__PURE__ */ (0,
|
|
14710
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("div", { className: (0, import_css56.cx)(styles["headerInfo"]), children: [
|
|
14711
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)(Typography_default, { noWrap: true, className: (0, import_css56.cx)(styles["headerName"]), variant: "body1", fontWeight: "medium", children: currentOrganization.name }),
|
|
14712
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("div", { className: (0, import_css56.cx)(styles["headerMeta"]), children: [
|
|
14713
|
+
showMemberCount && currentOrganization.memberCount !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(
|
|
14684
14714
|
Typography_default,
|
|
14685
14715
|
{
|
|
14686
14716
|
noWrap: true,
|
|
@@ -14690,17 +14720,17 @@ var BaseOrganizationSwitcher = ({
|
|
|
14690
14720
|
currentOrganization.memberCount,
|
|
14691
14721
|
" ",
|
|
14692
14722
|
currentOrganization.memberCount === 1 ? t("organization.switcher.member") : t("organization.switcher.members"),
|
|
14693
|
-
showRole && currentOrganization.role && /* @__PURE__ */ (0,
|
|
14723
|
+
showRole && currentOrganization.role && /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("span", { children: [
|
|
14694
14724
|
" \u2022 ",
|
|
14695
14725
|
currentOrganization.role
|
|
14696
14726
|
] })
|
|
14697
14727
|
]
|
|
14698
14728
|
}
|
|
14699
14729
|
),
|
|
14700
|
-
showRole && currentOrganization.role && (!showMemberCount || currentOrganization.memberCount === void 0) && /* @__PURE__ */ (0,
|
|
14730
|
+
showRole && currentOrganization.role && (!showMemberCount || currentOrganization.memberCount === void 0) && /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(Typography_default, { noWrap: true, className: (0, import_css56.cx)(styles["headerRole"]), variant: "caption", color: "secondary", children: currentOrganization.role })
|
|
14701
14731
|
] })
|
|
14702
14732
|
] }),
|
|
14703
|
-
onManageProfile && /* @__PURE__ */ (0,
|
|
14733
|
+
onManageProfile && /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
|
|
14704
14734
|
Button_default,
|
|
14705
14735
|
{
|
|
14706
14736
|
onClick: onManageProfile,
|
|
@@ -14709,7 +14739,7 @@ var BaseOrganizationSwitcher = ({
|
|
|
14709
14739
|
size: "small",
|
|
14710
14740
|
"aria-label": "Manage Organization Profile",
|
|
14711
14741
|
className: (0, import_css56.cx)(styles["manageButton"]),
|
|
14712
|
-
endIcon: /* @__PURE__ */ (0,
|
|
14742
|
+
endIcon: /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(
|
|
14713
14743
|
"svg",
|
|
14714
14744
|
{
|
|
14715
14745
|
width: "16",
|
|
@@ -14721,8 +14751,8 @@ var BaseOrganizationSwitcher = ({
|
|
|
14721
14751
|
strokeLinecap: "round",
|
|
14722
14752
|
strokeLinejoin: "round",
|
|
14723
14753
|
children: [
|
|
14724
|
-
/* @__PURE__ */ (0,
|
|
14725
|
-
/* @__PURE__ */ (0,
|
|
14754
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)("circle", { cx: "12", cy: "12", r: "3" }),
|
|
14755
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)("path", { d: "M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1 1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z" })
|
|
14726
14756
|
]
|
|
14727
14757
|
}
|
|
14728
14758
|
),
|
|
@@ -14730,27 +14760,27 @@ var BaseOrganizationSwitcher = ({
|
|
|
14730
14760
|
}
|
|
14731
14761
|
)
|
|
14732
14762
|
] }),
|
|
14733
|
-
organizations.length > 1 && /* @__PURE__ */ (0,
|
|
14763
|
+
organizations.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
|
|
14734
14764
|
"div",
|
|
14735
14765
|
{
|
|
14736
14766
|
className: (0, import_css56.cx)(styles["header"], styles["sectionHeaderContainer"]),
|
|
14737
14767
|
style: {
|
|
14738
14768
|
borderTop: currentOrganization ? `1px solid ${theme.vars.colors.border}` : "none"
|
|
14739
14769
|
},
|
|
14740
|
-
children: /* @__PURE__ */ (0,
|
|
14770
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(Typography_default, { variant: "caption", fontWeight: 600, className: (0, import_css56.cx)(styles["sectionHeader"]), children: t("organization.switcher.switch.organization") })
|
|
14741
14771
|
}
|
|
14742
14772
|
),
|
|
14743
|
-
/* @__PURE__ */ (0,
|
|
14773
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { className: (0, import_css56.cx)(styles["menu"]), children: (() => {
|
|
14744
14774
|
if (loading) {
|
|
14745
14775
|
return renderLoading ? renderLoading() : defaultRenderLoading2();
|
|
14746
14776
|
}
|
|
14747
14777
|
if (error) {
|
|
14748
14778
|
return renderError ? renderError(error) : defaultRenderError2(error);
|
|
14749
14779
|
}
|
|
14750
|
-
return /* @__PURE__ */ (0,
|
|
14780
|
+
return /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(import_jsx_runtime102.Fragment, { children: [
|
|
14751
14781
|
switchableOrganizations.map((organization) => {
|
|
14752
14782
|
const isSelected = false;
|
|
14753
|
-
return /* @__PURE__ */ (0,
|
|
14783
|
+
return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
|
|
14754
14784
|
Button_default,
|
|
14755
14785
|
{
|
|
14756
14786
|
onClick: () => handleOrganizationSwitch(organization),
|
|
@@ -14768,10 +14798,10 @@ var BaseOrganizationSwitcher = ({
|
|
|
14768
14798
|
organization.id
|
|
14769
14799
|
);
|
|
14770
14800
|
}),
|
|
14771
|
-
menuItems.length > 0 && /* @__PURE__ */ (0,
|
|
14772
|
-
/* @__PURE__ */ (0,
|
|
14801
|
+
menuItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(import_jsx_runtime102.Fragment, { children: [
|
|
14802
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { className: (0, import_css56.cx)(styles["menuDivider"]) }),
|
|
14773
14803
|
menuItems.map(
|
|
14774
|
-
(item, index) => /* @__PURE__ */ (0,
|
|
14804
|
+
(item, index) => /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { children: item.href ? /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(
|
|
14775
14805
|
"a",
|
|
14776
14806
|
{
|
|
14777
14807
|
href: item.href,
|
|
@@ -14785,10 +14815,10 @@ var BaseOrganizationSwitcher = ({
|
|
|
14785
14815
|
onBlur: () => setHoveredItemIndex(null),
|
|
14786
14816
|
children: [
|
|
14787
14817
|
item.icon,
|
|
14788
|
-
/* @__PURE__ */ (0,
|
|
14818
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)("span", { children: item.label })
|
|
14789
14819
|
]
|
|
14790
14820
|
}
|
|
14791
|
-
) : /* @__PURE__ */ (0,
|
|
14821
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
|
|
14792
14822
|
Button_default,
|
|
14793
14823
|
{
|
|
14794
14824
|
onClick: () => handleMenuItemClick(item),
|
|
@@ -14820,8 +14850,8 @@ var BaseOrganizationSwitcher_default = BaseOrganizationSwitcher;
|
|
|
14820
14850
|
var import_react104 = require("react");
|
|
14821
14851
|
|
|
14822
14852
|
// src/components/primitives/Icons/BuildingAlt.tsx
|
|
14823
|
-
var
|
|
14824
|
-
var BuildingAlt = ({ height = 24, width = 24 }) => /* @__PURE__ */ (0,
|
|
14853
|
+
var import_jsx_runtime103 = require("react/jsx-runtime");
|
|
14854
|
+
var BuildingAlt = ({ height = 24, width = 24 }) => /* @__PURE__ */ (0, import_jsx_runtime103.jsxs)(
|
|
14825
14855
|
"svg",
|
|
14826
14856
|
{
|
|
14827
14857
|
width,
|
|
@@ -14834,13 +14864,13 @@ var BuildingAlt = ({ height = 24, width = 24 }) => /* @__PURE__ */ (0, import_js
|
|
|
14834
14864
|
strokeLinecap: "round",
|
|
14835
14865
|
strokeLinejoin: "round",
|
|
14836
14866
|
children: [
|
|
14837
|
-
/* @__PURE__ */ (0,
|
|
14838
|
-
/* @__PURE__ */ (0,
|
|
14839
|
-
/* @__PURE__ */ (0,
|
|
14840
|
-
/* @__PURE__ */ (0,
|
|
14841
|
-
/* @__PURE__ */ (0,
|
|
14842
|
-
/* @__PURE__ */ (0,
|
|
14843
|
-
/* @__PURE__ */ (0,
|
|
14867
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsx)("path", { d: "M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z" }),
|
|
14868
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsx)("path", { d: "M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2" }),
|
|
14869
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsx)("path", { d: "M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2" }),
|
|
14870
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsx)("path", { d: "M10 6h4" }),
|
|
14871
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsx)("path", { d: "M10 10h4" }),
|
|
14872
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsx)("path", { d: "M10 14h4" }),
|
|
14873
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsx)("path", { d: "M10 18h4" })
|
|
14844
14874
|
]
|
|
14845
14875
|
}
|
|
14846
14876
|
);
|
|
@@ -14994,7 +15024,7 @@ var useStyles26 = (theme, colorScheme) => (0, import_react92.useMemo)(() => {
|
|
|
14994
15024
|
var BaseCreateOrganization_styles_default = useStyles26;
|
|
14995
15025
|
|
|
14996
15026
|
// src/components/presentation/CreateOrganization/BaseCreateOrganization.tsx
|
|
14997
|
-
var
|
|
15027
|
+
var import_jsx_runtime104 = require("react/jsx-runtime");
|
|
14998
15028
|
var logger8 = (0, import_browser83.createPackageComponentLogger)(
|
|
14999
15029
|
"@asgardeo/react",
|
|
15000
15030
|
"BaseCreateOrganization"
|
|
@@ -15084,13 +15114,13 @@ var BaseCreateOrganization = ({
|
|
|
15084
15114
|
logger8.error("Form submission error:");
|
|
15085
15115
|
}
|
|
15086
15116
|
};
|
|
15087
|
-
const createOrganizationContent = /* @__PURE__ */ (0,
|
|
15088
|
-
/* @__PURE__ */ (0,
|
|
15089
|
-
error && /* @__PURE__ */ (0,
|
|
15090
|
-
/* @__PURE__ */ (0,
|
|
15091
|
-
/* @__PURE__ */ (0,
|
|
15117
|
+
const createOrganizationContent = /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("div", { className: (0, import_css58.cx)(styles["root"], cardLayout && styles["card"], className), style, children: /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)("div", { className: (0, import_css58.cx)(styles["content"]), children: [
|
|
15118
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsxs)("form", { id: "create-organization-form", className: (0, import_css58.cx)(styles["form"]), onSubmit: handleSubmit, children: [
|
|
15119
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)(Alert_default, { variant: "error", className: styles["errorAlert"], children: [
|
|
15120
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)(Alert_default.Title, { children: "Error" }),
|
|
15121
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)(Alert_default.Description, { children: error })
|
|
15092
15122
|
] }),
|
|
15093
|
-
/* @__PURE__ */ (0,
|
|
15123
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)("div", { className: (0, import_css58.cx)(styles["fieldGroup"]), children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
|
|
15094
15124
|
TextField_default,
|
|
15095
15125
|
{
|
|
15096
15126
|
label: `${t("elements.fields.organization.name.label")}`,
|
|
@@ -15103,7 +15133,7 @@ var BaseCreateOrganization = ({
|
|
|
15103
15133
|
className: (0, import_css58.cx)(styles["input"])
|
|
15104
15134
|
}
|
|
15105
15135
|
) }),
|
|
15106
|
-
/* @__PURE__ */ (0,
|
|
15136
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)("div", { className: (0, import_css58.cx)(styles["fieldGroup"]), children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
|
|
15107
15137
|
TextField_default,
|
|
15108
15138
|
{
|
|
15109
15139
|
label: `${t("elements.fields.organization.handle.label") || "Organization Handle"}`,
|
|
@@ -15117,9 +15147,9 @@ var BaseCreateOrganization = ({
|
|
|
15117
15147
|
className: (0, import_css58.cx)(styles["input"])
|
|
15118
15148
|
}
|
|
15119
15149
|
) }),
|
|
15120
|
-
/* @__PURE__ */ (0,
|
|
15121
|
-
/* @__PURE__ */ (0,
|
|
15122
|
-
/* @__PURE__ */ (0,
|
|
15150
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)("div", { className: (0, import_css58.cx)(styles["fieldGroup"]), children: /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)(FormControl_default, { error: formErrors.description, children: [
|
|
15151
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)(InputLabel_default, { required: true, children: t("elements.fields.organization.description.label") }),
|
|
15152
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
|
|
15123
15153
|
"textarea",
|
|
15124
15154
|
{
|
|
15125
15155
|
className: (0, import_css58.cx)(styles["textarea"], formErrors.description && styles["textareaError"]),
|
|
@@ -15133,15 +15163,15 @@ var BaseCreateOrganization = ({
|
|
|
15133
15163
|
] }) }),
|
|
15134
15164
|
renderAdditionalFields && renderAdditionalFields()
|
|
15135
15165
|
] }),
|
|
15136
|
-
/* @__PURE__ */ (0,
|
|
15137
|
-
onCancel && /* @__PURE__ */ (0,
|
|
15138
|
-
/* @__PURE__ */ (0,
|
|
15166
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsxs)("div", { className: (0, import_css58.cx)(styles["actions"]), children: [
|
|
15167
|
+
onCancel && /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(Button_default, { type: "button", variant: "outline", onClick: onCancel, disabled: loading, children: t("organization.create.buttons.cancel.text") }),
|
|
15168
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)(Button_default, { type: "submit", variant: "solid", color: "primary", disabled: loading, form: "create-organization-form", children: loading ? t("organization.create.buttons.create_organization.loading.text") : t("organization.create.buttons.create_organization.text") })
|
|
15139
15169
|
] })
|
|
15140
15170
|
] }) });
|
|
15141
15171
|
if (mode === "popup") {
|
|
15142
|
-
return /* @__PURE__ */ (0,
|
|
15143
|
-
/* @__PURE__ */ (0,
|
|
15144
|
-
/* @__PURE__ */ (0,
|
|
15172
|
+
return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)(Dialog_default.Content, { children: [
|
|
15173
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)(Dialog_default.Heading, { children: title }),
|
|
15174
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)("div", { className: styles["popup"], children: createOrganizationContent })
|
|
15145
15175
|
] }) });
|
|
15146
15176
|
}
|
|
15147
15177
|
return createOrganizationContent;
|
|
@@ -15179,7 +15209,7 @@ var createOrganization = async ({
|
|
|
15179
15209
|
var createOrganization_default = createOrganization;
|
|
15180
15210
|
|
|
15181
15211
|
// src/components/presentation/CreateOrganization/CreateOrganization.tsx
|
|
15182
|
-
var
|
|
15212
|
+
var import_jsx_runtime105 = require("react/jsx-runtime");
|
|
15183
15213
|
var CreateOrganization = ({
|
|
15184
15214
|
onCreateOrganization,
|
|
15185
15215
|
fallback = null,
|
|
@@ -15195,7 +15225,7 @@ var CreateOrganization = ({
|
|
|
15195
15225
|
return fallback;
|
|
15196
15226
|
}
|
|
15197
15227
|
if (!isSignedIn) {
|
|
15198
|
-
return /* @__PURE__ */ (0,
|
|
15228
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_jsx_runtime105.Fragment, {});
|
|
15199
15229
|
}
|
|
15200
15230
|
const parentId = defaultParentId || currentOrganization?.id || "";
|
|
15201
15231
|
const handleSubmit = async (payload) => {
|
|
@@ -15230,7 +15260,7 @@ var CreateOrganization = ({
|
|
|
15230
15260
|
setLoading(false);
|
|
15231
15261
|
}
|
|
15232
15262
|
};
|
|
15233
|
-
return /* @__PURE__ */ (0,
|
|
15263
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
15234
15264
|
BaseCreateOrganization,
|
|
15235
15265
|
{
|
|
15236
15266
|
onSubmit: handleSubmit,
|
|
@@ -15478,20 +15508,20 @@ var useStyles27 = (theme, colorScheme) => (0, import_react95.useMemo)(() => {
|
|
|
15478
15508
|
var BaseOrganizationList_styles_default = useStyles27;
|
|
15479
15509
|
|
|
15480
15510
|
// src/components/presentation/OrganizationList/BaseOrganizationList.tsx
|
|
15481
|
-
var
|
|
15482
|
-
var defaultRenderOrganization = (organization, styles, t, onOrganizationSelect, showStatus) => /* @__PURE__ */ (0,
|
|
15483
|
-
/* @__PURE__ */ (0,
|
|
15484
|
-
/* @__PURE__ */ (0,
|
|
15485
|
-
/* @__PURE__ */ (0,
|
|
15486
|
-
/* @__PURE__ */ (0,
|
|
15487
|
-
/* @__PURE__ */ (0,
|
|
15511
|
+
var import_jsx_runtime106 = require("react/jsx-runtime");
|
|
15512
|
+
var defaultRenderOrganization = (organization, styles, t, onOrganizationSelect, showStatus) => /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)("div", { className: (0, import_css60.cx)(styles.organizationItem), children: [
|
|
15513
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsxs)("div", { className: (0, import_css60.cx)(styles.organizationContent), children: [
|
|
15514
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsx)(Avatar, { variant: "square", name: organization.name, size: 48, alt: `${organization.name} logo` }),
|
|
15515
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsxs)("div", { className: (0, import_css60.cx)(styles.organizationInfo), children: [
|
|
15516
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsx)(Typography_default, { variant: "h6", className: (0, import_css60.cx)(styles.organizationName), children: organization.name }),
|
|
15517
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsxs)(Typography_default, { variant: "body2", color: "textSecondary", className: (0, import_css60.cx)(styles.organizationHandle), children: [
|
|
15488
15518
|
"@",
|
|
15489
15519
|
organization.orgHandle
|
|
15490
15520
|
] }),
|
|
15491
|
-
showStatus && /* @__PURE__ */ (0,
|
|
15521
|
+
showStatus && /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)(Typography_default, { variant: "body2", color: "textSecondary", className: (0, import_css60.cx)(styles.organizationStatus), children: [
|
|
15492
15522
|
t("organization.switcher.status.label"),
|
|
15493
15523
|
" ",
|
|
15494
|
-
/* @__PURE__ */ (0,
|
|
15524
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
|
|
15495
15525
|
"span",
|
|
15496
15526
|
{
|
|
15497
15527
|
className: (0, import_css60.cx)(
|
|
@@ -15504,7 +15534,7 @@ var defaultRenderOrganization = (organization, styles, t, onOrganizationSelect,
|
|
|
15504
15534
|
] })
|
|
15505
15535
|
] })
|
|
15506
15536
|
] }),
|
|
15507
|
-
organization.canSwitch && /* @__PURE__ */ (0,
|
|
15537
|
+
organization.canSwitch && /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("div", { className: (0, import_css60.cx)(styles.organizationActions), children: /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
|
|
15508
15538
|
Button_default,
|
|
15509
15539
|
{
|
|
15510
15540
|
onClick: (e) => {
|
|
@@ -15517,17 +15547,17 @@ var defaultRenderOrganization = (organization, styles, t, onOrganizationSelect,
|
|
|
15517
15547
|
}
|
|
15518
15548
|
) })
|
|
15519
15549
|
] }, organization.id);
|
|
15520
|
-
var defaultRenderLoading = (t, styles) => /* @__PURE__ */ (0,
|
|
15521
|
-
/* @__PURE__ */ (0,
|
|
15522
|
-
/* @__PURE__ */ (0,
|
|
15550
|
+
var defaultRenderLoading = (t, styles) => /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)("div", { className: (0, import_css60.cx)(styles.loadingContainer), children: [
|
|
15551
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsx)(Spinner_default, { size: "medium" }),
|
|
15552
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsx)(Typography_default, { variant: "body1", color: "textSecondary", className: (0, import_css60.cx)(styles.loadingText), children: t("organization.switcher.loading.placeholder.organizations") })
|
|
15523
15553
|
] });
|
|
15524
|
-
var defaultRenderError = (errorMessage, t, styles) => /* @__PURE__ */ (0,
|
|
15525
|
-
/* @__PURE__ */ (0,
|
|
15554
|
+
var defaultRenderError = (errorMessage, t, styles) => /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("div", { className: (0, import_css60.cx)(styles.errorContainer), children: /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)(Typography_default, { variant: "body1", color: "error", children: [
|
|
15555
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsx)("strong", { children: t("organization.switcher.error.prefix") }),
|
|
15526
15556
|
" ",
|
|
15527
15557
|
errorMessage
|
|
15528
15558
|
] }) });
|
|
15529
|
-
var defaultRenderLoadMore = (onLoadMore, isLoadingMore, t, styles) => /* @__PURE__ */ (0,
|
|
15530
|
-
var defaultRenderEmpty = (t, styles) => /* @__PURE__ */ (0,
|
|
15559
|
+
var defaultRenderLoadMore = (onLoadMore, isLoadingMore, t, styles) => /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(Button_default, { onClick: onLoadMore, disabled: isLoadingMore, className: (0, import_css60.cx)(styles.loadMoreButton), type: "button", fullWidth: true, children: isLoadingMore ? t("organization.switcher.loading.more") : t("organization.switcher.buttons.load_more.text") });
|
|
15560
|
+
var defaultRenderEmpty = (t, styles) => /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("div", { className: (0, import_css60.cx)(styles.emptyContainer), children: /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(Typography_default, { variant: "body1", color: "textSecondary", className: (0, import_css60.cx)(styles.emptyText), children: t("organization.switcher.no.organizations") }) });
|
|
15531
15561
|
var BaseOrganizationList = ({
|
|
15532
15562
|
className = "",
|
|
15533
15563
|
allOrganizations,
|
|
@@ -15571,42 +15601,42 @@ var BaseOrganizationList = ({
|
|
|
15571
15601
|
const renderLoadMoreWithStyles = renderLoadMore || ((onLoadMore, loadingMore) => defaultRenderLoadMore(onLoadMore, loadingMore, t, styles));
|
|
15572
15602
|
const renderOrganizationWithStyles = renderOrganization || ((org) => defaultRenderOrganization(org, styles, t, onOrganizationSelect, showStatus));
|
|
15573
15603
|
if (isLoading && organizationsWithSwitchAccess?.length === 0) {
|
|
15574
|
-
const loadingContent = /* @__PURE__ */ (0,
|
|
15604
|
+
const loadingContent = /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("div", { className: (0, import_css60.cx)(styles["root"], className), style, children: renderLoadingWithStyles() });
|
|
15575
15605
|
if (mode === "popup") {
|
|
15576
|
-
return /* @__PURE__ */ (0,
|
|
15577
|
-
/* @__PURE__ */ (0,
|
|
15578
|
-
/* @__PURE__ */ (0,
|
|
15606
|
+
return /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)(Dialog_default.Content, { children: [
|
|
15607
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsx)(Dialog_default.Heading, { children: title }),
|
|
15608
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsx)("div", { className: (0, import_css60.cx)(styles["popupContent"]), children: loadingContent })
|
|
15579
15609
|
] }) });
|
|
15580
15610
|
}
|
|
15581
15611
|
return loadingContent;
|
|
15582
15612
|
}
|
|
15583
15613
|
if (error && organizationsWithSwitchAccess?.length === 0) {
|
|
15584
|
-
const errorContent = /* @__PURE__ */ (0,
|
|
15614
|
+
const errorContent = /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("div", { className: (0, import_css60.cx)(styles["root"], className), style, children: renderErrorWithStyles(error) });
|
|
15585
15615
|
if (mode === "popup") {
|
|
15586
|
-
return /* @__PURE__ */ (0,
|
|
15587
|
-
/* @__PURE__ */ (0,
|
|
15588
|
-
/* @__PURE__ */ (0,
|
|
15616
|
+
return /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)(Dialog_default.Content, { children: [
|
|
15617
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsx)(Dialog_default.Heading, { children: title }),
|
|
15618
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsx)("div", { className: (0, import_css60.cx)(styles["popupContent"]), children: errorContent })
|
|
15589
15619
|
] }) });
|
|
15590
15620
|
}
|
|
15591
15621
|
return errorContent;
|
|
15592
15622
|
}
|
|
15593
15623
|
if (!isLoading && organizationsWithSwitchAccess?.length === 0) {
|
|
15594
|
-
const emptyContent = /* @__PURE__ */ (0,
|
|
15624
|
+
const emptyContent = /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("div", { className: (0, import_css60.cx)(styles["root"], className), style, children: renderEmptyWithStyles() });
|
|
15595
15625
|
if (mode === "popup") {
|
|
15596
|
-
return /* @__PURE__ */ (0,
|
|
15597
|
-
/* @__PURE__ */ (0,
|
|
15598
|
-
/* @__PURE__ */ (0,
|
|
15626
|
+
return /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)(Dialog_default.Content, { children: [
|
|
15627
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsx)(Dialog_default.Heading, { children: title }),
|
|
15628
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsx)("div", { className: (0, import_css60.cx)(styles["popupContent"]), children: emptyContent })
|
|
15599
15629
|
] }) });
|
|
15600
15630
|
}
|
|
15601
15631
|
return emptyContent;
|
|
15602
15632
|
}
|
|
15603
|
-
const organizationListContent = /* @__PURE__ */ (0,
|
|
15604
|
-
/* @__PURE__ */ (0,
|
|
15605
|
-
/* @__PURE__ */ (0,
|
|
15633
|
+
const organizationListContent = /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)("div", { className: (0, import_css60.cx)(styles["root"], className), style, children: [
|
|
15634
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsxs)("div", { className: (0, import_css60.cx)(styles["header"]), children: [
|
|
15635
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsx)("div", { className: (0, import_css60.cx)(styles["headerInfo"]), children: /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(Typography_default, { variant: "body2", color: "textSecondary", className: (0, import_css60.cx)(styles["subtitle"]), children: t("organization.switcher.showing.count", {
|
|
15606
15636
|
showing: organizationsWithSwitchAccess?.length,
|
|
15607
15637
|
total: allOrganizations?.organizations?.length || 0
|
|
15608
15638
|
}) }) }),
|
|
15609
|
-
onRefresh && /* @__PURE__ */ (0,
|
|
15639
|
+
onRefresh && /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
|
|
15610
15640
|
Button_default,
|
|
15611
15641
|
{
|
|
15612
15642
|
onClick: onRefresh,
|
|
@@ -15618,16 +15648,16 @@ var BaseOrganizationList = ({
|
|
|
15618
15648
|
}
|
|
15619
15649
|
)
|
|
15620
15650
|
] }),
|
|
15621
|
-
/* @__PURE__ */ (0,
|
|
15651
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsx)("div", { className: (0, import_css60.cx)(styles["listContainer"]), children: organizationsWithSwitchAccess?.map(
|
|
15622
15652
|
(organization, index) => renderOrganizationWithStyles(organization, index)
|
|
15623
15653
|
) }),
|
|
15624
|
-
error && organizationsWithSwitchAccess?.length > 0 && /* @__PURE__ */ (0,
|
|
15625
|
-
hasMore && fetchMore && /* @__PURE__ */ (0,
|
|
15654
|
+
error && organizationsWithSwitchAccess?.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("div", { className: (0, import_css60.cx)(styles["errorMargin"]), children: renderErrorWithStyles(error) }),
|
|
15655
|
+
hasMore && fetchMore && /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("div", { className: (0, import_css60.cx)(styles["loadMoreMargin"]), children: renderLoadMoreWithStyles(fetchMore, isLoadingMore) })
|
|
15626
15656
|
] });
|
|
15627
15657
|
if (mode === "popup") {
|
|
15628
|
-
return /* @__PURE__ */ (0,
|
|
15629
|
-
/* @__PURE__ */ (0,
|
|
15630
|
-
/* @__PURE__ */ (0,
|
|
15658
|
+
return /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)(Dialog_default.Content, { children: [
|
|
15659
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsx)(Dialog_default.Heading, { children: title }),
|
|
15660
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsx)("div", { className: (0, import_css60.cx)(styles["popupContent"]), children: organizationListContent })
|
|
15631
15661
|
] }) });
|
|
15632
15662
|
}
|
|
15633
15663
|
return organizationListContent;
|
|
@@ -15697,7 +15727,7 @@ var useStyles28 = (theme, colorScheme) => (0, import_react97.useMemo)(() => {
|
|
|
15697
15727
|
var OrganizationList_styles_default = useStyles28;
|
|
15698
15728
|
|
|
15699
15729
|
// src/components/presentation/OrganizationList/OrganizationList.tsx
|
|
15700
|
-
var
|
|
15730
|
+
var import_jsx_runtime107 = require("react/jsx-runtime");
|
|
15701
15731
|
var OrganizationList = (props) => {
|
|
15702
15732
|
const { onOrganizationSelect, className = "", style, ...baseProps } = props;
|
|
15703
15733
|
const { autoFetch, filter, limit, recursive, ...filteredBaseProps } = baseProps;
|
|
@@ -15712,7 +15742,7 @@ var OrganizationList = (props) => {
|
|
|
15712
15742
|
setAllOrganizations(await getAllOrganizations2());
|
|
15713
15743
|
})();
|
|
15714
15744
|
}, []);
|
|
15715
|
-
return /* @__PURE__ */ (0,
|
|
15745
|
+
return /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("div", { className: (0, import_css62.cx)(styles["root"], className), style, children: /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("div", { className: (0, import_css62.cx)(styles["container"]), children: /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
|
|
15716
15746
|
BaseOrganizationList,
|
|
15717
15747
|
{
|
|
15718
15748
|
allOrganizations,
|
|
@@ -16051,7 +16081,7 @@ var useStyles30 = (theme, colorScheme, disabled, readOnly, hasError) => (0, impo
|
|
|
16051
16081
|
var KeyValueInput_styles_default = useStyles30;
|
|
16052
16082
|
|
|
16053
16083
|
// src/components/primitives/KeyValueInput/KeyValueInput.tsx
|
|
16054
|
-
var
|
|
16084
|
+
var import_jsx_runtime108 = require("react/jsx-runtime");
|
|
16055
16085
|
var KeyValueInput = ({
|
|
16056
16086
|
className = "",
|
|
16057
16087
|
disabled = false,
|
|
@@ -16128,18 +16158,18 @@ var KeyValueInput = ({
|
|
|
16128
16158
|
const isAddDisabled = disabled || readOnly || !canAddMore || !newKey.trim() || !newValue.trim();
|
|
16129
16159
|
const renderReadOnlyContent = () => {
|
|
16130
16160
|
if (pairs.length === 0) {
|
|
16131
|
-
return /* @__PURE__ */ (0,
|
|
16161
|
+
return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("div", { className: (0, import_css65.cx)((0, import_browser85.withVendorCSSClassPrefix)((0, import_browser85.bem)("key-value-input", "empty-state")), styles["emptyState"]), children: "No attributes defined" });
|
|
16132
16162
|
}
|
|
16133
|
-
return pairs.map((pair, index) => /* @__PURE__ */ (0,
|
|
16163
|
+
return pairs.map((pair, index) => /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(
|
|
16134
16164
|
"div",
|
|
16135
16165
|
{
|
|
16136
16166
|
className: (0, import_css65.cx)((0, import_browser85.withVendorCSSClassPrefix)((0, import_browser85.bem)("key-value-input", "readonly-pair")), styles["readOnlyPair"]),
|
|
16137
16167
|
children: [
|
|
16138
|
-
/* @__PURE__ */ (0,
|
|
16168
|
+
/* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("span", { className: (0, import_css65.cx)((0, import_browser85.withVendorCSSClassPrefix)((0, import_browser85.bem)("key-value-input", "readonly-key")), styles["readOnlyKey"]), children: [
|
|
16139
16169
|
pair.key,
|
|
16140
16170
|
":"
|
|
16141
16171
|
] }),
|
|
16142
|
-
/* @__PURE__ */ (0,
|
|
16172
|
+
/* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
|
|
16143
16173
|
"span",
|
|
16144
16174
|
{
|
|
16145
16175
|
className: (0, import_css65.cx)((0, import_browser85.withVendorCSSClassPrefix)((0, import_browser85.bem)("key-value-input", "readonly-value")), styles["readOnlyValue"]),
|
|
@@ -16151,10 +16181,10 @@ var KeyValueInput = ({
|
|
|
16151
16181
|
`${pair.key}-${index}`
|
|
16152
16182
|
));
|
|
16153
16183
|
};
|
|
16154
|
-
return /* @__PURE__ */ (0,
|
|
16155
|
-
label && /* @__PURE__ */ (0,
|
|
16184
|
+
return /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("div", { className: (0, import_css65.cx)((0, import_browser85.withVendorCSSClassPrefix)((0, import_browser85.bem)("key-value-input")), styles["container"], className), children: [
|
|
16185
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("label", { className: (0, import_css65.cx)((0, import_browser85.withVendorCSSClassPrefix)((0, import_browser85.bem)("key-value-input", "label")), styles["label"]), children: [
|
|
16156
16186
|
label,
|
|
16157
|
-
required && /* @__PURE__ */ (0,
|
|
16187
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
|
|
16158
16188
|
"span",
|
|
16159
16189
|
{
|
|
16160
16190
|
className: (0, import_css65.cx)((0, import_browser85.withVendorCSSClassPrefix)((0, import_browser85.bem)("key-value-input", "required")), styles["requiredIndicator"]),
|
|
@@ -16162,13 +16192,13 @@ var KeyValueInput = ({
|
|
|
16162
16192
|
}
|
|
16163
16193
|
)
|
|
16164
16194
|
] }),
|
|
16165
|
-
/* @__PURE__ */ (0,
|
|
16166
|
-
readOnly ? renderReadOnlyContent() : pairs.map((pair, index) => /* @__PURE__ */ (0,
|
|
16195
|
+
/* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("div", { className: (0, import_css65.cx)((0, import_browser85.withVendorCSSClassPrefix)((0, import_browser85.bem)("key-value-input", "pairs-list")), styles["pairsList"]), children: [
|
|
16196
|
+
readOnly ? renderReadOnlyContent() : pairs.map((pair, index) => /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(
|
|
16167
16197
|
"div",
|
|
16168
16198
|
{
|
|
16169
16199
|
className: (0, import_css65.cx)((0, import_browser85.withVendorCSSClassPrefix)((0, import_browser85.bem)("key-value-input", "pair-row")), styles["pairRow"]),
|
|
16170
16200
|
children: [
|
|
16171
|
-
/* @__PURE__ */ (0,
|
|
16201
|
+
/* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
|
|
16172
16202
|
TextField_default,
|
|
16173
16203
|
{
|
|
16174
16204
|
placeholder: keyPlaceholder,
|
|
@@ -16179,7 +16209,7 @@ var KeyValueInput = ({
|
|
|
16179
16209
|
"aria-label": `${keyLabel} ${index + 1}`
|
|
16180
16210
|
}
|
|
16181
16211
|
),
|
|
16182
|
-
/* @__PURE__ */ (0,
|
|
16212
|
+
/* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
|
|
16183
16213
|
TextField_default,
|
|
16184
16214
|
{
|
|
16185
16215
|
placeholder: valuePlaceholder,
|
|
@@ -16190,7 +16220,7 @@ var KeyValueInput = ({
|
|
|
16190
16220
|
"aria-label": `${valueLabel} ${index + 1}`
|
|
16191
16221
|
}
|
|
16192
16222
|
),
|
|
16193
|
-
!readOnly && /* @__PURE__ */ (0,
|
|
16223
|
+
!readOnly && /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
|
|
16194
16224
|
"button",
|
|
16195
16225
|
{
|
|
16196
16226
|
type: "button",
|
|
@@ -16201,15 +16231,15 @@ var KeyValueInput = ({
|
|
|
16201
16231
|
styles["removeButton"]
|
|
16202
16232
|
),
|
|
16203
16233
|
"aria-label": `${removeButtonText} ${pair.key}`,
|
|
16204
|
-
children: /* @__PURE__ */ (0,
|
|
16234
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(X_default, { width: 16, height: 16 })
|
|
16205
16235
|
}
|
|
16206
16236
|
)
|
|
16207
16237
|
]
|
|
16208
16238
|
},
|
|
16209
16239
|
`${pair.key}-${index}`
|
|
16210
16240
|
)),
|
|
16211
|
-
!readOnly && /* @__PURE__ */ (0,
|
|
16212
|
-
/* @__PURE__ */ (0,
|
|
16241
|
+
!readOnly && /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("div", { className: (0, import_css65.cx)((0, import_browser85.withVendorCSSClassPrefix)((0, import_browser85.bem)("key-value-input", "add-row")), styles["addRow"]), children: [
|
|
16242
|
+
/* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
|
|
16213
16243
|
TextField_default,
|
|
16214
16244
|
{
|
|
16215
16245
|
placeholder: keyPlaceholder,
|
|
@@ -16220,7 +16250,7 @@ var KeyValueInput = ({
|
|
|
16220
16250
|
"aria-label": "New key"
|
|
16221
16251
|
}
|
|
16222
16252
|
),
|
|
16223
|
-
/* @__PURE__ */ (0,
|
|
16253
|
+
/* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
|
|
16224
16254
|
TextField_default,
|
|
16225
16255
|
{
|
|
16226
16256
|
placeholder: valuePlaceholder,
|
|
@@ -16236,7 +16266,7 @@ var KeyValueInput = ({
|
|
|
16236
16266
|
}
|
|
16237
16267
|
}
|
|
16238
16268
|
),
|
|
16239
|
-
/* @__PURE__ */ (0,
|
|
16269
|
+
/* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
|
|
16240
16270
|
"button",
|
|
16241
16271
|
{
|
|
16242
16272
|
type: "button",
|
|
@@ -16244,13 +16274,13 @@ var KeyValueInput = ({
|
|
|
16244
16274
|
disabled: isAddDisabled,
|
|
16245
16275
|
className: (0, import_css65.cx)((0, import_browser85.withVendorCSSClassPrefix)((0, import_browser85.bem)("key-value-input", "add-button")), styles["addButton"]),
|
|
16246
16276
|
"aria-label": "Add new key-value pair",
|
|
16247
|
-
children: /* @__PURE__ */ (0,
|
|
16277
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(Plus_default, { width: 16, height: 16 })
|
|
16248
16278
|
}
|
|
16249
16279
|
)
|
|
16250
16280
|
] })
|
|
16251
16281
|
] }),
|
|
16252
|
-
(helperText || error) && /* @__PURE__ */ (0,
|
|
16253
|
-
maxPairs && /* @__PURE__ */ (0,
|
|
16282
|
+
(helperText || error) && /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("div", { className: (0, import_css65.cx)((0, import_browser85.withVendorCSSClassPrefix)((0, import_browser85.bem)("key-value-input", "helper-text")), styles["helperText"]), children: error || helperText }),
|
|
16283
|
+
maxPairs && /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("div", { className: (0, import_css65.cx)((0, import_browser85.withVendorCSSClassPrefix)((0, import_browser85.bem)("key-value-input", "counter")), styles["counterText"]), children: [
|
|
16254
16284
|
pairs.length,
|
|
16255
16285
|
" of ",
|
|
16256
16286
|
maxPairs,
|
|
@@ -16261,7 +16291,7 @@ var KeyValueInput = ({
|
|
|
16261
16291
|
var KeyValueInput_default = KeyValueInput;
|
|
16262
16292
|
|
|
16263
16293
|
// src/components/presentation/OrganizationProfile/BaseOrganizationProfile.tsx
|
|
16264
|
-
var
|
|
16294
|
+
var import_jsx_runtime109 = require("react/jsx-runtime");
|
|
16265
16295
|
var BaseOrganizationProfile = ({
|
|
16266
16296
|
fallback = null,
|
|
16267
16297
|
className = "",
|
|
@@ -16310,7 +16340,7 @@ var BaseOrganizationProfile = ({
|
|
|
16310
16340
|
const styles = BaseOrganizationProfile_styles_default(theme, colorScheme);
|
|
16311
16341
|
const [editedOrganization, setEditedOrganization] = (0, import_react102.useState)(organization);
|
|
16312
16342
|
const [editingFields, setEditingFields] = (0, import_react102.useState)({});
|
|
16313
|
-
const PencilIcon = () => /* @__PURE__ */ (0,
|
|
16343
|
+
const PencilIcon = () => /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
16314
16344
|
"svg",
|
|
16315
16345
|
{
|
|
16316
16346
|
width: "16",
|
|
@@ -16321,7 +16351,7 @@ var BaseOrganizationProfile = ({
|
|
|
16321
16351
|
strokeWidth: "2",
|
|
16322
16352
|
strokeLinecap: "round",
|
|
16323
16353
|
strokeLinejoin: "round",
|
|
16324
|
-
children: /* @__PURE__ */ (0,
|
|
16354
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("path", { d: "M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z" })
|
|
16325
16355
|
}
|
|
16326
16356
|
);
|
|
16327
16357
|
const toggleFieldEdit = (0, import_react102.useCallback)((fieldName) => {
|
|
@@ -16391,7 +16421,7 @@ var BaseOrganizationProfile = ({
|
|
|
16391
16421
|
let fieldInput;
|
|
16392
16422
|
if (key === "attributes") {
|
|
16393
16423
|
const attributesValue = typeof fieldValue === "object" && fieldValue !== null ? fieldValue : {};
|
|
16394
|
-
fieldInput = /* @__PURE__ */ (0,
|
|
16424
|
+
fieldInput = /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
16395
16425
|
KeyValueInput_default,
|
|
16396
16426
|
{
|
|
16397
16427
|
value: attributesValue,
|
|
@@ -16429,26 +16459,26 @@ var BaseOrganizationProfile = ({
|
|
|
16429
16459
|
}
|
|
16430
16460
|
);
|
|
16431
16461
|
} else {
|
|
16432
|
-
fieldInput = /* @__PURE__ */ (0,
|
|
16462
|
+
fieldInput = /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(TextField_default, { ...commonProps });
|
|
16433
16463
|
}
|
|
16434
|
-
return /* @__PURE__ */ (0,
|
|
16435
|
-
/* @__PURE__ */ (0,
|
|
16436
|
-
/* @__PURE__ */ (0,
|
|
16464
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(import_jsx_runtime109.Fragment, { children: [
|
|
16465
|
+
/* @__PURE__ */ (0, import_jsx_runtime109.jsx)("span", { className: (0, import_css66.cx)(styles["label"]), children: label }),
|
|
16466
|
+
/* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { className: (0, import_css66.cx)(styles["value"]), children: fieldInput })
|
|
16437
16467
|
] });
|
|
16438
16468
|
}
|
|
16439
16469
|
const hasValue = value !== void 0 && value !== null && value !== "";
|
|
16440
16470
|
const isFieldEditable = editable && fieldEditable;
|
|
16441
16471
|
let displayValue;
|
|
16442
16472
|
if (hasValue) {
|
|
16443
|
-
displayValue = key === "attributes" && typeof value === "object" && value !== null ? /* @__PURE__ */ (0,
|
|
16473
|
+
displayValue = key === "attributes" && typeof value === "object" && value !== null ? /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(KeyValueInput_default, { value, readOnly: true, label: "" }) : String(renderedValue);
|
|
16444
16474
|
} else if (isFieldEditable) {
|
|
16445
16475
|
displayValue = getFieldPlaceholder(key);
|
|
16446
16476
|
} else {
|
|
16447
16477
|
displayValue = "-";
|
|
16448
16478
|
}
|
|
16449
|
-
return /* @__PURE__ */ (0,
|
|
16450
|
-
/* @__PURE__ */ (0,
|
|
16451
|
-
/* @__PURE__ */ (0,
|
|
16479
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(import_jsx_runtime109.Fragment, { children: [
|
|
16480
|
+
/* @__PURE__ */ (0, import_jsx_runtime109.jsx)("span", { className: (0, import_css66.cx)(styles["label"]), children: label }),
|
|
16481
|
+
/* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { className: (0, import_css66.cx)(styles["value"], !hasValue && styles["valueEmpty"]), children: !hasValue && isFieldEditable && onStartEdit ? /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
16452
16482
|
Button_default,
|
|
16453
16483
|
{
|
|
16454
16484
|
onClick: onStartEdit,
|
|
@@ -16471,8 +16501,8 @@ var BaseOrganizationProfile = ({
|
|
|
16471
16501
|
if (!shouldShow) {
|
|
16472
16502
|
return null;
|
|
16473
16503
|
}
|
|
16474
|
-
return /* @__PURE__ */ (0,
|
|
16475
|
-
/* @__PURE__ */ (0,
|
|
16504
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("div", { className: (0, import_css66.cx)(styles["field"]), children: [
|
|
16505
|
+
/* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { className: (0, import_css66.cx)(styles["fieldContent"]), children: renderField(
|
|
16476
16506
|
field,
|
|
16477
16507
|
isFieldEditing,
|
|
16478
16508
|
(value) => {
|
|
@@ -16482,8 +16512,8 @@ var BaseOrganizationProfile = ({
|
|
|
16482
16512
|
},
|
|
16483
16513
|
() => toggleFieldEdit(field.key)
|
|
16484
16514
|
) }),
|
|
16485
|
-
isFieldEditable && /* @__PURE__ */ (0,
|
|
16486
|
-
/* @__PURE__ */ (0,
|
|
16515
|
+
isFieldEditable && /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { className: (0, import_css66.cx)(styles["fieldActions"]), children: isFieldEditing ? /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(import_jsx_runtime109.Fragment, { children: [
|
|
16516
|
+
/* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
16487
16517
|
Button_default,
|
|
16488
16518
|
{
|
|
16489
16519
|
onClick: () => handleFieldSave(field.key),
|
|
@@ -16494,7 +16524,7 @@ var BaseOrganizationProfile = ({
|
|
|
16494
16524
|
children: saveButtonText
|
|
16495
16525
|
}
|
|
16496
16526
|
),
|
|
16497
|
-
/* @__PURE__ */ (0,
|
|
16527
|
+
/* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
16498
16528
|
Button_default,
|
|
16499
16529
|
{
|
|
16500
16530
|
onClick: () => handleFieldCancel(field.key),
|
|
@@ -16505,7 +16535,7 @@ var BaseOrganizationProfile = ({
|
|
|
16505
16535
|
children: cancelButtonText
|
|
16506
16536
|
}
|
|
16507
16537
|
)
|
|
16508
|
-
] }) : hasValue && /* @__PURE__ */ (0,
|
|
16538
|
+
] }) : hasValue && /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
16509
16539
|
Button_default,
|
|
16510
16540
|
{
|
|
16511
16541
|
onClick: () => toggleFieldEdit(field.key),
|
|
@@ -16514,7 +16544,7 @@ var BaseOrganizationProfile = ({
|
|
|
16514
16544
|
size: "small",
|
|
16515
16545
|
title: "Edit field",
|
|
16516
16546
|
className: (0, import_css66.cx)(styles["editButton"]),
|
|
16517
|
-
children: /* @__PURE__ */ (0,
|
|
16547
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(PencilIcon, {})
|
|
16518
16548
|
}
|
|
16519
16549
|
) })
|
|
16520
16550
|
] }, field.key);
|
|
@@ -16522,23 +16552,23 @@ var BaseOrganizationProfile = ({
|
|
|
16522
16552
|
if (!organization) {
|
|
16523
16553
|
return fallback;
|
|
16524
16554
|
}
|
|
16525
|
-
const profileContent = /* @__PURE__ */ (0,
|
|
16526
|
-
/* @__PURE__ */ (0,
|
|
16527
|
-
/* @__PURE__ */ (0,
|
|
16528
|
-
/* @__PURE__ */ (0,
|
|
16529
|
-
/* @__PURE__ */ (0,
|
|
16530
|
-
organization.orgHandle && /* @__PURE__ */ (0,
|
|
16555
|
+
const profileContent = /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(Card_default, { className: (0, import_css66.cx)(styles["root"], cardLayout && styles["card"], className), children: [
|
|
16556
|
+
/* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("div", { className: (0, import_css66.cx)(styles["header"]), children: [
|
|
16557
|
+
/* @__PURE__ */ (0, import_jsx_runtime109.jsx)(Avatar, { name: getOrgInitials(organization.name), size: 80, alt: `${organization.name} logo` }),
|
|
16558
|
+
/* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("div", { className: (0, import_css66.cx)(styles["orgInfo"]), children: [
|
|
16559
|
+
/* @__PURE__ */ (0, import_jsx_runtime109.jsx)("h2", { className: (0, import_css66.cx)(styles["name"]), children: organization.name }),
|
|
16560
|
+
organization.orgHandle && /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("p", { className: (0, import_css66.cx)(styles["handle"]), children: [
|
|
16531
16561
|
"@",
|
|
16532
16562
|
organization.orgHandle
|
|
16533
16563
|
] })
|
|
16534
16564
|
] })
|
|
16535
16565
|
] }),
|
|
16536
|
-
/* @__PURE__ */ (0,
|
|
16566
|
+
/* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { className: (0, import_css66.cx)(styles["infoContainer"]), children: fields.map((field) => renderOrganizationField(field)) })
|
|
16537
16567
|
] });
|
|
16538
16568
|
if (mode === "popup") {
|
|
16539
|
-
return /* @__PURE__ */ (0,
|
|
16540
|
-
/* @__PURE__ */ (0,
|
|
16541
|
-
/* @__PURE__ */ (0,
|
|
16569
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(Dialog_default.Content, { children: [
|
|
16570
|
+
/* @__PURE__ */ (0, import_jsx_runtime109.jsx)(Dialog_default.Heading, { children: title }),
|
|
16571
|
+
/* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { className: (0, import_css66.cx)(styles["popup"]), children: profileContent })
|
|
16542
16572
|
] }) });
|
|
16543
16573
|
}
|
|
16544
16574
|
return profileContent;
|
|
@@ -16607,7 +16637,7 @@ var updateOrganization = async ({
|
|
|
16607
16637
|
var updateOrganization_default = updateOrganization;
|
|
16608
16638
|
|
|
16609
16639
|
// src/components/presentation/OrganizationProfile/OrganizationProfile.tsx
|
|
16610
|
-
var
|
|
16640
|
+
var import_jsx_runtime110 = require("react/jsx-runtime");
|
|
16611
16641
|
var logger9 = (0, import_browser89.createPackageComponentLogger)(
|
|
16612
16642
|
"@asgardeo/react",
|
|
16613
16643
|
"OrganizationProfile"
|
|
@@ -16665,7 +16695,7 @@ var OrganizationProfile = ({
|
|
|
16665
16695
|
throw err;
|
|
16666
16696
|
}
|
|
16667
16697
|
};
|
|
16668
|
-
return /* @__PURE__ */ (0,
|
|
16698
|
+
return /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
|
|
16669
16699
|
BaseOrganizationProfile_default,
|
|
16670
16700
|
{
|
|
16671
16701
|
organization,
|
|
@@ -16682,7 +16712,7 @@ var OrganizationProfile = ({
|
|
|
16682
16712
|
var OrganizationProfile_default = OrganizationProfile;
|
|
16683
16713
|
|
|
16684
16714
|
// src/components/presentation/OrganizationSwitcher/OrganizationSwitcher.tsx
|
|
16685
|
-
var
|
|
16715
|
+
var import_jsx_runtime111 = require("react/jsx-runtime");
|
|
16686
16716
|
var OrganizationSwitcher = ({
|
|
16687
16717
|
currentOrganization: propCurrentOrganization,
|
|
16688
16718
|
fallback = null,
|
|
@@ -16707,7 +16737,7 @@ var OrganizationSwitcher = ({
|
|
|
16707
16737
|
return fallback;
|
|
16708
16738
|
}
|
|
16709
16739
|
if (!isSignedIn) {
|
|
16710
|
-
return /* @__PURE__ */ (0,
|
|
16740
|
+
return /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_jsx_runtime111.Fragment, {});
|
|
16711
16741
|
}
|
|
16712
16742
|
const organizations = propOrganizations || contextOrganizations || [];
|
|
16713
16743
|
const currentOrganization = propCurrentOrganization || contextCurrentOrganization;
|
|
@@ -16721,19 +16751,19 @@ var OrganizationSwitcher = ({
|
|
|
16721
16751
|
const defaultMenuItems = [];
|
|
16722
16752
|
if (currentOrganization) {
|
|
16723
16753
|
defaultMenuItems.push({
|
|
16724
|
-
icon: /* @__PURE__ */ (0,
|
|
16754
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(BuildingAlt_default, {}),
|
|
16725
16755
|
label: t("organization.switcher.manage.organizations"),
|
|
16726
16756
|
onClick: handleManageOrganizations
|
|
16727
16757
|
});
|
|
16728
16758
|
}
|
|
16729
16759
|
defaultMenuItems.push({
|
|
16730
|
-
icon: /* @__PURE__ */ (0,
|
|
16760
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("path", { d: "M12 5v14m-7-7h14" }) }),
|
|
16731
16761
|
label: t("organization.switcher.create.organization"),
|
|
16732
16762
|
onClick: () => setIsCreateOrgOpen(true)
|
|
16733
16763
|
});
|
|
16734
16764
|
const menuItems = props.menuItems ? [...defaultMenuItems, ...props.menuItems] : defaultMenuItems;
|
|
16735
|
-
return /* @__PURE__ */ (0,
|
|
16736
|
-
/* @__PURE__ */ (0,
|
|
16765
|
+
return /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(import_jsx_runtime111.Fragment, { children: [
|
|
16766
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
|
|
16737
16767
|
BaseOrganizationSwitcher,
|
|
16738
16768
|
{
|
|
16739
16769
|
organizations,
|
|
@@ -16747,7 +16777,7 @@ var OrganizationSwitcher = ({
|
|
|
16747
16777
|
...props
|
|
16748
16778
|
}
|
|
16749
16779
|
),
|
|
16750
|
-
/* @__PURE__ */ (0,
|
|
16780
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
|
|
16751
16781
|
CreateOrganization,
|
|
16752
16782
|
{
|
|
16753
16783
|
mode: "popup",
|
|
@@ -16761,7 +16791,7 @@ var OrganizationSwitcher = ({
|
|
|
16761
16791
|
}
|
|
16762
16792
|
}
|
|
16763
16793
|
),
|
|
16764
|
-
currentOrganization && /* @__PURE__ */ (0,
|
|
16794
|
+
currentOrganization && /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
|
|
16765
16795
|
OrganizationProfile_default,
|
|
16766
16796
|
{
|
|
16767
16797
|
organizationId: currentOrganization.id,
|
|
@@ -16769,11 +16799,11 @@ var OrganizationSwitcher = ({
|
|
|
16769
16799
|
open: isProfileOpen,
|
|
16770
16800
|
onOpenChange: setIsProfileOpen,
|
|
16771
16801
|
cardLayout: true,
|
|
16772
|
-
loadingFallback: /* @__PURE__ */ (0,
|
|
16773
|
-
errorFallback: /* @__PURE__ */ (0,
|
|
16802
|
+
loadingFallback: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("div", { children: t("organization.profile.loading") }),
|
|
16803
|
+
errorFallback: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("div", { children: t("organization.profile.error") })
|
|
16774
16804
|
}
|
|
16775
16805
|
),
|
|
16776
|
-
/* @__PURE__ */ (0,
|
|
16806
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
|
|
16777
16807
|
OrganizationList_default,
|
|
16778
16808
|
{
|
|
16779
16809
|
mode: "popup",
|
|
@@ -16910,7 +16940,7 @@ var useStyles31 = (theme, colorScheme) => (0, import_react105.useMemo)(() => {
|
|
|
16910
16940
|
var BaseLanguageSwitcher_styles_default = useStyles31;
|
|
16911
16941
|
|
|
16912
16942
|
// src/components/presentation/LanguageSwitcher/BaseLanguageSwitcher.tsx
|
|
16913
|
-
var
|
|
16943
|
+
var import_jsx_runtime112 = require("react/jsx-runtime");
|
|
16914
16944
|
var BaseLanguageSwitcher = ({
|
|
16915
16945
|
children,
|
|
16916
16946
|
className,
|
|
@@ -16922,27 +16952,33 @@ var BaseLanguageSwitcher = ({
|
|
|
16922
16952
|
const { theme, colorScheme } = useTheme_default();
|
|
16923
16953
|
const styles = BaseLanguageSwitcher_styles_default(theme, colorScheme);
|
|
16924
16954
|
const [isOpen, setIsOpen] = (0, import_react107.useState)(false);
|
|
16955
|
+
const hasMultipleLanguages = languages.length > 1;
|
|
16956
|
+
(0, import_react107.useEffect)(() => {
|
|
16957
|
+
if (!hasMultipleLanguages && isOpen) {
|
|
16958
|
+
setIsOpen(false);
|
|
16959
|
+
}
|
|
16960
|
+
}, [hasMultipleLanguages, isOpen]);
|
|
16925
16961
|
const { refs, floatingStyles, context } = (0, import_react106.useFloating)({
|
|
16926
16962
|
middleware: [(0, import_react106.offset)(4), (0, import_react106.flip)(), (0, import_react106.shift)()],
|
|
16927
16963
|
onOpenChange: setIsOpen,
|
|
16928
16964
|
open: isOpen,
|
|
16929
16965
|
whileElementsMounted: import_react106.autoUpdate
|
|
16930
16966
|
});
|
|
16931
|
-
const click = (0, import_react106.useClick)(context);
|
|
16932
|
-
const dismiss = (0, import_react106.useDismiss)(context);
|
|
16933
|
-
const role = (0, import_react106.useRole)(context, { role: "listbox" });
|
|
16967
|
+
const click = (0, import_react106.useClick)(context, { enabled: hasMultipleLanguages });
|
|
16968
|
+
const dismiss = (0, import_react106.useDismiss)(context, { enabled: hasMultipleLanguages });
|
|
16969
|
+
const role = (0, import_react106.useRole)(context, { enabled: hasMultipleLanguages, role: "listbox" });
|
|
16934
16970
|
const { getReferenceProps, getFloatingProps } = (0, import_react106.useInteractions)([click, dismiss, role]);
|
|
16935
16971
|
const currentOption = languages.find((l) => l.code === currentLanguage);
|
|
16936
16972
|
if (children) {
|
|
16937
|
-
return /* @__PURE__ */ (0,
|
|
16973
|
+
return /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_jsx_runtime112.Fragment, { children: children({
|
|
16938
16974
|
currentLanguage,
|
|
16939
16975
|
isLoading,
|
|
16940
16976
|
languages,
|
|
16941
16977
|
onLanguageChange
|
|
16942
16978
|
}) });
|
|
16943
16979
|
}
|
|
16944
|
-
return /* @__PURE__ */ (0,
|
|
16945
|
-
/* @__PURE__ */ (0,
|
|
16980
|
+
return /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)("div", { className: (0, import_css68.cx)(styles["root"], className), children: [
|
|
16981
|
+
/* @__PURE__ */ (0, import_jsx_runtime112.jsxs)(
|
|
16946
16982
|
"button",
|
|
16947
16983
|
{
|
|
16948
16984
|
ref: refs.setReference,
|
|
@@ -16952,13 +16988,13 @@ var BaseLanguageSwitcher = ({
|
|
|
16952
16988
|
...getReferenceProps(),
|
|
16953
16989
|
className: styles["trigger"],
|
|
16954
16990
|
children: [
|
|
16955
|
-
currentOption && /* @__PURE__ */ (0,
|
|
16956
|
-
/* @__PURE__ */ (0,
|
|
16957
|
-
/* @__PURE__ */ (0,
|
|
16991
|
+
currentOption && /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("span", { className: styles["triggerEmoji"], children: currentOption.emoji }),
|
|
16992
|
+
/* @__PURE__ */ (0, import_jsx_runtime112.jsx)("span", { className: styles["triggerLabel"], children: currentOption?.displayName ?? currentLanguage }),
|
|
16993
|
+
hasMultipleLanguages && /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(ChevronDown_default, {})
|
|
16958
16994
|
]
|
|
16959
16995
|
}
|
|
16960
16996
|
),
|
|
16961
|
-
isOpen && /* @__PURE__ */ (0,
|
|
16997
|
+
isOpen && hasMultipleLanguages && /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_react106.FloatingPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_react106.FloatingFocusManager, { context, modal: false, children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
|
|
16962
16998
|
"div",
|
|
16963
16999
|
{
|
|
16964
17000
|
ref: refs.setFloating,
|
|
@@ -16967,7 +17003,7 @@ var BaseLanguageSwitcher = ({
|
|
|
16967
17003
|
className: styles["content"],
|
|
16968
17004
|
role: "listbox",
|
|
16969
17005
|
"aria-label": "Select language",
|
|
16970
|
-
children: languages.map((lang) => /* @__PURE__ */ (0,
|
|
17006
|
+
children: languages.map((lang) => /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)(
|
|
16971
17007
|
"button",
|
|
16972
17008
|
{
|
|
16973
17009
|
type: "button",
|
|
@@ -16979,9 +17015,9 @@ var BaseLanguageSwitcher = ({
|
|
|
16979
17015
|
setIsOpen(false);
|
|
16980
17016
|
},
|
|
16981
17017
|
children: [
|
|
16982
|
-
/* @__PURE__ */ (0,
|
|
16983
|
-
/* @__PURE__ */ (0,
|
|
16984
|
-
lang.code === currentLanguage && /* @__PURE__ */ (0,
|
|
17018
|
+
/* @__PURE__ */ (0, import_jsx_runtime112.jsx)("span", { className: styles["optionEmoji"], children: lang.emoji }),
|
|
17019
|
+
/* @__PURE__ */ (0, import_jsx_runtime112.jsx)("span", { className: styles["optionLabel"], children: lang.displayName }),
|
|
17020
|
+
lang.code === currentLanguage && /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("span", { className: styles["checkIcon"], children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(Check_default, {}) })
|
|
16985
17021
|
]
|
|
16986
17022
|
},
|
|
16987
17023
|
lang.code
|
|
@@ -17008,25 +17044,30 @@ var useFlowMeta = () => {
|
|
|
17008
17044
|
var useFlowMeta_default = useFlowMeta;
|
|
17009
17045
|
|
|
17010
17046
|
// src/components/presentation/LanguageSwitcher/LanguageSwitcher.tsx
|
|
17011
|
-
var
|
|
17047
|
+
var import_jsx_runtime113 = require("react/jsx-runtime");
|
|
17012
17048
|
var LanguageSwitcher = ({ children, className }) => {
|
|
17013
17049
|
const { meta, switchLanguage, isLoading } = useFlowMeta_default();
|
|
17014
17050
|
const { currentLanguage } = useTranslation_default();
|
|
17015
17051
|
const availableLanguageCodes = meta?.i18n?.languages ?? [];
|
|
17052
|
+
const effectiveLanguageCodes = (0, import_react109.useMemo)(() => {
|
|
17053
|
+
const fallbackCodes = availableLanguageCodes.length > 0 ? availableLanguageCodes : [currentLanguage];
|
|
17054
|
+
return Array.from(/* @__PURE__ */ new Set([currentLanguage, ...fallbackCodes]));
|
|
17055
|
+
}, [availableLanguageCodes, currentLanguage]);
|
|
17016
17056
|
const languages = (0, import_react109.useMemo)(
|
|
17017
|
-
() =>
|
|
17057
|
+
() => effectiveLanguageCodes.map((code) => ({
|
|
17018
17058
|
code,
|
|
17019
|
-
|
|
17059
|
+
// Resolve each label in its own locale so option names stay stable across UI language switches.
|
|
17060
|
+
displayName: (0, import_browser90.resolveLocaleDisplayName)(code, code) || code,
|
|
17020
17061
|
emoji: (0, import_browser90.resolveLocaleEmoji)(code)
|
|
17021
17062
|
})),
|
|
17022
|
-
[
|
|
17063
|
+
[effectiveLanguageCodes]
|
|
17023
17064
|
);
|
|
17024
17065
|
const handleLanguageChange = (language) => {
|
|
17025
17066
|
if (language !== currentLanguage) {
|
|
17026
17067
|
switchLanguage(language);
|
|
17027
17068
|
}
|
|
17028
17069
|
};
|
|
17029
|
-
return /* @__PURE__ */ (0,
|
|
17070
|
+
return /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
17030
17071
|
BaseLanguageSwitcher_default,
|
|
17031
17072
|
{
|
|
17032
17073
|
currentLanguage,
|