@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/index.js
CHANGED
|
@@ -7845,7 +7845,6 @@ var getAuthComponentHeadings_default = getAuthComponentHeadings;
|
|
|
7845
7845
|
import {
|
|
7846
7846
|
FieldType as FieldType7,
|
|
7847
7847
|
EmbeddedFlowComponentTypeV2 as EmbeddedFlowComponentType,
|
|
7848
|
-
EmbeddedFlowActionVariantV2 as EmbeddedFlowActionVariant,
|
|
7849
7848
|
EmbeddedFlowEventTypeV2 as EmbeddedFlowEventType,
|
|
7850
7849
|
createPackageComponentLogger as createPackageComponentLogger5,
|
|
7851
7850
|
resolveVars as resolveVars2
|
|
@@ -7944,14 +7943,40 @@ var ArrowLeftRight = ({ color = "currentColor", size = 24 }) => /* @__PURE__ */
|
|
|
7944
7943
|
ArrowLeftRight.displayName = "ArrowLeftRight";
|
|
7945
7944
|
var ArrowLeftRight_default = ArrowLeftRight;
|
|
7946
7945
|
|
|
7946
|
+
// src/components/primitives/Icons/ArrowRightLeft.tsx
|
|
7947
|
+
import { jsx as jsx62, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
7948
|
+
var ArrowRightLeft = ({ color = "currentColor", size = 24 }) => /* @__PURE__ */ jsxs28(
|
|
7949
|
+
"svg",
|
|
7950
|
+
{
|
|
7951
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
7952
|
+
width: size,
|
|
7953
|
+
height: size,
|
|
7954
|
+
viewBox: "0 0 24 24",
|
|
7955
|
+
fill: "none",
|
|
7956
|
+
stroke: color,
|
|
7957
|
+
strokeWidth: "2",
|
|
7958
|
+
strokeLinecap: "round",
|
|
7959
|
+
strokeLinejoin: "round",
|
|
7960
|
+
children: [
|
|
7961
|
+
/* @__PURE__ */ jsx62("path", { d: "m16 3 4 4-4 4" }),
|
|
7962
|
+
/* @__PURE__ */ jsx62("path", { d: "M20 7H4" }),
|
|
7963
|
+
/* @__PURE__ */ jsx62("path", { d: "m8 21-4-4 4-4" }),
|
|
7964
|
+
/* @__PURE__ */ jsx62("path", { d: "M4 17h16" })
|
|
7965
|
+
]
|
|
7966
|
+
}
|
|
7967
|
+
);
|
|
7968
|
+
ArrowRightLeft.displayName = "ArrowRightLeft";
|
|
7969
|
+
var ArrowRightLeft_default = ArrowRightLeft;
|
|
7970
|
+
|
|
7947
7971
|
// src/components/primitives/Icons/flowIconRegistry.tsx
|
|
7948
7972
|
var flowIconRegistry = {
|
|
7949
|
-
ArrowLeftRight: ArrowLeftRight_default
|
|
7973
|
+
ArrowLeftRight: ArrowLeftRight_default,
|
|
7974
|
+
ArrowRightLeft: ArrowRightLeft_default
|
|
7950
7975
|
};
|
|
7951
7976
|
var flowIconRegistry_default = flowIconRegistry;
|
|
7952
7977
|
|
|
7953
7978
|
// src/components/presentation/auth/AuthOptionFactory.tsx
|
|
7954
|
-
import { jsx as
|
|
7979
|
+
import { jsx as jsx63 } from "react/jsx-runtime";
|
|
7955
7980
|
var logger5 = createPackageComponentLogger5(
|
|
7956
7981
|
"@asgardeo/react",
|
|
7957
7982
|
"AuthOptionFactory"
|
|
@@ -7992,11 +8017,11 @@ var getTypographyVariant = (variant) => {
|
|
|
7992
8017
|
};
|
|
7993
8018
|
return variantMap[variant] || "h3";
|
|
7994
8019
|
};
|
|
7995
|
-
var matchesSocialProvider = (actionId, eventType, buttonText, provider, authType,
|
|
8020
|
+
var matchesSocialProvider = (actionId, eventType, buttonText, provider, authType, _componentVariant) => {
|
|
7996
8021
|
const providerId = `${provider}_auth`;
|
|
7997
8022
|
const providerMatches = actionId === providerId || eventType === providerId;
|
|
7998
|
-
if (
|
|
7999
|
-
return
|
|
8023
|
+
if (buttonText.toLowerCase().includes(provider)) {
|
|
8024
|
+
return true;
|
|
8000
8025
|
}
|
|
8001
8026
|
if (authType === "signup") {
|
|
8002
8027
|
return providerMatches || buttonText.toLowerCase().includes(provider);
|
|
@@ -8050,27 +8075,27 @@ var createAuthComponentFromFlow = (component, formValues, touchedFields, formErr
|
|
|
8050
8075
|
}
|
|
8051
8076
|
};
|
|
8052
8077
|
if (matchesSocialProvider(actionId, eventType, buttonText, "google", authType, componentVariant)) {
|
|
8053
|
-
return /* @__PURE__ */
|
|
8078
|
+
return /* @__PURE__ */ jsx63(GoogleButton_default, { onClick: handleClick, className: options.buttonClassName }, key);
|
|
8054
8079
|
}
|
|
8055
8080
|
if (matchesSocialProvider(actionId, eventType, buttonText, "github", authType, componentVariant)) {
|
|
8056
|
-
return /* @__PURE__ */
|
|
8081
|
+
return /* @__PURE__ */ jsx63(GitHubButton_default, { onClick: handleClick, className: options.buttonClassName }, key);
|
|
8057
8082
|
}
|
|
8058
8083
|
if (matchesSocialProvider(actionId, eventType, buttonText, "facebook", authType, componentVariant)) {
|
|
8059
|
-
return /* @__PURE__ */
|
|
8084
|
+
return /* @__PURE__ */ jsx63(FacebookButton_default, { onClick: handleClick, className: options.buttonClassName }, key);
|
|
8060
8085
|
}
|
|
8061
8086
|
if (matchesSocialProvider(actionId, eventType, buttonText, "microsoft", authType, componentVariant)) {
|
|
8062
|
-
return /* @__PURE__ */
|
|
8087
|
+
return /* @__PURE__ */ jsx63(MicrosoftButton_default, { onClick: handleClick, className: options.buttonClassName }, key);
|
|
8063
8088
|
}
|
|
8064
8089
|
if (matchesSocialProvider(actionId, eventType, buttonText, "linkedin", authType, componentVariant)) {
|
|
8065
|
-
return /* @__PURE__ */
|
|
8090
|
+
return /* @__PURE__ */ jsx63(LinkedInButton_default, { onClick: handleClick, className: options.buttonClassName }, key);
|
|
8066
8091
|
}
|
|
8067
8092
|
if (matchesSocialProvider(actionId, eventType, buttonText, "ethereum", authType, componentVariant)) {
|
|
8068
|
-
return /* @__PURE__ */
|
|
8093
|
+
return /* @__PURE__ */ jsx63(SignInWithEthereumButton_default, { onClick: handleClick, className: options.buttonClassName }, key);
|
|
8069
8094
|
}
|
|
8070
8095
|
if (actionId === "prompt_mobile" || eventType === "prompt_mobile") {
|
|
8071
|
-
return /* @__PURE__ */
|
|
8096
|
+
return /* @__PURE__ */ jsx63(SmsOtpButton_default, { onClick: handleClick, className: options.buttonClassName }, key);
|
|
8072
8097
|
}
|
|
8073
|
-
const startIconEl = component.startIcon ? /* @__PURE__ */
|
|
8098
|
+
const startIconEl = component.startIcon ? /* @__PURE__ */ jsx63(
|
|
8074
8099
|
"img",
|
|
8075
8100
|
{
|
|
8076
8101
|
src: component.startIcon,
|
|
@@ -8079,7 +8104,7 @@ var createAuthComponentFromFlow = (component, formValues, touchedFields, formErr
|
|
|
8079
8104
|
style: { height: "1.25em", objectFit: "contain", width: "1.25em" }
|
|
8080
8105
|
}
|
|
8081
8106
|
) : null;
|
|
8082
|
-
const endIconEl = component.endIcon ? /* @__PURE__ */
|
|
8107
|
+
const endIconEl = component.endIcon ? /* @__PURE__ */ jsx63(
|
|
8083
8108
|
"img",
|
|
8084
8109
|
{
|
|
8085
8110
|
src: component.endIcon,
|
|
@@ -8088,7 +8113,7 @@ var createAuthComponentFromFlow = (component, formValues, touchedFields, formErr
|
|
|
8088
8113
|
style: { height: "1.25em", objectFit: "contain", width: "1.25em" }
|
|
8089
8114
|
}
|
|
8090
8115
|
) : null;
|
|
8091
|
-
return /* @__PURE__ */
|
|
8116
|
+
return /* @__PURE__ */ jsx63(
|
|
8092
8117
|
Button_default,
|
|
8093
8118
|
{
|
|
8094
8119
|
fullWidth: true,
|
|
@@ -8107,10 +8132,10 @@ var createAuthComponentFromFlow = (component, formValues, touchedFields, formErr
|
|
|
8107
8132
|
}
|
|
8108
8133
|
case EmbeddedFlowComponentType.Text: {
|
|
8109
8134
|
const variant = getTypographyVariant(component.variant);
|
|
8110
|
-
return /* @__PURE__ */
|
|
8135
|
+
return /* @__PURE__ */ jsx63(Typography_default, { variant, children: resolve(component.label) }, key);
|
|
8111
8136
|
}
|
|
8112
8137
|
case EmbeddedFlowComponentType.Divider: {
|
|
8113
|
-
return /* @__PURE__ */
|
|
8138
|
+
return /* @__PURE__ */ jsx63(Divider_default, { children: resolve(component.label) || "" }, key);
|
|
8114
8139
|
}
|
|
8115
8140
|
case EmbeddedFlowComponentType.Select: {
|
|
8116
8141
|
const identifier = component.ref;
|
|
@@ -8121,7 +8146,7 @@ var createAuthComponentFromFlow = (component, formValues, touchedFields, formErr
|
|
|
8121
8146
|
label: typeof opt === "string" ? opt : String(opt.label ?? opt.value ?? ""),
|
|
8122
8147
|
value: typeof opt === "string" ? opt : String(opt.value ?? "")
|
|
8123
8148
|
}));
|
|
8124
|
-
return /* @__PURE__ */
|
|
8149
|
+
return /* @__PURE__ */ jsx63(
|
|
8125
8150
|
Select_default,
|
|
8126
8151
|
{
|
|
8127
8152
|
name: identifier,
|
|
@@ -8156,12 +8181,12 @@ var createAuthComponentFromFlow = (component, formValues, touchedFields, formErr
|
|
|
8156
8181
|
}
|
|
8157
8182
|
)
|
|
8158
8183
|
).filter(Boolean);
|
|
8159
|
-
return /* @__PURE__ */
|
|
8184
|
+
return /* @__PURE__ */ jsx63("form", { id: component.id, children: blockComponents }, key);
|
|
8160
8185
|
}
|
|
8161
8186
|
return null;
|
|
8162
8187
|
}
|
|
8163
8188
|
case EmbeddedFlowComponentType.RichText: {
|
|
8164
|
-
return /* @__PURE__ */
|
|
8189
|
+
return /* @__PURE__ */ jsx63(
|
|
8165
8190
|
"div",
|
|
8166
8191
|
{
|
|
8167
8192
|
className: richTextClass,
|
|
@@ -8171,15 +8196,17 @@ var createAuthComponentFromFlow = (component, formValues, touchedFields, formErr
|
|
|
8171
8196
|
);
|
|
8172
8197
|
}
|
|
8173
8198
|
case EmbeddedFlowComponentType.Image: {
|
|
8174
|
-
|
|
8199
|
+
const explicitHeight = resolve(component.height?.toString());
|
|
8200
|
+
const explicitWidth = resolve(component.width?.toString());
|
|
8201
|
+
return /* @__PURE__ */ jsx63(
|
|
8175
8202
|
ImageComponent_default,
|
|
8176
8203
|
{
|
|
8177
8204
|
component: {
|
|
8178
8205
|
config: {
|
|
8179
8206
|
alt: resolve(component.alt) || resolve(component.label) || "Image",
|
|
8180
|
-
height:
|
|
8207
|
+
height: explicitHeight || (options.inStack ? "50" : "auto"),
|
|
8181
8208
|
src: resolve(component.src),
|
|
8182
|
-
width:
|
|
8209
|
+
width: explicitWidth || (options.inStack ? "50" : "100%")
|
|
8183
8210
|
}
|
|
8184
8211
|
},
|
|
8185
8212
|
formErrors: void 0,
|
|
@@ -8201,7 +8228,7 @@ var createAuthComponentFromFlow = (component, formValues, touchedFields, formErr
|
|
|
8201
8228
|
logger5.warn(`Unknown icon name: "${iconName}". Skipping render.`);
|
|
8202
8229
|
return null;
|
|
8203
8230
|
}
|
|
8204
|
-
return /* @__PURE__ */
|
|
8231
|
+
return /* @__PURE__ */ jsx63(IconComponent, { size: component.size || 24, color: component.color || "currentColor" }, key);
|
|
8205
8232
|
}
|
|
8206
8233
|
case EmbeddedFlowComponentType.Stack: {
|
|
8207
8234
|
const direction = component.direction || "row";
|
|
@@ -8228,11 +8255,12 @@ var createAuthComponentFromFlow = (component, formValues, touchedFields, formErr
|
|
|
8228
8255
|
authType,
|
|
8229
8256
|
{
|
|
8230
8257
|
...options,
|
|
8258
|
+
inStack: true,
|
|
8231
8259
|
key: childComponent.id || `${component.id}_${index}`
|
|
8232
8260
|
}
|
|
8233
8261
|
)
|
|
8234
8262
|
) : [];
|
|
8235
|
-
return /* @__PURE__ */
|
|
8263
|
+
return /* @__PURE__ */ jsx63("div", { style: stackStyle, children: stackChildren }, key);
|
|
8236
8264
|
}
|
|
8237
8265
|
default:
|
|
8238
8266
|
logger5.warn(`Unsupported component type: ${component.type}. Skipping render.`);
|
|
@@ -8289,7 +8317,7 @@ var renderInviteUserComponents = (components, formValues, touchedFields, formErr
|
|
|
8289
8317
|
).filter(Boolean);
|
|
8290
8318
|
|
|
8291
8319
|
// src/components/presentation/auth/SignIn/v2/BaseSignIn.tsx
|
|
8292
|
-
import { jsx as
|
|
8320
|
+
import { jsx as jsx64, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
8293
8321
|
var BaseSignInContent2 = ({
|
|
8294
8322
|
components = [],
|
|
8295
8323
|
onSubmit,
|
|
@@ -8497,13 +8525,13 @@ var BaseSignInContent2 = ({
|
|
|
8497
8525
|
},
|
|
8498
8526
|
values: formValues
|
|
8499
8527
|
};
|
|
8500
|
-
return /* @__PURE__ */
|
|
8528
|
+
return /* @__PURE__ */ jsx64("div", { className: containerClasses, "data-testid": "asgardeo-signin", children: children(renderProps) });
|
|
8501
8529
|
}
|
|
8502
8530
|
if (isLoading) {
|
|
8503
|
-
return /* @__PURE__ */
|
|
8531
|
+
return /* @__PURE__ */ jsx64(Card_default, { className: cx20(containerClasses, styles.card), "data-testid": "asgardeo-signin", variant, children: /* @__PURE__ */ jsx64(Card_default.Content, { children: /* @__PURE__ */ jsx64("div", { style: { display: "flex", justifyContent: "center", padding: "2rem" }, children: /* @__PURE__ */ jsx64(Spinner_default, {}) }) }) });
|
|
8504
8532
|
}
|
|
8505
8533
|
if (!components || components.length === 0) {
|
|
8506
|
-
return /* @__PURE__ */
|
|
8534
|
+
return /* @__PURE__ */ jsx64(Card_default, { className: cx20(containerClasses, styles.card), "data-testid": "asgardeo-signin", variant, children: /* @__PURE__ */ jsx64(Card_default.Content, { children: /* @__PURE__ */ jsx64(Alert_default, { variant: "warning", children: /* @__PURE__ */ jsx64(Typography_default, { variant: "body1", children: t("errors.signin.components.not.available") }) }) }) });
|
|
8507
8535
|
}
|
|
8508
8536
|
const {
|
|
8509
8537
|
title: rawTitle,
|
|
@@ -8512,46 +8540,46 @@ var BaseSignInContent2 = ({
|
|
|
8512
8540
|
} = getAuthComponentHeadings_default(components, flowTitle, flowSubtitle, void 0, void 0);
|
|
8513
8541
|
const title = resolveVars3(rawTitle, { meta, t });
|
|
8514
8542
|
const subtitle = resolveVars3(rawSubtitle, { meta, t });
|
|
8515
|
-
return /* @__PURE__ */
|
|
8516
|
-
(showTitle || showSubtitle) && /* @__PURE__ */
|
|
8517
|
-
showTitle && /* @__PURE__ */
|
|
8518
|
-
showSubtitle && /* @__PURE__ */
|
|
8543
|
+
return /* @__PURE__ */ jsxs29(Card_default, { className: cx20(containerClasses, styles.card), "data-testid": "asgardeo-signin", variant, children: [
|
|
8544
|
+
(showTitle || showSubtitle) && /* @__PURE__ */ jsxs29(Card_default.Header, { className: styles.header, children: [
|
|
8545
|
+
showTitle && /* @__PURE__ */ jsx64(Card_default.Title, { level: 2, className: styles.title, children: title }),
|
|
8546
|
+
showSubtitle && /* @__PURE__ */ jsx64(Typography_default, { variant: "body1", className: styles.subtitle, children: subtitle })
|
|
8519
8547
|
] }),
|
|
8520
|
-
/* @__PURE__ */
|
|
8521
|
-
externalError && /* @__PURE__ */
|
|
8522
|
-
flowMessages && flowMessages.length > 0 && /* @__PURE__ */
|
|
8548
|
+
/* @__PURE__ */ jsxs29(Card_default.Content, { children: [
|
|
8549
|
+
externalError && /* @__PURE__ */ jsx64("div", { className: styles.flowMessagesContainer, children: /* @__PURE__ */ jsx64(Alert_default, { variant: "error", className: cx20(styles.flowMessageItem, messageClasses), children: /* @__PURE__ */ jsx64(Alert_default.Description, { children: externalError.message }) }) }),
|
|
8550
|
+
flowMessages && flowMessages.length > 0 && /* @__PURE__ */ jsx64("div", { className: styles.flowMessagesContainer, children: flowMessages.map((message, index) => /* @__PURE__ */ jsx64(
|
|
8523
8551
|
Alert_default,
|
|
8524
8552
|
{
|
|
8525
8553
|
variant: message.type === "error" ? "error" : "info",
|
|
8526
8554
|
className: cx20(styles.flowMessageItem, messageClasses),
|
|
8527
|
-
children: /* @__PURE__ */
|
|
8555
|
+
children: /* @__PURE__ */ jsx64(Alert_default.Description, { children: message.message })
|
|
8528
8556
|
},
|
|
8529
8557
|
index
|
|
8530
8558
|
)) }),
|
|
8531
|
-
/* @__PURE__ */
|
|
8559
|
+
/* @__PURE__ */ jsx64("div", { className: styles.contentContainer, children: componentsWithoutHeadings && renderComponents(componentsWithoutHeadings) })
|
|
8532
8560
|
] })
|
|
8533
8561
|
] });
|
|
8534
8562
|
};
|
|
8535
8563
|
var BaseSignIn2 = ({ preferences, showLogo = true, ...rest }) => {
|
|
8536
8564
|
const { theme } = useTheme_default();
|
|
8537
8565
|
const styles = BaseSignIn_styles_default(theme, theme.vars.colors.text.primary);
|
|
8538
|
-
const content = /* @__PURE__ */
|
|
8539
|
-
showLogo && /* @__PURE__ */
|
|
8540
|
-
/* @__PURE__ */
|
|
8566
|
+
const content = /* @__PURE__ */ jsxs29("div", { children: [
|
|
8567
|
+
showLogo && /* @__PURE__ */ jsx64("div", { className: styles.logoContainer, children: /* @__PURE__ */ jsx64(Logo_default, { size: "large" }) }),
|
|
8568
|
+
/* @__PURE__ */ jsx64(FlowProvider_default, { children: /* @__PURE__ */ jsx64(BaseSignInContent2, { showLogo, ...rest }) })
|
|
8541
8569
|
] });
|
|
8542
8570
|
if (!preferences) return content;
|
|
8543
|
-
return /* @__PURE__ */
|
|
8571
|
+
return /* @__PURE__ */ jsx64(ComponentPreferencesContext_default.Provider, { value: preferences, children: content });
|
|
8544
8572
|
};
|
|
8545
8573
|
var BaseSignIn_default2 = BaseSignIn2;
|
|
8546
8574
|
|
|
8547
8575
|
// src/components/presentation/auth/SignIn/BaseSignIn.tsx
|
|
8548
|
-
import { jsx as
|
|
8576
|
+
import { jsx as jsx65 } from "react/jsx-runtime";
|
|
8549
8577
|
var BaseSignIn3 = (props) => {
|
|
8550
8578
|
const { platform } = useAsgardeo_default();
|
|
8551
8579
|
if (platform === Platform4.AsgardeoV2) {
|
|
8552
|
-
return /* @__PURE__ */
|
|
8580
|
+
return /* @__PURE__ */ jsx65(BaseSignIn_default2, { ...props });
|
|
8553
8581
|
}
|
|
8554
|
-
return /* @__PURE__ */
|
|
8582
|
+
return /* @__PURE__ */ jsx65(BaseSignIn_default, { ...props });
|
|
8555
8583
|
};
|
|
8556
8584
|
var BaseSignIn_default3 = BaseSignIn3;
|
|
8557
8585
|
|
|
@@ -8843,7 +8871,7 @@ var handlePasskeyAuthentication = async (challengeData) => {
|
|
|
8843
8871
|
};
|
|
8844
8872
|
|
|
8845
8873
|
// src/components/presentation/auth/SignIn/v2/SignIn.tsx
|
|
8846
|
-
import { Fragment as Fragment13, jsx as
|
|
8874
|
+
import { Fragment as Fragment13, jsx as jsx66 } from "react/jsx-runtime";
|
|
8847
8875
|
var SignIn = ({
|
|
8848
8876
|
className,
|
|
8849
8877
|
preferences,
|
|
@@ -9180,9 +9208,9 @@ var SignIn = ({
|
|
|
9180
9208
|
meta,
|
|
9181
9209
|
onSubmit: handleSubmit
|
|
9182
9210
|
};
|
|
9183
|
-
return /* @__PURE__ */
|
|
9211
|
+
return /* @__PURE__ */ jsx66(Fragment13, { children: children(renderProps) });
|
|
9184
9212
|
}
|
|
9185
|
-
return /* @__PURE__ */
|
|
9213
|
+
return /* @__PURE__ */ jsx66(
|
|
9186
9214
|
BaseSignIn_default2,
|
|
9187
9215
|
{
|
|
9188
9216
|
components,
|
|
@@ -9200,7 +9228,7 @@ var SignIn = ({
|
|
|
9200
9228
|
var SignIn_default = SignIn;
|
|
9201
9229
|
|
|
9202
9230
|
// src/components/presentation/auth/SignIn/SignIn.tsx
|
|
9203
|
-
import { jsx as
|
|
9231
|
+
import { jsx as jsx67 } from "react/jsx-runtime";
|
|
9204
9232
|
var SignIn2 = ({ className, size = "medium", children, preferences, ...rest }) => {
|
|
9205
9233
|
const { signIn, afterSignInUrl, isInitialized, isLoading, platform } = useAsgardeo_default();
|
|
9206
9234
|
const handleInitialize = async () => await signIn({ response_mode: "direct" });
|
|
@@ -9217,7 +9245,7 @@ var SignIn2 = ({ className, size = "medium", children, preferences, ...rest }) =
|
|
|
9217
9245
|
}
|
|
9218
9246
|
};
|
|
9219
9247
|
if (platform === Platform5.AsgardeoV2) {
|
|
9220
|
-
return /* @__PURE__ */
|
|
9248
|
+
return /* @__PURE__ */ jsx67(
|
|
9221
9249
|
SignIn_default,
|
|
9222
9250
|
{
|
|
9223
9251
|
className,
|
|
@@ -9230,7 +9258,7 @@ var SignIn2 = ({ className, size = "medium", children, preferences, ...rest }) =
|
|
|
9230
9258
|
}
|
|
9231
9259
|
);
|
|
9232
9260
|
}
|
|
9233
|
-
return /* @__PURE__ */
|
|
9261
|
+
return /* @__PURE__ */ jsx67(
|
|
9234
9262
|
BaseSignIn_default3,
|
|
9235
9263
|
{
|
|
9236
9264
|
isLoading: isLoading || !isInitialized,
|
|
@@ -9324,13 +9352,13 @@ var DateInput = ({
|
|
|
9324
9352
|
var DateInput_default = DateInput;
|
|
9325
9353
|
|
|
9326
9354
|
// src/components/adapters/DividerComponent.tsx
|
|
9327
|
-
import { jsx as
|
|
9355
|
+
import { jsx as jsx68 } from "react/jsx-runtime";
|
|
9328
9356
|
var DividerComponent = ({ component }) => {
|
|
9329
9357
|
const { theme } = useTheme_default();
|
|
9330
9358
|
const config = component.config || {};
|
|
9331
9359
|
const text = config["text"] || "";
|
|
9332
9360
|
const variant = component.variant?.toLowerCase() || "horizontal";
|
|
9333
|
-
return /* @__PURE__ */
|
|
9361
|
+
return /* @__PURE__ */ jsx68(
|
|
9334
9362
|
Divider_default,
|
|
9335
9363
|
{
|
|
9336
9364
|
orientation: variant === "vertical" ? "vertical" : "horizontal",
|
|
@@ -9371,7 +9399,7 @@ var EmailInput = ({
|
|
|
9371
9399
|
var EmailInput_default = EmailInput;
|
|
9372
9400
|
|
|
9373
9401
|
// src/components/adapters/FormContainer.tsx
|
|
9374
|
-
import { jsx as
|
|
9402
|
+
import { jsx as jsx69 } from "react/jsx-runtime";
|
|
9375
9403
|
var FormContainer = (props) => {
|
|
9376
9404
|
const { component } = props;
|
|
9377
9405
|
if (component.components && component.components.length > 0) {
|
|
@@ -9384,14 +9412,14 @@ var FormContainer = (props) => {
|
|
|
9384
9412
|
props.onSubmit(submitButton, props.formValues);
|
|
9385
9413
|
}
|
|
9386
9414
|
};
|
|
9387
|
-
return /* @__PURE__ */
|
|
9415
|
+
return /* @__PURE__ */ jsx69("form", { onSubmit: handleFormSubmit, style: { display: "flex", flexDirection: "column" }, children: component.components.map(
|
|
9388
9416
|
(childComponent) => createSignUpComponent({
|
|
9389
9417
|
...props,
|
|
9390
9418
|
component: childComponent
|
|
9391
9419
|
})
|
|
9392
9420
|
) }, component.id);
|
|
9393
9421
|
}
|
|
9394
|
-
return /* @__PURE__ */
|
|
9422
|
+
return /* @__PURE__ */ jsx69("div", {}, component.id);
|
|
9395
9423
|
};
|
|
9396
9424
|
var FormContainer_default = FormContainer;
|
|
9397
9425
|
|
|
@@ -9517,7 +9545,7 @@ var SelectInput = ({
|
|
|
9517
9545
|
var SelectInput_default = SelectInput;
|
|
9518
9546
|
|
|
9519
9547
|
// src/components/adapters/SubmitButton.tsx
|
|
9520
|
-
import { jsx as
|
|
9548
|
+
import { jsx as jsx70 } from "react/jsx-runtime";
|
|
9521
9549
|
var ButtonComponent = ({
|
|
9522
9550
|
component,
|
|
9523
9551
|
isLoading,
|
|
@@ -9539,6 +9567,7 @@ var ButtonComponent = ({
|
|
|
9539
9567
|
case "TEXT":
|
|
9540
9568
|
return { color: "primary", variant: "text" };
|
|
9541
9569
|
case "SOCIAL":
|
|
9570
|
+
case "OUTLINED":
|
|
9542
9571
|
return { color: "primary", variant: "outline" };
|
|
9543
9572
|
default:
|
|
9544
9573
|
return { color: "primary", variant: "solid" };
|
|
@@ -9550,7 +9579,7 @@ var ButtonComponent = ({
|
|
|
9550
9579
|
onSubmit(component);
|
|
9551
9580
|
}
|
|
9552
9581
|
};
|
|
9553
|
-
return /* @__PURE__ */
|
|
9582
|
+
return /* @__PURE__ */ jsx70(
|
|
9554
9583
|
Button_default,
|
|
9555
9584
|
{
|
|
9556
9585
|
type: buttonType === "submit" ? "submit" : "button",
|
|
@@ -9561,7 +9590,7 @@ var ButtonComponent = ({
|
|
|
9561
9590
|
onClick: buttonType !== "submit" ? handleClick : void 0,
|
|
9562
9591
|
className: buttonClassName,
|
|
9563
9592
|
style: { width: "100%" },
|
|
9564
|
-
children: isLoading ? /* @__PURE__ */
|
|
9593
|
+
children: isLoading ? /* @__PURE__ */ jsx70(Spinner_default, { size: "small" }) : buttonText
|
|
9565
9594
|
},
|
|
9566
9595
|
component.id
|
|
9567
9596
|
);
|
|
@@ -9569,7 +9598,7 @@ var ButtonComponent = ({
|
|
|
9569
9598
|
var SubmitButton_default = ButtonComponent;
|
|
9570
9599
|
|
|
9571
9600
|
// src/components/adapters/TelephoneInput.tsx
|
|
9572
|
-
import { jsx as
|
|
9601
|
+
import { jsx as jsx71 } from "react/jsx-runtime";
|
|
9573
9602
|
var TelephoneInput = ({
|
|
9574
9603
|
component,
|
|
9575
9604
|
formValues,
|
|
@@ -9582,7 +9611,7 @@ var TelephoneInput = ({
|
|
|
9582
9611
|
const fieldName = config["identifier"] || config["name"] || component.id;
|
|
9583
9612
|
const value = formValues[fieldName] || "";
|
|
9584
9613
|
const error = touchedFields[fieldName] ? formErrors[fieldName] : void 0;
|
|
9585
|
-
return /* @__PURE__ */
|
|
9614
|
+
return /* @__PURE__ */ jsx71(
|
|
9586
9615
|
TextField_default,
|
|
9587
9616
|
{
|
|
9588
9617
|
name: fieldName,
|
|
@@ -9630,7 +9659,7 @@ var TextInput = ({
|
|
|
9630
9659
|
var TextInput_default = TextInput;
|
|
9631
9660
|
|
|
9632
9661
|
// src/components/adapters/Typography.tsx
|
|
9633
|
-
import { jsx as
|
|
9662
|
+
import { jsx as jsx72 } from "react/jsx-runtime";
|
|
9634
9663
|
var TypographyComponent = ({ component }) => {
|
|
9635
9664
|
const { theme } = useTheme_default();
|
|
9636
9665
|
const config = component.config || {};
|
|
@@ -9671,7 +9700,7 @@ var TypographyComponent = ({ component }) => {
|
|
|
9671
9700
|
default:
|
|
9672
9701
|
typographyVariant = "body1";
|
|
9673
9702
|
}
|
|
9674
|
-
return /* @__PURE__ */
|
|
9703
|
+
return /* @__PURE__ */ jsx72(
|
|
9675
9704
|
Typography_default,
|
|
9676
9705
|
{
|
|
9677
9706
|
variant: typographyVariant,
|
|
@@ -9684,69 +9713,69 @@ var TypographyComponent = ({ component }) => {
|
|
|
9684
9713
|
var Typography_default2 = TypographyComponent;
|
|
9685
9714
|
|
|
9686
9715
|
// src/components/presentation/auth/SignUp/v1/SignUpOptionFactory.tsx
|
|
9687
|
-
import { jsx as
|
|
9716
|
+
import { jsx as jsx73 } from "react/jsx-runtime";
|
|
9688
9717
|
var createSignUpComponent = ({ component, onSubmit, ...rest }) => {
|
|
9689
9718
|
switch (component.type) {
|
|
9690
9719
|
case EmbeddedFlowComponentType2.Typography:
|
|
9691
|
-
return /* @__PURE__ */
|
|
9720
|
+
return /* @__PURE__ */ jsx73(Typography_default2, { component, onSubmit, ...rest });
|
|
9692
9721
|
case EmbeddedFlowComponentType2.Input: {
|
|
9693
9722
|
const inputVariant = component.variant?.toUpperCase();
|
|
9694
9723
|
const inputType = component.config["type"]?.toLowerCase();
|
|
9695
9724
|
if (inputVariant === "EMAIL" || inputType === "email") {
|
|
9696
|
-
return /* @__PURE__ */
|
|
9725
|
+
return /* @__PURE__ */ jsx73(EmailInput_default, { component, onSubmit, ...rest });
|
|
9697
9726
|
}
|
|
9698
9727
|
if (inputVariant === "PASSWORD" || inputType === "password") {
|
|
9699
|
-
return /* @__PURE__ */
|
|
9728
|
+
return /* @__PURE__ */ jsx73(PasswordInput_default, { component, onSubmit, ...rest });
|
|
9700
9729
|
}
|
|
9701
9730
|
if (inputVariant === "TELEPHONE" || inputType === "tel") {
|
|
9702
|
-
return /* @__PURE__ */
|
|
9731
|
+
return /* @__PURE__ */ jsx73(TelephoneInput_default, { component, onSubmit, ...rest });
|
|
9703
9732
|
}
|
|
9704
9733
|
if (inputVariant === "NUMBER" || inputType === "number") {
|
|
9705
|
-
return /* @__PURE__ */
|
|
9734
|
+
return /* @__PURE__ */ jsx73(NumberInput_default, { component, onSubmit, ...rest });
|
|
9706
9735
|
}
|
|
9707
9736
|
if (inputVariant === "DATE" || inputType === "date") {
|
|
9708
|
-
return /* @__PURE__ */
|
|
9737
|
+
return /* @__PURE__ */ jsx73(DateInput_default, { component, onSubmit, ...rest });
|
|
9709
9738
|
}
|
|
9710
9739
|
if (inputVariant === "CHECKBOX" || inputType === "checkbox") {
|
|
9711
|
-
return /* @__PURE__ */
|
|
9740
|
+
return /* @__PURE__ */ jsx73(CheckboxInput_default, { component, onSubmit, ...rest });
|
|
9712
9741
|
}
|
|
9713
|
-
return /* @__PURE__ */
|
|
9742
|
+
return /* @__PURE__ */ jsx73(TextInput_default, { component, onSubmit, ...rest });
|
|
9714
9743
|
}
|
|
9715
9744
|
case EmbeddedFlowComponentType2.Button: {
|
|
9716
9745
|
const buttonVariant = component.variant?.toUpperCase();
|
|
9717
9746
|
const buttonText = component.config["text"] || component.config["label"] || "";
|
|
9718
9747
|
if (buttonVariant === "SOCIAL") {
|
|
9719
9748
|
if (buttonText.toLowerCase().includes("google")) {
|
|
9720
|
-
return /* @__PURE__ */
|
|
9749
|
+
return /* @__PURE__ */ jsx73(GoogleButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
|
|
9721
9750
|
}
|
|
9722
9751
|
if (buttonText.toLowerCase().includes("github")) {
|
|
9723
|
-
return /* @__PURE__ */
|
|
9752
|
+
return /* @__PURE__ */ jsx73(GitHubButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
|
|
9724
9753
|
}
|
|
9725
9754
|
if (buttonText.toLowerCase().includes("microsoft")) {
|
|
9726
|
-
return /* @__PURE__ */
|
|
9755
|
+
return /* @__PURE__ */ jsx73(MicrosoftButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
|
|
9727
9756
|
}
|
|
9728
9757
|
if (buttonText.toLowerCase().includes("facebook")) {
|
|
9729
|
-
return /* @__PURE__ */
|
|
9758
|
+
return /* @__PURE__ */ jsx73(FacebookButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
|
|
9730
9759
|
}
|
|
9731
9760
|
if (buttonText.toLowerCase().includes("linkedin")) {
|
|
9732
|
-
return /* @__PURE__ */
|
|
9761
|
+
return /* @__PURE__ */ jsx73(LinkedInButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
|
|
9733
9762
|
}
|
|
9734
9763
|
if (buttonText.toLowerCase().includes("ethereum")) {
|
|
9735
|
-
return /* @__PURE__ */
|
|
9764
|
+
return /* @__PURE__ */ jsx73(SignInWithEthereumButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
|
|
9736
9765
|
}
|
|
9737
9766
|
}
|
|
9738
|
-
return /* @__PURE__ */
|
|
9767
|
+
return /* @__PURE__ */ jsx73(SubmitButton_default, { component, onSubmit, ...rest });
|
|
9739
9768
|
}
|
|
9740
9769
|
case EmbeddedFlowComponentType2.Form:
|
|
9741
|
-
return /* @__PURE__ */
|
|
9770
|
+
return /* @__PURE__ */ jsx73(FormContainer_default, { component, onSubmit, ...rest });
|
|
9742
9771
|
case EmbeddedFlowComponentType2.Select:
|
|
9743
|
-
return /* @__PURE__ */
|
|
9772
|
+
return /* @__PURE__ */ jsx73(SelectInput_default, { component, onSubmit, ...rest });
|
|
9744
9773
|
case EmbeddedFlowComponentType2.Divider:
|
|
9745
|
-
return /* @__PURE__ */
|
|
9774
|
+
return /* @__PURE__ */ jsx73(DividerComponent_default, { component, onSubmit, ...rest });
|
|
9746
9775
|
case EmbeddedFlowComponentType2.Image:
|
|
9747
|
-
return /* @__PURE__ */
|
|
9776
|
+
return /* @__PURE__ */ jsx73(ImageComponent_default, { component, onSubmit, ...rest });
|
|
9748
9777
|
default:
|
|
9749
|
-
return /* @__PURE__ */
|
|
9778
|
+
return /* @__PURE__ */ jsx73("div", {});
|
|
9750
9779
|
}
|
|
9751
9780
|
};
|
|
9752
9781
|
var createSignUpOptionFromComponent = (component, formValues, touchedFields, formErrors, isLoading, isFormValid, onInputChange, options) => createSignUpComponent({
|
|
@@ -9915,7 +9944,7 @@ var useStyles17 = (theme, colorScheme) => useMemo25(() => {
|
|
|
9915
9944
|
var BaseSignUp_styles_default = useStyles17;
|
|
9916
9945
|
|
|
9917
9946
|
// src/components/presentation/auth/SignUp/v1/BaseSignUp.tsx
|
|
9918
|
-
import { jsx as
|
|
9947
|
+
import { jsx as jsx74, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
9919
9948
|
var logger6 = createPackageComponentLogger6(
|
|
9920
9949
|
"@asgardeo/react",
|
|
9921
9950
|
"BaseSignUp"
|
|
@@ -10318,42 +10347,42 @@ var BaseSignUpContent = ({
|
|
|
10318
10347
|
validateForm,
|
|
10319
10348
|
values: formValues
|
|
10320
10349
|
};
|
|
10321
|
-
return /* @__PURE__ */
|
|
10350
|
+
return /* @__PURE__ */ jsx74("div", { className: containerClasses, children: children(renderProps) });
|
|
10322
10351
|
}
|
|
10323
10352
|
if (!isFlowInitialized && isLoading) {
|
|
10324
|
-
return /* @__PURE__ */
|
|
10353
|
+
return /* @__PURE__ */ jsx74(Card_default, { className: cx21(containerClasses, styles.card), variant, children: /* @__PURE__ */ jsx74(Card_default.Content, { children: /* @__PURE__ */ jsx74("div", { className: styles.loadingContainer, children: /* @__PURE__ */ jsx74(Spinner_default, { size: "medium" }) }) }) });
|
|
10325
10354
|
}
|
|
10326
10355
|
if (!currentFlow) {
|
|
10327
|
-
return /* @__PURE__ */
|
|
10328
|
-
/* @__PURE__ */
|
|
10329
|
-
/* @__PURE__ */
|
|
10356
|
+
return /* @__PURE__ */ jsx74(Card_default, { className: cx21(containerClasses, styles.card), variant, children: /* @__PURE__ */ jsx74(Card_default.Content, { children: /* @__PURE__ */ jsxs30(Alert_default, { variant: "error", className: errorClasses, children: [
|
|
10357
|
+
/* @__PURE__ */ jsx74(Alert_default.Title, { children: t("errors.heading") }),
|
|
10358
|
+
/* @__PURE__ */ jsx74(Alert_default.Description, { children: t("errors.signup.flow.initialization.failure") })
|
|
10330
10359
|
] }) }) });
|
|
10331
10360
|
}
|
|
10332
|
-
return /* @__PURE__ */
|
|
10333
|
-
(showTitle || showSubtitle) && /* @__PURE__ */
|
|
10334
|
-
showTitle && /* @__PURE__ */
|
|
10335
|
-
showSubtitle && /* @__PURE__ */
|
|
10361
|
+
return /* @__PURE__ */ jsxs30(Card_default, { className: cx21(containerClasses, styles.card), variant, children: [
|
|
10362
|
+
(showTitle || showSubtitle) && /* @__PURE__ */ jsxs30(Card_default.Header, { className: styles.header, children: [
|
|
10363
|
+
showTitle && /* @__PURE__ */ jsx74(Card_default.Title, { level: 2, className: styles.title, children: flowTitle || t("signup.heading") }),
|
|
10364
|
+
showSubtitle && /* @__PURE__ */ jsx74(Typography_default, { variant: "body1", className: styles.subtitle, children: flowSubtitle || t("signup.subheading") })
|
|
10336
10365
|
] }),
|
|
10337
|
-
/* @__PURE__ */
|
|
10338
|
-
flowMessages && flowMessages.length > 0 && /* @__PURE__ */
|
|
10366
|
+
/* @__PURE__ */ jsxs30(Card_default.Content, { children: [
|
|
10367
|
+
flowMessages && flowMessages.length > 0 && /* @__PURE__ */ jsx74("div", { className: styles.flowMessagesContainer, children: flowMessages.map((message, index) => /* @__PURE__ */ jsx74(
|
|
10339
10368
|
Alert_default,
|
|
10340
10369
|
{
|
|
10341
10370
|
variant: message.type?.toLowerCase() === "error" ? "error" : "info",
|
|
10342
10371
|
className: cx21(styles.flowMessageItem, messageClasses),
|
|
10343
|
-
children: /* @__PURE__ */
|
|
10372
|
+
children: /* @__PURE__ */ jsx74(Alert_default.Description, { children: message.message })
|
|
10344
10373
|
},
|
|
10345
10374
|
message.id || index
|
|
10346
10375
|
)) }),
|
|
10347
|
-
/* @__PURE__ */
|
|
10376
|
+
/* @__PURE__ */ jsx74("div", { className: styles.contentContainer, children: currentFlow.data?.components && currentFlow.data.components.length > 0 ? renderComponents(currentFlow.data.components) : /* @__PURE__ */ jsx74(Alert_default, { variant: "warning", children: /* @__PURE__ */ jsx74(Typography_default, { variant: "body1", children: t("errors.signup.components.not.available") }) }) })
|
|
10348
10377
|
] })
|
|
10349
10378
|
] });
|
|
10350
10379
|
};
|
|
10351
10380
|
var BaseSignUp = ({ showLogo = true, ...rest }) => {
|
|
10352
10381
|
const { theme, colorScheme } = useTheme_default();
|
|
10353
10382
|
const styles = BaseSignUp_styles_default(theme, colorScheme);
|
|
10354
|
-
return /* @__PURE__ */
|
|
10355
|
-
showLogo && /* @__PURE__ */
|
|
10356
|
-
/* @__PURE__ */
|
|
10383
|
+
return /* @__PURE__ */ jsxs30("div", { children: [
|
|
10384
|
+
showLogo && /* @__PURE__ */ jsx74("div", { className: styles.logoContainer, children: /* @__PURE__ */ jsx74(Logo_default, { size: "large" }) }),
|
|
10385
|
+
/* @__PURE__ */ jsx74(FlowProvider_default, { children: /* @__PURE__ */ jsx74(BaseSignUpContent, { showLogo, ...rest }) })
|
|
10357
10386
|
] });
|
|
10358
10387
|
};
|
|
10359
10388
|
var BaseSignUp_default = BaseSignUp;
|
|
@@ -10368,7 +10397,7 @@ import {
|
|
|
10368
10397
|
} from "@asgardeo/browser";
|
|
10369
10398
|
import { cx as cx22 } from "@emotion/css";
|
|
10370
10399
|
import { useEffect as useEffect18, useState as useState19, useCallback as useCallback13, useRef as useRef9 } from "react";
|
|
10371
|
-
import { jsx as
|
|
10400
|
+
import { jsx as jsx75, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
10372
10401
|
var logger7 = createPackageComponentLogger7(
|
|
10373
10402
|
"@asgardeo/react",
|
|
10374
10403
|
"BaseSignUp"
|
|
@@ -10872,15 +10901,15 @@ var BaseSignUpContent2 = ({
|
|
|
10872
10901
|
},
|
|
10873
10902
|
values: formValues
|
|
10874
10903
|
};
|
|
10875
|
-
return /* @__PURE__ */
|
|
10904
|
+
return /* @__PURE__ */ jsx75("div", { className: containerClasses, children: children(renderProps) });
|
|
10876
10905
|
}
|
|
10877
10906
|
if (!isFlowInitialized && isLoading) {
|
|
10878
|
-
return /* @__PURE__ */
|
|
10907
|
+
return /* @__PURE__ */ jsx75(Card_default, { className: cx22(containerClasses, styles.card), variant, children: /* @__PURE__ */ jsx75(Card_default.Content, { children: /* @__PURE__ */ jsx75("div", { className: styles.loadingContainer, children: /* @__PURE__ */ jsx75(Spinner_default, { size: "medium" }) }) }) });
|
|
10879
10908
|
}
|
|
10880
10909
|
if (!currentFlow) {
|
|
10881
|
-
return /* @__PURE__ */
|
|
10882
|
-
/* @__PURE__ */
|
|
10883
|
-
/* @__PURE__ */
|
|
10910
|
+
return /* @__PURE__ */ jsx75(Card_default, { className: cx22(containerClasses, styles.card), variant, children: /* @__PURE__ */ jsx75(Card_default.Content, { children: /* @__PURE__ */ jsxs31(Alert_default, { variant: "error", className: errorClasses, children: [
|
|
10911
|
+
/* @__PURE__ */ jsx75(Alert_default.Title, { children: t("errors.heading") }),
|
|
10912
|
+
/* @__PURE__ */ jsx75(Alert_default.Description, { children: t("errors.signup.flow.initialization.failure") })
|
|
10884
10913
|
] }) }) });
|
|
10885
10914
|
}
|
|
10886
10915
|
const componentsToRender = currentFlow.data?.components || [];
|
|
@@ -10891,46 +10920,46 @@ var BaseSignUpContent2 = ({
|
|
|
10891
10920
|
t("signup.heading"),
|
|
10892
10921
|
t("signup.subheading")
|
|
10893
10922
|
);
|
|
10894
|
-
return /* @__PURE__ */
|
|
10895
|
-
(showTitle || showSubtitle) && /* @__PURE__ */
|
|
10896
|
-
showTitle && /* @__PURE__ */
|
|
10897
|
-
showSubtitle && /* @__PURE__ */
|
|
10923
|
+
return /* @__PURE__ */ jsxs31(Card_default, { className: cx22(containerClasses, styles.card), variant, children: [
|
|
10924
|
+
(showTitle || showSubtitle) && /* @__PURE__ */ jsxs31(Card_default.Header, { className: styles.header, children: [
|
|
10925
|
+
showTitle && /* @__PURE__ */ jsx75(Card_default.Title, { level: 2, className: styles.title, children: title }),
|
|
10926
|
+
showSubtitle && /* @__PURE__ */ jsx75(Typography_default, { variant: "body1", className: styles.subtitle, children: subtitle })
|
|
10898
10927
|
] }),
|
|
10899
|
-
/* @__PURE__ */
|
|
10900
|
-
externalError && /* @__PURE__ */
|
|
10901
|
-
flowMessages && flowMessages.length > 0 && /* @__PURE__ */
|
|
10928
|
+
/* @__PURE__ */ jsxs31(Card_default.Content, { children: [
|
|
10929
|
+
externalError && /* @__PURE__ */ jsx75("div", { className: styles.flowMessagesContainer, children: /* @__PURE__ */ jsx75(Alert_default, { variant: "error", className: cx22(styles.flowMessageItem, messageClasses), children: /* @__PURE__ */ jsx75(Alert_default.Description, { children: externalError.message }) }) }),
|
|
10930
|
+
flowMessages && flowMessages.length > 0 && /* @__PURE__ */ jsx75("div", { className: styles.flowMessagesContainer, children: flowMessages.map((message, index) => /* @__PURE__ */ jsx75(
|
|
10902
10931
|
Alert_default,
|
|
10903
10932
|
{
|
|
10904
10933
|
variant: message.type?.toLowerCase() === "error" ? "error" : "info",
|
|
10905
10934
|
className: cx22(styles.flowMessageItem, messageClasses),
|
|
10906
|
-
children: /* @__PURE__ */
|
|
10935
|
+
children: /* @__PURE__ */ jsx75(Alert_default.Description, { children: message.message })
|
|
10907
10936
|
},
|
|
10908
10937
|
message.id || index
|
|
10909
10938
|
)) }),
|
|
10910
|
-
/* @__PURE__ */
|
|
10939
|
+
/* @__PURE__ */ jsx75("div", { className: styles.contentContainer, children: componentsWithoutHeadings && componentsWithoutHeadings.length > 0 ? renderComponents(componentsWithoutHeadings) : /* @__PURE__ */ jsx75(Alert_default, { variant: "warning", children: /* @__PURE__ */ jsx75(Typography_default, { variant: "body1", children: t("errors.signup.components.not.available") }) }) })
|
|
10911
10940
|
] })
|
|
10912
10941
|
] });
|
|
10913
10942
|
};
|
|
10914
10943
|
var BaseSignUp2 = ({ preferences, showLogo = true, ...rest }) => {
|
|
10915
10944
|
const { theme, colorScheme } = useTheme_default();
|
|
10916
10945
|
const styles = BaseSignUp_styles_default(theme, colorScheme);
|
|
10917
|
-
const content = /* @__PURE__ */
|
|
10918
|
-
showLogo && /* @__PURE__ */
|
|
10919
|
-
/* @__PURE__ */
|
|
10946
|
+
const content = /* @__PURE__ */ jsxs31("div", { children: [
|
|
10947
|
+
showLogo && /* @__PURE__ */ jsx75("div", { className: styles.logoContainer, children: /* @__PURE__ */ jsx75(Logo_default, { size: "large" }) }),
|
|
10948
|
+
/* @__PURE__ */ jsx75(FlowProvider_default, { children: /* @__PURE__ */ jsx75(BaseSignUpContent2, { showLogo, ...rest }) })
|
|
10920
10949
|
] });
|
|
10921
10950
|
if (!preferences) return content;
|
|
10922
|
-
return /* @__PURE__ */
|
|
10951
|
+
return /* @__PURE__ */ jsx75(ComponentPreferencesContext_default.Provider, { value: preferences, children: content });
|
|
10923
10952
|
};
|
|
10924
10953
|
var BaseSignUp_default2 = BaseSignUp2;
|
|
10925
10954
|
|
|
10926
10955
|
// src/components/presentation/auth/SignUp/BaseSignUp.tsx
|
|
10927
|
-
import { jsx as
|
|
10956
|
+
import { jsx as jsx76 } from "react/jsx-runtime";
|
|
10928
10957
|
var BaseSignUp3 = (props) => {
|
|
10929
10958
|
const { platform } = useAsgardeo_default();
|
|
10930
10959
|
if (platform === Platform6.AsgardeoV2) {
|
|
10931
|
-
return /* @__PURE__ */
|
|
10960
|
+
return /* @__PURE__ */ jsx76(BaseSignUp_default2, { ...props });
|
|
10932
10961
|
}
|
|
10933
|
-
return /* @__PURE__ */
|
|
10962
|
+
return /* @__PURE__ */ jsx76(BaseSignUp_default, { ...props });
|
|
10934
10963
|
};
|
|
10935
10964
|
var BaseSignUp_default3 = BaseSignUp3;
|
|
10936
10965
|
|
|
@@ -10942,7 +10971,7 @@ import {
|
|
|
10942
10971
|
EmbeddedFlowResponseType as EmbeddedFlowResponseType3,
|
|
10943
10972
|
EmbeddedFlowType as EmbeddedFlowType2
|
|
10944
10973
|
} from "@asgardeo/browser";
|
|
10945
|
-
import { jsx as
|
|
10974
|
+
import { jsx as jsx77 } from "react/jsx-runtime";
|
|
10946
10975
|
var SignUp = ({
|
|
10947
10976
|
className,
|
|
10948
10977
|
size = "medium",
|
|
@@ -10971,7 +11000,7 @@ var SignUp = ({
|
|
|
10971
11000
|
window.location.href = response.data.redirectURL;
|
|
10972
11001
|
}
|
|
10973
11002
|
};
|
|
10974
|
-
return /* @__PURE__ */
|
|
11003
|
+
return /* @__PURE__ */ jsx77(
|
|
10975
11004
|
BaseSignUp_default,
|
|
10976
11005
|
{
|
|
10977
11006
|
afterSignUpUrl,
|
|
@@ -10997,7 +11026,7 @@ import {
|
|
|
10997
11026
|
EmbeddedFlowResponseType as EmbeddedFlowResponseType4,
|
|
10998
11027
|
EmbeddedFlowType as EmbeddedFlowType3
|
|
10999
11028
|
} from "@asgardeo/browser";
|
|
11000
|
-
import { jsx as
|
|
11029
|
+
import { jsx as jsx78 } from "react/jsx-runtime";
|
|
11001
11030
|
var SignUp2 = ({
|
|
11002
11031
|
className,
|
|
11003
11032
|
size = "medium",
|
|
@@ -11035,7 +11064,7 @@ var SignUp2 = ({
|
|
|
11035
11064
|
window.location.href = response.data.redirectURL;
|
|
11036
11065
|
}
|
|
11037
11066
|
};
|
|
11038
|
-
return /* @__PURE__ */
|
|
11067
|
+
return /* @__PURE__ */ jsx78(
|
|
11039
11068
|
BaseSignUp_default2,
|
|
11040
11069
|
{
|
|
11041
11070
|
afterSignUpUrl,
|
|
@@ -11057,13 +11086,13 @@ var SignUp2 = ({
|
|
|
11057
11086
|
var SignUp_default2 = SignUp2;
|
|
11058
11087
|
|
|
11059
11088
|
// src/components/presentation/auth/SignUp/SignUp.tsx
|
|
11060
|
-
import { jsx as
|
|
11089
|
+
import { jsx as jsx79 } from "react/jsx-runtime";
|
|
11061
11090
|
var SignUp3 = (props) => {
|
|
11062
11091
|
const { platform } = useAsgardeo_default();
|
|
11063
11092
|
if (platform === Platform7.AsgardeoV2) {
|
|
11064
|
-
return /* @__PURE__ */
|
|
11093
|
+
return /* @__PURE__ */ jsx79(SignUp_default2, { ...props });
|
|
11065
11094
|
}
|
|
11066
|
-
return /* @__PURE__ */
|
|
11095
|
+
return /* @__PURE__ */ jsx79(SignUp_default, { ...props });
|
|
11067
11096
|
};
|
|
11068
11097
|
var SignUp_default3 = SignUp3;
|
|
11069
11098
|
|
|
@@ -11116,7 +11145,7 @@ var useStyles18 = (theme, colorScheme) => useMemo26(() => {
|
|
|
11116
11145
|
var BaseInviteUser_styles_default = useStyles18;
|
|
11117
11146
|
|
|
11118
11147
|
// src/components/presentation/auth/InviteUser/v2/BaseInviteUser.tsx
|
|
11119
|
-
import { jsx as
|
|
11148
|
+
import { jsx as jsx80, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
11120
11149
|
var BaseInviteUser = ({
|
|
11121
11150
|
onInitialize,
|
|
11122
11151
|
onSubmit,
|
|
@@ -11420,28 +11449,28 @@ var BaseInviteUser = ({
|
|
|
11420
11449
|
values: formValues
|
|
11421
11450
|
};
|
|
11422
11451
|
if (children) {
|
|
11423
|
-
return /* @__PURE__ */
|
|
11452
|
+
return /* @__PURE__ */ jsx80("div", { className, children: children(renderProps) });
|
|
11424
11453
|
}
|
|
11425
11454
|
if (!isInitialized) {
|
|
11426
|
-
return /* @__PURE__ */
|
|
11455
|
+
return /* @__PURE__ */ jsx80(Card_default, { className: cx23(className, styles.card), variant, children: /* @__PURE__ */ jsx80(Card_default.Content, { children: /* @__PURE__ */ jsx80("div", { style: { display: "flex", justifyContent: "center", padding: "2rem" }, children: /* @__PURE__ */ jsx80(Spinner_default, { size: "medium" }) }) }) });
|
|
11427
11456
|
}
|
|
11428
11457
|
if (!isFlowInitialized && isLoading) {
|
|
11429
|
-
return /* @__PURE__ */
|
|
11458
|
+
return /* @__PURE__ */ jsx80(Card_default, { className: cx23(className, styles.card), variant, children: /* @__PURE__ */ jsx80(Card_default.Content, { children: /* @__PURE__ */ jsx80("div", { style: { display: "flex", justifyContent: "center", padding: "2rem" }, children: /* @__PURE__ */ jsx80(Spinner_default, { size: "medium" }) }) }) });
|
|
11430
11459
|
}
|
|
11431
11460
|
if (!currentFlow && apiError) {
|
|
11432
|
-
return /* @__PURE__ */
|
|
11433
|
-
/* @__PURE__ */
|
|
11434
|
-
/* @__PURE__ */
|
|
11461
|
+
return /* @__PURE__ */ jsx80(Card_default, { className: cx23(className, styles.card), variant, children: /* @__PURE__ */ jsx80(Card_default.Content, { children: /* @__PURE__ */ jsxs32(Alert_default, { variant: "error", children: [
|
|
11462
|
+
/* @__PURE__ */ jsx80(Alert_default.Title, { children: "Error" }),
|
|
11463
|
+
/* @__PURE__ */ jsx80(Alert_default.Description, { children: apiError.message })
|
|
11435
11464
|
] }) }) });
|
|
11436
11465
|
}
|
|
11437
11466
|
if (isInviteGenerated && inviteLink) {
|
|
11438
|
-
return /* @__PURE__ */
|
|
11439
|
-
/* @__PURE__ */
|
|
11440
|
-
/* @__PURE__ */
|
|
11441
|
-
/* @__PURE__ */
|
|
11442
|
-
/* @__PURE__ */
|
|
11443
|
-
/* @__PURE__ */
|
|
11444
|
-
/* @__PURE__ */
|
|
11467
|
+
return /* @__PURE__ */ jsxs32(Card_default, { className: cx23(className, styles.card), variant, children: [
|
|
11468
|
+
/* @__PURE__ */ jsx80(Card_default.Header, { className: styles.header, children: /* @__PURE__ */ jsx80(Card_default.Title, { level: 2, className: styles.title, children: "Invite Link Generated!" }) }),
|
|
11469
|
+
/* @__PURE__ */ jsxs32(Card_default.Content, { children: [
|
|
11470
|
+
/* @__PURE__ */ jsx80(Alert_default, { variant: "success", children: /* @__PURE__ */ jsx80(Alert_default.Description, { children: "Share this link with the user to complete their registration." }) }),
|
|
11471
|
+
/* @__PURE__ */ jsxs32("div", { style: { marginTop: "1rem" }, children: [
|
|
11472
|
+
/* @__PURE__ */ jsx80(Typography_default, { variant: "body2", style: { marginBottom: "0.5rem" }, children: "Invite Link" }),
|
|
11473
|
+
/* @__PURE__ */ jsxs32(
|
|
11445
11474
|
"div",
|
|
11446
11475
|
{
|
|
11447
11476
|
style: {
|
|
@@ -11454,26 +11483,26 @@ var BaseInviteUser = ({
|
|
|
11454
11483
|
wordBreak: "break-all"
|
|
11455
11484
|
},
|
|
11456
11485
|
children: [
|
|
11457
|
-
/* @__PURE__ */
|
|
11458
|
-
/* @__PURE__ */
|
|
11486
|
+
/* @__PURE__ */ jsx80(Typography_default, { variant: "body2", style: { flex: 1 }, children: inviteLink }),
|
|
11487
|
+
/* @__PURE__ */ jsx80(Button_default, { variant: "outline", size: "small", onClick: copyInviteLink, children: inviteLinkCopied ? "Copied!" : "Copy" })
|
|
11459
11488
|
]
|
|
11460
11489
|
}
|
|
11461
11490
|
)
|
|
11462
11491
|
] }),
|
|
11463
|
-
/* @__PURE__ */
|
|
11492
|
+
/* @__PURE__ */ jsx80("div", { style: { display: "flex", gap: "0.5rem", marginTop: "1.5rem" }, children: /* @__PURE__ */ jsx80(Button_default, { variant: "outline", onClick: resetFlow, children: "Invite Another User" }) })
|
|
11464
11493
|
] })
|
|
11465
11494
|
] });
|
|
11466
11495
|
}
|
|
11467
|
-
return /* @__PURE__ */
|
|
11468
|
-
(showTitle || showSubtitle) && (title || subtitle) && /* @__PURE__ */
|
|
11469
|
-
showTitle && title && /* @__PURE__ */
|
|
11470
|
-
showSubtitle && subtitle && /* @__PURE__ */
|
|
11496
|
+
return /* @__PURE__ */ jsxs32(Card_default, { className: cx23(className, styles.card), variant, children: [
|
|
11497
|
+
(showTitle || showSubtitle) && (title || subtitle) && /* @__PURE__ */ jsxs32(Card_default.Header, { className: styles.header, children: [
|
|
11498
|
+
showTitle && title && /* @__PURE__ */ jsx80(Card_default.Title, { level: 2, className: styles.title, children: title }),
|
|
11499
|
+
showSubtitle && subtitle && /* @__PURE__ */ jsx80(Typography_default, { variant: "body1", className: styles.subtitle, children: subtitle })
|
|
11471
11500
|
] }),
|
|
11472
|
-
/* @__PURE__ */
|
|
11473
|
-
apiError && /* @__PURE__ */
|
|
11474
|
-
/* @__PURE__ */
|
|
11475
|
-
componentsWithoutHeadings && componentsWithoutHeadings.length > 0 ? renderComponents(componentsWithoutHeadings) : !isLoading && /* @__PURE__ */
|
|
11476
|
-
isLoading && /* @__PURE__ */
|
|
11501
|
+
/* @__PURE__ */ jsxs32(Card_default.Content, { children: [
|
|
11502
|
+
apiError && /* @__PURE__ */ jsx80("div", { style: { marginBottom: "1rem" }, children: /* @__PURE__ */ jsx80(Alert_default, { variant: "error", children: /* @__PURE__ */ jsx80(Alert_default.Description, { children: apiError.message }) }) }),
|
|
11503
|
+
/* @__PURE__ */ jsxs32("div", { children: [
|
|
11504
|
+
componentsWithoutHeadings && componentsWithoutHeadings.length > 0 ? renderComponents(componentsWithoutHeadings) : !isLoading && /* @__PURE__ */ jsx80(Alert_default, { variant: "warning", children: /* @__PURE__ */ jsx80(Typography_default, { variant: "body1", children: "No form components available" }) }),
|
|
11505
|
+
isLoading && /* @__PURE__ */ jsx80("div", { style: { display: "flex", justifyContent: "center", padding: "1rem" }, children: /* @__PURE__ */ jsx80(Spinner_default, { size: "small" }) })
|
|
11477
11506
|
] })
|
|
11478
11507
|
] })
|
|
11479
11508
|
] });
|
|
@@ -11481,7 +11510,7 @@ var BaseInviteUser = ({
|
|
|
11481
11510
|
var BaseInviteUser_default = BaseInviteUser;
|
|
11482
11511
|
|
|
11483
11512
|
// src/components/presentation/auth/InviteUser/v2/InviteUser.tsx
|
|
11484
|
-
import { jsx as
|
|
11513
|
+
import { jsx as jsx81 } from "react/jsx-runtime";
|
|
11485
11514
|
var InviteUser = ({
|
|
11486
11515
|
onInviteLinkGenerated,
|
|
11487
11516
|
onError,
|
|
@@ -11525,7 +11554,7 @@ var InviteUser = ({
|
|
|
11525
11554
|
});
|
|
11526
11555
|
return response.data;
|
|
11527
11556
|
};
|
|
11528
|
-
return /* @__PURE__ */
|
|
11557
|
+
return /* @__PURE__ */ jsx81(
|
|
11529
11558
|
BaseInviteUser_default,
|
|
11530
11559
|
{
|
|
11531
11560
|
onInitialize: handleInitialize,
|
|
@@ -11593,7 +11622,7 @@ var useStyles19 = (theme, colorScheme) => useMemo27(() => {
|
|
|
11593
11622
|
var BaseAcceptInvite_styles_default = useStyles19;
|
|
11594
11623
|
|
|
11595
11624
|
// src/components/presentation/auth/AcceptInvite/v2/BaseAcceptInvite.tsx
|
|
11596
|
-
import { jsx as
|
|
11625
|
+
import { jsx as jsx82, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
11597
11626
|
var BaseAcceptInvite = ({
|
|
11598
11627
|
flowId,
|
|
11599
11628
|
inviteToken,
|
|
@@ -11922,50 +11951,50 @@ var BaseAcceptInvite = ({
|
|
|
11922
11951
|
values: formValues
|
|
11923
11952
|
};
|
|
11924
11953
|
if (children) {
|
|
11925
|
-
return /* @__PURE__ */
|
|
11954
|
+
return /* @__PURE__ */ jsx82("div", { className, children: children(renderProps) });
|
|
11926
11955
|
}
|
|
11927
11956
|
if (isValidatingToken) {
|
|
11928
|
-
return /* @__PURE__ */
|
|
11929
|
-
/* @__PURE__ */
|
|
11930
|
-
/* @__PURE__ */
|
|
11957
|
+
return /* @__PURE__ */ jsx82(Card_default, { className: cx24(className, styles.card), variant, children: /* @__PURE__ */ jsx82(Card_default.Content, { children: /* @__PURE__ */ jsxs33("div", { style: { alignItems: "center", display: "flex", flexDirection: "column", gap: "1rem", padding: "2rem" }, children: [
|
|
11958
|
+
/* @__PURE__ */ jsx82(Spinner_default, { size: "medium" }),
|
|
11959
|
+
/* @__PURE__ */ jsx82(Typography_default, { variant: "body1", children: "Validating your invite link..." })
|
|
11931
11960
|
] }) }) });
|
|
11932
11961
|
}
|
|
11933
11962
|
if (isTokenInvalid) {
|
|
11934
|
-
return /* @__PURE__ */
|
|
11935
|
-
/* @__PURE__ */
|
|
11936
|
-
/* @__PURE__ */
|
|
11937
|
-
/* @__PURE__ */
|
|
11938
|
-
/* @__PURE__ */
|
|
11939
|
-
/* @__PURE__ */
|
|
11963
|
+
return /* @__PURE__ */ jsxs33(Card_default, { className: cx24(className, styles.card), variant, children: [
|
|
11964
|
+
/* @__PURE__ */ jsx82(Card_default.Header, { className: styles.header, children: /* @__PURE__ */ jsx82(Card_default.Title, { level: 2, className: styles.title, children: "Invalid Invite Link" }) }),
|
|
11965
|
+
/* @__PURE__ */ jsxs33(Card_default.Content, { children: [
|
|
11966
|
+
/* @__PURE__ */ jsxs33(Alert_default, { variant: "error", children: [
|
|
11967
|
+
/* @__PURE__ */ jsx82(Alert_default.Title, { children: "Unable to verify invite" }),
|
|
11968
|
+
/* @__PURE__ */ jsx82(Alert_default.Description, { children: apiError?.message || "This invite link is invalid or has expired. Please contact your administrator for a new invite." })
|
|
11940
11969
|
] }),
|
|
11941
|
-
onGoToSignIn && /* @__PURE__ */
|
|
11970
|
+
onGoToSignIn && /* @__PURE__ */ jsx82("div", { style: { display: "flex", justifyContent: "center", marginTop: "1.5rem" }, children: /* @__PURE__ */ jsx82(Button_default, { variant: "outline", onClick: onGoToSignIn, children: "Go to Sign In" }) })
|
|
11942
11971
|
] })
|
|
11943
11972
|
] });
|
|
11944
11973
|
}
|
|
11945
11974
|
if (isComplete) {
|
|
11946
|
-
return /* @__PURE__ */
|
|
11947
|
-
/* @__PURE__ */
|
|
11948
|
-
/* @__PURE__ */
|
|
11949
|
-
/* @__PURE__ */
|
|
11950
|
-
onGoToSignIn && /* @__PURE__ */
|
|
11975
|
+
return /* @__PURE__ */ jsxs33(Card_default, { className: cx24(className, styles.card), variant, children: [
|
|
11976
|
+
/* @__PURE__ */ jsx82(Card_default.Header, { className: styles.header, children: /* @__PURE__ */ jsx82(Card_default.Title, { level: 2, className: styles.title, children: "Account Setup Complete!" }) }),
|
|
11977
|
+
/* @__PURE__ */ jsxs33(Card_default.Content, { children: [
|
|
11978
|
+
/* @__PURE__ */ jsx82(Alert_default, { variant: "success", children: /* @__PURE__ */ jsx82(Alert_default.Description, { children: "Your account has been successfully set up. You can now sign in with your credentials." }) }),
|
|
11979
|
+
onGoToSignIn && /* @__PURE__ */ jsx82("div", { style: { display: "flex", justifyContent: "center", marginTop: "1.5rem" }, children: /* @__PURE__ */ jsx82(Button_default, { variant: "solid", color: "primary", onClick: onGoToSignIn, children: "Sign In" }) })
|
|
11951
11980
|
] })
|
|
11952
11981
|
] });
|
|
11953
11982
|
}
|
|
11954
|
-
return /* @__PURE__ */
|
|
11955
|
-
(showTitle || showSubtitle) && (title || subtitle) && /* @__PURE__ */
|
|
11956
|
-
showTitle && title && /* @__PURE__ */
|
|
11957
|
-
showSubtitle && subtitle && /* @__PURE__ */
|
|
11983
|
+
return /* @__PURE__ */ jsxs33(Card_default, { className: cx24(className, styles.card), variant, children: [
|
|
11984
|
+
(showTitle || showSubtitle) && (title || subtitle) && /* @__PURE__ */ jsxs33(Card_default.Header, { className: styles.header, children: [
|
|
11985
|
+
showTitle && title && /* @__PURE__ */ jsx82(Card_default.Title, { level: 2, className: styles.title, children: title }),
|
|
11986
|
+
showSubtitle && subtitle && /* @__PURE__ */ jsx82(Typography_default, { variant: "body1", className: styles.subtitle, children: subtitle })
|
|
11958
11987
|
] }),
|
|
11959
|
-
/* @__PURE__ */
|
|
11960
|
-
apiError && /* @__PURE__ */
|
|
11961
|
-
/* @__PURE__ */
|
|
11962
|
-
componentsWithoutHeadings && componentsWithoutHeadings.length > 0 ? renderComponents(componentsWithoutHeadings) : !isLoading && /* @__PURE__ */
|
|
11963
|
-
isLoading && /* @__PURE__ */
|
|
11988
|
+
/* @__PURE__ */ jsxs33(Card_default.Content, { children: [
|
|
11989
|
+
apiError && /* @__PURE__ */ jsx82("div", { style: { marginBottom: "1rem" }, children: /* @__PURE__ */ jsx82(Alert_default, { variant: "error", children: /* @__PURE__ */ jsx82(Alert_default.Description, { children: apiError.message }) }) }),
|
|
11990
|
+
/* @__PURE__ */ jsxs33("div", { children: [
|
|
11991
|
+
componentsWithoutHeadings && componentsWithoutHeadings.length > 0 ? renderComponents(componentsWithoutHeadings) : !isLoading && /* @__PURE__ */ jsx82(Alert_default, { variant: "warning", children: /* @__PURE__ */ jsx82(Typography_default, { variant: "body1", children: "No form components available" }) }),
|
|
11992
|
+
isLoading && /* @__PURE__ */ jsx82("div", { style: { display: "flex", justifyContent: "center", padding: "1rem" }, children: /* @__PURE__ */ jsx82(Spinner_default, { size: "small" }) })
|
|
11964
11993
|
] }),
|
|
11965
|
-
onGoToSignIn && /* @__PURE__ */
|
|
11994
|
+
onGoToSignIn && /* @__PURE__ */ jsx82("div", { style: { marginTop: "1.5rem", textAlign: "center" }, children: /* @__PURE__ */ jsxs33(Typography_default, { variant: "body2", children: [
|
|
11966
11995
|
"Already have an account?",
|
|
11967
11996
|
" ",
|
|
11968
|
-
/* @__PURE__ */
|
|
11997
|
+
/* @__PURE__ */ jsx82(Button_default, { variant: "text", onClick: onGoToSignIn, style: { minWidth: "auto", padding: 0 }, children: "Sign In" })
|
|
11969
11998
|
] }) })
|
|
11970
11999
|
] })
|
|
11971
12000
|
] });
|
|
@@ -11973,7 +12002,7 @@ var BaseAcceptInvite = ({
|
|
|
11973
12002
|
var BaseAcceptInvite_default = BaseAcceptInvite;
|
|
11974
12003
|
|
|
11975
12004
|
// src/components/presentation/auth/AcceptInvite/v2/AcceptInvite.tsx
|
|
11976
|
-
import { jsx as
|
|
12005
|
+
import { jsx as jsx83 } from "react/jsx-runtime";
|
|
11977
12006
|
var getUrlParams = () => {
|
|
11978
12007
|
if (typeof window === "undefined") {
|
|
11979
12008
|
return {};
|
|
@@ -12029,7 +12058,7 @@ var AcceptInvite = ({
|
|
|
12029
12058
|
}
|
|
12030
12059
|
return response.json();
|
|
12031
12060
|
};
|
|
12032
|
-
return /* @__PURE__ */
|
|
12061
|
+
return /* @__PURE__ */ jsx83(
|
|
12033
12062
|
BaseAcceptInvite_default,
|
|
12034
12063
|
{
|
|
12035
12064
|
flowId,
|
|
@@ -12140,45 +12169,45 @@ var Callback = ({ onNavigate, onError }) => {
|
|
|
12140
12169
|
};
|
|
12141
12170
|
|
|
12142
12171
|
// src/components/presentation/User/BaseUser.tsx
|
|
12143
|
-
import { Fragment as Fragment14, jsx as
|
|
12172
|
+
import { Fragment as Fragment14, jsx as jsx84 } from "react/jsx-runtime";
|
|
12144
12173
|
var BaseUser = ({ user, children, fallback = null }) => {
|
|
12145
12174
|
if (!user) {
|
|
12146
|
-
return /* @__PURE__ */
|
|
12175
|
+
return /* @__PURE__ */ jsx84(Fragment14, { children: fallback });
|
|
12147
12176
|
}
|
|
12148
|
-
return /* @__PURE__ */
|
|
12177
|
+
return /* @__PURE__ */ jsx84(Fragment14, { children: children(user) });
|
|
12149
12178
|
};
|
|
12150
12179
|
BaseUser.displayName = "BaseUser";
|
|
12151
12180
|
var BaseUser_default = BaseUser;
|
|
12152
12181
|
|
|
12153
12182
|
// src/components/presentation/User/User.tsx
|
|
12154
|
-
import { jsx as
|
|
12183
|
+
import { jsx as jsx85 } from "react/jsx-runtime";
|
|
12155
12184
|
var User5 = ({ children, fallback = null }) => {
|
|
12156
12185
|
const { user } = useAsgardeo_default();
|
|
12157
|
-
return /* @__PURE__ */
|
|
12186
|
+
return /* @__PURE__ */ jsx85(BaseUser_default, { user, fallback, children });
|
|
12158
12187
|
};
|
|
12159
12188
|
User5.displayName = "User";
|
|
12160
12189
|
var User_default = User5;
|
|
12161
12190
|
|
|
12162
12191
|
// src/components/presentation/Organization/BaseOrganization.tsx
|
|
12163
|
-
import { Fragment as Fragment15, jsx as
|
|
12192
|
+
import { Fragment as Fragment15, jsx as jsx86 } from "react/jsx-runtime";
|
|
12164
12193
|
var BaseOrganization = ({
|
|
12165
12194
|
children,
|
|
12166
12195
|
fallback = null,
|
|
12167
12196
|
organization
|
|
12168
12197
|
}) => {
|
|
12169
12198
|
if (!organization) {
|
|
12170
|
-
return /* @__PURE__ */
|
|
12199
|
+
return /* @__PURE__ */ jsx86(Fragment15, { children: fallback });
|
|
12171
12200
|
}
|
|
12172
|
-
return /* @__PURE__ */
|
|
12201
|
+
return /* @__PURE__ */ jsx86(Fragment15, { children: children(organization) });
|
|
12173
12202
|
};
|
|
12174
12203
|
BaseOrganization.displayName = "BaseOrganization";
|
|
12175
12204
|
var BaseOrganization_default = BaseOrganization;
|
|
12176
12205
|
|
|
12177
12206
|
// src/components/presentation/Organization/Organization.tsx
|
|
12178
|
-
import { jsx as
|
|
12207
|
+
import { jsx as jsx87 } from "react/jsx-runtime";
|
|
12179
12208
|
var Organization5 = ({ children, fallback = null }) => {
|
|
12180
12209
|
const { currentOrganization } = useOrganization_default();
|
|
12181
|
-
return /* @__PURE__ */
|
|
12210
|
+
return /* @__PURE__ */ jsx87(BaseOrganization_default, { organization: currentOrganization, fallback, children });
|
|
12182
12211
|
};
|
|
12183
12212
|
Organization5.displayName = "Organization";
|
|
12184
12213
|
var Organization_default = Organization5;
|
|
@@ -12517,7 +12546,7 @@ var useStyles21 = (theme, colorScheme, size, variant, backgroundColor) => useMem
|
|
|
12517
12546
|
var Avatar_styles_default = useStyles21;
|
|
12518
12547
|
|
|
12519
12548
|
// src/components/primitives/Avatar/Avatar.tsx
|
|
12520
|
-
import { jsx as
|
|
12549
|
+
import { jsx as jsx88 } from "react/jsx-runtime";
|
|
12521
12550
|
var Avatar = ({
|
|
12522
12551
|
alt = "User avatar",
|
|
12523
12552
|
background = "random",
|
|
@@ -12564,7 +12593,7 @@ var Avatar = ({
|
|
|
12564
12593
|
const getInitials = (fullName) => fullName.split(" ").map((part) => part[0]).slice(0, 2).join("").toUpperCase();
|
|
12565
12594
|
const renderContent = () => {
|
|
12566
12595
|
if (imageUrl) {
|
|
12567
|
-
return /* @__PURE__ */
|
|
12596
|
+
return /* @__PURE__ */ jsx88(
|
|
12568
12597
|
"img",
|
|
12569
12598
|
{
|
|
12570
12599
|
src: imageUrl,
|
|
@@ -12577,19 +12606,19 @@ var Avatar = ({
|
|
|
12577
12606
|
return getInitials(name);
|
|
12578
12607
|
}
|
|
12579
12608
|
if (isLoading) {
|
|
12580
|
-
return /* @__PURE__ */
|
|
12609
|
+
return /* @__PURE__ */ jsx88("div", { className: cx25(withVendorCSSClassPrefix24(bem16("avatar", "skeleton")), styles["skeleton"]) });
|
|
12581
12610
|
}
|
|
12582
|
-
return /* @__PURE__ */
|
|
12611
|
+
return /* @__PURE__ */ jsx88(
|
|
12583
12612
|
"svg",
|
|
12584
12613
|
{
|
|
12585
12614
|
xmlns: "http://www.w3.org/2000/svg",
|
|
12586
12615
|
viewBox: "0 0 640 640",
|
|
12587
12616
|
className: cx25(withVendorCSSClassPrefix24(bem16("avatar", "icon")), styles["icon"]),
|
|
12588
|
-
children: /* @__PURE__ */
|
|
12617
|
+
children: /* @__PURE__ */ jsx88("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" })
|
|
12589
12618
|
}
|
|
12590
12619
|
);
|
|
12591
12620
|
};
|
|
12592
|
-
return /* @__PURE__ */
|
|
12621
|
+
return /* @__PURE__ */ jsx88(
|
|
12593
12622
|
"div",
|
|
12594
12623
|
{
|
|
12595
12624
|
className: cx25(
|
|
@@ -12696,8 +12725,8 @@ var useStyles22 = (theme, colorScheme) => useMemo32(() => {
|
|
|
12696
12725
|
var Dialog_styles_default = useStyles22;
|
|
12697
12726
|
|
|
12698
12727
|
// src/components/primitives/Icons/LogOut.tsx
|
|
12699
|
-
import { jsx as
|
|
12700
|
-
var LogOut = (props) => /* @__PURE__ */
|
|
12728
|
+
import { jsx as jsx89, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
12729
|
+
var LogOut = (props) => /* @__PURE__ */ jsxs34(
|
|
12701
12730
|
"svg",
|
|
12702
12731
|
{
|
|
12703
12732
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -12711,17 +12740,17 @@ var LogOut = (props) => /* @__PURE__ */ jsxs33(
|
|
|
12711
12740
|
strokeLinejoin: "round",
|
|
12712
12741
|
...props,
|
|
12713
12742
|
children: [
|
|
12714
|
-
/* @__PURE__ */
|
|
12715
|
-
/* @__PURE__ */
|
|
12716
|
-
/* @__PURE__ */
|
|
12743
|
+
/* @__PURE__ */ jsx89("path", { d: "m16 17 5-5-5-5" }),
|
|
12744
|
+
/* @__PURE__ */ jsx89("path", { d: "M21 12H9" }),
|
|
12745
|
+
/* @__PURE__ */ jsx89("path", { d: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" })
|
|
12717
12746
|
]
|
|
12718
12747
|
}
|
|
12719
12748
|
);
|
|
12720
12749
|
var LogOut_default = LogOut;
|
|
12721
12750
|
|
|
12722
12751
|
// src/components/primitives/Icons/Plus.tsx
|
|
12723
|
-
import { jsx as
|
|
12724
|
-
var Plus = (props) => /* @__PURE__ */
|
|
12752
|
+
import { jsx as jsx90, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
12753
|
+
var Plus = (props) => /* @__PURE__ */ jsxs35(
|
|
12725
12754
|
"svg",
|
|
12726
12755
|
{
|
|
12727
12756
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -12735,16 +12764,16 @@ var Plus = (props) => /* @__PURE__ */ jsxs34(
|
|
|
12735
12764
|
strokeLinejoin: "round",
|
|
12736
12765
|
...props,
|
|
12737
12766
|
children: [
|
|
12738
|
-
/* @__PURE__ */
|
|
12739
|
-
/* @__PURE__ */
|
|
12767
|
+
/* @__PURE__ */ jsx90("path", { d: "M5 12h14" }),
|
|
12768
|
+
/* @__PURE__ */ jsx90("path", { d: "M12 5v14" })
|
|
12740
12769
|
]
|
|
12741
12770
|
}
|
|
12742
12771
|
);
|
|
12743
12772
|
var Plus_default = Plus;
|
|
12744
12773
|
|
|
12745
12774
|
// src/components/primitives/Icons/User.tsx
|
|
12746
|
-
import { jsx as
|
|
12747
|
-
var User7 = (props) => /* @__PURE__ */
|
|
12775
|
+
import { jsx as jsx91, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
12776
|
+
var User7 = (props) => /* @__PURE__ */ jsxs36(
|
|
12748
12777
|
"svg",
|
|
12749
12778
|
{
|
|
12750
12779
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -12758,16 +12787,16 @@ var User7 = (props) => /* @__PURE__ */ jsxs35(
|
|
|
12758
12787
|
strokeLinejoin: "round",
|
|
12759
12788
|
...props,
|
|
12760
12789
|
children: [
|
|
12761
|
-
/* @__PURE__ */
|
|
12762
|
-
/* @__PURE__ */
|
|
12790
|
+
/* @__PURE__ */ jsx91("path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" }),
|
|
12791
|
+
/* @__PURE__ */ jsx91("circle", { cx: "12", cy: "7", r: "4" })
|
|
12763
12792
|
]
|
|
12764
12793
|
}
|
|
12765
12794
|
);
|
|
12766
12795
|
var User_default2 = User7;
|
|
12767
12796
|
|
|
12768
12797
|
// src/components/primitives/Icons/X.tsx
|
|
12769
|
-
import { jsx as
|
|
12770
|
-
var X = (props) => /* @__PURE__ */
|
|
12798
|
+
import { jsx as jsx92, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
12799
|
+
var X = (props) => /* @__PURE__ */ jsxs37(
|
|
12771
12800
|
"svg",
|
|
12772
12801
|
{
|
|
12773
12802
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -12781,15 +12810,15 @@ var X = (props) => /* @__PURE__ */ jsxs36(
|
|
|
12781
12810
|
strokeLinejoin: "round",
|
|
12782
12811
|
...props,
|
|
12783
12812
|
children: [
|
|
12784
|
-
/* @__PURE__ */
|
|
12785
|
-
/* @__PURE__ */
|
|
12813
|
+
/* @__PURE__ */ jsx92("path", { d: "M18 6 6 18" }),
|
|
12814
|
+
/* @__PURE__ */ jsx92("path", { d: "m6 6 12 12" })
|
|
12786
12815
|
]
|
|
12787
12816
|
}
|
|
12788
12817
|
);
|
|
12789
12818
|
var X_default = X;
|
|
12790
12819
|
|
|
12791
12820
|
// src/components/primitives/Dialog/Dialog.tsx
|
|
12792
|
-
import { jsx as
|
|
12821
|
+
import { jsx as jsx93, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
12793
12822
|
function useDialog({
|
|
12794
12823
|
initialOpen = false,
|
|
12795
12824
|
open: controlledOpen,
|
|
@@ -12835,7 +12864,7 @@ var useDialogContext = () => {
|
|
|
12835
12864
|
};
|
|
12836
12865
|
function Dialog({ children, ...options }) {
|
|
12837
12866
|
const dialog = useDialog(options);
|
|
12838
|
-
return /* @__PURE__ */
|
|
12867
|
+
return /* @__PURE__ */ jsx93(DialogContext.Provider, { value: dialog, children });
|
|
12839
12868
|
}
|
|
12840
12869
|
var DialogTrigger = forwardRef10(
|
|
12841
12870
|
({ children, asChild = false, ...props }, propRef) => {
|
|
@@ -12853,7 +12882,7 @@ var DialogTrigger = forwardRef10(
|
|
|
12853
12882
|
})
|
|
12854
12883
|
);
|
|
12855
12884
|
}
|
|
12856
|
-
return /* @__PURE__ */
|
|
12885
|
+
return /* @__PURE__ */ jsx93("button", { ref, "data-state": context.open ? "open" : "closed", ...context.getReferenceProps(props), children });
|
|
12857
12886
|
}
|
|
12858
12887
|
);
|
|
12859
12888
|
var DialogContent = forwardRef10(
|
|
@@ -12863,12 +12892,12 @@ var DialogContent = forwardRef10(
|
|
|
12863
12892
|
const styles = Dialog_styles_default(theme, colorScheme);
|
|
12864
12893
|
const ref = useMergeRefs([context.refs.setFloating, propRef]);
|
|
12865
12894
|
if (!floatingContext.open) return null;
|
|
12866
|
-
return /* @__PURE__ */
|
|
12895
|
+
return /* @__PURE__ */ jsx93(FloatingPortal, { children: /* @__PURE__ */ jsx93(
|
|
12867
12896
|
FloatingOverlay,
|
|
12868
12897
|
{
|
|
12869
12898
|
className: cx26(withVendorCSSClassPrefix25(bem17("dialog", "overlay")), styles["overlay"]),
|
|
12870
12899
|
lockScroll: true,
|
|
12871
|
-
children: /* @__PURE__ */
|
|
12900
|
+
children: /* @__PURE__ */ jsx93(FloatingFocusManager, { context: floatingContext, initialFocus: -1, children: /* @__PURE__ */ jsx93(
|
|
12872
12901
|
"div",
|
|
12873
12902
|
{
|
|
12874
12903
|
ref,
|
|
@@ -12895,8 +12924,8 @@ var DialogHeading = forwardRef10(
|
|
|
12895
12924
|
context.setLabelId(void 0);
|
|
12896
12925
|
};
|
|
12897
12926
|
}, [id, context.setLabelId]);
|
|
12898
|
-
return /* @__PURE__ */
|
|
12899
|
-
/* @__PURE__ */
|
|
12927
|
+
return /* @__PURE__ */ jsxs38("div", { className: cx26(withVendorCSSClassPrefix25(bem17("dialog", "header")), styles["header"]), children: [
|
|
12928
|
+
/* @__PURE__ */ jsx93(
|
|
12900
12929
|
"h2",
|
|
12901
12930
|
{
|
|
12902
12931
|
...props,
|
|
@@ -12906,7 +12935,7 @@ var DialogHeading = forwardRef10(
|
|
|
12906
12935
|
children
|
|
12907
12936
|
}
|
|
12908
12937
|
),
|
|
12909
|
-
/* @__PURE__ */
|
|
12938
|
+
/* @__PURE__ */ jsx93(
|
|
12910
12939
|
Button_default,
|
|
12911
12940
|
{
|
|
12912
12941
|
color: "tertiary",
|
|
@@ -12917,7 +12946,7 @@ var DialogHeading = forwardRef10(
|
|
|
12917
12946
|
context.setOpen(false);
|
|
12918
12947
|
},
|
|
12919
12948
|
"aria-label": "Close",
|
|
12920
|
-
children: /* @__PURE__ */
|
|
12949
|
+
children: /* @__PURE__ */ jsx93(X_default, { width: 16, height: 16 })
|
|
12921
12950
|
}
|
|
12922
12951
|
)
|
|
12923
12952
|
] });
|
|
@@ -12935,7 +12964,7 @@ var DialogDescription = forwardRef10(
|
|
|
12935
12964
|
context.setDescriptionId(void 0);
|
|
12936
12965
|
};
|
|
12937
12966
|
}, [id, context.setDescriptionId]);
|
|
12938
|
-
return /* @__PURE__ */
|
|
12967
|
+
return /* @__PURE__ */ jsx93(
|
|
12939
12968
|
"p",
|
|
12940
12969
|
{
|
|
12941
12970
|
...props,
|
|
@@ -12964,7 +12993,7 @@ var DialogClose = forwardRef10(
|
|
|
12964
12993
|
onClick: handleClick
|
|
12965
12994
|
});
|
|
12966
12995
|
}
|
|
12967
|
-
return /* @__PURE__ */
|
|
12996
|
+
return /* @__PURE__ */ jsx93(
|
|
12968
12997
|
Button_default,
|
|
12969
12998
|
{
|
|
12970
12999
|
...props,
|
|
@@ -13087,7 +13116,7 @@ var useStyles23 = (theme, colorScheme, disabled, hasError, canAddMore, canRemove
|
|
|
13087
13116
|
var MultiInput_styles_default = useStyles23;
|
|
13088
13117
|
|
|
13089
13118
|
// src/components/primitives/MultiInput/MultiInput.tsx
|
|
13090
|
-
import { jsx as
|
|
13119
|
+
import { jsx as jsx94, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
13091
13120
|
var MultiInput = ({
|
|
13092
13121
|
label,
|
|
13093
13122
|
error,
|
|
@@ -13110,8 +13139,8 @@ var MultiInput = ({
|
|
|
13110
13139
|
const canAddMore = !maxFields || values.length < maxFields;
|
|
13111
13140
|
const canRemove = values.length > minFields;
|
|
13112
13141
|
const styles = MultiInput_styles_default(theme, colorScheme, !!disabled, !!error, canAddMore, canRemove);
|
|
13113
|
-
const PlusIcon = ({ iconClassName }) => /* @__PURE__ */
|
|
13114
|
-
const BinIcon = ({ iconClassName }) => /* @__PURE__ */
|
|
13142
|
+
const PlusIcon = ({ iconClassName }) => /* @__PURE__ */ jsx94("svg", { width: "16", height: "16", viewBox: "0 0 24 24", className: cx27(styles["icon"], iconClassName), children: /* @__PURE__ */ jsx94("path", { d: "M12 5v14M5 12h14" }) });
|
|
13143
|
+
const BinIcon = ({ iconClassName }) => /* @__PURE__ */ jsx94("svg", { width: "16", height: "16", viewBox: "0 0 24 24", className: cx27(styles["icon"], iconClassName), children: /* @__PURE__ */ jsx94("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" }) });
|
|
13115
13144
|
const handleAddValue = useCallback16(
|
|
13116
13145
|
(newValue) => {
|
|
13117
13146
|
if (newValue.trim() !== "" && (!maxFields || values.length < maxFields)) {
|
|
@@ -13155,9 +13184,9 @@ var MultiInput = ({
|
|
|
13155
13184
|
};
|
|
13156
13185
|
switch (fieldType) {
|
|
13157
13186
|
case "DATE_TIME":
|
|
13158
|
-
return /* @__PURE__ */
|
|
13187
|
+
return /* @__PURE__ */ jsx94(DatePicker_default, { ...commonProps });
|
|
13159
13188
|
case "BOOLEAN":
|
|
13160
|
-
return /* @__PURE__ */
|
|
13189
|
+
return /* @__PURE__ */ jsx94(
|
|
13161
13190
|
Checkbox_default,
|
|
13162
13191
|
{
|
|
13163
13192
|
...commonProps,
|
|
@@ -13166,7 +13195,7 @@ var MultiInput = ({
|
|
|
13166
13195
|
}
|
|
13167
13196
|
);
|
|
13168
13197
|
default:
|
|
13169
|
-
return /* @__PURE__ */
|
|
13198
|
+
return /* @__PURE__ */ jsx94(TextField_default, { ...commonProps, type });
|
|
13170
13199
|
}
|
|
13171
13200
|
},
|
|
13172
13201
|
[placeholder, disabled, startIcon, endIcon, error, fieldType, type]
|
|
@@ -13178,7 +13207,7 @@ var MultiInput = ({
|
|
|
13178
13207
|
setCurrentInputValue("");
|
|
13179
13208
|
}
|
|
13180
13209
|
}, [currentInputValue, handleAddValue]);
|
|
13181
|
-
return /* @__PURE__ */
|
|
13210
|
+
return /* @__PURE__ */ jsxs39(
|
|
13182
13211
|
FormControl_default,
|
|
13183
13212
|
{
|
|
13184
13213
|
error,
|
|
@@ -13186,27 +13215,27 @@ var MultiInput = ({
|
|
|
13186
13215
|
className: cx27(withVendorCSSClassPrefix26(bem18("multi-input")), className),
|
|
13187
13216
|
style,
|
|
13188
13217
|
children: [
|
|
13189
|
-
label && /* @__PURE__ */
|
|
13190
|
-
/* @__PURE__ */
|
|
13191
|
-
/* @__PURE__ */
|
|
13218
|
+
label && /* @__PURE__ */ jsx94(InputLabel_default, { required, error: !!error, children: label }),
|
|
13219
|
+
/* @__PURE__ */ jsxs39("div", { className: cx27(withVendorCSSClassPrefix26(bem18("multi-input", "container")), styles["container"]), children: [
|
|
13220
|
+
/* @__PURE__ */ jsx94("div", { className: cx27(withVendorCSSClassPrefix26(bem18("multi-input", "input-row")), styles["inputRow"]), children: /* @__PURE__ */ jsx94("div", { className: cx27(withVendorCSSClassPrefix26(bem18("multi-input", "input-wrapper")), styles["inputWrapper"]), children: renderInputField(
|
|
13192
13221
|
currentInputValue,
|
|
13193
13222
|
setCurrentInputValue,
|
|
13194
|
-
canAddMore ? /* @__PURE__ */
|
|
13223
|
+
canAddMore ? /* @__PURE__ */ jsx94(PlusIcon, { iconClassName: styles["plusIcon"] }) : void 0,
|
|
13195
13224
|
canAddMore ? handleInputSubmit : void 0
|
|
13196
13225
|
) }) }),
|
|
13197
|
-
values.length > 0 && /* @__PURE__ */
|
|
13226
|
+
values.length > 0 && /* @__PURE__ */ jsx94("div", { className: cx27(withVendorCSSClassPrefix26(bem18("multi-input", "list-container")), styles["listContainer"]), children: values.map((value, index) => /* @__PURE__ */ jsxs39(
|
|
13198
13227
|
"div",
|
|
13199
13228
|
{
|
|
13200
13229
|
className: cx27(withVendorCSSClassPrefix26(bem18("multi-input", "list-item")), styles["listItem"]),
|
|
13201
13230
|
children: [
|
|
13202
|
-
/* @__PURE__ */
|
|
13231
|
+
/* @__PURE__ */ jsx94(
|
|
13203
13232
|
"span",
|
|
13204
13233
|
{
|
|
13205
13234
|
className: cx27(withVendorCSSClassPrefix26(bem18("multi-input", "list-item-text")), styles["listItemText"]),
|
|
13206
13235
|
children: value
|
|
13207
13236
|
}
|
|
13208
13237
|
),
|
|
13209
|
-
canRemove && /* @__PURE__ */
|
|
13238
|
+
canRemove && /* @__PURE__ */ jsx94(
|
|
13210
13239
|
"button",
|
|
13211
13240
|
{
|
|
13212
13241
|
type: "button",
|
|
@@ -13217,7 +13246,7 @@ var MultiInput = ({
|
|
|
13217
13246
|
styles["removeButton"]
|
|
13218
13247
|
),
|
|
13219
13248
|
title: "Remove value",
|
|
13220
|
-
children: /* @__PURE__ */
|
|
13249
|
+
children: /* @__PURE__ */ jsx94(BinIcon, { iconClassName: styles["icon"] })
|
|
13221
13250
|
}
|
|
13222
13251
|
)
|
|
13223
13252
|
]
|
|
@@ -13232,7 +13261,7 @@ var MultiInput = ({
|
|
|
13232
13261
|
var MultiInput_default = MultiInput;
|
|
13233
13262
|
|
|
13234
13263
|
// src/components/presentation/UserProfile/BaseUserProfile.tsx
|
|
13235
|
-
import { Fragment as Fragment16, jsx as
|
|
13264
|
+
import { Fragment as Fragment16, jsx as jsx95, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
13236
13265
|
var fieldsToSkip = [
|
|
13237
13266
|
"roles.default",
|
|
13238
13267
|
"active",
|
|
@@ -13294,7 +13323,7 @@ var BaseUserProfile = ({
|
|
|
13294
13323
|
},
|
|
13295
13324
|
[showFields, hideFields]
|
|
13296
13325
|
);
|
|
13297
|
-
const PencilIcon = () => /* @__PURE__ */
|
|
13326
|
+
const PencilIcon = () => /* @__PURE__ */ jsx95(
|
|
13298
13327
|
"svg",
|
|
13299
13328
|
{
|
|
13300
13329
|
width: "16",
|
|
@@ -13305,7 +13334,7 @@ var BaseUserProfile = ({
|
|
|
13305
13334
|
strokeWidth: "2",
|
|
13306
13335
|
strokeLinecap: "round",
|
|
13307
13336
|
strokeLinejoin: "round",
|
|
13308
|
-
children: /* @__PURE__ */
|
|
13337
|
+
children: /* @__PURE__ */ jsx95("path", { d: "M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z" })
|
|
13309
13338
|
}
|
|
13310
13339
|
);
|
|
13311
13340
|
const toggleFieldEdit = useCallback17((fieldName) => {
|
|
@@ -13335,12 +13364,12 @@ var BaseUserProfile = ({
|
|
|
13335
13364
|
const styles = BaseUserProfile_styles_default(theme, colorScheme);
|
|
13336
13365
|
const ObjectDisplay = ({ data }) => {
|
|
13337
13366
|
if (!data || typeof data !== "object") return null;
|
|
13338
|
-
return /* @__PURE__ */
|
|
13339
|
-
/* @__PURE__ */
|
|
13367
|
+
return /* @__PURE__ */ jsx95("table", { className: styles.value, children: /* @__PURE__ */ jsx95("tbody", { children: Object.entries(data).map(([key, value]) => /* @__PURE__ */ jsxs40("tr", { children: [
|
|
13368
|
+
/* @__PURE__ */ jsx95("td", { className: styles.objectKey, children: /* @__PURE__ */ jsxs40("strong", { children: [
|
|
13340
13369
|
formatLabel(key),
|
|
13341
13370
|
":"
|
|
13342
13371
|
] }) }),
|
|
13343
|
-
/* @__PURE__ */
|
|
13372
|
+
/* @__PURE__ */ jsx95("td", { className: styles.objectValue, children: typeof value === "object" ? /* @__PURE__ */ jsx95(ObjectDisplay, { data: value }) : String(value) })
|
|
13344
13373
|
] }, key)) }) });
|
|
13345
13374
|
};
|
|
13346
13375
|
function set(obj, path, value) {
|
|
@@ -13415,7 +13444,7 @@ var BaseUserProfile = ({
|
|
|
13415
13444
|
const { value, displayName, description, name, type, required, mutability, subAttributes, multiValued } = schema;
|
|
13416
13445
|
const label = displayName || description || name || "";
|
|
13417
13446
|
if (subAttributes && Array.isArray(subAttributes)) {
|
|
13418
|
-
return /* @__PURE__ */
|
|
13447
|
+
return /* @__PURE__ */ jsx95(Fragment16, { children: subAttributes.map((subAttr, index) => {
|
|
13419
13448
|
let displayValue2;
|
|
13420
13449
|
if (Array.isArray(subAttr.value)) {
|
|
13421
13450
|
displayValue2 = subAttr.value.map((item) => typeof item === "object" ? JSON.stringify(item) : String(item)).join(", ");
|
|
@@ -13424,9 +13453,9 @@ var BaseUserProfile = ({
|
|
|
13424
13453
|
} else {
|
|
13425
13454
|
displayValue2 = String(subAttr.value);
|
|
13426
13455
|
}
|
|
13427
|
-
return /* @__PURE__ */
|
|
13428
|
-
/* @__PURE__ */
|
|
13429
|
-
/* @__PURE__ */
|
|
13456
|
+
return /* @__PURE__ */ jsxs40("div", { className: styles.field, children: [
|
|
13457
|
+
/* @__PURE__ */ jsx95("span", { className: styles.label, children: subAttr.displayName || subAttr.description || "" }),
|
|
13458
|
+
/* @__PURE__ */ jsx95("div", { className: styles.value, children: displayValue2 })
|
|
13430
13459
|
] }, index);
|
|
13431
13460
|
}) });
|
|
13432
13461
|
}
|
|
@@ -13450,9 +13479,9 @@ var BaseUserProfile = ({
|
|
|
13450
13479
|
} else {
|
|
13451
13480
|
fieldValues = [];
|
|
13452
13481
|
}
|
|
13453
|
-
return /* @__PURE__ */
|
|
13454
|
-
/* @__PURE__ */
|
|
13455
|
-
/* @__PURE__ */
|
|
13482
|
+
return /* @__PURE__ */ jsxs40(Fragment16, { children: [
|
|
13483
|
+
/* @__PURE__ */ jsx95("span", { className: styles.label, children: label }),
|
|
13484
|
+
/* @__PURE__ */ jsx95("div", { className: styles.value, children: /* @__PURE__ */ jsx95(
|
|
13456
13485
|
MultiInput_default,
|
|
13457
13486
|
{
|
|
13458
13487
|
values: fieldValues,
|
|
@@ -13483,9 +13512,9 @@ var BaseUserProfile = ({
|
|
|
13483
13512
|
} else {
|
|
13484
13513
|
displayValue2 = "-";
|
|
13485
13514
|
}
|
|
13486
|
-
return /* @__PURE__ */
|
|
13487
|
-
/* @__PURE__ */
|
|
13488
|
-
/* @__PURE__ */
|
|
13515
|
+
return /* @__PURE__ */ jsxs40(Fragment16, { children: [
|
|
13516
|
+
/* @__PURE__ */ jsx95("span", { className: styles.label, children: label }),
|
|
13517
|
+
/* @__PURE__ */ jsx95("div", { className: cx28(styles.value, !hasValues ? styles.valuePlaceholder : ""), children: !hasValues && isEditable2 && onStartEdit ? /* @__PURE__ */ jsx95(
|
|
13489
13518
|
Button_default,
|
|
13490
13519
|
{
|
|
13491
13520
|
onClick: onStartEdit,
|
|
@@ -13500,7 +13529,7 @@ var BaseUserProfile = ({
|
|
|
13500
13529
|
] });
|
|
13501
13530
|
}
|
|
13502
13531
|
if (type === "COMPLEX" && typeof value === "object") {
|
|
13503
|
-
return /* @__PURE__ */
|
|
13532
|
+
return /* @__PURE__ */ jsx95(ObjectDisplay, { data: value });
|
|
13504
13533
|
}
|
|
13505
13534
|
if (isEditing && onEditValue && mutability !== "READ_ONLY" && !readonlyFields.includes(name || "")) {
|
|
13506
13535
|
let fieldValue;
|
|
@@ -13522,13 +13551,13 @@ var BaseUserProfile = ({
|
|
|
13522
13551
|
let field;
|
|
13523
13552
|
switch (type) {
|
|
13524
13553
|
case "STRING":
|
|
13525
|
-
field = /* @__PURE__ */
|
|
13554
|
+
field = /* @__PURE__ */ jsx95(TextField_default, { ...commonProps });
|
|
13526
13555
|
break;
|
|
13527
13556
|
case "DATE_TIME":
|
|
13528
|
-
field = /* @__PURE__ */
|
|
13557
|
+
field = /* @__PURE__ */ jsx95(DatePicker_default, { ...commonProps });
|
|
13529
13558
|
break;
|
|
13530
13559
|
case "BOOLEAN":
|
|
13531
|
-
field = /* @__PURE__ */
|
|
13560
|
+
field = /* @__PURE__ */ jsx95(
|
|
13532
13561
|
Checkbox_default,
|
|
13533
13562
|
{
|
|
13534
13563
|
...commonProps,
|
|
@@ -13540,7 +13569,7 @@ var BaseUserProfile = ({
|
|
|
13540
13569
|
);
|
|
13541
13570
|
break;
|
|
13542
13571
|
case "COMPLEX":
|
|
13543
|
-
field = /* @__PURE__ */
|
|
13572
|
+
field = /* @__PURE__ */ jsx95(
|
|
13544
13573
|
"textarea",
|
|
13545
13574
|
{
|
|
13546
13575
|
value: fieldValue,
|
|
@@ -13552,11 +13581,11 @@ var BaseUserProfile = ({
|
|
|
13552
13581
|
);
|
|
13553
13582
|
break;
|
|
13554
13583
|
default:
|
|
13555
|
-
field = /* @__PURE__ */
|
|
13584
|
+
field = /* @__PURE__ */ jsx95(TextField_default, { ...commonProps });
|
|
13556
13585
|
}
|
|
13557
|
-
return /* @__PURE__ */
|
|
13558
|
-
/* @__PURE__ */
|
|
13559
|
-
/* @__PURE__ */
|
|
13586
|
+
return /* @__PURE__ */ jsxs40(Fragment16, { children: [
|
|
13587
|
+
/* @__PURE__ */ jsx95("span", { className: styles.label, children: label }),
|
|
13588
|
+
/* @__PURE__ */ jsx95("div", { className: styles.value, children: field })
|
|
13560
13589
|
] });
|
|
13561
13590
|
}
|
|
13562
13591
|
const hasValue = value !== void 0 && value !== null && value !== "";
|
|
@@ -13569,9 +13598,9 @@ var BaseUserProfile = ({
|
|
|
13569
13598
|
} else {
|
|
13570
13599
|
displayValue = "-";
|
|
13571
13600
|
}
|
|
13572
|
-
return /* @__PURE__ */
|
|
13573
|
-
/* @__PURE__ */
|
|
13574
|
-
/* @__PURE__ */
|
|
13601
|
+
return /* @__PURE__ */ jsxs40(Fragment16, { children: [
|
|
13602
|
+
/* @__PURE__ */ jsx95("span", { className: styles.label, children: label }),
|
|
13603
|
+
/* @__PURE__ */ jsx95("div", { className: cx28(styles.value, !hasValue ? styles.valuePlaceholder : ""), children: !hasValue && isEditable && onStartEdit ? /* @__PURE__ */ jsx95(
|
|
13575
13604
|
Button_default,
|
|
13576
13605
|
{
|
|
13577
13606
|
onClick: onStartEdit,
|
|
@@ -13594,8 +13623,8 @@ var BaseUserProfile = ({
|
|
|
13594
13623
|
if (!shouldShow) {
|
|
13595
13624
|
return null;
|
|
13596
13625
|
}
|
|
13597
|
-
return /* @__PURE__ */
|
|
13598
|
-
/* @__PURE__ */
|
|
13626
|
+
return /* @__PURE__ */ jsxs40("div", { className: styles.field, children: [
|
|
13627
|
+
/* @__PURE__ */ jsx95("div", { className: styles.fieldInner, children: renderSchemaField(
|
|
13599
13628
|
schema,
|
|
13600
13629
|
isFieldEditing,
|
|
13601
13630
|
(value) => {
|
|
@@ -13605,10 +13634,10 @@ var BaseUserProfile = ({
|
|
|
13605
13634
|
},
|
|
13606
13635
|
() => toggleFieldEdit(schema.name)
|
|
13607
13636
|
) }),
|
|
13608
|
-
editable && schema.mutability !== "READ_ONLY" && !isReadonlyField && /* @__PURE__ */
|
|
13609
|
-
isFieldEditing && /* @__PURE__ */
|
|
13610
|
-
/* @__PURE__ */
|
|
13611
|
-
/* @__PURE__ */
|
|
13637
|
+
editable && schema.mutability !== "READ_ONLY" && !isReadonlyField && /* @__PURE__ */ jsxs40("div", { className: styles.fieldActions, children: [
|
|
13638
|
+
isFieldEditing && /* @__PURE__ */ jsxs40(Fragment16, { children: [
|
|
13639
|
+
/* @__PURE__ */ jsx95(Button_default, { size: "small", color: "primary", variant: "solid", onClick: () => handleFieldSave(schema), children: "Save" }),
|
|
13640
|
+
/* @__PURE__ */ jsx95(
|
|
13612
13641
|
Button_default,
|
|
13613
13642
|
{
|
|
13614
13643
|
size: "small",
|
|
@@ -13619,7 +13648,7 @@ var BaseUserProfile = ({
|
|
|
13619
13648
|
}
|
|
13620
13649
|
)
|
|
13621
13650
|
] }),
|
|
13622
|
-
!isFieldEditing && hasValue && /* @__PURE__ */
|
|
13651
|
+
!isFieldEditing && hasValue && /* @__PURE__ */ jsx95(
|
|
13623
13652
|
Button_default,
|
|
13624
13653
|
{
|
|
13625
13654
|
size: "small",
|
|
@@ -13628,7 +13657,7 @@ var BaseUserProfile = ({
|
|
|
13628
13657
|
onClick: () => toggleFieldEdit(schema.name),
|
|
13629
13658
|
title: "Edit",
|
|
13630
13659
|
className: styles.editButton,
|
|
13631
|
-
children: /* @__PURE__ */
|
|
13660
|
+
children: /* @__PURE__ */ jsx95(PencilIcon, {})
|
|
13632
13661
|
}
|
|
13633
13662
|
)
|
|
13634
13663
|
] })
|
|
@@ -13651,9 +13680,9 @@ var BaseUserProfile = ({
|
|
|
13651
13680
|
if (!shouldShowField(key)) return false;
|
|
13652
13681
|
return value !== void 0 && value !== "" && value !== null;
|
|
13653
13682
|
}).sort(([a], [b]) => a.localeCompare(b));
|
|
13654
|
-
return /* @__PURE__ */
|
|
13655
|
-
/* @__PURE__ */
|
|
13656
|
-
/* @__PURE__ */
|
|
13683
|
+
return /* @__PURE__ */ jsxs40(Fragment16, { children: [
|
|
13684
|
+
/* @__PURE__ */ jsxs40("div", { className: styles.profileSummary, children: [
|
|
13685
|
+
/* @__PURE__ */ jsx95(
|
|
13657
13686
|
Avatar,
|
|
13658
13687
|
{
|
|
13659
13688
|
imageUrl: getMappedUserProfileValue_default("picture", mergedMappings, currentUser),
|
|
@@ -13663,32 +13692,32 @@ var BaseUserProfile = ({
|
|
|
13663
13692
|
isLoading
|
|
13664
13693
|
}
|
|
13665
13694
|
),
|
|
13666
|
-
/* @__PURE__ */
|
|
13667
|
-
getMappedUserProfileValue_default("email", mergedMappings, currentUser) && /* @__PURE__ */
|
|
13695
|
+
/* @__PURE__ */ jsx95(Typography_default, { variant: "h3", fontWeight: "medium", children: displayName }),
|
|
13696
|
+
getMappedUserProfileValue_default("email", mergedMappings, currentUser) && /* @__PURE__ */ jsx95(Typography_default, { variant: "body2", color: "textSecondary", children: getMappedUserProfileValue_default("email", mergedMappings, currentUser) })
|
|
13668
13697
|
] }),
|
|
13669
|
-
/* @__PURE__ */
|
|
13670
|
-
profileEntries.map(([key, value], index) => /* @__PURE__ */
|
|
13671
|
-
/* @__PURE__ */
|
|
13672
|
-
/* @__PURE__ */
|
|
13673
|
-
/* @__PURE__ */
|
|
13698
|
+
/* @__PURE__ */ jsx95(Divider_default, {}),
|
|
13699
|
+
profileEntries.map(([key, value], index) => /* @__PURE__ */ jsxs40("div", { children: [
|
|
13700
|
+
/* @__PURE__ */ jsxs40("div", { className: styles.sectionRow, children: [
|
|
13701
|
+
/* @__PURE__ */ jsx95("div", { className: styles.sectionLabel, children: formatLabel(key) }),
|
|
13702
|
+
/* @__PURE__ */ jsx95("div", { className: styles.sectionValue, children: typeof value === "object" ? /* @__PURE__ */ jsx95(ObjectDisplay, { data: value }) : String(value) })
|
|
13674
13703
|
] }),
|
|
13675
|
-
index < profileEntries.length - 1 && /* @__PURE__ */
|
|
13704
|
+
index < profileEntries.length - 1 && /* @__PURE__ */ jsx95(Divider_default, {})
|
|
13676
13705
|
] }, key))
|
|
13677
13706
|
] });
|
|
13678
13707
|
};
|
|
13679
|
-
const profileContent = /* @__PURE__ */
|
|
13680
|
-
error && /* @__PURE__ */
|
|
13708
|
+
const profileContent = /* @__PURE__ */ jsxs40(Card_default, { className: containerClasses, children: [
|
|
13709
|
+
error && /* @__PURE__ */ jsxs40(
|
|
13681
13710
|
Alert_default,
|
|
13682
13711
|
{
|
|
13683
13712
|
variant: "error",
|
|
13684
13713
|
className: cx28(withVendorCSSClassPrefix27(bem19("user-profile", "alert")), styles.alert),
|
|
13685
13714
|
children: [
|
|
13686
|
-
/* @__PURE__ */
|
|
13687
|
-
/* @__PURE__ */
|
|
13715
|
+
/* @__PURE__ */ jsx95(Alert_default.Title, { children: t("errors.heading") || "Error" }),
|
|
13716
|
+
/* @__PURE__ */ jsx95(Alert_default.Description, { children: error })
|
|
13688
13717
|
]
|
|
13689
13718
|
}
|
|
13690
13719
|
),
|
|
13691
|
-
schemas && schemas.length > 0 && /* @__PURE__ */
|
|
13720
|
+
schemas && schemas.length > 0 && /* @__PURE__ */ jsx95("div", { className: styles.header, children: /* @__PURE__ */ jsx95(
|
|
13692
13721
|
Avatar,
|
|
13693
13722
|
{
|
|
13694
13723
|
imageUrl: getMappedUserProfileValue_default("picture", mergedMappings, currentUser),
|
|
@@ -13698,7 +13727,7 @@ var BaseUserProfile = ({
|
|
|
13698
13727
|
isLoading
|
|
13699
13728
|
}
|
|
13700
13729
|
) }),
|
|
13701
|
-
/* @__PURE__ */
|
|
13730
|
+
/* @__PURE__ */ jsx95("div", { className: styles.infoContainer, children: schemas && schemas.length > 0 ? schemas.filter((schema) => {
|
|
13702
13731
|
if (!schema.name || !shouldShowField(schema.name)) return false;
|
|
13703
13732
|
if (!editable) {
|
|
13704
13733
|
const value = flattenedProfile && schema.name ? flattenedProfile[schema.name] : void 0;
|
|
@@ -13715,13 +13744,13 @@ var BaseUserProfile = ({
|
|
|
13715
13744
|
...schema,
|
|
13716
13745
|
value
|
|
13717
13746
|
};
|
|
13718
|
-
return /* @__PURE__ */
|
|
13747
|
+
return /* @__PURE__ */ jsx95("div", { className: styles.info, children: renderUserInfo(schemaWithValue) }, schema.name || index);
|
|
13719
13748
|
}) : renderProfileWithoutSchemas() })
|
|
13720
13749
|
] });
|
|
13721
13750
|
if (mode === "popup") {
|
|
13722
|
-
return /* @__PURE__ */
|
|
13723
|
-
/* @__PURE__ */
|
|
13724
|
-
/* @__PURE__ */
|
|
13751
|
+
return /* @__PURE__ */ jsx95(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs40(Dialog_default.Content, { children: [
|
|
13752
|
+
/* @__PURE__ */ jsx95(Dialog_default.Heading, { children: title ?? t("user.profile.heading") }),
|
|
13753
|
+
/* @__PURE__ */ jsx95("div", { className: styles.popup, children: profileContent })
|
|
13725
13754
|
] }) });
|
|
13726
13755
|
}
|
|
13727
13756
|
return profileContent;
|
|
@@ -13763,7 +13792,7 @@ var updateMeProfile = async ({ fetcher, instanceId = 0, ...requestConfig }) => {
|
|
|
13763
13792
|
var updateMeProfile_default = updateMeProfile;
|
|
13764
13793
|
|
|
13765
13794
|
// src/components/presentation/UserProfile/UserProfile.tsx
|
|
13766
|
-
import { jsx as
|
|
13795
|
+
import { jsx as jsx96 } from "react/jsx-runtime";
|
|
13767
13796
|
var UserProfile3 = ({ preferences, ...rest }) => {
|
|
13768
13797
|
const { baseUrl, instanceId } = useAsgardeo_default();
|
|
13769
13798
|
const { profile, flattenedProfile, schemas, onUpdateProfile } = useUser_default();
|
|
@@ -13782,7 +13811,7 @@ var UserProfile3 = ({ preferences, ...rest }) => {
|
|
|
13782
13811
|
setError(message);
|
|
13783
13812
|
}
|
|
13784
13813
|
};
|
|
13785
|
-
return /* @__PURE__ */
|
|
13814
|
+
return /* @__PURE__ */ jsx96(
|
|
13786
13815
|
BaseUserProfile_default,
|
|
13787
13816
|
{
|
|
13788
13817
|
profile,
|
|
@@ -14005,7 +14034,7 @@ var useStyles24 = (theme, colorScheme) => useMemo35(() => {
|
|
|
14005
14034
|
var BaseUserDropdown_styles_default = useStyles24;
|
|
14006
14035
|
|
|
14007
14036
|
// src/components/presentation/UserDropdown/BaseUserDropdown.tsx
|
|
14008
|
-
import { jsx as
|
|
14037
|
+
import { jsx as jsx97, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
14009
14038
|
var BaseUserDropdown = ({
|
|
14010
14039
|
fallback = null,
|
|
14011
14040
|
className = "",
|
|
@@ -14057,14 +14086,14 @@ var BaseUserDropdown = ({
|
|
|
14057
14086
|
const defaultMenuItems = [];
|
|
14058
14087
|
if (onManageProfile) {
|
|
14059
14088
|
defaultMenuItems.push({
|
|
14060
|
-
icon: /* @__PURE__ */
|
|
14089
|
+
icon: /* @__PURE__ */ jsx97(User_default2, { width: "16", height: "16" }),
|
|
14061
14090
|
label: "Manage Profile",
|
|
14062
14091
|
onClick: onManageProfile
|
|
14063
14092
|
});
|
|
14064
14093
|
}
|
|
14065
14094
|
if (onSignOut) {
|
|
14066
14095
|
defaultMenuItems.push({
|
|
14067
|
-
icon: /* @__PURE__ */
|
|
14096
|
+
icon: /* @__PURE__ */ jsx97(LogOut_default, { width: "16", height: "16" }),
|
|
14068
14097
|
label: "Sign Out",
|
|
14069
14098
|
onClick: onSignOut
|
|
14070
14099
|
});
|
|
@@ -14076,8 +14105,8 @@ var BaseUserDropdown = ({
|
|
|
14076
14105
|
}
|
|
14077
14106
|
allMenuItems.push(...defaultMenuItems);
|
|
14078
14107
|
}
|
|
14079
|
-
return /* @__PURE__ */
|
|
14080
|
-
/* @__PURE__ */
|
|
14108
|
+
return /* @__PURE__ */ jsxs41("div", { className: cx29(withVendorCSSClassPrefix28("user-dropdown"), className), children: [
|
|
14109
|
+
/* @__PURE__ */ jsxs41(
|
|
14081
14110
|
Button_default,
|
|
14082
14111
|
{
|
|
14083
14112
|
ref: refs.setReference,
|
|
@@ -14088,7 +14117,7 @@ var BaseUserDropdown = ({
|
|
|
14088
14117
|
"data-testid": "asgardeo-user-dropdown-trigger",
|
|
14089
14118
|
...getReferenceProps(),
|
|
14090
14119
|
children: [
|
|
14091
|
-
/* @__PURE__ */
|
|
14120
|
+
/* @__PURE__ */ jsx97(
|
|
14092
14121
|
Avatar,
|
|
14093
14122
|
{
|
|
14094
14123
|
imageUrl: getMappedUserProfileValue_default("picture", mergedMappings, user),
|
|
@@ -14097,7 +14126,7 @@ var BaseUserDropdown = ({
|
|
|
14097
14126
|
alt: `${getDisplayName_default(mergedMappings, user)}'s avatar`
|
|
14098
14127
|
}
|
|
14099
14128
|
),
|
|
14100
|
-
showTriggerLabel && /* @__PURE__ */
|
|
14129
|
+
showTriggerLabel && /* @__PURE__ */ jsx97(
|
|
14101
14130
|
Typography_default,
|
|
14102
14131
|
{
|
|
14103
14132
|
variant: "body2",
|
|
@@ -14108,7 +14137,7 @@ var BaseUserDropdown = ({
|
|
|
14108
14137
|
]
|
|
14109
14138
|
}
|
|
14110
14139
|
),
|
|
14111
|
-
isOpen && /* @__PURE__ */
|
|
14140
|
+
isOpen && /* @__PURE__ */ jsx97(FloatingPortal2, { id: portalId, children: /* @__PURE__ */ jsx97(FloatingFocusManager2, { context, modal: false, initialFocus: -1, children: /* @__PURE__ */ jsxs41(
|
|
14112
14141
|
"div",
|
|
14113
14142
|
{
|
|
14114
14143
|
ref: refs.setFloating,
|
|
@@ -14121,8 +14150,8 @@ var BaseUserDropdown = ({
|
|
|
14121
14150
|
},
|
|
14122
14151
|
...getFloatingProps(),
|
|
14123
14152
|
children: [
|
|
14124
|
-
/* @__PURE__ */
|
|
14125
|
-
/* @__PURE__ */
|
|
14153
|
+
/* @__PURE__ */ jsxs41("div", { className: cx29(withVendorCSSClassPrefix28("user-dropdown__header"), styles["dropdownHeader"]), children: [
|
|
14154
|
+
/* @__PURE__ */ jsx97(
|
|
14126
14155
|
Avatar,
|
|
14127
14156
|
{
|
|
14128
14157
|
imageUrl: getMappedUserProfileValue_default("picture", mergedMappings, user),
|
|
@@ -14131,8 +14160,8 @@ var BaseUserDropdown = ({
|
|
|
14131
14160
|
alt: `${getDisplayName_default(mergedMappings, user)}'s avatar`
|
|
14132
14161
|
}
|
|
14133
14162
|
),
|
|
14134
|
-
/* @__PURE__ */
|
|
14135
|
-
/* @__PURE__ */
|
|
14163
|
+
/* @__PURE__ */ jsxs41("div", { className: cx29(withVendorCSSClassPrefix28("user-dropdown__header-info"), styles["headerInfo"]), children: [
|
|
14164
|
+
/* @__PURE__ */ jsx97(
|
|
14136
14165
|
Typography_default,
|
|
14137
14166
|
{
|
|
14138
14167
|
noWrap: true,
|
|
@@ -14142,7 +14171,7 @@ var BaseUserDropdown = ({
|
|
|
14142
14171
|
children: getDisplayName_default(mergedMappings, user)
|
|
14143
14172
|
}
|
|
14144
14173
|
),
|
|
14145
|
-
/* @__PURE__ */
|
|
14174
|
+
/* @__PURE__ */ jsx97(
|
|
14146
14175
|
Typography_default,
|
|
14147
14176
|
{
|
|
14148
14177
|
noWrap: true,
|
|
@@ -14154,9 +14183,9 @@ var BaseUserDropdown = ({
|
|
|
14154
14183
|
)
|
|
14155
14184
|
] })
|
|
14156
14185
|
] }),
|
|
14157
|
-
/* @__PURE__ */
|
|
14186
|
+
/* @__PURE__ */ jsx97("div", { className: cx29(withVendorCSSClassPrefix28("user-dropdown__menu"), styles["dropdownMenu"]), children: allMenuItems.map((item, index) => /* @__PURE__ */ jsx97("div", { children: (() => {
|
|
14158
14187
|
if (item.label === "") {
|
|
14159
|
-
return /* @__PURE__ */
|
|
14188
|
+
return /* @__PURE__ */ jsx97(
|
|
14160
14189
|
"div",
|
|
14161
14190
|
{
|
|
14162
14191
|
className: cx29(withVendorCSSClassPrefix28("user-dropdown__menu-divider"), styles["divider"])
|
|
@@ -14164,7 +14193,7 @@ var BaseUserDropdown = ({
|
|
|
14164
14193
|
);
|
|
14165
14194
|
}
|
|
14166
14195
|
if (item.href) {
|
|
14167
|
-
return /* @__PURE__ */
|
|
14196
|
+
return /* @__PURE__ */ jsxs41(
|
|
14168
14197
|
"a",
|
|
14169
14198
|
{
|
|
14170
14199
|
href: item.href,
|
|
@@ -14181,12 +14210,12 @@ var BaseUserDropdown = ({
|
|
|
14181
14210
|
onBlur: () => setHoveredItemIndex(null),
|
|
14182
14211
|
children: [
|
|
14183
14212
|
item.icon,
|
|
14184
|
-
/* @__PURE__ */
|
|
14213
|
+
/* @__PURE__ */ jsx97("span", { children: item.label })
|
|
14185
14214
|
]
|
|
14186
14215
|
}
|
|
14187
14216
|
);
|
|
14188
14217
|
}
|
|
14189
|
-
return /* @__PURE__ */
|
|
14218
|
+
return /* @__PURE__ */ jsx97(
|
|
14190
14219
|
Button_default,
|
|
14191
14220
|
{
|
|
14192
14221
|
onClick: () => handleMenuItemClick(item),
|
|
@@ -14213,7 +14242,7 @@ var BaseUserDropdown_default = BaseUserDropdown;
|
|
|
14213
14242
|
|
|
14214
14243
|
// src/components/presentation/UserDropdown/UserDropdown.tsx
|
|
14215
14244
|
import { useState as useState27 } from "react";
|
|
14216
|
-
import { Fragment as Fragment17, jsx as
|
|
14245
|
+
import { Fragment as Fragment17, jsx as jsx98, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
14217
14246
|
var UserDropdown = ({
|
|
14218
14247
|
children,
|
|
14219
14248
|
renderTrigger,
|
|
@@ -14245,14 +14274,14 @@ var UserDropdown = ({
|
|
|
14245
14274
|
user
|
|
14246
14275
|
};
|
|
14247
14276
|
if (children) {
|
|
14248
|
-
return /* @__PURE__ */
|
|
14277
|
+
return /* @__PURE__ */ jsxs42(Fragment17, { children: [
|
|
14249
14278
|
children(renderProps),
|
|
14250
|
-
/* @__PURE__ */
|
|
14279
|
+
/* @__PURE__ */ jsx98(UserProfile_default, { mode: "popup", open: isProfileOpen, onOpenChange: setIsProfileOpen })
|
|
14251
14280
|
] });
|
|
14252
14281
|
}
|
|
14253
14282
|
if (renderTrigger || renderDropdown) {
|
|
14254
|
-
return /* @__PURE__ */
|
|
14255
|
-
renderTrigger ? renderTrigger(renderProps) : /* @__PURE__ */
|
|
14283
|
+
return /* @__PURE__ */ jsxs42(Fragment17, { children: [
|
|
14284
|
+
renderTrigger ? renderTrigger(renderProps) : /* @__PURE__ */ jsx98(
|
|
14256
14285
|
BaseUserDropdown,
|
|
14257
14286
|
{
|
|
14258
14287
|
user,
|
|
@@ -14262,11 +14291,11 @@ var UserDropdown = ({
|
|
|
14262
14291
|
...rest
|
|
14263
14292
|
}
|
|
14264
14293
|
),
|
|
14265
|
-
/* @__PURE__ */
|
|
14294
|
+
/* @__PURE__ */ jsx98(UserProfile_default, { mode: "popup", open: isProfileOpen, onOpenChange: setIsProfileOpen })
|
|
14266
14295
|
] });
|
|
14267
14296
|
}
|
|
14268
|
-
return /* @__PURE__ */
|
|
14269
|
-
/* @__PURE__ */
|
|
14297
|
+
return /* @__PURE__ */ jsxs42(Fragment17, { children: [
|
|
14298
|
+
/* @__PURE__ */ jsx98(
|
|
14270
14299
|
BaseUserDropdown,
|
|
14271
14300
|
{
|
|
14272
14301
|
user,
|
|
@@ -14276,7 +14305,7 @@ var UserDropdown = ({
|
|
|
14276
14305
|
...rest
|
|
14277
14306
|
}
|
|
14278
14307
|
),
|
|
14279
|
-
isProfileOpen && /* @__PURE__ */
|
|
14308
|
+
isProfileOpen && /* @__PURE__ */ jsx98(UserProfile_default, { mode: "popup", open: isProfileOpen, onOpenChange: setIsProfileOpen })
|
|
14280
14309
|
] });
|
|
14281
14310
|
};
|
|
14282
14311
|
var UserDropdown_default = UserDropdown;
|
|
@@ -14524,9 +14553,9 @@ var useStyles25 = (theme, colorScheme) => useMemo36(() => {
|
|
|
14524
14553
|
var BaseOrganizationSwitcher_styles_default = useStyles25;
|
|
14525
14554
|
|
|
14526
14555
|
// src/components/primitives/Icons/Building.tsx
|
|
14527
|
-
import { jsx as
|
|
14528
|
-
var Building = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */
|
|
14529
|
-
/* @__PURE__ */
|
|
14556
|
+
import { jsx as jsx99, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
14557
|
+
var Building = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */ jsxs43("svg", { width, height, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
14558
|
+
/* @__PURE__ */ jsx99(
|
|
14530
14559
|
"path",
|
|
14531
14560
|
{
|
|
14532
14561
|
d: "M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",
|
|
@@ -14536,30 +14565,30 @@ var Building = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PU
|
|
|
14536
14565
|
strokeLinejoin: "round"
|
|
14537
14566
|
}
|
|
14538
14567
|
),
|
|
14539
|
-
/* @__PURE__ */
|
|
14540
|
-
/* @__PURE__ */
|
|
14541
|
-
/* @__PURE__ */
|
|
14542
|
-
/* @__PURE__ */
|
|
14543
|
-
/* @__PURE__ */
|
|
14544
|
-
/* @__PURE__ */
|
|
14568
|
+
/* @__PURE__ */ jsx99("path", { d: "M6 12h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
14569
|
+
/* @__PURE__ */ jsx99("path", { d: "M6 8h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
14570
|
+
/* @__PURE__ */ jsx99("path", { d: "M14 8h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
14571
|
+
/* @__PURE__ */ jsx99("path", { d: "M14 12h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
14572
|
+
/* @__PURE__ */ jsx99("path", { d: "M6 18h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
14573
|
+
/* @__PURE__ */ jsx99("path", { d: "M14 18h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
14545
14574
|
] });
|
|
14546
14575
|
Building.displayName = "Building";
|
|
14547
14576
|
var Building_default = Building;
|
|
14548
14577
|
|
|
14549
14578
|
// src/components/primitives/Icons/Check.tsx
|
|
14550
|
-
import { jsx as
|
|
14551
|
-
var Check = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */
|
|
14579
|
+
import { jsx as jsx100 } from "react/jsx-runtime";
|
|
14580
|
+
var Check = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */ jsx100("svg", { width, height, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx100("path", { d: "M20 6 9 17l-5-5", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
14552
14581
|
Check.displayName = "Check";
|
|
14553
14582
|
var Check_default = Check;
|
|
14554
14583
|
|
|
14555
14584
|
// src/components/primitives/Icons/ChevronDown.tsx
|
|
14556
|
-
import { jsx as
|
|
14557
|
-
var ChevronDown = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */
|
|
14585
|
+
import { jsx as jsx101 } from "react/jsx-runtime";
|
|
14586
|
+
var ChevronDown = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */ jsx101("svg", { width, height, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx101("path", { d: "m6 9 6 6 6-6", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
14558
14587
|
ChevronDown.displayName = "ChevronDown";
|
|
14559
14588
|
var ChevronDown_default = ChevronDown;
|
|
14560
14589
|
|
|
14561
14590
|
// src/components/presentation/OrganizationSwitcher/BaseOrganizationSwitcher.tsx
|
|
14562
|
-
import { Fragment as Fragment18, jsx as
|
|
14591
|
+
import { Fragment as Fragment18, jsx as jsx102, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
14563
14592
|
var BaseOrganizationSwitcher = ({
|
|
14564
14593
|
organizations,
|
|
14565
14594
|
currentOrganization,
|
|
@@ -14614,8 +14643,8 @@ var BaseOrganizationSwitcher = ({
|
|
|
14614
14643
|
const switchableOrganizations = organizations.filter(
|
|
14615
14644
|
(org) => org.id !== currentOrganization?.id
|
|
14616
14645
|
);
|
|
14617
|
-
const defaultRenderOrganization2 = (organization, isSelected) => /* @__PURE__ */
|
|
14618
|
-
/* @__PURE__ */
|
|
14646
|
+
const defaultRenderOrganization2 = (organization, isSelected) => /* @__PURE__ */ jsxs44(Fragment18, { children: [
|
|
14647
|
+
/* @__PURE__ */ jsx102(
|
|
14619
14648
|
Avatar,
|
|
14620
14649
|
{
|
|
14621
14650
|
variant: "square",
|
|
@@ -14625,24 +14654,24 @@ var BaseOrganizationSwitcher = ({
|
|
|
14625
14654
|
alt: `${organization.name} avatar`
|
|
14626
14655
|
}
|
|
14627
14656
|
),
|
|
14628
|
-
/* @__PURE__ */
|
|
14629
|
-
/* @__PURE__ */
|
|
14630
|
-
/* @__PURE__ */
|
|
14631
|
-
showMemberCount && organization.memberCount !== void 0 && /* @__PURE__ */
|
|
14657
|
+
/* @__PURE__ */ jsxs44("div", { className: cx30(styles["organizationInfo"]), children: [
|
|
14658
|
+
/* @__PURE__ */ jsx102(Typography_default, { variant: "body2", fontWeight: "medium", className: cx30(styles["organizationName"]), children: organization.name }),
|
|
14659
|
+
/* @__PURE__ */ jsxs44("div", { className: cx30(styles["organizationMeta"]), children: [
|
|
14660
|
+
showMemberCount && organization.memberCount !== void 0 && /* @__PURE__ */ jsxs44("span", { children: [
|
|
14632
14661
|
organization.memberCount,
|
|
14633
14662
|
" ",
|
|
14634
14663
|
organization.memberCount === 1 ? t("organization.switcher.member") : t("organization.switcher.members")
|
|
14635
14664
|
] }),
|
|
14636
|
-
showRole && organization.role && showMemberCount && organization.memberCount !== void 0 && /* @__PURE__ */
|
|
14637
|
-
showRole && organization.role && /* @__PURE__ */
|
|
14665
|
+
showRole && organization.role && showMemberCount && organization.memberCount !== void 0 && /* @__PURE__ */ jsx102("span", { children: " \u2022 " }),
|
|
14666
|
+
showRole && organization.role && /* @__PURE__ */ jsx102("span", { className: cx30(styles["roleCapitalized"]), children: organization.role })
|
|
14638
14667
|
] })
|
|
14639
14668
|
] }),
|
|
14640
|
-
isSelected && /* @__PURE__ */
|
|
14669
|
+
isSelected && /* @__PURE__ */ jsx102(Check_default, { width: "16", height: "16", color: theme.vars.colors.text.primary })
|
|
14641
14670
|
] });
|
|
14642
|
-
const defaultRenderLoading2 = () => /* @__PURE__ */
|
|
14643
|
-
const defaultRenderError2 = (errorMessage) => /* @__PURE__ */
|
|
14644
|
-
return /* @__PURE__ */
|
|
14645
|
-
/* @__PURE__ */
|
|
14671
|
+
const defaultRenderLoading2 = () => /* @__PURE__ */ jsx102("div", { className: cx30(styles["loadingContainer"]), children: /* @__PURE__ */ jsx102(Typography_default, { variant: "caption", className: cx30(styles["loadingText"]), children: t("organization.switcher.loading.placeholder.organizations") }) });
|
|
14672
|
+
const defaultRenderError2 = (errorMessage) => /* @__PURE__ */ jsx102("div", { className: cx30(styles["errorContainer"]), children: /* @__PURE__ */ jsx102(Typography_default, { variant: "caption", className: cx30(styles["errorText"]), children: errorMessage }) });
|
|
14673
|
+
return /* @__PURE__ */ jsxs44("div", { className: cx30(styles["root"], className), style, children: [
|
|
14674
|
+
/* @__PURE__ */ jsxs44(
|
|
14646
14675
|
Button_default,
|
|
14647
14676
|
{
|
|
14648
14677
|
ref: refs.setReference,
|
|
@@ -14652,8 +14681,8 @@ var BaseOrganizationSwitcher = ({
|
|
|
14652
14681
|
size: "medium",
|
|
14653
14682
|
...getReferenceProps(),
|
|
14654
14683
|
children: [
|
|
14655
|
-
currentOrganization ? /* @__PURE__ */
|
|
14656
|
-
/* @__PURE__ */
|
|
14684
|
+
currentOrganization ? /* @__PURE__ */ jsxs44(Fragment18, { children: [
|
|
14685
|
+
/* @__PURE__ */ jsx102(
|
|
14657
14686
|
Avatar,
|
|
14658
14687
|
{
|
|
14659
14688
|
variant: "square",
|
|
@@ -14663,16 +14692,16 @@ var BaseOrganizationSwitcher = ({
|
|
|
14663
14692
|
alt: `${currentOrganization.name} avatar`
|
|
14664
14693
|
}
|
|
14665
14694
|
),
|
|
14666
|
-
showTriggerLabel && /* @__PURE__ */
|
|
14667
|
-
] }) : /* @__PURE__ */
|
|
14668
|
-
/* @__PURE__ */
|
|
14669
|
-
showTriggerLabel && /* @__PURE__ */
|
|
14695
|
+
showTriggerLabel && /* @__PURE__ */ jsx102(Typography_default, { variant: "body2", className: cx30(styles["triggerLabel"]), children: currentOrganization.name })
|
|
14696
|
+
] }) : /* @__PURE__ */ jsxs44(Fragment18, { children: [
|
|
14697
|
+
/* @__PURE__ */ jsx102(Building_default, { width: avatarSize, height: avatarSize }),
|
|
14698
|
+
showTriggerLabel && /* @__PURE__ */ jsx102(Typography_default, { variant: "body2", className: cx30(styles["triggerLabel"]), children: t("elements.fields.organization.select.label") })
|
|
14670
14699
|
] }),
|
|
14671
|
-
/* @__PURE__ */
|
|
14700
|
+
/* @__PURE__ */ jsx102("span", { style: { display: "inline-flex", transform: isRTL ? "scaleX(-1)" : "none" }, children: /* @__PURE__ */ jsx102(ChevronDown_default, { width: "16", height: "16" }) })
|
|
14672
14701
|
]
|
|
14673
14702
|
}
|
|
14674
14703
|
),
|
|
14675
|
-
isOpen && /* @__PURE__ */
|
|
14704
|
+
isOpen && /* @__PURE__ */ jsx102(FloatingPortal3, { id: portalId, children: /* @__PURE__ */ jsx102(FloatingFocusManager3, { context, modal: false, initialFocus: -1, children: /* @__PURE__ */ jsxs44(
|
|
14676
14705
|
"div",
|
|
14677
14706
|
{
|
|
14678
14707
|
ref: refs.setFloating,
|
|
@@ -14680,8 +14709,8 @@ var BaseOrganizationSwitcher = ({
|
|
|
14680
14709
|
style: floatingStyles,
|
|
14681
14710
|
...getFloatingProps(),
|
|
14682
14711
|
children: [
|
|
14683
|
-
currentOrganization && /* @__PURE__ */
|
|
14684
|
-
/* @__PURE__ */
|
|
14712
|
+
currentOrganization && /* @__PURE__ */ jsxs44("div", { className: cx30(styles["header"]), children: [
|
|
14713
|
+
/* @__PURE__ */ jsx102(
|
|
14685
14714
|
Avatar,
|
|
14686
14715
|
{
|
|
14687
14716
|
variant: "square",
|
|
@@ -14691,10 +14720,10 @@ var BaseOrganizationSwitcher = ({
|
|
|
14691
14720
|
alt: `${currentOrganization.name} avatar`
|
|
14692
14721
|
}
|
|
14693
14722
|
),
|
|
14694
|
-
/* @__PURE__ */
|
|
14695
|
-
/* @__PURE__ */
|
|
14696
|
-
/* @__PURE__ */
|
|
14697
|
-
showMemberCount && currentOrganization.memberCount !== void 0 && /* @__PURE__ */
|
|
14723
|
+
/* @__PURE__ */ jsxs44("div", { className: cx30(styles["headerInfo"]), children: [
|
|
14724
|
+
/* @__PURE__ */ jsx102(Typography_default, { noWrap: true, className: cx30(styles["headerName"]), variant: "body1", fontWeight: "medium", children: currentOrganization.name }),
|
|
14725
|
+
/* @__PURE__ */ jsxs44("div", { className: cx30(styles["headerMeta"]), children: [
|
|
14726
|
+
showMemberCount && currentOrganization.memberCount !== void 0 && /* @__PURE__ */ jsxs44(
|
|
14698
14727
|
Typography_default,
|
|
14699
14728
|
{
|
|
14700
14729
|
noWrap: true,
|
|
@@ -14704,17 +14733,17 @@ var BaseOrganizationSwitcher = ({
|
|
|
14704
14733
|
currentOrganization.memberCount,
|
|
14705
14734
|
" ",
|
|
14706
14735
|
currentOrganization.memberCount === 1 ? t("organization.switcher.member") : t("organization.switcher.members"),
|
|
14707
|
-
showRole && currentOrganization.role && /* @__PURE__ */
|
|
14736
|
+
showRole && currentOrganization.role && /* @__PURE__ */ jsxs44("span", { children: [
|
|
14708
14737
|
" \u2022 ",
|
|
14709
14738
|
currentOrganization.role
|
|
14710
14739
|
] })
|
|
14711
14740
|
]
|
|
14712
14741
|
}
|
|
14713
14742
|
),
|
|
14714
|
-
showRole && currentOrganization.role && (!showMemberCount || currentOrganization.memberCount === void 0) && /* @__PURE__ */
|
|
14743
|
+
showRole && currentOrganization.role && (!showMemberCount || currentOrganization.memberCount === void 0) && /* @__PURE__ */ jsx102(Typography_default, { noWrap: true, className: cx30(styles["headerRole"]), variant: "caption", color: "secondary", children: currentOrganization.role })
|
|
14715
14744
|
] })
|
|
14716
14745
|
] }),
|
|
14717
|
-
onManageProfile && /* @__PURE__ */
|
|
14746
|
+
onManageProfile && /* @__PURE__ */ jsx102(
|
|
14718
14747
|
Button_default,
|
|
14719
14748
|
{
|
|
14720
14749
|
onClick: onManageProfile,
|
|
@@ -14723,7 +14752,7 @@ var BaseOrganizationSwitcher = ({
|
|
|
14723
14752
|
size: "small",
|
|
14724
14753
|
"aria-label": "Manage Organization Profile",
|
|
14725
14754
|
className: cx30(styles["manageButton"]),
|
|
14726
|
-
endIcon: /* @__PURE__ */
|
|
14755
|
+
endIcon: /* @__PURE__ */ jsxs44(
|
|
14727
14756
|
"svg",
|
|
14728
14757
|
{
|
|
14729
14758
|
width: "16",
|
|
@@ -14735,8 +14764,8 @@ var BaseOrganizationSwitcher = ({
|
|
|
14735
14764
|
strokeLinecap: "round",
|
|
14736
14765
|
strokeLinejoin: "round",
|
|
14737
14766
|
children: [
|
|
14738
|
-
/* @__PURE__ */
|
|
14739
|
-
/* @__PURE__ */
|
|
14767
|
+
/* @__PURE__ */ jsx102("circle", { cx: "12", cy: "12", r: "3" }),
|
|
14768
|
+
/* @__PURE__ */ jsx102("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" })
|
|
14740
14769
|
]
|
|
14741
14770
|
}
|
|
14742
14771
|
),
|
|
@@ -14744,27 +14773,27 @@ var BaseOrganizationSwitcher = ({
|
|
|
14744
14773
|
}
|
|
14745
14774
|
)
|
|
14746
14775
|
] }),
|
|
14747
|
-
organizations.length > 1 && /* @__PURE__ */
|
|
14776
|
+
organizations.length > 1 && /* @__PURE__ */ jsx102(
|
|
14748
14777
|
"div",
|
|
14749
14778
|
{
|
|
14750
14779
|
className: cx30(styles["header"], styles["sectionHeaderContainer"]),
|
|
14751
14780
|
style: {
|
|
14752
14781
|
borderTop: currentOrganization ? `1px solid ${theme.vars.colors.border}` : "none"
|
|
14753
14782
|
},
|
|
14754
|
-
children: /* @__PURE__ */
|
|
14783
|
+
children: /* @__PURE__ */ jsx102(Typography_default, { variant: "caption", fontWeight: 600, className: cx30(styles["sectionHeader"]), children: t("organization.switcher.switch.organization") })
|
|
14755
14784
|
}
|
|
14756
14785
|
),
|
|
14757
|
-
/* @__PURE__ */
|
|
14786
|
+
/* @__PURE__ */ jsx102("div", { className: cx30(styles["menu"]), children: (() => {
|
|
14758
14787
|
if (loading) {
|
|
14759
14788
|
return renderLoading ? renderLoading() : defaultRenderLoading2();
|
|
14760
14789
|
}
|
|
14761
14790
|
if (error) {
|
|
14762
14791
|
return renderError ? renderError(error) : defaultRenderError2(error);
|
|
14763
14792
|
}
|
|
14764
|
-
return /* @__PURE__ */
|
|
14793
|
+
return /* @__PURE__ */ jsxs44(Fragment18, { children: [
|
|
14765
14794
|
switchableOrganizations.map((organization) => {
|
|
14766
14795
|
const isSelected = false;
|
|
14767
|
-
return /* @__PURE__ */
|
|
14796
|
+
return /* @__PURE__ */ jsx102(
|
|
14768
14797
|
Button_default,
|
|
14769
14798
|
{
|
|
14770
14799
|
onClick: () => handleOrganizationSwitch(organization),
|
|
@@ -14782,10 +14811,10 @@ var BaseOrganizationSwitcher = ({
|
|
|
14782
14811
|
organization.id
|
|
14783
14812
|
);
|
|
14784
14813
|
}),
|
|
14785
|
-
menuItems.length > 0 && /* @__PURE__ */
|
|
14786
|
-
/* @__PURE__ */
|
|
14814
|
+
menuItems.length > 0 && /* @__PURE__ */ jsxs44(Fragment18, { children: [
|
|
14815
|
+
/* @__PURE__ */ jsx102("div", { className: cx30(styles["menuDivider"]) }),
|
|
14787
14816
|
menuItems.map(
|
|
14788
|
-
(item, index) => /* @__PURE__ */
|
|
14817
|
+
(item, index) => /* @__PURE__ */ jsx102("div", { children: item.href ? /* @__PURE__ */ jsxs44(
|
|
14789
14818
|
"a",
|
|
14790
14819
|
{
|
|
14791
14820
|
href: item.href,
|
|
@@ -14799,10 +14828,10 @@ var BaseOrganizationSwitcher = ({
|
|
|
14799
14828
|
onBlur: () => setHoveredItemIndex(null),
|
|
14800
14829
|
children: [
|
|
14801
14830
|
item.icon,
|
|
14802
|
-
/* @__PURE__ */
|
|
14831
|
+
/* @__PURE__ */ jsx102("span", { children: item.label })
|
|
14803
14832
|
]
|
|
14804
14833
|
}
|
|
14805
|
-
) : /* @__PURE__ */
|
|
14834
|
+
) : /* @__PURE__ */ jsx102(
|
|
14806
14835
|
Button_default,
|
|
14807
14836
|
{
|
|
14808
14837
|
onClick: () => handleMenuItemClick(item),
|
|
@@ -14834,8 +14863,8 @@ var BaseOrganizationSwitcher_default = BaseOrganizationSwitcher;
|
|
|
14834
14863
|
import { useState as useState35 } from "react";
|
|
14835
14864
|
|
|
14836
14865
|
// src/components/primitives/Icons/BuildingAlt.tsx
|
|
14837
|
-
import { jsx as
|
|
14838
|
-
var BuildingAlt = ({ height = 24, width = 24 }) => /* @__PURE__ */
|
|
14866
|
+
import { jsx as jsx103, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
14867
|
+
var BuildingAlt = ({ height = 24, width = 24 }) => /* @__PURE__ */ jsxs45(
|
|
14839
14868
|
"svg",
|
|
14840
14869
|
{
|
|
14841
14870
|
width,
|
|
@@ -14848,13 +14877,13 @@ var BuildingAlt = ({ height = 24, width = 24 }) => /* @__PURE__ */ jsxs44(
|
|
|
14848
14877
|
strokeLinecap: "round",
|
|
14849
14878
|
strokeLinejoin: "round",
|
|
14850
14879
|
children: [
|
|
14851
|
-
/* @__PURE__ */
|
|
14852
|
-
/* @__PURE__ */
|
|
14853
|
-
/* @__PURE__ */
|
|
14854
|
-
/* @__PURE__ */
|
|
14855
|
-
/* @__PURE__ */
|
|
14856
|
-
/* @__PURE__ */
|
|
14857
|
-
/* @__PURE__ */
|
|
14880
|
+
/* @__PURE__ */ jsx103("path", { d: "M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z" }),
|
|
14881
|
+
/* @__PURE__ */ jsx103("path", { d: "M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2" }),
|
|
14882
|
+
/* @__PURE__ */ jsx103("path", { d: "M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2" }),
|
|
14883
|
+
/* @__PURE__ */ jsx103("path", { d: "M10 6h4" }),
|
|
14884
|
+
/* @__PURE__ */ jsx103("path", { d: "M10 10h4" }),
|
|
14885
|
+
/* @__PURE__ */ jsx103("path", { d: "M10 14h4" }),
|
|
14886
|
+
/* @__PURE__ */ jsx103("path", { d: "M10 18h4" })
|
|
14858
14887
|
]
|
|
14859
14888
|
}
|
|
14860
14889
|
);
|
|
@@ -15008,7 +15037,7 @@ var useStyles26 = (theme, colorScheme) => useMemo37(() => {
|
|
|
15008
15037
|
var BaseCreateOrganization_styles_default = useStyles26;
|
|
15009
15038
|
|
|
15010
15039
|
// src/components/presentation/CreateOrganization/BaseCreateOrganization.tsx
|
|
15011
|
-
import { jsx as
|
|
15040
|
+
import { jsx as jsx104, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
15012
15041
|
var logger8 = createPackageComponentLogger8(
|
|
15013
15042
|
"@asgardeo/react",
|
|
15014
15043
|
"BaseCreateOrganization"
|
|
@@ -15098,13 +15127,13 @@ var BaseCreateOrganization = ({
|
|
|
15098
15127
|
logger8.error("Form submission error:");
|
|
15099
15128
|
}
|
|
15100
15129
|
};
|
|
15101
|
-
const createOrganizationContent = /* @__PURE__ */
|
|
15102
|
-
/* @__PURE__ */
|
|
15103
|
-
error && /* @__PURE__ */
|
|
15104
|
-
/* @__PURE__ */
|
|
15105
|
-
/* @__PURE__ */
|
|
15130
|
+
const createOrganizationContent = /* @__PURE__ */ jsx104("div", { className: cx31(styles["root"], cardLayout && styles["card"], className), style, children: /* @__PURE__ */ jsxs46("div", { className: cx31(styles["content"]), children: [
|
|
15131
|
+
/* @__PURE__ */ jsxs46("form", { id: "create-organization-form", className: cx31(styles["form"]), onSubmit: handleSubmit, children: [
|
|
15132
|
+
error && /* @__PURE__ */ jsxs46(Alert_default, { variant: "error", className: styles["errorAlert"], children: [
|
|
15133
|
+
/* @__PURE__ */ jsx104(Alert_default.Title, { children: "Error" }),
|
|
15134
|
+
/* @__PURE__ */ jsx104(Alert_default.Description, { children: error })
|
|
15106
15135
|
] }),
|
|
15107
|
-
/* @__PURE__ */
|
|
15136
|
+
/* @__PURE__ */ jsx104("div", { className: cx31(styles["fieldGroup"]), children: /* @__PURE__ */ jsx104(
|
|
15108
15137
|
TextField_default,
|
|
15109
15138
|
{
|
|
15110
15139
|
label: `${t("elements.fields.organization.name.label")}`,
|
|
@@ -15117,7 +15146,7 @@ var BaseCreateOrganization = ({
|
|
|
15117
15146
|
className: cx31(styles["input"])
|
|
15118
15147
|
}
|
|
15119
15148
|
) }),
|
|
15120
|
-
/* @__PURE__ */
|
|
15149
|
+
/* @__PURE__ */ jsx104("div", { className: cx31(styles["fieldGroup"]), children: /* @__PURE__ */ jsx104(
|
|
15121
15150
|
TextField_default,
|
|
15122
15151
|
{
|
|
15123
15152
|
label: `${t("elements.fields.organization.handle.label") || "Organization Handle"}`,
|
|
@@ -15131,9 +15160,9 @@ var BaseCreateOrganization = ({
|
|
|
15131
15160
|
className: cx31(styles["input"])
|
|
15132
15161
|
}
|
|
15133
15162
|
) }),
|
|
15134
|
-
/* @__PURE__ */
|
|
15135
|
-
/* @__PURE__ */
|
|
15136
|
-
/* @__PURE__ */
|
|
15163
|
+
/* @__PURE__ */ jsx104("div", { className: cx31(styles["fieldGroup"]), children: /* @__PURE__ */ jsxs46(FormControl_default, { error: formErrors.description, children: [
|
|
15164
|
+
/* @__PURE__ */ jsx104(InputLabel_default, { required: true, children: t("elements.fields.organization.description.label") }),
|
|
15165
|
+
/* @__PURE__ */ jsx104(
|
|
15137
15166
|
"textarea",
|
|
15138
15167
|
{
|
|
15139
15168
|
className: cx31(styles["textarea"], formErrors.description && styles["textareaError"]),
|
|
@@ -15147,15 +15176,15 @@ var BaseCreateOrganization = ({
|
|
|
15147
15176
|
] }) }),
|
|
15148
15177
|
renderAdditionalFields && renderAdditionalFields()
|
|
15149
15178
|
] }),
|
|
15150
|
-
/* @__PURE__ */
|
|
15151
|
-
onCancel && /* @__PURE__ */
|
|
15152
|
-
/* @__PURE__ */
|
|
15179
|
+
/* @__PURE__ */ jsxs46("div", { className: cx31(styles["actions"]), children: [
|
|
15180
|
+
onCancel && /* @__PURE__ */ jsx104(Button_default, { type: "button", variant: "outline", onClick: onCancel, disabled: loading, children: t("organization.create.buttons.cancel.text") }),
|
|
15181
|
+
/* @__PURE__ */ jsx104(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") })
|
|
15153
15182
|
] })
|
|
15154
15183
|
] }) });
|
|
15155
15184
|
if (mode === "popup") {
|
|
15156
|
-
return /* @__PURE__ */
|
|
15157
|
-
/* @__PURE__ */
|
|
15158
|
-
/* @__PURE__ */
|
|
15185
|
+
return /* @__PURE__ */ jsx104(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs46(Dialog_default.Content, { children: [
|
|
15186
|
+
/* @__PURE__ */ jsx104(Dialog_default.Heading, { children: title }),
|
|
15187
|
+
/* @__PURE__ */ jsx104("div", { className: styles["popup"], children: createOrganizationContent })
|
|
15159
15188
|
] }) });
|
|
15160
15189
|
}
|
|
15161
15190
|
return createOrganizationContent;
|
|
@@ -15196,7 +15225,7 @@ var createOrganization = async ({
|
|
|
15196
15225
|
var createOrganization_default = createOrganization;
|
|
15197
15226
|
|
|
15198
15227
|
// src/components/presentation/CreateOrganization/CreateOrganization.tsx
|
|
15199
|
-
import { Fragment as Fragment19, jsx as
|
|
15228
|
+
import { Fragment as Fragment19, jsx as jsx105 } from "react/jsx-runtime";
|
|
15200
15229
|
var CreateOrganization = ({
|
|
15201
15230
|
onCreateOrganization,
|
|
15202
15231
|
fallback = null,
|
|
@@ -15212,7 +15241,7 @@ var CreateOrganization = ({
|
|
|
15212
15241
|
return fallback;
|
|
15213
15242
|
}
|
|
15214
15243
|
if (!isSignedIn) {
|
|
15215
|
-
return /* @__PURE__ */
|
|
15244
|
+
return /* @__PURE__ */ jsx105(Fragment19, {});
|
|
15216
15245
|
}
|
|
15217
15246
|
const parentId = defaultParentId || currentOrganization?.id || "";
|
|
15218
15247
|
const handleSubmit = async (payload) => {
|
|
@@ -15247,7 +15276,7 @@ var CreateOrganization = ({
|
|
|
15247
15276
|
setLoading(false);
|
|
15248
15277
|
}
|
|
15249
15278
|
};
|
|
15250
|
-
return /* @__PURE__ */
|
|
15279
|
+
return /* @__PURE__ */ jsx105(
|
|
15251
15280
|
BaseCreateOrganization,
|
|
15252
15281
|
{
|
|
15253
15282
|
onSubmit: handleSubmit,
|
|
@@ -15495,20 +15524,20 @@ var useStyles27 = (theme, colorScheme) => useMemo38(() => {
|
|
|
15495
15524
|
var BaseOrganizationList_styles_default = useStyles27;
|
|
15496
15525
|
|
|
15497
15526
|
// src/components/presentation/OrganizationList/BaseOrganizationList.tsx
|
|
15498
|
-
import { jsx as
|
|
15499
|
-
var defaultRenderOrganization = (organization, styles, t, onOrganizationSelect, showStatus) => /* @__PURE__ */
|
|
15500
|
-
/* @__PURE__ */
|
|
15501
|
-
/* @__PURE__ */
|
|
15502
|
-
/* @__PURE__ */
|
|
15503
|
-
/* @__PURE__ */
|
|
15504
|
-
/* @__PURE__ */
|
|
15527
|
+
import { jsx as jsx106, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
15528
|
+
var defaultRenderOrganization = (organization, styles, t, onOrganizationSelect, showStatus) => /* @__PURE__ */ jsxs47("div", { className: cx32(styles.organizationItem), children: [
|
|
15529
|
+
/* @__PURE__ */ jsxs47("div", { className: cx32(styles.organizationContent), children: [
|
|
15530
|
+
/* @__PURE__ */ jsx106(Avatar, { variant: "square", name: organization.name, size: 48, alt: `${organization.name} logo` }),
|
|
15531
|
+
/* @__PURE__ */ jsxs47("div", { className: cx32(styles.organizationInfo), children: [
|
|
15532
|
+
/* @__PURE__ */ jsx106(Typography_default, { variant: "h6", className: cx32(styles.organizationName), children: organization.name }),
|
|
15533
|
+
/* @__PURE__ */ jsxs47(Typography_default, { variant: "body2", color: "textSecondary", className: cx32(styles.organizationHandle), children: [
|
|
15505
15534
|
"@",
|
|
15506
15535
|
organization.orgHandle
|
|
15507
15536
|
] }),
|
|
15508
|
-
showStatus && /* @__PURE__ */
|
|
15537
|
+
showStatus && /* @__PURE__ */ jsxs47(Typography_default, { variant: "body2", color: "textSecondary", className: cx32(styles.organizationStatus), children: [
|
|
15509
15538
|
t("organization.switcher.status.label"),
|
|
15510
15539
|
" ",
|
|
15511
|
-
/* @__PURE__ */
|
|
15540
|
+
/* @__PURE__ */ jsx106(
|
|
15512
15541
|
"span",
|
|
15513
15542
|
{
|
|
15514
15543
|
className: cx32(
|
|
@@ -15521,7 +15550,7 @@ var defaultRenderOrganization = (organization, styles, t, onOrganizationSelect,
|
|
|
15521
15550
|
] })
|
|
15522
15551
|
] })
|
|
15523
15552
|
] }),
|
|
15524
|
-
organization.canSwitch && /* @__PURE__ */
|
|
15553
|
+
organization.canSwitch && /* @__PURE__ */ jsx106("div", { className: cx32(styles.organizationActions), children: /* @__PURE__ */ jsx106(
|
|
15525
15554
|
Button_default,
|
|
15526
15555
|
{
|
|
15527
15556
|
onClick: (e) => {
|
|
@@ -15534,17 +15563,17 @@ var defaultRenderOrganization = (organization, styles, t, onOrganizationSelect,
|
|
|
15534
15563
|
}
|
|
15535
15564
|
) })
|
|
15536
15565
|
] }, organization.id);
|
|
15537
|
-
var defaultRenderLoading = (t, styles) => /* @__PURE__ */
|
|
15538
|
-
/* @__PURE__ */
|
|
15539
|
-
/* @__PURE__ */
|
|
15566
|
+
var defaultRenderLoading = (t, styles) => /* @__PURE__ */ jsxs47("div", { className: cx32(styles.loadingContainer), children: [
|
|
15567
|
+
/* @__PURE__ */ jsx106(Spinner_default, { size: "medium" }),
|
|
15568
|
+
/* @__PURE__ */ jsx106(Typography_default, { variant: "body1", color: "textSecondary", className: cx32(styles.loadingText), children: t("organization.switcher.loading.placeholder.organizations") })
|
|
15540
15569
|
] });
|
|
15541
|
-
var defaultRenderError = (errorMessage, t, styles) => /* @__PURE__ */
|
|
15542
|
-
/* @__PURE__ */
|
|
15570
|
+
var defaultRenderError = (errorMessage, t, styles) => /* @__PURE__ */ jsx106("div", { className: cx32(styles.errorContainer), children: /* @__PURE__ */ jsxs47(Typography_default, { variant: "body1", color: "error", children: [
|
|
15571
|
+
/* @__PURE__ */ jsx106("strong", { children: t("organization.switcher.error.prefix") }),
|
|
15543
15572
|
" ",
|
|
15544
15573
|
errorMessage
|
|
15545
15574
|
] }) });
|
|
15546
|
-
var defaultRenderLoadMore = (onLoadMore, isLoadingMore, t, styles) => /* @__PURE__ */
|
|
15547
|
-
var defaultRenderEmpty = (t, styles) => /* @__PURE__ */
|
|
15575
|
+
var defaultRenderLoadMore = (onLoadMore, isLoadingMore, t, styles) => /* @__PURE__ */ jsx106(Button_default, { onClick: onLoadMore, disabled: isLoadingMore, className: cx32(styles.loadMoreButton), type: "button", fullWidth: true, children: isLoadingMore ? t("organization.switcher.loading.more") : t("organization.switcher.buttons.load_more.text") });
|
|
15576
|
+
var defaultRenderEmpty = (t, styles) => /* @__PURE__ */ jsx106("div", { className: cx32(styles.emptyContainer), children: /* @__PURE__ */ jsx106(Typography_default, { variant: "body1", color: "textSecondary", className: cx32(styles.emptyText), children: t("organization.switcher.no.organizations") }) });
|
|
15548
15577
|
var BaseOrganizationList = ({
|
|
15549
15578
|
className = "",
|
|
15550
15579
|
allOrganizations,
|
|
@@ -15588,42 +15617,42 @@ var BaseOrganizationList = ({
|
|
|
15588
15617
|
const renderLoadMoreWithStyles = renderLoadMore || ((onLoadMore, loadingMore) => defaultRenderLoadMore(onLoadMore, loadingMore, t, styles));
|
|
15589
15618
|
const renderOrganizationWithStyles = renderOrganization || ((org) => defaultRenderOrganization(org, styles, t, onOrganizationSelect, showStatus));
|
|
15590
15619
|
if (isLoading && organizationsWithSwitchAccess?.length === 0) {
|
|
15591
|
-
const loadingContent = /* @__PURE__ */
|
|
15620
|
+
const loadingContent = /* @__PURE__ */ jsx106("div", { className: cx32(styles["root"], className), style, children: renderLoadingWithStyles() });
|
|
15592
15621
|
if (mode === "popup") {
|
|
15593
|
-
return /* @__PURE__ */
|
|
15594
|
-
/* @__PURE__ */
|
|
15595
|
-
/* @__PURE__ */
|
|
15622
|
+
return /* @__PURE__ */ jsx106(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs47(Dialog_default.Content, { children: [
|
|
15623
|
+
/* @__PURE__ */ jsx106(Dialog_default.Heading, { children: title }),
|
|
15624
|
+
/* @__PURE__ */ jsx106("div", { className: cx32(styles["popupContent"]), children: loadingContent })
|
|
15596
15625
|
] }) });
|
|
15597
15626
|
}
|
|
15598
15627
|
return loadingContent;
|
|
15599
15628
|
}
|
|
15600
15629
|
if (error && organizationsWithSwitchAccess?.length === 0) {
|
|
15601
|
-
const errorContent = /* @__PURE__ */
|
|
15630
|
+
const errorContent = /* @__PURE__ */ jsx106("div", { className: cx32(styles["root"], className), style, children: renderErrorWithStyles(error) });
|
|
15602
15631
|
if (mode === "popup") {
|
|
15603
|
-
return /* @__PURE__ */
|
|
15604
|
-
/* @__PURE__ */
|
|
15605
|
-
/* @__PURE__ */
|
|
15632
|
+
return /* @__PURE__ */ jsx106(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs47(Dialog_default.Content, { children: [
|
|
15633
|
+
/* @__PURE__ */ jsx106(Dialog_default.Heading, { children: title }),
|
|
15634
|
+
/* @__PURE__ */ jsx106("div", { className: cx32(styles["popupContent"]), children: errorContent })
|
|
15606
15635
|
] }) });
|
|
15607
15636
|
}
|
|
15608
15637
|
return errorContent;
|
|
15609
15638
|
}
|
|
15610
15639
|
if (!isLoading && organizationsWithSwitchAccess?.length === 0) {
|
|
15611
|
-
const emptyContent = /* @__PURE__ */
|
|
15640
|
+
const emptyContent = /* @__PURE__ */ jsx106("div", { className: cx32(styles["root"], className), style, children: renderEmptyWithStyles() });
|
|
15612
15641
|
if (mode === "popup") {
|
|
15613
|
-
return /* @__PURE__ */
|
|
15614
|
-
/* @__PURE__ */
|
|
15615
|
-
/* @__PURE__ */
|
|
15642
|
+
return /* @__PURE__ */ jsx106(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs47(Dialog_default.Content, { children: [
|
|
15643
|
+
/* @__PURE__ */ jsx106(Dialog_default.Heading, { children: title }),
|
|
15644
|
+
/* @__PURE__ */ jsx106("div", { className: cx32(styles["popupContent"]), children: emptyContent })
|
|
15616
15645
|
] }) });
|
|
15617
15646
|
}
|
|
15618
15647
|
return emptyContent;
|
|
15619
15648
|
}
|
|
15620
|
-
const organizationListContent = /* @__PURE__ */
|
|
15621
|
-
/* @__PURE__ */
|
|
15622
|
-
/* @__PURE__ */
|
|
15649
|
+
const organizationListContent = /* @__PURE__ */ jsxs47("div", { className: cx32(styles["root"], className), style, children: [
|
|
15650
|
+
/* @__PURE__ */ jsxs47("div", { className: cx32(styles["header"]), children: [
|
|
15651
|
+
/* @__PURE__ */ jsx106("div", { className: cx32(styles["headerInfo"]), children: /* @__PURE__ */ jsx106(Typography_default, { variant: "body2", color: "textSecondary", className: cx32(styles["subtitle"]), children: t("organization.switcher.showing.count", {
|
|
15623
15652
|
showing: organizationsWithSwitchAccess?.length,
|
|
15624
15653
|
total: allOrganizations?.organizations?.length || 0
|
|
15625
15654
|
}) }) }),
|
|
15626
|
-
onRefresh && /* @__PURE__ */
|
|
15655
|
+
onRefresh && /* @__PURE__ */ jsx106(
|
|
15627
15656
|
Button_default,
|
|
15628
15657
|
{
|
|
15629
15658
|
onClick: onRefresh,
|
|
@@ -15635,16 +15664,16 @@ var BaseOrganizationList = ({
|
|
|
15635
15664
|
}
|
|
15636
15665
|
)
|
|
15637
15666
|
] }),
|
|
15638
|
-
/* @__PURE__ */
|
|
15667
|
+
/* @__PURE__ */ jsx106("div", { className: cx32(styles["listContainer"]), children: organizationsWithSwitchAccess?.map(
|
|
15639
15668
|
(organization, index) => renderOrganizationWithStyles(organization, index)
|
|
15640
15669
|
) }),
|
|
15641
|
-
error && organizationsWithSwitchAccess?.length > 0 && /* @__PURE__ */
|
|
15642
|
-
hasMore && fetchMore && /* @__PURE__ */
|
|
15670
|
+
error && organizationsWithSwitchAccess?.length > 0 && /* @__PURE__ */ jsx106("div", { className: cx32(styles["errorMargin"]), children: renderErrorWithStyles(error) }),
|
|
15671
|
+
hasMore && fetchMore && /* @__PURE__ */ jsx106("div", { className: cx32(styles["loadMoreMargin"]), children: renderLoadMoreWithStyles(fetchMore, isLoadingMore) })
|
|
15643
15672
|
] });
|
|
15644
15673
|
if (mode === "popup") {
|
|
15645
|
-
return /* @__PURE__ */
|
|
15646
|
-
/* @__PURE__ */
|
|
15647
|
-
/* @__PURE__ */
|
|
15674
|
+
return /* @__PURE__ */ jsx106(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs47(Dialog_default.Content, { children: [
|
|
15675
|
+
/* @__PURE__ */ jsx106(Dialog_default.Heading, { children: title }),
|
|
15676
|
+
/* @__PURE__ */ jsx106("div", { className: cx32(styles["popupContent"]), children: organizationListContent })
|
|
15648
15677
|
] }) });
|
|
15649
15678
|
}
|
|
15650
15679
|
return organizationListContent;
|
|
@@ -15714,7 +15743,7 @@ var useStyles28 = (theme, colorScheme) => useMemo40(() => {
|
|
|
15714
15743
|
var OrganizationList_styles_default = useStyles28;
|
|
15715
15744
|
|
|
15716
15745
|
// src/components/presentation/OrganizationList/OrganizationList.tsx
|
|
15717
|
-
import { jsx as
|
|
15746
|
+
import { jsx as jsx107 } from "react/jsx-runtime";
|
|
15718
15747
|
var OrganizationList = (props) => {
|
|
15719
15748
|
const { onOrganizationSelect, className = "", style, ...baseProps } = props;
|
|
15720
15749
|
const { autoFetch, filter, limit, recursive, ...filteredBaseProps } = baseProps;
|
|
@@ -15729,7 +15758,7 @@ var OrganizationList = (props) => {
|
|
|
15729
15758
|
setAllOrganizations(await getAllOrganizations2());
|
|
15730
15759
|
})();
|
|
15731
15760
|
}, []);
|
|
15732
|
-
return /* @__PURE__ */
|
|
15761
|
+
return /* @__PURE__ */ jsx107("div", { className: cx33(styles["root"], className), style, children: /* @__PURE__ */ jsx107("div", { className: cx33(styles["container"]), children: /* @__PURE__ */ jsx107(
|
|
15733
15762
|
BaseOrganizationList,
|
|
15734
15763
|
{
|
|
15735
15764
|
allOrganizations,
|
|
@@ -16068,7 +16097,7 @@ var useStyles30 = (theme, colorScheme, disabled, readOnly, hasError) => useMemo4
|
|
|
16068
16097
|
var KeyValueInput_styles_default = useStyles30;
|
|
16069
16098
|
|
|
16070
16099
|
// src/components/primitives/KeyValueInput/KeyValueInput.tsx
|
|
16071
|
-
import { jsx as
|
|
16100
|
+
import { jsx as jsx108, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
16072
16101
|
var KeyValueInput = ({
|
|
16073
16102
|
className = "",
|
|
16074
16103
|
disabled = false,
|
|
@@ -16145,18 +16174,18 @@ var KeyValueInput = ({
|
|
|
16145
16174
|
const isAddDisabled = disabled || readOnly || !canAddMore || !newKey.trim() || !newValue.trim();
|
|
16146
16175
|
const renderReadOnlyContent = () => {
|
|
16147
16176
|
if (pairs.length === 0) {
|
|
16148
|
-
return /* @__PURE__ */
|
|
16177
|
+
return /* @__PURE__ */ jsx108("div", { className: cx34(withVendorCSSClassPrefix29(bem20("key-value-input", "empty-state")), styles["emptyState"]), children: "No attributes defined" });
|
|
16149
16178
|
}
|
|
16150
|
-
return pairs.map((pair, index) => /* @__PURE__ */
|
|
16179
|
+
return pairs.map((pair, index) => /* @__PURE__ */ jsxs48(
|
|
16151
16180
|
"div",
|
|
16152
16181
|
{
|
|
16153
16182
|
className: cx34(withVendorCSSClassPrefix29(bem20("key-value-input", "readonly-pair")), styles["readOnlyPair"]),
|
|
16154
16183
|
children: [
|
|
16155
|
-
/* @__PURE__ */
|
|
16184
|
+
/* @__PURE__ */ jsxs48("span", { className: cx34(withVendorCSSClassPrefix29(bem20("key-value-input", "readonly-key")), styles["readOnlyKey"]), children: [
|
|
16156
16185
|
pair.key,
|
|
16157
16186
|
":"
|
|
16158
16187
|
] }),
|
|
16159
|
-
/* @__PURE__ */
|
|
16188
|
+
/* @__PURE__ */ jsx108(
|
|
16160
16189
|
"span",
|
|
16161
16190
|
{
|
|
16162
16191
|
className: cx34(withVendorCSSClassPrefix29(bem20("key-value-input", "readonly-value")), styles["readOnlyValue"]),
|
|
@@ -16168,10 +16197,10 @@ var KeyValueInput = ({
|
|
|
16168
16197
|
`${pair.key}-${index}`
|
|
16169
16198
|
));
|
|
16170
16199
|
};
|
|
16171
|
-
return /* @__PURE__ */
|
|
16172
|
-
label && /* @__PURE__ */
|
|
16200
|
+
return /* @__PURE__ */ jsxs48("div", { className: cx34(withVendorCSSClassPrefix29(bem20("key-value-input")), styles["container"], className), children: [
|
|
16201
|
+
label && /* @__PURE__ */ jsxs48("label", { className: cx34(withVendorCSSClassPrefix29(bem20("key-value-input", "label")), styles["label"]), children: [
|
|
16173
16202
|
label,
|
|
16174
|
-
required && /* @__PURE__ */
|
|
16203
|
+
required && /* @__PURE__ */ jsx108(
|
|
16175
16204
|
"span",
|
|
16176
16205
|
{
|
|
16177
16206
|
className: cx34(withVendorCSSClassPrefix29(bem20("key-value-input", "required")), styles["requiredIndicator"]),
|
|
@@ -16179,13 +16208,13 @@ var KeyValueInput = ({
|
|
|
16179
16208
|
}
|
|
16180
16209
|
)
|
|
16181
16210
|
] }),
|
|
16182
|
-
/* @__PURE__ */
|
|
16183
|
-
readOnly ? renderReadOnlyContent() : pairs.map((pair, index) => /* @__PURE__ */
|
|
16211
|
+
/* @__PURE__ */ jsxs48("div", { className: cx34(withVendorCSSClassPrefix29(bem20("key-value-input", "pairs-list")), styles["pairsList"]), children: [
|
|
16212
|
+
readOnly ? renderReadOnlyContent() : pairs.map((pair, index) => /* @__PURE__ */ jsxs48(
|
|
16184
16213
|
"div",
|
|
16185
16214
|
{
|
|
16186
16215
|
className: cx34(withVendorCSSClassPrefix29(bem20("key-value-input", "pair-row")), styles["pairRow"]),
|
|
16187
16216
|
children: [
|
|
16188
|
-
/* @__PURE__ */
|
|
16217
|
+
/* @__PURE__ */ jsx108(
|
|
16189
16218
|
TextField_default,
|
|
16190
16219
|
{
|
|
16191
16220
|
placeholder: keyPlaceholder,
|
|
@@ -16196,7 +16225,7 @@ var KeyValueInput = ({
|
|
|
16196
16225
|
"aria-label": `${keyLabel} ${index + 1}`
|
|
16197
16226
|
}
|
|
16198
16227
|
),
|
|
16199
|
-
/* @__PURE__ */
|
|
16228
|
+
/* @__PURE__ */ jsx108(
|
|
16200
16229
|
TextField_default,
|
|
16201
16230
|
{
|
|
16202
16231
|
placeholder: valuePlaceholder,
|
|
@@ -16207,7 +16236,7 @@ var KeyValueInput = ({
|
|
|
16207
16236
|
"aria-label": `${valueLabel} ${index + 1}`
|
|
16208
16237
|
}
|
|
16209
16238
|
),
|
|
16210
|
-
!readOnly && /* @__PURE__ */
|
|
16239
|
+
!readOnly && /* @__PURE__ */ jsx108(
|
|
16211
16240
|
"button",
|
|
16212
16241
|
{
|
|
16213
16242
|
type: "button",
|
|
@@ -16218,15 +16247,15 @@ var KeyValueInput = ({
|
|
|
16218
16247
|
styles["removeButton"]
|
|
16219
16248
|
),
|
|
16220
16249
|
"aria-label": `${removeButtonText} ${pair.key}`,
|
|
16221
|
-
children: /* @__PURE__ */
|
|
16250
|
+
children: /* @__PURE__ */ jsx108(X_default, { width: 16, height: 16 })
|
|
16222
16251
|
}
|
|
16223
16252
|
)
|
|
16224
16253
|
]
|
|
16225
16254
|
},
|
|
16226
16255
|
`${pair.key}-${index}`
|
|
16227
16256
|
)),
|
|
16228
|
-
!readOnly && /* @__PURE__ */
|
|
16229
|
-
/* @__PURE__ */
|
|
16257
|
+
!readOnly && /* @__PURE__ */ jsxs48("div", { className: cx34(withVendorCSSClassPrefix29(bem20("key-value-input", "add-row")), styles["addRow"]), children: [
|
|
16258
|
+
/* @__PURE__ */ jsx108(
|
|
16230
16259
|
TextField_default,
|
|
16231
16260
|
{
|
|
16232
16261
|
placeholder: keyPlaceholder,
|
|
@@ -16237,7 +16266,7 @@ var KeyValueInput = ({
|
|
|
16237
16266
|
"aria-label": "New key"
|
|
16238
16267
|
}
|
|
16239
16268
|
),
|
|
16240
|
-
/* @__PURE__ */
|
|
16269
|
+
/* @__PURE__ */ jsx108(
|
|
16241
16270
|
TextField_default,
|
|
16242
16271
|
{
|
|
16243
16272
|
placeholder: valuePlaceholder,
|
|
@@ -16253,7 +16282,7 @@ var KeyValueInput = ({
|
|
|
16253
16282
|
}
|
|
16254
16283
|
}
|
|
16255
16284
|
),
|
|
16256
|
-
/* @__PURE__ */
|
|
16285
|
+
/* @__PURE__ */ jsx108(
|
|
16257
16286
|
"button",
|
|
16258
16287
|
{
|
|
16259
16288
|
type: "button",
|
|
@@ -16261,13 +16290,13 @@ var KeyValueInput = ({
|
|
|
16261
16290
|
disabled: isAddDisabled,
|
|
16262
16291
|
className: cx34(withVendorCSSClassPrefix29(bem20("key-value-input", "add-button")), styles["addButton"]),
|
|
16263
16292
|
"aria-label": "Add new key-value pair",
|
|
16264
|
-
children: /* @__PURE__ */
|
|
16293
|
+
children: /* @__PURE__ */ jsx108(Plus_default, { width: 16, height: 16 })
|
|
16265
16294
|
}
|
|
16266
16295
|
)
|
|
16267
16296
|
] })
|
|
16268
16297
|
] }),
|
|
16269
|
-
(helperText || error) && /* @__PURE__ */
|
|
16270
|
-
maxPairs && /* @__PURE__ */
|
|
16298
|
+
(helperText || error) && /* @__PURE__ */ jsx108("div", { className: cx34(withVendorCSSClassPrefix29(bem20("key-value-input", "helper-text")), styles["helperText"]), children: error || helperText }),
|
|
16299
|
+
maxPairs && /* @__PURE__ */ jsxs48("div", { className: cx34(withVendorCSSClassPrefix29(bem20("key-value-input", "counter")), styles["counterText"]), children: [
|
|
16271
16300
|
pairs.length,
|
|
16272
16301
|
" of ",
|
|
16273
16302
|
maxPairs,
|
|
@@ -16278,7 +16307,7 @@ var KeyValueInput = ({
|
|
|
16278
16307
|
var KeyValueInput_default = KeyValueInput;
|
|
16279
16308
|
|
|
16280
16309
|
// src/components/presentation/OrganizationProfile/BaseOrganizationProfile.tsx
|
|
16281
|
-
import { Fragment as Fragment20, jsx as
|
|
16310
|
+
import { Fragment as Fragment20, jsx as jsx109, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
16282
16311
|
var BaseOrganizationProfile = ({
|
|
16283
16312
|
fallback = null,
|
|
16284
16313
|
className = "",
|
|
@@ -16327,7 +16356,7 @@ var BaseOrganizationProfile = ({
|
|
|
16327
16356
|
const styles = BaseOrganizationProfile_styles_default(theme, colorScheme);
|
|
16328
16357
|
const [editedOrganization, setEditedOrganization] = useState33(organization);
|
|
16329
16358
|
const [editingFields, setEditingFields] = useState33({});
|
|
16330
|
-
const PencilIcon = () => /* @__PURE__ */
|
|
16359
|
+
const PencilIcon = () => /* @__PURE__ */ jsx109(
|
|
16331
16360
|
"svg",
|
|
16332
16361
|
{
|
|
16333
16362
|
width: "16",
|
|
@@ -16338,7 +16367,7 @@ var BaseOrganizationProfile = ({
|
|
|
16338
16367
|
strokeWidth: "2",
|
|
16339
16368
|
strokeLinecap: "round",
|
|
16340
16369
|
strokeLinejoin: "round",
|
|
16341
|
-
children: /* @__PURE__ */
|
|
16370
|
+
children: /* @__PURE__ */ jsx109("path", { d: "M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z" })
|
|
16342
16371
|
}
|
|
16343
16372
|
);
|
|
16344
16373
|
const toggleFieldEdit = useCallback19((fieldName) => {
|
|
@@ -16408,7 +16437,7 @@ var BaseOrganizationProfile = ({
|
|
|
16408
16437
|
let fieldInput;
|
|
16409
16438
|
if (key === "attributes") {
|
|
16410
16439
|
const attributesValue = typeof fieldValue === "object" && fieldValue !== null ? fieldValue : {};
|
|
16411
|
-
fieldInput = /* @__PURE__ */
|
|
16440
|
+
fieldInput = /* @__PURE__ */ jsx109(
|
|
16412
16441
|
KeyValueInput_default,
|
|
16413
16442
|
{
|
|
16414
16443
|
value: attributesValue,
|
|
@@ -16446,26 +16475,26 @@ var BaseOrganizationProfile = ({
|
|
|
16446
16475
|
}
|
|
16447
16476
|
);
|
|
16448
16477
|
} else {
|
|
16449
|
-
fieldInput = /* @__PURE__ */
|
|
16478
|
+
fieldInput = /* @__PURE__ */ jsx109(TextField_default, { ...commonProps });
|
|
16450
16479
|
}
|
|
16451
|
-
return /* @__PURE__ */
|
|
16452
|
-
/* @__PURE__ */
|
|
16453
|
-
/* @__PURE__ */
|
|
16480
|
+
return /* @__PURE__ */ jsxs49(Fragment20, { children: [
|
|
16481
|
+
/* @__PURE__ */ jsx109("span", { className: cx35(styles["label"]), children: label }),
|
|
16482
|
+
/* @__PURE__ */ jsx109("div", { className: cx35(styles["value"]), children: fieldInput })
|
|
16454
16483
|
] });
|
|
16455
16484
|
}
|
|
16456
16485
|
const hasValue = value !== void 0 && value !== null && value !== "";
|
|
16457
16486
|
const isFieldEditable = editable && fieldEditable;
|
|
16458
16487
|
let displayValue;
|
|
16459
16488
|
if (hasValue) {
|
|
16460
|
-
displayValue = key === "attributes" && typeof value === "object" && value !== null ? /* @__PURE__ */
|
|
16489
|
+
displayValue = key === "attributes" && typeof value === "object" && value !== null ? /* @__PURE__ */ jsx109(KeyValueInput_default, { value, readOnly: true, label: "" }) : String(renderedValue);
|
|
16461
16490
|
} else if (isFieldEditable) {
|
|
16462
16491
|
displayValue = getFieldPlaceholder(key);
|
|
16463
16492
|
} else {
|
|
16464
16493
|
displayValue = "-";
|
|
16465
16494
|
}
|
|
16466
|
-
return /* @__PURE__ */
|
|
16467
|
-
/* @__PURE__ */
|
|
16468
|
-
/* @__PURE__ */
|
|
16495
|
+
return /* @__PURE__ */ jsxs49(Fragment20, { children: [
|
|
16496
|
+
/* @__PURE__ */ jsx109("span", { className: cx35(styles["label"]), children: label }),
|
|
16497
|
+
/* @__PURE__ */ jsx109("div", { className: cx35(styles["value"], !hasValue && styles["valueEmpty"]), children: !hasValue && isFieldEditable && onStartEdit ? /* @__PURE__ */ jsx109(
|
|
16469
16498
|
Button_default,
|
|
16470
16499
|
{
|
|
16471
16500
|
onClick: onStartEdit,
|
|
@@ -16488,8 +16517,8 @@ var BaseOrganizationProfile = ({
|
|
|
16488
16517
|
if (!shouldShow) {
|
|
16489
16518
|
return null;
|
|
16490
16519
|
}
|
|
16491
|
-
return /* @__PURE__ */
|
|
16492
|
-
/* @__PURE__ */
|
|
16520
|
+
return /* @__PURE__ */ jsxs49("div", { className: cx35(styles["field"]), children: [
|
|
16521
|
+
/* @__PURE__ */ jsx109("div", { className: cx35(styles["fieldContent"]), children: renderField(
|
|
16493
16522
|
field,
|
|
16494
16523
|
isFieldEditing,
|
|
16495
16524
|
(value) => {
|
|
@@ -16499,8 +16528,8 @@ var BaseOrganizationProfile = ({
|
|
|
16499
16528
|
},
|
|
16500
16529
|
() => toggleFieldEdit(field.key)
|
|
16501
16530
|
) }),
|
|
16502
|
-
isFieldEditable && /* @__PURE__ */
|
|
16503
|
-
/* @__PURE__ */
|
|
16531
|
+
isFieldEditable && /* @__PURE__ */ jsx109("div", { className: cx35(styles["fieldActions"]), children: isFieldEditing ? /* @__PURE__ */ jsxs49(Fragment20, { children: [
|
|
16532
|
+
/* @__PURE__ */ jsx109(
|
|
16504
16533
|
Button_default,
|
|
16505
16534
|
{
|
|
16506
16535
|
onClick: () => handleFieldSave(field.key),
|
|
@@ -16511,7 +16540,7 @@ var BaseOrganizationProfile = ({
|
|
|
16511
16540
|
children: saveButtonText
|
|
16512
16541
|
}
|
|
16513
16542
|
),
|
|
16514
|
-
/* @__PURE__ */
|
|
16543
|
+
/* @__PURE__ */ jsx109(
|
|
16515
16544
|
Button_default,
|
|
16516
16545
|
{
|
|
16517
16546
|
onClick: () => handleFieldCancel(field.key),
|
|
@@ -16522,7 +16551,7 @@ var BaseOrganizationProfile = ({
|
|
|
16522
16551
|
children: cancelButtonText
|
|
16523
16552
|
}
|
|
16524
16553
|
)
|
|
16525
|
-
] }) : hasValue && /* @__PURE__ */
|
|
16554
|
+
] }) : hasValue && /* @__PURE__ */ jsx109(
|
|
16526
16555
|
Button_default,
|
|
16527
16556
|
{
|
|
16528
16557
|
onClick: () => toggleFieldEdit(field.key),
|
|
@@ -16531,7 +16560,7 @@ var BaseOrganizationProfile = ({
|
|
|
16531
16560
|
size: "small",
|
|
16532
16561
|
title: "Edit field",
|
|
16533
16562
|
className: cx35(styles["editButton"]),
|
|
16534
|
-
children: /* @__PURE__ */
|
|
16563
|
+
children: /* @__PURE__ */ jsx109(PencilIcon, {})
|
|
16535
16564
|
}
|
|
16536
16565
|
) })
|
|
16537
16566
|
] }, field.key);
|
|
@@ -16539,23 +16568,23 @@ var BaseOrganizationProfile = ({
|
|
|
16539
16568
|
if (!organization) {
|
|
16540
16569
|
return fallback;
|
|
16541
16570
|
}
|
|
16542
|
-
const profileContent = /* @__PURE__ */
|
|
16543
|
-
/* @__PURE__ */
|
|
16544
|
-
/* @__PURE__ */
|
|
16545
|
-
/* @__PURE__ */
|
|
16546
|
-
/* @__PURE__ */
|
|
16547
|
-
organization.orgHandle && /* @__PURE__ */
|
|
16571
|
+
const profileContent = /* @__PURE__ */ jsxs49(Card_default, { className: cx35(styles["root"], cardLayout && styles["card"], className), children: [
|
|
16572
|
+
/* @__PURE__ */ jsxs49("div", { className: cx35(styles["header"]), children: [
|
|
16573
|
+
/* @__PURE__ */ jsx109(Avatar, { name: getOrgInitials(organization.name), size: 80, alt: `${organization.name} logo` }),
|
|
16574
|
+
/* @__PURE__ */ jsxs49("div", { className: cx35(styles["orgInfo"]), children: [
|
|
16575
|
+
/* @__PURE__ */ jsx109("h2", { className: cx35(styles["name"]), children: organization.name }),
|
|
16576
|
+
organization.orgHandle && /* @__PURE__ */ jsxs49("p", { className: cx35(styles["handle"]), children: [
|
|
16548
16577
|
"@",
|
|
16549
16578
|
organization.orgHandle
|
|
16550
16579
|
] })
|
|
16551
16580
|
] })
|
|
16552
16581
|
] }),
|
|
16553
|
-
/* @__PURE__ */
|
|
16582
|
+
/* @__PURE__ */ jsx109("div", { className: cx35(styles["infoContainer"]), children: fields.map((field) => renderOrganizationField(field)) })
|
|
16554
16583
|
] });
|
|
16555
16584
|
if (mode === "popup") {
|
|
16556
|
-
return /* @__PURE__ */
|
|
16557
|
-
/* @__PURE__ */
|
|
16558
|
-
/* @__PURE__ */
|
|
16585
|
+
return /* @__PURE__ */ jsx109(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs49(Dialog_default.Content, { children: [
|
|
16586
|
+
/* @__PURE__ */ jsx109(Dialog_default.Heading, { children: title }),
|
|
16587
|
+
/* @__PURE__ */ jsx109("div", { className: cx35(styles["popup"]), children: profileContent })
|
|
16559
16588
|
] }) });
|
|
16560
16589
|
}
|
|
16561
16590
|
return profileContent;
|
|
@@ -16631,7 +16660,7 @@ var updateOrganization = async ({
|
|
|
16631
16660
|
var updateOrganization_default = updateOrganization;
|
|
16632
16661
|
|
|
16633
16662
|
// src/components/presentation/OrganizationProfile/OrganizationProfile.tsx
|
|
16634
|
-
import { jsx as
|
|
16663
|
+
import { jsx as jsx110 } from "react/jsx-runtime";
|
|
16635
16664
|
var logger9 = createPackageComponentLogger9(
|
|
16636
16665
|
"@asgardeo/react",
|
|
16637
16666
|
"OrganizationProfile"
|
|
@@ -16689,7 +16718,7 @@ var OrganizationProfile = ({
|
|
|
16689
16718
|
throw err;
|
|
16690
16719
|
}
|
|
16691
16720
|
};
|
|
16692
|
-
return /* @__PURE__ */
|
|
16721
|
+
return /* @__PURE__ */ jsx110(
|
|
16693
16722
|
BaseOrganizationProfile_default,
|
|
16694
16723
|
{
|
|
16695
16724
|
organization,
|
|
@@ -16706,7 +16735,7 @@ var OrganizationProfile = ({
|
|
|
16706
16735
|
var OrganizationProfile_default = OrganizationProfile;
|
|
16707
16736
|
|
|
16708
16737
|
// src/components/presentation/OrganizationSwitcher/OrganizationSwitcher.tsx
|
|
16709
|
-
import { Fragment as Fragment21, jsx as
|
|
16738
|
+
import { Fragment as Fragment21, jsx as jsx111, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
16710
16739
|
var OrganizationSwitcher = ({
|
|
16711
16740
|
currentOrganization: propCurrentOrganization,
|
|
16712
16741
|
fallback = null,
|
|
@@ -16731,7 +16760,7 @@ var OrganizationSwitcher = ({
|
|
|
16731
16760
|
return fallback;
|
|
16732
16761
|
}
|
|
16733
16762
|
if (!isSignedIn) {
|
|
16734
|
-
return /* @__PURE__ */
|
|
16763
|
+
return /* @__PURE__ */ jsx111(Fragment21, {});
|
|
16735
16764
|
}
|
|
16736
16765
|
const organizations = propOrganizations || contextOrganizations || [];
|
|
16737
16766
|
const currentOrganization = propCurrentOrganization || contextCurrentOrganization;
|
|
@@ -16745,19 +16774,19 @@ var OrganizationSwitcher = ({
|
|
|
16745
16774
|
const defaultMenuItems = [];
|
|
16746
16775
|
if (currentOrganization) {
|
|
16747
16776
|
defaultMenuItems.push({
|
|
16748
|
-
icon: /* @__PURE__ */
|
|
16777
|
+
icon: /* @__PURE__ */ jsx111(BuildingAlt_default, {}),
|
|
16749
16778
|
label: t("organization.switcher.manage.organizations"),
|
|
16750
16779
|
onClick: handleManageOrganizations
|
|
16751
16780
|
});
|
|
16752
16781
|
}
|
|
16753
16782
|
defaultMenuItems.push({
|
|
16754
|
-
icon: /* @__PURE__ */
|
|
16783
|
+
icon: /* @__PURE__ */ jsx111("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx111("path", { d: "M12 5v14m-7-7h14" }) }),
|
|
16755
16784
|
label: t("organization.switcher.create.organization"),
|
|
16756
16785
|
onClick: () => setIsCreateOrgOpen(true)
|
|
16757
16786
|
});
|
|
16758
16787
|
const menuItems = props.menuItems ? [...defaultMenuItems, ...props.menuItems] : defaultMenuItems;
|
|
16759
|
-
return /* @__PURE__ */
|
|
16760
|
-
/* @__PURE__ */
|
|
16788
|
+
return /* @__PURE__ */ jsxs50(Fragment21, { children: [
|
|
16789
|
+
/* @__PURE__ */ jsx111(
|
|
16761
16790
|
BaseOrganizationSwitcher,
|
|
16762
16791
|
{
|
|
16763
16792
|
organizations,
|
|
@@ -16771,7 +16800,7 @@ var OrganizationSwitcher = ({
|
|
|
16771
16800
|
...props
|
|
16772
16801
|
}
|
|
16773
16802
|
),
|
|
16774
|
-
/* @__PURE__ */
|
|
16803
|
+
/* @__PURE__ */ jsx111(
|
|
16775
16804
|
CreateOrganization,
|
|
16776
16805
|
{
|
|
16777
16806
|
mode: "popup",
|
|
@@ -16785,7 +16814,7 @@ var OrganizationSwitcher = ({
|
|
|
16785
16814
|
}
|
|
16786
16815
|
}
|
|
16787
16816
|
),
|
|
16788
|
-
currentOrganization && /* @__PURE__ */
|
|
16817
|
+
currentOrganization && /* @__PURE__ */ jsx111(
|
|
16789
16818
|
OrganizationProfile_default,
|
|
16790
16819
|
{
|
|
16791
16820
|
organizationId: currentOrganization.id,
|
|
@@ -16793,11 +16822,11 @@ var OrganizationSwitcher = ({
|
|
|
16793
16822
|
open: isProfileOpen,
|
|
16794
16823
|
onOpenChange: setIsProfileOpen,
|
|
16795
16824
|
cardLayout: true,
|
|
16796
|
-
loadingFallback: /* @__PURE__ */
|
|
16797
|
-
errorFallback: /* @__PURE__ */
|
|
16825
|
+
loadingFallback: /* @__PURE__ */ jsx111("div", { children: t("organization.profile.loading") }),
|
|
16826
|
+
errorFallback: /* @__PURE__ */ jsx111("div", { children: t("organization.profile.error") })
|
|
16798
16827
|
}
|
|
16799
16828
|
),
|
|
16800
|
-
/* @__PURE__ */
|
|
16829
|
+
/* @__PURE__ */ jsx111(
|
|
16801
16830
|
OrganizationList_default,
|
|
16802
16831
|
{
|
|
16803
16832
|
mode: "popup",
|
|
@@ -16831,7 +16860,7 @@ import {
|
|
|
16831
16860
|
useInteractions as useInteractions4,
|
|
16832
16861
|
useRole as useRole4
|
|
16833
16862
|
} from "@floating-ui/react";
|
|
16834
|
-
import { useState as useState36 } from "react";
|
|
16863
|
+
import { useEffect as useEffect24, useState as useState36 } from "react";
|
|
16835
16864
|
|
|
16836
16865
|
// src/components/presentation/LanguageSwitcher/BaseLanguageSwitcher.styles.ts
|
|
16837
16866
|
import { css as css32 } from "@emotion/css";
|
|
@@ -16946,7 +16975,7 @@ var useStyles31 = (theme, colorScheme) => useMemo43(() => {
|
|
|
16946
16975
|
var BaseLanguageSwitcher_styles_default = useStyles31;
|
|
16947
16976
|
|
|
16948
16977
|
// src/components/presentation/LanguageSwitcher/BaseLanguageSwitcher.tsx
|
|
16949
|
-
import { Fragment as Fragment22, jsx as
|
|
16978
|
+
import { Fragment as Fragment22, jsx as jsx112, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
16950
16979
|
var BaseLanguageSwitcher = ({
|
|
16951
16980
|
children,
|
|
16952
16981
|
className,
|
|
@@ -16958,27 +16987,33 @@ var BaseLanguageSwitcher = ({
|
|
|
16958
16987
|
const { theme, colorScheme } = useTheme_default();
|
|
16959
16988
|
const styles = BaseLanguageSwitcher_styles_default(theme, colorScheme);
|
|
16960
16989
|
const [isOpen, setIsOpen] = useState36(false);
|
|
16990
|
+
const hasMultipleLanguages = languages.length > 1;
|
|
16991
|
+
useEffect24(() => {
|
|
16992
|
+
if (!hasMultipleLanguages && isOpen) {
|
|
16993
|
+
setIsOpen(false);
|
|
16994
|
+
}
|
|
16995
|
+
}, [hasMultipleLanguages, isOpen]);
|
|
16961
16996
|
const { refs, floatingStyles, context } = useFloating4({
|
|
16962
16997
|
middleware: [offset3(4), flip3(), shift3()],
|
|
16963
16998
|
onOpenChange: setIsOpen,
|
|
16964
16999
|
open: isOpen,
|
|
16965
17000
|
whileElementsMounted: autoUpdate3
|
|
16966
17001
|
});
|
|
16967
|
-
const click = useClick4(context);
|
|
16968
|
-
const dismiss = useDismiss4(context);
|
|
16969
|
-
const role = useRole4(context, { role: "listbox" });
|
|
17002
|
+
const click = useClick4(context, { enabled: hasMultipleLanguages });
|
|
17003
|
+
const dismiss = useDismiss4(context, { enabled: hasMultipleLanguages });
|
|
17004
|
+
const role = useRole4(context, { enabled: hasMultipleLanguages, role: "listbox" });
|
|
16970
17005
|
const { getReferenceProps, getFloatingProps } = useInteractions4([click, dismiss, role]);
|
|
16971
17006
|
const currentOption = languages.find((l) => l.code === currentLanguage);
|
|
16972
17007
|
if (children) {
|
|
16973
|
-
return /* @__PURE__ */
|
|
17008
|
+
return /* @__PURE__ */ jsx112(Fragment22, { children: children({
|
|
16974
17009
|
currentLanguage,
|
|
16975
17010
|
isLoading,
|
|
16976
17011
|
languages,
|
|
16977
17012
|
onLanguageChange
|
|
16978
17013
|
}) });
|
|
16979
17014
|
}
|
|
16980
|
-
return /* @__PURE__ */
|
|
16981
|
-
/* @__PURE__ */
|
|
17015
|
+
return /* @__PURE__ */ jsxs51("div", { className: cx36(styles["root"], className), children: [
|
|
17016
|
+
/* @__PURE__ */ jsxs51(
|
|
16982
17017
|
"button",
|
|
16983
17018
|
{
|
|
16984
17019
|
ref: refs.setReference,
|
|
@@ -16988,13 +17023,13 @@ var BaseLanguageSwitcher = ({
|
|
|
16988
17023
|
...getReferenceProps(),
|
|
16989
17024
|
className: styles["trigger"],
|
|
16990
17025
|
children: [
|
|
16991
|
-
currentOption && /* @__PURE__ */
|
|
16992
|
-
/* @__PURE__ */
|
|
16993
|
-
/* @__PURE__ */
|
|
17026
|
+
currentOption && /* @__PURE__ */ jsx112("span", { className: styles["triggerEmoji"], children: currentOption.emoji }),
|
|
17027
|
+
/* @__PURE__ */ jsx112("span", { className: styles["triggerLabel"], children: currentOption?.displayName ?? currentLanguage }),
|
|
17028
|
+
hasMultipleLanguages && /* @__PURE__ */ jsx112(ChevronDown_default, {})
|
|
16994
17029
|
]
|
|
16995
17030
|
}
|
|
16996
17031
|
),
|
|
16997
|
-
isOpen && /* @__PURE__ */
|
|
17032
|
+
isOpen && hasMultipleLanguages && /* @__PURE__ */ jsx112(FloatingPortal4, { children: /* @__PURE__ */ jsx112(FloatingFocusManager4, { context, modal: false, children: /* @__PURE__ */ jsx112(
|
|
16998
17033
|
"div",
|
|
16999
17034
|
{
|
|
17000
17035
|
ref: refs.setFloating,
|
|
@@ -17003,7 +17038,7 @@ var BaseLanguageSwitcher = ({
|
|
|
17003
17038
|
className: styles["content"],
|
|
17004
17039
|
role: "listbox",
|
|
17005
17040
|
"aria-label": "Select language",
|
|
17006
|
-
children: languages.map((lang) => /* @__PURE__ */
|
|
17041
|
+
children: languages.map((lang) => /* @__PURE__ */ jsxs51(
|
|
17007
17042
|
"button",
|
|
17008
17043
|
{
|
|
17009
17044
|
type: "button",
|
|
@@ -17015,9 +17050,9 @@ var BaseLanguageSwitcher = ({
|
|
|
17015
17050
|
setIsOpen(false);
|
|
17016
17051
|
},
|
|
17017
17052
|
children: [
|
|
17018
|
-
/* @__PURE__ */
|
|
17019
|
-
/* @__PURE__ */
|
|
17020
|
-
lang.code === currentLanguage && /* @__PURE__ */
|
|
17053
|
+
/* @__PURE__ */ jsx112("span", { className: styles["optionEmoji"], children: lang.emoji }),
|
|
17054
|
+
/* @__PURE__ */ jsx112("span", { className: styles["optionLabel"], children: lang.displayName }),
|
|
17055
|
+
lang.code === currentLanguage && /* @__PURE__ */ jsx112("span", { className: styles["checkIcon"], children: /* @__PURE__ */ jsx112(Check_default, {}) })
|
|
17021
17056
|
]
|
|
17022
17057
|
},
|
|
17023
17058
|
lang.code
|
|
@@ -17044,25 +17079,30 @@ var useFlowMeta = () => {
|
|
|
17044
17079
|
var useFlowMeta_default = useFlowMeta;
|
|
17045
17080
|
|
|
17046
17081
|
// src/components/presentation/LanguageSwitcher/LanguageSwitcher.tsx
|
|
17047
|
-
import { jsx as
|
|
17082
|
+
import { jsx as jsx113 } from "react/jsx-runtime";
|
|
17048
17083
|
var LanguageSwitcher = ({ children, className }) => {
|
|
17049
17084
|
const { meta, switchLanguage, isLoading } = useFlowMeta_default();
|
|
17050
17085
|
const { currentLanguage } = useTranslation_default();
|
|
17051
17086
|
const availableLanguageCodes = meta?.i18n?.languages ?? [];
|
|
17087
|
+
const effectiveLanguageCodes = useMemo44(() => {
|
|
17088
|
+
const fallbackCodes = availableLanguageCodes.length > 0 ? availableLanguageCodes : [currentLanguage];
|
|
17089
|
+
return Array.from(/* @__PURE__ */ new Set([currentLanguage, ...fallbackCodes]));
|
|
17090
|
+
}, [availableLanguageCodes, currentLanguage]);
|
|
17052
17091
|
const languages = useMemo44(
|
|
17053
|
-
() =>
|
|
17092
|
+
() => effectiveLanguageCodes.map((code) => ({
|
|
17054
17093
|
code,
|
|
17055
|
-
|
|
17094
|
+
// Resolve each label in its own locale so option names stay stable across UI language switches.
|
|
17095
|
+
displayName: resolveLocaleDisplayName(code, code) || code,
|
|
17056
17096
|
emoji: resolveLocaleEmoji(code)
|
|
17057
17097
|
})),
|
|
17058
|
-
[
|
|
17098
|
+
[effectiveLanguageCodes]
|
|
17059
17099
|
);
|
|
17060
17100
|
const handleLanguageChange = (language) => {
|
|
17061
17101
|
if (language !== currentLanguage) {
|
|
17062
17102
|
switchLanguage(language);
|
|
17063
17103
|
}
|
|
17064
17104
|
};
|
|
17065
|
-
return /* @__PURE__ */
|
|
17105
|
+
return /* @__PURE__ */ jsx113(
|
|
17066
17106
|
BaseLanguageSwitcher_default,
|
|
17067
17107
|
{
|
|
17068
17108
|
currentLanguage,
|