@asgardeo/javascript 0.1.2 → 0.1.4
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/AsgardeoJavaScriptClient.d.ts +6 -2
- package/dist/api/getAllOrganizations.d.ts +2 -11
- package/dist/cjs/index.js +536 -31
- package/dist/cjs/index.js.map +4 -4
- package/dist/index.d.ts +4 -1
- package/dist/index.js +534 -31
- package/dist/index.js.map +4 -4
- package/dist/models/client.d.ts +16 -3
- package/dist/models/i18n.d.ts +10 -0
- package/dist/models/organization.d.ts +9 -0
- package/dist/theme/createTheme.d.ts +17 -1
- package/dist/theme/types.d.ts +199 -0
- package/dist/utils/processUsername.d.ts +73 -0
- package/dist/utils/transformBrandingPreferenceToTheme.d.ts +48 -0
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -71,10 +71,12 @@ __export(index_exports, {
|
|
|
71
71
|
initializeEmbeddedSignInFlow: () => initializeEmbeddedSignInFlow_default,
|
|
72
72
|
isEmpty: () => isEmpty_default,
|
|
73
73
|
processOpenIDScopes: () => processOpenIDScopes_default,
|
|
74
|
+
processUsername: () => processUsername_default,
|
|
74
75
|
removeTrailingSlash: () => removeTrailingSlash_default,
|
|
75
76
|
resolveFieldName: () => resolveFieldName_default,
|
|
76
77
|
resolveFieldType: () => resolveFieldType_default,
|
|
77
78
|
set: () => set_default,
|
|
79
|
+
transformBrandingPreferenceToTheme: () => transformBrandingPreferenceToTheme_default,
|
|
78
80
|
updateMeProfile: () => updateMeProfile_default,
|
|
79
81
|
updateOrganization: () => updateOrganization_default,
|
|
80
82
|
withVendorCSSClassPrefix: () => withVendorCSSClassPrefix_default
|
|
@@ -2028,9 +2030,9 @@ var initializeEmbeddedSignInFlow = async ({
|
|
|
2028
2030
|
...requestConfig,
|
|
2029
2031
|
method: requestConfig.method || "POST",
|
|
2030
2032
|
headers: {
|
|
2033
|
+
...requestConfig.headers,
|
|
2031
2034
|
"Content-Type": "application/x-www-form-urlencoded",
|
|
2032
|
-
Accept: "application/json"
|
|
2033
|
-
...requestConfig.headers
|
|
2035
|
+
Accept: "application/json"
|
|
2034
2036
|
},
|
|
2035
2037
|
body: searchParams.toString()
|
|
2036
2038
|
});
|
|
@@ -2195,6 +2197,32 @@ var getUserInfo = async ({ url, ...requestConfig }) => {
|
|
|
2195
2197
|
};
|
|
2196
2198
|
var getUserInfo_default = getUserInfo;
|
|
2197
2199
|
|
|
2200
|
+
// src/utils/processUsername.ts
|
|
2201
|
+
var USERSTORE_PREFIX_REGEX = /^[A-Z_][A-Z0-9_]*\//;
|
|
2202
|
+
var removeUserstorePrefix = (username) => {
|
|
2203
|
+
if (!username) {
|
|
2204
|
+
return "";
|
|
2205
|
+
}
|
|
2206
|
+
return username.replace(USERSTORE_PREFIX_REGEX, "");
|
|
2207
|
+
};
|
|
2208
|
+
var processUsername = (user) => {
|
|
2209
|
+
if (!user) {
|
|
2210
|
+
return user;
|
|
2211
|
+
}
|
|
2212
|
+
const processedUser = { ...user };
|
|
2213
|
+
if (processedUser.username) {
|
|
2214
|
+
processedUser.username = removeUserstorePrefix(processedUser.username);
|
|
2215
|
+
}
|
|
2216
|
+
if (processedUser.userName) {
|
|
2217
|
+
processedUser.userName = removeUserstorePrefix(processedUser.userName);
|
|
2218
|
+
}
|
|
2219
|
+
if (processedUser.user_name) {
|
|
2220
|
+
processedUser.user_name = removeUserstorePrefix(processedUser.user_name);
|
|
2221
|
+
}
|
|
2222
|
+
return processedUser;
|
|
2223
|
+
};
|
|
2224
|
+
var processUsername_default = processUsername;
|
|
2225
|
+
|
|
2198
2226
|
// src/api/getScim2Me.ts
|
|
2199
2227
|
var getScim2Me = async ({ url, baseUrl, fetcher, ...requestConfig }) => {
|
|
2200
2228
|
try {
|
|
@@ -2231,7 +2259,8 @@ var getScim2Me = async ({ url, baseUrl, fetcher, ...requestConfig }) => {
|
|
|
2231
2259
|
response.statusText
|
|
2232
2260
|
);
|
|
2233
2261
|
}
|
|
2234
|
-
|
|
2262
|
+
const user = await response.json();
|
|
2263
|
+
return processUsername_default(user);
|
|
2235
2264
|
} catch (error) {
|
|
2236
2265
|
if (error instanceof AsgardeoAPIError) {
|
|
2237
2266
|
throw error;
|
|
@@ -2334,9 +2363,9 @@ var getAllOrganizations = async ({
|
|
|
2334
2363
|
...requestConfig,
|
|
2335
2364
|
method: "GET",
|
|
2336
2365
|
headers: {
|
|
2366
|
+
...requestConfig.headers,
|
|
2337
2367
|
"Content-Type": "application/json",
|
|
2338
|
-
Accept: "application/json"
|
|
2339
|
-
...requestConfig.headers
|
|
2368
|
+
Accept: "application/json"
|
|
2340
2369
|
}
|
|
2341
2370
|
};
|
|
2342
2371
|
try {
|
|
@@ -2793,7 +2822,7 @@ var getBrandingPreference = async ({
|
|
|
2793
2822
|
)
|
|
2794
2823
|
);
|
|
2795
2824
|
const fetchFn = fetcher || fetch;
|
|
2796
|
-
const resolvedUrl = `${baseUrl}/api/server/v1/branding-preference${queryParams.toString() ? `?${queryParams.toString()}` : ""}`;
|
|
2825
|
+
const resolvedUrl = `${baseUrl}/api/server/v1/branding-preference/resolve${queryParams.toString() ? `?${queryParams.toString()}` : ""}`;
|
|
2797
2826
|
const requestInit = {
|
|
2798
2827
|
...requestConfig,
|
|
2799
2828
|
method: "GET",
|
|
@@ -2937,6 +2966,19 @@ var AsgardeoJavaScriptClient_default = AsgardeoJavaScriptClient;
|
|
|
2937
2966
|
// src/theme/createTheme.ts
|
|
2938
2967
|
var lightTheme = {
|
|
2939
2968
|
colors: {
|
|
2969
|
+
action: {
|
|
2970
|
+
active: "rgba(0, 0, 0, 0.54)",
|
|
2971
|
+
hover: "rgba(0, 0, 0, 0.04)",
|
|
2972
|
+
hoverOpacity: 0.04,
|
|
2973
|
+
selected: "rgba(0, 0, 0, 0.08)",
|
|
2974
|
+
selectedOpacity: 0.08,
|
|
2975
|
+
disabled: "rgba(0, 0, 0, 0.26)",
|
|
2976
|
+
disabledBackground: "rgba(0, 0, 0, 0.12)",
|
|
2977
|
+
disabledOpacity: 0.38,
|
|
2978
|
+
focus: "rgba(0, 0, 0, 0.12)",
|
|
2979
|
+
focusOpacity: 0.12,
|
|
2980
|
+
activatedOpacity: 0.12
|
|
2981
|
+
},
|
|
2940
2982
|
primary: {
|
|
2941
2983
|
main: "#1a73e8",
|
|
2942
2984
|
contrastText: "#ffffff"
|
|
@@ -2982,10 +3024,57 @@ var lightTheme = {
|
|
|
2982
3024
|
small: "0 2px 8px rgba(0, 0, 0, 0.1)",
|
|
2983
3025
|
medium: "0 4px 16px rgba(0, 0, 0, 0.15)",
|
|
2984
3026
|
large: "0 8px 32px rgba(0, 0, 0, 0.2)"
|
|
3027
|
+
},
|
|
3028
|
+
typography: {
|
|
3029
|
+
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',
|
|
3030
|
+
fontSizes: {
|
|
3031
|
+
xs: "0.75rem",
|
|
3032
|
+
// 12px
|
|
3033
|
+
sm: "0.875rem",
|
|
3034
|
+
// 14px
|
|
3035
|
+
md: "1rem",
|
|
3036
|
+
// 16px
|
|
3037
|
+
lg: "1.125rem",
|
|
3038
|
+
// 18px
|
|
3039
|
+
xl: "1.25rem",
|
|
3040
|
+
// 20px
|
|
3041
|
+
"2xl": "1.5rem",
|
|
3042
|
+
// 24px
|
|
3043
|
+
"3xl": "2.125rem"
|
|
3044
|
+
// 34px
|
|
3045
|
+
},
|
|
3046
|
+
fontWeights: {
|
|
3047
|
+
normal: 400,
|
|
3048
|
+
medium: 500,
|
|
3049
|
+
semibold: 600,
|
|
3050
|
+
bold: 700
|
|
3051
|
+
},
|
|
3052
|
+
lineHeights: {
|
|
3053
|
+
tight: 1.2,
|
|
3054
|
+
normal: 1.4,
|
|
3055
|
+
relaxed: 1.6
|
|
3056
|
+
}
|
|
3057
|
+
},
|
|
3058
|
+
images: {
|
|
3059
|
+
favicon: {},
|
|
3060
|
+
logo: {}
|
|
2985
3061
|
}
|
|
2986
3062
|
};
|
|
2987
3063
|
var darkTheme = {
|
|
2988
3064
|
colors: {
|
|
3065
|
+
action: {
|
|
3066
|
+
active: "rgba(255, 255, 255, 0.70)",
|
|
3067
|
+
hover: "rgba(255, 255, 255, 0.04)",
|
|
3068
|
+
hoverOpacity: 0.04,
|
|
3069
|
+
selected: "rgba(255, 255, 255, 0.08)",
|
|
3070
|
+
selectedOpacity: 0.08,
|
|
3071
|
+
disabled: "rgba(255, 255, 255, 0.26)",
|
|
3072
|
+
disabledBackground: "rgba(255, 255, 255, 0.12)",
|
|
3073
|
+
disabledOpacity: 0.38,
|
|
3074
|
+
focus: "rgba(255, 255, 255, 0.12)",
|
|
3075
|
+
focusOpacity: 0.12,
|
|
3076
|
+
activatedOpacity: 0.12
|
|
3077
|
+
},
|
|
2989
3078
|
primary: {
|
|
2990
3079
|
main: "#1a73e8",
|
|
2991
3080
|
contrastText: "#ffffff"
|
|
@@ -3031,35 +3120,308 @@ var darkTheme = {
|
|
|
3031
3120
|
small: "0 2px 8px rgba(0, 0, 0, 0.3)",
|
|
3032
3121
|
medium: "0 4px 16px rgba(0, 0, 0, 0.4)",
|
|
3033
3122
|
large: "0 8px 32px rgba(0, 0, 0, 0.5)"
|
|
3123
|
+
},
|
|
3124
|
+
typography: {
|
|
3125
|
+
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',
|
|
3126
|
+
fontSizes: {
|
|
3127
|
+
xs: "0.75rem",
|
|
3128
|
+
// 12px
|
|
3129
|
+
sm: "0.875rem",
|
|
3130
|
+
// 14px
|
|
3131
|
+
md: "1rem",
|
|
3132
|
+
// 16px
|
|
3133
|
+
lg: "1.125rem",
|
|
3134
|
+
// 18px
|
|
3135
|
+
xl: "1.25rem",
|
|
3136
|
+
// 20px
|
|
3137
|
+
"2xl": "1.5rem",
|
|
3138
|
+
// 24px
|
|
3139
|
+
"3xl": "2.125rem"
|
|
3140
|
+
// 34px
|
|
3141
|
+
},
|
|
3142
|
+
fontWeights: {
|
|
3143
|
+
normal: 400,
|
|
3144
|
+
medium: 500,
|
|
3145
|
+
semibold: 600,
|
|
3146
|
+
bold: 700
|
|
3147
|
+
},
|
|
3148
|
+
lineHeights: {
|
|
3149
|
+
tight: 1.2,
|
|
3150
|
+
normal: 1.4,
|
|
3151
|
+
relaxed: 1.6
|
|
3152
|
+
}
|
|
3153
|
+
},
|
|
3154
|
+
images: {
|
|
3155
|
+
favicon: {},
|
|
3156
|
+
logo: {}
|
|
3034
3157
|
}
|
|
3035
3158
|
};
|
|
3036
3159
|
var toCssVariables = (theme) => {
|
|
3037
3160
|
const cssVars = {};
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3161
|
+
const prefix = theme.cssVarPrefix || VendorConstants_default.VENDOR_PREFIX;
|
|
3162
|
+
if (theme.colors?.action?.active) {
|
|
3163
|
+
cssVars[`--${prefix}-color-action-active`] = theme.colors.action.active;
|
|
3164
|
+
}
|
|
3165
|
+
if (theme.colors?.action?.hover) {
|
|
3166
|
+
cssVars[`--${prefix}-color-action-hover`] = theme.colors.action.hover;
|
|
3167
|
+
}
|
|
3168
|
+
if (theme.colors?.action?.hoverOpacity !== void 0) {
|
|
3169
|
+
cssVars[`--${prefix}-color-action-hoverOpacity`] = theme.colors.action.hoverOpacity.toString();
|
|
3170
|
+
}
|
|
3171
|
+
if (theme.colors?.action?.selected) {
|
|
3172
|
+
cssVars[`--${prefix}-color-action-selected`] = theme.colors.action.selected;
|
|
3173
|
+
}
|
|
3174
|
+
if (theme.colors?.action?.selectedOpacity !== void 0) {
|
|
3175
|
+
cssVars[`--${prefix}-color-action-selectedOpacity`] = theme.colors.action.selectedOpacity.toString();
|
|
3176
|
+
}
|
|
3177
|
+
if (theme.colors?.action?.disabled) {
|
|
3178
|
+
cssVars[`--${prefix}-color-action-disabled`] = theme.colors.action.disabled;
|
|
3179
|
+
}
|
|
3180
|
+
if (theme.colors?.action?.disabledBackground) {
|
|
3181
|
+
cssVars[`--${prefix}-color-action-disabledBackground`] = theme.colors.action.disabledBackground;
|
|
3182
|
+
}
|
|
3183
|
+
if (theme.colors?.action?.disabledOpacity !== void 0) {
|
|
3184
|
+
cssVars[`--${prefix}-color-action-disabledOpacity`] = theme.colors.action.disabledOpacity.toString();
|
|
3185
|
+
}
|
|
3186
|
+
if (theme.colors?.action?.focus) {
|
|
3187
|
+
cssVars[`--${prefix}-color-action-focus`] = theme.colors.action.focus;
|
|
3188
|
+
}
|
|
3189
|
+
if (theme.colors?.action?.focusOpacity !== void 0) {
|
|
3190
|
+
cssVars[`--${prefix}-color-action-focusOpacity`] = theme.colors.action.focusOpacity.toString();
|
|
3191
|
+
}
|
|
3192
|
+
if (theme.colors?.action?.activatedOpacity !== void 0) {
|
|
3193
|
+
cssVars[`--${prefix}-color-action-activatedOpacity`] = theme.colors.action.activatedOpacity.toString();
|
|
3194
|
+
}
|
|
3195
|
+
if (theme.colors?.primary?.main) {
|
|
3196
|
+
cssVars[`--${prefix}-color-primary-main`] = theme.colors.primary.main;
|
|
3197
|
+
}
|
|
3198
|
+
if (theme.colors?.primary?.contrastText) {
|
|
3199
|
+
cssVars[`--${prefix}-color-primary-contrastText`] = theme.colors.primary.contrastText;
|
|
3200
|
+
}
|
|
3201
|
+
if (theme.colors?.secondary?.main) {
|
|
3202
|
+
cssVars[`--${prefix}-color-secondary-main`] = theme.colors.secondary.main;
|
|
3203
|
+
}
|
|
3204
|
+
if (theme.colors?.secondary?.contrastText) {
|
|
3205
|
+
cssVars[`--${prefix}-color-secondary-contrastText`] = theme.colors.secondary.contrastText;
|
|
3206
|
+
}
|
|
3207
|
+
if (theme.colors?.background?.surface) {
|
|
3208
|
+
cssVars[`--${prefix}-color-background-surface`] = theme.colors.background.surface;
|
|
3209
|
+
}
|
|
3210
|
+
if (theme.colors?.background?.disabled) {
|
|
3211
|
+
cssVars[`--${prefix}-color-background-disabled`] = theme.colors.background.disabled;
|
|
3212
|
+
}
|
|
3213
|
+
if (theme.colors?.background?.body?.main) {
|
|
3214
|
+
cssVars[`--${prefix}-color-background-body-main`] = theme.colors.background.body.main;
|
|
3215
|
+
}
|
|
3216
|
+
if (theme.colors?.error?.main) {
|
|
3217
|
+
cssVars[`--${prefix}-color-error-main`] = theme.colors.error.main;
|
|
3218
|
+
}
|
|
3219
|
+
if (theme.colors?.error?.contrastText) {
|
|
3220
|
+
cssVars[`--${prefix}-color-error-contrastText`] = theme.colors.error.contrastText;
|
|
3221
|
+
}
|
|
3222
|
+
if (theme.colors?.success?.main) {
|
|
3223
|
+
cssVars[`--${prefix}-color-success-main`] = theme.colors.success.main;
|
|
3224
|
+
}
|
|
3225
|
+
if (theme.colors?.success?.contrastText) {
|
|
3226
|
+
cssVars[`--${prefix}-color-success-contrastText`] = theme.colors.success.contrastText;
|
|
3227
|
+
}
|
|
3228
|
+
if (theme.colors?.warning?.main) {
|
|
3229
|
+
cssVars[`--${prefix}-color-warning-main`] = theme.colors.warning.main;
|
|
3230
|
+
}
|
|
3231
|
+
if (theme.colors?.warning?.contrastText) {
|
|
3232
|
+
cssVars[`--${prefix}-color-warning-contrastText`] = theme.colors.warning.contrastText;
|
|
3233
|
+
}
|
|
3234
|
+
if (theme.colors?.text?.primary) {
|
|
3235
|
+
cssVars[`--${prefix}-color-text-primary`] = theme.colors.text.primary;
|
|
3236
|
+
}
|
|
3237
|
+
if (theme.colors?.text?.secondary) {
|
|
3238
|
+
cssVars[`--${prefix}-color-text-secondary`] = theme.colors.text.secondary;
|
|
3239
|
+
}
|
|
3240
|
+
if (theme.colors?.border) {
|
|
3241
|
+
cssVars[`--${prefix}-color-border`] = theme.colors.border;
|
|
3242
|
+
}
|
|
3243
|
+
if (theme.spacing?.unit !== void 0) {
|
|
3244
|
+
cssVars[`--${prefix}-spacing-unit`] = `${theme.spacing.unit}px`;
|
|
3245
|
+
}
|
|
3246
|
+
if (theme.borderRadius?.small) {
|
|
3247
|
+
cssVars[`--${prefix}-border-radius-small`] = theme.borderRadius.small;
|
|
3248
|
+
}
|
|
3249
|
+
if (theme.borderRadius?.medium) {
|
|
3250
|
+
cssVars[`--${prefix}-border-radius-medium`] = theme.borderRadius.medium;
|
|
3251
|
+
}
|
|
3252
|
+
if (theme.borderRadius?.large) {
|
|
3253
|
+
cssVars[`--${prefix}-border-radius-large`] = theme.borderRadius.large;
|
|
3254
|
+
}
|
|
3255
|
+
if (theme.shadows?.small) {
|
|
3256
|
+
cssVars[`--${prefix}-shadow-small`] = theme.shadows.small;
|
|
3257
|
+
}
|
|
3258
|
+
if (theme.shadows?.medium) {
|
|
3259
|
+
cssVars[`--${prefix}-shadow-medium`] = theme.shadows.medium;
|
|
3260
|
+
}
|
|
3261
|
+
if (theme.shadows?.large) {
|
|
3262
|
+
cssVars[`--${prefix}-shadow-large`] = theme.shadows.large;
|
|
3263
|
+
}
|
|
3264
|
+
if (theme.typography?.fontFamily) {
|
|
3265
|
+
cssVars[`--${prefix}-typography-fontFamily`] = theme.typography.fontFamily;
|
|
3266
|
+
}
|
|
3267
|
+
if (theme.typography?.fontSizes?.xs) {
|
|
3268
|
+
cssVars[`--${prefix}-typography-fontSize-xs`] = theme.typography.fontSizes.xs;
|
|
3269
|
+
}
|
|
3270
|
+
if (theme.typography?.fontSizes?.sm) {
|
|
3271
|
+
cssVars[`--${prefix}-typography-fontSize-sm`] = theme.typography.fontSizes.sm;
|
|
3272
|
+
}
|
|
3273
|
+
if (theme.typography?.fontSizes?.md) {
|
|
3274
|
+
cssVars[`--${prefix}-typography-fontSize-md`] = theme.typography.fontSizes.md;
|
|
3275
|
+
}
|
|
3276
|
+
if (theme.typography?.fontSizes?.lg) {
|
|
3277
|
+
cssVars[`--${prefix}-typography-fontSize-lg`] = theme.typography.fontSizes.lg;
|
|
3278
|
+
}
|
|
3279
|
+
if (theme.typography?.fontSizes?.xl) {
|
|
3280
|
+
cssVars[`--${prefix}-typography-fontSize-xl`] = theme.typography.fontSizes.xl;
|
|
3281
|
+
}
|
|
3282
|
+
if (theme.typography?.fontSizes?.["2xl"]) {
|
|
3283
|
+
cssVars[`--${prefix}-typography-fontSize-2xl`] = theme.typography.fontSizes["2xl"];
|
|
3284
|
+
}
|
|
3285
|
+
if (theme.typography?.fontSizes?.["3xl"]) {
|
|
3286
|
+
cssVars[`--${prefix}-typography-fontSize-3xl`] = theme.typography.fontSizes["3xl"];
|
|
3287
|
+
}
|
|
3288
|
+
if (theme.typography?.fontWeights?.normal !== void 0) {
|
|
3289
|
+
cssVars[`--${prefix}-typography-fontWeight-normal`] = theme.typography.fontWeights.normal.toString();
|
|
3290
|
+
}
|
|
3291
|
+
if (theme.typography?.fontWeights?.medium !== void 0) {
|
|
3292
|
+
cssVars[`--${prefix}-typography-fontWeight-medium`] = theme.typography.fontWeights.medium.toString();
|
|
3293
|
+
}
|
|
3294
|
+
if (theme.typography?.fontWeights?.semibold !== void 0) {
|
|
3295
|
+
cssVars[`--${prefix}-typography-fontWeight-semibold`] = theme.typography.fontWeights.semibold.toString();
|
|
3296
|
+
}
|
|
3297
|
+
if (theme.typography?.fontWeights?.bold !== void 0) {
|
|
3298
|
+
cssVars[`--${prefix}-typography-fontWeight-bold`] = theme.typography.fontWeights.bold.toString();
|
|
3299
|
+
}
|
|
3300
|
+
if (theme.typography?.lineHeights?.tight !== void 0) {
|
|
3301
|
+
cssVars[`--${prefix}-typography-lineHeight-tight`] = theme.typography.lineHeights.tight.toString();
|
|
3302
|
+
}
|
|
3303
|
+
if (theme.typography?.lineHeights?.normal !== void 0) {
|
|
3304
|
+
cssVars[`--${prefix}-typography-lineHeight-normal`] = theme.typography.lineHeights.normal.toString();
|
|
3305
|
+
}
|
|
3306
|
+
if (theme.typography?.lineHeights?.relaxed !== void 0) {
|
|
3307
|
+
cssVars[`--${prefix}-typography-lineHeight-relaxed`] = theme.typography.lineHeights.relaxed.toString();
|
|
3308
|
+
}
|
|
3309
|
+
if (theme.images) {
|
|
3310
|
+
Object.keys(theme.images).forEach((imageKey) => {
|
|
3311
|
+
const imageConfig = theme.images[imageKey];
|
|
3312
|
+
if (imageConfig?.url) {
|
|
3313
|
+
cssVars[`--${prefix}-image-${imageKey}-url`] = imageConfig.url;
|
|
3314
|
+
}
|
|
3315
|
+
if (imageConfig?.title) {
|
|
3316
|
+
cssVars[`--${prefix}-image-${imageKey}-title`] = imageConfig.title;
|
|
3317
|
+
}
|
|
3318
|
+
if (imageConfig?.alt) {
|
|
3319
|
+
cssVars[`--${prefix}-image-${imageKey}-alt`] = imageConfig.alt;
|
|
3320
|
+
}
|
|
3321
|
+
});
|
|
3322
|
+
}
|
|
3061
3323
|
return cssVars;
|
|
3062
3324
|
};
|
|
3325
|
+
var toThemeVars = (theme) => {
|
|
3326
|
+
const prefix = theme.cssVarPrefix || VendorConstants_default.VENDOR_PREFIX;
|
|
3327
|
+
const themeVars = {
|
|
3328
|
+
colors: {
|
|
3329
|
+
action: {
|
|
3330
|
+
active: `var(--${prefix}-color-action-active)`,
|
|
3331
|
+
hover: `var(--${prefix}-color-action-hover)`,
|
|
3332
|
+
hoverOpacity: `var(--${prefix}-color-action-hoverOpacity)`,
|
|
3333
|
+
selected: `var(--${prefix}-color-action-selected)`,
|
|
3334
|
+
selectedOpacity: `var(--${prefix}-color-action-selectedOpacity)`,
|
|
3335
|
+
disabled: `var(--${prefix}-color-action-disabled)`,
|
|
3336
|
+
disabledBackground: `var(--${prefix}-color-action-disabledBackground)`,
|
|
3337
|
+
disabledOpacity: `var(--${prefix}-color-action-disabledOpacity)`,
|
|
3338
|
+
focus: `var(--${prefix}-color-action-focus)`,
|
|
3339
|
+
focusOpacity: `var(--${prefix}-color-action-focusOpacity)`,
|
|
3340
|
+
activatedOpacity: `var(--${prefix}-color-action-activatedOpacity)`
|
|
3341
|
+
},
|
|
3342
|
+
primary: {
|
|
3343
|
+
main: `var(--${prefix}-color-primary-main)`,
|
|
3344
|
+
contrastText: `var(--${prefix}-color-primary-contrastText)`
|
|
3345
|
+
},
|
|
3346
|
+
secondary: {
|
|
3347
|
+
main: `var(--${prefix}-color-secondary-main)`,
|
|
3348
|
+
contrastText: `var(--${prefix}-color-secondary-contrastText)`
|
|
3349
|
+
},
|
|
3350
|
+
background: {
|
|
3351
|
+
surface: `var(--${prefix}-color-background-surface)`,
|
|
3352
|
+
disabled: `var(--${prefix}-color-background-disabled)`,
|
|
3353
|
+
body: {
|
|
3354
|
+
main: `var(--${prefix}-color-background-body-main)`
|
|
3355
|
+
}
|
|
3356
|
+
},
|
|
3357
|
+
error: {
|
|
3358
|
+
main: `var(--${prefix}-color-error-main)`,
|
|
3359
|
+
contrastText: `var(--${prefix}-color-error-contrastText)`
|
|
3360
|
+
},
|
|
3361
|
+
success: {
|
|
3362
|
+
main: `var(--${prefix}-color-success-main)`,
|
|
3363
|
+
contrastText: `var(--${prefix}-color-success-contrastText)`
|
|
3364
|
+
},
|
|
3365
|
+
warning: {
|
|
3366
|
+
main: `var(--${prefix}-color-warning-main)`,
|
|
3367
|
+
contrastText: `var(--${prefix}-color-warning-contrastText)`
|
|
3368
|
+
},
|
|
3369
|
+
text: {
|
|
3370
|
+
primary: `var(--${prefix}-color-text-primary)`,
|
|
3371
|
+
secondary: `var(--${prefix}-color-text-secondary)`
|
|
3372
|
+
},
|
|
3373
|
+
border: `var(--${prefix}-color-border)`
|
|
3374
|
+
},
|
|
3375
|
+
spacing: {
|
|
3376
|
+
unit: `var(--${prefix}-spacing-unit)`
|
|
3377
|
+
},
|
|
3378
|
+
borderRadius: {
|
|
3379
|
+
small: `var(--${prefix}-border-radius-small)`,
|
|
3380
|
+
medium: `var(--${prefix}-border-radius-medium)`,
|
|
3381
|
+
large: `var(--${prefix}-border-radius-large)`
|
|
3382
|
+
},
|
|
3383
|
+
shadows: {
|
|
3384
|
+
small: `var(--${prefix}-shadow-small)`,
|
|
3385
|
+
medium: `var(--${prefix}-shadow-medium)`,
|
|
3386
|
+
large: `var(--${prefix}-shadow-large)`
|
|
3387
|
+
},
|
|
3388
|
+
typography: {
|
|
3389
|
+
fontFamily: `var(--${prefix}-typography-fontFamily)`,
|
|
3390
|
+
fontSizes: {
|
|
3391
|
+
xs: `var(--${prefix}-typography-fontSize-xs)`,
|
|
3392
|
+
sm: `var(--${prefix}-typography-fontSize-sm)`,
|
|
3393
|
+
md: `var(--${prefix}-typography-fontSize-md)`,
|
|
3394
|
+
lg: `var(--${prefix}-typography-fontSize-lg)`,
|
|
3395
|
+
xl: `var(--${prefix}-typography-fontSize-xl)`,
|
|
3396
|
+
"2xl": `var(--${prefix}-typography-fontSize-2xl)`,
|
|
3397
|
+
"3xl": `var(--${prefix}-typography-fontSize-3xl)`
|
|
3398
|
+
},
|
|
3399
|
+
fontWeights: {
|
|
3400
|
+
normal: `var(--${prefix}-typography-fontWeight-normal)`,
|
|
3401
|
+
medium: `var(--${prefix}-typography-fontWeight-medium)`,
|
|
3402
|
+
semibold: `var(--${prefix}-typography-fontWeight-semibold)`,
|
|
3403
|
+
bold: `var(--${prefix}-typography-fontWeight-bold)`
|
|
3404
|
+
},
|
|
3405
|
+
lineHeights: {
|
|
3406
|
+
tight: `var(--${prefix}-typography-lineHeight-tight)`,
|
|
3407
|
+
normal: `var(--${prefix}-typography-lineHeight-normal)`,
|
|
3408
|
+
relaxed: `var(--${prefix}-typography-lineHeight-relaxed)`
|
|
3409
|
+
}
|
|
3410
|
+
}
|
|
3411
|
+
};
|
|
3412
|
+
if (theme.images) {
|
|
3413
|
+
themeVars.images = {};
|
|
3414
|
+
Object.keys(theme.images).forEach((imageKey) => {
|
|
3415
|
+
const imageConfig = theme.images[imageKey];
|
|
3416
|
+
themeVars.images[imageKey] = {
|
|
3417
|
+
url: imageConfig?.url ? `var(--${prefix}-image-${imageKey}-url)` : void 0,
|
|
3418
|
+
title: imageConfig?.title ? `var(--${prefix}-image-${imageKey}-title)` : void 0,
|
|
3419
|
+
alt: imageConfig?.alt ? `var(--${prefix}-image-${imageKey}-alt)` : void 0
|
|
3420
|
+
};
|
|
3421
|
+
});
|
|
3422
|
+
}
|
|
3423
|
+
return themeVars;
|
|
3424
|
+
};
|
|
3063
3425
|
var createTheme = (config = {}, isDark = false) => {
|
|
3064
3426
|
const baseTheme = isDark ? darkTheme : lightTheme;
|
|
3065
3427
|
const mergedConfig = {
|
|
@@ -3068,6 +3430,10 @@ var createTheme = (config = {}, isDark = false) => {
|
|
|
3068
3430
|
colors: {
|
|
3069
3431
|
...baseTheme.colors,
|
|
3070
3432
|
...config.colors,
|
|
3433
|
+
action: {
|
|
3434
|
+
...baseTheme.colors.action,
|
|
3435
|
+
...config.colors?.action || {}
|
|
3436
|
+
},
|
|
3071
3437
|
secondary: {
|
|
3072
3438
|
...baseTheme.colors.secondary,
|
|
3073
3439
|
...config.colors?.secondary || {}
|
|
@@ -3084,11 +3450,32 @@ var createTheme = (config = {}, isDark = false) => {
|
|
|
3084
3450
|
shadows: {
|
|
3085
3451
|
...baseTheme.shadows,
|
|
3086
3452
|
...config.shadows
|
|
3453
|
+
},
|
|
3454
|
+
typography: {
|
|
3455
|
+
...baseTheme.typography,
|
|
3456
|
+
...config.typography,
|
|
3457
|
+
fontSizes: {
|
|
3458
|
+
...baseTheme.typography.fontSizes,
|
|
3459
|
+
...config.typography?.fontSizes || {}
|
|
3460
|
+
},
|
|
3461
|
+
fontWeights: {
|
|
3462
|
+
...baseTheme.typography.fontWeights,
|
|
3463
|
+
...config.typography?.fontWeights || {}
|
|
3464
|
+
},
|
|
3465
|
+
lineHeights: {
|
|
3466
|
+
...baseTheme.typography.lineHeights,
|
|
3467
|
+
...config.typography?.lineHeights || {}
|
|
3468
|
+
}
|
|
3469
|
+
},
|
|
3470
|
+
images: {
|
|
3471
|
+
...baseTheme.images,
|
|
3472
|
+
...config.images
|
|
3087
3473
|
}
|
|
3088
3474
|
};
|
|
3089
3475
|
return {
|
|
3090
3476
|
...mergedConfig,
|
|
3091
|
-
cssVariables: toCssVariables(mergedConfig)
|
|
3477
|
+
cssVariables: toCssVariables(mergedConfig),
|
|
3478
|
+
vars: toThemeVars(mergedConfig)
|
|
3092
3479
|
};
|
|
3093
3480
|
};
|
|
3094
3481
|
var createTheme_default = createTheme;
|
|
@@ -3412,8 +3799,18 @@ var translations = {
|
|
|
3412
3799
|
"organization.switcher.members": "members",
|
|
3413
3800
|
"organization.switcher.member": "member",
|
|
3414
3801
|
"organization.switcher.create.organization": "Create Organization",
|
|
3415
|
-
"organization.switcher.manage.organizations": "Manage
|
|
3802
|
+
"organization.switcher.manage.organizations": "Manage Organizations",
|
|
3416
3803
|
"organization.switcher.manage.button": "Manage",
|
|
3804
|
+
"organization.switcher.organizations.title": "Organizations",
|
|
3805
|
+
"organization.switcher.switch.button": "Switch",
|
|
3806
|
+
"organization.switcher.no.access": "No Access",
|
|
3807
|
+
"organization.switcher.status.label": "Status:",
|
|
3808
|
+
"organization.switcher.showing.count": "Showing {showing} of {total} organizations",
|
|
3809
|
+
"organization.switcher.refresh.button": "Refresh",
|
|
3810
|
+
"organization.switcher.load.more": "Load More Organizations",
|
|
3811
|
+
"organization.switcher.loading.more": "Loading...",
|
|
3812
|
+
"organization.switcher.no.organizations": "No organizations found",
|
|
3813
|
+
"organization.switcher.error.prefix": "Error:",
|
|
3417
3814
|
"organization.profile.title": "Organization Profile",
|
|
3418
3815
|
"organization.profile.loading": "Loading organization...",
|
|
3419
3816
|
"organization.profile.error": "Failed to load organization",
|
|
@@ -3500,6 +3897,112 @@ var resolveFieldName_default = resolveFieldName;
|
|
|
3500
3897
|
// src/utils/withVendorCSSClassPrefix.ts
|
|
3501
3898
|
var withVendorCSSClassPrefix = (className) => `${VendorConstants_default.VENDOR_PREFIX}-${className}`;
|
|
3502
3899
|
var withVendorCSSClassPrefix_default = withVendorCSSClassPrefix;
|
|
3900
|
+
|
|
3901
|
+
// src/utils/transformBrandingPreferenceToTheme.ts
|
|
3902
|
+
var extractColorValue = (colorVariant) => {
|
|
3903
|
+
return colorVariant?.main;
|
|
3904
|
+
};
|
|
3905
|
+
var extractContrastText = (colorVariant) => {
|
|
3906
|
+
return colorVariant?.contrastText;
|
|
3907
|
+
};
|
|
3908
|
+
var transformThemeVariant = (themeVariant, isDark = false) => {
|
|
3909
|
+
const colors = themeVariant.colors;
|
|
3910
|
+
const buttons = themeVariant.buttons;
|
|
3911
|
+
const inputs = themeVariant.inputs;
|
|
3912
|
+
const images = themeVariant.images;
|
|
3913
|
+
return {
|
|
3914
|
+
colors: {
|
|
3915
|
+
action: {
|
|
3916
|
+
active: isDark ? "rgba(255, 255, 255, 0.70)" : "rgba(0, 0, 0, 0.54)",
|
|
3917
|
+
hover: isDark ? "rgba(255, 255, 255, 0.04)" : "rgba(0, 0, 0, 0.04)",
|
|
3918
|
+
hoverOpacity: 0.04,
|
|
3919
|
+
selected: isDark ? "rgba(255, 255, 255, 0.08)" : "rgba(0, 0, 0, 0.08)",
|
|
3920
|
+
selectedOpacity: 0.08,
|
|
3921
|
+
disabled: isDark ? "rgba(255, 255, 255, 0.26)" : "rgba(0, 0, 0, 0.26)",
|
|
3922
|
+
disabledBackground: isDark ? "rgba(255, 255, 255, 0.12)" : "rgba(0, 0, 0, 0.12)",
|
|
3923
|
+
disabledOpacity: 0.38,
|
|
3924
|
+
focus: isDark ? "rgba(255, 255, 255, 0.12)" : "rgba(0, 0, 0, 0.12)",
|
|
3925
|
+
focusOpacity: 0.12,
|
|
3926
|
+
activatedOpacity: 0.12
|
|
3927
|
+
},
|
|
3928
|
+
primary: {
|
|
3929
|
+
main: extractColorValue(colors?.primary),
|
|
3930
|
+
contrastText: extractContrastText(colors?.primary)
|
|
3931
|
+
},
|
|
3932
|
+
secondary: {
|
|
3933
|
+
main: extractColorValue(colors?.secondary),
|
|
3934
|
+
contrastText: extractContrastText(colors?.secondary)
|
|
3935
|
+
},
|
|
3936
|
+
background: {
|
|
3937
|
+
surface: extractColorValue(colors?.background?.surface),
|
|
3938
|
+
disabled: extractColorValue(colors?.background?.surface),
|
|
3939
|
+
body: {
|
|
3940
|
+
main: extractColorValue(colors?.background?.body)
|
|
3941
|
+
}
|
|
3942
|
+
},
|
|
3943
|
+
text: {
|
|
3944
|
+
primary: colors?.text?.primary,
|
|
3945
|
+
secondary: colors?.text?.secondary
|
|
3946
|
+
},
|
|
3947
|
+
border: colors?.outlined?.default,
|
|
3948
|
+
error: {
|
|
3949
|
+
main: extractColorValue(colors?.alerts?.error),
|
|
3950
|
+
contrastText: extractContrastText(colors?.alerts?.error)
|
|
3951
|
+
},
|
|
3952
|
+
success: {
|
|
3953
|
+
main: extractColorValue(colors?.alerts?.info),
|
|
3954
|
+
contrastText: extractContrastText(colors?.alerts?.info)
|
|
3955
|
+
},
|
|
3956
|
+
warning: {
|
|
3957
|
+
main: extractColorValue(colors?.alerts?.warning),
|
|
3958
|
+
contrastText: extractContrastText(colors?.alerts?.warning)
|
|
3959
|
+
}
|
|
3960
|
+
},
|
|
3961
|
+
// Extract border radius from buttons or inputs
|
|
3962
|
+
borderRadius: {
|
|
3963
|
+
small: buttons?.primary?.base?.border?.borderRadius || inputs?.base?.border?.borderRadius,
|
|
3964
|
+
medium: buttons?.secondary?.base?.border?.borderRadius,
|
|
3965
|
+
large: buttons?.externalConnection?.base?.border?.borderRadius
|
|
3966
|
+
},
|
|
3967
|
+
// Extract and transform images
|
|
3968
|
+
images: {
|
|
3969
|
+
favicon: images?.favicon ? {
|
|
3970
|
+
url: images.favicon.imgURL,
|
|
3971
|
+
title: images.favicon.title,
|
|
3972
|
+
alt: images.favicon.altText
|
|
3973
|
+
} : void 0,
|
|
3974
|
+
logo: images?.logo ? {
|
|
3975
|
+
url: images.logo.imgURL,
|
|
3976
|
+
title: images.logo.title,
|
|
3977
|
+
alt: images.logo.altText
|
|
3978
|
+
} : void 0
|
|
3979
|
+
}
|
|
3980
|
+
};
|
|
3981
|
+
};
|
|
3982
|
+
var transformBrandingPreferenceToTheme = (brandingPreference, forceTheme) => {
|
|
3983
|
+
const themeConfig = brandingPreference?.preference?.theme;
|
|
3984
|
+
if (!themeConfig) {
|
|
3985
|
+
return createTheme_default({}, false);
|
|
3986
|
+
}
|
|
3987
|
+
let activeThemeKey;
|
|
3988
|
+
if (forceTheme) {
|
|
3989
|
+
activeThemeKey = forceTheme.toUpperCase();
|
|
3990
|
+
} else {
|
|
3991
|
+
activeThemeKey = themeConfig.activeTheme || "LIGHT";
|
|
3992
|
+
}
|
|
3993
|
+
const themeVariant = themeConfig[activeThemeKey];
|
|
3994
|
+
if (!themeVariant) {
|
|
3995
|
+
const fallbackVariant = themeConfig.LIGHT || themeConfig.DARK;
|
|
3996
|
+
if (fallbackVariant) {
|
|
3997
|
+
const transformedConfig2 = transformThemeVariant(fallbackVariant, activeThemeKey === "DARK");
|
|
3998
|
+
return createTheme_default(transformedConfig2, activeThemeKey === "DARK");
|
|
3999
|
+
}
|
|
4000
|
+
return createTheme_default({}, activeThemeKey === "DARK");
|
|
4001
|
+
}
|
|
4002
|
+
const transformedConfig = transformThemeVariant(themeVariant, activeThemeKey === "DARK");
|
|
4003
|
+
return createTheme_default(transformedConfig, activeThemeKey === "DARK");
|
|
4004
|
+
};
|
|
4005
|
+
var transformBrandingPreferenceToTheme_default = transformBrandingPreferenceToTheme;
|
|
3503
4006
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3504
4007
|
0 && (module.exports = {
|
|
3505
4008
|
ApplicationNativeAuthenticationConstants,
|
|
@@ -3552,10 +4055,12 @@ var withVendorCSSClassPrefix_default = withVendorCSSClassPrefix;
|
|
|
3552
4055
|
initializeEmbeddedSignInFlow,
|
|
3553
4056
|
isEmpty,
|
|
3554
4057
|
processOpenIDScopes,
|
|
4058
|
+
processUsername,
|
|
3555
4059
|
removeTrailingSlash,
|
|
3556
4060
|
resolveFieldName,
|
|
3557
4061
|
resolveFieldType,
|
|
3558
4062
|
set,
|
|
4063
|
+
transformBrandingPreferenceToTheme,
|
|
3559
4064
|
updateMeProfile,
|
|
3560
4065
|
updateOrganization,
|
|
3561
4066
|
withVendorCSSClassPrefix
|