@asgardeo/react 0.5.3 → 0.5.4

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.
@@ -0,0 +1,86 @@
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 } from 'react';
19
+ export interface MultiInputProps {
20
+ /**
21
+ * Label text to display above the inputs
22
+ */
23
+ label?: string;
24
+ /**
25
+ * Error message to display below the inputs
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 inputs
42
+ */
43
+ helperText?: string;
44
+ /**
45
+ * Placeholder text for input fields
46
+ */
47
+ placeholder?: string;
48
+ /**
49
+ * Array of values
50
+ */
51
+ values: string[];
52
+ /**
53
+ * Callback when values change
54
+ */
55
+ onChange: (values: string[]) => void;
56
+ /**
57
+ * Custom style object
58
+ */
59
+ style?: CSSProperties;
60
+ /**
61
+ * Input type
62
+ */
63
+ type?: 'text' | 'email' | 'tel' | 'url' | 'password' | 'date' | 'boolean';
64
+ /**
65
+ * Field type for different input components
66
+ */
67
+ fieldType?: 'STRING' | 'DATE_TIME' | 'BOOLEAN';
68
+ /**
69
+ * Icon to display at the start (left) of each input
70
+ */
71
+ startIcon?: ReactNode;
72
+ /**
73
+ * Icon to display at the end (right) of each input (in addition to add/remove buttons)
74
+ */
75
+ endIcon?: ReactNode;
76
+ /**
77
+ * Minimum number of fields to show (default: 1)
78
+ */
79
+ minFields?: number;
80
+ /**
81
+ * Maximum number of fields to allow (default: unlimited)
82
+ */
83
+ maxFields?: number;
84
+ }
85
+ declare const MultiInput: FC<MultiInputProps>;
86
+ export default MultiInput;
@@ -21,6 +21,8 @@ import { Organization } from '@asgardeo/browser';
21
21
  * Props interface of {@link AsgardeoContext}
22
22
  */
23
23
  export type AsgardeoContextProps = {
24
+ organizationHandle: string | undefined;
25
+ applicationId: string | undefined;
24
26
  signInUrl: string | undefined;
25
27
  signUpUrl: string | undefined;
26
28
  afterSignInUrl: string | undefined;
@@ -16,10 +16,21 @@
16
16
  * under the License.
17
17
  */
18
18
  import { FC, PropsWithChildren } from 'react';
19
- import { ThemeConfig, RecursivePartial } from '@asgardeo/browser';
19
+ import { ThemeConfig, ThemeMode, RecursivePartial, BrowserThemeDetection } from '@asgardeo/browser';
20
20
  export interface ThemeProviderProps {
21
21
  theme?: RecursivePartial<ThemeConfig>;
22
- defaultColorScheme?: 'light' | 'dark';
22
+ /**
23
+ * The theme mode to use for automatic detection
24
+ * - 'light': Always use light theme
25
+ * - 'dark': Always use dark theme
26
+ * - 'system': Use system preference (prefers-color-scheme media query)
27
+ * - 'class': Detect theme based on CSS classes on HTML element
28
+ */
29
+ mode?: ThemeMode;
30
+ /**
31
+ * Configuration for theme detection when using 'class' or 'system' mode
32
+ */
33
+ detection?: BrowserThemeDetection;
23
34
  }
24
35
  declare const ThemeProvider: FC<PropsWithChildren<ThemeProviderProps>>;
25
36
  export default ThemeProvider;
@@ -15,7 +15,7 @@
15
15
  * specific language governing permissions and limitations
16
16
  * under the License.
17
17
  */
18
- import { User, Schema } from '@asgardeo/browser';
18
+ import { User, Schema, UpdateMeProfileConfig } from '@asgardeo/browser';
19
19
  import { Context } from 'react';
20
20
  /**
21
21
  * Props interface of {@link UserContext}
@@ -25,6 +25,14 @@ export type UserContextProps = {
25
25
  profile: User | null;
26
26
  revalidateProfile: () => Promise<void>;
27
27
  schemas: Schema[] | null;
28
+ updateProfile: (requestConfig: UpdateMeProfileConfig, sessionId?: string) => Promise<{
29
+ success: boolean;
30
+ data: {
31
+ user: User;
32
+ };
33
+ error: string;
34
+ }>;
35
+ onUpdateProfile: (payload: User) => void;
28
36
  };
29
37
  /**
30
38
  * Context object for managing user profile data and related operations.
@@ -15,7 +15,7 @@
15
15
  * specific language governing permissions and limitations
16
16
  * under the License.
17
17
  */
18
- import { UserProfile } from '@asgardeo/browser';
18
+ import { UpdateMeProfileConfig, User, UserProfile } from '@asgardeo/browser';
19
19
  import { FC, PropsWithChildren } from 'react';
20
20
  /**
21
21
  * Props interface of {@link UserProvider}
@@ -23,6 +23,14 @@ import { FC, PropsWithChildren } from 'react';
23
23
  export interface UserProviderProps {
24
24
  profile: UserProfile;
25
25
  revalidateProfile?: () => Promise<void>;
26
+ updateProfile?: (requestConfig: UpdateMeProfileConfig, sessionId?: string) => Promise<{
27
+ success: boolean;
28
+ data: {
29
+ user: User;
30
+ };
31
+ error: string;
32
+ }>;
33
+ onUpdateProfile?: (payload: User) => void;
26
34
  }
27
35
  /**
28
36
  * UserProvider component that manages user profile data and provides it through UserContext.
package/dist/index.d.ts CHANGED
@@ -139,6 +139,8 @@ export { default as OtpField } from './components/primitives/OtpField/OtpField';
139
139
  export * from './components/primitives/OtpField/OtpField';
140
140
  export { default as TextField } from './components/primitives/TextField/TextField';
141
141
  export * from './components/primitives/TextField/TextField';
142
+ export { default as MultiInput } from './components/primitives/MultiInput/MultiInput';
143
+ export * from './components/primitives/MultiInput/MultiInput';
142
144
  export { default as PasswordField } from './components/primitives/PasswordField/PasswordField';
143
145
  export * from './components/primitives/PasswordField/PasswordField';
144
146
  export { default as Select } from './components/primitives/Select/Select';
@@ -169,6 +171,7 @@ export { default as UserIcon } from './components/primitives/Icons/User';
169
171
  export { default as LogOut } from './components/primitives/Icons/LogOut';
170
172
  export { createField, FieldFactory, validateFieldValue } from './components/factories/FieldFactory';
171
173
  export * from './components/factories/FieldFactory';
174
+ export { default as BuildingAlt } from './components/primitives/Icons/BuildingAlt';
172
175
  export type { FlowStep, FlowMessage, FlowContextValue } from './contexts/Flow/FlowContext';
173
176
  export type { FlowProviderProps } from './contexts/Flow/FlowProvider';
174
177
  export { default as getAllOrganizations, GetAllOrganizationsConfig } from './api/getAllOrganizations';