@asgardeo/react 0.11.2 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/dist/AsgardeoReactClient.d.ts +10 -10
  2. package/dist/__temp__/api.d.ts +6 -6
  3. package/dist/__temp__/models.d.ts +30 -30
  4. package/dist/cjs/index.js +6272 -5796
  5. package/dist/cjs/index.js.map +4 -4
  6. package/dist/components/adapters/FacebookButton.d.ts +1 -1
  7. package/dist/components/adapters/GitHubButton.d.ts +1 -1
  8. package/dist/components/adapters/GoogleButton.d.ts +1 -1
  9. package/dist/components/adapters/LinkedInButton.d.ts +1 -1
  10. package/dist/components/adapters/MicrosoftButton.d.ts +1 -1
  11. package/dist/components/adapters/SignInWithEthereumButton.d.ts +1 -1
  12. package/dist/components/adapters/SmsOtpButton.d.ts +1 -1
  13. package/dist/components/auth/Callback/Callback.d.ts +51 -0
  14. package/dist/components/factories/FieldFactory.d.ts +25 -25
  15. package/dist/components/presentation/CreateOrganization/BaseCreateOrganization.styles.d.ts +1 -18
  16. package/dist/components/presentation/CreateOrganization/CreateOrganization.d.ts +1 -1
  17. package/dist/components/presentation/OrganizationList/BaseOrganizationList.d.ts +26 -26
  18. package/dist/components/presentation/OrganizationList/BaseOrganizationList.styles.d.ts +1 -31
  19. package/dist/components/presentation/OrganizationList/OrganizationList.styles.d.ts +1 -6
  20. package/dist/components/presentation/OrganizationProfile/BaseOrganizationProfile.d.ts +3 -3
  21. package/dist/components/presentation/OrganizationProfile/BaseOrganizationProfile.styles.d.ts +1 -27
  22. package/dist/components/presentation/OrganizationSwitcher/BaseOrganizationSwitcher.d.ts +6 -6
  23. package/dist/components/presentation/OrganizationSwitcher/BaseOrganizationSwitcher.styles.d.ts +1 -25
  24. package/dist/components/presentation/User/BaseUser.d.ts +4 -4
  25. package/dist/components/presentation/UserDropdown/BaseUserDropdown.styles.d.ts +1 -15
  26. package/dist/components/presentation/UserProfile/BaseUserProfile.d.ts +3 -3
  27. package/dist/components/presentation/UserProfile/BaseUserProfile.styles.d.ts +1 -26
  28. package/dist/components/presentation/auth/AcceptInvite/index.d.ts +1 -1
  29. package/dist/components/presentation/auth/AcceptInvite/v2/AcceptInvite.d.ts +13 -13
  30. package/dist/components/presentation/auth/AcceptInvite/v2/BaseAcceptInvite.d.ts +52 -51
  31. package/dist/components/presentation/auth/AcceptInvite/v2/BaseAcceptInvite.styles.d.ts +6 -10
  32. package/dist/components/presentation/auth/AuthOptionFactory.d.ts +1 -1
  33. package/dist/components/presentation/auth/InviteUser/index.d.ts +1 -1
  34. package/dist/components/presentation/auth/InviteUser/v2/BaseInviteUser.d.ts +57 -57
  35. package/dist/components/presentation/auth/InviteUser/v2/BaseInviteUser.styles.d.ts +6 -10
  36. package/dist/components/presentation/auth/InviteUser/v2/InviteUser.d.ts +15 -15
  37. package/dist/components/presentation/auth/SignIn/BaseSignIn.styles.d.ts +1 -27
  38. package/dist/components/presentation/auth/SignIn/SignIn.d.ts +1 -1
  39. package/dist/components/presentation/auth/SignIn/v1/BaseSignIn.d.ts +12 -12
  40. package/dist/components/presentation/auth/SignIn/v1/options/SignInOptionFactory.d.ts +15 -15
  41. package/dist/components/presentation/auth/SignIn/v1/types.d.ts +30 -30
  42. package/dist/components/presentation/auth/SignIn/v2/BaseSignIn.d.ts +47 -47
  43. package/dist/components/presentation/auth/SignIn/v2/SignIn.d.ts +20 -20
  44. package/dist/components/presentation/auth/SignUp/BaseSignUp.styles.d.ts +1 -26
  45. package/dist/components/presentation/auth/SignUp/v1/BaseSignUp.d.ts +40 -40
  46. package/dist/components/presentation/auth/SignUp/v1/SignUpOptionFactory.d.ts +1 -1
  47. package/dist/components/presentation/auth/SignUp/v2/BaseSignUp.d.ts +46 -46
  48. package/dist/components/primitives/Alert/Alert.d.ts +8 -8
  49. package/dist/components/primitives/Alert/Alert.styles.d.ts +1 -8
  50. package/dist/components/primitives/Avatar/Avatar.d.ts +4 -4
  51. package/dist/components/primitives/Avatar/Avatar.styles.d.ts +1 -7
  52. package/dist/components/primitives/Button/Button.d.ts +14 -14
  53. package/dist/components/primitives/Button/Button.styles.d.ts +1 -13
  54. package/dist/components/primitives/Card/Card.d.ts +4 -4
  55. package/dist/components/primitives/Card/Card.styles.d.ts +1 -11
  56. package/dist/components/primitives/Checkbox/Checkbox.d.ts +8 -8
  57. package/dist/components/primitives/Checkbox/Checkbox.styles.d.ts +1 -8
  58. package/dist/components/primitives/DatePicker/DatePicker.d.ts +12 -12
  59. package/dist/components/primitives/DatePicker/DatePicker.styles.d.ts +1 -6
  60. package/dist/components/primitives/Dialog/Dialog.d.ts +17 -17
  61. package/dist/components/primitives/Dialog/Dialog.styles.d.ts +1 -9
  62. package/dist/components/primitives/Divider/Divider.d.ts +2 -2
  63. package/dist/components/primitives/Divider/Divider.styles.d.ts +1 -7
  64. package/dist/components/primitives/FormControl/FormControl.d.ts +4 -4
  65. package/dist/components/primitives/FormControl/FormControl.styles.d.ts +1 -5
  66. package/dist/components/primitives/InputLabel/InputLabel.d.ts +10 -10
  67. package/dist/components/primitives/InputLabel/InputLabel.styles.d.ts +1 -7
  68. package/dist/components/primitives/KeyValueInput/KeyValueInput.d.ts +4 -4
  69. package/dist/components/primitives/KeyValueInput/KeyValueInput.styles.d.ts +1 -17
  70. package/dist/components/primitives/Logo/Logo.d.ts +8 -8
  71. package/dist/components/primitives/Logo/Logo.styles.d.ts +1 -7
  72. package/dist/components/primitives/MultiInput/MultiInput.d.ts +28 -28
  73. package/dist/components/primitives/MultiInput/MultiInput.styles.d.ts +1 -11
  74. package/dist/components/primitives/OtpField/OtpField.d.ts +20 -20
  75. package/dist/components/primitives/OtpField/OtpField.styles.d.ts +1 -6
  76. package/dist/components/primitives/PasswordField/PasswordField.styles.d.ts +1 -5
  77. package/dist/components/primitives/Select/Select.d.ts +18 -18
  78. package/dist/components/primitives/Select/Select.styles.d.ts +1 -6
  79. package/dist/components/primitives/Spinner/Spinner.d.ts +4 -4
  80. package/dist/components/primitives/Spinner/Spinner.styles.d.ts +1 -6
  81. package/dist/components/primitives/TextField/TextField.d.ts +18 -18
  82. package/dist/components/primitives/TextField/TextField.styles.d.ts +1 -9
  83. package/dist/components/primitives/Typography/Typography.d.ts +24 -24
  84. package/dist/components/primitives/Typography/Typography.styles.d.ts +1 -19
  85. package/dist/contexts/Asgardeo/AsgardeoContext.d.ts +62 -62
  86. package/dist/contexts/Branding/BrandingContext.d.ts +12 -11
  87. package/dist/contexts/Branding/BrandingProvider.d.ts +10 -10
  88. package/dist/contexts/Flow/FlowContext.d.ts +25 -24
  89. package/dist/contexts/Flow/FlowProvider.d.ts +4 -4
  90. package/dist/contexts/I18n/I18nContext.d.ts +6 -5
  91. package/dist/contexts/I18n/I18nProvider.d.ts +1 -1
  92. package/dist/contexts/Theme/ThemeContext.d.ts +12 -11
  93. package/dist/contexts/Theme/ThemeProvider.d.ts +10 -10
  94. package/dist/contexts/Theme/types.d.ts +30 -30
  95. package/dist/contexts/User/UserContext.d.ts +2 -2
  96. package/dist/contexts/User/UserProvider.d.ts +2 -2
  97. package/dist/hooks/useBranding.d.ts +17 -17
  98. package/dist/hooks/useBrowserUrl.d.ts +8 -0
  99. package/dist/hooks/useForm.d.ts +10 -9
  100. package/dist/hooks/useTranslation.d.ts +4 -4
  101. package/dist/hooks/v2/useOAuthCallback.d.ts +82 -0
  102. package/dist/index.d.ts +7 -26
  103. package/dist/index.js +6330 -5824
  104. package/dist/index.js.map +4 -4
  105. package/dist/utils/oauth.d.ts +24 -0
  106. package/dist/utils/v2/flowTransformer.d.ts +7 -7
  107. package/dist/utils/v2/getAuthComponentHeadings.d.ts +2 -2
  108. package/package.json +2 -2
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).
3
+ *
4
+ * WSO2 LLC. licenses this file to you under the Apache License,
5
+ * Version 2.0 (the "License"); you may not use this file except
6
+ * in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing,
12
+ * software distributed under the License is distributed on an
13
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ * KIND, either express or implied. See the License for the
15
+ * specific language governing permissions and limitations
16
+ * under the License.
17
+ */
18
+ /**
19
+ * Initiates OAuth redirect with CSRF protection.
20
+ * Generates random state, stores return path in sessionStorage, and redirects to OAuth provider.
21
+ *
22
+ * @param redirectURL - OAuth authorization URL from the server
23
+ */
24
+ export declare function initiateOAuthRedirect(redirectURL: string): void;
@@ -46,19 +46,14 @@ import { UseTranslation } from '../../hooks/useTranslation';
46
46
  * Generic flow error response interface that covers common error structure
47
47
  */
48
48
  export interface FlowErrorResponse {
49
+ failureReason?: string;
49
50
  flowId: string;
50
51
  flowStatus: 'ERROR';
51
- failureReason?: string;
52
52
  }
53
53
  /**
54
54
  * Configuration options for flow transformation
55
55
  */
56
56
  export interface FlowTransformOptions {
57
- /**
58
- * Whether to throw errors or return them as normalized response
59
- * @default true
60
- */
61
- throwOnError?: boolean;
62
57
  /**
63
58
  * Default error message key for translation fallback
64
59
  * @default 'errors.flow.generic'
@@ -69,6 +64,11 @@ export interface FlowTransformOptions {
69
64
  * @default true
70
65
  */
71
66
  resolveTranslations?: boolean;
67
+ /**
68
+ * Whether to throw errors or return them as normalized response
69
+ * @default true
70
+ */
71
+ throwOnError?: boolean;
72
72
  }
73
73
  /**
74
74
  * Transform and resolve translations in components from flow response.
@@ -114,6 +114,6 @@ export declare const checkForErrorResponse: (response: any, t: UseTranslation["t
114
114
  * @throws {any} The original response if it's an error and throwOnError is true
115
115
  */
116
116
  export declare const normalizeFlowResponse: (response: any, t: UseTranslation["t"], options?: FlowTransformOptions) => {
117
- flowId: string;
118
117
  components: EmbeddedFlowComponent[];
118
+ flowId: string;
119
119
  };
@@ -27,10 +27,10 @@ export interface HeadingExtractionResult {
27
27
  * Complete result of authentication component heading extraction
28
28
  */
29
29
  export interface AuthComponentHeadingsResult {
30
- title: string;
31
- subtitle: string;
32
30
  componentsWithoutHeadings: EmbeddedFlowComponent[];
33
31
  headingComponents: HeadingExtractionResult;
32
+ subtitle: string;
33
+ title: string;
34
34
  }
35
35
  /**
36
36
  * Extracts heading and subheading components from authentication flow components
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asgardeo/react",
3
- "version": "0.11.2",
3
+ "version": "0.12.0",
4
4
  "description": "React implementation of Asgardeo JavaScript SDK.",
5
5
  "keywords": [
6
6
  "asgardeo",
@@ -59,7 +59,7 @@
59
59
  "react-dom": "19.1.4",
60
60
  "tslib": "2.8.1",
61
61
  "@asgardeo/i18n": "0.4.2",
62
- "@asgardeo/browser": "0.2.8"
62
+ "@asgardeo/browser": "0.2.10"
63
63
  },
64
64
  "publishConfig": {
65
65
  "access": "public"