@xsolla/xui-uploader 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 +36 -0
- package/package.json +5 -5
package/README.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# @xsolla/xui-uploader
|
|
2
|
+
|
|
3
|
+
File upload control with a trigger button and selected file list.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
yarn add @xsolla/xui-uploader
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
import { Uploader } from '@xsolla/xui-uploader';
|
|
15
|
+
|
|
16
|
+
<Uploader
|
|
17
|
+
label="Attachments"
|
|
18
|
+
accept=".jpg,.png,.pdf"
|
|
19
|
+
multiple
|
|
20
|
+
onFilesChange={(files) => console.log(files)}
|
|
21
|
+
/>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Props
|
|
25
|
+
|
|
26
|
+
### Uploader
|
|
27
|
+
|
|
28
|
+
| Prop | Type | Default | Description |
|
|
29
|
+
|------|------|---------|-------------|
|
|
30
|
+
| `label` | `string` | — | Label rendered above the upload button |
|
|
31
|
+
| `placeholder` | `string` | `"Select files to upload"` | Button text when no files are selected |
|
|
32
|
+
| `accept` | `string` | — | Accepted file types (e.g. `".jpg,.png"`) |
|
|
33
|
+
| `multiple` | `boolean` | `false` | Allow selecting multiple files |
|
|
34
|
+
| `onFilesChange` | `(files: File[]) => void` | — | Callback fired when the file list changes |
|
|
35
|
+
| `disabled` | `boolean` | `false` | Disables the control |
|
|
36
|
+
| `size` | `"xl" \| "lg" \| "md" \| "sm" \| "xs"` | `"md"` | Size of the upload button |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xsolla/xui-uploader",
|
|
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",
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
"build:native": "PLATFORM=native tsup"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@xsolla/xui-button": "0.
|
|
14
|
-
"@xsolla/xui-core": "0.
|
|
15
|
-
"@xsolla/xui-icons": "0.
|
|
16
|
-
"@xsolla/xui-primitives-core": "0.
|
|
13
|
+
"@xsolla/xui-button": "0.97.0",
|
|
14
|
+
"@xsolla/xui-core": "0.97.0",
|
|
15
|
+
"@xsolla/xui-icons": "0.97.0",
|
|
16
|
+
"@xsolla/xui-primitives-core": "0.97.0"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
19
|
"react": ">=16.8.0"
|