@lanaco/lnc-react-ui 4.0.209 → 4.0.210

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 +1 @@
1
- "use strict";const i=require("react/jsx-runtime"),o=require("react"),q=require("./useDetectMobile-DYV6V1yw.cjs"),_=require("./index-CUaeb_TU.cjs"),f=require("./Button.cjs"),j=require("./style-AYc9hnFj.cjs"),w=o.memo(_.ShopCard),M=o.forwardRef(({buttonText:u,buttonLink:a,items:r,onButtonAction:c=()=>{},onSelectCard:s=()=>{},isLoading:v=!1,limit:R=4,getImage:n=()=>{},isHighlight:l=!1,componentName:d},p)=>{const h=q.useDetectMobile(),m=o.useMemo(()=>{var t;return(t=r==null?void 0:r.slice(0,4))==null?void 0:t.map((e,g)=>i.jsx(w,{uuid:e==null?void 0:e.uuid,title:e==null?void 0:e.name,subtitle:e==null?void 0:e.shortDescription,rating:e==null?void 0:e.rating,reviewCount:e==null?void 0:e.reviewCount,onSelectCard:(C,b)=>s==null?void 0:s(e==null?void 0:e.uuid,b),image:n(e==null?void 0:e.profileImage,e==null?void 0:e.uuid)||null,hideProducts:!0,metadata:{name:d,accessor:e==null?void 0:e.accessor}},`shop-card__${g+1}`))},[r]);return i.jsxs(j.Wrapper,{ref:p,className:l?"highlight":"",children:[i.jsx("div",{className:"wrapper__grid",children:m}),i.jsx(f,{text:u,borderRadius:"curved",btnType:h?"basic":"outline",color:"neutral",className:"wrapper__action",onClick:()=>c(a)})]})});module.exports=M;
1
+ "use strict";const i=require("react/jsx-runtime"),o=require("react"),q=require("./useDetectMobile-DYV6V1yw.cjs"),_=require("./index-B1-PjbTA.cjs"),f=require("./Button.cjs"),j=require("./style-AYc9hnFj.cjs"),w=o.memo(_.ShopCard),M=o.forwardRef(({buttonText:u,buttonLink:a,items:r,onButtonAction:c=()=>{},onSelectCard:s=()=>{},isLoading:v=!1,limit:R=4,getImage:n=()=>{},isHighlight:l=!1,componentName:d},p)=>{const h=q.useDetectMobile(),m=o.useMemo(()=>{var t;return(t=r==null?void 0:r.slice(0,4))==null?void 0:t.map((e,g)=>i.jsx(w,{uuid:e==null?void 0:e.uuid,title:e==null?void 0:e.name,subtitle:e==null?void 0:e.shortDescription,rating:e==null?void 0:e.rating,reviewCount:e==null?void 0:e.reviewCount,onSelectCard:(C,b)=>s==null?void 0:s(e==null?void 0:e.uuid,b),image:n(e==null?void 0:e.profileImage,e==null?void 0:e.uuid)||null,hideProducts:!0,metadata:{name:d,accessor:e==null?void 0:e.accessor}},`shop-card__${g+1}`))},[r]);return i.jsxs(j.Wrapper,{ref:p,className:l?"highlight":"",children:[i.jsx("div",{className:"wrapper__grid",children:m}),i.jsx(f,{text:u,borderRadius:"curved",btnType:h?"basic":"outline",color:"neutral",className:"wrapper__action",onClick:()=>c(a)})]})});module.exports=M;
@@ -1,7 +1,7 @@
1
1
  import { jsx as i, jsxs as g } from "react/jsx-runtime";
2
2
  import { memo as b, forwardRef as _, useMemo as w } from "react";
3
3
  import { u as v } from "./useDetectMobile-CcVo3PNi.js";
4
- import { S as M } from "./index-yARaIaLj.js";
4
+ import { S as M } from "./index-BEUk0FDk.js";
5
5
  import C from "./Button.js";
6
6
  import { W as N } from "./style-Bq3rMbnN.js";
7
7
  const S = b(M), L = _(
@@ -1,4 +1,4 @@
1
- "use strict";const t=require("react/jsx-runtime"),g=require("react"),h=require("./Button.cjs"),$=require("./index-CUaeb_TU.cjs"),R=require("./utils-CITgSxXe.cjs"),f=require("./emotion-styled.browser.esm-BtEseadx.cjs"),p=require("./breakpoints-CcVm-gVm.cjs"),s=require("./style-BAcV7F53.cjs"),N=f.styled.div`
1
+ "use strict";const t=require("react/jsx-runtime"),g=require("react"),h=require("./Button.cjs"),$=require("./index-B1-PjbTA.cjs"),R=require("./utils-CITgSxXe.cjs"),f=require("./emotion-styled.browser.esm-BtEseadx.cjs"),p=require("./breakpoints-CcVm-gVm.cjs"),s=require("./style-BAcV7F53.cjs"),N=f.styled.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  align-items: flex-start;
@@ -1,7 +1,7 @@
1
1
  import { jsxs as l, jsx as r, Fragment as N } from "react/jsx-runtime";
2
2
  import { Suspense as R, forwardRef as j } from "react";
3
3
  import u from "./Button.js";
4
- import { S as z } from "./index-yARaIaLj.js";
4
+ import { S as z } from "./index-BEUk0FDk.js";
5
5
  import { l as M } from "./utils-B2fsQ6PS.js";
6
6
  import { s as g } from "./emotion-styled.browser.esm-BNN1dTl3.js";
7
7
  import { d as m } from "./breakpoints-ff0SIcV3.js";
@@ -1,4 +1,4 @@
1
- "use strict";const r=require("react/jsx-runtime"),t=require("react"),x=require("./Icon.cjs"),o=require("./utils-CITgSxXe.cjs"),$=require("./emotion-styled.browser.esm-BtEseadx.cjs"),R=require("./breakpoints-CcVm-gVm.cjs"),f=require("./ShopAvatar-CV3lj34D.cjs"),k=require("./index-DsINTjQk.cjs"),D=$.styled.a`
1
+ "use strict";const r=require("react/jsx-runtime"),l=require("react"),x=require("./Icon.cjs"),o=require("./utils-CITgSxXe.cjs"),$=require("./emotion-styled.browser.esm-BtEseadx.cjs"),R=require("./breakpoints-CcVm-gVm.cjs"),d=require("./ShopAvatar-CV3lj34D.cjs"),k=require("./index-DsINTjQk.cjs"),D=$.styled.a`
2
2
  text-decoration: none;
3
3
  color: var(--gray-950);
4
4
  display: flex;
@@ -119,6 +119,10 @@
119
119
  border-radius: 0 0 1.25rem 0;
120
120
  }
121
121
 
122
+ &:only-child {
123
+ border-radius: 0 0 1.25rem 1.25rem;
124
+ }
125
+
122
126
  & .product__image {
123
127
  width: 100%;
124
128
  aspect-ratio: 1 / 1;
@@ -139,4 +143,4 @@
139
143
  }
140
144
  }
141
145
  }
142
- `,E=t.forwardRef(({uuid:c,image:p,imageComponent:g,title:w,subtitle:d,badges:v,rating:y,reviewCount:m,products:l,onSelectCard:j=()=>{},getProductImage:b=()=>{},canAcceptPayments:N,hideProducts:S=!1,showRating:q=!0,metadata:i={},LinkComponent:_},I)=>{const u=_||"a",s=t.useRef(),h=t.useRef();return t.useEffect(()=>{var n;const e=a=>{a.target.src=f.DefaultShopImage,a.onerror=null};return(n=s==null?void 0:s.current)==null||n.addEventListener("error",e),()=>{var a;(a=s==null?void 0:s.current)==null||a.removeEventListener("error",e)}},[]),r.jsxs(D,{ref:h,name:i==null?void 0:i.name,"data-accessor":i==null?void 0:i.accessor,onClick:e=>j(e,h),as:u,..._?{to:`/shop/${c}`}:{href:`/shop/${c}`},children:[r.jsxs("div",{className:"wrapper__content",children:[o.isDefined(g)?g:p?r.jsx("img",{ref:s,src:p,className:"wrapper__image"}):r.jsx("img",{src:f.DefaultShopImage,className:"wrapper__image"}),r.jsxs("div",{className:"wrapper__info",children:[r.jsxs("div",{className:"wrapper__title",children:[w," ",N&&r.jsx(x,{color:"secondary",icon:"credit-card",className:"card"})]}),r.jsx("div",{className:"wrapper__subtitle",children:d}),v&&r.jsx("div",{className:"wrapper__badges"}),q&&r.jsxs("div",{className:"wrapper__rating",children:[r.jsx("div",{className:"wrapper_stars",children:[...Array(5).keys()].map((e,n)=>r.jsx(x,{icon:" mng-lnc-star--filled",className:`wrapper__star ${e>=y?"gold-star":""}`},`shop-card-rating-star__${n+1}`))}),r.jsxs("div",{className:"wrapper__review-count",children:["(",m==null?void 0:m.toLocaleString(),")"]})]})]})]}),S!==!0&&r.jsx("div",{className:"wrapper__products",children:l&&(l==null?void 0:l.map((e,n)=>r.jsx(t.Fragment,{children:r.jsx("div",{className:"wrapper__product",onClick:()=>{var a;return(a=e==null?void 0:e.onSelectProduct)==null?void 0:a.call(e,e==null?void 0:e.uuid)},children:o.isDefined(e==null?void 0:e.imageComponent)?e==null?void 0:e.imageComponent:r.jsx(k.ProductImageWrapper,{src:b(e==null?void 0:e.image,e==null?void 0:e.uuid,c),className:"product__image"})})},n)))})]})});exports.ShopCard=E;
146
+ `,E=l.forwardRef(({uuid:c,image:p,imageComponent:g,title:f,subtitle:w,badges:v,rating:y,reviewCount:m,products:t,onSelectCard:j=()=>{},getProductImage:b=()=>{},canAcceptPayments:N,hideProducts:u=!1,showRating:S=!0,metadata:i={},LinkComponent:_},I)=>{const q=_||"a",s=l.useRef(),h=l.useRef();return l.useEffect(()=>{var n;const e=a=>{a.target.src=d.DefaultShopImage,a.onerror=null};return(n=s==null?void 0:s.current)==null||n.addEventListener("error",e),()=>{var a;(a=s==null?void 0:s.current)==null||a.removeEventListener("error",e)}},[]),r.jsxs(D,{ref:h,name:i==null?void 0:i.name,"data-accessor":i==null?void 0:i.accessor,onClick:e=>j(e,h),as:q,..._?{to:`/shop/${c}`}:{href:`/shop/${c}`},children:[r.jsxs("div",{className:"wrapper__content",children:[o.isDefined(g)?g:p?r.jsx("img",{ref:s,src:p,className:"wrapper__image"}):r.jsx("img",{src:d.DefaultShopImage,className:"wrapper__image"}),r.jsxs("div",{className:"wrapper__info",children:[r.jsxs("div",{className:"wrapper__title",children:[f," ",N&&r.jsx(x,{color:"secondary",icon:"credit-card",className:"card"})]}),r.jsx("div",{className:"wrapper__subtitle",children:w}),v&&r.jsx("div",{className:"wrapper__badges"}),S&&r.jsxs("div",{className:"wrapper__rating",children:[r.jsx("div",{className:"wrapper_stars",children:[...Array(5).keys()].map((e,n)=>r.jsx(x,{icon:" mng-lnc-star--filled",className:`wrapper__star ${e>=y?"gold-star":""}`},`shop-card-rating-star__${n+1}`))}),r.jsxs("div",{className:"wrapper__review-count",children:["(",m==null?void 0:m.toLocaleString(),")"]})]})]})]}),u!==!0&&r.jsx("div",{className:"wrapper__products",children:t&&(t==null?void 0:t.map((e,n)=>r.jsx(l.Fragment,{children:r.jsx("div",{className:"wrapper__product",onClick:()=>{var a;return(a=e==null?void 0:e.onSelectProduct)==null?void 0:a.call(e,e==null?void 0:e.uuid)},children:o.isDefined(e==null?void 0:e.imageComponent)?e==null?void 0:e.imageComponent:r.jsx(k.ProductImageWrapper,{src:b(e==null?void 0:e.image,e==null?void 0:e.uuid,c),className:"product__image"})})},n)))})]})});exports.ShopCard=E;
@@ -1,7 +1,7 @@
1
1
  import { jsxs as l, jsx as r } from "react/jsx-runtime";
2
- import { forwardRef as D, useRef as f, useEffect as L, Fragment as P } from "react";
3
- import h from "./Icon.js";
4
- import { n as w, m as d } from "./utils-B2fsQ6PS.js";
2
+ import { forwardRef as D, useRef as h, useEffect as L, Fragment as P } from "react";
3
+ import f from "./Icon.js";
4
+ import { n as d, m as w } from "./utils-B2fsQ6PS.js";
5
5
  import { s as I } from "./emotion-styled.browser.esm-BNN1dTl3.js";
6
6
  import { d as W } from "./breakpoints-ff0SIcV3.js";
7
7
  import { D as x } from "./ShopAvatar-4-fCYGEc.js";
@@ -61,7 +61,7 @@ const C = I.a`
61
61
  font-weight: 500;
62
62
  line-height: 1.5rem;
63
63
  letter-spacing: -0.0112rem;
64
- ${w(2)}
64
+ ${d(2)}
65
65
  text-align: center;
66
66
  }
67
67
 
@@ -73,7 +73,7 @@ const C = I.a`
73
73
  font-weight: 400;
74
74
  line-height: 1.25rem;
75
75
  letter-spacing: -0.0056rem;
76
- ${w(2)}
76
+ ${d(2)}
77
77
  }
78
78
 
79
79
  & .wrapper__badges {
@@ -127,6 +127,10 @@ const C = I.a`
127
127
  border-radius: 0 0 1.25rem 0;
128
128
  }
129
129
 
130
+ &:only-child {
131
+ border-radius: 0 0 1.25rem 1.25rem;
132
+ }
133
+
130
134
  & .product__image {
131
135
  width: 100%;
132
136
  aspect-ratio: 1 / 1;
@@ -168,7 +172,7 @@ const C = I.a`
168
172
  metadata: s = {},
169
173
  LinkComponent: g
170
174
  }, F) => {
171
- const z = g || "a", i = f(), _ = f();
175
+ const z = g || "a", i = h(), _ = h();
172
176
  return L(() => {
173
177
  var n;
174
178
  const e = (a) => {
@@ -193,18 +197,18 @@ const C = I.a`
193
197
  },
194
198
  children: [
195
199
  /* @__PURE__ */ l("div", { className: "wrapper__content", children: [
196
- d(p) ? p : c ? /* @__PURE__ */ r("img", { ref: i, src: c, className: "wrapper__image" }) : /* @__PURE__ */ r("img", { src: x, className: "wrapper__image" }),
200
+ w(p) ? p : c ? /* @__PURE__ */ r("img", { ref: i, src: c, className: "wrapper__image" }) : /* @__PURE__ */ r("img", { src: x, className: "wrapper__image" }),
197
201
  /* @__PURE__ */ l("div", { className: "wrapper__info", children: [
198
202
  /* @__PURE__ */ l("div", { className: "wrapper__title", children: [
199
203
  v,
200
204
  " ",
201
- j && /* @__PURE__ */ r(h, { color: "secondary", icon: "credit-card", className: "card" })
205
+ j && /* @__PURE__ */ r(f, { color: "secondary", icon: "credit-card", className: "card" })
202
206
  ] }),
203
207
  /* @__PURE__ */ r("div", { className: "wrapper__subtitle", children: y }),
204
208
  b && /* @__PURE__ */ r("div", { className: "wrapper__badges" }),
205
209
  k && /* @__PURE__ */ l("div", { className: "wrapper__rating", children: [
206
210
  /* @__PURE__ */ r("div", { className: "wrapper_stars", children: [...Array(5).keys()].map((e, n) => /* @__PURE__ */ r(
207
- h,
211
+ f,
208
212
  {
209
213
  icon: " mng-lnc-star--filled",
210
214
  className: `wrapper__star ${e >= N ? "gold-star" : ""}`
@@ -227,7 +231,7 @@ const C = I.a`
227
231
  var a;
228
232
  return (a = e == null ? void 0 : e.onSelectProduct) == null ? void 0 : a.call(e, e == null ? void 0 : e.uuid);
229
233
  },
230
- children: d(e == null ? void 0 : e.imageComponent) ? e == null ? void 0 : e.imageComponent : /* @__PURE__ */ r(
234
+ children: w(e == null ? void 0 : e.imageComponent) ? e == null ? void 0 : e.imageComponent : /* @__PURE__ */ r(
231
235
  A,
232
236
  {
233
237
  src: S(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lanaco/lnc-react-ui",
3
- "version": "4.0.209",
3
+ "version": "4.0.210",
4
4
  "description": "React component library",
5
5
  "type": "module",
6
6
  "keywords": [