@propeller-commerce/propeller-v2-react-ui 0.27.0 → 0.28.0

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/pure.cjs CHANGED
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
+ var jsxRuntime = require('react/jsx-runtime');
3
4
  var propellerV2CoreUi = require('@propeller-commerce/propeller-v2-core-ui');
4
5
  var clsx = require('clsx');
5
6
  var tailwindMerge = require('tailwind-merge');
6
- var jsxRuntime = require('react/jsx-runtime');
7
7
  var React = require('react');
8
8
  var propellerSdkV2 = require('@propeller-commerce/propeller-sdk-v2');
9
9
 
@@ -27,7 +27,23 @@ function _interopNamespace(e) {
27
27
 
28
28
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
29
29
 
30
- // src/components/Breadcrumbs.tsx
30
+ // src/components/PropellerImg.tsx
31
+ function PropellerImg({ as: Injected, ...props }) {
32
+ if (Injected) return /* @__PURE__ */ jsxRuntime.jsx(Injected, { ...props });
33
+ const { src, alt, className, width, height, loading, onClick } = props;
34
+ return /* @__PURE__ */ jsxRuntime.jsx(
35
+ "img",
36
+ {
37
+ src,
38
+ alt,
39
+ className,
40
+ width,
41
+ height,
42
+ loading,
43
+ onClick
44
+ }
45
+ );
46
+ }
31
47
  function cn(...inputs) {
32
48
  return tailwindMerge.twMerge(clsx.clsx(inputs));
33
49
  }
@@ -353,11 +369,13 @@ function OrderItemCard(props) {
353
369
  className: `propeller-order-item-card__cell propeller-order-item-card__cell--product ${isChildItem ? "px-6 py-2 pl-28" : "px-6 py-4"}`,
354
370
  children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-4", children: [
355
371
  showImage ? productImage ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "propeller-order-item-card__media relative w-16 h-16 flex-shrink-0 rounded overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx(
356
- "img",
372
+ PropellerImg,
357
373
  {
374
+ as: props.imgComponent,
358
375
  className: "propeller-order-item-card__image object-cover w-full h-full",
359
376
  src: productImage,
360
- alt: productName
377
+ alt: productName,
378
+ loading: "lazy"
361
379
  }
362
380
  ) }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "propeller-order-item-card__image-placeholder w-16 h-16 bg-surface-hover rounded flex items-center justify-center text-foreground-subtle text-xs", children: propellerV2CoreUi.getLabel(props.labels, "noImage", "No Img") }) : null,
363
381
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
@@ -995,5 +1013,6 @@ exports.ProductJsonLd = ProductJsonLd_default;
995
1013
  exports.ProductPrice = ProductPrice_default;
996
1014
  exports.ProductShortDescription = ProductShortDescription_default;
997
1015
  exports.ProductVideos = ProductVideos_default;
1016
+ exports.PropellerImg = PropellerImg;
998
1017
  //# sourceMappingURL=pure.cjs.map
999
1018
  //# sourceMappingURL=pure.cjs.map