@asgardeo/react 0.13.0 → 0.13.2
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/cjs/index.js +1618 -1375
- package/dist/cjs/index.js.map +4 -4
- package/dist/components/presentation/auth/AuthOptionFactory.d.ts +14 -1
- package/dist/{utils/v2/resolveTranslation.d.ts → components/primitives/Icons/ArrowLeftRight.d.ts} +11 -9
- package/dist/components/primitives/Icons/flowIconRegistry.d.ts +28 -0
- package/dist/components/primitives/Icons/index.d.ts +1 -0
- package/dist/contexts/Asgardeo/AsgardeoContext.d.ts +13 -0
- package/dist/contexts/I18n/I18nContext.d.ts +5 -0
- package/dist/index.js +1126 -885
- package/dist/index.js.map +4 -4
- package/dist/utils/v2/flowTransformer.d.ts +3 -3
- package/dist/utils/v2/resolveTranslationsInArray.d.ts +4 -2
- package/dist/utils/v2/resolveTranslationsInObject.d.ts +5 -3
- package/package.json +4 -3
|
@@ -15,8 +15,9 @@
|
|
|
15
15
|
* specific language governing permissions and limitations
|
|
16
16
|
* under the License.
|
|
17
17
|
*/
|
|
18
|
-
import { EmbeddedFlowComponentV2 as EmbeddedFlowComponent } from '@asgardeo/browser';
|
|
18
|
+
import { FlowMetadataResponse, EmbeddedFlowComponentV2 as EmbeddedFlowComponent } from '@asgardeo/browser';
|
|
19
19
|
import { ReactElement } from 'react';
|
|
20
|
+
import { UseTranslation } from '../../../hooks/useTranslation';
|
|
20
21
|
export type AuthType = 'signin' | 'signup';
|
|
21
22
|
/**
|
|
22
23
|
* Processes an array of components and renders them as React elements for sign-in.
|
|
@@ -24,9 +25,13 @@ export type AuthType = 'signin' | 'signup';
|
|
|
24
25
|
export declare const renderSignInComponents: (components: EmbeddedFlowComponent[], formValues: Record<string, string>, touchedFields: Record<string, boolean>, formErrors: Record<string, string>, isLoading: boolean, isFormValid: boolean, onInputChange: (name: string, value: string) => void, options?: {
|
|
25
26
|
buttonClassName?: string;
|
|
26
27
|
inputClassName?: string;
|
|
28
|
+
/** Flow metadata for resolving {{meta(...)}} expressions at render time */
|
|
29
|
+
meta?: FlowMetadataResponse | null;
|
|
27
30
|
onInputBlur?: (name: string) => void;
|
|
28
31
|
onSubmit?: (component: EmbeddedFlowComponent, data?: Record<string, any>, skipValidation?: boolean) => void;
|
|
29
32
|
size?: "small" | "medium" | "large";
|
|
33
|
+
/** Translation function for resolving {{t(...)}} expressions at render time */
|
|
34
|
+
t?: UseTranslation["t"];
|
|
30
35
|
variant?: any;
|
|
31
36
|
}) => ReactElement[];
|
|
32
37
|
/**
|
|
@@ -35,9 +40,13 @@ export declare const renderSignInComponents: (components: EmbeddedFlowComponent[
|
|
|
35
40
|
export declare const renderSignUpComponents: (components: EmbeddedFlowComponent[], formValues: Record<string, string>, touchedFields: Record<string, boolean>, formErrors: Record<string, string>, isLoading: boolean, isFormValid: boolean, onInputChange: (name: string, value: string) => void, options?: {
|
|
36
41
|
buttonClassName?: string;
|
|
37
42
|
inputClassName?: string;
|
|
43
|
+
/** Flow metadata for resolving {{meta(...)}} expressions at render time */
|
|
44
|
+
meta?: FlowMetadataResponse | null;
|
|
38
45
|
onInputBlur?: (name: string) => void;
|
|
39
46
|
onSubmit?: (component: EmbeddedFlowComponent, data?: Record<string, any>, skipValidation?: boolean) => void;
|
|
40
47
|
size?: "small" | "medium" | "large";
|
|
48
|
+
/** Translation function for resolving {{t(...)}} expressions at render time */
|
|
49
|
+
t?: UseTranslation["t"];
|
|
41
50
|
variant?: any;
|
|
42
51
|
}) => ReactElement[];
|
|
43
52
|
/**
|
|
@@ -47,8 +56,12 @@ export declare const renderSignUpComponents: (components: EmbeddedFlowComponent[
|
|
|
47
56
|
export declare const renderInviteUserComponents: (components: EmbeddedFlowComponent[], formValues: Record<string, string>, touchedFields: Record<string, boolean>, formErrors: Record<string, string>, isLoading: boolean, isFormValid: boolean, onInputChange: (name: string, value: string) => void, options?: {
|
|
48
57
|
buttonClassName?: string;
|
|
49
58
|
inputClassName?: string;
|
|
59
|
+
/** Flow metadata for resolving {{meta(...)}} expressions at render time */
|
|
60
|
+
meta?: FlowMetadataResponse | null;
|
|
50
61
|
onInputBlur?: (name: string) => void;
|
|
51
62
|
onSubmit?: (component: EmbeddedFlowComponent, data?: Record<string, any>, skipValidation?: boolean) => void;
|
|
52
63
|
size?: "small" | "medium" | "large";
|
|
64
|
+
/** Translation function for resolving {{t(...)}} expressions at render time */
|
|
65
|
+
t?: UseTranslation["t"];
|
|
53
66
|
variant?: any;
|
|
54
67
|
}) => ReactElement[];
|
package/dist/{utils/v2/resolveTranslation.d.ts → components/primitives/Icons/ArrowLeftRight.d.ts}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c)
|
|
2
|
+
* Copyright (c) 2026, 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,13 +15,15 @@
|
|
|
15
15
|
* specific language governing permissions and limitations
|
|
16
16
|
* under the License.
|
|
17
17
|
*/
|
|
18
|
-
import {
|
|
18
|
+
import { FC } from 'react';
|
|
19
|
+
export interface ArrowLeftRightProps {
|
|
20
|
+
/** Color of the icon stroke */
|
|
21
|
+
color?: string;
|
|
22
|
+
/** Icon size in pixels */
|
|
23
|
+
size?: number;
|
|
24
|
+
}
|
|
19
25
|
/**
|
|
20
|
-
*
|
|
21
|
-
* If the text is not a translation string, returns the original text.
|
|
22
|
-
* @param text - The text to resolve (could be a translation string or regular text)
|
|
23
|
-
* @param t - The translation function from useTranslation
|
|
24
|
-
* @returns The resolved text
|
|
26
|
+
* ArrowLeftRight Icon component (lucide-compatible).
|
|
25
27
|
*/
|
|
26
|
-
|
|
27
|
-
export default
|
|
28
|
+
declare const ArrowLeftRight: FC<ArrowLeftRightProps>;
|
|
29
|
+
export default ArrowLeftRight;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, 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
|
+
export interface FlowIconProps {
|
|
20
|
+
color?: string;
|
|
21
|
+
size?: number;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Registry of icon components keyed by their lucide-compatible name.
|
|
25
|
+
* Add new icons here as needed by flow definitions.
|
|
26
|
+
*/
|
|
27
|
+
declare const flowIconRegistry: Record<string, FC<FlowIconProps>>;
|
|
28
|
+
export default flowIconRegistry;
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
* specific language governing permissions and limitations
|
|
16
16
|
* under the License.
|
|
17
17
|
*/
|
|
18
|
+
export { default as ArrowLeftRight } from './ArrowLeftRight';
|
|
18
19
|
export { default as CircleAlert } from './CircleAlert';
|
|
19
20
|
export { default as CircleCheck } from './CircleCheck';
|
|
20
21
|
export { default as Eye } from './Eye';
|
|
@@ -103,6 +103,19 @@ export type AsgardeoContextProps = {
|
|
|
103
103
|
* @returns Promise resolving to boolean indicating success.
|
|
104
104
|
*/
|
|
105
105
|
reInitialize: (config: Partial<AsgardeoReactConfig>) => Promise<boolean>;
|
|
106
|
+
/**
|
|
107
|
+
* Resolves `{{ t(key) }}` and `{{ meta(path) }}` template expressions in a string,
|
|
108
|
+
* using the current i18n translation function and flow metadata from context.
|
|
109
|
+
*
|
|
110
|
+
* Useful in render-props patterns where consumers need to expand template strings
|
|
111
|
+
* that come from the server (e.g. component labels, placeholders, headings).
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* const {resolveVars} = useAsgardeo();
|
|
115
|
+
* resolveVars('{{ t(signin.heading.label) }}') // → 'Sign In'
|
|
116
|
+
* resolveVars('Login to {{ meta(application.name) }}') // → 'Login to My App'
|
|
117
|
+
*/
|
|
118
|
+
resolveVars: (text: string | undefined) => string;
|
|
106
119
|
/**
|
|
107
120
|
* Sign-in function to initiate the authentication process.
|
|
108
121
|
* @remark This is the programmatic version of the `SignInButton` component.
|
|
@@ -30,6 +30,11 @@ export interface I18nContextValue {
|
|
|
30
30
|
* The fallback language code
|
|
31
31
|
*/
|
|
32
32
|
fallbackLanguage: string;
|
|
33
|
+
/**
|
|
34
|
+
* Injects additional bundles into the i18n system (e.g., from flow metadata).
|
|
35
|
+
* Injected bundles take precedence over defaults but are overridden by prop-provided bundles.
|
|
36
|
+
*/
|
|
37
|
+
injectBundles: (bundles: Record<string, I18nBundle>) => void;
|
|
33
38
|
/**
|
|
34
39
|
* Function to change the current language
|
|
35
40
|
*/
|