@propeller-commerce/propeller-v2-react-ui 0.4.16 → 0.4.17
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/CHANGELOG.md +12 -0
- package/dist/index.cjs +14 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +28 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.js +14 -2
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,18 @@ once it reaches 1.0. Until then (the `0.x` line) the public API may change
|
|
|
8
8
|
between minor versions; breaking changes are called out below and in
|
|
9
9
|
[MIGRATION.md](./MIGRATION.md).
|
|
10
10
|
|
|
11
|
+
## [0.4.17] - 2026-07-09
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- `ProductCard` / `ProductGrid`: new `belowName?: (product: Product) => ReactNode`
|
|
16
|
+
render prop. Renders arbitrary host-supplied content directly below the
|
|
17
|
+
product name (and above the short description / price) in both the grid and
|
|
18
|
+
row layouts, without forking the card — e.g. package descriptions or custom
|
|
19
|
+
badges. On `ProductGrid` it cascades to every card via `ProductGridConfig`;
|
|
20
|
+
on `ProductCard` it can also be set per-card (explicit prop wins over grid
|
|
21
|
+
context). Also exposed as the `<ProductCard.BelowName>` compound subcomponent.
|
|
22
|
+
|
|
11
23
|
## [0.4.16] - 2026-07-09
|
|
12
24
|
|
|
13
25
|
### Added
|
package/dist/index.cjs
CHANGED
|
@@ -13322,7 +13322,8 @@ var RESOLVE_SPEC2 = {
|
|
|
13322
13322
|
addToCartComponent: { grid: "addToCartComponent" },
|
|
13323
13323
|
imageComponent: { grid: "imageComponent" },
|
|
13324
13324
|
badgesComponent: { grid: "badgesComponent" },
|
|
13325
|
-
favoriteComponent: { grid: "favoriteComponent" }
|
|
13325
|
+
favoriteComponent: { grid: "favoriteComponent" },
|
|
13326
|
+
belowName: { grid: "belowName" }
|
|
13326
13327
|
};
|
|
13327
13328
|
var ProductCardContext = React6.createContext(null);
|
|
13328
13329
|
function useProductCard() {
|
|
@@ -13403,6 +13404,7 @@ function ProductCardRoot(rawProps) {
|
|
|
13403
13404
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "propeller-product-card__body flex flex-1 flex-row items-center gap-4 px-4 py-2 min-w-0", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-0.5 flex-1 min-w-0", children: [
|
|
13404
13405
|
props.showSku !== false && sku ? /* @__PURE__ */ jsxRuntime.jsx(ProductCardSku, {}) : null,
|
|
13405
13406
|
props.showName !== false ? /* @__PURE__ */ jsxRuntime.jsx(ProductCardName, { linkable: true }) : null,
|
|
13407
|
+
/* @__PURE__ */ jsxRuntime.jsx(ProductCardBelowName, {}),
|
|
13406
13408
|
textLabelValues.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(ProductCardTextLabels, {}) : null,
|
|
13407
13409
|
props.showManufacturer && manufacturer ? /* @__PURE__ */ jsxRuntime.jsx(ProductCardManufacturer, {}) : null,
|
|
13408
13410
|
props.showShortDescription && shortDescription ? /* @__PURE__ */ jsxRuntime.jsx(ProductCardShortDescription, {}) : null
|
|
@@ -13418,6 +13420,7 @@ function ProductCardRoot(rawProps) {
|
|
|
13418
13420
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "propeller-product-card__body flex flex-1 flex-col gap-1.5 p-3 sm:gap-2 sm:p-4", children: [
|
|
13419
13421
|
props.showSku !== false && sku ? /* @__PURE__ */ jsxRuntime.jsx(ProductCardSku, {}) : null,
|
|
13420
13422
|
props.showName !== false ? /* @__PURE__ */ jsxRuntime.jsx(ProductCardName, { linkable: true }) : null,
|
|
13423
|
+
/* @__PURE__ */ jsxRuntime.jsx(ProductCardBelowName, {}),
|
|
13421
13424
|
textLabelValues.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(ProductCardTextLabels, {}) : null,
|
|
13422
13425
|
props.showStock && !!product.inventory ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "hidden md:block", children: /* @__PURE__ */ jsxRuntime.jsx(ProductCardStock, {}) }) : null,
|
|
13423
13426
|
props.showManufacturer && manufacturer ? /* @__PURE__ */ jsxRuntime.jsx(ProductCardManufacturer, {}) : null,
|
|
@@ -13600,6 +13603,13 @@ function ProductCardStock(props) {
|
|
|
13600
13603
|
}
|
|
13601
13604
|
);
|
|
13602
13605
|
}
|
|
13606
|
+
function ProductCardBelowName() {
|
|
13607
|
+
const { product, resolved } = useProductCard();
|
|
13608
|
+
if (!resolved.belowName) return null;
|
|
13609
|
+
const content = resolved.belowName(product);
|
|
13610
|
+
if (content == null || content === false) return null;
|
|
13611
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "propeller-product-card__below-name", children: content });
|
|
13612
|
+
}
|
|
13603
13613
|
function ProductCardPrice(props) {
|
|
13604
13614
|
const { product, derived, resolved } = useProductCard();
|
|
13605
13615
|
if (!product?.price) return null;
|
|
@@ -13678,6 +13688,7 @@ ProductCard.Badges = ProductCardBadges;
|
|
|
13678
13688
|
ProductCard.Favorite = ProductCardFavorite;
|
|
13679
13689
|
ProductCard.Name = ProductCardName;
|
|
13680
13690
|
ProductCard.Sku = ProductCardSku;
|
|
13691
|
+
ProductCard.BelowName = ProductCardBelowName;
|
|
13681
13692
|
ProductCard.ShortDescription = ProductCardShortDescription;
|
|
13682
13693
|
ProductCard.Manufacturer = ProductCardManufacturer;
|
|
13683
13694
|
ProductCard.TextLabels = ProductCardTextLabels;
|
|
@@ -14060,7 +14071,8 @@ function ProductGrid(rawProps) {
|
|
|
14060
14071
|
badgesComponent: props.badgesComponent,
|
|
14061
14072
|
favoriteComponent: props.favoriteComponent,
|
|
14062
14073
|
productCardComponent: props.productCardComponent,
|
|
14063
|
-
clusterCardComponent: props.clusterCardComponent
|
|
14074
|
+
clusterCardComponent: props.clusterCardComponent,
|
|
14075
|
+
belowName: props.belowName
|
|
14064
14076
|
};
|
|
14065
14077
|
if (rawProps.children !== void 0) {
|
|
14066
14078
|
const compoundCtx = {
|