etudes 17.0.0 → 18.0.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.
- package/build/components/CoverImage.d.ts +2 -2
- package/build/components/Image.d.ts +5 -38
- package/build/components/Picture.d.ts +12 -0
- package/build/etudes.js +2449 -2412
- package/build/etudes.umd.cjs +9 -9
- package/build/hooks/useInterval.d.ts +2 -1
- package/build/hooks/useTimeout.d.ts +2 -1
- package/build/index.d.ts +1 -0
- package/build/types/ImageSource.d.ts +62 -0
- package/package.json +17 -17
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { PictureProps } from './Picture.js';
|
|
3
3
|
/**
|
|
4
4
|
* Type describing the props of {@link CoverImage}.
|
|
5
5
|
*/
|
|
6
|
-
export type CoverImageProps = Omit<HTMLAttributes<HTMLDivElement>, 'onLoadStart'> & Pick<
|
|
6
|
+
export type CoverImageProps = Omit<HTMLAttributes<HTMLDivElement>, 'onLoadStart'> & Pick<PictureProps, 'alt' | 'loadingMode' | 'sources' | 'src' | 'onLoadStart' | 'onLoadComplete' | 'onLoadError'> & {
|
|
7
7
|
/**
|
|
8
8
|
* The known aspect ratio of the image, expressed by width / height. If
|
|
9
9
|
* unprovided, it will be inferred after loading the image.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
2
|
import { Size } from 'spase';
|
|
3
|
+
import { ImageSource } from '../types/ImageSource.js';
|
|
3
4
|
/**
|
|
4
5
|
* Type describing the props of {@link Image}.
|
|
5
6
|
*/
|
|
@@ -11,46 +12,12 @@ export type ImageProps = Omit<HTMLAttributes<HTMLImageElement>, 'alt' | 'loading
|
|
|
11
12
|
/**
|
|
12
13
|
* Loading mode for the image.
|
|
13
14
|
*/
|
|
14
|
-
loadingMode?: '
|
|
15
|
+
loadingMode?: 'eager' | 'lazy';
|
|
15
16
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* no `pixelDensity` value.
|
|
17
|
+
* Optional image source. If provided, this will be used to set the `sizes`
|
|
18
|
+
* and `srcset` attributes of the `<img>` element.
|
|
19
19
|
*/
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* A URL specifying an image location.
|
|
23
|
-
*/
|
|
24
|
-
src: string;
|
|
25
|
-
/**
|
|
26
|
-
* Optional intrinsic width (in pixels) of the image expressed as a positive
|
|
27
|
-
* integer. If set, leave `pixelDensity` unspecified (only one of `width` or
|
|
28
|
-
* `pixelDensity` can be specified).
|
|
29
|
-
*/
|
|
30
|
-
width?: number;
|
|
31
|
-
/**
|
|
32
|
-
* Optional pixel density of the image expressed as a positive floating
|
|
33
|
-
* number. If set, leave `width` unspecified (only one of `width` or
|
|
34
|
-
* `pixelDensity` can be specified.
|
|
35
|
-
*/
|
|
36
|
-
pixelDensity?: number;
|
|
37
|
-
}[];
|
|
38
|
-
/**
|
|
39
|
-
* Descriptor for the `sizes` attribute of the `<img>` element.
|
|
40
|
-
*/
|
|
41
|
-
sizes?: {
|
|
42
|
-
/**
|
|
43
|
-
* Optional media query condition (without brackets, i.e. `max-width:
|
|
44
|
-
* 100px`). Note that this must be omitted for the last item in this list of
|
|
45
|
-
* sizes.
|
|
46
|
-
*/
|
|
47
|
-
mediaCondition?: string;
|
|
48
|
-
/**
|
|
49
|
-
* A CSS size value indicating the size of the image's slot on the page,
|
|
50
|
-
* i.e. `100px`, `100vw`, `50%`, etc.
|
|
51
|
-
*/
|
|
52
|
-
width: string;
|
|
53
|
-
}[];
|
|
20
|
+
source?: Omit<ImageSource, 'media' | 'type'>;
|
|
54
21
|
/**
|
|
55
22
|
* Fallback image URL for browsers that do not support the `srcset` attribute.
|
|
56
23
|
*/
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
import { ImageSource } from '../types/ImageSource.js';
|
|
3
|
+
import { ImageProps } from './Image.js';
|
|
4
|
+
/**
|
|
5
|
+
* Type describing the props of {@link Picture}.
|
|
6
|
+
*/
|
|
7
|
+
export type PictureProps = HTMLAttributes<HTMLPictureElement> & Pick<ImageProps, 'alt' | 'loadingMode' | 'src' | 'onLoadStart' | 'onLoadComplete' | 'onLoadError' | 'onSizeChange'> & {
|
|
8
|
+
sources?: ImageSource[];
|
|
9
|
+
};
|
|
10
|
+
export declare const Picture: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLPictureElement> & Pick<ImageProps, "onLoadStart" | "alt" | "src" | "onLoadComplete" | "onLoadError" | "loadingMode" | "onSizeChange"> & {
|
|
11
|
+
sources?: ImageSource[];
|
|
12
|
+
} & import('react').RefAttributes<HTMLPictureElement>>;
|