@w3payments/react 1.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.
- package/README.md +308 -0
- package/dist/assets/3.svg +1 -0
- package/dist/assets/io.svg +1 -0
- package/dist/assets/main.css +1 -0
- package/dist/assets/vite.svg +1 -0
- package/dist/assets/w.svg +1 -0
- package/dist/components/PaymentButton.d.ts +18 -0
- package/dist/components/PaymentButton.d.ts.map +1 -0
- package/dist/components/PaymentFooter.d.ts +10 -0
- package/dist/components/PaymentFooter.d.ts.map +1 -0
- package/dist/components/PaymentHeader.d.ts +10 -0
- package/dist/components/PaymentHeader.d.ts.map +1 -0
- package/dist/components/PaymentInput.d.ts +23 -0
- package/dist/components/PaymentInput.d.ts.map +1 -0
- package/dist/components/PaymentMethodGroup.d.ts +14 -0
- package/dist/components/PaymentMethodGroup.d.ts.map +1 -0
- package/dist/components/PaymentMethodOption.d.ts +16 -0
- package/dist/components/PaymentMethodOption.d.ts.map +1 -0
- package/dist/components/PaymentMethodSelection.d.ts +14 -0
- package/dist/components/PaymentMethodSelection.d.ts.map +1 -0
- package/dist/components/PaymentSummary.d.ts +13 -0
- package/dist/components/PaymentSummary.d.ts.map +1 -0
- package/dist/components/W3PaymentWidget.d.ts +63 -0
- package/dist/components/W3PaymentWidget.d.ts.map +1 -0
- package/dist/components/W3PaymentsProvider.d.ts +24 -0
- package/dist/components/W3PaymentsProvider.d.ts.map +1 -0
- package/dist/components/index.d.ts +12 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/context/W3PaymentsContext.d.ts +31 -0
- package/dist/context/W3PaymentsContext.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +8 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/useW3Payments.d.ts +32 -0
- package/dist/hooks/useW3Payments.d.ts.map +1 -0
- package/dist/http/W3PaymentsClient.d.ts +16 -0
- package/dist/http/W3PaymentsClient.d.ts.map +1 -0
- package/dist/index-B9KdNmCT.cjs +94 -0
- package/dist/index-Cu_k1Q9p.js +13544 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +67 -0
- package/dist/index.mjs +5815 -0
- package/dist/main.d.ts +10 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/types.d.ts +48 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/utils/numbers.d.ts +16 -0
- package/dist/utils/numbers.d.ts.map +1 -0
- package/dist/utils/theme.d.ts +6 -0
- package/dist/utils/theme.d.ts.map +1 -0
- package/package.json +112 -0
package/dist/main.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const W3_PAYMENTS_REACT_VERSION = "1.0.0";
|
|
2
|
+
export { W3PaymentsProvider, W3PaymentWidget } from './components';
|
|
3
|
+
export { useW3Payments } from './hooks/useW3Payments';
|
|
4
|
+
export type { W3PaymentsProviderProps, W3PaymentWidgetProps, PaymentInitiateData, PaymentCompleteData, PaymentErrorData, PaymentMethodOptionProps, } from './components';
|
|
5
|
+
export type { PaymentEvent, PaymentError, PaymentMethodDisplayData, } from './types';
|
|
6
|
+
declare const _default: {
|
|
7
|
+
W3_PAYMENTS_REACT_VERSION: string;
|
|
8
|
+
};
|
|
9
|
+
export default _default;
|
|
10
|
+
//# sourceMappingURL=main.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../lib/main.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,YAAY,CAAC;AAGpB,eAAO,MAAM,yBAAyB,UAAU,CAAC;AAGjD,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAGnE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAGtD,YAAY,EACV,uBAAuB,EACvB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,wBAAwB,GACzB,MAAM,cAAc,CAAC;AAGtB,YAAY,EACV,YAAY,EACZ,YAAY,EACZ,wBAAwB,GACzB,MAAM,SAAS,CAAC;;;;AAGjB,wBAEE"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared React Types
|
|
3
|
+
*
|
|
4
|
+
* TypeScript interfaces shared across multiple React components
|
|
5
|
+
* Component-specific types should be declared in their respective component files.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Payment event for tracking payment lifecycle
|
|
9
|
+
* Used by W3PaymentsProvider for event callbacks
|
|
10
|
+
*/
|
|
11
|
+
export interface PaymentEvent {
|
|
12
|
+
/** Event type */
|
|
13
|
+
type: 'payment_initiated' | 'payment_processing' | 'payment_completed' | 'payment_failed' | 'payment_cancelled';
|
|
14
|
+
/** Event payload */
|
|
15
|
+
payload: any;
|
|
16
|
+
/** Event timestamp */
|
|
17
|
+
timestamp: Date;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Payment error interface for React components
|
|
21
|
+
* General error interface used across multiple components
|
|
22
|
+
*/
|
|
23
|
+
export interface PaymentError {
|
|
24
|
+
/** Error code */
|
|
25
|
+
code: string;
|
|
26
|
+
/** Error message */
|
|
27
|
+
message: string;
|
|
28
|
+
/** Error details */
|
|
29
|
+
details?: any;
|
|
30
|
+
/** Vendor that generated the error */
|
|
31
|
+
vendor?: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Simple payment method display data for UI
|
|
35
|
+
*/
|
|
36
|
+
export interface PaymentMethodDisplayData {
|
|
37
|
+
/** Unique identifier for the payment method instance */
|
|
38
|
+
id: string;
|
|
39
|
+
/** Display name for the payment method (e.g., "BTC", "krakenDirect", "ACH") */
|
|
40
|
+
displayName: string;
|
|
41
|
+
/** Whether this option is enabled (default: true) */
|
|
42
|
+
enabled?: boolean;
|
|
43
|
+
/** Custom disabled message (e.g., "Not Available", "Coming Soon") */
|
|
44
|
+
disabledMessage?: string;
|
|
45
|
+
/** Badge text (e.g., "Popular", "Fast") */
|
|
46
|
+
badge?: string;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../lib/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,iBAAiB;IACjB,IAAI,EACA,mBAAmB,GACnB,oBAAoB,GACpB,mBAAmB,GACnB,gBAAgB,GAChB,mBAAmB,CAAC;IACxB,oBAAoB;IACpB,OAAO,EAAE,GAAG,CAAC;IACb,sBAAsB;IACtB,SAAS,EAAE,IAAI,CAAC;CACjB;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,iBAAiB;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,oBAAoB;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,oBAAoB;IACpB,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,wDAAwD;IACxD,EAAE,EAAE,MAAM,CAAC;IACX,+EAA+E;IAC/E,WAAW,EAAE,MAAM,CAAC;IACpB,qDAAqD;IACrD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,qEAAqE;IACrE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Number formatting utilities
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Format a number with specific decimal places (no thousand separators)
|
|
6
|
+
*/
|
|
7
|
+
export declare function formatNumber(value: string | number, decimals: number): string;
|
|
8
|
+
/**
|
|
9
|
+
* Format a number for display with thousand separators
|
|
10
|
+
*/
|
|
11
|
+
export declare function formatNumberDisplay(value: string | number, decimals: number): string;
|
|
12
|
+
/**
|
|
13
|
+
* Format USD amount
|
|
14
|
+
*/
|
|
15
|
+
export declare function formatUSD(value: number): string;
|
|
16
|
+
//# sourceMappingURL=numbers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"numbers.d.ts","sourceRoot":"","sources":["../../lib/utils/numbers.ts"],"names":[],"mappings":"AAAA;;GAEG;AA6BH;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAK7E;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,MAAM,GAAG,MAAM,EACtB,QAAQ,EAAE,MAAM,GACf,MAAM,CAKR;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE/C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../lib/utils/theme.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAEV,YAAY,EAEb,MAAM,oBAAoB,CAAC;AAyD5B;;GAEG;AACH,wBAAgB,UAAU,CACxB,UAAU,EAAE,YAAY,EACxB,SAAS,EAAE,WAAW,GACrB,IAAI,CA6BN"}
|
package/package.json
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@w3payments/react",
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "React component library for universal Web3 payment processing with multi-vendor support",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"module": "dist/index.mjs",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.mjs",
|
|
13
|
+
"require": "./dist/index.js"
|
|
14
|
+
},
|
|
15
|
+
"./styles": "./dist/assets/main.css"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist"
|
|
19
|
+
],
|
|
20
|
+
"author": "W3 Payments Team",
|
|
21
|
+
"license": "MIT",
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "git+https://github.com/w3-io/payments-platform.git",
|
|
25
|
+
"directory": "packages/react"
|
|
26
|
+
},
|
|
27
|
+
"homepage": "https://github.com/w3-io/payments-platform#readme",
|
|
28
|
+
"bugs": {
|
|
29
|
+
"url": "https://github.com/w3-io/payments-platform/issues"
|
|
30
|
+
},
|
|
31
|
+
"keywords": [
|
|
32
|
+
"react",
|
|
33
|
+
"payments",
|
|
34
|
+
"web3",
|
|
35
|
+
"cryptocurrency",
|
|
36
|
+
"payment-processing",
|
|
37
|
+
"payment-gateway",
|
|
38
|
+
"widget",
|
|
39
|
+
"component-library",
|
|
40
|
+
"typescript",
|
|
41
|
+
"meshpay",
|
|
42
|
+
"ironpay",
|
|
43
|
+
"crypto-payments",
|
|
44
|
+
"payment-widget",
|
|
45
|
+
"fintech"
|
|
46
|
+
],
|
|
47
|
+
"publishConfig": {
|
|
48
|
+
"access": "public",
|
|
49
|
+
"registry": "https://registry.npmjs.org/"
|
|
50
|
+
},
|
|
51
|
+
"sideEffects": [
|
|
52
|
+
"**/*.css"
|
|
53
|
+
],
|
|
54
|
+
"dependencies": {
|
|
55
|
+
"@meshconnect/web-link-sdk": "^3.4.1",
|
|
56
|
+
"@storybook/react-vite": "^10.1.10",
|
|
57
|
+
"@tailwindcss/vite": "^4.1.18",
|
|
58
|
+
"tailwindcss": "^4.1.18",
|
|
59
|
+
"@w3payments/adapters": "1.1.0",
|
|
60
|
+
"@w3payments/common": "1.1.0",
|
|
61
|
+
"@w3payments/core": "1.1.0"
|
|
62
|
+
},
|
|
63
|
+
"peerDependencies": {
|
|
64
|
+
"react": ">=18.0.0",
|
|
65
|
+
"react-dom": ">=18.0.0"
|
|
66
|
+
},
|
|
67
|
+
"peerDependenciesMeta": {
|
|
68
|
+
"react": {
|
|
69
|
+
"optional": false
|
|
70
|
+
},
|
|
71
|
+
"react-dom": {
|
|
72
|
+
"optional": false
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
"devDependencies": {
|
|
76
|
+
"@chromatic-com/storybook": "^4.1.3",
|
|
77
|
+
"@storybook/addon-a11y": "^10.1.10",
|
|
78
|
+
"@storybook/addon-docs": "^10.1.10",
|
|
79
|
+
"@storybook/addon-essentials": "^8.6.14",
|
|
80
|
+
"@storybook/addon-interactions": "^8.6.14",
|
|
81
|
+
"@storybook/addon-vitest": "^10.1.10",
|
|
82
|
+
"@types/cors": "^2.8.19",
|
|
83
|
+
"@types/express": "^5.0.6",
|
|
84
|
+
"@types/node": "^24.10.3",
|
|
85
|
+
"@types/react": "^19.2.7",
|
|
86
|
+
"@types/react-dom": "^19.2.3",
|
|
87
|
+
"@vitejs/plugin-react": "^5.1.2",
|
|
88
|
+
"concurrently": "^8.2.2",
|
|
89
|
+
"cors": "^2.8.5",
|
|
90
|
+
"dotenv": "^17.2.3",
|
|
91
|
+
"eslint-plugin-storybook": "^10.1.10",
|
|
92
|
+
"express": "^5.2.1",
|
|
93
|
+
"react": "^19.2.3",
|
|
94
|
+
"react-dom": "^19.2.3",
|
|
95
|
+
"storybook": "^10.1.10",
|
|
96
|
+
"typescript": "~5.9.3",
|
|
97
|
+
"vite": "^7.2.7",
|
|
98
|
+
"vite-plugin-dts": "^4.5.4",
|
|
99
|
+
"vite-plugin-lib-inject-css": "^2.2.2"
|
|
100
|
+
},
|
|
101
|
+
"scripts": {
|
|
102
|
+
"dev": "vite",
|
|
103
|
+
"build": "tsc -p tsconfig.build.json && vite build",
|
|
104
|
+
"lint": "eslint .",
|
|
105
|
+
"preview": "vite preview",
|
|
106
|
+
"storybook": "concurrently \"npx tsx server.ts\" \"storybook dev -p 6006\"",
|
|
107
|
+
"build-storybook": "storybook build",
|
|
108
|
+
"version": "pnpm run build",
|
|
109
|
+
"publish:beta": "pnpm publish --access public --tag beta --no-git-checks",
|
|
110
|
+
"publish:prod": "pnpm publish --access public --no-git-checks"
|
|
111
|
+
}
|
|
112
|
+
}
|