@lanaco/lnc-react-ui 4.0.107 → 4.0.109
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/BlogListSection.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const r=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";const r=require("react/jsx-runtime"),c=require("react"),w=require("./Icon.cjs"),y=require("./IconButton.cjs"),N=require("./Chip.cjs"),o=require("./utils-CZynEOC_.cjs"),k=require("./index-BvSNRLNa.cjs"),j=require("./emotion-styled.browser.esm-BtEseadx.cjs"),R=require("./suspense-large-CtcwWswP.cjs"),q=j.styled.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
padding: 1rem;
|
|
4
4
|
align-items: center;
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
font-weight: 600;
|
|
44
44
|
line-height: 1.5rem;
|
|
45
45
|
letter-spacing: 0.1px;
|
|
46
|
-
${
|
|
46
|
+
${o.truncateTextInRows(3)}
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
& .wrapper__tags {
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
|
-
`,I=
|
|
120
|
+
`,I=c.forwardRef(({title:d,imageUrl:s,options:i,publishedAt:a,timeToReadText:n="{0} min read",timeToRead:l=0,numberOfLikes:m=0,numberOfComments:p=0,isBookmarked:g=!1,onSelectCard:h=()=>{},onSelectOption:f=()=>{},onBookmark:e=()=>{},onShare:u=()=>{}},b)=>r.jsxs(q,{onClick:h,children:[r.jsx(k.ProductImageWrapper,{src:s,className:"wrapper__image"}),r.jsxs("div",{className:"wrapper__content",children:[r.jsxs("div",{className:"wrapper__subcontent",children:[r.jsx("div",{className:"wrapper__title",children:d}),r.jsx("div",{className:"wrapper__tags",children:i&&(i==null?void 0:i.map((t,v)=>r.jsx(N,{label:t==null?void 0:t.name,color:t==null?void 0:t.color,className:"wrapper__tag",onClick:_=>{_==null||_.stopPropagation(),f(t==null?void 0:t.code)}},`blog-card-sponsored-option__${v+1}`)))})]}),r.jsxs("div",{className:"wrapper__info",children:[r.jsxs("div",{className:"info__content",children:[r.jsx("div",{className:"info__text",children:`${o.formatLocaleDateString(a)} • ${o.formatString(n,l)}`}),r.jsxs("div",{className:"info__text",children:[r.jsxs("div",{children:[r.jsx(w,{icon:" mng-lnc-thumbs-up",sizeInUnits:"1rem"}),o.getRoundedNumber(m)]}),r.jsxs("div",{children:[r.jsx(w,{icon:" mng-lnc-messages",sizeInUnits:"1rem"}),o.getRoundedNumber(p)]})]})]}),r.jsxs("div",{className:"info__content",children:[r.jsx(y,{icon:g?" mng-lnc-bookmark--filled":" mng-lnc-bookmark",borderRadius:"curved",btnType:"basic",color:"neutral",onClick:t=>{t==null||t.stopPropagation(),e()}}),r.jsx(y,{icon:" mng-lnc-share",borderRadius:"curved",btnType:"basic",color:"neutral",onClick:t=>{t==null||t.stopPropagation(),u()}})]})]})]})]})),z=j.styled.div`
|
|
121
121
|
display: flex;
|
|
122
122
|
flex-direction: column;
|
|
123
123
|
align-items: flex-start;
|
|
@@ -139,4 +139,4 @@
|
|
|
139
139
|
bottom: -0.75rem;
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
|
-
`,
|
|
142
|
+
`,C=c.memo(I),L=c.forwardRef(({timeToReadText:d="{0} min read",items:s,onSelectCard:i=()=>{},onSelectOption:a=()=>{},onShare:n=()=>{},onBookmark:l=()=>{},isLoading:m=!1,getImage:p=()=>{},isSeparated:g=!0},h)=>{const f=c.useMemo(()=>s==null?void 0:s.map((e,u)=>r.jsx(C,{title:e==null?void 0:e.title,titleSlug:e==null?void 0:e.titleSlug,options:e==null?void 0:e.options,publishedAt:e==null?void 0:e.publishedAt,timeToReadText:d,timeToRead:e==null?void 0:e.timeToRead,numberOfLikes:e==null?void 0:e.numberOfLikes,numberOfComments:e==null?void 0:e.numberOfComments,isSponsored:e==null?void 0:e.isSponsored,isBookmarked:e==null?void 0:e.isBookmarked,onSelectCard:()=>i==null?void 0:i(e),onSelectOption:b=>a==null?void 0:a(b),onShare:()=>n==null?void 0:n(e),onBookmark:()=>l==null?void 0:l(e),imageUrl:p(e==null?void 0:e.imageUrl,e==null?void 0:e.uuid)||null},`blog-card-item__${u+1}`)),[s]);return r.jsx(z,{className:g?"separated":"",children:r.jsx(R.SuspenseBlogLarge,{isLoading:m,limit:5,keyPrefix:"blog-section",children:f})})});module.exports=L;
|
package/dist/BlogListSection.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsxs as i, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
2
|
+
import { forwardRef as y, memo as z, useMemo as I } from "react";
|
|
3
|
+
import b from "./Icon.js";
|
|
4
|
+
import w from "./IconButton.js";
|
|
5
5
|
import R from "./Chip.js";
|
|
6
|
-
import { p as j, s as
|
|
7
|
-
import { P } from "./index-YGcWbzeb.js";
|
|
8
|
-
import { s as
|
|
9
|
-
import { S as
|
|
10
|
-
const L =
|
|
6
|
+
import { p as j, s as C, v as P, w as v } from "./utils-BbgAIA9N.js";
|
|
7
|
+
import { P as $ } from "./index-YGcWbzeb.js";
|
|
8
|
+
import { s as N } from "./emotion-styled.browser.esm-BNN1dTl3.js";
|
|
9
|
+
import { S as B } from "./suspense-large-BM9s_kZP.js";
|
|
10
|
+
const L = N.div`
|
|
11
11
|
display: flex;
|
|
12
12
|
padding: 1rem;
|
|
13
13
|
align-items: center;
|
|
@@ -126,7 +126,7 @@ const L = y.div`
|
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
|
-
`, T =
|
|
129
|
+
`, T = y(
|
|
130
130
|
({
|
|
131
131
|
title: m,
|
|
132
132
|
imageUrl: n,
|
|
@@ -136,70 +136,71 @@ const L = y.div`
|
|
|
136
136
|
timeToRead: o = 0,
|
|
137
137
|
numberOfLikes: c = 0,
|
|
138
138
|
numberOfComments: d = 0,
|
|
139
|
-
|
|
139
|
+
isBookmarked: p = !1,
|
|
140
|
+
onSelectCard: _ = () => {
|
|
140
141
|
},
|
|
141
|
-
onSelectOption:
|
|
142
|
+
onSelectOption: f = () => {
|
|
142
143
|
},
|
|
143
|
-
onBookmark:
|
|
144
|
+
onBookmark: e = () => {
|
|
144
145
|
},
|
|
145
|
-
onShare:
|
|
146
|
+
onShare: g = () => {
|
|
146
147
|
}
|
|
147
|
-
},
|
|
148
|
-
/* @__PURE__ */ t(
|
|
148
|
+
}, h) => /* @__PURE__ */ i(L, { onClick: _, children: [
|
|
149
|
+
/* @__PURE__ */ t($, { src: n, className: "wrapper__image" }),
|
|
149
150
|
/* @__PURE__ */ i("div", { className: "wrapper__content", children: [
|
|
150
151
|
/* @__PURE__ */ i("div", { className: "wrapper__subcontent", children: [
|
|
151
152
|
/* @__PURE__ */ t("div", { className: "wrapper__title", children: m }),
|
|
152
|
-
/* @__PURE__ */ t("div", { className: "wrapper__tags", children: a && (a == null ? void 0 : a.map((r,
|
|
153
|
+
/* @__PURE__ */ t("div", { className: "wrapper__tags", children: a && (a == null ? void 0 : a.map((r, k) => /* @__PURE__ */ t(
|
|
153
154
|
R,
|
|
154
155
|
{
|
|
155
156
|
label: r == null ? void 0 : r.name,
|
|
156
157
|
color: r == null ? void 0 : r.color,
|
|
157
158
|
className: "wrapper__tag",
|
|
158
|
-
onClick: (
|
|
159
|
-
|
|
159
|
+
onClick: (u) => {
|
|
160
|
+
u == null || u.stopPropagation(), f(r == null ? void 0 : r.code);
|
|
160
161
|
}
|
|
161
162
|
},
|
|
162
|
-
`blog-card-sponsored-option__${
|
|
163
|
+
`blog-card-sponsored-option__${k + 1}`
|
|
163
164
|
))) })
|
|
164
165
|
] }),
|
|
165
166
|
/* @__PURE__ */ i("div", { className: "wrapper__info", children: [
|
|
166
167
|
/* @__PURE__ */ i("div", { className: "info__content", children: [
|
|
167
|
-
/* @__PURE__ */ t("div", { className: "info__text", children: `${
|
|
168
|
+
/* @__PURE__ */ t("div", { className: "info__text", children: `${C(
|
|
168
169
|
l
|
|
169
|
-
)} • ${
|
|
170
|
+
)} • ${P(s, o)}` }),
|
|
170
171
|
/* @__PURE__ */ i("div", { className: "info__text", children: [
|
|
171
172
|
/* @__PURE__ */ i("div", { children: [
|
|
172
|
-
/* @__PURE__ */ t(
|
|
173
|
-
|
|
173
|
+
/* @__PURE__ */ t(b, { icon: " mng-lnc-thumbs-up", sizeInUnits: "1rem" }),
|
|
174
|
+
v(c)
|
|
174
175
|
] }),
|
|
175
176
|
/* @__PURE__ */ i("div", { children: [
|
|
176
|
-
/* @__PURE__ */ t(
|
|
177
|
-
|
|
177
|
+
/* @__PURE__ */ t(b, { icon: " mng-lnc-messages", sizeInUnits: "1rem" }),
|
|
178
|
+
v(d)
|
|
178
179
|
] })
|
|
179
180
|
] })
|
|
180
181
|
] }),
|
|
181
182
|
/* @__PURE__ */ i("div", { className: "info__content", children: [
|
|
182
183
|
/* @__PURE__ */ t(
|
|
183
|
-
|
|
184
|
+
w,
|
|
184
185
|
{
|
|
185
|
-
icon: " mng-lnc-bookmark",
|
|
186
|
+
icon: p ? " mng-lnc-bookmark--filled" : " mng-lnc-bookmark",
|
|
186
187
|
borderRadius: "curved",
|
|
187
188
|
btnType: "basic",
|
|
188
189
|
color: "neutral",
|
|
189
190
|
onClick: (r) => {
|
|
190
|
-
r == null || r.stopPropagation(),
|
|
191
|
+
r == null || r.stopPropagation(), e();
|
|
191
192
|
}
|
|
192
193
|
}
|
|
193
194
|
),
|
|
194
195
|
/* @__PURE__ */ t(
|
|
195
|
-
|
|
196
|
+
w,
|
|
196
197
|
{
|
|
197
198
|
icon: " mng-lnc-share",
|
|
198
199
|
borderRadius: "curved",
|
|
199
200
|
btnType: "basic",
|
|
200
201
|
color: "neutral",
|
|
201
202
|
onClick: (r) => {
|
|
202
|
-
r == null || r.stopPropagation(),
|
|
203
|
+
r == null || r.stopPropagation(), g();
|
|
203
204
|
}
|
|
204
205
|
}
|
|
205
206
|
)
|
|
@@ -207,7 +208,7 @@ const L = y.div`
|
|
|
207
208
|
] })
|
|
208
209
|
] })
|
|
209
210
|
] })
|
|
210
|
-
), U =
|
|
211
|
+
), U = N.div`
|
|
211
212
|
display: flex;
|
|
212
213
|
flex-direction: column;
|
|
213
214
|
align-items: flex-start;
|
|
@@ -229,7 +230,7 @@ const L = y.div`
|
|
|
229
230
|
bottom: -0.75rem;
|
|
230
231
|
}
|
|
231
232
|
}
|
|
232
|
-
`,
|
|
233
|
+
`, W = z(T), J = y(
|
|
233
234
|
({
|
|
234
235
|
timeToReadText: m = "{0} min read",
|
|
235
236
|
items: n,
|
|
@@ -245,9 +246,9 @@ const L = y.div`
|
|
|
245
246
|
getImage: d = () => {
|
|
246
247
|
},
|
|
247
248
|
isSeparated: p = !0
|
|
248
|
-
},
|
|
249
|
-
const f = I(() => n == null ? void 0 : n.map((e,
|
|
250
|
-
|
|
249
|
+
}, _) => {
|
|
250
|
+
const f = I(() => n == null ? void 0 : n.map((e, g) => /* @__PURE__ */ t(
|
|
251
|
+
W,
|
|
251
252
|
{
|
|
252
253
|
title: e == null ? void 0 : e.title,
|
|
253
254
|
titleSlug: e == null ? void 0 : e.titleSlug,
|
|
@@ -258,16 +259,17 @@ const L = y.div`
|
|
|
258
259
|
numberOfLikes: e == null ? void 0 : e.numberOfLikes,
|
|
259
260
|
numberOfComments: e == null ? void 0 : e.numberOfComments,
|
|
260
261
|
isSponsored: e == null ? void 0 : e.isSponsored,
|
|
262
|
+
isBookmarked: e == null ? void 0 : e.isBookmarked,
|
|
261
263
|
onSelectCard: () => a == null ? void 0 : a(e),
|
|
262
|
-
onSelectOption: (
|
|
264
|
+
onSelectOption: (h) => l == null ? void 0 : l(h),
|
|
263
265
|
onShare: () => s == null ? void 0 : s(e),
|
|
264
266
|
onBookmark: () => o == null ? void 0 : o(e),
|
|
265
267
|
imageUrl: d(e == null ? void 0 : e.imageUrl, e == null ? void 0 : e.uuid) || null
|
|
266
268
|
},
|
|
267
|
-
`blog-card-item__${
|
|
269
|
+
`blog-card-item__${g + 1}`
|
|
268
270
|
)), [n]);
|
|
269
271
|
return /* @__PURE__ */ t(U, { className: p ? "separated" : "", children: /* @__PURE__ */ t(
|
|
270
|
-
|
|
272
|
+
B,
|
|
271
273
|
{
|
|
272
274
|
isLoading: c,
|
|
273
275
|
limit: 5,
|
|
@@ -278,5 +280,5 @@ const L = y.div`
|
|
|
278
280
|
}
|
|
279
281
|
);
|
|
280
282
|
export {
|
|
281
|
-
|
|
283
|
+
J as default
|
|
282
284
|
};
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
|
-
`,w=m.forwardRef(({title:t,imageUrl:e,description:n,buttonText:a,onSelectCard:l=()=>{},className:o,position:s,tag:c,backgroundColor:p},x)=>{const h=u.useTheme();return r.jsx(r.Fragment,{children:r.jsxs(_,{ref:x,theme:h,className:o,position:s,backgroundColor:p,children:[r.jsx("img",{src:e,className:"wrapper__image"}),r.jsxs("div",{className:"wrapper__text",children:[c&&r.jsx("div",{className:"text__tag",children:c}),r.jsx("div",{className:"text__title",children:t}),i.isDefinedNotEmptyString(n)&&r.jsx("div",{className:"text__description",children:n}),i.isDefinedNotEmptyString(a)&&r.jsx(f,{text:a,
|
|
117
|
+
`,w=m.forwardRef(({title:t,imageUrl:e,description:n,buttonText:a,onSelectCard:l=()=>{},className:o,position:s,tag:c,backgroundColor:p},x)=>{const h=u.useTheme();return r.jsx(r.Fragment,{children:r.jsxs(_,{ref:x,theme:h,className:o,position:s,backgroundColor:p,onClick:l,children:[r.jsx("img",{src:e,className:"wrapper__image"}),r.jsxs("div",{className:"wrapper__text",children:[c&&r.jsx("div",{className:"text__tag",children:c}),r.jsx("div",{className:"text__title",children:t}),i.isDefinedNotEmptyString(n)&&r.jsx("div",{className:"text__description",children:n}),i.isDefinedNotEmptyString(a)&&r.jsx(f,{text:a,className:"text__action"})]})]})})}),b=d.styled.div`
|
|
118
118
|
display: flex;
|
|
119
119
|
flex-direction: column;
|
|
120
120
|
gap: 1.5rem;
|
|
@@ -155,6 +155,7 @@ const y = s.div`
|
|
|
155
155
|
className: o,
|
|
156
156
|
position: d,
|
|
157
157
|
backgroundColor: x,
|
|
158
|
+
onClick: l,
|
|
158
159
|
children: [
|
|
159
160
|
/* @__PURE__ */ t("img", { src: e, className: "wrapper__image" }),
|
|
160
161
|
/* @__PURE__ */ m("div", { className: "wrapper__text", children: [
|
|
@@ -165,7 +166,6 @@ const y = s.div`
|
|
|
165
166
|
b,
|
|
166
167
|
{
|
|
167
168
|
text: a,
|
|
168
|
-
onClick: l,
|
|
169
169
|
className: "text__action"
|
|
170
170
|
}
|
|
171
171
|
)
|