@vtex/faststore 0.0.7 → 0.0.10

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 (498) hide show
  1. package/CHANGELOG.md +102 -0
  2. package/dist/actions.json +194 -1
  3. package/dist/catalog.json +3449 -1612
  4. package/dist/cli/index.d.ts +512 -63
  5. package/dist/cli/index.js +2098 -686
  6. package/dist/cli/index.js.map +1 -1
  7. package/dist/cli/server-runtime.js +44 -24
  8. package/dist/cli/server-runtime.js.map +1 -1
  9. package/dist/client.d.ts +5 -1
  10. package/dist/client.js +5 -1
  11. package/dist/components.d.ts +42 -10
  12. package/dist/components.js +47 -15
  13. package/dist/content-types.json +823 -0
  14. package/dist/core/dist/define-component.d.ts +12 -2
  15. package/dist/docs/account-access-gate.md +4 -4
  16. package/dist/docs/account-address-book.md +519 -0
  17. package/dist/docs/account-entry-point.md +5 -5
  18. package/dist/docs/account-menu.md +7 -7
  19. package/dist/docs/account-saved-cards.md +301 -0
  20. package/dist/docs/alert-dialog.md +2 -2
  21. package/dist/docs/billing-address.md +17 -9
  22. package/dist/docs/binding-switcher.md +154 -0
  23. package/dist/docs/card-entry.md +38 -7
  24. package/dist/docs/card-summary.md +175 -0
  25. package/dist/docs/cardholder-document.md +16 -14
  26. package/dist/docs/cart-destination.md +238 -0
  27. package/dist/docs/cart-item.md +22 -4
  28. package/dist/docs/cart-totalizer.md +1 -1
  29. package/dist/docs/cart.md +126 -19
  30. package/dist/docs/client-profile-fieldset.md +7 -5
  31. package/dist/docs/copy-text.md +84 -0
  32. package/dist/docs/document-field.md +8 -8
  33. package/dist/docs/footer-link-group.md +2 -2
  34. package/dist/docs/footer-social.md +1 -1
  35. package/dist/docs/free-shipping-progress.md +13 -9
  36. package/dist/docs/header-root.md +1 -1
  37. package/dist/docs/incentives.md +4 -4
  38. package/dist/docs/logo.md +6 -6
  39. package/dist/docs/my-account-profile.md +4 -4
  40. package/dist/docs/navigation-link-list.md +2 -2
  41. package/dist/docs/navigation-link.md +3 -3
  42. package/dist/docs/order-cancel.md +52 -0
  43. package/dist/docs/order-delivery-address.md +63 -0
  44. package/dist/docs/order-delivery-group.md +83 -0
  45. package/dist/docs/order-details-back.md +41 -0
  46. package/dist/docs/order-details-header.md +48 -0
  47. package/dist/docs/order-list-row.md +46 -0
  48. package/dist/docs/order-list-search.md +101 -0
  49. package/dist/docs/order-list-views.md +97 -0
  50. package/dist/docs/order-list.md +94 -0
  51. package/dist/docs/order-payment.md +94 -0
  52. package/dist/docs/order-placed-date.md +49 -0
  53. package/dist/docs/order-placed-payment-summary.md +13 -15
  54. package/dist/docs/order-placed.md +225 -0
  55. package/dist/docs/order-progress.md +88 -0
  56. package/dist/docs/order-status-badge.md +91 -0
  57. package/dist/docs/order-summary.md +53 -0
  58. package/dist/docs/payment-method-badges.md +16 -5
  59. package/dist/docs/payment-methods.md +1 -1
  60. package/dist/docs/place-order.md +13 -9
  61. package/dist/docs/product-information.md +2 -2
  62. package/dist/docs/product-shelf.md +7 -0
  63. package/dist/docs/saved-cards.md +2 -2
  64. package/dist/docs/select.md +22 -10
  65. package/dist/docs/session.md +1 -1
  66. package/dist/docs/shipping-address.md +1 -1
  67. package/dist/docs/sign-in-redirect.md +7 -7
  68. package/dist/docs/toast.md +35 -13
  69. package/dist/index.d.ts +7 -2
  70. package/dist/index.js +2 -1
  71. package/dist/internal/client.d.ts +9 -1
  72. package/dist/internal/client.js +10 -2
  73. package/dist/internal/server.d.ts +8 -2
  74. package/dist/internal/server.js +8 -2
  75. package/dist/matter/account-access-gate/account-access-gate.d.ts +2 -1
  76. package/dist/matter/account-access-gate/account-access-gate.js +19 -16
  77. package/dist/matter/account-access-gate/account-access-gate.js.map +1 -1
  78. package/dist/matter/account-address-book/account-address-book-delete.d.ts +60 -0
  79. package/dist/matter/account-address-book/account-address-book-delete.js +184 -0
  80. package/dist/matter/account-address-book/account-address-book-delete.js.map +1 -0
  81. package/dist/matter/account-address-book/account-address-book-deliverability.d.ts +19 -0
  82. package/dist/matter/account-address-book/account-address-book-deliverability.js +50 -0
  83. package/dist/matter/account-address-book/account-address-book-deliverability.js.map +1 -0
  84. package/dist/matter/account-address-book/account-address-book-form-parts.d.ts +42 -0
  85. package/dist/matter/account-address-book/account-address-book-form-parts.js +146 -0
  86. package/dist/matter/account-address-book/account-address-book-form-parts.js.map +1 -0
  87. package/dist/matter/account-address-book/account-address-book-profile-notice.d.ts +25 -0
  88. package/dist/matter/account-address-book/account-address-book-profile-notice.js +72 -0
  89. package/dist/matter/account-address-book/account-address-book-profile-notice.js.map +1 -0
  90. package/dist/matter/account-address-book/account-address-book.d.ts +120 -0
  91. package/dist/matter/account-address-book/account-address-book.js +469 -0
  92. package/dist/matter/account-address-book/account-address-book.js.map +1 -0
  93. package/dist/matter/account-address-book/account-address-country-switch.js +59 -0
  94. package/dist/matter/account-address-book/account-address-country-switch.js.map +1 -0
  95. package/dist/matter/account-address-book/account-address-country.d.ts +36 -0
  96. package/dist/matter/account-address-book/account-address-country.js +151 -0
  97. package/dist/matter/account-address-book/account-address-country.js.map +1 -0
  98. package/dist/matter/account-address-book/account-address-first-line.js +11 -0
  99. package/dist/matter/account-address-book/account-address-first-line.js.map +1 -0
  100. package/dist/matter/account-address-book/account-address-form-context.d.ts +55 -0
  101. package/dist/matter/account-address-book/account-address-form-context.js +14 -0
  102. package/dist/matter/account-address-book/account-address-form-context.js.map +1 -0
  103. package/dist/matter/account-address-book/account-address-form.d.ts +85 -0
  104. package/dist/matter/account-address-book/account-address-form.js +946 -0
  105. package/dist/matter/account-address-book/account-address-form.js.map +1 -0
  106. package/dist/matter/account-address-book/account-address-postal-autofill.js +189 -0
  107. package/dist/matter/account-address-book/account-address-postal-autofill.js.map +1 -0
  108. package/dist/matter/account-address-book/account-address-record.d.ts +26 -0
  109. package/dist/matter/account-address-book/account-address-record.js +138 -0
  110. package/dist/matter/account-address-book/account-address-record.js.map +1 -0
  111. package/dist/matter/account-entry-point/account-entry-point.js +11 -11
  112. package/dist/matter/account-entry-point/account-entry-point.js.map +1 -1
  113. package/dist/matter/account-menu/account-menu.d.ts +7 -3
  114. package/dist/matter/account-menu/account-menu.js +69 -28
  115. package/dist/matter/account-menu/account-menu.js.map +1 -1
  116. package/dist/matter/account-saved-cards/account-saved-cards.d.ts +383 -0
  117. package/dist/matter/account-saved-cards/account-saved-cards.js +956 -0
  118. package/dist/matter/account-saved-cards/account-saved-cards.js.map +1 -0
  119. package/dist/matter/billing-address/billing-address.d.ts +30 -17
  120. package/dist/matter/billing-address/billing-address.js +128 -33
  121. package/dist/matter/billing-address/billing-address.js.map +1 -1
  122. package/dist/matter/breadcrumb/breadcrumb.js +2 -2
  123. package/dist/matter/breadcrumb/breadcrumb.js.map +1 -1
  124. package/dist/matter/card-entry/card-capture.js +4 -3
  125. package/dist/matter/card-entry/card-capture.js.map +1 -1
  126. package/dist/matter/card-entry/card-entry.d.ts +5 -3
  127. package/dist/matter/card-entry/card-entry.js +77 -27
  128. package/dist/matter/card-entry/card-entry.js.map +1 -1
  129. package/dist/matter/cardholder-document/cardholder-document.d.ts +10 -9
  130. package/dist/matter/cardholder-document/cardholder-document.js +36 -16
  131. package/dist/matter/cardholder-document/cardholder-document.js.map +1 -1
  132. package/dist/matter/cart/cart-namespace.d.ts +5 -1
  133. package/dist/matter/cart/cart-namespace.js +5 -1
  134. package/dist/matter/cart/cart-namespace.js.map +1 -1
  135. package/dist/matter/cart/cart.d.ts +41 -6
  136. package/dist/matter/cart/cart.js +267 -54
  137. package/dist/matter/cart/cart.js.map +1 -1
  138. package/dist/matter/cart-destination/cart-destination.d.ts +222 -0
  139. package/dist/matter/cart-destination/cart-destination.js +613 -0
  140. package/dist/matter/cart-destination/cart-destination.js.map +1 -0
  141. package/dist/matter/cart-item/cart-item.d.ts +4 -2
  142. package/dist/matter/cart-item/cart-item.js +76 -17
  143. package/dist/matter/cart-item/cart-item.js.map +1 -1
  144. package/dist/matter/cart-totalizer/cart-totalizer.js +3 -2
  145. package/dist/matter/cart-totalizer/cart-totalizer.js.map +1 -1
  146. package/dist/matter/client-preferences/client-preferences-fieldset.js +1 -1
  147. package/dist/matter/client-profile-form/client-profile-fieldset.js +8 -5
  148. package/dist/matter/client-profile-form/client-profile-fieldset.js.map +1 -1
  149. package/dist/matter/free-shipping-progress/free-shipping-progress.d.ts +6 -3
  150. package/dist/matter/free-shipping-progress/free-shipping-progress.js +76 -33
  151. package/dist/matter/free-shipping-progress/free-shipping-progress.js.map +1 -1
  152. package/dist/matter/identity-edit/identity-edit.js +3 -3
  153. package/dist/matter/identity-edit/identity-edit.js.map +1 -1
  154. package/dist/matter/identity-summary/identity-summary.js +2 -2
  155. package/dist/matter/identity-summary/identity-summary.js.map +1 -1
  156. package/dist/matter/my-account-profile/my-account-profile.d.ts +3 -3
  157. package/dist/matter/my-account-profile/my-account-profile.js +4 -4
  158. package/dist/matter/my-account-profile/my-account-profile.js.map +1 -1
  159. package/dist/matter/order-cancel/order-cancel.d.ts +110 -0
  160. package/dist/matter/order-cancel/order-cancel.js +344 -0
  161. package/dist/matter/order-cancel/order-cancel.js.map +1 -0
  162. package/dist/matter/order-delivery-address/order-delivery-address.d.ts +73 -0
  163. package/dist/matter/order-delivery-address/order-delivery-address.js +172 -0
  164. package/dist/matter/order-delivery-address/order-delivery-address.js.map +1 -0
  165. package/dist/matter/order-delivery-group/order-delivery-group.d.ts +128 -0
  166. package/dist/matter/order-delivery-group/order-delivery-group.js +408 -0
  167. package/dist/matter/order-delivery-group/order-delivery-group.js.map +1 -0
  168. package/dist/matter/order-details-header/order-details-header.d.ts +104 -0
  169. package/dist/matter/order-details-header/order-details-header.js +190 -0
  170. package/dist/matter/order-details-header/order-details-header.js.map +1 -0
  171. package/dist/matter/order-list/customer-orders-filter.d.ts +12 -0
  172. package/dist/matter/order-list/customer-orders-filter.js +30 -0
  173. package/dist/matter/order-list/customer-orders-filter.js.map +1 -0
  174. package/dist/matter/order-list/order-list.d.ts +121 -0
  175. package/dist/matter/order-list/order-list.js +395 -0
  176. package/dist/matter/order-list/order-list.js.map +1 -0
  177. package/dist/matter/order-list-row/order-list-row.d.ts +44 -0
  178. package/dist/matter/order-list-row/order-list-row.js +127 -0
  179. package/dist/matter/order-list-row/order-list-row.js.map +1 -0
  180. package/dist/matter/order-list-search/order-list-search.d.ts +72 -0
  181. package/dist/matter/order-list-search/order-list-search.js +296 -0
  182. package/dist/matter/order-list-search/order-list-search.js.map +1 -0
  183. package/dist/matter/order-list-views/order-list-views.d.ts +65 -0
  184. package/dist/matter/order-list-views/order-list-views.js +154 -0
  185. package/dist/matter/order-list-views/order-list-views.js.map +1 -0
  186. package/dist/matter/order-payment/order-payment.d.ts +83 -0
  187. package/dist/matter/order-payment/order-payment.js +258 -0
  188. package/dist/matter/order-payment/order-payment.js.map +1 -0
  189. package/dist/matter/order-placed/order-placed-deliveries.d.ts +145 -0
  190. package/dist/matter/order-placed/order-placed-deliveries.js +380 -0
  191. package/dist/matter/order-placed/order-placed-deliveries.js.map +1 -0
  192. package/dist/matter/order-placed/order-placed.d.ts +122 -0
  193. package/dist/matter/order-placed/order-placed.js +452 -0
  194. package/dist/matter/order-placed/order-placed.js.map +1 -0
  195. package/dist/matter/order-placed-date/order-placed-date.d.ts +45 -0
  196. package/dist/matter/order-placed-date/order-placed-date.js +92 -0
  197. package/dist/matter/order-placed-date/order-placed-date.js.map +1 -0
  198. package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.d.ts +5 -8
  199. package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.js +29 -81
  200. package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.js.map +1 -1
  201. package/dist/matter/order-progress/order-progress.d.ts +85 -0
  202. package/dist/matter/order-progress/order-progress.js +203 -0
  203. package/dist/matter/order-progress/order-progress.js.map +1 -0
  204. package/dist/matter/order-summary/order-summary.d.ts +81 -0
  205. package/dist/matter/order-summary/order-summary.js +192 -0
  206. package/dist/matter/order-summary/order-summary.js.map +1 -0
  207. package/dist/matter/payment/cardholder-document-rule.d.ts +35 -0
  208. package/dist/matter/payment/cardholder-document-rule.js +35 -0
  209. package/dist/matter/payment/cardholder-document-rule.js.map +1 -0
  210. package/dist/matter/payment/payment-card-capture.js +38 -23
  211. package/dist/matter/payment/payment-card-capture.js.map +1 -1
  212. package/dist/matter/payment/payment-controller.js +11 -0
  213. package/dist/matter/payment/payment-controller.js.map +1 -1
  214. package/dist/matter/payment/payment-method-badges.js +4 -2
  215. package/dist/matter/payment/payment-method-badges.js.map +1 -1
  216. package/dist/matter/payment/payment.js +11 -0
  217. package/dist/matter/payment/payment.js.map +1 -1
  218. package/dist/matter/payment/use-payment-method-selection.d.ts +39 -0
  219. package/dist/matter/payment/use-payment-method-selection.js +30 -2
  220. package/dist/matter/payment/use-payment-method-selection.js.map +1 -1
  221. package/dist/matter/payment/use-payment-submit-gate.d.ts +16 -2
  222. package/dist/matter/payment/use-payment-submit-gate.js +42 -14
  223. package/dist/matter/payment/use-payment-submit-gate.js.map +1 -1
  224. package/dist/matter/place-order/place-order.d.ts +12 -7
  225. package/dist/matter/place-order/place-order.js +126 -103
  226. package/dist/matter/place-order/place-order.js.map +1 -1
  227. package/dist/matter/pricing/pricing.js +5 -5
  228. package/dist/matter/pricing/pricing.js.map +1 -1
  229. package/dist/matter/product-shelf/product-shelf.d.ts +7 -0
  230. package/dist/matter/product-shelf/product-shelf.js +115 -1
  231. package/dist/matter/product-shelf/product-shelf.js.map +1 -1
  232. package/dist/matter/region/region.js +1 -1
  233. package/dist/matter/saved-cards/saved-cards.js +26 -15
  234. package/dist/matter/saved-cards/saved-cards.js.map +1 -1
  235. package/dist/matter/session/session.js +2 -2
  236. package/dist/matter/session/session.js.map +1 -1
  237. package/dist/matter/shipping-address/country-descriptors.d.ts +1 -0
  238. package/dist/matter/shipping-address/country-descriptors.js +23 -1
  239. package/dist/matter/shipping-address/country-descriptors.js.map +1 -1
  240. package/dist/matter/shipping-address/shipping-address.js +62 -14
  241. package/dist/matter/shipping-address/shipping-address.js.map +1 -1
  242. package/dist/matter/shipping-simulator/shipping-simulator.d.ts +2 -2
  243. package/dist/matter/shipping-simulator/shipping-simulator.js +6 -2
  244. package/dist/matter/shipping-simulator/shipping-simulator.js.map +1 -1
  245. package/dist/matter/sign-in-redirect/sign-in-redirect.js +48 -10
  246. package/dist/matter/sign-in-redirect/sign-in-redirect.js.map +1 -1
  247. package/dist/matter/variant-selector/variant-selector.js +2 -2
  248. package/dist/matter/variant-selector/variant-selector.js.map +1 -1
  249. package/dist/particles/address-summary/address-summary.js +2 -2
  250. package/dist/particles/address-summary/address-summary.js.map +1 -1
  251. package/dist/particles/alert-dialog/alert-dialog.d.ts +5 -1
  252. package/dist/particles/alert-dialog/alert-dialog.js +5 -2
  253. package/dist/particles/alert-dialog/alert-dialog.js.map +1 -1
  254. package/dist/particles/binding-switcher/binding-switcher.d.ts +38 -0
  255. package/dist/particles/binding-switcher/binding-switcher.js +183 -0
  256. package/dist/particles/binding-switcher/binding-switcher.js.map +1 -0
  257. package/dist/particles/card-summary/card-network.d.ts +17 -0
  258. package/dist/particles/card-summary/card-network.js +25 -0
  259. package/dist/particles/card-summary/card-network.js.map +1 -0
  260. package/dist/particles/card-summary/card-summary.d.ts +83 -0
  261. package/dist/particles/card-summary/card-summary.js +188 -0
  262. package/dist/particles/card-summary/card-summary.js.map +1 -0
  263. package/dist/particles/copy-text/copy-text.d.ts +28 -0
  264. package/dist/particles/copy-text/copy-text.js +140 -0
  265. package/dist/particles/copy-text/copy-text.js.map +1 -0
  266. package/dist/particles/document-field/document-field.d.ts +34 -5
  267. package/dist/particles/document-field/document-field.js +115 -19
  268. package/dist/particles/document-field/document-field.js.map +1 -1
  269. package/dist/particles/field/field.js +1 -1
  270. package/dist/particles/field/field.js.map +1 -1
  271. package/dist/particles/footer-link-group/footer-link-group.d.ts +6 -2
  272. package/dist/particles/footer-link-group/footer-link-group.js +18 -7
  273. package/dist/particles/footer-link-group/footer-link-group.js.map +1 -1
  274. package/dist/particles/footer-social/footer-social.d.ts +1 -1
  275. package/dist/particles/footer-social/footer-social.js +1 -1
  276. package/dist/particles/footer-social/footer-social.js.map +1 -1
  277. package/dist/particles/incentives/incentives.d.ts +7 -3
  278. package/dist/particles/incentives/incentives.js +8 -3
  279. package/dist/particles/incentives/incentives.js.map +1 -1
  280. package/dist/particles/logo/logo.d.ts +3 -2
  281. package/dist/particles/logo/logo.js +20 -8
  282. package/dist/particles/logo/logo.js.map +1 -1
  283. package/dist/particles/navigation-link/navigation-link.d.ts +2 -3
  284. package/dist/particles/navigation-link/navigation-link.js +4 -4
  285. package/dist/particles/navigation-link/navigation-link.js.map +1 -1
  286. package/dist/particles/navigation-link-list/navigation-link-list.d.ts +6 -2
  287. package/dist/particles/navigation-link-list/navigation-link-list.js +18 -7
  288. package/dist/particles/navigation-link-list/navigation-link-list.js.map +1 -1
  289. package/dist/particles/order-details-back/order-details-back.d.ts +28 -0
  290. package/dist/particles/order-details-back/order-details-back.js +52 -0
  291. package/dist/particles/order-details-back/order-details-back.js.map +1 -0
  292. package/dist/particles/order-status-badge/order-status-badge.d.ts +19 -0
  293. package/dist/particles/order-status-badge/order-status-badge.js +50 -0
  294. package/dist/particles/order-status-badge/order-status-badge.js.map +1 -0
  295. package/dist/particles/payment-methods/payment-methods.d.ts +1 -1
  296. package/dist/particles/payment-methods/payment-methods.js +1 -1
  297. package/dist/particles/payment-methods/payment-methods.js.map +1 -1
  298. package/dist/particles/phone-field/phone-field.js +2 -2
  299. package/dist/particles/phone-field/phone-field.js.map +1 -1
  300. package/dist/particles/select/select.js +6 -6
  301. package/dist/particles/select/select.js.map +1 -1
  302. package/dist/particles/toast/toast.d.ts +21 -7
  303. package/dist/particles/toast/toast.js +76 -8
  304. package/dist/particles/toast/toast.js.map +1 -1
  305. package/dist/schema.graphql +1376 -126
  306. package/dist/sdk/actions/address-action-provider.d.ts +16 -0
  307. package/dist/sdk/actions/address-action-provider.js +20 -0
  308. package/dist/sdk/actions/address-action-provider.js.map +1 -0
  309. package/dist/sdk/actions/analytics-action-provider.js +1 -1
  310. package/dist/sdk/actions/index.d.ts +5 -1
  311. package/dist/sdk/actions/index.js +5 -1
  312. package/dist/sdk/actions/locale-action-provider.d.ts +16 -0
  313. package/dist/sdk/actions/locale-action-provider.js +20 -0
  314. package/dist/sdk/actions/locale-action-provider.js.map +1 -0
  315. package/dist/sdk/actions/order-action-provider.d.ts +12 -0
  316. package/dist/sdk/actions/order-action-provider.js +16 -0
  317. package/dist/sdk/actions/order-action-provider.js.map +1 -0
  318. package/dist/sdk/actions/saved-card-action-provider.d.ts +12 -0
  319. package/dist/sdk/actions/saved-card-action-provider.js +16 -0
  320. package/dist/sdk/actions/saved-card-action-provider.js.map +1 -0
  321. package/dist/sdk/actions/types.d.ts +10 -2
  322. package/dist/sdk/address/address-fields.js +38 -0
  323. package/dist/sdk/address/address-fields.js.map +1 -0
  324. package/dist/sdk/address/checkout-readiness.js +17 -0
  325. package/dist/sdk/address/checkout-readiness.js.map +1 -0
  326. package/dist/sdk/address/constants.js +60 -0
  327. package/dist/sdk/address/constants.js.map +1 -0
  328. package/dist/sdk/address/country-display.js +19 -0
  329. package/dist/sdk/address/country-display.js.map +1 -0
  330. package/dist/sdk/address/country-rules.js +30 -0
  331. package/dist/sdk/address/country-rules.js.map +1 -0
  332. package/dist/sdk/address/format-address.js +18 -0
  333. package/dist/sdk/address/format-address.js.map +1 -0
  334. package/dist/sdk/address/iso-countries.js +262 -0
  335. package/dist/sdk/address/iso-countries.js.map +1 -0
  336. package/dist/sdk/address/layouts.js +56 -0
  337. package/dist/sdk/address/layouts.js.map +1 -0
  338. package/dist/sdk/address/messages.js +97 -0
  339. package/dist/sdk/address/messages.js.map +1 -0
  340. package/dist/sdk/address/operations.d.ts +54 -0
  341. package/dist/sdk/address/operations.js +83 -0
  342. package/dist/sdk/address/operations.js.map +1 -0
  343. package/dist/sdk/address/postal-code-lookup-operations.js +23 -0
  344. package/dist/sdk/address/postal-code-lookup-operations.js.map +1 -0
  345. package/dist/sdk/address/postal-code.js +11 -0
  346. package/dist/sdk/address/postal-code.js.map +1 -0
  347. package/dist/sdk/address/schema.js +14 -0
  348. package/dist/sdk/address/schema.js.map +1 -0
  349. package/dist/sdk/address/server-fields.js +25 -0
  350. package/dist/sdk/address/server-fields.js.map +1 -0
  351. package/dist/sdk/address/switch-country.js +57 -0
  352. package/dist/sdk/address/switch-country.js.map +1 -0
  353. package/dist/sdk/address/types.d.ts +26 -0
  354. package/dist/sdk/address/use-address-actions.d.ts +29 -0
  355. package/dist/sdk/address/use-address-actions.js +247 -0
  356. package/dist/sdk/address/use-address-actions.js.map +1 -0
  357. package/dist/sdk/address/use-address-by-postal-code.js +57 -0
  358. package/dist/sdk/address/use-address-by-postal-code.js.map +1 -0
  359. package/dist/sdk/address/validate-address.js +62 -0
  360. package/dist/sdk/address/validate-address.js.map +1 -0
  361. package/dist/sdk/cache/storefront-cache.js +30 -4
  362. package/dist/sdk/cache/storefront-cache.js.map +1 -1
  363. package/dist/sdk/cart/operations.d.ts +2 -1
  364. package/dist/sdk/cart/operations.js +55 -1
  365. package/dist/sdk/cart/operations.js.map +1 -1
  366. package/dist/sdk/cart/optimistic.d.ts +30 -7
  367. package/dist/sdk/cart/optimistic.js +78 -41
  368. package/dist/sdk/cart/optimistic.js.map +1 -1
  369. package/dist/sdk/cart/use-cart-actions.d.ts +7 -0
  370. package/dist/sdk/cart/use-cart-actions.js +61 -15
  371. package/dist/sdk/cart/use-cart-actions.js.map +1 -1
  372. package/dist/sdk/cart/use-cart-sync-sales-channel.js +70 -0
  373. package/dist/sdk/cart/use-cart-sync-sales-channel.js.map +1 -0
  374. package/dist/sdk/client/fetch-page-data.d.ts +11 -0
  375. package/dist/sdk/client/fetch-page-data.js +12 -1
  376. package/dist/sdk/client/fetch-page-data.js.map +1 -1
  377. package/dist/sdk/content/create-content-runtime.js +1 -8
  378. package/dist/sdk/content/create-content-runtime.js.map +1 -1
  379. package/dist/sdk/data/failed-fields.js +23 -0
  380. package/dist/sdk/data/failed-fields.js.map +1 -0
  381. package/dist/sdk/data/index.js +2 -2
  382. package/dist/sdk/data/page-reactive-data-root.d.ts +45 -7
  383. package/dist/sdk/data/page-reactive-data-root.js +88 -12
  384. package/dist/sdk/data/page-reactive-data-root.js.map +1 -1
  385. package/dist/sdk/data/reactive-list-item-data-provider.js +2 -2
  386. package/dist/sdk/generated/fragment-types.js +2 -0
  387. package/dist/sdk/generated/fragment-types.js.map +1 -1
  388. package/dist/sdk/generated/gql.js +17 -11
  389. package/dist/sdk/generated/gql.js.map +1 -1
  390. package/dist/sdk/generated/graphql.d.ts +185 -46
  391. package/dist/sdk/generated/graphql.js +2587 -155
  392. package/dist/sdk/generated/graphql.js.map +1 -1
  393. package/dist/sdk/i18n/messages/en-US.js +157 -1
  394. package/dist/sdk/i18n/messages/en-US.json +157 -1
  395. package/dist/sdk/i18n/messages/en-US.json.d.ts +156 -0
  396. package/dist/sdk/i18n/messages/es-ES.js +157 -1
  397. package/dist/sdk/i18n/messages/es-ES.json +157 -1
  398. package/dist/sdk/i18n/messages/pt-BR.js +157 -1
  399. package/dist/sdk/i18n/messages/pt-BR.json +157 -1
  400. package/dist/sdk/i18n/provider.js +1 -1
  401. package/dist/sdk/i18n/provider.js.map +1 -1
  402. package/dist/sdk/locale/binding-switch-provider.d.ts +13 -0
  403. package/dist/sdk/locale/binding-switch-provider.js +20 -0
  404. package/dist/sdk/locale/binding-switch-provider.js.map +1 -0
  405. package/dist/sdk/locale/use-locale-actions.d.ts +16 -0
  406. package/dist/sdk/locale/use-locale-actions.js +70 -0
  407. package/dist/sdk/locale/use-locale-actions.js.map +1 -0
  408. package/dist/sdk/navigation/binding-switch.d.ts +39 -0
  409. package/dist/sdk/navigation/binding-switch.js +129 -0
  410. package/dist/sdk/navigation/binding-switch.js.map +1 -0
  411. package/dist/sdk/navigation/current-page.js +30 -0
  412. package/dist/sdk/navigation/current-page.js.map +1 -0
  413. package/dist/sdk/navigation/decode-route-params.d.ts +11 -0
  414. package/dist/sdk/navigation/decode-route-params.js +32 -0
  415. package/dist/sdk/navigation/decode-route-params.js.map +1 -0
  416. package/dist/sdk/navigation/not-found-log.d.ts +28 -0
  417. package/dist/sdk/navigation/not-found-log.js +133 -0
  418. package/dist/sdk/navigation/not-found-log.js.map +1 -0
  419. package/dist/sdk/navigation/path.js +25 -0
  420. package/dist/sdk/navigation/path.js.map +1 -0
  421. package/dist/sdk/navigation/redirect.d.ts +11 -0
  422. package/dist/sdk/navigation/redirect.js +22 -0
  423. package/dist/sdk/navigation/redirect.js.map +1 -0
  424. package/dist/sdk/navigation/report.js +70 -0
  425. package/dist/sdk/navigation/report.js.map +1 -0
  426. package/dist/sdk/navigation/resolve-storefront-href.d.ts +12 -0
  427. package/dist/sdk/navigation/resolve-storefront-href.js +214 -0
  428. package/dist/sdk/navigation/resolve-storefront-href.js.map +1 -0
  429. package/dist/sdk/navigation/route-identity-provider.d.ts +11 -0
  430. package/dist/sdk/navigation/route-identity-provider.js +20 -0
  431. package/dist/sdk/navigation/route-identity-provider.js.map +1 -0
  432. package/dist/sdk/navigation/route-map-provider.d.ts +19 -0
  433. package/dist/sdk/navigation/route-map-provider.js +29 -0
  434. package/dist/sdk/navigation/route-map-provider.js.map +1 -0
  435. package/dist/sdk/navigation/storefront-link.d.ts +16 -0
  436. package/dist/sdk/navigation/storefront-link.js +66 -0
  437. package/dist/sdk/navigation/storefront-link.js.map +1 -0
  438. package/dist/sdk/navigation/types.d.ts +45 -0
  439. package/dist/sdk/navigation/use-storefront-navigation.d.ts +26 -0
  440. package/dist/sdk/navigation/use-storefront-navigation.js +73 -0
  441. package/dist/sdk/navigation/use-storefront-navigation.js.map +1 -0
  442. package/dist/sdk/navigation/use-storefront-route.d.ts +26 -0
  443. package/dist/sdk/navigation/use-storefront-route.js +87 -0
  444. package/dist/sdk/navigation/use-storefront-route.js.map +1 -0
  445. package/dist/sdk/navigation/use-storefront-search-params.d.ts +11 -0
  446. package/dist/sdk/navigation/use-storefront-search-params.js +16 -0
  447. package/dist/sdk/navigation/use-storefront-search-params.js.map +1 -0
  448. package/dist/sdk/orders/completion-badge.d.ts +8 -0
  449. package/dist/sdk/orders/completion-badge.js +47 -0
  450. package/dist/sdk/orders/completion-badge.js.map +1 -0
  451. package/dist/sdk/orders/order-operations.d.ts +19 -0
  452. package/dist/sdk/orders/order-operations.js +21 -0
  453. package/dist/sdk/orders/order-operations.js.map +1 -0
  454. package/dist/sdk/orders/use-order-actions.d.ts +23 -0
  455. package/dist/sdk/orders/use-order-actions.js +62 -0
  456. package/dist/sdk/orders/use-order-actions.js.map +1 -0
  457. package/dist/sdk/payment/gateway-origin.js +26 -13
  458. package/dist/sdk/payment/gateway-origin.js.map +1 -1
  459. package/dist/sdk/payment/gateway.d.ts +14 -2
  460. package/dist/sdk/payment/gateway.js +32 -14
  461. package/dist/sdk/payment/gateway.js.map +1 -1
  462. package/dist/sdk/payment/operations.js +11 -0
  463. package/dist/sdk/payment/operations.js.map +1 -1
  464. package/dist/sdk/payment/submission-registry.d.ts +2 -1
  465. package/dist/sdk/payment/submission-registry.js +12 -8
  466. package/dist/sdk/payment/submission-registry.js.map +1 -1
  467. package/dist/sdk/payment/use-payment-actions.d.ts +5 -3
  468. package/dist/sdk/payment/use-payment-actions.js +5 -2
  469. package/dist/sdk/payment/use-payment-actions.js.map +1 -1
  470. package/dist/sdk/payment/use-place-order.d.ts +6 -3
  471. package/dist/sdk/payment/use-place-order.js +333 -143
  472. package/dist/sdk/payment/use-place-order.js.map +1 -1
  473. package/dist/sdk/saved-cards/operations.d.ts +16 -0
  474. package/dist/sdk/saved-cards/operations.js +41 -0
  475. package/dist/sdk/saved-cards/operations.js.map +1 -0
  476. package/dist/sdk/saved-cards/use-saved-card-actions.d.ts +26 -0
  477. package/dist/sdk/saved-cards/use-saved-card-actions.js +86 -0
  478. package/dist/sdk/saved-cards/use-saved-card-actions.js.map +1 -0
  479. package/dist/sdk/seo/page-alternates.d.ts +57 -0
  480. package/dist/sdk/seo/page-alternates.js +127 -0
  481. package/dist/sdk/seo/page-alternates.js.map +1 -0
  482. package/dist/sdk/shipping/shipping-operations.d.ts +1 -1
  483. package/dist/sdk/shipping/shipping-operations.js +13 -0
  484. package/dist/sdk/shipping/shipping-operations.js.map +1 -1
  485. package/dist/sdk/state/cart.d.ts +9 -2
  486. package/dist/sdk/state/cart.js +9 -2
  487. package/dist/sdk/state/cart.js.map +1 -1
  488. package/dist/utils/own-value.js +19 -0
  489. package/dist/utils/own-value.js.map +1 -0
  490. package/dist/utils/safe-href.d.ts +4 -4
  491. package/dist/utils/safe-href.js +31 -22
  492. package/dist/utils/safe-href.js.map +1 -1
  493. package/package.json +5 -1
  494. package/skills/storefront-asset/SKILL.md +111 -0
  495. package/skills/storefront-asset/references/api-side.md +153 -0
  496. package/skills/storefront-asset/references/findings.md +40 -0
  497. package/skills/storefront-asset/references/ui-side.md +94 -0
  498. package/src/styles/tailwind.css +28 -2
@@ -1 +1 @@
1
- {"version":3,"file":"payment-methods.js","names":[],"sources":["../../../src/particles/payment-methods/payment-methods.tsx"],"sourcesContent":["import { type ContentValue, defineComponent, defineContentType } from '@vtex/fs-core';\nimport type { ComponentPropsWithRef } from 'react';\nimport { Icon } from '../icon/icon.js';\nimport { Image } from '../image/image.js';\n\n// ---------------------------------------------------------------------------\n// Content model\n// ---------------------------------------------------------------------------\n\nexport const PaymentMethodsContent = defineContentType({\n id: 'payment-methods',\n title: 'Payment Methods',\n description: 'Accepted payment methods shown as a strip of icons.',\n schema: {\n type: 'object',\n additionalProperties: false,\n // Neither property is required. A missing element key already omits the component before any\n // required check runs, so requiring them would buy nothing and cost the prop fallback: an entry\n // authoring one field alone would be shape-invalid and take the whole element down with it.\n properties: {\n heading: { type: 'string', title: 'Heading' },\n methods: {\n type: 'array',\n title: 'Payment methods',\n // Author-time guidance only: no read-time gate enforces item bounds, so its one consumer is\n // the Content Platform Admin's form. An empty list still reaches the component, which\n // self-hides on it. No ceiling — a merchant lists every method they accept.\n minItems: 1,\n items: {\n type: 'object',\n additionalProperties: false,\n required: ['label'],\n properties: {\n // Inline rather than a named constant: the catalog scanner reads this file statically\n // and rejects an identifier it cannot evaluate. `PAYMENT_METHOD_NAMES` derives from here.\n method: {\n type: 'string',\n enum: [\n 'visa',\n 'amex',\n 'apple-pay',\n 'elo-card',\n 'diners',\n 'google-pay',\n 'mastercard',\n 'paypal',\n 'pix',\n 'stripe',\n ],\n title: 'Method',\n },\n label: { type: 'string', minLength: 1, title: 'Label' },\n iconUrl: {\n type: 'string',\n format: 'uri',\n title: 'Custom icon',\n widget: { 'ui:widget': 'media-gallery' },\n },\n },\n },\n },\n },\n },\n});\n\n/**\n * The payment glyphs the base icon dialect carries, and so the only names `method` admits. Exported\n * because a store's `global.json` has to list them under `icons.include` for a CMS-chosen name to\n * resolve at runtime — one import there instead of ten retyped strings. Reading it off the model\n * rather than declaring it beside one makes the two impossible to drift apart.\n */\nexport const PAYMENT_METHOD_NAMES = PaymentMethodsContent.schema.properties.methods.items.properties.method.enum;\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\ntype PaymentMethodsContentValue = ContentValue<typeof PaymentMethodsContent>;\n\n/** One row of the strip. Derived from the model so the prop and content channels cannot drift. */\nexport type PaymentMethodItem = NonNullable<PaymentMethodsContentValue['methods']>[number];\n\ntype PaymentMethodName = NonNullable<PaymentMethodItem['method']>;\n\nexport type PaymentMethodsProps = ComponentPropsWithRef<'div'> & {\n /** Authored fallback for the section heading, used when no CMS entry supplies one. */\n heading?: string;\n /** Authored fallback for the accepted set, used when no CMS entry supplies one. */\n methods?: readonly PaymentMethodItem[];\n /** Injected by the compiler, sliced from the page's or layout's composite content entry. */\n $content?: PaymentMethodsContentValue;\n};\n\n// ---------------------------------------------------------------------------\n// Definition\n// ---------------------------------------------------------------------------\n\nexport const PaymentMethodsDefinition = defineComponent({\n name: 'PaymentMethods',\n importPath: '@vtex/faststore/components',\n component: PaymentMethods,\n content: PaymentMethodsContent,\n editor: { label: 'Payment Methods', category: 'content' },\n schema: {\n heading: { type: 'string', label: 'Heading' },\n methods: { type: 'array', label: 'Payment methods' },\n },\n guideline:\n \"The store's accepted payment methods as a strip of flags, both the heading and the list CMS-editable. Not PricingPaymentMethodsList, which renders a product's installment plans from commerce data. Every predefined method name must be listed in the store's icons.include. See payment-methods.md.\",\n});\n\n// ---------------------------------------------------------------------------\n// Implementation\n// ---------------------------------------------------------------------------\n\n/**\n * A method that can render: a non-blank label plus exactly one glyph source. The two members are\n * what the union encodes — an upload names itself through `alt`, while a sprite glyph is decorative\n * and needs the label alongside it.\n */\ntype ResolvedMethod =\n | { label: string; method: PaymentMethodName; src?: undefined }\n | { label: string; method?: PaymentMethodName; src: string };\n\n/**\n * Drops every item that cannot render both a glyph and an accessible name. Neither read-time gate\n * enforces `minLength`, so a blank label reaches the component, and `method` is optional so that\n * Boleto can arrive through `iconUrl` — which leaves an item carrying neither, also legal and also\n * unrenderable. An icon with no name is the one thing F5 must not ship.\n */\nfunction resolveMethods(methods: readonly PaymentMethodItem[]): ResolvedMethod[] {\n const resolved: ResolvedMethod[] = [];\n\n for (const item of methods) {\n if (!item.label.trim()) continue;\n\n if (item.iconUrl?.trim()) {\n resolved.push({ label: item.label, method: item.method, src: item.iconUrl });\n } else if (item.method) {\n resolved.push({ label: item.label, method: item.method });\n }\n }\n\n return resolved;\n}\n\nexport function PaymentMethods({ heading, methods, $content, className, ...props }: PaymentMethodsProps) {\n const sectionHeading = $content?.heading ?? heading;\n const resolved = resolveMethods($content?.methods ?? methods ?? []);\n\n if (resolved.length === 0) return null;\n\n // A blank heading is unconfigured, not an empty value: no element and no group name, rather than\n // an empty one. Trim to decide, never to render.\n const named = Boolean(sectionHeading?.trim());\n\n return (\n <div {...props} className={className} data-fs-payment-methods=\"\">\n {named ? (\n <h3 data-fs-text=\"\" data-fs-payment-methods-heading=\"\">\n {sectionHeading}\n </h3>\n ) : null}\n {/* biome-ignore lint/a11y/noRedundantRoles: WebKit drops the implicit list role from a ul whose\n computed `list-style` is `none` — exactly what this component's swatch sets — so the explicit\n role is what holds the semantics the named list was chosen for. */}\n <ul role=\"list\" data-fs-payment-methods-list=\"\" aria-label={named ? sectionHeading : undefined}>\n {resolved.map((item, index) => (\n <li key={index} data-fs-payment-method=\"\" data-fs-payment-method-name={item.method}>\n {item.src === undefined ? (\n <>\n <Icon name={item.method} data-fs-payment-method-icon=\"\" />\n <span data-fs-sr-only=\"\" className=\"sr-only\">\n {item.label}\n </span>\n </>\n ) : (\n <Image src={item.src} alt={item.label} data-fs-payment-method-icon=\"\" />\n )}\n </li>\n ))}\n </ul>\n </div>\n );\n}\n"],"mappings":";;;;;;;AASA,MAAa,wBAAwB,kBAAkB;CACrD,IAAI;CACJ,OAAO;CACP,aAAa;CACb,QAAQ;EACN,MAAM;EACN,sBAAsB;EAItB,YAAY;GACV,SAAS;IAAE,MAAM;IAAU,OAAO;GAAU;GAC5C,SAAS;IACP,MAAM;IACN,OAAO;IAIP,UAAU;IACV,OAAO;KACL,MAAM;KACN,sBAAsB;KACtB,UAAU,CAAC,OAAO;KAClB,YAAY;MAGV,QAAQ;OACN,MAAM;OACN,MAAM;QACJ;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;OACF;OACA,OAAO;MACT;MACA,OAAO;OAAE,MAAM;OAAU,WAAW;OAAG,OAAO;MAAQ;MACtD,SAAS;OACP,MAAM;OACN,QAAQ;OACR,OAAO;OACP,QAAQ,EAAE,aAAa,gBAAgB;MACzC;KACF;IACF;GACF;EACF;CACF;AACF,CAAC;;;;;;;AAQD,MAAa,uBAAuB,sBAAsB,OAAO,WAAW,QAAQ,MAAM,WAAW,OAAO;AA0B5G,MAAa,2BAA2B,gBAAgB;CACtD,MAAM;CACN,YAAY;CACZ,WAAW;CACX,SAAS;CACT,QAAQ;EAAE,OAAO;EAAmB,UAAU;CAAU;CACxD,QAAQ;EACN,SAAS;GAAE,MAAM;GAAU,OAAO;EAAU;EAC5C,SAAS;GAAE,MAAM;GAAS,OAAO;EAAkB;CACr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AAA;GAEvE,GAXK,KAWL,CACL;EACC,CAAA,CACD;;AAET"}
1
+ {"version":3,"file":"payment-methods.js","names":[],"sources":["../../../src/particles/payment-methods/payment-methods.tsx"],"sourcesContent":["import { type ContentValue, defineComponent, defineContentType } from '@vtex/fs-core';\nimport type { ComponentPropsWithRef } from 'react';\nimport { Icon } from '../icon/icon.js';\nimport { Image } from '../image/image.js';\n\n// ---------------------------------------------------------------------------\n// Content model\n// ---------------------------------------------------------------------------\n\nexport const PaymentMethodsContent = defineContentType({\n id: 'payment-methods',\n title: 'Payment Methods',\n description: 'Accepted payment methods shown as a strip of icons.',\n schema: {\n type: 'object',\n additionalProperties: false,\n // Neither property is required. A missing element key already omits the component before any\n // required check runs, so requiring them would buy nothing and cost the prop fallback: an entry\n // authoring one field alone would be shape-invalid and take the whole element down with it.\n properties: {\n heading: { type: 'string', title: 'Heading' },\n methods: {\n type: 'array',\n title: 'Payment methods',\n // Author-time guidance only: no read-time gate enforces item bounds, so its one consumer is\n // the Content Platform Admin's form. An empty list still reaches the component, which\n // self-hides on it. No ceiling — a merchant lists every method they accept.\n minItems: 1,\n items: {\n type: 'object',\n additionalProperties: false,\n required: ['label'],\n properties: {\n // Inline rather than a named constant: the catalog scanner reads this file statically\n // and rejects an identifier it cannot evaluate. `PAYMENT_METHOD_NAMES` derives from here.\n method: {\n type: 'string',\n enum: [\n 'visa',\n 'amex',\n 'apple-pay',\n 'elo-card',\n 'diners',\n 'google-pay',\n 'mastercard',\n 'paypal',\n 'pix',\n 'stripe',\n ],\n title: 'Method',\n },\n label: { type: 'string', minLength: 1, title: 'Label' },\n iconUrl: {\n type: 'string',\n format: 'uri',\n title: 'Custom icon',\n widget: { 'ui:widget': 'media-gallery' },\n },\n },\n },\n },\n },\n },\n});\n\n/**\n * The payment glyphs the base icon dialect carries, and so the only names `method` admits. Exported\n * because a store's foundation has to list them under `icons.include` for a CMS-chosen name to\n * resolve at runtime — one import there instead of ten retyped strings. Reading it off the model\n * rather than declaring it beside one makes the two impossible to drift apart.\n */\nexport const PAYMENT_METHOD_NAMES = PaymentMethodsContent.schema.properties.methods.items.properties.method.enum;\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\ntype PaymentMethodsContentValue = ContentValue<typeof PaymentMethodsContent>;\n\n/** One row of the strip. Derived from the model so the prop and content channels cannot drift. */\nexport type PaymentMethodItem = NonNullable<PaymentMethodsContentValue['methods']>[number];\n\ntype PaymentMethodName = NonNullable<PaymentMethodItem['method']>;\n\nexport type PaymentMethodsProps = ComponentPropsWithRef<'div'> & {\n /** Authored fallback for the section heading, used when no CMS entry supplies one. */\n heading?: string;\n /** Authored fallback for the accepted set, used when no CMS entry supplies one. */\n methods?: readonly PaymentMethodItem[];\n /** Injected by the compiler, sliced from the page's or layout's composite content entry. */\n $content?: PaymentMethodsContentValue;\n};\n\n// ---------------------------------------------------------------------------\n// Definition\n// ---------------------------------------------------------------------------\n\nexport const PaymentMethodsDefinition = defineComponent({\n name: 'PaymentMethods',\n importPath: '@vtex/faststore/components',\n component: PaymentMethods,\n content: PaymentMethodsContent,\n editor: { label: 'Payment Methods', category: 'content' },\n schema: {\n heading: { type: 'string', label: 'Heading' },\n methods: { type: 'array', label: 'Payment methods' },\n },\n guideline:\n \"The store's accepted payment methods as a strip of flags, both the heading and the list CMS-editable. Not PricingPaymentMethodsList, which renders a product's installment plans from commerce data. Every predefined method name must be listed in the store's icons.include. See payment-methods.md.\",\n});\n\n// ---------------------------------------------------------------------------\n// Implementation\n// ---------------------------------------------------------------------------\n\n/**\n * A method that can render: a non-blank label plus exactly one glyph source. The two members are\n * what the union encodes — an upload names itself through `alt`, while a sprite glyph is decorative\n * and needs the label alongside it.\n */\ntype ResolvedMethod =\n | { label: string; method: PaymentMethodName; src?: undefined }\n | { label: string; method?: PaymentMethodName; src: string };\n\n/**\n * Drops every item that cannot render both a glyph and an accessible name. Neither read-time gate\n * enforces `minLength`, so a blank label reaches the component, and `method` is optional so that\n * Boleto can arrive through `iconUrl` — which leaves an item carrying neither, also legal and also\n * unrenderable. An icon with no name is the one thing F5 must not ship.\n */\nfunction resolveMethods(methods: readonly PaymentMethodItem[]): ResolvedMethod[] {\n const resolved: ResolvedMethod[] = [];\n\n for (const item of methods) {\n if (!item.label.trim()) continue;\n\n if (item.iconUrl?.trim()) {\n resolved.push({ label: item.label, method: item.method, src: item.iconUrl });\n } else if (item.method) {\n resolved.push({ label: item.label, method: item.method });\n }\n }\n\n return resolved;\n}\n\nexport function PaymentMethods({ heading, methods, $content, className, ...props }: PaymentMethodsProps) {\n const sectionHeading = $content?.heading ?? heading;\n const resolved = resolveMethods($content?.methods ?? methods ?? []);\n\n if (resolved.length === 0) return null;\n\n // A blank heading is unconfigured, not an empty value: no element and no group name, rather than\n // an empty one. Trim to decide, never to render.\n const named = Boolean(sectionHeading?.trim());\n\n return (\n <div {...props} className={className} data-fs-payment-methods=\"\">\n {named ? (\n <h3 data-fs-text=\"\" data-fs-payment-methods-heading=\"\">\n {sectionHeading}\n </h3>\n ) : null}\n {/* biome-ignore lint/a11y/noRedundantRoles: WebKit drops the implicit list role from a ul whose\n computed `list-style` is `none` — exactly what this component's swatch sets — so the explicit\n role is what holds the semantics the named list was chosen for. */}\n <ul role=\"list\" data-fs-payment-methods-list=\"\" aria-label={named ? sectionHeading : undefined}>\n {resolved.map((item, index) => (\n <li key={index} data-fs-payment-method=\"\" data-fs-payment-method-name={item.method}>\n {item.src === undefined ? (\n <>\n <Icon name={item.method} data-fs-payment-method-icon=\"\" />\n <span data-fs-sr-only=\"\" className=\"sr-only\">\n {item.label}\n </span>\n </>\n ) : (\n <Image src={item.src} alt={item.label} data-fs-payment-method-icon=\"\" />\n )}\n </li>\n ))}\n </ul>\n </div>\n );\n}\n"],"mappings":";;;;;;;AASA,MAAa,wBAAwB,kBAAkB;CACrD,IAAI;CACJ,OAAO;CACP,aAAa;CACb,QAAQ;EACN,MAAM;EACN,sBAAsB;EAItB,YAAY;GACV,SAAS;IAAE,MAAM;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W,CAAC,CAAC;CAElE,IAAI,SAAS,WAAW,GAAG,OAAO;CAIlC,MAAM,QAAQ,QAAQ,gBAAgB,KAAK,CAAC;CAE5C,OACE,qBAAC,OAAD;EAAK,GAAI;EAAkB;EAAW,2BAAwB;EAA9D,UAAA,CACG,QACC,oBAAC,MAAD;GAAI,gBAAa;GAAG,mCAAgC;GACjD,UAAA;EACC,CAAA,IACF,MAIJ,oBAAC,MAAD;GAAI,MAAK;GAAO,gCAA6B;GAAG,cAAY,QAAQ,iBAAiB,KAAA;GAClF,UAAA,SAAS,KAAK,MAAM,UACnB,oBAAC,MAAD;IAAgB,0BAAuB;IAAG,+BAA6B,KAAK;IACzE,UAAA,KAAK,QAAQ,KAAA,IACZ,qBAAA,UAAA,EAAA,UAAA,CACE,oBAAC,MAAD;KAAM,MAAM,KAAK;KAAQ,+BAA4B;IAAI,CAAA,GACzD,oBAAC,QAAD;KAAM,mBAAgB;KAAG,WAAU;KAChC,UAAA,KAAK;IACF,CAAA,CACN,EAAA,CAAA,IAEF,oBAAC,OAAD;KAAO,KAAK,KAAK;KAAK,KAAK,KAAK;KAAO,+BAA4B;IAAI,CAAA;GAEvE,GAXK,KAWL,CACL;EACC,CAAA,CACD;;AAET"}
@@ -5,7 +5,7 @@ import { FieldBinding, TEXT_FIELD_VALUE, mergeFieldValidator, useBoundField, use
5
5
  import { useComposedRef } from "../shared/compose-refs.js";
6
6
  import { Input } from "../input/input.js";
7
7
  import { createContext, useContext, useMemo, useState } from "react";
8
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
9
9
  import { Field } from "@base-ui/react/field";
10
10
  import { useFormContext, useFormState } from "react-hook-form";
11
11
  //#region src/particles/phone-field/phone-field.tsx
@@ -258,7 +258,7 @@ function PhoneFieldView({ ref, country, className, label, isDisabled, placeholde
258
258
  disabled: isDisabled,
259
259
  children: /* @__PURE__ */ jsx(PhoneFieldInputContext.Provider, {
260
260
  value: inputContext,
261
- children: children ?? /* @__PURE__ */ jsxs(Fragment, { children: [
261
+ children: children ?? /* @__PURE__ */ jsxs(Fragment$1, { children: [
262
262
  /* @__PURE__ */ jsx(Field.Label, {
263
263
  "data-fs-phone-field-label": "",
264
264
  "data-fs-field-label": "",
@@ -1 +1 @@
1
- {"version":3,"file":"phone-field.js","names":["BaseField"],"sources":["../../../src/particles/phone-field/phone-field.tsx"],"sourcesContent":["'use client';\nimport { Field as BaseField } from '@base-ui/react/field';\nimport { defineComponent } from '@vtex/fs-core';\nimport type { ChangeEvent, FocusEvent, ReactNode, Ref } from 'react';\nimport { createContext, useContext, useMemo, useState } from 'react';\nimport { useFormContext, useFormState } from 'react-hook-form';\nimport {\n FieldBinding,\n type FieldContract,\n type FieldRule,\n mergeFieldValidator,\n TEXT_FIELD_VALUE,\n useBoundField,\n useField,\n} from '../field/field.js';\nimport { Input } from '../input/input.js';\nimport { useComposedRef } from '../shared/compose-refs.js';\n\n// ---------------------------------------------------------------------------\n// Country masks\n// ---------------------------------------------------------------------------\n\n/**\n * Country codes supported by PhoneField.\n * Only US and BR are implemented; every other ISO-2 code falls back to the US\n * format (Gap-06 in the PhoneField spec).\n */\nexport type PhoneCountry = 'US' | 'BR';\n\n/**\n * Returns true when `value` starts with the E.164 or bare country-code prefix\n * for the given country.\n *\n * US country code: 1 → \"+1…\" or \"1…\"\n * BR country code: 55 → \"+55…\" or \"55…\"\n */\nfunction isValidCountryCode(value: string, country: PhoneCountry): boolean {\n switch (country) {\n case 'US':\n return value.startsWith('+1') || value.startsWith('1');\n case 'BR':\n return value.startsWith('+55') || value.startsWith('55');\n default:\n return false;\n }\n}\n\n/**\n * Strips phone mask formatting from `value`.\n *\n * When the raw string carries a valid country-code prefix (e.g. \"+55…\"), the\n * returned value preserves the leading \"+\" so callers can detect E.164 intent.\n * Otherwise only digits are returned.\n *\n * `removePhoneMask(applyPhoneMask(raw, country), country) === raw` for all\n * valid raw values that do NOT carry a country-code prefix.\n */\nexport function removePhoneMask(value: string, country: PhoneCountry): string {\n const onlyDigits = value.replace(/\\D/g, '');\n\n // Only treat as E.164 when the raw string explicitly carries a \"+\" prefix.\n // A bare digit string that starts with the country-code digits (e.g. \"1234567890\"\n // starting with \"1\") is a local number, not a country-code-prefixed one.\n if (value.startsWith('+') && isValidCountryCode(value, country)) {\n return `+${onlyDigits}`;\n }\n\n return onlyDigits;\n}\n\n/**\n * Formats `value` into the mask pattern for `country`, applying as many mask\n * characters as the digit count allows (progressive masking while typing).\n *\n * US: (123) 456-7890 or +1 (123) 456-7890\n * BR: (11) 99999-9999 or +55 (11) 99999-9999\n *\n * Non-US/BR countries fall back to the US mask.\n */\nexport function applyPhoneMask(value: string, country: PhoneCountry): string {\n switch (country) {\n case 'US':\n return applyUSPhoneMask(value);\n case 'BR':\n return applyBRPhoneMask(value);\n default:\n return applyUSPhoneMask(value);\n }\n}\n\nfunction applyUSPhoneMask(value: string): string {\n const onlyDigits = value.replace(/\\D/g, '');\n\n // E.164 with explicit \"+\" prefix and full country code\n if (value.startsWith('+1') && onlyDigits.length >= 11) {\n const local = value.replace('+1', '').replace(/\\D/g, '');\n return `+1 ${formatUSNumber(local)}`;\n }\n\n // Bare country-code prefix (e.g. \"11234567890\")\n if (onlyDigits.startsWith('1') && onlyDigits.length === 11) {\n return `+1 ${formatUSNumber(onlyDigits.substring(1))}`;\n }\n\n return formatUSNumber(onlyDigits);\n}\n\nfunction formatUSNumber(digits: string): string {\n // US local numbers cap at 10 digits — drop the overflow instead of growing the mask unbounded.\n const local = digits.slice(0, 10);\n if (local.length === 0) return '';\n if (local.length <= 3) return `(${local}`;\n if (local.length <= 6) return `(${local.slice(0, 3)}) ${local.slice(3)}`;\n return `(${local.slice(0, 3)}) ${local.slice(3, 6)}-${local.slice(6)}`;\n}\n\nfunction applyBRPhoneMask(value: string): string {\n const onlyDigits = value.replace(/\\D/g, '');\n\n // E.164 with explicit \"+55\" prefix. 12 digits is a landline (+55 + 10 local),\n // 13 is a mobile (+55 + 11 local); both strip the \"55\" country code.\n if (value.startsWith('+55') && onlyDigits.length >= 12) {\n const local = value.replace('+55', '').replace(/\\D/g, '');\n return `+55 ${formatBRNumber(local)}`;\n }\n\n // Bare country-code prefix (e.g. \"5511999998888\" mobile, \"551133334444\" landline)\n if (onlyDigits.startsWith('55') && (onlyDigits.length === 12 || onlyDigits.length === 13)) {\n return `+55 ${formatBRNumber(onlyDigits.substring(2))}`;\n }\n\n return formatBRNumber(onlyDigits);\n}\n\nfunction formatBRNumber(digits: string): string {\n // BR local numbers cap at 11 digits (mobile) — drop the overflow instead of growing the mask unbounded.\n const local = digits.slice(0, 11);\n if (local.length === 0) return '';\n if (local.length <= 2) return `(${local}`;\n if (local.length <= 6) return `(${local.slice(0, 2)}) ${local.slice(2)}`;\n // 7-10 digits: landline format (XX) XXXX-XXXX\n if (local.length <= 10) return `(${local.slice(0, 2)}) ${local.slice(2, 6)}-${local.slice(6)}`;\n // 11 digits: mobile format (XX) XXXXX-XXXX\n return `(${local.slice(0, 2)}) ${local.slice(2, 7)}-${local.slice(7)}`;\n}\n\n// ---------------------------------------------------------------------------\n// Validation\n// ---------------------------------------------------------------------------\n\n/**\n * BR local part: 10 digits is a landline; 11 digits is a mobile, which must carry the mandatory\n * ninth digit \"9\" right after the two-digit DDD (the `phone` library rule the spec's Gap-05\n * reimplements — \"11899998888\" is mobile-shaped but not a real BR number).\n */\nfunction isValidBRLocal(digits: string): boolean {\n if (digits.length === 10) return true;\n return digits.length === 11 && digits[2] === '9';\n}\n\n/**\n * Validates a raw (unmasked) phone number string for the given country.\n *\n * NOTE: The spec (KD-3) calls for using the `phone` npm library for validation.\n * The library is listed in Gap-05 as a new dependency to add when available.\n * Until that dependency is installed, this implements an equivalent\n * digit-count validation that covers all spec key-scenarios for US and BR.\n * Country-code and non-country-code inputs are both handled.\n *\n * US valid forms:\n * - 10 digits (local, e.g. \"1234567890\")\n * - 11 raw digits with country code \"1\" (e.g. \"11234567890\")\n * - E.164 \"+1\" + 10 digits (e.g. \"+11234567890\")\n *\n * BR valid forms:\n * - 10 digits (landline, e.g. \"1133334444\")\n * - 11 digits (mobile, e.g. \"11999998888\"; the ninth digit after the DDD must be \"9\")\n * - E.164 \"+55\" + 10 or 11 digits (e.g. \"+5511999998888\")\n */\nexport function validatePhoneNumber(input: string, country: PhoneCountry): boolean {\n if (!input || !input.trim()) return false;\n\n const digits = input.replace(/\\D/g, '');\n\n if (isValidCountryCode(input, country)) {\n // Country-code branch: validate digit count including the country code digits.\n if (country === 'US') {\n // \"+1\" or \"1\" prefix + exactly 10 local digits = 11 raw digits\n if (digits.length === 11) return true;\n // Fall through: could be a 10-digit local number that starts with \"1\"\n } else {\n // BR: \"+55\" or \"55\" prefix + 10 or 11 local digits = 12 or 13 raw digits\n if (digits.length === 12 || digits.length === 13) return isValidBRLocal(digits.slice(2));\n // Fall through: could be local digits that happen to start with \"55\"\n }\n }\n\n // Local (no country code) validation\n if (country === 'US') {\n return digits.length === 10;\n }\n\n return isValidBRLocal(digits);\n}\n\n/**\n * Normalizes a valid raw phone value to E.164 for persistence (legacy checkout parity): the\n * particle emits local digits (\"2015551234\") or a \"+\"-prefixed string; the profile stores\n * \"+12015551234\". Only call this on values `validatePhoneNumber` has already accepted — shared by\n * every binding that persists a phone value (`ClientProfilePhoneControl`, `ClientProfileFieldset`)\n * so there is exactly one normalization implementation.\n */\nexport function toE164(raw: string, country: PhoneCountry): string {\n const unmasked = removePhoneMask(raw, country);\n if (unmasked.startsWith('+')) return unmasked;\n const code = country === 'BR' ? '55' : '1';\n const localMax = country === 'BR' ? 11 : 10;\n // A bare country-code prefix (\"12015551234\", \"5511999998888\") only needs the \"+\".\n return unmasked.startsWith(code) && unmasked.length > localMax ? `+${unmasked}` : `+${code}${unmasked}`;\n}\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\ntype PhoneFieldRequirement = 'mandatory' | 'optional';\n\nexport type PhoneFieldProps = {\n /** Controlled raw (unmasked) phone value. Unused on the bound path — react-hook-form owns the value. */\n value?: string;\n /** Uncontrolled initial raw value. Unused on the bound path — the field contract's `defaultValue` seeds it instead. */\n defaultValue?: string;\n /** Called with the raw (unmasked) value on every change. */\n onValueChange?: (value: string) => void;\n /** Selects the phone mask and validation rule. */\n country?: PhoneCountry;\n /**\n * Visible field label. No signature default (Decision 5 of the wrapped-field-particles spec) — an\n * omitted label falls back to the field contract's `label` when bound, and to `'Phone'` when not.\n */\n label?: string;\n /** Disables the field when true. Falls back to the field contract's `disabled` when bound. */\n isDisabled?: boolean;\n /** Input placeholder text. Falls back to the field contract's `placeholder` when bound. */\n placeholder?: string;\n /**\n * Externally-controlled invalid state. When provided, overrides the\n * particle's internal blur-triggered validation result.\n */\n invalid?: boolean;\n /**\n * Externally-supplied error message. When provided, overrides the\n * particle's internal error string.\n */\n error?: string;\n /** Error string shown when the input format is invalid. */\n errorInvalid?: string;\n /** Error string shown when the mandatory field is left empty. */\n errorRequired?: string;\n /**\n * Raises the field to required. It only ever raises: bound to a fieldset whose rule already says\n * required, `'optional'` does not lower it.\n *\n * - `'mandatory'`: empty input blocks submission.\n * - `'optional'`: empty input is allowed; format is still checked when a\n * value is present.\n * - unset: no opinion, so a phone with no baseline is optional.\n */\n requirement?: PhoneFieldRequirement;\n /** Called after the field loses focus (post-validation). */\n onBlur?: () => void;\n /** Additional class applied to the root element. */\n className?: string;\n /**\n * Lands on the masked `<input type=\"tel\">` the particle renders. Composed with react-hook-form's own\n * ref on the bound path — a caller ref and react-hook-form's ref are both honoured.\n */\n ref?: Ref<HTMLInputElement>;\n /**\n * Given, replaces the default `Field.Label` + `PhoneFieldInput` + `Field.Error` anatomy — any order,\n * any subset. `PhoneFieldInput` is the one part that carries the mask, the composed ref and the\n * particle's own value/handlers; a composed generic `Field.Control` would call `useController` a\n * second time for the same name (RFC's named, accepted double-binder hole).\n */\n children?: ReactNode;\n};\n\n// ---------------------------------------------------------------------------\n// Definition\n// ---------------------------------------------------------------------------\n\nexport const PhoneFieldDefinition = defineComponent<PhoneFieldProps>({\n name: 'PhoneField',\n importPath: '@vtex/faststore/components',\n component: PhoneField,\n providesContext: 'phone-field',\n editor: { label: 'Phone Field', category: 'action' },\n schema: {\n country: { type: 'string', default: 'US', label: 'Country (US or BR)' },\n label: { type: 'string', default: 'Phone', label: 'Label' },\n // No default: an unset requirement is no opinion, not a raise to mandatory.\n requirement: { type: ['mandatory', 'optional'] as const, label: 'Requirement' },\n errorInvalid: { type: 'string', default: 'Invalid phone number', label: 'Invalid error message' },\n errorRequired: { type: 'string', default: 'Phone number is required', label: 'Required error message' },\n },\n guideline:\n 'Locale-aware, business-agnostic phone number input composed from the field + input particles. Applies country masking, validates on blur, and exposes its value via onValueChange. Bind it to a data source (e.g. ClientProfilePhoneControl for checkout) to persist the value. Recomposable (RFC:503): given children, they replace the default Field.Label + PhoneFieldInput + Field.Error anatomy, in any order.',\n});\n\n// ---------------------------------------------------------------------------\n// Component\n// ---------------------------------------------------------------------------\n\n/**\n * Presentational, business-agnostic phone field. Composes the `field` and `input` particles: the\n * `Field.Root` owns the invalid/disabled state and the `Field.Error match` slot, while the `Input`\n * particle renders the masked `<tel>` control. The particle stays reusable (checkout binding today,\n * MyAccount / extensions later); a binding owns the data source and persistence.\n *\n * US/BR masking, blur validation, and the `data-fs-phone-field*` attributes (plus the country variant\n * attribute) are kept; error strings remain props (a documented i18n divergence — the country tables\n * are internal, the copy is owner-supplied).\n *\n * Reads the field contract through `useField()` and `useFormContext()` and dispatches to a bound or an\n * unbound sub-component — \"bound\" means both are present. Every react-hook-form hook lives in\n * `BoundPhoneField`, so hook order never changes under a mounted component. Both sub-components render\n * the same `PhoneFieldView`, so the two paths cannot drift into different DOM.\n */\nexport function PhoneField({ requirement, ...props }: PhoneFieldProps): ReactNode {\n const contract = useField();\n const formContext = useFormContext();\n\n if (contract && formContext) {\n return <BoundPhoneField {...props} requirement={requirement} contract={contract} />;\n }\n\n return <UnboundPhoneField {...props} requirement={requirement} />;\n}\n\n// ---------------------------------------------------------------------------\n// Input part — catalogued, placeable (Decision 4). Carries the mask, the composed ref, and the\n// particle's own onChange/onBlur; a generic Field.Control cannot be this part, because the mask and\n// the country/requirement validator belong to PhoneField, not to react-hook-form's own registration.\n// ---------------------------------------------------------------------------\n\ntype PhoneFieldInputContextValue = {\n ref?: Ref<HTMLInputElement>;\n value: string;\n placeholder?: string;\n /** Resolved by the binder, threaded here because this part is not the one that binds. */\n required: boolean;\n onChange: (event: ChangeEvent<HTMLInputElement>) => void;\n onBlur: (event: FocusEvent<HTMLInputElement>) => void;\n};\n\nconst PhoneFieldInputContext = createContext<PhoneFieldInputContextValue | null>(null);\n\nfunction usePhoneFieldInputContext(): PhoneFieldInputContextValue {\n const context = useContext(PhoneFieldInputContext);\n if (!context) {\n throw new Error('PhoneFieldInput must be a descendant of PhoneField.');\n }\n return context;\n}\n\nexport type PhoneFieldInputProps = { className?: string };\n\nexport const PhoneFieldInputDefinition = defineComponent<PhoneFieldInputProps>({\n name: 'PhoneFieldInput',\n importPath: '@vtex/faststore/components',\n component: PhoneFieldInput,\n requiresContext: 'phone-field',\n editor: { label: 'Phone Field Input', category: 'action' },\n schema: {},\n guideline:\n \"The masked <input type=\\\"tel\\\"> PhoneField owns. Must sit inside PhoneField, in either the default anatomy or an author's composed children. Carries the country mask, the composed ref, and PhoneField's own onChange/onBlur — a composed Field.Control here instead re-registers the field with react-hook-form and loses the mask (unsupported, RFC's named double-binder hole).\",\n});\n\n/** Renders the masked `<input>`, reading its value/handlers/ref from the enclosing `PhoneField`. */\nexport function PhoneFieldInput({ className }: PhoneFieldInputProps): ReactNode {\n const { ref, value, placeholder, required, onChange, onBlur } = usePhoneFieldInputContext();\n\n return (\n <Input\n ref={ref}\n data-fs-phone-field-input=\"\"\n type=\"tel\"\n inputMode=\"numeric\"\n // `aria-required`, not native `required`, for the reason password-field.tsx:89-91 records:\n // `Input` is a Base UI `Field.Control`, and native constraint tracking would flip\n // `aria-invalid` on its own, ahead of react-hook-form's own validation.\n aria-required={required || undefined}\n value={value}\n onChange={onChange}\n onBlur={onBlur}\n placeholder={placeholder}\n className={className}\n />\n );\n}\n\n// ---------------------------------------------------------------------------\n// Shared view — identical DOM whether bound or unbound\n// ---------------------------------------------------------------------------\n\ntype PhoneFieldViewProps = {\n ref?: Ref<HTMLInputElement>;\n country: PhoneCountry;\n className?: string;\n label: string;\n isDisabled: boolean;\n placeholder?: string;\n required: boolean;\n maskedValue: string;\n effectiveInvalid: boolean;\n effectiveError: string;\n onChange: (event: ChangeEvent<HTMLInputElement>) => void;\n onBlur: (event: FocusEvent<HTMLInputElement>) => void;\n children?: ReactNode;\n};\n\nfunction PhoneFieldView({\n ref,\n country,\n className,\n label,\n isDisabled,\n placeholder,\n required,\n maskedValue,\n effectiveInvalid,\n effectiveError,\n onChange,\n onBlur,\n children,\n}: PhoneFieldViewProps) {\n const inputContext = useMemo<PhoneFieldInputContextValue>(\n () => ({ ref, value: maskedValue, placeholder, required, onChange, onBlur }),\n [ref, maskedValue, placeholder, required, onChange, onBlur],\n );\n\n return (\n // Deliberately the RAW Base UI Field primitives, not this package's own Field.Root/Label/Error\n // wrapper, for the default anatomy: this reproduces exactly what rendered before Decision 3\n // (when FieldContractBoundary shielded this subtree from the ambient contract) — the resolved\n // `label`/`effectiveError` text renders unconditionally, and Field.Root's own dirty/touched\n // fallback tracking stays in charge, rather than react-hook-form's. Composed children, below,\n // use the package's own Field.* parts on purpose — that is what makes a childless Field.Label /\n // Field.Error resolve real text (FR-5).\n <BaseField.Root\n data-fs-phone-field-root=\"\"\n data-fs-phone-field-root-country={country}\n data-fs-field-root=\"\"\n className={className}\n invalid={effectiveInvalid}\n disabled={isDisabled}\n >\n <PhoneFieldInputContext.Provider value={inputContext}>\n {children ?? (\n <>\n <BaseField.Label data-fs-phone-field-label=\"\" data-fs-field-label=\"\">\n {label}\n </BaseField.Label>\n <PhoneFieldInput />\n {effectiveError ? (\n <BaseField.Error match data-fs-phone-field-error=\"\" data-fs-field-error=\"\">\n {effectiveError}\n </BaseField.Error>\n ) : null}\n </>\n )}\n </PhoneFieldInputContext.Provider>\n </BaseField.Root>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Unbound — today's body, moved verbatim\n// ---------------------------------------------------------------------------\n\ntype UnboundPhoneFieldProps = PhoneFieldProps;\n\nfunction UnboundPhoneField({\n value,\n defaultValue = '',\n onValueChange,\n country = 'US',\n label,\n isDisabled = false,\n placeholder,\n invalid,\n error,\n errorInvalid = 'Invalid phone number',\n errorRequired = 'Phone number is required',\n requirement,\n onBlur,\n className,\n ref,\n children,\n}: UnboundPhoneFieldProps) {\n const isControlled = value !== undefined;\n\n const [internalRaw, setInternalRaw] = useState(defaultValue);\n const [localInvalid, setLocalInvalid] = useState(false);\n const [localError, setLocalError] = useState('');\n\n // Clear local validation state when country changes so the next blur re-validates against the new\n // country's rules. The comparison baseline lives in state, not a ref, and the compare-and-set runs\n // during render (before paint), so a render React abandons without committing — a suspended\n // transition, a Suspense retry — never leaves a stale baseline behind the way a ref write would.\n const [prevCountry, setPrevCountry] = useState(country);\n if (prevCountry !== country) {\n setPrevCountry(country);\n setLocalInvalid(false);\n setLocalError('');\n }\n\n const rawValue = isControlled ? (value as string) : internalRaw;\n const maskedValue = applyPhoneMask(rawValue, country);\n const resolvedLabel = label ?? 'Phone';\n\n // External props take precedence over internal validation state.\n // When `invalid` is externally controlled, the error display is also fully\n // controlled: use the explicit `error` prop, or fall back to empty string so\n // no stale local error leaks through when the parent says the field is valid.\n const effectiveInvalid = invalid !== undefined ? invalid : localInvalid;\n const effectiveError = error !== undefined ? error : effectiveInvalid ? localError : '';\n\n function handleChange(event: ChangeEvent<HTMLInputElement>) {\n if (isDisabled) return;\n const raw = removePhoneMask(event.target.value, country);\n if (!isControlled) {\n setInternalRaw(raw);\n }\n onValueChange?.(raw);\n }\n\n function handleBlur(_event: FocusEvent<HTMLInputElement>) {\n if (isDisabled) return;\n\n let isFieldInvalid = false;\n let fieldError = '';\n\n if (requirement === 'mandatory' && !rawValue.trim()) {\n isFieldInvalid = true;\n fieldError = errorRequired;\n } else if (rawValue.trim()) {\n const valid = validatePhoneNumber(rawValue, country);\n isFieldInvalid = !valid;\n fieldError = valid ? '' : errorInvalid;\n }\n // optional + empty → no error, keep isFieldInvalid = false / fieldError = ''\n\n setLocalInvalid(isFieldInvalid);\n setLocalError(fieldError);\n onBlur?.();\n }\n\n return (\n <PhoneFieldView\n ref={ref}\n country={country}\n className={className}\n label={resolvedLabel}\n isDisabled={isDisabled}\n placeholder={placeholder}\n required={requirement === 'mandatory'}\n maskedValue={maskedValue}\n effectiveInvalid={effectiveInvalid}\n effectiveError={effectiveError}\n onChange={handleChange}\n onBlur={handleBlur}\n >\n {children}\n </PhoneFieldView>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Bound — reads the field contract, binds through useController\n// ---------------------------------------------------------------------------\n\ntype BoundPhoneFieldProps = UnboundPhoneFieldProps & { contract: FieldContract };\n\nfunction BoundPhoneField({\n value: _value,\n defaultValue: _defaultValue,\n onValueChange,\n country = 'US',\n label,\n isDisabled,\n placeholder,\n invalid,\n error,\n errorInvalid = 'Invalid phone number',\n errorRequired = 'Phone number is required',\n requirement,\n onBlur,\n className,\n ref: callerRef,\n contract,\n children,\n}: BoundPhoneFieldProps) {\n // Format only. Requiredness is not decided here: `useBoundField` resolves it from the fieldset's\n // baseline and the raise below, and installs the blank check, so the announcement and the\n // validation cannot disagree. The check composes alongside whatever the fieldset validates —\n // before this merge, any contract validator discarded the particle's own validation whole.\n const rule = useMemo<FieldRule>(\n () =>\n mergeFieldValidator(contract.rule, 'phoneFormat', (rawValue) => {\n const raw = typeof rawValue === 'string' ? rawValue : String(rawValue ?? '');\n return !raw.trim() || validatePhoneNumber(raw, country) || errorInvalid;\n }),\n [contract.rule, errorInvalid, country],\n );\n\n const field = useBoundField(contract, TEXT_FIELD_VALUE, rule, {\n required: requirement === 'mandatory',\n message: errorRequired,\n });\n const { getFieldState } = useFormContext();\n const { invalid: rhfInvalid, error: rhfError } = getFieldState(contract.name, useFormState({ name: contract.name }));\n\n const composedRef = useComposedRef<HTMLInputElement>(callerRef, field.ref);\n\n const rawValue = typeof field.value === 'string' ? field.value : String(field.value ?? '');\n const maskedValue = applyPhoneMask(rawValue, country);\n const resolvedLabel = label ?? contract.label ?? 'Phone';\n const resolvedPlaceholder = placeholder ?? contract.placeholder;\n const resolvedIsDisabled = isDisabled ?? contract.disabled ?? false;\n\n const effectiveInvalid = invalid !== undefined ? invalid : rhfInvalid;\n const effectiveError = error !== undefined ? error : effectiveInvalid ? (rhfError?.message ?? '') : '';\n\n function handleChange(event: ChangeEvent<HTMLInputElement>) {\n const raw = removePhoneMask(event.target.value, country);\n field.onChange(raw);\n onValueChange?.(raw);\n }\n\n function handleBlur(_event: FocusEvent<HTMLInputElement>) {\n field.onBlur();\n onBlur?.();\n }\n\n return (\n // Decision 3: replaces the empty-contract FieldContractBoundary with a re-provided contract\n // carrying the RESOLVED name/label/placeholder — the values a composed childless Field.Label /\n // Field.Error actually need, as opposed to the raw (possibly-undefined) ones the ambient\n // contract from the enclosing FieldBinding carries. useBoundField above remains the sole binder\n // for contract.name; this FieldBinding never registers anything itself.\n <FieldBinding\n name={contract.name}\n label={resolvedLabel}\n placeholder={resolvedPlaceholder}\n defaultValue={contract.defaultValue}\n rule={contract.rule}\n options={contract.options}\n disabled={resolvedIsDisabled}\n readOnly={contract.readOnly}\n autoComplete={contract.autoComplete}\n inputMode={contract.inputMode}\n >\n <PhoneFieldView\n ref={composedRef}\n country={country}\n className={className}\n label={resolvedLabel}\n isDisabled={resolvedIsDisabled}\n placeholder={resolvedPlaceholder}\n required={field.required}\n maskedValue={maskedValue}\n effectiveInvalid={effectiveInvalid}\n effectiveError={effectiveError}\n onChange={handleChange}\n onBlur={handleBlur}\n >\n {children}\n </PhoneFieldView>\n </FieldBinding>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAoCA,SAAS,mBAAmB,OAAe,SAAgC;CACzE,QAAQ,SA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;EACf,SAAS,SAAS;EAClB,UAAU;EACV,UAAU,SAAS;EACnB,cAAc,SAAS;EACvB,WAAW,SAAS;EAEpB,UAAA,oBAAC,gBAAD;GACE,KAAK;GACI;GACE;GACX,OAAO;GACP,YAAY;GACZ,aAAa;GACb,UAAU,MAAM;GACH;GACK;GACF;GAChB,UAAU;GACV,QAAQ;GAEP;EACa,CAAA;CACJ,CAAA;AAElB"}
1
+ {"version":3,"file":"phone-field.js","names":["BaseField"],"sources":["../../../src/particles/phone-field/phone-field.tsx"],"sourcesContent":["'use client';\nimport { Field as BaseField } from '@base-ui/react/field';\nimport { defineComponent } from '@vtex/fs-core';\nimport type { ChangeEvent, FocusEvent, ReactNode, Ref } from 'react';\nimport { createContext, useContext, useMemo, useState } from 'react';\nimport { useFormContext, useFormState } from 'react-hook-form';\nimport {\n FieldBinding,\n type FieldContract,\n type FieldRule,\n mergeFieldValidator,\n TEXT_FIELD_VALUE,\n useBoundField,\n useField,\n} from '../field/field.js';\nimport { Input } from '../input/input.js';\nimport { useComposedRef } from '../shared/compose-refs.js';\n\n// ---------------------------------------------------------------------------\n// Country masks\n// ---------------------------------------------------------------------------\n\n/**\n * Country codes supported by PhoneField.\n * Only US and BR are implemented; every other ISO-2 code falls back to the US\n * format (Gap-06 in the PhoneField spec).\n */\nexport type PhoneCountry = 'US' | 'BR';\n\n/**\n * Returns true when `value` starts with the E.164 or bare country-code prefix\n * for the given country.\n *\n * US country code: 1 → \"+1…\" or \"1…\"\n * BR country code: 55 → \"+55…\" or \"55…\"\n */\nfunction isValidCountryCode(value: string, country: PhoneCountry): boolean {\n switch (country) {\n case 'US':\n return value.startsWith('+1') || value.startsWith('1');\n case 'BR':\n return value.startsWith('+55') || value.startsWith('55');\n default:\n return false;\n }\n}\n\n/**\n * Strips phone mask formatting from `value`.\n *\n * When the raw string carries a valid country-code prefix (e.g. \"+55…\"), the\n * returned value preserves the leading \"+\" so callers can detect E.164 intent.\n * Otherwise only digits are returned.\n *\n * `removePhoneMask(applyPhoneMask(raw, country), country) === raw` for all\n * valid raw values that do NOT carry a country-code prefix.\n */\nexport function removePhoneMask(value: string, country: PhoneCountry): string {\n const onlyDigits = value.replace(/\\D/g, '');\n\n // Only treat as E.164 when the raw string explicitly carries a \"+\" prefix.\n // A bare digit string that starts with the country-code digits (e.g. \"1234567890\"\n // starting with \"1\") is a local number, not a country-code-prefixed one.\n if (value.startsWith('+') && isValidCountryCode(value, country)) {\n return `+${onlyDigits}`;\n }\n\n return onlyDigits;\n}\n\n/**\n * Formats `value` into the mask pattern for `country`, applying as many mask\n * characters as the digit count allows (progressive masking while typing).\n *\n * US: (123) 456-7890 or +1 (123) 456-7890\n * BR: (11) 99999-9999 or +55 (11) 99999-9999\n *\n * Non-US/BR countries fall back to the US mask.\n */\nexport function applyPhoneMask(value: string, country: PhoneCountry): string {\n switch (country) {\n case 'US':\n return applyUSPhoneMask(value);\n case 'BR':\n return applyBRPhoneMask(value);\n default:\n return applyUSPhoneMask(value);\n }\n}\n\nfunction applyUSPhoneMask(value: string): string {\n const onlyDigits = value.replace(/\\D/g, '');\n\n // E.164 with explicit \"+\" prefix and full country code\n if (value.startsWith('+1') && onlyDigits.length >= 11) {\n const local = value.replace('+1', '').replace(/\\D/g, '');\n return `+1 ${formatUSNumber(local)}`;\n }\n\n // Bare country-code prefix (e.g. \"11234567890\")\n if (onlyDigits.startsWith('1') && onlyDigits.length === 11) {\n return `+1 ${formatUSNumber(onlyDigits.substring(1))}`;\n }\n\n return formatUSNumber(onlyDigits);\n}\n\nfunction formatUSNumber(digits: string): string {\n // US local numbers cap at 10 digits — drop the overflow instead of growing the mask unbounded.\n const local = digits.slice(0, 10);\n if (local.length === 0) return '';\n if (local.length <= 3) return `(${local}`;\n if (local.length <= 6) return `(${local.slice(0, 3)}) ${local.slice(3)}`;\n return `(${local.slice(0, 3)}) ${local.slice(3, 6)}-${local.slice(6)}`;\n}\n\nfunction applyBRPhoneMask(value: string): string {\n const onlyDigits = value.replace(/\\D/g, '');\n\n // E.164 with explicit \"+55\" prefix. 12 digits is a landline (+55 + 10 local),\n // 13 is a mobile (+55 + 11 local); both strip the \"55\" country code.\n if (value.startsWith('+55') && onlyDigits.length >= 12) {\n const local = value.replace('+55', '').replace(/\\D/g, '');\n return `+55 ${formatBRNumber(local)}`;\n }\n\n // Bare country-code prefix (e.g. \"5511999998888\" mobile, \"551133334444\" landline)\n if (onlyDigits.startsWith('55') && (onlyDigits.length === 12 || onlyDigits.length === 13)) {\n return `+55 ${formatBRNumber(onlyDigits.substring(2))}`;\n }\n\n return formatBRNumber(onlyDigits);\n}\n\nfunction formatBRNumber(digits: string): string {\n // BR local numbers cap at 11 digits (mobile) — drop the overflow instead of growing the mask unbounded.\n const local = digits.slice(0, 11);\n if (local.length === 0) return '';\n if (local.length <= 2) return `(${local}`;\n if (local.length <= 6) return `(${local.slice(0, 2)}) ${local.slice(2)}`;\n // 7-10 digits: landline format (XX) XXXX-XXXX\n if (local.length <= 10) return `(${local.slice(0, 2)}) ${local.slice(2, 6)}-${local.slice(6)}`;\n // 11 digits: mobile format (XX) XXXXX-XXXX\n return `(${local.slice(0, 2)}) ${local.slice(2, 7)}-${local.slice(7)}`;\n}\n\n// ---------------------------------------------------------------------------\n// Validation\n// ---------------------------------------------------------------------------\n\n/**\n * BR local part: 10 digits is a landline; 11 digits is a mobile, which must carry the mandatory\n * ninth digit \"9\" right after the two-digit DDD (the `phone` library rule the spec's Gap-05\n * reimplements — \"11899998888\" is mobile-shaped but not a real BR number).\n */\nfunction isValidBRLocal(digits: string): boolean {\n if (digits.length === 10) return true;\n return digits.length === 11 && digits[2] === '9';\n}\n\n/**\n * Validates a raw (unmasked) phone number string for the given country.\n *\n * NOTE: The spec (KD-3) calls for using the `phone` npm library for validation.\n * The library is listed in Gap-05 as a new dependency to add when available.\n * Until that dependency is installed, this implements an equivalent\n * digit-count validation that covers all spec key-scenarios for US and BR.\n * Country-code and non-country-code inputs are both handled.\n *\n * US valid forms:\n * - 10 digits (local, e.g. \"1234567890\")\n * - 11 raw digits with country code \"1\" (e.g. \"11234567890\")\n * - E.164 \"+1\" + 10 digits (e.g. \"+11234567890\")\n *\n * BR valid forms:\n * - 10 digits (landline, e.g. \"1133334444\")\n * - 11 digits (mobile, e.g. \"11999998888\"; the ninth digit after the DDD must be \"9\")\n * - E.164 \"+55\" + 10 or 11 digits (e.g. \"+5511999998888\")\n */\nexport function validatePhoneNumber(input: string, country: PhoneCountry): boolean {\n if (!input || !input.trim()) return false;\n\n const digits = input.replace(/\\D/g, '');\n\n if (isValidCountryCode(input, country)) {\n // Country-code branch: validate digit count including the country code digits.\n if (country === 'US') {\n // \"+1\" or \"1\" prefix + exactly 10 local digits = 11 raw digits\n if (digits.length === 11) return true;\n // Fall through: could be a 10-digit local number that starts with \"1\"\n } else {\n // BR: \"+55\" or \"55\" prefix + 10 or 11 local digits = 12 or 13 raw digits\n if (digits.length === 12 || digits.length === 13) return isValidBRLocal(digits.slice(2));\n // Fall through: could be local digits that happen to start with \"55\"\n }\n }\n\n // Local (no country code) validation\n if (country === 'US') {\n return digits.length === 10;\n }\n\n return isValidBRLocal(digits);\n}\n\n/**\n * Normalizes a valid raw phone value to E.164 for persistence (legacy checkout parity): the\n * particle emits local digits (\"2015551234\") or a \"+\"-prefixed string; the profile stores\n * \"+12015551234\". Only call this on values `validatePhoneNumber` has already accepted — shared by\n * every binding that persists a phone value (`ClientProfilePhoneControl`, `ClientProfileFieldset`)\n * so there is exactly one normalization implementation.\n */\nexport function toE164(raw: string, country: PhoneCountry): string {\n const unmasked = removePhoneMask(raw, country);\n if (unmasked.startsWith('+')) return unmasked;\n const code = country === 'BR' ? '55' : '1';\n const localMax = country === 'BR' ? 11 : 10;\n // A bare country-code prefix (\"12015551234\", \"5511999998888\") only needs the \"+\".\n return unmasked.startsWith(code) && unmasked.length > localMax ? `+${unmasked}` : `+${code}${unmasked}`;\n}\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\ntype PhoneFieldRequirement = 'mandatory' | 'optional';\n\nexport type PhoneFieldProps = {\n /** Controlled raw (unmasked) phone value. Unused on the bound path — react-hook-form owns the value. */\n value?: string;\n /** Uncontrolled initial raw value. Unused on the bound path — the field contract's `defaultValue` seeds it instead. */\n defaultValue?: string;\n /** Called with the raw (unmasked) value on every change. */\n onValueChange?: (value: string) => void;\n /** Selects the phone mask and validation rule. */\n country?: PhoneCountry;\n /**\n * Visible field label. No signature default (Decision 5 of the wrapped-field-particles spec) — an\n * omitted label falls back to the field contract's `label` when bound, and to `'Phone'` when not.\n */\n label?: string;\n /** Disables the field when true. Falls back to the field contract's `disabled` when bound. */\n isDisabled?: boolean;\n /** Input placeholder text. Falls back to the field contract's `placeholder` when bound. */\n placeholder?: string;\n /**\n * Externally-controlled invalid state. When provided, overrides the\n * particle's internal blur-triggered validation result.\n */\n invalid?: boolean;\n /**\n * Externally-supplied error message. When provided, overrides the\n * particle's internal error string.\n */\n error?: string;\n /** Error string shown when the input format is invalid. */\n errorInvalid?: string;\n /** Error string shown when the mandatory field is left empty. */\n errorRequired?: string;\n /**\n * Raises the field to required. It only ever raises: bound to a fieldset whose rule already says\n * required, `'optional'` does not lower it.\n *\n * - `'mandatory'`: empty input blocks submission.\n * - `'optional'`: empty input is allowed; format is still checked when a\n * value is present.\n * - unset: no opinion, so a phone with no baseline is optional.\n */\n requirement?: PhoneFieldRequirement;\n /** Called after the field loses focus (post-validation). */\n onBlur?: () => void;\n /** Additional class applied to the root element. */\n className?: string;\n /**\n * Lands on the masked `<input type=\"tel\">` the particle renders. Composed with react-hook-form's own\n * ref on the bound path — a caller ref and react-hook-form's ref are both honoured.\n */\n ref?: Ref<HTMLInputElement>;\n /**\n * Given, replaces the default `Field.Label` + `PhoneFieldInput` + `Field.Error` anatomy — any order,\n * any subset. `PhoneFieldInput` is the one part that carries the mask, the composed ref and the\n * particle's own value/handlers; a composed generic `Field.Control` would call `useController` a\n * second time for the same name (RFC's named, accepted double-binder hole).\n */\n children?: ReactNode;\n};\n\n// ---------------------------------------------------------------------------\n// Definition\n// ---------------------------------------------------------------------------\n\nexport const PhoneFieldDefinition = defineComponent<PhoneFieldProps>({\n name: 'PhoneField',\n importPath: '@vtex/faststore/components',\n component: PhoneField,\n providesContext: 'phone-field',\n editor: { label: 'Phone Field', category: 'action' },\n schema: {\n country: { type: 'string', default: 'US', label: 'Country (US or BR)' },\n label: { type: 'string', default: 'Phone', label: 'Label' },\n // No default: an unset requirement is no opinion, not a raise to mandatory.\n requirement: { type: ['mandatory', 'optional'] as const, label: 'Requirement' },\n errorInvalid: { type: 'string', default: 'Invalid phone number', label: 'Invalid error message' },\n errorRequired: { type: 'string', default: 'Phone number is required', label: 'Required error message' },\n },\n guideline:\n 'Locale-aware, business-agnostic phone number input composed from the field + input particles. Applies country masking, validates on blur, and exposes its value via onValueChange. Bind it to a data source (e.g. ClientProfilePhoneControl for checkout) to persist the value. Recomposable (RFC:503): given children, they replace the default Field.Label + PhoneFieldInput + Field.Error anatomy, in any order.',\n});\n\n// ---------------------------------------------------------------------------\n// Component\n// ---------------------------------------------------------------------------\n\n/**\n * Presentational, business-agnostic phone field. Composes the `field` and `input` particles: the\n * `Field.Root` owns the invalid/disabled state and the `Field.Error match` slot, while the `Input`\n * particle renders the masked `<tel>` control. The particle stays reusable (checkout binding today,\n * MyAccount / extensions later); a binding owns the data source and persistence.\n *\n * US/BR masking, blur validation, and the `data-fs-phone-field*` attributes (plus the country variant\n * attribute) are kept; error strings remain props (a documented i18n divergence — the country tables\n * are internal, the copy is owner-supplied).\n *\n * Reads the field contract through `useField()` and `useFormContext()` and dispatches to a bound or an\n * unbound sub-component — \"bound\" means both are present. Every react-hook-form hook lives in\n * `BoundPhoneField`, so hook order never changes under a mounted component. Both sub-components render\n * the same `PhoneFieldView`, so the two paths cannot drift into different DOM.\n */\nexport function PhoneField({ requirement, ...props }: PhoneFieldProps): ReactNode {\n const contract = useField();\n const formContext = useFormContext();\n\n if (contract && formContext) {\n return <BoundPhoneField {...props} requirement={requirement} contract={contract} />;\n }\n\n return <UnboundPhoneField {...props} requirement={requirement} />;\n}\n\n// ---------------------------------------------------------------------------\n// Input part — catalogued, placeable (Decision 4). Carries the mask, the composed ref, and the\n// particle's own onChange/onBlur; a generic Field.Control cannot be this part, because the mask and\n// the country/requirement validator belong to PhoneField, not to react-hook-form's own registration.\n// ---------------------------------------------------------------------------\n\ntype PhoneFieldInputContextValue = {\n ref?: Ref<HTMLInputElement>;\n value: string;\n placeholder?: string;\n /** Resolved by the binder, threaded here because this part is not the one that binds. */\n required: boolean;\n onChange: (event: ChangeEvent<HTMLInputElement>) => void;\n onBlur: (event: FocusEvent<HTMLInputElement>) => void;\n};\n\nconst PhoneFieldInputContext = createContext<PhoneFieldInputContextValue | null>(null);\n\nfunction usePhoneFieldInputContext(): PhoneFieldInputContextValue {\n const context = useContext(PhoneFieldInputContext);\n if (!context) {\n throw new Error('PhoneFieldInput must be a descendant of PhoneField.');\n }\n return context;\n}\n\nexport type PhoneFieldInputProps = { className?: string };\n\nexport const PhoneFieldInputDefinition = defineComponent<PhoneFieldInputProps>({\n name: 'PhoneFieldInput',\n importPath: '@vtex/faststore/components',\n component: PhoneFieldInput,\n requiresContext: 'phone-field',\n editor: { label: 'Phone Field Input', category: 'action' },\n schema: {},\n guideline:\n \"The masked <input type=\\\"tel\\\"> PhoneField owns. Must sit inside PhoneField, in either the default anatomy or an author's composed children. Carries the country mask, the composed ref, and PhoneField's own onChange/onBlur — a composed Field.Control here instead re-registers the field with react-hook-form and loses the mask (unsupported, RFC's named double-binder hole).\",\n});\n\n/** Renders the masked `<input>`, reading its value/handlers/ref from the enclosing `PhoneField`. */\nexport function PhoneFieldInput({ className }: PhoneFieldInputProps): ReactNode {\n const { ref, value, placeholder, required, onChange, onBlur } = usePhoneFieldInputContext();\n\n return (\n <Input\n ref={ref}\n data-fs-phone-field-input=\"\"\n type=\"tel\"\n inputMode=\"numeric\"\n // `aria-required`, not native `required`, for the reason password-field.tsx:89-91 records:\n // `Input` is a Base UI `Field.Control`, and native constraint tracking would flip\n // `aria-invalid` on its own, ahead of react-hook-form's own validation.\n aria-required={required || undefined}\n value={value}\n onChange={onChange}\n onBlur={onBlur}\n placeholder={placeholder}\n className={className}\n />\n );\n}\n\n// ---------------------------------------------------------------------------\n// Shared view — identical DOM whether bound or unbound\n// ---------------------------------------------------------------------------\n\ntype PhoneFieldViewProps = {\n ref?: Ref<HTMLInputElement>;\n country: PhoneCountry;\n className?: string;\n label: string;\n isDisabled: boolean;\n placeholder?: string;\n required: boolean;\n maskedValue: string;\n effectiveInvalid: boolean;\n effectiveError: string;\n onChange: (event: ChangeEvent<HTMLInputElement>) => void;\n onBlur: (event: FocusEvent<HTMLInputElement>) => void;\n children?: ReactNode;\n};\n\nfunction PhoneFieldView({\n ref,\n country,\n className,\n label,\n isDisabled,\n placeholder,\n required,\n maskedValue,\n effectiveInvalid,\n effectiveError,\n onChange,\n onBlur,\n children,\n}: PhoneFieldViewProps) {\n const inputContext = useMemo<PhoneFieldInputContextValue>(\n () => ({ ref, value: maskedValue, placeholder, required, onChange, onBlur }),\n [ref, maskedValue, placeholder, required, onChange, onBlur],\n );\n\n return (\n // Deliberately the RAW Base UI Field primitives, not this package's own Field.Root/Label/Error\n // wrapper, for the default anatomy: this reproduces exactly what rendered before Decision 3\n // (when FieldContractBoundary shielded this subtree from the ambient contract) — the resolved\n // `label`/`effectiveError` text renders unconditionally, and Field.Root's own dirty/touched\n // fallback tracking stays in charge, rather than react-hook-form's. Composed children, below,\n // use the package's own Field.* parts on purpose — that is what makes a childless Field.Label /\n // Field.Error resolve real text (FR-5).\n <BaseField.Root\n data-fs-phone-field-root=\"\"\n data-fs-phone-field-root-country={country}\n data-fs-field-root=\"\"\n className={className}\n invalid={effectiveInvalid}\n disabled={isDisabled}\n >\n <PhoneFieldInputContext.Provider value={inputContext}>\n {children ?? (\n <>\n <BaseField.Label data-fs-phone-field-label=\"\" data-fs-field-label=\"\">\n {label}\n </BaseField.Label>\n <PhoneFieldInput />\n {effectiveError ? (\n <BaseField.Error match data-fs-phone-field-error=\"\" data-fs-field-error=\"\">\n {effectiveError}\n </BaseField.Error>\n ) : null}\n </>\n )}\n </PhoneFieldInputContext.Provider>\n </BaseField.Root>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Unbound — today's body, moved verbatim\n// ---------------------------------------------------------------------------\n\ntype UnboundPhoneFieldProps = PhoneFieldProps;\n\nfunction UnboundPhoneField({\n value,\n defaultValue = '',\n onValueChange,\n country = 'US',\n label,\n isDisabled = false,\n placeholder,\n invalid,\n error,\n errorInvalid = 'Invalid phone number',\n errorRequired = 'Phone number is required',\n requirement,\n onBlur,\n className,\n ref,\n children,\n}: UnboundPhoneFieldProps) {\n const isControlled = value !== undefined;\n\n const [internalRaw, setInternalRaw] = useState(defaultValue);\n const [localInvalid, setLocalInvalid] = useState(false);\n const [localError, setLocalError] = useState('');\n\n // Clear local validation state when country changes so the next blur re-validates against the new\n // country's rules. The comparison baseline lives in state, not a ref, and the compare-and-set runs\n // during render (before paint), so a render React abandons without committing — a suspended\n // transition, a Suspense retry — never leaves a stale baseline behind the way a ref write would.\n const [prevCountry, setPrevCountry] = useState(country);\n if (prevCountry !== country) {\n setPrevCountry(country);\n setLocalInvalid(false);\n setLocalError('');\n }\n\n const rawValue = isControlled ? (value as string) : internalRaw;\n const maskedValue = applyPhoneMask(rawValue, country);\n const resolvedLabel = label ?? 'Phone';\n\n // External props take precedence over internal validation state.\n // When `invalid` is externally controlled, the error display is also fully\n // controlled: use the explicit `error` prop, or fall back to empty string so\n // no stale local error leaks through when the parent says the field is valid.\n const effectiveInvalid = invalid !== undefined ? invalid : localInvalid;\n const effectiveError = error !== undefined ? error : effectiveInvalid ? localError : '';\n\n function handleChange(event: ChangeEvent<HTMLInputElement>) {\n if (isDisabled) return;\n const raw = removePhoneMask(event.target.value, country);\n if (!isControlled) {\n setInternalRaw(raw);\n }\n onValueChange?.(raw);\n }\n\n function handleBlur(_event: FocusEvent<HTMLInputElement>) {\n if (isDisabled) return;\n\n let isFieldInvalid = false;\n let fieldError = '';\n\n if (requirement === 'mandatory' && !rawValue.trim()) {\n isFieldInvalid = true;\n fieldError = errorRequired;\n } else if (rawValue.trim()) {\n const valid = validatePhoneNumber(rawValue, country);\n isFieldInvalid = !valid;\n fieldError = valid ? '' : errorInvalid;\n }\n // optional + empty → no error, keep isFieldInvalid = false / fieldError = ''\n\n setLocalInvalid(isFieldInvalid);\n setLocalError(fieldError);\n onBlur?.();\n }\n\n return (\n <PhoneFieldView\n ref={ref}\n country={country}\n className={className}\n label={resolvedLabel}\n isDisabled={isDisabled}\n placeholder={placeholder}\n required={requirement === 'mandatory'}\n maskedValue={maskedValue}\n effectiveInvalid={effectiveInvalid}\n effectiveError={effectiveError}\n onChange={handleChange}\n onBlur={handleBlur}\n >\n {children}\n </PhoneFieldView>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Bound — reads the field contract, binds through useController\n// ---------------------------------------------------------------------------\n\ntype BoundPhoneFieldProps = UnboundPhoneFieldProps & { contract: FieldContract };\n\nfunction BoundPhoneField({\n value: _value,\n defaultValue: _defaultValue,\n onValueChange,\n country = 'US',\n label,\n isDisabled,\n placeholder,\n invalid,\n error,\n errorInvalid = 'Invalid phone number',\n errorRequired = 'Phone number is required',\n requirement,\n onBlur,\n className,\n ref: callerRef,\n contract,\n children,\n}: BoundPhoneFieldProps) {\n // Format only. Requiredness is not decided here: `useBoundField` resolves it from the fieldset's\n // baseline and the raise below, and installs the blank check, so the announcement and the\n // validation cannot disagree. The check composes alongside whatever the fieldset validates —\n // before this merge, any contract validator discarded the particle's own validation whole.\n const rule = useMemo<FieldRule>(\n () =>\n mergeFieldValidator(contract.rule, 'phoneFormat', (rawValue) => {\n const raw = typeof rawValue === 'string' ? rawValue : String(rawValue ?? '');\n return !raw.trim() || validatePhoneNumber(raw, country) || errorInvalid;\n }),\n [contract.rule, errorInvalid, country],\n );\n\n const field = useBoundField(contract, TEXT_FIELD_VALUE, rule, {\n required: requirement === 'mandatory',\n message: errorRequired,\n });\n const { getFieldState } = useFormContext();\n const { invalid: rhfInvalid, error: rhfError } = getFieldState(contract.name, useFormState({ name: contract.name }));\n\n const composedRef = useComposedRef<HTMLInputElement>(callerRef, field.ref);\n\n const rawValue = typeof field.value === 'string' ? field.value : String(field.value ?? '');\n const maskedValue = applyPhoneMask(rawValue, country);\n const resolvedLabel = label ?? contract.label ?? 'Phone';\n const resolvedPlaceholder = placeholder ?? contract.placeholder;\n const resolvedIsDisabled = isDisabled ?? contract.disabled ?? false;\n\n const effectiveInvalid = invalid !== undefined ? invalid : rhfInvalid;\n const effectiveError = error !== undefined ? error : effectiveInvalid ? (rhfError?.message ?? '') : '';\n\n function handleChange(event: ChangeEvent<HTMLInputElement>) {\n const raw = removePhoneMask(event.target.value, country);\n field.onChange(raw);\n onValueChange?.(raw);\n }\n\n function handleBlur(_event: FocusEvent<HTMLInputElement>) {\n field.onBlur();\n onBlur?.();\n }\n\n return (\n // Decision 3: replaces the empty-contract FieldContractBoundary with a re-provided contract\n // carrying the RESOLVED name/label/placeholder — the values a composed childless Field.Label /\n // Field.Error actually need, as opposed to the raw (possibly-undefined) ones the ambient\n // contract from the enclosing FieldBinding carries. useBoundField above remains the sole binder\n // for contract.name; this FieldBinding never registers anything itself.\n <FieldBinding\n name={contract.name}\n label={resolvedLabel}\n placeholder={resolvedPlaceholder}\n defaultValue={contract.defaultValue}\n rule={contract.rule}\n options={contract.options}\n disabled={resolvedIsDisabled}\n readOnly={contract.readOnly}\n autoComplete={contract.autoComplete}\n inputMode={contract.inputMode}\n >\n <PhoneFieldView\n ref={composedRef}\n country={country}\n className={className}\n label={resolvedLabel}\n isDisabled={resolvedIsDisabled}\n placeholder={resolvedPlaceholder}\n required={field.required}\n maskedValue={maskedValue}\n effectiveInvalid={effectiveInvalid}\n effectiveError={effectiveError}\n onChange={handleChange}\n onBlur={handleBlur}\n >\n {children}\n </PhoneFieldView>\n </FieldBinding>\n );\n}\n"],"mappings":";;;;;;;;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,SAAS;EACf,OAAO;EACP,aAAa;EACb,cAAc,SAAS;EACvB,MAAM,SAAS;EACf,SAAS,SAAS;EAClB,UAAU;EACV,UAAU,SAAS;EACnB,cAAc,SAAS;EACvB,WAAW,SAAS;EAEpB,UAAA,oBAAC,gBAAD;GACE,KAAK;GACI;GACE;GACX,OAAO;GACP,YAAY;GACZ,aAAa;GACb,UAAU,MAAM;GACH;GACK;GACF;GAChB,UAAU;GACV,QAAQ;GAEP;EACa,CAAA;CACJ,CAAA;AAElB"}
@@ -131,7 +131,7 @@ const SelectPositionerDefinition = defineComponent({
131
131
  "center",
132
132
  "end"
133
133
  ],
134
- default: "center",
134
+ default: "start",
135
135
  label: "Align"
136
136
  },
137
137
  sideOffset: {
@@ -141,11 +141,11 @@ const SelectPositionerDefinition = defineComponent({
141
141
  },
142
142
  alignItemWithTrigger: {
143
143
  type: "boolean",
144
- default: true,
144
+ default: false,
145
145
  label: "Align Item With Trigger"
146
146
  }
147
147
  },
148
- guideline: "Positions the popup relative to the trigger. Use side and align to control placement; alignItemWithTrigger=true overlaps the trigger to align the selected item visually."
148
+ guideline: "Positions the popup relative to the trigger. Use side and align to control placement. The popup opens below the trigger by default; alignItemWithTrigger=true makes it cover the trigger to align the selected item with it."
149
149
  });
150
150
  const SelectScrollUpArrowDefinition = defineComponent({
151
151
  name: "SelectScrollUpArrow",
@@ -171,7 +171,7 @@ const SelectPopupDefinition = defineComponent({
171
171
  category: "layout"
172
172
  },
173
173
  schema: {},
174
- guideline: "Visible container for the select list. Apply background, shadow, and border styles here."
174
+ guideline: "Visible container for the select list. Apply background, shadow, and border styles here. The base stylesheet bounds it to the viewport (max-height from --available-height, as a flex column) so the list scrolls inside it; a utility class such as max-h-60 overrides that bound."
175
175
  });
176
176
  const SelectArrowDefinition = defineComponent({
177
177
  name: "SelectArrow",
@@ -193,7 +193,7 @@ const SelectListDefinition = defineComponent({
193
193
  category: "layout"
194
194
  },
195
195
  schema: {},
196
- guideline: "Scrollable container for all Select.Item elements. Apply max-height and overflow for scrolling."
196
+ guideline: "Scrollable container for all Select.Item elements. The base stylesheet makes it scroll (overflow-y: auto) inside the popup bound; an overflow-* utility class overrides that."
197
197
  });
198
198
  const SelectItemDefinition = defineComponent({
199
199
  name: "SelectItem",
@@ -345,7 +345,7 @@ function SelectBackdrop({ className, children, ...props }) {
345
345
  children
346
346
  });
347
347
  }
348
- function SelectPositioner({ side = "bottom", align = "center", sideOffset = 0, alignItemWithTrigger = true, className, children, ...props }) {
348
+ function SelectPositioner({ side = "bottom", align = "start", sideOffset = 0, alignItemWithTrigger = false, className, children, ...props }) {
349
349
  return /* @__PURE__ */ jsx(Select.Positioner, {
350
350
  ...props,
351
351
  side,
@@ -1 +1 @@
1
- {"version":3,"file":"select.js","names":["BaseSelect","Select"],"sources":["../../../src/particles/select/select.tsx"],"sourcesContent":["'use client';\nimport { Select as BaseSelect } from '@base-ui/react/select';\nimport { defineComponent } from '@vtex/fs-core';\nimport type { ComponentPropsWithRef, ReactNode } from 'react';\n\nexport type SelectSide = 'top' | 'bottom' | 'left' | 'right';\nexport type SelectAlign = 'start' | 'center' | 'end';\n\nexport type SelectRootProps = {\n disabled?: boolean;\n modal?: boolean;\n required?: boolean;\n readOnly?: boolean;\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string | null) => void;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n name?: string;\n /** Forwarded to Base UI's hidden `<input>` — turns on browser autofill for the field. */\n autoComplete?: string;\n children?: ReactNode;\n};\n\nexport type SelectLabelProps = ComponentPropsWithRef<'div'>;\n\nexport type SelectTriggerProps = ComponentPropsWithRef<'button'> & {\n disabled?: boolean;\n};\n\nexport type SelectValueProps = Omit<ComponentPropsWithRef<'span'>, 'children'> & {\n placeholder?: string;\n /** Rendered content, or a render function receiving the current value (Base UI resolves the\n * matching item's label automatically when omitted, but only once that item has mounted at\n * least once — e.g. after the popup has been opened — so pass a render function when the\n * label must be correct before the shopper ever opens the dropdown). */\n children?: ReactNode | ((value: string | null) => ReactNode);\n};\n\nexport type SelectIconProps = ComponentPropsWithRef<'span'>;\n\nexport type SelectPortalProps = {\n children?: ReactNode;\n};\n\nexport type SelectBackdropProps = ComponentPropsWithRef<'div'>;\n\nexport type SelectPositionerProps = ComponentPropsWithRef<'div'> & {\n side?: SelectSide;\n align?: SelectAlign;\n sideOffset?: number;\n alignItemWithTrigger?: boolean;\n};\n\nexport type SelectScrollUpArrowProps = ComponentPropsWithRef<'div'> & {\n keepMounted?: boolean;\n};\n\nexport type SelectPopupProps = ComponentPropsWithRef<'div'>;\n\nexport type SelectArrowProps = ComponentPropsWithRef<'div'>;\n\nexport type SelectListProps = ComponentPropsWithRef<'div'>;\n\nexport type SelectItemProps = ComponentPropsWithRef<'div'> & {\n value?: string;\n disabled?: boolean;\n label?: string;\n};\n\nexport type SelectItemTextProps = ComponentPropsWithRef<'div'>;\n\nexport type SelectItemIndicatorProps = ComponentPropsWithRef<'span'> & {\n keepMounted?: boolean;\n};\n\nexport type SelectSeparatorProps = ComponentPropsWithRef<'div'>;\n\nexport type SelectGroupProps = ComponentPropsWithRef<'div'>;\n\nexport type SelectGroupLabelProps = ComponentPropsWithRef<'div'>;\n\nexport type SelectScrollDownArrowProps = ComponentPropsWithRef<'div'> & {\n keepMounted?: boolean;\n};\n\nexport const SelectRootDefinition = defineComponent<SelectRootProps>({\n name: 'SelectRoot',\n importPath: '@vtex/faststore/components',\n component: SelectRoot,\n editor: { label: 'Select Root', category: 'layout' },\n schema: {\n disabled: { type: 'boolean', default: false, label: 'Disabled' },\n modal: { type: 'boolean', default: true, label: 'Modal' },\n required: { type: 'boolean', default: false, label: 'Required' },\n readOnly: { type: 'boolean', default: false, label: 'Read Only' },\n },\n guideline:\n 'Root of a select dropdown. Manages selection state, modal overlay, and form integration. Compose as: SelectRoot > (SelectLabel + SelectTrigger > (SelectValue + SelectIcon) + SelectPortal > (SelectBackdrop + SelectPositioner > SelectPopup > (SelectScrollUpArrow + SelectList > [SelectItem > (SelectItemText + SelectItemIndicator)] + SelectScrollDownArrow))). Use SelectGroup > (SelectGroupLabel + [SelectItem]) for grouped options. Set modal=false to allow interacting with background elements while open.',\n});\n\nexport const SelectLabelDefinition = defineComponent<SelectLabelProps>({\n name: 'SelectLabel',\n importPath: '@vtex/faststore/components',\n component: SelectLabel,\n editor: { label: 'Select Label', category: 'layout' },\n schema: {},\n guideline:\n 'Accessible label associated with the trigger. Always place outside Select.Trigger so screen readers announce it separately.',\n});\n\nexport const SelectTriggerDefinition = defineComponent<SelectTriggerProps>({\n name: 'SelectTrigger',\n importPath: '@vtex/faststore/components',\n component: SelectTrigger,\n editor: { label: 'Select Trigger', category: 'action' },\n schema: {\n disabled: { type: 'boolean', default: false, label: 'Disabled' },\n },\n guideline:\n 'Opens and closes the popup on click. Use data-open and data-placeholder CSS attributes for open-state and empty-state styling.',\n});\n\nexport const SelectValueDefinition = defineComponent<SelectValueProps>({\n name: 'SelectValue',\n importPath: '@vtex/faststore/components',\n component: SelectValue,\n editor: { label: 'Select Value', category: 'layout' },\n schema: {},\n guideline:\n \"Renders the selected item's text, or placeholder when nothing is selected. Style the placeholder state via [data-fs-select-value][data-placeholder].\",\n});\n\nexport const SelectIconDefinition = defineComponent<SelectIconProps>({\n name: 'SelectIcon',\n importPath: '@vtex/faststore/components',\n component: SelectIcon,\n editor: { label: 'Select Icon', category: 'layout' },\n schema: {},\n guideline:\n 'Decorative indicator (e.g. chevron) inside the trigger. Rotates or changes when the popup opens via data-open.',\n});\n\nexport const SelectPortalDefinition = defineComponent<SelectPortalProps>({\n name: 'SelectPortal',\n importPath: '@vtex/faststore/components',\n component: SelectPortal,\n editor: { label: 'Select Portal', category: 'layout' },\n schema: {},\n guideline:\n 'Teleports popup content to <body>. Always wrap Select.Positioner with this to avoid overflow/z-index issues.',\n});\n\nexport const SelectBackdropDefinition = defineComponent<SelectBackdropProps>({\n name: 'SelectBackdrop',\n importPath: '@vtex/faststore/components',\n component: SelectBackdrop,\n editor: { label: 'Select Backdrop', category: 'layout' },\n schema: {},\n guideline:\n 'Invisible overlay that closes the select when clicked outside. Required when modal=true to trap interaction.',\n});\n\nexport const SelectPositionerDefinition = defineComponent<SelectPositionerProps>({\n name: 'SelectPositioner',\n importPath: '@vtex/faststore/components',\n component: SelectPositioner,\n editor: { label: 'Select Positioner', category: 'layout' },\n schema: {\n side: { type: ['top', 'bottom', 'left', 'right'] as const, default: 'bottom', label: 'Side' },\n align: { type: ['start', 'center', 'end'] as const, default: 'center', label: 'Align' },\n sideOffset: { type: 'number', default: 0, label: 'Side Offset' },\n alignItemWithTrigger: { type: 'boolean', default: true, label: 'Align Item With Trigger' },\n },\n guideline:\n 'Positions the popup relative to the trigger. Use side and align to control placement; alignItemWithTrigger=true overlaps the trigger to align the selected item visually.',\n});\n\nexport const SelectScrollUpArrowDefinition = defineComponent<SelectScrollUpArrowProps>({\n name: 'SelectScrollUpArrow',\n importPath: '@vtex/faststore/components',\n component: SelectScrollUpArrow,\n editor: { label: 'Select Scroll Up Arrow', category: 'layout' },\n schema: {\n keepMounted: { type: 'boolean', default: false, label: 'Keep Mounted' },\n },\n guideline: 'Scrolls the list upward when hovered. Appears automatically when the list overflows at the top.',\n});\n\nexport const SelectPopupDefinition = defineComponent<SelectPopupProps>({\n name: 'SelectPopup',\n importPath: '@vtex/faststore/components',\n component: SelectPopup,\n editor: { label: 'Select Popup', category: 'layout' },\n schema: {},\n guideline: 'Visible container for the select list. Apply background, shadow, and border styles here.',\n});\n\nexport const SelectArrowDefinition = defineComponent<SelectArrowProps>({\n name: 'SelectArrow',\n importPath: '@vtex/faststore/components',\n component: SelectArrow,\n editor: { label: 'Select Arrow', category: 'layout' },\n schema: {},\n guideline:\n 'Pointing arrow attached to the popup indicating the anchor. Optional — omit when not using an arrow indicator.',\n});\n\nexport const SelectListDefinition = defineComponent<SelectListProps>({\n name: 'SelectList',\n importPath: '@vtex/faststore/components',\n component: SelectList,\n editor: { label: 'Select List', category: 'layout' },\n schema: {},\n guideline: 'Scrollable container for all Select.Item elements. Apply max-height and overflow for scrolling.',\n});\n\nexport const SelectItemDefinition = defineComponent<SelectItemProps>({\n name: 'SelectItem',\n importPath: '@vtex/faststore/components',\n component: SelectItem,\n editor: { label: 'Select Item', category: 'layout' },\n schema: {\n value: { type: 'string', label: 'Value' },\n disabled: { type: 'boolean', default: false, label: 'Disabled' },\n },\n guideline:\n 'One selectable option. Requires a unique value prop. Style selected and highlighted states via data-selected and data-highlighted attributes.',\n});\n\nexport const SelectItemTextDefinition = defineComponent<SelectItemTextProps>({\n name: 'SelectItemText',\n importPath: '@vtex/faststore/components',\n component: SelectItemText,\n editor: { label: 'Select Item Text', category: 'layout' },\n schema: {},\n guideline: 'The visible text label of an item. Base UI uses this for keyboard navigation matching.',\n});\n\nexport const SelectItemIndicatorDefinition = defineComponent<SelectItemIndicatorProps>({\n name: 'SelectItemIndicator',\n importPath: '@vtex/faststore/components',\n component: SelectItemIndicator,\n editor: { label: 'Select Item Indicator', category: 'layout' },\n schema: {\n keepMounted: { type: 'boolean', default: false, label: 'Keep Mounted' },\n },\n guideline: 'Checkmark or indicator shown only on the selected item. Set keepMounted=true to animate in/out.',\n});\n\nexport const SelectSeparatorDefinition = defineComponent<SelectSeparatorProps>({\n name: 'SelectSeparator',\n importPath: '@vtex/faststore/components',\n component: SelectSeparator,\n editor: { label: 'Select Separator', category: 'layout' },\n schema: {},\n guideline: 'Visual divider between items or groups. Use between unrelated option groups.',\n});\n\nexport const SelectGroupDefinition = defineComponent<SelectGroupProps>({\n name: 'SelectGroup',\n importPath: '@vtex/faststore/components',\n component: SelectGroup,\n editor: { label: 'Select Group', category: 'layout' },\n schema: {},\n guideline: 'Groups related items under a shared SelectGroupLabel for semantic and visual grouping.',\n});\n\nexport const SelectGroupLabelDefinition = defineComponent<SelectGroupLabelProps>({\n name: 'SelectGroupLabel',\n importPath: '@vtex/faststore/components',\n component: SelectGroupLabel,\n editor: { label: 'Select Group Label', category: 'layout' },\n schema: {},\n guideline: 'Non-interactive label for a Select.Group. Announced by screen readers as a group name.',\n});\n\nexport const SelectScrollDownArrowDefinition = defineComponent<SelectScrollDownArrowProps>({\n name: 'SelectScrollDownArrow',\n importPath: '@vtex/faststore/components',\n component: SelectScrollDownArrow,\n editor: { label: 'Select Scroll Down Arrow', category: 'layout' },\n schema: {\n keepMounted: { type: 'boolean', default: false, label: 'Keep Mounted' },\n },\n guideline: 'Scrolls the list downward when hovered. Appears when the list overflows at the bottom.',\n});\n\nexport function SelectRoot({\n disabled = false,\n modal = true,\n required = false,\n readOnly = false,\n children,\n ...props\n}: SelectRootProps) {\n return (\n <BaseSelect.Root {...props} disabled={disabled} modal={modal} required={required} readOnly={readOnly}>\n {children}\n </BaseSelect.Root>\n );\n}\n\nexport function SelectLabel({ className, children, ...props }: SelectLabelProps) {\n return (\n <BaseSelect.Label {...props} className={className} data-fs-select-label=\"\">\n {children}\n </BaseSelect.Label>\n );\n}\n\nexport function SelectTrigger({ disabled = false, className, children, ...props }: SelectTriggerProps) {\n return (\n <BaseSelect.Trigger {...props} disabled={disabled} className={className} data-fs-select-trigger=\"\">\n {children}\n </BaseSelect.Trigger>\n );\n}\n\nexport function SelectValue({ placeholder, className, children, ...props }: SelectValueProps) {\n return (\n <BaseSelect.Value {...props} placeholder={placeholder} className={className} data-fs-select-value=\"\">\n {children}\n </BaseSelect.Value>\n );\n}\n\nexport function SelectIcon({ className, children, ...props }: SelectIconProps) {\n return (\n <BaseSelect.Icon {...props} className={className} data-fs-select-icon=\"\">\n {children}\n </BaseSelect.Icon>\n );\n}\n\nexport function SelectPortal({ children }: SelectPortalProps) {\n return <BaseSelect.Portal>{children}</BaseSelect.Portal>;\n}\n\nexport function SelectBackdrop({ className, children, ...props }: SelectBackdropProps) {\n return (\n <BaseSelect.Backdrop {...props} className={className} data-fs-select-backdrop=\"\">\n {children}\n </BaseSelect.Backdrop>\n );\n}\n\nexport function SelectPositioner({\n side = 'bottom',\n align = 'center',\n sideOffset = 0,\n alignItemWithTrigger = true,\n className,\n children,\n ...props\n}: SelectPositionerProps) {\n return (\n <BaseSelect.Positioner\n {...props}\n side={side}\n align={align}\n sideOffset={sideOffset}\n alignItemWithTrigger={alignItemWithTrigger}\n className={className}\n data-fs-select-positioner=\"\"\n >\n {children}\n </BaseSelect.Positioner>\n );\n}\n\nexport function SelectScrollUpArrow({ keepMounted = false, className, children, ...props }: SelectScrollUpArrowProps) {\n return (\n <BaseSelect.ScrollUpArrow\n {...props}\n keepMounted={keepMounted}\n className={className}\n data-fs-select-scroll-up-arrow=\"\"\n >\n {children}\n </BaseSelect.ScrollUpArrow>\n );\n}\n\nexport function SelectPopup({ className, children, ...props }: SelectPopupProps) {\n return (\n <BaseSelect.Popup {...props} className={className} data-fs-select-popup=\"\">\n {children}\n </BaseSelect.Popup>\n );\n}\n\nexport function SelectArrow({ className, children, ...props }: SelectArrowProps) {\n return (\n <BaseSelect.Arrow {...props} className={className} data-fs-select-arrow=\"\">\n {children}\n </BaseSelect.Arrow>\n );\n}\n\nexport function SelectList({ className, children, ...props }: SelectListProps) {\n return (\n <BaseSelect.List {...props} className={className} data-fs-select-list=\"\">\n {children}\n </BaseSelect.List>\n );\n}\n\nexport function SelectItem({ value, disabled = false, label, className, children, ...props }: SelectItemProps) {\n return (\n <BaseSelect.Item\n {...props}\n value={value}\n disabled={disabled}\n label={label}\n className={className}\n data-fs-select-item=\"\"\n >\n {children}\n </BaseSelect.Item>\n );\n}\n\nexport function SelectItemText({ className, children, ...props }: SelectItemTextProps) {\n return (\n <BaseSelect.ItemText {...props} className={className} data-fs-select-item-text=\"\">\n {children}\n </BaseSelect.ItemText>\n );\n}\n\nexport function SelectItemIndicator({ keepMounted = false, className, children, ...props }: SelectItemIndicatorProps) {\n return (\n <BaseSelect.ItemIndicator\n {...props}\n keepMounted={keepMounted}\n className={className}\n data-fs-select-item-indicator=\"\"\n >\n {children}\n </BaseSelect.ItemIndicator>\n );\n}\n\nexport function SelectSeparator({ className, children, ...props }: SelectSeparatorProps) {\n return (\n <BaseSelect.Separator {...props} className={className} data-fs-select-separator=\"\">\n {children}\n </BaseSelect.Separator>\n );\n}\n\nexport function SelectGroup({ className, children, ...props }: SelectGroupProps) {\n return (\n <BaseSelect.Group {...props} className={className} data-fs-select-group=\"\">\n {children}\n </BaseSelect.Group>\n );\n}\n\nexport function SelectGroupLabel({ className, children, ...props }: SelectGroupLabelProps) {\n return (\n <BaseSelect.GroupLabel {...props} className={className} data-fs-select-group-label=\"\">\n {children}\n </BaseSelect.GroupLabel>\n );\n}\n\nexport function SelectScrollDownArrow({\n keepMounted = false,\n className,\n children,\n ...props\n}: SelectScrollDownArrowProps) {\n return (\n <BaseSelect.ScrollDownArrow\n {...props}\n keepMounted={keepMounted}\n className={className}\n data-fs-select-scroll-down-arrow=\"\"\n >\n {children}\n </BaseSelect.ScrollDownArrow>\n );\n}\n\nexport const Select = {\n Root: SelectRoot,\n Label: SelectLabel,\n Trigger: SelectTrigger,\n Value: SelectValue,\n Icon: SelectIcon,\n Portal: SelectPortal,\n Backdrop: SelectBackdrop,\n Positioner: SelectPositioner,\n ScrollUpArrow: SelectScrollUpArrow,\n Popup: SelectPopup,\n Arrow: SelectArrow,\n List: SelectList,\n Item: SelectItem,\n ItemText: SelectItemText,\n ItemIndicator: SelectItemIndicator,\n Separator: SelectSeparator,\n Group: SelectGroup,\n GroupLabel: SelectGroupLabel,\n ScrollDownArrow: SelectScrollDownArrow,\n};\n"],"mappings":";;;;;;AAuFA,MAAa,uBAAuB,gBAAiC;CACnE,MAAM;CACN,YAAY;CACZ,WAAW;CACX,QAAQ;EAAE,OAAO;EAAe,UAAU;CAAS;CACnD,QAAQ;EACN,UAAU;GAAE,MAAM;GAAW,SAAS;GAAO,OAAO;EAAW;EAC/D,OAAO;GAAE,MAAM;GAAW,SAAS;GAAM,OAAO;EAAQ;EACxD,UAAU;GAAE,MAAM;GAAW,SAAS;GAAO,OAAO;EAAW;EAC/D,UAAU;GAAE,MAAM;GAAW,SAAS;GAAO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ACpB,MAAM;CACN,OAAO;CACP,SAAS;CACT,OAAO;CACP,MAAM;CACN,QAAQ;CACR,UAAU;CACV,YAAY;CACZ,eAAe;CACf,OAAO;CACP,OAAO;CACP,MAAM;CACN,MAAM;CACN,UAAU;CACV,eAAe;CACf,WAAW;CACX,OAAO;CACP,YAAY;CACZ,iBAAiB;AACnB"}
1
+ {"version":3,"file":"select.js","names":["BaseSelect","Select"],"sources":["../../../src/particles/select/select.tsx"],"sourcesContent":["'use client';\nimport { Select as BaseSelect } from '@base-ui/react/select';\nimport { defineComponent } from '@vtex/fs-core';\nimport type { ComponentPropsWithRef, ReactNode } from 'react';\n\nexport type SelectSide = 'top' | 'bottom' | 'left' | 'right';\nexport type SelectAlign = 'start' | 'center' | 'end';\n\nexport type SelectRootProps = {\n disabled?: boolean;\n modal?: boolean;\n required?: boolean;\n readOnly?: boolean;\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string | null) => void;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n name?: string;\n /** Forwarded to Base UI's hidden `<input>` — turns on browser autofill for the field. */\n autoComplete?: string;\n children?: ReactNode;\n};\n\nexport type SelectLabelProps = ComponentPropsWithRef<'div'>;\n\nexport type SelectTriggerProps = ComponentPropsWithRef<'button'> & {\n disabled?: boolean;\n};\n\nexport type SelectValueProps = Omit<ComponentPropsWithRef<'span'>, 'children'> & {\n placeholder?: string;\n /** Rendered content, or a render function receiving the current value (Base UI resolves the\n * matching item's label automatically when omitted, but only once that item has mounted at\n * least once — e.g. after the popup has been opened — so pass a render function when the\n * label must be correct before the shopper ever opens the dropdown). */\n children?: ReactNode | ((value: string | null) => ReactNode);\n};\n\nexport type SelectIconProps = ComponentPropsWithRef<'span'>;\n\nexport type SelectPortalProps = {\n children?: ReactNode;\n};\n\nexport type SelectBackdropProps = ComponentPropsWithRef<'div'>;\n\nexport type SelectPositionerProps = ComponentPropsWithRef<'div'> & {\n side?: SelectSide;\n align?: SelectAlign;\n sideOffset?: number;\n alignItemWithTrigger?: boolean;\n};\n\nexport type SelectScrollUpArrowProps = ComponentPropsWithRef<'div'> & {\n keepMounted?: boolean;\n};\n\nexport type SelectPopupProps = ComponentPropsWithRef<'div'>;\n\nexport type SelectArrowProps = ComponentPropsWithRef<'div'>;\n\nexport type SelectListProps = ComponentPropsWithRef<'div'>;\n\nexport type SelectItemProps = ComponentPropsWithRef<'div'> & {\n value?: string;\n disabled?: boolean;\n label?: string;\n};\n\nexport type SelectItemTextProps = ComponentPropsWithRef<'div'>;\n\nexport type SelectItemIndicatorProps = ComponentPropsWithRef<'span'> & {\n keepMounted?: boolean;\n};\n\nexport type SelectSeparatorProps = ComponentPropsWithRef<'div'>;\n\nexport type SelectGroupProps = ComponentPropsWithRef<'div'>;\n\nexport type SelectGroupLabelProps = ComponentPropsWithRef<'div'>;\n\nexport type SelectScrollDownArrowProps = ComponentPropsWithRef<'div'> & {\n keepMounted?: boolean;\n};\n\nexport const SelectRootDefinition = defineComponent<SelectRootProps>({\n name: 'SelectRoot',\n importPath: '@vtex/faststore/components',\n component: SelectRoot,\n editor: { label: 'Select Root', category: 'layout' },\n schema: {\n disabled: { type: 'boolean', default: false, label: 'Disabled' },\n modal: { type: 'boolean', default: true, label: 'Modal' },\n required: { type: 'boolean', default: false, label: 'Required' },\n readOnly: { type: 'boolean', default: false, label: 'Read Only' },\n },\n guideline:\n 'Root of a select dropdown. Manages selection state, modal overlay, and form integration. Compose as: SelectRoot > (SelectLabel + SelectTrigger > (SelectValue + SelectIcon) + SelectPortal > (SelectBackdrop + SelectPositioner > SelectPopup > (SelectScrollUpArrow + SelectList > [SelectItem > (SelectItemText + SelectItemIndicator)] + SelectScrollDownArrow))). Use SelectGroup > (SelectGroupLabel + [SelectItem]) for grouped options. Set modal=false to allow interacting with background elements while open.',\n});\n\nexport const SelectLabelDefinition = defineComponent<SelectLabelProps>({\n name: 'SelectLabel',\n importPath: '@vtex/faststore/components',\n component: SelectLabel,\n editor: { label: 'Select Label', category: 'layout' },\n schema: {},\n guideline:\n 'Accessible label associated with the trigger. Always place outside Select.Trigger so screen readers announce it separately.',\n});\n\nexport const SelectTriggerDefinition = defineComponent<SelectTriggerProps>({\n name: 'SelectTrigger',\n importPath: '@vtex/faststore/components',\n component: SelectTrigger,\n editor: { label: 'Select Trigger', category: 'action' },\n schema: {\n disabled: { type: 'boolean', default: false, label: 'Disabled' },\n },\n guideline:\n 'Opens and closes the popup on click. Use data-open and data-placeholder CSS attributes for open-state and empty-state styling.',\n});\n\nexport const SelectValueDefinition = defineComponent<SelectValueProps>({\n name: 'SelectValue',\n importPath: '@vtex/faststore/components',\n component: SelectValue,\n editor: { label: 'Select Value', category: 'layout' },\n schema: {},\n guideline:\n \"Renders the selected item's text, or placeholder when nothing is selected. Style the placeholder state via [data-fs-select-value][data-placeholder].\",\n});\n\nexport const SelectIconDefinition = defineComponent<SelectIconProps>({\n name: 'SelectIcon',\n importPath: '@vtex/faststore/components',\n component: SelectIcon,\n editor: { label: 'Select Icon', category: 'layout' },\n schema: {},\n guideline:\n 'Decorative indicator (e.g. chevron) inside the trigger. Rotates or changes when the popup opens via data-open.',\n});\n\nexport const SelectPortalDefinition = defineComponent<SelectPortalProps>({\n name: 'SelectPortal',\n importPath: '@vtex/faststore/components',\n component: SelectPortal,\n editor: { label: 'Select Portal', category: 'layout' },\n schema: {},\n guideline:\n 'Teleports popup content to <body>. Always wrap Select.Positioner with this to avoid overflow/z-index issues.',\n});\n\nexport const SelectBackdropDefinition = defineComponent<SelectBackdropProps>({\n name: 'SelectBackdrop',\n importPath: '@vtex/faststore/components',\n component: SelectBackdrop,\n editor: { label: 'Select Backdrop', category: 'layout' },\n schema: {},\n guideline:\n 'Invisible overlay that closes the select when clicked outside. Required when modal=true to trap interaction.',\n});\n\nexport const SelectPositionerDefinition = defineComponent<SelectPositionerProps>({\n name: 'SelectPositioner',\n importPath: '@vtex/faststore/components',\n component: SelectPositioner,\n editor: { label: 'Select Positioner', category: 'layout' },\n schema: {\n side: { type: ['top', 'bottom', 'left', 'right'] as const, default: 'bottom', label: 'Side' },\n align: { type: ['start', 'center', 'end'] as const, default: 'start', label: 'Align' },\n sideOffset: { type: 'number', default: 0, label: 'Side Offset' },\n alignItemWithTrigger: { type: 'boolean', default: false, label: 'Align Item With Trigger' },\n },\n guideline:\n 'Positions the popup relative to the trigger. Use side and align to control placement. The popup opens below the trigger by default; alignItemWithTrigger=true makes it cover the trigger to align the selected item with it.',\n});\n\nexport const SelectScrollUpArrowDefinition = defineComponent<SelectScrollUpArrowProps>({\n name: 'SelectScrollUpArrow',\n importPath: '@vtex/faststore/components',\n component: SelectScrollUpArrow,\n editor: { label: 'Select Scroll Up Arrow', category: 'layout' },\n schema: {\n keepMounted: { type: 'boolean', default: false, label: 'Keep Mounted' },\n },\n guideline: 'Scrolls the list upward when hovered. Appears automatically when the list overflows at the top.',\n});\n\nexport const SelectPopupDefinition = defineComponent<SelectPopupProps>({\n name: 'SelectPopup',\n importPath: '@vtex/faststore/components',\n component: SelectPopup,\n editor: { label: 'Select Popup', category: 'layout' },\n schema: {},\n guideline:\n 'Visible container for the select list. Apply background, shadow, and border styles here. The base stylesheet bounds it to the viewport (max-height from --available-height, as a flex column) so the list scrolls inside it; a utility class such as max-h-60 overrides that bound.',\n});\n\nexport const SelectArrowDefinition = defineComponent<SelectArrowProps>({\n name: 'SelectArrow',\n importPath: '@vtex/faststore/components',\n component: SelectArrow,\n editor: { label: 'Select Arrow', category: 'layout' },\n schema: {},\n guideline:\n 'Pointing arrow attached to the popup indicating the anchor. Optional — omit when not using an arrow indicator.',\n});\n\nexport const SelectListDefinition = defineComponent<SelectListProps>({\n name: 'SelectList',\n importPath: '@vtex/faststore/components',\n component: SelectList,\n editor: { label: 'Select List', category: 'layout' },\n schema: {},\n guideline:\n 'Scrollable container for all Select.Item elements. The base stylesheet makes it scroll (overflow-y: auto) inside the popup bound; an overflow-* utility class overrides that.',\n});\n\nexport const SelectItemDefinition = defineComponent<SelectItemProps>({\n name: 'SelectItem',\n importPath: '@vtex/faststore/components',\n component: SelectItem,\n editor: { label: 'Select Item', category: 'layout' },\n schema: {\n value: { type: 'string', label: 'Value' },\n disabled: { type: 'boolean', default: false, label: 'Disabled' },\n },\n guideline:\n 'One selectable option. Requires a unique value prop. Style selected and highlighted states via data-selected and data-highlighted attributes.',\n});\n\nexport const SelectItemTextDefinition = defineComponent<SelectItemTextProps>({\n name: 'SelectItemText',\n importPath: '@vtex/faststore/components',\n component: SelectItemText,\n editor: { label: 'Select Item Text', category: 'layout' },\n schema: {},\n guideline: 'The visible text label of an item. Base UI uses this for keyboard navigation matching.',\n});\n\nexport const SelectItemIndicatorDefinition = defineComponent<SelectItemIndicatorProps>({\n name: 'SelectItemIndicator',\n importPath: '@vtex/faststore/components',\n component: SelectItemIndicator,\n editor: { label: 'Select Item Indicator', category: 'layout' },\n schema: {\n keepMounted: { type: 'boolean', default: false, label: 'Keep Mounted' },\n },\n guideline: 'Checkmark or indicator shown only on the selected item. Set keepMounted=true to animate in/out.',\n});\n\nexport const SelectSeparatorDefinition = defineComponent<SelectSeparatorProps>({\n name: 'SelectSeparator',\n importPath: '@vtex/faststore/components',\n component: SelectSeparator,\n editor: { label: 'Select Separator', category: 'layout' },\n schema: {},\n guideline: 'Visual divider between items or groups. Use between unrelated option groups.',\n});\n\nexport const SelectGroupDefinition = defineComponent<SelectGroupProps>({\n name: 'SelectGroup',\n importPath: '@vtex/faststore/components',\n component: SelectGroup,\n editor: { label: 'Select Group', category: 'layout' },\n schema: {},\n guideline: 'Groups related items under a shared SelectGroupLabel for semantic and visual grouping.',\n});\n\nexport const SelectGroupLabelDefinition = defineComponent<SelectGroupLabelProps>({\n name: 'SelectGroupLabel',\n importPath: '@vtex/faststore/components',\n component: SelectGroupLabel,\n editor: { label: 'Select Group Label', category: 'layout' },\n schema: {},\n guideline: 'Non-interactive label for a Select.Group. Announced by screen readers as a group name.',\n});\n\nexport const SelectScrollDownArrowDefinition = defineComponent<SelectScrollDownArrowProps>({\n name: 'SelectScrollDownArrow',\n importPath: '@vtex/faststore/components',\n component: SelectScrollDownArrow,\n editor: { label: 'Select Scroll Down Arrow', category: 'layout' },\n schema: {\n keepMounted: { type: 'boolean', default: false, label: 'Keep Mounted' },\n },\n guideline: 'Scrolls the list downward when hovered. Appears when the list overflows at the bottom.',\n});\n\nexport function SelectRoot({\n disabled = false,\n modal = true,\n required = false,\n readOnly = false,\n children,\n ...props\n}: SelectRootProps) {\n return (\n <BaseSelect.Root {...props} disabled={disabled} modal={modal} required={required} readOnly={readOnly}>\n {children}\n </BaseSelect.Root>\n );\n}\n\nexport function SelectLabel({ className, children, ...props }: SelectLabelProps) {\n return (\n <BaseSelect.Label {...props} className={className} data-fs-select-label=\"\">\n {children}\n </BaseSelect.Label>\n );\n}\n\nexport function SelectTrigger({ disabled = false, className, children, ...props }: SelectTriggerProps) {\n return (\n <BaseSelect.Trigger {...props} disabled={disabled} className={className} data-fs-select-trigger=\"\">\n {children}\n </BaseSelect.Trigger>\n );\n}\n\nexport function SelectValue({ placeholder, className, children, ...props }: SelectValueProps) {\n return (\n <BaseSelect.Value {...props} placeholder={placeholder} className={className} data-fs-select-value=\"\">\n {children}\n </BaseSelect.Value>\n );\n}\n\nexport function SelectIcon({ className, children, ...props }: SelectIconProps) {\n return (\n <BaseSelect.Icon {...props} className={className} data-fs-select-icon=\"\">\n {children}\n </BaseSelect.Icon>\n );\n}\n\nexport function SelectPortal({ children }: SelectPortalProps) {\n return <BaseSelect.Portal>{children}</BaseSelect.Portal>;\n}\n\nexport function SelectBackdrop({ className, children, ...props }: SelectBackdropProps) {\n return (\n <BaseSelect.Backdrop {...props} className={className} data-fs-select-backdrop=\"\">\n {children}\n </BaseSelect.Backdrop>\n );\n}\n\nexport function SelectPositioner({\n side = 'bottom',\n align = 'start',\n sideOffset = 0,\n alignItemWithTrigger = false,\n className,\n children,\n ...props\n}: SelectPositionerProps) {\n return (\n <BaseSelect.Positioner\n {...props}\n side={side}\n align={align}\n sideOffset={sideOffset}\n alignItemWithTrigger={alignItemWithTrigger}\n className={className}\n data-fs-select-positioner=\"\"\n >\n {children}\n </BaseSelect.Positioner>\n );\n}\n\nexport function SelectScrollUpArrow({ keepMounted = false, className, children, ...props }: SelectScrollUpArrowProps) {\n return (\n <BaseSelect.ScrollUpArrow\n {...props}\n keepMounted={keepMounted}\n className={className}\n data-fs-select-scroll-up-arrow=\"\"\n >\n {children}\n </BaseSelect.ScrollUpArrow>\n );\n}\n\nexport function SelectPopup({ className, children, ...props }: SelectPopupProps) {\n return (\n <BaseSelect.Popup {...props} className={className} data-fs-select-popup=\"\">\n {children}\n </BaseSelect.Popup>\n );\n}\n\nexport function SelectArrow({ className, children, ...props }: SelectArrowProps) {\n return (\n <BaseSelect.Arrow {...props} className={className} data-fs-select-arrow=\"\">\n {children}\n </BaseSelect.Arrow>\n );\n}\n\nexport function SelectList({ className, children, ...props }: SelectListProps) {\n return (\n <BaseSelect.List {...props} className={className} data-fs-select-list=\"\">\n {children}\n </BaseSelect.List>\n );\n}\n\nexport function SelectItem({ value, disabled = false, label, className, children, ...props }: SelectItemProps) {\n return (\n <BaseSelect.Item\n {...props}\n value={value}\n disabled={disabled}\n label={label}\n className={className}\n data-fs-select-item=\"\"\n >\n {children}\n </BaseSelect.Item>\n );\n}\n\nexport function SelectItemText({ className, children, ...props }: SelectItemTextProps) {\n return (\n <BaseSelect.ItemText {...props} className={className} data-fs-select-item-text=\"\">\n {children}\n </BaseSelect.ItemText>\n );\n}\n\nexport function SelectItemIndicator({ keepMounted = false, className, children, ...props }: SelectItemIndicatorProps) {\n return (\n <BaseSelect.ItemIndicator\n {...props}\n keepMounted={keepMounted}\n className={className}\n data-fs-select-item-indicator=\"\"\n >\n {children}\n </BaseSelect.ItemIndicator>\n );\n}\n\nexport function SelectSeparator({ className, children, ...props }: SelectSeparatorProps) {\n return (\n <BaseSelect.Separator {...props} className={className} data-fs-select-separator=\"\">\n {children}\n </BaseSelect.Separator>\n );\n}\n\nexport function SelectGroup({ className, children, ...props }: SelectGroupProps) {\n return (\n <BaseSelect.Group {...props} className={className} data-fs-select-group=\"\">\n {children}\n </BaseSelect.Group>\n );\n}\n\nexport function SelectGroupLabel({ className, children, ...props }: SelectGroupLabelProps) {\n return (\n <BaseSelect.GroupLabel {...props} className={className} data-fs-select-group-label=\"\">\n {children}\n </BaseSelect.GroupLabel>\n );\n}\n\nexport function SelectScrollDownArrow({\n keepMounted = false,\n className,\n children,\n ...props\n}: SelectScrollDownArrowProps) {\n return (\n <BaseSelect.ScrollDownArrow\n {...props}\n keepMounted={keepMounted}\n className={className}\n data-fs-select-scroll-down-arrow=\"\"\n >\n {children}\n </BaseSelect.ScrollDownArrow>\n );\n}\n\nexport const Select = {\n Root: SelectRoot,\n Label: SelectLabel,\n Trigger: SelectTrigger,\n Value: SelectValue,\n Icon: SelectIcon,\n Portal: SelectPortal,\n Backdrop: SelectBackdrop,\n Positioner: SelectPositioner,\n ScrollUpArrow: SelectScrollUpArrow,\n Popup: SelectPopup,\n Arrow: SelectArrow,\n List: SelectList,\n Item: SelectItem,\n ItemText: SelectItemText,\n ItemIndicator: SelectItemIndicator,\n Separator: SelectSeparator,\n Group: SelectGroup,\n GroupLabel: SelectGroupLabel,\n ScrollDownArrow: SelectScrollDownArrow,\n};\n"],"mappings":";;;;;;AAuFA,MAAa,uBAAuB,gBAAiC;CACnE,MAAM;CACN,YAAY;CACZ,WAAW;CACX,QAAQ;EAAE,OAAO;EAAe,UAAU;CAAS;CACnD,QAAQ;EACN,UAAU;GAAE,MAAM;GAAW,SAAS;GAAO,OAAO;EAAW;EAC/D,OAAO;GAAE,MAAM;GAAW,SAAS;GAAM,OAAO;EAAQ;EACxD,UAAU;GAAE,MAAM;GAAW,SAAS;GAAO,OAAO;EAAW;EAC/D,UAAU;GAAE,MAAM;GAAW,SAAS;GAAO,OAAO;EAAY;CAClE;CACA,WACE;AACJ,CAAC;AAED,MAAa,wBAAwB,gBAAkC;CACrE,MAAM;CACN,YAAY;CACZ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Ae;CACf,OAAO;CACP,OAAO;CACP,MAAM;CACN,MAAM;CACN,UAAU;CACV,eAAe;CACf,WAAW;CACX,OAAO;CACP,YAAY;CACZ,iBAAiB;AACnB"}
@@ -1,10 +1,12 @@
1
1
  import { ComponentDefinition } from "../../core/dist/define-component.js";
2
2
  import "../../core/dist/index.js";
3
3
  import { ComponentPropsWithRef, ReactNode } from "react";
4
- import { Toast, ToastManager, ToastManager as ToastManager$1, ToastRootToastObject } from "@base-ui/react/toast";
4
+ import { Toast, ToastManager, ToastManager as ToastManager$1, ToastRootToastObject, UseToastManagerReturnValue } from "@base-ui/react/toast";
5
5
  //#region src/particles/toast/toast.d.ts
6
6
  /** The queued toast object `useToast().toasts` returns and `ToastRoot` renders. */
7
7
  export type ToastObject = ToastRootToastObject;
8
+ /** What `useOptionalToast` returns under a provider; same shape as `useToast()`. */
9
+ export type ToastManagerValue = UseToastManagerReturnValue;
8
10
  type SwipeDirection = 'up' | 'down' | 'left' | 'right';
9
11
  export type ToastProviderProps = Readonly<{
10
12
  /** Max concurrent toasts before older ones are marked limited. */
@@ -21,13 +23,17 @@ export type ToastPortalProps = Readonly<{
21
23
  }>;
22
24
  export type ToastViewportProps = ComponentPropsWithRef<'div'>;
23
25
  export type ToastRootProps = Readonly<{
24
- /** The queued toast to render, from `useToast().toasts`. */
25
- toast: ToastObject;
26
+ /** The queued toast to render. Defaults to the toast `ToastList` publishes. */
27
+ toast?: ToastObject;
26
28
  /** Directions the toast can be swiped to dismiss. @default ['down', 'right'] */
27
29
  swipeDirection?: SwipeDirection | SwipeDirection[];
28
30
  className?: string;
29
31
  children?: ReactNode;
30
32
  }>;
33
+ export type ToastListProps = Readonly<{
34
+ /** The per-toast template, rendered once per queued toast. */
35
+ children?: ReactNode;
36
+ }>;
31
37
  export type ToastTitleProps = ComponentPropsWithRef<'h2'>;
32
38
  export type ToastDescriptionProps = ComponentPropsWithRef<'p'>;
33
39
  export type ToastActionProps = ComponentPropsWithRef<'button'>;
@@ -47,21 +53,28 @@ export declare const ToastPortalDefinition: ComponentDefinition<Readonly<{
47
53
  }>>;
48
54
  export declare const ToastViewportDefinition: ComponentDefinition<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>;
49
55
  export declare const ToastRootDefinition: ComponentDefinition<Readonly<{
50
- /** The queued toast to render, from `useToast().toasts`. */
51
- toast: ToastObject;
56
+ /** The queued toast to render. Defaults to the toast `ToastList` publishes. */
57
+ toast?: ToastObject;
52
58
  /** Directions the toast can be swiped to dismiss. @default ['down', 'right'] */
53
59
  swipeDirection?: SwipeDirection | SwipeDirection[];
54
60
  className?: string;
55
61
  children?: ReactNode;
56
62
  }>>;
63
+ export declare const ToastListDefinition: ComponentDefinition<Readonly<{
64
+ /** The per-toast template, rendered once per queued toast. */
65
+ children?: ReactNode;
66
+ }>>;
57
67
  export declare const ToastTitleDefinition: ComponentDefinition<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>>;
58
68
  export declare const ToastDescriptionDefinition: ComponentDefinition<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>>;
59
69
  export declare const ToastActionDefinition: ComponentDefinition<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>>;
60
70
  export declare const ToastCloseDefinition: ComponentDefinition<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>>;
61
71
  export declare function ToastProvider({ limit, timeout, toastManager, children }: ToastProviderProps): import("react/jsx-runtime").JSX.Element;
72
+ /** The toast manager under a `ToastProvider`, or `null` without one. Never throws. */
73
+ export declare function useOptionalToast(): ToastManagerValue | null;
74
+ export declare function ToastList({ children }: ToastListProps): import("react/jsx-runtime").JSX.Element | null;
62
75
  export declare function ToastPortal({ className, children }: ToastPortalProps): import("react/jsx-runtime").JSX.Element;
63
- export declare function ToastViewport({ className, children, ...props }: ToastViewportProps): import("react/jsx-runtime").JSX.Element;
64
- export declare function ToastRoot({ toast, swipeDirection, className, children }: ToastRootProps): import("react/jsx-runtime").JSX.Element;
76
+ export declare function ToastViewport({ className, children, 'aria-label': ariaLabel, ...props }: ToastViewportProps): import("react/jsx-runtime").JSX.Element;
77
+ export declare function ToastRoot({ toast: toastProp, swipeDirection, className, children }: ToastRootProps): import("react/jsx-runtime").JSX.Element | null;
65
78
  export declare function ToastTitle({ className, children, ...props }: ToastTitleProps): import("react/jsx-runtime").JSX.Element;
66
79
  export declare function ToastDescription({ className, children, ...props }: ToastDescriptionProps): import("react/jsx-runtime").JSX.Element;
67
80
  export declare function ToastAction({ className, children, ...props }: ToastActionProps): import("react/jsx-runtime").JSX.Element;
@@ -72,6 +85,7 @@ declare const Toast$1: {
72
85
  Provider: typeof ToastProvider;
73
86
  Portal: typeof ToastPortal;
74
87
  Viewport: typeof ToastViewport;
88
+ List: typeof ToastList;
75
89
  Root: typeof ToastRoot;
76
90
  Title: typeof ToastTitle;
77
91
  Description: typeof ToastDescription;