@asgardeo/react 0.2.4 → 0.4.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/README.md +112 -6
- package/dist/AsgardeoReactClient.d.ts +38 -0
- package/dist/__temp__/api.d.ts +228 -0
- package/dist/__temp__/models.d.ts +97 -0
- package/dist/api/scim2/getMeProfile.d.ts +39 -0
- package/dist/api/scim2/getSchemas.d.ts +39 -0
- package/dist/api/scim2/updateMeProfile.d.ts +38 -0
- package/dist/cjs/index.js +17998 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/components/actions/SignInButton/BaseSignInButton.d.ts +66 -0
- package/dist/components/actions/SignInButton/SignInButton.d.ts +65 -0
- package/dist/components/actions/SignOutButton/BaseSignOutButton.d.ts +66 -0
- package/dist/components/actions/SignOutButton/SignOutButton.d.ts +65 -0
- package/dist/components/actions/SignUpButton/BaseSignUpButton.d.ts +66 -0
- package/dist/components/actions/SignUpButton/SignUpButton.d.ts +66 -0
- package/dist/components/control/SignedIn.d.ts +45 -0
- package/dist/components/control/SignedOut.d.ts +45 -0
- package/dist/components/factories/FieldFactory.d.ts +107 -0
- package/dist/components/presentation/SignIn/BaseSignIn.d.ts +125 -0
- package/dist/components/presentation/SignIn/SignIn.d.ts +62 -0
- package/dist/{esm/types/hooks/use-config.d.ts → components/presentation/SignIn/options/EmailOtp.d.ts} +7 -5
- package/dist/components/presentation/SignIn/options/FacebookButton.d.ts +25 -0
- package/dist/components/presentation/SignIn/options/GitHubButton.d.ts +25 -0
- package/dist/components/presentation/SignIn/options/GoogleButton.d.ts +25 -0
- package/dist/components/presentation/SignIn/options/IdentifierFirst.d.ts +25 -0
- package/dist/components/presentation/SignIn/options/LinkedInButton.d.ts +25 -0
- package/dist/{esm/types/components/SignIn/fragments/SmsOtp.d.ts → components/presentation/SignIn/options/MicrosoftButton.d.ts} +9 -5
- package/dist/components/presentation/SignIn/options/MultiOptionButton.d.ts +26 -0
- package/dist/components/presentation/SignIn/options/SignInOptionFactory.d.ts +76 -0
- package/dist/{esm/types/components/SignOutButton/SignOutButton.d.ts → components/presentation/SignIn/options/SignInWithEthereumButton.d.ts} +7 -9
- package/dist/{esm/types/contexts/branding-preference-context.d.ts → components/presentation/SignIn/options/SmsOtp.d.ts} +9 -5
- package/dist/components/presentation/SignIn/options/SocialButton.d.ts +25 -0
- package/dist/{esm/types/contexts/asgardeo-context.d.ts → components/presentation/SignIn/options/Totp.d.ts} +9 -5
- package/dist/components/presentation/SignIn/options/UsernamePassword.d.ts +25 -0
- package/dist/components/presentation/SignIn/types.d.ts +124 -0
- package/dist/components/presentation/User/BaseUser.d.ts +66 -0
- package/dist/components/presentation/User/User.d.ts +62 -0
- package/dist/components/presentation/UserDropdown/BaseUserDropdown.d.ts +76 -0
- package/dist/components/presentation/UserDropdown/UserDropdown.d.ts +49 -0
- package/dist/components/presentation/UserProfile/BaseUserProfile.d.ts +63 -0
- package/dist/components/presentation/UserProfile/UserProfile.d.ts +49 -0
- package/dist/components/primitives/Alert/Alert.d.ts +74 -0
- package/dist/{esm/types/components/SignIn/SignIn.d.ts → components/primitives/Avatar/Avatar.d.ts} +25 -14
- package/dist/components/primitives/Button/Button.d.ts +83 -0
- package/dist/components/primitives/Card/Card.d.ts +133 -0
- package/dist/{esm/types/oxygen-ui-react-auth-components/models/component.d.ts → components/primitives/Checkbox/Checkbox.d.ts} +22 -7
- package/dist/components/primitives/DatePicker/DatePicker.d.ts +50 -0
- package/dist/components/primitives/Divider/Divider.d.ts +58 -0
- package/dist/components/primitives/FormControl/FormControl.d.ts +50 -0
- package/dist/components/primitives/Icons/CircleAlert.d.ts +23 -0
- package/dist/components/primitives/Icons/CircleCheck.d.ts +23 -0
- package/dist/{esm/types/models/use-config.d.ts → components/primitives/Icons/Eye.d.ts} +7 -6
- package/dist/{esm/types/contexts/i18n-context.d.ts → components/primitives/Icons/EyeOff.d.ts} +7 -5
- package/dist/{esm/types/hooks/use-on.d.ts → components/primitives/Icons/Info.d.ts} +7 -4
- package/dist/components/primitives/Icons/TriangleAlert.d.ts +23 -0
- package/dist/components/primitives/InputLabel/InputLabel.d.ts +46 -0
- package/dist/components/primitives/OtpField/OtpField.d.ts +86 -0
- package/dist/{esm/types/components/SignInButton/SignInButton.d.ts → components/primitives/PasswordField/PasswordField.d.ts} +13 -11
- package/dist/components/primitives/Popover/Popover.d.ts +96 -0
- package/dist/components/primitives/Select/Select.d.ts +60 -0
- package/dist/components/primitives/Spinner/Spinner.d.ts +54 -0
- package/dist/components/primitives/TextField/TextField.d.ts +62 -0
- package/dist/components/primitives/Typography/Typography.d.ts +81 -0
- package/dist/contexts/Asgardeo/AsgardeoContext.d.ts +57 -0
- package/dist/{esm/types/components/public-components.d.ts → contexts/Asgardeo/AsgardeoProvider.d.ts} +9 -6
- package/dist/contexts/Asgardeo/useAsgardeo.d.ts +20 -0
- package/dist/contexts/Flow/FlowContext.d.ts +73 -0
- package/dist/contexts/Flow/FlowProvider.d.ts +46 -0
- package/dist/contexts/Flow/useFlow.d.ts +48 -0
- package/dist/contexts/I18n/I18nContext.d.ts +42 -0
- package/dist/{esm/types/components/SignedIn/SignedIn.d.ts → contexts/I18n/I18nProvider.d.ts} +12 -10
- package/dist/contexts/I18n/useI18n.d.ts +27 -0
- package/dist/{esm/types/models/asgardeo-provider-props.d.ts → contexts/Theme/ThemeContext.d.ts} +8 -7
- package/dist/{esm/types/models/branding-preference-provider-props.d.ts → contexts/Theme/ThemeProvider.d.ts} +8 -5
- package/dist/{esm/types/models/use-on.d.ts → contexts/Theme/types.d.ts} +22 -12
- package/dist/{esm/types/models/signed-props.d.ts → contexts/Theme/useTheme.d.ts} +4 -6
- package/dist/contexts/User/UserContext.d.ts +32 -0
- package/dist/contexts/User/UserProvider.d.ts +55 -0
- package/dist/contexts/User/useUser.d.ts +94 -0
- package/dist/hooks/useBrowserUrl.d.ts +47 -0
- package/dist/hooks/useForm.d.ts +192 -0
- package/dist/hooks/useTranslation.d.ts +52 -0
- package/dist/index.d.ts +121 -348
- package/dist/index.js +18064 -0
- package/dist/index.js.map +7 -0
- package/dist/{esm/types/models/public-models.d.ts → models/config.d.ts} +3 -3
- package/dist/utils/getMappedUserProfileValue.d.ts +51 -0
- package/package.json +55 -59
- package/dist/esm/index.js +0 -45278
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/types/components/SignIn/fragments/BasicAuth.d.ts +0 -35
- package/dist/esm/types/components/SignIn/fragments/EmailOtp.d.ts +0 -32
- package/dist/esm/types/components/SignIn/fragments/IdentifierFirst.d.ts +0 -35
- package/dist/esm/types/components/SignIn/fragments/LoginOptionsBox.d.ts +0 -30
- package/dist/esm/types/components/SignIn/fragments/Totp.d.ts +0 -33
- package/dist/esm/types/components/SignedOut/SignedOut.d.ts +0 -29
- package/dist/esm/types/hooks/use-authentication.d.ts +0 -27
- package/dist/esm/types/hooks/use-translations.d.ts +0 -33
- package/dist/esm/types/index.d.ts +0 -22
- package/dist/esm/types/models/auth-context.d.ts +0 -43
- package/dist/esm/types/models/basic-auth-props.d.ts +0 -29
- package/dist/esm/types/models/email-otp-props.d.ts +0 -26
- package/dist/esm/types/models/i18n.d.ts +0 -34
- package/dist/esm/types/models/jwt-verify-options.d.ts +0 -25
- package/dist/esm/types/models/login-options-box-props.d.ts +0 -24
- package/dist/esm/types/models/sign-in.d.ts +0 -49
- package/dist/esm/types/models/totp-props.d.ts +0 -26
- package/dist/esm/types/models/use-authentication.d.ts +0 -29
- package/dist/esm/types/models/use-translations.d.ts +0 -22
- package/dist/esm/types/oxygen-ui-react-auth-components/SignIn/SignIn.d.ts +0 -79
- package/dist/esm/types/oxygen-ui-react-auth-components/SignInAlert/SignInAlert.d.ts +0 -37
- package/dist/esm/types/oxygen-ui-react-auth-components/SignInButton/SignInButton.d.ts +0 -27
- package/dist/esm/types/oxygen-ui-react-auth-components/SignInDivider/SignInDivider.d.ts +0 -26
- package/dist/esm/types/oxygen-ui-react-auth-components/SignInFooter/SignInFooter.d.ts +0 -29
- package/dist/esm/types/oxygen-ui-react-auth-components/SignInImage/SignInImage.d.ts +0 -23
- package/dist/esm/types/oxygen-ui-react-auth-components/SignInLink/SignInLink.d.ts +0 -25
- package/dist/esm/types/oxygen-ui-react-auth-components/SignInPaper/SignInPaper.d.ts +0 -26
- package/dist/esm/types/oxygen-ui-react-auth-components/SignInPinInput/SignInPinInput.d.ts +0 -30
- package/dist/esm/types/oxygen-ui-react-auth-components/SignInTextField/SignInTextField.d.ts +0 -26
- package/dist/esm/types/oxygen-ui-react-auth-components/SignInTypography/SignInTypography.d.ts +0 -32
- package/dist/esm/types/oxygen-ui-react-auth-components/index.d.ts +0 -19
- package/dist/esm/types/providers/AsgardeoProvider.d.ts +0 -34
- package/dist/esm/types/providers/BrandingPreferenceProvider.d.ts +0 -32
- package/dist/esm/types/providers/I18nProvider.d.ts +0 -33
- package/dist/esm/types/theme/generate-theme-sign-in.d.ts +0 -28
- package/dist/esm/types/theme/generate-theme.d.ts +0 -30
- package/dist/esm/types/utils/crypto-utils.d.ts +0 -52
- package/dist/esm/types/utils/session-store.d.ts +0 -25
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c)
|
|
2
|
+
* Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
|
|
3
3
|
*
|
|
4
4
|
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
5
|
* Version 2.0 (the "License"); you may not use this file except
|
|
@@ -15,15 +15,17 @@
|
|
|
15
15
|
* specific language governing permissions and limitations
|
|
16
16
|
* under the License.
|
|
17
17
|
*/
|
|
18
|
-
import {
|
|
19
|
-
import '
|
|
20
|
-
|
|
18
|
+
import { FC } from 'react';
|
|
19
|
+
import { TextFieldProps } from '../TextField/TextField';
|
|
20
|
+
export interface PasswordFieldProps extends Omit<TextFieldProps, 'type' | 'endIcon' | 'onEndIconClick' | 'onChange'> {
|
|
21
|
+
/**
|
|
22
|
+
* Callback function when the field value changes
|
|
23
|
+
*/
|
|
24
|
+
onChange: (value: string) => void;
|
|
25
|
+
}
|
|
21
26
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* @param {Object} props - Component props.
|
|
25
|
-
* @param {ReactElement} props.customComponent - Optional custom component to be rendered.
|
|
26
|
-
* @returns {ReactElement} Rendered SignInButton component.
|
|
27
|
+
* Password field component with show/hide toggle functionality.
|
|
28
|
+
* This component extends TextField and adds password visibility toggle functionality.
|
|
27
29
|
*/
|
|
28
|
-
declare const
|
|
29
|
-
export default
|
|
30
|
+
declare const PasswordField: FC<PasswordFieldProps>;
|
|
31
|
+
export default PasswordField;
|
|
@@ -0,0 +1,96 @@
|
|
|
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 React from 'react';
|
|
19
|
+
import { UseFloatingReturn, UseInteractionsReturn } from '@floating-ui/react';
|
|
20
|
+
interface DialogOptions {
|
|
21
|
+
initialOpen?: boolean;
|
|
22
|
+
open?: boolean;
|
|
23
|
+
onOpenChange?: (open: boolean) => void;
|
|
24
|
+
}
|
|
25
|
+
interface DialogHookReturn extends UseFloatingReturn, UseInteractionsReturn {
|
|
26
|
+
open: boolean;
|
|
27
|
+
setOpen: (open: boolean) => void;
|
|
28
|
+
labelId: string | undefined;
|
|
29
|
+
descriptionId: string | undefined;
|
|
30
|
+
setLabelId: React.Dispatch<React.SetStateAction<string | undefined>>;
|
|
31
|
+
setDescriptionId: React.Dispatch<React.SetStateAction<string | undefined>>;
|
|
32
|
+
}
|
|
33
|
+
export declare function useDialog({ initialOpen, open: controlledOpen, onOpenChange: setControlledOpen, }?: DialogOptions): DialogHookReturn;
|
|
34
|
+
interface PopoverOptions {
|
|
35
|
+
initialOpen?: boolean;
|
|
36
|
+
open?: boolean;
|
|
37
|
+
onOpenChange?: (open: boolean) => void;
|
|
38
|
+
placement?: 'top' | 'bottom' | 'left' | 'right' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end';
|
|
39
|
+
offset?: number;
|
|
40
|
+
}
|
|
41
|
+
interface PopoverHookReturn extends UseFloatingReturn, UseInteractionsReturn {
|
|
42
|
+
open: boolean;
|
|
43
|
+
setOpen: (open: boolean) => void;
|
|
44
|
+
labelId: string | undefined;
|
|
45
|
+
descriptionId: string | undefined;
|
|
46
|
+
setLabelId: React.Dispatch<React.SetStateAction<string | undefined>>;
|
|
47
|
+
setDescriptionId: React.Dispatch<React.SetStateAction<string | undefined>>;
|
|
48
|
+
}
|
|
49
|
+
export declare function usePopover({ initialOpen, open: controlledOpen, onOpenChange: setControlledOpen, placement, offset: offsetValue, }?: PopoverOptions): PopoverHookReturn;
|
|
50
|
+
export declare const useDialogContext: () => DialogHookReturn;
|
|
51
|
+
export declare const usePopoverContext: () => PopoverHookReturn;
|
|
52
|
+
export declare function Dialog({ children, ...options }: {
|
|
53
|
+
children: React.ReactNode;
|
|
54
|
+
} & DialogOptions): import("react/jsx-runtime").JSX.Element;
|
|
55
|
+
interface DialogTriggerProps {
|
|
56
|
+
children: React.ReactNode;
|
|
57
|
+
asChild?: boolean;
|
|
58
|
+
}
|
|
59
|
+
export declare const DialogTrigger: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLElement> & DialogTriggerProps, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
60
|
+
export declare const DialogContent: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
61
|
+
export declare function Popover({ children, ...options }: {
|
|
62
|
+
children: React.ReactNode;
|
|
63
|
+
} & PopoverOptions): import("react/jsx-runtime").JSX.Element;
|
|
64
|
+
interface PopoverTriggerProps {
|
|
65
|
+
children: React.ReactNode;
|
|
66
|
+
asChild?: boolean;
|
|
67
|
+
}
|
|
68
|
+
export declare const PopoverTrigger: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLElement> & PopoverTriggerProps, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
69
|
+
export declare const PopoverContent: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
70
|
+
export declare const PopoverHeading: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
71
|
+
export declare const DialogHeading: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
72
|
+
export declare const PopoverDescription: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
73
|
+
export declare const DialogDescription: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
74
|
+
export declare const PopoverClose: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement>>;
|
|
75
|
+
export declare const DialogClose: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement>>;
|
|
76
|
+
interface LegacyPopoverProps {
|
|
77
|
+
isOpen: boolean;
|
|
78
|
+
children: React.ReactNode;
|
|
79
|
+
onClose: () => void;
|
|
80
|
+
className?: string;
|
|
81
|
+
mode?: 'modal' | 'dropdown';
|
|
82
|
+
trigger?: HTMLElement | null;
|
|
83
|
+
placement?: 'top' | 'bottom' | 'left' | 'right' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end';
|
|
84
|
+
offset?: number;
|
|
85
|
+
}
|
|
86
|
+
declare const LegacyPopoverHeader: React.FC<{
|
|
87
|
+
children?: React.ReactNode;
|
|
88
|
+
}>;
|
|
89
|
+
declare const LegacyPopoverContent: React.FC<{
|
|
90
|
+
children: React.ReactNode;
|
|
91
|
+
}>;
|
|
92
|
+
export declare const LegacyPopover: React.FC<LegacyPopoverProps> & {
|
|
93
|
+
Header: typeof LegacyPopoverHeader;
|
|
94
|
+
Content: typeof LegacyPopoverContent;
|
|
95
|
+
};
|
|
96
|
+
export default LegacyPopover;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2024, 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, SelectHTMLAttributes } from 'react';
|
|
19
|
+
export interface SelectOption {
|
|
20
|
+
/**
|
|
21
|
+
* The value that will be submitted with the form
|
|
22
|
+
*/
|
|
23
|
+
value: string;
|
|
24
|
+
/**
|
|
25
|
+
* The text that will be displayed in the select
|
|
26
|
+
*/
|
|
27
|
+
label: string;
|
|
28
|
+
}
|
|
29
|
+
export interface SelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>, 'className'> {
|
|
30
|
+
/**
|
|
31
|
+
* Label text to display above the select
|
|
32
|
+
*/
|
|
33
|
+
label?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Error message to display below the select
|
|
36
|
+
*/
|
|
37
|
+
error?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Additional CSS class names
|
|
40
|
+
*/
|
|
41
|
+
className?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Whether the field is required
|
|
44
|
+
*/
|
|
45
|
+
required?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Whether the field is disabled
|
|
48
|
+
*/
|
|
49
|
+
disabled?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Helper text to display below the select
|
|
52
|
+
*/
|
|
53
|
+
helperText?: string;
|
|
54
|
+
/**
|
|
55
|
+
* The options to display in the select
|
|
56
|
+
*/
|
|
57
|
+
options: SelectOption[];
|
|
58
|
+
}
|
|
59
|
+
declare const Select: FC<SelectProps>;
|
|
60
|
+
export default Select;
|
|
@@ -0,0 +1,54 @@
|
|
|
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, CSSProperties } from 'react';
|
|
19
|
+
export type SpinnerSize = 'small' | 'medium' | 'large';
|
|
20
|
+
export interface SpinnerProps {
|
|
21
|
+
/**
|
|
22
|
+
* Size of the spinner
|
|
23
|
+
*/
|
|
24
|
+
size?: SpinnerSize;
|
|
25
|
+
/**
|
|
26
|
+
* Custom color for the spinner
|
|
27
|
+
*/
|
|
28
|
+
color?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Additional CSS class names
|
|
31
|
+
*/
|
|
32
|
+
className?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Custom styles
|
|
35
|
+
*/
|
|
36
|
+
style?: CSSProperties;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Spinner component for loading states
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```tsx
|
|
43
|
+
* // Basic spinner
|
|
44
|
+
* <Spinner />
|
|
45
|
+
*
|
|
46
|
+
* // Large spinner with custom color
|
|
47
|
+
* <Spinner size="large" color="#3b82f6" />
|
|
48
|
+
*
|
|
49
|
+
* // Small spinner
|
|
50
|
+
* <Spinner size="small" />
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
declare const Spinner: FC<SpinnerProps>;
|
|
54
|
+
export default Spinner;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2024, 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, InputHTMLAttributes, ReactNode } from 'react';
|
|
19
|
+
export interface TextFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'className'> {
|
|
20
|
+
/**
|
|
21
|
+
* Label text to display above the input
|
|
22
|
+
*/
|
|
23
|
+
label?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Error message to display below the input
|
|
26
|
+
*/
|
|
27
|
+
error?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Additional CSS class names
|
|
30
|
+
*/
|
|
31
|
+
className?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Whether the field is required
|
|
34
|
+
*/
|
|
35
|
+
required?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Whether the field is disabled
|
|
38
|
+
*/
|
|
39
|
+
disabled?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Helper text to display below the input
|
|
42
|
+
*/
|
|
43
|
+
helperText?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Icon to display at the start (left) of the input
|
|
46
|
+
*/
|
|
47
|
+
startIcon?: ReactNode;
|
|
48
|
+
/**
|
|
49
|
+
* Icon to display at the end (right) of the input
|
|
50
|
+
*/
|
|
51
|
+
endIcon?: ReactNode;
|
|
52
|
+
/**
|
|
53
|
+
* Click handler for the start icon
|
|
54
|
+
*/
|
|
55
|
+
onStartIconClick?: () => void;
|
|
56
|
+
/**
|
|
57
|
+
* Click handler for the end icon
|
|
58
|
+
*/
|
|
59
|
+
onEndIconClick?: () => void;
|
|
60
|
+
}
|
|
61
|
+
declare const TextField: FC<TextFieldProps>;
|
|
62
|
+
export default TextField;
|
|
@@ -0,0 +1,81 @@
|
|
|
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 { CSSProperties, FC, ReactNode, ElementType } from 'react';
|
|
19
|
+
export type TypographyVariant = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'subtitle1' | 'subtitle2' | 'body1' | 'body2' | 'caption' | 'overline' | 'button';
|
|
20
|
+
export type TypographyAlign = 'left' | 'center' | 'right' | 'justify';
|
|
21
|
+
export type TypographyColor = 'primary' | 'secondary' | 'error' | 'success' | 'warning' | 'info' | 'textPrimary' | 'textSecondary' | 'inherit';
|
|
22
|
+
export interface TypographyProps {
|
|
23
|
+
/**
|
|
24
|
+
* The content to be rendered
|
|
25
|
+
*/
|
|
26
|
+
children: ReactNode;
|
|
27
|
+
/**
|
|
28
|
+
* The typography variant to apply
|
|
29
|
+
*/
|
|
30
|
+
variant?: TypographyVariant;
|
|
31
|
+
/**
|
|
32
|
+
* The HTML element or React component to render
|
|
33
|
+
*/
|
|
34
|
+
component?: ElementType;
|
|
35
|
+
/**
|
|
36
|
+
* Text alignment
|
|
37
|
+
*/
|
|
38
|
+
align?: TypographyAlign;
|
|
39
|
+
/**
|
|
40
|
+
* Color variant
|
|
41
|
+
*/
|
|
42
|
+
color?: TypographyColor;
|
|
43
|
+
/**
|
|
44
|
+
* Whether the text should be clipped with ellipsis when it overflows
|
|
45
|
+
*/
|
|
46
|
+
noWrap?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Additional CSS class names
|
|
49
|
+
*/
|
|
50
|
+
className?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Custom styles
|
|
53
|
+
*/
|
|
54
|
+
style?: CSSProperties;
|
|
55
|
+
/**
|
|
56
|
+
* Whether the text should be displayed inline
|
|
57
|
+
*/
|
|
58
|
+
inline?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Custom font weight
|
|
61
|
+
*/
|
|
62
|
+
fontWeight?: 'normal' | 'medium' | 'semibold' | 'bold' | number;
|
|
63
|
+
/**
|
|
64
|
+
* Custom font size (overrides variant sizing)
|
|
65
|
+
*/
|
|
66
|
+
fontSize?: string | number;
|
|
67
|
+
/**
|
|
68
|
+
* Line height
|
|
69
|
+
*/
|
|
70
|
+
lineHeight?: string | number;
|
|
71
|
+
/**
|
|
72
|
+
* Whether to disable gutters (margin bottom)
|
|
73
|
+
*/
|
|
74
|
+
gutterBottom?: boolean;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Typography component for consistent text rendering throughout the application.
|
|
78
|
+
* Integrates with the theme system and provides semantic HTML elements.
|
|
79
|
+
*/
|
|
80
|
+
declare const Typography: FC<TypographyProps>;
|
|
81
|
+
export default Typography;
|
|
@@ -0,0 +1,57 @@
|
|
|
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 { Context } from 'react';
|
|
19
|
+
/**
|
|
20
|
+
* Props interface of {@link AsgardeoContext}
|
|
21
|
+
*/
|
|
22
|
+
export type AsgardeoContextProps = {
|
|
23
|
+
/**
|
|
24
|
+
* Flag indicating whether the SDK is working in the background.
|
|
25
|
+
*/
|
|
26
|
+
isLoading: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Flag indicating whether the user is signed in or not.
|
|
29
|
+
*/
|
|
30
|
+
isSignedIn: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Sign-in function to initiate the authentication process.
|
|
33
|
+
* @remark This is the programmatic version of the `SignInButton` component.
|
|
34
|
+
* TODO: Fix the types.
|
|
35
|
+
*/
|
|
36
|
+
signIn: any;
|
|
37
|
+
/**
|
|
38
|
+
* Sign-out function to terminate the authentication session.
|
|
39
|
+
* @remark This is the programmatic version of the `SignOutButton` component.
|
|
40
|
+
* FIXME: Fix the types.
|
|
41
|
+
*/
|
|
42
|
+
signOut: any;
|
|
43
|
+
/**
|
|
44
|
+
* Sign-up function to initiate the registration process.
|
|
45
|
+
* @remark This is the programmatic version of the `SignUpButton` component.
|
|
46
|
+
* FIXME: Fix the types.
|
|
47
|
+
*/
|
|
48
|
+
signUp: any;
|
|
49
|
+
user: any;
|
|
50
|
+
baseUrl: string;
|
|
51
|
+
afterSignInUrl: string;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Context object for managing the Authentication flow builder core context.
|
|
55
|
+
*/
|
|
56
|
+
declare const AsgardeoContext: Context<AsgardeoContextProps | null>;
|
|
57
|
+
export default AsgardeoContext;
|
package/dist/{esm/types/components/public-components.d.ts → contexts/Asgardeo/AsgardeoProvider.d.ts}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c)
|
|
2
|
+
* Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
|
|
3
3
|
*
|
|
4
4
|
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
5
|
* Version 2.0 (the "License"); you may not use this file except
|
|
@@ -15,8 +15,11 @@
|
|
|
15
15
|
* specific language governing permissions and limitations
|
|
16
16
|
* under the License.
|
|
17
17
|
*/
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
import { FC, PropsWithChildren } from 'react';
|
|
19
|
+
import { AsgardeoReactConfig } from '../../models/config';
|
|
20
|
+
/**
|
|
21
|
+
* Props interface of {@link AsgardeoProvider}
|
|
22
|
+
*/
|
|
23
|
+
export type AsgardeoProviderProps = AsgardeoReactConfig;
|
|
24
|
+
declare const AsgardeoProvider: FC<PropsWithChildren<AsgardeoProviderProps>>;
|
|
25
|
+
export default AsgardeoProvider;
|
|
@@ -0,0 +1,20 @@
|
|
|
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 { AsgardeoContextProps } from './AsgardeoContext';
|
|
19
|
+
declare const useAsgardeo: () => AsgardeoContextProps;
|
|
20
|
+
export default useAsgardeo;
|
|
@@ -0,0 +1,73 @@
|
|
|
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
|
+
/**
|
|
19
|
+
* Types of authentication flows/steps that can be displayed.
|
|
20
|
+
*/
|
|
21
|
+
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
|
+
canGoBack?: boolean;
|
|
27
|
+
metadata?: Record<string, any>;
|
|
28
|
+
} | null;
|
|
29
|
+
/**
|
|
30
|
+
* Message types for displaying in authentication flows.
|
|
31
|
+
*/
|
|
32
|
+
export interface FlowMessage {
|
|
33
|
+
id?: string;
|
|
34
|
+
type: 'success' | 'error' | 'warning' | 'info';
|
|
35
|
+
message: string;
|
|
36
|
+
dismissible?: boolean;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Context value for managing authentication flow UI state.
|
|
40
|
+
*/
|
|
41
|
+
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
|
+
addMessage: (message: FlowMessage) => void;
|
|
50
|
+
removeMessage: (messageId: string) => void;
|
|
51
|
+
clearMessages: () => void;
|
|
52
|
+
error: string | null;
|
|
53
|
+
setError: (error: string | null) => void;
|
|
54
|
+
isLoading: boolean;
|
|
55
|
+
setIsLoading: (loading: boolean) => void;
|
|
56
|
+
showBackButton: boolean;
|
|
57
|
+
setShowBackButton: (show: boolean) => void;
|
|
58
|
+
onGoBack?: () => void;
|
|
59
|
+
setOnGoBack: (callback?: () => void) => void;
|
|
60
|
+
reset: () => void;
|
|
61
|
+
navigateToFlow: (flowType: NonNullable<FlowStep>['type'], options?: {
|
|
62
|
+
title?: string;
|
|
63
|
+
subtitle?: string;
|
|
64
|
+
metadata?: Record<string, any>;
|
|
65
|
+
}) => void;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Context for managing authentication flow UI state.
|
|
69
|
+
* This context handles titles, messages, navigation, and loading states
|
|
70
|
+
* for authentication flows like SignIn, SignUp, organization signin, etc.
|
|
71
|
+
*/
|
|
72
|
+
declare const FlowContext: import("react").Context<FlowContextValue>;
|
|
73
|
+
export default FlowContext;
|
|
@@ -0,0 +1,46 @@
|
|
|
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, PropsWithChildren } from 'react';
|
|
19
|
+
import { FlowStep } from './FlowContext';
|
|
20
|
+
/**
|
|
21
|
+
* Props for the FlowProvider component.
|
|
22
|
+
*/
|
|
23
|
+
export interface FlowProviderProps {
|
|
24
|
+
/**
|
|
25
|
+
* Initial step to start with.
|
|
26
|
+
*/
|
|
27
|
+
initialStep?: FlowStep;
|
|
28
|
+
/**
|
|
29
|
+
* Initial title.
|
|
30
|
+
*/
|
|
31
|
+
initialTitle?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Initial subtitle.
|
|
34
|
+
*/
|
|
35
|
+
initialSubtitle?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Callback when flow type changes.
|
|
38
|
+
*/
|
|
39
|
+
onFlowChange?: (step: FlowStep) => void;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Provider component for flow context.
|
|
43
|
+
* Manages shared UI state for authentication flows including titles, messages, and navigation.
|
|
44
|
+
*/
|
|
45
|
+
declare const FlowProvider: FC<PropsWithChildren<FlowProviderProps>>;
|
|
46
|
+
export default FlowProvider;
|
|
@@ -0,0 +1,48 @@
|
|
|
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 { FlowContextValue } from './FlowContext';
|
|
19
|
+
/**
|
|
20
|
+
* Hook to access the flow context.
|
|
21
|
+
* Must be used within a FlowProvider.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```tsx
|
|
25
|
+
* const MyAuthComponent = () => {
|
|
26
|
+
* const { title, setTitle, addMessage, isLoading } = useFlow();
|
|
27
|
+
*
|
|
28
|
+
* const handleSuccess = () => {
|
|
29
|
+
* addMessage({
|
|
30
|
+
* type: 'success',
|
|
31
|
+
* message: 'Authentication successful!'
|
|
32
|
+
* });
|
|
33
|
+
* };
|
|
34
|
+
*
|
|
35
|
+
* return (
|
|
36
|
+
* <div>
|
|
37
|
+
* <h1>{title}</h1>
|
|
38
|
+
* {isLoading && <p>Loading...</p>}
|
|
39
|
+
* </div>
|
|
40
|
+
* );
|
|
41
|
+
* };
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
* @returns The flow context value
|
|
45
|
+
* @throws Error if used outside of FlowProvider
|
|
46
|
+
*/
|
|
47
|
+
declare const useFlow: () => FlowContextValue;
|
|
48
|
+
export default useFlow;
|