@caseparts-org/caseblocks 0.0.34 → 0.0.36
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/main-client.d.ts +1 -0
- package/dist/molecules/Cart/Cart.js +24 -24
- package/package.json +1 -1
package/dist/main-client.d.ts
CHANGED
|
@@ -14,3 +14,4 @@ export { MainNav } from './organisms/MainNav/MainNav';
|
|
|
14
14
|
export type { MainCategory, MainNavProps, Category } from './organisms/MainNav/MainNav';
|
|
15
15
|
export { ChipSelector } from './organisms/ChipSelector/ChipSelector';
|
|
16
16
|
export type { ChipSelectorProps } from './organisms/ChipSelector/ChipSelector';
|
|
17
|
+
export type { ShoppingCart, CartItem } from './molecules/Cart/Cart';
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
1
|
+
import { jsx as t, jsxs as s } from "react/jsx-runtime";
|
|
2
2
|
import { Icon as o } from "../../atoms/Icon/Icon.js";
|
|
3
3
|
import { Text as m } from "../../atoms/Text/Text.js";
|
|
4
4
|
import { Button as g } from "../../atoms/Button/Button.js";
|
|
5
5
|
import { Tooltip as _ } from "../Tooltip/Tooltip.js";
|
|
6
6
|
import { QuantityInput as p } from "../QuantityInput/QuantityInput.js";
|
|
7
|
-
import '../../assets/Cart.css';const
|
|
8
|
-
cart:
|
|
9
|
-
count:
|
|
7
|
+
import '../../assets/Cart.css';const u = "_cart_tgc5k_1", I = "_count_tgc5k_8", f = "_cartContainer_tgc5k_23", k = "_cartItems_tgc5k_32", v = "_itemInfo_tgc5k_54", y = "_removeItem_tgc5k_71", z = "_itemManagement_tgc5k_78", C = "_noItems_tgc5k_83", N = "_subtotal_tgc5k_90", e = {
|
|
8
|
+
cart: u,
|
|
9
|
+
count: I,
|
|
10
10
|
cartContainer: f,
|
|
11
11
|
cartItems: k,
|
|
12
12
|
itemInfo: v,
|
|
13
|
-
removeItem:
|
|
14
|
-
itemManagement:
|
|
15
|
-
noItems:
|
|
16
|
-
subtotal:
|
|
13
|
+
removeItem: y,
|
|
14
|
+
itemManagement: z,
|
|
15
|
+
noItems: C,
|
|
16
|
+
subtotal: N
|
|
17
17
|
};
|
|
18
|
-
function
|
|
18
|
+
function Q({
|
|
19
19
|
cart: i,
|
|
20
20
|
onItemQtyChange: a,
|
|
21
21
|
onItemDelete: r,
|
|
@@ -27,7 +27,7 @@ function T({
|
|
|
27
27
|
return i = i || { items: [] }, /* @__PURE__ */ t(
|
|
28
28
|
_,
|
|
29
29
|
{
|
|
30
|
-
trigger: /* @__PURE__ */
|
|
30
|
+
trigger: /* @__PURE__ */ s("button", { className: e.cart, ...d, children: [
|
|
31
31
|
/* @__PURE__ */ t(
|
|
32
32
|
o,
|
|
33
33
|
{
|
|
@@ -40,27 +40,27 @@ function T({
|
|
|
40
40
|
] }),
|
|
41
41
|
position: "bottom",
|
|
42
42
|
on: "click",
|
|
43
|
-
children: /* @__PURE__ */
|
|
43
|
+
children: /* @__PURE__ */ s("div", { className: e.cartContainer, children: [
|
|
44
44
|
/* @__PURE__ */ t(m, { as: "h1", size: "2xl", children: "Cart" }),
|
|
45
45
|
/* @__PURE__ */ t("div", { className: e.cartItems, children: i.items.length > 0 ? /* @__PURE__ */ t("ul", { children: i.items.map(
|
|
46
|
-
(
|
|
47
|
-
/* @__PURE__ */
|
|
48
|
-
/* @__PURE__ */ t("img", { src:
|
|
49
|
-
/* @__PURE__ */
|
|
50
|
-
/* @__PURE__ */ t(m, { as: "p", size: "sm", children:
|
|
51
|
-
/* @__PURE__ */
|
|
46
|
+
(n) => /* @__PURE__ */ s("li", { className: e.cartItem, children: [
|
|
47
|
+
/* @__PURE__ */ s("div", { className: e.itemInfo, children: [
|
|
48
|
+
/* @__PURE__ */ t("img", { src: n.imageUrl, alt: `${n.itemId} product image` }),
|
|
49
|
+
/* @__PURE__ */ s("div", { children: [
|
|
50
|
+
/* @__PURE__ */ t(m, { as: "p", size: "sm", children: n.description }),
|
|
51
|
+
/* @__PURE__ */ s(m, { as: "p", size: "sm", children: [
|
|
52
52
|
"Part # ",
|
|
53
|
-
|
|
53
|
+
n.itemId
|
|
54
54
|
] })
|
|
55
55
|
] })
|
|
56
56
|
] }),
|
|
57
|
-
/* @__PURE__ */
|
|
58
|
-
/* @__PURE__ */ t("button", { onClick: () => r(
|
|
59
|
-
/* @__PURE__ */ t(p, { onQuantityChange: (h) => a(
|
|
57
|
+
/* @__PURE__ */ s("div", { className: e.itemManagement, children: [
|
|
58
|
+
/* @__PURE__ */ t("button", { onClick: () => r(n), className: e.removeItem, children: /* @__PURE__ */ t(o, { iconKey: "fa-regular fa-trash", size: "sm" }) }),
|
|
59
|
+
/* @__PURE__ */ t(p, { quantity: n.quantity, onQuantityChange: (h) => a(n, h), size: "sm" })
|
|
60
60
|
] })
|
|
61
|
-
] },
|
|
61
|
+
] }, n.id)
|
|
62
62
|
) }) : /* @__PURE__ */ t("div", { className: e.noItems, children: /* @__PURE__ */ t(m, { as: "p", size: "sm", children: "No items in your cart yet" }) }) }),
|
|
63
|
-
c && /* @__PURE__ */
|
|
63
|
+
c && /* @__PURE__ */ s("div", { className: e.subtotal, children: [
|
|
64
64
|
/* @__PURE__ */ t(m, { size: "md", children: "Subtotal" }),
|
|
65
65
|
/* @__PURE__ */ t(m, { size: "md", children: c })
|
|
66
66
|
] }),
|
|
@@ -70,5 +70,5 @@ function T({
|
|
|
70
70
|
);
|
|
71
71
|
}
|
|
72
72
|
export {
|
|
73
|
-
|
|
73
|
+
Q as ShoppingCart
|
|
74
74
|
};
|