lm-web-controls 1.4.6 → 1.4.8
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/controls/blogList/index.js +1 -1
- package/dist/controls/featuredBlog/index.js +1 -1
- package/dist/controls/optimizedImage/index.js +1 -1
- package/dist/controls/post/index.js +1 -1
- package/dist/controls/relatedPosts/index.js +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/dist/styles/style.css +1 -1
- package/package.json +1 -1
- package/readme.md +222 -0
- package/types/lm-web-controls.d.ts +0 -18
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{__awaiter as e,__generator as t,__spreadArray as n}from"../../_virtual/_tslib.js";import a,{useState as i,useRef as o,useEffect as c}from"react";import r from"moment";
|
|
2
|
+
import{__awaiter as e,__generator as t,__spreadArray as n}from"../../_virtual/_tslib.js";import a,{useState as i,useRef as o,useEffect as c}from"react";import r from"moment";function l(l){var s=this,m=l.data,d=l.icon,u=l.title,g=l.nestedUrl,v=l.category,h=l.fetchMore,f=l.autoFetchCount,b=void 0===f?2:f,p=m.items,E=m.pagingInfo,N=i(""),y=N[0],w=N[1],I=i("grid"),M=I[0],O=I[1],P=i(p),C=P[0],k=P[1],x=i(E),Y=x[0],B=x[1],S=i(!1),j=S[0],A=S[1],D=i(0),L=D[0],T=D[1],G=o(null),V=i(!1),_=V[0],z=V[1];function F(){return e(this,void 0,void 0,function(){var e;return t(this,function(t){switch(t.label){case 0:return!Y.hasNextPage||j?[2]:(A(!0),[4,h(Y.currentPage+1)]);case 1:return e=t.sent(),k(function(t){return n(n([],t,!0),e.items,!0)}),B(e.pagingInfo),A(!1),T(function(e){return e+1}),[2]}})})}return c(function(){var a=navigator.userAgent;["Googlebot","Bingbot","Yahoo","DuckDuckBot","Baiduspider","YandexBot"].some(function(e){return a.includes(e)})&&(z(!0),e(s,void 0,void 0,function(){var e,a,i;return t(this,function(t){switch(t.label){case 0:e=Y.currentPage,a=n([],p,!0),t.label=1;case 1:return Y.hasNextPage?[4,h(e+1)]:[3,3];case 2:return i=t.sent(),a=n(n([],a,!0),i.items,!0),e++,i.pagingInfo.hasNextPage?[3,1]:[3,3];case 3:return k(a),[2]}})}))},[]),c(function(){"undefined"!=typeof window&&w(window.location.origin)},[]),c(function(){if(y){var e=C.map(function(e){var t,n;return{"@context":"https://schema.org","@type":"Article",headline:e.title,image:[e.featuredImage],author:{"@type":"Person",name:(null===(t=e.author)||void 0===t?void 0:t.name)||"Admin"},datePublished:r(e.publishedOn).toISOString(),dateModified:r(e.publishedOn).toISOString(),mainEntityOfPage:{"@type":"WebPage","@id":"".concat(y).concat(g?"/".concat(g):"","/post").concat(v?"/".concat(e.categoryInfo.slug):"","/").concat(e.slug)},publisher:{"@type":"Organization",name:(null===(n=e.author)||void 0===n?void 0:n.name)||"Admin"},description:e.previewContent}});if(!_){var t=document.getElementById("blog-list-json-ld-schema");t&&document.head.removeChild(t);var n=document.createElement("script");return n.type="application/ld+json",n.id="blog-list-json-ld-schema",n.innerHTML=JSON.stringify(e),document.head.appendChild(n),function(){document.head.contains(n)&&document.head.removeChild(n)}}}},[y,C,_]),c(function(){if(G.current&&!(L>=b)){var e=new IntersectionObserver(function(e){e[0].isIntersecting&&L<b&&!j&&F()},{threshold:1});return e.observe(G.current),function(){return e.disconnect()}}},[Y,L,j,b]),a.createElement("section",{className:"blog-list-main-container"},a.createElement("div",{className:"blog-list-top-container"},u&&a.createElement("h2",{className:"blog-list-main-title"},u),a.createElement("div",{className:"blog-list-icons-container"},d.grid&&a.createElement("div",{className:"blog-list-icon ".concat("grid"===M?"active":""),onClick:function(){return O("grid")},title:"Grid View"},d.grid),d.list&&a.createElement("div",{className:"blog-list-icon ".concat("list"===M?"active":""),onClick:function(){return O("list")},title:"List View"},d.list))),a.createElement("div",{className:"".concat("grid"===M?"blogs-grid-view":"blogs-list-view")},C.map(function(e){var t,n,i;return a.createElement("div",{key:e.slug,className:"".concat("grid"===M?"blog-item-grid":"blog-item-list")},a.createElement("a",{href:"".concat(g?"/".concat(g):"","/post").concat(v?"/".concat(e.categoryInfo.slug):"","/").concat(e.slug)},a.createElement("img",{src:e.featuredImage,alt:e.title,className:"".concat("grid"===M?"blog-item-grid-image":"blog-item-list-image")})),a.createElement("div",{className:"blog-details"},a.createElement("a",{href:"".concat(g?"/".concat(g):"","/post").concat(v?"/".concat(e.categoryInfo.slug):"","/").concat(e.slug)},a.createElement("h3",{className:"blog-item-title"},e.title)),a.createElement("div",{className:"blog-item-avatar-main-container"},a.createElement("div",{className:"blog-item-avatar"},(null===(t=e.author)||void 0===t?void 0:t.name)?null===(n=e.author)||void 0===n?void 0:n.name[0]:""),a.createElement("div",{className:"blog-item-author-container"},a.createElement("h3",{className:"blog-item-author-name"},(null===(i=e.author)||void 0===i?void 0:i.name)||""),a.createElement("div",{className:"blog-item-date-read"},"On ".concat(r(e.publishedOn).format("ddd, MMM DD, YYYY"),", ").concat(e.readTime?"".concat(e.readTime," Min read"):"3 Min read")))),a.createElement("p",{className:"blog-item-preview-content"},e.previewContent),a.createElement("a",{className:"blog-item-read-more-container",href:"".concat(g?"/".concat(g):"","/post").concat(v?"/".concat(e.categoryInfo.slug):"","/").concat(e.slug)},a.createElement("p",null,"Read More"),d.link?d.link:null)))})),Y.hasNextPage&&L>=b&&a.createElement("div",{className:"blog-list-load-more-container"},a.createElement("button",{onClick:F,className:"blog-list-load-more-button"},j?"Loading...":"Load More")),L<b&&a.createElement("div",{ref:G,style:{height:"1px",visibility:"hidden"}}))}export{l as BlogList};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import e from"react";import a from"moment";
|
|
2
|
+
import e from"react";import a from"moment";function t(t){var n,o,c,l,r,m,d=t.featured,i=t.icon,s=t.nestedUrl,u=t.category;return e.createElement("section",{className:"featured-blog-main-container"},e.createElement("div",{className:"featured-blog-image-container"},e.createElement("img",{src:d.featuredImage,alt:d.title,className:"featured-blog-image"}),e.createElement("span",{className:"post-category"},(null===(n=null==d?void 0:d.categoryInfo)||void 0===n?void 0:n.name)||"General")),e.createElement("div",{className:"featured-blog-data-container"},e.createElement("a",{href:"".concat(s?"/".concat(s):"","/post").concat(u?"/".concat(null===(o=d.categoryInfo)||void 0===o?void 0:o.slug):"","/").concat(d.slug),className:"featured-blog-title-link"},e.createElement("h2",{className:"featured-blog-title"},d.title)),e.createElement("div",{className:"featured-blog-avatar-main-container"},e.createElement("div",{className:"featured-blog-avatar"},(null===(c=d.author)||void 0===c?void 0:c.name)?null===(l=d.author)||void 0===l?void 0:l.name[0]:""),e.createElement("div",{className:"featured-blog-author-container"},e.createElement("h3",{className:"featured-blog-author-name"},(null===(r=d.author)||void 0===r?void 0:r.name)||""),e.createElement("div",{className:"featured-blog-date-read"},"On ".concat(a(d.publishedOn).format("ddd, MMM DD, YYYY"),", ").concat(d.readTime?"".concat(d.readTime," Min read"):"3 Min read")))),e.createElement("p",{className:"featured-blog-preview-content"},d.previewContent),e.createElement("a",{className:"read-more-container",href:"".concat(s?"/".concat(s):"","/post").concat(u?"/".concat(null===(m=d.categoryInfo)||void 0===m?void 0:m.slug):"","/").concat(d.slug)},e.createElement("p",null,"Read More"),i||null)))}export{t as FeaturedBlog};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{__assign as t}from"../../_virtual/_tslib.js";import e,{useState as
|
|
2
|
+
import{__assign as t}from"../../_virtual/_tslib.js";import e,{useState as o,useRef as i}from"react";function n(n){var l=n.src,r=n.alt,a=n.className,c=void 0===a?"":a,d=n.width,s=n.height,f=n.sizes,p=n.priority,u=void 0!==p&&p,m=n.placeholder,h=void 0===m?"empty":m,g=n.blurDataURL,b=n.onLoad,v=n.onError,y=n.fill,w=void 0!==y&&y,x=n.style,E=o(!1),j=E[0],z=E[1],k=o(!1),C=k[0],S=k[1],F=i(null),L=t(t({position:w?"absolute":"relative",display:"block",overflow:"hidden"},w?{top:0,left:0,bottom:0,right:0}:{}),d&&s&&!w?{width:d,height:s}:{}),H=t({position:w?"absolute":"static",top:w?0:void 0,left:w?0:void 0,bottom:w?0:void 0,right:w?0:void 0,boxSizing:"border-box",padding:0,border:"none",margin:"auto",display:"block",width:w?"100%":d||"100%",height:w?"100%":s||"auto",minWidth:"100%",maxWidth:"100%",minHeight:"100%",maxHeight:"100%",objectFit:"cover",objectPosition:"center",transition:"opacity 0.3s ease",opacity:j?1:0},x);return e.createElement("div",{className:c,style:L},!j&&!C&&e.createElement("div",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",backgroundColor:"#f3f4f6",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"12px",color:"#9ca3af"}},"blur"===h&&g?e.createElement("img",{src:g,alt:"",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:"cover",filter:"blur(10px)",transform:"scale(1.1)"}}):null),C&&e.createElement("div",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",backgroundColor:"#fef2f2",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"12px",color:"#dc2626"}},"Failed to load image"),e.createElement("img",{ref:F,src:l,alt:r,onLoad:function(){z(!0),null==b||b()},onError:function(){S(!0),null==v||v()},loading:u?"eager":"lazy",sizes:f,srcSet:f?function(){if(f){return[640,750,828,1080,1200,1920,2048].map(function(t){return"".concat(l," ").concat(t,"w")}).join(", ")}}():void 0,style:H}))}var l=function(t){if("undefined"!=typeof window){var e=document.createElement("link");e.rel="preload",e.as="image",e.href=t,document.head.appendChild(e)}};export{n as OptimizedImage,l as preloadImage};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import e,{useState as t,useEffect as a}from"react";import n from"moment";
|
|
2
|
+
import e,{useState as t,useEffect as a}from"react";import n from"moment";function o(o){var i,r,d,l,m=o.post,c=o.ish1,s=t(""),p=s[0],u=s[1];return a(function(){"undefined"!=typeof window&&u(window.location.href)},[]),a(function(){var e,t;if(p){var a={"@context":"https://schema.org","@type":"Article",headline:m.title,image:[m.featuredImage],author:{"@type":"Person",name:(null===(e=m.author)||void 0===e?void 0:e.name)||"Admin"},datePublished:n(m.publishedOn).toISOString(),dateModified:n(m.publishedOn).toISOString(),mainEntityOfPage:{"@type":"WebPage","@id":p},publisher:{"@type":"Organization",name:(null===(t=m.author)||void 0===t?void 0:t.name)||"Admin"},description:m.previewContent,articleBody:m.content.replace(/<[^>]+>/g,"")},o=document.getElementById("post-json-ld-schema");o&&document.head.removeChild(o);var i=document.createElement("script");return i.type="application/ld+json",i.id="post-json-ld-schema",i.innerHTML=JSON.stringify(a),document.head.appendChild(i),function(){document.head.contains(i)&&document.head.removeChild(i)}}},[p,m]),e.createElement("section",{className:"post-main-container"},c?e.createElement("h1",{className:"post-title"},m.title):e.createElement("h2",{className:"post-title"},m.title),e.createElement("div",{className:"post-avatar-main-container"},e.createElement("div",{className:"post-avatar"},(null===(i=m.author)||void 0===i?void 0:i.name)?null===(r=m.author)||void 0===r?void 0:r.name[0]:""),e.createElement("div",{className:"post-author-container"},e.createElement("h3",{className:"post-author-name"},(null===(d=m.author)||void 0===d?void 0:d.name)||""),e.createElement("div",{className:"post-date-read"},"On ".concat(n(m.publishedOn).format("ddd, MMM DD, YYYY"),", ").concat(m.readTime?"".concat(m.readTime," Min read"):"3 Min read")))),e.createElement("div",{className:"post-image-container"},e.createElement("img",{src:m.featuredImage,alt:m.title,className:"post-image"}),e.createElement("span",{className:"post-category"},(null===(l=null==m?void 0:m.categoryInfo)||void 0===l?void 0:l.name)||"General")),e.createElement("span",{dangerouslySetInnerHTML:{__html:m.content},className:"post-content",id:"post-content"}))}export{o as Post};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import e from"react";
|
|
2
|
+
import e from"react";function t(t){var a=t.relatedPosts,l=t.title,s=t.nestedUrl,c=t.category;return a.length?e.createElement("div",{className:"related-posts-main-container"},e.createElement("h2",{className:"related-posts-title"},l||"Related Posts"),e.createElement("div",{className:"related-posts"},a.map(function(t,a){return e.createElement("a",{key:a,className:"related-post-item",href:"".concat(s?"/".concat(s):"","/post").concat(c?"/".concat(t.categoryInfo.slug):"","/").concat(t.slug)},e.createElement("img",{src:t.featuredImage,alt:t.title,className:"related-post-item-image"}),e.createElement("h3",{className:"related-post-item-title"},t.title))}))):null}export{t as RelatedPosts};
|
package/dist/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.lm-slider{width:100%}.lm-back-to-top{align-items:center;display:flex;justify-content:center;position:fixed;transition-duration:.2s}.lm-back-to-top-svg{width:50%}.lm-hide-scroll-btn{transform:translateY(6rem)}.left-margin-xs{margin-left:5px}.reading-progress-bar-container{background-color:transparent;height:5px;left:0;position:fixed;top:0;width:100%;z-index:1000}.reading-progress-bar{height:100%;transform-origin:left;transition:width .2s ease-out}.faq-items{margin-top:1.5rem;width:100%}.faq-item{cursor:pointer;display:flex;flex-direction:column;transition:all .3s ease}.faq-question-container{align-items:center;display:flex;justify-content:space-between}.faq-icon{height:24px;transition:transform .3s ease;width:24px}.rotate{transform:rotate(45deg)}.faq-answer{max-height:0;opacity:0;overflow:hidden;transition:max-height .5s ease,opacity .5s ease}.faq-answer.open{max-height:360px;opacity:1}.skeleton-container{display:flex;flex-direction:column;gap:.5rem;width:100%}.skeleton{background-color:#e1e2e6;border-radius:.375rem;min-height:80px;overflow:hidden;position:relative;width:100%;&:after{animation:wave 1.5s linear infinite;background:linear-gradient(90deg,transparent,hsla(0,0%,100%,.4),transparent);content:"";height:100%;left:0;position:absolute;top:0;width:100%}}@keyframes wave{0%{transform:translateX(-100%)}to{transform:translateX(100%)}}.featured-blog-main-container{display:grid;gap:1.5rem;grid-template-columns:repeat(2,minmax(0,1fr));width:100%}.featured-blog-image-container{height:100%;position:relative;width:100%}.featured-blog-image{height:100%;max-height:380px;object-fit:cover;object-position:center;width:100%}.featured-blog-category{background-color:#fff;bottom:2rem;color:#000;font-size:16px;padding:12px 24px;position:absolute;right:2rem}.featured-blog-data-container{display:flex;flex-direction:column;gap:1rem;width:100%}.featured-blog-avatar-main-container{align-items:center;display:flex;gap:1rem}.featured-blog-avatar{align-items:center;background-color:#000;border-radius:100%;color:#fff;display:flex;font-size:18px;font-weight:600;height:35px;justify-content:center;min-width:35px;width:35px}.featured-blog-author-container{display:flex;flex-direction:column;gap:8px}.read-more-container{align-items:center;display:flex;gap:10px}.post-main-container{display:flex;flex-direction:column;gap:1.5rem;width:100%}.post-image-container{height:100%;position:relative;width:100%}.post-image{height:100%;max-height:380px;object-fit:cover;object-position:center;width:100%}.post-category{background-color:#fff;bottom:2rem;color:#000;font-size:16px;padding:12px 24px;position:absolute;right:2rem}.post-avatar-main-container{align-items:center;display:flex;gap:1rem}.post-avatar{align-items:center;background-color:#000;border-radius:100%;color:#fff;display:flex;font-size:18px;font-weight:600;height:35px;justify-content:center;min-width:35px;width:35px}.post-author-container{display:flex;flex-direction:column;gap:8px}.related-posts-main-container{gap:1.5rem}.related-posts,.related-posts-main-container{display:flex;flex-direction:column;width:100%}.related-posts{gap:10px}.related-post-item{align-items:center;display:flex;gap:1rem}.related-post-item-image{object-fit:cover;object-position:center}@media (max-width:768px){.featured-blog-main-container{grid-template-columns:repeat(1,minmax(0,1fr))}}.blog-list-main-container{display:flex;flex-direction:column;width:100%}.blog-list-top-container{align-items:center;display:flex;gap:1rem;justify-content:space-between}.blog-list-icons-container{align-items:center;display:flex;gap:8px}.blog-list-icon{align-items:center;border:1px solid transparent;cursor:pointer;display:flex;justify-content:center;padding:10px;transition:all .3s ease-in-out}.blog-list-icon.active{background-color:#f0f4f8;border-color:#386bb7}.blogs-grid-view{display:grid;gap:1rem;grid-template-columns:repeat(3,minmax(0,1fr));width:100%}.blogs-list-view{gap:1rem;width:100%}.blog-item-grid,.blogs-list-view{display:flex;flex-direction:column}.blog-item-list{display:flex;flex-direction:row;gap:1.5rem}.blog-item-grid-image,.blog-item-list-image{height:100%;max-height:350px;object-fit:cover;object-position:center;width:100%}.blog-details{display:flex;flex-direction:column}.blog-item-avatar-main-container{align-items:center;display:flex;gap:1rem}.blog-item-avatar{align-items:center;background-color:#000;border-radius:100%;color:#fff;display:flex;font-size:18px;font-weight:600;height:35px;justify-content:center;min-width:35px;width:35px}.blog-item-author-container{display:flex;flex-direction:column;gap:8px}.blog-item-read-more-container{align-items:center;display:flex;gap:10px}.blog-list-load-more-container{align-items:center;display:flex;justify-content:center;width:100%}@media (max-width:1024px){.blogs-grid-view{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (max-width:640px){.blogs-grid-view{grid-template-columns:repeat(1,minmax(0,1fr))}.blog-item-list{flex-direction:column}}.modal-wrapper{align-items:center;background-color:#00000095;display:flex;inset:0;justify-content:center;left:0;position:fixed;top:0;z-index:9999}.modal-container{align-items:center;background-color:#fff;box-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);display:flex;flex-direction:column;max-width:26rem;padding:1rem 2rem;position:relative;width:90%}.modal-close-button{position:absolute;right:.75rem;top:.75rem}.modal-title{font-size:1.5rem;font-weight:600;margin-bottom:1rem;text-align:center}.modal-form-container,.modal-form-wrapper{display:flex;flex-direction:column;width:100%}.modal-form-container{gap:.5rem}.input-container{display:flex;flex-direction:column;width:100%}.modal-form-input{height:3rem;padding:1.5rem;transition:all;transition-duration:.3s;width:100%}.modal-form-error-message{color:#ef4444;font-size:.875rem;margin-top:.25rem}.modal-form-button-container{align-items:center;display:flex;justify-content:center}.modal-form-submit-button{border-radius:5px;font-size:15px;font-weight:500;padding:14px 28px;width:100%}.exit-intent-modal-wrapper{align-items:center;background-color:#00000095;display:flex;inset:0;justify-content:center;left:0;position:fixed;top:0;z-index:9999}.exit-intent-modal-container{align-items:center;background-color:#fff;box-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);display:flex;flex-direction:column;max-width:26rem;padding:1rem 2rem;position:relative;width:90%}.exit-intent-modal-close-button{position:absolute;right:.75rem;top:.75rem}.lm-hero-slider{align-items:center;display:flex;justify-content:center;overflow:hidden;position:relative;width:100%}.lm-hero-slider-container{height:100%;position:relative;width:100%}.lm-hero-slider-slide{align-items:center;background-position:50%;background-repeat:no-repeat;background-size:cover;display:flex;height:100%;justify-content:center;left:0;opacity:0;position:absolute;top:0;transition:all .5s ease-in-out;width:100%}.lm-hero-slider-slide.fade.active{opacity:1}.lm-hero-slider-slide.scroll{opacity:1;transition:transform .5s ease-in-out}.lm-hero-slider-overlay{align-items:center;background:rgba(0,0,0,.4);bottom:0;display:flex;justify-content:center;left:0;padding:2rem;position:absolute;right:0;top:0}.lm-hero-slider-content{color:#fff;max-width:800px;text-align:center;z-index:2}.lm-hero-slider-title{font-size:3rem;font-weight:700;line-height:1.2;margin-bottom:1rem;text-shadow:2px 2px 4px rgba(0,0,0,.5)}.lm-hero-slider-description{font-size:1.25rem;line-height:1.5;margin-bottom:2rem;text-shadow:1px 1px 2px rgba(0,0,0,.5)}.lm-hero-slider-content .lm-hero-slider-title:last-child{margin-bottom:2rem}.lm-hero-slider-content .lm-hero-slider-title+.lm-hero-slider-button{margin-top:1rem}.lm-hero-slider-button{background-color:#f97316;border-radius:.5rem;color:#fff;display:inline-block;font-weight:600;letter-spacing:.5px;padding:.875rem 2rem;text-decoration:none;text-transform:uppercase;transition:all .3s ease}.lm-hero-slider-button:hover{background-color:#ea580c;box-shadow:0 4px 12px rgba(0,0,0,.3);transform:translateY(-2px)}.lm-hero-slider-nav{align-items:center;background:hsla(0,0%,100%,.9);border:none;border-radius:50%;color:#333;cursor:pointer;display:flex;height:50px;justify-content:center;position:absolute;top:50%;transform:translateY(-50%);transition:all .3s ease;width:50px;z-index:10}.lm-hero-slider-nav:hover{background:#fff;transform:translateY(-50%) scale(1.1)}.lm-hero-slider-nav:disabled{cursor:not-allowed;opacity:.5;transform:translateY(-50%)}.lm-hero-slider-prev{left:1rem}.lm-hero-slider-next{right:1rem}.lm-hero-slider-dots{bottom:2rem;display:flex;gap:.5rem;left:50%;position:absolute;transform:translateX(-50%);z-index:10}.lm-hero-slider-dot{background:transparent;border:2px solid hsla(0,0%,100%,.7);border-radius:50%;cursor:pointer;height:12px;transition:all .3s ease;width:12px}.lm-hero-slider-dot.active{background:#fff;border-color:#fff}.lm-hero-slider-dot:hover{border-color:#fff;transform:scale(1.2)}.lm-hero-slider-dot:disabled{cursor:not-allowed;opacity:.5}@media (max-width:768px){.lm-hero-slider-title{font-size:2rem}.lm-hero-slider-description{font-size:1rem}.lm-hero-slider-content{padding:1rem}.lm-hero-slider-nav{height:40px;width:40px}.lm-hero-slider-prev{left:.5rem}.lm-hero-slider-next{right:.5rem}.lm-hero-slider-dots{bottom:1rem}}@media (max-width:480px){.lm-hero-slider-title{font-size:1.5rem}.lm-hero-slider-description{font-size:.875rem;margin-bottom:1.5rem}.lm-hero-slider-button{font-size:.875rem;padding:.75rem 1.5rem}}
|
|
1
|
+
.lm-slider{width:100%}.lm-back-to-top{align-items:center;display:flex;justify-content:center;position:fixed;transition-duration:.2s}.lm-back-to-top-svg{width:50%}.lm-hide-scroll-btn{transform:translateY(6rem)}.left-margin-xs{margin-left:5px}.reading-progress-bar-container{background-color:transparent;height:5px;left:0;position:fixed;top:0;width:100%;z-index:1000}.reading-progress-bar{height:100%;transform-origin:left;transition:width .2s ease-out}.faq-items{margin-top:1.5rem;width:100%}.faq-item{cursor:pointer;display:flex;flex-direction:column;transition:all .3s ease}.faq-question-container{align-items:center;display:flex;justify-content:space-between}.faq-icon{height:24px;transition:transform .3s ease;width:24px}.rotate{transform:rotate(45deg)}.faq-answer{max-height:0;opacity:0;overflow:hidden;transition:max-height .5s ease,opacity .5s ease}.faq-answer.open{max-height:360px;opacity:1}.skeleton-container{display:flex;flex-direction:column;gap:.5rem;width:100%}.skeleton{background-color:#e1e2e6;border-radius:.375rem;min-height:80px;overflow:hidden;position:relative;width:100%;&:after{animation:wave 1.5s linear infinite;background:linear-gradient(90deg,transparent,hsla(0,0%,100%,.4),transparent);content:"";height:100%;left:0;position:absolute;top:0;width:100%}}@keyframes wave{0%{transform:translateX(-100%)}to{transform:translateX(100%)}}.featured-blog-main-container{display:grid;gap:1.5rem;grid-template-columns:repeat(2,minmax(0,1fr));width:100%}.featured-blog-image-container{height:100%;position:relative;width:100%}.featured-blog-image{height:100%;max-height:380px;object-fit:cover;object-position:center;width:100%}.featured-blog-category{background-color:#fff;bottom:2rem;color:#000;font-size:16px;padding:12px 24px;position:absolute;right:2rem}.featured-blog-data-container{display:flex;flex-direction:column;gap:1rem;width:100%}.featured-blog-avatar-main-container{align-items:center;display:flex;gap:1rem}.featured-blog-avatar{align-items:center;background-color:#000;border-radius:100%;color:#fff;display:flex;font-size:18px;font-weight:600;height:35px;justify-content:center;min-width:35px;width:35px}.featured-blog-author-container{display:flex;flex-direction:column;gap:8px}.read-more-container{align-items:center;display:flex;gap:10px}.post-main-container{display:flex;flex-direction:column;gap:1.5rem;width:100%}.post-image-container{height:100%;position:relative;width:100%}.post-image{height:100%;max-height:380px;object-fit:cover;object-position:center;width:100%}.post-category{background-color:#fff;bottom:2rem;color:#000;font-size:16px;padding:12px 24px;position:absolute;right:2rem}.post-avatar-main-container{align-items:center;display:flex;gap:1rem}.post-avatar{align-items:center;background-color:#000;border-radius:100%;color:#fff;display:flex;font-size:18px;font-weight:600;height:35px;justify-content:center;min-width:35px;width:35px}.post-author-container{display:flex;flex-direction:column;gap:8px}.related-posts-main-container{gap:1.5rem}.related-posts,.related-posts-main-container{display:flex;flex-direction:column;width:100%}.related-posts{gap:10px}.related-post-item{align-items:center;display:flex;gap:1rem}.related-post-item-image{object-fit:cover;object-position:center}@media (max-width:768px){.featured-blog-main-container{grid-template-columns:repeat(1,minmax(0,1fr))}}.blog-list-main-container{display:flex;flex-direction:column;width:100%}.blog-list-top-container{align-items:center;display:flex;gap:1rem;justify-content:space-between}.blog-list-icons-container{align-items:center;display:flex;gap:8px}.blog-list-icon{align-items:center;border:1px solid transparent;cursor:pointer;display:flex;justify-content:center;padding:10px;transition:all .3s ease-in-out}.blog-list-icon.active{background-color:#f0f4f8;border-color:#386bb7}.blogs-grid-view{display:grid;gap:1rem;grid-template-columns:repeat(3,minmax(0,1fr));width:100%}.blogs-list-view{gap:1rem;width:100%}.blog-item-grid,.blogs-list-view{display:flex;flex-direction:column}.blog-item-list{display:flex;flex-direction:row;gap:1.5rem}.blog-item-grid-image,.blog-item-list-image{height:100%;max-height:350px;object-fit:cover;object-position:center;width:100%}.blog-details{display:flex;flex-direction:column}.blog-item-avatar-main-container{align-items:center;display:flex;gap:1rem}.blog-item-avatar{align-items:center;background-color:#000;border-radius:100%;color:#fff;display:flex;font-size:18px;font-weight:600;height:35px;justify-content:center;min-width:35px;width:35px}.blog-item-author-container{display:flex;flex-direction:column;gap:8px}.blog-item-read-more-container{align-items:center;display:flex;gap:10px}.blog-list-load-more-container{align-items:center;display:flex;justify-content:center;width:100%}@media (max-width:1024px){.blogs-grid-view{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (max-width:640px){.blogs-grid-view{grid-template-columns:repeat(1,minmax(0,1fr))}.blog-item-list{flex-direction:column}}.modal-wrapper{align-items:center;background-color:#00000095;display:flex;inset:0;justify-content:center;left:0;position:fixed;top:0;z-index:9999}.modal-container{align-items:center;background-color:#fff;box-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);display:flex;flex-direction:column;max-width:26rem;padding:1rem 2rem;position:relative;width:90%}.modal-close-button{position:absolute;right:.75rem;top:.75rem}.modal-title{font-size:1.5rem;font-weight:600;margin-bottom:1rem;text-align:center}.modal-form-container,.modal-form-wrapper{display:flex;flex-direction:column;width:100%}.modal-form-container{gap:.5rem}.input-container{display:flex;flex-direction:column;width:100%}.modal-form-input{height:3rem;padding:1.5rem;transition:all;transition-duration:.3s;width:100%}.modal-form-error-message{color:#ef4444;font-size:.875rem;margin-top:.25rem}.modal-form-button-container{align-items:center;display:flex;justify-content:center}.modal-form-submit-button{border-radius:5px;font-size:15px;font-weight:500;padding:14px 28px;width:100%}.exit-intent-modal-wrapper{align-items:center;background-color:#00000095;display:flex;inset:0;justify-content:center;left:0;position:fixed;top:0;z-index:9999}.exit-intent-modal-container{align-items:center;background-color:#fff;box-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);display:flex;flex-direction:column;max-width:26rem;padding:1rem 2rem;position:relative;width:90%}.exit-intent-modal-close-button{position:absolute;right:.75rem;top:.75rem}.lm-hero-slider{align-items:center;display:flex;justify-content:center;overflow:hidden;position:relative;width:100%}.lm-hero-slider-container{height:100%;position:relative;width:100%}.lm-hero-slider-slide{align-items:center;background-position:50%;background-repeat:no-repeat;background-size:cover;display:flex;height:100%;justify-content:center;left:0;opacity:0;position:absolute;top:0;transition:all .5s ease-in-out;width:100%}.lm-hero-slider-slide.fade.active{opacity:1}.lm-hero-slider-slide.scroll{opacity:1;transition:transform .5s ease-in-out}.lm-hero-slider-overlay{align-items:center;background:rgba(0,0,0,.4);bottom:0;display:flex;justify-content:center;left:0;padding:2rem;position:absolute;right:0;top:0}.lm-hero-slider-content{color:#fff;max-width:800px;text-align:center;z-index:2}.lm-hero-slider-title{font-size:3rem;font-weight:700;line-height:1.2;margin-bottom:1rem;text-shadow:2px 2px 4px rgba(0,0,0,.5)}.lm-hero-slider-description{font-size:1.25rem;line-height:1.5;margin-bottom:2rem;text-shadow:1px 1px 2px rgba(0,0,0,.5)}.lm-hero-slider-content .lm-hero-slider-title:last-child{margin-bottom:2rem}.lm-hero-slider-content .lm-hero-slider-title+.lm-hero-slider-button{margin-top:1rem}.lm-hero-slider-button{background-color:#f97316;border-radius:.5rem;color:#fff;display:inline-block;font-weight:600;letter-spacing:.5px;padding:.875rem 2rem;text-decoration:none;text-transform:uppercase;transition:all .3s ease}.lm-hero-slider-button:hover{background-color:#ea580c;box-shadow:0 4px 12px rgba(0,0,0,.3);transform:translateY(-2px)}.lm-hero-slider-nav{align-items:center;background:hsla(0,0%,100%,.9);border:none;border-radius:50%;color:#333;cursor:pointer;display:flex;height:50px;justify-content:center;position:absolute;top:50%;transform:translateY(-50%);transition:all .3s ease;width:50px;z-index:10}.lm-hero-slider-nav:hover{background:#fff;transform:translateY(-50%) scale(1.1)}.lm-hero-slider-nav:disabled{cursor:not-allowed;opacity:.5;transform:translateY(-50%)}.lm-hero-slider-prev{left:1rem}.lm-hero-slider-next{right:1rem}.lm-hero-slider-dots{bottom:2rem;display:flex;gap:.5rem;left:50%;position:absolute;transform:translateX(-50%);z-index:10}.lm-hero-slider-dot{background:transparent;border:2px solid hsla(0,0%,100%,.7);border-radius:50%;cursor:pointer;height:12px;transition:all .3s ease;width:12px}.lm-hero-slider-dot.active{background:#fff;border-color:#fff}.lm-hero-slider-dot:hover{border-color:#fff;transform:scale(1.2)}.lm-hero-slider-dot:disabled{cursor:not-allowed;opacity:.5}@media (max-width:768px){.lm-hero-slider-title{font-size:2rem}.lm-hero-slider-description{font-size:1rem}.lm-hero-slider-content{padding:1rem}.lm-hero-slider-nav{height:40px;width:40px}.lm-hero-slider-prev{left:.5rem}.lm-hero-slider-next{right:.5rem}.lm-hero-slider-dots{bottom:1rem}}@media (max-width:480px){.lm-hero-slider-title{font-size:1.5rem}.lm-hero-slider-description{font-size:.875rem;margin-bottom:1.5rem}.lm-hero-slider-button{font-size:.875rem;padding:.75rem 1.5rem}}
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{Copyright}from"./controls/copyright/index.js";export{Email}from"./controls/email/index.js";export{INSTA_MEDIA_TYPES,InstaFeed}from"./controls/instaFeed/index.js";export{Map}from"./controls/map/index.js";export{Phone}from"./controls/phone/index.js";export{BackToTop}from"./controls/backToTop/index.js";export{CopyrightWithUTM}from"./controls/copyrightWithUTM/index.js";export{SocialShare}from"./controls/socialShare/index.js";export{ReadingProgressBar}from"./controls/readingProgressBar/index.js";export{TableOfContents}from"./controls/tableOfContents/index.js";export{Faq}from"./controls/faq/index.js";export{FaqSchema}from"./controls/faqSchema/index.js";export{FeaturedBlog}from"./controls/featuredBlog/index.js";export{Post}from"./controls/post/index.js";export{PostJsonLD}from"./controls/postSchema/index.js";export{RelatedPosts}from"./controls/relatedPosts/index.js";export{BlogList}from"./controls/blogList/index.js";export{BlogListJsonLD}from"./controls/blogListSchema/index.js";export{ModalForm}from"./controls/modalForm/index.js";export{BreadCrumbJsonLD}from"./controls/breadCrumbSchema/index.js";export{OrganizationJsonLD}from"./controls/organizationSchema/index.js";export{ExitIntent}from"./controls/exitIntent/index.js";export{IdleTimeIntent}from"./controls/idleTimeIntent/index.js";export{HeroSlider}from"./controls/heroSlider/index.js";
|
|
1
|
+
export{Copyright}from"./controls/copyright/index.js";export{Email}from"./controls/email/index.js";export{INSTA_MEDIA_TYPES,InstaFeed}from"./controls/instaFeed/index.js";export{Map}from"./controls/map/index.js";export{Phone}from"./controls/phone/index.js";export{BackToTop}from"./controls/backToTop/index.js";export{CopyrightWithUTM}from"./controls/copyrightWithUTM/index.js";export{SocialShare}from"./controls/socialShare/index.js";export{ReadingProgressBar}from"./controls/readingProgressBar/index.js";export{TableOfContents}from"./controls/tableOfContents/index.js";export{Faq}from"./controls/faq/index.js";export{FaqSchema}from"./controls/faqSchema/index.js";export{FeaturedBlog}from"./controls/featuredBlog/index.js";export{Post}from"./controls/post/index.js";export{PostJsonLD}from"./controls/postSchema/index.js";export{RelatedPosts}from"./controls/relatedPosts/index.js";export{BlogList}from"./controls/blogList/index.js";export{BlogListJsonLD}from"./controls/blogListSchema/index.js";export{ModalForm}from"./controls/modalForm/index.js";export{BreadCrumbJsonLD}from"./controls/breadCrumbSchema/index.js";export{OrganizationJsonLD}from"./controls/organizationSchema/index.js";export{ExitIntent}from"./controls/exitIntent/index.js";export{IdleTimeIntent}from"./controls/idleTimeIntent/index.js";export{HeroSlider}from"./controls/heroSlider/index.js";
|
package/dist/styles/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.lm-slider{width:100%}.lm-back-to-top{align-items:center;display:flex;justify-content:center;position:fixed;transition-duration:.2s}.lm-back-to-top-svg{width:50%}.lm-hide-scroll-btn{transform:translateY(6rem)}.left-margin-xs{margin-left:5px}.reading-progress-bar-container{background-color:transparent;height:5px;left:0;position:fixed;top:0;width:100%;z-index:1000}.reading-progress-bar{height:100%;transform-origin:left;transition:width .2s ease-out}.faq-items{margin-top:1.5rem;width:100%}.faq-item{cursor:pointer;display:flex;flex-direction:column;transition:all .3s ease}.faq-question-container{align-items:center;display:flex;justify-content:space-between}.faq-icon{height:24px;transition:transform .3s ease;width:24px}.rotate{transform:rotate(45deg)}.faq-answer{max-height:0;opacity:0;overflow:hidden;transition:max-height .5s ease,opacity .5s ease}.faq-answer.open{max-height:360px;opacity:1}.skeleton-container{display:flex;flex-direction:column;gap:.5rem;width:100%}.skeleton{background-color:#e1e2e6;border-radius:.375rem;min-height:80px;overflow:hidden;position:relative;width:100%;&:after{animation:wave 1.5s linear infinite;background:linear-gradient(90deg,transparent,hsla(0,0%,100%,.4),transparent);content:"";height:100%;left:0;position:absolute;top:0;width:100%}}@keyframes wave{0%{transform:translateX(-100%)}to{transform:translateX(100%)}}.featured-blog-main-container{display:grid;gap:1.5rem;grid-template-columns:repeat(2,minmax(0,1fr));width:100%}.featured-blog-image-container{height:100%;position:relative;width:100%}.featured-blog-image{height:100%;max-height:380px;object-fit:cover;object-position:center;width:100%}.featured-blog-category{background-color:#fff;bottom:2rem;color:#000;font-size:16px;padding:12px 24px;position:absolute;right:2rem}.featured-blog-data-container{display:flex;flex-direction:column;gap:1rem;width:100%}.featured-blog-avatar-main-container{align-items:center;display:flex;gap:1rem}.featured-blog-avatar{align-items:center;background-color:#000;border-radius:100%;color:#fff;display:flex;font-size:18px;font-weight:600;height:35px;justify-content:center;min-width:35px;width:35px}.featured-blog-author-container{display:flex;flex-direction:column;gap:8px}.read-more-container{align-items:center;display:flex;gap:10px}.post-main-container{display:flex;flex-direction:column;gap:1.5rem;width:100%}.post-image-container{height:100%;position:relative;width:100%}.post-image{height:100%;max-height:380px;object-fit:cover;object-position:center;width:100%}.post-category{background-color:#fff;bottom:2rem;color:#000;font-size:16px;padding:12px 24px;position:absolute;right:2rem}.post-avatar-main-container{align-items:center;display:flex;gap:1rem}.post-avatar{align-items:center;background-color:#000;border-radius:100%;color:#fff;display:flex;font-size:18px;font-weight:600;height:35px;justify-content:center;min-width:35px;width:35px}.post-author-container{display:flex;flex-direction:column;gap:8px}.related-posts-main-container{gap:1.5rem}.related-posts,.related-posts-main-container{display:flex;flex-direction:column;width:100%}.related-posts{gap:10px}.related-post-item{align-items:center;display:flex;gap:1rem}.related-post-item-image{object-fit:cover;object-position:center}@media (max-width:768px){.featured-blog-main-container{grid-template-columns:repeat(1,minmax(0,1fr))}}.blog-list-main-container{display:flex;flex-direction:column;width:100%}.blog-list-top-container{align-items:center;display:flex;gap:1rem;justify-content:space-between}.blog-list-icons-container{align-items:center;display:flex;gap:8px}.blog-list-icon{align-items:center;border:1px solid transparent;cursor:pointer;display:flex;justify-content:center;padding:10px;transition:all .3s ease-in-out}.blog-list-icon.active{background-color:#f0f4f8;border-color:#386bb7}.blogs-grid-view{display:grid;gap:1rem;grid-template-columns:repeat(3,minmax(0,1fr));width:100%}.blogs-list-view{gap:1rem;width:100%}.blog-item-grid,.blogs-list-view{display:flex;flex-direction:column}.blog-item-list{display:flex;flex-direction:row;gap:1.5rem}.blog-item-grid-image,.blog-item-list-image{height:100%;max-height:350px;object-fit:cover;object-position:center;width:100%}.blog-details{display:flex;flex-direction:column}.blog-item-avatar-main-container{align-items:center;display:flex;gap:1rem}.blog-item-avatar{align-items:center;background-color:#000;border-radius:100%;color:#fff;display:flex;font-size:18px;font-weight:600;height:35px;justify-content:center;min-width:35px;width:35px}.blog-item-author-container{display:flex;flex-direction:column;gap:8px}.blog-item-read-more-container{align-items:center;display:flex;gap:10px}.blog-list-load-more-container{align-items:center;display:flex;justify-content:center;width:100%}@media (max-width:1024px){.blogs-grid-view{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (max-width:640px){.blogs-grid-view{grid-template-columns:repeat(1,minmax(0,1fr))}.blog-item-list{flex-direction:column}}.modal-wrapper{align-items:center;background-color:#00000095;display:flex;inset:0;justify-content:center;left:0;position:fixed;top:0;z-index:9999}.modal-container{align-items:center;background-color:#fff;box-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);display:flex;flex-direction:column;max-width:26rem;padding:1rem 2rem;position:relative;width:90%}.modal-close-button{position:absolute;right:.75rem;top:.75rem}.modal-title{font-size:1.5rem;font-weight:600;margin-bottom:1rem;text-align:center}.modal-form-container,.modal-form-wrapper{display:flex;flex-direction:column;width:100%}.modal-form-container{gap:.5rem}.input-container{display:flex;flex-direction:column;width:100%}.modal-form-input{height:3rem;padding:1.5rem;transition:all;transition-duration:.3s;width:100%}.modal-form-error-message{color:#ef4444;font-size:.875rem;margin-top:.25rem}.modal-form-button-container{align-items:center;display:flex;justify-content:center}.modal-form-submit-button{border-radius:5px;font-size:15px;font-weight:500;padding:14px 28px;width:100%}.exit-intent-modal-wrapper{align-items:center;background-color:#00000095;display:flex;inset:0;justify-content:center;left:0;position:fixed;top:0;z-index:9999}.exit-intent-modal-container{align-items:center;background-color:#fff;box-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);display:flex;flex-direction:column;max-width:26rem;padding:1rem 2rem;position:relative;width:90%}.exit-intent-modal-close-button{position:absolute;right:.75rem;top:.75rem}.lm-hero-slider{align-items:center;display:flex;justify-content:center;overflow:hidden;position:relative;width:100%}.lm-hero-slider-container{height:100%;position:relative;width:100%}.lm-hero-slider-slide{align-items:center;background-position:50%;background-repeat:no-repeat;background-size:cover;display:flex;height:100%;justify-content:center;left:0;opacity:0;position:absolute;top:0;transition:all .5s ease-in-out;width:100%}.lm-hero-slider-slide.fade.active{opacity:1}.lm-hero-slider-slide.scroll{opacity:1;transition:transform .5s ease-in-out}.lm-hero-slider-overlay{align-items:center;background:rgba(0,0,0,.4);bottom:0;display:flex;justify-content:center;left:0;padding:2rem;position:absolute;right:0;top:0}.lm-hero-slider-content{color:#fff;max-width:800px;text-align:center;z-index:2}.lm-hero-slider-title{font-size:3rem;font-weight:700;line-height:1.2;margin-bottom:1rem;text-shadow:2px 2px 4px rgba(0,0,0,.5)}.lm-hero-slider-description{font-size:1.25rem;line-height:1.5;margin-bottom:2rem;text-shadow:1px 1px 2px rgba(0,0,0,.5)}.lm-hero-slider-content .lm-hero-slider-title:last-child{margin-bottom:2rem}.lm-hero-slider-content .lm-hero-slider-title+.lm-hero-slider-button{margin-top:1rem}.lm-hero-slider-button{background-color:#f97316;border-radius:.5rem;color:#fff;display:inline-block;font-weight:600;letter-spacing:.5px;padding:.875rem 2rem;text-decoration:none;text-transform:uppercase;transition:all .3s ease}.lm-hero-slider-button:hover{background-color:#ea580c;box-shadow:0 4px 12px rgba(0,0,0,.3);transform:translateY(-2px)}.lm-hero-slider-nav{align-items:center;background:hsla(0,0%,100%,.9);border:none;border-radius:50%;color:#333;cursor:pointer;display:flex;height:50px;justify-content:center;position:absolute;top:50%;transform:translateY(-50%);transition:all .3s ease;width:50px;z-index:10}.lm-hero-slider-nav:hover{background:#fff;transform:translateY(-50%) scale(1.1)}.lm-hero-slider-nav:disabled{cursor:not-allowed;opacity:.5;transform:translateY(-50%)}.lm-hero-slider-prev{left:1rem}.lm-hero-slider-next{right:1rem}.lm-hero-slider-dots{bottom:2rem;display:flex;gap:.5rem;left:50%;position:absolute;transform:translateX(-50%);z-index:10}.lm-hero-slider-dot{background:transparent;border:2px solid hsla(0,0%,100%,.7);border-radius:50%;cursor:pointer;height:12px;transition:all .3s ease;width:12px}.lm-hero-slider-dot.active{background:#fff;border-color:#fff}.lm-hero-slider-dot:hover{border-color:#fff;transform:scale(1.2)}.lm-hero-slider-dot:disabled{cursor:not-allowed;opacity:.5}@media (max-width:768px){.lm-hero-slider-title{font-size:2rem}.lm-hero-slider-description{font-size:1rem}.lm-hero-slider-content{padding:1rem}.lm-hero-slider-nav{height:40px;width:40px}.lm-hero-slider-prev{left:.5rem}.lm-hero-slider-next{right:.5rem}.lm-hero-slider-dots{bottom:1rem}}@media (max-width:480px){.lm-hero-slider-title{font-size:1.5rem}.lm-hero-slider-description{font-size:.875rem;margin-bottom:1.5rem}.lm-hero-slider-button{font-size:.875rem;padding:.75rem 1.5rem}}
|
|
1
|
+
.lm-slider{width:100%}.lm-back-to-top{align-items:center;display:flex;justify-content:center;position:fixed;transition-duration:.2s}.lm-back-to-top-svg{width:50%}.lm-hide-scroll-btn{transform:translateY(6rem)}.left-margin-xs{margin-left:5px}.reading-progress-bar-container{background-color:transparent;height:5px;left:0;position:fixed;top:0;width:100%;z-index:1000}.reading-progress-bar{height:100%;transform-origin:left;transition:width .2s ease-out}.faq-items{margin-top:1.5rem;width:100%}.faq-item{cursor:pointer;display:flex;flex-direction:column;transition:all .3s ease}.faq-question-container{align-items:center;display:flex;justify-content:space-between}.faq-icon{height:24px;transition:transform .3s ease;width:24px}.rotate{transform:rotate(45deg)}.faq-answer{max-height:0;opacity:0;overflow:hidden;transition:max-height .5s ease,opacity .5s ease}.faq-answer.open{max-height:360px;opacity:1}.skeleton-container{display:flex;flex-direction:column;gap:.5rem;width:100%}.skeleton{background-color:#e1e2e6;border-radius:.375rem;min-height:80px;overflow:hidden;position:relative;width:100%;&:after{animation:wave 1.5s linear infinite;background:linear-gradient(90deg,transparent,hsla(0,0%,100%,.4),transparent);content:"";height:100%;left:0;position:absolute;top:0;width:100%}}@keyframes wave{0%{transform:translateX(-100%)}to{transform:translateX(100%)}}.featured-blog-main-container{display:grid;gap:1.5rem;grid-template-columns:repeat(2,minmax(0,1fr));width:100%}.featured-blog-image-container{height:100%;position:relative;width:100%}.featured-blog-image{height:100%;max-height:380px;object-fit:cover;object-position:center;width:100%}.featured-blog-category{background-color:#fff;bottom:2rem;color:#000;font-size:16px;padding:12px 24px;position:absolute;right:2rem}.featured-blog-data-container{display:flex;flex-direction:column;gap:1rem;width:100%}.featured-blog-avatar-main-container{align-items:center;display:flex;gap:1rem}.featured-blog-avatar{align-items:center;background-color:#000;border-radius:100%;color:#fff;display:flex;font-size:18px;font-weight:600;height:35px;justify-content:center;min-width:35px;width:35px}.featured-blog-author-container{display:flex;flex-direction:column;gap:8px}.read-more-container{align-items:center;display:flex;gap:10px}.post-main-container{display:flex;flex-direction:column;gap:1.5rem;width:100%}.post-image-container{height:100%;position:relative;width:100%}.post-image{height:100%;max-height:380px;object-fit:cover;object-position:center;width:100%}.post-category{background-color:#fff;bottom:2rem;color:#000;font-size:16px;padding:12px 24px;position:absolute;right:2rem}.post-avatar-main-container{align-items:center;display:flex;gap:1rem}.post-avatar{align-items:center;background-color:#000;border-radius:100%;color:#fff;display:flex;font-size:18px;font-weight:600;height:35px;justify-content:center;min-width:35px;width:35px}.post-author-container{display:flex;flex-direction:column;gap:8px}.related-posts-main-container{gap:1.5rem}.related-posts,.related-posts-main-container{display:flex;flex-direction:column;width:100%}.related-posts{gap:10px}.related-post-item{align-items:center;display:flex;gap:1rem}.related-post-item-image{object-fit:cover;object-position:center}@media (max-width:768px){.featured-blog-main-container{grid-template-columns:repeat(1,minmax(0,1fr))}}.blog-list-main-container{display:flex;flex-direction:column;width:100%}.blog-list-top-container{align-items:center;display:flex;gap:1rem;justify-content:space-between}.blog-list-icons-container{align-items:center;display:flex;gap:8px}.blog-list-icon{align-items:center;border:1px solid transparent;cursor:pointer;display:flex;justify-content:center;padding:10px;transition:all .3s ease-in-out}.blog-list-icon.active{background-color:#f0f4f8;border-color:#386bb7}.blogs-grid-view{display:grid;gap:1rem;grid-template-columns:repeat(3,minmax(0,1fr));width:100%}.blogs-list-view{gap:1rem;width:100%}.blog-item-grid,.blogs-list-view{display:flex;flex-direction:column}.blog-item-list{display:flex;flex-direction:row;gap:1.5rem}.blog-item-grid-image,.blog-item-list-image{height:100%;max-height:350px;object-fit:cover;object-position:center;width:100%}.blog-details{display:flex;flex-direction:column}.blog-item-avatar-main-container{align-items:center;display:flex;gap:1rem}.blog-item-avatar{align-items:center;background-color:#000;border-radius:100%;color:#fff;display:flex;font-size:18px;font-weight:600;height:35px;justify-content:center;min-width:35px;width:35px}.blog-item-author-container{display:flex;flex-direction:column;gap:8px}.blog-item-read-more-container{align-items:center;display:flex;gap:10px}.blog-list-load-more-container{align-items:center;display:flex;justify-content:center;width:100%}@media (max-width:1024px){.blogs-grid-view{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (max-width:640px){.blogs-grid-view{grid-template-columns:repeat(1,minmax(0,1fr))}.blog-item-list{flex-direction:column}}.modal-wrapper{align-items:center;background-color:#00000095;display:flex;inset:0;justify-content:center;left:0;position:fixed;top:0;z-index:9999}.modal-container{align-items:center;background-color:#fff;box-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);display:flex;flex-direction:column;max-width:26rem;padding:1rem 2rem;position:relative;width:90%}.modal-close-button{position:absolute;right:.75rem;top:.75rem}.modal-title{font-size:1.5rem;font-weight:600;margin-bottom:1rem;text-align:center}.modal-form-container,.modal-form-wrapper{display:flex;flex-direction:column;width:100%}.modal-form-container{gap:.5rem}.input-container{display:flex;flex-direction:column;width:100%}.modal-form-input{height:3rem;padding:1.5rem;transition:all;transition-duration:.3s;width:100%}.modal-form-error-message{color:#ef4444;font-size:.875rem;margin-top:.25rem}.modal-form-button-container{align-items:center;display:flex;justify-content:center}.modal-form-submit-button{border-radius:5px;font-size:15px;font-weight:500;padding:14px 28px;width:100%}.exit-intent-modal-wrapper{align-items:center;background-color:#00000095;display:flex;inset:0;justify-content:center;left:0;position:fixed;top:0;z-index:9999}.exit-intent-modal-container{align-items:center;background-color:#fff;box-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);display:flex;flex-direction:column;max-width:26rem;padding:1rem 2rem;position:relative;width:90%}.exit-intent-modal-close-button{position:absolute;right:.75rem;top:.75rem}.lm-hero-slider{align-items:center;display:flex;justify-content:center;overflow:hidden;position:relative;width:100%}.lm-hero-slider-container{height:100%;position:relative;width:100%}.lm-hero-slider-slide{align-items:center;background-position:50%;background-repeat:no-repeat;background-size:cover;display:flex;height:100%;justify-content:center;left:0;opacity:0;position:absolute;top:0;transition:all .5s ease-in-out;width:100%}.lm-hero-slider-slide.fade.active{opacity:1}.lm-hero-slider-slide.scroll{opacity:1;transition:transform .5s ease-in-out}.lm-hero-slider-overlay{align-items:center;background:rgba(0,0,0,.4);bottom:0;display:flex;justify-content:center;left:0;padding:2rem;position:absolute;right:0;top:0}.lm-hero-slider-content{color:#fff;max-width:800px;text-align:center;z-index:2}.lm-hero-slider-title{font-size:3rem;font-weight:700;line-height:1.2;margin-bottom:1rem;text-shadow:2px 2px 4px rgba(0,0,0,.5)}.lm-hero-slider-description{font-size:1.25rem;line-height:1.5;margin-bottom:2rem;text-shadow:1px 1px 2px rgba(0,0,0,.5)}.lm-hero-slider-content .lm-hero-slider-title:last-child{margin-bottom:2rem}.lm-hero-slider-content .lm-hero-slider-title+.lm-hero-slider-button{margin-top:1rem}.lm-hero-slider-button{background-color:#f97316;border-radius:.5rem;color:#fff;display:inline-block;font-weight:600;letter-spacing:.5px;padding:.875rem 2rem;text-decoration:none;text-transform:uppercase;transition:all .3s ease}.lm-hero-slider-button:hover{background-color:#ea580c;box-shadow:0 4px 12px rgba(0,0,0,.3);transform:translateY(-2px)}.lm-hero-slider-nav{align-items:center;background:hsla(0,0%,100%,.9);border:none;border-radius:50%;color:#333;cursor:pointer;display:flex;height:50px;justify-content:center;position:absolute;top:50%;transform:translateY(-50%);transition:all .3s ease;width:50px;z-index:10}.lm-hero-slider-nav:hover{background:#fff;transform:translateY(-50%) scale(1.1)}.lm-hero-slider-nav:disabled{cursor:not-allowed;opacity:.5;transform:translateY(-50%)}.lm-hero-slider-prev{left:1rem}.lm-hero-slider-next{right:1rem}.lm-hero-slider-dots{bottom:2rem;display:flex;gap:.5rem;left:50%;position:absolute;transform:translateX(-50%);z-index:10}.lm-hero-slider-dot{background:transparent;border:2px solid hsla(0,0%,100%,.7);border-radius:50%;cursor:pointer;height:12px;transition:all .3s ease;width:12px}.lm-hero-slider-dot.active{background:#fff;border-color:#fff}.lm-hero-slider-dot:hover{border-color:#fff;transform:scale(1.2)}.lm-hero-slider-dot:disabled{cursor:not-allowed;opacity:.5}@media (max-width:768px){.lm-hero-slider-title{font-size:2rem}.lm-hero-slider-description{font-size:1rem}.lm-hero-slider-content{padding:1rem}.lm-hero-slider-nav{height:40px;width:40px}.lm-hero-slider-prev{left:.5rem}.lm-hero-slider-next{right:.5rem}.lm-hero-slider-dots{bottom:1rem}}@media (max-width:480px){.lm-hero-slider-title{font-size:1.5rem}.lm-hero-slider-description{font-size:.875rem;margin-bottom:1.5rem}.lm-hero-slider-button{font-size:.875rem;padding:.75rem 1.5rem}}
|
package/package.json
CHANGED
package/readme.md
ADDED
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
# How to create a Custom NPM Module with React Components?
|
|
2
|
+
|
|
3
|
+
This repo is aimed to describe the process of creating a custom NPM package/module with React.JS components. It will guide you through the steps of setting up your development environment, writing and exporting your components, and publishing your package to the NPM registry[Optional]. Additionally, it will provide tips and best practices for maintaining and updating your package.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
**Step 1:** Make a directory and initialize npm.
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
mkdir custom-npm-package
|
|
11
|
+
npm init
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Alternatively, you can use the following command to quickly generate a minimal boilerplate:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm init -y
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Add the necessary fields. After the successfull walkthrough a package.json will created and looks like below.
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
{
|
|
24
|
+
"name": "gittuts",
|
|
25
|
+
"version": "1.0.0",
|
|
26
|
+
"description": "",
|
|
27
|
+
"main": "index.js",
|
|
28
|
+
"scripts": {
|
|
29
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
30
|
+
},
|
|
31
|
+
"author": "",
|
|
32
|
+
"license": "ISC"
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
**Step 2:** Create a src folder in the root add a index.js/index.ts in it also create a component folder and creates some components in it.
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
src
|
|
40
|
+
├── components
|
|
41
|
+
│ ├── Component1
|
|
42
|
+
│ │ └── index.tsx
|
|
43
|
+
│ ├── Component2
|
|
44
|
+
│ │ └── index.tsx
|
|
45
|
+
│ └── Component3
|
|
46
|
+
│ └── index.tsx
|
|
47
|
+
└── index.ts
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
**Step 3:** Now, Add react and react-dom as peer-dependencies and dev-dependencies.
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
yarn add react react-dom --dev
|
|
54
|
+
|
|
55
|
+
or
|
|
56
|
+
|
|
57
|
+
npm install react react-dom --dev
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
The final package.json may looks like below.
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
{
|
|
64
|
+
"name": "custom-npm-package",
|
|
65
|
+
"version": "1.0.0",
|
|
66
|
+
"description": "react custom npm module",
|
|
67
|
+
"main": "index.js",
|
|
68
|
+
"scripts": {
|
|
69
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
70
|
+
"build": "npx babel src --out-file index.js --extensions .ts,.tsx"
|
|
71
|
+
},
|
|
72
|
+
"author": "Anandhu",
|
|
73
|
+
"license": "ISC",
|
|
74
|
+
"peerDependencies": {
|
|
75
|
+
"react": "^18.2.0",
|
|
76
|
+
"react-dom": "^18.2.0"
|
|
77
|
+
},
|
|
78
|
+
"devDependencies": {
|
|
79
|
+
"@types/react": "^18.0.34",
|
|
80
|
+
"react": "^18.2.0",
|
|
81
|
+
"react-dom": "^18.2.0",
|
|
82
|
+
"typescript": "^5.0.4"
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Since it is Typescript. I've also installed typescript, typescript react with it.
|
|
88
|
+
|
|
89
|
+
**Step 4:** Its time to bundle the code. Install [rollup.js](https://rollupjs.org/)
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
npm install --save react rollup
|
|
93
|
+
```
|
|
94
|
+
You will also need to install the Rollup plugins for Babel, CommonJS, and Node Resolve by running
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
npm install --save-dev @rollup/plugin-babel @rollup/plugin-commonjs @rollup/plugin-node-resolve rollup-plugin-terser
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
**Step 5:** Configure Rollup
|
|
102
|
+
|
|
103
|
+
Create a `rollup.config.mjs` or `rollup.config.js` file in the root of your project. In this file, configure Rollup to bundle your React component by specifying the input file, output format, and plugins to use. Here is an example configuration:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
import babel from 'rollup-plugin-babel';
|
|
107
|
+
import resolve from '@rollup/plugin-node-resolve';
|
|
108
|
+
import external from 'rollup-plugin-peer-deps-external';
|
|
109
|
+
import terser from '@rollup/plugin-terser';
|
|
110
|
+
import typescript from "rollup-plugin-typescript2"; // For Typescript
|
|
111
|
+
|
|
112
|
+
export default [
|
|
113
|
+
{
|
|
114
|
+
input: './src/index.ts',
|
|
115
|
+
output: [
|
|
116
|
+
{
|
|
117
|
+
file: 'dist/index.js',
|
|
118
|
+
format: 'cjs',
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
file: 'dist/index.es.js',
|
|
122
|
+
format: 'es',
|
|
123
|
+
exports: 'named',
|
|
124
|
+
}
|
|
125
|
+
],
|
|
126
|
+
plugins: [
|
|
127
|
+
babel({
|
|
128
|
+
exclude: 'node_modules/**',
|
|
129
|
+
presets: ['@babel/preset-react']
|
|
130
|
+
}),
|
|
131
|
+
external({
|
|
132
|
+
includeDependencies: true
|
|
133
|
+
}),
|
|
134
|
+
resolve(),
|
|
135
|
+
terser(),
|
|
136
|
+
typescript({ useTsconfigDeclarationDir: true }),
|
|
137
|
+
]
|
|
138
|
+
}
|
|
139
|
+
];
|
|
140
|
+
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
To our package.json, let's add this as build command so that we won't have to type it repeatedly. Under "scripts" in package.json add the following.
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
"scripts": {
|
|
147
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
148
|
+
"build": "npx rollup -c"
|
|
149
|
+
}
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
now we can simply use ```npm run build``` or ```yarn build``` to bundle the code.
|
|
153
|
+
|
|
154
|
+
If it compiled without any error you may see a new folder `dist` generated in the root folder with transpiled Javascript Code.
|
|
155
|
+
|
|
156
|
+

|
|
157
|
+
|
|
158
|
+
_image: bundled output_
|
|
159
|
+
|
|
160
|
+
Note: that if you're using a build tool like Webpack, you may not need to use npx babel at all. Instead, you can use a TypeScript loader like ts-loader or awesome-typescript-loader that will transpile and transform your TypeScript files as part of the build process.
|
|
161
|
+
|
|
162
|
+
**Step 6:** Lets pack it so we can use/test it in other projects. Run the following command from the root folder.
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
npm pack
|
|
166
|
+
```
|
|
167
|
+
This will generate a .tgz file that we can use to install the package locally in other projects.
|
|
168
|
+
|
|
169
|
+
Alternatively, you can link the package for testing purpose(Recommended).
|
|
170
|
+
|
|
171
|
+
Using `npm link` in your package's root directory, create a global symlink of your package. A shortcut that directs your system to another directory or file is known as a "symlink," short for symbolic link.
|
|
172
|
+
|
|
173
|
+
Now, create an another application and tell the application to use the global symlink with `npm link your-package-name`. This way, we could save a lot of time.
|
|
174
|
+
|
|
175
|
+
**Step 7:** Navigate to your other project's directory and install your package using npm install <path to tarball file>. For example:
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
npm i 'path_to_the_packed_file'
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
**Step 8:** In your host project's code you can import and use your component as follows:
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
import logo from "./logo.svg";
|
|
185
|
+
import "./App.css";
|
|
186
|
+
import TextInput from "my_npm_package"; // Importing from the package
|
|
187
|
+
import { useState } from "react";
|
|
188
|
+
|
|
189
|
+
function App() {
|
|
190
|
+
const [value, setValue] = useState('');
|
|
191
|
+
console.log(value)
|
|
192
|
+
|
|
193
|
+
function handleChange(e) {
|
|
194
|
+
setValue(e.target.value);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
return (
|
|
198
|
+
<div className="App">
|
|
199
|
+
<header className="App-header">
|
|
200
|
+
<img src={logo} className="App-logo" alt="logo" />
|
|
201
|
+
<p>Custom npm module.</p>
|
|
202
|
+
<TextInput label="Name" value={value} onChange={handleChange} />
|
|
203
|
+
</header>
|
|
204
|
+
</div>
|
|
205
|
+
);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
export default App;
|
|
209
|
+
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
Additionally we can use packages like [storybook.js](https://storybook.js.org/) to build UI components and pages in isolation and by doing so we could see the changes that happens to our components without the need of installing it in a host application. You could find the documention for implementing story book [here](https://storybook.js.org/docs/react/get-started/install/).
|
|
213
|
+
|
|
214
|
+
**Step 9:** Publishing our package to NPM Registry
|
|
215
|
+
|
|
216
|
+
To publish a package to the npm registry, we need to follow these steps:
|
|
217
|
+
|
|
218
|
+
- Create an npm account on [npmjs.com](https://www.npmjs.com/signup).
|
|
219
|
+
- Sign in to npm from your terminal using the ```npm login``` command.
|
|
220
|
+
- Prepare your package for publishing.
|
|
221
|
+
- Publish the package from the terminal using the ```npm publish``` command.
|
|
222
|
+
- React 18 Version 1.3.2.
|
|
@@ -265,23 +265,6 @@ declare module "lm-web-controls" {
|
|
|
265
265
|
};
|
|
266
266
|
};
|
|
267
267
|
|
|
268
|
-
type OptimizedImageProps = {
|
|
269
|
-
src: string;
|
|
270
|
-
alt: string;
|
|
271
|
-
className?: string;
|
|
272
|
-
width?: number;
|
|
273
|
-
height?: number;
|
|
274
|
-
sizes?: string;
|
|
275
|
-
priority?: boolean;
|
|
276
|
-
quality?: number;
|
|
277
|
-
placeholder?: "blur" | "empty";
|
|
278
|
-
blurDataURL?: string;
|
|
279
|
-
onLoad?: () => void;
|
|
280
|
-
onError?: () => void;
|
|
281
|
-
fill?: boolean;
|
|
282
|
-
style?: React.CSSProperties;
|
|
283
|
-
};
|
|
284
|
-
|
|
285
268
|
export const Email: React.FC<EmailProps>;
|
|
286
269
|
export const Copyright: React.FC<CopyrightProps>;
|
|
287
270
|
export const Phone: React.FC<PhoneProps>;
|
|
@@ -306,7 +289,6 @@ declare module "lm-web-controls" {
|
|
|
306
289
|
export const ExitIntent: React.FC<ExitIntentProps>;
|
|
307
290
|
export const IdleTimeIntent: React.FC<IdleTimeIntentProps>;
|
|
308
291
|
export const HeroSlider: React.FC<HeroSliderProps>;
|
|
309
|
-
export const OptimizedImage: React.FC<OptimizedImageProps>;
|
|
310
292
|
|
|
311
293
|
export const INSTA_MEDIA_TYPES: {
|
|
312
294
|
readonly IMAGE: 1;
|