@propeller-commerce/propeller-v2-react-ui 0.15.2 → 0.15.4

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 CHANGED
@@ -8,6 +8,32 @@ 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.15.4] - 2026-08-10
12
+
13
+ ### Fixed
14
+
15
+ - `<ItemsOverview>` follows the Incl./Excl. BTW toggle. It never resolved infra,
16
+ so it printed `item.price × quantity` — always excl. VAT — while `<CartItem>`
17
+ on the cart page printed `totalSumNet` (incl.). The same lines therefore
18
+ appeared on two different tax bases in consecutive checkout steps. It now
19
+ reads `includeTax` (and `currency` / `language`, which also silently fell back
20
+ to `'€'` and no language) from `<PropellerProvider>`, and takes line totals
21
+ from `totalSum` / `totalSumNet` — the same fields `<CartItem>` reads. Bundle,
22
+ bundle-item and child-option prices switch on the same basis.
23
+
24
+ Hosts that already render inside `<PropellerProvider>` need no change; pass
25
+ `includeTax` explicitly to override.
26
+
27
+ ## [0.15.3] - 2026-08-10
28
+
29
+ ### Fixed
30
+
31
+ - `<CartSummary>` renders a **Transaction costs** line when the cart's payment
32
+ method carries a fee. The fee was already inside `total.totalGross`, so the
33
+ panel's own rows never added up to the "Total excl. VAT" it printed — a €7.25
34
+ order with €49.00 shipping showed €56.60. `<OrderTotals>` has always shown
35
+ this row; the cart panel now matches. Label key: `transactionCosts`.
36
+
11
37
  ## [0.15.2] - 2026-08-10
12
38
 
13
39
  ### Fixed
package/dist/index.cjs CHANGED
@@ -7815,6 +7815,12 @@ function CartSummary(rawProps) {
7815
7815
  function discountAmount() {
7816
7816
  return props.cart?.total?.discount || 0;
7817
7817
  }
7818
+ function hasTransactionCosts() {
7819
+ return (props.cart?.paymentData?.price || 0) > 0;
7820
+ }
7821
+ function transactionCosts() {
7822
+ return Number(props.cart?.paymentData?.price || 0);
7823
+ }
7818
7824
  function hasShippingCosts() {
7819
7825
  return (props.cart?.postageData?.price || 0) > 0;
7820
7826
  }
@@ -7889,6 +7895,10 @@ function CartSummary(rawProps) {
7889
7895
  formatItemPrice(discountAmount())
7890
7896
  ] })
7891
7897
  ] }) : null,
7898
+ hasTransactionCosts() ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "propeller-cart-summary__row flex justify-between text-muted-foreground", "data-row": "transaction-costs", children: [
7899
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "propeller-cart-summary__label", children: propellerV2CoreUi.getLabel(props.labels, "transactionCosts", "Transaction costs:") }),
7900
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "propeller-cart-summary__value", children: formatItemPrice(transactionCosts()) })
7901
+ ] }) : null,
7892
7902
  showShippingCosts() && hasShippingCosts() ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "propeller-cart-summary__row flex justify-between text-muted-foreground", "data-row": "shipping-costs", children: [
7893
7903
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "propeller-cart-summary__label", children: propellerV2CoreUi.getLabel(props.labels, "shippingCosts", "Shipping costs:") }),
7894
7904
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "propeller-cart-summary__value", children: formatItemPrice(shippingCosts()) })
@@ -12849,7 +12859,9 @@ function getBundleNonLeaders(item) {
12849
12859
  if (!items) return [];
12850
12860
  return items.filter((bi) => bi.isLeader !== propellerSdkV2.YesNo.Y);
12851
12861
  }
12852
- function ItemsOverview(props) {
12862
+ function ItemsOverview(rawProps) {
12863
+ const props = useInfraProps(rawProps);
12864
+ const useTax = !!props.includeTax;
12853
12865
  const containerClass = props.itemsOverviewContainerClass || "cart-items-overview";
12854
12866
  const itemNameClickable = props.itemNameClickable !== void 0 ? props.itemNameClickable : true;
12855
12867
  const showAvailability = props.showAvailability !== void 0 ? props.showAvailability : true;
@@ -12865,6 +12877,13 @@ function ItemsOverview(props) {
12865
12877
  }
12866
12878
  return propellerV2CoreUi.formatPrice(price || 0, { symbol: currencySymbol });
12867
12879
  }
12880
+ function lineTotal(item) {
12881
+ return (useTax ? item.totalSumNet : item.totalSum) || 0;
12882
+ }
12883
+ function bundlePrice(price) {
12884
+ if (!price) return void 0;
12885
+ return useTax ? price.net : price.gross;
12886
+ }
12868
12887
  function getItemSurcharges(item) {
12869
12888
  const list = (item.surcharges ?? []).filter(
12870
12889
  (s) => s.enabled !== false
@@ -12927,12 +12946,12 @@ function ItemsOverview(props) {
12927
12946
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
12928
12947
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between items-start gap-2", children: [
12929
12948
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "propeller-items-overview__item-title text-sm font-medium leading-tight text-foreground line-clamp-2", children: item.bundle?.name || "Bundle" }),
12930
- showPrice && money(item.bundle?.price?.net) ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "propeller-items-overview__item-price font-semibold text-sm text-foreground whitespace-nowrap", children: money(item.bundle?.price?.net) }) : null
12949
+ showPrice && money(bundlePrice(item.bundle?.price)) ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "propeller-items-overview__item-price font-semibold text-sm text-foreground whitespace-nowrap", children: money(bundlePrice(item.bundle?.price)) }) : null
12931
12950
  ] }),
12932
12951
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "propeller-items-overview__item-bundle mt-1.5 space-y-1 border-l-2 border-secondary/10 pl-2", children: [
12933
12952
  leader ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "propeller-items-overview__item-bundle-leader flex justify-between items-center text-xs", children: [
12934
12953
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-foreground", children: leader.product.names?.[0]?.value || "Product" }),
12935
- money(leader.price?.net) ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground whitespace-nowrap ml-2", children: money(leader.price?.net) }) : null
12954
+ money(bundlePrice(leader.price)) ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground whitespace-nowrap ml-2", children: money(bundlePrice(leader.price)) }) : null
12936
12955
  ] }) : null,
12937
12956
  getBundleNonLeaders(item).map((bundleItem, idx) => /* @__PURE__ */ jsxRuntime.jsxs(
12938
12957
  "div",
@@ -12940,7 +12959,7 @@ function ItemsOverview(props) {
12940
12959
  className: "propeller-items-overview__item-bundle-item flex justify-between items-center text-xs text-muted-foreground",
12941
12960
  children: [
12942
12961
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "line-clamp-1", children: bundleItem.product?.names?.[0]?.value || "Product" }),
12943
- money(bundleItem.price?.net) ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-foreground-subtle whitespace-nowrap ml-2", children: money(bundleItem.price?.net) }) : null
12962
+ money(bundlePrice(bundleItem.price)) ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-foreground-subtle whitespace-nowrap ml-2", children: money(bundlePrice(bundleItem.price)) }) : null
12944
12963
  ]
12945
12964
  },
12946
12965
  idx
@@ -12963,7 +12982,7 @@ function ItemsOverview(props) {
12963
12982
  children: getItemName(item)
12964
12983
  }
12965
12984
  ) : /* @__PURE__ */ jsxRuntime.jsx("p", { className: "propeller-items-overview__item-title font-medium text-sm leading-tight line-clamp-2", children: getItemName(item) }),
12966
- showPrice ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "propeller-items-overview__item-price font-semibold text-sm text-foreground whitespace-nowrap", children: formatItemPrice((item.price || 0) * (item.quantity || 1)) }) : null
12985
+ showPrice ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "propeller-items-overview__item-price font-semibold text-sm text-foreground whitespace-nowrap", children: formatItemPrice(lineTotal(item)) }) : null
12967
12986
  ] }),
12968
12987
  showSku && itemSku ? /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "propeller-items-overview__item-sku text-xs text-muted-foreground mt-0.5", children: [
12969
12988
  "SKU: ",
@@ -12979,7 +12998,7 @@ function ItemsOverview(props) {
12979
12998
  className: "propeller-items-overview__item-option flex justify-between items-center text-xs text-muted-foreground",
12980
12999
  children: [
12981
13000
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "line-clamp-1", children: child.product?.names?.[0]?.value || "Option" }),
12982
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-foreground-subtle whitespace-nowrap ml-2", children: formatItemPrice(child.totalSum || 0) })
13001
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-foreground-subtle whitespace-nowrap ml-2", children: formatItemPrice(lineTotal(child)) })
12983
13002
  ]
12984
13003
  },
12985
13004
  idx