medusa-ui-common 3.0.0 → 3.0.2

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.0",
3
+ "version": "3.0.2",
4
4
  "description": "Shared storefront UI primitives.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -18,6 +18,7 @@
18
18
  "peerDependencies": {
19
19
  "@medusajs/types": ">=2",
20
20
  "@medusajs/ui": "*",
21
+ "@medusajs/icons": "^2.0.0",
21
22
  "lodash": ">=4",
22
23
  "lucide-react": "*",
23
24
  "medusa-contact-logic-plugin": "^2.0.0",
@@ -48,21 +49,6 @@
48
49
  "import": "./src/common/*",
49
50
  "default": "./src/common/*"
50
51
  },
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
52
  "./context/*": {
67
53
  "types": "./src/context/*",
68
54
  "import": "./src/context/*",
@@ -87,11 +73,6 @@
87
73
  "types": "./src/constants/*",
88
74
  "import": "./src/constants/*",
89
75
  "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
76
  }
96
77
  },
97
78
  "typesVersions": {
@@ -102,17 +83,17 @@
102
83
  }
103
84
  },
104
85
  "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
86
  "@headlessui/react": "^2.2.0",
111
87
  "@medusajs/icons": "^2.0.0",
112
88
  "@medusajs/ui": "^4.0.0",
113
89
  "@types/react": "18.3.18",
114
90
  "@types/react-dom": "18.3.5",
115
91
  "typescript": "^5.6.0",
92
+ "next": "^15.0.0",
93
+ "medusa-storefront-analytics": "workspace:*",
94
+ "medusa-storefront-core": "workspace:*",
95
+ "medusa-storefront-data": "workspace:*",
96
+ "medusa-storefront-theme-base": "workspace:*",
116
97
  "color": "^5.0.3",
117
98
  "react-razorpay": "^3.0.1"
118
99
  }
@@ -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> = ({ totals, items = [], checkoutStep, customer }) => {
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
- PRICE SUMMARY ({itemCount} {itemCount === 1 ? "ITEM" : "ITEMS"})
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="/uploads/profile-images/t-shirt.gif"
58
- alt="Placing order..."
65
+ src={gifSrc}
66
+ alt={gifAlt}
59
67
  className="w-32 h-32 object-contain mx-auto"
60
68
  />
61
69
  </div>