@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,184 @@
1
+ # ClientPreferences
2
+
3
+ **Category:** identity
4
+ **Purpose:** The consent opt-in section of a checkout User Identity step. A `ClientPreferencesRoot` reads both opt-in flags — newsletter (`optinNewsLetter`) and save-personal-data (`savePersonalData`) — from the shopper's `ClientPreferences` entity (a sibling of `Cart`, via `Query.clientPreferences`) and publishes them to its Controls. Each Control is a bound checkbox that persists its own flag via `$actions.identity.clientPreferencesUpdate`. It reads session state from `useSession()` and must sit inside a `SessionRoot`.
5
+
6
+ ---
7
+
8
+ ## Visual cues (how to identify in an image)
9
+
10
+ Use these signals to detect that a consent opt-in section is present. Position on the page is irrelevant for detection. The image is the source of truth for layout.
11
+
12
+ - One or two **checkboxes with a text label**, typically below the email/profile fields of a checkout identity step.
13
+ - A **newsletter opt-in** — a checkbox labelled like *"Quero receber novidades e ofertas por e-mail"* / *"Sign me up for the newsletter"*.
14
+ - A **save-my-data opt-in** — a checkbox labelled like *"Salvar minhas informações para a próxima compra"* / *"Save my information for next time"*.
15
+ - The checkboxes are **unchecked by default** (opt-in, not opt-out).
16
+
17
+ Use `ClientPreferencesRoot` + the matching Control(s) whenever the checkbox must read from and write to the shopper's stored preferences — not for a purely presentational checkbox.
18
+
19
+ ---
20
+
21
+ ## When to use
22
+
23
+ - The consent / preferences step of the checkout User Identity flow.
24
+ - Anywhere the shopper's newsletter or save-personal-data preference must be read (pre-fill) and written (persisted on toggle).
25
+
26
+ ## When NOT to use
27
+
28
+ - A purely presentational checkbox with host-owned state → use the `Checkbox` particle (optionally wrapped with `Field`) directly.
29
+ - Email / name / phone / document identity fields → out of scope (separate identity components; email is `EmailIdentificationControl`).
30
+ - Terms-and-conditions or order-review checkboxes unrelated to `ClientPreferences` → not this matter.
31
+
32
+ ---
33
+
34
+ ## Composition
35
+
36
+ ```
37
+ SessionRoot (provides the session tri-state; required ancestor)
38
+ └── ClientPreferencesRoot (data-fs-client-preferences-root; reads both opt-ins)
39
+ ├── NewsletterOptInControl (data-fs-newsletter-opt-in; bound to optinNewsLetter)
40
+ └── SavePersonalDataOptInControl (data-fs-save-personal-data-opt-in; bound to savePersonalData)
41
+ ```
42
+
43
+ - `ClientPreferencesRoot` **must** have a `SessionRoot` ancestor — `useSession()` throws otherwise.
44
+ - Both Controls **must** be descendants of `ClientPreferencesRoot` — each throws *"A client-preferences Control must be used inside a ClientPreferencesRoot."* otherwise.
45
+ - The two Controls are **siblings** in the same `children` array — a single Root owns both opt-ins (one data owner = one Root, per ADR-0011). Include only the Control(s) whose checkbox is visible; child order reflects visual order.
46
+
47
+ ---
48
+
49
+ ## Components
50
+
51
+ ### ClientPreferencesRoot
52
+
53
+ Binding provider for the section. Reads both opt-in values from `Query.clientPreferences`, seeds each Control, and tracks per-field pending/error. Renders a `<div data-fs-client-preferences-root>` wrapper. No merchant-facing props beyond `className`.
54
+
55
+ **Data:** declares a colocated `fragment ClientPreferencesData on Query { clientPreferences { optinNewsLetter savePersonalData } }` with `fetchStrategy: 'reactive'`. The compiler merges it into the page query — no explicit `dataSources` entry needed.
56
+
57
+ ### NewsletterOptInControl
58
+
59
+ The bound newsletter checkbox (`optinNewsLetter`). Inlines `Field` + `Checkbox` + `Icon` (no `CheckboxField` particle). Toggling dispatches `$actions.identity.clientPreferencesUpdate({ optinNewsLetter })`. Defaults to unchecked.
60
+
61
+ | Prop | Type | Default | Notes |
62
+ |------|------|---------|-------|
63
+ | `label` | string | — | The text shown beside the checkbox. |
64
+ | `$actions` | injected | — | Carries `identity.clientPreferencesUpdate` (compiler-injected). |
65
+
66
+ **Write:** declares `actions: { identity: ['clientPreferencesUpdate'] }`. The write is pessimistic/async — while in flight the checkbox is disabled and the Control carries `data-fs-newsletter-opt-in-pending`. Server `userErrors` surface inline under this checkbox only.
67
+
68
+ ### SavePersonalDataOptInControl
69
+
70
+ The bound save-personal-data checkbox (`savePersonalData`). Same shape as `NewsletterOptInControl` — toggling dispatches `$actions.identity.clientPreferencesUpdate({ savePersonalData })`, carries `data-fs-save-personal-data-opt-in-pending` while in flight, and surfaces its own `userErrors`. Defaults to unchecked.
71
+
72
+ | Prop | Type | Default | Notes |
73
+ |------|------|---------|-------|
74
+ | `label` | string | — | The text shown beside the checkbox. |
75
+ | `$actions` | injected | — | Carries `identity.clientPreferencesUpdate` (compiler-injected). |
76
+
77
+ Both Controls share one internal `OptInControl` implementation; each registered Control only fixes its `fieldKey` and `data-fs-*` attributes.
78
+
79
+ ---
80
+
81
+ ## Behavior
82
+
83
+ - **Pre-fill:** each checkbox reflects its `clientPreferences` value; a `null` (shopper has not chosen) reads as unchecked.
84
+ - **Toggle → persist:** dispatches `$actions.identity.clientPreferencesUpdate` with **only** the toggled field; the other flag is left untouched.
85
+ - **In flight:** the toggled checkbox is disabled and its Control carries its `*-pending` attribute; the other Control is unaffected (per-field pending).
86
+ - **Server `userErrors`:** surfaced inline under the Control that produced them (per-field error).
87
+ - **Read-only session:** when `useSession()` reports `canEditData: false` (identified but unauthenticated claimed profile — VTEX refuses the write server-side), both checkboxes render disabled and each Control carries its `*-readonly` attribute (`data-fs-newsletter-opt-in-readonly`, `data-fs-save-personal-data-opt-in-readonly`), mirroring `EmailIdentificationControl`.
88
+
89
+ ---
90
+
91
+ ## Canonical schema example
92
+
93
+ ```json
94
+ {
95
+ "session": {
96
+ "type": "SessionRoot",
97
+ "children": ["client-preferences"]
98
+ },
99
+ "client-preferences": {
100
+ "type": "ClientPreferencesRoot",
101
+ "children": ["newsletter-opt-in", "save-data-opt-in"]
102
+ },
103
+ "newsletter-opt-in": {
104
+ "type": "NewsletterOptInControl",
105
+ "props": { "label": "Quero receber novidades e ofertas por e-mail" }
106
+ },
107
+ "save-data-opt-in": {
108
+ "type": "SavePersonalDataOptInControl",
109
+ "props": { "label": "Salvar minhas informações para a próxima compra" }
110
+ }
111
+ }
112
+ ```
113
+
114
+ ### Minimal variant (only the newsletter opt-in visible)
115
+
116
+ ```json
117
+ {
118
+ "session": {
119
+ "type": "SessionRoot",
120
+ "children": ["client-preferences"]
121
+ },
122
+ "client-preferences": {
123
+ "type": "ClientPreferencesRoot",
124
+ "children": ["newsletter-opt-in"]
125
+ },
126
+ "newsletter-opt-in": {
127
+ "type": "NewsletterOptInControl",
128
+ "props": { "label": "Sign me up for the newsletter" }
129
+ }
130
+ }
131
+ ```
132
+
133
+ ---
134
+
135
+ ## Common mistakes
136
+
137
+ - **Rendering a Control outside `ClientPreferencesRoot`.** Each Control reads the section context and throws otherwise.
138
+ - **Rendering `ClientPreferencesRoot` outside `SessionRoot`.** `useSession()` throws; every identity page must host a `SessionRoot`.
139
+ - **Inventing a `CheckboxField` particle.** The Controls deliberately inline `Field` + `Checkbox` + `Icon`; there is no `CheckboxField`.
140
+ - **Nesting one Control inside the other.** `NewsletterOptInControl` and `SavePersonalDataOptInControl` are siblings under one `ClientPreferencesRoot`, not parent/child.
141
+ - **Adding a second `ClientPreferencesRoot` for the second checkbox.** One Root owns both opt-ins; add the two Controls as siblings.
142
+ - **Defaulting to checked.** These are opt-ins — unchecked by default. A `null` preference is unchecked, not checked.
143
+
144
+ ---
145
+
146
+ ## Styling
147
+
148
+ `ClientPreferencesRoot` stacks the checkboxes; each Control is a checkbox-plus-label row. Read spacing and text color off the image.
149
+
150
+ | Component | What you style | Plausible classes |
151
+ |---|---|---|
152
+ | `ClientPreferencesRoot` | Stacks the opt-in rows | `flex flex-col gap-[8px]` |
153
+ | `NewsletterOptInControl` / `SavePersonalDataOptInControl` | The checkbox + label row | `flex items-center gap-[8px] text-[14px] text-[#333333]` |
154
+
155
+ Styled example:
156
+
157
+ ```json
158
+ {
159
+ "client-preferences": {
160
+ "type": "ClientPreferencesRoot",
161
+ "children": ["newsletter-opt-in", "save-data-opt-in"],
162
+ "style": ["flex", "flex-col", "gap-[8px]"]
163
+ },
164
+ "newsletter-opt-in": {
165
+ "type": "NewsletterOptInControl",
166
+ "props": { "label": "Quero receber novidades e ofertas por e-mail" },
167
+ "style": ["flex", "items-center", "gap-[8px]", "text-[14px]", "text-[#333333]"]
168
+ },
169
+ "save-data-opt-in": {
170
+ "type": "SavePersonalDataOptInControl",
171
+ "props": { "label": "Salvar minhas informações para a próxima compra" },
172
+ "style": ["flex", "items-center", "gap-[8px]", "text-[14px]", "text-[#333333]"]
173
+ }
174
+ }
175
+ ```
176
+
177
+ ---
178
+
179
+ ## Related
180
+
181
+ - [[email-identification]] — sibling identity control; reads/writes `clientProfile.email` and moves the session `anonymous → identified`. Same `SessionRoot` requirement.
182
+ - [[session]] — provides the identification tri-state and the required `SessionRoot` ancestor.
183
+ - [[checkbox]] — the presentational particle each Control wraps.
184
+ - [[field]] — provides the label/error wrapper each Control inlines.
@@ -0,0 +1,192 @@
1
+ # ClientProfileForm
2
+
3
+ **Category:** identity
4
+ **Purpose:** The batched customer-information form for the checkout identity step — the `InformationFormUSA` replacement. Pre-fills first/last name, phone, document, and both consent opt-ins from the shopper's saved profile and preferences; displays the email read-only. A single Save / Continue action validates the draft and dispatches at most one `clientProfileUpdate` and one `clientPreferencesUpdate`, each carrying only the fields the shopper edited, with pending/confirmation/error feedback.
5
+
6
+ ---
7
+
8
+ ## Visual cues (how to identify in an image)
9
+
10
+ - A single form block on a checkout identity step titled "Your information" (or similar), grouping: a read-only email display, first name, last name, a country-masked phone field, an optional tax-document field (e.g. CPF for Brazil), and two checkboxes ("email me with news and offers", "save my information for next time").
11
+ - One visible primary button at the bottom labelled "Save and continue" (or similar) — not a hidden submit.
12
+ - Pre-filled values for a returning/identified shopper; blank, still-editable fields for a guest or an incomplete profile.
13
+ - An inline error banner on failure, or a confirmation line on success, appearing near the button.
14
+
15
+ Use `ClientProfileForm` (not a hand-assembled combination of `Field`/`PhoneField`/`DocumentField`) whenever the image shows this whole batched-save customer-information block.
16
+
17
+ ---
18
+
19
+ ## When to use
20
+
21
+ - The customer-information section of the checkout identity step, for both returning/identified shoppers (pre-fill + edit) and guests (fill from empty).
22
+ - Anywhere name, phone, document, and consent opt-ins must be collected together and persisted in one explicit action.
23
+
24
+ ## When NOT to use
25
+
26
+ - Editing the email — that is `EmailIdentificationControl`'s job; this form only displays it.
27
+ - A single standalone phone or opt-in field with its own save-on-blur behavior — use `ClientProfilePhoneControl` / `NewsletterOptInControl` / `SavePersonalDataOptInControl` instead. **Never place a standalone per-field identity Control and this form for the same field on the same view** — both would write the field, racing each other.
28
+ - Address fields — those belong to Delivery, not this form.
29
+
30
+ ---
31
+
32
+ ## Composition
33
+
34
+ `ClientProfileForm` is a **compound**: `Root` owns the data + mechanics; the field/fieldset/feedback
35
+ parts are composed freely (any order, any subset). The schema author decides which fields render — a
36
+ merchant whose platform config drops a field (or whose account can't persist one, e.g. an unsupported
37
+ `savePersonalData`) simply does not compose that part.
38
+
39
+ ```
40
+ SessionRoot (required ancestor; session tri-state + canEditData)
41
+ └── ClientProfileForm.Root (data-fs-client-profile-form; own fragment/data root; owns draft + Save)
42
+ ├── ClientProfileForm.Fieldset section="profile" [legend]
43
+ │ ├── .EmailField (read-only)
44
+ │ ├── .FirstNameField / .LastNameField
45
+ │ ├── .PhoneField (uses country from Root)
46
+ │ └── .DocumentField (self-gates on documentType)
47
+ ├── ClientProfileForm.Fieldset section="preferences" [legend]
48
+ │ ├── .NewsletterCheckbox
49
+ │ └── .SavePersonalDataCheckbox (omit to drop the field entirely — no CSS hack)
50
+ ├── .Error / .Confirmation
51
+ └── .SubmitButton
52
+ ```
53
+
54
+ `Root` is self-contained: it declares the colocated fragment over `clientProfile` + `clientPreferences`
55
+ and must not be nested inside `ClientProfileRoot` / `ClientPreferencesRoot` (those self-persist per
56
+ field on blur, double-writing against this form's batched Save). Every part `requiresContext:
57
+ 'client-profile-form'`; a custom/derived field declares its own additional `requiresContext`.
58
+
59
+ ---
60
+
61
+ ## Behavior
62
+
63
+ - **Sections**: compose `ClientProfileForm.Fieldset` blocks with a `section` name → `data-fs-client-profile-form-section="<name>"`, and an optional `legend`. Not hard-coded — the author groups fields however the design needs.
64
+ - **Pre-fill**: every field seeds from `$data` on mount; missing profile fields render empty and stay editable.
65
+ - **Draft & dirty tracking**: edits are tracked locally per field; only touched fields are dispatched. Background `$data` refreshes re-seed untouched fields only — an in-progress edit is never clobbered.
66
+ - **Save**: validates **field format only** — phone mask and document check-digit, each blocking Save when the field is non-empty and malformed. It does not enforce requiredness: the parts are composed freely by the schema, so a required check here could fire for a field the page never mounted. Which fields a shopper must fill is a business rule, waiting on the composable entity forms RFC (#572) to decide where it belongs. The format checks carry the same composition hazard in a narrower form, and it is still open: they key off the Root's `country` and `documentType` rather than off which leaves were composed, so a store that sets `documentType` without composing `DocumentField` can block Save with no field to render the error in and nowhere to move focus. Closing it properly means the leaves registering themselves with the Root, which is that same RFC's territory. The phone case is wider than the document one and needs no merchant configuration at all — see Known gaps below. On Save it dispatches at most one `clientProfileUpdate` (dirty profile fields) and one `clientPreferencesUpdate` (dirty consent flags) in parallel; a Save with nothing dirty dispatches nothing and shows the confirmation, so the press still answers.
67
+ - **Document erase**: clearing a previously-saved document and pressing Save sends `document: ''` — an explicit erase, not an omission.
68
+ - **Feedback**: `data-fs-client-profile-form-pending` while a write is in flight (fieldset disabled, Save not re-triggerable); an inline `role="alert"` region on `userErrors`; an `<output>` confirmation on success, cleared on the next edit.
69
+ - **Read-only**: `session.canEditData === false` renders `data-fs-client-profile-form-readonly`, disables every field, and omits the Save button entirely.
70
+ - **The form announces nothing**: a completed Save shows the confirmation and stops there. It publishes no signal, so nothing elsewhere collapses, advances or reacts. Whether finishing this form should move a section or a wizard is a sequencing question, and the mechanism for it is being designed in the flow-of-steps RFC (#611) rather than assumed here.
71
+ - **The form never learns who listens.** It reports nothing at all, so `IdentityEditController` cannot react to it: that section moves only on its own buttons. Compose the swap around this form: an `IdentityEditController` holding an `IdentitySummaryView` with the summary, an `IdentityEditForm` with `ClientProfileForm.Root`, an `IdentityEditButton` in the heading, and an `IdentityEditCancelButton` as cancel next to the form. The same form therefore works unchanged inside a collapsing section or on a page of its own.
72
+
73
+ ---
74
+
75
+ ## Props
76
+
77
+ **`ClientProfileForm.Root`** — `country` (`'US' | 'BR'`, default `'US'`; provided to the phone leaf via
78
+ context), `documentType` (string, e.g. `'CPF'`; the document leaf renders only when supported).
79
+ Declares `actions: { identity: ['clientProfileUpdate', 'clientPreferencesUpdate'] }`,
80
+ `requiresContext: 'session'`, `providesContext: 'client-profile-form'`.
81
+
82
+ **`ClientProfileForm.Fieldset`** — `legend` (optional visible title), `section` (name → `data-fs-*-section`).
83
+
84
+ **Field parts** (`.EmailField`, `.FirstNameField`, `.LastNameField`, `.PhoneField`, `.DocumentField`,
85
+ `.NewsletterCheckbox`, `.SavePersonalDataCheckbox`) — each takes an optional `label` (sensible default).
86
+ **`.Confirmation`** — `message` (default `'Your information has been saved.'`). **`.SubmitButton`** —
87
+ `label` (default `'Save and continue'`) or composed `children`.
88
+
89
+ ---
90
+
91
+ ## Canonical schema example
92
+
93
+ ```json
94
+ {
95
+ "session": {
96
+ "type": "SessionRoot",
97
+ "children": ["email-identification", "profile-form"]
98
+ },
99
+ "email-identification": {
100
+ "type": "EmailIdentificationControl",
101
+ "children": []
102
+ },
103
+ "profile-form": {
104
+ "type": "ClientProfileFormRoot",
105
+ "props": { "country": "BR", "documentType": "CPF" },
106
+ "children": ["profile-fieldset", "preferences-fieldset", "form-error", "form-confirmation", "form-submit"]
107
+ },
108
+ "profile-fieldset": {
109
+ "type": "ClientProfileFormFieldset",
110
+ "props": { "section": "profile", "legend": "Your information" },
111
+ "children": ["email", "first-name", "last-name", "phone", "document"]
112
+ },
113
+ "email": { "type": "ClientProfileFormEmailField", "children": [] },
114
+ "first-name": { "type": "ClientProfileFormFirstNameField", "children": [] },
115
+ "last-name": { "type": "ClientProfileFormLastNameField", "children": [] },
116
+ "phone": { "type": "ClientProfileFormPhoneField", "children": [] },
117
+ "document": { "type": "ClientProfileFormDocumentField", "children": [] },
118
+ "preferences-fieldset": {
119
+ "type": "ClientProfileFormFieldset",
120
+ "props": { "section": "preferences" },
121
+ "children": ["newsletter"]
122
+ },
123
+ "newsletter": { "type": "ClientProfileFormNewsletterCheckbox", "children": [] },
124
+ "form-error": { "type": "ClientProfileFormError", "children": [] },
125
+ "form-confirmation": { "type": "ClientProfileFormConfirmation", "children": [] },
126
+ "form-submit": { "type": "ClientProfileFormSubmitButton", "children": [] }
127
+ }
128
+ ```
129
+
130
+ Both fieldsets are children of the Root, not siblings of it: every part declares
131
+ `requiresContext: 'client-profile-form'`, so a fieldset placed outside is rejected by the
132
+ context-constraint walk at build time.
133
+
134
+ (Omitting `ClientProfileFormSavePersonalDataCheckbox` above drops that field entirely — the intended
135
+ way to exclude a field the account can't persist, with no CSS hack and no shared-component change.)
136
+
137
+ ---
138
+
139
+ ## Common mistakes
140
+
141
+ - **Rendering `ClientProfileForm` outside `SessionRoot`.** `useSession()` throws; every identity page must host a `SessionRoot`.
142
+ - **Nesting it inside `ClientProfileRoot` / `ClientPreferencesRoot`, or placing a standalone Control for the same field alongside it.** The form is its own data root and its own write surface — double-nesting or double-placing creates a double-write race.
143
+ - **Expecting the email to be editable.** It is always read-only here; email changes go through `EmailIdentificationControl`.
144
+ - **Expecting per-keystroke or per-blur saves.** All fields are form-bound; only pressing Save dispatches a write.
145
+ - **Expecting the form to enforce required fields.** It validates format only. A blank field saves, because the form cannot know which of its freely-composed parts the page actually mounted.
146
+ - **Rendering a field part outside `ClientProfileForm.Root`.** Every part `requiresContext: 'client-profile-form'` and throws otherwise.
147
+
148
+ ---
149
+
150
+ ## Styling
151
+
152
+ | Component | What you style | Plausible classes |
153
+ |---|---|---|
154
+ | `ClientProfileForm` | The `data-fs-client-profile-form` root; carries `-pending`/`-readonly`/`-saved` presence attributes | `flex flex-col gap-10` |
155
+ | Section | `data-fs-client-profile-form-section="profile\|preferences"` — the two entity-anchored fieldsets | `flex flex-col gap-4` |
156
+ | Field wrapper | `data-fs-client-profile-form-field="email\|first-name\|last-name\|phone\|document\|newsletter\|save-personal-data"` | `flex flex-col gap-4` |
157
+ | Error / confirmation | `[data-fs-client-profile-form-error]` / `[data-fs-client-profile-form-confirmation]` | `text-sm text-red-600` / `text-sm text-green-600` |
158
+
159
+ Field-level visuals (borders, focus rings, error color) are owned by the composed particles' own swatches (`field`, `phone-field`, `document-field`, `checkbox`, `button`) and are not redefined here.
160
+
161
+ ---
162
+
163
+ ## Known gaps
164
+
165
+ Found by review and deliberately left for the dedicated revision of these components, rather than patched
166
+ here. The first is the widest.
167
+
168
+ - **Format validation runs against fields the page may never have composed, and the phone case needs no
169
+ merchant configuration at all.** `country` defaults to `'US'`, so the phone check always runs. A store
170
+ composing `Root` + name fields + `SubmitButton`, serving a shopper whose stored phone is a legacy
171
+ malformed value, gets a Save that sets `errors.phone`, finds no phone input to focus, renders no message
172
+ because `PhoneField` is not mounted, and returns — dead on every press, button still enabled. The
173
+ `documentType` variant of the same hole at least requires the merchant to have set a Root prop. Closing
174
+ both properly means the leaves registering themselves with the Root; see the composable entity forms RFC
175
+ (#572).
176
+ - **Two other early returns leave Save silent.** A missing `$actions.identity`, or a dirty field with no
177
+ matching write function, returns without touching `pending`, `serverError` or `saved` — the same dead
178
+ press the pristine branch above was changed to avoid.
179
+ - **`VALIDATION_ORDER` is a hard-coded `['phone', 'document']`,** but the leaves are now composed in any
180
+ order. With both fields malformed, focus jumps to the phone input even when the document error is the one
181
+ the shopper can see first. The order should come from DOM position now that the fixed template is gone.
182
+ - **The re-seed of untouched fields mutates a ref during render** and queues its `setDraft` in the same
183
+ pass. A discarded render keeps the ref but loses the update, so pristine fields can hold stale values
184
+ after `$data` arrives.
185
+
186
+ ## Related
187
+
188
+ - [[email-identification]] — the sibling identification control this form's email display defers to.
189
+ - [[client-profile]] — the standalone, per-field-blur phone binding; do not compose alongside this form for the same field.
190
+ - [[client-preferences]] — the standalone, per-field-blur consent Controls; do not compose alongside this form for the same field.
191
+ - [[session]] — provides the identification tri-state and the required `SessionRoot` ancestor.
192
+ - [[phone-field]], [[document-field]], [[field]], [[fieldset]], [[checkbox]] — the particles this matter composes directly.
@@ -0,0 +1,117 @@
1
+ # ClientProfile
2
+
3
+ **Category:** identity
4
+ **Purpose:** The shopper-profile section of a checkout User Identity step. `ClientProfileRoot` reads the `ClientProfile` sibling entity (`Query.clientProfile`) and publishes its fields to descendant Controls; `ClientProfilePhoneControl` binds a `PhoneField` to `clientProfile.phone`, pre-filling from the entity and persisting on blur via `$actions.identity.clientProfileUpdate`. The Root reads `useSession()` and must sit inside a `SessionRoot`.
5
+
6
+ ---
7
+
8
+ ## Visual cues (how to identify in an image)
9
+
10
+ - A shopper-profile block on a checkout identification step — today a single **phone number** field labelled "Phone" / "Telefone", masked per country (`(123) 456-7890` for US, `(11) 99999-9999` for BR).
11
+ - The value is pre-filled for a returning/identified shopper and editing it persists the new number to the profile.
12
+ - When invalid, an inline error appears below the input.
13
+
14
+ The image is the source of truth for layout. Use the `ClientProfile` Root + Control (not a bare `PhoneField`) whenever the phone must read from and write to the shopper profile.
15
+
16
+ ---
17
+
18
+ ## When to use
19
+
20
+ - The profile-fields section of the checkout User Identity flow.
21
+ - Anywhere the shopper's profile phone must be read (pre-fill) and written (persisted to `clientProfileData`).
22
+
23
+ ## When NOT to use
24
+
25
+ - A purely presentational phone input with host-owned state → use the `PhoneField` particle directly.
26
+ - The email identification field → use `EmailIdentificationControl`.
27
+ - Name / document / opt-in fields → out of scope (separate future Controls on the same Root).
28
+
29
+ ---
30
+
31
+ ## Composition
32
+
33
+ ```
34
+ SessionRoot (provides the session tri-state; required ancestor)
35
+ └── ClientProfileRoot (data-fs-client-profile-root; provides context 'client-profile')
36
+ └── ClientProfilePhoneControl (bound phone field; requires context 'client-profile')
37
+ ```
38
+
39
+ - `ClientProfileRoot` **must** have a `SessionRoot` ancestor — `useSession()` throws otherwise.
40
+ - `ClientProfilePhoneControl` **must** be a descendant of `ClientProfileRoot` — it throws otherwise.
41
+ - Child order reflects visual order. Future profile Controls are siblings of `ClientProfilePhoneControl` under the same Root.
42
+
43
+ ---
44
+
45
+ ## Components
46
+
47
+ ### ClientProfileRoot
48
+
49
+ Section provider. Declares a colocated reactive fragment `ClientProfilePhoneData on Query { clientProfile { phone } }` (`fetchStrategy: 'reactive'`) — the compiler merges it into the page query, no explicit `dataSources` entry needed. Seeds the profile values and publishes the `client-profile` context.
50
+
51
+ No props (the `$data` slice and `className` are injected / host-supplied, not authored in schema).
52
+
53
+ ### ClientProfilePhoneControl
54
+
55
+ Binds the reusable `PhoneField` particle to the profile. Reads the saved phone from context; on a **changed, client-valid** value persists only `phone` through `$actions.identity.clientProfileUpdate({ phone })` on blur (pessimistic — awaits the mutation). The field is disabled while the write is in flight and server `userErrors` surface inline.
56
+
57
+ | Prop | Type | Default | Notes |
58
+ |------|------|---------|-------|
59
+ | `label` | string | `'Phone'` | Visible field label. |
60
+ | `country` | `'US' \| 'BR'` | `'US'` | Selects the phone mask and validation rule. |
61
+ | `requirement` | `'mandatory' \| 'optional' \| 'hidden'` | `'mandatory'` | Controls visibility and required validation. |
62
+ | `errorInvalid` | string | `'Invalid phone number'` | Inline error for an invalid format. |
63
+ | `errorRequired` | string | `'Phone number is required'` | Inline error when a mandatory field is empty. |
64
+ | `$actions` | injected | — | Carries `identity.clientProfileUpdate` (compiler-injected). |
65
+
66
+ **Write:** declares `actions: { identity: ['clientProfileUpdate'] }`. No write when the value is unchanged, empty-and-mandatory, or client-side invalid.
67
+
68
+ ---
69
+
70
+ ## Canonical schema example
71
+
72
+ ```json
73
+ {
74
+ "type": "SessionRoot",
75
+ "children": [
76
+ {
77
+ "type": "ClientProfileRoot",
78
+ "children": [
79
+ {
80
+ "type": "ClientProfilePhoneControl",
81
+ "props": {
82
+ "label": "Phone",
83
+ "country": "US",
84
+ "requirement": "mandatory"
85
+ }
86
+ }
87
+ ]
88
+ }
89
+ ]
90
+ }
91
+ ```
92
+
93
+ ---
94
+
95
+ ## Common mistakes
96
+
97
+ - **Rendering `ClientProfileRoot` outside `SessionRoot`.** `useSession()` throws; every identity page must host a `SessionRoot`.
98
+ - **Using a bare `PhoneField` for the profile phone.** The correct binding is `ClientProfilePhoneControl`, which reads and writes `clientProfile.phone`.
99
+ - **Putting `ClientProfilePhoneControl` outside `ClientProfileRoot`.** It must be a descendant; the context throws otherwise.
100
+ - **Expecting the write on every keystroke.** The persist runs on blur, only for a changed and valid value.
101
+
102
+ ---
103
+
104
+ ## Styling
105
+
106
+ | Component | What you style | Plausible classes |
107
+ |---|---|---|
108
+ | `ClientProfileRoot` | Stacks the profile fields | `flex flex-col gap-4` |
109
+ | `ClientProfilePhoneControl` | The control wrapper (`data-fs-client-profile-phone-control`, receives `className`; carries `data-fs-client-profile-phone-pending` while the write is in flight and `data-fs-client-profile-phone-readonly` when the session's `canEditData` is false); target the inner `data-fs-phone-field-*` attributes | `flex flex-col gap-1 [&_[data-fs-phone-field-input]]:border [&_[data-fs-phone-field-input]]:rounded-md [&_[data-fs-phone-field-input]]:px-3 [&_[data-fs-phone-field-input]]:py-2 [&_[data-fs-phone-field-error]]:text-xs [&_[data-fs-phone-field-error]]:text-red-500` |
110
+
111
+ ---
112
+
113
+ ## Related
114
+
115
+ - [[phone-field]] — the presentational particle this binds to the shopper `ClientProfile`.
116
+ - [[email-identification]] — the sibling identity control that binds the email and flips `Session.isIdentified`.
117
+ - [[session]] — provides the identification tri-state and the required `SessionRoot` ancestor.
@@ -0,0 +1,97 @@
1
+ # Container
2
+
3
+ **Category:** layout
4
+ **Purpose:** Generic layout wrapper. Centers its content and applies a responsive max-width. Has no commerce data of its own — it groups other blocks (gallery, product info, pricing, buy button) into a page section.
5
+
6
+ ---
7
+
8
+ ## Visual cues (how to identify in an image)
9
+
10
+ Container is a layout primitive, not a visible widget — you rarely "see" it directly. Infer one when the image shows several blocks sharing a centered column with consistent side margins. The image is the source of truth for layout.
11
+
12
+ Reach for `Container` when:
13
+
14
+ - The page content sits in a **centered column** with empty gutters on both sides, rather than spanning edge to edge.
15
+ - Multiple distinct blocks (gallery, title, price, CTA) are **visually grouped** inside that column.
16
+
17
+ Do not add a `Container` for a single isolated element that needs no grouping.
18
+
19
+ ---
20
+
21
+ ## When to use
22
+
23
+ - As the layout wrapper that holds the main blocks of a PDP (gallery, product info, pricing, buy button) inside one centered column.
24
+ - Any time several sibling blocks need to share the same max-width and centering.
25
+
26
+ ## When NOT to use
27
+
28
+ - As the cart data provider — that is `CartRoot`. `Container` carries no cart context.
29
+ - As a styled box with custom padding/background unrelated to the centered-column layout — use a plain element with a class instead.
30
+ - To wrap a single element that already lays out fine on its own — extra nesting only bloats the schema.
31
+
32
+ ---
33
+
34
+ ## Composition
35
+
36
+ `Container` is a passthrough wrapper: it renders a `<div>` and places its children inside. It has no required parent and no required children — anything valid in the schema can be a child. On a PDP it typically sits just under `CartRoot` and groups the page's main blocks.
37
+
38
+ ```
39
+ CartRoot
40
+ └── Container
41
+ ├── ProductGalleryRoot
42
+ ├── ProductInformationRoot
43
+ ├── PricingRoot
44
+ └── BuyButtonRoot
45
+ ```
46
+
47
+ Children are siblings sharing the same `children` array; child order reflects visual order. `Container` does not provide any data context, so cart-aware blocks (`BuyButtonRoot`, cart particles) still need a `CartRoot` ancestor above it.
48
+
49
+ ---
50
+
51
+ ## Components
52
+
53
+ ### Container
54
+
55
+ Centered, max-width layout wrapper. No props — it accepts only standard `<div>` attributes (e.g. `className`).
56
+
57
+ ---
58
+
59
+ ## Canonical schema example
60
+
61
+ `Container` grouping the main PDP blocks under a page-level `CartRoot`:
62
+
63
+ ```json
64
+ {
65
+ "root": { "type": "CartRoot", "children": ["layout"] },
66
+ "layout": {
67
+ "type": "Container",
68
+ "children": ["gallery", "product-info", "pricing", "buy-button"]
69
+ },
70
+ "gallery": { "type": "ProductGalleryRoot" },
71
+ "product-info": { "type": "ProductInformationRoot", "children": ["title", "description"] },
72
+ "title": { "type": "ProductInformationTitle" },
73
+ "description": { "type": "ProductInformationDescription" },
74
+ "pricing": { "type": "PricingRoot", "children": ["pricing-selling"] },
75
+ "pricing-selling": { "type": "PricingSellingPrice" },
76
+ "buy-button": { "type": "BuyButtonRoot", "children": ["buy-button-action"] },
77
+ "buy-button-action": { "type": "BuyButtonButton" }
78
+ }
79
+ ```
80
+
81
+ ---
82
+
83
+ ## Common mistakes
84
+
85
+ - **Using `Container` as the page root on a PDP with a buy button.** The root must be `CartRoot` so cart-aware blocks have their context; `Container` goes underneath it.
86
+ - **Expecting `Container` to provide product or cart data.** It is a pure layout `<div>` — data comes from `CartRoot`, `PricingRoot`, etc.
87
+ - **Inventing `Section`, `Box`, `Wrapper`, or `Layout`.** The layout primitive is `Container`.
88
+ - **Nesting a `Container` for every block.** One `Container` grouping the sibling blocks is enough; per-block wrappers add depth without purpose.
89
+
90
+ ---
91
+
92
+ ## Related
93
+
94
+ - [[cart]] — `CartRoot`, the page-level data provider that usually wraps `Container` on a PDP.
95
+ - [[buy-button]] — purchase CTA placed as a child block inside `Container`; requires the `CartRoot` ancestor.
96
+ - [[pricing]] — price block placed as a sibling inside `Container`.
97
+ - [[product-information]] — title/description block placed as a sibling inside `Container`.