@asgardeo/react 0.6.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +620 -554
- 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 -363
- 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,14 @@ 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) => {
|
|
7394
|
+
const lowerName = name.toLowerCase();
|
|
7395
|
+
if (lowerName.includes("password")) {
|
|
7396
|
+
return "PASSWORD";
|
|
7397
|
+
}
|
|
7398
|
+
if (lowerName.includes("email")) {
|
|
7399
|
+
return "EMAIL";
|
|
7400
|
+
}
|
|
7373
7401
|
switch (type.toLowerCase()) {
|
|
7374
7402
|
case "email":
|
|
7375
7403
|
return "EMAIL";
|
|
@@ -7396,7 +7424,7 @@ var getInputPlaceholder = (name, type, t) => {
|
|
|
7396
7424
|
return placeholder;
|
|
7397
7425
|
};
|
|
7398
7426
|
var convertSimpleInputToComponent = (input, t) => {
|
|
7399
|
-
const variant = getInputVariant(input.type);
|
|
7427
|
+
const variant = getInputVariant(input.type, input.name);
|
|
7400
7428
|
const label = getInputLabel(input.name, input.type, t);
|
|
7401
7429
|
const placeholder = getInputPlaceholder(input.name, input.type, t);
|
|
7402
7430
|
return {
|
|
@@ -7404,7 +7432,7 @@ var convertSimpleInputToComponent = (input, t) => {
|
|
|
7404
7432
|
type: EmbeddedFlowComponentType2.Input,
|
|
7405
7433
|
variant,
|
|
7406
7434
|
config: {
|
|
7407
|
-
type: input.type
|
|
7435
|
+
type: input.type,
|
|
7408
7436
|
label,
|
|
7409
7437
|
placeholder,
|
|
7410
7438
|
required: input.required,
|
|
@@ -7474,7 +7502,7 @@ var normalizeFlowResponse = (response, t) => {
|
|
|
7474
7502
|
};
|
|
7475
7503
|
|
|
7476
7504
|
// src/components/presentation/SignIn/component-driven/SignIn.tsx
|
|
7477
|
-
import { Fragment as Fragment12, jsx as
|
|
7505
|
+
import { Fragment as Fragment12, jsx as jsx58 } from "react/jsx-runtime";
|
|
7478
7506
|
var SignIn = ({ className, size = "medium", onSuccess, onError, variant, children }) => {
|
|
7479
7507
|
const { applicationId, afterSignInUrl, signIn, isInitialized, isLoading } = useAsgardeo_default();
|
|
7480
7508
|
const { t } = useTranslation_default();
|
|
@@ -7588,9 +7616,9 @@ var SignIn = ({ className, size = "medium", onSuccess, onError, variant, childre
|
|
|
7588
7616
|
components,
|
|
7589
7617
|
error: flowError
|
|
7590
7618
|
};
|
|
7591
|
-
return /* @__PURE__ */
|
|
7619
|
+
return /* @__PURE__ */ jsx58(Fragment12, { children: children(renderProps) });
|
|
7592
7620
|
}
|
|
7593
|
-
return /* @__PURE__ */
|
|
7621
|
+
return /* @__PURE__ */ jsx58(
|
|
7594
7622
|
BaseSignIn_default2,
|
|
7595
7623
|
{
|
|
7596
7624
|
components,
|
|
@@ -7606,7 +7634,7 @@ var SignIn = ({ className, size = "medium", onSuccess, onError, variant, childre
|
|
|
7606
7634
|
var SignIn_default = SignIn;
|
|
7607
7635
|
|
|
7608
7636
|
// src/components/presentation/SignIn/SignIn.tsx
|
|
7609
|
-
import { jsx as
|
|
7637
|
+
import { jsx as jsx59 } from "react/jsx-runtime";
|
|
7610
7638
|
var SignIn2 = ({ className, size = "medium", children, ...rest }) => {
|
|
7611
7639
|
const { signIn, afterSignInUrl, isInitialized, isLoading, platform } = useAsgardeo_default();
|
|
7612
7640
|
const handleInitialize = async () => {
|
|
@@ -7626,8 +7654,8 @@ var SignIn2 = ({ className, size = "medium", children, ...rest }) => {
|
|
|
7626
7654
|
window.location.href = url.toString();
|
|
7627
7655
|
}
|
|
7628
7656
|
};
|
|
7629
|
-
if (platform ===
|
|
7630
|
-
return /* @__PURE__ */
|
|
7657
|
+
if (platform === Platform4.AsgardeoV2) {
|
|
7658
|
+
return /* @__PURE__ */ jsx59(
|
|
7631
7659
|
SignIn_default,
|
|
7632
7660
|
{
|
|
7633
7661
|
className,
|
|
@@ -7639,7 +7667,7 @@ var SignIn2 = ({ className, size = "medium", children, ...rest }) => {
|
|
|
7639
7667
|
}
|
|
7640
7668
|
);
|
|
7641
7669
|
}
|
|
7642
|
-
return /* @__PURE__ */
|
|
7670
|
+
return /* @__PURE__ */ jsx59(
|
|
7643
7671
|
BaseSignIn_default,
|
|
7644
7672
|
{
|
|
7645
7673
|
isLoading: isLoading || !isInitialized,
|
|
@@ -7660,8 +7688,7 @@ import {
|
|
|
7660
7688
|
EmbeddedFlowStatus,
|
|
7661
7689
|
EmbeddedFlowComponentType as EmbeddedFlowComponentType5,
|
|
7662
7690
|
EmbeddedFlowResponseType,
|
|
7663
|
-
withVendorCSSClassPrefix as withVendorCSSClassPrefix21
|
|
7664
|
-
AsgardeoAPIError as AsgardeoAPIError3
|
|
7691
|
+
withVendorCSSClassPrefix as withVendorCSSClassPrefix21
|
|
7665
7692
|
} from "@asgardeo/browser";
|
|
7666
7693
|
import { cx as cx21 } from "@emotion/css";
|
|
7667
7694
|
import { useEffect as useEffect14, useState as useState17, useCallback as useCallback11, useRef as useRef5 } from "react";
|
|
@@ -7726,13 +7753,13 @@ var DateInput = ({
|
|
|
7726
7753
|
var DateInput_default = DateInput;
|
|
7727
7754
|
|
|
7728
7755
|
// src/components/adapters/DividerComponent.tsx
|
|
7729
|
-
import { jsx as
|
|
7756
|
+
import { jsx as jsx60 } from "react/jsx-runtime";
|
|
7730
7757
|
var DividerComponent = ({ component }) => {
|
|
7731
7758
|
const { theme } = useTheme_default();
|
|
7732
7759
|
const config = component.config || {};
|
|
7733
7760
|
const text = config["text"] || "";
|
|
7734
7761
|
const variant = component.variant?.toLowerCase() || "horizontal";
|
|
7735
|
-
return /* @__PURE__ */
|
|
7762
|
+
return /* @__PURE__ */ jsx60(
|
|
7736
7763
|
Divider_default,
|
|
7737
7764
|
{
|
|
7738
7765
|
orientation: variant === "vertical" ? "vertical" : "horizontal",
|
|
@@ -7773,7 +7800,7 @@ var EmailInput = ({
|
|
|
7773
7800
|
var EmailInput_default = EmailInput;
|
|
7774
7801
|
|
|
7775
7802
|
// src/components/adapters/FormContainer.tsx
|
|
7776
|
-
import { jsx as
|
|
7803
|
+
import { jsx as jsx61 } from "react/jsx-runtime";
|
|
7777
7804
|
var FormContainer = (props) => {
|
|
7778
7805
|
const { component } = props;
|
|
7779
7806
|
if (component.components && component.components.length > 0) {
|
|
@@ -7786,19 +7813,19 @@ var FormContainer = (props) => {
|
|
|
7786
7813
|
props.onSubmit(submitButton, props.formValues);
|
|
7787
7814
|
}
|
|
7788
7815
|
};
|
|
7789
|
-
return /* @__PURE__ */
|
|
7816
|
+
return /* @__PURE__ */ jsx61("form", { onSubmit: handleFormSubmit, style: { display: "flex", flexDirection: "column" }, children: component.components.map(
|
|
7790
7817
|
(childComponent, index) => createSignUpComponent({
|
|
7791
7818
|
...props,
|
|
7792
7819
|
component: childComponent
|
|
7793
7820
|
})
|
|
7794
7821
|
) }, component.id);
|
|
7795
7822
|
}
|
|
7796
|
-
return /* @__PURE__ */
|
|
7823
|
+
return /* @__PURE__ */ jsx61("div", {}, component.id);
|
|
7797
7824
|
};
|
|
7798
7825
|
var FormContainer_default = FormContainer;
|
|
7799
7826
|
|
|
7800
7827
|
// src/components/adapters/ImageComponent.tsx
|
|
7801
|
-
import { jsx as
|
|
7828
|
+
import { jsx as jsx62 } from "react/jsx-runtime";
|
|
7802
7829
|
var ImageComponent = ({ component }) => {
|
|
7803
7830
|
const { theme } = useTheme_default();
|
|
7804
7831
|
const config = component.config || {};
|
|
@@ -7815,7 +7842,7 @@ var ImageComponent = ({ component }) => {
|
|
|
7815
7842
|
if (!src) {
|
|
7816
7843
|
return null;
|
|
7817
7844
|
}
|
|
7818
|
-
return /* @__PURE__ */
|
|
7845
|
+
return /* @__PURE__ */ jsx62("div", { style: { textAlign: "center" }, children: /* @__PURE__ */ jsx62(
|
|
7819
7846
|
"img",
|
|
7820
7847
|
{
|
|
7821
7848
|
src,
|
|
@@ -7918,7 +7945,7 @@ var PasswordInput = ({
|
|
|
7918
7945
|
var PasswordInput_default = PasswordInput;
|
|
7919
7946
|
|
|
7920
7947
|
// src/components/adapters/SubmitButton.tsx
|
|
7921
|
-
import { jsx as
|
|
7948
|
+
import { jsx as jsx63 } from "react/jsx-runtime";
|
|
7922
7949
|
var ButtonComponent = ({
|
|
7923
7950
|
component,
|
|
7924
7951
|
isLoading,
|
|
@@ -7951,7 +7978,7 @@ var ButtonComponent = ({
|
|
|
7951
7978
|
onSubmit(component);
|
|
7952
7979
|
}
|
|
7953
7980
|
};
|
|
7954
|
-
return /* @__PURE__ */
|
|
7981
|
+
return /* @__PURE__ */ jsx63(
|
|
7955
7982
|
Button_default,
|
|
7956
7983
|
{
|
|
7957
7984
|
type: buttonType === "submit" ? "submit" : "button",
|
|
@@ -7962,7 +7989,7 @@ var ButtonComponent = ({
|
|
|
7962
7989
|
onClick: buttonType !== "submit" ? handleClick : void 0,
|
|
7963
7990
|
className: buttonClassName,
|
|
7964
7991
|
style: { width: "100%" },
|
|
7965
|
-
children: isLoading ? /* @__PURE__ */
|
|
7992
|
+
children: isLoading ? /* @__PURE__ */ jsx63(Spinner_default, { size: "small" }) : buttonText
|
|
7966
7993
|
},
|
|
7967
7994
|
component.id
|
|
7968
7995
|
);
|
|
@@ -7970,7 +7997,7 @@ var ButtonComponent = ({
|
|
|
7970
7997
|
var SubmitButton_default = ButtonComponent;
|
|
7971
7998
|
|
|
7972
7999
|
// src/components/adapters/TelephoneInput.tsx
|
|
7973
|
-
import { jsx as
|
|
8000
|
+
import { jsx as jsx64 } from "react/jsx-runtime";
|
|
7974
8001
|
var TelephoneInput = ({
|
|
7975
8002
|
component,
|
|
7976
8003
|
formValues,
|
|
@@ -7983,7 +8010,7 @@ var TelephoneInput = ({
|
|
|
7983
8010
|
const fieldName = config["identifier"] || config["name"] || component.id;
|
|
7984
8011
|
const value = formValues[fieldName] || "";
|
|
7985
8012
|
const error = touchedFields[fieldName] ? formErrors[fieldName] : void 0;
|
|
7986
|
-
return /* @__PURE__ */
|
|
8013
|
+
return /* @__PURE__ */ jsx64(
|
|
7987
8014
|
TextField_default,
|
|
7988
8015
|
{
|
|
7989
8016
|
name: fieldName,
|
|
@@ -8031,7 +8058,7 @@ var TextInput = ({
|
|
|
8031
8058
|
var TextInput_default = TextInput;
|
|
8032
8059
|
|
|
8033
8060
|
// src/components/adapters/Typography.tsx
|
|
8034
|
-
import { jsx as
|
|
8061
|
+
import { jsx as jsx65 } from "react/jsx-runtime";
|
|
8035
8062
|
var TypographyComponent = ({ component }) => {
|
|
8036
8063
|
const { theme } = useTheme_default();
|
|
8037
8064
|
const config = component.config || {};
|
|
@@ -8072,7 +8099,7 @@ var TypographyComponent = ({ component }) => {
|
|
|
8072
8099
|
default:
|
|
8073
8100
|
typographyVariant = "body1";
|
|
8074
8101
|
}
|
|
8075
|
-
return /* @__PURE__ */
|
|
8102
|
+
return /* @__PURE__ */ jsx65(
|
|
8076
8103
|
Typography_default,
|
|
8077
8104
|
{
|
|
8078
8105
|
variant: typographyVariant,
|
|
@@ -8085,66 +8112,66 @@ var TypographyComponent = ({ component }) => {
|
|
|
8085
8112
|
var Typography_default2 = TypographyComponent;
|
|
8086
8113
|
|
|
8087
8114
|
// src/components/presentation/SignUp/SignUpOptionFactory.tsx
|
|
8088
|
-
import { jsx as
|
|
8115
|
+
import { jsx as jsx66 } from "react/jsx-runtime";
|
|
8089
8116
|
var createSignUpComponent = ({ component, onSubmit, ...rest }) => {
|
|
8090
8117
|
switch (component.type) {
|
|
8091
8118
|
case EmbeddedFlowComponentType3.Typography:
|
|
8092
|
-
return /* @__PURE__ */
|
|
8119
|
+
return /* @__PURE__ */ jsx66(Typography_default2, { component, onSubmit, ...rest });
|
|
8093
8120
|
case EmbeddedFlowComponentType3.Input:
|
|
8094
8121
|
const inputVariant = component.variant?.toUpperCase();
|
|
8095
8122
|
const inputType = component.config["type"]?.toLowerCase();
|
|
8096
8123
|
if (inputVariant === "EMAIL" || inputType === "email") {
|
|
8097
|
-
return /* @__PURE__ */
|
|
8124
|
+
return /* @__PURE__ */ jsx66(EmailInput_default, { component, onSubmit, ...rest });
|
|
8098
8125
|
}
|
|
8099
8126
|
if (inputVariant === "PASSWORD" || inputType === "password") {
|
|
8100
|
-
return /* @__PURE__ */
|
|
8127
|
+
return /* @__PURE__ */ jsx66(PasswordInput_default, { component, onSubmit, ...rest });
|
|
8101
8128
|
}
|
|
8102
8129
|
if (inputVariant === "TELEPHONE" || inputType === "tel") {
|
|
8103
|
-
return /* @__PURE__ */
|
|
8130
|
+
return /* @__PURE__ */ jsx66(TelephoneInput_default, { component, onSubmit, ...rest });
|
|
8104
8131
|
}
|
|
8105
8132
|
if (inputVariant === "NUMBER" || inputType === "number") {
|
|
8106
|
-
return /* @__PURE__ */
|
|
8133
|
+
return /* @__PURE__ */ jsx66(NumberInput_default, { component, onSubmit, ...rest });
|
|
8107
8134
|
}
|
|
8108
8135
|
if (inputVariant === "DATE" || inputType === "date") {
|
|
8109
|
-
return /* @__PURE__ */
|
|
8136
|
+
return /* @__PURE__ */ jsx66(DateInput_default, { component, onSubmit, ...rest });
|
|
8110
8137
|
}
|
|
8111
8138
|
if (inputVariant === "CHECKBOX" || inputType === "checkbox") {
|
|
8112
|
-
return /* @__PURE__ */
|
|
8139
|
+
return /* @__PURE__ */ jsx66(CheckboxInput_default, { component, onSubmit, ...rest });
|
|
8113
8140
|
}
|
|
8114
|
-
return /* @__PURE__ */
|
|
8141
|
+
return /* @__PURE__ */ jsx66(TextInput_default, { component, onSubmit, ...rest });
|
|
8115
8142
|
case EmbeddedFlowComponentType3.Button: {
|
|
8116
8143
|
const buttonVariant = component.variant?.toUpperCase();
|
|
8117
8144
|
const buttonText = component.config["text"] || component.config["label"] || "";
|
|
8118
8145
|
if (buttonVariant === "SOCIAL") {
|
|
8119
8146
|
if (buttonText.toLowerCase().includes("google")) {
|
|
8120
|
-
return /* @__PURE__ */
|
|
8147
|
+
return /* @__PURE__ */ jsx66(GoogleButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
|
|
8121
8148
|
}
|
|
8122
8149
|
if (buttonText.toLowerCase().includes("github")) {
|
|
8123
|
-
return /* @__PURE__ */
|
|
8150
|
+
return /* @__PURE__ */ jsx66(GitHubButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
|
|
8124
8151
|
}
|
|
8125
8152
|
if (buttonText.toLowerCase().includes("microsoft")) {
|
|
8126
|
-
return /* @__PURE__ */
|
|
8153
|
+
return /* @__PURE__ */ jsx66(MicrosoftButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
|
|
8127
8154
|
}
|
|
8128
8155
|
if (buttonText.toLowerCase().includes("facebook")) {
|
|
8129
|
-
return /* @__PURE__ */
|
|
8156
|
+
return /* @__PURE__ */ jsx66(FacebookButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
|
|
8130
8157
|
}
|
|
8131
8158
|
if (buttonText.toLowerCase().includes("linkedin")) {
|
|
8132
|
-
return /* @__PURE__ */
|
|
8159
|
+
return /* @__PURE__ */ jsx66(LinkedInButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
|
|
8133
8160
|
}
|
|
8134
8161
|
if (buttonText.toLowerCase().includes("ethereum")) {
|
|
8135
|
-
return /* @__PURE__ */
|
|
8162
|
+
return /* @__PURE__ */ jsx66(SignInWithEthereumButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
|
|
8136
8163
|
}
|
|
8137
8164
|
}
|
|
8138
|
-
return /* @__PURE__ */
|
|
8165
|
+
return /* @__PURE__ */ jsx66(SubmitButton_default, { component, onSubmit, ...rest });
|
|
8139
8166
|
}
|
|
8140
8167
|
case EmbeddedFlowComponentType3.Form:
|
|
8141
|
-
return /* @__PURE__ */
|
|
8168
|
+
return /* @__PURE__ */ jsx66(FormContainer_default, { component, onSubmit, ...rest });
|
|
8142
8169
|
case EmbeddedFlowComponentType3.Divider:
|
|
8143
|
-
return /* @__PURE__ */
|
|
8170
|
+
return /* @__PURE__ */ jsx66(DividerComponent_default, { component, onSubmit, ...rest });
|
|
8144
8171
|
case EmbeddedFlowComponentType3.Image:
|
|
8145
|
-
return /* @__PURE__ */
|
|
8172
|
+
return /* @__PURE__ */ jsx66(ImageComponent_default, { component, onSubmit, ...rest });
|
|
8146
8173
|
default:
|
|
8147
|
-
return /* @__PURE__ */
|
|
8174
|
+
return /* @__PURE__ */ jsx66("div", {});
|
|
8148
8175
|
}
|
|
8149
8176
|
};
|
|
8150
8177
|
var createSignUpOptionFromComponent = (component, formValues, touchedFields, formErrors, isLoading, isFormValid, onInputChange, options) => createSignUpComponent({
|
|
@@ -8175,12 +8202,21 @@ var renderSignUpComponents = (components, formValues, touchedFields, formErrors,
|
|
|
8175
8202
|
).filter(Boolean);
|
|
8176
8203
|
|
|
8177
8204
|
// src/components/presentation/SignUp/transformer.ts
|
|
8178
|
-
import {
|
|
8205
|
+
import {
|
|
8206
|
+
EmbeddedFlowComponentType as EmbeddedFlowComponentType4
|
|
8207
|
+
} from "@asgardeo/browser";
|
|
8179
8208
|
var generateId2 = (prefix) => {
|
|
8180
8209
|
const suffix = Math.random().toString(36).substring(2, 6);
|
|
8181
8210
|
return `${prefix}_${suffix}`;
|
|
8182
8211
|
};
|
|
8183
|
-
var getInputVariant2 = (type) => {
|
|
8212
|
+
var getInputVariant2 = (type, name) => {
|
|
8213
|
+
const lowerName = name.toLowerCase();
|
|
8214
|
+
if (lowerName.includes("password")) {
|
|
8215
|
+
return "PASSWORD";
|
|
8216
|
+
}
|
|
8217
|
+
if (lowerName.includes("email")) {
|
|
8218
|
+
return "EMAIL";
|
|
8219
|
+
}
|
|
8184
8220
|
switch (type.toLowerCase()) {
|
|
8185
8221
|
case "email":
|
|
8186
8222
|
return "EMAIL";
|
|
@@ -8207,7 +8243,7 @@ var getInputPlaceholder2 = (name, type, t) => {
|
|
|
8207
8243
|
return placeholder;
|
|
8208
8244
|
};
|
|
8209
8245
|
var convertSimpleInputToComponent2 = (input, t) => {
|
|
8210
|
-
const variant = getInputVariant2(input.type);
|
|
8246
|
+
const variant = getInputVariant2(input.type, input.name);
|
|
8211
8247
|
const label = getInputLabel2(input.name, input.type, t);
|
|
8212
8248
|
const placeholder = getInputPlaceholder2(input.name, input.type, t);
|
|
8213
8249
|
return {
|
|
@@ -8215,7 +8251,7 @@ var convertSimpleInputToComponent2 = (input, t) => {
|
|
|
8215
8251
|
type: EmbeddedFlowComponentType4.Input,
|
|
8216
8252
|
variant,
|
|
8217
8253
|
config: {
|
|
8218
|
-
type: input.type
|
|
8254
|
+
type: input.type,
|
|
8219
8255
|
label,
|
|
8220
8256
|
placeholder,
|
|
8221
8257
|
required: input.required,
|
|
@@ -8277,6 +8313,38 @@ var transformSimpleToComponentDriven2 = (response, t) => {
|
|
|
8277
8313
|
}
|
|
8278
8314
|
return result;
|
|
8279
8315
|
};
|
|
8316
|
+
var extractErrorMessage = (error, t) => {
|
|
8317
|
+
let errorMessage = t("errors.sign.up.flow.failure");
|
|
8318
|
+
if (error && typeof error === "object") {
|
|
8319
|
+
if (error.flowStatus === "ERROR" && error.failureReason) {
|
|
8320
|
+
errorMessage = error.failureReason;
|
|
8321
|
+
} else if (error.code && (error.message || error.description)) {
|
|
8322
|
+
errorMessage = error.description || error.message;
|
|
8323
|
+
} else if (error instanceof Error && error.name === "AsgardeoAPIError") {
|
|
8324
|
+
try {
|
|
8325
|
+
const errorResponse = JSON.parse(
|
|
8326
|
+
error.message
|
|
8327
|
+
);
|
|
8328
|
+
if (errorResponse.failureReason) {
|
|
8329
|
+
errorMessage = errorResponse.failureReason;
|
|
8330
|
+
} else if (errorResponse.description) {
|
|
8331
|
+
errorMessage = errorResponse.description;
|
|
8332
|
+
} else if (errorResponse.message) {
|
|
8333
|
+
errorMessage = errorResponse.message;
|
|
8334
|
+
} else {
|
|
8335
|
+
errorMessage = error.message;
|
|
8336
|
+
}
|
|
8337
|
+
} catch {
|
|
8338
|
+
errorMessage = error.message;
|
|
8339
|
+
}
|
|
8340
|
+
} else if (error.message) {
|
|
8341
|
+
errorMessage = error.message;
|
|
8342
|
+
}
|
|
8343
|
+
} else if (typeof error === "string") {
|
|
8344
|
+
errorMessage = error;
|
|
8345
|
+
}
|
|
8346
|
+
return errorMessage;
|
|
8347
|
+
};
|
|
8280
8348
|
|
|
8281
8349
|
// src/components/presentation/SignUp/BaseSignUp.styles.ts
|
|
8282
8350
|
import { css as css18 } from "@emotion/css";
|
|
@@ -8420,13 +8488,13 @@ var useStyles18 = (theme, colorScheme) => {
|
|
|
8420
8488
|
var BaseSignUp_styles_default = useStyles18;
|
|
8421
8489
|
|
|
8422
8490
|
// src/components/presentation/SignUp/BaseSignUp.tsx
|
|
8423
|
-
import { jsx as
|
|
8491
|
+
import { jsx as jsx67, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
8424
8492
|
var BaseSignUp = (props) => {
|
|
8425
8493
|
const { theme, colorScheme } = useTheme_default();
|
|
8426
8494
|
const styles = BaseSignUp_styles_default(theme, colorScheme);
|
|
8427
8495
|
return /* @__PURE__ */ jsxs28("div", { children: [
|
|
8428
|
-
/* @__PURE__ */
|
|
8429
|
-
/* @__PURE__ */
|
|
8496
|
+
/* @__PURE__ */ jsx67("div", { className: styles.logoContainer, children: /* @__PURE__ */ jsx67(Logo_default, { size: "large" }) }),
|
|
8497
|
+
/* @__PURE__ */ jsx67(FlowProvider_default, { children: /* @__PURE__ */ jsx67(BaseSignUpContent, { ...props }) })
|
|
8430
8498
|
] });
|
|
8431
8499
|
};
|
|
8432
8500
|
var BaseSignUpContent = ({
|
|
@@ -8448,12 +8516,22 @@ var BaseSignUpContent = ({
|
|
|
8448
8516
|
}) => {
|
|
8449
8517
|
const { theme, colorScheme } = useTheme_default();
|
|
8450
8518
|
const { t } = useTranslation_default();
|
|
8451
|
-
const { subtitle: flowSubtitle, title: flowTitle, messages: flowMessages } = useFlow_default();
|
|
8519
|
+
const { subtitle: flowSubtitle, title: flowTitle, messages: flowMessages, addMessage, clearMessages } = useFlow_default();
|
|
8452
8520
|
const styles = BaseSignUp_styles_default(theme, colorScheme);
|
|
8521
|
+
const handleError = useCallback11(
|
|
8522
|
+
(error) => {
|
|
8523
|
+
const errorMessage = extractErrorMessage(error, t);
|
|
8524
|
+
clearMessages();
|
|
8525
|
+
addMessage({
|
|
8526
|
+
type: "error",
|
|
8527
|
+
message: errorMessage
|
|
8528
|
+
});
|
|
8529
|
+
},
|
|
8530
|
+
[t, addMessage, clearMessages]
|
|
8531
|
+
);
|
|
8453
8532
|
const [isLoading, setIsLoading] = useState17(false);
|
|
8454
8533
|
const [isFlowInitialized, setIsFlowInitialized] = useState17(false);
|
|
8455
8534
|
const [currentFlow, setCurrentFlow] = useState17(null);
|
|
8456
|
-
const [error, setError] = useState17(null);
|
|
8457
8535
|
const [formData, setFormData] = useState17({});
|
|
8458
8536
|
const initializationAttemptedRef = useRef5(false);
|
|
8459
8537
|
const normalizeFlowResponse2 = useCallback11(
|
|
@@ -8554,7 +8632,7 @@ var BaseSignUpContent = ({
|
|
|
8554
8632
|
return;
|
|
8555
8633
|
}
|
|
8556
8634
|
setIsLoading(true);
|
|
8557
|
-
|
|
8635
|
+
clearMessages();
|
|
8558
8636
|
try {
|
|
8559
8637
|
const filteredInputs = {};
|
|
8560
8638
|
if (data) {
|
|
@@ -8585,8 +8663,7 @@ var BaseSignUpContent = ({
|
|
|
8585
8663
|
setupFormFields(response);
|
|
8586
8664
|
}
|
|
8587
8665
|
} catch (err) {
|
|
8588
|
-
|
|
8589
|
-
setError(errorMessage);
|
|
8666
|
+
handleError(err);
|
|
8590
8667
|
onError?.(err);
|
|
8591
8668
|
} finally {
|
|
8592
8669
|
setIsLoading(false);
|
|
@@ -8631,8 +8708,7 @@ var BaseSignUpContent = ({
|
|
|
8631
8708
|
popup.close();
|
|
8632
8709
|
cleanup();
|
|
8633
8710
|
} catch (err) {
|
|
8634
|
-
|
|
8635
|
-
setError(errorMessage);
|
|
8711
|
+
handleError(err);
|
|
8636
8712
|
onError?.(err);
|
|
8637
8713
|
popup.close();
|
|
8638
8714
|
cleanup();
|
|
@@ -8663,9 +8739,9 @@ var BaseSignUpContent = ({
|
|
|
8663
8739
|
const url = new URL(popupUrl);
|
|
8664
8740
|
const code = url.searchParams.get("code");
|
|
8665
8741
|
const state = url.searchParams.get("state");
|
|
8666
|
-
const
|
|
8667
|
-
if (
|
|
8668
|
-
console.error("OAuth error:",
|
|
8742
|
+
const error = url.searchParams.get("error");
|
|
8743
|
+
if (error) {
|
|
8744
|
+
console.error("OAuth error:", error);
|
|
8669
8745
|
popup.close();
|
|
8670
8746
|
cleanup();
|
|
8671
8747
|
return;
|
|
@@ -8691,8 +8767,7 @@ var BaseSignUpContent = ({
|
|
|
8691
8767
|
}
|
|
8692
8768
|
popup.close();
|
|
8693
8769
|
} catch (err) {
|
|
8694
|
-
|
|
8695
|
-
setError(errorMessage);
|
|
8770
|
+
handleError(err);
|
|
8696
8771
|
onError?.(err);
|
|
8697
8772
|
popup.close();
|
|
8698
8773
|
}
|
|
@@ -8745,7 +8820,6 @@ var BaseSignUpContent = ({
|
|
|
8745
8820
|
handleInputChange,
|
|
8746
8821
|
{
|
|
8747
8822
|
buttonClassName: buttonClasses,
|
|
8748
|
-
error,
|
|
8749
8823
|
inputClassName: inputClasses,
|
|
8750
8824
|
onSubmit: handleSubmit,
|
|
8751
8825
|
size,
|
|
@@ -8760,7 +8834,6 @@ var BaseSignUpContent = ({
|
|
|
8760
8834
|
isLoading,
|
|
8761
8835
|
size,
|
|
8762
8836
|
variant,
|
|
8763
|
-
error,
|
|
8764
8837
|
inputClasses,
|
|
8765
8838
|
buttonClasses,
|
|
8766
8839
|
handleSubmit
|
|
@@ -8771,7 +8844,7 @@ var BaseSignUpContent = ({
|
|
|
8771
8844
|
initializationAttemptedRef.current = true;
|
|
8772
8845
|
(async () => {
|
|
8773
8846
|
setIsLoading(true);
|
|
8774
|
-
|
|
8847
|
+
clearMessages();
|
|
8775
8848
|
try {
|
|
8776
8849
|
const rawResponse = await onInitialize();
|
|
8777
8850
|
const response = normalizeFlowResponse2(rawResponse);
|
|
@@ -8786,8 +8859,7 @@ var BaseSignUpContent = ({
|
|
|
8786
8859
|
setupFormFields(response);
|
|
8787
8860
|
}
|
|
8788
8861
|
} catch (err) {
|
|
8789
|
-
|
|
8790
|
-
setError(errorMessage);
|
|
8862
|
+
handleError(err);
|
|
8791
8863
|
onError?.(err);
|
|
8792
8864
|
} finally {
|
|
8793
8865
|
setIsLoading(false);
|
|
@@ -8813,7 +8885,6 @@ var BaseSignUpContent = ({
|
|
|
8813
8885
|
touched: touchedFields,
|
|
8814
8886
|
isValid: isFormValid,
|
|
8815
8887
|
isLoading,
|
|
8816
|
-
error,
|
|
8817
8888
|
components: currentFlow?.data?.components || [],
|
|
8818
8889
|
handleInputChange,
|
|
8819
8890
|
handleSubmit,
|
|
@@ -8822,34 +8893,32 @@ var BaseSignUpContent = ({
|
|
|
8822
8893
|
subtitle: flowSubtitle || t("signup.subtitle"),
|
|
8823
8894
|
messages: flowMessages || []
|
|
8824
8895
|
};
|
|
8825
|
-
return /* @__PURE__ */
|
|
8896
|
+
return /* @__PURE__ */ jsx67("div", { className: containerClasses, children: children(renderProps) });
|
|
8826
8897
|
}
|
|
8827
8898
|
if (!isFlowInitialized && isLoading) {
|
|
8828
|
-
return /* @__PURE__ */
|
|
8899
|
+
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
8900
|
}
|
|
8830
8901
|
if (!currentFlow) {
|
|
8831
|
-
return /* @__PURE__ */
|
|
8832
|
-
/* @__PURE__ */
|
|
8833
|
-
/* @__PURE__ */
|
|
8902
|
+
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: [
|
|
8903
|
+
/* @__PURE__ */ jsx67(Alert_default.Title, { children: t("errors.title") }),
|
|
8904
|
+
/* @__PURE__ */ jsx67(Alert_default.Description, { children: t("errors.sign.up.flow.initialization.failure") })
|
|
8834
8905
|
] }) }) });
|
|
8835
8906
|
}
|
|
8836
8907
|
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
|
-
] })
|
|
8908
|
+
/* @__PURE__ */ jsxs28(Card_default.Header, { className: styles.header, children: [
|
|
8909
|
+
/* @__PURE__ */ jsx67(Card_default.Title, { level: 2, className: styles.title, children: flowTitle || t("signup.title") }),
|
|
8910
|
+
/* @__PURE__ */ jsx67(Typography_default, { variant: "body1", className: styles.subtitle, children: flowSubtitle || t("signup.subtitle") }),
|
|
8911
|
+
flowMessages && flowMessages.length > 0 && /* @__PURE__ */ jsx67("div", { className: styles.flowMessagesContainer, children: flowMessages.map((message, index) => /* @__PURE__ */ jsx67(
|
|
8912
|
+
Alert_default,
|
|
8913
|
+
{
|
|
8914
|
+
variant: message.type?.toLowerCase() === "error" ? "error" : "info",
|
|
8915
|
+
className: cx21(styles.flowMessageItem, messageClasses),
|
|
8916
|
+
children: /* @__PURE__ */ jsx67(Alert_default.Description, { children: message.message })
|
|
8917
|
+
},
|
|
8918
|
+
message.id || index
|
|
8919
|
+
)) })
|
|
8920
|
+
] }),
|
|
8921
|
+
/* @__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
8922
|
] });
|
|
8854
8923
|
};
|
|
8855
8924
|
var BaseSignUp_default = BaseSignUp;
|
|
@@ -8858,9 +8927,9 @@ var BaseSignUp_default = BaseSignUp;
|
|
|
8858
8927
|
import {
|
|
8859
8928
|
EmbeddedFlowResponseType as EmbeddedFlowResponseType2,
|
|
8860
8929
|
EmbeddedFlowType as EmbeddedFlowType2,
|
|
8861
|
-
Platform as
|
|
8930
|
+
Platform as Platform5
|
|
8862
8931
|
} from "@asgardeo/browser";
|
|
8863
|
-
import { jsx as
|
|
8932
|
+
import { jsx as jsx68 } from "react/jsx-runtime";
|
|
8864
8933
|
var SignUp = ({
|
|
8865
8934
|
className,
|
|
8866
8935
|
size = "medium",
|
|
@@ -8875,7 +8944,7 @@ var SignUp = ({
|
|
|
8875
8944
|
const handleInitialize = async (payload) => {
|
|
8876
8945
|
const initialPayload = payload || {
|
|
8877
8946
|
flowType: EmbeddedFlowType2.Registration,
|
|
8878
|
-
...platform ===
|
|
8947
|
+
...platform === Platform5.AsgardeoV2 && applicationId && { applicationId }
|
|
8879
8948
|
};
|
|
8880
8949
|
return await signUp(initialPayload);
|
|
8881
8950
|
};
|
|
@@ -8890,7 +8959,7 @@ var SignUp = ({
|
|
|
8890
8959
|
window.location.href = response.data.redirectURL;
|
|
8891
8960
|
}
|
|
8892
8961
|
};
|
|
8893
|
-
return /* @__PURE__ */
|
|
8962
|
+
return /* @__PURE__ */ jsx68(
|
|
8894
8963
|
BaseSignUp_default,
|
|
8895
8964
|
{
|
|
8896
8965
|
afterSignUpUrl,
|
|
@@ -8909,41 +8978,41 @@ var SignUp = ({
|
|
|
8909
8978
|
var SignUp_default = SignUp;
|
|
8910
8979
|
|
|
8911
8980
|
// src/components/presentation/User/BaseUser.tsx
|
|
8912
|
-
import { Fragment as Fragment13, jsx as
|
|
8981
|
+
import { Fragment as Fragment13, jsx as jsx69 } from "react/jsx-runtime";
|
|
8913
8982
|
var BaseUser = ({ user, children, fallback = null }) => {
|
|
8914
8983
|
if (!user) {
|
|
8915
|
-
return /* @__PURE__ */
|
|
8984
|
+
return /* @__PURE__ */ jsx69(Fragment13, { children: fallback });
|
|
8916
8985
|
}
|
|
8917
|
-
return /* @__PURE__ */
|
|
8986
|
+
return /* @__PURE__ */ jsx69(Fragment13, { children: children(user) });
|
|
8918
8987
|
};
|
|
8919
8988
|
BaseUser.displayName = "BaseUser";
|
|
8920
8989
|
var BaseUser_default = BaseUser;
|
|
8921
8990
|
|
|
8922
8991
|
// src/components/presentation/User/User.tsx
|
|
8923
|
-
import { jsx as
|
|
8992
|
+
import { jsx as jsx70 } from "react/jsx-runtime";
|
|
8924
8993
|
var User5 = ({ children, fallback = null }) => {
|
|
8925
8994
|
const { user } = useAsgardeo_default();
|
|
8926
|
-
return /* @__PURE__ */
|
|
8995
|
+
return /* @__PURE__ */ jsx70(BaseUser_default, { user, fallback, children });
|
|
8927
8996
|
};
|
|
8928
8997
|
User5.displayName = "User";
|
|
8929
8998
|
var User_default = User5;
|
|
8930
8999
|
|
|
8931
9000
|
// src/components/presentation/Organization/BaseOrganization.tsx
|
|
8932
|
-
import { Fragment as Fragment14, jsx as
|
|
9001
|
+
import { Fragment as Fragment14, jsx as jsx71 } from "react/jsx-runtime";
|
|
8933
9002
|
var BaseOrganization = ({ children, fallback = null, organization }) => {
|
|
8934
9003
|
if (!organization) {
|
|
8935
|
-
return /* @__PURE__ */
|
|
9004
|
+
return /* @__PURE__ */ jsx71(Fragment14, { children: fallback });
|
|
8936
9005
|
}
|
|
8937
|
-
return /* @__PURE__ */
|
|
9006
|
+
return /* @__PURE__ */ jsx71(Fragment14, { children: children(organization) });
|
|
8938
9007
|
};
|
|
8939
9008
|
BaseOrganization.displayName = "BaseOrganization";
|
|
8940
9009
|
var BaseOrganization_default = BaseOrganization;
|
|
8941
9010
|
|
|
8942
9011
|
// src/components/presentation/Organization/Organization.tsx
|
|
8943
|
-
import { jsx as
|
|
9012
|
+
import { jsx as jsx72 } from "react/jsx-runtime";
|
|
8944
9013
|
var Organization5 = ({ children, fallback = null }) => {
|
|
8945
9014
|
const { currentOrganization } = useOrganization_default();
|
|
8946
|
-
return /* @__PURE__ */
|
|
9015
|
+
return /* @__PURE__ */ jsx72(BaseOrganization_default, { organization: currentOrganization, fallback, children });
|
|
8947
9016
|
};
|
|
8948
9017
|
Organization5.displayName = "Organization";
|
|
8949
9018
|
var Organization_default = Organization5;
|
|
@@ -9049,7 +9118,7 @@ var useStyles19 = (theme, colorScheme, size, variant, backgroundColor) => {
|
|
|
9049
9118
|
var Avatar_styles_default = useStyles19;
|
|
9050
9119
|
|
|
9051
9120
|
// src/components/primitives/Avatar/Avatar.tsx
|
|
9052
|
-
import { jsx as
|
|
9121
|
+
import { jsx as jsx73 } from "react/jsx-runtime";
|
|
9053
9122
|
var Avatar = ({
|
|
9054
9123
|
alt = "User avatar",
|
|
9055
9124
|
background = "random",
|
|
@@ -9096,25 +9165,25 @@ var Avatar = ({
|
|
|
9096
9165
|
const getInitials = (fullName) => fullName.split(" ").map((part) => part[0]).slice(0, 2).join("").toUpperCase();
|
|
9097
9166
|
const renderContent = () => {
|
|
9098
9167
|
if (imageUrl) {
|
|
9099
|
-
return /* @__PURE__ */
|
|
9168
|
+
return /* @__PURE__ */ jsx73("img", { src: imageUrl, alt, className: cx22(withVendorCSSClassPrefix22(bem16("avatar", "image")), styles.image) });
|
|
9100
9169
|
}
|
|
9101
9170
|
if (name) {
|
|
9102
9171
|
return getInitials(name);
|
|
9103
9172
|
}
|
|
9104
9173
|
if (isLoading) {
|
|
9105
|
-
return /* @__PURE__ */
|
|
9174
|
+
return /* @__PURE__ */ jsx73("div", { className: cx22(withVendorCSSClassPrefix22(bem16("avatar", "skeleton")), styles.skeleton) });
|
|
9106
9175
|
}
|
|
9107
|
-
return /* @__PURE__ */
|
|
9176
|
+
return /* @__PURE__ */ jsx73(
|
|
9108
9177
|
"svg",
|
|
9109
9178
|
{
|
|
9110
9179
|
xmlns: "http://www.w3.org/2000/svg",
|
|
9111
9180
|
viewBox: "0 0 640 640",
|
|
9112
9181
|
className: cx22(withVendorCSSClassPrefix22(bem16("avatar", "icon")), styles.icon),
|
|
9113
|
-
children: /* @__PURE__ */
|
|
9182
|
+
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
9183
|
}
|
|
9115
9184
|
);
|
|
9116
9185
|
};
|
|
9117
|
-
return /* @__PURE__ */
|
|
9186
|
+
return /* @__PURE__ */ jsx73(
|
|
9118
9187
|
"div",
|
|
9119
9188
|
{
|
|
9120
9189
|
className: cx22(
|
|
@@ -9149,7 +9218,7 @@ import { cx as cx23 } from "@emotion/css";
|
|
|
9149
9218
|
import React2 from "react";
|
|
9150
9219
|
|
|
9151
9220
|
// src/components/primitives/Icons/LogOut.tsx
|
|
9152
|
-
import { jsx as
|
|
9221
|
+
import { jsx as jsx74, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
9153
9222
|
var LogOut = (props) => /* @__PURE__ */ jsxs29(
|
|
9154
9223
|
"svg",
|
|
9155
9224
|
{
|
|
@@ -9164,16 +9233,16 @@ var LogOut = (props) => /* @__PURE__ */ jsxs29(
|
|
|
9164
9233
|
strokeLinejoin: "round",
|
|
9165
9234
|
...props,
|
|
9166
9235
|
children: [
|
|
9167
|
-
/* @__PURE__ */
|
|
9168
|
-
/* @__PURE__ */
|
|
9169
|
-
/* @__PURE__ */
|
|
9236
|
+
/* @__PURE__ */ jsx74("path", { d: "m16 17 5-5-5-5" }),
|
|
9237
|
+
/* @__PURE__ */ jsx74("path", { d: "M21 12H9" }),
|
|
9238
|
+
/* @__PURE__ */ jsx74("path", { d: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" })
|
|
9170
9239
|
]
|
|
9171
9240
|
}
|
|
9172
9241
|
);
|
|
9173
9242
|
var LogOut_default = LogOut;
|
|
9174
9243
|
|
|
9175
9244
|
// src/components/primitives/Icons/Plus.tsx
|
|
9176
|
-
import { jsx as
|
|
9245
|
+
import { jsx as jsx75, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
9177
9246
|
var Plus = (props) => /* @__PURE__ */ jsxs30(
|
|
9178
9247
|
"svg",
|
|
9179
9248
|
{
|
|
@@ -9188,15 +9257,15 @@ var Plus = (props) => /* @__PURE__ */ jsxs30(
|
|
|
9188
9257
|
strokeLinejoin: "round",
|
|
9189
9258
|
...props,
|
|
9190
9259
|
children: [
|
|
9191
|
-
/* @__PURE__ */
|
|
9192
|
-
/* @__PURE__ */
|
|
9260
|
+
/* @__PURE__ */ jsx75("path", { d: "M5 12h14" }),
|
|
9261
|
+
/* @__PURE__ */ jsx75("path", { d: "M12 5v14" })
|
|
9193
9262
|
]
|
|
9194
9263
|
}
|
|
9195
9264
|
);
|
|
9196
9265
|
var Plus_default = Plus;
|
|
9197
9266
|
|
|
9198
9267
|
// src/components/primitives/Icons/User.tsx
|
|
9199
|
-
import { jsx as
|
|
9268
|
+
import { jsx as jsx76, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
9200
9269
|
var User7 = (props) => /* @__PURE__ */ jsxs31(
|
|
9201
9270
|
"svg",
|
|
9202
9271
|
{
|
|
@@ -9211,15 +9280,15 @@ var User7 = (props) => /* @__PURE__ */ jsxs31(
|
|
|
9211
9280
|
strokeLinejoin: "round",
|
|
9212
9281
|
...props,
|
|
9213
9282
|
children: [
|
|
9214
|
-
/* @__PURE__ */
|
|
9215
|
-
/* @__PURE__ */
|
|
9283
|
+
/* @__PURE__ */ jsx76("path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" }),
|
|
9284
|
+
/* @__PURE__ */ jsx76("circle", { cx: "12", cy: "7", r: "4" })
|
|
9216
9285
|
]
|
|
9217
9286
|
}
|
|
9218
9287
|
);
|
|
9219
9288
|
var User_default2 = User7;
|
|
9220
9289
|
|
|
9221
9290
|
// src/components/primitives/Icons/X.tsx
|
|
9222
|
-
import { jsx as
|
|
9291
|
+
import { jsx as jsx77, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
9223
9292
|
var X = (props) => /* @__PURE__ */ jsxs32(
|
|
9224
9293
|
"svg",
|
|
9225
9294
|
{
|
|
@@ -9234,8 +9303,8 @@ var X = (props) => /* @__PURE__ */ jsxs32(
|
|
|
9234
9303
|
strokeLinejoin: "round",
|
|
9235
9304
|
...props,
|
|
9236
9305
|
children: [
|
|
9237
|
-
/* @__PURE__ */
|
|
9238
|
-
/* @__PURE__ */
|
|
9306
|
+
/* @__PURE__ */ jsx77("path", { d: "M18 6 6 18" }),
|
|
9307
|
+
/* @__PURE__ */ jsx77("path", { d: "m6 6 12 12" })
|
|
9239
9308
|
]
|
|
9240
9309
|
}
|
|
9241
9310
|
);
|
|
@@ -9307,7 +9376,7 @@ var useStyles20 = (theme, colorScheme) => {
|
|
|
9307
9376
|
var Dialog_styles_default = useStyles20;
|
|
9308
9377
|
|
|
9309
9378
|
// src/components/primitives/Dialog/Dialog.tsx
|
|
9310
|
-
import { jsx as
|
|
9379
|
+
import { jsx as jsx78, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
9311
9380
|
function useDialog({
|
|
9312
9381
|
initialOpen = false,
|
|
9313
9382
|
open: controlledOpen,
|
|
@@ -9353,7 +9422,7 @@ var useDialogContext = () => {
|
|
|
9353
9422
|
};
|
|
9354
9423
|
function Dialog({ children, ...options }) {
|
|
9355
9424
|
const dialog = useDialog(options);
|
|
9356
|
-
return /* @__PURE__ */
|
|
9425
|
+
return /* @__PURE__ */ jsx78(DialogContext.Provider, { value: dialog, children });
|
|
9357
9426
|
}
|
|
9358
9427
|
var DialogTrigger = React2.forwardRef(
|
|
9359
9428
|
({ children, asChild = false, ...props }, propRef) => {
|
|
@@ -9371,7 +9440,7 @@ var DialogTrigger = React2.forwardRef(
|
|
|
9371
9440
|
})
|
|
9372
9441
|
);
|
|
9373
9442
|
}
|
|
9374
|
-
return /* @__PURE__ */
|
|
9443
|
+
return /* @__PURE__ */ jsx78("button", { ref, "data-state": context.open ? "open" : "closed", ...context.getReferenceProps(props), children });
|
|
9375
9444
|
}
|
|
9376
9445
|
);
|
|
9377
9446
|
var DialogContent = React2.forwardRef((props, propRef) => {
|
|
@@ -9380,7 +9449,7 @@ var DialogContent = React2.forwardRef((props, propRef) => {
|
|
|
9380
9449
|
const styles = Dialog_styles_default(theme, colorScheme);
|
|
9381
9450
|
const ref = useMergeRefs([context.refs.setFloating, propRef]);
|
|
9382
9451
|
if (!floatingContext.open) return null;
|
|
9383
|
-
return /* @__PURE__ */
|
|
9452
|
+
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
9453
|
"div",
|
|
9385
9454
|
{
|
|
9386
9455
|
ref,
|
|
@@ -9403,7 +9472,7 @@ var DialogHeading = React2.forwardRef(
|
|
|
9403
9472
|
return () => context.setLabelId(void 0);
|
|
9404
9473
|
}, [id, context.setLabelId]);
|
|
9405
9474
|
return /* @__PURE__ */ jsxs33("div", { className: cx23(withVendorCSSClassPrefix23(bem17("dialog", "header")), styles.header), children: [
|
|
9406
|
-
/* @__PURE__ */
|
|
9475
|
+
/* @__PURE__ */ jsx78(
|
|
9407
9476
|
"h2",
|
|
9408
9477
|
{
|
|
9409
9478
|
...props,
|
|
@@ -9413,7 +9482,7 @@ var DialogHeading = React2.forwardRef(
|
|
|
9413
9482
|
children
|
|
9414
9483
|
}
|
|
9415
9484
|
),
|
|
9416
|
-
/* @__PURE__ */
|
|
9485
|
+
/* @__PURE__ */ jsx78(
|
|
9417
9486
|
Button_default,
|
|
9418
9487
|
{
|
|
9419
9488
|
color: "tertiary",
|
|
@@ -9422,7 +9491,7 @@ var DialogHeading = React2.forwardRef(
|
|
|
9422
9491
|
shape: "round",
|
|
9423
9492
|
onClick: () => context.setOpen(false),
|
|
9424
9493
|
"aria-label": "Close",
|
|
9425
|
-
children: /* @__PURE__ */
|
|
9494
|
+
children: /* @__PURE__ */ jsx78(X_default, { width: 16, height: 16 })
|
|
9426
9495
|
}
|
|
9427
9496
|
)
|
|
9428
9497
|
] });
|
|
@@ -9438,7 +9507,7 @@ var DialogDescription = React2.forwardRef(
|
|
|
9438
9507
|
context.setDescriptionId(id);
|
|
9439
9508
|
return () => context.setDescriptionId(void 0);
|
|
9440
9509
|
}, [id, context.setDescriptionId]);
|
|
9441
|
-
return /* @__PURE__ */
|
|
9510
|
+
return /* @__PURE__ */ jsx78(
|
|
9442
9511
|
"p",
|
|
9443
9512
|
{
|
|
9444
9513
|
...props,
|
|
@@ -9468,7 +9537,7 @@ var DialogClose = React2.forwardRef(({ children, asChild = false, ...props }, pr
|
|
|
9468
9537
|
onClick: handleClick
|
|
9469
9538
|
});
|
|
9470
9539
|
}
|
|
9471
|
-
return /* @__PURE__ */
|
|
9540
|
+
return /* @__PURE__ */ jsx78(
|
|
9472
9541
|
Button_default,
|
|
9473
9542
|
{
|
|
9474
9543
|
...props,
|
|
@@ -9591,7 +9660,7 @@ var useStyles21 = (theme, colorScheme, disabled, hasError, canAddMore, canRemove
|
|
|
9591
9660
|
var MultiInput_styles_default = useStyles21;
|
|
9592
9661
|
|
|
9593
9662
|
// src/components/primitives/MultiInput/MultiInput.tsx
|
|
9594
|
-
import { jsx as
|
|
9663
|
+
import { jsx as jsx79, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
9595
9664
|
var MultiInput = ({
|
|
9596
9665
|
label,
|
|
9597
9666
|
error,
|
|
@@ -9614,8 +9683,8 @@ var MultiInput = ({
|
|
|
9614
9683
|
const canAddMore = !maxFields || values.length < maxFields;
|
|
9615
9684
|
const canRemove = values.length > minFields;
|
|
9616
9685
|
const styles = MultiInput_styles_default(theme, colorScheme, !!disabled, !!error, canAddMore, canRemove);
|
|
9617
|
-
const PlusIcon = ({ className: className2 }) => /* @__PURE__ */
|
|
9618
|
-
const BinIcon = ({ className: className2 }) => /* @__PURE__ */
|
|
9686
|
+
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" }) });
|
|
9687
|
+
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
9688
|
const handleAddValue = useCallback12(
|
|
9620
9689
|
(newValue) => {
|
|
9621
9690
|
if (newValue.trim() !== "" && (!maxFields || values.length < maxFields)) {
|
|
@@ -9659,9 +9728,9 @@ var MultiInput = ({
|
|
|
9659
9728
|
};
|
|
9660
9729
|
switch (fieldType) {
|
|
9661
9730
|
case "DATE_TIME":
|
|
9662
|
-
return /* @__PURE__ */
|
|
9731
|
+
return /* @__PURE__ */ jsx79(DatePicker_default, { ...commonProps });
|
|
9663
9732
|
case "BOOLEAN":
|
|
9664
|
-
return /* @__PURE__ */
|
|
9733
|
+
return /* @__PURE__ */ jsx79(
|
|
9665
9734
|
Checkbox_default,
|
|
9666
9735
|
{
|
|
9667
9736
|
...commonProps,
|
|
@@ -9670,7 +9739,7 @@ var MultiInput = ({
|
|
|
9670
9739
|
}
|
|
9671
9740
|
);
|
|
9672
9741
|
default:
|
|
9673
|
-
return /* @__PURE__ */
|
|
9742
|
+
return /* @__PURE__ */ jsx79(TextField_default, { ...commonProps, type });
|
|
9674
9743
|
}
|
|
9675
9744
|
},
|
|
9676
9745
|
[placeholder, disabled, startIcon, endIcon, error, fieldType, type]
|
|
@@ -9690,27 +9759,27 @@ var MultiInput = ({
|
|
|
9690
9759
|
className: cx24(withVendorCSSClassPrefix24(bem18("multi-input")), className),
|
|
9691
9760
|
style,
|
|
9692
9761
|
children: [
|
|
9693
|
-
label && /* @__PURE__ */
|
|
9762
|
+
label && /* @__PURE__ */ jsx79(InputLabel_default, { required, error: !!error, children: label }),
|
|
9694
9763
|
/* @__PURE__ */ jsxs34("div", { className: cx24(withVendorCSSClassPrefix24(bem18("multi-input", "container")), styles.container), children: [
|
|
9695
|
-
/* @__PURE__ */
|
|
9764
|
+
/* @__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
9765
|
currentInputValue,
|
|
9697
9766
|
setCurrentInputValue,
|
|
9698
|
-
canAddMore ? /* @__PURE__ */
|
|
9767
|
+
canAddMore ? /* @__PURE__ */ jsx79(PlusIcon, { className: styles.plusIcon }) : void 0,
|
|
9699
9768
|
canAddMore ? handleInputSubmit : void 0
|
|
9700
9769
|
) }) }),
|
|
9701
|
-
values.length > 0 && /* @__PURE__ */
|
|
9770
|
+
values.length > 0 && /* @__PURE__ */ jsx79("div", { className: cx24(withVendorCSSClassPrefix24(bem18("multi-input", "list-container")), styles.listContainer), children: values.map((value, index) => /* @__PURE__ */ jsxs34(
|
|
9702
9771
|
"div",
|
|
9703
9772
|
{
|
|
9704
9773
|
className: cx24(withVendorCSSClassPrefix24(bem18("multi-input", "list-item")), styles.listItem),
|
|
9705
9774
|
children: [
|
|
9706
|
-
/* @__PURE__ */
|
|
9775
|
+
/* @__PURE__ */ jsx79(
|
|
9707
9776
|
"span",
|
|
9708
9777
|
{
|
|
9709
9778
|
className: cx24(withVendorCSSClassPrefix24(bem18("multi-input", "list-item-text")), styles.listItemText),
|
|
9710
9779
|
children: value
|
|
9711
9780
|
}
|
|
9712
9781
|
),
|
|
9713
|
-
canRemove && /* @__PURE__ */
|
|
9782
|
+
canRemove && /* @__PURE__ */ jsx79(
|
|
9714
9783
|
"button",
|
|
9715
9784
|
{
|
|
9716
9785
|
type: "button",
|
|
@@ -9718,7 +9787,7 @@ var MultiInput = ({
|
|
|
9718
9787
|
disabled,
|
|
9719
9788
|
className: cx24(withVendorCSSClassPrefix24(bem18("multi-input", "remove-button")), styles.removeButton),
|
|
9720
9789
|
title: "Remove value",
|
|
9721
|
-
children: /* @__PURE__ */
|
|
9790
|
+
children: /* @__PURE__ */ jsx79(BinIcon, { className: styles.icon })
|
|
9722
9791
|
}
|
|
9723
9792
|
)
|
|
9724
9793
|
]
|
|
@@ -9917,7 +9986,7 @@ var getDisplayName = (mergedMappings, user) => {
|
|
|
9917
9986
|
var getDisplayName_default = getDisplayName;
|
|
9918
9987
|
|
|
9919
9988
|
// src/components/presentation/UserProfile/BaseUserProfile.tsx
|
|
9920
|
-
import { Fragment as Fragment15, jsx as
|
|
9989
|
+
import { Fragment as Fragment15, jsx as jsx80, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
9921
9990
|
var fieldsToSkip = [
|
|
9922
9991
|
"roles.default",
|
|
9923
9992
|
"active",
|
|
@@ -9977,7 +10046,7 @@ var BaseUserProfile = ({
|
|
|
9977
10046
|
},
|
|
9978
10047
|
[showFields, hideFields]
|
|
9979
10048
|
);
|
|
9980
|
-
const PencilIcon = () => /* @__PURE__ */
|
|
10049
|
+
const PencilIcon = () => /* @__PURE__ */ jsx80(
|
|
9981
10050
|
"svg",
|
|
9982
10051
|
{
|
|
9983
10052
|
width: "16",
|
|
@@ -9988,7 +10057,7 @@ var BaseUserProfile = ({
|
|
|
9988
10057
|
strokeWidth: "2",
|
|
9989
10058
|
strokeLinecap: "round",
|
|
9990
10059
|
strokeLinejoin: "round",
|
|
9991
|
-
children: /* @__PURE__ */
|
|
10060
|
+
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
10061
|
}
|
|
9993
10062
|
);
|
|
9994
10063
|
const toggleFieldEdit = useCallback13((fieldName) => {
|
|
@@ -10013,12 +10082,12 @@ var BaseUserProfile = ({
|
|
|
10013
10082
|
}, []);
|
|
10014
10083
|
const ObjectDisplay = ({ data }) => {
|
|
10015
10084
|
if (!data || typeof data !== "object") return null;
|
|
10016
|
-
return /* @__PURE__ */
|
|
10017
|
-
/* @__PURE__ */
|
|
10085
|
+
return /* @__PURE__ */ jsx80("table", { className: styles.value, children: /* @__PURE__ */ jsx80("tbody", { children: Object.entries(data).map(([key, value]) => /* @__PURE__ */ jsxs35("tr", { children: [
|
|
10086
|
+
/* @__PURE__ */ jsx80("td", { className: styles.objectKey, children: /* @__PURE__ */ jsxs35("strong", { children: [
|
|
10018
10087
|
formatLabel(key),
|
|
10019
10088
|
":"
|
|
10020
10089
|
] }) }),
|
|
10021
|
-
/* @__PURE__ */
|
|
10090
|
+
/* @__PURE__ */ jsx80("td", { className: styles.objectValue, children: typeof value === "object" ? /* @__PURE__ */ jsx80(ObjectDisplay, { data: value }) : String(value) })
|
|
10022
10091
|
] }, key)) }) });
|
|
10023
10092
|
};
|
|
10024
10093
|
function set(obj, path, value) {
|
|
@@ -10091,9 +10160,9 @@ var BaseUserProfile = ({
|
|
|
10091
10160
|
const { value, displayName, description, name, type, required, mutability, subAttributes, multiValued } = schema;
|
|
10092
10161
|
const label = displayName || description || name || "";
|
|
10093
10162
|
if (subAttributes && Array.isArray(subAttributes)) {
|
|
10094
|
-
return /* @__PURE__ */
|
|
10095
|
-
/* @__PURE__ */
|
|
10096
|
-
/* @__PURE__ */
|
|
10163
|
+
return /* @__PURE__ */ jsx80(Fragment15, { children: subAttributes.map((subAttr, index) => /* @__PURE__ */ jsxs35("div", { className: styles.field, children: [
|
|
10164
|
+
/* @__PURE__ */ jsx80("span", { className: styles.label, children: subAttr.displayName || subAttr.description || "" }),
|
|
10165
|
+
/* @__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
10166
|
] }, index)) });
|
|
10098
10167
|
}
|
|
10099
10168
|
if (Array.isArray(value) || multiValued) {
|
|
@@ -10110,8 +10179,8 @@ var BaseUserProfile = ({
|
|
|
10110
10179
|
fieldValues = [];
|
|
10111
10180
|
}
|
|
10112
10181
|
return /* @__PURE__ */ jsxs35(Fragment15, { children: [
|
|
10113
|
-
/* @__PURE__ */
|
|
10114
|
-
/* @__PURE__ */
|
|
10182
|
+
/* @__PURE__ */ jsx80("span", { className: styles.label, children: label }),
|
|
10183
|
+
/* @__PURE__ */ jsx80("div", { className: styles.value, children: /* @__PURE__ */ jsx80(
|
|
10115
10184
|
MultiInput_default,
|
|
10116
10185
|
{
|
|
10117
10186
|
values: fieldValues,
|
|
@@ -10143,8 +10212,8 @@ var BaseUserProfile = ({
|
|
|
10143
10212
|
displayValue2 = "-";
|
|
10144
10213
|
}
|
|
10145
10214
|
return /* @__PURE__ */ jsxs35(Fragment15, { children: [
|
|
10146
|
-
/* @__PURE__ */
|
|
10147
|
-
/* @__PURE__ */
|
|
10215
|
+
/* @__PURE__ */ jsx80("span", { className: styles.label, children: label }),
|
|
10216
|
+
/* @__PURE__ */ jsx80("div", { className: cx25(styles.value, !hasValues ? styles.valuePlaceholder : ""), children: !hasValues && isEditable2 && onStartEdit ? /* @__PURE__ */ jsx80(
|
|
10148
10217
|
Button_default,
|
|
10149
10218
|
{
|
|
10150
10219
|
onClick: onStartEdit,
|
|
@@ -10159,7 +10228,7 @@ var BaseUserProfile = ({
|
|
|
10159
10228
|
] });
|
|
10160
10229
|
}
|
|
10161
10230
|
if (type === "COMPLEX" && typeof value === "object") {
|
|
10162
|
-
return /* @__PURE__ */
|
|
10231
|
+
return /* @__PURE__ */ jsx80(ObjectDisplay, { data: value });
|
|
10163
10232
|
}
|
|
10164
10233
|
if (isEditing && onEditValue && mutability !== "READ_ONLY" && !readonlyFields.includes(name || "")) {
|
|
10165
10234
|
const fieldValue = editedUser && name && editedUser[name] !== void 0 ? editedUser[name] : flattenedProfile && name && flattenedProfile[name] !== void 0 ? flattenedProfile[name] : value || "";
|
|
@@ -10174,16 +10243,16 @@ var BaseUserProfile = ({
|
|
|
10174
10243
|
let field;
|
|
10175
10244
|
switch (type) {
|
|
10176
10245
|
case "STRING":
|
|
10177
|
-
field = /* @__PURE__ */
|
|
10246
|
+
field = /* @__PURE__ */ jsx80(TextField_default, { ...commonProps });
|
|
10178
10247
|
break;
|
|
10179
10248
|
case "DATE_TIME":
|
|
10180
|
-
field = /* @__PURE__ */
|
|
10249
|
+
field = /* @__PURE__ */ jsx80(DatePicker_default, { ...commonProps });
|
|
10181
10250
|
break;
|
|
10182
10251
|
case "BOOLEAN":
|
|
10183
|
-
field = /* @__PURE__ */
|
|
10252
|
+
field = /* @__PURE__ */ jsx80(Checkbox_default, { ...commonProps, checked: !!fieldValue, onChange: (e) => onEditValue(e.target.checked) });
|
|
10184
10253
|
break;
|
|
10185
10254
|
case "COMPLEX":
|
|
10186
|
-
field = /* @__PURE__ */
|
|
10255
|
+
field = /* @__PURE__ */ jsx80(
|
|
10187
10256
|
"textarea",
|
|
10188
10257
|
{
|
|
10189
10258
|
value: fieldValue,
|
|
@@ -10195,11 +10264,11 @@ var BaseUserProfile = ({
|
|
|
10195
10264
|
);
|
|
10196
10265
|
break;
|
|
10197
10266
|
default:
|
|
10198
|
-
field = /* @__PURE__ */
|
|
10267
|
+
field = /* @__PURE__ */ jsx80(TextField_default, { ...commonProps });
|
|
10199
10268
|
}
|
|
10200
10269
|
return /* @__PURE__ */ jsxs35(Fragment15, { children: [
|
|
10201
|
-
/* @__PURE__ */
|
|
10202
|
-
/* @__PURE__ */
|
|
10270
|
+
/* @__PURE__ */ jsx80("span", { className: styles.label, children: label }),
|
|
10271
|
+
/* @__PURE__ */ jsx80("div", { className: styles.value, children: field })
|
|
10203
10272
|
] });
|
|
10204
10273
|
}
|
|
10205
10274
|
const hasValue = value !== void 0 && value !== null && value !== "";
|
|
@@ -10213,8 +10282,8 @@ var BaseUserProfile = ({
|
|
|
10213
10282
|
displayValue = "-";
|
|
10214
10283
|
}
|
|
10215
10284
|
return /* @__PURE__ */ jsxs35(Fragment15, { children: [
|
|
10216
|
-
/* @__PURE__ */
|
|
10217
|
-
/* @__PURE__ */
|
|
10285
|
+
/* @__PURE__ */ jsx80("span", { className: styles.label, children: label }),
|
|
10286
|
+
/* @__PURE__ */ jsx80("div", { className: cx25(styles.value, !hasValue ? styles.valuePlaceholder : ""), children: !hasValue && isEditable && onStartEdit ? /* @__PURE__ */ jsx80(
|
|
10218
10287
|
Button_default,
|
|
10219
10288
|
{
|
|
10220
10289
|
onClick: onStartEdit,
|
|
@@ -10243,7 +10312,7 @@ var BaseUserProfile = ({
|
|
|
10243
10312
|
gap: theme.vars.spacing.unit
|
|
10244
10313
|
};
|
|
10245
10314
|
return /* @__PURE__ */ jsxs35("div", { className: styles.field, children: [
|
|
10246
|
-
/* @__PURE__ */
|
|
10315
|
+
/* @__PURE__ */ jsx80("div", { className: styles.fieldInner, children: renderSchemaField(
|
|
10247
10316
|
schema,
|
|
10248
10317
|
isFieldEditing,
|
|
10249
10318
|
(value) => {
|
|
@@ -10255,10 +10324,10 @@ var BaseUserProfile = ({
|
|
|
10255
10324
|
) }),
|
|
10256
10325
|
editable && schema.mutability !== "READ_ONLY" && !isReadonlyField && /* @__PURE__ */ jsxs35("div", { className: styles.fieldActions, children: [
|
|
10257
10326
|
isFieldEditing && /* @__PURE__ */ jsxs35(Fragment15, { children: [
|
|
10258
|
-
/* @__PURE__ */
|
|
10259
|
-
/* @__PURE__ */
|
|
10327
|
+
/* @__PURE__ */ jsx80(Button_default, { size: "small", color: "primary", variant: "solid", onClick: () => handleFieldSave(schema), children: "Save" }),
|
|
10328
|
+
/* @__PURE__ */ jsx80(Button_default, { size: "small", color: "secondary", variant: "solid", onClick: () => handleFieldCancel(schema.name), children: "Cancel" })
|
|
10260
10329
|
] }),
|
|
10261
|
-
!isFieldEditing && hasValue && /* @__PURE__ */
|
|
10330
|
+
!isFieldEditing && hasValue && /* @__PURE__ */ jsx80(
|
|
10262
10331
|
Button_default,
|
|
10263
10332
|
{
|
|
10264
10333
|
size: "small",
|
|
@@ -10267,7 +10336,7 @@ var BaseUserProfile = ({
|
|
|
10267
10336
|
onClick: () => toggleFieldEdit(schema.name),
|
|
10268
10337
|
title: "Edit",
|
|
10269
10338
|
className: styles.editButton,
|
|
10270
|
-
children: /* @__PURE__ */
|
|
10339
|
+
children: /* @__PURE__ */ jsx80(PencilIcon, {})
|
|
10271
10340
|
}
|
|
10272
10341
|
)
|
|
10273
10342
|
] })
|
|
@@ -10291,17 +10360,17 @@ var BaseUserProfile = ({
|
|
|
10291
10360
|
if (!shouldShowField(key)) return false;
|
|
10292
10361
|
return value !== void 0 && value !== "" && value !== null;
|
|
10293
10362
|
}).sort(([a], [b]) => a.localeCompare(b));
|
|
10294
|
-
return /* @__PURE__ */
|
|
10295
|
-
/* @__PURE__ */
|
|
10296
|
-
/* @__PURE__ */
|
|
10363
|
+
return /* @__PURE__ */ jsx80(Fragment15, { children: profileEntries.map(([key, value]) => /* @__PURE__ */ jsxs35("div", { className: styles.field, children: [
|
|
10364
|
+
/* @__PURE__ */ jsx80("span", { className: styles.label, children: formatLabel(key) }),
|
|
10365
|
+
/* @__PURE__ */ jsx80("div", { className: styles.value, children: typeof value === "object" ? JSON.stringify(value, null, 2) : String(value) })
|
|
10297
10366
|
] }, key)) });
|
|
10298
10367
|
};
|
|
10299
10368
|
const profileContent = /* @__PURE__ */ jsxs35(Card_default, { className: containerClasses, children: [
|
|
10300
10369
|
error && /* @__PURE__ */ jsxs35(Alert_default, { variant: "error", className: cx25(withVendorCSSClassPrefix26(bem19("user-profile", "alert")), styles.alert), children: [
|
|
10301
|
-
/* @__PURE__ */
|
|
10302
|
-
/* @__PURE__ */
|
|
10370
|
+
/* @__PURE__ */ jsx80(Alert_default.Title, { children: t("errors.title") || "Error" }),
|
|
10371
|
+
/* @__PURE__ */ jsx80(Alert_default.Description, { children: error })
|
|
10303
10372
|
] }),
|
|
10304
|
-
/* @__PURE__ */
|
|
10373
|
+
/* @__PURE__ */ jsx80("div", { className: styles.header, children: /* @__PURE__ */ jsx80(
|
|
10305
10374
|
Avatar,
|
|
10306
10375
|
{
|
|
10307
10376
|
imageUrl: getMappedUserProfileValue_default("picture", mergedMappings, currentUser),
|
|
@@ -10311,7 +10380,7 @@ var BaseUserProfile = ({
|
|
|
10311
10380
|
isLoading
|
|
10312
10381
|
}
|
|
10313
10382
|
) }),
|
|
10314
|
-
/* @__PURE__ */
|
|
10383
|
+
/* @__PURE__ */ jsx80("div", { className: styles.infoContainer, children: schemas && schemas.length > 0 ? schemas.filter((schema) => {
|
|
10315
10384
|
if (!schema.name || !shouldShowField(schema.name)) return false;
|
|
10316
10385
|
if (!editable) {
|
|
10317
10386
|
const value = flattenedProfile && schema.name ? flattenedProfile[schema.name] : void 0;
|
|
@@ -10328,13 +10397,13 @@ var BaseUserProfile = ({
|
|
|
10328
10397
|
...schema,
|
|
10329
10398
|
value
|
|
10330
10399
|
};
|
|
10331
|
-
return /* @__PURE__ */
|
|
10400
|
+
return /* @__PURE__ */ jsx80("div", { className: styles.info, children: renderUserInfo(schemaWithValue) }, schema.name || index);
|
|
10332
10401
|
}) : renderProfileWithoutSchemas() })
|
|
10333
10402
|
] });
|
|
10334
10403
|
if (mode === "popup") {
|
|
10335
|
-
return /* @__PURE__ */
|
|
10336
|
-
/* @__PURE__ */
|
|
10337
|
-
/* @__PURE__ */
|
|
10404
|
+
return /* @__PURE__ */ jsx80(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs35(Dialog_default.Content, { children: [
|
|
10405
|
+
/* @__PURE__ */ jsx80(Dialog_default.Heading, { children: title ?? t("user.profile.title") }),
|
|
10406
|
+
/* @__PURE__ */ jsx80("div", { className: styles.popup, children: profileContent })
|
|
10338
10407
|
] }) });
|
|
10339
10408
|
}
|
|
10340
10409
|
return profileContent;
|
|
@@ -10375,7 +10444,7 @@ var updateMeProfile_default = updateMeProfile;
|
|
|
10375
10444
|
|
|
10376
10445
|
// src/components/presentation/UserProfile/UserProfile.tsx
|
|
10377
10446
|
import { AsgardeoError } from "@asgardeo/browser";
|
|
10378
|
-
import { jsx as
|
|
10447
|
+
import { jsx as jsx81 } from "react/jsx-runtime";
|
|
10379
10448
|
var UserProfile3 = ({ ...rest }) => {
|
|
10380
10449
|
const { baseUrl, isLoading } = useAsgardeo_default();
|
|
10381
10450
|
const { profile, flattenedProfile, schemas, onUpdateProfile } = useUser_default();
|
|
@@ -10394,7 +10463,7 @@ var UserProfile3 = ({ ...rest }) => {
|
|
|
10394
10463
|
setError(message);
|
|
10395
10464
|
}
|
|
10396
10465
|
};
|
|
10397
|
-
return /* @__PURE__ */
|
|
10466
|
+
return /* @__PURE__ */ jsx81(
|
|
10398
10467
|
BaseUserProfile_default,
|
|
10399
10468
|
{
|
|
10400
10469
|
profile,
|
|
@@ -10611,7 +10680,7 @@ var useStyles23 = (theme, colorScheme) => {
|
|
|
10611
10680
|
var BaseUserDropdown_styles_default = useStyles23;
|
|
10612
10681
|
|
|
10613
10682
|
// src/components/presentation/UserDropdown/BaseUserDropdown.tsx
|
|
10614
|
-
import { jsx as
|
|
10683
|
+
import { jsx as jsx82, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
10615
10684
|
var BaseUserDropdown = ({
|
|
10616
10685
|
fallback = null,
|
|
10617
10686
|
className = "",
|
|
@@ -10665,14 +10734,14 @@ var BaseUserDropdown = ({
|
|
|
10665
10734
|
defaultMenuItems.push({
|
|
10666
10735
|
label: "Manage Profile",
|
|
10667
10736
|
onClick: onManageProfile,
|
|
10668
|
-
icon: /* @__PURE__ */
|
|
10737
|
+
icon: /* @__PURE__ */ jsx82(User_default2, { width: "16", height: "16" })
|
|
10669
10738
|
});
|
|
10670
10739
|
}
|
|
10671
10740
|
if (onSignOut) {
|
|
10672
10741
|
defaultMenuItems.push({
|
|
10673
10742
|
label: "Sign Out",
|
|
10674
10743
|
onClick: onSignOut,
|
|
10675
|
-
icon: /* @__PURE__ */
|
|
10744
|
+
icon: /* @__PURE__ */ jsx82(LogOut_default, { width: "16", height: "16" })
|
|
10676
10745
|
});
|
|
10677
10746
|
}
|
|
10678
10747
|
const allMenuItems = [...menuItems];
|
|
@@ -10693,7 +10762,7 @@ var BaseUserDropdown = ({
|
|
|
10693
10762
|
size: "medium",
|
|
10694
10763
|
...getReferenceProps(),
|
|
10695
10764
|
children: [
|
|
10696
|
-
/* @__PURE__ */
|
|
10765
|
+
/* @__PURE__ */ jsx82(
|
|
10697
10766
|
Avatar,
|
|
10698
10767
|
{
|
|
10699
10768
|
imageUrl: getMappedUserProfileValue_default("picture", mergedMappings, user),
|
|
@@ -10702,7 +10771,7 @@ var BaseUserDropdown = ({
|
|
|
10702
10771
|
alt: `${getDisplayName_default(mergedMappings, user)}'s avatar`
|
|
10703
10772
|
}
|
|
10704
10773
|
),
|
|
10705
|
-
showTriggerLabel && /* @__PURE__ */
|
|
10774
|
+
showTriggerLabel && /* @__PURE__ */ jsx82(
|
|
10706
10775
|
Typography_default,
|
|
10707
10776
|
{
|
|
10708
10777
|
variant: "body2",
|
|
@@ -10713,7 +10782,7 @@ var BaseUserDropdown = ({
|
|
|
10713
10782
|
]
|
|
10714
10783
|
}
|
|
10715
10784
|
),
|
|
10716
|
-
isOpen && /* @__PURE__ */
|
|
10785
|
+
isOpen && /* @__PURE__ */ jsx82(FloatingPortal2, { id: portalId, children: /* @__PURE__ */ jsx82(FloatingFocusManager2, { context, modal: false, initialFocus: -1, children: /* @__PURE__ */ jsxs36(
|
|
10717
10786
|
"div",
|
|
10718
10787
|
{
|
|
10719
10788
|
ref: refs.setFloating,
|
|
@@ -10727,7 +10796,7 @@ var BaseUserDropdown = ({
|
|
|
10727
10796
|
...getFloatingProps(),
|
|
10728
10797
|
children: [
|
|
10729
10798
|
/* @__PURE__ */ jsxs36("div", { className: cx26(withVendorCSSClassPrefix27("user-dropdown__header"), styles.dropdownHeader), children: [
|
|
10730
|
-
/* @__PURE__ */
|
|
10799
|
+
/* @__PURE__ */ jsx82(
|
|
10731
10800
|
Avatar,
|
|
10732
10801
|
{
|
|
10733
10802
|
imageUrl: getMappedUserProfileValue_default("picture", mergedMappings, user),
|
|
@@ -10737,7 +10806,7 @@ var BaseUserDropdown = ({
|
|
|
10737
10806
|
}
|
|
10738
10807
|
),
|
|
10739
10808
|
/* @__PURE__ */ jsxs36("div", { className: cx26(withVendorCSSClassPrefix27("user-dropdown__header-info"), styles.headerInfo), children: [
|
|
10740
|
-
/* @__PURE__ */
|
|
10809
|
+
/* @__PURE__ */ jsx82(
|
|
10741
10810
|
Typography_default,
|
|
10742
10811
|
{
|
|
10743
10812
|
noWrap: true,
|
|
@@ -10747,7 +10816,7 @@ var BaseUserDropdown = ({
|
|
|
10747
10816
|
children: getDisplayName_default(mergedMappings, user)
|
|
10748
10817
|
}
|
|
10749
10818
|
),
|
|
10750
|
-
/* @__PURE__ */
|
|
10819
|
+
/* @__PURE__ */ jsx82(
|
|
10751
10820
|
Typography_default,
|
|
10752
10821
|
{
|
|
10753
10822
|
noWrap: true,
|
|
@@ -10759,7 +10828,7 @@ var BaseUserDropdown = ({
|
|
|
10759
10828
|
)
|
|
10760
10829
|
] })
|
|
10761
10830
|
] }),
|
|
10762
|
-
/* @__PURE__ */
|
|
10831
|
+
/* @__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
10832
|
"a",
|
|
10764
10833
|
{
|
|
10765
10834
|
href: item.href,
|
|
@@ -10773,10 +10842,10 @@ var BaseUserDropdown = ({
|
|
|
10773
10842
|
onBlur: () => setHoveredItemIndex(null),
|
|
10774
10843
|
children: [
|
|
10775
10844
|
item.icon,
|
|
10776
|
-
/* @__PURE__ */
|
|
10845
|
+
/* @__PURE__ */ jsx82("span", { children: item.label })
|
|
10777
10846
|
]
|
|
10778
10847
|
}
|
|
10779
|
-
) : /* @__PURE__ */
|
|
10848
|
+
) : /* @__PURE__ */ jsx82(
|
|
10780
10849
|
Button_default,
|
|
10781
10850
|
{
|
|
10782
10851
|
onClick: () => handleMenuItemClick(item),
|
|
@@ -10802,7 +10871,7 @@ var BaseUserDropdown_default = BaseUserDropdown;
|
|
|
10802
10871
|
|
|
10803
10872
|
// src/components/presentation/UserDropdown/UserDropdown.tsx
|
|
10804
10873
|
import { useState as useState22 } from "react";
|
|
10805
|
-
import { Fragment as Fragment16, jsx as
|
|
10874
|
+
import { Fragment as Fragment16, jsx as jsx83, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
10806
10875
|
var UserDropdown = ({
|
|
10807
10876
|
children,
|
|
10808
10877
|
renderTrigger,
|
|
@@ -10833,12 +10902,12 @@ var UserDropdown = ({
|
|
|
10833
10902
|
if (children) {
|
|
10834
10903
|
return /* @__PURE__ */ jsxs37(Fragment16, { children: [
|
|
10835
10904
|
children(renderProps),
|
|
10836
|
-
/* @__PURE__ */
|
|
10905
|
+
/* @__PURE__ */ jsx83(UserProfile_default, { mode: "popup", open: isProfileOpen, onOpenChange: setIsProfileOpen })
|
|
10837
10906
|
] });
|
|
10838
10907
|
}
|
|
10839
10908
|
if (renderTrigger || renderDropdown) {
|
|
10840
10909
|
return /* @__PURE__ */ jsxs37(Fragment16, { children: [
|
|
10841
|
-
renderTrigger ? renderTrigger(renderProps) : /* @__PURE__ */
|
|
10910
|
+
renderTrigger ? renderTrigger(renderProps) : /* @__PURE__ */ jsx83(
|
|
10842
10911
|
BaseUserDropdown_default,
|
|
10843
10912
|
{
|
|
10844
10913
|
user,
|
|
@@ -10848,11 +10917,11 @@ var UserDropdown = ({
|
|
|
10848
10917
|
...rest
|
|
10849
10918
|
}
|
|
10850
10919
|
),
|
|
10851
|
-
/* @__PURE__ */
|
|
10920
|
+
/* @__PURE__ */ jsx83(UserProfile_default, { mode: "popup", open: isProfileOpen, onOpenChange: setIsProfileOpen })
|
|
10852
10921
|
] });
|
|
10853
10922
|
}
|
|
10854
10923
|
return /* @__PURE__ */ jsxs37(Fragment16, { children: [
|
|
10855
|
-
/* @__PURE__ */
|
|
10924
|
+
/* @__PURE__ */ jsx83(
|
|
10856
10925
|
BaseUserDropdown_default,
|
|
10857
10926
|
{
|
|
10858
10927
|
user,
|
|
@@ -10862,7 +10931,7 @@ var UserDropdown = ({
|
|
|
10862
10931
|
...rest
|
|
10863
10932
|
}
|
|
10864
10933
|
),
|
|
10865
|
-
isProfileOpen && /* @__PURE__ */
|
|
10934
|
+
isProfileOpen && /* @__PURE__ */ jsx83(UserProfile_default, { mode: "popup", open: isProfileOpen, onOpenChange: setIsProfileOpen })
|
|
10866
10935
|
] });
|
|
10867
10936
|
};
|
|
10868
10937
|
var UserDropdown_default = UserDropdown;
|
|
@@ -10885,9 +10954,9 @@ import { cx as cx27 } from "@emotion/css";
|
|
|
10885
10954
|
import { useState as useState23 } from "react";
|
|
10886
10955
|
|
|
10887
10956
|
// src/components/primitives/Icons/Building.tsx
|
|
10888
|
-
import { jsx as
|
|
10957
|
+
import { jsx as jsx84, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
10889
10958
|
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__ */
|
|
10959
|
+
/* @__PURE__ */ jsx84(
|
|
10891
10960
|
"path",
|
|
10892
10961
|
{
|
|
10893
10962
|
d: "M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",
|
|
@@ -10897,25 +10966,25 @@ var Building = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PU
|
|
|
10897
10966
|
strokeLinejoin: "round"
|
|
10898
10967
|
}
|
|
10899
10968
|
),
|
|
10900
|
-
/* @__PURE__ */
|
|
10901
|
-
/* @__PURE__ */
|
|
10902
|
-
/* @__PURE__ */
|
|
10903
|
-
/* @__PURE__ */
|
|
10904
|
-
/* @__PURE__ */
|
|
10905
|
-
/* @__PURE__ */
|
|
10969
|
+
/* @__PURE__ */ jsx84("path", { d: "M6 12h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
10970
|
+
/* @__PURE__ */ jsx84("path", { d: "M6 8h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
10971
|
+
/* @__PURE__ */ jsx84("path", { d: "M14 8h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
10972
|
+
/* @__PURE__ */ jsx84("path", { d: "M14 12h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
10973
|
+
/* @__PURE__ */ jsx84("path", { d: "M6 18h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
10974
|
+
/* @__PURE__ */ jsx84("path", { d: "M14 18h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
10906
10975
|
] });
|
|
10907
10976
|
Building.displayName = "Building";
|
|
10908
10977
|
var Building_default = Building;
|
|
10909
10978
|
|
|
10910
10979
|
// src/components/primitives/Icons/Check.tsx
|
|
10911
|
-
import { jsx as
|
|
10912
|
-
var Check = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */
|
|
10980
|
+
import { jsx as jsx85 } from "react/jsx-runtime";
|
|
10981
|
+
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
10982
|
Check.displayName = "Check";
|
|
10914
10983
|
var Check_default = Check;
|
|
10915
10984
|
|
|
10916
10985
|
// src/components/primitives/Icons/ChevronDown.tsx
|
|
10917
|
-
import { jsx as
|
|
10918
|
-
var ChevronDown = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */
|
|
10986
|
+
import { jsx as jsx86 } from "react/jsx-runtime";
|
|
10987
|
+
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
10988
|
ChevronDown.displayName = "ChevronDown";
|
|
10920
10989
|
var ChevronDown_default = ChevronDown;
|
|
10921
10990
|
|
|
@@ -11145,7 +11214,7 @@ var useStyles24 = (theme, colorScheme) => {
|
|
|
11145
11214
|
var BaseOrganizationSwitcher_styles_default = useStyles24;
|
|
11146
11215
|
|
|
11147
11216
|
// src/components/presentation/OrganizationSwitcher/BaseOrganizationSwitcher.tsx
|
|
11148
|
-
import { Fragment as Fragment17, jsx as
|
|
11217
|
+
import { Fragment as Fragment17, jsx as jsx87, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
11149
11218
|
var BaseOrganizationSwitcher = ({
|
|
11150
11219
|
organizations,
|
|
11151
11220
|
currentOrganization,
|
|
@@ -11200,7 +11269,7 @@ var BaseOrganizationSwitcher = ({
|
|
|
11200
11269
|
(org) => org.id !== currentOrganization?.id
|
|
11201
11270
|
);
|
|
11202
11271
|
const defaultRenderOrganization2 = (organization, isSelected) => /* @__PURE__ */ jsxs39(Fragment17, { children: [
|
|
11203
|
-
/* @__PURE__ */
|
|
11272
|
+
/* @__PURE__ */ jsx87(
|
|
11204
11273
|
Avatar,
|
|
11205
11274
|
{
|
|
11206
11275
|
variant: "square",
|
|
@@ -11211,21 +11280,21 @@ var BaseOrganizationSwitcher = ({
|
|
|
11211
11280
|
}
|
|
11212
11281
|
),
|
|
11213
11282
|
/* @__PURE__ */ jsxs39("div", { className: cx27(styles.organizationInfo), children: [
|
|
11214
|
-
/* @__PURE__ */
|
|
11283
|
+
/* @__PURE__ */ jsx87(Typography_default, { variant: "body2", fontWeight: "medium", className: cx27(styles.organizationName), children: organization.name }),
|
|
11215
11284
|
/* @__PURE__ */ jsxs39("div", { className: cx27(styles.organizationMeta), children: [
|
|
11216
11285
|
showMemberCount && organization.memberCount !== void 0 && /* @__PURE__ */ jsxs39("span", { children: [
|
|
11217
11286
|
organization.memberCount,
|
|
11218
11287
|
" ",
|
|
11219
11288
|
organization.memberCount === 1 ? t("organization.switcher.member") : t("organization.switcher.members")
|
|
11220
11289
|
] }),
|
|
11221
|
-
showRole && organization.role && showMemberCount && organization.memberCount !== void 0 && /* @__PURE__ */
|
|
11222
|
-
showRole && organization.role && /* @__PURE__ */
|
|
11290
|
+
showRole && organization.role && showMemberCount && organization.memberCount !== void 0 && /* @__PURE__ */ jsx87("span", { children: " \u2022 " }),
|
|
11291
|
+
showRole && organization.role && /* @__PURE__ */ jsx87("span", { className: cx27(styles.roleCapitalized), children: organization.role })
|
|
11223
11292
|
] })
|
|
11224
11293
|
] }),
|
|
11225
|
-
isSelected && /* @__PURE__ */
|
|
11294
|
+
isSelected && /* @__PURE__ */ jsx87(Check_default, { width: "16", height: "16", color: theme.vars.colors.text.primary })
|
|
11226
11295
|
] });
|
|
11227
|
-
const defaultRenderLoading2 = () => /* @__PURE__ */
|
|
11228
|
-
const defaultRenderError2 = (errorMessage) => /* @__PURE__ */
|
|
11296
|
+
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") }) });
|
|
11297
|
+
const defaultRenderError2 = (errorMessage) => /* @__PURE__ */ jsx87("div", { className: cx27(styles.errorContainer), children: /* @__PURE__ */ jsx87(Typography_default, { variant: "caption", className: cx27(styles.errorText), children: errorMessage }) });
|
|
11229
11298
|
return /* @__PURE__ */ jsxs39("div", { className: cx27(styles.root, className), style, children: [
|
|
11230
11299
|
/* @__PURE__ */ jsxs39(
|
|
11231
11300
|
Button_default,
|
|
@@ -11238,7 +11307,7 @@ var BaseOrganizationSwitcher = ({
|
|
|
11238
11307
|
...getReferenceProps(),
|
|
11239
11308
|
children: [
|
|
11240
11309
|
currentOrganization ? /* @__PURE__ */ jsxs39(Fragment17, { children: [
|
|
11241
|
-
/* @__PURE__ */
|
|
11310
|
+
/* @__PURE__ */ jsx87(
|
|
11242
11311
|
Avatar,
|
|
11243
11312
|
{
|
|
11244
11313
|
variant: "square",
|
|
@@ -11248,18 +11317,18 @@ var BaseOrganizationSwitcher = ({
|
|
|
11248
11317
|
alt: `${currentOrganization.name} avatar`
|
|
11249
11318
|
}
|
|
11250
11319
|
),
|
|
11251
|
-
showTriggerLabel && /* @__PURE__ */
|
|
11320
|
+
showTriggerLabel && /* @__PURE__ */ jsx87(Typography_default, { variant: "body2", className: cx27(styles.triggerLabel), children: currentOrganization.name })
|
|
11252
11321
|
] }) : /* @__PURE__ */ jsxs39(Fragment17, { children: [
|
|
11253
|
-
/* @__PURE__ */
|
|
11254
|
-
showTriggerLabel && /* @__PURE__ */
|
|
11322
|
+
/* @__PURE__ */ jsx87(Building_default, { width: avatarSize, height: avatarSize }),
|
|
11323
|
+
showTriggerLabel && /* @__PURE__ */ jsx87(Typography_default, { variant: "body2", className: cx27(styles.triggerLabel), children: t("organization.switcher.select.organization") })
|
|
11255
11324
|
] }),
|
|
11256
|
-
/* @__PURE__ */
|
|
11325
|
+
/* @__PURE__ */ jsx87("span", { style: { transform: isRTL ? "scaleX(-1)" : "none", display: "inline-flex" }, children: /* @__PURE__ */ jsx87(ChevronDown_default, { width: "16", height: "16" }) })
|
|
11257
11326
|
]
|
|
11258
11327
|
}
|
|
11259
11328
|
),
|
|
11260
|
-
isOpen && /* @__PURE__ */
|
|
11329
|
+
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
11330
|
currentOrganization && /* @__PURE__ */ jsxs39("div", { className: cx27(styles.header), children: [
|
|
11262
|
-
/* @__PURE__ */
|
|
11331
|
+
/* @__PURE__ */ jsx87(
|
|
11263
11332
|
Avatar,
|
|
11264
11333
|
{
|
|
11265
11334
|
variant: "square",
|
|
@@ -11270,7 +11339,7 @@ var BaseOrganizationSwitcher = ({
|
|
|
11270
11339
|
}
|
|
11271
11340
|
),
|
|
11272
11341
|
/* @__PURE__ */ jsxs39("div", { className: cx27(styles.headerInfo), children: [
|
|
11273
|
-
/* @__PURE__ */
|
|
11342
|
+
/* @__PURE__ */ jsx87(Typography_default, { noWrap: true, className: cx27(styles.headerName), variant: "body1", fontWeight: "medium", children: currentOrganization.name }),
|
|
11274
11343
|
/* @__PURE__ */ jsxs39("div", { className: cx27(styles.headerMeta), children: [
|
|
11275
11344
|
showMemberCount && currentOrganization.memberCount !== void 0 && /* @__PURE__ */ jsxs39(
|
|
11276
11345
|
Typography_default,
|
|
@@ -11289,10 +11358,10 @@ var BaseOrganizationSwitcher = ({
|
|
|
11289
11358
|
]
|
|
11290
11359
|
}
|
|
11291
11360
|
),
|
|
11292
|
-
showRole && currentOrganization.role && (!showMemberCount || currentOrganization.memberCount === void 0) && /* @__PURE__ */
|
|
11361
|
+
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
11362
|
] })
|
|
11294
11363
|
] }),
|
|
11295
|
-
onManageProfile && /* @__PURE__ */
|
|
11364
|
+
onManageProfile && /* @__PURE__ */ jsx87(
|
|
11296
11365
|
Button_default,
|
|
11297
11366
|
{
|
|
11298
11367
|
onClick: onManageProfile,
|
|
@@ -11313,8 +11382,8 @@ var BaseOrganizationSwitcher = ({
|
|
|
11313
11382
|
strokeLinecap: "round",
|
|
11314
11383
|
strokeLinejoin: "round",
|
|
11315
11384
|
children: [
|
|
11316
|
-
/* @__PURE__ */
|
|
11317
|
-
/* @__PURE__ */
|
|
11385
|
+
/* @__PURE__ */ jsx87("circle", { cx: "12", cy: "12", r: "3" }),
|
|
11386
|
+
/* @__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
11387
|
]
|
|
11319
11388
|
}
|
|
11320
11389
|
),
|
|
@@ -11322,20 +11391,20 @@ var BaseOrganizationSwitcher = ({
|
|
|
11322
11391
|
}
|
|
11323
11392
|
)
|
|
11324
11393
|
] }),
|
|
11325
|
-
organizations.length > 1 && /* @__PURE__ */
|
|
11394
|
+
organizations.length > 1 && /* @__PURE__ */ jsx87(
|
|
11326
11395
|
"div",
|
|
11327
11396
|
{
|
|
11328
11397
|
className: cx27(styles.header, styles.sectionHeaderContainer),
|
|
11329
11398
|
style: {
|
|
11330
11399
|
borderTop: currentOrganization ? `1px solid ${theme.vars.colors.border}` : "none"
|
|
11331
11400
|
},
|
|
11332
|
-
children: /* @__PURE__ */
|
|
11401
|
+
children: /* @__PURE__ */ jsx87(Typography_default, { variant: "caption", fontWeight: 600, className: cx27(styles.sectionHeader), children: t("organization.switcher.switch.organization") })
|
|
11333
11402
|
}
|
|
11334
11403
|
),
|
|
11335
|
-
/* @__PURE__ */
|
|
11404
|
+
/* @__PURE__ */ jsx87("div", { className: cx27(styles.menu), children: loading ? renderLoading ? renderLoading() : defaultRenderLoading2() : error ? renderError ? renderError(error) : defaultRenderError2(error) : /* @__PURE__ */ jsxs39(Fragment17, { children: [
|
|
11336
11405
|
switchableOrganizations.map((organization) => {
|
|
11337
11406
|
const isSelected = false;
|
|
11338
|
-
return /* @__PURE__ */
|
|
11407
|
+
return /* @__PURE__ */ jsx87(
|
|
11339
11408
|
Button_default,
|
|
11340
11409
|
{
|
|
11341
11410
|
onClick: () => handleOrganizationSwitch(organization),
|
|
@@ -11354,9 +11423,9 @@ var BaseOrganizationSwitcher = ({
|
|
|
11354
11423
|
);
|
|
11355
11424
|
}),
|
|
11356
11425
|
menuItems.length > 0 && /* @__PURE__ */ jsxs39(Fragment17, { children: [
|
|
11357
|
-
/* @__PURE__ */
|
|
11426
|
+
/* @__PURE__ */ jsx87("div", { className: cx27(styles.menuDivider) }),
|
|
11358
11427
|
menuItems.map(
|
|
11359
|
-
(item, index) => /* @__PURE__ */
|
|
11428
|
+
(item, index) => /* @__PURE__ */ jsx87("div", { children: item.href ? /* @__PURE__ */ jsxs39(
|
|
11360
11429
|
"a",
|
|
11361
11430
|
{
|
|
11362
11431
|
href: item.href,
|
|
@@ -11370,10 +11439,10 @@ var BaseOrganizationSwitcher = ({
|
|
|
11370
11439
|
onBlur: () => setHoveredItemIndex(null),
|
|
11371
11440
|
children: [
|
|
11372
11441
|
item.icon,
|
|
11373
|
-
/* @__PURE__ */
|
|
11442
|
+
/* @__PURE__ */ jsx87("span", { children: item.label })
|
|
11374
11443
|
]
|
|
11375
11444
|
}
|
|
11376
|
-
) : /* @__PURE__ */
|
|
11445
|
+
) : /* @__PURE__ */ jsx87(
|
|
11377
11446
|
Button_default,
|
|
11378
11447
|
{
|
|
11379
11448
|
onClick: () => handleMenuItemClick(item),
|
|
@@ -11547,7 +11616,7 @@ var useStyles25 = (theme, colorScheme) => {
|
|
|
11547
11616
|
var BaseCreateOrganization_styles_default = useStyles25;
|
|
11548
11617
|
|
|
11549
11618
|
// src/components/presentation/CreateOrganization/BaseCreateOrganization.tsx
|
|
11550
|
-
import { jsx as
|
|
11619
|
+
import { jsx as jsx88, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
11551
11620
|
var BaseCreateOrganization = ({
|
|
11552
11621
|
cardLayout = true,
|
|
11553
11622
|
className = "",
|
|
@@ -11634,13 +11703,13 @@ var BaseCreateOrganization = ({
|
|
|
11634
11703
|
console.error("Form submission error:", submitError);
|
|
11635
11704
|
}
|
|
11636
11705
|
};
|
|
11637
|
-
const createOrganizationContent = /* @__PURE__ */
|
|
11706
|
+
const createOrganizationContent = /* @__PURE__ */ jsx88("div", { className: cx28(styles.root, cardLayout && styles.card, className), style, children: /* @__PURE__ */ jsxs40("div", { className: cx28(styles.content), children: [
|
|
11638
11707
|
/* @__PURE__ */ jsxs40("form", { id: "create-organization-form", className: cx28(styles.form), onSubmit: handleSubmit, children: [
|
|
11639
11708
|
error && /* @__PURE__ */ jsxs40(Alert_default, { variant: "error", className: styles.errorAlert, children: [
|
|
11640
|
-
/* @__PURE__ */
|
|
11641
|
-
/* @__PURE__ */
|
|
11709
|
+
/* @__PURE__ */ jsx88(Alert_default.Title, { children: "Error" }),
|
|
11710
|
+
/* @__PURE__ */ jsx88(Alert_default.Description, { children: error })
|
|
11642
11711
|
] }),
|
|
11643
|
-
/* @__PURE__ */
|
|
11712
|
+
/* @__PURE__ */ jsx88("div", { className: cx28(styles.fieldGroup), children: /* @__PURE__ */ jsx88(
|
|
11644
11713
|
TextField_default,
|
|
11645
11714
|
{
|
|
11646
11715
|
label: `${t("organization.create.name.label")}`,
|
|
@@ -11653,7 +11722,7 @@ var BaseCreateOrganization = ({
|
|
|
11653
11722
|
className: cx28(styles.input)
|
|
11654
11723
|
}
|
|
11655
11724
|
) }),
|
|
11656
|
-
/* @__PURE__ */
|
|
11725
|
+
/* @__PURE__ */ jsx88("div", { className: cx28(styles.fieldGroup), children: /* @__PURE__ */ jsx88(
|
|
11657
11726
|
TextField_default,
|
|
11658
11727
|
{
|
|
11659
11728
|
label: `${t("organization.create.handle.label") || "Organization Handle"}`,
|
|
@@ -11667,9 +11736,9 @@ var BaseCreateOrganization = ({
|
|
|
11667
11736
|
className: cx28(styles.input)
|
|
11668
11737
|
}
|
|
11669
11738
|
) }),
|
|
11670
|
-
/* @__PURE__ */
|
|
11671
|
-
/* @__PURE__ */
|
|
11672
|
-
/* @__PURE__ */
|
|
11739
|
+
/* @__PURE__ */ jsx88("div", { className: cx28(styles.fieldGroup), children: /* @__PURE__ */ jsxs40(FormControl_default, { error: formErrors.description, children: [
|
|
11740
|
+
/* @__PURE__ */ jsx88(InputLabel_default, { required: true, children: t("organization.create.description.label") }),
|
|
11741
|
+
/* @__PURE__ */ jsx88(
|
|
11673
11742
|
"textarea",
|
|
11674
11743
|
{
|
|
11675
11744
|
className: cx28(styles.textarea, formErrors.description && styles.textareaError),
|
|
@@ -11684,14 +11753,14 @@ var BaseCreateOrganization = ({
|
|
|
11684
11753
|
renderAdditionalFields && renderAdditionalFields()
|
|
11685
11754
|
] }),
|
|
11686
11755
|
/* @__PURE__ */ jsxs40("div", { className: cx28(styles.actions), children: [
|
|
11687
|
-
onCancel && /* @__PURE__ */
|
|
11688
|
-
/* @__PURE__ */
|
|
11756
|
+
onCancel && /* @__PURE__ */ jsx88(Button_default, { type: "button", variant: "outline", onClick: onCancel, disabled: loading, children: t("organization.create.cancel") }),
|
|
11757
|
+
/* @__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
11758
|
] })
|
|
11690
11759
|
] }) });
|
|
11691
11760
|
if (mode === "popup") {
|
|
11692
|
-
return /* @__PURE__ */
|
|
11693
|
-
/* @__PURE__ */
|
|
11694
|
-
/* @__PURE__ */
|
|
11761
|
+
return /* @__PURE__ */ jsx88(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs40(Dialog_default.Content, { children: [
|
|
11762
|
+
/* @__PURE__ */ jsx88(Dialog_default.Heading, { children: title }),
|
|
11763
|
+
/* @__PURE__ */ jsx88("div", { className: styles.popup, children: createOrganizationContent })
|
|
11695
11764
|
] }) });
|
|
11696
11765
|
}
|
|
11697
11766
|
return createOrganizationContent;
|
|
@@ -11727,7 +11796,7 @@ var createOrganization = async ({ fetcher, ...requestConfig }) => {
|
|
|
11727
11796
|
var createOrganization_default = createOrganization;
|
|
11728
11797
|
|
|
11729
11798
|
// src/components/presentation/CreateOrganization/CreateOrganization.tsx
|
|
11730
|
-
import { Fragment as Fragment18, jsx as
|
|
11799
|
+
import { Fragment as Fragment18, jsx as jsx89 } from "react/jsx-runtime";
|
|
11731
11800
|
var CreateOrganization = ({
|
|
11732
11801
|
onCreateOrganization,
|
|
11733
11802
|
fallback = null,
|
|
@@ -11743,7 +11812,7 @@ var CreateOrganization = ({
|
|
|
11743
11812
|
return fallback;
|
|
11744
11813
|
}
|
|
11745
11814
|
if (!isSignedIn) {
|
|
11746
|
-
return /* @__PURE__ */
|
|
11815
|
+
return /* @__PURE__ */ jsx89(Fragment18, {});
|
|
11747
11816
|
}
|
|
11748
11817
|
const parentId = defaultParentId || currentOrganization?.id || "";
|
|
11749
11818
|
const handleSubmit = async (payload) => {
|
|
@@ -11777,7 +11846,7 @@ var CreateOrganization = ({
|
|
|
11777
11846
|
setLoading(false);
|
|
11778
11847
|
}
|
|
11779
11848
|
};
|
|
11780
|
-
return /* @__PURE__ */
|
|
11849
|
+
return /* @__PURE__ */ jsx89(
|
|
11781
11850
|
BaseCreateOrganization,
|
|
11782
11851
|
{
|
|
11783
11852
|
onSubmit: handleSubmit,
|
|
@@ -11959,7 +12028,7 @@ var useStyles26 = (theme, colorScheme, disabled, readOnly, hasError) => {
|
|
|
11959
12028
|
var KeyValueInput_styles_default = useStyles26;
|
|
11960
12029
|
|
|
11961
12030
|
// src/components/primitives/KeyValueInput/KeyValueInput.tsx
|
|
11962
|
-
import { jsx as
|
|
12031
|
+
import { jsx as jsx90, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
11963
12032
|
var KeyValueInput = ({
|
|
11964
12033
|
className = "",
|
|
11965
12034
|
disabled = false,
|
|
@@ -12037,7 +12106,7 @@ var KeyValueInput = ({
|
|
|
12037
12106
|
return /* @__PURE__ */ jsxs41("div", { className: cx29(withVendorCSSClassPrefix28(bem20("key-value-input")), styles.container, className), children: [
|
|
12038
12107
|
label && /* @__PURE__ */ jsxs41("label", { className: cx29(withVendorCSSClassPrefix28(bem20("key-value-input", "label")), styles.label), children: [
|
|
12039
12108
|
label,
|
|
12040
|
-
required && /* @__PURE__ */
|
|
12109
|
+
required && /* @__PURE__ */ jsx90(
|
|
12041
12110
|
"span",
|
|
12042
12111
|
{
|
|
12043
12112
|
className: cx29(withVendorCSSClassPrefix28(bem20("key-value-input", "required")), styles.requiredIndicator),
|
|
@@ -12046,7 +12115,7 @@ var KeyValueInput = ({
|
|
|
12046
12115
|
)
|
|
12047
12116
|
] }),
|
|
12048
12117
|
/* @__PURE__ */ jsxs41("div", { className: cx29(withVendorCSSClassPrefix28(bem20("key-value-input", "pairs-list")), styles.pairsList), children: [
|
|
12049
|
-
pairs.length === 0 && readOnly ? /* @__PURE__ */
|
|
12118
|
+
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
12119
|
"div",
|
|
12051
12120
|
{
|
|
12052
12121
|
className: cx29(withVendorCSSClassPrefix28(bem20("key-value-input", "readonly-pair")), styles.readOnlyPair),
|
|
@@ -12061,7 +12130,7 @@ var KeyValueInput = ({
|
|
|
12061
12130
|
]
|
|
12062
12131
|
}
|
|
12063
12132
|
),
|
|
12064
|
-
/* @__PURE__ */
|
|
12133
|
+
/* @__PURE__ */ jsx90(
|
|
12065
12134
|
"span",
|
|
12066
12135
|
{
|
|
12067
12136
|
className: cx29(withVendorCSSClassPrefix28(bem20("key-value-input", "readonly-value")), styles.readOnlyValue),
|
|
@@ -12076,7 +12145,7 @@ var KeyValueInput = ({
|
|
|
12076
12145
|
{
|
|
12077
12146
|
className: cx29(withVendorCSSClassPrefix28(bem20("key-value-input", "pair-row")), styles.pairRow),
|
|
12078
12147
|
children: [
|
|
12079
|
-
/* @__PURE__ */
|
|
12148
|
+
/* @__PURE__ */ jsx90(
|
|
12080
12149
|
TextField_default,
|
|
12081
12150
|
{
|
|
12082
12151
|
placeholder: keyPlaceholder,
|
|
@@ -12087,7 +12156,7 @@ var KeyValueInput = ({
|
|
|
12087
12156
|
"aria-label": `${keyLabel} ${index + 1}`
|
|
12088
12157
|
}
|
|
12089
12158
|
),
|
|
12090
|
-
/* @__PURE__ */
|
|
12159
|
+
/* @__PURE__ */ jsx90(
|
|
12091
12160
|
TextField_default,
|
|
12092
12161
|
{
|
|
12093
12162
|
placeholder: valuePlaceholder,
|
|
@@ -12098,7 +12167,7 @@ var KeyValueInput = ({
|
|
|
12098
12167
|
"aria-label": `${valueLabel} ${index + 1}`
|
|
12099
12168
|
}
|
|
12100
12169
|
),
|
|
12101
|
-
!readOnly && /* @__PURE__ */
|
|
12170
|
+
!readOnly && /* @__PURE__ */ jsx90(
|
|
12102
12171
|
"button",
|
|
12103
12172
|
{
|
|
12104
12173
|
type: "button",
|
|
@@ -12106,7 +12175,7 @@ var KeyValueInput = ({
|
|
|
12106
12175
|
disabled,
|
|
12107
12176
|
className: cx29(withVendorCSSClassPrefix28(bem20("key-value-input", "remove-button")), styles.removeButton),
|
|
12108
12177
|
"aria-label": `${removeButtonText} ${pair.key}`,
|
|
12109
|
-
children: /* @__PURE__ */
|
|
12178
|
+
children: /* @__PURE__ */ jsx90(X_default, { width: 16, height: 16 })
|
|
12110
12179
|
}
|
|
12111
12180
|
)
|
|
12112
12181
|
]
|
|
@@ -12114,7 +12183,7 @@ var KeyValueInput = ({
|
|
|
12114
12183
|
`${pair.key}-${index}`
|
|
12115
12184
|
)),
|
|
12116
12185
|
!readOnly && /* @__PURE__ */ jsxs41("div", { className: cx29(withVendorCSSClassPrefix28(bem20("key-value-input", "add-row")), styles.addRow), children: [
|
|
12117
|
-
/* @__PURE__ */
|
|
12186
|
+
/* @__PURE__ */ jsx90(
|
|
12118
12187
|
TextField_default,
|
|
12119
12188
|
{
|
|
12120
12189
|
placeholder: keyPlaceholder,
|
|
@@ -12125,7 +12194,7 @@ var KeyValueInput = ({
|
|
|
12125
12194
|
"aria-label": "New key"
|
|
12126
12195
|
}
|
|
12127
12196
|
),
|
|
12128
|
-
/* @__PURE__ */
|
|
12197
|
+
/* @__PURE__ */ jsx90(
|
|
12129
12198
|
TextField_default,
|
|
12130
12199
|
{
|
|
12131
12200
|
placeholder: valuePlaceholder,
|
|
@@ -12141,7 +12210,7 @@ var KeyValueInput = ({
|
|
|
12141
12210
|
}
|
|
12142
12211
|
}
|
|
12143
12212
|
),
|
|
12144
|
-
/* @__PURE__ */
|
|
12213
|
+
/* @__PURE__ */ jsx90(
|
|
12145
12214
|
"button",
|
|
12146
12215
|
{
|
|
12147
12216
|
type: "button",
|
|
@@ -12149,12 +12218,12 @@ var KeyValueInput = ({
|
|
|
12149
12218
|
disabled: isAddDisabled,
|
|
12150
12219
|
className: cx29(withVendorCSSClassPrefix28(bem20("key-value-input", "add-button")), styles.addButton),
|
|
12151
12220
|
"aria-label": "Add new key-value pair",
|
|
12152
|
-
children: /* @__PURE__ */
|
|
12221
|
+
children: /* @__PURE__ */ jsx90(Plus_default, { width: 16, height: 16 })
|
|
12153
12222
|
}
|
|
12154
12223
|
)
|
|
12155
12224
|
] })
|
|
12156
12225
|
] }),
|
|
12157
|
-
(helperText || error) && /* @__PURE__ */
|
|
12226
|
+
(helperText || error) && /* @__PURE__ */ jsx90("div", { className: cx29(withVendorCSSClassPrefix28(bem20("key-value-input", "helper-text")), styles.helperText), children: error || helperText }),
|
|
12158
12227
|
maxPairs && /* @__PURE__ */ jsxs41("div", { className: cx29(withVendorCSSClassPrefix28(bem20("key-value-input", "counter")), styles.counterText), children: [
|
|
12159
12228
|
pairs.length,
|
|
12160
12229
|
" of ",
|
|
@@ -12322,7 +12391,7 @@ var useStyles27 = (theme, colorScheme) => {
|
|
|
12322
12391
|
var BaseOrganizationProfile_styles_default = useStyles27;
|
|
12323
12392
|
|
|
12324
12393
|
// src/components/presentation/OrganizationProfile/BaseOrganizationProfile.tsx
|
|
12325
|
-
import { Fragment as Fragment19, jsx as
|
|
12394
|
+
import { Fragment as Fragment19, jsx as jsx91, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
12326
12395
|
var BaseOrganizationProfile = ({
|
|
12327
12396
|
fallback = null,
|
|
12328
12397
|
className = "",
|
|
@@ -12373,7 +12442,7 @@ var BaseOrganizationProfile = ({
|
|
|
12373
12442
|
const styles = BaseOrganizationProfile_styles_default(theme, colorScheme);
|
|
12374
12443
|
const [editedOrganization, setEditedOrganization] = useState27(organization);
|
|
12375
12444
|
const [editingFields, setEditingFields] = useState27({});
|
|
12376
|
-
const PencilIcon = () => /* @__PURE__ */
|
|
12445
|
+
const PencilIcon = () => /* @__PURE__ */ jsx91(
|
|
12377
12446
|
"svg",
|
|
12378
12447
|
{
|
|
12379
12448
|
width: "16",
|
|
@@ -12384,7 +12453,7 @@ var BaseOrganizationProfile = ({
|
|
|
12384
12453
|
strokeWidth: "2",
|
|
12385
12454
|
strokeLinecap: "round",
|
|
12386
12455
|
strokeLinejoin: "round",
|
|
12387
|
-
children: /* @__PURE__ */
|
|
12456
|
+
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
12457
|
}
|
|
12389
12458
|
);
|
|
12390
12459
|
const toggleFieldEdit = useCallback15((fieldName) => {
|
|
@@ -12447,7 +12516,7 @@ var BaseOrganizationProfile = ({
|
|
|
12447
12516
|
let fieldInput;
|
|
12448
12517
|
if (key === "attributes") {
|
|
12449
12518
|
const attributesValue = typeof fieldValue === "object" && fieldValue !== null ? fieldValue : {};
|
|
12450
|
-
fieldInput = /* @__PURE__ */
|
|
12519
|
+
fieldInput = /* @__PURE__ */ jsx91(
|
|
12451
12520
|
KeyValueInput_default,
|
|
12452
12521
|
{
|
|
12453
12522
|
value: attributesValue,
|
|
@@ -12485,26 +12554,26 @@ var BaseOrganizationProfile = ({
|
|
|
12485
12554
|
}
|
|
12486
12555
|
);
|
|
12487
12556
|
} else {
|
|
12488
|
-
fieldInput = /* @__PURE__ */
|
|
12557
|
+
fieldInput = /* @__PURE__ */ jsx91(TextField_default, { ...commonProps });
|
|
12489
12558
|
}
|
|
12490
12559
|
return /* @__PURE__ */ jsxs42(Fragment19, { children: [
|
|
12491
|
-
/* @__PURE__ */
|
|
12492
|
-
/* @__PURE__ */
|
|
12560
|
+
/* @__PURE__ */ jsx91("span", { className: cx30(styles.label), children: label }),
|
|
12561
|
+
/* @__PURE__ */ jsx91("div", { className: cx30(styles.value), children: fieldInput })
|
|
12493
12562
|
] });
|
|
12494
12563
|
}
|
|
12495
12564
|
const hasValue = value !== void 0 && value !== null && value !== "";
|
|
12496
12565
|
const isFieldEditable = editable && fieldEditable;
|
|
12497
12566
|
let displayValue;
|
|
12498
12567
|
if (hasValue) {
|
|
12499
|
-
displayValue = key === "attributes" && typeof value === "object" && value !== null ? /* @__PURE__ */
|
|
12568
|
+
displayValue = key === "attributes" && typeof value === "object" && value !== null ? /* @__PURE__ */ jsx91(KeyValueInput_default, { value, readOnly: true, label: "" }) : String(renderedValue);
|
|
12500
12569
|
} else if (isFieldEditable) {
|
|
12501
12570
|
displayValue = getFieldPlaceholder(key);
|
|
12502
12571
|
} else {
|
|
12503
12572
|
displayValue = "-";
|
|
12504
12573
|
}
|
|
12505
12574
|
return /* @__PURE__ */ jsxs42(Fragment19, { children: [
|
|
12506
|
-
/* @__PURE__ */
|
|
12507
|
-
/* @__PURE__ */
|
|
12575
|
+
/* @__PURE__ */ jsx91("span", { className: cx30(styles.label), children: label }),
|
|
12576
|
+
/* @__PURE__ */ jsx91("div", { className: cx30(styles.value, !hasValue && styles.valueEmpty), children: !hasValue && isFieldEditable && onStartEdit ? /* @__PURE__ */ jsx91(
|
|
12508
12577
|
Button_default,
|
|
12509
12578
|
{
|
|
12510
12579
|
onClick: onStartEdit,
|
|
@@ -12528,7 +12597,7 @@ var BaseOrganizationProfile = ({
|
|
|
12528
12597
|
return null;
|
|
12529
12598
|
}
|
|
12530
12599
|
return /* @__PURE__ */ jsxs42("div", { className: cx30(styles.field), children: [
|
|
12531
|
-
/* @__PURE__ */
|
|
12600
|
+
/* @__PURE__ */ jsx91("div", { className: cx30(styles.fieldContent), children: renderField(
|
|
12532
12601
|
field,
|
|
12533
12602
|
isFieldEditing,
|
|
12534
12603
|
(value) => {
|
|
@@ -12538,8 +12607,8 @@ var BaseOrganizationProfile = ({
|
|
|
12538
12607
|
},
|
|
12539
12608
|
() => toggleFieldEdit(field.key)
|
|
12540
12609
|
) }),
|
|
12541
|
-
isFieldEditable && /* @__PURE__ */
|
|
12542
|
-
/* @__PURE__ */
|
|
12610
|
+
isFieldEditable && /* @__PURE__ */ jsx91("div", { className: cx30(styles.fieldActions), children: isFieldEditing ? /* @__PURE__ */ jsxs42(Fragment19, { children: [
|
|
12611
|
+
/* @__PURE__ */ jsx91(
|
|
12543
12612
|
Button_default,
|
|
12544
12613
|
{
|
|
12545
12614
|
onClick: () => handleFieldSave(field.key),
|
|
@@ -12550,7 +12619,7 @@ var BaseOrganizationProfile = ({
|
|
|
12550
12619
|
children: saveButtonText
|
|
12551
12620
|
}
|
|
12552
12621
|
),
|
|
12553
|
-
/* @__PURE__ */
|
|
12622
|
+
/* @__PURE__ */ jsx91(
|
|
12554
12623
|
Button_default,
|
|
12555
12624
|
{
|
|
12556
12625
|
onClick: () => handleFieldCancel(field.key),
|
|
@@ -12561,7 +12630,7 @@ var BaseOrganizationProfile = ({
|
|
|
12561
12630
|
children: cancelButtonText
|
|
12562
12631
|
}
|
|
12563
12632
|
)
|
|
12564
|
-
] }) : hasValue && /* @__PURE__ */
|
|
12633
|
+
] }) : hasValue && /* @__PURE__ */ jsx91(
|
|
12565
12634
|
Button_default,
|
|
12566
12635
|
{
|
|
12567
12636
|
onClick: () => toggleFieldEdit(field.key),
|
|
@@ -12570,7 +12639,7 @@ var BaseOrganizationProfile = ({
|
|
|
12570
12639
|
size: "small",
|
|
12571
12640
|
title: "Edit field",
|
|
12572
12641
|
className: cx30(styles.editButton),
|
|
12573
|
-
children: /* @__PURE__ */
|
|
12642
|
+
children: /* @__PURE__ */ jsx91(PencilIcon, {})
|
|
12574
12643
|
}
|
|
12575
12644
|
) })
|
|
12576
12645
|
] }, field.key);
|
|
@@ -12580,21 +12649,21 @@ var BaseOrganizationProfile = ({
|
|
|
12580
12649
|
}
|
|
12581
12650
|
const profileContent = /* @__PURE__ */ jsxs42(Card_default, { className: cx30(styles.root, cardLayout && styles.card, className), children: [
|
|
12582
12651
|
/* @__PURE__ */ jsxs42("div", { className: cx30(styles.header), children: [
|
|
12583
|
-
/* @__PURE__ */
|
|
12652
|
+
/* @__PURE__ */ jsx91(Avatar, { name: getOrgInitials(organization.name), size: 80, alt: `${organization.name} logo` }),
|
|
12584
12653
|
/* @__PURE__ */ jsxs42("div", { className: cx30(styles.orgInfo), children: [
|
|
12585
|
-
/* @__PURE__ */
|
|
12654
|
+
/* @__PURE__ */ jsx91("h2", { className: cx30(styles.name), children: organization.name }),
|
|
12586
12655
|
organization.orgHandle && /* @__PURE__ */ jsxs42("p", { className: cx30(styles.handle), children: [
|
|
12587
12656
|
"@",
|
|
12588
12657
|
organization.orgHandle
|
|
12589
12658
|
] })
|
|
12590
12659
|
] })
|
|
12591
12660
|
] }),
|
|
12592
|
-
/* @__PURE__ */
|
|
12661
|
+
/* @__PURE__ */ jsx91("div", { className: cx30(styles.infoContainer), children: fields.map((field, index) => renderOrganizationField(field)) })
|
|
12593
12662
|
] });
|
|
12594
12663
|
if (mode === "popup") {
|
|
12595
|
-
return /* @__PURE__ */
|
|
12596
|
-
/* @__PURE__ */
|
|
12597
|
-
/* @__PURE__ */
|
|
12664
|
+
return /* @__PURE__ */ jsx91(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs42(Dialog_default.Content, { children: [
|
|
12665
|
+
/* @__PURE__ */ jsx91(Dialog_default.Heading, { children: title }),
|
|
12666
|
+
/* @__PURE__ */ jsx91("div", { className: cx30(styles.popup), children: profileContent })
|
|
12598
12667
|
] }) });
|
|
12599
12668
|
}
|
|
12600
12669
|
return profileContent;
|
|
@@ -12663,7 +12732,7 @@ var updateOrganization = async ({
|
|
|
12663
12732
|
var updateOrganization_default = updateOrganization;
|
|
12664
12733
|
|
|
12665
12734
|
// src/components/presentation/OrganizationProfile/OrganizationProfile.tsx
|
|
12666
|
-
import { jsx as
|
|
12735
|
+
import { jsx as jsx92 } from "react/jsx-runtime";
|
|
12667
12736
|
var OrganizationProfile = ({
|
|
12668
12737
|
organizationId,
|
|
12669
12738
|
mode = "default",
|
|
@@ -12671,8 +12740,8 @@ var OrganizationProfile = ({
|
|
|
12671
12740
|
onOpenChange,
|
|
12672
12741
|
onUpdate,
|
|
12673
12742
|
popupTitle,
|
|
12674
|
-
loadingFallback = /* @__PURE__ */
|
|
12675
|
-
errorFallback = /* @__PURE__ */
|
|
12743
|
+
loadingFallback = /* @__PURE__ */ jsx92("div", { children: "Loading organization..." }),
|
|
12744
|
+
errorFallback = /* @__PURE__ */ jsx92("div", { children: "Failed to load organization data" }),
|
|
12676
12745
|
...rest
|
|
12677
12746
|
}) => {
|
|
12678
12747
|
const { baseUrl } = useAsgardeo_default();
|
|
@@ -12723,7 +12792,7 @@ var OrganizationProfile = ({
|
|
|
12723
12792
|
throw err;
|
|
12724
12793
|
}
|
|
12725
12794
|
};
|
|
12726
|
-
return /* @__PURE__ */
|
|
12795
|
+
return /* @__PURE__ */ jsx92(
|
|
12727
12796
|
BaseOrganizationProfile_default,
|
|
12728
12797
|
{
|
|
12729
12798
|
organization,
|
|
@@ -12973,13 +13042,13 @@ var useStyles28 = (theme, colorScheme) => {
|
|
|
12973
13042
|
var BaseOrganizationList_styles_default = useStyles28;
|
|
12974
13043
|
|
|
12975
13044
|
// src/components/presentation/OrganizationList/BaseOrganizationList.tsx
|
|
12976
|
-
import { jsx as
|
|
13045
|
+
import { jsx as jsx93, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
12977
13046
|
var defaultRenderOrganization = (organization, styles, t, onOrganizationSelect, showStatus) => {
|
|
12978
13047
|
return /* @__PURE__ */ jsxs43("div", { className: cx31(styles.organizationItem), children: [
|
|
12979
13048
|
/* @__PURE__ */ jsxs43("div", { className: cx31(styles.organizationContent), children: [
|
|
12980
|
-
/* @__PURE__ */
|
|
13049
|
+
/* @__PURE__ */ jsx93(Avatar_default, { variant: "square", name: organization.name, size: 48, alt: `${organization.name} logo` }),
|
|
12981
13050
|
/* @__PURE__ */ jsxs43("div", { className: cx31(styles.organizationInfo), children: [
|
|
12982
|
-
/* @__PURE__ */
|
|
13051
|
+
/* @__PURE__ */ jsx93(Typography_default, { variant: "h6", className: cx31(styles.organizationName), children: organization.name }),
|
|
12983
13052
|
/* @__PURE__ */ jsxs43(Typography_default, { variant: "body2", color: "textSecondary", className: cx31(styles.organizationHandle), children: [
|
|
12984
13053
|
"@",
|
|
12985
13054
|
organization.orgHandle
|
|
@@ -12987,7 +13056,7 @@ var defaultRenderOrganization = (organization, styles, t, onOrganizationSelect,
|
|
|
12987
13056
|
showStatus && /* @__PURE__ */ jsxs43(Typography_default, { variant: "body2", color: "textSecondary", className: cx31(styles.organizationStatus), children: [
|
|
12988
13057
|
t("organization.switcher.status.label"),
|
|
12989
13058
|
" ",
|
|
12990
|
-
/* @__PURE__ */
|
|
13059
|
+
/* @__PURE__ */ jsx93(
|
|
12991
13060
|
"span",
|
|
12992
13061
|
{
|
|
12993
13062
|
className: cx31(
|
|
@@ -13000,7 +13069,7 @@ var defaultRenderOrganization = (organization, styles, t, onOrganizationSelect,
|
|
|
13000
13069
|
] })
|
|
13001
13070
|
] })
|
|
13002
13071
|
] }),
|
|
13003
|
-
organization.canSwitch && /* @__PURE__ */
|
|
13072
|
+
organization.canSwitch && /* @__PURE__ */ jsx93("div", { className: cx31(styles.organizationActions), children: /* @__PURE__ */ jsx93(
|
|
13004
13073
|
Button_default,
|
|
13005
13074
|
{
|
|
13006
13075
|
onClick: (e) => {
|
|
@@ -13015,16 +13084,16 @@ var defaultRenderOrganization = (organization, styles, t, onOrganizationSelect,
|
|
|
13015
13084
|
] }, organization.id);
|
|
13016
13085
|
};
|
|
13017
13086
|
var defaultRenderLoading = (t, styles) => /* @__PURE__ */ jsxs43("div", { className: cx31(styles.loadingContainer), children: [
|
|
13018
|
-
/* @__PURE__ */
|
|
13019
|
-
/* @__PURE__ */
|
|
13087
|
+
/* @__PURE__ */ jsx93(Spinner_default, { size: "medium" }),
|
|
13088
|
+
/* @__PURE__ */ jsx93(Typography_default, { variant: "body1", color: "textSecondary", className: cx31(styles.loadingText), children: t("organization.switcher.loading.organizations") })
|
|
13020
13089
|
] });
|
|
13021
|
-
var defaultRenderError = (error, t, styles) => /* @__PURE__ */
|
|
13022
|
-
/* @__PURE__ */
|
|
13090
|
+
var defaultRenderError = (error, t, styles) => /* @__PURE__ */ jsx93("div", { className: cx31(styles.errorContainer), children: /* @__PURE__ */ jsxs43(Typography_default, { variant: "body1", color: "error", children: [
|
|
13091
|
+
/* @__PURE__ */ jsx93("strong", { children: t("organization.switcher.error.prefix") }),
|
|
13023
13092
|
" ",
|
|
13024
13093
|
error
|
|
13025
13094
|
] }) });
|
|
13026
|
-
var defaultRenderLoadMore = (onLoadMore, isLoading, t, styles) => /* @__PURE__ */
|
|
13027
|
-
var defaultRenderEmpty = (t, styles) => /* @__PURE__ */
|
|
13095
|
+
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") });
|
|
13096
|
+
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
13097
|
var BaseOrganizationList = ({
|
|
13029
13098
|
className = "",
|
|
13030
13099
|
allOrganizations,
|
|
@@ -13067,53 +13136,53 @@ var BaseOrganizationList = ({
|
|
|
13067
13136
|
const renderLoadMoreWithStyles = renderLoadMore || ((onLoadMore, isLoading2) => defaultRenderLoadMore(onLoadMore, isLoading2, t, styles));
|
|
13068
13137
|
const renderOrganizationWithStyles = renderOrganization || ((org) => defaultRenderOrganization(org, styles, t, onOrganizationSelect, showStatus));
|
|
13069
13138
|
if (isLoading && organizationsWithSwitchAccess?.length === 0) {
|
|
13070
|
-
const loadingContent = /* @__PURE__ */
|
|
13139
|
+
const loadingContent = /* @__PURE__ */ jsx93("div", { className: cx31(styles.root, className), style, children: renderLoadingWithStyles() });
|
|
13071
13140
|
if (mode === "popup") {
|
|
13072
|
-
return /* @__PURE__ */
|
|
13073
|
-
/* @__PURE__ */
|
|
13074
|
-
/* @__PURE__ */
|
|
13141
|
+
return /* @__PURE__ */ jsx93(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs43(Dialog_default.Content, { children: [
|
|
13142
|
+
/* @__PURE__ */ jsx93(Dialog_default.Heading, { children: title }),
|
|
13143
|
+
/* @__PURE__ */ jsx93("div", { className: cx31(styles.popupContent), children: loadingContent })
|
|
13075
13144
|
] }) });
|
|
13076
13145
|
}
|
|
13077
13146
|
return loadingContent;
|
|
13078
13147
|
}
|
|
13079
13148
|
if (error && organizationsWithSwitchAccess?.length === 0) {
|
|
13080
|
-
const errorContent = /* @__PURE__ */
|
|
13149
|
+
const errorContent = /* @__PURE__ */ jsx93("div", { className: cx31(styles.root, className), style, children: renderErrorWithStyles(error) });
|
|
13081
13150
|
if (mode === "popup") {
|
|
13082
|
-
return /* @__PURE__ */
|
|
13083
|
-
/* @__PURE__ */
|
|
13084
|
-
/* @__PURE__ */
|
|
13151
|
+
return /* @__PURE__ */ jsx93(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs43(Dialog_default.Content, { children: [
|
|
13152
|
+
/* @__PURE__ */ jsx93(Dialog_default.Heading, { children: title }),
|
|
13153
|
+
/* @__PURE__ */ jsx93("div", { className: cx31(styles.popupContent), children: errorContent })
|
|
13085
13154
|
] }) });
|
|
13086
13155
|
}
|
|
13087
13156
|
return errorContent;
|
|
13088
13157
|
}
|
|
13089
13158
|
if (!isLoading && organizationsWithSwitchAccess?.length === 0) {
|
|
13090
|
-
const emptyContent = /* @__PURE__ */
|
|
13159
|
+
const emptyContent = /* @__PURE__ */ jsx93("div", { className: cx31(styles.root, className), style, children: renderEmptyWithStyles() });
|
|
13091
13160
|
if (mode === "popup") {
|
|
13092
|
-
return /* @__PURE__ */
|
|
13093
|
-
/* @__PURE__ */
|
|
13094
|
-
/* @__PURE__ */
|
|
13161
|
+
return /* @__PURE__ */ jsx93(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs43(Dialog_default.Content, { children: [
|
|
13162
|
+
/* @__PURE__ */ jsx93(Dialog_default.Heading, { children: title }),
|
|
13163
|
+
/* @__PURE__ */ jsx93("div", { className: cx31(styles.popupContent), children: emptyContent })
|
|
13095
13164
|
] }) });
|
|
13096
13165
|
}
|
|
13097
13166
|
return emptyContent;
|
|
13098
13167
|
}
|
|
13099
13168
|
const organizationListContent = /* @__PURE__ */ jsxs43("div", { className: cx31(styles.root, className), style, children: [
|
|
13100
13169
|
/* @__PURE__ */ jsxs43("div", { className: cx31(styles.header), children: [
|
|
13101
|
-
/* @__PURE__ */
|
|
13170
|
+
/* @__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
13171
|
showing: organizationsWithSwitchAccess?.length,
|
|
13103
13172
|
total: allOrganizations?.organizations?.length || 0
|
|
13104
13173
|
}) }) }),
|
|
13105
|
-
onRefresh && /* @__PURE__ */
|
|
13174
|
+
onRefresh && /* @__PURE__ */ jsx93(Button_default, { onClick: onRefresh, className: cx31(styles.refreshButton), type: "button", variant: "outline", size: "small", children: t("organization.switcher.refresh.button") })
|
|
13106
13175
|
] }),
|
|
13107
|
-
/* @__PURE__ */
|
|
13176
|
+
/* @__PURE__ */ jsx93("div", { className: cx31(styles.listContainer), children: organizationsWithSwitchAccess?.map(
|
|
13108
13177
|
(organization, index) => renderOrganizationWithStyles(organization, index)
|
|
13109
13178
|
) }),
|
|
13110
|
-
error && organizationsWithSwitchAccess?.length > 0 && /* @__PURE__ */
|
|
13111
|
-
hasMore && fetchMore && /* @__PURE__ */
|
|
13179
|
+
error && organizationsWithSwitchAccess?.length > 0 && /* @__PURE__ */ jsx93("div", { className: cx31(styles.errorMargin), children: renderErrorWithStyles(error) }),
|
|
13180
|
+
hasMore && fetchMore && /* @__PURE__ */ jsx93("div", { className: cx31(styles.loadMoreMargin), children: renderLoadMoreWithStyles(fetchMore, isLoadingMore) })
|
|
13112
13181
|
] });
|
|
13113
13182
|
if (mode === "popup") {
|
|
13114
|
-
return /* @__PURE__ */
|
|
13115
|
-
/* @__PURE__ */
|
|
13116
|
-
/* @__PURE__ */
|
|
13183
|
+
return /* @__PURE__ */ jsx93(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs43(Dialog_default.Content, { children: [
|
|
13184
|
+
/* @__PURE__ */ jsx93(Dialog_default.Heading, { children: title }),
|
|
13185
|
+
/* @__PURE__ */ jsx93("div", { className: cx31(styles.popupContent), children: organizationListContent })
|
|
13117
13186
|
] }) });
|
|
13118
13187
|
}
|
|
13119
13188
|
return organizationListContent;
|
|
@@ -13184,7 +13253,7 @@ var useStyles29 = (theme, colorScheme) => {
|
|
|
13184
13253
|
var OrganizationList_styles_default = useStyles29;
|
|
13185
13254
|
|
|
13186
13255
|
// src/components/presentation/OrganizationList/OrganizationList.tsx
|
|
13187
|
-
import { jsx as
|
|
13256
|
+
import { jsx as jsx94 } from "react/jsx-runtime";
|
|
13188
13257
|
var OrganizationList = ({
|
|
13189
13258
|
autoFetch = true,
|
|
13190
13259
|
filter = "",
|
|
@@ -13206,7 +13275,7 @@ var OrganizationList = ({
|
|
|
13206
13275
|
setAllOrganizations(await getAllOrganizations2());
|
|
13207
13276
|
})();
|
|
13208
13277
|
}, []);
|
|
13209
|
-
return /* @__PURE__ */
|
|
13278
|
+
return /* @__PURE__ */ jsx94("div", { className: cx32(styles.root, className), style, children: /* @__PURE__ */ jsx94("div", { className: cx32(styles.container), children: /* @__PURE__ */ jsx94(
|
|
13210
13279
|
BaseOrganizationList_default,
|
|
13211
13280
|
{
|
|
13212
13281
|
allOrganizations,
|
|
@@ -13221,7 +13290,7 @@ var OrganizationList = ({
|
|
|
13221
13290
|
var OrganizationList_default = OrganizationList;
|
|
13222
13291
|
|
|
13223
13292
|
// src/components/primitives/Icons/BuildingAlt.tsx
|
|
13224
|
-
import { jsx as
|
|
13293
|
+
import { jsx as jsx95, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
13225
13294
|
var BuildingAlt = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */ jsxs44(
|
|
13226
13295
|
"svg",
|
|
13227
13296
|
{
|
|
@@ -13235,13 +13304,13 @@ var BuildingAlt = ({ color = "currentColor", height = 24, width = 24 }) => /* @_
|
|
|
13235
13304
|
strokeLinecap: "round",
|
|
13236
13305
|
strokeLinejoin: "round",
|
|
13237
13306
|
children: [
|
|
13238
|
-
/* @__PURE__ */
|
|
13239
|
-
/* @__PURE__ */
|
|
13240
|
-
/* @__PURE__ */
|
|
13241
|
-
/* @__PURE__ */
|
|
13242
|
-
/* @__PURE__ */
|
|
13243
|
-
/* @__PURE__ */
|
|
13244
|
-
/* @__PURE__ */
|
|
13307
|
+
/* @__PURE__ */ jsx95("path", { d: "M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z" }),
|
|
13308
|
+
/* @__PURE__ */ jsx95("path", { d: "M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2" }),
|
|
13309
|
+
/* @__PURE__ */ jsx95("path", { d: "M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2" }),
|
|
13310
|
+
/* @__PURE__ */ jsx95("path", { d: "M10 6h4" }),
|
|
13311
|
+
/* @__PURE__ */ jsx95("path", { d: "M10 10h4" }),
|
|
13312
|
+
/* @__PURE__ */ jsx95("path", { d: "M10 14h4" }),
|
|
13313
|
+
/* @__PURE__ */ jsx95("path", { d: "M10 18h4" })
|
|
13245
13314
|
]
|
|
13246
13315
|
}
|
|
13247
13316
|
);
|
|
@@ -13249,7 +13318,7 @@ BuildingAlt.displayName = "BuildingAlt";
|
|
|
13249
13318
|
var BuildingAlt_default = BuildingAlt;
|
|
13250
13319
|
|
|
13251
13320
|
// src/components/presentation/OrganizationSwitcher/OrganizationSwitcher.tsx
|
|
13252
|
-
import { Fragment as Fragment20, jsx as
|
|
13321
|
+
import { Fragment as Fragment20, jsx as jsx96, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
13253
13322
|
var OrganizationSwitcher = ({
|
|
13254
13323
|
currentOrganization: propCurrentOrganization,
|
|
13255
13324
|
fallback = null,
|
|
@@ -13273,7 +13342,7 @@ var OrganizationSwitcher = ({
|
|
|
13273
13342
|
return fallback;
|
|
13274
13343
|
}
|
|
13275
13344
|
if (!isSignedIn) {
|
|
13276
|
-
return /* @__PURE__ */
|
|
13345
|
+
return /* @__PURE__ */ jsx96(Fragment20, {});
|
|
13277
13346
|
}
|
|
13278
13347
|
const organizations = propOrganizations || contextOrganizations || [];
|
|
13279
13348
|
const currentOrganization = propCurrentOrganization || contextCurrentOrganization;
|
|
@@ -13287,19 +13356,19 @@ var OrganizationSwitcher = ({
|
|
|
13287
13356
|
const defaultMenuItems = [];
|
|
13288
13357
|
if (currentOrganization) {
|
|
13289
13358
|
defaultMenuItems.push({
|
|
13290
|
-
icon: /* @__PURE__ */
|
|
13359
|
+
icon: /* @__PURE__ */ jsx96(BuildingAlt_default, {}),
|
|
13291
13360
|
label: t("organization.switcher.manage.organizations"),
|
|
13292
13361
|
onClick: handleManageOrganizations
|
|
13293
13362
|
});
|
|
13294
13363
|
}
|
|
13295
13364
|
defaultMenuItems.push({
|
|
13296
|
-
icon: /* @__PURE__ */
|
|
13365
|
+
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
13366
|
label: t("organization.switcher.create.organization"),
|
|
13298
13367
|
onClick: () => setIsCreateOrgOpen(true)
|
|
13299
13368
|
});
|
|
13300
13369
|
const menuItems = props.menuItems ? [...defaultMenuItems, ...props.menuItems] : defaultMenuItems;
|
|
13301
13370
|
return /* @__PURE__ */ jsxs45(Fragment20, { children: [
|
|
13302
|
-
/* @__PURE__ */
|
|
13371
|
+
/* @__PURE__ */ jsx96(
|
|
13303
13372
|
BaseOrganizationSwitcher_default,
|
|
13304
13373
|
{
|
|
13305
13374
|
organizations,
|
|
@@ -13312,7 +13381,7 @@ var OrganizationSwitcher = ({
|
|
|
13312
13381
|
...props
|
|
13313
13382
|
}
|
|
13314
13383
|
),
|
|
13315
|
-
/* @__PURE__ */
|
|
13384
|
+
/* @__PURE__ */ jsx96(
|
|
13316
13385
|
CreateOrganization,
|
|
13317
13386
|
{
|
|
13318
13387
|
mode: "popup",
|
|
@@ -13326,7 +13395,7 @@ var OrganizationSwitcher = ({
|
|
|
13326
13395
|
}
|
|
13327
13396
|
}
|
|
13328
13397
|
),
|
|
13329
|
-
currentOrganization && /* @__PURE__ */
|
|
13398
|
+
currentOrganization && /* @__PURE__ */ jsx96(
|
|
13330
13399
|
OrganizationProfile_default,
|
|
13331
13400
|
{
|
|
13332
13401
|
organizationId: currentOrganization.id,
|
|
@@ -13334,11 +13403,11 @@ var OrganizationSwitcher = ({
|
|
|
13334
13403
|
open: isProfileOpen,
|
|
13335
13404
|
onOpenChange: setIsProfileOpen,
|
|
13336
13405
|
cardLayout: true,
|
|
13337
|
-
loadingFallback: /* @__PURE__ */
|
|
13338
|
-
errorFallback: /* @__PURE__ */
|
|
13406
|
+
loadingFallback: /* @__PURE__ */ jsx96("div", { children: t("organization.profile.loading") }),
|
|
13407
|
+
errorFallback: /* @__PURE__ */ jsx96("div", { children: t("organization.profile.error") })
|
|
13339
13408
|
}
|
|
13340
13409
|
),
|
|
13341
|
-
/* @__PURE__ */
|
|
13410
|
+
/* @__PURE__ */ jsx96(
|
|
13342
13411
|
OrganizationList_default,
|
|
13343
13412
|
{
|
|
13344
13413
|
mode: "popup",
|
|
@@ -13371,7 +13440,7 @@ export {
|
|
|
13371
13440
|
BaseOrganizationList_default as BaseOrganizationList,
|
|
13372
13441
|
BaseOrganizationProfile_default as BaseOrganizationProfile,
|
|
13373
13442
|
BaseOrganizationSwitcher_default as BaseOrganizationSwitcher,
|
|
13374
|
-
|
|
13443
|
+
BaseSignIn_default3 as BaseSignIn,
|
|
13375
13444
|
BaseSignInButton_default as BaseSignInButton,
|
|
13376
13445
|
BaseSignOutButton_default as BaseSignOutButton,
|
|
13377
13446
|
BaseSignUp_default as BaseSignUp,
|