@cartbase/storefront 0.2.0 → 0.3.0

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.
@@ -1,263 +1,263 @@
1
- /**
2
- * Checkout labels — default English copy.
3
- *
4
- * Ported from `@1click/ui/src/checkout/labels.ts` (v2.3.1) with the
5
- * Cartbase additions: gift-card tender labels (`giftCard*`) for the new
6
- * GiftCardSection (gift cards are a Cartbase feature with no @1click
7
- * equivalent — docs/storefront/gift-cards.md).
8
- *
9
- * Every user-facing string in the checkout module comes from a
10
- * `CheckoutLabels` object. Stores override strings by passing a partial
11
- * labels object to `CheckoutProvider`. English is the baseline; stores
12
- * wanting Bulgarian, German, etc. pass their own translations.
13
- */
14
-
15
- export type CheckoutLabels = {
16
- // Section headings
17
- deliveryInfo: string
18
- shippingServices: string
19
- paymentMethod: string
20
- orderSummary: string
21
-
22
- // Form fields
23
- email: string
24
- country: string
25
- /**
26
- * Localized name of the single-region country (e.g. "България"). When
27
- * the checkout renders with exactly one country, the country select
28
- * collapses to a readonly field showing this name instead of the
29
- * dropdown's English `display_name`. Optional — falls back to the
30
- * country's `display_name` when omitted.
31
- */
32
- singleCountryName?: string
33
- firstName: string
34
- lastName: string
35
- address: string
36
- apartment: string
37
- city: string
38
- postalCode: string
39
- phone: string
40
- province: string
41
-
42
- // Buttons
43
- saveAddress: string
44
- updateAddress: string
45
- addToOrder: string
46
- addCode: string
47
-
48
- // States / empty / disabled
49
- deliveryDisabled: string
50
- noShippingOptions: string
51
- paymentDisabled: string
52
- /** Shown above the shipping options when they render as a read-only
53
- * price preview before the address is entered (stores that opt into
54
- * `previewWhenAddressNotReady`). */
55
- deliveryPreviewHint: string
56
- /** Hint under the disabled Buy button explaining what's still missing. */
57
- buyNeedsAddress: string
58
- buyNeedsDelivery: string
59
-
60
- // Payment tabs
61
- codNote: string
62
- /** Online-payment radio label. Covers every Stripe-enabled method
63
- * (card + Apple Pay + Google Pay + Link + whatever else is turned on
64
- * in the Stripe Dashboard). Replaces the old `payByCard`. */
65
- payOnline: string
66
- cashOnDelivery: string
67
- termsText: string
68
-
69
- // Address reuse
70
- useSavedAddress: string
71
- saveInfo: string
72
-
73
- // Saved address picker
74
- chooseAddress: string
75
-
76
- // Order summary
77
- items: string
78
- qty: string
79
- subtotal: string
80
- shipping: string
81
- shippingCalc: string
82
- shippingFree: string
83
- tax: string
84
- taxTooltip: string
85
- total: string
86
- discount: string
87
- discountCode: string
88
- discountSub: string
89
- /** Default label for the cash-on-delivery fee row. Used as the third-
90
- * level fallback when neither the cart's `cod_fee_label` (Cartbase
91
- * server truth) nor a per-store override is available. */
92
- codFee: string
93
- recommended: string
94
- recommendedSoon: string
95
- recommendedSoonSub: string
96
- remove: string
97
- secureCheckout: string
98
-
99
- // Gift cards (Cartbase gift-card tender — docs/storefront/gift-cards.md)
100
- giftCard: string
101
- giftCardSub: string
102
- giftCardPlaceholder: string
103
- /** Row label for the summary's gift-card tender line ("Gift cards −X"). */
104
- giftCardApplied: string
105
- /** Label for the remainder row ("Remaining to pay"). Rendered only when
106
- * gift cards cover part of the total (`gift_card_total > 0`). */
107
- giftCardRemaining: string
108
- /** Prefix for an applied card chip, followed by the masked last4
109
- * (e.g. "Gift card ••••1234"). */
110
- giftCardEnding: string
111
-
112
- // Company invoice
113
- companyInvoice: string
114
- companyName: string
115
- companyVat: string
116
- companyMol: string
117
- companyAddress: string
118
-
119
- // Place order button
120
- placeOrder: string
121
- selectPaymentMethod: string
122
-
123
- /**
124
- * Processing-state messages shown beneath the spinning Buy button
125
- * while `performBuyClick` is in flight. Cycle through with a fade
126
- * transition every ~1.8s; on long flows (3DS challenges, slow
127
- * networks) the cycle loops back to index 0.
128
- *
129
- * Two arrays so card and COD show different micro-narratives — card
130
- * mentions the bank handshake (the slow part), COD jumps straight
131
- * to delivery + order. The closing entry should be a brand-flavored
132
- * line that's still honest to the "processing" moment (don't say
133
- * "packing" — nothing is being packed yet).
134
- */
135
- processingCard: string[]
136
- processingCod: string[]
137
-
138
- // Econt office selector
139
- econtLoadingOffices: string
140
- econtNearestOffices: string
141
- econtSearchAnother: string
142
- econtSearchPlaceholder: string
143
- econtNoResults: string
144
- econtChange: string
145
-
146
- // BoxNow locker selector
147
- boxnowLoadingLockers: string
148
- boxnowNearestLockers: string
149
- boxnowSearchAnother: string
150
- boxnowSearchPlaceholder: string
151
- boxnowNoResults: string
152
- boxnowChange: string
153
- boxnowUnavailable: string
154
- boxnowNoLockersInCity: string
155
- }
156
-
157
- export const defaultCheckoutLabels: CheckoutLabels = {
158
- deliveryInfo: "Delivery information",
159
- shippingServices: "Shipping method",
160
- paymentMethod: "Payment method",
161
- orderSummary: "Order summary",
162
-
163
- email: "Email",
164
- country: "Country",
165
- singleCountryName: undefined,
166
- firstName: "First name",
167
- lastName: "Last name",
168
- address: "Address",
169
- apartment: "Apartment, suite, etc. (optional)",
170
- city: "City",
171
- postalCode: "Postal code",
172
- phone: "Phone",
173
- province: "State / province",
174
-
175
- saveAddress: "Save and continue",
176
- updateAddress: "Update address",
177
- addToOrder: "+ Add to order",
178
- addCode: "Apply",
179
-
180
- deliveryDisabled:
181
- "Enter your delivery address to see available shipping options.",
182
- noShippingOptions: "No shipping options available for your address.",
183
- paymentDisabled: "Select a shipping method to continue.",
184
- deliveryPreviewHint: "Enter your address to choose a delivery method.",
185
- buyNeedsAddress: "Enter your delivery address",
186
- buyNeedsDelivery: "Choose a delivery method",
187
-
188
- codNote: "Cash on delivery. Additional fees may apply.",
189
- payOnline: "Pay online",
190
- cashOnDelivery: "Cash on delivery",
191
- termsText:
192
- "By placing your order you accept our Terms and Privacy Policy.",
193
-
194
- useSavedAddress: "Use a saved address?",
195
- saveInfo: "Save this information for next time",
196
-
197
- chooseAddress: "Choose an address",
198
-
199
- items: "items",
200
- qty: "Qty",
201
- subtotal: "Subtotal",
202
- shipping: "Shipping",
203
- shippingCalc: "Calculated at checkout",
204
- shippingFree: "Free",
205
- tax: "VAT incl.",
206
- taxTooltip: "20% VAT is included in prices",
207
- total: "Total",
208
- discount: "Discount",
209
- discountCode: "Discount code",
210
- discountSub: "Save with a promo code",
211
- codFee: "Cash on delivery fee",
212
- recommended: "Recommended for you",
213
- recommendedSoon: "Coming soon",
214
- recommendedSoonSub: "Personalized recommendations",
215
- remove: "Remove",
216
- secureCheckout: "Secure checkout",
217
-
218
- giftCard: "Gift card",
219
- giftCardSub: "Redeem a gift card",
220
- giftCardPlaceholder: "GIFT-XXXX-XXXX",
221
- giftCardApplied: "Gift cards",
222
- giftCardRemaining: "Remaining to pay",
223
- giftCardEnding: "Gift card ending in",
224
-
225
- companyInvoice: "Company invoice",
226
- companyName: "Company name",
227
- companyVat: "VAT / Company number",
228
- companyMol: "Responsible person",
229
- companyAddress: "Company address",
230
-
231
- placeOrder: "Place order",
232
- selectPaymentMethod: "Select a payment method",
233
-
234
- processingCard: [
235
- "Connecting to the bank...",
236
- "Confirming the payment...",
237
- "Recording the order...",
238
- "Attending to every detail...",
239
- ],
240
- processingCod: [
241
- "Reserving the delivery...",
242
- "Preparing the order...",
243
- "Attending to every detail...",
244
- ],
245
-
246
- econtLoadingOffices: "Loading offices...",
247
- econtNearestOffices: "Nearest offices",
248
- econtSearchAnother: "Search for another office",
249
- econtSearchPlaceholder: "Search by name, city, or address...",
250
- econtNoResults: "No offices found for",
251
- econtChange: "Change",
252
-
253
- boxnowLoadingLockers: "Loading lockers...",
254
- boxnowNearestLockers: "Nearest lockers",
255
- boxnowSearchAnother: "Search for another locker",
256
- boxnowSearchPlaceholder: "Search by name, address, or postal code...",
257
- boxnowNoResults: "No lockers found for",
258
- boxnowChange: "Change",
259
- boxnowUnavailable:
260
- "BoxNow is temporarily unavailable, please choose a different shipping method.",
261
- boxnowNoLockersInCity:
262
- "No BoxNow lockers found in your city. Please choose a different shipping method.",
263
- }
1
+ /**
2
+ * Checkout labels — default English copy.
3
+ *
4
+ * Ported from `@1click/ui/src/checkout/labels.ts` (v2.3.1) with the
5
+ * Cartbase additions: gift-card tender labels (`giftCard*`) for the new
6
+ * GiftCardSection (gift cards are a Cartbase feature with no @1click
7
+ * equivalent — docs/storefront/gift-cards.md).
8
+ *
9
+ * Every user-facing string in the checkout module comes from a
10
+ * `CheckoutLabels` object. Stores override strings by passing a partial
11
+ * labels object to `CheckoutProvider`. English is the baseline; stores
12
+ * wanting Bulgarian, German, etc. pass their own translations.
13
+ */
14
+
15
+ export type CheckoutLabels = {
16
+ // Section headings
17
+ deliveryInfo: string
18
+ shippingServices: string
19
+ paymentMethod: string
20
+ orderSummary: string
21
+
22
+ // Form fields
23
+ email: string
24
+ country: string
25
+ /**
26
+ * Localized name of the single-region country (e.g. "България"). When
27
+ * the checkout renders with exactly one country, the country select
28
+ * collapses to a readonly field showing this name instead of the
29
+ * dropdown's English `display_name`. Optional — falls back to the
30
+ * country's `display_name` when omitted.
31
+ */
32
+ singleCountryName?: string
33
+ firstName: string
34
+ lastName: string
35
+ address: string
36
+ apartment: string
37
+ city: string
38
+ postalCode: string
39
+ phone: string
40
+ province: string
41
+
42
+ // Buttons
43
+ saveAddress: string
44
+ updateAddress: string
45
+ addToOrder: string
46
+ addCode: string
47
+
48
+ // States / empty / disabled
49
+ deliveryDisabled: string
50
+ noShippingOptions: string
51
+ paymentDisabled: string
52
+ /** Shown above the shipping options when they render as a read-only
53
+ * price preview before the address is entered (stores that opt into
54
+ * `previewWhenAddressNotReady`). */
55
+ deliveryPreviewHint: string
56
+ /** Hint under the disabled Buy button explaining what's still missing. */
57
+ buyNeedsAddress: string
58
+ buyNeedsDelivery: string
59
+
60
+ // Payment tabs
61
+ codNote: string
62
+ /** Online-payment radio label. Covers every Stripe-enabled method
63
+ * (card + Apple Pay + Google Pay + Link + whatever else is turned on
64
+ * in the Stripe Dashboard). Replaces the old `payByCard`. */
65
+ payOnline: string
66
+ cashOnDelivery: string
67
+ termsText: string
68
+
69
+ // Address reuse
70
+ useSavedAddress: string
71
+ saveInfo: string
72
+
73
+ // Saved address picker
74
+ chooseAddress: string
75
+
76
+ // Order summary
77
+ items: string
78
+ qty: string
79
+ subtotal: string
80
+ shipping: string
81
+ shippingCalc: string
82
+ shippingFree: string
83
+ tax: string
84
+ taxTooltip: string
85
+ total: string
86
+ discount: string
87
+ discountCode: string
88
+ discountSub: string
89
+ /** Default label for the cash-on-delivery fee row. Used as the third-
90
+ * level fallback when neither the cart's `payment_method_fee_label` (Cartbase
91
+ * server truth) nor a per-store override is available. */
92
+ paymentMethodFee: string
93
+ recommended: string
94
+ recommendedSoon: string
95
+ recommendedSoonSub: string
96
+ remove: string
97
+ secureCheckout: string
98
+
99
+ // Gift cards (Cartbase gift-card tender — docs/storefront/gift-cards.md)
100
+ giftCard: string
101
+ giftCardSub: string
102
+ giftCardPlaceholder: string
103
+ /** Row label for the summary's gift-card tender line ("Gift cards −X"). */
104
+ giftCardApplied: string
105
+ /** Label for the remainder row ("Remaining to pay"). Rendered only when
106
+ * gift cards cover part of the total (`gift_card_total > 0`). */
107
+ giftCardRemaining: string
108
+ /** Prefix for an applied card chip, followed by the masked last4
109
+ * (e.g. "Gift card ••••1234"). */
110
+ giftCardEnding: string
111
+
112
+ // Company invoice
113
+ companyInvoice: string
114
+ companyName: string
115
+ companyVat: string
116
+ companyMol: string
117
+ companyAddress: string
118
+
119
+ // Place order button
120
+ placeOrder: string
121
+ selectPaymentMethod: string
122
+
123
+ /**
124
+ * Processing-state messages shown beneath the spinning Buy button
125
+ * while `performBuyClick` is in flight. Cycle through with a fade
126
+ * transition every ~1.8s; on long flows (3DS challenges, slow
127
+ * networks) the cycle loops back to index 0.
128
+ *
129
+ * Two arrays so card and COD show different micro-narratives — card
130
+ * mentions the bank handshake (the slow part), COD jumps straight
131
+ * to delivery + order. The closing entry should be a brand-flavored
132
+ * line that's still honest to the "processing" moment (don't say
133
+ * "packing" — nothing is being packed yet).
134
+ */
135
+ processingCard: string[]
136
+ processingCod: string[]
137
+
138
+ // Econt office selector
139
+ econtLoadingOffices: string
140
+ econtNearestOffices: string
141
+ econtSearchAnother: string
142
+ econtSearchPlaceholder: string
143
+ econtNoResults: string
144
+ econtChange: string
145
+
146
+ // BoxNow locker selector
147
+ boxnowLoadingLockers: string
148
+ boxnowNearestLockers: string
149
+ boxnowSearchAnother: string
150
+ boxnowSearchPlaceholder: string
151
+ boxnowNoResults: string
152
+ boxnowChange: string
153
+ boxnowUnavailable: string
154
+ boxnowNoLockersInCity: string
155
+ }
156
+
157
+ export const defaultCheckoutLabels: CheckoutLabels = {
158
+ deliveryInfo: "Delivery information",
159
+ shippingServices: "Shipping method",
160
+ paymentMethod: "Payment method",
161
+ orderSummary: "Order summary",
162
+
163
+ email: "Email",
164
+ country: "Country",
165
+ singleCountryName: undefined,
166
+ firstName: "First name",
167
+ lastName: "Last name",
168
+ address: "Address",
169
+ apartment: "Apartment, suite, etc. (optional)",
170
+ city: "City",
171
+ postalCode: "Postal code",
172
+ phone: "Phone",
173
+ province: "State / province",
174
+
175
+ saveAddress: "Save and continue",
176
+ updateAddress: "Update address",
177
+ addToOrder: "+ Add to order",
178
+ addCode: "Apply",
179
+
180
+ deliveryDisabled:
181
+ "Enter your delivery address to see available shipping options.",
182
+ noShippingOptions: "No shipping options available for your address.",
183
+ paymentDisabled: "Select a shipping method to continue.",
184
+ deliveryPreviewHint: "Enter your address to choose a delivery method.",
185
+ buyNeedsAddress: "Enter your delivery address",
186
+ buyNeedsDelivery: "Choose a delivery method",
187
+
188
+ codNote: "Cash on delivery. Additional fees may apply.",
189
+ payOnline: "Pay online",
190
+ cashOnDelivery: "Cash on delivery",
191
+ termsText:
192
+ "By placing your order you accept our Terms and Privacy Policy.",
193
+
194
+ useSavedAddress: "Use a saved address?",
195
+ saveInfo: "Save this information for next time",
196
+
197
+ chooseAddress: "Choose an address",
198
+
199
+ items: "items",
200
+ qty: "Qty",
201
+ subtotal: "Subtotal",
202
+ shipping: "Shipping",
203
+ shippingCalc: "Calculated at checkout",
204
+ shippingFree: "Free",
205
+ tax: "VAT incl.",
206
+ taxTooltip: "20% VAT is included in prices",
207
+ total: "Total",
208
+ discount: "Discount",
209
+ discountCode: "Discount code",
210
+ discountSub: "Save with a promo code",
211
+ paymentMethodFee: "Payment method fee",
212
+ recommended: "Recommended for you",
213
+ recommendedSoon: "Coming soon",
214
+ recommendedSoonSub: "Personalized recommendations",
215
+ remove: "Remove",
216
+ secureCheckout: "Secure checkout",
217
+
218
+ giftCard: "Gift card",
219
+ giftCardSub: "Redeem a gift card",
220
+ giftCardPlaceholder: "GIFT-XXXX-XXXX",
221
+ giftCardApplied: "Gift cards",
222
+ giftCardRemaining: "Remaining to pay",
223
+ giftCardEnding: "Gift card ending in",
224
+
225
+ companyInvoice: "Company invoice",
226
+ companyName: "Company name",
227
+ companyVat: "VAT / Company number",
228
+ companyMol: "Responsible person",
229
+ companyAddress: "Company address",
230
+
231
+ placeOrder: "Place order",
232
+ selectPaymentMethod: "Select a payment method",
233
+
234
+ processingCard: [
235
+ "Connecting to the bank...",
236
+ "Confirming the payment...",
237
+ "Recording the order...",
238
+ "Attending to every detail...",
239
+ ],
240
+ processingCod: [
241
+ "Reserving the delivery...",
242
+ "Preparing the order...",
243
+ "Attending to every detail...",
244
+ ],
245
+
246
+ econtLoadingOffices: "Loading offices...",
247
+ econtNearestOffices: "Nearest offices",
248
+ econtSearchAnother: "Search for another office",
249
+ econtSearchPlaceholder: "Search by name, city, or address...",
250
+ econtNoResults: "No offices found for",
251
+ econtChange: "Change",
252
+
253
+ boxnowLoadingLockers: "Loading lockers...",
254
+ boxnowNearestLockers: "Nearest lockers",
255
+ boxnowSearchAnother: "Search for another locker",
256
+ boxnowSearchPlaceholder: "Search by name, address, or postal code...",
257
+ boxnowNoResults: "No lockers found for",
258
+ boxnowChange: "Change",
259
+ boxnowUnavailable:
260
+ "BoxNow is temporarily unavailable, please choose a different shipping method.",
261
+ boxnowNoLockersInCity:
262
+ "No BoxNow lockers found in your city. Please choose a different shipping method.",
263
+ }