@pelcro/react-pelcro-js 3.2.0-beta.28 → 3.2.0-beta.30

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.cjs.js CHANGED
@@ -16025,7 +16025,7 @@ const CouponCode = ({
16025
16025
  };
16026
16026
 
16027
16027
  return /*#__PURE__*/React__default['default'].createElement("div", {
16028
- className: "plc-mt-4"
16028
+ className: "plc-mt-4 plc-mb-6"
16029
16029
  }, /*#__PURE__*/React__default['default'].createElement(Button, Object.assign({
16030
16030
  className: "plc-mb-2 plc-text-base plc-text-gray-500",
16031
16031
  variant: "ghost",
@@ -20660,7 +20660,7 @@ const CartModal = ({
20660
20660
  CartModal.viewId = "cart";
20661
20661
 
20662
20662
  const ShopSelectProductButton = ({
20663
- itemId,
20663
+ item,
20664
20664
  onClick,
20665
20665
  ...otherProps
20666
20666
  }) => {
@@ -20676,7 +20676,8 @@ const ShopSelectProductButton = ({
20676
20676
  const handleClick = () => {
20677
20677
  setDisabled(true);
20678
20678
  setTextContent(t("buttons.added"));
20679
- addToCart(itemId);
20679
+ addToCart(item.id);
20680
+ document.dispatchEvent(cartItemAdded(item));
20680
20681
  onClick === null || onClick === void 0 ? void 0 : onClick();
20681
20682
  setTimeout(() => {
20682
20683
  setDisabled(false);
@@ -20685,8 +20686,8 @@ const ShopSelectProductButton = ({
20685
20686
  };
20686
20687
 
20687
20688
  return /*#__PURE__*/React__default['default'].createElement(Button, Object.assign({
20688
- "data-sku-id": itemId,
20689
- id: `pelcro-shop-select-${itemId}`,
20689
+ "data-sku-id": item.id,
20690
+ id: `pelcro-shop-select-${item.id}`,
20690
20691
  onClick: handleClick,
20691
20692
  disabled: disabled
20692
20693
  }, otherProps), textContent);
@@ -20730,9 +20731,8 @@ const ShopView = () => {
20730
20731
  }, item.name), /*#__PURE__*/React__default['default'].createElement("p", {
20731
20732
  className: "plc-font-bold pelcro-shop-product-description"
20732
20733
  }, item.description), /*#__PURE__*/React__default['default'].createElement(ShopSelectProductButton, {
20733
- itemId: item.id,
20734
- className: "plc-mt-2",
20735
- onClick: () => document.dispatchEvent(cartItemAdded(item))
20734
+ item: item,
20735
+ className: "plc-mt-2"
20736
20736
  }), /*#__PURE__*/React__default['default'].createElement(ShopPurchaseButton, {
20737
20737
  itemId: item.id,
20738
20738
  className: "plc-mt-2"
package/dist/index.esm.js CHANGED
@@ -15995,7 +15995,7 @@ const CouponCode = ({
15995
15995
  };
15996
15996
 
15997
15997
  return /*#__PURE__*/React__default.createElement("div", {
15998
- className: "plc-mt-4"
15998
+ className: "plc-mt-4 plc-mb-6"
15999
15999
  }, /*#__PURE__*/React__default.createElement(Button, Object.assign({
16000
16000
  className: "plc-mb-2 plc-text-base plc-text-gray-500",
16001
16001
  variant: "ghost",
@@ -20630,7 +20630,7 @@ const CartModal = ({
20630
20630
  CartModal.viewId = "cart";
20631
20631
 
20632
20632
  const ShopSelectProductButton = ({
20633
- itemId,
20633
+ item,
20634
20634
  onClick,
20635
20635
  ...otherProps
20636
20636
  }) => {
@@ -20646,7 +20646,8 @@ const ShopSelectProductButton = ({
20646
20646
  const handleClick = () => {
20647
20647
  setDisabled(true);
20648
20648
  setTextContent(t("buttons.added"));
20649
- addToCart(itemId);
20649
+ addToCart(item.id);
20650
+ document.dispatchEvent(cartItemAdded(item));
20650
20651
  onClick === null || onClick === void 0 ? void 0 : onClick();
20651
20652
  setTimeout(() => {
20652
20653
  setDisabled(false);
@@ -20655,8 +20656,8 @@ const ShopSelectProductButton = ({
20655
20656
  };
20656
20657
 
20657
20658
  return /*#__PURE__*/React__default.createElement(Button, Object.assign({
20658
- "data-sku-id": itemId,
20659
- id: `pelcro-shop-select-${itemId}`,
20659
+ "data-sku-id": item.id,
20660
+ id: `pelcro-shop-select-${item.id}`,
20660
20661
  onClick: handleClick,
20661
20662
  disabled: disabled
20662
20663
  }, otherProps), textContent);
@@ -20700,9 +20701,8 @@ const ShopView = () => {
20700
20701
  }, item.name), /*#__PURE__*/React__default.createElement("p", {
20701
20702
  className: "plc-font-bold pelcro-shop-product-description"
20702
20703
  }, item.description), /*#__PURE__*/React__default.createElement(ShopSelectProductButton, {
20703
- itemId: item.id,
20704
- className: "plc-mt-2",
20705
- onClick: () => document.dispatchEvent(cartItemAdded(item))
20704
+ item: item,
20705
+ className: "plc-mt-2"
20706
20706
  }), /*#__PURE__*/React__default.createElement(ShopPurchaseButton, {
20707
20707
  itemId: item.id,
20708
20708
  className: "plc-mt-2"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pelcro/react-pelcro-js",
3
3
  "description": "Pelcro's React UI Elements",
4
- "version": "3.2.0-beta.28",
4
+ "version": "3.2.0-beta.30",
5
5
  "license": "MIT",
6
6
  "private": false,
7
7
  "main": "dist/index.cjs.js",