@propeller-commerce/propeller-v2-react-ui 0.11.2 → 0.11.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,52 @@ 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.11.4] - 2026-07-31
12
+
13
+ ### Fixed
14
+
15
+ - **The add-to-cart button overflowed its product card in narrow columns.**
16
+ The submit button is `flex-1`, but a flex item defaults to
17
+ `min-width: auto` and so refuses to shrink below its content width — icon
18
+ plus label plus `px-6` of padding. In a slider or a dense grid the button
19
+ ran past the card's edge instead of fitting inside it. Longer non-English
20
+ labels hit this first: Dutch "Toevoegen" is roughly twice the width of the
21
+ "Add" the padding was sized around. The button now carries `min-w-0`, eases
22
+ its padding to `px-3 sm:px-6`, and wraps its label in a `truncate` span, so
23
+ it shrinks to the column and ellipsises rather than overflowing. Same fix
24
+ for `<ClusterCard>`'s "View cluster" link, which had the identical shape.
25
+ - **Hovering a card's CTA lit up the whole card.** The card root is a
26
+ `group` with `hover:shadow-md`, so hovering the button — a descendant —
27
+ raised the card shadow, shifted its border and zoomed the product image at
28
+ the same time as the button's own hover state. Three things answering one
29
+ intent read as the card being clickable rather than the button. While the
30
+ pointer is on a CTA the card-level highlight and the image zoom now stand
31
+ down and the button owns the hover; moving anywhere else on the card is
32
+ unchanged. Browsers without `:has()` keep the previous behaviour.
33
+
34
+ ### Changed
35
+
36
+ - **`<AddToCart>`'s hover shade now matches the other CTAs.** It darkened to
37
+ `bg-secondary/90` where every other solid button in the package uses `/80`.
38
+ Now `/80` as well.
39
+
40
+ ## [0.11.3] - 2026-07-31
41
+
42
+ ### Fixed
43
+
44
+ - **`<ProductSlider>` hid add-to-cart from signed-in users in a semi-closed
45
+ portal.** It gated the control on `portalMode === 'open'`, so the whole mode
46
+ lost it rather than just anonymous visitors — the same defect `ProductGrid`
47
+ had before 0.8.0. Sliders now gate on the shared
48
+ `isContentHidden(portalMode, user)` like the grid, so a signed-in shopper
49
+ keeps add-to-cart on cross-sells, up-sells and CMS product blocks.
50
+
51
+ ### Added
52
+
53
+ - **`allowAddToCart` on `<ProductSlider>`** — lets a host hide the control the
54
+ way `ProductGrid` already allows. Defaults to `true`; a semi-closed portal
55
+ still withholds it from anonymous visitors regardless.
56
+
11
57
  ## [0.11.2] - 2026-07-31
12
58
 
13
59
  ### Fixed
package/dist/index.cjs CHANGED
@@ -4607,7 +4607,7 @@ function AddToCart(rawProps) {
4607
4607
  "button",
4608
4608
  {
4609
4609
  type: "button",
4610
- className: "propeller-add-to-cart__submit flex-1 basis-full md:basis-auto inline-flex justify-center items-center gap-2 h-10 px-6 border border-transparent text-sm font-medium rounded-control text-secondary-foreground bg-secondary hover:bg-secondary/90 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-secondary disabled:opacity-50 disabled:cursor-not-allowed transition-colors",
4610
+ className: "propeller-add-to-cart__submit flex-1 min-w-0 basis-full md:basis-auto inline-flex justify-center items-center gap-2 h-10 px-3 sm:px-6 border border-transparent text-sm font-medium rounded-control text-secondary-foreground bg-secondary hover:bg-secondary/80 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-secondary disabled:opacity-50 disabled:cursor-not-allowed transition-colors",
4611
4611
  onClick: () => handleAddToCart(),
4612
4612
  disabled: loading,
4613
4613
  children: [
@@ -4629,8 +4629,7 @@ function AddToCart(rawProps) {
4629
4629
  ]
4630
4630
  }
4631
4631
  ),
4632
- loading ? /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: propellerV2CoreUi.getLabel(props.labels, "adding", "Adding...") }) : null,
4633
- !loading ? /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: propellerV2CoreUi.getLabel(props.labels, "add", "Add") }) : null
4632
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "propeller-add-to-cart__submit-label min-w-0 truncate", children: loading ? propellerV2CoreUi.getLabel(props.labels, "adding", "Adding...") : propellerV2CoreUi.getLabel(props.labels, "add", "Add") })
4634
4633
  ]
4635
4634
  }
4636
4635
  )
@@ -8383,8 +8382,8 @@ function ClusterCardViewClusterLink(props) {
8383
8382
  {
8384
8383
  href: derived.clusterUrl,
8385
8384
  onClick: handleClusterClick,
8386
- className: props.className ?? "propeller-cluster-card__cta-link flex w-full items-center justify-center rounded-control bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2",
8387
- children: props.label ?? derived.viewClusterLabel
8385
+ className: props.className ?? "propeller-cluster-card__cta-link flex w-full min-w-0 items-center justify-center rounded-control bg-primary px-3 sm:px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2",
8386
+ children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "propeller-cluster-card__cta-label min-w-0 truncate", children: props.label ?? derived.viewClusterLabel })
8388
8387
  }
8389
8388
  );
8390
8389
  }
@@ -16081,8 +16080,9 @@ function ProductSlider(rawProps) {
16081
16080
  function desktopCount() {
16082
16081
  return props.itemsPerView?.desktop || 4;
16083
16082
  }
16084
- function portalMode() {
16085
- return props.portalMode || "open";
16083
+ function showAddToCart() {
16084
+ const allow = props.allowAddToCart !== false;
16085
+ return !propellerV2CoreUi.isContentHidden(props.portalMode, props.user) && allow;
16086
16086
  }
16087
16087
  function isCluster(item) {
16088
16088
  return "clusterId" in item && !("productId" in item);
@@ -16231,7 +16231,7 @@ function ProductSlider(rawProps) {
16231
16231
  ProductCardImpl,
16232
16232
  {
16233
16233
  product: item,
16234
- allowAddToCart: portalMode() === "open",
16234
+ allowAddToCart: showAddToCart(),
16235
16235
  labels: props.productCardLabels,
16236
16236
  stockLabels: props.stockLabels,
16237
16237
  priceLabels: props.priceLabels,