@asgardeo/react 0.6.31 → 0.8.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.
- package/dist/cjs/index.js +1695 -803
- package/dist/cjs/index.js.map +4 -4
- package/dist/components/presentation/auth/AcceptInvite/index.d.ts +21 -0
- package/dist/components/presentation/auth/AcceptInvite/v2/AcceptInvite.d.ts +124 -0
- package/dist/components/presentation/auth/AcceptInvite/v2/BaseAcceptInvite.d.ts +192 -0
- package/dist/components/presentation/auth/AcceptInvite/v2/BaseAcceptInvite.styles.d.ts +30 -0
- package/dist/components/presentation/auth/AuthOptionFactory.d.ts +12 -0
- package/dist/components/presentation/auth/InviteUser/index.d.ts +21 -0
- package/dist/components/presentation/auth/InviteUser/v2/BaseInviteUser.d.ts +185 -0
- package/dist/components/presentation/auth/InviteUser/v2/BaseInviteUser.styles.d.ts +30 -0
- package/dist/components/presentation/auth/InviteUser/v2/InviteUser.d.ts +107 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +1621 -729
- package/dist/index.js.map +4 -4
- package/package.json +2 -2
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025, 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
|
+
import { FC, ReactNode } from 'react';
|
|
19
|
+
import { BaseInviteUserRenderProps, InviteUserFlowResponse } from './BaseInviteUser';
|
|
20
|
+
/**
|
|
21
|
+
* Render props for InviteUser (re-exported for convenience).
|
|
22
|
+
*/
|
|
23
|
+
export type InviteUserRenderProps = BaseInviteUserRenderProps;
|
|
24
|
+
/**
|
|
25
|
+
* Props for the InviteUser component.
|
|
26
|
+
*/
|
|
27
|
+
export interface InviteUserProps {
|
|
28
|
+
/**
|
|
29
|
+
* Callback when the invite link is generated successfully.
|
|
30
|
+
*/
|
|
31
|
+
onInviteLinkGenerated?: (inviteLink: string, flowId: string) => void;
|
|
32
|
+
/**
|
|
33
|
+
* Callback when an error occurs.
|
|
34
|
+
*/
|
|
35
|
+
onError?: (error: Error) => void;
|
|
36
|
+
/**
|
|
37
|
+
* Callback when the flow state changes.
|
|
38
|
+
*/
|
|
39
|
+
onFlowChange?: (response: InviteUserFlowResponse) => void;
|
|
40
|
+
/**
|
|
41
|
+
* Custom CSS class name.
|
|
42
|
+
*/
|
|
43
|
+
className?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Render props function for custom UI.
|
|
46
|
+
* If not provided, default UI will be rendered by the SDK.
|
|
47
|
+
*/
|
|
48
|
+
children?: (props: InviteUserRenderProps) => ReactNode;
|
|
49
|
+
/**
|
|
50
|
+
* Size variant for the component.
|
|
51
|
+
*/
|
|
52
|
+
size?: 'small' | 'medium' | 'large';
|
|
53
|
+
/**
|
|
54
|
+
* Theme variant for the component card.
|
|
55
|
+
*/
|
|
56
|
+
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
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* InviteUser component for initiating invite user flow.
|
|
68
|
+
*
|
|
69
|
+
* This component is designed for admin users in the thunder-develop app to:
|
|
70
|
+
* 1. Select a user type (if multiple available)
|
|
71
|
+
* 2. Enter user details (username, email)
|
|
72
|
+
* 3. Generate an invite link for the end user
|
|
73
|
+
*
|
|
74
|
+
* The component uses the authenticated Asgardeo SDK context to make API calls
|
|
75
|
+
* with the admin's access token (requires 'system' scope).
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ```tsx
|
|
79
|
+
* import { InviteUser } from '@asgardeo/react';
|
|
80
|
+
*
|
|
81
|
+
* const InviteUserPage = () => {
|
|
82
|
+
* const [inviteLink, setInviteLink] = useState<string>();
|
|
83
|
+
*
|
|
84
|
+
* return (
|
|
85
|
+
* <InviteUser
|
|
86
|
+
* onInviteLinkGenerated={(link, flowId) => setInviteLink(link)}
|
|
87
|
+
* onError={(error) => console.error(error)}
|
|
88
|
+
* >
|
|
89
|
+
* {({ values, components, isLoading, handleInputChange, handleSubmit, inviteLink, isInviteGenerated }) => (
|
|
90
|
+
* <div>
|
|
91
|
+
* {isInviteGenerated ? (
|
|
92
|
+
* <div>
|
|
93
|
+
* <h2>Invite Link Generated!</h2>
|
|
94
|
+
* <p>{inviteLink}</p>
|
|
95
|
+
* </div>
|
|
96
|
+
* ) : (
|
|
97
|
+
* // Render form based on components
|
|
98
|
+
* )}
|
|
99
|
+
* </div>
|
|
100
|
+
* )}
|
|
101
|
+
* </InviteUser>
|
|
102
|
+
* );
|
|
103
|
+
* };
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
106
|
+
declare const InviteUser: FC<InviteUserProps>;
|
|
107
|
+
export default InviteUser;
|
package/dist/index.d.ts
CHANGED
|
@@ -91,6 +91,10 @@ export { default as BaseSignUp } from './components/presentation/auth/SignUp/Bas
|
|
|
91
91
|
export * from './components/presentation/auth/SignUp/BaseSignUp';
|
|
92
92
|
export { default as SignUp } from './components/presentation/auth/SignUp/SignUp';
|
|
93
93
|
export * from './components/presentation/auth/SignUp/SignUp';
|
|
94
|
+
export { BaseInviteUser, InviteUser } from './components/presentation/auth/InviteUser';
|
|
95
|
+
export * from './components/presentation/auth/InviteUser';
|
|
96
|
+
export { BaseAcceptInvite, AcceptInvite } from './components/presentation/auth/AcceptInvite';
|
|
97
|
+
export * from './components/presentation/auth/AcceptInvite';
|
|
94
98
|
export { default as IdentifierFirst } from './components/presentation/auth/SignIn/v1/options/IdentifierFirst';
|
|
95
99
|
export { default as UsernamePassword } from './components/presentation/auth/SignIn/v1/options/UsernamePassword';
|
|
96
100
|
export { default as GoogleButton } from './components/adapters/GoogleButton';
|