@xsolla/xui-multi-select 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 +43 -0
- package/package.json +5 -5
package/README.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# @xsolla/xui-multi-select
|
|
2
|
+
|
|
3
|
+
Multi-value dropdown select with tag or text display of selected items.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
yarn add @xsolla/xui-multi-select
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
import { MultiSelect } from '@xsolla/xui-multi-select';
|
|
15
|
+
|
|
16
|
+
<MultiSelect
|
|
17
|
+
label="Platforms"
|
|
18
|
+
options={[
|
|
19
|
+
{ label: 'Web', value: 'web' },
|
|
20
|
+
{ label: 'iOS', value: 'ios' },
|
|
21
|
+
{ label: 'Android', value: 'android' },
|
|
22
|
+
]}
|
|
23
|
+
value={selected}
|
|
24
|
+
onChange={setSelected}
|
|
25
|
+
/>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Props
|
|
29
|
+
|
|
30
|
+
### MultiSelect
|
|
31
|
+
|
|
32
|
+
| Prop | Type | Default | Description |
|
|
33
|
+
|------|------|---------|-------------|
|
|
34
|
+
| `options` | `MultiSelectOption[]` | — | List of options (`{ label, value, disabled? }`) |
|
|
35
|
+
| `value` | `MultiSelectValue` | — | Array of selected values |
|
|
36
|
+
| `onChange` | `(values: MultiSelectValue) => void` | — | Called when the selection changes |
|
|
37
|
+
| `placeholder` | `string` | `"Select"` | Placeholder text when nothing is selected |
|
|
38
|
+
| `label` | `string` | — | Label displayed above the control |
|
|
39
|
+
| `size` | `"xs" \| "sm" \| "md" \| "lg" \| "xl"` | `"md"` | Size of the control |
|
|
40
|
+
| `state` | `"default" \| "hover" \| "focus" \| "disable" \| "error"` | — | Visual state |
|
|
41
|
+
| `disabled` | `boolean` | `false` | Disables the control |
|
|
42
|
+
| `errorMessage` | `string` | — | Error message shown below the control |
|
|
43
|
+
| `variant` | `"tag" \| "text"` | `"tag"` | Display selected items as tags or comma-separated text |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xsolla/xui-multi-select",
|
|
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-checkbox": "0.
|
|
14
|
-
"@xsolla/xui-core": "0.
|
|
15
|
-
"@xsolla/xui-dropdown": "0.
|
|
16
|
-
"@xsolla/xui-primitives-core": "0.
|
|
13
|
+
"@xsolla/xui-checkbox": "0.97.0",
|
|
14
|
+
"@xsolla/xui-core": "0.97.0",
|
|
15
|
+
"@xsolla/xui-dropdown": "0.97.0",
|
|
16
|
+
"@xsolla/xui-primitives-core": "0.97.0"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
19
|
"react": ">=16.8.0",
|