@propeller-commerce/propeller-v2-react-ui 0.24.0 → 0.26.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/CHANGELOG.md +66 -0
- package/dist/index.cjs +365 -37
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +170 -6
- package/dist/index.d.ts +170 -6
- package/dist/index.js +360 -41
- package/dist/index.js.map +1 -1
- package/dist/pure.cjs +2 -1
- package/dist/pure.cjs.map +1 -1
- package/dist/pure.d.cts +11 -3
- package/dist/pure.d.ts +11 -3
- package/dist/pure.js +2 -1
- package/dist/pure.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/pure.d.cts
CHANGED
|
@@ -528,9 +528,10 @@ interface ProductPriceProps {
|
|
|
528
528
|
language?: string;
|
|
529
529
|
/**
|
|
530
530
|
* ProductPrice object from the product.
|
|
531
|
-
* Obtain from `product.price`.
|
|
531
|
+
* Obtain from `product.price`. Omitted only when `priceOnRequest` renders in
|
|
532
|
+
* its place.
|
|
532
533
|
*/
|
|
533
|
-
price
|
|
534
|
+
price?: ProductPrice;
|
|
534
535
|
/** Currency symbol to display. Defaults to '€'. */
|
|
535
536
|
currency?: string;
|
|
536
537
|
/**
|
|
@@ -560,9 +561,16 @@ interface ProductPriceProps {
|
|
|
560
561
|
options?: ClusterOption[];
|
|
561
562
|
/** Active option product selections — pass Object.values(selectedOptionProducts). Price updates on every change. */
|
|
562
563
|
selectedOptionProducts?: Product[];
|
|
564
|
+
/**
|
|
565
|
+
* Render the price-on-request label instead of an amount.
|
|
566
|
+
* Derive with `isPriceOnRequest(product)` — `price.gross`/`net` are still
|
|
567
|
+
* populated (usually 0) for these products, so an unguarded render shows a
|
|
568
|
+
* real-looking € 0,00.
|
|
569
|
+
*/
|
|
570
|
+
priceOnRequest?: boolean;
|
|
563
571
|
/**
|
|
564
572
|
* Override any UI string.
|
|
565
|
-
* Available keys: inclTax, exclTax, loginToSeePrices
|
|
573
|
+
* Available keys: inclTax, exclTax, loginToSeePrices, priceOnRequest
|
|
566
574
|
*/
|
|
567
575
|
labels?: Record<string, string>;
|
|
568
576
|
/**
|
package/dist/pure.d.ts
CHANGED
|
@@ -528,9 +528,10 @@ interface ProductPriceProps {
|
|
|
528
528
|
language?: string;
|
|
529
529
|
/**
|
|
530
530
|
* ProductPrice object from the product.
|
|
531
|
-
* Obtain from `product.price`.
|
|
531
|
+
* Obtain from `product.price`. Omitted only when `priceOnRequest` renders in
|
|
532
|
+
* its place.
|
|
532
533
|
*/
|
|
533
|
-
price
|
|
534
|
+
price?: ProductPrice;
|
|
534
535
|
/** Currency symbol to display. Defaults to '€'. */
|
|
535
536
|
currency?: string;
|
|
536
537
|
/**
|
|
@@ -560,9 +561,16 @@ interface ProductPriceProps {
|
|
|
560
561
|
options?: ClusterOption[];
|
|
561
562
|
/** Active option product selections — pass Object.values(selectedOptionProducts). Price updates on every change. */
|
|
562
563
|
selectedOptionProducts?: Product[];
|
|
564
|
+
/**
|
|
565
|
+
* Render the price-on-request label instead of an amount.
|
|
566
|
+
* Derive with `isPriceOnRequest(product)` — `price.gross`/`net` are still
|
|
567
|
+
* populated (usually 0) for these products, so an unguarded render shows a
|
|
568
|
+
* real-looking € 0,00.
|
|
569
|
+
*/
|
|
570
|
+
priceOnRequest?: boolean;
|
|
563
571
|
/**
|
|
564
572
|
* Override any UI string.
|
|
565
|
-
* Available keys: inclTax, exclTax, loginToSeePrices
|
|
573
|
+
* Available keys: inclTax, exclTax, loginToSeePrices, priceOnRequest
|
|
566
574
|
*/
|
|
567
575
|
labels?: Record<string, string>;
|
|
568
576
|
/**
|
package/dist/pure.js
CHANGED
|
@@ -825,7 +825,8 @@ function ProductPriceDisplay(props) {
|
|
|
825
825
|
}
|
|
826
826
|
return /* @__PURE__ */ jsxs("div", { className: cn(`propeller-product-price ${props.className || ""}`), "data-hidden": isHidden() ? "true" : "false", children: [
|
|
827
827
|
isHidden() && props.showLoginPrompt !== false ? /* @__PURE__ */ jsx("p", { className: "propeller-product-price__login-prompt text-sm text-muted-foreground italic", children: getLabel(props.labels, "loginToSeePrices", "Log in to see prices") }) : null,
|
|
828
|
-
!isHidden() &&
|
|
828
|
+
!isHidden() && props.priceOnRequest ? /* @__PURE__ */ jsx("p", { className: "propeller-product-price__on-request text-sm text-foreground", children: getLabel(props.labels, "priceOnRequest", "Price on request") }) : null,
|
|
829
|
+
!isHidden() && !props.priceOnRequest && !!getLeadingPrice() ? /* @__PURE__ */ jsxs("div", { className: "propeller-product-price__content flex flex-col gap-0.5", children: [
|
|
829
830
|
/* @__PURE__ */ jsxs("div", { className: "propeller-product-price__primary flex items-baseline gap-2", children: [
|
|
830
831
|
/* @__PURE__ */ jsx(
|
|
831
832
|
"span",
|