react-ronin
Advanced tools
Comparing version 2.2.5-dependabot-npm-and-yarn-types-react-18.3.3-experimental.0 to 2.2.5
@@ -0,1 +1,2 @@ | ||
/// <reference types="web" /> | ||
import React from "react"; | ||
@@ -45,4 +46,13 @@ import type { StoredObject } from "ronin/types"; | ||
loading?: "lazy"; | ||
/** | ||
* The class names for the image container (not the image itself). | ||
* | ||
*/ | ||
className?: string; | ||
/** | ||
* The inline style for the image container (not the image itself). | ||
*/ | ||
style?: React.CSSProperties; | ||
} | ||
declare const Image: ({ src: input, alt, size: defaultSize, width: defaultWidth, height: defaultHeight, quality, loading, }: ImageProps) => React.JSX.Element; | ||
declare const Image: React.ForwardRefExoticComponent<ImageProps & React.RefAttributes<HTMLDivElement>>; | ||
export default Image; |
"use client"; | ||
import React, { useCallback, useRef } from "react"; | ||
const Image = ({ src: input, alt, size: defaultSize, width: defaultWidth, height: defaultHeight, quality, loading, }) => { | ||
import React, { useCallback, useRef, forwardRef } from "react"; | ||
const Image = forwardRef(({ src: input, alt, size: defaultSize, width: defaultWidth, height: defaultHeight, quality, loading, style, className, }, ref) => { | ||
const imageElement = useRef(null); | ||
@@ -44,3 +44,3 @@ const renderTime = useRef(Date.now()); | ||
}, []); | ||
return (React.createElement("div", { style: { | ||
return (React.createElement("div", { ref: ref, className: className, style: { | ||
position: "relative", | ||
@@ -51,2 +51,3 @@ overflow: "hidden", | ||
height: height || "100%", | ||
...style, | ||
} }, | ||
@@ -60,3 +61,3 @@ placeholder && (React.createElement("img", { style: { position: "absolute", width: "100%", height: "100%" }, src: placeholder, alt: alt })), | ||
}, decoding: "async", onLoad: onLoad, loading: loading, ref: imageElement, src: source, srcSet: responsiveSource }))); | ||
}; | ||
}); | ||
export default Image; |
{ | ||
"name": "react-ronin", | ||
"version": "2.2.5-dependabot-npm-and-yarn-types-react-18.3.3-experimental.0", | ||
"version": "2.2.5", | ||
"license": "Apache-2.0", | ||
@@ -64,3 +64,3 @@ "main": "dist/index.js", | ||
"husky": "9.0.11", | ||
"lint-staged": "15.2.4", | ||
"lint-staged": "15.2.5", | ||
"msw": "2.3.0", | ||
@@ -67,0 +67,0 @@ "react": "18.3.1", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
26962
260
1