@lanaco/lnc-react-ui 4.0.193 → 4.0.194

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"),E=require("./emotion-styled.browser.esm-BtEseadx.cjs"),I=require("./consts-goSZX3xP.cjs"),L=require("./IconButton.cjs"),T=require("./Button.cjs"),n=require("./utils-RnrgDDZP.cjs"),z=require("./useDetectMobile-zkbzoOGV.cjs"),g=require("./index-Lmz3An4A.cjs"),R=E.styled.div`
1
+ "use strict";const t=require("react/jsx-runtime"),c=require("react"),f=require("./emotion-styled.browser.esm-BtEseadx.cjs"),Q=require("./consts-goSZX3xP.cjs"),G=require("./IconButton.cjs"),W=require("./Button.cjs"),a=require("./utils-RnrgDDZP.cjs"),X=require("./useDetectMobile-zkbzoOGV.cjs"),b=require("./index-Lmz3An4A.cjs"),Z=require("./index-CSNxZFTX.cjs"),l=require("./style-BAcV7F53.cjs"),H=f.styled.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  gap: 1.5rem;
@@ -21,9 +21,18 @@
21
21
  }
22
22
  }
23
23
 
24
+ & .section__options {
25
+ & button {
26
+ &:focus {
27
+ outline: none;
28
+ outline-offset: 0;
29
+ }
30
+ }
31
+ }
32
+
24
33
  & .section__items {
25
34
  display: grid;
26
- grid-template-columns: ${r=>`repeat(${r.limit}, minmax(0, 1fr))`};
35
+ grid-template-columns: ${o=>`repeat(${o.limit}, minmax(0, 1fr))`};
27
36
  gap: 2rem;
28
37
  }
29
38
 
@@ -47,7 +56,7 @@
47
56
  white-space: nowrap;
48
57
  }
49
58
 
50
- @media (max-width: ${I.MOBILE_SIZE_PX+"px"}) {
59
+ @media (max-width: ${Q.MOBILE_SIZE_PX+"px"}) {
51
60
  gap: 1.25rem;
52
61
 
53
62
  & .section__items {
@@ -70,4 +79,4 @@
70
79
  }
71
80
  }
72
81
  }
73
- `,U=a.memo(g.DetailedProductCard),A=a.forwardRef((r,p)=>{const{title:l,icon:c,items:i,limit:f=4,isLoading:s=!1,onSelectCard:b=()=>{},onLoadMore:h=()=>{},onButtonAction:w=()=>{},getImage:y=()=>{},viewAllbuttonLink:d,viewAllButonText:m="View all",negotiableText:_,freeText:k,loadMoreButtonIcon:v="angle-down",sponsoredText:S,onBookmark:C=()=>{},actionComponent:N,componentName:P,hasNextPage:j=!1,LinkComponent:q,urgentText:D}=r,u=z.useDetectMobile(),M=a.useMemo(()=>i==null?void 0:i.map((e,o)=>t.jsx(U,{name: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,sponsored:e==null?void 0:e.sponsored,imageComponent:e==null?void 0:e.imageComponent,onSelectCard:(F,B)=>b({uuid:e==null?void 0:e.uuid,nameSlug:e==null?void 0:e.nameSlug,cardRef:B}),nameSlug:e==null?void 0:e.nameSlug,imageUrl:y(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:_,freeText:k,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,hasQuantities:e==null?void 0:e.hasQuantities,status:e==null?void 0:e.status,trade:e==null?void 0:e.trade,sponsoredText:S,onBookmark:C,actionComponent:N,bookmarked:e==null?void 0:e.bookmarked,bookmarkLists:e==null?void 0:e.bookmarkLists,metadata:{accessor:e==null?void 0:e.accessor,name:P},sellerName:e==null?void 0:e.sellerName,forCart:e==null?void 0:e.forCart,forOrder:e==null?void 0:e.forOrder,contactSeller:e==null?void 0:e.contactSeller,hasVariants:e==null?void 0:e.hasVariants,LinkComponent:q,activeSalesPackages:e==null?void 0:e.activeSalesPackages,urgentText:D},o)),[i]);return t.jsxs(R,{ref:p,limit:f,children:[t.jsxs("div",{className:"section__heading",children:[n.isDefinedNotEmptyString(l)&&t.jsxs("div",{className:"section__title",children:[n.isDefinedNotEmptyString(c)&&t.jsx("i",{className:c})," ",l]}),u&&n.isDefinedNotEmptyString(d)&&n.isDefinedNotEmptyString(m)&&!s&&t.jsx(T,{type:"button",btnType:"tinted",color:"neutral",onClick:e=>{var o;(o=e==null?void 0:e.target)==null||o.blur(),w(d)},borderRadius:"curved",className:"section__view-all",children:m})]}),t.jsx(g.SuspenseDetailedProductCard,{isLoading:s,keyPrefix:"detailed-product-card-skeleton",children:t.jsx("div",{className:"section__items",children:M})}),!u&&!s&&j&&t.jsx(L,{icon:v,borderRadius:"curved",btnType:"basic",color:"neutral",className:"section__show-more",onClick:h})]})});module.exports=A;
82
+ `,J=f.styled(l.SkeletonRowWrapper)``,Y=({keyPrefix:o})=>t.jsxs(J,{children:[t.jsx(l.SkeletonLinePlaceholder,{width:"5rem",borderRadius:"0.75rem"},`${o}-1`),t.jsx(l.SkeletonLinePlaceholder,{width:"5rem",borderRadius:"0.75rem"},`${o}-2`),t.jsx(l.SkeletonLinePlaceholder,{width:"5rem",borderRadius:"0.75rem"},`${o}-3`)]}),x=({keyPrefix:o,isLoading:d=!1,fallbackComponent:n=t.jsx(t.Fragment,{}),children:i})=>t.jsx(c.Suspense,{fallbackComponent:n,children:d===!0?t.jsx(Y,{keyPrefix:o}):i}),ee=c.memo(b.DetailedProductCard),te=c.forwardRef((o,d)=>{const{title:n,icon:i,items:r,limit:h=4,isLoading:u=!1,onSelectCard:S=()=>{},onLoadMore:w=()=>{},onButtonAction:_=()=>{},getImage:y=()=>{},viewAllbuttonLink:m,viewAllButonText:p="View all",negotiableText:k,freeText:v,loadMoreButtonIcon:j="angle-down",sponsoredText:C,onBookmark:N=()=>{},actionComponent:L,componentName:q,hasNextPage:P=!1,LinkComponent:B,urgentText:R,options:O=[],isLoadingOptions:D=!1,selectedOption:M,onSelectOption:E=()=>{},onRemoveOption:I=()=>{},allOptionsEnabled:T=!1,allOptionsLabel:$="All",onSelectAllOptions:A=()=>{},optionLabel:z="label",optionValue:F="value",optionCode:U="code"}=o,g=X.useDetectMobile(),V=c.useMemo(()=>r==null?void 0:r.map((e,s)=>t.jsx(ee,{name: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,sponsored:e==null?void 0:e.sponsored,imageComponent:e==null?void 0:e.imageComponent,onSelectCard:(oe,K)=>S({uuid:e==null?void 0:e.uuid,nameSlug:e==null?void 0:e.nameSlug,cardRef:K}),nameSlug:e==null?void 0:e.nameSlug,imageUrl:y(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:k,freeText:v,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,hasQuantities:e==null?void 0:e.hasQuantities,status:e==null?void 0:e.status,trade:e==null?void 0:e.trade,sponsoredText:C,onBookmark:N,actionComponent:L,bookmarked:e==null?void 0:e.bookmarked,bookmarkLists:e==null?void 0:e.bookmarkLists,metadata:{accessor:e==null?void 0:e.accessor,name:q},sellerName:e==null?void 0:e.sellerName,forCart:e==null?void 0:e.forCart,forOrder:e==null?void 0:e.forOrder,contactSeller:e==null?void 0:e.contactSeller,hasVariants:e==null?void 0:e.hasVariants,LinkComponent:B,activeSalesPackages:e==null?void 0:e.activeSalesPackages,urgentText:R},s)),[r]);return t.jsxs(H,{ref:d,limit:h,children:[t.jsxs("div",{className:"section__heading",children:[a.isDefinedNotEmptyString(n)&&t.jsxs("div",{className:"section__title",children:[a.isDefinedNotEmptyString(i)&&t.jsx("i",{className:i})," ",n]}),g&&a.isDefinedNotEmptyString(m)&&a.isDefinedNotEmptyString(p)&&!u&&t.jsx(W,{type:"button",btnType:"tinted",color:"neutral",onClick:e=>{var s;(s=e==null?void 0:e.target)==null||s.blur(),_(m)},borderRadius:"curved",className:"section__view-all",children:p})]}),t.jsx(x,{isLoading:D,children:t.jsx(Z.SelectBar,{items:O,selectedIds:M,onRemove:I,onSelect:E,allButton:T,onSelectAll:A,labelKey:z,valueKey:F,codeKey:U,noMargin:!0,productsToolbarName:$,noGradient:!0,className:"section__options"})}),t.jsx(b.SuspenseDetailedProductCard,{isLoading:u,keyPrefix:"detailed-product-card-skeleton",children:t.jsx("div",{className:"section__items",children:V})}),!g&&!u&&P&&t.jsx(G,{icon:j,borderRadius:"curved",btnType:"basic",color:"neutral",className:"section__show-more",onClick:w})]})});module.exports=te;
@@ -1,13 +1,15 @@
1
- import { jsx as t, jsxs as s } from "react/jsx-runtime";
2
- import { memo as D, forwardRef as I, useMemo as z } from "react";
3
- import { s as E } from "./emotion-styled.browser.esm-BNN1dTl3.js";
4
- import { M as U } from "./consts-BuFChS64.js";
5
- import $ from "./IconButton.js";
6
- import j from "./Button.js";
7
- import { k as r } from "./utils-Dc5zIpaz.js";
8
- import { u as A } from "./useDetectMobile-Bkvj0VMa.js";
9
- import { D as F, S as O } from "./index-DqBXIFsQ.js";
10
- const R = E.div`
1
+ import { jsxs as s, jsx as o, Fragment as q } from "react/jsx-runtime";
2
+ import { Suspense as Q, memo as G, forwardRef as W, useMemo as X } from "react";
3
+ import { s as f } from "./emotion-styled.browser.esm-BNN1dTl3.js";
4
+ import { M as Z } from "./consts-BuFChS64.js";
5
+ import H from "./IconButton.js";
6
+ import J from "./Button.js";
7
+ import { k as l } from "./utils-Dc5zIpaz.js";
8
+ import { u as Y } from "./useDetectMobile-Bkvj0VMa.js";
9
+ import { D as x, S as ee } from "./index-DqBXIFsQ.js";
10
+ import { S as oe } from "./index-BGiZlEQt.js";
11
+ import { a as te, b as m } from "./style-CXMUA6cI.js";
12
+ const ie = f.div`
11
13
  display: flex;
12
14
  flex-direction: column;
13
15
  gap: 1.5rem;
@@ -30,9 +32,18 @@ const R = E.div`
30
32
  }
31
33
  }
32
34
 
35
+ & .section__options {
36
+ & button {
37
+ &:focus {
38
+ outline: none;
39
+ outline-offset: 0;
40
+ }
41
+ }
42
+ }
43
+
33
44
  & .section__items {
34
45
  display: grid;
35
- grid-template-columns: ${(a) => `repeat(${a.limit}, minmax(0, 1fr))`};
46
+ grid-template-columns: ${(t) => `repeat(${t.limit}, minmax(0, 1fr))`};
36
47
  gap: 2rem;
37
48
  }
38
49
 
@@ -56,7 +67,7 @@ const R = E.div`
56
67
  white-space: nowrap;
57
68
  }
58
69
 
59
- @media (max-width: ${U + "px"}) {
70
+ @media (max-width: ${Z + "px"}) {
60
71
  gap: 1.25rem;
61
72
 
62
73
  & .section__items {
@@ -79,36 +90,80 @@ const R = E.div`
79
90
  }
80
91
  }
81
92
  }
82
- `, V = D(F), x = I((a, p) => {
93
+ `, ne = f(te)``, re = ({ keyPrefix: t }) => /* @__PURE__ */ s(ne, { children: [
94
+ /* @__PURE__ */ o(
95
+ m,
96
+ {
97
+ width: "5rem",
98
+ borderRadius: "0.75rem"
99
+ },
100
+ `${t}-1`
101
+ ),
102
+ /* @__PURE__ */ o(
103
+ m,
104
+ {
105
+ width: "5rem",
106
+ borderRadius: "0.75rem"
107
+ },
108
+ `${t}-2`
109
+ ),
110
+ /* @__PURE__ */ o(
111
+ m,
112
+ {
113
+ width: "5rem",
114
+ borderRadius: "0.75rem"
115
+ },
116
+ `${t}-3`
117
+ )
118
+ ] }), ae = ({
119
+ keyPrefix: t,
120
+ isLoading: c = !1,
121
+ fallbackComponent: i = /* @__PURE__ */ o(q, {}),
122
+ children: n
123
+ }) => /* @__PURE__ */ o(Q, { fallbackComponent: i, children: c === !0 ? /* @__PURE__ */ o(re, { keyPrefix: t }) : n }), le = G(x), _e = W((t, c) => {
83
124
  const {
84
- title: l,
85
- icon: c,
86
- items: o,
87
- limit: g = 4,
88
- isLoading: n = !1,
89
- onSelectCard: f = () => {
125
+ title: i,
126
+ icon: n,
127
+ items: r,
128
+ limit: b = 4,
129
+ isLoading: d = !1,
130
+ onSelectCard: h = () => {
90
131
  },
91
- onLoadMore: h = () => {
132
+ onLoadMore: w = () => {
92
133
  },
93
- onButtonAction: b = () => {
134
+ onButtonAction: S = () => {
94
135
  },
95
- getImage: w = () => {
136
+ getImage: _ = () => {
96
137
  },
97
- viewAllbuttonLink: m,
98
- viewAllButonText: d = "View all",
99
- negotiableText: _,
100
- freeText: k,
138
+ viewAllbuttonLink: u,
139
+ viewAllButonText: p = "View all",
140
+ negotiableText: k,
141
+ freeText: v,
101
142
  loadMoreButtonIcon: y = "angle-down",
102
- sponsoredText: v,
103
- onBookmark: C = () => {
143
+ sponsoredText: C,
144
+ onBookmark: N = () => {
104
145
  },
105
- actionComponent: S,
106
- componentName: N,
146
+ actionComponent: L,
147
+ componentName: B,
107
148
  hasNextPage: P = !1,
108
- LinkComponent: M,
109
- urgentText: B
110
- } = a, u = A(), L = z(() => o == null ? void 0 : o.map((e, i) => /* @__PURE__ */ t(
111
- V,
149
+ LinkComponent: O,
150
+ urgentText: M,
151
+ options: R = [],
152
+ isLoadingOptions: T = !1,
153
+ selectedOption: $,
154
+ onSelectOption: I = () => {
155
+ },
156
+ onRemoveOption: A = () => {
157
+ },
158
+ allOptionsEnabled: D = !1,
159
+ allOptionsLabel: z = "All",
160
+ onSelectAllOptions: E = () => {
161
+ },
162
+ optionLabel: F = "label",
163
+ optionValue: U = "value",
164
+ optionCode: V = "code"
165
+ } = t, g = Y(), j = X(() => r == null ? void 0 : r.map((e, a) => /* @__PURE__ */ o(
166
+ le,
112
167
  {
113
168
  name: e == null ? void 0 : e.name,
114
169
  price: e == null ? void 0 : e.price,
@@ -119,13 +174,13 @@ const R = E.div`
119
174
  uuid: e == null ? void 0 : e.uuid,
120
175
  sponsored: e == null ? void 0 : e.sponsored,
121
176
  imageComponent: e == null ? void 0 : e.imageComponent,
122
- onSelectCard: (q, T) => f({ uuid: e == null ? void 0 : e.uuid, nameSlug: e == null ? void 0 : e.nameSlug, cardRef: T }),
177
+ onSelectCard: (se, K) => h({ uuid: e == null ? void 0 : e.uuid, nameSlug: e == null ? void 0 : e.nameSlug, cardRef: K }),
123
178
  nameSlug: e == null ? void 0 : e.nameSlug,
124
- imageUrl: w(e == null ? void 0 : e.image, e == null ? void 0 : e.uuid, e == null ? void 0 : e.sellerUuid) || null,
179
+ imageUrl: _(e == null ? void 0 : e.image, e == null ? void 0 : e.uuid, e == null ? void 0 : e.sellerUuid) || null,
125
180
  isFree: e == null ? void 0 : e.isFree,
126
181
  isNegotiable: e == null ? void 0 : e.isNegotiable,
127
- negotiableText: _,
128
- freeText: k,
182
+ negotiableText: k,
183
+ freeText: v,
129
184
  tags: e == null ? void 0 : e.tags,
130
185
  categoryCode: e == null ? void 0 : e.categoryCode,
131
186
  condition: e == null ? void 0 : e.condition,
@@ -133,67 +188,85 @@ const R = E.div`
133
188
  hasQuantities: e == null ? void 0 : e.hasQuantities,
134
189
  status: e == null ? void 0 : e.status,
135
190
  trade: e == null ? void 0 : e.trade,
136
- sponsoredText: v,
137
- onBookmark: C,
138
- actionComponent: S,
191
+ sponsoredText: C,
192
+ onBookmark: N,
193
+ actionComponent: L,
139
194
  bookmarked: e == null ? void 0 : e.bookmarked,
140
195
  bookmarkLists: e == null ? void 0 : e.bookmarkLists,
141
- metadata: { accessor: e == null ? void 0 : e.accessor, name: N },
196
+ metadata: { accessor: e == null ? void 0 : e.accessor, name: B },
142
197
  sellerName: e == null ? void 0 : e.sellerName,
143
198
  forCart: e == null ? void 0 : e.forCart,
144
199
  forOrder: e == null ? void 0 : e.forOrder,
145
200
  contactSeller: e == null ? void 0 : e.contactSeller,
146
201
  hasVariants: e == null ? void 0 : e.hasVariants,
147
- LinkComponent: M,
202
+ LinkComponent: O,
148
203
  activeSalesPackages: e == null ? void 0 : e.activeSalesPackages,
149
- urgentText: B
204
+ urgentText: M
150
205
  },
151
- i
152
- )), [o]);
153
- return /* @__PURE__ */ s(R, { ref: p, limit: g, children: [
206
+ a
207
+ )), [r]);
208
+ return /* @__PURE__ */ s(ie, { ref: c, limit: b, children: [
154
209
  /* @__PURE__ */ s("div", { className: "section__heading", children: [
155
- r(l) && /* @__PURE__ */ s("div", { className: "section__title", children: [
156
- r(c) && /* @__PURE__ */ t("i", { className: c }),
210
+ l(i) && /* @__PURE__ */ s("div", { className: "section__title", children: [
211
+ l(n) && /* @__PURE__ */ o("i", { className: n }),
157
212
  " ",
158
- l
213
+ i
159
214
  ] }),
160
- u && r(m) && r(d) && !n && /* @__PURE__ */ t(
161
- j,
215
+ g && l(u) && l(p) && !d && /* @__PURE__ */ o(
216
+ J,
162
217
  {
163
218
  type: "button",
164
219
  btnType: "tinted",
165
220
  color: "neutral",
166
221
  onClick: (e) => {
167
- var i;
168
- (i = e == null ? void 0 : e.target) == null || i.blur(), b(m);
222
+ var a;
223
+ (a = e == null ? void 0 : e.target) == null || a.blur(), S(u);
169
224
  },
170
225
  borderRadius: "curved",
171
226
  className: "section__view-all",
172
- children: d
227
+ children: p
173
228
  }
174
229
  )
175
230
  ] }),
176
- /* @__PURE__ */ t(
177
- O,
231
+ /* @__PURE__ */ o(ae, { isLoading: T, children: /* @__PURE__ */ o(
232
+ oe,
233
+ {
234
+ items: R,
235
+ selectedIds: $,
236
+ onRemove: A,
237
+ onSelect: I,
238
+ allButton: D,
239
+ onSelectAll: E,
240
+ labelKey: F,
241
+ valueKey: U,
242
+ codeKey: V,
243
+ noMargin: !0,
244
+ productsToolbarName: z,
245
+ noGradient: !0,
246
+ className: "section__options"
247
+ }
248
+ ) }),
249
+ /* @__PURE__ */ o(
250
+ ee,
178
251
  {
179
- isLoading: n,
252
+ isLoading: d,
180
253
  keyPrefix: "detailed-product-card-skeleton",
181
- children: /* @__PURE__ */ t("div", { className: "section__items", children: L })
254
+ children: /* @__PURE__ */ o("div", { className: "section__items", children: j })
182
255
  }
183
256
  ),
184
- !u && !n && P && /* @__PURE__ */ t(
185
- $,
257
+ !g && !d && P && /* @__PURE__ */ o(
258
+ H,
186
259
  {
187
260
  icon: y,
188
261
  borderRadius: "curved",
189
262
  btnType: "basic",
190
263
  color: "neutral",
191
264
  className: "section__show-more",
192
- onClick: h
265
+ onClick: w
193
266
  }
194
267
  )
195
268
  ] });
196
269
  });
197
270
  export {
198
- x as default
271
+ _e as default
199
272
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lanaco/lnc-react-ui",
3
- "version": "4.0.193",
3
+ "version": "4.0.194",
4
4
  "description": "React component library",
5
5
  "type": "module",
6
6
  "keywords": [