@vtex/faststore 0.0.4 → 0.0.6

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 (306) hide show
  1. package/CHANGELOG.md +67 -0
  2. package/dist/actions.json +181 -0
  3. package/dist/catalog.json +1595 -481
  4. package/dist/client.d.ts +2 -1
  5. package/dist/client.js +2 -1
  6. package/dist/components.d.ts +31 -7
  7. package/dist/components.js +35 -13
  8. package/dist/content-types.json +73 -0
  9. package/dist/docs/access-code-sign-in.md +1 -1
  10. package/dist/docs/account-access-gate.md +153 -0
  11. package/dist/docs/account-entry-point.md +1 -2
  12. package/dist/docs/account-menu.md +164 -0
  13. package/dist/docs/address-summary.md +24 -3
  14. package/dist/docs/alert-dialog.md +204 -0
  15. package/dist/docs/billing-address.md +284 -0
  16. package/dist/docs/buy-button.md +1 -1
  17. package/dist/docs/card-entry.md +250 -0
  18. package/dist/docs/cardholder-document.md +142 -0
  19. package/dist/docs/cart.md +1 -1
  20. package/dist/docs/client-preferences-fieldset.md +148 -0
  21. package/dist/docs/client-preferences.md +2 -1
  22. package/dist/docs/client-profile-fieldset.md +184 -0
  23. package/dist/docs/client-profile.md +1 -1
  24. package/dist/docs/document-field.md +58 -4
  25. package/dist/docs/field.md +317 -0
  26. package/dist/docs/form.md +307 -0
  27. package/dist/docs/identity-edit.md +6 -6
  28. package/dist/docs/identity-summary.md +5 -5
  29. package/dist/docs/installments.md +248 -0
  30. package/dist/docs/my-account-profile.md +1 -0
  31. package/dist/docs/order-placed-payment-summary.md +138 -0
  32. package/dist/docs/payment-method-badges.md +232 -0
  33. package/dist/docs/payment-methods.md +1 -0
  34. package/dist/docs/payment.md +218 -0
  35. package/dist/docs/phone-field.md +58 -4
  36. package/dist/docs/place-order.md +157 -0
  37. package/dist/docs/save-card.md +186 -0
  38. package/dist/docs/saved-cards.md +218 -0
  39. package/dist/docs/select.md +465 -0
  40. package/dist/docs/session.md +1 -1
  41. package/dist/docs/shipping-address.md +110 -258
  42. package/dist/docs/sign-in-redirect.md +1 -1
  43. package/dist/index.d.ts +4 -1
  44. package/dist/internal/client.d.ts +3 -1
  45. package/dist/internal/client.js +3 -1
  46. package/dist/matter/access-code-sign-in/access-code-sign-in.js +9 -8
  47. package/dist/matter/access-code-sign-in/access-code-sign-in.js.map +1 -1
  48. package/dist/matter/account-access-gate/account-access-gate.d.ts +86 -0
  49. package/dist/matter/account-access-gate/account-access-gate.js +283 -0
  50. package/dist/matter/account-access-gate/account-access-gate.js.map +1 -0
  51. package/dist/matter/account-access-gate/sign-out-intent.d.ts +17 -0
  52. package/dist/matter/account-access-gate/sign-out-intent.js +62 -0
  53. package/dist/matter/account-access-gate/sign-out-intent.js.map +1 -0
  54. package/dist/matter/account-entry-point/account-entry-point.js +2 -2
  55. package/dist/matter/account-entry-point/account-entry-point.js.map +1 -1
  56. package/dist/matter/account-menu/account-menu.d.ts +88 -0
  57. package/dist/matter/account-menu/account-menu.js +246 -0
  58. package/dist/matter/account-menu/account-menu.js.map +1 -0
  59. package/dist/matter/billing-address/billing-address.d.ts +165 -0
  60. package/dist/matter/billing-address/billing-address.js +408 -0
  61. package/dist/matter/billing-address/billing-address.js.map +1 -0
  62. package/dist/matter/card-entry/card-capture.d.ts +25 -0
  63. package/dist/matter/card-entry/card-capture.js +25 -0
  64. package/dist/matter/card-entry/card-capture.js.map +1 -0
  65. package/dist/matter/card-entry/card-entry.d.ts +120 -0
  66. package/dist/matter/card-entry/card-entry.js +832 -0
  67. package/dist/matter/card-entry/card-entry.js.map +1 -0
  68. package/dist/matter/cardholder-document/cardholder-document.d.ts +45 -0
  69. package/dist/matter/cardholder-document/cardholder-document.js +70 -0
  70. package/dist/matter/cardholder-document/cardholder-document.js.map +1 -0
  71. package/dist/matter/cart/cart.d.ts +1 -1
  72. package/dist/matter/cart/cart.js +2 -2
  73. package/dist/matter/cart/cart.js.map +1 -1
  74. package/dist/matter/client-preferences/client-preferences-fieldset.d.ts +77 -0
  75. package/dist/matter/client-preferences/client-preferences-fieldset.js +299 -0
  76. package/dist/matter/client-preferences/client-preferences-fieldset.js.map +1 -0
  77. package/dist/matter/client-preferences/client-preferences.d.ts +3 -5
  78. package/dist/matter/client-preferences/client-preferences.js +6 -6
  79. package/dist/matter/client-preferences/client-preferences.js.map +1 -1
  80. package/dist/matter/client-profile/client-profile.d.ts +4 -6
  81. package/dist/matter/client-profile/client-profile.js +9 -6
  82. package/dist/matter/client-profile/client-profile.js.map +1 -1
  83. package/dist/matter/client-profile-form/client-profile-fieldset.d.ts +119 -0
  84. package/dist/matter/client-profile-form/client-profile-fieldset.js +488 -0
  85. package/dist/matter/client-profile-form/client-profile-fieldset.js.map +1 -0
  86. package/dist/matter/delivery-options/delivery-options.js.map +1 -1
  87. package/dist/matter/identity-edit/identity-edit.js +2 -2
  88. package/dist/matter/identity-edit/identity-edit.js.map +1 -1
  89. package/dist/matter/identity-summary/identity-summary.js +2 -2
  90. package/dist/matter/identity-summary/identity-summary.js.map +1 -1
  91. package/dist/matter/installments/installments-select.d.ts +42 -0
  92. package/dist/matter/installments/installments-select.js +167 -0
  93. package/dist/matter/installments/installments-select.js.map +1 -0
  94. package/dist/matter/installments/installments.d.ts +58 -0
  95. package/dist/matter/installments/installments.js +176 -0
  96. package/dist/matter/installments/installments.js.map +1 -0
  97. package/dist/matter/installments/use-installments-selection.d.ts +29 -0
  98. package/dist/matter/installments/use-installments-selection.js +95 -0
  99. package/dist/matter/installments/use-installments-selection.js.map +1 -0
  100. package/dist/matter/my-account-profile/my-account-profile.js +5 -5
  101. package/dist/matter/my-account-profile/my-account-profile.js.map +1 -1
  102. package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.d.ts +63 -0
  103. package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.js +305 -0
  104. package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.js.map +1 -0
  105. package/dist/matter/payment/payment-card-capture.d.ts +19 -0
  106. package/dist/matter/payment/payment-card-capture.js +129 -0
  107. package/dist/matter/payment/payment-card-capture.js.map +1 -0
  108. package/dist/matter/payment/payment-controller.d.ts +24 -0
  109. package/dist/matter/payment/payment-controller.js +107 -0
  110. package/dist/matter/payment/payment-controller.js.map +1 -0
  111. package/dist/matter/payment/payment-method-badges.d.ts +57 -0
  112. package/dist/matter/payment/payment-method-badges.js +192 -0
  113. package/dist/matter/payment/payment-method-badges.js.map +1 -0
  114. package/dist/matter/payment/payment.d.ts +89 -0
  115. package/dist/matter/payment/payment.js +263 -0
  116. package/dist/matter/payment/payment.js.map +1 -0
  117. package/dist/matter/payment/use-payment-method-selection.d.ts +302 -0
  118. package/dist/matter/payment/use-payment-method-selection.js +458 -0
  119. package/dist/matter/payment/use-payment-method-selection.js.map +1 -0
  120. package/dist/matter/payment/use-payment-submit-gate.d.ts +111 -0
  121. package/dist/matter/payment/use-payment-submit-gate.js +144 -0
  122. package/dist/matter/payment/use-payment-submit-gate.js.map +1 -0
  123. package/dist/matter/place-order/place-order.d.ts +74 -0
  124. package/dist/matter/place-order/place-order.js +379 -0
  125. package/dist/matter/place-order/place-order.js.map +1 -0
  126. package/dist/matter/product-list/product-list.d.ts +1 -0
  127. package/dist/matter/product-list/product-list.js.map +1 -1
  128. package/dist/matter/product-shelf/product-shelf.d.ts +1 -0
  129. package/dist/matter/product-shelf/product-shelf.js +2 -0
  130. package/dist/matter/product-shelf/product-shelf.js.map +1 -1
  131. package/dist/matter/region/region.js +1 -1
  132. package/dist/matter/region/region.js.map +1 -1
  133. package/dist/matter/save-card/save-card.d.ts +49 -0
  134. package/dist/matter/save-card/save-card.js +188 -0
  135. package/dist/matter/save-card/save-card.js.map +1 -0
  136. package/dist/matter/saved-cards/saved-cards.d.ts +79 -0
  137. package/dist/matter/saved-cards/saved-cards.js +387 -0
  138. package/dist/matter/saved-cards/saved-cards.js.map +1 -0
  139. package/dist/matter/shipping-address/country-descriptors.js +20 -10
  140. package/dist/matter/shipping-address/country-descriptors.js.map +1 -1
  141. package/dist/matter/shipping-address/shipping-address.d.ts +113 -174
  142. package/dist/matter/shipping-address/shipping-address.js +481 -792
  143. package/dist/matter/shipping-address/shipping-address.js.map +1 -1
  144. package/dist/matter/shipping-simulator/shipping-simulator.js.map +1 -1
  145. package/dist/matter/variant-selector/variant-selector.js +1 -1
  146. package/dist/particles/address-summary/address-summary.d.ts +24 -0
  147. package/dist/particles/address-summary/address-summary.js +83 -2
  148. package/dist/particles/address-summary/address-summary.js.map +1 -1
  149. package/dist/particles/alert-dialog/alert-dialog.d.ts +68 -0
  150. package/dist/particles/alert-dialog/alert-dialog.js +187 -0
  151. package/dist/particles/alert-dialog/alert-dialog.js.map +1 -0
  152. package/dist/particles/checkbox/checkbox.d.ts +7 -3
  153. package/dist/particles/checkbox/checkbox.js +4 -1
  154. package/dist/particles/checkbox/checkbox.js.map +1 -1
  155. package/dist/particles/document-field/document-field.d.ts +48 -5
  156. package/dist/particles/document-field/document-field.js +189 -32
  157. package/dist/particles/document-field/document-field.js.map +1 -1
  158. package/dist/particles/field/bound-field-registry.js +52 -0
  159. package/dist/particles/field/bound-field-registry.js.map +1 -0
  160. package/dist/particles/field/field.d.ts +116 -0
  161. package/dist/particles/field/field.js +497 -6
  162. package/dist/particles/field/field.js.map +1 -1
  163. package/dist/particles/fieldset/fieldset.js +2 -2
  164. package/dist/particles/fieldset/fieldset.js.map +1 -1
  165. package/dist/particles/footer-social/footer-social.js +1 -1
  166. package/dist/particles/form/form.d.ts +104 -0
  167. package/dist/particles/form/form.js +485 -0
  168. package/dist/particles/form/form.js.map +1 -0
  169. package/dist/particles/incentives/incentives.js +1 -1
  170. package/dist/particles/phone-field/phone-field.d.ts +38 -10
  171. package/dist/particles/phone-field/phone-field.js +183 -39
  172. package/dist/particles/phone-field/phone-field.js.map +1 -1
  173. package/dist/particles/postal-code-field/postal-code-field.js +2 -2
  174. package/dist/particles/postal-code-field/postal-code-field.js.map +1 -1
  175. package/dist/particles/select/field-select.d.ts +43 -0
  176. package/dist/particles/select/field-select.js +150 -0
  177. package/dist/particles/select/field-select.js.map +1 -0
  178. package/dist/particles/select/select.d.ts +2 -0
  179. package/dist/particles/select/select.js.map +1 -1
  180. package/dist/particles/shared/compose-refs.js +21 -0
  181. package/dist/particles/shared/compose-refs.js.map +1 -0
  182. package/dist/schema.graphql +701 -2
  183. package/dist/sdk/actions/analytics-action-provider.d.ts +15 -0
  184. package/dist/sdk/actions/analytics-action-provider.js +19 -0
  185. package/dist/sdk/actions/analytics-action-provider.js.map +1 -0
  186. package/dist/sdk/actions/cart-action-provider.d.ts +1 -1
  187. package/dist/sdk/actions/cart-action-provider.js +1 -1
  188. package/dist/sdk/actions/cart-action-provider.js.map +1 -1
  189. package/dist/sdk/actions/index.d.ts +3 -1
  190. package/dist/sdk/actions/index.js +3 -1
  191. package/dist/sdk/actions/payment-action-provider.d.ts +22 -0
  192. package/dist/sdk/actions/payment-action-provider.js +26 -0
  193. package/dist/sdk/actions/payment-action-provider.js.map +1 -0
  194. package/dist/sdk/actions/session-action-provider.d.ts +1 -1
  195. package/dist/sdk/actions/session-action-provider.js +1 -1
  196. package/dist/sdk/actions/session-action-provider.js.map +1 -1
  197. package/dist/sdk/actions/shipping-action-provider.d.ts +1 -1
  198. package/dist/sdk/actions/shipping-action-provider.js +1 -1
  199. package/dist/sdk/actions/shipping-action-provider.js.map +1 -1
  200. package/dist/sdk/actions/types.d.ts +6 -2
  201. package/dist/sdk/analytics/analytics-destination.d.ts +43 -0
  202. package/dist/sdk/analytics/analytics-destination.js +90 -0
  203. package/dist/sdk/analytics/analytics-destination.js.map +1 -0
  204. package/dist/sdk/analytics/use-analytics-actions.d.ts +57 -0
  205. package/dist/sdk/analytics/use-analytics-actions.js +108 -0
  206. package/dist/sdk/analytics/use-analytics-actions.js.map +1 -0
  207. package/dist/sdk/cache/storefront-cache.js +1 -1
  208. package/dist/sdk/cache/storefront-cache.js.map +1 -1
  209. package/dist/sdk/cart/operations.d.ts +4 -4
  210. package/dist/sdk/cart/operations.js +1 -1
  211. package/dist/sdk/cart/operations.js.map +1 -1
  212. package/dist/sdk/cart/optimistic.js +1 -1
  213. package/dist/sdk/cart/optimistic.js.map +1 -1
  214. package/dist/sdk/cart/use-cart-actions.d.ts +1 -1
  215. package/dist/sdk/cart/use-cart-actions.js +4 -4
  216. package/dist/sdk/cart/use-cart-actions.js.map +1 -1
  217. package/dist/sdk/cart/use-cart-validate-on-open.js +1 -1
  218. package/dist/sdk/cart/use-cart-validate-on-open.js.map +1 -1
  219. package/dist/sdk/cart/write-gate.js +1 -1
  220. package/dist/sdk/cart/write-gate.js.map +1 -1
  221. package/dist/sdk/data/entity-resolution-context.js +31 -0
  222. package/dist/sdk/data/entity-resolution-context.js.map +1 -0
  223. package/dist/sdk/data/entity-subscriber.js +18 -8
  224. package/dist/sdk/data/entity-subscriber.js.map +1 -1
  225. package/dist/sdk/data/index.js +1 -0
  226. package/dist/sdk/data/page-reactive-data-root.d.ts +38 -2
  227. package/dist/sdk/data/page-reactive-data-root.js +4 -2
  228. package/dist/sdk/data/page-reactive-data-root.js.map +1 -1
  229. package/dist/sdk/data/reactive-data-provider.d.ts +1 -1
  230. package/dist/sdk/data/reactive-data-provider.js +8 -4
  231. package/dist/sdk/data/reactive-data-provider.js.map +1 -1
  232. package/dist/sdk/data/reactive-list-item-data-provider.d.ts +1 -1
  233. package/dist/sdk/data/reactive-list-item-data-provider.js +13 -5
  234. package/dist/sdk/data/reactive-list-item-data-provider.js.map +1 -1
  235. package/dist/sdk/data/use-reactive-data-settled.js +39 -0
  236. package/dist/sdk/data/use-reactive-data-settled.js.map +1 -0
  237. package/dist/sdk/data/use-reactive-entity.js +6 -2
  238. package/dist/sdk/data/use-reactive-entity.js.map +1 -1
  239. package/dist/sdk/generated/fragment-types.js +2 -0
  240. package/dist/sdk/generated/fragment-types.js.map +1 -1
  241. package/dist/sdk/generated/gql.js +2 -1
  242. package/dist/sdk/generated/gql.js.map +1 -1
  243. package/dist/sdk/generated/graphql.js +85 -1
  244. package/dist/sdk/generated/graphql.js.map +1 -1
  245. package/dist/sdk/i18n/messages/en-US.js +3 -0
  246. package/dist/sdk/i18n/messages/en-US.json +3 -0
  247. package/dist/sdk/i18n/messages/en-US.json.d.ts +3 -0
  248. package/dist/sdk/i18n/messages/es-ES.js +3 -0
  249. package/dist/sdk/i18n/messages/es-ES.json +3 -0
  250. package/dist/sdk/i18n/messages/pt-BR.js +3 -0
  251. package/dist/sdk/i18n/messages/pt-BR.json +3 -0
  252. package/dist/sdk/identity/operations.js.map +1 -1
  253. package/dist/sdk/identity/use-identity-actions.d.ts +1 -1
  254. package/dist/sdk/identity/use-identity-actions.js +3 -2
  255. package/dist/sdk/identity/use-identity-actions.js.map +1 -1
  256. package/dist/sdk/payment/gateway-origin.js +35 -0
  257. package/dist/sdk/payment/gateway-origin.js.map +1 -0
  258. package/dist/sdk/payment/gateway.d.ts +85 -0
  259. package/dist/sdk/payment/gateway.js +183 -0
  260. package/dist/sdk/payment/gateway.js.map +1 -0
  261. package/dist/sdk/payment/operations.d.ts +52 -0
  262. package/dist/sdk/payment/operations.js +223 -0
  263. package/dist/sdk/payment/operations.js.map +1 -0
  264. package/dist/sdk/payment/security-code-mask.js +71 -0
  265. package/dist/sdk/payment/security-code-mask.js.map +1 -0
  266. package/dist/sdk/payment/submission-registry.d.ts +33 -0
  267. package/dist/sdk/payment/submission-registry.js +58 -0
  268. package/dist/sdk/payment/submission-registry.js.map +1 -0
  269. package/dist/sdk/payment/use-payment-actions.d.ts +78 -0
  270. package/dist/sdk/payment/use-payment-actions.js +276 -0
  271. package/dist/sdk/payment/use-payment-actions.js.map +1 -0
  272. package/dist/sdk/payment/use-place-order.d.ts +65 -0
  273. package/dist/sdk/payment/use-place-order.js +640 -0
  274. package/dist/sdk/payment/use-place-order.js.map +1 -0
  275. package/dist/sdk/session/auth-operations.d.ts +1 -1
  276. package/dist/sdk/session/auth-operations.js.map +1 -1
  277. package/dist/sdk/session/use-session-actions.d.ts +1 -1
  278. package/dist/sdk/session/use-session-actions.js.map +1 -1
  279. package/dist/sdk/session/use-session-revalidation.js +65 -0
  280. package/dist/sdk/session/use-session-revalidation.js.map +1 -0
  281. package/dist/sdk/shipping/option-select-operations.d.ts +1 -1
  282. package/dist/sdk/shipping/option-select-operations.js.map +1 -1
  283. package/dist/sdk/shipping/request-timeout.js +1 -1
  284. package/dist/sdk/shipping/request-timeout.js.map +1 -1
  285. package/dist/sdk/shipping/shipping-operations.d.ts +1 -1
  286. package/dist/sdk/shipping/shipping-operations.js.map +1 -1
  287. package/dist/sdk/shipping/use-shipping-actions.d.ts +2 -2
  288. package/dist/sdk/shipping/use-shipping-actions.js +1 -1
  289. package/dist/sdk/shipping/use-shipping-actions.js.map +1 -1
  290. package/dist/sdk/state/cart.d.ts +3 -4
  291. package/dist/sdk/state/cart.js +6 -7
  292. package/dist/sdk/state/cart.js.map +1 -1
  293. package/dist/utils/loggable-error-name.js +49 -0
  294. package/dist/utils/loggable-error-name.js.map +1 -0
  295. package/dist/utils/resolve-authored-copy.js +18 -0
  296. package/dist/utils/resolve-authored-copy.js.map +1 -0
  297. package/dist/utils/safe-href.js +3 -3
  298. package/dist/utils/safe-href.js.map +1 -1
  299. package/dist/utils/substitute-template.js +33 -0
  300. package/dist/utils/substitute-template.js.map +1 -0
  301. package/package.json +2 -1
  302. package/src/styles/tailwind.css +34 -0
  303. package/dist/docs/client-profile-form.md +0 -192
  304. package/dist/matter/client-profile-form/client-profile-form.d.ts +0 -126
  305. package/dist/matter/client-profile-form/client-profile-form.js +0 -662
  306. package/dist/matter/client-profile-form/client-profile-form.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"country-descriptors.js","names":[],"sources":["../../../src/matter/shipping-address/country-descriptors.ts"],"sourcesContent":["/**\n * Country-adaptive shipping address form descriptors.\n *\n * Each descriptor declares the form shape (field set, order, and labels) for a specific country.\n * Descriptors are data only: no validation metadata, no required flags, no format patterns.\n * Country adaptation is data-driven; adding a country is a data-only change (a new descriptor entry).\n *\n * Canonical field names must be shared/consistent across descriptors for fields both countries have\n * (recipientName, postalCode, street, number, complement, city, state), so that switching countries\n * preserves shared field values in the batched draft state (Decision 1/Invariant).\n *\n * Per Decision 2, this narrows the RFC's descriptor scope to form shape only: the only client-enforced\n * content rule is the non-blank recipient name. Postal-code format, per-country required enforcement,\n * and per-field blur validation are deferred to VTEX (v1 surfaces rejections as UPSTREAM_ERROR) and\n * a future @vtex/country-forms adoption.\n */\n\n/**\n * Describes a single form field within a country descriptor.\n *\n * @property name - Canonical field name (e.g., \"recipientName\", \"street\", \"neighborhood\").\n * Shared field names across descriptors enable draft state preservation on country switch.\n * @property label - Human-readable label for the field. Named `label` (not a key) to allow future\n * swapping with i18n keys once the codebase adopts an i18n layer.\n */\nexport type FieldDescriptor = Readonly<{\n name: string;\n label: string;\n}>;\n\n/**\n * Describes the form shape for a single country.\n *\n * @property iso - ISO 3166-1 alpha-3 country code (e.g., \"BRA\", \"USA\"). Must be a valid 3-letter code\n * matching the Address.country field type (plain String!, ISO alpha-3 by convention).\n * @property label - Human-readable country name for the country selector (e.g., \"Brazil\", \"United States\").\n * Named `label` (not a key) to allow future swapping with i18n keys.\n * @property fields - Ordered field set for this country. Order defines the visual order in the form.\n * Only fields this country uses are listed; absent fields are not rendered.\n */\nexport type CountryDescriptor = Readonly<{\n iso: string;\n label: string;\n fields: readonly FieldDescriptor[];\n}>;\n\n/**\n * Brazil (BRA) address form descriptor.\n *\n * Field order:\n * 1. recipientName — recipient of the package\n * 2. street — street name\n * 3. number — street number\n * 4. complement — apartment, suite, etc. (optional per GraphQL but no form-level validation)\n * 5. neighborhood — bairro (BR-specific, not in US form)\n * 6. city — city name\n * 7. state — state/UF code (canonical name shared with US, though US calls it state abbreviation)\n * 8. postalCode — CEP format (validation deferred to VTEX in v1)\n */\nconst brDescriptor: CountryDescriptor = {\n iso: 'BRA',\n label: 'Brasil',\n fields: [\n { name: 'recipientName', label: 'nome do destinatário' },\n { name: 'street', label: 'rua' },\n { name: 'number', label: 'número' },\n { name: 'complement', label: 'complemento (opcional)' },\n { name: 'neighborhood', label: 'bairro' },\n { name: 'city', label: 'cidade' },\n { name: 'state', label: 'estado' },\n { name: 'postalCode', label: 'cep' },\n ],\n};\n\n/**\n * United States (USA) address form descriptor.\n *\n * Field order:\n * 1. recipientName — recipient of the package\n * 2. street — street name\n * 3. number — street number\n * 4. complement — apartment, suite, etc. (optional per GraphQL but no form-level validation)\n * 5. city — city name\n * 6. state — state abbreviation (canonical name shared with BR for draft preservation)\n * 7. postalCode — ZIP/ZIP+4 format (validation deferred to VTEX in v1)\n *\n * Note: neighborhood is not included in the US v1 form. If the shopper switches from BR to US,\n * the neighborhood value is retained in the draft but hidden (descriptor controls visibility only);\n * switching back to BR resurfaces it.\n */\nconst usaDescriptor: CountryDescriptor = {\n iso: 'USA',\n label: 'Estados Unidos',\n fields: [\n { name: 'recipientName', label: 'nome do destinatário' },\n { name: 'street', label: 'rua' },\n { name: 'number', label: 'número' },\n { name: 'complement', label: 'complemento (opcional)' },\n { name: 'city', label: 'cidade' },\n { name: 'state', label: 'estado' },\n { name: 'postalCode', label: 'código postal' },\n ],\n};\n\n/**\n * All available country descriptors, keyed by ISO alpha-3 code.\n *\n * The country selector lists only countries with a descriptor; a descriptor-less country is unreachable.\n * Adding a country is a data-only change: add a new CountryDescriptor entry here.\n */\nexport const countryDescriptors: Readonly<Record<string, CountryDescriptor>> = {\n BRA: brDescriptor,\n USA: usaDescriptor,\n};\n\n/**\n * Returns an ordered list of available country ISO codes (those with a descriptor).\n *\n * @returns ISO alpha-3 codes of all implemented countries, in definition order.\n */\nexport function getAvailableCountries(): readonly string[] {\n return Object.keys(countryDescriptors);\n}\n\n/**\n * Retrieves the descriptor for a given country.\n *\n * @param iso - ISO 3166-1 alpha-3 country code (e.g., \"BRA\", \"USA\")\n * @returns The CountryDescriptor for the country, or undefined if not implemented.\n */\nexport function getCountryDescriptor(iso: string): CountryDescriptor | undefined {\n return countryDescriptors[iso];\n}\n"],"mappings":";;;;;;AA8GA,MAAa,qBAAkE;CAC7E,KAAK;EAnDL,KAAK;EACL,OAAO;EACP,QAAQ;GACN;IAAE,MAAM;IAAiB,OAAO;GAAuB;GACvD;IAAE,MAAM;IAAU,OAAO;GAAM;GAC/B;IAAE,MAAM;IAAU,OAAO;GAAS;GAClC;IAAE,MAAM;IAAc,OAAO;GAAyB;GACtD;IAAE,MAAM;IAAgB,OAAO;GAAS;GACxC;IAAE,MAAM;IAAQ,OAAO;GAAS;GAChC;IAAE,MAAM;IAAS,OAAO;GAAS;GACjC;IAAE,MAAM;IAAc,OAAO;GAAM;EACrC;CAwCK;CACL,KAAK;EArBL,KAAK;EACL,OAAO;EACP,QAAQ;GACN;IAAE,MAAM;IAAiB,OAAO;GAAuB;GACvD;IAAE,MAAM;IAAU,OAAO;GAAM;GAC/B;IAAE,MAAM;IAAU,OAAO;GAAS;GAClC;IAAE,MAAM;IAAc,OAAO;GAAyB;GACtD;IAAE,MAAM;IAAQ,OAAO;GAAS;GAChC;IAAE,MAAM;IAAS,OAAO;GAAS;GACjC;IAAE,MAAM;IAAc,OAAO;GAAgB;EAC/C;CAWK;AACP;;;;;;AAOA,SAAgB,wBAA2C;CACzD,OAAO,OAAO,KAAK,kBAAkB;AACvC;;;;;;;AAQA,SAAgB,qBAAqB,KAA4C;CAC/E,OAAO,mBAAmB;AAC5B"}
1
+ {"version":3,"file":"country-descriptors.js","names":[],"sources":["../../../src/matter/shipping-address/country-descriptors.ts"],"sourcesContent":["/**\n * Country-adaptive shipping address form descriptors.\n *\n * Each descriptor declares the form shape (field set, order, and labels) for a specific country.\n * Descriptors are primarily data — field set, order, and labels — but a `FieldDescriptor` may also\n * carry `required` and `rule`, the two validation facts a country varies. `ShippingAddressFieldset`\n * is the only reader of either (specs/shipping-address-fieldset.md, Decision 3): a field whose\n * descriptor entry is absent is never rendered, so it can carry no requiredness at all.\n * Country adaptation is data-driven; adding a country is a data-only change (a new descriptor entry).\n *\n * Canonical field names must be shared/consistent across descriptors for fields both countries have\n * (recipientName, postalCode, street, number, complement, city, state), so that switching countries\n * preserves shared field values in the batched draft state (Decision 1/Invariant).\n *\n * Per Decision 2, this narrows the RFC's descriptor scope to form shape plus two per-field validation\n * facts: the non-blank recipient name and, per country, the postal code's format. Both descriptors'\n * `postalCode` entry carries a `pattern` rule matching that country's CEP or ZIP shape; every other\n * field's `rule` stays undefined. There is no server-side postal-code validation to fall back on:\n * `shippingAddressUpdate` types `postalCode` as a plain `z.string()`, forwards it verbatim with\n * `clearAddressIfPostalCodeNotFound: false`, and has no try/catch around the upstream call, so a\n * malformed value still returns HTTP 200 with an empty `userErrors` array. This client-side rule is\n * the only postal-code guard in the system today; per-field blur validation and a future\n * @vtex/country-forms adoption remain deferred.\n */\n\nimport type { FieldRule } from '../../particles/field/field.js';\n\n/**\n * Describes a single form field within a country descriptor.\n *\n * @property name - Canonical field name (e.g., \"recipientName\", \"street\", \"neighborhood\").\n * Shared field names across descriptors enable draft state preservation on country switch.\n * @property label - Human-readable label for the field. Named `label` (not a key) to allow future\n * swapping with i18n keys once the codebase adopts an i18n layer.\n */\nexport type FieldDescriptor = Readonly<{\n name: string;\n label: string;\n /**\n * Whether the fieldset requires a non-blank value. Read only by ShippingAddressFieldset, which\n * turns it into the field contract's `rule`. A field whose descriptor entry is absent is not\n * rendered, so it can carry no requiredness at all — that is the point (Decision 3).\n */\n required?: boolean;\n /**\n * Extra react-hook-form rules for this field in this country: pattern, minLength, and so on.\n * Merged under the generated `required`. Only `postalCode` carries one today.\n */\n rule?: FieldRule;\n}>;\n\n/**\n * Describes the form shape for a single country.\n *\n * @property iso - ISO 3166-1 alpha-3 country code (e.g., \"BRA\", \"USA\"). Must be a valid 3-letter code\n * matching the Address.country field type (plain String!, ISO alpha-3 by convention).\n * @property label - Human-readable country name for the country selector (e.g., \"Brazil\", \"United States\").\n * Named `label` (not a key) to allow future swapping with i18n keys.\n * @property fields - Ordered field set for this country. Order defines the visual order in the form.\n * Only fields this country uses are listed; absent fields are not rendered.\n */\nexport type CountryDescriptor = Readonly<{\n iso: string;\n label: string;\n fields: readonly FieldDescriptor[];\n}>;\n\n/**\n * Brazil (BRA) address form descriptor.\n *\n * Field order:\n * 1. recipientName — recipient of the package\n * 2. street — street name\n * 3. number — street number\n * 4. complement — apartment, suite, etc. (optional per GraphQL but no form-level validation)\n * 5. neighborhood — bairro (BR-specific, not in US form)\n * 6. city — city name\n * 7. state — state/UF code (canonical name shared with US, though US calls it state abbreviation)\n * 8. postalCode — CEP format, client-validated via `rule` (8 digits, hyphen after the fifth optional)\n */\nconst brDescriptor: CountryDescriptor = {\n iso: 'BRA',\n label: 'Brasil',\n fields: [\n { name: 'recipientName', label: 'nome do destinatário', required: true },\n { name: 'street', label: 'rua' },\n { name: 'number', label: 'número' },\n { name: 'complement', label: 'complemento (opcional)' },\n { name: 'neighborhood', label: 'bairro' },\n { name: 'city', label: 'cidade' },\n { name: 'state', label: 'estado' },\n {\n name: 'postalCode',\n label: 'cep',\n rule: { pattern: { value: /^\\d{5}-?\\d{3}$/, message: 'cep inválido' } },\n },\n ],\n};\n\n/**\n * United States (USA) address form descriptor.\n *\n * Field order:\n * 1. recipientName — recipient of the package\n * 2. street — street name\n * 3. number — street number\n * 4. complement — apartment, suite, etc. (optional per GraphQL but no form-level validation)\n * 5. city — city name\n * 6. state — state abbreviation (canonical name shared with BR for draft preservation)\n * 7. postalCode — ZIP/ZIP+4 format, client-validated via `rule` (5 digits, optional 4-digit\n * extension, hyphen before it optional either way — accepts both `02101-1234` and `021011234`)\n *\n * Note: neighborhood is not included in the US v1 form. If the shopper switches from BR to US,\n * the neighborhood value is retained in the draft but hidden (descriptor controls visibility only);\n * switching back to BR resurfaces it.\n */\nconst usaDescriptor: CountryDescriptor = {\n iso: 'USA',\n label: 'United States',\n fields: [\n { name: 'recipientName', label: 'recipient name', required: true },\n { name: 'street', label: 'street' },\n { name: 'number', label: 'number' },\n { name: 'complement', label: 'apartment, suite, etc. (optional)' },\n { name: 'city', label: 'city' },\n { name: 'state', label: 'state' },\n {\n name: 'postalCode',\n label: 'zip code',\n rule: { pattern: { value: /^\\d{5}(-?\\d{4})?$/, message: 'invalid zip code' } },\n },\n ],\n};\n\n/**\n * All available country descriptors, keyed by ISO alpha-3 code.\n *\n * The country selector lists only countries with a descriptor; a descriptor-less country is unreachable.\n * Adding a country is a data-only change: add a new CountryDescriptor entry here.\n */\nexport const countryDescriptors: Readonly<Record<string, CountryDescriptor>> = {\n BRA: brDescriptor,\n USA: usaDescriptor,\n};\n\n/**\n * Returns an ordered list of available country ISO codes (those with a descriptor).\n *\n * @returns ISO alpha-3 codes of all implemented countries, in definition order.\n */\nexport function getAvailableCountries(): readonly string[] {\n return Object.keys(countryDescriptors);\n}\n\n/**\n * Retrieves the descriptor for a given country.\n *\n * @param iso - ISO 3166-1 alpha-3 country code (e.g., \"BRA\", \"USA\")\n * @returns The CountryDescriptor for the country, or undefined if not implemented.\n */\nexport function getCountryDescriptor(iso: string): CountryDescriptor | undefined {\n return countryDescriptors[iso];\n}\n"],"mappings":";;;;;;AA4IA,MAAa,qBAAkE;CAC7E,KAAK;EA5DL,KAAK;EACL,OAAO;EACP,QAAQ;GACN;IAAE,MAAM;IAAiB,OAAO;IAAwB,UAAU;GAAK;GACvE;IAAE,MAAM;IAAU,OAAO;GAAM;GAC/B;IAAE,MAAM;IAAU,OAAO;GAAS;GAClC;IAAE,MAAM;IAAc,OAAO;GAAyB;GACtD;IAAE,MAAM;IAAgB,OAAO;GAAS;GACxC;IAAE,MAAM;IAAQ,OAAO;GAAS;GAChC;IAAE,MAAM;IAAS,OAAO;GAAS;GACjC;IACE,MAAM;IACN,OAAO;IACP,MAAM,EAAE,SAAS;KAAE,OAAO;KAAkB,SAAS;IAAe,EAAE;GACxE;EACF;CA6CK;CACL,KAAK;EAzBL,KAAK;EACL,OAAO;EACP,QAAQ;GACN;IAAE,MAAM;IAAiB,OAAO;IAAkB,UAAU;GAAK;GACjE;IAAE,MAAM;IAAU,OAAO;GAAS;GAClC;IAAE,MAAM;IAAU,OAAO;GAAS;GAClC;IAAE,MAAM;IAAc,OAAO;GAAoC;GACjE;IAAE,MAAM;IAAQ,OAAO;GAAO;GAC9B;IAAE,MAAM;IAAS,OAAO;GAAQ;GAChC;IACE,MAAM;IACN,OAAO;IACP,MAAM,EAAE,SAAS;KAAE,OAAO;KAAqB,SAAS;IAAmB,EAAE;GAC/E;EACF;CAWK;AACP;;;;;;AAOA,SAAgB,wBAA2C;CACzD,OAAO,OAAO,KAAK,kBAAkB;AACvC;;;;;;;AAQA,SAAgB,qBAAqB,KAA4C;CAC/E,OAAO,mBAAmB;AAC5B"}
@@ -1,16 +1,17 @@
1
1
  import { ComponentDefinition } from "../../core/dist/define-component.js";
2
2
  import "../../core/dist/index.js";
3
3
  import { ComponentActions } from "../../sdk/actions/types.js";
4
- import { ReactNode } from "react";
4
+ import { ComponentPropsWithRef, ReactNode } from "react";
5
5
  //#region src/matter/shipping-address/shipping-address.d.ts
6
6
  /**
7
- * The `$data` slice forwarded by the reactive runtime. `ShippingAddressData` selects two root
8
- * fields (`shipping`, `clientProfile`), so the compiler composes them via
7
+ * The `$data` slice forwarded to `ShippingAddressFieldset` by the reactive runtime. Selects two
8
+ * root fields (`shipping`, `clientProfile`), so the compiler composes them via
9
9
  * `MultipleReactiveDataProvider`, which keys each entity's resolved slice by its own root field —
10
10
  * `$data` is `{ shipping: {...}, clientProfile: {...} }`, not a flat/unwrapped shape (that unwrapped
11
11
  * shape only applies to single-root-field fragments, e.g. CartTotalizerRoot's `$data.totalizers`).
12
+ * Carries no `savedAddresses` — the fieldset has no saved-address UI of its own (Decision 1).
12
13
  */
13
- export type ShippingAddressData = {
14
+ export type ShippingAddressFieldsetData = {
14
15
  shipping?: {
15
16
  address?: {
16
17
  id?: string | null;
@@ -24,106 +25,102 @@ export type ShippingAddressData = {
24
25
  city?: string | null;
25
26
  state?: string | null;
26
27
  } | null;
27
- savedAddresses?: Array<{
28
- id?: string | null;
29
- recipientName?: string | null;
30
- postalCode?: string | null;
31
- country?: string | null;
32
- street?: string | null;
33
- number?: string | null;
34
- complement?: string | null;
35
- neighborhood?: string | null;
36
- city?: string | null;
37
- state?: string | null;
38
- }>;
39
28
  } | null;
40
29
  clientProfile?: {
41
30
  firstName?: string | null;
42
31
  lastName?: string | null;
43
32
  } | null;
44
33
  } | null;
45
- export type ShippingAddressRootProps = {
46
- /** Default country (ISO alpha-3) when no address exists. */
34
+ export type ShippingAddressFieldsetProps = {
35
+ /** Country used when the stored address has none. */
47
36
  defaultCountry?: string;
37
+ /** Placeholder rows the loading skeleton draws. Set it to the number of Controls composed here. */
38
+ skeletonCount?: number;
39
+ /** Announced politely while the address resolves. Blank means no announcement. */
40
+ loadingLabel?: string;
41
+ /** Announced politely once the Controls mount. Blank means no announcement. */
42
+ loadedLabel?: string;
43
+ /** Accessible name of the `<fieldset>` group. Blank means no name is exposed. */
44
+ groupLabel?: string;
48
45
  className?: string;
49
46
  children?: ReactNode;
50
- /** `ShippingAddressData` forwarded by the reactive runtime. */
51
- $data?: ShippingAddressData;
47
+ /** `ShippingAddressFieldsetData` forwarded by the reactive runtime. */
48
+ $data?: ShippingAddressFieldsetData;
52
49
  /** Compiler-injected action surface; carries `shipping.setAddress`. */
53
50
  $actions?: ComponentActions;
54
51
  };
55
52
  export type ShippingAddressStreetControlProps = {
56
53
  className?: string;
54
+ /** Overrides the descriptor's label. Absence means the platform's value. */
55
+ label?: string;
56
+ placeholder?: string;
57
+ /** Recomposes the anatomy. Absence renders Field.Label, Field.Control, Field.Error. */
58
+ children?: ReactNode;
57
59
  };
58
60
  export type ShippingAddressNumberControlProps = {
59
61
  className?: string;
62
+ /** Overrides the descriptor's label. Absence means the platform's value. */
63
+ label?: string;
64
+ placeholder?: string;
65
+ /** Recomposes the anatomy. Absence renders Field.Label, Field.Control, Field.Error. */
66
+ children?: ReactNode;
60
67
  };
61
68
  export type ShippingAddressCityControlProps = {
62
69
  className?: string;
70
+ /** Overrides the descriptor's label. Absence means the platform's value. */
71
+ label?: string;
72
+ placeholder?: string;
73
+ /** Recomposes the anatomy. Absence renders Field.Label, Field.Control, Field.Error. */
74
+ children?: ReactNode;
63
75
  };
64
76
  export type ShippingAddressStateControlProps = {
65
77
  className?: string;
78
+ /** Overrides the descriptor's label. Absence means the platform's value. */
79
+ label?: string;
80
+ placeholder?: string;
81
+ /** Recomposes the anatomy. Absence renders Field.Label, Field.Control, Field.Error. */
82
+ children?: ReactNode;
66
83
  };
67
84
  export type ShippingAddressPostalCodeControlProps = {
68
85
  className?: string;
86
+ /** Overrides the descriptor's label. Absence means the platform's value. */
87
+ label?: string;
88
+ placeholder?: string;
89
+ /** Recomposes the anatomy. Absence renders Field.Label, Field.Control, Field.Error. */
90
+ children?: ReactNode;
69
91
  };
70
92
  export type ShippingAddressComplementControlProps = {
71
93
  className?: string;
72
- };
73
- export type ShippingAddressNeighborhoodControlProps = {
74
- className?: string;
75
- };
76
- export type ShippingAddressCountryControlProps = {
77
- className?: string;
94
+ /** Overrides the descriptor's label. Absence means the platform's value. */
78
95
  label?: string;
96
+ placeholder?: string;
97
+ /** Recomposes the anatomy. Absence renders Field.Label, Field.Control, Field.Error. */
98
+ children?: ReactNode;
79
99
  };
80
- export type ShippingAddressRecipientNameControlProps = {
81
- className?: string;
82
- };
83
- export type ShippingAddressSavedListProps = {
84
- className?: string;
85
- };
86
- export type ShippingAddressSavedOptionProps = {
87
- id: string;
88
- className?: string;
89
- };
90
- export type ShippingAddressSubmitProps = {
100
+ export type ShippingAddressNeighborhoodControlProps = {
91
101
  className?: string;
102
+ /** Overrides the descriptor's label. Absence means the platform's value. */
92
103
  label?: string;
93
- pendingLabel?: string;
94
- };
95
- export type ShippingAddressErrorProps = {
96
- className?: string;
97
- };
98
- export type ShippingAddressSavedAddressDrawerControllerProps = {
104
+ placeholder?: string;
105
+ /** Recomposes the anatomy. Absence renders Field.Label, Field.Control, Field.Error. */
99
106
  children?: ReactNode;
100
107
  };
101
- export type ShippingAddressSavedAddressSubmitProps = {
108
+ export type ShippingAddressCountryControlProps = {
102
109
  className?: string;
103
110
  label?: string;
104
- pendingLabel?: string;
105
- };
106
- export type ShippingAddressSelectedSummaryProps = {
107
- className?: string;
108
- /**
109
- * The lines to render, in order — typically the `AddressSummaryRecipient` / `Street` / `Locality`
110
- * leaves. Defaults to recipient, street, locality when omitted.
111
- */
111
+ placeholder?: string;
112
+ /** Recomposes the anatomy. Absence renders Field.Label, FieldSelect.Root, Field.Error. */
112
113
  children?: ReactNode;
113
114
  };
114
- export type ShippingAddressEditControllerProps = {
115
- children?: ReactNode;
116
- };
117
- export type ShippingAddressSectionPanelProps = {
118
- children?: ReactNode;
119
- };
120
- export type ShippingAddressEditButtonProps = {
115
+ export type ShippingAddressRecipientNameControlProps = {
121
116
  className?: string;
117
+ /** Overrides the descriptor's label. Absence means the platform's value. */
122
118
  label?: string;
123
- /** Compose custom button content (e.g. an Icon plus text); falls back to `label`. */
119
+ placeholder?: string;
120
+ /** Recomposes the anatomy. Absence renders Field.Label, Field.Control, Field.Error. */
124
121
  children?: ReactNode;
125
122
  };
126
- export declare const ShippingAddressRootDefinition: ComponentDefinition<ShippingAddressRootProps>;
123
+ export declare const ShippingAddressFieldsetDefinition: ComponentDefinition<ShippingAddressFieldsetProps>;
127
124
  export declare const ShippingAddressRecipientNameControlDefinition: ComponentDefinition<ShippingAddressRecipientNameControlProps>;
128
125
  export declare const ShippingAddressStreetControlDefinition: ComponentDefinition<ShippingAddressStreetControlProps>;
129
126
  export declare const ShippingAddressNumberControlDefinition: ComponentDefinition<ShippingAddressNumberControlProps>;
@@ -133,110 +130,76 @@ export declare const ShippingAddressPostalCodeControlDefinition: ComponentDefini
133
130
  export declare const ShippingAddressComplementControlDefinition: ComponentDefinition<ShippingAddressComplementControlProps>;
134
131
  export declare const ShippingAddressNeighborhoodControlDefinition: ComponentDefinition<ShippingAddressNeighborhoodControlProps>;
135
132
  export declare const ShippingAddressCountryControlDefinition: ComponentDefinition<ShippingAddressCountryControlProps>;
136
- export declare const ShippingAddressSavedListDefinition: ComponentDefinition<ShippingAddressSavedListProps>;
137
- export declare const ShippingAddressSavedOptionDefinition: ComponentDefinition<ShippingAddressSavedOptionProps>;
138
- export declare const ShippingAddressSubmitDefinition: ComponentDefinition<ShippingAddressSubmitProps>;
139
- export declare const ShippingAddressErrorDefinition: ComponentDefinition<ShippingAddressErrorProps>;
140
- export declare const ShippingAddressSavedAddressDrawerControllerDefinition: ComponentDefinition<ShippingAddressSavedAddressDrawerControllerProps>;
141
- export declare const ShippingAddressSavedAddressSubmitDefinition: ComponentDefinition<ShippingAddressSavedAddressSubmitProps>;
142
- export declare const ShippingAddressSelectedSummaryDefinition: ComponentDefinition<ShippingAddressSelectedSummaryProps>;
143
- export declare const ShippingAddressEditControllerDefinition: ComponentDefinition<ShippingAddressEditControllerProps>;
144
- export declare const ShippingAddressSummaryViewDefinition: ComponentDefinition<ShippingAddressSectionPanelProps>;
145
- export declare const ShippingAddressEditFormDefinition: ComponentDefinition<ShippingAddressSectionPanelProps>;
146
- export declare const ShippingAddressEditButtonDefinition: ComponentDefinition<ShippingAddressEditButtonProps>;
147
- export declare const ShippingAddressCancelButtonDefinition: ComponentDefinition<ShippingAddressEditButtonProps>;
148
133
  /**
149
- * ShippingAddressRoot owns the batched form state, manages the current descriptor,
150
- * and provides context to child Controls. It handles submit dispatch and error tracking.
134
+ * ShippingAddressFieldset — this entity's root: same data, same action as a page-level submit
135
+ * would use, dispatched at form-submit time instead of through a button of its own. Registers one
136
+ * `FieldsetRegistration` with the enclosing `FormRoot` under the `shippingAddress` namespace,
137
+ * derives the active country descriptor from react-hook-form (Decision 2), and publishes each
138
+ * field's seed/rule/label through its own context so a bound Control never writes a validation
139
+ * expression. Renders no button and holds no draft of its own.
140
+ *
141
+ * Its controls mount only once the entity has resolved; until then the `Fieldset.Root` carries
142
+ * `-pending` and renders `ShippingAddressFieldsetSkeleton`. "Resolved" is two conditions, because
143
+ * `$data` alone cannot answer it: under the reactive runtime the slice is defined from the first
144
+ * render — `useReactiveEntity` hands down `fallbackData` while the cache read is incomplete — so an
145
+ * empty server answer looks exactly like a resolved one, and every control would mount seeded `''`
146
+ * before the shopper's stored address arrives. Each seed reaches react-hook-form as a field-level
147
+ * `defaultValue`; `useSeedAdoption` re-seeds a clean field with it on every render, but once the
148
+ * field turns dirty no later seed ever reaches it again (Decision 12). Mounting before the answer
149
+ * arrives would seed `''`: a shopper who starts typing before the real value lands makes the field
150
+ * dirty on that empty seed, permanently locking their saved address out of it, and even a shopper who
151
+ * does not type sees the field flash from `''` to the real data. `useReactiveDataSettled` supplies
152
+ * the missing half: the page query's own in-flight state, latched so it only ever goes pending →
153
+ * settled. The `$data === undefined` half still carries
154
+ * trees with no reactive root above them, where the slice arrives as a plain prop.
155
+ *
156
+ * Both ends of that wait are spoken: the fieldset carries `aria-busy` while it lasts and holds a
157
+ * polite live region that announces `loadingLabel` and then `loadedLabel`. Style the region
158
+ * `sr-only` — it is text meant for a screen reader, not for the page.
151
159
  */
152
- export declare function ShippingAddressRoot({ defaultCountry, className, children, $data: $dataProp, $actions: $actionsProp }: Readonly<ShippingAddressRootProps>): import("react/jsx-runtime").JSX.Element;
160
+ export declare function ShippingAddressFieldset({ defaultCountry, skeletonCount, loadingLabel, loadedLabel, groupLabel, className, children, $data: $dataProp, $actions: $actionsProp }: ShippingAddressFieldsetProps): ReactNode;
161
+ export declare namespace ShippingAddressFieldset {
162
+ var Skeleton: typeof ShippingAddressFieldsetSkeleton;
163
+ }
153
164
  /**
154
- * RecipientNameControl — the only client-validated field (US-4, US-6).
165
+ * The loading state of the fieldset, rendered in place of the Controls until the entity resolves and
166
+ * declared as the definition's `skeleton`. Purely visual: the wait is spoken by the fieldset's own
167
+ * live region, so this is hidden from assistive technology rather than announced twice.
168
+ */
169
+ export declare function ShippingAddressFieldsetSkeleton({ count, className, ...props }: ComponentPropsWithRef<'div'> & {
170
+ count?: number;
171
+ }): import("react/jsx-runtime").JSX.Element;
172
+ /**
173
+ * RecipientNameControl — the only required field (US-4, US-6); the postal code is client-validated
174
+ * too, against the active country's format.
155
175
  * Pre-filled from clientProfile, editable, required.
156
176
  */
157
- export declare function ShippingAddressRecipientNameControl({ className }: ShippingAddressRecipientNameControlProps): import("react/jsx-runtime").JSX.Element | null;
177
+ export declare function ShippingAddressRecipientNameControl({ className, label, placeholder, children }: ShippingAddressRecipientNameControlProps): ReactNode;
158
178
  /** StreetControl */
159
- export declare function ShippingAddressStreetControl({ className }: ShippingAddressStreetControlProps): import("react/jsx-runtime").JSX.Element | null;
179
+ export declare function ShippingAddressStreetControl({ className, label, placeholder, children }: ShippingAddressStreetControlProps): ReactNode;
160
180
  /** NumberControl */
161
- export declare function ShippingAddressNumberControl({ className }: ShippingAddressNumberControlProps): import("react/jsx-runtime").JSX.Element | null;
181
+ export declare function ShippingAddressNumberControl({ className, label, placeholder, children }: ShippingAddressNumberControlProps): ReactNode;
162
182
  /** CityControl */
163
- export declare function ShippingAddressCityControl({ className }: ShippingAddressCityControlProps): import("react/jsx-runtime").JSX.Element | null;
183
+ export declare function ShippingAddressCityControl({ className, label, placeholder, children }: ShippingAddressCityControlProps): ReactNode;
164
184
  /** StateControl */
165
- export declare function ShippingAddressStateControl({ className }: ShippingAddressStateControlProps): import("react/jsx-runtime").JSX.Element | null;
185
+ export declare function ShippingAddressStateControl({ className, label, placeholder, children }: ShippingAddressStateControlProps): ReactNode;
166
186
  /** PostalCodeControl */
167
- export declare function ShippingAddressPostalCodeControl({ className }: ShippingAddressPostalCodeControlProps): import("react/jsx-runtime").JSX.Element | null;
187
+ export declare function ShippingAddressPostalCodeControl({ className, label, placeholder, children }: ShippingAddressPostalCodeControlProps): ReactNode;
168
188
  /** ComplementControl */
169
- export declare function ShippingAddressComplementControl({ className }: ShippingAddressComplementControlProps): import("react/jsx-runtime").JSX.Element | null;
189
+ export declare function ShippingAddressComplementControl({ className, label, placeholder, children }: ShippingAddressComplementControlProps): ReactNode;
170
190
  /** NeighborhoodControl (BR-specific in v1) */
171
- export declare function ShippingAddressNeighborhoodControl({ className }: ShippingAddressNeighborhoodControlProps): import("react/jsx-runtime").JSX.Element | null;
172
- /** CountryControl — lists only countries with a descriptor (US-2, first criterion) */
173
- export declare function ShippingAddressCountryControl({ className, label }: ShippingAddressCountryControlProps): import("react/jsx-runtime").JSX.Element;
174
- /**
175
- * ShippingAddressSavedList — renders only when savedAddresses is non-empty (logged-in signal).
176
- */
177
- export declare function ShippingAddressSavedList({ className }: ShippingAddressSavedListProps): import("react/jsx-runtime").JSX.Element | null;
178
- /**
179
- * ShippingAddressSavedOption — selectable saved address; populates draft on selection.
180
- * Includes isCurrent visual variant to mark the address matching the current cart address (Decision 8).
181
- */
182
- export declare function ShippingAddressSavedOption({ id, className }: ShippingAddressSavedOptionProps): import("react/jsx-runtime").JSX.Element | null;
183
- /**
184
- * ShippingAddressSubmit — dispatches the batched submit; reflects pending state.
185
- */
186
- export declare function ShippingAddressSubmit({ className, label, pendingLabel }: ShippingAddressSubmitProps): import("react/jsx-runtime").JSX.Element;
187
- /**
188
- * ShippingAddressSavedAddressDrawerController — makes the wrapped DrawerRoot controlled by the
189
- * shipping-address context's savedAddressDrawerOpen state, and blocks dismissal (Escape, backdrop
190
- * click, close button) while drawerSubmitting is true by simply not forwarding the close request
191
- * to the setter. Mirrors CartOpenOnAdd's cloneElement mechanism. Expects a single DrawerRoot child.
192
- */
193
- export declare function ShippingAddressSavedAddressDrawerController({ children }: ShippingAddressSavedAddressDrawerControllerProps): ReactNode;
194
- /**
195
- * ShippingAddressSavedAddressSubmit — the drawer's "selecionar" submit button; independent
196
- * submitting state from the main form's Submit (Decision 7); no-ops when the selected saved
197
- * address is already the current one (Decision 8).
198
- */
199
- export declare function ShippingAddressSavedAddressSubmit({ className, label, pendingLabel }: ShippingAddressSavedAddressSubmitProps): import("react/jsx-runtime").JSX.Element;
200
- /**
201
- * ShippingAddressSelectedSummary — provides the current delivery address via AddressSummaryRoot's
202
- * context and renders it through AddressSummary. Composed lines go through that same wrapper rather
203
- * than replacing it, because AddressSummaryRoot renders no DOM and `className` would have nowhere to
204
- * land. Self-gating on currentAddress: renders null when there is none yet, rather than an empty
205
- * provider with nothing meaningful to show.
206
- */
207
- export declare function ShippingAddressSelectedSummary({ className, children }: ShippingAddressSelectedSummaryProps): import("react/jsx-runtime").JSX.Element | null;
208
- /**
209
- * ShippingAddressEditController — owns the view/edit mode. Defaults to 'view' when a current
210
- * address exists, 'edit' otherwise (derived reactively from currentAddressId, so it self-corrects
211
- * if the address arrives asynchronously after mount, same issue as the draft-sync effect above).
212
- * Once the shopper explicitly toggles (via ShippingAddressEditButton) or a submit succeeds, the
213
- * explicit mode takes over. Does not render any DOM itself; provides ShippingAddressSectionContext
214
- * to ShippingAddressSummaryView/ShippingAddressEditForm/ShippingAddressEditButton descendants.
215
- */
216
- export declare function ShippingAddressEditController({ children }: ShippingAddressEditControllerProps): import("react/jsx-runtime").JSX.Element;
217
- /** Renders its children only while the section shows the saved-address summary. */
218
- export declare function ShippingAddressSummaryView({ children }: ShippingAddressSectionPanelProps): import("react/jsx-runtime").JSX.Element | null;
219
- /** Renders its children only while the section shows the address form. */
220
- export declare function ShippingAddressEditForm({ children }: ShippingAddressSectionPanelProps): import("react/jsx-runtime").JSX.Element | null;
221
- /**
222
- * ShippingAddressEditButton — CTA that switches the mode to 'edit'. Has no knowledge of why the
223
- * mode might currently be 'view' (a current address, or a just-completed submit) — it only writes
224
- * the mode forward.
225
- */
226
- export declare function ShippingAddressEditButton({ className, label, children }: ShippingAddressEditButtonProps): import("react/jsx-runtime").JSX.Element;
227
- /**
228
- * ShippingAddressCancelButton — returns the section to its summary without writing. Without it a
229
- * shopper who opens the form can only leave through a successful `setAddress`, and blanking the
230
- * recipient disables Submit, which leaves the section stuck open over the summary it replaced.
231
- */
232
- export declare function ShippingAddressCancelButton({ className, label, children }: ShippingAddressEditButtonProps): import("react/jsx-runtime").JSX.Element;
191
+ export declare function ShippingAddressNeighborhoodControl({ className, label, placeholder, children }: ShippingAddressNeighborhoodControlProps): ReactNode;
233
192
  /**
234
- * ShippingAddressError — renders domain userErrors inline, or generic upstream error state.
193
+ * CountryControl — moves onto `FieldSelect` (Decision 8): the trigger resolves a country name from
194
+ * the field contract's `options`. Gated on `descriptor`, not on a per-field entry (country has
195
+ * none): a country with no descriptor renders no controls at all (Decision 3/4's "no entry, no
196
+ * control" applied to the field that selects the entry itself).
235
197
  */
236
- export declare function ShippingAddressError({ className }: ShippingAddressErrorProps): import("react/jsx-runtime").JSX.Element | null;
198
+ export declare function ShippingAddressCountryControl({ className, label, placeholder, children }: ShippingAddressCountryControlProps): ReactNode;
237
199
  export declare const ShippingAddress: {
238
- Root: typeof ShippingAddressRoot;
239
- RootDefinition: ComponentDefinition<ShippingAddressRootProps>;
200
+ Fieldset: typeof ShippingAddressFieldset;
201
+ FieldsetDefinition: ComponentDefinition<ShippingAddressFieldsetProps>;
202
+ FieldsetSkeleton: typeof ShippingAddressFieldsetSkeleton;
240
203
  RecipientNameControl: typeof ShippingAddressRecipientNameControl;
241
204
  RecipientNameControlDefinition: ComponentDefinition<ShippingAddressRecipientNameControlProps>;
242
205
  StreetControl: typeof ShippingAddressStreetControl;
@@ -255,30 +218,6 @@ export declare const ShippingAddress: {
255
218
  NeighborhoodControlDefinition: ComponentDefinition<ShippingAddressNeighborhoodControlProps>;
256
219
  CountryControl: typeof ShippingAddressCountryControl;
257
220
  CountryControlDefinition: ComponentDefinition<ShippingAddressCountryControlProps>;
258
- SavedList: typeof ShippingAddressSavedList;
259
- SavedListDefinition: ComponentDefinition<ShippingAddressSavedListProps>;
260
- SavedOption: typeof ShippingAddressSavedOption;
261
- SavedOptionDefinition: ComponentDefinition<ShippingAddressSavedOptionProps>;
262
- Submit: typeof ShippingAddressSubmit;
263
- SubmitDefinition: ComponentDefinition<ShippingAddressSubmitProps>;
264
- SavedAddressDrawerController: typeof ShippingAddressSavedAddressDrawerController;
265
- SavedAddressDrawerControllerDefinition: ComponentDefinition<ShippingAddressSavedAddressDrawerControllerProps>;
266
- SavedAddressSubmit: typeof ShippingAddressSavedAddressSubmit;
267
- SavedAddressSubmitDefinition: ComponentDefinition<ShippingAddressSavedAddressSubmitProps>;
268
- SelectedSummary: typeof ShippingAddressSelectedSummary;
269
- SelectedSummaryDefinition: ComponentDefinition<ShippingAddressSelectedSummaryProps>;
270
- EditController: typeof ShippingAddressEditController;
271
- EditControllerDefinition: ComponentDefinition<ShippingAddressEditControllerProps>;
272
- SummaryView: typeof ShippingAddressSummaryView;
273
- SummaryViewDefinition: ComponentDefinition<ShippingAddressSectionPanelProps>;
274
- EditForm: typeof ShippingAddressEditForm;
275
- EditFormDefinition: ComponentDefinition<ShippingAddressSectionPanelProps>;
276
- EditButton: typeof ShippingAddressEditButton;
277
- EditButtonDefinition: ComponentDefinition<ShippingAddressEditButtonProps>;
278
- CancelButton: typeof ShippingAddressCancelButton;
279
- CancelButtonDefinition: ComponentDefinition<ShippingAddressEditButtonProps>;
280
- Error: typeof ShippingAddressError;
281
- ErrorDefinition: ComponentDefinition<ShippingAddressErrorProps>;
282
221
  };
283
222
  //#endregion
284
223
  //# sourceMappingURL=shipping-address.d.ts.map