gantri-components 1.144.7 → 1.144.8

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.
@@ -0,0 +1 @@
1
+ export { ProgressiveImage } from './progressive-image';
@@ -0,0 +1 @@
1
+ export { ProgressiveImage } from './progressive-image';
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ import { ProgressiveImageProps } from './progressive-image.types';
3
+ export declare const ProgressiveImage: FC<ProgressiveImageProps>;
@@ -0,0 +1,7 @@
1
+ import { ResolutionAwarePropBase } from '../../../../types/resolution-aware-prop.type';
2
+ import { ImageProps } from '../../image.types';
3
+ export interface ProgressiveImageProps extends Pick<ImageProps, 'onClick' | 'objectFit' | 'objectPosition' | 'className' | 'style'> {
4
+ alt: NonNullable<string>;
5
+ onLoad?: () => void;
6
+ src: NonNullable<ResolutionAwarePropBase<string>>;
7
+ }
@@ -1,5 +1,7 @@
1
- import { ImageProps, ImageSource, TransformationMode, TransformationQuality, TransformationType } from './image.types';
1
+ import { IGravity } from '@cloudinary/url-gen/qualifiers/gravity/GravityQualifier';
2
+ import { AspectRatio, Dpr, ImageDimension, ImageProps, ImageSource, TransformationMode, TransformationQuality, TransformationType } from './image.types';
3
+ import { ResolutionAwarePropBase } from '../../types/resolution-aware-prop.type';
2
4
  import { Optional } from '../../types/common';
3
5
  export declare const extractSizePropertyValue: (prop: Optional<string | number>) => number | undefined;
4
- export declare const generateCloudinaryUrl: (source: ImageSource, imageName?: string | undefined, aspectRatio?: string | undefined, width?: Optional<number | string>, height?: Optional<number | string>, mode?: Optional<TransformationMode>, quality?: Optional<TransformationQuality>, dpr?: Optional<number>, type?: Optional<TransformationType>) => string;
5
- export declare const generateImages: (params: Partial<ImageProps>, type?: TransformationType) => string | [Optional<string>, Optional<string>, Optional<string>];
6
+ export declare const generateCloudinaryUrl: (source: ImageSource, imageName?: string | undefined, aspectRatio?: AspectRatio | undefined, width?: Optional<ImageDimension>, height?: Optional<ImageDimension>, mode?: Optional<TransformationMode>, quality?: Optional<TransformationQuality>, dpr?: Optional<Dpr>, type?: Optional<TransformationType>, gravity?: Optional<IGravity>) => string;
7
+ export declare const generateImages: (params: Partial<ImageProps>, type?: TransformationType) => string | ResolutionAwarePropBase<string>;
@@ -1,3 +1,2 @@
1
- import { ImageProps, Transformations } from './image.types';
1
+ import { ImageProps } from './image.types';
2
2
  export declare const ImagePresets: Partial<ImageProps>;
3
- export declare const TransformationPresets: Partial<Transformations>;
@@ -1,29 +1,34 @@
1
1
  import { Property } from 'csstype';
2
2
  import { CSSProperties } from 'react';
3
+ import { IGravity } from '@cloudinary/url-gen/qualifiers/gravity/GravityQualifier';
3
4
  import { ResolutionAwareProp } from '../../types/resolution-aware-prop.type';
4
5
  import { Color } from '../../styles';
5
6
  import { Optional } from '../../types/common';
7
+ export declare type AspectRatio = `${number}:${number}` | number;
8
+ export declare type ImageDimension = `${string}px` | `${string}rem` | number;
9
+ export declare type Dpr = number | 'auto';
6
10
  export declare type ImageTransformationsVariant = 'f' | 'h' | 'q' | 'ffh' | 'hff' | 'hhf';
7
11
  export interface ImageProps {
8
12
  alt: string;
9
- aspectRatio?: Optional<ResolutionAwareProp<string>>;
10
13
  className?: string;
11
- commonTransformations?: Optional<Transformations>;
12
- dpr?: Optional<number>;
14
+ /**
15
+ * Defines the aspect ratio of the image container, if a transformation is not provided,
16
+ * the aspectRatio transformation will inherit from this value.
17
+ * */
18
+ containerAspectRatio?: Optional<ResolutionAwareProp<AspectRatio>>;
19
+ dpr?: Optional<Dpr>;
13
20
  fallbackColor?: Optional<Color>;
14
21
  fetchImmediately?: boolean;
15
- height?: Optional<ResolutionAwareProp<string | number>>;
22
+ height?: Optional<ResolutionAwareProp<ImageDimension>>;
16
23
  immediateAvailable?: Optional<boolean>;
17
24
  maxHeight?: Optional<ResolutionAwareProp<Property.MaxHeight>>;
18
25
  maxWidth?: Optional<ResolutionAwareProp<Property.MinWidth>>;
19
26
  minHeight?: Optional<ResolutionAwareProp<Property.MinHeight>>;
20
27
  minWidth?: Optional<ResolutionAwareProp<Property.MinWidth>>;
21
- mode?: Optional<ResolutionAwareProp<TransformationMode>>;
22
28
  objectFit?: Optional<ResolutionAwareProp<Property.ObjectFit>>;
23
29
  objectPosition?: Optional<ResolutionAwareProp<Property.ObjectPosition>>;
24
30
  observerMargin?: string;
25
31
  onClick?: () => void;
26
- quality?: Optional<TransformationQuality>;
27
32
  showLoadingIndicator?: Optional<boolean>;
28
33
  source?: Optional<ImageSource>;
29
34
  src: ResolutionAwareProp<string>;
@@ -39,18 +44,20 @@ export interface ImageProps {
39
44
  * hhf => desktop half width, tablet half width, mobile full width
40
45
  */
41
46
  transformationsVariant?: Optional<ImageTransformationsVariant>;
42
- width?: Optional<ResolutionAwareProp<string | number>>;
47
+ width?: Optional<ResolutionAwareProp<ImageDimension>>;
43
48
  }
44
49
  export interface Transformations {
45
- aspectRatio?: Optional<string>;
46
- height?: Optional<number>;
47
- mode?: Optional<TransformationMode>;
48
- width?: Optional<number>;
50
+ aspectRatio?: AspectRatio;
51
+ gravity?: IGravity;
52
+ height?: ImageDimension;
53
+ mode?: TransformationMode;
54
+ quality?: TransformationQuality;
55
+ width?: ImageDimension;
49
56
  }
50
57
  export declare type ImageSource = 'static' | 'dynamic' | 'absolute';
51
58
  export declare type TransformationMode = 'scale' | 'limitFit' | 'limitFill' | 'limitPad' | 'fill' | 'fit' | 'crop' | 'pad' | 'imaggaCrop' | 'imaggaScale' | 'minimumFit' | 'minimumPad' | 'fillPad';
52
59
  export declare type TransformationQuality = 'auto' | 'autoBest' | 'autoEco' | 'autoGood' | 'autoLow' | 'jpegmini' | 'jpegminiBest' | 'jpegminiHigh' | 'jpegminiMedium';
53
- export interface StyledImageContainerProps extends Pick<ImageProps, 'aspectRatio' | 'width' | 'height' | 'fallbackColor' | 'maxWidth' | 'maxHeight' | 'minWidth' | 'minHeight'> {
60
+ export interface StyledImageContainerProps extends Pick<ImageProps, 'containerAspectRatio' | 'width' | 'height' | 'fallbackColor' | 'maxWidth' | 'maxHeight' | 'minWidth' | 'minHeight'> {
54
61
  }
55
62
  export interface StyledImageProps extends Pick<ImageProps, 'objectFit' | 'objectPosition'> {
56
63
  }
@@ -30,4 +30,3 @@ export * from './text-field';
30
30
  export * from './toggle';
31
31
  export * from './tooltip';
32
32
  export * from './typography';
33
- export * from './video';
@@ -1,9 +1,8 @@
1
1
  import { AppSize, ResolutionAwareProp, ResolutionAwarePropBase } from '../types/resolution-aware-prop.type';
2
2
  import { ExtractStyleFromResolutionAwarePropEntry } from '../types/layout';
3
- export declare function extractValuesFromResolutionAwareProp<T = unknown>(prop: unknown): ResolutionAwarePropBase<T>;
4
- export declare const isResolutionAwareProperty: (prop: unknown) => prop is any;
5
- export declare const getResolutionPrefix: () => AppSize;
6
- export declare const extractValueFromResolutionAwareProp: (prop: any, size: AppSize) => any;
3
+ export declare const isResolutionAwarePropBase: (prop: unknown) => prop is any;
4
+ export declare function extractValuesFromResolutionAwareProp<T = unknown>(prop: unknown): Required<ResolutionAwarePropBase<T>>;
5
+ export declare const extractValueFromResolutionAwareProp: (prop: unknown, size: AppSize) => any;
7
6
  export declare const calculateDimensionsFromAspectRatio: (aspectRatio: string) => {
8
7
  height: string;
9
8
  width: string;