react-iro-gradient-picker 1.2.1 → 1.2.4

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.
@@ -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 type TValueProp = string | IGradientData;
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 { IGradientData, IFlexibleGradientData } 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;
@@ -11,5 +11,5 @@ interface IParsedGraient {
11
11
  sideCorner?: string;
12
12
  parseWarning?: boolean;
13
13
  }
14
- declare const _default: (input: string) => string | IParsedGraient;
14
+ declare const _default: (input: string) => IParsedGraient | string;
15
15
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-iro-gradient-picker",
3
- "version": "1.2.1",
3
+ "version": "1.2.4",
4
4
  "description": "Modern React gradient and solid color picker with complete dark theme support, built with TypeScript and Tailwind CSS",
5
5
  "keywords": [
6
6
  "react",