@xsolla/xui-input-copy 0.96.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 +6 -6
package/README.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# @xsolla/xui-input-copy
|
|
2
|
+
|
|
3
|
+
Input field with a copy-to-clipboard button and optional hidden text toggle.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
yarn add @xsolla/xui-input-copy
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
import { InputCopy } from '@xsolla/xui-input-copy';
|
|
15
|
+
|
|
16
|
+
<InputCopy
|
|
17
|
+
label="API key"
|
|
18
|
+
value="sk-abc123"
|
|
19
|
+
onCopy={(v) => console.log('Copied:', v)}
|
|
20
|
+
/>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Props
|
|
24
|
+
|
|
25
|
+
### InputCopy
|
|
26
|
+
|
|
27
|
+
| Prop | Type | Default | Description |
|
|
28
|
+
|------|------|---------|-------------|
|
|
29
|
+
| `value` | `string` | `''` | Controlled value |
|
|
30
|
+
| `onCopy` | `(value: string) => void` | — | Called after value is copied to clipboard |
|
|
31
|
+
| `secureTextEntry` | `boolean` | `false` | Masks the value like a password field |
|
|
32
|
+
| `initialVisible` | `boolean` | `false` | Initial visibility when `secureTextEntry` is `true` |
|
|
33
|
+
| `size` | `'xl' \| 'lg' \| 'md' \| 'sm' \| 'xs'` | `'md'` | Input size |
|
|
34
|
+
| `disabled` | `boolean` | `false` | Disables the input and copy button |
|
|
35
|
+
| `label` | `string` | — | Label displayed above the input |
|
|
36
|
+
| `errorMessage` | `string` | — | Error text displayed below; also sets invalid state |
|
|
37
|
+
| `error` | `boolean` | — | Sets invalid state without a message |
|
|
38
|
+
| `onChange` | `(e: ChangeEvent) => void` | — | Change handler |
|
|
39
|
+
| `onChangeText` | `(text: string) => void` | — | Alternative change handler receiving the string value |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xsolla/xui-input-copy",
|
|
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,11 +13,11 @@
|
|
|
13
13
|
"test:coverage": "vitest run --coverage"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@xsolla/xui-button": "0.
|
|
17
|
-
"@xsolla/xui-core": "0.
|
|
18
|
-
"@xsolla/xui-icons": "0.
|
|
19
|
-
"@xsolla/xui-input": "0.
|
|
20
|
-
"@xsolla/xui-primitives-core": "0.
|
|
16
|
+
"@xsolla/xui-button": "0.97.0",
|
|
17
|
+
"@xsolla/xui-core": "0.97.0",
|
|
18
|
+
"@xsolla/xui-icons": "0.97.0",
|
|
19
|
+
"@xsolla/xui-input": "0.97.0",
|
|
20
|
+
"@xsolla/xui-primitives-core": "0.97.0"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"react": ">=16.8.0",
|