@lanaco/lnc-react-ui 4.0.157 → 4.0.160
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/BlogCardsSponsoredSection.cjs +8 -8
- package/dist/BlogCardsSponsoredSection.js +105 -89
- package/dist/BlogExploreSection.cjs +5 -5
- package/dist/BlogExploreSection.js +88 -84
- package/dist/BlogListSection.cjs +5 -5
- package/dist/BlogListSection.js +139 -126
- package/dist/BlogProductCardsSection.cjs +1 -1
- package/dist/BlogProductCardsSection.js +37 -35
- package/dist/BlogShopCardsSection.cjs +1 -1
- package/dist/BlogShopCardsSection.js +43 -41
- package/dist/BlogSingleSection.cjs +1 -1
- package/dist/BlogSingleSection.js +9 -4
- package/dist/BlogsSectionDetailed.cjs +11 -11
- package/dist/BlogsSectionDetailed.js +122 -108
- package/dist/BlogsSectionLarge.cjs +4 -4
- package/dist/BlogsSectionLarge.js +43 -40
- package/dist/BlogsSectionSimple.cjs +8 -8
- package/dist/BlogsSectionSimple.js +100 -86
- package/dist/BlogsSectionSimpleCentered.cjs +9 -9
- package/dist/BlogsSectionSimpleCentered.js +81 -66
- package/dist/BlogsSectionWithFilters.cjs +11 -11
- package/dist/BlogsSectionWithFilters.js +108 -93
- package/dist/{CustomStyles-Ajyqx0cb.cjs → CustomStyles-BwHfr4iM.cjs} +1 -1
- package/dist/{CustomStyles-DVcu00ul.js → CustomStyles-iconSXFL.js} +0 -1
- package/dist/DetailedProductsInfinitiveSection.cjs +3 -3
- package/dist/DetailedProductsInfinitiveSection.js +29 -27
- package/dist/DetailedProductsSection.cjs +3 -3
- package/dist/DetailedProductsSection.js +76 -65
- package/dist/Dropdown.cjs +1 -1
- package/dist/Dropdown.js +2 -2
- package/dist/DropdownLookup.cjs +1 -1
- package/dist/DropdownLookup.js +1 -1
- package/dist/FieldOfInterestsWithAvatarsCardsSection.cjs +1 -1
- package/dist/FieldOfInterestsWithAvatarsCardsSection.js +1 -1
- package/dist/MultiSelectDropdown.cjs +1 -1
- package/dist/MultiSelectDropdown.js +1 -1
- package/dist/MultiSelectDropdownLookup.cjs +1 -1
- package/dist/MultiSelectDropdownLookup.js +1 -1
- package/dist/ProductsWithBannerSection.cjs +10 -10
- package/dist/ProductsWithBannerSection.js +81 -59
- package/dist/SalesCampaignsSection.cjs +27 -27
- package/dist/SalesCampaignsSection.js +245 -239
- package/dist/ShopCardsSection.cjs +3 -3
- package/dist/ShopCardsSection.js +27 -25
- package/dist/SimpleProductsSection.cjs +3 -3
- package/dist/SimpleProductsSection.js +62 -51
- package/dist/UrgentSaleProductsSection.cjs +6 -6
- package/dist/UrgentSaleProductsSection.js +67 -56
- package/dist/index-1Dm1i6WK.js +52 -0
- package/dist/index-BGTtoLxz.cjs +1 -0
- package/dist/{index-CLoINIGC.cjs → index-DicTpiG0.cjs} +5 -5
- package/dist/{index-BGY3PSA-.js → index-y6sKgrZC.js} +45 -34
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{skeleton-BWFqIToC.js → skeleton-5mO22c5S.js} +94 -84
- package/dist/{skeleton-CanJ6Gr6.cjs → skeleton-Ccd6EDeB.cjs} +8 -8
- package/dist/{suspense-product-card-detailed-BWoxabjZ.js → suspense-product-card-detailed-BZtObEfA.js} +126 -123
- package/dist/{suspense-product-card-detailed-DYyH_jf5.cjs → suspense-product-card-detailed-D-pjVe22.cjs} +7 -7
- package/dist/{suspense-product-card-simple-CrqjSxHI.cjs → suspense-product-card-simple-DJ8UYolb.cjs} +1 -1
- package/dist/{suspense-product-card-simple-CLJjab5B.js → suspense-product-card-simple-ziy0XcLp.js} +1 -1
- package/package.json +1 -1
- package/dist/index-Cm0f72Po.cjs +0 -1
- package/dist/index-DGp7FHms.js +0 -42
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { s as
|
|
4
|
-
import { M as
|
|
5
|
-
import { u as
|
|
6
|
-
import { R as
|
|
7
|
-
import { p as
|
|
8
|
-
import { P as
|
|
9
|
-
const
|
|
1
|
+
import { jsxs as u, jsx as r, Fragment as h } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as f, useRef as $, Suspense as U, memo as I, useMemo as M } from "react";
|
|
3
|
+
import { s as b } from "./emotion-styled.browser.esm-BNN1dTl3.js";
|
|
4
|
+
import { M as w } from "./consts-BuFChS64.js";
|
|
5
|
+
import { u as R } from "./useDetectMobile-Bkvj0VMa.js";
|
|
6
|
+
import { R as W } from "./style-BLuyU97E.js";
|
|
7
|
+
import { p as j, o as v, l as E, k as z } from "./utils-BdsZgOUE.js";
|
|
8
|
+
import { P as B } from "./index-CF3HhgvN.js";
|
|
9
|
+
const D = b.div`
|
|
10
10
|
width: 100%;
|
|
11
11
|
height: 22.5rem;
|
|
12
12
|
min-height: 22.5rem;
|
|
@@ -24,18 +24,18 @@ const E = p.div`
|
|
|
24
24
|
object-fit: cover;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
@media (max-width: ${
|
|
27
|
+
@media (max-width: ${w + "px"}) {
|
|
28
28
|
height: 100%;
|
|
29
29
|
min-height: 100%;
|
|
30
30
|
max-height: 100%;
|
|
31
31
|
aspect-ratio: 1 / 1;
|
|
32
32
|
}
|
|
33
|
-
`,
|
|
33
|
+
`, _ = b.div`
|
|
34
34
|
display: grid;
|
|
35
35
|
grid-template-columns: ${(t) => `repeat(${t.limit}, minmax(0, 1fr))`};
|
|
36
36
|
gap: 1.25rem;
|
|
37
37
|
|
|
38
|
-
@media (max-width: ${
|
|
38
|
+
@media (max-width: ${w + "px"}) {
|
|
39
39
|
display: flex;
|
|
40
40
|
gap: 1rem;
|
|
41
41
|
overflow-x: auto;
|
|
@@ -54,7 +54,7 @@ const E = p.div`
|
|
|
54
54
|
/* Safari and Chrome */
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
`,
|
|
57
|
+
`, P = b.div`
|
|
58
58
|
display: flex;
|
|
59
59
|
flex-direction: column;
|
|
60
60
|
gap: 0.5rem;
|
|
@@ -70,22 +70,22 @@ const E = p.div`
|
|
|
70
70
|
& .card-title {
|
|
71
71
|
font-size: 0.875rem;
|
|
72
72
|
font-weight: 600;
|
|
73
|
-
${
|
|
73
|
+
${j(2)}
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
& .skeleton-img {
|
|
77
|
-
background-color: ${
|
|
77
|
+
background-color: ${v("-90deg")};
|
|
78
78
|
border-radius: 0.75rem;
|
|
79
79
|
border: 1px solid white;
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
& .skeleton-title {
|
|
83
|
-
background-color: ${
|
|
83
|
+
background-color: ${v("-90deg")};
|
|
84
84
|
width: 100%;
|
|
85
85
|
height: 1.25rem;
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
@media (max-width: ${
|
|
88
|
+
@media (max-width: ${w + "px"}) {
|
|
89
89
|
& img {
|
|
90
90
|
width: 8.875rem;
|
|
91
91
|
height: 8.875rem;
|
|
@@ -96,92 +96,114 @@ const E = p.div`
|
|
|
96
96
|
object-fit: cover;
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
-
`,
|
|
99
|
+
`, A = f((t, l) => {
|
|
100
100
|
const {
|
|
101
101
|
uuid: o,
|
|
102
102
|
title: i,
|
|
103
103
|
image: a,
|
|
104
|
-
sellerUuid:
|
|
104
|
+
sellerUuid: S,
|
|
105
105
|
onSelectCard: d = () => {
|
|
106
106
|
},
|
|
107
|
-
imageComponent:
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
107
|
+
imageComponent: s,
|
|
108
|
+
metadata: n
|
|
109
|
+
} = t, m = $(null);
|
|
110
|
+
return /* @__PURE__ */ u(
|
|
111
|
+
P,
|
|
112
|
+
{
|
|
113
|
+
ref: m,
|
|
114
|
+
className: "product-card",
|
|
115
|
+
name: n == null ? void 0 : n.name,
|
|
116
|
+
"data-accessor": n == null ? void 0 : n.accessor,
|
|
117
|
+
onClick: (c) => d(c, l),
|
|
118
|
+
children: [
|
|
119
|
+
E(s) ? s : /* @__PURE__ */ r(B, { src: a }),
|
|
120
|
+
/* @__PURE__ */ r("div", { className: "card-title", children: i })
|
|
121
|
+
]
|
|
122
|
+
}
|
|
123
|
+
);
|
|
124
|
+
}), F = f(({}, t) => /* @__PURE__ */ u(P, { className: "product-card", children: [
|
|
114
125
|
/* @__PURE__ */ r("img", { className: "skeleton-img" }),
|
|
115
126
|
/* @__PURE__ */ r("div", { className: "skeleton-title" })
|
|
116
|
-
] })),
|
|
117
|
-
|
|
127
|
+
] })), G = ({ limit: t = 4, isLoading: l = !1, keyPrefix: o }) => /* @__PURE__ */ r(h, { children: Array.from({ length: t }, (i, a) => /* @__PURE__ */ r(
|
|
128
|
+
F,
|
|
118
129
|
{
|
|
119
130
|
isLoading: l
|
|
120
131
|
},
|
|
121
132
|
`${o}-skeleton-product-card-${a}`
|
|
122
|
-
)) }),
|
|
133
|
+
)) }), T = ({
|
|
123
134
|
children: t,
|
|
124
|
-
fallbackComponent: l = /* @__PURE__ */ r(
|
|
135
|
+
fallbackComponent: l = /* @__PURE__ */ r(h, {}),
|
|
125
136
|
isLoading: o = !1,
|
|
126
137
|
limit: i,
|
|
127
138
|
keyPrefix: a
|
|
128
|
-
}) => /* @__PURE__ */ r(
|
|
129
|
-
|
|
139
|
+
}) => /* @__PURE__ */ r(U, { fallbackComponent: l, children: o === !0 ? /* @__PURE__ */ r(
|
|
140
|
+
G,
|
|
130
141
|
{
|
|
131
142
|
isLoading: o,
|
|
132
143
|
limit: i,
|
|
133
144
|
keyPrefix: a
|
|
134
145
|
}
|
|
135
|
-
) : t }),
|
|
146
|
+
) : t }), C = I(A), Q = f((t, l) => {
|
|
136
147
|
const {
|
|
137
148
|
icon: o,
|
|
138
149
|
items: i,
|
|
139
150
|
limit: a = 4,
|
|
140
|
-
imageUrl:
|
|
151
|
+
imageUrl: S,
|
|
141
152
|
onSelectCard: d = () => {
|
|
142
153
|
},
|
|
143
|
-
title:
|
|
144
|
-
isLoading:
|
|
145
|
-
getImage:
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
|
|
154
|
+
title: s = "Season inspiration",
|
|
155
|
+
isLoading: n = !1,
|
|
156
|
+
getImage: m = () => {
|
|
157
|
+
},
|
|
158
|
+
componentName: c
|
|
159
|
+
} = t, k = R(), N = M(() => /* @__PURE__ */ r(h, { children: k === !0 ? i == null ? void 0 : i.map((e, p) => /* @__PURE__ */ r(
|
|
160
|
+
C,
|
|
149
161
|
{
|
|
150
162
|
title: e == null ? void 0 : e.name,
|
|
151
163
|
sellerUuid: e == null ? void 0 : e.sellerUuid,
|
|
152
164
|
uuid: e == null ? void 0 : e.uuid,
|
|
153
|
-
onSelectCard: () => d({
|
|
154
|
-
|
|
165
|
+
onSelectCard: (y, g) => d({
|
|
166
|
+
uuid: e == null ? void 0 : e.uuid,
|
|
167
|
+
nameSlug: e == null ? void 0 : e.nameSlug,
|
|
168
|
+
cardRef: g
|
|
169
|
+
}),
|
|
170
|
+
image: m(e == null ? void 0 : e.image, e == null ? void 0 : e.uuid, e == null ? void 0 : e.sellerUuid) || null,
|
|
171
|
+
metadata: { name: c, accessor: e == null ? void 0 : e.accessor }
|
|
155
172
|
},
|
|
156
|
-
|
|
157
|
-
)) : i == null ? void 0 : i.slice(0, a).map((e,
|
|
158
|
-
|
|
173
|
+
p
|
|
174
|
+
)) : i == null ? void 0 : i.slice(0, a).map((e, p) => /* @__PURE__ */ r(
|
|
175
|
+
C,
|
|
159
176
|
{
|
|
160
177
|
title: e == null ? void 0 : e.name,
|
|
161
178
|
sellerUuid: e == null ? void 0 : e.sellerUuid,
|
|
162
179
|
uuid: e == null ? void 0 : e.uuid,
|
|
163
|
-
onSelectCard: () => d({
|
|
164
|
-
|
|
180
|
+
onSelectCard: (y, g) => d({
|
|
181
|
+
uuid: e == null ? void 0 : e.uuid,
|
|
182
|
+
nameSlug: e == null ? void 0 : e.nameSlug,
|
|
183
|
+
cardRef: g
|
|
184
|
+
}),
|
|
185
|
+
image: m(e == null ? void 0 : e.image, e == null ? void 0 : e.uuid, e == null ? void 0 : e.sellerUuid) || null,
|
|
186
|
+
metadata: { name: c, accessor: e == null ? void 0 : e.accessor }
|
|
165
187
|
},
|
|
166
|
-
|
|
167
|
-
)) }), [i,
|
|
168
|
-
return /* @__PURE__ */
|
|
169
|
-
/* @__PURE__ */ r("div", { className: "regular-title", children: /* @__PURE__ */
|
|
170
|
-
|
|
171
|
-
/* @__PURE__ */ r("span", { children:
|
|
188
|
+
p
|
|
189
|
+
)) }), [i, k, a]);
|
|
190
|
+
return /* @__PURE__ */ u(W, { ref: l, children: [
|
|
191
|
+
/* @__PURE__ */ r("div", { className: "regular-title", children: /* @__PURE__ */ u("div", { className: "regular-title-text", children: [
|
|
192
|
+
z(o) && /* @__PURE__ */ r("i", { className: o }),
|
|
193
|
+
/* @__PURE__ */ r("span", { children: s })
|
|
172
194
|
] }) }),
|
|
173
|
-
/* @__PURE__ */ r(
|
|
174
|
-
/* @__PURE__ */ r(
|
|
175
|
-
|
|
195
|
+
/* @__PURE__ */ r(D, { className: "products-banner", children: /* @__PURE__ */ r("img", { src: S }) }),
|
|
196
|
+
/* @__PURE__ */ r(_, { limit: a, children: /* @__PURE__ */ r(
|
|
197
|
+
T,
|
|
176
198
|
{
|
|
177
|
-
isLoading:
|
|
199
|
+
isLoading: n,
|
|
178
200
|
limit: a,
|
|
179
201
|
keyPrefix: "explore-landing",
|
|
180
|
-
children:
|
|
202
|
+
children: N
|
|
181
203
|
}
|
|
182
204
|
) })
|
|
183
205
|
] });
|
|
184
206
|
});
|
|
185
207
|
export {
|
|
186
|
-
|
|
208
|
+
Q as default
|
|
187
209
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const t=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),c=require("react"),m=require("./emotion-styled.browser.esm-BtEseadx.cjs"),x=require("./utils-Dl9xPH4c.cjs"),P=require("./consts-goSZX3xP.cjs"),ce=require("./motion-B_VPZaJq.cjs"),s=require("./index-BpbMKBf_.cjs"),de=require("./Icon.cjs"),ne=require("./ShopAvatar-CV3lj34D.cjs"),je=require("./Badge.cjs"),Y=require("./emotion-element-f0de968e.browser.esm-B7k6i6lC.cjs"),se=require("./IconButton.cjs"),ge=require("./useDetectMobile-zkbzoOGV.cjs"),Te=m.styled.div`
|
|
2
2
|
cursor: pointer;
|
|
3
3
|
display: flex;
|
|
4
4
|
gap: 1rem;
|
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
border-radius: 1.25rem;
|
|
7
7
|
border: 1px solid var(--gray-200, #e4e9f0);
|
|
8
8
|
|
|
9
|
-
@media (max-width: ${
|
|
9
|
+
@media (max-width: ${P.MOBILE_SIZE_PX+"px"}) {
|
|
10
10
|
flex-direction: column;
|
|
11
11
|
padding: 1rem;
|
|
12
12
|
gap: 0;
|
|
13
13
|
}
|
|
14
|
-
`,
|
|
14
|
+
`,Se=m.styled.div`
|
|
15
15
|
border-radius: ${e=>x.getBorderRadiusValueWithUnits(e.theme,"edged")};
|
|
16
16
|
height: 13.75rem;
|
|
17
17
|
width: 13.75rem;
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
transform: scale(1.25);
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
|
|
37
|
+
`,$e=m.styled.div`
|
|
38
38
|
flex: 1;
|
|
39
39
|
display: flex;
|
|
40
40
|
flex-direction: column;
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
color: var(--gray-600, #676e79);
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
@media (max-width: ${
|
|
120
|
+
@media (max-width: ${P.MOBILE_SIZE_PX+"px"}) {
|
|
121
121
|
padding: 1rem 0 0 0;
|
|
122
122
|
|
|
123
123
|
& .campaign-title-text {
|
|
@@ -142,13 +142,13 @@
|
|
|
142
142
|
gap: 0.25rem;
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
|
-
`,
|
|
145
|
+
`,ae=(e=!1,n=!1,a=!1)=>`
|
|
146
146
|
display: flex;
|
|
147
147
|
${n?"flex-wrap: wrap;":""}
|
|
148
148
|
${n?"":"flex-wrap: nowrap;"}
|
|
149
149
|
${e?"align-items: center;":""}
|
|
150
|
-
${
|
|
151
|
-
`,
|
|
150
|
+
${a?"justify-content: center;":""}
|
|
151
|
+
`,Pe=m.styled(ce.motion.div)`
|
|
152
152
|
text-decoration: none;
|
|
153
153
|
${e=>e.hasPermission===!0&&"cursor: pointer"};
|
|
154
154
|
|
|
@@ -165,7 +165,7 @@
|
|
|
165
165
|
text-decoration: none;
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
-
${
|
|
168
|
+
${ae(!0)}
|
|
169
169
|
gap: 0.5rem;
|
|
170
170
|
padding: 0.5rem;
|
|
171
171
|
color: var(--gray-950, #14161a);
|
|
@@ -181,7 +181,7 @@
|
|
|
181
181
|
font-weight: 400;
|
|
182
182
|
}
|
|
183
183
|
& .logo-wrapper {
|
|
184
|
-
${
|
|
184
|
+
${ae(!0,!1,!0)}
|
|
185
185
|
flex-shrink: 0;
|
|
186
186
|
border-radius: 999px;
|
|
187
187
|
|
|
@@ -220,17 +220,17 @@
|
|
|
220
220
|
background-color: var(--gray-95080, #14161acc);
|
|
221
221
|
}
|
|
222
222
|
|
|
223
|
-
@media (max-width: ${
|
|
223
|
+
@media (max-width: ${P.MOBILE_SIZE_PX+"px"}) {
|
|
224
224
|
padding: 0;
|
|
225
225
|
font-size: 0.875rem;
|
|
226
226
|
}
|
|
227
|
-
|
|
227
|
+
`,Ie=m.styled.div`
|
|
228
228
|
position: absolute;
|
|
229
229
|
top: 0.5rem;
|
|
230
230
|
${e=>e.alignToLeft===!0?"left: 0.5rem;":"right: 0.5rem;"}
|
|
231
231
|
display: flex;
|
|
232
232
|
gap: 0.25rem;
|
|
233
|
-
`,
|
|
233
|
+
`,Ce=m.styled.div`
|
|
234
234
|
border-radius: ${e=>x.getBorderRadiusValueWithUnits(e.theme,e.borderRadius||"slight")};
|
|
235
235
|
background-color: ${e=>e==null?void 0:e.color};
|
|
236
236
|
color: white;
|
|
@@ -246,7 +246,7 @@
|
|
|
246
246
|
& i {
|
|
247
247
|
font-size: 0.813rem;
|
|
248
248
|
}
|
|
249
|
-
`,
|
|
249
|
+
`,ke=c.forwardRef(({src:e,...n},a)=>{const o=c.useRef();return c.useEffect(()=>{var u;const l=i=>{i.target.src=ne.DefaultShopImage,i.onerror=null};return(u=o==null?void 0:o.current)==null||u.addEventListener("error",l),()=>{var i;(i=o==null?void 0:o.current)==null||i.removeEventListener("error",l)}},[]),t.jsx(c.Fragment,{ref:a,children:x.isDefinedNotEmptyString(e)?t.jsx("img",{ref:o,src:e,...n}):t.jsx("img",{src:ne.DefaultShopImage,...n})})}),pe=e=>{const{uuid:n,hasPermission:a=!0,isUser:o,image:l,imageComponent:u,name:i,notifications:p=0,color:d="primary",size:w="large",style:I,disabled:C,onClick:j=()=>{},isActive:k,className:b,shopCategory:v,themeData:_}=e,T={theme:Y.useTheme(),color:d,size:w,style:I,disabled:C};return c.createElement(Pe,{onClick:g=>{g.stopPropagation(),a===!0&&(j==null||j())},...T,key:i,className:`profile-item ${b}`,hasPermission:a,isActive:k,themeColor:(_==null?void 0:_.code)||"transparent"},t.jsx("div",{className:"logo-wrapper",children:x.isDefined(u)?u:l}),t.jsxs("div",{children:[t.jsx("div",{className:"name",children:i}),!o&&t.jsx("div",{className:"description",children:v}),p>0&&t.jsx("div",{className:"notifications-number",children:t.jsx(je,{className:"badge",color:"danger",size:"small",children:p>99?"99+":p})})]}))};pe.propTypes={id:s.PropTypes.any,isUserProfile:s.PropTypes.bool,themeColor:s.PropTypes.string,image:s.PropTypes.any,name:s.PropTypes.string,notifications:s.PropTypes.number,style:s.PropTypes.object,className:s.PropTypes.string,color:s.PropTypes.oneOf(["primary","secondary","success","warning","danger","information","neutral"]),size:s.PropTypes.oneOf(["large"]),onSelect:s.PropTypes.func,hasPermission:s.PropTypes.bool};const oe=(e,n)=>{if(!e||!n)return null;const a=e.getTime()-n.getTime(),o=24*60*60*1e3;return Math.floor(a/o)},ie=e=>{if(e!==void 0){const n=new Date(e),a=n.getFullYear(),o=n.getMonth()+1;return`${String(n.getDate()).padStart(2)}. ${o}. ${a}.`}},me=c.forwardRef((e,n)=>{var te;const a=Y.useTheme(),{shopUuid:o,title:l="",coverPhoto:u,onSelect:i,startDate:p,endDate:d,salesPackages:w,shopName:I,shopCategory:C,shopImage:j,shopImageComponent:k,className:b,onSelectCard:v=()=>{},onSelectShop:_=()=>{},upcoming:N=!1,upcomingCampaignText:T,campaignSingleText:g,salesCampaignTypes:h=[],startsInPrefixTextPlural:B,startsinSuffixTextPlural:q,startsInPrefixTextSingular:W,startsinSuffixTextSingular:J,endsInPrefixTextPlural:V,endsinSuffixTextPlural:F,endsInPrefixTextSingular:X,endsinSuffixTextSingular:M,themeData:Z,numberOfListings:D,numberOfListingsTextSingular:r,numberOfListingsTextPlural:A,metadata:S,...G}=e,K=c.useRef(),Q=p?new Date(p)<=new Date:!1,fe=oe(p?new Date(p):null,new Date),z=oe(d?new Date(d):null,new Date),xe=z!==null&&z<=2&&z>0,ee=d?new Date(d).getTime():null,ye=Date.now(),H=ee!==null?ee-ye:null,R=H!==null&&H>0&&H<24*60*60*1e3,re=(y,O,f,E,$)=>f===1?`${y} ${f} ${E}`:`${O} ${f} ${$}`,we=()=>{if(!d)return null;const y=be,f=new Date(d).getTime()-y.getTime();if(f<=0)return null;const E=Math.floor(f/(1e3*60*60)),$=Math.floor(f%(1e3*60*60)/(1e3*60)),_e=Math.floor(f%(1e3*60)/1e3);return{hours:E,minutes:$,seconds:_e}},[be,ve]=c.useState(new Date);c.useEffect(()=>{if(!R)return;const y=setInterval(()=>{ve(new Date)},1e3);return()=>clearInterval(y)},[R]);const L=R?we():null;return t.jsxs(Te,{ref:K,theme:a,className:b,name:S==null?void 0:S.name,"data-accessor":S==null?void 0:S.accessor,onClick:y=>v(y,K),...G,children:[t.jsxs(Se,{theme:a,onClick:()=>i==null?void 0:i(),children:[t.jsx("img",{src:u}),t.jsx(Ie,{children:w==null?void 0:w.map((y,O)=>{var f,E;return t.jsx(Ce,{color:(f=h==null?void 0:h.find($=>$.value===y))==null?void 0:f.color,theme:a,children:t.jsx(de,{icon:(E=h==null?void 0:h.find($=>$.value===y))==null?void 0:E.icon})},`package__${O}`)})})]}),t.jsxs($e,{theme:a,children:[t.jsx("div",{className:"text-block-wrapper",children:t.jsxs("div",{className:"title-block-wrapper",children:[t.jsx("div",{className:"campaign-title",children:(te=N?T:g)==null?void 0:te.toUpperCase()}),t.jsx("div",{className:"campaign-title-text",children:l}),d&&p&&t.jsxs("div",{className:"campaign-date",children:[ie(p)," - ",ie(d)]}),t.jsxs("div",{className:"timestamp-text",children:[D>0&&t.jsxs("span",{className:"listings-text",children:[D," ",D===1?r:A," ","∙"," "]}),t.jsx("span",{className:`duration-text ${xe?"urgent":""} ${Q?"":"starts-in"}`,children:R&&L?t.jsxs("div",{className:"countdown-timer",children:[X," ",L.hours.toString().padStart(2,"0"),":",L.minutes.toString().padStart(2,"0"),":",L.seconds.toString().padStart(2,"0")]}):Q?re(X,V,z,M,F):re(W,B,fe,J,q)})]})]})}),t.jsx(pe,{hasPermission:!0,image:t.jsx(ke,{src:j}),imageComponent:k,themeData:Z,isActive:!0,isUser:!1,name:I,shopCategory:C,onClick:()=>_(o)})]})]})});me.propTypes={title:s.PropTypes.oneOfType([s.PropTypes.string,s.PropTypes.element]),numberOfListings:s.PropTypes.number,dropdown:s.PropTypes.any,color:s.PropTypes.string};m.styled.div`
|
|
250
250
|
display: flex;
|
|
251
251
|
flex-direction: column;
|
|
252
252
|
gap: 1.5rem;
|
|
@@ -277,25 +277,25 @@
|
|
|
277
277
|
}
|
|
278
278
|
}
|
|
279
279
|
|
|
280
|
-
@media (max-width: ${
|
|
280
|
+
@media (max-width: ${P.MOBILE_SIZE_PX+"px"}) {
|
|
281
281
|
& .campaign-item {
|
|
282
282
|
min-width: 100%;
|
|
283
283
|
width: 100%;
|
|
284
284
|
margin-right: 0;
|
|
285
285
|
}
|
|
286
286
|
}
|
|
287
|
-
`;const
|
|
287
|
+
`;const U=m.styled.div`
|
|
288
288
|
width: ${e=>e.width||"100%"};
|
|
289
289
|
height: ${e=>(e.heightCoeff||1)*1.125}rem;
|
|
290
290
|
background-color: var(--gray-200, #dddfe4);
|
|
291
291
|
|
|
292
292
|
${x.linearGradientAnimation("-90deg")}
|
|
293
|
-
`,
|
|
293
|
+
`,Ne=m.styled.div`
|
|
294
294
|
display: flex;
|
|
295
295
|
flex-direction: ${e=>e!=null&&e.row?"row":"column"};
|
|
296
296
|
gap: ${e=>(e==null?void 0:e.gap)??"0.5rem"};
|
|
297
297
|
width: ${e=>(e==null?void 0:e.width)??"100%"};
|
|
298
|
-
`,
|
|
298
|
+
`,le=m.styled.div`
|
|
299
299
|
border-radius: ${e=>x.getBorderRadiusValueWithUnits(e.theme,(e==null?void 0:e.borderRadius)??"regular")};
|
|
300
300
|
background: var(--gray-200, #dddfe4);
|
|
301
301
|
position: relative;
|
|
@@ -306,7 +306,7 @@
|
|
|
306
306
|
flex-shrink: 0;
|
|
307
307
|
|
|
308
308
|
${x.linearGradientAnimation()}
|
|
309
|
-
`,
|
|
309
|
+
`,De=m.styled.div`
|
|
310
310
|
background: var(--white, #fff);
|
|
311
311
|
border-radius: ${e=>x.getBorderRadiusValueWithUnits(e.theme,"edged")};
|
|
312
312
|
box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.1), 0px 1px 2px rgba(0, 0, 0, 0.06);
|
|
@@ -335,17 +335,17 @@
|
|
|
335
335
|
gap: 0.5rem;
|
|
336
336
|
}
|
|
337
337
|
|
|
338
|
-
@media (max-width: ${
|
|
338
|
+
@media (max-width: ${P.MOBILE_SIZE_PX+"px"}) {
|
|
339
339
|
flex-direction: column;
|
|
340
340
|
|
|
341
341
|
& .campaign__user {
|
|
342
342
|
margin-top: 1rem;
|
|
343
343
|
}
|
|
344
344
|
}
|
|
345
|
-
`,
|
|
345
|
+
`,Ee=m.styled.div`
|
|
346
346
|
display: flex;
|
|
347
347
|
gap: 1.5rem;
|
|
348
|
-
`,
|
|
348
|
+
`,Me=c.forwardRef(({},e)=>{const n=Y.useTheme();return t.jsxs(De,{ref:e,theme:n,children:[t.jsx("div",{className:"campaign__left-section",children:t.jsx(le,{theme:n,width:"15rem",height:"15rem",borderRadius:"edged"})}),t.jsxs("div",{className:"campaign__right-section",children:[t.jsxs(Ne,{theme:n,children:[t.jsx(U,{heightCoeff:.75,theme:n,width:"35%"}),t.jsx(U,{heightCoeff:1.25,theme:n}),t.jsx(U,{heightCoeff:3,theme:n})]}),t.jsxs("div",{className:"campaign__user",children:[t.jsx(le,{theme:n,width:"2.5rem",height:"2.5rem",borderRadius:"curved"}),t.jsx(U,{theme:n,width:"75%"})]})]})]})}),ze=({itemsCount:e=5,keyPrefix:n})=>t.jsx(Ee,{children:Array.from({length:e},(a,o)=>t.jsx(Me,{},`${n}-skeleton-campaign-card-${o}`))}),Re=({children:e,fallbackComponent:n=t.jsx(t.Fragment,{}),isLoading:a=!1,itemsCount:o=5,keyPrefix:l})=>t.jsx(c.Suspense,{fallback:n,children:a===!0?t.jsx(ze,{itemsCount:o,keyPrefix:l}):e}),Le=m.styled.div`
|
|
349
349
|
margin: 0 auto;
|
|
350
350
|
display: flex;
|
|
351
351
|
flex-direction: column;
|
|
@@ -384,7 +384,7 @@
|
|
|
384
384
|
right: 0;
|
|
385
385
|
}
|
|
386
386
|
|
|
387
|
-
@media (max-width: ${
|
|
387
|
+
@media (max-width: ${P.MOBILE_SIZE_PX+"px"}) {
|
|
388
388
|
& .scrollable-section__header {
|
|
389
389
|
& .scrollable-section__title {
|
|
390
390
|
& .title__text {
|
|
@@ -394,13 +394,13 @@
|
|
|
394
394
|
}
|
|
395
395
|
}
|
|
396
396
|
}
|
|
397
|
-
`,
|
|
397
|
+
`,Oe=m.styled(ce.motion.div)`
|
|
398
398
|
display: grid;
|
|
399
399
|
grid-template-columns: repeat(${e=>e==null?void 0:e.numOfColumns}, 1fr);
|
|
400
400
|
gap: 1.5rem;
|
|
401
401
|
width: 100%;
|
|
402
402
|
|
|
403
|
-
@media (max-width: ${
|
|
403
|
+
@media (max-width: ${P.MOBILE_SIZE_PX+"px"}) {
|
|
404
404
|
display: flex;
|
|
405
405
|
flex-wrap: nowrap;
|
|
406
406
|
overflow-x: scroll;
|
|
@@ -422,7 +422,7 @@
|
|
|
422
422
|
/* Safari and Chrome */
|
|
423
423
|
}
|
|
424
424
|
}
|
|
425
|
-
`,
|
|
425
|
+
`,he=c.forwardRef(({icon:e,title:n,numOfSlides:a=2,showNavigation:o=!0,children:l},u)=>{const[i,p]=c.useState(0),[d,w]=c.useState(1),[I,C]=c.useState(null),[j,k]=c.useState(null),b=ge.useDetectMobile(),v=(l==null?void 0:l.length)??1;c.useEffect(()=>{const g=()=>{w(a)};return window.addEventListener("resize",g),g(),()=>window.removeEventListener("resize",g)},[]);const _=b?l:l==null?void 0:l.slice(i,i+d),N=g=>{var h;(h=g==null?void 0:g.target)==null||h.blur(),i+d<v&&p(i+d)},T=g=>{var h;(h=g==null?void 0:g.target)==null||h.blur(),i-d>=0&&p(i-d)};return t.jsxs(Le,{ref:u,children:[t.jsx("div",{className:"scrollable-section__header",children:t.jsxs("div",{className:"scrollable-section__title",children:[x.isDefinedNotEmptyString(e)&&t.jsx(de,{icon:e,color:"primary",sizeInUnits:"1.5rem",className:"title__icon"}),x.isDefinedNotEmptyString(n)&&t.jsxs("div",{className:"title__text",children:[" ",n]})]})}),t.jsx(Oe,{numOfColumns:a,...!b&&{animate:{x:0,opacity:1},initial:{x:10,opacity:0}},children:_},`scrollable-section__content-${i}`),o&&v>d&&!b&&t.jsxs("div",{className:"scrollable-section__navigation",children:[t.jsx(se,{icon:"angle-left",borderRadius:"curved",btnType:"tinted",color:"neutral",className:"navigation__arrow",disabled:i===0,onClick:T}),t.jsx(se,{icon:"angle-right",borderRadius:"curved",btnType:"tinted",color:"neutral",className:"navigation__arrow",disabled:i+d>=v,onClick:N})]})]})});he.propTypes={icon:s.PropTypes.string,title:s.PropTypes.string,numOfSlides:s.PropTypes.number,numOfSlidesForMobile:s.PropTypes.number,showNavigation:s.PropTypes.bool};const Ue=m.styled.div`
|
|
426
426
|
display: flex;
|
|
427
427
|
flex: 1;
|
|
428
428
|
width: 100%;
|
|
@@ -439,4 +439,4 @@
|
|
|
439
439
|
border-radius: 1.25rem;
|
|
440
440
|
object-fit: cover;
|
|
441
441
|
}
|
|
442
|
-
`,
|
|
442
|
+
`,ue=c.forwardRef(({sectionName:e,imageUrl:n,maxHeight:a="16.25rem",className:o="",handleClick:l=()=>{}},u)=>t.jsx(Ue,{ref:u,maxHeight:a,onClick:l,className:`itemless-banner ${o}`,children:t.jsx("img",{src:n,alt:`itemless-banner__${e}`})}));ue.propTypes={sectionName:s.PropTypes.string,imageUrl:s.PropTypes.string,maxHeight:s.PropTypes.string,className:s.PropTypes.string,handleClick:s.PropTypes.func};const Be=c.memo(me),qe=c.forwardRef(({sellerType:e="Shop",items:n=[],title:a,icon:o,isLoading:l,onSelectCard:u=()=>{},onSelectShop:i=()=>{},getImage:p=()=>{},campaignSingleText:d,upcomingCampaignText:w,salesCampaignTypes:I=[],startsInPrefixTextPlural:C,startsinSuffixTextPlural:j,startsInPrefixTextSingular:k,startsinSuffixTextSingular:b,endsInPrefixTextPlural:v,endsinSuffixTextPlural:_,endsInPrefixTextSingular:N,endsinSuffixTextSingular:T,numOfSlides:g=2,showNavigation:h=!0,numberOfListingsTextSingular:B,numberOfListingsTextPlural:q,itemlessImageUrl:W,itemlessLink:J,handleItemlessLink:V=()=>{},componentName:F},X)=>{const M=ge.useDetectMobile(),Z=c.useMemo(()=>{let D=n==null?void 0:n.map((r,A)=>t.jsx(Be,{className:"campaign-item",coverPhoto:p(r==null?void 0:r.coverPhoto,(r==null?void 0:r.uuid)||(r==null?void 0:r.campaignUuid)),description:r==null?void 0:r.description,endDate:r==null?void 0:r.endDate,salesPackages:r==null?void 0:r.salesPackages,sellerType:e,shopImage:r==null?void 0:r.profileImage,shopImageComponent:r==null?void 0:r.profileImageComponent,shopName:r==null?void 0:r.shopName,shopUuid:r==null?void 0:r.shopUuid,shopCategory:r==null?void 0:r.shopCategory,startDate:r==null?void 0:r.startDate,title:r==null?void 0:r.name,uuid:r==null?void 0:r.campaignUuid,onSelectCard:(S,G)=>u(r==null?void 0:r.campaignUuid,r==null?void 0:r.shopUuid,G),onSelectShop:()=>i(r==null?void 0:r.shopUuid),campaignSingleText:d,upcomingCampaignText:w,upcoming:r==null?void 0:r.upcoming,salesCampaignTypes:I,startsInPrefixTextPlural:C,startsinSuffixTextPlural:j,startsInPrefixTextSingular:k,startsinSuffixTextSingular:b,endsInPrefixTextPlural:v,endsinSuffixTextPlural:_,endsInPrefixTextSingular:N,endsinSuffixTextSingular:T,themeData:r==null?void 0:r.themeData,numberOfListings:r==null?void 0:r.numberOfListings,numberOfListingsTextSingular:B,numberOfListingsTextPlural:q,metadata:{name:F,accessor:r==null?void 0:r.accessor}},`campaign__item__${A}__${r==null?void 0:r.startDate}___${r==null?void 0:r.endDate}`));return(n==null?void 0:n.length)<2&&!M?[...D,t.jsx(ue,{imageUrl:W,className:"campaign-item",handleClick:V},"itemless-campaign-section-banner")]:D},[n]);return t.jsx(Re,{isLoading:l,itemsCount:M?1:2,keyPrefix:"sales-camp",children:t.jsx(he,{icon:o,title:a,numOfSlides:g,showNavigation:h,children:Z},`sales-campaign-section__${M}`)})});module.exports=qe;
|