@w3payments/react 0.0.1
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 +488 -0
- package/dist/appearance.d.ts +30 -0
- package/dist/appearance.d.ts.map +1 -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/CurrencyIcon.d.ts +71 -0
- package/dist/components/CurrencyIcon.d.ts.map +1 -0
- package/dist/components/ExchangeIcon.d.ts +8 -0
- package/dist/components/ExchangeIcon.d.ts.map +1 -0
- package/dist/components/PaymentMethodRow.d.ts +24 -0
- package/dist/components/PaymentMethodRow.d.ts.map +1 -0
- package/dist/components/W3PaymentFooter.d.ts +8 -0
- package/dist/components/W3PaymentFooter.d.ts.map +1 -0
- package/dist/components/W3PaymentWidget.d.ts +46 -0
- package/dist/components/W3PaymentWidget.d.ts.map +1 -0
- package/dist/components/index.d.ts +12 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +25 -0
- package/dist/index.mjs +10636 -0
- package/dist/main.d.ts +9 -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/qr.d.ts +41 -0
- package/dist/utils/qr.d.ts.map +1 -0
- package/package.json +114 -0
package/dist/main.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const W3_PAYMENTS_REACT_VERSION = "1.0.0";
|
|
2
|
+
export { W3PaymentWidget } from './components';
|
|
3
|
+
export type { W3PaymentWidgetProps, PaymentMethodRowProps, W3PaymentFooterProps, } from './components';
|
|
4
|
+
export type { PaymentEvent, PaymentError, PaymentMethodDisplayData, } from './types';
|
|
5
|
+
declare const _default: {
|
|
6
|
+
W3_PAYMENTS_REACT_VERSION: string;
|
|
7
|
+
};
|
|
8
|
+
export default _default;
|
|
9
|
+
//# sourceMappingURL=main.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,YAAY,CAAC;AAGpB,eAAO,MAAM,yBAAyB,UAAU,CAAC;AAGjD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAG/C,YAAY,EACV,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,GACrB,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":["../src/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,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* QR Code Utilities for Payment Addresses
|
|
3
|
+
*/
|
|
4
|
+
export interface QRCodeOptions {
|
|
5
|
+
/** Error correction level */
|
|
6
|
+
errorCorrectionLevel?: 'L' | 'M' | 'Q' | 'H';
|
|
7
|
+
/** QR code type */
|
|
8
|
+
type?: 'image/png' | 'image/jpeg' | 'image/webp';
|
|
9
|
+
/** Quality (0-1) for JPEG */
|
|
10
|
+
quality?: number;
|
|
11
|
+
/** Margin around QR code */
|
|
12
|
+
margin?: number;
|
|
13
|
+
/** Color options */
|
|
14
|
+
color?: {
|
|
15
|
+
dark?: string;
|
|
16
|
+
light?: string;
|
|
17
|
+
};
|
|
18
|
+
/** Width/height in pixels */
|
|
19
|
+
width?: number;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Generate QR code as data URL for payment addresses
|
|
23
|
+
*/
|
|
24
|
+
export declare function generatePaymentQR(address: string, symbol?: string, amount?: string, options?: QRCodeOptions): Promise<string>;
|
|
25
|
+
/**
|
|
26
|
+
* Generate simple QR code for text/addresses
|
|
27
|
+
*/
|
|
28
|
+
export declare function generateQRCode(data: string, options?: QRCodeOptions): Promise<string>;
|
|
29
|
+
/**
|
|
30
|
+
* Generate QR code as SVG string
|
|
31
|
+
*/
|
|
32
|
+
export declare function generateQRCodeSVG(data: string, options?: Omit<QRCodeOptions, 'type' | 'quality'>): Promise<string>;
|
|
33
|
+
/**
|
|
34
|
+
* Validate if a string can be encoded as QR code
|
|
35
|
+
*/
|
|
36
|
+
export declare function validateQRData(data: string): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Copy text to clipboard (browser utility)
|
|
39
|
+
*/
|
|
40
|
+
export declare function copyToClipboard(text: string): Promise<boolean>;
|
|
41
|
+
//# sourceMapping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"}
|
package/package.json
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@w3payments/react",
|
|
3
|
+
"version": "0.0.1",
|
|
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
|
+
"@mantine/core": "^8.3.10",
|
|
56
|
+
"@types/qrcode": "^1.5.6",
|
|
57
|
+
"framer-motion": "^12.23.26",
|
|
58
|
+
"qrcode": "^1.5.4",
|
|
59
|
+
"@w3payments/core": "0.0.1"
|
|
60
|
+
},
|
|
61
|
+
"peerDependencies": {
|
|
62
|
+
"react": ">=18.0.0",
|
|
63
|
+
"react-dom": ">=18.0.0"
|
|
64
|
+
},
|
|
65
|
+
"peerDependenciesMeta": {
|
|
66
|
+
"react": {
|
|
67
|
+
"optional": false
|
|
68
|
+
},
|
|
69
|
+
"react-dom": {
|
|
70
|
+
"optional": false
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
"devDependencies": {
|
|
74
|
+
"@chromatic-com/storybook": "^4.1.3",
|
|
75
|
+
"@storybook/addon-a11y": "^10.1.11",
|
|
76
|
+
"@storybook/addon-docs": "^10.1.11",
|
|
77
|
+
"@storybook/addon-vitest": "^10.1.11",
|
|
78
|
+
"@storybook/react-vite": "^10.1.11",
|
|
79
|
+
"@types/cors": "^2.8.19",
|
|
80
|
+
"@types/express": "^5.0.6",
|
|
81
|
+
"@types/node": "^24.10.3",
|
|
82
|
+
"@types/react": "^19.2.7",
|
|
83
|
+
"@types/react-dom": "^19.2.3",
|
|
84
|
+
"@vitejs/plugin-react": "^5.1.2",
|
|
85
|
+
"concurrently": "^8.2.2",
|
|
86
|
+
"cors": "^2.8.5",
|
|
87
|
+
"dotenv": "^17.2.3",
|
|
88
|
+
"eslint-plugin-storybook": "^10.1.11",
|
|
89
|
+
"express": "^5.2.1",
|
|
90
|
+
"find-up": "^8.0.0",
|
|
91
|
+
"react": "^19.2.3",
|
|
92
|
+
"react-dom": "^19.2.3",
|
|
93
|
+
"storybook": "^10.1.11",
|
|
94
|
+
"tsc-alias": "^1.8.16",
|
|
95
|
+
"typescript": "~5.9.3",
|
|
96
|
+
"unplugin-dts": "1.0.0-beta.6",
|
|
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": "vite build",
|
|
104
|
+
"lint": "eslint .",
|
|
105
|
+
"preview": "vite preview",
|
|
106
|
+
"storybook": "concurrently \"npx tsx server.ts\" \"storybook dev -p 6006\"",
|
|
107
|
+
"server": "npx tsx server.ts",
|
|
108
|
+
"kill-servers": "pkill -f 'tsx server.ts' || pkill -f 'storybook dev' || echo 'No servers running'",
|
|
109
|
+
"build-storybook": "storybook build",
|
|
110
|
+
"version": "pnpm run build",
|
|
111
|
+
"publish:beta": "pnpm publish --access public --tag beta --no-git-checks",
|
|
112
|
+
"publish:prod": "pnpm publish --access public --no-git-checks"
|
|
113
|
+
}
|
|
114
|
+
}
|