@planetaexo/design-system 0.58.1 → 0.58.3

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
@@ -10081,6 +10081,7 @@ function Picture(_a) {
10081
10081
  "onLoad",
10082
10082
  "onError"
10083
10083
  ]);
10084
+ var _a2;
10084
10085
  const ref = React31__namespace.useRef(null);
10085
10086
  const [visible, setVisible] = React31__namespace.useState(eager);
10086
10087
  const [loaded, setLoaded] = React31__namespace.useState(false);
@@ -10109,6 +10110,7 @@ function Picture(_a) {
10109
10110
  const webp = webpVariantUrl(src);
10110
10111
  const realSrc = visible ? src : PLACEHOLDER_SRC;
10111
10112
  const decodingResolved = decoding != null ? decoding : eager ? void 0 : "async";
10113
+ const fetchPriorityResolved = (_a2 = imgProps.fetchPriority) != null ? _a2 : eager ? void 0 : "low";
10112
10114
  const handleLoad = (e) => {
10113
10115
  if (visible) setLoaded(true);
10114
10116
  onLoad == null ? void 0 : onLoad(e);
@@ -10118,12 +10120,14 @@ function Picture(_a) {
10118
10120
  onError == null ? void 0 : onError(e);
10119
10121
  };
10120
10122
  const showLoader = visible && !loaded;
10123
+ const hideImg = visible && !loaded;
10124
+ const mergedStyle = __spreadValues(__spreadValues({}, imgProps.style), hideImg ? { opacity: 0 } : {});
10121
10125
  if (!webp) {
10122
10126
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
10123
10127
  showLoader && /* @__PURE__ */ jsxRuntime.jsx(PictureLoader, {}),
10124
10128
  /* @__PURE__ */ jsxRuntime.jsx(
10125
10129
  "img",
10126
- __spreadValues({
10130
+ __spreadProps(__spreadValues({
10127
10131
  ref,
10128
10132
  src: realSrc,
10129
10133
  "data-src": visible ? void 0 : src,
@@ -10131,7 +10135,10 @@ function Picture(_a) {
10131
10135
  loading: loading != null ? loading : eager ? void 0 : "lazy",
10132
10136
  onLoad: handleLoad,
10133
10137
  onError: handleError
10134
- }, imgProps)
10138
+ }, imgProps), {
10139
+ fetchPriority: fetchPriorityResolved,
10140
+ style: mergedStyle
10141
+ })
10135
10142
  )
10136
10143
  ] });
10137
10144
  }
@@ -10142,7 +10149,7 @@ function Picture(_a) {
10142
10149
  extraSources,
10143
10150
  /* @__PURE__ */ jsxRuntime.jsx(
10144
10151
  "img",
10145
- __spreadValues({
10152
+ __spreadProps(__spreadValues({
10146
10153
  ref,
10147
10154
  src: realSrc,
10148
10155
  "data-src": visible ? void 0 : src,
@@ -10151,7 +10158,10 @@ function Picture(_a) {
10151
10158
  loading: loading != null ? loading : eager ? void 0 : "lazy",
10152
10159
  onLoad: handleLoad,
10153
10160
  onError: handleError
10154
- }, imgProps)
10161
+ }, imgProps), {
10162
+ fetchPriority: fetchPriorityResolved,
10163
+ style: mergedStyle
10164
+ })
10155
10165
  )
10156
10166
  ] })
10157
10167
  ] });