@monei-js/react-components 2.0.1 → 2.0.3

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 CHANGED
@@ -21,8 +21,7 @@ npm install @monei-js/react-components @monei-js/components
21
21
 
22
22
  ```tsx
23
23
  import {useRef} from 'react';
24
- import {CardInput, type CardInputHandle} from '@monei-js/react-components';
25
- import {confirmPayment} from '@monei-js/components';
24
+ import {CardInput, confirmPayment, type CardInputHandle} from '@monei-js/react-components';
26
25
 
27
26
  function PaymentForm({paymentId}: {paymentId: string}) {
28
27
  const cardRef = useRef<CardInputHandle>(null);
@@ -42,14 +41,12 @@ function PaymentForm({paymentId}: {paymentId: string}) {
42
41
  }
43
42
  ```
44
43
 
45
- ## Dual-import pattern
44
+ ## API Re-exports
46
45
 
47
- Components come from this package. API functions and types come from the base package:
46
+ `confirmPayment` and `api` are re-exported from this package for convenience:
48
47
 
49
48
  ```tsx
50
- import {CardInput, Bizum} from '@monei-js/react-components';
51
- import {confirmPayment, api} from '@monei-js/components';
52
- import type {PaymentStatus} from '@monei-js/components';
49
+ import {CardInput, Bizum, confirmPayment, api} from '@monei-js/react-components';
53
50
  ```
54
51
 
55
52
  ## Migrating from `.driver('react')`
@@ -100,8 +97,7 @@ const {token} = await ref.current!.submit({cardholderName: 'John'});
100
97
 
101
98
  ```tsx
102
99
  import {useRef, useState} from 'react';
103
- import {CardInput, type CardInputHandle} from '@monei-js/react-components';
104
- import {confirmPayment} from '@monei-js/components';
100
+ import {CardInput, confirmPayment, type CardInputHandle} from '@monei-js/react-components';
105
101
 
106
102
  function PaymentForm({paymentId}: {paymentId: string}) {
107
103
  const cardRef = useRef<CardInputHandle>(null);
package/dist/index.cjs CHANGED
@@ -101,3 +101,15 @@ exports.Bizum = Bizum;
101
101
  exports.CardInput = CardInput;
102
102
  exports.PayPal = PayPal;
103
103
  exports.PaymentRequest = PaymentRequest;
104
+ Object.defineProperty(exports, "api", {
105
+ enumerable: true,
106
+ get: function() {
107
+ return _monei_js_components.api;
108
+ }
109
+ });
110
+ Object.defineProperty(exports, "confirmPayment", {
111
+ enumerable: true,
112
+ get: function() {
113
+ return _monei_js_components.confirmPayment;
114
+ }
115
+ });
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react from "react";
2
- import { BizumComponentProps, BizumComponentProps as BizumComponentProps$1, CardInputComponentProps, CardInputComponentProps as CardInputComponentProps$1, CardInputHandle, CardInputHandle as CardInputHandle$1, PayPalComponentProps, PayPalComponentProps as PayPalComponentProps$1, PaymentRequestComponentProps, PaymentRequestComponentProps as PaymentRequestComponentProps$1 } from "@monei-js/components";
2
+ import { BizumComponentProps, BizumComponentProps as BizumComponentProps$1, CardInputComponentProps, CardInputComponentProps as CardInputComponentProps$1, CardInputHandle, CardInputHandle as CardInputHandle$1, PayPalComponentProps, PayPalComponentProps as PayPalComponentProps$1, PaymentRequestComponentProps, PaymentRequestComponentProps as PaymentRequestComponentProps$1, api, confirmPayment } from "@monei-js/components";
3
3
 
4
4
  //#region src/card-input.d.ts
5
5
  declare const CardInput: react.ForwardRefExoticComponent<CardInputComponentProps$1 & react.RefAttributes<CardInputHandle$1>>;
@@ -13,4 +13,4 @@ declare const PayPal: react.ForwardRefExoticComponent<PayPalComponentProps$1 & r
13
13
  //#region src/payment-request.d.ts
14
14
  declare const PaymentRequest: react.ForwardRefExoticComponent<PaymentRequestComponentProps$1 & react.RefAttributes<unknown>>;
15
15
  //#endregion
16
- export { Bizum, type BizumComponentProps, CardInput, type CardInputComponentProps, type CardInputHandle, PayPal, type PayPalComponentProps, PaymentRequest, type PaymentRequestComponentProps };
16
+ export { Bizum, type BizumComponentProps, CardInput, type CardInputComponentProps, type CardInputHandle, PayPal, type PayPalComponentProps, PaymentRequest, type PaymentRequestComponentProps, api, confirmPayment };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { BizumComponentProps, BizumComponentProps as BizumComponentProps$1, CardInputComponentProps, CardInputComponentProps as CardInputComponentProps$1, CardInputHandle, CardInputHandle as CardInputHandle$1, PayPalComponentProps, PayPalComponentProps as PayPalComponentProps$1, PaymentRequestComponentProps, PaymentRequestComponentProps as PaymentRequestComponentProps$1 } from "@monei-js/components";
1
+ import { BizumComponentProps, BizumComponentProps as BizumComponentProps$1, CardInputComponentProps, CardInputComponentProps as CardInputComponentProps$1, CardInputHandle, CardInputHandle as CardInputHandle$1, PayPalComponentProps, PayPalComponentProps as PayPalComponentProps$1, PaymentRequestComponentProps, PaymentRequestComponentProps as PaymentRequestComponentProps$1, api, confirmPayment } from "@monei-js/components";
2
2
  import * as react from "react";
3
3
 
4
4
  //#region src/card-input.d.ts
@@ -13,4 +13,4 @@ declare const PayPal: react.ForwardRefExoticComponent<PayPalComponentProps$1 & r
13
13
  //#region src/payment-request.d.ts
14
14
  declare const PaymentRequest: react.ForwardRefExoticComponent<PaymentRequestComponentProps$1 & react.RefAttributes<unknown>>;
15
15
  //#endregion
16
- export { Bizum, type BizumComponentProps, CardInput, type CardInputComponentProps, type CardInputHandle, PayPal, type PayPalComponentProps, PaymentRequest, type PaymentRequestComponentProps };
16
+ export { Bizum, type BizumComponentProps, CardInput, type CardInputComponentProps, type CardInputHandle, PayPal, type PayPalComponentProps, PaymentRequest, type PaymentRequestComponentProps, api, confirmPayment };
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Bizum as Bizum$1, CardInput as CardInput$1, PayPal as PayPal$1, PaymentRequest as PaymentRequest$1 } from "@monei-js/components";
1
+ import { Bizum as Bizum$1, CardInput as CardInput$1, PayPal as PayPal$1, PaymentRequest as PaymentRequest$1, api, confirmPayment } from "@monei-js/components";
2
2
  import React from "react";
3
3
  //#region src/create-bridge-component.ts
4
4
  /**
@@ -73,4 +73,4 @@ const PayPal = createBridgeComponent(PayPal$1);
73
73
  //#region src/payment-request.ts
74
74
  const PaymentRequest = createBridgeComponent(PaymentRequest$1);
75
75
  //#endregion
76
- export { Bizum, CardInput, PayPal, PaymentRequest };
76
+ export { Bizum, CardInput, PayPal, PaymentRequest, api, confirmPayment };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monei-js/react-components",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
4
4
  "author": "MONEI <support@monei.com> (https://monei.com)",
5
5
  "description": "MONEI React components for accepting payments with CardInput, Bizum, PayPal, and PaymentRequest.",
6
6
  "homepage": "https://monei.com",