@asgardeo/react 0.4.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AsgardeoReactClient.d.ts +13 -5
- package/dist/__temp__/api.d.ts +11 -5
- package/dist/__temp__/models.d.ts +3 -3
- package/dist/api/createOrganization.d.ts +81 -0
- package/dist/api/getAllOrganizations.d.ts +73 -0
- package/dist/api/getMeOrganizations.d.ts +77 -0
- package/dist/api/getOrganization.d.ts +69 -0
- package/dist/api/getSchemas.d.ts +67 -0
- package/dist/api/getScim2Me.d.ts +67 -0
- package/dist/api/updateMeProfile.d.ts +55 -0
- package/dist/api/updateOrganization.d.ts +76 -0
- package/dist/cjs/index.js +9685 -17275
- package/dist/cjs/index.js.map +4 -4
- package/dist/components/actions/SignInButton/BaseSignInButton.d.ts +5 -5
- package/dist/components/actions/SignOutButton/BaseSignOutButton.d.ts +5 -5
- package/dist/components/actions/SignUpButton/BaseSignUpButton.d.ts +5 -5
- package/dist/components/control/AsgardeoLoading.d.ts +47 -0
- package/dist/components/control/SignedIn.d.ts +2 -0
- package/dist/components/control/SignedOut.d.ts +2 -0
- package/dist/components/factories/FieldFactory.d.ts +6 -11
- package/dist/components/presentation/CreateOrganization/BaseCreateOrganization.d.ts +53 -0
- package/dist/components/presentation/CreateOrganization/CreateOrganization.d.ts +67 -0
- package/dist/components/presentation/Organization/BaseOrganization.d.ts +66 -0
- package/dist/components/presentation/Organization/Organization.d.ts +66 -0
- package/dist/components/presentation/OrganizationList/BaseOrganizationList.d.ts +117 -0
- package/dist/components/presentation/OrganizationList/OrganizationList.d.ts +93 -0
- package/dist/components/presentation/OrganizationProfile/BaseOrganizationProfile.d.ts +153 -0
- package/dist/components/presentation/OrganizationProfile/OrganizationProfile.d.ts +119 -0
- package/dist/components/presentation/OrganizationSwitcher/BaseOrganizationSwitcher.d.ts +141 -0
- package/dist/components/presentation/OrganizationSwitcher/OrganizationSwitcher.d.ts +70 -0
- package/dist/components/presentation/SignIn/BaseSignIn.d.ts +31 -38
- package/dist/components/presentation/SignIn/SignIn.d.ts +3 -14
- package/dist/components/presentation/SignIn/options/SignInOptionFactory.d.ts +4 -4
- package/dist/components/presentation/SignIn/types.d.ts +6 -6
- package/dist/components/presentation/SignUp/BaseSignUp.d.ts +126 -0
- package/dist/components/presentation/SignUp/SignUp.d.ts +55 -0
- package/dist/components/presentation/SignUp/options/CheckboxInput.d.ts +24 -0
- package/dist/components/presentation/SignUp/options/DateInput.d.ts +24 -0
- package/dist/components/presentation/SignUp/options/DividerComponent.d.ts +24 -0
- package/dist/components/presentation/SignUp/options/EmailInput.d.ts +24 -0
- package/dist/components/presentation/SignUp/options/FormContainer.d.ts +24 -0
- package/dist/components/presentation/SignUp/options/GoogleButton.d.ts +25 -0
- package/dist/components/presentation/SignUp/options/ImageComponent.d.ts +24 -0
- package/dist/components/presentation/SignUp/options/NumberInput.d.ts +24 -0
- package/dist/components/presentation/SignUp/options/PasswordInput.d.ts +24 -0
- package/dist/components/presentation/SignUp/options/SignUpOptionFactory.d.ts +100 -0
- package/dist/components/presentation/SignUp/options/SocialButton.d.ts +24 -0
- package/dist/components/presentation/SignUp/options/SubmitButton.d.ts +24 -0
- package/dist/components/presentation/SignUp/options/TelephoneInput.d.ts +24 -0
- package/dist/components/presentation/SignUp/options/TextInput.d.ts +24 -0
- package/dist/components/presentation/SignUp/options/Typography.d.ts +24 -0
- package/dist/components/presentation/SignUp/options/index.d.ts +26 -0
- package/dist/components/presentation/UserDropdown/BaseUserDropdown.d.ts +34 -22
- package/dist/components/presentation/UserDropdown/UserDropdown.d.ts +60 -4
- package/dist/components/presentation/UserProfile/BaseUserProfile.d.ts +17 -15
- package/dist/components/presentation/UserProfile/UserProfile.d.ts +1 -1
- package/dist/components/primitives/Avatar/Avatar.d.ts +21 -8
- package/dist/components/primitives/Card/Card.d.ts +8 -9
- package/dist/components/primitives/Divider/Divider.d.ts +8 -8
- package/dist/components/primitives/Icons/Building.d.ts +40 -0
- package/dist/components/primitives/Icons/BuildingAlt.d.ts +40 -0
- package/dist/components/primitives/Icons/Check.d.ts +40 -0
- package/dist/components/primitives/Icons/ChevronDown.d.ts +40 -0
- package/dist/components/primitives/Icons/LogOut.d.ts +23 -0
- package/dist/components/primitives/Icons/Plus.d.ts +23 -0
- package/dist/components/primitives/Icons/Settings.d.ts +0 -0
- package/dist/components/primitives/Icons/User.d.ts +23 -0
- package/dist/components/primitives/Icons/X.d.ts +23 -0
- package/dist/components/primitives/Icons/index.d.ts +27 -0
- package/dist/components/primitives/KeyValueInput/KeyValueInput.d.ts +123 -0
- package/dist/components/primitives/KeyValueInput/index.d.ts +0 -0
- package/dist/components/primitives/Popover/Popover.d.ts +19 -19
- package/dist/contexts/Asgardeo/AsgardeoContext.d.ts +7 -2
- package/dist/contexts/Organization/OrganizationContext.d.ts +74 -0
- package/dist/contexts/Organization/OrganizationProvider.d.ts +90 -0
- package/dist/contexts/Organization/useOrganization.d.ts +104 -0
- package/dist/contexts/Theme/types.d.ts +38 -9
- package/dist/contexts/User/UserContext.d.ts +3 -2
- package/dist/contexts/User/UserProvider.d.ts +2 -1
- package/dist/hooks/useForm.d.ts +52 -52
- package/dist/index.d.ts +53 -1
- package/dist/index.js +9725 -17303
- package/dist/index.js.map +4 -4
- package/package.json +1 -1
- package/dist/api/scim2/getMeProfile.d.ts +0 -39
- package/dist/api/scim2/getSchemas.d.ts +0 -39
- package/dist/api/scim2/updateMeProfile.d.ts +0 -38
package/dist/hooks/useForm.d.ts
CHANGED
|
@@ -19,131 +19,131 @@
|
|
|
19
19
|
* Generic form field configuration
|
|
20
20
|
*/
|
|
21
21
|
export interface FormField {
|
|
22
|
+
initialValue?: string;
|
|
22
23
|
name: string;
|
|
23
24
|
required?: boolean;
|
|
24
|
-
initialValue?: string;
|
|
25
25
|
validator?: (value: string) => string | null;
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
28
|
* Form validation result
|
|
29
29
|
*/
|
|
30
30
|
export interface ValidationResult {
|
|
31
|
-
isValid: boolean;
|
|
32
31
|
errors: Record<string, string>;
|
|
32
|
+
isValid: boolean;
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
35
|
* Configuration for the useForm hook
|
|
36
36
|
*/
|
|
37
37
|
export interface UseFormConfig<T extends Record<string, string>> {
|
|
38
|
-
/**
|
|
39
|
-
* Initial form values
|
|
40
|
-
*/
|
|
41
|
-
initialValues?: Partial<T>;
|
|
42
38
|
/**
|
|
43
39
|
* Form field definitions
|
|
44
40
|
*/
|
|
45
41
|
fields?: FormField[];
|
|
46
42
|
/**
|
|
47
|
-
*
|
|
43
|
+
* Initial form values
|
|
48
44
|
*/
|
|
49
|
-
|
|
45
|
+
initialValues?: Partial<T>;
|
|
50
46
|
/**
|
|
51
|
-
*
|
|
47
|
+
* Custom required field validation message
|
|
52
48
|
*/
|
|
53
|
-
|
|
49
|
+
requiredMessage?: string;
|
|
54
50
|
/**
|
|
55
51
|
* Whether to validate on blur (default: true)
|
|
56
52
|
*/
|
|
57
53
|
validateOnBlur?: boolean;
|
|
58
54
|
/**
|
|
59
|
-
*
|
|
55
|
+
* Whether to validate on change (default: false)
|
|
60
56
|
*/
|
|
61
|
-
|
|
57
|
+
validateOnChange?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Global form validator function
|
|
60
|
+
*/
|
|
61
|
+
validator?: (values: T) => Record<string, string>;
|
|
62
62
|
}
|
|
63
63
|
/**
|
|
64
64
|
* Return type for the useForm hook
|
|
65
65
|
*/
|
|
66
66
|
export interface UseFormReturn<T extends Record<string, string>> {
|
|
67
67
|
/**
|
|
68
|
-
*
|
|
69
|
-
*/
|
|
70
|
-
values: T;
|
|
71
|
-
/**
|
|
72
|
-
* Fields that have been touched by the user
|
|
68
|
+
* Clear all errors
|
|
73
69
|
*/
|
|
74
|
-
|
|
70
|
+
clearErrors: () => void;
|
|
75
71
|
/**
|
|
76
72
|
* Current validation errors
|
|
77
73
|
*/
|
|
78
74
|
errors: Record<keyof T, string>;
|
|
79
75
|
/**
|
|
80
|
-
*
|
|
76
|
+
* Get field props for easy integration with form components
|
|
81
77
|
*/
|
|
82
|
-
|
|
78
|
+
getFieldProps: (name: keyof T) => {
|
|
79
|
+
error: string | undefined;
|
|
80
|
+
name: keyof T;
|
|
81
|
+
onBlur: () => void;
|
|
82
|
+
onChange: (value: string) => void;
|
|
83
|
+
required: boolean;
|
|
84
|
+
touched: boolean;
|
|
85
|
+
value: string;
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* Handle form submission
|
|
89
|
+
*/
|
|
90
|
+
handleSubmit: (onSubmit: (values: T) => void | Promise<void>) => (e?: React.FormEvent) => Promise<void>;
|
|
83
91
|
/**
|
|
84
92
|
* Whether the form has been submitted
|
|
85
93
|
*/
|
|
86
94
|
isSubmitted: boolean;
|
|
87
95
|
/**
|
|
88
|
-
*
|
|
96
|
+
* Whether the form is currently valid
|
|
89
97
|
*/
|
|
90
|
-
|
|
98
|
+
isValid: boolean;
|
|
91
99
|
/**
|
|
92
|
-
*
|
|
100
|
+
* Reset the form to initial values
|
|
93
101
|
*/
|
|
94
|
-
|
|
102
|
+
reset: () => void;
|
|
95
103
|
/**
|
|
96
|
-
*
|
|
104
|
+
* Set a field error
|
|
97
105
|
*/
|
|
98
|
-
|
|
106
|
+
setError: (name: keyof T, error: string) => void;
|
|
99
107
|
/**
|
|
100
|
-
*
|
|
108
|
+
* Set multiple field errors
|
|
101
109
|
*/
|
|
102
|
-
|
|
110
|
+
setErrors: (errors: Partial<Record<keyof T, string>>) => void;
|
|
103
111
|
/**
|
|
104
|
-
* Mark
|
|
112
|
+
* Mark a field as touched
|
|
105
113
|
*/
|
|
106
|
-
|
|
114
|
+
setTouched: (name: keyof T, touched?: boolean) => void;
|
|
107
115
|
/**
|
|
108
|
-
*
|
|
116
|
+
* Mark multiple fields as touched
|
|
109
117
|
*/
|
|
110
|
-
|
|
118
|
+
setTouchedFields: (touched: Partial<Record<keyof T, boolean>>) => void;
|
|
111
119
|
/**
|
|
112
|
-
* Set
|
|
120
|
+
* Set a single field value
|
|
113
121
|
*/
|
|
114
|
-
|
|
122
|
+
setValue: (name: keyof T, value: string) => void;
|
|
115
123
|
/**
|
|
116
|
-
*
|
|
124
|
+
* Set multiple field values
|
|
117
125
|
*/
|
|
118
|
-
|
|
126
|
+
setValues: (values: Partial<T>) => void;
|
|
119
127
|
/**
|
|
120
|
-
*
|
|
128
|
+
* Mark all fields as touched
|
|
121
129
|
*/
|
|
122
|
-
|
|
130
|
+
touchAllFields: () => void;
|
|
123
131
|
/**
|
|
124
132
|
* Validate all fields
|
|
125
133
|
*/
|
|
126
134
|
validateForm: () => ValidationResult;
|
|
127
135
|
/**
|
|
128
|
-
*
|
|
136
|
+
* Current form values
|
|
129
137
|
*/
|
|
130
|
-
|
|
138
|
+
values: T;
|
|
131
139
|
/**
|
|
132
|
-
*
|
|
140
|
+
* Validate a single field
|
|
133
141
|
*/
|
|
134
|
-
|
|
142
|
+
validateField: (name: keyof T) => string | null;
|
|
135
143
|
/**
|
|
136
|
-
*
|
|
144
|
+
* Fields that have been touched by the user
|
|
137
145
|
*/
|
|
138
|
-
|
|
139
|
-
name: keyof T;
|
|
140
|
-
value: string;
|
|
141
|
-
onChange: (value: string) => void;
|
|
142
|
-
onBlur: () => void;
|
|
143
|
-
error: string | undefined;
|
|
144
|
-
touched: boolean;
|
|
145
|
-
required: boolean;
|
|
146
|
-
};
|
|
146
|
+
touched: Record<keyof T, boolean>;
|
|
147
147
|
}
|
|
148
148
|
/**
|
|
149
149
|
* Generic form hook that provides comprehensive form state management and validation.
|
package/dist/index.d.ts
CHANGED
|
@@ -27,6 +27,12 @@ export { default as UserProvider } from './contexts/User/UserProvider';
|
|
|
27
27
|
export * from './contexts/User/UserProvider';
|
|
28
28
|
export { default as useUser } from './contexts/User/useUser';
|
|
29
29
|
export * from './contexts/User/useUser';
|
|
30
|
+
export { default as OrganizationContext } from './contexts/Organization/OrganizationContext';
|
|
31
|
+
export * from './contexts/Organization/OrganizationContext';
|
|
32
|
+
export { default as OrganizationProvider } from './contexts/Organization/OrganizationProvider';
|
|
33
|
+
export * from './contexts/Organization/OrganizationProvider';
|
|
34
|
+
export { default as useOrganization } from './contexts/Organization/useOrganization';
|
|
35
|
+
export * from './contexts/Organization/useOrganization';
|
|
30
36
|
export { default as FlowContext } from './contexts/Flow/FlowContext';
|
|
31
37
|
export * from './contexts/Flow/FlowContext';
|
|
32
38
|
export { default as FlowProvider } from './contexts/Flow/FlowProvider';
|
|
@@ -67,10 +73,16 @@ export { default as SignedIn } from './components/control/SignedIn';
|
|
|
67
73
|
export * from './components/control/SignedIn';
|
|
68
74
|
export { default as SignedOut } from './components/control/SignedOut';
|
|
69
75
|
export * from './components/control/SignedOut';
|
|
76
|
+
export { default as AsgardeoLoading } from './components/control/AsgardeoLoading';
|
|
77
|
+
export * from './components/control/AsgardeoLoading';
|
|
70
78
|
export { default as BaseSignIn } from './components/presentation/SignIn/BaseSignIn';
|
|
71
79
|
export * from './components/presentation/SignIn/BaseSignIn';
|
|
72
80
|
export { default as SignIn } from './components/presentation/SignIn/SignIn';
|
|
73
81
|
export * from './components/presentation/SignIn/SignIn';
|
|
82
|
+
export { default as BaseSignUp } from './components/presentation/SignUp/BaseSignUp';
|
|
83
|
+
export * from './components/presentation/SignUp/BaseSignUp';
|
|
84
|
+
export { default as SignUp } from './components/presentation/SignUp/SignUp';
|
|
85
|
+
export * from './components/presentation/SignUp/SignUp';
|
|
74
86
|
export { default as IdentifierFirst } from './components/presentation/SignIn/options/IdentifierFirst';
|
|
75
87
|
export { default as UsernamePassword } from './components/presentation/SignIn/options/UsernamePassword';
|
|
76
88
|
export { default as GoogleButton } from './components/presentation/SignIn/options/GoogleButton';
|
|
@@ -89,6 +101,10 @@ export { default as BaseUser } from './components/presentation/User/BaseUser';
|
|
|
89
101
|
export * from './components/presentation/User/BaseUser';
|
|
90
102
|
export { default as User } from './components/presentation/User/User';
|
|
91
103
|
export * from './components/presentation/User/User';
|
|
104
|
+
export { default as BaseOrganization } from './components/presentation/Organization/BaseOrganization';
|
|
105
|
+
export * from './components/presentation/Organization/BaseOrganization';
|
|
106
|
+
export { default as Organization } from './components/presentation/Organization/Organization';
|
|
107
|
+
export * from './components/presentation/Organization/Organization';
|
|
92
108
|
export { default as BaseUserProfile } from './components/presentation/UserProfile/BaseUserProfile';
|
|
93
109
|
export * from './components/presentation/UserProfile/BaseUserProfile';
|
|
94
110
|
export { default as UserProfile } from './components/presentation/UserProfile/UserProfile';
|
|
@@ -97,6 +113,22 @@ export { default as BaseUserDropdown } from './components/presentation/UserDropd
|
|
|
97
113
|
export * from './components/presentation/UserDropdown/BaseUserDropdown';
|
|
98
114
|
export { default as UserDropdown } from './components/presentation/UserDropdown/UserDropdown';
|
|
99
115
|
export * from './components/presentation/UserDropdown/UserDropdown';
|
|
116
|
+
export { default as BaseOrganizationSwitcher } from './components/presentation/OrganizationSwitcher/BaseOrganizationSwitcher';
|
|
117
|
+
export * from './components/presentation/OrganizationSwitcher/BaseOrganizationSwitcher';
|
|
118
|
+
export { default as OrganizationSwitcher } from './components/presentation/OrganizationSwitcher/OrganizationSwitcher';
|
|
119
|
+
export * from './components/presentation/OrganizationSwitcher/OrganizationSwitcher';
|
|
120
|
+
export { default as BaseOrganizationList } from './components/presentation/OrganizationList/BaseOrganizationList';
|
|
121
|
+
export * from './components/presentation/OrganizationList/BaseOrganizationList';
|
|
122
|
+
export { default as OrganizationList } from './components/presentation/OrganizationList/OrganizationList';
|
|
123
|
+
export * from './components/presentation/OrganizationList/OrganizationList';
|
|
124
|
+
export { default as BaseOrganizationProfile } from './components/presentation/OrganizationProfile/BaseOrganizationProfile';
|
|
125
|
+
export * from './components/presentation/OrganizationProfile/BaseOrganizationProfile';
|
|
126
|
+
export { default as OrganizationProfile } from './components/presentation/OrganizationProfile/OrganizationProfile';
|
|
127
|
+
export * from './components/presentation/OrganizationProfile/OrganizationProfile';
|
|
128
|
+
export { BaseCreateOrganization } from './components/presentation/CreateOrganization/BaseCreateOrganization';
|
|
129
|
+
export * from './components/presentation/CreateOrganization/BaseCreateOrganization';
|
|
130
|
+
export { CreateOrganization } from './components/presentation/CreateOrganization/CreateOrganization';
|
|
131
|
+
export * from './components/presentation/CreateOrganization/CreateOrganization';
|
|
100
132
|
export { default as Button } from './components/primitives/Button/Button';
|
|
101
133
|
export * from './components/primitives/Button/Button';
|
|
102
134
|
export { default as Card } from './components/primitives/Card/Card';
|
|
@@ -119,6 +151,8 @@ export { default as FormControl } from './components/primitives/FormControl/Form
|
|
|
119
151
|
export * from './components/primitives/FormControl/FormControl';
|
|
120
152
|
export { default as InputLabel } from './components/primitives/InputLabel/InputLabel';
|
|
121
153
|
export * from './components/primitives/InputLabel/InputLabel';
|
|
154
|
+
export { default as KeyValueInput } from './components/primitives/KeyValueInput/KeyValueInput';
|
|
155
|
+
export * from './components/primitives/KeyValueInput/KeyValueInput';
|
|
122
156
|
export { default as Typography } from './components/primitives/Typography/Typography';
|
|
123
157
|
export * from './components/primitives/Typography/Typography';
|
|
124
158
|
export { default as Divider } from './components/primitives/Divider/Divider';
|
|
@@ -131,7 +165,25 @@ export { default as CircleCheck } from './components/primitives/Icons/CircleChec
|
|
|
131
165
|
export { default as CircleAlert } from './components/primitives/Icons/CircleAlert';
|
|
132
166
|
export { default as TriangleAlert } from './components/primitives/Icons/TriangleAlert';
|
|
133
167
|
export { default as Info } from './components/primitives/Icons/Info';
|
|
134
|
-
export {
|
|
168
|
+
export { default as UserIcon } from './components/primitives/Icons/User';
|
|
169
|
+
export { default as LogOut } from './components/primitives/Icons/LogOut';
|
|
170
|
+
export { createField, FieldFactory, validateFieldValue } from './components/factories/FieldFactory';
|
|
135
171
|
export * from './components/factories/FieldFactory';
|
|
136
172
|
export type { FlowStep, FlowMessage, FlowContextValue } from './contexts/Flow/FlowContext';
|
|
137
173
|
export type { FlowProviderProps } from './contexts/Flow/FlowProvider';
|
|
174
|
+
export { default as getAllOrganizations } from './api/getAllOrganizations';
|
|
175
|
+
export { default as createOrganization } from './api/createOrganization';
|
|
176
|
+
export { default as getMeOrganizations } from './api/getMeOrganizations';
|
|
177
|
+
export { default as getOrganization } from './api/getOrganization';
|
|
178
|
+
export { default as updateOrganization, createPatchOperations } from './api/updateOrganization';
|
|
179
|
+
export { default as getSchemas } from './api/getSchemas';
|
|
180
|
+
export { default as updateMeProfile } from './api/updateMeProfile';
|
|
181
|
+
export type { GetAllOrganizationsConfig } from './api/getAllOrganizations';
|
|
182
|
+
export type { CreateOrganizationConfig } from './api/createOrganization';
|
|
183
|
+
export type { GetMeOrganizationsConfig } from './api/getMeOrganizations';
|
|
184
|
+
export type { GetOrganizationConfig } from './api/getOrganization';
|
|
185
|
+
export type { UpdateOrganizationConfig } from './api/updateOrganization';
|
|
186
|
+
export type { GetSchemasConfig } from './api/getSchemas';
|
|
187
|
+
export type { UpdateMeProfileConfig } from './api/updateMeProfile';
|
|
188
|
+
export { default as getMeProfile } from './api/getScim2Me';
|
|
189
|
+
export * from './api/getScim2Me';
|