@pradip1995/segment-product-card 0.3.14 → 0.3.16

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pradip1995/segment-product-card",
3
- "version": "0.3.14",
3
+ "version": "0.3.16",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -12,15 +12,17 @@ function ProductRailHeader({
12
12
  href = "/store",
13
13
  }: {
14
14
  title: string
15
- viewAllLink: string
15
+ viewAllLink?: string
16
16
  href?: string
17
17
  }) {
18
18
  return (
19
19
  <div className="home-section-header">
20
20
  <h2 className="home-section-header__title">{title}</h2>
21
- <LocalizedLink href={href} className="home-section-header__link">
22
- {viewAllLink}
23
- </LocalizedLink>
21
+ {viewAllLink ? (
22
+ <LocalizedLink href={href} className="home-section-header__link">
23
+ {viewAllLink}
24
+ </LocalizedLink>
25
+ ) : null}
24
26
  </div>
25
27
  )
26
28
  }
@@ -108,6 +110,7 @@ export function ProductRailByVariant({
108
110
  href,
109
111
  wishlistProductIds,
110
112
  productCardVariant,
113
+ showNavButtons,
111
114
  }: {
112
115
  variant: ProductRailVariant
113
116
  products: HttpTypes.StoreProduct[]
@@ -115,10 +118,11 @@ export function ProductRailByVariant({
115
118
  ratings?: Array<{ product_id?: string; rating?: number }>
116
119
  countryCode?: string
117
120
  title: string
118
- viewAllLink: string
121
+ viewAllLink?: string
119
122
  href?: string
120
123
  wishlistProductIds?: string[]
121
124
  productCardVariant?: ProductCardVariant
125
+ showNavButtons?: boolean
122
126
  }) {
123
127
  return (
124
128
  <>
@@ -131,6 +135,7 @@ export function ProductRailByVariant({
131
135
  countryCode={countryCode}
132
136
  wishlistProductIds={wishlistProductIds}
133
137
  productCardVariant={productCardVariant}
138
+ showNavButtons={showNavButtons}
134
139
  />
135
140
  ) : variant === "featured" ? (
136
141
  <ProductRailFeatured
@@ -11,6 +11,7 @@ type ProductScrollProps = {
11
11
  countryCode?: string
12
12
  wishlistProductIds?: string[]
13
13
  productCardVariant?: ProductCardVariant
14
+ showNavButtons?: boolean
14
15
  }
15
16
 
16
17
  export default function ProductScroll({
@@ -20,6 +21,7 @@ export default function ProductScroll({
20
21
  countryCode,
21
22
  wishlistProductIds,
22
23
  productCardVariant,
24
+ showNavButtons = true,
23
25
  }: ProductScrollProps) {
24
26
  const viewportRef = useRef<HTMLDivElement>(null)
25
27
 
@@ -37,14 +39,16 @@ export default function ProductScroll({
37
39
 
38
40
  return (
39
41
  <div className="product-scroll bestsellers-carousel">
40
- <button
41
- type="button"
42
- className="product-scroll__nav bestsellers-carousel__nav product-scroll__nav--prev bestsellers-carousel__nav--prev"
43
- onClick={() => scroll("prev")}
44
- aria-label="Previous products"
45
- >
46
-
47
- </button>
42
+ {showNavButtons ? (
43
+ <button
44
+ type="button"
45
+ className="product-scroll__nav bestsellers-carousel__nav product-scroll__nav--prev bestsellers-carousel__nav--prev"
46
+ onClick={() => scroll("prev")}
47
+ aria-label="Previous products"
48
+ >
49
+
50
+ </button>
51
+ ) : null}
48
52
  <div
49
53
  ref={viewportRef}
50
54
  className="product-scroll__viewport bestsellers-carousel__viewport"
@@ -67,14 +71,16 @@ export default function ProductScroll({
67
71
  ))}
68
72
  </div>
69
73
  </div>
70
- <button
71
- type="button"
72
- className="product-scroll__nav bestsellers-carousel__nav product-scroll__nav--next bestsellers-carousel__nav--next"
73
- onClick={() => scroll("next")}
74
- aria-label="Next products"
75
- >
76
-
77
- </button>
74
+ {showNavButtons ? (
75
+ <button
76
+ type="button"
77
+ className="product-scroll__nav bestsellers-carousel__nav product-scroll__nav--next bestsellers-carousel__nav--next"
78
+ onClick={() => scroll("next")}
79
+ aria-label="Next products"
80
+ >
81
+
82
+ </button>
83
+ ) : null}
78
84
  </div>
79
85
  )
80
86
  }
package/src/segment.css CHANGED
@@ -266,6 +266,24 @@
266
266
  }
267
267
 
268
268
  .jewelry-product-card .product-card__actions {
269
+ top: 0.5rem;
270
+ right: 0.5rem;
271
+ }
272
+
273
+ .jewelry-product-card .product-card__wishlist-btn {
274
+ width: 2.125rem;
275
+ height: 2.125rem;
276
+ border-radius: 999px;
277
+ border: 1px solid rgba(59, 31, 78, 0.12);
278
+ background: rgba(255, 255, 255, 0.96);
279
+ }
280
+
281
+ .jewelry-product-card .product-card__wishlist-btn--active {
282
+ background: var(--color-brand-accent-muted, #f4eff8);
283
+ }
284
+
285
+ /* Cart uses the bottom Add to cart bar — hide the icon duplicate */
286
+ .jewelry-product-card .product-card__cart-btn {
269
287
  display: none;
270
288
  }
271
289