@salesgenterp/ui-components 0.3.0 → 0.3.1
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/index.js +224 -0
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +225 -2
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -163,6 +163,229 @@ var CartDrawer = function CartDrawer(_ref) {
|
|
|
163
163
|
}, "continue to checkout"))));
|
|
164
164
|
};
|
|
165
165
|
|
|
166
|
+
var _templateObject$2, _templateObject2$2, _templateObject3$2, _templateObject4$1, _templateObject5$1, _templateObject6$1;
|
|
167
|
+
var CartSummaryContainer = styled.div(_templateObject$2 || (_templateObject$2 = _taggedTemplateLiteralLoose(["\n width: min(95%, 24.75em);\n max-width: ", ";\n display: flex;\n flex-direction: column;\n background: ", ";\n color: ", ";\n border-radius: 25px;\n padding: 2em 1em;\n align-items: center;\n p {\n font-size: 0.89em;\n font-weight: 300;\n align-self: flex-start;\n color: inherit;\n margin: 0;\n padding: 0;\n }\n .continueShopping {\n font-size: 0.75em;\n color: inherit;\n text-transform: capitalize;\n height: 20px;\n border-bottom: 1px solid;\n border-color: ", ";\n font-weight: 300;\n cursor: pointer;\n }\n"])), function (props) {
|
|
168
|
+
return props.maxWidth || '24.75em';
|
|
169
|
+
}, function (props) {
|
|
170
|
+
return props.background || '#667080';
|
|
171
|
+
}, function (props) {
|
|
172
|
+
return props.color || 'white';
|
|
173
|
+
}, function (props) {
|
|
174
|
+
return props.color || 'white';
|
|
175
|
+
});
|
|
176
|
+
var CartSummaryRow = styled.div(_templateObject2$2 || (_templateObject2$2 = _taggedTemplateLiteralLoose(["\n width: 100%;\n display: flex;\n flex-direction: row;\n justify-content: ", ";\n align-items: center;\n color: inherit;\n h6,\n h5 {\n margin: 0;\n font-size: 1em;\n font-weight: 700;\n color: inherit;\n text-transform: capitalize;\n }\n h5 {\n font-size: ", ";\n }\n"])), function (props) {
|
|
177
|
+
return props.justify || 'space-between';
|
|
178
|
+
}, function (props) {
|
|
179
|
+
return props.h5 || '1.31em';
|
|
180
|
+
});
|
|
181
|
+
var CartSummaryHr = styled.hr(_templateObject3$2 || (_templateObject3$2 = _taggedTemplateLiteralLoose(["\n border: none;\n width: 100%;\n height: 1px;\n background-color: ", ";\n margin: 1em 0;\n"])), function (props) {
|
|
182
|
+
return props.color || 'rgba(255, 255, 255, 0.5)';
|
|
183
|
+
});
|
|
184
|
+
var CartSummaryInputBox = styled.form(_templateObject4$1 || (_templateObject4$1 = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n padding-bottom: ", ";\n input {\n width: 10.81rem;\n height: 2.44rem;\n padding: 0.2em 0.8em;\n text-transform: capitalize;\n font-size: 0.89em;\n border-radius: 1.19rem;\n margin-right: 1em;\n border: none;\n outline: none;\n background: ", ";\n color: ", ";\n &::placeholder {\n color: ", ";\n }\n }\n button {\n width: 7.75rem;\n height: 2.44rem;\n background: ", ";\n border-radius: 1.19rem;\n display: grid;\n color: inherit;\n place-items: center;\n border: none;\n outline: none;\n text-transform: uppercase;\n cursor: pointer;\n font-size: 0.75em;\n transition: 0.3s;\n &:hover {\n letter-spacing: 1px;\n }\n }\n"])), function (props) {
|
|
185
|
+
return props.paddingBottom ? '2em' : '0';
|
|
186
|
+
}, function (props) {
|
|
187
|
+
return props.background || '#bfc3ca';
|
|
188
|
+
}, function (props) {
|
|
189
|
+
return props.color || '#667080';
|
|
190
|
+
}, function (props) {
|
|
191
|
+
return props.color || '#667080';
|
|
192
|
+
}, function (props) {
|
|
193
|
+
return props.btn || '#393f48';
|
|
194
|
+
});
|
|
195
|
+
var CartSummaryCheckoutBtn = styled.button(_templateObject5$1 || (_templateObject5$1 = _taggedTemplateLiteralLoose(["\n font-size: 0.95em;\n font-weight: 700;\n background: #393f48;\n cursor: pointer;\n text-transform: uppercase;\n color: inherit;\n border: none;\n outline: none;\n width: 16.81em;\n height: 3.75em;\n display: grid;\n place-items: center;\n font-size: 0.75em;\n border-radius: 2.64em;\n padding: 0;\n font-size: 0.94em;\n margin: 1em auto;\n transition: 0.3s;\n margin-top: 2em;\n &:hover {\n opacity: 0.8;\n }\n"])));
|
|
196
|
+
var CartSummaryCheckBoxRow = styled(CartSummaryRow)(_templateObject6$1 || (_templateObject6$1 = _taggedTemplateLiteralLoose(["\n justify-content: flex-start;\n margin-left: 1em;\n margin-top: 1em;\n cursor: pointer;\n .checkBox {\n width: 0.63em;\n height: 0.63em;\n border: 1px solid;\n border-color: ", ";\n background: transparent;\n margin-right: 0.5em;\n border-radius: 50%;\n background: ", ";\n }\n p {\n font-size: 1em;\n font-weight: 6 400;\n span {\n font-weight: 600;\n margin: 0 0.1em;\n }\n }\n"])), function (props) {
|
|
197
|
+
return props.background || 'white';
|
|
198
|
+
}, function (props) {
|
|
199
|
+
return props.selected ? props.background : 'transparent';
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
var CartSummary = function CartSummary(_ref) {
|
|
203
|
+
var _styles$input, _styles$input2, _ref2;
|
|
204
|
+
|
|
205
|
+
var _ref$retail = _ref.retail,
|
|
206
|
+
retail = _ref$retail === void 0 ? true : _ref$retail,
|
|
207
|
+
shippingData = _ref.shippingData,
|
|
208
|
+
selectedShipping = _ref.selectedShipping,
|
|
209
|
+
setShipping = _ref.setShipping,
|
|
210
|
+
clickRedirect = _ref.clickRedirect,
|
|
211
|
+
subtotal = _ref.subtotal,
|
|
212
|
+
styles = _ref.styles;
|
|
213
|
+
console.log(selectedShipping);
|
|
214
|
+
return /*#__PURE__*/React__default.createElement(CartSummaryContainer, {
|
|
215
|
+
background: styles === null || styles === void 0 ? void 0 : styles.bg,
|
|
216
|
+
color: styles === null || styles === void 0 ? void 0 : styles.color
|
|
217
|
+
}, /*#__PURE__*/React__default.createElement("p", null, "Cart summary"), /*#__PURE__*/React__default.createElement(CartSummaryHr, {
|
|
218
|
+
color: styles === null || styles === void 0 ? void 0 : styles.hr
|
|
219
|
+
}), /*#__PURE__*/React__default.createElement(CartSummaryRow, null, /*#__PURE__*/React__default.createElement("h6", null, "subtotal"), /*#__PURE__*/React__default.createElement("h5", null, "$", subtotal === null || subtotal === void 0 ? void 0 : subtotal.toFixed(2))), /*#__PURE__*/React__default.createElement(CartSummaryHr, {
|
|
220
|
+
color: styles === null || styles === void 0 ? void 0 : styles.hr
|
|
221
|
+
}), /*#__PURE__*/React__default.createElement(CartSummaryRow, null, /*#__PURE__*/React__default.createElement("h6", null, "Discount"), /*#__PURE__*/React__default.createElement("h5", null, "$0.00")), /*#__PURE__*/React__default.createElement(CartSummaryHr, {
|
|
222
|
+
color: styles === null || styles === void 0 ? void 0 : styles.hr
|
|
223
|
+
}), retail && /*#__PURE__*/React__default.createElement(material.Stack, {
|
|
224
|
+
flexDirection: "column",
|
|
225
|
+
justifyContent: "flexStart",
|
|
226
|
+
sx: {
|
|
227
|
+
width: '100%'
|
|
228
|
+
}
|
|
229
|
+
}, /*#__PURE__*/React__default.createElement(CartSummaryRow, {
|
|
230
|
+
justify: "flex-start"
|
|
231
|
+
}, /*#__PURE__*/React__default.createElement("h6", null, "shipping")), shippingData.map(function (li, i) {
|
|
232
|
+
var _li$amount;
|
|
233
|
+
|
|
234
|
+
return /*#__PURE__*/React__default.createElement(CartSummaryCheckBoxRow, {
|
|
235
|
+
key: i,
|
|
236
|
+
selected: li.id === selectedShipping.id,
|
|
237
|
+
onClick: function onClick() {
|
|
238
|
+
setShipping(li);
|
|
239
|
+
},
|
|
240
|
+
background: styles.color
|
|
241
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
242
|
+
className: "checkBox"
|
|
243
|
+
}), /*#__PURE__*/React__default.createElement("p", null, li.name, ' ', li.amount && li.amount > 0 && /*#__PURE__*/React__default.createElement("span", null, ": $", (_li$amount = li.amount) === null || _li$amount === void 0 ? void 0 : _li$amount.toFixed(2))));
|
|
244
|
+
}), /*#__PURE__*/React__default.createElement(CartSummaryHr, {
|
|
245
|
+
color: styles === null || styles === void 0 ? void 0 : styles.hr
|
|
246
|
+
})), /*#__PURE__*/React__default.createElement(CartSummaryInputBox, {
|
|
247
|
+
paddingBottom: !retail,
|
|
248
|
+
background: styles === null || styles === void 0 ? void 0 : (_styles$input = styles.input) === null || _styles$input === void 0 ? void 0 : _styles$input.bg,
|
|
249
|
+
color: styles === null || styles === void 0 ? void 0 : (_styles$input2 = styles.input) === null || _styles$input2 === void 0 ? void 0 : _styles$input2.color,
|
|
250
|
+
btn: styles === null || styles === void 0 ? void 0 : styles.btnColor
|
|
251
|
+
}, /*#__PURE__*/React__default.createElement("input", {
|
|
252
|
+
placeholder: "Coupon code",
|
|
253
|
+
type: "email",
|
|
254
|
+
required: true
|
|
255
|
+
}), /*#__PURE__*/React__default.createElement("button", null, "apply coupon")), /*#__PURE__*/React__default.createElement(CartSummaryHr, {
|
|
256
|
+
color: styles === null || styles === void 0 ? void 0 : styles.hr
|
|
257
|
+
}), /*#__PURE__*/React__default.createElement(CartSummaryRow, {
|
|
258
|
+
h5: "1.64em"
|
|
259
|
+
}, /*#__PURE__*/React__default.createElement("h6", null, "total"), /*#__PURE__*/React__default.createElement("h5", null, "$", (_ref2 = subtotal + (selectedShipping === null || selectedShipping === void 0 ? void 0 : selectedShipping.amount)) === null || _ref2 === void 0 ? void 0 : _ref2.toFixed(2))), /*#__PURE__*/React__default.createElement(CartSummaryRow, {
|
|
260
|
+
justify: "center"
|
|
261
|
+
}, /*#__PURE__*/React__default.createElement(CartSummaryCheckoutBtn, {
|
|
262
|
+
onClick: function onClick() {
|
|
263
|
+
return clickRedirect('/checkout');
|
|
264
|
+
},
|
|
265
|
+
background: styles === null || styles === void 0 ? void 0 : styles.btnColor
|
|
266
|
+
}, "proceed to checkokut")), /*#__PURE__*/React__default.createElement(CartSummaryRow, {
|
|
267
|
+
justify: "center"
|
|
268
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
269
|
+
className: "continueShopping",
|
|
270
|
+
onClick: function onClick() {
|
|
271
|
+
return clickRedirect('/');
|
|
272
|
+
}
|
|
273
|
+
}, "Continue to shopping")));
|
|
274
|
+
};
|
|
275
|
+
|
|
276
|
+
var _templateObject$3, _templateObject2$3, _templateObject3$3, _templateObject4$2, _templateObject5$2, _templateObject6$2, _templateObject7$1;
|
|
277
|
+
var CartPageCard = styled.div(_templateObject$3 || (_templateObject$3 = _taggedTemplateLiteralLoose(["\n width: min(97%, 485px);\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n padding: 1rem;\n background: #ffffff;\n box-shadow: 0px 20px 35px rgba(0, 0, 0, 0.05);\n border-radius: 20px;\n position: relative;\n"])));
|
|
278
|
+
var CartPageImg = styled.img(_templateObject2$3 || (_templateObject2$3 = _taggedTemplateLiteralLoose(["\n /* width: 95px; */\n width: ", ";\n height: ", ";\n position: relative;\n margin-right: 1em;\n"])), function (props) {
|
|
279
|
+
return props.width || 'auto';
|
|
280
|
+
}, function (props) {
|
|
281
|
+
return props.height || '81px';
|
|
282
|
+
});
|
|
283
|
+
var NameAndQtBox = styled.div(_templateObject3$3 || (_templateObject3$3 = _taggedTemplateLiteralLoose(["\n width: 90%;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: space-between;\n position: relative;\n"])));
|
|
284
|
+
var CartPageCardName = styled.div(_templateObject4$2 || (_templateObject4$2 = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n align-items: flex-start;\n width: 90%;\n overflow: hidden;\n text-overflow: ellipsis;\n margin-bottom: 0.6em;\n h6 {\n color: #323232;\n font-size: 0.9em;\n margin-bottom: 0.6em;\n line-height: 1.3rem;\n max-height: 1.4rem;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n p {\n font-size: 1.1em;\n color: #c3c6c9;\n }\n"])));
|
|
285
|
+
var QtAndPriceBox = styled.div(_templateObject5$2 || (_templateObject5$2 = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n width: 100%;\n .subtotal {\n color: #323232;\n text-transform: capitalize;\n font-weight: bold;\n font-size: 0.85em;\n }\n"])));
|
|
286
|
+
var CartPageQtBox = styled.div(_templateObject6$2 || (_templateObject6$2 = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n max-width: 80px;\n min-width: 80px;\n height: 22px;\n .icon {\n width: 20.5px;\n height: 20.5px;\n display: grid;\n place-items: center;\n font-size: 10px;\n background: #eef1f4;\n cursor: pointer;\n }\n .qt {\n font-size: 18px;\n font-weight: 500;\n display: grid;\n place-items: center;\n color: #c3c6c9;\n }\n"])));
|
|
287
|
+
var CloseBtn = styled.div(_templateObject7$1 || (_templateObject7$1 = _taggedTemplateLiteralLoose(["\n width: 25px;\n height: 25px;\n display: grid;\n place-items: center;\n position: absolute;\n top: 1em;\n right: 1em;\n cursor: pointer;\n border-radius: 50%;\n background: #eef1f4;\n font-size: 12px;\n"])));
|
|
288
|
+
|
|
289
|
+
var CartPageProductCard = function CartPageProductCard(_ref) {
|
|
290
|
+
var _item$standardPrice;
|
|
291
|
+
|
|
292
|
+
var item = _ref.item,
|
|
293
|
+
imgnotfoundUrl = _ref.imgnotfoundUrl,
|
|
294
|
+
handleIncrementDecrement = _ref.handleIncrementDecrement,
|
|
295
|
+
handleRemoveProduct = _ref.handleRemoveProduct,
|
|
296
|
+
loading = _ref.loading,
|
|
297
|
+
imgSize = _ref.imgSize;
|
|
298
|
+
var imgnotfoundUrlcommon = '/images/imgnotfound.jpeg';
|
|
299
|
+
if (imgnotfoundUrl && imgnotfoundUrl !== 'null') imgnotfoundUrlcommon = imgnotfoundUrl;
|
|
300
|
+
return /*#__PURE__*/React__default.createElement(CartPageCard, null, /*#__PURE__*/React__default.createElement(CartPageImg, {
|
|
301
|
+
src: item.imageUrl && item.imageUrl !== 'null' ? item.imageUrl : imgnotfoundUrlcommon,
|
|
302
|
+
alt: 'no product image available',
|
|
303
|
+
width: imgSize === null || imgSize === void 0 ? void 0 : imgSize.width,
|
|
304
|
+
height: imgSize === null || imgSize === void 0 ? void 0 : imgSize.height
|
|
305
|
+
}), /*#__PURE__*/React__default.createElement(NameAndQtBox, null, /*#__PURE__*/React__default.createElement(CartPageCardName, null, /*#__PURE__*/React__default.createElement(material.Tooltip, {
|
|
306
|
+
title: item.productName,
|
|
307
|
+
placement: "top",
|
|
308
|
+
arrow: true
|
|
309
|
+
}, /*#__PURE__*/React__default.createElement("h6", null, item.productName)), /*#__PURE__*/React__default.createElement("p", null, "$", (_item$standardPrice = item.standardPrice) === null || _item$standardPrice === void 0 ? void 0 : _item$standardPrice.toFixed(2))), /*#__PURE__*/React__default.createElement(QtAndPriceBox, null, /*#__PURE__*/React__default.createElement(CartPageQtBox, null, /*#__PURE__*/React__default.createElement("span", {
|
|
310
|
+
className: "icon",
|
|
311
|
+
onClick: function onClick() {
|
|
312
|
+
if (loading) return;
|
|
313
|
+
handleIncrementDecrement('decrement', item);
|
|
314
|
+
}
|
|
315
|
+
}, /*#__PURE__*/React__default.createElement(ai.AiOutlineMinus, null)), /*#__PURE__*/React__default.createElement("span", {
|
|
316
|
+
className: "qt"
|
|
317
|
+
}, item.quantity), /*#__PURE__*/React__default.createElement("span", {
|
|
318
|
+
className: "icon",
|
|
319
|
+
onClick: function onClick() {
|
|
320
|
+
if (loading) return;
|
|
321
|
+
handleIncrementDecrement('increment', item);
|
|
322
|
+
}
|
|
323
|
+
}, /*#__PURE__*/React__default.createElement(ai.AiOutlinePlus, null))), /*#__PURE__*/React__default.createElement("p", {
|
|
324
|
+
className: "subtotal"
|
|
325
|
+
}, "subtotal: $", (item.standardPrice * item.quantity).toFixed(2)))), /*#__PURE__*/React__default.createElement(CloseBtn, {
|
|
326
|
+
onClick: function onClick() {
|
|
327
|
+
if (loading) return;
|
|
328
|
+
handleRemoveProduct(item);
|
|
329
|
+
}
|
|
330
|
+
}, /*#__PURE__*/React__default.createElement(ai.AiOutlineClose, null)));
|
|
331
|
+
};
|
|
332
|
+
|
|
333
|
+
var _templateObject$4, _templateObject2$4;
|
|
334
|
+
var CartPageContainer = styled.div(_templateObject$4 || (_templateObject$4 = _taggedTemplateLiteralLoose(["\n width: 100%;\n max-width: ", ";\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: flex-start;\n\n .scrollDiv {\n width: 68%;\n height: 630px;\n max-height: 630px;\n background-color: white;\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n margin-right: 0.3em;\n &::-webkit-scrollbar {\n width: ", ";\n }\n\n /* Track */\n &::-webkit-scrollbar-track {\n background: ", ";\n border-radius: 16px;\n }\n\n /* Handle */\n &::-webkit-scrollbar-thumb {\n background: ", ";\n border-radius: 16px;\n margin: 5px 2px;\n border: 3px solid;\n border-color: ", ";\n }\n box-shadow: 0px 20px 35px rgba(0, 0, 0, 0.05);\n }\n @media only screen and (max-width: 840px) {\n flex-direction: column;\n .scrollDiv {\n width: 100%;\n margin: 0;\n margin-bottom: 2em;\n padding: 0 0.4em;\n }\n }\n"])), function (props) {
|
|
335
|
+
return props.maxWidth || '1350px';
|
|
336
|
+
}, function (props) {
|
|
337
|
+
return props.retail ? '12px' : '8px';
|
|
338
|
+
}, function (props) {
|
|
339
|
+
return props.retail ? '#667080' : 'rgba(102, 112, 128, 0.5)';
|
|
340
|
+
}, function (props) {
|
|
341
|
+
return props.retail ? '#BFC3CA' : '#EDEDED';
|
|
342
|
+
}, function (props) {
|
|
343
|
+
return props.retail ? '#667080' : 'rgba(102, 112, 128, 0.5)';
|
|
344
|
+
});
|
|
345
|
+
var CardsBox = styled.div(_templateObject2$4 || (_templateObject2$4 = _taggedTemplateLiteralLoose(["\n width: 100%;\n /* min-height: 1000px; */\n position: relative;\n max-width: 860px;\n margin-right: auto;\n padding: 1em 2em;\n display: ", ";\n grid-template-columns: 1fr 1fr;\n flex-direction: column;\n align-items: flex-start;\n grid-gap: 1em;\n justify-content: flex-start;\n align-items: center;\n border-radius: 20px;\n @media only screen and (max-width: 1220px) {\n display: flex;\n }\n @media only screen and (max-width: 640px) {\n padding: 1em 0.2em;\n }\n"])), function (props) {
|
|
346
|
+
return props.retail ? 'grid' : 'flex';
|
|
347
|
+
});
|
|
348
|
+
|
|
349
|
+
var CartPageComponent = function CartPageComponent(_ref) {
|
|
350
|
+
var _cartData$cartLineIte;
|
|
351
|
+
|
|
352
|
+
var retail = _ref.retail,
|
|
353
|
+
shippingData = _ref.shippingData,
|
|
354
|
+
selectedShipping = _ref.selectedShipping,
|
|
355
|
+
setShipping = _ref.setShipping,
|
|
356
|
+
clickRedirect = _ref.clickRedirect,
|
|
357
|
+
cartData = _ref.cartData,
|
|
358
|
+
handleIncrementDecrement = _ref.handleIncrementDecrement,
|
|
359
|
+
handleRemoveProduct = _ref.handleRemoveProduct,
|
|
360
|
+
loading = _ref.loading,
|
|
361
|
+
imgnotfoundUrl = _ref.imgnotfoundUrl,
|
|
362
|
+
styles = _ref.styles;
|
|
363
|
+
return /*#__PURE__*/React__default.createElement(CartPageContainer, {
|
|
364
|
+
retail: retail
|
|
365
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
366
|
+
className: "scrollDiv"
|
|
367
|
+
}, /*#__PURE__*/React__default.createElement(CardsBox, {
|
|
368
|
+
retail: retail
|
|
369
|
+
}, cartData === null || cartData === void 0 ? void 0 : (_cartData$cartLineIte = cartData.cartLineItemDtoList) === null || _cartData$cartLineIte === void 0 ? void 0 : _cartData$cartLineIte.map(function (item) {
|
|
370
|
+
return /*#__PURE__*/React__default.createElement(CartPageProductCard, {
|
|
371
|
+
item: item,
|
|
372
|
+
loading: loading,
|
|
373
|
+
imgnotfoundUrl: imgnotfoundUrl,
|
|
374
|
+
handleIncrementDecrement: handleIncrementDecrement,
|
|
375
|
+
handleRemoveProduct: handleRemoveProduct,
|
|
376
|
+
imgSize: styles === null || styles === void 0 ? void 0 : styles.imgSize
|
|
377
|
+
});
|
|
378
|
+
}))), /*#__PURE__*/React__default.createElement(CartSummary, {
|
|
379
|
+
retail: retail,
|
|
380
|
+
shippingData: shippingData,
|
|
381
|
+
selectedShipping: selectedShipping,
|
|
382
|
+
setShipping: setShipping,
|
|
383
|
+
clickRedirect: clickRedirect,
|
|
384
|
+
subtotal: cartData === null || cartData === void 0 ? void 0 : cartData.totalCartPrice,
|
|
385
|
+
styles: styles === null || styles === void 0 ? void 0 : styles.cartSummary
|
|
386
|
+
}));
|
|
387
|
+
};
|
|
388
|
+
|
|
166
389
|
var Breakpoint = function Breakpoint() {};
|
|
167
390
|
|
|
168
391
|
Breakpoint.xs = 'xs';
|
|
@@ -270,6 +493,7 @@ function useGridSize() {
|
|
|
270
493
|
|
|
271
494
|
exports.Breakpoint = Breakpoint;
|
|
272
495
|
exports.CartDrawer = CartDrawer;
|
|
496
|
+
exports.CartPage = CartPageComponent;
|
|
273
497
|
exports.Variant = Variant;
|
|
274
498
|
exports.useGridSize = useGridSize;
|
|
275
499
|
exports.useWindowSize = useWindowSize;
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/components/CartDrawer/cartDrawer.styles.js","../src/components/CartDrawer/CartDrawerCard/CartDrawerProduct.styles.js","../src/components/CartDrawer/CartDrawerCard/CartDrawerCard.jsx","../src/components/CartDrawer/CartDrawer.jsx","../src/constants/Breakpoint.js","../src/constants/Variant.js","../src/utils/debounce.js","../src/hooks/useWindowSize.jsx","../src/hooks/useGridSize.jsx"],"sourcesContent":["import styled from 'styled-components';\nexport const CartDrawerContainer = styled.div`\n width: 100%;\n max-width: ${(props) => props.maxWidth || '650px'};\n height: 100%;\n font-family: ${(props) => props.fontFamily};\n /* padding: 1em;\n padding-top: 0rem; */\n position: relative;\n /* min-width: 100%; */\n min-height: 100vh;\n max-height: 100vh;\n overflow-y: auto;\n /* background-color: grey; */\n /* border: 1px solid; */\n`;\n\nexport const CartDrawerBar = styled.div`\n width: 100%;\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n position: sticky;\n box-sizing: border-box;\n top: 0;\n left: -1em;\n padding: 1em;\n height: 4.6rem;\n font-size: 1.6rem;\n background-color: white;\n font-weight: bold;\n padding-left: 1rem;\n z-index: 2;\n .icon {\n cursor: pointer;\n font-size: 22px;\n }\n @media only screen and (max-width: 640px) {\n font-size: 1.2rem;\n height: 4rem;\n }\n`;\n\nexport const CartDrawerProductContainer = styled.div`\n width: 100%;\n height: max-content;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: flex-start;\n position: relative;\n /* height: 900px; */\n padding: 1rem;\n min-height: 74vh;\n opacity: ${(props) => props.opacity};\n @media only screen and (max-width: 748px) {\n min-height: 75vh;\n }\n /* background-color: red; */\n`;\n\nexport const CartDrawerBottomSection = styled.div`\n width: 100%;\n /* height: 8rem; */\n background-color: white;\n box-shadow: 3px -2px 10px #b1b1b1;\n display: flex;\n flex-direction: column;\n min-height: 7rem;\n position: sticky;\n bottom: 0;\n /* padding-bottom: 0.5rem; */\n\n /* left: 0; */\n align-items: center;\n .row {\n width: 100%;\n padding: 0rem 1rem;\n padding-top: 1rem;\n /* padding-left: 1rem; */\n h5 {\n font-weight: bold;\n font-size: 1.1rem;\n span {\n font-weight: 400;\n padding-left: 0.5rem;\n }\n }\n }\n @media only screen and (max-width: 340px) {\n min-height: 6rem;\n .row h5 {\n font-size: 0.8rem;\n }\n }\n`;\n\nexport const CartDrawerOutlinedButton = styled.button`\n width: 90%;\n height: 3.55rem;\n border: 2px solid;\n border-radius: 1rem;\n display: grid;\n place-items: center;\n font-weight: 500;\n font-size: 1rem;\n transition: 0.5s;\n outline: none;\n text-transform: capitalize;\n border-color: ${(props) => props.color || 'black'};\n color: ${(props) => props.color || 'black'};\n text-transform: capitalize;\n margin: 0.6rem 0;\n cursor: pointer;\n background: white;\n &:hover,\n &:focus {\n opacity: 0.8;\n letter-spacing: 1px;\n outline: none;\n }\n @media only screen and (max-width: 640px) {\n height: 2.9rem;\n }\n @media only screen and (max-width: 340px) {\n height: 2.2rem;\n margin: 0.3rem 0;\n }\n`;\n\nexport const CartDrawerFilledButton = styled(CartDrawerOutlinedButton)`\n background: ${(props) => props.color || 'black'};\n color: white;\n position: relative;\n margin-bottom: 1rem;\n .icon {\n position: absolute;\n right: 2rem;\n margin: auto 0;\n }\n`;\n\nexport const CartDrawerEmptyCart = styled.div`\n width: 100%;\n height: calc(100vh - 4.6rem);\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n h6 {\n font-size: 1.8rem;\n font-weight: bold;\n text-transform: uppercase;\n margin: 0;\n margin-top: 1rem;\n color: ${(props) => props.color || 'red'};\n }\n p {\n font-size: 1.1rem;\n text-transform: capitalize;\n font-weight: 500;\n /* color: darkgrey; */\n /* color: orange; */\n }\n .icon {\n font-size: 9.5rem;\n color: darkgrey;\n /* color: orange; */\n }\n`;\n","import styled from 'styled-components';\nexport const CartDrawerProduct = styled.div`\n width: 100%;\n display: flex;\n flex-direction: row;\n height: 100px;\n justify-content: space-around;\n align-items: center;\n overflow: hidden;\n margin-bottom: 2rem;\n img {\n width: 20%;\n max-height: 100%;\n /* aspect-ratio: 1; */\n object-fit: cover;\n }\n .middleSection {\n width: 60%;\n padding-left: 0.8rem;\n height: 100%;\n h6 {\n font-size: 1.1rem;\n font-weight: bold;\n margin: 0;\n\n span {\n font-size: 0.8rem;\n color: grey;\n text-decoration: line-through;\n margin-right: 0.5rem;\n }\n }\n .name {\n font-size: 0.9rem;\n line-height: 1.2rem;\n max-height: 2.45rem;\n width: 100%;\n word-wrap: break-word;\n overflow: hidden;\n text-overflow: ellipsis;\n transition: 0.3s;\n cursor: pointer;\n &:hover {\n color: ${(props) => props.color || 'grey'};\n }\n }\n }\n .endSection {\n width: 20%;\n height: 100%;\n .icon {\n cursor: pointer;\n transition: 0.4s;\n &:hover {\n color: red;\n /* opacity: 0.7; */\n }\n }\n }\n @media only screen and (max-width: 340px) {\n height: 80px;\n .middleSection {\n h6 {\n font-size: 0.9rem;\n }\n .name {\n font-size: 0.7rem;\n height: 1.45rem;\n }\n }\n }\n`;\n\nexport const CartDrawerQtBox = styled.div`\n height: 34px;\n width: 82px;\n border: 1px solid rgb(211, 210, 210);\n display: flex;\n align-items: center;\n justify-content: space-between;\n font-size: 13.5px;\n color: #333;\n padding: 0 0.5rem;\n border-radius: 5px;\n max-width: 100%;\n\n span {\n cursor: pointer;\n height: 100%;\n display: grid;\n place-items: center;\n }\n .qt {\n font-size: 12px;\n color: black;\n font-weight: 500;\n cursor: auto;\n }\n @media only screen and (max-width: 640px) {\n min-width: 55px;\n aspect-ratio: 1/2;\n /* min-height: 28px; */\n font-size: 10px;\n }\n @media only screen and (max-width: 340px) {\n min-width: 50px;\n aspect-ratio: 1/2;\n height: 22px;\n font-size: 8px;\n }\n`;\nexport const CartDrawerLoader = styled.div`\n position: absolute;\n top: 30%;\n width: 100px;\n height: 100px;\n display: grid;\n place-items: center;\n`;\n","import React from 'react';\nimport { Stack, Tooltip } from '@mui/material';\nimport { RiDeleteBin5Line } from 'react-icons/ri';\nimport { AiOutlinePlus, AiOutlineMinus } from 'react-icons/ai';\n// import imgnotfound from '../../../assets/imgnotfound.jpeg';\n////////\nimport { CartDrawerProduct, CartDrawerQtBox } from './CartDrawerProduct.styles';\nconst CartDrawerProductCard = ({\n product,\n color,\n handleIncrementDecrement,\n handleRemoveProduct,\n handleRedirect,\n imgnotfoundUrl,\n loading,\n}) => {\n let imgnotfoundUrlcommon = '/images/imgnotfound.jpeg';\n if (imgnotfoundUrl && imgnotfoundUrl !== 'null')\n imgnotfoundUrlcommon = imgnotfoundUrl;\n\n return (\n <CartDrawerProduct color={color}>\n <img\n src={\n product.imageUrl && product.imageUrl !== 'null'\n ? product.imageUrl\n : imgnotfoundUrlcommon\n }\n alt={'no product image available'}\n />\n <Stack\n flexDirection=\"column\"\n justifyContent=\"space-between\"\n alignItems=\"flex-start\"\n className=\"middleSection\"\n >\n <Tooltip title={product?.productName} placement=\"top\" arrow>\n <h6 className=\"name\" onClick={() => handleRedirect(product)}>\n {product?.productName}\n </h6>\n </Tooltip>\n\n <h6>\n {product?.standardPrice === product?.cartStandardPrice ? (\n `$${product?.standardPrice}`\n ) : (\n <React.Fragment>\n <span>${product?.cartStandardPrice?.toFixed(2)}</span>$\n {product?.standardPrice?.toFixed(2)}\n </React.Fragment>\n )}\n </h6>\n </Stack>\n <Stack\n flexDirection=\"column\"\n justifyContent=\"space-between\"\n alignItems=\"flex-end\"\n className=\"endSection\"\n >\n <RiDeleteBin5Line\n className=\"icon\"\n onClick={() => {\n if (loading) return;\n handleRemoveProduct(product);\n }}\n />\n <CartDrawerQtBox>\n <span\n onClick={() => {\n if (loading) return;\n handleIncrementDecrement('decrement', product);\n }}\n >\n {' '}\n <AiOutlineMinus />\n </span>{' '}\n <span className={'qt'}>{product?.quantity}</span>\n <span\n onClick={() => {\n if (loading) return;\n handleIncrementDecrement('increment', product);\n }}\n >\n <AiOutlinePlus />\n </span>\n </CartDrawerQtBox>\n </Stack>\n </CartDrawerProduct>\n );\n};\n\nexport default CartDrawerProductCard;\n","import { Stack } from '@mui/material';\nimport React from 'react';\nimport { GrClose } from 'react-icons/gr';\nimport { GiShoppingCart } from 'react-icons/gi';\nimport { BsCartX } from 'react-icons/bs';\n//////\nimport {\n CartDrawerBar,\n CartDrawerBottomSection,\n CartDrawerContainer,\n CartDrawerOutlinedButton,\n CartDrawerFilledButton,\n CartDrawerProductContainer,\n CartDrawerEmptyCart,\n} from './cartDrawer.styles';\nimport CartDrawerProductCard from './CartDrawerCard/CartDrawerCard';\nimport { CartDrawerLoader } from './CartDrawerCard/CartDrawerProduct.styles';\nimport { PuffLoader } from 'react-spinners';\n\nconst CartDrawer = ({\n cartData,\n maxWidth,\n color,\n handleRedirect,\n handleIncrementDecrement,\n handleRemoveProduct,\n handleClose,\n loading,\n imgnotfoundUrl,\n}) => {\n return (\n <React.Fragment>\n <CartDrawerContainer maxWidth={maxWidth}>\n <CartDrawerBar>\n <h2>Your Cart</h2>\n <GrClose\n className=\"icon\"\n onClick={() => {\n handleClose();\n }}\n />\n </CartDrawerBar>\n {cartData && cartData?.totalCartQuantity > 0 ? (\n <CartDrawerProductContainer opacity={loading ? '.4' : '1'}>\n {cartData?.cartLineItemDtoList?.map((product, i) => (\n <React.Fragment>\n {loading && (\n <CartDrawerLoader>\n <PuffLoader color=\"black\" />\n </CartDrawerLoader>\n )}\n\n <CartDrawerProductCard\n product={product}\n handleRedirect={handleRedirect}\n handleIncrementDecrement={handleIncrementDecrement}\n handleRemoveProduct={handleRemoveProduct}\n color={color}\n key={i}\n imgnotfoundUrl={imgnotfoundUrl}\n loading={loading}\n />\n </React.Fragment>\n ))}\n </CartDrawerProductContainer>\n ) : (\n <CartDrawerEmptyCart color={color}>\n <BsCartX className=\"icon\" />\n <h6>OOps!</h6>\n <p>your cart is empty</p>\n </CartDrawerEmptyCart>\n )}\n {cartData && cartData?.totalCartQuantity > 0 && (\n <CartDrawerBottomSection>\n <Stack\n flexDirection=\"row\"\n justifyContent=\"space-between\"\n alignItems=\"center\"\n className=\"row\"\n >\n <h5>\n Subtotal<span>({cartData?.totalCartQuantity} items)</span>\n </h5>\n <h5>${cartData?.totalCartPrice?.toFixed(2)}</h5>\n </Stack>\n <CartDrawerOutlinedButton\n color={color}\n onClick={() => handleRedirect('cart')}\n >\n view cart\n </CartDrawerOutlinedButton>\n <CartDrawerFilledButton\n color={color}\n onClick={() => handleRedirect('checkout')}\n >\n continue to checkout\n </CartDrawerFilledButton>\n </CartDrawerBottomSection>\n )}\n </CartDrawerContainer>\n </React.Fragment>\n );\n};\n\nexport default CartDrawer;\n","class Breakpoint {\n static xs = 'xs';\n static sm = 'sm';\n static md = 'md';\n static lg = 'lg';\n static xl = 'xl';\n static xxl = 'xxl';\n}\n\nexport default Breakpoint;\n","class Variant {\n static ONE = 'one';\n static TWO = 'two';\n static THREE = 'three';\n}\n\nexport default Variant;\n","export default function debounce(func, wait, immediate) {\n let timeout;\n return function (...args) {\n clearTimeout(timeout);\n timeout = setTimeout(() => {\n timeout = null;\n if (!immediate) func.apply(this, args);\n }, wait);\n if (immediate && !timeout) func.apply(this, [...args]);\n };\n}\n","import { useEffect, useState } from 'react';\nimport debounce from '../utils/debounce';\n\nfunction useWindowSize() {\n const isWindow = typeof window !== 'undefined';\n const [windowSize, setWindowSize] = useState({\n width: isWindow ? window.innerWidth : 1200,\n height: isWindow ? window.innerHeight : 800,\n });\n\n useEffect(() => {\n const onWindowResize = () => {\n setWindowSize({\n width: window.innerWidth,\n height: window.innerHeight,\n });\n };\n\n const onResize = debounce(onWindowResize, 100);\n\n window.addEventListener('resize', onResize);\n onWindowResize();\n\n return () => {\n window.removeEventListener('resize', onResize);\n };\n }, []);\n\n return windowSize;\n}\n\nexport default useWindowSize;\n","import { useEffect, useState } from 'react';\nimport useWindowSize from './useWindowSize';\nimport { Breakpoint } from '../constants';\n\n/*\n The breakpoints of responsive grid follow Google chrome media queries rules\n*/\nconst getBreakpoint = ({ width: screen }) => {\n let breakpoint = '';\n\n if (screen <= 320) {\n breakpoint = Breakpoint.xs;\n }\n if (screen >= 375) {\n breakpoint = Breakpoint.sm;\n }\n if (screen >= 768) {\n breakpoint = Breakpoint.md;\n }\n if (screen >= 992) {\n breakpoint = Breakpoint.lg;\n }\n if (screen >= 1200) {\n breakpoint = Breakpoint.xl;\n }\n if (screen >= 1600) {\n breakpoint = Breakpoint.xxl;\n }\n\n return breakpoint;\n};\n\nfunction useGridSize() {\n const windowSize = useWindowSize();\n const [layout, setLayout] = useState(Breakpoint.md);\n\n useEffect(() => {\n setLayout(getBreakpoint(windowSize));\n }, [windowSize]);\n return layout;\n}\n\nexport default useGridSize;\n"],"names":["CartDrawerContainer","styled","div","props","maxWidth","fontFamily","CartDrawerBar","CartDrawerProductContainer","opacity","CartDrawerBottomSection","CartDrawerOutlinedButton","button","color","CartDrawerFilledButton","CartDrawerEmptyCart","CartDrawerProduct","CartDrawerQtBox","CartDrawerLoader","CartDrawerProductCard","product","handleIncrementDecrement","handleRemoveProduct","handleRedirect","imgnotfoundUrl","loading","imgnotfoundUrlcommon","React","imageUrl","Stack","Tooltip","productName","standardPrice","cartStandardPrice","toFixed","RiDeleteBin5Line","AiOutlineMinus","quantity","AiOutlinePlus","CartDrawer","cartData","handleClose","GrClose","totalCartQuantity","cartLineItemDtoList","map","i","PuffLoader","BsCartX","totalCartPrice","Breakpoint","xs","sm","md","lg","xl","xxl","Variant","ONE","TWO","THREE","debounce","func","wait","immediate","timeout","args","clearTimeout","setTimeout","apply","useWindowSize","isWindow","window","useState","width","innerWidth","height","innerHeight","windowSize","setWindowSize","useEffect","onWindowResize","onResize","addEventListener","removeEventListener","getBreakpoint","screen","breakpoint","useGridSize","layout","setLayout"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AACO,IAAMA,mBAAmB,GAAGC,MAAM,CAACC,GAAV,oXAEjB,UAACC,KAAD;EAAA,OAAWA,KAAK,CAACC,QAAN,IAAkB,OAA7B;AAAA,CAFiB,EAIf,UAACD,KAAD;EAAA,OAAWA,KAAK,CAACE,UAAjB;AAAA,CAJe,CAAzB;AAgBA,IAAMC,aAAa,GAAGL,MAAM,CAACC,GAAV,0jBAAnB;AA2BA,IAAMK,0BAA0B,GAAGN,MAAM,CAACC,GAAV,+aAW1B,UAACC,KAAD;EAAA,OAAWA,KAAK,CAACK,OAAjB;AAAA,CAX0B,CAAhC;AAkBA,IAAMC,uBAAuB,GAAGR,MAAM,CAACC,GAAV,2uBAA7B;AAoCA,IAAMQ,wBAAwB,GAAGT,MAAM,CAACU,MAAV,ssBAYnB,UAACR,KAAD;EAAA,OAAWA,KAAK,CAACS,KAAN,IAAe,OAA1B;AAAA,CAZmB,EAa1B,UAACT,KAAD;EAAA,OAAWA,KAAK,CAACS,KAAN,IAAe,OAA1B;AAAA,CAb0B,CAA9B;AAiCA,IAAMC,sBAAsB,GAAGZ,MAAM,CAACS,wBAAD,CAAT,oPACnB,UAACP,KAAD;EAAA,OAAWA,KAAK,CAACS,KAAN,IAAe,OAA1B;AAAA,CADmB,CAA5B;AA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M,IAAI,GAAd,EAAmB;IACjBC,UAAU,GAAGrC,UAAU,CAACG,EAAxB;;;EAEF,IAAIiC,MAAM,IAAI,GAAd,EAAmB;IACjBC,UAAU,GAAGrC,UAAU,CAACI,EAAxB;;;EAEF,IAAIgC,MAAM,IAAI,IAAd,EAAoB;IAClBC,UAAU,GAAGrC,UAAU,CAACK,EAAxB;;;EAEF,IAAI+B,MAAM,IAAI,IAAd,EAAoB;IAClBC,UAAU,GAAGrC,UAAU,CAACM,GAAxB;;;EAGF,OAAO+B,UAAP;AACD,CAvBD;;AAyBA,SAASC,WAAT,GAAuB;EACrB,IAAMV,UAAU,GAAGR,aAAa,EAAhC;;EACA,gBAA4BG,cAAQ,CAACvB,UAAU,CAACG,EAAZ,CAApC;MAAOoC,MAAP;MAAeC,SAAf;;EAEAV,eAAS,CAAC,YAAM;IACdU,SAAS,CAACL,aAAa,CAACP,UAAD,CAAd,CAAT;GADO,EAEN,CAACA,UAAD,CAFM,CAAT;EAGA,OAAOW,MAAP;AACD;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/components/CartDrawer/cartDrawer.styles.js","../src/components/CartDrawer/CartDrawerCard/CartDrawerProduct.styles.js","../src/components/CartDrawer/CartDrawerCard/CartDrawerCard.jsx","../src/components/CartDrawer/CartDrawer.jsx","../src/components/CartPage/CartSummary/CartSummary.styles.js","../src/components/CartPage/CartSummary/index.jsx","../src/components/CartPage/ProductCard/Card.styles.js","../src/components/CartPage/ProductCard/CartPageCard.jsx","../src/components/CartPage/index.jsx","../src/constants/Breakpoint.js","../src/constants/Variant.js","../src/utils/debounce.js","../src/hooks/useWindowSize.jsx","../src/hooks/useGridSize.jsx"],"sourcesContent":["import styled from 'styled-components';\nexport const CartDrawerContainer = styled.div`\n width: 100%;\n max-width: ${(props) => props.maxWidth || '650px'};\n height: 100%;\n font-family: ${(props) => props.fontFamily};\n /* padding: 1em;\n padding-top: 0rem; */\n position: relative;\n /* min-width: 100%; */\n min-height: 100vh;\n max-height: 100vh;\n overflow-y: auto;\n /* background-color: grey; */\n /* border: 1px solid; */\n`;\n\nexport const CartDrawerBar = styled.div`\n width: 100%;\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n position: sticky;\n box-sizing: border-box;\n top: 0;\n left: -1em;\n padding: 1em;\n height: 4.6rem;\n font-size: 1.6rem;\n background-color: white;\n font-weight: bold;\n padding-left: 1rem;\n z-index: 2;\n .icon {\n cursor: pointer;\n font-size: 22px;\n }\n @media only screen and (max-width: 640px) {\n font-size: 1.2rem;\n height: 4rem;\n }\n`;\n\nexport const CartDrawerProductContainer = styled.div`\n width: 100%;\n height: max-content;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: flex-start;\n position: relative;\n /* height: 900px; */\n padding: 1rem;\n min-height: 74vh;\n opacity: ${(props) => props.opacity};\n @media only screen and (max-width: 748px) {\n min-height: 75vh;\n }\n /* background-color: red; */\n`;\n\nexport const CartDrawerBottomSection = styled.div`\n width: 100%;\n /* height: 8rem; */\n background-color: white;\n box-shadow: 3px -2px 10px #b1b1b1;\n display: flex;\n flex-direction: column;\n min-height: 7rem;\n position: sticky;\n bottom: 0;\n /* padding-bottom: 0.5rem; */\n\n /* left: 0; */\n align-items: center;\n .row {\n width: 100%;\n padding: 0rem 1rem;\n padding-top: 1rem;\n /* padding-left: 1rem; */\n h5 {\n font-weight: bold;\n font-size: 1.1rem;\n span {\n font-weight: 400;\n padding-left: 0.5rem;\n }\n }\n }\n @media only screen and (max-width: 340px) {\n min-height: 6rem;\n .row h5 {\n font-size: 0.8rem;\n }\n }\n`;\n\nexport const CartDrawerOutlinedButton = styled.button`\n width: 90%;\n height: 3.55rem;\n border: 2px solid;\n border-radius: 1rem;\n display: grid;\n place-items: center;\n font-weight: 500;\n font-size: 1rem;\n transition: 0.5s;\n outline: none;\n text-transform: capitalize;\n border-color: ${(props) => props.color || 'black'};\n color: ${(props) => props.color || 'black'};\n text-transform: capitalize;\n margin: 0.6rem 0;\n cursor: pointer;\n background: white;\n &:hover,\n &:focus {\n opacity: 0.8;\n letter-spacing: 1px;\n outline: none;\n }\n @media only screen and (max-width: 640px) {\n height: 2.9rem;\n }\n @media only screen and (max-width: 340px) {\n height: 2.2rem;\n margin: 0.3rem 0;\n }\n`;\n\nexport const CartDrawerFilledButton = styled(CartDrawerOutlinedButton)`\n background: ${(props) => props.color || 'black'};\n color: white;\n position: relative;\n margin-bottom: 1rem;\n .icon {\n position: absolute;\n right: 2rem;\n margin: auto 0;\n }\n`;\n\nexport const CartDrawerEmptyCart = styled.div`\n width: 100%;\n height: calc(100vh - 4.6rem);\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n h6 {\n font-size: 1.8rem;\n font-weight: bold;\n text-transform: uppercase;\n margin: 0;\n margin-top: 1rem;\n color: ${(props) => props.color || 'red'};\n }\n p {\n font-size: 1.1rem;\n text-transform: capitalize;\n font-weight: 500;\n /* color: darkgrey; */\n /* color: orange; */\n }\n .icon {\n font-size: 9.5rem;\n color: darkgrey;\n /* color: orange; */\n }\n`;\n","import styled from 'styled-components';\nexport const CartDrawerProduct = styled.div`\n width: 100%;\n display: flex;\n flex-direction: row;\n height: 100px;\n justify-content: space-around;\n align-items: center;\n overflow: hidden;\n margin-bottom: 2rem;\n img {\n width: 20%;\n max-height: 100%;\n /* aspect-ratio: 1; */\n object-fit: cover;\n }\n .middleSection {\n width: 60%;\n padding-left: 0.8rem;\n height: 100%;\n h6 {\n font-size: 1.1rem;\n font-weight: bold;\n margin: 0;\n\n span {\n font-size: 0.8rem;\n color: grey;\n text-decoration: line-through;\n margin-right: 0.5rem;\n }\n }\n .name {\n font-size: 0.9rem;\n line-height: 1.2rem;\n max-height: 2.45rem;\n width: 100%;\n word-wrap: break-word;\n overflow: hidden;\n text-overflow: ellipsis;\n transition: 0.3s;\n cursor: pointer;\n &:hover {\n color: ${(props) => props.color || 'grey'};\n }\n }\n }\n .endSection {\n width: 20%;\n height: 100%;\n .icon {\n cursor: pointer;\n transition: 0.4s;\n &:hover {\n color: red;\n /* opacity: 0.7; */\n }\n }\n }\n @media only screen and (max-width: 340px) {\n height: 80px;\n .middleSection {\n h6 {\n font-size: 0.9rem;\n }\n .name {\n font-size: 0.7rem;\n height: 1.45rem;\n }\n }\n }\n`;\n\nexport const CartDrawerQtBox = styled.div`\n height: 34px;\n width: 82px;\n border: 1px solid rgb(211, 210, 210);\n display: flex;\n align-items: center;\n justify-content: space-between;\n font-size: 13.5px;\n color: #333;\n padding: 0 0.5rem;\n border-radius: 5px;\n max-width: 100%;\n\n span {\n cursor: pointer;\n height: 100%;\n display: grid;\n place-items: center;\n }\n .qt {\n font-size: 12px;\n color: black;\n font-weight: 500;\n cursor: auto;\n }\n @media only screen and (max-width: 640px) {\n min-width: 55px;\n aspect-ratio: 1/2;\n /* min-height: 28px; */\n font-size: 10px;\n }\n @media only screen and (max-width: 340px) {\n min-width: 50px;\n aspect-ratio: 1/2;\n height: 22px;\n font-size: 8px;\n }\n`;\nexport const CartDrawerLoader = styled.div`\n position: absolute;\n top: 30%;\n width: 100px;\n height: 100px;\n display: grid;\n place-items: center;\n`;\n","import React from 'react';\nimport { Stack, Tooltip } from '@mui/material';\nimport { RiDeleteBin5Line } from 'react-icons/ri';\nimport { AiOutlinePlus, AiOutlineMinus } from 'react-icons/ai';\n// import imgnotfound from '../../../assets/imgnotfound.jpeg';\n////////\nimport { CartDrawerProduct, CartDrawerQtBox } from './CartDrawerProduct.styles';\nconst CartDrawerProductCard = ({\n product,\n color,\n handleIncrementDecrement,\n handleRemoveProduct,\n handleRedirect,\n imgnotfoundUrl,\n loading,\n}) => {\n let imgnotfoundUrlcommon = '/images/imgnotfound.jpeg';\n if (imgnotfoundUrl && imgnotfoundUrl !== 'null')\n imgnotfoundUrlcommon = imgnotfoundUrl;\n\n return (\n <CartDrawerProduct color={color}>\n <img\n src={\n product.imageUrl && product.imageUrl !== 'null'\n ? product.imageUrl\n : imgnotfoundUrlcommon\n }\n alt={'no product image available'}\n />\n <Stack\n flexDirection=\"column\"\n justifyContent=\"space-between\"\n alignItems=\"flex-start\"\n className=\"middleSection\"\n >\n <Tooltip title={product?.productName} placement=\"top\" arrow>\n <h6 className=\"name\" onClick={() => handleRedirect(product)}>\n {product?.productName}\n </h6>\n </Tooltip>\n\n <h6>\n {product?.standardPrice === product?.cartStandardPrice ? (\n `$${product?.standardPrice}`\n ) : (\n <React.Fragment>\n <span>${product?.cartStandardPrice?.toFixed(2)}</span>$\n {product?.standardPrice?.toFixed(2)}\n </React.Fragment>\n )}\n </h6>\n </Stack>\n <Stack\n flexDirection=\"column\"\n justifyContent=\"space-between\"\n alignItems=\"flex-end\"\n className=\"endSection\"\n >\n <RiDeleteBin5Line\n className=\"icon\"\n onClick={() => {\n if (loading) return;\n handleRemoveProduct(product);\n }}\n />\n <CartDrawerQtBox>\n <span\n onClick={() => {\n if (loading) return;\n handleIncrementDecrement('decrement', product);\n }}\n >\n {' '}\n <AiOutlineMinus />\n </span>{' '}\n <span className={'qt'}>{product?.quantity}</span>\n <span\n onClick={() => {\n if (loading) return;\n handleIncrementDecrement('increment', product);\n }}\n >\n <AiOutlinePlus />\n </span>\n </CartDrawerQtBox>\n </Stack>\n </CartDrawerProduct>\n );\n};\n\nexport default CartDrawerProductCard;\n","import { Stack } from '@mui/material';\nimport React from 'react';\nimport { GrClose } from 'react-icons/gr';\nimport { GiShoppingCart } from 'react-icons/gi';\nimport { BsCartX } from 'react-icons/bs';\n//////\nimport {\n CartDrawerBar,\n CartDrawerBottomSection,\n CartDrawerContainer,\n CartDrawerOutlinedButton,\n CartDrawerFilledButton,\n CartDrawerProductContainer,\n CartDrawerEmptyCart,\n} from './cartDrawer.styles';\nimport CartDrawerProductCard from './CartDrawerCard/CartDrawerCard';\nimport { CartDrawerLoader } from './CartDrawerCard/CartDrawerProduct.styles';\nimport { PuffLoader } from 'react-spinners';\n\nconst CartDrawer = ({\n cartData,\n maxWidth,\n color,\n handleRedirect,\n handleIncrementDecrement,\n handleRemoveProduct,\n handleClose,\n loading,\n imgnotfoundUrl,\n}) => {\n return (\n <React.Fragment>\n <CartDrawerContainer maxWidth={maxWidth}>\n <CartDrawerBar>\n <h2>Your Cart</h2>\n <GrClose\n className=\"icon\"\n onClick={() => {\n handleClose();\n }}\n />\n </CartDrawerBar>\n {cartData && cartData?.totalCartQuantity > 0 ? (\n <CartDrawerProductContainer opacity={loading ? '.4' : '1'}>\n {cartData?.cartLineItemDtoList?.map((product, i) => (\n <React.Fragment>\n {loading && (\n <CartDrawerLoader>\n <PuffLoader color=\"black\" />\n </CartDrawerLoader>\n )}\n\n <CartDrawerProductCard\n product={product}\n handleRedirect={handleRedirect}\n handleIncrementDecrement={handleIncrementDecrement}\n handleRemoveProduct={handleRemoveProduct}\n color={color}\n key={i}\n imgnotfoundUrl={imgnotfoundUrl}\n loading={loading}\n />\n </React.Fragment>\n ))}\n </CartDrawerProductContainer>\n ) : (\n <CartDrawerEmptyCart color={color}>\n <BsCartX className=\"icon\" />\n <h6>OOps!</h6>\n <p>your cart is empty</p>\n </CartDrawerEmptyCart>\n )}\n {cartData && cartData?.totalCartQuantity > 0 && (\n <CartDrawerBottomSection>\n <Stack\n flexDirection=\"row\"\n justifyContent=\"space-between\"\n alignItems=\"center\"\n className=\"row\"\n >\n <h5>\n Subtotal<span>({cartData?.totalCartQuantity} items)</span>\n </h5>\n <h5>${cartData?.totalCartPrice?.toFixed(2)}</h5>\n </Stack>\n <CartDrawerOutlinedButton\n color={color}\n onClick={() => handleRedirect('cart')}\n >\n view cart\n </CartDrawerOutlinedButton>\n <CartDrawerFilledButton\n color={color}\n onClick={() => handleRedirect('checkout')}\n >\n continue to checkout\n </CartDrawerFilledButton>\n </CartDrawerBottomSection>\n )}\n </CartDrawerContainer>\n </React.Fragment>\n );\n};\n\nexport default CartDrawer;\n","import styled from 'styled-components';\n\nexport const CartSummaryContainer = styled.div`\n width: min(95%, 24.75em);\n max-width: ${(props) => props.maxWidth || '24.75em'};\n display: flex;\n flex-direction: column;\n background: ${(props) => props.background || '#667080'};\n color: ${(props) => props.color || 'white'};\n border-radius: 25px;\n padding: 2em 1em;\n align-items: center;\n p {\n font-size: 0.89em;\n font-weight: 300;\n align-self: flex-start;\n color: inherit;\n margin: 0;\n padding: 0;\n }\n .continueShopping {\n font-size: 0.75em;\n color: inherit;\n text-transform: capitalize;\n height: 20px;\n border-bottom: 1px solid;\n border-color: ${(props) => props.color || 'white'};\n font-weight: 300;\n cursor: pointer;\n }\n`;\nexport const CartSummaryRow = styled.div`\n width: 100%;\n display: flex;\n flex-direction: row;\n justify-content: ${(props) => props.justify || 'space-between'};\n align-items: center;\n color: inherit;\n h6,\n h5 {\n margin: 0;\n font-size: 1em;\n font-weight: 700;\n color: inherit;\n text-transform: capitalize;\n }\n h5 {\n font-size: ${(props) => props.h5 || '1.31em'};\n }\n`;\nexport const CartSummaryHr = styled.hr`\n border: none;\n width: 100%;\n height: 1px;\n background-color: ${(props) => props.color || 'rgba(255, 255, 255, 0.5)'};\n margin: 1em 0;\n`;\n\nexport const CartSummaryInputBox = styled.form`\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n padding-bottom: ${(props) => (props.paddingBottom ? '2em' : '0')};\n input {\n width: 10.81rem;\n height: 2.44rem;\n padding: 0.2em 0.8em;\n text-transform: capitalize;\n font-size: 0.89em;\n border-radius: 1.19rem;\n margin-right: 1em;\n border: none;\n outline: none;\n background: ${(props) => props.background || '#bfc3ca'};\n color: ${(props) => props.color || '#667080'};\n &::placeholder {\n color: ${(props) => props.color || '#667080'};\n }\n }\n button {\n width: 7.75rem;\n height: 2.44rem;\n background: ${(props) => props.btn || '#393f48'};\n border-radius: 1.19rem;\n display: grid;\n color: inherit;\n place-items: center;\n border: none;\n outline: none;\n text-transform: uppercase;\n cursor: pointer;\n font-size: 0.75em;\n transition: 0.3s;\n &:hover {\n letter-spacing: 1px;\n }\n }\n`;\nexport const CartSummaryCheckoutBtn = styled.button`\n font-size: 0.95em;\n font-weight: 700;\n background: #393f48;\n cursor: pointer;\n text-transform: uppercase;\n color: inherit;\n border: none;\n outline: none;\n width: 16.81em;\n height: 3.75em;\n display: grid;\n place-items: center;\n font-size: 0.75em;\n border-radius: 2.64em;\n padding: 0;\n font-size: 0.94em;\n margin: 1em auto;\n transition: 0.3s;\n margin-top: 2em;\n &:hover {\n opacity: 0.8;\n }\n`;\n\nexport const CartSummaryCheckBoxRow = styled(CartSummaryRow)`\n justify-content: flex-start;\n margin-left: 1em;\n margin-top: 1em;\n cursor: pointer;\n .checkBox {\n width: 0.63em;\n height: 0.63em;\n border: 1px solid;\n border-color: ${(props) => props.background || 'white'};\n background: transparent;\n margin-right: 0.5em;\n border-radius: 50%;\n background: ${(props) =>\n props.selected ? props.background : 'transparent'};\n }\n p {\n font-size: 1em;\n font-weight: 6 400;\n span {\n font-weight: 600;\n margin: 0 0.1em;\n }\n }\n`;\n","import { Stack } from '@mui/material';\nimport React, { useState } from 'react';\n\nimport {\n CartSummaryCheckBoxRow,\n CartSummaryCheckoutBtn,\n CartSummaryContainer,\n CartSummaryHr,\n CartSummaryInputBox,\n CartSummaryRow,\n} from './CartSummary.styles';\n\nconst CartSummary = ({\n retail = true,\n shippingData,\n selectedShipping,\n setShipping,\n clickRedirect,\n subtotal,\n styles,\n}) => {\n console.log(selectedShipping);\n return (\n <CartSummaryContainer background={styles?.bg} color={styles?.color}>\n <p>Cart summary</p>\n <CartSummaryHr color={styles?.hr} />\n <CartSummaryRow>\n <h6>subtotal</h6>\n <h5>${subtotal?.toFixed(2)}</h5>\n </CartSummaryRow>\n <CartSummaryHr color={styles?.hr} />\n <CartSummaryRow>\n <h6>Discount</h6>\n <h5>$0.00</h5>\n </CartSummaryRow>\n <CartSummaryHr color={styles?.hr} />\n {retail && (\n <Stack\n flexDirection=\"column\"\n justifyContent=\"flexStart\"\n sx={{ width: '100%' }}\n >\n <CartSummaryRow justify=\"flex-start\">\n <h6>shipping</h6>\n </CartSummaryRow>\n {shippingData.map((li, i) => (\n <CartSummaryCheckBoxRow\n key={i}\n selected={li.id === selectedShipping.id}\n onClick={() => {\n setShipping(li);\n }}\n background={styles.color}\n >\n <span className=\"checkBox\"></span>\n <p>\n {li.name}{' '}\n {li.amount && li.amount > 0 && (\n <span>: ${li.amount?.toFixed(2)}</span>\n )}\n </p>\n </CartSummaryCheckBoxRow>\n ))}\n <CartSummaryHr color={styles?.hr} />\n </Stack>\n )}\n <CartSummaryInputBox\n paddingBottom={!retail}\n background={styles?.input?.bg}\n color={styles?.input?.color}\n btn={styles?.btnColor}\n >\n <input placeholder=\"Coupon code\" type=\"email\" required />\n <button>apply coupon</button>\n </CartSummaryInputBox>\n\n <CartSummaryHr color={styles?.hr} />\n <CartSummaryRow h5=\"1.64em\">\n <h6>total</h6>\n <h5>${(subtotal + selectedShipping?.amount)?.toFixed(2)}</h5>\n </CartSummaryRow>\n <CartSummaryRow justify=\"center\">\n <CartSummaryCheckoutBtn\n onClick={() => clickRedirect('/checkout')}\n background={styles?.btnColor}\n >\n proceed to checkokut\n </CartSummaryCheckoutBtn>\n </CartSummaryRow>\n <CartSummaryRow justify=\"center\">\n <span className=\"continueShopping\" onClick={() => clickRedirect('/')}>\n Continue to shopping\n </span>\n </CartSummaryRow>\n </CartSummaryContainer>\n );\n};\n\nexport default CartSummary;\n","import styled from 'styled-components';\n\n// export const CartTableHeader = styled.div`\n// width: 100%;\n// display: flex;\n// flex-direction: row;\n// align-items: center;\n// background-color: red;\n// min-height: 80px;\n// position: sticky;\n// top: 0;\n// right: 0;\n// z-index: 1;\n// `;\n\nexport const CartPageCard = styled.div`\n width: min(97%, 485px);\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n padding: 1rem;\n background: #ffffff;\n box-shadow: 0px 20px 35px rgba(0, 0, 0, 0.05);\n border-radius: 20px;\n position: relative;\n`;\n\nexport const CartPageImg = styled.img`\n /* width: 95px; */\n width: ${(props) => props.width || 'auto'};\n height: ${(props) => props.height || '81px'};\n position: relative;\n margin-right: 1em;\n`;\nexport const NameAndQtBox = styled.div`\n width: 90%;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: space-between;\n position: relative;\n`;\nexport const CartPageCardName = styled.div`\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n align-items: flex-start;\n width: 90%;\n overflow: hidden;\n text-overflow: ellipsis;\n margin-bottom: 0.6em;\n h6 {\n color: #323232;\n font-size: 0.9em;\n margin-bottom: 0.6em;\n line-height: 1.3rem;\n max-height: 1.4rem;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n p {\n font-size: 1.1em;\n color: #c3c6c9;\n }\n`;\n\nexport const QtAndPriceBox = styled.div`\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n width: 100%;\n .subtotal {\n color: #323232;\n text-transform: capitalize;\n font-weight: bold;\n font-size: 0.85em;\n }\n`;\n\nexport const CartPageQtBox = styled.div`\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n max-width: 80px;\n min-width: 80px;\n height: 22px;\n .icon {\n width: 20.5px;\n height: 20.5px;\n display: grid;\n place-items: center;\n font-size: 10px;\n background: #eef1f4;\n cursor: pointer;\n }\n .qt {\n font-size: 18px;\n font-weight: 500;\n display: grid;\n place-items: center;\n color: #c3c6c9;\n }\n`;\n\nexport const CloseBtn = styled.div`\n width: 25px;\n height: 25px;\n display: grid;\n place-items: center;\n position: absolute;\n top: 1em;\n right: 1em;\n cursor: pointer;\n border-radius: 50%;\n background: #eef1f4;\n font-size: 12px;\n`;\n","import { Tooltip } from '@mui/material';\nimport React from 'react';\nimport { AiOutlineMinus, AiOutlinePlus, AiOutlineClose } from 'react-icons/ai';\nimport {\n CartPageCard,\n CartPageCardName,\n CartPageImg,\n CartPageQtBox,\n CloseBtn,\n NameAndQtBox,\n QtAndPriceBox,\n} from './Card.styles';\n\nconst CartPageProductCard = ({\n item,\n imgnotfoundUrl,\n handleIncrementDecrement,\n handleRemoveProduct,\n loading,\n imgSize,\n}) => {\n let imgnotfoundUrlcommon = '/images/imgnotfound.jpeg';\n if (imgnotfoundUrl && imgnotfoundUrl !== 'null')\n imgnotfoundUrlcommon = imgnotfoundUrl;\n\n return (\n <CartPageCard>\n <CartPageImg\n src={\n item.imageUrl && item.imageUrl !== 'null'\n ? item.imageUrl\n : imgnotfoundUrlcommon\n }\n alt={'no product image available'}\n width={imgSize?.width}\n height={imgSize?.height}\n />\n <NameAndQtBox>\n <CartPageCardName>\n <Tooltip title={item.productName} placement=\"top\" arrow>\n <h6>{item.productName}</h6>\n </Tooltip>\n <p>${item.standardPrice?.toFixed(2)}</p>\n </CartPageCardName>\n <QtAndPriceBox>\n <CartPageQtBox>\n <span\n className=\"icon\"\n onClick={() => {\n if (loading) return;\n handleIncrementDecrement('decrement', item);\n }}\n >\n <AiOutlineMinus />\n </span>\n <span className=\"qt\">{item.quantity}</span>\n <span\n className=\"icon\"\n onClick={() => {\n if (loading) return;\n handleIncrementDecrement('increment', item);\n }}\n >\n <AiOutlinePlus />\n </span>\n </CartPageQtBox>\n <p className=\"subtotal\">\n subtotal: ${(item.standardPrice * item.quantity).toFixed(2)}\n </p>\n </QtAndPriceBox>\n </NameAndQtBox>\n <CloseBtn\n onClick={() => {\n if (loading) return;\n handleRemoveProduct(item);\n }}\n >\n <AiOutlineClose />\n </CloseBtn>\n </CartPageCard>\n );\n};\n\nexport default CartPageProductCard;\n","import React from 'react';\nimport styled from 'styled-components';\nimport CartSummary from './CartSummary';\nimport { CartHeader, CartTableHeader } from './ProductCard/Card.styles';\nimport CartPageProductCard from './ProductCard/CartPageCard';\nexport const CartPageContainer = styled.div`\n width: 100%;\n max-width: ${(props) => props.maxWidth || '1350px'};\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: flex-start;\n\n .scrollDiv {\n width: 68%;\n height: 630px;\n max-height: 630px;\n background-color: white;\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n margin-right: 0.3em;\n &::-webkit-scrollbar {\n width: ${(props) => (props.retail ? '12px' : '8px')};\n }\n\n /* Track */\n &::-webkit-scrollbar-track {\n background: ${(props) =>\n props.retail ? '#667080' : 'rgba(102, 112, 128, 0.5)'};\n border-radius: 16px;\n }\n\n /* Handle */\n &::-webkit-scrollbar-thumb {\n background: ${(props) => (props.retail ? '#BFC3CA' : '#EDEDED')};\n border-radius: 16px;\n margin: 5px 2px;\n border: 3px solid;\n border-color: ${(props) =>\n props.retail ? '#667080' : 'rgba(102, 112, 128, 0.5)'};\n }\n box-shadow: 0px 20px 35px rgba(0, 0, 0, 0.05);\n }\n @media only screen and (max-width: 840px) {\n flex-direction: column;\n .scrollDiv {\n width: 100%;\n margin: 0;\n margin-bottom: 2em;\n padding: 0 0.4em;\n }\n }\n`;\nconst CardsBox = styled.div`\n width: 100%;\n /* min-height: 1000px; */\n position: relative;\n max-width: 860px;\n margin-right: auto;\n padding: 1em 2em;\n display: ${(props) => (props.retail ? 'grid' : 'flex')};\n grid-template-columns: 1fr 1fr;\n flex-direction: column;\n align-items: flex-start;\n grid-gap: 1em;\n justify-content: flex-start;\n align-items: center;\n border-radius: 20px;\n @media only screen and (max-width: 1220px) {\n display: flex;\n }\n @media only screen and (max-width: 640px) {\n padding: 1em 0.2em;\n }\n`;\nconst CartPageComponent = ({\n retail,\n shippingData,\n selectedShipping,\n setShipping,\n clickRedirect,\n cartData,\n handleIncrementDecrement,\n handleRemoveProduct,\n loading,\n imgnotfoundUrl,\n styles\n}) => {\n return (\n <CartPageContainer retail={retail}>\n <div className=\"scrollDiv\">\n {/* <CartTableHeader> div</CartTableHeader> */}\n <CardsBox retail={retail}>\n {cartData?.cartLineItemDtoList?.map((item) => (\n <CartPageProductCard\n item={item}\n loading={loading}\n imgnotfoundUrl={imgnotfoundUrl}\n handleIncrementDecrement={handleIncrementDecrement}\n handleRemoveProduct={handleRemoveProduct}\n imgSize={styles?.imgSize}\n />\n ))}\n </CardsBox>\n </div>\n <CartSummary\n retail={retail}\n shippingData={shippingData}\n selectedShipping={selectedShipping}\n setShipping={setShipping}\n clickRedirect={clickRedirect}\n subtotal={cartData?.totalCartPrice}\n styles={styles?.cartSummary}\n />\n </CartPageContainer>\n );\n};\n\nexport default CartPageComponent;\n","class Breakpoint {\n static xs = 'xs';\n static sm = 'sm';\n static md = 'md';\n static lg = 'lg';\n static xl = 'xl';\n static xxl = 'xxl';\n}\n\nexport default Breakpoint;\n","class Variant {\n static ONE = 'one';\n static TWO = 'two';\n static THREE = 'three';\n}\n\nexport default Variant;\n","export default function debounce(func, wait, immediate) {\n let timeout;\n return function (...args) {\n clearTimeout(timeout);\n timeout = setTimeout(() => {\n timeout = null;\n if (!immediate) func.apply(this, args);\n }, wait);\n if (immediate && !timeout) func.apply(this, [...args]);\n };\n}\n","import { useEffect, useState } from 'react';\nimport debounce from '../utils/debounce';\n\nfunction useWindowSize() {\n const isWindow = typeof window !== 'undefined';\n const [windowSize, setWindowSize] = useState({\n width: isWindow ? window.innerWidth : 1200,\n height: isWindow ? window.innerHeight : 800,\n });\n\n useEffect(() => {\n const onWindowResize = () => {\n setWindowSize({\n width: window.innerWidth,\n height: window.innerHeight,\n });\n };\n\n const onResize = debounce(onWindowResize, 100);\n\n window.addEventListener('resize', onResize);\n onWindowResize();\n\n return () => {\n window.removeEventListener('resize', onResize);\n };\n }, []);\n\n return windowSize;\n}\n\nexport default useWindowSize;\n","import { useEffect, useState } from 'react';\nimport useWindowSize from './useWindowSize';\nimport { Breakpoint } from '../constants';\n\n/*\n The breakpoints of responsive grid follow Google chrome media queries rules\n*/\nconst getBreakpoint = ({ width: screen }) => {\n let breakpoint = '';\n\n if (screen <= 320) {\n breakpoint = Breakpoint.xs;\n }\n if (screen >= 375) {\n breakpoint = Breakpoint.sm;\n }\n if (screen >= 768) {\n breakpoint = Breakpoint.md;\n }\n if (screen >= 992) {\n breakpoint = Breakpoint.lg;\n }\n if (screen >= 1200) {\n breakpoint = Breakpoint.xl;\n }\n if (screen >= 1600) {\n breakpoint = Breakpoint.xxl;\n }\n\n return breakpoint;\n};\n\nfunction useGridSize() {\n const windowSize = useWindowSize();\n const [layout, setLayout] = useState(Breakpoint.md);\n\n useEffect(() => {\n setLayout(getBreakpoint(windowSize));\n }, [windowSize]);\n return layout;\n}\n\nexport default useGridSize;\n"],"names":["CartDrawerContainer","styled","div","props","maxWidth","fontFamily","CartDrawerBar","CartDrawerProductContainer","opacity","CartDrawerBottomSection","CartDrawerOutlinedButton","button","color","CartDrawerFilledButton","CartDrawerEmptyCart","CartDrawerProduct","CartDrawerQtBox","CartDrawerLoader","CartDrawerProductCard","product","handleIncrementDecrement","handleRemoveProduct","handleRedirect","imgnotfoundUrl","loading","imgnotfoundUrlcommon","React","imageUrl","Stack","Tooltip","productName","standardPrice","cartStandardPrice","toFixed","RiDeleteBin5Line","AiOutlineMinus","quantity","AiOutlinePlus","CartDrawer","cartData","handleClose","GrClose","totalCartQuantity","cartLineItemDtoList","map","i","PuffLoader","BsCartX","totalCartPrice","CartSummaryContainer","background","CartSummaryRow","justify","h5","CartSummaryHr","hr","CartSummaryInputBox","form","paddingBottom","btn","CartSummaryCheckoutBtn","CartSummaryCheckBoxRow","selected","CartSummary","retail","shippingData","selectedShipping","setShipping","clickRedirect","subtotal","styles","console","log","bg","width","li","id","name","amount","input","btnColor","CartPageCard","CartPageImg","img","height","NameAndQtBox","CartPageCardName","QtAndPriceBox","CartPageQtBox","CloseBtn","CartPageProductCard","item","imgSize","AiOutlineClose","CartPageContainer","CardsBox","CartPageComponent","cartSummary","Breakpoint","xs","sm","md","lg","xl","xxl","Variant","ONE","TWO","THREE","debounce","func","wait","immediate","timeout","args","clearTimeout","setTimeout","apply","useWindowSize","isWindow","window","useState","innerWidth","innerHeight","windowSize","setWindowSize","useEffect","onWindowResize","onResize","addEventListener","removeEventListener","getBreakpoint","screen","breakpoint","useGridSize","layout","setLayout"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AACO,IAAMA,mBAAmB,GAAGC,MAAM,CAACC,GAAV,oXAEjB,UAACC,KAAD;EAAA,OAAWA,KAAK,CAACC,QAAN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styled from 'styled-components';
|
|
7
7
|
import { RiDeleteBin5Line } from 'react-icons/ri';
|
|
8
|
-
import { AiOutlineMinus, AiOutlinePlus } from 'react-icons/ai';
|
|
8
|
+
import { AiOutlineMinus, AiOutlinePlus, AiOutlineClose } from 'react-icons/ai';
|
|
9
9
|
import { PuffLoader } from 'react-spinners';
|
|
10
10
|
|
|
11
11
|
function _taggedTemplateLiteralLoose(strings, raw) {
|
|
@@ -160,6 +160,229 @@ var CartDrawer = function CartDrawer(_ref) {
|
|
|
160
160
|
}, "continue to checkout"))));
|
|
161
161
|
};
|
|
162
162
|
|
|
163
|
+
var _templateObject$2, _templateObject2$2, _templateObject3$2, _templateObject4$1, _templateObject5$1, _templateObject6$1;
|
|
164
|
+
var CartSummaryContainer = styled.div(_templateObject$2 || (_templateObject$2 = _taggedTemplateLiteralLoose(["\n width: min(95%, 24.75em);\n max-width: ", ";\n display: flex;\n flex-direction: column;\n background: ", ";\n color: ", ";\n border-radius: 25px;\n padding: 2em 1em;\n align-items: center;\n p {\n font-size: 0.89em;\n font-weight: 300;\n align-self: flex-start;\n color: inherit;\n margin: 0;\n padding: 0;\n }\n .continueShopping {\n font-size: 0.75em;\n color: inherit;\n text-transform: capitalize;\n height: 20px;\n border-bottom: 1px solid;\n border-color: ", ";\n font-weight: 300;\n cursor: pointer;\n }\n"])), function (props) {
|
|
165
|
+
return props.maxWidth || '24.75em';
|
|
166
|
+
}, function (props) {
|
|
167
|
+
return props.background || '#667080';
|
|
168
|
+
}, function (props) {
|
|
169
|
+
return props.color || 'white';
|
|
170
|
+
}, function (props) {
|
|
171
|
+
return props.color || 'white';
|
|
172
|
+
});
|
|
173
|
+
var CartSummaryRow = styled.div(_templateObject2$2 || (_templateObject2$2 = _taggedTemplateLiteralLoose(["\n width: 100%;\n display: flex;\n flex-direction: row;\n justify-content: ", ";\n align-items: center;\n color: inherit;\n h6,\n h5 {\n margin: 0;\n font-size: 1em;\n font-weight: 700;\n color: inherit;\n text-transform: capitalize;\n }\n h5 {\n font-size: ", ";\n }\n"])), function (props) {
|
|
174
|
+
return props.justify || 'space-between';
|
|
175
|
+
}, function (props) {
|
|
176
|
+
return props.h5 || '1.31em';
|
|
177
|
+
});
|
|
178
|
+
var CartSummaryHr = styled.hr(_templateObject3$2 || (_templateObject3$2 = _taggedTemplateLiteralLoose(["\n border: none;\n width: 100%;\n height: 1px;\n background-color: ", ";\n margin: 1em 0;\n"])), function (props) {
|
|
179
|
+
return props.color || 'rgba(255, 255, 255, 0.5)';
|
|
180
|
+
});
|
|
181
|
+
var CartSummaryInputBox = styled.form(_templateObject4$1 || (_templateObject4$1 = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n padding-bottom: ", ";\n input {\n width: 10.81rem;\n height: 2.44rem;\n padding: 0.2em 0.8em;\n text-transform: capitalize;\n font-size: 0.89em;\n border-radius: 1.19rem;\n margin-right: 1em;\n border: none;\n outline: none;\n background: ", ";\n color: ", ";\n &::placeholder {\n color: ", ";\n }\n }\n button {\n width: 7.75rem;\n height: 2.44rem;\n background: ", ";\n border-radius: 1.19rem;\n display: grid;\n color: inherit;\n place-items: center;\n border: none;\n outline: none;\n text-transform: uppercase;\n cursor: pointer;\n font-size: 0.75em;\n transition: 0.3s;\n &:hover {\n letter-spacing: 1px;\n }\n }\n"])), function (props) {
|
|
182
|
+
return props.paddingBottom ? '2em' : '0';
|
|
183
|
+
}, function (props) {
|
|
184
|
+
return props.background || '#bfc3ca';
|
|
185
|
+
}, function (props) {
|
|
186
|
+
return props.color || '#667080';
|
|
187
|
+
}, function (props) {
|
|
188
|
+
return props.color || '#667080';
|
|
189
|
+
}, function (props) {
|
|
190
|
+
return props.btn || '#393f48';
|
|
191
|
+
});
|
|
192
|
+
var CartSummaryCheckoutBtn = styled.button(_templateObject5$1 || (_templateObject5$1 = _taggedTemplateLiteralLoose(["\n font-size: 0.95em;\n font-weight: 700;\n background: #393f48;\n cursor: pointer;\n text-transform: uppercase;\n color: inherit;\n border: none;\n outline: none;\n width: 16.81em;\n height: 3.75em;\n display: grid;\n place-items: center;\n font-size: 0.75em;\n border-radius: 2.64em;\n padding: 0;\n font-size: 0.94em;\n margin: 1em auto;\n transition: 0.3s;\n margin-top: 2em;\n &:hover {\n opacity: 0.8;\n }\n"])));
|
|
193
|
+
var CartSummaryCheckBoxRow = styled(CartSummaryRow)(_templateObject6$1 || (_templateObject6$1 = _taggedTemplateLiteralLoose(["\n justify-content: flex-start;\n margin-left: 1em;\n margin-top: 1em;\n cursor: pointer;\n .checkBox {\n width: 0.63em;\n height: 0.63em;\n border: 1px solid;\n border-color: ", ";\n background: transparent;\n margin-right: 0.5em;\n border-radius: 50%;\n background: ", ";\n }\n p {\n font-size: 1em;\n font-weight: 6 400;\n span {\n font-weight: 600;\n margin: 0 0.1em;\n }\n }\n"])), function (props) {
|
|
194
|
+
return props.background || 'white';
|
|
195
|
+
}, function (props) {
|
|
196
|
+
return props.selected ? props.background : 'transparent';
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
var CartSummary = function CartSummary(_ref) {
|
|
200
|
+
var _styles$input, _styles$input2, _ref2;
|
|
201
|
+
|
|
202
|
+
var _ref$retail = _ref.retail,
|
|
203
|
+
retail = _ref$retail === void 0 ? true : _ref$retail,
|
|
204
|
+
shippingData = _ref.shippingData,
|
|
205
|
+
selectedShipping = _ref.selectedShipping,
|
|
206
|
+
setShipping = _ref.setShipping,
|
|
207
|
+
clickRedirect = _ref.clickRedirect,
|
|
208
|
+
subtotal = _ref.subtotal,
|
|
209
|
+
styles = _ref.styles;
|
|
210
|
+
console.log(selectedShipping);
|
|
211
|
+
return /*#__PURE__*/React.createElement(CartSummaryContainer, {
|
|
212
|
+
background: styles === null || styles === void 0 ? void 0 : styles.bg,
|
|
213
|
+
color: styles === null || styles === void 0 ? void 0 : styles.color
|
|
214
|
+
}, /*#__PURE__*/React.createElement("p", null, "Cart summary"), /*#__PURE__*/React.createElement(CartSummaryHr, {
|
|
215
|
+
color: styles === null || styles === void 0 ? void 0 : styles.hr
|
|
216
|
+
}), /*#__PURE__*/React.createElement(CartSummaryRow, null, /*#__PURE__*/React.createElement("h6", null, "subtotal"), /*#__PURE__*/React.createElement("h5", null, "$", subtotal === null || subtotal === void 0 ? void 0 : subtotal.toFixed(2))), /*#__PURE__*/React.createElement(CartSummaryHr, {
|
|
217
|
+
color: styles === null || styles === void 0 ? void 0 : styles.hr
|
|
218
|
+
}), /*#__PURE__*/React.createElement(CartSummaryRow, null, /*#__PURE__*/React.createElement("h6", null, "Discount"), /*#__PURE__*/React.createElement("h5", null, "$0.00")), /*#__PURE__*/React.createElement(CartSummaryHr, {
|
|
219
|
+
color: styles === null || styles === void 0 ? void 0 : styles.hr
|
|
220
|
+
}), retail && /*#__PURE__*/React.createElement(Stack, {
|
|
221
|
+
flexDirection: "column",
|
|
222
|
+
justifyContent: "flexStart",
|
|
223
|
+
sx: {
|
|
224
|
+
width: '100%'
|
|
225
|
+
}
|
|
226
|
+
}, /*#__PURE__*/React.createElement(CartSummaryRow, {
|
|
227
|
+
justify: "flex-start"
|
|
228
|
+
}, /*#__PURE__*/React.createElement("h6", null, "shipping")), shippingData.map(function (li, i) {
|
|
229
|
+
var _li$amount;
|
|
230
|
+
|
|
231
|
+
return /*#__PURE__*/React.createElement(CartSummaryCheckBoxRow, {
|
|
232
|
+
key: i,
|
|
233
|
+
selected: li.id === selectedShipping.id,
|
|
234
|
+
onClick: function onClick() {
|
|
235
|
+
setShipping(li);
|
|
236
|
+
},
|
|
237
|
+
background: styles.color
|
|
238
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
239
|
+
className: "checkBox"
|
|
240
|
+
}), /*#__PURE__*/React.createElement("p", null, li.name, ' ', li.amount && li.amount > 0 && /*#__PURE__*/React.createElement("span", null, ": $", (_li$amount = li.amount) === null || _li$amount === void 0 ? void 0 : _li$amount.toFixed(2))));
|
|
241
|
+
}), /*#__PURE__*/React.createElement(CartSummaryHr, {
|
|
242
|
+
color: styles === null || styles === void 0 ? void 0 : styles.hr
|
|
243
|
+
})), /*#__PURE__*/React.createElement(CartSummaryInputBox, {
|
|
244
|
+
paddingBottom: !retail,
|
|
245
|
+
background: styles === null || styles === void 0 ? void 0 : (_styles$input = styles.input) === null || _styles$input === void 0 ? void 0 : _styles$input.bg,
|
|
246
|
+
color: styles === null || styles === void 0 ? void 0 : (_styles$input2 = styles.input) === null || _styles$input2 === void 0 ? void 0 : _styles$input2.color,
|
|
247
|
+
btn: styles === null || styles === void 0 ? void 0 : styles.btnColor
|
|
248
|
+
}, /*#__PURE__*/React.createElement("input", {
|
|
249
|
+
placeholder: "Coupon code",
|
|
250
|
+
type: "email",
|
|
251
|
+
required: true
|
|
252
|
+
}), /*#__PURE__*/React.createElement("button", null, "apply coupon")), /*#__PURE__*/React.createElement(CartSummaryHr, {
|
|
253
|
+
color: styles === null || styles === void 0 ? void 0 : styles.hr
|
|
254
|
+
}), /*#__PURE__*/React.createElement(CartSummaryRow, {
|
|
255
|
+
h5: "1.64em"
|
|
256
|
+
}, /*#__PURE__*/React.createElement("h6", null, "total"), /*#__PURE__*/React.createElement("h5", null, "$", (_ref2 = subtotal + (selectedShipping === null || selectedShipping === void 0 ? void 0 : selectedShipping.amount)) === null || _ref2 === void 0 ? void 0 : _ref2.toFixed(2))), /*#__PURE__*/React.createElement(CartSummaryRow, {
|
|
257
|
+
justify: "center"
|
|
258
|
+
}, /*#__PURE__*/React.createElement(CartSummaryCheckoutBtn, {
|
|
259
|
+
onClick: function onClick() {
|
|
260
|
+
return clickRedirect('/checkout');
|
|
261
|
+
},
|
|
262
|
+
background: styles === null || styles === void 0 ? void 0 : styles.btnColor
|
|
263
|
+
}, "proceed to checkokut")), /*#__PURE__*/React.createElement(CartSummaryRow, {
|
|
264
|
+
justify: "center"
|
|
265
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
266
|
+
className: "continueShopping",
|
|
267
|
+
onClick: function onClick() {
|
|
268
|
+
return clickRedirect('/');
|
|
269
|
+
}
|
|
270
|
+
}, "Continue to shopping")));
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
var _templateObject$3, _templateObject2$3, _templateObject3$3, _templateObject4$2, _templateObject5$2, _templateObject6$2, _templateObject7$1;
|
|
274
|
+
var CartPageCard = styled.div(_templateObject$3 || (_templateObject$3 = _taggedTemplateLiteralLoose(["\n width: min(97%, 485px);\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n padding: 1rem;\n background: #ffffff;\n box-shadow: 0px 20px 35px rgba(0, 0, 0, 0.05);\n border-radius: 20px;\n position: relative;\n"])));
|
|
275
|
+
var CartPageImg = styled.img(_templateObject2$3 || (_templateObject2$3 = _taggedTemplateLiteralLoose(["\n /* width: 95px; */\n width: ", ";\n height: ", ";\n position: relative;\n margin-right: 1em;\n"])), function (props) {
|
|
276
|
+
return props.width || 'auto';
|
|
277
|
+
}, function (props) {
|
|
278
|
+
return props.height || '81px';
|
|
279
|
+
});
|
|
280
|
+
var NameAndQtBox = styled.div(_templateObject3$3 || (_templateObject3$3 = _taggedTemplateLiteralLoose(["\n width: 90%;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: space-between;\n position: relative;\n"])));
|
|
281
|
+
var CartPageCardName = styled.div(_templateObject4$2 || (_templateObject4$2 = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n align-items: flex-start;\n width: 90%;\n overflow: hidden;\n text-overflow: ellipsis;\n margin-bottom: 0.6em;\n h6 {\n color: #323232;\n font-size: 0.9em;\n margin-bottom: 0.6em;\n line-height: 1.3rem;\n max-height: 1.4rem;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n p {\n font-size: 1.1em;\n color: #c3c6c9;\n }\n"])));
|
|
282
|
+
var QtAndPriceBox = styled.div(_templateObject5$2 || (_templateObject5$2 = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n width: 100%;\n .subtotal {\n color: #323232;\n text-transform: capitalize;\n font-weight: bold;\n font-size: 0.85em;\n }\n"])));
|
|
283
|
+
var CartPageQtBox = styled.div(_templateObject6$2 || (_templateObject6$2 = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n max-width: 80px;\n min-width: 80px;\n height: 22px;\n .icon {\n width: 20.5px;\n height: 20.5px;\n display: grid;\n place-items: center;\n font-size: 10px;\n background: #eef1f4;\n cursor: pointer;\n }\n .qt {\n font-size: 18px;\n font-weight: 500;\n display: grid;\n place-items: center;\n color: #c3c6c9;\n }\n"])));
|
|
284
|
+
var CloseBtn = styled.div(_templateObject7$1 || (_templateObject7$1 = _taggedTemplateLiteralLoose(["\n width: 25px;\n height: 25px;\n display: grid;\n place-items: center;\n position: absolute;\n top: 1em;\n right: 1em;\n cursor: pointer;\n border-radius: 50%;\n background: #eef1f4;\n font-size: 12px;\n"])));
|
|
285
|
+
|
|
286
|
+
var CartPageProductCard = function CartPageProductCard(_ref) {
|
|
287
|
+
var _item$standardPrice;
|
|
288
|
+
|
|
289
|
+
var item = _ref.item,
|
|
290
|
+
imgnotfoundUrl = _ref.imgnotfoundUrl,
|
|
291
|
+
handleIncrementDecrement = _ref.handleIncrementDecrement,
|
|
292
|
+
handleRemoveProduct = _ref.handleRemoveProduct,
|
|
293
|
+
loading = _ref.loading,
|
|
294
|
+
imgSize = _ref.imgSize;
|
|
295
|
+
var imgnotfoundUrlcommon = '/images/imgnotfound.jpeg';
|
|
296
|
+
if (imgnotfoundUrl && imgnotfoundUrl !== 'null') imgnotfoundUrlcommon = imgnotfoundUrl;
|
|
297
|
+
return /*#__PURE__*/React.createElement(CartPageCard, null, /*#__PURE__*/React.createElement(CartPageImg, {
|
|
298
|
+
src: item.imageUrl && item.imageUrl !== 'null' ? item.imageUrl : imgnotfoundUrlcommon,
|
|
299
|
+
alt: 'no product image available',
|
|
300
|
+
width: imgSize === null || imgSize === void 0 ? void 0 : imgSize.width,
|
|
301
|
+
height: imgSize === null || imgSize === void 0 ? void 0 : imgSize.height
|
|
302
|
+
}), /*#__PURE__*/React.createElement(NameAndQtBox, null, /*#__PURE__*/React.createElement(CartPageCardName, null, /*#__PURE__*/React.createElement(Tooltip, {
|
|
303
|
+
title: item.productName,
|
|
304
|
+
placement: "top",
|
|
305
|
+
arrow: true
|
|
306
|
+
}, /*#__PURE__*/React.createElement("h6", null, item.productName)), /*#__PURE__*/React.createElement("p", null, "$", (_item$standardPrice = item.standardPrice) === null || _item$standardPrice === void 0 ? void 0 : _item$standardPrice.toFixed(2))), /*#__PURE__*/React.createElement(QtAndPriceBox, null, /*#__PURE__*/React.createElement(CartPageQtBox, null, /*#__PURE__*/React.createElement("span", {
|
|
307
|
+
className: "icon",
|
|
308
|
+
onClick: function onClick() {
|
|
309
|
+
if (loading) return;
|
|
310
|
+
handleIncrementDecrement('decrement', item);
|
|
311
|
+
}
|
|
312
|
+
}, /*#__PURE__*/React.createElement(AiOutlineMinus, null)), /*#__PURE__*/React.createElement("span", {
|
|
313
|
+
className: "qt"
|
|
314
|
+
}, item.quantity), /*#__PURE__*/React.createElement("span", {
|
|
315
|
+
className: "icon",
|
|
316
|
+
onClick: function onClick() {
|
|
317
|
+
if (loading) return;
|
|
318
|
+
handleIncrementDecrement('increment', item);
|
|
319
|
+
}
|
|
320
|
+
}, /*#__PURE__*/React.createElement(AiOutlinePlus, null))), /*#__PURE__*/React.createElement("p", {
|
|
321
|
+
className: "subtotal"
|
|
322
|
+
}, "subtotal: $", (item.standardPrice * item.quantity).toFixed(2)))), /*#__PURE__*/React.createElement(CloseBtn, {
|
|
323
|
+
onClick: function onClick() {
|
|
324
|
+
if (loading) return;
|
|
325
|
+
handleRemoveProduct(item);
|
|
326
|
+
}
|
|
327
|
+
}, /*#__PURE__*/React.createElement(AiOutlineClose, null)));
|
|
328
|
+
};
|
|
329
|
+
|
|
330
|
+
var _templateObject$4, _templateObject2$4;
|
|
331
|
+
var CartPageContainer = styled.div(_templateObject$4 || (_templateObject$4 = _taggedTemplateLiteralLoose(["\n width: 100%;\n max-width: ", ";\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: flex-start;\n\n .scrollDiv {\n width: 68%;\n height: 630px;\n max-height: 630px;\n background-color: white;\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n margin-right: 0.3em;\n &::-webkit-scrollbar {\n width: ", ";\n }\n\n /* Track */\n &::-webkit-scrollbar-track {\n background: ", ";\n border-radius: 16px;\n }\n\n /* Handle */\n &::-webkit-scrollbar-thumb {\n background: ", ";\n border-radius: 16px;\n margin: 5px 2px;\n border: 3px solid;\n border-color: ", ";\n }\n box-shadow: 0px 20px 35px rgba(0, 0, 0, 0.05);\n }\n @media only screen and (max-width: 840px) {\n flex-direction: column;\n .scrollDiv {\n width: 100%;\n margin: 0;\n margin-bottom: 2em;\n padding: 0 0.4em;\n }\n }\n"])), function (props) {
|
|
332
|
+
return props.maxWidth || '1350px';
|
|
333
|
+
}, function (props) {
|
|
334
|
+
return props.retail ? '12px' : '8px';
|
|
335
|
+
}, function (props) {
|
|
336
|
+
return props.retail ? '#667080' : 'rgba(102, 112, 128, 0.5)';
|
|
337
|
+
}, function (props) {
|
|
338
|
+
return props.retail ? '#BFC3CA' : '#EDEDED';
|
|
339
|
+
}, function (props) {
|
|
340
|
+
return props.retail ? '#667080' : 'rgba(102, 112, 128, 0.5)';
|
|
341
|
+
});
|
|
342
|
+
var CardsBox = styled.div(_templateObject2$4 || (_templateObject2$4 = _taggedTemplateLiteralLoose(["\n width: 100%;\n /* min-height: 1000px; */\n position: relative;\n max-width: 860px;\n margin-right: auto;\n padding: 1em 2em;\n display: ", ";\n grid-template-columns: 1fr 1fr;\n flex-direction: column;\n align-items: flex-start;\n grid-gap: 1em;\n justify-content: flex-start;\n align-items: center;\n border-radius: 20px;\n @media only screen and (max-width: 1220px) {\n display: flex;\n }\n @media only screen and (max-width: 640px) {\n padding: 1em 0.2em;\n }\n"])), function (props) {
|
|
343
|
+
return props.retail ? 'grid' : 'flex';
|
|
344
|
+
});
|
|
345
|
+
|
|
346
|
+
var CartPageComponent = function CartPageComponent(_ref) {
|
|
347
|
+
var _cartData$cartLineIte;
|
|
348
|
+
|
|
349
|
+
var retail = _ref.retail,
|
|
350
|
+
shippingData = _ref.shippingData,
|
|
351
|
+
selectedShipping = _ref.selectedShipping,
|
|
352
|
+
setShipping = _ref.setShipping,
|
|
353
|
+
clickRedirect = _ref.clickRedirect,
|
|
354
|
+
cartData = _ref.cartData,
|
|
355
|
+
handleIncrementDecrement = _ref.handleIncrementDecrement,
|
|
356
|
+
handleRemoveProduct = _ref.handleRemoveProduct,
|
|
357
|
+
loading = _ref.loading,
|
|
358
|
+
imgnotfoundUrl = _ref.imgnotfoundUrl,
|
|
359
|
+
styles = _ref.styles;
|
|
360
|
+
return /*#__PURE__*/React.createElement(CartPageContainer, {
|
|
361
|
+
retail: retail
|
|
362
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
363
|
+
className: "scrollDiv"
|
|
364
|
+
}, /*#__PURE__*/React.createElement(CardsBox, {
|
|
365
|
+
retail: retail
|
|
366
|
+
}, cartData === null || cartData === void 0 ? void 0 : (_cartData$cartLineIte = cartData.cartLineItemDtoList) === null || _cartData$cartLineIte === void 0 ? void 0 : _cartData$cartLineIte.map(function (item) {
|
|
367
|
+
return /*#__PURE__*/React.createElement(CartPageProductCard, {
|
|
368
|
+
item: item,
|
|
369
|
+
loading: loading,
|
|
370
|
+
imgnotfoundUrl: imgnotfoundUrl,
|
|
371
|
+
handleIncrementDecrement: handleIncrementDecrement,
|
|
372
|
+
handleRemoveProduct: handleRemoveProduct,
|
|
373
|
+
imgSize: styles === null || styles === void 0 ? void 0 : styles.imgSize
|
|
374
|
+
});
|
|
375
|
+
}))), /*#__PURE__*/React.createElement(CartSummary, {
|
|
376
|
+
retail: retail,
|
|
377
|
+
shippingData: shippingData,
|
|
378
|
+
selectedShipping: selectedShipping,
|
|
379
|
+
setShipping: setShipping,
|
|
380
|
+
clickRedirect: clickRedirect,
|
|
381
|
+
subtotal: cartData === null || cartData === void 0 ? void 0 : cartData.totalCartPrice,
|
|
382
|
+
styles: styles === null || styles === void 0 ? void 0 : styles.cartSummary
|
|
383
|
+
}));
|
|
384
|
+
};
|
|
385
|
+
|
|
163
386
|
var Breakpoint = function Breakpoint() {};
|
|
164
387
|
|
|
165
388
|
Breakpoint.xs = 'xs';
|
|
@@ -265,5 +488,5 @@ function useGridSize() {
|
|
|
265
488
|
return layout;
|
|
266
489
|
}
|
|
267
490
|
|
|
268
|
-
export { Breakpoint, CartDrawer, Variant, useGridSize, useWindowSize };
|
|
491
|
+
export { Breakpoint, CartDrawer, CartPageComponent as CartPage, Variant, useGridSize, useWindowSize };
|
|
269
492
|
//# sourceMappingURL=index.modern.js.map
|
package/dist/index.modern.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.modern.js","sources":["../src/components/CartDrawer/cartDrawer.styles.js","../src/components/CartDrawer/CartDrawerCard/CartDrawerProduct.styles.js","../src/components/CartDrawer/CartDrawerCard/CartDrawerCard.jsx","../src/components/CartDrawer/CartDrawer.jsx","../src/constants/Breakpoint.js","../src/constants/Variant.js","../src/utils/debounce.js","../src/hooks/useWindowSize.jsx","../src/hooks/useGridSize.jsx"],"sourcesContent":["import styled from 'styled-components';\nexport const CartDrawerContainer = styled.div`\n width: 100%;\n max-width: ${(props) => props.maxWidth || '650px'};\n height: 100%;\n font-family: ${(props) => props.fontFamily};\n /* padding: 1em;\n padding-top: 0rem; */\n position: relative;\n /* min-width: 100%; */\n min-height: 100vh;\n max-height: 100vh;\n overflow-y: auto;\n /* background-color: grey; */\n /* border: 1px solid; */\n`;\n\nexport const CartDrawerBar = styled.div`\n width: 100%;\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n position: sticky;\n box-sizing: border-box;\n top: 0;\n left: -1em;\n padding: 1em;\n height: 4.6rem;\n font-size: 1.6rem;\n background-color: white;\n font-weight: bold;\n padding-left: 1rem;\n z-index: 2;\n .icon {\n cursor: pointer;\n font-size: 22px;\n }\n @media only screen and (max-width: 640px) {\n font-size: 1.2rem;\n height: 4rem;\n }\n`;\n\nexport const CartDrawerProductContainer = styled.div`\n width: 100%;\n height: max-content;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: flex-start;\n position: relative;\n /* height: 900px; */\n padding: 1rem;\n min-height: 74vh;\n opacity: ${(props) => props.opacity};\n @media only screen and (max-width: 748px) {\n min-height: 75vh;\n }\n /* background-color: red; */\n`;\n\nexport const CartDrawerBottomSection = styled.div`\n width: 100%;\n /* height: 8rem; */\n background-color: white;\n box-shadow: 3px -2px 10px #b1b1b1;\n display: flex;\n flex-direction: column;\n min-height: 7rem;\n position: sticky;\n bottom: 0;\n /* padding-bottom: 0.5rem; */\n\n /* left: 0; */\n align-items: center;\n .row {\n width: 100%;\n padding: 0rem 1rem;\n padding-top: 1rem;\n /* padding-left: 1rem; */\n h5 {\n font-weight: bold;\n font-size: 1.1rem;\n span {\n font-weight: 400;\n padding-left: 0.5rem;\n }\n }\n }\n @media only screen and (max-width: 340px) {\n min-height: 6rem;\n .row h5 {\n font-size: 0.8rem;\n }\n }\n`;\n\nexport const CartDrawerOutlinedButton = styled.button`\n width: 90%;\n height: 3.55rem;\n border: 2px solid;\n border-radius: 1rem;\n display: grid;\n place-items: center;\n font-weight: 500;\n font-size: 1rem;\n transition: 0.5s;\n outline: none;\n text-transform: capitalize;\n border-color: ${(props) => props.color || 'black'};\n color: ${(props) => props.color || 'black'};\n text-transform: capitalize;\n margin: 0.6rem 0;\n cursor: pointer;\n background: white;\n &:hover,\n &:focus {\n opacity: 0.8;\n letter-spacing: 1px;\n outline: none;\n }\n @media only screen and (max-width: 640px) {\n height: 2.9rem;\n }\n @media only screen and (max-width: 340px) {\n height: 2.2rem;\n margin: 0.3rem 0;\n }\n`;\n\nexport const CartDrawerFilledButton = styled(CartDrawerOutlinedButton)`\n background: ${(props) => props.color || 'black'};\n color: white;\n position: relative;\n margin-bottom: 1rem;\n .icon {\n position: absolute;\n right: 2rem;\n margin: auto 0;\n }\n`;\n\nexport const CartDrawerEmptyCart = styled.div`\n width: 100%;\n height: calc(100vh - 4.6rem);\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n h6 {\n font-size: 1.8rem;\n font-weight: bold;\n text-transform: uppercase;\n margin: 0;\n margin-top: 1rem;\n color: ${(props) => props.color || 'red'};\n }\n p {\n font-size: 1.1rem;\n text-transform: capitalize;\n font-weight: 500;\n /* color: darkgrey; */\n /* color: orange; */\n }\n .icon {\n font-size: 9.5rem;\n color: darkgrey;\n /* color: orange; */\n }\n`;\n","import styled from 'styled-components';\nexport const CartDrawerProduct = styled.div`\n width: 100%;\n display: flex;\n flex-direction: row;\n height: 100px;\n justify-content: space-around;\n align-items: center;\n overflow: hidden;\n margin-bottom: 2rem;\n img {\n width: 20%;\n max-height: 100%;\n /* aspect-ratio: 1; */\n object-fit: cover;\n }\n .middleSection {\n width: 60%;\n padding-left: 0.8rem;\n height: 100%;\n h6 {\n font-size: 1.1rem;\n font-weight: bold;\n margin: 0;\n\n span {\n font-size: 0.8rem;\n color: grey;\n text-decoration: line-through;\n margin-right: 0.5rem;\n }\n }\n .name {\n font-size: 0.9rem;\n line-height: 1.2rem;\n max-height: 2.45rem;\n width: 100%;\n word-wrap: break-word;\n overflow: hidden;\n text-overflow: ellipsis;\n transition: 0.3s;\n cursor: pointer;\n &:hover {\n color: ${(props) => props.color || 'grey'};\n }\n }\n }\n .endSection {\n width: 20%;\n height: 100%;\n .icon {\n cursor: pointer;\n transition: 0.4s;\n &:hover {\n color: red;\n /* opacity: 0.7; */\n }\n }\n }\n @media only screen and (max-width: 340px) {\n height: 80px;\n .middleSection {\n h6 {\n font-size: 0.9rem;\n }\n .name {\n font-size: 0.7rem;\n height: 1.45rem;\n }\n }\n }\n`;\n\nexport const CartDrawerQtBox = styled.div`\n height: 34px;\n width: 82px;\n border: 1px solid rgb(211, 210, 210);\n display: flex;\n align-items: center;\n justify-content: space-between;\n font-size: 13.5px;\n color: #333;\n padding: 0 0.5rem;\n border-radius: 5px;\n max-width: 100%;\n\n span {\n cursor: pointer;\n height: 100%;\n display: grid;\n place-items: center;\n }\n .qt {\n font-size: 12px;\n color: black;\n font-weight: 500;\n cursor: auto;\n }\n @media only screen and (max-width: 640px) {\n min-width: 55px;\n aspect-ratio: 1/2;\n /* min-height: 28px; */\n font-size: 10px;\n }\n @media only screen and (max-width: 340px) {\n min-width: 50px;\n aspect-ratio: 1/2;\n height: 22px;\n font-size: 8px;\n }\n`;\nexport const CartDrawerLoader = styled.div`\n position: absolute;\n top: 30%;\n width: 100px;\n height: 100px;\n display: grid;\n place-items: center;\n`;\n","import React from 'react';\nimport { Stack, Tooltip } from '@mui/material';\nimport { RiDeleteBin5Line } from 'react-icons/ri';\nimport { AiOutlinePlus, AiOutlineMinus } from 'react-icons/ai';\n// import imgnotfound from '../../../assets/imgnotfound.jpeg';\n////////\nimport { CartDrawerProduct, CartDrawerQtBox } from './CartDrawerProduct.styles';\nconst CartDrawerProductCard = ({\n product,\n color,\n handleIncrementDecrement,\n handleRemoveProduct,\n handleRedirect,\n imgnotfoundUrl,\n loading,\n}) => {\n let imgnotfoundUrlcommon = '/images/imgnotfound.jpeg';\n if (imgnotfoundUrl && imgnotfoundUrl !== 'null')\n imgnotfoundUrlcommon = imgnotfoundUrl;\n\n return (\n <CartDrawerProduct color={color}>\n <img\n src={\n product.imageUrl && product.imageUrl !== 'null'\n ? product.imageUrl\n : imgnotfoundUrlcommon\n }\n alt={'no product image available'}\n />\n <Stack\n flexDirection=\"column\"\n justifyContent=\"space-between\"\n alignItems=\"flex-start\"\n className=\"middleSection\"\n >\n <Tooltip title={product?.productName} placement=\"top\" arrow>\n <h6 className=\"name\" onClick={() => handleRedirect(product)}>\n {product?.productName}\n </h6>\n </Tooltip>\n\n <h6>\n {product?.standardPrice === product?.cartStandardPrice ? (\n `$${product?.standardPrice}`\n ) : (\n <React.Fragment>\n <span>${product?.cartStandardPrice?.toFixed(2)}</span>$\n {product?.standardPrice?.toFixed(2)}\n </React.Fragment>\n )}\n </h6>\n </Stack>\n <Stack\n flexDirection=\"column\"\n justifyContent=\"space-between\"\n alignItems=\"flex-end\"\n className=\"endSection\"\n >\n <RiDeleteBin5Line\n className=\"icon\"\n onClick={() => {\n if (loading) return;\n handleRemoveProduct(product);\n }}\n />\n <CartDrawerQtBox>\n <span\n onClick={() => {\n if (loading) return;\n handleIncrementDecrement('decrement', product);\n }}\n >\n {' '}\n <AiOutlineMinus />\n </span>{' '}\n <span className={'qt'}>{product?.quantity}</span>\n <span\n onClick={() => {\n if (loading) return;\n handleIncrementDecrement('increment', product);\n }}\n >\n <AiOutlinePlus />\n </span>\n </CartDrawerQtBox>\n </Stack>\n </CartDrawerProduct>\n );\n};\n\nexport default CartDrawerProductCard;\n","import { Stack } from '@mui/material';\nimport React from 'react';\nimport { GrClose } from 'react-icons/gr';\nimport { GiShoppingCart } from 'react-icons/gi';\nimport { BsCartX } from 'react-icons/bs';\n//////\nimport {\n CartDrawerBar,\n CartDrawerBottomSection,\n CartDrawerContainer,\n CartDrawerOutlinedButton,\n CartDrawerFilledButton,\n CartDrawerProductContainer,\n CartDrawerEmptyCart,\n} from './cartDrawer.styles';\nimport CartDrawerProductCard from './CartDrawerCard/CartDrawerCard';\nimport { CartDrawerLoader } from './CartDrawerCard/CartDrawerProduct.styles';\nimport { PuffLoader } from 'react-spinners';\n\nconst CartDrawer = ({\n cartData,\n maxWidth,\n color,\n handleRedirect,\n handleIncrementDecrement,\n handleRemoveProduct,\n handleClose,\n loading,\n imgnotfoundUrl,\n}) => {\n return (\n <React.Fragment>\n <CartDrawerContainer maxWidth={maxWidth}>\n <CartDrawerBar>\n <h2>Your Cart</h2>\n <GrClose\n className=\"icon\"\n onClick={() => {\n handleClose();\n }}\n />\n </CartDrawerBar>\n {cartData && cartData?.totalCartQuantity > 0 ? (\n <CartDrawerProductContainer opacity={loading ? '.4' : '1'}>\n {cartData?.cartLineItemDtoList?.map((product, i) => (\n <React.Fragment>\n {loading && (\n <CartDrawerLoader>\n <PuffLoader color=\"black\" />\n </CartDrawerLoader>\n )}\n\n <CartDrawerProductCard\n product={product}\n handleRedirect={handleRedirect}\n handleIncrementDecrement={handleIncrementDecrement}\n handleRemoveProduct={handleRemoveProduct}\n color={color}\n key={i}\n imgnotfoundUrl={imgnotfoundUrl}\n loading={loading}\n />\n </React.Fragment>\n ))}\n </CartDrawerProductContainer>\n ) : (\n <CartDrawerEmptyCart color={color}>\n <BsCartX className=\"icon\" />\n <h6>OOps!</h6>\n <p>your cart is empty</p>\n </CartDrawerEmptyCart>\n )}\n {cartData && cartData?.totalCartQuantity > 0 && (\n <CartDrawerBottomSection>\n <Stack\n flexDirection=\"row\"\n justifyContent=\"space-between\"\n alignItems=\"center\"\n className=\"row\"\n >\n <h5>\n Subtotal<span>({cartData?.totalCartQuantity} items)</span>\n </h5>\n <h5>${cartData?.totalCartPrice?.toFixed(2)}</h5>\n </Stack>\n <CartDrawerOutlinedButton\n color={color}\n onClick={() => handleRedirect('cart')}\n >\n view cart\n </CartDrawerOutlinedButton>\n <CartDrawerFilledButton\n color={color}\n onClick={() => handleRedirect('checkout')}\n >\n continue to checkout\n </CartDrawerFilledButton>\n </CartDrawerBottomSection>\n )}\n </CartDrawerContainer>\n </React.Fragment>\n );\n};\n\nexport default CartDrawer;\n","class Breakpoint {\n static xs = 'xs';\n static sm = 'sm';\n static md = 'md';\n static lg = 'lg';\n static xl = 'xl';\n static xxl = 'xxl';\n}\n\nexport default Breakpoint;\n","class Variant {\n static ONE = 'one';\n static TWO = 'two';\n static THREE = 'three';\n}\n\nexport default Variant;\n","export default function debounce(func, wait, immediate) {\n let timeout;\n return function (...args) {\n clearTimeout(timeout);\n timeout = setTimeout(() => {\n timeout = null;\n if (!immediate) func.apply(this, args);\n }, wait);\n if (immediate && !timeout) func.apply(this, [...args]);\n };\n}\n","import { useEffect, useState } from 'react';\nimport debounce from '../utils/debounce';\n\nfunction useWindowSize() {\n const isWindow = typeof window !== 'undefined';\n const [windowSize, setWindowSize] = useState({\n width: isWindow ? window.innerWidth : 1200,\n height: isWindow ? window.innerHeight : 800,\n });\n\n useEffect(() => {\n const onWindowResize = () => {\n setWindowSize({\n width: window.innerWidth,\n height: window.innerHeight,\n });\n };\n\n const onResize = debounce(onWindowResize, 100);\n\n window.addEventListener('resize', onResize);\n onWindowResize();\n\n return () => {\n window.removeEventListener('resize', onResize);\n };\n }, []);\n\n return windowSize;\n}\n\nexport default useWindowSize;\n","import { useEffect, useState } from 'react';\nimport useWindowSize from './useWindowSize';\nimport { Breakpoint } from '../constants';\n\n/*\n The breakpoints of responsive grid follow Google chrome media queries rules\n*/\nconst getBreakpoint = ({ width: screen }) => {\n let breakpoint = '';\n\n if (screen <= 320) {\n breakpoint = Breakpoint.xs;\n }\n if (screen >= 375) {\n breakpoint = Breakpoint.sm;\n }\n if (screen >= 768) {\n breakpoint = Breakpoint.md;\n }\n if (screen >= 992) {\n breakpoint = Breakpoint.lg;\n }\n if (screen >= 1200) {\n breakpoint = Breakpoint.xl;\n }\n if (screen >= 1600) {\n breakpoint = Breakpoint.xxl;\n }\n\n return breakpoint;\n};\n\nfunction useGridSize() {\n const windowSize = useWindowSize();\n const [layout, setLayout] = useState(Breakpoint.md);\n\n useEffect(() => {\n setLayout(getBreakpoint(windowSize));\n }, [windowSize]);\n return layout;\n}\n\nexport default useGridSize;\n"],"names":["CartDrawerContainer","styled","div","props","maxWidth","fontFamily","CartDrawerBar","CartDrawerProductContainer","opacity","CartDrawerBottomSection","CartDrawerOutlinedButton","button","color","CartDrawerFilledButton","CartDrawerEmptyCart","CartDrawerProduct","CartDrawerQtBox","CartDrawerLoader","CartDrawerProductCard","product","handleIncrementDecrement","handleRemoveProduct","handleRedirect","imgnotfoundUrl","loading","imgnotfoundUrlcommon","imageUrl","productName","standardPrice","cartStandardPrice","toFixed","quantity","CartDrawer","cartData","handleClose","totalCartQuantity","cartLineItemDtoList","map","i","totalCartPrice","Breakpoint","xs","sm","md","lg","xl","xxl","Variant","ONE","TWO","THREE","debounce","func","wait","immediate","timeout","args","clearTimeout","setTimeout","apply","useWindowSize","isWindow","window","useState","width","innerWidth","height","innerHeight","windowSize","setWindowSize","useEffect","onWindowResize","onResize","addEventListener","removeEventListener","getBreakpoint","screen","breakpoint","useGridSize","layout","setLayout"],"mappings":";;;;;;;;;;;;;;;;;;;;AACO,IAAMA,mBAAmB,GAAGC,MAAM,CAACC,GAAV,oXAEjB,UAACC,KAAD;EAAA,OAAWA,KAAK,CAACC,QAAN,IAAkB,OAA7B;AAAA,CAFiB,EAIf,UAACD,KAAD;EAAA,OAAWA,KAAK,CAACE,UAAjB;AAAA,CAJe,CAAzB;AAgBA,IAAMC,aAAa,GAAGL,MAAM,CAACC,GAAV,0jBAAnB;AA2BA,IAAMK,0BAA0B,GAAGN,MAAM,CAACC,GAAV,+aAW1B,UAACC,KAAD;EAAA,OAAWA,KAAK,CAACK,OAAjB;AAAA,CAX0B,CAAhC;AAkBA,IAAMC,uBAAuB,GAAGR,MAAM,CAACC,GAAV,2uBAA7B;AAoCA,IAAMQ,wBAAwB,GAAGT,MAAM,CAACU,MAAV,ssBAYnB,UAACR,KAAD;EAAA,OAAWA,KAAK,CAACS,KAAN,IAAe,OAA1B;AAAA,CAZmB,EAa1B,UAACT,KAAD;EAAA,OAAWA,KAAK,CAACS,KAAN,IAAe,OAA1B;AAAA,CAb0B,CAA9B;AAiCA,IAAMC,sBAAsB,GAAGZ,MAAM,CAACS,wBAAD,CAAT,oPACnB,UAACP,KAAD;EAAA,OAAWA,KAAK,CAACS,KAAN,IAAe,OAA1B;AAAA,CADmB,CAA5B;AAYA,IAAME,mBAAmB,GAAGb,MAAM,CAACC,GAAV,imBAanB,UAACC,KAAD;EAAA,OAAWA,KAAK,CAACS,KAAN,IAAe,KAA1B;AAAA,CAbmB,CAAzB;;;AC9IA,IAAMG,iBAAiB,GAAGd,MAAM,CAACC,GAAV,+4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,IAAI,IAAd,EAAoB;IAClBC,UAAU,GAAGrC,UAAU,CAACM,GAAxB;;;EAGF,OAAO+B,UAAP;AACD,CAvBD;;AAyBA,SAASC,WAAT,GAAuB;EACrB,IAAMV,UAAU,GAAGR,aAAa,EAAhC;;EACA,gBAA4BG,QAAQ,CAACvB,UAAU,CAACG,EAAZ,CAApC;MAAOoC,MAAP;MAAeC,SAAf;;EAEAV,SAAS,CAAC,YAAM;IACdU,SAAS,CAACL,aAAa,CAACP,UAAD,CAAd,CAAT;GADO,EAEN,CAACA,UAAD,CAFM,CAAT;EAGA,OAAOW,MAAP;AACD;;;;"}
|
|
1
|
+
{"version":3,"file":"index.modern.js","sources":["../src/components/CartDrawer/cartDrawer.styles.js","../src/components/CartDrawer/CartDrawerCard/CartDrawerProduct.styles.js","../src/components/CartDrawer/CartDrawerCard/CartDrawerCard.jsx","../src/components/CartDrawer/CartDrawer.jsx","../src/components/CartPage/CartSummary/CartSummary.styles.js","../src/components/CartPage/CartSummary/index.jsx","../src/components/CartPage/ProductCard/Card.styles.js","../src/components/CartPage/ProductCard/CartPageCard.jsx","../src/components/CartPage/index.jsx","../src/constants/Breakpoint.js","../src/constants/Variant.js","../src/utils/debounce.js","../src/hooks/useWindowSize.jsx","../src/hooks/useGridSize.jsx"],"sourcesContent":["import styled from 'styled-components';\nexport const CartDrawerContainer = styled.div`\n width: 100%;\n max-width: ${(props) => props.maxWidth || '650px'};\n height: 100%;\n font-family: ${(props) => props.fontFamily};\n /* padding: 1em;\n padding-top: 0rem; */\n position: relative;\n /* min-width: 100%; */\n min-height: 100vh;\n max-height: 100vh;\n overflow-y: auto;\n /* background-color: grey; */\n /* border: 1px solid; */\n`;\n\nexport const CartDrawerBar = styled.div`\n width: 100%;\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n position: sticky;\n box-sizing: border-box;\n top: 0;\n left: -1em;\n padding: 1em;\n height: 4.6rem;\n font-size: 1.6rem;\n background-color: white;\n font-weight: bold;\n padding-left: 1rem;\n z-index: 2;\n .icon {\n cursor: pointer;\n font-size: 22px;\n }\n @media only screen and (max-width: 640px) {\n font-size: 1.2rem;\n height: 4rem;\n }\n`;\n\nexport const CartDrawerProductContainer = styled.div`\n width: 100%;\n height: max-content;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: flex-start;\n position: relative;\n /* height: 900px; */\n padding: 1rem;\n min-height: 74vh;\n opacity: ${(props) => props.opacity};\n @media only screen and (max-width: 748px) {\n min-height: 75vh;\n }\n /* background-color: red; */\n`;\n\nexport const CartDrawerBottomSection = styled.div`\n width: 100%;\n /* height: 8rem; */\n background-color: white;\n box-shadow: 3px -2px 10px #b1b1b1;\n display: flex;\n flex-direction: column;\n min-height: 7rem;\n position: sticky;\n bottom: 0;\n /* padding-bottom: 0.5rem; */\n\n /* left: 0; */\n align-items: center;\n .row {\n width: 100%;\n padding: 0rem 1rem;\n padding-top: 1rem;\n /* padding-left: 1rem; */\n h5 {\n font-weight: bold;\n font-size: 1.1rem;\n span {\n font-weight: 400;\n padding-left: 0.5rem;\n }\n }\n }\n @media only screen and (max-width: 340px) {\n min-height: 6rem;\n .row h5 {\n font-size: 0.8rem;\n }\n }\n`;\n\nexport const CartDrawerOutlinedButton = styled.button`\n width: 90%;\n height: 3.55rem;\n border: 2px solid;\n border-radius: 1rem;\n display: grid;\n place-items: center;\n font-weight: 500;\n font-size: 1rem;\n transition: 0.5s;\n outline: none;\n text-transform: capitalize;\n border-color: ${(props) => props.color || 'black'};\n color: ${(props) => props.color || 'black'};\n text-transform: capitalize;\n margin: 0.6rem 0;\n cursor: pointer;\n background: white;\n &:hover,\n &:focus {\n opacity: 0.8;\n letter-spacing: 1px;\n outline: none;\n }\n @media only screen and (max-width: 640px) {\n height: 2.9rem;\n }\n @media only screen and (max-width: 340px) {\n height: 2.2rem;\n margin: 0.3rem 0;\n }\n`;\n\nexport const CartDrawerFilledButton = styled(CartDrawerOutlinedButton)`\n background: ${(props) => props.color || 'black'};\n color: white;\n position: relative;\n margin-bottom: 1rem;\n .icon {\n position: absolute;\n right: 2rem;\n margin: auto 0;\n }\n`;\n\nexport const CartDrawerEmptyCart = styled.div`\n width: 100%;\n height: calc(100vh - 4.6rem);\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n h6 {\n font-size: 1.8rem;\n font-weight: bold;\n text-transform: uppercase;\n margin: 0;\n margin-top: 1rem;\n color: ${(props) => props.color || 'red'};\n }\n p {\n font-size: 1.1rem;\n text-transform: capitalize;\n font-weight: 500;\n /* color: darkgrey; */\n /* color: orange; */\n }\n .icon {\n font-size: 9.5rem;\n color: darkgrey;\n /* color: orange; */\n }\n`;\n","import styled from 'styled-components';\nexport const CartDrawerProduct = styled.div`\n width: 100%;\n display: flex;\n flex-direction: row;\n height: 100px;\n justify-content: space-around;\n align-items: center;\n overflow: hidden;\n margin-bottom: 2rem;\n img {\n width: 20%;\n max-height: 100%;\n /* aspect-ratio: 1; */\n object-fit: cover;\n }\n .middleSection {\n width: 60%;\n padding-left: 0.8rem;\n height: 100%;\n h6 {\n font-size: 1.1rem;\n font-weight: bold;\n margin: 0;\n\n span {\n font-size: 0.8rem;\n color: grey;\n text-decoration: line-through;\n margin-right: 0.5rem;\n }\n }\n .name {\n font-size: 0.9rem;\n line-height: 1.2rem;\n max-height: 2.45rem;\n width: 100%;\n word-wrap: break-word;\n overflow: hidden;\n text-overflow: ellipsis;\n transition: 0.3s;\n cursor: pointer;\n &:hover {\n color: ${(props) => props.color || 'grey'};\n }\n }\n }\n .endSection {\n width: 20%;\n height: 100%;\n .icon {\n cursor: pointer;\n transition: 0.4s;\n &:hover {\n color: red;\n /* opacity: 0.7; */\n }\n }\n }\n @media only screen and (max-width: 340px) {\n height: 80px;\n .middleSection {\n h6 {\n font-size: 0.9rem;\n }\n .name {\n font-size: 0.7rem;\n height: 1.45rem;\n }\n }\n }\n`;\n\nexport const CartDrawerQtBox = styled.div`\n height: 34px;\n width: 82px;\n border: 1px solid rgb(211, 210, 210);\n display: flex;\n align-items: center;\n justify-content: space-between;\n font-size: 13.5px;\n color: #333;\n padding: 0 0.5rem;\n border-radius: 5px;\n max-width: 100%;\n\n span {\n cursor: pointer;\n height: 100%;\n display: grid;\n place-items: center;\n }\n .qt {\n font-size: 12px;\n color: black;\n font-weight: 500;\n cursor: auto;\n }\n @media only screen and (max-width: 640px) {\n min-width: 55px;\n aspect-ratio: 1/2;\n /* min-height: 28px; */\n font-size: 10px;\n }\n @media only screen and (max-width: 340px) {\n min-width: 50px;\n aspect-ratio: 1/2;\n height: 22px;\n font-size: 8px;\n }\n`;\nexport const CartDrawerLoader = styled.div`\n position: absolute;\n top: 30%;\n width: 100px;\n height: 100px;\n display: grid;\n place-items: center;\n`;\n","import React from 'react';\nimport { Stack, Tooltip } from '@mui/material';\nimport { RiDeleteBin5Line } from 'react-icons/ri';\nimport { AiOutlinePlus, AiOutlineMinus } from 'react-icons/ai';\n// import imgnotfound from '../../../assets/imgnotfound.jpeg';\n////////\nimport { CartDrawerProduct, CartDrawerQtBox } from './CartDrawerProduct.styles';\nconst CartDrawerProductCard = ({\n product,\n color,\n handleIncrementDecrement,\n handleRemoveProduct,\n handleRedirect,\n imgnotfoundUrl,\n loading,\n}) => {\n let imgnotfoundUrlcommon = '/images/imgnotfound.jpeg';\n if (imgnotfoundUrl && imgnotfoundUrl !== 'null')\n imgnotfoundUrlcommon = imgnotfoundUrl;\n\n return (\n <CartDrawerProduct color={color}>\n <img\n src={\n product.imageUrl && product.imageUrl !== 'null'\n ? product.imageUrl\n : imgnotfoundUrlcommon\n }\n alt={'no product image available'}\n />\n <Stack\n flexDirection=\"column\"\n justifyContent=\"space-between\"\n alignItems=\"flex-start\"\n className=\"middleSection\"\n >\n <Tooltip title={product?.productName} placement=\"top\" arrow>\n <h6 className=\"name\" onClick={() => handleRedirect(product)}>\n {product?.productName}\n </h6>\n </Tooltip>\n\n <h6>\n {product?.standardPrice === product?.cartStandardPrice ? (\n `$${product?.standardPrice}`\n ) : (\n <React.Fragment>\n <span>${product?.cartStandardPrice?.toFixed(2)}</span>$\n {product?.standardPrice?.toFixed(2)}\n </React.Fragment>\n )}\n </h6>\n </Stack>\n <Stack\n flexDirection=\"column\"\n justifyContent=\"space-between\"\n alignItems=\"flex-end\"\n className=\"endSection\"\n >\n <RiDeleteBin5Line\n className=\"icon\"\n onClick={() => {\n if (loading) return;\n handleRemoveProduct(product);\n }}\n />\n <CartDrawerQtBox>\n <span\n onClick={() => {\n if (loading) return;\n handleIncrementDecrement('decrement', product);\n }}\n >\n {' '}\n <AiOutlineMinus />\n </span>{' '}\n <span className={'qt'}>{product?.quantity}</span>\n <span\n onClick={() => {\n if (loading) return;\n handleIncrementDecrement('increment', product);\n }}\n >\n <AiOutlinePlus />\n </span>\n </CartDrawerQtBox>\n </Stack>\n </CartDrawerProduct>\n );\n};\n\nexport default CartDrawerProductCard;\n","import { Stack } from '@mui/material';\nimport React from 'react';\nimport { GrClose } from 'react-icons/gr';\nimport { GiShoppingCart } from 'react-icons/gi';\nimport { BsCartX } from 'react-icons/bs';\n//////\nimport {\n CartDrawerBar,\n CartDrawerBottomSection,\n CartDrawerContainer,\n CartDrawerOutlinedButton,\n CartDrawerFilledButton,\n CartDrawerProductContainer,\n CartDrawerEmptyCart,\n} from './cartDrawer.styles';\nimport CartDrawerProductCard from './CartDrawerCard/CartDrawerCard';\nimport { CartDrawerLoader } from './CartDrawerCard/CartDrawerProduct.styles';\nimport { PuffLoader } from 'react-spinners';\n\nconst CartDrawer = ({\n cartData,\n maxWidth,\n color,\n handleRedirect,\n handleIncrementDecrement,\n handleRemoveProduct,\n handleClose,\n loading,\n imgnotfoundUrl,\n}) => {\n return (\n <React.Fragment>\n <CartDrawerContainer maxWidth={maxWidth}>\n <CartDrawerBar>\n <h2>Your Cart</h2>\n <GrClose\n className=\"icon\"\n onClick={() => {\n handleClose();\n }}\n />\n </CartDrawerBar>\n {cartData && cartData?.totalCartQuantity > 0 ? (\n <CartDrawerProductContainer opacity={loading ? '.4' : '1'}>\n {cartData?.cartLineItemDtoList?.map((product, i) => (\n <React.Fragment>\n {loading && (\n <CartDrawerLoader>\n <PuffLoader color=\"black\" />\n </CartDrawerLoader>\n )}\n\n <CartDrawerProductCard\n product={product}\n handleRedirect={handleRedirect}\n handleIncrementDecrement={handleIncrementDecrement}\n handleRemoveProduct={handleRemoveProduct}\n color={color}\n key={i}\n imgnotfoundUrl={imgnotfoundUrl}\n loading={loading}\n />\n </React.Fragment>\n ))}\n </CartDrawerProductContainer>\n ) : (\n <CartDrawerEmptyCart color={color}>\n <BsCartX className=\"icon\" />\n <h6>OOps!</h6>\n <p>your cart is empty</p>\n </CartDrawerEmptyCart>\n )}\n {cartData && cartData?.totalCartQuantity > 0 && (\n <CartDrawerBottomSection>\n <Stack\n flexDirection=\"row\"\n justifyContent=\"space-between\"\n alignItems=\"center\"\n className=\"row\"\n >\n <h5>\n Subtotal<span>({cartData?.totalCartQuantity} items)</span>\n </h5>\n <h5>${cartData?.totalCartPrice?.toFixed(2)}</h5>\n </Stack>\n <CartDrawerOutlinedButton\n color={color}\n onClick={() => handleRedirect('cart')}\n >\n view cart\n </CartDrawerOutlinedButton>\n <CartDrawerFilledButton\n color={color}\n onClick={() => handleRedirect('checkout')}\n >\n continue to checkout\n </CartDrawerFilledButton>\n </CartDrawerBottomSection>\n )}\n </CartDrawerContainer>\n </React.Fragment>\n );\n};\n\nexport default CartDrawer;\n","import styled from 'styled-components';\n\nexport const CartSummaryContainer = styled.div`\n width: min(95%, 24.75em);\n max-width: ${(props) => props.maxWidth || '24.75em'};\n display: flex;\n flex-direction: column;\n background: ${(props) => props.background || '#667080'};\n color: ${(props) => props.color || 'white'};\n border-radius: 25px;\n padding: 2em 1em;\n align-items: center;\n p {\n font-size: 0.89em;\n font-weight: 300;\n align-self: flex-start;\n color: inherit;\n margin: 0;\n padding: 0;\n }\n .continueShopping {\n font-size: 0.75em;\n color: inherit;\n text-transform: capitalize;\n height: 20px;\n border-bottom: 1px solid;\n border-color: ${(props) => props.color || 'white'};\n font-weight: 300;\n cursor: pointer;\n }\n`;\nexport const CartSummaryRow = styled.div`\n width: 100%;\n display: flex;\n flex-direction: row;\n justify-content: ${(props) => props.justify || 'space-between'};\n align-items: center;\n color: inherit;\n h6,\n h5 {\n margin: 0;\n font-size: 1em;\n font-weight: 700;\n color: inherit;\n text-transform: capitalize;\n }\n h5 {\n font-size: ${(props) => props.h5 || '1.31em'};\n }\n`;\nexport const CartSummaryHr = styled.hr`\n border: none;\n width: 100%;\n height: 1px;\n background-color: ${(props) => props.color || 'rgba(255, 255, 255, 0.5)'};\n margin: 1em 0;\n`;\n\nexport const CartSummaryInputBox = styled.form`\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n padding-bottom: ${(props) => (props.paddingBottom ? '2em' : '0')};\n input {\n width: 10.81rem;\n height: 2.44rem;\n padding: 0.2em 0.8em;\n text-transform: capitalize;\n font-size: 0.89em;\n border-radius: 1.19rem;\n margin-right: 1em;\n border: none;\n outline: none;\n background: ${(props) => props.background || '#bfc3ca'};\n color: ${(props) => props.color || '#667080'};\n &::placeholder {\n color: ${(props) => props.color || '#667080'};\n }\n }\n button {\n width: 7.75rem;\n height: 2.44rem;\n background: ${(props) => props.btn || '#393f48'};\n border-radius: 1.19rem;\n display: grid;\n color: inherit;\n place-items: center;\n border: none;\n outline: none;\n text-transform: uppercase;\n cursor: pointer;\n font-size: 0.75em;\n transition: 0.3s;\n &:hover {\n letter-spacing: 1px;\n }\n }\n`;\nexport const CartSummaryCheckoutBtn = styled.button`\n font-size: 0.95em;\n font-weight: 700;\n background: #393f48;\n cursor: pointer;\n text-transform: uppercase;\n color: inherit;\n border: none;\n outline: none;\n width: 16.81em;\n height: 3.75em;\n display: grid;\n place-items: center;\n font-size: 0.75em;\n border-radius: 2.64em;\n padding: 0;\n font-size: 0.94em;\n margin: 1em auto;\n transition: 0.3s;\n margin-top: 2em;\n &:hover {\n opacity: 0.8;\n }\n`;\n\nexport const CartSummaryCheckBoxRow = styled(CartSummaryRow)`\n justify-content: flex-start;\n margin-left: 1em;\n margin-top: 1em;\n cursor: pointer;\n .checkBox {\n width: 0.63em;\n height: 0.63em;\n border: 1px solid;\n border-color: ${(props) => props.background || 'white'};\n background: transparent;\n margin-right: 0.5em;\n border-radius: 50%;\n background: ${(props) =>\n props.selected ? props.background : 'transparent'};\n }\n p {\n font-size: 1em;\n font-weight: 6 400;\n span {\n font-weight: 600;\n margin: 0 0.1em;\n }\n }\n`;\n","import { Stack } from '@mui/material';\nimport React, { useState } from 'react';\n\nimport {\n CartSummaryCheckBoxRow,\n CartSummaryCheckoutBtn,\n CartSummaryContainer,\n CartSummaryHr,\n CartSummaryInputBox,\n CartSummaryRow,\n} from './CartSummary.styles';\n\nconst CartSummary = ({\n retail = true,\n shippingData,\n selectedShipping,\n setShipping,\n clickRedirect,\n subtotal,\n styles,\n}) => {\n console.log(selectedShipping);\n return (\n <CartSummaryContainer background={styles?.bg} color={styles?.color}>\n <p>Cart summary</p>\n <CartSummaryHr color={styles?.hr} />\n <CartSummaryRow>\n <h6>subtotal</h6>\n <h5>${subtotal?.toFixed(2)}</h5>\n </CartSummaryRow>\n <CartSummaryHr color={styles?.hr} />\n <CartSummaryRow>\n <h6>Discount</h6>\n <h5>$0.00</h5>\n </CartSummaryRow>\n <CartSummaryHr color={styles?.hr} />\n {retail && (\n <Stack\n flexDirection=\"column\"\n justifyContent=\"flexStart\"\n sx={{ width: '100%' }}\n >\n <CartSummaryRow justify=\"flex-start\">\n <h6>shipping</h6>\n </CartSummaryRow>\n {shippingData.map((li, i) => (\n <CartSummaryCheckBoxRow\n key={i}\n selected={li.id === selectedShipping.id}\n onClick={() => {\n setShipping(li);\n }}\n background={styles.color}\n >\n <span className=\"checkBox\"></span>\n <p>\n {li.name}{' '}\n {li.amount && li.amount > 0 && (\n <span>: ${li.amount?.toFixed(2)}</span>\n )}\n </p>\n </CartSummaryCheckBoxRow>\n ))}\n <CartSummaryHr color={styles?.hr} />\n </Stack>\n )}\n <CartSummaryInputBox\n paddingBottom={!retail}\n background={styles?.input?.bg}\n color={styles?.input?.color}\n btn={styles?.btnColor}\n >\n <input placeholder=\"Coupon code\" type=\"email\" required />\n <button>apply coupon</button>\n </CartSummaryInputBox>\n\n <CartSummaryHr color={styles?.hr} />\n <CartSummaryRow h5=\"1.64em\">\n <h6>total</h6>\n <h5>${(subtotal + selectedShipping?.amount)?.toFixed(2)}</h5>\n </CartSummaryRow>\n <CartSummaryRow justify=\"center\">\n <CartSummaryCheckoutBtn\n onClick={() => clickRedirect('/checkout')}\n background={styles?.btnColor}\n >\n proceed to checkokut\n </CartSummaryCheckoutBtn>\n </CartSummaryRow>\n <CartSummaryRow justify=\"center\">\n <span className=\"continueShopping\" onClick={() => clickRedirect('/')}>\n Continue to shopping\n </span>\n </CartSummaryRow>\n </CartSummaryContainer>\n );\n};\n\nexport default CartSummary;\n","import styled from 'styled-components';\n\n// export const CartTableHeader = styled.div`\n// width: 100%;\n// display: flex;\n// flex-direction: row;\n// align-items: center;\n// background-color: red;\n// min-height: 80px;\n// position: sticky;\n// top: 0;\n// right: 0;\n// z-index: 1;\n// `;\n\nexport const CartPageCard = styled.div`\n width: min(97%, 485px);\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n padding: 1rem;\n background: #ffffff;\n box-shadow: 0px 20px 35px rgba(0, 0, 0, 0.05);\n border-radius: 20px;\n position: relative;\n`;\n\nexport const CartPageImg = styled.img`\n /* width: 95px; */\n width: ${(props) => props.width || 'auto'};\n height: ${(props) => props.height || '81px'};\n position: relative;\n margin-right: 1em;\n`;\nexport const NameAndQtBox = styled.div`\n width: 90%;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: space-between;\n position: relative;\n`;\nexport const CartPageCardName = styled.div`\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n align-items: flex-start;\n width: 90%;\n overflow: hidden;\n text-overflow: ellipsis;\n margin-bottom: 0.6em;\n h6 {\n color: #323232;\n font-size: 0.9em;\n margin-bottom: 0.6em;\n line-height: 1.3rem;\n max-height: 1.4rem;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n p {\n font-size: 1.1em;\n color: #c3c6c9;\n }\n`;\n\nexport const QtAndPriceBox = styled.div`\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n width: 100%;\n .subtotal {\n color: #323232;\n text-transform: capitalize;\n font-weight: bold;\n font-size: 0.85em;\n }\n`;\n\nexport const CartPageQtBox = styled.div`\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n max-width: 80px;\n min-width: 80px;\n height: 22px;\n .icon {\n width: 20.5px;\n height: 20.5px;\n display: grid;\n place-items: center;\n font-size: 10px;\n background: #eef1f4;\n cursor: pointer;\n }\n .qt {\n font-size: 18px;\n font-weight: 500;\n display: grid;\n place-items: center;\n color: #c3c6c9;\n }\n`;\n\nexport const CloseBtn = styled.div`\n width: 25px;\n height: 25px;\n display: grid;\n place-items: center;\n position: absolute;\n top: 1em;\n right: 1em;\n cursor: pointer;\n border-radius: 50%;\n background: #eef1f4;\n font-size: 12px;\n`;\n","import { Tooltip } from '@mui/material';\nimport React from 'react';\nimport { AiOutlineMinus, AiOutlinePlus, AiOutlineClose } from 'react-icons/ai';\nimport {\n CartPageCard,\n CartPageCardName,\n CartPageImg,\n CartPageQtBox,\n CloseBtn,\n NameAndQtBox,\n QtAndPriceBox,\n} from './Card.styles';\n\nconst CartPageProductCard = ({\n item,\n imgnotfoundUrl,\n handleIncrementDecrement,\n handleRemoveProduct,\n loading,\n imgSize,\n}) => {\n let imgnotfoundUrlcommon = '/images/imgnotfound.jpeg';\n if (imgnotfoundUrl && imgnotfoundUrl !== 'null')\n imgnotfoundUrlcommon = imgnotfoundUrl;\n\n return (\n <CartPageCard>\n <CartPageImg\n src={\n item.imageUrl && item.imageUrl !== 'null'\n ? item.imageUrl\n : imgnotfoundUrlcommon\n }\n alt={'no product image available'}\n width={imgSize?.width}\n height={imgSize?.height}\n />\n <NameAndQtBox>\n <CartPageCardName>\n <Tooltip title={item.productName} placement=\"top\" arrow>\n <h6>{item.productName}</h6>\n </Tooltip>\n <p>${item.standardPrice?.toFixed(2)}</p>\n </CartPageCardName>\n <QtAndPriceBox>\n <CartPageQtBox>\n <span\n className=\"icon\"\n onClick={() => {\n if (loading) return;\n handleIncrementDecrement('decrement', item);\n }}\n >\n <AiOutlineMinus />\n </span>\n <span className=\"qt\">{item.quantity}</span>\n <span\n className=\"icon\"\n onClick={() => {\n if (loading) return;\n handleIncrementDecrement('increment', item);\n }}\n >\n <AiOutlinePlus />\n </span>\n </CartPageQtBox>\n <p className=\"subtotal\">\n subtotal: ${(item.standardPrice * item.quantity).toFixed(2)}\n </p>\n </QtAndPriceBox>\n </NameAndQtBox>\n <CloseBtn\n onClick={() => {\n if (loading) return;\n handleRemoveProduct(item);\n }}\n >\n <AiOutlineClose />\n </CloseBtn>\n </CartPageCard>\n );\n};\n\nexport default CartPageProductCard;\n","import React from 'react';\nimport styled from 'styled-components';\nimport CartSummary from './CartSummary';\nimport { CartHeader, CartTableHeader } from './ProductCard/Card.styles';\nimport CartPageProductCard from './ProductCard/CartPageCard';\nexport const CartPageContainer = styled.div`\n width: 100%;\n max-width: ${(props) => props.maxWidth || '1350px'};\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: flex-start;\n\n .scrollDiv {\n width: 68%;\n height: 630px;\n max-height: 630px;\n background-color: white;\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n margin-right: 0.3em;\n &::-webkit-scrollbar {\n width: ${(props) => (props.retail ? '12px' : '8px')};\n }\n\n /* Track */\n &::-webkit-scrollbar-track {\n background: ${(props) =>\n props.retail ? '#667080' : 'rgba(102, 112, 128, 0.5)'};\n border-radius: 16px;\n }\n\n /* Handle */\n &::-webkit-scrollbar-thumb {\n background: ${(props) => (props.retail ? '#BFC3CA' : '#EDEDED')};\n border-radius: 16px;\n margin: 5px 2px;\n border: 3px solid;\n border-color: ${(props) =>\n props.retail ? '#667080' : 'rgba(102, 112, 128, 0.5)'};\n }\n box-shadow: 0px 20px 35px rgba(0, 0, 0, 0.05);\n }\n @media only screen and (max-width: 840px) {\n flex-direction: column;\n .scrollDiv {\n width: 100%;\n margin: 0;\n margin-bottom: 2em;\n padding: 0 0.4em;\n }\n }\n`;\nconst CardsBox = styled.div`\n width: 100%;\n /* min-height: 1000px; */\n position: relative;\n max-width: 860px;\n margin-right: auto;\n padding: 1em 2em;\n display: ${(props) => (props.retail ? 'grid' : 'flex')};\n grid-template-columns: 1fr 1fr;\n flex-direction: column;\n align-items: flex-start;\n grid-gap: 1em;\n justify-content: flex-start;\n align-items: center;\n border-radius: 20px;\n @media only screen and (max-width: 1220px) {\n display: flex;\n }\n @media only screen and (max-width: 640px) {\n padding: 1em 0.2em;\n }\n`;\nconst CartPageComponent = ({\n retail,\n shippingData,\n selectedShipping,\n setShipping,\n clickRedirect,\n cartData,\n handleIncrementDecrement,\n handleRemoveProduct,\n loading,\n imgnotfoundUrl,\n styles\n}) => {\n return (\n <CartPageContainer retail={retail}>\n <div className=\"scrollDiv\">\n {/* <CartTableHeader> div</CartTableHeader> */}\n <CardsBox retail={retail}>\n {cartData?.cartLineItemDtoList?.map((item) => (\n <CartPageProductCard\n item={item}\n loading={loading}\n imgnotfoundUrl={imgnotfoundUrl}\n handleIncrementDecrement={handleIncrementDecrement}\n handleRemoveProduct={handleRemoveProduct}\n imgSize={styles?.imgSize}\n />\n ))}\n </CardsBox>\n </div>\n <CartSummary\n retail={retail}\n shippingData={shippingData}\n selectedShipping={selectedShipping}\n setShipping={setShipping}\n clickRedirect={clickRedirect}\n subtotal={cartData?.totalCartPrice}\n styles={styles?.cartSummary}\n />\n </CartPageContainer>\n );\n};\n\nexport default CartPageComponent;\n","class Breakpoint {\n static xs = 'xs';\n static sm = 'sm';\n static md = 'md';\n static lg = 'lg';\n static xl = 'xl';\n static xxl = 'xxl';\n}\n\nexport default Breakpoint;\n","class Variant {\n static ONE = 'one';\n static TWO = 'two';\n static THREE = 'three';\n}\n\nexport default Variant;\n","export default function debounce(func, wait, immediate) {\n let timeout;\n return function (...args) {\n clearTimeout(timeout);\n timeout = setTimeout(() => {\n timeout = null;\n if (!immediate) func.apply(this, args);\n }, wait);\n if (immediate && !timeout) func.apply(this, [...args]);\n };\n}\n","import { useEffect, useState } from 'react';\nimport debounce from '../utils/debounce';\n\nfunction useWindowSize() {\n const isWindow = typeof window !== 'undefined';\n const [windowSize, setWindowSize] = useState({\n width: isWindow ? window.innerWidth : 1200,\n height: isWindow ? window.innerHeight : 800,\n });\n\n useEffect(() => {\n const onWindowResize = () => {\n setWindowSize({\n width: window.innerWidth,\n height: window.innerHeight,\n });\n };\n\n const onResize = debounce(onWindowResize, 100);\n\n window.addEventListener('resize', onResize);\n onWindowResize();\n\n return () => {\n window.removeEventListener('resize', onResize);\n };\n }, []);\n\n return windowSize;\n}\n\nexport default useWindowSize;\n","import { useEffect, useState } from 'react';\nimport useWindowSize from './useWindowSize';\nimport { Breakpoint } from '../constants';\n\n/*\n The breakpoints of responsive grid follow Google chrome media queries rules\n*/\nconst getBreakpoint = ({ width: screen }) => {\n let breakpoint = '';\n\n if (screen <= 320) {\n breakpoint = Breakpoint.xs;\n }\n if (screen >= 375) {\n breakpoint = Breakpoint.sm;\n }\n if (screen >= 768) {\n breakpoint = Breakpoint.md;\n }\n if (screen >= 992) {\n breakpoint = Breakpoint.lg;\n }\n if (screen >= 1200) {\n breakpoint = Breakpoint.xl;\n }\n if (screen >= 1600) {\n breakpoint = Breakpoint.xxl;\n }\n\n return breakpoint;\n};\n\nfunction useGridSize() {\n const windowSize = useWindowSize();\n const [layout, setLayout] = useState(Breakpoint.md);\n\n useEffect(() => {\n setLayout(getBreakpoint(windowSize));\n }, [windowSize]);\n return layout;\n}\n\nexport default useGridSize;\n"],"names":["CartDrawerContainer","styled","div","props","maxWidth","fontFamily","CartDrawerBar","CartDrawerProductContainer","opacity","CartDrawerBottomSection","CartDrawerOutlinedButton","button","color","CartDrawerFilledButton","CartDrawerEmptyCart","CartDrawerProduct","CartDrawerQtBox","CartDrawerLoader","CartDrawerProductCard","product","handleIncrementDecrement","handleRemoveProduct","handleRedirect","imgnotfoundUrl","loading","imgnotfoundUrlcommon","imageUrl","productName","standardPrice","cartStandardPrice","toFixed","quantity","CartDrawer","cartData","handleClose","totalCartQuantity","cartLineItemDtoList","map","i","totalCartPrice","CartSummaryContainer","background","CartSummaryRow","justify","h5","CartSummaryHr","hr","CartSummaryInputBox","form","paddingBottom","btn","CartSummaryCheckoutBtn","CartSummaryCheckBoxRow","selected","CartSummary","retail","shippingData","selectedShipping","setShipping","clickRedirect","subtotal","styles","console","log","bg","width","li","id","name","amount","input","btnColor","CartPageCard","CartPageImg","img","height","NameAndQtBox","CartPageCardName","QtAndPriceBox","CartPageQtBox","CloseBtn","CartPageProductCard","item","imgSize","CartPageContainer","CardsBox","CartPageComponent","cartSummary","Breakpoint","xs","sm","md","lg","xl","xxl","Variant","ONE","TWO","THREE","debounce","func","wait","immediate","timeout","args","clearTimeout","setTimeout","apply","useWindowSize","isWindow","window","useState","innerWidth","innerHeight","windowSize","setWindowSize","useEffect","onWindowResize","onResize","addEventListener","removeEventListener","getBreakpoint","screen","breakpoint","useGridSize","layout","setLayout"],"mappings":";;;;;;;;;;;;;;;;;;;;AACO,IAAMA,mBAAmB,GAAGC,MAAM,CAACC,GAAV,oXAEjB,UAACC,KAAD;EAAA,OAAWA,KAAK,CAACC,QAAN,IAAkB,OAA7B;AAAA,CAFiB,EAIf,UAACD,KAAD;EAAA,OAAWA,KAAK,CAACE,UAAjB;AAAA,CAJe,CAAzB;AAgBA,IAAMC,aAAa,GAAGL,MAAM,CAACC,GAAV,0jBAAnB;AA2BA,IAAMK,0BAA0B,GAAGN,MAAM,CAACC,GAAV,+aAW1B,UAACC,KAAD;EAAA,OAAWA,KAAK,CAACK,OAAjB;AAAA,CAX0B,CAAhC;AAkBA,IAAMC,uBAAuB,GAAGR,MAAM,CAACC,GAAV,2uBAA7B;AAoCA,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