@pradip1995/segment-animation-order 0.2.3 → 0.2.4

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.4",
4
4
  "description": "Motion/Lumière order confirmed, failed, and details pages",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -25,7 +25,7 @@
25
25
  "react-dom": ">=19"
26
26
  },
27
27
  "dependencies": {
28
- "@pradip1995/segment-primitives": "^0.4.0",
28
+ "@pradip1995/segment-primitives": "^0.4.11",
29
29
  "framer-motion": "^11.0.0"
30
30
  },
31
31
  "devDependencies": {
@@ -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,7 +106,7 @@ 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).purchasedItems as LineItem[]
109
110
  const activeReturns = getActiveReturns(order)
110
111
  const hasOpenReturn = activeReturns.length > 0
111
112
  const showCancel = canCancelOrder(order)
@@ -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>