@asgardeo/react 0.2.3 → 0.3.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 +108 -6
- package/dist/AsgardeoReactClient.d.ts +37 -0
- package/dist/__temp__/api.d.ts +229 -0
- package/dist/__temp__/models.d.ts +105 -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 +1888 -45111
- package/dist/cjs/index.js.map +7 -1
- package/dist/components/actions/SignInButton/BaseSignInButton.d.ts +65 -0
- package/dist/components/actions/SignInButton/SignInButton.d.ts +46 -0
- package/dist/components/actions/SignOutButton/BaseSignOutButton.d.ts +65 -0
- package/dist/components/actions/SignOutButton/SignOutButton.d.ts +44 -0
- package/dist/components/actions/SignUpButton/BaseSignUpButton.d.ts +65 -0
- package/dist/components/actions/SignUpButton/SignUpButton.d.ts +45 -0
- package/dist/components/control/SignedIn.d.ts +45 -0
- package/dist/components/control/SignedOut.d.ts +45 -0
- package/dist/components/presentation/User.d.ts +57 -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 +42 -0
- package/dist/components/presentation/UserProfile/UserProfile.d.ts +49 -0
- package/dist/{cjs/types/components/SignIn/SignIn.d.ts → components/primitives/Avatar/Avatar.d.ts} +25 -14
- package/dist/{esm/types/models/use-on.d.ts → components/primitives/Checkbox/Checkbox.d.ts} +20 -9
- package/dist/components/primitives/DatePicker/DatePicker.d.ts +50 -0
- package/dist/components/primitives/Popover/Popover.d.ts +59 -0
- package/dist/components/primitives/Select/Select.d.ts +60 -0
- package/dist/components/primitives/TextField/TextField.d.ts +46 -0
- package/dist/contexts/AsgardeoContext.d.ts +56 -0
- package/dist/{cjs/types/contexts/i18n-context.d.ts → hooks/useAsgardeo.d.ts} +4 -5
- package/dist/hooks/useBrowserUrl.d.ts +47 -0
- package/dist/index.d.ts +36 -348
- package/dist/index.js +1935 -0
- package/dist/index.js.map +7 -0
- package/dist/{cjs/types/models/public-models.d.ts → models/config.d.ts} +3 -3
- package/dist/{cjs/types/hooks/use-config.d.ts → providers/AsgardeoProvider.d.ts} +7 -5
- package/dist/{cjs/types/models/asgardeo-provider-props.d.ts → theme/ThemeContext.d.ts} +8 -7
- package/dist/{esm/types/models/asgardeo-provider-props.d.ts → theme/ThemeProvider.d.ts} +7 -7
- package/dist/{cjs/types/models/use-on.d.ts → theme/types.d.ts} +22 -12
- package/dist/{esm/types/oxygen-ui-react-auth-components/index.d.ts → theme/useTheme.d.ts} +3 -3
- package/dist/{cjs/types/models/use-config.d.ts → utils/getMappedUserProfileValue.d.ts} +3 -6
- package/dist/utils/getUserProfile.d.ts +59 -0
- package/package.json +55 -58
- package/dist/cjs/types/components/SignIn/fragments/BasicAuth.d.ts +0 -35
- package/dist/cjs/types/components/SignIn/fragments/EmailOtp.d.ts +0 -32
- package/dist/cjs/types/components/SignIn/fragments/IdentifierFirst.d.ts +0 -35
- package/dist/cjs/types/components/SignIn/fragments/LoginOptionsBox.d.ts +0 -30
- package/dist/cjs/types/components/SignIn/fragments/SmsOtp.d.ts +0 -21
- package/dist/cjs/types/components/SignIn/fragments/Totp.d.ts +0 -33
- package/dist/cjs/types/components/SignInButton/SignInButton.d.ts +0 -29
- package/dist/cjs/types/components/SignOutButton/SignOutButton.d.ts +0 -27
- package/dist/cjs/types/components/SignedIn/SignedIn.d.ts +0 -29
- package/dist/cjs/types/components/SignedOut/SignedOut.d.ts +0 -29
- package/dist/cjs/types/components/public-components.d.ts +0 -22
- package/dist/cjs/types/contexts/asgardeo-context.d.ts +0 -21
- package/dist/cjs/types/contexts/branding-preference-context.d.ts +0 -21
- package/dist/cjs/types/hooks/use-authentication.d.ts +0 -27
- package/dist/cjs/types/hooks/use-on.d.ts +0 -20
- package/dist/cjs/types/hooks/use-translations.d.ts +0 -33
- package/dist/cjs/types/index.d.ts +0 -22
- package/dist/cjs/types/models/auth-context.d.ts +0 -43
- package/dist/cjs/types/models/basic-auth-props.d.ts +0 -29
- package/dist/cjs/types/models/branding-preference-provider-props.d.ts +0 -22
- package/dist/cjs/types/models/email-otp-props.d.ts +0 -26
- package/dist/cjs/types/models/i18n.d.ts +0 -34
- package/dist/cjs/types/models/jwt-verify-options.d.ts +0 -25
- package/dist/cjs/types/models/login-options-box-props.d.ts +0 -24
- package/dist/cjs/types/models/sign-in.d.ts +0 -49
- package/dist/cjs/types/models/signed-props.d.ts +0 -22
- package/dist/cjs/types/models/totp-props.d.ts +0 -26
- package/dist/cjs/types/models/use-authentication.d.ts +0 -29
- package/dist/cjs/types/models/use-translations.d.ts +0 -22
- package/dist/cjs/types/oxygen-ui-react-auth-components/SignIn/SignIn.d.ts +0 -79
- package/dist/cjs/types/oxygen-ui-react-auth-components/SignInAlert/SignInAlert.d.ts +0 -37
- package/dist/cjs/types/oxygen-ui-react-auth-components/SignInButton/SignInButton.d.ts +0 -27
- package/dist/cjs/types/oxygen-ui-react-auth-components/SignInDivider/SignInDivider.d.ts +0 -26
- package/dist/cjs/types/oxygen-ui-react-auth-components/SignInFooter/SignInFooter.d.ts +0 -29
- package/dist/cjs/types/oxygen-ui-react-auth-components/SignInImage/SignInImage.d.ts +0 -23
- package/dist/cjs/types/oxygen-ui-react-auth-components/SignInLink/SignInLink.d.ts +0 -25
- package/dist/cjs/types/oxygen-ui-react-auth-components/SignInPaper/SignInPaper.d.ts +0 -26
- package/dist/cjs/types/oxygen-ui-react-auth-components/SignInPinInput/SignInPinInput.d.ts +0 -30
- package/dist/cjs/types/oxygen-ui-react-auth-components/SignInTextField/SignInTextField.d.ts +0 -26
- package/dist/cjs/types/oxygen-ui-react-auth-components/SignInTypography/SignInTypography.d.ts +0 -32
- package/dist/cjs/types/oxygen-ui-react-auth-components/index.d.ts +0 -19
- package/dist/cjs/types/oxygen-ui-react-auth-components/models/component.d.ts +0 -27
- package/dist/cjs/types/providers/AsgardeoProvider.d.ts +0 -34
- package/dist/cjs/types/providers/BrandingPreferenceProvider.d.ts +0 -32
- package/dist/cjs/types/providers/I18nProvider.d.ts +0 -33
- package/dist/cjs/types/theme/generate-theme-sign-in.d.ts +0 -28
- package/dist/cjs/types/theme/generate-theme.d.ts +0 -30
- package/dist/cjs/types/utils/crypto-utils.d.ts +0 -52
- package/dist/cjs/types/utils/session-store.d.ts +0 -25
- package/dist/esm/index.js +0 -45151
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/types/components/SignIn/SignIn.d.ts +0 -31
- 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/SmsOtp.d.ts +0 -21
- package/dist/esm/types/components/SignIn/fragments/Totp.d.ts +0 -33
- package/dist/esm/types/components/SignInButton/SignInButton.d.ts +0 -29
- package/dist/esm/types/components/SignOutButton/SignOutButton.d.ts +0 -27
- package/dist/esm/types/components/SignedIn/SignedIn.d.ts +0 -29
- package/dist/esm/types/components/SignedOut/SignedOut.d.ts +0 -29
- package/dist/esm/types/components/public-components.d.ts +0 -22
- package/dist/esm/types/contexts/asgardeo-context.d.ts +0 -21
- package/dist/esm/types/contexts/branding-preference-context.d.ts +0 -21
- package/dist/esm/types/contexts/i18n-context.d.ts +0 -21
- package/dist/esm/types/hooks/use-authentication.d.ts +0 -27
- package/dist/esm/types/hooks/use-config.d.ts +0 -23
- package/dist/esm/types/hooks/use-on.d.ts +0 -20
- 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/branding-preference-provider-props.d.ts +0 -22
- 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/public-models.d.ts +0 -19
- package/dist/esm/types/models/sign-in.d.ts +0 -49
- package/dist/esm/types/models/signed-props.d.ts +0 -22
- 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-config.d.ts +0 -22
- 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/models/component.d.ts +0 -27
- 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
|
@@ -0,0 +1,49 @@
|
|
|
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 } from 'react';
|
|
19
|
+
import { BaseUserProfileProps } from './BaseUserProfile';
|
|
20
|
+
/**
|
|
21
|
+
* Props for the UserProfile component.
|
|
22
|
+
* Extends BaseUserProfileProps but makes the user prop optional since it will be obtained from useAsgardeo
|
|
23
|
+
*/
|
|
24
|
+
export type UserProfileProps = Omit<BaseUserProfileProps, 'user'>;
|
|
25
|
+
/**
|
|
26
|
+
* UserProfile component displays the authenticated user's profile information in a
|
|
27
|
+
* structured and styled format. It shows user details such as display name, email,
|
|
28
|
+
* username, and other available profile information from Asgardeo.
|
|
29
|
+
*
|
|
30
|
+
* This component is the React-specific implementation that uses the BaseUserProfile
|
|
31
|
+
* and automatically retrieves the user data from Asgardeo context if not provided.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```tsx
|
|
35
|
+
* // Basic usage - will use user from Asgardeo context
|
|
36
|
+
* <UserProfile />
|
|
37
|
+
*
|
|
38
|
+
* // With explicit user data
|
|
39
|
+
* <UserProfile user={specificUser} />
|
|
40
|
+
*
|
|
41
|
+
* // With card layout and custom fallback
|
|
42
|
+
* <UserProfile
|
|
43
|
+
* cardLayout={true}
|
|
44
|
+
* fallback={<div>Please sign in to view your profile</div>}
|
|
45
|
+
* />
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
declare const UserProfile: FC<UserProfileProps>;
|
|
49
|
+
export default UserProfile;
|
package/dist/{cjs/types/components/SignIn/SignIn.d.ts → components/primitives/Avatar/Avatar.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
|
|
@@ -16,16 +16,27 @@
|
|
|
16
16
|
* under the License.
|
|
17
17
|
*/
|
|
18
18
|
import { FC } from 'react';
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
19
|
+
export interface AvatarProps {
|
|
20
|
+
/**
|
|
21
|
+
* The URL of the avatar image
|
|
22
|
+
*/
|
|
23
|
+
imageUrl?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Alternative text for the avatar image
|
|
26
|
+
*/
|
|
27
|
+
alt?: string;
|
|
28
|
+
/**
|
|
29
|
+
* The size of the avatar in pixels
|
|
30
|
+
*/
|
|
31
|
+
size?: number;
|
|
32
|
+
/**
|
|
33
|
+
* The name to use for generating initials when no image is provided
|
|
34
|
+
*/
|
|
35
|
+
name?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Optional className for the avatar
|
|
38
|
+
*/
|
|
39
|
+
className?: string;
|
|
40
|
+
}
|
|
41
|
+
export declare const Avatar: FC<AvatarProps>;
|
|
42
|
+
export default Avatar;
|
|
@@ -15,17 +15,28 @@
|
|
|
15
15
|
* specific language governing permissions and limitations
|
|
16
16
|
* under the License.
|
|
17
17
|
*/
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
import { FC, InputHTMLAttributes } from 'react';
|
|
19
|
+
export interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'className' | 'type'> {
|
|
20
|
+
/**
|
|
21
|
+
* Label text to display next to the checkbox
|
|
22
|
+
*/
|
|
23
|
+
label?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Error message to display below the checkbox
|
|
26
|
+
*/
|
|
27
|
+
error?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Additional CSS class names
|
|
30
|
+
*/
|
|
31
|
+
className?: string;
|
|
23
32
|
/**
|
|
24
|
-
*
|
|
33
|
+
* Whether the field is required
|
|
25
34
|
*/
|
|
26
|
-
|
|
35
|
+
required?: boolean;
|
|
27
36
|
/**
|
|
28
|
-
*
|
|
37
|
+
* Helper text to display below the checkbox
|
|
29
38
|
*/
|
|
30
|
-
|
|
39
|
+
helperText?: string;
|
|
31
40
|
}
|
|
41
|
+
export declare const Checkbox: FC<CheckboxProps>;
|
|
42
|
+
export default Checkbox;
|
|
@@ -0,0 +1,50 @@
|
|
|
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 } from 'react';
|
|
19
|
+
export interface DatePickerProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'className' | 'type'> {
|
|
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
|
+
* Custom date format for the regex pattern
|
|
46
|
+
*/
|
|
47
|
+
dateFormat?: string;
|
|
48
|
+
}
|
|
49
|
+
export declare const DatePicker: FC<DatePickerProps>;
|
|
50
|
+
export default DatePicker;
|
|
@@ -0,0 +1,59 @@
|
|
|
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
|
+
interface PopoverHeaderProps {
|
|
20
|
+
children?: ReactNode;
|
|
21
|
+
}
|
|
22
|
+
declare const PopoverHeader: FC<PopoverHeaderProps>;
|
|
23
|
+
interface PopoverContentProps {
|
|
24
|
+
children: ReactNode;
|
|
25
|
+
}
|
|
26
|
+
declare const PopoverContent: FC<PopoverContentProps>;
|
|
27
|
+
export interface PopoverProps {
|
|
28
|
+
/**
|
|
29
|
+
* Whether the popover is open
|
|
30
|
+
*/
|
|
31
|
+
isOpen: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* The content to display inside the popover
|
|
34
|
+
*/
|
|
35
|
+
children: ReactNode;
|
|
36
|
+
/**
|
|
37
|
+
* Callback when the popover should close
|
|
38
|
+
*/
|
|
39
|
+
onClose: () => void;
|
|
40
|
+
/**
|
|
41
|
+
* Optional custom class name for the popover container
|
|
42
|
+
*/
|
|
43
|
+
className?: string;
|
|
44
|
+
/**
|
|
45
|
+
* The HTML element ID where the portal should be mounted
|
|
46
|
+
*/
|
|
47
|
+
portalId?: string;
|
|
48
|
+
/**
|
|
49
|
+
* The display mode of the popover
|
|
50
|
+
* 'modal' - shows overlay and centers content
|
|
51
|
+
* 'dropdown' - no overlay, content positioned relative to trigger
|
|
52
|
+
*/
|
|
53
|
+
mode?: 'modal' | 'dropdown';
|
|
54
|
+
}
|
|
55
|
+
export declare const Popover: FC<PopoverProps> & {
|
|
56
|
+
Header: typeof PopoverHeader;
|
|
57
|
+
Content: typeof PopoverContent;
|
|
58
|
+
};
|
|
59
|
+
export default Popover;
|
|
@@ -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
|
+
export declare const Select: FC<SelectProps>;
|
|
60
|
+
export default Select;
|
|
@@ -0,0 +1,46 @@
|
|
|
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 } 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
|
+
export declare const TextField: FC<TextFieldProps>;
|
|
46
|
+
export default TextField;
|
|
@@ -0,0 +1,56 @@
|
|
|
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
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Context object for managing the Authentication flow builder core context.
|
|
54
|
+
*/
|
|
55
|
+
declare const AsgardeoContext: Context<AsgardeoContextProps | null>;
|
|
56
|
+
export default AsgardeoContext;
|
|
@@ -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,7 +15,6 @@
|
|
|
15
15
|
* specific language governing permissions and limitations
|
|
16
16
|
* under the License.
|
|
17
17
|
*/
|
|
18
|
-
import {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
export default I18nContext;
|
|
18
|
+
import { AsgardeoContextProps } from '../contexts/AsgardeoContext';
|
|
19
|
+
declare const useAsgardeo: () => AsgardeoContextProps;
|
|
20
|
+
export default useAsgardeo;
|
|
@@ -0,0 +1,47 @@
|
|
|
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
|
+
* Interface for the useBrowserUrl hook return value.
|
|
20
|
+
*/
|
|
21
|
+
export interface UseBrowserUrl {
|
|
22
|
+
/**
|
|
23
|
+
* Checks if the current URL contains authentication parameters.
|
|
24
|
+
*
|
|
25
|
+
* @param url - The URL object to check for authentication parameters
|
|
26
|
+
* @param afterSignInUrl - The URL where the authorization server should redirect after authentication
|
|
27
|
+
* @returns True if the URL contains authentication parameters and matches the afterSignInUrl, or if it contains an error parameter
|
|
28
|
+
*/
|
|
29
|
+
hasAuthParams: (url: URL, afterSignInUrl: string) => boolean;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Hook that provides utilities for handling browser URLs in authentication flows.
|
|
33
|
+
*
|
|
34
|
+
* @returns An object containing URL utility functions
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```tsx
|
|
38
|
+
* const { hasAuthParams } = useBrowserUrl();
|
|
39
|
+
* const url = new URL(window.location.href);
|
|
40
|
+
*
|
|
41
|
+
* if (hasAuthParams(url, "/after-signin")) {
|
|
42
|
+
* // Handle authentication callback
|
|
43
|
+
* }
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
declare const useBrowserUrl: () => UseBrowserUrl;
|
|
47
|
+
export default useBrowserUrl;
|