react-iro-gradient-picker 1.2.3 → 1.2.5
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/dist/index.es.js +202 -34
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +202 -33
- package/dist/index.js.map +1 -1
- package/dist/lib/types/types.d.ts +13 -1
- package/dist/utils/gradient/gradientConverter.d.ts +7 -3
- package/package.json +1 -1
@@ -3,13 +3,25 @@ export interface IGradientStop {
|
|
3
3
|
color: string;
|
4
4
|
position: number;
|
5
5
|
}
|
6
|
+
export interface IFlexibleGradientStop {
|
7
|
+
color: string;
|
8
|
+
position?: number | string;
|
9
|
+
}
|
6
10
|
export interface IGradientData {
|
7
11
|
type: 'linear' | 'radial';
|
8
12
|
angle?: number;
|
9
13
|
stops: IGradientStop[];
|
10
14
|
defaultActiveTab?: 'gradient';
|
11
15
|
}
|
12
|
-
export
|
16
|
+
export interface IFlexibleGradientData {
|
17
|
+
type?: 'linear' | 'radial' | string;
|
18
|
+
angle?: number | string;
|
19
|
+
stops: IFlexibleGradientStop[];
|
20
|
+
direction?: string;
|
21
|
+
position?: string;
|
22
|
+
}
|
23
|
+
export type TValueProp = string | IGradientData | IFlexibleGradientData;
|
24
|
+
export type TValuePropLegacy = string | IGradientData;
|
13
25
|
export interface IPropsComp {
|
14
26
|
value: TValueProp;
|
15
27
|
format?: 'rgb' | 'hsl' | 'hex';
|
@@ -1,8 +1,12 @@
|
|
1
|
-
import { IGradientData } from '../../lib/types';
|
1
|
+
import { IFlexibleGradientData, IGradientData } from '../../lib/types';
|
2
2
|
/**
|
3
|
-
* Convert gradient object to CSS gradient string
|
3
|
+
* Convert gradient object to CSS gradient string (strict typing)
|
4
4
|
*/
|
5
5
|
export declare function gradientObjectToCss(gradientData: IGradientData): string;
|
6
|
+
/**
|
7
|
+
* Convert flexible gradient object to CSS gradient string (loose typing)
|
8
|
+
*/
|
9
|
+
export declare function flexibleGradientToCss(gradientData: IFlexibleGradientData): string;
|
6
10
|
/**
|
7
11
|
* Convert CSS gradient string to gradient object
|
8
12
|
*/
|
@@ -14,4 +18,4 @@ export declare function isGradientObject(value: any): value is IGradientData;
|
|
14
18
|
/**
|
15
19
|
* Normalize value to always return a CSS gradient string
|
16
20
|
*/
|
17
|
-
export declare function normalizeGradientValue(value: string | IGradientData): string;
|
21
|
+
export declare function normalizeGradientValue(value: string | IGradientData | IFlexibleGradientData): string;
|
package/package.json
CHANGED