@lanaco/lnc-react-ui 4.0.145 → 4.0.146

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.
@@ -1,4 +1,4 @@
1
- "use strict";const t=require("react/jsx-runtime"),a=require("react"),U=require("./emotion-styled.browser.esm-BtEseadx.cjs"),F=require("./consts-goSZX3xP.cjs"),L=require("./Button.cjs"),h=require("./utils-Dl9xPH4c.cjs"),M=require("./useDetectMobile-zkbzoOGV.cjs"),T=require("./style-CyHewQxg.cjs"),j=require("./suspense-product-card-detailed-B7gioG73.cjs"),B=require("./index-D0xXo7W6.cjs"),E=U.styled.div`
1
+ "use strict";const t=require("react/jsx-runtime"),a=require("react"),U=require("./emotion-styled.browser.esm-BtEseadx.cjs"),F=require("./consts-goSZX3xP.cjs"),L=require("./Button.cjs"),h=require("./utils-Dl9xPH4c.cjs"),M=require("./useDetectMobile-zkbzoOGV.cjs"),T=require("./style-CyHewQxg.cjs"),j=require("./suspense-product-card-detailed-BVYLuo75.cjs"),B=require("./index-D0xXo7W6.cjs"),E=U.styled.div`
2
2
  display: grid;
3
3
  grid-template-columns: ${s=>`repeat(${s.limit}, minmax(0, 1fr))`};
4
4
  gap: 1.25rem;
@@ -6,7 +6,7 @@ import E from "./Button.js";
6
6
  import { k as h } from "./utils-BdsZgOUE.js";
7
7
  import { u as I } from "./useDetectMobile-Bkvj0VMa.js";
8
8
  import { T as O } from "./style-DFPWLJBr.js";
9
- import { D as R, S as W } from "./suspense-product-card-detailed-FUKF_Pyc.js";
9
+ import { D as R, S as W } from "./suspense-product-card-detailed-Bv1nJaPz.js";
10
10
  import { S as $ } from "./index-Dweo-G3H.js";
11
11
  const j = B.div`
12
12
  display: grid;
@@ -1,4 +1,4 @@
1
- "use strict";const i=require("react/jsx-runtime"),l=require("react"),v=require("./emotion-styled.browser.esm-BtEseadx.cjs"),k=require("./consts-goSZX3xP.cjs"),C=require("./useDetectMobile-zkbzoOGV.cjs"),q=require("./Button.cjs"),w=require("./suspense-product-card-detailed-B7gioG73.cjs"),N=v.styled.div`
1
+ "use strict";const i=require("react/jsx-runtime"),l=require("react"),v=require("./emotion-styled.browser.esm-BtEseadx.cjs"),k=require("./consts-goSZX3xP.cjs"),C=require("./useDetectMobile-zkbzoOGV.cjs"),q=require("./Button.cjs"),w=require("./suspense-product-card-detailed-BVYLuo75.cjs"),N=v.styled.div`
2
2
  padding: 1.75rem 3rem;
3
3
  display: grid;
4
4
  grid-template-columns: ${o=>`repeat(${o.limit||5}, minmax(0, 1fr))`};
@@ -4,7 +4,7 @@ import { s as F } from "./emotion-styled.browser.esm-BNN1dTl3.js";
4
4
  import { M as I, S as T } from "./consts-BuFChS64.js";
5
5
  import { u as _ } from "./useDetectMobile-Bkvj0VMa.js";
6
6
  import B from "./Button.js";
7
- import { D, S as E } from "./suspense-product-card-detailed-FUKF_Pyc.js";
7
+ import { D, S as E } from "./suspense-product-card-detailed-Bv1nJaPz.js";
8
8
  const j = F.div`
9
9
  padding: 1.75rem 3rem;
10
10
  display: grid;
@@ -1,4 +1,4 @@
1
- "use strict";const e=require("react/jsx-runtime"),l=require("react"),o=require("./utils-Dl9xPH4c.cjs"),x=require("./emotion-styled.browser.esm-BtEseadx.cjs"),le=require("./index-BueKsXT8.cjs"),_=require("./Badge.cjs"),de=require("./Popover.cjs"),me=require("./PopoverTrigger.cjs"),pe=require("./PopoverContent.cjs"),ge=require("./useDetectMobile-zkbzoOGV.cjs"),A=require("./consts-goSZX3xP.cjs"),X=x.styled.div`
1
+ "use strict";const e=require("react/jsx-runtime"),a=require("react"),o=require("./utils-Dl9xPH4c.cjs"),N=require("./emotion-styled.browser.esm-BtEseadx.cjs"),le=require("./index-BueKsXT8.cjs"),x=require("./Badge.cjs"),de=require("./Popover.cjs"),me=require("./PopoverTrigger.cjs"),pe=require("./PopoverContent.cjs"),ge=require("./useDetectMobile-zkbzoOGV.cjs"),A=require("./consts-goSZX3xP.cjs"),X=N.styled.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  gap: 0.5rem;
@@ -155,7 +155,7 @@
155
155
  &:hover .product-image-wrapper img {
156
156
  transform: scale(1.1);
157
157
  }
158
- `,ue=x.styled.div`
158
+ `,ue=N.styled.div`
159
159
  position: relative;
160
160
  overflow: hidden;
161
161
  border-radius: 0.75rem;
@@ -200,7 +200,7 @@
200
200
  display: flex;
201
201
  }
202
202
  }
203
- `,he=x.styled.div`
203
+ `,he=N.styled.div`
204
204
  background: var(--white, #fff);
205
205
  z-index: 1;
206
206
 
@@ -250,7 +250,7 @@
250
250
  color: var(--gray-950, #14161a);
251
251
  }
252
252
  }
253
- `,fe=x.styled.div`
253
+ `,fe=N.styled.div`
254
254
  display: flex;
255
255
  align-items: center;
256
256
  gap: 0.25rem;
@@ -262,4 +262,4 @@
262
262
  font-size: 1rem;
263
263
  color: var(--warning-500, #F59E0B);
264
264
  }
265
- `,ve=l.forwardRef(({sponsoredText:m="Sponsored"},w)=>e.jsxs(fe,{ref:w,className:"sponsored-line",children:[e.jsx("i",{className:"mng-lnc-paw2"}),e.jsx("span",{children:m})]})),we="Vehicles_Cars",be="Vehicles_Motorcycles",ye="Vehicles_Trucks",ke="Vehicles_AgriculturalMachines_Tractors",je="Vehicles_ConstructionMachines",_e="Vehicles_Bus",xe="Vehicles_Campers",Ne="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:""}},Ce=l.forwardRef((m,w)=>{const{uuid:p,name:y,price:u=0,sellingPrice:k,currency:j,isNegotiable:N,isFree:C,imageUrl:L,location:U,sponsored:O,imageComponent:V,onSelectCard:Y=()=>{},freeText:K="Free",negotiableText:Z="Negotiable",tags:t=[],categoryCode:P,condition:$,quantity:S,trade:E,sponsoredText:H,onBookmark:B=()=>{},bookmarkComponent:z,bookmarked:M,bookmarkLists:J}=m,T=ge.useDetectMobile(),Q=()=>o.isDefined(z)?l.cloneElement(z,{key:`bookmark_pr__${M}`,bookmarked:M,productUuid:p,onAddToBookmark:()=>B(!0,p),onRemoveFromBookmark:()=>B(!1,p),bookmarkedUuidList:J}):e.jsx(e.Fragment,{}),q=[we,be,ye,ke,je,_e,xe,Ne].some(r=>P==null?void 0:P.includes(r)),[ee,F]=l.useState(!1),re=()=>{F(!0)},ne=()=>{F(!1)},a=l.useRef(null),h=l.useRef([]),[W,oe]=l.useState(t==null?void 0:t.length),te=()=>{var f,c,b;if(!(a!=null&&a.current)||((f=h==null?void 0:h.current)==null?void 0:f.length)===0)return;const r=(c=a==null?void 0:a.current)==null?void 0:c.offsetWidth;let n=0,s=0;for(let d=0;d<(t==null?void 0:t.length);d++){const v=((b=h==null?void 0:h.current[d])==null?void 0:b.offsetWidth)||0,g=n+v+4;if(g<=r)n+=g,s++;else break}oe(s)};l.useEffect(()=>{const r=a==null?void 0:a.current;if(!r)return;const n=new ResizeObserver(()=>{te()});return n.observe(r),()=>{n.disconnect()}},[t]);const se=()=>{var r;return e.jsx("div",{className:"tags-popover__trigger",children:(r=t==null?void 0:t.slice(0,W))==null?void 0:r.map((n,s)=>{var v,g,I,R,G;const f=((v=i==null?void 0:i[n==null?void 0:n.code])==null?void 0:v.icon)??((g=i==null?void 0:i.default)==null?void 0:g.icon)??"",c=((I=n==null?void 0:n.measurementUnit)==null?void 0:I.symbol)??((R=i==null?void 0:i[n==null?void 0:n.code])==null?void 0:R.measure)??"",d=[(n==null?void 0:n.value)??((G=n==null?void 0:n.multiOptions)==null?void 0:G[0])??"",c].filter(Boolean).join(" ");return T?e.jsxs("div",{className:"tag-mobile",children:[d,s<W-1?" · ":""]}):e.jsxs(_,{ref:ce=>h.current[s]=ce,className:`tag ${O?"tag-sponsored":""}`,children:[e.jsx("i",{className:f}),d]},`detailed-products-section-tag__${s+1}`)})})},ie=()=>e.jsx("div",{className:"tags-popover__content",children:t==null?void 0:t.map((r,n)=>{var d,v,g;const s=((d=r==null?void 0:r.measurementUnit)==null?void 0:d.symbol)??((v=i==null?void 0:i[r==null?void 0:r.code])==null?void 0:v.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}`)})}),ae=()=>{var r;if(T){const n=[$,S,E];return(r=n==null?void 0:n.filter(s=>o.isDefinedNotEmptyString(s)))==null?void 0:r.map((s,f,c)=>e.jsxs("div",{className:"tag-mobile",children:[s,f<(c==null?void 0:c.length)-1?" · ":""]}))}return e.jsxs(e.Fragment,{children:[$&&e.jsx(_,{className:"tag",children:$},"detailed-products-section-tag__condition"),S&&e.jsx(_,{className:"tag",children:S},"detailed-products-section-tag__quantity"),E&&e.jsx(_,{className:"tag",children:E},"detailed-products-section-tag__trade")]})},D=u>0&&j&&N!==!0&&C!==!0&&u!==k;return e.jsxs(X,{ref:a,className:"product-card",onClick:Y,children:[e.jsxs(ue,{className:"product-image-wrapper",children:[e.jsx(Q,{}),o.isDefined(V)?V:e.jsx(le.ProductImageWrapper,{src:L})]}),e.jsx("div",{className:"wrapper-card-1",children:e.jsx("div",{className:"card-title",children:y})}),e.jsxs("div",{className:"wrapper-card-3",children:[q&&e.jsx("div",{...T?{}:{onMouseEnter:re,onMouseLeave:ne},children:e.jsxs(de,{placement:"bottom",open:ee,children:[e.jsx(me,{children:se()}),e.jsx(pe,{style:{all:"unset"},children:e.jsx(he,{children:ie()})})]})}),!q&&ae()]}),e.jsxs("div",{className:"wrapper-card-2",children:[e.jsxs("div",{className:`price-text ${D?"new-price":""}`,children:[k>0&&j&&N!==!0&&C!==!0&&e.jsx("div",{children:`${o.formatPrice(k)} ${o.GetCurrencySymbol(j)}`}),D&&e.jsx("div",{className:`${k>0?"full-price":""}`,children:`${o.formatPrice(u)} ${o.GetCurrencySymbol(j)}`}),N&&Z,C&&K]}),e.jsx("div",{className:"location-text",children:U})]}),O===!0&&e.jsx(ve,{sponsoredText:H})]})}),Pe=l.forwardRef(({},m)=>e.jsxs(X,{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:w=!1,keyPrefix:p})=>e.jsx(e.Fragment,{children:Array.from({length:m},(y,u)=>e.jsx(Pe,{isLoading:w},`${p}-skeleton-product-card-${u}`))}),Se=({children:m,fallbackComponent:w=e.jsx(e.Fragment,{}),isLoading:p=!1,limit:y,keyPrefix:u})=>e.jsx(l.Suspense,{fallbackComponent:w,children:p===!0?e.jsx($e,{isLoading:p,limit:y,keyPrefix:u}):m});exports.DetailedProductCard=Ce;exports.SuspenseDetailedProductCard=Se;
265
+ `,ve=a.forwardRef(({sponsoredText:p="Sponsored"},w)=>e.jsxs(fe,{ref:w,className:"sponsored-line",children:[e.jsx("i",{className:"mng-lnc-paw2"}),e.jsx("span",{children:p})]})),we="Vehicles_Cars",be="Vehicles_Motorcycles",ye="Vehicles_Trucks",je="Vehicles_AgriculturalMachines_Tractors",ke="Vehicles_ConstructionMachines",_e="Vehicles_Bus",xe="Vehicles_Campers",Ne="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:""}},Ce=a.forwardRef((p,w)=>{const{uuid:g,name:j,price:h=0,sellingPrice:k,currency:_,isNegotiable:C,isFree:P,imageUrl:L,location:U,sponsored:V,imageComponent:B,onSelectCard:Y=()=>{},freeText:K="Free",negotiableText:Z="Negotiable",tags:s=[],categoryCode:$,condition:E,quantity:S,trade:T,sponsoredText:H,onBookmark:z=()=>{},bookmarkComponent:b,bookmarked:M,bookmarkLists:J}=p,O=ge.useDetectMobile(),Q=()=>{var l;if(!o.isDefined(b))return e.jsx(e.Fragment,{});const r=b,n=(l=b==null?void 0:b.props)==null?void 0:l.children,t=a.cloneElement(n,{key:`bookmark_pr__${M}`,bookmarked:M,productUuid:g,onAddToBookmark:()=>z(!0,g),onRemoveFromBookmark:()=>z(!1,g),bookmarkedUuidList:J});return a.cloneElement(r,void 0,t)},q=[we,be,ye,je,ke,_e,xe,Ne].some(r=>$==null?void 0:$.includes(r)),[ee,F]=a.useState(!1),re=()=>{F(!0)},ne=()=>{F(!1)},c=a.useRef(null),f=a.useRef([]),[W,oe]=a.useState(s==null?void 0:s.length),te=()=>{var l,d,y;if(!(c!=null&&c.current)||((l=f==null?void 0:f.current)==null?void 0:l.length)===0)return;const r=(d=c==null?void 0:c.current)==null?void 0:d.offsetWidth;let n=0,t=0;for(let m=0;m<(s==null?void 0:s.length);m++){const v=((y=f==null?void 0:f.current[m])==null?void 0:y.offsetWidth)||0,u=n+v+4;if(u<=r)n+=u,t++;else break}oe(t)};a.useEffect(()=>{const r=c==null?void 0:c.current;if(!r)return;const n=new ResizeObserver(()=>{te()});return n.observe(r),()=>{n.disconnect()}},[s]);const se=()=>{var r;return e.jsx("div",{className:"tags-popover__trigger",children:(r=s==null?void 0:s.slice(0,W))==null?void 0:r.map((n,t)=>{var v,u,I,R,G;const l=((v=i==null?void 0:i[n==null?void 0:n.code])==null?void 0:v.icon)??((u=i==null?void 0:i.default)==null?void 0:u.icon)??"",d=((I=n==null?void 0:n.measurementUnit)==null?void 0:I.symbol)??((R=i==null?void 0:i[n==null?void 0:n.code])==null?void 0:R.measure)??"",m=[(n==null?void 0:n.value)??((G=n==null?void 0:n.multiOptions)==null?void 0:G[0])??"",d].filter(Boolean).join(" ");return O?e.jsxs("div",{className:"tag-mobile",children:[m,t<W-1?" · ":""]}):e.jsxs(x,{ref:ce=>f.current[t]=ce,className:`tag ${V?"tag-sponsored":""}`,children:[e.jsx("i",{className:l}),m]},`detailed-products-section-tag__${t+1}`)})})},ie=()=>e.jsx("div",{className:"tags-popover__content",children:s==null?void 0:s.map((r,n)=>{var m,v,u;const t=((m=r==null?void 0:r.measurementUnit)==null?void 0:m.symbol)??((v=i==null?void 0:i[r==null?void 0:r.code])==null?void 0:v.measure)??"",d=[(r==null?void 0:r.value)??((u=r==null?void 0:r.multiOptions)==null?void 0:u[0])??"",t].filter(Boolean).join(" "),y=r==null?void 0:r.name;return e.jsxs("div",{children:[e.jsx("span",{className:"tags-popover__name",children:`${y}: `}),e.jsx("span",{className:"tags-popover__value",children:d})]},`detailed-products-section-tag-dropdown__${n+1}`)})}),ae=()=>{var r;if(O){const n=[E,S,T];return(r=n==null?void 0:n.filter(t=>o.isDefinedNotEmptyString(t)))==null?void 0:r.map((t,l,d)=>e.jsxs("div",{className:"tag-mobile",children:[t,l<(d==null?void 0:d.length)-1?" · ":""]}))}return e.jsxs(e.Fragment,{children:[E&&e.jsx(x,{className:"tag",children:E},"detailed-products-section-tag__condition"),S&&e.jsx(x,{className:"tag",children:S},"detailed-products-section-tag__quantity"),T&&e.jsx(x,{className:"tag",children:T},"detailed-products-section-tag__trade")]})},D=h>0&&_&&C!==!0&&P!==!0&&h!==k;return e.jsxs(X,{ref:c,className:"product-card",onClick:Y,children:[e.jsxs(ue,{className:"product-image-wrapper",children:[e.jsx(Q,{}),o.isDefined(B)?B:e.jsx(le.ProductImageWrapper,{src:L})]}),e.jsx("div",{className:"wrapper-card-1",children:e.jsx("div",{className:"card-title",children:j})}),e.jsxs("div",{className:"wrapper-card-3",children:[q&&e.jsx("div",{...O?{}:{onMouseEnter:re,onMouseLeave:ne},children:e.jsxs(de,{placement:"bottom",open:ee,children:[e.jsx(me,{children:se()}),e.jsx(pe,{style:{all:"unset"},children:e.jsx(he,{children:ie()})})]})}),!q&&ae()]}),e.jsxs("div",{className:"wrapper-card-2",children:[e.jsxs("div",{className:`price-text ${D?"new-price":""}`,children:[k>0&&_&&C!==!0&&P!==!0&&e.jsx("div",{children:`${o.formatPrice(k)} ${o.GetCurrencySymbol(_)}`}),D&&e.jsx("div",{className:`${k>0?"full-price":""}`,children:`${o.formatPrice(h)} ${o.GetCurrencySymbol(_)}`}),C&&Z,P&&K]}),e.jsx("div",{className:"location-text",children:U})]}),V===!0&&e.jsx(ve,{sponsoredText:H})]})}),Pe=a.forwardRef(({},p)=>e.jsxs(X,{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:p=5,isLoading:w=!1,keyPrefix:g})=>e.jsx(e.Fragment,{children:Array.from({length:p},(j,h)=>e.jsx(Pe,{isLoading:w},`${g}-skeleton-product-card-${h}`))}),Ee=({children:p,fallbackComponent:w=e.jsx(e.Fragment,{}),isLoading:g=!1,limit:j,keyPrefix:h})=>e.jsx(a.Suspense,{fallbackComponent:w,children:g===!0?e.jsx($e,{isLoading:g,limit:j,keyPrefix:h}):p});exports.DetailedProductCard=Ce;exports.SuspenseDetailedProductCard=Ee;
@@ -1,15 +1,15 @@
1
- import { jsxs as n, jsx as e, Fragment as C } from "react/jsx-runtime";
2
- import { forwardRef as B, useState as A, useRef as Y, useEffect as ve, cloneElement as we, Suspense as be } from "react";
3
- import { p as ke, t as K, o as b, l as H, q as Z, G as J, k as ye } from "./utils-BdsZgOUE.js";
4
- import { s as P } from "./emotion-styled.browser.esm-BNN1dTl3.js";
1
+ import { jsxs as n, jsx as e, Fragment as P } from "react/jsx-runtime";
2
+ import { forwardRef as M, useState as A, useRef as Y, useEffect as we, cloneElement as K, Suspense as be } from "react";
3
+ import { p as ke, t as H, o as k, l as Z, q as J, G as Q, k as ye } from "./utils-BdsZgOUE.js";
4
+ import { s as $ } from "./emotion-styled.browser.esm-BNN1dTl3.js";
5
5
  import { P as _e } from "./index-CF3HhgvN.js";
6
- import N from "./Badge.js";
6
+ import C from "./Badge.js";
7
7
  import Ne from "./Popover.js";
8
8
  import Ce from "./PopoverTrigger.js";
9
9
  import Pe from "./PopoverContent.js";
10
10
  import { u as $e } from "./useDetectMobile-Bkvj0VMa.js";
11
- import { M as Q } from "./consts-BuFChS64.js";
12
- const x = P.div`
11
+ import { M as x } from "./consts-BuFChS64.js";
12
+ const ee = $.div`
13
13
  display: flex;
14
14
  flex-direction: column;
15
15
  gap: 0.5rem;
@@ -80,7 +80,7 @@ const x = P.div`
80
80
  & .price-text {
81
81
  font-size: 1rem;
82
82
  font-weight: 600;
83
- ${K()}
83
+ ${H()}
84
84
  display: flex;
85
85
  align-items: end;
86
86
  gap: 0.5rem;
@@ -103,7 +103,7 @@ const x = P.div`
103
103
  font-size: 0.75rem;
104
104
  font-weight: 400;
105
105
  color: var(--gray-600, #676e79);
106
- ${K()}
106
+ ${H()}
107
107
  }
108
108
 
109
109
  & .tags-wrapper {
@@ -112,31 +112,31 @@ const x = P.div`
112
112
  }
113
113
 
114
114
  & .skeleton-img {
115
- background-color: ${b("-90deg")};
115
+ background-color: ${k("-90deg")};
116
116
  border-radius: 0.75rem;
117
117
  border: 1px solid white;
118
118
  }
119
119
 
120
120
  & .skeleton-title {
121
- background-color: ${b("-90deg")};
121
+ background-color: ${k("-90deg")};
122
122
  width: 100%;
123
123
  height: 2.5rem;
124
124
  }
125
125
 
126
126
  & .skeleton-tags {
127
- background-color: ${b("-90deg")};
127
+ background-color: ${k("-90deg")};
128
128
  width: 80%;
129
129
  height: 1.5rem;
130
130
  }
131
131
 
132
132
  & .skeleton-price {
133
- background-color: ${b("-90deg")};
133
+ background-color: ${k("-90deg")};
134
134
  width: 50%;
135
135
  height: 2.5rem;
136
136
  }
137
137
 
138
138
  & .skeleton-sponsored {
139
- background-color: ${b("-90deg")};
139
+ background-color: ${k("-90deg")};
140
140
  width: 50%;
141
141
  height: 1rem;
142
142
  }
@@ -146,7 +146,7 @@ const x = P.div`
146
146
  gap: 0.25rem;
147
147
  }
148
148
 
149
- @media (max-width: ${Q + "px"}) {
149
+ @media (max-width: ${x + "px"}) {
150
150
  overflow: visible;
151
151
 
152
152
  & .tags-popover__trigger {
@@ -166,7 +166,7 @@ const x = P.div`
166
166
  &:hover .product-image-wrapper img {
167
167
  transform: scale(1.1);
168
168
  }
169
- `, Te = P.div`
169
+ `, Te = $.div`
170
170
  position: relative;
171
171
  overflow: hidden;
172
172
  border-radius: 0.75rem;
@@ -198,7 +198,7 @@ const x = P.div`
198
198
  transition: var(--transition, all 0.3s ease);
199
199
  }
200
200
 
201
- @media (max-width: ${Q + "px"}) {
201
+ @media (max-width: ${x + "px"}) {
202
202
  & img {
203
203
  width: 8.875rem;
204
204
  height: 8.875rem;
@@ -211,7 +211,7 @@ const x = P.div`
211
211
  display: flex;
212
212
  }
213
213
  }
214
- `, Ee = P.div`
214
+ `, Ee = $.div`
215
215
  background: var(--white, #fff);
216
216
  z-index: 1;
217
217
 
@@ -261,7 +261,7 @@ const x = P.div`
261
261
  color: var(--gray-950, #14161a);
262
262
  }
263
263
  }
264
- `, Ve = P.div`
264
+ `, Ve = $.div`
265
265
  display: flex;
266
266
  align-items: center;
267
267
  gap: 0.25rem;
@@ -273,9 +273,9 @@ const x = P.div`
273
273
  font-size: 1rem;
274
274
  color: var(--warning-500, #F59E0B);
275
275
  }
276
- `, Oe = B(({ sponsoredText: d = "Sponsored" }, v) => /* @__PURE__ */ n(Ve, { ref: v, className: "sponsored-line", children: [
276
+ `, Oe = M(({ sponsoredText: m = "Sponsored" }, v) => /* @__PURE__ */ n(Ve, { ref: v, className: "sponsored-line", children: [
277
277
  /* @__PURE__ */ e("i", { className: "mng-lnc-paw2" }),
278
- /* @__PURE__ */ e("span", { children: d })
278
+ /* @__PURE__ */ e("span", { children: m })
279
279
  ] })), Se = "Vehicles_Cars", ze = "Vehicles_Motorcycles", Be = "Vehicles_Trucks", Me = "Vehicles_AgriculturalMachines_Tractors", We = "Vehicles_ConstructionMachines", Fe = "Vehicles_Bus", De = "Vehicles_Campers", Ie = "RealEstates_", i = {
280
280
  Mileage: {
281
281
  icon: "mng-lnc-road",
@@ -377,42 +377,47 @@ const x = P.div`
377
377
  icon: " mng-lnc-clock--filled",
378
378
  measure: ""
379
379
  }
380
- }, xe = B((d, v) => {
380
+ }, xe = M((m, v) => {
381
381
  const {
382
- uuid: m,
383
- name: k,
384
- price: g = 0,
385
- sellingPrice: y,
386
- currency: _,
387
- isNegotiable: $,
388
- isFree: T,
389
- imageUrl: ee,
390
- location: re,
391
- sponsored: M,
392
- imageComponent: W,
393
- onSelectCard: oe = () => {
382
+ uuid: p,
383
+ name: y,
384
+ price: u = 0,
385
+ sellingPrice: _,
386
+ currency: N,
387
+ isNegotiable: T,
388
+ isFree: E,
389
+ imageUrl: re,
390
+ location: oe,
391
+ sponsored: W,
392
+ imageComponent: F,
393
+ onSelectCard: ne = () => {
394
394
  },
395
- freeText: ne = "Free",
396
- negotiableText: te = "Negotiable",
397
- tags: t = [],
398
- categoryCode: E,
399
- condition: V,
400
- quantity: O,
401
- trade: S,
402
- sponsoredText: ae,
403
- onBookmark: F = () => {
395
+ freeText: te = "Free",
396
+ negotiableText: ae = "Negotiable",
397
+ tags: a = [],
398
+ categoryCode: V,
399
+ condition: O,
400
+ quantity: S,
401
+ trade: z,
402
+ sponsoredText: ie,
403
+ onBookmark: D = () => {
404
404
  },
405
- bookmarkComponent: D,
405
+ bookmarkComponent: w,
406
406
  bookmarked: I,
407
- bookmarkLists: ie
408
- } = d, z = $e(), se = () => H(D) ? we(D, {
409
- key: `bookmark_pr__${I}`,
410
- bookmarked: I,
411
- productUuid: m,
412
- onAddToBookmark: () => F(!0, m),
413
- onRemoveFromBookmark: () => F(!1, m),
414
- bookmarkedUuidList: ie
415
- }) : /* @__PURE__ */ e(C, {}), j = [
407
+ bookmarkLists: se
408
+ } = m, B = $e(), ce = () => {
409
+ var c;
410
+ if (!Z(w)) return /* @__PURE__ */ e(P, {});
411
+ const r = w, o = (c = w == null ? void 0 : w.props) == null ? void 0 : c.children, t = K(o, {
412
+ key: `bookmark_pr__${I}`,
413
+ bookmarked: I,
414
+ productUuid: p,
415
+ onAddToBookmark: () => D(!0, p),
416
+ onRemoveFromBookmark: () => D(!1, p),
417
+ bookmarkedUuidList: se
418
+ });
419
+ return K(r, void 0, t);
420
+ }, j = [
416
421
  Se,
417
422
  ze,
418
423
  Be,
@@ -422,123 +427,123 @@ const x = P.div`
422
427
  De,
423
428
  Ie
424
429
  ].some(
425
- (r) => E == null ? void 0 : E.includes(r)
426
- ), [ce, G] = A(!1), le = () => {
430
+ (r) => V == null ? void 0 : V.includes(r)
431
+ ), [le, G] = A(!1), de = () => {
427
432
  G(!0);
428
- }, de = () => {
433
+ }, me = () => {
429
434
  G(!1);
430
- }, s = Y(null), u = Y([]), [R, me] = A(t == null ? void 0 : t.length), pe = () => {
431
- var h, c, w;
432
- if (!(s != null && s.current) || ((h = u == null ? void 0 : u.current) == null ? void 0 : h.length) === 0) return;
433
- const r = (c = s == null ? void 0 : s.current) == null ? void 0 : c.offsetWidth;
434
- let o = 0, a = 0;
435
- for (let l = 0; l < (t == null ? void 0 : t.length); l++) {
436
- const f = ((w = u == null ? void 0 : u.current[l]) == null ? void 0 : w.offsetWidth) || 0, p = o + f + 4;
437
- if (p <= r)
438
- o += p, a++;
435
+ }, s = Y(null), h = Y([]), [R, pe] = A(a == null ? void 0 : a.length), ge = () => {
436
+ var c, l, b;
437
+ if (!(s != null && s.current) || ((c = h == null ? void 0 : h.current) == null ? void 0 : c.length) === 0) return;
438
+ const r = (l = s == null ? void 0 : s.current) == null ? void 0 : l.offsetWidth;
439
+ let o = 0, t = 0;
440
+ for (let d = 0; d < (a == null ? void 0 : a.length); d++) {
441
+ const f = ((b = h == null ? void 0 : h.current[d]) == null ? void 0 : b.offsetWidth) || 0, g = o + f + 4;
442
+ if (g <= r)
443
+ o += g, t++;
439
444
  else
440
445
  break;
441
446
  }
442
- me(a);
447
+ pe(t);
443
448
  };
444
- ve(() => {
449
+ we(() => {
445
450
  const r = s == null ? void 0 : s.current;
446
451
  if (!r) return;
447
452
  const o = new ResizeObserver(() => {
448
- pe();
453
+ ge();
449
454
  });
450
455
  return o.observe(r), () => {
451
456
  o.disconnect();
452
457
  };
453
- }, [t]);
454
- const ge = () => {
458
+ }, [a]);
459
+ const ue = () => {
455
460
  var r;
456
- return /* @__PURE__ */ e("div", { className: "tags-popover__trigger", children: (r = t == null ? void 0 : t.slice(0, R)) == null ? void 0 : r.map((o, a) => {
457
- var f, p, X, L, q;
458
- const h = ((f = i == null ? void 0 : i[o == null ? void 0 : o.code]) == null ? void 0 : f.icon) ?? ((p = i == null ? void 0 : i.default) == null ? void 0 : p.icon) ?? "", c = ((X = o == null ? void 0 : o.measurementUnit) == null ? void 0 : X.symbol) ?? ((L = i == null ? void 0 : i[o == null ? void 0 : o.code]) == null ? void 0 : L.measure) ?? "", l = [(o == null ? void 0 : o.value) ?? ((q = o == null ? void 0 : o.multiOptions) == null ? void 0 : q[0]) ?? "", c].filter(Boolean).join(" ");
459
- return z ? /* @__PURE__ */ n("div", { className: "tag-mobile", children: [
460
- l,
461
- a < R - 1 ? " · " : ""
461
+ return /* @__PURE__ */ e("div", { className: "tags-popover__trigger", children: (r = a == null ? void 0 : a.slice(0, R)) == null ? void 0 : r.map((o, t) => {
462
+ var f, g, X, L, q;
463
+ const c = ((f = i == null ? void 0 : i[o == null ? void 0 : o.code]) == null ? void 0 : f.icon) ?? ((g = i == null ? void 0 : i.default) == null ? void 0 : g.icon) ?? "", l = ((X = o == null ? void 0 : o.measurementUnit) == null ? void 0 : X.symbol) ?? ((L = i == null ? void 0 : i[o == null ? void 0 : o.code]) == null ? void 0 : L.measure) ?? "", d = [(o == null ? void 0 : o.value) ?? ((q = o == null ? void 0 : o.multiOptions) == null ? void 0 : q[0]) ?? "", l].filter(Boolean).join(" ");
464
+ return B ? /* @__PURE__ */ n("div", { className: "tag-mobile", children: [
465
+ d,
466
+ t < R - 1 ? " · " : ""
462
467
  ] }) : /* @__PURE__ */ n(
463
- N,
468
+ C,
464
469
  {
465
- ref: (fe) => u.current[a] = fe,
466
- className: `tag ${M ? "tag-sponsored" : ""}`,
470
+ ref: (ve) => h.current[t] = ve,
471
+ className: `tag ${W ? "tag-sponsored" : ""}`,
467
472
  children: [
468
- /* @__PURE__ */ e("i", { className: h }),
469
- l
473
+ /* @__PURE__ */ e("i", { className: c }),
474
+ d
470
475
  ]
471
476
  },
472
- `detailed-products-section-tag__${a + 1}`
477
+ `detailed-products-section-tag__${t + 1}`
473
478
  );
474
479
  }) });
475
- }, ue = () => /* @__PURE__ */ e("div", { className: "tags-popover__content", children: t == null ? void 0 : t.map((r, o) => {
476
- var l, f, p;
477
- const a = ((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) ?? ((p = r == null ? void 0 : r.multiOptions) == null ? void 0 : p[0]) ?? "", a].filter(Boolean).join(" "), w = r == null ? void 0 : r.name;
480
+ }, he = () => /* @__PURE__ */ e("div", { className: "tags-popover__content", children: a == null ? void 0 : a.map((r, o) => {
481
+ var d, f, g;
482
+ const t = ((d = r == null ? void 0 : r.measurementUnit) == null ? void 0 : d.symbol) ?? ((f = i == null ? void 0 : i[r == null ? void 0 : r.code]) == null ? void 0 : f.measure) ?? "", l = [(r == null ? void 0 : r.value) ?? ((g = r == null ? void 0 : r.multiOptions) == null ? void 0 : g[0]) ?? "", t].filter(Boolean).join(" "), b = r == null ? void 0 : r.name;
478
483
  return /* @__PURE__ */ n("div", { children: [
479
- /* @__PURE__ */ e("span", { className: "tags-popover__name", children: `${w}: ` }),
480
- /* @__PURE__ */ e("span", { className: "tags-popover__value", children: c })
484
+ /* @__PURE__ */ e("span", { className: "tags-popover__name", children: `${b}: ` }),
485
+ /* @__PURE__ */ e("span", { className: "tags-popover__value", children: l })
481
486
  ] }, `detailed-products-section-tag-dropdown__${o + 1}`);
482
- }) }), he = () => {
487
+ }) }), fe = () => {
483
488
  var r;
484
- if (z) {
485
- const o = [V, O, S];
486
- return (r = o == null ? void 0 : o.filter((a) => ye(a))) == null ? void 0 : r.map((a, h, c) => /* @__PURE__ */ n("div", { className: "tag-mobile", children: [
487
- a,
488
- h < (c == null ? void 0 : c.length) - 1 ? " · " : ""
489
+ if (B) {
490
+ const o = [O, S, z];
491
+ return (r = o == null ? void 0 : o.filter((t) => ye(t))) == null ? void 0 : r.map((t, c, l) => /* @__PURE__ */ n("div", { className: "tag-mobile", children: [
492
+ t,
493
+ c < (l == null ? void 0 : l.length) - 1 ? " · " : ""
489
494
  ] }));
490
495
  }
491
- return /* @__PURE__ */ n(C, { children: [
492
- V && /* @__PURE__ */ e(N, { className: "tag", children: V }, "detailed-products-section-tag__condition"),
493
- O && /* @__PURE__ */ e(N, { className: "tag", children: O }, "detailed-products-section-tag__quantity"),
494
- S && /* @__PURE__ */ e(N, { className: "tag", children: S }, "detailed-products-section-tag__trade")
496
+ return /* @__PURE__ */ n(P, { children: [
497
+ O && /* @__PURE__ */ e(C, { className: "tag", children: O }, "detailed-products-section-tag__condition"),
498
+ S && /* @__PURE__ */ e(C, { className: "tag", children: S }, "detailed-products-section-tag__quantity"),
499
+ z && /* @__PURE__ */ e(C, { className: "tag", children: z }, "detailed-products-section-tag__trade")
495
500
  ] });
496
- }, U = g > 0 && _ && $ !== !0 && T !== !0 && g !== y;
501
+ }, U = u > 0 && N && T !== !0 && E !== !0 && u !== _;
497
502
  return (
498
503
  // <LandingPageProductCardSkeleton />
499
504
  /* @__PURE__ */ n(
500
- x,
505
+ ee,
501
506
  {
502
507
  ref: s,
503
508
  className: "product-card",
504
- onClick: oe,
509
+ onClick: ne,
505
510
  children: [
506
511
  /* @__PURE__ */ n(Te, { className: "product-image-wrapper", children: [
507
- /* @__PURE__ */ e(se, {}),
508
- H(W) ? W : /* @__PURE__ */ e(_e, { src: ee })
512
+ /* @__PURE__ */ e(ce, {}),
513
+ Z(F) ? F : /* @__PURE__ */ e(_e, { src: re })
509
514
  ] }),
510
- /* @__PURE__ */ e("div", { className: "wrapper-card-1", children: /* @__PURE__ */ e("div", { className: "card-title", children: k }) }),
515
+ /* @__PURE__ */ e("div", { className: "wrapper-card-1", children: /* @__PURE__ */ e("div", { className: "card-title", children: y }) }),
511
516
  /* @__PURE__ */ n("div", { className: "wrapper-card-3", children: [
512
517
  j && /* @__PURE__ */ e(
513
518
  "div",
514
519
  {
515
- ...z ? {} : {
516
- onMouseEnter: le,
517
- onMouseLeave: de
520
+ ...B ? {} : {
521
+ onMouseEnter: de,
522
+ onMouseLeave: me
518
523
  },
519
- children: /* @__PURE__ */ n(Ne, { placement: "bottom", open: ce, children: [
520
- /* @__PURE__ */ e(Ce, { children: ge() }),
521
- /* @__PURE__ */ e(Pe, { style: { all: "unset" }, children: /* @__PURE__ */ e(Ee, { children: ue() }) })
524
+ children: /* @__PURE__ */ n(Ne, { placement: "bottom", open: le, children: [
525
+ /* @__PURE__ */ e(Ce, { children: ue() }),
526
+ /* @__PURE__ */ e(Pe, { style: { all: "unset" }, children: /* @__PURE__ */ e(Ee, { children: he() }) })
522
527
  ] })
523
528
  }
524
529
  ),
525
- !j && he()
530
+ !j && fe()
526
531
  ] }),
527
532
  /* @__PURE__ */ n("div", { className: "wrapper-card-2", children: [
528
533
  /* @__PURE__ */ n("div", { className: `price-text ${U ? "new-price" : ""}`, children: [
529
- y > 0 && _ && $ !== !0 && T !== !0 && /* @__PURE__ */ e("div", { children: `${Z(y)} ${J(_)}` }),
530
- U && /* @__PURE__ */ e("div", { className: `${y > 0 ? "full-price" : ""}`, children: `${Z(g)} ${J(_)}` }),
531
- $ && te,
532
- T && ne
534
+ _ > 0 && N && T !== !0 && E !== !0 && /* @__PURE__ */ e("div", { children: `${J(_)} ${Q(N)}` }),
535
+ U && /* @__PURE__ */ e("div", { className: `${_ > 0 ? "full-price" : ""}`, children: `${J(u)} ${Q(N)}` }),
536
+ T && ae,
537
+ E && te
533
538
  ] }),
534
- /* @__PURE__ */ e("div", { className: "location-text", children: re })
539
+ /* @__PURE__ */ e("div", { className: "location-text", children: oe })
535
540
  ] }),
536
- M === !0 && /* @__PURE__ */ e(Oe, { sponsoredText: ae })
541
+ W === !0 && /* @__PURE__ */ e(Oe, { sponsoredText: ie })
537
542
  ]
538
543
  }
539
544
  )
540
545
  );
541
- }), je = B(({}, d) => /* @__PURE__ */ n(x, { className: "product-card", children: [
546
+ }), je = M(({}, m) => /* @__PURE__ */ n(ee, { className: "product-card", children: [
542
547
  /* @__PURE__ */ e("img", { className: "skeleton-img" }),
543
548
  /* @__PURE__ */ n("div", { className: "wrapper-card-1", children: [
544
549
  /* @__PURE__ */ e("div", { className: "skeleton-title" }),
@@ -548,26 +553,26 @@ const x = P.div`
548
553
  /* @__PURE__ */ e("div", { className: "skeleton-price" }),
549
554
  /* @__PURE__ */ e("div", { className: "skeleton-sponsored" })
550
555
  ] })
551
- ] })), Ge = ({ limit: d = 5, isLoading: v = !1, keyPrefix: m }) => /* @__PURE__ */ e(C, { children: Array.from({ length: d }, (k, g) => /* @__PURE__ */ e(
556
+ ] })), Ge = ({ limit: m = 5, isLoading: v = !1, keyPrefix: p }) => /* @__PURE__ */ e(P, { children: Array.from({ length: m }, (y, u) => /* @__PURE__ */ e(
552
557
  je,
553
558
  {
554
559
  isLoading: v
555
560
  },
556
- `${m}-skeleton-product-card-${g}`
561
+ `${p}-skeleton-product-card-${u}`
557
562
  )) }), er = ({
558
- children: d,
559
- fallbackComponent: v = /* @__PURE__ */ e(C, {}),
560
- isLoading: m = !1,
561
- limit: k,
562
- keyPrefix: g
563
- }) => /* @__PURE__ */ e(be, { fallbackComponent: v, children: m === !0 ? /* @__PURE__ */ e(
563
+ children: m,
564
+ fallbackComponent: v = /* @__PURE__ */ e(P, {}),
565
+ isLoading: p = !1,
566
+ limit: y,
567
+ keyPrefix: u
568
+ }) => /* @__PURE__ */ e(be, { fallbackComponent: v, children: p === !0 ? /* @__PURE__ */ e(
564
569
  Ge,
565
570
  {
566
- isLoading: m,
567
- limit: k,
568
- keyPrefix: g
571
+ isLoading: p,
572
+ limit: y,
573
+ keyPrefix: u
569
574
  }
570
- ) : d });
575
+ ) : m });
571
576
  export {
572
577
  xe as D,
573
578
  er as S
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lanaco/lnc-react-ui",
3
- "version": "4.0.145",
3
+ "version": "4.0.146",
4
4
  "description": "React component library",
5
5
  "type": "module",
6
6
  "keywords": [