@propeller-commerce/propeller-v2-react-ui 0.7.1 → 0.8.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/index.js CHANGED
@@ -1,10 +1,11 @@
1
1
  "use client";
2
- import { getLabel, getLocalizedValue, formatPrice, getClusterSku, getClusterImageUrl, getProductSku, getProductImageUrl, createServices, err, ok, formatSurcharge, deriveUserMode, isContact, isCustomer, getAddresses, isContentHidden, attributeNameMatches, getAttributeDisplayName, filterProductsBySelections, extractAttributeValues, getLanguageString, collectAttributeValues, getCountryName } from '@propeller-commerce/propeller-v2-core-ui';
2
+ import { getLabel, getLocalizedValue, formatPrice, getClusterSku, getClusterImageUrl, isContentHidden, getProductSku, getProductImageUrl, createServices, err, ok, formatSurcharge, deriveUserMode, isContact, isCustomer, getAddresses, attributeNameMatches, getAttributeDisplayName, filterProductsBySelections, extractAttributeValues, getLanguageString, collectAttributeValues, getCountryName } from '@propeller-commerce/propeller-v2-core-ui';
3
3
  export * from '@propeller-commerce/propeller-v2-core-ui';
4
4
  import * as React6 from 'react';
5
5
  import { createContext, useState, useRef, useMemo, useCallback, useContext, useEffect } from 'react';
6
6
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
7
7
  import { ProductStatus, ProductSortField, SortOrder, PurchaseRole, CrossupsellType, CartStatus, CartAddressType, Gender, YesNo, AddressType, PaymentStatuses, OrderSearchFields, OrderItemClass, ProductSearchableField, machineService, AttributeType, OrderSortField, OrderType, OrderDiscountType, BundleCondition } from '@propeller-commerce/propeller-sdk-v2';
8
+ import { User } from 'lucide-react';
8
9
 
9
10
  // src/index.ts
10
11
  var PropellerDepsContext = createContext(null);
@@ -7938,6 +7939,8 @@ var RESOLVE_SPEC = {
7938
7939
  includeTax: { infra: "includeTax" },
7939
7940
  language: { infra: "language", default: "NL" },
7940
7941
  currency: { infra: "currency", default: "\u20AC" },
7942
+ user: { infra: "user", default: null },
7943
+ portalMode: { infra: "portalMode" },
7941
7944
  columns: { grid: "columns", default: 3 },
7942
7945
  showPrice: { grid: "showPrice" },
7943
7946
  showStock: { grid: "showStock" },
@@ -7981,9 +7984,10 @@ function ClusterCard(rawProps) {
7981
7984
  const textLabelValues = resolveAttributeValues(cluster, props.textLabels).map((value) => ({
7982
7985
  value
7983
7986
  }));
7984
- const defaultProductInventory = cluster?.defaultProduct?.inventory;
7987
+ const contentHidden = isContentHidden(props.portalMode, props.user);
7988
+ const defaultProductInventory = contentHidden ? void 0 : cluster?.defaultProduct?.inventory;
7985
7989
  const useTax = props.includeTax !== void 0 ? !!props.includeTax : false;
7986
- const priceObj = cluster?.defaultProduct?.price;
7990
+ const priceObj = contentHidden ? void 0 : cluster?.defaultProduct?.price;
7987
7991
  const priceValue = useTax ? priceObj?.net : priceObj?.gross;
7988
7992
  const clusterPrice = props.showPrice === false ? "" : formatPrice(priceValue, { symbol: props.currency ?? "\u20AC" });
7989
7993
  function handleClusterClick(e) {
@@ -8388,6 +8392,23 @@ function MachineCard(props) {
8388
8392
  }
8389
8393
  );
8390
8394
  }
8395
+ function LoginToOrderButton(props) {
8396
+ return /* @__PURE__ */ jsxs(
8397
+ "button",
8398
+ {
8399
+ type: "button",
8400
+ className: `propeller-login-to-order inline-flex items-center justify-center gap-2 h-10 px-4 w-full rounded-control bg-primary text-primary-foreground text-sm font-medium hover:opacity-90 transition-opacity ${props.className || ""}`,
8401
+ onClick: () => {
8402
+ if (props.onLoginClick) props.onLoginClick();
8403
+ },
8404
+ children: [
8405
+ /* @__PURE__ */ jsx(User, { className: "propeller-login-to-order__icon w-4 h-4", "aria-hidden": "true" }),
8406
+ getLabel(props.labels, "loginToOrder", "Log in to order")
8407
+ ]
8408
+ }
8409
+ );
8410
+ }
8411
+ var LoginToOrderButton_default = LoginToOrderButton;
8391
8412
  function ProductPriceDisplay(props) {
8392
8413
  function isHidden2() {
8393
8414
  return isContentHidden(props.portalMode, props.user);
@@ -8438,7 +8459,7 @@ function ProductPriceDisplay(props) {
8438
8459
  return props.includeTax ? getLabel(props.labels, "exclTax", "excl. VAT") : getLabel(props.labels, "inclTax", "incl. VAT");
8439
8460
  }
8440
8461
  return /* @__PURE__ */ jsxs("div", { className: `propeller-product-price ${props.className || ""}`, "data-hidden": isHidden2() ? "true" : "false", children: [
8441
- isHidden2() ? /* @__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,
8462
+ isHidden2() && 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,
8442
8463
  !isHidden2() && !!getLeadingPrice() ? /* @__PURE__ */ jsxs("div", { className: "propeller-product-price__content flex flex-col gap-0.5", children: [
8443
8464
  /* @__PURE__ */ jsxs("div", { className: "propeller-product-price__primary flex items-baseline gap-2", children: [
8444
8465
  /* @__PURE__ */ jsx(
@@ -8481,6 +8502,7 @@ var RESOLVE_SPEC2 = {
8481
8502
  companyId: { infra: "companyId" },
8482
8503
  language: { infra: "language", default: "NL" },
8483
8504
  includeTax: { infra: "includeTax" },
8505
+ portalMode: { infra: "portalMode" },
8484
8506
  configuration: { infra: "configuration" },
8485
8507
  columns: { grid: "columns", default: 3 },
8486
8508
  showPrice: { grid: "showPrice" },
@@ -8502,6 +8524,7 @@ var RESOLVE_SPEC2 = {
8502
8524
  onCartCreated: { grid: "onCartCreated" },
8503
8525
  afterAddToCart: { grid: "afterAddToCart" },
8504
8526
  onProceedToCheckout: { grid: "onProceedToCheckout" },
8527
+ onLoginClick: { grid: "onLoginClick" },
8505
8528
  onRequestQuoteClick: { grid: "onRequestQuoteClick" },
8506
8529
  onProductClick: { grid: "onProductClick" },
8507
8530
  onToggleFavorite: {
@@ -8533,6 +8556,9 @@ function ProductCardRoot(rawProps) {
8533
8556
  const language = props.language || "NL";
8534
8557
  const product = props.product;
8535
8558
  const isRow = props.columns === 1;
8559
+ const contentHidden = isContentHidden(props.portalMode, props.user);
8560
+ const showStock = !!props.showStock && !contentHidden;
8561
+ const showCta = props.allowAddToCart !== false || contentHidden;
8536
8562
  const name = getProductName(product, language);
8537
8563
  const sku = getProductSku(product);
8538
8564
  const imageUrl = getProductImageUrl(product);
@@ -8603,10 +8629,10 @@ function ProductCardRoot(rawProps) {
8603
8629
  ] }) }),
8604
8630
  /* @__PURE__ */ jsxs("div", { className: "propeller-product-card__footer w-full md:w-auto flex flex-col gap-2 md:flex-row md:items-center md:gap-3 px-4 py-2 md:py-0 border-t md:border-t-0 border-border-subtle", children: [
8605
8631
  /* @__PURE__ */ jsxs("div", { className: "propeller-product-card__footer-meta flex items-center justify-between gap-3 md:contents", children: [
8606
- props.showStock && !!product.inventory ? /* @__PURE__ */ jsx(ProductCardStock, {}) : null,
8632
+ showStock && !!product.inventory ? /* @__PURE__ */ jsx(ProductCardStock, {}) : null,
8607
8633
  props.showPrice !== false && !!product?.price ? /* @__PURE__ */ jsx(ProductCardPrice, { priceSize: "text-sm" }) : null
8608
8634
  ] }),
8609
- props.allowAddToCart !== false ? /* @__PURE__ */ jsx("div", { className: "propeller-product-card__cta w-full md:w-auto md:flex-shrink-0 md:ml-auto", children: /* @__PURE__ */ jsx(ProductCardAddToCart, {}) }) : null
8635
+ showCta ? /* @__PURE__ */ jsx("div", { className: "propeller-product-card__cta w-full md:w-auto md:flex-shrink-0 md:ml-auto", children: /* @__PURE__ */ jsx(ProductCardAddToCart, {}) }) : null
8610
8636
  ] })
8611
8637
  ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
8612
8638
  /* @__PURE__ */ jsxs("div", { className: "propeller-product-card__body flex flex-1 flex-col gap-1.5 p-3 sm:gap-2 sm:p-4", children: [
@@ -8614,16 +8640,16 @@ function ProductCardRoot(rawProps) {
8614
8640
  props.showName !== false ? /* @__PURE__ */ jsx(ProductCardName, { linkable: true }) : null,
8615
8641
  /* @__PURE__ */ jsx(ProductCardBelowName, {}),
8616
8642
  textLabelValues.length > 0 ? /* @__PURE__ */ jsx(ProductCardTextLabels, {}) : null,
8617
- props.showStock && !!product.inventory ? /* @__PURE__ */ jsx("div", { className: "hidden md:block", children: /* @__PURE__ */ jsx(ProductCardStock, {}) }) : null,
8643
+ showStock && !!product.inventory ? /* @__PURE__ */ jsx("div", { className: "hidden md:block", children: /* @__PURE__ */ jsx(ProductCardStock, {}) }) : null,
8618
8644
  props.showManufacturer && manufacturer ? /* @__PURE__ */ jsx(ProductCardManufacturer, {}) : null,
8619
8645
  props.showShortDescription && shortDescription ? /* @__PURE__ */ jsx(ProductCardShortDescription, {}) : null,
8620
8646
  props.showPrice !== false && !!product?.price ? /* @__PURE__ */ jsx("div", { className: "propeller-product-card__price mt-auto pt-1 hidden md:block", children: /* @__PURE__ */ jsx(ProductCardPrice, { priceSize: "text-base sm:text-lg" }) }) : null
8621
8647
  ] }),
8622
- props.showStock && !!product.inventory || props.showPrice !== false && !!product?.price ? /* @__PURE__ */ jsxs("div", { className: "propeller-product-card__footer-meta flex flex-wrap items-center justify-between gap-x-2 gap-y-1 px-3 pt-1 sm:px-4 md:hidden", children: [
8623
- props.showStock && !!product.inventory ? /* @__PURE__ */ jsx(ProductCardStock, {}) : null,
8648
+ showStock && !!product.inventory || props.showPrice !== false && !!product?.price ? /* @__PURE__ */ jsxs("div", { className: "propeller-product-card__footer-meta flex flex-wrap items-center justify-between gap-x-2 gap-y-1 px-3 pt-1 sm:px-4 md:hidden", children: [
8649
+ showStock && !!product.inventory ? /* @__PURE__ */ jsx(ProductCardStock, {}) : null,
8624
8650
  props.showPrice !== false && !!product?.price ? /* @__PURE__ */ jsx(ProductCardPrice, { priceSize: "text-base", className: "propeller-product-card__price min-w-0 text-right" }) : null
8625
8651
  ] }) : null,
8626
- props.allowAddToCart !== false ? /* @__PURE__ */ jsx("div", { className: "propeller-product-card__cta px-3 pb-3 pt-2 sm:px-4 sm:pb-4", children: /* @__PURE__ */ jsx(ProductCardAddToCart, {}) }) : null
8652
+ showCta ? /* @__PURE__ */ jsx("div", { className: "propeller-product-card__cta px-3 pb-3 pt-2 sm:px-4 sm:pb-4", children: /* @__PURE__ */ jsx(ProductCardAddToCart, {}) }) : null
8627
8653
  ] })
8628
8654
  ]
8629
8655
  }
@@ -8822,12 +8848,25 @@ function ProductCardPrice(props) {
8822
8848
  price: product.price,
8823
8849
  includeTax: derived.useTax,
8824
8850
  priceSize: props.priceSize ?? "text-base sm:text-lg",
8825
- labels: resolved.priceLabels
8851
+ labels: resolved.priceLabels,
8852
+ portalMode: resolved.portalMode,
8853
+ user: resolved.user,
8854
+ showLoginPrompt: false
8826
8855
  }
8827
8856
  ) });
8828
8857
  }
8829
8858
  function ProductCardAddToCart(props) {
8830
8859
  const { product, resolved } = useProductCard();
8860
+ if (isContentHidden(resolved.portalMode, resolved.user)) {
8861
+ return /* @__PURE__ */ jsx(
8862
+ LoginToOrderButton_default,
8863
+ {
8864
+ className: props.className,
8865
+ labels: resolved.addToCartLabels,
8866
+ onLoginClick: resolved.onLoginClick
8867
+ }
8868
+ );
8869
+ }
8831
8870
  const InjectedAddToCart = resolved.addToCartComponent;
8832
8871
  if (InjectedAddToCart) {
8833
8872
  return /* @__PURE__ */ jsx(
@@ -8960,9 +8999,8 @@ function ProductGrid(rawProps) {
8960
8999
  return !!props.isLoading || isLoading;
8961
9000
  }
8962
9001
  function showAddToCart() {
8963
- const mode = props.portalMode || "open";
8964
9002
  const allow = props.allowAddToCart !== false;
8965
- return mode === "open" && allow;
9003
+ return !isContentHidden(props.portalMode, props.user) && allow;
8966
9004
  }
8967
9005
  function getSkeletonItems() {
8968
9006
  const cols = props.columns || 3;
@@ -8989,6 +9027,7 @@ function ProductGrid(rawProps) {
8989
9027
  onCartCreated: props.onCartCreated,
8990
9028
  afterAddToCart: props.afterAddToCart,
8991
9029
  onProceedToCheckout: props.onProceedToCheckout,
9030
+ onLoginClick: props.onLoginClick,
8992
9031
  onRequestQuoteClick: props.onRequestQuoteClick,
8993
9032
  onToggleFavorite: (item, isFav) => props.onToggleFavorite?.(item, isFav),
8994
9033
  onProductClick: (p) => props.onProductClick?.(p),
@@ -9637,7 +9676,7 @@ function GridToolbar(rawProps) {
9637
9676
  const [currentSortOrder, setCurrentSortOrder] = useState(SortOrder.DESC);
9638
9677
  const [currentOffset, setCurrentOffset] = useState(12);
9639
9678
  const [currentViewMode, setCurrentViewMode] = useState("grid");
9640
- function getLabel55(key) {
9679
+ function getLabel56(key) {
9641
9680
  const labels = props.labels || {};
9642
9681
  return labels[key] !== void 0 ? labels[key] : DEFAULT_LABELS[key] || key;
9643
9682
  }
@@ -9716,7 +9755,7 @@ function GridToolbar(rawProps) {
9716
9755
  /* @__PURE__ */ jsx("div", { className: "propeller-grid-toolbar__count text-sm text-muted-foreground font-medium", children: props.itemsFound > 0 ? /* @__PURE__ */ jsxs("span", { children: [
9717
9756
  props.itemsFound,
9718
9757
  "\xA0",
9719
- props.itemsFound === 1 ? getLabel55("productSingular") : getLabel55("productPlural")
9758
+ props.itemsFound === 1 ? getLabel56("productSingular") : getLabel56("productPlural")
9720
9759
  ] }) : null }),
9721
9760
  /* @__PURE__ */ jsxs("div", { className: "propeller-grid-toolbar__controls flex flex-wrap items-center gap-3", children: [
9722
9761
  /* @__PURE__ */ jsx(
@@ -9727,7 +9766,7 @@ function GridToolbar(rawProps) {
9727
9766
  onChange: (e) => handleOffsetChange(parseInt(e.target.value)),
9728
9767
  children: getOffsetOptions()?.map((n) => /* @__PURE__ */ jsxs("option", { value: n, children: [
9729
9768
  n,
9730
- getLabel55("perPage")
9769
+ getLabel56("perPage")
9731
9770
  ] }, n))
9732
9771
  }
9733
9772
  ),
@@ -9743,7 +9782,7 @@ function GridToolbar(rawProps) {
9743
9782
  {
9744
9783
  value: field,
9745
9784
  disabled: field === "PRICE" && isPriceSortDisabled(),
9746
- children: getLabel55(field)
9785
+ children: getLabel56(field)
9747
9786
  },
9748
9787
  field
9749
9788
  ))
@@ -9756,8 +9795,8 @@ function GridToolbar(rawProps) {
9756
9795
  value: currentSortOrder,
9757
9796
  onChange: (e) => handleSortOrderChange(e.target.value),
9758
9797
  children: [
9759
- /* @__PURE__ */ jsx("option", { value: SortOrder.ASC, children: getLabel55("ASC") }),
9760
- /* @__PURE__ */ jsx("option", { value: SortOrder.DESC, children: getLabel55("DESC") })
9798
+ /* @__PURE__ */ jsx("option", { value: SortOrder.ASC, children: getLabel56("ASC") }),
9799
+ /* @__PURE__ */ jsx("option", { value: SortOrder.DESC, children: getLabel56("DESC") })
9761
9800
  ]
9762
9801
  }
9763
9802
  ),
@@ -9767,7 +9806,7 @@ function GridToolbar(rawProps) {
9767
9806
  type: "button",
9768
9807
  className: "propeller-grid-toolbar__view-toggle h-9 w-9 flex items-center justify-center rounded-control border border-input bg-transparent hover:bg-accent hover:text-accent-foreground transition-colors",
9769
9808
  onClick: (event) => handleViewChange(),
9770
- title: currentViewMode === "grid" ? getLabel55("switchToList") : getLabel55("switchToGrid"),
9809
+ title: currentViewMode === "grid" ? getLabel56("switchToList") : getLabel56("switchToGrid"),
9771
9810
  children: [
9772
9811
  currentViewMode === "grid" ? /* @__PURE__ */ jsxs(
9773
9812
  "svg",
@@ -9825,7 +9864,7 @@ function GridToolbar(rawProps) {
9825
9864
  onClick: (event) => {
9826
9865
  if (props.onClearFilters) props.onClearFilters();
9827
9866
  },
9828
- children: getLabel55("clearAll")
9867
+ children: getLabel56("clearAll")
9829
9868
  }
9830
9869
  ),
9831
9870
  props.priceFilterMin !== void 0 || props.priceFilterMax !== void 0 ? /* @__PURE__ */ jsxs(
@@ -9836,7 +9875,7 @@ function GridToolbar(rawProps) {
9836
9875
  if (props.onPriceFilterRemove) props.onPriceFilterRemove();
9837
9876
  },
9838
9877
  children: [
9839
- getLabel55("price"),
9878
+ getLabel56("price"),
9840
9879
  ": \u20AC",
9841
9880
  props.priceFilterMin ?? 0,
9842
9881
  " \u2013 \u20AC",
@@ -9873,7 +9912,7 @@ var DEFAULT_LABELS2 = {
9873
9912
  of: "of"
9874
9913
  };
9875
9914
  function GridPagination(props) {
9876
- function getLabel55(key) {
9915
+ function getLabel56(key) {
9877
9916
  const labels = props.labels || {};
9878
9917
  return labels[key] !== void 0 ? labels[key] : DEFAULT_LABELS2[key] || key;
9879
9918
  }
@@ -9946,15 +9985,15 @@ function GridPagination(props) {
9946
9985
  className: "propeller-grid-pagination__btn propeller-grid-pagination__btn--prev inline-flex items-center rounded-control border border-input bg-card px-4 py-2 text-sm font-medium text-foreground shadow-sm hover:bg-surface-hover disabled:opacity-40 disabled:cursor-not-allowed",
9947
9986
  disabled: currentPage === 1,
9948
9987
  onClick: () => handlePageChange(currentPage - 1),
9949
- children: getLabel55("previous")
9988
+ children: getLabel56("previous")
9950
9989
  }
9951
9990
  ),
9952
9991
  /* @__PURE__ */ jsxs("span", { className: "propeller-grid-pagination__info px-2 text-sm font-medium text-muted-foreground", children: [
9953
- getLabel55("page"),
9992
+ getLabel56("page"),
9954
9993
  "\xA0",
9955
9994
  currentPage,
9956
9995
  "\xA0",
9957
- getLabel55("of"),
9996
+ getLabel56("of"),
9958
9997
  "\xA0",
9959
9998
  totalPages
9960
9999
  ] }),
@@ -9965,7 +10004,7 @@ function GridPagination(props) {
9965
10004
  className: "propeller-grid-pagination__btn propeller-grid-pagination__btn--next inline-flex items-center rounded-control border border-input bg-card px-4 py-2 text-sm font-medium text-foreground shadow-sm hover:bg-surface-hover disabled:opacity-40 disabled:cursor-not-allowed",
9966
10005
  disabled: currentPage === totalPages,
9967
10006
  onClick: () => handlePageChange(currentPage + 1),
9968
- children: getLabel55("next")
10007
+ children: getLabel56("next")
9969
10008
  }
9970
10009
  )
9971
10010
  ] }) : null,
@@ -9977,7 +10016,7 @@ function GridPagination(props) {
9977
10016
  className: "propeller-grid-pagination__btn propeller-grid-pagination__btn--prev inline-flex items-center rounded-control border border-input bg-card px-3 py-2 text-sm font-medium text-foreground shadow-sm hover:bg-surface-hover disabled:opacity-40 disabled:cursor-not-allowed",
9978
10017
  disabled: currentPage === 1,
9979
10018
  onClick: () => handlePageChange(currentPage - 1),
9980
- children: getLabel55("previous")
10019
+ children: getLabel56("previous")
9981
10020
  }
9982
10021
  ),
9983
10022
  getFullPages().map((item, idx) => /* @__PURE__ */ jsx(
@@ -10004,7 +10043,7 @@ function GridPagination(props) {
10004
10043
  className: "propeller-grid-pagination__btn propeller-grid-pagination__btn--next inline-flex items-center rounded-control border border-input bg-card px-3 py-2 text-sm font-medium text-foreground shadow-sm hover:bg-surface-hover disabled:opacity-40 disabled:cursor-not-allowed",
10005
10044
  disabled: currentPage === totalPages,
10006
10045
  onClick: () => handlePageChange(currentPage + 1),
10007
- children: getLabel55("next")
10046
+ children: getLabel56("next")
10008
10047
  }
10009
10048
  )
10010
10049
  ] }) : null
@@ -10496,13 +10535,14 @@ function ClusterOptions(props) {
10496
10535
  function getOptionsForRender() {
10497
10536
  const options = props.options || [];
10498
10537
  const sel = selectedProductIds;
10538
+ const hidePrices = isContentHidden(props.portalMode, props.user);
10499
10539
  return options.filter((option) => option.hidden !== YesNo.Y).map((option) => {
10500
10540
  const idStr = option.id.toString();
10501
10541
  const selectedProductId = sel[idStr] || "";
10502
10542
  const products = (option.products || []).map((p) => ({
10503
10543
  productId: p.productId,
10504
10544
  productIdStr: p.productId.toString(),
10505
- label: `${getProductName2(p)} \u2014 ${formatPrice9(p.price?.gross || 0, props.currency ?? "\u20AC")}`
10545
+ label: hidePrices ? getProductName2(p) : `${getProductName2(p)} \u2014 ${formatPrice9(p.price?.gross || 0, props.currency ?? "\u20AC")}`
10506
10546
  }));
10507
10547
  let previewImageUrl = "";
10508
10548
  let previewName = "";
@@ -10514,7 +10554,7 @@ function ClusterOptions(props) {
10514
10554
  if (selectedProduct) {
10515
10555
  previewImageUrl = getProductImageUrl4(selectedProduct);
10516
10556
  previewName = getProductName2(selectedProduct);
10517
- previewPrice = formatPrice9(selectedProduct.price?.gross || 0, props.currency ?? "\u20AC");
10557
+ previewPrice = hidePrices ? "" : formatPrice9(selectedProduct.price?.gross || 0, props.currency ?? "\u20AC");
10518
10558
  }
10519
10559
  }
10520
10560
  const isRequired = option.isRequired === YesNo.Y;
@@ -14986,11 +15026,11 @@ function ProductBundles(rawProps) {
14986
15026
  children: addingBundleId === bundle.id ? getLabel(props.labels, "adding", "Adding...") : getLabel(props.labels, "addToCart", "In cart")
14987
15027
  }
14988
15028
  )
14989
- ] }) : /* @__PURE__ */ jsx("div", { className: "propeller-product-bundles__login-prompt text-center text-sm text-muted-foreground py-2", children: getLabel(
15029
+ ] }) : props.showLoginPrompt !== false ? /* @__PURE__ */ jsx("div", { className: "propeller-product-bundles__login-prompt text-center text-sm text-muted-foreground py-2", children: getLabel(
14990
15030
  props.labels,
14991
15031
  "loginToSeePrices",
14992
15032
  "Log in to see prices and add to cart"
14993
- ) })
15033
+ ) }) : null
14994
15034
  ] })
14995
15035
  ] })
14996
15036
  },
@@ -15773,6 +15813,7 @@ function ProductInfoPrice(props = {}) {
15773
15813
  function ProductInfoStock(props = {}) {
15774
15814
  const { product, resolved, derived } = useProductInfoContext();
15775
15815
  if (!product.inventory) return null;
15816
+ if (isContentHidden(derived.portalMode, resolved.user)) return null;
15776
15817
  const Injected = resolved.stockComponent;
15777
15818
  if (Injected) {
15778
15819
  return /* @__PURE__ */ jsx(
@@ -15799,6 +15840,16 @@ function ProductInfoStock(props = {}) {
15799
15840
  }
15800
15841
  function ProductInfoAddToCart(props = {}) {
15801
15842
  const { product, resolved, derived } = useProductInfoContext();
15843
+ if (isContentHidden(derived.portalMode, resolved.user)) {
15844
+ return /* @__PURE__ */ jsx(
15845
+ LoginToOrderButton_default,
15846
+ {
15847
+ className: props.className,
15848
+ labels: derived.labels,
15849
+ onLoginClick: resolved.onLoginClick
15850
+ }
15851
+ );
15852
+ }
15802
15853
  const Injected = resolved.addToCartComponent;
15803
15854
  if (Injected) {
15804
15855
  return /* @__PURE__ */ jsx(Injected, { product, labels: derived.labels, className: props.className });
@@ -18633,6 +18684,6 @@ function UserDetails(rawProps) {
18633
18684
  }
18634
18685
  var UserDetails_default = UserDetails;
18635
18686
 
18636
- export { AccountIconAndMenu_default as AccountIconAndMenu, ActionCode_default as ActionCode, AddToCart_default as AddToCart, AddToFavorite_default as AddToFavorite, AddressCard_default as AddressCard, AddressSelector_default as AddressSelector, BreadcrumbsWithProvider_default as Breadcrumbs, CartBonusItems_default as CartBonusItems, CartCarriers_default as CartCarriers, CartIconAndSidebar_default as CartIconAndSidebar, CartItem_default as CartItem, CartOverview_default as CartOverview, CartPaymethods_default as CartPaymethods, CartSummary_default as CartSummary, CategoryDescription_default as CategoryDescription, CategoryShortDescriptionWithProvider_default as CategoryShortDescription, ClusterCard_default as ClusterCard, ClusterConfigurator_default as ClusterConfigurator, ClusterInfo_default as ClusterInfo, ClusterOptions_default as ClusterOptions, CompanySwitcher_default as CompanySwitcher, AddToCart_default as DefaultAddToCart, AddToFavorite_default as DefaultAddToFavorite, ItemStock_default as DefaultItemStock, DefaultProductBadges, ProductBulkPrices_default as DefaultProductBulkPrices, ProductBundles_default as DefaultProductBundles, DefaultProductImage, ProductPrice_default as DefaultProductPrice, DefaultProductSurcharges, DeliveryDate_default as DeliveryDate, FavoriteListDetails_default as FavoriteListDetails, FavoriteListItem_default as FavoriteListItem, FavoriteLists_default as FavoriteLists, ForgotPassword_default as ForgotPassword, GridFilters_default as GridFilters, GridFiltersPanel, GridPagination_default as GridPagination, GridTitleWithProvider_default as GridTitle, GridToolbar_default as GridToolbar, ItemStock_default as ItemStock, ItemsOverview_default as ItemsOverview, LoginForm_default as LoginForm, MachineCard, MachineGrid, Menu_default as Menu, OrderActions_default as OrderActions, OrderBonusItems_default as OrderBonusItems, OrderItemCard_default as OrderItemCard, OrderList_default as OrderList, OrderShipments_default as OrderShipments, OrderSummary_default as OrderSummary, OrderTotals_default as OrderTotals, PriceToggle_default as PriceToggle, ProductBulkPricesWithProvider_default as ProductBulkPrices, ProductBundles_default as ProductBundles, ProductCard_default as ProductCard, ProductDescription_default as ProductDescription, ProductDownloads_default as ProductDownloads, ProductGallery_default as ProductGallery, ProductGrid_default as ProductGrid, ProductGridConfigProvider, ProductInfo_default as ProductInfo, ProductPriceWithProvider_default as ProductPrice, ProductShortDescriptionWithProvider_default as ProductShortDescription, ProductSlider_default as ProductSlider, ProductSpecifications_default as ProductSpecifications, ProductTabs_default as ProductTabs, ProductVideos_default as ProductVideos, PropellerDepsProvider, PropellerProvider, PurchaseAuthorizationConfigurator_default as PurchaseAuthorizationConfigurator, PurchaseAuthorizationRequests_default as PurchaseAuthorizationRequests, QuickOrder, QuoteActions_default as QuoteActions, RegisterForm_default as RegisterForm, SearchBar_default as SearchBar, UserDetails_default as UserDetails, buildRootMachinesQuery, fetchActiveCart, initCart, mergeAnonymousCart, useAddress, useAuth, useCart, useCheckout, useClusterConfigurator, useCompany, useFavorites, useInfraProps, useMachines, useMenu, useOrders, useProductBundles, useProductGridConfig, useProductInfo, useProductSearch, useProductSlider, useProductSpecs, usePropellerContext, usePropellerDeps, usePropellerScope, usePurchaseAuthorizationConfigurator, usePurchaseAuthorizationRequests, useQuickOrder, useRequiredPropellerDeps, useResolvedProps, useServices, useSpareParts, useUserMode };
18687
+ export { AccountIconAndMenu_default as AccountIconAndMenu, ActionCode_default as ActionCode, AddToCart_default as AddToCart, AddToFavorite_default as AddToFavorite, AddressCard_default as AddressCard, AddressSelector_default as AddressSelector, BreadcrumbsWithProvider_default as Breadcrumbs, CartBonusItems_default as CartBonusItems, CartCarriers_default as CartCarriers, CartIconAndSidebar_default as CartIconAndSidebar, CartItem_default as CartItem, CartOverview_default as CartOverview, CartPaymethods_default as CartPaymethods, CartSummary_default as CartSummary, CategoryDescription_default as CategoryDescription, CategoryShortDescriptionWithProvider_default as CategoryShortDescription, ClusterCard_default as ClusterCard, ClusterConfigurator_default as ClusterConfigurator, ClusterInfo_default as ClusterInfo, ClusterOptions_default as ClusterOptions, CompanySwitcher_default as CompanySwitcher, AddToCart_default as DefaultAddToCart, AddToFavorite_default as DefaultAddToFavorite, ItemStock_default as DefaultItemStock, DefaultProductBadges, ProductBulkPrices_default as DefaultProductBulkPrices, ProductBundles_default as DefaultProductBundles, DefaultProductImage, ProductPrice_default as DefaultProductPrice, DefaultProductSurcharges, DeliveryDate_default as DeliveryDate, FavoriteListDetails_default as FavoriteListDetails, FavoriteListItem_default as FavoriteListItem, FavoriteLists_default as FavoriteLists, ForgotPassword_default as ForgotPassword, GridFilters_default as GridFilters, GridFiltersPanel, GridPagination_default as GridPagination, GridTitleWithProvider_default as GridTitle, GridToolbar_default as GridToolbar, ItemStock_default as ItemStock, ItemsOverview_default as ItemsOverview, LoginForm_default as LoginForm, LoginToOrderButton_default as LoginToOrderButton, MachineCard, MachineGrid, Menu_default as Menu, OrderActions_default as OrderActions, OrderBonusItems_default as OrderBonusItems, OrderItemCard_default as OrderItemCard, OrderList_default as OrderList, OrderShipments_default as OrderShipments, OrderSummary_default as OrderSummary, OrderTotals_default as OrderTotals, PriceToggle_default as PriceToggle, ProductBulkPricesWithProvider_default as ProductBulkPrices, ProductBundles_default as ProductBundles, ProductCard_default as ProductCard, ProductDescription_default as ProductDescription, ProductDownloads_default as ProductDownloads, ProductGallery_default as ProductGallery, ProductGrid_default as ProductGrid, ProductGridConfigProvider, ProductInfo_default as ProductInfo, ProductPriceWithProvider_default as ProductPrice, ProductShortDescriptionWithProvider_default as ProductShortDescription, ProductSlider_default as ProductSlider, ProductSpecifications_default as ProductSpecifications, ProductTabs_default as ProductTabs, ProductVideos_default as ProductVideos, PropellerDepsProvider, PropellerProvider, PurchaseAuthorizationConfigurator_default as PurchaseAuthorizationConfigurator, PurchaseAuthorizationRequests_default as PurchaseAuthorizationRequests, QuickOrder, QuoteActions_default as QuoteActions, RegisterForm_default as RegisterForm, SearchBar_default as SearchBar, UserDetails_default as UserDetails, buildRootMachinesQuery, fetchActiveCart, initCart, mergeAnonymousCart, useAddress, useAuth, useCart, useCheckout, useClusterConfigurator, useCompany, useFavorites, useInfraProps, useMachines, useMenu, useOrders, useProductBundles, useProductGridConfig, useProductInfo, useProductSearch, useProductSlider, useProductSpecs, usePropellerContext, usePropellerDeps, usePropellerScope, usePurchaseAuthorizationConfigurator, usePurchaseAuthorizationRequests, useQuickOrder, useRequiredPropellerDeps, useResolvedProps, useServices, useSpareParts, useUserMode };
18637
18688
  //# sourceMappingURL=index.js.map
18638
18689
  //# sourceMappingURL=index.js.map