@jpmorgan-payments/embedded-finance-components 0.5.96 → 0.5.97
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 +102 -49
- package/dist/{2FJCTAHO-DEGBnirH.js → 2FJCTAHO-Ccp37Lea.js} +1592 -1684
- package/dist/esm/ef-components.js +1 -1
- package/dist/{index-ORpG-_-r.js → index-B7o74JTn.js} +19843 -19694
- package/dist/index.css +1 -1
- package/dist/index.d.ts +225 -38
- package/dist/mockServiceWorker.js +1 -1
- package/dist/{production-CMWcfpfg.js → production-B68ZfU8t.js} +42 -42
- package/dist/umd/ef-components.js +1498 -1498
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -10,56 +10,75 @@ While we strive to incorporate ADA (Americans with Disabilities Act) best practi
|
|
|
10
10
|
|
|
11
11
|
## Overview
|
|
12
12
|
|
|
13
|
-
Embedded UI Components
|
|
13
|
+
The Embedded UI Components library offers a seamless way to integrate sophisticated UI capabilities into your existing web applications, providing a plug-and-play solution for Embedded Finance features.
|
|
14
14
|
|
|
15
15
|
## Important Usage Notes
|
|
16
16
|
|
|
17
17
|
**All Embedded UI Components must be wrapped within the `EBComponentsProvider`.** The `EBComponentsProvider` is specifically designed for these components and is not applicable to any other client components in your application.
|
|
18
18
|
|
|
19
|
-
##
|
|
19
|
+
## Main Embedded UI Components Architecture Concepts
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
The library is built on several key architectural concepts:
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
It is using @tanstack/react-query for handling API calls and authentication as well as Orval generated types for the API requests and responses.
|
|
23
|
+
### Integration Scenarios and Use Cases
|
|
25
24
|
|
|
26
|
-
|
|
25
|
+
The Embedded UI Components are designed for flexible integration into parent web applications, offering several customization points:
|
|
27
26
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
```mermaid
|
|
28
|
+
graph LR
|
|
29
|
+
subgraph "Parent Web Application"
|
|
30
|
+
CMS["Content Management System"]
|
|
31
|
+
Theme["Theming System"]
|
|
32
|
+
RUM["Real User Monitoring"]
|
|
33
|
+
Storage[("Client ID / Platform ID / User Identity")]
|
|
34
|
+
|
|
35
|
+
subgraph "Embedded Components Integration"
|
|
36
|
+
Provider["EBComponentsProvider"]
|
|
37
|
+
Components["Embedded UI Components"]
|
|
38
|
+
|
|
39
|
+
Provider --> Components
|
|
40
|
+
end
|
|
31
41
|
|
|
32
|
-
|
|
42
|
+
CMS -->|"Content Tokens"| Provider
|
|
43
|
+
Theme -->|"Design Tokens"| Provider
|
|
44
|
+
RUM -->|"User Event Handler"| Components
|
|
45
|
+
Storage -->|"Client ID / Platform ID"| Components
|
|
46
|
+
end
|
|
47
|
+
```
|
|
33
48
|
|
|
34
|
-
|
|
35
|
-
import { EBComponentsProvider } from '@jpmorgan-payments/embedded-finance-components';
|
|
49
|
+
#### Integration Flexibility
|
|
36
50
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
51
|
+
1. **Runtime Customization**
|
|
52
|
+
|
|
53
|
+
- Inject design tokens to match parent app's theme or use the default ones
|
|
54
|
+
- Override content tokens from parent app's CMS systems or any other source
|
|
55
|
+
- Connect to parent app's monitoring via `userEventsHandler`
|
|
56
|
+
|
|
57
|
+
2. **Component Configuration**
|
|
58
|
+
- Configure API endpoints via provider
|
|
59
|
+
- Customize component behavior through props
|
|
60
|
+
|
|
61
|
+
3. **Client ID / Platform ID** (only for onboarding components)
|
|
62
|
+
- Onboarding Embedded UI Components can be used in fully controlled (client ID is provided and managed by the parent app) or uncontrolled (client ID is created from scratch by the embedded component) mode
|
|
63
|
+
- In uncontrolled mode the embedded component will create a new client and it is recommended to manage its lifecycle via the `onPostClientResponse` callback prop
|
|
64
|
+
|
|
65
|
+
#### Future Extensibility
|
|
66
|
+
|
|
67
|
+
1. **Field Configuration**
|
|
68
|
+
|
|
69
|
+
- Externalization of field mapping logic
|
|
70
|
+
- Custom field validation rules
|
|
71
|
+
- Dynamic form layout configuration
|
|
72
|
+
- Validation rules can be overridden from the parent app
|
|
57
73
|
|
|
58
|
-
|
|
74
|
+
2. **Workflow Customization**
|
|
75
|
+
- Integration with Arazzo workflow definitions
|
|
76
|
+
- Custom step sequencing
|
|
77
|
+
- Conditional flow logic
|
|
59
78
|
|
|
60
|
-
|
|
79
|
+
### Overall Logical Composition Diagram
|
|
61
80
|
|
|
62
|
-
|
|
81
|
+
**Note:** The following diagram illustrates the component architecture using the onboarding wizard as an example:
|
|
63
82
|
|
|
64
83
|
```mermaid
|
|
65
84
|
graph TB
|
|
@@ -93,14 +112,14 @@ graph TB
|
|
|
93
112
|
end
|
|
94
113
|
```
|
|
95
114
|
|
|
96
|
-
### Key
|
|
115
|
+
### Key Principles
|
|
97
116
|
|
|
98
117
|
1. **OpenAPI Specification (OAS) & Future Arazzo Flows**
|
|
99
118
|
|
|
100
119
|
- OAS defines API contracts and types
|
|
101
|
-
-
|
|
102
|
-
-
|
|
103
|
-
-
|
|
120
|
+
- Serves as source of truth for API interfaces
|
|
121
|
+
- Generates TypeScript types and React Query hooks
|
|
122
|
+
- Future: Arazzo Flows will enable automated flow generation (not currently available)
|
|
104
123
|
|
|
105
124
|
2. **Automated Code Generation**
|
|
106
125
|
|
|
@@ -108,10 +127,9 @@ graph TB
|
|
|
108
127
|
- TypeScript interfaces
|
|
109
128
|
- Type-safe React Query hooks
|
|
110
129
|
- API client utilities
|
|
111
|
-
- Future capability: Flow generation from Arazzo Flows
|
|
112
130
|
- Ensures type consistency between API and UI
|
|
113
131
|
|
|
114
|
-
3. **
|
|
132
|
+
3. **Other utility functions**
|
|
115
133
|
|
|
116
134
|
Built using generated types and hooks with an opinionated layer providing:
|
|
117
135
|
|
|
@@ -123,15 +141,46 @@ graph TB
|
|
|
123
141
|
- Cognitive load reduction
|
|
124
142
|
- Intelligent navigation
|
|
125
143
|
|
|
126
|
-
|
|
127
|
-
- Components make API calls to Platform Service Layer (PSL)
|
|
128
|
-
- PSL handles:
|
|
129
|
-
- Authentication & authorization
|
|
130
|
-
- Request forwarding to backend APIs
|
|
131
|
-
- Response processing
|
|
132
|
-
- Error handling
|
|
144
|
+
## Embedded UI Components
|
|
133
145
|
|
|
134
|
-
|
|
146
|
+
The library currently provides the following components:
|
|
147
|
+
|
|
148
|
+
### EBComponentsProvider
|
|
149
|
+
|
|
150
|
+
The `EBComponentsProvider` is a crucial wrapper component that must be placed at the top level of your Embedded UI Components implementation. It handles authentication, applies theming, and provides necessary context to all child Embedded UI Components.
|
|
151
|
+
It is using @tanstack/react-query for handling API calls and authentication as well as Orval generated types for the API requests and responses.
|
|
152
|
+
|
|
153
|
+
#### Key Props:
|
|
154
|
+
|
|
155
|
+
- `apiBaseUrl`: The base URL for API calls (required)
|
|
156
|
+
- `theme`: Customization options for the components' appearance (optional)
|
|
157
|
+
- `headers`: Custom headers for API requests (optional)
|
|
158
|
+
|
|
159
|
+
#### Usage:
|
|
160
|
+
|
|
161
|
+
```jsx
|
|
162
|
+
import { EBComponentsProvider } from '@jpmorgan-payments/embedded-finance-components';
|
|
163
|
+
|
|
164
|
+
const EmbeddedFinanceSection = () => {
|
|
165
|
+
return (
|
|
166
|
+
<EBComponentsProvider
|
|
167
|
+
apiBaseUrl="https://your-api-base-url.com"
|
|
168
|
+
theme={{
|
|
169
|
+
colorScheme: 'light',
|
|
170
|
+
variables: {
|
|
171
|
+
primaryColor: '#007bff',
|
|
172
|
+
fontFamily: 'Arial, sans-serif',
|
|
173
|
+
},
|
|
174
|
+
}}
|
|
175
|
+
headers={{
|
|
176
|
+
'Custom-Header': 'value',
|
|
177
|
+
}}
|
|
178
|
+
>
|
|
179
|
+
{/* Your Embedded UI Components go here */}
|
|
180
|
+
</EBComponentsProvider>
|
|
181
|
+
);
|
|
182
|
+
};
|
|
183
|
+
```
|
|
135
184
|
|
|
136
185
|
### 1. OnboardingWizardBasic
|
|
137
186
|
|
|
@@ -255,6 +304,8 @@ Please refer to the LinkedAccountProps interface in the codebase for more detail
|
|
|
255
304
|
|
|
256
305
|
## Theming
|
|
257
306
|
|
|
307
|
+
The library supports comprehensive theming through the EBComponentsProvider. Components can be styled to match your application's design system using theme tokens.
|
|
308
|
+
|
|
258
309
|
The `EBComponentsProvider` accepts a `theme` prop that allows for extensive customization of the components' appearance. The theme object can include the following properties:
|
|
259
310
|
|
|
260
311
|
- `colorScheme`: 'dark' | 'light' | 'system'
|
|
@@ -308,6 +359,8 @@ yarn add @jpmorgan-payments/embedded-finance-components
|
|
|
308
359
|
|
|
309
360
|
## Contributing
|
|
310
361
|
|
|
362
|
+
To contribute to the development of this library, please follow these guidelines:
|
|
363
|
+
|
|
311
364
|
### Recommended VSCode plugins:
|
|
312
365
|
|
|
313
366
|
- Prettier
|