@asgardeo/react 0.6.0 → 0.6.2
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 +620 -558
- package/dist/cjs/index.js.map +4 -4
- package/dist/components/factories/FieldFactory.d.ts +4 -0
- package/dist/components/presentation/SignIn/BaseSignIn.d.ts +27 -0
- package/dist/components/presentation/SignIn/SignIn.d.ts +2 -2
- package/dist/components/presentation/SignIn/component-driven/SignInOptionFactory.d.ts +1 -0
- package/dist/components/presentation/SignUp/BaseSignUp.d.ts +0 -4
- package/dist/components/presentation/SignUp/SignUpOptionFactory.d.ts +0 -6
- package/dist/components/presentation/SignUp/transformer.d.ts +75 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +432 -367
- package/dist/index.js.map +4 -4
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -2906,6 +2906,11 @@ var Loading = ({ children, fallback = null }) => {
|
|
|
2906
2906
|
Loading.displayName = "Loading";
|
|
2907
2907
|
var Loading_default = Loading;
|
|
2908
2908
|
|
|
2909
|
+
// src/components/presentation/SignIn/BaseSignIn.tsx
|
|
2910
|
+
import {
|
|
2911
|
+
Platform as Platform3
|
|
2912
|
+
} from "@asgardeo/browser";
|
|
2913
|
+
|
|
2909
2914
|
// src/components/presentation/SignIn/non-component-driven/BaseSignIn.tsx
|
|
2910
2915
|
import {
|
|
2911
2916
|
EmbeddedSignInFlowStepType,
|
|
@@ -4366,6 +4371,7 @@ var createField = (config) => {
|
|
|
4366
4371
|
required,
|
|
4367
4372
|
value,
|
|
4368
4373
|
onChange,
|
|
4374
|
+
onBlur,
|
|
4369
4375
|
disabled = false,
|
|
4370
4376
|
error,
|
|
4371
4377
|
className,
|
|
@@ -4382,7 +4388,8 @@ var createField = (config) => {
|
|
|
4382
4388
|
error: validationError,
|
|
4383
4389
|
className,
|
|
4384
4390
|
value,
|
|
4385
|
-
placeholder
|
|
4391
|
+
placeholder,
|
|
4392
|
+
onBlur
|
|
4386
4393
|
};
|
|
4387
4394
|
switch (type) {
|
|
4388
4395
|
case FieldType.Password:
|
|
@@ -6806,14 +6813,6 @@ var BaseSignInContent = ({
|
|
|
6806
6813
|
};
|
|
6807
6814
|
var BaseSignIn_default = BaseSignIn;
|
|
6808
6815
|
|
|
6809
|
-
// src/components/presentation/SignIn/SignIn.tsx
|
|
6810
|
-
import {
|
|
6811
|
-
Platform as Platform3
|
|
6812
|
-
} from "@asgardeo/browser";
|
|
6813
|
-
|
|
6814
|
-
// src/components/presentation/SignIn/component-driven/SignIn.tsx
|
|
6815
|
-
import { useState as useState16, useEffect as useEffect13, useRef as useRef4 } from "react";
|
|
6816
|
-
|
|
6817
6816
|
// src/components/presentation/SignIn/component-driven/BaseSignIn.tsx
|
|
6818
6817
|
import { useState as useState15, useCallback as useCallback10 } from "react";
|
|
6819
6818
|
import { cx as cx20 } from "@emotion/css";
|
|
@@ -7033,6 +7032,7 @@ var createSignInComponentFromFlow = (component, formValues, touchedFields, formE
|
|
|
7033
7032
|
value,
|
|
7034
7033
|
error,
|
|
7035
7034
|
onChange: (newValue) => onInputChange(identifier, newValue),
|
|
7035
|
+
onBlur: () => options.onInputBlur?.(identifier),
|
|
7036
7036
|
className: options.inputClassName
|
|
7037
7037
|
});
|
|
7038
7038
|
return React.cloneElement(field, { key });
|
|
@@ -7209,6 +7209,8 @@ var BaseSignInContent2 = ({
|
|
|
7209
7209
|
} = form;
|
|
7210
7210
|
const handleInputChange = (name, value) => {
|
|
7211
7211
|
setFormValue(name, value);
|
|
7212
|
+
};
|
|
7213
|
+
const handleInputBlur = (name) => {
|
|
7212
7214
|
setFormTouched(name, true);
|
|
7213
7215
|
};
|
|
7214
7216
|
const handleSubmit = async (component, data) => {
|
|
@@ -7288,6 +7290,7 @@ var BaseSignInContent2 = ({
|
|
|
7288
7290
|
buttonClassName: buttonClasses,
|
|
7289
7291
|
error,
|
|
7290
7292
|
inputClassName: inputClasses,
|
|
7293
|
+
onInputBlur: handleInputBlur,
|
|
7291
7294
|
onSubmit: handleSubmit,
|
|
7292
7295
|
size,
|
|
7293
7296
|
variant
|
|
@@ -7304,6 +7307,7 @@ var BaseSignInContent2 = ({
|
|
|
7304
7307
|
error,
|
|
7305
7308
|
inputClasses,
|
|
7306
7309
|
buttonClasses,
|
|
7310
|
+
handleInputBlur,
|
|
7307
7311
|
handleSubmit
|
|
7308
7312
|
]
|
|
7309
7313
|
);
|
|
@@ -7356,7 +7360,24 @@ var BaseSignInContent2 = ({
|
|
|
7356
7360
|
};
|
|
7357
7361
|
var BaseSignIn_default2 = BaseSignIn2;
|
|
7358
7362
|
|
|
7363
|
+
// src/components/presentation/SignIn/BaseSignIn.tsx
|
|
7364
|
+
import { jsx as jsx57 } from "react/jsx-runtime";
|
|
7365
|
+
var BaseSignIn3 = (props) => {
|
|
7366
|
+
const { platform } = useAsgardeo_default();
|
|
7367
|
+
if (platform === Platform3.AsgardeoV2) {
|
|
7368
|
+
return /* @__PURE__ */ jsx57(BaseSignIn_default2, { ...props });
|
|
7369
|
+
}
|
|
7370
|
+
return /* @__PURE__ */ jsx57(BaseSignIn_default, { ...props });
|
|
7371
|
+
};
|
|
7372
|
+
var BaseSignIn_default3 = BaseSignIn3;
|
|
7373
|
+
|
|
7374
|
+
// src/components/presentation/SignIn/SignIn.tsx
|
|
7375
|
+
import {
|
|
7376
|
+
Platform as Platform4
|
|
7377
|
+
} from "@asgardeo/browser";
|
|
7378
|
+
|
|
7359
7379
|
// src/components/presentation/SignIn/component-driven/SignIn.tsx
|
|
7380
|
+
import { useState as useState16, useEffect as useEffect13, useRef as useRef4 } from "react";
|
|
7360
7381
|
import {
|
|
7361
7382
|
AsgardeoRuntimeError as AsgardeoRuntimeError8,
|
|
7362
7383
|
EmbeddedFlowType,
|
|
@@ -7369,7 +7390,7 @@ var generateId = (prefix) => {
|
|
|
7369
7390
|
const suffix = Math.random().toString(36).substring(2, 6);
|
|
7370
7391
|
return `${prefix}_${suffix}`;
|
|
7371
7392
|
};
|
|
7372
|
-
var getInputVariant = (type) => {
|
|
7393
|
+
var getInputVariant = (type, name) => {
|
|
7373
7394
|
switch (type.toLowerCase()) {
|
|
7374
7395
|
case "email":
|
|
7375
7396
|
return "EMAIL";
|
|
@@ -7396,15 +7417,19 @@ var getInputPlaceholder = (name, type, t) => {
|
|
|
7396
7417
|
return placeholder;
|
|
7397
7418
|
};
|
|
7398
7419
|
var convertSimpleInputToComponent = (input, t) => {
|
|
7399
|
-
|
|
7400
|
-
|
|
7401
|
-
|
|
7420
|
+
let fieldType = input.type;
|
|
7421
|
+
if (input.name.toLowerCase().includes("password") && input.type.toLowerCase() === "string") {
|
|
7422
|
+
fieldType = "password";
|
|
7423
|
+
}
|
|
7424
|
+
const variant = getInputVariant(fieldType, input.name);
|
|
7425
|
+
const label = getInputLabel(input.name, fieldType, t);
|
|
7426
|
+
const placeholder = getInputPlaceholder(input.name, fieldType, t);
|
|
7402
7427
|
return {
|
|
7403
7428
|
id: generateId("input"),
|
|
7404
7429
|
type: EmbeddedFlowComponentType2.Input,
|
|
7405
7430
|
variant,
|
|
7406
7431
|
config: {
|
|
7407
|
-
type:
|
|
7432
|
+
type: fieldType,
|
|
7408
7433
|
label,
|
|
7409
7434
|
placeholder,
|
|
7410
7435
|
required: input.required,
|
|
@@ -7415,7 +7440,8 @@ var convertSimpleInputToComponent = (input, t) => {
|
|
|
7415
7440
|
};
|
|
7416
7441
|
};
|
|
7417
7442
|
var convertActionToComponent = (action, t) => {
|
|
7418
|
-
const
|
|
7443
|
+
const normalizedId = action.id.replace(/_auth$/, "");
|
|
7444
|
+
const i18nKey = `elements.buttons.${normalizedId}`;
|
|
7419
7445
|
let text = t(i18nKey);
|
|
7420
7446
|
if (!text || text === i18nKey) {
|
|
7421
7447
|
text = action.id.replace(/_/g, " ");
|
|
@@ -7474,7 +7500,7 @@ var normalizeFlowResponse = (response, t) => {
|
|
|
7474
7500
|
};
|
|
7475
7501
|
|
|
7476
7502
|
// src/components/presentation/SignIn/component-driven/SignIn.tsx
|
|
7477
|
-
import { Fragment as Fragment12, jsx as
|
|
7503
|
+
import { Fragment as Fragment12, jsx as jsx58 } from "react/jsx-runtime";
|
|
7478
7504
|
var SignIn = ({ className, size = "medium", onSuccess, onError, variant, children }) => {
|
|
7479
7505
|
const { applicationId, afterSignInUrl, signIn, isInitialized, isLoading } = useAsgardeo_default();
|
|
7480
7506
|
const { t } = useTranslation_default();
|
|
@@ -7588,9 +7614,9 @@ var SignIn = ({ className, size = "medium", onSuccess, onError, variant, childre
|
|
|
7588
7614
|
components,
|
|
7589
7615
|
error: flowError
|
|
7590
7616
|
};
|
|
7591
|
-
return /* @__PURE__ */
|
|
7617
|
+
return /* @__PURE__ */ jsx58(Fragment12, { children: children(renderProps) });
|
|
7592
7618
|
}
|
|
7593
|
-
return /* @__PURE__ */
|
|
7619
|
+
return /* @__PURE__ */ jsx58(
|
|
7594
7620
|
BaseSignIn_default2,
|
|
7595
7621
|
{
|
|
7596
7622
|
components,
|
|
@@ -7606,7 +7632,7 @@ var SignIn = ({ className, size = "medium", onSuccess, onError, variant, childre
|
|
|
7606
7632
|
var SignIn_default = SignIn;
|
|
7607
7633
|
|
|
7608
7634
|
// src/components/presentation/SignIn/SignIn.tsx
|
|
7609
|
-
import { jsx as
|
|
7635
|
+
import { jsx as jsx59 } from "react/jsx-runtime";
|
|
7610
7636
|
var SignIn2 = ({ className, size = "medium", children, ...rest }) => {
|
|
7611
7637
|
const { signIn, afterSignInUrl, isInitialized, isLoading, platform } = useAsgardeo_default();
|
|
7612
7638
|
const handleInitialize = async () => {
|
|
@@ -7626,8 +7652,8 @@ var SignIn2 = ({ className, size = "medium", children, ...rest }) => {
|
|
|
7626
7652
|
window.location.href = url.toString();
|
|
7627
7653
|
}
|
|
7628
7654
|
};
|
|
7629
|
-
if (platform ===
|
|
7630
|
-
return /* @__PURE__ */
|
|
7655
|
+
if (platform === Platform4.AsgardeoV2) {
|
|
7656
|
+
return /* @__PURE__ */ jsx59(
|
|
7631
7657
|
SignIn_default,
|
|
7632
7658
|
{
|
|
7633
7659
|
className,
|
|
@@ -7639,7 +7665,7 @@ var SignIn2 = ({ className, size = "medium", children, ...rest }) => {
|
|
|
7639
7665
|
}
|
|
7640
7666
|
);
|
|
7641
7667
|
}
|
|
7642
|
-
return /* @__PURE__ */
|
|
7668
|
+
return /* @__PURE__ */ jsx59(
|
|
7643
7669
|
BaseSignIn_default,
|
|
7644
7670
|
{
|
|
7645
7671
|
isLoading: isLoading || !isInitialized,
|
|
@@ -7660,8 +7686,7 @@ import {
|
|
|
7660
7686
|
EmbeddedFlowStatus,
|
|
7661
7687
|
EmbeddedFlowComponentType as EmbeddedFlowComponentType5,
|
|
7662
7688
|
EmbeddedFlowResponseType,
|
|
7663
|
-
withVendorCSSClassPrefix as withVendorCSSClassPrefix21
|
|
7664
|
-
AsgardeoAPIError as AsgardeoAPIError3
|
|
7689
|
+
withVendorCSSClassPrefix as withVendorCSSClassPrefix21
|
|
7665
7690
|
} from "@asgardeo/browser";
|
|
7666
7691
|
import { cx as cx21 } from "@emotion/css";
|
|
7667
7692
|
import { useEffect as useEffect14, useState as useState17, useCallback as useCallback11, useRef as useRef5 } from "react";
|
|
@@ -7726,13 +7751,13 @@ var DateInput = ({
|
|
|
7726
7751
|
var DateInput_default = DateInput;
|
|
7727
7752
|
|
|
7728
7753
|
// src/components/adapters/DividerComponent.tsx
|
|
7729
|
-
import { jsx as
|
|
7754
|
+
import { jsx as jsx60 } from "react/jsx-runtime";
|
|
7730
7755
|
var DividerComponent = ({ component }) => {
|
|
7731
7756
|
const { theme } = useTheme_default();
|
|
7732
7757
|
const config = component.config || {};
|
|
7733
7758
|
const text = config["text"] || "";
|
|
7734
7759
|
const variant = component.variant?.toLowerCase() || "horizontal";
|
|
7735
|
-
return /* @__PURE__ */
|
|
7760
|
+
return /* @__PURE__ */ jsx60(
|
|
7736
7761
|
Divider_default,
|
|
7737
7762
|
{
|
|
7738
7763
|
orientation: variant === "vertical" ? "vertical" : "horizontal",
|
|
@@ -7773,7 +7798,7 @@ var EmailInput = ({
|
|
|
7773
7798
|
var EmailInput_default = EmailInput;
|
|
7774
7799
|
|
|
7775
7800
|
// src/components/adapters/FormContainer.tsx
|
|
7776
|
-
import { jsx as
|
|
7801
|
+
import { jsx as jsx61 } from "react/jsx-runtime";
|
|
7777
7802
|
var FormContainer = (props) => {
|
|
7778
7803
|
const { component } = props;
|
|
7779
7804
|
if (component.components && component.components.length > 0) {
|
|
@@ -7786,19 +7811,19 @@ var FormContainer = (props) => {
|
|
|
7786
7811
|
props.onSubmit(submitButton, props.formValues);
|
|
7787
7812
|
}
|
|
7788
7813
|
};
|
|
7789
|
-
return /* @__PURE__ */
|
|
7814
|
+
return /* @__PURE__ */ jsx61("form", { onSubmit: handleFormSubmit, style: { display: "flex", flexDirection: "column" }, children: component.components.map(
|
|
7790
7815
|
(childComponent, index) => createSignUpComponent({
|
|
7791
7816
|
...props,
|
|
7792
7817
|
component: childComponent
|
|
7793
7818
|
})
|
|
7794
7819
|
) }, component.id);
|
|
7795
7820
|
}
|
|
7796
|
-
return /* @__PURE__ */
|
|
7821
|
+
return /* @__PURE__ */ jsx61("div", {}, component.id);
|
|
7797
7822
|
};
|
|
7798
7823
|
var FormContainer_default = FormContainer;
|
|
7799
7824
|
|
|
7800
7825
|
// src/components/adapters/ImageComponent.tsx
|
|
7801
|
-
import { jsx as
|
|
7826
|
+
import { jsx as jsx62 } from "react/jsx-runtime";
|
|
7802
7827
|
var ImageComponent = ({ component }) => {
|
|
7803
7828
|
const { theme } = useTheme_default();
|
|
7804
7829
|
const config = component.config || {};
|
|
@@ -7815,7 +7840,7 @@ var ImageComponent = ({ component }) => {
|
|
|
7815
7840
|
if (!src) {
|
|
7816
7841
|
return null;
|
|
7817
7842
|
}
|
|
7818
|
-
return /* @__PURE__ */
|
|
7843
|
+
return /* @__PURE__ */ jsx62("div", { style: { textAlign: "center" }, children: /* @__PURE__ */ jsx62(
|
|
7819
7844
|
"img",
|
|
7820
7845
|
{
|
|
7821
7846
|
src,
|
|
@@ -7918,7 +7943,7 @@ var PasswordInput = ({
|
|
|
7918
7943
|
var PasswordInput_default = PasswordInput;
|
|
7919
7944
|
|
|
7920
7945
|
// src/components/adapters/SubmitButton.tsx
|
|
7921
|
-
import { jsx as
|
|
7946
|
+
import { jsx as jsx63 } from "react/jsx-runtime";
|
|
7922
7947
|
var ButtonComponent = ({
|
|
7923
7948
|
component,
|
|
7924
7949
|
isLoading,
|
|
@@ -7951,7 +7976,7 @@ var ButtonComponent = ({
|
|
|
7951
7976
|
onSubmit(component);
|
|
7952
7977
|
}
|
|
7953
7978
|
};
|
|
7954
|
-
return /* @__PURE__ */
|
|
7979
|
+
return /* @__PURE__ */ jsx63(
|
|
7955
7980
|
Button_default,
|
|
7956
7981
|
{
|
|
7957
7982
|
type: buttonType === "submit" ? "submit" : "button",
|
|
@@ -7962,7 +7987,7 @@ var ButtonComponent = ({
|
|
|
7962
7987
|
onClick: buttonType !== "submit" ? handleClick : void 0,
|
|
7963
7988
|
className: buttonClassName,
|
|
7964
7989
|
style: { width: "100%" },
|
|
7965
|
-
children: isLoading ? /* @__PURE__ */
|
|
7990
|
+
children: isLoading ? /* @__PURE__ */ jsx63(Spinner_default, { size: "small" }) : buttonText
|
|
7966
7991
|
},
|
|
7967
7992
|
component.id
|
|
7968
7993
|
);
|
|
@@ -7970,7 +7995,7 @@ var ButtonComponent = ({
|
|
|
7970
7995
|
var SubmitButton_default = ButtonComponent;
|
|
7971
7996
|
|
|
7972
7997
|
// src/components/adapters/TelephoneInput.tsx
|
|
7973
|
-
import { jsx as
|
|
7998
|
+
import { jsx as jsx64 } from "react/jsx-runtime";
|
|
7974
7999
|
var TelephoneInput = ({
|
|
7975
8000
|
component,
|
|
7976
8001
|
formValues,
|
|
@@ -7983,7 +8008,7 @@ var TelephoneInput = ({
|
|
|
7983
8008
|
const fieldName = config["identifier"] || config["name"] || component.id;
|
|
7984
8009
|
const value = formValues[fieldName] || "";
|
|
7985
8010
|
const error = touchedFields[fieldName] ? formErrors[fieldName] : void 0;
|
|
7986
|
-
return /* @__PURE__ */
|
|
8011
|
+
return /* @__PURE__ */ jsx64(
|
|
7987
8012
|
TextField_default,
|
|
7988
8013
|
{
|
|
7989
8014
|
name: fieldName,
|
|
@@ -8031,7 +8056,7 @@ var TextInput = ({
|
|
|
8031
8056
|
var TextInput_default = TextInput;
|
|
8032
8057
|
|
|
8033
8058
|
// src/components/adapters/Typography.tsx
|
|
8034
|
-
import { jsx as
|
|
8059
|
+
import { jsx as jsx65 } from "react/jsx-runtime";
|
|
8035
8060
|
var TypographyComponent = ({ component }) => {
|
|
8036
8061
|
const { theme } = useTheme_default();
|
|
8037
8062
|
const config = component.config || {};
|
|
@@ -8072,7 +8097,7 @@ var TypographyComponent = ({ component }) => {
|
|
|
8072
8097
|
default:
|
|
8073
8098
|
typographyVariant = "body1";
|
|
8074
8099
|
}
|
|
8075
|
-
return /* @__PURE__ */
|
|
8100
|
+
return /* @__PURE__ */ jsx65(
|
|
8076
8101
|
Typography_default,
|
|
8077
8102
|
{
|
|
8078
8103
|
variant: typographyVariant,
|
|
@@ -8085,66 +8110,66 @@ var TypographyComponent = ({ component }) => {
|
|
|
8085
8110
|
var Typography_default2 = TypographyComponent;
|
|
8086
8111
|
|
|
8087
8112
|
// src/components/presentation/SignUp/SignUpOptionFactory.tsx
|
|
8088
|
-
import { jsx as
|
|
8113
|
+
import { jsx as jsx66 } from "react/jsx-runtime";
|
|
8089
8114
|
var createSignUpComponent = ({ component, onSubmit, ...rest }) => {
|
|
8090
8115
|
switch (component.type) {
|
|
8091
8116
|
case EmbeddedFlowComponentType3.Typography:
|
|
8092
|
-
return /* @__PURE__ */
|
|
8117
|
+
return /* @__PURE__ */ jsx66(Typography_default2, { component, onSubmit, ...rest });
|
|
8093
8118
|
case EmbeddedFlowComponentType3.Input:
|
|
8094
8119
|
const inputVariant = component.variant?.toUpperCase();
|
|
8095
8120
|
const inputType = component.config["type"]?.toLowerCase();
|
|
8096
8121
|
if (inputVariant === "EMAIL" || inputType === "email") {
|
|
8097
|
-
return /* @__PURE__ */
|
|
8122
|
+
return /* @__PURE__ */ jsx66(EmailInput_default, { component, onSubmit, ...rest });
|
|
8098
8123
|
}
|
|
8099
8124
|
if (inputVariant === "PASSWORD" || inputType === "password") {
|
|
8100
|
-
return /* @__PURE__ */
|
|
8125
|
+
return /* @__PURE__ */ jsx66(PasswordInput_default, { component, onSubmit, ...rest });
|
|
8101
8126
|
}
|
|
8102
8127
|
if (inputVariant === "TELEPHONE" || inputType === "tel") {
|
|
8103
|
-
return /* @__PURE__ */
|
|
8128
|
+
return /* @__PURE__ */ jsx66(TelephoneInput_default, { component, onSubmit, ...rest });
|
|
8104
8129
|
}
|
|
8105
8130
|
if (inputVariant === "NUMBER" || inputType === "number") {
|
|
8106
|
-
return /* @__PURE__ */
|
|
8131
|
+
return /* @__PURE__ */ jsx66(NumberInput_default, { component, onSubmit, ...rest });
|
|
8107
8132
|
}
|
|
8108
8133
|
if (inputVariant === "DATE" || inputType === "date") {
|
|
8109
|
-
return /* @__PURE__ */
|
|
8134
|
+
return /* @__PURE__ */ jsx66(DateInput_default, { component, onSubmit, ...rest });
|
|
8110
8135
|
}
|
|
8111
8136
|
if (inputVariant === "CHECKBOX" || inputType === "checkbox") {
|
|
8112
|
-
return /* @__PURE__ */
|
|
8137
|
+
return /* @__PURE__ */ jsx66(CheckboxInput_default, { component, onSubmit, ...rest });
|
|
8113
8138
|
}
|
|
8114
|
-
return /* @__PURE__ */
|
|
8139
|
+
return /* @__PURE__ */ jsx66(TextInput_default, { component, onSubmit, ...rest });
|
|
8115
8140
|
case EmbeddedFlowComponentType3.Button: {
|
|
8116
8141
|
const buttonVariant = component.variant?.toUpperCase();
|
|
8117
8142
|
const buttonText = component.config["text"] || component.config["label"] || "";
|
|
8118
8143
|
if (buttonVariant === "SOCIAL") {
|
|
8119
8144
|
if (buttonText.toLowerCase().includes("google")) {
|
|
8120
|
-
return /* @__PURE__ */
|
|
8145
|
+
return /* @__PURE__ */ jsx66(GoogleButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
|
|
8121
8146
|
}
|
|
8122
8147
|
if (buttonText.toLowerCase().includes("github")) {
|
|
8123
|
-
return /* @__PURE__ */
|
|
8148
|
+
return /* @__PURE__ */ jsx66(GitHubButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
|
|
8124
8149
|
}
|
|
8125
8150
|
if (buttonText.toLowerCase().includes("microsoft")) {
|
|
8126
|
-
return /* @__PURE__ */
|
|
8151
|
+
return /* @__PURE__ */ jsx66(MicrosoftButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
|
|
8127
8152
|
}
|
|
8128
8153
|
if (buttonText.toLowerCase().includes("facebook")) {
|
|
8129
|
-
return /* @__PURE__ */
|
|
8154
|
+
return /* @__PURE__ */ jsx66(FacebookButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
|
|
8130
8155
|
}
|
|
8131
8156
|
if (buttonText.toLowerCase().includes("linkedin")) {
|
|
8132
|
-
return /* @__PURE__ */
|
|
8157
|
+
return /* @__PURE__ */ jsx66(LinkedInButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
|
|
8133
8158
|
}
|
|
8134
8159
|
if (buttonText.toLowerCase().includes("ethereum")) {
|
|
8135
|
-
return /* @__PURE__ */
|
|
8160
|
+
return /* @__PURE__ */ jsx66(SignInWithEthereumButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
|
|
8136
8161
|
}
|
|
8137
8162
|
}
|
|
8138
|
-
return /* @__PURE__ */
|
|
8163
|
+
return /* @__PURE__ */ jsx66(SubmitButton_default, { component, onSubmit, ...rest });
|
|
8139
8164
|
}
|
|
8140
8165
|
case EmbeddedFlowComponentType3.Form:
|
|
8141
|
-
return /* @__PURE__ */
|
|
8166
|
+
return /* @__PURE__ */ jsx66(FormContainer_default, { component, onSubmit, ...rest });
|
|
8142
8167
|
case EmbeddedFlowComponentType3.Divider:
|
|
8143
|
-
return /* @__PURE__ */
|
|
8168
|
+
return /* @__PURE__ */ jsx66(DividerComponent_default, { component, onSubmit, ...rest });
|
|
8144
8169
|
case EmbeddedFlowComponentType3.Image:
|
|
8145
|
-
return /* @__PURE__ */
|
|
8170
|
+
return /* @__PURE__ */ jsx66(ImageComponent_default, { component, onSubmit, ...rest });
|
|
8146
8171
|
default:
|
|
8147
|
-
return /* @__PURE__ */
|
|
8172
|
+
return /* @__PURE__ */ jsx66("div", {});
|
|
8148
8173
|
}
|
|
8149
8174
|
};
|
|
8150
8175
|
var createSignUpOptionFromComponent = (component, formValues, touchedFields, formErrors, isLoading, isFormValid, onInputChange, options) => createSignUpComponent({
|
|
@@ -8175,12 +8200,14 @@ var renderSignUpComponents = (components, formValues, touchedFields, formErrors,
|
|
|
8175
8200
|
).filter(Boolean);
|
|
8176
8201
|
|
|
8177
8202
|
// src/components/presentation/SignUp/transformer.ts
|
|
8178
|
-
import {
|
|
8203
|
+
import {
|
|
8204
|
+
EmbeddedFlowComponentType as EmbeddedFlowComponentType4
|
|
8205
|
+
} from "@asgardeo/browser";
|
|
8179
8206
|
var generateId2 = (prefix) => {
|
|
8180
8207
|
const suffix = Math.random().toString(36).substring(2, 6);
|
|
8181
8208
|
return `${prefix}_${suffix}`;
|
|
8182
8209
|
};
|
|
8183
|
-
var getInputVariant2 = (type) => {
|
|
8210
|
+
var getInputVariant2 = (type, name) => {
|
|
8184
8211
|
switch (type.toLowerCase()) {
|
|
8185
8212
|
case "email":
|
|
8186
8213
|
return "EMAIL";
|
|
@@ -8207,7 +8234,11 @@ var getInputPlaceholder2 = (name, type, t) => {
|
|
|
8207
8234
|
return placeholder;
|
|
8208
8235
|
};
|
|
8209
8236
|
var convertSimpleInputToComponent2 = (input, t) => {
|
|
8210
|
-
|
|
8237
|
+
let fieldType = input.type;
|
|
8238
|
+
if (input.name.toLowerCase().includes("password") && input.type.toLowerCase() === "string") {
|
|
8239
|
+
fieldType = "password";
|
|
8240
|
+
}
|
|
8241
|
+
const variant = getInputVariant2(input.type, input.name);
|
|
8211
8242
|
const label = getInputLabel2(input.name, input.type, t);
|
|
8212
8243
|
const placeholder = getInputPlaceholder2(input.name, input.type, t);
|
|
8213
8244
|
return {
|
|
@@ -8215,7 +8246,7 @@ var convertSimpleInputToComponent2 = (input, t) => {
|
|
|
8215
8246
|
type: EmbeddedFlowComponentType4.Input,
|
|
8216
8247
|
variant,
|
|
8217
8248
|
config: {
|
|
8218
|
-
type: input.type
|
|
8249
|
+
type: input.type,
|
|
8219
8250
|
label,
|
|
8220
8251
|
placeholder,
|
|
8221
8252
|
required: input.required,
|
|
@@ -8226,7 +8257,8 @@ var convertSimpleInputToComponent2 = (input, t) => {
|
|
|
8226
8257
|
};
|
|
8227
8258
|
};
|
|
8228
8259
|
var convertActionToComponent2 = (action, t) => {
|
|
8229
|
-
const
|
|
8260
|
+
const normalizedId = action.id.replace(/_auth$/, "");
|
|
8261
|
+
const i18nKey = `elements.buttons.${normalizedId}`;
|
|
8230
8262
|
let text = t(i18nKey);
|
|
8231
8263
|
if (!text || text === i18nKey) {
|
|
8232
8264
|
text = action.id.replace(/_/g, " ");
|
|
@@ -8277,6 +8309,38 @@ var transformSimpleToComponentDriven2 = (response, t) => {
|
|
|
8277
8309
|
}
|
|
8278
8310
|
return result;
|
|
8279
8311
|
};
|
|
8312
|
+
var extractErrorMessage = (error, t) => {
|
|
8313
|
+
let errorMessage = t("errors.sign.up.flow.failure");
|
|
8314
|
+
if (error && typeof error === "object") {
|
|
8315
|
+
if (error.flowStatus === "ERROR" && error.failureReason) {
|
|
8316
|
+
errorMessage = error.failureReason;
|
|
8317
|
+
} else if (error.code && (error.message || error.description)) {
|
|
8318
|
+
errorMessage = error.description || error.message;
|
|
8319
|
+
} else if (error instanceof Error && error.name === "AsgardeoAPIError") {
|
|
8320
|
+
try {
|
|
8321
|
+
const errorResponse = JSON.parse(
|
|
8322
|
+
error.message
|
|
8323
|
+
);
|
|
8324
|
+
if (errorResponse.failureReason) {
|
|
8325
|
+
errorMessage = errorResponse.failureReason;
|
|
8326
|
+
} else if (errorResponse.description) {
|
|
8327
|
+
errorMessage = errorResponse.description;
|
|
8328
|
+
} else if (errorResponse.message) {
|
|
8329
|
+
errorMessage = errorResponse.message;
|
|
8330
|
+
} else {
|
|
8331
|
+
errorMessage = error.message;
|
|
8332
|
+
}
|
|
8333
|
+
} catch {
|
|
8334
|
+
errorMessage = error.message;
|
|
8335
|
+
}
|
|
8336
|
+
} else if (error.message) {
|
|
8337
|
+
errorMessage = error.message;
|
|
8338
|
+
}
|
|
8339
|
+
} else if (typeof error === "string") {
|
|
8340
|
+
errorMessage = error;
|
|
8341
|
+
}
|
|
8342
|
+
return errorMessage;
|
|
8343
|
+
};
|
|
8280
8344
|
|
|
8281
8345
|
// src/components/presentation/SignUp/BaseSignUp.styles.ts
|
|
8282
8346
|
import { css as css18 } from "@emotion/css";
|
|
@@ -8420,13 +8484,13 @@ var useStyles18 = (theme, colorScheme) => {
|
|
|
8420
8484
|
var BaseSignUp_styles_default = useStyles18;
|
|
8421
8485
|
|
|
8422
8486
|
// src/components/presentation/SignUp/BaseSignUp.tsx
|
|
8423
|
-
import { jsx as
|
|
8487
|
+
import { jsx as jsx67, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
8424
8488
|
var BaseSignUp = (props) => {
|
|
8425
8489
|
const { theme, colorScheme } = useTheme_default();
|
|
8426
8490
|
const styles = BaseSignUp_styles_default(theme, colorScheme);
|
|
8427
8491
|
return /* @__PURE__ */ jsxs28("div", { children: [
|
|
8428
|
-
/* @__PURE__ */
|
|
8429
|
-
/* @__PURE__ */
|
|
8492
|
+
/* @__PURE__ */ jsx67("div", { className: styles.logoContainer, children: /* @__PURE__ */ jsx67(Logo_default, { size: "large" }) }),
|
|
8493
|
+
/* @__PURE__ */ jsx67(FlowProvider_default, { children: /* @__PURE__ */ jsx67(BaseSignUpContent, { ...props }) })
|
|
8430
8494
|
] });
|
|
8431
8495
|
};
|
|
8432
8496
|
var BaseSignUpContent = ({
|
|
@@ -8448,12 +8512,22 @@ var BaseSignUpContent = ({
|
|
|
8448
8512
|
}) => {
|
|
8449
8513
|
const { theme, colorScheme } = useTheme_default();
|
|
8450
8514
|
const { t } = useTranslation_default();
|
|
8451
|
-
const { subtitle: flowSubtitle, title: flowTitle, messages: flowMessages } = useFlow_default();
|
|
8515
|
+
const { subtitle: flowSubtitle, title: flowTitle, messages: flowMessages, addMessage, clearMessages } = useFlow_default();
|
|
8452
8516
|
const styles = BaseSignUp_styles_default(theme, colorScheme);
|
|
8517
|
+
const handleError = useCallback11(
|
|
8518
|
+
(error) => {
|
|
8519
|
+
const errorMessage = extractErrorMessage(error, t);
|
|
8520
|
+
clearMessages();
|
|
8521
|
+
addMessage({
|
|
8522
|
+
type: "error",
|
|
8523
|
+
message: errorMessage
|
|
8524
|
+
});
|
|
8525
|
+
},
|
|
8526
|
+
[t, addMessage, clearMessages]
|
|
8527
|
+
);
|
|
8453
8528
|
const [isLoading, setIsLoading] = useState17(false);
|
|
8454
8529
|
const [isFlowInitialized, setIsFlowInitialized] = useState17(false);
|
|
8455
8530
|
const [currentFlow, setCurrentFlow] = useState17(null);
|
|
8456
|
-
const [error, setError] = useState17(null);
|
|
8457
8531
|
const [formData, setFormData] = useState17({});
|
|
8458
8532
|
const initializationAttemptedRef = useRef5(false);
|
|
8459
8533
|
const normalizeFlowResponse2 = useCallback11(
|
|
@@ -8554,7 +8628,7 @@ var BaseSignUpContent = ({
|
|
|
8554
8628
|
return;
|
|
8555
8629
|
}
|
|
8556
8630
|
setIsLoading(true);
|
|
8557
|
-
|
|
8631
|
+
clearMessages();
|
|
8558
8632
|
try {
|
|
8559
8633
|
const filteredInputs = {};
|
|
8560
8634
|
if (data) {
|
|
@@ -8585,8 +8659,7 @@ var BaseSignUpContent = ({
|
|
|
8585
8659
|
setupFormFields(response);
|
|
8586
8660
|
}
|
|
8587
8661
|
} catch (err) {
|
|
8588
|
-
|
|
8589
|
-
setError(errorMessage);
|
|
8662
|
+
handleError(err);
|
|
8590
8663
|
onError?.(err);
|
|
8591
8664
|
} finally {
|
|
8592
8665
|
setIsLoading(false);
|
|
@@ -8631,8 +8704,7 @@ var BaseSignUpContent = ({
|
|
|
8631
8704
|
popup.close();
|
|
8632
8705
|
cleanup();
|
|
8633
8706
|
} catch (err) {
|
|
8634
|
-
|
|
8635
|
-
setError(errorMessage);
|
|
8707
|
+
handleError(err);
|
|
8636
8708
|
onError?.(err);
|
|
8637
8709
|
popup.close();
|
|
8638
8710
|
cleanup();
|
|
@@ -8663,9 +8735,9 @@ var BaseSignUpContent = ({
|
|
|
8663
8735
|
const url = new URL(popupUrl);
|
|
8664
8736
|
const code = url.searchParams.get("code");
|
|
8665
8737
|
const state = url.searchParams.get("state");
|
|
8666
|
-
const
|
|
8667
|
-
if (
|
|
8668
|
-
console.error("OAuth error:",
|
|
8738
|
+
const error = url.searchParams.get("error");
|
|
8739
|
+
if (error) {
|
|
8740
|
+
console.error("OAuth error:", error);
|
|
8669
8741
|
popup.close();
|
|
8670
8742
|
cleanup();
|
|
8671
8743
|
return;
|
|
@@ -8691,8 +8763,7 @@ var BaseSignUpContent = ({
|
|
|
8691
8763
|
}
|
|
8692
8764
|
popup.close();
|
|
8693
8765
|
} catch (err) {
|
|
8694
|
-
|
|
8695
|
-
setError(errorMessage);
|
|
8766
|
+
handleError(err);
|
|
8696
8767
|
onError?.(err);
|
|
8697
8768
|
popup.close();
|
|
8698
8769
|
}
|
|
@@ -8745,7 +8816,6 @@ var BaseSignUpContent = ({
|
|
|
8745
8816
|
handleInputChange,
|
|
8746
8817
|
{
|
|
8747
8818
|
buttonClassName: buttonClasses,
|
|
8748
|
-
error,
|
|
8749
8819
|
inputClassName: inputClasses,
|
|
8750
8820
|
onSubmit: handleSubmit,
|
|
8751
8821
|
size,
|
|
@@ -8760,7 +8830,6 @@ var BaseSignUpContent = ({
|
|
|
8760
8830
|
isLoading,
|
|
8761
8831
|
size,
|
|
8762
8832
|
variant,
|
|
8763
|
-
error,
|
|
8764
8833
|
inputClasses,
|
|
8765
8834
|
buttonClasses,
|
|
8766
8835
|
handleSubmit
|
|
@@ -8771,7 +8840,7 @@ var BaseSignUpContent = ({
|
|
|
8771
8840
|
initializationAttemptedRef.current = true;
|
|
8772
8841
|
(async () => {
|
|
8773
8842
|
setIsLoading(true);
|
|
8774
|
-
|
|
8843
|
+
clearMessages();
|
|
8775
8844
|
try {
|
|
8776
8845
|
const rawResponse = await onInitialize();
|
|
8777
8846
|
const response = normalizeFlowResponse2(rawResponse);
|
|
@@ -8786,8 +8855,7 @@ var BaseSignUpContent = ({
|
|
|
8786
8855
|
setupFormFields(response);
|
|
8787
8856
|
}
|
|
8788
8857
|
} catch (err) {
|
|
8789
|
-
|
|
8790
|
-
setError(errorMessage);
|
|
8858
|
+
handleError(err);
|
|
8791
8859
|
onError?.(err);
|
|
8792
8860
|
} finally {
|
|
8793
8861
|
setIsLoading(false);
|
|
@@ -8813,7 +8881,6 @@ var BaseSignUpContent = ({
|
|
|
8813
8881
|
touched: touchedFields,
|
|
8814
8882
|
isValid: isFormValid,
|
|
8815
8883
|
isLoading,
|
|
8816
|
-
error,
|
|
8817
8884
|
components: currentFlow?.data?.components || [],
|
|
8818
8885
|
handleInputChange,
|
|
8819
8886
|
handleSubmit,
|
|
@@ -8822,34 +8889,32 @@ var BaseSignUpContent = ({
|
|
|
8822
8889
|
subtitle: flowSubtitle || t("signup.subtitle"),
|
|
8823
8890
|
messages: flowMessages || []
|
|
8824
8891
|
};
|
|
8825
|
-
return /* @__PURE__ */
|
|
8892
|
+
return /* @__PURE__ */ jsx67("div", { className: containerClasses, children: children(renderProps) });
|
|
8826
8893
|
}
|
|
8827
8894
|
if (!isFlowInitialized && isLoading) {
|
|
8828
|
-
return /* @__PURE__ */
|
|
8895
|
+
return /* @__PURE__ */ jsx67(Card_default, { className: cx21(containerClasses, styles.card), variant, children: /* @__PURE__ */ jsx67(Card_default.Content, { children: /* @__PURE__ */ jsx67("div", { className: styles.loadingContainer, children: /* @__PURE__ */ jsx67(Spinner_default, { size: "medium" }) }) }) });
|
|
8829
8896
|
}
|
|
8830
8897
|
if (!currentFlow) {
|
|
8831
|
-
return /* @__PURE__ */
|
|
8832
|
-
/* @__PURE__ */
|
|
8833
|
-
/* @__PURE__ */
|
|
8898
|
+
return /* @__PURE__ */ jsx67(Card_default, { className: cx21(containerClasses, styles.card), variant, children: /* @__PURE__ */ jsx67(Card_default.Content, { children: /* @__PURE__ */ jsxs28(Alert_default, { variant: "error", className: errorClasses, children: [
|
|
8899
|
+
/* @__PURE__ */ jsx67(Alert_default.Title, { children: t("errors.title") }),
|
|
8900
|
+
/* @__PURE__ */ jsx67(Alert_default.Description, { children: t("errors.sign.up.flow.initialization.failure") })
|
|
8834
8901
|
] }) }) });
|
|
8835
8902
|
}
|
|
8836
8903
|
return /* @__PURE__ */ jsxs28(Card_default, { className: cx21(containerClasses, styles.card), variant, children: [
|
|
8837
|
-
|
|
8838
|
-
|
|
8839
|
-
{
|
|
8840
|
-
|
|
8841
|
-
|
|
8842
|
-
|
|
8843
|
-
|
|
8844
|
-
|
|
8845
|
-
|
|
8846
|
-
|
|
8847
|
-
|
|
8848
|
-
|
|
8849
|
-
|
|
8850
|
-
|
|
8851
|
-
/* @__PURE__ */ jsx66("div", { className: styles.contentContainer, children: currentFlow.data?.components && renderComponents(currentFlow.data.components) })
|
|
8852
|
-
] })
|
|
8904
|
+
/* @__PURE__ */ jsxs28(Card_default.Header, { className: styles.header, children: [
|
|
8905
|
+
/* @__PURE__ */ jsx67(Card_default.Title, { level: 2, className: styles.title, children: flowTitle || t("signup.title") }),
|
|
8906
|
+
/* @__PURE__ */ jsx67(Typography_default, { variant: "body1", className: styles.subtitle, children: flowSubtitle || t("signup.subtitle") }),
|
|
8907
|
+
flowMessages && flowMessages.length > 0 && /* @__PURE__ */ jsx67("div", { className: styles.flowMessagesContainer, children: flowMessages.map((message, index) => /* @__PURE__ */ jsx67(
|
|
8908
|
+
Alert_default,
|
|
8909
|
+
{
|
|
8910
|
+
variant: message.type?.toLowerCase() === "error" ? "error" : "info",
|
|
8911
|
+
className: cx21(styles.flowMessageItem, messageClasses),
|
|
8912
|
+
children: /* @__PURE__ */ jsx67(Alert_default.Description, { children: message.message })
|
|
8913
|
+
},
|
|
8914
|
+
message.id || index
|
|
8915
|
+
)) })
|
|
8916
|
+
] }),
|
|
8917
|
+
/* @__PURE__ */ jsx67(Card_default.Content, { children: /* @__PURE__ */ jsx67("div", { className: styles.contentContainer, children: currentFlow.data?.components && currentFlow.data.components.length > 0 ? renderComponents(currentFlow.data.components) : /* @__PURE__ */ jsx67(Alert_default, { variant: "warning", children: /* @__PURE__ */ jsx67(Typography_default, { variant: "body1", children: t("errors.sign.up.components.not.available") }) }) }) })
|
|
8853
8918
|
] });
|
|
8854
8919
|
};
|
|
8855
8920
|
var BaseSignUp_default = BaseSignUp;
|
|
@@ -8858,9 +8923,9 @@ var BaseSignUp_default = BaseSignUp;
|
|
|
8858
8923
|
import {
|
|
8859
8924
|
EmbeddedFlowResponseType as EmbeddedFlowResponseType2,
|
|
8860
8925
|
EmbeddedFlowType as EmbeddedFlowType2,
|
|
8861
|
-
Platform as
|
|
8926
|
+
Platform as Platform5
|
|
8862
8927
|
} from "@asgardeo/browser";
|
|
8863
|
-
import { jsx as
|
|
8928
|
+
import { jsx as jsx68 } from "react/jsx-runtime";
|
|
8864
8929
|
var SignUp = ({
|
|
8865
8930
|
className,
|
|
8866
8931
|
size = "medium",
|
|
@@ -8875,7 +8940,7 @@ var SignUp = ({
|
|
|
8875
8940
|
const handleInitialize = async (payload) => {
|
|
8876
8941
|
const initialPayload = payload || {
|
|
8877
8942
|
flowType: EmbeddedFlowType2.Registration,
|
|
8878
|
-
...platform ===
|
|
8943
|
+
...platform === Platform5.AsgardeoV2 && applicationId && { applicationId }
|
|
8879
8944
|
};
|
|
8880
8945
|
return await signUp(initialPayload);
|
|
8881
8946
|
};
|
|
@@ -8890,7 +8955,7 @@ var SignUp = ({
|
|
|
8890
8955
|
window.location.href = response.data.redirectURL;
|
|
8891
8956
|
}
|
|
8892
8957
|
};
|
|
8893
|
-
return /* @__PURE__ */
|
|
8958
|
+
return /* @__PURE__ */ jsx68(
|
|
8894
8959
|
BaseSignUp_default,
|
|
8895
8960
|
{
|
|
8896
8961
|
afterSignUpUrl,
|
|
@@ -8909,41 +8974,41 @@ var SignUp = ({
|
|
|
8909
8974
|
var SignUp_default = SignUp;
|
|
8910
8975
|
|
|
8911
8976
|
// src/components/presentation/User/BaseUser.tsx
|
|
8912
|
-
import { Fragment as Fragment13, jsx as
|
|
8977
|
+
import { Fragment as Fragment13, jsx as jsx69 } from "react/jsx-runtime";
|
|
8913
8978
|
var BaseUser = ({ user, children, fallback = null }) => {
|
|
8914
8979
|
if (!user) {
|
|
8915
|
-
return /* @__PURE__ */
|
|
8980
|
+
return /* @__PURE__ */ jsx69(Fragment13, { children: fallback });
|
|
8916
8981
|
}
|
|
8917
|
-
return /* @__PURE__ */
|
|
8982
|
+
return /* @__PURE__ */ jsx69(Fragment13, { children: children(user) });
|
|
8918
8983
|
};
|
|
8919
8984
|
BaseUser.displayName = "BaseUser";
|
|
8920
8985
|
var BaseUser_default = BaseUser;
|
|
8921
8986
|
|
|
8922
8987
|
// src/components/presentation/User/User.tsx
|
|
8923
|
-
import { jsx as
|
|
8988
|
+
import { jsx as jsx70 } from "react/jsx-runtime";
|
|
8924
8989
|
var User5 = ({ children, fallback = null }) => {
|
|
8925
8990
|
const { user } = useAsgardeo_default();
|
|
8926
|
-
return /* @__PURE__ */
|
|
8991
|
+
return /* @__PURE__ */ jsx70(BaseUser_default, { user, fallback, children });
|
|
8927
8992
|
};
|
|
8928
8993
|
User5.displayName = "User";
|
|
8929
8994
|
var User_default = User5;
|
|
8930
8995
|
|
|
8931
8996
|
// src/components/presentation/Organization/BaseOrganization.tsx
|
|
8932
|
-
import { Fragment as Fragment14, jsx as
|
|
8997
|
+
import { Fragment as Fragment14, jsx as jsx71 } from "react/jsx-runtime";
|
|
8933
8998
|
var BaseOrganization = ({ children, fallback = null, organization }) => {
|
|
8934
8999
|
if (!organization) {
|
|
8935
|
-
return /* @__PURE__ */
|
|
9000
|
+
return /* @__PURE__ */ jsx71(Fragment14, { children: fallback });
|
|
8936
9001
|
}
|
|
8937
|
-
return /* @__PURE__ */
|
|
9002
|
+
return /* @__PURE__ */ jsx71(Fragment14, { children: children(organization) });
|
|
8938
9003
|
};
|
|
8939
9004
|
BaseOrganization.displayName = "BaseOrganization";
|
|
8940
9005
|
var BaseOrganization_default = BaseOrganization;
|
|
8941
9006
|
|
|
8942
9007
|
// src/components/presentation/Organization/Organization.tsx
|
|
8943
|
-
import { jsx as
|
|
9008
|
+
import { jsx as jsx72 } from "react/jsx-runtime";
|
|
8944
9009
|
var Organization5 = ({ children, fallback = null }) => {
|
|
8945
9010
|
const { currentOrganization } = useOrganization_default();
|
|
8946
|
-
return /* @__PURE__ */
|
|
9011
|
+
return /* @__PURE__ */ jsx72(BaseOrganization_default, { organization: currentOrganization, fallback, children });
|
|
8947
9012
|
};
|
|
8948
9013
|
Organization5.displayName = "Organization";
|
|
8949
9014
|
var Organization_default = Organization5;
|
|
@@ -9049,7 +9114,7 @@ var useStyles19 = (theme, colorScheme, size, variant, backgroundColor) => {
|
|
|
9049
9114
|
var Avatar_styles_default = useStyles19;
|
|
9050
9115
|
|
|
9051
9116
|
// src/components/primitives/Avatar/Avatar.tsx
|
|
9052
|
-
import { jsx as
|
|
9117
|
+
import { jsx as jsx73 } from "react/jsx-runtime";
|
|
9053
9118
|
var Avatar = ({
|
|
9054
9119
|
alt = "User avatar",
|
|
9055
9120
|
background = "random",
|
|
@@ -9096,25 +9161,25 @@ var Avatar = ({
|
|
|
9096
9161
|
const getInitials = (fullName) => fullName.split(" ").map((part) => part[0]).slice(0, 2).join("").toUpperCase();
|
|
9097
9162
|
const renderContent = () => {
|
|
9098
9163
|
if (imageUrl) {
|
|
9099
|
-
return /* @__PURE__ */
|
|
9164
|
+
return /* @__PURE__ */ jsx73("img", { src: imageUrl, alt, className: cx22(withVendorCSSClassPrefix22(bem16("avatar", "image")), styles.image) });
|
|
9100
9165
|
}
|
|
9101
9166
|
if (name) {
|
|
9102
9167
|
return getInitials(name);
|
|
9103
9168
|
}
|
|
9104
9169
|
if (isLoading) {
|
|
9105
|
-
return /* @__PURE__ */
|
|
9170
|
+
return /* @__PURE__ */ jsx73("div", { className: cx22(withVendorCSSClassPrefix22(bem16("avatar", "skeleton")), styles.skeleton) });
|
|
9106
9171
|
}
|
|
9107
|
-
return /* @__PURE__ */
|
|
9172
|
+
return /* @__PURE__ */ jsx73(
|
|
9108
9173
|
"svg",
|
|
9109
9174
|
{
|
|
9110
9175
|
xmlns: "http://www.w3.org/2000/svg",
|
|
9111
9176
|
viewBox: "0 0 640 640",
|
|
9112
9177
|
className: cx22(withVendorCSSClassPrefix22(bem16("avatar", "icon")), styles.icon),
|
|
9113
|
-
children: /* @__PURE__ */
|
|
9178
|
+
children: /* @__PURE__ */ jsx73("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" })
|
|
9114
9179
|
}
|
|
9115
9180
|
);
|
|
9116
9181
|
};
|
|
9117
|
-
return /* @__PURE__ */
|
|
9182
|
+
return /* @__PURE__ */ jsx73(
|
|
9118
9183
|
"div",
|
|
9119
9184
|
{
|
|
9120
9185
|
className: cx22(
|
|
@@ -9149,7 +9214,7 @@ import { cx as cx23 } from "@emotion/css";
|
|
|
9149
9214
|
import React2 from "react";
|
|
9150
9215
|
|
|
9151
9216
|
// src/components/primitives/Icons/LogOut.tsx
|
|
9152
|
-
import { jsx as
|
|
9217
|
+
import { jsx as jsx74, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
9153
9218
|
var LogOut = (props) => /* @__PURE__ */ jsxs29(
|
|
9154
9219
|
"svg",
|
|
9155
9220
|
{
|
|
@@ -9164,16 +9229,16 @@ var LogOut = (props) => /* @__PURE__ */ jsxs29(
|
|
|
9164
9229
|
strokeLinejoin: "round",
|
|
9165
9230
|
...props,
|
|
9166
9231
|
children: [
|
|
9167
|
-
/* @__PURE__ */
|
|
9168
|
-
/* @__PURE__ */
|
|
9169
|
-
/* @__PURE__ */
|
|
9232
|
+
/* @__PURE__ */ jsx74("path", { d: "m16 17 5-5-5-5" }),
|
|
9233
|
+
/* @__PURE__ */ jsx74("path", { d: "M21 12H9" }),
|
|
9234
|
+
/* @__PURE__ */ jsx74("path", { d: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" })
|
|
9170
9235
|
]
|
|
9171
9236
|
}
|
|
9172
9237
|
);
|
|
9173
9238
|
var LogOut_default = LogOut;
|
|
9174
9239
|
|
|
9175
9240
|
// src/components/primitives/Icons/Plus.tsx
|
|
9176
|
-
import { jsx as
|
|
9241
|
+
import { jsx as jsx75, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
9177
9242
|
var Plus = (props) => /* @__PURE__ */ jsxs30(
|
|
9178
9243
|
"svg",
|
|
9179
9244
|
{
|
|
@@ -9188,15 +9253,15 @@ var Plus = (props) => /* @__PURE__ */ jsxs30(
|
|
|
9188
9253
|
strokeLinejoin: "round",
|
|
9189
9254
|
...props,
|
|
9190
9255
|
children: [
|
|
9191
|
-
/* @__PURE__ */
|
|
9192
|
-
/* @__PURE__ */
|
|
9256
|
+
/* @__PURE__ */ jsx75("path", { d: "M5 12h14" }),
|
|
9257
|
+
/* @__PURE__ */ jsx75("path", { d: "M12 5v14" })
|
|
9193
9258
|
]
|
|
9194
9259
|
}
|
|
9195
9260
|
);
|
|
9196
9261
|
var Plus_default = Plus;
|
|
9197
9262
|
|
|
9198
9263
|
// src/components/primitives/Icons/User.tsx
|
|
9199
|
-
import { jsx as
|
|
9264
|
+
import { jsx as jsx76, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
9200
9265
|
var User7 = (props) => /* @__PURE__ */ jsxs31(
|
|
9201
9266
|
"svg",
|
|
9202
9267
|
{
|
|
@@ -9211,15 +9276,15 @@ var User7 = (props) => /* @__PURE__ */ jsxs31(
|
|
|
9211
9276
|
strokeLinejoin: "round",
|
|
9212
9277
|
...props,
|
|
9213
9278
|
children: [
|
|
9214
|
-
/* @__PURE__ */
|
|
9215
|
-
/* @__PURE__ */
|
|
9279
|
+
/* @__PURE__ */ jsx76("path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" }),
|
|
9280
|
+
/* @__PURE__ */ jsx76("circle", { cx: "12", cy: "7", r: "4" })
|
|
9216
9281
|
]
|
|
9217
9282
|
}
|
|
9218
9283
|
);
|
|
9219
9284
|
var User_default2 = User7;
|
|
9220
9285
|
|
|
9221
9286
|
// src/components/primitives/Icons/X.tsx
|
|
9222
|
-
import { jsx as
|
|
9287
|
+
import { jsx as jsx77, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
9223
9288
|
var X = (props) => /* @__PURE__ */ jsxs32(
|
|
9224
9289
|
"svg",
|
|
9225
9290
|
{
|
|
@@ -9234,8 +9299,8 @@ var X = (props) => /* @__PURE__ */ jsxs32(
|
|
|
9234
9299
|
strokeLinejoin: "round",
|
|
9235
9300
|
...props,
|
|
9236
9301
|
children: [
|
|
9237
|
-
/* @__PURE__ */
|
|
9238
|
-
/* @__PURE__ */
|
|
9302
|
+
/* @__PURE__ */ jsx77("path", { d: "M18 6 6 18" }),
|
|
9303
|
+
/* @__PURE__ */ jsx77("path", { d: "m6 6 12 12" })
|
|
9239
9304
|
]
|
|
9240
9305
|
}
|
|
9241
9306
|
);
|
|
@@ -9307,7 +9372,7 @@ var useStyles20 = (theme, colorScheme) => {
|
|
|
9307
9372
|
var Dialog_styles_default = useStyles20;
|
|
9308
9373
|
|
|
9309
9374
|
// src/components/primitives/Dialog/Dialog.tsx
|
|
9310
|
-
import { jsx as
|
|
9375
|
+
import { jsx as jsx78, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
9311
9376
|
function useDialog({
|
|
9312
9377
|
initialOpen = false,
|
|
9313
9378
|
open: controlledOpen,
|
|
@@ -9353,7 +9418,7 @@ var useDialogContext = () => {
|
|
|
9353
9418
|
};
|
|
9354
9419
|
function Dialog({ children, ...options }) {
|
|
9355
9420
|
const dialog = useDialog(options);
|
|
9356
|
-
return /* @__PURE__ */
|
|
9421
|
+
return /* @__PURE__ */ jsx78(DialogContext.Provider, { value: dialog, children });
|
|
9357
9422
|
}
|
|
9358
9423
|
var DialogTrigger = React2.forwardRef(
|
|
9359
9424
|
({ children, asChild = false, ...props }, propRef) => {
|
|
@@ -9371,7 +9436,7 @@ var DialogTrigger = React2.forwardRef(
|
|
|
9371
9436
|
})
|
|
9372
9437
|
);
|
|
9373
9438
|
}
|
|
9374
|
-
return /* @__PURE__ */
|
|
9439
|
+
return /* @__PURE__ */ jsx78("button", { ref, "data-state": context.open ? "open" : "closed", ...context.getReferenceProps(props), children });
|
|
9375
9440
|
}
|
|
9376
9441
|
);
|
|
9377
9442
|
var DialogContent = React2.forwardRef((props, propRef) => {
|
|
@@ -9380,7 +9445,7 @@ var DialogContent = React2.forwardRef((props, propRef) => {
|
|
|
9380
9445
|
const styles = Dialog_styles_default(theme, colorScheme);
|
|
9381
9446
|
const ref = useMergeRefs([context.refs.setFloating, propRef]);
|
|
9382
9447
|
if (!floatingContext.open) return null;
|
|
9383
|
-
return /* @__PURE__ */
|
|
9448
|
+
return /* @__PURE__ */ jsx78(FloatingPortal, { children: /* @__PURE__ */ jsx78(FloatingOverlay, { className: cx23(withVendorCSSClassPrefix23(bem17("dialog", "overlay")), styles.overlay), lockScroll: true, children: /* @__PURE__ */ jsx78(FloatingFocusManager, { context: floatingContext, initialFocus: -1, children: /* @__PURE__ */ jsx78(
|
|
9384
9449
|
"div",
|
|
9385
9450
|
{
|
|
9386
9451
|
ref,
|
|
@@ -9403,7 +9468,7 @@ var DialogHeading = React2.forwardRef(
|
|
|
9403
9468
|
return () => context.setLabelId(void 0);
|
|
9404
9469
|
}, [id, context.setLabelId]);
|
|
9405
9470
|
return /* @__PURE__ */ jsxs33("div", { className: cx23(withVendorCSSClassPrefix23(bem17("dialog", "header")), styles.header), children: [
|
|
9406
|
-
/* @__PURE__ */
|
|
9471
|
+
/* @__PURE__ */ jsx78(
|
|
9407
9472
|
"h2",
|
|
9408
9473
|
{
|
|
9409
9474
|
...props,
|
|
@@ -9413,7 +9478,7 @@ var DialogHeading = React2.forwardRef(
|
|
|
9413
9478
|
children
|
|
9414
9479
|
}
|
|
9415
9480
|
),
|
|
9416
|
-
/* @__PURE__ */
|
|
9481
|
+
/* @__PURE__ */ jsx78(
|
|
9417
9482
|
Button_default,
|
|
9418
9483
|
{
|
|
9419
9484
|
color: "tertiary",
|
|
@@ -9422,7 +9487,7 @@ var DialogHeading = React2.forwardRef(
|
|
|
9422
9487
|
shape: "round",
|
|
9423
9488
|
onClick: () => context.setOpen(false),
|
|
9424
9489
|
"aria-label": "Close",
|
|
9425
|
-
children: /* @__PURE__ */
|
|
9490
|
+
children: /* @__PURE__ */ jsx78(X_default, { width: 16, height: 16 })
|
|
9426
9491
|
}
|
|
9427
9492
|
)
|
|
9428
9493
|
] });
|
|
@@ -9438,7 +9503,7 @@ var DialogDescription = React2.forwardRef(
|
|
|
9438
9503
|
context.setDescriptionId(id);
|
|
9439
9504
|
return () => context.setDescriptionId(void 0);
|
|
9440
9505
|
}, [id, context.setDescriptionId]);
|
|
9441
|
-
return /* @__PURE__ */
|
|
9506
|
+
return /* @__PURE__ */ jsx78(
|
|
9442
9507
|
"p",
|
|
9443
9508
|
{
|
|
9444
9509
|
...props,
|
|
@@ -9468,7 +9533,7 @@ var DialogClose = React2.forwardRef(({ children, asChild = false, ...props }, pr
|
|
|
9468
9533
|
onClick: handleClick
|
|
9469
9534
|
});
|
|
9470
9535
|
}
|
|
9471
|
-
return /* @__PURE__ */
|
|
9536
|
+
return /* @__PURE__ */ jsx78(
|
|
9472
9537
|
Button_default,
|
|
9473
9538
|
{
|
|
9474
9539
|
...props,
|
|
@@ -9591,7 +9656,7 @@ var useStyles21 = (theme, colorScheme, disabled, hasError, canAddMore, canRemove
|
|
|
9591
9656
|
var MultiInput_styles_default = useStyles21;
|
|
9592
9657
|
|
|
9593
9658
|
// src/components/primitives/MultiInput/MultiInput.tsx
|
|
9594
|
-
import { jsx as
|
|
9659
|
+
import { jsx as jsx79, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
9595
9660
|
var MultiInput = ({
|
|
9596
9661
|
label,
|
|
9597
9662
|
error,
|
|
@@ -9614,8 +9679,8 @@ var MultiInput = ({
|
|
|
9614
9679
|
const canAddMore = !maxFields || values.length < maxFields;
|
|
9615
9680
|
const canRemove = values.length > minFields;
|
|
9616
9681
|
const styles = MultiInput_styles_default(theme, colorScheme, !!disabled, !!error, canAddMore, canRemove);
|
|
9617
|
-
const PlusIcon = ({ className: className2 }) => /* @__PURE__ */
|
|
9618
|
-
const BinIcon = ({ className: className2 }) => /* @__PURE__ */
|
|
9682
|
+
const PlusIcon = ({ className: className2 }) => /* @__PURE__ */ jsx79("svg", { width: "16", height: "16", viewBox: "0 0 24 24", className: cx24(styles.icon, className2), children: /* @__PURE__ */ jsx79("path", { d: "M12 5v14M5 12h14" }) });
|
|
9683
|
+
const BinIcon = ({ className: className2 }) => /* @__PURE__ */ jsx79("svg", { width: "16", height: "16", viewBox: "0 0 24 24", className: cx24(styles.icon, className2), children: /* @__PURE__ */ jsx79("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" }) });
|
|
9619
9684
|
const handleAddValue = useCallback12(
|
|
9620
9685
|
(newValue) => {
|
|
9621
9686
|
if (newValue.trim() !== "" && (!maxFields || values.length < maxFields)) {
|
|
@@ -9659,9 +9724,9 @@ var MultiInput = ({
|
|
|
9659
9724
|
};
|
|
9660
9725
|
switch (fieldType) {
|
|
9661
9726
|
case "DATE_TIME":
|
|
9662
|
-
return /* @__PURE__ */
|
|
9727
|
+
return /* @__PURE__ */ jsx79(DatePicker_default, { ...commonProps });
|
|
9663
9728
|
case "BOOLEAN":
|
|
9664
|
-
return /* @__PURE__ */
|
|
9729
|
+
return /* @__PURE__ */ jsx79(
|
|
9665
9730
|
Checkbox_default,
|
|
9666
9731
|
{
|
|
9667
9732
|
...commonProps,
|
|
@@ -9670,7 +9735,7 @@ var MultiInput = ({
|
|
|
9670
9735
|
}
|
|
9671
9736
|
);
|
|
9672
9737
|
default:
|
|
9673
|
-
return /* @__PURE__ */
|
|
9738
|
+
return /* @__PURE__ */ jsx79(TextField_default, { ...commonProps, type });
|
|
9674
9739
|
}
|
|
9675
9740
|
},
|
|
9676
9741
|
[placeholder, disabled, startIcon, endIcon, error, fieldType, type]
|
|
@@ -9690,27 +9755,27 @@ var MultiInput = ({
|
|
|
9690
9755
|
className: cx24(withVendorCSSClassPrefix24(bem18("multi-input")), className),
|
|
9691
9756
|
style,
|
|
9692
9757
|
children: [
|
|
9693
|
-
label && /* @__PURE__ */
|
|
9758
|
+
label && /* @__PURE__ */ jsx79(InputLabel_default, { required, error: !!error, children: label }),
|
|
9694
9759
|
/* @__PURE__ */ jsxs34("div", { className: cx24(withVendorCSSClassPrefix24(bem18("multi-input", "container")), styles.container), children: [
|
|
9695
|
-
/* @__PURE__ */
|
|
9760
|
+
/* @__PURE__ */ jsx79("div", { className: cx24(withVendorCSSClassPrefix24(bem18("multi-input", "input-row")), styles.inputRow), children: /* @__PURE__ */ jsx79("div", { className: cx24(withVendorCSSClassPrefix24(bem18("multi-input", "input-wrapper")), styles.inputWrapper), children: renderInputField(
|
|
9696
9761
|
currentInputValue,
|
|
9697
9762
|
setCurrentInputValue,
|
|
9698
|
-
canAddMore ? /* @__PURE__ */
|
|
9763
|
+
canAddMore ? /* @__PURE__ */ jsx79(PlusIcon, { className: styles.plusIcon }) : void 0,
|
|
9699
9764
|
canAddMore ? handleInputSubmit : void 0
|
|
9700
9765
|
) }) }),
|
|
9701
|
-
values.length > 0 && /* @__PURE__ */
|
|
9766
|
+
values.length > 0 && /* @__PURE__ */ jsx79("div", { className: cx24(withVendorCSSClassPrefix24(bem18("multi-input", "list-container")), styles.listContainer), children: values.map((value, index) => /* @__PURE__ */ jsxs34(
|
|
9702
9767
|
"div",
|
|
9703
9768
|
{
|
|
9704
9769
|
className: cx24(withVendorCSSClassPrefix24(bem18("multi-input", "list-item")), styles.listItem),
|
|
9705
9770
|
children: [
|
|
9706
|
-
/* @__PURE__ */
|
|
9771
|
+
/* @__PURE__ */ jsx79(
|
|
9707
9772
|
"span",
|
|
9708
9773
|
{
|
|
9709
9774
|
className: cx24(withVendorCSSClassPrefix24(bem18("multi-input", "list-item-text")), styles.listItemText),
|
|
9710
9775
|
children: value
|
|
9711
9776
|
}
|
|
9712
9777
|
),
|
|
9713
|
-
canRemove && /* @__PURE__ */
|
|
9778
|
+
canRemove && /* @__PURE__ */ jsx79(
|
|
9714
9779
|
"button",
|
|
9715
9780
|
{
|
|
9716
9781
|
type: "button",
|
|
@@ -9718,7 +9783,7 @@ var MultiInput = ({
|
|
|
9718
9783
|
disabled,
|
|
9719
9784
|
className: cx24(withVendorCSSClassPrefix24(bem18("multi-input", "remove-button")), styles.removeButton),
|
|
9720
9785
|
title: "Remove value",
|
|
9721
|
-
children: /* @__PURE__ */
|
|
9786
|
+
children: /* @__PURE__ */ jsx79(BinIcon, { className: styles.icon })
|
|
9722
9787
|
}
|
|
9723
9788
|
)
|
|
9724
9789
|
]
|
|
@@ -9917,7 +9982,7 @@ var getDisplayName = (mergedMappings, user) => {
|
|
|
9917
9982
|
var getDisplayName_default = getDisplayName;
|
|
9918
9983
|
|
|
9919
9984
|
// src/components/presentation/UserProfile/BaseUserProfile.tsx
|
|
9920
|
-
import { Fragment as Fragment15, jsx as
|
|
9985
|
+
import { Fragment as Fragment15, jsx as jsx80, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
9921
9986
|
var fieldsToSkip = [
|
|
9922
9987
|
"roles.default",
|
|
9923
9988
|
"active",
|
|
@@ -9977,7 +10042,7 @@ var BaseUserProfile = ({
|
|
|
9977
10042
|
},
|
|
9978
10043
|
[showFields, hideFields]
|
|
9979
10044
|
);
|
|
9980
|
-
const PencilIcon = () => /* @__PURE__ */
|
|
10045
|
+
const PencilIcon = () => /* @__PURE__ */ jsx80(
|
|
9981
10046
|
"svg",
|
|
9982
10047
|
{
|
|
9983
10048
|
width: "16",
|
|
@@ -9988,7 +10053,7 @@ var BaseUserProfile = ({
|
|
|
9988
10053
|
strokeWidth: "2",
|
|
9989
10054
|
strokeLinecap: "round",
|
|
9990
10055
|
strokeLinejoin: "round",
|
|
9991
|
-
children: /* @__PURE__ */
|
|
10056
|
+
children: /* @__PURE__ */ jsx80("path", { d: "M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z" })
|
|
9992
10057
|
}
|
|
9993
10058
|
);
|
|
9994
10059
|
const toggleFieldEdit = useCallback13((fieldName) => {
|
|
@@ -10013,12 +10078,12 @@ var BaseUserProfile = ({
|
|
|
10013
10078
|
}, []);
|
|
10014
10079
|
const ObjectDisplay = ({ data }) => {
|
|
10015
10080
|
if (!data || typeof data !== "object") return null;
|
|
10016
|
-
return /* @__PURE__ */
|
|
10017
|
-
/* @__PURE__ */
|
|
10081
|
+
return /* @__PURE__ */ jsx80("table", { className: styles.value, children: /* @__PURE__ */ jsx80("tbody", { children: Object.entries(data).map(([key, value]) => /* @__PURE__ */ jsxs35("tr", { children: [
|
|
10082
|
+
/* @__PURE__ */ jsx80("td", { className: styles.objectKey, children: /* @__PURE__ */ jsxs35("strong", { children: [
|
|
10018
10083
|
formatLabel(key),
|
|
10019
10084
|
":"
|
|
10020
10085
|
] }) }),
|
|
10021
|
-
/* @__PURE__ */
|
|
10086
|
+
/* @__PURE__ */ jsx80("td", { className: styles.objectValue, children: typeof value === "object" ? /* @__PURE__ */ jsx80(ObjectDisplay, { data: value }) : String(value) })
|
|
10022
10087
|
] }, key)) }) });
|
|
10023
10088
|
};
|
|
10024
10089
|
function set(obj, path, value) {
|
|
@@ -10091,9 +10156,9 @@ var BaseUserProfile = ({
|
|
|
10091
10156
|
const { value, displayName, description, name, type, required, mutability, subAttributes, multiValued } = schema;
|
|
10092
10157
|
const label = displayName || description || name || "";
|
|
10093
10158
|
if (subAttributes && Array.isArray(subAttributes)) {
|
|
10094
|
-
return /* @__PURE__ */
|
|
10095
|
-
/* @__PURE__ */
|
|
10096
|
-
/* @__PURE__ */
|
|
10159
|
+
return /* @__PURE__ */ jsx80(Fragment15, { children: subAttributes.map((subAttr, index) => /* @__PURE__ */ jsxs35("div", { className: styles.field, children: [
|
|
10160
|
+
/* @__PURE__ */ jsx80("span", { className: styles.label, children: subAttr.displayName || subAttr.description || "" }),
|
|
10161
|
+
/* @__PURE__ */ jsx80("div", { className: styles.value, children: Array.isArray(subAttr.value) ? subAttr.value.map((item) => typeof item === "object" ? JSON.stringify(item) : String(item)).join(", ") : typeof subAttr.value === "object" ? JSON.stringify(subAttr.value) : String(subAttr.value) })
|
|
10097
10162
|
] }, index)) });
|
|
10098
10163
|
}
|
|
10099
10164
|
if (Array.isArray(value) || multiValued) {
|
|
@@ -10110,8 +10175,8 @@ var BaseUserProfile = ({
|
|
|
10110
10175
|
fieldValues = [];
|
|
10111
10176
|
}
|
|
10112
10177
|
return /* @__PURE__ */ jsxs35(Fragment15, { children: [
|
|
10113
|
-
/* @__PURE__ */
|
|
10114
|
-
/* @__PURE__ */
|
|
10178
|
+
/* @__PURE__ */ jsx80("span", { className: styles.label, children: label }),
|
|
10179
|
+
/* @__PURE__ */ jsx80("div", { className: styles.value, children: /* @__PURE__ */ jsx80(
|
|
10115
10180
|
MultiInput_default,
|
|
10116
10181
|
{
|
|
10117
10182
|
values: fieldValues,
|
|
@@ -10143,8 +10208,8 @@ var BaseUserProfile = ({
|
|
|
10143
10208
|
displayValue2 = "-";
|
|
10144
10209
|
}
|
|
10145
10210
|
return /* @__PURE__ */ jsxs35(Fragment15, { children: [
|
|
10146
|
-
/* @__PURE__ */
|
|
10147
|
-
/* @__PURE__ */
|
|
10211
|
+
/* @__PURE__ */ jsx80("span", { className: styles.label, children: label }),
|
|
10212
|
+
/* @__PURE__ */ jsx80("div", { className: cx25(styles.value, !hasValues ? styles.valuePlaceholder : ""), children: !hasValues && isEditable2 && onStartEdit ? /* @__PURE__ */ jsx80(
|
|
10148
10213
|
Button_default,
|
|
10149
10214
|
{
|
|
10150
10215
|
onClick: onStartEdit,
|
|
@@ -10159,7 +10224,7 @@ var BaseUserProfile = ({
|
|
|
10159
10224
|
] });
|
|
10160
10225
|
}
|
|
10161
10226
|
if (type === "COMPLEX" && typeof value === "object") {
|
|
10162
|
-
return /* @__PURE__ */
|
|
10227
|
+
return /* @__PURE__ */ jsx80(ObjectDisplay, { data: value });
|
|
10163
10228
|
}
|
|
10164
10229
|
if (isEditing && onEditValue && mutability !== "READ_ONLY" && !readonlyFields.includes(name || "")) {
|
|
10165
10230
|
const fieldValue = editedUser && name && editedUser[name] !== void 0 ? editedUser[name] : flattenedProfile && name && flattenedProfile[name] !== void 0 ? flattenedProfile[name] : value || "";
|
|
@@ -10174,16 +10239,16 @@ var BaseUserProfile = ({
|
|
|
10174
10239
|
let field;
|
|
10175
10240
|
switch (type) {
|
|
10176
10241
|
case "STRING":
|
|
10177
|
-
field = /* @__PURE__ */
|
|
10242
|
+
field = /* @__PURE__ */ jsx80(TextField_default, { ...commonProps });
|
|
10178
10243
|
break;
|
|
10179
10244
|
case "DATE_TIME":
|
|
10180
|
-
field = /* @__PURE__ */
|
|
10245
|
+
field = /* @__PURE__ */ jsx80(DatePicker_default, { ...commonProps });
|
|
10181
10246
|
break;
|
|
10182
10247
|
case "BOOLEAN":
|
|
10183
|
-
field = /* @__PURE__ */
|
|
10248
|
+
field = /* @__PURE__ */ jsx80(Checkbox_default, { ...commonProps, checked: !!fieldValue, onChange: (e) => onEditValue(e.target.checked) });
|
|
10184
10249
|
break;
|
|
10185
10250
|
case "COMPLEX":
|
|
10186
|
-
field = /* @__PURE__ */
|
|
10251
|
+
field = /* @__PURE__ */ jsx80(
|
|
10187
10252
|
"textarea",
|
|
10188
10253
|
{
|
|
10189
10254
|
value: fieldValue,
|
|
@@ -10195,11 +10260,11 @@ var BaseUserProfile = ({
|
|
|
10195
10260
|
);
|
|
10196
10261
|
break;
|
|
10197
10262
|
default:
|
|
10198
|
-
field = /* @__PURE__ */
|
|
10263
|
+
field = /* @__PURE__ */ jsx80(TextField_default, { ...commonProps });
|
|
10199
10264
|
}
|
|
10200
10265
|
return /* @__PURE__ */ jsxs35(Fragment15, { children: [
|
|
10201
|
-
/* @__PURE__ */
|
|
10202
|
-
/* @__PURE__ */
|
|
10266
|
+
/* @__PURE__ */ jsx80("span", { className: styles.label, children: label }),
|
|
10267
|
+
/* @__PURE__ */ jsx80("div", { className: styles.value, children: field })
|
|
10203
10268
|
] });
|
|
10204
10269
|
}
|
|
10205
10270
|
const hasValue = value !== void 0 && value !== null && value !== "";
|
|
@@ -10213,8 +10278,8 @@ var BaseUserProfile = ({
|
|
|
10213
10278
|
displayValue = "-";
|
|
10214
10279
|
}
|
|
10215
10280
|
return /* @__PURE__ */ jsxs35(Fragment15, { children: [
|
|
10216
|
-
/* @__PURE__ */
|
|
10217
|
-
/* @__PURE__ */
|
|
10281
|
+
/* @__PURE__ */ jsx80("span", { className: styles.label, children: label }),
|
|
10282
|
+
/* @__PURE__ */ jsx80("div", { className: cx25(styles.value, !hasValue ? styles.valuePlaceholder : ""), children: !hasValue && isEditable && onStartEdit ? /* @__PURE__ */ jsx80(
|
|
10218
10283
|
Button_default,
|
|
10219
10284
|
{
|
|
10220
10285
|
onClick: onStartEdit,
|
|
@@ -10243,7 +10308,7 @@ var BaseUserProfile = ({
|
|
|
10243
10308
|
gap: theme.vars.spacing.unit
|
|
10244
10309
|
};
|
|
10245
10310
|
return /* @__PURE__ */ jsxs35("div", { className: styles.field, children: [
|
|
10246
|
-
/* @__PURE__ */
|
|
10311
|
+
/* @__PURE__ */ jsx80("div", { className: styles.fieldInner, children: renderSchemaField(
|
|
10247
10312
|
schema,
|
|
10248
10313
|
isFieldEditing,
|
|
10249
10314
|
(value) => {
|
|
@@ -10255,10 +10320,10 @@ var BaseUserProfile = ({
|
|
|
10255
10320
|
) }),
|
|
10256
10321
|
editable && schema.mutability !== "READ_ONLY" && !isReadonlyField && /* @__PURE__ */ jsxs35("div", { className: styles.fieldActions, children: [
|
|
10257
10322
|
isFieldEditing && /* @__PURE__ */ jsxs35(Fragment15, { children: [
|
|
10258
|
-
/* @__PURE__ */
|
|
10259
|
-
/* @__PURE__ */
|
|
10323
|
+
/* @__PURE__ */ jsx80(Button_default, { size: "small", color: "primary", variant: "solid", onClick: () => handleFieldSave(schema), children: "Save" }),
|
|
10324
|
+
/* @__PURE__ */ jsx80(Button_default, { size: "small", color: "secondary", variant: "solid", onClick: () => handleFieldCancel(schema.name), children: "Cancel" })
|
|
10260
10325
|
] }),
|
|
10261
|
-
!isFieldEditing && hasValue && /* @__PURE__ */
|
|
10326
|
+
!isFieldEditing && hasValue && /* @__PURE__ */ jsx80(
|
|
10262
10327
|
Button_default,
|
|
10263
10328
|
{
|
|
10264
10329
|
size: "small",
|
|
@@ -10267,7 +10332,7 @@ var BaseUserProfile = ({
|
|
|
10267
10332
|
onClick: () => toggleFieldEdit(schema.name),
|
|
10268
10333
|
title: "Edit",
|
|
10269
10334
|
className: styles.editButton,
|
|
10270
|
-
children: /* @__PURE__ */
|
|
10335
|
+
children: /* @__PURE__ */ jsx80(PencilIcon, {})
|
|
10271
10336
|
}
|
|
10272
10337
|
)
|
|
10273
10338
|
] })
|
|
@@ -10291,17 +10356,17 @@ var BaseUserProfile = ({
|
|
|
10291
10356
|
if (!shouldShowField(key)) return false;
|
|
10292
10357
|
return value !== void 0 && value !== "" && value !== null;
|
|
10293
10358
|
}).sort(([a], [b]) => a.localeCompare(b));
|
|
10294
|
-
return /* @__PURE__ */
|
|
10295
|
-
/* @__PURE__ */
|
|
10296
|
-
/* @__PURE__ */
|
|
10359
|
+
return /* @__PURE__ */ jsx80(Fragment15, { children: profileEntries.map(([key, value]) => /* @__PURE__ */ jsxs35("div", { className: styles.field, children: [
|
|
10360
|
+
/* @__PURE__ */ jsx80("span", { className: styles.label, children: formatLabel(key) }),
|
|
10361
|
+
/* @__PURE__ */ jsx80("div", { className: styles.value, children: typeof value === "object" ? JSON.stringify(value, null, 2) : String(value) })
|
|
10297
10362
|
] }, key)) });
|
|
10298
10363
|
};
|
|
10299
10364
|
const profileContent = /* @__PURE__ */ jsxs35(Card_default, { className: containerClasses, children: [
|
|
10300
10365
|
error && /* @__PURE__ */ jsxs35(Alert_default, { variant: "error", className: cx25(withVendorCSSClassPrefix26(bem19("user-profile", "alert")), styles.alert), children: [
|
|
10301
|
-
/* @__PURE__ */
|
|
10302
|
-
/* @__PURE__ */
|
|
10366
|
+
/* @__PURE__ */ jsx80(Alert_default.Title, { children: t("errors.title") || "Error" }),
|
|
10367
|
+
/* @__PURE__ */ jsx80(Alert_default.Description, { children: error })
|
|
10303
10368
|
] }),
|
|
10304
|
-
/* @__PURE__ */
|
|
10369
|
+
/* @__PURE__ */ jsx80("div", { className: styles.header, children: /* @__PURE__ */ jsx80(
|
|
10305
10370
|
Avatar,
|
|
10306
10371
|
{
|
|
10307
10372
|
imageUrl: getMappedUserProfileValue_default("picture", mergedMappings, currentUser),
|
|
@@ -10311,7 +10376,7 @@ var BaseUserProfile = ({
|
|
|
10311
10376
|
isLoading
|
|
10312
10377
|
}
|
|
10313
10378
|
) }),
|
|
10314
|
-
/* @__PURE__ */
|
|
10379
|
+
/* @__PURE__ */ jsx80("div", { className: styles.infoContainer, children: schemas && schemas.length > 0 ? schemas.filter((schema) => {
|
|
10315
10380
|
if (!schema.name || !shouldShowField(schema.name)) return false;
|
|
10316
10381
|
if (!editable) {
|
|
10317
10382
|
const value = flattenedProfile && schema.name ? flattenedProfile[schema.name] : void 0;
|
|
@@ -10328,13 +10393,13 @@ var BaseUserProfile = ({
|
|
|
10328
10393
|
...schema,
|
|
10329
10394
|
value
|
|
10330
10395
|
};
|
|
10331
|
-
return /* @__PURE__ */
|
|
10396
|
+
return /* @__PURE__ */ jsx80("div", { className: styles.info, children: renderUserInfo(schemaWithValue) }, schema.name || index);
|
|
10332
10397
|
}) : renderProfileWithoutSchemas() })
|
|
10333
10398
|
] });
|
|
10334
10399
|
if (mode === "popup") {
|
|
10335
|
-
return /* @__PURE__ */
|
|
10336
|
-
/* @__PURE__ */
|
|
10337
|
-
/* @__PURE__ */
|
|
10400
|
+
return /* @__PURE__ */ jsx80(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs35(Dialog_default.Content, { children: [
|
|
10401
|
+
/* @__PURE__ */ jsx80(Dialog_default.Heading, { children: title ?? t("user.profile.title") }),
|
|
10402
|
+
/* @__PURE__ */ jsx80("div", { className: styles.popup, children: profileContent })
|
|
10338
10403
|
] }) });
|
|
10339
10404
|
}
|
|
10340
10405
|
return profileContent;
|
|
@@ -10375,7 +10440,7 @@ var updateMeProfile_default = updateMeProfile;
|
|
|
10375
10440
|
|
|
10376
10441
|
// src/components/presentation/UserProfile/UserProfile.tsx
|
|
10377
10442
|
import { AsgardeoError } from "@asgardeo/browser";
|
|
10378
|
-
import { jsx as
|
|
10443
|
+
import { jsx as jsx81 } from "react/jsx-runtime";
|
|
10379
10444
|
var UserProfile3 = ({ ...rest }) => {
|
|
10380
10445
|
const { baseUrl, isLoading } = useAsgardeo_default();
|
|
10381
10446
|
const { profile, flattenedProfile, schemas, onUpdateProfile } = useUser_default();
|
|
@@ -10394,7 +10459,7 @@ var UserProfile3 = ({ ...rest }) => {
|
|
|
10394
10459
|
setError(message);
|
|
10395
10460
|
}
|
|
10396
10461
|
};
|
|
10397
|
-
return /* @__PURE__ */
|
|
10462
|
+
return /* @__PURE__ */ jsx81(
|
|
10398
10463
|
BaseUserProfile_default,
|
|
10399
10464
|
{
|
|
10400
10465
|
profile,
|
|
@@ -10611,7 +10676,7 @@ var useStyles23 = (theme, colorScheme) => {
|
|
|
10611
10676
|
var BaseUserDropdown_styles_default = useStyles23;
|
|
10612
10677
|
|
|
10613
10678
|
// src/components/presentation/UserDropdown/BaseUserDropdown.tsx
|
|
10614
|
-
import { jsx as
|
|
10679
|
+
import { jsx as jsx82, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
10615
10680
|
var BaseUserDropdown = ({
|
|
10616
10681
|
fallback = null,
|
|
10617
10682
|
className = "",
|
|
@@ -10665,14 +10730,14 @@ var BaseUserDropdown = ({
|
|
|
10665
10730
|
defaultMenuItems.push({
|
|
10666
10731
|
label: "Manage Profile",
|
|
10667
10732
|
onClick: onManageProfile,
|
|
10668
|
-
icon: /* @__PURE__ */
|
|
10733
|
+
icon: /* @__PURE__ */ jsx82(User_default2, { width: "16", height: "16" })
|
|
10669
10734
|
});
|
|
10670
10735
|
}
|
|
10671
10736
|
if (onSignOut) {
|
|
10672
10737
|
defaultMenuItems.push({
|
|
10673
10738
|
label: "Sign Out",
|
|
10674
10739
|
onClick: onSignOut,
|
|
10675
|
-
icon: /* @__PURE__ */
|
|
10740
|
+
icon: /* @__PURE__ */ jsx82(LogOut_default, { width: "16", height: "16" })
|
|
10676
10741
|
});
|
|
10677
10742
|
}
|
|
10678
10743
|
const allMenuItems = [...menuItems];
|
|
@@ -10693,7 +10758,7 @@ var BaseUserDropdown = ({
|
|
|
10693
10758
|
size: "medium",
|
|
10694
10759
|
...getReferenceProps(),
|
|
10695
10760
|
children: [
|
|
10696
|
-
/* @__PURE__ */
|
|
10761
|
+
/* @__PURE__ */ jsx82(
|
|
10697
10762
|
Avatar,
|
|
10698
10763
|
{
|
|
10699
10764
|
imageUrl: getMappedUserProfileValue_default("picture", mergedMappings, user),
|
|
@@ -10702,7 +10767,7 @@ var BaseUserDropdown = ({
|
|
|
10702
10767
|
alt: `${getDisplayName_default(mergedMappings, user)}'s avatar`
|
|
10703
10768
|
}
|
|
10704
10769
|
),
|
|
10705
|
-
showTriggerLabel && /* @__PURE__ */
|
|
10770
|
+
showTriggerLabel && /* @__PURE__ */ jsx82(
|
|
10706
10771
|
Typography_default,
|
|
10707
10772
|
{
|
|
10708
10773
|
variant: "body2",
|
|
@@ -10713,7 +10778,7 @@ var BaseUserDropdown = ({
|
|
|
10713
10778
|
]
|
|
10714
10779
|
}
|
|
10715
10780
|
),
|
|
10716
|
-
isOpen && /* @__PURE__ */
|
|
10781
|
+
isOpen && /* @__PURE__ */ jsx82(FloatingPortal2, { id: portalId, children: /* @__PURE__ */ jsx82(FloatingFocusManager2, { context, modal: false, initialFocus: -1, children: /* @__PURE__ */ jsxs36(
|
|
10717
10782
|
"div",
|
|
10718
10783
|
{
|
|
10719
10784
|
ref: refs.setFloating,
|
|
@@ -10727,7 +10792,7 @@ var BaseUserDropdown = ({
|
|
|
10727
10792
|
...getFloatingProps(),
|
|
10728
10793
|
children: [
|
|
10729
10794
|
/* @__PURE__ */ jsxs36("div", { className: cx26(withVendorCSSClassPrefix27("user-dropdown__header"), styles.dropdownHeader), children: [
|
|
10730
|
-
/* @__PURE__ */
|
|
10795
|
+
/* @__PURE__ */ jsx82(
|
|
10731
10796
|
Avatar,
|
|
10732
10797
|
{
|
|
10733
10798
|
imageUrl: getMappedUserProfileValue_default("picture", mergedMappings, user),
|
|
@@ -10737,7 +10802,7 @@ var BaseUserDropdown = ({
|
|
|
10737
10802
|
}
|
|
10738
10803
|
),
|
|
10739
10804
|
/* @__PURE__ */ jsxs36("div", { className: cx26(withVendorCSSClassPrefix27("user-dropdown__header-info"), styles.headerInfo), children: [
|
|
10740
|
-
/* @__PURE__ */
|
|
10805
|
+
/* @__PURE__ */ jsx82(
|
|
10741
10806
|
Typography_default,
|
|
10742
10807
|
{
|
|
10743
10808
|
noWrap: true,
|
|
@@ -10747,7 +10812,7 @@ var BaseUserDropdown = ({
|
|
|
10747
10812
|
children: getDisplayName_default(mergedMappings, user)
|
|
10748
10813
|
}
|
|
10749
10814
|
),
|
|
10750
|
-
/* @__PURE__ */
|
|
10815
|
+
/* @__PURE__ */ jsx82(
|
|
10751
10816
|
Typography_default,
|
|
10752
10817
|
{
|
|
10753
10818
|
noWrap: true,
|
|
@@ -10759,7 +10824,7 @@ var BaseUserDropdown = ({
|
|
|
10759
10824
|
)
|
|
10760
10825
|
] })
|
|
10761
10826
|
] }),
|
|
10762
|
-
/* @__PURE__ */
|
|
10827
|
+
/* @__PURE__ */ jsx82("div", { className: cx26(withVendorCSSClassPrefix27("user-dropdown__menu"), styles.dropdownMenu), children: allMenuItems.map((item, index) => /* @__PURE__ */ jsx82("div", { children: item.label === "" ? /* @__PURE__ */ jsx82("div", { className: cx26(withVendorCSSClassPrefix27("user-dropdown__menu-divider"), styles.divider) }) : item.href ? /* @__PURE__ */ jsxs36(
|
|
10763
10828
|
"a",
|
|
10764
10829
|
{
|
|
10765
10830
|
href: item.href,
|
|
@@ -10773,10 +10838,10 @@ var BaseUserDropdown = ({
|
|
|
10773
10838
|
onBlur: () => setHoveredItemIndex(null),
|
|
10774
10839
|
children: [
|
|
10775
10840
|
item.icon,
|
|
10776
|
-
/* @__PURE__ */
|
|
10841
|
+
/* @__PURE__ */ jsx82("span", { children: item.label })
|
|
10777
10842
|
]
|
|
10778
10843
|
}
|
|
10779
|
-
) : /* @__PURE__ */
|
|
10844
|
+
) : /* @__PURE__ */ jsx82(
|
|
10780
10845
|
Button_default,
|
|
10781
10846
|
{
|
|
10782
10847
|
onClick: () => handleMenuItemClick(item),
|
|
@@ -10802,7 +10867,7 @@ var BaseUserDropdown_default = BaseUserDropdown;
|
|
|
10802
10867
|
|
|
10803
10868
|
// src/components/presentation/UserDropdown/UserDropdown.tsx
|
|
10804
10869
|
import { useState as useState22 } from "react";
|
|
10805
|
-
import { Fragment as Fragment16, jsx as
|
|
10870
|
+
import { Fragment as Fragment16, jsx as jsx83, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
10806
10871
|
var UserDropdown = ({
|
|
10807
10872
|
children,
|
|
10808
10873
|
renderTrigger,
|
|
@@ -10833,12 +10898,12 @@ var UserDropdown = ({
|
|
|
10833
10898
|
if (children) {
|
|
10834
10899
|
return /* @__PURE__ */ jsxs37(Fragment16, { children: [
|
|
10835
10900
|
children(renderProps),
|
|
10836
|
-
/* @__PURE__ */
|
|
10901
|
+
/* @__PURE__ */ jsx83(UserProfile_default, { mode: "popup", open: isProfileOpen, onOpenChange: setIsProfileOpen })
|
|
10837
10902
|
] });
|
|
10838
10903
|
}
|
|
10839
10904
|
if (renderTrigger || renderDropdown) {
|
|
10840
10905
|
return /* @__PURE__ */ jsxs37(Fragment16, { children: [
|
|
10841
|
-
renderTrigger ? renderTrigger(renderProps) : /* @__PURE__ */
|
|
10906
|
+
renderTrigger ? renderTrigger(renderProps) : /* @__PURE__ */ jsx83(
|
|
10842
10907
|
BaseUserDropdown_default,
|
|
10843
10908
|
{
|
|
10844
10909
|
user,
|
|
@@ -10848,11 +10913,11 @@ var UserDropdown = ({
|
|
|
10848
10913
|
...rest
|
|
10849
10914
|
}
|
|
10850
10915
|
),
|
|
10851
|
-
/* @__PURE__ */
|
|
10916
|
+
/* @__PURE__ */ jsx83(UserProfile_default, { mode: "popup", open: isProfileOpen, onOpenChange: setIsProfileOpen })
|
|
10852
10917
|
] });
|
|
10853
10918
|
}
|
|
10854
10919
|
return /* @__PURE__ */ jsxs37(Fragment16, { children: [
|
|
10855
|
-
/* @__PURE__ */
|
|
10920
|
+
/* @__PURE__ */ jsx83(
|
|
10856
10921
|
BaseUserDropdown_default,
|
|
10857
10922
|
{
|
|
10858
10923
|
user,
|
|
@@ -10862,7 +10927,7 @@ var UserDropdown = ({
|
|
|
10862
10927
|
...rest
|
|
10863
10928
|
}
|
|
10864
10929
|
),
|
|
10865
|
-
isProfileOpen && /* @__PURE__ */
|
|
10930
|
+
isProfileOpen && /* @__PURE__ */ jsx83(UserProfile_default, { mode: "popup", open: isProfileOpen, onOpenChange: setIsProfileOpen })
|
|
10866
10931
|
] });
|
|
10867
10932
|
};
|
|
10868
10933
|
var UserDropdown_default = UserDropdown;
|
|
@@ -10885,9 +10950,9 @@ import { cx as cx27 } from "@emotion/css";
|
|
|
10885
10950
|
import { useState as useState23 } from "react";
|
|
10886
10951
|
|
|
10887
10952
|
// src/components/primitives/Icons/Building.tsx
|
|
10888
|
-
import { jsx as
|
|
10953
|
+
import { jsx as jsx84, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
10889
10954
|
var Building = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */ jsxs38("svg", { width, height, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
10890
|
-
/* @__PURE__ */
|
|
10955
|
+
/* @__PURE__ */ jsx84(
|
|
10891
10956
|
"path",
|
|
10892
10957
|
{
|
|
10893
10958
|
d: "M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",
|
|
@@ -10897,25 +10962,25 @@ var Building = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PU
|
|
|
10897
10962
|
strokeLinejoin: "round"
|
|
10898
10963
|
}
|
|
10899
10964
|
),
|
|
10900
|
-
/* @__PURE__ */
|
|
10901
|
-
/* @__PURE__ */
|
|
10902
|
-
/* @__PURE__ */
|
|
10903
|
-
/* @__PURE__ */
|
|
10904
|
-
/* @__PURE__ */
|
|
10905
|
-
/* @__PURE__ */
|
|
10965
|
+
/* @__PURE__ */ jsx84("path", { d: "M6 12h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
10966
|
+
/* @__PURE__ */ jsx84("path", { d: "M6 8h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
10967
|
+
/* @__PURE__ */ jsx84("path", { d: "M14 8h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
10968
|
+
/* @__PURE__ */ jsx84("path", { d: "M14 12h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
10969
|
+
/* @__PURE__ */ jsx84("path", { d: "M6 18h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
10970
|
+
/* @__PURE__ */ jsx84("path", { d: "M14 18h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
10906
10971
|
] });
|
|
10907
10972
|
Building.displayName = "Building";
|
|
10908
10973
|
var Building_default = Building;
|
|
10909
10974
|
|
|
10910
10975
|
// src/components/primitives/Icons/Check.tsx
|
|
10911
|
-
import { jsx as
|
|
10912
|
-
var Check = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */
|
|
10976
|
+
import { jsx as jsx85 } from "react/jsx-runtime";
|
|
10977
|
+
var Check = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */ jsx85("svg", { width, height, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx85("path", { d: "M20 6 9 17l-5-5", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
10913
10978
|
Check.displayName = "Check";
|
|
10914
10979
|
var Check_default = Check;
|
|
10915
10980
|
|
|
10916
10981
|
// src/components/primitives/Icons/ChevronDown.tsx
|
|
10917
|
-
import { jsx as
|
|
10918
|
-
var ChevronDown = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */
|
|
10982
|
+
import { jsx as jsx86 } from "react/jsx-runtime";
|
|
10983
|
+
var ChevronDown = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */ jsx86("svg", { width, height, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx86("path", { d: "m6 9 6 6 6-6", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
10919
10984
|
ChevronDown.displayName = "ChevronDown";
|
|
10920
10985
|
var ChevronDown_default = ChevronDown;
|
|
10921
10986
|
|
|
@@ -11145,7 +11210,7 @@ var useStyles24 = (theme, colorScheme) => {
|
|
|
11145
11210
|
var BaseOrganizationSwitcher_styles_default = useStyles24;
|
|
11146
11211
|
|
|
11147
11212
|
// src/components/presentation/OrganizationSwitcher/BaseOrganizationSwitcher.tsx
|
|
11148
|
-
import { Fragment as Fragment17, jsx as
|
|
11213
|
+
import { Fragment as Fragment17, jsx as jsx87, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
11149
11214
|
var BaseOrganizationSwitcher = ({
|
|
11150
11215
|
organizations,
|
|
11151
11216
|
currentOrganization,
|
|
@@ -11200,7 +11265,7 @@ var BaseOrganizationSwitcher = ({
|
|
|
11200
11265
|
(org) => org.id !== currentOrganization?.id
|
|
11201
11266
|
);
|
|
11202
11267
|
const defaultRenderOrganization2 = (organization, isSelected) => /* @__PURE__ */ jsxs39(Fragment17, { children: [
|
|
11203
|
-
/* @__PURE__ */
|
|
11268
|
+
/* @__PURE__ */ jsx87(
|
|
11204
11269
|
Avatar,
|
|
11205
11270
|
{
|
|
11206
11271
|
variant: "square",
|
|
@@ -11211,21 +11276,21 @@ var BaseOrganizationSwitcher = ({
|
|
|
11211
11276
|
}
|
|
11212
11277
|
),
|
|
11213
11278
|
/* @__PURE__ */ jsxs39("div", { className: cx27(styles.organizationInfo), children: [
|
|
11214
|
-
/* @__PURE__ */
|
|
11279
|
+
/* @__PURE__ */ jsx87(Typography_default, { variant: "body2", fontWeight: "medium", className: cx27(styles.organizationName), children: organization.name }),
|
|
11215
11280
|
/* @__PURE__ */ jsxs39("div", { className: cx27(styles.organizationMeta), children: [
|
|
11216
11281
|
showMemberCount && organization.memberCount !== void 0 && /* @__PURE__ */ jsxs39("span", { children: [
|
|
11217
11282
|
organization.memberCount,
|
|
11218
11283
|
" ",
|
|
11219
11284
|
organization.memberCount === 1 ? t("organization.switcher.member") : t("organization.switcher.members")
|
|
11220
11285
|
] }),
|
|
11221
|
-
showRole && organization.role && showMemberCount && organization.memberCount !== void 0 && /* @__PURE__ */
|
|
11222
|
-
showRole && organization.role && /* @__PURE__ */
|
|
11286
|
+
showRole && organization.role && showMemberCount && organization.memberCount !== void 0 && /* @__PURE__ */ jsx87("span", { children: " \u2022 " }),
|
|
11287
|
+
showRole && organization.role && /* @__PURE__ */ jsx87("span", { className: cx27(styles.roleCapitalized), children: organization.role })
|
|
11223
11288
|
] })
|
|
11224
11289
|
] }),
|
|
11225
|
-
isSelected && /* @__PURE__ */
|
|
11290
|
+
isSelected && /* @__PURE__ */ jsx87(Check_default, { width: "16", height: "16", color: theme.vars.colors.text.primary })
|
|
11226
11291
|
] });
|
|
11227
|
-
const defaultRenderLoading2 = () => /* @__PURE__ */
|
|
11228
|
-
const defaultRenderError2 = (errorMessage) => /* @__PURE__ */
|
|
11292
|
+
const defaultRenderLoading2 = () => /* @__PURE__ */ jsx87("div", { className: cx27(styles.loadingContainer), children: /* @__PURE__ */ jsx87(Typography_default, { variant: "caption", className: cx27(styles.loadingText), children: t("organization.switcher.loading.organizations") }) });
|
|
11293
|
+
const defaultRenderError2 = (errorMessage) => /* @__PURE__ */ jsx87("div", { className: cx27(styles.errorContainer), children: /* @__PURE__ */ jsx87(Typography_default, { variant: "caption", className: cx27(styles.errorText), children: errorMessage }) });
|
|
11229
11294
|
return /* @__PURE__ */ jsxs39("div", { className: cx27(styles.root, className), style, children: [
|
|
11230
11295
|
/* @__PURE__ */ jsxs39(
|
|
11231
11296
|
Button_default,
|
|
@@ -11238,7 +11303,7 @@ var BaseOrganizationSwitcher = ({
|
|
|
11238
11303
|
...getReferenceProps(),
|
|
11239
11304
|
children: [
|
|
11240
11305
|
currentOrganization ? /* @__PURE__ */ jsxs39(Fragment17, { children: [
|
|
11241
|
-
/* @__PURE__ */
|
|
11306
|
+
/* @__PURE__ */ jsx87(
|
|
11242
11307
|
Avatar,
|
|
11243
11308
|
{
|
|
11244
11309
|
variant: "square",
|
|
@@ -11248,18 +11313,18 @@ var BaseOrganizationSwitcher = ({
|
|
|
11248
11313
|
alt: `${currentOrganization.name} avatar`
|
|
11249
11314
|
}
|
|
11250
11315
|
),
|
|
11251
|
-
showTriggerLabel && /* @__PURE__ */
|
|
11316
|
+
showTriggerLabel && /* @__PURE__ */ jsx87(Typography_default, { variant: "body2", className: cx27(styles.triggerLabel), children: currentOrganization.name })
|
|
11252
11317
|
] }) : /* @__PURE__ */ jsxs39(Fragment17, { children: [
|
|
11253
|
-
/* @__PURE__ */
|
|
11254
|
-
showTriggerLabel && /* @__PURE__ */
|
|
11318
|
+
/* @__PURE__ */ jsx87(Building_default, { width: avatarSize, height: avatarSize }),
|
|
11319
|
+
showTriggerLabel && /* @__PURE__ */ jsx87(Typography_default, { variant: "body2", className: cx27(styles.triggerLabel), children: t("organization.switcher.select.organization") })
|
|
11255
11320
|
] }),
|
|
11256
|
-
/* @__PURE__ */
|
|
11321
|
+
/* @__PURE__ */ jsx87("span", { style: { transform: isRTL ? "scaleX(-1)" : "none", display: "inline-flex" }, children: /* @__PURE__ */ jsx87(ChevronDown_default, { width: "16", height: "16" }) })
|
|
11257
11322
|
]
|
|
11258
11323
|
}
|
|
11259
11324
|
),
|
|
11260
|
-
isOpen && /* @__PURE__ */
|
|
11325
|
+
isOpen && /* @__PURE__ */ jsx87(FloatingPortal3, { id: portalId, children: /* @__PURE__ */ jsx87(FloatingFocusManager3, { context, modal: false, initialFocus: -1, children: /* @__PURE__ */ jsxs39("div", { ref: refs.setFloating, className: cx27(styles.content), style: floatingStyles, ...getFloatingProps(), children: [
|
|
11261
11326
|
currentOrganization && /* @__PURE__ */ jsxs39("div", { className: cx27(styles.header), children: [
|
|
11262
|
-
/* @__PURE__ */
|
|
11327
|
+
/* @__PURE__ */ jsx87(
|
|
11263
11328
|
Avatar,
|
|
11264
11329
|
{
|
|
11265
11330
|
variant: "square",
|
|
@@ -11270,7 +11335,7 @@ var BaseOrganizationSwitcher = ({
|
|
|
11270
11335
|
}
|
|
11271
11336
|
),
|
|
11272
11337
|
/* @__PURE__ */ jsxs39("div", { className: cx27(styles.headerInfo), children: [
|
|
11273
|
-
/* @__PURE__ */
|
|
11338
|
+
/* @__PURE__ */ jsx87(Typography_default, { noWrap: true, className: cx27(styles.headerName), variant: "body1", fontWeight: "medium", children: currentOrganization.name }),
|
|
11274
11339
|
/* @__PURE__ */ jsxs39("div", { className: cx27(styles.headerMeta), children: [
|
|
11275
11340
|
showMemberCount && currentOrganization.memberCount !== void 0 && /* @__PURE__ */ jsxs39(
|
|
11276
11341
|
Typography_default,
|
|
@@ -11289,10 +11354,10 @@ var BaseOrganizationSwitcher = ({
|
|
|
11289
11354
|
]
|
|
11290
11355
|
}
|
|
11291
11356
|
),
|
|
11292
|
-
showRole && currentOrganization.role && (!showMemberCount || currentOrganization.memberCount === void 0) && /* @__PURE__ */
|
|
11357
|
+
showRole && currentOrganization.role && (!showMemberCount || currentOrganization.memberCount === void 0) && /* @__PURE__ */ jsx87(Typography_default, { noWrap: true, className: cx27(styles.headerRole), variant: "caption", color: "secondary", children: currentOrganization.role })
|
|
11293
11358
|
] })
|
|
11294
11359
|
] }),
|
|
11295
|
-
onManageProfile && /* @__PURE__ */
|
|
11360
|
+
onManageProfile && /* @__PURE__ */ jsx87(
|
|
11296
11361
|
Button_default,
|
|
11297
11362
|
{
|
|
11298
11363
|
onClick: onManageProfile,
|
|
@@ -11313,8 +11378,8 @@ var BaseOrganizationSwitcher = ({
|
|
|
11313
11378
|
strokeLinecap: "round",
|
|
11314
11379
|
strokeLinejoin: "round",
|
|
11315
11380
|
children: [
|
|
11316
|
-
/* @__PURE__ */
|
|
11317
|
-
/* @__PURE__ */
|
|
11381
|
+
/* @__PURE__ */ jsx87("circle", { cx: "12", cy: "12", r: "3" }),
|
|
11382
|
+
/* @__PURE__ */ jsx87("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" })
|
|
11318
11383
|
]
|
|
11319
11384
|
}
|
|
11320
11385
|
),
|
|
@@ -11322,20 +11387,20 @@ var BaseOrganizationSwitcher = ({
|
|
|
11322
11387
|
}
|
|
11323
11388
|
)
|
|
11324
11389
|
] }),
|
|
11325
|
-
organizations.length > 1 && /* @__PURE__ */
|
|
11390
|
+
organizations.length > 1 && /* @__PURE__ */ jsx87(
|
|
11326
11391
|
"div",
|
|
11327
11392
|
{
|
|
11328
11393
|
className: cx27(styles.header, styles.sectionHeaderContainer),
|
|
11329
11394
|
style: {
|
|
11330
11395
|
borderTop: currentOrganization ? `1px solid ${theme.vars.colors.border}` : "none"
|
|
11331
11396
|
},
|
|
11332
|
-
children: /* @__PURE__ */
|
|
11397
|
+
children: /* @__PURE__ */ jsx87(Typography_default, { variant: "caption", fontWeight: 600, className: cx27(styles.sectionHeader), children: t("organization.switcher.switch.organization") })
|
|
11333
11398
|
}
|
|
11334
11399
|
),
|
|
11335
|
-
/* @__PURE__ */
|
|
11400
|
+
/* @__PURE__ */ jsx87("div", { className: cx27(styles.menu), children: loading ? renderLoading ? renderLoading() : defaultRenderLoading2() : error ? renderError ? renderError(error) : defaultRenderError2(error) : /* @__PURE__ */ jsxs39(Fragment17, { children: [
|
|
11336
11401
|
switchableOrganizations.map((organization) => {
|
|
11337
11402
|
const isSelected = false;
|
|
11338
|
-
return /* @__PURE__ */
|
|
11403
|
+
return /* @__PURE__ */ jsx87(
|
|
11339
11404
|
Button_default,
|
|
11340
11405
|
{
|
|
11341
11406
|
onClick: () => handleOrganizationSwitch(organization),
|
|
@@ -11354,9 +11419,9 @@ var BaseOrganizationSwitcher = ({
|
|
|
11354
11419
|
);
|
|
11355
11420
|
}),
|
|
11356
11421
|
menuItems.length > 0 && /* @__PURE__ */ jsxs39(Fragment17, { children: [
|
|
11357
|
-
/* @__PURE__ */
|
|
11422
|
+
/* @__PURE__ */ jsx87("div", { className: cx27(styles.menuDivider) }),
|
|
11358
11423
|
menuItems.map(
|
|
11359
|
-
(item, index) => /* @__PURE__ */
|
|
11424
|
+
(item, index) => /* @__PURE__ */ jsx87("div", { children: item.href ? /* @__PURE__ */ jsxs39(
|
|
11360
11425
|
"a",
|
|
11361
11426
|
{
|
|
11362
11427
|
href: item.href,
|
|
@@ -11370,10 +11435,10 @@ var BaseOrganizationSwitcher = ({
|
|
|
11370
11435
|
onBlur: () => setHoveredItemIndex(null),
|
|
11371
11436
|
children: [
|
|
11372
11437
|
item.icon,
|
|
11373
|
-
/* @__PURE__ */
|
|
11438
|
+
/* @__PURE__ */ jsx87("span", { children: item.label })
|
|
11374
11439
|
]
|
|
11375
11440
|
}
|
|
11376
|
-
) : /* @__PURE__ */
|
|
11441
|
+
) : /* @__PURE__ */ jsx87(
|
|
11377
11442
|
Button_default,
|
|
11378
11443
|
{
|
|
11379
11444
|
onClick: () => handleMenuItemClick(item),
|
|
@@ -11547,7 +11612,7 @@ var useStyles25 = (theme, colorScheme) => {
|
|
|
11547
11612
|
var BaseCreateOrganization_styles_default = useStyles25;
|
|
11548
11613
|
|
|
11549
11614
|
// src/components/presentation/CreateOrganization/BaseCreateOrganization.tsx
|
|
11550
|
-
import { jsx as
|
|
11615
|
+
import { jsx as jsx88, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
11551
11616
|
var BaseCreateOrganization = ({
|
|
11552
11617
|
cardLayout = true,
|
|
11553
11618
|
className = "",
|
|
@@ -11634,13 +11699,13 @@ var BaseCreateOrganization = ({
|
|
|
11634
11699
|
console.error("Form submission error:", submitError);
|
|
11635
11700
|
}
|
|
11636
11701
|
};
|
|
11637
|
-
const createOrganizationContent = /* @__PURE__ */
|
|
11702
|
+
const createOrganizationContent = /* @__PURE__ */ jsx88("div", { className: cx28(styles.root, cardLayout && styles.card, className), style, children: /* @__PURE__ */ jsxs40("div", { className: cx28(styles.content), children: [
|
|
11638
11703
|
/* @__PURE__ */ jsxs40("form", { id: "create-organization-form", className: cx28(styles.form), onSubmit: handleSubmit, children: [
|
|
11639
11704
|
error && /* @__PURE__ */ jsxs40(Alert_default, { variant: "error", className: styles.errorAlert, children: [
|
|
11640
|
-
/* @__PURE__ */
|
|
11641
|
-
/* @__PURE__ */
|
|
11705
|
+
/* @__PURE__ */ jsx88(Alert_default.Title, { children: "Error" }),
|
|
11706
|
+
/* @__PURE__ */ jsx88(Alert_default.Description, { children: error })
|
|
11642
11707
|
] }),
|
|
11643
|
-
/* @__PURE__ */
|
|
11708
|
+
/* @__PURE__ */ jsx88("div", { className: cx28(styles.fieldGroup), children: /* @__PURE__ */ jsx88(
|
|
11644
11709
|
TextField_default,
|
|
11645
11710
|
{
|
|
11646
11711
|
label: `${t("organization.create.name.label")}`,
|
|
@@ -11653,7 +11718,7 @@ var BaseCreateOrganization = ({
|
|
|
11653
11718
|
className: cx28(styles.input)
|
|
11654
11719
|
}
|
|
11655
11720
|
) }),
|
|
11656
|
-
/* @__PURE__ */
|
|
11721
|
+
/* @__PURE__ */ jsx88("div", { className: cx28(styles.fieldGroup), children: /* @__PURE__ */ jsx88(
|
|
11657
11722
|
TextField_default,
|
|
11658
11723
|
{
|
|
11659
11724
|
label: `${t("organization.create.handle.label") || "Organization Handle"}`,
|
|
@@ -11667,9 +11732,9 @@ var BaseCreateOrganization = ({
|
|
|
11667
11732
|
className: cx28(styles.input)
|
|
11668
11733
|
}
|
|
11669
11734
|
) }),
|
|
11670
|
-
/* @__PURE__ */
|
|
11671
|
-
/* @__PURE__ */
|
|
11672
|
-
/* @__PURE__ */
|
|
11735
|
+
/* @__PURE__ */ jsx88("div", { className: cx28(styles.fieldGroup), children: /* @__PURE__ */ jsxs40(FormControl_default, { error: formErrors.description, children: [
|
|
11736
|
+
/* @__PURE__ */ jsx88(InputLabel_default, { required: true, children: t("organization.create.description.label") }),
|
|
11737
|
+
/* @__PURE__ */ jsx88(
|
|
11673
11738
|
"textarea",
|
|
11674
11739
|
{
|
|
11675
11740
|
className: cx28(styles.textarea, formErrors.description && styles.textareaError),
|
|
@@ -11684,14 +11749,14 @@ var BaseCreateOrganization = ({
|
|
|
11684
11749
|
renderAdditionalFields && renderAdditionalFields()
|
|
11685
11750
|
] }),
|
|
11686
11751
|
/* @__PURE__ */ jsxs40("div", { className: cx28(styles.actions), children: [
|
|
11687
|
-
onCancel && /* @__PURE__ */
|
|
11688
|
-
/* @__PURE__ */
|
|
11752
|
+
onCancel && /* @__PURE__ */ jsx88(Button_default, { type: "button", variant: "outline", onClick: onCancel, disabled: loading, children: t("organization.create.cancel") }),
|
|
11753
|
+
/* @__PURE__ */ jsx88(Button_default, { type: "submit", variant: "solid", color: "primary", disabled: loading, form: "create-organization-form", children: loading ? t("organization.create.creating") : t("organization.create.button") })
|
|
11689
11754
|
] })
|
|
11690
11755
|
] }) });
|
|
11691
11756
|
if (mode === "popup") {
|
|
11692
|
-
return /* @__PURE__ */
|
|
11693
|
-
/* @__PURE__ */
|
|
11694
|
-
/* @__PURE__ */
|
|
11757
|
+
return /* @__PURE__ */ jsx88(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs40(Dialog_default.Content, { children: [
|
|
11758
|
+
/* @__PURE__ */ jsx88(Dialog_default.Heading, { children: title }),
|
|
11759
|
+
/* @__PURE__ */ jsx88("div", { className: styles.popup, children: createOrganizationContent })
|
|
11695
11760
|
] }) });
|
|
11696
11761
|
}
|
|
11697
11762
|
return createOrganizationContent;
|
|
@@ -11727,7 +11792,7 @@ var createOrganization = async ({ fetcher, ...requestConfig }) => {
|
|
|
11727
11792
|
var createOrganization_default = createOrganization;
|
|
11728
11793
|
|
|
11729
11794
|
// src/components/presentation/CreateOrganization/CreateOrganization.tsx
|
|
11730
|
-
import { Fragment as Fragment18, jsx as
|
|
11795
|
+
import { Fragment as Fragment18, jsx as jsx89 } from "react/jsx-runtime";
|
|
11731
11796
|
var CreateOrganization = ({
|
|
11732
11797
|
onCreateOrganization,
|
|
11733
11798
|
fallback = null,
|
|
@@ -11743,7 +11808,7 @@ var CreateOrganization = ({
|
|
|
11743
11808
|
return fallback;
|
|
11744
11809
|
}
|
|
11745
11810
|
if (!isSignedIn) {
|
|
11746
|
-
return /* @__PURE__ */
|
|
11811
|
+
return /* @__PURE__ */ jsx89(Fragment18, {});
|
|
11747
11812
|
}
|
|
11748
11813
|
const parentId = defaultParentId || currentOrganization?.id || "";
|
|
11749
11814
|
const handleSubmit = async (payload) => {
|
|
@@ -11777,7 +11842,7 @@ var CreateOrganization = ({
|
|
|
11777
11842
|
setLoading(false);
|
|
11778
11843
|
}
|
|
11779
11844
|
};
|
|
11780
|
-
return /* @__PURE__ */
|
|
11845
|
+
return /* @__PURE__ */ jsx89(
|
|
11781
11846
|
BaseCreateOrganization,
|
|
11782
11847
|
{
|
|
11783
11848
|
onSubmit: handleSubmit,
|
|
@@ -11959,7 +12024,7 @@ var useStyles26 = (theme, colorScheme, disabled, readOnly, hasError) => {
|
|
|
11959
12024
|
var KeyValueInput_styles_default = useStyles26;
|
|
11960
12025
|
|
|
11961
12026
|
// src/components/primitives/KeyValueInput/KeyValueInput.tsx
|
|
11962
|
-
import { jsx as
|
|
12027
|
+
import { jsx as jsx90, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
11963
12028
|
var KeyValueInput = ({
|
|
11964
12029
|
className = "",
|
|
11965
12030
|
disabled = false,
|
|
@@ -12037,7 +12102,7 @@ var KeyValueInput = ({
|
|
|
12037
12102
|
return /* @__PURE__ */ jsxs41("div", { className: cx29(withVendorCSSClassPrefix28(bem20("key-value-input")), styles.container, className), children: [
|
|
12038
12103
|
label && /* @__PURE__ */ jsxs41("label", { className: cx29(withVendorCSSClassPrefix28(bem20("key-value-input", "label")), styles.label), children: [
|
|
12039
12104
|
label,
|
|
12040
|
-
required && /* @__PURE__ */
|
|
12105
|
+
required && /* @__PURE__ */ jsx90(
|
|
12041
12106
|
"span",
|
|
12042
12107
|
{
|
|
12043
12108
|
className: cx29(withVendorCSSClassPrefix28(bem20("key-value-input", "required")), styles.requiredIndicator),
|
|
@@ -12046,7 +12111,7 @@ var KeyValueInput = ({
|
|
|
12046
12111
|
)
|
|
12047
12112
|
] }),
|
|
12048
12113
|
/* @__PURE__ */ jsxs41("div", { className: cx29(withVendorCSSClassPrefix28(bem20("key-value-input", "pairs-list")), styles.pairsList), children: [
|
|
12049
|
-
pairs.length === 0 && readOnly ? /* @__PURE__ */
|
|
12114
|
+
pairs.length === 0 && readOnly ? /* @__PURE__ */ jsx90("div", { className: cx29(withVendorCSSClassPrefix28(bem20("key-value-input", "empty-state")), styles.emptyState), children: "No attributes defined" }) : readOnly ? pairs.map((pair, index) => /* @__PURE__ */ jsxs41(
|
|
12050
12115
|
"div",
|
|
12051
12116
|
{
|
|
12052
12117
|
className: cx29(withVendorCSSClassPrefix28(bem20("key-value-input", "readonly-pair")), styles.readOnlyPair),
|
|
@@ -12061,7 +12126,7 @@ var KeyValueInput = ({
|
|
|
12061
12126
|
]
|
|
12062
12127
|
}
|
|
12063
12128
|
),
|
|
12064
|
-
/* @__PURE__ */
|
|
12129
|
+
/* @__PURE__ */ jsx90(
|
|
12065
12130
|
"span",
|
|
12066
12131
|
{
|
|
12067
12132
|
className: cx29(withVendorCSSClassPrefix28(bem20("key-value-input", "readonly-value")), styles.readOnlyValue),
|
|
@@ -12076,7 +12141,7 @@ var KeyValueInput = ({
|
|
|
12076
12141
|
{
|
|
12077
12142
|
className: cx29(withVendorCSSClassPrefix28(bem20("key-value-input", "pair-row")), styles.pairRow),
|
|
12078
12143
|
children: [
|
|
12079
|
-
/* @__PURE__ */
|
|
12144
|
+
/* @__PURE__ */ jsx90(
|
|
12080
12145
|
TextField_default,
|
|
12081
12146
|
{
|
|
12082
12147
|
placeholder: keyPlaceholder,
|
|
@@ -12087,7 +12152,7 @@ var KeyValueInput = ({
|
|
|
12087
12152
|
"aria-label": `${keyLabel} ${index + 1}`
|
|
12088
12153
|
}
|
|
12089
12154
|
),
|
|
12090
|
-
/* @__PURE__ */
|
|
12155
|
+
/* @__PURE__ */ jsx90(
|
|
12091
12156
|
TextField_default,
|
|
12092
12157
|
{
|
|
12093
12158
|
placeholder: valuePlaceholder,
|
|
@@ -12098,7 +12163,7 @@ var KeyValueInput = ({
|
|
|
12098
12163
|
"aria-label": `${valueLabel} ${index + 1}`
|
|
12099
12164
|
}
|
|
12100
12165
|
),
|
|
12101
|
-
!readOnly && /* @__PURE__ */
|
|
12166
|
+
!readOnly && /* @__PURE__ */ jsx90(
|
|
12102
12167
|
"button",
|
|
12103
12168
|
{
|
|
12104
12169
|
type: "button",
|
|
@@ -12106,7 +12171,7 @@ var KeyValueInput = ({
|
|
|
12106
12171
|
disabled,
|
|
12107
12172
|
className: cx29(withVendorCSSClassPrefix28(bem20("key-value-input", "remove-button")), styles.removeButton),
|
|
12108
12173
|
"aria-label": `${removeButtonText} ${pair.key}`,
|
|
12109
|
-
children: /* @__PURE__ */
|
|
12174
|
+
children: /* @__PURE__ */ jsx90(X_default, { width: 16, height: 16 })
|
|
12110
12175
|
}
|
|
12111
12176
|
)
|
|
12112
12177
|
]
|
|
@@ -12114,7 +12179,7 @@ var KeyValueInput = ({
|
|
|
12114
12179
|
`${pair.key}-${index}`
|
|
12115
12180
|
)),
|
|
12116
12181
|
!readOnly && /* @__PURE__ */ jsxs41("div", { className: cx29(withVendorCSSClassPrefix28(bem20("key-value-input", "add-row")), styles.addRow), children: [
|
|
12117
|
-
/* @__PURE__ */
|
|
12182
|
+
/* @__PURE__ */ jsx90(
|
|
12118
12183
|
TextField_default,
|
|
12119
12184
|
{
|
|
12120
12185
|
placeholder: keyPlaceholder,
|
|
@@ -12125,7 +12190,7 @@ var KeyValueInput = ({
|
|
|
12125
12190
|
"aria-label": "New key"
|
|
12126
12191
|
}
|
|
12127
12192
|
),
|
|
12128
|
-
/* @__PURE__ */
|
|
12193
|
+
/* @__PURE__ */ jsx90(
|
|
12129
12194
|
TextField_default,
|
|
12130
12195
|
{
|
|
12131
12196
|
placeholder: valuePlaceholder,
|
|
@@ -12141,7 +12206,7 @@ var KeyValueInput = ({
|
|
|
12141
12206
|
}
|
|
12142
12207
|
}
|
|
12143
12208
|
),
|
|
12144
|
-
/* @__PURE__ */
|
|
12209
|
+
/* @__PURE__ */ jsx90(
|
|
12145
12210
|
"button",
|
|
12146
12211
|
{
|
|
12147
12212
|
type: "button",
|
|
@@ -12149,12 +12214,12 @@ var KeyValueInput = ({
|
|
|
12149
12214
|
disabled: isAddDisabled,
|
|
12150
12215
|
className: cx29(withVendorCSSClassPrefix28(bem20("key-value-input", "add-button")), styles.addButton),
|
|
12151
12216
|
"aria-label": "Add new key-value pair",
|
|
12152
|
-
children: /* @__PURE__ */
|
|
12217
|
+
children: /* @__PURE__ */ jsx90(Plus_default, { width: 16, height: 16 })
|
|
12153
12218
|
}
|
|
12154
12219
|
)
|
|
12155
12220
|
] })
|
|
12156
12221
|
] }),
|
|
12157
|
-
(helperText || error) && /* @__PURE__ */
|
|
12222
|
+
(helperText || error) && /* @__PURE__ */ jsx90("div", { className: cx29(withVendorCSSClassPrefix28(bem20("key-value-input", "helper-text")), styles.helperText), children: error || helperText }),
|
|
12158
12223
|
maxPairs && /* @__PURE__ */ jsxs41("div", { className: cx29(withVendorCSSClassPrefix28(bem20("key-value-input", "counter")), styles.counterText), children: [
|
|
12159
12224
|
pairs.length,
|
|
12160
12225
|
" of ",
|
|
@@ -12322,7 +12387,7 @@ var useStyles27 = (theme, colorScheme) => {
|
|
|
12322
12387
|
var BaseOrganizationProfile_styles_default = useStyles27;
|
|
12323
12388
|
|
|
12324
12389
|
// src/components/presentation/OrganizationProfile/BaseOrganizationProfile.tsx
|
|
12325
|
-
import { Fragment as Fragment19, jsx as
|
|
12390
|
+
import { Fragment as Fragment19, jsx as jsx91, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
12326
12391
|
var BaseOrganizationProfile = ({
|
|
12327
12392
|
fallback = null,
|
|
12328
12393
|
className = "",
|
|
@@ -12373,7 +12438,7 @@ var BaseOrganizationProfile = ({
|
|
|
12373
12438
|
const styles = BaseOrganizationProfile_styles_default(theme, colorScheme);
|
|
12374
12439
|
const [editedOrganization, setEditedOrganization] = useState27(organization);
|
|
12375
12440
|
const [editingFields, setEditingFields] = useState27({});
|
|
12376
|
-
const PencilIcon = () => /* @__PURE__ */
|
|
12441
|
+
const PencilIcon = () => /* @__PURE__ */ jsx91(
|
|
12377
12442
|
"svg",
|
|
12378
12443
|
{
|
|
12379
12444
|
width: "16",
|
|
@@ -12384,7 +12449,7 @@ var BaseOrganizationProfile = ({
|
|
|
12384
12449
|
strokeWidth: "2",
|
|
12385
12450
|
strokeLinecap: "round",
|
|
12386
12451
|
strokeLinejoin: "round",
|
|
12387
|
-
children: /* @__PURE__ */
|
|
12452
|
+
children: /* @__PURE__ */ jsx91("path", { d: "M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z" })
|
|
12388
12453
|
}
|
|
12389
12454
|
);
|
|
12390
12455
|
const toggleFieldEdit = useCallback15((fieldName) => {
|
|
@@ -12447,7 +12512,7 @@ var BaseOrganizationProfile = ({
|
|
|
12447
12512
|
let fieldInput;
|
|
12448
12513
|
if (key === "attributes") {
|
|
12449
12514
|
const attributesValue = typeof fieldValue === "object" && fieldValue !== null ? fieldValue : {};
|
|
12450
|
-
fieldInput = /* @__PURE__ */
|
|
12515
|
+
fieldInput = /* @__PURE__ */ jsx91(
|
|
12451
12516
|
KeyValueInput_default,
|
|
12452
12517
|
{
|
|
12453
12518
|
value: attributesValue,
|
|
@@ -12485,26 +12550,26 @@ var BaseOrganizationProfile = ({
|
|
|
12485
12550
|
}
|
|
12486
12551
|
);
|
|
12487
12552
|
} else {
|
|
12488
|
-
fieldInput = /* @__PURE__ */
|
|
12553
|
+
fieldInput = /* @__PURE__ */ jsx91(TextField_default, { ...commonProps });
|
|
12489
12554
|
}
|
|
12490
12555
|
return /* @__PURE__ */ jsxs42(Fragment19, { children: [
|
|
12491
|
-
/* @__PURE__ */
|
|
12492
|
-
/* @__PURE__ */
|
|
12556
|
+
/* @__PURE__ */ jsx91("span", { className: cx30(styles.label), children: label }),
|
|
12557
|
+
/* @__PURE__ */ jsx91("div", { className: cx30(styles.value), children: fieldInput })
|
|
12493
12558
|
] });
|
|
12494
12559
|
}
|
|
12495
12560
|
const hasValue = value !== void 0 && value !== null && value !== "";
|
|
12496
12561
|
const isFieldEditable = editable && fieldEditable;
|
|
12497
12562
|
let displayValue;
|
|
12498
12563
|
if (hasValue) {
|
|
12499
|
-
displayValue = key === "attributes" && typeof value === "object" && value !== null ? /* @__PURE__ */
|
|
12564
|
+
displayValue = key === "attributes" && typeof value === "object" && value !== null ? /* @__PURE__ */ jsx91(KeyValueInput_default, { value, readOnly: true, label: "" }) : String(renderedValue);
|
|
12500
12565
|
} else if (isFieldEditable) {
|
|
12501
12566
|
displayValue = getFieldPlaceholder(key);
|
|
12502
12567
|
} else {
|
|
12503
12568
|
displayValue = "-";
|
|
12504
12569
|
}
|
|
12505
12570
|
return /* @__PURE__ */ jsxs42(Fragment19, { children: [
|
|
12506
|
-
/* @__PURE__ */
|
|
12507
|
-
/* @__PURE__ */
|
|
12571
|
+
/* @__PURE__ */ jsx91("span", { className: cx30(styles.label), children: label }),
|
|
12572
|
+
/* @__PURE__ */ jsx91("div", { className: cx30(styles.value, !hasValue && styles.valueEmpty), children: !hasValue && isFieldEditable && onStartEdit ? /* @__PURE__ */ jsx91(
|
|
12508
12573
|
Button_default,
|
|
12509
12574
|
{
|
|
12510
12575
|
onClick: onStartEdit,
|
|
@@ -12528,7 +12593,7 @@ var BaseOrganizationProfile = ({
|
|
|
12528
12593
|
return null;
|
|
12529
12594
|
}
|
|
12530
12595
|
return /* @__PURE__ */ jsxs42("div", { className: cx30(styles.field), children: [
|
|
12531
|
-
/* @__PURE__ */
|
|
12596
|
+
/* @__PURE__ */ jsx91("div", { className: cx30(styles.fieldContent), children: renderField(
|
|
12532
12597
|
field,
|
|
12533
12598
|
isFieldEditing,
|
|
12534
12599
|
(value) => {
|
|
@@ -12538,8 +12603,8 @@ var BaseOrganizationProfile = ({
|
|
|
12538
12603
|
},
|
|
12539
12604
|
() => toggleFieldEdit(field.key)
|
|
12540
12605
|
) }),
|
|
12541
|
-
isFieldEditable && /* @__PURE__ */
|
|
12542
|
-
/* @__PURE__ */
|
|
12606
|
+
isFieldEditable && /* @__PURE__ */ jsx91("div", { className: cx30(styles.fieldActions), children: isFieldEditing ? /* @__PURE__ */ jsxs42(Fragment19, { children: [
|
|
12607
|
+
/* @__PURE__ */ jsx91(
|
|
12543
12608
|
Button_default,
|
|
12544
12609
|
{
|
|
12545
12610
|
onClick: () => handleFieldSave(field.key),
|
|
@@ -12550,7 +12615,7 @@ var BaseOrganizationProfile = ({
|
|
|
12550
12615
|
children: saveButtonText
|
|
12551
12616
|
}
|
|
12552
12617
|
),
|
|
12553
|
-
/* @__PURE__ */
|
|
12618
|
+
/* @__PURE__ */ jsx91(
|
|
12554
12619
|
Button_default,
|
|
12555
12620
|
{
|
|
12556
12621
|
onClick: () => handleFieldCancel(field.key),
|
|
@@ -12561,7 +12626,7 @@ var BaseOrganizationProfile = ({
|
|
|
12561
12626
|
children: cancelButtonText
|
|
12562
12627
|
}
|
|
12563
12628
|
)
|
|
12564
|
-
] }) : hasValue && /* @__PURE__ */
|
|
12629
|
+
] }) : hasValue && /* @__PURE__ */ jsx91(
|
|
12565
12630
|
Button_default,
|
|
12566
12631
|
{
|
|
12567
12632
|
onClick: () => toggleFieldEdit(field.key),
|
|
@@ -12570,7 +12635,7 @@ var BaseOrganizationProfile = ({
|
|
|
12570
12635
|
size: "small",
|
|
12571
12636
|
title: "Edit field",
|
|
12572
12637
|
className: cx30(styles.editButton),
|
|
12573
|
-
children: /* @__PURE__ */
|
|
12638
|
+
children: /* @__PURE__ */ jsx91(PencilIcon, {})
|
|
12574
12639
|
}
|
|
12575
12640
|
) })
|
|
12576
12641
|
] }, field.key);
|
|
@@ -12580,21 +12645,21 @@ var BaseOrganizationProfile = ({
|
|
|
12580
12645
|
}
|
|
12581
12646
|
const profileContent = /* @__PURE__ */ jsxs42(Card_default, { className: cx30(styles.root, cardLayout && styles.card, className), children: [
|
|
12582
12647
|
/* @__PURE__ */ jsxs42("div", { className: cx30(styles.header), children: [
|
|
12583
|
-
/* @__PURE__ */
|
|
12648
|
+
/* @__PURE__ */ jsx91(Avatar, { name: getOrgInitials(organization.name), size: 80, alt: `${organization.name} logo` }),
|
|
12584
12649
|
/* @__PURE__ */ jsxs42("div", { className: cx30(styles.orgInfo), children: [
|
|
12585
|
-
/* @__PURE__ */
|
|
12650
|
+
/* @__PURE__ */ jsx91("h2", { className: cx30(styles.name), children: organization.name }),
|
|
12586
12651
|
organization.orgHandle && /* @__PURE__ */ jsxs42("p", { className: cx30(styles.handle), children: [
|
|
12587
12652
|
"@",
|
|
12588
12653
|
organization.orgHandle
|
|
12589
12654
|
] })
|
|
12590
12655
|
] })
|
|
12591
12656
|
] }),
|
|
12592
|
-
/* @__PURE__ */
|
|
12657
|
+
/* @__PURE__ */ jsx91("div", { className: cx30(styles.infoContainer), children: fields.map((field, index) => renderOrganizationField(field)) })
|
|
12593
12658
|
] });
|
|
12594
12659
|
if (mode === "popup") {
|
|
12595
|
-
return /* @__PURE__ */
|
|
12596
|
-
/* @__PURE__ */
|
|
12597
|
-
/* @__PURE__ */
|
|
12660
|
+
return /* @__PURE__ */ jsx91(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs42(Dialog_default.Content, { children: [
|
|
12661
|
+
/* @__PURE__ */ jsx91(Dialog_default.Heading, { children: title }),
|
|
12662
|
+
/* @__PURE__ */ jsx91("div", { className: cx30(styles.popup), children: profileContent })
|
|
12598
12663
|
] }) });
|
|
12599
12664
|
}
|
|
12600
12665
|
return profileContent;
|
|
@@ -12663,7 +12728,7 @@ var updateOrganization = async ({
|
|
|
12663
12728
|
var updateOrganization_default = updateOrganization;
|
|
12664
12729
|
|
|
12665
12730
|
// src/components/presentation/OrganizationProfile/OrganizationProfile.tsx
|
|
12666
|
-
import { jsx as
|
|
12731
|
+
import { jsx as jsx92 } from "react/jsx-runtime";
|
|
12667
12732
|
var OrganizationProfile = ({
|
|
12668
12733
|
organizationId,
|
|
12669
12734
|
mode = "default",
|
|
@@ -12671,8 +12736,8 @@ var OrganizationProfile = ({
|
|
|
12671
12736
|
onOpenChange,
|
|
12672
12737
|
onUpdate,
|
|
12673
12738
|
popupTitle,
|
|
12674
|
-
loadingFallback = /* @__PURE__ */
|
|
12675
|
-
errorFallback = /* @__PURE__ */
|
|
12739
|
+
loadingFallback = /* @__PURE__ */ jsx92("div", { children: "Loading organization..." }),
|
|
12740
|
+
errorFallback = /* @__PURE__ */ jsx92("div", { children: "Failed to load organization data" }),
|
|
12676
12741
|
...rest
|
|
12677
12742
|
}) => {
|
|
12678
12743
|
const { baseUrl } = useAsgardeo_default();
|
|
@@ -12723,7 +12788,7 @@ var OrganizationProfile = ({
|
|
|
12723
12788
|
throw err;
|
|
12724
12789
|
}
|
|
12725
12790
|
};
|
|
12726
|
-
return /* @__PURE__ */
|
|
12791
|
+
return /* @__PURE__ */ jsx92(
|
|
12727
12792
|
BaseOrganizationProfile_default,
|
|
12728
12793
|
{
|
|
12729
12794
|
organization,
|
|
@@ -12973,13 +13038,13 @@ var useStyles28 = (theme, colorScheme) => {
|
|
|
12973
13038
|
var BaseOrganizationList_styles_default = useStyles28;
|
|
12974
13039
|
|
|
12975
13040
|
// src/components/presentation/OrganizationList/BaseOrganizationList.tsx
|
|
12976
|
-
import { jsx as
|
|
13041
|
+
import { jsx as jsx93, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
12977
13042
|
var defaultRenderOrganization = (organization, styles, t, onOrganizationSelect, showStatus) => {
|
|
12978
13043
|
return /* @__PURE__ */ jsxs43("div", { className: cx31(styles.organizationItem), children: [
|
|
12979
13044
|
/* @__PURE__ */ jsxs43("div", { className: cx31(styles.organizationContent), children: [
|
|
12980
|
-
/* @__PURE__ */
|
|
13045
|
+
/* @__PURE__ */ jsx93(Avatar_default, { variant: "square", name: organization.name, size: 48, alt: `${organization.name} logo` }),
|
|
12981
13046
|
/* @__PURE__ */ jsxs43("div", { className: cx31(styles.organizationInfo), children: [
|
|
12982
|
-
/* @__PURE__ */
|
|
13047
|
+
/* @__PURE__ */ jsx93(Typography_default, { variant: "h6", className: cx31(styles.organizationName), children: organization.name }),
|
|
12983
13048
|
/* @__PURE__ */ jsxs43(Typography_default, { variant: "body2", color: "textSecondary", className: cx31(styles.organizationHandle), children: [
|
|
12984
13049
|
"@",
|
|
12985
13050
|
organization.orgHandle
|
|
@@ -12987,7 +13052,7 @@ var defaultRenderOrganization = (organization, styles, t, onOrganizationSelect,
|
|
|
12987
13052
|
showStatus && /* @__PURE__ */ jsxs43(Typography_default, { variant: "body2", color: "textSecondary", className: cx31(styles.organizationStatus), children: [
|
|
12988
13053
|
t("organization.switcher.status.label"),
|
|
12989
13054
|
" ",
|
|
12990
|
-
/* @__PURE__ */
|
|
13055
|
+
/* @__PURE__ */ jsx93(
|
|
12991
13056
|
"span",
|
|
12992
13057
|
{
|
|
12993
13058
|
className: cx31(
|
|
@@ -13000,7 +13065,7 @@ var defaultRenderOrganization = (organization, styles, t, onOrganizationSelect,
|
|
|
13000
13065
|
] })
|
|
13001
13066
|
] })
|
|
13002
13067
|
] }),
|
|
13003
|
-
organization.canSwitch && /* @__PURE__ */
|
|
13068
|
+
organization.canSwitch && /* @__PURE__ */ jsx93("div", { className: cx31(styles.organizationActions), children: /* @__PURE__ */ jsx93(
|
|
13004
13069
|
Button_default,
|
|
13005
13070
|
{
|
|
13006
13071
|
onClick: (e) => {
|
|
@@ -13015,16 +13080,16 @@ var defaultRenderOrganization = (organization, styles, t, onOrganizationSelect,
|
|
|
13015
13080
|
] }, organization.id);
|
|
13016
13081
|
};
|
|
13017
13082
|
var defaultRenderLoading = (t, styles) => /* @__PURE__ */ jsxs43("div", { className: cx31(styles.loadingContainer), children: [
|
|
13018
|
-
/* @__PURE__ */
|
|
13019
|
-
/* @__PURE__ */
|
|
13083
|
+
/* @__PURE__ */ jsx93(Spinner_default, { size: "medium" }),
|
|
13084
|
+
/* @__PURE__ */ jsx93(Typography_default, { variant: "body1", color: "textSecondary", className: cx31(styles.loadingText), children: t("organization.switcher.loading.organizations") })
|
|
13020
13085
|
] });
|
|
13021
|
-
var defaultRenderError = (error, t, styles) => /* @__PURE__ */
|
|
13022
|
-
/* @__PURE__ */
|
|
13086
|
+
var defaultRenderError = (error, t, styles) => /* @__PURE__ */ jsx93("div", { className: cx31(styles.errorContainer), children: /* @__PURE__ */ jsxs43(Typography_default, { variant: "body1", color: "error", children: [
|
|
13087
|
+
/* @__PURE__ */ jsx93("strong", { children: t("organization.switcher.error.prefix") }),
|
|
13023
13088
|
" ",
|
|
13024
13089
|
error
|
|
13025
13090
|
] }) });
|
|
13026
|
-
var defaultRenderLoadMore = (onLoadMore, isLoading, t, styles) => /* @__PURE__ */
|
|
13027
|
-
var defaultRenderEmpty = (t, styles) => /* @__PURE__ */
|
|
13091
|
+
var defaultRenderLoadMore = (onLoadMore, isLoading, t, styles) => /* @__PURE__ */ jsx93(Button_default, { onClick: onLoadMore, disabled: isLoading, className: cx31(styles.loadMoreButton), type: "button", fullWidth: true, children: isLoading ? t("organization.switcher.loading.more") : t("organization.switcher.load.more") });
|
|
13092
|
+
var defaultRenderEmpty = (t, styles) => /* @__PURE__ */ jsx93("div", { className: cx31(styles.emptyContainer), children: /* @__PURE__ */ jsx93(Typography_default, { variant: "body1", color: "textSecondary", className: cx31(styles.emptyText), children: t("organization.switcher.no.organizations") }) });
|
|
13028
13093
|
var BaseOrganizationList = ({
|
|
13029
13094
|
className = "",
|
|
13030
13095
|
allOrganizations,
|
|
@@ -13067,53 +13132,53 @@ var BaseOrganizationList = ({
|
|
|
13067
13132
|
const renderLoadMoreWithStyles = renderLoadMore || ((onLoadMore, isLoading2) => defaultRenderLoadMore(onLoadMore, isLoading2, t, styles));
|
|
13068
13133
|
const renderOrganizationWithStyles = renderOrganization || ((org) => defaultRenderOrganization(org, styles, t, onOrganizationSelect, showStatus));
|
|
13069
13134
|
if (isLoading && organizationsWithSwitchAccess?.length === 0) {
|
|
13070
|
-
const loadingContent = /* @__PURE__ */
|
|
13135
|
+
const loadingContent = /* @__PURE__ */ jsx93("div", { className: cx31(styles.root, className), style, children: renderLoadingWithStyles() });
|
|
13071
13136
|
if (mode === "popup") {
|
|
13072
|
-
return /* @__PURE__ */
|
|
13073
|
-
/* @__PURE__ */
|
|
13074
|
-
/* @__PURE__ */
|
|
13137
|
+
return /* @__PURE__ */ jsx93(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs43(Dialog_default.Content, { children: [
|
|
13138
|
+
/* @__PURE__ */ jsx93(Dialog_default.Heading, { children: title }),
|
|
13139
|
+
/* @__PURE__ */ jsx93("div", { className: cx31(styles.popupContent), children: loadingContent })
|
|
13075
13140
|
] }) });
|
|
13076
13141
|
}
|
|
13077
13142
|
return loadingContent;
|
|
13078
13143
|
}
|
|
13079
13144
|
if (error && organizationsWithSwitchAccess?.length === 0) {
|
|
13080
|
-
const errorContent = /* @__PURE__ */
|
|
13145
|
+
const errorContent = /* @__PURE__ */ jsx93("div", { className: cx31(styles.root, className), style, children: renderErrorWithStyles(error) });
|
|
13081
13146
|
if (mode === "popup") {
|
|
13082
|
-
return /* @__PURE__ */
|
|
13083
|
-
/* @__PURE__ */
|
|
13084
|
-
/* @__PURE__ */
|
|
13147
|
+
return /* @__PURE__ */ jsx93(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs43(Dialog_default.Content, { children: [
|
|
13148
|
+
/* @__PURE__ */ jsx93(Dialog_default.Heading, { children: title }),
|
|
13149
|
+
/* @__PURE__ */ jsx93("div", { className: cx31(styles.popupContent), children: errorContent })
|
|
13085
13150
|
] }) });
|
|
13086
13151
|
}
|
|
13087
13152
|
return errorContent;
|
|
13088
13153
|
}
|
|
13089
13154
|
if (!isLoading && organizationsWithSwitchAccess?.length === 0) {
|
|
13090
|
-
const emptyContent = /* @__PURE__ */
|
|
13155
|
+
const emptyContent = /* @__PURE__ */ jsx93("div", { className: cx31(styles.root, className), style, children: renderEmptyWithStyles() });
|
|
13091
13156
|
if (mode === "popup") {
|
|
13092
|
-
return /* @__PURE__ */
|
|
13093
|
-
/* @__PURE__ */
|
|
13094
|
-
/* @__PURE__ */
|
|
13157
|
+
return /* @__PURE__ */ jsx93(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs43(Dialog_default.Content, { children: [
|
|
13158
|
+
/* @__PURE__ */ jsx93(Dialog_default.Heading, { children: title }),
|
|
13159
|
+
/* @__PURE__ */ jsx93("div", { className: cx31(styles.popupContent), children: emptyContent })
|
|
13095
13160
|
] }) });
|
|
13096
13161
|
}
|
|
13097
13162
|
return emptyContent;
|
|
13098
13163
|
}
|
|
13099
13164
|
const organizationListContent = /* @__PURE__ */ jsxs43("div", { className: cx31(styles.root, className), style, children: [
|
|
13100
13165
|
/* @__PURE__ */ jsxs43("div", { className: cx31(styles.header), children: [
|
|
13101
|
-
/* @__PURE__ */
|
|
13166
|
+
/* @__PURE__ */ jsx93("div", { className: cx31(styles.headerInfo), children: /* @__PURE__ */ jsx93(Typography_default, { variant: "body2", color: "textSecondary", className: cx31(styles.subtitle), children: t("organization.switcher.showing.count", {
|
|
13102
13167
|
showing: organizationsWithSwitchAccess?.length,
|
|
13103
13168
|
total: allOrganizations?.organizations?.length || 0
|
|
13104
13169
|
}) }) }),
|
|
13105
|
-
onRefresh && /* @__PURE__ */
|
|
13170
|
+
onRefresh && /* @__PURE__ */ jsx93(Button_default, { onClick: onRefresh, className: cx31(styles.refreshButton), type: "button", variant: "outline", size: "small", children: t("organization.switcher.refresh.button") })
|
|
13106
13171
|
] }),
|
|
13107
|
-
/* @__PURE__ */
|
|
13172
|
+
/* @__PURE__ */ jsx93("div", { className: cx31(styles.listContainer), children: organizationsWithSwitchAccess?.map(
|
|
13108
13173
|
(organization, index) => renderOrganizationWithStyles(organization, index)
|
|
13109
13174
|
) }),
|
|
13110
|
-
error && organizationsWithSwitchAccess?.length > 0 && /* @__PURE__ */
|
|
13111
|
-
hasMore && fetchMore && /* @__PURE__ */
|
|
13175
|
+
error && organizationsWithSwitchAccess?.length > 0 && /* @__PURE__ */ jsx93("div", { className: cx31(styles.errorMargin), children: renderErrorWithStyles(error) }),
|
|
13176
|
+
hasMore && fetchMore && /* @__PURE__ */ jsx93("div", { className: cx31(styles.loadMoreMargin), children: renderLoadMoreWithStyles(fetchMore, isLoadingMore) })
|
|
13112
13177
|
] });
|
|
13113
13178
|
if (mode === "popup") {
|
|
13114
|
-
return /* @__PURE__ */
|
|
13115
|
-
/* @__PURE__ */
|
|
13116
|
-
/* @__PURE__ */
|
|
13179
|
+
return /* @__PURE__ */ jsx93(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs43(Dialog_default.Content, { children: [
|
|
13180
|
+
/* @__PURE__ */ jsx93(Dialog_default.Heading, { children: title }),
|
|
13181
|
+
/* @__PURE__ */ jsx93("div", { className: cx31(styles.popupContent), children: organizationListContent })
|
|
13117
13182
|
] }) });
|
|
13118
13183
|
}
|
|
13119
13184
|
return organizationListContent;
|
|
@@ -13184,7 +13249,7 @@ var useStyles29 = (theme, colorScheme) => {
|
|
|
13184
13249
|
var OrganizationList_styles_default = useStyles29;
|
|
13185
13250
|
|
|
13186
13251
|
// src/components/presentation/OrganizationList/OrganizationList.tsx
|
|
13187
|
-
import { jsx as
|
|
13252
|
+
import { jsx as jsx94 } from "react/jsx-runtime";
|
|
13188
13253
|
var OrganizationList = ({
|
|
13189
13254
|
autoFetch = true,
|
|
13190
13255
|
filter = "",
|
|
@@ -13206,7 +13271,7 @@ var OrganizationList = ({
|
|
|
13206
13271
|
setAllOrganizations(await getAllOrganizations2());
|
|
13207
13272
|
})();
|
|
13208
13273
|
}, []);
|
|
13209
|
-
return /* @__PURE__ */
|
|
13274
|
+
return /* @__PURE__ */ jsx94("div", { className: cx32(styles.root, className), style, children: /* @__PURE__ */ jsx94("div", { className: cx32(styles.container), children: /* @__PURE__ */ jsx94(
|
|
13210
13275
|
BaseOrganizationList_default,
|
|
13211
13276
|
{
|
|
13212
13277
|
allOrganizations,
|
|
@@ -13221,7 +13286,7 @@ var OrganizationList = ({
|
|
|
13221
13286
|
var OrganizationList_default = OrganizationList;
|
|
13222
13287
|
|
|
13223
13288
|
// src/components/primitives/Icons/BuildingAlt.tsx
|
|
13224
|
-
import { jsx as
|
|
13289
|
+
import { jsx as jsx95, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
13225
13290
|
var BuildingAlt = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */ jsxs44(
|
|
13226
13291
|
"svg",
|
|
13227
13292
|
{
|
|
@@ -13235,13 +13300,13 @@ var BuildingAlt = ({ color = "currentColor", height = 24, width = 24 }) => /* @_
|
|
|
13235
13300
|
strokeLinecap: "round",
|
|
13236
13301
|
strokeLinejoin: "round",
|
|
13237
13302
|
children: [
|
|
13238
|
-
/* @__PURE__ */
|
|
13239
|
-
/* @__PURE__ */
|
|
13240
|
-
/* @__PURE__ */
|
|
13241
|
-
/* @__PURE__ */
|
|
13242
|
-
/* @__PURE__ */
|
|
13243
|
-
/* @__PURE__ */
|
|
13244
|
-
/* @__PURE__ */
|
|
13303
|
+
/* @__PURE__ */ jsx95("path", { d: "M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z" }),
|
|
13304
|
+
/* @__PURE__ */ jsx95("path", { d: "M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2" }),
|
|
13305
|
+
/* @__PURE__ */ jsx95("path", { d: "M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2" }),
|
|
13306
|
+
/* @__PURE__ */ jsx95("path", { d: "M10 6h4" }),
|
|
13307
|
+
/* @__PURE__ */ jsx95("path", { d: "M10 10h4" }),
|
|
13308
|
+
/* @__PURE__ */ jsx95("path", { d: "M10 14h4" }),
|
|
13309
|
+
/* @__PURE__ */ jsx95("path", { d: "M10 18h4" })
|
|
13245
13310
|
]
|
|
13246
13311
|
}
|
|
13247
13312
|
);
|
|
@@ -13249,7 +13314,7 @@ BuildingAlt.displayName = "BuildingAlt";
|
|
|
13249
13314
|
var BuildingAlt_default = BuildingAlt;
|
|
13250
13315
|
|
|
13251
13316
|
// src/components/presentation/OrganizationSwitcher/OrganizationSwitcher.tsx
|
|
13252
|
-
import { Fragment as Fragment20, jsx as
|
|
13317
|
+
import { Fragment as Fragment20, jsx as jsx96, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
13253
13318
|
var OrganizationSwitcher = ({
|
|
13254
13319
|
currentOrganization: propCurrentOrganization,
|
|
13255
13320
|
fallback = null,
|
|
@@ -13273,7 +13338,7 @@ var OrganizationSwitcher = ({
|
|
|
13273
13338
|
return fallback;
|
|
13274
13339
|
}
|
|
13275
13340
|
if (!isSignedIn) {
|
|
13276
|
-
return /* @__PURE__ */
|
|
13341
|
+
return /* @__PURE__ */ jsx96(Fragment20, {});
|
|
13277
13342
|
}
|
|
13278
13343
|
const organizations = propOrganizations || contextOrganizations || [];
|
|
13279
13344
|
const currentOrganization = propCurrentOrganization || contextCurrentOrganization;
|
|
@@ -13287,19 +13352,19 @@ var OrganizationSwitcher = ({
|
|
|
13287
13352
|
const defaultMenuItems = [];
|
|
13288
13353
|
if (currentOrganization) {
|
|
13289
13354
|
defaultMenuItems.push({
|
|
13290
|
-
icon: /* @__PURE__ */
|
|
13355
|
+
icon: /* @__PURE__ */ jsx96(BuildingAlt_default, {}),
|
|
13291
13356
|
label: t("organization.switcher.manage.organizations"),
|
|
13292
13357
|
onClick: handleManageOrganizations
|
|
13293
13358
|
});
|
|
13294
13359
|
}
|
|
13295
13360
|
defaultMenuItems.push({
|
|
13296
|
-
icon: /* @__PURE__ */
|
|
13361
|
+
icon: /* @__PURE__ */ jsx96("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx96("path", { d: "M12 5v14m-7-7h14" }) }),
|
|
13297
13362
|
label: t("organization.switcher.create.organization"),
|
|
13298
13363
|
onClick: () => setIsCreateOrgOpen(true)
|
|
13299
13364
|
});
|
|
13300
13365
|
const menuItems = props.menuItems ? [...defaultMenuItems, ...props.menuItems] : defaultMenuItems;
|
|
13301
13366
|
return /* @__PURE__ */ jsxs45(Fragment20, { children: [
|
|
13302
|
-
/* @__PURE__ */
|
|
13367
|
+
/* @__PURE__ */ jsx96(
|
|
13303
13368
|
BaseOrganizationSwitcher_default,
|
|
13304
13369
|
{
|
|
13305
13370
|
organizations,
|
|
@@ -13312,7 +13377,7 @@ var OrganizationSwitcher = ({
|
|
|
13312
13377
|
...props
|
|
13313
13378
|
}
|
|
13314
13379
|
),
|
|
13315
|
-
/* @__PURE__ */
|
|
13380
|
+
/* @__PURE__ */ jsx96(
|
|
13316
13381
|
CreateOrganization,
|
|
13317
13382
|
{
|
|
13318
13383
|
mode: "popup",
|
|
@@ -13326,7 +13391,7 @@ var OrganizationSwitcher = ({
|
|
|
13326
13391
|
}
|
|
13327
13392
|
}
|
|
13328
13393
|
),
|
|
13329
|
-
currentOrganization && /* @__PURE__ */
|
|
13394
|
+
currentOrganization && /* @__PURE__ */ jsx96(
|
|
13330
13395
|
OrganizationProfile_default,
|
|
13331
13396
|
{
|
|
13332
13397
|
organizationId: currentOrganization.id,
|
|
@@ -13334,11 +13399,11 @@ var OrganizationSwitcher = ({
|
|
|
13334
13399
|
open: isProfileOpen,
|
|
13335
13400
|
onOpenChange: setIsProfileOpen,
|
|
13336
13401
|
cardLayout: true,
|
|
13337
|
-
loadingFallback: /* @__PURE__ */
|
|
13338
|
-
errorFallback: /* @__PURE__ */
|
|
13402
|
+
loadingFallback: /* @__PURE__ */ jsx96("div", { children: t("organization.profile.loading") }),
|
|
13403
|
+
errorFallback: /* @__PURE__ */ jsx96("div", { children: t("organization.profile.error") })
|
|
13339
13404
|
}
|
|
13340
13405
|
),
|
|
13341
|
-
/* @__PURE__ */
|
|
13406
|
+
/* @__PURE__ */ jsx96(
|
|
13342
13407
|
OrganizationList_default,
|
|
13343
13408
|
{
|
|
13344
13409
|
mode: "popup",
|
|
@@ -13371,7 +13436,7 @@ export {
|
|
|
13371
13436
|
BaseOrganizationList_default as BaseOrganizationList,
|
|
13372
13437
|
BaseOrganizationProfile_default as BaseOrganizationProfile,
|
|
13373
13438
|
BaseOrganizationSwitcher_default as BaseOrganizationSwitcher,
|
|
13374
|
-
|
|
13439
|
+
BaseSignIn_default3 as BaseSignIn,
|
|
13375
13440
|
BaseSignInButton_default as BaseSignInButton,
|
|
13376
13441
|
BaseSignOutButton_default as BaseSignOutButton,
|
|
13377
13442
|
BaseSignUp_default as BaseSignUp,
|