@lanaco/lnc-react-ui 4.0.140 → 4.0.142
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/DetailedProductsSection.cjs +4 -4
- package/dist/DetailedProductsSection.js +62 -51
- package/dist/SwipeableDrawer.cjs +7 -7
- package/dist/SwipeableDrawer.js +72 -69
- package/dist/UrgentSaleProductsSection.cjs +6 -6
- package/dist/UrgentSaleProductsSection.js +55 -44
- package/dist/suspense-product-card-detailed-BA06QK8a.cjs +265 -0
- package/dist/{suspense-product-card-detailed-DtTXmJJB.js → suspense-product-card-detailed-CUd-EI3U.js} +156 -121
- package/package.json +1 -1
- package/dist/suspense-product-card-detailed-C7_tBl85.cjs +0 -246
|
@@ -1,246 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("react/jsx-runtime"),d=require("react"),t=require("./utils-Dl9xPH4c.cjs"),x=require("./emotion-styled.browser.esm-BtEseadx.cjs"),te=require("./index-BueKsXT8.cjs"),_=require("./Badge.cjs"),oe=require("./Popover.cjs"),se=require("./PopoverTrigger.cjs"),ie=require("./PopoverContent.cjs"),ae=require("./useDetectMobile-zkbzoOGV.cjs"),D=require("./consts-goSZX3xP.cjs"),I=x.styled.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: column;
|
|
4
|
-
gap: 0.5rem;
|
|
5
|
-
cursor: pointer;
|
|
6
|
-
overflow: hidden;
|
|
7
|
-
width: 100%;
|
|
8
|
-
|
|
9
|
-
& .wrapper-card-1 {
|
|
10
|
-
display: flex;
|
|
11
|
-
flex-direction: column;
|
|
12
|
-
gap: 0.38rem;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
& .wrapper-card-2 {
|
|
16
|
-
display: flex;
|
|
17
|
-
flex-direction: column;
|
|
18
|
-
gap: 0;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
& .wrapper-card-3 {
|
|
22
|
-
display: flex;
|
|
23
|
-
flex-wrap: wrap;
|
|
24
|
-
gap: 0.25rem;
|
|
25
|
-
|
|
26
|
-
& > div {
|
|
27
|
-
& > div {
|
|
28
|
-
width: 100% !important;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
& .tag {
|
|
34
|
-
height: 1.5rem;
|
|
35
|
-
gap: 0.25rem;
|
|
36
|
-
padding: 0.25rem 0.375rem;
|
|
37
|
-
border-radius: 0.375rem;
|
|
38
|
-
background: #f9fafb;
|
|
39
|
-
border: 1px solid var(--gray-95012, #14161a1f);
|
|
40
|
-
font-weight: 400;
|
|
41
|
-
font-size: 0.75rem;
|
|
42
|
-
line-height: 1rem;
|
|
43
|
-
letter-spacing: 0.025rem;
|
|
44
|
-
color: var(--gray-950, #14161a);
|
|
45
|
-
white-space: nowrap;
|
|
46
|
-
flex: 0 0 auto;
|
|
47
|
-
|
|
48
|
-
&.tag-sponsored {
|
|
49
|
-
& i {
|
|
50
|
-
color: var(--yellow-500, #f59e0b);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
& .tag-mobile {
|
|
56
|
-
font-weight: 400;
|
|
57
|
-
font-size: 0.75rem;
|
|
58
|
-
line-height: 1rem;
|
|
59
|
-
letter-spacing: 0.025rem;
|
|
60
|
-
color: var(--gray-600, #676e79);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
& .card-title {
|
|
64
|
-
font-size: 0.875rem;
|
|
65
|
-
font-weight: 600;
|
|
66
|
-
${t.truncateTextInRows(2)}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
& .price-text {
|
|
70
|
-
font-size: 1rem;
|
|
71
|
-
font-weight: 600;
|
|
72
|
-
${t.truncateText()}
|
|
73
|
-
display: flex;
|
|
74
|
-
align-items: end;
|
|
75
|
-
gap: 0.5rem;
|
|
76
|
-
color: var(--gray-950, #14161a);
|
|
77
|
-
|
|
78
|
-
&.new-price {
|
|
79
|
-
color: var(--danger-600, #e11d48);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
& .full-price {
|
|
83
|
-
text-decoration: line-through;
|
|
84
|
-
font-size: 0.75rem;
|
|
85
|
-
font-weight: 400;
|
|
86
|
-
padding-bottom: 0.125rem;
|
|
87
|
-
color: var(--gray-600, #676e79);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
& .location-text {
|
|
92
|
-
font-size: 0.75rem;
|
|
93
|
-
font-weight: 400;
|
|
94
|
-
color: var(--gray-600, #676e79);
|
|
95
|
-
${t.truncateText()}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
& .tags-wrapper {
|
|
99
|
-
display: flex;
|
|
100
|
-
gap: 0.5rem;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
& .skeleton-img {
|
|
104
|
-
background-color: ${t.linearGradientAnimation("-90deg")};
|
|
105
|
-
border-radius: 0.75rem;
|
|
106
|
-
border: 1px solid white;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
& .skeleton-title {
|
|
110
|
-
background-color: ${t.linearGradientAnimation("-90deg")};
|
|
111
|
-
width: 100%;
|
|
112
|
-
height: 2.5rem;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
& .skeleton-tags {
|
|
116
|
-
background-color: ${t.linearGradientAnimation("-90deg")};
|
|
117
|
-
width: 80%;
|
|
118
|
-
height: 1.5rem;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
& .skeleton-price {
|
|
122
|
-
background-color: ${t.linearGradientAnimation("-90deg")};
|
|
123
|
-
width: 50%;
|
|
124
|
-
height: 2.5rem;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
& .skeleton-sponsored {
|
|
128
|
-
background-color: ${t.linearGradientAnimation("-90deg")};
|
|
129
|
-
width: 50%;
|
|
130
|
-
height: 1rem;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
& .tags-popover__trigger {
|
|
134
|
-
display: flex;
|
|
135
|
-
gap: 0.25rem;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
@media (max-width: ${D.MOBILE_SIZE_PX+"px"}) {
|
|
139
|
-
overflow: visible;
|
|
140
|
-
|
|
141
|
-
& .tags-popover__trigger {
|
|
142
|
-
flex-wrap: wrap;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
& .price-text {
|
|
146
|
-
font-size: 0.875rem;
|
|
147
|
-
font-weight: 600;
|
|
148
|
-
|
|
149
|
-
& .full-price {
|
|
150
|
-
display: none;
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
&:hover .product-image-wrapper img {
|
|
156
|
-
transform: scale(1.1);
|
|
157
|
-
}
|
|
158
|
-
`,ce=x.styled.div`
|
|
159
|
-
position: relative;
|
|
160
|
-
overflow: hidden;
|
|
161
|
-
border-radius: 0.75rem;
|
|
162
|
-
width: 100%;
|
|
163
|
-
aspect-ratio: 1 / 1;
|
|
164
|
-
border: 1px solid #0c15201f;
|
|
165
|
-
|
|
166
|
-
& img {
|
|
167
|
-
display: block;
|
|
168
|
-
width: 100%;
|
|
169
|
-
height: 100%;
|
|
170
|
-
object-fit: cover;
|
|
171
|
-
border-radius: 0.75rem;
|
|
172
|
-
transition: var(--transition, all 0.3s ease);
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
@media (max-width: ${D.MOBILE_SIZE_PX+"px"}) {
|
|
176
|
-
& img {
|
|
177
|
-
width: 8.875rem;
|
|
178
|
-
height: 8.875rem;
|
|
179
|
-
min-width: 8.875rem;
|
|
180
|
-
min-height: 8.875rem;
|
|
181
|
-
object-fit: cover;
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
`,le=x.styled.div`
|
|
185
|
-
background: var(--white, #fff);
|
|
186
|
-
z-index: 1;
|
|
187
|
-
|
|
188
|
-
border: 1px solid var(--gray-200, #dddfe4);
|
|
189
|
-
border-radius: 0.5rem;
|
|
190
|
-
line-height: 1rem;
|
|
191
|
-
position: absolute;
|
|
192
|
-
padding: 0.5rem 0.75rem;
|
|
193
|
-
top: 0.5rem;
|
|
194
|
-
left: 25%;
|
|
195
|
-
transform: translateX(-50%);
|
|
196
|
-
min-width: 13rem;
|
|
197
|
-
|
|
198
|
-
&::before,
|
|
199
|
-
&::after {
|
|
200
|
-
content: "";
|
|
201
|
-
position: absolute;
|
|
202
|
-
left: 50%;
|
|
203
|
-
transform: translateX(-50%);
|
|
204
|
-
border-style: solid;
|
|
205
|
-
border-width: 0.625rem;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
&::after {
|
|
209
|
-
top: -1.1875rem;
|
|
210
|
-
border-color: transparent transparent var(--white, #fff) transparent;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
&::before {
|
|
214
|
-
top: -1.25rem;
|
|
215
|
-
border-color: transparent transparent var(--gray-200, #dddfe4) transparent;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
& .tags-popover__content {
|
|
219
|
-
display: flex;
|
|
220
|
-
flex-wrap: wrap;
|
|
221
|
-
flex-direction: column;
|
|
222
|
-
gap: 0.375rem;
|
|
223
|
-
font-size: 0.75rem;
|
|
224
|
-
font-weight: 400;
|
|
225
|
-
|
|
226
|
-
& .tags-popover__name {
|
|
227
|
-
color: var(--gray-600, #676e79);
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
& .tags-popover__value {
|
|
231
|
-
color: var(--gray-950, #14161a);
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
`,de=x.styled.div`
|
|
235
|
-
display: flex;
|
|
236
|
-
align-items: center;
|
|
237
|
-
gap: 0.25rem;
|
|
238
|
-
color: var(--gray-500);
|
|
239
|
-
font-size: 0.75rem;
|
|
240
|
-
font-weight: 500;
|
|
241
|
-
|
|
242
|
-
& i {
|
|
243
|
-
font-size: 1rem;
|
|
244
|
-
color: var(--warning-500, #F59E0B);
|
|
245
|
-
}
|
|
246
|
-
`,me=d.forwardRef(({sponsoredText:m="Sponsored"},v)=>e.jsxs(de,{ref:v,className:"sponsored-line",children:[e.jsx("i",{className:"mng-lnc-paw2"}),e.jsx("span",{children:m})]})),pe="Vehicles_Cars",ge="Vehicles_Motorcycles",ue="Vehicles_Trucks",he="Vehicles_AgriculturalMachines_Tractors",fe="Vehicles_ConstructionMachines",ve="Vehicles_Bus",we="Vehicles_Campers",ye="RealEstates_",i={Mileage:{icon:"mng-lnc-road",measure:"km"},YearOfProduction:{icon:"mng-lnc-calendar",measure:""},Fuel:{icon:"mng-lnc-gas-station",measure:""},EnginePowerKW:{icon:"mng-lnc-engine",measure:"kW"},Transmission:{icon:"mng-lnc-transmission",measure:""},Model:{icon:"mng-lnc-application",measure:""},Brand:{icon:"mng-lnc-car--front",measure:""},SurfaceArea:{icon:"mng-lnc-right-angle",measure:""},Floor:{icon:"mng-lnc-elevator",measure:""},FurnishedCondition:{icon:"mng-lnc-sofa-01",measure:""},AdType:{icon:"mng-lnc-notes",measure:""},NumberOfRooms:{icon:"mng-lnc-meeting-room",measure:""},HeatingType:{icon:"mng-lnc-heat",measure:""},AirConditioning:{icon:"mng-lnc-air-conditioner",measure:""},Type:{icon:"mng-lnc-house-building",measure:""},Parking:{icon:"mng-lnc-parking-area-circle",measure:""},Internet:{icon:"mng-lnc-wifi-02",measure:""},State:{icon:"mng-lnc-settings-1",measure:""},NumberOfPremises:{icon:"mng-lnc-meeting-room",measure:""},Pool:{icon:"mng-lnc-pool",measure:""},Approach:{icon:"mng-lnc-driveway",measure:""},NumberOfBeds:{icon:"mng-lnc-bed",measure:""},Kitchen:{icon:"mng-lnc-fridge",measure:""},BathroomToilet:{icon:"mng-lnc-bath",measure:""},default:{icon:" mng-lnc-clock--filled",measure:""}},be=d.forwardRef((m,v)=>{const{title:w,price:y=0,sellingPrice:p,currency:j,isNegotiable:N,isFree:C,imageUrl:G,location:R,sponsored:T,imageComponent:O,onSelectCard:A=()=>{},freeText:X="Free",negotiableText:L="Negotiable",tags:o=[],categoryCode:k,condition:P,quantity:$,trade:S,sponsoredText:U}=m,E=ae.useDetectMobile(),V=[pe,ge,ue,he,fe,ve,we,ye].some(r=>k==null?void 0:k.includes(r)),[Y,M]=d.useState(!1),K=()=>{M(!0)},Z=()=>{M(!1)},a=d.useRef(null),u=d.useRef([]),[q,H]=d.useState(o==null?void 0:o.length),J=()=>{var h,c,b;if(!(a!=null&&a.current)||((h=u==null?void 0:u.current)==null?void 0:h.length)===0)return;const r=(c=a==null?void 0:a.current)==null?void 0:c.offsetWidth;let n=0,s=0;for(let l=0;l<(o==null?void 0:o.length);l++){const f=((b=u==null?void 0:u.current[l])==null?void 0:b.offsetWidth)||0,g=n+f+4;if(g<=r)n+=g,s++;else break}H(s)};d.useEffect(()=>{const r=a==null?void 0:a.current;if(!r)return;const n=new ResizeObserver(()=>{J()});return n.observe(r),()=>{n.disconnect()}},[o]);const Q=()=>{var r;return e.jsx("div",{className:"tags-popover__trigger",children:(r=o==null?void 0:o.slice(0,q))==null?void 0:r.map((n,s)=>{var f,g,W,B,F;const h=((f=i==null?void 0:i[n==null?void 0:n.code])==null?void 0:f.icon)??((g=i==null?void 0:i.default)==null?void 0:g.icon)??"",c=((W=n==null?void 0:n.measurementUnit)==null?void 0:W.symbol)??((B=i==null?void 0:i[n==null?void 0:n.code])==null?void 0:B.measure)??"",l=[(n==null?void 0:n.value)??((F=n==null?void 0:n.multiOptions)==null?void 0:F[0])??"",c].filter(Boolean).join(" ");return E?e.jsxs("div",{className:"tag-mobile",children:[l,s<q-1?" · ":""]}):e.jsxs(_,{ref:ne=>u.current[s]=ne,className:`tag ${T?"tag-sponsored":""}`,children:[e.jsx("i",{className:h}),l]},`detailed-products-section-tag__${s+1}`)})})},ee=()=>e.jsx("div",{className:"tags-popover__content",children:o==null?void 0:o.map((r,n)=>{var l,f,g;const s=((l=r==null?void 0:r.measurementUnit)==null?void 0:l.symbol)??((f=i==null?void 0:i[r==null?void 0:r.code])==null?void 0:f.measure)??"",c=[(r==null?void 0:r.value)??((g=r==null?void 0:r.multiOptions)==null?void 0:g[0])??"",s].filter(Boolean).join(" "),b=r==null?void 0:r.name;return e.jsxs("div",{children:[e.jsx("span",{className:"tags-popover__name",children:`${b}: `}),e.jsx("span",{className:"tags-popover__value",children:c})]},`detailed-products-section-tag-dropdown__${n+1}`)})}),re=()=>{var r;if(E){const n=[P,$,S];return(r=n==null?void 0:n.filter(s=>t.isDefinedNotEmptyString(s)))==null?void 0:r.map((s,h,c)=>e.jsxs("div",{className:"tag-mobile",children:[s,h<(c==null?void 0:c.length)-1?" · ":""]}))}return e.jsxs(e.Fragment,{children:[P&&e.jsx(_,{className:"tag",children:P},"detailed-products-section-tag__condition"),$&&e.jsx(_,{className:"tag",children:$},"detailed-products-section-tag__quantity"),S&&e.jsx(_,{className:"tag",children:S},"detailed-products-section-tag__trade")]})},z=y>0&&j&&N!==!0&&C!==!0&&y!==p;return e.jsxs(I,{ref:a,className:"product-card",onClick:A,children:[e.jsx(ce,{className:"product-image-wrapper",children:t.isDefined(O)?O:e.jsx(te.ProductImageWrapper,{src:G})}),e.jsx("div",{className:"wrapper-card-1",children:e.jsx("div",{className:"card-title",children:w})}),e.jsxs("div",{className:"wrapper-card-3",children:[V&&e.jsx("div",{...E?{}:{onMouseEnter:K,onMouseLeave:Z},children:e.jsxs(oe,{placement:"bottom",open:Y,children:[e.jsx(se,{children:Q()}),e.jsx(ie,{style:{all:"unset"},children:e.jsx(le,{children:ee()})})]})}),!V&&re()]}),e.jsxs("div",{className:"wrapper-card-2",children:[e.jsxs("div",{className:`price-text ${z?"new-price":""}`,children:[p>0&&j&&N!==!0&&C!==!0&&e.jsx("div",{children:`${t.formatPrice(p)} ${t.GetCurrencySymbol(j)}`}),z&&e.jsx("div",{className:`${p>0?"full-price":""}`,children:`${t.formatPrice(y)} ${t.GetCurrencySymbol(j)}`}),N&&L,C&&X]}),e.jsx("div",{className:"location-text",children:R})]}),T===!0&&e.jsx(me,{sponsoredText:U})]})}),je=d.forwardRef(({},m)=>e.jsxs(I,{className:"product-card",children:[e.jsx("img",{className:"skeleton-img"}),e.jsxs("div",{className:"wrapper-card-1",children:[e.jsx("div",{className:"skeleton-title"}),e.jsx("div",{className:"skeleton-tags"})]}),e.jsxs("div",{className:"wrapper-card-1",children:[e.jsx("div",{className:"skeleton-price"}),e.jsx("div",{className:"skeleton-sponsored"})]})]})),_e=({limit:m=5,isLoading:v=!1,keyPrefix:w})=>e.jsx(e.Fragment,{children:Array.from({length:m},(y,p)=>e.jsx(je,{isLoading:v},`${w}-skeleton-product-card-${p}`))}),xe=({children:m,fallbackComponent:v=e.jsx(e.Fragment,{}),isLoading:w=!1,limit:y,keyPrefix:p})=>e.jsx(d.Suspense,{fallbackComponent:v,children:w===!0?e.jsx(_e,{isLoading:w,limit:y,keyPrefix:p}):m});exports.DetailedProductCard=be;exports.SuspenseDetailedProductCard=xe;
|