@xsolla/xui-color-picker 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 +36 -0
- package/package.json +6 -6
package/README.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# @xsolla/xui-color-picker
|
|
2
|
+
|
|
3
|
+
HSB colour picker with hue/alpha sliders, format switching, and optional eyedropper.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
yarn add @xsolla/xui-color-picker
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
import { ColorPicker } from '@xsolla/xui-color-picker';
|
|
15
|
+
|
|
16
|
+
<ColorPicker
|
|
17
|
+
value="#66E6FF"
|
|
18
|
+
colorFormat="hex"
|
|
19
|
+
onChange={({ valueInInitialFormat }) => console.log(valueInInitialFormat)}
|
|
20
|
+
/>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Props
|
|
24
|
+
|
|
25
|
+
### ColorPicker
|
|
26
|
+
|
|
27
|
+
| Prop | Type | Default | Description |
|
|
28
|
+
|------|------|---------|-------------|
|
|
29
|
+
| `value` | `string` | `"#66E6FFFF"` | Current colour value in any supported format |
|
|
30
|
+
| `onChange` | `(event: ColorPickerChangeEvent) => void` | — | Called on every colour change with values in both initial and current formats |
|
|
31
|
+
| `colorFormat` | `"hex" \| "rgb" \| "hsl" \| "hsb"` | `"hex"` | Default output format |
|
|
32
|
+
| `selectableFormats` | `InputColorFormat[]` | all formats | Formats available in the format selector |
|
|
33
|
+
| `alpha` | `boolean` | `true` | Enable the alpha (opacity) slider and channel input |
|
|
34
|
+
| `eyedropper` | `boolean` | `false` | Show the native eyedropper tool button |
|
|
35
|
+
| `bottomContent` | `ReactNode` | — | Custom content rendered at the bottom of the picker |
|
|
36
|
+
| `copiedIcon` | `ReactElement` | — | Custom icon shown after copying the colour value |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xsolla/xui-color-picker",
|
|
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,11 +10,11 @@
|
|
|
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-input": "0.
|
|
16
|
-
"@xsolla/xui-primitives-core": "0.
|
|
17
|
-
"@xsolla/xui-select": "0.
|
|
13
|
+
"@xsolla/xui-button": "0.97.0",
|
|
14
|
+
"@xsolla/xui-core": "0.97.0",
|
|
15
|
+
"@xsolla/xui-input": "0.97.0",
|
|
16
|
+
"@xsolla/xui-primitives-core": "0.97.0",
|
|
17
|
+
"@xsolla/xui-select": "0.97.0"
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
20
|
"react": ">=16.8.0"
|