@asgardeo/react 0.3.0 → 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.
Files changed (79) hide show
  1. package/README.md +5 -1
  2. package/dist/AsgardeoReactClient.d.ts +3 -2
  3. package/dist/__temp__/api.d.ts +17 -18
  4. package/dist/__temp__/models.d.ts +13 -21
  5. package/dist/cjs/index.js +17252 -1209
  6. package/dist/cjs/index.js.map +4 -4
  7. package/dist/components/actions/SignInButton/BaseSignInButton.d.ts +4 -3
  8. package/dist/components/actions/SignInButton/SignInButton.d.ts +21 -2
  9. package/dist/components/actions/SignOutButton/BaseSignOutButton.d.ts +4 -3
  10. package/dist/components/actions/SignOutButton/SignOutButton.d.ts +22 -1
  11. package/dist/components/actions/SignUpButton/BaseSignUpButton.d.ts +2 -1
  12. package/dist/components/actions/SignUpButton/SignUpButton.d.ts +21 -0
  13. package/dist/components/factories/FieldFactory.d.ts +107 -0
  14. package/dist/components/presentation/SignIn/BaseSignIn.d.ts +125 -0
  15. package/dist/components/presentation/SignIn/SignIn.d.ts +62 -0
  16. package/dist/components/presentation/SignIn/options/EmailOtp.d.ts +25 -0
  17. package/dist/components/presentation/SignIn/options/FacebookButton.d.ts +25 -0
  18. package/dist/components/presentation/SignIn/options/GitHubButton.d.ts +25 -0
  19. package/dist/components/presentation/SignIn/options/GoogleButton.d.ts +25 -0
  20. package/dist/components/presentation/SignIn/options/IdentifierFirst.d.ts +25 -0
  21. package/dist/components/presentation/SignIn/options/LinkedInButton.d.ts +25 -0
  22. package/dist/components/presentation/SignIn/options/MicrosoftButton.d.ts +25 -0
  23. package/dist/components/presentation/SignIn/options/MultiOptionButton.d.ts +26 -0
  24. package/dist/components/presentation/SignIn/options/SignInOptionFactory.d.ts +76 -0
  25. package/dist/components/presentation/SignIn/options/SignInWithEthereumButton.d.ts +25 -0
  26. package/dist/components/presentation/SignIn/options/SmsOtp.d.ts +25 -0
  27. package/dist/components/presentation/SignIn/options/SocialButton.d.ts +25 -0
  28. package/dist/components/presentation/SignIn/options/Totp.d.ts +25 -0
  29. package/dist/components/presentation/SignIn/options/UsernamePassword.d.ts +25 -0
  30. package/dist/components/presentation/SignIn/types.d.ts +124 -0
  31. package/dist/components/presentation/User/BaseUser.d.ts +66 -0
  32. package/dist/components/presentation/{User.d.ts → User/User.d.ts} +9 -4
  33. package/dist/components/presentation/UserDropdown/BaseUserDropdown.d.ts +1 -1
  34. package/dist/components/presentation/UserProfile/BaseUserProfile.d.ts +23 -2
  35. package/dist/components/primitives/Alert/Alert.d.ts +74 -0
  36. package/dist/components/primitives/Button/Button.d.ts +83 -0
  37. package/dist/components/primitives/Card/Card.d.ts +133 -0
  38. package/dist/components/primitives/Checkbox/Checkbox.d.ts +1 -1
  39. package/dist/components/primitives/DatePicker/DatePicker.d.ts +1 -1
  40. package/dist/components/primitives/Divider/Divider.d.ts +58 -0
  41. package/dist/components/primitives/FormControl/FormControl.d.ts +50 -0
  42. package/dist/components/primitives/Icons/CircleAlert.d.ts +23 -0
  43. package/dist/components/primitives/Icons/CircleCheck.d.ts +23 -0
  44. package/dist/components/primitives/Icons/Eye.d.ts +23 -0
  45. package/dist/components/primitives/Icons/EyeOff.d.ts +23 -0
  46. package/dist/components/primitives/Icons/Info.d.ts +23 -0
  47. package/dist/components/primitives/Icons/TriangleAlert.d.ts +23 -0
  48. package/dist/components/primitives/InputLabel/InputLabel.d.ts +46 -0
  49. package/dist/components/primitives/OtpField/OtpField.d.ts +86 -0
  50. package/dist/components/primitives/PasswordField/PasswordField.d.ts +31 -0
  51. package/dist/components/primitives/Popover/Popover.d.ts +71 -34
  52. package/dist/components/primitives/Select/Select.d.ts +1 -1
  53. package/dist/components/primitives/Spinner/Spinner.d.ts +54 -0
  54. package/dist/components/primitives/TextField/TextField.d.ts +18 -2
  55. package/dist/components/primitives/Typography/Typography.d.ts +81 -0
  56. package/dist/contexts/{AsgardeoContext.d.ts → Asgardeo/AsgardeoContext.d.ts} +1 -0
  57. package/dist/{providers → contexts/Asgardeo}/AsgardeoProvider.d.ts +1 -1
  58. package/dist/{hooks → contexts/Asgardeo}/useAsgardeo.d.ts +1 -1
  59. package/dist/contexts/Flow/FlowContext.d.ts +73 -0
  60. package/dist/contexts/Flow/FlowProvider.d.ts +46 -0
  61. package/dist/contexts/Flow/useFlow.d.ts +48 -0
  62. package/dist/contexts/I18n/I18nContext.d.ts +42 -0
  63. package/dist/contexts/I18n/I18nProvider.d.ts +31 -0
  64. package/dist/contexts/I18n/useI18n.d.ts +27 -0
  65. package/dist/{theme → contexts/Theme}/ThemeProvider.d.ts +2 -1
  66. package/dist/{theme → contexts/Theme}/useTheme.d.ts +2 -1
  67. package/dist/contexts/User/UserContext.d.ts +32 -0
  68. package/dist/contexts/User/UserProvider.d.ts +55 -0
  69. package/dist/contexts/User/useUser.d.ts +94 -0
  70. package/dist/hooks/useForm.d.ts +192 -0
  71. package/dist/hooks/useTranslation.d.ts +52 -0
  72. package/dist/index.d.ts +94 -9
  73. package/dist/index.js +17242 -1113
  74. package/dist/index.js.map +4 -4
  75. package/dist/utils/getMappedUserProfileValue.d.ts +33 -1
  76. package/package.json +6 -5
  77. package/dist/utils/getUserProfile.d.ts +0 -59
  78. /package/dist/{theme → contexts/Theme}/ThemeContext.d.ts +0 -0
  79. /package/dist/{theme → contexts/Theme}/types.d.ts +0 -0
@@ -15,45 +15,82 @@
15
15
  * specific language governing permissions and limitations
16
16
  * under the License.
17
17
  */
18
- import { FC, ReactNode } from 'react';
19
- interface PopoverHeaderProps {
20
- children?: ReactNode;
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;
21
24
  }
22
- declare const PopoverHeader: FC<PopoverHeaderProps>;
23
- interface PopoverContentProps {
24
- children: ReactNode;
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>>;
25
32
  }
26
- declare const PopoverContent: FC<PopoverContentProps>;
27
- export interface PopoverProps {
28
- /**
29
- * Whether the popover is open
30
- */
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 {
31
77
  isOpen: boolean;
32
- /**
33
- * The content to display inside the popover
34
- */
35
- children: ReactNode;
36
- /**
37
- * Callback when the popover should close
38
- */
78
+ children: React.ReactNode;
39
79
  onClose: () => void;
40
- /**
41
- * Optional custom class name for the popover container
42
- */
43
80
  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
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;
54
85
  }
55
- export declare const Popover: FC<PopoverProps> & {
56
- Header: typeof PopoverHeader;
57
- Content: typeof PopoverContent;
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;
58
95
  };
59
- export default Popover;
96
+ export default LegacyPopover;
@@ -56,5 +56,5 @@ export interface SelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement
56
56
  */
57
57
  options: SelectOption[];
58
58
  }
59
- export declare const Select: FC<SelectProps>;
59
+ declare const Select: FC<SelectProps>;
60
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;
@@ -15,7 +15,7 @@
15
15
  * specific language governing permissions and limitations
16
16
  * under the License.
17
17
  */
18
- import { FC, InputHTMLAttributes } from 'react';
18
+ import { FC, InputHTMLAttributes, ReactNode } from 'react';
19
19
  export interface TextFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'className'> {
20
20
  /**
21
21
  * Label text to display above the input
@@ -41,6 +41,22 @@ export interface TextFieldProps extends Omit<InputHTMLAttributes<HTMLInputElemen
41
41
  * Helper text to display below the input
42
42
  */
43
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;
44
60
  }
45
- export declare const TextField: FC<TextFieldProps>;
61
+ declare const TextField: FC<TextFieldProps>;
46
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;
@@ -48,6 +48,7 @@ export type AsgardeoContextProps = {
48
48
  signUp: any;
49
49
  user: any;
50
50
  baseUrl: string;
51
+ afterSignInUrl: string;
51
52
  };
52
53
  /**
53
54
  * Context object for managing the Authentication flow builder core context.
@@ -16,7 +16,7 @@
16
16
  * under the License.
17
17
  */
18
18
  import { FC, PropsWithChildren } from 'react';
19
- import { AsgardeoReactConfig } from '../models/config';
19
+ import { AsgardeoReactConfig } from '../../models/config';
20
20
  /**
21
21
  * Props interface of {@link AsgardeoProvider}
22
22
  */
@@ -15,6 +15,6 @@
15
15
  * specific language governing permissions and limitations
16
16
  * under the License.
17
17
  */
18
- import { AsgardeoContextProps } from '../contexts/AsgardeoContext';
18
+ import { AsgardeoContextProps } from './AsgardeoContext';
19
19
  declare const useAsgardeo: () => AsgardeoContextProps;
20
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;
@@ -0,0 +1,42 @@
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 { I18nBundle } from '@asgardeo/browser';
19
+ export interface I18nContextValue {
20
+ /**
21
+ * The current language code (e.g., 'en-US', 'fr-FR')
22
+ */
23
+ currentLanguage: string;
24
+ /**
25
+ * The fallback language code
26
+ */
27
+ fallbackLanguage: string;
28
+ /**
29
+ * All available i18n bundles (default + user provided)
30
+ */
31
+ bundles: Record<string, I18nBundle>;
32
+ /**
33
+ * Function to change the current language
34
+ */
35
+ setLanguage: (language: string) => void;
36
+ /**
37
+ * Function to get a translation by key with optional parameters
38
+ */
39
+ t: (key: string, params?: Record<string, string | number>) => string;
40
+ }
41
+ declare const I18nContext: import("react").Context<I18nContextValue>;
42
+ export default I18nContext;
@@ -0,0 +1,31 @@
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 { I18nPreferences } from '@asgardeo/browser';
20
+ export interface I18nProviderProps {
21
+ /**
22
+ * The i18n preferences from the AsgardeoProvider
23
+ */
24
+ preferences?: I18nPreferences;
25
+ }
26
+ /**
27
+ * I18nProvider component that manages internationalization state and provides
28
+ * translation functions to child components.
29
+ */
30
+ declare const I18nProvider: FC<PropsWithChildren<I18nProviderProps>>;
31
+ export default I18nProvider;
@@ -0,0 +1,27 @@
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 { I18nContextValue } from './I18nContext';
19
+ /**
20
+ * Hook for accessing the I18n context directly.
21
+ * Provides access to the full i18n context including bundles and all utilities.
22
+ *
23
+ * @returns The complete I18n context value
24
+ * @throws Error if used outside of I18nProvider context
25
+ */
26
+ declare const useI18n: () => I18nContextValue;
27
+ export default useI18n;
@@ -21,4 +21,5 @@ export interface ThemeProviderProps {
21
21
  theme?: RecursivePartial<ThemeConfig>;
22
22
  defaultColorScheme?: 'light' | 'dark';
23
23
  }
24
- export declare const ThemeProvider: FC<PropsWithChildren<ThemeProviderProps>>;
24
+ declare const ThemeProvider: FC<PropsWithChildren<ThemeProviderProps>>;
25
+ export default ThemeProvider;
@@ -16,4 +16,5 @@
16
16
  * under the License.
17
17
  */
18
18
  import { ThemeContextValue } from './ThemeContext';
19
- export declare const useTheme: () => ThemeContextValue;
19
+ declare const useTheme: () => ThemeContextValue;
20
+ export default useTheme;
@@ -0,0 +1,32 @@
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
+ import { User, Schema } from '@asgardeo/browser';
20
+ /**
21
+ * Props interface of {@link UserContext}
22
+ */
23
+ export type UserContextProps = {
24
+ profile: User | null;
25
+ schemas: Schema[] | null;
26
+ flattenedProfile: User | null;
27
+ };
28
+ /**
29
+ * Context object for managing user profile data and related operations.
30
+ */
31
+ declare const UserContext: Context<UserContextProps | null>;
32
+ export default UserContext;