@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.js CHANGED
@@ -10060,6 +10060,7 @@ function Picture(_a) {
10060
10060
  "onLoad",
10061
10061
  "onError"
10062
10062
  ]);
10063
+ var _a2;
10063
10064
  const ref = React31.useRef(null);
10064
10065
  const [visible, setVisible] = React31.useState(eager);
10065
10066
  const [loaded, setLoaded] = React31.useState(false);
@@ -10088,6 +10089,7 @@ function Picture(_a) {
10088
10089
  const webp = webpVariantUrl(src);
10089
10090
  const realSrc = visible ? src : PLACEHOLDER_SRC;
10090
10091
  const decodingResolved = decoding != null ? decoding : eager ? void 0 : "async";
10092
+ const fetchPriorityResolved = (_a2 = imgProps.fetchPriority) != null ? _a2 : eager ? void 0 : "low";
10091
10093
  const handleLoad = (e) => {
10092
10094
  if (visible) setLoaded(true);
10093
10095
  onLoad == null ? void 0 : onLoad(e);
@@ -10097,12 +10099,14 @@ function Picture(_a) {
10097
10099
  onError == null ? void 0 : onError(e);
10098
10100
  };
10099
10101
  const showLoader = visible && !loaded;
10102
+ const hideImg = visible && !loaded;
10103
+ const mergedStyle = __spreadValues(__spreadValues({}, imgProps.style), hideImg ? { opacity: 0 } : {});
10100
10104
  if (!webp) {
10101
10105
  return /* @__PURE__ */ jsxs(Fragment, { children: [
10102
10106
  showLoader && /* @__PURE__ */ jsx(PictureLoader, {}),
10103
10107
  /* @__PURE__ */ jsx(
10104
10108
  "img",
10105
- __spreadValues({
10109
+ __spreadProps(__spreadValues({
10106
10110
  ref,
10107
10111
  src: realSrc,
10108
10112
  "data-src": visible ? void 0 : src,
@@ -10110,7 +10114,10 @@ function Picture(_a) {
10110
10114
  loading: loading != null ? loading : eager ? void 0 : "lazy",
10111
10115
  onLoad: handleLoad,
10112
10116
  onError: handleError
10113
- }, imgProps)
10117
+ }, imgProps), {
10118
+ fetchPriority: fetchPriorityResolved,
10119
+ style: mergedStyle
10120
+ })
10114
10121
  )
10115
10122
  ] });
10116
10123
  }
@@ -10121,7 +10128,7 @@ function Picture(_a) {
10121
10128
  extraSources,
10122
10129
  /* @__PURE__ */ jsx(
10123
10130
  "img",
10124
- __spreadValues({
10131
+ __spreadProps(__spreadValues({
10125
10132
  ref,
10126
10133
  src: realSrc,
10127
10134
  "data-src": visible ? void 0 : src,
@@ -10130,7 +10137,10 @@ function Picture(_a) {
10130
10137
  loading: loading != null ? loading : eager ? void 0 : "lazy",
10131
10138
  onLoad: handleLoad,
10132
10139
  onError: handleError
10133
- }, imgProps)
10140
+ }, imgProps), {
10141
+ fetchPriority: fetchPriorityResolved,
10142
+ style: mergedStyle
10143
+ })
10134
10144
  )
10135
10145
  ] })
10136
10146
  ] });