@asgardeo/javascript 0.1.9 → 0.1.10

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/index.js CHANGED
@@ -3274,10 +3274,31 @@ var toCssVariables = (theme) => {
3274
3274
  }
3275
3275
  });
3276
3276
  }
3277
+ if (theme.components?.Button?.styleOverrides?.root?.borderRadius) {
3278
+ cssVars[`--${prefix}-component-button-root-borderRadius`] = theme.components.Button.styleOverrides.root.borderRadius;
3279
+ }
3280
+ if (theme.components?.Field?.styleOverrides?.root?.borderRadius) {
3281
+ cssVars[`--${prefix}-component-field-root-borderRadius`] = theme.components.Field.styleOverrides.root.borderRadius;
3282
+ }
3277
3283
  return cssVars;
3278
3284
  };
3279
3285
  var toThemeVars = (theme) => {
3280
3286
  const prefix = theme.cssVarPrefix || VendorConstants_default.VENDOR_PREFIX;
3287
+ const componentVars = {};
3288
+ if (theme.components?.Button?.styleOverrides?.root?.borderRadius) {
3289
+ componentVars.Button = {
3290
+ root: {
3291
+ borderRadius: `var(--${prefix}-component-button-root-borderRadius)`
3292
+ }
3293
+ };
3294
+ }
3295
+ if (theme.components?.Field?.styleOverrides?.root?.borderRadius) {
3296
+ componentVars.Field = {
3297
+ root: {
3298
+ borderRadius: `var(--${prefix}-component-field-root-borderRadius)`
3299
+ }
3300
+ };
3301
+ }
3281
3302
  const themeVars = {
3282
3303
  colors: {
3283
3304
  action: {
@@ -3378,6 +3399,9 @@ var toThemeVars = (theme) => {
3378
3399
  };
3379
3400
  });
3380
3401
  }
3402
+ if (Object.keys(componentVars).length > 0) {
3403
+ themeVars.components = componentVars;
3404
+ }
3381
3405
  return themeVars;
3382
3406
  };
3383
3407
  var createTheme = (config = {}, isDark = false) => {
@@ -3901,7 +3925,7 @@ var transformThemeVariant = (themeVariant, isDark = false) => {
3901
3925
  const buttons = themeVariant.buttons;
3902
3926
  const inputs = themeVariant.inputs;
3903
3927
  const images = themeVariant.images;
3904
- return {
3928
+ const config = {
3905
3929
  colors: {
3906
3930
  action: {
3907
3931
  active: isDark ? "rgba(255, 255, 255, 0.70)" : "rgba(0, 0, 0, 0.54)",
@@ -3962,13 +3986,6 @@ var transformThemeVariant = (themeVariant, isDark = false) => {
3962
3986
  dark: colors?.alerts?.warning?.dark || colors?.alerts?.warning?.main
3963
3987
  }
3964
3988
  },
3965
- // Extract border radius from buttons or inputs
3966
- borderRadius: {
3967
- small: buttons?.primary?.base?.border?.borderRadius || inputs?.base?.border?.borderRadius,
3968
- medium: buttons?.secondary?.base?.border?.borderRadius,
3969
- large: buttons?.externalConnection?.base?.border?.borderRadius
3970
- },
3971
- // Extract and transform images
3972
3989
  images: {
3973
3990
  favicon: images?.favicon ? {
3974
3991
  url: images.favicon.imgURL,
@@ -3982,6 +3999,31 @@ var transformThemeVariant = (themeVariant, isDark = false) => {
3982
3999
  } : void 0
3983
4000
  }
3984
4001
  };
4002
+ const buttonBorderRadius = buttons?.primary?.base?.border?.borderRadius;
4003
+ const fieldBorderRadius = inputs?.base?.border?.borderRadius;
4004
+ if (buttonBorderRadius || fieldBorderRadius) {
4005
+ config.components = {
4006
+ ...buttonBorderRadius && {
4007
+ Button: {
4008
+ styleOverrides: {
4009
+ root: {
4010
+ borderRadius: buttonBorderRadius
4011
+ }
4012
+ }
4013
+ }
4014
+ },
4015
+ ...fieldBorderRadius && {
4016
+ Field: {
4017
+ styleOverrides: {
4018
+ root: {
4019
+ borderRadius: fieldBorderRadius
4020
+ }
4021
+ }
4022
+ }
4023
+ }
4024
+ };
4025
+ }
4026
+ return config;
3985
4027
  };
3986
4028
  var transformBrandingPreferenceToTheme = (brandingPreference, forceTheme) => {
3987
4029
  const themeConfig = brandingPreference?.preference?.theme;