@asgardeo/react 0.11.2 → 0.11.3
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/AsgardeoReactClient.d.ts +10 -10
- package/dist/__temp__/api.d.ts +6 -6
- package/dist/__temp__/models.d.ts +30 -30
- package/dist/cjs/index.js +5988 -5754
- package/dist/cjs/index.js.map +4 -4
- package/dist/components/adapters/FacebookButton.d.ts +1 -1
- package/dist/components/adapters/GitHubButton.d.ts +1 -1
- package/dist/components/adapters/GoogleButton.d.ts +1 -1
- package/dist/components/adapters/LinkedInButton.d.ts +1 -1
- package/dist/components/adapters/MicrosoftButton.d.ts +1 -1
- package/dist/components/adapters/SignInWithEthereumButton.d.ts +1 -1
- package/dist/components/adapters/SmsOtpButton.d.ts +1 -1
- package/dist/components/factories/FieldFactory.d.ts +25 -25
- package/dist/components/presentation/CreateOrganization/BaseCreateOrganization.styles.d.ts +1 -18
- package/dist/components/presentation/CreateOrganization/CreateOrganization.d.ts +1 -1
- package/dist/components/presentation/OrganizationList/BaseOrganizationList.d.ts +26 -26
- package/dist/components/presentation/OrganizationList/BaseOrganizationList.styles.d.ts +1 -31
- package/dist/components/presentation/OrganizationList/OrganizationList.styles.d.ts +1 -6
- package/dist/components/presentation/OrganizationProfile/BaseOrganizationProfile.d.ts +3 -3
- package/dist/components/presentation/OrganizationProfile/BaseOrganizationProfile.styles.d.ts +1 -27
- package/dist/components/presentation/OrganizationSwitcher/BaseOrganizationSwitcher.d.ts +6 -6
- package/dist/components/presentation/OrganizationSwitcher/BaseOrganizationSwitcher.styles.d.ts +1 -25
- package/dist/components/presentation/User/BaseUser.d.ts +4 -4
- package/dist/components/presentation/UserDropdown/BaseUserDropdown.styles.d.ts +1 -15
- package/dist/components/presentation/UserProfile/BaseUserProfile.d.ts +3 -3
- package/dist/components/presentation/UserProfile/BaseUserProfile.styles.d.ts +1 -26
- package/dist/components/presentation/auth/AcceptInvite/index.d.ts +1 -1
- package/dist/components/presentation/auth/AcceptInvite/v2/AcceptInvite.d.ts +13 -13
- package/dist/components/presentation/auth/AcceptInvite/v2/BaseAcceptInvite.d.ts +51 -51
- package/dist/components/presentation/auth/AcceptInvite/v2/BaseAcceptInvite.styles.d.ts +6 -10
- package/dist/components/presentation/auth/AuthOptionFactory.d.ts +1 -1
- package/dist/components/presentation/auth/InviteUser/index.d.ts +1 -1
- package/dist/components/presentation/auth/InviteUser/v2/BaseInviteUser.d.ts +57 -57
- package/dist/components/presentation/auth/InviteUser/v2/BaseInviteUser.styles.d.ts +6 -10
- package/dist/components/presentation/auth/InviteUser/v2/InviteUser.d.ts +15 -15
- package/dist/components/presentation/auth/SignIn/BaseSignIn.styles.d.ts +1 -27
- package/dist/components/presentation/auth/SignIn/SignIn.d.ts +1 -1
- package/dist/components/presentation/auth/SignIn/v1/BaseSignIn.d.ts +12 -12
- package/dist/components/presentation/auth/SignIn/v1/options/SignInOptionFactory.d.ts +15 -15
- package/dist/components/presentation/auth/SignIn/v1/types.d.ts +30 -30
- package/dist/components/presentation/auth/SignIn/v2/BaseSignIn.d.ts +47 -47
- package/dist/components/presentation/auth/SignIn/v2/SignIn.d.ts +20 -20
- package/dist/components/presentation/auth/SignUp/BaseSignUp.styles.d.ts +1 -26
- package/dist/components/presentation/auth/SignUp/v1/BaseSignUp.d.ts +40 -40
- package/dist/components/presentation/auth/SignUp/v1/SignUpOptionFactory.d.ts +1 -1
- package/dist/components/presentation/auth/SignUp/v2/BaseSignUp.d.ts +46 -46
- package/dist/components/primitives/Alert/Alert.d.ts +8 -8
- package/dist/components/primitives/Alert/Alert.styles.d.ts +1 -8
- package/dist/components/primitives/Avatar/Avatar.d.ts +4 -4
- package/dist/components/primitives/Avatar/Avatar.styles.d.ts +1 -7
- package/dist/components/primitives/Button/Button.d.ts +14 -14
- package/dist/components/primitives/Button/Button.styles.d.ts +1 -13
- package/dist/components/primitives/Card/Card.d.ts +4 -4
- package/dist/components/primitives/Card/Card.styles.d.ts +1 -11
- package/dist/components/primitives/Checkbox/Checkbox.d.ts +8 -8
- package/dist/components/primitives/Checkbox/Checkbox.styles.d.ts +1 -8
- package/dist/components/primitives/DatePicker/DatePicker.d.ts +12 -12
- package/dist/components/primitives/DatePicker/DatePicker.styles.d.ts +1 -6
- package/dist/components/primitives/Dialog/Dialog.d.ts +17 -17
- package/dist/components/primitives/Dialog/Dialog.styles.d.ts +1 -9
- package/dist/components/primitives/Divider/Divider.d.ts +2 -2
- package/dist/components/primitives/Divider/Divider.styles.d.ts +1 -7
- package/dist/components/primitives/FormControl/FormControl.d.ts +4 -4
- package/dist/components/primitives/FormControl/FormControl.styles.d.ts +1 -5
- package/dist/components/primitives/InputLabel/InputLabel.d.ts +10 -10
- package/dist/components/primitives/InputLabel/InputLabel.styles.d.ts +1 -7
- package/dist/components/primitives/KeyValueInput/KeyValueInput.d.ts +4 -4
- package/dist/components/primitives/KeyValueInput/KeyValueInput.styles.d.ts +1 -17
- package/dist/components/primitives/Logo/Logo.d.ts +8 -8
- package/dist/components/primitives/Logo/Logo.styles.d.ts +1 -7
- package/dist/components/primitives/MultiInput/MultiInput.d.ts +28 -28
- package/dist/components/primitives/MultiInput/MultiInput.styles.d.ts +1 -11
- package/dist/components/primitives/OtpField/OtpField.d.ts +20 -20
- package/dist/components/primitives/OtpField/OtpField.styles.d.ts +1 -6
- package/dist/components/primitives/PasswordField/PasswordField.styles.d.ts +1 -5
- package/dist/components/primitives/Select/Select.d.ts +18 -18
- package/dist/components/primitives/Select/Select.styles.d.ts +1 -6
- package/dist/components/primitives/Spinner/Spinner.d.ts +4 -4
- package/dist/components/primitives/Spinner/Spinner.styles.d.ts +1 -6
- package/dist/components/primitives/TextField/TextField.d.ts +18 -18
- package/dist/components/primitives/TextField/TextField.styles.d.ts +1 -9
- package/dist/components/primitives/Typography/Typography.d.ts +24 -24
- package/dist/components/primitives/Typography/Typography.styles.d.ts +1 -19
- package/dist/contexts/Asgardeo/AsgardeoContext.d.ts +62 -62
- package/dist/contexts/Branding/BrandingContext.d.ts +12 -11
- package/dist/contexts/Branding/BrandingProvider.d.ts +10 -10
- package/dist/contexts/Flow/FlowContext.d.ts +25 -24
- package/dist/contexts/Flow/FlowProvider.d.ts +4 -4
- package/dist/contexts/I18n/I18nContext.d.ts +6 -5
- package/dist/contexts/I18n/I18nProvider.d.ts +1 -1
- package/dist/contexts/Theme/ThemeContext.d.ts +12 -11
- package/dist/contexts/Theme/ThemeProvider.d.ts +10 -10
- package/dist/contexts/Theme/types.d.ts +30 -30
- package/dist/contexts/User/UserContext.d.ts +2 -2
- package/dist/contexts/User/UserProvider.d.ts +2 -2
- package/dist/hooks/useBranding.d.ts +17 -17
- package/dist/hooks/useForm.d.ts +10 -9
- package/dist/hooks/useTranslation.d.ts +4 -4
- package/dist/index.d.ts +6 -26
- package/dist/index.js +5969 -5705
- package/dist/index.js.map +4 -4
- package/dist/utils/v2/flowTransformer.d.ts +7 -7
- package/dist/utils/v2/getAuthComponentHeadings.d.ts +2 -2
- package/package.json +2 -2
|
@@ -34,23 +34,5 @@ export type TypographyColor = 'primary' | 'secondary' | 'error' | 'success' | 'w
|
|
|
34
34
|
* @param lineHeight - Custom line height
|
|
35
35
|
* @returns Object containing CSS class names for component styling
|
|
36
36
|
*/
|
|
37
|
-
declare const useStyles: (theme: Theme, colorScheme: string, variant: TypographyVariant, align: TypographyAlign, color: TypographyColor, noWrap: boolean, inline: boolean, gutterBottom: boolean, fontWeight?: "normal" | "medium" | "semibold" | "bold" | number, fontSize?: string | number, lineHeight?: string | number) =>
|
|
38
|
-
typography: string;
|
|
39
|
-
typographyNoWrap: string;
|
|
40
|
-
typographyInline: string;
|
|
41
|
-
typographyGutterBottom: string;
|
|
42
|
-
typographyH1: string;
|
|
43
|
-
typographyH2: string;
|
|
44
|
-
typographyH3: string;
|
|
45
|
-
typographyH4: string;
|
|
46
|
-
typographyH5: string;
|
|
47
|
-
typographyH6: string;
|
|
48
|
-
typographySubtitle1: string;
|
|
49
|
-
typographySubtitle2: string;
|
|
50
|
-
typographyBody1: string;
|
|
51
|
-
typographyBody2: string;
|
|
52
|
-
typographyCaption: string;
|
|
53
|
-
typographyOverline: string;
|
|
54
|
-
typographyButton: string;
|
|
55
|
-
};
|
|
37
|
+
declare const useStyles: (theme: Theme, colorScheme: string, variant: TypographyVariant, align: TypographyAlign, color: TypographyColor, noWrap: boolean, inline: boolean, gutterBottom: boolean, fontWeight?: "normal" | "medium" | "semibold" | "bold" | number, fontSize?: string | number, lineHeight?: string | number) => Record<string, string>;
|
|
56
38
|
export default useStyles;
|
|
@@ -15,53 +15,45 @@
|
|
|
15
15
|
* specific language governing permissions and limitations
|
|
16
16
|
* under the License.
|
|
17
17
|
*/
|
|
18
|
-
import { Context } from 'react';
|
|
19
18
|
import { HttpRequestConfig, HttpResponse, IdToken, Organization, SignInOptions, TokenExchangeRequestConfig, TokenResponse } from '@asgardeo/browser';
|
|
19
|
+
import { Context } from 'react';
|
|
20
20
|
import AsgardeoReactClient from '../../AsgardeoReactClient';
|
|
21
21
|
import { AsgardeoReactConfig } from '../../models/config';
|
|
22
22
|
/**
|
|
23
23
|
* Props interface of {@link AsgardeoContext}
|
|
24
24
|
*/
|
|
25
25
|
export type AsgardeoContextProps = {
|
|
26
|
-
organizationHandle: string | undefined;
|
|
27
|
-
applicationId: string | undefined;
|
|
28
|
-
signInUrl: string | undefined;
|
|
29
|
-
signUpUrl: string | undefined;
|
|
30
26
|
afterSignInUrl: string | undefined;
|
|
27
|
+
applicationId: string | undefined;
|
|
31
28
|
baseUrl: string | undefined;
|
|
32
|
-
isInitialized: boolean;
|
|
33
|
-
/**
|
|
34
|
-
* Flag indicating whether the SDK is working in the background.
|
|
35
|
-
*/
|
|
36
|
-
isLoading: boolean;
|
|
37
|
-
/**
|
|
38
|
-
* Flag indicating whether the user is signed in or not.
|
|
39
|
-
*/
|
|
40
|
-
isSignedIn: boolean;
|
|
41
29
|
/**
|
|
42
|
-
*
|
|
43
|
-
* @
|
|
44
|
-
*
|
|
30
|
+
* Swaps the current access token with a new one based on the provided configuration (with a grant type).
|
|
31
|
+
* @param config - Configuration for the token exchange request.
|
|
32
|
+
* @returns A promise that resolves to the token response or the raw response.
|
|
45
33
|
*/
|
|
46
|
-
|
|
34
|
+
exchangeToken: (config: TokenExchangeRequestConfig) => Promise<TokenResponse | Response>;
|
|
47
35
|
/**
|
|
48
|
-
*
|
|
49
|
-
*
|
|
36
|
+
* Retrieves the access token stored in the storage.
|
|
37
|
+
* This function retrieves the access token and returns it.
|
|
38
|
+
* @remarks This does not work in the `webWorker` or any other worker environment.
|
|
39
|
+
* @returns A promise that resolves to the access token.
|
|
50
40
|
*/
|
|
51
|
-
|
|
41
|
+
getAccessToken: () => Promise<string>;
|
|
52
42
|
/**
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
43
|
+
* Function to retrieve the decoded ID token.
|
|
44
|
+
* This function decodes the ID token and returns its payload.
|
|
45
|
+
* It can be used to access user claims and other information contained in the ID token.
|
|
46
|
+
*
|
|
47
|
+
* @returns A promise that resolves to the decoded ID token payload.
|
|
56
48
|
*/
|
|
57
|
-
|
|
49
|
+
getDecodedIdToken: () => Promise<IdToken>;
|
|
58
50
|
/**
|
|
59
|
-
*
|
|
60
|
-
*
|
|
51
|
+
* Function to retrieve the ID token.
|
|
52
|
+
* This function retrieves the ID token and returns it.
|
|
53
|
+
*
|
|
54
|
+
* @returns A promise that resolves to the ID token.
|
|
61
55
|
*/
|
|
62
|
-
|
|
63
|
-
user: any;
|
|
64
|
-
organization: Organization;
|
|
56
|
+
getIdToken: () => Promise<string>;
|
|
65
57
|
/**
|
|
66
58
|
* HTTP request function to make API calls.
|
|
67
59
|
* @param requestConfig - Configuration for the HTTP request.
|
|
@@ -81,6 +73,33 @@ export type AsgardeoContextProps = {
|
|
|
81
73
|
*/
|
|
82
74
|
requestAll: (requestConfigs?: HttpRequestConfig[]) => Promise<HttpResponse<any>[]>;
|
|
83
75
|
};
|
|
76
|
+
isInitialized: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Flag indicating whether the SDK is working in the background.
|
|
79
|
+
*/
|
|
80
|
+
isLoading: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Flag indicating whether the user is signed in or not.
|
|
83
|
+
*/
|
|
84
|
+
isSignedIn: boolean;
|
|
85
|
+
organization: Organization;
|
|
86
|
+
organizationHandle: string | undefined;
|
|
87
|
+
/**
|
|
88
|
+
* Re-initializes the client with a new configuration.
|
|
89
|
+
*
|
|
90
|
+
* @remarks
|
|
91
|
+
* This can be partial configuration to update only specific fields.
|
|
92
|
+
*
|
|
93
|
+
* @param config - New configuration to re-initialize the client with.
|
|
94
|
+
* @returns Promise resolving to boolean indicating success.
|
|
95
|
+
*/
|
|
96
|
+
reInitialize: (config: Partial<AsgardeoReactConfig>) => Promise<boolean>;
|
|
97
|
+
/**
|
|
98
|
+
* Sign-in function to initiate the authentication process.
|
|
99
|
+
* @remark This is the programmatic version of the `SignInButton` component.
|
|
100
|
+
* TODO: Fix the types.
|
|
101
|
+
*/
|
|
102
|
+
signIn: (...args: any) => Promise<any>;
|
|
84
103
|
/**
|
|
85
104
|
* Optional additional parameters to be sent in the sign-in request.
|
|
86
105
|
* This can include custom parameters that your authorization server supports.
|
|
@@ -92,43 +111,24 @@ export type AsgardeoContextProps = {
|
|
|
92
111
|
*/
|
|
93
112
|
signInOptions: SignInOptions;
|
|
94
113
|
/**
|
|
95
|
-
*
|
|
96
|
-
* This
|
|
97
|
-
* It can be used to access user claims and other information contained in the ID token.
|
|
98
|
-
*
|
|
99
|
-
* @returns A promise that resolves to the decoded ID token payload.
|
|
100
|
-
*/
|
|
101
|
-
getDecodedIdToken: () => Promise<IdToken>;
|
|
102
|
-
/**
|
|
103
|
-
* Function to retrieve the ID token.
|
|
104
|
-
* This function retrieves the ID token and returns it.
|
|
105
|
-
*
|
|
106
|
-
* @returns A promise that resolves to the ID token.
|
|
107
|
-
*/
|
|
108
|
-
getIdToken: () => Promise<string>;
|
|
109
|
-
/**
|
|
110
|
-
* Retrieves the access token stored in the storage.
|
|
111
|
-
* This function retrieves the access token and returns it.
|
|
112
|
-
* @remarks This does not work in the `webWorker` or any other worker environment.
|
|
113
|
-
* @returns A promise that resolves to the access token.
|
|
114
|
+
* Silent sign-in function to re-authenticate the user without user interaction.
|
|
115
|
+
* @remark This is the programmatic version of the `SilentSignIn` component.
|
|
114
116
|
*/
|
|
115
|
-
|
|
117
|
+
signInSilently: AsgardeoReactClient['signInSilently'];
|
|
118
|
+
signInUrl: string | undefined;
|
|
116
119
|
/**
|
|
117
|
-
*
|
|
118
|
-
* @
|
|
119
|
-
*
|
|
120
|
+
* Sign-out function to terminate the authentication session.
|
|
121
|
+
* @remark This is the programmatic version of the `SignOutButton` component.
|
|
122
|
+
* FIXME: Fix the types.
|
|
120
123
|
*/
|
|
121
|
-
|
|
124
|
+
signOut: any;
|
|
122
125
|
/**
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
* @remarks
|
|
126
|
-
* This can be partial configuration to update only specific fields.
|
|
127
|
-
*
|
|
128
|
-
* @param config - New configuration to re-initialize the client with.
|
|
129
|
-
* @returns Promise resolving to boolean indicating success.
|
|
126
|
+
* Sign-up function to initiate the registration process.
|
|
127
|
+
* @remark This is the programmatic version of the `SignUpButton` component.
|
|
130
128
|
*/
|
|
131
|
-
|
|
129
|
+
signUp: (...args: any[]) => Promise<any>;
|
|
130
|
+
signUpUrl: string | undefined;
|
|
131
|
+
user: any;
|
|
132
132
|
} & Pick<AsgardeoReactConfig, 'storage' | 'platform'> & Pick<AsgardeoReactClient, 'clearSession' | 'switchOrganization'>;
|
|
133
133
|
/**
|
|
134
134
|
* Context object for managing the Authentication flow builder core context.
|
|
@@ -16,23 +16,16 @@
|
|
|
16
16
|
* under the License.
|
|
17
17
|
*/
|
|
18
18
|
import { BrandingPreference, Theme } from '@asgardeo/browser';
|
|
19
|
+
import { Context } from 'react';
|
|
19
20
|
export interface BrandingContextValue {
|
|
20
|
-
/**
|
|
21
|
-
* The raw branding preference data
|
|
22
|
-
*/
|
|
23
|
-
brandingPreference: BrandingPreference | null;
|
|
24
|
-
/**
|
|
25
|
-
* The transformed theme object
|
|
26
|
-
*/
|
|
27
|
-
theme: Theme | null;
|
|
28
21
|
/**
|
|
29
22
|
* The active theme mode from branding preference ('light' | 'dark')
|
|
30
23
|
*/
|
|
31
24
|
activeTheme: 'light' | 'dark' | null;
|
|
32
25
|
/**
|
|
33
|
-
*
|
|
26
|
+
* The raw branding preference data
|
|
34
27
|
*/
|
|
35
|
-
|
|
28
|
+
brandingPreference: BrandingPreference | null;
|
|
36
29
|
/**
|
|
37
30
|
* Error state
|
|
38
31
|
*/
|
|
@@ -41,11 +34,19 @@ export interface BrandingContextValue {
|
|
|
41
34
|
* Function to manually fetch branding preference
|
|
42
35
|
*/
|
|
43
36
|
fetchBranding: () => Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* Loading state
|
|
39
|
+
*/
|
|
40
|
+
isLoading: boolean;
|
|
44
41
|
/**
|
|
45
42
|
* Function to refetch branding preference
|
|
46
43
|
* This bypasses the single-call restriction and forces a new API call
|
|
47
44
|
*/
|
|
48
45
|
refetch: () => Promise<void>;
|
|
46
|
+
/**
|
|
47
|
+
* The transformed theme object
|
|
48
|
+
*/
|
|
49
|
+
theme: Theme | null;
|
|
49
50
|
}
|
|
50
|
-
declare const BrandingContext:
|
|
51
|
+
declare const BrandingContext: Context<BrandingContextValue | null>;
|
|
51
52
|
export default BrandingContext;
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
* specific language governing permissions and limitations
|
|
16
16
|
* under the License.
|
|
17
17
|
*/
|
|
18
|
-
import { FC, PropsWithChildren } from 'react';
|
|
19
18
|
import { BrandingPreference } from '@asgardeo/browser';
|
|
19
|
+
import { FC, PropsWithChildren } from 'react';
|
|
20
20
|
/**
|
|
21
21
|
* Configuration options for the BrandingProvider
|
|
22
22
|
*/
|
|
@@ -25,24 +25,24 @@ export interface BrandingProviderProps {
|
|
|
25
25
|
* The branding preference data passed from parent (typically AsgardeoProvider)
|
|
26
26
|
*/
|
|
27
27
|
brandingPreference?: BrandingPreference | null;
|
|
28
|
-
/**
|
|
29
|
-
* Force a specific theme ('light' or 'dark')
|
|
30
|
-
* If not provided, will use the activeTheme from branding preference
|
|
31
|
-
*/
|
|
32
|
-
forceTheme?: 'light' | 'dark';
|
|
33
28
|
/**
|
|
34
29
|
* Whether the branding provider is enabled
|
|
35
30
|
* @default true
|
|
36
31
|
*/
|
|
37
32
|
enabled?: boolean;
|
|
38
|
-
/**
|
|
39
|
-
* Loading state passed from parent
|
|
40
|
-
*/
|
|
41
|
-
isLoading?: boolean;
|
|
42
33
|
/**
|
|
43
34
|
* Error state passed from parent
|
|
44
35
|
*/
|
|
45
36
|
error?: Error | null;
|
|
37
|
+
/**
|
|
38
|
+
* Force a specific theme ('light' or 'dark')
|
|
39
|
+
* If not provided, will use the activeTheme from branding preference
|
|
40
|
+
*/
|
|
41
|
+
forceTheme?: 'light' | 'dark';
|
|
42
|
+
/**
|
|
43
|
+
* Loading state passed from parent
|
|
44
|
+
*/
|
|
45
|
+
isLoading?: boolean;
|
|
46
46
|
/**
|
|
47
47
|
* Function to refetch branding preference passed from parent
|
|
48
48
|
*/
|
|
@@ -15,59 +15,60 @@
|
|
|
15
15
|
* specific language governing permissions and limitations
|
|
16
16
|
* under the License.
|
|
17
17
|
*/
|
|
18
|
+
import { Context } from 'react';
|
|
18
19
|
/**
|
|
19
20
|
* Types of authentication flows/steps that can be displayed.
|
|
20
21
|
*/
|
|
21
22
|
export type FlowStep = {
|
|
22
|
-
id: string;
|
|
23
|
-
type: 'signin' | 'signup' | 'organization-signin' | 'forgot-password' | 'reset-password' | 'verify-email' | 'mfa';
|
|
24
|
-
title: string;
|
|
25
|
-
subtitle?: string;
|
|
26
23
|
canGoBack?: boolean;
|
|
24
|
+
id: string;
|
|
27
25
|
metadata?: Record<string, any>;
|
|
26
|
+
subtitle?: string;
|
|
27
|
+
title: string;
|
|
28
|
+
type: 'signin' | 'signup' | 'organization-signin' | 'forgot-password' | 'reset-password' | 'verify-email' | 'mfa';
|
|
28
29
|
} | null;
|
|
29
30
|
/**
|
|
30
31
|
* Message types for displaying in authentication flows.
|
|
31
32
|
*/
|
|
32
33
|
export interface FlowMessage {
|
|
34
|
+
dismissible?: boolean;
|
|
33
35
|
id?: string;
|
|
34
|
-
type: 'success' | 'error' | 'warning' | 'info';
|
|
35
36
|
message: string;
|
|
36
|
-
|
|
37
|
+
type: 'success' | 'error' | 'warning' | 'info';
|
|
37
38
|
}
|
|
38
39
|
/**
|
|
39
40
|
* Context value for managing authentication flow UI state.
|
|
40
41
|
*/
|
|
41
42
|
export interface FlowContextValue {
|
|
42
|
-
currentStep: FlowStep;
|
|
43
|
-
setCurrentStep: (step: FlowStep) => void;
|
|
44
|
-
title: string;
|
|
45
|
-
setTitle: (title: string) => void;
|
|
46
|
-
subtitle?: string;
|
|
47
|
-
setSubtitle: (subtitle?: string) => void;
|
|
48
|
-
messages: FlowMessage[];
|
|
49
43
|
addMessage: (message: FlowMessage) => void;
|
|
50
|
-
removeMessage: (messageId: string) => void;
|
|
51
44
|
clearMessages: () => void;
|
|
45
|
+
currentStep: FlowStep;
|
|
52
46
|
error: string | null;
|
|
53
|
-
setError: (error: string | null) => void;
|
|
54
47
|
isLoading: boolean;
|
|
55
|
-
|
|
56
|
-
showBackButton: boolean;
|
|
57
|
-
setShowBackButton: (show: boolean) => void;
|
|
58
|
-
onGoBack?: () => void;
|
|
59
|
-
setOnGoBack: (callback?: () => void) => void;
|
|
60
|
-
reset: () => void;
|
|
48
|
+
messages: FlowMessage[];
|
|
61
49
|
navigateToFlow: (flowType: NonNullable<FlowStep>['type'], options?: {
|
|
62
|
-
title?: string;
|
|
63
|
-
subtitle?: string;
|
|
64
50
|
metadata?: Record<string, any>;
|
|
51
|
+
subtitle?: string;
|
|
52
|
+
title?: string;
|
|
65
53
|
}) => void;
|
|
54
|
+
onGoBack?: () => void;
|
|
55
|
+
removeMessage: (messageId: string) => void;
|
|
56
|
+
reset: () => void;
|
|
57
|
+
setCurrentStep: (step: FlowStep) => void;
|
|
58
|
+
setError: (error: string | null) => void;
|
|
59
|
+
setIsLoading: (loading: boolean) => void;
|
|
60
|
+
setOnGoBack: (callback?: () => void) => void;
|
|
61
|
+
setShowBackButton: (show: boolean) => void;
|
|
62
|
+
setSubtitle: (subtitle?: string) => void;
|
|
63
|
+
setTitle: (title: string) => void;
|
|
64
|
+
showBackButton: boolean;
|
|
65
|
+
subtitle?: string;
|
|
66
|
+
title: string;
|
|
66
67
|
}
|
|
67
68
|
/**
|
|
68
69
|
* Context for managing authentication flow UI state.
|
|
69
70
|
* This context handles titles, messages, navigation, and loading states
|
|
70
71
|
* for authentication flows like SignIn, SignUp, organization signin, etc.
|
|
71
72
|
*/
|
|
72
|
-
declare const FlowContext:
|
|
73
|
+
declare const FlowContext: Context<FlowContextValue | undefined>;
|
|
73
74
|
export default FlowContext;
|
|
@@ -25,14 +25,14 @@ export interface FlowProviderProps {
|
|
|
25
25
|
* Initial step to start with.
|
|
26
26
|
*/
|
|
27
27
|
initialStep?: FlowStep;
|
|
28
|
-
/**
|
|
29
|
-
* Initial title.
|
|
30
|
-
*/
|
|
31
|
-
initialTitle?: string;
|
|
32
28
|
/**
|
|
33
29
|
* Initial subtitle.
|
|
34
30
|
*/
|
|
35
31
|
initialSubtitle?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Initial title.
|
|
34
|
+
*/
|
|
35
|
+
initialTitle?: string;
|
|
36
36
|
/**
|
|
37
37
|
* Callback when flow type changes.
|
|
38
38
|
*/
|
|
@@ -16,7 +16,12 @@
|
|
|
16
16
|
* under the License.
|
|
17
17
|
*/
|
|
18
18
|
import { I18nBundle } from '@asgardeo/i18n';
|
|
19
|
+
import { Context } from 'react';
|
|
19
20
|
export interface I18nContextValue {
|
|
21
|
+
/**
|
|
22
|
+
* All available i18n bundles (default + user provided)
|
|
23
|
+
*/
|
|
24
|
+
bundles: Record<string, I18nBundle>;
|
|
20
25
|
/**
|
|
21
26
|
* The current language code (e.g., 'en-US', 'fr-FR')
|
|
22
27
|
*/
|
|
@@ -25,10 +30,6 @@ export interface I18nContextValue {
|
|
|
25
30
|
* The fallback language code
|
|
26
31
|
*/
|
|
27
32
|
fallbackLanguage: string;
|
|
28
|
-
/**
|
|
29
|
-
* All available i18n bundles (default + user provided)
|
|
30
|
-
*/
|
|
31
|
-
bundles: Record<string, I18nBundle>;
|
|
32
33
|
/**
|
|
33
34
|
* Function to change the current language
|
|
34
35
|
*/
|
|
@@ -38,5 +39,5 @@ export interface I18nContextValue {
|
|
|
38
39
|
*/
|
|
39
40
|
t: (key: string, params?: Record<string, string | number>) => string;
|
|
40
41
|
}
|
|
41
|
-
declare const I18nContext:
|
|
42
|
+
declare const I18nContext: Context<I18nContextValue | null>;
|
|
42
43
|
export default I18nContext;
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
* specific language governing permissions and limitations
|
|
16
16
|
* under the License.
|
|
17
17
|
*/
|
|
18
|
-
import { FC, PropsWithChildren } from 'react';
|
|
19
18
|
import { I18nPreferences } from '@asgardeo/browser';
|
|
19
|
+
import { FC, PropsWithChildren } from 'react';
|
|
20
20
|
export interface I18nProviderProps {
|
|
21
21
|
/**
|
|
22
22
|
* The i18n preferences from the AsgardeoProvider
|
|
@@ -16,26 +16,27 @@
|
|
|
16
16
|
* under the License.
|
|
17
17
|
*/
|
|
18
18
|
import { Theme } from '@asgardeo/browser';
|
|
19
|
+
import { Context } from 'react';
|
|
19
20
|
export interface ThemeContextValue {
|
|
20
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Error from branding theme fetch, if any
|
|
23
|
+
*/
|
|
24
|
+
brandingError?: Error | null;
|
|
21
25
|
colorScheme: 'light' | 'dark';
|
|
22
26
|
/**
|
|
23
27
|
* The text direction for the UI.
|
|
24
28
|
*/
|
|
25
29
|
direction: 'ltr' | 'rtl';
|
|
26
|
-
toggleTheme: () => void;
|
|
27
|
-
/**
|
|
28
|
-
* Whether branding theme is currently loading
|
|
29
|
-
*/
|
|
30
|
-
isBrandingLoading?: boolean;
|
|
31
|
-
/**
|
|
32
|
-
* Error from branding theme fetch, if any
|
|
33
|
-
*/
|
|
34
|
-
brandingError?: Error | null;
|
|
35
30
|
/**
|
|
36
31
|
* Whether branding inheritance is enabled
|
|
37
32
|
*/
|
|
38
33
|
inheritFromBranding?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Whether branding theme is currently loading
|
|
36
|
+
*/
|
|
37
|
+
isBrandingLoading?: boolean;
|
|
38
|
+
theme: Theme;
|
|
39
|
+
toggleTheme: () => void;
|
|
39
40
|
}
|
|
40
|
-
declare const ThemeContext:
|
|
41
|
+
declare const ThemeContext: Context<ThemeContextValue | null>;
|
|
41
42
|
export default ThemeContext;
|
|
@@ -15,10 +15,17 @@
|
|
|
15
15
|
* specific language governing permissions and limitations
|
|
16
16
|
* under the License.
|
|
17
17
|
*/
|
|
18
|
-
import { FC, PropsWithChildren } from 'react';
|
|
19
18
|
import { ThemeConfig, ThemeMode, RecursivePartial, BrowserThemeDetection, ThemePreferences } from '@asgardeo/browser';
|
|
19
|
+
import { FC, PropsWithChildren } from 'react';
|
|
20
20
|
export interface ThemeProviderProps {
|
|
21
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Configuration for theme detection when using 'class' or 'system' mode
|
|
23
|
+
*/
|
|
24
|
+
detection?: BrowserThemeDetection;
|
|
25
|
+
/**
|
|
26
|
+
* Configuration for branding integration
|
|
27
|
+
*/
|
|
28
|
+
inheritFromBranding?: ThemePreferences['inheritFromBranding'];
|
|
22
29
|
/**
|
|
23
30
|
* The theme mode to use for automatic detection
|
|
24
31
|
* - 'light': Always use light theme
|
|
@@ -28,14 +35,7 @@ export interface ThemeProviderProps {
|
|
|
28
35
|
* - 'branding': Use active theme from branding preference (requires inheritFromBranding=true)
|
|
29
36
|
*/
|
|
30
37
|
mode?: ThemeMode | 'branding';
|
|
31
|
-
|
|
32
|
-
* Configuration for theme detection when using 'class' or 'system' mode
|
|
33
|
-
*/
|
|
34
|
-
detection?: BrowserThemeDetection;
|
|
35
|
-
/**
|
|
36
|
-
* Configuration for branding integration
|
|
37
|
-
*/
|
|
38
|
-
inheritFromBranding?: ThemePreferences['inheritFromBranding'];
|
|
38
|
+
theme?: RecursivePartial<ThemeConfig>;
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
41
41
|
* ThemeProvider component that manages theme state and provides theme context to child components.
|
|
@@ -56,6 +56,11 @@ export interface ThemeConfig {
|
|
|
56
56
|
small: string;
|
|
57
57
|
};
|
|
58
58
|
colors: ThemeColors;
|
|
59
|
+
/**
|
|
60
|
+
* The prefix used for CSS variables.
|
|
61
|
+
* @default 'asgardeo' (from VendorConstants.VENDOR_PREFIX)
|
|
62
|
+
*/
|
|
63
|
+
cssVarPrefix?: string;
|
|
59
64
|
/**
|
|
60
65
|
* The text direction for the UI.
|
|
61
66
|
* @default 'ltr'
|
|
@@ -69,59 +74,54 @@ export interface ThemeConfig {
|
|
|
69
74
|
spacing: {
|
|
70
75
|
unit: number;
|
|
71
76
|
};
|
|
72
|
-
/**
|
|
73
|
-
* The prefix used for CSS variables.
|
|
74
|
-
* @default 'asgardeo' (from VendorConstants.VENDOR_PREFIX)
|
|
75
|
-
*/
|
|
76
|
-
cssVarPrefix?: string;
|
|
77
77
|
}
|
|
78
78
|
export interface ThemeVars {
|
|
79
|
+
borderRadius: {
|
|
80
|
+
large: string;
|
|
81
|
+
medium: string;
|
|
82
|
+
small: string;
|
|
83
|
+
};
|
|
79
84
|
colors: {
|
|
80
|
-
primary: {
|
|
81
|
-
main: string;
|
|
82
|
-
contrastText: string;
|
|
83
|
-
};
|
|
84
|
-
secondary: {
|
|
85
|
-
main: string;
|
|
86
|
-
contrastText: string;
|
|
87
|
-
};
|
|
88
85
|
background: {
|
|
89
|
-
surface: string;
|
|
90
|
-
disabled: string;
|
|
91
86
|
body: {
|
|
92
87
|
main: string;
|
|
93
88
|
};
|
|
89
|
+
disabled: string;
|
|
90
|
+
surface: string;
|
|
94
91
|
};
|
|
92
|
+
border: string;
|
|
95
93
|
error: {
|
|
96
|
-
main: string;
|
|
97
94
|
contrastText: string;
|
|
98
|
-
};
|
|
99
|
-
success: {
|
|
100
95
|
main: string;
|
|
96
|
+
};
|
|
97
|
+
primary: {
|
|
101
98
|
contrastText: string;
|
|
99
|
+
main: string;
|
|
102
100
|
};
|
|
103
|
-
|
|
101
|
+
secondary: {
|
|
102
|
+
contrastText: string;
|
|
104
103
|
main: string;
|
|
104
|
+
};
|
|
105
|
+
success: {
|
|
105
106
|
contrastText: string;
|
|
107
|
+
main: string;
|
|
106
108
|
};
|
|
107
109
|
text: {
|
|
108
110
|
primary: string;
|
|
109
111
|
secondary: string;
|
|
110
112
|
};
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
};
|
|
116
|
-
borderRadius: {
|
|
117
|
-
small: string;
|
|
118
|
-
medium: string;
|
|
119
|
-
large: string;
|
|
113
|
+
warning: {
|
|
114
|
+
contrastText: string;
|
|
115
|
+
main: string;
|
|
116
|
+
};
|
|
120
117
|
};
|
|
121
118
|
shadows: {
|
|
122
|
-
small: string;
|
|
123
|
-
medium: string;
|
|
124
119
|
large: string;
|
|
120
|
+
medium: string;
|
|
121
|
+
small: string;
|
|
122
|
+
};
|
|
123
|
+
spacing: {
|
|
124
|
+
unit: string;
|
|
125
125
|
};
|
|
126
126
|
}
|
|
127
127
|
export interface Theme extends ThemeConfig {
|
|
@@ -22,17 +22,17 @@ import { Context } from 'react';
|
|
|
22
22
|
*/
|
|
23
23
|
export type UserContextProps = {
|
|
24
24
|
flattenedProfile: User | null;
|
|
25
|
+
onUpdateProfile: (payload: User) => void;
|
|
25
26
|
profile: User | null;
|
|
26
27
|
revalidateProfile: () => Promise<void>;
|
|
27
28
|
schemas: Schema[] | null;
|
|
28
29
|
updateProfile: (requestConfig: UpdateMeProfileConfig, sessionId?: string) => Promise<{
|
|
29
|
-
success: boolean;
|
|
30
30
|
data: {
|
|
31
31
|
user: User;
|
|
32
32
|
};
|
|
33
33
|
error: string;
|
|
34
|
+
success: boolean;
|
|
34
35
|
}>;
|
|
35
|
-
onUpdateProfile: (payload: User) => void;
|
|
36
36
|
};
|
|
37
37
|
/**
|
|
38
38
|
* Context object for managing user profile data and related operations.
|
|
@@ -21,16 +21,16 @@ import { FC, PropsWithChildren } from 'react';
|
|
|
21
21
|
* Props interface of {@link UserProvider}
|
|
22
22
|
*/
|
|
23
23
|
export interface UserProviderProps {
|
|
24
|
+
onUpdateProfile?: (payload: User) => void;
|
|
24
25
|
profile: UserProfile;
|
|
25
26
|
revalidateProfile?: () => Promise<void>;
|
|
26
27
|
updateProfile?: (requestConfig: UpdateMeProfileConfig, sessionId?: string) => Promise<{
|
|
27
|
-
success: boolean;
|
|
28
28
|
data: {
|
|
29
29
|
user: User;
|
|
30
30
|
};
|
|
31
31
|
error: string;
|
|
32
|
+
success: boolean;
|
|
32
33
|
}>;
|
|
33
|
-
onUpdateProfile?: (payload: User) => void;
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
36
36
|
* UserProvider component that manages user profile data and provides it through UserContext.
|