@monei-js/components 1.7.10 → 2.1.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 (56) hide show
  1. package/README.md +100 -9
  2. package/dist/chunk.js +13 -0
  3. package/dist/index.cjs +1643 -0
  4. package/dist/index.d.cts +528 -0
  5. package/dist/index.d.ts +526 -14
  6. package/dist/index.js +1616 -7
  7. package/dist/monei.umd.production.min.js +64 -0
  8. package/dist/monei.umd.production.min.js.map +1 -0
  9. package/package.json +42 -65
  10. package/src/bridge/types.ts +106 -0
  11. package/dist/api.d.ts +0 -13
  12. package/dist/bizum/container.d.ts +0 -4
  13. package/dist/bizum/index.d.ts +0 -5
  14. package/dist/bizum/modal.d.ts +0 -3
  15. package/dist/bizum/types.d.ts +0 -30
  16. package/dist/cardInput/index.d.ts +0 -8
  17. package/dist/cardInput/types.d.ts +0 -51
  18. package/dist/click2pay/container.d.ts +0 -4
  19. package/dist/click2pay/index.d.ts +0 -5
  20. package/dist/click2pay/modal.d.ts +0 -3
  21. package/dist/click2pay/types.d.ts +0 -23
  22. package/dist/cofidis/container.d.ts +0 -4
  23. package/dist/cofidis/index.d.ts +0 -6
  24. package/dist/cofidis/modal.d.ts +0 -3
  25. package/dist/cofidis/types.d.ts +0 -45
  26. package/dist/cofidis/widget.d.ts +0 -3
  27. package/dist/cofidisLoan/container.d.ts +0 -4
  28. package/dist/cofidisLoan/index.d.ts +0 -7
  29. package/dist/cofidisLoan/modal.d.ts +0 -4
  30. package/dist/cofidisLoan/types.d.ts +0 -45
  31. package/dist/cofidisLoan/widget.d.ts +0 -4
  32. package/dist/components.cjs.development.js +0 -18997
  33. package/dist/components.cjs.development.js.map +0 -1
  34. package/dist/components.cjs.production.min.js +0 -2
  35. package/dist/components.cjs.production.min.js.map +0 -1
  36. package/dist/components.esm.js +0 -18979
  37. package/dist/components.esm.js.map +0 -1
  38. package/dist/config.d.ts +0 -28
  39. package/dist/container.d.ts +0 -1
  40. package/dist/enums.d.ts +0 -4
  41. package/dist/googlePay/index.d.ts +0 -4
  42. package/dist/googlePay/types.d.ts +0 -21
  43. package/dist/paymentModal/container.d.ts +0 -4
  44. package/dist/paymentModal/index.d.ts +0 -6
  45. package/dist/paymentModal/types.d.ts +0 -28
  46. package/dist/paymentRequest/index.d.ts +0 -4
  47. package/dist/paymentRequest/types.d.ts +0 -22
  48. package/dist/paypal/index.d.ts +0 -4
  49. package/dist/paypal/types.d.ts +0 -27
  50. package/dist/types.d.ts +0 -194
  51. package/dist/utils.d.ts +0 -11
  52. package/types/belter.d.ts +0 -1
  53. package/types/component.d.ts +0 -196
  54. package/types/css.d.ts +0 -9
  55. package/types/global.d.ts +0 -3
  56. package/types/post-robot.d.ts +0 -1
package/README.md CHANGED
@@ -1,16 +1,107 @@
1
- # MONEI Components
1
+ # @monei-js/components
2
2
 
3
- MONEI UI Components enable you to collect sensitive payment information using customizable UI components.
3
+ MONEI UI Components drop-in payment UI for the web. Renders secure iframes for card input, PayPal, Bizum, Apple Pay, and a full payment modal. Works with any framework or vanilla JS.
4
4
 
5
- UI components include features like:
5
+ ## Framework Packages
6
6
 
7
- Formatting card information automatically as it’s entered
8
- Translating placeholders into your customer’s preferred language
9
- Using responsive design to fit the width of your customer’s screen or mobile device
10
- Customizing the styling to match the look and feel of your checkout flow
7
+ For framework-specific components with idiomatic APIs and full type support:
11
8
 
12
- For creating payments on your server, use [@monei-js/node-sdk](https://github.com/MONEI/monei-node-sdk)
9
+ | Package | Framework | Install |
10
+ | ------------------------------ | ----------- | ------------------------------------ |
11
+ | `@monei-js/react-components` | React 17+ | `npm i @monei-js/react-components` |
12
+ | `@monei-js/vue-components` | Vue 3.3+ | `npm i @monei-js/vue-components` |
13
+ | `@monei-js/angular-components` | Angular 14+ | `npm i @monei-js/angular-components` |
14
+ | `@monei-js/svelte-components` | Svelte 5+ | `npm i @monei-js/svelte-components` |
15
+
16
+ All framework packages require `@monei-js/components` as a peer dependency for API functions (`confirmPayment`, `api`, etc.).
17
+
18
+ ## Install
19
+
20
+ ```bash
21
+ npm install @monei-js/components
22
+ ```
23
+
24
+ Or load via CDN:
25
+
26
+ ```html
27
+ <script src="https://js.monei.com/v3/monei.js"></script>
28
+ ```
29
+
30
+ ## Components
31
+
32
+ | Component | Description |
33
+ | ---------------- | -------------------------------------------- |
34
+ | `CardInput` | Secure card number/expiry/CVC input (iframe) |
35
+ | `PaymentModal` | Full-screen payment flow modal |
36
+ | `Bizum` | Bizum button + phone verification modal |
37
+ | `PayPal` | PayPal checkout button |
38
+ | `PaymentRequest` | Apple Pay / browser Payment Request button |
39
+
40
+ ## Quick Start (Vanilla JS)
41
+
42
+ ```js
43
+ import {CardInput, confirmPayment} from '@monei-js/components';
44
+
45
+ const cardInput = CardInput({
46
+ paymentId: 'pay_...',
47
+ onChange({isTouched, error, cardType}) {
48
+ // handle validation state
49
+ }
50
+ });
51
+ cardInput.render('#card-input');
52
+
53
+ // Tokenize and confirm
54
+ const {token} = await cardInput.submit();
55
+ const result = await confirmPayment({paymentId: 'pay_...', paymentToken: token});
56
+ ```
57
+
58
+ ## API
59
+
60
+ Exported via `api` namespace:
61
+
62
+ - `confirmPayment({paymentId, ...})` — confirm a payment with token
63
+ - `getPaymentMethods({accountId | paymentId})` — list available payment methods
64
+ - `getPayment(paymentId)` — fetch payment status
65
+ - `createPayment({accountId, amount, currency, ...})` — create a client-side payment (POS)
66
+ - `sendPaymentReceipt({paymentId, customerEmail, ...})` — send receipt email
67
+
68
+ ## Migrating from `createToken`
69
+
70
+ Before:
71
+
72
+ ```js
73
+ import {CardInput, createToken} from '@monei-js/components';
74
+
75
+ const cardInput = CardInput({paymentId: 'pay_...'});
76
+ cardInput.render('#card-input');
77
+ const {token} = await createToken(cardInput);
78
+ ```
79
+
80
+ After (instance `submit()`):
81
+
82
+ ```js
83
+ import {CardInput} from '@monei-js/components';
84
+
85
+ const cardInput = CardInput({paymentId: 'pay_...'});
86
+ cardInput.render('#card-input');
87
+ const {token} = await cardInput.submit({cardholderName: 'John'});
88
+ ```
89
+
90
+ `createToken()` still works but logs a deprecation warning.
91
+
92
+ ## Deprecated APIs
93
+
94
+ - **`.driver()`** — Use the framework-specific packages above instead. `.driver('react')` → `@monei-js/react-components`, `.driver('vue3')` → `@monei-js/vue-components`, `.driver('angular')` → `@monei-js/angular-components`.
95
+ - **`createToken(instance)`** — Use `instance.submit()` instead (see above).
96
+
97
+ ## Server-Side
98
+
99
+ For creating payments on your server, use [@monei-js/node-sdk](https://github.com/MONEI/monei-node-sdk).
13
100
 
14
101
  ## Documentation
15
102
 
16
- Check full documentation in our [Documentation portal](https://docs.monei.com/docs/monei-js-overview)
103
+ Full docs: [docs.monei.com/docs/monei-js-overview](https://docs.monei.com/docs/monei-js-overview)
104
+
105
+ ## License
106
+
107
+ MIT
package/dist/chunk.js ADDED
@@ -0,0 +1,13 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __defProp = Object.defineProperty;
3
+ var __exportAll = (all, no_symbols) => {
4
+ let target = {};
5
+ for (var name in all) __defProp(target, name, {
6
+ get: all[name],
7
+ enumerable: true
8
+ });
9
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
10
+ return target;
11
+ };
12
+ //#endregion
13
+ export { __exportAll as t };