@xsolla/xui-input-payment 0.95.0 → 0.97.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 +39 -0
- package/package.json +4 -4
package/README.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# @xsolla/xui-input-payment
|
|
2
|
+
|
|
3
|
+
Payment card number input with animated payment system icons and auto-detection.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
yarn add @xsolla/xui-input-payment
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
import { InputPayment } from '@xsolla/xui-input-payment';
|
|
15
|
+
|
|
16
|
+
<InputPayment
|
|
17
|
+
value={cardNumber}
|
|
18
|
+
onChange={(e) => setCardNumber(e.target.value)}
|
|
19
|
+
possiblePayments={['visa', 'mastercard', 'amex']}
|
|
20
|
+
onRecognizedPaymentChange={(system) => console.log(system)}
|
|
21
|
+
/>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Props
|
|
25
|
+
|
|
26
|
+
### InputPayment
|
|
27
|
+
|
|
28
|
+
| Prop | Type | Default | Description |
|
|
29
|
+
|------|------|---------|-------------|
|
|
30
|
+
| `value` | `string` | — | Controlled card number value |
|
|
31
|
+
| `placeholder` | `string` | `'Card number'` | Placeholder text |
|
|
32
|
+
| `onChange` | `(e: ChangeEvent) => void` | — | Change handler |
|
|
33
|
+
| `onChangeText` | `(text: string) => void` | — | Alternative change handler receiving the string value |
|
|
34
|
+
| `size` | `'xl' \| 'lg' \| 'md' \| 'sm' \| 'xs'` | `'md'` | Input size |
|
|
35
|
+
| `disabled` | `boolean` | `false` | Disables the input |
|
|
36
|
+
| `errorMessage` | `string` | — | Error text displayed below; also sets invalid state |
|
|
37
|
+
| `error` | `boolean` | — | Sets invalid state without a message |
|
|
38
|
+
| `possiblePayments` | `PaymentSystemKey[]` | 8 common systems | Payment icons shown on the right |
|
|
39
|
+
| `onRecognizedPaymentChange` | `(payment: PaymentSystemKey \| null) => void` | — | Called when the detected system changes |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xsolla/xui-input-payment",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.97.0",
|
|
4
4
|
"main": "./web/index.js",
|
|
5
5
|
"module": "./web/index.mjs",
|
|
6
6
|
"types": "./web/index.d.ts",
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
"test:coverage": "vitest run --coverage"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@xsolla/xui-core": "0.
|
|
17
|
-
"@xsolla/xui-icons-payment": "0.
|
|
18
|
-
"@xsolla/xui-primitives-core": "0.
|
|
16
|
+
"@xsolla/xui-core": "0.97.0",
|
|
17
|
+
"@xsolla/xui-icons-payment": "0.97.0",
|
|
18
|
+
"@xsolla/xui-primitives-core": "0.97.0"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
21
21
|
"react": ">=16.8.0",
|