@propeller-commerce/propeller-v2-react-ui 0.27.0 → 0.29.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.d.cts CHANGED
@@ -1,7 +1,20 @@
1
1
  import * as React from 'react';
2
- import { Category, Cluster, Product, ProductInventory, OrderItem, Order, ProductPrice, Contact, Customer, PaginatedMediaDocumentResponse, ClusterOption, PaginatedMediaVideoResponse } from '@propeller-commerce/propeller-sdk-v2';
3
2
  import * as _propeller_commerce_propeller_v2_core_ui from '@propeller-commerce/propeller-v2-core-ui';
4
- import { JsonLdContext } from '@propeller-commerce/propeller-v2-core-ui';
3
+ import { ImgComponentProps, JsonLdContext } from '@propeller-commerce/propeller-v2-core-ui';
4
+ import { Category, Cluster, Product, ProductInventory, OrderItem, Order, ProductPrice, Contact, Customer, PaginatedMediaDocumentResponse, ClusterOption, PaginatedMediaVideoResponse } from '@propeller-commerce/propeller-sdk-v2';
5
+
6
+ /**
7
+ * @rsc-safe — Pure display component. No React hooks, no event handlers, no
8
+ * browser APIs, no context reads. Renders directly from props and can be
9
+ * imported into a React Server Component without a 'use client' boundary.
10
+ */
11
+
12
+ interface PropellerImgProps extends ImgComponentProps {
13
+ /** The host's image component. RSC-safe callers pass it; others use `useImgComponent()`. */
14
+ as?: React.ComponentType<ImgComponentProps>;
15
+ }
16
+ /** The package's single `<img>` site. Falls back to `<img>` when nothing is injected. */
17
+ declare function PropellerImg({ as: Injected, ...props }: PropellerImgProps): React.JSX.Element;
5
18
 
6
19
  /**
7
20
  * @rsc-safe — Pure display component. No React hooks, no event handlers, no
@@ -295,6 +308,8 @@ interface OrderItemCardProps {
295
308
  labels?: Record<string, string>;
296
309
  priceComponent?: React.ComponentType<_propeller_commerce_propeller_v2_core_ui.PriceComponentProps>;
297
310
  stockComponent?: React.ComponentType<_propeller_commerce_propeller_v2_core_ui.StockComponentProps>;
311
+ /** Replaces the `<img>`. Passed directly: this component reads no context. */
312
+ imgComponent?: React.ComponentType<_propeller_commerce_propeller_v2_core_ui.ImgComponentProps>;
298
313
  }
299
314
  /**
300
315
  * Renders a single order line item as a table row (with optional indented
@@ -649,4 +664,4 @@ interface ProductVideosProps {
649
664
  */
650
665
  declare function ProductVideos(props: ProductVideosProps): React.JSX.Element;
651
666
 
652
- export { Breadcrumbs, type BreadcrumbsProps, CategoryShortDescription, type CategoryShortDescriptionProps, _default$3 as ClusterJsonLd, type ClusterJsonLdProps, GridTitle, type GridTitleProps, _default$2 as ItemListJsonLd, type ItemListJsonLdProps, _default as ItemStock, type ItemStockProps, OrderItemCard, type OrderItemCardProps, OrderSummary, type OrderSummaryProps, OrderTotals, type OrderTotalsProps, ProductBulkPrices, type ProductBulkPricesProps, ProductDownloads, type ProductDownloadsProps, _default$1 as ProductJsonLd, type ProductJsonLdProps, ProductPriceDisplay as ProductPrice, type ProductPriceProps, ProductShortDescription, type ProductShortDescriptionProps, ProductVideos, type ProductVideosProps };
667
+ export { Breadcrumbs, type BreadcrumbsProps, CategoryShortDescription, type CategoryShortDescriptionProps, _default$3 as ClusterJsonLd, type ClusterJsonLdProps, GridTitle, type GridTitleProps, _default$2 as ItemListJsonLd, type ItemListJsonLdProps, _default as ItemStock, type ItemStockProps, OrderItemCard, type OrderItemCardProps, OrderSummary, type OrderSummaryProps, OrderTotals, type OrderTotalsProps, ProductBulkPrices, type ProductBulkPricesProps, ProductDownloads, type ProductDownloadsProps, _default$1 as ProductJsonLd, type ProductJsonLdProps, ProductPriceDisplay as ProductPrice, type ProductPriceProps, ProductShortDescription, type ProductShortDescriptionProps, ProductVideos, type ProductVideosProps, PropellerImg, type PropellerImgProps };
package/dist/pure.d.ts CHANGED
@@ -1,7 +1,20 @@
1
1
  import * as React from 'react';
2
- import { Category, Cluster, Product, ProductInventory, OrderItem, Order, ProductPrice, Contact, Customer, PaginatedMediaDocumentResponse, ClusterOption, PaginatedMediaVideoResponse } from '@propeller-commerce/propeller-sdk-v2';
3
2
  import * as _propeller_commerce_propeller_v2_core_ui from '@propeller-commerce/propeller-v2-core-ui';
4
- import { JsonLdContext } from '@propeller-commerce/propeller-v2-core-ui';
3
+ import { ImgComponentProps, JsonLdContext } from '@propeller-commerce/propeller-v2-core-ui';
4
+ import { Category, Cluster, Product, ProductInventory, OrderItem, Order, ProductPrice, Contact, Customer, PaginatedMediaDocumentResponse, ClusterOption, PaginatedMediaVideoResponse } from '@propeller-commerce/propeller-sdk-v2';
5
+
6
+ /**
7
+ * @rsc-safe — Pure display component. No React hooks, no event handlers, no
8
+ * browser APIs, no context reads. Renders directly from props and can be
9
+ * imported into a React Server Component without a 'use client' boundary.
10
+ */
11
+
12
+ interface PropellerImgProps extends ImgComponentProps {
13
+ /** The host's image component. RSC-safe callers pass it; others use `useImgComponent()`. */
14
+ as?: React.ComponentType<ImgComponentProps>;
15
+ }
16
+ /** The package's single `<img>` site. Falls back to `<img>` when nothing is injected. */
17
+ declare function PropellerImg({ as: Injected, ...props }: PropellerImgProps): React.JSX.Element;
5
18
 
6
19
  /**
7
20
  * @rsc-safe — Pure display component. No React hooks, no event handlers, no
@@ -295,6 +308,8 @@ interface OrderItemCardProps {
295
308
  labels?: Record<string, string>;
296
309
  priceComponent?: React.ComponentType<_propeller_commerce_propeller_v2_core_ui.PriceComponentProps>;
297
310
  stockComponent?: React.ComponentType<_propeller_commerce_propeller_v2_core_ui.StockComponentProps>;
311
+ /** Replaces the `<img>`. Passed directly: this component reads no context. */
312
+ imgComponent?: React.ComponentType<_propeller_commerce_propeller_v2_core_ui.ImgComponentProps>;
298
313
  }
299
314
  /**
300
315
  * Renders a single order line item as a table row (with optional indented
@@ -649,4 +664,4 @@ interface ProductVideosProps {
649
664
  */
650
665
  declare function ProductVideos(props: ProductVideosProps): React.JSX.Element;
651
666
 
652
- export { Breadcrumbs, type BreadcrumbsProps, CategoryShortDescription, type CategoryShortDescriptionProps, _default$3 as ClusterJsonLd, type ClusterJsonLdProps, GridTitle, type GridTitleProps, _default$2 as ItemListJsonLd, type ItemListJsonLdProps, _default as ItemStock, type ItemStockProps, OrderItemCard, type OrderItemCardProps, OrderSummary, type OrderSummaryProps, OrderTotals, type OrderTotalsProps, ProductBulkPrices, type ProductBulkPricesProps, ProductDownloads, type ProductDownloadsProps, _default$1 as ProductJsonLd, type ProductJsonLdProps, ProductPriceDisplay as ProductPrice, type ProductPriceProps, ProductShortDescription, type ProductShortDescriptionProps, ProductVideos, type ProductVideosProps };
667
+ export { Breadcrumbs, type BreadcrumbsProps, CategoryShortDescription, type CategoryShortDescriptionProps, _default$3 as ClusterJsonLd, type ClusterJsonLdProps, GridTitle, type GridTitleProps, _default$2 as ItemListJsonLd, type ItemListJsonLdProps, _default as ItemStock, type ItemStockProps, OrderItemCard, type OrderItemCardProps, OrderSummary, type OrderSummaryProps, OrderTotals, type OrderTotalsProps, ProductBulkPrices, type ProductBulkPricesProps, ProductDownloads, type ProductDownloadsProps, _default$1 as ProductJsonLd, type ProductJsonLdProps, ProductPriceDisplay as ProductPrice, type ProductPriceProps, ProductShortDescription, type ProductShortDescriptionProps, ProductVideos, type ProductVideosProps, PropellerImg, type PropellerImgProps };
package/dist/pure.js CHANGED
@@ -1,11 +1,27 @@
1
+ import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
1
2
  import { buildClusterJsonLd, safeJsonStringify, buildItemListJsonLd, buildProductJsonLd, getLabel, getLocalizedValue, isContentHidden, formatPrice, localeForLanguage, getCountryName, resolveLanguageEntry, getLanguageString, getLanguageUri } from '@propeller-commerce/propeller-v2-core-ui';
2
3
  import { clsx } from 'clsx';
3
4
  import { twMerge } from 'tailwind-merge';
4
- import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
5
5
  import * as React from 'react';
6
6
  import { OrderDiscountType, YesNo } from '@propeller-commerce/propeller-sdk-v2';
7
7
 
8
- // src/components/Breadcrumbs.tsx
8
+ // src/components/PropellerImg.tsx
9
+ function PropellerImg({ as: Injected, ...props }) {
10
+ if (Injected) return /* @__PURE__ */ jsx(Injected, { ...props });
11
+ const { src, alt, className, width, height, loading, onClick } = props;
12
+ return /* @__PURE__ */ jsx(
13
+ "img",
14
+ {
15
+ src,
16
+ alt,
17
+ className,
18
+ width,
19
+ height,
20
+ loading,
21
+ onClick
22
+ }
23
+ );
24
+ }
9
25
  function cn(...inputs) {
10
26
  return twMerge(clsx(inputs));
11
27
  }
@@ -331,11 +347,13 @@ function OrderItemCard(props) {
331
347
  className: `propeller-order-item-card__cell propeller-order-item-card__cell--product ${isChildItem ? "px-6 py-2 pl-28" : "px-6 py-4"}`,
332
348
  children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4", children: [
333
349
  showImage ? productImage ? /* @__PURE__ */ jsx("div", { className: "propeller-order-item-card__media relative w-16 h-16 flex-shrink-0 rounded overflow-hidden", children: /* @__PURE__ */ jsx(
334
- "img",
350
+ PropellerImg,
335
351
  {
352
+ as: props.imgComponent,
336
353
  className: "propeller-order-item-card__image object-cover w-full h-full",
337
354
  src: productImage,
338
- alt: productName
355
+ alt: productName,
356
+ loading: "lazy"
339
357
  }
340
358
  ) }) : /* @__PURE__ */ 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: getLabel(props.labels, "noImage", "No Img") }) : null,
341
359
  /* @__PURE__ */ jsxs("div", { children: [
@@ -958,6 +976,6 @@ function ProductVideos(props) {
958
976
  }
959
977
  var ProductVideos_default = ProductVideos;
960
978
 
961
- export { Breadcrumbs_default as Breadcrumbs, CategoryShortDescription_default as CategoryShortDescription, ClusterJsonLd_default as ClusterJsonLd, GridTitle_default as GridTitle, ItemListJsonLd_default as ItemListJsonLd, ItemStock_default as ItemStock, OrderItemCard_default as OrderItemCard, OrderSummary_default as OrderSummary, OrderTotals_default as OrderTotals, ProductBulkPrices_default as ProductBulkPrices, ProductDownloads_default as ProductDownloads, ProductJsonLd_default as ProductJsonLd, ProductPrice_default as ProductPrice, ProductShortDescription_default as ProductShortDescription, ProductVideos_default as ProductVideos };
979
+ export { Breadcrumbs_default as Breadcrumbs, CategoryShortDescription_default as CategoryShortDescription, ClusterJsonLd_default as ClusterJsonLd, GridTitle_default as GridTitle, ItemListJsonLd_default as ItemListJsonLd, ItemStock_default as ItemStock, OrderItemCard_default as OrderItemCard, OrderSummary_default as OrderSummary, OrderTotals_default as OrderTotals, ProductBulkPrices_default as ProductBulkPrices, ProductDownloads_default as ProductDownloads, ProductJsonLd_default as ProductJsonLd, ProductPrice_default as ProductPrice, ProductShortDescription_default as ProductShortDescription, ProductVideos_default as ProductVideos, PropellerImg };
962
980
  //# sourceMappingURL=pure.js.map
963
981
  //# sourceMappingURL=pure.js.map