@propeller-commerce/propeller-v2-react-ui 0.7.1 → 0.9.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
@@ -152,12 +152,12 @@ declare const _default$1: React.MemoExoticComponent<typeof ProductJsonLd>;
152
152
  interface CategoryShortDescriptionProps {
153
153
  /**
154
154
  * Language code used to resolve the correct localised short description
155
- * from `category.shortDescription`.
155
+ * from `category.shortDescriptions`.
156
156
  */
157
157
  language: string;
158
158
  /**
159
159
  * Propeller Category object.
160
- * The component reads `category.shortDescription` (an array of LocalizedString)
160
+ * The component reads `category.shortDescriptions` (an array of LocalizedString)
161
161
  * and renders the matching language entry as HTML.
162
162
  */
163
163
  category?: Category;
@@ -496,6 +496,11 @@ interface ProductPriceProps {
496
496
  * Available keys: inclTax, exclTax, loginToSeePrices
497
497
  */
498
498
  labels?: Record<string, string>;
499
+ /**
500
+ * Show the "log in to see prices" prompt when the price is hidden.
501
+ * Defaults to true; pass false to render nothing in its place.
502
+ */
503
+ showLoginPrompt?: boolean;
499
504
  /** Tailwind text-size class for the leading price. Defaults to 'text-3xl'. */
500
505
  priceSize?: string;
501
506
  /** Extra CSS class applied to the root element. */
package/dist/pure.d.ts CHANGED
@@ -152,12 +152,12 @@ declare const _default$1: React.MemoExoticComponent<typeof ProductJsonLd>;
152
152
  interface CategoryShortDescriptionProps {
153
153
  /**
154
154
  * Language code used to resolve the correct localised short description
155
- * from `category.shortDescription`.
155
+ * from `category.shortDescriptions`.
156
156
  */
157
157
  language: string;
158
158
  /**
159
159
  * Propeller Category object.
160
- * The component reads `category.shortDescription` (an array of LocalizedString)
160
+ * The component reads `category.shortDescriptions` (an array of LocalizedString)
161
161
  * and renders the matching language entry as HTML.
162
162
  */
163
163
  category?: Category;
@@ -496,6 +496,11 @@ interface ProductPriceProps {
496
496
  * Available keys: inclTax, exclTax, loginToSeePrices
497
497
  */
498
498
  labels?: Record<string, string>;
499
+ /**
500
+ * Show the "log in to see prices" prompt when the price is hidden.
501
+ * Defaults to true; pass false to render nothing in its place.
502
+ */
503
+ showLoginPrompt?: boolean;
499
504
  /** Tailwind text-size class for the leading price. Defaults to 'text-3xl'. */
500
505
  priceSize?: string;
501
506
  /** Extra CSS class applied to the root element. */
package/dist/pure.js CHANGED
@@ -18,8 +18,8 @@ function Breadcrumbs(props) {
18
18
  }
19
19
  const displayItems = props.showCurrent === false && items.length > 0 ? items.slice(0, items.length - 1) : items;
20
20
  function getCategoryName(cat) {
21
- const match = cat.name?.find((n) => n.language === lang);
22
- return match?.value || cat.name?.[0]?.value || "";
21
+ const match = cat.names?.find((n) => n.language === lang);
22
+ return match?.value || cat.names?.[0]?.value || "";
23
23
  }
24
24
  function getCategoryUrl(cat, index) {
25
25
  if (props.getUrl) return props.getUrl(cat, index);
@@ -27,7 +27,7 @@ function Breadcrumbs(props) {
27
27
  if (urls && typeof urls.getCategoryUrl === "function") {
28
28
  return urls.getCategoryUrl(cat, props.language);
29
29
  }
30
- const slug = cat.slug?.find((s) => s.language === lang)?.value || cat.slug?.[0]?.value || "";
30
+ const slug = cat.slugs?.find((s) => s.language === lang)?.value || cat.slugs?.[0]?.value || "";
31
31
  return `/category/${cat.categoryId}/${slug}`;
32
32
  }
33
33
  function isCurrentItem(index) {
@@ -138,7 +138,7 @@ function ProductJsonLd(props) {
138
138
  }
139
139
  var ProductJsonLd_default = React.memo(ProductJsonLd);
140
140
  function CategoryShortDescription(props) {
141
- const match = props.category?.shortDescription?.find(
141
+ const match = props.category?.shortDescriptions?.find(
142
142
  (d) => d.language === props.language
143
143
  );
144
144
  const html = match?.value || "";
@@ -820,7 +820,7 @@ function ProductPriceDisplay(props) {
820
820
  return props.includeTax ? getLabel(props.labels, "exclTax", "excl. VAT") : getLabel(props.labels, "inclTax", "incl. VAT");
821
821
  }
822
822
  return /* @__PURE__ */ jsxs("div", { className: `propeller-product-price ${props.className || ""}`, "data-hidden": isHidden() ? "true" : "false", children: [
823
- isHidden() ? /* @__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,
823
+ 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,
824
824
  !isHidden() && !!getLeadingPrice() ? /* @__PURE__ */ jsxs("div", { className: "propeller-product-price__content flex flex-col gap-0.5", children: [
825
825
  /* @__PURE__ */ jsxs("div", { className: "propeller-product-price__primary flex items-baseline gap-2", children: [
826
826
  /* @__PURE__ */ jsx(