@lanaco/lnc-react-ui 4.0.138 → 4.0.140

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,7 +1,7 @@
1
- "use strict";const i=require("react/jsx-runtime"),s=require("react"),v=require("./emotion-styled.browser.esm-BtEseadx.cjs"),D=require("./consts-goSZX3xP.cjs"),U=require("./Button.cjs"),y=require("./utils-Dl9xPH4c.cjs"),M=require("./useDetectMobile-zkbzoOGV.cjs"),F=require("./style-CyHewQxg.cjs"),h=require("./suspense-product-card-detailed-BJLmsTWB.cjs"),T=require("./index-D0xXo7W6.cjs"),E=v.styled.div`
1
+ "use strict";const t=require("react/jsx-runtime"),s=require("react"),v=require("./emotion-styled.browser.esm-BtEseadx.cjs"),D=require("./consts-goSZX3xP.cjs"),U=require("./Button.cjs"),C=require("./utils-Dl9xPH4c.cjs"),M=require("./useDetectMobile-zkbzoOGV.cjs"),T=require("./style-CyHewQxg.cjs"),f=require("./suspense-product-card-detailed-C7_tBl85.cjs"),F=require("./index-D0xXo7W6.cjs"),E=v.styled.div`
2
2
  display: grid;
3
- grid-template-columns: ${r=>`repeat(${r.limit}, minmax(0, 1fr))`};
4
- gap: ${r=>(r==null?void 0:r.gap)||"1.25rem"};
3
+ grid-template-columns: ${l=>`repeat(${l.limit}, minmax(0, 1fr))`};
4
+ gap: 1.25rem;
5
5
 
6
6
  & .button-link {
7
7
  white-space: nowrap;
@@ -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: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:"neutral",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;
29
+ `,h=s.memo(f.DetailedProductCard),R=s.forwardRef((l,q)=>{const{icon:a,title:S,buttonLink:c,items:i,buttonText:j,limit:o=4,onSelectCard:d=()=>{},onButtonAction:w=()=>{},isLoading:P=!1,getImage:u=()=>{},negotiableText:m,freeText:g,options:n,onSelectOption:p=()=>{},productsToolbarName:N="All",sponsoredText:b}=l,y=M.useDetectMobile(),k=s.useMemo(()=>t.jsx(t.Fragment,{children:y===!0?i==null?void 0:i.map((e,r)=>t.jsx(h,{title:e==null?void 0:e.title,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,sponsored:e==null?void 0:e.sponsored,imageComponent:e==null?void 0:e.imageComponent,onSelectCard:()=>d(e==null?void 0:e.uuid),imageUrl:u(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,tags:e==null?void 0:e.tags,categoryCode:e==null?void 0:e.categoryCode,condition:e==null?void 0:e.condition,quantity:e==null?void 0:e.quantity,trade:e==null?void 0:e.trade,sponsoredText:b},r)):i==null?void 0:i.slice(0,o).map((e,r)=>t.jsx(h,{title:e==null?void 0:e.title,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,sponsored:e==null?void 0:e.sponsored,imageComponent:e==null?void 0:e.imageComponent,onSelectCard:()=>d(e==null?void 0:e.uuid),imageUrl:u(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,tags:e==null?void 0:e.tags,categoryCode:e==null?void 0:e.categoryCode,condition:e==null?void 0:e.condition,quantity:e==null?void 0:e.quantity,trade:e==null?void 0:e.trade,sponsoredText:b},r))}),[i,y,o]);return t.jsxs(T.TitleWithOptionsSectionWrapper,{ref:q,children:[t.jsxs("div",{className:"regular-title",children:[t.jsxs("div",{className:"regular-title-text",children:[C.isDefinedNotEmptyString(a)&&t.jsx("i",{className:a}),t.jsx("span",{children:S})]}),C.isDefinedNotEmptyString(c)&&t.jsx(U,{type:"button",btnType:"tinted",color:"neutral",onClick:e=>{var r;(r=e==null?void 0:e.target)==null||r.blur(),w(c)},borderRadius:"curved",className:"button-link",children:j})]}),(n==null?void 0:n.length)>0&&t.jsx(F.SelectBar,{items:n,onRemove:e=>{p(e)},onSelect:e=>{p(e)},labelKey:"name",valueKey:"code",noMargin:!0,productsToolbarName:N}),t.jsx(E,{limit:o,children:t.jsx(f.SuspenseDetailedProductCard,{isLoading:P,limit:o,keyPrefix:"explore-landing",children:k})})]})});module.exports=R;
@@ -1,23 +1,23 @@
1
- import { jsx as i, Fragment as U, jsxs as a } from "react/jsx-runtime";
2
- import { memo as M, forwardRef as T, useMemo as D } from "react";
1
+ import { jsx as i, Fragment as T, jsxs as l } from "react/jsx-runtime";
2
+ import { memo as U, forwardRef as M, useMemo as D } from "react";
3
3
  import { s as F } from "./emotion-styled.browser.esm-BNN1dTl3.js";
4
- import { M as B } from "./consts-BuFChS64.js";
5
- import E from "./Button.js";
6
- import { k as f } from "./utils-BdsZgOUE.js";
7
- import { u as I } from "./useDetectMobile-Bkvj0VMa.js";
8
- import { T as $ } from "./style-DFPWLJBr.js";
9
- import { D as L, S as O } from "./suspense-product-card-detailed-D6191kXr.js";
4
+ import { M as q } from "./consts-BuFChS64.js";
5
+ import B from "./Button.js";
6
+ import { k as y } from "./utils-BdsZgOUE.js";
7
+ import { u as E } from "./useDetectMobile-Bkvj0VMa.js";
8
+ import { T as I } from "./style-DFPWLJBr.js";
9
+ import { D as L, S as O } from "./suspense-product-card-detailed-DtTXmJJB.js";
10
10
  import { S as R } from "./index-Dweo-G3H.js";
11
11
  const W = F.div`
12
12
  display: grid;
13
- grid-template-columns: ${(r) => `repeat(${r.limit}, minmax(0, 1fr))`};
14
- gap: ${(r) => (r == null ? void 0 : r.gap) || "1.25rem"};
13
+ grid-template-columns: ${(a) => `repeat(${a.limit}, minmax(0, 1fr))`};
14
+ gap: 1.25rem;
15
15
 
16
16
  & .button-link {
17
17
  white-space: nowrap;
18
18
  }
19
19
 
20
- @media (max-width: ${B + "px"}) {
20
+ @media (max-width: ${q + "px"}) {
21
21
  display: flex;
22
22
  gap: 1rem;
23
23
  overflow-x: auto;
@@ -36,15 +36,14 @@ const W = F.div`
36
36
  /* Safari and Chrome */
37
37
  }
38
38
  }
39
- `, S = M(L), J = T((r, h) => {
39
+ `, C = U(L), J = M((a, h) => {
40
40
  const {
41
41
  icon: s,
42
- title: y,
42
+ title: S,
43
43
  buttonLink: d,
44
- items: o,
44
+ items: t,
45
45
  buttonText: w,
46
- limit: l = 4,
47
- gap: C,
46
+ limit: o = 4,
48
47
  onSelectCard: c = () => {
49
48
  },
50
49
  onButtonAction: P = () => {
@@ -57,31 +56,38 @@ const W = F.div`
57
56
  options: n,
58
57
  onSelectOption: g = () => {
59
58
  },
60
- productsToolbarName: N = "All"
61
- } = r, b = I(), v = D(() => /* @__PURE__ */ i(U, { children: b === !0 ? o == null ? void 0 : o.map((e, t) => /* @__PURE__ */ i(
62
- S,
59
+ productsToolbarName: N = "All",
60
+ sponsoredText: b
61
+ } = a, f = E(), v = D(() => /* @__PURE__ */ i(T, { children: f === !0 ? t == null ? void 0 : t.map((e, r) => /* @__PURE__ */ i(
62
+ C,
63
63
  {
64
- title: e == null ? void 0 : e.name,
64
+ title: e == null ? void 0 : e.title,
65
65
  price: e == null ? void 0 : e.price,
66
66
  sellingPrice: e == null ? void 0 : e.sellingPrice,
67
67
  currency: e == null ? void 0 : e.currency,
68
68
  image: e == null ? void 0 : e.image,
69
69
  sellerUuid: e == null ? void 0 : e.sellerUuid,
70
70
  uuid: e == null ? void 0 : e.uuid,
71
- isSponsored: e == null ? void 0 : e.isSponsored,
71
+ sponsored: e == null ? void 0 : e.sponsored,
72
72
  imageComponent: e == null ? void 0 : e.imageComponent,
73
73
  onSelectCard: () => c(e == null ? void 0 : e.uuid),
74
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,
78
- freeText: p
78
+ freeText: p,
79
+ tags: e == null ? void 0 : e.tags,
80
+ categoryCode: e == null ? void 0 : e.categoryCode,
81
+ condition: e == null ? void 0 : e.condition,
82
+ quantity: e == null ? void 0 : e.quantity,
83
+ trade: e == null ? void 0 : e.trade,
84
+ sponsoredText: b
79
85
  },
80
- t
81
- )) : o == null ? void 0 : o.slice(0, l).map((e, t) => /* @__PURE__ */ i(
82
- S,
86
+ r
87
+ )) : t == null ? void 0 : t.slice(0, o).map((e, r) => /* @__PURE__ */ i(
88
+ C,
83
89
  {
84
- title: e == null ? void 0 : e.name,
90
+ title: e == null ? void 0 : e.title,
85
91
  price: e == null ? void 0 : e.price,
86
92
  sellingPrice: e == null ? void 0 : e.sellingPrice,
87
93
  currency: e == null ? void 0 : e.currency,
@@ -89,32 +95,38 @@ const W = F.div`
89
95
  sellerUuid: e == null ? void 0 : e.sellerUuid,
90
96
  uuid: e == null ? void 0 : e.uuid,
91
97
  location: e == null ? void 0 : e.location,
92
- isSponsored: e == null ? void 0 : e.isSponsored,
98
+ sponsored: e == null ? void 0 : e.sponsored,
93
99
  imageComponent: e == null ? void 0 : e.imageComponent,
94
100
  onSelectCard: () => c(e == null ? void 0 : e.uuid),
95
101
  imageUrl: m(e == null ? void 0 : e.image, e == null ? void 0 : e.uuid, e == null ? void 0 : e.sellerUuid) || null,
96
102
  isFree: e == null ? void 0 : e.isFree,
97
103
  isNegotiable: e == null ? void 0 : e.isNegotiable,
98
104
  negotiableText: u,
99
- freeText: p
105
+ freeText: p,
106
+ tags: e == null ? void 0 : e.tags,
107
+ categoryCode: e == null ? void 0 : e.categoryCode,
108
+ condition: e == null ? void 0 : e.condition,
109
+ quantity: e == null ? void 0 : e.quantity,
110
+ trade: e == null ? void 0 : e.trade,
111
+ sponsoredText: b
100
112
  },
101
- t
102
- )) }), [o, b, l]);
103
- return /* @__PURE__ */ a($, { ref: h, children: [
104
- /* @__PURE__ */ a("div", { className: "regular-title", children: [
105
- /* @__PURE__ */ a("div", { className: "regular-title-text", children: [
106
- f(s) && /* @__PURE__ */ i("i", { className: s }),
107
- /* @__PURE__ */ i("span", { children: y })
113
+ r
114
+ )) }), [t, f, o]);
115
+ return /* @__PURE__ */ l(I, { ref: h, children: [
116
+ /* @__PURE__ */ l("div", { className: "regular-title", children: [
117
+ /* @__PURE__ */ l("div", { className: "regular-title-text", children: [
118
+ y(s) && /* @__PURE__ */ i("i", { className: s }),
119
+ /* @__PURE__ */ i("span", { children: S })
108
120
  ] }),
109
- f(d) && /* @__PURE__ */ i(
110
- E,
121
+ y(d) && /* @__PURE__ */ i(
122
+ B,
111
123
  {
112
124
  type: "button",
113
125
  btnType: "tinted",
114
126
  color: "neutral",
115
127
  onClick: (e) => {
116
- var t;
117
- (t = e == null ? void 0 : e.target) == null || t.blur(), P(d);
128
+ var r;
129
+ (r = e == null ? void 0 : e.target) == null || r.blur(), P(d);
118
130
  },
119
131
  borderRadius: "curved",
120
132
  className: "button-link",
@@ -138,11 +150,11 @@ const W = F.div`
138
150
  productsToolbarName: N
139
151
  }
140
152
  ),
141
- /* @__PURE__ */ i(W, { limit: l, gap: C, children: /* @__PURE__ */ i(
153
+ /* @__PURE__ */ i(W, { limit: o, children: /* @__PURE__ */ i(
142
154
  O,
143
155
  {
144
156
  isLoading: k,
145
- limit: l,
157
+ limit: o,
146
158
  keyPrefix: "explore-landing",
147
159
  children: v
148
160
  }
@@ -1,4 +1,4 @@
1
- "use strict";const i=require("react/jsx-runtime"),n=require("react"),P=require("./emotion-styled.browser.esm-BtEseadx.cjs"),f=require("./consts-goSZX3xP.cjs"),v=require("./useDetectMobile-zkbzoOGV.cjs"),q=require("./Button.cjs"),b=require("./suspense-product-card-detailed-BJLmsTWB.cjs"),C=P.styled.div`
1
+ "use strict";const i=require("react/jsx-runtime"),n=require("react"),P=require("./emotion-styled.browser.esm-BtEseadx.cjs"),f=require("./consts-goSZX3xP.cjs"),v=require("./useDetectMobile-zkbzoOGV.cjs"),q=require("./Button.cjs"),b=require("./suspense-product-card-detailed-C7_tBl85.cjs"),C=P.styled.div`
2
2
  padding: 1.75rem 3rem;
3
3
  display: grid;
4
4
  grid-template-columns: ${t=>`repeat(${t.limit||5}, minmax(0, 1fr))`};
@@ -4,7 +4,7 @@ import { s as C } from "./emotion-styled.browser.esm-BNN1dTl3.js";
4
4
  import { M as L, S as F } from "./consts-BuFChS64.js";
5
5
  import { u as I } from "./useDetectMobile-Bkvj0VMa.js";
6
6
  import T from "./Button.js";
7
- import { D as _, S as D } from "./suspense-product-card-detailed-D6191kXr.js";
7
+ import { D as _, S as D } from "./suspense-product-card-detailed-DtTXmJJB.js";
8
8
  const E = C.div`
9
9
  padding: 1.75rem 3rem;
10
10
  display: grid;
@@ -0,0 +1,246 @@
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;
@@ -0,0 +1,539 @@
1
+ import { jsxs as n, jsx as e, Fragment as S } from "react/jsx-runtime";
2
+ import { forwardRef as z, useState as R, useRef as q, useEffect as de, Suspense as me } from "react";
3
+ import { p as pe, t as U, o as y, l as ge, q as Y, G as A, k as ue } from "./utils-BdsZgOUE.js";
4
+ import { s as k } from "./emotion-styled.browser.esm-BNN1dTl3.js";
5
+ import { P as he } from "./index-CF3HhgvN.js";
6
+ import N from "./Badge.js";
7
+ import fe from "./Popover.js";
8
+ import ve from "./PopoverTrigger.js";
9
+ import we from "./PopoverContent.js";
10
+ import { u as be } from "./useDetectMobile-Bkvj0VMa.js";
11
+ import { M as K } from "./consts-BuFChS64.js";
12
+ const L = k.div`
13
+ display: flex;
14
+ flex-direction: column;
15
+ gap: 0.5rem;
16
+ cursor: pointer;
17
+ overflow: hidden;
18
+ width: 100%;
19
+
20
+ & .wrapper-card-1 {
21
+ display: flex;
22
+ flex-direction: column;
23
+ gap: 0.38rem;
24
+ }
25
+
26
+ & .wrapper-card-2 {
27
+ display: flex;
28
+ flex-direction: column;
29
+ gap: 0;
30
+ }
31
+
32
+ & .wrapper-card-3 {
33
+ display: flex;
34
+ flex-wrap: wrap;
35
+ gap: 0.25rem;
36
+
37
+ & > div {
38
+ & > div {
39
+ width: 100% !important;
40
+ }
41
+ }
42
+ }
43
+
44
+ & .tag {
45
+ height: 1.5rem;
46
+ gap: 0.25rem;
47
+ padding: 0.25rem 0.375rem;
48
+ border-radius: 0.375rem;
49
+ background: #f9fafb;
50
+ border: 1px solid var(--gray-95012, #14161a1f);
51
+ font-weight: 400;
52
+ font-size: 0.75rem;
53
+ line-height: 1rem;
54
+ letter-spacing: 0.025rem;
55
+ color: var(--gray-950, #14161a);
56
+ white-space: nowrap;
57
+ flex: 0 0 auto;
58
+
59
+ &.tag-sponsored {
60
+ & i {
61
+ color: var(--yellow-500, #f59e0b);
62
+ }
63
+ }
64
+ }
65
+
66
+ & .tag-mobile {
67
+ font-weight: 400;
68
+ font-size: 0.75rem;
69
+ line-height: 1rem;
70
+ letter-spacing: 0.025rem;
71
+ color: var(--gray-600, #676e79);
72
+ }
73
+
74
+ & .card-title {
75
+ font-size: 0.875rem;
76
+ font-weight: 600;
77
+ ${pe(2)}
78
+ }
79
+
80
+ & .price-text {
81
+ font-size: 1rem;
82
+ font-weight: 600;
83
+ ${U()}
84
+ display: flex;
85
+ align-items: end;
86
+ gap: 0.5rem;
87
+ color: var(--gray-950, #14161a);
88
+
89
+ &.new-price {
90
+ color: var(--danger-600, #e11d48);
91
+ }
92
+
93
+ & .full-price {
94
+ text-decoration: line-through;
95
+ font-size: 0.75rem;
96
+ font-weight: 400;
97
+ padding-bottom: 0.125rem;
98
+ color: var(--gray-600, #676e79);
99
+ }
100
+ }
101
+
102
+ & .location-text {
103
+ font-size: 0.75rem;
104
+ font-weight: 400;
105
+ color: var(--gray-600, #676e79);
106
+ ${U()}
107
+ }
108
+
109
+ & .tags-wrapper {
110
+ display: flex;
111
+ gap: 0.5rem;
112
+ }
113
+
114
+ & .skeleton-img {
115
+ background-color: ${y("-90deg")};
116
+ border-radius: 0.75rem;
117
+ border: 1px solid white;
118
+ }
119
+
120
+ & .skeleton-title {
121
+ background-color: ${y("-90deg")};
122
+ width: 100%;
123
+ height: 2.5rem;
124
+ }
125
+
126
+ & .skeleton-tags {
127
+ background-color: ${y("-90deg")};
128
+ width: 80%;
129
+ height: 1.5rem;
130
+ }
131
+
132
+ & .skeleton-price {
133
+ background-color: ${y("-90deg")};
134
+ width: 50%;
135
+ height: 2.5rem;
136
+ }
137
+
138
+ & .skeleton-sponsored {
139
+ background-color: ${y("-90deg")};
140
+ width: 50%;
141
+ height: 1rem;
142
+ }
143
+
144
+ & .tags-popover__trigger {
145
+ display: flex;
146
+ gap: 0.25rem;
147
+ }
148
+
149
+ @media (max-width: ${K + "px"}) {
150
+ overflow: visible;
151
+
152
+ & .tags-popover__trigger {
153
+ flex-wrap: wrap;
154
+ }
155
+
156
+ & .price-text {
157
+ font-size: 0.875rem;
158
+ font-weight: 600;
159
+
160
+ & .full-price {
161
+ display: none;
162
+ }
163
+ }
164
+ }
165
+
166
+ &:hover .product-image-wrapper img {
167
+ transform: scale(1.1);
168
+ }
169
+ `, ye = k.div`
170
+ position: relative;
171
+ overflow: hidden;
172
+ border-radius: 0.75rem;
173
+ width: 100%;
174
+ aspect-ratio: 1 / 1;
175
+ border: 1px solid #0c15201f;
176
+
177
+ & img {
178
+ display: block;
179
+ width: 100%;
180
+ height: 100%;
181
+ object-fit: cover;
182
+ border-radius: 0.75rem;
183
+ transition: var(--transition, all 0.3s ease);
184
+ }
185
+
186
+ @media (max-width: ${K + "px"}) {
187
+ & img {
188
+ width: 8.875rem;
189
+ height: 8.875rem;
190
+ min-width: 8.875rem;
191
+ min-height: 8.875rem;
192
+ object-fit: cover;
193
+ }
194
+ }
195
+ `, _e = k.div`
196
+ background: var(--white, #fff);
197
+ z-index: 1;
198
+
199
+ border: 1px solid var(--gray-200, #dddfe4);
200
+ border-radius: 0.5rem;
201
+ line-height: 1rem;
202
+ position: absolute;
203
+ padding: 0.5rem 0.75rem;
204
+ top: 0.5rem;
205
+ left: 25%;
206
+ transform: translateX(-50%);
207
+ min-width: 13rem;
208
+
209
+ &::before,
210
+ &::after {
211
+ content: "";
212
+ position: absolute;
213
+ left: 50%;
214
+ transform: translateX(-50%);
215
+ border-style: solid;
216
+ border-width: 0.625rem;
217
+ }
218
+
219
+ &::after {
220
+ top: -1.1875rem;
221
+ border-color: transparent transparent var(--white, #fff) transparent;
222
+ }
223
+
224
+ &::before {
225
+ top: -1.25rem;
226
+ border-color: transparent transparent var(--gray-200, #dddfe4) transparent;
227
+ }
228
+
229
+ & .tags-popover__content {
230
+ display: flex;
231
+ flex-wrap: wrap;
232
+ flex-direction: column;
233
+ gap: 0.375rem;
234
+ font-size: 0.75rem;
235
+ font-weight: 400;
236
+
237
+ & .tags-popover__name {
238
+ color: var(--gray-600, #676e79);
239
+ }
240
+
241
+ & .tags-popover__value {
242
+ color: var(--gray-950, #14161a);
243
+ }
244
+ }
245
+ `, Ne = k.div`
246
+ display: flex;
247
+ align-items: center;
248
+ gap: 0.25rem;
249
+ color: var(--gray-500);
250
+ font-size: 0.75rem;
251
+ font-weight: 500;
252
+
253
+ & i {
254
+ font-size: 1rem;
255
+ color: var(--warning-500, #F59E0B);
256
+ }
257
+ `, ke = z(({ sponsoredText: d = "Sponsored" }, f) => /* @__PURE__ */ n(Ne, { ref: f, className: "sponsored-line", children: [
258
+ /* @__PURE__ */ e("i", { className: "mng-lnc-paw2" }),
259
+ /* @__PURE__ */ e("span", { children: d })
260
+ ] })), Ce = "Vehicles_Cars", Pe = "Vehicles_Motorcycles", $e = "Vehicles_Trucks", Te = "Vehicles_AgriculturalMachines_Tractors", Ve = "Vehicles_ConstructionMachines", Ee = "Vehicles_Bus", Oe = "Vehicles_Campers", Se = "RealEstates_", i = {
261
+ Mileage: {
262
+ icon: "mng-lnc-road",
263
+ measure: "km"
264
+ },
265
+ YearOfProduction: {
266
+ icon: "mng-lnc-calendar",
267
+ measure: ""
268
+ },
269
+ Fuel: {
270
+ icon: "mng-lnc-gas-station",
271
+ measure: ""
272
+ },
273
+ EnginePowerKW: {
274
+ icon: "mng-lnc-engine",
275
+ measure: "kW"
276
+ },
277
+ Transmission: {
278
+ icon: "mng-lnc-transmission",
279
+ measure: ""
280
+ },
281
+ Model: {
282
+ icon: "mng-lnc-application",
283
+ measure: ""
284
+ },
285
+ Brand: {
286
+ icon: "mng-lnc-car--front",
287
+ measure: ""
288
+ },
289
+ SurfaceArea: {
290
+ icon: "mng-lnc-right-angle",
291
+ measure: ""
292
+ },
293
+ Floor: {
294
+ icon: "mng-lnc-elevator",
295
+ measure: ""
296
+ },
297
+ FurnishedCondition: {
298
+ icon: "mng-lnc-sofa-01",
299
+ measure: ""
300
+ },
301
+ AdType: {
302
+ icon: "mng-lnc-notes",
303
+ measure: ""
304
+ },
305
+ NumberOfRooms: {
306
+ icon: "mng-lnc-meeting-room",
307
+ measure: ""
308
+ },
309
+ HeatingType: {
310
+ icon: "mng-lnc-heat",
311
+ measure: ""
312
+ },
313
+ AirConditioning: {
314
+ icon: "mng-lnc-air-conditioner",
315
+ measure: ""
316
+ },
317
+ Type: {
318
+ icon: "mng-lnc-house-building",
319
+ measure: ""
320
+ },
321
+ Parking: {
322
+ icon: "mng-lnc-parking-area-circle",
323
+ measure: ""
324
+ },
325
+ Internet: {
326
+ icon: "mng-lnc-wifi-02",
327
+ measure: ""
328
+ },
329
+ State: {
330
+ icon: "mng-lnc-settings-1",
331
+ measure: ""
332
+ },
333
+ NumberOfPremises: {
334
+ icon: "mng-lnc-meeting-room",
335
+ measure: ""
336
+ },
337
+ Pool: {
338
+ icon: "mng-lnc-pool",
339
+ measure: ""
340
+ },
341
+ Approach: {
342
+ icon: "mng-lnc-driveway",
343
+ measure: ""
344
+ },
345
+ NumberOfBeds: {
346
+ icon: "mng-lnc-bed",
347
+ measure: ""
348
+ },
349
+ Kitchen: {
350
+ icon: "mng-lnc-fridge",
351
+ measure: ""
352
+ },
353
+ BathroomToilet: {
354
+ icon: "mng-lnc-bath",
355
+ measure: ""
356
+ },
357
+ default: {
358
+ icon: " mng-lnc-clock--filled",
359
+ measure: ""
360
+ }
361
+ }, Ae = z((d, f) => {
362
+ const {
363
+ title: v,
364
+ price: w = 0,
365
+ sellingPrice: m,
366
+ currency: _,
367
+ isNegotiable: C,
368
+ isFree: P,
369
+ imageUrl: H,
370
+ location: Z,
371
+ sponsored: M,
372
+ imageComponent: W,
373
+ onSelectCard: J = () => {
374
+ },
375
+ freeText: Q = "Free",
376
+ negotiableText: x = "Negotiable",
377
+ tags: t = [],
378
+ categoryCode: $,
379
+ condition: T,
380
+ quantity: V,
381
+ trade: E,
382
+ sponsoredText: ee
383
+ } = d, O = be(), B = [
384
+ Ce,
385
+ Pe,
386
+ $e,
387
+ Te,
388
+ Ve,
389
+ Ee,
390
+ Oe,
391
+ Se
392
+ ].some(
393
+ (r) => $ == null ? void 0 : $.includes(r)
394
+ ), [re, F] = R(!1), oe = () => {
395
+ F(!0);
396
+ }, ne = () => {
397
+ F(!1);
398
+ }, s = q(null), g = q([]), [D, te] = R(t == null ? void 0 : t.length), ae = () => {
399
+ var u, c, b;
400
+ if (!(s != null && s.current) || ((u = g == null ? void 0 : g.current) == null ? void 0 : u.length) === 0) return;
401
+ const r = (c = s == null ? void 0 : s.current) == null ? void 0 : c.offsetWidth;
402
+ let o = 0, a = 0;
403
+ for (let l = 0; l < (t == null ? void 0 : t.length); l++) {
404
+ const h = ((b = g == null ? void 0 : g.current[l]) == null ? void 0 : b.offsetWidth) || 0, p = o + h + 4;
405
+ if (p <= r)
406
+ o += p, a++;
407
+ else
408
+ break;
409
+ }
410
+ te(a);
411
+ };
412
+ de(() => {
413
+ const r = s == null ? void 0 : s.current;
414
+ if (!r) return;
415
+ const o = new ResizeObserver(() => {
416
+ ae();
417
+ });
418
+ return o.observe(r), () => {
419
+ o.disconnect();
420
+ };
421
+ }, [t]);
422
+ const ie = () => {
423
+ var r;
424
+ return /* @__PURE__ */ e("div", { className: "tags-popover__trigger", children: (r = t == null ? void 0 : t.slice(0, D)) == null ? void 0 : r.map((o, a) => {
425
+ var h, p, j, G, X;
426
+ const u = ((h = i == null ? void 0 : i[o == null ? void 0 : o.code]) == null ? void 0 : h.icon) ?? ((p = i == null ? void 0 : i.default) == null ? void 0 : p.icon) ?? "", c = ((j = o == null ? void 0 : o.measurementUnit) == null ? void 0 : j.symbol) ?? ((G = i == null ? void 0 : i[o == null ? void 0 : o.code]) == null ? void 0 : G.measure) ?? "", l = [(o == null ? void 0 : o.value) ?? ((X = o == null ? void 0 : o.multiOptions) == null ? void 0 : X[0]) ?? "", c].filter(Boolean).join(" ");
427
+ return O ? /* @__PURE__ */ n("div", { className: "tag-mobile", children: [
428
+ l,
429
+ a < D - 1 ? " · " : ""
430
+ ] }) : /* @__PURE__ */ n(
431
+ N,
432
+ {
433
+ ref: (le) => g.current[a] = le,
434
+ className: `tag ${M ? "tag-sponsored" : ""}`,
435
+ children: [
436
+ /* @__PURE__ */ e("i", { className: u }),
437
+ l
438
+ ]
439
+ },
440
+ `detailed-products-section-tag__${a + 1}`
441
+ );
442
+ }) });
443
+ }, se = () => /* @__PURE__ */ e("div", { className: "tags-popover__content", children: t == null ? void 0 : t.map((r, o) => {
444
+ var l, h, p;
445
+ const a = ((l = r == null ? void 0 : r.measurementUnit) == null ? void 0 : l.symbol) ?? ((h = i == null ? void 0 : i[r == null ? void 0 : r.code]) == null ? void 0 : h.measure) ?? "", c = [(r == null ? void 0 : r.value) ?? ((p = r == null ? void 0 : r.multiOptions) == null ? void 0 : p[0]) ?? "", a].filter(Boolean).join(" "), b = r == null ? void 0 : r.name;
446
+ return /* @__PURE__ */ n("div", { children: [
447
+ /* @__PURE__ */ e("span", { className: "tags-popover__name", children: `${b}: ` }),
448
+ /* @__PURE__ */ e("span", { className: "tags-popover__value", children: c })
449
+ ] }, `detailed-products-section-tag-dropdown__${o + 1}`);
450
+ }) }), ce = () => {
451
+ var r;
452
+ if (O) {
453
+ const o = [T, V, E];
454
+ return (r = o == null ? void 0 : o.filter((a) => ue(a))) == null ? void 0 : r.map((a, u, c) => /* @__PURE__ */ n("div", { className: "tag-mobile", children: [
455
+ a,
456
+ u < (c == null ? void 0 : c.length) - 1 ? " · " : ""
457
+ ] }));
458
+ }
459
+ return /* @__PURE__ */ n(S, { children: [
460
+ T && /* @__PURE__ */ e(N, { className: "tag", children: T }, "detailed-products-section-tag__condition"),
461
+ V && /* @__PURE__ */ e(N, { className: "tag", children: V }, "detailed-products-section-tag__quantity"),
462
+ E && /* @__PURE__ */ e(N, { className: "tag", children: E }, "detailed-products-section-tag__trade")
463
+ ] });
464
+ }, I = w > 0 && _ && C !== !0 && P !== !0 && w !== m;
465
+ return (
466
+ // <LandingPageProductCardSkeleton />
467
+ /* @__PURE__ */ n(
468
+ L,
469
+ {
470
+ ref: s,
471
+ className: "product-card",
472
+ onClick: J,
473
+ children: [
474
+ /* @__PURE__ */ e(ye, { className: "product-image-wrapper", children: ge(W) ? W : /* @__PURE__ */ e(he, { src: H }) }),
475
+ /* @__PURE__ */ e("div", { className: "wrapper-card-1", children: /* @__PURE__ */ e("div", { className: "card-title", children: v }) }),
476
+ /* @__PURE__ */ n("div", { className: "wrapper-card-3", children: [
477
+ B && /* @__PURE__ */ e(
478
+ "div",
479
+ {
480
+ ...O ? {} : {
481
+ onMouseEnter: oe,
482
+ onMouseLeave: ne
483
+ },
484
+ children: /* @__PURE__ */ n(fe, { placement: "bottom", open: re, children: [
485
+ /* @__PURE__ */ e(ve, { children: ie() }),
486
+ /* @__PURE__ */ e(we, { style: { all: "unset" }, children: /* @__PURE__ */ e(_e, { children: se() }) })
487
+ ] })
488
+ }
489
+ ),
490
+ !B && ce()
491
+ ] }),
492
+ /* @__PURE__ */ n("div", { className: "wrapper-card-2", children: [
493
+ /* @__PURE__ */ n("div", { className: `price-text ${I ? "new-price" : ""}`, children: [
494
+ m > 0 && _ && C !== !0 && P !== !0 && /* @__PURE__ */ e("div", { children: `${Y(m)} ${A(_)}` }),
495
+ I && /* @__PURE__ */ e("div", { className: `${m > 0 ? "full-price" : ""}`, children: `${Y(w)} ${A(_)}` }),
496
+ C && x,
497
+ P && Q
498
+ ] }),
499
+ /* @__PURE__ */ e("div", { className: "location-text", children: Z })
500
+ ] }),
501
+ M === !0 && /* @__PURE__ */ e(ke, { sponsoredText: ee })
502
+ ]
503
+ }
504
+ )
505
+ );
506
+ }), ze = z(({}, d) => /* @__PURE__ */ n(L, { className: "product-card", children: [
507
+ /* @__PURE__ */ e("img", { className: "skeleton-img" }),
508
+ /* @__PURE__ */ n("div", { className: "wrapper-card-1", children: [
509
+ /* @__PURE__ */ e("div", { className: "skeleton-title" }),
510
+ /* @__PURE__ */ e("div", { className: "skeleton-tags" })
511
+ ] }),
512
+ /* @__PURE__ */ n("div", { className: "wrapper-card-1", children: [
513
+ /* @__PURE__ */ e("div", { className: "skeleton-price" }),
514
+ /* @__PURE__ */ e("div", { className: "skeleton-sponsored" })
515
+ ] })
516
+ ] })), Me = ({ limit: d = 5, isLoading: f = !1, keyPrefix: v }) => /* @__PURE__ */ e(S, { children: Array.from({ length: d }, (w, m) => /* @__PURE__ */ e(
517
+ ze,
518
+ {
519
+ isLoading: f
520
+ },
521
+ `${v}-skeleton-product-card-${m}`
522
+ )) }), Ke = ({
523
+ children: d,
524
+ fallbackComponent: f = /* @__PURE__ */ e(S, {}),
525
+ isLoading: v = !1,
526
+ limit: w,
527
+ keyPrefix: m
528
+ }) => /* @__PURE__ */ e(me, { fallbackComponent: f, children: v === !0 ? /* @__PURE__ */ e(
529
+ Me,
530
+ {
531
+ isLoading: v,
532
+ limit: w,
533
+ keyPrefix: m
534
+ }
535
+ ) : d });
536
+ export {
537
+ Ae as D,
538
+ Ke as S
539
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lanaco/lnc-react-ui",
3
- "version": "4.0.138",
3
+ "version": "4.0.140",
4
4
  "description": "React component library",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -1,131 +0,0 @@
1
- "use strict";const e=require("react/jsx-runtime"),c=require("react"),r=require("./utils-Dl9xPH4c.cjs"),p=require("./emotion-styled.browser.esm-BtEseadx.cjs"),k=require("./index-BueKsXT8.cjs"),u=require("./consts-goSZX3xP.cjs"),x=p.styled.div`
2
- display: flex;
3
- flex-direction: column;
4
- gap: 0.5rem;
5
- cursor: pointer;
6
-
7
- & .wrapper-card-1 {
8
- display: flex;
9
- flex-direction: column;
10
- gap: 0.38rem;
11
- }
12
-
13
- & .wrapper-card-2 {
14
- display: flex;
15
- flex-direction: column;
16
- gap: 0;
17
- }
18
-
19
- & .card-title {
20
- font-size: 0.875rem;
21
- font-weight: 600;
22
- ${r.truncateTextInRows(2)}
23
- }
24
-
25
- & .price-text {
26
- font-size: 1rem;
27
- font-weight: 600;
28
- ${r.truncateText()}
29
- display: flex;
30
- align-items: end;
31
- gap: 0.5rem;
32
- & .full-price {
33
- text-decoration: line-through;
34
- font-size: 0.75rem;
35
- font-weight: 400;
36
- padding-bottom: 0.125rem;
37
- color: var(--gray-600, #676e79);
38
- }
39
- }
40
-
41
- & .location-text {
42
- font-size: 0.75rem;
43
- font-weight: 400;
44
- color: var(--gray-600, #676e79);
45
- ${r.truncateText()}
46
- }
47
-
48
- & .tags-wrapper {
49
- display: flex;
50
- gap: 0.5rem;
51
- }
52
-
53
- & .skeleton-img {
54
- background-color: ${r.linearGradientAnimation("-90deg")};
55
- border-radius: 0.75rem;
56
- border: 1px solid white;
57
- }
58
-
59
- & .skeleton-title {
60
- background-color: ${r.linearGradientAnimation("-90deg")};
61
- width: 100%;
62
- height: 2.5rem;
63
- }
64
-
65
- & .skeleton-tags {
66
- background-color: ${r.linearGradientAnimation("-90deg")};
67
- width: 80%;
68
- height: 1.5rem;
69
- }
70
-
71
- & .skeleton-price {
72
- background-color: ${r.linearGradientAnimation("-90deg")};
73
- width: 50%;
74
- height: 2.5rem;
75
- }
76
-
77
- & .skeleton-sponsored {
78
- background-color: ${r.linearGradientAnimation("-90deg")};
79
- width: 50%;
80
- height: 1rem;
81
- }
82
-
83
- @media (max-width: ${u.MOBILE_SIZE_PX+"px"}) {
84
- & .price-text {
85
- font-size: 0.875rem;
86
- font-weight: 600;
87
- }
88
- }
89
-
90
- &:hover .product-image-wrapper img {
91
- transform: scale(1.1);
92
- }
93
- `,y=p.styled.div`
94
- position: relative;
95
- overflow: hidden;
96
- border-radius: 0.75rem;
97
- width: 100%;
98
- aspect-ratio: 1 / 1;
99
- border: 1px solid #0c15201f;
100
-
101
- & img {
102
- display: block;
103
- width: 100%;
104
- height: 100%;
105
- object-fit: cover;
106
- border-radius: 0.75rem;
107
- transition: var(--transition, all 0.3s ease);
108
- }
109
-
110
- @media (max-width: ${u.MOBILE_SIZE_PX+"px"}) {
111
- & img {
112
- width: 8.875rem;
113
- height: 8.875rem;
114
- min-width: 8.875rem;
115
- min-height: 8.875rem;
116
- object-fit: cover;
117
- }
118
- }
119
- `,N=p.styled.div`
120
- display: flex;
121
- align-items: center;
122
- gap: 0.25rem;
123
- color: var(--gray-500);
124
- font-size: 0.75rem;
125
- font-weight: 500;
126
-
127
- & i {
128
- font-size: 1rem;
129
- color: var(--warning-500, #F59E0B);
130
- }
131
- `,$=c.forwardRef(({sponsoredText:t="Sponsored"},s)=>e.jsxs(N,{ref:s,className:"sponsored-line",children:[e.jsx("i",{className:"mng-lnc-paw2"}),e.jsx("span",{children:t})]})),S=c.forwardRef((t,s)=>{const{uuid:a,title:o,price:i=0,sellingPrice:n,currency:d,isNegotiable:l,isFree:m,imageUrl:h,sellerUuid:G,location:f,isSponsored:w,imageComponent:g,onSelectCard:j=()=>{},freeText:v="Free",negotiableText:b="Negotiable"}=t;return e.jsxs(x,{className:"product-card",onClick:j,children:[e.jsx(y,{className:"product-image-wrapper",children:r.isDefined(g)?g:e.jsx(k.ProductImageWrapper,{src:h})}),e.jsx("div",{className:"wrapper-card-1",children:e.jsx("div",{className:"card-title",children:o})}),e.jsxs("div",{className:"wrapper-card-2",children:[e.jsxs("div",{className:"price-text",children:[n>0&&d&&l!==!0&&m!==!0&&e.jsx("div",{children:`${r.formatPrice(n)} ${r.GetCurrencySymbol(d)}`}),i>0&&d&&l!==!0&&m!==!0&&i!==n&&e.jsx("div",{className:`${n>0?"full-price":""}`,children:`${r.formatPrice(i)} ${r.GetCurrencySymbol(d)}`}),l&&b,m&&v]}),e.jsx("div",{className:"location-text",children:f})]}),w===!0&&e.jsx($,{})]})}),P=c.forwardRef(({},t)=>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"})]})]})),C=({limit:t=5,isLoading:s=!1,keyPrefix:a})=>e.jsx(e.Fragment,{children:Array.from({length:t},(o,i)=>e.jsx(P,{isLoading:s},`${a}-skeleton-product-card-${i}`))}),z=({children:t,fallbackComponent:s=e.jsx(e.Fragment,{}),isLoading:a=!1,limit:o,keyPrefix:i})=>e.jsx(c.Suspense,{fallbackComponent:s,children:a===!0?e.jsx(C,{isLoading:a,limit:o,keyPrefix:i}):t});exports.DetailedProductCard=S;exports.SuspenseDetailedProductCard=z;
@@ -1,209 +0,0 @@
1
- import { jsxs as i, jsx as e, Fragment as x } from "react/jsx-runtime";
2
- import { forwardRef as p, Suspense as z } from "react";
3
- import { p as C, t as f, o as s, l as D, q as u, G as w } from "./utils-BdsZgOUE.js";
4
- import { s as g } from "./emotion-styled.browser.esm-BNN1dTl3.js";
5
- import { P as I } from "./index-CF3HhgvN.js";
6
- import { M as v } from "./consts-BuFChS64.js";
7
- const k = g.div`
8
- display: flex;
9
- flex-direction: column;
10
- gap: 0.5rem;
11
- cursor: pointer;
12
-
13
- & .wrapper-card-1 {
14
- display: flex;
15
- flex-direction: column;
16
- gap: 0.38rem;
17
- }
18
-
19
- & .wrapper-card-2 {
20
- display: flex;
21
- flex-direction: column;
22
- gap: 0;
23
- }
24
-
25
- & .card-title {
26
- font-size: 0.875rem;
27
- font-weight: 600;
28
- ${C(2)}
29
- }
30
-
31
- & .price-text {
32
- font-size: 1rem;
33
- font-weight: 600;
34
- ${f()}
35
- display: flex;
36
- align-items: end;
37
- gap: 0.5rem;
38
- & .full-price {
39
- text-decoration: line-through;
40
- font-size: 0.75rem;
41
- font-weight: 400;
42
- padding-bottom: 0.125rem;
43
- color: var(--gray-600, #676e79);
44
- }
45
- }
46
-
47
- & .location-text {
48
- font-size: 0.75rem;
49
- font-weight: 400;
50
- color: var(--gray-600, #676e79);
51
- ${f()}
52
- }
53
-
54
- & .tags-wrapper {
55
- display: flex;
56
- gap: 0.5rem;
57
- }
58
-
59
- & .skeleton-img {
60
- background-color: ${s("-90deg")};
61
- border-radius: 0.75rem;
62
- border: 1px solid white;
63
- }
64
-
65
- & .skeleton-title {
66
- background-color: ${s("-90deg")};
67
- width: 100%;
68
- height: 2.5rem;
69
- }
70
-
71
- & .skeleton-tags {
72
- background-color: ${s("-90deg")};
73
- width: 80%;
74
- height: 1.5rem;
75
- }
76
-
77
- & .skeleton-price {
78
- background-color: ${s("-90deg")};
79
- width: 50%;
80
- height: 2.5rem;
81
- }
82
-
83
- & .skeleton-sponsored {
84
- background-color: ${s("-90deg")};
85
- width: 50%;
86
- height: 1rem;
87
- }
88
-
89
- @media (max-width: ${v + "px"}) {
90
- & .price-text {
91
- font-size: 0.875rem;
92
- font-weight: 600;
93
- }
94
- }
95
-
96
- &:hover .product-image-wrapper img {
97
- transform: scale(1.1);
98
- }
99
- `, j = g.div`
100
- position: relative;
101
- overflow: hidden;
102
- border-radius: 0.75rem;
103
- width: 100%;
104
- aspect-ratio: 1 / 1;
105
- border: 1px solid #0c15201f;
106
-
107
- & img {
108
- display: block;
109
- width: 100%;
110
- height: 100%;
111
- object-fit: cover;
112
- border-radius: 0.75rem;
113
- transition: var(--transition, all 0.3s ease);
114
- }
115
-
116
- @media (max-width: ${v + "px"}) {
117
- & img {
118
- width: 8.875rem;
119
- height: 8.875rem;
120
- min-width: 8.875rem;
121
- min-height: 8.875rem;
122
- object-fit: cover;
123
- }
124
- }
125
- `, F = g.div`
126
- display: flex;
127
- align-items: center;
128
- gap: 0.25rem;
129
- color: var(--gray-500);
130
- font-size: 0.75rem;
131
- font-weight: 500;
132
-
133
- & i {
134
- font-size: 1rem;
135
- color: var(--warning-500, #F59E0B);
136
- }
137
- `, T = p(({ sponsoredText: r = "Sponsored" }, a) => /* @__PURE__ */ i(F, { ref: a, className: "sponsored-line", children: [
138
- /* @__PURE__ */ e("i", { className: "mng-lnc-paw2" }),
139
- /* @__PURE__ */ e("span", { children: r })
140
- ] })), q = p((r, a) => {
141
- const {
142
- uuid: o,
143
- title: l,
144
- price: t = 0,
145
- sellingPrice: d,
146
- currency: n,
147
- isNegotiable: c,
148
- isFree: m,
149
- imageUrl: N,
150
- sellerUuid: G,
151
- location: b,
152
- isSponsored: $,
153
- imageComponent: h,
154
- onSelectCard: y = () => {
155
- },
156
- freeText: S = "Free",
157
- negotiableText: P = "Negotiable"
158
- } = r;
159
- return (
160
- // <LandingPageProductCardSkeleton />
161
- /* @__PURE__ */ i(k, { className: "product-card", onClick: y, children: [
162
- /* @__PURE__ */ e(j, { className: "product-image-wrapper", children: D(h) ? h : /* @__PURE__ */ e(I, { src: N }) }),
163
- /* @__PURE__ */ e("div", { className: "wrapper-card-1", children: /* @__PURE__ */ e("div", { className: "card-title", children: l }) }),
164
- /* @__PURE__ */ i("div", { className: "wrapper-card-2", children: [
165
- /* @__PURE__ */ i("div", { className: "price-text", children: [
166
- d > 0 && n && c !== !0 && m !== !0 && /* @__PURE__ */ e("div", { children: `${u(d)} ${w(n)}` }),
167
- t > 0 && n && c !== !0 && m !== !0 && t !== d && /* @__PURE__ */ e("div", { className: `${d > 0 ? "full-price" : ""}`, children: `${u(t)} ${w(n)}` }),
168
- c && P,
169
- m && S
170
- ] }),
171
- /* @__PURE__ */ e("div", { className: "location-text", children: b })
172
- ] }),
173
- $ === !0 && /* @__PURE__ */ e(T, {})
174
- ] })
175
- );
176
- }), W = p(({}, r) => /* @__PURE__ */ i(k, { className: "product-card", children: [
177
- /* @__PURE__ */ e("img", { className: "skeleton-img" }),
178
- /* @__PURE__ */ i("div", { className: "wrapper-card-1", children: [
179
- /* @__PURE__ */ e("div", { className: "skeleton-title" }),
180
- /* @__PURE__ */ e("div", { className: "skeleton-tags" })
181
- ] }),
182
- /* @__PURE__ */ i("div", { className: "wrapper-card-1", children: [
183
- /* @__PURE__ */ e("div", { className: "skeleton-price" }),
184
- /* @__PURE__ */ e("div", { className: "skeleton-sponsored" })
185
- ] })
186
- ] })), E = ({ limit: r = 5, isLoading: a = !1, keyPrefix: o }) => /* @__PURE__ */ e(x, { children: Array.from({ length: r }, (l, t) => /* @__PURE__ */ e(
187
- W,
188
- {
189
- isLoading: a
190
- },
191
- `${o}-skeleton-product-card-${t}`
192
- )) }), L = ({
193
- children: r,
194
- fallbackComponent: a = /* @__PURE__ */ e(x, {}),
195
- isLoading: o = !1,
196
- limit: l,
197
- keyPrefix: t
198
- }) => /* @__PURE__ */ e(z, { fallbackComponent: a, children: o === !0 ? /* @__PURE__ */ e(
199
- E,
200
- {
201
- isLoading: o,
202
- limit: l,
203
- keyPrefix: t
204
- }
205
- ) : r });
206
- export {
207
- q as D,
208
- L as S
209
- };