@cartbase/storefront 0.19.0 → 0.20.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.
Files changed (105) hide show
  1. package/LICENSE +21 -21
  2. package/package.json +258 -258
  3. package/src/api/auth.ts +108 -108
  4. package/src/api/carts.ts +523 -523
  5. package/src/api/categories.ts +184 -184
  6. package/src/api/checkout.ts +526 -526
  7. package/src/api/collections.ts +130 -130
  8. package/src/api/consent.ts +75 -75
  9. package/src/api/content.ts +125 -125
  10. package/src/api/customers.ts +303 -303
  11. package/src/api/gift-cards.ts +112 -112
  12. package/src/api/http.ts +180 -180
  13. package/src/api/index.ts +30 -30
  14. package/src/api/menus.ts +77 -77
  15. package/src/api/metaobjects.ts +136 -136
  16. package/src/api/orders.ts +290 -290
  17. package/src/api/redirects.ts +37 -37
  18. package/src/api/regions.ts +200 -200
  19. package/src/api/reviews.ts +22 -1
  20. package/src/api/search.ts +163 -163
  21. package/src/api/store.ts +35 -35
  22. package/src/api/types.ts +91 -91
  23. package/src/cart-drawer/context.tsx +778 -778
  24. package/src/cart-drawer/cross-sell-carousel.tsx +211 -211
  25. package/src/cart-drawer/cross-sell-sidebar.tsx +158 -158
  26. package/src/cart-drawer/gift-wrap.tsx +82 -82
  27. package/src/cart-drawer/item/index.tsx +162 -162
  28. package/src/cart-drawer/item/upsell.tsx +110 -110
  29. package/src/cart-drawer/labels.ts +123 -123
  30. package/src/cart-drawer/mutation-queue.ts +78 -78
  31. package/src/cart-drawer/notes.tsx +131 -131
  32. package/src/cart-drawer/sticky-footer.tsx +73 -73
  33. package/src/cart-drawer/summary-breakdown.tsx +197 -197
  34. package/src/checkout/address-error-copy.ts +117 -117
  35. package/src/checkout/boxnow-locker-selector.tsx +410 -410
  36. package/src/checkout/compare-addresses.ts +40 -40
  37. package/src/checkout/discount-section.tsx +218 -218
  38. package/src/checkout/error-copy-codes.ts +63 -63
  39. package/src/checkout/geocode.ts +154 -154
  40. package/src/checkout/gift-card-section.tsx +224 -224
  41. package/src/checkout/index.ts +72 -72
  42. package/src/checkout/labels.ts +495 -495
  43. package/src/checkout/payment-button.tsx +372 -372
  44. package/src/checkout/payment-error-copy.ts +154 -154
  45. package/src/checkout/promotion-error-copy.ts +91 -91
  46. package/src/common/country-flag.tsx +52 -52
  47. package/src/common/country-select.tsx +11 -11
  48. package/src/common/index.ts +20 -20
  49. package/src/common/market-select.tsx +57 -57
  50. package/src/index.ts +12 -12
  51. package/src/lib/country-name.ts +59 -59
  52. package/src/lib/get-product-price.ts +133 -133
  53. package/src/lib/media-image.tsx +39 -39
  54. package/src/lib/payment-constants.ts +53 -53
  55. package/src/lib/platform.ts +13 -13
  56. package/src/lib/price.tsx +39 -39
  57. package/src/lib/store-api-error.ts +36 -36
  58. package/src/lib/variant-caption.ts +32 -32
  59. package/src/locales/bg.ts +3 -2
  60. package/src/locales/context.ts +37 -37
  61. package/src/locales/en.ts +26 -26
  62. package/src/locales/es.ts +3 -2
  63. package/src/locales/index.ts +19 -19
  64. package/src/locales/provider.tsx +59 -59
  65. package/src/locales/types.ts +77 -77
  66. package/src/order/index.ts +62 -62
  67. package/src/order/labels.ts +79 -79
  68. package/src/order/order-totals.tsx +250 -250
  69. package/src/primitives/select-field.tsx +93 -93
  70. package/src/products/image-gallery.tsx +43 -43
  71. package/src/products/option-select.tsx +67 -67
  72. package/src/products/product-info.tsx +5 -5
  73. package/src/products/product-price.tsx +69 -69
  74. package/src/products/product-promises.tsx +61 -61
  75. package/src/products/product-specs.tsx +65 -65
  76. package/src/products/product-tabs.tsx +123 -123
  77. package/src/products/purchase-options.tsx +130 -130
  78. package/src/products/sets.ts +110 -110
  79. package/src/products/variant-matching.ts +71 -71
  80. package/src/products/variant-url.ts +74 -74
  81. package/src/reviews-ui/index.ts +12 -0
  82. package/src/reviews-ui/labels.ts +5 -2
  83. package/src/reviews-ui/lightbox-state.ts +46 -46
  84. package/src/reviews-ui/review-header.tsx +166 -0
  85. package/src/reviews-ui/review-lightbox.tsx +271 -271
  86. package/src/reviews-ui/review-list.tsx +193 -191
  87. package/src/reviews-ui/review-widget.tsx +63 -71
  88. package/src/reviews-ui/star-badge.tsx +6 -4
  89. package/src/reviews-ui/widget-options.ts +55 -0
  90. package/src/store/category-template.tsx +136 -136
  91. package/src/store/index.ts +40 -40
  92. package/src/tracking/chatgpt-pixel.tsx +99 -99
  93. package/src/tracking/consent-init.tsx +62 -62
  94. package/src/tracking/events.ts +348 -348
  95. package/src/tracking/ga4.tsx +93 -93
  96. package/src/tracking/google-ads.ts +84 -84
  97. package/src/tracking/gtm.tsx +60 -60
  98. package/src/tracking/inline-script.ts +49 -49
  99. package/src/tracking/oaiq.ts +206 -206
  100. package/src/tracking/tiktok-pixel.tsx +91 -91
  101. package/src/tracking/track-init.tsx +56 -56
  102. package/src/tracking/track-order-purchase.tsx +122 -122
  103. package/src/tracking/ttq.ts +180 -180
  104. package/src/tracking/use-tracking-config.ts +54 -54
  105. package/theme/index.css +25 -25
@@ -1,59 +1,59 @@
1
- "use client"
2
-
3
- import { useContext, type ReactNode } from "react"
4
- import { CheckoutProvider } from "../checkout/context"
5
- import { OrderLabelsProvider } from "../order/context"
6
- import { ProductLabelsProvider } from "../products/context"
7
- import { StorefrontLocaleContext } from "./context"
8
- import type { StorefrontLocale } from "./types"
9
- import { en } from "./en"
10
-
11
- /**
12
- * ONE PROVIDER FOR THE STORE'S LANGUAGE.
13
- *
14
- * import { es } from "@cartbase/storefront/locales/es"
15
- * <StorefrontLocaleProvider locale={es}>{children}</StorefrontLocaleProvider>
16
- *
17
- * Every CLIENT component inside it speaks the pack, and nothing else has to
18
- * be wired: it mounts the three label contexts (products, checkout, order),
19
- * and the cart drawer and the reviews family read the language from it
20
- * directly (`useLocaleArea`, since 2026-09-14). It does not MOUNT the cart
21
- * drawer, because that provider carries the cart's state, its client and its
22
- * persistence callbacks, which belong where the app owns that state; the
23
- * drawer only reads the language from here.
24
- *
25
- * What it cannot reach is a SERVER component, because a server component has
26
- * no context. The store, product and order templates render on the server,
27
- * so each page hands them their area of the pack as a REQUIRED prop:
28
- * `PropLabelAreas` in ./types names them, with the mounts written out.
29
- *
30
- * DEFAULT IS ENGLISH. A component rendered outside this provider reads the
31
- * library's own English defaults, so nothing renders blank or crashes for
32
- * want of a provider.
33
- */
34
- export function StorefrontLocaleProvider({
35
- locale,
36
- children,
37
- }: {
38
- locale: StorefrontLocale
39
- children: ReactNode
40
- }) {
41
- return (
42
- <StorefrontLocaleContext.Provider value={locale}>
43
- <ProductLabelsProvider labels={locale.products}>
44
- <CheckoutProvider labels={locale.checkout}>
45
- <OrderLabelsProvider labels={locale.order}>{children}</OrderLabelsProvider>
46
- </CheckoutProvider>
47
- </ProductLabelsProvider>
48
- </StorefrontLocaleContext.Provider>
49
- )
50
- }
51
-
52
- /**
53
- * The whole mounted locale, English when none is mounted: for the code that
54
- * needs the language itself, e.g. `<html lang={locale.code}>`, and for a
55
- * client shell that hands a server template its pack.
56
- */
57
- export function useStorefrontLocale(): StorefrontLocale {
58
- return useContext(StorefrontLocaleContext) ?? en
59
- }
1
+ "use client"
2
+
3
+ import { useContext, type ReactNode } from "react"
4
+ import { CheckoutProvider } from "../checkout/context"
5
+ import { OrderLabelsProvider } from "../order/context"
6
+ import { ProductLabelsProvider } from "../products/context"
7
+ import { StorefrontLocaleContext } from "./context"
8
+ import type { StorefrontLocale } from "./types"
9
+ import { en } from "./en"
10
+
11
+ /**
12
+ * ONE PROVIDER FOR THE STORE'S LANGUAGE.
13
+ *
14
+ * import { es } from "@cartbase/storefront/locales/es"
15
+ * <StorefrontLocaleProvider locale={es}>{children}</StorefrontLocaleProvider>
16
+ *
17
+ * Every CLIENT component inside it speaks the pack, and nothing else has to
18
+ * be wired: it mounts the three label contexts (products, checkout, order),
19
+ * and the cart drawer and the reviews family read the language from it
20
+ * directly (`useLocaleArea`, since 2026-09-14). It does not MOUNT the cart
21
+ * drawer, because that provider carries the cart's state, its client and its
22
+ * persistence callbacks, which belong where the app owns that state; the
23
+ * drawer only reads the language from here.
24
+ *
25
+ * What it cannot reach is a SERVER component, because a server component has
26
+ * no context. The store, product and order templates render on the server,
27
+ * so each page hands them their area of the pack as a REQUIRED prop:
28
+ * `PropLabelAreas` in ./types names them, with the mounts written out.
29
+ *
30
+ * DEFAULT IS ENGLISH. A component rendered outside this provider reads the
31
+ * library's own English defaults, so nothing renders blank or crashes for
32
+ * want of a provider.
33
+ */
34
+ export function StorefrontLocaleProvider({
35
+ locale,
36
+ children,
37
+ }: {
38
+ locale: StorefrontLocale
39
+ children: ReactNode
40
+ }) {
41
+ return (
42
+ <StorefrontLocaleContext.Provider value={locale}>
43
+ <ProductLabelsProvider labels={locale.products}>
44
+ <CheckoutProvider labels={locale.checkout}>
45
+ <OrderLabelsProvider labels={locale.order}>{children}</OrderLabelsProvider>
46
+ </CheckoutProvider>
47
+ </ProductLabelsProvider>
48
+ </StorefrontLocaleContext.Provider>
49
+ )
50
+ }
51
+
52
+ /**
53
+ * The whole mounted locale, English when none is mounted: for the code that
54
+ * needs the language itself, e.g. `<html lang={locale.code}>`, and for a
55
+ * client shell that hands a server template its pack.
56
+ */
57
+ export function useStorefrontLocale(): StorefrontLocale {
58
+ return useContext(StorefrontLocaleContext) ?? en
59
+ }
@@ -1,77 +1,77 @@
1
- import type { CartDrawerLabels } from "../cart-drawer/labels"
2
- import type { CheckoutLabels } from "../checkout/labels"
3
- import type { OrderLabels } from "../order/labels"
4
- import type { ProductLabels } from "../products/labels"
5
- import type { ReviewsUiLabels } from "../reviews-ui/labels"
6
- import type { StoreLabels } from "../store/labels"
7
-
8
- /**
9
- * A LOCALE IS ONE OBJECT COVERING THE WHOLE STOREFRONT.
10
- *
11
- * Before this (2026-09-13) every area shipped its own English defaults and
12
- * its own Bulgarian file, so localizing a store meant importing six packs
13
- * and mounting four separate providers, and a global package shipped
14
- * Bulgarian copy to every merchant on earth. Alexander's ruling: the
15
- * library is international ENGLISH, and a language is a pack the store
16
- * opts into.
17
- *
18
- * So: English is the library's own default and lives in each area's
19
- * `labels.ts` beside its type. Every other language is a locale pack
20
- * imported by subpath — `@cartbase/storefront/locales/es`,
21
- * `/locales/bg` — and is typed against these six shapes, which means a
22
- * missing translation is a COMPILE ERROR rather than a silent fall back to
23
- * English in the middle of a Spanish checkout.
24
- *
25
- * Adding a language is one file in `src/locales/` plus its export path.
26
- * Nothing else in the package changes, and no component knows a language
27
- * exists.
28
- */
29
- export interface StorefrontLocale {
30
- /** BCP 47 code, for the app's own persistence and for `<html lang>`. */
31
- code: string
32
- /** The language's own name, for a switcher that does not want Intl. */
33
- name: string
34
- products: ProductLabels
35
- store: StoreLabels
36
- cartDrawer: CartDrawerLabels
37
- checkout: CheckoutLabels
38
- order: OrderLabels
39
- reviews: ReviewsUiLabels
40
- }
41
-
42
- /**
43
- * THE AREAS WHOSE PACK THE APP MUST HAND OVER AS A PROP, and the prop is
44
- * REQUIRED.
45
- *
46
- * Not a style choice and not a gap in this layer: a React SERVER component
47
- * cannot read a client context, and these areas are rendered on the server.
48
- * `StorefrontLocaleProvider` therefore reaches the client components and
49
- * nothing else, and a server-rendered heading would stay English however
50
- * many providers were mounted above it.
51
- *
52
- * Since 2026-09-14 the page-level templates of these areas REQUIRE the pack
53
- * (`labels: StoreLabels`, never `labels?`), so a page that forgets it fails
54
- * to compile instead of shipping silent English. That was the defect: on
55
- * 2026-09-13 evoo, a Bulgarian store, ended a product page in the English
56
- * "Related products / You might also want to check out these products", and
57
- * its search page and order confirmation stayed English, with no error, no
58
- * warning and no failing test. English is not a special case: an English
59
- * store passes `en.store`. The scaffold declares `STORE_LOCALE` once in its
60
- * config and every page reads its area from it.
61
- *
62
- * Hand the pack to each page-level template once and everything inside it
63
- * follows:
64
- *
65
- * <StoreTemplate labels={STORE_LOCALE.store} />
66
- * <SearchTemplate labels={STORE_LOCALE.store} />
67
- * <CollectionTemplate labels={STORE_LOCALE.store} />
68
- * <CategoryTemplate labels={STORE_LOCALE.store} />
69
- * <ProductTemplate labels={STORE_LOCALE.products} /> // + the related strip
70
- * <OrderCompletedTemplate labels={STORE_LOCALE.order} />
71
- *
72
- * The cart drawer and the reviews family were listed here until 2026-09-14.
73
- * They are client components, so they now read the mounted language
74
- * themselves (`useLocaleArea` in ./context); their `labels` prop is an
75
- * override, never a requirement.
76
- */
77
- export type PropLabelAreas = Pick<StorefrontLocale, "products" | "store" | "order">
1
+ import type { CartDrawerLabels } from "../cart-drawer/labels"
2
+ import type { CheckoutLabels } from "../checkout/labels"
3
+ import type { OrderLabels } from "../order/labels"
4
+ import type { ProductLabels } from "../products/labels"
5
+ import type { ReviewsUiLabels } from "../reviews-ui/labels"
6
+ import type { StoreLabels } from "../store/labels"
7
+
8
+ /**
9
+ * A LOCALE IS ONE OBJECT COVERING THE WHOLE STOREFRONT.
10
+ *
11
+ * Before this (2026-09-13) every area shipped its own English defaults and
12
+ * its own Bulgarian file, so localizing a store meant importing six packs
13
+ * and mounting four separate providers, and a global package shipped
14
+ * Bulgarian copy to every merchant on earth. Alexander's ruling: the
15
+ * library is international ENGLISH, and a language is a pack the store
16
+ * opts into.
17
+ *
18
+ * So: English is the library's own default and lives in each area's
19
+ * `labels.ts` beside its type. Every other language is a locale pack
20
+ * imported by subpath — `@cartbase/storefront/locales/es`,
21
+ * `/locales/bg` — and is typed against these six shapes, which means a
22
+ * missing translation is a COMPILE ERROR rather than a silent fall back to
23
+ * English in the middle of a Spanish checkout.
24
+ *
25
+ * Adding a language is one file in `src/locales/` plus its export path.
26
+ * Nothing else in the package changes, and no component knows a language
27
+ * exists.
28
+ */
29
+ export interface StorefrontLocale {
30
+ /** BCP 47 code, for the app's own persistence and for `<html lang>`. */
31
+ code: string
32
+ /** The language's own name, for a switcher that does not want Intl. */
33
+ name: string
34
+ products: ProductLabels
35
+ store: StoreLabels
36
+ cartDrawer: CartDrawerLabels
37
+ checkout: CheckoutLabels
38
+ order: OrderLabels
39
+ reviews: ReviewsUiLabels
40
+ }
41
+
42
+ /**
43
+ * THE AREAS WHOSE PACK THE APP MUST HAND OVER AS A PROP, and the prop is
44
+ * REQUIRED.
45
+ *
46
+ * Not a style choice and not a gap in this layer: a React SERVER component
47
+ * cannot read a client context, and these areas are rendered on the server.
48
+ * `StorefrontLocaleProvider` therefore reaches the client components and
49
+ * nothing else, and a server-rendered heading would stay English however
50
+ * many providers were mounted above it.
51
+ *
52
+ * Since 2026-09-14 the page-level templates of these areas REQUIRE the pack
53
+ * (`labels: StoreLabels`, never `labels?`), so a page that forgets it fails
54
+ * to compile instead of shipping silent English. That was the defect: on
55
+ * 2026-09-13 evoo, a Bulgarian store, ended a product page in the English
56
+ * "Related products / You might also want to check out these products", and
57
+ * its search page and order confirmation stayed English, with no error, no
58
+ * warning and no failing test. English is not a special case: an English
59
+ * store passes `en.store`. The scaffold declares `STORE_LOCALE` once in its
60
+ * config and every page reads its area from it.
61
+ *
62
+ * Hand the pack to each page-level template once and everything inside it
63
+ * follows:
64
+ *
65
+ * <StoreTemplate labels={STORE_LOCALE.store} />
66
+ * <SearchTemplate labels={STORE_LOCALE.store} />
67
+ * <CollectionTemplate labels={STORE_LOCALE.store} />
68
+ * <CategoryTemplate labels={STORE_LOCALE.store} />
69
+ * <ProductTemplate labels={STORE_LOCALE.products} /> // + the related strip
70
+ * <OrderCompletedTemplate labels={STORE_LOCALE.order} />
71
+ *
72
+ * The cart drawer and the reviews family were listed here until 2026-09-14.
73
+ * They are client components, so they now read the mounted language
74
+ * themselves (`useLocaleArea` in ./context); their `labels` prop is an
75
+ * override, never a requirement.
76
+ */
77
+ export type PropLabelAreas = Pick<StorefrontLocale, "products" | "store" | "order">
@@ -1,62 +1,62 @@
1
- /**
2
- * @cartbase/storefront/order — order confirmation + account order views.
3
- * Ported from `@1click/ui/src/order` (v2.3.1) with Cartbase data seams; see
4
- * per-module JSDoc and docs/storefront/components.md for the contracts.
5
- */
6
- export { OrderLabelsProvider, useOrderLabels } from "./context"
7
- export { defaultOrderLabels, type OrderLabels } from "./labels"
8
-
9
- export {
10
- OrderConfirmationHeader,
11
- type OrderConfirmationHeaderProps,
12
- type OrderHeaderData,
13
- } from "./order-confirmation-header"
14
- export {
15
- OrderItem,
16
- displayItemFromOrderItem,
17
- displayItemFromCartLine,
18
- variantLabelFrom,
19
- type OrderItemProps,
20
- type OrderDisplayItem,
21
- type CartLineLike,
22
- } from "./order-item"
23
- export { OrderItemsList, type OrderItemsListProps } from "./order-items-list"
24
- export {
25
- OrderTotals,
26
- selectOrderTotalsRows,
27
- orderTotalsFromSummary,
28
- type OrderTotalsProps,
29
- type OrderTotalsSource,
30
- type OrderTotalsRow,
31
- } from "./order-totals"
32
- export {
33
- OrderAddressCard,
34
- type OrderAddressCardProps,
35
- type OrderContactData,
36
- } from "./order-address-card"
37
- export {
38
- OrderDeliveryCard,
39
- pickTrackingLabels,
40
- type OrderDeliveryCardProps,
41
- type OrderDeliveryData,
42
- type ShippingMethodDisplay,
43
- type TrackingLabel,
44
- } from "./order-delivery-card"
45
- export {
46
- OrderPaymentCard,
47
- resolvePaymentTitle,
48
- type OrderPaymentCardProps,
49
- } from "./order-payment-card"
50
- export {
51
- OrderTimeline,
52
- deriveFulfillmentStatus,
53
- type OrderTimelineProps,
54
- } from "./order-timeline"
55
- export {
56
- OrderHelpSection,
57
- type OrderHelpSectionProps,
58
- } from "./order-help-section"
59
- export {
60
- OrderCompletedTemplate,
61
- type OrderCompletedTemplateProps,
62
- } from "./order-completed-template"
1
+ /**
2
+ * @cartbase/storefront/order — order confirmation + account order views.
3
+ * Ported from `@1click/ui/src/order` (v2.3.1) with Cartbase data seams; see
4
+ * per-module JSDoc and docs/storefront/components.md for the contracts.
5
+ */
6
+ export { OrderLabelsProvider, useOrderLabels } from "./context"
7
+ export { defaultOrderLabels, type OrderLabels } from "./labels"
8
+
9
+ export {
10
+ OrderConfirmationHeader,
11
+ type OrderConfirmationHeaderProps,
12
+ type OrderHeaderData,
13
+ } from "./order-confirmation-header"
14
+ export {
15
+ OrderItem,
16
+ displayItemFromOrderItem,
17
+ displayItemFromCartLine,
18
+ variantLabelFrom,
19
+ type OrderItemProps,
20
+ type OrderDisplayItem,
21
+ type CartLineLike,
22
+ } from "./order-item"
23
+ export { OrderItemsList, type OrderItemsListProps } from "./order-items-list"
24
+ export {
25
+ OrderTotals,
26
+ selectOrderTotalsRows,
27
+ orderTotalsFromSummary,
28
+ type OrderTotalsProps,
29
+ type OrderTotalsSource,
30
+ type OrderTotalsRow,
31
+ } from "./order-totals"
32
+ export {
33
+ OrderAddressCard,
34
+ type OrderAddressCardProps,
35
+ type OrderContactData,
36
+ } from "./order-address-card"
37
+ export {
38
+ OrderDeliveryCard,
39
+ pickTrackingLabels,
40
+ type OrderDeliveryCardProps,
41
+ type OrderDeliveryData,
42
+ type ShippingMethodDisplay,
43
+ type TrackingLabel,
44
+ } from "./order-delivery-card"
45
+ export {
46
+ OrderPaymentCard,
47
+ resolvePaymentTitle,
48
+ type OrderPaymentCardProps,
49
+ } from "./order-payment-card"
50
+ export {
51
+ OrderTimeline,
52
+ deriveFulfillmentStatus,
53
+ type OrderTimelineProps,
54
+ } from "./order-timeline"
55
+ export {
56
+ OrderHelpSection,
57
+ type OrderHelpSectionProps,
58
+ } from "./order-help-section"
59
+ export {
60
+ OrderCompletedTemplate,
61
+ type OrderCompletedTemplateProps,
62
+ } from "./order-completed-template"
@@ -1,79 +1,79 @@
1
- /**
2
- * Order family label pack. Ported from `@1click/ui/src/order/labels.ts`
3
- * (v2.3.1) unchanged, plus `tracking` — new in the Cartbase port because the
4
- * Cartbase order surface exposes fulfillment tracking labels
5
- * (`StoreOrderDetail.fulfillments[].fulfillment.labels`) that
6
- * `OrderDeliveryCard` now renders.
7
- */
8
- export type OrderLabels = {
9
- orderConfirmed: string
10
- confirmationSent: string
11
- orderNumber: string
12
- orderDate: string
13
- summary: string
14
- subtotal: string
15
- shipping: string
16
- discount: string
17
- tax: string
18
- total: string
19
- /** Default label for the cash-on-delivery fee row. Used as the third-
20
- * level fallback when neither a per-store override nor the server's
21
- * `payment_method_fee_label` / fee line title is available. */
22
- paymentMethodFee: string
23
- contactInfo: string
24
- delivery: string
25
- paymentMethod: string
26
- paymentMethodTitles: {
27
- card: string
28
- cod: string
29
- /** Offline manual payments (pp_manual) — NOT cash on delivery. */
30
- manual: string
31
- paypal: string
32
- }
33
- needHelp: string
34
- contactUs: string
35
- returnsExchanges: string
36
- orderPlaced: string
37
- processing: string
38
- shipped: string
39
- delivered: string
40
- free: string
41
- continueShopping: string
42
- qty: string
43
- /** Heading for the fulfillment tracking-numbers block (Cartbase addition). */
44
- tracking: string
45
- }
46
-
47
- export const defaultOrderLabels: OrderLabels = {
48
- orderConfirmed: "Order confirmed",
49
- confirmationSent: "We sent a confirmation to",
50
- orderNumber: "Order",
51
- orderDate: "Date",
52
- summary: "Order summary",
53
- subtotal: "Subtotal",
54
- shipping: "Shipping",
55
- discount: "Discount",
56
- tax: "Tax",
57
- total: "Total",
58
- paymentMethodFee: "Payment method fee",
59
- contactInfo: "Contact info",
60
- delivery: "Delivery",
61
- paymentMethod: "Payment method",
62
- paymentMethodTitles: {
63
- card: "Credit / debit card",
64
- cod: "Cash on delivery",
65
- manual: "Manual payment",
66
- paypal: "PayPal",
67
- },
68
- needHelp: "Need help?",
69
- contactUs: "Contact us",
70
- returnsExchanges: "Returns & exchanges",
71
- orderPlaced: "Placed",
72
- processing: "Processing",
73
- shipped: "Shipped",
74
- delivered: "Delivered",
75
- free: "FREE",
76
- continueShopping: "Continue shopping",
77
- qty: "qty.",
78
- tracking: "Tracking",
79
- }
1
+ /**
2
+ * Order family label pack. Ported from `@1click/ui/src/order/labels.ts`
3
+ * (v2.3.1) unchanged, plus `tracking` — new in the Cartbase port because the
4
+ * Cartbase order surface exposes fulfillment tracking labels
5
+ * (`StoreOrderDetail.fulfillments[].fulfillment.labels`) that
6
+ * `OrderDeliveryCard` now renders.
7
+ */
8
+ export type OrderLabels = {
9
+ orderConfirmed: string
10
+ confirmationSent: string
11
+ orderNumber: string
12
+ orderDate: string
13
+ summary: string
14
+ subtotal: string
15
+ shipping: string
16
+ discount: string
17
+ tax: string
18
+ total: string
19
+ /** Default label for the cash-on-delivery fee row. Used as the third-
20
+ * level fallback when neither a per-store override nor the server's
21
+ * `payment_method_fee_label` / fee line title is available. */
22
+ paymentMethodFee: string
23
+ contactInfo: string
24
+ delivery: string
25
+ paymentMethod: string
26
+ paymentMethodTitles: {
27
+ card: string
28
+ cod: string
29
+ /** Offline manual payments (pp_manual) — NOT cash on delivery. */
30
+ manual: string
31
+ paypal: string
32
+ }
33
+ needHelp: string
34
+ contactUs: string
35
+ returnsExchanges: string
36
+ orderPlaced: string
37
+ processing: string
38
+ shipped: string
39
+ delivered: string
40
+ free: string
41
+ continueShopping: string
42
+ qty: string
43
+ /** Heading for the fulfillment tracking-numbers block (Cartbase addition). */
44
+ tracking: string
45
+ }
46
+
47
+ export const defaultOrderLabels: OrderLabels = {
48
+ orderConfirmed: "Order confirmed",
49
+ confirmationSent: "We sent a confirmation to",
50
+ orderNumber: "Order",
51
+ orderDate: "Date",
52
+ summary: "Order summary",
53
+ subtotal: "Subtotal",
54
+ shipping: "Shipping",
55
+ discount: "Discount",
56
+ tax: "Tax",
57
+ total: "Total",
58
+ paymentMethodFee: "Payment method fee",
59
+ contactInfo: "Contact info",
60
+ delivery: "Delivery",
61
+ paymentMethod: "Payment method",
62
+ paymentMethodTitles: {
63
+ card: "Credit / debit card",
64
+ cod: "Cash on delivery",
65
+ manual: "Manual payment",
66
+ paypal: "PayPal",
67
+ },
68
+ needHelp: "Need help?",
69
+ contactUs: "Contact us",
70
+ returnsExchanges: "Returns & exchanges",
71
+ orderPlaced: "Placed",
72
+ processing: "Processing",
73
+ shipped: "Shipped",
74
+ delivered: "Delivered",
75
+ free: "FREE",
76
+ continueShopping: "Continue shopping",
77
+ qty: "qty.",
78
+ tracking: "Tracking",
79
+ }