@flash-pay/react 0.1.0 → 2.0.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.
package/dist/index.cjs.js CHANGED
@@ -1,2 +1,75 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("react/jsx-runtime"),b=require("@flash-pay/browser-sdk"),e=require("react");function j({transactionId:u,onSuccess:c,onFailure:n,onClose:s,showTitle:o,showDescription:f,showAmount:a,style:d,origin:R}){const t=e.useRef(null),i=e.useRef(c),l=e.useRef(n),y=e.useRef(s);return e.useEffect(()=>{i.current=c,l.current=n,y.current=s}),e.useEffect(()=>{if(!t.current)return;const k=b.checkout({transactionId:u,container:t.current,onSuccess:r=>i.current?.(r),onFailure:r=>l.current?.(r),onClose:r=>y.current?.(r),showTitle:o,showDescription:f,showAmount:a,style:d,origin:R});return()=>k.destroy()},[u,o,f,a,R]),S.jsx("div",{ref:t})}exports.FlashpayCheckout=j;
2
- //# sourceMappingURL=index.cjs.js.map
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ FlashpayCheckout: () => FlashpayCheckout
24
+ });
25
+ module.exports = __toCommonJS(index_exports);
26
+
27
+ // src/FlashpayCheckout.tsx
28
+ var import_browser_sdk = require("@flash-pay/browser-sdk");
29
+ var import_react = require("react");
30
+ var import_jsx_runtime = require("react/jsx-runtime");
31
+ function FlashpayCheckout({
32
+ transactionId,
33
+ onSuccess,
34
+ onFailure,
35
+ onClose,
36
+ showTitle = true,
37
+ showDescription = true,
38
+ showAmount = true,
39
+ style,
40
+ origin
41
+ }) {
42
+ const containerRef = (0, import_react.useRef)(null);
43
+ const onSuccessRef = (0, import_react.useRef)(onSuccess);
44
+ const onFailureRef = (0, import_react.useRef)(onFailure);
45
+ const onCloseRef = (0, import_react.useRef)(onClose);
46
+ const styleRef = (0, import_react.useRef)(style);
47
+ (0, import_react.useEffect)(() => {
48
+ onSuccessRef.current = onSuccess;
49
+ onFailureRef.current = onFailure;
50
+ onCloseRef.current = onClose;
51
+ styleRef.current = style;
52
+ });
53
+ (0, import_react.useEffect)(() => {
54
+ if (!containerRef.current) return;
55
+ const instance = (0, import_browser_sdk.checkout)({
56
+ transactionId,
57
+ container: containerRef.current,
58
+ onSuccess: (data) => onSuccessRef.current?.(data),
59
+ onFailure: (data) => onFailureRef.current?.(data),
60
+ onClose: (data) => onCloseRef.current?.(data),
61
+ showTitle,
62
+ showDescription,
63
+ showAmount,
64
+ style: styleRef.current,
65
+ origin
66
+ });
67
+ return () => instance.destroy();
68
+ }, [transactionId, showTitle, showDescription, showAmount, origin]);
69
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ref: containerRef });
70
+ }
71
+ // Annotate the CommonJS export names for ESM import in node:
72
+ 0 && (module.exports = {
73
+ FlashpayCheckout
74
+ });
75
+ //# sourceMappingURL=index.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":["../src/FlashpayCheckout.tsx"],"sourcesContent":["import { checkout } from \"@flash-pay/browser-sdk\";\nimport type { PaymentEventData, PaymentData } from \"@flash-pay/browser-sdk\";\nimport { useEffect, useRef } from \"react\";\n\nexport type { PaymentEventData, PaymentData };\n\nexport interface FlashpayCheckoutProps {\n transactionId: string;\n onSuccess?: (data: PaymentEventData) => void;\n onFailure?: (data: PaymentEventData) => void;\n onClose?: (data: PaymentEventData) => void;\n showTitle?: boolean;\n showDescription?: boolean;\n showAmount?: boolean;\n style?: Partial<CSSStyleDeclaration>;\n origin?: string;\n}\n\nexport function FlashpayCheckout({\n transactionId,\n onSuccess,\n onFailure,\n onClose,\n showTitle,\n showDescription,\n showAmount,\n style,\n origin,\n}: FlashpayCheckoutProps) {\n const containerRef = useRef<HTMLDivElement>(null);\n\n // Stable refs so callback identity changes don't re-initialize the SDK\n const onSuccessRef = useRef(onSuccess);\n const onFailureRef = useRef(onFailure);\n const onCloseRef = useRef(onClose);\n useEffect(() => {\n onSuccessRef.current = onSuccess;\n onFailureRef.current = onFailure;\n onCloseRef.current = onClose;\n });\n\n useEffect(() => {\n if (!containerRef.current) return;\n const instance = checkout({\n transactionId,\n container: containerRef.current,\n onSuccess: (data) => onSuccessRef.current?.(data),\n onFailure: (data) => onFailureRef.current?.(data),\n onClose: (data) => onCloseRef.current?.(data),\n showTitle,\n showDescription,\n showAmount,\n style,\n origin,\n });\n return () => instance.destroy();\n }, [transactionId, showTitle, showDescription, showAmount, origin]);\n\n return <div ref={containerRef} />;\n}\n"],"names":["FlashpayCheckout","transactionId","onSuccess","onFailure","onClose","showTitle","showDescription","showAmount","style","origin","containerRef","useRef","onSuccessRef","onFailureRef","onCloseRef","useEffect","instance","checkout","data","jsx"],"mappings":"4KAkBO,SAASA,EAAiB,CAC/B,cAAAC,EACA,UAAAC,EACA,UAAAC,EACA,QAAAC,EACA,UAAAC,EACA,gBAAAC,EACA,WAAAC,EACA,MAAAC,EACA,OAAAC,CACF,EAA0B,CACxB,MAAMC,EAAeC,EAAAA,OAAuB,IAAI,EAG1CC,EAAeD,EAAAA,OAAOT,CAAS,EAC/BW,EAAeF,EAAAA,OAAOR,CAAS,EAC/BW,EAAaH,EAAAA,OAAOP,CAAO,EACjCW,OAAAA,EAAAA,UAAU,IAAM,CACdH,EAAa,QAAUV,EACvBW,EAAa,QAAUV,EACvBW,EAAW,QAAUV,CACvB,CAAC,EAEDW,EAAAA,UAAU,IAAM,CACd,GAAI,CAACL,EAAa,QAAS,OAC3B,MAAMM,EAAWC,EAAAA,SAAS,CACxB,cAAAhB,EACA,UAAWS,EAAa,QACxB,UAAYQ,GAASN,EAAa,UAAUM,CAAI,EAChD,UAAYA,GAASL,EAAa,UAAUK,CAAI,EAChD,QAAUA,GAASJ,EAAW,UAAUI,CAAI,EAC5C,UAAAb,EACA,gBAAAC,EACA,WAAAC,EACA,MAAAC,EACA,OAAAC,CAAA,CACD,EACD,MAAO,IAAMO,EAAS,QAAA,CACxB,EAAG,CAACf,EAAeI,EAAWC,EAAiBC,EAAYE,CAAM,CAAC,EAE3DU,EAAAA,IAAC,MAAA,CAAI,IAAKT,CAAA,CAAc,CACjC"}
1
+ {"version":3,"sources":["../src/index.ts","../src/FlashpayCheckout.tsx"],"sourcesContent":["export { FlashpayCheckout } from \"./FlashpayCheckout\";\nexport type { FlashpayCheckoutProps, PaymentEventData, PaymentData } from \"./FlashpayCheckout\";\n","import { checkout } from \"@flash-pay/browser-sdk\";\nimport type { PaymentEventData, PaymentData } from \"@flash-pay/browser-sdk\";\nimport { useEffect, useRef } from \"react\";\n\nexport type { PaymentEventData, PaymentData };\n\nexport interface FlashpayCheckoutProps {\n transactionId: string;\n onSuccess?: (data: PaymentEventData) => void;\n onFailure?: (data: PaymentEventData) => void;\n onClose?: (data: PaymentEventData) => void;\n showTitle?: boolean;\n showDescription?: boolean;\n showAmount?: boolean;\n style?: Partial<CSSStyleDeclaration>;\n origin?: string;\n}\n\nexport function FlashpayCheckout({\n transactionId,\n onSuccess,\n onFailure,\n onClose,\n showTitle = true,\n showDescription = true,\n showAmount = true,\n style,\n origin,\n}: FlashpayCheckoutProps) {\n const containerRef = useRef<HTMLDivElement>(null);\n\n // Stable refs so callback / style identity changes don't re-initialize the SDK\n const onSuccessRef = useRef(onSuccess);\n const onFailureRef = useRef(onFailure);\n const onCloseRef = useRef(onClose);\n const styleRef = useRef(style);\n useEffect(() => {\n onSuccessRef.current = onSuccess;\n onFailureRef.current = onFailure;\n onCloseRef.current = onClose;\n styleRef.current = style;\n });\n\n useEffect(() => {\n if (!containerRef.current) return;\n const instance = checkout({\n transactionId,\n container: containerRef.current,\n onSuccess: (data) => onSuccessRef.current?.(data),\n onFailure: (data) => onFailureRef.current?.(data),\n onClose: (data) => onCloseRef.current?.(data),\n showTitle,\n showDescription,\n showAmount,\n style: styleRef.current,\n origin,\n });\n return () => instance.destroy();\n }, [transactionId, showTitle, showDescription, showAmount, origin]);\n\n return <div ref={containerRef} />;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,yBAAyB;AAEzB,mBAAkC;AA0DzB;AA1CF,SAAS,iBAAiB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,YAAY;AAAA,EACZ,kBAAkB;AAAA,EAClB,aAAa;AAAA,EACb;AAAA,EACA;AACF,GAA0B;AACxB,QAAM,mBAAe,qBAAuB,IAAI;AAGhD,QAAM,mBAAe,qBAAO,SAAS;AACrC,QAAM,mBAAe,qBAAO,SAAS;AACrC,QAAM,iBAAa,qBAAO,OAAO;AACjC,QAAM,eAAW,qBAAO,KAAK;AAC7B,8BAAU,MAAM;AACd,iBAAa,UAAU;AACvB,iBAAa,UAAU;AACvB,eAAW,UAAU;AACrB,aAAS,UAAU;AAAA,EACrB,CAAC;AAED,8BAAU,MAAM;AACd,QAAI,CAAC,aAAa,QAAS;AAC3B,UAAM,eAAW,6BAAS;AAAA,MACxB;AAAA,MACA,WAAW,aAAa;AAAA,MACxB,WAAW,CAAC,SAAS,aAAa,UAAU,IAAI;AAAA,MAChD,WAAW,CAAC,SAAS,aAAa,UAAU,IAAI;AAAA,MAChD,SAAS,CAAC,SAAS,WAAW,UAAU,IAAI;AAAA,MAC5C;AAAA,MACA;AAAA,MACA;AAAA,MACA,OAAO,SAAS;AAAA,MAChB;AAAA,IACF,CAAC;AACD,WAAO,MAAM,SAAS,QAAQ;AAAA,EAChC,GAAG,CAAC,eAAe,WAAW,iBAAiB,YAAY,MAAM,CAAC;AAElE,SAAO,4CAAC,SAAI,KAAK,cAAc;AACjC;","names":[]}
@@ -0,0 +1,18 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { PaymentEventData } from '@flash-pay/browser-sdk';
3
+ export { PaymentData, PaymentEventData } from '@flash-pay/browser-sdk';
4
+
5
+ interface FlashpayCheckoutProps {
6
+ transactionId: string;
7
+ onSuccess?: (data: PaymentEventData) => void;
8
+ onFailure?: (data: PaymentEventData) => void;
9
+ onClose?: (data: PaymentEventData) => void;
10
+ showTitle?: boolean;
11
+ showDescription?: boolean;
12
+ showAmount?: boolean;
13
+ style?: Partial<CSSStyleDeclaration>;
14
+ origin?: string;
15
+ }
16
+ declare function FlashpayCheckout({ transactionId, onSuccess, onFailure, onClose, showTitle, showDescription, showAmount, style, origin, }: FlashpayCheckoutProps): react_jsx_runtime.JSX.Element;
17
+
18
+ export { FlashpayCheckout, type FlashpayCheckoutProps };
package/dist/index.d.ts CHANGED
@@ -1,2 +1,18 @@
1
- export { FlashpayCheckout } from './FlashpayCheckout';
2
- export type { FlashpayCheckoutProps, PaymentEventData, PaymentData } from './FlashpayCheckout';
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { PaymentEventData } from '@flash-pay/browser-sdk';
3
+ export { PaymentData, PaymentEventData } from '@flash-pay/browser-sdk';
4
+
5
+ interface FlashpayCheckoutProps {
6
+ transactionId: string;
7
+ onSuccess?: (data: PaymentEventData) => void;
8
+ onFailure?: (data: PaymentEventData) => void;
9
+ onClose?: (data: PaymentEventData) => void;
10
+ showTitle?: boolean;
11
+ showDescription?: boolean;
12
+ showAmount?: boolean;
13
+ style?: Partial<CSSStyleDeclaration>;
14
+ origin?: string;
15
+ }
16
+ declare function FlashpayCheckout({ transactionId, onSuccess, onFailure, onClose, showTitle, showDescription, showAmount, style, origin, }: FlashpayCheckoutProps): react_jsx_runtime.JSX.Element;
17
+
18
+ export { FlashpayCheckout, type FlashpayCheckoutProps };
package/dist/index.es.js CHANGED
@@ -1,38 +1,48 @@
1
- import { jsx as y } from "react/jsx-runtime";
2
- import { checkout as C } from "@flash-pay/browser-sdk";
3
- import { useRef as e, useEffect as p } from "react";
4
- function v({
5
- transactionId: t,
6
- onSuccess: c,
7
- onFailure: u,
8
- onClose: o,
9
- showTitle: f,
10
- showDescription: s,
11
- showAmount: m,
12
- style: k,
13
- origin: R
1
+ // src/FlashpayCheckout.tsx
2
+ import { checkout } from "@flash-pay/browser-sdk";
3
+ import { useEffect, useRef } from "react";
4
+ import { jsx } from "react/jsx-runtime";
5
+ function FlashpayCheckout({
6
+ transactionId,
7
+ onSuccess,
8
+ onFailure,
9
+ onClose,
10
+ showTitle = true,
11
+ showDescription = true,
12
+ showAmount = true,
13
+ style,
14
+ origin
14
15
  }) {
15
- const n = e(null), a = e(c), i = e(u), l = e(o);
16
- return p(() => {
17
- a.current = c, i.current = u, l.current = o;
18
- }), p(() => {
19
- if (!n.current) return;
20
- const x = C({
21
- transactionId: t,
22
- container: n.current,
23
- onSuccess: (r) => a.current?.(r),
24
- onFailure: (r) => i.current?.(r),
25
- onClose: (r) => l.current?.(r),
26
- showTitle: f,
27
- showDescription: s,
28
- showAmount: m,
29
- style: k,
30
- origin: R
16
+ const containerRef = useRef(null);
17
+ const onSuccessRef = useRef(onSuccess);
18
+ const onFailureRef = useRef(onFailure);
19
+ const onCloseRef = useRef(onClose);
20
+ const styleRef = useRef(style);
21
+ useEffect(() => {
22
+ onSuccessRef.current = onSuccess;
23
+ onFailureRef.current = onFailure;
24
+ onCloseRef.current = onClose;
25
+ styleRef.current = style;
26
+ });
27
+ useEffect(() => {
28
+ if (!containerRef.current) return;
29
+ const instance = checkout({
30
+ transactionId,
31
+ container: containerRef.current,
32
+ onSuccess: (data) => onSuccessRef.current?.(data),
33
+ onFailure: (data) => onFailureRef.current?.(data),
34
+ onClose: (data) => onCloseRef.current?.(data),
35
+ showTitle,
36
+ showDescription,
37
+ showAmount,
38
+ style: styleRef.current,
39
+ origin
31
40
  });
32
- return () => x.destroy();
33
- }, [t, f, s, m, R]), /* @__PURE__ */ y("div", { ref: n });
41
+ return () => instance.destroy();
42
+ }, [transactionId, showTitle, showDescription, showAmount, origin]);
43
+ return /* @__PURE__ */ jsx("div", { ref: containerRef });
34
44
  }
35
45
  export {
36
- v as FlashpayCheckout
46
+ FlashpayCheckout
37
47
  };
38
- //# sourceMappingURL=index.es.js.map
48
+ //# sourceMappingURL=index.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es.js","sources":["../src/FlashpayCheckout.tsx"],"sourcesContent":["import { checkout } from \"@flash-pay/browser-sdk\";\nimport type { PaymentEventData, PaymentData } from \"@flash-pay/browser-sdk\";\nimport { useEffect, useRef } from \"react\";\n\nexport type { PaymentEventData, PaymentData };\n\nexport interface FlashpayCheckoutProps {\n transactionId: string;\n onSuccess?: (data: PaymentEventData) => void;\n onFailure?: (data: PaymentEventData) => void;\n onClose?: (data: PaymentEventData) => void;\n showTitle?: boolean;\n showDescription?: boolean;\n showAmount?: boolean;\n style?: Partial<CSSStyleDeclaration>;\n origin?: string;\n}\n\nexport function FlashpayCheckout({\n transactionId,\n onSuccess,\n onFailure,\n onClose,\n showTitle,\n showDescription,\n showAmount,\n style,\n origin,\n}: FlashpayCheckoutProps) {\n const containerRef = useRef<HTMLDivElement>(null);\n\n // Stable refs so callback identity changes don't re-initialize the SDK\n const onSuccessRef = useRef(onSuccess);\n const onFailureRef = useRef(onFailure);\n const onCloseRef = useRef(onClose);\n useEffect(() => {\n onSuccessRef.current = onSuccess;\n onFailureRef.current = onFailure;\n onCloseRef.current = onClose;\n });\n\n useEffect(() => {\n if (!containerRef.current) return;\n const instance = checkout({\n transactionId,\n container: containerRef.current,\n onSuccess: (data) => onSuccessRef.current?.(data),\n onFailure: (data) => onFailureRef.current?.(data),\n onClose: (data) => onCloseRef.current?.(data),\n showTitle,\n showDescription,\n showAmount,\n style,\n origin,\n });\n return () => instance.destroy();\n }, [transactionId, showTitle, showDescription, showAmount, origin]);\n\n return <div ref={containerRef} />;\n}\n"],"names":["FlashpayCheckout","transactionId","onSuccess","onFailure","onClose","showTitle","showDescription","showAmount","style","origin","containerRef","useRef","onSuccessRef","onFailureRef","onCloseRef","useEffect","instance","checkout","data","jsx"],"mappings":";;;AAkBO,SAASA,EAAiB;AAAA,EAC/B,eAAAC;AAAA,EACA,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,YAAAC;AAAA,EACA,OAAAC;AAAA,EACA,QAAAC;AACF,GAA0B;AACxB,QAAMC,IAAeC,EAAuB,IAAI,GAG1CC,IAAeD,EAAOT,CAAS,GAC/BW,IAAeF,EAAOR,CAAS,GAC/BW,IAAaH,EAAOP,CAAO;AACjC,SAAAW,EAAU,MAAM;AACd,IAAAH,EAAa,UAAUV,GACvBW,EAAa,UAAUV,GACvBW,EAAW,UAAUV;AAAA,EACvB,CAAC,GAEDW,EAAU,MAAM;AACd,QAAI,CAACL,EAAa,QAAS;AAC3B,UAAMM,IAAWC,EAAS;AAAA,MACxB,eAAAhB;AAAA,MACA,WAAWS,EAAa;AAAA,MACxB,WAAW,CAACQ,MAASN,EAAa,UAAUM,CAAI;AAAA,MAChD,WAAW,CAACA,MAASL,EAAa,UAAUK,CAAI;AAAA,MAChD,SAAS,CAACA,MAASJ,EAAW,UAAUI,CAAI;AAAA,MAC5C,WAAAb;AAAA,MACA,iBAAAC;AAAA,MACA,YAAAC;AAAA,MACA,OAAAC;AAAA,MACA,QAAAC;AAAA,IAAA,CACD;AACD,WAAO,MAAMO,EAAS,QAAA;AAAA,EACxB,GAAG,CAACf,GAAeI,GAAWC,GAAiBC,GAAYE,CAAM,CAAC,GAE3D,gBAAAU,EAAC,OAAA,EAAI,KAAKT,EAAA,CAAc;AACjC;"}
1
+ {"version":3,"sources":["../src/FlashpayCheckout.tsx"],"sourcesContent":["import { checkout } from \"@flash-pay/browser-sdk\";\nimport type { PaymentEventData, PaymentData } from \"@flash-pay/browser-sdk\";\nimport { useEffect, useRef } from \"react\";\n\nexport type { PaymentEventData, PaymentData };\n\nexport interface FlashpayCheckoutProps {\n transactionId: string;\n onSuccess?: (data: PaymentEventData) => void;\n onFailure?: (data: PaymentEventData) => void;\n onClose?: (data: PaymentEventData) => void;\n showTitle?: boolean;\n showDescription?: boolean;\n showAmount?: boolean;\n style?: Partial<CSSStyleDeclaration>;\n origin?: string;\n}\n\nexport function FlashpayCheckout({\n transactionId,\n onSuccess,\n onFailure,\n onClose,\n showTitle = true,\n showDescription = true,\n showAmount = true,\n style,\n origin,\n}: FlashpayCheckoutProps) {\n const containerRef = useRef<HTMLDivElement>(null);\n\n // Stable refs so callback / style identity changes don't re-initialize the SDK\n const onSuccessRef = useRef(onSuccess);\n const onFailureRef = useRef(onFailure);\n const onCloseRef = useRef(onClose);\n const styleRef = useRef(style);\n useEffect(() => {\n onSuccessRef.current = onSuccess;\n onFailureRef.current = onFailure;\n onCloseRef.current = onClose;\n styleRef.current = style;\n });\n\n useEffect(() => {\n if (!containerRef.current) return;\n const instance = checkout({\n transactionId,\n container: containerRef.current,\n onSuccess: (data) => onSuccessRef.current?.(data),\n onFailure: (data) => onFailureRef.current?.(data),\n onClose: (data) => onCloseRef.current?.(data),\n showTitle,\n showDescription,\n showAmount,\n style: styleRef.current,\n origin,\n });\n return () => instance.destroy();\n }, [transactionId, showTitle, showDescription, showAmount, origin]);\n\n return <div ref={containerRef} />;\n}\n"],"mappings":";AAAA,SAAS,gBAAgB;AAEzB,SAAS,WAAW,cAAc;AA0DzB;AA1CF,SAAS,iBAAiB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,YAAY;AAAA,EACZ,kBAAkB;AAAA,EAClB,aAAa;AAAA,EACb;AAAA,EACA;AACF,GAA0B;AACxB,QAAM,eAAe,OAAuB,IAAI;AAGhD,QAAM,eAAe,OAAO,SAAS;AACrC,QAAM,eAAe,OAAO,SAAS;AACrC,QAAM,aAAa,OAAO,OAAO;AACjC,QAAM,WAAW,OAAO,KAAK;AAC7B,YAAU,MAAM;AACd,iBAAa,UAAU;AACvB,iBAAa,UAAU;AACvB,eAAW,UAAU;AACrB,aAAS,UAAU;AAAA,EACrB,CAAC;AAED,YAAU,MAAM;AACd,QAAI,CAAC,aAAa,QAAS;AAC3B,UAAM,WAAW,SAAS;AAAA,MACxB;AAAA,MACA,WAAW,aAAa;AAAA,MACxB,WAAW,CAAC,SAAS,aAAa,UAAU,IAAI;AAAA,MAChD,WAAW,CAAC,SAAS,aAAa,UAAU,IAAI;AAAA,MAChD,SAAS,CAAC,SAAS,WAAW,UAAU,IAAI;AAAA,MAC5C;AAAA,MACA;AAAA,MACA;AAAA,MACA,OAAO,SAAS;AAAA,MAChB;AAAA,IACF,CAAC;AACD,WAAO,MAAM,SAAS,QAAQ;AAAA,EAChC,GAAG,CAAC,eAAe,WAAW,iBAAiB,YAAY,MAAM,CAAC;AAElE,SAAO,oBAAC,SAAI,KAAK,cAAc;AACjC;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flash-pay/react",
3
- "version": "0.1.0",
3
+ "version": "2.0.0",
4
4
  "description": "Flashpay React component wrapper",
5
5
  "main": "./dist/index.cjs.js",
6
6
  "module": "./dist/index.es.js",
@@ -8,36 +8,37 @@
8
8
  "sideEffects": false,
9
9
  "exports": {
10
10
  ".": {
11
+ "types": "./dist/index.d.ts",
11
12
  "import": "./dist/index.es.js",
12
- "require": "./dist/index.cjs.js",
13
- "types": "./dist/index.d.ts"
13
+ "require": "./dist/index.cjs.js"
14
14
  }
15
15
  },
16
- "files": ["dist"],
16
+ "files": [
17
+ "dist"
18
+ ],
17
19
  "scripts": {
18
- "build": "vite build",
19
- "dev": "vite build --watch",
20
+ "build": "tsup",
21
+ "dev": "tsup --watch",
20
22
  "test": "vitest run",
21
23
  "test:watch": "vitest"
22
24
  },
23
25
  "peerDependencies": {
24
- "@flash-pay/browser-sdk": ">=0.1.0",
26
+ "@flash-pay/browser-sdk": ">=2.0.0",
25
27
  "react": ">=18.0.0",
26
28
  "react-dom": ">=18.0.0"
27
29
  },
28
30
  "devDependencies": {
29
31
  "@flash-pay/browser-sdk": "workspace:*",
30
32
  "@testing-library/react": "^16.0.0",
31
- "@types/react": "^18.0.0",
32
- "@types/react-dom": "^18.0.0",
33
+ "@types/react": "^19.0.0",
34
+ "@types/react-dom": "^19.0.0",
33
35
  "@vitejs/plugin-react": "^4.0.0",
34
36
  "ajv": "^8.18.0",
35
37
  "jsdom": "^26.0.0",
36
- "react": "^18.0.0",
37
- "react-dom": "^18.0.0",
38
+ "react": "^19.0.0",
39
+ "react-dom": "^19.0.0",
40
+ "tsup": "^8.5.0",
38
41
  "typescript": "^5.3.3",
39
- "vite": "^7.3.1",
40
- "vite-plugin-dts": "^4.5.4",
41
42
  "vitest": "^3.0.0"
42
43
  }
43
44
  }
@@ -1,14 +0,0 @@
1
- import { PaymentEventData, PaymentData } from '@flash-pay/browser-sdk';
2
- export type { PaymentEventData, PaymentData };
3
- export interface FlashpayCheckoutProps {
4
- transactionId: string;
5
- onSuccess?: (data: PaymentEventData) => void;
6
- onFailure?: (data: PaymentEventData) => void;
7
- onClose?: (data: PaymentEventData) => void;
8
- showTitle?: boolean;
9
- showDescription?: boolean;
10
- showAmount?: boolean;
11
- style?: Partial<CSSStyleDeclaration>;
12
- origin?: string;
13
- }
14
- export declare function FlashpayCheckout({ transactionId, onSuccess, onFailure, onClose, showTitle, showDescription, showAmount, style, origin, }: FlashpayCheckoutProps): import("react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- export {};