@asgardeo/react 0.5.13 → 0.5.15

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 CHANGED
@@ -176,7 +176,8 @@ var AsgardeoContext = (0, import_react.createContext)({
176
176
  http: {
177
177
  request: () => null,
178
178
  requestAll: () => null
179
- }
179
+ },
180
+ signInOptions: {}
180
181
  });
181
182
  AsgardeoContext.displayName = "AsgardeoContext";
182
183
  var AsgardeoContext_default = AsgardeoContext;
@@ -1289,7 +1290,8 @@ var ThemeProvider = ({
1289
1290
  borderRadius: brandingTheme.borderRadius,
1290
1291
  shadows: brandingTheme.shadows,
1291
1292
  spacing: brandingTheme.spacing,
1292
- images: brandingTheme.images
1293
+ images: brandingTheme.images,
1294
+ components: brandingTheme.components
1293
1295
  };
1294
1296
  return {
1295
1297
  ...brandingThemeConfig,
@@ -1313,6 +1315,10 @@ var ThemeProvider = ({
1313
1315
  images: {
1314
1316
  ...brandingThemeConfig.images,
1315
1317
  ...themeConfig?.images
1318
+ },
1319
+ components: {
1320
+ ...brandingThemeConfig.components,
1321
+ ...themeConfig?.components
1316
1322
  }
1317
1323
  };
1318
1324
  }, [inheritFromBranding, brandingTheme, themeConfig]);
@@ -1478,6 +1484,7 @@ var AsgardeoProvider = ({
1478
1484
  signUpUrl,
1479
1485
  organizationHandle,
1480
1486
  applicationId,
1487
+ signInOptions,
1481
1488
  ...rest
1482
1489
  }) => {
1483
1490
  const reRenderCheckRef = (0, import_react15.useRef)(false);
@@ -1501,6 +1508,7 @@ var AsgardeoProvider = ({
1501
1508
  scopes,
1502
1509
  signUpUrl,
1503
1510
  signInUrl,
1511
+ signInOptions,
1504
1512
  ...rest
1505
1513
  });
1506
1514
  const [brandingPreference, setBrandingPreference] = (0, import_react15.useState)(null);
@@ -1738,7 +1746,8 @@ var AsgardeoProvider = ({
1738
1746
  http: {
1739
1747
  request: asgardeo.request.bind(asgardeo),
1740
1748
  requestAll: asgardeo.requestAll.bind(asgardeo)
1741
- }
1749
+ },
1750
+ signInOptions
1742
1751
  }),
1743
1752
  [
1744
1753
  applicationId,
@@ -1754,7 +1763,8 @@ var AsgardeoProvider = ({
1754
1763
  signIn,
1755
1764
  signInSilently,
1756
1765
  user,
1757
- asgardeo
1766
+ asgardeo,
1767
+ signInOptions
1758
1768
  ]
1759
1769
  );
1760
1770
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(AsgardeoContext_default.Provider, { value, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(I18nProvider_default, { preferences: preferences?.i18n, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
@@ -2232,7 +2242,7 @@ var useStyles2 = (theme, colorScheme, color, variant, size, fullWidth, disabled,
2232
2242
  align-items: center;
2233
2243
  justify-content: center;
2234
2244
  gap: calc(${theme.vars.spacing.unit} * 1);
2235
- border-radius: ${shape === "round" ? "50%" : theme.vars.borderRadius.medium};
2245
+ border-radius: ${shape === "round" ? "50%" : theme.vars.components?.Button?.root?.borderRadius || theme.vars.borderRadius.medium};
2236
2246
  font-weight: 500;
2237
2247
  cursor: ${disabled || loading ? "not-allowed" : "pointer"};
2238
2248
  outline: none;
@@ -2563,8 +2573,8 @@ var BaseSignInButton_default = BaseSignInButton;
2563
2573
  var import_browser18 = require("@asgardeo/browser");
2564
2574
  var import_react28 = require("react");
2565
2575
  var import_jsx_runtime11 = require("react/jsx-runtime");
2566
- var SignInButton = (0, import_react28.forwardRef)(({ children, onClick, preferences, ...rest }, ref) => {
2567
- const { signIn, signInUrl } = useAsgardeo_default();
2576
+ var SignInButton = (0, import_react28.forwardRef)(({ children, onClick, preferences, signInOptions: overriddenSignInOptions = {}, ...rest }, ref) => {
2577
+ const { signIn, signInUrl, signInOptions } = useAsgardeo_default();
2568
2578
  const { t } = useTranslation_default(preferences?.i18n);
2569
2579
  const [isLoading, setIsLoading] = (0, import_react28.useState)(false);
2570
2580
  const handleSignIn = async (e) => {
@@ -2574,7 +2584,7 @@ var SignInButton = (0, import_react28.forwardRef)(({ children, onClick, preferen
2574
2584
  window.history.pushState(null, "", signInUrl);
2575
2585
  window.dispatchEvent(new PopStateEvent("popstate", { state: null }));
2576
2586
  } else {
2577
- await signIn();
2587
+ await signIn(overriddenSignInOptions ?? signInOptions);
2578
2588
  }
2579
2589
  if (onClick) {
2580
2590
  onClick(e);
@@ -3336,7 +3346,7 @@ var useStyles6 = (theme, colorScheme, disabled, hasError, hasStartIcon, hasEndIc
3336
3346
  width: 100%;
3337
3347
  padding: ${theme.vars.spacing.unit} ${rightPadding} ${theme.vars.spacing.unit} ${leftPadding};
3338
3348
  border: 1px solid ${hasError ? theme.vars.colors.error.main : theme.vars.colors.border};
3339
- border-radius: ${theme.vars.borderRadius.medium};
3349
+ border-radius: ${theme.vars.components?.Field?.root?.borderRadius || theme.vars.borderRadius.medium};
3340
3350
  font-size: ${theme.vars.typography.fontSizes.md};
3341
3351
  color: ${theme.vars.colors.text.primary};
3342
3352
  background-color: ${disabled ? theme.vars.colors.background.disabled : theme.vars.colors.background.surface};
@@ -3520,7 +3530,7 @@ var useStyles7 = (theme, colorScheme, disabled, hasError) => {
3520
3530
  width: 100%;
3521
3531
  padding: ${theme.vars.spacing.unit} calc(${theme.vars.spacing.unit} * 1.5);
3522
3532
  border: 1px solid ${hasError ? theme.vars.colors.error.main : theme.vars.colors.border};
3523
- border-radius: ${theme.vars.borderRadius.medium};
3533
+ border-radius: ${theme.vars.components?.Field?.root?.borderRadius || theme.vars.borderRadius.medium};
3524
3534
  font-size: ${theme.vars.typography.fontSizes.md};
3525
3535
  color: ${theme.vars.colors.text.primary};
3526
3536
  background-color: ${disabled ? theme.vars.colors.background.disabled : theme.vars.colors.background.surface};
@@ -3660,7 +3670,7 @@ var useStyles8 = (theme, colorScheme, disabled, hasError, length) => {
3660
3670
  font-size: ${theme.vars.typography.fontSizes.xl};
3661
3671
  font-weight: 500;
3662
3672
  border: 2px solid ${hasError ? theme.vars.colors.error.main : theme.vars.colors.border};
3663
- border-radius: ${theme.vars.borderRadius.medium};
3673
+ border-radius: ${theme.vars.components?.Field?.root?.borderRadius || theme.vars.borderRadius.medium};
3664
3674
  color: ${theme.vars.colors.text.primary};
3665
3675
  background-color: ${disabled ? theme.vars.colors.background.disabled : theme.vars.colors.background.surface};
3666
3676
  outline: none;
@@ -3990,7 +4000,7 @@ var useStyles10 = (theme, colorScheme, hasError, disabled) => {
3990
4000
  width: 100%;
3991
4001
  padding: ${theme.vars.spacing.unit} calc(${theme.vars.spacing.unit} * 1.5);
3992
4002
  border: 1px solid ${theme.vars.colors.border};
3993
- border-radius: ${theme.vars.borderRadius.medium};
4003
+ border-radius: ${theme.vars.components?.Field?.root?.borderRadius || theme.vars.borderRadius.medium};
3994
4004
  font-size: 1rem;
3995
4005
  color: ${theme.vars.colors.text.primary};
3996
4006
  background-color: ${theme.vars.colors.background.surface};