@lanaco/lnc-react-ui 4.0.127 → 4.0.128
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 e=require("react/jsx-runtime"),q=require("react"),n=require("./index-BpbMKBf_.cjs"),
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),q=require("react"),n=require("./index-BpbMKBf_.cjs"),C=require("./utils-DmMdPm9O.cjs"),J=require("./TextInput.cjs"),w=require("./Icon.cjs"),K=require("./Link.cjs"),z=require("./DropdownMenu.cjs"),I=require("./DropdownItem.cjs"),Q=require("./tag-Bov1gw34.cjs"),W=require("./BlogProductCardsSection.cjs"),P=require("./emotion-styled.browser.esm-BtEseadx.cjs"),S=require("./BlogListSection.cjs"),Y=require("./consts-goSZX3xP.cjs"),B=P.styled.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
justify-content: space-between;
|
|
4
4
|
align-items: center;
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
|
-
`,O=q.forwardRef(({perPageOptions:o=[{code:10,name:"Show 10 items"},{code:25,name:"Show 25 items"},{code:50,name:"Show 50 items"}],perPage:m,handlePerPage:_=()=>{},page:s=1,handlePage:c=()=>{},totalPage:r},d)=>{var h,l;const p=()=>{s>1&&(c==null||c(s-1))},f=()=>{s<r&&(c==null||c(s+1))},x=()=>{const t=[];if(r<=7)for(let a=1;a<=r;a++)t.push(a);else s<=3?t.push(1,2,3,"...",r):s>=r-2?t.push(1,"...",r-2,r-1,r):t.push(1,2,3,"...",r);return t==null?void 0:t.map((a,u)=>a==="..."?e.jsx("div",{className:"pagination__page ellipsis",children:a},`pagination-ellipsis__${u}`):e.jsx("div",{onClick:()=>c(a),className:`pagination__page ${s===a?"active":""}`,children:a},`pagination-page__${u}`))};return e.jsxs(B,{className:"pagination",children:[e.jsx(
|
|
82
|
+
`,O=q.forwardRef(({perPageOptions:o=[{code:10,name:"Show 10 items"},{code:25,name:"Show 25 items"},{code:50,name:"Show 50 items"}],perPage:m,handlePerPage:_=()=>{},page:s=1,handlePage:c=()=>{},totalPage:r},d)=>{var h,l;const p=()=>{s>1&&(c==null||c(s-1))},f=()=>{s<r&&(c==null||c(s+1))},x=()=>{const t=[];if(r<=7)for(let a=1;a<=r;a++)t.push(a);else s<=3?t.push(1,2,3,"...",r):s>=r-2?t.push(1,"...",r-2,r-1,r):t.push(1,2,3,"...",r);return t==null?void 0:t.map((a,u)=>a==="..."?e.jsx("div",{className:"pagination__page ellipsis",children:a},`pagination-ellipsis__${u}`):e.jsx("div",{onClick:()=>c(a),className:`pagination__page ${s===a?"active":""}`,children:a},`pagination-page__${u}`))};return e.jsxs(B,{className:"pagination",children:[e.jsx(z,{color:"neutral",control:((h=o==null?void 0:o.find(t=>(t==null?void 0:t.code)===m))==null?void 0:h.name)||((l=o[0])==null?void 0:l.name),placement:"bottom",zIndex:1001,className:"pagination__per-page",children:o==null?void 0:o.map((t,a)=>e.jsx(I,{active:(t==null?void 0:t.code)===(m==null?void 0:m.code),className:"sort-by__item",onClick:()=>_(t),children:t==null?void 0:t.name},`blog-epxlore-section-per-page-option__${a+1}`))}),e.jsxs("div",{className:"pagination__pages",children:[e.jsx("div",{className:`pagination__page ${s===1?"disabled":""}`,onClick:p,children:e.jsx(w,{icon:" mng-lnc-chevron--left"})}),x(),e.jsx("div",{className:`pagination__page ${s===r?"disabled":""}`,onClick:f,children:e.jsx(w,{icon:" mng-lnc-chevron--right"})})]})]})}),ee=P.styled.div`
|
|
83
83
|
display: flex;
|
|
84
84
|
align-items: flex-start;
|
|
85
85
|
gap: 2rem;
|
|
@@ -255,6 +255,7 @@
|
|
|
255
255
|
font-style: normal;
|
|
256
256
|
font-weight: 500;
|
|
257
257
|
line-height: 1.25rem;
|
|
258
|
+
${C.truncateTextInRows(2)}
|
|
258
259
|
}
|
|
259
260
|
|
|
260
261
|
& .item__description {
|
|
@@ -316,4 +317,4 @@
|
|
|
316
317
|
display: none;
|
|
317
318
|
}
|
|
318
319
|
}
|
|
319
|
-
`,
|
|
320
|
+
`,L=q.forwardRef(({mainTitle:o,sideTitle:m,tags:_,selectedTag:s,handleSelectTag:c=()=>{},blogs:r,miniBlogs:d,products:p,blogsLoading:f=!1,productsLoading:x=!1,sortingOptions:h,sortBy:l,handleSortBy:t=()=>{},allTagText:a="All",searchPlaceholderText:u="Search blogs",timeToReadText:j="{0} min read",getBlogImageUrl:y=()=>{},handleSelectBlog:g=()=>{},handleSelectBlogTag:b=()=>{},handleShareBlog:N=()=>{},handleBookmarkBlog:k=()=>{},showAllButtonLink:$,showAllButtonText:A="Show all products",viewAllButtonText:R="View all (11)",viewAllButtonLink:ne,handleViewAll:D=()=>{},handleShowAll:E=()=>{},handleSelectProduct:M=()=>{},getProductImageUrl:U=()=>{},page:F,handlePage:H=()=>{},perPage:V,handlePerPage:X=()=>{},totalPage:v,perPageOptions:Z,handleSearch:G=()=>{}},re)=>e.jsxs(ee,{children:[e.jsxs("div",{className:"landing__main-content",children:[o&&e.jsx("div",{className:"main-content__title",children:o}),_&&e.jsx(Q.FaqSectionTags,{tags:_,allTagText:a,selectedTagCode:s,onSelectTag:c}),e.jsxs("div",{className:"main-content__actions",children:[e.jsx(J,{className:"main-content__search",placeholder:u,debounceTime:200,prefix:e.jsx(w,{icon:" mng-lnc-search",sizeInUnits:"1.25rem",className:"main-content__search-prefix"}),color:"neutral",onChange:G}),e.jsx(z,{color:"neutral",control:l==null?void 0:l.name,zIndex:1001,className:"main-content__sort-by",children:h==null?void 0:h.map((i,T)=>e.jsx(I,{active:(i==null?void 0:i.code)===(l==null?void 0:l.code),className:"sort-by__item",onClick:()=>t(i),children:i==null?void 0:i.name},`blog-epxlore-section-sorting-option__${T+1}`))})]}),e.jsxs("div",{className:"main-content__items",children:[r&&(r==null?void 0:r.length)>0&&e.jsx(S,{timeToReadText:j,items:r==null?void 0:r.slice(0,5),isLoading:f,getImage:y,onSelectCard:g,onSelectOption:b,onShare:N,onBookmark:k}),e.jsx("div",{className:"main-content__divider"}),p&&(p==null?void 0:p.length)>0&&e.jsx(W,{buttonText:A,buttonLink:$,onButtonAction:E,onSelectCard:M,items:p,isLoading:x,getImage:U,isHighlight:!0}),e.jsx("div",{className:"main-content__divider"}),r&&(r==null?void 0:r.length)>0&&e.jsx(S,{timeToReadText:j,items:r==null?void 0:r.slice(5),isLoading:f,getImage:y,onSelectCard:g,onSelectOption:b,onShare:N,onBookmark:k})]}),v&&v>1&&e.jsx(O,{perPageOptions:Z,perPage:V,handlePerPage:X,page:F,handlePage:H,totalPage:v})]}),e.jsxs("div",{className:"landing__side-content",children:[m&&e.jsx("div",{className:"side-content__title",children:m}),e.jsx("div",{className:"side-content__items",children:d&&(d==null?void 0:d.length)>0&&(d==null?void 0:d.map((i,T)=>e.jsxs("div",{className:"side-content__item",onClick:()=>g(i),children:[e.jsx("img",{src:y(i==null?void 0:i.imageUrl,i==null?void 0:i.uuid)||null,alt:`Mini blog ${T+1}`,className:"item__image"}),e.jsxs("div",{className:"item__content",children:[e.jsx("div",{className:"item__title",children:i==null?void 0:i.title}),e.jsx("div",{className:"item__description",children:C.formatLocaleDateString(i==null?void 0:i.publishedAt)})]})]})))}),e.jsx(K,{onClick:D,className:"side-content__link",children:R})]})]}));L.propTypes={mainTitle:n.PropTypes.string,sideTitle:n.PropTypes.string,tags:n.PropTypes.array,selectedTag:n.PropTypes.any,handleSelectTag:n.PropTypes.func,blogs:n.PropTypes.array,miniBlogs:n.PropTypes.array,products:n.PropTypes.array,blogsLoading:n.PropTypes.bool,productsLoading:n.PropTypes.bool,sortingOptions:n.PropTypes.array,sortBy:n.PropTypes.any,handleSortBy:n.PropTypes.func,allTagText:n.PropTypes.string,searchPlaceholderText:n.PropTypes.string,timeToReadText:n.PropTypes.string,getBlogImageUrl:n.PropTypes.func,handleSelectBlog:n.PropTypes.func,handleSelectBlogTag:n.PropTypes.func,handleShareBlog:n.PropTypes.func,handleBookmarkBlog:n.PropTypes.func,showAllButtonLink:n.PropTypes.string,showAllButtonText:n.PropTypes.string,viewAllButtonText:n.PropTypes.string,handleShowAll:n.PropTypes.func,handleSelectProduct:n.PropTypes.func,getProductImageUrl:n.PropTypes.func,page:n.PropTypes.number,handlePage:n.PropTypes.func,perPage:n.PropTypes.any,handlePerPage:n.PropTypes.func,totalPage:n.PropTypes.number,perPageOptions:n.PropTypes.array,handleSearch:n.PropTypes.func};module.exports=L;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsxs as d, jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as I } from "react";
|
|
3
3
|
import { P as e } from "./index-CblbdqjE.js";
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
4
|
+
import { p as J, s as K } from "./utils-BPdU4_1q.js";
|
|
5
|
+
import Q from "./TextInput.js";
|
|
6
6
|
import N from "./Icon.js";
|
|
7
|
-
import
|
|
7
|
+
import W from "./Link.js";
|
|
8
8
|
import L from "./DropdownMenu.js";
|
|
9
9
|
import $ from "./DropdownItem.js";
|
|
10
|
-
import { F as
|
|
11
|
-
import
|
|
10
|
+
import { F as Y } from "./tag-CtleOqEC.js";
|
|
11
|
+
import B from "./BlogProductCardsSection.js";
|
|
12
12
|
import { s as A } from "./emotion-styled.browser.esm-BNN1dTl3.js";
|
|
13
13
|
import z from "./BlogListSection.js";
|
|
14
|
-
import { M as
|
|
15
|
-
const
|
|
14
|
+
import { M as O } from "./consts-BuFChS64.js";
|
|
15
|
+
const P = A.div`
|
|
16
16
|
display: flex;
|
|
17
17
|
justify-content: space-between;
|
|
18
18
|
align-items: center;
|
|
@@ -93,7 +93,7 @@ const O = A.div`
|
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
-
`,
|
|
96
|
+
`, ee = I(
|
|
97
97
|
({
|
|
98
98
|
perPageOptions: o = [
|
|
99
99
|
{ code: 10, name: "Show 10 items" },
|
|
@@ -137,7 +137,7 @@ const O = A.div`
|
|
|
137
137
|
`pagination-page__${p}`
|
|
138
138
|
));
|
|
139
139
|
};
|
|
140
|
-
return /* @__PURE__ */ d(
|
|
140
|
+
return /* @__PURE__ */ d(P, { className: "pagination", children: [
|
|
141
141
|
/* @__PURE__ */ n(
|
|
142
142
|
L,
|
|
143
143
|
{
|
|
@@ -179,7 +179,7 @@ const O = A.div`
|
|
|
179
179
|
] })
|
|
180
180
|
] });
|
|
181
181
|
}
|
|
182
|
-
),
|
|
182
|
+
), ne = A.div`
|
|
183
183
|
display: flex;
|
|
184
184
|
align-items: flex-start;
|
|
185
185
|
gap: 2rem;
|
|
@@ -355,6 +355,7 @@ const O = A.div`
|
|
|
355
355
|
font-style: normal;
|
|
356
356
|
font-weight: 500;
|
|
357
357
|
line-height: 1.25rem;
|
|
358
|
+
${J(2)}
|
|
358
359
|
}
|
|
359
360
|
|
|
360
361
|
& .item__description {
|
|
@@ -369,7 +370,7 @@ const O = A.div`
|
|
|
369
370
|
}
|
|
370
371
|
}
|
|
371
372
|
|
|
372
|
-
@media (max-width: ${
|
|
373
|
+
@media (max-width: ${O + "px"}) {
|
|
373
374
|
flex-direction: column;
|
|
374
375
|
|
|
375
376
|
& .landing__main-content {
|
|
@@ -416,7 +417,7 @@ const O = A.div`
|
|
|
416
417
|
display: none;
|
|
417
418
|
}
|
|
418
419
|
}
|
|
419
|
-
`,
|
|
420
|
+
`, te = I(
|
|
420
421
|
({
|
|
421
422
|
mainTitle: o,
|
|
422
423
|
sideTitle: f,
|
|
@@ -442,24 +443,24 @@ const O = A.div`
|
|
|
442
443
|
},
|
|
443
444
|
handleSelectBlogTag: S = () => {
|
|
444
445
|
},
|
|
445
|
-
handleShareBlog:
|
|
446
|
+
handleShareBlog: T = () => {
|
|
446
447
|
},
|
|
447
|
-
handleBookmarkBlog:
|
|
448
|
+
handleBookmarkBlog: C = () => {
|
|
448
449
|
},
|
|
449
450
|
showAllButtonLink: j,
|
|
450
451
|
showAllButtonText: M = "Show all products",
|
|
451
452
|
viewAllButtonText: D = "View all (11)",
|
|
452
|
-
viewAllButtonLink:
|
|
453
|
+
viewAllButtonLink: re,
|
|
453
454
|
handleViewAll: E = () => {
|
|
454
455
|
},
|
|
455
456
|
handleShowAll: F = () => {
|
|
456
457
|
},
|
|
457
|
-
handleSelectProduct:
|
|
458
|
+
handleSelectProduct: R = () => {
|
|
458
459
|
},
|
|
459
|
-
getProductImageUrl:
|
|
460
|
+
getProductImageUrl: U = () => {
|
|
460
461
|
},
|
|
461
|
-
page:
|
|
462
|
-
handlePage:
|
|
462
|
+
page: q,
|
|
463
|
+
handlePage: H = () => {
|
|
463
464
|
},
|
|
464
465
|
perPage: V,
|
|
465
466
|
handlePerPage: X = () => {
|
|
@@ -468,21 +469,21 @@ const O = A.div`
|
|
|
468
469
|
perPageOptions: Z,
|
|
469
470
|
handleSearch: G = () => {
|
|
470
471
|
}
|
|
471
|
-
},
|
|
472
|
+
}, ie) => /* @__PURE__ */ d(ne, { children: [
|
|
472
473
|
/* @__PURE__ */ d("div", { className: "landing__main-content", children: [
|
|
473
474
|
o && /* @__PURE__ */ n("div", { className: "main-content__title", children: o }),
|
|
474
475
|
u && /* @__PURE__ */ n(
|
|
475
|
-
|
|
476
|
+
Y,
|
|
476
477
|
{
|
|
477
478
|
tags: u,
|
|
478
479
|
allTagText: a,
|
|
479
|
-
|
|
480
|
+
selectedTagCode: c,
|
|
480
481
|
onSelectTag: l
|
|
481
482
|
}
|
|
482
483
|
),
|
|
483
484
|
/* @__PURE__ */ d("div", { className: "main-content__actions", children: [
|
|
484
485
|
/* @__PURE__ */ n(
|
|
485
|
-
|
|
486
|
+
Q,
|
|
486
487
|
{
|
|
487
488
|
className: "main-content__search",
|
|
488
489
|
placeholder: p,
|
|
@@ -529,21 +530,21 @@ const O = A.div`
|
|
|
529
530
|
getImage: x,
|
|
530
531
|
onSelectCard: y,
|
|
531
532
|
onSelectOption: S,
|
|
532
|
-
onShare:
|
|
533
|
-
onBookmark:
|
|
533
|
+
onShare: T,
|
|
534
|
+
onBookmark: C
|
|
534
535
|
}
|
|
535
536
|
),
|
|
536
537
|
/* @__PURE__ */ n("div", { className: "main-content__divider" }),
|
|
537
538
|
h && (h == null ? void 0 : h.length) > 0 && /* @__PURE__ */ n(
|
|
538
|
-
|
|
539
|
+
B,
|
|
539
540
|
{
|
|
540
541
|
buttonText: M,
|
|
541
542
|
buttonLink: j,
|
|
542
543
|
onButtonAction: F,
|
|
543
|
-
onSelectCard:
|
|
544
|
+
onSelectCard: R,
|
|
544
545
|
items: h,
|
|
545
546
|
isLoading: v,
|
|
546
|
-
getImage:
|
|
547
|
+
getImage: U,
|
|
547
548
|
isHighlight: !0
|
|
548
549
|
}
|
|
549
550
|
),
|
|
@@ -557,19 +558,19 @@ const O = A.div`
|
|
|
557
558
|
getImage: x,
|
|
558
559
|
onSelectCard: y,
|
|
559
560
|
onSelectOption: S,
|
|
560
|
-
onShare:
|
|
561
|
-
onBookmark:
|
|
561
|
+
onShare: T,
|
|
562
|
+
onBookmark: C
|
|
562
563
|
}
|
|
563
564
|
)
|
|
564
565
|
] }),
|
|
565
566
|
w && w > 1 && /* @__PURE__ */ n(
|
|
566
|
-
|
|
567
|
+
ee,
|
|
567
568
|
{
|
|
568
569
|
perPageOptions: Z,
|
|
569
570
|
perPage: V,
|
|
570
571
|
handlePerPage: X,
|
|
571
|
-
page:
|
|
572
|
-
handlePage:
|
|
572
|
+
page: q,
|
|
573
|
+
handlePage: H,
|
|
573
574
|
totalPage: w
|
|
574
575
|
}
|
|
575
576
|
)
|
|
@@ -592,16 +593,16 @@ const O = A.div`
|
|
|
592
593
|
),
|
|
593
594
|
/* @__PURE__ */ d("div", { className: "item__content", children: [
|
|
594
595
|
/* @__PURE__ */ n("div", { className: "item__title", children: i == null ? void 0 : i.title }),
|
|
595
|
-
/* @__PURE__ */ n("div", { className: "item__description", children:
|
|
596
|
+
/* @__PURE__ */ n("div", { className: "item__description", children: K(i == null ? void 0 : i.publishedAt) })
|
|
596
597
|
] })
|
|
597
598
|
]
|
|
598
599
|
}
|
|
599
600
|
))) }),
|
|
600
|
-
/* @__PURE__ */ n(
|
|
601
|
+
/* @__PURE__ */ n(W, { onClick: E, className: "side-content__link", children: D })
|
|
601
602
|
] })
|
|
602
603
|
] })
|
|
603
604
|
);
|
|
604
|
-
|
|
605
|
+
te.propTypes = {
|
|
605
606
|
mainTitle: e.string,
|
|
606
607
|
sideTitle: e.string,
|
|
607
608
|
tags: e.array,
|
|
@@ -638,5 +639,5 @@ ne.propTypes = {
|
|
|
638
639
|
handleSearch: e.func
|
|
639
640
|
};
|
|
640
641
|
export {
|
|
641
|
-
|
|
642
|
+
te as default
|
|
642
643
|
};
|