@pradip1995/segment-animation-order 0.2.3 → 0.2.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pradip1995/segment-animation-order",
3
- "version": "0.2.3",
3
+ "version": "0.2.5",
4
4
  "description": "Motion/Lumière order confirmed, failed, and details pages",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -16,6 +16,10 @@
16
16
  ".": "./src/index.ts",
17
17
  "./manifest": "./src/manifest.ts"
18
18
  },
19
+ "scripts": {
20
+ "typecheck": "tsc --noEmit",
21
+ "lint": "tsc --noEmit"
22
+ },
19
23
  "peerDependencies": {
20
24
  "@medusajs/types": ">=2",
21
25
  "@pradip1995/commerce-core": "^4.0.0",
@@ -25,7 +29,7 @@
25
29
  "react-dom": ">=19"
26
30
  },
27
31
  "dependencies": {
28
- "@pradip1995/segment-primitives": "^0.4.0",
32
+ "@pradip1995/segment-primitives": "^0.4.20",
29
33
  "framer-motion": "^11.0.0"
30
34
  },
31
35
  "devDependencies": {
@@ -36,9 +40,5 @@
36
40
  "next": ">=15",
37
41
  "react": "19.0.3",
38
42
  "typescript": "^5.7.2"
39
- },
40
- "scripts": {
41
- "typecheck": "tsc --noEmit",
42
- "lint": "tsc --noEmit"
43
43
  }
44
- }
44
+ }
@@ -4,7 +4,7 @@
4
4
  --anim-order-ink: #0a0a0a;
5
5
  --anim-order-muted: #737373;
6
6
  --anim-order-line: #e8e8e8;
7
- --anim-order-accent: #e23b00;
7
+ --anim-order-accent: #111111;
8
8
  position: relative;
9
9
  isolation: isolate;
10
10
  width: 100%;
@@ -20,7 +20,7 @@
20
20
  inset: 0;
21
21
  z-index: 0;
22
22
  background:
23
- radial-gradient(ellipse 80% 55% at 50% -10%, rgba(226, 59, 0, 0.1), transparent 60%),
23
+ radial-gradient(ellipse 80% 55% at 50% -10%, rgba(17, 17, 17, 0.08), transparent 60%),
24
24
  linear-gradient(180deg, #fafafa 0%, #ffffff 42%, #ffffff 100%);
25
25
  }
26
26
 
@@ -293,7 +293,7 @@
293
293
  /* ── Order details ─────────────────────────────────────────── */
294
294
 
295
295
  .anim-order--details {
296
- --anim-order-accent: #e23b00;
296
+ --anim-order-accent: #111111;
297
297
  --anim-order-ink: #1c1412;
298
298
  --anim-order-muted: #7a6e68;
299
299
  --anim-order-line: #ebe4df;
@@ -301,7 +301,7 @@
301
301
 
302
302
  .anim-order--details .anim-order__atmosphere {
303
303
  background:
304
- radial-gradient(ellipse 80% 55% at 50% -10%, rgba(226, 59, 0, 0.09), transparent 60%),
304
+ radial-gradient(ellipse 80% 55% at 50% -10%, rgba(17, 17, 17, 0.08), transparent 60%),
305
305
  linear-gradient(180deg, #fffaf7 0%, #ffffff 45%, #ffffff 100%);
306
306
  }
307
307
 
@@ -6,6 +6,7 @@ import { usePathname, useRouter } from "next/navigation"
6
6
  import type { HttpTypes } from "@medusajs/types"
7
7
  import { addToCart } from "@pradip1995/commerce-core/client/actions/cart"
8
8
  import LocalizedLink from "@pradip1995/segment-primitives/localized-link"
9
+ import { presentOrderLines } from "@pradip1995/segment-primitives/order-lines"
9
10
  import {
10
11
  cancelOrderAction,
11
12
  downloadInvoiceAction,
@@ -105,9 +106,8 @@ export default function OrderActions({ order }: { order: HttpTypes.StoreOrder })
105
106
  const router = useRouter()
106
107
  const pathname = usePathname() || ""
107
108
  const countryCode = pathname.split("/").filter(Boolean)[0] || "in"
108
- const items = (order.items || []) as LineItem[]
109
+ const items = presentOrderLines(order).returnExchangeItems as LineItem[]
109
110
  const activeReturns = getActiveReturns(order)
110
- const hasOpenReturn = activeReturns.length > 0
111
111
  const showCancel = canCancelOrder(order)
112
112
  const showReturnExchange = canReturnOrExchange(order)
113
113
  const showReorder = canReorder(order)
@@ -115,7 +115,9 @@ export default function OrderActions({ order }: { order: HttpTypes.StoreOrder })
115
115
  const hasEligibleItems = items.some(
116
116
  (item) => getEligibleQty(item, activeReturns) > 0
117
117
  )
118
- const returnActionsDisabled = hasOpenReturn || !hasEligibleItems
118
+ // Do not block the whole order when one return is open — remaining /
119
+ // delivered replacement qty must stay actionable (H.ankit flow).
120
+ const returnActionsDisabled = !hasEligibleItems
119
121
 
120
122
  useEffect(() => {
121
123
  setMounted(true)
@@ -4,6 +4,7 @@ import Image from "next/image"
4
4
  import { motion } from "framer-motion"
5
5
  import LocalizedLink from "@pradip1995/segment-primitives/localized-link"
6
6
  import { formatPrice } from "@pradip1995/segment-primitives/format-price"
7
+ import { presentOrderLines } from "@pradip1995/segment-primitives/order-lines"
7
8
  import type { HttpTypes } from "@medusajs/types"
8
9
  import OrderActions from "./order-actions"
9
10
  import OrderTracking from "./order-tracking"
@@ -32,7 +33,8 @@ export default function OrderDetailsView({
32
33
  isLoggedIn: boolean
33
34
  }) {
34
35
  const currency = order.currency_code || "inr"
35
- const items = order.items || []
36
+ const presentation = presentOrderLines(order)
37
+ const items = presentation.purchasedItems
36
38
  const shipping = order.shipping_address
37
39
  const status = pretty(order.status)
38
40
  const fulfillment = pretty(order.fulfillment_status)
@@ -216,15 +218,15 @@ export default function OrderDetailsView({
216
218
  <dl className="anim-order__summary">
217
219
  <div>
218
220
  <dt>Subtotal</dt>
219
- <dd>{formatPrice(order.subtotal, currency)}</dd>
221
+ <dd>{formatPrice(presentation.paidSubtotal, currency)}</dd>
220
222
  </div>
221
223
  <div>
222
224
  <dt>Shipping</dt>
223
225
  <dd>{formatPrice(order.shipping_total, currency)}</dd>
224
226
  </div>
225
227
  <div className="anim-order__summary-total">
226
- <dt>Total</dt>
227
- <dd>{formatPrice(order.total, currency)}</dd>
228
+ <dt>Paid total</dt>
229
+ <dd>{formatPrice(presentation.paidTotal, currency)}</dd>
228
230
  </div>
229
231
  </dl>
230
232
  </div>