Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@plurix/coupons

Package Overview
Dependencies
Maintainers
3
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@plurix/coupons - npm Package Compare versions

Comparing version 0.1.2 to 0.1.4

dist/assets/NoCouponIcon.d.ts

124

dist/coupons.cjs.development.js

@@ -9,2 +9,20 @@ 'use strict';

var CuponIcon = function CuponIcon(_ref) {
var _ref$width = _ref.width,
width = _ref$width === void 0 ? 20 : _ref$width,
_ref$height = _ref.height,
height = _ref$height === void 0 ? 16 : _ref$height;
return React.createElement("svg", {
width: width,
height: height,
viewBox: "0 0 20 16",
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
"data-testid": 'cupon-icon'
}, React.createElement("path", {
d: "M1.5 16C1.1 16 0.75 15.85 0.45 15.55C0.15 15.25 0 14.9 0 14.5V10.675C0.616667 10.5417 1.12917 10.2208 1.5375 9.7125C1.94583 9.20417 2.15 8.63333 2.15 8C2.15 7.36667 1.94583 6.79167 1.5375 6.275C1.12917 5.75833 0.616667 5.44167 0 5.325V1.5C0 1.1 0.15 0.75 0.45 0.45C0.75 0.15 1.1 0 1.5 0H18.5C18.9 0 19.25 0.15 19.55 0.45C19.85 0.75 20 1.1 20 1.5V5.325C19.3833 5.44167 18.875 5.75833 18.475 6.275C18.075 6.79167 17.875 7.36667 17.875 8C17.875 8.63333 18.075 9.20417 18.475 9.7125C18.875 10.2208 19.3833 10.5417 20 10.675V14.5C20 14.9 19.85 15.25 19.55 15.55C19.25 15.85 18.9 16 18.5 16H1.5ZM1.5 14.5H18.5V11.775C17.9 11.3583 17.3958 10.8208 16.9875 10.1625C16.5792 9.50417 16.375 8.78333 16.375 8C16.375 7.21667 16.5792 6.49583 16.9875 5.8375C17.3958 5.17917 17.9 4.64167 18.5 4.225V1.5H1.5V4.225C2.1 4.64167 2.60833 5.17917 3.025 5.8375C3.44167 6.49583 3.65 7.21667 3.65 8C3.65 8.78333 3.44167 9.50417 3.025 10.1625C2.60833 10.8208 2.1 11.3583 1.5 11.775V14.5ZM7.4 12.05L10 10.025L12.6 12.05L11.6 8.85L14.05 6.8H11.05L10 3.75L8.95 6.8H5.95L8.4 8.85L7.4 12.05Z",
fill: "var(--color-main)"
}));
};
var SuccessIcon = function SuccessIcon(_ref) {

@@ -38,64 +56,2 @@ var _ref$width = _ref.width,

var ErrorIcon = function ErrorIcon(_ref) {
var color = _ref.color;
return React.createElement("svg", {
width: "16",
height: "16",
viewBox: "0 0 16 16",
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
"data-testid": 'error-icon'
}, React.createElement("circle", {
cx: "8",
cy: "8",
r: "8",
fill: color != null ? color : 'var(--color-negativeFeedback-light)'
}), React.createElement("path", {
fillRule: "evenodd",
clipRule: "evenodd",
d: "M5.48082 6.19357C5.28406 5.99682 5.28406 5.67782 5.48082 5.48106C5.67757 5.28431 5.99657 5.28431 6.19333 5.48106L7.99995 7.28768L9.80657 5.48106C10.0033 5.28431 10.3223 5.28431 10.5191 5.48106C10.7158 5.67782 10.7158 5.99682 10.5191 6.19357L8.71246 8.00019L10.519 9.80675C10.7158 10.0035 10.7158 10.3225 10.519 10.5193C10.3223 10.716 10.0033 10.716 9.80651 10.5193L7.99995 8.7127L6.19339 10.5193C5.99663 10.716 5.67763 10.716 5.48088 10.5193C5.28412 10.3225 5.28412 10.0035 5.48088 9.80675L7.28744 8.00019L5.48082 6.19357Z",
fill: "white"
}));
};
var AppliedCoupon = function AppliedCoupon(_ref) {
var type = _ref.type;
if (type === 'success') {
return React.createElement("p", {
className: 'succesCoupon'
}, React.createElement("span", null, React.createElement(SuccessIcon, null)), "Cupom aplicado com sucesso");
}
if (type === 'expired') {
return React.createElement("p", {
className: "error-coupon"
}, React.createElement("span", null, React.createElement(ErrorIcon, null)), "Cupom expirado.");
}
if (type === 'error') {
return React.createElement("p", {
className: "error-coupon"
}, React.createElement("span", null, React.createElement(ErrorIcon, null)), "N\xE3o foi possivel aplicar o cupom.", React.createElement("br", null), "Tente aplicar mais tarde.");
}
return React.createElement("p", {
className: "error-coupon"
}, React.createElement("span", null, React.createElement(ErrorIcon, null)), "Cupom expirado ou incorreto");
};
var CuponIcon = function CuponIcon(_ref) {
var _ref$width = _ref.width,
width = _ref$width === void 0 ? 20 : _ref$width,
_ref$height = _ref.height,
height = _ref$height === void 0 ? 16 : _ref$height;
return React.createElement("svg", {
width: width,
height: height,
viewBox: "0 0 20 16",
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
"data-testid": 'cupon-icon'
}, React.createElement("path", {
d: "M1.5 16C1.1 16 0.75 15.85 0.45 15.55C0.15 15.25 0 14.9 0 14.5V10.675C0.616667 10.5417 1.12917 10.2208 1.5375 9.7125C1.94583 9.20417 2.15 8.63333 2.15 8C2.15 7.36667 1.94583 6.79167 1.5375 6.275C1.12917 5.75833 0.616667 5.44167 0 5.325V1.5C0 1.1 0.15 0.75 0.45 0.45C0.75 0.15 1.1 0 1.5 0H18.5C18.9 0 19.25 0.15 19.55 0.45C19.85 0.75 20 1.1 20 1.5V5.325C19.3833 5.44167 18.875 5.75833 18.475 6.275C18.075 6.79167 17.875 7.36667 17.875 8C17.875 8.63333 18.075 9.20417 18.475 9.7125C18.875 10.2208 19.3833 10.5417 20 10.675V14.5C20 14.9 19.85 15.25 19.55 15.55C19.25 15.85 18.9 16 18.5 16H1.5ZM1.5 14.5H18.5V11.775C17.9 11.3583 17.3958 10.8208 16.9875 10.1625C16.5792 9.50417 16.375 8.78333 16.375 8C16.375 7.21667 16.5792 6.49583 16.9875 5.8375C17.3958 5.17917 17.9 4.64167 18.5 4.225V1.5H1.5V4.225C2.1 4.64167 2.60833 5.17917 3.025 5.8375C3.44167 6.49583 3.65 7.21667 3.65 8C3.65 8.78333 3.44167 9.50417 3.025 10.1625C2.60833 10.8208 2.1 11.3583 1.5 11.775V14.5ZM7.4 12.05L10 10.025L12.6 12.05L11.6 8.85L14.05 6.8H11.05L10 3.75L8.95 6.8H5.95L8.4 8.85L7.4 12.05Z",
fill: "var(--color-main)"
}));
};
var CouponCard = function CouponCard(_ref) {

@@ -156,2 +112,46 @@ var couponName = _ref.couponName,

var ErrorIcon = function ErrorIcon(_ref) {
var color = _ref.color;
return React.createElement("svg", {
width: "16",
height: "16",
viewBox: "0 0 16 16",
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
"data-testid": 'error-icon'
}, React.createElement("circle", {
cx: "8",
cy: "8",
r: "8",
fill: color != null ? color : 'var(--color-negativeFeedback-light)'
}), React.createElement("path", {
fillRule: "evenodd",
clipRule: "evenodd",
d: "M5.48082 6.19357C5.28406 5.99682 5.28406 5.67782 5.48082 5.48106C5.67757 5.28431 5.99657 5.28431 6.19333 5.48106L7.99995 7.28768L9.80657 5.48106C10.0033 5.28431 10.3223 5.28431 10.5191 5.48106C10.7158 5.67782 10.7158 5.99682 10.5191 6.19357L8.71246 8.00019L10.519 9.80675C10.7158 10.0035 10.7158 10.3225 10.519 10.5193C10.3223 10.716 10.0033 10.716 9.80651 10.5193L7.99995 8.7127L6.19339 10.5193C5.99663 10.716 5.67763 10.716 5.48088 10.5193C5.28412 10.3225 5.28412 10.0035 5.48088 9.80675L7.28744 8.00019L5.48082 6.19357Z",
fill: "white"
}));
};
var AppliedCoupon = function AppliedCoupon(_ref) {
var type = _ref.type;
if (type === 'success') {
return React.createElement("p", {
className: 'succesCoupon'
}, React.createElement("span", null, React.createElement(SuccessIcon, null)), "Cupom aplicado com sucesso");
}
if (type === 'expired') {
return React.createElement("p", {
className: "error-coupon"
}, React.createElement("span", null, React.createElement(ErrorIcon, null)), "Cupom expirado.");
}
if (type === 'error') {
return React.createElement("p", {
className: "error-coupon"
}, React.createElement("span", null, React.createElement(ErrorIcon, null)), "N\xE3o foi possivel aplicar o cupom.", React.createElement("br", null), "Tente aplicar mais tarde.");
}
return React.createElement("p", {
className: "error-coupon"
}, React.createElement("span", null, React.createElement(ErrorIcon, null)), "Cupom expirado ou incorreto");
};
var CloseIcon = function CloseIcon(_ref) {

@@ -158,0 +158,0 @@ var color = _ref.color;

@@ -1,2 +0,2 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=(e=require("react"))&&"object"==typeof e&&"default"in e?e.default:e,l=function(e){var l=e.width,n=e.height;return t.createElement("svg",{width:void 0===l?18:l,height:void 0===n?18:n,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-testid":"success-icon"},t.createElement("path",{d:"M9 17A8 8 0 1 0 9 1a8 8 0 0 0 0 16Z",fill:"var(--color-positiveFeedback)",stroke:"var(--color-positiveFeedback)",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"}),t.createElement("path",{d:"m5 9 2.667 2.667L13 6.334",stroke:"var(--color-grayScale-white)",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"}))},n=function(e){var l=e.color;return t.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-testid":"error-icon"},t.createElement("circle",{cx:"8",cy:"8",r:"8",fill:null!=l?l:"var(--color-negativeFeedback-light)"}),t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.48082 6.19357C5.28406 5.99682 5.28406 5.67782 5.48082 5.48106C5.67757 5.28431 5.99657 5.28431 6.19333 5.48106L7.99995 7.28768L9.80657 5.48106C10.0033 5.28431 10.3223 5.28431 10.5191 5.48106C10.7158 5.67782 10.7158 5.99682 10.5191 6.19357L8.71246 8.00019L10.519 9.80675C10.7158 10.0035 10.7158 10.3225 10.519 10.5193C10.3223 10.716 10.0033 10.716 9.80651 10.5193L7.99995 8.7127L6.19339 10.5193C5.99663 10.716 5.67763 10.716 5.48088 10.5193C5.28412 10.3225 5.28412 10.0035 5.48088 9.80675L7.28744 8.00019L5.48082 6.19357Z",fill:"white"}))},a=function(e){var l=e.width,n=e.height;return t.createElement("svg",{width:void 0===l?20:l,height:void 0===n?16:n,viewBox:"0 0 20 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-testid":"cupon-icon"},t.createElement("path",{d:"M1.5 16C1.1 16 0.75 15.85 0.45 15.55C0.15 15.25 0 14.9 0 14.5V10.675C0.616667 10.5417 1.12917 10.2208 1.5375 9.7125C1.94583 9.20417 2.15 8.63333 2.15 8C2.15 7.36667 1.94583 6.79167 1.5375 6.275C1.12917 5.75833 0.616667 5.44167 0 5.325V1.5C0 1.1 0.15 0.75 0.45 0.45C0.75 0.15 1.1 0 1.5 0H18.5C18.9 0 19.25 0.15 19.55 0.45C19.85 0.75 20 1.1 20 1.5V5.325C19.3833 5.44167 18.875 5.75833 18.475 6.275C18.075 6.79167 17.875 7.36667 17.875 8C17.875 8.63333 18.075 9.20417 18.475 9.7125C18.875 10.2208 19.3833 10.5417 20 10.675V14.5C20 14.9 19.85 15.25 19.55 15.55C19.25 15.85 18.9 16 18.5 16H1.5ZM1.5 14.5H18.5V11.775C17.9 11.3583 17.3958 10.8208 16.9875 10.1625C16.5792 9.50417 16.375 8.78333 16.375 8C16.375 7.21667 16.5792 6.49583 16.9875 5.8375C17.3958 5.17917 17.9 4.64167 18.5 4.225V1.5H1.5V4.225C2.1 4.64167 2.60833 5.17917 3.025 5.8375C3.44167 6.49583 3.65 7.21667 3.65 8C3.65 8.78333 3.44167 9.50417 3.025 10.1625C2.60833 10.8208 2.1 11.3583 1.5 11.775V14.5ZM7.4 12.05L10 10.025L12.6 12.05L11.6 8.85L14.05 6.8H11.05L10 3.75L8.95 6.8H5.95L8.4 8.85L7.4 12.05Z",fill:"var(--color-main)"}))},o=function(e){var l=e.color;return t.createElement("svg",{width:"1em",height:"1em",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-testid":"close"},t.createElement("path",{d:"m12 4-8 8M4 4l8 8",stroke:null!=l?l:"var(--color-grayScale)",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}))};exports.AppliedCoupon=function(e){var a=e.type;return"success"===a?t.createElement("p",{className:"succesCoupon"},t.createElement("span",null,t.createElement(l,null)),"Cupom aplicado com sucesso"):"expired"===a?t.createElement("p",{className:"error-coupon"},t.createElement("span",null,t.createElement(n,null)),"Cupom expirado."):"error"===a?t.createElement("p",{className:"error-coupon"},t.createElement("span",null,t.createElement(n,null)),"Não foi possivel aplicar o cupom.",t.createElement("br",null),"Tente aplicar mais tarde."):t.createElement("p",{className:"error-coupon"},t.createElement("span",null,t.createElement(n,null)),"Cupom expirado ou incorreto")},exports.CouponCard=function(e){var n=e.couponName,o=e.couponValue,r=e.couponDescription,c=e.couponExpirationDate,i=e.loading,s=e.isApplyCoupon,u=e.setActiveRule,m=e.handleApplyCoupon,p=e.handleRemoveCoupon;return t.createElement("div",{className:"container-card-cupon",id:"coupon"},t.createElement("div",{className:"text-container"},t.createElement("div",{className:"container-title"},t.createElement(a,{width:20,height:16}),t.createElement("p",{className:"title"},n)),o&&t.createElement("p",{className:"price-babge"},"- ",o),r&&t.createElement("p",{className:"subtitle"},r),c&&t.createElement("p",{className:"subtitle"},"Válido até ",c)),t.createElement("div",{className:"vertical-line"}),t.createElement("div",{className:"buttons-container"},s&&t.createElement("button",{className:"applied-coupon"},t.createElement("span",{className:"applied-coupon-span"},t.createElement(l,null)),"Aplicado"),s?t.createElement("button",{onClick:function(){return p(n)},className:"remove-coupon",disabled:i},"Remover"):t.createElement("button",{onClick:function(){return m(n)},className:"apply-coupon",disabled:i},"Aplicar"),r&&t.createElement("a",{onClick:function(){return u(!0)}},"Ver Regras")))},exports.ModalRules=function(e){var l=e.children,n=e.setCloseX;return t.createElement("div",{className:"modal-rule-coupon-external"},t.createElement("div",{className:"modal-rule-coupon-internal"},t.createElement("div",{className:"modal-rule-coupon-title"},t.createElement("h1",{className:"modal-rule-coupon-title-h1"},e.title),t.createElement("span",{className:".modal-rule-coupon-title-span",onClick:function(){return n(!1)}},t.createElement(o,null))),t.createElement("div",{className:"modal-rule-coupon-children"},l)))};
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=(e=require("react"))&&"object"==typeof e&&"default"in e?e.default:e,l=function(e){var l=e.width,n=e.height;return t.createElement("svg",{width:void 0===l?20:l,height:void 0===n?16:n,viewBox:"0 0 20 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-testid":"cupon-icon"},t.createElement("path",{d:"M1.5 16C1.1 16 0.75 15.85 0.45 15.55C0.15 15.25 0 14.9 0 14.5V10.675C0.616667 10.5417 1.12917 10.2208 1.5375 9.7125C1.94583 9.20417 2.15 8.63333 2.15 8C2.15 7.36667 1.94583 6.79167 1.5375 6.275C1.12917 5.75833 0.616667 5.44167 0 5.325V1.5C0 1.1 0.15 0.75 0.45 0.45C0.75 0.15 1.1 0 1.5 0H18.5C18.9 0 19.25 0.15 19.55 0.45C19.85 0.75 20 1.1 20 1.5V5.325C19.3833 5.44167 18.875 5.75833 18.475 6.275C18.075 6.79167 17.875 7.36667 17.875 8C17.875 8.63333 18.075 9.20417 18.475 9.7125C18.875 10.2208 19.3833 10.5417 20 10.675V14.5C20 14.9 19.85 15.25 19.55 15.55C19.25 15.85 18.9 16 18.5 16H1.5ZM1.5 14.5H18.5V11.775C17.9 11.3583 17.3958 10.8208 16.9875 10.1625C16.5792 9.50417 16.375 8.78333 16.375 8C16.375 7.21667 16.5792 6.49583 16.9875 5.8375C17.3958 5.17917 17.9 4.64167 18.5 4.225V1.5H1.5V4.225C2.1 4.64167 2.60833 5.17917 3.025 5.8375C3.44167 6.49583 3.65 7.21667 3.65 8C3.65 8.78333 3.44167 9.50417 3.025 10.1625C2.60833 10.8208 2.1 11.3583 1.5 11.775V14.5ZM7.4 12.05L10 10.025L12.6 12.05L11.6 8.85L14.05 6.8H11.05L10 3.75L8.95 6.8H5.95L8.4 8.85L7.4 12.05Z",fill:"var(--color-main)"}))},n=function(e){var l=e.width,n=e.height;return t.createElement("svg",{width:void 0===l?18:l,height:void 0===n?18:n,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-testid":"success-icon"},t.createElement("path",{d:"M9 17A8 8 0 1 0 9 1a8 8 0 0 0 0 16Z",fill:"var(--color-positiveFeedback)",stroke:"var(--color-positiveFeedback)",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"}),t.createElement("path",{d:"m5 9 2.667 2.667L13 6.334",stroke:"var(--color-grayScale-white)",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"}))},a=function(e){var l=e.color;return t.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-testid":"error-icon"},t.createElement("circle",{cx:"8",cy:"8",r:"8",fill:null!=l?l:"var(--color-negativeFeedback-light)"}),t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.48082 6.19357C5.28406 5.99682 5.28406 5.67782 5.48082 5.48106C5.67757 5.28431 5.99657 5.28431 6.19333 5.48106L7.99995 7.28768L9.80657 5.48106C10.0033 5.28431 10.3223 5.28431 10.5191 5.48106C10.7158 5.67782 10.7158 5.99682 10.5191 6.19357L8.71246 8.00019L10.519 9.80675C10.7158 10.0035 10.7158 10.3225 10.519 10.5193C10.3223 10.716 10.0033 10.716 9.80651 10.5193L7.99995 8.7127L6.19339 10.5193C5.99663 10.716 5.67763 10.716 5.48088 10.5193C5.28412 10.3225 5.28412 10.0035 5.48088 9.80675L7.28744 8.00019L5.48082 6.19357Z",fill:"white"}))},o=function(e){var l=e.color;return t.createElement("svg",{width:"1em",height:"1em",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-testid":"close"},t.createElement("path",{d:"m12 4-8 8M4 4l8 8",stroke:null!=l?l:"var(--color-grayScale)",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}))};exports.AppliedCoupon=function(e){var l=e.type;return"success"===l?t.createElement("p",{className:"succesCoupon"},t.createElement("span",null,t.createElement(n,null)),"Cupom aplicado com sucesso"):"expired"===l?t.createElement("p",{className:"error-coupon"},t.createElement("span",null,t.createElement(a,null)),"Cupom expirado."):"error"===l?t.createElement("p",{className:"error-coupon"},t.createElement("span",null,t.createElement(a,null)),"Não foi possivel aplicar o cupom.",t.createElement("br",null),"Tente aplicar mais tarde."):t.createElement("p",{className:"error-coupon"},t.createElement("span",null,t.createElement(a,null)),"Cupom expirado ou incorreto")},exports.CouponCard=function(e){var a=e.couponName,o=e.couponValue,r=e.couponDescription,c=e.couponExpirationDate,i=e.loading,s=e.isApplyCoupon,u=e.setActiveRule,m=e.handleApplyCoupon,p=e.handleRemoveCoupon;return t.createElement("div",{className:"container-card-cupon",id:"coupon"},t.createElement("div",{className:"text-container"},t.createElement("div",{className:"container-title"},t.createElement(l,{width:20,height:16}),t.createElement("p",{className:"title"},a)),o&&t.createElement("p",{className:"price-babge"},"- ",o),r&&t.createElement("p",{className:"subtitle"},r),c&&t.createElement("p",{className:"subtitle"},"Válido até ",c)),t.createElement("div",{className:"vertical-line"}),t.createElement("div",{className:"buttons-container"},s&&t.createElement("button",{className:"applied-coupon"},t.createElement("span",{className:"applied-coupon-span"},t.createElement(n,null)),"Aplicado"),s?t.createElement("button",{onClick:function(){return p(a)},className:"remove-coupon",disabled:i},"Remover"):t.createElement("button",{onClick:function(){return m(a)},className:"apply-coupon",disabled:i},"Aplicar"),r&&t.createElement("a",{onClick:function(){return u(!0)}},"Ver Regras")))},exports.ModalRules=function(e){var l=e.children,n=e.setCloseX;return t.createElement("div",{className:"modal-rule-coupon-external"},t.createElement("div",{className:"modal-rule-coupon-internal"},t.createElement("div",{className:"modal-rule-coupon-title"},t.createElement("h1",{className:"modal-rule-coupon-title-h1"},e.title),t.createElement("span",{className:".modal-rule-coupon-title-span",onClick:function(){return n(!1)}},t.createElement(o,null))),t.createElement("div",{className:"modal-rule-coupon-children"},l)))};
//# sourceMappingURL=coupons.cjs.production.min.js.map
import React from 'react';
var CuponIcon = function CuponIcon(_ref) {
var _ref$width = _ref.width,
width = _ref$width === void 0 ? 20 : _ref$width,
_ref$height = _ref.height,
height = _ref$height === void 0 ? 16 : _ref$height;
return React.createElement("svg", {
width: width,
height: height,
viewBox: "0 0 20 16",
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
"data-testid": 'cupon-icon'
}, React.createElement("path", {
d: "M1.5 16C1.1 16 0.75 15.85 0.45 15.55C0.15 15.25 0 14.9 0 14.5V10.675C0.616667 10.5417 1.12917 10.2208 1.5375 9.7125C1.94583 9.20417 2.15 8.63333 2.15 8C2.15 7.36667 1.94583 6.79167 1.5375 6.275C1.12917 5.75833 0.616667 5.44167 0 5.325V1.5C0 1.1 0.15 0.75 0.45 0.45C0.75 0.15 1.1 0 1.5 0H18.5C18.9 0 19.25 0.15 19.55 0.45C19.85 0.75 20 1.1 20 1.5V5.325C19.3833 5.44167 18.875 5.75833 18.475 6.275C18.075 6.79167 17.875 7.36667 17.875 8C17.875 8.63333 18.075 9.20417 18.475 9.7125C18.875 10.2208 19.3833 10.5417 20 10.675V14.5C20 14.9 19.85 15.25 19.55 15.55C19.25 15.85 18.9 16 18.5 16H1.5ZM1.5 14.5H18.5V11.775C17.9 11.3583 17.3958 10.8208 16.9875 10.1625C16.5792 9.50417 16.375 8.78333 16.375 8C16.375 7.21667 16.5792 6.49583 16.9875 5.8375C17.3958 5.17917 17.9 4.64167 18.5 4.225V1.5H1.5V4.225C2.1 4.64167 2.60833 5.17917 3.025 5.8375C3.44167 6.49583 3.65 7.21667 3.65 8C3.65 8.78333 3.44167 9.50417 3.025 10.1625C2.60833 10.8208 2.1 11.3583 1.5 11.775V14.5ZM7.4 12.05L10 10.025L12.6 12.05L11.6 8.85L14.05 6.8H11.05L10 3.75L8.95 6.8H5.95L8.4 8.85L7.4 12.05Z",
fill: "var(--color-main)"
}));
};
var SuccessIcon = function SuccessIcon(_ref) {

@@ -31,64 +49,2 @@ var _ref$width = _ref.width,

var ErrorIcon = function ErrorIcon(_ref) {
var color = _ref.color;
return React.createElement("svg", {
width: "16",
height: "16",
viewBox: "0 0 16 16",
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
"data-testid": 'error-icon'
}, React.createElement("circle", {
cx: "8",
cy: "8",
r: "8",
fill: color != null ? color : 'var(--color-negativeFeedback-light)'
}), React.createElement("path", {
fillRule: "evenodd",
clipRule: "evenodd",
d: "M5.48082 6.19357C5.28406 5.99682 5.28406 5.67782 5.48082 5.48106C5.67757 5.28431 5.99657 5.28431 6.19333 5.48106L7.99995 7.28768L9.80657 5.48106C10.0033 5.28431 10.3223 5.28431 10.5191 5.48106C10.7158 5.67782 10.7158 5.99682 10.5191 6.19357L8.71246 8.00019L10.519 9.80675C10.7158 10.0035 10.7158 10.3225 10.519 10.5193C10.3223 10.716 10.0033 10.716 9.80651 10.5193L7.99995 8.7127L6.19339 10.5193C5.99663 10.716 5.67763 10.716 5.48088 10.5193C5.28412 10.3225 5.28412 10.0035 5.48088 9.80675L7.28744 8.00019L5.48082 6.19357Z",
fill: "white"
}));
};
var AppliedCoupon = function AppliedCoupon(_ref) {
var type = _ref.type;
if (type === 'success') {
return React.createElement("p", {
className: 'succesCoupon'
}, React.createElement("span", null, React.createElement(SuccessIcon, null)), "Cupom aplicado com sucesso");
}
if (type === 'expired') {
return React.createElement("p", {
className: "error-coupon"
}, React.createElement("span", null, React.createElement(ErrorIcon, null)), "Cupom expirado.");
}
if (type === 'error') {
return React.createElement("p", {
className: "error-coupon"
}, React.createElement("span", null, React.createElement(ErrorIcon, null)), "N\xE3o foi possivel aplicar o cupom.", React.createElement("br", null), "Tente aplicar mais tarde.");
}
return React.createElement("p", {
className: "error-coupon"
}, React.createElement("span", null, React.createElement(ErrorIcon, null)), "Cupom expirado ou incorreto");
};
var CuponIcon = function CuponIcon(_ref) {
var _ref$width = _ref.width,
width = _ref$width === void 0 ? 20 : _ref$width,
_ref$height = _ref.height,
height = _ref$height === void 0 ? 16 : _ref$height;
return React.createElement("svg", {
width: width,
height: height,
viewBox: "0 0 20 16",
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
"data-testid": 'cupon-icon'
}, React.createElement("path", {
d: "M1.5 16C1.1 16 0.75 15.85 0.45 15.55C0.15 15.25 0 14.9 0 14.5V10.675C0.616667 10.5417 1.12917 10.2208 1.5375 9.7125C1.94583 9.20417 2.15 8.63333 2.15 8C2.15 7.36667 1.94583 6.79167 1.5375 6.275C1.12917 5.75833 0.616667 5.44167 0 5.325V1.5C0 1.1 0.15 0.75 0.45 0.45C0.75 0.15 1.1 0 1.5 0H18.5C18.9 0 19.25 0.15 19.55 0.45C19.85 0.75 20 1.1 20 1.5V5.325C19.3833 5.44167 18.875 5.75833 18.475 6.275C18.075 6.79167 17.875 7.36667 17.875 8C17.875 8.63333 18.075 9.20417 18.475 9.7125C18.875 10.2208 19.3833 10.5417 20 10.675V14.5C20 14.9 19.85 15.25 19.55 15.55C19.25 15.85 18.9 16 18.5 16H1.5ZM1.5 14.5H18.5V11.775C17.9 11.3583 17.3958 10.8208 16.9875 10.1625C16.5792 9.50417 16.375 8.78333 16.375 8C16.375 7.21667 16.5792 6.49583 16.9875 5.8375C17.3958 5.17917 17.9 4.64167 18.5 4.225V1.5H1.5V4.225C2.1 4.64167 2.60833 5.17917 3.025 5.8375C3.44167 6.49583 3.65 7.21667 3.65 8C3.65 8.78333 3.44167 9.50417 3.025 10.1625C2.60833 10.8208 2.1 11.3583 1.5 11.775V14.5ZM7.4 12.05L10 10.025L12.6 12.05L11.6 8.85L14.05 6.8H11.05L10 3.75L8.95 6.8H5.95L8.4 8.85L7.4 12.05Z",
fill: "var(--color-main)"
}));
};
var CouponCard = function CouponCard(_ref) {

@@ -149,2 +105,46 @@ var couponName = _ref.couponName,

var ErrorIcon = function ErrorIcon(_ref) {
var color = _ref.color;
return React.createElement("svg", {
width: "16",
height: "16",
viewBox: "0 0 16 16",
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
"data-testid": 'error-icon'
}, React.createElement("circle", {
cx: "8",
cy: "8",
r: "8",
fill: color != null ? color : 'var(--color-negativeFeedback-light)'
}), React.createElement("path", {
fillRule: "evenodd",
clipRule: "evenodd",
d: "M5.48082 6.19357C5.28406 5.99682 5.28406 5.67782 5.48082 5.48106C5.67757 5.28431 5.99657 5.28431 6.19333 5.48106L7.99995 7.28768L9.80657 5.48106C10.0033 5.28431 10.3223 5.28431 10.5191 5.48106C10.7158 5.67782 10.7158 5.99682 10.5191 6.19357L8.71246 8.00019L10.519 9.80675C10.7158 10.0035 10.7158 10.3225 10.519 10.5193C10.3223 10.716 10.0033 10.716 9.80651 10.5193L7.99995 8.7127L6.19339 10.5193C5.99663 10.716 5.67763 10.716 5.48088 10.5193C5.28412 10.3225 5.28412 10.0035 5.48088 9.80675L7.28744 8.00019L5.48082 6.19357Z",
fill: "white"
}));
};
var AppliedCoupon = function AppliedCoupon(_ref) {
var type = _ref.type;
if (type === 'success') {
return React.createElement("p", {
className: 'succesCoupon'
}, React.createElement("span", null, React.createElement(SuccessIcon, null)), "Cupom aplicado com sucesso");
}
if (type === 'expired') {
return React.createElement("p", {
className: "error-coupon"
}, React.createElement("span", null, React.createElement(ErrorIcon, null)), "Cupom expirado.");
}
if (type === 'error') {
return React.createElement("p", {
className: "error-coupon"
}, React.createElement("span", null, React.createElement(ErrorIcon, null)), "N\xE3o foi possivel aplicar o cupom.", React.createElement("br", null), "Tente aplicar mais tarde.");
}
return React.createElement("p", {
className: "error-coupon"
}, React.createElement("span", null, React.createElement(ErrorIcon, null)), "Cupom expirado ou incorreto");
};
var CloseIcon = function CloseIcon(_ref) {

@@ -151,0 +151,0 @@ var color = _ref.color;

@@ -1,4 +0,1 @@

import { AppliedCoupon } from "./components/AppliedCoupon";
import { CouponCard } from "./components/CouponCard";
import { ModalRules } from "./components/ModalRules";
export { AppliedCoupon, CouponCard, ModalRules };
export * from './components/index';
{
"version": "0.1.2",
"version": "0.1.4",
"license": "MIT",

@@ -14,5 +14,7 @@ "main": "dist/index.js",

"scripts": {
"test": "jest",
"test-w": "jest --watch",
"test-c": "jest --coverage",
"start": "tsdx watch",
"build": "tsdx build",
"test": "tsdx test --passWithNoTests",
"lint": "tsdx lint",

@@ -51,14 +53,25 @@ "prepare": "tsdx build",

"devDependencies": {
"@size-limit/preset-small-lib": "^8.1.0",
"@types/react": "^18.0.22",
"@types/react-dom": "^18.0.7",
"@babel/core": "^7.18.2",
"@size-limit/preset-small-lib": "^7.0.8",
"@storybook/addon-essentials": "^6.5.7",
"@storybook/addon-info": "^5.3.21",
"@storybook/addon-links": "^6.5.7",
"@storybook/addons": "^6.5.7",
"@storybook/react": "^6.5.7",
"@storybook/testing-react": "^1.3.0",
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^13.3.0",
"@types/jest": "^28.1.1",
"@types/react": "^18.0.12",
"@types/react-dom": "^18.0.5",
"babel-loader": "^8.2.5",
"husky": "^8.0.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"sass": "^1.55.0",
"size-limit": "^8.1.0",
"react": "^18.1.0",
"react-dom": "^18.1.0",
"react-is": "^18.1.0",
"size-limit": "^7.0.8",
"tsdx": "^0.14.1",
"tslib": "^2.4.0",
"typescript": "^4.8.4"
"typescript": "^4.7.3"
}
}

@@ -1,5 +0,1 @@

import { AppliedCoupon } from "./components/AppliedCoupon";
import { CouponCard } from "./components/CouponCard";
import { ModalRules } from "./components/ModalRules";
export { AppliedCoupon, CouponCard, ModalRules }
export * from './components/index'

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc