@vtex/faststore 0.0.8 → 0.0.11

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 (568) hide show
  1. package/CHANGELOG.md +101 -0
  2. package/README.md +0 -1
  3. package/dist/actions.json +48 -1
  4. package/dist/catalog.json +1397 -1594
  5. package/dist/cli/index.d.ts +66 -28
  6. package/dist/cli/index.js +7371 -512
  7. package/dist/cli/index.js.map +1 -1
  8. package/dist/cli/server-runtime.js +41 -60
  9. package/dist/cli/server-runtime.js.map +1 -1
  10. package/dist/client.d.ts +3 -3
  11. package/dist/client.js +2 -2
  12. package/dist/components.d.ts +67 -56
  13. package/dist/components.js +64 -53
  14. package/dist/content-types.json +5886 -555
  15. package/dist/core/dist/define-component.d.ts +7 -2
  16. package/dist/core/dist/define-content-type.d.ts +50 -2
  17. package/dist/core/dist/define-content-type.js +107 -3
  18. package/dist/core/dist/define-content-type.js.map +1 -1
  19. package/dist/core/dist/index.d.ts +2 -2
  20. package/dist/docs/access-code-field.md +1 -1
  21. package/dist/docs/access-code-sign-in.md +126 -77
  22. package/dist/docs/account-address-book.md +210 -95
  23. package/dist/docs/account-entry-point.md +4 -4
  24. package/dist/docs/account-menu.md +16 -17
  25. package/dist/docs/account-saved-cards.md +306 -0
  26. package/dist/docs/alert-dialog.md +3 -1
  27. package/dist/docs/avatar.md +4 -2
  28. package/dist/docs/billing-address.md +99 -30
  29. package/dist/docs/binding-switcher.md +157 -0
  30. package/dist/docs/buy-button.md +7 -8
  31. package/dist/docs/card-entry.md +42 -29
  32. package/dist/docs/card-summary.md +185 -0
  33. package/dist/docs/cardholder-document.md +5 -3
  34. package/dist/docs/carousel.md +5 -4
  35. package/dist/docs/cart-destination.md +251 -0
  36. package/dist/docs/cart-item.md +48 -15
  37. package/dist/docs/cart-totalizer.md +8 -6
  38. package/dist/docs/cart.md +240 -39
  39. package/dist/docs/challenge-return.md +135 -0
  40. package/dist/docs/client-preferences-fieldset.md +10 -5
  41. package/dist/docs/client-preferences.md +31 -8
  42. package/dist/docs/client-profile-fieldset.md +20 -6
  43. package/dist/docs/client-profile.md +12 -3
  44. package/dist/docs/copy-text.md +9 -7
  45. package/dist/docs/document-field.md +1 -1
  46. package/dist/docs/email-field.md +2 -1
  47. package/dist/docs/email-identification.md +12 -2
  48. package/dist/docs/footer-copyright.md +4 -2
  49. package/dist/docs/footer-social.md +1 -1
  50. package/dist/docs/form.md +54 -18
  51. package/dist/docs/free-shipping-progress.md +18 -13
  52. package/dist/docs/identity-edit.md +8 -2
  53. package/dist/docs/identity-summary.md +18 -5
  54. package/dist/docs/incentives.md +2 -2
  55. package/dist/docs/installments.md +46 -32
  56. package/dist/docs/logo.md +1 -1
  57. package/dist/docs/my-account-profile.md +16 -11
  58. package/dist/docs/navigation-link.md +5 -3
  59. package/dist/docs/order-cancel.md +3 -1
  60. package/dist/docs/order-delivery-address.md +7 -5
  61. package/dist/docs/order-delivery-group.md +1 -3
  62. package/dist/docs/order-details-back.md +1 -1
  63. package/dist/docs/order-details-header.md +1 -4
  64. package/dist/docs/order-invoice-download.md +60 -0
  65. package/dist/docs/order-list-row.md +1 -1
  66. package/dist/docs/order-list-search.md +13 -20
  67. package/dist/docs/order-list-views.md +11 -17
  68. package/dist/docs/order-list.md +12 -5
  69. package/dist/docs/order-payment.md +9 -7
  70. package/dist/docs/order-placed-date.md +1 -1
  71. package/dist/docs/order-placed-payment-summary.md +28 -15
  72. package/dist/docs/order-placed.md +49 -14
  73. package/dist/docs/order-progress.md +1 -1
  74. package/dist/docs/order-status-badge.md +20 -9
  75. package/dist/docs/order-summary.md +2 -2
  76. package/dist/docs/order-tracking-link.md +58 -0
  77. package/dist/docs/payment-method-badges.md +32 -6
  78. package/dist/docs/payment-methods.md +2 -2
  79. package/dist/docs/payment.md +36 -17
  80. package/dist/docs/phone-field.md +4 -4
  81. package/dist/docs/place-order.md +84 -36
  82. package/dist/docs/postal-code-field.md +3 -1
  83. package/dist/docs/pricing.md +21 -23
  84. package/dist/docs/product-gallery.md +19 -20
  85. package/dist/docs/product-information.md +14 -10
  86. package/dist/docs/product-list.md +7 -6
  87. package/dist/docs/product-shelf.md +7 -1
  88. package/dist/docs/promotion.md +4 -2
  89. package/dist/docs/region.md +23 -15
  90. package/dist/docs/save-card.md +7 -6
  91. package/dist/docs/saved-cards.md +65 -36
  92. package/dist/docs/select.md +3 -4
  93. package/dist/docs/shipping-address.md +57 -21
  94. package/dist/docs/shipping-simulator.md +53 -15
  95. package/dist/docs/sign-in-disclosure.md +176 -0
  96. package/dist/docs/sign-in-form.md +78 -47
  97. package/dist/docs/sign-in-redirect.md +5 -3
  98. package/dist/docs/sign-in.md +173 -0
  99. package/dist/docs/toast.md +45 -16
  100. package/dist/docs/variant-selector.md +15 -11
  101. package/dist/graphql/types.d.ts +4 -14
  102. package/dist/index.d.ts +3 -2
  103. package/dist/internal/client.d.ts +4 -3
  104. package/dist/internal/client.js +5 -2
  105. package/dist/internal/server.d.ts +10 -5
  106. package/dist/internal/server.js +9 -4
  107. package/dist/matter/access-code-sign-in/access-code-sign-in.d.ts +250 -66
  108. package/dist/matter/access-code-sign-in/access-code-sign-in.js +459 -188
  109. package/dist/matter/access-code-sign-in/access-code-sign-in.js.map +1 -1
  110. package/dist/matter/account-address-book/account-address-book-delete.d.ts +78 -40
  111. package/dist/matter/account-address-book/account-address-book-delete.js +86 -50
  112. package/dist/matter/account-address-book/account-address-book-delete.js.map +1 -1
  113. package/dist/matter/account-address-book/account-address-book-deliverability.d.ts +21 -4
  114. package/dist/matter/account-address-book/account-address-book-deliverability.js +45 -17
  115. package/dist/matter/account-address-book/account-address-book-deliverability.js.map +1 -1
  116. package/dist/matter/account-address-book/account-address-book-form-parts.d.ts +74 -19
  117. package/dist/matter/account-address-book/account-address-book-form-parts.js +77 -26
  118. package/dist/matter/account-address-book/account-address-book-form-parts.js.map +1 -1
  119. package/dist/matter/account-address-book/account-address-book-profile-notice.d.ts +27 -6
  120. package/dist/matter/account-address-book/account-address-book-profile-notice.js +55 -28
  121. package/dist/matter/account-address-book/account-address-book-profile-notice.js.map +1 -1
  122. package/dist/matter/account-address-book/account-address-book.d.ts +67 -14
  123. package/dist/matter/account-address-book/account-address-book.js +74 -33
  124. package/dist/matter/account-address-book/account-address-book.js.map +1 -1
  125. package/dist/matter/account-address-book/account-address-country-switch.js +3 -3
  126. package/dist/matter/account-address-book/account-address-country-switch.js.map +1 -1
  127. package/dist/matter/account-address-book/account-address-country.d.ts +66 -20
  128. package/dist/matter/account-address-book/account-address-country.js +83 -49
  129. package/dist/matter/account-address-book/account-address-country.js.map +1 -1
  130. package/dist/matter/account-address-book/account-address-form-context.d.ts +8 -4
  131. package/dist/matter/account-address-book/account-address-form-context.js.map +1 -1
  132. package/dist/matter/account-address-book/account-address-form.d.ts +468 -45
  133. package/dist/matter/account-address-book/account-address-form.js +518 -155
  134. package/dist/matter/account-address-book/account-address-form.js.map +1 -1
  135. package/dist/matter/account-address-book/account-address-record.d.ts +27 -6
  136. package/dist/matter/account-address-book/account-address-record.js +32 -17
  137. package/dist/matter/account-address-book/account-address-record.js.map +1 -1
  138. package/dist/matter/account-menu/account-menu.d.ts +34 -17
  139. package/dist/matter/account-menu/account-menu.js +46 -54
  140. package/dist/matter/account-menu/account-menu.js.map +1 -1
  141. package/dist/matter/account-menu-identity/account-menu-identity.js +1 -1
  142. package/dist/matter/account-saved-cards/account-saved-cards.d.ts +463 -0
  143. package/dist/matter/account-saved-cards/account-saved-cards.js +1011 -0
  144. package/dist/matter/account-saved-cards/account-saved-cards.js.map +1 -0
  145. package/dist/matter/billing-address/billing-address.d.ts +156 -74
  146. package/dist/matter/billing-address/billing-address.js +227 -156
  147. package/dist/matter/billing-address/billing-address.js.map +1 -1
  148. package/dist/matter/breadcrumb/breadcrumb.d.ts +21 -3
  149. package/dist/matter/breadcrumb/breadcrumb.js +24 -9
  150. package/dist/matter/breadcrumb/breadcrumb.js.map +1 -1
  151. package/dist/matter/buy-button/buy-button.d.ts +8 -11
  152. package/dist/matter/buy-button/buy-button.js +10 -19
  153. package/dist/matter/buy-button/buy-button.js.map +1 -1
  154. package/dist/matter/card-entry/card-capture.js +12 -4
  155. package/dist/matter/card-entry/card-capture.js.map +1 -1
  156. package/dist/matter/card-entry/card-entry.d.ts +123 -32
  157. package/dist/matter/card-entry/card-entry.js +348 -221
  158. package/dist/matter/card-entry/card-entry.js.map +1 -1
  159. package/dist/matter/cart/cart-namespace.d.ts +11 -1
  160. package/dist/matter/cart/cart-namespace.js +11 -1
  161. package/dist/matter/cart/cart-namespace.js.map +1 -1
  162. package/dist/matter/cart/cart.d.ts +416 -45
  163. package/dist/matter/cart/cart.js +782 -101
  164. package/dist/matter/cart/cart.js.map +1 -1
  165. package/dist/matter/cart-destination/cart-destination.d.ts +233 -0
  166. package/dist/matter/cart-destination/cart-destination.js +703 -0
  167. package/dist/matter/cart-destination/cart-destination.js.map +1 -0
  168. package/dist/matter/cart-item/cart-item.d.ts +145 -16
  169. package/dist/matter/cart-item/cart-item.js +230 -54
  170. package/dist/matter/cart-item/cart-item.js.map +1 -1
  171. package/dist/matter/cart-item-compositions/cart-item-compositions.js +1 -1
  172. package/dist/matter/cart-item-compositions/cart-item-compositions.js.map +1 -1
  173. package/dist/matter/cart-item-customizations/cart-item-customizations.js +1 -1
  174. package/dist/matter/cart-item-customizations/cart-item-customizations.js.map +1 -1
  175. package/dist/matter/cart-item-discounts/cart-item-discounts.js +1 -1
  176. package/dist/matter/cart-item-discounts/cart-item-discounts.js.map +1 -1
  177. package/dist/matter/cart-item-seller-info/cart-item-seller-info.js +1 -1
  178. package/dist/matter/cart-item-seller-info/cart-item-seller-info.js.map +1 -1
  179. package/dist/matter/cart-item-variations/cart-item-variations.js +1 -1
  180. package/dist/matter/cart-item-variations/cart-item-variations.js.map +1 -1
  181. package/dist/matter/cart-totalizer/cart-totalizer.d.ts +43 -9
  182. package/dist/matter/cart-totalizer/cart-totalizer.js +49 -19
  183. package/dist/matter/cart-totalizer/cart-totalizer.js.map +1 -1
  184. package/dist/matter/challenge-return/challenge-return.d.ts +62 -0
  185. package/dist/matter/challenge-return/challenge-return.js +241 -0
  186. package/dist/matter/challenge-return/challenge-return.js.map +1 -0
  187. package/dist/matter/client-preferences/client-preferences-fieldset.d.ts +86 -17
  188. package/dist/matter/client-preferences/client-preferences-fieldset.js +126 -54
  189. package/dist/matter/client-preferences/client-preferences-fieldset.js.map +1 -1
  190. package/dist/matter/client-preferences/client-preferences.d.ts +50 -7
  191. package/dist/matter/client-preferences/client-preferences.js +84 -15
  192. package/dist/matter/client-preferences/client-preferences.js.map +1 -1
  193. package/dist/matter/client-profile/client-profile.d.ts +44 -9
  194. package/dist/matter/client-profile/client-profile.js +64 -24
  195. package/dist/matter/client-profile/client-profile.js.map +1 -1
  196. package/dist/matter/client-profile-form/client-profile-fieldset.d.ts +119 -22
  197. package/dist/matter/client-profile-form/client-profile-fieldset.js +161 -73
  198. package/dist/matter/client-profile-form/client-profile-fieldset.js.map +1 -1
  199. package/dist/matter/delivery-options/delivery-options-accordion.d.ts +49 -4
  200. package/dist/matter/delivery-options/delivery-options-accordion.js +67 -14
  201. package/dist/matter/delivery-options/delivery-options-accordion.js.map +1 -1
  202. package/dist/matter/delivery-options/delivery-options-controller.d.ts +69 -9
  203. package/dist/matter/delivery-options/delivery-options-controller.js +80 -14
  204. package/dist/matter/delivery-options/delivery-options-controller.js.map +1 -1
  205. package/dist/matter/delivery-options/delivery-options.d.ts +37 -2
  206. package/dist/matter/delivery-options/delivery-options.js +75 -12
  207. package/dist/matter/delivery-options/delivery-options.js.map +1 -1
  208. package/dist/matter/delivery-options/use-delivery-option-selection.d.ts +1 -0
  209. package/dist/matter/delivery-options/use-delivery-option-selection.js +1 -1
  210. package/dist/matter/delivery-options/use-delivery-option-selection.js.map +1 -1
  211. package/dist/matter/email-identification/email-identification.d.ts +25 -3
  212. package/dist/matter/email-identification/email-identification.js +49 -12
  213. package/dist/matter/email-identification/email-identification.js.map +1 -1
  214. package/dist/matter/free-shipping-progress/free-shipping-progress.d.ts +85 -10
  215. package/dist/matter/free-shipping-progress/free-shipping-progress.js +153 -53
  216. package/dist/matter/free-shipping-progress/free-shipping-progress.js.map +1 -1
  217. package/dist/matter/identity-edit/identity-edit.d.ts +52 -10
  218. package/dist/matter/identity-edit/identity-edit.js +47 -19
  219. package/dist/matter/identity-edit/identity-edit.js.map +1 -1
  220. package/dist/matter/identity-summary/identity-summary.d.ts +76 -22
  221. package/dist/matter/identity-summary/identity-summary.js +95 -45
  222. package/dist/matter/identity-summary/identity-summary.js.map +1 -1
  223. package/dist/matter/installments/installments-select.d.ts +98 -16
  224. package/dist/matter/installments/installments-select.js +156 -48
  225. package/dist/matter/installments/installments-select.js.map +1 -1
  226. package/dist/matter/installments/installments.d.ts +96 -16
  227. package/dist/matter/installments/installments.js +115 -40
  228. package/dist/matter/installments/installments.js.map +1 -1
  229. package/dist/matter/installments/use-installments-selection.d.ts +1 -0
  230. package/dist/matter/installments/use-installments-selection.js +8 -3
  231. package/dist/matter/installments/use-installments-selection.js.map +1 -1
  232. package/dist/matter/my-account-profile/my-account-profile.d.ts +358 -103
  233. package/dist/matter/my-account-profile/my-account-profile.js +370 -174
  234. package/dist/matter/my-account-profile/my-account-profile.js.map +1 -1
  235. package/dist/matter/order-cancel/order-cancel.d.ts +65 -19
  236. package/dist/matter/order-cancel/order-cancel.js +118 -51
  237. package/dist/matter/order-cancel/order-cancel.js.map +1 -1
  238. package/dist/matter/order-delivery-address/order-delivery-address.d.ts +8 -18
  239. package/dist/matter/order-delivery-address/order-delivery-address.js +14 -23
  240. package/dist/matter/order-delivery-address/order-delivery-address.js.map +1 -1
  241. package/dist/matter/order-delivery-group/order-delivery-group.d.ts +40 -24
  242. package/dist/matter/order-delivery-group/order-delivery-group.js +64 -74
  243. package/dist/matter/order-delivery-group/order-delivery-group.js.map +1 -1
  244. package/dist/matter/order-details-header/order-details-header.d.ts +32 -15
  245. package/dist/matter/order-details-header/order-details-header.js +66 -58
  246. package/dist/matter/order-details-header/order-details-header.js.map +1 -1
  247. package/dist/matter/order-invoice-download/order-invoice-download.d.ts +78 -0
  248. package/dist/matter/order-invoice-download/order-invoice-download.js +173 -0
  249. package/dist/matter/order-invoice-download/order-invoice-download.js.map +1 -0
  250. package/dist/matter/order-list/order-list.d.ts +164 -19
  251. package/dist/matter/order-list/order-list.js +229 -87
  252. package/dist/matter/order-list/order-list.js.map +1 -1
  253. package/dist/matter/order-list-row/order-list-row.d.ts +6 -1
  254. package/dist/matter/order-list-row/order-list-row.js +3 -2
  255. package/dist/matter/order-list-row/order-list-row.js.map +1 -1
  256. package/dist/matter/order-list-search/order-list-search.d.ts +18 -26
  257. package/dist/matter/order-list-search/order-list-search.js +30 -69
  258. package/dist/matter/order-list-search/order-list-search.js.map +1 -1
  259. package/dist/matter/order-list-views/order-list-views.d.ts +15 -22
  260. package/dist/matter/order-list-views/order-list-views.js +22 -68
  261. package/dist/matter/order-list-views/order-list-views.js.map +1 -1
  262. package/dist/matter/order-payment/order-payment.d.ts +33 -10
  263. package/dist/matter/order-payment/order-payment.js +44 -39
  264. package/dist/matter/order-payment/order-payment.js.map +1 -1
  265. package/dist/matter/order-placed/order-placed-deliveries.d.ts +144 -12
  266. package/dist/matter/order-placed/order-placed-deliveries.js +115 -40
  267. package/dist/matter/order-placed/order-placed-deliveries.js.map +1 -1
  268. package/dist/matter/order-placed/order-placed.d.ts +198 -31
  269. package/dist/matter/order-placed/order-placed.js +230 -139
  270. package/dist/matter/order-placed/order-placed.js.map +1 -1
  271. package/dist/matter/order-placed-date/order-placed-date.d.ts +5 -8
  272. package/dist/matter/order-placed-date/order-placed-date.js +7 -8
  273. package/dist/matter/order-placed-date/order-placed-date.js.map +1 -1
  274. package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.d.ts +90 -17
  275. package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.js +93 -117
  276. package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.js.map +1 -1
  277. package/dist/matter/order-progress/order-progress.d.ts +19 -8
  278. package/dist/matter/order-progress/order-progress.js +37 -45
  279. package/dist/matter/order-progress/order-progress.js.map +1 -1
  280. package/dist/matter/order-summary/order-summary.d.ts +19 -9
  281. package/dist/matter/order-summary/order-summary.js +38 -44
  282. package/dist/matter/order-summary/order-summary.js.map +1 -1
  283. package/dist/matter/order-tracking-link/order-tracking-link.d.ts +43 -0
  284. package/dist/matter/order-tracking-link/order-tracking-link.js +107 -0
  285. package/dist/matter/order-tracking-link/order-tracking-link.js.map +1 -0
  286. package/dist/matter/payment/payment-card-capture.js +17 -10
  287. package/dist/matter/payment/payment-card-capture.js.map +1 -1
  288. package/dist/matter/payment/payment-controller.d.ts +4 -2
  289. package/dist/matter/payment/payment-controller.js +30 -9
  290. package/dist/matter/payment/payment-controller.js.map +1 -1
  291. package/dist/matter/payment/payment-method-badges.js +1 -1
  292. package/dist/matter/payment/payment.d.ts +69 -19
  293. package/dist/matter/payment/payment.js +101 -35
  294. package/dist/matter/payment/payment.js.map +1 -1
  295. package/dist/matter/payment/use-payment-method-selection.d.ts +25 -4
  296. package/dist/matter/payment/use-payment-method-selection.js +94 -32
  297. package/dist/matter/payment/use-payment-method-selection.js.map +1 -1
  298. package/dist/matter/payment/use-payment-submit-gate.d.ts +14 -3
  299. package/dist/matter/payment/use-payment-submit-gate.js +47 -8
  300. package/dist/matter/payment/use-payment-submit-gate.js.map +1 -1
  301. package/dist/matter/place-order/place-order.d.ts +171 -57
  302. package/dist/matter/place-order/place-order.js +376 -185
  303. package/dist/matter/place-order/place-order.js.map +1 -1
  304. package/dist/matter/pricing/pricing.d.ts +152 -13
  305. package/dist/matter/pricing/pricing.js +153 -52
  306. package/dist/matter/pricing/pricing.js.map +1 -1
  307. package/dist/matter/product-information/product-information.d.ts +27 -4
  308. package/dist/matter/product-information/product-information.js +32 -15
  309. package/dist/matter/product-information/product-information.js.map +1 -1
  310. package/dist/matter/product-list/product-list.d.ts +24 -6
  311. package/dist/matter/product-list/product-list.js +32 -26
  312. package/dist/matter/product-list/product-list.js.map +1 -1
  313. package/dist/matter/product-shelf/product-shelf.d.ts +8 -3
  314. package/dist/matter/product-shelf/product-shelf.js +111 -10
  315. package/dist/matter/product-shelf/product-shelf.js.map +1 -1
  316. package/dist/matter/region/region.d.ts +33 -16
  317. package/dist/matter/region/region.js +59 -52
  318. package/dist/matter/region/region.js.map +1 -1
  319. package/dist/matter/save-card/save-card.d.ts +43 -8
  320. package/dist/matter/save-card/save-card.js +61 -23
  321. package/dist/matter/save-card/save-card.js.map +1 -1
  322. package/dist/matter/saved-cards/saved-cards.d.ts +113 -21
  323. package/dist/matter/saved-cards/saved-cards.js +349 -77
  324. package/dist/matter/saved-cards/saved-cards.js.map +1 -1
  325. package/dist/matter/shipping-address/address-payload.js +25 -0
  326. package/dist/matter/shipping-address/address-payload.js.map +1 -0
  327. package/dist/matter/shipping-address/country-descriptors.js +71 -71
  328. package/dist/matter/shipping-address/country-descriptors.js.map +1 -1
  329. package/dist/matter/shipping-address/library-country-descriptors.js +136 -0
  330. package/dist/matter/shipping-address/library-country-descriptors.js.map +1 -0
  331. package/dist/matter/shipping-address/shipping-address.d.ts +312 -45
  332. package/dist/matter/shipping-address/shipping-address.js +443 -188
  333. package/dist/matter/shipping-address/shipping-address.js.map +1 -1
  334. package/dist/matter/shipping-simulator/shipping-simulator.d.ts +251 -25
  335. package/dist/matter/shipping-simulator/shipping-simulator.js +261 -51
  336. package/dist/matter/shipping-simulator/shipping-simulator.js.map +1 -1
  337. package/dist/matter/sign-in/sign-in.d.ts +108 -0
  338. package/dist/matter/sign-in/sign-in.js +285 -0
  339. package/dist/matter/sign-in/sign-in.js.map +1 -0
  340. package/dist/matter/sign-in-disclosure/sign-in-disclosure.d.ts +81 -0
  341. package/dist/matter/sign-in-disclosure/sign-in-disclosure.js +232 -0
  342. package/dist/matter/sign-in-disclosure/sign-in-disclosure.js.map +1 -0
  343. package/dist/matter/sign-in-form/sign-in-form.d.ts +93 -62
  344. package/dist/matter/sign-in-form/sign-in-form.js +134 -144
  345. package/dist/matter/sign-in-form/sign-in-form.js.map +1 -1
  346. package/dist/particles/binding-switcher/binding-switcher.d.ts +59 -0
  347. package/dist/particles/binding-switcher/binding-switcher.js +194 -0
  348. package/dist/particles/binding-switcher/binding-switcher.js.map +1 -0
  349. package/dist/particles/card-summary/card-network.d.ts +17 -0
  350. package/dist/particles/card-summary/card-network.js +25 -0
  351. package/dist/particles/card-summary/card-network.js.map +1 -0
  352. package/dist/particles/card-summary/card-summary.d.ts +113 -0
  353. package/dist/particles/card-summary/card-summary.js +221 -0
  354. package/dist/particles/card-summary/card-summary.js.map +1 -0
  355. package/dist/particles/carousel/carousel.d.ts +99 -11
  356. package/dist/particles/carousel/carousel.js +103 -35
  357. package/dist/particles/carousel/carousel.js.map +1 -1
  358. package/dist/particles/copy-text/copy-text.js +5 -15
  359. package/dist/particles/copy-text/copy-text.js.map +1 -1
  360. package/dist/particles/dialog/dialog.d.ts +14 -6
  361. package/dist/particles/dialog/dialog.js +6 -3
  362. package/dist/particles/dialog/dialog.js.map +1 -1
  363. package/dist/particles/drawer/drawer.js +1 -1
  364. package/dist/particles/drawer/drawer.js.map +1 -1
  365. package/dist/particles/email-field/email-field.d.ts +2 -1
  366. package/dist/particles/email-field/email-field.js +2 -1
  367. package/dist/particles/email-field/email-field.js.map +1 -1
  368. package/dist/particles/footer-link-group/footer-link-group.js +1 -0
  369. package/dist/particles/footer-link-group/footer-link-group.js.map +1 -1
  370. package/dist/particles/footer-social/footer-social.d.ts +1 -1
  371. package/dist/particles/footer-social/footer-social.js +1 -1
  372. package/dist/particles/footer-social/footer-social.js.map +1 -1
  373. package/dist/particles/form/form.d.ts +85 -13
  374. package/dist/particles/form/form.js +91 -42
  375. package/dist/particles/form/form.js.map +1 -1
  376. package/dist/particles/gallery/gallery.d.ts +129 -12
  377. package/dist/particles/gallery/gallery.js +121 -34
  378. package/dist/particles/gallery/gallery.js.map +1 -1
  379. package/dist/particles/incentives/incentives.d.ts +1 -1
  380. package/dist/particles/incentives/incentives.js +1 -1
  381. package/dist/particles/incentives/incentives.js.map +1 -1
  382. package/dist/particles/order-details-back/order-details-back.d.ts +5 -3
  383. package/dist/particles/order-details-back/order-details-back.js +8 -10
  384. package/dist/particles/order-details-back/order-details-back.js.map +1 -1
  385. package/dist/particles/order-status-badge/order-status-badge.d.ts +3 -3
  386. package/dist/particles/order-status-badge/order-status-badge.js +4 -20
  387. package/dist/particles/order-status-badge/order-status-badge.js.map +1 -1
  388. package/dist/particles/password-field/password-field.d.ts +1 -1
  389. package/dist/particles/password-field/password-field.js +2 -4
  390. package/dist/particles/password-field/password-field.js.map +1 -1
  391. package/dist/particles/payment-methods/payment-methods.d.ts +1 -1
  392. package/dist/particles/payment-methods/payment-methods.js +1 -1
  393. package/dist/particles/payment-methods/payment-methods.js.map +1 -1
  394. package/dist/particles/phone-field/phone-field.d.ts +4 -4
  395. package/dist/particles/phone-field/phone-field.js +8 -11
  396. package/dist/particles/phone-field/phone-field.js.map +1 -1
  397. package/dist/particles/spinner/spinner.d.ts +24 -4
  398. package/dist/particles/spinner/spinner.js +25 -9
  399. package/dist/particles/spinner/spinner.js.map +1 -1
  400. package/dist/particles/switch/switch.d.ts +4 -1
  401. package/dist/particles/switch/switch.js +3 -1
  402. package/dist/particles/switch/switch.js.map +1 -1
  403. package/dist/particles/toast/toast.d.ts +49 -9
  404. package/dist/particles/toast/toast.js +81 -15
  405. package/dist/particles/toast/toast.js.map +1 -1
  406. package/dist/schema.graphql +461 -89
  407. package/dist/sdk/actions/index.d.ts +3 -1
  408. package/dist/sdk/actions/index.js +3 -1
  409. package/dist/sdk/actions/locale-action-provider.d.ts +16 -0
  410. package/dist/sdk/actions/locale-action-provider.js +20 -0
  411. package/dist/sdk/actions/locale-action-provider.js.map +1 -0
  412. package/dist/sdk/actions/saved-card-action-provider.d.ts +12 -0
  413. package/dist/sdk/actions/saved-card-action-provider.js +16 -0
  414. package/dist/sdk/actions/saved-card-action-provider.js.map +1 -0
  415. package/dist/sdk/actions/types.d.ts +6 -2
  416. package/dist/sdk/address/address-fields.js +4 -4
  417. package/dist/sdk/address/address-fields.js.map +1 -1
  418. package/dist/sdk/address/constants.js +1 -6
  419. package/dist/sdk/address/constants.js.map +1 -1
  420. package/dist/sdk/address/messages.js +44 -44
  421. package/dist/sdk/address/messages.js.map +1 -1
  422. package/dist/sdk/address/postal-code.js +15 -2
  423. package/dist/sdk/address/postal-code.js.map +1 -1
  424. package/dist/sdk/address/types.d.ts +5 -3
  425. package/dist/sdk/address/validate-address.js +3 -3
  426. package/dist/sdk/address/validate-address.js.map +1 -1
  427. package/dist/sdk/analytics/use-analytics-actions.d.ts +1 -1
  428. package/dist/sdk/analytics/use-analytics-actions.js.map +1 -1
  429. package/dist/sdk/cache/storefront-cache.js +2 -1
  430. package/dist/sdk/cache/storefront-cache.js.map +1 -1
  431. package/dist/sdk/cart/operations.d.ts +2 -1
  432. package/dist/sdk/cart/operations.js +55 -1
  433. package/dist/sdk/cart/operations.js.map +1 -1
  434. package/dist/sdk/cart/optimistic.d.ts +30 -7
  435. package/dist/sdk/cart/optimistic.js +78 -41
  436. package/dist/sdk/cart/optimistic.js.map +1 -1
  437. package/dist/sdk/cart/use-cart-actions.d.ts +7 -0
  438. package/dist/sdk/cart/use-cart-actions.js +61 -15
  439. package/dist/sdk/cart/use-cart-actions.js.map +1 -1
  440. package/dist/sdk/cart/use-cart-sync-sales-channel.js +70 -0
  441. package/dist/sdk/cart/use-cart-sync-sales-channel.js.map +1 -0
  442. package/dist/sdk/data/index.js +2 -2
  443. package/dist/sdk/data/reactive-list-item-data-provider.js +2 -2
  444. package/dist/sdk/generated/gql.js +16 -12
  445. package/dist/sdk/generated/gql.js.map +1 -1
  446. package/dist/sdk/generated/graphql.d.ts +197 -51
  447. package/dist/sdk/generated/graphql.js +2318 -91
  448. package/dist/sdk/generated/graphql.js.map +1 -1
  449. package/dist/sdk/i18n/format-error-code.js +23 -0
  450. package/dist/sdk/i18n/format-error-code.js.map +1 -0
  451. package/dist/sdk/i18n/message-formatter.d.ts +22 -0
  452. package/dist/sdk/i18n/message-formatter.js +140 -0
  453. package/dist/sdk/i18n/message-formatter.js.map +1 -0
  454. package/dist/sdk/i18n/use-message-formatter.d.ts +8 -0
  455. package/dist/sdk/i18n/use-message-formatter.js +18 -0
  456. package/dist/sdk/i18n/use-message-formatter.js.map +1 -0
  457. package/dist/sdk/identity/use-identity-actions.js.map +1 -1
  458. package/dist/sdk/locale/binding-switch-provider.d.ts +13 -0
  459. package/dist/sdk/locale/binding-switch-provider.js +20 -0
  460. package/dist/sdk/locale/binding-switch-provider.js.map +1 -0
  461. package/dist/sdk/locale/use-locale-actions.d.ts +16 -0
  462. package/dist/sdk/locale/use-locale-actions.js +70 -0
  463. package/dist/sdk/locale/use-locale-actions.js.map +1 -0
  464. package/dist/sdk/navigation/binding-switch.d.ts +39 -0
  465. package/dist/sdk/navigation/binding-switch.js +129 -0
  466. package/dist/sdk/navigation/binding-switch.js.map +1 -0
  467. package/dist/sdk/navigation/decode-route-params.d.ts +11 -0
  468. package/dist/sdk/navigation/decode-route-params.js +32 -0
  469. package/dist/sdk/navigation/decode-route-params.js.map +1 -0
  470. package/dist/sdk/navigation/redirect.d.ts +2 -0
  471. package/dist/sdk/navigation/redirect.js +19 -1
  472. package/dist/sdk/navigation/redirect.js.map +1 -1
  473. package/dist/sdk/navigation/types.d.ts +13 -0
  474. package/dist/sdk/payment/bin-format.js +20 -0
  475. package/dist/sdk/payment/bin-format.js.map +1 -0
  476. package/dist/sdk/payment/challenge-return.js +37 -0
  477. package/dist/sdk/payment/challenge-return.js.map +1 -0
  478. package/dist/sdk/payment/confirmation-last-four.js +39 -0
  479. package/dist/sdk/payment/confirmation-last-four.js.map +1 -0
  480. package/dist/sdk/payment/gateway.d.ts +1 -1
  481. package/dist/sdk/payment/gateway.js +8 -2
  482. package/dist/sdk/payment/gateway.js.map +1 -1
  483. package/dist/sdk/payment/operations.d.ts +1 -0
  484. package/dist/sdk/payment/operations.js +28 -6
  485. package/dist/sdk/payment/operations.js.map +1 -1
  486. package/dist/sdk/payment/resumed-purchase.d.ts +1 -0
  487. package/dist/sdk/payment/resumed-purchase.js +119 -0
  488. package/dist/sdk/payment/resumed-purchase.js.map +1 -0
  489. package/dist/sdk/payment/security-code-mask.js +16 -23
  490. package/dist/sdk/payment/security-code-mask.js.map +1 -1
  491. package/dist/sdk/payment/submission-registry.js +6 -2
  492. package/dist/sdk/payment/submission-registry.js.map +1 -1
  493. package/dist/sdk/payment/use-payment-actions.d.ts +18 -3
  494. package/dist/sdk/payment/use-payment-actions.js +23 -3
  495. package/dist/sdk/payment/use-payment-actions.js.map +1 -1
  496. package/dist/sdk/payment/use-place-order.d.ts +10 -2
  497. package/dist/sdk/payment/use-place-order.js +138 -76
  498. package/dist/sdk/payment/use-place-order.js.map +1 -1
  499. package/dist/sdk/provider/storefront-provider.d.ts +1 -7
  500. package/dist/sdk/provider/storefront-provider.js +4 -11
  501. package/dist/sdk/provider/storefront-provider.js.map +1 -1
  502. package/dist/sdk/saved-cards/operations.d.ts +16 -0
  503. package/dist/sdk/saved-cards/operations.js +41 -0
  504. package/dist/sdk/saved-cards/operations.js.map +1 -0
  505. package/dist/sdk/saved-cards/use-saved-card-actions.d.ts +26 -0
  506. package/dist/sdk/saved-cards/use-saved-card-actions.js +86 -0
  507. package/dist/sdk/saved-cards/use-saved-card-actions.js.map +1 -0
  508. package/dist/sdk/seo/entity-landing.d.ts +24 -0
  509. package/dist/sdk/seo/entity-landing.js +30 -0
  510. package/dist/sdk/seo/entity-landing.js.map +1 -0
  511. package/dist/sdk/seo/page-alternates.d.ts +8 -5
  512. package/dist/sdk/seo/page-alternates.js +11 -14
  513. package/dist/sdk/seo/page-alternates.js.map +1 -1
  514. package/dist/sdk/seo/search-landing.d.ts +42 -0
  515. package/dist/sdk/seo/search-landing.js +85 -0
  516. package/dist/sdk/seo/search-landing.js.map +1 -0
  517. package/dist/sdk/session/mock-session.d.ts +9 -0
  518. package/dist/sdk/session/mock-session.js +31 -0
  519. package/dist/sdk/session/mock-session.js.map +1 -0
  520. package/dist/sdk/session/read-server-session.d.ts +3 -0
  521. package/dist/sdk/session/read-server-session.js +5 -0
  522. package/dist/sdk/session/read-server-session.js.map +1 -1
  523. package/dist/sdk/session/return-path-segment.d.ts +10 -0
  524. package/dist/sdk/session/return-path-segment.js +15 -0
  525. package/dist/sdk/session/return-path-segment.js.map +1 -0
  526. package/dist/sdk/session/use-session-actions.js.map +1 -1
  527. package/dist/sdk/shipping/shipping-operations.d.ts +1 -1
  528. package/dist/sdk/shipping/shipping-operations.js +13 -0
  529. package/dist/sdk/shipping/shipping-operations.js.map +1 -1
  530. package/dist/sdk/shipping/use-cart-shipping-simulation.js.map +1 -1
  531. package/dist/sdk/shipping/use-shipping-actions.js.map +1 -1
  532. package/dist/sdk/shipping/use-shipping-simulation.js.map +1 -1
  533. package/dist/sdk/state/cart.d.ts +9 -2
  534. package/dist/sdk/state/cart.js +9 -2
  535. package/dist/sdk/state/cart.js.map +1 -1
  536. package/dist/utils/safe-href.d.ts +2 -0
  537. package/package.json +4 -3
  538. package/skills/storefront-asset/SKILL.md +2 -2
  539. package/skills/storefront-asset/references/api-side.md +27 -14
  540. package/skills/storefront-asset/references/findings.md +5 -2
  541. package/src/styles/tailwind.css +9 -2
  542. package/dist/matter/shipping-address/country-descriptors.d.ts +0 -1
  543. package/dist/message-locales.json +0 -7
  544. package/dist/sdk/i18n/client.d.ts +0 -4
  545. package/dist/sdk/i18n/client.js +0 -4
  546. package/dist/sdk/i18n/locales.d.ts +0 -8
  547. package/dist/sdk/i18n/locales.js +0 -57
  548. package/dist/sdk/i18n/locales.js.map +0 -1
  549. package/dist/sdk/i18n/messages/en-US.js +0 -164
  550. package/dist/sdk/i18n/messages/en-US.js.map +0 -1
  551. package/dist/sdk/i18n/messages/en-US.json +0 -159
  552. package/dist/sdk/i18n/messages/en-US.json.d.ts +0 -163
  553. package/dist/sdk/i18n/messages/es-ES.js +0 -164
  554. package/dist/sdk/i18n/messages/es-ES.js.map +0 -1
  555. package/dist/sdk/i18n/messages/es-ES.json +0 -159
  556. package/dist/sdk/i18n/messages/pt-BR.js +0 -164
  557. package/dist/sdk/i18n/messages/pt-BR.js.map +0 -1
  558. package/dist/sdk/i18n/messages/pt-BR.json +0 -159
  559. package/dist/sdk/i18n/provider.d.ts +0 -1
  560. package/dist/sdk/i18n/provider.js +0 -30
  561. package/dist/sdk/i18n/provider.js.map +0 -1
  562. package/dist/sdk/i18n/server.d.ts +0 -28
  563. package/dist/sdk/i18n/server.js +0 -59
  564. package/dist/sdk/i18n/server.js.map +0 -1
  565. package/dist/utils/resolve-authored-copy.js +0 -18
  566. package/dist/utils/resolve-authored-copy.js.map +0 -1
  567. package/dist/utils/substitute-template.js +0 -33
  568. package/dist/utils/substitute-template.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"order-list-views.js","names":[],"sources":["../../../src/matter/order-list-views/order-list-views.tsx"],"sourcesContent":["'use client';\n\nimport { type ContentValue, defineComponent, defineContentType } from '@vtex/fs-core';\nimport type { Ref } from 'react';\nimport { type CurrentRoute, currentPageWith } from '../../sdk/navigation/current-page.js';\nimport { StorefrontLink } from '../../sdk/navigation/storefront-link.js';\nimport type { PageRef } from '../../sdk/navigation/types.js';\nimport { useStorefrontRoute } from '../../sdk/navigation/use-storefront-route.js';\nimport { useStorefrontSearchParams } from '../../sdk/navigation/use-storefront-search-params.js';\n\nexport const OrderListViewsContent = defineContentType({\n id: 'order-list-views',\n title: 'Order List Views',\n description: 'The names of the four order views and the accessible name of the switch.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n label: { type: 'string', title: 'Accessible name' },\n all: { type: 'string', title: 'All orders' },\n ongoing: { type: 'string', title: 'Ongoing' },\n completed: { type: 'string', title: 'Completed' },\n cancelled: { type: 'string', title: 'Cancelled' },\n },\n },\n});\n\nexport type OrderListView = 'all' | 'ongoing' | 'completed' | 'cancelled';\n\nexport type OrderListViewsContentValue = ContentValue<typeof OrderListViewsContent>;\n\nexport type OrderListViewsProps = Readonly<{\n /** Accessible name of the navigation landmark. */\n label?: string;\n allLabel?: string;\n ongoingLabel?: string;\n completedLabel?: string;\n cancelledLabel?: string;\n /** Injected by the compiler from the page content entry. */\n $content?: OrderListViewsContentValue;\n className?: string;\n ref?: Ref<HTMLElement>;\n}>;\n\nconst CHOICES: readonly OrderListView[] = ['all', 'ongoing', 'completed', 'cancelled'];\n\nconst DEFAULT_GROUP_LABEL = 'Order views';\n\nconst DEFAULT_LABELS: Record<OrderListView, string> = {\n all: 'All orders',\n ongoing: 'Ongoing',\n completed: 'Completed',\n cancelled: 'Cancelled',\n};\n\nexport const OrderListViewsDefinition = defineComponent<OrderListViewsProps>({\n name: 'OrderListViews',\n importPath: '@vtex/faststore/components',\n component: OrderListViews,\n content: OrderListViewsContent,\n editor: { label: 'Order List Views', category: 'navigation' },\n schema: {\n label: { type: 'string', default: 'Order views', label: 'Accessible name' },\n allLabel: { type: 'string', default: 'All orders', label: 'All orders' },\n ongoingLabel: { type: 'string', default: 'Ongoing', label: 'Ongoing' },\n completedLabel: { type: 'string', default: 'Completed', label: 'Completed' },\n cancelledLabel: { type: 'string', default: 'Cancelled', label: 'Cancelled' },\n },\n guideline:\n 'Four links that switch the orders page among all orders, ongoing, completed, and cancelled. Choosing one writes the view search param and keeps an existing search and placed-date range. It does not filter the orders already on the page.',\n});\n\nfunction resolveText(content: string | undefined, prop: string | undefined, fallback: string): string {\n const fromContent = content?.trim();\n if (fromContent) {\n return fromContent;\n }\n const fromProp = prop?.trim();\n if (fromProp) {\n return fromProp;\n }\n return fallback;\n}\n\nfunction authoredLabel(view: OrderListView, props: OrderListViewsProps): string | undefined {\n switch (view) {\n case 'all':\n return props.allLabel;\n case 'ongoing':\n return props.ongoingLabel;\n case 'completed':\n return props.completedLabel;\n case 'cancelled':\n return props.cancelledLabel;\n }\n}\n\nfunction currentView(value: string | null): OrderListView {\n if (value === 'ongoing' || value === 'completed' || value === 'cancelled') {\n return value;\n }\n return 'all';\n}\n\nfunction choiceHref(route: CurrentRoute, searchParams: URLSearchParams, view: OrderListView): PageRef | string {\n const next = new URLSearchParams(searchParams);\n next.delete('view');\n next.delete('after');\n if (view !== 'all') {\n next.set('view', view);\n }\n return currentPageWith(route, next);\n}\n\nexport function OrderListViews({\n label,\n allLabel,\n ongoingLabel,\n completedLabel,\n cancelledLabel,\n $content,\n className,\n ref,\n}: OrderListViewsProps) {\n const route = useStorefrontRoute();\n const searchParams = useStorefrontSearchParams();\n const current = currentView(searchParams.get('view'));\n const props: OrderListViewsProps = { label, allLabel, ongoingLabel, completedLabel, cancelledLabel, $content };\n const groupLabel = resolveText($content?.label, label, DEFAULT_GROUP_LABEL);\n\n return (\n <nav\n ref={ref}\n aria-label={groupLabel}\n className={className}\n data-fs-order-list-views=\"\"\n data-fs-order-list-views-current={current}\n >\n {CHOICES.map((view) => {\n const text = resolveText($content?.[view], authoredLabel(view, props), DEFAULT_LABELS[view]);\n const selected = view === current;\n return (\n <StorefrontLink\n key={view}\n href={choiceHref(route, searchParams, view)}\n aria-current={selected ? 'page' : undefined}\n data-fs-order-list-views-choice={view}\n data-fs-order-list-views-choice-current={selected ? '' : undefined}\n >\n {text}\n </StorefrontLink>\n );\n })}\n </nav>\n );\n}\n"],"mappings":";;;;;;;;;;AAUA,MAAa,wBAAwB,kBAAkB;CACrD,IAAI;CACJ,OAAO;CACP,aAAa;CACb,QAAQ;EACN,MAAM;EACN,sBAAsB;EACtB,YAAY;GACV,OAAO;IAAE,MAAM;IAAU,OAAO;GAAkB;GAClD,KAAK;IAAE,MAAM;IAAU,OAAO;GAAa;GAC3C,SAAS;IAAE,MAAM;IAAU,OAAO;GAAU;GAC5C,WAAW;IAAE,MAAM;IAAU,OAAO;GAAY;GAChD,WAAW;IAAE,MAAM;IAAU,OAAO;GAAY;EAClD;CACF;AACF,CAAC;AAmBD,MAAM,UAAoC;CAAC;CAAO;CAAW;CAAa;AAAW;AAEr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,WACA,OACsB;CACtB,MAAM,QAAQ,mBAAmB;CACjC,MAAM,eAAe,0BAA0B;CAC/C,MAAM,UAAU,YAAY,aAAa,IAAI,MAAM,CAAC;CACpD,MAAM,QAA6B;EAAE;EAAO;EAAU;EAAc;EAAgB;EAAgB;CAAS;CAC7G,MAAM,aAAa,YAAY,UAAU,OAAO,OAAO,mBAAmB;CAE1E,OACE,oBAAC,OAAD;EACO;EACL,cAAY;EACD;EACX,4BAAyB;EACzB,oCAAkC;EAEjC,UAAA,QAAQ,KAAK,SAAS;GACrB,MAAM,OAAO,YAAY,WAAW,OAAO,cAAc,MAAM,KAAK,GAAG,eAAe,KAAK;GAC3F,MAAM,WAAW,SAAS;GAC1B,OACE,oBAAC,gBAAD;IAEE,MAAM,WAAW,OAAO,cAAc,IAAI;IAC1C,gBAAc,WAAW,SAAS,KAAA;IAClC,mCAAiC;IACjC,2CAAyC,WAAW,KAAK,KAAA;IAExD,UAAA;GACa,GAPT,IAOS;EAEpB,CAAC;CACE,CAAA;AAET"}
1
+ {"version":3,"file":"order-list-views.js","names":[],"sources":["../../../src/matter/order-list-views/order-list-views.tsx"],"sourcesContent":["'use client';\n\nimport { type ContentValue, defineComponent, defineContentType, type MessageLocaleProp } from '@vtex/fs-core';\nimport type { Ref } from 'react';\nimport { useMessageFormatter } from '../../sdk/i18n/use-message-formatter.js';\nimport { type CurrentRoute, currentPageWith } from '../../sdk/navigation/current-page.js';\nimport { StorefrontLink } from '../../sdk/navigation/storefront-link.js';\nimport type { PageRef } from '../../sdk/navigation/types.js';\nimport { useStorefrontRoute } from '../../sdk/navigation/use-storefront-route.js';\nimport { useStorefrontSearchParams } from '../../sdk/navigation/use-storefront-search-params.js';\n\nexport const OrderListViewsContent = defineContentType({\n id: 'order-list-views',\n title: 'Order List Views',\n description: 'The names of the four order views and the accessible name of the switch.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n label: { type: 'string', title: 'Accessible name', format: 'icu-message', messageSource: 'Order views' },\n all: { type: 'string', title: 'All orders', format: 'icu-message', messageSource: 'All orders' },\n ongoing: { type: 'string', title: 'Ongoing', format: 'icu-message', messageSource: 'Ongoing' },\n completed: { type: 'string', title: 'Completed', format: 'icu-message', messageSource: 'Completed' },\n cancelled: { type: 'string', title: 'Cancelled', format: 'icu-message', messageSource: 'Cancelled' },\n },\n },\n});\n\nexport type OrderListView = 'all' | 'ongoing' | 'completed' | 'cancelled';\n\nexport type OrderListViewsContentValue = ContentValue<typeof OrderListViewsContent>;\n\nexport type OrderListViewsProps = MessageLocaleProp &\n Readonly<{\n /** The accessible name of the landmark and the four view names. */\n $content?: OrderListViewsContentValue;\n className?: string;\n ref?: Ref<HTMLElement>;\n }>;\n\nconst CHOICES: readonly OrderListView[] = ['all', 'ongoing', 'completed', 'cancelled'];\n\nexport const OrderListViewsDefinition = defineComponent<OrderListViewsProps>({\n name: 'OrderListViews',\n importPath: '@vtex/faststore/components',\n component: OrderListViews,\n content: OrderListViewsContent,\n editor: { label: 'Order List Views', category: 'navigation' },\n schema: {},\n guideline:\n 'Four links that switch the orders page among all orders, ongoing, completed, and cancelled. Their names are the $content fields all, ongoing, completed and cancelled; label is the landmark name. Choosing one writes the view search param and keeps an existing search and placed-date range. It does not filter the orders already on the page.',\n});\n\nfunction currentView(value: string | null): OrderListView {\n if (value === 'ongoing' || value === 'completed' || value === 'cancelled') {\n return value;\n }\n return 'all';\n}\n\nfunction choiceHref(route: CurrentRoute, searchParams: URLSearchParams, view: OrderListView): PageRef | string {\n const next = new URLSearchParams(searchParams);\n next.delete('view');\n next.delete('after');\n if (view !== 'all') {\n next.set('view', view);\n }\n return currentPageWith(route, next);\n}\n\nexport function OrderListViews({ $content, $locale, className, ref }: OrderListViewsProps) {\n const route = useStorefrontRoute();\n const searchParams = useStorefrontSearchParams();\n const { format } = useMessageFormatter(OrderListViewsContent, $content);\n const current = currentView(searchParams.get('view'));\n\n return (\n <nav\n ref={ref}\n aria-label={format('label')}\n className={className}\n data-fs-order-list-views=\"\"\n data-fs-order-list-views-current={current}\n >\n {CHOICES.map((view) => {\n const selected = view === current;\n return (\n <StorefrontLink\n key={view}\n href={choiceHref(route, searchParams, view)}\n aria-current={selected ? 'page' : undefined}\n data-fs-order-list-views-choice={view}\n data-fs-order-list-views-choice-current={selected ? '' : undefined}\n >\n {format(view)}\n </StorefrontLink>\n );\n })}\n </nav>\n );\n}\n"],"mappings":";;;;;;;;;;;AAWA,MAAa,wBAAwB,kBAAkB;CACrD,IAAI;CACJ,OAAO;CACP,aAAa;CACb,QAAQ;EACN,MAAM;EACN,sBAAsB;EACtB,YAAY;GACV,OAAO;IAAE,MAAM;IAAU,OAAO;IAAmB,QAAQ;IAAe,eAAe;GAAc;GACvG,KAAK;IAAE,MAAM;IAAU,OAAO;IAAc,QAAQ;IAAe,eAAe;GAAa;GAC/F,SAAS;IAAE,MAAM;IAAU,OAAO;IAAW,QAAQ;IAAe,eAAe;GAAU;GAC7F,WAAW;IAAE,MAAM;IAAU,OAAO;IAAa,QAAQ;IAAe,eAAe;GAAY;GACnG,WAAW;IAAE,MAAM;IAAU,OAAO;IAAa,QAAQ;IAAe,eAAe;GAAY;EACrG;CACF;AACF,CAAC;AAcD,MAAM,UAAoC;CAAC;CAAO;CAAW;CAAa;AAAW;AAErF,MAAa,2BAA2B,gBAAqC;CAC3E,MAAM;CACN,YAAY;CACZ,WAAW;CACX,SAAS;CACT,QAAQ;EAAE,OAAO;EAAoB,UAAU;CAAa;CAC5D,QAAQ,CAAC;CACT,WACE;AACJ,CAAC;AAED,SAAS,YAAY,OAAqC;CACxD,IAAI,UAAU,aAAa,UAAU,eAAe,UAAU,aAC5D,OAAO;CAET,OAAO;AACT;AAEA,SAAS,WAAW,OAAqB,cAA+B,MAAuC;CAC7G,MAAM,OAAO,IAAI,gBAAgB,YAAY;CAC7C,KAAK,OAAO,MAAM;CAClB,KAAK,OAAO,OAAO;CACnB,IAAI,SAAS,OACX,KAAK,IAAI,QAAQ,IAAI;CAEvB,OAAO,gBAAgB,OAAO,IAAI;AACpC;AAEA,SAAgB,eAAe,EAAE,UAAU,SAAS,WAAW,OAA4B;CACzF,MAAM,QAAQ,mBAAmB;CACjC,MAAM,eAAe,0BAA0B;CAC/C,MAAM,EAAE,WAAW,oBAAoB,uBAAuB,QAAQ;CACtE,MAAM,UAAU,YAAY,aAAa,IAAI,MAAM,CAAC;CAEpD,OACE,oBAAC,OAAD;EACO;EACL,cAAY,OAAO,OAAO;EACf;EACX,4BAAyB;EACzB,oCAAkC;EAEjC,UAAA,QAAQ,KAAK,SAAS;GACrB,MAAM,WAAW,SAAS;GAC1B,OACE,oBAAC,gBAAD;IAEE,MAAM,WAAW,OAAO,cAAc,IAAI;IAC1C,gBAAc,WAAW,SAAS,KAAA;IAClC,mCAAiC;IACjC,2CAAyC,WAAW,KAAK,KAAA;IAExD,UAAA,OAAO,IAAI;GACE,GAPT,IAOS;EAEpB,CAAC;CACE,CAAA;AAET"}
@@ -1,4 +1,4 @@
1
- import { ContentValue } from "../../core/dist/define-content-type.js";
1
+ import { ContentValue, MessageLocaleProp } from "../../core/dist/define-content-type.js";
2
2
  import { ComponentDefinition } from "../../core/dist/define-component.js";
3
3
  import "../../core/dist/index.js";
4
4
  import { ComponentPropsWithRef, Ref } from "react";
@@ -6,7 +6,7 @@ import { ComponentPropsWithRef, Ref } from "react";
6
6
  export declare const OrderPaymentContent: {
7
7
  readonly id: "order-payment";
8
8
  readonly title: "Order Payment";
9
- readonly description: "The heading, the bank-invoice name, and the fixed labels of the payment section. The installment line keeps {count} and {amount}.";
9
+ readonly description: "The heading, the bank-invoice name, and the fixed labels of the payment section.";
10
10
  readonly schema: {
11
11
  readonly type: "object";
12
12
  readonly additionalProperties: false;
@@ -14,6 +14,8 @@ export declare const OrderPaymentContent: {
14
14
  readonly heading: {
15
15
  readonly type: "string";
16
16
  readonly title: "Heading";
17
+ readonly format: "icu-message";
18
+ readonly messageSource: "Payment";
17
19
  };
18
20
  readonly bankInvoiceName: {
19
21
  readonly type: "string";
@@ -22,27 +24,53 @@ export declare const OrderPaymentContent: {
22
24
  readonly empty: {
23
25
  readonly type: "string";
24
26
  readonly title: "Empty";
27
+ readonly format: "icu-message";
28
+ readonly messageSource: "No payment recorded";
25
29
  };
26
30
  readonly methodPlaceholder: {
27
31
  readonly type: "string";
28
32
  readonly title: "Method unavailable";
33
+ readonly format: "icu-message";
34
+ readonly messageSource: "Payment method unavailable";
29
35
  };
30
36
  readonly installments: {
31
37
  readonly type: "string";
32
38
  readonly title: "Installments";
33
- readonly description: "Keep the placeholders {count} and {amount}.";
39
+ readonly format: "icu-message";
40
+ readonly messageSource: "{count}x {amount}";
41
+ readonly messageArguments: {
42
+ readonly type: "object";
43
+ readonly properties: {
44
+ readonly count: {
45
+ readonly type: "integer";
46
+ };
47
+ readonly amount: {
48
+ readonly type: "string";
49
+ };
50
+ };
51
+ };
52
+ readonly messageExample: {
53
+ readonly count: 3;
54
+ readonly amount: "$33.33";
55
+ };
34
56
  };
35
57
  readonly redemptionCode: {
36
58
  readonly type: "string";
37
59
  readonly title: "Gift card code";
60
+ readonly format: "icu-message";
61
+ readonly messageSource: "Gift card code";
38
62
  };
39
63
  readonly bankInvoiceNumber: {
40
64
  readonly type: "string";
41
65
  readonly title: "Bank invoice number";
66
+ readonly format: "icu-message";
67
+ readonly messageSource: "Bank invoice number";
42
68
  };
43
69
  readonly bankInvoicePrint: {
44
70
  readonly type: "string";
45
71
  readonly title: "Print bank invoice";
72
+ readonly format: "icu-message";
73
+ readonly messageSource: "Print bank invoice";
46
74
  };
47
75
  };
48
76
  };
@@ -65,18 +93,13 @@ export type OrderPaymentData = {
65
93
  allowCancellation: boolean;
66
94
  payments: OrderPaymentRecord[];
67
95
  };
68
- export type OrderPaymentProps = Readonly<{
96
+ export type OrderPaymentProps = MessageLocaleProp & Readonly<{
69
97
  $content?: OrderPaymentContentValue;
70
98
  $data?: OrderPaymentData | null;
71
99
  className?: string;
72
100
  ref?: Ref<HTMLElement>;
73
101
  }>;
74
- export declare const OrderPaymentDefinition: ComponentDefinition<Readonly<{
75
- $content?: OrderPaymentContentValue;
76
- $data?: OrderPaymentData | null;
77
- className?: string;
78
- ref?: Ref<HTMLElement>;
79
- }>>;
102
+ export declare const OrderPaymentDefinition: ComponentDefinition<OrderPaymentProps>;
80
103
  export declare function OrderPaymentSkeleton({ className, ...props }: ComponentPropsWithRef<'div'>): import("react/jsx-runtime").JSX.Element;
81
104
  export declare function OrderPayment({ $content, $data, className, ref }: OrderPaymentProps): import("react/jsx-runtime").JSX.Element | null;
82
105
  //#endregion
@@ -4,7 +4,7 @@ import { defineContentType } from "../../core/dist/define-content-type.js";
4
4
  import "../../core/dist/index.js";
5
5
  import { resolveSafeHref } from "../../utils/safe-href.js";
6
6
  import { useStorefrontFormatters } from "../../sdk/format/client.js";
7
- import { useIntl } from "../../sdk/i18n/client.js";
7
+ import { useMessageFormatter } from "../../sdk/i18n/use-message-formatter.js";
8
8
  import { Icon } from "../../particles/icon/icon.js";
9
9
  import { paymentMethodIconName } from "../payment/payment-method-badges.js";
10
10
  import { useId } from "react";
@@ -33,14 +33,16 @@ const fragment = `
33
33
  const OrderPaymentContent = defineContentType({
34
34
  id: "order-payment",
35
35
  title: "Order Payment",
36
- description: "The heading, the bank-invoice name, and the fixed labels of the payment section. The installment line keeps {count} and {amount}.",
36
+ description: "The heading, the bank-invoice name, and the fixed labels of the payment section.",
37
37
  schema: {
38
38
  type: "object",
39
39
  additionalProperties: false,
40
40
  properties: {
41
41
  heading: {
42
42
  type: "string",
43
- title: "Heading"
43
+ title: "Heading",
44
+ format: "icu-message",
45
+ messageSource: "Payment"
44
46
  },
45
47
  bankInvoiceName: {
46
48
  type: "string",
@@ -48,28 +50,50 @@ const OrderPaymentContent = defineContentType({
48
50
  },
49
51
  empty: {
50
52
  type: "string",
51
- title: "Empty"
53
+ title: "Empty",
54
+ format: "icu-message",
55
+ messageSource: "No payment recorded"
52
56
  },
53
57
  methodPlaceholder: {
54
58
  type: "string",
55
- title: "Method unavailable"
59
+ title: "Method unavailable",
60
+ format: "icu-message",
61
+ messageSource: "Payment method unavailable"
56
62
  },
57
63
  installments: {
58
64
  type: "string",
59
65
  title: "Installments",
60
- description: "Keep the placeholders {count} and {amount}."
66
+ format: "icu-message",
67
+ messageSource: "{count}x {amount}",
68
+ messageArguments: {
69
+ type: "object",
70
+ properties: {
71
+ count: { type: "integer" },
72
+ amount: { type: "string" }
73
+ }
74
+ },
75
+ messageExample: {
76
+ count: 3,
77
+ amount: "$33.33"
78
+ }
61
79
  },
62
80
  redemptionCode: {
63
81
  type: "string",
64
- title: "Gift card code"
82
+ title: "Gift card code",
83
+ format: "icu-message",
84
+ messageSource: "Gift card code"
65
85
  },
66
86
  bankInvoiceNumber: {
67
87
  type: "string",
68
- title: "Bank invoice number"
88
+ title: "Bank invoice number",
89
+ format: "icu-message",
90
+ messageSource: "Bank invoice number"
69
91
  },
70
92
  bankInvoicePrint: {
71
93
  type: "string",
72
- title: "Print bank invoice"
94
+ title: "Print bank invoice",
95
+ format: "icu-message",
96
+ messageSource: "Print bank invoice"
73
97
  }
74
98
  }
75
99
  }
@@ -87,21 +111,8 @@ const OrderPaymentDefinition = defineComponent({
87
111
  category: "content"
88
112
  },
89
113
  schema: {},
90
- guideline: "The payments recorded on one of the shopper orders: method, last four digits when recorded, brand icon when known, amount, installments, gift-card code, and bank-invoice number. Labels are content; a blank field keeps the catalogue. The print link shows only while the order can still be cancelled. Place it on the order details page."
114
+ guideline: "The payments recorded on one of the shopper orders: method, last four digits when recorded, brand icon when known, amount, installments, gift-card code, and bank-invoice number. Labels are content. The print link shows only while the order can still be cancelled. Place it on the order details page."
91
115
  });
92
- function fill(template, values) {
93
- return template.replaceAll(/\{(count|amount)\}/g, (_, key) => String(values[key] ?? ""));
94
- }
95
- function paymentLabels(content, intl) {
96
- return {
97
- empty: copy(content?.empty, intl.formatMessage({ id: "fs/order-payment.empty" })),
98
- methodPlaceholder: copy(content?.methodPlaceholder, intl.formatMessage({ id: "fs/order-payment.method.placeholder" })),
99
- installments: content?.installments?.trim() || void 0,
100
- redemptionCode: copy(content?.redemptionCode, intl.formatMessage({ id: "fs/order-payment.redemption-code" })),
101
- bankInvoiceNumber: copy(content?.bankInvoiceNumber, intl.formatMessage({ id: "fs/order-payment.bank-invoice.number" })),
102
- bankInvoicePrint: copy(content?.bankInvoicePrint, intl.formatMessage({ id: "fs/order-payment.bank-invoice.print" }))
103
- };
104
- }
105
116
  function copy(value, fallback) {
106
117
  return value?.trim() || fallback;
107
118
  }
@@ -145,11 +156,9 @@ function OrderPaymentSkeleton({ className, ...props }) {
145
156
  });
146
157
  }
147
158
  function OrderPayment({ $content, $data, className, ref }) {
148
- const intl = useIntl();
159
+ const messages = useMessageFormatter(OrderPaymentContent, $content);
149
160
  const headingId = useId();
150
161
  if (!$data) return null;
151
- const heading = copy($content?.heading, intl.formatMessage({ id: "fs/order-payment.heading" }));
152
- const labels = paymentLabels($content, intl);
153
162
  const keys = paymentKeys($data.payments);
154
163
  return /* @__PURE__ */ jsxs("section", {
155
164
  ref,
@@ -159,23 +168,22 @@ function OrderPayment({ $content, $data, className, ref }) {
159
168
  children: [/* @__PURE__ */ jsx("h2", {
160
169
  id: headingId,
161
170
  "data-fs-order-payment-heading": "",
162
- children: heading
171
+ children: messages.format("heading")
163
172
  }), $data.payments.length === 0 ? /* @__PURE__ */ jsx("p", {
164
173
  "data-fs-order-payment-empty": "",
165
- children: labels.empty
174
+ children: messages.format("empty")
166
175
  }) : /* @__PURE__ */ jsx("ul", {
167
176
  "data-fs-order-payment-list": "",
168
177
  children: $data.payments.map((record, index) => /* @__PURE__ */ jsx(OrderPaymentItem, {
169
178
  record,
170
179
  allowCancellation: $data.allowCancellation,
171
180
  bankInvoiceName: $content?.bankInvoiceName,
172
- labels
181
+ messages
173
182
  }, keys[index]))
174
183
  })]
175
184
  });
176
185
  }
177
- function OrderPaymentItem({ record, allowCancellation, bankInvoiceName, labels }) {
178
- const intl = useIntl();
186
+ function OrderPaymentItem({ record, allowCancellation, bankInvoiceName, messages }) {
179
187
  const { formatMoney } = useStorefrontFormatters();
180
188
  const bankInvoice = isBankInvoice(record);
181
189
  const methodName = record.methodName?.trim() || null;
@@ -200,7 +208,7 @@ function OrderPaymentItem({ record, allowCancellation, bankInvoiceName, labels }
200
208
  }) : null,
201
209
  /* @__PURE__ */ jsx("span", {
202
210
  "data-fs-order-payment-method-name": "",
203
- children: name || labels.methodPlaceholder
211
+ children: name || messages.format("methodPlaceholder")
204
212
  }),
205
213
  lastDigits ? /* @__PURE__ */ jsx("span", {
206
214
  "data-fs-order-payment-last-digits": "",
@@ -214,10 +222,7 @@ function OrderPaymentItem({ record, allowCancellation, bankInvoiceName, labels }
214
222
  }),
215
223
  amount != null && installments ? /* @__PURE__ */ jsx("span", {
216
224
  "data-fs-order-payment-installments": "",
217
- children: labels.installments ? fill(labels.installments, {
218
- count: installments,
219
- amount: formatMoney(amount / installments, { currency })
220
- }) : intl.formatMessage({ id: "fs/order-payment.installments" }, {
225
+ children: messages.format("installments", {
221
226
  count: installments,
222
227
  amount: formatMoney(amount / installments, { currency })
223
228
  })
@@ -226,7 +231,7 @@ function OrderPaymentItem({ record, allowCancellation, bankInvoiceName, labels }
226
231
  "data-fs-order-payment-redemption-code": "",
227
232
  children: [/* @__PURE__ */ jsx("span", {
228
233
  "data-fs-order-payment-label": "",
229
- children: labels.redemptionCode
234
+ children: messages.format("redemptionCode")
230
235
  }), /* @__PURE__ */ jsx("span", {
231
236
  "data-fs-order-payment-value": "",
232
237
  children: record.redemptionCode
@@ -236,7 +241,7 @@ function OrderPaymentItem({ record, allowCancellation, bankInvoiceName, labels }
236
241
  "data-fs-order-payment-bank-invoice-number": "",
237
242
  children: [/* @__PURE__ */ jsx("span", {
238
243
  "data-fs-order-payment-label": "",
239
- children: labels.bankInvoiceNumber
244
+ children: messages.format("bankInvoiceNumber")
240
245
  }), /* @__PURE__ */ jsx("span", {
241
246
  "data-fs-order-payment-value": "",
242
247
  children: record.bankInvoiceNumber
@@ -247,7 +252,7 @@ function OrderPaymentItem({ record, allowCancellation, bankInvoiceName, labels }
247
252
  target: "_blank",
248
253
  rel: "noopener noreferrer",
249
254
  "data-fs-order-payment-print": "",
250
- children: labels.bankInvoicePrint
255
+ children: messages.format("bankInvoicePrint")
251
256
  }) : null
252
257
  ]
253
258
  });
@@ -1 +1 @@
1
- {"version":3,"file":"order-payment.js","names":[],"sources":["../../../src/matter/order-payment/order-payment.tsx"],"sourcesContent":["'use client';\n\nimport { type ContentValue, defineComponent, defineContentType } from '@vtex/fs-core';\nimport { type ComponentPropsWithRef, type Ref, useId } from 'react';\nimport { Icon } from '../../particles/icon/icon.js';\nimport { useStorefrontFormatters } from '../../sdk/format/client.js';\nimport { useIntl } from '../../sdk/i18n/client.js';\nimport { resolveSafeHref } from '../../utils/safe-href.js';\nimport { paymentMethodIconName } from '../payment/payment-method-badges.js';\n\nconst fragment = /* GraphQL */ `\n fragment OrderPaymentData on Query {\n customerOrder(id: $orderId) {\n id\n allowCancellation\n payments {\n methodName\n lastDigits\n amount {\n amount\n currencyCode\n }\n installments\n redemptionCode\n bankInvoiceNumber\n bankInvoicePrintUrl\n }\n }\n }\n`;\n\nexport const OrderPaymentContent = defineContentType({\n id: 'order-payment',\n title: 'Order Payment',\n description:\n 'The heading, the bank-invoice name, and the fixed labels of the payment section. The installment line keeps {count} and {amount}.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n heading: { type: 'string', title: 'Heading' },\n bankInvoiceName: { type: 'string', title: 'Bank invoice name' },\n empty: { type: 'string', title: 'Empty' },\n methodPlaceholder: { type: 'string', title: 'Method unavailable' },\n installments: {\n type: 'string',\n title: 'Installments',\n description: 'Keep the placeholders {count} and {amount}.',\n },\n redemptionCode: { type: 'string', title: 'Gift card code' },\n bankInvoiceNumber: { type: 'string', title: 'Bank invoice number' },\n bankInvoicePrint: { type: 'string', title: 'Print bank invoice' },\n },\n },\n});\n\nexport type OrderPaymentContentValue = ContentValue<typeof OrderPaymentContent>;\n\nexport type OrderPaymentRecord = {\n methodName: string | null;\n lastDigits: string | null;\n amount: { amount: string | number; currencyCode: string };\n installments: number | null;\n redemptionCode: string | null;\n bankInvoiceNumber: string | null;\n bankInvoicePrintUrl: string | null;\n};\n\nexport type OrderPaymentData = {\n id: string;\n allowCancellation: boolean;\n payments: OrderPaymentRecord[];\n};\n\nexport type OrderPaymentProps = Readonly<{\n $content?: OrderPaymentContentValue;\n $data?: OrderPaymentData | null;\n className?: string;\n ref?: Ref<HTMLElement>;\n}>;\n\nexport const OrderPaymentDefinition = defineComponent<OrderPaymentProps>({\n name: 'OrderPayment',\n importPath: '@vtex/faststore/components',\n component: OrderPayment,\n content: OrderPaymentContent,\n fragment,\n fetchStrategy: 'static',\n skeleton: OrderPaymentSkeleton,\n editor: { label: 'Order Payment', category: 'content' },\n schema: {},\n guideline:\n 'The payments recorded on one of the shopper orders: method, last four digits when recorded, brand icon when known, amount, installments, gift-card code, and bank-invoice number. Labels are content; a blank field keeps the catalogue. The print link shows only while the order can still be cancelled. Place it on the order details page.',\n});\n\nfunction fill(template: string, values: Record<string, string | number>): string {\n return template.replaceAll(/\\{(count|amount)\\}/g, (_, key: string) => String(values[key] ?? ''));\n}\n\ntype PaymentLabels = {\n empty: string;\n methodPlaceholder: string;\n installments: string | undefined;\n redemptionCode: string;\n bankInvoiceNumber: string;\n bankInvoicePrint: string;\n};\n\nfunction paymentLabels(content: OrderPaymentContentValue | undefined, intl: ReturnType<typeof useIntl>): PaymentLabels {\n return {\n empty: copy(content?.empty, intl.formatMessage({ id: 'fs/order-payment.empty' })),\n methodPlaceholder: copy(\n content?.methodPlaceholder,\n intl.formatMessage({ id: 'fs/order-payment.method.placeholder' }),\n ),\n installments: content?.installments?.trim() || undefined,\n redemptionCode: copy(content?.redemptionCode, intl.formatMessage({ id: 'fs/order-payment.redemption-code' })),\n bankInvoiceNumber: copy(\n content?.bankInvoiceNumber,\n intl.formatMessage({ id: 'fs/order-payment.bank-invoice.number' }),\n ),\n bankInvoicePrint: copy(\n content?.bankInvoicePrint,\n intl.formatMessage({ id: 'fs/order-payment.bank-invoice.print' }),\n ),\n };\n}\n\nfunction copy(value: string | undefined, fallback: string): string {\n const trimmed = value?.trim();\n return trimmed || fallback;\n}\n\nfunction moneyAmount(amount: string | number): number | null {\n // Number('') and Number(' ') are 0, which would print a blank upstream amount as a real zero.\n if (typeof amount === 'string' && amount.trim() === '') {\n return null;\n }\n const value = typeof amount === 'number' ? amount : Number(amount);\n return Number.isFinite(value) ? value : null;\n}\n\n// Payments carry no identifier, so the key is the record's own values; a repeated record (two\n// identical card charges) gets a counter so React still sees distinct keys.\nfunction paymentKeys(payments: readonly OrderPaymentRecord[]): string[] {\n const seen = new Map<string, number>();\n return payments.map((record) => {\n const base = [\n record.methodName,\n record.lastDigits,\n record.amount.amount,\n record.amount.currencyCode,\n record.installments,\n record.redemptionCode,\n record.bankInvoiceNumber,\n ]\n .map((value) => value ?? '')\n .join(':');\n const repeats = seen.get(base) ?? 0;\n seen.set(base, repeats + 1);\n return repeats === 0 ? base : `${base}#${repeats}`;\n });\n}\n\nfunction isBankInvoice(record: OrderPaymentRecord): boolean {\n return Boolean(record.bankInvoiceNumber || record.bankInvoicePrintUrl);\n}\n\nfunction printHref(record: OrderPaymentRecord, allowCancellation: boolean): string | null {\n if (!allowCancellation || !record.bankInvoicePrintUrl) {\n return null;\n }\n const destination = resolveSafeHref(record.bankInvoicePrintUrl);\n return destination.safe ? destination.href : null;\n}\n\nexport function OrderPaymentSkeleton({ className, ...props }: ComponentPropsWithRef<'div'>) {\n return (\n <div {...props} className={className} data-fs-order-payment-skeleton=\"\" aria-hidden=\"true\">\n <span data-fs-order-payment-skeleton-row=\"\" />\n <span data-fs-order-payment-skeleton-row=\"\" />\n </div>\n );\n}\n\nexport function OrderPayment({ $content, $data, className, ref }: OrderPaymentProps) {\n const intl = useIntl();\n const headingId = useId();\n\n if (!$data) {\n return null;\n }\n\n const heading = copy($content?.heading, intl.formatMessage({ id: 'fs/order-payment.heading' }));\n const labels = paymentLabels($content, intl);\n const keys = paymentKeys($data.payments);\n\n return (\n <section ref={ref} aria-labelledby={headingId} className={className} data-fs-order-payment=\"\">\n <h2 id={headingId} data-fs-order-payment-heading=\"\">\n {heading}\n </h2>\n {$data.payments.length === 0 ? (\n <p data-fs-order-payment-empty=\"\">{labels.empty}</p>\n ) : (\n <ul data-fs-order-payment-list=\"\">\n {$data.payments.map((record, index) => (\n <OrderPaymentItem\n key={keys[index]}\n record={record}\n allowCancellation={$data.allowCancellation}\n bankInvoiceName={$content?.bankInvoiceName}\n labels={labels}\n />\n ))}\n </ul>\n )}\n </section>\n );\n}\n\ntype OrderPaymentItemProps = Readonly<{\n record: OrderPaymentRecord;\n allowCancellation: boolean;\n bankInvoiceName: string | undefined;\n labels: PaymentLabels;\n}>;\n\nfunction OrderPaymentItem({ record, allowCancellation, bankInvoiceName, labels }: OrderPaymentItemProps) {\n const intl = useIntl();\n const { formatMoney } = useStorefrontFormatters();\n const bankInvoice = isBankInvoice(record);\n const methodName = record.methodName?.trim() || null;\n const name = bankInvoice ? copy(bankInvoiceName, methodName ?? '') : (methodName ?? '');\n const lastDigits = record.lastDigits?.trim() || null;\n const icon = methodName ? paymentMethodIconName(methodName) : null;\n const amount = moneyAmount(record.amount.amount);\n const currency = record.amount.currencyCode;\n const installments = record.installments != null && record.installments > 1 ? record.installments : null;\n const href = printHref(record, allowCancellation);\n\n return (\n <li data-fs-order-payment-item=\"\" data-fs-order-payment-item-bank-invoice={bankInvoice ? '' : undefined}>\n <span data-fs-order-payment-method=\"\">\n {icon ? <Icon name={icon} aria-hidden=\"true\" data-fs-order-payment-icon=\"\" /> : null}\n <span data-fs-order-payment-method-name=\"\">{name || labels.methodPlaceholder}</span>\n {lastDigits ? <span data-fs-order-payment-last-digits=\"\">{`•••• ${lastDigits}`}</span> : null}\n </span>\n {amount == null ? null : <span data-fs-order-payment-amount=\"\">{formatMoney(amount, { currency })}</span>}\n {amount != null && installments ? (\n <span data-fs-order-payment-installments=\"\">\n {labels.installments\n ? fill(labels.installments, {\n count: installments,\n amount: formatMoney(amount / installments, { currency }),\n })\n : intl.formatMessage(\n { id: 'fs/order-payment.installments' },\n { count: installments, amount: formatMoney(amount / installments, { currency }) },\n )}\n </span>\n ) : null}\n {record.redemptionCode ? (\n <span data-fs-order-payment-redemption-code=\"\">\n <span data-fs-order-payment-label=\"\">{labels.redemptionCode}</span>\n <span data-fs-order-payment-value=\"\">{record.redemptionCode}</span>\n </span>\n ) : null}\n {record.bankInvoiceNumber ? (\n <span data-fs-order-payment-bank-invoice-number=\"\">\n <span data-fs-order-payment-label=\"\">{labels.bankInvoiceNumber}</span>\n <span data-fs-order-payment-value=\"\">{record.bankInvoiceNumber}</span>\n </span>\n ) : null}\n {href ? (\n <a href={href} target=\"_blank\" rel=\"noopener noreferrer\" data-fs-order-payment-print=\"\">\n {labels.bankInvoicePrint}\n </a>\n ) : null}\n </li>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAUA,MAAM,WAAyB;;;;;;;;;;;;;;;;;;;;AAqB/B,MAAa,sBAAsB,kBAAkB;CACnD,IAAI;CACJ,OAAO;CACP,aACE;CACF,QAAQ;EACN,MAAM;EACN,sBAAsB;EACtB,YAAY;GACV,SAAS;IAAE,MAAM;IAAU,OAAO;GAAU;GAC5C,iBAAiB;IAAE,MAAM;IAAU,OAAO;GAAoB;GAC9D,OAAO;IAAE,MAAM;IAAU,OAAO;GAAQ;GACxC,mBAAmB;IAAE,MAAM;IAAU,OAAO;GAAqB;GACjE,cAAc;IACZ,MAAM;IACN,OAAO;IACP,aAAa;GACf;GACA,gBAAgB;IAAE,MAAM;IAAU,OAAO;GAAiB;GAC1D,mBAAmB;IAAE,MAAM;IAAU,OAAO;GAAsB;GAClE,kBAAkB;IAAE,MAAM;IAAU,OAAO;GAAqB;EAClE;CACF;AACF,CAAC;AA2BD,MAAa,yBAAyB,gBAAmC;CACvE,MAAM;CACN,YAAY;CACZ,WAAW;CACX,SA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YAAY,SAAS,cAAc,EAAE,SAAS,CAAC;IACzD,CAAC,IACD,KAAK,cACH,EAAE,IAAI,gCAAgC,GACtC;KAAE,OAAO;KAAc,QAAQ,YAAY,SAAS,cAAc,EAAE,SAAS,CAAC;IAAE,CAClF;GACA,CAAA,IACJ;GACH,OAAO,iBACN,qBAAC,QAAD;IAAM,yCAAsC;IAA5C,UAAA,CACE,oBAAC,QAAD;KAAM,+BAA4B;KAAI,UAAA,OAAO;IAAqB,CAAA,GAClE,oBAAC,QAAD;KAAM,+BAA4B;KAAI,UAAA,OAAO;IAAqB,CAAA,CAC9D;GACJ,CAAA,IAAA;GACH,OAAO,oBACN,qBAAC,QAAD;IAAM,6CAA0C;IAAhD,UAAA,CACE,oBAAC,QAAD;KAAM,+BAA4B;KAAI,UAAA,OAAO;IAAwB,CAAA,GACrE,oBAAC,QAAD;KAAM,+BAA4B;KAAI,UAAA,OAAO;IAAwB,CAAA,CACjE;GACJ,CAAA,IAAA;GACH,OACC,oBAAC,KAAD;IAAS;IAAM,QAAO;IAAS,KAAI;IAAsB,+BAA4B;IAClF,UAAA,OAAO;GACP,CAAA,IACD;EACF;;AAER"}
1
+ {"version":3,"file":"order-payment.js","names":[],"sources":["../../../src/matter/order-payment/order-payment.tsx"],"sourcesContent":["'use client';\n\nimport { type ContentValue, defineComponent, defineContentType, type MessageLocaleProp } from '@vtex/fs-core';\nimport { type ComponentPropsWithRef, type Ref, useId } from 'react';\nimport { Icon } from '../../particles/icon/icon.js';\nimport { useStorefrontFormatters } from '../../sdk/format/client.js';\nimport type { MessageFormatter } from '../../sdk/i18n/message-formatter.js';\nimport { useMessageFormatter } from '../../sdk/i18n/use-message-formatter.js';\nimport { resolveSafeHref } from '../../utils/safe-href.js';\nimport { paymentMethodIconName } from '../payment/payment-method-badges.js';\n\nconst fragment = /* GraphQL */ `\n fragment OrderPaymentData on Query {\n customerOrder(id: $orderId) {\n id\n allowCancellation\n payments {\n methodName\n lastDigits\n amount {\n amount\n currencyCode\n }\n installments\n redemptionCode\n bankInvoiceNumber\n bankInvoicePrintUrl\n }\n }\n }\n`;\n\nexport const OrderPaymentContent = defineContentType({\n id: 'order-payment',\n title: 'Order Payment',\n description: 'The heading, the bank-invoice name, and the fixed labels of the payment section.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n heading: { type: 'string', title: 'Heading', format: 'icu-message', messageSource: 'Payment' },\n bankInvoiceName: { type: 'string', title: 'Bank invoice name' },\n empty: { type: 'string', title: 'Empty', format: 'icu-message', messageSource: 'No payment recorded' },\n methodPlaceholder: {\n type: 'string',\n title: 'Method unavailable',\n format: 'icu-message',\n messageSource: 'Payment method unavailable',\n },\n installments: {\n type: 'string',\n title: 'Installments',\n format: 'icu-message',\n messageSource: '{count}x {amount}',\n messageArguments: {\n type: 'object',\n properties: { count: { type: 'integer' }, amount: { type: 'string' } },\n },\n messageExample: { count: 3, amount: '$33.33' },\n },\n redemptionCode: {\n type: 'string',\n title: 'Gift card code',\n format: 'icu-message',\n messageSource: 'Gift card code',\n },\n bankInvoiceNumber: {\n type: 'string',\n title: 'Bank invoice number',\n format: 'icu-message',\n messageSource: 'Bank invoice number',\n },\n bankInvoicePrint: {\n type: 'string',\n title: 'Print bank invoice',\n format: 'icu-message',\n messageSource: 'Print bank invoice',\n },\n },\n },\n});\n\nexport type OrderPaymentContentValue = ContentValue<typeof OrderPaymentContent>;\n\nexport type OrderPaymentRecord = {\n methodName: string | null;\n lastDigits: string | null;\n amount: { amount: string | number; currencyCode: string };\n installments: number | null;\n redemptionCode: string | null;\n bankInvoiceNumber: string | null;\n bankInvoicePrintUrl: string | null;\n};\n\nexport type OrderPaymentData = {\n id: string;\n allowCancellation: boolean;\n payments: OrderPaymentRecord[];\n};\n\nexport type OrderPaymentProps = MessageLocaleProp &\n Readonly<{\n $content?: OrderPaymentContentValue;\n $data?: OrderPaymentData | null;\n className?: string;\n ref?: Ref<HTMLElement>;\n }>;\n\nexport const OrderPaymentDefinition = defineComponent<OrderPaymentProps>({\n name: 'OrderPayment',\n importPath: '@vtex/faststore/components',\n component: OrderPayment,\n content: OrderPaymentContent,\n fragment,\n fetchStrategy: 'static',\n skeleton: OrderPaymentSkeleton,\n editor: { label: 'Order Payment', category: 'content' },\n schema: {},\n guideline:\n 'The payments recorded on one of the shopper orders: method, last four digits when recorded, brand icon when known, amount, installments, gift-card code, and bank-invoice number. Labels are content. The print link shows only while the order can still be cancelled. Place it on the order details page.',\n});\n\nfunction copy(value: string | undefined, fallback: string): string {\n const trimmed = value?.trim();\n return trimmed || fallback;\n}\n\nfunction moneyAmount(amount: string | number): number | null {\n // Number('') and Number(' ') are 0, which would print a blank upstream amount as a real zero.\n if (typeof amount === 'string' && amount.trim() === '') {\n return null;\n }\n const value = typeof amount === 'number' ? amount : Number(amount);\n return Number.isFinite(value) ? value : null;\n}\n\n// Payments carry no identifier, so the key is the record's own values; a repeated record (two\n// identical card charges) gets a counter so React still sees distinct keys.\nfunction paymentKeys(payments: readonly OrderPaymentRecord[]): string[] {\n const seen = new Map<string, number>();\n return payments.map((record) => {\n const base = [\n record.methodName,\n record.lastDigits,\n record.amount.amount,\n record.amount.currencyCode,\n record.installments,\n record.redemptionCode,\n record.bankInvoiceNumber,\n ]\n .map((value) => value ?? '')\n .join(':');\n const repeats = seen.get(base) ?? 0;\n seen.set(base, repeats + 1);\n return repeats === 0 ? base : `${base}#${repeats}`;\n });\n}\n\nfunction isBankInvoice(record: OrderPaymentRecord): boolean {\n return Boolean(record.bankInvoiceNumber || record.bankInvoicePrintUrl);\n}\n\nfunction printHref(record: OrderPaymentRecord, allowCancellation: boolean): string | null {\n if (!allowCancellation || !record.bankInvoicePrintUrl) {\n return null;\n }\n const destination = resolveSafeHref(record.bankInvoicePrintUrl);\n return destination.safe ? destination.href : null;\n}\n\nexport function OrderPaymentSkeleton({ className, ...props }: ComponentPropsWithRef<'div'>) {\n return (\n <div {...props} className={className} data-fs-order-payment-skeleton=\"\" aria-hidden=\"true\">\n <span data-fs-order-payment-skeleton-row=\"\" />\n <span data-fs-order-payment-skeleton-row=\"\" />\n </div>\n );\n}\n\nexport function OrderPayment({ $content, $data, className, ref }: OrderPaymentProps) {\n const messages = useMessageFormatter(OrderPaymentContent, $content);\n const headingId = useId();\n\n if (!$data) {\n return null;\n }\n\n const keys = paymentKeys($data.payments);\n\n return (\n <section ref={ref} aria-labelledby={headingId} className={className} data-fs-order-payment=\"\">\n <h2 id={headingId} data-fs-order-payment-heading=\"\">\n {messages.format('heading')}\n </h2>\n {$data.payments.length === 0 ? (\n <p data-fs-order-payment-empty=\"\">{messages.format('empty')}</p>\n ) : (\n <ul data-fs-order-payment-list=\"\">\n {$data.payments.map((record, index) => (\n <OrderPaymentItem\n key={keys[index]}\n record={record}\n allowCancellation={$data.allowCancellation}\n bankInvoiceName={$content?.bankInvoiceName}\n messages={messages}\n />\n ))}\n </ul>\n )}\n </section>\n );\n}\n\ntype OrderPaymentItemProps = Readonly<{\n record: OrderPaymentRecord;\n allowCancellation: boolean;\n bankInvoiceName: string | undefined;\n messages: MessageFormatter<typeof OrderPaymentContent>;\n}>;\n\nfunction OrderPaymentItem({ record, allowCancellation, bankInvoiceName, messages }: OrderPaymentItemProps) {\n const { formatMoney } = useStorefrontFormatters();\n const bankInvoice = isBankInvoice(record);\n const methodName = record.methodName?.trim() || null;\n const name = bankInvoice ? copy(bankInvoiceName, methodName ?? '') : (methodName ?? '');\n const lastDigits = record.lastDigits?.trim() || null;\n const icon = methodName ? paymentMethodIconName(methodName) : null;\n const amount = moneyAmount(record.amount.amount);\n const currency = record.amount.currencyCode;\n const installments = record.installments != null && record.installments > 1 ? record.installments : null;\n const href = printHref(record, allowCancellation);\n\n return (\n <li data-fs-order-payment-item=\"\" data-fs-order-payment-item-bank-invoice={bankInvoice ? '' : undefined}>\n <span data-fs-order-payment-method=\"\">\n {icon ? <Icon name={icon} aria-hidden=\"true\" data-fs-order-payment-icon=\"\" /> : null}\n <span data-fs-order-payment-method-name=\"\">{name || messages.format('methodPlaceholder')}</span>\n {lastDigits ? <span data-fs-order-payment-last-digits=\"\">{`•••• ${lastDigits}`}</span> : null}\n </span>\n {amount == null ? null : <span data-fs-order-payment-amount=\"\">{formatMoney(amount, { currency })}</span>}\n {amount != null && installments ? (\n <span data-fs-order-payment-installments=\"\">\n {messages.format('installments', {\n count: installments,\n amount: formatMoney(amount / installments, { currency }),\n })}\n </span>\n ) : null}\n {record.redemptionCode ? (\n <span data-fs-order-payment-redemption-code=\"\">\n <span data-fs-order-payment-label=\"\">{messages.format('redemptionCode')}</span>\n <span data-fs-order-payment-value=\"\">{record.redemptionCode}</span>\n </span>\n ) : null}\n {record.bankInvoiceNumber ? (\n <span data-fs-order-payment-bank-invoice-number=\"\">\n <span data-fs-order-payment-label=\"\">{messages.format('bankInvoiceNumber')}</span>\n <span data-fs-order-payment-value=\"\">{record.bankInvoiceNumber}</span>\n </span>\n ) : null}\n {href ? (\n <a href={href} target=\"_blank\" rel=\"noopener noreferrer\" data-fs-order-payment-print=\"\">\n {messages.format('bankInvoicePrint')}\n </a>\n ) : null}\n </li>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAWA,MAAM,WAAyB;;;;;;;;;;;;;;;;;;;;AAqB/B,MAAa,sBAAsB,kBAAkB;CACnD,IAAI;CACJ,OAAO;CACP,aAAa;CACb,QAAQ;EACN,MAAM;EACN,sBAAsB;EACtB,YAAY;GACV,SAAS;IAAE,MAAM;IAAU,OAAO;IAAW,QAAQ;IAAe,eAAe;GAAU;GAC7F,iBAAiB;IAAE,MAAM;IAAU,OAAO;GAAoB;GAC9D,OAAO;IAAE,MAAM;IAAU,OAAO;IAAS,QAAQ;IAAe,eAAe;GAAsB;GACrG,mBAAmB;IACjB,MAAM;IACN,OAAO;IACP,QAAQ;IACR,eAAe;GACjB;GACA,cAAc;IACZ,MAAM;IACN,OAAO;IACP,QAAQ;IACR,eAAe;IACf,kBAAkB;KAChB,MAAM;KACN,YAAY;MAAE,OAAO,EAAE,MAAM,UAAU;MAAG,QAAQ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QAAD;IAAM,6CAA0C;IAAhD,UAAA,CACE,oBAAC,QAAD;KAAM,+BAA4B;KAAI,UAAA,SAAS,OAAO,mBAAmB;IAAQ,CAAA,GACjF,oBAAC,QAAD;KAAM,+BAA4B;KAAI,UAAA,OAAO;IAAwB,CAAA,CACjE;GACJ,CAAA,IAAA;GACH,OACC,oBAAC,KAAD;IAAS;IAAM,QAAO;IAAS,KAAI;IAAsB,+BAA4B;IAClF,UAAA,SAAS,OAAO,kBAAkB;GAClC,CAAA,IACD;EACF;;AAER"}
@@ -1,8 +1,9 @@
1
+ import { ContentValue, MessageLocaleProp } from "../../core/dist/define-content-type.js";
1
2
  import { ComponentDefinition } from "../../core/dist/define-component.js";
2
3
  import "../../core/dist/index.js";
3
- import { ShippingEstimateUnit } from "../shipping-simulator/shipping-simulator.js";
4
- import { OrderPlacedMoney } from "./order-placed.js";
5
4
  import { AddressSummaryFields } from "../../particles/address-summary/address-summary.js";
5
+ import { OrderPlacedMoney } from "./order-placed.js";
6
+ import { ShippingEstimateUnit } from "../shipping-simulator/shipping-simulator.js";
6
7
  import { ReactNode } from "react";
7
8
  //#region src/matter/order-placed/order-placed-deliveries.d.ts
8
9
  export type OrderPlacedShippingEstimateUnit = ShippingEstimateUnit;
@@ -93,17 +94,10 @@ export type OrderPlacedDeliveryListProps = {
93
94
  children?: ReactNode;
94
95
  $data?: OrderPlacedDeliveryListData;
95
96
  };
96
- export type OrderPlacedDeliveryGroupProps = {
97
+ export type OrderPlacedDeliveryGroupProps = MessageLocaleProp & {
98
+ $content?: ContentValue<typeof OrderPlacedDeliveryGroupContent>;
97
99
  className?: string;
98
100
  children?: ReactNode;
99
- /** The dated promise; `{date}` placeholder. */
100
- dateTemplate?: string;
101
- /** `{count}` placeholder, for any count but one. */
102
- itemCountTemplate?: string;
103
- /** `{count}` placeholder, for a count of one. */
104
- itemCountOneTemplate?: string;
105
- /** `{name}` placeholder, shown when the delivery is picked up. */
106
- pickupPointTemplate?: string;
107
101
  };
108
102
  export type OrderPlacedItemRowProps = {
109
103
  className?: string;
@@ -117,6 +111,144 @@ export declare function useOrderDelivery(): OrderPlacedDelivery;
117
111
  /** The item the nearest OrderPlacedItemRow renders this subtree for. */
118
112
  export declare function useOrderPlacedItem(): OrderPlacedItem;
119
113
  export declare const OrderPlacedDeliveryListDefinition: ComponentDefinition<OrderPlacedDeliveryListProps>;
114
+ export declare const OrderPlacedDeliveryGroupContent: {
115
+ readonly id: "order-placed-delivery-group";
116
+ readonly title: "Order Placed Delivery Group";
117
+ readonly description: "The dated promise, the relative estimate sentences (one per unit), the item count and the pickup point of a placed order's delivery.";
118
+ readonly schema: {
119
+ readonly type: "object";
120
+ readonly additionalProperties: false;
121
+ readonly properties: {
122
+ readonly dateTemplate: {
123
+ readonly type: "string";
124
+ readonly title: "Dated promise";
125
+ readonly description: "`date` is the formatted estimated date.";
126
+ readonly format: "icu-message";
127
+ readonly messageSource: "Arrives by {date}";
128
+ readonly messageArguments: {
129
+ readonly type: "object";
130
+ readonly properties: {
131
+ readonly date: {
132
+ readonly type: "string";
133
+ };
134
+ };
135
+ };
136
+ readonly messageExample: {
137
+ readonly date: "Mar 12, 2026";
138
+ };
139
+ };
140
+ readonly itemCountTemplate: {
141
+ readonly type: "string";
142
+ readonly title: "Item count";
143
+ readonly format: "icu-message";
144
+ readonly messageSource: "{count, plural, one {# item} other {# items}}";
145
+ readonly messageArguments: {
146
+ readonly type: "object";
147
+ readonly properties: {
148
+ readonly count: {
149
+ readonly type: "integer";
150
+ };
151
+ };
152
+ };
153
+ readonly messageExample: {
154
+ readonly count: 3;
155
+ };
156
+ };
157
+ readonly pickupPointTemplate: {
158
+ readonly type: "string";
159
+ readonly title: "Pickup point";
160
+ readonly description: "`name` is the pickup point name.";
161
+ readonly format: "icu-message";
162
+ readonly messageSource: "Pickup at {name}";
163
+ readonly messageArguments: {
164
+ readonly type: "object";
165
+ readonly properties: {
166
+ readonly name: {
167
+ readonly type: "string";
168
+ };
169
+ };
170
+ };
171
+ readonly messageExample: {
172
+ readonly name: "Downtown store";
173
+ };
174
+ };
175
+ readonly today: {
176
+ readonly type: "string";
177
+ readonly title: "Arrives today";
178
+ readonly format: "icu-message";
179
+ readonly messageSource: "arrives today";
180
+ };
181
+ readonly inBusinessDays: {
182
+ readonly type: "string";
183
+ readonly title: "In business days";
184
+ readonly format: "icu-message";
185
+ readonly messageSource: "in {days, plural, one {# business day} other {# business days}}";
186
+ readonly messageArguments: {
187
+ readonly type: "object";
188
+ readonly properties: {
189
+ readonly days: {
190
+ readonly type: "integer";
191
+ };
192
+ };
193
+ };
194
+ readonly messageExample: {
195
+ readonly days: 3;
196
+ };
197
+ };
198
+ readonly inDays: {
199
+ readonly type: "string";
200
+ readonly title: "In days";
201
+ readonly format: "icu-message";
202
+ readonly messageSource: "in {days, plural, one {# day} other {# days}}";
203
+ readonly messageArguments: {
204
+ readonly type: "object";
205
+ readonly properties: {
206
+ readonly days: {
207
+ readonly type: "integer";
208
+ };
209
+ };
210
+ };
211
+ readonly messageExample: {
212
+ readonly days: 3;
213
+ };
214
+ };
215
+ readonly inHours: {
216
+ readonly type: "string";
217
+ readonly title: "In hours";
218
+ readonly format: "icu-message";
219
+ readonly messageSource: "in {hours, plural, one {# hour} other {# hours}}";
220
+ readonly messageArguments: {
221
+ readonly type: "object";
222
+ readonly properties: {
223
+ readonly hours: {
224
+ readonly type: "integer";
225
+ };
226
+ };
227
+ };
228
+ readonly messageExample: {
229
+ readonly hours: 4;
230
+ };
231
+ };
232
+ readonly inMinutes: {
233
+ readonly type: "string";
234
+ readonly title: "In minutes";
235
+ readonly format: "icu-message";
236
+ readonly messageSource: "in {minutes, plural, one {# minute} other {# minutes}}";
237
+ readonly messageArguments: {
238
+ readonly type: "object";
239
+ readonly properties: {
240
+ readonly minutes: {
241
+ readonly type: "integer";
242
+ };
243
+ };
244
+ };
245
+ readonly messageExample: {
246
+ readonly minutes: 30;
247
+ };
248
+ };
249
+ };
250
+ };
251
+ };
120
252
  export declare const OrderPlacedDeliveryGroupDefinition: ComponentDefinition<OrderPlacedDeliveryGroupProps>;
121
253
  export declare const OrderPlacedItemRowDefinition: ComponentDefinition<OrderPlacedItemRowProps>;
122
254
  export declare const OrderPlacedItemCompositionsDefinition: ComponentDefinition<OrderPlacedItemCompositionsProps>;
@@ -127,7 +259,7 @@ export declare function OrderPlacedDeliveryList({ className, children, $data: $d
127
259
  * `AddressSummary*` children. The dated promise wins when the order carries one; otherwise the relative
128
260
  * estimate. A delivery with neither a method nor a date still shows its items and count.
129
261
  */
130
- export declare function OrderPlacedDeliveryGroup({ className, children, dateTemplate, itemCountTemplate, itemCountOneTemplate, pickupPointTemplate }: Readonly<OrderPlacedDeliveryGroupProps>): import("react/jsx-runtime").JSX.Element;
262
+ export declare function OrderPlacedDeliveryGroup({ $content, $locale, className, children }: Readonly<OrderPlacedDeliveryGroupProps>): import("react/jsx-runtime").JSX.Element;
131
263
  /**
132
264
  * Each item of the nearest delivery, through the cart's own `CartItemRoot`: the row publishes the
133
265
  * order item on `DataOverrideContext`, the seam `CartItemRoot` reads before its `$data`, so the cart's