medusa-ui-common 3.0.0 → 3.0.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "medusa-ui-common",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "Shared storefront UI primitives.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"medusa-contact-logic-plugin": "^2.0.0",
|
|
24
24
|
"medusa-reviews-logic": "^2.0.0",
|
|
25
25
|
"medusa-storefront-analytics": "^1.0.0",
|
|
26
|
-
"medusa-storefront-data": "^2.
|
|
26
|
+
"medusa-storefront-data": "^2.0.0",
|
|
27
27
|
"medusa-storefront-hooks": "^1.0.0",
|
|
28
28
|
"medusa-wishlist-logic": "^2.0.0",
|
|
29
29
|
"medusa-storefront-theme-base": "^3.0.0",
|
|
@@ -48,21 +48,6 @@
|
|
|
48
48
|
"import": "./src/common/*",
|
|
49
49
|
"default": "./src/common/*"
|
|
50
50
|
},
|
|
51
|
-
"./providers": {
|
|
52
|
-
"types": "./src/storefront-providers.tsx",
|
|
53
|
-
"import": "./src/storefront-providers.tsx",
|
|
54
|
-
"default": "./src/storefront-providers.tsx"
|
|
55
|
-
},
|
|
56
|
-
"./context/wishlist-context": {
|
|
57
|
-
"types": "./src/context/wishlist-context.tsx",
|
|
58
|
-
"import": "./src/context/wishlist-context.tsx",
|
|
59
|
-
"default": "./src/context/wishlist-context.tsx"
|
|
60
|
-
},
|
|
61
|
-
"./context/modal-context": {
|
|
62
|
-
"types": "./src/context/modal-context.tsx",
|
|
63
|
-
"import": "./src/context/modal-context.tsx",
|
|
64
|
-
"default": "./src/context/modal-context.tsx"
|
|
65
|
-
},
|
|
66
51
|
"./context/*": {
|
|
67
52
|
"types": "./src/context/*",
|
|
68
53
|
"import": "./src/context/*",
|
|
@@ -87,11 +72,6 @@
|
|
|
87
72
|
"types": "./src/constants/*",
|
|
88
73
|
"import": "./src/constants/*",
|
|
89
74
|
"default": "./src/constants/*"
|
|
90
|
-
},
|
|
91
|
-
"./page-compose/types": {
|
|
92
|
-
"types": "./src/page-compose/types.ts",
|
|
93
|
-
"import": "./src/page-compose/types.ts",
|
|
94
|
-
"default": "./src/page-compose/types.ts"
|
|
95
75
|
}
|
|
96
76
|
},
|
|
97
77
|
"typesVersions": {
|
|
@@ -102,17 +82,17 @@
|
|
|
102
82
|
}
|
|
103
83
|
},
|
|
104
84
|
"devDependencies": {
|
|
105
|
-
"next": "^15.0.0",
|
|
106
|
-
"medusa-storefront-analytics": "workspace:*",
|
|
107
|
-
"medusa-storefront-core": "workspace:*",
|
|
108
|
-
"medusa-storefront-data": "workspace:*",
|
|
109
|
-
"medusa-storefront-theme-base": "workspace:*",
|
|
110
85
|
"@headlessui/react": "^2.2.0",
|
|
111
86
|
"@medusajs/icons": "^2.0.0",
|
|
112
87
|
"@medusajs/ui": "^4.0.0",
|
|
113
88
|
"@types/react": "18.3.18",
|
|
114
89
|
"@types/react-dom": "18.3.5",
|
|
115
90
|
"typescript": "^5.6.0",
|
|
91
|
+
"next": "^15.0.0",
|
|
92
|
+
"medusa-storefront-analytics": "1.5.1",
|
|
93
|
+
"medusa-storefront-core": "1.2.5",
|
|
94
|
+
"medusa-storefront-data": "2.5.9",
|
|
95
|
+
"medusa-storefront-theme-base": "3.0.1",
|
|
116
96
|
"color": "^5.0.3",
|
|
117
97
|
"react-razorpay": "^3.0.1"
|
|
118
98
|
}
|
|
@@ -12,6 +12,12 @@ import { useSiteCompany } from "medusa-storefront-core"
|
|
|
12
12
|
import { useButtonClassName } from "../../../context/button-theme-context"
|
|
13
13
|
import { ThemedButton } from "../themed-button"
|
|
14
14
|
|
|
15
|
+
type CartTotalsPriceSummaryCopy = {
|
|
16
|
+
title: string
|
|
17
|
+
itemSingular: string
|
|
18
|
+
itemPlural: string
|
|
19
|
+
}
|
|
20
|
+
|
|
15
21
|
type CartTotalsProps = {
|
|
16
22
|
totals: {
|
|
17
23
|
total?: number | null
|
|
@@ -25,9 +31,16 @@ type CartTotalsProps = {
|
|
|
25
31
|
items?: HttpTypes.StoreCartLineItem[]
|
|
26
32
|
checkoutStep?: string
|
|
27
33
|
customer?: HttpTypes.StoreCustomer | null
|
|
34
|
+
priceSummaryCopy?: CartTotalsPriceSummaryCopy
|
|
28
35
|
}
|
|
29
36
|
|
|
30
|
-
const CartTotals: React.FC<CartTotalsProps> = ({
|
|
37
|
+
const CartTotals: React.FC<CartTotalsProps> = ({
|
|
38
|
+
totals,
|
|
39
|
+
items = [],
|
|
40
|
+
checkoutStep,
|
|
41
|
+
customer,
|
|
42
|
+
priceSummaryCopy,
|
|
43
|
+
}) => {
|
|
31
44
|
const company = useSiteCompany()
|
|
32
45
|
const primaryBtn = useButtonClassName("primary", { size: "lg", className: "w-full" })
|
|
33
46
|
const secondaryBtn = useButtonClassName("secondary", { size: "lg", className: "w-full" })
|
|
@@ -277,7 +290,9 @@ const CartTotals: React.FC<CartTotalsProps> = ({ totals, items = [], checkoutSte
|
|
|
277
290
|
<div className="bg-[var(--sf-color-background)] rounded-lg p-3 min-[550px]:p-4 sm:p-5 md:p-6 min-[1023px]:p-4 min-[1150px]:p-5 min-[1360px]:p-6 border shadow-sm w-full" style={{ borderColor: '#C0C0C0' }}>
|
|
278
291
|
<ProcessingOverlay isOpen={showOverlay} variant={processingVariant} />
|
|
279
292
|
<h3 className="text-sm min-[550px]:text-base sm:text-lg min-[1023px]:text-base min-[1150px]:text-lg min-[1360px]:text-lg font-bold text-[var(--sf-color-text)] mb-2.5 min-[550px]:mb-3 sm:mb-4 min-[1023px]:mb-3 min-[1150px]:mb-4 min-[1360px]:mb-4">
|
|
280
|
-
|
|
293
|
+
{priceSummaryCopy
|
|
294
|
+
? `${priceSummaryCopy.title} (${itemCount} ${itemCount === 1 ? priceSummaryCopy.itemSingular : priceSummaryCopy.itemPlural})`
|
|
295
|
+
: `PRICE SUMMARY (${itemCount} ${itemCount === 1 ? "ITEM" : "ITEMS"})`}
|
|
281
296
|
</h3>
|
|
282
297
|
|
|
283
298
|
<div className="flex flex-col gap-y-2 min-[550px]:gap-y-2.5 sm:gap-y-3 min-[1023px]:gap-y-2 min-[1150px]:gap-y-3 min-[1360px]:gap-y-3 text-xs min-[550px]:text-sm sm:text-base min-[1023px]:text-sm min-[1150px]:text-base min-[1360px]:text-base text-[var(--sf-color-text)]">
|
|
@@ -6,16 +6,24 @@ const ProcessingOverlay = ({
|
|
|
6
6
|
isOpen,
|
|
7
7
|
title,
|
|
8
8
|
subtitle = "Please do not refresh or close this window",
|
|
9
|
-
variant = "payment"
|
|
9
|
+
variant = "payment",
|
|
10
|
+
gifSrc = "/uploads/profile-images/t-shirt.gif",
|
|
11
|
+
gifAlt = "Placing order...",
|
|
12
|
+
paymentMessages: paymentMessagesProp,
|
|
13
|
+
orderMessages: orderMessagesProp,
|
|
10
14
|
}: {
|
|
11
15
|
isOpen: boolean
|
|
12
16
|
title?: string
|
|
13
17
|
subtitle?: string
|
|
14
18
|
variant?: "payment" | "order"
|
|
19
|
+
gifSrc?: string
|
|
20
|
+
gifAlt?: string
|
|
21
|
+
paymentMessages?: string[]
|
|
22
|
+
orderMessages?: string[]
|
|
15
23
|
}) => {
|
|
16
24
|
const [messageIndex, setMessageIndex] = useState(0)
|
|
17
25
|
|
|
18
|
-
const paymentMessages = [
|
|
26
|
+
const paymentMessages = paymentMessagesProp ?? [
|
|
19
27
|
"Securing your transaction...",
|
|
20
28
|
"Verifying with payment provider...",
|
|
21
29
|
"Finalizing your order...",
|
|
@@ -23,7 +31,7 @@ const ProcessingOverlay = ({
|
|
|
23
31
|
"Finishing up..."
|
|
24
32
|
]
|
|
25
33
|
|
|
26
|
-
const orderMessages = [
|
|
34
|
+
const orderMessages = orderMessagesProp ?? [
|
|
27
35
|
"Placing your order...",
|
|
28
36
|
"Preparing your confirmation...",
|
|
29
37
|
"Almost there...",
|
|
@@ -54,8 +62,8 @@ const ProcessingOverlay = ({
|
|
|
54
62
|
<div className="bg-white p-8 rounded-2xl shadow-2xl border border-purple-100 flex flex-col items-center max-w-xs w-full mx-4 transform animate-in zoom-in-95 duration-300">
|
|
55
63
|
<div className="relative mb-2">
|
|
56
64
|
<img
|
|
57
|
-
src=
|
|
58
|
-
alt=
|
|
65
|
+
src={gifSrc}
|
|
66
|
+
alt={gifAlt}
|
|
59
67
|
className="w-32 h-32 object-contain mx-auto"
|
|
60
68
|
/>
|
|
61
69
|
</div>
|