pixelize-design-library 2.2.63 → 2.2.75

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
1
  import React from "react";
2
2
  import { ProductCardProps } from "./ProductCardProps";
3
- declare const ProductCard: ({ id, label, productImage, rating, reviews, tags, options, button, batch, description, avalabilitys, onAddToCart, onClick, size, }: ProductCardProps) => React.JSX.Element;
3
+ declare const ProductCard: ({ id, label, productImage, rating, reviews, tags, options, button, batch, description, avalabilitys, onAddToCart, onClick, addToCart, goToCart, OnGoToCart, size, }: ProductCardProps) => React.JSX.Element;
4
4
  export default ProductCard;
@@ -36,7 +36,7 @@ var ProductLabel_1 = __importDefault(require("./ProductLabel"));
36
36
  var useCustomTheme_1 = require("../../Theme/useCustomTheme");
37
37
  var ProductCard = function (_a) {
38
38
  var _b;
39
- var id = _a.id, label = _a.label, productImage = _a.productImage, rating = _a.rating, reviews = _a.reviews, tags = _a.tags, options = _a.options, button = _a.button, batch = _a.batch, description = _a.description, avalabilitys = _a.avalabilitys, onAddToCart = _a.onAddToCart, onClick = _a.onClick, _c = _a.size, size = _c === void 0 ? "sm" : _c;
39
+ var id = _a.id, label = _a.label, productImage = _a.productImage, rating = _a.rating, reviews = _a.reviews, tags = _a.tags, options = _a.options, button = _a.button, batch = _a.batch, description = _a.description, avalabilitys = _a.avalabilitys, onAddToCart = _a.onAddToCart, onClick = _a.onClick, addToCart = _a.addToCart, goToCart = _a.goToCart, OnGoToCart = _a.OnGoToCart, _c = _a.size, size = _c === void 0 ? "sm" : _c;
40
40
  var _d = (0, react_1.useState)(false), hover = _d[0], setHover = _d[1];
41
41
  var theme = (0, useCustomTheme_1.useCustomTheme)();
42
42
  var sizeStyles = {
@@ -73,6 +73,7 @@ var ProductCard = function (_a) {
73
73
  tags && react_1.default.createElement(ProductTags_1.default, { tags: tags, size: size }),
74
74
  options && react_1.default.createElement(ProductPrice_1.default, { options: options, size: size }),
75
75
  (button === null || button === void 0 ? void 0 : button.onClick) && (react_1.default.createElement(Button_1.default, { colorScheme: "red", size: safeSize, width: "100%", onClick: button === null || button === void 0 ? void 0 : button.onClick }, (_b = button.label) !== null && _b !== void 0 ? _b : "Add to Cart")),
76
- onAddToCart && (react_1.default.createElement(Button_1.default, { width: "100%", size: safeSize, onClick: function () { return onAddToCart === null || onAddToCart === void 0 ? void 0 : onAddToCart(id); }, colorScheme: "red" }, "Add to Cart")))));
76
+ addToCart && (react_1.default.createElement(Button_1.default, { width: "100%", size: safeSize, onClick: function () { return onAddToCart === null || onAddToCart === void 0 ? void 0 : onAddToCart(id); }, colorScheme: "red" }, "Add to Cart")),
77
+ goToCart && (react_1.default.createElement(Button_1.default, { width: "100%", size: safeSize, onClick: OnGoToCart, colorScheme: "red" }, "Go to Cart")))));
77
78
  };
78
79
  exports.default = ProductCard;
@@ -14,6 +14,9 @@ export type ProductCardProps = {
14
14
  onClick: () => void;
15
15
  };
16
16
  onAddToCart?: (id: string | number) => void;
17
+ addToCart?: boolean;
18
+ goToCart?: boolean;
19
+ OnGoToCart?: () => void;
17
20
  batch?: batch;
18
21
  size?: SizeType;
19
22
  avalabilitys?: boolean;
@@ -1,4 +1,4 @@
1
1
  import React from "react";
2
2
  import { ProductDetailsProps } from "./ProductDetailsProps";
3
- declare const ProductDetails: ({ id, price, label, shortdesc, tags, images, batch, category, onAddToCart, }: ProductDetailsProps) => React.JSX.Element;
3
+ declare const ProductDetails: ({ id, price, label, shortdesc, tags, images, batch, category, onAddToCart, addToCart, goToCart, OnGoToCart, }: ProductDetailsProps) => React.JSX.Element;
4
4
  export default ProductDetails;
@@ -13,7 +13,7 @@ var useCustomTheme_1 = require("../../Theme/useCustomTheme");
13
13
  var Button_1 = __importDefault(require("../Button/Button"));
14
14
  var lucide_react_1 = require("lucide-react");
15
15
  var ProductDetails = function (_a) {
16
- var id = _a.id, price = _a.price, label = _a.label, shortdesc = _a.shortdesc, tags = _a.tags, images = _a.images, batch = _a.batch, category = _a.category, onAddToCart = _a.onAddToCart;
16
+ var id = _a.id, price = _a.price, label = _a.label, shortdesc = _a.shortdesc, tags = _a.tags, images = _a.images, batch = _a.batch, category = _a.category, onAddToCart = _a.onAddToCart, addToCart = _a.addToCart, goToCart = _a.goToCart, OnGoToCart = _a.OnGoToCart;
17
17
  var theme = (0, useCustomTheme_1.useCustomTheme)();
18
18
  return (react_1.default.createElement(react_2.Flex, { direction: ["column", "row"], maxW: "6xl", mx: "auto", align: "start", gap: 5 },
19
19
  react_1.default.createElement(react_2.Box, { position: "relative", color: "white", borderRadius: "md", flex: "1", minH: "31.25rem" },
@@ -23,6 +23,7 @@ var ProductDetails = function (_a) {
23
23
  react_1.default.createElement(react_2.Text, { fontSize: "md", color: theme.colors.gray[700], my: 3 }, shortdesc),
24
24
  tags && react_1.default.createElement(ProductTags_1.default, { tags: tags, size: "sm" }),
25
25
  price && react_1.default.createElement(ProductDtlPrice_1.default, { price: price }),
26
- react_1.default.createElement(Button_1.default, { size: "sm", colorScheme: "red", leftIcon: react_1.default.createElement(lucide_react_1.ShoppingCartIcon, null), sx: { ml: "1.1rem" }, onClick: function () { return onAddToCart === null || onAddToCart === void 0 ? void 0 : onAddToCart(id); } }, "Add to cart"))));
26
+ addToCart && (react_1.default.createElement(Button_1.default, { size: "sm", colorScheme: "red", leftIcon: react_1.default.createElement(lucide_react_1.ShoppingCartIcon, null), sx: { ml: "1.1rem" }, onClick: function () { return onAddToCart === null || onAddToCart === void 0 ? void 0 : onAddToCart(id); } }, "Add to cart")),
27
+ goToCart && (react_1.default.createElement(Button_1.default, { size: "sm", colorScheme: "red", leftIcon: react_1.default.createElement(lucide_react_1.ShoppingCartIcon, null), sx: { ml: "1.1rem" }, onClick: OnGoToCart }, "Go to cart")))));
27
28
  };
28
29
  exports.default = ProductDetails;
@@ -9,6 +9,9 @@ export type ProductDetailsProps = {
9
9
  batch?: batch;
10
10
  category?: string;
11
11
  onAddToCart?: (id: string | number) => void;
12
+ addToCart?: boolean;
13
+ goToCart?: boolean;
14
+ OnGoToCart?: () => void;
12
15
  };
13
16
  export type price = {
14
17
  label: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pixelize-design-library",
3
- "version": "2.2.63",
3
+ "version": "2.2.75",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",