@lanaco/lnc-react-ui 4.0.110 → 4.0.112
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/BannerSectionCarousel.cjs +5 -5
- package/dist/BannerSectionCarousel.js +150 -155
- package/dist/DetailedProductsSection.cjs +1 -1
- package/dist/DetailedProductsSection.js +11 -11
- package/dist/SalesCampaignsSection.cjs +47 -42
- package/dist/SalesCampaignsSection.js +353 -290
- package/package.json +1 -1
|
@@ -26,4 +26,4 @@
|
|
|
26
26
|
/* Safari and Chrome */
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
`,S=s.memo(h.DetailedProductCard),R=s.forwardRef((r,f)=>{const{icon:a,title:
|
|
29
|
+
`,S=s.memo(h.DetailedProductCard),R=s.forwardRef((r,f)=>{const{icon:a,title:j,buttonLink:c,items:t,buttonText:w,limit:o=4,gap:C,onSelectCard:u=()=>{},onButtonAction:P=()=>{},isLoading:N=!1,getImage:d=()=>{},negotiableText:m,freeText:g,options:l,onSelectOption:p=()=>{},productsToolbarName:q="All"}=r,b=M.useDetectMobile(),k=s.useMemo(()=>i.jsx(i.Fragment,{children:b===!0?t==null?void 0:t.map((e,n)=>i.jsx(S,{title:e==null?void 0:e.name,price:e==null?void 0:e.price,sellingPrice:e==null?void 0:e.sellingPrice,currency:e==null?void 0:e.currency,image:e==null?void 0:e.image,sellerUuid:e==null?void 0:e.sellerUuid,uuid:e==null?void 0:e.uuid,isSponsored:e==null?void 0:e.isSponsored,imageComponent:e==null?void 0:e.imageComponent,onSelectCard:()=>u(e==null?void 0:e.uuid),imageUrl:d(e==null?void 0:e.image,e==null?void 0:e.uuid,e==null?void 0:e.sellerUuid)||null,isFree:e==null?void 0:e.isFree,isNegotiable:e==null?void 0:e.isNegotiable,negotiableText:m,freeText:g},n)):t==null?void 0:t.slice(0,o).map((e,n)=>i.jsx(S,{title:e==null?void 0:e.name,price:e==null?void 0:e.price,sellingPrice:e==null?void 0:e.sellingPrice,currency:e==null?void 0:e.currency,image:e==null?void 0:e.image,sellerUuid:e==null?void 0:e.sellerUuid,uuid:e==null?void 0:e.uuid,location:e==null?void 0:e.location,isSponsored:e==null?void 0:e.isSponsored,imageComponent:e==null?void 0:e.imageComponent,onSelectCard:()=>u(e==null?void 0:e.uuid),imageUrl:d(e==null?void 0:e.image,e==null?void 0:e.uuid,e==null?void 0:e.sellerUuid)||null,isFree:e==null?void 0:e.isFree,isNegotiable:e==null?void 0:e.isNegotiable,negotiableText:m,freeText:g},n))}),[t,b,o]);return i.jsxs(F.TitleWithOptionsSectionWrapper,{ref:f,children:[i.jsxs("div",{className:"regular-title",children:[i.jsxs("div",{className:"regular-title-text",children:[y.isDefinedNotEmptyString(a)&&i.jsx("i",{className:a}),i.jsx("span",{children:j})]}),y.isDefinedNotEmptyString(c)&&i.jsx(U,{type:"button",btnType:"tinted",color:"gray",onClick:e=>{var n;(n=e==null?void 0:e.target)==null||n.blur(),P(c)},borderRadius:"curved",className:"button-link",children:w})]}),(l==null?void 0:l.length)>0&&i.jsx(T.SelectBar,{items:l,onRemove:e=>{p(e)},onSelect:e=>{p(e)},labelKey:"name",valueKey:"code",noMargin:!0,productsToolbarName:q}),i.jsx(E,{limit:o,gap:C,children:i.jsx(h.SuspenseDetailedProductCard,{isLoading:N,limit:o,keyPrefix:"explore-landing",children:k})})]})});module.exports=R;
|
|
@@ -42,15 +42,15 @@ const W = F.div`
|
|
|
42
42
|
title: h,
|
|
43
43
|
buttonLink: d,
|
|
44
44
|
items: o,
|
|
45
|
-
buttonText:
|
|
45
|
+
buttonText: w,
|
|
46
46
|
limit: l = 4,
|
|
47
|
-
gap:
|
|
48
|
-
onSelectCard:
|
|
47
|
+
gap: C,
|
|
48
|
+
onSelectCard: c = () => {
|
|
49
49
|
},
|
|
50
50
|
onButtonAction: P = () => {
|
|
51
51
|
},
|
|
52
52
|
isLoading: k = !1,
|
|
53
|
-
getImage:
|
|
53
|
+
getImage: m = () => {
|
|
54
54
|
},
|
|
55
55
|
negotiableText: u,
|
|
56
56
|
freeText: p,
|
|
@@ -70,8 +70,8 @@ const W = F.div`
|
|
|
70
70
|
uuid: e == null ? void 0 : e.uuid,
|
|
71
71
|
isSponsored: e == null ? void 0 : e.isSponsored,
|
|
72
72
|
imageComponent: e == null ? void 0 : e.imageComponent,
|
|
73
|
-
onSelectCard: () =>
|
|
74
|
-
imageUrl:
|
|
73
|
+
onSelectCard: () => c(e == null ? void 0 : e.uuid),
|
|
74
|
+
imageUrl: m(e == null ? void 0 : e.image, e == null ? void 0 : e.uuid, e == null ? void 0 : e.sellerUuid) || null,
|
|
75
75
|
isFree: e == null ? void 0 : e.isFree,
|
|
76
76
|
isNegotiable: e == null ? void 0 : e.isNegotiable,
|
|
77
77
|
negotiableText: u,
|
|
@@ -91,8 +91,8 @@ const W = F.div`
|
|
|
91
91
|
location: e == null ? void 0 : e.location,
|
|
92
92
|
isSponsored: e == null ? void 0 : e.isSponsored,
|
|
93
93
|
imageComponent: e == null ? void 0 : e.imageComponent,
|
|
94
|
-
onSelectCard: () =>
|
|
95
|
-
imageUrl:
|
|
94
|
+
onSelectCard: () => c(e == null ? void 0 : e.uuid),
|
|
95
|
+
imageUrl: m(e == null ? void 0 : e.image, e == null ? void 0 : e.uuid, e == null ? void 0 : e.sellerUuid) || null,
|
|
96
96
|
isFree: e == null ? void 0 : e.isFree,
|
|
97
97
|
isNegotiable: e == null ? void 0 : e.isNegotiable,
|
|
98
98
|
negotiableText: u,
|
|
@@ -118,7 +118,7 @@ const W = F.div`
|
|
|
118
118
|
},
|
|
119
119
|
borderRadius: "curved",
|
|
120
120
|
className: "button-link",
|
|
121
|
-
children:
|
|
121
|
+
children: w
|
|
122
122
|
}
|
|
123
123
|
)
|
|
124
124
|
] }),
|
|
@@ -138,11 +138,11 @@ const W = F.div`
|
|
|
138
138
|
productsToolbarName: N
|
|
139
139
|
}
|
|
140
140
|
),
|
|
141
|
-
/* @__PURE__ */ i(W, { limit: l, gap:
|
|
141
|
+
/* @__PURE__ */ i(W, { limit: l, gap: C, children: /* @__PURE__ */ i(
|
|
142
142
|
O,
|
|
143
143
|
{
|
|
144
144
|
isLoading: k,
|
|
145
|
-
|
|
145
|
+
limit: l,
|
|
146
146
|
keyPrefix: "explore-landing",
|
|
147
147
|
children: v
|
|
148
148
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const t=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),h=require("react"),p=require("./emotion-styled.browser.esm-BtEseadx.cjs"),v=require("./utils-CZynEOC_.cjs"),I=require("./consts-goSZX3xP.cjs"),H=require("./motion-B_VPZaJq.cjs"),a=require("./index-BPVoEhTF.cjs"),J=require("./Icon.cjs"),pe=require("./Badge.cjs"),q=require("./emotion-element-f0de968e.browser.esm-B7k6i6lC.cjs"),X=require("./IconButton.cjs"),K=require("./useDetectMobile-zkbzoOGV.cjs"),ue=p.styled.div`
|
|
2
2
|
cursor: pointer;
|
|
3
3
|
display: flex;
|
|
4
4
|
gap: 1rem;
|
|
@@ -6,15 +6,15 @@
|
|
|
6
6
|
border-radius: 20px;
|
|
7
7
|
border: 1px solid var(--gray-95008, #14161a14);
|
|
8
8
|
|
|
9
|
-
@media (max-width: ${
|
|
9
|
+
@media (max-width: ${I.MOBILE_SIZE_PX+"px"}) {
|
|
10
10
|
flex-direction: column;
|
|
11
11
|
padding: 0;
|
|
12
12
|
gap: 0;
|
|
13
13
|
border: none;
|
|
14
14
|
border-radius: 0;
|
|
15
15
|
}
|
|
16
|
-
`,
|
|
17
|
-
border-radius: ${e=>
|
|
16
|
+
`,he=p.styled.div`
|
|
17
|
+
border-radius: ${e=>v.getBorderRadiusValueWithUnits(e.theme,"edged")};
|
|
18
18
|
height: 15rem;
|
|
19
19
|
width: 15rem;
|
|
20
20
|
min-width: 15rem;
|
|
@@ -37,12 +37,12 @@
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
@media (max-width: ${
|
|
40
|
+
@media (max-width: ${I.MOBILE_SIZE_PX+"px"}) {
|
|
41
41
|
width: 100%;
|
|
42
42
|
max-width: 100dvh;
|
|
43
43
|
height: 23.438rem;
|
|
44
44
|
}
|
|
45
|
-
`,
|
|
45
|
+
`,me=p.styled.div`
|
|
46
46
|
flex: 1;
|
|
47
47
|
display: flex;
|
|
48
48
|
flex-direction: column;
|
|
@@ -63,7 +63,6 @@
|
|
|
63
63
|
font-weight: 600;
|
|
64
64
|
font-size: 1.375rem;
|
|
65
65
|
transition: var(--transition, all 0.3s ease);
|
|
66
|
-
|
|
67
66
|
}
|
|
68
67
|
|
|
69
68
|
& .text-block-wrapper {
|
|
@@ -78,9 +77,9 @@
|
|
|
78
77
|
}
|
|
79
78
|
|
|
80
79
|
& .timestamp-text {
|
|
81
|
-
font-size: 0.
|
|
82
|
-
font-weight:
|
|
83
|
-
padding-top: 0.
|
|
80
|
+
font-size: 0.975rem;
|
|
81
|
+
font-weight: 500;
|
|
82
|
+
padding-top: 0.75rem;
|
|
84
83
|
color: var(--gray-700, #4e555f);
|
|
85
84
|
}
|
|
86
85
|
|
|
@@ -88,7 +87,7 @@
|
|
|
88
87
|
background-color: transparent;
|
|
89
88
|
}
|
|
90
89
|
|
|
91
|
-
@media (max-width: ${
|
|
90
|
+
@media (max-width: ${I.MOBILE_SIZE_PX+"px"}) {
|
|
92
91
|
padding: 1.25rem;
|
|
93
92
|
|
|
94
93
|
& .campaign-title {
|
|
@@ -102,13 +101,13 @@
|
|
|
102
101
|
gap: 0.25rem;
|
|
103
102
|
}
|
|
104
103
|
}
|
|
105
|
-
`,
|
|
104
|
+
`,fe={"#ADE3EB":"#76D0DB","#DDD6FE":"#C4B5FD","#FDE68A":"#FCD34D","#A7F3D0":"#6EE7B7","#BADFFF":"#87C6FA","#FECDD3":"#FDA4AF","#EFE2CF":"#EAD2AF","#DDDFE4":"#C4C8CF","#E7E5E4":"#D6D3D1","#FED7AA":"#FDBA74",default:"#C4C8CF"},Z=(e=!1,n=!1,o=!1)=>`
|
|
106
105
|
display: flex;
|
|
107
|
-
${
|
|
108
|
-
${
|
|
106
|
+
${n?"flex-wrap: wrap;":""}
|
|
107
|
+
${n?"":"flex-wrap: nowrap;"}
|
|
109
108
|
${e?"align-items: center;":""}
|
|
110
109
|
${o?"justify-content: center;":""}
|
|
111
|
-
`,
|
|
110
|
+
`,xe=p.styled(H.motion.div)`
|
|
112
111
|
text-decoration: none;
|
|
113
112
|
${e=>e.hasPermission===!0&&"cursor: pointer"};
|
|
114
113
|
|
|
@@ -125,29 +124,34 @@
|
|
|
125
124
|
text-decoration: none;
|
|
126
125
|
}
|
|
127
126
|
|
|
128
|
-
${
|
|
127
|
+
${Z(!0)}
|
|
129
128
|
gap: 0.5rem;
|
|
130
129
|
padding: 0.5rem;
|
|
131
130
|
color: ${e=>e.isActive===!1?"var(--gray-900)":"var(--primary-600)"};
|
|
132
131
|
font-weight: 500;
|
|
133
132
|
font-size: 0.875rem;
|
|
134
133
|
line-height: 1.25rem;
|
|
135
|
-
border-radius: ${e=>
|
|
134
|
+
border-radius: ${e=>v.getBorderRadiusValueWithUnits(e.theme,"slight")};
|
|
136
135
|
transition: all 0.25s ease;
|
|
137
|
-
|
|
136
|
+
& .description {
|
|
137
|
+
font-size: 0.85rem;
|
|
138
|
+
color: var(--gray-600, #676e79);
|
|
139
|
+
line-height: 1rem;
|
|
140
|
+
font-weight: 400;
|
|
141
|
+
}
|
|
138
142
|
& .logo-wrapper {
|
|
139
|
-
${
|
|
143
|
+
${Z(!0,!1,!0)}
|
|
140
144
|
flex-shrink: 0;
|
|
141
145
|
border-radius: 999px;
|
|
142
146
|
border: 3px solid
|
|
143
|
-
${e=>e.isActive===!1?"var(--gray-300, #c4c8cf)":
|
|
147
|
+
${e=>e.isActive===!1?"var(--gray-300, #c4c8cf)":fe[e.themeColor]??"var(--gray-300, #c4c8cf)"};
|
|
144
148
|
|
|
145
149
|
& img,
|
|
146
150
|
.img-placeholder {
|
|
147
151
|
border-radius: 999px;
|
|
148
152
|
object-fit: cover;
|
|
149
|
-
height:
|
|
150
|
-
width:
|
|
153
|
+
height: 2.25rem;
|
|
154
|
+
width: 2.25rem;
|
|
151
155
|
background-color: var(--gray-200, #dddfe4);
|
|
152
156
|
}
|
|
153
157
|
|
|
@@ -164,6 +168,7 @@
|
|
|
164
168
|
|
|
165
169
|
& .name {
|
|
166
170
|
flex-grow: 15;
|
|
171
|
+
font-size: 1.055rem;
|
|
167
172
|
}
|
|
168
173
|
|
|
169
174
|
& .notifications-number .badge {
|
|
@@ -182,15 +187,15 @@
|
|
|
182
187
|
background-color: var(--gray-95080, #14161acc);
|
|
183
188
|
color: var(--gray-600, #676e79);
|
|
184
189
|
}
|
|
185
|
-
`,
|
|
190
|
+
`,ye=p.styled.div`
|
|
186
191
|
position: absolute;
|
|
187
192
|
top: 0.5rem;
|
|
188
193
|
${e=>e.alignToLeft===!0?"left: 0.5rem;":"right: 0.5rem;"}
|
|
189
194
|
display: flex;
|
|
190
195
|
gap: 0.25rem;
|
|
191
|
-
`,
|
|
192
|
-
border-radius: ${e=>
|
|
193
|
-
background-color: ${e=>
|
|
196
|
+
`,we=p.styled.div`
|
|
197
|
+
border-radius: ${e=>v.getBorderRadiusValueWithUnits(e.theme,e.borderRadius||"slight")};
|
|
198
|
+
background-color: ${e=>e==null?void 0:e.color};
|
|
194
199
|
color: white;
|
|
195
200
|
height: 1.5rem;
|
|
196
201
|
min-width: 1.5rem;
|
|
@@ -204,7 +209,7 @@
|
|
|
204
209
|
& i {
|
|
205
210
|
font-size: 0.813rem;
|
|
206
211
|
}
|
|
207
|
-
`,
|
|
212
|
+
`,Q=e=>{const{uuid:n,hasPermission:o=!0,isUser:l,image:f,name:u,notifications:_=0,color:g="primary",size:$="large",style:c,disabled:P,onClick:i=()=>{},isActive:m,className:y,shopCategory:j,themeData:x}=e,b={theme:q.useTheme(),color:g,size:$,style:c,disabled:P};return h.createElement(xe,{onClick:T=>{T.stopPropagation(),o===!0&&(i==null||i())},...b,key:u,className:`profile-item ${y}`,hasPermission:o,isActive:m,themeColor:(x==null?void 0:x.code)||"transparent"},t.jsx("div",{className:"logo-wrapper",children:f}),t.jsxs("div",{children:[t.jsx("div",{className:"name",children:u}),!l&&t.jsx("div",{className:"description",children:j}),_>0&&t.jsx("div",{className:"notifications-number",children:t.jsx(pe,{className:"badge",color:"danger",size:"small",children:_>99?"99+":_})})]}))};Q.propTypes={id:a.PropTypes.any,isUserProfile:a.PropTypes.bool,themeColor:a.PropTypes.string,image:a.PropTypes.any,name:a.PropTypes.string,notifications:a.PropTypes.number,style:a.PropTypes.object,className:a.PropTypes.string,color:a.PropTypes.oneOf(["primary","secondary","success","warning","danger","information","neutral"]),size:a.PropTypes.oneOf(["large"]),onSelect:a.PropTypes.func,hasPermission:a.PropTypes.bool};const L=(e,n)=>{if(!e||!n)return null;let o=Math.floor((e==null?void 0:e.getTime())-(n==null?void 0:n.getTime())),l=1e3*60*60*24;return Math.ceil(o/l)},G=e=>{if(e!==void 0){const n=new Date(e),o=n.getFullYear(),l=n.getMonth()+1;return`${String(n.getDate()).padStart(2)}. ${l}. ${o}.`}},ee=h.forwardRef((e,n)=>{var V;const o=q.useTheme(),{uuid:l,shopUuid:f,title:u="",description:_,badges:g,coverPhoto:$,onSelect:c,status:P,startDate:i,endDate:m,salesPackages:y,shopName:j,shopCategory:x,shopImage:D,className:b,onSelectCard:T=()=>{},onSelectShop:C=()=>{},upcoming:S=!1,upcomingCampaignText:k,campaignSingleText:N,salesCampaignTypes:w=[],startsInPrefixTextPlural:s,startsinSuffixTextPlural:d,startsInPrefixTextSingular:R,startsinSuffixTextSingular:r,endsInPrefixTextPlural:A,endsinSuffixTextPlural:te,endsInPrefixTextSingular:ne,endsinSuffixTextSingular:se,themeData:ae,numberOfListings:M,numberOfListingsTextSingular:oe,numberOfListingsTextPlural:ie,...le}=e,ce=i?new Date(i)<=new Date:!1;L(m?new Date(m):null,i?new Date(i):null);const de=L(i?new Date(i):null,new Date),ge=L(m?new Date(m):null,new Date),W=(B,U,E,z,F)=>E===1?`${B} ${E} ${z}`:`${U} ${E} ${F}`;return t.jsxs(ue,{ref:n,theme:o,className:b,onClick:T,...le,children:[t.jsxs(he,{theme:o,onClick:()=>c==null?void 0:c(),children:[t.jsx("img",{src:$}),t.jsx(ye,{children:y==null?void 0:y.map((B,U)=>{var E,z;return t.jsx(we,{color:(E=w==null?void 0:w.find(F=>F.value===B))==null?void 0:E.color,theme:o,children:t.jsx(J,{icon:(z=w==null?void 0:w.find(F=>F.value===B))==null?void 0:z.icon})},`package__${U}`)})})]}),t.jsxs(me,{theme:o,children:[t.jsx("div",{className:"text-block-wrapper",children:t.jsxs("div",{className:"title-block-wrapper",children:[t.jsx("div",{className:"campaign-title",children:(V=S?k:N)==null?void 0:V.toUpperCase()}),t.jsx("div",{className:"campaign-title-text",children:u}),m&&i&&t.jsxs("div",{children:[G(i)," - ",G(m)]}),t.jsxs("div",{className:"timestamp-text",children:[M>0&&`${M} ${M===1?oe:ie} ∙ `,ce?W(ne,A,ge,se,te):W(R,s,de,r,d)]})]})}),t.jsx(Q,{hasPermission:!0,image:t.jsx("img",{src:D,className:`${D?"":"no-image"}`}),themeData:ae,isActive:!0,isUser:!1,name:j,shopCategory:x,onClick:()=>C(f)})]})]})});ee.propTypes={title:a.PropTypes.oneOfType([a.PropTypes.string,a.PropTypes.element]),numberOfListings:a.PropTypes.number,dropdown:a.PropTypes.any,color:a.PropTypes.string};p.styled.div`
|
|
208
213
|
display: flex;
|
|
209
214
|
flex-direction: column;
|
|
210
215
|
gap: 1.5rem;
|
|
@@ -235,26 +240,26 @@
|
|
|
235
240
|
}
|
|
236
241
|
}
|
|
237
242
|
|
|
238
|
-
@media (max-width: ${
|
|
243
|
+
@media (max-width: ${I.MOBILE_SIZE_PX+"px"}) {
|
|
239
244
|
& .campaign-item {
|
|
240
245
|
min-width: 100%;
|
|
241
246
|
width: 100%;
|
|
242
247
|
margin-right: 0;
|
|
243
248
|
}
|
|
244
249
|
}
|
|
245
|
-
`;const
|
|
250
|
+
`;const O=p.styled.div`
|
|
246
251
|
width: ${e=>e.width||"100%"};
|
|
247
252
|
height: ${e=>(e.heightCoeff||1)*1.125}rem;
|
|
248
253
|
background-color: var(--gray-200, #dddfe4);
|
|
249
254
|
|
|
250
|
-
${
|
|
251
|
-
`,
|
|
255
|
+
${v.linearGradientAnimation("-90deg")}
|
|
256
|
+
`,be=p.styled.div`
|
|
252
257
|
display: flex;
|
|
253
258
|
flex-direction: ${e=>e!=null&&e.row?"row":"column"};
|
|
254
259
|
gap: ${e=>(e==null?void 0:e.gap)??"0.5rem"};
|
|
255
260
|
width: ${e=>(e==null?void 0:e.width)??"100%"};
|
|
256
|
-
`,
|
|
257
|
-
border-radius: ${e=>
|
|
261
|
+
`,Y=p.styled.div`
|
|
262
|
+
border-radius: ${e=>v.getBorderRadiusValueWithUnits(e.theme,(e==null?void 0:e.borderRadius)??"regular")};
|
|
258
263
|
background: var(--gray-200, #dddfe4);
|
|
259
264
|
position: relative;
|
|
260
265
|
max-height: ${e=>(e==null?void 0:e.height)??"5rem"};
|
|
@@ -263,10 +268,10 @@
|
|
|
263
268
|
width: ${e=>(e==null?void 0:e.width)??"5rem"};
|
|
264
269
|
flex-shrink: 0;
|
|
265
270
|
|
|
266
|
-
${
|
|
267
|
-
`,
|
|
271
|
+
${v.linearGradientAnimation()}
|
|
272
|
+
`,ve=p.styled.div`
|
|
268
273
|
background: var(--white, #fff);
|
|
269
|
-
border-radius: ${e=>
|
|
274
|
+
border-radius: ${e=>v.getBorderRadiusValueWithUnits(e.theme,"edged")};
|
|
270
275
|
box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.1), 0px 1px 2px rgba(0, 0, 0, 0.06);
|
|
271
276
|
border: 1px solid var(--gray-95012, #14161a1f);
|
|
272
277
|
|
|
@@ -293,17 +298,17 @@
|
|
|
293
298
|
gap: 0.5rem;
|
|
294
299
|
}
|
|
295
300
|
|
|
296
|
-
@media (max-width: ${
|
|
301
|
+
@media (max-width: ${I.MOBILE_SIZE_PX+"px"}) {
|
|
297
302
|
flex-direction: column;
|
|
298
303
|
|
|
299
304
|
& .campaign__user {
|
|
300
305
|
margin-top: 1rem;
|
|
301
306
|
}
|
|
302
307
|
}
|
|
303
|
-
`,
|
|
308
|
+
`,_e=p.styled.div`
|
|
304
309
|
display: flex;
|
|
305
310
|
gap: 1.5rem;
|
|
306
|
-
|
|
311
|
+
`,$e=h.forwardRef(({},e)=>{const n=q.useTheme();return t.jsxs(ve,{ref:e,theme:n,children:[t.jsx("div",{className:"campaign__left-section",children:t.jsx(Y,{theme:n,width:"15rem",height:"15rem",borderRadius:"edged"})}),t.jsxs("div",{className:"campaign__right-section",children:[t.jsxs(be,{theme:n,children:[t.jsx(O,{heightCoeff:.75,theme:n,width:"35%"}),t.jsx(O,{heightCoeff:1.25,theme:n}),t.jsx(O,{heightCoeff:3,theme:n})]}),t.jsxs("div",{className:"campaign__user",children:[t.jsx(Y,{theme:n,width:"2.5rem",height:"2.5rem",borderRadius:"curved"}),t.jsx(O,{theme:n,width:"75%"})]})]})]})}),je=({itemsCount:e=5,keyPrefix:n})=>t.jsx(_e,{children:Array.from({length:e},(o,l)=>t.jsx($e,{},`${n}-skeleton-campaign-card-${l}`))}),De=({children:e,fallbackComponent:n=t.jsx(t.Fragment,{}),isLoading:o=!1,itemsCount:l=5,keyPrefix:f})=>t.jsx(h.Suspense,{fallback:n,children:o===!0?t.jsx(je,{itemsCount:l,keyPrefix:f}):e}),Te=p.styled.div`
|
|
307
312
|
margin: 0 auto;
|
|
308
313
|
display: flex;
|
|
309
314
|
flex-direction: column;
|
|
@@ -344,12 +349,12 @@
|
|
|
344
349
|
top: 0;
|
|
345
350
|
right: 0;
|
|
346
351
|
}
|
|
347
|
-
`,
|
|
352
|
+
`,Pe=p.styled(H.motion.div)`
|
|
348
353
|
display: grid;
|
|
349
354
|
grid-template-columns: repeat(${e=>e==null?void 0:e.numOfColumns}, 1fr);
|
|
350
355
|
gap: 1.5rem;
|
|
351
356
|
|
|
352
|
-
@media (max-width: ${
|
|
357
|
+
@media (max-width: ${I.MOBILE_SIZE_PX+"px"}) {
|
|
353
358
|
grid-template-columns: repeat(${e=>e==null?void 0:e.numOfColumnsForMobile}, 1fr);
|
|
354
359
|
}
|
|
355
|
-
`,
|
|
360
|
+
`,re=h.forwardRef(({icon:e,title:n,numOfSlides:o=2,numOfSlidesForMobile:l=1,showNavigation:f=!0,children:u},_)=>{const[g,$]=h.useState(0),[c,P]=h.useState(1),[i,m]=h.useState(null),[y,j]=h.useState(null),x=K.useDetectMobile(),D=50,b=(u==null?void 0:u.length)??1;h.useEffect(()=>{const s=()=>{P(x?l:o)};return window.addEventListener("resize",s),s(),()=>window.removeEventListener("resize",s)},[]);const T=u==null?void 0:u.slice(g,g+c),C=s=>{var d;(d=s==null?void 0:s.target)==null||d.blur(),g+c<b&&$(g+c)},S=s=>{var d;(d=s==null?void 0:s.target)==null||d.blur(),g-c>=0&&$(g-c)},k=s=>{var d;j(null),m((d=s==null?void 0:s.targetTouches["0"])==null?void 0:d.clientX)},N=s=>{var d;j((d=s==null?void 0:s.targetTouches["0"])==null?void 0:d.clientX)},w=()=>{if(!i||!y)return;const s=i-y;s>D&&C(),s<-D&&S()};return t.jsxs(Te,{ref:_,...x?{onTouchStart:k,onTouchMove:N,onTouchEnd:w}:{},children:[t.jsx("div",{className:"scrollable-section__header",children:t.jsxs("div",{className:"scrollable-section__title",children:[v.isDefinedNotEmptyString(e)&&t.jsx(J,{icon:e,color:"primary",sizeInUnits:"1.5rem",className:"title__icon"}),v.isDefinedNotEmptyString(n)&&t.jsx("div",{className:"title__text",children:n})]})}),t.jsx(Pe,{numOfColumns:o,numOfColumnsForMobile:l,animate:{x:0,opacity:1},initial:{x:10,opacity:0},children:T},`scrollable-section__content-${g}`),f&&b>c&&!x&&t.jsxs("div",{className:"scrollable-section__navigation",children:[t.jsx(X,{icon:"angle-left",borderRadius:"curved",btnType:"tinted",color:"neutral",className:"navigation__arrow",disabled:g===0,onClick:S}),t.jsx(X,{icon:"angle-right",borderRadius:"curved",btnType:"tinted",color:"neutral",className:"navigation__arrow",disabled:g+c>=b,onClick:C})]})]})});re.propTypes={icon:a.PropTypes.string,title:a.PropTypes.string,numOfSlides:a.PropTypes.number,numOfSlidesForMobile:a.PropTypes.number,showNavigation:a.PropTypes.bool};const Ce=h.memo(ee),Se=h.forwardRef(({sellerType:e="Shop",items:n=[],title:o,icon:l,isLoading:f,onSelectCard:u=()=>{},onSelectShop:_=()=>{},getImage:g=()=>{},campaignSingleText:$,upcomingCampaignText:c,salesCampaignTypes:P=[],startsInPrefixTextPlural:i,startsinSuffixTextPlural:m,startsInPrefixTextSingular:y,startsinSuffixTextSingular:j,endsInPrefixTextPlural:x,endsinSuffixTextPlural:D,endsInPrefixTextSingular:b,endsinSuffixTextSingular:T,numOfSlides:C=2,numOfSlidesForMobile:S=1,showNavigation:k=!0,numberOfListingsTextSingular:N,numberOfListingsTextPlural:w},s)=>{const d=K.useDetectMobile(),R=h.useMemo(()=>n==null?void 0:n.map((r,A)=>t.jsx(Ce,{className:"campaign-item",coverPhoto:g(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,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:()=>u(r==null?void 0:r.campaignUuid,r==null?void 0:r.shopUuid),onSelectShop:()=>_(r==null?void 0:r.shopUuid),campaignSingleText:$,upcomingCampaignText:c,upcoming:r==null?void 0:r.upcoming,salesCampaignTypes:P,startsInPrefixTextPlural:i,startsinSuffixTextPlural:m,startsInPrefixTextSingular:y,startsinSuffixTextSingular:j,endsInPrefixTextPlural:x,endsinSuffixTextPlural:D,endsInPrefixTextSingular:b,endsinSuffixTextSingular:T,themeData:r==null?void 0:r.themeData,numberOfListings:r==null?void 0:r.numberOfListings,numberOfListingsTextSingular:N,numberOfListingsTextPlural:w},`campaign__item__${A}__${r==null?void 0:r.startDate}___${r==null?void 0:r.endDate}`)),[n]);return t.jsx(De,{isLoading:f,itemsCount:d?1:2,keyPrefix:"sales-camp",children:t.jsx(re,{icon:l,title:o,numOfSlides:C,numOfSlidesForMobile:S,showNavigation:k,children:R})})});module.exports=Se;
|