gantri-components 2.241.0 → 2.242.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.
|
@@ -1,16 +1,30 @@
|
|
|
1
1
|
import { Property } from 'csstype';
|
|
2
|
-
import { CSSProperties, ReactEventHandler } from 'react';
|
|
2
|
+
import { AriaAttributes, CSSProperties, ImgHTMLAttributes, ReactEventHandler } from 'react';
|
|
3
3
|
import { IGravity } from '@cloudinary/url-gen/qualifiers/gravity/GravityQualifier';
|
|
4
4
|
import { ImageFormatType, VideoFormatType } from '@cloudinary/transformation-builder-sdk/types/types';
|
|
5
5
|
import { ResolutionAwareProp } from '../../types/resolution-aware-prop.type';
|
|
6
6
|
import { Color } from '../../styles';
|
|
7
|
+
/**
|
|
8
|
+
* HTML/ARIA attributes the underlying `<img>` accepts as pass-throughs.
|
|
9
|
+
* These are forwarded as-is so callers can opt into native behaviour
|
|
10
|
+
* (e.g. `draggable={false}` inside a Carousel cell, `crossOrigin="anonymous"`
|
|
11
|
+
* for canvas extraction, `tabIndex` for focus management) without having to
|
|
12
|
+
* eject from `<Picture>`.
|
|
13
|
+
*
|
|
14
|
+
* Anything not in this Pick is intentionally NOT exposed to keep the API
|
|
15
|
+
* narrow — `width`, `height`, `sizes`, `srcSet`, `loading`, `fetchPriority`,
|
|
16
|
+
* `onLoad`, `onError`, `onClick` are owned by the component itself.
|
|
17
|
+
*/
|
|
18
|
+
export type PicturePassThroughProps = Pick<ImgHTMLAttributes<HTMLImageElement>, 'crossOrigin' | 'draggable' | 'id' | 'referrerPolicy' | 'role' | 'tabIndex' | 'title'> & AriaAttributes & {
|
|
19
|
+
[dataAttr: `data-${string}`]: string | number | boolean | undefined;
|
|
20
|
+
};
|
|
7
21
|
export type PictureCrop = 'scale' | 'limitFit' | 'limitFill' | 'limitPad' | 'fill' | 'fit' | 'crop' | 'pad' | 'imaggaCrop' | 'imaggaScale' | 'minimumFit' | 'minimumPad' | 'fillPad' | 'thumbnail';
|
|
8
22
|
export type PictureQuality = 'auto' | 'autoBest' | 'autoEco' | 'autoGood' | 'autoLow' | 'jpegmini' | 'jpegminiBest' | 'jpegminiHigh' | 'jpegminiMedium';
|
|
9
23
|
export type PictureFormat = ImageFormatType | VideoFormatType;
|
|
10
24
|
export type PictureEffect = 'grayscale' | 'sepia' | 'blackwhite' | 'negate' | 'oil_paint' | 'cartoonify' | 'vignette' | 'pixelate' | string;
|
|
11
25
|
export type PicturePlaceholder = 'blur' | 'color' | 'none';
|
|
12
26
|
export type PictureAs = 'image' | 'video-frame';
|
|
13
|
-
export interface PictureProps {
|
|
27
|
+
export interface PictureProps extends PicturePassThroughProps {
|
|
14
28
|
src: ResolutionAwareProp<string>;
|
|
15
29
|
alt: string;
|
|
16
30
|
/** Override auto-detection of how to render the asset. */
|