UNPKG

@nuskin/react-loyalty-elements

Version:

A React based component library for reusable Nextgen Loyalty component

1 lines 4.1 kB
function n(n,r){if(r==null||r>n.length)r=n.length;for(var e=0,t=new Array(r);e<r;e++)t[e]=n[e];return t}function r(n){if(Array.isArray(n))return n}function e(n,r){var e=n==null?null:typeof Symbol!=="undefined"&&n[Symbol.iterator]||n["@@iterator"];if(e==null)return;var t=[];var o=true;var i=false;var a,l;try{for(e=e.call(n);!(o=(a=e.next()).done);o=true){t.push(a.value);if(r&&t.length===r)break}}catch(n){i=true;l=n}finally{try{if(!o&&e["return"]!=null)e["return"]()}finally{if(i)throw l}}return t}function t(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function o(n,o){return r(n)||e(n,o)||a(n,o)||t()}function i(n,r){if(!r){r=n.slice(0)}return Object.freeze(Object.defineProperties(n,{raw:{value:Object.freeze(r)}}))}function a(r,e){if(!r)return;if(typeof r==="string")return n(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor)t=r.constructor.name;if(t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return n(r,e)}function l(){var n=i(["\n display: flex;\n flex-direction: row;\n background-color: #fff;\n border-radius: 10px;\n box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.1);\n overflow: hidden;\n margin-top: 10px;\n border: 1px solid #e0e0e0;\n\n @media (max-width: 767px) {\n flex-direction: column;\n padding: 10px;\n }\n"]);l=function r(){return n};return n}function u(){var n=i(["\n width: 40%;\n height: 345px;\n display: block;\n object-fit: cover;\n\n @media (max-width: 767px) {\n width: 100%;\n border-radius: 10px 10px 0 0;\n }\n"]);u=function r(){return n};return n}function c(){var n=i(["\n display: flex;\n flex-direction: column;\n justify-content: center;\n padding: 0px 40px;\n width: 60%;\n background-color: #f5f5f5;\n\n @media (max-width: 767px) {\n width: 100%;\n padding: 20px;\n }\n"]);c=function r(){return n};return n}function f(){var n=i(["\n font-family: Inter, sans-serif;\n font-size: 14px;\n font-weight: 600;\n line-height: 20px;\n margin-bottom: 10px;\n"]);f=function r(){return n};return n}function d(){var n=i(["\n font-family: Inter, sans-serif;\n font-size: 16px;\n font-weight: 400;\n line-height: 22px;\n color: #252525;\n margin-top: 2rem;\n"]);d=function r(){return n};return n}function s(){var n=i(["\n width: 257px;\n margin-top: 15px;\n background-color: #252525;\n color: #fff;\n padding: 10px 20px;\n border: none;\n border-radius: 5px;\n cursor: pointer;\n\n &:hover {\n background-color: #8c8c8c;\n }\n\n &:focus-visible {\n outline: 2px solid #252525 !important;\n outline-offset: 2px;\n }\n"]);s=function r(){return n};return n}function p(){var n=i(["\n max-width: 360px;\n"]);p=function r(){return n};return n}import{d as h,e as x}from"../chunk-Z6ATMGBY.mjs";import{useState as y}from"react";var m=h.div(l()),g=h.img(u()),b=h.div(c()),v=h.h2(f()),w=h.p(d()),j=h.button(s()),k=h.img(p());import{Fragment as B,jsx as A,jsxs as M}from"react/jsx-runtime";var O=function(n){var r=n.translationConfig,e=r===void 0?{header:"",body:"",learnMore:"",loyaltyLogoBlack:"",loyaltyBanner:""}:r,t=n.learnMoreConfig,i=t===void 0?{tagLine:"",cardOneDescription:"",cardOneVoucherAmount:"",cardTwoDescription:"",cardTwoVoucherAmount:"",header:"",loyaltyLogoWhite:"",loyaltyBanner:"",learnMore:""}:t,a=o(y(!1),2),l=a[0],u=a[1],c=function(){return u(!0)},f=function(){return u(!1)};return M(B,{children:[e&&M(m,{children:[e.loyaltyBanner&&A(g,{src:e.loyaltyBanner,alt:"Beauty Device"}),M(b,{children:[e.header&&A(v,{children:e.header}),e.loyaltyLogoBlack&&A(k,{src:e.loyaltyLogoBlack,alt:"Rewards Logo"}),e.body&&A(w,{children:e.body}),i.learnMore&&A(j,{onClick:c,children:i.learnMore})]})]}),i&&A(x,{show:l,close:f,learnMoreConfig:i,translationConfig:e})]})},S=O;export{S as SubscriptionRewardBanner};//# sourceMappingURL=index.mjs.map