react-iro-gradient-picker 1.1.7 → 1.2.3
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 +113 -1
- package/dist/components/core/Colorpicker/IroGradient/index.d.ts +2 -2
- package/dist/components/core/Colorpicker/IroSolid/index.d.ts +2 -2
- package/dist/components/core/Colorpicker/helper.d.ts +2 -1
- package/dist/index.es.js +272 -122
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +275 -121
- package/dist/index.js.map +1 -1
- package/dist/lib/types/types.d.ts +44 -1
- package/dist/utils/gradient/gradientConverter.d.ts +17 -0
- package/dist/utils/gradient/index.d.ts +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/validation/validGradient.d.ts +1 -1
- package/package.json +1 -1
@@ -1,6 +1,17 @@
|
|
1
1
|
import { ReactText } from 'react';
|
2
|
+
export interface IGradientStop {
|
3
|
+
color: string;
|
4
|
+
position: number;
|
5
|
+
}
|
6
|
+
export interface IGradientData {
|
7
|
+
type: 'linear' | 'radial';
|
8
|
+
angle?: number;
|
9
|
+
stops: IGradientStop[];
|
10
|
+
defaultActiveTab?: 'gradient';
|
11
|
+
}
|
12
|
+
export type TValueProp = string | IGradientData;
|
2
13
|
export interface IPropsComp {
|
3
|
-
value:
|
14
|
+
value: TValueProp;
|
4
15
|
format?: 'rgb' | 'hsl' | 'hex';
|
5
16
|
debounceMS?: number;
|
6
17
|
debounce?: boolean;
|
@@ -20,6 +31,38 @@ export interface IPropsComp {
|
|
20
31
|
showReset?: boolean;
|
21
32
|
onReset?: () => void;
|
22
33
|
}
|
34
|
+
export interface IPropsSolid {
|
35
|
+
value: string;
|
36
|
+
format?: 'rgb' | 'hsl' | 'hex';
|
37
|
+
debounceMS?: number;
|
38
|
+
debounce?: boolean;
|
39
|
+
showAlpha?: boolean;
|
40
|
+
showInputs?: boolean;
|
41
|
+
colorBoardHeight?: number;
|
42
|
+
defaultColors?: string[];
|
43
|
+
onChange?: (value: string) => void;
|
44
|
+
showReset?: boolean;
|
45
|
+
onReset?: () => void;
|
46
|
+
}
|
47
|
+
export interface IPropsGradient {
|
48
|
+
value: string;
|
49
|
+
format?: 'rgb' | 'hsl' | 'hex';
|
50
|
+
debounceMS?: number;
|
51
|
+
debounce?: boolean;
|
52
|
+
showAlpha?: boolean;
|
53
|
+
showInputs?: boolean;
|
54
|
+
showGradientResult?: boolean;
|
55
|
+
showGradientStops?: boolean;
|
56
|
+
showGradientMode?: boolean;
|
57
|
+
showGradientAngle?: boolean;
|
58
|
+
showGradientPosition?: boolean;
|
59
|
+
allowAddGradientStops?: boolean;
|
60
|
+
colorBoardHeight?: number;
|
61
|
+
defaultColors?: string[];
|
62
|
+
onChange?: (value: string) => void;
|
63
|
+
showReset?: boolean;
|
64
|
+
onReset?: () => void;
|
65
|
+
}
|
23
66
|
export interface IPropsMain extends IPropsComp {
|
24
67
|
gradient?: boolean;
|
25
68
|
solid?: boolean;
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { IGradientData } from '../../lib/types';
|
2
|
+
/**
|
3
|
+
* Convert gradient object to CSS gradient string
|
4
|
+
*/
|
5
|
+
export declare function gradientObjectToCss(gradientData: IGradientData): string;
|
6
|
+
/**
|
7
|
+
* Convert CSS gradient string to gradient object
|
8
|
+
*/
|
9
|
+
export declare function cssToGradientObject(cssGradient: string): IGradientData | null;
|
10
|
+
/**
|
11
|
+
* Check if a value is a gradient object
|
12
|
+
*/
|
13
|
+
export declare function isGradientObject(value: any): value is IGradientData;
|
14
|
+
/**
|
15
|
+
* Normalize value to always return a CSS gradient string
|
16
|
+
*/
|
17
|
+
export declare function normalizeGradientValue(value: string | IGradientData): string;
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './gradientConverter';
|
package/dist/utils/index.d.ts
CHANGED
package/package.json
CHANGED