@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":"field.js","names":["BaseField","Field"],"sources":["../../../src/particles/field/field.tsx"],"sourcesContent":["'use client';\nimport type { FieldValidityState } from '@base-ui/react/field';\nimport { Field as BaseField } from '@base-ui/react/field';\nimport { defineComponent } from '@vtex/fs-core';\nimport type { ComponentPropsWithRef, ReactNode } from 'react';\n\nexport type FieldRootProps = ComponentPropsWithRef<'div'> & {\n disabled?: boolean;\n invalid?: boolean;\n name?: string;\n};\n\nexport type FieldLabelProps = ComponentPropsWithRef<'label'>;\n\nexport type FieldControlProps = Omit<ComponentPropsWithRef<'input'>, 'children'>;\n\nexport type FieldDescriptionProps = ComponentPropsWithRef<'p'>;\n\nexport type FieldErrorProps = ComponentPropsWithRef<'div'> & {\n /**\n * Controls when the error is shown. `true` always shows it (for externally/caller-driven\n * validity, e.g. presence-only checks with no native constraint validation); a\n * `ValidityState` key shows it only when that specific native validity flag is set. Omit to\n * fall back to Base UI's default: shown whenever the field's tracked validity is invalid.\n * Note `match={false}` does not suppress the error — it falls back to that default\n * invalid-driven behavior; callers needing a boolean should use `invalid ? true : 'customError'`.\n */\n match?: boolean | keyof ValidityState;\n};\n\nexport type FieldValidityProps = {\n children: (state: FieldValidityState) => ReactNode;\n};\n\nexport const FieldRootDefinition = defineComponent<FieldRootProps>({\n name: 'FieldRoot',\n importPath: '@vtex/faststore/components',\n component: FieldRoot,\n editor: { label: 'Field Root', category: 'layout' },\n schema: {\n disabled: { type: 'boolean', default: false, label: 'Disabled' },\n },\n guideline:\n 'Form field container that connects a label, input, and validation messages via ARIA. Use Field.Control as the input element, or place a compatible Base UI input (Input, Checkbox, Select) as a direct child. Set invalid=true to trigger Field.Error display.',\n});\n\nexport const FieldLabelDefinition = defineComponent<FieldLabelProps>({\n name: 'FieldLabel',\n importPath: '@vtex/faststore/components',\n component: FieldLabel,\n editor: { label: 'Field Label', category: 'layout' },\n schema: {},\n guideline:\n \"Accessible label inside Field.Root. Automatically associated with Field.Control's input via ARIA. Place before Field.Control in the DOM.\",\n});\n\nexport const FieldControlDefinition = defineComponent<FieldControlProps>({\n name: 'FieldControl',\n importPath: '@vtex/faststore/components',\n component: FieldControl,\n editor: { label: 'Field Control', category: 'layout' },\n schema: {},\n guideline:\n 'Renders a native `<input>` element directly. It IS the input — do not place any child inside it. Pass input attributes (type, placeholder, required, etc.) directly as props. It is automatically linked to Field.Label and Field.Error via ARIA.',\n});\n\nexport const FieldDescriptionDefinition = defineComponent<FieldDescriptionProps>({\n name: 'FieldDescription',\n importPath: '@vtex/faststore/components',\n component: FieldDescription,\n editor: { label: 'Field Description', category: 'layout' },\n schema: {},\n guideline:\n 'Helper text inside Field.Root. Automatically linked to the control via aria-describedby. Always visible regardless of validation state.',\n});\n\nexport const FieldErrorDefinition = defineComponent<FieldErrorProps>({\n name: 'FieldError',\n importPath: '@vtex/faststore/components',\n component: FieldError,\n editor: { label: 'Field Error', category: 'layout' },\n schema: {},\n guideline:\n 'Validation error message inside Field.Root. Shown when the field is in an invalid state. Linked to the control via aria-describedby.',\n});\n\nexport const FieldValidityDefinition = defineComponent<FieldValidityProps>({\n name: 'FieldValidity',\n importPath: '@vtex/faststore/components',\n component: FieldValidity,\n editor: { label: 'Field Validity', category: 'layout' },\n schema: {},\n guideline:\n \"Validation feedback slot using a render prop for custom messages derived from the field's validity state. Use for dynamic messages when Field.Error text is not fixed.\",\n});\n\nexport function FieldRoot({ disabled, invalid, name, className, children, ...props }: FieldRootProps) {\n return (\n <BaseField.Root\n {...props}\n disabled={disabled}\n invalid={invalid}\n name={name}\n className={className}\n data-fs-field-root=\"\"\n >\n {children}\n </BaseField.Root>\n );\n}\n\nexport function FieldLabel({ className, children, ...props }: FieldLabelProps) {\n return (\n <BaseField.Label {...props} className={className} data-fs-field-label=\"\">\n {children}\n </BaseField.Label>\n );\n}\n\nexport function FieldControl({ className, ...props }: FieldControlProps) {\n return <BaseField.Control {...props} className={className} data-fs-field-control=\"\" />;\n}\n\nexport function FieldDescription({ className, children, ...props }: FieldDescriptionProps) {\n return (\n <BaseField.Description {...props} className={className} data-fs-field-description=\"\">\n {children}\n </BaseField.Description>\n );\n}\n\nexport function FieldError({ className, children, ...props }: FieldErrorProps) {\n return (\n <BaseField.Error {...props} className={className} data-fs-field-error=\"\">\n {children}\n </BaseField.Error>\n );\n}\n\nexport function FieldValidity({ children }: FieldValidityProps) {\n return <BaseField.Validity>{children}</BaseField.Validity>;\n}\n\nexport const Field = {\n Root: FieldRoot,\n Label: FieldLabel,\n Control: FieldControl,\n Description: FieldDescription,\n Error: FieldError,\n Validity: FieldValidity,\n};\n"],"mappings":";;;;;;AAkCA,MAAa,sBAAsB,gBAAgC;CACjE,MAAM;CACN,YAAY;CACZ,WAAW;CACX,QAAQ;EAAE,OAAO;EAAc,UAAU;CAAS;CAClD,QAAQ,EACN,UAAU;EAAE,MAAM;EAAW,SAAS;EAAO,OAAO;CAAW,EACjE;CACA,WACE;AACJ,CAAC;AAED,MAAa,uBAAuB,gBAAiC;CACnE,MAAM;CACN,YAAY;CACZ,WAAW;CACX,QAAQ;EAAE,OAAO;EAAe,UAAU;CAAS;CACnD,QAAQ,CAAC;CACT,WACE;AACJ,CAAC;AAED,MAAa,yBAAyB,gBAAmC;CACvE,MAAM;CACN,YAAY;CACZ,WAAW;CACX,QAAQ;EAAE,OAAO;EAAiB,UAAU;CAAS;CACrD,QAAQ,CAAC;CACT,WACE;AACJ,CAAC;AAED,MAAa,6BAA6B,gBAAuC;CAC/E,MAAM;CACN,YAAY;CACZ,WAAW;CACX,QAAQ;EAAE,OAAO;EAAqB,UAAU;CAAS;CACzD,QAAQ,CAAC;CACT,WACE;AACJ,CAAC;AAED,MAAa,uBAAuB,gBAAiC;CACnE,MAAM;CACN,YAAY;CACZ,WAAW;CACX,QAAQ;EAAE,OAAO;EAAe,UAAU;CAAS;CACnD,QAAQ,CAAC;CACT,WACE;AACJ,CAAC;AAED,MAAa,0BAA0B,gBAAoC;CACzE,MAAM;CACN,YAAY;CACZ,WAAW;CACX,QAAQ;EAAE,OAAO;EAAkB,UAAU;CAAS;CACtD,QAAQ,CAAC;CACT,WACE;AACJ,CAAC;AAED,SAAgB,UAAU,EAAE,UAAU,SAAS,MAAM,WAAW,UAAU,GAAG,SAAyB;CACpG,OACE,oBAACA,MAAU,MAAX;EACE,GAAI;EACM;EACD;EACH;EACK;EACX,sBAAmB;EAElB;CACa,CAAA;AAEpB;AAEA,SAAgB,WAAW,EAAE,WAAW,UAAU,GAAG,SAA0B;CAC7E,OACE,oBAACA,MAAU,OAAX;EAAiB,GAAI;EAAkB;EAAW,uBAAoB;EACnE;CACc,CAAA;AAErB;AAEA,SAAgB,aAAa,EAAE,WAAW,GAAG,SAA4B;CACvE,OAAO,oBAACA,MAAU,SAAX;EAAmB,GAAI;EAAkB;EAAW,yBAAsB;CAAI,CAAA;AACvF;AAEA,SAAgB,iBAAiB,EAAE,WAAW,UAAU,GAAG,SAAgC;CACzF,OACE,oBAACA,MAAU,aAAX;EAAuB,GAAI;EAAkB;EAAW,6BAA0B;EAC/E;CACoB,CAAA;AAE3B;AAEA,SAAgB,WAAW,EAAE,WAAW,UAAU,GAAG,SAA0B;CAC7E,OACE,oBAACA,MAAU,OAAX;EAAiB,GAAI;EAAkB;EAAW,uBAAoB;EACnE;CACc,CAAA;AAErB;AAEA,SAAgB,cAAc,EAAE,YAAgC;CAC9D,OAAO,oBAACA,MAAU,UAAX,EAAqB,SAA6B,CAAA;AAC3D;AAEA,MAAaC,UAAQ;CACnB,MAAM;CACN,OAAO;CACP,SAAS;CACT,aAAa;CACb,OAAO;CACP,UAAU;AACZ"}
1
+ {"version":3,"file":"field.js","names":["BaseField","Field"],"sources":["../../../src/particles/field/field.tsx"],"sourcesContent":["'use client';\nimport type { FieldValidityState } from '@base-ui/react/field';\nimport { Field as BaseField } from '@base-ui/react/field';\nimport { defineComponent } from '@vtex/fs-core';\nimport type { ComponentPropsWithRef, ReactNode, RefCallback } from 'react';\nimport { createContext, useCallback, useContext, useEffect, useMemo, useRef } from 'react';\nimport type { Control, RegisterOptions } from 'react-hook-form';\nimport { useController, useFormContext, useFormState } from 'react-hook-form';\nimport { Checkbox } from '../checkbox/checkbox.js';\nimport { registerFieldClearer } from './bound-field-registry.js';\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\nexport type FieldRootProps = ComponentPropsWithRef<'div'> & {\n disabled?: boolean;\n invalid?: boolean;\n name?: string;\n};\n\nexport type FieldLabelProps = ComponentPropsWithRef<'label'>;\n\nexport type FieldControlProps = Omit<ComponentPropsWithRef<'input'>, 'children'>;\n\nexport type FieldDescriptionProps = ComponentPropsWithRef<'p'>;\n\nexport type FieldErrorProps = ComponentPropsWithRef<'div'> & {\n /**\n * Controls when the error is shown. `true` always shows it (for externally/caller-driven\n * validity, e.g. presence-only checks with no native constraint validation); a\n * `ValidityState` key shows it only when that specific native validity flag is set. Omit to\n * fall back to Base UI's default: shown whenever the field's tracked validity is invalid.\n * Note `match={false}` does not suppress the error — it falls back to that default\n * invalid-driven behavior; callers needing a boolean should use `invalid ? true : 'customError'`.\n * Only consulted on the unbound path — a bound `Field.Error` renders from the field contract's\n * name and react-hook-form's error state instead.\n */\n match?: boolean | keyof ValidityState;\n};\n\nexport type FieldValidityProps = {\n children: (state: FieldValidityState) => ReactNode;\n};\n\n/** One choice of a field whose value is picked from a list. Platform-owned; an author reorders the part, not the list. */\nexport type FieldOption = Readonly<{ value: string; label: string }>;\n\n/** A rule member constrained to `value`, carrying its own message — react-hook-form's own shape for\n * a constrained validation rule, declared here as our own type (Decision 5). */\nexport type FieldRuleConstraint<T> = Readonly<{ value: T; message: string }>;\n\n/** A field-level validator: reads the live value, returns `true` (valid), a message, or `false`. */\nexport type FieldValidator = (value: unknown) => boolean | string;\n\n/**\n * The fieldset's validation rule for this field, handed to `useBoundField` and mapped internally to\n * react-hook-form's `RegisterOptions` (`toRegisterOptions`) — nothing that imports this type from the\n * barrel ever names a react-hook-form type (RFC `Dependencies`).\n *\n * These seven members are a starting point measured against every rule this repository authors\n * today, not a closed contract: `RegisterOptions` carries more (`setValueAs`, `deps`, `valueAsNumber`,\n * …), and a member is added here the day a field actually needs it — this is not a deliberately closed\n * set to work around.\n */\nexport type FieldRule = Readonly<{\n required?: boolean | string | FieldRuleConstraint<boolean>;\n min?: number | string | FieldRuleConstraint<number | string>;\n max?: number | string | FieldRuleConstraint<number | string>;\n minLength?: number | FieldRuleConstraint<number>;\n maxLength?: number | FieldRuleConstraint<number>;\n pattern?: RegExp | FieldRuleConstraint<RegExp>;\n validate?: FieldValidator | Readonly<Record<string, FieldValidator>>;\n}>;\n\n/**\n * The one place `RegisterOptions` is named as a value type. `FieldRule`'s members are declared\n * independently of react-hook-form's (Decision 5), but each already carries react-hook-form's own\n * runtime shape (a bare value, or `{ value, message }`), so this is an assertion, not a per-member\n * transform. `field-rule.type-test.tsx` pins the boundary from the other side: it fails to compile if\n * `FieldRule` ever widens back to a bare `RegisterOptions` alias.\n */\nfunction toRegisterOptions(rule: FieldRule | undefined): RegisterOptions | undefined {\n return rule as RegisterOptions | undefined;\n}\n\n/**\n * A control's own bid to make its field required. A control raises; it never lowers — so `false` and\n * an absent raise are the same thing, no opinion, and a baseline that already says required survives\n * either. `message` is the copy the raise brings with it (`PhoneField`'s `errorRequired`), used only\n * when the raise is what carries the field to required.\n */\nexport type FieldRequirementRaise = Readonly<{\n required?: boolean;\n message?: string;\n}>;\n\n/**\n * One field's requiredness, resolved once and read everywhere: the announcement, the blank check and\n * the error copy all come from here, so they cannot disagree.\n */\nexport type ResolvedRequiredness = Readonly<{\n /** `baselineRequired || authorRaise`. Spread into `aria-required` as `required || undefined`, so a\n * field never announces `aria-required=\"false\"`. */\n required: boolean;\n /** What the blank check reports. Absent when neither side supplied copy. */\n message?: string;\n /** The rule to register with: the baseline, carrying the blank check when the field is required. */\n rule: FieldRule | undefined;\n}>;\n\n/**\n * react-hook-form's own reading of `required`: `.value` for the object form\n * (`{ value: boolean; message: string }`), plain truthiness otherwise (a boolean or a message\n * string). A message string is itself the copy, which is why the two are read together.\n */\nfunction readBaseline(rule: FieldRule | undefined): { required: boolean; message?: string } {\n const required = rule?.required;\n if (typeof required === 'object' && required !== null) {\n return { required: Boolean(required.value), message: required.value ? required.message : undefined };\n }\n if (typeof required === 'string') return { required: true, message: required };\n return { required: Boolean(required) };\n}\n\n/** A `validate` member is either one function or a record of named ones; downstream only wants the record. */\nfunction normaliseValidators(validate: FieldRule['validate']): Record<string, FieldValidator> {\n if (!validate) return {};\n return typeof validate === 'function' ? { validate } : { ...validate };\n}\n\n/**\n * Composes `validator` into `rule` under `name`, alongside whatever the rule already validates —\n * never instead of it. The two composites reach for this to keep their own format check while a\n * fieldset-supplied validator stays in force; before it, both discarded their own validation whole\n * the moment the fieldset supplied any.\n */\nexport function mergeFieldValidator(rule: FieldRule | undefined, name: string, validator: FieldValidator): FieldRule {\n return { ...rule, validate: { ...normaliseValidators(rule?.validate), [name]: validator } };\n}\n\n/**\n * The one resolution of `required = baselineRequired || authorRaise`. The fieldset's `FieldRule` is\n * the baseline; a control may raise a field to required and never lower one, so `raise.required`\n * only ever adds. Read-only deliberately plays no part: a field that is read-only and required stays\n * required, and an unsatisfiable form is the declared baseline's fault, not this function's.\n *\n * Baseline copy wins over the raise's, matching react-hook-form's own order — it evaluates `required`\n * before `validate`, so the fieldset's message was already the one a shopper saw whenever both existed.\n *\n * `required` catches an empty string but not a space-filled one (`inputValue === ''` is\n * react-hook-form's only emptiness test for a string), so the blank check goes in beside it. It is\n * installed last, so it cannot be displaced by a same-named validator from the rule.\n */\nexport function resolveRequiredness(rule: FieldRule | undefined, raise?: FieldRequirementRaise): ResolvedRequiredness {\n const baseline = readBaseline(rule);\n const required = baseline.required || Boolean(raise?.required);\n\n if (!required) return { required: false, rule };\n\n const message = baseline.message ?? (baseline.required ? undefined : raise?.message);\n const notBlank: FieldValidator = (value) => String(value ?? '').trim().length > 0 || message || false;\n\n return { required, message, rule: { ...mergeFieldValidator(rule, 'notBlank', notBlank), required: message ?? true } };\n}\n\n/**\n * One field's identity and its static facts: the argument list `useController` needs, hoisted out of\n * a prop-drill that composition made impossible. Not a mirror of state react-hook-form also holds —\n * it carries NO live value, so it never changes while the shopper types, and the parts subscribe to\n * react-hook-form for value, error, dirty and touched.\n */\nexport type FieldContract = Readonly<{\n /** Full, namespaced react-hook-form field name, e.g. `shippingAddress.street`. */\n name: string;\n /** Resolved label text: the Control's `label` prop, else the platform's default. */\n label?: string;\n placeholder?: string;\n /** Seed value, registered as react-hook-form's field-level `defaultValue`. */\n defaultValue?: unknown;\n rule?: FieldRule;\n /** Only for a field whose value is picked from a list. Unread until `Field.Select` is added. */\n options?: readonly FieldOption[];\n disabled?: boolean;\n readOnly?: boolean;\n autoComplete?: string;\n inputMode?: 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url';\n}>;\n\n/** Supplies the field contract to everything below it. Renders no DOM. Never catalogued. */\nexport type FieldBindingProps = FieldContract & {\n children?: ReactNode;\n};\n\n/**\n * Provided by a fieldset. Declares the one namespace every name registered through it belongs to, and\n * registers a full field name, returning its unregister.\n */\nexport type FieldsetFieldRegistry = {\n /**\n * The namespace this fieldset owns — the prefix of every full name its own controls register. Declared\n * by the provider, never inferred from a caller.\n */\n namespace: string;\n /**\n * Registers a full, namespaced field name and returns a release function. Refcounted by the provider,\n * so two callers holding one name produce one entry, released when the last of them releases. The\n * returned function releases at most once.\n */\n registerFieldName: (name: string) => () => void;\n};\n\n/** What `useFieldsetFieldNames` hands a fieldset: the value to provide, and the list to register. */\nexport type FieldsetFieldNames = Readonly<{\n /** Referentially stable while `namespace` is unchanged. Goes straight into the context provider. */\n registry: FieldsetFieldRegistry;\n /** Every full field name currently held, in first-registration order. Stable identity. */\n getFieldNames: () => readonly string[];\n}>;\n\n/** New bound part. Reads the contract, binds through useBoundField, drives Checkbox.Root. */\nexport type FieldCheckboxProps = {\n readonly className?: string;\n readonly children?: ReactNode;\n};\n\n// ---------------------------------------------------------------------------\n// Field contract context\n// ---------------------------------------------------------------------------\n\nconst FieldContext = createContext<FieldContract | null>(null);\n\n/** Reads the field contract. Returns null when no binding is above the caller. */\nexport function useField(): FieldContract | null {\n return useContext(FieldContext);\n}\n\n/**\n * Per (control, field name), the seed the *fieldset supplied* for that name — `contract.defaultValue`\n * as handed down, not the value any one part narrowed it to before calling `resetField`. The\n * distinction only shows up where the RFC says two parts may bind one name (\"A fieldset registers\n * once, collecting the field names its own children mount, refcounted so that a part remounting, or\n * two parts binding one name, never unregisters a name still in use\"): a text part and a checkbox\n * part over the same name narrow one seed to two different types, so a ledger holding the narrowed\n * value disagrees with itself on every render — neither part's entry ever satisfies the other's\n * `seedsEqual` check, and the two reset each other forever. Keyed on what the fieldset supplied, both\n * parts read the same entry, the first to run adopts and the rest skip. The second part's own\n * `useController` registration still carries its own narrowing, so it reads dirty against a baseline\n * it did not set — the honest outcome, and better than a hang.\n *\n * Keyed by the `control` object itself rather than by any `FieldBinding` component instance. Adoption is a\n * property of the field name within this form, not of whichever component instance happens to be\n * mounted right now: a fieldset's own conditional control (the `documentType` gate on\n * `ClientProfileDocumentControl`, a country-descriptor swap in `ShippingAddressFieldset`) unmounts and\n * remounts its `FieldBinding` with a brand-new instance that remembers nothing, while the shopper's\n * edit survives the unmount in `control._formValues` — nothing in this codebase sets\n * `shouldUnregister`. A `useRef` latch scoped to the instance cannot see that history and re-adopts the\n * stale seed over the surviving edit; this ledger can, because it outlives the instance. A `WeakMap` so\n * a form that itself unmounts (a fresh `useForm()` call, a fresh `control`) starts over empty, exactly\n * as it should.\n *\n * A `Map` of seeds, not a `Set` of names: recording only that a name was adopted cannot distinguish a\n * seed already in force from a different one that supersedes it, so a later `defaultValue` could never\n * reach the form — that was the whole bug this ledger replaces. `has(name)` is read separately from\n * `get(name)` everywhere below, so \"never adopted\" and \"adopted `undefined`\" stay distinguishable\n * states.\n */\nconst adoptedSeeds = new WeakMap<Control, Map<string, unknown>>();\n\nfunction adoptedSeedsFor(control: Control): Map<string, unknown> {\n let seeds = adoptedSeeds.get(control);\n if (!seeds) {\n seeds = new Map();\n adoptedSeeds.set(control, seeds);\n }\n return seeds;\n}\n\n/**\n * Structural rather than referential equality between two seeds, mirroring `valuesEqual` in\n * `form.tsx:128-130` and its documented reasoning: a field's seed is a primitive or plain record a\n * bound Control's contract carries (a string, a boolean, a small object) — never a function or a\n * circular structure — so a `JSON.stringify` comparison is a safe stand-in for a real deep-equal.\n * Duplicated rather than imported: `field.tsx` imports nothing from `form.tsx`, and the particles are\n * deliberately independent modules.\n *\n * `Object.is` is rejected here even though neither shipped shape's `normalise` (`TEXT_FIELD_VALUE`,\n * `BOOLEAN_FIELD_VALUE`) can hand this function anything but a primitive today — this guard is\n * defensive against a shape that does not exist yet, not against a reachable path. The day a shape's\n * `normalise` returns a record or an array, a fieldset that hands out a freshly-allocated seed with\n * the same content on every render would fail `Object.is` against itself, and the\n * resetField → formState → render → resetField chain below would never terminate (measured: swapping\n * in `Object.is` hung the suite past 150 seconds, until a render ceiling was added that turns the same\n * mutation into a named failure in seconds). Do not remove this as dead code on the\n * grounds that no object-shaped seed reaches it today — the regression test that pins it is\n * `field.test.tsx`'s `'terminates when the seed is a fresh, structurally identical object literal on\n * every render'`, which exercises `useSeedAdoption` through a test-only shape precisely because no\n * shipped shape can.\n */\nfunction seedsEqual(a: unknown, b: unknown): boolean {\n return a === b || JSON.stringify(a) === JSON.stringify(b);\n}\n\n/**\n * react-hook-form copies a per-field `defaultValue` into control._defaultValues only when\n * shouldUnregister is set, which nothing here sets — so without this, the pristine comparison for a\n * seeded field runs against `undefined` and any touched field stays dirty for good. Adopted once per\n * (control, name) for a given seed, tracked in `adoptedSeeds`, which survives this component instance\n * unmounting and remounting — so a remount with the same stale seed prop never overwrites a shopper's\n * live edit, and a later, *different* seed reaches a field the shopper has not touched without the\n * shopper having to reload the page.\n *\n * Called from `useBoundField`, not from `FieldBinding` (relocated, T57): the caller is now the very\n * part whose own `useController` call registers `name`. `useController` calls `control.register(name,\n * …)` from a `useRef` initialiser during the first render, and `register` adds to `_names.mount`\n * synchronously — before that render returns, let alone before this effect's first run. So the mount\n * guard below is satisfied on this effect's very first run for the caller's own name; the ordering\n * `FieldBinding` could not rely on (a descendant control mounting on a *later* commit than the binding\n * around it) no longer arises, because binder and adopter are now one and the same component instance.\n * The T-5 test (`field.test.tsx`, a control that shows up on a later render than its enclosing\n * `FieldBinding`) still passes — not because that race is still possible, but because nothing here\n * special-cases it away: the guard simply reads true the one time it is asked.\n *\n * No dependency array all the same: this effect must still re-run on every render, because the guards\n * below can otherwise miss their only remaining chance — the dirty-then-clean case. A seed arriving\n * while the field is dirty is skipped by the third guard and never recorded; the only later signal that\n * it can now be adopted is the field itself turning clean, which changes neither `name` nor the\n * normalised seed this hook receives, so a dependency array keyed to its own arguments would never\n * re-invoke it. Re-running on every render costs nothing extra here: every guard below but the\n * adopting one is a no-op, and useFormContext() already forces a re-render on every formState emission\n * regardless (Invariant 4 is violated in letter, not by this effect), so this adds no new re-render of\n * its own.\n *\n * The first guard below is what does termination, not just correctness: react-hook-form rebuilds\n * formState on every emission and FormProvider memoises its context value with formState in its own\n * dependency list, so useFormContext()'s return value changes identity after every resetField call.\n * Without that guard, that identity change would drive another render, which would call resetField\n * again, which would change formState again — an unbounded loop. Its early return breaks it: once the\n * ledger's recorded seed for this name is equal (by `seedsEqual`) to the current `defaultValue`, every\n * further run for that name exits before reaching resetField — which is also why it must be the first\n * check after the ledger lookup, ahead of even the mount guard.\n *\n * Precondition this re-seed relies on and does not itself enforce: `defaultValue` regressing to a\n * reactive fragment's incomplete-read fallback once the field has already adopted real data.\n * Probing this against `useReactiveEntity`'s fallback expression (`use-reactive-entity.ts:57`), mounting\n * a clean field over real, complete data and then trying to make `fragmentResult.complete` flip back to\n * false: measured as **reachable**, not merely suspected. Two of the three probes reproduced it —\n * evicting a field the fragment selects (`cache.evict({ id, fieldName })`, then `cache.gc()`) and\n * moving the root query's entity id to one never written to the cache (a session or orderForm change)\n * both regress the read, and this effect cannot tell that apart from a genuine, saved change: the\n * second probe blanked a clean control from \"Ada\" to \"\", and an independent audit reproduced it.\n * `client.clearStore()` on a still-mounted, still-referenced entity did not reproduce it. The\n * fieldsets close that gap above this hook: they withhold their controls until `useEntityDataResolved`\n * reports their entity resolved, so a regressed read never reaches this effect through a fieldset.\n */\nfunction useSeedAdoption(name: string, suppliedSeed: unknown, narrowedSeed: unknown): void {\n const form = useFormContext();\n\n useEffect(() => {\n if (!form) return;\n const seeds = adoptedSeedsFor(form.control);\n if (seeds.has(name) && seedsEqual(seeds.get(name), suppliedSeed)) return;\n if (!form.control._names.mount.has(name)) return;\n if (seeds.has(name) && form.getFieldState(name).isDirty) return;\n form.resetField(name, { defaultValue: narrowedSeed });\n seeds.set(name, suppliedSeed);\n });\n}\n\nexport function FieldBinding({\n name,\n label,\n placeholder,\n defaultValue,\n rule,\n options,\n disabled,\n readOnly,\n autoComplete,\n inputMode,\n children,\n}: FieldBindingProps): ReactNode {\n // No live value in the contract (Decision 1), so it is stable across a whole editing session as\n // long as the caller's own props are stable — memoised here so an unrelated re-render of whatever\n // renders this binding never produces a new object identity for subscribers.\n const contract = useMemo<FieldContract>(\n () => ({ name, label, placeholder, defaultValue, rule, options, disabled, readOnly, autoComplete, inputMode }),\n [name, label, placeholder, defaultValue, rule, options, disabled, readOnly, autoComplete, inputMode],\n );\n\n return <FieldContext.Provider value={contract}>{children}</FieldContext.Provider>;\n}\n\n// ---------------------------------------------------------------------------\n// Bound part support — the empty value and seed narrowing a part owns (T57)\n// ---------------------------------------------------------------------------\n\n/**\n * What a bound part knows about its own value that `FieldBinding` does not (RFC `The rest of the\n * parts`): the value it holds when it holds nothing, and how to narrow an arbitrary seed to that\n * type. Each shape is the pair together, not two loose values, so a part cannot pair a boolean\n * `empty` with a string `normalise`.\n */\nexport type FieldValueShape<T> = Readonly<{\n /** The value `useBoundField`'s registered clearer writes — this field's own type, not `''` by default. */\n empty: T;\n /** Narrows an arbitrary seed (`contract.defaultValue`) to this part's own value type. */\n normalise: (seed: unknown) => T;\n}>;\n\n/** A text-shaped bound field: empty is `''`, and a non-string seed narrows to `''`. */\nexport const TEXT_FIELD_VALUE: FieldValueShape<string> = {\n empty: '',\n normalise: (seed) => (typeof seed === 'string' ? seed : ''),\n};\n\n/** A boolean-shaped bound field: empty is `false`, and any seed narrows through `Boolean(...)`. */\nexport const BOOLEAN_FIELD_VALUE: FieldValueShape<boolean> = {\n empty: false,\n normalise: (seed) => Boolean(seed),\n};\n\n/**\n * What `useBoundField` hands back: react-hook-form's own `field` object, reshaped into a type this\n * repository declares (Decision 6) — returning `useController`'s own `ControllerRenderProps` would put\n * a react-hook-form type back on the barrel the moment this hook is exported. `value: T`, not\n * `unknown`, because `BoundFieldControl` passes `field.value` straight into `BaseField.Control`, which\n * an `unknown` would reject. `ref` is a plain `RefCallback<HTMLElement>`, assignable to both\n * `Ref<HTMLInputElement>` and `Ref<HTMLButtonElement>`, so every existing `ref={field.ref}` site and\n * `useComposedRef` call keep compiling unchanged.\n */\nexport type BoundField<T> = Readonly<{\n name: string;\n value: T;\n onChange: (...event: unknown[]) => void;\n onBlur: () => void;\n ref: RefCallback<HTMLElement>;\n /** The resolved requiredness, so the control that renders the input announces the same value the\n * registered rule enforces. Spread as `required || undefined` — a field never announces `false`. */\n required: boolean;\n}>;\n\n/**\n * The only caller of `useController` in this package (I-1). Registers the field with react-hook-form,\n * adopts the same normalised seed as the dirty baseline (Decision 1), and registers a clearer that\n * writes the shape's own empty value for as long as the part stays mounted (FR-5) — three facts a\n * bound part previously scattered across its own call site, `FieldBinding` and `FormClear`.\n *\n * The effective rule is `rule ?? contract.rule`: a part with no rule of its own (`BoundFieldControl`,\n * `BoundFieldCheckbox`, `BoundFieldSelectRoot`) falls back to the contract's; `BoundPhoneField` and\n * `BoundDocumentField` pass their own `useMemo`-derived rule, which already merges the particle's\n * format check into `contract.rule` rather than replacing it.\n *\n * Requiredness resolves here rather than at each call site (FR: one chokepoint), so no bound control\n * can register a rule whose enforcement and announcement disagree, or forget the blank check. A\n * control that wants its field required passes a `raise`; only `FieldSelectTrigger`, which announces\n * from a different component than the one that binds, calls `resolveRequiredness` for itself.\n */\nexport function useBoundField<T>(\n contract: FieldContract,\n shape: FieldValueShape<T>,\n rule?: FieldRule,\n raise?: FieldRequirementRaise,\n): BoundField<T> {\n const { control, setValue } = useFormContext();\n // Memoised on the raise's two scalars, not on the raise object: callers build it inline, so a\n // fresh identity every render would hand `useController` a fresh `rules` object every render.\n const raiseRequired = raise?.required;\n const raiseMessage = raise?.message;\n const requiredness = useMemo(\n () => resolveRequiredness(rule ?? contract.rule, { required: raiseRequired, message: raiseMessage }),\n [rule, contract.rule, raiseRequired, raiseMessage],\n );\n // One named local, referenced by both useController's defaultValue and the adoption call below\n // (AC-3) — registration and the dirty baseline must never drift apart by reading two independent\n // normalise() calls.\n const seed = shape.normalise(contract.defaultValue);\n\n const { field } = useController({\n name: contract.name,\n rules: toRegisterOptions(requiredness.rule),\n defaultValue: seed,\n });\n\n useSeedAdoption(contract.name, contract.defaultValue, seed);\n\n useEffect(\n () =>\n registerFieldClearer(control, contract.name, () => setValue(contract.name, shape.empty, { shouldDirty: true })),\n [control, contract.name, setValue, shape.empty],\n );\n\n return { ...field, required: requiredness.required };\n}\n\n// ---------------------------------------------------------------------------\n// Fieldset registration seam (provider ships from a later fieldset task)\n// ---------------------------------------------------------------------------\n\n/** Exported so those tasks import it rather than redefine it. */\nexport const FieldsetFieldContext = createContext<FieldsetFieldRegistry | null>(null);\n\n/** Unchanged: the registry above the caller, or null. Now carrying a namespace. */\nexport function useFieldsetContext(): FieldsetFieldRegistry | null {\n return useContext(FieldsetFieldContext);\n}\n\n/**\n * Registers `${namespace}.${key}` with the enclosing fieldset while the caller is mounted, and returns\n * that full name. Throws during render when a registry is above the caller and declares a different\n * namespace. Registers nothing and throws nothing when no registry is above. Holds no state: the\n * refcount belongs to the provider.\n */\nexport function useFieldsetField(namespace: string, key: string): string {\n const registry = useFieldsetContext();\n const name = `${namespace}.${key}`;\n\n if (registry && registry.namespace !== namespace) {\n throw new Error(\n `A control asked to register \"${name}\", but the fieldset registry above it owns the namespace \"${registry.namespace}\". A registry serves exactly one namespace, declared by the fieldset that provides it.`,\n );\n }\n\n useEffect(() => {\n if (!registry) return;\n return registry.registerFieldName(name);\n }, [registry, name]);\n\n return name;\n}\n\n/**\n * The field-name bookkeeping a fieldset provides. Refcounted, so two callers of one name collapse to one\n * entry however they arrived — including a caller that reaches `registerFieldName` directly.\n */\nexport function useFieldsetFieldNames(namespace: string): FieldsetFieldNames {\n // Own state, not module state: this ref lives on the fieldset's own component instance, so it\n // survives every re-render regardless of whether the caller memoises the registry it hands out.\n const counts = useRef(new Map<string, number>());\n\n const registerFieldName = useCallback((name: string) => {\n counts.current.set(name, (counts.current.get(name) ?? 0) + 1);\n\n // One-shot: a counted Map, unlike the Set it replaces, is not idempotent on release. Without this\n // latch a double-invoked unregister (StrictMode, or a defensive caller) would decrement past a\n // second live holder and evict a name it still holds.\n let released = false;\n return () => {\n if (released) return;\n released = true;\n\n const remaining = (counts.current.get(name) ?? 0) - 1;\n if (remaining > 0) {\n counts.current.set(name, remaining);\n } else {\n counts.current.delete(name);\n }\n };\n }, []);\n\n const getFieldNames = useCallback((): readonly string[] => Array.from(counts.current.keys()), []);\n\n // Memoised on namespace: a fieldset that re-points at a different namespace produces a new registry\n // object, so every mounted control re-registers under the new namespace in the same commit.\n const registry = useMemo<FieldsetFieldRegistry>(\n () => ({ namespace, registerFieldName }),\n [namespace, registerFieldName],\n );\n\n return { registry, getFieldNames };\n}\n\n/**\n * Throws during render when an ancestor fieldset is already providing field registration for this\n * subtree. Every fieldset calls it in one line.\n */\nexport function useNoAncestorFieldset(componentName: string): void {\n const ancestor = useFieldsetContext();\n\n if (ancestor) {\n throw new Error(\n `${componentName} cannot be nested inside another fieldset. An ancestor fieldset owning the namespace \"${ancestor.namespace}\" already provides field registration for this subtree, so this fieldset's controls would register under that namespace instead of their own. Compose fieldsets as siblings under the same FormRoot instead of nesting them.`,\n );\n }\n}\n\n// ---------------------------------------------------------------------------\n// Definitions\n// ---------------------------------------------------------------------------\n\nexport const FieldRootDefinition = defineComponent<FieldRootProps>({\n name: 'FieldRoot',\n importPath: '@vtex/faststore/components',\n component: FieldRoot,\n providesContext: 'field',\n editor: { label: 'Field Root', category: 'layout' },\n schema: {\n disabled: { type: 'boolean', default: false, label: 'Disabled' },\n },\n guideline:\n 'Form field container that connects a label, input, and validation messages via ARIA. Use Field.Control as the input element, or place a compatible Base UI input (Input, Checkbox, Select) as a direct child. Set invalid=true to trigger Field.Error display. Wrapping a bound Control feeds invalid/dirty/touched from react-hook-form automatically.',\n});\n\nexport const FieldLabelDefinition = defineComponent<FieldLabelProps>({\n name: 'FieldLabel',\n importPath: '@vtex/faststore/components',\n component: FieldLabel,\n requiresContext: 'field',\n editor: { label: 'Field Label', category: 'layout' },\n schema: {},\n guideline:\n \"Accessible label inside Field.Root. Automatically associated with Field.Control's input via ARIA. Place before Field.Control in the DOM. Under a bound Control, a childless Field.Label renders the field contract's label.\",\n});\n\nexport const FieldControlDefinition = defineComponent<FieldControlProps>({\n name: 'FieldControl',\n importPath: '@vtex/faststore/components',\n component: FieldControl,\n requiresContext: 'field',\n editor: { label: 'Field Control', category: 'layout' },\n schema: {},\n guideline:\n \"Renders a native `<input>` element directly. It IS the input — do not place any child inside it. Pass input attributes (type, placeholder, required, etc.) directly as props. It is automatically linked to Field.Label and Field.Error via ARIA. Under a bound Control, it registers with react-hook-form using the field contract's name, seed value, and validation rule.\",\n});\n\nexport const FieldDescriptionDefinition = defineComponent<FieldDescriptionProps>({\n name: 'FieldDescription',\n importPath: '@vtex/faststore/components',\n component: FieldDescription,\n requiresContext: 'field',\n editor: { label: 'Field Description', category: 'layout' },\n schema: {},\n guideline:\n 'Helper text inside Field.Root. Automatically linked to the control via aria-describedby. Always visible regardless of validation state.',\n});\n\nexport const FieldErrorDefinition = defineComponent<FieldErrorProps>({\n name: 'FieldError',\n importPath: '@vtex/faststore/components',\n component: FieldError,\n requiresContext: 'field',\n editor: { label: 'Field Error', category: 'layout' },\n schema: {},\n guideline:\n \"Validation error message inside Field.Root. Shown when the field is in an invalid state. Linked to the control via aria-describedby. Under a bound Control, it renders react-hook-form's error message for the field contract's name.\",\n});\n\nexport const FieldValidityDefinition = defineComponent<FieldValidityProps>({\n name: 'FieldValidity',\n importPath: '@vtex/faststore/components',\n component: FieldValidity,\n requiresContext: 'field',\n editor: { label: 'Field Validity', category: 'layout' },\n schema: {},\n guideline:\n \"Validation feedback slot using a render prop for custom messages derived from the field's validity state. Use for dynamic messages when Field.Error text is not fixed.\",\n});\n\nexport const FieldCheckboxDefinition = defineComponent<FieldCheckboxProps>({\n name: 'FieldCheckbox',\n importPath: '@vtex/faststore/components',\n component: FieldCheckbox,\n requiresContext: 'field',\n editor: { label: 'Field Checkbox', category: 'action' },\n schema: {},\n guideline:\n 'Bound boolean control over the shipped Checkbox particle: reads the enclosing field contract and drives Checkbox.Root through react-hook-form. Compose Checkbox.Indicator as a child for the visual check mark. Place inside Field.Root, the only ancestor that provides the field context it requires today — a bound Control will satisfy it too, once one ships.',\n});\n\n// ---------------------------------------------------------------------------\n// Parts\n// ---------------------------------------------------------------------------\n\nexport function FieldRoot({ disabled, invalid, name, className, children, ...props }: FieldRootProps) {\n const contract = useField();\n const formContext = useFormContext();\n\n if (contract && formContext) {\n return (\n <BoundFieldRoot\n {...props}\n contract={contract}\n disabled={disabled}\n invalid={invalid}\n name={name}\n className={className}\n >\n {children}\n </BoundFieldRoot>\n );\n }\n\n return (\n <BaseField.Root\n {...props}\n disabled={disabled}\n invalid={invalid}\n name={name}\n className={className}\n data-fs-field-root=\"\"\n >\n {children}\n </BaseField.Root>\n );\n}\n\ntype BoundFieldRootProps = FieldRootProps & { contract: FieldContract };\n\nfunction BoundFieldRoot({ contract, disabled, invalid, name, className, children, ...props }: BoundFieldRootProps) {\n const { getFieldState, control } = useFormContext();\n const {\n invalid: rhfInvalid,\n isDirty,\n isTouched,\n } = getFieldState(contract.name, useFormState({ name: contract.name }));\n\n // Base UI's `FieldRoot` computes `dirty = dirtyProp ?? dirtyState`, and `setDirty` returns\n // immediately once `dirtyProp !== undefined` (`FieldRoot.js:50-67`) — so passing `false`\n // unconditionally disables Base UI's own fallback tracking exactly as hard as passing `true` did.\n // That fallback is still needed for any name react-hook-form never registers (a raw Base UI control\n // under a bound `Field.Root`), so the prop is three-state: `undefined` while the name is unmounted,\n // then react-hook-form's own value once it registers — which always wins from then on, in both\n // directions, closing the freeze-at-true latch the unconditional form reopened.\n const isRegistered = control._names.mount.has(contract.name);\n\n return (\n <BaseField.Root\n {...props}\n name={name ?? contract.name}\n disabled={disabled ?? contract.disabled}\n invalid={invalid ?? rhfInvalid}\n dirty={isRegistered ? isDirty : undefined}\n touched={isRegistered ? isTouched : undefined}\n className={className}\n data-fs-field-root=\"\"\n >\n {children}\n </BaseField.Root>\n );\n}\n\nexport function FieldLabel({ className, children, ...props }: FieldLabelProps) {\n const contract = useField();\n const formContext = useFormContext();\n\n if (contract && formContext) {\n return (\n <BoundFieldLabel {...props} contract={contract} className={className}>\n {children}\n </BoundFieldLabel>\n );\n }\n\n return (\n <BaseField.Label {...props} className={className} data-fs-field-label=\"\">\n {children}\n </BaseField.Label>\n );\n}\n\ntype BoundFieldLabelProps = FieldLabelProps & { contract: FieldContract };\n\nfunction BoundFieldLabel({ contract, className, children, ...props }: BoundFieldLabelProps) {\n return (\n <BaseField.Label {...props} className={className} data-fs-field-label=\"\">\n {children ?? contract.label}\n </BaseField.Label>\n );\n}\n\nexport function FieldControl({ className, ...props }: FieldControlProps) {\n const contract = useField();\n const formContext = useFormContext();\n\n if (contract && formContext) {\n return <BoundFieldControl {...props} contract={contract} className={className} />;\n }\n\n return <BaseField.Control {...props} className={className} data-fs-field-control=\"\" />;\n}\n\ntype BoundFieldControlProps = FieldControlProps & { contract: FieldContract };\n\nfunction BoundFieldControl({\n contract,\n placeholder,\n disabled,\n readOnly,\n autoComplete,\n inputMode,\n className,\n ...props\n}: BoundFieldControlProps) {\n const field = useBoundField(contract, TEXT_FIELD_VALUE);\n\n return (\n <BaseField.Control\n {...props}\n name={field.name}\n value={field.value}\n onChange={field.onChange}\n onBlur={field.onBlur}\n ref={field.ref}\n placeholder={placeholder ?? contract.placeholder}\n disabled={disabled ?? contract.disabled}\n readOnly={readOnly ?? contract.readOnly}\n autoComplete={autoComplete ?? contract.autoComplete}\n inputMode={inputMode ?? contract.inputMode}\n aria-required={field.required || undefined}\n className={className}\n data-fs-field-control=\"\"\n />\n );\n}\n\nexport function FieldDescription({ className, children, ...props }: FieldDescriptionProps) {\n return (\n <BaseField.Description {...props} className={className} data-fs-field-description=\"\">\n {children}\n </BaseField.Description>\n );\n}\n\nexport function FieldError({ className, children, ...props }: FieldErrorProps) {\n const contract = useField();\n const formContext = useFormContext();\n\n if (contract && formContext) {\n return (\n <BoundFieldError {...props} contract={contract} className={className}>\n {children}\n </BoundFieldError>\n );\n }\n\n return (\n <BaseField.Error {...props} className={className} data-fs-field-error=\"\">\n {children}\n </BaseField.Error>\n );\n}\n\ntype BoundFieldErrorProps = FieldErrorProps & { contract: FieldContract };\n\n// `match` is not destructured for use — its documented meaning applies to the unbound path only\n// (Decision: bound visibility is driven by react-hook-form's own error for the contract's name).\nfunction BoundFieldError({ contract, className, children, match: _match, ...props }: BoundFieldErrorProps) {\n const { getFieldState } = useFormContext();\n const { error } = getFieldState(contract.name, useFormState({ name: contract.name }));\n\n if (!error) return null;\n // A `validate` that reports failure with `false` rather than a string (e.g. DocumentField's\n // check-digit validator when no `errorMessage` was authored) leaves react-hook-form's own\n // `error.message` empty. Rendering in that case would put an empty `<div data-fs-field-error>` on\n // the page where the field's own default (unbound) anatomy renders nothing at all — a divergence\n // between the composed and default anatomies (finding F4). An author-supplied `children` still\n // always renders regardless, since that text does not depend on react-hook-form's message.\n if (!children && !error.message) return null;\n\n return (\n // `match` forces Base UI past its own native-constraint-validation gate: with no real HTML5\n // constraint on the input, Field.Error's default (no `match`) visibility check reads native\n // validity, not react-hook-form's. We have already decided to render from react-hook-form's\n // error above, so `match` here only lets that decision take effect — it does not affect the\n // message, which is our own `children` below and always wins over Base UI's own computed text.\n <BaseField.Error {...props} match className={className} data-fs-field-error=\"\">\n {children ?? error.message}\n </BaseField.Error>\n );\n}\n\nexport function FieldValidity({ children }: FieldValidityProps) {\n return <BaseField.Validity>{children}</BaseField.Validity>;\n}\n\nexport function FieldCheckbox({ className, children }: FieldCheckboxProps): ReactNode {\n const contract = useField();\n const formContext = useFormContext();\n\n if (contract && formContext) {\n return (\n <BoundFieldCheckbox contract={contract} className={className}>\n {children}\n </BoundFieldCheckbox>\n );\n }\n\n return <Checkbox.Root className={className}>{children}</Checkbox.Root>;\n}\n\ntype BoundFieldCheckboxProps = FieldCheckboxProps & { contract: FieldContract };\n\nfunction BoundFieldCheckbox({ contract, className, children }: BoundFieldCheckboxProps) {\n const field = useBoundField(contract, BOOLEAN_FIELD_VALUE);\n\n return (\n <Checkbox.Root\n checked={field.value}\n onCheckedChange={field.onChange}\n onBlur={field.onBlur}\n ref={field.ref}\n disabled={contract.disabled}\n className={className}\n data-fs-field-checkbox=\"\"\n >\n {children}\n </Checkbox.Root>\n );\n}\n\nexport const Field = {\n Root: FieldRoot,\n Label: FieldLabel,\n Control: FieldControl,\n Description: FieldDescription,\n Error: FieldError,\n Validity: FieldValidity,\n Checkbox: FieldCheckbox,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AAkFA,SAAS,kBAAkB,MAA0D;CACnF,OAAO;AACT;;;;;;AAgCA,SAAS,aAAa,MAAsE;CAC1F,MAAM,WAAW,MAAM;CACvB,IAAI,OAAO,aAAa,YAAY,aAAa,MAC/C,OAAO;EAAE,UAAU,QAAQ,SAAS,KAAK;EAAG,SAAS,SAAS,QAAQ,SAAS,UAAU,KAAA;CAAU;CAErG,IAAI,OAAO,aAAa,UAAU,OAAO;EAAE,UAAU;EAAM,SAAS;CAAS;CAC7E,OAAO,EAAE,UAAU,QAAQ,QAAQ,EAAE;AACvC;;AAGA,SAAS,oBAAoB,UAAiE;CAC5F,IAAI,CAAC,UAAU,OAAO,CAAC;CACvB,OAAO,OAAO,aAAa,aAAa,EAAE,SAAS,IAAI,EAAE,GAAG,SAAS;AACvE;;;;;;;AAQA,SAAgB,oBAAoB,MAA6B,MAAc,WAAsC;CACnH,OAAO;EAAE,GAAG;EAAM,UAAU;GAAE,GAAG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AG,SAA+B;CACzG,MAAM,EAAE,kBAAkB,eAAe;CACzC,MAAM,EAAE,UAAU,cAAc,SAAS,MAAM,aAAa,EAAE,MAAM,SAAS,KAAK,CAAC,CAAC;CAEpF,IAAI,CAAC,OAAO,OAAO;CAOnB,IAAI,CAAC,YAAY,CAAC,MAAM,SAAS,OAAO;CAExC,OAME,oBAACA,MAAU,OAAX;EAAiB,GAAI;EAAO,OAAA;EAAiB;EAAW,uBAAoB;EACzE,UAAA,YAAY,MAAM;CACJ,CAAA;AAErB;AAEA,SAAgB,cAAc,EAAE,YAAgC;CAC9D,OAAO,oBAACA,MAAU,UAAX,EAAqB,SAA6B,CAAA;AAC3D;AAEA,SAAgB,cAAc,EAAE,WAAW,YAA2C;CACpF,MAAM,WAAW,SAAS;CAC1B,MAAM,cAAc,eAAe;CAEnC,IAAI,YAAY,aACd,OACE,oBAAC,oBAAD;EAA8B;EAAqB;EAChD;CACiB,CAAA;CAIxB,OAAO,oBAAC,SAAS,MAAV;EAA0B;EAAY;CAAwB,CAAA;AACvE;AAIA,SAAS,mBAAmB,EAAE,UAAU,WAAW,YAAqC;CACtF,MAAM,QAAQ,cAAc,UAAU,mBAAmB;CAEzD,OACE,oBAAC,SAAS,MAAV;EACE,SAAS,MAAM;EACf,iBAAiB,MAAM;EACvB,QAAQ,MAAM;EACd,KAAK,MAAM;EACX,UAAU,SAAS;EACR;EACX,0BAAuB;EAEtB;CACY,CAAA;AAEnB;AAEA,MAAaC,UAAQ;CACnB,MAAM;CACN,OAAO;CACP,SAAS;CACT,aAAa;CACb,OAAO;CACP,UAAU;CACV,UAAU;AACZ"}
@@ -13,7 +13,7 @@ const FieldsetRootDefinition = defineComponent({
13
13
  category: "layout"
14
14
  },
15
15
  schema: {},
16
- guideline: "Root of an accessible fieldset for grouping related form controls. Compose as: FieldsetRoot > FieldsetLegend + [form controls]. Set disabled on the root to disable all contained inputs."
16
+ guideline: "Root of an accessible fieldset for grouping related form controls. Compose as: FieldsetRoot > FieldsetLegend + [form controls]. `disabled` marks the group with `data-disabled` and disables Field-family descendants through context — it does not set the native `fieldset[disabled]` attribute, so plain inputs, `CheckboxRoot` and `RadioGroup` inside it stay interactive."
17
17
  });
18
18
  const FieldsetLegendDefinition = defineComponent({
19
19
  name: "FieldsetLegend",
@@ -24,7 +24,7 @@ const FieldsetLegendDefinition = defineComponent({
24
24
  category: "layout"
25
25
  },
26
26
  schema: {},
27
- guideline: "Visible title for a Fieldset.Root. Renders as a styled <legend> element."
27
+ guideline: "Visible title for a `FieldsetRoot`. Renders a `div` — not a native `<legend>` — and names the enclosing fieldset through `aria-labelledby`, so it must sit inside a `FieldsetRoot` to label anything; when two are composed, the last one wins."
28
28
  });
29
29
  function FieldsetRoot({ className, children, ...props }) {
30
30
  return /* @__PURE__ */ jsx(Fieldset.Root, {
@@ -1 +1 @@
1
- {"version":3,"file":"fieldset.js","names":["BaseFieldset","Fieldset"],"sources":["../../../src/particles/fieldset/fieldset.tsx"],"sourcesContent":["'use client';\nimport { Fieldset as BaseFieldset } from '@base-ui/react/fieldset';\nimport { defineComponent } from '@vtex/fs-core';\nimport type { ComponentPropsWithRef } from 'react';\n\nexport type FieldsetRootProps = ComponentPropsWithRef<'fieldset'>;\n\nexport type FieldsetLegendProps = ComponentPropsWithRef<'div'>;\n\nexport const FieldsetRootDefinition = defineComponent<FieldsetRootProps>({\n name: 'FieldsetRoot',\n importPath: '@vtex/faststore/components',\n component: FieldsetRoot,\n editor: { label: 'Fieldset Root', category: 'layout' },\n schema: {},\n guideline:\n 'Root of an accessible fieldset for grouping related form controls. Compose as: FieldsetRoot > FieldsetLegend + [form controls]. Set disabled on the root to disable all contained inputs.',\n});\n\nexport const FieldsetLegendDefinition = defineComponent<FieldsetLegendProps>({\n name: 'FieldsetLegend',\n importPath: '@vtex/faststore/components',\n component: FieldsetLegend,\n editor: { label: 'Fieldset Legend', category: 'layout' },\n schema: {},\n guideline: 'Visible title for a Fieldset.Root. Renders as a styled <legend> element.',\n});\n\nexport function FieldsetRoot({ className, children, ...props }: FieldsetRootProps) {\n return (\n <BaseFieldset.Root {...props} className={className} data-fs-fieldset-root=\"\">\n {children}\n </BaseFieldset.Root>\n );\n}\n\nexport function FieldsetLegend({ className, children, ...props }: FieldsetLegendProps) {\n return (\n <BaseFieldset.Legend {...props} className={className} data-fs-fieldset-legend=\"\">\n {children}\n </BaseFieldset.Legend>\n );\n}\n\nexport const Fieldset = {\n Root: FieldsetRoot,\n Legend: FieldsetLegend,\n};\n"],"mappings":";;;;;;AASA,MAAa,yBAAyB,gBAAmC;CACvE,MAAM;CACN,YAAY;CACZ,WAAW;CACX,QAAQ;EAAE,OAAO;EAAiB,UAAU;CAAS;CACrD,QAAQ,CAAC;CACT,WACE;AACJ,CAAC;AAED,MAAa,2BAA2B,gBAAqC;CAC3E,MAAM;CACN,YAAY;CACZ,WAAW;CACX,QAAQ;EAAE,OAAO;EAAmB,UAAU;CAAS;CACvD,QAAQ,CAAC;CACT,WAAW;AACb,CAAC;AAED,SAAgB,aAAa,EAAE,WAAW,UAAU,GAAG,SAA4B;CACjF,OACE,oBAACA,SAAa,MAAd;EAAmB,GAAI;EAAkB;EAAW,yBAAsB;EACvE;CACgB,CAAA;AAEvB;AAEA,SAAgB,eAAe,EAAE,WAAW,UAAU,GAAG,SAA8B;CACrF,OACE,oBAACA,SAAa,QAAd;EAAqB,GAAI;EAAkB;EAAW,2BAAwB;EAC3E;CACkB,CAAA;AAEzB;AAEA,MAAaC,aAAW;CACtB,MAAM;CACN,QAAQ;AACV"}
1
+ {"version":3,"file":"fieldset.js","names":["BaseFieldset","Fieldset"],"sources":["../../../src/particles/fieldset/fieldset.tsx"],"sourcesContent":["'use client';\nimport { Fieldset as BaseFieldset } from '@base-ui/react/fieldset';\nimport { defineComponent } from '@vtex/fs-core';\nimport type { ComponentPropsWithRef } from 'react';\n\nexport type FieldsetRootProps = ComponentPropsWithRef<'fieldset'>;\n\nexport type FieldsetLegendProps = ComponentPropsWithRef<'div'>;\n\nexport const FieldsetRootDefinition = defineComponent<FieldsetRootProps>({\n name: 'FieldsetRoot',\n importPath: '@vtex/faststore/components',\n component: FieldsetRoot,\n editor: { label: 'Fieldset Root', category: 'layout' },\n schema: {},\n guideline:\n 'Root of an accessible fieldset for grouping related form controls. Compose as: FieldsetRoot > FieldsetLegend + [form controls]. `disabled` marks the group with `data-disabled` and disables Field-family descendants through context — it does not set the native `fieldset[disabled]` attribute, so plain inputs, `CheckboxRoot` and `RadioGroup` inside it stay interactive.',\n});\n\nexport const FieldsetLegendDefinition = defineComponent<FieldsetLegendProps>({\n name: 'FieldsetLegend',\n importPath: '@vtex/faststore/components',\n component: FieldsetLegend,\n editor: { label: 'Fieldset Legend', category: 'layout' },\n schema: {},\n guideline:\n 'Visible title for a `FieldsetRoot`. Renders a `div` — not a native `<legend>` — and names the enclosing fieldset through `aria-labelledby`, so it must sit inside a `FieldsetRoot` to label anything; when two are composed, the last one wins.',\n});\n\nexport function FieldsetRoot({ className, children, ...props }: FieldsetRootProps) {\n return (\n <BaseFieldset.Root {...props} className={className} data-fs-fieldset-root=\"\">\n {children}\n </BaseFieldset.Root>\n );\n}\n\nexport function FieldsetLegend({ className, children, ...props }: FieldsetLegendProps) {\n return (\n <BaseFieldset.Legend {...props} className={className} data-fs-fieldset-legend=\"\">\n {children}\n </BaseFieldset.Legend>\n );\n}\n\nexport const Fieldset = {\n Root: FieldsetRoot,\n Legend: FieldsetLegend,\n};\n"],"mappings":";;;;;;AASA,MAAa,yBAAyB,gBAAmC;CACvE,MAAM;CACN,YAAY;CACZ,WAAW;CACX,QAAQ;EAAE,OAAO;EAAiB,UAAU;CAAS;CACrD,QAAQ,CAAC;CACT,WACE;AACJ,CAAC;AAED,MAAa,2BAA2B,gBAAqC;CAC3E,MAAM;CACN,YAAY;CACZ,WAAW;CACX,QAAQ;EAAE,OAAO;EAAmB,UAAU;CAAS;CACvD,QAAQ,CAAC;CACT,WACE;AACJ,CAAC;AAED,SAAgB,aAAa,EAAE,WAAW,UAAU,GAAG,SAA4B;CACjF,OACE,oBAACA,SAAa,MAAd;EAAmB,GAAI;EAAkB;EAAW,yBAAsB;EACvE;CACgB,CAAA;AAEvB;AAEA,SAAgB,eAAe,EAAE,WAAW,UAAU,GAAG,SAA8B;CACrF,OACE,oBAACA,SAAa,QAAd;EAAqB,GAAI;EAAkB;EAAW,2BAAwB;EAC3E;CACkB,CAAA;AAEzB;AAEA,MAAaC,aAAW;CACtB,MAAM;CACN,QAAQ;AACV"}
@@ -1,9 +1,9 @@
1
1
  import { defineComponent } from "../../core/dist/define-component.js";
2
2
  import { defineContentType } from "../../core/dist/define-content-type.js";
3
3
  import "../../core/dist/index.js";
4
- import { Icon } from "../icon/icon.js";
5
4
  import { resolveSafeHref } from "../../utils/safe-href.js";
6
5
  import { NavigationLink } from "../navigation-link/navigation-link.js";
6
+ import { Icon } from "../icon/icon.js";
7
7
  import { Image } from "../image/image.js";
8
8
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
9
9
  //#region src/particles/footer-social/footer-social.tsx
@@ -0,0 +1,104 @@
1
+ import { ComponentDefinition } from "../../core/dist/define-component.js";
2
+ import "../../core/dist/index.js";
3
+ import { ComponentPropsWithRef, ReactNode } from "react";
4
+ //#region src/particles/form/form.d.ts
5
+ /**
6
+ * The structural minimum every SDK user-error type satisfies. `code` is optional so that every
7
+ * shipped shape is assignable, including `RegionUserError`, the one that declares it optional;
8
+ * `ShippingAddressUpdateErrorEntity`, `ClientProfileUserError`, `CartUserError` and
9
+ * `SessionUserError` all declare `Readonly<{ code: string; message: string }>`. There is no shared
10
+ * user-error type in the SDK to reuse.
11
+ */
12
+ export type FormUserError = Readonly<{
13
+ code?: string;
14
+ message: string;
15
+ }>;
16
+ /** What one fieldset hands the form. The form learns nothing else about it. */
17
+ export type FieldsetRegistration = Readonly<{
18
+ /** Matches the field-name prefix every one of this fieldset's controls registers under. */
19
+ namespace: string;
20
+ /** Every full, namespaced field name this fieldset currently has mounted. */
21
+ getFieldNames: () => readonly string[];
22
+ /**
23
+ * Closes over the fieldset's own injected `$actions`. Rejecting is allowed; the form catches it.
24
+ * Must settle: the form gives up on a dispatch still pending after `FORM_DISPATCH_TIMEOUT_MS` and
25
+ * reports it as a failed write. Must also be idempotent: giving up on a dispatch does not cancel it,
26
+ * so a timed-out write may already be landing on the server, and the same payload is re-dispatched on
27
+ * the shopper's next submit while the field stays dirty.
28
+ */
29
+ dispatch: (payload: Record<string, unknown>) => Promise<readonly FormUserError[]>;
30
+ /** Shapes react-hook-form's raw values into the mutation's payload, including type coercion. */
31
+ toPayload: (values: Record<string, unknown>) => Record<string, unknown>;
32
+ /**
33
+ * Machine identifier for this fieldset's write. `FormError` renders it as the
34
+ * `data-fs-form-error-item` attribute value and uses it in two React keys; it is never displayed,
35
+ * because the visible text is each `userError`'s own `message` or `FormError`'s `fallbackMessage`.
36
+ * Its value is the kebab-case ASCII rendering of this registration's own `namespace`
37
+ * (`shippingAddress` → `shipping-address`), so a stylesheet selecting
38
+ * `[data-fs-form-error-item="…"]` needs one predictable shape and no diacritics.
39
+ */
40
+ label: string;
41
+ }>;
42
+ /**
43
+ * One fieldset's write that did not land. An empty `userErrors` means the dispatch rejected or never
44
+ * settled within `FORM_DISPATCH_TIMEOUT_MS`; either way `FormError` renders `fallbackMessage`.
45
+ */
46
+ export type FormWriteFailure = Readonly<{
47
+ label: string;
48
+ userErrors: readonly FormUserError[];
49
+ }>;
50
+ export type FormRegistry = Readonly<{
51
+ /** Stable for the life of the FormRoot. Returns the unregister function. */
52
+ registerFieldset: (registration: FieldsetRegistration) => () => void;
53
+ /** The last submit's failures, in dispatch order. */
54
+ failures: readonly FormWriteFailure[];
55
+ }>;
56
+ /** Throws when no FormRoot is above the caller. */
57
+ export declare function useFormRegistry(): FormRegistry;
58
+ export type FormRootProps = Omit<ComponentPropsWithRef<'form'>, 'onSubmit' | 'action' | 'method' | 'target' | 'encType' | 'dangerouslySetInnerHTML'>;
59
+ export type FormSubmitProps = {
60
+ className?: string;
61
+ label?: string;
62
+ children?: ReactNode;
63
+ };
64
+ export type FormClearProps = {
65
+ className?: string;
66
+ label?: string;
67
+ children?: ReactNode;
68
+ };
69
+ export type FormResetProps = {
70
+ className?: string;
71
+ label?: string;
72
+ children?: ReactNode;
73
+ };
74
+ export type FormErrorProps = {
75
+ className?: string;
76
+ fallbackMessage?: string;
77
+ };
78
+ export declare const FormRootDefinition: ComponentDefinition<FormRootProps>;
79
+ export declare const FormSubmitDefinition: ComponentDefinition<FormSubmitProps>;
80
+ export declare const FormEnterSubmitDefinition: ComponentDefinition<FormSubmitProps>;
81
+ export declare const FormErrorDefinition: ComponentDefinition<FormErrorProps>;
82
+ export declare const FormClearDefinition: ComponentDefinition<FormClearProps>;
83
+ export declare const FormResetDefinition: ComponentDefinition<FormResetProps>;
84
+ export declare function FormRoot({ className, children, onKeyDown, ...props }: FormRootProps): ReactNode;
85
+ export declare function FormSubmit(props: FormSubmitProps): ReactNode;
86
+ /**
87
+ * Renders the same button as `FormSubmit` and additionally allows Enter to submit this FormRoot's own
88
+ * text-entry inputs while mounted — see `handleKeyDown`'s own doc for the form-scoped allowance and
89
+ * the IME carve-out.
90
+ */
91
+ export declare function FormEnterSubmit(props: FormSubmitProps): ReactNode;
92
+ export declare function FormError({ className, fallbackMessage }: FormErrorProps): ReactNode;
93
+ export declare function FormClear({ className, label, children }: FormClearProps): ReactNode;
94
+ export declare function FormReset({ className, label, children }: FormResetProps): ReactNode;
95
+ export declare const Form: {
96
+ Root: typeof FormRoot;
97
+ Submit: typeof FormSubmit;
98
+ EnterSubmit: typeof FormEnterSubmit;
99
+ Error: typeof FormError;
100
+ Clear: typeof FormClear;
101
+ Reset: typeof FormReset;
102
+ };
103
+ //#endregion
104
+ //# sourceMappingURL=form.d.ts.map