@docpensieve/components 0.1.5 → 0.2.0-beta.1

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/README.md CHANGED
@@ -1,3 +1,7 @@
1
+ <p align="center">
2
+ <img src="https://raw.githubusercontent.com/Juniors017/docpensieve/main/branding/logo.jpg" alt="DocPensieve — Documentation &amp; Magical Memory" width="180">
3
+ </p>
4
+
1
5
  # @docpensieve/components
2
6
 
3
7
  > Global MDX components
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docpensieve/components",
3
- "version": "0.1.5",
3
+ "version": "0.2.0-beta.1",
4
4
  "description": "DocPensieve global MDX components, usable without import: Card, Columns, Tooltip, Tree, Skill, TimeTimer, LogoIcon, ScrollToTop",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -20,7 +20,7 @@
20
20
  "types"
21
21
  ],
22
22
  "dependencies": {
23
- "@docpensieve/shared": "0.1.5"
23
+ "@docpensieve/shared": "0.2.0-beta.1"
24
24
  },
25
25
  "peerDependencies": {
26
26
  "react": "^19"
@@ -37,7 +37,7 @@
37
37
  "url": "git+https://github.com/Juniors017/docpensieve.git",
38
38
  "directory": "packages/components"
39
39
  },
40
- "homepage": "https://github.com/Juniors017/docpensieve#readme",
40
+ "homepage": "https://docpensieve.com",
41
41
  "bugs": {
42
42
  "url": "https://github.com/Juniors017/docpensieve/issues"
43
43
  },
package/src/card.js CHANGED
@@ -79,16 +79,20 @@ export const CardFooter = cardPart('cardFooter', 'CardFooter');
79
79
  *
80
80
  * @param {{
81
81
  * className?: string, style?: object, src?: string,
82
- * alt?: string, title?: string, srcSet?: string, sizes?: string,
82
+ * alt?: string, title?: string, srcSet?: string, sizes?: string, loading?: 'lazy' | 'eager',
83
83
  * }} props `alt` defaults to the empty string: without that attribute, a
84
84
  * screen reader would announce the file URL.
85
85
  */
86
- export function CardImage({ className, style, src, alt = '', ...rest }) {
86
+ export function CardImage({ className, style, src, alt = '', loading = 'lazy', ...rest }) {
87
87
  return h('img', {
88
88
  className: classNames(cls('cardImage'), className),
89
89
  style,
90
90
  src: resolveUrl(src),
91
91
  alt,
92
+ // Lazy by default: a card image is rarely what the reader sees first,
93
+ // and React stops preloading an image loaded lazily.
94
+ loading,
95
+ decoding: 'async',
92
96
  ...rest,
93
97
  });
94
98
  }
package/types/card.d.ts CHANGED
@@ -49,11 +49,11 @@ export declare const CardFooter: (props: PartProps) => any;
49
49
  *
50
50
  * @param {{
51
51
  * className?: string, style?: object, src?: string,
52
- * alt?: string, title?: string, srcSet?: string, sizes?: string,
52
+ * alt?: string, title?: string, srcSet?: string, sizes?: string, loading?: 'lazy' | 'eager',
53
53
  * }} props `alt` defaults to the empty string: without that attribute, a
54
54
  * screen reader would announce the file URL.
55
55
  */
56
- export declare function CardImage({ className, style, src, alt, ...rest }: {
56
+ export declare function CardImage({ className, style, src, alt, loading, ...rest }: {
57
57
  className?: string;
58
58
  style?: object;
59
59
  src?: string;
@@ -61,6 +61,7 @@ export declare function CardImage({ className, style, src, alt, ...rest }: {
61
61
  title?: string;
62
62
  srcSet?: string;
63
63
  sizes?: string;
64
+ loading?: 'lazy' | 'eager';
64
65
  }): import("react").DetailedReactHTMLElement<{
65
66
  title?: string;
66
67
  srcSet?: string;
@@ -69,4 +70,6 @@ export declare function CardImage({ className, style, src, alt, ...rest }: {
69
70
  style: object | undefined;
70
71
  src: string | undefined;
71
72
  alt: string;
73
+ loading: "eager" | "lazy";
74
+ decoding: string;
72
75
  }, HTMLElement>;