@planetaexo/design-system 0.58.0 → 0.58.2

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/dist/index.cjs CHANGED
@@ -10103,6 +10103,9 @@ function Picture(_a) {
10103
10103
  io.observe(el);
10104
10104
  return () => io.disconnect();
10105
10105
  }, [eager, visible, rootMargin]);
10106
+ React31__namespace.useEffect(() => {
10107
+ setLoaded(false);
10108
+ }, [src]);
10106
10109
  const webp = webpVariantUrl(src);
10107
10110
  const realSrc = visible ? src : PLACEHOLDER_SRC;
10108
10111
  const decodingResolved = decoding != null ? decoding : eager ? void 0 : "async";
@@ -10115,12 +10118,14 @@ function Picture(_a) {
10115
10118
  onError == null ? void 0 : onError(e);
10116
10119
  };
10117
10120
  const showLoader = visible && !loaded;
10121
+ const hideImg = visible && !loaded;
10122
+ const mergedStyle = __spreadValues(__spreadValues({}, imgProps.style), hideImg ? { opacity: 0 } : {});
10118
10123
  if (!webp) {
10119
10124
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
10120
10125
  showLoader && /* @__PURE__ */ jsxRuntime.jsx(PictureLoader, {}),
10121
10126
  /* @__PURE__ */ jsxRuntime.jsx(
10122
10127
  "img",
10123
- __spreadValues({
10128
+ __spreadProps(__spreadValues({
10124
10129
  ref,
10125
10130
  src: realSrc,
10126
10131
  "data-src": visible ? void 0 : src,
@@ -10128,7 +10133,9 @@ function Picture(_a) {
10128
10133
  loading: loading != null ? loading : eager ? void 0 : "lazy",
10129
10134
  onLoad: handleLoad,
10130
10135
  onError: handleError
10131
- }, imgProps)
10136
+ }, imgProps), {
10137
+ style: mergedStyle
10138
+ })
10132
10139
  )
10133
10140
  ] });
10134
10141
  }
@@ -10139,7 +10146,7 @@ function Picture(_a) {
10139
10146
  extraSources,
10140
10147
  /* @__PURE__ */ jsxRuntime.jsx(
10141
10148
  "img",
10142
- __spreadValues({
10149
+ __spreadProps(__spreadValues({
10143
10150
  ref,
10144
10151
  src: realSrc,
10145
10152
  "data-src": visible ? void 0 : src,
@@ -10148,7 +10155,9 @@ function Picture(_a) {
10148
10155
  loading: loading != null ? loading : eager ? void 0 : "lazy",
10149
10156
  onLoad: handleLoad,
10150
10157
  onError: handleError
10151
- }, imgProps)
10158
+ }, imgProps), {
10159
+ style: mergedStyle
10160
+ })
10152
10161
  )
10153
10162
  ] })
10154
10163
  ] });