@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
@@ -30,6 +30,15 @@ export interface AcceptInviteProps {
30
30
  * If not provided, will try to read from window location.
31
31
  */
32
32
  baseUrl?: string;
33
+ /**
34
+ * Render props function for custom UI.
35
+ * If not provided, default UI will be rendered by the SDK.
36
+ */
37
+ children?: (props: AcceptInviteRenderProps) => ReactNode;
38
+ /**
39
+ * Custom CSS class name.
40
+ */
41
+ className?: string;
33
42
  /**
34
43
  * Flow ID from the invite link.
35
44
  * If not provided, will be extracted from URL query parameters.
@@ -57,14 +66,13 @@ export interface AcceptInviteProps {
57
66
  */
58
67
  onGoToSignIn?: () => void;
59
68
  /**
60
- * Custom CSS class name.
69
+ * Whether to show the subtitle.
61
70
  */
62
- className?: string;
71
+ showSubtitle?: boolean;
63
72
  /**
64
- * Render props function for custom UI.
65
- * If not provided, default UI will be rendered by the SDK.
73
+ * Whether to show the title.
66
74
  */
67
- children?: (props: AcceptInviteRenderProps) => ReactNode;
75
+ showTitle?: boolean;
68
76
  /**
69
77
  * Size variant for the component.
70
78
  */
@@ -73,14 +81,6 @@ export interface AcceptInviteProps {
73
81
  * Theme variant for the component card.
74
82
  */
75
83
  variant?: 'outlined' | 'elevated';
76
- /**
77
- * Whether to show the title.
78
- */
79
- showTitle?: boolean;
80
- /**
81
- * Whether to show the subtitle.
82
- */
83
- showSubtitle?: boolean;
84
84
  }
85
85
  /**
86
86
  * AcceptInvite component for end-users to accept an invite and set their password.
@@ -21,103 +21,113 @@ import { CardProps } from '../../../../primitives/Card/Card';
21
21
  * Flow response structure from the backend.
22
22
  */
23
23
  export interface AcceptInviteFlowResponse {
24
- flowId: string;
25
- flowStatus: 'INCOMPLETE' | 'COMPLETE' | 'ERROR';
26
- type?: 'VIEW' | 'REDIRECTION';
27
24
  data?: {
25
+ additionalData?: Record<string, string>;
28
26
  components?: any[];
29
27
  meta?: {
30
28
  components?: any[];
31
29
  };
32
- additionalData?: Record<string, string>;
30
+ redirectURL?: string;
33
31
  };
34
32
  failureReason?: string;
33
+ flowId: string;
34
+ flowStatus: 'INCOMPLETE' | 'COMPLETE' | 'ERROR';
35
+ type?: 'VIEW' | 'REDIRECTION';
35
36
  }
36
37
  /**
37
38
  * Render props for custom UI rendering of AcceptInvite.
38
39
  */
39
40
  export interface BaseAcceptInviteRenderProps {
40
41
  /**
41
- * Form values for the current step.
42
+ * Title from the password screen (for use in completion screen).
42
43
  */
43
- values: Record<string, string>;
44
+ completionTitle?: string;
44
45
  /**
45
- * Field validation errors.
46
+ * Flow components from the current step.
46
47
  */
47
- fieldErrors: Record<string, string>;
48
+ components: any[];
48
49
  /**
49
50
  * API error (if any).
50
51
  */
51
52
  error?: Error | null;
52
53
  /**
53
- * Touched fields.
54
- */
55
- touched: Record<string, boolean>;
56
- /**
57
- * Loading state.
58
- */
59
- isLoading: boolean;
60
- /**
61
- * Flow components from the current step.
54
+ * Field validation errors.
62
55
  */
63
- components: any[];
56
+ fieldErrors: Record<string, string>;
64
57
  /**
65
58
  * Current flow ID from URL.
66
59
  */
67
60
  flowId?: string;
68
61
  /**
69
- * Invite token from URL.
70
- */
71
- inviteToken?: string;
72
- /**
73
- * Function to handle input changes.
62
+ * Navigate to sign in page.
74
63
  */
75
- handleInputChange: (name: string, value: string) => void;
64
+ goToSignIn?: () => void;
76
65
  /**
77
66
  * Function to handle input blur.
78
67
  */
79
68
  handleInputBlur: (name: string) => void;
69
+ /**
70
+ * Function to handle input changes.
71
+ */
72
+ handleInputChange: (name: string, value: string) => void;
80
73
  /**
81
74
  * Function to handle form submission.
82
75
  */
83
76
  handleSubmit: (component: any, data?: Record<string, any>) => Promise<void>;
77
+ /**
78
+ * Invite token from URL.
79
+ */
80
+ inviteToken?: string;
84
81
  /**
85
82
  * Whether the flow has completed successfully.
86
83
  */
87
84
  isComplete: boolean;
88
85
  /**
89
- * Whether the invite token is being validated.
86
+ * Loading state.
90
87
  */
91
- isValidatingToken: boolean;
88
+ isLoading: boolean;
92
89
  /**
93
90
  * Whether the token validation failed.
94
91
  */
95
92
  isTokenInvalid: boolean;
96
93
  /**
97
- * Title for the current step.
94
+ * Whether the form is valid.
98
95
  */
99
- title?: string;
96
+ isValid: boolean;
97
+ /**
98
+ * Whether the invite token is being validated.
99
+ */
100
+ isValidatingToken: boolean;
100
101
  /**
101
102
  * Subtitle for the current step.
102
103
  */
103
104
  subtitle?: string;
104
105
  /**
105
- * Whether the form is valid.
106
+ * Title for the current step.
106
107
  */
107
- isValid: boolean;
108
+ title?: string;
108
109
  /**
109
- * Navigate to sign in page.
110
+ * Touched fields.
110
111
  */
111
- goToSignIn?: () => void;
112
+ touched: Record<string, boolean>;
112
113
  /**
113
- * Title from the password screen (for use in completion screen).
114
+ * Form values for the current step.
114
115
  */
115
- completionTitle?: string;
116
+ values: Record<string, string>;
116
117
  }
117
118
  /**
118
119
  * Props for the BaseAcceptInvite component.
119
120
  */
120
121
  export interface BaseAcceptInviteProps {
122
+ /**
123
+ * Render props function for custom UI.
124
+ * If not provided, default UI will be rendered.
125
+ */
126
+ children?: (props: BaseAcceptInviteRenderProps) => ReactNode;
127
+ /**
128
+ * Custom CSS class name.
129
+ */
130
+ className?: string;
121
131
  /**
122
132
  * Flow ID from the invite link URL.
123
133
  */
@@ -138,24 +148,23 @@ export interface BaseAcceptInviteProps {
138
148
  * Callback when the flow state changes.
139
149
  */
140
150
  onFlowChange?: (response: AcceptInviteFlowResponse) => void;
151
+ /**
152
+ * Callback to navigate to sign in page.
153
+ */
154
+ onGoToSignIn?: () => void;
141
155
  /**
142
156
  * Function to submit flow step data.
143
157
  * This makes a request to the flow/execute endpoint.
144
158
  */
145
159
  onSubmit: (payload: Record<string, any>) => Promise<AcceptInviteFlowResponse>;
146
160
  /**
147
- * Callback to navigate to sign in page.
148
- */
149
- onGoToSignIn?: () => void;
150
- /**
151
- * Custom CSS class name.
161
+ * Whether to show the subtitle.
152
162
  */
153
- className?: string;
163
+ showSubtitle?: boolean;
154
164
  /**
155
- * Render props function for custom UI.
156
- * If not provided, default UI will be rendered.
165
+ * Whether to show the title.
157
166
  */
158
- children?: (props: BaseAcceptInviteRenderProps) => ReactNode;
167
+ showTitle?: boolean;
159
168
  /**
160
169
  * Size variant for the component.
161
170
  */
@@ -164,14 +173,6 @@ export interface BaseAcceptInviteProps {
164
173
  * Theme variant for the component.
165
174
  */
166
175
  variant?: CardProps['variant'];
167
- /**
168
- * Whether to show the title.
169
- */
170
- showTitle?: boolean;
171
- /**
172
- * Whether to show the subtitle.
173
- */
174
- showSubtitle?: boolean;
175
176
  }
176
177
  /**
177
178
  * Base component for accept invite flow (end-user).
@@ -9,10 +9,11 @@
9
9
  * http://www.apache.org/licenses/LICENSE-2.0
10
10
  *
11
11
  * Unless required by applicable law or agreed to in writing,
12
- * software distributed under an "AS IS" BASIS, WITHOUT WARRANTIES
13
- * OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and
15
- * limitations under the License.
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.
16
17
  */
17
18
  import { Theme } from '@asgardeo/browser';
18
19
  /**
@@ -21,10 +22,5 @@ import { Theme } from '@asgardeo/browser';
21
22
  * @param colorScheme - The current color scheme (used for memoization)
22
23
  * @returns Object containing CSS class names for component styling
23
24
  */
24
- declare const useStyles: (theme: Theme, colorScheme: string) => {
25
- card: string;
26
- header: string;
27
- title: string;
28
- subtitle: string;
29
- };
25
+ declare const useStyles: (theme: Theme, colorScheme: string) => Record<string, string>;
30
26
  export default useStyles;
@@ -15,8 +15,8 @@
15
15
  * specific language governing permissions and limitations
16
16
  * under the License.
17
17
  */
18
- import { ReactElement } from 'react';
19
18
  import { EmbeddedFlowComponentV2 as EmbeddedFlowComponent } from '@asgardeo/browser';
19
+ import { ReactElement } from 'react';
20
20
  export type AuthType = 'signin' | 'signup';
21
21
  /**
22
22
  * Processes an array of components and renders them as React elements for sign-in.
@@ -18,4 +18,4 @@
18
18
  export { default as InviteUser } from './v2/InviteUser';
19
19
  export type { InviteUserProps, InviteUserRenderProps } from './v2/InviteUser';
20
20
  export { default as BaseInviteUser } from './v2/BaseInviteUser';
21
- export type { BaseInviteUserProps, BaseInviteUserRenderProps, InviteUserFlowResponse, } from './v2/BaseInviteUser';
21
+ export type { BaseInviteUserProps, BaseInviteUserRenderProps, InviteUserFlowResponse } from './v2/BaseInviteUser';
@@ -21,103 +21,112 @@ import { CardProps } from '../../../../primitives/Card/Card';
21
21
  * Flow response structure from the backend.
22
22
  */
23
23
  export interface InviteUserFlowResponse {
24
- flowId: string;
25
- flowStatus: 'INCOMPLETE' | 'COMPLETE' | 'ERROR';
26
- type?: 'VIEW' | 'REDIRECTION';
27
24
  data?: {
25
+ additionalData?: Record<string, string>;
28
26
  components?: any[];
29
27
  meta?: {
30
28
  components?: any[];
31
29
  };
32
- additionalData?: Record<string, string>;
33
30
  };
34
31
  failureReason?: string;
32
+ flowId: string;
33
+ flowStatus: 'INCOMPLETE' | 'COMPLETE' | 'ERROR';
34
+ type?: 'VIEW' | 'REDIRECTION';
35
35
  }
36
36
  /**
37
37
  * Render props for custom UI rendering of InviteUser.
38
38
  */
39
39
  export interface BaseInviteUserRenderProps {
40
40
  /**
41
- * Form values for the current step.
41
+ * Flow components from the current step.
42
42
  */
43
- values: Record<string, string>;
43
+ components: any[];
44
44
  /**
45
- * Field validation errors.
45
+ * Copy invite link to clipboard.
46
46
  */
47
- fieldErrors: Record<string, string>;
47
+ copyInviteLink: () => Promise<void>;
48
48
  /**
49
49
  * API error (if any).
50
50
  */
51
51
  error?: Error | null;
52
52
  /**
53
- * Touched fields.
54
- */
55
- touched: Record<string, boolean>;
56
- /**
57
- * Loading state.
58
- */
59
- isLoading: boolean;
60
- /**
61
- * Flow components from the current step.
62
- */
63
- components: any[];
64
- /**
65
- * Generated invite link (available after user provisioning).
53
+ * Field validation errors.
66
54
  */
67
- inviteLink?: string;
55
+ fieldErrors: Record<string, string>;
68
56
  /**
69
57
  * Current flow ID.
70
58
  */
71
59
  flowId?: string;
72
- /**
73
- * Function to handle input changes.
74
- */
75
- handleInputChange: (name: string, value: string) => void;
76
60
  /**
77
61
  * Function to handle input blur.
78
62
  */
79
63
  handleInputBlur: (name: string) => void;
64
+ /**
65
+ * Function to handle input changes.
66
+ */
67
+ handleInputChange: (name: string, value: string) => void;
80
68
  /**
81
69
  * Function to handle form submission.
82
70
  */
83
71
  handleSubmit: (component: any, data?: Record<string, any>) => Promise<void>;
84
72
  /**
85
- * Whether the invite link has been generated (admin flow complete).
73
+ * Generated invite link (available after user provisioning).
86
74
  */
87
- isInviteGenerated: boolean;
75
+ inviteLink?: string;
88
76
  /**
89
- * Title for the current step.
77
+ * Whether the invite link was copied.
90
78
  */
91
- title?: string;
79
+ inviteLinkCopied: boolean;
92
80
  /**
93
- * Subtitle for the current step.
81
+ * Whether the invite link has been generated (admin flow complete).
94
82
  */
95
- subtitle?: string;
83
+ isInviteGenerated: boolean;
84
+ /**
85
+ * Loading state.
86
+ */
87
+ isLoading: boolean;
96
88
  /**
97
89
  * Whether the form is valid.
98
90
  */
99
91
  isValid: boolean;
100
92
  /**
101
- * Copy invite link to clipboard.
93
+ * Reset the flow to invite another user.
102
94
  */
103
- copyInviteLink: () => Promise<void>;
95
+ resetFlow: () => void;
104
96
  /**
105
- * Whether the invite link was copied.
97
+ * Subtitle for the current step.
106
98
  */
107
- inviteLinkCopied: boolean;
99
+ subtitle?: string;
108
100
  /**
109
- * Reset the flow to invite another user.
101
+ * Title for the current step.
110
102
  */
111
- resetFlow: () => void;
103
+ title?: string;
104
+ /**
105
+ * Touched fields.
106
+ */
107
+ touched: Record<string, boolean>;
108
+ /**
109
+ * Form values for the current step.
110
+ */
111
+ values: Record<string, string>;
112
112
  }
113
113
  /**
114
114
  * Props for the BaseInviteUser component.
115
115
  */
116
116
  export interface BaseInviteUserProps {
117
117
  /**
118
- * Callback when the invite link is generated successfully.
118
+ * Render props function for custom UI.
119
+ * If not provided, default UI will be rendered.
119
120
  */
120
- onInviteLinkGenerated?: (inviteLink: string, flowId: string) => void;
121
+ children?: (props: BaseInviteUserRenderProps) => ReactNode;
122
+ /**
123
+ * Custom CSS class name.
124
+ */
125
+ className?: string;
126
+ /**
127
+ * Whether the SDK is initialized.
128
+ */
129
+ isInitialized?: boolean;
121
130
  /**
122
131
  * Callback when an error occurs.
123
132
  */
@@ -131,24 +140,23 @@ export interface BaseInviteUserProps {
131
140
  * This should make an authenticated request to the flow/execute endpoint.
132
141
  */
133
142
  onInitialize: (payload: Record<string, any>) => Promise<InviteUserFlowResponse>;
143
+ /**
144
+ * Callback when the invite link is generated successfully.
145
+ */
146
+ onInviteLinkGenerated?: (inviteLink: string, flowId: string) => void;
134
147
  /**
135
148
  * Function to submit flow step data.
136
149
  * This should make an authenticated request to the flow/execute endpoint.
137
150
  */
138
151
  onSubmit: (payload: Record<string, any>) => Promise<InviteUserFlowResponse>;
139
152
  /**
140
- * Custom CSS class name.
141
- */
142
- className?: string;
143
- /**
144
- * Render props function for custom UI.
145
- * If not provided, default UI will be rendered.
153
+ * Whether to show the subtitle.
146
154
  */
147
- children?: (props: BaseInviteUserRenderProps) => ReactNode;
155
+ showSubtitle?: boolean;
148
156
  /**
149
- * Whether the SDK is initialized.
157
+ * Whether to show the title.
150
158
  */
151
- isInitialized?: boolean;
159
+ showTitle?: boolean;
152
160
  /**
153
161
  * Size variant for the component.
154
162
  */
@@ -157,14 +165,6 @@ export interface BaseInviteUserProps {
157
165
  * Theme variant for the component.
158
166
  */
159
167
  variant?: CardProps['variant'];
160
- /**
161
- * Whether to show the title.
162
- */
163
- showTitle?: boolean;
164
- /**
165
- * Whether to show the subtitle.
166
- */
167
- showSubtitle?: boolean;
168
168
  }
169
169
  /**
170
170
  * Base component for invite user flow.
@@ -9,10 +9,11 @@
9
9
  * http://www.apache.org/licenses/LICENSE-2.0
10
10
  *
11
11
  * Unless required by applicable law or agreed to in writing,
12
- * software distributed under an "AS IS" BASIS, WITHOUT WARRANTIES
13
- * OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and
15
- * limitations under the License.
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.
16
17
  */
17
18
  import { Theme } from '@asgardeo/browser';
18
19
  /**
@@ -21,10 +22,5 @@ import { Theme } from '@asgardeo/browser';
21
22
  * @param colorScheme - The current color scheme (used for memoization)
22
23
  * @returns Object containing CSS class names for component styling
23
24
  */
24
- declare const useStyles: (theme: Theme, colorScheme: string) => {
25
- card: string;
26
- header: string;
27
- title: string;
28
- subtitle: string;
29
- };
25
+ declare const useStyles: (theme: Theme, colorScheme: string) => Record<string, string>;
30
26
  export default useStyles;
@@ -26,9 +26,14 @@ export type InviteUserRenderProps = BaseInviteUserRenderProps;
26
26
  */
27
27
  export interface InviteUserProps {
28
28
  /**
29
- * Callback when the invite link is generated successfully.
29
+ * Render props function for custom UI.
30
+ * If not provided, default UI will be rendered by the SDK.
30
31
  */
31
- onInviteLinkGenerated?: (inviteLink: string, flowId: string) => void;
32
+ children?: (props: InviteUserRenderProps) => ReactNode;
33
+ /**
34
+ * Custom CSS class name.
35
+ */
36
+ className?: string;
32
37
  /**
33
38
  * Callback when an error occurs.
34
39
  */
@@ -38,14 +43,17 @@ export interface InviteUserProps {
38
43
  */
39
44
  onFlowChange?: (response: InviteUserFlowResponse) => void;
40
45
  /**
41
- * Custom CSS class name.
46
+ * Callback when the invite link is generated successfully.
42
47
  */
43
- className?: string;
48
+ onInviteLinkGenerated?: (inviteLink: string, flowId: string) => void;
44
49
  /**
45
- * Render props function for custom UI.
46
- * If not provided, default UI will be rendered by the SDK.
50
+ * Whether to show the subtitle.
47
51
  */
48
- children?: (props: InviteUserRenderProps) => ReactNode;
52
+ showSubtitle?: boolean;
53
+ /**
54
+ * Whether to show the title.
55
+ */
56
+ showTitle?: boolean;
49
57
  /**
50
58
  * Size variant for the component.
51
59
  */
@@ -54,14 +62,6 @@ export interface InviteUserProps {
54
62
  * Theme variant for the component card.
55
63
  */
56
64
  variant?: 'outlined' | 'elevated';
57
- /**
58
- * Whether to show the title.
59
- */
60
- showTitle?: boolean;
61
- /**
62
- * Whether to show the subtitle.
63
- */
64
- showSubtitle?: boolean;
65
65
  }
66
66
  /**
67
67
  * InviteUser component for initiating invite user flow.
@@ -22,31 +22,5 @@ import { Theme } from '@asgardeo/browser';
22
22
  * @param colorScheme - The current color scheme (used for memoization)
23
23
  * @returns Object containing CSS class names for component styling
24
24
  */
25
- declare const useStyles: (theme: Theme, colorScheme: string) => {
26
- signIn: string;
27
- card: string;
28
- logoContainer: string;
29
- header: string;
30
- title: string;
31
- subtitle: string;
32
- messagesContainer: string;
33
- messageItem: string;
34
- errorContainer: string;
35
- contentContainer: string;
36
- loadingContainer: string;
37
- loadingText: string;
38
- divider: string;
39
- centeredContainer: string;
40
- passkeyContainer: string;
41
- passkeyText: string;
42
- form: string;
43
- formDivider: string;
44
- authenticatorSection: string;
45
- authenticatorItem: string;
46
- noAuthenticatorCard: string;
47
- errorAlert: string;
48
- messagesAlert: string;
49
- flowMessagesContainer: string;
50
- flowMessageItem: string;
51
- };
25
+ declare const useStyles: (theme: Theme, colorScheme: string) => Record<string, string>;
52
26
  export default useStyles;
@@ -16,8 +16,8 @@
16
16
  * under the License.
17
17
  */
18
18
  import { FC, ReactElement } from 'react';
19
- import { SignInRenderProps } from './v2/SignIn';
20
19
  import { BaseSignInProps } from './BaseSignIn';
20
+ import { SignInRenderProps } from './v2/SignIn';
21
21
  /**
22
22
  * Props for the SignIn component.
23
23
  * Extends BaseSignInProps for full compatibility with the React BaseSignIn component
@@ -39,6 +39,10 @@ export interface BaseSignInProps {
39
39
  * Custom CSS class name for form inputs.
40
40
  */
41
41
  inputClassName?: string;
42
+ /**
43
+ * Flag to determine the component is ready to be rendered.
44
+ */
45
+ isLoading?: boolean;
42
46
  /**
43
47
  * Custom CSS class name for info messages.
44
48
  */
@@ -53,10 +57,6 @@ export interface BaseSignInProps {
53
57
  * @param response - The current authentication response.
54
58
  */
55
59
  onFlowChange?: (response: EmbeddedSignInFlowInitiateResponse | EmbeddedSignInFlowHandleResponse) => void;
56
- /**
57
- * Flag to determine the component is ready to be rendered.
58
- */
59
- isLoading?: boolean;
60
60
  /**
61
61
  * Function to initialize authentication flow.
62
62
  * @returns Promise resolving to the initial authentication response.
@@ -74,25 +74,25 @@ export interface BaseSignInProps {
74
74
  */
75
75
  onSuccess?: (authData: Record<string, any>) => void;
76
76
  /**
77
- * Size variant for the component.
77
+ * Whether to show the logo.
78
78
  */
79
- size?: 'small' | 'medium' | 'large';
79
+ showLogo?: boolean;
80
80
  /**
81
- * Theme variant for the component.
81
+ * Whether to show the subtitle.
82
82
  */
83
- variant?: CardProps['variant'];
83
+ showSubtitle?: boolean;
84
84
  /**
85
85
  * Whether to show the title.
86
86
  */
87
87
  showTitle?: boolean;
88
88
  /**
89
- * Whether to show the subtitle.
89
+ * Size variant for the component.
90
90
  */
91
- showSubtitle?: boolean;
91
+ size?: 'small' | 'medium' | 'large';
92
92
  /**
93
- * Whether to show the logo.
93
+ * Theme variant for the component.
94
94
  */
95
- showLogo?: boolean;
95
+ variant?: CardProps['variant'];
96
96
  }
97
97
  /**
98
98
  * Base SignIn component that provides native authentication flow.