@vtex/faststore 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (538) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/LICENSE +21 -0
  3. package/README.md +95 -0
  4. package/dist/actions.json +334 -0
  5. package/dist/catalog.json +6615 -0
  6. package/dist/client.d.ts +17 -0
  7. package/dist/client.js +8 -0
  8. package/dist/components.d.ts +87 -0
  9. package/dist/components.js +87 -0
  10. package/dist/content-types.json +684 -0
  11. package/dist/core/dist/actions/mock-action.d.ts +24 -0
  12. package/dist/core/dist/actions/mock-action.js +28 -0
  13. package/dist/core/dist/actions/mock-action.js.map +1 -0
  14. package/dist/core/dist/actions/registry.d.ts +24 -0
  15. package/dist/core/dist/actions/registry.js +28 -0
  16. package/dist/core/dist/actions/registry.js.map +1 -0
  17. package/dist/core/dist/define-component.d.ts +100 -0
  18. package/dist/core/dist/define-component.js +8 -0
  19. package/dist/core/dist/define-component.js.map +1 -0
  20. package/dist/core/dist/define-content-type.d.ts +95 -0
  21. package/dist/core/dist/define-content-type.js +283 -0
  22. package/dist/core/dist/define-content-type.js.map +1 -0
  23. package/dist/core/dist/index.d.ts +7 -0
  24. package/dist/core/dist/index.js +5 -0
  25. package/dist/core/dist/schema/generated/schema.d.ts +28 -0
  26. package/dist/core/dist/types.d.ts +1 -0
  27. package/dist/docs/access-code-field.md +100 -0
  28. package/dist/docs/access-code-sign-in.md +174 -0
  29. package/dist/docs/account-entry-point.md +155 -0
  30. package/dist/docs/address-summary.md +50 -0
  31. package/dist/docs/buy-button.md +162 -0
  32. package/dist/docs/carousel.md +105 -0
  33. package/dist/docs/cart-item.md +162 -0
  34. package/dist/docs/cart-totalizer.md +197 -0
  35. package/dist/docs/cart.md +495 -0
  36. package/dist/docs/client-preferences.md +184 -0
  37. package/dist/docs/client-profile-form.md +192 -0
  38. package/dist/docs/client-profile.md +117 -0
  39. package/dist/docs/container.md +97 -0
  40. package/dist/docs/document-field.md +97 -0
  41. package/dist/docs/email-field.md +93 -0
  42. package/dist/docs/email-identification.md +102 -0
  43. package/dist/docs/footer-copyright.md +112 -0
  44. package/dist/docs/footer-link-group.md +162 -0
  45. package/dist/docs/footer-root.md +145 -0
  46. package/dist/docs/footer-social.md +151 -0
  47. package/dist/docs/free-shipping-progress.md +87 -0
  48. package/dist/docs/gallery.md +84 -0
  49. package/dist/docs/header-root.md +150 -0
  50. package/dist/docs/identity-edit.md +88 -0
  51. package/dist/docs/identity-summary.md +106 -0
  52. package/dist/docs/incentives.md +151 -0
  53. package/dist/docs/logo.md +135 -0
  54. package/dist/docs/meter.md +67 -0
  55. package/dist/docs/navigation-link-list.md +171 -0
  56. package/dist/docs/navigation-link.md +163 -0
  57. package/dist/docs/navigation-menu.md +264 -0
  58. package/dist/docs/payment-methods.md +139 -0
  59. package/dist/docs/phone-field.md +106 -0
  60. package/dist/docs/postal-code-field.md +126 -0
  61. package/dist/docs/pricing.md +499 -0
  62. package/dist/docs/product-gallery.md +409 -0
  63. package/dist/docs/product-information.md +295 -0
  64. package/dist/docs/product-list.md +170 -0
  65. package/dist/docs/product-quantity.md +88 -0
  66. package/dist/docs/product-shelf.md +141 -0
  67. package/dist/docs/promotion.md +109 -0
  68. package/dist/docs/region.md +225 -0
  69. package/dist/docs/session.md +123 -0
  70. package/dist/docs/shipping-address.md +390 -0
  71. package/dist/docs/shipping-simulator.md +147 -0
  72. package/dist/docs/sign-in-form.md +117 -0
  73. package/dist/docs/tabs.md +176 -0
  74. package/dist/docs/toast.md +124 -0
  75. package/dist/docs/variant-selector.md +450 -0
  76. package/dist/graphql/define-subgraph.d.ts +12 -0
  77. package/dist/graphql/define-subgraph.js +15 -0
  78. package/dist/graphql/define-subgraph.js.map +1 -0
  79. package/dist/graphql/gql.d.ts +10 -0
  80. package/dist/graphql/gql.js +16 -0
  81. package/dist/graphql/gql.js.map +1 -0
  82. package/dist/graphql/types.d.ts +88 -0
  83. package/dist/graphql.d.ts +4 -0
  84. package/dist/graphql.js +3 -0
  85. package/dist/index.d.ts +19 -0
  86. package/dist/index.js +5 -0
  87. package/dist/internal/client.d.ts +24 -0
  88. package/dist/internal/client.js +23 -0
  89. package/dist/internal/content.d.ts +2 -0
  90. package/dist/internal/content.js +2 -0
  91. package/dist/internal/server.d.ts +7 -0
  92. package/dist/internal/server.js +6 -0
  93. package/dist/matter/access-code-sign-in/access-code-sign-in.d.ts +111 -0
  94. package/dist/matter/access-code-sign-in/access-code-sign-in.js +387 -0
  95. package/dist/matter/access-code-sign-in/access-code-sign-in.js.map +1 -0
  96. package/dist/matter/account-entry-point/account-entry-point.d.ts +64 -0
  97. package/dist/matter/account-entry-point/account-entry-point.js +151 -0
  98. package/dist/matter/account-entry-point/account-entry-point.js.map +1 -0
  99. package/dist/matter/breadcrumb/breadcrumb.d.ts +40 -0
  100. package/dist/matter/breadcrumb/breadcrumb.js +155 -0
  101. package/dist/matter/breadcrumb/breadcrumb.js.map +1 -0
  102. package/dist/matter/buy-button/buy-button.d.ts +95 -0
  103. package/dist/matter/buy-button/buy-button.js +259 -0
  104. package/dist/matter/buy-button/buy-button.js.map +1 -0
  105. package/dist/matter/cart/cart-namespace.d.ts +48 -0
  106. package/dist/matter/cart/cart-namespace.js +50 -0
  107. package/dist/matter/cart/cart-namespace.js.map +1 -0
  108. package/dist/matter/cart/cart.d.ts +312 -0
  109. package/dist/matter/cart/cart.js +1034 -0
  110. package/dist/matter/cart/cart.js.map +1 -0
  111. package/dist/matter/cart-item/cart-item.d.ts +103 -0
  112. package/dist/matter/cart-item/cart-item.js +672 -0
  113. package/dist/matter/cart-item/cart-item.js.map +1 -0
  114. package/dist/matter/cart-item-compositions/cart-item-compositions.d.ts +49 -0
  115. package/dist/matter/cart-item-compositions/cart-item-compositions.js +165 -0
  116. package/dist/matter/cart-item-compositions/cart-item-compositions.js.map +1 -0
  117. package/dist/matter/cart-item-customizations/cart-item-customizations.d.ts +28 -0
  118. package/dist/matter/cart-item-customizations/cart-item-customizations.js +73 -0
  119. package/dist/matter/cart-item-customizations/cart-item-customizations.js.map +1 -0
  120. package/dist/matter/cart-item-discounts/cart-item-discounts.d.ts +33 -0
  121. package/dist/matter/cart-item-discounts/cart-item-discounts.js +70 -0
  122. package/dist/matter/cart-item-discounts/cart-item-discounts.js.map +1 -0
  123. package/dist/matter/cart-item-seller-info/cart-item-seller-info.d.ts +24 -0
  124. package/dist/matter/cart-item-seller-info/cart-item-seller-info.js +54 -0
  125. package/dist/matter/cart-item-seller-info/cart-item-seller-info.js.map +1 -0
  126. package/dist/matter/cart-item-variations/cart-item-variations.d.ts +27 -0
  127. package/dist/matter/cart-item-variations/cart-item-variations.js +69 -0
  128. package/dist/matter/cart-item-variations/cart-item-variations.js.map +1 -0
  129. package/dist/matter/cart-totalizer/cart-totalizer.d.ts +78 -0
  130. package/dist/matter/cart-totalizer/cart-totalizer.js +220 -0
  131. package/dist/matter/cart-totalizer/cart-totalizer.js.map +1 -0
  132. package/dist/matter/client-preferences/client-preferences.d.ts +50 -0
  133. package/dist/matter/client-preferences/client-preferences.js +206 -0
  134. package/dist/matter/client-preferences/client-preferences.js.map +1 -0
  135. package/dist/matter/client-profile/client-profile.d.ts +59 -0
  136. package/dist/matter/client-profile/client-profile.js +185 -0
  137. package/dist/matter/client-profile/client-profile.js.map +1 -0
  138. package/dist/matter/client-profile-form/client-profile-form.d.ts +126 -0
  139. package/dist/matter/client-profile-form/client-profile-form.js +660 -0
  140. package/dist/matter/client-profile-form/client-profile-form.js.map +1 -0
  141. package/dist/matter/delivery-options/delivery-options-accordion.d.ts +30 -0
  142. package/dist/matter/delivery-options/delivery-options-accordion.js +189 -0
  143. package/dist/matter/delivery-options/delivery-options-accordion.js.map +1 -0
  144. package/dist/matter/delivery-options/delivery-options-controller.d.ts +49 -0
  145. package/dist/matter/delivery-options/delivery-options-controller.js +203 -0
  146. package/dist/matter/delivery-options/delivery-options-controller.js.map +1 -0
  147. package/dist/matter/delivery-options/delivery-options.d.ts +31 -0
  148. package/dist/matter/delivery-options/delivery-options.js +103 -0
  149. package/dist/matter/delivery-options/delivery-options.js.map +1 -0
  150. package/dist/matter/delivery-options/use-delivery-option-selection.d.ts +9 -0
  151. package/dist/matter/delivery-options/use-delivery-option-selection.js +76 -0
  152. package/dist/matter/delivery-options/use-delivery-option-selection.js.map +1 -0
  153. package/dist/matter/email-identification/email-identification.d.ts +37 -0
  154. package/dist/matter/email-identification/email-identification.js +111 -0
  155. package/dist/matter/email-identification/email-identification.js.map +1 -0
  156. package/dist/matter/free-shipping-progress/free-shipping-progress.d.ts +44 -0
  157. package/dist/matter/free-shipping-progress/free-shipping-progress.js +170 -0
  158. package/dist/matter/free-shipping-progress/free-shipping-progress.js.map +1 -0
  159. package/dist/matter/identity-edit/identity-edit.d.ts +52 -0
  160. package/dist/matter/identity-edit/identity-edit.js +148 -0
  161. package/dist/matter/identity-edit/identity-edit.js.map +1 -0
  162. package/dist/matter/identity-summary/identity-summary.d.ts +128 -0
  163. package/dist/matter/identity-summary/identity-summary.js +344 -0
  164. package/dist/matter/identity-summary/identity-summary.js.map +1 -0
  165. package/dist/matter/pricing/pricing.d.ts +162 -0
  166. package/dist/matter/pricing/pricing.js +793 -0
  167. package/dist/matter/pricing/pricing.js.map +1 -0
  168. package/dist/matter/product-gallery/product-gallery.d.ts +23 -0
  169. package/dist/matter/product-gallery/product-gallery.js +188 -0
  170. package/dist/matter/product-gallery/product-gallery.js.map +1 -0
  171. package/dist/matter/product-information/product-information.d.ts +61 -0
  172. package/dist/matter/product-information/product-information.js +355 -0
  173. package/dist/matter/product-information/product-information.js.map +1 -0
  174. package/dist/matter/product-list/product-list.d.ts +86 -0
  175. package/dist/matter/product-list/product-list.js +342 -0
  176. package/dist/matter/product-list/product-list.js.map +1 -0
  177. package/dist/matter/product-quantity/product-quantity.d.ts +50 -0
  178. package/dist/matter/product-quantity/product-quantity.js +111 -0
  179. package/dist/matter/product-quantity/product-quantity.js.map +1 -0
  180. package/dist/matter/product-shelf/product-shelf.d.ts +125 -0
  181. package/dist/matter/product-shelf/product-shelf.js +376 -0
  182. package/dist/matter/product-shelf/product-shelf.js.map +1 -0
  183. package/dist/matter/region/region.d.ts +211 -0
  184. package/dist/matter/region/region.js +579 -0
  185. package/dist/matter/region/region.js.map +1 -0
  186. package/dist/matter/session/session.d.ts +58 -0
  187. package/dist/matter/session/session.js +112 -0
  188. package/dist/matter/session/session.js.map +1 -0
  189. package/dist/matter/shipping-address/country-descriptors.js +101 -0
  190. package/dist/matter/shipping-address/country-descriptors.js.map +1 -0
  191. package/dist/matter/shipping-address/shipping-address.d.ts +284 -0
  192. package/dist/matter/shipping-address/shipping-address.js +1036 -0
  193. package/dist/matter/shipping-address/shipping-address.js.map +1 -0
  194. package/dist/matter/shipping-simulator/shipping-simulator.d.ts +143 -0
  195. package/dist/matter/shipping-simulator/shipping-simulator.js +644 -0
  196. package/dist/matter/shipping-simulator/shipping-simulator.js.map +1 -0
  197. package/dist/matter/sign-in-form/sign-in-form.d.ts +79 -0
  198. package/dist/matter/sign-in-form/sign-in-form.js +226 -0
  199. package/dist/matter/sign-in-form/sign-in-form.js.map +1 -0
  200. package/dist/matter/variant-selector/variant-selector.d.ts +183 -0
  201. package/dist/matter/variant-selector/variant-selector.js +840 -0
  202. package/dist/matter/variant-selector/variant-selector.js.map +1 -0
  203. package/dist/message-locales.json +7 -0
  204. package/dist/particles/access-code-field/access-code-field.d.ts +33 -0
  205. package/dist/particles/access-code-field/access-code-field.js +95 -0
  206. package/dist/particles/access-code-field/access-code-field.js.map +1 -0
  207. package/dist/particles/accordion/accordion.d.ts +45 -0
  208. package/dist/particles/accordion/accordion.js +156 -0
  209. package/dist/particles/accordion/accordion.js.map +1 -0
  210. package/dist/particles/address-summary/address-summary.d.ts +50 -0
  211. package/dist/particles/address-summary/address-summary.js +129 -0
  212. package/dist/particles/address-summary/address-summary.js.map +1 -0
  213. package/dist/particles/badge/badge.d.ts +10 -0
  214. package/dist/particles/badge/badge.js +27 -0
  215. package/dist/particles/badge/badge.js.map +1 -0
  216. package/dist/particles/button/button.d.ts +18 -0
  217. package/dist/particles/button/button.js +37 -0
  218. package/dist/particles/button/button.js.map +1 -0
  219. package/dist/particles/carousel/carousel.d.ts +60 -0
  220. package/dist/particles/carousel/carousel.js +335 -0
  221. package/dist/particles/carousel/carousel.js.map +1 -0
  222. package/dist/particles/checkbox/checkbox.d.ts +40 -0
  223. package/dist/particles/checkbox/checkbox.js +82 -0
  224. package/dist/particles/checkbox/checkbox.js.map +1 -0
  225. package/dist/particles/container/container.d.ts +20 -0
  226. package/dist/particles/container/container.js +36 -0
  227. package/dist/particles/container/container.js.map +1 -0
  228. package/dist/particles/dialog/dialog.d.ts +54 -0
  229. package/dist/particles/dialog/dialog.js +192 -0
  230. package/dist/particles/dialog/dialog.js.map +1 -0
  231. package/dist/particles/document-field/document-field.d.ts +61 -0
  232. package/dist/particles/document-field/document-field.js +146 -0
  233. package/dist/particles/document-field/document-field.js.map +1 -0
  234. package/dist/particles/drawer/drawer.d.ts +52 -0
  235. package/dist/particles/drawer/drawer.js +183 -0
  236. package/dist/particles/drawer/drawer.js.map +1 -0
  237. package/dist/particles/email-field/email-field.d.ts +37 -0
  238. package/dist/particles/email-field/email-field.js +106 -0
  239. package/dist/particles/email-field/email-field.js.map +1 -0
  240. package/dist/particles/field/field.d.ts +50 -0
  241. package/dist/particles/field/field.js +133 -0
  242. package/dist/particles/field/field.js.map +1 -0
  243. package/dist/particles/fieldset/fieldset.d.ts +16 -0
  244. package/dist/particles/fieldset/fieldset.js +52 -0
  245. package/dist/particles/fieldset/fieldset.js.map +1 -0
  246. package/dist/particles/footer-copyright/footer-copyright.d.ts +32 -0
  247. package/dist/particles/footer-copyright/footer-copyright.js +50 -0
  248. package/dist/particles/footer-copyright/footer-copyright.js.map +1 -0
  249. package/dist/particles/footer-link-group/footer-link-group.d.ts +66 -0
  250. package/dist/particles/footer-link-group/footer-link-group.js +154 -0
  251. package/dist/particles/footer-link-group/footer-link-group.js.map +1 -0
  252. package/dist/particles/footer-root/footer-root.d.ts +21 -0
  253. package/dist/particles/footer-root/footer-root.js +38 -0
  254. package/dist/particles/footer-root/footer-root.js.map +1 -0
  255. package/dist/particles/footer-social/footer-social.d.ts +79 -0
  256. package/dist/particles/footer-social/footer-social.js +176 -0
  257. package/dist/particles/footer-social/footer-social.js.map +1 -0
  258. package/dist/particles/gallery/gallery.d.ts +181 -0
  259. package/dist/particles/gallery/gallery.js +920 -0
  260. package/dist/particles/gallery/gallery.js.map +1 -0
  261. package/dist/particles/header-root/header-root.d.ts +21 -0
  262. package/dist/particles/header-root/header-root.js +38 -0
  263. package/dist/particles/header-root/header-root.js.map +1 -0
  264. package/dist/particles/icon/icon.d.ts +22 -0
  265. package/dist/particles/icon/icon.js +48 -0
  266. package/dist/particles/icon/icon.js.map +1 -0
  267. package/dist/particles/image/image.d.ts +13 -0
  268. package/dist/particles/image/image.js +59 -0
  269. package/dist/particles/image/image.js.map +1 -0
  270. package/dist/particles/incentives/incentives.d.ts +85 -0
  271. package/dist/particles/incentives/incentives.js +200 -0
  272. package/dist/particles/incentives/incentives.js.map +1 -0
  273. package/dist/particles/input/input.d.ts +9 -0
  274. package/dist/particles/input/input.js +28 -0
  275. package/dist/particles/input/input.js.map +1 -0
  276. package/dist/particles/logo/logo.d.ts +55 -0
  277. package/dist/particles/logo/logo.js +96 -0
  278. package/dist/particles/logo/logo.js.map +1 -0
  279. package/dist/particles/menu/menu.d.ts +103 -0
  280. package/dist/particles/menu/menu.js +409 -0
  281. package/dist/particles/menu/menu.js.map +1 -0
  282. package/dist/particles/menubar/menubar.d.ts +18 -0
  283. package/dist/particles/menubar/menubar.js +42 -0
  284. package/dist/particles/menubar/menubar.js.map +1 -0
  285. package/dist/particles/meter/meter.d.ts +36 -0
  286. package/dist/particles/meter/meter.js +132 -0
  287. package/dist/particles/meter/meter.js.map +1 -0
  288. package/dist/particles/navigation-link/navigation-link.d.ts +43 -0
  289. package/dist/particles/navigation-link/navigation-link.js +82 -0
  290. package/dist/particles/navigation-link/navigation-link.js.map +1 -0
  291. package/dist/particles/navigation-link-list/navigation-link-list.d.ts +59 -0
  292. package/dist/particles/navigation-link-list/navigation-link-list.js +103 -0
  293. package/dist/particles/navigation-link-list/navigation-link-list.js.map +1 -0
  294. package/dist/particles/navigation-menu/navigation-menu.d.ts +78 -0
  295. package/dist/particles/navigation-menu/navigation-menu.js +295 -0
  296. package/dist/particles/navigation-menu/navigation-menu.js.map +1 -0
  297. package/dist/particles/number-field/number-field.d.ts +46 -0
  298. package/dist/particles/number-field/number-field.js +169 -0
  299. package/dist/particles/number-field/number-field.js.map +1 -0
  300. package/dist/particles/password-field/password-field.d.ts +31 -0
  301. package/dist/particles/password-field/password-field.js +109 -0
  302. package/dist/particles/password-field/password-field.js.map +1 -0
  303. package/dist/particles/payment-methods/payment-methods.d.ts +72 -0
  304. package/dist/particles/payment-methods/payment-methods.js +151 -0
  305. package/dist/particles/payment-methods/payment-methods.js.map +1 -0
  306. package/dist/particles/phone-field/phone-field.d.ts +67 -0
  307. package/dist/particles/phone-field/phone-field.js +250 -0
  308. package/dist/particles/phone-field/phone-field.js.map +1 -0
  309. package/dist/particles/popover/popover.d.ts +68 -0
  310. package/dist/particles/popover/popover.js +284 -0
  311. package/dist/particles/popover/popover.js.map +1 -0
  312. package/dist/particles/postal-code-field/postal-code-field.d.ts +75 -0
  313. package/dist/particles/postal-code-field/postal-code-field.js +169 -0
  314. package/dist/particles/postal-code-field/postal-code-field.js.map +1 -0
  315. package/dist/particles/promotion/promotion.d.ts +46 -0
  316. package/dist/particles/promotion/promotion.js +78 -0
  317. package/dist/particles/promotion/promotion.js.map +1 -0
  318. package/dist/particles/quantity-selector/quantity-selector.d.ts +30 -0
  319. package/dist/particles/quantity-selector/quantity-selector.js +116 -0
  320. package/dist/particles/quantity-selector/quantity-selector.js.map +1 -0
  321. package/dist/particles/radio/radio.d.ts +36 -0
  322. package/dist/particles/radio/radio.js +76 -0
  323. package/dist/particles/radio/radio.js.map +1 -0
  324. package/dist/particles/scroll-area/scroll-area.d.ts +36 -0
  325. package/dist/particles/scroll-area/scroll-area.js +145 -0
  326. package/dist/particles/scroll-area/scroll-area.js.map +1 -0
  327. package/dist/particles/select/select.d.ts +125 -0
  328. package/dist/particles/select/select.js +478 -0
  329. package/dist/particles/select/select.js.map +1 -0
  330. package/dist/particles/separator/separator.d.ts +12 -0
  331. package/dist/particles/separator/separator.js +33 -0
  332. package/dist/particles/separator/separator.js.map +1 -0
  333. package/dist/particles/shared/input-mask.d.ts +5 -0
  334. package/dist/particles/shared/input-mask.js +58 -0
  335. package/dist/particles/shared/input-mask.js.map +1 -0
  336. package/dist/particles/spinner/spinner.d.ts +13 -0
  337. package/dist/particles/spinner/spinner.js +31 -0
  338. package/dist/particles/spinner/spinner.js.map +1 -0
  339. package/dist/particles/switch/switch.d.ts +27 -0
  340. package/dist/particles/switch/switch.js +59 -0
  341. package/dist/particles/switch/switch.js.map +1 -0
  342. package/dist/particles/tabs/tabs.d.ts +45 -0
  343. package/dist/particles/tabs/tabs.js +164 -0
  344. package/dist/particles/tabs/tabs.js.map +1 -0
  345. package/dist/particles/text/text.d.ts +24 -0
  346. package/dist/particles/text/text.js +40 -0
  347. package/dist/particles/text/text.js.map +1 -0
  348. package/dist/particles/toast/toast.d.ts +83 -0
  349. package/dist/particles/toast/toast.js +194 -0
  350. package/dist/particles/toast/toast.js.map +1 -0
  351. package/dist/particles/toggle/toggle.d.ts +26 -0
  352. package/dist/particles/toggle/toggle.js +61 -0
  353. package/dist/particles/toggle/toggle.js.map +1 -0
  354. package/dist/particles/tooltip/tooltip.d.ts +61 -0
  355. package/dist/particles/tooltip/tooltip.js +240 -0
  356. package/dist/particles/tooltip/tooltip.js.map +1 -0
  357. package/dist/schema.graphql +2953 -0
  358. package/dist/sdk/actions/cart-action-provider.d.ts +19 -0
  359. package/dist/sdk/actions/cart-action-provider.js +23 -0
  360. package/dist/sdk/actions/cart-action-provider.js.map +1 -0
  361. package/dist/sdk/actions/identity-action-provider.d.ts +15 -0
  362. package/dist/sdk/actions/identity-action-provider.js +19 -0
  363. package/dist/sdk/actions/identity-action-provider.js.map +1 -0
  364. package/dist/sdk/actions/index.d.ts +7 -0
  365. package/dist/sdk/actions/index.js +6 -0
  366. package/dist/sdk/actions/inject-actions.d.ts +14 -0
  367. package/dist/sdk/actions/inject-actions.js +36 -0
  368. package/dist/sdk/actions/inject-actions.js.map +1 -0
  369. package/dist/sdk/actions/region-action-provider.d.ts +15 -0
  370. package/dist/sdk/actions/region-action-provider.js +19 -0
  371. package/dist/sdk/actions/region-action-provider.js.map +1 -0
  372. package/dist/sdk/actions/session-action-provider.d.ts +15 -0
  373. package/dist/sdk/actions/session-action-provider.js +19 -0
  374. package/dist/sdk/actions/session-action-provider.js.map +1 -0
  375. package/dist/sdk/actions/shipping-action-provider.d.ts +15 -0
  376. package/dist/sdk/actions/shipping-action-provider.js +19 -0
  377. package/dist/sdk/actions/shipping-action-provider.js.map +1 -0
  378. package/dist/sdk/actions/types.d.ts +21 -0
  379. package/dist/sdk/cache/storefront-cache.js +35 -0
  380. package/dist/sdk/cache/storefront-cache.js.map +1 -0
  381. package/dist/sdk/cart/operations.d.ts +31 -0
  382. package/dist/sdk/cart/operations.js +215 -0
  383. package/dist/sdk/cart/operations.js.map +1 -0
  384. package/dist/sdk/cart/optimistic.d.ts +24 -0
  385. package/dist/sdk/cart/optimistic.js +164 -0
  386. package/dist/sdk/cart/optimistic.js.map +1 -0
  387. package/dist/sdk/cart/use-cart-actions.d.ts +56 -0
  388. package/dist/sdk/cart/use-cart-actions.js +348 -0
  389. package/dist/sdk/cart/use-cart-actions.js.map +1 -0
  390. package/dist/sdk/cart/use-cart-validate-on-open.js +50 -0
  391. package/dist/sdk/cart/use-cart-validate-on-open.js.map +1 -0
  392. package/dist/sdk/cart/write-gate.js +54 -0
  393. package/dist/sdk/cart/write-gate.js.map +1 -0
  394. package/dist/sdk/client/assert-api-url.js +20 -0
  395. package/dist/sdk/client/assert-api-url.js.map +1 -0
  396. package/dist/sdk/client/create-client.d.ts +23 -0
  397. package/dist/sdk/client/create-client.js +46 -0
  398. package/dist/sdk/client/create-client.js.map +1 -0
  399. package/dist/sdk/client/fetch-page-data.d.ts +39 -0
  400. package/dist/sdk/client/fetch-page-data.js +33 -0
  401. package/dist/sdk/client/fetch-page-data.js.map +1 -0
  402. package/dist/sdk/client/register-preload-query.d.ts +24 -0
  403. package/dist/sdk/client/register-preload-query.js +33 -0
  404. package/dist/sdk/client/register-preload-query.js.map +1 -0
  405. package/dist/sdk/content/create-content-runtime.d.ts +68 -0
  406. package/dist/sdk/content/create-content-runtime.js +503 -0
  407. package/dist/sdk/content/create-content-runtime.js.map +1 -0
  408. package/dist/sdk/context/headers.d.ts +15 -0
  409. package/dist/sdk/context/headers.js +21 -0
  410. package/dist/sdk/context/headers.js.map +1 -0
  411. package/dist/sdk/context/storefront-context.d.ts +11 -0
  412. package/dist/sdk/context/storefront-context.js +29 -0
  413. package/dist/sdk/context/storefront-context.js.map +1 -0
  414. package/dist/sdk/data/data-override-context.d.ts +12 -0
  415. package/dist/sdk/data/data-override-context.js +19 -0
  416. package/dist/sdk/data/data-override-context.js.map +1 -0
  417. package/dist/sdk/data/entity-subscriber.js +28 -0
  418. package/dist/sdk/data/entity-subscriber.js.map +1 -0
  419. package/dist/sdk/data/hot-data-provider.d.ts +19 -0
  420. package/dist/sdk/data/hot-data-provider.js +33 -0
  421. package/dist/sdk/data/hot-data-provider.js.map +1 -0
  422. package/dist/sdk/data/index.d.ts +8 -0
  423. package/dist/sdk/data/index.js +8 -0
  424. package/dist/sdk/data/list-item-ref-context.d.ts +20 -0
  425. package/dist/sdk/data/list-item-ref-context.js +11 -0
  426. package/dist/sdk/data/list-item-ref-context.js.map +1 -0
  427. package/dist/sdk/data/multiple-reactive-data-provider.d.ts +32 -0
  428. package/dist/sdk/data/multiple-reactive-data-provider.js +20 -0
  429. package/dist/sdk/data/multiple-reactive-data-provider.js.map +1 -0
  430. package/dist/sdk/data/page-reactive-data-root.d.ts +53 -0
  431. package/dist/sdk/data/page-reactive-data-root.js +153 -0
  432. package/dist/sdk/data/page-reactive-data-root.js.map +1 -0
  433. package/dist/sdk/data/reactive-data-provider.d.ts +25 -0
  434. package/dist/sdk/data/reactive-data-provider.js +24 -0
  435. package/dist/sdk/data/reactive-data-provider.js.map +1 -0
  436. package/dist/sdk/data/reactive-list-item-data-provider.d.ts +26 -0
  437. package/dist/sdk/data/reactive-list-item-data-provider.js +42 -0
  438. package/dist/sdk/data/reactive-list-item-data-provider.js.map +1 -0
  439. package/dist/sdk/data/use-reactive-entity.js +40 -0
  440. package/dist/sdk/data/use-reactive-entity.js.map +1 -0
  441. package/dist/sdk/format/client.d.ts +12 -0
  442. package/dist/sdk/format/client.js +20 -0
  443. package/dist/sdk/format/client.js.map +1 -0
  444. package/dist/sdk/format/formatters.d.ts +32 -0
  445. package/dist/sdk/format/formatters.js +45 -0
  446. package/dist/sdk/format/formatters.js.map +1 -0
  447. package/dist/sdk/generated/fragment-types.js +23 -0
  448. package/dist/sdk/generated/fragment-types.js.map +1 -0
  449. package/dist/sdk/generated/gql.js +51 -0
  450. package/dist/sdk/generated/gql.js.map +1 -0
  451. package/dist/sdk/generated/graphql.d.ts +622 -0
  452. package/dist/sdk/generated/graphql.js +11917 -0
  453. package/dist/sdk/generated/graphql.js.map +1 -0
  454. package/dist/sdk/graphql-tag.d.ts +10 -0
  455. package/dist/sdk/graphql-tag.js +21 -0
  456. package/dist/sdk/graphql-tag.js.map +1 -0
  457. package/dist/sdk/i18n/client.d.ts +4 -0
  458. package/dist/sdk/i18n/client.js +4 -0
  459. package/dist/sdk/i18n/locales.d.ts +8 -0
  460. package/dist/sdk/i18n/locales.js +57 -0
  461. package/dist/sdk/i18n/locales.js.map +1 -0
  462. package/dist/sdk/i18n/messages/en-US.js +24 -0
  463. package/dist/sdk/i18n/messages/en-US.js.map +1 -0
  464. package/dist/sdk/i18n/messages/en-US.json +19 -0
  465. package/dist/sdk/i18n/messages/en-US.json.d.ts +23 -0
  466. package/dist/sdk/i18n/messages/es-ES.js +24 -0
  467. package/dist/sdk/i18n/messages/es-ES.js.map +1 -0
  468. package/dist/sdk/i18n/messages/es-ES.json +19 -0
  469. package/dist/sdk/i18n/messages/pt-BR.js +24 -0
  470. package/dist/sdk/i18n/messages/pt-BR.js.map +1 -0
  471. package/dist/sdk/i18n/messages/pt-BR.json +19 -0
  472. package/dist/sdk/i18n/provider.d.ts +1 -0
  473. package/dist/sdk/i18n/provider.js +30 -0
  474. package/dist/sdk/i18n/provider.js.map +1 -0
  475. package/dist/sdk/i18n/server.d.ts +28 -0
  476. package/dist/sdk/i18n/server.js +59 -0
  477. package/dist/sdk/i18n/server.js.map +1 -0
  478. package/dist/sdk/identity/operations.d.ts +34 -0
  479. package/dist/sdk/identity/operations.js +78 -0
  480. package/dist/sdk/identity/operations.js.map +1 -0
  481. package/dist/sdk/identity/use-identity-actions.d.ts +62 -0
  482. package/dist/sdk/identity/use-identity-actions.js +180 -0
  483. package/dist/sdk/identity/use-identity-actions.js.map +1 -0
  484. package/dist/sdk/provider/index.d.ts +2 -0
  485. package/dist/sdk/provider/index.js +2 -0
  486. package/dist/sdk/provider/storefront-provider.d.ts +32 -0
  487. package/dist/sdk/provider/storefront-provider.js +111 -0
  488. package/dist/sdk/provider/storefront-provider.js.map +1 -0
  489. package/dist/sdk/region/operations.d.ts +6 -0
  490. package/dist/sdk/region/region-operations.d.ts +30 -0
  491. package/dist/sdk/region/region-operations.js +23 -0
  492. package/dist/sdk/region/region-operations.js.map +1 -0
  493. package/dist/sdk/region/use-region-actions.d.ts +23 -0
  494. package/dist/sdk/region/use-region-actions.js +66 -0
  495. package/dist/sdk/region/use-region-actions.js.map +1 -0
  496. package/dist/sdk/seller.js +11 -0
  497. package/dist/sdk/seller.js.map +1 -0
  498. package/dist/sdk/session/auth-operations.d.ts +47 -0
  499. package/dist/sdk/session/auth-operations.js +79 -0
  500. package/dist/sdk/session/auth-operations.js.map +1 -0
  501. package/dist/sdk/session/operations.d.ts +6 -0
  502. package/dist/sdk/session/use-session-actions.d.ts +27 -0
  503. package/dist/sdk/session/use-session-actions.js +126 -0
  504. package/dist/sdk/session/use-session-actions.js.map +1 -0
  505. package/dist/sdk/shipping/cart-operations.d.ts +3 -0
  506. package/dist/sdk/shipping/cart-operations.js +33 -0
  507. package/dist/sdk/shipping/cart-operations.js.map +1 -0
  508. package/dist/sdk/shipping/operations.d.ts +3 -0
  509. package/dist/sdk/shipping/operations.js +33 -0
  510. package/dist/sdk/shipping/operations.js.map +1 -0
  511. package/dist/sdk/shipping/option-select-operations.d.ts +24 -0
  512. package/dist/sdk/shipping/option-select-operations.js +45 -0
  513. package/dist/sdk/shipping/option-select-operations.js.map +1 -0
  514. package/dist/sdk/shipping/request-timeout.js +41 -0
  515. package/dist/sdk/shipping/request-timeout.js.map +1 -0
  516. package/dist/sdk/shipping/shipping-operations.d.ts +38 -0
  517. package/dist/sdk/shipping/shipping-operations.js +77 -0
  518. package/dist/sdk/shipping/shipping-operations.js.map +1 -0
  519. package/dist/sdk/shipping/use-cart-shipping-simulation.d.ts +7 -0
  520. package/dist/sdk/shipping/use-cart-shipping-simulation.js +72 -0
  521. package/dist/sdk/shipping/use-cart-shipping-simulation.js.map +1 -0
  522. package/dist/sdk/shipping/use-shipping-actions.d.ts +27 -0
  523. package/dist/sdk/shipping/use-shipping-actions.js +113 -0
  524. package/dist/sdk/shipping/use-shipping-actions.js.map +1 -0
  525. package/dist/sdk/shipping/use-shipping-simulation.d.ts +7 -0
  526. package/dist/sdk/shipping/use-shipping-simulation.js +72 -0
  527. package/dist/sdk/shipping/use-shipping-simulation.js.map +1 -0
  528. package/dist/sdk/state/cart.d.ts +42 -0
  529. package/dist/sdk/state/cart.js +64 -0
  530. package/dist/sdk/state/cart.js.map +1 -0
  531. package/dist/sdk/state/index.js +3 -0
  532. package/dist/sdk/state/variant-selector.d.ts +17 -0
  533. package/dist/sdk/state/variant-selector.js +14 -0
  534. package/dist/sdk/state/variant-selector.js.map +1 -0
  535. package/dist/utils/safe-href.js +63 -0
  536. package/dist/utils/safe-href.js.map +1 -0
  537. package/package.json +84 -0
  538. package/src/styles/tailwind.css +32 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cart-item.js","names":["BaseNumberField"],"sources":["../../../src/matter/cart-item/cart-item.tsx"],"sourcesContent":["'use client';\n\nimport { NumberField as BaseNumberField } from '@base-ui/react/number-field';\nimport { defineComponent } from '@vtex/fs-core';\nimport { type ComponentPropsWithRef, createContext, type ReactNode, useContext, useState } from 'react';\nimport { NavigationLink, type NavigationLinkProps } from '../../particles/navigation-link/navigation-link.js';\nimport type { ComponentActions } from '../../sdk/actions/types.js';\nimport type { CartItemEntity } from '../../sdk/cart/operations.js';\nimport { useStorefrontContext } from '../../sdk/context/storefront-context.js';\nimport { useDataOverride } from '../../sdk/data/data-override-context.js';\nimport { graphql } from '../../sdk/generated/gql.js';\nimport { resolveSafeHref } from '../../utils/safe-href.js';\nimport { formatPrice } from '../cart/cart.js';\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\nexport type CartItemRootProps = ComponentPropsWithRef<'div'> & {\n /**\n * Per-line slice delivered by the `reactive-list-item` runtime (`ReactiveListItemDataProvider`) —\n * the resolved `CartItem` entity read from the normalized cache via `useFragment(CartItem:<id>)`.\n * Injected through the iteration context in a compiled page; the `$data` prop is retained for test\n * injection.\n */\n $data?: CartItemEntity | null;\n};\n\nexport type CartItemImageProps = ComponentPropsWithRef<'img'> & {\n objectFit?: 'contain' | 'cover' | 'fill' | 'none';\n};\n\n// The destination is the line's own product page, so `href` is not authorable. `$content` goes with it\n// because the leaf declares no content model: a product URL is commerce data, not copy. `target` goes\n// too, so the same-tab rule is enforced by the type rather than merely absent from the schema — an\n// image-only link cannot carry the \"(opens in new tab)\" cue a `_blank` destination needs.\nexport type CartItemProductLinkProps = Omit<NavigationLinkProps, 'href' | '$content' | 'target'>;\n\nexport type CartItemNameProps = ComponentPropsWithRef<'span'>;\n\nexport type CartItemVariantProps = ComponentPropsWithRef<'span'>;\n\nexport type CartItemSkuProps = ComponentPropsWithRef<'span'>;\n\nexport type CartItemPriceProps = ComponentPropsWithRef<'span'>;\n\nexport type CartItemListPriceProps = ComponentPropsWithRef<'span'>;\n\nexport type CartItemDiscountPercentageProps = ComponentPropsWithRef<'span'> & {\n template?: string;\n};\n\nexport type CartItemLineTotalProps = ComponentPropsWithRef<'span'>;\n\nexport type CartItemOwnTotalProps = ComponentPropsWithRef<'span'>;\n\nexport type CartItemAggregateTotalProps = ComponentPropsWithRef<'span'>;\n\n/**\n * Per-line slice delivered by the `reactive-list-item` runtime: the value the wrapper publishes\n * through `DataOverrideContext`, read via `useDataOverride`. Only the field the stepper converts with\n * is typed; the resolved cache slice carries the full fragment selection.\n */\nexport type CartItemQuantitySlice = {\n variant: { unitMultiplier: number } | null;\n};\n\nexport type CartItemQuantityProps = Omit<ComponentPropsWithRef<'div'>, 'defaultValue' | 'value'> & {\n /** Minimum, in purchasable units — not in the unit shown to the shopper. */\n min?: number;\n /** Maximum, in purchasable units. Unbounded when unset. */\n max?: number;\n /** Step, in purchasable units: one step moves the display by one unit multiplier. */\n step?: number;\n removeOnDecrement?: boolean;\n /** Snap-notice template; `{value}` is replaced with the corrected displayed amount. */\n validationMessage?: string;\n children?: ReactNode;\n /** Per-line slice from the reactive-list-item runtime; injected/overridden by the wrapper. */\n $data?: CartItemQuantitySlice | null;\n /** Injected by the compiler from `actions: { cart: [...] }`; the cart write surface. */\n $actions?: ComponentActions;\n};\n\nexport type CartItemQuantityValueProps = ComponentPropsWithRef<'span'>;\n\nexport type CartItemRemoveProps = ComponentPropsWithRef<'button'> & {\n /** Injected by the compiler from `actions: { cart: ['removeItem'] }`; the cart write surface. */\n $actions?: ComponentActions;\n};\n\nexport type CartItemAvailableProps = ComponentPropsWithRef<'div'>;\n\nexport type CartItemUnavailableProps = ComponentPropsWithRef<'div'>;\n\nexport type CartItemGiftProps = ComponentPropsWithRef<'span'>;\n\n// ---------------------------------------------------------------------------\n// GraphQL Fragment — typed via @graphql-codegen client-preset (T7)\n//\n// CartItemRoot owns the core-scalar slice of each cart line (ADR-0012 Option B). Fields are inlined\n// (no `...` spread) so the compiler's list-field derivation finds the iterated `items` list by its\n// direct child field and re-roots this fragment to `CartItemRootData_CartItem on CartItem` for the\n// per-line `useFragment` subscription. `variant.availability` stays here — it is a cross-cutting core\n// scalar (CartCheckoutGuard, CartItemAvailable/Unavailable read it), not an optional display leaf.\n// `gift` stays here for the same reason: CartItemGift, CartItemRemove's suppression, and the row's\n// own state hook all read it, so one selection serves three consumers.\n//\n// Every field selected here MUST also be selected by the mutation fragment (`CartItemFragment` in\n// sdk/cart/operations.ts). ReactiveListItemDataProvider resolves `complete ? data : fallbackData`,\n// so a field present here but missing there makes every line incomplete after a cart write and\n// degrades the whole list to the cart-level slice, which carries no product or prices.\n// ---------------------------------------------------------------------------\n\nconst fragment = graphql(`\n fragment CartItemRootData on Query {\n cart {\n items {\n __typename\n id\n quantity\n price {\n amount\n currencyCode\n }\n listPrice {\n amount\n currencyCode\n }\n sellingPrice {\n amount\n currencyCode\n }\n gift\n ownTotal {\n ...MoneyFragment\n }\n total {\n ...MoneyFragment\n }\n variant {\n __typename\n variantId\n sku\n name\n image {\n url\n altText\n }\n availability\n }\n product {\n __typename\n productId\n title\n detailUrl\n categories {\n categoryId\n name\n }\n brand {\n brandId\n name\n }\n }\n }\n }\n }\n`);\n\n// ADR-0011: the unit multiplier is optional per-line data owned by the stepper that converts with\n// it, not by the core root — a cart line showing a read-only quantity never fetches it. Fields are\n// inlined (no `...` spread) so the derived per-item fragment is self-contained for `useFragment`, and\n// it drills the identical cart { items { ... } } path as the other per-item matters so it merges\n// un-aliased (ADR-0012).\nconst cartItemQuantityFragment = graphql(`\n fragment CartItemQuantityData on Query {\n cart {\n items {\n __typename\n id\n variant {\n __typename\n unitMultiplier\n }\n }\n }\n }\n`);\n\n// ---------------------------------------------------------------------------\n// Cart item context — provided by CartItemRoot with its resolved per-line slice\n// ---------------------------------------------------------------------------\n\nconst CartItemContext = createContext<CartItemEntity | null>(null);\n\nfunction useCartItem(): CartItemEntity {\n const item = useContext(CartItemContext);\n if (!item) {\n throw new Error('Cart item components must be used inside a <CartItemRoot> subtree.');\n }\n return item;\n}\n\n// ---------------------------------------------------------------------------\n// Definitions\n// ---------------------------------------------------------------------------\n\nexport const CartItemRootDefinition = defineComponent<CartItemRootProps>({\n name: 'CartItemRoot',\n importPath: '@vtex/faststore/components',\n component: CartItemRoot,\n fragment,\n fetchStrategy: 'reactive-list-item',\n // Placement: requires CartList's `cart-item` iteration context and provides `cart-item-data` to the\n // core particles below. The two tokens differ, so it does not self-satisfy — the context-constraints\n // walk checks `requiresContext` before pushing this node's own `providesContext`.\n requiresContext: 'cart-item',\n providesContext: 'cart-item-data',\n editor: { label: 'Cart Item Root', category: 'commerce' },\n schema: {},\n guideline:\n 'Per-line data provider for the cart line-item template: place it directly inside CartList, wrapping the CartItem* particles (CartItemImage, CartItemName, CartItemPrice, the CartItemQuantity stepper, CartItemRemove, …). It owns the core per-item fields and delivers each line its own slice, so the core particles must sit inside it. Must be inside CartList. See cart-item.md.',\n});\n\nexport const CartItemImageDefinition = defineComponent<CartItemImageProps>({\n name: 'CartItemImage',\n importPath: '@vtex/faststore/components',\n component: CartItemImage,\n requiresContext: 'cart-item-data',\n editor: { label: 'Cart Item Image', category: 'commerce' },\n schema: {\n objectFit: { type: ['contain', 'cover', 'fill', 'none'] as const, default: 'contain', label: 'Object Fit' },\n },\n guideline: 'Renders the product image from the cart item. Must be inside CartItemRoot.',\n});\n\nexport const CartItemProductLinkDefinition = defineComponent<CartItemProductLinkProps>({\n name: 'CartItemProductLink',\n importPath: '@vtex/faststore/components',\n component: CartItemProductLink,\n requiresContext: 'cart-item-data',\n editor: { label: 'Cart Item Product Link', category: 'commerce' },\n schema: {},\n guideline:\n 'Links the cart line image to its product page, using the product URL the line already carries: place it inside CartItemRoot wrapping CartItemImage. Whether a line links is decided by placing this element, so there is no prop to toggle it — a checkout line simply omits it. Renders its children unwrapped when the line has no image or no usable product URL, so it never leaves an empty or unsafe link. Navigation is same-tab, and the leaf adds no fields to the page query. Must be inside CartItemRoot. See cart-item.md.',\n});\n\nexport const CartItemNameDefinition = defineComponent<CartItemNameProps>({\n name: 'CartItemName',\n importPath: '@vtex/faststore/components',\n component: CartItemName,\n requiresContext: 'cart-item-data',\n editor: { label: 'Cart Item Name', category: 'commerce' },\n schema: {},\n guideline: 'Renders the product name from the cart item. Must be inside CartItemRoot.',\n});\n\nexport const CartItemVariantDefinition = defineComponent<CartItemVariantProps>({\n name: 'CartItemVariant',\n importPath: '@vtex/faststore/components',\n component: CartItemVariant,\n requiresContext: 'cart-item-data',\n editor: { label: 'Cart Item Variant', category: 'commerce' },\n schema: {},\n guideline:\n 'Renders the selected variant name of the cart item (e.g. \"Midnight Black\"); renders null when the variant has no name. Use as a subtitle under CartItemName, typically alongside CartItemSku. Must be inside CartItemRoot.',\n});\n\nexport const CartItemSkuDefinition = defineComponent<CartItemSkuProps>({\n name: 'CartItemSku',\n importPath: '@vtex/faststore/components',\n component: CartItemSku,\n requiresContext: 'cart-item-data',\n editor: { label: 'Cart Item SKU', category: 'commerce' },\n schema: {},\n guideline:\n 'Renders the SKU code of the cart item variant (e.g. \"WNC-400X\"); renders null when the variant has no SKU. Use as a subtitle under CartItemName, typically alongside CartItemVariant. Must be inside CartItemRoot.',\n});\n\nexport const CartItemPriceDefinition = defineComponent<CartItemPriceProps>({\n name: 'CartItemPrice',\n importPath: '@vtex/faststore/components',\n component: CartItemPrice,\n requiresContext: 'cart-item-data',\n editor: { label: 'Cart Item Price', category: 'commerce' },\n schema: {},\n guideline:\n 'Renders the selling price of the cart item, formatted from the active storefront context. Must be inside CartItemRoot.',\n});\n\nexport const CartItemListPriceDefinition = defineComponent<CartItemListPriceProps>({\n name: 'CartItemListPrice',\n importPath: '@vtex/faststore/components',\n component: CartItemListPrice,\n requiresContext: 'cart-item-data',\n editor: { label: 'Cart Item List Price', category: 'commerce' },\n schema: {},\n guideline:\n 'Renders the original list price of the cart item (strikethrough); renders null when no discount is active. Use alongside CartItemPrice to show promotional pricing. Must be inside CartItemRoot.',\n});\n\nexport const CartItemDiscountPercentageDefinition = defineComponent<CartItemDiscountPercentageProps>({\n name: 'CartItemDiscountPercentage',\n importPath: '@vtex/faststore/components',\n component: CartItemDiscountPercentage,\n requiresContext: 'cart-item-data',\n editor: { label: 'Cart Item Discount %', category: 'commerce' },\n schema: {\n template: { type: 'string', default: '-{percentage}%', label: 'Template' },\n },\n guideline:\n 'Per-line discount badge showing the integer listPrice-vs-sellingPrice percentage (e.g. \"-20%\"); use the template prop to customize the format ({percentage} is the integer percent). Renders null when the line has no discount (sellingPrice >= listPrice), so it only appears on promotional lines. Place alongside CartItemPrice/CartItemListPrice. Must be inside CartItemRoot.',\n});\n\nexport const CartItemLineTotalDefinition = defineComponent<CartItemLineTotalProps>({\n name: 'CartItemLineTotal',\n importPath: '@vtex/faststore/components',\n component: CartItemLineTotal,\n requiresContext: 'cart-item-data',\n editor: { label: 'Cart Item Line Total', category: 'commerce' },\n schema: {},\n guideline:\n 'Renders the per-line total (selling price × quantity) formatted from the active storefront context. Must be inside CartItemRoot.',\n});\n\nexport const CartItemOwnTotalDefinition = defineComponent<CartItemOwnTotalProps>({\n name: 'CartItemOwnTotal',\n importPath: '@vtex/faststore/components',\n component: CartItemOwnTotal,\n requiresContext: 'cart-item-data',\n editor: { label: 'Cart Item Own Total', category: 'commerce' },\n schema: {},\n guideline:\n \"Renders the line's own total (excludes bundle/composition children), formatted from the active storefront context. Equals CartItemAggregateTotal on lines with no compositions. Must be inside CartItemRoot. See cart-item.md.\",\n});\n\nexport const CartItemAggregateTotalDefinition = defineComponent<CartItemAggregateTotalProps>({\n name: 'CartItemAggregateTotal',\n importPath: '@vtex/faststore/components',\n component: CartItemAggregateTotal,\n requiresContext: 'cart-item-data',\n editor: { label: 'Cart Item Aggregate Total', category: 'commerce' },\n schema: {},\n guideline:\n \"Renders the line's aggregate total including all nested composition children, formatted from the active storefront context — the price the shopper actually pays for a bundled line. Equals CartItemOwnTotal on lines with no compositions. Must be inside CartItemRoot. See cart-item.md.\",\n});\n\nexport const CartItemQuantityDefinition = defineComponent<CartItemQuantityProps>({\n name: 'CartItemQuantity',\n importPath: '@vtex/faststore/components',\n component: CartItemQuantity,\n fragment: cartItemQuantityFragment,\n fetchStrategy: 'reactive-list-item',\n requiresContext: 'cart-item-data',\n editor: { label: 'Cart Item Quantity', category: 'commerce' },\n schema: {\n min: { type: 'number', default: 1, label: 'Min' },\n max: { type: 'number', label: 'Max' },\n step: { type: 'number', default: 1, label: 'Step' },\n removeOnDecrement: { type: 'boolean', default: false, label: 'Remove On Decrement' },\n validationMessage: { type: 'string', default: 'Quantity adjusted to {value}.', label: 'Validation Message' },\n },\n actions: { cart: ['increaseQuantity', 'decreaseQuantity', 'removeItem'] },\n guideline:\n \"Quantity stepper for a cart item, shown in the unit the merchant sells in: the displayed amount is the line's quantity times its unit multiplier, so a SKU sold in 500 g portions reads 1.5 rather than 3. min, max, and step are configured in purchasable units and converted for display, so one template serves SKUs with different multipliers. A typed amount that is out of bounds or off the multiplier grid snaps to the nearest valid value on commit and renders validationMessage. Set removeOnDecrement=true to remove the item when quantity reaches the minimum. Renders nothing on a gift line — a gift's quantity is promotion-controlled and cannot be stepped or removed, so use CartItemQuantityValue to show a gift's fixed quantity. Must be inside CartItemRoot. See cart-item.md.\",\n});\n\nexport const CartItemQuantityValueDefinition = defineComponent<CartItemQuantityValueProps>({\n name: 'CartItemQuantityValue',\n importPath: '@vtex/faststore/components',\n component: CartItemQuantityValue,\n requiresContext: 'cart-item-data',\n editor: { label: 'Cart Item Quantity Value', category: 'commerce' },\n schema: {},\n guideline:\n 'Renders the read-only quantity count of the cart item as text (e.g. a \"Qty\" badge). Distinct from the editable CartItemQuantity stepper. Must be inside CartItemRoot.',\n});\n\nexport const CartItemRemoveDefinition = defineComponent<CartItemRemoveProps>({\n name: 'CartItemRemove',\n importPath: '@vtex/faststore/components',\n component: CartItemRemove,\n requiresContext: 'cart-item-data',\n editor: { label: 'Cart Item Remove', category: 'commerce' },\n schema: {},\n actions: { cart: ['removeItem'] },\n guideline:\n 'Button that removes the current line item from the cart. Must be inside CartItemRoot. Also composes inside CartItemUnavailable as a remove-on-alert control. See cart-item.md.',\n});\n\nexport const CartItemAvailableDefinition = defineComponent<CartItemAvailableProps>({\n name: 'CartItemAvailable',\n importPath: '@vtex/faststore/components',\n component: CartItemAvailable,\n requiresContext: 'cart-item-data',\n editor: { label: 'Cart Item Available', category: 'commerce' },\n schema: {},\n guideline:\n 'Renders its children only when the current cart item is in stock (availability AVAILABLE). Wrap price, quantity stepper, and line total so they hide for unavailable items. Must be inside CartItemRoot.',\n});\n\nexport const CartItemUnavailableDefinition = defineComponent<CartItemUnavailableProps>({\n name: 'CartItemUnavailable',\n importPath: '@vtex/faststore/components',\n component: CartItemUnavailable,\n requiresContext: 'cart-item-data',\n editor: { label: 'Cart Item Unavailable', category: 'commerce' },\n schema: {},\n guideline:\n 'Status badge shown only when the current cart item is NOT available. Renders a built-in English label per state (OUT_OF_STOCK → \"Out of stock\", UNAVAILABLE → \"Cannot be delivered\", otherwise \"Unavailable\"); pass children to override the text — children REPLACE the label, so a remove-on-alert composition nests an explicit label plus a CartItemRemove. Emits data-fs-cart-item-unavailable-state for per-state styling. Must be inside CartItemRoot. See cart-item.md.',\n});\n\nexport const CartItemGiftDefinition = defineComponent<CartItemGiftProps>({\n name: 'CartItemGift',\n importPath: '@vtex/faststore/components',\n component: CartItemGift,\n requiresContext: 'cart-item-data',\n editor: { label: 'Cart Item Gift', category: 'commerce' },\n schema: {},\n guideline:\n 'Free marker for a promotional gift line: renders only when the current cart item is a gift, showing a built-in \"Free\" label; pass children to override the text — children REPLACE the label. Place it beside CartItemPrice/CartItemListPrice, whose struck-through list price it complements. It is an inline marker, not a wrapper for a gift-only subtree. On a gift line CartItemRemove suppresses itself and CartItemRoot marks the row with data-fs-cart-item-gift-line, so neither needs composing differently. Must be inside CartItemRoot. See cart-item.md.',\n});\n\n// ---------------------------------------------------------------------------\n// Implementations\n// ---------------------------------------------------------------------------\n\nexport function CartItemRoot({ $data: $dataProp, className, children, ...props }: CartItemRootProps) {\n // Read the resolved per-line slice through the DataOverrideContext seam the reactive-list-item\n // wrapper publishes (or via $data in tests), then re-provide it to the core particles — the same\n // \"read my slice, then provide React context to descendants\" shape CartRoot uses for the cart.\n const slice = useDataOverride<CartItemEntity | null | undefined>($dataProp) ?? null;\n\n return (\n <CartItemContext value={slice}>\n <div\n {...props}\n className={className}\n data-fs-cart-item-root=\"\"\n {...(slice?.gift ? { 'data-fs-cart-item-gift-line': '' } : {})}\n >\n {children}\n </div>\n </CartItemContext>\n );\n}\n\nexport function CartItemImage({ className, objectFit = 'contain', ...props }: CartItemImageProps) {\n const item = useCartItem();\n const image = item.variant.image;\n\n if (!image) return null;\n\n return (\n // biome-ignore lint/performance/noImgElement: Cart item image URL is dynamic; matter stays Next-agnostic.\n <img\n {...props}\n src={image.url}\n alt={image.altText ?? item.variant.name}\n className={className}\n style={{ objectFit, ...props.style }}\n data-fs-cart-item-image=\"\"\n data-fs-image=\"\"\n />\n );\n}\n\nexport function CartItemProductLink({ className, children, ...props }: Readonly<CartItemProductLinkProps>) {\n const item = useCartItem();\n // The particle gates only CMS-authored destinations, so a platform URL arriving on the `href` prop\n // is this leaf's own to validate. `detailUrl` is `String!`, which excludes null but not an empty or\n // hostile value. Either way the leaf degrades to a passthrough rather than self-hiding the way the\n // data-bearing leaves do: returning null would take the image with it.\n const destination = resolveSafeHref(item.product.detailUrl);\n\n if (!destination.safe) {\n // A blank URL is ordinary, so it stays quiet. Anything else was actively refused, and the reason\n // is logged the way the particle logs a refused authored destination — never the value itself.\n if (destination.reason !== 'blank') {\n console.warn('[CartItemProductLink] product URL rejected', { reason: destination.reason });\n }\n return children;\n }\n\n // The anchor is named by the wrapped image's alt text (`altText ?? variant.name`). With no image\n // there is nothing to render or name; with a blank alt the anchor would be a focus stop with no\n // accessible name. Either way, degrade to the unwrapped children rather than emit an unnamed link.\n const image = item.variant.image;\n if (!image || !(image.altText ?? item.variant.name ?? '').trim()) return children;\n\n return (\n <NavigationLink {...props} href={destination.href} className={className} data-fs-cart-item-product-link=\"\">\n {children}\n </NavigationLink>\n );\n}\n\nexport function CartItemName({ className, children, ...props }: CartItemNameProps) {\n const item = useCartItem();\n\n return (\n <span {...props} className={className} data-fs-cart-item-name=\"\" data-fs-text=\"\">\n {children ?? item.product.title}\n </span>\n );\n}\n\nexport function CartItemVariant({ className, children, ...props }: CartItemVariantProps) {\n const item = useCartItem();\n const { name } = item.variant;\n if (!name) return null;\n\n return (\n <span {...props} className={className} data-fs-cart-item-variant=\"\">\n {children ?? name}\n </span>\n );\n}\n\nexport function CartItemSku({ className, children, ...props }: CartItemSkuProps) {\n const item = useCartItem();\n const { sku } = item.variant;\n if (!sku) return null;\n\n return (\n <span {...props} className={className} data-fs-cart-item-sku=\"\">\n {children ?? sku}\n </span>\n );\n}\n\nexport function CartItemPrice({ className, children, ...props }: CartItemPriceProps) {\n const item = useCartItem();\n const { locale, currency } = useStorefrontContext();\n\n return (\n <span {...props} className={className} data-fs-cart-item-price=\"\" data-fs-text=\"\">\n {children ?? formatPrice(item.sellingPrice.amount, locale, currency)}\n </span>\n );\n}\n\nexport function CartItemListPrice({ className, children, ...props }: CartItemListPriceProps) {\n const item = useCartItem();\n const { locale, currency } = useStorefrontContext();\n\n if (item.listPrice.amount <= item.sellingPrice.amount) {\n return null;\n }\n\n return (\n <span {...props} className={className} data-fs-cart-item-list-price=\"\" data-fs-text=\"\">\n {children ?? formatPrice(item.listPrice.amount, locale, currency)}\n </span>\n );\n}\n\nexport function CartItemDiscountPercentage({\n template = '-{percentage}%',\n className,\n children,\n ...props\n}: CartItemDiscountPercentageProps) {\n const item = useCartItem();\n\n const listPrice = Number(item.listPrice.amount);\n const sellingPrice = Number(item.sellingPrice.amount);\n\n if (listPrice <= sellingPrice) {\n return null;\n }\n\n const percent = Math.round(((listPrice - sellingPrice) / listPrice) * 100);\n const text = template.replaceAll('{percentage}', String(percent));\n\n return (\n <span {...props} className={className} data-fs-cart-item-discount-percentage=\"\" data-fs-text=\"\">\n {children ?? text}\n </span>\n );\n}\n\nexport function CartItemLineTotal({ className, children, ...props }: CartItemLineTotalProps) {\n const item = useCartItem();\n const { locale, currency } = useStorefrontContext();\n\n return (\n <span {...props} className={className} data-fs-cart-item-line-total=\"\">\n {children ?? formatPrice(item.sellingPrice.amount * item.quantity, locale, currency)}\n </span>\n );\n}\n\nexport function CartItemOwnTotal({ className, children, ...props }: CartItemOwnTotalProps) {\n const item = useCartItem();\n const { locale, currency } = useStorefrontContext();\n\n return (\n <span {...props} className={className} data-fs-cart-item-own-total=\"\" data-fs-text=\"\">\n {children ?? formatPrice(Number(item.ownTotal.amount), locale, currency)}\n </span>\n );\n}\n\nexport function CartItemAggregateTotal({ className, children, ...props }: CartItemAggregateTotalProps) {\n const item = useCartItem();\n const { locale, currency } = useStorefrontContext();\n\n return (\n <span {...props} className={className} data-fs-cart-item-aggregate-total=\"\" data-fs-text=\"\">\n {children ?? formatPrice(Number(item.total.amount), locale, currency)}\n </span>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Quantity stepper — the unit multiplier converts between the purchasable count the order form and\n// the cart mutations use, and the measure the merchant sells in. `1` is the identity, so a SKU sold\n// by the unit behaves exactly as it did before the multiplier was read.\n// ---------------------------------------------------------------------------\n\n/** Why a committed amount had to be corrected; drives both the notice and its styling hook. */\ntype QuantityAdjustment = { reason: 'min' | 'max' | 'multiple'; value: number };\n\nconst MAX_DISPLAY_DECIMALS = 6;\n\n/**\n * A multiplier the platform cannot sell in — zero, negative, or non-finite — is treated as `1`, which\n * is also the fallback when the optional slice is absent (the stepper composed with no own provider).\n */\nfunction effectiveMultiplier(slice: CartItemQuantitySlice | null | undefined): number {\n const multiplier = slice?.variant?.unitMultiplier ?? 1;\n return Number.isFinite(multiplier) && multiplier > 0 ? multiplier : 1;\n}\n\n/**\n * Precision of the multiplier, so a displayed amount never carries binary-representation noise.\n * Derived through `toFixed` rather than `String`: `String` switches to exponential notation below\n * 1e-6, where it carries no decimal point and would report zero places, yielding a step of 0 that no\n * control can move. The normal-path precisions (0.5, 0.1, 0.333) are covered by tests; the\n * exponential branch is not, since it needs a multiplier no SKU can have.\n */\nfunction decimalPlacesOf(multiplier: number): number {\n const [, decimals = ''] = multiplier.toFixed(MAX_DISPLAY_DECIMALS).split('.');\n // Trailing zeros carry no precision; strip them with a linear scan rather than a `/0+$/` regex,\n // which SonarQube flags as super-linear (harmless here — the input is a bounded toFixed string).\n let end = decimals.length;\n while (end > 0 && decimals[end - 1] === '0') end -= 1;\n return end;\n}\n\nfunction roundTo(value: number, decimals: number): number {\n return Number(value.toFixed(decimals));\n}\n\nfunction resolveAdjustment(\n entered: number,\n snappedDisplay: number,\n multiplier: number,\n minDisplay: number,\n maxDisplay: number | undefined,\n): QuantityAdjustment | null {\n if (maxDisplay != null && entered > maxDisplay) return { reason: 'max', value: snappedDisplay };\n if (entered < minDisplay) return { reason: 'min', value: snappedDisplay };\n // Tolerance is relative to the multiplier, so recovering the count through a division never reads\n // as an off-grid entry.\n if (Math.abs(entered - snappedDisplay) > multiplier * 1e-6) return { reason: 'multiple', value: snappedDisplay };\n return null;\n}\n\nexport function CartItemQuantity({\n className,\n children,\n min = 1,\n max,\n step,\n removeOnDecrement,\n validationMessage = 'Quantity adjusted to {value}.',\n $data: $dataProp,\n $actions,\n ...props\n}: CartItemQuantityProps) {\n const item = useCartItem();\n const slice = useDataOverride<CartItemQuantitySlice | null | undefined>($dataProp);\n const [adjustment, setAdjustment] = useState<QuantityAdjustment | null>(null);\n\n // A gift line has no interactive quantity control, the same way CartItemRemove has no remove\n // control: a promotion-controlled quantity the shopper cannot validly change, and — with\n // removeOnDecrement — a path that would otherwise dispatch removeItem on a gift, discarding a\n // benefit T6 already sealed off from the remove button. Suppressing the stepper closes that path\n // under any composition. A store showing a gift's fixed quantity composes CartItemQuantityValue.\n if (item.gift) return null;\n\n const cart = $actions?.cart;\n\n const multiplier = effectiveMultiplier(slice);\n const decimals = decimalPlacesOf(multiplier);\n // min, max, and step are counts of purchasable units, and a cart line holds a whole number of\n // them, so a fractional bound has no valid value to land on. Left unrounded, a fractional `min` or\n // `max` becomes the clamp result and leaks into the delta — `decreaseQuantity({ by: 2.5 })` — which\n // the cart mutations reject. Rounding all three keeps every reachable value, and every dispatched\n // delta, an integer.\n const stepUnits = Math.max(1, Math.round(step ?? 1));\n const minUnits = Math.round(min);\n const maxUnits = max == null ? undefined : Math.round(max);\n const displayStep = roundTo(stepUnits * multiplier, decimals);\n const minDisplay = roundTo(minUnits * multiplier, decimals);\n const maxDisplay = maxUnits == null ? undefined : roundTo(maxUnits * multiplier, decimals);\n\n // Commit rather than change: `onValueChange` fires per parseable keystroke, so enforcing there\n // writes to the cart for every digit typed and snaps a value the shopper has not finished entering.\n function handleValueCommitted(value: number | null) {\n if (value == null) return;\n\n if (removeOnDecrement && value < minDisplay) {\n setAdjustment(null);\n void cart?.removeItem?.({ id: item.id });\n return;\n }\n\n const snapped = Math.min(Math.max(Math.round(value / multiplier), minUnits), maxUnits ?? Number.POSITIVE_INFINITY);\n const snappedDisplay = roundTo(snapped * multiplier, decimals);\n setAdjustment(resolveAdjustment(value, snappedDisplay, multiplier, minDisplay, maxDisplay));\n\n const delta = snapped - item.quantity;\n if (delta > 0) {\n void cart?.increaseQuantity?.({ id: item.id, by: delta });\n } else if (delta < 0) {\n void cart?.decreaseQuantity?.({ id: item.id, by: -delta });\n }\n }\n\n const effectiveMin = removeOnDecrement ? 0 : minDisplay;\n const computedClassName = removeOnDecrement ? (className ? `group ${className}` : 'group') : className;\n\n return (\n <BaseNumberField.Root\n {...props}\n value={roundTo(item.quantity * multiplier, decimals)}\n onValueCommitted={handleValueCommitted}\n // A shopper editing the field again makes the previous correction stale, so it is dropped as\n // soon as they type. Step and scrub reasons are excluded: those land on the grid by\n // construction and never raise a notice, so clearing on them would be dead code.\n onValueChange={(_value, details) => {\n if (details.reason === 'input-change' || details.reason === 'input-paste' || details.reason === 'input-clear') {\n setAdjustment(null);\n }\n }}\n min={effectiveMin}\n max={maxDisplay}\n step={displayStep}\n smallStep={displayStep}\n largeStep={roundTo(displayStep * 10, decimals)}\n snapOnStep\n // Base UI clamps text entry to min/max on its own, which would correct an out-of-bounds amount\n // before this component ever saw it — and a correction nobody can observe cannot be explained.\n allowOutOfRange\n className={computedClassName}\n data-fs-cart-item-quantity=\"\"\n {...(multiplier === 1 ? {} : { 'data-fs-cart-item-quantity-multiplier': String(multiplier) })}\n {...(adjustment\n ? {\n 'data-fs-cart-item-quantity-adjusted': '',\n 'data-fs-cart-item-quantity-adjusted-reason': adjustment.reason,\n }\n : {})}\n {...(removeOnDecrement && item.quantity <= minUnits ? { 'data-fs-cart-item-at-min': '' } : {})}\n >\n {children}\n {adjustment ? (\n <div role=\"alert\" data-fs-cart-item-quantity-validation=\"\">\n {validationMessage.replaceAll('{value}', String(adjustment.value))}\n </div>\n ) : null}\n </BaseNumberField.Root>\n );\n}\n\nexport function CartItemQuantityValue({ className, children, ...props }: CartItemQuantityValueProps) {\n const item = useCartItem();\n\n return (\n <span {...props} className={className} data-fs-cart-item-quantity-value=\"\">\n {children ?? String(item.quantity)}\n </span>\n );\n}\n\nexport function CartItemRemove({ className, children, onClick, $actions, ...props }: CartItemRemoveProps) {\n const item = useCartItem();\n\n // A gift line has no remove control: the promotion granted the item, and this phase does not let a\n // shopper discard it. Suppressed here rather than by composition, because CartList renders one\n // template for every line — an author cannot leave the leaf out of gift rows alone. Covers the\n // remove-on-alert composition too; an unavailable gift is recovered by the cart-level\n // CartRemoveUnavailable batch and by server-side cart validation.\n if (item.gift) return null;\n\n function handleClick(e: React.MouseEvent<HTMLButtonElement>) {\n void $actions?.cart?.removeItem?.({ id: item.id });\n onClick?.(e);\n }\n\n return (\n <button\n {...props}\n type=\"button\"\n className={className}\n onClick={handleClick}\n data-fs-cart-item-remove=\"\"\n data-fs-button=\"\"\n >\n {children}\n </button>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Availability gates — read `variant.availability` from the core slice (F4).\n// UNKNOWN and any future non-available state fall back to the generic \"Unavailable\".\n// ---------------------------------------------------------------------------\n\nconst UNAVAILABLE_LABELS: Record<string, string> = {\n OUT_OF_STOCK: 'Out of stock',\n UNAVAILABLE: 'Cannot be delivered',\n};\n\nfunction unavailableLabel(availability: string): string {\n return UNAVAILABLE_LABELS[availability] ?? 'Unavailable';\n}\n\nexport function CartItemAvailable({ className, children, ...props }: CartItemAvailableProps) {\n const item = useCartItem();\n if (item.variant.availability !== 'AVAILABLE') return null;\n\n return (\n <div {...props} className={className} data-fs-cart-item-available=\"\">\n {children}\n </div>\n );\n}\n\nexport function CartItemUnavailable({ className, children, ...props }: CartItemUnavailableProps) {\n const item = useCartItem();\n const { availability } = item.variant;\n if (availability === 'AVAILABLE') return null;\n\n return (\n <div\n {...props}\n className={className}\n data-fs-cart-item-unavailable=\"\"\n data-fs-cart-item-unavailable-state={availability.toLowerCase()}\n >\n {children ?? unavailableLabel(availability)}\n </div>\n );\n}\n\n// ---------------------------------------------------------------------------\n// F9 — gift marker. Inline, so `children` override the label rather than nesting a subtree; a gift\n// row's other needs are met by the row's own `data-fs-cart-item-gift-line` hook. \"Free\" is\n// operational copy, so it ships as a built-in default like the unavailability labels above, and moves\n// to the localization catalog rather than to a content model.\n// ---------------------------------------------------------------------------\n\nexport function CartItemGift({ className, children, ...props }: CartItemGiftProps) {\n const item = useCartItem();\n if (!item.gift) return null;\n\n return (\n <span {...props} className={className} data-fs-cart-item-gift=\"\" data-fs-text=\"\">\n {children ?? 'Free'}\n </span>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAkHA,MAAM,WAAW,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,YAAY;EAE7D,UAAA,YAAY,iBAAiB,YAAY;CACvC,CAAA;AAET;AASA,SAAgB,aAAa,EAAE,WAAW,UAAU,GAAG,SAA4B;CAEjF,IAAI,CADS,YACL,CAAC,CAAC,MAAM,OAAO;CAEvB,OACE,oBAAC,QAAD;EAAM,GAAI;EAAkB;EAAW,0BAAuB;EAAG,gBAAa;EAC3E,UAAA,YAAY;CACT,CAAA;AAEV"}
@@ -0,0 +1,49 @@
1
+ import { ComponentDefinition } from "../../core/dist/define-component.js";
2
+ import "../../core/dist/index.js";
3
+ import { ComponentPropsWithRef } from "react";
4
+ //#region src/matter/cart-item-compositions/cart-item-compositions.d.ts
5
+ export type CartItemCustomizationEntryView = {
6
+ name: string;
7
+ value: string;
8
+ };
9
+ export type CartItemCustomizationView = {
10
+ id: string;
11
+ entries: CartItemCustomizationEntryView[];
12
+ };
13
+ export type CartItemCompositionView = {
14
+ id: string;
15
+ name: string;
16
+ quantity: number;
17
+ price: {
18
+ amount: number;
19
+ currencyCode: string;
20
+ };
21
+ ownTotal: {
22
+ amount: number;
23
+ currencyCode: string;
24
+ };
25
+ total: {
26
+ amount: number;
27
+ currencyCode: string;
28
+ };
29
+ availability: string;
30
+ assemblyId: string;
31
+ customizations: CartItemCustomizationView[];
32
+ compositions?: CartItemCompositionView[];
33
+ };
34
+ /**
35
+ * Per-line slice delivered by the `reactive-list-item` runtime: the value the wrapper publishes
36
+ * through `DataOverrideContext`, read via `useDataOverride`. Only the fields the component renders
37
+ * are typed; the resolved cache slice carries the full fragment selection.
38
+ */
39
+ export type CartItemCompositionsSlice = {
40
+ compositions: CartItemCompositionView[];
41
+ };
42
+ export type CartItemCompositionsProps = ComponentPropsWithRef<'div'> & {
43
+ /** Per-item slice from the reactive-list-item runtime; injected/overridden by the wrapper. */
44
+ $data?: CartItemCompositionsSlice | null;
45
+ };
46
+ export declare const CartItemCompositionsDefinition: ComponentDefinition<CartItemCompositionsProps>;
47
+ export declare function CartItemCompositions({ className, $data: $dataProp, ...props }: CartItemCompositionsProps): import("react/jsx-runtime").JSX.Element | null;
48
+ //#endregion
49
+ //# sourceMappingURL=cart-item-compositions.d.ts.map
@@ -0,0 +1,165 @@
1
+ "use client";
2
+ import { defineComponent } from "../../core/dist/define-component.js";
3
+ import "../../core/dist/index.js";
4
+ import { useStorefrontContext } from "../../sdk/context/storefront-context.js";
5
+ import { graphql } from "../../sdk/generated/gql.js";
6
+ import { useDataOverride } from "../../sdk/data/data-override-context.js";
7
+ import { formatPrice } from "../cart/cart.js";
8
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
9
+ //#region src/matter/cart-item-compositions/cart-item-compositions.tsx
10
+ const cartItemCompositionsFragment = graphql(`
11
+ fragment CartItemCompositionsData on Query {
12
+ cart {
13
+ items {
14
+ __typename
15
+ id
16
+ compositions {
17
+ id
18
+ name
19
+ quantity
20
+ price {
21
+ ...MoneyFragment
22
+ }
23
+ availability
24
+ assemblyId
25
+ ownTotal {
26
+ ...MoneyFragment
27
+ }
28
+ total {
29
+ ...MoneyFragment
30
+ }
31
+ customizations {
32
+ id
33
+ entries {
34
+ name
35
+ value
36
+ }
37
+ }
38
+ compositions {
39
+ id
40
+ name
41
+ quantity
42
+ price {
43
+ ...MoneyFragment
44
+ }
45
+ availability
46
+ assemblyId
47
+ ownTotal {
48
+ ...MoneyFragment
49
+ }
50
+ total {
51
+ ...MoneyFragment
52
+ }
53
+ customizations {
54
+ id
55
+ entries {
56
+ name
57
+ value
58
+ }
59
+ }
60
+ compositions {
61
+ id
62
+ name
63
+ quantity
64
+ price {
65
+ ...MoneyFragment
66
+ }
67
+ availability
68
+ assemblyId
69
+ ownTotal {
70
+ ...MoneyFragment
71
+ }
72
+ total {
73
+ ...MoneyFragment
74
+ }
75
+ customizations {
76
+ id
77
+ entries {
78
+ name
79
+ value
80
+ }
81
+ }
82
+ }
83
+ }
84
+ }
85
+ }
86
+ }
87
+ }
88
+ `);
89
+ const CartItemCompositionsDefinition = defineComponent({
90
+ name: "CartItemCompositions",
91
+ importPath: "@vtex/faststore/components",
92
+ component: CartItemCompositions,
93
+ fragment: cartItemCompositionsFragment,
94
+ fetchStrategy: "reactive-list-item",
95
+ requiresContext: "cart-item",
96
+ editor: {
97
+ label: "Cart Item Compositions",
98
+ category: "commerce"
99
+ },
100
+ schema: {},
101
+ guideline: "Renders the nested bundle/assembly tree a shopper built under a cart line — each child shows name, quantity, unit price, and its own customizations, recursing on nested children; renders null when the line has none. Must be inside CartList. See cart-item.md."
102
+ });
103
+ function CustomizationGroups({ customizations }) {
104
+ if (customizations.length === 0) return null;
105
+ return /* @__PURE__ */ jsx(Fragment, { children: customizations.map((group) => /* @__PURE__ */ jsxs("div", {
106
+ "data-fs-cart-item-customization": "",
107
+ "data-fs-cart-item-customization-id": group.id,
108
+ children: [/* @__PURE__ */ jsx("span", {
109
+ "data-fs-cart-item-customization-label": "",
110
+ "data-fs-text": "",
111
+ children: group.id
112
+ }), group.entries.map((entry, index) => /* @__PURE__ */ jsxs("span", {
113
+ "data-fs-cart-item-customization-entry": "",
114
+ "data-fs-text": "",
115
+ children: [/* @__PURE__ */ jsx("span", {
116
+ "data-fs-cart-item-customization-name": "",
117
+ children: entry.name
118
+ }), /* @__PURE__ */ jsx("span", {
119
+ "data-fs-cart-item-customization-value": "",
120
+ children: entry.value
121
+ })]
122
+ }, `${entry.name}-${index}`))]
123
+ }, group.id)) });
124
+ }
125
+ function CartItemCompositions({ className, $data: $dataProp, ...props }) {
126
+ const slice = useDataOverride($dataProp);
127
+ const { locale, currency } = useStorefrontContext();
128
+ const compositions = slice?.compositions;
129
+ if (!compositions || compositions.length === 0) return null;
130
+ function renderComposition(node, depth) {
131
+ return /* @__PURE__ */ jsxs("div", {
132
+ "data-fs-cart-item-composition": "",
133
+ "data-fs-cart-item-composition-depth": depth,
134
+ children: [
135
+ /* @__PURE__ */ jsx("span", {
136
+ "data-fs-cart-item-composition-name": "",
137
+ "data-fs-text": "",
138
+ children: node.name
139
+ }),
140
+ /* @__PURE__ */ jsx("span", {
141
+ "data-fs-cart-item-composition-quantity": "",
142
+ "data-fs-text": "",
143
+ children: `×${node.quantity}`
144
+ }),
145
+ /* @__PURE__ */ jsx("span", {
146
+ "data-fs-cart-item-composition-price": "",
147
+ "data-fs-text": "",
148
+ children: formatPrice(Number(node.price.amount), locale, currency)
149
+ }),
150
+ /* @__PURE__ */ jsx(CustomizationGroups, { customizations: node.customizations }),
151
+ (node.compositions ?? []).map((child) => renderComposition(child, depth + 1))
152
+ ]
153
+ }, node.id);
154
+ }
155
+ return /* @__PURE__ */ jsx("div", {
156
+ ...props,
157
+ className,
158
+ "data-fs-cart-item-compositions": "",
159
+ children: compositions.map((node) => renderComposition(node, 0))
160
+ });
161
+ }
162
+ //#endregion
163
+ export { CartItemCompositions, CartItemCompositionsDefinition };
164
+
165
+ //# sourceMappingURL=cart-item-compositions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cart-item-compositions.js","names":[],"sources":["../../../src/matter/cart-item-compositions/cart-item-compositions.tsx"],"sourcesContent":["'use client';\n\nimport { defineComponent } from '@vtex/fs-core';\nimport type { ComponentPropsWithRef } from 'react';\nimport { useStorefrontContext } from '../../sdk/context/storefront-context.js';\nimport { useDataOverride } from '../../sdk/data/data-override-context.js';\nimport { graphql } from '../../sdk/generated/gql.js';\nimport { formatPrice } from '../cart/cart.js';\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\nexport type CartItemCustomizationEntryView = { name: string; value: string };\n\nexport type CartItemCustomizationView = { id: string; entries: CartItemCustomizationEntryView[] };\n\nexport type CartItemCompositionView = {\n id: string;\n name: string;\n quantity: number;\n price: { amount: number; currencyCode: string };\n ownTotal: { amount: number; currencyCode: string };\n total: { amount: number; currencyCode: string };\n availability: string;\n assemblyId: string;\n customizations: CartItemCustomizationView[];\n // Recursive; the fragment inlines this selection to 3 levels, so a node at the deepest fetched\n // level has no `compositions` sub-selection and the field is `undefined` at runtime.\n compositions?: CartItemCompositionView[];\n};\n\n/**\n * Per-line slice delivered by the `reactive-list-item` runtime: the value the wrapper publishes\n * through `DataOverrideContext`, read via `useDataOverride`. Only the fields the component renders\n * are typed; the resolved cache slice carries the full fragment selection.\n */\nexport type CartItemCompositionsSlice = {\n compositions: CartItemCompositionView[];\n};\n\nexport type CartItemCompositionsProps = ComponentPropsWithRef<'div'> & {\n /** Per-item slice from the reactive-list-item runtime; injected/overridden by the wrapper. */\n $data?: CartItemCompositionsSlice | null;\n};\n\n// ---------------------------------------------------------------------------\n// GraphQL Fragment — typed via @graphql-codegen client-preset\n// ---------------------------------------------------------------------------\n\n// ADR-0011: CartItemCompositions is a per-item sub-matter that OWNS its (optional) compositions data.\n// Decomposed out of the monolithic CartItemFragment, the compositions subtree is fetched only on pages\n// that place this matter — over-fetch elimination by data ownership. The author writes one uniform\n// `on Query` fragment drilling the list; the compiler re-roots it to\n// `CartItemCompositionsData_CartItem on CartItem`. The recursive `compositions` selection is inlined to\n// a pragmatic depth (GraphQL selection sets cannot self-reference); the server guards cycles (836\n// visited-index) and depth is bounded by the assembly config.\nconst cartItemCompositionsFragment = graphql(`\n fragment CartItemCompositionsData on Query {\n cart {\n items {\n __typename\n id\n compositions {\n id\n name\n quantity\n price {\n ...MoneyFragment\n }\n availability\n assemblyId\n ownTotal {\n ...MoneyFragment\n }\n total {\n ...MoneyFragment\n }\n customizations {\n id\n entries {\n name\n value\n }\n }\n compositions {\n id\n name\n quantity\n price {\n ...MoneyFragment\n }\n availability\n assemblyId\n ownTotal {\n ...MoneyFragment\n }\n total {\n ...MoneyFragment\n }\n customizations {\n id\n entries {\n name\n value\n }\n }\n compositions {\n id\n name\n quantity\n price {\n ...MoneyFragment\n }\n availability\n assemblyId\n ownTotal {\n ...MoneyFragment\n }\n total {\n ...MoneyFragment\n }\n customizations {\n id\n entries {\n name\n value\n }\n }\n }\n }\n }\n }\n }\n }\n`);\n\n// ---------------------------------------------------------------------------\n// Definition\n// ---------------------------------------------------------------------------\n\nexport const CartItemCompositionsDefinition = defineComponent<CartItemCompositionsProps>({\n name: 'CartItemCompositions',\n importPath: '@vtex/faststore/components',\n component: CartItemCompositions,\n fragment: cartItemCompositionsFragment,\n fetchStrategy: 'reactive-list-item',\n // requiresContext pairs with CartList (provides 'cart-item') so the context-constraints walk\n // rejects placing this matter outside its iterator.\n requiresContext: 'cart-item',\n editor: { label: 'Cart Item Compositions', category: 'commerce' },\n schema: {},\n guideline:\n 'Renders the nested bundle/assembly tree a shopper built under a cart line — each child shows name, quantity, unit price, and its own customizations, recursing on nested children; renders null when the line has none. Must be inside CartList. See cart-item.md.',\n});\n\n// ---------------------------------------------------------------------------\n// Implementation\n// ---------------------------------------------------------------------------\n\n// Shared customization-row renderer, co-located per single-file-matter convention. Renders the same\n// name/value anatomy as CartItemCustomizations so one compound swatch styles both surfaces. Not\n// imported from that matter — coupling two matters' data ownership/fragments is avoided (836 Decision 3).\nfunction CustomizationGroups({ customizations }: { customizations: CartItemCustomizationView[] }) {\n if (customizations.length === 0) return null;\n\n return (\n <>\n {customizations.map((group) => (\n <div key={group.id} data-fs-cart-item-customization=\"\" data-fs-cart-item-customization-id={group.id}>\n <span data-fs-cart-item-customization-label=\"\" data-fs-text=\"\">\n {group.id}\n </span>\n {group.entries.map((entry, index) => (\n <span key={`${entry.name}-${index}`} data-fs-cart-item-customization-entry=\"\" data-fs-text=\"\">\n <span data-fs-cart-item-customization-name=\"\">{entry.name}</span>\n <span data-fs-cart-item-customization-value=\"\">{entry.value}</span>\n </span>\n ))}\n </div>\n ))}\n </>\n );\n}\n\nexport function CartItemCompositions({ className, $data: $dataProp, ...props }: CartItemCompositionsProps) {\n // Delivery-agnostic: the slice arrives through the DataOverrideContext seam the reactive-list-item\n // wrapper publishes (or via $data in tests); the component calls no data hook.\n const slice = useDataOverride<CartItemCompositionsSlice | null | undefined>($dataProp);\n const { locale, currency } = useStorefrontContext();\n const compositions = slice?.compositions;\n\n if (!compositions || compositions.length === 0) {\n return null;\n }\n\n // Recursion is over finite in-slice data (the server guarantees acyclic compositions): render the\n // node's row (name, quantity, unit price), its own customizations (836 Decision 8), then recurse\n // over its nested children at depth + 1. React keys use the node id.\n function renderComposition(node: CartItemCompositionView, depth: number) {\n return (\n <div key={node.id} data-fs-cart-item-composition=\"\" data-fs-cart-item-composition-depth={depth}>\n <span data-fs-cart-item-composition-name=\"\" data-fs-text=\"\">\n {node.name}\n </span>\n <span data-fs-cart-item-composition-quantity=\"\" data-fs-text=\"\">\n {`×${node.quantity}`}\n </span>\n <span data-fs-cart-item-composition-price=\"\" data-fs-text=\"\">\n {formatPrice(Number(node.price.amount), locale, currency)}\n </span>\n <CustomizationGroups customizations={node.customizations} />\n {(node.compositions ?? []).map((child) => renderComposition(child, depth + 1))}\n </div>\n );\n }\n\n return (\n <div {...props} className={className} data-fs-cart-item-compositions=\"\">\n {compositions.map((node) => renderComposition(node, 0))}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;AAyDA,MAAM,+BAA+B,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8E5C;AAMD,MAAa,iCAAiC,gBAA2C;CACvF,MAAM;CACN,YAAY;CACZ,WAAW;CACX,UAAU;CACV,eAAe;CAGf,iBAAiB;CACjB,QAAQ;EAAE,OAAO;EAA0B,UAAU;CAAW;CAChE,QAAQ,CAAC;CACT,WACE;AACJ,CAAC;AASD,SAAS,oBAAoB,EAAE,kBAAmE;CAChG,IAAI,eAAe,WAAW,GAAG,OAAO;CAExC,OACE,oBAAA,UAAA,EAAA,UACG,eAAe,KAAK,UACnB,qBAAC,OAAD;EAAoB,mCAAgC;EAAG,sCAAoC,MAAM;EAAjG,UAAA,CACE,oBAAC,QAAD;GAAM,yCAAsC;GAAG,gBAAa;GACzD,UAAA,MAAM;EACH,CAAA,GACL,MAAM,QAAQ,KAAK,OAAO,UACzB,qBAAC,QAAD;GAAqC,yCAAsC;GAAG,gBAAa;GAA3F,UAAA,CACE,oBAAC,QAAD;IAAM,wCAAqC;IAAI,UAAA,MAAM;GAAW,CAAA,GAChE,oBAAC,QAAD;IAAM,yCAAsC;IAAI,UAAA,MAAM;GAAY,CAAA,CAC9D;EAHK,GAAA,GAAG,MAAM,KAAK,GAAG,OAGtB,CACP,CACE;CAVK,GAAA,MAAM,EAUX,CACN,EACD,CAAA;AAEN;AAEA,SAAgB,qBAAqB,EAAE,WAAW,OAAO,WAAW,GAAG,SAAoC;CAGzG,MAAM,QAAQ,gBAA8D,SAAS;CACrF,MAAM,EAAE,QAAQ,aAAa,qBAAqB;CAClD,MAAM,eAAe,OAAO;CAE5B,IAAI,CAAC,gBAAgB,aAAa,WAAW,GAC3C,OAAO;CAMT,SAAS,kBAAkB,MAA+B,OAAe;EACvE,OACE,qBAAC,OAAD;GAAmB,iCAA8B;GAAG,uCAAqC;GAAzF,UAAA;IACE,oBAAC,QAAD;KAAM,sCAAmC;KAAG,gBAAa;KACtD,UAAA,KAAK;IACF,CAAA;IACN,oBAAC,QAAD;KAAM,0CAAuC;KAAG,gBAAa;KAC1D,UAAA,IAAI,KAAK;IACN,CAAA;IACN,oBAAC,QAAD;KAAM,uCAAoC;KAAG,gBAAa;KACvD,UAAA,YAAY,OAAO,KAAK,MAAM,MAAM,GAAG,QAAQ,QAAQ;IACpD,CAAA;IACN,oBAAC,qBAAD,EAAqB,gBAAgB,KAAK,eAAiB,CAAA;KACzD,KAAK,gBAAgB,CAAC,EAAA,CAAG,KAAK,UAAU,kBAAkB,OAAO,QAAQ,CAAC,CAAC;GAC1E;EAZK,GAAA,KAAK,EAYV;CAET;CAEA,OACE,oBAAC,OAAD;EAAK,GAAI;EAAkB;EAAW,kCAA+B;EAClE,UAAA,aAAa,KAAK,SAAS,kBAAkB,MAAM,CAAC,CAAC;CACnD,CAAA;AAET"}
@@ -0,0 +1,28 @@
1
+ import { ComponentDefinition } from "../../core/dist/define-component.js";
2
+ import "../../core/dist/index.js";
3
+ import { ComponentPropsWithRef } from "react";
4
+ //#region src/matter/cart-item-customizations/cart-item-customizations.d.ts
5
+ export type CartItemCustomizationEntryView = {
6
+ name: string;
7
+ value: string;
8
+ };
9
+ export type CartItemCustomizationView = {
10
+ id: string;
11
+ entries: CartItemCustomizationEntryView[];
12
+ };
13
+ /**
14
+ * Per-line slice delivered by the `reactive-list-item` runtime: the value the wrapper publishes
15
+ * through `DataOverrideContext`, read via `useDataOverride`. Only the fields the component renders
16
+ * are typed; the resolved cache slice carries the full fragment selection.
17
+ */
18
+ export type CartItemCustomizationsSlice = {
19
+ customizations: CartItemCustomizationView[];
20
+ };
21
+ export type CartItemCustomizationsProps = ComponentPropsWithRef<'div'> & {
22
+ /** Per-item slice from the reactive-list-item runtime; injected/overridden by the wrapper. */
23
+ $data?: CartItemCustomizationsSlice | null;
24
+ };
25
+ export declare const CartItemCustomizationsDefinition: ComponentDefinition<CartItemCustomizationsProps>;
26
+ export declare function CartItemCustomizations({ className, $data: $dataProp, ...props }: CartItemCustomizationsProps): import("react/jsx-runtime").JSX.Element | null;
27
+ //#endregion
28
+ //# sourceMappingURL=cart-item-customizations.d.ts.map
@@ -0,0 +1,73 @@
1
+ "use client";
2
+ import { defineComponent } from "../../core/dist/define-component.js";
3
+ import "../../core/dist/index.js";
4
+ import { graphql } from "../../sdk/generated/gql.js";
5
+ import { useDataOverride } from "../../sdk/data/data-override-context.js";
6
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
+ //#region src/matter/cart-item-customizations/cart-item-customizations.tsx
8
+ const cartItemCustomizationsFragment = graphql(`
9
+ fragment CartItemCustomizationsData on Query {
10
+ cart {
11
+ items {
12
+ __typename
13
+ id
14
+ customizations {
15
+ id
16
+ entries {
17
+ name
18
+ value
19
+ }
20
+ }
21
+ }
22
+ }
23
+ }
24
+ `);
25
+ const CartItemCustomizationsDefinition = defineComponent({
26
+ name: "CartItemCustomizations",
27
+ importPath: "@vtex/faststore/components",
28
+ component: CartItemCustomizations,
29
+ fragment: cartItemCustomizationsFragment,
30
+ fetchStrategy: "reactive-list-item",
31
+ requiresContext: "cart-item",
32
+ editor: {
33
+ label: "Cart Item Customizations",
34
+ category: "commerce"
35
+ },
36
+ schema: {},
37
+ guideline: "Renders the form-based customizations a shopper applied to a cart line (e.g. \"Text: MARIA\"), one group per assembly; renders null when the line has none. Must be inside CartList. See cart-item.md."
38
+ });
39
+ function CustomizationGroups({ customizations }) {
40
+ return /* @__PURE__ */ jsx(Fragment, { children: customizations.map((group) => /* @__PURE__ */ jsxs("div", {
41
+ "data-fs-cart-item-customization": "",
42
+ "data-fs-cart-item-customization-id": group.id,
43
+ children: [/* @__PURE__ */ jsx("span", {
44
+ "data-fs-cart-item-customization-label": "",
45
+ "data-fs-text": "",
46
+ children: group.id
47
+ }), group.entries.map((entry, index) => /* @__PURE__ */ jsxs("span", {
48
+ "data-fs-cart-item-customization-entry": "",
49
+ "data-fs-text": "",
50
+ children: [/* @__PURE__ */ jsx("span", {
51
+ "data-fs-cart-item-customization-name": "",
52
+ children: entry.name
53
+ }), /* @__PURE__ */ jsx("span", {
54
+ "data-fs-cart-item-customization-value": "",
55
+ children: entry.value
56
+ })]
57
+ }, `${entry.name}-${index}`))]
58
+ }, group.id)) });
59
+ }
60
+ function CartItemCustomizations({ className, $data: $dataProp, ...props }) {
61
+ const customizations = useDataOverride($dataProp)?.customizations;
62
+ if (!customizations || customizations.length === 0) return null;
63
+ return /* @__PURE__ */ jsx("div", {
64
+ ...props,
65
+ className,
66
+ "data-fs-cart-item-customizations": "",
67
+ children: /* @__PURE__ */ jsx(CustomizationGroups, { customizations })
68
+ });
69
+ }
70
+ //#endregion
71
+ export { CartItemCustomizations, CartItemCustomizationsDefinition };
72
+
73
+ //# sourceMappingURL=cart-item-customizations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cart-item-customizations.js","names":[],"sources":["../../../src/matter/cart-item-customizations/cart-item-customizations.tsx"],"sourcesContent":["'use client';\n\nimport { defineComponent } from '@vtex/fs-core';\nimport type { ComponentPropsWithRef } from 'react';\nimport { useDataOverride } from '../../sdk/data/data-override-context.js';\nimport { graphql } from '../../sdk/generated/gql.js';\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\nexport type CartItemCustomizationEntryView = { name: string; value: string };\n\nexport type CartItemCustomizationView = { id: string; entries: CartItemCustomizationEntryView[] };\n\n/**\n * Per-line slice delivered by the `reactive-list-item` runtime: the value the wrapper publishes\n * through `DataOverrideContext`, read via `useDataOverride`. Only the fields the component renders\n * are typed; the resolved cache slice carries the full fragment selection.\n */\nexport type CartItemCustomizationsSlice = {\n customizations: CartItemCustomizationView[];\n};\n\nexport type CartItemCustomizationsProps = ComponentPropsWithRef<'div'> & {\n /** Per-item slice from the reactive-list-item runtime; injected/overridden by the wrapper. */\n $data?: CartItemCustomizationsSlice | null;\n};\n\n// ---------------------------------------------------------------------------\n// GraphQL Fragment — typed via @graphql-codegen client-preset\n// ---------------------------------------------------------------------------\n\n// ADR-0011: CartItemCustomizations is a per-item sub-matter that OWNS its (optional) customizations\n// data. Decomposed out of the monolithic CartItemFragment, the customizations subtree is fetched only\n// on pages that place this matter — over-fetch elimination by data ownership. The author writes one\n// uniform `on Query` fragment drilling the list; the compiler re-roots it to\n// `CartItemCustomizationsData_CartItem on CartItem`. Fields are inlined (no `...` spread on the owned\n// subtree) so the derived per-item fragment is self-contained for `useFragment`; it drills the\n// identical cart { items { ... } } path as the other per-item matters so it merges un-aliased.\nconst cartItemCustomizationsFragment = graphql(`\n fragment CartItemCustomizationsData on Query {\n cart {\n items {\n __typename\n id\n customizations {\n id\n entries {\n name\n value\n }\n }\n }\n }\n }\n`);\n\n// ---------------------------------------------------------------------------\n// Definition\n// ---------------------------------------------------------------------------\n\nexport const CartItemCustomizationsDefinition = defineComponent<CartItemCustomizationsProps>({\n name: 'CartItemCustomizations',\n importPath: '@vtex/faststore/components',\n component: CartItemCustomizations,\n fragment: cartItemCustomizationsFragment,\n fetchStrategy: 'reactive-list-item',\n // requiresContext pairs with CartList (provides 'cart-item') so the context-constraints walk\n // rejects placing this matter outside its iterator.\n requiresContext: 'cart-item',\n editor: { label: 'Cart Item Customizations', category: 'commerce' },\n schema: {},\n guideline:\n 'Renders the form-based customizations a shopper applied to a cart line (e.g. \"Text: MARIA\"), one group per assembly; renders null when the line has none. Must be inside CartList. See cart-item.md.',\n});\n\n// ---------------------------------------------------------------------------\n// Implementation\n// ---------------------------------------------------------------------------\n\n// Shared customization-row renderer, co-located per single-file-matter convention. The identical\n// name/value anatomy is reused by CartItemCompositions for each composition child's own\n// customizations (836 Decision 8), so a single compound swatch styles both surfaces.\nfunction CustomizationGroups({ customizations }: { customizations: CartItemCustomizationView[] }) {\n return (\n <>\n {customizations.map((group) => (\n <div key={group.id} data-fs-cart-item-customization=\"\" data-fs-cart-item-customization-id={group.id}>\n <span data-fs-cart-item-customization-label=\"\" data-fs-text=\"\">\n {group.id}\n </span>\n {group.entries.map((entry, index) => (\n <span key={`${entry.name}-${index}`} data-fs-cart-item-customization-entry=\"\" data-fs-text=\"\">\n <span data-fs-cart-item-customization-name=\"\">{entry.name}</span>\n <span data-fs-cart-item-customization-value=\"\">{entry.value}</span>\n </span>\n ))}\n </div>\n ))}\n </>\n );\n}\n\nexport function CartItemCustomizations({ className, $data: $dataProp, ...props }: CartItemCustomizationsProps) {\n // Delivery-agnostic: the slice arrives through the DataOverrideContext seam the reactive-list-item\n // wrapper publishes (or via $data in tests); the component calls no data hook.\n const slice = useDataOverride<CartItemCustomizationsSlice | null | undefined>($dataProp);\n const customizations = slice?.customizations;\n\n if (!customizations || customizations.length === 0) {\n return null;\n }\n\n return (\n <div {...props} className={className} data-fs-cart-item-customizations=\"\">\n <CustomizationGroups customizations={customizations} />\n </div>\n );\n}\n"],"mappings":";;;;;;;AAwCA,MAAM,iCAAiC,QAAQ;;;;;;;;;;;;;;;;CAgB9C;AAMD,MAAa,mCAAmC,gBAA6C;CAC3F,MAAM;CACN,YAAY;CACZ,WAAW;CACX,UAAU;CACV,eAAe;CAGf,iBAAiB;CACjB,QAAQ;EAAE,OAAO;EAA4B,UAAU;CAAW;CAClE,QAAQ,CAAC;CACT,WACE;AACJ,CAAC;AASD,SAAS,oBAAoB,EAAE,kBAAmE;CAChG,OACE,oBAAA,UAAA,EAAA,UACG,eAAe,KAAK,UACnB,qBAAC,OAAD;EAAoB,mCAAgC;EAAG,sCAAoC,MAAM;EAAjG,UAAA,CACE,oBAAC,QAAD;GAAM,yCAAsC;GAAG,gBAAa;GACzD,UAAA,MAAM;EACH,CAAA,GACL,MAAM,QAAQ,KAAK,OAAO,UACzB,qBAAC,QAAD;GAAqC,yCAAsC;GAAG,gBAAa;GAA3F,UAAA,CACE,oBAAC,QAAD;IAAM,wCAAqC;IAAI,UAAA,MAAM;GAAW,CAAA,GAChE,oBAAC,QAAD;IAAM,yCAAsC;IAAI,UAAA,MAAM;GAAY,CAAA,CAC9D;EAHK,GAAA,GAAG,MAAM,KAAK,GAAG,OAGtB,CACP,CACE;CAVK,GAAA,MAAM,EAUX,CACN,EACD,CAAA;AAEN;AAEA,SAAgB,uBAAuB,EAAE,WAAW,OAAO,WAAW,GAAG,SAAsC;CAI7G,MAAM,iBADQ,gBAAgE,SACnD,CAAC,EAAE;CAE9B,IAAI,CAAC,kBAAkB,eAAe,WAAW,GAC/C,OAAO;CAGT,OACE,oBAAC,OAAD;EAAK,GAAI;EAAkB;EAAW,oCAAiC;EACrE,UAAA,oBAAC,qBAAD,EAAqC,eAAiB,CAAA;CACnD,CAAA;AAET"}
@@ -0,0 +1,33 @@
1
+ import { ComponentDefinition } from "../../core/dist/define-component.js";
2
+ import "../../core/dist/index.js";
3
+ import { ComponentPropsWithRef } from "react";
4
+ //#region src/matter/cart-item-discounts/cart-item-discounts.d.ts
5
+ /**
6
+ * One named promotion discount on the current cart line. `value` is the absolute amount discounted
7
+ * (a positive `Money`); the leading `−` and the `%` sign are presentational (FSPG-835 contract).
8
+ * `amount` is typed `number` but is a string at runtime, so it is `Number()`-coerced before formatting.
9
+ */
10
+ export type CartItemDiscountEntry = {
11
+ name: string;
12
+ value: {
13
+ amount: number;
14
+ currencyCode: string;
15
+ };
16
+ isPercentual: boolean;
17
+ };
18
+ /**
19
+ * Per-line slice delivered by the `reactive-list-item` runtime: the value the wrapper publishes
20
+ * through `DataOverrideContext`, read via `useDataOverride`. Only the fields the component renders
21
+ * are typed; the resolved cache slice carries the full fragment selection.
22
+ */
23
+ export type CartItemDiscountsSlice = {
24
+ discounts: CartItemDiscountEntry[];
25
+ };
26
+ export type CartItemDiscountsProps = ComponentPropsWithRef<'div'> & {
27
+ /** Per-item slice from the reactive-list-item runtime; injected/overridden by the wrapper. */
28
+ $data?: CartItemDiscountsSlice | null;
29
+ };
30
+ export declare const CartItemDiscountsDefinition: ComponentDefinition<CartItemDiscountsProps>;
31
+ export declare function CartItemDiscounts({ className, $data: $dataProp, ...props }: CartItemDiscountsProps): import("react/jsx-runtime").JSX.Element | null;
32
+ //#endregion
33
+ //# sourceMappingURL=cart-item-discounts.d.ts.map
@@ -0,0 +1,70 @@
1
+ "use client";
2
+ import { defineComponent } from "../../core/dist/define-component.js";
3
+ import "../../core/dist/index.js";
4
+ import { useStorefrontContext } from "../../sdk/context/storefront-context.js";
5
+ import { graphql } from "../../sdk/generated/gql.js";
6
+ import { useDataOverride } from "../../sdk/data/data-override-context.js";
7
+ import { formatPrice } from "../cart/cart.js";
8
+ import { jsx, jsxs } from "react/jsx-runtime";
9
+ //#region src/matter/cart-item-discounts/cart-item-discounts.tsx
10
+ const cartItemDiscountsFragment = graphql(`
11
+ fragment CartItemDiscountsData on Query {
12
+ cart {
13
+ items {
14
+ __typename
15
+ id
16
+ discounts {
17
+ name
18
+ value {
19
+ ...MoneyFragment
20
+ }
21
+ isPercentual
22
+ }
23
+ }
24
+ }
25
+ }
26
+ `);
27
+ const CartItemDiscountsDefinition = defineComponent({
28
+ name: "CartItemDiscounts",
29
+ importPath: "@vtex/faststore/components",
30
+ component: CartItemDiscounts,
31
+ fragment: cartItemDiscountsFragment,
32
+ fetchStrategy: "reactive-list-item",
33
+ requiresContext: "cart-item",
34
+ editor: {
35
+ label: "Cart Item Discounts",
36
+ category: "commerce"
37
+ },
38
+ schema: {},
39
+ guideline: "Renders the named promotion discounts applied to a cart line (e.g. \"Black Friday −R$ 20,00\"); renders null when the line has none. Distinct from the CartItemDiscountPercentage badge. Must be inside CartList. See cart-item.md."
40
+ });
41
+ function CartItemDiscounts({ className, $data: $dataProp, ...props }) {
42
+ const slice = useDataOverride($dataProp);
43
+ const { locale, currency } = useStorefrontContext();
44
+ const discounts = slice?.discounts;
45
+ if (!discounts || discounts.length === 0) return null;
46
+ return /* @__PURE__ */ jsx("div", {
47
+ ...props,
48
+ className,
49
+ "data-fs-cart-item-discounts": "",
50
+ children: discounts.map((discount, index) => {
51
+ const amount = Number(discount.value.amount);
52
+ const value = discount.isPercentual ? `−${amount}%` : `−${formatPrice(amount, locale, currency)}`;
53
+ return /* @__PURE__ */ jsxs("span", {
54
+ "data-fs-cart-item-discount": "",
55
+ "data-fs-text": "",
56
+ children: [/* @__PURE__ */ jsx("span", {
57
+ "data-fs-cart-item-discount-name": "",
58
+ children: discount.name
59
+ }), /* @__PURE__ */ jsx("span", {
60
+ "data-fs-cart-item-discount-value": "",
61
+ children: value
62
+ })]
63
+ }, `${discount.name}-${index}`);
64
+ })
65
+ });
66
+ }
67
+ //#endregion
68
+ export { CartItemDiscounts, CartItemDiscountsDefinition };
69
+
70
+ //# sourceMappingURL=cart-item-discounts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cart-item-discounts.js","names":[],"sources":["../../../src/matter/cart-item-discounts/cart-item-discounts.tsx"],"sourcesContent":["'use client';\n\nimport { defineComponent } from '@vtex/fs-core';\nimport type { ComponentPropsWithRef } from 'react';\nimport { useStorefrontContext } from '../../sdk/context/storefront-context.js';\nimport { useDataOverride } from '../../sdk/data/data-override-context.js';\nimport { graphql } from '../../sdk/generated/gql.js';\nimport { formatPrice } from '../cart/cart.js';\n\n// ---------------------------------------------------------------------------\n// GraphQL Fragment — typed via @graphql-codegen client-preset\n// ---------------------------------------------------------------------------\n\n// ADR-0011: CartItemDiscounts is a per-item sub-matter that OWNS its (optional) discounts data.\n// Decomposed out of the monolithic CartItemFragment, the discounts subtree is fetched only on pages\n// that place this matter — over-fetch elimination by data ownership. The author writes one uniform\n// `on Query` fragment drilling the list; the compiler re-roots it to\n// `CartItemDiscountsData_CartItem on CartItem`. Fields are inlined (no `...` spread on `discounts`)\n// so the derived per-item fragment is self-contained for `useFragment`; it drills the identical\n// cart { items { ... } } path as the other per-item matters so it merges un-aliased (ADR-0012).\nconst cartItemDiscountsFragment = graphql(`\n fragment CartItemDiscountsData on Query {\n cart {\n items {\n __typename\n id\n discounts {\n name\n value {\n ...MoneyFragment\n }\n isPercentual\n }\n }\n }\n }\n`);\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\n/**\n * One named promotion discount on the current cart line. `value` is the absolute amount discounted\n * (a positive `Money`); the leading `−` and the `%` sign are presentational (FSPG-835 contract).\n * `amount` is typed `number` but is a string at runtime, so it is `Number()`-coerced before formatting.\n */\nexport type CartItemDiscountEntry = {\n name: string;\n value: { amount: number; currencyCode: string };\n isPercentual: boolean;\n};\n\n/**\n * Per-line slice delivered by the `reactive-list-item` runtime: the value the wrapper publishes\n * through `DataOverrideContext`, read via `useDataOverride`. Only the fields the component renders\n * are typed; the resolved cache slice carries the full fragment selection.\n */\nexport type CartItemDiscountsSlice = {\n discounts: CartItemDiscountEntry[];\n};\n\nexport type CartItemDiscountsProps = ComponentPropsWithRef<'div'> & {\n /** Per-item slice from the reactive-list-item runtime; injected/overridden by the wrapper. */\n $data?: CartItemDiscountsSlice | null;\n};\n\n// ---------------------------------------------------------------------------\n// Definition\n// ---------------------------------------------------------------------------\n\nexport const CartItemDiscountsDefinition = defineComponent<CartItemDiscountsProps>({\n name: 'CartItemDiscounts',\n importPath: '@vtex/faststore/components',\n component: CartItemDiscounts,\n fragment: cartItemDiscountsFragment,\n fetchStrategy: 'reactive-list-item',\n // requiresContext pairs with CartList (provides 'cart-item') so the context-constraints walk\n // rejects placing this matter outside its iterator.\n requiresContext: 'cart-item',\n editor: { label: 'Cart Item Discounts', category: 'commerce' },\n schema: {},\n guideline:\n 'Renders the named promotion discounts applied to a cart line (e.g. \"Black Friday −R$ 20,00\"); renders null when the line has none. Distinct from the CartItemDiscountPercentage badge. Must be inside CartList. See cart-item.md.',\n});\n\n// ---------------------------------------------------------------------------\n// Implementation\n// ---------------------------------------------------------------------------\n\nexport function CartItemDiscounts({ className, $data: $dataProp, ...props }: CartItemDiscountsProps) {\n // Delivery-agnostic: the slice arrives through the DataOverrideContext seam the reactive-list-item\n // wrapper publishes (or via $data in tests); the component calls no data hook.\n const slice = useDataOverride<CartItemDiscountsSlice | null | undefined>($dataProp);\n const { locale, currency } = useStorefrontContext();\n const discounts = slice?.discounts;\n\n if (!discounts || discounts.length === 0) {\n return null;\n }\n\n return (\n <div {...props} className={className} data-fs-cart-item-discounts=\"\">\n {discounts.map((discount, index) => {\n const amount = Number(discount.value.amount);\n const value = discount.isPercentual ? `−${amount}%` : `−${formatPrice(amount, locale, currency)}`;\n\n return (\n <span key={`${discount.name}-${index}`} data-fs-cart-item-discount=\"\" data-fs-text=\"\">\n <span data-fs-cart-item-discount-name=\"\">{discount.name}</span>\n <span data-fs-cart-item-discount-value=\"\">{value}</span>\n </span>\n );\n })}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;AAoBA,MAAM,4BAA4B,QAAQ;;;;;;;;;;;;;;;;CAgBzC;AAmCD,MAAa,8BAA8B,gBAAwC;CACjF,MAAM;CACN,YAAY;CACZ,WAAW;CACX,UAAU;CACV,eAAe;CAGf,iBAAiB;CACjB,QAAQ;EAAE,OAAO;EAAuB,UAAU;CAAW;CAC7D,QAAQ,CAAC;CACT,WACE;AACJ,CAAC;AAMD,SAAgB,kBAAkB,EAAE,WAAW,OAAO,WAAW,GAAG,SAAiC;CAGnG,MAAM,QAAQ,gBAA2D,SAAS;CAClF,MAAM,EAAE,QAAQ,aAAa,qBAAqB;CAClD,MAAM,YAAY,OAAO;CAEzB,IAAI,CAAC,aAAa,UAAU,WAAW,GACrC,OAAO;CAGT,OACE,oBAAC,OAAD;EAAK,GAAI;EAAkB;EAAW,+BAA4B;EAC/D,UAAA,UAAU,KAAK,UAAU,UAAU;GAClC,MAAM,SAAS,OAAO,SAAS,MAAM,MAAM;GAC3C,MAAM,QAAQ,SAAS,eAAe,IAAI,OAAO,KAAK,IAAI,YAAY,QAAQ,QAAQ,QAAQ;GAE9F,OACE,qBAAC,QAAD;IAAwC,8BAA2B;IAAG,gBAAa;IAAnF,UAAA,CACE,oBAAC,QAAD;KAAM,mCAAgC;KAAI,UAAA,SAAS;IAAW,CAAA,GAC9D,oBAAC,QAAD;KAAM,oCAAiC;KAAI,UAAA;IAAY,CAAA,CACnD;GAHK,GAAA,GAAG,SAAS,KAAK,GAAG,OAGzB;EAEV,CAAC;CACE,CAAA;AAET"}
@@ -0,0 +1,24 @@
1
+ import { ComponentDefinition } from "../../core/dist/define-component.js";
2
+ import "../../core/dist/index.js";
3
+ import { ComponentPropsWithRef } from "react";
4
+ //#region src/matter/cart-item-seller-info/cart-item-seller-info.d.ts
5
+ /**
6
+ * Per-line slice delivered by the `reactive-list-item` runtime: the value the wrapper publishes
7
+ * through `DataOverrideContext`, read via `useDataOverride`. Only the fields the component renders
8
+ * are typed; the resolved cache slice carries the full fragment selection.
9
+ */
10
+ export type CartItemSellerInfoSlice = {
11
+ variant: {
12
+ seller: {
13
+ name: string;
14
+ } | null;
15
+ } | null;
16
+ };
17
+ export type CartItemSellerInfoProps = ComponentPropsWithRef<'span'> & {
18
+ /** Per-item slice from the reactive-list-item runtime; injected/overridden by the wrapper. */
19
+ $data?: CartItemSellerInfoSlice | null;
20
+ };
21
+ export declare const CartItemSellerInfoDefinition: ComponentDefinition<CartItemSellerInfoProps>;
22
+ export declare function CartItemSellerInfo({ className, children, $data: $dataProp, ...props }: CartItemSellerInfoProps): import("react/jsx-runtime").JSX.Element | null;
23
+ //#endregion
24
+ //# sourceMappingURL=cart-item-seller-info.d.ts.map