@asgardeo/react 0.6.5 → 0.6.6
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 +178 -123
- package/dist/cjs/index.js.map +4 -4
- package/dist/components/adapters/SelectInput.d.ts +24 -0
- package/dist/index.js +55 -0
- package/dist/index.js.map +4 -4
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -36,7 +36,7 @@ __export(index_exports, {
|
|
|
36
36
|
AlertTitle: () => AlertTitle,
|
|
37
37
|
AsgardeoContext: () => AsgardeoContext_default,
|
|
38
38
|
AsgardeoProvider: () => AsgardeoProvider_default,
|
|
39
|
-
AsgardeoRuntimeError: () =>
|
|
39
|
+
AsgardeoRuntimeError: () => import_browser77.AsgardeoRuntimeError,
|
|
40
40
|
BaseCreateOrganization: () => BaseCreateOrganization,
|
|
41
41
|
BaseOrganization: () => BaseOrganization_default,
|
|
42
42
|
BaseOrganizationList: () => BaseOrganizationList_default,
|
|
@@ -125,17 +125,17 @@ __export(index_exports, {
|
|
|
125
125
|
UsernamePassword: () => UsernamePassword_default,
|
|
126
126
|
createField: () => createField,
|
|
127
127
|
createOrganization: () => createOrganization_default,
|
|
128
|
-
createPatchOperations: () =>
|
|
128
|
+
createPatchOperations: () => import_browser76.createPatchOperations,
|
|
129
129
|
createSignInOption: () => createSignInOption,
|
|
130
130
|
createSignInOptionFromAuthenticator: () => createSignInOptionFromAuthenticator,
|
|
131
|
-
getActiveTheme: () =>
|
|
131
|
+
getActiveTheme: () => import_browser77.getActiveTheme,
|
|
132
132
|
getAllOrganizations: () => getAllOrganizations_default,
|
|
133
133
|
getMeOrganizations: () => getMeOrganizations_default,
|
|
134
134
|
getMeProfile: () => getScim2Me_default,
|
|
135
135
|
getOrganization: () => getOrganization_default,
|
|
136
136
|
getSchemas: () => getSchemas_default,
|
|
137
|
-
http: () =>
|
|
138
|
-
navigate: () =>
|
|
137
|
+
http: () => import_browser77.http,
|
|
138
|
+
navigate: () => import_browser77.navigate,
|
|
139
139
|
updateMeProfile: () => updateMeProfile_default,
|
|
140
140
|
updateOrganization: () => updateOrganization_default,
|
|
141
141
|
useAlertVariant: () => useAlertVariant,
|
|
@@ -7113,6 +7113,25 @@ var convertSimpleInputToComponent = (input, t) => {
|
|
|
7113
7113
|
if (input.name.toLowerCase().includes("password") && input.type.toLowerCase() === "string") {
|
|
7114
7114
|
fieldType = "password";
|
|
7115
7115
|
}
|
|
7116
|
+
if (input.type.toLowerCase() === "dropdown") {
|
|
7117
|
+
const label2 = getInputLabel(input.name, fieldType, t);
|
|
7118
|
+
const placeholder2 = getInputPlaceholder(input.name, fieldType, t);
|
|
7119
|
+
return {
|
|
7120
|
+
id: generateId("select"),
|
|
7121
|
+
type: import_browser47.EmbeddedFlowComponentType.Select,
|
|
7122
|
+
variant: "SELECT",
|
|
7123
|
+
config: {
|
|
7124
|
+
type: fieldType,
|
|
7125
|
+
label: label2,
|
|
7126
|
+
placeholder: placeholder2,
|
|
7127
|
+
required: input.required,
|
|
7128
|
+
identifier: input.name,
|
|
7129
|
+
hint: "",
|
|
7130
|
+
options: input.options || []
|
|
7131
|
+
},
|
|
7132
|
+
components: []
|
|
7133
|
+
};
|
|
7134
|
+
}
|
|
7116
7135
|
const variant = getInputVariant(fieldType, input.name);
|
|
7117
7136
|
const label = getInputLabel(input.name, fieldType, t);
|
|
7118
7137
|
const placeholder = getInputPlaceholder(input.name, fieldType, t);
|
|
@@ -7772,12 +7791,12 @@ var SignIn2 = ({ className, size = "medium", children, ...rest }) => {
|
|
|
7772
7791
|
var SignIn_default2 = SignIn2;
|
|
7773
7792
|
|
|
7774
7793
|
// src/components/presentation/SignUp/BaseSignUp.tsx
|
|
7775
|
-
var
|
|
7794
|
+
var import_browser61 = require("@asgardeo/browser");
|
|
7776
7795
|
var import_css38 = require("@emotion/css");
|
|
7777
7796
|
var import_react61 = require("react");
|
|
7778
7797
|
|
|
7779
7798
|
// src/components/presentation/SignUp/SignUpOptionFactory.tsx
|
|
7780
|
-
var
|
|
7799
|
+
var import_browser60 = require("@asgardeo/browser");
|
|
7781
7800
|
|
|
7782
7801
|
// src/components/adapters/CheckboxInput.tsx
|
|
7783
7802
|
var import_browser53 = require("@asgardeo/browser");
|
|
@@ -8140,6 +8159,40 @@ var TextInput = ({
|
|
|
8140
8159
|
};
|
|
8141
8160
|
var TextInput_default = TextInput;
|
|
8142
8161
|
|
|
8162
|
+
// src/components/adapters/SelectInput.tsx
|
|
8163
|
+
var import_browser59 = require("@asgardeo/browser");
|
|
8164
|
+
var SelectInput = ({
|
|
8165
|
+
component,
|
|
8166
|
+
formValues,
|
|
8167
|
+
touchedFields,
|
|
8168
|
+
formErrors,
|
|
8169
|
+
onInputChange,
|
|
8170
|
+
inputClassName
|
|
8171
|
+
}) => {
|
|
8172
|
+
const config = component.config || {};
|
|
8173
|
+
const fieldName = config["identifier"] || config["name"] || component.id;
|
|
8174
|
+
const value = formValues[fieldName] || "";
|
|
8175
|
+
const error = touchedFields[fieldName] ? formErrors[fieldName] : void 0;
|
|
8176
|
+
const rawOptions = config["options"] || [];
|
|
8177
|
+
const options = rawOptions.map((option) => ({
|
|
8178
|
+
label: option,
|
|
8179
|
+
value: option
|
|
8180
|
+
}));
|
|
8181
|
+
return createField({
|
|
8182
|
+
type: import_browser59.FieldType.Select,
|
|
8183
|
+
name: fieldName,
|
|
8184
|
+
label: config["label"] || "",
|
|
8185
|
+
placeholder: config["placeholder"] || "",
|
|
8186
|
+
required: config["required"] || false,
|
|
8187
|
+
value,
|
|
8188
|
+
error,
|
|
8189
|
+
options,
|
|
8190
|
+
onChange: (newValue) => onInputChange(fieldName, newValue),
|
|
8191
|
+
className: inputClassName
|
|
8192
|
+
});
|
|
8193
|
+
};
|
|
8194
|
+
var SelectInput_default = SelectInput;
|
|
8195
|
+
|
|
8143
8196
|
// src/components/adapters/Typography.tsx
|
|
8144
8197
|
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
8145
8198
|
var TypographyComponent = ({ component }) => {
|
|
@@ -8198,9 +8251,9 @@ var Typography_default2 = TypographyComponent;
|
|
|
8198
8251
|
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
8199
8252
|
var createSignUpComponent = ({ component, onSubmit, ...rest }) => {
|
|
8200
8253
|
switch (component.type) {
|
|
8201
|
-
case
|
|
8254
|
+
case import_browser60.EmbeddedFlowComponentType.Typography:
|
|
8202
8255
|
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Typography_default2, { component, onSubmit, ...rest });
|
|
8203
|
-
case
|
|
8256
|
+
case import_browser60.EmbeddedFlowComponentType.Input:
|
|
8204
8257
|
const inputVariant = component.variant?.toUpperCase();
|
|
8205
8258
|
const inputType = component.config["type"]?.toLowerCase();
|
|
8206
8259
|
if (inputVariant === "EMAIL" || inputType === "email") {
|
|
@@ -8222,7 +8275,7 @@ var createSignUpComponent = ({ component, onSubmit, ...rest }) => {
|
|
|
8222
8275
|
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(CheckboxInput_default, { component, onSubmit, ...rest });
|
|
8223
8276
|
}
|
|
8224
8277
|
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(TextInput_default, { component, onSubmit, ...rest });
|
|
8225
|
-
case
|
|
8278
|
+
case import_browser60.EmbeddedFlowComponentType.Button: {
|
|
8226
8279
|
const buttonVariant = component.variant?.toUpperCase();
|
|
8227
8280
|
const buttonText = component.config["text"] || component.config["label"] || "";
|
|
8228
8281
|
if (buttonVariant === "SOCIAL") {
|
|
@@ -8247,11 +8300,13 @@ var createSignUpComponent = ({ component, onSubmit, ...rest }) => {
|
|
|
8247
8300
|
}
|
|
8248
8301
|
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(SubmitButton_default, { component, onSubmit, ...rest });
|
|
8249
8302
|
}
|
|
8250
|
-
case
|
|
8303
|
+
case import_browser60.EmbeddedFlowComponentType.Form:
|
|
8251
8304
|
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(FormContainer_default, { component, onSubmit, ...rest });
|
|
8252
|
-
case
|
|
8305
|
+
case import_browser60.EmbeddedFlowComponentType.Select:
|
|
8306
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(SelectInput_default, { component, onSubmit, ...rest });
|
|
8307
|
+
case import_browser60.EmbeddedFlowComponentType.Divider:
|
|
8253
8308
|
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(DividerComponent_default, { component, onSubmit, ...rest });
|
|
8254
|
-
case
|
|
8309
|
+
case import_browser60.EmbeddedFlowComponentType.Image:
|
|
8255
8310
|
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(ImageComponent_default, { component, onSubmit, ...rest });
|
|
8256
8311
|
default:
|
|
8257
8312
|
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", {});
|
|
@@ -8495,7 +8550,7 @@ var BaseSignUpContent = ({
|
|
|
8495
8550
|
const fields = [];
|
|
8496
8551
|
const processComponents = (comps) => {
|
|
8497
8552
|
comps.forEach((component) => {
|
|
8498
|
-
if (component.type ===
|
|
8553
|
+
if (component.type === import_browser61.EmbeddedFlowComponentType.Input) {
|
|
8499
8554
|
const config = component.config || {};
|
|
8500
8555
|
fields.push({
|
|
8501
8556
|
name: config.name || component.id,
|
|
@@ -8588,11 +8643,11 @@ var BaseSignUpContent = ({
|
|
|
8588
8643
|
const rawResponse = await onSubmit(payload);
|
|
8589
8644
|
const response = normalizeFlowResponse2(rawResponse);
|
|
8590
8645
|
onFlowChange?.(response);
|
|
8591
|
-
if (response.flowStatus ===
|
|
8646
|
+
if (response.flowStatus === import_browser61.EmbeddedFlowStatus.Complete) {
|
|
8592
8647
|
onComplete?.(response);
|
|
8593
8648
|
return;
|
|
8594
8649
|
}
|
|
8595
|
-
if (response.flowStatus ===
|
|
8650
|
+
if (response.flowStatus === import_browser61.EmbeddedFlowStatus.Incomplete) {
|
|
8596
8651
|
if (handleRedirectionIfNeeded(response, component)) {
|
|
8597
8652
|
return;
|
|
8598
8653
|
}
|
|
@@ -8607,7 +8662,7 @@ var BaseSignUpContent = ({
|
|
|
8607
8662
|
}
|
|
8608
8663
|
};
|
|
8609
8664
|
const handleRedirectionIfNeeded = (response, component) => {
|
|
8610
|
-
if (response?.type ===
|
|
8665
|
+
if (response?.type === import_browser61.EmbeddedFlowResponseType.Redirection && response?.data?.redirectURL) {
|
|
8611
8666
|
const redirectUrl = response.data.redirectURL;
|
|
8612
8667
|
const popup = window.open(redirectUrl, "oauth_popup", "width=500,height=600,scrollbars=yes,resizable=yes");
|
|
8613
8668
|
if (!popup) {
|
|
@@ -8636,9 +8691,9 @@ var BaseSignUpContent = ({
|
|
|
8636
8691
|
try {
|
|
8637
8692
|
const continueResponse = await onSubmit(payload);
|
|
8638
8693
|
onFlowChange?.(continueResponse);
|
|
8639
|
-
if (continueResponse.flowStatus ===
|
|
8694
|
+
if (continueResponse.flowStatus === import_browser61.EmbeddedFlowStatus.Complete) {
|
|
8640
8695
|
onComplete?.(continueResponse);
|
|
8641
|
-
} else if (continueResponse.flowStatus ===
|
|
8696
|
+
} else if (continueResponse.flowStatus === import_browser61.EmbeddedFlowStatus.Incomplete) {
|
|
8642
8697
|
setCurrentFlow(continueResponse);
|
|
8643
8698
|
setupFormFields(continueResponse);
|
|
8644
8699
|
}
|
|
@@ -8696,9 +8751,9 @@ var BaseSignUpContent = ({
|
|
|
8696
8751
|
try {
|
|
8697
8752
|
const continueResponse = await onSubmit(payload);
|
|
8698
8753
|
onFlowChange?.(continueResponse);
|
|
8699
|
-
if (continueResponse.flowStatus ===
|
|
8754
|
+
if (continueResponse.flowStatus === import_browser61.EmbeddedFlowStatus.Complete) {
|
|
8700
8755
|
onComplete?.(continueResponse);
|
|
8701
|
-
} else if (continueResponse.flowStatus ===
|
|
8756
|
+
} else if (continueResponse.flowStatus === import_browser61.EmbeddedFlowStatus.Incomplete) {
|
|
8702
8757
|
setCurrentFlow(continueResponse);
|
|
8703
8758
|
setupFormFields(continueResponse);
|
|
8704
8759
|
}
|
|
@@ -8722,30 +8777,30 @@ var BaseSignUpContent = ({
|
|
|
8722
8777
|
};
|
|
8723
8778
|
const containerClasses = (0, import_css38.cx)(
|
|
8724
8779
|
[
|
|
8725
|
-
(0,
|
|
8726
|
-
(0,
|
|
8727
|
-
(0,
|
|
8780
|
+
(0, import_browser61.withVendorCSSClassPrefix)("signup"),
|
|
8781
|
+
(0, import_browser61.withVendorCSSClassPrefix)(`signup--${size}`),
|
|
8782
|
+
(0, import_browser61.withVendorCSSClassPrefix)(`signup--${variant}`)
|
|
8728
8783
|
],
|
|
8729
8784
|
className
|
|
8730
8785
|
);
|
|
8731
8786
|
const inputClasses = (0, import_css38.cx)(
|
|
8732
8787
|
[
|
|
8733
|
-
(0,
|
|
8734
|
-
size === "small" && (0,
|
|
8735
|
-
size === "large" && (0,
|
|
8788
|
+
(0, import_browser61.withVendorCSSClassPrefix)("signup__input"),
|
|
8789
|
+
size === "small" && (0, import_browser61.withVendorCSSClassPrefix)("signup__input--small"),
|
|
8790
|
+
size === "large" && (0, import_browser61.withVendorCSSClassPrefix)("signup__input--large")
|
|
8736
8791
|
],
|
|
8737
8792
|
inputClassName
|
|
8738
8793
|
);
|
|
8739
8794
|
const buttonClasses = (0, import_css38.cx)(
|
|
8740
8795
|
[
|
|
8741
|
-
(0,
|
|
8742
|
-
size === "small" && (0,
|
|
8743
|
-
size === "large" && (0,
|
|
8796
|
+
(0, import_browser61.withVendorCSSClassPrefix)("signup__button"),
|
|
8797
|
+
size === "small" && (0, import_browser61.withVendorCSSClassPrefix)("signup__button--small"),
|
|
8798
|
+
size === "large" && (0, import_browser61.withVendorCSSClassPrefix)("signup__button--large")
|
|
8744
8799
|
],
|
|
8745
8800
|
buttonClassName
|
|
8746
8801
|
);
|
|
8747
|
-
const errorClasses = (0, import_css38.cx)([(0,
|
|
8748
|
-
const messageClasses = (0, import_css38.cx)([(0,
|
|
8802
|
+
const errorClasses = (0, import_css38.cx)([(0, import_browser61.withVendorCSSClassPrefix)("signup__error")], errorClassName);
|
|
8803
|
+
const messageClasses = (0, import_css38.cx)([(0, import_browser61.withVendorCSSClassPrefix)("signup__messages")], messageClassName);
|
|
8749
8804
|
const renderComponents = (0, import_react61.useCallback)(
|
|
8750
8805
|
(components) => renderSignUpComponents(
|
|
8751
8806
|
components,
|
|
@@ -8788,11 +8843,11 @@ var BaseSignUpContent = ({
|
|
|
8788
8843
|
setCurrentFlow(response);
|
|
8789
8844
|
setIsFlowInitialized(true);
|
|
8790
8845
|
onFlowChange?.(response);
|
|
8791
|
-
if (response.flowStatus ===
|
|
8846
|
+
if (response.flowStatus === import_browser61.EmbeddedFlowStatus.Complete) {
|
|
8792
8847
|
onComplete?.(response);
|
|
8793
8848
|
return;
|
|
8794
8849
|
}
|
|
8795
|
-
if (response.flowStatus ===
|
|
8850
|
+
if (response.flowStatus === import_browser61.EmbeddedFlowStatus.Incomplete) {
|
|
8796
8851
|
setupFormFields(response);
|
|
8797
8852
|
}
|
|
8798
8853
|
} catch (err) {
|
|
@@ -8863,7 +8918,7 @@ var BaseSignUpContent = ({
|
|
|
8863
8918
|
var BaseSignUp_default = BaseSignUp;
|
|
8864
8919
|
|
|
8865
8920
|
// src/components/presentation/SignUp/SignUp.tsx
|
|
8866
|
-
var
|
|
8921
|
+
var import_browser62 = require("@asgardeo/browser");
|
|
8867
8922
|
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
8868
8923
|
var SignUp = ({
|
|
8869
8924
|
className,
|
|
@@ -8881,18 +8936,18 @@ var SignUp = ({
|
|
|
8881
8936
|
const applicationIdFromUrl = urlParams.get("applicationId");
|
|
8882
8937
|
const effectiveApplicationId = applicationId || applicationIdFromUrl;
|
|
8883
8938
|
const initialPayload = payload || {
|
|
8884
|
-
flowType:
|
|
8885
|
-
...platform ===
|
|
8939
|
+
flowType: import_browser62.EmbeddedFlowType.Registration,
|
|
8940
|
+
...platform === import_browser62.Platform.AsgardeoV2 && effectiveApplicationId && { applicationId: effectiveApplicationId }
|
|
8886
8941
|
};
|
|
8887
8942
|
return await signUp(initialPayload);
|
|
8888
8943
|
};
|
|
8889
8944
|
const handleOnSubmit = async (payload) => await signUp(payload);
|
|
8890
8945
|
const handleComplete = (response) => {
|
|
8891
8946
|
onComplete?.(response);
|
|
8892
|
-
if (shouldRedirectAfterSignUp && response?.type !==
|
|
8947
|
+
if (shouldRedirectAfterSignUp && response?.type !== import_browser62.EmbeddedFlowResponseType.Redirection && afterSignUpUrl) {
|
|
8893
8948
|
window.location.href = afterSignUpUrl;
|
|
8894
8949
|
}
|
|
8895
|
-
if (shouldRedirectAfterSignUp && response?.type ===
|
|
8950
|
+
if (shouldRedirectAfterSignUp && response?.type === import_browser62.EmbeddedFlowResponseType.Redirection && response?.data?.redirectURL && !response.data.redirectURL.includes("oauth") && // Not a social provider redirect
|
|
8896
8951
|
!response.data.redirectURL.includes("auth")) {
|
|
8897
8952
|
window.location.href = response.data.redirectURL;
|
|
8898
8953
|
}
|
|
@@ -8910,8 +8965,8 @@ var SignUp = ({
|
|
|
8910
8965
|
isInitialized,
|
|
8911
8966
|
children,
|
|
8912
8967
|
showLogo: true,
|
|
8913
|
-
showTitle: platform ===
|
|
8914
|
-
showSubtitle: platform ===
|
|
8968
|
+
showTitle: platform === import_browser62.Platform.AsgardeoV2,
|
|
8969
|
+
showSubtitle: platform === import_browser62.Platform.AsgardeoV2,
|
|
8915
8970
|
...rest
|
|
8916
8971
|
}
|
|
8917
8972
|
);
|
|
@@ -8959,35 +9014,35 @@ Organization5.displayName = "Organization";
|
|
|
8959
9014
|
var Organization_default = Organization5;
|
|
8960
9015
|
|
|
8961
9016
|
// src/components/presentation/UserProfile/BaseUserProfile.tsx
|
|
8962
|
-
var
|
|
9017
|
+
var import_browser68 = require("@asgardeo/browser");
|
|
8963
9018
|
var import_css46 = require("@emotion/css");
|
|
8964
9019
|
var import_react70 = require("react");
|
|
8965
9020
|
|
|
8966
9021
|
// src/utils/getMappedUserProfileValue.ts
|
|
8967
|
-
var
|
|
9022
|
+
var import_browser63 = require("@asgardeo/browser");
|
|
8968
9023
|
var getMappedUserProfileValue = (key, mappings, user) => {
|
|
8969
9024
|
if (!key || !mappings || !user) {
|
|
8970
9025
|
return void 0;
|
|
8971
9026
|
}
|
|
8972
9027
|
const mapping = mappings[key];
|
|
8973
9028
|
if (!mapping) {
|
|
8974
|
-
return (0,
|
|
9029
|
+
return (0, import_browser63.get)(user, key);
|
|
8975
9030
|
}
|
|
8976
9031
|
if (Array.isArray(mapping)) {
|
|
8977
9032
|
for (const path of mapping) {
|
|
8978
|
-
const value = (0,
|
|
9033
|
+
const value = (0, import_browser63.get)(user, path);
|
|
8979
9034
|
if (value !== void 0 && value !== null && value !== "") {
|
|
8980
9035
|
return value;
|
|
8981
9036
|
}
|
|
8982
9037
|
}
|
|
8983
9038
|
return void 0;
|
|
8984
9039
|
}
|
|
8985
|
-
return (0,
|
|
9040
|
+
return (0, import_browser63.get)(user, mapping);
|
|
8986
9041
|
};
|
|
8987
9042
|
var getMappedUserProfileValue_default = getMappedUserProfileValue;
|
|
8988
9043
|
|
|
8989
9044
|
// src/components/primitives/Avatar/Avatar.tsx
|
|
8990
|
-
var
|
|
9045
|
+
var import_browser64 = require("@asgardeo/browser");
|
|
8991
9046
|
var import_css40 = require("@emotion/css");
|
|
8992
9047
|
var import_react63 = require("react");
|
|
8993
9048
|
|
|
@@ -9106,20 +9161,20 @@ var Avatar = ({
|
|
|
9106
9161
|
const getInitials = (fullName) => fullName.split(" ").map((part) => part[0]).slice(0, 2).join("").toUpperCase();
|
|
9107
9162
|
const renderContent = () => {
|
|
9108
9163
|
if (imageUrl) {
|
|
9109
|
-
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("img", { src: imageUrl, alt, className: (0, import_css40.cx)((0,
|
|
9164
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("img", { src: imageUrl, alt, className: (0, import_css40.cx)((0, import_browser64.withVendorCSSClassPrefix)((0, import_browser64.bem)("avatar", "image")), styles.image) });
|
|
9110
9165
|
}
|
|
9111
9166
|
if (name) {
|
|
9112
9167
|
return getInitials(name);
|
|
9113
9168
|
}
|
|
9114
9169
|
if (isLoading) {
|
|
9115
|
-
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: (0, import_css40.cx)((0,
|
|
9170
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: (0, import_css40.cx)((0, import_browser64.withVendorCSSClassPrefix)((0, import_browser64.bem)("avatar", "skeleton")), styles.skeleton) });
|
|
9116
9171
|
}
|
|
9117
9172
|
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
9118
9173
|
"svg",
|
|
9119
9174
|
{
|
|
9120
9175
|
xmlns: "http://www.w3.org/2000/svg",
|
|
9121
9176
|
viewBox: "0 0 640 640",
|
|
9122
|
-
className: (0, import_css40.cx)((0,
|
|
9177
|
+
className: (0, import_css40.cx)((0, import_browser64.withVendorCSSClassPrefix)((0, import_browser64.bem)("avatar", "icon")), styles.icon),
|
|
9123
9178
|
children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("path", { d: "M240 192C240 147.8 275.8 112 320 112C364.2 112 400 147.8 400 192C400 236.2 364.2 272 320 272C275.8 272 240 236.2 240 192zM448 192C448 121.3 390.7 64 320 64C249.3 64 192 121.3 192 192C192 262.7 249.3 320 320 320C390.7 320 448 262.7 448 192zM144 544C144 473.3 201.3 416 272 416L368 416C438.7 416 496 473.3 496 544L496 552C496 565.3 506.7 576 520 576C533.3 576 544 565.3 544 552L544 544C544 446.8 465.2 368 368 368L272 368C174.8 368 96 446.8 96 544L96 552C96 565.3 106.7 576 120 576C133.3 576 144 565.3 144 552L144 544z" })
|
|
9124
9179
|
}
|
|
9125
9180
|
);
|
|
@@ -9128,11 +9183,11 @@ var Avatar = ({
|
|
|
9128
9183
|
"div",
|
|
9129
9184
|
{
|
|
9130
9185
|
className: (0, import_css40.cx)(
|
|
9131
|
-
(0,
|
|
9186
|
+
(0, import_browser64.withVendorCSSClassPrefix)((0, import_browser64.bem)("avatar")),
|
|
9132
9187
|
styles.avatar,
|
|
9133
9188
|
styles.variant,
|
|
9134
|
-
(0,
|
|
9135
|
-
isDefaultState && (0,
|
|
9189
|
+
(0, import_browser64.withVendorCSSClassPrefix)((0, import_browser64.bem)("avatar", null, variant)),
|
|
9190
|
+
isDefaultState && (0, import_browser64.withVendorCSSClassPrefix)((0, import_browser64.bem)("avatar", "default")),
|
|
9136
9191
|
className
|
|
9137
9192
|
),
|
|
9138
9193
|
children: renderContent()
|
|
@@ -9142,7 +9197,7 @@ var Avatar = ({
|
|
|
9142
9197
|
var Avatar_default = Avatar;
|
|
9143
9198
|
|
|
9144
9199
|
// src/components/primitives/Dialog/Dialog.tsx
|
|
9145
|
-
var
|
|
9200
|
+
var import_browser65 = require("@asgardeo/browser");
|
|
9146
9201
|
var import_react65 = require("@floating-ui/react");
|
|
9147
9202
|
var import_css42 = require("@emotion/css");
|
|
9148
9203
|
var import_react66 = __toESM(require("react"), 1);
|
|
@@ -9379,11 +9434,11 @@ var DialogContent = import_react66.default.forwardRef((props, propRef) => {
|
|
|
9379
9434
|
const styles = Dialog_styles_default(theme, colorScheme);
|
|
9380
9435
|
const ref = (0, import_react65.useMergeRefs)([context.refs.setFloating, propRef]);
|
|
9381
9436
|
if (!floatingContext.open) return null;
|
|
9382
|
-
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_react65.FloatingPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_react65.FloatingOverlay, { className: (0, import_css42.cx)((0,
|
|
9437
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_react65.FloatingPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_react65.FloatingOverlay, { className: (0, import_css42.cx)((0, import_browser65.withVendorCSSClassPrefix)((0, import_browser65.bem)("dialog", "overlay")), styles.overlay), lockScroll: true, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_react65.FloatingFocusManager, { context: floatingContext, initialFocus: -1, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
9383
9438
|
"div",
|
|
9384
9439
|
{
|
|
9385
9440
|
ref,
|
|
9386
|
-
className: (0, import_css42.cx)((0,
|
|
9441
|
+
className: (0, import_css42.cx)((0, import_browser65.withVendorCSSClassPrefix)((0, import_browser65.bem)("dialog", "content")), styles.content, props.className),
|
|
9387
9442
|
"aria-labelledby": context.labelId,
|
|
9388
9443
|
"aria-describedby": context.descriptionId,
|
|
9389
9444
|
...context.getFloatingProps(props),
|
|
@@ -9401,14 +9456,14 @@ var DialogHeading = import_react66.default.forwardRef(
|
|
|
9401
9456
|
context.setLabelId(id);
|
|
9402
9457
|
return () => context.setLabelId(void 0);
|
|
9403
9458
|
}, [id, context.setLabelId]);
|
|
9404
|
-
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: (0, import_css42.cx)((0,
|
|
9459
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: (0, import_css42.cx)((0, import_browser65.withVendorCSSClassPrefix)((0, import_browser65.bem)("dialog", "header")), styles.header), children: [
|
|
9405
9460
|
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
9406
9461
|
"h2",
|
|
9407
9462
|
{
|
|
9408
9463
|
...props,
|
|
9409
9464
|
ref,
|
|
9410
9465
|
id,
|
|
9411
|
-
className: (0, import_css42.cx)((0,
|
|
9466
|
+
className: (0, import_css42.cx)((0, import_browser65.withVendorCSSClassPrefix)((0, import_browser65.bem)("dialog", "title")), styles.headerTitle),
|
|
9412
9467
|
children
|
|
9413
9468
|
}
|
|
9414
9469
|
),
|
|
@@ -9443,7 +9498,7 @@ var DialogDescription = import_react66.default.forwardRef(
|
|
|
9443
9498
|
...props,
|
|
9444
9499
|
ref,
|
|
9445
9500
|
id,
|
|
9446
|
-
className: (0, import_css42.cx)((0,
|
|
9501
|
+
className: (0, import_css42.cx)((0, import_browser65.withVendorCSSClassPrefix)((0, import_browser65.bem)("dialog", "description")), styles.description, props.className),
|
|
9447
9502
|
children
|
|
9448
9503
|
}
|
|
9449
9504
|
);
|
|
@@ -9473,7 +9528,7 @@ var DialogClose = import_react66.default.forwardRef(({ children, asChild = false
|
|
|
9473
9528
|
...props,
|
|
9474
9529
|
ref,
|
|
9475
9530
|
onClick: handleClick,
|
|
9476
|
-
className: (0, import_css42.cx)((0,
|
|
9531
|
+
className: (0, import_css42.cx)((0, import_browser65.withVendorCSSClassPrefix)((0, import_browser65.bem)("dialog", "close")), props.className),
|
|
9477
9532
|
variant: "text",
|
|
9478
9533
|
children
|
|
9479
9534
|
}
|
|
@@ -9494,7 +9549,7 @@ var Dialog_default = Dialog;
|
|
|
9494
9549
|
// src/components/primitives/MultiInput/MultiInput.tsx
|
|
9495
9550
|
var import_react68 = require("react");
|
|
9496
9551
|
var import_css44 = require("@emotion/css");
|
|
9497
|
-
var
|
|
9552
|
+
var import_browser66 = require("@asgardeo/browser");
|
|
9498
9553
|
|
|
9499
9554
|
// src/components/primitives/MultiInput/MultiInput.styles.ts
|
|
9500
9555
|
var import_css43 = require("@emotion/css");
|
|
@@ -9686,26 +9741,26 @@ var MultiInput = ({
|
|
|
9686
9741
|
{
|
|
9687
9742
|
error,
|
|
9688
9743
|
helperText,
|
|
9689
|
-
className: (0, import_css44.cx)((0,
|
|
9744
|
+
className: (0, import_css44.cx)((0, import_browser66.withVendorCSSClassPrefix)((0, import_browser66.bem)("multi-input")), className),
|
|
9690
9745
|
style,
|
|
9691
9746
|
children: [
|
|
9692
9747
|
label && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(InputLabel_default, { required, error: !!error, children: label }),
|
|
9693
|
-
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: (0, import_css44.cx)((0,
|
|
9694
|
-
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: (0, import_css44.cx)((0,
|
|
9748
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: (0, import_css44.cx)((0, import_browser66.withVendorCSSClassPrefix)((0, import_browser66.bem)("multi-input", "container")), styles.container), children: [
|
|
9749
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: (0, import_css44.cx)((0, import_browser66.withVendorCSSClassPrefix)((0, import_browser66.bem)("multi-input", "input-row")), styles.inputRow), children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: (0, import_css44.cx)((0, import_browser66.withVendorCSSClassPrefix)((0, import_browser66.bem)("multi-input", "input-wrapper")), styles.inputWrapper), children: renderInputField(
|
|
9695
9750
|
currentInputValue,
|
|
9696
9751
|
setCurrentInputValue,
|
|
9697
9752
|
canAddMore ? /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(PlusIcon, { className: styles.plusIcon }) : void 0,
|
|
9698
9753
|
canAddMore ? handleInputSubmit : void 0
|
|
9699
9754
|
) }) }),
|
|
9700
|
-
values.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: (0, import_css44.cx)((0,
|
|
9755
|
+
values.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: (0, import_css44.cx)((0, import_browser66.withVendorCSSClassPrefix)((0, import_browser66.bem)("multi-input", "list-container")), styles.listContainer), children: values.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(
|
|
9701
9756
|
"div",
|
|
9702
9757
|
{
|
|
9703
|
-
className: (0, import_css44.cx)((0,
|
|
9758
|
+
className: (0, import_css44.cx)((0, import_browser66.withVendorCSSClassPrefix)((0, import_browser66.bem)("multi-input", "list-item")), styles.listItem),
|
|
9704
9759
|
children: [
|
|
9705
9760
|
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
9706
9761
|
"span",
|
|
9707
9762
|
{
|
|
9708
|
-
className: (0, import_css44.cx)((0,
|
|
9763
|
+
className: (0, import_css44.cx)((0, import_browser66.withVendorCSSClassPrefix)((0, import_browser66.bem)("multi-input", "list-item-text")), styles.listItemText),
|
|
9709
9764
|
children: value
|
|
9710
9765
|
}
|
|
9711
9766
|
),
|
|
@@ -9715,7 +9770,7 @@ var MultiInput = ({
|
|
|
9715
9770
|
type: "button",
|
|
9716
9771
|
onClick: () => handleRemoveValue(index),
|
|
9717
9772
|
disabled,
|
|
9718
|
-
className: (0, import_css44.cx)((0,
|
|
9773
|
+
className: (0, import_css44.cx)((0, import_browser66.withVendorCSSClassPrefix)((0, import_browser66.bem)("multi-input", "remove-button")), styles.removeButton),
|
|
9719
9774
|
title: "Remove value",
|
|
9720
9775
|
children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(BinIcon, { className: styles.icon })
|
|
9721
9776
|
}
|
|
@@ -9734,7 +9789,7 @@ var MultiInput_default = MultiInput;
|
|
|
9734
9789
|
// src/components/presentation/UserProfile/BaseUserProfile.styles.ts
|
|
9735
9790
|
var import_css45 = require("@emotion/css");
|
|
9736
9791
|
var import_react69 = require("react");
|
|
9737
|
-
var
|
|
9792
|
+
var import_browser67 = require("@asgardeo/browser");
|
|
9738
9793
|
var useStyles21 = (theme, colorScheme) => {
|
|
9739
9794
|
const valuePlaceholder = import_css45.css`
|
|
9740
9795
|
font-style: italic;
|
|
@@ -9845,7 +9900,7 @@ var useStyles21 = (theme, colorScheme) => {
|
|
|
9845
9900
|
max-width: 350px;
|
|
9846
9901
|
text-align: start;
|
|
9847
9902
|
|
|
9848
|
-
.${(0,
|
|
9903
|
+
.${(0, import_browser67.withVendorCSSClassPrefix)("form-control")} {
|
|
9849
9904
|
margin-bottom: 0;
|
|
9850
9905
|
}
|
|
9851
9906
|
|
|
@@ -10044,7 +10099,7 @@ var BaseUserProfile = ({
|
|
|
10044
10099
|
fieldValue = fieldValue.filter((v) => v !== void 0 && v !== null && v !== "");
|
|
10045
10100
|
}
|
|
10046
10101
|
let payload = {};
|
|
10047
|
-
if (schema.schemaId && schema.schemaId !==
|
|
10102
|
+
if (schema.schemaId && schema.schemaId !== import_browser68.WellKnownSchemaIds.User) {
|
|
10048
10103
|
payload = {
|
|
10049
10104
|
[schema.schemaId]: {
|
|
10050
10105
|
[fieldName]: fieldValue
|
|
@@ -10278,7 +10333,7 @@ var BaseUserProfile = ({
|
|
|
10278
10333
|
const containerClasses = (0, import_css46.cx)(
|
|
10279
10334
|
styles.root,
|
|
10280
10335
|
cardLayout ? styles.card : "",
|
|
10281
|
-
(0,
|
|
10336
|
+
(0, import_browser68.withVendorCSSClassPrefix)("user-profile"),
|
|
10282
10337
|
className
|
|
10283
10338
|
);
|
|
10284
10339
|
const currentUser = flattenedProfile || profile;
|
|
@@ -10296,7 +10351,7 @@ var BaseUserProfile = ({
|
|
|
10296
10351
|
] }, key)) });
|
|
10297
10352
|
};
|
|
10298
10353
|
const profileContent = /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(Card_default, { className: containerClasses, children: [
|
|
10299
|
-
error && /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(Alert_default, { variant: "error", className: (0, import_css46.cx)((0,
|
|
10354
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(Alert_default, { variant: "error", className: (0, import_css46.cx)((0, import_browser68.withVendorCSSClassPrefix)((0, import_browser68.bem)("user-profile", "alert")), styles.alert), children: [
|
|
10300
10355
|
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Alert_default.Title, { children: t("errors.title") || "Error" }),
|
|
10301
10356
|
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Alert_default.Description, { children: error })
|
|
10302
10357
|
] }),
|
|
@@ -10344,8 +10399,8 @@ var BaseUserProfile_default = BaseUserProfile;
|
|
|
10344
10399
|
var import_react71 = require("react");
|
|
10345
10400
|
|
|
10346
10401
|
// src/api/updateMeProfile.ts
|
|
10347
|
-
var
|
|
10348
|
-
var httpClient5 =
|
|
10402
|
+
var import_browser69 = require("@asgardeo/browser");
|
|
10403
|
+
var httpClient5 = import_browser69.AsgardeoSPAClient.getInstance().httpRequest.bind(import_browser69.AsgardeoSPAClient.getInstance());
|
|
10349
10404
|
var updateMeProfile = async ({ fetcher, ...requestConfig }) => {
|
|
10350
10405
|
const defaultFetcher = async (url, config) => {
|
|
10351
10406
|
const response = await httpClient5({
|
|
@@ -10362,7 +10417,7 @@ var updateMeProfile = async ({ fetcher, ...requestConfig }) => {
|
|
|
10362
10417
|
text: () => Promise.resolve(typeof response.data === "string" ? response.data : JSON.stringify(response.data))
|
|
10363
10418
|
};
|
|
10364
10419
|
};
|
|
10365
|
-
return (0,
|
|
10420
|
+
return (0, import_browser69.updateMeProfile)({
|
|
10366
10421
|
...requestConfig,
|
|
10367
10422
|
fetcher: fetcher || defaultFetcher
|
|
10368
10423
|
});
|
|
@@ -10370,7 +10425,7 @@ var updateMeProfile = async ({ fetcher, ...requestConfig }) => {
|
|
|
10370
10425
|
var updateMeProfile_default = updateMeProfile;
|
|
10371
10426
|
|
|
10372
10427
|
// src/components/presentation/UserProfile/UserProfile.tsx
|
|
10373
|
-
var
|
|
10428
|
+
var import_browser70 = require("@asgardeo/browser");
|
|
10374
10429
|
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
10375
10430
|
var UserProfile3 = ({ ...rest }) => {
|
|
10376
10431
|
const { baseUrl, isLoading } = useAsgardeo_default();
|
|
@@ -10384,7 +10439,7 @@ var UserProfile3 = ({ ...rest }) => {
|
|
|
10384
10439
|
onUpdateProfile(response);
|
|
10385
10440
|
} catch (error2) {
|
|
10386
10441
|
let message = t("user.profile.update.generic.error");
|
|
10387
|
-
if (error2 instanceof
|
|
10442
|
+
if (error2 instanceof import_browser70.AsgardeoError) {
|
|
10388
10443
|
message = error2?.message;
|
|
10389
10444
|
}
|
|
10390
10445
|
setError(message);
|
|
@@ -10405,7 +10460,7 @@ var UserProfile3 = ({ ...rest }) => {
|
|
|
10405
10460
|
var UserProfile_default = UserProfile3;
|
|
10406
10461
|
|
|
10407
10462
|
// src/components/presentation/UserDropdown/BaseUserDropdown.tsx
|
|
10408
|
-
var
|
|
10463
|
+
var import_browser71 = require("@asgardeo/browser");
|
|
10409
10464
|
var import_react73 = require("@floating-ui/react");
|
|
10410
10465
|
var import_css48 = require("@emotion/css");
|
|
10411
10466
|
var import_react74 = require("react");
|
|
@@ -10666,12 +10721,12 @@ var BaseUserDropdown = ({
|
|
|
10666
10721
|
}
|
|
10667
10722
|
allMenuItems.push(...defaultMenuItems);
|
|
10668
10723
|
}
|
|
10669
|
-
return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: (0, import_css48.cx)((0,
|
|
10724
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: (0, import_css48.cx)((0, import_browser71.withVendorCSSClassPrefix)("user-dropdown"), className), children: [
|
|
10670
10725
|
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(
|
|
10671
10726
|
Button_default,
|
|
10672
10727
|
{
|
|
10673
10728
|
ref: refs.setReference,
|
|
10674
|
-
className: (0, import_css48.cx)((0,
|
|
10729
|
+
className: (0, import_css48.cx)((0, import_browser71.withVendorCSSClassPrefix)("user-dropdown__trigger"), styles.trigger),
|
|
10675
10730
|
color: "tertiary",
|
|
10676
10731
|
variant: "text",
|
|
10677
10732
|
size: "medium",
|
|
@@ -10690,7 +10745,7 @@ var BaseUserDropdown = ({
|
|
|
10690
10745
|
Typography_default,
|
|
10691
10746
|
{
|
|
10692
10747
|
variant: "body2",
|
|
10693
|
-
className: (0, import_css48.cx)((0,
|
|
10748
|
+
className: (0, import_css48.cx)((0, import_browser71.withVendorCSSClassPrefix)("user-dropdown__trigger-label"), styles.userName),
|
|
10694
10749
|
children: getDisplayName_default(mergedMappings, user)
|
|
10695
10750
|
}
|
|
10696
10751
|
)
|
|
@@ -10701,7 +10756,7 @@ var BaseUserDropdown = ({
|
|
|
10701
10756
|
"div",
|
|
10702
10757
|
{
|
|
10703
10758
|
ref: refs.setFloating,
|
|
10704
|
-
className: (0, import_css48.cx)((0,
|
|
10759
|
+
className: (0, import_css48.cx)((0, import_browser71.withVendorCSSClassPrefix)("user-dropdown__content"), styles.dropdownContent),
|
|
10705
10760
|
style: {
|
|
10706
10761
|
...floatingStyles,
|
|
10707
10762
|
// Floating UI doesn't set a z-index by default, so we set a high value to ensure the dropdown appears above other elements.
|
|
@@ -10710,7 +10765,7 @@ var BaseUserDropdown = ({
|
|
|
10710
10765
|
},
|
|
10711
10766
|
...getFloatingProps(),
|
|
10712
10767
|
children: [
|
|
10713
|
-
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: (0, import_css48.cx)((0,
|
|
10768
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: (0, import_css48.cx)((0, import_browser71.withVendorCSSClassPrefix)("user-dropdown__header"), styles.dropdownHeader), children: [
|
|
10714
10769
|
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
10715
10770
|
Avatar,
|
|
10716
10771
|
{
|
|
@@ -10720,12 +10775,12 @@ var BaseUserDropdown = ({
|
|
|
10720
10775
|
alt: `${getDisplayName_default(mergedMappings, user)}'s avatar`
|
|
10721
10776
|
}
|
|
10722
10777
|
),
|
|
10723
|
-
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: (0, import_css48.cx)((0,
|
|
10778
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: (0, import_css48.cx)((0, import_browser71.withVendorCSSClassPrefix)("user-dropdown__header-info"), styles.headerInfo), children: [
|
|
10724
10779
|
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
10725
10780
|
Typography_default,
|
|
10726
10781
|
{
|
|
10727
10782
|
noWrap: true,
|
|
10728
|
-
className: (0,
|
|
10783
|
+
className: (0, import_browser71.withVendorCSSClassPrefix)("user-dropdown__header-name"),
|
|
10729
10784
|
variant: "body1",
|
|
10730
10785
|
fontWeight: "medium",
|
|
10731
10786
|
children: getDisplayName_default(mergedMappings, user)
|
|
@@ -10735,7 +10790,7 @@ var BaseUserDropdown = ({
|
|
|
10735
10790
|
Typography_default,
|
|
10736
10791
|
{
|
|
10737
10792
|
noWrap: true,
|
|
10738
|
-
className: (0,
|
|
10793
|
+
className: (0, import_browser71.withVendorCSSClassPrefix)("user-dropdown__header-email"),
|
|
10739
10794
|
variant: "caption",
|
|
10740
10795
|
color: "secondary",
|
|
10741
10796
|
children: getMappedUserProfileValue_default("username", mergedMappings, user) || getMappedUserProfileValue_default("email", mergedMappings, user)
|
|
@@ -10743,14 +10798,14 @@ var BaseUserDropdown = ({
|
|
|
10743
10798
|
)
|
|
10744
10799
|
] })
|
|
10745
10800
|
] }),
|
|
10746
|
-
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: (0, import_css48.cx)((0,
|
|
10801
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: (0, import_css48.cx)((0, import_browser71.withVendorCSSClassPrefix)("user-dropdown__menu"), styles.dropdownMenu), children: allMenuItems.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { children: item.label === "" ? /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: (0, import_css48.cx)((0, import_browser71.withVendorCSSClassPrefix)("user-dropdown__menu-divider"), styles.divider) }) : item.href ? /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(
|
|
10747
10802
|
"a",
|
|
10748
10803
|
{
|
|
10749
10804
|
href: item.href,
|
|
10750
10805
|
style: {
|
|
10751
10806
|
backgroundColor: hoveredItemIndex === index ? theme.vars.colors.action?.hover : "transparent"
|
|
10752
10807
|
},
|
|
10753
|
-
className: (0, import_css48.cx)((0,
|
|
10808
|
+
className: (0, import_css48.cx)((0, import_browser71.withVendorCSSClassPrefix)("user-dropdown__menu-item"), styles.menuItemAnchor),
|
|
10754
10809
|
onMouseEnter: () => setHoveredItemIndex(index),
|
|
10755
10810
|
onMouseLeave: () => setHoveredItemIndex(null),
|
|
10756
10811
|
onFocus: () => setHoveredItemIndex(index),
|
|
@@ -10767,7 +10822,7 @@ var BaseUserDropdown = ({
|
|
|
10767
10822
|
style: {
|
|
10768
10823
|
backgroundColor: hoveredItemIndex === index ? theme.vars.colors.action?.hover : "transparent"
|
|
10769
10824
|
},
|
|
10770
|
-
className: (0, import_css48.cx)((0,
|
|
10825
|
+
className: (0, import_css48.cx)((0, import_browser71.withVendorCSSClassPrefix)("user-dropdown__menu-item"), styles.menuItem),
|
|
10771
10826
|
color: "tertiary",
|
|
10772
10827
|
variant: "text",
|
|
10773
10828
|
size: "small",
|
|
@@ -11670,8 +11725,8 @@ var BaseCreateOrganization = ({
|
|
|
11670
11725
|
};
|
|
11671
11726
|
|
|
11672
11727
|
// src/api/createOrganization.ts
|
|
11673
|
-
var
|
|
11674
|
-
var httpClient6 =
|
|
11728
|
+
var import_browser72 = require("@asgardeo/browser");
|
|
11729
|
+
var httpClient6 = import_browser72.AsgardeoSPAClient.getInstance().httpRequest.bind(import_browser72.AsgardeoSPAClient.getInstance());
|
|
11675
11730
|
var createOrganization = async ({ fetcher, ...requestConfig }) => {
|
|
11676
11731
|
const defaultFetcher = async (url, config) => {
|
|
11677
11732
|
const response = await httpClient6({
|
|
@@ -11688,7 +11743,7 @@ var createOrganization = async ({ fetcher, ...requestConfig }) => {
|
|
|
11688
11743
|
text: () => Promise.resolve(typeof response.data === "string" ? response.data : JSON.stringify(response.data))
|
|
11689
11744
|
};
|
|
11690
11745
|
};
|
|
11691
|
-
return (0,
|
|
11746
|
+
return (0, import_browser72.createOrganization)({
|
|
11692
11747
|
...requestConfig,
|
|
11693
11748
|
fetcher: fetcher || defaultFetcher
|
|
11694
11749
|
});
|
|
@@ -11763,12 +11818,12 @@ var CreateOrganization = ({
|
|
|
11763
11818
|
var import_react86 = require("react");
|
|
11764
11819
|
|
|
11765
11820
|
// src/components/presentation/OrganizationProfile/BaseOrganizationProfile.tsx
|
|
11766
|
-
var
|
|
11821
|
+
var import_browser74 = require("@asgardeo/browser");
|
|
11767
11822
|
var import_css56 = require("@emotion/css");
|
|
11768
11823
|
var import_react85 = require("react");
|
|
11769
11824
|
|
|
11770
11825
|
// src/components/primitives/KeyValueInput/KeyValueInput.tsx
|
|
11771
|
-
var
|
|
11826
|
+
var import_browser73 = require("@asgardeo/browser");
|
|
11772
11827
|
var import_css54 = require("@emotion/css");
|
|
11773
11828
|
var import_react83 = require("react");
|
|
11774
11829
|
|
|
@@ -12003,27 +12058,27 @@ var KeyValueInput = ({
|
|
|
12003
12058
|
);
|
|
12004
12059
|
const canAddMore = !maxPairs || pairs.length < maxPairs;
|
|
12005
12060
|
const isAddDisabled = disabled || readOnly || !canAddMore || !newKey.trim() || !newValue.trim();
|
|
12006
|
-
return /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: (0, import_css54.cx)((0,
|
|
12007
|
-
label && /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("label", { className: (0, import_css54.cx)((0,
|
|
12061
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: (0, import_css54.cx)((0, import_browser73.withVendorCSSClassPrefix)((0, import_browser73.bem)("key-value-input")), styles.container, className), children: [
|
|
12062
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("label", { className: (0, import_css54.cx)((0, import_browser73.withVendorCSSClassPrefix)((0, import_browser73.bem)("key-value-input", "label")), styles.label), children: [
|
|
12008
12063
|
label,
|
|
12009
12064
|
required && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
12010
12065
|
"span",
|
|
12011
12066
|
{
|
|
12012
|
-
className: (0, import_css54.cx)((0,
|
|
12067
|
+
className: (0, import_css54.cx)((0, import_browser73.withVendorCSSClassPrefix)((0, import_browser73.bem)("key-value-input", "required")), styles.requiredIndicator),
|
|
12013
12068
|
children: " *"
|
|
12014
12069
|
}
|
|
12015
12070
|
)
|
|
12016
12071
|
] }),
|
|
12017
|
-
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: (0, import_css54.cx)((0,
|
|
12018
|
-
pairs.length === 0 && readOnly ? /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: (0, import_css54.cx)((0,
|
|
12072
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: (0, import_css54.cx)((0, import_browser73.withVendorCSSClassPrefix)((0, import_browser73.bem)("key-value-input", "pairs-list")), styles.pairsList), children: [
|
|
12073
|
+
pairs.length === 0 && readOnly ? /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: (0, import_css54.cx)((0, import_browser73.withVendorCSSClassPrefix)((0, import_browser73.bem)("key-value-input", "empty-state")), styles.emptyState), children: "No attributes defined" }) : readOnly ? pairs.map((pair, index) => /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
12019
12074
|
"div",
|
|
12020
12075
|
{
|
|
12021
|
-
className: (0, import_css54.cx)((0,
|
|
12076
|
+
className: (0, import_css54.cx)((0, import_browser73.withVendorCSSClassPrefix)((0, import_browser73.bem)("key-value-input", "readonly-pair")), styles.readOnlyPair),
|
|
12022
12077
|
children: [
|
|
12023
12078
|
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
12024
12079
|
"span",
|
|
12025
12080
|
{
|
|
12026
|
-
className: (0, import_css54.cx)((0,
|
|
12081
|
+
className: (0, import_css54.cx)((0, import_browser73.withVendorCSSClassPrefix)((0, import_browser73.bem)("key-value-input", "readonly-key")), styles.readOnlyKey),
|
|
12027
12082
|
children: [
|
|
12028
12083
|
pair.key,
|
|
12029
12084
|
":"
|
|
@@ -12033,7 +12088,7 @@ var KeyValueInput = ({
|
|
|
12033
12088
|
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
12034
12089
|
"span",
|
|
12035
12090
|
{
|
|
12036
|
-
className: (0, import_css54.cx)((0,
|
|
12091
|
+
className: (0, import_css54.cx)((0, import_browser73.withVendorCSSClassPrefix)((0, import_browser73.bem)("key-value-input", "readonly-value")), styles.readOnlyValue),
|
|
12037
12092
|
children: pair.value
|
|
12038
12093
|
}
|
|
12039
12094
|
)
|
|
@@ -12043,7 +12098,7 @@ var KeyValueInput = ({
|
|
|
12043
12098
|
)) : pairs.map((pair, index) => /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
12044
12099
|
"div",
|
|
12045
12100
|
{
|
|
12046
|
-
className: (0, import_css54.cx)((0,
|
|
12101
|
+
className: (0, import_css54.cx)((0, import_browser73.withVendorCSSClassPrefix)((0, import_browser73.bem)("key-value-input", "pair-row")), styles.pairRow),
|
|
12047
12102
|
children: [
|
|
12048
12103
|
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
12049
12104
|
TextField_default,
|
|
@@ -12052,7 +12107,7 @@ var KeyValueInput = ({
|
|
|
12052
12107
|
value: pair.key,
|
|
12053
12108
|
onChange: (e) => handleUpdatePair(index, "key", e.target.value),
|
|
12054
12109
|
disabled: disabled || readOnly,
|
|
12055
|
-
className: (0, import_css54.cx)((0,
|
|
12110
|
+
className: (0, import_css54.cx)((0, import_browser73.withVendorCSSClassPrefix)((0, import_browser73.bem)("key-value-input", "pair-input")), styles.pairInput),
|
|
12056
12111
|
"aria-label": `${keyLabel} ${index + 1}`
|
|
12057
12112
|
}
|
|
12058
12113
|
),
|
|
@@ -12063,7 +12118,7 @@ var KeyValueInput = ({
|
|
|
12063
12118
|
value: pair.value,
|
|
12064
12119
|
onChange: (e) => handleUpdatePair(index, "value", e.target.value),
|
|
12065
12120
|
disabled: disabled || readOnly,
|
|
12066
|
-
className: (0, import_css54.cx)((0,
|
|
12121
|
+
className: (0, import_css54.cx)((0, import_browser73.withVendorCSSClassPrefix)((0, import_browser73.bem)("key-value-input", "pair-input")), styles.pairInput),
|
|
12067
12122
|
"aria-label": `${valueLabel} ${index + 1}`
|
|
12068
12123
|
}
|
|
12069
12124
|
),
|
|
@@ -12073,7 +12128,7 @@ var KeyValueInput = ({
|
|
|
12073
12128
|
type: "button",
|
|
12074
12129
|
onClick: () => handleRemovePair(index),
|
|
12075
12130
|
disabled,
|
|
12076
|
-
className: (0, import_css54.cx)((0,
|
|
12131
|
+
className: (0, import_css54.cx)((0, import_browser73.withVendorCSSClassPrefix)((0, import_browser73.bem)("key-value-input", "remove-button")), styles.removeButton),
|
|
12077
12132
|
"aria-label": `${removeButtonText} ${pair.key}`,
|
|
12078
12133
|
children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(X_default, { width: 16, height: 16 })
|
|
12079
12134
|
}
|
|
@@ -12082,7 +12137,7 @@ var KeyValueInput = ({
|
|
|
12082
12137
|
},
|
|
12083
12138
|
`${pair.key}-${index}`
|
|
12084
12139
|
)),
|
|
12085
|
-
!readOnly && /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: (0, import_css54.cx)((0,
|
|
12140
|
+
!readOnly && /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: (0, import_css54.cx)((0, import_browser73.withVendorCSSClassPrefix)((0, import_browser73.bem)("key-value-input", "add-row")), styles.addRow), children: [
|
|
12086
12141
|
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
12087
12142
|
TextField_default,
|
|
12088
12143
|
{
|
|
@@ -12090,7 +12145,7 @@ var KeyValueInput = ({
|
|
|
12090
12145
|
value: newKey,
|
|
12091
12146
|
onChange: (e) => setNewKey(e.target.value),
|
|
12092
12147
|
disabled,
|
|
12093
|
-
className: (0, import_css54.cx)((0,
|
|
12148
|
+
className: (0, import_css54.cx)((0, import_browser73.withVendorCSSClassPrefix)((0, import_browser73.bem)("key-value-input", "pair-input")), styles.pairInput),
|
|
12094
12149
|
"aria-label": "New key"
|
|
12095
12150
|
}
|
|
12096
12151
|
),
|
|
@@ -12101,7 +12156,7 @@ var KeyValueInput = ({
|
|
|
12101
12156
|
value: newValue,
|
|
12102
12157
|
onChange: (e) => setNewValue(e.target.value),
|
|
12103
12158
|
disabled,
|
|
12104
|
-
className: (0, import_css54.cx)((0,
|
|
12159
|
+
className: (0, import_css54.cx)((0, import_browser73.withVendorCSSClassPrefix)((0, import_browser73.bem)("key-value-input", "pair-input")), styles.pairInput),
|
|
12105
12160
|
"aria-label": "New value",
|
|
12106
12161
|
onKeyPress: (e) => {
|
|
12107
12162
|
if (e.key === "Enter" && !isAddDisabled) {
|
|
@@ -12116,15 +12171,15 @@ var KeyValueInput = ({
|
|
|
12116
12171
|
type: "button",
|
|
12117
12172
|
onClick: handleAddPair,
|
|
12118
12173
|
disabled: isAddDisabled,
|
|
12119
|
-
className: (0, import_css54.cx)((0,
|
|
12174
|
+
className: (0, import_css54.cx)((0, import_browser73.withVendorCSSClassPrefix)((0, import_browser73.bem)("key-value-input", "add-button")), styles.addButton),
|
|
12120
12175
|
"aria-label": "Add new key-value pair",
|
|
12121
12176
|
children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(Plus_default, { width: 16, height: 16 })
|
|
12122
12177
|
}
|
|
12123
12178
|
)
|
|
12124
12179
|
] })
|
|
12125
12180
|
] }),
|
|
12126
|
-
(helperText || error) && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: (0, import_css54.cx)((0,
|
|
12127
|
-
maxPairs && /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: (0, import_css54.cx)((0,
|
|
12181
|
+
(helperText || error) && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: (0, import_css54.cx)((0, import_browser73.withVendorCSSClassPrefix)((0, import_browser73.bem)("key-value-input", "helper-text")), styles.helperText), children: error || helperText }),
|
|
12182
|
+
maxPairs && /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: (0, import_css54.cx)((0, import_browser73.withVendorCSSClassPrefix)((0, import_browser73.bem)("key-value-input", "counter")), styles.counterText), children: [
|
|
12128
12183
|
pairs.length,
|
|
12129
12184
|
" of ",
|
|
12130
12185
|
maxPairs,
|
|
@@ -12328,13 +12383,13 @@ var BaseOrganizationProfile = ({
|
|
|
12328
12383
|
key: "created",
|
|
12329
12384
|
label: "Created Date",
|
|
12330
12385
|
editable: false,
|
|
12331
|
-
render: (value) => (0,
|
|
12386
|
+
render: (value) => (0, import_browser74.formatDate)(value)
|
|
12332
12387
|
},
|
|
12333
12388
|
{
|
|
12334
12389
|
key: "lastModified",
|
|
12335
12390
|
label: "Last Modified Date",
|
|
12336
12391
|
editable: false,
|
|
12337
|
-
render: (value) => (0,
|
|
12392
|
+
render: (value) => (0, import_browser74.formatDate)(value)
|
|
12338
12393
|
}
|
|
12339
12394
|
]
|
|
12340
12395
|
}) => {
|
|
@@ -12571,8 +12626,8 @@ var BaseOrganizationProfile = ({
|
|
|
12571
12626
|
var BaseOrganizationProfile_default = BaseOrganizationProfile;
|
|
12572
12627
|
|
|
12573
12628
|
// src/api/getOrganization.ts
|
|
12574
|
-
var
|
|
12575
|
-
var httpClient7 =
|
|
12629
|
+
var import_browser75 = require("@asgardeo/browser");
|
|
12630
|
+
var httpClient7 = import_browser75.AsgardeoSPAClient.getInstance().httpRequest.bind(import_browser75.AsgardeoSPAClient.getInstance());
|
|
12576
12631
|
var getOrganization = async ({ fetcher, ...requestConfig }) => {
|
|
12577
12632
|
const defaultFetcher = async (url, config) => {
|
|
12578
12633
|
const response = await httpClient7({
|
|
@@ -12588,7 +12643,7 @@ var getOrganization = async ({ fetcher, ...requestConfig }) => {
|
|
|
12588
12643
|
text: () => Promise.resolve(typeof response.data === "string" ? response.data : JSON.stringify(response.data))
|
|
12589
12644
|
};
|
|
12590
12645
|
};
|
|
12591
|
-
return (0,
|
|
12646
|
+
return (0, import_browser75.getOrganization)({
|
|
12592
12647
|
...requestConfig,
|
|
12593
12648
|
fetcher: fetcher || defaultFetcher
|
|
12594
12649
|
});
|
|
@@ -12596,8 +12651,8 @@ var getOrganization = async ({ fetcher, ...requestConfig }) => {
|
|
|
12596
12651
|
var getOrganization_default = getOrganization;
|
|
12597
12652
|
|
|
12598
12653
|
// src/api/updateOrganization.ts
|
|
12599
|
-
var
|
|
12600
|
-
var httpClient8 =
|
|
12654
|
+
var import_browser76 = require("@asgardeo/browser");
|
|
12655
|
+
var httpClient8 = import_browser76.AsgardeoSPAClient.getInstance().httpRequest.bind(import_browser76.AsgardeoSPAClient.getInstance());
|
|
12601
12656
|
var updateOrganization = async ({
|
|
12602
12657
|
fetcher,
|
|
12603
12658
|
...requestConfig
|
|
@@ -12617,7 +12672,7 @@ var updateOrganization = async ({
|
|
|
12617
12672
|
text: () => Promise.resolve(typeof response.data === "string" ? response.data : JSON.stringify(response.data))
|
|
12618
12673
|
};
|
|
12619
12674
|
};
|
|
12620
|
-
return (0,
|
|
12675
|
+
return (0, import_browser76.updateOrganization)({
|
|
12621
12676
|
...requestConfig,
|
|
12622
12677
|
fetcher: fetcher || defaultFetcher
|
|
12623
12678
|
});
|
|
@@ -12670,7 +12725,7 @@ var OrganizationProfile = ({
|
|
|
12670
12725
|
const handleOrganizationUpdate = async (payload) => {
|
|
12671
12726
|
if (!baseUrl || !organizationId) return;
|
|
12672
12727
|
try {
|
|
12673
|
-
const operations = (0,
|
|
12728
|
+
const operations = (0, import_browser76.createPatchOperations)(payload);
|
|
12674
12729
|
await updateOrganization_default({
|
|
12675
12730
|
baseUrl,
|
|
12676
12731
|
organizationId,
|
|
@@ -13320,5 +13375,5 @@ var OrganizationSwitcher = ({
|
|
|
13320
13375
|
var OrganizationSwitcher_default = OrganizationSwitcher;
|
|
13321
13376
|
|
|
13322
13377
|
// src/index.ts
|
|
13323
|
-
var
|
|
13378
|
+
var import_browser77 = require("@asgardeo/browser");
|
|
13324
13379
|
//# sourceMappingURL=index.js.map
|