@xsolla/xui-input 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 +42 -0
- package/package.json +4 -4
package/README.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# @xsolla/xui-input
|
|
2
|
+
|
|
3
|
+
Text input component with label, error, icon, clear, and checked state support.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
yarn add @xsolla/xui-input
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
import { Input } from '@xsolla/xui-input';
|
|
15
|
+
|
|
16
|
+
<Input
|
|
17
|
+
label="Email"
|
|
18
|
+
placeholder="Enter email"
|
|
19
|
+
value={value}
|
|
20
|
+
onChange={(e) => setValue(e.target.value)}
|
|
21
|
+
errorMessage="Invalid email"
|
|
22
|
+
/>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Props
|
|
26
|
+
|
|
27
|
+
### Input
|
|
28
|
+
|
|
29
|
+
| Prop | Type | Default | Description |
|
|
30
|
+
|------|------|---------|-------------|
|
|
31
|
+
| `value` | `string` | — | Controlled value |
|
|
32
|
+
| `placeholder` | `string` | — | Placeholder text |
|
|
33
|
+
| `onChange` | `(e: ChangeEvent) => void` | — | Change handler |
|
|
34
|
+
| `onChangeText` | `(text: string) => void` | — | Alternative change handler receiving the string value |
|
|
35
|
+
| `size` | `'xl' \| 'lg' \| 'md' \| 'sm' \| 'xs'` | `'md'` | Input size |
|
|
36
|
+
| `disabled` | `boolean` | `false` | Disables the input |
|
|
37
|
+
| `label` | `string` | — | Label displayed above the input |
|
|
38
|
+
| `errorMessage` | `string` | — | Error text displayed below; also sets invalid state |
|
|
39
|
+
| `error` | `boolean` | — | Sets invalid state without a message |
|
|
40
|
+
| `iconLeft` | `ReactNode` | — | Icon on the left side |
|
|
41
|
+
| `iconRight` | `ReactNode` | — | Icon on the right side |
|
|
42
|
+
| `extraClear` | `boolean` | `false` | Shows a clear button when the field has a value |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xsolla/xui-input",
|
|
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": "0.
|
|
18
|
-
"@xsolla/xui-primitives-core": "0.
|
|
16
|
+
"@xsolla/xui-core": "0.97.0",
|
|
17
|
+
"@xsolla/xui-icons": "0.97.0",
|
|
18
|
+
"@xsolla/xui-primitives-core": "0.97.0"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
21
21
|
"react": ">=16.8.0",
|