@asgardeo/react 0.7.0 → 0.8.0
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 +1695 -803
- package/dist/cjs/index.js.map +4 -4
- package/dist/components/presentation/auth/AcceptInvite/index.d.ts +21 -0
- package/dist/components/presentation/auth/AcceptInvite/v2/AcceptInvite.d.ts +124 -0
- package/dist/components/presentation/auth/AcceptInvite/v2/BaseAcceptInvite.d.ts +192 -0
- package/dist/components/presentation/auth/AcceptInvite/v2/BaseAcceptInvite.styles.d.ts +30 -0
- package/dist/components/presentation/auth/AuthOptionFactory.d.ts +12 -0
- package/dist/components/presentation/auth/InviteUser/index.d.ts +21 -0
- package/dist/components/presentation/auth/InviteUser/v2/BaseInviteUser.d.ts +185 -0
- package/dist/components/presentation/auth/InviteUser/v2/BaseInviteUser.styles.d.ts +30 -0
- package/dist/components/presentation/auth/InviteUser/v2/InviteUser.d.ts +107 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +1621 -729
- package/dist/index.js.map +4 -4
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -7178,6 +7178,22 @@ var renderSignUpComponents = (components, formValues, touchedFields, formErrors,
|
|
|
7178
7178
|
}
|
|
7179
7179
|
)
|
|
7180
7180
|
).filter(Boolean);
|
|
7181
|
+
var renderInviteUserComponents = (components, formValues, touchedFields, formErrors, isLoading, isFormValid, onInputChange, options) => components.map(
|
|
7182
|
+
(component, index) => createAuthComponentFromFlow(
|
|
7183
|
+
component,
|
|
7184
|
+
formValues,
|
|
7185
|
+
touchedFields,
|
|
7186
|
+
formErrors,
|
|
7187
|
+
isLoading,
|
|
7188
|
+
isFormValid,
|
|
7189
|
+
onInputChange,
|
|
7190
|
+
"signup",
|
|
7191
|
+
{
|
|
7192
|
+
...options,
|
|
7193
|
+
key: component.id || index
|
|
7194
|
+
}
|
|
7195
|
+
)
|
|
7196
|
+
).filter(Boolean);
|
|
7181
7197
|
|
|
7182
7198
|
// src/utils/v2/resolveTranslation.ts
|
|
7183
7199
|
var isTranslationString = (text) => {
|
|
@@ -7697,7 +7713,7 @@ var SignIn = ({ className, size = "medium", onSuccess, onError, variant, childre
|
|
|
7697
7713
|
sessionStorage.removeItem("asgardeo_auth_id");
|
|
7698
7714
|
oauthCodeProcessedRef.current = false;
|
|
7699
7715
|
};
|
|
7700
|
-
const
|
|
7716
|
+
const getUrlParams2 = () => {
|
|
7701
7717
|
const urlParams = new URL(window?.location?.href ?? "").searchParams;
|
|
7702
7718
|
return {
|
|
7703
7719
|
code: urlParams.get("code"),
|
|
@@ -7757,7 +7773,7 @@ var SignIn = ({ className, size = "medium", onSuccess, onError, variant, childre
|
|
|
7757
7773
|
if (response.flowId) {
|
|
7758
7774
|
setFlowId(response.flowId);
|
|
7759
7775
|
}
|
|
7760
|
-
const urlParams =
|
|
7776
|
+
const urlParams = getUrlParams2();
|
|
7761
7777
|
handleAuthId(urlParams.authId);
|
|
7762
7778
|
window.location.href = redirectURL;
|
|
7763
7779
|
return true;
|
|
@@ -7767,7 +7783,7 @@ var SignIn = ({ className, size = "medium", onSuccess, onError, variant, childre
|
|
|
7767
7783
|
};
|
|
7768
7784
|
useEffect13(() => {
|
|
7769
7785
|
const storedFlowId = sessionStorage.getItem("asgardeo_flow_id");
|
|
7770
|
-
const urlParams =
|
|
7786
|
+
const urlParams = getUrlParams2();
|
|
7771
7787
|
if (urlParams.error) {
|
|
7772
7788
|
handleOAuthError(urlParams.error, urlParams.errorDescription);
|
|
7773
7789
|
return;
|
|
@@ -7776,14 +7792,14 @@ var SignIn = ({ className, size = "medium", onSuccess, onError, variant, childre
|
|
|
7776
7792
|
if (urlParams.code || urlParams.state) {
|
|
7777
7793
|
return;
|
|
7778
7794
|
}
|
|
7779
|
-
const currentUrlParams =
|
|
7795
|
+
const currentUrlParams = getUrlParams2();
|
|
7780
7796
|
if (isInitialized && !isLoading && !isFlowInitialized && !initializationAttemptedRef.current && !currentFlowId && !currentUrlParams.code && !currentUrlParams.state && !isSubmitting && !oauthCodeProcessedRef.current) {
|
|
7781
7797
|
initializationAttemptedRef.current = true;
|
|
7782
7798
|
initializeFlow();
|
|
7783
7799
|
}
|
|
7784
7800
|
}, [isInitialized, isLoading, isFlowInitialized, currentFlowId]);
|
|
7785
7801
|
const initializeFlow = async () => {
|
|
7786
|
-
const urlParams =
|
|
7802
|
+
const urlParams = getUrlParams2();
|
|
7787
7803
|
oauthCodeProcessedRef.current = false;
|
|
7788
7804
|
handleAuthId(urlParams.authId);
|
|
7789
7805
|
const effectiveApplicationId = applicationId || urlParams.applicationId;
|
|
@@ -7895,7 +7911,7 @@ var SignIn = ({ className, size = "medium", onSuccess, onError, variant, childre
|
|
|
7895
7911
|
setError(error);
|
|
7896
7912
|
};
|
|
7897
7913
|
useEffect13(() => {
|
|
7898
|
-
const urlParams =
|
|
7914
|
+
const urlParams = getUrlParams2();
|
|
7899
7915
|
const storedFlowId = sessionStorage.getItem("asgardeo_flow_id");
|
|
7900
7916
|
if (urlParams.error) {
|
|
7901
7917
|
handleOAuthError(urlParams.error, urlParams.errorDescription);
|
|
@@ -9522,7 +9538,7 @@ var BaseSignUpContent2 = ({
|
|
|
9522
9538
|
handleInputBlur
|
|
9523
9539
|
]
|
|
9524
9540
|
);
|
|
9525
|
-
const
|
|
9541
|
+
const getUrlParams2 = () => {
|
|
9526
9542
|
const urlParams = new URL(window?.location?.href ?? "").searchParams;
|
|
9527
9543
|
return {
|
|
9528
9544
|
code: urlParams.get("code"),
|
|
@@ -9531,7 +9547,7 @@ var BaseSignUpContent2 = ({
|
|
|
9531
9547
|
};
|
|
9532
9548
|
};
|
|
9533
9549
|
useEffect15(() => {
|
|
9534
|
-
const urlParams =
|
|
9550
|
+
const urlParams = getUrlParams2();
|
|
9535
9551
|
if (urlParams.code || urlParams.state) {
|
|
9536
9552
|
return;
|
|
9537
9553
|
}
|
|
@@ -9692,131 +9708,1003 @@ var SignUp = ({
|
|
|
9692
9708
|
onComplete: handleComplete,
|
|
9693
9709
|
className,
|
|
9694
9710
|
size,
|
|
9695
|
-
isInitialized,
|
|
9696
|
-
children,
|
|
9697
|
-
showLogo: true,
|
|
9698
|
-
showTitle: false,
|
|
9699
|
-
showSubtitle: false,
|
|
9700
|
-
...rest
|
|
9701
|
-
}
|
|
9711
|
+
isInitialized,
|
|
9712
|
+
children,
|
|
9713
|
+
showLogo: true,
|
|
9714
|
+
showTitle: false,
|
|
9715
|
+
showSubtitle: false,
|
|
9716
|
+
...rest
|
|
9717
|
+
}
|
|
9718
|
+
);
|
|
9719
|
+
};
|
|
9720
|
+
var SignUp_default = SignUp;
|
|
9721
|
+
|
|
9722
|
+
// src/components/presentation/auth/SignUp/v2/SignUp.tsx
|
|
9723
|
+
import {
|
|
9724
|
+
EmbeddedFlowResponseType as EmbeddedFlowResponseType4,
|
|
9725
|
+
EmbeddedFlowType as EmbeddedFlowType3
|
|
9726
|
+
} from "@asgardeo/browser";
|
|
9727
|
+
import { jsx as jsx71 } from "react/jsx-runtime";
|
|
9728
|
+
var SignUp2 = ({
|
|
9729
|
+
className,
|
|
9730
|
+
size = "medium",
|
|
9731
|
+
afterSignUpUrl,
|
|
9732
|
+
onError,
|
|
9733
|
+
onComplete,
|
|
9734
|
+
shouldRedirectAfterSignUp = true,
|
|
9735
|
+
children,
|
|
9736
|
+
...rest
|
|
9737
|
+
}) => {
|
|
9738
|
+
const { signUp, isInitialized, applicationId } = useAsgardeo_default();
|
|
9739
|
+
const handleInitialize = async (payload) => {
|
|
9740
|
+
const urlParams = new URL(window.location.href).searchParams;
|
|
9741
|
+
const applicationIdFromUrl = urlParams.get("applicationId");
|
|
9742
|
+
const effectiveApplicationId = applicationId || applicationIdFromUrl;
|
|
9743
|
+
const initialPayload = payload || {
|
|
9744
|
+
flowType: EmbeddedFlowType3.Registration,
|
|
9745
|
+
...effectiveApplicationId && { applicationId: effectiveApplicationId }
|
|
9746
|
+
};
|
|
9747
|
+
return await signUp(initialPayload);
|
|
9748
|
+
};
|
|
9749
|
+
const handleOnSubmit = async (payload) => await signUp(payload);
|
|
9750
|
+
const handleComplete = (response) => {
|
|
9751
|
+
onComplete?.(response);
|
|
9752
|
+
if (shouldRedirectAfterSignUp && response?.type !== EmbeddedFlowResponseType4.Redirection && afterSignUpUrl) {
|
|
9753
|
+
window.location.href = afterSignUpUrl;
|
|
9754
|
+
}
|
|
9755
|
+
if (shouldRedirectAfterSignUp && response?.type === EmbeddedFlowResponseType4.Redirection && response?.data?.redirectURL && !response.data.redirectURL.includes("oauth") && // Not a social provider redirect
|
|
9756
|
+
!response.data.redirectURL.includes("auth")) {
|
|
9757
|
+
window.location.href = response.data.redirectURL;
|
|
9758
|
+
}
|
|
9759
|
+
};
|
|
9760
|
+
return /* @__PURE__ */ jsx71(
|
|
9761
|
+
BaseSignUp_default2,
|
|
9762
|
+
{
|
|
9763
|
+
afterSignUpUrl,
|
|
9764
|
+
onInitialize: handleInitialize,
|
|
9765
|
+
onSubmit: handleOnSubmit,
|
|
9766
|
+
onError,
|
|
9767
|
+
onComplete: handleComplete,
|
|
9768
|
+
className,
|
|
9769
|
+
size,
|
|
9770
|
+
isInitialized,
|
|
9771
|
+
children,
|
|
9772
|
+
showLogo: true,
|
|
9773
|
+
showTitle: true,
|
|
9774
|
+
showSubtitle: true,
|
|
9775
|
+
...rest
|
|
9776
|
+
}
|
|
9777
|
+
);
|
|
9778
|
+
};
|
|
9779
|
+
var SignUp_default2 = SignUp2;
|
|
9780
|
+
|
|
9781
|
+
// src/components/presentation/auth/SignUp/SignUp.tsx
|
|
9782
|
+
import { jsx as jsx72 } from "react/jsx-runtime";
|
|
9783
|
+
var SignUp3 = (props) => {
|
|
9784
|
+
const { platform } = useAsgardeo_default();
|
|
9785
|
+
if (platform === Platform6.AsgardeoV2) {
|
|
9786
|
+
return /* @__PURE__ */ jsx72(SignUp_default2, { ...props });
|
|
9787
|
+
}
|
|
9788
|
+
return /* @__PURE__ */ jsx72(SignUp_default, { ...props });
|
|
9789
|
+
};
|
|
9790
|
+
var SignUp_default3 = SignUp3;
|
|
9791
|
+
|
|
9792
|
+
// src/components/presentation/auth/InviteUser/v2/InviteUser.tsx
|
|
9793
|
+
import { EmbeddedFlowType as EmbeddedFlowType5 } from "@asgardeo/browser";
|
|
9794
|
+
|
|
9795
|
+
// src/components/presentation/auth/InviteUser/v2/BaseInviteUser.tsx
|
|
9796
|
+
import { useCallback as useCallback13, useEffect as useEffect16, useRef as useRef7, useState as useState19 } from "react";
|
|
9797
|
+
import { EmbeddedFlowType as EmbeddedFlowType4 } from "@asgardeo/browser";
|
|
9798
|
+
import { cx as cx23 } from "@emotion/css";
|
|
9799
|
+
|
|
9800
|
+
// src/components/presentation/auth/InviteUser/v2/BaseInviteUser.styles.ts
|
|
9801
|
+
import { css as css18 } from "@emotion/css";
|
|
9802
|
+
import { useMemo as useMemo25 } from "react";
|
|
9803
|
+
var useStyles18 = (theme, colorScheme) => {
|
|
9804
|
+
return useMemo25(() => {
|
|
9805
|
+
const card = css18`
|
|
9806
|
+
background: ${theme.vars.colors.background.surface};
|
|
9807
|
+
border-radius: ${theme.vars.borderRadius.large};
|
|
9808
|
+
gap: calc(${theme.vars.spacing.unit} * 2);
|
|
9809
|
+
min-width: 420px;
|
|
9810
|
+
`;
|
|
9811
|
+
const header = css18`
|
|
9812
|
+
gap: 0;
|
|
9813
|
+
align-items: center;
|
|
9814
|
+
`;
|
|
9815
|
+
const title = css18`
|
|
9816
|
+
margin: 0 0 calc(${theme.vars.spacing.unit} * 1) 0;
|
|
9817
|
+
color: ${theme.vars.colors.text.primary};
|
|
9818
|
+
`;
|
|
9819
|
+
const subtitle = css18`
|
|
9820
|
+
margin-bottom: calc(${theme.vars.spacing.unit} * 1);
|
|
9821
|
+
color: ${theme.vars.colors.text.secondary};
|
|
9822
|
+
`;
|
|
9823
|
+
return {
|
|
9824
|
+
card,
|
|
9825
|
+
header,
|
|
9826
|
+
title,
|
|
9827
|
+
subtitle
|
|
9828
|
+
};
|
|
9829
|
+
}, [
|
|
9830
|
+
theme.vars.colors.background.surface,
|
|
9831
|
+
theme.vars.colors.text.primary,
|
|
9832
|
+
theme.vars.colors.text.secondary,
|
|
9833
|
+
theme.vars.borderRadius.large,
|
|
9834
|
+
theme.vars.spacing.unit,
|
|
9835
|
+
colorScheme
|
|
9836
|
+
]);
|
|
9837
|
+
};
|
|
9838
|
+
var BaseInviteUser_styles_default = useStyles18;
|
|
9839
|
+
|
|
9840
|
+
// src/components/presentation/auth/InviteUser/v2/BaseInviteUser.tsx
|
|
9841
|
+
import { jsx as jsx73, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
9842
|
+
var BaseInviteUser = ({
|
|
9843
|
+
onInitialize,
|
|
9844
|
+
onSubmit,
|
|
9845
|
+
onError,
|
|
9846
|
+
onFlowChange,
|
|
9847
|
+
onInviteLinkGenerated,
|
|
9848
|
+
className = "",
|
|
9849
|
+
children,
|
|
9850
|
+
isInitialized = true,
|
|
9851
|
+
size = "medium",
|
|
9852
|
+
variant = "outlined",
|
|
9853
|
+
showTitle = true,
|
|
9854
|
+
showSubtitle = true
|
|
9855
|
+
}) => {
|
|
9856
|
+
const { t } = useTranslation_default();
|
|
9857
|
+
const { theme } = useTheme_default();
|
|
9858
|
+
const styles = BaseInviteUser_styles_default(theme, theme.vars.colors.text.primary);
|
|
9859
|
+
const [isLoading, setIsLoading] = useState19(false);
|
|
9860
|
+
const [isFlowInitialized, setIsFlowInitialized] = useState19(false);
|
|
9861
|
+
const [currentFlow, setCurrentFlow] = useState19(null);
|
|
9862
|
+
const [apiError, setApiError] = useState19(null);
|
|
9863
|
+
const [formValues, setFormValues] = useState19({});
|
|
9864
|
+
const [formErrors, setFormErrors] = useState19({});
|
|
9865
|
+
const [touchedFields, setTouchedFields] = useState19({});
|
|
9866
|
+
const [inviteLink, setInviteLink] = useState19();
|
|
9867
|
+
const [inviteLinkCopied, setInviteLinkCopied] = useState19(false);
|
|
9868
|
+
const [isFormValid, setIsFormValid] = useState19(true);
|
|
9869
|
+
const initializationAttemptedRef = useRef7(false);
|
|
9870
|
+
const handleError = useCallback13(
|
|
9871
|
+
(error) => {
|
|
9872
|
+
const errorMessage = error?.failureReason || extractErrorMessage(error, t, "components.inviteUser.errors.generic");
|
|
9873
|
+
setApiError(error instanceof Error ? error : new Error(errorMessage));
|
|
9874
|
+
onError?.(error instanceof Error ? error : new Error(errorMessage));
|
|
9875
|
+
},
|
|
9876
|
+
[t, onError]
|
|
9877
|
+
);
|
|
9878
|
+
const normalizeFlowResponseLocal = useCallback13(
|
|
9879
|
+
(response) => {
|
|
9880
|
+
if (!response?.data?.meta?.components) {
|
|
9881
|
+
return response;
|
|
9882
|
+
}
|
|
9883
|
+
try {
|
|
9884
|
+
const { components: components2 } = normalizeFlowResponse(response, t, {
|
|
9885
|
+
defaultErrorKey: "components.inviteUser.errors.generic",
|
|
9886
|
+
resolveTranslations: !children
|
|
9887
|
+
});
|
|
9888
|
+
return {
|
|
9889
|
+
...response,
|
|
9890
|
+
data: {
|
|
9891
|
+
...response.data,
|
|
9892
|
+
components: components2
|
|
9893
|
+
}
|
|
9894
|
+
};
|
|
9895
|
+
} catch {
|
|
9896
|
+
return response;
|
|
9897
|
+
}
|
|
9898
|
+
},
|
|
9899
|
+
[t, children]
|
|
9900
|
+
);
|
|
9901
|
+
const handleInputChange = useCallback13((name, value) => {
|
|
9902
|
+
setFormValues((prev) => ({ ...prev, [name]: value }));
|
|
9903
|
+
setFormErrors((prev) => {
|
|
9904
|
+
const newErrors = { ...prev };
|
|
9905
|
+
delete newErrors[name];
|
|
9906
|
+
return newErrors;
|
|
9907
|
+
});
|
|
9908
|
+
}, []);
|
|
9909
|
+
const handleInputBlur = useCallback13((name) => {
|
|
9910
|
+
setTouchedFields((prev) => ({ ...prev, [name]: true }));
|
|
9911
|
+
}, []);
|
|
9912
|
+
const validateForm = useCallback13(
|
|
9913
|
+
(components2) => {
|
|
9914
|
+
const errors = {};
|
|
9915
|
+
const validateComponents = (comps) => {
|
|
9916
|
+
comps.forEach((comp) => {
|
|
9917
|
+
if ((comp.type === "TEXT_INPUT" || comp.type === "EMAIL_INPUT" || comp.type === "SELECT") && comp.required && comp.ref) {
|
|
9918
|
+
const value = formValues[comp.ref];
|
|
9919
|
+
if (!value || value.trim() === "") {
|
|
9920
|
+
errors[comp.ref] = `${comp.label || comp.ref} is required`;
|
|
9921
|
+
}
|
|
9922
|
+
if (comp.type === "EMAIL_INPUT" && value && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value)) {
|
|
9923
|
+
errors[comp.ref] = "Please enter a valid email address";
|
|
9924
|
+
}
|
|
9925
|
+
}
|
|
9926
|
+
if (comp.components && Array.isArray(comp.components)) {
|
|
9927
|
+
validateComponents(comp.components);
|
|
9928
|
+
}
|
|
9929
|
+
});
|
|
9930
|
+
};
|
|
9931
|
+
validateComponents(components2);
|
|
9932
|
+
return { isValid: Object.keys(errors).length === 0, errors };
|
|
9933
|
+
},
|
|
9934
|
+
[formValues]
|
|
9935
|
+
);
|
|
9936
|
+
const handleSubmit = useCallback13(
|
|
9937
|
+
async (component, data) => {
|
|
9938
|
+
if (!currentFlow) {
|
|
9939
|
+
return;
|
|
9940
|
+
}
|
|
9941
|
+
const components2 = currentFlow.data?.components || [];
|
|
9942
|
+
const validation = validateForm(components2);
|
|
9943
|
+
if (!validation.isValid) {
|
|
9944
|
+
setFormErrors(validation.errors);
|
|
9945
|
+
setIsFormValid(false);
|
|
9946
|
+
const touched = {};
|
|
9947
|
+
Object.keys(validation.errors).forEach((key) => {
|
|
9948
|
+
touched[key] = true;
|
|
9949
|
+
});
|
|
9950
|
+
setTouchedFields((prev) => ({ ...prev, ...touched }));
|
|
9951
|
+
return;
|
|
9952
|
+
}
|
|
9953
|
+
setIsLoading(true);
|
|
9954
|
+
setApiError(null);
|
|
9955
|
+
setIsFormValid(true);
|
|
9956
|
+
try {
|
|
9957
|
+
const inputs = data || formValues;
|
|
9958
|
+
const payload = {
|
|
9959
|
+
flowId: currentFlow.flowId,
|
|
9960
|
+
inputs,
|
|
9961
|
+
verbose: true
|
|
9962
|
+
};
|
|
9963
|
+
if (component?.id) {
|
|
9964
|
+
payload["action"] = component.id;
|
|
9965
|
+
}
|
|
9966
|
+
const rawResponse = await onSubmit(payload);
|
|
9967
|
+
const response = normalizeFlowResponseLocal(rawResponse);
|
|
9968
|
+
onFlowChange?.(response);
|
|
9969
|
+
if (response.data?.additionalData?.["inviteLink"]) {
|
|
9970
|
+
const inviteLinkValue = response.data.additionalData["inviteLink"];
|
|
9971
|
+
setInviteLink(inviteLinkValue);
|
|
9972
|
+
onInviteLinkGenerated?.(inviteLinkValue, response.flowId);
|
|
9973
|
+
}
|
|
9974
|
+
if (response.flowStatus === "ERROR") {
|
|
9975
|
+
handleError(response);
|
|
9976
|
+
return;
|
|
9977
|
+
}
|
|
9978
|
+
setCurrentFlow(response);
|
|
9979
|
+
setFormValues({});
|
|
9980
|
+
setFormErrors({});
|
|
9981
|
+
setTouchedFields({});
|
|
9982
|
+
} catch (err) {
|
|
9983
|
+
handleError(err);
|
|
9984
|
+
} finally {
|
|
9985
|
+
setIsLoading(false);
|
|
9986
|
+
}
|
|
9987
|
+
},
|
|
9988
|
+
[currentFlow, formValues, validateForm, onSubmit, onFlowChange, onInviteLinkGenerated, handleError, normalizeFlowResponseLocal]
|
|
9989
|
+
);
|
|
9990
|
+
const copyInviteLink = useCallback13(async () => {
|
|
9991
|
+
if (!inviteLink) return;
|
|
9992
|
+
try {
|
|
9993
|
+
await navigator.clipboard.writeText(inviteLink);
|
|
9994
|
+
setInviteLinkCopied(true);
|
|
9995
|
+
setTimeout(() => setInviteLinkCopied(false), 3e3);
|
|
9996
|
+
} catch {
|
|
9997
|
+
const textArea = document.createElement("textarea");
|
|
9998
|
+
textArea.value = inviteLink;
|
|
9999
|
+
document.body.appendChild(textArea);
|
|
10000
|
+
textArea.select();
|
|
10001
|
+
document.execCommand("copy");
|
|
10002
|
+
document.body.removeChild(textArea);
|
|
10003
|
+
setInviteLinkCopied(true);
|
|
10004
|
+
setTimeout(() => setInviteLinkCopied(false), 3e3);
|
|
10005
|
+
}
|
|
10006
|
+
}, [inviteLink]);
|
|
10007
|
+
const resetFlow = useCallback13(() => {
|
|
10008
|
+
setIsFlowInitialized(false);
|
|
10009
|
+
setCurrentFlow(null);
|
|
10010
|
+
setApiError(null);
|
|
10011
|
+
setFormValues({});
|
|
10012
|
+
setFormErrors({});
|
|
10013
|
+
setTouchedFields({});
|
|
10014
|
+
setInviteLink(void 0);
|
|
10015
|
+
setInviteLinkCopied(false);
|
|
10016
|
+
initializationAttemptedRef.current = false;
|
|
10017
|
+
}, []);
|
|
10018
|
+
useEffect16(() => {
|
|
10019
|
+
if (isInitialized && !isFlowInitialized && !initializationAttemptedRef.current) {
|
|
10020
|
+
initializationAttemptedRef.current = true;
|
|
10021
|
+
(async () => {
|
|
10022
|
+
setIsLoading(true);
|
|
10023
|
+
setApiError(null);
|
|
10024
|
+
try {
|
|
10025
|
+
const payload = {
|
|
10026
|
+
flowType: EmbeddedFlowType4.UserOnboarding,
|
|
10027
|
+
verbose: true
|
|
10028
|
+
};
|
|
10029
|
+
const rawResponse = await onInitialize(payload);
|
|
10030
|
+
const response = normalizeFlowResponseLocal(rawResponse);
|
|
10031
|
+
setCurrentFlow(response);
|
|
10032
|
+
setIsFlowInitialized(true);
|
|
10033
|
+
onFlowChange?.(response);
|
|
10034
|
+
if (response.flowStatus === "ERROR") {
|
|
10035
|
+
handleError(response);
|
|
10036
|
+
}
|
|
10037
|
+
} catch (err) {
|
|
10038
|
+
handleError(err);
|
|
10039
|
+
} finally {
|
|
10040
|
+
setIsLoading(false);
|
|
10041
|
+
}
|
|
10042
|
+
})();
|
|
10043
|
+
}
|
|
10044
|
+
}, [isInitialized, isFlowInitialized, onInitialize, onFlowChange, handleError, normalizeFlowResponseLocal]);
|
|
10045
|
+
useEffect16(() => {
|
|
10046
|
+
if (currentFlow && isFlowInitialized) {
|
|
10047
|
+
const components2 = currentFlow.data?.components || [];
|
|
10048
|
+
if (components2.length > 0) {
|
|
10049
|
+
const validation = validateForm(components2);
|
|
10050
|
+
setIsFormValid(validation.isValid);
|
|
10051
|
+
}
|
|
10052
|
+
}
|
|
10053
|
+
}, [formValues, currentFlow, isFlowInitialized, validateForm]);
|
|
10054
|
+
const extractHeadings = useCallback13((components2) => {
|
|
10055
|
+
let title2;
|
|
10056
|
+
let subtitle2;
|
|
10057
|
+
components2.forEach((comp) => {
|
|
10058
|
+
if (comp.type === "TEXT") {
|
|
10059
|
+
if (comp.variant === "HEADING_1" && !title2) {
|
|
10060
|
+
title2 = comp.label;
|
|
10061
|
+
} else if ((comp.variant === "HEADING_2" || comp.variant === "SUBTITLE_1") && !subtitle2) {
|
|
10062
|
+
subtitle2 = comp.label;
|
|
10063
|
+
}
|
|
10064
|
+
}
|
|
10065
|
+
});
|
|
10066
|
+
return { title: title2, subtitle: subtitle2 };
|
|
10067
|
+
}, []);
|
|
10068
|
+
const filterHeadings = useCallback13((components2) => {
|
|
10069
|
+
return components2.filter(
|
|
10070
|
+
(comp) => !(comp.type === "TEXT" && (comp.variant === "HEADING_1" || comp.variant === "HEADING_2"))
|
|
10071
|
+
);
|
|
10072
|
+
}, []);
|
|
10073
|
+
const renderComponents = useCallback13(
|
|
10074
|
+
(components2) => renderInviteUserComponents(components2, formValues, touchedFields, formErrors, isLoading, isFormValid, handleInputChange, {
|
|
10075
|
+
onInputBlur: handleInputBlur,
|
|
10076
|
+
onSubmit: handleSubmit,
|
|
10077
|
+
size,
|
|
10078
|
+
variant
|
|
10079
|
+
}),
|
|
10080
|
+
[formValues, touchedFields, formErrors, isLoading, isFormValid, handleInputChange, handleInputBlur, handleSubmit, size, variant]
|
|
10081
|
+
);
|
|
10082
|
+
const components = currentFlow?.data?.components || currentFlow?.data?.meta?.components || [];
|
|
10083
|
+
const { title, subtitle } = extractHeadings(components);
|
|
10084
|
+
const componentsWithoutHeadings = filterHeadings(components);
|
|
10085
|
+
const isInviteGenerated = !!inviteLink;
|
|
10086
|
+
const renderProps = {
|
|
10087
|
+
values: formValues,
|
|
10088
|
+
fieldErrors: formErrors,
|
|
10089
|
+
error: apiError,
|
|
10090
|
+
touched: touchedFields,
|
|
10091
|
+
isLoading,
|
|
10092
|
+
components,
|
|
10093
|
+
inviteLink,
|
|
10094
|
+
flowId: currentFlow?.flowId,
|
|
10095
|
+
handleInputChange,
|
|
10096
|
+
handleInputBlur,
|
|
10097
|
+
handleSubmit,
|
|
10098
|
+
isInviteGenerated,
|
|
10099
|
+
title,
|
|
10100
|
+
subtitle,
|
|
10101
|
+
isValid: isFormValid,
|
|
10102
|
+
copyInviteLink,
|
|
10103
|
+
inviteLinkCopied,
|
|
10104
|
+
resetFlow
|
|
10105
|
+
};
|
|
10106
|
+
if (children) {
|
|
10107
|
+
return /* @__PURE__ */ jsx73("div", { className, children: children(renderProps) });
|
|
10108
|
+
}
|
|
10109
|
+
if (!isInitialized) {
|
|
10110
|
+
return /* @__PURE__ */ jsx73(Card_default, { className: cx23(className, styles.card), variant, children: /* @__PURE__ */ jsx73(Card_default.Content, { children: /* @__PURE__ */ jsx73("div", { style: { display: "flex", justifyContent: "center", padding: "2rem" }, children: /* @__PURE__ */ jsx73(Spinner_default, { size: "medium" }) }) }) });
|
|
10111
|
+
}
|
|
10112
|
+
if (!isFlowInitialized && isLoading) {
|
|
10113
|
+
return /* @__PURE__ */ jsx73(Card_default, { className: cx23(className, styles.card), variant, children: /* @__PURE__ */ jsx73(Card_default.Content, { children: /* @__PURE__ */ jsx73("div", { style: { display: "flex", justifyContent: "center", padding: "2rem" }, children: /* @__PURE__ */ jsx73(Spinner_default, { size: "medium" }) }) }) });
|
|
10114
|
+
}
|
|
10115
|
+
if (!currentFlow && apiError) {
|
|
10116
|
+
return /* @__PURE__ */ jsx73(Card_default, { className: cx23(className, styles.card), variant, children: /* @__PURE__ */ jsx73(Card_default.Content, { children: /* @__PURE__ */ jsxs30(Alert_default, { variant: "error", children: [
|
|
10117
|
+
/* @__PURE__ */ jsx73(Alert_default.Title, { children: "Error" }),
|
|
10118
|
+
/* @__PURE__ */ jsx73(Alert_default.Description, { children: apiError.message })
|
|
10119
|
+
] }) }) });
|
|
10120
|
+
}
|
|
10121
|
+
if (isInviteGenerated && inviteLink) {
|
|
10122
|
+
return /* @__PURE__ */ jsxs30(Card_default, { className: cx23(className, styles.card), variant, children: [
|
|
10123
|
+
/* @__PURE__ */ jsx73(Card_default.Header, { className: styles.header, children: /* @__PURE__ */ jsx73(Card_default.Title, { level: 2, className: styles.title, children: "Invite Link Generated!" }) }),
|
|
10124
|
+
/* @__PURE__ */ jsxs30(Card_default.Content, { children: [
|
|
10125
|
+
/* @__PURE__ */ jsx73(Alert_default, { variant: "success", children: /* @__PURE__ */ jsx73(Alert_default.Description, { children: "Share this link with the user to complete their registration." }) }),
|
|
10126
|
+
/* @__PURE__ */ jsxs30("div", { style: { marginTop: "1rem" }, children: [
|
|
10127
|
+
/* @__PURE__ */ jsx73(Typography_default, { variant: "body2", style: { marginBottom: "0.5rem" }, children: "Invite Link" }),
|
|
10128
|
+
/* @__PURE__ */ jsxs30(
|
|
10129
|
+
"div",
|
|
10130
|
+
{
|
|
10131
|
+
style: {
|
|
10132
|
+
display: "flex",
|
|
10133
|
+
alignItems: "center",
|
|
10134
|
+
gap: "0.5rem",
|
|
10135
|
+
padding: "0.75rem",
|
|
10136
|
+
backgroundColor: "var(--asgardeo-color-background-secondary, #f5f5f5)",
|
|
10137
|
+
borderRadius: "4px",
|
|
10138
|
+
wordBreak: "break-all"
|
|
10139
|
+
},
|
|
10140
|
+
children: [
|
|
10141
|
+
/* @__PURE__ */ jsx73(Typography_default, { variant: "body2", style: { flex: 1 }, children: inviteLink }),
|
|
10142
|
+
/* @__PURE__ */ jsx73(Button_default, { variant: "outline", size: "small", onClick: copyInviteLink, children: inviteLinkCopied ? "Copied!" : "Copy" })
|
|
10143
|
+
]
|
|
10144
|
+
}
|
|
10145
|
+
)
|
|
10146
|
+
] }),
|
|
10147
|
+
/* @__PURE__ */ jsx73("div", { style: { marginTop: "1.5rem", display: "flex", gap: "0.5rem" }, children: /* @__PURE__ */ jsx73(Button_default, { variant: "outline", onClick: resetFlow, children: "Invite Another User" }) })
|
|
10148
|
+
] })
|
|
10149
|
+
] });
|
|
10150
|
+
}
|
|
10151
|
+
return /* @__PURE__ */ jsxs30(Card_default, { className: cx23(className, styles.card), variant, children: [
|
|
10152
|
+
(showTitle || showSubtitle) && (title || subtitle) && /* @__PURE__ */ jsxs30(Card_default.Header, { className: styles.header, children: [
|
|
10153
|
+
showTitle && title && /* @__PURE__ */ jsx73(Card_default.Title, { level: 2, className: styles.title, children: title }),
|
|
10154
|
+
showSubtitle && subtitle && /* @__PURE__ */ jsx73(Typography_default, { variant: "body1", className: styles.subtitle, children: subtitle })
|
|
10155
|
+
] }),
|
|
10156
|
+
/* @__PURE__ */ jsxs30(Card_default.Content, { children: [
|
|
10157
|
+
apiError && /* @__PURE__ */ jsx73("div", { style: { marginBottom: "1rem" }, children: /* @__PURE__ */ jsx73(Alert_default, { variant: "error", children: /* @__PURE__ */ jsx73(Alert_default.Description, { children: apiError.message }) }) }),
|
|
10158
|
+
/* @__PURE__ */ jsxs30("div", { children: [
|
|
10159
|
+
componentsWithoutHeadings && componentsWithoutHeadings.length > 0 ? renderComponents(componentsWithoutHeadings) : !isLoading && /* @__PURE__ */ jsx73(Alert_default, { variant: "warning", children: /* @__PURE__ */ jsx73(Typography_default, { variant: "body1", children: "No form components available" }) }),
|
|
10160
|
+
isLoading && /* @__PURE__ */ jsx73("div", { style: { display: "flex", justifyContent: "center", padding: "1rem" }, children: /* @__PURE__ */ jsx73(Spinner_default, { size: "small" }) })
|
|
10161
|
+
] })
|
|
10162
|
+
] })
|
|
10163
|
+
] });
|
|
10164
|
+
};
|
|
10165
|
+
var BaseInviteUser_default = BaseInviteUser;
|
|
10166
|
+
|
|
10167
|
+
// src/components/presentation/auth/InviteUser/v2/InviteUser.tsx
|
|
10168
|
+
import { jsx as jsx74 } from "react/jsx-runtime";
|
|
10169
|
+
var InviteUser = ({
|
|
10170
|
+
onInviteLinkGenerated,
|
|
10171
|
+
onError,
|
|
10172
|
+
onFlowChange,
|
|
10173
|
+
className,
|
|
10174
|
+
children,
|
|
10175
|
+
size = "medium",
|
|
10176
|
+
variant = "outlined",
|
|
10177
|
+
showTitle = true,
|
|
10178
|
+
showSubtitle = true
|
|
10179
|
+
}) => {
|
|
10180
|
+
const { http: http2, baseUrl, isInitialized } = useAsgardeo_default();
|
|
10181
|
+
const handleInitialize = async (payload) => {
|
|
10182
|
+
const response = await http2.request({
|
|
10183
|
+
url: `${baseUrl}/flow/execute`,
|
|
10184
|
+
method: "POST",
|
|
10185
|
+
headers: {
|
|
10186
|
+
"Content-Type": "application/json",
|
|
10187
|
+
Accept: "application/json"
|
|
10188
|
+
},
|
|
10189
|
+
data: {
|
|
10190
|
+
...payload,
|
|
10191
|
+
flowType: EmbeddedFlowType5.UserOnboarding,
|
|
10192
|
+
verbose: true
|
|
10193
|
+
}
|
|
10194
|
+
});
|
|
10195
|
+
return response.data;
|
|
10196
|
+
};
|
|
10197
|
+
const handleSubmit = async (payload) => {
|
|
10198
|
+
const response = await http2.request({
|
|
10199
|
+
url: `${baseUrl}/flow/execute`,
|
|
10200
|
+
method: "POST",
|
|
10201
|
+
headers: {
|
|
10202
|
+
"Content-Type": "application/json",
|
|
10203
|
+
Accept: "application/json"
|
|
10204
|
+
},
|
|
10205
|
+
data: {
|
|
10206
|
+
...payload,
|
|
10207
|
+
verbose: true
|
|
10208
|
+
}
|
|
10209
|
+
});
|
|
10210
|
+
return response.data;
|
|
10211
|
+
};
|
|
10212
|
+
return /* @__PURE__ */ jsx74(
|
|
10213
|
+
BaseInviteUser_default,
|
|
10214
|
+
{
|
|
10215
|
+
onInitialize: handleInitialize,
|
|
10216
|
+
onSubmit: handleSubmit,
|
|
10217
|
+
onInviteLinkGenerated,
|
|
10218
|
+
onError,
|
|
10219
|
+
onFlowChange,
|
|
10220
|
+
className,
|
|
10221
|
+
isInitialized,
|
|
10222
|
+
size,
|
|
10223
|
+
variant,
|
|
10224
|
+
showTitle,
|
|
10225
|
+
showSubtitle,
|
|
10226
|
+
children
|
|
10227
|
+
}
|
|
10228
|
+
);
|
|
10229
|
+
};
|
|
10230
|
+
var InviteUser_default = InviteUser;
|
|
10231
|
+
|
|
10232
|
+
// src/components/presentation/auth/AcceptInvite/v2/AcceptInvite.tsx
|
|
10233
|
+
import { useMemo as useMemo27 } from "react";
|
|
10234
|
+
|
|
10235
|
+
// src/components/presentation/auth/AcceptInvite/v2/BaseAcceptInvite.tsx
|
|
10236
|
+
import { useCallback as useCallback14, useEffect as useEffect17, useRef as useRef8, useState as useState20 } from "react";
|
|
10237
|
+
import { cx as cx24 } from "@emotion/css";
|
|
10238
|
+
|
|
10239
|
+
// src/components/presentation/auth/AcceptInvite/v2/BaseAcceptInvite.styles.ts
|
|
10240
|
+
import { css as css19 } from "@emotion/css";
|
|
10241
|
+
import { useMemo as useMemo26 } from "react";
|
|
10242
|
+
var useStyles19 = (theme, colorScheme) => {
|
|
10243
|
+
return useMemo26(() => {
|
|
10244
|
+
const card = css19`
|
|
10245
|
+
background: ${theme.vars.colors.background.surface};
|
|
10246
|
+
border-radius: ${theme.vars.borderRadius.large};
|
|
10247
|
+
gap: calc(${theme.vars.spacing.unit} * 2);
|
|
10248
|
+
min-width: 420px;
|
|
10249
|
+
`;
|
|
10250
|
+
const header = css19`
|
|
10251
|
+
gap: 0;
|
|
10252
|
+
align-items: center;
|
|
10253
|
+
`;
|
|
10254
|
+
const title = css19`
|
|
10255
|
+
margin: 0 0 calc(${theme.vars.spacing.unit} * 1) 0;
|
|
10256
|
+
color: ${theme.vars.colors.text.primary};
|
|
10257
|
+
`;
|
|
10258
|
+
const subtitle = css19`
|
|
10259
|
+
margin-bottom: calc(${theme.vars.spacing.unit} * 1);
|
|
10260
|
+
color: ${theme.vars.colors.text.secondary};
|
|
10261
|
+
`;
|
|
10262
|
+
return {
|
|
10263
|
+
card,
|
|
10264
|
+
header,
|
|
10265
|
+
title,
|
|
10266
|
+
subtitle
|
|
10267
|
+
};
|
|
10268
|
+
}, [
|
|
10269
|
+
theme.vars.colors.background.surface,
|
|
10270
|
+
theme.vars.colors.text.primary,
|
|
10271
|
+
theme.vars.colors.text.secondary,
|
|
10272
|
+
theme.vars.borderRadius.large,
|
|
10273
|
+
theme.vars.spacing.unit,
|
|
10274
|
+
colorScheme
|
|
10275
|
+
]);
|
|
10276
|
+
};
|
|
10277
|
+
var BaseAcceptInvite_styles_default = useStyles19;
|
|
10278
|
+
|
|
10279
|
+
// src/components/presentation/auth/AcceptInvite/v2/BaseAcceptInvite.tsx
|
|
10280
|
+
import { jsx as jsx75, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
10281
|
+
var BaseAcceptInvite = ({
|
|
10282
|
+
flowId,
|
|
10283
|
+
inviteToken,
|
|
10284
|
+
onSubmit,
|
|
10285
|
+
onComplete,
|
|
10286
|
+
onError,
|
|
10287
|
+
onFlowChange,
|
|
10288
|
+
onGoToSignIn,
|
|
10289
|
+
className = "",
|
|
10290
|
+
children,
|
|
10291
|
+
size = "medium",
|
|
10292
|
+
variant = "outlined",
|
|
10293
|
+
showTitle = true,
|
|
10294
|
+
showSubtitle = true
|
|
10295
|
+
}) => {
|
|
10296
|
+
const { t } = useTranslation_default();
|
|
10297
|
+
const { theme } = useTheme_default();
|
|
10298
|
+
const styles = BaseAcceptInvite_styles_default(theme, theme.vars.colors.text.primary);
|
|
10299
|
+
const [isLoading, setIsLoading] = useState20(false);
|
|
10300
|
+
const [isValidatingToken, setIsValidatingToken] = useState20(true);
|
|
10301
|
+
const [isTokenInvalid, setIsTokenInvalid] = useState20(false);
|
|
10302
|
+
const [isComplete, setIsComplete] = useState20(false);
|
|
10303
|
+
const [currentFlow, setCurrentFlow] = useState20(null);
|
|
10304
|
+
const [apiError, setApiError] = useState20(null);
|
|
10305
|
+
const [formValues, setFormValues] = useState20({});
|
|
10306
|
+
const [formErrors, setFormErrors] = useState20({});
|
|
10307
|
+
const [touchedFields, setTouchedFields] = useState20({});
|
|
10308
|
+
const [isFormValid, setIsFormValid] = useState20(true);
|
|
10309
|
+
const [completionTitle, setCompletionTitle] = useState20(void 0);
|
|
10310
|
+
const tokenValidationAttemptedRef = useRef8(false);
|
|
10311
|
+
const handleError = useCallback14(
|
|
10312
|
+
(error) => {
|
|
10313
|
+
const errorMessage = error?.failureReason || extractErrorMessage(error, t, "components.acceptInvite.errors.generic");
|
|
10314
|
+
setApiError(error instanceof Error ? error : new Error(errorMessage));
|
|
10315
|
+
onError?.(error instanceof Error ? error : new Error(errorMessage));
|
|
10316
|
+
},
|
|
10317
|
+
[t, onError]
|
|
10318
|
+
);
|
|
10319
|
+
const normalizeFlowResponseLocal = useCallback14(
|
|
10320
|
+
(response) => {
|
|
10321
|
+
if (!response?.data?.meta?.components) {
|
|
10322
|
+
return response;
|
|
10323
|
+
}
|
|
10324
|
+
try {
|
|
10325
|
+
const { components: components2 } = normalizeFlowResponse(response, t, {
|
|
10326
|
+
defaultErrorKey: "components.acceptInvite.errors.generic",
|
|
10327
|
+
resolveTranslations: !children
|
|
10328
|
+
});
|
|
10329
|
+
return {
|
|
10330
|
+
...response,
|
|
10331
|
+
data: {
|
|
10332
|
+
...response.data,
|
|
10333
|
+
components: components2
|
|
10334
|
+
}
|
|
10335
|
+
};
|
|
10336
|
+
} catch {
|
|
10337
|
+
return response;
|
|
10338
|
+
}
|
|
10339
|
+
},
|
|
10340
|
+
[t, children]
|
|
10341
|
+
);
|
|
10342
|
+
const handleInputChange = useCallback14((name, value) => {
|
|
10343
|
+
setFormValues((prev) => ({ ...prev, [name]: value }));
|
|
10344
|
+
setFormErrors((prev) => {
|
|
10345
|
+
const newErrors = { ...prev };
|
|
10346
|
+
delete newErrors[name];
|
|
10347
|
+
return newErrors;
|
|
10348
|
+
});
|
|
10349
|
+
}, []);
|
|
10350
|
+
const handleInputBlur = useCallback14((name) => {
|
|
10351
|
+
setTouchedFields((prev) => ({ ...prev, [name]: true }));
|
|
10352
|
+
}, []);
|
|
10353
|
+
const validateForm = useCallback14(
|
|
10354
|
+
(components2) => {
|
|
10355
|
+
const errors = {};
|
|
10356
|
+
const validateComponents = (comps) => {
|
|
10357
|
+
comps.forEach((comp) => {
|
|
10358
|
+
if ((comp.type === "PASSWORD_INPUT" || comp.type === "TEXT_INPUT" || comp.type === "EMAIL_INPUT") && comp.required && comp.ref) {
|
|
10359
|
+
const value = formValues[comp.ref];
|
|
10360
|
+
if (!value || value.trim() === "") {
|
|
10361
|
+
errors[comp.ref] = `${comp.label || comp.ref} is required`;
|
|
10362
|
+
}
|
|
10363
|
+
}
|
|
10364
|
+
if (comp.components && Array.isArray(comp.components)) {
|
|
10365
|
+
validateComponents(comp.components);
|
|
10366
|
+
}
|
|
10367
|
+
});
|
|
10368
|
+
};
|
|
10369
|
+
validateComponents(components2);
|
|
10370
|
+
return { isValid: Object.keys(errors).length === 0, errors };
|
|
10371
|
+
},
|
|
10372
|
+
[formValues]
|
|
10373
|
+
);
|
|
10374
|
+
const handleSubmit = useCallback14(
|
|
10375
|
+
async (component, data) => {
|
|
10376
|
+
if (!currentFlow) {
|
|
10377
|
+
return;
|
|
10378
|
+
}
|
|
10379
|
+
const components2 = currentFlow.data?.components || [];
|
|
10380
|
+
const validation = validateForm(components2);
|
|
10381
|
+
if (!validation.isValid) {
|
|
10382
|
+
setFormErrors(validation.errors);
|
|
10383
|
+
setIsFormValid(false);
|
|
10384
|
+
const touched = {};
|
|
10385
|
+
Object.keys(validation.errors).forEach((key) => {
|
|
10386
|
+
touched[key] = true;
|
|
10387
|
+
});
|
|
10388
|
+
setTouchedFields((prev) => ({ ...prev, ...touched }));
|
|
10389
|
+
return;
|
|
10390
|
+
}
|
|
10391
|
+
setIsLoading(true);
|
|
10392
|
+
setApiError(null);
|
|
10393
|
+
setIsFormValid(true);
|
|
10394
|
+
try {
|
|
10395
|
+
const inputs = data || formValues;
|
|
10396
|
+
const payload = {
|
|
10397
|
+
flowId: currentFlow.flowId,
|
|
10398
|
+
inputs,
|
|
10399
|
+
verbose: true
|
|
10400
|
+
};
|
|
10401
|
+
if (component?.id) {
|
|
10402
|
+
payload["action"] = component.id;
|
|
10403
|
+
}
|
|
10404
|
+
const rawResponse = await onSubmit(payload);
|
|
10405
|
+
const response = normalizeFlowResponseLocal(rawResponse);
|
|
10406
|
+
onFlowChange?.(response);
|
|
10407
|
+
if (currentFlow?.data?.components || currentFlow?.data?.meta?.components) {
|
|
10408
|
+
const currentComponents = currentFlow.data.components || currentFlow.data.meta?.components || [];
|
|
10409
|
+
const heading = currentComponents.find(
|
|
10410
|
+
(comp) => comp.type === "TEXT" && comp.variant === "HEADING_1"
|
|
10411
|
+
);
|
|
10412
|
+
if (heading?.label) {
|
|
10413
|
+
setCompletionTitle(heading.label);
|
|
10414
|
+
}
|
|
10415
|
+
}
|
|
10416
|
+
if (response.flowStatus === "COMPLETE") {
|
|
10417
|
+
setIsComplete(true);
|
|
10418
|
+
onComplete?.();
|
|
10419
|
+
return;
|
|
10420
|
+
}
|
|
10421
|
+
if (response.flowStatus === "ERROR") {
|
|
10422
|
+
handleError(response);
|
|
10423
|
+
return;
|
|
10424
|
+
}
|
|
10425
|
+
setCurrentFlow(response);
|
|
10426
|
+
setFormValues({});
|
|
10427
|
+
setFormErrors({});
|
|
10428
|
+
setTouchedFields({});
|
|
10429
|
+
} catch (err) {
|
|
10430
|
+
handleError(err);
|
|
10431
|
+
} finally {
|
|
10432
|
+
setIsLoading(false);
|
|
10433
|
+
}
|
|
10434
|
+
},
|
|
10435
|
+
[currentFlow, formValues, validateForm, onSubmit, onFlowChange, onComplete, handleError, normalizeFlowResponseLocal]
|
|
10436
|
+
);
|
|
10437
|
+
useEffect17(() => {
|
|
10438
|
+
if (!flowId || !inviteToken || tokenValidationAttemptedRef.current) {
|
|
10439
|
+
if (!flowId || !inviteToken) {
|
|
10440
|
+
setIsValidatingToken(false);
|
|
10441
|
+
setIsTokenInvalid(true);
|
|
10442
|
+
handleError(new Error("Invalid invite link. Missing flowId or inviteToken."));
|
|
10443
|
+
}
|
|
10444
|
+
return;
|
|
10445
|
+
}
|
|
10446
|
+
tokenValidationAttemptedRef.current = true;
|
|
10447
|
+
(async () => {
|
|
10448
|
+
setIsValidatingToken(true);
|
|
10449
|
+
setApiError(null);
|
|
10450
|
+
try {
|
|
10451
|
+
const payload = {
|
|
10452
|
+
flowId,
|
|
10453
|
+
inputs: {
|
|
10454
|
+
inviteToken
|
|
10455
|
+
},
|
|
10456
|
+
verbose: true
|
|
10457
|
+
};
|
|
10458
|
+
const rawResponse = await onSubmit(payload);
|
|
10459
|
+
const response = normalizeFlowResponseLocal(rawResponse);
|
|
10460
|
+
onFlowChange?.(response);
|
|
10461
|
+
if (response.flowStatus === "ERROR") {
|
|
10462
|
+
setIsTokenInvalid(true);
|
|
10463
|
+
handleError(response);
|
|
10464
|
+
return;
|
|
10465
|
+
}
|
|
10466
|
+
setCurrentFlow(response);
|
|
10467
|
+
} catch (err) {
|
|
10468
|
+
setIsTokenInvalid(true);
|
|
10469
|
+
handleError(err);
|
|
10470
|
+
} finally {
|
|
10471
|
+
setIsValidatingToken(false);
|
|
10472
|
+
}
|
|
10473
|
+
})();
|
|
10474
|
+
}, [flowId, inviteToken, onSubmit, onFlowChange, handleError, normalizeFlowResponseLocal]);
|
|
10475
|
+
const extractHeadings = useCallback14((components2) => {
|
|
10476
|
+
let title2;
|
|
10477
|
+
let subtitle2;
|
|
10478
|
+
components2.forEach((comp) => {
|
|
10479
|
+
if (comp.type === "TEXT") {
|
|
10480
|
+
if (comp.variant === "HEADING_1" && !title2) {
|
|
10481
|
+
title2 = comp.label;
|
|
10482
|
+
} else if ((comp.variant === "HEADING_2" || comp.variant === "SUBTITLE_1") && !subtitle2) {
|
|
10483
|
+
subtitle2 = comp.label;
|
|
10484
|
+
}
|
|
10485
|
+
}
|
|
10486
|
+
});
|
|
10487
|
+
return { title: title2, subtitle: subtitle2 };
|
|
10488
|
+
}, []);
|
|
10489
|
+
const filterHeadings = useCallback14((components2) => {
|
|
10490
|
+
return components2.filter(
|
|
10491
|
+
(comp) => !(comp.type === "TEXT" && (comp.variant === "HEADING_1" || comp.variant === "HEADING_2"))
|
|
10492
|
+
);
|
|
10493
|
+
}, []);
|
|
10494
|
+
const renderComponents = useCallback14(
|
|
10495
|
+
(components2) => renderInviteUserComponents(components2, formValues, touchedFields, formErrors, isLoading, isFormValid, handleInputChange, {
|
|
10496
|
+
onInputBlur: handleInputBlur,
|
|
10497
|
+
onSubmit: handleSubmit,
|
|
10498
|
+
size,
|
|
10499
|
+
variant
|
|
10500
|
+
}),
|
|
10501
|
+
[formValues, touchedFields, formErrors, isLoading, isFormValid, handleInputChange, handleInputBlur, handleSubmit, size, variant]
|
|
9702
10502
|
);
|
|
10503
|
+
const components = currentFlow?.data?.components || currentFlow?.data?.meta?.components || [];
|
|
10504
|
+
const { title, subtitle } = extractHeadings(components);
|
|
10505
|
+
const componentsWithoutHeadings = filterHeadings(components);
|
|
10506
|
+
const renderProps = {
|
|
10507
|
+
values: formValues,
|
|
10508
|
+
fieldErrors: formErrors,
|
|
10509
|
+
error: apiError,
|
|
10510
|
+
touched: touchedFields,
|
|
10511
|
+
isLoading,
|
|
10512
|
+
components,
|
|
10513
|
+
flowId,
|
|
10514
|
+
inviteToken,
|
|
10515
|
+
handleInputChange,
|
|
10516
|
+
handleInputBlur,
|
|
10517
|
+
handleSubmit,
|
|
10518
|
+
isComplete,
|
|
10519
|
+
isValidatingToken,
|
|
10520
|
+
isTokenInvalid,
|
|
10521
|
+
title,
|
|
10522
|
+
subtitle,
|
|
10523
|
+
isValid: isFormValid,
|
|
10524
|
+
goToSignIn: onGoToSignIn,
|
|
10525
|
+
completionTitle
|
|
10526
|
+
};
|
|
10527
|
+
if (children) {
|
|
10528
|
+
return /* @__PURE__ */ jsx75("div", { className, children: children(renderProps) });
|
|
10529
|
+
}
|
|
10530
|
+
if (isValidatingToken) {
|
|
10531
|
+
return /* @__PURE__ */ jsx75(Card_default, { className: cx24(className, styles.card), variant, children: /* @__PURE__ */ jsx75(Card_default.Content, { children: /* @__PURE__ */ jsxs31("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", padding: "2rem", gap: "1rem" }, children: [
|
|
10532
|
+
/* @__PURE__ */ jsx75(Spinner_default, { size: "medium" }),
|
|
10533
|
+
/* @__PURE__ */ jsx75(Typography_default, { variant: "body1", children: "Validating your invite link..." })
|
|
10534
|
+
] }) }) });
|
|
10535
|
+
}
|
|
10536
|
+
if (isTokenInvalid) {
|
|
10537
|
+
return /* @__PURE__ */ jsxs31(Card_default, { className: cx24(className, styles.card), variant, children: [
|
|
10538
|
+
/* @__PURE__ */ jsx75(Card_default.Header, { className: styles.header, children: /* @__PURE__ */ jsx75(Card_default.Title, { level: 2, className: styles.title, children: "Invalid Invite Link" }) }),
|
|
10539
|
+
/* @__PURE__ */ jsxs31(Card_default.Content, { children: [
|
|
10540
|
+
/* @__PURE__ */ jsxs31(Alert_default, { variant: "error", children: [
|
|
10541
|
+
/* @__PURE__ */ jsx75(Alert_default.Title, { children: "Unable to verify invite" }),
|
|
10542
|
+
/* @__PURE__ */ jsx75(Alert_default.Description, { children: apiError?.message || "This invite link is invalid or has expired. Please contact your administrator for a new invite." })
|
|
10543
|
+
] }),
|
|
10544
|
+
onGoToSignIn && /* @__PURE__ */ jsx75("div", { style: { marginTop: "1.5rem", display: "flex", justifyContent: "center" }, children: /* @__PURE__ */ jsx75(Button_default, { variant: "outline", onClick: onGoToSignIn, children: "Go to Sign In" }) })
|
|
10545
|
+
] })
|
|
10546
|
+
] });
|
|
10547
|
+
}
|
|
10548
|
+
if (isComplete) {
|
|
10549
|
+
return /* @__PURE__ */ jsxs31(Card_default, { className: cx24(className, styles.card), variant, children: [
|
|
10550
|
+
/* @__PURE__ */ jsx75(Card_default.Header, { className: styles.header, children: /* @__PURE__ */ jsx75(Card_default.Title, { level: 2, className: styles.title, children: "Account Setup Complete!" }) }),
|
|
10551
|
+
/* @__PURE__ */ jsxs31(Card_default.Content, { children: [
|
|
10552
|
+
/* @__PURE__ */ jsx75(Alert_default, { variant: "success", children: /* @__PURE__ */ jsx75(Alert_default.Description, { children: "Your account has been successfully set up. You can now sign in with your credentials." }) }),
|
|
10553
|
+
onGoToSignIn && /* @__PURE__ */ jsx75("div", { style: { marginTop: "1.5rem", display: "flex", justifyContent: "center" }, children: /* @__PURE__ */ jsx75(Button_default, { variant: "solid", color: "primary", onClick: onGoToSignIn, children: "Sign In" }) })
|
|
10554
|
+
] })
|
|
10555
|
+
] });
|
|
10556
|
+
}
|
|
10557
|
+
return /* @__PURE__ */ jsxs31(Card_default, { className: cx24(className, styles.card), variant, children: [
|
|
10558
|
+
(showTitle || showSubtitle) && (title || subtitle) && /* @__PURE__ */ jsxs31(Card_default.Header, { className: styles.header, children: [
|
|
10559
|
+
showTitle && title && /* @__PURE__ */ jsx75(Card_default.Title, { level: 2, className: styles.title, children: title }),
|
|
10560
|
+
showSubtitle && subtitle && /* @__PURE__ */ jsx75(Typography_default, { variant: "body1", className: styles.subtitle, children: subtitle })
|
|
10561
|
+
] }),
|
|
10562
|
+
/* @__PURE__ */ jsxs31(Card_default.Content, { children: [
|
|
10563
|
+
apiError && /* @__PURE__ */ jsx75("div", { style: { marginBottom: "1rem" }, children: /* @__PURE__ */ jsx75(Alert_default, { variant: "error", children: /* @__PURE__ */ jsx75(Alert_default.Description, { children: apiError.message }) }) }),
|
|
10564
|
+
/* @__PURE__ */ jsxs31("div", { children: [
|
|
10565
|
+
componentsWithoutHeadings && componentsWithoutHeadings.length > 0 ? renderComponents(componentsWithoutHeadings) : !isLoading && /* @__PURE__ */ jsx75(Alert_default, { variant: "warning", children: /* @__PURE__ */ jsx75(Typography_default, { variant: "body1", children: "No form components available" }) }),
|
|
10566
|
+
isLoading && /* @__PURE__ */ jsx75("div", { style: { display: "flex", justifyContent: "center", padding: "1rem" }, children: /* @__PURE__ */ jsx75(Spinner_default, { size: "small" }) })
|
|
10567
|
+
] }),
|
|
10568
|
+
onGoToSignIn && /* @__PURE__ */ jsx75("div", { style: { marginTop: "1.5rem", textAlign: "center" }, children: /* @__PURE__ */ jsxs31(Typography_default, { variant: "body2", children: [
|
|
10569
|
+
"Already have an account?",
|
|
10570
|
+
" ",
|
|
10571
|
+
/* @__PURE__ */ jsx75(
|
|
10572
|
+
Button_default,
|
|
10573
|
+
{
|
|
10574
|
+
variant: "text",
|
|
10575
|
+
onClick: onGoToSignIn,
|
|
10576
|
+
style: { padding: 0, minWidth: "auto" },
|
|
10577
|
+
children: "Sign In"
|
|
10578
|
+
}
|
|
10579
|
+
)
|
|
10580
|
+
] }) })
|
|
10581
|
+
] })
|
|
10582
|
+
] });
|
|
9703
10583
|
};
|
|
9704
|
-
var
|
|
10584
|
+
var BaseAcceptInvite_default = BaseAcceptInvite;
|
|
9705
10585
|
|
|
9706
|
-
// src/components/presentation/auth/
|
|
9707
|
-
import {
|
|
9708
|
-
|
|
9709
|
-
|
|
9710
|
-
}
|
|
9711
|
-
|
|
9712
|
-
|
|
9713
|
-
|
|
9714
|
-
|
|
9715
|
-
|
|
9716
|
-
|
|
10586
|
+
// src/components/presentation/auth/AcceptInvite/v2/AcceptInvite.tsx
|
|
10587
|
+
import { jsx as jsx76 } from "react/jsx-runtime";
|
|
10588
|
+
var getUrlParams = () => {
|
|
10589
|
+
if (typeof window === "undefined") {
|
|
10590
|
+
return {};
|
|
10591
|
+
}
|
|
10592
|
+
const params = new URLSearchParams(window.location.search);
|
|
10593
|
+
return {
|
|
10594
|
+
flowId: params.get("flowId") || void 0,
|
|
10595
|
+
inviteToken: params.get("inviteToken") || void 0
|
|
10596
|
+
};
|
|
10597
|
+
};
|
|
10598
|
+
var AcceptInvite = ({
|
|
10599
|
+
baseUrl,
|
|
10600
|
+
flowId: flowIdProp,
|
|
10601
|
+
inviteToken: inviteTokenProp,
|
|
9717
10602
|
onComplete,
|
|
9718
|
-
|
|
10603
|
+
onError,
|
|
10604
|
+
onFlowChange,
|
|
10605
|
+
onGoToSignIn,
|
|
10606
|
+
className,
|
|
9719
10607
|
children,
|
|
9720
|
-
|
|
10608
|
+
size = "medium",
|
|
10609
|
+
variant = "outlined",
|
|
10610
|
+
showTitle = true,
|
|
10611
|
+
showSubtitle = true
|
|
9721
10612
|
}) => {
|
|
9722
|
-
const {
|
|
9723
|
-
const
|
|
9724
|
-
|
|
9725
|
-
|
|
9726
|
-
|
|
9727
|
-
|
|
9728
|
-
flowType: EmbeddedFlowType3.Registration,
|
|
9729
|
-
...effectiveApplicationId && { applicationId: effectiveApplicationId }
|
|
9730
|
-
};
|
|
9731
|
-
return await signUp(initialPayload);
|
|
9732
|
-
};
|
|
9733
|
-
const handleOnSubmit = async (payload) => await signUp(payload);
|
|
9734
|
-
const handleComplete = (response) => {
|
|
9735
|
-
onComplete?.(response);
|
|
9736
|
-
if (shouldRedirectAfterSignUp && response?.type !== EmbeddedFlowResponseType4.Redirection && afterSignUpUrl) {
|
|
9737
|
-
window.location.href = afterSignUpUrl;
|
|
10613
|
+
const { flowId: urlFlowId, inviteToken: urlInviteToken } = useMemo27(() => getUrlParams(), []);
|
|
10614
|
+
const flowId = flowIdProp || urlFlowId;
|
|
10615
|
+
const inviteToken = inviteTokenProp || urlInviteToken;
|
|
10616
|
+
const apiBaseUrl = useMemo27(() => {
|
|
10617
|
+
if (baseUrl) {
|
|
10618
|
+
return baseUrl;
|
|
9738
10619
|
}
|
|
9739
|
-
if (
|
|
9740
|
-
|
|
9741
|
-
|
|
10620
|
+
if (typeof window !== "undefined") {
|
|
10621
|
+
return window.location.origin;
|
|
10622
|
+
}
|
|
10623
|
+
return "";
|
|
10624
|
+
}, [baseUrl]);
|
|
10625
|
+
const handleSubmit = async (payload) => {
|
|
10626
|
+
const response = await fetch(`${apiBaseUrl}/flow/execute`, {
|
|
10627
|
+
method: "POST",
|
|
10628
|
+
headers: {
|
|
10629
|
+
"Content-Type": "application/json",
|
|
10630
|
+
Accept: "application/json"
|
|
10631
|
+
},
|
|
10632
|
+
body: JSON.stringify({
|
|
10633
|
+
...payload,
|
|
10634
|
+
verbose: true
|
|
10635
|
+
})
|
|
10636
|
+
});
|
|
10637
|
+
if (!response.ok) {
|
|
10638
|
+
const errorText = await response.text();
|
|
10639
|
+
throw new Error(`Request failed: ${errorText}`);
|
|
9742
10640
|
}
|
|
10641
|
+
return response.json();
|
|
9743
10642
|
};
|
|
9744
|
-
return /* @__PURE__ */
|
|
9745
|
-
|
|
10643
|
+
return /* @__PURE__ */ jsx76(
|
|
10644
|
+
BaseAcceptInvite_default,
|
|
9746
10645
|
{
|
|
9747
|
-
|
|
9748
|
-
|
|
9749
|
-
onSubmit:
|
|
10646
|
+
flowId,
|
|
10647
|
+
inviteToken,
|
|
10648
|
+
onSubmit: handleSubmit,
|
|
10649
|
+
onComplete,
|
|
9750
10650
|
onError,
|
|
9751
|
-
|
|
10651
|
+
onFlowChange,
|
|
10652
|
+
onGoToSignIn,
|
|
9752
10653
|
className,
|
|
9753
10654
|
size,
|
|
9754
|
-
|
|
9755
|
-
|
|
9756
|
-
|
|
9757
|
-
|
|
9758
|
-
showSubtitle: true,
|
|
9759
|
-
...rest
|
|
10655
|
+
variant,
|
|
10656
|
+
showTitle,
|
|
10657
|
+
showSubtitle,
|
|
10658
|
+
children
|
|
9760
10659
|
}
|
|
9761
10660
|
);
|
|
9762
10661
|
};
|
|
9763
|
-
var
|
|
9764
|
-
|
|
9765
|
-
// src/components/presentation/auth/SignUp/SignUp.tsx
|
|
9766
|
-
import { jsx as jsx72 } from "react/jsx-runtime";
|
|
9767
|
-
var SignUp3 = (props) => {
|
|
9768
|
-
const { platform } = useAsgardeo_default();
|
|
9769
|
-
if (platform === Platform6.AsgardeoV2) {
|
|
9770
|
-
return /* @__PURE__ */ jsx72(SignUp_default2, { ...props });
|
|
9771
|
-
}
|
|
9772
|
-
return /* @__PURE__ */ jsx72(SignUp_default, { ...props });
|
|
9773
|
-
};
|
|
9774
|
-
var SignUp_default3 = SignUp3;
|
|
10662
|
+
var AcceptInvite_default = AcceptInvite;
|
|
9775
10663
|
|
|
9776
10664
|
// src/components/presentation/User/BaseUser.tsx
|
|
9777
|
-
import { Fragment as Fragment13, jsx as
|
|
10665
|
+
import { Fragment as Fragment13, jsx as jsx77 } from "react/jsx-runtime";
|
|
9778
10666
|
var BaseUser = ({ user, children, fallback = null }) => {
|
|
9779
10667
|
if (!user) {
|
|
9780
|
-
return /* @__PURE__ */
|
|
10668
|
+
return /* @__PURE__ */ jsx77(Fragment13, { children: fallback });
|
|
9781
10669
|
}
|
|
9782
|
-
return /* @__PURE__ */
|
|
10670
|
+
return /* @__PURE__ */ jsx77(Fragment13, { children: children(user) });
|
|
9783
10671
|
};
|
|
9784
10672
|
BaseUser.displayName = "BaseUser";
|
|
9785
10673
|
var BaseUser_default = BaseUser;
|
|
9786
10674
|
|
|
9787
10675
|
// src/components/presentation/User/User.tsx
|
|
9788
|
-
import { jsx as
|
|
10676
|
+
import { jsx as jsx78 } from "react/jsx-runtime";
|
|
9789
10677
|
var User5 = ({ children, fallback = null }) => {
|
|
9790
10678
|
const { user } = useAsgardeo_default();
|
|
9791
|
-
return /* @__PURE__ */
|
|
10679
|
+
return /* @__PURE__ */ jsx78(BaseUser_default, { user, fallback, children });
|
|
9792
10680
|
};
|
|
9793
10681
|
User5.displayName = "User";
|
|
9794
10682
|
var User_default = User5;
|
|
9795
10683
|
|
|
9796
10684
|
// src/components/presentation/Organization/BaseOrganization.tsx
|
|
9797
|
-
import { Fragment as Fragment14, jsx as
|
|
10685
|
+
import { Fragment as Fragment14, jsx as jsx79 } from "react/jsx-runtime";
|
|
9798
10686
|
var BaseOrganization = ({ children, fallback = null, organization }) => {
|
|
9799
10687
|
if (!organization) {
|
|
9800
|
-
return /* @__PURE__ */
|
|
10688
|
+
return /* @__PURE__ */ jsx79(Fragment14, { children: fallback });
|
|
9801
10689
|
}
|
|
9802
|
-
return /* @__PURE__ */
|
|
10690
|
+
return /* @__PURE__ */ jsx79(Fragment14, { children: children(organization) });
|
|
9803
10691
|
};
|
|
9804
10692
|
BaseOrganization.displayName = "BaseOrganization";
|
|
9805
10693
|
var BaseOrganization_default = BaseOrganization;
|
|
9806
10694
|
|
|
9807
10695
|
// src/components/presentation/Organization/Organization.tsx
|
|
9808
|
-
import { jsx as
|
|
10696
|
+
import { jsx as jsx80 } from "react/jsx-runtime";
|
|
9809
10697
|
var Organization5 = ({ children, fallback = null }) => {
|
|
9810
10698
|
const { currentOrganization } = useOrganization_default();
|
|
9811
|
-
return /* @__PURE__ */
|
|
10699
|
+
return /* @__PURE__ */ jsx80(BaseOrganization_default, { organization: currentOrganization, fallback, children });
|
|
9812
10700
|
};
|
|
9813
10701
|
Organization5.displayName = "Organization";
|
|
9814
10702
|
var Organization_default = Organization5;
|
|
9815
10703
|
|
|
9816
10704
|
// src/components/presentation/UserProfile/BaseUserProfile.tsx
|
|
9817
10705
|
import { withVendorCSSClassPrefix as withVendorCSSClassPrefix27, WellKnownSchemaIds, bem as bem19 } from "@asgardeo/browser";
|
|
9818
|
-
import { cx as
|
|
9819
|
-
import { useState as
|
|
10706
|
+
import { cx as cx28 } from "@emotion/css";
|
|
10707
|
+
import { useState as useState22, useCallback as useCallback16 } from "react";
|
|
9820
10708
|
|
|
9821
10709
|
// src/utils/getMappedUserProfileValue.ts
|
|
9822
10710
|
import { get } from "@asgardeo/browser";
|
|
@@ -9843,15 +10731,15 @@ var getMappedUserProfileValue_default = getMappedUserProfileValue;
|
|
|
9843
10731
|
|
|
9844
10732
|
// src/components/primitives/Avatar/Avatar.tsx
|
|
9845
10733
|
import { withVendorCSSClassPrefix as withVendorCSSClassPrefix23, bem as bem16 } from "@asgardeo/browser";
|
|
9846
|
-
import { cx as
|
|
9847
|
-
import { useMemo as
|
|
10734
|
+
import { cx as cx25 } from "@emotion/css";
|
|
10735
|
+
import { useMemo as useMemo29 } from "react";
|
|
9848
10736
|
|
|
9849
10737
|
// src/components/primitives/Avatar/Avatar.styles.ts
|
|
9850
|
-
import { css as
|
|
9851
|
-
import { useMemo as
|
|
9852
|
-
var
|
|
9853
|
-
return
|
|
9854
|
-
const baseAvatar =
|
|
10738
|
+
import { css as css20 } from "@emotion/css";
|
|
10739
|
+
import { useMemo as useMemo28 } from "react";
|
|
10740
|
+
var useStyles20 = (theme, colorScheme, size, variant, backgroundColor) => {
|
|
10741
|
+
return useMemo28(() => {
|
|
10742
|
+
const baseAvatar = css20`
|
|
9855
10743
|
align-items: center;
|
|
9856
10744
|
background: ${backgroundColor || theme.vars.colors.background.surface};
|
|
9857
10745
|
border: ${backgroundColor ? "none" : `1px solid ${theme.vars.colors.border}`};
|
|
@@ -9867,19 +10755,19 @@ var useStyles18 = (theme, colorScheme, size, variant, backgroundColor) => {
|
|
|
9867
10755
|
width: ${size}px;
|
|
9868
10756
|
`;
|
|
9869
10757
|
const variantStyles = {
|
|
9870
|
-
circular:
|
|
10758
|
+
circular: css20`
|
|
9871
10759
|
border-radius: 50%;
|
|
9872
10760
|
`,
|
|
9873
|
-
square:
|
|
10761
|
+
square: css20`
|
|
9874
10762
|
border-radius: 8px;
|
|
9875
10763
|
`
|
|
9876
10764
|
};
|
|
9877
|
-
const imageStyles =
|
|
10765
|
+
const imageStyles = css20`
|
|
9878
10766
|
height: 100%;
|
|
9879
10767
|
object-fit: cover;
|
|
9880
10768
|
width: 100%;
|
|
9881
10769
|
`;
|
|
9882
|
-
const skeletonStyles =
|
|
10770
|
+
const skeletonStyles = css20`
|
|
9883
10771
|
width: 100%;
|
|
9884
10772
|
height: 100%;
|
|
9885
10773
|
background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
|
|
@@ -9896,7 +10784,7 @@ var useStyles18 = (theme, colorScheme, size, variant, backgroundColor) => {
|
|
|
9896
10784
|
}
|
|
9897
10785
|
}
|
|
9898
10786
|
`;
|
|
9899
|
-
const iconStyles =
|
|
10787
|
+
const iconStyles = css20`
|
|
9900
10788
|
width: 60%;
|
|
9901
10789
|
height: 60%;
|
|
9902
10790
|
fill: ${backgroundColor ? "#ffffff" : theme.vars.colors.text.secondary};
|
|
@@ -9911,10 +10799,10 @@ var useStyles18 = (theme, colorScheme, size, variant, backgroundColor) => {
|
|
|
9911
10799
|
};
|
|
9912
10800
|
}, [theme, colorScheme, size, variant, backgroundColor]);
|
|
9913
10801
|
};
|
|
9914
|
-
var Avatar_styles_default =
|
|
10802
|
+
var Avatar_styles_default = useStyles20;
|
|
9915
10803
|
|
|
9916
10804
|
// src/components/primitives/Avatar/Avatar.tsx
|
|
9917
|
-
import { jsx as
|
|
10805
|
+
import { jsx as jsx81 } from "react/jsx-runtime";
|
|
9918
10806
|
var Avatar = ({
|
|
9919
10807
|
alt = "User avatar",
|
|
9920
10808
|
background = "random",
|
|
@@ -9944,7 +10832,7 @@ var Avatar = ({
|
|
|
9944
10832
|
const colors = generateColor(seed);
|
|
9945
10833
|
return `linear-gradient(${angle}deg, ${colors})`;
|
|
9946
10834
|
};
|
|
9947
|
-
const backgroundColor =
|
|
10835
|
+
const backgroundColor = useMemo29(() => {
|
|
9948
10836
|
if (!name || imageUrl) {
|
|
9949
10837
|
return void 0;
|
|
9950
10838
|
}
|
|
@@ -9961,28 +10849,28 @@ var Avatar = ({
|
|
|
9961
10849
|
const getInitials = (fullName) => fullName.split(" ").map((part) => part[0]).slice(0, 2).join("").toUpperCase();
|
|
9962
10850
|
const renderContent = () => {
|
|
9963
10851
|
if (imageUrl) {
|
|
9964
|
-
return /* @__PURE__ */
|
|
10852
|
+
return /* @__PURE__ */ jsx81("img", { src: imageUrl, alt, className: cx25(withVendorCSSClassPrefix23(bem16("avatar", "image")), styles.image) });
|
|
9965
10853
|
}
|
|
9966
10854
|
if (name) {
|
|
9967
10855
|
return getInitials(name);
|
|
9968
10856
|
}
|
|
9969
10857
|
if (isLoading) {
|
|
9970
|
-
return /* @__PURE__ */
|
|
10858
|
+
return /* @__PURE__ */ jsx81("div", { className: cx25(withVendorCSSClassPrefix23(bem16("avatar", "skeleton")), styles.skeleton) });
|
|
9971
10859
|
}
|
|
9972
|
-
return /* @__PURE__ */
|
|
10860
|
+
return /* @__PURE__ */ jsx81(
|
|
9973
10861
|
"svg",
|
|
9974
10862
|
{
|
|
9975
10863
|
xmlns: "http://www.w3.org/2000/svg",
|
|
9976
10864
|
viewBox: "0 0 640 640",
|
|
9977
|
-
className:
|
|
9978
|
-
children: /* @__PURE__ */
|
|
10865
|
+
className: cx25(withVendorCSSClassPrefix23(bem16("avatar", "icon")), styles.icon),
|
|
10866
|
+
children: /* @__PURE__ */ jsx81("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" })
|
|
9979
10867
|
}
|
|
9980
10868
|
);
|
|
9981
10869
|
};
|
|
9982
|
-
return /* @__PURE__ */
|
|
10870
|
+
return /* @__PURE__ */ jsx81(
|
|
9983
10871
|
"div",
|
|
9984
10872
|
{
|
|
9985
|
-
className:
|
|
10873
|
+
className: cx25(
|
|
9986
10874
|
withVendorCSSClassPrefix23(bem16("avatar")),
|
|
9987
10875
|
styles.avatar,
|
|
9988
10876
|
styles.variant,
|
|
@@ -10010,12 +10898,12 @@ import {
|
|
|
10010
10898
|
FloatingPortal,
|
|
10011
10899
|
useId
|
|
10012
10900
|
} from "@floating-ui/react";
|
|
10013
|
-
import { cx as
|
|
10901
|
+
import { cx as cx26 } from "@emotion/css";
|
|
10014
10902
|
import React2 from "react";
|
|
10015
10903
|
|
|
10016
10904
|
// src/components/primitives/Icons/LogOut.tsx
|
|
10017
|
-
import { jsx as
|
|
10018
|
-
var LogOut = (props) => /* @__PURE__ */
|
|
10905
|
+
import { jsx as jsx82, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
10906
|
+
var LogOut = (props) => /* @__PURE__ */ jsxs32(
|
|
10019
10907
|
"svg",
|
|
10020
10908
|
{
|
|
10021
10909
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -10029,17 +10917,17 @@ var LogOut = (props) => /* @__PURE__ */ jsxs30(
|
|
|
10029
10917
|
strokeLinejoin: "round",
|
|
10030
10918
|
...props,
|
|
10031
10919
|
children: [
|
|
10032
|
-
/* @__PURE__ */
|
|
10033
|
-
/* @__PURE__ */
|
|
10034
|
-
/* @__PURE__ */
|
|
10920
|
+
/* @__PURE__ */ jsx82("path", { d: "m16 17 5-5-5-5" }),
|
|
10921
|
+
/* @__PURE__ */ jsx82("path", { d: "M21 12H9" }),
|
|
10922
|
+
/* @__PURE__ */ jsx82("path", { d: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" })
|
|
10035
10923
|
]
|
|
10036
10924
|
}
|
|
10037
10925
|
);
|
|
10038
10926
|
var LogOut_default = LogOut;
|
|
10039
10927
|
|
|
10040
10928
|
// src/components/primitives/Icons/Plus.tsx
|
|
10041
|
-
import { jsx as
|
|
10042
|
-
var Plus = (props) => /* @__PURE__ */
|
|
10929
|
+
import { jsx as jsx83, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
10930
|
+
var Plus = (props) => /* @__PURE__ */ jsxs33(
|
|
10043
10931
|
"svg",
|
|
10044
10932
|
{
|
|
10045
10933
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -10053,16 +10941,16 @@ var Plus = (props) => /* @__PURE__ */ jsxs31(
|
|
|
10053
10941
|
strokeLinejoin: "round",
|
|
10054
10942
|
...props,
|
|
10055
10943
|
children: [
|
|
10056
|
-
/* @__PURE__ */
|
|
10057
|
-
/* @__PURE__ */
|
|
10944
|
+
/* @__PURE__ */ jsx83("path", { d: "M5 12h14" }),
|
|
10945
|
+
/* @__PURE__ */ jsx83("path", { d: "M12 5v14" })
|
|
10058
10946
|
]
|
|
10059
10947
|
}
|
|
10060
10948
|
);
|
|
10061
10949
|
var Plus_default = Plus;
|
|
10062
10950
|
|
|
10063
10951
|
// src/components/primitives/Icons/User.tsx
|
|
10064
|
-
import { jsx as
|
|
10065
|
-
var User7 = (props) => /* @__PURE__ */
|
|
10952
|
+
import { jsx as jsx84, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
10953
|
+
var User7 = (props) => /* @__PURE__ */ jsxs34(
|
|
10066
10954
|
"svg",
|
|
10067
10955
|
{
|
|
10068
10956
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -10076,16 +10964,16 @@ var User7 = (props) => /* @__PURE__ */ jsxs32(
|
|
|
10076
10964
|
strokeLinejoin: "round",
|
|
10077
10965
|
...props,
|
|
10078
10966
|
children: [
|
|
10079
|
-
/* @__PURE__ */
|
|
10080
|
-
/* @__PURE__ */
|
|
10967
|
+
/* @__PURE__ */ jsx84("path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" }),
|
|
10968
|
+
/* @__PURE__ */ jsx84("circle", { cx: "12", cy: "7", r: "4" })
|
|
10081
10969
|
]
|
|
10082
10970
|
}
|
|
10083
10971
|
);
|
|
10084
10972
|
var User_default2 = User7;
|
|
10085
10973
|
|
|
10086
10974
|
// src/components/primitives/Icons/X.tsx
|
|
10087
|
-
import { jsx as
|
|
10088
|
-
var X = (props) => /* @__PURE__ */
|
|
10975
|
+
import { jsx as jsx85, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
10976
|
+
var X = (props) => /* @__PURE__ */ jsxs35(
|
|
10089
10977
|
"svg",
|
|
10090
10978
|
{
|
|
10091
10979
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -10099,26 +10987,26 @@ var X = (props) => /* @__PURE__ */ jsxs33(
|
|
|
10099
10987
|
strokeLinejoin: "round",
|
|
10100
10988
|
...props,
|
|
10101
10989
|
children: [
|
|
10102
|
-
/* @__PURE__ */
|
|
10103
|
-
/* @__PURE__ */
|
|
10990
|
+
/* @__PURE__ */ jsx85("path", { d: "M18 6 6 18" }),
|
|
10991
|
+
/* @__PURE__ */ jsx85("path", { d: "m6 6 12 12" })
|
|
10104
10992
|
]
|
|
10105
10993
|
}
|
|
10106
10994
|
);
|
|
10107
10995
|
var X_default = X;
|
|
10108
10996
|
|
|
10109
10997
|
// src/components/primitives/Dialog/Dialog.styles.ts
|
|
10110
|
-
import { css as
|
|
10111
|
-
import { useMemo as
|
|
10112
|
-
var
|
|
10113
|
-
return
|
|
10114
|
-
const overlay =
|
|
10998
|
+
import { css as css21 } from "@emotion/css";
|
|
10999
|
+
import { useMemo as useMemo30 } from "react";
|
|
11000
|
+
var useStyles21 = (theme, colorScheme) => {
|
|
11001
|
+
return useMemo30(() => {
|
|
11002
|
+
const overlay = css21`
|
|
10115
11003
|
background-color: rgba(0, 0, 0, 0.5);
|
|
10116
11004
|
display: flex;
|
|
10117
11005
|
align-items: center;
|
|
10118
11006
|
justify-content: center;
|
|
10119
11007
|
z-index: 9999;
|
|
10120
11008
|
`;
|
|
10121
|
-
const content =
|
|
11009
|
+
const content = css21`
|
|
10122
11010
|
background: ${theme.vars.colors.background.surface};
|
|
10123
11011
|
border-radius: ${theme.vars.borderRadius.large};
|
|
10124
11012
|
box-shadow: 0 2px 8px ${colorScheme === "dark" ? "rgba(0, 0, 0, 0.3)" : "rgba(0, 0, 0, 0.15)"};
|
|
@@ -10126,7 +11014,7 @@ var useStyles19 = (theme, colorScheme) => {
|
|
|
10126
11014
|
overflow-y: auto;
|
|
10127
11015
|
z-index: 10000;
|
|
10128
11016
|
`;
|
|
10129
|
-
const dropdownContent =
|
|
11017
|
+
const dropdownContent = css21`
|
|
10130
11018
|
background: ${theme.vars.colors.background.surface};
|
|
10131
11019
|
border-radius: ${theme.vars.borderRadius.large};
|
|
10132
11020
|
box-shadow: 0 2px 8px ${colorScheme === "dark" ? "rgba(0, 0, 0, 0.3)" : "rgba(0, 0, 0, 0.15)"};
|
|
@@ -10136,23 +11024,23 @@ var useStyles19 = (theme, colorScheme) => {
|
|
|
10136
11024
|
overflow-y: auto;
|
|
10137
11025
|
z-index: 10000;
|
|
10138
11026
|
`;
|
|
10139
|
-
const header =
|
|
11027
|
+
const header = css21`
|
|
10140
11028
|
display: flex;
|
|
10141
11029
|
justify-content: space-between;
|
|
10142
11030
|
align-items: center;
|
|
10143
11031
|
padding: calc(${theme.vars.spacing.unit} * 3) calc(${theme.vars.spacing.unit} * 4.5);
|
|
10144
11032
|
border-bottom: 1px solid ${theme.vars.colors.border};
|
|
10145
11033
|
`;
|
|
10146
|
-
const headerTitle =
|
|
11034
|
+
const headerTitle = css21`
|
|
10147
11035
|
margin: 0;
|
|
10148
11036
|
font-size: 1.2rem;
|
|
10149
11037
|
font-weight: 600;
|
|
10150
11038
|
color: ${theme.vars.colors.text.primary};
|
|
10151
11039
|
`;
|
|
10152
|
-
const contentBody =
|
|
11040
|
+
const contentBody = css21`
|
|
10153
11041
|
padding: calc(${theme.vars.spacing.unit} * 2);
|
|
10154
11042
|
`;
|
|
10155
|
-
const description =
|
|
11043
|
+
const description = css21`
|
|
10156
11044
|
margin: 0;
|
|
10157
11045
|
color: ${theme.vars.colors.text.secondary};
|
|
10158
11046
|
font-size: ${theme.vars.typography.fontSizes.sm};
|
|
@@ -10169,10 +11057,10 @@ var useStyles19 = (theme, colorScheme) => {
|
|
|
10169
11057
|
};
|
|
10170
11058
|
}, [theme, colorScheme]);
|
|
10171
11059
|
};
|
|
10172
|
-
var Dialog_styles_default =
|
|
11060
|
+
var Dialog_styles_default = useStyles21;
|
|
10173
11061
|
|
|
10174
11062
|
// src/components/primitives/Dialog/Dialog.tsx
|
|
10175
|
-
import { jsx as
|
|
11063
|
+
import { jsx as jsx86, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
10176
11064
|
function useDialog({
|
|
10177
11065
|
initialOpen = false,
|
|
10178
11066
|
open: controlledOpen,
|
|
@@ -10218,7 +11106,7 @@ var useDialogContext = () => {
|
|
|
10218
11106
|
};
|
|
10219
11107
|
function Dialog({ children, ...options }) {
|
|
10220
11108
|
const dialog = useDialog(options);
|
|
10221
|
-
return /* @__PURE__ */
|
|
11109
|
+
return /* @__PURE__ */ jsx86(DialogContext.Provider, { value: dialog, children });
|
|
10222
11110
|
}
|
|
10223
11111
|
var DialogTrigger = React2.forwardRef(
|
|
10224
11112
|
({ children, asChild = false, ...props }, propRef) => {
|
|
@@ -10236,7 +11124,7 @@ var DialogTrigger = React2.forwardRef(
|
|
|
10236
11124
|
})
|
|
10237
11125
|
);
|
|
10238
11126
|
}
|
|
10239
|
-
return /* @__PURE__ */
|
|
11127
|
+
return /* @__PURE__ */ jsx86("button", { ref, "data-state": context.open ? "open" : "closed", ...context.getReferenceProps(props), children });
|
|
10240
11128
|
}
|
|
10241
11129
|
);
|
|
10242
11130
|
var DialogContent = React2.forwardRef((props, propRef) => {
|
|
@@ -10245,11 +11133,11 @@ var DialogContent = React2.forwardRef((props, propRef) => {
|
|
|
10245
11133
|
const styles = Dialog_styles_default(theme, colorScheme);
|
|
10246
11134
|
const ref = useMergeRefs([context.refs.setFloating, propRef]);
|
|
10247
11135
|
if (!floatingContext.open) return null;
|
|
10248
|
-
return /* @__PURE__ */
|
|
11136
|
+
return /* @__PURE__ */ jsx86(FloatingPortal, { children: /* @__PURE__ */ jsx86(FloatingOverlay, { className: cx26(withVendorCSSClassPrefix24(bem17("dialog", "overlay")), styles.overlay), lockScroll: true, children: /* @__PURE__ */ jsx86(FloatingFocusManager, { context: floatingContext, initialFocus: -1, children: /* @__PURE__ */ jsx86(
|
|
10249
11137
|
"div",
|
|
10250
11138
|
{
|
|
10251
11139
|
ref,
|
|
10252
|
-
className:
|
|
11140
|
+
className: cx26(withVendorCSSClassPrefix24(bem17("dialog", "content")), styles.content, props.className),
|
|
10253
11141
|
"aria-labelledby": context.labelId,
|
|
10254
11142
|
"aria-describedby": context.descriptionId,
|
|
10255
11143
|
...context.getFloatingProps(props),
|
|
@@ -10267,18 +11155,18 @@ var DialogHeading = React2.forwardRef(
|
|
|
10267
11155
|
context.setLabelId(id);
|
|
10268
11156
|
return () => context.setLabelId(void 0);
|
|
10269
11157
|
}, [id, context.setLabelId]);
|
|
10270
|
-
return /* @__PURE__ */
|
|
10271
|
-
/* @__PURE__ */
|
|
11158
|
+
return /* @__PURE__ */ jsxs36("div", { className: cx26(withVendorCSSClassPrefix24(bem17("dialog", "header")), styles.header), children: [
|
|
11159
|
+
/* @__PURE__ */ jsx86(
|
|
10272
11160
|
"h2",
|
|
10273
11161
|
{
|
|
10274
11162
|
...props,
|
|
10275
11163
|
ref,
|
|
10276
11164
|
id,
|
|
10277
|
-
className:
|
|
11165
|
+
className: cx26(withVendorCSSClassPrefix24(bem17("dialog", "title")), styles.headerTitle),
|
|
10278
11166
|
children
|
|
10279
11167
|
}
|
|
10280
11168
|
),
|
|
10281
|
-
/* @__PURE__ */
|
|
11169
|
+
/* @__PURE__ */ jsx86(
|
|
10282
11170
|
Button_default,
|
|
10283
11171
|
{
|
|
10284
11172
|
color: "tertiary",
|
|
@@ -10287,7 +11175,7 @@ var DialogHeading = React2.forwardRef(
|
|
|
10287
11175
|
shape: "round",
|
|
10288
11176
|
onClick: () => context.setOpen(false),
|
|
10289
11177
|
"aria-label": "Close",
|
|
10290
|
-
children: /* @__PURE__ */
|
|
11178
|
+
children: /* @__PURE__ */ jsx86(X_default, { width: 16, height: 16 })
|
|
10291
11179
|
}
|
|
10292
11180
|
)
|
|
10293
11181
|
] });
|
|
@@ -10303,13 +11191,13 @@ var DialogDescription = React2.forwardRef(
|
|
|
10303
11191
|
context.setDescriptionId(id);
|
|
10304
11192
|
return () => context.setDescriptionId(void 0);
|
|
10305
11193
|
}, [id, context.setDescriptionId]);
|
|
10306
|
-
return /* @__PURE__ */
|
|
11194
|
+
return /* @__PURE__ */ jsx86(
|
|
10307
11195
|
"p",
|
|
10308
11196
|
{
|
|
10309
11197
|
...props,
|
|
10310
11198
|
ref,
|
|
10311
11199
|
id,
|
|
10312
|
-
className:
|
|
11200
|
+
className: cx26(withVendorCSSClassPrefix24(bem17("dialog", "description")), styles.description, props.className),
|
|
10313
11201
|
children
|
|
10314
11202
|
}
|
|
10315
11203
|
);
|
|
@@ -10333,13 +11221,13 @@ var DialogClose = React2.forwardRef(({ children, asChild = false, ...props }, pr
|
|
|
10333
11221
|
onClick: handleClick
|
|
10334
11222
|
});
|
|
10335
11223
|
}
|
|
10336
|
-
return /* @__PURE__ */
|
|
11224
|
+
return /* @__PURE__ */ jsx86(
|
|
10337
11225
|
Button_default,
|
|
10338
11226
|
{
|
|
10339
11227
|
...props,
|
|
10340
11228
|
ref,
|
|
10341
11229
|
onClick: handleClick,
|
|
10342
|
-
className:
|
|
11230
|
+
className: cx26(withVendorCSSClassPrefix24(bem17("dialog", "close")), props.className),
|
|
10343
11231
|
variant: "text",
|
|
10344
11232
|
children
|
|
10345
11233
|
}
|
|
@@ -10358,41 +11246,41 @@ Dialog.Close = DialogClose;
|
|
|
10358
11246
|
var Dialog_default = Dialog;
|
|
10359
11247
|
|
|
10360
11248
|
// src/components/primitives/MultiInput/MultiInput.tsx
|
|
10361
|
-
import { useCallback as
|
|
10362
|
-
import { cx as
|
|
11249
|
+
import { useCallback as useCallback15, useState as useState21 } from "react";
|
|
11250
|
+
import { cx as cx27 } from "@emotion/css";
|
|
10363
11251
|
import { withVendorCSSClassPrefix as withVendorCSSClassPrefix25, bem as bem18 } from "@asgardeo/browser";
|
|
10364
11252
|
|
|
10365
11253
|
// src/components/primitives/MultiInput/MultiInput.styles.ts
|
|
10366
|
-
import { css as
|
|
10367
|
-
import { useMemo as
|
|
10368
|
-
var
|
|
10369
|
-
return
|
|
10370
|
-
const container =
|
|
11254
|
+
import { css as css22 } from "@emotion/css";
|
|
11255
|
+
import { useMemo as useMemo31 } from "react";
|
|
11256
|
+
var useStyles22 = (theme, colorScheme, disabled, hasError, canAddMore, canRemove) => {
|
|
11257
|
+
return useMemo31(() => {
|
|
11258
|
+
const container = css22`
|
|
10371
11259
|
display: flex;
|
|
10372
11260
|
flex-direction: column;
|
|
10373
11261
|
gap: ${theme.vars.spacing.unit};
|
|
10374
11262
|
`;
|
|
10375
|
-
const inputRow =
|
|
11263
|
+
const inputRow = css22`
|
|
10376
11264
|
display: flex;
|
|
10377
11265
|
align-items: center;
|
|
10378
11266
|
gap: ${theme.vars.spacing.unit};
|
|
10379
11267
|
position: relative;
|
|
10380
11268
|
`;
|
|
10381
|
-
const inputWrapper =
|
|
11269
|
+
const inputWrapper = css22`
|
|
10382
11270
|
flex: 1;
|
|
10383
11271
|
`;
|
|
10384
|
-
const plusIcon =
|
|
11272
|
+
const plusIcon = css22`
|
|
10385
11273
|
background: ${theme.vars.colors.secondary.main};
|
|
10386
11274
|
border-radius: 50%;
|
|
10387
11275
|
outline: 4px ${theme.vars.colors.secondary.main} auto;
|
|
10388
11276
|
color: ${theme.vars.colors.secondary.contrastText};
|
|
10389
11277
|
`;
|
|
10390
|
-
const listContainer =
|
|
11278
|
+
const listContainer = css22`
|
|
10391
11279
|
display: flex;
|
|
10392
11280
|
flex-direction: column;
|
|
10393
11281
|
gap: 0;
|
|
10394
11282
|
`;
|
|
10395
|
-
const listItem =
|
|
11283
|
+
const listItem = css22`
|
|
10396
11284
|
display: flex;
|
|
10397
11285
|
align-items: center;
|
|
10398
11286
|
justify-content: space-between;
|
|
@@ -10407,11 +11295,11 @@ var useStyles20 = (theme, colorScheme, disabled, hasError, canAddMore, canRemove
|
|
|
10407
11295
|
margin-bottom: 0;
|
|
10408
11296
|
}
|
|
10409
11297
|
`;
|
|
10410
|
-
const listItemText =
|
|
11298
|
+
const listItemText = css22`
|
|
10411
11299
|
flex: 1;
|
|
10412
11300
|
word-break: break-word;
|
|
10413
11301
|
`;
|
|
10414
|
-
const removeButton =
|
|
11302
|
+
const removeButton = css22`
|
|
10415
11303
|
padding: calc(${theme.vars.spacing.unit} / 2);
|
|
10416
11304
|
min-width: auto;
|
|
10417
11305
|
color: ${theme.vars.colors.error.main};
|
|
@@ -10431,7 +11319,7 @@ var useStyles20 = (theme, colorScheme, disabled, hasError, canAddMore, canRemove
|
|
|
10431
11319
|
opacity: 0.6;
|
|
10432
11320
|
}
|
|
10433
11321
|
`;
|
|
10434
|
-
const icon =
|
|
11322
|
+
const icon = css22`
|
|
10435
11323
|
width: 16px;
|
|
10436
11324
|
height: 16px;
|
|
10437
11325
|
stroke: currentColor;
|
|
@@ -10453,10 +11341,10 @@ var useStyles20 = (theme, colorScheme, disabled, hasError, canAddMore, canRemove
|
|
|
10453
11341
|
};
|
|
10454
11342
|
}, [theme, colorScheme, disabled, hasError, canAddMore, canRemove]);
|
|
10455
11343
|
};
|
|
10456
|
-
var MultiInput_styles_default =
|
|
11344
|
+
var MultiInput_styles_default = useStyles22;
|
|
10457
11345
|
|
|
10458
11346
|
// src/components/primitives/MultiInput/MultiInput.tsx
|
|
10459
|
-
import { jsx as
|
|
11347
|
+
import { jsx as jsx87, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
10460
11348
|
var MultiInput = ({
|
|
10461
11349
|
label,
|
|
10462
11350
|
error,
|
|
@@ -10479,9 +11367,9 @@ var MultiInput = ({
|
|
|
10479
11367
|
const canAddMore = !maxFields || values.length < maxFields;
|
|
10480
11368
|
const canRemove = values.length > minFields;
|
|
10481
11369
|
const styles = MultiInput_styles_default(theme, colorScheme, !!disabled, !!error, canAddMore, canRemove);
|
|
10482
|
-
const PlusIcon = ({ className: className2 }) => /* @__PURE__ */
|
|
10483
|
-
const BinIcon = ({ className: className2 }) => /* @__PURE__ */
|
|
10484
|
-
const handleAddValue =
|
|
11370
|
+
const PlusIcon = ({ className: className2 }) => /* @__PURE__ */ jsx87("svg", { width: "16", height: "16", viewBox: "0 0 24 24", className: cx27(styles.icon, className2), children: /* @__PURE__ */ jsx87("path", { d: "M12 5v14M5 12h14" }) });
|
|
11371
|
+
const BinIcon = ({ className: className2 }) => /* @__PURE__ */ jsx87("svg", { width: "16", height: "16", viewBox: "0 0 24 24", className: cx27(styles.icon, className2), children: /* @__PURE__ */ jsx87("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" }) });
|
|
11372
|
+
const handleAddValue = useCallback15(
|
|
10485
11373
|
(newValue) => {
|
|
10486
11374
|
if (newValue.trim() !== "" && (!maxFields || values.length < maxFields)) {
|
|
10487
11375
|
onChange([...values, newValue.trim()]);
|
|
@@ -10489,7 +11377,7 @@ var MultiInput = ({
|
|
|
10489
11377
|
},
|
|
10490
11378
|
[values, onChange, maxFields]
|
|
10491
11379
|
);
|
|
10492
|
-
const handleRemoveValue =
|
|
11380
|
+
const handleRemoveValue = useCallback15(
|
|
10493
11381
|
(index) => {
|
|
10494
11382
|
if (values.length > minFields) {
|
|
10495
11383
|
const updatedValues = values.filter((_, i) => i !== index);
|
|
@@ -10498,7 +11386,7 @@ var MultiInput = ({
|
|
|
10498
11386
|
},
|
|
10499
11387
|
[values, onChange, minFields]
|
|
10500
11388
|
);
|
|
10501
|
-
const renderInputField =
|
|
11389
|
+
const renderInputField = useCallback15(
|
|
10502
11390
|
(value, onValueChange, attachedEndIcon, onEndIconClick) => {
|
|
10503
11391
|
const handleInputChange = (e) => {
|
|
10504
11392
|
const newValue = e.target ? e.target.value : e;
|
|
@@ -10524,9 +11412,9 @@ var MultiInput = ({
|
|
|
10524
11412
|
};
|
|
10525
11413
|
switch (fieldType) {
|
|
10526
11414
|
case "DATE_TIME":
|
|
10527
|
-
return /* @__PURE__ */
|
|
11415
|
+
return /* @__PURE__ */ jsx87(DatePicker_default, { ...commonProps });
|
|
10528
11416
|
case "BOOLEAN":
|
|
10529
|
-
return /* @__PURE__ */
|
|
11417
|
+
return /* @__PURE__ */ jsx87(
|
|
10530
11418
|
Checkbox_default,
|
|
10531
11419
|
{
|
|
10532
11420
|
...commonProps,
|
|
@@ -10535,55 +11423,55 @@ var MultiInput = ({
|
|
|
10535
11423
|
}
|
|
10536
11424
|
);
|
|
10537
11425
|
default:
|
|
10538
|
-
return /* @__PURE__ */
|
|
11426
|
+
return /* @__PURE__ */ jsx87(TextField_default, { ...commonProps, type });
|
|
10539
11427
|
}
|
|
10540
11428
|
},
|
|
10541
11429
|
[placeholder, disabled, startIcon, endIcon, error, fieldType, type]
|
|
10542
11430
|
);
|
|
10543
|
-
const [currentInputValue, setCurrentInputValue] =
|
|
10544
|
-
const handleInputSubmit =
|
|
11431
|
+
const [currentInputValue, setCurrentInputValue] = useState21("");
|
|
11432
|
+
const handleInputSubmit = useCallback15(() => {
|
|
10545
11433
|
if (currentInputValue.trim() !== "") {
|
|
10546
11434
|
handleAddValue(currentInputValue);
|
|
10547
11435
|
setCurrentInputValue("");
|
|
10548
11436
|
}
|
|
10549
11437
|
}, [currentInputValue, handleAddValue]);
|
|
10550
|
-
return /* @__PURE__ */
|
|
11438
|
+
return /* @__PURE__ */ jsxs37(
|
|
10551
11439
|
FormControl_default,
|
|
10552
11440
|
{
|
|
10553
11441
|
error,
|
|
10554
11442
|
helperText,
|
|
10555
|
-
className:
|
|
11443
|
+
className: cx27(withVendorCSSClassPrefix25(bem18("multi-input")), className),
|
|
10556
11444
|
style,
|
|
10557
11445
|
children: [
|
|
10558
|
-
label && /* @__PURE__ */
|
|
10559
|
-
/* @__PURE__ */
|
|
10560
|
-
/* @__PURE__ */
|
|
11446
|
+
label && /* @__PURE__ */ jsx87(InputLabel_default, { required, error: !!error, children: label }),
|
|
11447
|
+
/* @__PURE__ */ jsxs37("div", { className: cx27(withVendorCSSClassPrefix25(bem18("multi-input", "container")), styles.container), children: [
|
|
11448
|
+
/* @__PURE__ */ jsx87("div", { className: cx27(withVendorCSSClassPrefix25(bem18("multi-input", "input-row")), styles.inputRow), children: /* @__PURE__ */ jsx87("div", { className: cx27(withVendorCSSClassPrefix25(bem18("multi-input", "input-wrapper")), styles.inputWrapper), children: renderInputField(
|
|
10561
11449
|
currentInputValue,
|
|
10562
11450
|
setCurrentInputValue,
|
|
10563
|
-
canAddMore ? /* @__PURE__ */
|
|
11451
|
+
canAddMore ? /* @__PURE__ */ jsx87(PlusIcon, { className: styles.plusIcon }) : void 0,
|
|
10564
11452
|
canAddMore ? handleInputSubmit : void 0
|
|
10565
11453
|
) }) }),
|
|
10566
|
-
values.length > 0 && /* @__PURE__ */
|
|
11454
|
+
values.length > 0 && /* @__PURE__ */ jsx87("div", { className: cx27(withVendorCSSClassPrefix25(bem18("multi-input", "list-container")), styles.listContainer), children: values.map((value, index) => /* @__PURE__ */ jsxs37(
|
|
10567
11455
|
"div",
|
|
10568
11456
|
{
|
|
10569
|
-
className:
|
|
11457
|
+
className: cx27(withVendorCSSClassPrefix25(bem18("multi-input", "list-item")), styles.listItem),
|
|
10570
11458
|
children: [
|
|
10571
|
-
/* @__PURE__ */
|
|
11459
|
+
/* @__PURE__ */ jsx87(
|
|
10572
11460
|
"span",
|
|
10573
11461
|
{
|
|
10574
|
-
className:
|
|
11462
|
+
className: cx27(withVendorCSSClassPrefix25(bem18("multi-input", "list-item-text")), styles.listItemText),
|
|
10575
11463
|
children: value
|
|
10576
11464
|
}
|
|
10577
11465
|
),
|
|
10578
|
-
canRemove && /* @__PURE__ */
|
|
11466
|
+
canRemove && /* @__PURE__ */ jsx87(
|
|
10579
11467
|
"button",
|
|
10580
11468
|
{
|
|
10581
11469
|
type: "button",
|
|
10582
11470
|
onClick: () => handleRemoveValue(index),
|
|
10583
11471
|
disabled,
|
|
10584
|
-
className:
|
|
11472
|
+
className: cx27(withVendorCSSClassPrefix25(bem18("multi-input", "remove-button")), styles.removeButton),
|
|
10585
11473
|
title: "Remove value",
|
|
10586
|
-
children: /* @__PURE__ */
|
|
11474
|
+
children: /* @__PURE__ */ jsx87(BinIcon, { className: styles.icon })
|
|
10587
11475
|
}
|
|
10588
11476
|
)
|
|
10589
11477
|
]
|
|
@@ -10598,15 +11486,15 @@ var MultiInput = ({
|
|
|
10598
11486
|
var MultiInput_default = MultiInput;
|
|
10599
11487
|
|
|
10600
11488
|
// src/components/presentation/UserProfile/BaseUserProfile.styles.ts
|
|
10601
|
-
import { css as
|
|
10602
|
-
import { useMemo as
|
|
11489
|
+
import { css as css23 } from "@emotion/css";
|
|
11490
|
+
import { useMemo as useMemo32 } from "react";
|
|
10603
11491
|
import { withVendorCSSClassPrefix as withVendorCSSClassPrefix26 } from "@asgardeo/browser";
|
|
10604
|
-
var
|
|
10605
|
-
const valuePlaceholder =
|
|
11492
|
+
var useStyles23 = (theme, colorScheme) => {
|
|
11493
|
+
const valuePlaceholder = css23`
|
|
10606
11494
|
font-style: italic;
|
|
10607
11495
|
opacity: 0.7;
|
|
10608
11496
|
`;
|
|
10609
|
-
const editButton =
|
|
11497
|
+
const editButton = css23`
|
|
10610
11498
|
font-style: italic;
|
|
10611
11499
|
text-decoration: underline;
|
|
10612
11500
|
opacity: 0.7;
|
|
@@ -10617,19 +11505,19 @@ var useStyles21 = (theme, colorScheme) => {
|
|
|
10617
11505
|
background-color: transparent;
|
|
10618
11506
|
}
|
|
10619
11507
|
`;
|
|
10620
|
-
const fieldInner =
|
|
11508
|
+
const fieldInner = css23`
|
|
10621
11509
|
flex: 1;
|
|
10622
11510
|
display: flex;
|
|
10623
11511
|
align-items: center;
|
|
10624
11512
|
gap: ${theme.vars.spacing.unit};
|
|
10625
11513
|
`;
|
|
10626
|
-
const fieldActions =
|
|
11514
|
+
const fieldActions = css23`
|
|
10627
11515
|
display: flex;
|
|
10628
11516
|
gap: calc(${theme.vars.spacing.unit} / 2);
|
|
10629
11517
|
align-items: center;
|
|
10630
11518
|
margin-inline-start: calc(${theme.vars.spacing.unit} * 4);
|
|
10631
11519
|
`;
|
|
10632
|
-
const complexTextarea =
|
|
11520
|
+
const complexTextarea = css23`
|
|
10633
11521
|
min-height: 60px;
|
|
10634
11522
|
width: 100%;
|
|
10635
11523
|
padding: 8px;
|
|
@@ -10637,57 +11525,57 @@ var useStyles21 = (theme, colorScheme) => {
|
|
|
10637
11525
|
border-radius: ${theme.vars.borderRadius.small};
|
|
10638
11526
|
resize: vertical;
|
|
10639
11527
|
`;
|
|
10640
|
-
const objectKey =
|
|
11528
|
+
const objectKey = css23`
|
|
10641
11529
|
padding: ${theme.vars.spacing.unit};
|
|
10642
11530
|
vertical-align: top;
|
|
10643
11531
|
`;
|
|
10644
|
-
const objectValue =
|
|
11532
|
+
const objectValue = css23`
|
|
10645
11533
|
padding: ${theme.vars.spacing.unit};
|
|
10646
11534
|
vertical-align: top;
|
|
10647
11535
|
`;
|
|
10648
|
-
return
|
|
10649
|
-
const root =
|
|
11536
|
+
return useMemo32(() => {
|
|
11537
|
+
const root = css23`
|
|
10650
11538
|
padding: calc(${theme.vars.spacing.unit} * 4);
|
|
10651
11539
|
min-width: 600px;
|
|
10652
11540
|
margin: 0 auto;
|
|
10653
11541
|
`;
|
|
10654
|
-
const card =
|
|
11542
|
+
const card = css23`
|
|
10655
11543
|
background: ${theme.vars.colors.background.surface};
|
|
10656
11544
|
border-radius: ${theme.vars.borderRadius.large};
|
|
10657
11545
|
`;
|
|
10658
|
-
const header =
|
|
11546
|
+
const header = css23`
|
|
10659
11547
|
display: flex;
|
|
10660
11548
|
align-items: center;
|
|
10661
11549
|
gap: calc(${theme.vars.spacing.unit} * 1.5);
|
|
10662
11550
|
margin-bottom: calc(${theme.vars.spacing.unit} * 1.5);
|
|
10663
11551
|
`;
|
|
10664
|
-
const profileInfo =
|
|
11552
|
+
const profileInfo = css23`
|
|
10665
11553
|
flex: 1;
|
|
10666
11554
|
`;
|
|
10667
|
-
const name =
|
|
11555
|
+
const name = css23`
|
|
10668
11556
|
font-size: 1.5rem;
|
|
10669
11557
|
font-weight: 600;
|
|
10670
11558
|
margin: 0;
|
|
10671
11559
|
color: ${theme.vars.colors.text.primary};
|
|
10672
11560
|
`;
|
|
10673
|
-
const infoContainer =
|
|
11561
|
+
const infoContainer = css23`
|
|
10674
11562
|
display: flex;
|
|
10675
11563
|
flex-direction: column;
|
|
10676
11564
|
`;
|
|
10677
|
-
const info =
|
|
11565
|
+
const info = css23`
|
|
10678
11566
|
padding: calc(${theme.vars.spacing.unit} * 1.5) 0;
|
|
10679
11567
|
border-bottom: 1px solid ${theme.vars.colors.border};
|
|
10680
11568
|
`;
|
|
10681
|
-
const field =
|
|
11569
|
+
const field = css23`
|
|
10682
11570
|
display: flex;
|
|
10683
11571
|
align-items: center;
|
|
10684
11572
|
padding: calc(${theme.vars.spacing.unit} / 2) 0;
|
|
10685
11573
|
min-height: 28px;
|
|
10686
11574
|
`;
|
|
10687
|
-
const lastField =
|
|
11575
|
+
const lastField = css23`
|
|
10688
11576
|
border-bottom: none;
|
|
10689
11577
|
`;
|
|
10690
|
-
const label =
|
|
11578
|
+
const label = css23`
|
|
10691
11579
|
font-size: 0.875rem;
|
|
10692
11580
|
font-weight: 500;
|
|
10693
11581
|
color: ${theme.vars.colors.text.secondary};
|
|
@@ -10696,7 +11584,7 @@ var useStyles21 = (theme, colorScheme) => {
|
|
|
10696
11584
|
line-height: 28px;
|
|
10697
11585
|
text-align: start;
|
|
10698
11586
|
`;
|
|
10699
|
-
const value =
|
|
11587
|
+
const value = css23`
|
|
10700
11588
|
color: ${theme.vars.colors.text.primary};
|
|
10701
11589
|
flex: 1;
|
|
10702
11590
|
display: inline-block;
|
|
@@ -10729,10 +11617,10 @@ var useStyles21 = (theme, colorScheme) => {
|
|
|
10729
11617
|
border-color: ${theme.vars.colors.border};
|
|
10730
11618
|
}
|
|
10731
11619
|
`;
|
|
10732
|
-
const popup =
|
|
11620
|
+
const popup = css23`
|
|
10733
11621
|
padding: calc(${theme.vars.spacing.unit} * 2);
|
|
10734
11622
|
`;
|
|
10735
|
-
const alert =
|
|
11623
|
+
const alert = css23`
|
|
10736
11624
|
margin-bottom: calc(${theme.vars.spacing.unit} * 3);
|
|
10737
11625
|
`;
|
|
10738
11626
|
return {
|
|
@@ -10768,7 +11656,7 @@ var useStyles21 = (theme, colorScheme) => {
|
|
|
10768
11656
|
colorScheme
|
|
10769
11657
|
]);
|
|
10770
11658
|
};
|
|
10771
|
-
var BaseUserProfile_styles_default =
|
|
11659
|
+
var BaseUserProfile_styles_default = useStyles23;
|
|
10772
11660
|
|
|
10773
11661
|
// src/utils/getDisplayName.ts
|
|
10774
11662
|
var getDisplayName = (mergedMappings, user) => {
|
|
@@ -10782,7 +11670,7 @@ var getDisplayName = (mergedMappings, user) => {
|
|
|
10782
11670
|
var getDisplayName_default = getDisplayName;
|
|
10783
11671
|
|
|
10784
11672
|
// src/components/presentation/UserProfile/BaseUserProfile.tsx
|
|
10785
|
-
import { Fragment as Fragment15, jsx as
|
|
11673
|
+
import { Fragment as Fragment15, jsx as jsx88, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
10786
11674
|
var fieldsToSkip = [
|
|
10787
11675
|
"roles.default",
|
|
10788
11676
|
"active",
|
|
@@ -10824,10 +11712,10 @@ var BaseUserProfile = ({
|
|
|
10824
11712
|
hideFields = []
|
|
10825
11713
|
}) => {
|
|
10826
11714
|
const { theme, colorScheme } = useTheme_default();
|
|
10827
|
-
const [editedUser, setEditedUser] =
|
|
10828
|
-
const [editingFields, setEditingFields] =
|
|
11715
|
+
const [editedUser, setEditedUser] = useState22(flattenedProfile || profile);
|
|
11716
|
+
const [editingFields, setEditingFields] = useState22({});
|
|
10829
11717
|
const { t } = useTranslation_default();
|
|
10830
|
-
const shouldShowField =
|
|
11718
|
+
const shouldShowField = useCallback16(
|
|
10831
11719
|
(fieldName) => {
|
|
10832
11720
|
if (fieldsToSkip.includes(fieldName)) {
|
|
10833
11721
|
return false;
|
|
@@ -10842,7 +11730,7 @@ var BaseUserProfile = ({
|
|
|
10842
11730
|
},
|
|
10843
11731
|
[showFields, hideFields]
|
|
10844
11732
|
);
|
|
10845
|
-
const PencilIcon = () => /* @__PURE__ */
|
|
11733
|
+
const PencilIcon = () => /* @__PURE__ */ jsx88(
|
|
10846
11734
|
"svg",
|
|
10847
11735
|
{
|
|
10848
11736
|
width: "16",
|
|
@@ -10853,16 +11741,16 @@ var BaseUserProfile = ({
|
|
|
10853
11741
|
strokeWidth: "2",
|
|
10854
11742
|
strokeLinecap: "round",
|
|
10855
11743
|
strokeLinejoin: "round",
|
|
10856
|
-
children: /* @__PURE__ */
|
|
11744
|
+
children: /* @__PURE__ */ jsx88("path", { d: "M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z" })
|
|
10857
11745
|
}
|
|
10858
11746
|
);
|
|
10859
|
-
const toggleFieldEdit =
|
|
11747
|
+
const toggleFieldEdit = useCallback16((fieldName) => {
|
|
10860
11748
|
setEditingFields((prev) => ({
|
|
10861
11749
|
...prev,
|
|
10862
11750
|
[fieldName]: !prev[fieldName]
|
|
10863
11751
|
}));
|
|
10864
11752
|
}, []);
|
|
10865
|
-
const getFieldPlaceholder =
|
|
11753
|
+
const getFieldPlaceholder = useCallback16((schema) => {
|
|
10866
11754
|
const { type, displayName, description, name } = schema;
|
|
10867
11755
|
const fieldLabel = displayName || description || name || "value";
|
|
10868
11756
|
switch (type) {
|
|
@@ -10878,12 +11766,12 @@ var BaseUserProfile = ({
|
|
|
10878
11766
|
}, []);
|
|
10879
11767
|
const ObjectDisplay = ({ data }) => {
|
|
10880
11768
|
if (!data || typeof data !== "object") return null;
|
|
10881
|
-
return /* @__PURE__ */
|
|
10882
|
-
/* @__PURE__ */
|
|
11769
|
+
return /* @__PURE__ */ jsx88("table", { className: styles.value, children: /* @__PURE__ */ jsx88("tbody", { children: Object.entries(data).map(([key, value]) => /* @__PURE__ */ jsxs38("tr", { children: [
|
|
11770
|
+
/* @__PURE__ */ jsx88("td", { className: styles.objectKey, children: /* @__PURE__ */ jsxs38("strong", { children: [
|
|
10883
11771
|
formatLabel(key),
|
|
10884
11772
|
":"
|
|
10885
11773
|
] }) }),
|
|
10886
|
-
/* @__PURE__ */
|
|
11774
|
+
/* @__PURE__ */ jsx88("td", { className: styles.objectValue, children: typeof value === "object" ? /* @__PURE__ */ jsx88(ObjectDisplay, { data: value }) : String(value) })
|
|
10887
11775
|
] }, key)) }) });
|
|
10888
11776
|
};
|
|
10889
11777
|
function set(obj, path, value) {
|
|
@@ -10901,7 +11789,7 @@ var BaseUserProfile = ({
|
|
|
10901
11789
|
}
|
|
10902
11790
|
}
|
|
10903
11791
|
}
|
|
10904
|
-
const handleFieldSave =
|
|
11792
|
+
const handleFieldSave = useCallback16(
|
|
10905
11793
|
(schema) => {
|
|
10906
11794
|
if (!onUpdate || !schema.name) return;
|
|
10907
11795
|
const fieldName = schema.name;
|
|
@@ -10924,7 +11812,7 @@ var BaseUserProfile = ({
|
|
|
10924
11812
|
},
|
|
10925
11813
|
[editedUser, flattenedProfile, onUpdate, toggleFieldEdit]
|
|
10926
11814
|
);
|
|
10927
|
-
const handleFieldCancel =
|
|
11815
|
+
const handleFieldCancel = useCallback16(
|
|
10928
11816
|
(fieldName) => {
|
|
10929
11817
|
const currentUser2 = flattenedProfile || profile;
|
|
10930
11818
|
setEditedUser((prev) => ({
|
|
@@ -10935,7 +11823,7 @@ var BaseUserProfile = ({
|
|
|
10935
11823
|
},
|
|
10936
11824
|
[flattenedProfile, profile, toggleFieldEdit]
|
|
10937
11825
|
);
|
|
10938
|
-
const formatLabel =
|
|
11826
|
+
const formatLabel = useCallback16(
|
|
10939
11827
|
(key) => key.split(/(?=[A-Z])|_/).map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(" "),
|
|
10940
11828
|
[]
|
|
10941
11829
|
);
|
|
@@ -10956,9 +11844,9 @@ var BaseUserProfile = ({
|
|
|
10956
11844
|
const { value, displayName, description, name, type, required, mutability, subAttributes, multiValued } = schema;
|
|
10957
11845
|
const label = displayName || description || name || "";
|
|
10958
11846
|
if (subAttributes && Array.isArray(subAttributes)) {
|
|
10959
|
-
return /* @__PURE__ */
|
|
10960
|
-
/* @__PURE__ */
|
|
10961
|
-
/* @__PURE__ */
|
|
11847
|
+
return /* @__PURE__ */ jsx88(Fragment15, { children: subAttributes.map((subAttr, index) => /* @__PURE__ */ jsxs38("div", { className: styles.field, children: [
|
|
11848
|
+
/* @__PURE__ */ jsx88("span", { className: styles.label, children: subAttr.displayName || subAttr.description || "" }),
|
|
11849
|
+
/* @__PURE__ */ jsx88("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) })
|
|
10962
11850
|
] }, index)) });
|
|
10963
11851
|
}
|
|
10964
11852
|
if (Array.isArray(value) || multiValued) {
|
|
@@ -10974,9 +11862,9 @@ var BaseUserProfile = ({
|
|
|
10974
11862
|
} else {
|
|
10975
11863
|
fieldValues = [];
|
|
10976
11864
|
}
|
|
10977
|
-
return /* @__PURE__ */
|
|
10978
|
-
/* @__PURE__ */
|
|
10979
|
-
/* @__PURE__ */
|
|
11865
|
+
return /* @__PURE__ */ jsxs38(Fragment15, { children: [
|
|
11866
|
+
/* @__PURE__ */ jsx88("span", { className: styles.label, children: label }),
|
|
11867
|
+
/* @__PURE__ */ jsx88("div", { className: styles.value, children: /* @__PURE__ */ jsx88(
|
|
10980
11868
|
MultiInput_default,
|
|
10981
11869
|
{
|
|
10982
11870
|
values: fieldValues,
|
|
@@ -11007,9 +11895,9 @@ var BaseUserProfile = ({
|
|
|
11007
11895
|
} else {
|
|
11008
11896
|
displayValue2 = "-";
|
|
11009
11897
|
}
|
|
11010
|
-
return /* @__PURE__ */
|
|
11011
|
-
/* @__PURE__ */
|
|
11012
|
-
/* @__PURE__ */
|
|
11898
|
+
return /* @__PURE__ */ jsxs38(Fragment15, { children: [
|
|
11899
|
+
/* @__PURE__ */ jsx88("span", { className: styles.label, children: label }),
|
|
11900
|
+
/* @__PURE__ */ jsx88("div", { className: cx28(styles.value, !hasValues ? styles.valuePlaceholder : ""), children: !hasValues && isEditable2 && onStartEdit ? /* @__PURE__ */ jsx88(
|
|
11013
11901
|
Button_default,
|
|
11014
11902
|
{
|
|
11015
11903
|
onClick: onStartEdit,
|
|
@@ -11024,7 +11912,7 @@ var BaseUserProfile = ({
|
|
|
11024
11912
|
] });
|
|
11025
11913
|
}
|
|
11026
11914
|
if (type === "COMPLEX" && typeof value === "object") {
|
|
11027
|
-
return /* @__PURE__ */
|
|
11915
|
+
return /* @__PURE__ */ jsx88(ObjectDisplay, { data: value });
|
|
11028
11916
|
}
|
|
11029
11917
|
if (isEditing && onEditValue && mutability !== "READ_ONLY" && !readonlyFields.includes(name || "")) {
|
|
11030
11918
|
const fieldValue = editedUser && name && editedUser[name] !== void 0 ? editedUser[name] : flattenedProfile && name && flattenedProfile[name] !== void 0 ? flattenedProfile[name] : value || "";
|
|
@@ -11039,16 +11927,16 @@ var BaseUserProfile = ({
|
|
|
11039
11927
|
let field;
|
|
11040
11928
|
switch (type) {
|
|
11041
11929
|
case "STRING":
|
|
11042
|
-
field = /* @__PURE__ */
|
|
11930
|
+
field = /* @__PURE__ */ jsx88(TextField_default, { ...commonProps });
|
|
11043
11931
|
break;
|
|
11044
11932
|
case "DATE_TIME":
|
|
11045
|
-
field = /* @__PURE__ */
|
|
11933
|
+
field = /* @__PURE__ */ jsx88(DatePicker_default, { ...commonProps });
|
|
11046
11934
|
break;
|
|
11047
11935
|
case "BOOLEAN":
|
|
11048
|
-
field = /* @__PURE__ */
|
|
11936
|
+
field = /* @__PURE__ */ jsx88(Checkbox_default, { ...commonProps, checked: !!fieldValue, onChange: (e) => onEditValue(e.target.checked) });
|
|
11049
11937
|
break;
|
|
11050
11938
|
case "COMPLEX":
|
|
11051
|
-
field = /* @__PURE__ */
|
|
11939
|
+
field = /* @__PURE__ */ jsx88(
|
|
11052
11940
|
"textarea",
|
|
11053
11941
|
{
|
|
11054
11942
|
value: fieldValue,
|
|
@@ -11060,11 +11948,11 @@ var BaseUserProfile = ({
|
|
|
11060
11948
|
);
|
|
11061
11949
|
break;
|
|
11062
11950
|
default:
|
|
11063
|
-
field = /* @__PURE__ */
|
|
11951
|
+
field = /* @__PURE__ */ jsx88(TextField_default, { ...commonProps });
|
|
11064
11952
|
}
|
|
11065
|
-
return /* @__PURE__ */
|
|
11066
|
-
/* @__PURE__ */
|
|
11067
|
-
/* @__PURE__ */
|
|
11953
|
+
return /* @__PURE__ */ jsxs38(Fragment15, { children: [
|
|
11954
|
+
/* @__PURE__ */ jsx88("span", { className: styles.label, children: label }),
|
|
11955
|
+
/* @__PURE__ */ jsx88("div", { className: styles.value, children: field })
|
|
11068
11956
|
] });
|
|
11069
11957
|
}
|
|
11070
11958
|
const hasValue = value !== void 0 && value !== null && value !== "";
|
|
@@ -11077,9 +11965,9 @@ var BaseUserProfile = ({
|
|
|
11077
11965
|
} else {
|
|
11078
11966
|
displayValue = "-";
|
|
11079
11967
|
}
|
|
11080
|
-
return /* @__PURE__ */
|
|
11081
|
-
/* @__PURE__ */
|
|
11082
|
-
/* @__PURE__ */
|
|
11968
|
+
return /* @__PURE__ */ jsxs38(Fragment15, { children: [
|
|
11969
|
+
/* @__PURE__ */ jsx88("span", { className: styles.label, children: label }),
|
|
11970
|
+
/* @__PURE__ */ jsx88("div", { className: cx28(styles.value, !hasValue ? styles.valuePlaceholder : ""), children: !hasValue && isEditable && onStartEdit ? /* @__PURE__ */ jsx88(
|
|
11083
11971
|
Button_default,
|
|
11084
11972
|
{
|
|
11085
11973
|
onClick: onStartEdit,
|
|
@@ -11107,8 +11995,8 @@ var BaseUserProfile = ({
|
|
|
11107
11995
|
alignItems: "center",
|
|
11108
11996
|
gap: theme.vars.spacing.unit
|
|
11109
11997
|
};
|
|
11110
|
-
return /* @__PURE__ */
|
|
11111
|
-
/* @__PURE__ */
|
|
11998
|
+
return /* @__PURE__ */ jsxs38("div", { className: styles.field, children: [
|
|
11999
|
+
/* @__PURE__ */ jsx88("div", { className: styles.fieldInner, children: renderSchemaField(
|
|
11112
12000
|
schema,
|
|
11113
12001
|
isFieldEditing,
|
|
11114
12002
|
(value) => {
|
|
@@ -11118,12 +12006,12 @@ var BaseUserProfile = ({
|
|
|
11118
12006
|
},
|
|
11119
12007
|
() => toggleFieldEdit(schema.name)
|
|
11120
12008
|
) }),
|
|
11121
|
-
editable && schema.mutability !== "READ_ONLY" && !isReadonlyField && /* @__PURE__ */
|
|
11122
|
-
isFieldEditing && /* @__PURE__ */
|
|
11123
|
-
/* @__PURE__ */
|
|
11124
|
-
/* @__PURE__ */
|
|
12009
|
+
editable && schema.mutability !== "READ_ONLY" && !isReadonlyField && /* @__PURE__ */ jsxs38("div", { className: styles.fieldActions, children: [
|
|
12010
|
+
isFieldEditing && /* @__PURE__ */ jsxs38(Fragment15, { children: [
|
|
12011
|
+
/* @__PURE__ */ jsx88(Button_default, { size: "small", color: "primary", variant: "solid", onClick: () => handleFieldSave(schema), children: "Save" }),
|
|
12012
|
+
/* @__PURE__ */ jsx88(Button_default, { size: "small", color: "secondary", variant: "solid", onClick: () => handleFieldCancel(schema.name), children: "Cancel" })
|
|
11125
12013
|
] }),
|
|
11126
|
-
!isFieldEditing && hasValue && /* @__PURE__ */
|
|
12014
|
+
!isFieldEditing && hasValue && /* @__PURE__ */ jsx88(
|
|
11127
12015
|
Button_default,
|
|
11128
12016
|
{
|
|
11129
12017
|
size: "small",
|
|
@@ -11132,7 +12020,7 @@ var BaseUserProfile = ({
|
|
|
11132
12020
|
onClick: () => toggleFieldEdit(schema.name),
|
|
11133
12021
|
title: "Edit",
|
|
11134
12022
|
className: styles.editButton,
|
|
11135
|
-
children: /* @__PURE__ */
|
|
12023
|
+
children: /* @__PURE__ */ jsx88(PencilIcon, {})
|
|
11136
12024
|
}
|
|
11137
12025
|
)
|
|
11138
12026
|
] })
|
|
@@ -11141,7 +12029,7 @@ var BaseUserProfile = ({
|
|
|
11141
12029
|
if (!profile && !flattenedProfile) {
|
|
11142
12030
|
return fallback;
|
|
11143
12031
|
}
|
|
11144
|
-
const containerClasses =
|
|
12032
|
+
const containerClasses = cx28(
|
|
11145
12033
|
styles.root,
|
|
11146
12034
|
cardLayout ? styles.card : "",
|
|
11147
12035
|
withVendorCSSClassPrefix27("user-profile"),
|
|
@@ -11156,17 +12044,17 @@ var BaseUserProfile = ({
|
|
|
11156
12044
|
if (!shouldShowField(key)) return false;
|
|
11157
12045
|
return value !== void 0 && value !== "" && value !== null;
|
|
11158
12046
|
}).sort(([a], [b]) => a.localeCompare(b));
|
|
11159
|
-
return /* @__PURE__ */
|
|
11160
|
-
/* @__PURE__ */
|
|
11161
|
-
/* @__PURE__ */
|
|
12047
|
+
return /* @__PURE__ */ jsx88(Fragment15, { children: profileEntries.map(([key, value]) => /* @__PURE__ */ jsxs38("div", { className: styles.field, children: [
|
|
12048
|
+
/* @__PURE__ */ jsx88("span", { className: styles.label, children: formatLabel(key) }),
|
|
12049
|
+
/* @__PURE__ */ jsx88("div", { className: styles.value, children: typeof value === "object" ? JSON.stringify(value, null, 2) : String(value) })
|
|
11162
12050
|
] }, key)) });
|
|
11163
12051
|
};
|
|
11164
|
-
const profileContent = /* @__PURE__ */
|
|
11165
|
-
error && /* @__PURE__ */
|
|
11166
|
-
/* @__PURE__ */
|
|
11167
|
-
/* @__PURE__ */
|
|
12052
|
+
const profileContent = /* @__PURE__ */ jsxs38(Card_default, { className: containerClasses, children: [
|
|
12053
|
+
error && /* @__PURE__ */ jsxs38(Alert_default, { variant: "error", className: cx28(withVendorCSSClassPrefix27(bem19("user-profile", "alert")), styles.alert), children: [
|
|
12054
|
+
/* @__PURE__ */ jsx88(Alert_default.Title, { children: t("errors.heading") || "Error" }),
|
|
12055
|
+
/* @__PURE__ */ jsx88(Alert_default.Description, { children: error })
|
|
11168
12056
|
] }),
|
|
11169
|
-
/* @__PURE__ */
|
|
12057
|
+
/* @__PURE__ */ jsx88("div", { className: styles.header, children: /* @__PURE__ */ jsx88(
|
|
11170
12058
|
Avatar,
|
|
11171
12059
|
{
|
|
11172
12060
|
imageUrl: getMappedUserProfileValue_default("picture", mergedMappings, currentUser),
|
|
@@ -11176,7 +12064,7 @@ var BaseUserProfile = ({
|
|
|
11176
12064
|
isLoading
|
|
11177
12065
|
}
|
|
11178
12066
|
) }),
|
|
11179
|
-
/* @__PURE__ */
|
|
12067
|
+
/* @__PURE__ */ jsx88("div", { className: styles.infoContainer, children: schemas && schemas.length > 0 ? schemas.filter((schema) => {
|
|
11180
12068
|
if (!schema.name || !shouldShowField(schema.name)) return false;
|
|
11181
12069
|
if (!editable) {
|
|
11182
12070
|
const value = flattenedProfile && schema.name ? flattenedProfile[schema.name] : void 0;
|
|
@@ -11193,13 +12081,13 @@ var BaseUserProfile = ({
|
|
|
11193
12081
|
...schema,
|
|
11194
12082
|
value
|
|
11195
12083
|
};
|
|
11196
|
-
return /* @__PURE__ */
|
|
12084
|
+
return /* @__PURE__ */ jsx88("div", { className: styles.info, children: renderUserInfo(schemaWithValue) }, schema.name || index);
|
|
11197
12085
|
}) : renderProfileWithoutSchemas() })
|
|
11198
12086
|
] });
|
|
11199
12087
|
if (mode === "popup") {
|
|
11200
|
-
return /* @__PURE__ */
|
|
11201
|
-
/* @__PURE__ */
|
|
11202
|
-
/* @__PURE__ */
|
|
12088
|
+
return /* @__PURE__ */ jsx88(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs38(Dialog_default.Content, { children: [
|
|
12089
|
+
/* @__PURE__ */ jsx88(Dialog_default.Heading, { children: title ?? t("user.profile.heading") }),
|
|
12090
|
+
/* @__PURE__ */ jsx88("div", { className: styles.popup, children: profileContent })
|
|
11203
12091
|
] }) });
|
|
11204
12092
|
}
|
|
11205
12093
|
return profileContent;
|
|
@@ -11207,7 +12095,7 @@ var BaseUserProfile = ({
|
|
|
11207
12095
|
var BaseUserProfile_default = BaseUserProfile;
|
|
11208
12096
|
|
|
11209
12097
|
// src/components/presentation/UserProfile/UserProfile.tsx
|
|
11210
|
-
import { useState as
|
|
12098
|
+
import { useState as useState23 } from "react";
|
|
11211
12099
|
|
|
11212
12100
|
// src/api/updateMeProfile.ts
|
|
11213
12101
|
import {
|
|
@@ -11240,12 +12128,12 @@ var updateMeProfile_default = updateMeProfile;
|
|
|
11240
12128
|
|
|
11241
12129
|
// src/components/presentation/UserProfile/UserProfile.tsx
|
|
11242
12130
|
import { AsgardeoError } from "@asgardeo/browser";
|
|
11243
|
-
import { jsx as
|
|
12131
|
+
import { jsx as jsx89 } from "react/jsx-runtime";
|
|
11244
12132
|
var UserProfile3 = ({ ...rest }) => {
|
|
11245
12133
|
const { baseUrl, isLoading } = useAsgardeo_default();
|
|
11246
12134
|
const { profile, flattenedProfile, schemas, onUpdateProfile } = useUser_default();
|
|
11247
12135
|
const { t } = useTranslation_default();
|
|
11248
|
-
const [error, setError] =
|
|
12136
|
+
const [error, setError] = useState23(null);
|
|
11249
12137
|
const handleProfileUpdate = async (payload) => {
|
|
11250
12138
|
setError(null);
|
|
11251
12139
|
try {
|
|
@@ -11259,7 +12147,7 @@ var UserProfile3 = ({ ...rest }) => {
|
|
|
11259
12147
|
setError(message);
|
|
11260
12148
|
}
|
|
11261
12149
|
};
|
|
11262
|
-
return /* @__PURE__ */
|
|
12150
|
+
return /* @__PURE__ */ jsx89(
|
|
11263
12151
|
BaseUserProfile_default,
|
|
11264
12152
|
{
|
|
11265
12153
|
profile,
|
|
@@ -11288,15 +12176,15 @@ import {
|
|
|
11288
12176
|
FloatingFocusManager as FloatingFocusManager2,
|
|
11289
12177
|
FloatingPortal as FloatingPortal2
|
|
11290
12178
|
} from "@floating-ui/react";
|
|
11291
|
-
import { cx as
|
|
11292
|
-
import { useState as
|
|
12179
|
+
import { cx as cx29 } from "@emotion/css";
|
|
12180
|
+
import { useState as useState24 } from "react";
|
|
11293
12181
|
|
|
11294
12182
|
// src/components/presentation/UserDropdown/BaseUserDropdown.styles.ts
|
|
11295
|
-
import { css as
|
|
11296
|
-
import { useMemo as
|
|
11297
|
-
var
|
|
11298
|
-
return
|
|
11299
|
-
const trigger =
|
|
12183
|
+
import { css as css24 } from "@emotion/css";
|
|
12184
|
+
import { useMemo as useMemo33 } from "react";
|
|
12185
|
+
var useStyles24 = (theme, colorScheme) => {
|
|
12186
|
+
return useMemo33(() => {
|
|
12187
|
+
const trigger = css24`
|
|
11300
12188
|
display: inline-flex;
|
|
11301
12189
|
align-items: center;
|
|
11302
12190
|
gap: calc(${theme.vars.spacing.unit} * 0.75);
|
|
@@ -11323,7 +12211,7 @@ var useStyles22 = (theme, colorScheme) => {
|
|
|
11323
12211
|
box-shadow: none;
|
|
11324
12212
|
}
|
|
11325
12213
|
`;
|
|
11326
|
-
const userName =
|
|
12214
|
+
const userName = css24`
|
|
11327
12215
|
color: ${theme.vars.colors.text.primary};
|
|
11328
12216
|
font-size: 0.875rem;
|
|
11329
12217
|
font-weight: 500;
|
|
@@ -11332,7 +12220,7 @@ var useStyles22 = (theme, colorScheme) => {
|
|
|
11332
12220
|
text-overflow: ellipsis;
|
|
11333
12221
|
white-space: nowrap;
|
|
11334
12222
|
`;
|
|
11335
|
-
const dropdownContent =
|
|
12223
|
+
const dropdownContent = css24`
|
|
11336
12224
|
background: ${theme.vars.colors.background.surface};
|
|
11337
12225
|
border-radius: ${theme.vars.borderRadius.large};
|
|
11338
12226
|
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
|
|
@@ -11342,12 +12230,12 @@ var useStyles22 = (theme, colorScheme) => {
|
|
|
11342
12230
|
z-index: 1000;
|
|
11343
12231
|
overflow: hidden;
|
|
11344
12232
|
`;
|
|
11345
|
-
const dropdownMenu =
|
|
12233
|
+
const dropdownMenu = css24`
|
|
11346
12234
|
display: flex;
|
|
11347
12235
|
flex-direction: column;
|
|
11348
12236
|
width: 100%;
|
|
11349
12237
|
`;
|
|
11350
|
-
const menuItem =
|
|
12238
|
+
const menuItem = css24`
|
|
11351
12239
|
display: flex;
|
|
11352
12240
|
align-items: center;
|
|
11353
12241
|
justify-content: flex-start;
|
|
@@ -11375,7 +12263,7 @@ var useStyles22 = (theme, colorScheme) => {
|
|
|
11375
12263
|
box-shadow: none;
|
|
11376
12264
|
}
|
|
11377
12265
|
`;
|
|
11378
|
-
const menuItemAnchor =
|
|
12266
|
+
const menuItemAnchor = css24`
|
|
11379
12267
|
display: flex;
|
|
11380
12268
|
align-items: center;
|
|
11381
12269
|
justify-content: flex-start;
|
|
@@ -11396,18 +12284,18 @@ var useStyles22 = (theme, colorScheme) => {
|
|
|
11396
12284
|
background-color: ${theme.vars.colors.action?.hover || "rgba(0, 0, 0, 0.05)"};
|
|
11397
12285
|
}
|
|
11398
12286
|
`;
|
|
11399
|
-
const divider =
|
|
12287
|
+
const divider = css24`
|
|
11400
12288
|
margin: calc(${theme.vars.spacing.unit} * 0.5) 0;
|
|
11401
12289
|
border-bottom: 1px solid ${theme.vars.colors.border};
|
|
11402
12290
|
`;
|
|
11403
|
-
const dropdownHeader =
|
|
12291
|
+
const dropdownHeader = css24`
|
|
11404
12292
|
display: flex;
|
|
11405
12293
|
align-items: center;
|
|
11406
12294
|
gap: ${theme.vars.spacing.unit};
|
|
11407
12295
|
padding: calc(${theme.vars.spacing.unit} * 1.5);
|
|
11408
12296
|
border-bottom: 1px solid ${theme.vars.colors.border};
|
|
11409
12297
|
`;
|
|
11410
|
-
const headerInfo =
|
|
12298
|
+
const headerInfo = css24`
|
|
11411
12299
|
display: flex;
|
|
11412
12300
|
flex-direction: column;
|
|
11413
12301
|
gap: calc(${theme.vars.spacing.unit} / 4);
|
|
@@ -11417,7 +12305,7 @@ var useStyles22 = (theme, colorScheme) => {
|
|
|
11417
12305
|
text-overflow: ellipsis;
|
|
11418
12306
|
white-space: nowrap;
|
|
11419
12307
|
`;
|
|
11420
|
-
const headerName =
|
|
12308
|
+
const headerName = css24`
|
|
11421
12309
|
color: ${theme.vars.colors.text.primary};
|
|
11422
12310
|
font-size: 1rem;
|
|
11423
12311
|
font-weight: 500;
|
|
@@ -11426,7 +12314,7 @@ var useStyles22 = (theme, colorScheme) => {
|
|
|
11426
12314
|
text-overflow: ellipsis;
|
|
11427
12315
|
white-space: nowrap;
|
|
11428
12316
|
`;
|
|
11429
|
-
const headerEmail =
|
|
12317
|
+
const headerEmail = css24`
|
|
11430
12318
|
color: ${theme.vars.colors.text.secondary};
|
|
11431
12319
|
font-size: 0.875rem;
|
|
11432
12320
|
margin: 0;
|
|
@@ -11434,14 +12322,14 @@ var useStyles22 = (theme, colorScheme) => {
|
|
|
11434
12322
|
text-overflow: ellipsis;
|
|
11435
12323
|
white-space: nowrap;
|
|
11436
12324
|
`;
|
|
11437
|
-
const loadingContainer =
|
|
12325
|
+
const loadingContainer = css24`
|
|
11438
12326
|
display: flex;
|
|
11439
12327
|
align-items: center;
|
|
11440
12328
|
justify-content: center;
|
|
11441
12329
|
min-height: 80px;
|
|
11442
12330
|
gap: ${theme.vars.spacing.unit};
|
|
11443
12331
|
`;
|
|
11444
|
-
const loadingText =
|
|
12332
|
+
const loadingText = css24`
|
|
11445
12333
|
color: ${theme.vars.colors.text.secondary};
|
|
11446
12334
|
font-size: 0.875rem;
|
|
11447
12335
|
`;
|
|
@@ -11473,10 +12361,10 @@ var useStyles22 = (theme, colorScheme) => {
|
|
|
11473
12361
|
colorScheme
|
|
11474
12362
|
]);
|
|
11475
12363
|
};
|
|
11476
|
-
var BaseUserDropdown_styles_default =
|
|
12364
|
+
var BaseUserDropdown_styles_default = useStyles24;
|
|
11477
12365
|
|
|
11478
12366
|
// src/components/presentation/UserDropdown/BaseUserDropdown.tsx
|
|
11479
|
-
import { jsx as
|
|
12367
|
+
import { jsx as jsx90, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
11480
12368
|
var BaseUserDropdown = ({
|
|
11481
12369
|
fallback = null,
|
|
11482
12370
|
className = "",
|
|
@@ -11492,8 +12380,8 @@ var BaseUserDropdown = ({
|
|
|
11492
12380
|
}) => {
|
|
11493
12381
|
const { theme, colorScheme } = useTheme_default();
|
|
11494
12382
|
const styles = BaseUserDropdown_styles_default(theme, colorScheme);
|
|
11495
|
-
const [isOpen, setIsOpen] =
|
|
11496
|
-
const [hoveredItemIndex, setHoveredItemIndex] =
|
|
12383
|
+
const [isOpen, setIsOpen] = useState24(false);
|
|
12384
|
+
const [hoveredItemIndex, setHoveredItemIndex] = useState24(null);
|
|
11497
12385
|
const { refs, floatingStyles, context } = useFloating2({
|
|
11498
12386
|
open: isOpen,
|
|
11499
12387
|
onOpenChange: setIsOpen,
|
|
@@ -11530,14 +12418,14 @@ var BaseUserDropdown = ({
|
|
|
11530
12418
|
defaultMenuItems.push({
|
|
11531
12419
|
label: "Manage Profile",
|
|
11532
12420
|
onClick: onManageProfile,
|
|
11533
|
-
icon: /* @__PURE__ */
|
|
12421
|
+
icon: /* @__PURE__ */ jsx90(User_default2, { width: "16", height: "16" })
|
|
11534
12422
|
});
|
|
11535
12423
|
}
|
|
11536
12424
|
if (onSignOut) {
|
|
11537
12425
|
defaultMenuItems.push({
|
|
11538
12426
|
label: "Sign Out",
|
|
11539
12427
|
onClick: onSignOut,
|
|
11540
|
-
icon: /* @__PURE__ */
|
|
12428
|
+
icon: /* @__PURE__ */ jsx90(LogOut_default, { width: "16", height: "16" })
|
|
11541
12429
|
});
|
|
11542
12430
|
}
|
|
11543
12431
|
const allMenuItems = [...menuItems];
|
|
@@ -11547,18 +12435,18 @@ var BaseUserDropdown = ({
|
|
|
11547
12435
|
}
|
|
11548
12436
|
allMenuItems.push(...defaultMenuItems);
|
|
11549
12437
|
}
|
|
11550
|
-
return /* @__PURE__ */
|
|
11551
|
-
/* @__PURE__ */
|
|
12438
|
+
return /* @__PURE__ */ jsxs39("div", { className: cx29(withVendorCSSClassPrefix28("user-dropdown"), className), children: [
|
|
12439
|
+
/* @__PURE__ */ jsxs39(
|
|
11552
12440
|
Button_default,
|
|
11553
12441
|
{
|
|
11554
12442
|
ref: refs.setReference,
|
|
11555
|
-
className:
|
|
12443
|
+
className: cx29(withVendorCSSClassPrefix28("user-dropdown__trigger"), styles.trigger),
|
|
11556
12444
|
color: "tertiary",
|
|
11557
12445
|
variant: "text",
|
|
11558
12446
|
size: "medium",
|
|
11559
12447
|
...getReferenceProps(),
|
|
11560
12448
|
children: [
|
|
11561
|
-
/* @__PURE__ */
|
|
12449
|
+
/* @__PURE__ */ jsx90(
|
|
11562
12450
|
Avatar,
|
|
11563
12451
|
{
|
|
11564
12452
|
imageUrl: getMappedUserProfileValue_default("picture", mergedMappings, user),
|
|
@@ -11567,22 +12455,22 @@ var BaseUserDropdown = ({
|
|
|
11567
12455
|
alt: `${getDisplayName_default(mergedMappings, user)}'s avatar`
|
|
11568
12456
|
}
|
|
11569
12457
|
),
|
|
11570
|
-
showTriggerLabel && /* @__PURE__ */
|
|
12458
|
+
showTriggerLabel && /* @__PURE__ */ jsx90(
|
|
11571
12459
|
Typography_default,
|
|
11572
12460
|
{
|
|
11573
12461
|
variant: "body2",
|
|
11574
|
-
className:
|
|
12462
|
+
className: cx29(withVendorCSSClassPrefix28("user-dropdown__trigger-label"), styles.userName),
|
|
11575
12463
|
children: getDisplayName_default(mergedMappings, user)
|
|
11576
12464
|
}
|
|
11577
12465
|
)
|
|
11578
12466
|
]
|
|
11579
12467
|
}
|
|
11580
12468
|
),
|
|
11581
|
-
isOpen && /* @__PURE__ */
|
|
12469
|
+
isOpen && /* @__PURE__ */ jsx90(FloatingPortal2, { id: portalId, children: /* @__PURE__ */ jsx90(FloatingFocusManager2, { context, modal: false, initialFocus: -1, children: /* @__PURE__ */ jsxs39(
|
|
11582
12470
|
"div",
|
|
11583
12471
|
{
|
|
11584
12472
|
ref: refs.setFloating,
|
|
11585
|
-
className:
|
|
12473
|
+
className: cx29(withVendorCSSClassPrefix28("user-dropdown__content"), styles.dropdownContent),
|
|
11586
12474
|
style: {
|
|
11587
12475
|
...floatingStyles,
|
|
11588
12476
|
// Floating UI doesn't set a z-index by default, so we set a high value to ensure the dropdown appears above other elements.
|
|
@@ -11591,8 +12479,8 @@ var BaseUserDropdown = ({
|
|
|
11591
12479
|
},
|
|
11592
12480
|
...getFloatingProps(),
|
|
11593
12481
|
children: [
|
|
11594
|
-
/* @__PURE__ */
|
|
11595
|
-
/* @__PURE__ */
|
|
12482
|
+
/* @__PURE__ */ jsxs39("div", { className: cx29(withVendorCSSClassPrefix28("user-dropdown__header"), styles.dropdownHeader), children: [
|
|
12483
|
+
/* @__PURE__ */ jsx90(
|
|
11596
12484
|
Avatar,
|
|
11597
12485
|
{
|
|
11598
12486
|
imageUrl: getMappedUserProfileValue_default("picture", mergedMappings, user),
|
|
@@ -11601,8 +12489,8 @@ var BaseUserDropdown = ({
|
|
|
11601
12489
|
alt: `${getDisplayName_default(mergedMappings, user)}'s avatar`
|
|
11602
12490
|
}
|
|
11603
12491
|
),
|
|
11604
|
-
/* @__PURE__ */
|
|
11605
|
-
/* @__PURE__ */
|
|
12492
|
+
/* @__PURE__ */ jsxs39("div", { className: cx29(withVendorCSSClassPrefix28("user-dropdown__header-info"), styles.headerInfo), children: [
|
|
12493
|
+
/* @__PURE__ */ jsx90(
|
|
11606
12494
|
Typography_default,
|
|
11607
12495
|
{
|
|
11608
12496
|
noWrap: true,
|
|
@@ -11612,7 +12500,7 @@ var BaseUserDropdown = ({
|
|
|
11612
12500
|
children: getDisplayName_default(mergedMappings, user)
|
|
11613
12501
|
}
|
|
11614
12502
|
),
|
|
11615
|
-
/* @__PURE__ */
|
|
12503
|
+
/* @__PURE__ */ jsx90(
|
|
11616
12504
|
Typography_default,
|
|
11617
12505
|
{
|
|
11618
12506
|
noWrap: true,
|
|
@@ -11624,31 +12512,31 @@ var BaseUserDropdown = ({
|
|
|
11624
12512
|
)
|
|
11625
12513
|
] })
|
|
11626
12514
|
] }),
|
|
11627
|
-
/* @__PURE__ */
|
|
12515
|
+
/* @__PURE__ */ jsx90("div", { className: cx29(withVendorCSSClassPrefix28("user-dropdown__menu"), styles.dropdownMenu), children: allMenuItems.map((item, index) => /* @__PURE__ */ jsx90("div", { children: item.label === "" ? /* @__PURE__ */ jsx90("div", { className: cx29(withVendorCSSClassPrefix28("user-dropdown__menu-divider"), styles.divider) }) : item.href ? /* @__PURE__ */ jsxs39(
|
|
11628
12516
|
"a",
|
|
11629
12517
|
{
|
|
11630
12518
|
href: item.href,
|
|
11631
12519
|
style: {
|
|
11632
12520
|
backgroundColor: hoveredItemIndex === index ? theme.vars.colors.action?.hover : "transparent"
|
|
11633
12521
|
},
|
|
11634
|
-
className:
|
|
12522
|
+
className: cx29(withVendorCSSClassPrefix28("user-dropdown__menu-item"), styles.menuItemAnchor),
|
|
11635
12523
|
onMouseEnter: () => setHoveredItemIndex(index),
|
|
11636
12524
|
onMouseLeave: () => setHoveredItemIndex(null),
|
|
11637
12525
|
onFocus: () => setHoveredItemIndex(index),
|
|
11638
12526
|
onBlur: () => setHoveredItemIndex(null),
|
|
11639
12527
|
children: [
|
|
11640
12528
|
item.icon,
|
|
11641
|
-
/* @__PURE__ */
|
|
12529
|
+
/* @__PURE__ */ jsx90("span", { children: item.label })
|
|
11642
12530
|
]
|
|
11643
12531
|
}
|
|
11644
|
-
) : /* @__PURE__ */
|
|
12532
|
+
) : /* @__PURE__ */ jsx90(
|
|
11645
12533
|
Button_default,
|
|
11646
12534
|
{
|
|
11647
12535
|
onClick: () => handleMenuItemClick(item),
|
|
11648
12536
|
style: {
|
|
11649
12537
|
backgroundColor: hoveredItemIndex === index ? theme.vars.colors.action?.hover : "transparent"
|
|
11650
12538
|
},
|
|
11651
|
-
className:
|
|
12539
|
+
className: cx29(withVendorCSSClassPrefix28("user-dropdown__menu-item"), styles.menuItem),
|
|
11652
12540
|
color: "tertiary",
|
|
11653
12541
|
variant: "text",
|
|
11654
12542
|
size: "small",
|
|
@@ -11666,8 +12554,8 @@ var BaseUserDropdown = ({
|
|
|
11666
12554
|
var BaseUserDropdown_default = BaseUserDropdown;
|
|
11667
12555
|
|
|
11668
12556
|
// src/components/presentation/UserDropdown/UserDropdown.tsx
|
|
11669
|
-
import { useState as
|
|
11670
|
-
import { Fragment as Fragment16, jsx as
|
|
12557
|
+
import { useState as useState25 } from "react";
|
|
12558
|
+
import { Fragment as Fragment16, jsx as jsx91, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
11671
12559
|
var UserDropdown = ({
|
|
11672
12560
|
children,
|
|
11673
12561
|
renderTrigger,
|
|
@@ -11676,7 +12564,7 @@ var UserDropdown = ({
|
|
|
11676
12564
|
...rest
|
|
11677
12565
|
}) => {
|
|
11678
12566
|
const { user, isLoading, signOut } = useAsgardeo_default();
|
|
11679
|
-
const [isProfileOpen, setIsProfileOpen] =
|
|
12567
|
+
const [isProfileOpen, setIsProfileOpen] = useState25(false);
|
|
11680
12568
|
const handleManageProfile = () => {
|
|
11681
12569
|
setIsProfileOpen(true);
|
|
11682
12570
|
};
|
|
@@ -11696,14 +12584,14 @@ var UserDropdown = ({
|
|
|
11696
12584
|
closeProfile
|
|
11697
12585
|
};
|
|
11698
12586
|
if (children) {
|
|
11699
|
-
return /* @__PURE__ */
|
|
12587
|
+
return /* @__PURE__ */ jsxs40(Fragment16, { children: [
|
|
11700
12588
|
children(renderProps),
|
|
11701
|
-
/* @__PURE__ */
|
|
12589
|
+
/* @__PURE__ */ jsx91(UserProfile_default, { mode: "popup", open: isProfileOpen, onOpenChange: setIsProfileOpen })
|
|
11702
12590
|
] });
|
|
11703
12591
|
}
|
|
11704
12592
|
if (renderTrigger || renderDropdown) {
|
|
11705
|
-
return /* @__PURE__ */
|
|
11706
|
-
renderTrigger ? renderTrigger(renderProps) : /* @__PURE__ */
|
|
12593
|
+
return /* @__PURE__ */ jsxs40(Fragment16, { children: [
|
|
12594
|
+
renderTrigger ? renderTrigger(renderProps) : /* @__PURE__ */ jsx91(
|
|
11707
12595
|
BaseUserDropdown_default,
|
|
11708
12596
|
{
|
|
11709
12597
|
user,
|
|
@@ -11713,11 +12601,11 @@ var UserDropdown = ({
|
|
|
11713
12601
|
...rest
|
|
11714
12602
|
}
|
|
11715
12603
|
),
|
|
11716
|
-
/* @__PURE__ */
|
|
12604
|
+
/* @__PURE__ */ jsx91(UserProfile_default, { mode: "popup", open: isProfileOpen, onOpenChange: setIsProfileOpen })
|
|
11717
12605
|
] });
|
|
11718
12606
|
}
|
|
11719
|
-
return /* @__PURE__ */
|
|
11720
|
-
/* @__PURE__ */
|
|
12607
|
+
return /* @__PURE__ */ jsxs40(Fragment16, { children: [
|
|
12608
|
+
/* @__PURE__ */ jsx91(
|
|
11721
12609
|
BaseUserDropdown_default,
|
|
11722
12610
|
{
|
|
11723
12611
|
user,
|
|
@@ -11727,7 +12615,7 @@ var UserDropdown = ({
|
|
|
11727
12615
|
...rest
|
|
11728
12616
|
}
|
|
11729
12617
|
),
|
|
11730
|
-
isProfileOpen && /* @__PURE__ */
|
|
12618
|
+
isProfileOpen && /* @__PURE__ */ jsx91(UserProfile_default, { mode: "popup", open: isProfileOpen, onOpenChange: setIsProfileOpen })
|
|
11731
12619
|
] });
|
|
11732
12620
|
};
|
|
11733
12621
|
var UserDropdown_default = UserDropdown;
|
|
@@ -11746,13 +12634,13 @@ import {
|
|
|
11746
12634
|
FloatingFocusManager as FloatingFocusManager3,
|
|
11747
12635
|
FloatingPortal as FloatingPortal3
|
|
11748
12636
|
} from "@floating-ui/react";
|
|
11749
|
-
import { cx as
|
|
11750
|
-
import { useState as
|
|
12637
|
+
import { cx as cx30 } from "@emotion/css";
|
|
12638
|
+
import { useState as useState26 } from "react";
|
|
11751
12639
|
|
|
11752
12640
|
// src/components/primitives/Icons/Building.tsx
|
|
11753
|
-
import { jsx as
|
|
11754
|
-
var Building = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */
|
|
11755
|
-
/* @__PURE__ */
|
|
12641
|
+
import { jsx as jsx92, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
12642
|
+
var Building = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */ jsxs41("svg", { width, height, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
12643
|
+
/* @__PURE__ */ jsx92(
|
|
11756
12644
|
"path",
|
|
11757
12645
|
{
|
|
11758
12646
|
d: "M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",
|
|
@@ -11762,38 +12650,38 @@ var Building = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PU
|
|
|
11762
12650
|
strokeLinejoin: "round"
|
|
11763
12651
|
}
|
|
11764
12652
|
),
|
|
11765
|
-
/* @__PURE__ */
|
|
11766
|
-
/* @__PURE__ */
|
|
11767
|
-
/* @__PURE__ */
|
|
11768
|
-
/* @__PURE__ */
|
|
11769
|
-
/* @__PURE__ */
|
|
11770
|
-
/* @__PURE__ */
|
|
12653
|
+
/* @__PURE__ */ jsx92("path", { d: "M6 12h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
12654
|
+
/* @__PURE__ */ jsx92("path", { d: "M6 8h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
12655
|
+
/* @__PURE__ */ jsx92("path", { d: "M14 8h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
12656
|
+
/* @__PURE__ */ jsx92("path", { d: "M14 12h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
12657
|
+
/* @__PURE__ */ jsx92("path", { d: "M6 18h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
12658
|
+
/* @__PURE__ */ jsx92("path", { d: "M14 18h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
11771
12659
|
] });
|
|
11772
12660
|
Building.displayName = "Building";
|
|
11773
12661
|
var Building_default = Building;
|
|
11774
12662
|
|
|
11775
12663
|
// src/components/primitives/Icons/Check.tsx
|
|
11776
|
-
import { jsx as
|
|
11777
|
-
var Check = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */
|
|
12664
|
+
import { jsx as jsx93 } from "react/jsx-runtime";
|
|
12665
|
+
var Check = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */ jsx93("svg", { width, height, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx93("path", { d: "M20 6 9 17l-5-5", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
11778
12666
|
Check.displayName = "Check";
|
|
11779
12667
|
var Check_default = Check;
|
|
11780
12668
|
|
|
11781
12669
|
// src/components/primitives/Icons/ChevronDown.tsx
|
|
11782
|
-
import { jsx as
|
|
11783
|
-
var ChevronDown = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */
|
|
12670
|
+
import { jsx as jsx94 } from "react/jsx-runtime";
|
|
12671
|
+
var ChevronDown = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */ jsx94("svg", { width, height, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx94("path", { d: "m6 9 6 6 6-6", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
11784
12672
|
ChevronDown.displayName = "ChevronDown";
|
|
11785
12673
|
var ChevronDown_default = ChevronDown;
|
|
11786
12674
|
|
|
11787
12675
|
// src/components/presentation/OrganizationSwitcher/BaseOrganizationSwitcher.styles.ts
|
|
11788
|
-
import { css as
|
|
11789
|
-
import { useMemo as
|
|
11790
|
-
var
|
|
11791
|
-
return
|
|
11792
|
-
const root =
|
|
12676
|
+
import { css as css25 } from "@emotion/css";
|
|
12677
|
+
import { useMemo as useMemo34 } from "react";
|
|
12678
|
+
var useStyles25 = (theme, colorScheme) => {
|
|
12679
|
+
return useMemo34(() => {
|
|
12680
|
+
const root = css25`
|
|
11793
12681
|
display: inline-block;
|
|
11794
12682
|
position: relative;
|
|
11795
12683
|
`;
|
|
11796
|
-
const trigger =
|
|
12684
|
+
const trigger = css25`
|
|
11797
12685
|
display: inline-flex;
|
|
11798
12686
|
align-items: center;
|
|
11799
12687
|
gap: ${theme.vars.spacing.unit};
|
|
@@ -11813,7 +12701,7 @@ var useStyles23 = (theme, colorScheme) => {
|
|
|
11813
12701
|
background-color: ${theme.vars.colors.background.surface};
|
|
11814
12702
|
}
|
|
11815
12703
|
`;
|
|
11816
|
-
const triggerLabel =
|
|
12704
|
+
const triggerLabel = css25`
|
|
11817
12705
|
color: ${theme.vars.colors.text.primary};
|
|
11818
12706
|
font-weight: 500;
|
|
11819
12707
|
overflow: hidden;
|
|
@@ -11821,7 +12709,7 @@ var useStyles23 = (theme, colorScheme) => {
|
|
|
11821
12709
|
white-space: nowrap;
|
|
11822
12710
|
flex: 1;
|
|
11823
12711
|
`;
|
|
11824
|
-
const content =
|
|
12712
|
+
const content = css25`
|
|
11825
12713
|
min-width: 280px;
|
|
11826
12714
|
max-width: 400px;
|
|
11827
12715
|
background-color: ${theme.vars.colors.background.surface};
|
|
@@ -11831,13 +12719,13 @@ var useStyles23 = (theme, colorScheme) => {
|
|
|
11831
12719
|
outline: none;
|
|
11832
12720
|
z-index: 1000;
|
|
11833
12721
|
`;
|
|
11834
|
-
const header =
|
|
12722
|
+
const header = css25`
|
|
11835
12723
|
display: flex;
|
|
11836
12724
|
align-items: center;
|
|
11837
12725
|
gap: ${theme.vars.spacing.unit};
|
|
11838
12726
|
padding: ${theme.vars.spacing.unit} calc(${theme.vars.spacing.unit} * 2);
|
|
11839
12727
|
`;
|
|
11840
|
-
const headerInfo =
|
|
12728
|
+
const headerInfo = css25`
|
|
11841
12729
|
display: flex;
|
|
11842
12730
|
flex-direction: column;
|
|
11843
12731
|
gap: calc(${theme.vars.spacing.unit} / 4);
|
|
@@ -11845,7 +12733,7 @@ var useStyles23 = (theme, colorScheme) => {
|
|
|
11845
12733
|
min-width: 0;
|
|
11846
12734
|
overflow: hidden;
|
|
11847
12735
|
`;
|
|
11848
|
-
const headerName =
|
|
12736
|
+
const headerName = css25`
|
|
11849
12737
|
color: ${theme.vars.colors.text.primary};
|
|
11850
12738
|
font-size: 0.875rem;
|
|
11851
12739
|
font-weight: 500;
|
|
@@ -11854,7 +12742,7 @@ var useStyles23 = (theme, colorScheme) => {
|
|
|
11854
12742
|
text-overflow: ellipsis;
|
|
11855
12743
|
white-space: nowrap;
|
|
11856
12744
|
`;
|
|
11857
|
-
const headerMeta =
|
|
12745
|
+
const headerMeta = css25`
|
|
11858
12746
|
color: ${theme.vars.colors.text.secondary};
|
|
11859
12747
|
font-size: 0.75rem;
|
|
11860
12748
|
margin: 0;
|
|
@@ -11862,7 +12750,7 @@ var useStyles23 = (theme, colorScheme) => {
|
|
|
11862
12750
|
text-overflow: ellipsis;
|
|
11863
12751
|
white-space: nowrap;
|
|
11864
12752
|
`;
|
|
11865
|
-
const headerRole =
|
|
12753
|
+
const headerRole = css25`
|
|
11866
12754
|
color: ${theme.vars.colors.text.secondary};
|
|
11867
12755
|
font-size: 0.75rem;
|
|
11868
12756
|
margin: 0;
|
|
@@ -11871,16 +12759,16 @@ var useStyles23 = (theme, colorScheme) => {
|
|
|
11871
12759
|
white-space: nowrap;
|
|
11872
12760
|
text-transform: capitalize;
|
|
11873
12761
|
`;
|
|
11874
|
-
const manageButton =
|
|
12762
|
+
const manageButton = css25`
|
|
11875
12763
|
min-width: auto;
|
|
11876
12764
|
margin-inline-start: auto;
|
|
11877
12765
|
`;
|
|
11878
|
-
const menu =
|
|
12766
|
+
const menu = css25`
|
|
11879
12767
|
display: flex;
|
|
11880
12768
|
flex-direction: column;
|
|
11881
12769
|
width: 100%;
|
|
11882
12770
|
`;
|
|
11883
|
-
const menuItem =
|
|
12771
|
+
const menuItem = css25`
|
|
11884
12772
|
display: flex;
|
|
11885
12773
|
align-items: center;
|
|
11886
12774
|
justify-content: flex-start;
|
|
@@ -11905,11 +12793,11 @@ var useStyles23 = (theme, colorScheme) => {
|
|
|
11905
12793
|
background-color: ${theme.vars.colors.action?.hover || "rgba(0, 0, 0, 0.04)"};
|
|
11906
12794
|
}
|
|
11907
12795
|
`;
|
|
11908
|
-
const menuDivider =
|
|
12796
|
+
const menuDivider = css25`
|
|
11909
12797
|
margin: calc(${theme.vars.spacing.unit} * 0.5) 0;
|
|
11910
12798
|
border-bottom: 1px solid ${theme.vars.colors.border};
|
|
11911
12799
|
`;
|
|
11912
|
-
const organizationInfo =
|
|
12800
|
+
const organizationInfo = css25`
|
|
11913
12801
|
display: flex;
|
|
11914
12802
|
flex-direction: column;
|
|
11915
12803
|
gap: calc(${theme.vars.spacing.unit} / 4);
|
|
@@ -11917,7 +12805,7 @@ var useStyles23 = (theme, colorScheme) => {
|
|
|
11917
12805
|
min-width: 0;
|
|
11918
12806
|
overflow: hidden;
|
|
11919
12807
|
`;
|
|
11920
|
-
const organizationName =
|
|
12808
|
+
const organizationName = css25`
|
|
11921
12809
|
color: ${theme.vars.colors.text.primary};
|
|
11922
12810
|
font-size: 0.875rem;
|
|
11923
12811
|
font-weight: 500;
|
|
@@ -11926,7 +12814,7 @@ var useStyles23 = (theme, colorScheme) => {
|
|
|
11926
12814
|
text-overflow: ellipsis;
|
|
11927
12815
|
white-space: nowrap;
|
|
11928
12816
|
`;
|
|
11929
|
-
const organizationMeta =
|
|
12817
|
+
const organizationMeta = css25`
|
|
11930
12818
|
color: ${theme.vars.colors.text.secondary};
|
|
11931
12819
|
font-size: 0.75rem;
|
|
11932
12820
|
margin: 0;
|
|
@@ -11934,40 +12822,40 @@ var useStyles23 = (theme, colorScheme) => {
|
|
|
11934
12822
|
text-overflow: ellipsis;
|
|
11935
12823
|
white-space: nowrap;
|
|
11936
12824
|
`;
|
|
11937
|
-
const loadingContainer =
|
|
12825
|
+
const loadingContainer = css25`
|
|
11938
12826
|
display: flex;
|
|
11939
12827
|
align-items: center;
|
|
11940
12828
|
justify-content: center;
|
|
11941
12829
|
min-height: 80px;
|
|
11942
12830
|
gap: ${theme.vars.spacing.unit};
|
|
11943
12831
|
`;
|
|
11944
|
-
const loadingText =
|
|
12832
|
+
const loadingText = css25`
|
|
11945
12833
|
color: ${theme.vars.colors.text.secondary};
|
|
11946
12834
|
font-size: 0.875rem;
|
|
11947
12835
|
`;
|
|
11948
|
-
const errorContainer =
|
|
12836
|
+
const errorContainer = css25`
|
|
11949
12837
|
display: flex;
|
|
11950
12838
|
align-items: center;
|
|
11951
12839
|
justify-content: center;
|
|
11952
12840
|
min-height: 80px;
|
|
11953
12841
|
padding: calc(${theme.vars.spacing.unit} * 2);
|
|
11954
12842
|
`;
|
|
11955
|
-
const errorText =
|
|
12843
|
+
const errorText = css25`
|
|
11956
12844
|
color: ${theme.vars.colors.text.secondary};
|
|
11957
12845
|
font-size: 0.875rem;
|
|
11958
12846
|
text-align: center;
|
|
11959
12847
|
`;
|
|
11960
|
-
const sectionHeader =
|
|
12848
|
+
const sectionHeader = css25`
|
|
11961
12849
|
text-transform: uppercase;
|
|
11962
12850
|
letter-spacing: 0.05em;
|
|
11963
12851
|
color: ${theme.vars.colors.text.secondary};
|
|
11964
12852
|
`;
|
|
11965
|
-
const sectionHeaderContainer =
|
|
12853
|
+
const sectionHeaderContainer = css25`
|
|
11966
12854
|
border-top: none;
|
|
11967
12855
|
border-bottom: none;
|
|
11968
12856
|
padding-bottom: calc(${theme.vars.spacing.unit} / 2);
|
|
11969
12857
|
`;
|
|
11970
|
-
const roleCapitalized =
|
|
12858
|
+
const roleCapitalized = css25`
|
|
11971
12859
|
text-transform: capitalize;
|
|
11972
12860
|
`;
|
|
11973
12861
|
return {
|
|
@@ -12007,10 +12895,10 @@ var useStyles23 = (theme, colorScheme) => {
|
|
|
12007
12895
|
colorScheme
|
|
12008
12896
|
]);
|
|
12009
12897
|
};
|
|
12010
|
-
var BaseOrganizationSwitcher_styles_default =
|
|
12898
|
+
var BaseOrganizationSwitcher_styles_default = useStyles25;
|
|
12011
12899
|
|
|
12012
12900
|
// src/components/presentation/OrganizationSwitcher/BaseOrganizationSwitcher.tsx
|
|
12013
|
-
import { Fragment as Fragment17, jsx as
|
|
12901
|
+
import { Fragment as Fragment17, jsx as jsx95, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
12014
12902
|
var BaseOrganizationSwitcher = ({
|
|
12015
12903
|
organizations,
|
|
12016
12904
|
currentOrganization,
|
|
@@ -12033,8 +12921,8 @@ var BaseOrganizationSwitcher = ({
|
|
|
12033
12921
|
}) => {
|
|
12034
12922
|
const { theme, colorScheme, direction } = useTheme_default();
|
|
12035
12923
|
const styles = BaseOrganizationSwitcher_styles_default(theme, colorScheme);
|
|
12036
|
-
const [isOpen, setIsOpen] =
|
|
12037
|
-
const [hoveredItemIndex, setHoveredItemIndex] =
|
|
12924
|
+
const [isOpen, setIsOpen] = useState26(false);
|
|
12925
|
+
const [hoveredItemIndex, setHoveredItemIndex] = useState26(null);
|
|
12038
12926
|
const { t } = useTranslation_default();
|
|
12039
12927
|
const isRTL = direction === "rtl";
|
|
12040
12928
|
const { refs, floatingStyles, context } = useFloating3({
|
|
@@ -12064,8 +12952,8 @@ var BaseOrganizationSwitcher = ({
|
|
|
12064
12952
|
const switchableOrganizations = organizations.filter(
|
|
12065
12953
|
(org) => org.id !== currentOrganization?.id
|
|
12066
12954
|
);
|
|
12067
|
-
const defaultRenderOrganization2 = (organization, isSelected) => /* @__PURE__ */
|
|
12068
|
-
/* @__PURE__ */
|
|
12955
|
+
const defaultRenderOrganization2 = (organization, isSelected) => /* @__PURE__ */ jsxs42(Fragment17, { children: [
|
|
12956
|
+
/* @__PURE__ */ jsx95(
|
|
12069
12957
|
Avatar,
|
|
12070
12958
|
{
|
|
12071
12959
|
variant: "square",
|
|
@@ -12075,35 +12963,35 @@ var BaseOrganizationSwitcher = ({
|
|
|
12075
12963
|
alt: `${organization.name} avatar`
|
|
12076
12964
|
}
|
|
12077
12965
|
),
|
|
12078
|
-
/* @__PURE__ */
|
|
12079
|
-
/* @__PURE__ */
|
|
12080
|
-
/* @__PURE__ */
|
|
12081
|
-
showMemberCount && organization.memberCount !== void 0 && /* @__PURE__ */
|
|
12966
|
+
/* @__PURE__ */ jsxs42("div", { className: cx30(styles.organizationInfo), children: [
|
|
12967
|
+
/* @__PURE__ */ jsx95(Typography_default, { variant: "body2", fontWeight: "medium", className: cx30(styles.organizationName), children: organization.name }),
|
|
12968
|
+
/* @__PURE__ */ jsxs42("div", { className: cx30(styles.organizationMeta), children: [
|
|
12969
|
+
showMemberCount && organization.memberCount !== void 0 && /* @__PURE__ */ jsxs42("span", { children: [
|
|
12082
12970
|
organization.memberCount,
|
|
12083
12971
|
" ",
|
|
12084
12972
|
organization.memberCount === 1 ? t("organization.switcher.member") : t("organization.switcher.members")
|
|
12085
12973
|
] }),
|
|
12086
|
-
showRole && organization.role && showMemberCount && organization.memberCount !== void 0 && /* @__PURE__ */
|
|
12087
|
-
showRole && organization.role && /* @__PURE__ */
|
|
12974
|
+
showRole && organization.role && showMemberCount && organization.memberCount !== void 0 && /* @__PURE__ */ jsx95("span", { children: " \u2022 " }),
|
|
12975
|
+
showRole && organization.role && /* @__PURE__ */ jsx95("span", { className: cx30(styles.roleCapitalized), children: organization.role })
|
|
12088
12976
|
] })
|
|
12089
12977
|
] }),
|
|
12090
|
-
isSelected && /* @__PURE__ */
|
|
12978
|
+
isSelected && /* @__PURE__ */ jsx95(Check_default, { width: "16", height: "16", color: theme.vars.colors.text.primary })
|
|
12091
12979
|
] });
|
|
12092
|
-
const defaultRenderLoading2 = () => /* @__PURE__ */
|
|
12093
|
-
const defaultRenderError2 = (errorMessage) => /* @__PURE__ */
|
|
12094
|
-
return /* @__PURE__ */
|
|
12095
|
-
/* @__PURE__ */
|
|
12980
|
+
const defaultRenderLoading2 = () => /* @__PURE__ */ jsx95("div", { className: cx30(styles.loadingContainer), children: /* @__PURE__ */ jsx95(Typography_default, { variant: "caption", className: cx30(styles.loadingText), children: t("organization.switcher.loading.placeholder.organizations") }) });
|
|
12981
|
+
const defaultRenderError2 = (errorMessage) => /* @__PURE__ */ jsx95("div", { className: cx30(styles.errorContainer), children: /* @__PURE__ */ jsx95(Typography_default, { variant: "caption", className: cx30(styles.errorText), children: errorMessage }) });
|
|
12982
|
+
return /* @__PURE__ */ jsxs42("div", { className: cx30(styles.root, className), style, children: [
|
|
12983
|
+
/* @__PURE__ */ jsxs42(
|
|
12096
12984
|
Button_default,
|
|
12097
12985
|
{
|
|
12098
12986
|
ref: refs.setReference,
|
|
12099
|
-
className:
|
|
12987
|
+
className: cx30(styles.trigger),
|
|
12100
12988
|
color: "tertiary",
|
|
12101
12989
|
variant: "outline",
|
|
12102
12990
|
size: "medium",
|
|
12103
12991
|
...getReferenceProps(),
|
|
12104
12992
|
children: [
|
|
12105
|
-
currentOrganization ? /* @__PURE__ */
|
|
12106
|
-
/* @__PURE__ */
|
|
12993
|
+
currentOrganization ? /* @__PURE__ */ jsxs42(Fragment17, { children: [
|
|
12994
|
+
/* @__PURE__ */ jsx95(
|
|
12107
12995
|
Avatar,
|
|
12108
12996
|
{
|
|
12109
12997
|
variant: "square",
|
|
@@ -12113,18 +13001,18 @@ var BaseOrganizationSwitcher = ({
|
|
|
12113
13001
|
alt: `${currentOrganization.name} avatar`
|
|
12114
13002
|
}
|
|
12115
13003
|
),
|
|
12116
|
-
showTriggerLabel && /* @__PURE__ */
|
|
12117
|
-
] }) : /* @__PURE__ */
|
|
12118
|
-
/* @__PURE__ */
|
|
12119
|
-
showTriggerLabel && /* @__PURE__ */
|
|
13004
|
+
showTriggerLabel && /* @__PURE__ */ jsx95(Typography_default, { variant: "body2", className: cx30(styles.triggerLabel), children: currentOrganization.name })
|
|
13005
|
+
] }) : /* @__PURE__ */ jsxs42(Fragment17, { children: [
|
|
13006
|
+
/* @__PURE__ */ jsx95(Building_default, { width: avatarSize, height: avatarSize }),
|
|
13007
|
+
showTriggerLabel && /* @__PURE__ */ jsx95(Typography_default, { variant: "body2", className: cx30(styles.triggerLabel), children: t("elements.fields.organization.select.label") })
|
|
12120
13008
|
] }),
|
|
12121
|
-
/* @__PURE__ */
|
|
13009
|
+
/* @__PURE__ */ jsx95("span", { style: { transform: isRTL ? "scaleX(-1)" : "none", display: "inline-flex" }, children: /* @__PURE__ */ jsx95(ChevronDown_default, { width: "16", height: "16" }) })
|
|
12122
13010
|
]
|
|
12123
13011
|
}
|
|
12124
13012
|
),
|
|
12125
|
-
isOpen && /* @__PURE__ */
|
|
12126
|
-
currentOrganization && /* @__PURE__ */
|
|
12127
|
-
/* @__PURE__ */
|
|
13013
|
+
isOpen && /* @__PURE__ */ jsx95(FloatingPortal3, { id: portalId, children: /* @__PURE__ */ jsx95(FloatingFocusManager3, { context, modal: false, initialFocus: -1, children: /* @__PURE__ */ jsxs42("div", { ref: refs.setFloating, className: cx30(styles.content), style: floatingStyles, ...getFloatingProps(), children: [
|
|
13014
|
+
currentOrganization && /* @__PURE__ */ jsxs42("div", { className: cx30(styles.header), children: [
|
|
13015
|
+
/* @__PURE__ */ jsx95(
|
|
12128
13016
|
Avatar,
|
|
12129
13017
|
{
|
|
12130
13018
|
variant: "square",
|
|
@@ -12134,10 +13022,10 @@ var BaseOrganizationSwitcher = ({
|
|
|
12134
13022
|
alt: `${currentOrganization.name} avatar`
|
|
12135
13023
|
}
|
|
12136
13024
|
),
|
|
12137
|
-
/* @__PURE__ */
|
|
12138
|
-
/* @__PURE__ */
|
|
12139
|
-
/* @__PURE__ */
|
|
12140
|
-
showMemberCount && currentOrganization.memberCount !== void 0 && /* @__PURE__ */
|
|
13025
|
+
/* @__PURE__ */ jsxs42("div", { className: cx30(styles.headerInfo), children: [
|
|
13026
|
+
/* @__PURE__ */ jsx95(Typography_default, { noWrap: true, className: cx30(styles.headerName), variant: "body1", fontWeight: "medium", children: currentOrganization.name }),
|
|
13027
|
+
/* @__PURE__ */ jsxs42("div", { className: cx30(styles.headerMeta), children: [
|
|
13028
|
+
showMemberCount && currentOrganization.memberCount !== void 0 && /* @__PURE__ */ jsxs42(
|
|
12141
13029
|
Typography_default,
|
|
12142
13030
|
{
|
|
12143
13031
|
noWrap: true,
|
|
@@ -12147,17 +13035,17 @@ var BaseOrganizationSwitcher = ({
|
|
|
12147
13035
|
currentOrganization.memberCount,
|
|
12148
13036
|
" ",
|
|
12149
13037
|
currentOrganization.memberCount === 1 ? t("organization.switcher.member") : t("organization.switcher.members"),
|
|
12150
|
-
showRole && currentOrganization.role && /* @__PURE__ */
|
|
13038
|
+
showRole && currentOrganization.role && /* @__PURE__ */ jsxs42("span", { children: [
|
|
12151
13039
|
" \u2022 ",
|
|
12152
13040
|
currentOrganization.role
|
|
12153
13041
|
] })
|
|
12154
13042
|
]
|
|
12155
13043
|
}
|
|
12156
13044
|
),
|
|
12157
|
-
showRole && currentOrganization.role && (!showMemberCount || currentOrganization.memberCount === void 0) && /* @__PURE__ */
|
|
13045
|
+
showRole && currentOrganization.role && (!showMemberCount || currentOrganization.memberCount === void 0) && /* @__PURE__ */ jsx95(Typography_default, { noWrap: true, className: cx30(styles.headerRole), variant: "caption", color: "secondary", children: currentOrganization.role })
|
|
12158
13046
|
] })
|
|
12159
13047
|
] }),
|
|
12160
|
-
onManageProfile && /* @__PURE__ */
|
|
13048
|
+
onManageProfile && /* @__PURE__ */ jsx95(
|
|
12161
13049
|
Button_default,
|
|
12162
13050
|
{
|
|
12163
13051
|
onClick: onManageProfile,
|
|
@@ -12165,8 +13053,8 @@ var BaseOrganizationSwitcher = ({
|
|
|
12165
13053
|
variant: "outline",
|
|
12166
13054
|
size: "small",
|
|
12167
13055
|
"aria-label": "Manage Organization Profile",
|
|
12168
|
-
className:
|
|
12169
|
-
endIcon: /* @__PURE__ */
|
|
13056
|
+
className: cx30(styles.manageButton),
|
|
13057
|
+
endIcon: /* @__PURE__ */ jsxs42(
|
|
12170
13058
|
"svg",
|
|
12171
13059
|
{
|
|
12172
13060
|
width: "16",
|
|
@@ -12178,8 +13066,8 @@ var BaseOrganizationSwitcher = ({
|
|
|
12178
13066
|
strokeLinecap: "round",
|
|
12179
13067
|
strokeLinejoin: "round",
|
|
12180
13068
|
children: [
|
|
12181
|
-
/* @__PURE__ */
|
|
12182
|
-
/* @__PURE__ */
|
|
13069
|
+
/* @__PURE__ */ jsx95("circle", { cx: "12", cy: "12", r: "3" }),
|
|
13070
|
+
/* @__PURE__ */ jsx95("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" })
|
|
12183
13071
|
]
|
|
12184
13072
|
}
|
|
12185
13073
|
),
|
|
@@ -12187,24 +13075,24 @@ var BaseOrganizationSwitcher = ({
|
|
|
12187
13075
|
}
|
|
12188
13076
|
)
|
|
12189
13077
|
] }),
|
|
12190
|
-
organizations.length > 1 && /* @__PURE__ */
|
|
13078
|
+
organizations.length > 1 && /* @__PURE__ */ jsx95(
|
|
12191
13079
|
"div",
|
|
12192
13080
|
{
|
|
12193
|
-
className:
|
|
13081
|
+
className: cx30(styles.header, styles.sectionHeaderContainer),
|
|
12194
13082
|
style: {
|
|
12195
13083
|
borderTop: currentOrganization ? `1px solid ${theme.vars.colors.border}` : "none"
|
|
12196
13084
|
},
|
|
12197
|
-
children: /* @__PURE__ */
|
|
13085
|
+
children: /* @__PURE__ */ jsx95(Typography_default, { variant: "caption", fontWeight: 600, className: cx30(styles.sectionHeader), children: t("organization.switcher.switch.organization") })
|
|
12198
13086
|
}
|
|
12199
13087
|
),
|
|
12200
|
-
/* @__PURE__ */
|
|
13088
|
+
/* @__PURE__ */ jsx95("div", { className: cx30(styles.menu), children: loading ? renderLoading ? renderLoading() : defaultRenderLoading2() : error ? renderError ? renderError(error) : defaultRenderError2(error) : /* @__PURE__ */ jsxs42(Fragment17, { children: [
|
|
12201
13089
|
switchableOrganizations.map((organization) => {
|
|
12202
13090
|
const isSelected = false;
|
|
12203
|
-
return /* @__PURE__ */
|
|
13091
|
+
return /* @__PURE__ */ jsx95(
|
|
12204
13092
|
Button_default,
|
|
12205
13093
|
{
|
|
12206
13094
|
onClick: () => handleOrganizationSwitch(organization),
|
|
12207
|
-
className:
|
|
13095
|
+
className: cx30(styles.menuItem),
|
|
12208
13096
|
color: "tertiary",
|
|
12209
13097
|
variant: "text",
|
|
12210
13098
|
size: "small",
|
|
@@ -12218,34 +13106,34 @@ var BaseOrganizationSwitcher = ({
|
|
|
12218
13106
|
organization.id
|
|
12219
13107
|
);
|
|
12220
13108
|
}),
|
|
12221
|
-
menuItems.length > 0 && /* @__PURE__ */
|
|
12222
|
-
/* @__PURE__ */
|
|
13109
|
+
menuItems.length > 0 && /* @__PURE__ */ jsxs42(Fragment17, { children: [
|
|
13110
|
+
/* @__PURE__ */ jsx95("div", { className: cx30(styles.menuDivider) }),
|
|
12223
13111
|
menuItems.map(
|
|
12224
|
-
(item, index) => /* @__PURE__ */
|
|
13112
|
+
(item, index) => /* @__PURE__ */ jsx95("div", { children: item.href ? /* @__PURE__ */ jsxs42(
|
|
12225
13113
|
"a",
|
|
12226
13114
|
{
|
|
12227
13115
|
href: item.href,
|
|
12228
13116
|
style: {
|
|
12229
13117
|
backgroundColor: hoveredItemIndex === switchableOrganizations.length + index ? theme.vars.colors.action?.hover : "transparent"
|
|
12230
13118
|
},
|
|
12231
|
-
className:
|
|
13119
|
+
className: cx30(styles.menuItem),
|
|
12232
13120
|
onMouseEnter: () => setHoveredItemIndex(switchableOrganizations.length + index),
|
|
12233
13121
|
onMouseLeave: () => setHoveredItemIndex(null),
|
|
12234
13122
|
onFocus: () => setHoveredItemIndex(switchableOrganizations.length + index),
|
|
12235
13123
|
onBlur: () => setHoveredItemIndex(null),
|
|
12236
13124
|
children: [
|
|
12237
13125
|
item.icon,
|
|
12238
|
-
/* @__PURE__ */
|
|
13126
|
+
/* @__PURE__ */ jsx95("span", { children: item.label })
|
|
12239
13127
|
]
|
|
12240
13128
|
}
|
|
12241
|
-
) : /* @__PURE__ */
|
|
13129
|
+
) : /* @__PURE__ */ jsx95(
|
|
12242
13130
|
Button_default,
|
|
12243
13131
|
{
|
|
12244
13132
|
onClick: () => handleMenuItemClick(item),
|
|
12245
13133
|
style: {
|
|
12246
13134
|
backgroundColor: hoveredItemIndex === switchableOrganizations.length + index ? theme.vars.colors.action?.hover : "transparent"
|
|
12247
13135
|
},
|
|
12248
|
-
className:
|
|
13136
|
+
className: cx30(styles.menuItem),
|
|
12249
13137
|
color: "tertiary",
|
|
12250
13138
|
variant: "text",
|
|
12251
13139
|
size: "small",
|
|
@@ -12264,60 +13152,60 @@ var BaseOrganizationSwitcher = ({
|
|
|
12264
13152
|
var BaseOrganizationSwitcher_default = BaseOrganizationSwitcher;
|
|
12265
13153
|
|
|
12266
13154
|
// src/components/presentation/OrganizationSwitcher/OrganizationSwitcher.tsx
|
|
12267
|
-
import { useState as
|
|
13155
|
+
import { useState as useState33 } from "react";
|
|
12268
13156
|
|
|
12269
13157
|
// src/components/presentation/CreateOrganization/CreateOrganization.tsx
|
|
12270
|
-
import { useState as
|
|
13158
|
+
import { useState as useState28 } from "react";
|
|
12271
13159
|
|
|
12272
13160
|
// src/components/presentation/CreateOrganization/BaseCreateOrganization.tsx
|
|
12273
|
-
import { cx as
|
|
12274
|
-
import { useState as
|
|
13161
|
+
import { cx as cx31 } from "@emotion/css";
|
|
13162
|
+
import { useState as useState27 } from "react";
|
|
12275
13163
|
|
|
12276
13164
|
// src/components/presentation/CreateOrganization/BaseCreateOrganization.styles.ts
|
|
12277
|
-
import { css as
|
|
12278
|
-
import { useMemo as
|
|
12279
|
-
var
|
|
12280
|
-
return
|
|
12281
|
-
const root =
|
|
13165
|
+
import { css as css26 } from "@emotion/css";
|
|
13166
|
+
import { useMemo as useMemo35 } from "react";
|
|
13167
|
+
var useStyles26 = (theme, colorScheme) => {
|
|
13168
|
+
return useMemo35(() => {
|
|
13169
|
+
const root = css26`
|
|
12282
13170
|
padding: calc(${theme.vars.spacing.unit} * 4);
|
|
12283
13171
|
min-width: 600px;
|
|
12284
13172
|
margin: 0 auto;
|
|
12285
13173
|
`;
|
|
12286
|
-
const card =
|
|
13174
|
+
const card = css26`
|
|
12287
13175
|
background: ${theme.vars.colors.background.surface};
|
|
12288
13176
|
border-radius: ${theme.vars.borderRadius.large};
|
|
12289
13177
|
padding: calc(${theme.vars.spacing.unit} * 4);
|
|
12290
13178
|
`;
|
|
12291
|
-
const content =
|
|
13179
|
+
const content = css26`
|
|
12292
13180
|
display: flex;
|
|
12293
13181
|
flex-direction: column;
|
|
12294
13182
|
gap: calc(${theme.vars.spacing.unit} * 2);
|
|
12295
13183
|
`;
|
|
12296
|
-
const form =
|
|
13184
|
+
const form = css26`
|
|
12297
13185
|
display: flex;
|
|
12298
13186
|
flex-direction: column;
|
|
12299
13187
|
gap: calc(${theme.vars.spacing.unit} * 2);
|
|
12300
13188
|
width: 100%;
|
|
12301
13189
|
`;
|
|
12302
|
-
const header =
|
|
13190
|
+
const header = css26`
|
|
12303
13191
|
display: flex;
|
|
12304
13192
|
align-items: center;
|
|
12305
13193
|
gap: calc(${theme.vars.spacing.unit} * 1.5);
|
|
12306
13194
|
margin-bottom: calc(${theme.vars.spacing.unit} * 1.5);
|
|
12307
13195
|
`;
|
|
12308
|
-
const field =
|
|
13196
|
+
const field = css26`
|
|
12309
13197
|
display: flex;
|
|
12310
13198
|
align-items: center;
|
|
12311
13199
|
padding: ${theme.vars.spacing.unit} 0;
|
|
12312
13200
|
border-bottom: 1px solid ${theme.vars.colors.border};
|
|
12313
13201
|
min-height: 32px;
|
|
12314
13202
|
`;
|
|
12315
|
-
const fieldGroup =
|
|
13203
|
+
const fieldGroup = css26`
|
|
12316
13204
|
display: flex;
|
|
12317
13205
|
flex-direction: column;
|
|
12318
13206
|
gap: calc(${theme.vars.spacing.unit} * 0.5);
|
|
12319
13207
|
`;
|
|
12320
|
-
const textarea =
|
|
13208
|
+
const textarea = css26`
|
|
12321
13209
|
width: 100%;
|
|
12322
13210
|
padding: ${theme.vars.spacing.unit} calc(${theme.vars.spacing.unit} * 1.5);
|
|
12323
13211
|
border: 1px solid ${theme.vars.colors.border};
|
|
@@ -12339,28 +13227,28 @@ var useStyles24 = (theme, colorScheme) => {
|
|
|
12339
13227
|
cursor: not-allowed;
|
|
12340
13228
|
}
|
|
12341
13229
|
`;
|
|
12342
|
-
const textareaError =
|
|
13230
|
+
const textareaError = css26`
|
|
12343
13231
|
border-color: ${theme.vars.colors.error.main};
|
|
12344
13232
|
`;
|
|
12345
|
-
const input =
|
|
12346
|
-
const avatarContainer =
|
|
13233
|
+
const input = css26``;
|
|
13234
|
+
const avatarContainer = css26`
|
|
12347
13235
|
align-items: flex-start;
|
|
12348
13236
|
display: flex;
|
|
12349
13237
|
gap: calc(${theme.vars.spacing.unit} * 2);
|
|
12350
13238
|
margin-bottom: ${theme.vars.spacing.unit};
|
|
12351
13239
|
`;
|
|
12352
|
-
const actions =
|
|
13240
|
+
const actions = css26`
|
|
12353
13241
|
display: flex;
|
|
12354
13242
|
gap: ${theme.vars.spacing.unit};
|
|
12355
13243
|
justify-content: flex-end;
|
|
12356
13244
|
padding-top: calc(${theme.vars.spacing.unit} * 2);
|
|
12357
13245
|
`;
|
|
12358
|
-
const infoContainer =
|
|
13246
|
+
const infoContainer = css26`
|
|
12359
13247
|
display: flex;
|
|
12360
13248
|
flex-direction: column;
|
|
12361
13249
|
gap: ${theme.vars.spacing.unit};
|
|
12362
13250
|
`;
|
|
12363
|
-
const value =
|
|
13251
|
+
const value = css26`
|
|
12364
13252
|
color: ${theme.vars.colors.text.primary};
|
|
12365
13253
|
flex: 1;
|
|
12366
13254
|
display: flex;
|
|
@@ -12370,10 +13258,10 @@ var useStyles24 = (theme, colorScheme) => {
|
|
|
12370
13258
|
min-height: 32px;
|
|
12371
13259
|
line-height: 32px;
|
|
12372
13260
|
`;
|
|
12373
|
-
const popup =
|
|
13261
|
+
const popup = css26`
|
|
12374
13262
|
padding: calc(${theme.vars.spacing.unit} * 2);
|
|
12375
13263
|
`;
|
|
12376
|
-
const errorAlert =
|
|
13264
|
+
const errorAlert = css26`
|
|
12377
13265
|
margin-bottom: calc(${theme.vars.spacing.unit} * 2);
|
|
12378
13266
|
`;
|
|
12379
13267
|
return {
|
|
@@ -12409,10 +13297,10 @@ var useStyles24 = (theme, colorScheme) => {
|
|
|
12409
13297
|
colorScheme
|
|
12410
13298
|
]);
|
|
12411
13299
|
};
|
|
12412
|
-
var BaseCreateOrganization_styles_default =
|
|
13300
|
+
var BaseCreateOrganization_styles_default = useStyles26;
|
|
12413
13301
|
|
|
12414
13302
|
// src/components/presentation/CreateOrganization/BaseCreateOrganization.tsx
|
|
12415
|
-
import { jsx as
|
|
13303
|
+
import { jsx as jsx96, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
12416
13304
|
var BaseCreateOrganization = ({
|
|
12417
13305
|
cardLayout = true,
|
|
12418
13306
|
className = "",
|
|
@@ -12433,13 +13321,13 @@ var BaseCreateOrganization = ({
|
|
|
12433
13321
|
const { theme, colorScheme } = useTheme_default();
|
|
12434
13322
|
const styles = BaseCreateOrganization_styles_default(theme, colorScheme);
|
|
12435
13323
|
const { t } = useTranslation_default();
|
|
12436
|
-
const [formData, setFormData] =
|
|
13324
|
+
const [formData, setFormData] = useState27({
|
|
12437
13325
|
description: "",
|
|
12438
13326
|
handle: "",
|
|
12439
13327
|
name: "",
|
|
12440
13328
|
...initialValues
|
|
12441
13329
|
});
|
|
12442
|
-
const [formErrors, setFormErrors] =
|
|
13330
|
+
const [formErrors, setFormErrors] = useState27({});
|
|
12443
13331
|
const validateForm = () => {
|
|
12444
13332
|
const errors = {};
|
|
12445
13333
|
if (!formData.name.trim()) {
|
|
@@ -12499,13 +13387,13 @@ var BaseCreateOrganization = ({
|
|
|
12499
13387
|
console.error("Form submission error:", submitError);
|
|
12500
13388
|
}
|
|
12501
13389
|
};
|
|
12502
|
-
const createOrganizationContent = /* @__PURE__ */
|
|
12503
|
-
/* @__PURE__ */
|
|
12504
|
-
error && /* @__PURE__ */
|
|
12505
|
-
/* @__PURE__ */
|
|
12506
|
-
/* @__PURE__ */
|
|
13390
|
+
const createOrganizationContent = /* @__PURE__ */ jsx96("div", { className: cx31(styles.root, cardLayout && styles.card, className), style, children: /* @__PURE__ */ jsxs43("div", { className: cx31(styles.content), children: [
|
|
13391
|
+
/* @__PURE__ */ jsxs43("form", { id: "create-organization-form", className: cx31(styles.form), onSubmit: handleSubmit, children: [
|
|
13392
|
+
error && /* @__PURE__ */ jsxs43(Alert_default, { variant: "error", className: styles.errorAlert, children: [
|
|
13393
|
+
/* @__PURE__ */ jsx96(Alert_default.Title, { children: "Error" }),
|
|
13394
|
+
/* @__PURE__ */ jsx96(Alert_default.Description, { children: error })
|
|
12507
13395
|
] }),
|
|
12508
|
-
/* @__PURE__ */
|
|
13396
|
+
/* @__PURE__ */ jsx96("div", { className: cx31(styles.fieldGroup), children: /* @__PURE__ */ jsx96(
|
|
12509
13397
|
TextField_default,
|
|
12510
13398
|
{
|
|
12511
13399
|
label: `${t("elements.fields.organization.name.label")}`,
|
|
@@ -12515,10 +13403,10 @@ var BaseCreateOrganization = ({
|
|
|
12515
13403
|
disabled: loading,
|
|
12516
13404
|
required: true,
|
|
12517
13405
|
error: formErrors.name,
|
|
12518
|
-
className:
|
|
13406
|
+
className: cx31(styles.input)
|
|
12519
13407
|
}
|
|
12520
13408
|
) }),
|
|
12521
|
-
/* @__PURE__ */
|
|
13409
|
+
/* @__PURE__ */ jsx96("div", { className: cx31(styles.fieldGroup), children: /* @__PURE__ */ jsx96(
|
|
12522
13410
|
TextField_default,
|
|
12523
13411
|
{
|
|
12524
13412
|
label: `${t("elements.fields.organization.handle.label") || "Organization Handle"}`,
|
|
@@ -12529,15 +13417,15 @@ var BaseCreateOrganization = ({
|
|
|
12529
13417
|
required: true,
|
|
12530
13418
|
error: formErrors.handle,
|
|
12531
13419
|
helperText: "This will be your organization's unique identifier. Only lowercase letters, numbers, and hyphens are allowed.",
|
|
12532
|
-
className:
|
|
13420
|
+
className: cx31(styles.input)
|
|
12533
13421
|
}
|
|
12534
13422
|
) }),
|
|
12535
|
-
/* @__PURE__ */
|
|
12536
|
-
/* @__PURE__ */
|
|
12537
|
-
/* @__PURE__ */
|
|
13423
|
+
/* @__PURE__ */ jsx96("div", { className: cx31(styles.fieldGroup), children: /* @__PURE__ */ jsxs43(FormControl_default, { error: formErrors.description, children: [
|
|
13424
|
+
/* @__PURE__ */ jsx96(InputLabel_default, { required: true, children: t("elements.fields.organization.description.label") }),
|
|
13425
|
+
/* @__PURE__ */ jsx96(
|
|
12538
13426
|
"textarea",
|
|
12539
13427
|
{
|
|
12540
|
-
className:
|
|
13428
|
+
className: cx31(styles.textarea, formErrors.description && styles.textareaError),
|
|
12541
13429
|
placeholder: t("organization.create.description.placeholder"),
|
|
12542
13430
|
value: formData.description,
|
|
12543
13431
|
onChange: (e) => handleInputChange("description", e.target.value),
|
|
@@ -12548,15 +13436,15 @@ var BaseCreateOrganization = ({
|
|
|
12548
13436
|
] }) }),
|
|
12549
13437
|
renderAdditionalFields && renderAdditionalFields()
|
|
12550
13438
|
] }),
|
|
12551
|
-
/* @__PURE__ */
|
|
12552
|
-
onCancel && /* @__PURE__ */
|
|
12553
|
-
/* @__PURE__ */
|
|
13439
|
+
/* @__PURE__ */ jsxs43("div", { className: cx31(styles.actions), children: [
|
|
13440
|
+
onCancel && /* @__PURE__ */ jsx96(Button_default, { type: "button", variant: "outline", onClick: onCancel, disabled: loading, children: t("organization.create.buttons.cancel.text") }),
|
|
13441
|
+
/* @__PURE__ */ jsx96(Button_default, { type: "submit", variant: "solid", color: "primary", disabled: loading, form: "create-organization-form", children: loading ? t("organization.create.buttons.create_organization.loading.text") : t("organization.create.buttons.create_organization.text") })
|
|
12554
13442
|
] })
|
|
12555
13443
|
] }) });
|
|
12556
13444
|
if (mode === "popup") {
|
|
12557
|
-
return /* @__PURE__ */
|
|
12558
|
-
/* @__PURE__ */
|
|
12559
|
-
/* @__PURE__ */
|
|
13445
|
+
return /* @__PURE__ */ jsx96(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs43(Dialog_default.Content, { children: [
|
|
13446
|
+
/* @__PURE__ */ jsx96(Dialog_default.Heading, { children: title }),
|
|
13447
|
+
/* @__PURE__ */ jsx96("div", { className: styles.popup, children: createOrganizationContent })
|
|
12560
13448
|
] }) });
|
|
12561
13449
|
}
|
|
12562
13450
|
return createOrganizationContent;
|
|
@@ -12592,7 +13480,7 @@ var createOrganization = async ({ fetcher, ...requestConfig }) => {
|
|
|
12592
13480
|
var createOrganization_default = createOrganization;
|
|
12593
13481
|
|
|
12594
13482
|
// src/components/presentation/CreateOrganization/CreateOrganization.tsx
|
|
12595
|
-
import { Fragment as Fragment18, jsx as
|
|
13483
|
+
import { Fragment as Fragment18, jsx as jsx97 } from "react/jsx-runtime";
|
|
12596
13484
|
var CreateOrganization = ({
|
|
12597
13485
|
onCreateOrganization,
|
|
12598
13486
|
fallback = null,
|
|
@@ -12602,13 +13490,13 @@ var CreateOrganization = ({
|
|
|
12602
13490
|
}) => {
|
|
12603
13491
|
const { isSignedIn, baseUrl } = useAsgardeo_default();
|
|
12604
13492
|
const { currentOrganization, revalidateMyOrganizations } = useOrganization_default();
|
|
12605
|
-
const [loading, setLoading] =
|
|
12606
|
-
const [error, setError] =
|
|
13493
|
+
const [loading, setLoading] = useState28(false);
|
|
13494
|
+
const [error, setError] = useState28(null);
|
|
12607
13495
|
if (!isSignedIn && fallback) {
|
|
12608
13496
|
return fallback;
|
|
12609
13497
|
}
|
|
12610
13498
|
if (!isSignedIn) {
|
|
12611
|
-
return /* @__PURE__ */
|
|
13499
|
+
return /* @__PURE__ */ jsx97(Fragment18, {});
|
|
12612
13500
|
}
|
|
12613
13501
|
const parentId = defaultParentId || currentOrganization?.id || "";
|
|
12614
13502
|
const handleSubmit = async (payload) => {
|
|
@@ -12642,7 +13530,7 @@ var CreateOrganization = ({
|
|
|
12642
13530
|
setLoading(false);
|
|
12643
13531
|
}
|
|
12644
13532
|
};
|
|
12645
|
-
return /* @__PURE__ */
|
|
13533
|
+
return /* @__PURE__ */ jsx97(
|
|
12646
13534
|
BaseCreateOrganization,
|
|
12647
13535
|
{
|
|
12648
13536
|
onSubmit: handleSubmit,
|
|
@@ -12656,43 +13544,43 @@ var CreateOrganization = ({
|
|
|
12656
13544
|
};
|
|
12657
13545
|
|
|
12658
13546
|
// src/components/presentation/OrganizationProfile/OrganizationProfile.tsx
|
|
12659
|
-
import { useEffect as
|
|
13547
|
+
import { useEffect as useEffect18, useState as useState31 } from "react";
|
|
12660
13548
|
|
|
12661
13549
|
// src/components/presentation/OrganizationProfile/BaseOrganizationProfile.tsx
|
|
12662
13550
|
import { formatDate } from "@asgardeo/browser";
|
|
12663
|
-
import { cx as
|
|
12664
|
-
import { useState as
|
|
13551
|
+
import { cx as cx33 } from "@emotion/css";
|
|
13552
|
+
import { useState as useState30, useCallback as useCallback18 } from "react";
|
|
12665
13553
|
|
|
12666
13554
|
// src/components/primitives/KeyValueInput/KeyValueInput.tsx
|
|
12667
13555
|
import { withVendorCSSClassPrefix as withVendorCSSClassPrefix29, bem as bem20 } from "@asgardeo/browser";
|
|
12668
|
-
import { cx as
|
|
12669
|
-
import { useState as
|
|
13556
|
+
import { cx as cx32 } from "@emotion/css";
|
|
13557
|
+
import { useState as useState29, useCallback as useCallback17 } from "react";
|
|
12670
13558
|
|
|
12671
13559
|
// src/components/primitives/KeyValueInput/KeyValueInput.styles.ts
|
|
12672
|
-
import { css as
|
|
12673
|
-
import { useMemo as
|
|
12674
|
-
var
|
|
12675
|
-
return
|
|
12676
|
-
const container =
|
|
13560
|
+
import { css as css27 } from "@emotion/css";
|
|
13561
|
+
import { useMemo as useMemo36 } from "react";
|
|
13562
|
+
var useStyles27 = (theme, colorScheme, disabled, readOnly, hasError) => {
|
|
13563
|
+
return useMemo36(() => {
|
|
13564
|
+
const container = css27`
|
|
12677
13565
|
display: flex;
|
|
12678
13566
|
flex-direction: column;
|
|
12679
13567
|
gap: calc(${theme.vars.spacing.unit} / 2);
|
|
12680
13568
|
`;
|
|
12681
|
-
const label =
|
|
13569
|
+
const label = css27`
|
|
12682
13570
|
font-size: 0.875rem;
|
|
12683
13571
|
font-weight: 500;
|
|
12684
13572
|
color: ${theme.vars.colors.text.primary};
|
|
12685
13573
|
margin-bottom: calc(${theme.vars.spacing.unit} / 2);
|
|
12686
13574
|
`;
|
|
12687
|
-
const requiredIndicator =
|
|
13575
|
+
const requiredIndicator = css27`
|
|
12688
13576
|
color: ${theme.vars.colors.error.main};
|
|
12689
13577
|
`;
|
|
12690
|
-
const pairsList =
|
|
13578
|
+
const pairsList = css27`
|
|
12691
13579
|
display: flex;
|
|
12692
13580
|
flex-direction: column;
|
|
12693
13581
|
gap: calc(${theme.vars.spacing.unit} / 4);
|
|
12694
13582
|
`;
|
|
12695
|
-
const pairRow =
|
|
13583
|
+
const pairRow = css27`
|
|
12696
13584
|
display: flex;
|
|
12697
13585
|
align-items: center;
|
|
12698
13586
|
gap: calc(${theme.vars.spacing.unit} / 2);
|
|
@@ -12705,11 +13593,11 @@ var useStyles25 = (theme, colorScheme, disabled, readOnly, hasError) => {
|
|
|
12705
13593
|
background-color: ${theme.vars.colors.action.hover};
|
|
12706
13594
|
}
|
|
12707
13595
|
`;
|
|
12708
|
-
const pairInput =
|
|
13596
|
+
const pairInput = css27`
|
|
12709
13597
|
flex: 1;
|
|
12710
13598
|
min-width: 0;
|
|
12711
13599
|
`;
|
|
12712
|
-
const addRow =
|
|
13600
|
+
const addRow = css27`
|
|
12713
13601
|
display: flex;
|
|
12714
13602
|
align-items: center;
|
|
12715
13603
|
gap: calc(${theme.vars.spacing.unit} / 2);
|
|
@@ -12719,7 +13607,7 @@ var useStyles25 = (theme, colorScheme, disabled, readOnly, hasError) => {
|
|
|
12719
13607
|
background-color: transparent;
|
|
12720
13608
|
margin-top: calc(${theme.vars.spacing.unit} / 2);
|
|
12721
13609
|
`;
|
|
12722
|
-
const removeButton =
|
|
13610
|
+
const removeButton = css27`
|
|
12723
13611
|
min-width: auto;
|
|
12724
13612
|
width: 24px;
|
|
12725
13613
|
height: 24px;
|
|
@@ -12742,7 +13630,7 @@ var useStyles25 = (theme, colorScheme, disabled, readOnly, hasError) => {
|
|
|
12742
13630
|
opacity: 0.6;
|
|
12743
13631
|
}
|
|
12744
13632
|
`;
|
|
12745
|
-
const addButton =
|
|
13633
|
+
const addButton = css27`
|
|
12746
13634
|
min-width: auto;
|
|
12747
13635
|
width: 24px;
|
|
12748
13636
|
height: 24px;
|
|
@@ -12765,39 +13653,39 @@ var useStyles25 = (theme, colorScheme, disabled, readOnly, hasError) => {
|
|
|
12765
13653
|
opacity: 0.6;
|
|
12766
13654
|
}
|
|
12767
13655
|
`;
|
|
12768
|
-
const helperText =
|
|
13656
|
+
const helperText = css27`
|
|
12769
13657
|
font-size: 0.75rem;
|
|
12770
13658
|
color: ${hasError ? theme.vars.colors.error.main : theme.vars.colors.text.secondary};
|
|
12771
13659
|
margin-top: calc(${theme.vars.spacing.unit} / 2);
|
|
12772
13660
|
`;
|
|
12773
|
-
const emptyState =
|
|
13661
|
+
const emptyState = css27`
|
|
12774
13662
|
padding: ${theme.vars.spacing.unit};
|
|
12775
13663
|
text-align: center;
|
|
12776
13664
|
color: ${theme.vars.colors.text.secondary};
|
|
12777
13665
|
font-style: italic;
|
|
12778
13666
|
font-size: 0.75rem;
|
|
12779
13667
|
`;
|
|
12780
|
-
const readOnlyPair =
|
|
13668
|
+
const readOnlyPair = css27`
|
|
12781
13669
|
display: flex;
|
|
12782
13670
|
align-items: center;
|
|
12783
13671
|
gap: calc(${theme.vars.spacing.unit} / 2);
|
|
12784
13672
|
padding: calc(${theme.vars.spacing.unit} / 4) 0;
|
|
12785
13673
|
min-height: 20px;
|
|
12786
13674
|
`;
|
|
12787
|
-
const readOnlyKey =
|
|
13675
|
+
const readOnlyKey = css27`
|
|
12788
13676
|
font-size: 0.75rem;
|
|
12789
13677
|
font-weight: 500;
|
|
12790
13678
|
color: ${theme.vars.colors.text.secondary};
|
|
12791
13679
|
min-width: 80px;
|
|
12792
13680
|
flex-shrink: 0;
|
|
12793
13681
|
`;
|
|
12794
|
-
const readOnlyValue =
|
|
13682
|
+
const readOnlyValue = css27`
|
|
12795
13683
|
font-size: 0.75rem;
|
|
12796
13684
|
color: ${theme.vars.colors.text.primary};
|
|
12797
13685
|
word-break: break-word;
|
|
12798
13686
|
flex: 1;
|
|
12799
13687
|
`;
|
|
12800
|
-
const counterText =
|
|
13688
|
+
const counterText = css27`
|
|
12801
13689
|
font-size: 0.75rem;
|
|
12802
13690
|
color: ${theme.vars.colors.text.secondary};
|
|
12803
13691
|
margin-top: calc(${theme.vars.spacing.unit} / 2);
|
|
@@ -12821,10 +13709,10 @@ var useStyles25 = (theme, colorScheme, disabled, readOnly, hasError) => {
|
|
|
12821
13709
|
};
|
|
12822
13710
|
}, [theme, colorScheme, disabled, readOnly, hasError]);
|
|
12823
13711
|
};
|
|
12824
|
-
var KeyValueInput_styles_default =
|
|
13712
|
+
var KeyValueInput_styles_default = useStyles27;
|
|
12825
13713
|
|
|
12826
13714
|
// src/components/primitives/KeyValueInput/KeyValueInput.tsx
|
|
12827
|
-
import { jsx as
|
|
13715
|
+
import { jsx as jsx98, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
12828
13716
|
var KeyValueInput = ({
|
|
12829
13717
|
className = "",
|
|
12830
13718
|
disabled = false,
|
|
@@ -12847,10 +13735,10 @@ var KeyValueInput = ({
|
|
|
12847
13735
|
const { theme, colorScheme } = useTheme_default();
|
|
12848
13736
|
const styles = KeyValueInput_styles_default(theme, colorScheme, disabled, readOnly, !!error);
|
|
12849
13737
|
const initialPairs = Array.isArray(value) ? value : Object.entries(value).map(([key, val]) => ({ key, value: String(val) }));
|
|
12850
|
-
const [pairs, setPairs] =
|
|
12851
|
-
const [newKey, setNewKey] =
|
|
12852
|
-
const [newValue, setNewValue] =
|
|
12853
|
-
const handleAddPair =
|
|
13738
|
+
const [pairs, setPairs] = useState29(initialPairs);
|
|
13739
|
+
const [newKey, setNewKey] = useState29("");
|
|
13740
|
+
const [newValue, setNewValue] = useState29("");
|
|
13741
|
+
const handleAddPair = useCallback17(() => {
|
|
12854
13742
|
if (!newKey.trim() || !newValue.trim()) return;
|
|
12855
13743
|
if (maxPairs && pairs.length >= maxPairs) return;
|
|
12856
13744
|
const newPair = {
|
|
@@ -12868,7 +13756,7 @@ var KeyValueInput = ({
|
|
|
12868
13756
|
onAdd(newPair);
|
|
12869
13757
|
}
|
|
12870
13758
|
}, [newKey, newValue, pairs, maxPairs, onChange, onAdd]);
|
|
12871
|
-
const handleRemovePair =
|
|
13759
|
+
const handleRemovePair = useCallback17(
|
|
12872
13760
|
(index) => {
|
|
12873
13761
|
const pairToRemove = pairs[index];
|
|
12874
13762
|
const updatedPairs = pairs.filter((_, i) => i !== index);
|
|
@@ -12882,7 +13770,7 @@ var KeyValueInput = ({
|
|
|
12882
13770
|
},
|
|
12883
13771
|
[pairs, onChange, onRemove]
|
|
12884
13772
|
);
|
|
12885
|
-
const handleUpdatePair =
|
|
13773
|
+
const handleUpdatePair = useCallback17(
|
|
12886
13774
|
(index, field, newVal) => {
|
|
12887
13775
|
const updatedPairs = pairs.map((pair, i) => {
|
|
12888
13776
|
if (i === index) {
|
|
@@ -12899,105 +13787,105 @@ var KeyValueInput = ({
|
|
|
12899
13787
|
);
|
|
12900
13788
|
const canAddMore = !maxPairs || pairs.length < maxPairs;
|
|
12901
13789
|
const isAddDisabled = disabled || readOnly || !canAddMore || !newKey.trim() || !newValue.trim();
|
|
12902
|
-
return /* @__PURE__ */
|
|
12903
|
-
label && /* @__PURE__ */
|
|
13790
|
+
return /* @__PURE__ */ jsxs44("div", { className: cx32(withVendorCSSClassPrefix29(bem20("key-value-input")), styles.container, className), children: [
|
|
13791
|
+
label && /* @__PURE__ */ jsxs44("label", { className: cx32(withVendorCSSClassPrefix29(bem20("key-value-input", "label")), styles.label), children: [
|
|
12904
13792
|
label,
|
|
12905
|
-
required && /* @__PURE__ */
|
|
13793
|
+
required && /* @__PURE__ */ jsx98(
|
|
12906
13794
|
"span",
|
|
12907
13795
|
{
|
|
12908
|
-
className:
|
|
13796
|
+
className: cx32(withVendorCSSClassPrefix29(bem20("key-value-input", "required")), styles.requiredIndicator),
|
|
12909
13797
|
children: " *"
|
|
12910
13798
|
}
|
|
12911
13799
|
)
|
|
12912
13800
|
] }),
|
|
12913
|
-
/* @__PURE__ */
|
|
12914
|
-
pairs.length === 0 && readOnly ? /* @__PURE__ */
|
|
13801
|
+
/* @__PURE__ */ jsxs44("div", { className: cx32(withVendorCSSClassPrefix29(bem20("key-value-input", "pairs-list")), styles.pairsList), children: [
|
|
13802
|
+
pairs.length === 0 && readOnly ? /* @__PURE__ */ jsx98("div", { className: cx32(withVendorCSSClassPrefix29(bem20("key-value-input", "empty-state")), styles.emptyState), children: "No attributes defined" }) : readOnly ? pairs.map((pair, index) => /* @__PURE__ */ jsxs44(
|
|
12915
13803
|
"div",
|
|
12916
13804
|
{
|
|
12917
|
-
className:
|
|
13805
|
+
className: cx32(withVendorCSSClassPrefix29(bem20("key-value-input", "readonly-pair")), styles.readOnlyPair),
|
|
12918
13806
|
children: [
|
|
12919
|
-
/* @__PURE__ */
|
|
13807
|
+
/* @__PURE__ */ jsxs44(
|
|
12920
13808
|
"span",
|
|
12921
13809
|
{
|
|
12922
|
-
className:
|
|
13810
|
+
className: cx32(withVendorCSSClassPrefix29(bem20("key-value-input", "readonly-key")), styles.readOnlyKey),
|
|
12923
13811
|
children: [
|
|
12924
13812
|
pair.key,
|
|
12925
13813
|
":"
|
|
12926
13814
|
]
|
|
12927
13815
|
}
|
|
12928
13816
|
),
|
|
12929
|
-
/* @__PURE__ */
|
|
13817
|
+
/* @__PURE__ */ jsx98(
|
|
12930
13818
|
"span",
|
|
12931
13819
|
{
|
|
12932
|
-
className:
|
|
13820
|
+
className: cx32(withVendorCSSClassPrefix29(bem20("key-value-input", "readonly-value")), styles.readOnlyValue),
|
|
12933
13821
|
children: pair.value
|
|
12934
13822
|
}
|
|
12935
13823
|
)
|
|
12936
13824
|
]
|
|
12937
13825
|
},
|
|
12938
13826
|
`${pair.key}-${index}`
|
|
12939
|
-
)) : pairs.map((pair, index) => /* @__PURE__ */
|
|
13827
|
+
)) : pairs.map((pair, index) => /* @__PURE__ */ jsxs44(
|
|
12940
13828
|
"div",
|
|
12941
13829
|
{
|
|
12942
|
-
className:
|
|
13830
|
+
className: cx32(withVendorCSSClassPrefix29(bem20("key-value-input", "pair-row")), styles.pairRow),
|
|
12943
13831
|
children: [
|
|
12944
|
-
/* @__PURE__ */
|
|
13832
|
+
/* @__PURE__ */ jsx98(
|
|
12945
13833
|
TextField_default,
|
|
12946
13834
|
{
|
|
12947
13835
|
placeholder: keyPlaceholder,
|
|
12948
13836
|
value: pair.key,
|
|
12949
13837
|
onChange: (e) => handleUpdatePair(index, "key", e.target.value),
|
|
12950
13838
|
disabled: disabled || readOnly,
|
|
12951
|
-
className:
|
|
13839
|
+
className: cx32(withVendorCSSClassPrefix29(bem20("key-value-input", "pair-input")), styles.pairInput),
|
|
12952
13840
|
"aria-label": `${keyLabel} ${index + 1}`
|
|
12953
13841
|
}
|
|
12954
13842
|
),
|
|
12955
|
-
/* @__PURE__ */
|
|
13843
|
+
/* @__PURE__ */ jsx98(
|
|
12956
13844
|
TextField_default,
|
|
12957
13845
|
{
|
|
12958
13846
|
placeholder: valuePlaceholder,
|
|
12959
13847
|
value: pair.value,
|
|
12960
13848
|
onChange: (e) => handleUpdatePair(index, "value", e.target.value),
|
|
12961
13849
|
disabled: disabled || readOnly,
|
|
12962
|
-
className:
|
|
13850
|
+
className: cx32(withVendorCSSClassPrefix29(bem20("key-value-input", "pair-input")), styles.pairInput),
|
|
12963
13851
|
"aria-label": `${valueLabel} ${index + 1}`
|
|
12964
13852
|
}
|
|
12965
13853
|
),
|
|
12966
|
-
!readOnly && /* @__PURE__ */
|
|
13854
|
+
!readOnly && /* @__PURE__ */ jsx98(
|
|
12967
13855
|
"button",
|
|
12968
13856
|
{
|
|
12969
13857
|
type: "button",
|
|
12970
13858
|
onClick: () => handleRemovePair(index),
|
|
12971
13859
|
disabled,
|
|
12972
|
-
className:
|
|
13860
|
+
className: cx32(withVendorCSSClassPrefix29(bem20("key-value-input", "remove-button")), styles.removeButton),
|
|
12973
13861
|
"aria-label": `${removeButtonText} ${pair.key}`,
|
|
12974
|
-
children: /* @__PURE__ */
|
|
13862
|
+
children: /* @__PURE__ */ jsx98(X_default, { width: 16, height: 16 })
|
|
12975
13863
|
}
|
|
12976
13864
|
)
|
|
12977
13865
|
]
|
|
12978
13866
|
},
|
|
12979
13867
|
`${pair.key}-${index}`
|
|
12980
13868
|
)),
|
|
12981
|
-
!readOnly && /* @__PURE__ */
|
|
12982
|
-
/* @__PURE__ */
|
|
13869
|
+
!readOnly && /* @__PURE__ */ jsxs44("div", { className: cx32(withVendorCSSClassPrefix29(bem20("key-value-input", "add-row")), styles.addRow), children: [
|
|
13870
|
+
/* @__PURE__ */ jsx98(
|
|
12983
13871
|
TextField_default,
|
|
12984
13872
|
{
|
|
12985
13873
|
placeholder: keyPlaceholder,
|
|
12986
13874
|
value: newKey,
|
|
12987
13875
|
onChange: (e) => setNewKey(e.target.value),
|
|
12988
13876
|
disabled,
|
|
12989
|
-
className:
|
|
13877
|
+
className: cx32(withVendorCSSClassPrefix29(bem20("key-value-input", "pair-input")), styles.pairInput),
|
|
12990
13878
|
"aria-label": "New key"
|
|
12991
13879
|
}
|
|
12992
13880
|
),
|
|
12993
|
-
/* @__PURE__ */
|
|
13881
|
+
/* @__PURE__ */ jsx98(
|
|
12994
13882
|
TextField_default,
|
|
12995
13883
|
{
|
|
12996
13884
|
placeholder: valuePlaceholder,
|
|
12997
13885
|
value: newValue,
|
|
12998
13886
|
onChange: (e) => setNewValue(e.target.value),
|
|
12999
13887
|
disabled,
|
|
13000
|
-
className:
|
|
13888
|
+
className: cx32(withVendorCSSClassPrefix29(bem20("key-value-input", "pair-input")), styles.pairInput),
|
|
13001
13889
|
"aria-label": "New value",
|
|
13002
13890
|
onKeyPress: (e) => {
|
|
13003
13891
|
if (e.key === "Enter" && !isAddDisabled) {
|
|
@@ -13006,21 +13894,21 @@ var KeyValueInput = ({
|
|
|
13006
13894
|
}
|
|
13007
13895
|
}
|
|
13008
13896
|
),
|
|
13009
|
-
/* @__PURE__ */
|
|
13897
|
+
/* @__PURE__ */ jsx98(
|
|
13010
13898
|
"button",
|
|
13011
13899
|
{
|
|
13012
13900
|
type: "button",
|
|
13013
13901
|
onClick: handleAddPair,
|
|
13014
13902
|
disabled: isAddDisabled,
|
|
13015
|
-
className:
|
|
13903
|
+
className: cx32(withVendorCSSClassPrefix29(bem20("key-value-input", "add-button")), styles.addButton),
|
|
13016
13904
|
"aria-label": "Add new key-value pair",
|
|
13017
|
-
children: /* @__PURE__ */
|
|
13905
|
+
children: /* @__PURE__ */ jsx98(Plus_default, { width: 16, height: 16 })
|
|
13018
13906
|
}
|
|
13019
13907
|
)
|
|
13020
13908
|
] })
|
|
13021
13909
|
] }),
|
|
13022
|
-
(helperText || error) && /* @__PURE__ */
|
|
13023
|
-
maxPairs && /* @__PURE__ */
|
|
13910
|
+
(helperText || error) && /* @__PURE__ */ jsx98("div", { className: cx32(withVendorCSSClassPrefix29(bem20("key-value-input", "helper-text")), styles.helperText), children: error || helperText }),
|
|
13911
|
+
maxPairs && /* @__PURE__ */ jsxs44("div", { className: cx32(withVendorCSSClassPrefix29(bem20("key-value-input", "counter")), styles.counterText), children: [
|
|
13024
13912
|
pairs.length,
|
|
13025
13913
|
" of ",
|
|
13026
13914
|
maxPairs,
|
|
@@ -13031,48 +13919,48 @@ var KeyValueInput = ({
|
|
|
13031
13919
|
var KeyValueInput_default = KeyValueInput;
|
|
13032
13920
|
|
|
13033
13921
|
// src/components/presentation/OrganizationProfile/BaseOrganizationProfile.styles.ts
|
|
13034
|
-
import { css as
|
|
13035
|
-
import { useMemo as
|
|
13036
|
-
var
|
|
13037
|
-
return
|
|
13922
|
+
import { css as css28 } from "@emotion/css";
|
|
13923
|
+
import { useMemo as useMemo37 } from "react";
|
|
13924
|
+
var useStyles28 = (theme, colorScheme) => {
|
|
13925
|
+
return useMemo37(() => {
|
|
13038
13926
|
return {
|
|
13039
|
-
root:
|
|
13927
|
+
root: css28`
|
|
13040
13928
|
padding: calc(${theme.vars.spacing.unit} * 4);
|
|
13041
13929
|
min-width: 600px;
|
|
13042
13930
|
margin: 0 auto;
|
|
13043
13931
|
`,
|
|
13044
|
-
card:
|
|
13932
|
+
card: css28`
|
|
13045
13933
|
background: ${theme.vars.colors.background.surface};
|
|
13046
13934
|
border-radius: ${theme.vars.borderRadius.large};
|
|
13047
13935
|
`,
|
|
13048
|
-
header:
|
|
13936
|
+
header: css28`
|
|
13049
13937
|
display: flex;
|
|
13050
13938
|
align-items: center;
|
|
13051
13939
|
gap: calc(${theme.vars.spacing.unit} * 2);
|
|
13052
13940
|
margin-bottom: calc(${theme.vars.spacing.unit} * 3);
|
|
13053
13941
|
padding-bottom: calc(${theme.vars.spacing.unit} * 2);
|
|
13054
13942
|
`,
|
|
13055
|
-
orgInfo:
|
|
13943
|
+
orgInfo: css28`
|
|
13056
13944
|
flex: 1;
|
|
13057
13945
|
`,
|
|
13058
|
-
name:
|
|
13946
|
+
name: css28`
|
|
13059
13947
|
font-size: 1.5rem;
|
|
13060
13948
|
font-weight: 600;
|
|
13061
13949
|
margin: 0 0 8px 0;
|
|
13062
13950
|
color: ${theme.vars.colors.text.primary};
|
|
13063
13951
|
`,
|
|
13064
|
-
handle:
|
|
13952
|
+
handle: css28`
|
|
13065
13953
|
font-size: 1rem;
|
|
13066
13954
|
color: ${theme.vars.colors.text.secondary};
|
|
13067
13955
|
margin: 0;
|
|
13068
13956
|
font-family: monospace;
|
|
13069
13957
|
`,
|
|
13070
|
-
infoContainer:
|
|
13958
|
+
infoContainer: css28`
|
|
13071
13959
|
display: flex;
|
|
13072
13960
|
flex-direction: column;
|
|
13073
13961
|
gap: ${theme.vars.spacing.unit};
|
|
13074
13962
|
`,
|
|
13075
|
-
field:
|
|
13963
|
+
field: css28`
|
|
13076
13964
|
display: flex;
|
|
13077
13965
|
align-items: flex-start;
|
|
13078
13966
|
padding: calc(${theme.vars.spacing.unit} / 2) 0;
|
|
@@ -13080,21 +13968,21 @@ var useStyles26 = (theme, colorScheme) => {
|
|
|
13080
13968
|
min-height: 28px;
|
|
13081
13969
|
gap: ${theme.vars.spacing.unit};
|
|
13082
13970
|
`,
|
|
13083
|
-
fieldLast:
|
|
13971
|
+
fieldLast: css28`
|
|
13084
13972
|
border-bottom: none;
|
|
13085
13973
|
`,
|
|
13086
|
-
fieldContent:
|
|
13974
|
+
fieldContent: css28`
|
|
13087
13975
|
flex: 1;
|
|
13088
13976
|
display: flex;
|
|
13089
13977
|
align-items: center;
|
|
13090
13978
|
gap: ${theme.vars.spacing.unit};
|
|
13091
13979
|
`,
|
|
13092
|
-
fieldActions:
|
|
13980
|
+
fieldActions: css28`
|
|
13093
13981
|
display: flex;
|
|
13094
13982
|
align-items: center;
|
|
13095
13983
|
gap: calc(${theme.vars.spacing.unit} / 2);
|
|
13096
13984
|
`,
|
|
13097
|
-
label:
|
|
13985
|
+
label: css28`
|
|
13098
13986
|
font-size: 0.875rem;
|
|
13099
13987
|
font-weight: 500;
|
|
13100
13988
|
color: ${theme.vars.colors.text.secondary};
|
|
@@ -13102,7 +13990,7 @@ var useStyles26 = (theme, colorScheme) => {
|
|
|
13102
13990
|
flex-shrink: 0;
|
|
13103
13991
|
line-height: 28px;
|
|
13104
13992
|
`,
|
|
13105
|
-
value:
|
|
13993
|
+
value: css28`
|
|
13106
13994
|
color: ${theme.vars.colors.text.primary};
|
|
13107
13995
|
flex: 1;
|
|
13108
13996
|
display: flex;
|
|
@@ -13113,11 +14001,11 @@ var useStyles26 = (theme, colorScheme) => {
|
|
|
13113
14001
|
line-height: 28px;
|
|
13114
14002
|
word-break: break-word;
|
|
13115
14003
|
`,
|
|
13116
|
-
valueEmpty:
|
|
14004
|
+
valueEmpty: css28`
|
|
13117
14005
|
font-style: italic;
|
|
13118
14006
|
opacity: 0.7;
|
|
13119
14007
|
`,
|
|
13120
|
-
statusBadge:
|
|
14008
|
+
statusBadge: css28`
|
|
13121
14009
|
padding: calc(${theme.vars.spacing.unit} / 2) ${theme.vars.spacing.unit};
|
|
13122
14010
|
border-radius: ${theme.vars.borderRadius.small};
|
|
13123
14011
|
font-size: 0.75rem;
|
|
@@ -13126,12 +14014,12 @@ var useStyles26 = (theme, colorScheme) => {
|
|
|
13126
14014
|
text-transform: uppercase;
|
|
13127
14015
|
letter-spacing: 0.5px;
|
|
13128
14016
|
`,
|
|
13129
|
-
permissionsList:
|
|
14017
|
+
permissionsList: css28`
|
|
13130
14018
|
display: flex;
|
|
13131
14019
|
flex-wrap: wrap;
|
|
13132
14020
|
gap: calc(${theme.vars.spacing.unit} / 2);
|
|
13133
14021
|
`,
|
|
13134
|
-
permissionBadge:
|
|
14022
|
+
permissionBadge: css28`
|
|
13135
14023
|
padding: calc(${theme.vars.spacing.unit} / 4) ${theme.vars.spacing.unit};
|
|
13136
14024
|
border-radius: ${theme.vars.borderRadius.small};
|
|
13137
14025
|
font-size: 0.75rem;
|
|
@@ -13139,55 +14027,55 @@ var useStyles26 = (theme, colorScheme) => {
|
|
|
13139
14027
|
color: ${theme.vars.colors.primary.contrastText};
|
|
13140
14028
|
border: 1px solid ${theme.vars.colors.border};
|
|
13141
14029
|
`,
|
|
13142
|
-
attributesList:
|
|
14030
|
+
attributesList: css28`
|
|
13143
14031
|
display: flex;
|
|
13144
14032
|
flex-direction: column;
|
|
13145
14033
|
gap: calc(${theme.vars.spacing.unit} / 4);
|
|
13146
14034
|
`,
|
|
13147
|
-
attributeItem:
|
|
14035
|
+
attributeItem: css28`
|
|
13148
14036
|
display: flex;
|
|
13149
14037
|
gap: ${theme.vars.spacing.unit};
|
|
13150
14038
|
padding: calc(${theme.vars.spacing.unit} / 4) 0;
|
|
13151
14039
|
align-items: center;
|
|
13152
14040
|
`,
|
|
13153
|
-
attributeKey:
|
|
14041
|
+
attributeKey: css28`
|
|
13154
14042
|
font-size: 0.75rem;
|
|
13155
14043
|
font-weight: 500;
|
|
13156
14044
|
color: ${theme.vars.colors.text.secondary};
|
|
13157
14045
|
min-width: 80px;
|
|
13158
14046
|
flex-shrink: 0;
|
|
13159
14047
|
`,
|
|
13160
|
-
attributeValue:
|
|
14048
|
+
attributeValue: css28`
|
|
13161
14049
|
font-size: 0.75rem;
|
|
13162
14050
|
color: ${theme.vars.colors.text.primary};
|
|
13163
14051
|
word-break: break-word;
|
|
13164
14052
|
flex: 1;
|
|
13165
14053
|
`,
|
|
13166
|
-
popup:
|
|
14054
|
+
popup: css28`
|
|
13167
14055
|
padding: calc(${theme.vars.spacing.unit} * 2);
|
|
13168
14056
|
`,
|
|
13169
|
-
editButton:
|
|
14057
|
+
editButton: css28`
|
|
13170
14058
|
min-width: auto;
|
|
13171
14059
|
padding: calc(${theme.vars.spacing.unit} / 2);
|
|
13172
14060
|
min-height: auto;
|
|
13173
14061
|
`,
|
|
13174
|
-
placeholderButton:
|
|
14062
|
+
placeholderButton: css28`
|
|
13175
14063
|
font-style: italic;
|
|
13176
14064
|
text-decoration: underline;
|
|
13177
14065
|
opacity: 0.7;
|
|
13178
14066
|
padding: 0;
|
|
13179
14067
|
min-height: auto;
|
|
13180
14068
|
`,
|
|
13181
|
-
fieldInput:
|
|
14069
|
+
fieldInput: css28`
|
|
13182
14070
|
margin-bottom: 0;
|
|
13183
14071
|
`
|
|
13184
14072
|
};
|
|
13185
14073
|
}, [theme, colorScheme]);
|
|
13186
14074
|
};
|
|
13187
|
-
var BaseOrganizationProfile_styles_default =
|
|
14075
|
+
var BaseOrganizationProfile_styles_default = useStyles28;
|
|
13188
14076
|
|
|
13189
14077
|
// src/components/presentation/OrganizationProfile/BaseOrganizationProfile.tsx
|
|
13190
|
-
import { Fragment as Fragment19, jsx as
|
|
14078
|
+
import { Fragment as Fragment19, jsx as jsx99, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
13191
14079
|
var BaseOrganizationProfile = ({
|
|
13192
14080
|
fallback = null,
|
|
13193
14081
|
className = "",
|
|
@@ -13236,9 +14124,9 @@ var BaseOrganizationProfile = ({
|
|
|
13236
14124
|
}) => {
|
|
13237
14125
|
const { theme, colorScheme } = useTheme_default();
|
|
13238
14126
|
const styles = BaseOrganizationProfile_styles_default(theme, colorScheme);
|
|
13239
|
-
const [editedOrganization, setEditedOrganization] =
|
|
13240
|
-
const [editingFields, setEditingFields] =
|
|
13241
|
-
const PencilIcon = () => /* @__PURE__ */
|
|
14127
|
+
const [editedOrganization, setEditedOrganization] = useState30(organization);
|
|
14128
|
+
const [editingFields, setEditingFields] = useState30({});
|
|
14129
|
+
const PencilIcon = () => /* @__PURE__ */ jsx99(
|
|
13242
14130
|
"svg",
|
|
13243
14131
|
{
|
|
13244
14132
|
width: "16",
|
|
@@ -13249,16 +14137,16 @@ var BaseOrganizationProfile = ({
|
|
|
13249
14137
|
strokeWidth: "2",
|
|
13250
14138
|
strokeLinecap: "round",
|
|
13251
14139
|
strokeLinejoin: "round",
|
|
13252
|
-
children: /* @__PURE__ */
|
|
14140
|
+
children: /* @__PURE__ */ jsx99("path", { d: "M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z" })
|
|
13253
14141
|
}
|
|
13254
14142
|
);
|
|
13255
|
-
const toggleFieldEdit =
|
|
14143
|
+
const toggleFieldEdit = useCallback18((fieldName) => {
|
|
13256
14144
|
setEditingFields((prev) => ({
|
|
13257
14145
|
...prev,
|
|
13258
14146
|
[fieldName]: !prev[fieldName]
|
|
13259
14147
|
}));
|
|
13260
14148
|
}, []);
|
|
13261
|
-
const getFieldPlaceholder =
|
|
14149
|
+
const getFieldPlaceholder = useCallback18((fieldKey) => {
|
|
13262
14150
|
const fieldLabels = {
|
|
13263
14151
|
name: "organization name",
|
|
13264
14152
|
description: "organization description",
|
|
@@ -13269,7 +14157,7 @@ var BaseOrganizationProfile = ({
|
|
|
13269
14157
|
const fieldLabel = fieldLabels[fieldKey] || fieldKey.toLowerCase();
|
|
13270
14158
|
return `Enter ${fieldLabel}`;
|
|
13271
14159
|
}, []);
|
|
13272
|
-
const handleFieldSave =
|
|
14160
|
+
const handleFieldSave = useCallback18(
|
|
13273
14161
|
(fieldKey) => {
|
|
13274
14162
|
if (!onUpdate || !fieldKey) return;
|
|
13275
14163
|
const fieldValue = editedOrganization && fieldKey && editedOrganization[fieldKey] !== void 0 ? editedOrganization[fieldKey] : organization && organization[fieldKey] !== void 0 ? organization[fieldKey] : "";
|
|
@@ -13281,7 +14169,7 @@ var BaseOrganizationProfile = ({
|
|
|
13281
14169
|
},
|
|
13282
14170
|
[editedOrganization, organization, onUpdate, toggleFieldEdit]
|
|
13283
14171
|
);
|
|
13284
|
-
const handleFieldCancel =
|
|
14172
|
+
const handleFieldCancel = useCallback18(
|
|
13285
14173
|
(fieldKey) => {
|
|
13286
14174
|
setEditedOrganization((prev) => ({
|
|
13287
14175
|
...prev,
|
|
@@ -13307,12 +14195,12 @@ var BaseOrganizationProfile = ({
|
|
|
13307
14195
|
value: typeof fieldValue === "object" ? JSON.stringify(fieldValue) : String(fieldValue || ""),
|
|
13308
14196
|
onChange: (e) => onEditValue(e.target ? e.target.value : e),
|
|
13309
14197
|
placeholder: getFieldPlaceholder(key),
|
|
13310
|
-
className:
|
|
14198
|
+
className: cx33(styles.fieldInput)
|
|
13311
14199
|
};
|
|
13312
14200
|
let fieldInput;
|
|
13313
14201
|
if (key === "attributes") {
|
|
13314
14202
|
const attributesValue = typeof fieldValue === "object" && fieldValue !== null ? fieldValue : {};
|
|
13315
|
-
fieldInput = /* @__PURE__ */
|
|
14203
|
+
fieldInput = /* @__PURE__ */ jsx99(
|
|
13316
14204
|
KeyValueInput_default,
|
|
13317
14205
|
{
|
|
13318
14206
|
value: attributesValue,
|
|
@@ -13350,26 +14238,26 @@ var BaseOrganizationProfile = ({
|
|
|
13350
14238
|
}
|
|
13351
14239
|
);
|
|
13352
14240
|
} else {
|
|
13353
|
-
fieldInput = /* @__PURE__ */
|
|
14241
|
+
fieldInput = /* @__PURE__ */ jsx99(TextField_default, { ...commonProps });
|
|
13354
14242
|
}
|
|
13355
|
-
return /* @__PURE__ */
|
|
13356
|
-
/* @__PURE__ */
|
|
13357
|
-
/* @__PURE__ */
|
|
14243
|
+
return /* @__PURE__ */ jsxs45(Fragment19, { children: [
|
|
14244
|
+
/* @__PURE__ */ jsx99("span", { className: cx33(styles.label), children: label }),
|
|
14245
|
+
/* @__PURE__ */ jsx99("div", { className: cx33(styles.value), children: fieldInput })
|
|
13358
14246
|
] });
|
|
13359
14247
|
}
|
|
13360
14248
|
const hasValue = value !== void 0 && value !== null && value !== "";
|
|
13361
14249
|
const isFieldEditable = editable && fieldEditable;
|
|
13362
14250
|
let displayValue;
|
|
13363
14251
|
if (hasValue) {
|
|
13364
|
-
displayValue = key === "attributes" && typeof value === "object" && value !== null ? /* @__PURE__ */
|
|
14252
|
+
displayValue = key === "attributes" && typeof value === "object" && value !== null ? /* @__PURE__ */ jsx99(KeyValueInput_default, { value, readOnly: true, label: "" }) : String(renderedValue);
|
|
13365
14253
|
} else if (isFieldEditable) {
|
|
13366
14254
|
displayValue = getFieldPlaceholder(key);
|
|
13367
14255
|
} else {
|
|
13368
14256
|
displayValue = "-";
|
|
13369
14257
|
}
|
|
13370
|
-
return /* @__PURE__ */
|
|
13371
|
-
/* @__PURE__ */
|
|
13372
|
-
/* @__PURE__ */
|
|
14258
|
+
return /* @__PURE__ */ jsxs45(Fragment19, { children: [
|
|
14259
|
+
/* @__PURE__ */ jsx99("span", { className: cx33(styles.label), children: label }),
|
|
14260
|
+
/* @__PURE__ */ jsx99("div", { className: cx33(styles.value, !hasValue && styles.valueEmpty), children: !hasValue && isFieldEditable && onStartEdit ? /* @__PURE__ */ jsx99(
|
|
13373
14261
|
Button_default,
|
|
13374
14262
|
{
|
|
13375
14263
|
onClick: onStartEdit,
|
|
@@ -13377,7 +14265,7 @@ var BaseOrganizationProfile = ({
|
|
|
13377
14265
|
color: "secondary",
|
|
13378
14266
|
size: "small",
|
|
13379
14267
|
title: "Click to edit",
|
|
13380
|
-
className:
|
|
14268
|
+
className: cx33(styles.placeholderButton),
|
|
13381
14269
|
children: displayValue
|
|
13382
14270
|
}
|
|
13383
14271
|
) : displayValue })
|
|
@@ -13392,8 +14280,8 @@ var BaseOrganizationProfile = ({
|
|
|
13392
14280
|
if (!shouldShow) {
|
|
13393
14281
|
return null;
|
|
13394
14282
|
}
|
|
13395
|
-
return /* @__PURE__ */
|
|
13396
|
-
/* @__PURE__ */
|
|
14283
|
+
return /* @__PURE__ */ jsxs45("div", { className: cx33(styles.field), children: [
|
|
14284
|
+
/* @__PURE__ */ jsx99("div", { className: cx33(styles.fieldContent), children: renderField(
|
|
13397
14285
|
field,
|
|
13398
14286
|
isFieldEditing,
|
|
13399
14287
|
(value) => {
|
|
@@ -13403,8 +14291,8 @@ var BaseOrganizationProfile = ({
|
|
|
13403
14291
|
},
|
|
13404
14292
|
() => toggleFieldEdit(field.key)
|
|
13405
14293
|
) }),
|
|
13406
|
-
isFieldEditable && /* @__PURE__ */
|
|
13407
|
-
/* @__PURE__ */
|
|
14294
|
+
isFieldEditable && /* @__PURE__ */ jsx99("div", { className: cx33(styles.fieldActions), children: isFieldEditing ? /* @__PURE__ */ jsxs45(Fragment19, { children: [
|
|
14295
|
+
/* @__PURE__ */ jsx99(
|
|
13408
14296
|
Button_default,
|
|
13409
14297
|
{
|
|
13410
14298
|
onClick: () => handleFieldSave(field.key),
|
|
@@ -13415,7 +14303,7 @@ var BaseOrganizationProfile = ({
|
|
|
13415
14303
|
children: saveButtonText
|
|
13416
14304
|
}
|
|
13417
14305
|
),
|
|
13418
|
-
/* @__PURE__ */
|
|
14306
|
+
/* @__PURE__ */ jsx99(
|
|
13419
14307
|
Button_default,
|
|
13420
14308
|
{
|
|
13421
14309
|
onClick: () => handleFieldCancel(field.key),
|
|
@@ -13426,7 +14314,7 @@ var BaseOrganizationProfile = ({
|
|
|
13426
14314
|
children: cancelButtonText
|
|
13427
14315
|
}
|
|
13428
14316
|
)
|
|
13429
|
-
] }) : hasValue && /* @__PURE__ */
|
|
14317
|
+
] }) : hasValue && /* @__PURE__ */ jsx99(
|
|
13430
14318
|
Button_default,
|
|
13431
14319
|
{
|
|
13432
14320
|
onClick: () => toggleFieldEdit(field.key),
|
|
@@ -13434,8 +14322,8 @@ var BaseOrganizationProfile = ({
|
|
|
13434
14322
|
color: "secondary",
|
|
13435
14323
|
size: "small",
|
|
13436
14324
|
title: "Edit field",
|
|
13437
|
-
className:
|
|
13438
|
-
children: /* @__PURE__ */
|
|
14325
|
+
className: cx33(styles.editButton),
|
|
14326
|
+
children: /* @__PURE__ */ jsx99(PencilIcon, {})
|
|
13439
14327
|
}
|
|
13440
14328
|
) })
|
|
13441
14329
|
] }, field.key);
|
|
@@ -13443,23 +14331,23 @@ var BaseOrganizationProfile = ({
|
|
|
13443
14331
|
if (!organization) {
|
|
13444
14332
|
return fallback;
|
|
13445
14333
|
}
|
|
13446
|
-
const profileContent = /* @__PURE__ */
|
|
13447
|
-
/* @__PURE__ */
|
|
13448
|
-
/* @__PURE__ */
|
|
13449
|
-
/* @__PURE__ */
|
|
13450
|
-
/* @__PURE__ */
|
|
13451
|
-
organization.orgHandle && /* @__PURE__ */
|
|
14334
|
+
const profileContent = /* @__PURE__ */ jsxs45(Card_default, { className: cx33(styles.root, cardLayout && styles.card, className), children: [
|
|
14335
|
+
/* @__PURE__ */ jsxs45("div", { className: cx33(styles.header), children: [
|
|
14336
|
+
/* @__PURE__ */ jsx99(Avatar, { name: getOrgInitials(organization.name), size: 80, alt: `${organization.name} logo` }),
|
|
14337
|
+
/* @__PURE__ */ jsxs45("div", { className: cx33(styles.orgInfo), children: [
|
|
14338
|
+
/* @__PURE__ */ jsx99("h2", { className: cx33(styles.name), children: organization.name }),
|
|
14339
|
+
organization.orgHandle && /* @__PURE__ */ jsxs45("p", { className: cx33(styles.handle), children: [
|
|
13452
14340
|
"@",
|
|
13453
14341
|
organization.orgHandle
|
|
13454
14342
|
] })
|
|
13455
14343
|
] })
|
|
13456
14344
|
] }),
|
|
13457
|
-
/* @__PURE__ */
|
|
14345
|
+
/* @__PURE__ */ jsx99("div", { className: cx33(styles.infoContainer), children: fields.map((field, index) => renderOrganizationField(field)) })
|
|
13458
14346
|
] });
|
|
13459
14347
|
if (mode === "popup") {
|
|
13460
|
-
return /* @__PURE__ */
|
|
13461
|
-
/* @__PURE__ */
|
|
13462
|
-
/* @__PURE__ */
|
|
14348
|
+
return /* @__PURE__ */ jsx99(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs45(Dialog_default.Content, { children: [
|
|
14349
|
+
/* @__PURE__ */ jsx99(Dialog_default.Heading, { children: title }),
|
|
14350
|
+
/* @__PURE__ */ jsx99("div", { className: cx33(styles.popup), children: profileContent })
|
|
13463
14351
|
] }) });
|
|
13464
14352
|
}
|
|
13465
14353
|
return profileContent;
|
|
@@ -13528,7 +14416,7 @@ var updateOrganization = async ({
|
|
|
13528
14416
|
var updateOrganization_default = updateOrganization;
|
|
13529
14417
|
|
|
13530
14418
|
// src/components/presentation/OrganizationProfile/OrganizationProfile.tsx
|
|
13531
|
-
import { jsx as
|
|
14419
|
+
import { jsx as jsx100 } from "react/jsx-runtime";
|
|
13532
14420
|
var OrganizationProfile = ({
|
|
13533
14421
|
organizationId,
|
|
13534
14422
|
mode = "default",
|
|
@@ -13536,15 +14424,15 @@ var OrganizationProfile = ({
|
|
|
13536
14424
|
onOpenChange,
|
|
13537
14425
|
onUpdate,
|
|
13538
14426
|
popupTitle,
|
|
13539
|
-
loadingFallback = /* @__PURE__ */
|
|
13540
|
-
errorFallback = /* @__PURE__ */
|
|
14427
|
+
loadingFallback = /* @__PURE__ */ jsx100("div", { children: "Loading organization..." }),
|
|
14428
|
+
errorFallback = /* @__PURE__ */ jsx100("div", { children: "Failed to load organization data" }),
|
|
13541
14429
|
...rest
|
|
13542
14430
|
}) => {
|
|
13543
14431
|
const { baseUrl } = useAsgardeo_default();
|
|
13544
14432
|
const { t } = useTranslation_default();
|
|
13545
|
-
const [organization, setOrganization] =
|
|
13546
|
-
const [loading, setLoading] =
|
|
13547
|
-
const [error, setError] =
|
|
14433
|
+
const [organization, setOrganization] = useState31(null);
|
|
14434
|
+
const [loading, setLoading] = useState31(true);
|
|
14435
|
+
const [error, setError] = useState31(false);
|
|
13548
14436
|
const fetchOrganization = async () => {
|
|
13549
14437
|
if (!baseUrl || !organizationId) {
|
|
13550
14438
|
setLoading(false);
|
|
@@ -13567,7 +14455,7 @@ var OrganizationProfile = ({
|
|
|
13567
14455
|
setLoading(false);
|
|
13568
14456
|
}
|
|
13569
14457
|
};
|
|
13570
|
-
|
|
14458
|
+
useEffect18(() => {
|
|
13571
14459
|
fetchOrganization();
|
|
13572
14460
|
}, [baseUrl, organizationId]);
|
|
13573
14461
|
const handleOrganizationUpdate = async (payload) => {
|
|
@@ -13588,7 +14476,7 @@ var OrganizationProfile = ({
|
|
|
13588
14476
|
throw err;
|
|
13589
14477
|
}
|
|
13590
14478
|
};
|
|
13591
|
-
return /* @__PURE__ */
|
|
14479
|
+
return /* @__PURE__ */ jsx100(
|
|
13592
14480
|
BaseOrganizationProfile_default,
|
|
13593
14481
|
{
|
|
13594
14482
|
organization,
|
|
@@ -13604,26 +14492,26 @@ var OrganizationProfile = ({
|
|
|
13604
14492
|
var OrganizationProfile_default = OrganizationProfile;
|
|
13605
14493
|
|
|
13606
14494
|
// src/components/presentation/OrganizationList/OrganizationList.tsx
|
|
13607
|
-
import { cx as
|
|
13608
|
-
import { useEffect as
|
|
14495
|
+
import { cx as cx35 } from "@emotion/css";
|
|
14496
|
+
import { useEffect as useEffect19, useState as useState32 } from "react";
|
|
13609
14497
|
|
|
13610
14498
|
// src/components/presentation/OrganizationList/BaseOrganizationList.tsx
|
|
13611
|
-
import { cx as
|
|
13612
|
-
import { useMemo as
|
|
14499
|
+
import { cx as cx34 } from "@emotion/css";
|
|
14500
|
+
import { useMemo as useMemo39 } from "react";
|
|
13613
14501
|
|
|
13614
14502
|
// src/components/presentation/OrganizationList/BaseOrganizationList.styles.ts
|
|
13615
|
-
import { css as
|
|
13616
|
-
import { useMemo as
|
|
13617
|
-
var
|
|
13618
|
-
return
|
|
13619
|
-
const root =
|
|
14503
|
+
import { css as css29 } from "@emotion/css";
|
|
14504
|
+
import { useMemo as useMemo38 } from "react";
|
|
14505
|
+
var useStyles29 = (theme, colorScheme) => {
|
|
14506
|
+
return useMemo38(() => {
|
|
14507
|
+
const root = css29`
|
|
13620
14508
|
padding: calc(${theme.vars.spacing.unit} * 4);
|
|
13621
14509
|
min-width: 600px;
|
|
13622
14510
|
margin: 0 auto;
|
|
13623
14511
|
background: ${theme.vars.colors.background.surface};
|
|
13624
14512
|
border-radius: ${theme.vars.borderRadius.large};
|
|
13625
14513
|
`;
|
|
13626
|
-
const header =
|
|
14514
|
+
const header = css29`
|
|
13627
14515
|
display: flex;
|
|
13628
14516
|
align-items: center;
|
|
13629
14517
|
justify-content: space-between;
|
|
@@ -13631,21 +14519,21 @@ var useStyles27 = (theme, colorScheme) => {
|
|
|
13631
14519
|
padding-bottom: calc(${theme.vars.spacing.unit} * 2);
|
|
13632
14520
|
border-bottom: 1px solid ${theme.vars.colors.border};
|
|
13633
14521
|
`;
|
|
13634
|
-
const headerInfo =
|
|
14522
|
+
const headerInfo = css29`
|
|
13635
14523
|
flex: 1;
|
|
13636
14524
|
`;
|
|
13637
|
-
const title =
|
|
14525
|
+
const title = css29`
|
|
13638
14526
|
font-size: 1.5rem;
|
|
13639
14527
|
font-weight: 600;
|
|
13640
14528
|
margin: 0 0 8px 0;
|
|
13641
14529
|
color: ${theme.vars.colors.text.primary};
|
|
13642
14530
|
`;
|
|
13643
|
-
const subtitle =
|
|
14531
|
+
const subtitle = css29`
|
|
13644
14532
|
color: ${theme.vars.colors.text.secondary};
|
|
13645
14533
|
font-size: 0.875rem;
|
|
13646
14534
|
margin: 0;
|
|
13647
14535
|
`;
|
|
13648
|
-
const refreshButton =
|
|
14536
|
+
const refreshButton = css29`
|
|
13649
14537
|
background-color: ${theme.vars.colors.background.surface};
|
|
13650
14538
|
border: 1px solid ${theme.vars.colors.border};
|
|
13651
14539
|
border-radius: ${theme.vars.borderRadius.small};
|
|
@@ -13659,12 +14547,12 @@ var useStyles27 = (theme, colorScheme) => {
|
|
|
13659
14547
|
border-color: ${theme.vars.colors.primary.main};
|
|
13660
14548
|
}
|
|
13661
14549
|
`;
|
|
13662
|
-
const listContainer =
|
|
14550
|
+
const listContainer = css29`
|
|
13663
14551
|
display: flex;
|
|
13664
14552
|
flex-direction: column;
|
|
13665
14553
|
gap: calc(${theme.vars.spacing.unit} * 1.5);
|
|
13666
14554
|
`;
|
|
13667
|
-
const organizationItem =
|
|
14555
|
+
const organizationItem = css29`
|
|
13668
14556
|
border: 1px solid ${theme.vars.colors.border};
|
|
13669
14557
|
border-radius: ${theme.vars.borderRadius.medium};
|
|
13670
14558
|
display: flex;
|
|
@@ -13677,46 +14565,46 @@ var useStyles27 = (theme, colorScheme) => {
|
|
|
13677
14565
|
box-shadow: 0 2px 8px ${theme.vars.colors.primary.main}20;
|
|
13678
14566
|
}
|
|
13679
14567
|
`;
|
|
13680
|
-
const organizationContent =
|
|
14568
|
+
const organizationContent = css29`
|
|
13681
14569
|
display: flex;
|
|
13682
14570
|
align-items: center;
|
|
13683
14571
|
gap: calc(${theme.vars.spacing.unit} * 2);
|
|
13684
14572
|
flex: 1;
|
|
13685
14573
|
`;
|
|
13686
|
-
const organizationInfo =
|
|
14574
|
+
const organizationInfo = css29`
|
|
13687
14575
|
flex: 1;
|
|
13688
14576
|
`;
|
|
13689
|
-
const organizationName =
|
|
14577
|
+
const organizationName = css29`
|
|
13690
14578
|
font-size: 1.125rem;
|
|
13691
14579
|
font-weight: 600;
|
|
13692
14580
|
margin: 0 0 4px 0;
|
|
13693
14581
|
color: ${theme.vars.colors.text.primary};
|
|
13694
14582
|
`;
|
|
13695
|
-
const organizationHandle =
|
|
14583
|
+
const organizationHandle = css29`
|
|
13696
14584
|
color: ${theme.vars.colors.text.secondary};
|
|
13697
14585
|
font-size: 0.875rem;
|
|
13698
14586
|
margin: 0 0 4px 0;
|
|
13699
14587
|
font-family: monospace;
|
|
13700
14588
|
`;
|
|
13701
|
-
const organizationStatus =
|
|
14589
|
+
const organizationStatus = css29`
|
|
13702
14590
|
color: ${theme.vars.colors.text.secondary};
|
|
13703
14591
|
font-size: 0.875rem;
|
|
13704
14592
|
margin: 0;
|
|
13705
14593
|
`;
|
|
13706
|
-
const statusText =
|
|
14594
|
+
const statusText = css29`
|
|
13707
14595
|
font-weight: 500;
|
|
13708
14596
|
`;
|
|
13709
|
-
const statusTextActive =
|
|
14597
|
+
const statusTextActive = css29`
|
|
13710
14598
|
color: ${theme.vars.colors.success.main};
|
|
13711
14599
|
`;
|
|
13712
|
-
const statusTextInactive =
|
|
14600
|
+
const statusTextInactive = css29`
|
|
13713
14601
|
color: ${theme.vars.colors.error.main};
|
|
13714
14602
|
`;
|
|
13715
|
-
const organizationActions =
|
|
14603
|
+
const organizationActions = css29`
|
|
13716
14604
|
display: flex;
|
|
13717
14605
|
align-items: center;
|
|
13718
14606
|
`;
|
|
13719
|
-
const badge =
|
|
14607
|
+
const badge = css29`
|
|
13720
14608
|
border-radius: ${theme.vars.borderRadius.large};
|
|
13721
14609
|
font-size: 0.75rem;
|
|
13722
14610
|
font-weight: 500;
|
|
@@ -13724,15 +14612,15 @@ var useStyles27 = (theme, colorScheme) => {
|
|
|
13724
14612
|
text-transform: uppercase;
|
|
13725
14613
|
letter-spacing: 0.5px;
|
|
13726
14614
|
`;
|
|
13727
|
-
const badgeSuccess =
|
|
14615
|
+
const badgeSuccess = css29`
|
|
13728
14616
|
background-color: color-mix(in srgb, ${theme.vars.colors.success.main} 20%, transparent);
|
|
13729
14617
|
color: ${theme.vars.colors.success.main};
|
|
13730
14618
|
`;
|
|
13731
|
-
const badgeError =
|
|
14619
|
+
const badgeError = css29`
|
|
13732
14620
|
background-color: color-mix(in srgb, ${theme.vars.colors.error.main} 20%, transparent);
|
|
13733
14621
|
color: ${theme.vars.colors.error.main};
|
|
13734
14622
|
`;
|
|
13735
|
-
const loadingContainer =
|
|
14623
|
+
const loadingContainer = css29`
|
|
13736
14624
|
padding: calc(${theme.vars.spacing.unit} * 4);
|
|
13737
14625
|
text-align: center;
|
|
13738
14626
|
display: flex;
|
|
@@ -13740,25 +14628,25 @@ var useStyles27 = (theme, colorScheme) => {
|
|
|
13740
14628
|
align-items: center;
|
|
13741
14629
|
gap: calc(${theme.vars.spacing.unit} * 2);
|
|
13742
14630
|
`;
|
|
13743
|
-
const loadingText =
|
|
14631
|
+
const loadingText = css29`
|
|
13744
14632
|
margin-top: ${theme.vars.spacing.unit};
|
|
13745
14633
|
`;
|
|
13746
|
-
const errorContainer =
|
|
14634
|
+
const errorContainer = css29`
|
|
13747
14635
|
background-color: color-mix(in srgb, ${theme.vars.colors.error.main} 20%, transparent);
|
|
13748
14636
|
border: 1px solid ${theme.vars.colors.error.main};
|
|
13749
14637
|
border-radius: ${theme.vars.borderRadius.medium};
|
|
13750
14638
|
color: ${theme.vars.colors.error.main};
|
|
13751
14639
|
padding: calc(${theme.vars.spacing.unit} * 2);
|
|
13752
14640
|
`;
|
|
13753
|
-
const emptyContainer =
|
|
14641
|
+
const emptyContainer = css29`
|
|
13754
14642
|
padding: calc(${theme.vars.spacing.unit} * 4);
|
|
13755
14643
|
text-align: center;
|
|
13756
14644
|
`;
|
|
13757
|
-
const emptyText =
|
|
14645
|
+
const emptyText = css29`
|
|
13758
14646
|
color: ${theme.vars.colors.text.secondary};
|
|
13759
14647
|
font-size: 1rem;
|
|
13760
14648
|
`;
|
|
13761
|
-
const loadMoreButton =
|
|
14649
|
+
const loadMoreButton = css29`
|
|
13762
14650
|
background-color: ${theme.vars.colors.primary.main};
|
|
13763
14651
|
border: none;
|
|
13764
14652
|
border-radius: ${theme.vars.borderRadius.medium};
|
|
@@ -13779,13 +14667,13 @@ var useStyles27 = (theme, colorScheme) => {
|
|
|
13779
14667
|
opacity: 0.6;
|
|
13780
14668
|
}
|
|
13781
14669
|
`;
|
|
13782
|
-
const errorMargin =
|
|
14670
|
+
const errorMargin = css29`
|
|
13783
14671
|
margin-top: calc(${theme.vars.spacing.unit} * 2);
|
|
13784
14672
|
`;
|
|
13785
|
-
const loadMoreMargin =
|
|
14673
|
+
const loadMoreMargin = css29`
|
|
13786
14674
|
margin-top: calc(${theme.vars.spacing.unit} * 3);
|
|
13787
14675
|
`;
|
|
13788
|
-
const popupContent =
|
|
14676
|
+
const popupContent = css29`
|
|
13789
14677
|
padding: ${theme.vars.spacing.unit};
|
|
13790
14678
|
`;
|
|
13791
14679
|
return {
|
|
@@ -13835,27 +14723,27 @@ var useStyles27 = (theme, colorScheme) => {
|
|
|
13835
14723
|
colorScheme
|
|
13836
14724
|
]);
|
|
13837
14725
|
};
|
|
13838
|
-
var BaseOrganizationList_styles_default =
|
|
14726
|
+
var BaseOrganizationList_styles_default = useStyles29;
|
|
13839
14727
|
|
|
13840
14728
|
// src/components/presentation/OrganizationList/BaseOrganizationList.tsx
|
|
13841
|
-
import { jsx as
|
|
14729
|
+
import { jsx as jsx101, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
13842
14730
|
var defaultRenderOrganization = (organization, styles, t, onOrganizationSelect, showStatus) => {
|
|
13843
|
-
return /* @__PURE__ */
|
|
13844
|
-
/* @__PURE__ */
|
|
13845
|
-
/* @__PURE__ */
|
|
13846
|
-
/* @__PURE__ */
|
|
13847
|
-
/* @__PURE__ */
|
|
13848
|
-
/* @__PURE__ */
|
|
14731
|
+
return /* @__PURE__ */ jsxs46("div", { className: cx34(styles.organizationItem), children: [
|
|
14732
|
+
/* @__PURE__ */ jsxs46("div", { className: cx34(styles.organizationContent), children: [
|
|
14733
|
+
/* @__PURE__ */ jsx101(Avatar_default, { variant: "square", name: organization.name, size: 48, alt: `${organization.name} logo` }),
|
|
14734
|
+
/* @__PURE__ */ jsxs46("div", { className: cx34(styles.organizationInfo), children: [
|
|
14735
|
+
/* @__PURE__ */ jsx101(Typography_default, { variant: "h6", className: cx34(styles.organizationName), children: organization.name }),
|
|
14736
|
+
/* @__PURE__ */ jsxs46(Typography_default, { variant: "body2", color: "textSecondary", className: cx34(styles.organizationHandle), children: [
|
|
13849
14737
|
"@",
|
|
13850
14738
|
organization.orgHandle
|
|
13851
14739
|
] }),
|
|
13852
|
-
showStatus && /* @__PURE__ */
|
|
14740
|
+
showStatus && /* @__PURE__ */ jsxs46(Typography_default, { variant: "body2", color: "textSecondary", className: cx34(styles.organizationStatus), children: [
|
|
13853
14741
|
t("organization.switcher.status.label"),
|
|
13854
14742
|
" ",
|
|
13855
|
-
/* @__PURE__ */
|
|
14743
|
+
/* @__PURE__ */ jsx101(
|
|
13856
14744
|
"span",
|
|
13857
14745
|
{
|
|
13858
|
-
className:
|
|
14746
|
+
className: cx34(
|
|
13859
14747
|
styles.statusText,
|
|
13860
14748
|
organization.status === "ACTIVE" ? styles.statusTextActive : styles.statusTextInactive
|
|
13861
14749
|
),
|
|
@@ -13865,7 +14753,7 @@ var defaultRenderOrganization = (organization, styles, t, onOrganizationSelect,
|
|
|
13865
14753
|
] })
|
|
13866
14754
|
] })
|
|
13867
14755
|
] }),
|
|
13868
|
-
organization.canSwitch && /* @__PURE__ */
|
|
14756
|
+
organization.canSwitch && /* @__PURE__ */ jsx101("div", { className: cx34(styles.organizationActions), children: /* @__PURE__ */ jsx101(
|
|
13869
14757
|
Button_default,
|
|
13870
14758
|
{
|
|
13871
14759
|
onClick: (e) => {
|
|
@@ -13879,17 +14767,17 @@ var defaultRenderOrganization = (organization, styles, t, onOrganizationSelect,
|
|
|
13879
14767
|
) })
|
|
13880
14768
|
] }, organization.id);
|
|
13881
14769
|
};
|
|
13882
|
-
var defaultRenderLoading = (t, styles) => /* @__PURE__ */
|
|
13883
|
-
/* @__PURE__ */
|
|
13884
|
-
/* @__PURE__ */
|
|
14770
|
+
var defaultRenderLoading = (t, styles) => /* @__PURE__ */ jsxs46("div", { className: cx34(styles.loadingContainer), children: [
|
|
14771
|
+
/* @__PURE__ */ jsx101(Spinner_default, { size: "medium" }),
|
|
14772
|
+
/* @__PURE__ */ jsx101(Typography_default, { variant: "body1", color: "textSecondary", className: cx34(styles.loadingText), children: t("organization.switcher.loading.placeholder.organizations") })
|
|
13885
14773
|
] });
|
|
13886
|
-
var defaultRenderError = (error, t, styles) => /* @__PURE__ */
|
|
13887
|
-
/* @__PURE__ */
|
|
14774
|
+
var defaultRenderError = (error, t, styles) => /* @__PURE__ */ jsx101("div", { className: cx34(styles.errorContainer), children: /* @__PURE__ */ jsxs46(Typography_default, { variant: "body1", color: "error", children: [
|
|
14775
|
+
/* @__PURE__ */ jsx101("strong", { children: t("organization.switcher.error.prefix") }),
|
|
13888
14776
|
" ",
|
|
13889
14777
|
error
|
|
13890
14778
|
] }) });
|
|
13891
|
-
var defaultRenderLoadMore = (onLoadMore, isLoading, t, styles) => /* @__PURE__ */
|
|
13892
|
-
var defaultRenderEmpty = (t, styles) => /* @__PURE__ */
|
|
14779
|
+
var defaultRenderLoadMore = (onLoadMore, isLoading, t, styles) => /* @__PURE__ */ jsx101(Button_default, { onClick: onLoadMore, disabled: isLoading, className: cx34(styles.loadMoreButton), type: "button", fullWidth: true, children: isLoading ? t("organization.switcher.loading.more") : t("organization.switcher.buttons.load_more.text") });
|
|
14780
|
+
var defaultRenderEmpty = (t, styles) => /* @__PURE__ */ jsx101("div", { className: cx34(styles.emptyContainer), children: /* @__PURE__ */ jsx101(Typography_default, { variant: "body1", color: "textSecondary", className: cx34(styles.emptyText), children: t("organization.switcher.no.organizations") }) });
|
|
13893
14781
|
var BaseOrganizationList = ({
|
|
13894
14782
|
className = "",
|
|
13895
14783
|
allOrganizations,
|
|
@@ -13916,7 +14804,7 @@ var BaseOrganizationList = ({
|
|
|
13916
14804
|
const { theme, colorScheme } = useTheme_default();
|
|
13917
14805
|
const styles = BaseOrganizationList_styles_default(theme, colorScheme);
|
|
13918
14806
|
const { t } = useTranslation_default();
|
|
13919
|
-
const organizationsWithSwitchAccess =
|
|
14807
|
+
const organizationsWithSwitchAccess = useMemo39(() => {
|
|
13920
14808
|
if (!allOrganizations?.organizations) {
|
|
13921
14809
|
return [];
|
|
13922
14810
|
}
|
|
@@ -13932,53 +14820,53 @@ var BaseOrganizationList = ({
|
|
|
13932
14820
|
const renderLoadMoreWithStyles = renderLoadMore || ((onLoadMore, isLoading2) => defaultRenderLoadMore(onLoadMore, isLoading2, t, styles));
|
|
13933
14821
|
const renderOrganizationWithStyles = renderOrganization || ((org) => defaultRenderOrganization(org, styles, t, onOrganizationSelect, showStatus));
|
|
13934
14822
|
if (isLoading && organizationsWithSwitchAccess?.length === 0) {
|
|
13935
|
-
const loadingContent = /* @__PURE__ */
|
|
14823
|
+
const loadingContent = /* @__PURE__ */ jsx101("div", { className: cx34(styles.root, className), style, children: renderLoadingWithStyles() });
|
|
13936
14824
|
if (mode === "popup") {
|
|
13937
|
-
return /* @__PURE__ */
|
|
13938
|
-
/* @__PURE__ */
|
|
13939
|
-
/* @__PURE__ */
|
|
14825
|
+
return /* @__PURE__ */ jsx101(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs46(Dialog_default.Content, { children: [
|
|
14826
|
+
/* @__PURE__ */ jsx101(Dialog_default.Heading, { children: title }),
|
|
14827
|
+
/* @__PURE__ */ jsx101("div", { className: cx34(styles.popupContent), children: loadingContent })
|
|
13940
14828
|
] }) });
|
|
13941
14829
|
}
|
|
13942
14830
|
return loadingContent;
|
|
13943
14831
|
}
|
|
13944
14832
|
if (error && organizationsWithSwitchAccess?.length === 0) {
|
|
13945
|
-
const errorContent = /* @__PURE__ */
|
|
14833
|
+
const errorContent = /* @__PURE__ */ jsx101("div", { className: cx34(styles.root, className), style, children: renderErrorWithStyles(error) });
|
|
13946
14834
|
if (mode === "popup") {
|
|
13947
|
-
return /* @__PURE__ */
|
|
13948
|
-
/* @__PURE__ */
|
|
13949
|
-
/* @__PURE__ */
|
|
14835
|
+
return /* @__PURE__ */ jsx101(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs46(Dialog_default.Content, { children: [
|
|
14836
|
+
/* @__PURE__ */ jsx101(Dialog_default.Heading, { children: title }),
|
|
14837
|
+
/* @__PURE__ */ jsx101("div", { className: cx34(styles.popupContent), children: errorContent })
|
|
13950
14838
|
] }) });
|
|
13951
14839
|
}
|
|
13952
14840
|
return errorContent;
|
|
13953
14841
|
}
|
|
13954
14842
|
if (!isLoading && organizationsWithSwitchAccess?.length === 0) {
|
|
13955
|
-
const emptyContent = /* @__PURE__ */
|
|
14843
|
+
const emptyContent = /* @__PURE__ */ jsx101("div", { className: cx34(styles.root, className), style, children: renderEmptyWithStyles() });
|
|
13956
14844
|
if (mode === "popup") {
|
|
13957
|
-
return /* @__PURE__ */
|
|
13958
|
-
/* @__PURE__ */
|
|
13959
|
-
/* @__PURE__ */
|
|
14845
|
+
return /* @__PURE__ */ jsx101(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs46(Dialog_default.Content, { children: [
|
|
14846
|
+
/* @__PURE__ */ jsx101(Dialog_default.Heading, { children: title }),
|
|
14847
|
+
/* @__PURE__ */ jsx101("div", { className: cx34(styles.popupContent), children: emptyContent })
|
|
13960
14848
|
] }) });
|
|
13961
14849
|
}
|
|
13962
14850
|
return emptyContent;
|
|
13963
14851
|
}
|
|
13964
|
-
const organizationListContent = /* @__PURE__ */
|
|
13965
|
-
/* @__PURE__ */
|
|
13966
|
-
/* @__PURE__ */
|
|
14852
|
+
const organizationListContent = /* @__PURE__ */ jsxs46("div", { className: cx34(styles.root, className), style, children: [
|
|
14853
|
+
/* @__PURE__ */ jsxs46("div", { className: cx34(styles.header), children: [
|
|
14854
|
+
/* @__PURE__ */ jsx101("div", { className: cx34(styles.headerInfo), children: /* @__PURE__ */ jsx101(Typography_default, { variant: "body2", color: "textSecondary", className: cx34(styles.subtitle), children: t("organization.switcher.showing.count", {
|
|
13967
14855
|
showing: organizationsWithSwitchAccess?.length,
|
|
13968
14856
|
total: allOrganizations?.organizations?.length || 0
|
|
13969
14857
|
}) }) }),
|
|
13970
|
-
onRefresh && /* @__PURE__ */
|
|
14858
|
+
onRefresh && /* @__PURE__ */ jsx101(Button_default, { onClick: onRefresh, className: cx34(styles.refreshButton), type: "button", variant: "outline", size: "small", children: t("organization.switcher.buttons.refresh.text") })
|
|
13971
14859
|
] }),
|
|
13972
|
-
/* @__PURE__ */
|
|
14860
|
+
/* @__PURE__ */ jsx101("div", { className: cx34(styles.listContainer), children: organizationsWithSwitchAccess?.map(
|
|
13973
14861
|
(organization, index) => renderOrganizationWithStyles(organization, index)
|
|
13974
14862
|
) }),
|
|
13975
|
-
error && organizationsWithSwitchAccess?.length > 0 && /* @__PURE__ */
|
|
13976
|
-
hasMore && fetchMore && /* @__PURE__ */
|
|
14863
|
+
error && organizationsWithSwitchAccess?.length > 0 && /* @__PURE__ */ jsx101("div", { className: cx34(styles.errorMargin), children: renderErrorWithStyles(error) }),
|
|
14864
|
+
hasMore && fetchMore && /* @__PURE__ */ jsx101("div", { className: cx34(styles.loadMoreMargin), children: renderLoadMoreWithStyles(fetchMore, isLoadingMore) })
|
|
13977
14865
|
] });
|
|
13978
14866
|
if (mode === "popup") {
|
|
13979
|
-
return /* @__PURE__ */
|
|
13980
|
-
/* @__PURE__ */
|
|
13981
|
-
/* @__PURE__ */
|
|
14867
|
+
return /* @__PURE__ */ jsx101(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs46(Dialog_default.Content, { children: [
|
|
14868
|
+
/* @__PURE__ */ jsx101(Dialog_default.Heading, { children: title }),
|
|
14869
|
+
/* @__PURE__ */ jsx101("div", { className: cx34(styles.popupContent), children: organizationListContent })
|
|
13982
14870
|
] }) });
|
|
13983
14871
|
}
|
|
13984
14872
|
return organizationListContent;
|
|
@@ -13986,11 +14874,11 @@ var BaseOrganizationList = ({
|
|
|
13986
14874
|
var BaseOrganizationList_default = BaseOrganizationList;
|
|
13987
14875
|
|
|
13988
14876
|
// src/components/presentation/OrganizationList/OrganizationList.styles.ts
|
|
13989
|
-
import { css as
|
|
13990
|
-
import { useMemo as
|
|
13991
|
-
var
|
|
13992
|
-
return
|
|
13993
|
-
const cssOrganizationListWrapper =
|
|
14877
|
+
import { css as css30 } from "@emotion/css";
|
|
14878
|
+
import { useMemo as useMemo40 } from "react";
|
|
14879
|
+
var useStyles30 = (theme, colorScheme) => {
|
|
14880
|
+
return useMemo40(() => {
|
|
14881
|
+
const cssOrganizationListWrapper = css30`
|
|
13994
14882
|
/* Container wrapper styles for OrganizationList component */
|
|
13995
14883
|
width: 100%;
|
|
13996
14884
|
|
|
@@ -14021,11 +14909,11 @@ var useStyles28 = (theme, colorScheme) => {
|
|
|
14021
14909
|
`;
|
|
14022
14910
|
return {
|
|
14023
14911
|
root: cssOrganizationListWrapper,
|
|
14024
|
-
container:
|
|
14912
|
+
container: css30`
|
|
14025
14913
|
position: relative;
|
|
14026
14914
|
width: 100%;
|
|
14027
14915
|
`,
|
|
14028
|
-
errorState:
|
|
14916
|
+
errorState: css30`
|
|
14029
14917
|
padding: calc(${theme.vars.spacing.unit} * 2);
|
|
14030
14918
|
background-color: color-mix(in srgb, ${theme.vars.colors.error.main} 10%, transparent);
|
|
14031
14919
|
border: 1px solid ${theme.vars.colors.error.main};
|
|
@@ -14033,7 +14921,7 @@ var useStyles28 = (theme, colorScheme) => {
|
|
|
14033
14921
|
color: ${theme.vars.colors.error.main};
|
|
14034
14922
|
text-align: center;
|
|
14035
14923
|
`,
|
|
14036
|
-
loadingOverlay:
|
|
14924
|
+
loadingOverlay: css30`
|
|
14037
14925
|
position: absolute;
|
|
14038
14926
|
inset: 0;
|
|
14039
14927
|
background-color: color-mix(in srgb, ${theme.vars.colors.background.surface} 80%, transparent);
|
|
@@ -14046,10 +14934,10 @@ var useStyles28 = (theme, colorScheme) => {
|
|
|
14046
14934
|
};
|
|
14047
14935
|
}, [theme, colorScheme]);
|
|
14048
14936
|
};
|
|
14049
|
-
var OrganizationList_styles_default =
|
|
14937
|
+
var OrganizationList_styles_default = useStyles30;
|
|
14050
14938
|
|
|
14051
14939
|
// src/components/presentation/OrganizationList/OrganizationList.tsx
|
|
14052
|
-
import { jsx as
|
|
14940
|
+
import { jsx as jsx102 } from "react/jsx-runtime";
|
|
14053
14941
|
var OrganizationList = ({
|
|
14054
14942
|
autoFetch = true,
|
|
14055
14943
|
filter = "",
|
|
@@ -14063,15 +14951,15 @@ var OrganizationList = ({
|
|
|
14063
14951
|
const { theme, colorScheme } = useTheme_default();
|
|
14064
14952
|
const styles = OrganizationList_styles_default(theme, colorScheme);
|
|
14065
14953
|
const { getAllOrganizations: getAllOrganizations2, error, isLoading, myOrganizations } = useOrganization_default();
|
|
14066
|
-
const [allOrganizations, setAllOrganizations] =
|
|
14954
|
+
const [allOrganizations, setAllOrganizations] = useState32({
|
|
14067
14955
|
organizations: []
|
|
14068
14956
|
});
|
|
14069
|
-
|
|
14957
|
+
useEffect19(() => {
|
|
14070
14958
|
(async () => {
|
|
14071
14959
|
setAllOrganizations(await getAllOrganizations2());
|
|
14072
14960
|
})();
|
|
14073
14961
|
}, []);
|
|
14074
|
-
return /* @__PURE__ */
|
|
14962
|
+
return /* @__PURE__ */ jsx102("div", { className: cx35(styles.root, className), style, children: /* @__PURE__ */ jsx102("div", { className: cx35(styles.container), children: /* @__PURE__ */ jsx102(
|
|
14075
14963
|
BaseOrganizationList_default,
|
|
14076
14964
|
{
|
|
14077
14965
|
allOrganizations,
|
|
@@ -14086,8 +14974,8 @@ var OrganizationList = ({
|
|
|
14086
14974
|
var OrganizationList_default = OrganizationList;
|
|
14087
14975
|
|
|
14088
14976
|
// src/components/primitives/Icons/BuildingAlt.tsx
|
|
14089
|
-
import { jsx as
|
|
14090
|
-
var BuildingAlt = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */
|
|
14977
|
+
import { jsx as jsx103, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
14978
|
+
var BuildingAlt = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */ jsxs47(
|
|
14091
14979
|
"svg",
|
|
14092
14980
|
{
|
|
14093
14981
|
width,
|
|
@@ -14100,13 +14988,13 @@ var BuildingAlt = ({ color = "currentColor", height = 24, width = 24 }) => /* @_
|
|
|
14100
14988
|
strokeLinecap: "round",
|
|
14101
14989
|
strokeLinejoin: "round",
|
|
14102
14990
|
children: [
|
|
14103
|
-
/* @__PURE__ */
|
|
14104
|
-
/* @__PURE__ */
|
|
14105
|
-
/* @__PURE__ */
|
|
14106
|
-
/* @__PURE__ */
|
|
14107
|
-
/* @__PURE__ */
|
|
14108
|
-
/* @__PURE__ */
|
|
14109
|
-
/* @__PURE__ */
|
|
14991
|
+
/* @__PURE__ */ jsx103("path", { d: "M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z" }),
|
|
14992
|
+
/* @__PURE__ */ jsx103("path", { d: "M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2" }),
|
|
14993
|
+
/* @__PURE__ */ jsx103("path", { d: "M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2" }),
|
|
14994
|
+
/* @__PURE__ */ jsx103("path", { d: "M10 6h4" }),
|
|
14995
|
+
/* @__PURE__ */ jsx103("path", { d: "M10 10h4" }),
|
|
14996
|
+
/* @__PURE__ */ jsx103("path", { d: "M10 14h4" }),
|
|
14997
|
+
/* @__PURE__ */ jsx103("path", { d: "M10 18h4" })
|
|
14110
14998
|
]
|
|
14111
14999
|
}
|
|
14112
15000
|
);
|
|
@@ -14114,7 +15002,7 @@ BuildingAlt.displayName = "BuildingAlt";
|
|
|
14114
15002
|
var BuildingAlt_default = BuildingAlt;
|
|
14115
15003
|
|
|
14116
15004
|
// src/components/presentation/OrganizationSwitcher/OrganizationSwitcher.tsx
|
|
14117
|
-
import { Fragment as Fragment20, jsx as
|
|
15005
|
+
import { Fragment as Fragment20, jsx as jsx104, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
14118
15006
|
var OrganizationSwitcher = ({
|
|
14119
15007
|
currentOrganization: propCurrentOrganization,
|
|
14120
15008
|
fallback = null,
|
|
@@ -14130,15 +15018,15 @@ var OrganizationSwitcher = ({
|
|
|
14130
15018
|
isLoading,
|
|
14131
15019
|
error
|
|
14132
15020
|
} = useOrganization_default();
|
|
14133
|
-
const [isCreateOrgOpen, setIsCreateOrgOpen] =
|
|
14134
|
-
const [isProfileOpen, setIsProfileOpen] =
|
|
14135
|
-
const [isOrganizationListOpen, setIsOrganizationListOpen] =
|
|
15021
|
+
const [isCreateOrgOpen, setIsCreateOrgOpen] = useState33(false);
|
|
15022
|
+
const [isProfileOpen, setIsProfileOpen] = useState33(false);
|
|
15023
|
+
const [isOrganizationListOpen, setIsOrganizationListOpen] = useState33(false);
|
|
14136
15024
|
const { t } = useTranslation_default();
|
|
14137
15025
|
if (!isSignedIn && fallback) {
|
|
14138
15026
|
return fallback;
|
|
14139
15027
|
}
|
|
14140
15028
|
if (!isSignedIn) {
|
|
14141
|
-
return /* @__PURE__ */
|
|
15029
|
+
return /* @__PURE__ */ jsx104(Fragment20, {});
|
|
14142
15030
|
}
|
|
14143
15031
|
const organizations = propOrganizations || contextOrganizations || [];
|
|
14144
15032
|
const currentOrganization = propCurrentOrganization || contextCurrentOrganization;
|
|
@@ -14152,19 +15040,19 @@ var OrganizationSwitcher = ({
|
|
|
14152
15040
|
const defaultMenuItems = [];
|
|
14153
15041
|
if (currentOrganization) {
|
|
14154
15042
|
defaultMenuItems.push({
|
|
14155
|
-
icon: /* @__PURE__ */
|
|
15043
|
+
icon: /* @__PURE__ */ jsx104(BuildingAlt_default, {}),
|
|
14156
15044
|
label: t("organization.switcher.manage.organizations"),
|
|
14157
15045
|
onClick: handleManageOrganizations
|
|
14158
15046
|
});
|
|
14159
15047
|
}
|
|
14160
15048
|
defaultMenuItems.push({
|
|
14161
|
-
icon: /* @__PURE__ */
|
|
15049
|
+
icon: /* @__PURE__ */ jsx104("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx104("path", { d: "M12 5v14m-7-7h14" }) }),
|
|
14162
15050
|
label: t("organization.switcher.create.organization"),
|
|
14163
15051
|
onClick: () => setIsCreateOrgOpen(true)
|
|
14164
15052
|
});
|
|
14165
15053
|
const menuItems = props.menuItems ? [...defaultMenuItems, ...props.menuItems] : defaultMenuItems;
|
|
14166
|
-
return /* @__PURE__ */
|
|
14167
|
-
/* @__PURE__ */
|
|
15054
|
+
return /* @__PURE__ */ jsxs48(Fragment20, { children: [
|
|
15055
|
+
/* @__PURE__ */ jsx104(
|
|
14168
15056
|
BaseOrganizationSwitcher_default,
|
|
14169
15057
|
{
|
|
14170
15058
|
organizations,
|
|
@@ -14177,7 +15065,7 @@ var OrganizationSwitcher = ({
|
|
|
14177
15065
|
...props
|
|
14178
15066
|
}
|
|
14179
15067
|
),
|
|
14180
|
-
/* @__PURE__ */
|
|
15068
|
+
/* @__PURE__ */ jsx104(
|
|
14181
15069
|
CreateOrganization,
|
|
14182
15070
|
{
|
|
14183
15071
|
mode: "popup",
|
|
@@ -14191,7 +15079,7 @@ var OrganizationSwitcher = ({
|
|
|
14191
15079
|
}
|
|
14192
15080
|
}
|
|
14193
15081
|
),
|
|
14194
|
-
currentOrganization && /* @__PURE__ */
|
|
15082
|
+
currentOrganization && /* @__PURE__ */ jsx104(
|
|
14195
15083
|
OrganizationProfile_default,
|
|
14196
15084
|
{
|
|
14197
15085
|
organizationId: currentOrganization.id,
|
|
@@ -14199,11 +15087,11 @@ var OrganizationSwitcher = ({
|
|
|
14199
15087
|
open: isProfileOpen,
|
|
14200
15088
|
onOpenChange: setIsProfileOpen,
|
|
14201
15089
|
cardLayout: true,
|
|
14202
|
-
loadingFallback: /* @__PURE__ */
|
|
14203
|
-
errorFallback: /* @__PURE__ */
|
|
15090
|
+
loadingFallback: /* @__PURE__ */ jsx104("div", { children: t("organization.profile.loading") }),
|
|
15091
|
+
errorFallback: /* @__PURE__ */ jsx104("div", { children: t("organization.profile.error") })
|
|
14204
15092
|
}
|
|
14205
15093
|
),
|
|
14206
|
-
/* @__PURE__ */
|
|
15094
|
+
/* @__PURE__ */ jsx104(
|
|
14207
15095
|
OrganizationList_default,
|
|
14208
15096
|
{
|
|
14209
15097
|
mode: "popup",
|
|
@@ -14236,13 +15124,16 @@ import {
|
|
|
14236
15124
|
EmbeddedSignInFlowTypeV2 as EmbeddedSignInFlowTypeV22
|
|
14237
15125
|
} from "@asgardeo/browser";
|
|
14238
15126
|
export {
|
|
15127
|
+
AcceptInvite_default as AcceptInvite,
|
|
14239
15128
|
Alert_default as Alert,
|
|
14240
15129
|
AlertDescription,
|
|
14241
15130
|
AlertTitle,
|
|
14242
15131
|
AsgardeoContext_default as AsgardeoContext,
|
|
14243
15132
|
AsgardeoProvider_default as AsgardeoProvider,
|
|
14244
15133
|
AsgardeoRuntimeError9 as AsgardeoRuntimeError,
|
|
15134
|
+
BaseAcceptInvite_default as BaseAcceptInvite,
|
|
14245
15135
|
BaseCreateOrganization,
|
|
15136
|
+
BaseInviteUser_default as BaseInviteUser,
|
|
14246
15137
|
BaseOrganization_default as BaseOrganization,
|
|
14247
15138
|
BaseOrganizationList_default as BaseOrganizationList,
|
|
14248
15139
|
BaseOrganizationProfile_default as BaseOrganizationProfile,
|
|
@@ -14293,6 +15184,7 @@ export {
|
|
|
14293
15184
|
IdentifierFirst_default as IdentifierFirst,
|
|
14294
15185
|
Info_default as Info,
|
|
14295
15186
|
InputLabel_default as InputLabel,
|
|
15187
|
+
InviteUser_default as InviteUser,
|
|
14296
15188
|
KeyValueInput_default as KeyValueInput,
|
|
14297
15189
|
LinkedInButton_default as LinkedInButton,
|
|
14298
15190
|
Loading_default as Loading,
|