@springmicro/cart 0.3.2 → 0.3.5

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.
Files changed (35) hide show
  1. package/.eslintrc.cjs +21 -21
  2. package/README.md +64 -64
  3. package/dist/index.js +9778 -9696
  4. package/dist/index.umd.cjs +66 -92
  5. package/package.json +5 -3
  6. package/src/AddToCartForm.tsx +16 -16
  7. package/src/CartButton.tsx +249 -249
  8. package/src/ProductCard.css +106 -106
  9. package/src/ProductCard.tsx +165 -165
  10. package/src/checkout/{CheckoutList.css → ReviewCartAndCalculateTaxes.css} +93 -93
  11. package/src/checkout/ReviewCartAndCalculateTaxes.tsx +366 -0
  12. package/src/checkout/components/AddCard.tsx +267 -0
  13. package/src/checkout/components/Address.tsx +261 -265
  14. package/src/checkout/components/CartList.tsx +151 -0
  15. package/src/checkout/components/CartProductCard.css +67 -67
  16. package/src/checkout/components/CartProductCard.tsx +90 -80
  17. package/src/checkout/components/Invoice.tsx +145 -0
  18. package/src/checkout/components/ProviderLogos.tsx +93 -93
  19. package/src/checkout/components/StatusBar.tsx +32 -0
  20. package/src/checkout/index.tsx +161 -0
  21. package/src/index.css +5 -5
  22. package/src/index.ts +36 -35
  23. package/src/types.d.ts +56 -56
  24. package/src/utils/api.ts +67 -67
  25. package/src/utils/cartAuthHandler.ts +50 -50
  26. package/src/utils/index.ts +28 -28
  27. package/src/utils/storage.ts +133 -133
  28. package/tsconfig.json +24 -24
  29. package/tsconfig.node.json +11 -11
  30. package/vite.config.ts +25 -25
  31. package/springmicro-cart-0.2.3.tgz +0 -0
  32. package/src/checkout/CheckoutList.tsx +0 -264
  33. package/src/checkout/components/Billing.tsx +0 -353
  34. package/src/checkout/components/Order.tsx +0 -93
  35. package/src/checkout/components/index.tsx +0 -104
@@ -1,67 +1,67 @@
1
- .product-card {
2
- width: 500px;
3
- /* display: flex;
4
- flex-direction: row;
5
- justify-content: space-between; */
6
- display: grid;
7
- grid-template-columns: 1fr 40px;
8
- gap: 0.5rem;
9
- border-radius: 8px;
10
- padding: 1rem;
11
- box-shadow: 0px 0px 0px 0px rgba(0, 0, 0, 0);
12
- transition: all 0.3s 0.1s;
13
- cursor: pointer;
14
- min-height: 48px;
15
- flex-shrink: 0;
16
- }
17
-
18
- .product-card:hover {
19
- box-shadow: 0px 2px 5px 2px #dfdfdfff;
20
- transition: all 0.3s 0s;
21
- }
22
-
23
- .left-section {
24
- display: flex;
25
- flex-direction: row;
26
- gap: 1rem;
27
- flex-grow: 1;
28
- }
29
-
30
- .left-section > img,
31
- .missing-image {
32
- min-height: 100%;
33
- max-height: 100px;
34
- aspect-ratio: 1;
35
- border-radius: 6px;
36
- overflow: hidden;
37
- }
38
-
39
- .missing-image {
40
- background-color: rgb(222, 222, 222);
41
- }
42
-
43
- .two-row {
44
- display: flex;
45
- flex-direction: column;
46
- }
47
-
48
- .two-row :nth-child(1) {
49
- font-size: 20px;
50
- }
51
-
52
- .two-row :nth-child(2) {
53
- font-size: 14px;
54
- }
55
-
56
- .two-row > * {
57
- margin: 0;
58
- }
59
-
60
- .remove-button {
61
- color: transparent !important;
62
- transition: all 0.2s !important;
63
- }
64
-
65
- .product-card:hover .remove-button {
66
- color: red !important;
67
- }
1
+ .product-card {
2
+ width: 500px;
3
+ /* display: flex;
4
+ flex-direction: row;
5
+ justify-content: space-between; */
6
+ display: grid;
7
+ grid-template-columns: 1fr 40px;
8
+ gap: 0.5rem;
9
+ border-radius: 8px;
10
+ padding: 1rem;
11
+ box-shadow: 0px 0px 0px 0px rgba(0, 0, 0, 0);
12
+ transition: all 0.3s 0.1s;
13
+ cursor: pointer;
14
+ min-height: 48px;
15
+ flex-shrink: 0;
16
+ }
17
+
18
+ .product-card:hover {
19
+ box-shadow: 0px 2px 5px 2px #dfdfdfff;
20
+ transition: all 0.3s 0s;
21
+ }
22
+
23
+ .left-section {
24
+ display: flex;
25
+ flex-direction: row;
26
+ gap: 1rem;
27
+ flex-grow: 1;
28
+ }
29
+
30
+ .left-section > img,
31
+ .missing-image {
32
+ min-height: 100%;
33
+ max-height: 100px;
34
+ aspect-ratio: 1;
35
+ border-radius: 6px;
36
+ overflow: hidden;
37
+ }
38
+
39
+ .missing-image {
40
+ background-color: rgb(222, 222, 222);
41
+ }
42
+
43
+ .two-row {
44
+ display: flex;
45
+ flex-direction: column;
46
+ }
47
+
48
+ .two-row :nth-child(1) {
49
+ font-size: 20px;
50
+ }
51
+
52
+ .two-row :nth-child(2) {
53
+ font-size: 14px;
54
+ }
55
+
56
+ .two-row > * {
57
+ margin: 0;
58
+ }
59
+
60
+ .remove-button {
61
+ color: #ff000040 !important;
62
+ transition: all 0.2s !important;
63
+ }
64
+
65
+ .product-card:hover .remove-button {
66
+ color: red !important;
67
+ }
@@ -1,80 +1,90 @@
1
- import "./CartProductCard.css";
2
- import { Tooltip, IconButton, Typography } from "@mui/material";
3
- import CloseIcon from "@mui/icons-material/Close";
4
- import React from "react";
5
- import { CartProduct } from "../../types";
6
- import { removeFromCart } from "../../utils/storage";
7
-
8
- export function CartProductCard({
9
- product,
10
- i,
11
- price,
12
- disableProductLink = false,
13
- }: {
14
- product: CartProduct;
15
- i: number;
16
- price: any;
17
- disableProductLink?: boolean;
18
- }) {
19
- const [hoverDelete, setHoverDelete] = React.useState(false);
20
- console.log(product);
21
- return (
22
- <a
23
- className="product-card"
24
- href={
25
- disableProductLink || hoverDelete
26
- ? undefined
27
- : `/product/${product.product_id}`
28
- }
29
- >
30
- <div className="left-section">
31
- {product.image ? <img /> : <div className="missing-image"></div>}
32
- <div className="two-row">
33
- <Typography>{product.name}</Typography>
34
- <Typography>
35
- {price
36
- ? `$${(price.unit_amount / 100).toFixed(2)}${
37
- price.recurring
38
- ? `/${
39
- price.recurring.interval_count > 1
40
- ? `${price.recurring.interval_count} `
41
- : ""
42
- }${price.recurring.interval}${
43
- price.recurring.interval_count > 1 ? "s" : ""
44
- }`
45
- : ""
46
- }`
47
- : "Loading price..."}
48
- </Typography>
49
- </div>
50
- </div>
51
- <div
52
- style={{
53
- display: "flex",
54
- flexGrow: 1,
55
- justifyContent: "center",
56
- alignItems: "center",
57
- }}
58
- >
59
- <Tooltip
60
- title="Remove from cart"
61
- onMouseEnter={() => {
62
- setHoverDelete(true);
63
- }}
64
- onMouseLeave={() => {
65
- setHoverDelete(false);
66
- }}
67
- >
68
- <IconButton
69
- className="remove-button"
70
- onClick={() => {
71
- removeFromCart(i);
72
- }}
73
- >
74
- <CloseIcon />
75
- </IconButton>
76
- </Tooltip>
77
- </div>
78
- </a>
79
- );
80
- }
1
+ import "./CartProductCard.css";
2
+ import { Tooltip, IconButton, Typography } from "@mui/material";
3
+ import CloseIcon from "@mui/icons-material/Close";
4
+ import React from "react";
5
+ import { CartProduct } from "../../types";
6
+ import { removeFromCart } from "../../utils/storage";
7
+
8
+ export function CartProductCard({
9
+ product,
10
+ i,
11
+ price,
12
+ disableProductLink = false,
13
+ disableMissingImage = false,
14
+ disableModification = false,
15
+ }: {
16
+ product: CartProduct;
17
+ i: number;
18
+ price: any;
19
+ disableProductLink?: boolean;
20
+ disableMissingImage?: boolean;
21
+ disableModification?: boolean;
22
+ }) {
23
+ const [hoverDelete, setHoverDelete] = React.useState(false);
24
+
25
+ return (
26
+ <a
27
+ className="product-card"
28
+ href={
29
+ disableProductLink || hoverDelete
30
+ ? undefined
31
+ : `/product/${product.product_id}`
32
+ }
33
+ >
34
+ <div className="left-section">
35
+ {product.image ? (
36
+ <img />
37
+ ) : (
38
+ !disableMissingImage && <div className="missing-image" />
39
+ )}
40
+ <div className="two-row">
41
+ <Typography>{product.name}</Typography>
42
+ <Typography>
43
+ {price
44
+ ? `$${(price.unit_amount / 100).toFixed(2)}${
45
+ price.recurring
46
+ ? `/${
47
+ price.recurring.interval_count > 1
48
+ ? `${price.recurring.interval_count} `
49
+ : ""
50
+ }${price.recurring.interval}${
51
+ price.recurring.interval_count > 1 ? "s" : ""
52
+ }`
53
+ : ""
54
+ }`
55
+ : "Loading price..."}
56
+ </Typography>
57
+ </div>
58
+ </div>
59
+ <div
60
+ style={{
61
+ display: "flex",
62
+ flexGrow: 1,
63
+ justifyContent: "center",
64
+ alignItems: "center",
65
+ }}
66
+ >
67
+ {!disableModification && (
68
+ <Tooltip
69
+ title="Remove from cart"
70
+ onMouseEnter={() => {
71
+ setHoverDelete(true);
72
+ }}
73
+ onMouseLeave={() => {
74
+ setHoverDelete(false);
75
+ }}
76
+ >
77
+ <IconButton
78
+ className="remove-button"
79
+ onClick={() => {
80
+ removeFromCart(i);
81
+ }}
82
+ >
83
+ <CloseIcon />
84
+ </IconButton>
85
+ </Tooltip>
86
+ )}
87
+ </div>
88
+ </a>
89
+ );
90
+ }
@@ -0,0 +1,145 @@
1
+ import { AddCard, type AddCardProps } from "./AddCard";
2
+ import { postCheckout } from "../../utils/api";
3
+ import React from "react";
4
+ import {
5
+ Alert,
6
+ Container,
7
+ Typography,
8
+ CircularProgress,
9
+ TableContainer,
10
+ Table,
11
+ TableHead,
12
+ TableRow,
13
+ TableCell,
14
+ Paper,
15
+ TableBody,
16
+ } from "@mui/material";
17
+
18
+ type CheckoutProps = AddCardProps & {
19
+ order: any;
20
+ invoiceId?: string;
21
+ successData;
22
+ };
23
+
24
+ export default function Invoice({
25
+ order,
26
+ invoiceId,
27
+ successData,
28
+ }: CheckoutProps) {
29
+ const currentUrl = new URL(window.location.href);
30
+ const formatter = new Intl.NumberFormat("en-US", {
31
+ style: "currency",
32
+ currency: "USD",
33
+ });
34
+
35
+ if (
36
+ successData !== null ||
37
+ // currentUrl.searchParams.get("showReceipt")
38
+ order.charge_id ||
39
+ !["pending", "awaiting_payment"].includes(order.status)
40
+ ) {
41
+ const print = (
42
+ <a
43
+ href="#"
44
+ onClick={() => {
45
+ window.print();
46
+ return false;
47
+ }}
48
+ style={{ textDecoration: "underline" }}
49
+ >
50
+ print
51
+ </a>
52
+ );
53
+ const text =
54
+ successData !== null ? (
55
+ <>
56
+ Payment received! An email was sent to{" "}
57
+ <strong>{successData.billing_information.email}</strong>. You can also{" "}
58
+ {print} this page for your records.
59
+ </>
60
+ ) : (
61
+ <>Payment received! You can {print} this page for your records.</>
62
+ );
63
+ return (
64
+ <>
65
+ <Container>
66
+ <Alert severity="success">{text}</Alert>
67
+ </Container>
68
+ <Container>
69
+ <Typography variant="h4" gutterBottom>
70
+ {invoiceId ? `Invoice #${invoiceId}` : "Order"}
71
+ </Typography>
72
+ <Typography variant="subtitle1">
73
+ Reference: {order.reference}
74
+ </Typography>
75
+ <Typography variant="subtitle1">
76
+ Date: {new Date(order.date).toLocaleDateString()}
77
+ </Typography>
78
+ <Typography variant="subtitle1">Status: {order.status}</Typography>
79
+ {order.customer ? (
80
+ <Typography variant="subtitle1">
81
+ {order.customer.first_name} {order.customer.last_name}
82
+ </Typography>
83
+ ) : (
84
+ <Typography variant="subtitle1">
85
+ Customer ID: {order.customer_id}
86
+ </Typography>
87
+ )}
88
+
89
+ <TableContainer component={Paper} sx={{ my: 2 }}>
90
+ <Table>
91
+ <TableHead>
92
+ <TableRow>
93
+ <TableCell>Item ID</TableCell>
94
+ <TableCell>Name</TableCell>
95
+ <TableCell>Description</TableCell>
96
+ <TableCell>Quantity</TableCell>
97
+ <TableCell>Unit Price</TableCell>
98
+ <TableCell>Total Price</TableCell>
99
+ </TableRow>
100
+ </TableHead>
101
+ <TableBody>
102
+ {order.basket.map((item) => (
103
+ <TableRow key={item.item_id}>
104
+ <TableCell>{item.item_id}</TableCell>
105
+ <TableCell>{item.name}</TableCell>
106
+ <TableCell>{item.description || "-"}</TableCell>
107
+ <TableCell>{item.quantity}</TableCell>
108
+ <TableCell>
109
+ {formatter.format(item.unit_price_cents / 100)}
110
+ </TableCell>
111
+ <TableCell>
112
+ {formatter.format(
113
+ (item.quantity * item.unit_price_cents) / 100
114
+ )}
115
+ </TableCell>
116
+ </TableRow>
117
+ ))}
118
+ </TableBody>
119
+ </Table>
120
+ </TableContainer>
121
+ </Container>
122
+ </>
123
+ );
124
+ }
125
+
126
+ // return (
127
+ // <>
128
+ // <Order order={order} invoiceId={invoiceId} />
129
+ // {isSubmitting ? (
130
+ // <Container>
131
+ // <Typography>
132
+ // <CircularProgress color="primary" /> Submitting...
133
+ // </Typography>
134
+ // </Container>
135
+ // ) : (
136
+ // <AddCard
137
+ // contact={order.customer}
138
+ // onSubmit={onSubmit}
139
+ // PriceDetails={PriceDetails}
140
+ // />
141
+ // )
142
+ // }
143
+ // </>
144
+ // );
145
+ }
@@ -1,93 +1,93 @@
1
- import { createSvgIcon } from "@mui/material";
2
- // Source: https://brandfolder.com/s/99gctvbpwgvzbc7mz3j9g4x
3
-
4
- export const PoweredByStripe = createSvgIcon(
5
- <svg
6
- id="Layer_1"
7
- data-name="Layer 1"
8
- xmlns="http://www.w3.org/2000/svg"
9
- viewBox="0 0 150 34"
10
- >
11
- <defs>
12
- <style>{`.cls-1{fill: #635bff}`}</style>
13
- </defs>
14
- <title>Powered by Stripe - blurple</title>
15
- <path
16
- className="cls-1"
17
- d="M146,0H3.73A3.73,3.73,0,0,0,0,3.73V30.27A3.73,3.73,0,0,0,3.73,34H146a4,4,0,0,0,4-4V4A4,4,0,0,0,146,0Zm3,30a3,3,0,0,1-3,3H3.73A2.74,2.74,0,0,1,1,30.27V3.73A2.74,2.74,0,0,1,3.73,1H146a3,3,0,0,1,3,3Z"
18
- />
19
- <path
20
- className="cls-1"
21
- d="M17.07,11.24h-4.3V22h1.92V17.84h2.38c2.4,0,3.9-1.16,3.9-3.3S19.47,11.24,17.07,11.24Zm-.1,5H14.69v-3.3H17c1.38,0,2.11.59,2.11,1.65S18.35,16.19,17,16.19Z"
22
- />
23
- <path
24
- className="cls-1"
25
- d="M25.1,14a3.77,3.77,0,0,0-3.8,4.09,3.81,3.81,0,1,0,7.59,0A3.76,3.76,0,0,0,25.1,14Zm0,6.67c-1.22,0-2-1-2-2.58s.76-2.58,2-2.58,2,1,2,2.58S26.31,20.66,25.1,20.66Z"
26
- />
27
- <polygon
28
- className="cls-1"
29
- points="36.78 19.35 35.37 14.13 33.89 14.13 32.49 19.35 31.07 14.13 29.22 14.13 31.59 22.01 33.15 22.01 34.59 16.85 36.03 22.01 37.59 22.01 39.96 14.13 38.18 14.13 36.78 19.35"
30
- />
31
- <path
32
- className="cls-1"
33
- d="M44,14a3.83,3.83,0,0,0-3.75,4.09,3.79,3.79,0,0,0,3.83,4.09A3.47,3.47,0,0,0,47.49,20L46,19.38a1.78,1.78,0,0,1-1.83,1.26A2.12,2.12,0,0,1,42,18.47h5.52v-.6C47.54,15.71,46.32,14,44,14Zm-1.93,3.13A1.92,1.92,0,0,1,44,15.5a1.56,1.56,0,0,1,1.69,1.62Z"
34
- />
35
- <path
36
- className="cls-1"
37
- d="M50.69,15.3V14.13h-1.8V22h1.8V17.87a1.89,1.89,0,0,1,2-2,4.68,4.68,0,0,1,.66,0v-1.8c-.14,0-.3,0-.51,0A2.29,2.29,0,0,0,50.69,15.3Z"
38
- />
39
- <path
40
- className="cls-1"
41
- d="M57.48,14a3.83,3.83,0,0,0-3.75,4.09,3.79,3.79,0,0,0,3.83,4.09A3.47,3.47,0,0,0,60.93,20l-1.54-.59a1.78,1.78,0,0,1-1.83,1.26,2.12,2.12,0,0,1-2.1-2.17H61v-.6C61,15.71,59.76,14,57.48,14Zm-1.93,3.13a1.92,1.92,0,0,1,1.92-1.62,1.56,1.56,0,0,1,1.69,1.62Z"
42
- />
43
- <path
44
- className="cls-1"
45
- d="M67.56,15a2.85,2.85,0,0,0-2.26-1c-2.21,0-3.47,1.85-3.47,4.09s1.26,4.09,3.47,4.09a2.82,2.82,0,0,0,2.26-1V22h1.8V11.24h-1.8Zm0,3.35a2,2,0,0,1-2,2.28c-1.31,0-2-1-2-2.52s.7-2.52,2-2.52c1.11,0,2,.81,2,2.29Z"
46
- />
47
- <path
48
- className="cls-1"
49
- d="M79.31,14A2.88,2.88,0,0,0,77,15V11.24h-1.8V22H77v-.83a2.86,2.86,0,0,0,2.27,1c2.2,0,3.46-1.86,3.46-4.09S81.51,14,79.31,14ZM79,20.6a2,2,0,0,1-2-2.28v-.47c0-1.48.84-2.29,2-2.29,1.3,0,2,1,2,2.52S80.25,20.6,79,20.6Z"
50
- />
51
- <path
52
- className="cls-1"
53
- d="M86.93,19.66,85,14.13H83.1L86,21.72l-.3.74a1,1,0,0,1-1.14.79,4.12,4.12,0,0,1-.6,0v1.51a4.62,4.62,0,0,0,.73.05,2.67,2.67,0,0,0,2.78-2l3.24-8.62H88.82Z"
54
- />
55
- <path
56
- className="cls-1"
57
- d="M125,12.43a3,3,0,0,0-2.13.87l-.14-.69h-2.39V25.53l2.72-.59V21.81a3,3,0,0,0,1.93.7c1.94,0,3.72-1.59,3.72-5.11C128.71,14.18,126.91,12.43,125,12.43Zm-.65,7.63a1.61,1.61,0,0,1-1.28-.52l0-4.11a1.64,1.64,0,0,1,1.3-.55c1,0,1.68,1.13,1.68,2.58S125.36,20.06,124.35,20.06Z"
58
- />
59
- <path
60
- className="cls-1"
61
- d="M133.73,12.43c-2.62,0-4.21,2.26-4.21,5.11,0,3.37,1.88,5.08,4.56,5.08a6.12,6.12,0,0,0,3-.73V19.64a5.79,5.79,0,0,1-2.7.62c-1.08,0-2-.39-2.14-1.7h5.38c0-.15,0-.74,0-1C137.71,14.69,136.35,12.43,133.73,12.43Zm-1.47,4.07c0-1.26.77-1.79,1.45-1.79s1.4.53,1.4,1.79Z"
62
- />
63
- <path
64
- className="cls-1"
65
- d="M113,13.36l-.17-.82h-2.32v9.71h2.68V15.67a1.87,1.87,0,0,1,2.05-.58V12.54A1.8,1.8,0,0,0,113,13.36Z"
66
- />
67
- <path
68
- className="cls-1"
69
- d="M99.46,15.46c0-.44.36-.61.93-.61a5.9,5.9,0,0,1,2.7.72V12.94a7,7,0,0,0-2.7-.51c-2.21,0-3.68,1.18-3.68,3.16,0,3.1,4.14,2.6,4.14,3.93,0,.52-.44.69-1,.69a6.78,6.78,0,0,1-3-.9V22a7.38,7.38,0,0,0,3,.64c2.26,0,3.82-1.15,3.82-3.16C103.62,16.12,99.46,16.72,99.46,15.46Z"
70
- />
71
- <path
72
- className="cls-1"
73
- d="M107.28,10.24l-2.65.58v8.93a2.77,2.77,0,0,0,2.82,2.87,4.16,4.16,0,0,0,1.91-.37V20c-.35.15-2.06.66-2.06-1V15h2.06V12.66h-2.06Z"
74
- />
75
- <polygon
76
- className="cls-1"
77
- points="116.25 11.7 118.98 11.13 118.98 8.97 116.25 9.54 116.25 11.7"
78
- />
79
- <rect className="cls-1" x="116.25" y="12.61" width="2.73" height="9.64" />
80
- </svg>,
81
- "PoweredByStripe"
82
- );
83
-
84
- export const StripeLogoLink = ({ height }: { height?: string }) => {
85
- return (
86
- <a href="https://stripe.com" target="_blank">
87
- <PoweredByStripe
88
- sx={{ width: "unset", height: height || "1em" }}
89
- viewBox="0 0 150 34"
90
- />
91
- </a>
92
- );
93
- };
1
+ import { createSvgIcon } from "@mui/material";
2
+ // Source: https://brandfolder.com/s/99gctvbpwgvzbc7mz3j9g4x
3
+
4
+ export const PoweredByStripe = createSvgIcon(
5
+ <svg
6
+ id="Layer_1"
7
+ data-name="Layer 1"
8
+ xmlns="http://www.w3.org/2000/svg"
9
+ viewBox="0 0 150 34"
10
+ >
11
+ <defs>
12
+ <style>{`.cls-1{fill: #635bff}`}</style>
13
+ </defs>
14
+ <title>Powered by Stripe - blurple</title>
15
+ <path
16
+ className="cls-1"
17
+ d="M146,0H3.73A3.73,3.73,0,0,0,0,3.73V30.27A3.73,3.73,0,0,0,3.73,34H146a4,4,0,0,0,4-4V4A4,4,0,0,0,146,0Zm3,30a3,3,0,0,1-3,3H3.73A2.74,2.74,0,0,1,1,30.27V3.73A2.74,2.74,0,0,1,3.73,1H146a3,3,0,0,1,3,3Z"
18
+ />
19
+ <path
20
+ className="cls-1"
21
+ d="M17.07,11.24h-4.3V22h1.92V17.84h2.38c2.4,0,3.9-1.16,3.9-3.3S19.47,11.24,17.07,11.24Zm-.1,5H14.69v-3.3H17c1.38,0,2.11.59,2.11,1.65S18.35,16.19,17,16.19Z"
22
+ />
23
+ <path
24
+ className="cls-1"
25
+ d="M25.1,14a3.77,3.77,0,0,0-3.8,4.09,3.81,3.81,0,1,0,7.59,0A3.76,3.76,0,0,0,25.1,14Zm0,6.67c-1.22,0-2-1-2-2.58s.76-2.58,2-2.58,2,1,2,2.58S26.31,20.66,25.1,20.66Z"
26
+ />
27
+ <polygon
28
+ className="cls-1"
29
+ points="36.78 19.35 35.37 14.13 33.89 14.13 32.49 19.35 31.07 14.13 29.22 14.13 31.59 22.01 33.15 22.01 34.59 16.85 36.03 22.01 37.59 22.01 39.96 14.13 38.18 14.13 36.78 19.35"
30
+ />
31
+ <path
32
+ className="cls-1"
33
+ d="M44,14a3.83,3.83,0,0,0-3.75,4.09,3.79,3.79,0,0,0,3.83,4.09A3.47,3.47,0,0,0,47.49,20L46,19.38a1.78,1.78,0,0,1-1.83,1.26A2.12,2.12,0,0,1,42,18.47h5.52v-.6C47.54,15.71,46.32,14,44,14Zm-1.93,3.13A1.92,1.92,0,0,1,44,15.5a1.56,1.56,0,0,1,1.69,1.62Z"
34
+ />
35
+ <path
36
+ className="cls-1"
37
+ d="M50.69,15.3V14.13h-1.8V22h1.8V17.87a1.89,1.89,0,0,1,2-2,4.68,4.68,0,0,1,.66,0v-1.8c-.14,0-.3,0-.51,0A2.29,2.29,0,0,0,50.69,15.3Z"
38
+ />
39
+ <path
40
+ className="cls-1"
41
+ d="M57.48,14a3.83,3.83,0,0,0-3.75,4.09,3.79,3.79,0,0,0,3.83,4.09A3.47,3.47,0,0,0,60.93,20l-1.54-.59a1.78,1.78,0,0,1-1.83,1.26,2.12,2.12,0,0,1-2.1-2.17H61v-.6C61,15.71,59.76,14,57.48,14Zm-1.93,3.13a1.92,1.92,0,0,1,1.92-1.62,1.56,1.56,0,0,1,1.69,1.62Z"
42
+ />
43
+ <path
44
+ className="cls-1"
45
+ d="M67.56,15a2.85,2.85,0,0,0-2.26-1c-2.21,0-3.47,1.85-3.47,4.09s1.26,4.09,3.47,4.09a2.82,2.82,0,0,0,2.26-1V22h1.8V11.24h-1.8Zm0,3.35a2,2,0,0,1-2,2.28c-1.31,0-2-1-2-2.52s.7-2.52,2-2.52c1.11,0,2,.81,2,2.29Z"
46
+ />
47
+ <path
48
+ className="cls-1"
49
+ d="M79.31,14A2.88,2.88,0,0,0,77,15V11.24h-1.8V22H77v-.83a2.86,2.86,0,0,0,2.27,1c2.2,0,3.46-1.86,3.46-4.09S81.51,14,79.31,14ZM79,20.6a2,2,0,0,1-2-2.28v-.47c0-1.48.84-2.29,2-2.29,1.3,0,2,1,2,2.52S80.25,20.6,79,20.6Z"
50
+ />
51
+ <path
52
+ className="cls-1"
53
+ d="M86.93,19.66,85,14.13H83.1L86,21.72l-.3.74a1,1,0,0,1-1.14.79,4.12,4.12,0,0,1-.6,0v1.51a4.62,4.62,0,0,0,.73.05,2.67,2.67,0,0,0,2.78-2l3.24-8.62H88.82Z"
54
+ />
55
+ <path
56
+ className="cls-1"
57
+ d="M125,12.43a3,3,0,0,0-2.13.87l-.14-.69h-2.39V25.53l2.72-.59V21.81a3,3,0,0,0,1.93.7c1.94,0,3.72-1.59,3.72-5.11C128.71,14.18,126.91,12.43,125,12.43Zm-.65,7.63a1.61,1.61,0,0,1-1.28-.52l0-4.11a1.64,1.64,0,0,1,1.3-.55c1,0,1.68,1.13,1.68,2.58S125.36,20.06,124.35,20.06Z"
58
+ />
59
+ <path
60
+ className="cls-1"
61
+ d="M133.73,12.43c-2.62,0-4.21,2.26-4.21,5.11,0,3.37,1.88,5.08,4.56,5.08a6.12,6.12,0,0,0,3-.73V19.64a5.79,5.79,0,0,1-2.7.62c-1.08,0-2-.39-2.14-1.7h5.38c0-.15,0-.74,0-1C137.71,14.69,136.35,12.43,133.73,12.43Zm-1.47,4.07c0-1.26.77-1.79,1.45-1.79s1.4.53,1.4,1.79Z"
62
+ />
63
+ <path
64
+ className="cls-1"
65
+ d="M113,13.36l-.17-.82h-2.32v9.71h2.68V15.67a1.87,1.87,0,0,1,2.05-.58V12.54A1.8,1.8,0,0,0,113,13.36Z"
66
+ />
67
+ <path
68
+ className="cls-1"
69
+ d="M99.46,15.46c0-.44.36-.61.93-.61a5.9,5.9,0,0,1,2.7.72V12.94a7,7,0,0,0-2.7-.51c-2.21,0-3.68,1.18-3.68,3.16,0,3.1,4.14,2.6,4.14,3.93,0,.52-.44.69-1,.69a6.78,6.78,0,0,1-3-.9V22a7.38,7.38,0,0,0,3,.64c2.26,0,3.82-1.15,3.82-3.16C103.62,16.12,99.46,16.72,99.46,15.46Z"
70
+ />
71
+ <path
72
+ className="cls-1"
73
+ d="M107.28,10.24l-2.65.58v8.93a2.77,2.77,0,0,0,2.82,2.87,4.16,4.16,0,0,0,1.91-.37V20c-.35.15-2.06.66-2.06-1V15h2.06V12.66h-2.06Z"
74
+ />
75
+ <polygon
76
+ className="cls-1"
77
+ points="116.25 11.7 118.98 11.13 118.98 8.97 116.25 9.54 116.25 11.7"
78
+ />
79
+ <rect className="cls-1" x="116.25" y="12.61" width="2.73" height="9.64" />
80
+ </svg>,
81
+ "PoweredByStripe"
82
+ );
83
+
84
+ export const StripeLogoLink = ({ height }: { height?: string }) => {
85
+ return (
86
+ <a href="https://stripe.com" target="_blank">
87
+ <PoweredByStripe
88
+ sx={{ width: "unset", height: height || "1em" }}
89
+ viewBox="0 0 150 34"
90
+ />
91
+ </a>
92
+ );
93
+ };
@@ -0,0 +1,32 @@
1
+ import { Box, IconButton, Typography } from "@mui/material";
2
+ import ArrowBackIcon from "@mui/icons-material/ArrowBack";
3
+
4
+ export function StatusBar({ status, backlink = "" }) {
5
+ return (
6
+ <Box
7
+ style={{
8
+ display: "flex",
9
+ justifyContent: "center",
10
+ flexDirection: "row",
11
+ }}
12
+ >
13
+ <Box sx={{ flex: "1 1" }}>
14
+ <IconButton href={`/${backlink}`}>
15
+ <ArrowBackIcon />
16
+ </IconButton>
17
+ </Box>
18
+ <div id="status-bar">
19
+ <Typography className="status-text active">PAYMENT DETAILS</Typography>
20
+ <div className={"status-bar" + (status > 0 ? " active" : "")}></div>
21
+ <Typography className={"status-text" + (status > 0 ? " active" : "")}>
22
+ CONFIRMATION
23
+ </Typography>
24
+ <div className={"status-bar" + (status > 1 ? " active" : "")}></div>
25
+ <Typography className={"status-text" + (status > 1 ? " active" : "")}>
26
+ ORDER PLACED
27
+ </Typography>
28
+ </div>
29
+ <Box sx={{ flex: "1 1" }} />
30
+ </Box>
31
+ );
32
+ }