@lanaco/lnc-react-ui 4.0.183 → 4.0.185
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 +5 -3
- package/dist/BlogCardsSponsoredSection.js +68 -64
- package/dist/BlogCategoryCardsSection.cjs +1 -1
- package/dist/BlogCategoryCardsSection.js +1 -1
- package/dist/BlogListSection.cjs +8 -6
- package/dist/BlogListSection.js +122 -114
- package/dist/BlogProductCardsSection.cjs +1 -1
- package/dist/BlogProductCardsSection.js +1 -1
- package/dist/BlogShopCardsSection.cjs +1 -1
- package/dist/BlogShopCardsSection.js +1 -1
- package/dist/BlogSingleSection.cjs +1 -1
- package/dist/BlogSingleSection.js +1 -1
- package/dist/BlogsSectionDetailed.cjs +5 -3
- package/dist/BlogsSectionDetailed.js +53 -49
- package/dist/BlogsSectionLarge.cjs +2 -2
- package/dist/BlogsSectionLarge.js +2 -2
- package/dist/BlogsSectionSimple.cjs +9 -7
- package/dist/BlogsSectionSimple.js +53 -47
- package/dist/BlogsSectionSimpleCentered.cjs +7 -5
- package/dist/BlogsSectionSimpleCentered.js +31 -26
- package/dist/BlogsSectionWithFilters.cjs +9 -7
- package/dist/BlogsSectionWithFilters.js +47 -42
- package/dist/BrandHitsSection.cjs +9 -7
- package/dist/BrandHitsSection.js +40 -35
- package/dist/{CategorySimpleCard-BNYjZQTH.cjs → CategorySimpleCard-D5N8cx0Z.cjs} +4 -3
- package/dist/{CategorySimpleCard-BA0S7TaN.js → CategorySimpleCard-DRQuoxXu.js} +17 -15
- package/dist/CheckBoxInput.cjs +27 -27
- package/dist/CheckBoxInput.js +61 -98
- package/dist/ColorInput.cjs +26 -26
- package/dist/ColorInput.js +127 -162
- package/dist/DetailedProductsInfinitiveSection.cjs +2 -2
- package/dist/DetailedProductsInfinitiveSection.js +6 -5
- package/dist/DetailedProductsSection.cjs +2 -2
- package/dist/DetailedProductsSection.js +12 -10
- package/dist/FieldOfInterestsMasonrySection.cjs +5 -3
- package/dist/FieldOfInterestsMasonrySection.js +90 -85
- package/dist/FieldOfInterestsWithAvatarsCardsSection.cjs +4 -4
- package/dist/FieldOfInterestsWithAvatarsCardsSection.js +49 -46
- package/dist/FieldOfInterestsWithTagsCardsSection.cjs +8 -6
- package/dist/FieldOfInterestsWithTagsCardsSection.js +44 -40
- package/dist/GeneralWithTagsCardsSection.cjs +12 -8
- package/dist/GeneralWithTagsCardsSection.js +50 -44
- package/dist/GiftCardsSection.cjs +7 -5
- package/dist/GiftCardsSection.js +46 -40
- package/dist/MasonryGeneralCardsSection.cjs +6 -5
- package/dist/MasonryGeneralCardsSection.js +26 -23
- package/dist/Modal.cjs +14 -13
- package/dist/Modal.js +88 -86
- package/dist/OverlayGeneralCardsSection.cjs +7 -5
- package/dist/OverlayGeneralCardsSection.js +30 -35
- package/dist/ProductsWithBannerSection.cjs +8 -6
- package/dist/ProductsWithBannerSection.js +71 -77
- package/dist/QuattroCardsSection.cjs +8 -6
- package/dist/QuattroCardsSection.js +31 -28
- package/dist/ReviewsSection.cjs +11 -9
- package/dist/ReviewsSection.js +38 -36
- package/dist/SalesCampaignsSection.cjs +22 -19
- package/dist/SalesCampaignsSection.js +299 -300
- package/dist/ShopCardsSection.cjs +1 -1
- package/dist/ShopCardsSection.js +1 -1
- package/dist/SimpleCategoriesSection.cjs +2 -2
- package/dist/SimpleCategoriesSection.js +7 -3
- package/dist/SimpleProductsSection.cjs +5 -5
- package/dist/SimpleProductsSection.js +62 -72
- package/dist/UrgentSaleProductsSection.cjs +6 -6
- package/dist/UrgentSaleProductsSection.js +9 -7
- package/dist/{index-DoKMLSVY.cjs → index-0p_3g3pT.cjs} +4 -2
- package/dist/{index-Bhfq_YpE.js → index-BipuzfLW.js} +28 -25
- package/dist/{index-CaAhRJ2-.cjs → index-Bmr3IeZ_.cjs} +12 -11
- package/dist/{index-DWLKvVyZ.js → index-C8QkdNHi.js} +27 -23
- package/dist/{index-B8I1mHMA.js → index-CA59z2ge.js} +29 -26
- package/dist/{index-BnYqZk-h.cjs → index-DHV9awrE.cjs} +4 -2
- package/dist/{index-DxZ71UZ1.js → index-DZ8515cZ.js} +144 -137
- package/dist/{index-D55MR8tU.cjs → index-MiN854X_.cjs} +6 -4
- package/package.json +1 -1
package/dist/ReviewsSection.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { jsxs as n, jsx as r, Fragment as
|
|
1
|
+
import { jsxs as n, jsx as r, Fragment as S } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as v, Suspense as N, memo as z, useMemo as P } from "react";
|
|
3
|
-
import { s } from "./emotion-styled.browser.esm-BNN1dTl3.js";
|
|
3
|
+
import { s as l } from "./emotion-styled.browser.esm-BNN1dTl3.js";
|
|
4
4
|
import { M as $ } from "./consts-BuFChS64.js";
|
|
5
5
|
import { u as M } from "./useDetectMobile-Bkvj0VMa.js";
|
|
6
|
-
import { t as I, o as W, b as j, g as
|
|
7
|
-
import { useTheme as
|
|
6
|
+
import { t as I, o as W, b as j, g as x } from "./utils-Dc5zIpaz.js";
|
|
7
|
+
import { useTheme as E } from "./ThemeProvider.js";
|
|
8
8
|
import { P as d } from "./index-CblbdqjE.js";
|
|
9
|
-
import { P as
|
|
9
|
+
import { P as T } from "./index-C_NnINik.js";
|
|
10
10
|
import { s as G, a as L, S as f, c as w, b as o } from "./style-CXMUA6cI.js";
|
|
11
|
-
const F =
|
|
11
|
+
const F = l.div`
|
|
12
12
|
display: flex;
|
|
13
13
|
flex-direction: column;
|
|
14
14
|
color: var(--darkest-950);
|
|
@@ -18,7 +18,7 @@ const F = s.div`
|
|
|
18
18
|
font-weight: 600;
|
|
19
19
|
font-size: 1.5rem;
|
|
20
20
|
}
|
|
21
|
-
`, O =
|
|
21
|
+
`, O = l.div`
|
|
22
22
|
display: grid;
|
|
23
23
|
grid-template-columns: ${(t) => `repeat(${t.limit}, minmax(0, 1fr))`};
|
|
24
24
|
gap: 1.25rem;
|
|
@@ -26,10 +26,12 @@ const F = s.div`
|
|
|
26
26
|
@media (max-width: ${$ + "px"}) {
|
|
27
27
|
grid-template-columns: repeat(1, 1fr);
|
|
28
28
|
}
|
|
29
|
-
`, A =
|
|
29
|
+
`, A = l.div`
|
|
30
30
|
padding-top: 5rem;
|
|
31
31
|
overflow: hidden;
|
|
32
|
-
|
|
32
|
+
text-decoration: none;
|
|
33
|
+
color: var(--gray-950);
|
|
34
|
+
`, B = l.div`
|
|
33
35
|
position: relative;
|
|
34
36
|
cursor: pointer;
|
|
35
37
|
display: flex;
|
|
@@ -85,13 +87,13 @@ const F = s.div`
|
|
|
85
87
|
box-shadow: 0px 10px 15px -3px rgba(0, 0, 0, 0.1),
|
|
86
88
|
0px 4px 6px -2px rgba(0, 0, 0, 0.05);
|
|
87
89
|
}
|
|
88
|
-
`, R = (t, a) =>
|
|
90
|
+
`, R = (t, a) => x(
|
|
89
91
|
t.theme,
|
|
90
92
|
"StarRating",
|
|
91
93
|
t.color,
|
|
92
94
|
t.disabled === !0 ? "disabled" : "enabled",
|
|
93
95
|
a
|
|
94
|
-
), V =
|
|
96
|
+
), V = l.div`
|
|
95
97
|
font-size: ${(t) => R(t, "fontSize")};
|
|
96
98
|
line-height: ${(t) => R(t, "lineHeight")};
|
|
97
99
|
line-height: 1.5rem;
|
|
@@ -112,7 +114,7 @@ const F = s.div`
|
|
|
112
114
|
line-height: 1.5rem;
|
|
113
115
|
color: ${(t) => t.color};
|
|
114
116
|
}
|
|
115
|
-
`, _ =
|
|
117
|
+
`, _ = l.span`
|
|
116
118
|
position: absolute;
|
|
117
119
|
z-index: 1;
|
|
118
120
|
display: block;
|
|
@@ -128,35 +130,35 @@ const F = s.div`
|
|
|
128
130
|
t.disabled === !0 ? "disabled" : "enabled",
|
|
129
131
|
"filledColor"
|
|
130
132
|
)};
|
|
131
|
-
`, q =
|
|
133
|
+
`, q = l.span`
|
|
132
134
|
padding: 0;
|
|
133
135
|
display: block;
|
|
134
136
|
z-index: 0;
|
|
135
137
|
color: ${(t) => t.color};
|
|
136
138
|
`, k = v((t, a) => {
|
|
137
139
|
const {
|
|
138
|
-
rating:
|
|
140
|
+
rating: s = 0,
|
|
139
141
|
reviewCount: i = null,
|
|
140
142
|
disabled: m = !1,
|
|
141
143
|
tabIndex: c = 0,
|
|
142
|
-
className:
|
|
143
|
-
style:
|
|
144
|
+
className: g = "",
|
|
145
|
+
style: h = {},
|
|
144
146
|
color: u = "primary",
|
|
145
147
|
size: e = "large"
|
|
146
|
-
} = t, { theme: p } =
|
|
148
|
+
} = t, { theme: p } = E(), b = {
|
|
147
149
|
theme: p,
|
|
148
150
|
color: u,
|
|
149
151
|
size: e,
|
|
150
|
-
style:
|
|
152
|
+
style: h,
|
|
151
153
|
disabled: m
|
|
152
|
-
}, C =
|
|
154
|
+
}, C = s / 5 * 100;
|
|
153
155
|
return /* @__PURE__ */ n(
|
|
154
156
|
V,
|
|
155
157
|
{
|
|
156
158
|
ref: a,
|
|
157
159
|
tabIndex: c,
|
|
158
160
|
...b,
|
|
159
|
-
className: `star-rating ${
|
|
161
|
+
className: `star-rating ${g}`,
|
|
160
162
|
children: [
|
|
161
163
|
/* @__PURE__ */ n("div", { className: "rating", children: [
|
|
162
164
|
/* @__PURE__ */ r(
|
|
@@ -194,17 +196,17 @@ k.propTypes = {
|
|
|
194
196
|
size: d.oneOf(["small", "medium", "large"])
|
|
195
197
|
};
|
|
196
198
|
const D = v((t, a) => {
|
|
197
|
-
const { image:
|
|
198
|
-
}
|
|
199
|
-
return /* @__PURE__ */ r(A, { ref: a, className: "review-card", onClick:
|
|
200
|
-
/* @__PURE__ */ r(
|
|
199
|
+
const { image: s, text: i, title: m, link: c, rating: g, onSelectCard: h = () => {
|
|
200
|
+
} } = t;
|
|
201
|
+
return /* @__PURE__ */ r(A, { ref: a, className: "review-card", onClick: h, href: `/${c}`, children: /* @__PURE__ */ n(B, { children: [
|
|
202
|
+
/* @__PURE__ */ r(T, { src: s }),
|
|
201
203
|
/* @__PURE__ */ n("div", { className: "cont", children: [
|
|
202
204
|
/* @__PURE__ */ r("span", { className: "cont-title", children: m }),
|
|
203
205
|
/* @__PURE__ */ r("div", { className: "cont-text", children: i })
|
|
204
206
|
] }),
|
|
205
|
-
/* @__PURE__ */ r(k, { color: "warning", rating:
|
|
207
|
+
/* @__PURE__ */ r(k, { color: "warning", rating: g })
|
|
206
208
|
] }) });
|
|
207
|
-
}), H =
|
|
209
|
+
}), H = l(L)`
|
|
208
210
|
@media (max-width: ${$ + "px"}) {
|
|
209
211
|
flex-direction: column;
|
|
210
212
|
|
|
@@ -283,18 +285,18 @@ const D = v((t, a) => {
|
|
|
283
285
|
] }), Z = ({
|
|
284
286
|
keyPrefix: t,
|
|
285
287
|
isLoading: a = !1,
|
|
286
|
-
fallbackComponent:
|
|
288
|
+
fallbackComponent: s = /* @__PURE__ */ r(S, {}),
|
|
287
289
|
children: i
|
|
288
|
-
}) => /* @__PURE__ */ r(N, { fallbackComponent:
|
|
290
|
+
}) => /* @__PURE__ */ r(N, { fallbackComponent: s, children: a === !0 ? /* @__PURE__ */ r(X, { keyPrefix: t }) : i }), y = z(D), ae = v((t, a) => {
|
|
289
291
|
const {
|
|
290
|
-
title:
|
|
292
|
+
title: s = "Electronics reviews",
|
|
291
293
|
items: i,
|
|
292
294
|
limit: m = 3,
|
|
293
295
|
onSelectCard: c = () => {
|
|
294
296
|
},
|
|
295
|
-
isLoading:
|
|
296
|
-
} = t,
|
|
297
|
-
|
|
297
|
+
isLoading: g = !1
|
|
298
|
+
} = t, h = M(), u = P(() => /* @__PURE__ */ r(S, { children: h === !0 ? i == null ? void 0 : i.map((e, p) => /* @__PURE__ */ r(
|
|
299
|
+
y,
|
|
298
300
|
{
|
|
299
301
|
text: e == null ? void 0 : e.text,
|
|
300
302
|
title: e == null ? void 0 : e.title,
|
|
@@ -305,7 +307,7 @@ const D = v((t, a) => {
|
|
|
305
307
|
},
|
|
306
308
|
p
|
|
307
309
|
)) : i == null ? void 0 : i.slice(0, m).map((e, p) => /* @__PURE__ */ r(
|
|
308
|
-
|
|
310
|
+
y,
|
|
309
311
|
{
|
|
310
312
|
text: e == null ? void 0 : e.text,
|
|
311
313
|
title: e == null ? void 0 : e.title,
|
|
@@ -315,10 +317,10 @@ const D = v((t, a) => {
|
|
|
315
317
|
onSelectCard: () => c(e)
|
|
316
318
|
},
|
|
317
319
|
p
|
|
318
|
-
)) }), [i,
|
|
320
|
+
)) }), [i, h, m]);
|
|
319
321
|
return /* @__PURE__ */ n(F, { ref: a, children: [
|
|
320
|
-
/* @__PURE__ */ r("div", { className: "container-title", children:
|
|
321
|
-
/* @__PURE__ */ r(Z, { isLoading:
|
|
322
|
+
/* @__PURE__ */ r("div", { className: "container-title", children: s }),
|
|
323
|
+
/* @__PURE__ */ r(Z, { isLoading: g, keyPrefix: "reviews-skeleton", children: /* @__PURE__ */ r(O, { limit: m, children: u }) })
|
|
322
324
|
] });
|
|
323
325
|
});
|
|
324
326
|
export {
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
"use strict";const r=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";const r=require("react/jsx-runtime"),c=require("react"),S=require("./emotion-styled.browser.esm-BtEseadx.cjs"),y=require("./utils-RnrgDDZP.cjs"),z=require("./consts-goSZX3xP.cjs"),ge=require("./motion-B_VPZaJq.cjs"),he=require("./Icon.cjs"),le=require("./ShopAvatar-CV3lj34D.cjs"),ke=require("./Badge.cjs"),s=require("./index-BpbMKBf_.cjs"),me=require("./emotion-element-f0de968e.browser.esm-B7k6i6lC.cjs"),ce=require("./IconButton.cjs"),ue=require("./useDetectMobile-zkbzoOGV.cjs"),Te=require("./index-Be-_NM9Q.cjs"),i=require("./style-BAcV7F53.cjs"),$e=S.styled.a`
|
|
2
|
+
text-decoration: none;
|
|
3
|
+
color: var(--gray-950);
|
|
2
4
|
cursor: pointer;
|
|
3
5
|
display: flex;
|
|
4
6
|
gap: 1rem;
|
|
@@ -6,12 +8,12 @@
|
|
|
6
8
|
border-radius: 1.25rem;
|
|
7
9
|
border: 1px solid var(--gray-200, #e4e9f0);
|
|
8
10
|
|
|
9
|
-
@media (max-width: ${
|
|
11
|
+
@media (max-width: ${z.MOBILE_SIZE_PX+"px"}) {
|
|
10
12
|
flex-direction: column;
|
|
11
13
|
padding: 1rem;
|
|
12
14
|
gap: 0;
|
|
13
15
|
}
|
|
14
|
-
|
|
16
|
+
`,Ie=S.styled.div`
|
|
15
17
|
border-radius: ${n=>y.getBorderRadiusValueWithUnits(n.theme,"edged")};
|
|
16
18
|
height: 13.75rem;
|
|
17
19
|
width: 13.75rem;
|
|
@@ -117,7 +119,7 @@
|
|
|
117
119
|
color: var(--gray-600, #676e79);
|
|
118
120
|
}
|
|
119
121
|
|
|
120
|
-
@media (max-width: ${
|
|
122
|
+
@media (max-width: ${z.MOBILE_SIZE_PX+"px"}) {
|
|
121
123
|
padding: 1rem 0 0 0;
|
|
122
124
|
|
|
123
125
|
& .campaign-title-text {
|
|
@@ -142,14 +144,15 @@
|
|
|
142
144
|
gap: 0.25rem;
|
|
143
145
|
}
|
|
144
146
|
}
|
|
145
|
-
`,
|
|
147
|
+
`,de=(n=!1,t=!1,o=!1)=>`
|
|
146
148
|
display: flex;
|
|
147
|
-
${
|
|
148
|
-
${
|
|
149
|
+
${t?"flex-wrap: wrap;":""}
|
|
150
|
+
${t?"":"flex-wrap: nowrap;"}
|
|
149
151
|
${n?"align-items: center;":""}
|
|
150
152
|
${o?"justify-content: center;":""}
|
|
151
|
-
`,Ne=S.styled(
|
|
153
|
+
`,Ne=S.styled(ge.motion.a)`
|
|
152
154
|
text-decoration: none;
|
|
155
|
+
color: var(--gray-950);
|
|
153
156
|
${n=>n.hasPermission===!0&&"cursor: pointer"};
|
|
154
157
|
|
|
155
158
|
&:focus,
|
|
@@ -165,7 +168,7 @@
|
|
|
165
168
|
text-decoration: none;
|
|
166
169
|
}
|
|
167
170
|
|
|
168
|
-
${
|
|
171
|
+
${de(!0)}
|
|
169
172
|
gap: 0.5rem;
|
|
170
173
|
padding: 0.5rem;
|
|
171
174
|
color: var(--gray-950, #14161a);
|
|
@@ -181,7 +184,7 @@
|
|
|
181
184
|
font-weight: 400;
|
|
182
185
|
}
|
|
183
186
|
& .logo-wrapper {
|
|
184
|
-
${
|
|
187
|
+
${de(!0,!1,!0)}
|
|
185
188
|
flex-shrink: 0;
|
|
186
189
|
border-radius: 999px;
|
|
187
190
|
|
|
@@ -220,7 +223,7 @@
|
|
|
220
223
|
background-color: var(--gray-95080, #14161acc);
|
|
221
224
|
}
|
|
222
225
|
|
|
223
|
-
@media (max-width: ${
|
|
226
|
+
@media (max-width: ${z.MOBILE_SIZE_PX+"px"}) {
|
|
224
227
|
padding: 0;
|
|
225
228
|
font-size: 0.875rem;
|
|
226
229
|
}
|
|
@@ -246,7 +249,7 @@
|
|
|
246
249
|
& i {
|
|
247
250
|
font-size: 0.813rem;
|
|
248
251
|
}
|
|
249
|
-
`,Ee=
|
|
252
|
+
`,Ee=c.forwardRef(({src:n,...t},o)=>{const a=c.useRef();return c.useEffect(()=>{var m;const p=l=>{l.target.src=le.DefaultShopImage,l.onerror=null};return(m=a==null?void 0:a.current)==null||m.addEventListener("error",p),()=>{var l;(l=a==null?void 0:a.current)==null||l.removeEventListener("error",p)}},[]),r.jsx(c.Fragment,{ref:o,children:y.isDefinedNotEmptyString(n)?r.jsx("img",{ref:a,src:n,...t}):r.jsx("img",{src:le.DefaultShopImage,...t})})}),fe=n=>{const{uuid:t,hasPermission:o=!0,isUser:a,image:p,imageComponent:m,name:l,notifications:_=0,color:d="primary",size:u="large",style:h,disabled:I,onClick:f=()=>{},isActive:v,className:C,shopCategory:N,themeData:j}=n,x={theme:me.useTheme(),color:d,size:u,style:h,disabled:I};return c.createElement(Ne,{onClick:w=>{w==null||w.preventDefault(),w.stopPropagation(),o===!0&&(f==null||f())},...x,key:l,className:`profile-item ${C}`,hasPermission:o,isActive:v,themeColor:(j==null?void 0:j.code)||"transparent",href:`/${a?"user":"shop"}/${t}`},r.jsx("div",{className:"logo-wrapper",children:y.isDefined(m)?m:p}),r.jsxs("div",{children:[r.jsx("div",{className:"name",children:l}),!a&&r.jsx("div",{className:"description",children:N}),_>0&&r.jsx("div",{className:"notifications-number",children:r.jsx(ke,{className:"badge",color:"danger",size:"small",children:_>99?"99+":_})})]}))};fe.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 pe=n=>{if(n!==void 0){const t=new Date(n),o=t.getFullYear(),a=t.getMonth()+1;return`${String(t.getDate()).padStart(2)}. ${a}. ${o}.`}},ze=c.forwardRef((n,t)=>{var ie;const o=me.useTheme(),{uuid:a,shopUuid:p,title:m="",coverPhoto:l,onSelect:_,startDate:d,endDate:u,salesPackages:h,shopName:I,shopCategory:f,shopImage:v,shopImageComponent:C,className:N,onSelectCard:j=()=>{},onSelectShop:g=()=>{},upcoming:x=!1,upcomingCampaignText:w,campaignSingleText:Z,salesCampaignTypes:k=[],startsInPrefixTextPlural:F,startsinSuffixTextPlural:X,startsInPrefixTextSingular:G,startsinSuffixTextSingular:re,endsInPrefixTextPlural:A,endsinSuffixTextPlural:H,endsInPrefixTextSingular:U,endsinSuffixTextSingular:Y,endedText:ne,themeData:q,numberOfListings:R,numberOfListingsTextSingular:O,numberOfListingsTextPlural:e,metadata:T,...te}=n,B=c.useRef(),M=y.getDayNumberPrecise(d,u),J=M!==-1&&(M==null?void 0:M.isEnded)===!0,K=M!==-1&&!J,Q=y.calcDaysUntil(d),L=y.calcDaysRemaining(u),we=L!==null&&L<=2&&L>0,se=y.normalizeDate(u),oe=se?new Date(se):null,be=new Date,ee=oe?oe.getTime()-be.getTime():null,W=ee!==null&&ee>0&&ee<24*60*60*1e3,ae=(b,E,$,P,D)=>$===1?`${b} ${$} ${P}`:`${E} ${$} ${D}`,ve=()=>{if(!u)return null;const b=y.normalizeDate(u),E=b?new Date(b):null;if(!E)return null;const $=Se,P=E.getTime()-$.getTime();if(P<=0)return null;const D=Math.floor(P/(1e3*60*60)),Pe=Math.floor(P%(1e3*60*60)/(1e3*60)),_e=Math.floor(P%(1e3*60)/1e3);return{hours:D,minutes:Pe,seconds:_e}},[Se,je]=c.useState(new Date);c.useEffect(()=>{if(!W)return;const b=setInterval(()=>{je(new Date)},1e3);return()=>clearInterval(b)},[W]);const V=W?ve():null;return r.jsxs($e,{ref:B,theme:o,className:N,name:T==null?void 0:T.name,"data-accessor":T==null?void 0:T.accessor,onClick:b=>j(b,B),href:`/shop/${p}/campaign/${a}`,...te,children:[r.jsxs(Ie,{theme:o,children:[r.jsx("img",{src:l}),r.jsx(De,{children:h==null?void 0:h.map((b,E)=>{var $,P;return r.jsx(Le,{color:($=k==null?void 0:k.find(D=>D.value===b))==null?void 0:$.color,theme:o,children:r.jsx(he,{icon:(P=k==null?void 0:k.find(D=>D.value===b))==null?void 0:P.icon})},`package__${E}`)})})]}),r.jsxs(Ce,{theme:o,children:[r.jsx("div",{className:"text-block-wrapper",children:r.jsxs("div",{className:"title-block-wrapper",children:[r.jsx("div",{className:"campaign-title",children:(ie=x?w:Z)==null?void 0:ie.toUpperCase()}),r.jsx("div",{className:"campaign-title-text",children:m}),u&&d&&r.jsxs("div",{className:"campaign-date",children:[pe(d)," - ",pe(u)]}),r.jsxs("div",{className:"timestamp-text",children:[R>0&&r.jsxs("span",{className:"listings-text",children:[R," ",R===1?O:e," ","∙"," "]}),r.jsx("span",{className:`duration-text ${we?"urgent":""} ${K?"":"starts-in"}`,children:W&&V?r.jsxs("div",{className:"countdown-timer",children:[U," ",V.hours.toString().padStart(2,"0"),":",V.minutes.toString().padStart(2,"0"),":",V.seconds.toString().padStart(2,"0")]}):K&&!J&&L!==null&&L>0?ae(U,A,L,Y,H):J?ne||"Završena":!K&&Q!==null&&Q>0?ae(G,F,Q,re,X):null})]})]})}),r.jsx(fe,{hasPermission:!0,image:r.jsx(Ee,{src:v}),imageComponent:C,themeData:q,isActive:!0,isUser:!1,name:I,shopCategory:f,uuid:p,onClick:()=>g(p)})]})]})}),Re=S.styled.div`
|
|
250
253
|
margin: 0 auto;
|
|
251
254
|
display: flex;
|
|
252
255
|
flex-direction: column;
|
|
@@ -285,7 +288,7 @@
|
|
|
285
288
|
right: 0;
|
|
286
289
|
}
|
|
287
290
|
|
|
288
|
-
@media (max-width: ${
|
|
291
|
+
@media (max-width: ${z.MOBILE_SIZE_PX+"px"}) {
|
|
289
292
|
gap: 1.25rem;
|
|
290
293
|
|
|
291
294
|
& .scrollable-section__header {
|
|
@@ -297,13 +300,13 @@
|
|
|
297
300
|
}
|
|
298
301
|
}
|
|
299
302
|
}
|
|
300
|
-
`,
|
|
303
|
+
`,Me=S.styled(ge.motion.div)`
|
|
301
304
|
display: grid;
|
|
302
305
|
grid-template-columns: repeat(${n=>n==null?void 0:n.numOfColumns}, 1fr);
|
|
303
306
|
gap: 1.5rem;
|
|
304
307
|
width: 100%;
|
|
305
308
|
|
|
306
|
-
@media (max-width: ${
|
|
309
|
+
@media (max-width: ${z.MOBILE_SIZE_PX+"px"}) {
|
|
307
310
|
display: flex;
|
|
308
311
|
flex-wrap: nowrap;
|
|
309
312
|
overflow-x: scroll;
|
|
@@ -325,7 +328,7 @@
|
|
|
325
328
|
/* Safari and Chrome */
|
|
326
329
|
}
|
|
327
330
|
}
|
|
328
|
-
`,xe=
|
|
331
|
+
`,xe=c.forwardRef(({icon:n,title:t,numOfSlides:o=2,showNavigation:a=!0,hasNextPage:p=!1,handleFetchNextPage:m=()=>{},children:l},_)=>{const[d,u]=c.useState(0),[h,I]=c.useState(1),f=ue.useDetectMobile(),v=(l==null?void 0:l.length)??1;c.useEffect(()=>{const g=()=>{I(o)};return window.addEventListener("resize",g),g(),()=>window.removeEventListener("resize",g)},[]);const C=f?l:l==null?void 0:l.slice(d,d+h),N=g=>{var w;(w=g==null?void 0:g.target)==null||w.blur();const x=d+h;x<v&&u(x),x+h>=v&&p&&m()},j=g=>{var x;(x=g==null?void 0:g.target)==null||x.blur(),d-h>=0&&u(d-h)};return r.jsxs(Re,{ref:_,children:[r.jsx("div",{className:"scrollable-section__header",children:r.jsxs("div",{className:"scrollable-section__title",children:[y.isDefinedNotEmptyString(n)&&r.jsx(he,{icon:n,color:"primary",sizeInUnits:"1.5rem",className:"title__icon"}),y.isDefinedNotEmptyString(t)&&r.jsxs("div",{className:"title__text",children:[" ",t]})]})}),r.jsxs(Me,{numOfColumns:o,...!f&&{animate:{x:0,opacity:1},initial:{x:10,opacity:0}},children:[C,f&&p&&r.jsx(Te.InfiniteScrollEndElement,{onIsVisible:m})]},`scrollable-section__content-${d}`),a&&v>h&&!f&&r.jsxs("div",{className:"scrollable-section__navigation",children:[r.jsx(ce,{icon:"angle-left",borderRadius:"curved",btnType:"tinted",color:"neutral",className:"navigation__arrow",disabled:d===0,onClick:j}),r.jsx(ce,{icon:"angle-right",borderRadius:"curved",btnType:"tinted",color:"neutral",className:"navigation__arrow",disabled:d+h>=v,onClick:N})]})]})});xe.propTypes={icon:s.PropTypes.string,title:s.PropTypes.string,numOfSlides:s.PropTypes.number,numOfSlidesForMobile:s.PropTypes.number,handleFetchNextPage:s.PropTypes.func,showNavigation:s.PropTypes.bool};const Ue=S.styled.div`
|
|
329
332
|
display: flex;
|
|
330
333
|
flex: 1;
|
|
331
334
|
width: 100%;
|
|
@@ -342,8 +345,8 @@
|
|
|
342
345
|
border-radius: 1.25rem;
|
|
343
346
|
object-fit: cover;
|
|
344
347
|
}
|
|
345
|
-
`,ye=
|
|
346
|
-
@media (max-width: ${
|
|
348
|
+
`,ye=c.forwardRef(({sectionName:n,imageUrl:t,maxHeight:o="16.25rem",className:a="",handleClick:p=()=>{}},m)=>r.jsx(Ue,{ref:m,maxHeight:o,onClick:p,className:`itemless-banner ${a}`,children:r.jsx("img",{src:t,alt:`itemless-banner__${n}`})}));ye.propTypes={sectionName:s.PropTypes.string,imageUrl:s.PropTypes.string,maxHeight:s.PropTypes.string,className:s.PropTypes.string,handleClick:s.PropTypes.func};const qe=S.styled(i.SkeletonRowWrapper)`
|
|
349
|
+
@media (max-width: ${z.MOBILE_SIZE_PX+"px"}) {
|
|
347
350
|
flex-direction: column;
|
|
348
351
|
|
|
349
352
|
& .skeleton__image {
|
|
@@ -357,4 +360,4 @@
|
|
|
357
360
|
}
|
|
358
361
|
}
|
|
359
362
|
}
|
|
360
|
-
`,
|
|
363
|
+
`,Oe=({keyPrefix:n})=>r.jsxs(qe,{children:[r.jsxs(i.SkeletonRowWrapper,{children:[r.jsx(i.SkeletonSquarePlaceholder,{width:"13.75rem",height:"13.75rem",className:"skeleton__image"},`${n}-1`),r.jsxs(i.SkeletonColumnWrapper,{noGradient:!0,children:[r.jsx(i.SkeletonLinePlaceholder,{height:"1rem"}),r.jsx(i.SkeletonLinePlaceholder,{height:"1.75rem"}),r.jsx(i.SkeletonLinePlaceholder,{height:"1.25rem"}),r.jsx(i.SkeletonLinePlaceholder,{height:"2rem"}),r.jsxs(i.SkeletonRowWrapper,{alignItems:"center",noGradient:!0,children:[r.jsx(i.SkeletonCirclePlaceholder,{width:"2.5rem",height:"2.5rem"}),r.jsx(i.SkeletonLinePlaceholder,{width:"5rem",height:"1.25rem"})]})]})]}),r.jsxs(i.SkeletonRowWrapper,{noGradient:!0,children:[r.jsx(i.SkeletonSquarePlaceholder,{width:"13.75rem",height:"13.75rem",className:"skeleton__image"},`${n}-2`),r.jsxs(i.SkeletonColumnWrapper,{noGradient:!0,children:[r.jsx(i.SkeletonLinePlaceholder,{height:"1rem"}),r.jsx(i.SkeletonLinePlaceholder,{height:"1.75rem"}),r.jsx(i.SkeletonLinePlaceholder,{height:"1.25rem"}),r.jsx(i.SkeletonLinePlaceholder,{height:"2rem"}),r.jsxs(i.SkeletonRowWrapper,{alignItems:"center",noGradient:!0,children:[r.jsx(i.SkeletonCirclePlaceholder,{width:"2.5rem",height:"2.5rem"}),r.jsx(i.SkeletonLinePlaceholder,{width:"5rem",height:"1.25rem"})]})]})]})]}),Be=({keyPrefix:n,isLoading:t=!1,fallbackComponent:o=r.jsx(r.Fragment,{}),children:a})=>r.jsx(c.Suspense,{fallbackComponent:o,children:t===!0?r.jsx(Oe,{keyPrefix:n}):a}),We=c.memo(ze),Ve=c.forwardRef(({sellerType:n="Shop",items:t=[],title:o,icon:a,isLoading:p,onSelectCard:m=()=>{},onSelectShop:l=()=>{},getImage:_=()=>{},campaignSingleText:d,upcomingCampaignText:u,salesCampaignTypes:h=[],startsInPrefixTextPlural:I,startsinSuffixTextPlural:f,startsInPrefixTextSingular:v,startsinSuffixTextSingular:C,endsInPrefixTextPlural:N,endsinSuffixTextPlural:j,endsInPrefixTextSingular:g,endsinSuffixTextSingular:x,endedText:w,numOfSlides:Z=2,showNavigation:k=!0,numberOfListingsTextSingular:F,numberOfListingsTextPlural:X,itemlessImageUrl:G,itemlessLink:re,handleItemlessLink:A=()=>{},componentName:H,hasNextPage:U=!1,handleFetchNextPage:Y=()=>{}},ne)=>{const q=ue.useDetectMobile(),R=c.useMemo(()=>{let O=t==null?void 0:t.map((e,T)=>r.jsx(We,{className:"campaign-item",coverPhoto:_(e==null?void 0:e.coverPhoto,(e==null?void 0:e.uuid)||(e==null?void 0:e.campaignUuid)),description:e==null?void 0:e.description,endDate:e==null?void 0:e.endDate,salesPackages:e==null?void 0:e.salesPackages,sellerType:n,shopImage:e==null?void 0:e.profileImage,shopImageComponent:e==null?void 0:e.profileImageComponent,shopName:e==null?void 0:e.shopName,shopUuid:e==null?void 0:e.shopUuid,shopCategory:e==null?void 0:e.shopCategory,startDate:e==null?void 0:e.startDate,title:e==null?void 0:e.name,uuid:e==null?void 0:e.campaignUuid,onSelectCard:(te,B)=>m(e==null?void 0:e.campaignUuid,e==null?void 0:e.shopUuid,B),onSelectShop:()=>l(e==null?void 0:e.shopUuid),campaignSingleText:d,upcomingCampaignText:u,upcoming:e==null?void 0:e.upcoming,salesCampaignTypes:h,startsInPrefixTextPlural:I,startsinSuffixTextPlural:f,startsInPrefixTextSingular:v,startsinSuffixTextSingular:C,endsInPrefixTextPlural:N,endsinSuffixTextPlural:j,endsInPrefixTextSingular:g,endsinSuffixTextSingular:x,endedText:w,themeData:e==null?void 0:e.themeData,numberOfListings:e==null?void 0:e.numberOfListings,numberOfListingsTextSingular:F,numberOfListingsTextPlural:X,metadata:{name:H,accessor:e==null?void 0:e.accessor}},`campaign__item__${T}__${e==null?void 0:e.startDate}___${e==null?void 0:e.endDate}`));return(t==null?void 0:t.length)<2&&!q?[...O,r.jsx(ye,{imageUrl:G,className:"campaign-item",handleClick:A},"itemless-campaign-section-banner")]:O},[t]);return r.jsx(Be,{isLoading:p,keyPrefix:"sales-campaign-skeleton",children:r.jsx(xe,{icon:a,title:o,numOfSlides:Z,showNavigation:k,hasNextPage:U,handleFetchNextPage:Y,children:R},`sales-campaign-section__${q}`)})});module.exports=Ve;
|