@vtex/faststore 0.0.8 → 0.0.11

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 (568) hide show
  1. package/CHANGELOG.md +101 -0
  2. package/README.md +0 -1
  3. package/dist/actions.json +48 -1
  4. package/dist/catalog.json +1397 -1594
  5. package/dist/cli/index.d.ts +66 -28
  6. package/dist/cli/index.js +7371 -512
  7. package/dist/cli/index.js.map +1 -1
  8. package/dist/cli/server-runtime.js +41 -60
  9. package/dist/cli/server-runtime.js.map +1 -1
  10. package/dist/client.d.ts +3 -3
  11. package/dist/client.js +2 -2
  12. package/dist/components.d.ts +67 -56
  13. package/dist/components.js +64 -53
  14. package/dist/content-types.json +5886 -555
  15. package/dist/core/dist/define-component.d.ts +7 -2
  16. package/dist/core/dist/define-content-type.d.ts +50 -2
  17. package/dist/core/dist/define-content-type.js +107 -3
  18. package/dist/core/dist/define-content-type.js.map +1 -1
  19. package/dist/core/dist/index.d.ts +2 -2
  20. package/dist/docs/access-code-field.md +1 -1
  21. package/dist/docs/access-code-sign-in.md +126 -77
  22. package/dist/docs/account-address-book.md +210 -95
  23. package/dist/docs/account-entry-point.md +4 -4
  24. package/dist/docs/account-menu.md +16 -17
  25. package/dist/docs/account-saved-cards.md +306 -0
  26. package/dist/docs/alert-dialog.md +3 -1
  27. package/dist/docs/avatar.md +4 -2
  28. package/dist/docs/billing-address.md +99 -30
  29. package/dist/docs/binding-switcher.md +157 -0
  30. package/dist/docs/buy-button.md +7 -8
  31. package/dist/docs/card-entry.md +42 -29
  32. package/dist/docs/card-summary.md +185 -0
  33. package/dist/docs/cardholder-document.md +5 -3
  34. package/dist/docs/carousel.md +5 -4
  35. package/dist/docs/cart-destination.md +251 -0
  36. package/dist/docs/cart-item.md +48 -15
  37. package/dist/docs/cart-totalizer.md +8 -6
  38. package/dist/docs/cart.md +240 -39
  39. package/dist/docs/challenge-return.md +135 -0
  40. package/dist/docs/client-preferences-fieldset.md +10 -5
  41. package/dist/docs/client-preferences.md +31 -8
  42. package/dist/docs/client-profile-fieldset.md +20 -6
  43. package/dist/docs/client-profile.md +12 -3
  44. package/dist/docs/copy-text.md +9 -7
  45. package/dist/docs/document-field.md +1 -1
  46. package/dist/docs/email-field.md +2 -1
  47. package/dist/docs/email-identification.md +12 -2
  48. package/dist/docs/footer-copyright.md +4 -2
  49. package/dist/docs/footer-social.md +1 -1
  50. package/dist/docs/form.md +54 -18
  51. package/dist/docs/free-shipping-progress.md +18 -13
  52. package/dist/docs/identity-edit.md +8 -2
  53. package/dist/docs/identity-summary.md +18 -5
  54. package/dist/docs/incentives.md +2 -2
  55. package/dist/docs/installments.md +46 -32
  56. package/dist/docs/logo.md +1 -1
  57. package/dist/docs/my-account-profile.md +16 -11
  58. package/dist/docs/navigation-link.md +5 -3
  59. package/dist/docs/order-cancel.md +3 -1
  60. package/dist/docs/order-delivery-address.md +7 -5
  61. package/dist/docs/order-delivery-group.md +1 -3
  62. package/dist/docs/order-details-back.md +1 -1
  63. package/dist/docs/order-details-header.md +1 -4
  64. package/dist/docs/order-invoice-download.md +60 -0
  65. package/dist/docs/order-list-row.md +1 -1
  66. package/dist/docs/order-list-search.md +13 -20
  67. package/dist/docs/order-list-views.md +11 -17
  68. package/dist/docs/order-list.md +12 -5
  69. package/dist/docs/order-payment.md +9 -7
  70. package/dist/docs/order-placed-date.md +1 -1
  71. package/dist/docs/order-placed-payment-summary.md +28 -15
  72. package/dist/docs/order-placed.md +49 -14
  73. package/dist/docs/order-progress.md +1 -1
  74. package/dist/docs/order-status-badge.md +20 -9
  75. package/dist/docs/order-summary.md +2 -2
  76. package/dist/docs/order-tracking-link.md +58 -0
  77. package/dist/docs/payment-method-badges.md +32 -6
  78. package/dist/docs/payment-methods.md +2 -2
  79. package/dist/docs/payment.md +36 -17
  80. package/dist/docs/phone-field.md +4 -4
  81. package/dist/docs/place-order.md +84 -36
  82. package/dist/docs/postal-code-field.md +3 -1
  83. package/dist/docs/pricing.md +21 -23
  84. package/dist/docs/product-gallery.md +19 -20
  85. package/dist/docs/product-information.md +14 -10
  86. package/dist/docs/product-list.md +7 -6
  87. package/dist/docs/product-shelf.md +7 -1
  88. package/dist/docs/promotion.md +4 -2
  89. package/dist/docs/region.md +23 -15
  90. package/dist/docs/save-card.md +7 -6
  91. package/dist/docs/saved-cards.md +65 -36
  92. package/dist/docs/select.md +3 -4
  93. package/dist/docs/shipping-address.md +57 -21
  94. package/dist/docs/shipping-simulator.md +53 -15
  95. package/dist/docs/sign-in-disclosure.md +176 -0
  96. package/dist/docs/sign-in-form.md +78 -47
  97. package/dist/docs/sign-in-redirect.md +5 -3
  98. package/dist/docs/sign-in.md +173 -0
  99. package/dist/docs/toast.md +45 -16
  100. package/dist/docs/variant-selector.md +15 -11
  101. package/dist/graphql/types.d.ts +4 -14
  102. package/dist/index.d.ts +3 -2
  103. package/dist/internal/client.d.ts +4 -3
  104. package/dist/internal/client.js +5 -2
  105. package/dist/internal/server.d.ts +10 -5
  106. package/dist/internal/server.js +9 -4
  107. package/dist/matter/access-code-sign-in/access-code-sign-in.d.ts +250 -66
  108. package/dist/matter/access-code-sign-in/access-code-sign-in.js +459 -188
  109. package/dist/matter/access-code-sign-in/access-code-sign-in.js.map +1 -1
  110. package/dist/matter/account-address-book/account-address-book-delete.d.ts +78 -40
  111. package/dist/matter/account-address-book/account-address-book-delete.js +86 -50
  112. package/dist/matter/account-address-book/account-address-book-delete.js.map +1 -1
  113. package/dist/matter/account-address-book/account-address-book-deliverability.d.ts +21 -4
  114. package/dist/matter/account-address-book/account-address-book-deliverability.js +45 -17
  115. package/dist/matter/account-address-book/account-address-book-deliverability.js.map +1 -1
  116. package/dist/matter/account-address-book/account-address-book-form-parts.d.ts +74 -19
  117. package/dist/matter/account-address-book/account-address-book-form-parts.js +77 -26
  118. package/dist/matter/account-address-book/account-address-book-form-parts.js.map +1 -1
  119. package/dist/matter/account-address-book/account-address-book-profile-notice.d.ts +27 -6
  120. package/dist/matter/account-address-book/account-address-book-profile-notice.js +55 -28
  121. package/dist/matter/account-address-book/account-address-book-profile-notice.js.map +1 -1
  122. package/dist/matter/account-address-book/account-address-book.d.ts +67 -14
  123. package/dist/matter/account-address-book/account-address-book.js +74 -33
  124. package/dist/matter/account-address-book/account-address-book.js.map +1 -1
  125. package/dist/matter/account-address-book/account-address-country-switch.js +3 -3
  126. package/dist/matter/account-address-book/account-address-country-switch.js.map +1 -1
  127. package/dist/matter/account-address-book/account-address-country.d.ts +66 -20
  128. package/dist/matter/account-address-book/account-address-country.js +83 -49
  129. package/dist/matter/account-address-book/account-address-country.js.map +1 -1
  130. package/dist/matter/account-address-book/account-address-form-context.d.ts +8 -4
  131. package/dist/matter/account-address-book/account-address-form-context.js.map +1 -1
  132. package/dist/matter/account-address-book/account-address-form.d.ts +468 -45
  133. package/dist/matter/account-address-book/account-address-form.js +518 -155
  134. package/dist/matter/account-address-book/account-address-form.js.map +1 -1
  135. package/dist/matter/account-address-book/account-address-record.d.ts +27 -6
  136. package/dist/matter/account-address-book/account-address-record.js +32 -17
  137. package/dist/matter/account-address-book/account-address-record.js.map +1 -1
  138. package/dist/matter/account-menu/account-menu.d.ts +34 -17
  139. package/dist/matter/account-menu/account-menu.js +46 -54
  140. package/dist/matter/account-menu/account-menu.js.map +1 -1
  141. package/dist/matter/account-menu-identity/account-menu-identity.js +1 -1
  142. package/dist/matter/account-saved-cards/account-saved-cards.d.ts +463 -0
  143. package/dist/matter/account-saved-cards/account-saved-cards.js +1011 -0
  144. package/dist/matter/account-saved-cards/account-saved-cards.js.map +1 -0
  145. package/dist/matter/billing-address/billing-address.d.ts +156 -74
  146. package/dist/matter/billing-address/billing-address.js +227 -156
  147. package/dist/matter/billing-address/billing-address.js.map +1 -1
  148. package/dist/matter/breadcrumb/breadcrumb.d.ts +21 -3
  149. package/dist/matter/breadcrumb/breadcrumb.js +24 -9
  150. package/dist/matter/breadcrumb/breadcrumb.js.map +1 -1
  151. package/dist/matter/buy-button/buy-button.d.ts +8 -11
  152. package/dist/matter/buy-button/buy-button.js +10 -19
  153. package/dist/matter/buy-button/buy-button.js.map +1 -1
  154. package/dist/matter/card-entry/card-capture.js +12 -4
  155. package/dist/matter/card-entry/card-capture.js.map +1 -1
  156. package/dist/matter/card-entry/card-entry.d.ts +123 -32
  157. package/dist/matter/card-entry/card-entry.js +348 -221
  158. package/dist/matter/card-entry/card-entry.js.map +1 -1
  159. package/dist/matter/cart/cart-namespace.d.ts +11 -1
  160. package/dist/matter/cart/cart-namespace.js +11 -1
  161. package/dist/matter/cart/cart-namespace.js.map +1 -1
  162. package/dist/matter/cart/cart.d.ts +416 -45
  163. package/dist/matter/cart/cart.js +782 -101
  164. package/dist/matter/cart/cart.js.map +1 -1
  165. package/dist/matter/cart-destination/cart-destination.d.ts +233 -0
  166. package/dist/matter/cart-destination/cart-destination.js +703 -0
  167. package/dist/matter/cart-destination/cart-destination.js.map +1 -0
  168. package/dist/matter/cart-item/cart-item.d.ts +145 -16
  169. package/dist/matter/cart-item/cart-item.js +230 -54
  170. package/dist/matter/cart-item/cart-item.js.map +1 -1
  171. package/dist/matter/cart-item-compositions/cart-item-compositions.js +1 -1
  172. package/dist/matter/cart-item-compositions/cart-item-compositions.js.map +1 -1
  173. package/dist/matter/cart-item-customizations/cart-item-customizations.js +1 -1
  174. package/dist/matter/cart-item-customizations/cart-item-customizations.js.map +1 -1
  175. package/dist/matter/cart-item-discounts/cart-item-discounts.js +1 -1
  176. package/dist/matter/cart-item-discounts/cart-item-discounts.js.map +1 -1
  177. package/dist/matter/cart-item-seller-info/cart-item-seller-info.js +1 -1
  178. package/dist/matter/cart-item-seller-info/cart-item-seller-info.js.map +1 -1
  179. package/dist/matter/cart-item-variations/cart-item-variations.js +1 -1
  180. package/dist/matter/cart-item-variations/cart-item-variations.js.map +1 -1
  181. package/dist/matter/cart-totalizer/cart-totalizer.d.ts +43 -9
  182. package/dist/matter/cart-totalizer/cart-totalizer.js +49 -19
  183. package/dist/matter/cart-totalizer/cart-totalizer.js.map +1 -1
  184. package/dist/matter/challenge-return/challenge-return.d.ts +62 -0
  185. package/dist/matter/challenge-return/challenge-return.js +241 -0
  186. package/dist/matter/challenge-return/challenge-return.js.map +1 -0
  187. package/dist/matter/client-preferences/client-preferences-fieldset.d.ts +86 -17
  188. package/dist/matter/client-preferences/client-preferences-fieldset.js +126 -54
  189. package/dist/matter/client-preferences/client-preferences-fieldset.js.map +1 -1
  190. package/dist/matter/client-preferences/client-preferences.d.ts +50 -7
  191. package/dist/matter/client-preferences/client-preferences.js +84 -15
  192. package/dist/matter/client-preferences/client-preferences.js.map +1 -1
  193. package/dist/matter/client-profile/client-profile.d.ts +44 -9
  194. package/dist/matter/client-profile/client-profile.js +64 -24
  195. package/dist/matter/client-profile/client-profile.js.map +1 -1
  196. package/dist/matter/client-profile-form/client-profile-fieldset.d.ts +119 -22
  197. package/dist/matter/client-profile-form/client-profile-fieldset.js +161 -73
  198. package/dist/matter/client-profile-form/client-profile-fieldset.js.map +1 -1
  199. package/dist/matter/delivery-options/delivery-options-accordion.d.ts +49 -4
  200. package/dist/matter/delivery-options/delivery-options-accordion.js +67 -14
  201. package/dist/matter/delivery-options/delivery-options-accordion.js.map +1 -1
  202. package/dist/matter/delivery-options/delivery-options-controller.d.ts +69 -9
  203. package/dist/matter/delivery-options/delivery-options-controller.js +80 -14
  204. package/dist/matter/delivery-options/delivery-options-controller.js.map +1 -1
  205. package/dist/matter/delivery-options/delivery-options.d.ts +37 -2
  206. package/dist/matter/delivery-options/delivery-options.js +75 -12
  207. package/dist/matter/delivery-options/delivery-options.js.map +1 -1
  208. package/dist/matter/delivery-options/use-delivery-option-selection.d.ts +1 -0
  209. package/dist/matter/delivery-options/use-delivery-option-selection.js +1 -1
  210. package/dist/matter/delivery-options/use-delivery-option-selection.js.map +1 -1
  211. package/dist/matter/email-identification/email-identification.d.ts +25 -3
  212. package/dist/matter/email-identification/email-identification.js +49 -12
  213. package/dist/matter/email-identification/email-identification.js.map +1 -1
  214. package/dist/matter/free-shipping-progress/free-shipping-progress.d.ts +85 -10
  215. package/dist/matter/free-shipping-progress/free-shipping-progress.js +153 -53
  216. package/dist/matter/free-shipping-progress/free-shipping-progress.js.map +1 -1
  217. package/dist/matter/identity-edit/identity-edit.d.ts +52 -10
  218. package/dist/matter/identity-edit/identity-edit.js +47 -19
  219. package/dist/matter/identity-edit/identity-edit.js.map +1 -1
  220. package/dist/matter/identity-summary/identity-summary.d.ts +76 -22
  221. package/dist/matter/identity-summary/identity-summary.js +95 -45
  222. package/dist/matter/identity-summary/identity-summary.js.map +1 -1
  223. package/dist/matter/installments/installments-select.d.ts +98 -16
  224. package/dist/matter/installments/installments-select.js +156 -48
  225. package/dist/matter/installments/installments-select.js.map +1 -1
  226. package/dist/matter/installments/installments.d.ts +96 -16
  227. package/dist/matter/installments/installments.js +115 -40
  228. package/dist/matter/installments/installments.js.map +1 -1
  229. package/dist/matter/installments/use-installments-selection.d.ts +1 -0
  230. package/dist/matter/installments/use-installments-selection.js +8 -3
  231. package/dist/matter/installments/use-installments-selection.js.map +1 -1
  232. package/dist/matter/my-account-profile/my-account-profile.d.ts +358 -103
  233. package/dist/matter/my-account-profile/my-account-profile.js +370 -174
  234. package/dist/matter/my-account-profile/my-account-profile.js.map +1 -1
  235. package/dist/matter/order-cancel/order-cancel.d.ts +65 -19
  236. package/dist/matter/order-cancel/order-cancel.js +118 -51
  237. package/dist/matter/order-cancel/order-cancel.js.map +1 -1
  238. package/dist/matter/order-delivery-address/order-delivery-address.d.ts +8 -18
  239. package/dist/matter/order-delivery-address/order-delivery-address.js +14 -23
  240. package/dist/matter/order-delivery-address/order-delivery-address.js.map +1 -1
  241. package/dist/matter/order-delivery-group/order-delivery-group.d.ts +40 -24
  242. package/dist/matter/order-delivery-group/order-delivery-group.js +64 -74
  243. package/dist/matter/order-delivery-group/order-delivery-group.js.map +1 -1
  244. package/dist/matter/order-details-header/order-details-header.d.ts +32 -15
  245. package/dist/matter/order-details-header/order-details-header.js +66 -58
  246. package/dist/matter/order-details-header/order-details-header.js.map +1 -1
  247. package/dist/matter/order-invoice-download/order-invoice-download.d.ts +78 -0
  248. package/dist/matter/order-invoice-download/order-invoice-download.js +173 -0
  249. package/dist/matter/order-invoice-download/order-invoice-download.js.map +1 -0
  250. package/dist/matter/order-list/order-list.d.ts +164 -19
  251. package/dist/matter/order-list/order-list.js +229 -87
  252. package/dist/matter/order-list/order-list.js.map +1 -1
  253. package/dist/matter/order-list-row/order-list-row.d.ts +6 -1
  254. package/dist/matter/order-list-row/order-list-row.js +3 -2
  255. package/dist/matter/order-list-row/order-list-row.js.map +1 -1
  256. package/dist/matter/order-list-search/order-list-search.d.ts +18 -26
  257. package/dist/matter/order-list-search/order-list-search.js +30 -69
  258. package/dist/matter/order-list-search/order-list-search.js.map +1 -1
  259. package/dist/matter/order-list-views/order-list-views.d.ts +15 -22
  260. package/dist/matter/order-list-views/order-list-views.js +22 -68
  261. package/dist/matter/order-list-views/order-list-views.js.map +1 -1
  262. package/dist/matter/order-payment/order-payment.d.ts +33 -10
  263. package/dist/matter/order-payment/order-payment.js +44 -39
  264. package/dist/matter/order-payment/order-payment.js.map +1 -1
  265. package/dist/matter/order-placed/order-placed-deliveries.d.ts +144 -12
  266. package/dist/matter/order-placed/order-placed-deliveries.js +115 -40
  267. package/dist/matter/order-placed/order-placed-deliveries.js.map +1 -1
  268. package/dist/matter/order-placed/order-placed.d.ts +198 -31
  269. package/dist/matter/order-placed/order-placed.js +230 -139
  270. package/dist/matter/order-placed/order-placed.js.map +1 -1
  271. package/dist/matter/order-placed-date/order-placed-date.d.ts +5 -8
  272. package/dist/matter/order-placed-date/order-placed-date.js +7 -8
  273. package/dist/matter/order-placed-date/order-placed-date.js.map +1 -1
  274. package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.d.ts +90 -17
  275. package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.js +93 -117
  276. package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.js.map +1 -1
  277. package/dist/matter/order-progress/order-progress.d.ts +19 -8
  278. package/dist/matter/order-progress/order-progress.js +37 -45
  279. package/dist/matter/order-progress/order-progress.js.map +1 -1
  280. package/dist/matter/order-summary/order-summary.d.ts +19 -9
  281. package/dist/matter/order-summary/order-summary.js +38 -44
  282. package/dist/matter/order-summary/order-summary.js.map +1 -1
  283. package/dist/matter/order-tracking-link/order-tracking-link.d.ts +43 -0
  284. package/dist/matter/order-tracking-link/order-tracking-link.js +107 -0
  285. package/dist/matter/order-tracking-link/order-tracking-link.js.map +1 -0
  286. package/dist/matter/payment/payment-card-capture.js +17 -10
  287. package/dist/matter/payment/payment-card-capture.js.map +1 -1
  288. package/dist/matter/payment/payment-controller.d.ts +4 -2
  289. package/dist/matter/payment/payment-controller.js +30 -9
  290. package/dist/matter/payment/payment-controller.js.map +1 -1
  291. package/dist/matter/payment/payment-method-badges.js +1 -1
  292. package/dist/matter/payment/payment.d.ts +69 -19
  293. package/dist/matter/payment/payment.js +101 -35
  294. package/dist/matter/payment/payment.js.map +1 -1
  295. package/dist/matter/payment/use-payment-method-selection.d.ts +25 -4
  296. package/dist/matter/payment/use-payment-method-selection.js +94 -32
  297. package/dist/matter/payment/use-payment-method-selection.js.map +1 -1
  298. package/dist/matter/payment/use-payment-submit-gate.d.ts +14 -3
  299. package/dist/matter/payment/use-payment-submit-gate.js +47 -8
  300. package/dist/matter/payment/use-payment-submit-gate.js.map +1 -1
  301. package/dist/matter/place-order/place-order.d.ts +171 -57
  302. package/dist/matter/place-order/place-order.js +376 -185
  303. package/dist/matter/place-order/place-order.js.map +1 -1
  304. package/dist/matter/pricing/pricing.d.ts +152 -13
  305. package/dist/matter/pricing/pricing.js +153 -52
  306. package/dist/matter/pricing/pricing.js.map +1 -1
  307. package/dist/matter/product-information/product-information.d.ts +27 -4
  308. package/dist/matter/product-information/product-information.js +32 -15
  309. package/dist/matter/product-information/product-information.js.map +1 -1
  310. package/dist/matter/product-list/product-list.d.ts +24 -6
  311. package/dist/matter/product-list/product-list.js +32 -26
  312. package/dist/matter/product-list/product-list.js.map +1 -1
  313. package/dist/matter/product-shelf/product-shelf.d.ts +8 -3
  314. package/dist/matter/product-shelf/product-shelf.js +111 -10
  315. package/dist/matter/product-shelf/product-shelf.js.map +1 -1
  316. package/dist/matter/region/region.d.ts +33 -16
  317. package/dist/matter/region/region.js +59 -52
  318. package/dist/matter/region/region.js.map +1 -1
  319. package/dist/matter/save-card/save-card.d.ts +43 -8
  320. package/dist/matter/save-card/save-card.js +61 -23
  321. package/dist/matter/save-card/save-card.js.map +1 -1
  322. package/dist/matter/saved-cards/saved-cards.d.ts +113 -21
  323. package/dist/matter/saved-cards/saved-cards.js +349 -77
  324. package/dist/matter/saved-cards/saved-cards.js.map +1 -1
  325. package/dist/matter/shipping-address/address-payload.js +25 -0
  326. package/dist/matter/shipping-address/address-payload.js.map +1 -0
  327. package/dist/matter/shipping-address/country-descriptors.js +71 -71
  328. package/dist/matter/shipping-address/country-descriptors.js.map +1 -1
  329. package/dist/matter/shipping-address/library-country-descriptors.js +136 -0
  330. package/dist/matter/shipping-address/library-country-descriptors.js.map +1 -0
  331. package/dist/matter/shipping-address/shipping-address.d.ts +312 -45
  332. package/dist/matter/shipping-address/shipping-address.js +443 -188
  333. package/dist/matter/shipping-address/shipping-address.js.map +1 -1
  334. package/dist/matter/shipping-simulator/shipping-simulator.d.ts +251 -25
  335. package/dist/matter/shipping-simulator/shipping-simulator.js +261 -51
  336. package/dist/matter/shipping-simulator/shipping-simulator.js.map +1 -1
  337. package/dist/matter/sign-in/sign-in.d.ts +108 -0
  338. package/dist/matter/sign-in/sign-in.js +285 -0
  339. package/dist/matter/sign-in/sign-in.js.map +1 -0
  340. package/dist/matter/sign-in-disclosure/sign-in-disclosure.d.ts +81 -0
  341. package/dist/matter/sign-in-disclosure/sign-in-disclosure.js +232 -0
  342. package/dist/matter/sign-in-disclosure/sign-in-disclosure.js.map +1 -0
  343. package/dist/matter/sign-in-form/sign-in-form.d.ts +93 -62
  344. package/dist/matter/sign-in-form/sign-in-form.js +134 -144
  345. package/dist/matter/sign-in-form/sign-in-form.js.map +1 -1
  346. package/dist/particles/binding-switcher/binding-switcher.d.ts +59 -0
  347. package/dist/particles/binding-switcher/binding-switcher.js +194 -0
  348. package/dist/particles/binding-switcher/binding-switcher.js.map +1 -0
  349. package/dist/particles/card-summary/card-network.d.ts +17 -0
  350. package/dist/particles/card-summary/card-network.js +25 -0
  351. package/dist/particles/card-summary/card-network.js.map +1 -0
  352. package/dist/particles/card-summary/card-summary.d.ts +113 -0
  353. package/dist/particles/card-summary/card-summary.js +221 -0
  354. package/dist/particles/card-summary/card-summary.js.map +1 -0
  355. package/dist/particles/carousel/carousel.d.ts +99 -11
  356. package/dist/particles/carousel/carousel.js +103 -35
  357. package/dist/particles/carousel/carousel.js.map +1 -1
  358. package/dist/particles/copy-text/copy-text.js +5 -15
  359. package/dist/particles/copy-text/copy-text.js.map +1 -1
  360. package/dist/particles/dialog/dialog.d.ts +14 -6
  361. package/dist/particles/dialog/dialog.js +6 -3
  362. package/dist/particles/dialog/dialog.js.map +1 -1
  363. package/dist/particles/drawer/drawer.js +1 -1
  364. package/dist/particles/drawer/drawer.js.map +1 -1
  365. package/dist/particles/email-field/email-field.d.ts +2 -1
  366. package/dist/particles/email-field/email-field.js +2 -1
  367. package/dist/particles/email-field/email-field.js.map +1 -1
  368. package/dist/particles/footer-link-group/footer-link-group.js +1 -0
  369. package/dist/particles/footer-link-group/footer-link-group.js.map +1 -1
  370. package/dist/particles/footer-social/footer-social.d.ts +1 -1
  371. package/dist/particles/footer-social/footer-social.js +1 -1
  372. package/dist/particles/footer-social/footer-social.js.map +1 -1
  373. package/dist/particles/form/form.d.ts +85 -13
  374. package/dist/particles/form/form.js +91 -42
  375. package/dist/particles/form/form.js.map +1 -1
  376. package/dist/particles/gallery/gallery.d.ts +129 -12
  377. package/dist/particles/gallery/gallery.js +121 -34
  378. package/dist/particles/gallery/gallery.js.map +1 -1
  379. package/dist/particles/incentives/incentives.d.ts +1 -1
  380. package/dist/particles/incentives/incentives.js +1 -1
  381. package/dist/particles/incentives/incentives.js.map +1 -1
  382. package/dist/particles/order-details-back/order-details-back.d.ts +5 -3
  383. package/dist/particles/order-details-back/order-details-back.js +8 -10
  384. package/dist/particles/order-details-back/order-details-back.js.map +1 -1
  385. package/dist/particles/order-status-badge/order-status-badge.d.ts +3 -3
  386. package/dist/particles/order-status-badge/order-status-badge.js +4 -20
  387. package/dist/particles/order-status-badge/order-status-badge.js.map +1 -1
  388. package/dist/particles/password-field/password-field.d.ts +1 -1
  389. package/dist/particles/password-field/password-field.js +2 -4
  390. package/dist/particles/password-field/password-field.js.map +1 -1
  391. package/dist/particles/payment-methods/payment-methods.d.ts +1 -1
  392. package/dist/particles/payment-methods/payment-methods.js +1 -1
  393. package/dist/particles/payment-methods/payment-methods.js.map +1 -1
  394. package/dist/particles/phone-field/phone-field.d.ts +4 -4
  395. package/dist/particles/phone-field/phone-field.js +8 -11
  396. package/dist/particles/phone-field/phone-field.js.map +1 -1
  397. package/dist/particles/spinner/spinner.d.ts +24 -4
  398. package/dist/particles/spinner/spinner.js +25 -9
  399. package/dist/particles/spinner/spinner.js.map +1 -1
  400. package/dist/particles/switch/switch.d.ts +4 -1
  401. package/dist/particles/switch/switch.js +3 -1
  402. package/dist/particles/switch/switch.js.map +1 -1
  403. package/dist/particles/toast/toast.d.ts +49 -9
  404. package/dist/particles/toast/toast.js +81 -15
  405. package/dist/particles/toast/toast.js.map +1 -1
  406. package/dist/schema.graphql +461 -89
  407. package/dist/sdk/actions/index.d.ts +3 -1
  408. package/dist/sdk/actions/index.js +3 -1
  409. package/dist/sdk/actions/locale-action-provider.d.ts +16 -0
  410. package/dist/sdk/actions/locale-action-provider.js +20 -0
  411. package/dist/sdk/actions/locale-action-provider.js.map +1 -0
  412. package/dist/sdk/actions/saved-card-action-provider.d.ts +12 -0
  413. package/dist/sdk/actions/saved-card-action-provider.js +16 -0
  414. package/dist/sdk/actions/saved-card-action-provider.js.map +1 -0
  415. package/dist/sdk/actions/types.d.ts +6 -2
  416. package/dist/sdk/address/address-fields.js +4 -4
  417. package/dist/sdk/address/address-fields.js.map +1 -1
  418. package/dist/sdk/address/constants.js +1 -6
  419. package/dist/sdk/address/constants.js.map +1 -1
  420. package/dist/sdk/address/messages.js +44 -44
  421. package/dist/sdk/address/messages.js.map +1 -1
  422. package/dist/sdk/address/postal-code.js +15 -2
  423. package/dist/sdk/address/postal-code.js.map +1 -1
  424. package/dist/sdk/address/types.d.ts +5 -3
  425. package/dist/sdk/address/validate-address.js +3 -3
  426. package/dist/sdk/address/validate-address.js.map +1 -1
  427. package/dist/sdk/analytics/use-analytics-actions.d.ts +1 -1
  428. package/dist/sdk/analytics/use-analytics-actions.js.map +1 -1
  429. package/dist/sdk/cache/storefront-cache.js +2 -1
  430. package/dist/sdk/cache/storefront-cache.js.map +1 -1
  431. package/dist/sdk/cart/operations.d.ts +2 -1
  432. package/dist/sdk/cart/operations.js +55 -1
  433. package/dist/sdk/cart/operations.js.map +1 -1
  434. package/dist/sdk/cart/optimistic.d.ts +30 -7
  435. package/dist/sdk/cart/optimistic.js +78 -41
  436. package/dist/sdk/cart/optimistic.js.map +1 -1
  437. package/dist/sdk/cart/use-cart-actions.d.ts +7 -0
  438. package/dist/sdk/cart/use-cart-actions.js +61 -15
  439. package/dist/sdk/cart/use-cart-actions.js.map +1 -1
  440. package/dist/sdk/cart/use-cart-sync-sales-channel.js +70 -0
  441. package/dist/sdk/cart/use-cart-sync-sales-channel.js.map +1 -0
  442. package/dist/sdk/data/index.js +2 -2
  443. package/dist/sdk/data/reactive-list-item-data-provider.js +2 -2
  444. package/dist/sdk/generated/gql.js +16 -12
  445. package/dist/sdk/generated/gql.js.map +1 -1
  446. package/dist/sdk/generated/graphql.d.ts +197 -51
  447. package/dist/sdk/generated/graphql.js +2318 -91
  448. package/dist/sdk/generated/graphql.js.map +1 -1
  449. package/dist/sdk/i18n/format-error-code.js +23 -0
  450. package/dist/sdk/i18n/format-error-code.js.map +1 -0
  451. package/dist/sdk/i18n/message-formatter.d.ts +22 -0
  452. package/dist/sdk/i18n/message-formatter.js +140 -0
  453. package/dist/sdk/i18n/message-formatter.js.map +1 -0
  454. package/dist/sdk/i18n/use-message-formatter.d.ts +8 -0
  455. package/dist/sdk/i18n/use-message-formatter.js +18 -0
  456. package/dist/sdk/i18n/use-message-formatter.js.map +1 -0
  457. package/dist/sdk/identity/use-identity-actions.js.map +1 -1
  458. package/dist/sdk/locale/binding-switch-provider.d.ts +13 -0
  459. package/dist/sdk/locale/binding-switch-provider.js +20 -0
  460. package/dist/sdk/locale/binding-switch-provider.js.map +1 -0
  461. package/dist/sdk/locale/use-locale-actions.d.ts +16 -0
  462. package/dist/sdk/locale/use-locale-actions.js +70 -0
  463. package/dist/sdk/locale/use-locale-actions.js.map +1 -0
  464. package/dist/sdk/navigation/binding-switch.d.ts +39 -0
  465. package/dist/sdk/navigation/binding-switch.js +129 -0
  466. package/dist/sdk/navigation/binding-switch.js.map +1 -0
  467. package/dist/sdk/navigation/decode-route-params.d.ts +11 -0
  468. package/dist/sdk/navigation/decode-route-params.js +32 -0
  469. package/dist/sdk/navigation/decode-route-params.js.map +1 -0
  470. package/dist/sdk/navigation/redirect.d.ts +2 -0
  471. package/dist/sdk/navigation/redirect.js +19 -1
  472. package/dist/sdk/navigation/redirect.js.map +1 -1
  473. package/dist/sdk/navigation/types.d.ts +13 -0
  474. package/dist/sdk/payment/bin-format.js +20 -0
  475. package/dist/sdk/payment/bin-format.js.map +1 -0
  476. package/dist/sdk/payment/challenge-return.js +37 -0
  477. package/dist/sdk/payment/challenge-return.js.map +1 -0
  478. package/dist/sdk/payment/confirmation-last-four.js +39 -0
  479. package/dist/sdk/payment/confirmation-last-four.js.map +1 -0
  480. package/dist/sdk/payment/gateway.d.ts +1 -1
  481. package/dist/sdk/payment/gateway.js +8 -2
  482. package/dist/sdk/payment/gateway.js.map +1 -1
  483. package/dist/sdk/payment/operations.d.ts +1 -0
  484. package/dist/sdk/payment/operations.js +28 -6
  485. package/dist/sdk/payment/operations.js.map +1 -1
  486. package/dist/sdk/payment/resumed-purchase.d.ts +1 -0
  487. package/dist/sdk/payment/resumed-purchase.js +119 -0
  488. package/dist/sdk/payment/resumed-purchase.js.map +1 -0
  489. package/dist/sdk/payment/security-code-mask.js +16 -23
  490. package/dist/sdk/payment/security-code-mask.js.map +1 -1
  491. package/dist/sdk/payment/submission-registry.js +6 -2
  492. package/dist/sdk/payment/submission-registry.js.map +1 -1
  493. package/dist/sdk/payment/use-payment-actions.d.ts +18 -3
  494. package/dist/sdk/payment/use-payment-actions.js +23 -3
  495. package/dist/sdk/payment/use-payment-actions.js.map +1 -1
  496. package/dist/sdk/payment/use-place-order.d.ts +10 -2
  497. package/dist/sdk/payment/use-place-order.js +138 -76
  498. package/dist/sdk/payment/use-place-order.js.map +1 -1
  499. package/dist/sdk/provider/storefront-provider.d.ts +1 -7
  500. package/dist/sdk/provider/storefront-provider.js +4 -11
  501. package/dist/sdk/provider/storefront-provider.js.map +1 -1
  502. package/dist/sdk/saved-cards/operations.d.ts +16 -0
  503. package/dist/sdk/saved-cards/operations.js +41 -0
  504. package/dist/sdk/saved-cards/operations.js.map +1 -0
  505. package/dist/sdk/saved-cards/use-saved-card-actions.d.ts +26 -0
  506. package/dist/sdk/saved-cards/use-saved-card-actions.js +86 -0
  507. package/dist/sdk/saved-cards/use-saved-card-actions.js.map +1 -0
  508. package/dist/sdk/seo/entity-landing.d.ts +24 -0
  509. package/dist/sdk/seo/entity-landing.js +30 -0
  510. package/dist/sdk/seo/entity-landing.js.map +1 -0
  511. package/dist/sdk/seo/page-alternates.d.ts +8 -5
  512. package/dist/sdk/seo/page-alternates.js +11 -14
  513. package/dist/sdk/seo/page-alternates.js.map +1 -1
  514. package/dist/sdk/seo/search-landing.d.ts +42 -0
  515. package/dist/sdk/seo/search-landing.js +85 -0
  516. package/dist/sdk/seo/search-landing.js.map +1 -0
  517. package/dist/sdk/session/mock-session.d.ts +9 -0
  518. package/dist/sdk/session/mock-session.js +31 -0
  519. package/dist/sdk/session/mock-session.js.map +1 -0
  520. package/dist/sdk/session/read-server-session.d.ts +3 -0
  521. package/dist/sdk/session/read-server-session.js +5 -0
  522. package/dist/sdk/session/read-server-session.js.map +1 -1
  523. package/dist/sdk/session/return-path-segment.d.ts +10 -0
  524. package/dist/sdk/session/return-path-segment.js +15 -0
  525. package/dist/sdk/session/return-path-segment.js.map +1 -0
  526. package/dist/sdk/session/use-session-actions.js.map +1 -1
  527. package/dist/sdk/shipping/shipping-operations.d.ts +1 -1
  528. package/dist/sdk/shipping/shipping-operations.js +13 -0
  529. package/dist/sdk/shipping/shipping-operations.js.map +1 -1
  530. package/dist/sdk/shipping/use-cart-shipping-simulation.js.map +1 -1
  531. package/dist/sdk/shipping/use-shipping-actions.js.map +1 -1
  532. package/dist/sdk/shipping/use-shipping-simulation.js.map +1 -1
  533. package/dist/sdk/state/cart.d.ts +9 -2
  534. package/dist/sdk/state/cart.js +9 -2
  535. package/dist/sdk/state/cart.js.map +1 -1
  536. package/dist/utils/safe-href.d.ts +2 -0
  537. package/package.json +4 -3
  538. package/skills/storefront-asset/SKILL.md +2 -2
  539. package/skills/storefront-asset/references/api-side.md +27 -14
  540. package/skills/storefront-asset/references/findings.md +5 -2
  541. package/src/styles/tailwind.css +9 -2
  542. package/dist/matter/shipping-address/country-descriptors.d.ts +0 -1
  543. package/dist/message-locales.json +0 -7
  544. package/dist/sdk/i18n/client.d.ts +0 -4
  545. package/dist/sdk/i18n/client.js +0 -4
  546. package/dist/sdk/i18n/locales.d.ts +0 -8
  547. package/dist/sdk/i18n/locales.js +0 -57
  548. package/dist/sdk/i18n/locales.js.map +0 -1
  549. package/dist/sdk/i18n/messages/en-US.js +0 -164
  550. package/dist/sdk/i18n/messages/en-US.js.map +0 -1
  551. package/dist/sdk/i18n/messages/en-US.json +0 -159
  552. package/dist/sdk/i18n/messages/en-US.json.d.ts +0 -163
  553. package/dist/sdk/i18n/messages/es-ES.js +0 -164
  554. package/dist/sdk/i18n/messages/es-ES.js.map +0 -1
  555. package/dist/sdk/i18n/messages/es-ES.json +0 -159
  556. package/dist/sdk/i18n/messages/pt-BR.js +0 -164
  557. package/dist/sdk/i18n/messages/pt-BR.js.map +0 -1
  558. package/dist/sdk/i18n/messages/pt-BR.json +0 -159
  559. package/dist/sdk/i18n/provider.d.ts +0 -1
  560. package/dist/sdk/i18n/provider.js +0 -30
  561. package/dist/sdk/i18n/provider.js.map +0 -1
  562. package/dist/sdk/i18n/server.d.ts +0 -28
  563. package/dist/sdk/i18n/server.js +0 -59
  564. package/dist/sdk/i18n/server.js.map +0 -1
  565. package/dist/utils/resolve-authored-copy.js +0 -18
  566. package/dist/utils/resolve-authored-copy.js.map +0 -1
  567. package/dist/utils/substitute-template.js +0 -33
  568. package/dist/utils/substitute-template.js.map +0 -1
@@ -1,6 +1,7 @@
1
1
  import { ComponentDefinition } from "../../core/dist/define-component.js";
2
2
  import "../../core/dist/index.js";
3
- import { ComponentPropsWithRef, ReactNode } from "react";
3
+ import { ComponentProps, ComponentPropsWithRef, ReactNode } from "react";
4
+ import { Dialog } from "@base-ui/react/dialog";
4
5
  //#region src/particles/dialog/dialog.d.ts
5
6
  export type DialogRootProps = {
6
7
  open?: boolean;
@@ -12,9 +13,11 @@ export type DialogRootProps = {
12
13
  children?: ReactNode;
13
14
  };
14
15
  export type DialogTriggerProps = ComponentPropsWithRef<'button'>;
15
- export type DialogPortalProps = {
16
+ export type DialogPortalProps = Readonly<{
16
17
  children?: ReactNode;
17
- };
18
+ /** Parent element for the overlay. Omit it and the overlay renders on `document.body`. */
19
+ container?: ComponentProps<typeof Dialog.Portal>['container'];
20
+ }>;
18
21
  export type DialogBackdropProps = ComponentPropsWithRef<'div'>;
19
22
  export type DialogViewportProps = ComponentPropsWithRef<'div'>;
20
23
  export type DialogPopupProps = ComponentPropsWithRef<'div'>;
@@ -23,7 +26,11 @@ export type DialogDescriptionProps = ComponentPropsWithRef<'p'>;
23
26
  export type DialogCloseProps = ComponentPropsWithRef<'button'>;
24
27
  export declare const DialogRootDefinition: ComponentDefinition<DialogRootProps>;
25
28
  export declare const DialogTriggerDefinition: ComponentDefinition<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>>;
26
- export declare const DialogPortalDefinition: ComponentDefinition<DialogPortalProps>;
29
+ export declare const DialogPortalDefinition: ComponentDefinition<Readonly<{
30
+ children?: ReactNode;
31
+ /** Parent element for the overlay. Omit it and the overlay renders on `document.body`. */
32
+ container?: ComponentProps<typeof Dialog.Portal>["container"];
33
+ }>>;
27
34
  export declare const DialogBackdropDefinition: ComponentDefinition<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>;
28
35
  export declare const DialogViewportDefinition: ComponentDefinition<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>;
29
36
  export declare const DialogPopupDefinition: ComponentDefinition<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>;
@@ -32,14 +39,14 @@ export declare const DialogDescriptionDefinition: ComponentDefinition<import("re
32
39
  export declare const DialogCloseDefinition: ComponentDefinition<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>>;
33
40
  export declare function DialogRoot({ open, defaultOpen, modal, onOpenChange, children }: DialogRootProps): import("react/jsx-runtime").JSX.Element;
34
41
  export declare function DialogTrigger({ className, children, ...props }: DialogTriggerProps): import("react/jsx-runtime").JSX.Element;
35
- export declare function DialogPortal({ children }: DialogPortalProps): import("react/jsx-runtime").JSX.Element;
42
+ export declare function DialogPortal({ children, container }: DialogPortalProps): import("react/jsx-runtime").JSX.Element;
36
43
  export declare function DialogBackdrop({ className, children, ...props }: DialogBackdropProps): import("react/jsx-runtime").JSX.Element;
37
44
  export declare function DialogViewport({ className, children, ...props }: DialogViewportProps): import("react/jsx-runtime").JSX.Element;
38
45
  export declare function DialogPopup({ className, children, ...props }: DialogPopupProps): import("react/jsx-runtime").JSX.Element;
39
46
  export declare function DialogTitle({ className, children, ...props }: DialogTitleProps): import("react/jsx-runtime").JSX.Element;
40
47
  export declare function DialogDescription({ className, children, ...props }: DialogDescriptionProps): import("react/jsx-runtime").JSX.Element;
41
48
  export declare function DialogClose({ className, children, ...props }: DialogCloseProps): import("react/jsx-runtime").JSX.Element;
42
- export declare const Dialog: {
49
+ declare const Dialog$1: {
43
50
  Root: typeof DialogRoot;
44
51
  Trigger: typeof DialogTrigger;
45
52
  Portal: typeof DialogPortal;
@@ -51,4 +58,5 @@ export declare const Dialog: {
51
58
  Close: typeof DialogClose;
52
59
  };
53
60
  //#endregion
61
+ export { Dialog$1 as Dialog };
54
62
  //# sourceMappingURL=dialog.d.ts.map
@@ -39,7 +39,7 @@ const DialogPortalDefinition = defineComponent({
39
39
  category: "layout"
40
40
  },
41
41
  schema: {},
42
- guideline: "Renders its children outside the DOM tree (into document.body). Place DialogBackdrop and DialogViewport as direct children, in that order."
42
+ guideline: "Renders its children outside the DOM tree (into document.body, or into container when a parent swatch must reach the overlay). Place DialogBackdrop and DialogViewport as direct children, in that order."
43
43
  });
44
44
  const DialogBackdropDefinition = defineComponent({
45
45
  name: "DialogBackdrop",
@@ -124,8 +124,11 @@ function DialogTrigger({ className, children, ...props }) {
124
124
  children
125
125
  });
126
126
  }
127
- function DialogPortal({ children }) {
128
- return /* @__PURE__ */ jsx(Dialog.Portal, { children });
127
+ function DialogPortal({ children, container }) {
128
+ return /* @__PURE__ */ jsx(Dialog.Portal, {
129
+ container,
130
+ children
131
+ });
129
132
  }
130
133
  function DialogBackdrop({ className, children, ...props }) {
131
134
  return /* @__PURE__ */ jsx(Dialog.Backdrop, {
@@ -1 +1 @@
1
- {"version":3,"file":"dialog.js","names":["BaseDialog","Dialog"],"sources":["../../../src/particles/dialog/dialog.tsx"],"sourcesContent":["'use client';\nimport { Dialog as BaseDialog } from '@base-ui/react/dialog';\nimport { defineComponent } from '@vtex/fs-core';\nimport type { ComponentPropsWithRef, ReactNode } from 'react';\n\nexport type DialogRootProps = {\n open?: boolean;\n defaultOpen?: boolean;\n modal?: boolean;\n onOpenChange?: (open: boolean, eventDetails: { isCanceled: boolean }) => void;\n children?: ReactNode;\n};\n\nexport type DialogTriggerProps = ComponentPropsWithRef<'button'>;\n\nexport type DialogPortalProps = {\n children?: ReactNode;\n};\n\nexport type DialogBackdropProps = ComponentPropsWithRef<'div'>;\n\nexport type DialogViewportProps = ComponentPropsWithRef<'div'>;\n\nexport type DialogPopupProps = ComponentPropsWithRef<'div'>;\n\nexport type DialogTitleProps = ComponentPropsWithRef<'h2'>;\n\nexport type DialogDescriptionProps = ComponentPropsWithRef<'p'>;\n\nexport type DialogCloseProps = ComponentPropsWithRef<'button'>;\n\nexport const DialogRootDefinition = defineComponent<DialogRootProps>({\n name: 'DialogRoot',\n importPath: '@vtex/faststore/components',\n component: DialogRoot,\n editor: { label: 'Dialog Root', category: 'layout' },\n schema: {\n modal: { type: 'boolean', default: true, label: 'Modal' },\n },\n guideline:\n 'Root of a dialog overlay. Compose as: DialogRoot > (DialogTrigger + DialogPortal > (DialogBackdrop + DialogViewport > DialogPopup > (DialogTitle + content + DialogClose))). Set modal=false only when the dialog must coexist with page interactions.',\n});\n\nexport const DialogTriggerDefinition = defineComponent<DialogTriggerProps>({\n name: 'DialogTrigger',\n importPath: '@vtex/faststore/components',\n component: DialogTrigger,\n editor: { label: 'Dialog Trigger', category: 'action' },\n schema: {},\n guideline:\n 'Opens the dialog when clicked. Direct child of DialogRoot. Accepts any children (text, Icon). Base UI connects it to DialogRoot via context — no explicit wiring needed.',\n});\n\nexport const DialogPortalDefinition = defineComponent<DialogPortalProps>({\n name: 'DialogPortal',\n importPath: '@vtex/faststore/components',\n component: DialogPortal,\n editor: { label: 'Dialog Portal', category: 'layout' },\n schema: {},\n guideline:\n 'Renders its children outside the DOM tree (into document.body). Place DialogBackdrop and DialogViewport as direct children, in that order.',\n});\n\nexport const DialogBackdropDefinition = defineComponent<DialogBackdropProps>({\n name: 'DialogBackdrop',\n importPath: '@vtex/faststore/components',\n component: DialogBackdrop,\n editor: { label: 'Dialog Backdrop', category: 'layout' },\n schema: {},\n guideline:\n 'Semi-transparent overlay behind the popup. Direct child of DialogPortal, before DialogViewport. Clicking it closes the dialog unless disablePointerDismissal is set on DialogRoot.',\n});\n\nexport const DialogViewportDefinition = defineComponent<DialogViewportProps>({\n name: 'DialogViewport',\n importPath: '@vtex/faststore/components',\n component: DialogViewport,\n editor: { label: 'Dialog Viewport', category: 'layout' },\n schema: {},\n guideline:\n 'Positioning container for DialogPopup. Direct child of DialogPortal, after DialogBackdrop. Apply fixed positioning and centering here (e.g. fixed inset-0 flex items-center justify-center). Place DialogPopup inside.',\n});\n\nexport const DialogPopupDefinition = defineComponent<DialogPopupProps>({\n name: 'DialogPopup',\n importPath: '@vtex/faststore/components',\n component: DialogPopup,\n editor: { label: 'Dialog Popup', category: 'layout' },\n schema: {},\n guideline:\n 'The visible dialog panel, inside DialogViewport. Place DialogTitle (required), optional DialogDescription, your content, and DialogClose inside. Style with a background, padding, and shadow.',\n});\n\nexport const DialogTitleDefinition = defineComponent<DialogTitleProps>({\n name: 'DialogTitle',\n importPath: '@vtex/faststore/components',\n component: DialogTitle,\n editor: { label: 'Dialog Title', category: 'layout' },\n schema: {},\n guideline:\n 'Required heading inside DialogPopup — sets the accessible name of the dialog for screen readers. Use sr-only to hide it visually when a visual title already exists.',\n});\n\nexport const DialogDescriptionDefinition = defineComponent<DialogDescriptionProps>({\n name: 'DialogDescription',\n importPath: '@vtex/faststore/components',\n component: DialogDescription,\n editor: { label: 'Dialog Description', category: 'layout' },\n schema: {},\n guideline:\n 'Optional description inside DialogPopup, after DialogTitle. Provides additional context to screen readers. Omit if the dialog content is self-explanatory.',\n});\n\nexport const DialogCloseDefinition = defineComponent<DialogCloseProps>({\n name: 'DialogClose',\n importPath: '@vtex/faststore/components',\n component: DialogClose,\n editor: { label: 'Dialog Close', category: 'action' },\n schema: {},\n guideline:\n 'Closes the dialog when clicked. Place inside DialogPopup — can appear multiple times (e.g., close icon at top-right and a Cancel button at the bottom).',\n});\n\nexport function DialogRoot({ open, defaultOpen, modal = true, onOpenChange, children }: DialogRootProps) {\n return (\n <BaseDialog.Root open={open} defaultOpen={defaultOpen} modal={modal} onOpenChange={onOpenChange}>\n {children}\n </BaseDialog.Root>\n );\n}\n\nexport function DialogTrigger({ className, children, ...props }: DialogTriggerProps) {\n return (\n <BaseDialog.Trigger {...props} className={className} data-fs-dialog-trigger=\"\">\n {children}\n </BaseDialog.Trigger>\n );\n}\n\nexport function DialogPortal({ children }: DialogPortalProps) {\n return <BaseDialog.Portal>{children}</BaseDialog.Portal>;\n}\n\nexport function DialogBackdrop({ className, children, ...props }: DialogBackdropProps) {\n return (\n <BaseDialog.Backdrop {...props} className={className} data-fs-dialog-backdrop=\"\">\n {children}\n </BaseDialog.Backdrop>\n );\n}\n\nexport function DialogViewport({ className, children, ...props }: DialogViewportProps) {\n return (\n <div {...props} className={className} data-fs-dialog-viewport=\"\">\n {children}\n </div>\n );\n}\n\nexport function DialogPopup({ className, children, ...props }: DialogPopupProps) {\n return (\n <BaseDialog.Popup {...props} className={className} data-fs-dialog-popup=\"\">\n {children}\n </BaseDialog.Popup>\n );\n}\n\nexport function DialogTitle({ className, children, ...props }: DialogTitleProps) {\n return (\n <BaseDialog.Title {...props} className={className} data-fs-dialog-title=\"\">\n {children}\n </BaseDialog.Title>\n );\n}\n\nexport function DialogDescription({ className, children, ...props }: DialogDescriptionProps) {\n return (\n <BaseDialog.Description {...props} className={className} data-fs-dialog-description=\"\">\n {children}\n </BaseDialog.Description>\n );\n}\n\nexport function DialogClose({ className, children, ...props }: DialogCloseProps) {\n return (\n <BaseDialog.Close {...props} className={className} data-fs-dialog-close=\"\">\n {children}\n </BaseDialog.Close>\n );\n}\n\nexport const Dialog = {\n Root: DialogRoot,\n Trigger: DialogTrigger,\n Portal: DialogPortal,\n Backdrop: DialogBackdrop,\n Viewport: DialogViewport,\n Popup: DialogPopup,\n Title: DialogTitle,\n Description: DialogDescription,\n Close: DialogClose,\n};\n"],"mappings":";;;;;;AA+BA,MAAa,uBAAuB,gBAAiC;CACnE,MAAM;CACN,YAAY;CACZ,WAAW;CACX,QAAQ;EAAE,OAAO;EAAe,UAAU;CAAS;CACnD,QAAQ,EACN,OAAO;EAAE,MAAM;EAAW,SAAS;EAAM,OAAO;CAAQ,EAC1D;CACA,WACE;AACJ,CAAC;AAED,MAAa,0BAA0B,gBAAoC;CACzE,MAAM;CACN,YAAY;CACZ,WAAW;CACX,QAAQ;EAAE,OAAO;EAAkB,UAAU;CAAS;CACtD,QAAQ,CAAC;CACT,WACE;AACJ,CAAC;AAED,MAAa,yBAAyB,gBAAmC;CACvE,MAAM;CACN,YAAY;CACZ,WAAW;CACX,QAAQ;EAAE,OAAO;EAAiB,UAAU;CAAS;CACrD,QAAQ,CAAC;CACT,WACE;AACJ,CAAC;AAED,MAAa,2BAA2B,gBAAqC;CAC3E,MAAM;CACN,YAAY;CACZ,WAAW;CACX,QAAQ;EAAE,OAAO;EAAmB,UAAU;CAAS;CACvD,QAAQ,CAAC;CACT,WACE;AACJ,CAAC;AAED,MAAa,2BAA2B,gBAAqC;CAC3E,MAAM;CACN,YAAY;CACZ,WAAW;CACX,QAAQ;EAAE,OAAO;EAAmB,UAAU;CAAS;CACvD,QAAQ,CAAC;CACT,WACE;AACJ,CAAC;AAED,MAAa,wBAAwB,gBAAkC;CACrE,MAAM;CACN,YAAY;CACZ,WAAW;CACX,QAAQ;EAAE,OAAO;EAAgB,UAAU;CAAS;CACpD,QAAQ,CAAC;CACT,WACE;AACJ,CAAC;AAED,MAAa,wBAAwB,gBAAkC;CACrE,MAAM;CACN,YAAY;CACZ,WAAW;CACX,QAAQ;EAAE,OAAO;EAAgB,UAAU;CAAS;CACpD,QAAQ,CAAC;CACT,WACE;AACJ,CAAC;AAED,MAAa,8BAA8B,gBAAw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E,WAAW,UAAU,GAAG,SAAiC;CAC3F,OACE,oBAACA,OAAW,aAAZ;EAAwB,GAAI;EAAkB;EAAW,8BAA2B;EACjF;CACqB,CAAA;AAE5B;AAEA,SAAgB,YAAY,EAAE,WAAW,UAAU,GAAG,SAA2B;CAC/E,OACE,oBAACA,OAAW,OAAZ;EAAkB,GAAI;EAAkB;EAAW,wBAAqB;EACrE;CACe,CAAA;AAEtB;AAEA,MAAaC,WAAS;CACpB,MAAM;CACN,SAAS;CACT,QAAQ;CACR,UAAU;CACV,UAAU;CACV,OAAO;CACP,OAAO;CACP,aAAa;CACb,OAAO;AACT"}
1
+ {"version":3,"file":"dialog.js","names":["BaseDialog","Dialog"],"sources":["../../../src/particles/dialog/dialog.tsx"],"sourcesContent":["'use client';\nimport { Dialog as BaseDialog } from '@base-ui/react/dialog';\nimport { defineComponent } from '@vtex/fs-core';\nimport type { ComponentProps, ComponentPropsWithRef, ReactNode } from 'react';\n\nexport type DialogRootProps = {\n open?: boolean;\n defaultOpen?: boolean;\n modal?: boolean;\n onOpenChange?: (open: boolean, eventDetails: { isCanceled: boolean }) => void;\n children?: ReactNode;\n};\n\nexport type DialogTriggerProps = ComponentPropsWithRef<'button'>;\n\nexport type DialogPortalProps = Readonly<{\n children?: ReactNode;\n /** Parent element for the overlay. Omit it and the overlay renders on `document.body`. */\n container?: ComponentProps<typeof BaseDialog.Portal>['container'];\n}>;\n\nexport type DialogBackdropProps = ComponentPropsWithRef<'div'>;\n\nexport type DialogViewportProps = ComponentPropsWithRef<'div'>;\n\nexport type DialogPopupProps = ComponentPropsWithRef<'div'>;\n\nexport type DialogTitleProps = ComponentPropsWithRef<'h2'>;\n\nexport type DialogDescriptionProps = ComponentPropsWithRef<'p'>;\n\nexport type DialogCloseProps = ComponentPropsWithRef<'button'>;\n\nexport const DialogRootDefinition = defineComponent<DialogRootProps>({\n name: 'DialogRoot',\n importPath: '@vtex/faststore/components',\n component: DialogRoot,\n editor: { label: 'Dialog Root', category: 'layout' },\n schema: {\n modal: { type: 'boolean', default: true, label: 'Modal' },\n },\n guideline:\n 'Root of a dialog overlay. Compose as: DialogRoot > (DialogTrigger + DialogPortal > (DialogBackdrop + DialogViewport > DialogPopup > (DialogTitle + content + DialogClose))). Set modal=false only when the dialog must coexist with page interactions.',\n});\n\nexport const DialogTriggerDefinition = defineComponent<DialogTriggerProps>({\n name: 'DialogTrigger',\n importPath: '@vtex/faststore/components',\n component: DialogTrigger,\n editor: { label: 'Dialog Trigger', category: 'action' },\n schema: {},\n guideline:\n 'Opens the dialog when clicked. Direct child of DialogRoot. Accepts any children (text, Icon). Base UI connects it to DialogRoot via context — no explicit wiring needed.',\n});\n\nexport const DialogPortalDefinition = defineComponent<DialogPortalProps>({\n name: 'DialogPortal',\n importPath: '@vtex/faststore/components',\n component: DialogPortal,\n editor: { label: 'Dialog Portal', category: 'layout' },\n schema: {},\n guideline:\n 'Renders its children outside the DOM tree (into document.body, or into container when a parent swatch must reach the overlay). Place DialogBackdrop and DialogViewport as direct children, in that order.',\n});\n\nexport const DialogBackdropDefinition = defineComponent<DialogBackdropProps>({\n name: 'DialogBackdrop',\n importPath: '@vtex/faststore/components',\n component: DialogBackdrop,\n editor: { label: 'Dialog Backdrop', category: 'layout' },\n schema: {},\n guideline:\n 'Semi-transparent overlay behind the popup. Direct child of DialogPortal, before DialogViewport. Clicking it closes the dialog unless disablePointerDismissal is set on DialogRoot.',\n});\n\nexport const DialogViewportDefinition = defineComponent<DialogViewportProps>({\n name: 'DialogViewport',\n importPath: '@vtex/faststore/components',\n component: DialogViewport,\n editor: { label: 'Dialog Viewport', category: 'layout' },\n schema: {},\n guideline:\n 'Positioning container for DialogPopup. Direct child of DialogPortal, after DialogBackdrop. Apply fixed positioning and centering here (e.g. fixed inset-0 flex items-center justify-center). Place DialogPopup inside.',\n});\n\nexport const DialogPopupDefinition = defineComponent<DialogPopupProps>({\n name: 'DialogPopup',\n importPath: '@vtex/faststore/components',\n component: DialogPopup,\n editor: { label: 'Dialog Popup', category: 'layout' },\n schema: {},\n guideline:\n 'The visible dialog panel, inside DialogViewport. Place DialogTitle (required), optional DialogDescription, your content, and DialogClose inside. Style with a background, padding, and shadow.',\n});\n\nexport const DialogTitleDefinition = defineComponent<DialogTitleProps>({\n name: 'DialogTitle',\n importPath: '@vtex/faststore/components',\n component: DialogTitle,\n editor: { label: 'Dialog Title', category: 'layout' },\n schema: {},\n guideline:\n 'Required heading inside DialogPopup — sets the accessible name of the dialog for screen readers. Use sr-only to hide it visually when a visual title already exists.',\n});\n\nexport const DialogDescriptionDefinition = defineComponent<DialogDescriptionProps>({\n name: 'DialogDescription',\n importPath: '@vtex/faststore/components',\n component: DialogDescription,\n editor: { label: 'Dialog Description', category: 'layout' },\n schema: {},\n guideline:\n 'Optional description inside DialogPopup, after DialogTitle. Provides additional context to screen readers. Omit if the dialog content is self-explanatory.',\n});\n\nexport const DialogCloseDefinition = defineComponent<DialogCloseProps>({\n name: 'DialogClose',\n importPath: '@vtex/faststore/components',\n component: DialogClose,\n editor: { label: 'Dialog Close', category: 'action' },\n schema: {},\n guideline:\n 'Closes the dialog when clicked. Place inside DialogPopup — can appear multiple times (e.g., close icon at top-right and a Cancel button at the bottom).',\n});\n\nexport function DialogRoot({ open, defaultOpen, modal = true, onOpenChange, children }: DialogRootProps) {\n return (\n <BaseDialog.Root open={open} defaultOpen={defaultOpen} modal={modal} onOpenChange={onOpenChange}>\n {children}\n </BaseDialog.Root>\n );\n}\n\nexport function DialogTrigger({ className, children, ...props }: DialogTriggerProps) {\n return (\n <BaseDialog.Trigger {...props} className={className} data-fs-dialog-trigger=\"\">\n {children}\n </BaseDialog.Trigger>\n );\n}\n\nexport function DialogPortal({ children, container }: DialogPortalProps) {\n return <BaseDialog.Portal container={container}>{children}</BaseDialog.Portal>;\n}\n\nexport function DialogBackdrop({ className, children, ...props }: DialogBackdropProps) {\n return (\n <BaseDialog.Backdrop {...props} className={className} data-fs-dialog-backdrop=\"\">\n {children}\n </BaseDialog.Backdrop>\n );\n}\n\nexport function DialogViewport({ className, children, ...props }: DialogViewportProps) {\n return (\n <div {...props} className={className} data-fs-dialog-viewport=\"\">\n {children}\n </div>\n );\n}\n\nexport function DialogPopup({ className, children, ...props }: DialogPopupProps) {\n return (\n <BaseDialog.Popup {...props} className={className} data-fs-dialog-popup=\"\">\n {children}\n </BaseDialog.Popup>\n );\n}\n\nexport function DialogTitle({ className, children, ...props }: DialogTitleProps) {\n return (\n <BaseDialog.Title {...props} className={className} data-fs-dialog-title=\"\">\n {children}\n </BaseDialog.Title>\n );\n}\n\nexport function DialogDescription({ className, children, ...props }: DialogDescriptionProps) {\n return (\n <BaseDialog.Description {...props} className={className} data-fs-dialog-description=\"\">\n {children}\n </BaseDialog.Description>\n );\n}\n\nexport function DialogClose({ className, children, ...props }: DialogCloseProps) {\n return (\n <BaseDialog.Close {...props} className={className} data-fs-dialog-close=\"\">\n {children}\n </BaseDialog.Close>\n );\n}\n\nexport const Dialog = {\n Root: DialogRoot,\n Trigger: DialogTrigger,\n Portal: DialogPortal,\n Backdrop: DialogBackdrop,\n Viewport: DialogViewport,\n Popup: DialogPopup,\n Title: DialogTitle,\n Description: DialogDescription,\n Close: DialogClose,\n};\n"],"mappings":";;;;;;AAiCA,MAAa,uBAAuB,gBAAiC;CACnE,MAAM;CACN,YAAY;CACZ,WAAW;CACX,QAAQ;EAAE,OAAO;EAAe,UAAU;CAAS;CACnD,QAAQ,EACN,OAAO;EAAE,MAAM;EAAW,SAAS;EAAM,OAAO;CAAQ,EAC1D;CACA,WACE;AACJ,CAAC;AAED,MAAa,0BAA0B,gBAAoC;CACzE,MAAM;CACN,YAAY;CACZ,WAAW;CACX,QAAQ;EAAE,OAAO;EAAkB,UAAU;CAAS;CACtD,QAAQ,CAAC;CACT,WACE;AACJ,CAAC;AAED,MAAa,yBAAyB,gBAAmC;CACvE,MAAM;CACN,YAAY;CACZ,WAAW;CACX,QAAQ;EAAE,OAAO;EAAiB,UAAU;CAAS;CACrD,QAAQ,CA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C;CACvE,OAAO,oBAACA,OAAW,QAAZ;EAA8B;EAAY;CAA4B,CAAA;AAC/E;AAEA,SAAgB,eAAe,EAAE,WAAW,UAAU,GAAG,SAA8B;CACrF,OACE,oBAACA,OAAW,UAAZ;EAAqB,GAAI;EAAkB;EAAW,2BAAwB;EAC3E;CACkB,CAAA;AAEzB;AAEA,SAAgB,eAAe,EAAE,WAAW,UAAU,GAAG,SAA8B;CACrF,OACE,oBAAC,OAAD;EAAK,GAAI;EAAkB;EAAW,2BAAwB;EAC3D;CACE,CAAA;AAET;AAEA,SAAgB,YAAY,EAAE,WAAW,UAAU,GAAG,SAA2B;CAC/E,OACE,oBAACA,OAAW,OAAZ;EAAkB,GAAI;EAAkB;EAAW,wBAAqB;EACrE;CACe,CAAA;AAEtB;AAEA,SAAgB,YAAY,EAAE,WAAW,UAAU,GAAG,SAA2B;CAC/E,OACE,oBAACA,OAAW,OAAZ;EAAkB,GAAI;EAAkB;EAAW,wBAAqB;EACrE;CACe,CAAA;AAEtB;AAEA,SAAgB,kBAAkB,EAAE,WAAW,UAAU,GAAG,SAAiC;CAC3F,OACE,oBAACA,OAAW,aAAZ;EAAwB,GAAI;EAAkB;EAAW,8BAA2B;EACjF;CACqB,CAAA;AAE5B;AAEA,SAAgB,YAAY,EAAE,WAAW,UAAU,GAAG,SAA2B;CAC/E,OACE,oBAACA,OAAW,OAAZ;EAAkB,GAAI;EAAkB;EAAW,wBAAqB;EACrE;CACe,CAAA;AAEtB;AAEA,MAAaC,WAAS;CACpB,MAAM;CACN,SAAS;CACT,QAAQ;CACR,UAAU;CACV,UAAU;CACV,OAAO;CACP,OAAO;CACP,aAAa;CACb,OAAO;AACT"}
@@ -106,7 +106,7 @@ const DrawerCloseDefinition = defineComponent({
106
106
  category: "action"
107
107
  },
108
108
  schema: {},
109
- guideline: "Button that closes the drawer. Place at the top of Drawer.Popup. Receives ARIA label management automatically from Base UI."
109
+ guideline: "Button that closes the drawer. Place at the top of Drawer.Popup. It renders no label of its own, so an icon-only close needs an aria-label in the store language."
110
110
  });
111
111
  function DrawerRoot({ swipeDirection = "right", modal = true, children, ...props }) {
112
112
  return /* @__PURE__ */ jsx(Drawer.Root, {
@@ -1 +1 @@
1
- {"version":3,"file":"drawer.js","names":["BaseDrawer","Drawer"],"sources":["../../../src/particles/drawer/drawer.tsx"],"sourcesContent":["'use client';\nimport { Drawer as BaseDrawer } from '@base-ui/react/drawer';\nimport { defineComponent } from '@vtex/fs-core';\nimport type { ComponentPropsWithRef, ReactNode } from 'react';\n\nexport type DrawerSwipeDirection = 'up' | 'down' | 'left' | 'right';\n\nexport type DrawerRootProps = {\n swipeDirection?: DrawerSwipeDirection;\n modal?: boolean;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean, eventDetails: { isCanceled: boolean }) => void;\n children?: ReactNode;\n};\n\nexport type DrawerTriggerProps = ComponentPropsWithRef<'button'>;\n\nexport type DrawerPortalProps = {\n children?: ReactNode;\n};\n\nexport type DrawerBackdropProps = ComponentPropsWithRef<'div'>;\n\nexport type DrawerPopupProps = ComponentPropsWithRef<'div'>;\n\nexport type DrawerTitleProps = ComponentPropsWithRef<'h2'>;\n\nexport type DrawerDescriptionProps = ComponentPropsWithRef<'p'>;\n\nexport type DrawerCloseProps = ComponentPropsWithRef<'button'>;\n\nexport const DrawerRootDefinition = defineComponent<DrawerRootProps>({\n name: 'DrawerRoot',\n importPath: '@vtex/faststore/components',\n component: DrawerRoot,\n editor: { label: 'Drawer Root', category: 'layout' },\n schema: {\n swipeDirection: { type: ['up', 'down', 'left', 'right'] as const, default: 'right', label: 'Swipe Direction' },\n modal: { type: 'boolean', default: true, label: 'Modal' },\n },\n guideline:\n 'Root of a drawer side panel. When modal (the default) it delivers the full overlay contract: focus trapping inside the popup, body scroll lock on the page behind it, Escape-to-close, and backdrop-click dismissal — all inherited from Base UI, none re-implemented in the layout. Compose as: DrawerRoot > (DrawerTrigger + DrawerPortal > (DrawerBackdrop + DrawerPopup > (DrawerTitle + DrawerDescription + content + DrawerClose))). Set swipeDirection to control the slide edge (right for cart/filters, bottom for mobile menus); modal=false only when the drawer must coexist with page interactions (drops focus trap and scroll lock).',\n});\n\nexport const DrawerTriggerDefinition = defineComponent<DrawerTriggerProps>({\n name: 'DrawerTrigger',\n importPath: '@vtex/faststore/components',\n component: DrawerTrigger,\n editor: { label: 'Drawer Trigger', category: 'action' },\n schema: {},\n guideline: 'Button that opens the Drawer. Place inside or outside Drawer.Root — Base UI connects them via context.',\n});\n\nexport const DrawerPortalDefinition = defineComponent<DrawerPortalProps>({\n name: 'DrawerPortal',\n importPath: '@vtex/faststore/components',\n component: DrawerPortal,\n editor: { label: 'Drawer Portal', category: 'layout' },\n schema: {},\n guideline:\n 'Portal wrapper that renders Drawer.Backdrop and Drawer.Popup outside the DOM tree. Always wrap both inside Drawer.Portal.',\n});\n\nexport const DrawerBackdropDefinition = defineComponent<DrawerBackdropProps>({\n name: 'DrawerBackdrop',\n importPath: '@vtex/faststore/components',\n component: DrawerBackdrop,\n editor: { label: 'Drawer Backdrop', category: 'layout' },\n schema: {},\n guideline:\n 'Semi-transparent overlay rendered behind the popup. Clicking it dismisses the drawer unless disablePointerDismissal is set on Drawer.Root.',\n});\n\nexport const DrawerPopupDefinition = defineComponent<DrawerPopupProps>({\n name: 'DrawerPopup',\n importPath: '@vtex/faststore/components',\n component: DrawerPopup,\n editor: { label: 'Drawer Popup', category: 'layout' },\n schema: {},\n guideline:\n 'Main drawer panel. Animation and positioning are controlled by swipeDirection on Drawer.Root. Contains Drawer.Title, content, and Drawer.Close.',\n});\n\nexport const DrawerTitleDefinition = defineComponent<DrawerTitleProps>({\n name: 'DrawerTitle',\n importPath: '@vtex/faststore/components',\n component: DrawerTitle,\n editor: { label: 'Drawer Title', category: 'layout' },\n schema: {},\n guideline:\n 'Semantic heading inside Drawer.Popup. Required for screen reader accessibility — sets the accessible name of the dialog.',\n});\n\nexport const DrawerDescriptionDefinition = defineComponent<DrawerDescriptionProps>({\n name: 'DrawerDescription',\n importPath: '@vtex/faststore/components',\n component: DrawerDescription,\n editor: { label: 'Drawer Description', category: 'layout' },\n schema: {},\n guideline: 'Accessible description of the drawer. Optional but recommended for screen readers.',\n});\n\nexport const DrawerCloseDefinition = defineComponent<DrawerCloseProps>({\n name: 'DrawerClose',\n importPath: '@vtex/faststore/components',\n component: DrawerClose,\n editor: { label: 'Drawer Close', category: 'action' },\n schema: {},\n guideline:\n 'Button that closes the drawer. Place at the top of Drawer.Popup. Receives ARIA label management automatically from Base UI.',\n});\n\nexport function DrawerRoot({ swipeDirection = 'right', modal = true, children, ...props }: DrawerRootProps) {\n return (\n <BaseDrawer.Root {...props} swipeDirection={swipeDirection} modal={modal}>\n {children}\n </BaseDrawer.Root>\n );\n}\n\nexport function DrawerTrigger({ className, children, ...props }: DrawerTriggerProps) {\n return (\n <BaseDrawer.Trigger {...props} className={className} data-fs-drawer-trigger=\"\">\n {children}\n </BaseDrawer.Trigger>\n );\n}\n\nexport function DrawerPortal({ children }: DrawerPortalProps) {\n return <BaseDrawer.Portal>{children}</BaseDrawer.Portal>;\n}\n\nexport function DrawerBackdrop({ className, children, ...props }: DrawerBackdropProps) {\n return (\n <BaseDrawer.Backdrop {...props} className={className} data-fs-drawer-backdrop=\"\">\n {children}\n </BaseDrawer.Backdrop>\n );\n}\n\nexport function DrawerPopup({ className, children, ...props }: DrawerPopupProps) {\n return (\n <BaseDrawer.Popup {...props} className={className} data-fs-drawer-popup=\"\">\n {children}\n </BaseDrawer.Popup>\n );\n}\n\nexport function DrawerTitle({ className, children, ...props }: DrawerTitleProps) {\n return (\n <BaseDrawer.Title {...props} className={className} data-fs-drawer-title=\"\">\n {children}\n </BaseDrawer.Title>\n );\n}\n\nexport function DrawerDescription({ className, children, ...props }: DrawerDescriptionProps) {\n return (\n <BaseDrawer.Description {...props} className={className} data-fs-drawer-description=\"\">\n {children}\n </BaseDrawer.Description>\n );\n}\n\nexport function DrawerClose({ className, children, ...props }: DrawerCloseProps) {\n return (\n <BaseDrawer.Close {...props} className={className} data-fs-drawer-close=\"\">\n {children}\n </BaseDrawer.Close>\n );\n}\n\nexport const Drawer = {\n Root: DrawerRoot,\n Trigger: DrawerTrigger,\n Portal: DrawerPortal,\n Backdrop: DrawerBackdrop,\n Popup: DrawerPopup,\n Title: DrawerTitle,\n Description: DrawerDescription,\n Close: DrawerClose,\n};\n"],"mappings":";;;;;;AAgCA,MAAa,uBAAuB,gBAAiC;CACnE,MAAM;CACN,YAAY;CACZ,WAAW;CACX,QAAQ;EAAE,OAAO;EAAe,UAAU;CAAS;CACnD,QAAQ;EACN,gBAAgB;GAAE,MAAM;IAAC;IAAM;IAAQ;IAAQ;GAAO;GAAY,SAAS;GAAS,OAAO;EAAkB;EAC7G,OAAO;GAAE,MAAM;GAAW,SAAS;GAAM,OAAO;EAAQ;CAC1D;CACA,WACE;AACJ,CAAC;AAED,MAAa,0BAA0B,gBAAoC;CACzE,MAAM;CACN,YAAY;CACZ,WAAW;CACX,QAAQ;EAAE,OAAO;EAAkB,UAAU;CAAS;CACtD,QAAQ,CAAC;CACT,WAAW;AACb,CAAC;AAED,MAAa,yBAAyB,gBAAmC;CACvE,MAAM;CACN,YAAY;CACZ,WAAW;CACX,QAAQ;EAAE,OAAO;EAAiB,UAAU;CAAS;CACrD,QAAQ,CAAC;CACT,WACE;AACJ,CAAC;AAED,MAAa,2BAA2B,gBAAqC;CAC3E,MAAM;CACN,YAAY;CACZ,WAAW;CACX,QAAQ;EAAE,OAAO;EAAmB,UAAU;CAAS;CACvD,QAAQ,CAAC;CACT,WACE;AACJ,CAAC;AAED,MAAa,wBAAwB,gBAAkC;CACrE,MAAM;CACN,YAAY;CACZ,WAAW;CACX,QAAQ;EAAE,OAAO;EAAgB,UAAU;CAAS;CACpD,QAAQ,CAAC;CACT,WACE;AACJ,CAAC;AAED,MAAa,wBAAwB,gBAAkC;CACrE,MAAM;CACN,YAAY;CACZ,WAAW;CACX,QAAQ;EAAE,OAAO;EAAgB,UAAU;CA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aAAZ;EAAwB,GAAI;EAAkB;EAAW,8BAA2B;EACjF;CACqB,CAAA;AAE5B;AAEA,SAAgB,YAAY,EAAE,WAAW,UAAU,GAAG,SAA2B;CAC/E,OACE,oBAACA,OAAW,OAAZ;EAAkB,GAAI;EAAkB;EAAW,wBAAqB;EACrE;CACe,CAAA;AAEtB;AAEA,MAAaC,WAAS;CACpB,MAAM;CACN,SAAS;CACT,QAAQ;CACR,UAAU;CACV,OAAO;CACP,OAAO;CACP,aAAa;CACb,OAAO;AACT"}
1
+ {"version":3,"file":"drawer.js","names":["BaseDrawer","Drawer"],"sources":["../../../src/particles/drawer/drawer.tsx"],"sourcesContent":["'use client';\nimport { Drawer as BaseDrawer } from '@base-ui/react/drawer';\nimport { defineComponent } from '@vtex/fs-core';\nimport type { ComponentPropsWithRef, ReactNode } from 'react';\n\nexport type DrawerSwipeDirection = 'up' | 'down' | 'left' | 'right';\n\nexport type DrawerRootProps = {\n swipeDirection?: DrawerSwipeDirection;\n modal?: boolean;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean, eventDetails: { isCanceled: boolean }) => void;\n children?: ReactNode;\n};\n\nexport type DrawerTriggerProps = ComponentPropsWithRef<'button'>;\n\nexport type DrawerPortalProps = {\n children?: ReactNode;\n};\n\nexport type DrawerBackdropProps = ComponentPropsWithRef<'div'>;\n\nexport type DrawerPopupProps = ComponentPropsWithRef<'div'>;\n\nexport type DrawerTitleProps = ComponentPropsWithRef<'h2'>;\n\nexport type DrawerDescriptionProps = ComponentPropsWithRef<'p'>;\n\nexport type DrawerCloseProps = ComponentPropsWithRef<'button'>;\n\nexport const DrawerRootDefinition = defineComponent<DrawerRootProps>({\n name: 'DrawerRoot',\n importPath: '@vtex/faststore/components',\n component: DrawerRoot,\n editor: { label: 'Drawer Root', category: 'layout' },\n schema: {\n swipeDirection: { type: ['up', 'down', 'left', 'right'] as const, default: 'right', label: 'Swipe Direction' },\n modal: { type: 'boolean', default: true, label: 'Modal' },\n },\n guideline:\n 'Root of a drawer side panel. When modal (the default) it delivers the full overlay contract: focus trapping inside the popup, body scroll lock on the page behind it, Escape-to-close, and backdrop-click dismissal — all inherited from Base UI, none re-implemented in the layout. Compose as: DrawerRoot > (DrawerTrigger + DrawerPortal > (DrawerBackdrop + DrawerPopup > (DrawerTitle + DrawerDescription + content + DrawerClose))). Set swipeDirection to control the slide edge (right for cart/filters, bottom for mobile menus); modal=false only when the drawer must coexist with page interactions (drops focus trap and scroll lock).',\n});\n\nexport const DrawerTriggerDefinition = defineComponent<DrawerTriggerProps>({\n name: 'DrawerTrigger',\n importPath: '@vtex/faststore/components',\n component: DrawerTrigger,\n editor: { label: 'Drawer Trigger', category: 'action' },\n schema: {},\n guideline: 'Button that opens the Drawer. Place inside or outside Drawer.Root — Base UI connects them via context.',\n});\n\nexport const DrawerPortalDefinition = defineComponent<DrawerPortalProps>({\n name: 'DrawerPortal',\n importPath: '@vtex/faststore/components',\n component: DrawerPortal,\n editor: { label: 'Drawer Portal', category: 'layout' },\n schema: {},\n guideline:\n 'Portal wrapper that renders Drawer.Backdrop and Drawer.Popup outside the DOM tree. Always wrap both inside Drawer.Portal.',\n});\n\nexport const DrawerBackdropDefinition = defineComponent<DrawerBackdropProps>({\n name: 'DrawerBackdrop',\n importPath: '@vtex/faststore/components',\n component: DrawerBackdrop,\n editor: { label: 'Drawer Backdrop', category: 'layout' },\n schema: {},\n guideline:\n 'Semi-transparent overlay rendered behind the popup. Clicking it dismisses the drawer unless disablePointerDismissal is set on Drawer.Root.',\n});\n\nexport const DrawerPopupDefinition = defineComponent<DrawerPopupProps>({\n name: 'DrawerPopup',\n importPath: '@vtex/faststore/components',\n component: DrawerPopup,\n editor: { label: 'Drawer Popup', category: 'layout' },\n schema: {},\n guideline:\n 'Main drawer panel. Animation and positioning are controlled by swipeDirection on Drawer.Root. Contains Drawer.Title, content, and Drawer.Close.',\n});\n\nexport const DrawerTitleDefinition = defineComponent<DrawerTitleProps>({\n name: 'DrawerTitle',\n importPath: '@vtex/faststore/components',\n component: DrawerTitle,\n editor: { label: 'Drawer Title', category: 'layout' },\n schema: {},\n guideline:\n 'Semantic heading inside Drawer.Popup. Required for screen reader accessibility — sets the accessible name of the dialog.',\n});\n\nexport const DrawerDescriptionDefinition = defineComponent<DrawerDescriptionProps>({\n name: 'DrawerDescription',\n importPath: '@vtex/faststore/components',\n component: DrawerDescription,\n editor: { label: 'Drawer Description', category: 'layout' },\n schema: {},\n guideline: 'Accessible description of the drawer. Optional but recommended for screen readers.',\n});\n\nexport const DrawerCloseDefinition = defineComponent<DrawerCloseProps>({\n name: 'DrawerClose',\n importPath: '@vtex/faststore/components',\n component: DrawerClose,\n editor: { label: 'Drawer Close', category: 'action' },\n schema: {},\n guideline:\n 'Button that closes the drawer. Place at the top of Drawer.Popup. It renders no label of its own, so an icon-only close needs an aria-label in the store language.',\n});\n\nexport function DrawerRoot({ swipeDirection = 'right', modal = true, children, ...props }: DrawerRootProps) {\n return (\n <BaseDrawer.Root {...props} swipeDirection={swipeDirection} modal={modal}>\n {children}\n </BaseDrawer.Root>\n );\n}\n\nexport function DrawerTrigger({ className, children, ...props }: DrawerTriggerProps) {\n return (\n <BaseDrawer.Trigger {...props} className={className} data-fs-drawer-trigger=\"\">\n {children}\n </BaseDrawer.Trigger>\n );\n}\n\nexport function DrawerPortal({ children }: DrawerPortalProps) {\n return <BaseDrawer.Portal>{children}</BaseDrawer.Portal>;\n}\n\nexport function DrawerBackdrop({ className, children, ...props }: DrawerBackdropProps) {\n return (\n <BaseDrawer.Backdrop {...props} className={className} data-fs-drawer-backdrop=\"\">\n {children}\n </BaseDrawer.Backdrop>\n );\n}\n\nexport function DrawerPopup({ className, children, ...props }: DrawerPopupProps) {\n return (\n <BaseDrawer.Popup {...props} className={className} data-fs-drawer-popup=\"\">\n {children}\n </BaseDrawer.Popup>\n );\n}\n\nexport function DrawerTitle({ className, children, ...props }: DrawerTitleProps) {\n return (\n <BaseDrawer.Title {...props} className={className} data-fs-drawer-title=\"\">\n {children}\n </BaseDrawer.Title>\n );\n}\n\nexport function DrawerDescription({ className, children, ...props }: DrawerDescriptionProps) {\n return (\n <BaseDrawer.Description {...props} className={className} data-fs-drawer-description=\"\">\n {children}\n </BaseDrawer.Description>\n );\n}\n\nexport function DrawerClose({ className, children, ...props }: DrawerCloseProps) {\n return (\n <BaseDrawer.Close {...props} className={className} data-fs-drawer-close=\"\">\n {children}\n </BaseDrawer.Close>\n );\n}\n\nexport const Drawer = {\n Root: DrawerRoot,\n Trigger: DrawerTrigger,\n Portal: DrawerPortal,\n Backdrop: DrawerBackdrop,\n Popup: DrawerPopup,\n Title: DrawerTitle,\n Description: DrawerDescription,\n Close: DrawerClose,\n};\n"],"mappings":";;;;;;AAgCA,MAAa,uBAAuB,gBAAiC;CACnE,MAAM;CACN,YAAY;CACZ,WAAW;CACX,QAAQ;EAAE,OAAO;EAAe,UAAU;CAAS;CACnD,QAAQ;EACN,gBAAgB;GAAE,MAAM;IAAC;IAAM;IAAQ;IAAQ;GAAO;GAAY,SAAS;GAAS,OAAO;EAAkB;EAC7G,OAAO;GAAE,MAAM;GAAW,SAAS;GAAM,OAAO;EAAQ;CAC1D;CACA,WACE;AACJ,CAAC;AAED,MAAa,0BAA0B,gBAAoC;CACzE,MAAM;CACN,YAAY;CACZ,WAAW;CACX,QAAQ;EAAE,OAAO;EAAkB,UAAU;CAAS;CACtD,QAAQ,CAAC;CACT,WAAW;AACb,CAAC;AAED,MAAa,yBAAyB,gBAAmC;CACvE,MAAM;CACN,YAAY;CACZ,WAAW;CACX,QAAQ;EAAE,OAAO;EAAiB,UAAU;CAAS;CACrD,QAAQ,CAAC;CACT,WACE;AACJ,CAAC;AAED,MAAa,2BAA2B,gBAAqC;CAC3E,MAAM;CACN,YAAY;CACZ,WAAW;CACX,QAAQ;EAAE,OAAO;EAAmB,UAAU;CAAS;CACvD,QAAQ,CAAC;CACT,WACE;AACJ,CAAC;AAED,MAAa,wBAAwB,gBAAkC;CACrE,MAAM;CACN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AAY,EAAE,WAAW,UAAU,GAAG,SAA2B;CAC/E,OACE,oBAACA,OAAW,OAAZ;EAAkB,GAAI;EAAkB;EAAW,wBAAqB;EACrE;CACe,CAAA;AAEtB;AAEA,SAAgB,kBAAkB,EAAE,WAAW,UAAU,GAAG,SAAiC;CAC3F,OACE,oBAACA,OAAW,aAAZ;EAAwB,GAAI;EAAkB;EAAW,8BAA2B;EACjF;CACqB,CAAA;AAE5B;AAEA,SAAgB,YAAY,EAAE,WAAW,UAAU,GAAG,SAA2B;CAC/E,OACE,oBAACA,OAAW,OAAZ;EAAkB,GAAI;EAAkB;EAAW,wBAAqB;EACrE;CACe,CAAA;AAEtB;AAEA,MAAaC,WAAS;CACpB,MAAM;CACN,SAAS;CACT,QAAQ;CACR,UAAU;CACV,OAAO;CACP,OAAO;CACP,aAAa;CACb,OAAO;AACT"}
@@ -14,6 +14,7 @@ export type EmailFieldProps = Omit<ComponentPropsWithRef<'div'>, 'defaultValue'
14
14
  disabled?: boolean;
15
15
  required?: boolean;
16
16
  name?: string;
17
+ autoComplete?: string;
17
18
  };
18
19
  /**
19
20
  * Email format rule, ported from the legacy `EMAIL_VALIDATE_REGEX` (fastcheckout `validations.ts`).
@@ -32,6 +33,6 @@ export declare const EmailFieldDefinition: ComponentDefinition<EmailFieldProps>;
32
33
  * forces `invalid` (e.g. a server-side error from `EmailIdentificationControl`). It consumes no
33
34
  * GraphQL and no domain context — value flows through `value`/`defaultValue`/`onValueChange`.
34
35
  */
35
- export declare function EmailField({ value, defaultValue, onValueChange, onBlur, invalid, errorMessage, label, placeholder, disabled, required, name, className, ...props }: EmailFieldProps): import("react/jsx-runtime").JSX.Element;
36
+ export declare function EmailField({ value, defaultValue, onValueChange, onBlur, invalid, errorMessage, label, placeholder, disabled, required, name, autoComplete, className, ...props }: EmailFieldProps): import("react/jsx-runtime").JSX.Element;
36
37
  //#endregion
37
38
  //# sourceMappingURL=email-field.d.ts.map
@@ -57,7 +57,7 @@ const EmailFieldDefinition = defineComponent({
57
57
  * forces `invalid` (e.g. a server-side error from `EmailIdentificationControl`). It consumes no
58
58
  * GraphQL and no domain context — value flows through `value`/`defaultValue`/`onValueChange`.
59
59
  */
60
- function EmailField({ value, defaultValue = "", onValueChange, onBlur, invalid = false, errorMessage, label, placeholder, disabled = false, required = true, name = "email", className, ...props }) {
60
+ function EmailField({ value, defaultValue = "", onValueChange, onBlur, invalid = false, errorMessage, label, placeholder, disabled = false, required = true, name = "email", autoComplete, className, ...props }) {
61
61
  const isControlled = value !== void 0;
62
62
  const [internalValue, setInternalValue] = useState(defaultValue);
63
63
  const [formatInvalid, setFormatInvalid] = useState(false);
@@ -86,6 +86,7 @@ function EmailField({ value, defaultValue = "", onValueChange, onBlur, invalid =
86
86
  /* @__PURE__ */ jsx(Field.Control, {
87
87
  type: "email",
88
88
  name,
89
+ autoComplete,
89
90
  required,
90
91
  placeholder,
91
92
  disabled,
@@ -1 +1 @@
1
- {"version":3,"file":"email-field.js","names":[],"sources":["../../../src/particles/email-field/email-field.tsx"],"sourcesContent":["'use client';\nimport { defineComponent } from '@vtex/fs-core';\nimport type { ChangeEvent, ComponentPropsWithRef, FocusEvent } from 'react';\nimport { useState } from 'react';\nimport { Field } from '../field/field.js';\n\nexport type EmailFieldProps = Omit<ComponentPropsWithRef<'div'>, 'defaultValue' | 'value' | 'onChange' | 'onBlur'> & {\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n onBlur?: (event: FocusEvent<HTMLInputElement>) => void;\n invalid?: boolean;\n errorMessage?: string;\n label?: string;\n placeholder?: string;\n disabled?: boolean;\n required?: boolean;\n name?: string;\n};\n\n/**\n * Email format rule, ported from the legacy `EMAIL_VALIDATE_REGEX` (fastcheckout `validations.ts`).\n * The exact legacy source was unavailable at authoring time, so this uses the WHATWG/HTML5 email-input\n * pattern — the same rule the browser applies to `<input type=\"email\">`. Format validation runs on\n * blur/submit only, never per keystroke (Invariants & Constraints).\n */\nexport const EMAIL_VALIDATE_REGEX =\n /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+$/;\n\n/** True when `value` is a well-formed email address. Trims surrounding whitespace before testing. */\nexport function isValidEmail(value: string): boolean {\n return EMAIL_VALIDATE_REGEX.test(value.trim());\n}\n\nexport const EmailFieldDefinition = defineComponent<EmailFieldProps>({\n name: 'EmailField',\n importPath: '@vtex/faststore/components',\n component: EmailField,\n editor: { label: 'Email Field', category: 'content' },\n schema: {\n label: { type: 'string', label: 'Label' },\n placeholder: { type: 'string', label: 'Placeholder' },\n errorMessage: { type: 'string', label: 'Error message' },\n required: { type: 'boolean', default: true, label: 'Required' },\n disabled: { type: 'boolean', default: false, label: 'Disabled' },\n },\n guideline:\n 'Presentational, data-agnostic email input with blur/submit format validation; for a checkout-bound field use EmailIdentificationControl instead. See email-field.md.',\n});\n\n/**\n * Presentational email input (particle). Composes the `Field` particle (`Field.Root` + `Field.Label` +\n * `Field.Control` + `Field.Error`) and owns email **format** validation: it validates on blur/submit\n * (never per keystroke) and surfaces `errorMessage` inline when the format is invalid or when the host\n * forces `invalid` (e.g. a server-side error from `EmailIdentificationControl`). It consumes no\n * GraphQL and no domain context — value flows through `value`/`defaultValue`/`onValueChange`.\n */\nexport function EmailField({\n value,\n defaultValue = '',\n onValueChange,\n onBlur,\n invalid = false,\n errorMessage,\n label,\n placeholder,\n disabled = false,\n required = true,\n name = 'email',\n className,\n ...props\n}: EmailFieldProps) {\n const isControlled = value !== undefined;\n const [internalValue, setInternalValue] = useState(defaultValue);\n const [formatInvalid, setFormatInvalid] = useState(false);\n\n const currentValue = isControlled ? value : internalValue;\n const showInvalid = invalid || formatInvalid;\n\n function handleChange(event: ChangeEvent<HTMLInputElement>) {\n const next = event.target.value;\n if (!isControlled) setInternalValue(next);\n // Clear a prior format error while typing; it is re-evaluated on the next blur (no per-keystroke validation).\n if (formatInvalid) setFormatInvalid(false);\n onValueChange?.(next);\n }\n\n function handleBlur(event: FocusEvent<HTMLInputElement>) {\n const trimmed = currentValue.trim();\n setFormatInvalid(trimmed.length > 0 && !isValidEmail(trimmed));\n onBlur?.(event);\n }\n\n return (\n <Field.Root\n {...props}\n className={className}\n name={name}\n invalid={showInvalid}\n disabled={disabled}\n data-fs-email-field=\"\"\n >\n {label ? <Field.Label>{label}</Field.Label> : null}\n <Field.Control\n type=\"email\"\n name={name}\n required={required}\n placeholder={placeholder}\n disabled={disabled}\n onChange={handleChange}\n onBlur={handleBlur}\n {...(isControlled ? { value: currentValue } : { defaultValue })}\n />\n {showInvalid && errorMessage ? <Field.Error match>{errorMessage}</Field.Error> : null}\n </Field.Root>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AA0BA,MAAa,uBACX;;AAGF,SAAgB,aAAa,OAAwB;CACnD,OAAO,qBAAqB,KAAK,MAAM,KAAK,CAAC;AAC/C;AAEA,MAAa,uBAAuB,gBAAiC;CACnE,MAAM;CACN,YAAY;CACZ,WAAW;CACX,QAAQ;EAAE,OAAO;EAAe,UAAU;CAAU;CACpD,QAAQ;EACN,OAAO;GAAE,MAAM;GAAU,OAAO;EAAQ;EACxC,aAAa;GAAE,MAAM;GAAU,OAAO;EAAc;EACpD,cAAc;GAAE,MAAM;GAAU,OAAO;EAAgB;EACvD,UAAU;GAAE,MAAM;GAAW,SAAS;GAAM,OAAO;EAAW;EAC9D,UAAU;GAAE,MAAM;GAAW,SAAS;GAAO,OAAO;EAAW;CACjE;CACA,WACE;AACJ,CAAC;;;;;;;;AASD,SAAgB,WAAW,EACzB,OACA,eAAe,IACf,eACA,QACA,UAAU,OACV,cACA,OACA,aACA,WAAW,OACX,WAAW,MACX,OAAO,SACP,WACA,GAAG,SACe;CAClB,MAAM,eAAe,UAAU,KAAA;CAC/B,MAAM,CAAC,eAAe,oBAAoB,SAAS,YAAY;CAC/D,MAAM,CAAC,eAAe,oBAAoB,SAAS,KAAK;CAExD,MAAM,eAAe,eAAe,QAAQ;CAC5C,MAAM,cAAc,WAAW;CAE/B,SAAS,aAAa,OAAsC;EAC1D,MAAM,OAAO,MAAM,OAAO;EAC1B,IAAI,CAAC,cAAc,iBAAiB,IAAI;EAExC,IAAI,eAAe,iBAAiB,KAAK;EACzC,gBAAgB,IAAI;CACtB;CAEA,SAAS,WAAW,OAAqC;EACvD,MAAM,UAAU,aAAa,KAAK;EAClC,iBAAiB,QAAQ,SAAS,KAAK,CAAC,aAAa,OAAO,CAAC;EAC7D,SAAS,KAAK;CAChB;CAEA,OACE,qBAAC,MAAM,MAAP;EACE,GAAI;EACO;EACL;EACN,SAAS;EACC;EACV,uBAAoB;EANtB,UAAA;GAQG,QAAQ,oBAAC,MAAM,OAAP,EAAA,UAAc,MAAmB,CAAA,IAAI;GAC9C,oBAAC,MAAM,SAAP;IACE,MAAK;IACC;IACI;IACG;IACH;IACV,UAAU;IACV,QAAQ;IACR,GAAK,eAAe,EAAE,OAAO,aAAa,IAAI,EAAE,aAAa;GAC9D,CAAA;GACA,eAAe,eAAe,oBAAC,MAAM,OAAP;IAAa,OAAA;IAAO,UAAA;GAA0B,CAAA,IAAI;EACvE;;AAEhB"}
1
+ {"version":3,"file":"email-field.js","names":[],"sources":["../../../src/particles/email-field/email-field.tsx"],"sourcesContent":["'use client';\nimport { defineComponent } from '@vtex/fs-core';\nimport type { ChangeEvent, ComponentPropsWithRef, FocusEvent } from 'react';\nimport { useState } from 'react';\nimport { Field } from '../field/field.js';\n\nexport type EmailFieldProps = Omit<ComponentPropsWithRef<'div'>, 'defaultValue' | 'value' | 'onChange' | 'onBlur'> & {\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n onBlur?: (event: FocusEvent<HTMLInputElement>) => void;\n invalid?: boolean;\n errorMessage?: string;\n label?: string;\n placeholder?: string;\n disabled?: boolean;\n required?: boolean;\n name?: string;\n autoComplete?: string;\n};\n\n/**\n * Email format rule, ported from the legacy `EMAIL_VALIDATE_REGEX` (fastcheckout `validations.ts`).\n * The exact legacy source was unavailable at authoring time, so this uses the WHATWG/HTML5 email-input\n * pattern — the same rule the browser applies to `<input type=\"email\">`. Format validation runs on\n * blur/submit only, never per keystroke (Invariants & Constraints).\n */\nexport const EMAIL_VALIDATE_REGEX =\n /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+$/;\n\n/** True when `value` is a well-formed email address. Trims surrounding whitespace before testing. */\nexport function isValidEmail(value: string): boolean {\n return EMAIL_VALIDATE_REGEX.test(value.trim());\n}\n\nexport const EmailFieldDefinition = defineComponent<EmailFieldProps>({\n name: 'EmailField',\n importPath: '@vtex/faststore/components',\n component: EmailField,\n editor: { label: 'Email Field', category: 'content' },\n schema: {\n label: { type: 'string', label: 'Label' },\n placeholder: { type: 'string', label: 'Placeholder' },\n errorMessage: { type: 'string', label: 'Error message' },\n required: { type: 'boolean', default: true, label: 'Required' },\n disabled: { type: 'boolean', default: false, label: 'Disabled' },\n },\n guideline:\n 'Presentational, data-agnostic email input with blur/submit format validation; for a checkout-bound field use EmailIdentificationControl instead. See email-field.md.',\n});\n\n/**\n * Presentational email input (particle). Composes the `Field` particle (`Field.Root` + `Field.Label` +\n * `Field.Control` + `Field.Error`) and owns email **format** validation: it validates on blur/submit\n * (never per keystroke) and surfaces `errorMessage` inline when the format is invalid or when the host\n * forces `invalid` (e.g. a server-side error from `EmailIdentificationControl`). It consumes no\n * GraphQL and no domain context — value flows through `value`/`defaultValue`/`onValueChange`.\n */\nexport function EmailField({\n value,\n defaultValue = '',\n onValueChange,\n onBlur,\n invalid = false,\n errorMessage,\n label,\n placeholder,\n disabled = false,\n required = true,\n name = 'email',\n autoComplete,\n className,\n ...props\n}: EmailFieldProps) {\n const isControlled = value !== undefined;\n const [internalValue, setInternalValue] = useState(defaultValue);\n const [formatInvalid, setFormatInvalid] = useState(false);\n\n const currentValue = isControlled ? value : internalValue;\n const showInvalid = invalid || formatInvalid;\n\n function handleChange(event: ChangeEvent<HTMLInputElement>) {\n const next = event.target.value;\n if (!isControlled) setInternalValue(next);\n // Clear a prior format error while typing; it is re-evaluated on the next blur (no per-keystroke validation).\n if (formatInvalid) setFormatInvalid(false);\n onValueChange?.(next);\n }\n\n function handleBlur(event: FocusEvent<HTMLInputElement>) {\n const trimmed = currentValue.trim();\n setFormatInvalid(trimmed.length > 0 && !isValidEmail(trimmed));\n onBlur?.(event);\n }\n\n return (\n <Field.Root\n {...props}\n className={className}\n name={name}\n invalid={showInvalid}\n disabled={disabled}\n data-fs-email-field=\"\"\n >\n {label ? <Field.Label>{label}</Field.Label> : null}\n <Field.Control\n type=\"email\"\n name={name}\n autoComplete={autoComplete}\n required={required}\n placeholder={placeholder}\n disabled={disabled}\n onChange={handleChange}\n onBlur={handleBlur}\n {...(isControlled ? { value: currentValue } : { defaultValue })}\n />\n {showInvalid && errorMessage ? <Field.Error match>{errorMessage}</Field.Error> : null}\n </Field.Root>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AA2BA,MAAa,uBACX;;AAGF,SAAgB,aAAa,OAAwB;CACnD,OAAO,qBAAqB,KAAK,MAAM,KAAK,CAAC;AAC/C;AAEA,MAAa,uBAAuB,gBAAiC;CACnE,MAAM;CACN,YAAY;CACZ,WAAW;CACX,QAAQ;EAAE,OAAO;EAAe,UAAU;CAAU;CACpD,QAAQ;EACN,OAAO;GAAE,MAAM;GAAU,OAAO;EAAQ;EACxC,aAAa;GAAE,MAAM;GAAU,OAAO;EAAc;EACpD,cAAc;GAAE,MAAM;GAAU,OAAO;EAAgB;EACvD,UAAU;GAAE,MAAM;GAAW,SAAS;GAAM,OAAO;EAAW;EAC9D,UAAU;GAAE,MAAM;GAAW,SAAS;GAAO,OAAO;EAAW;CACjE;CACA,WACE;AACJ,CAAC;;;;;;;;AASD,SAAgB,WAAW,EACzB,OACA,eAAe,IACf,eACA,QACA,UAAU,OACV,cACA,OACA,aACA,WAAW,OACX,WAAW,MACX,OAAO,SACP,cACA,WACA,GAAG,SACe;CAClB,MAAM,eAAe,UAAU,KAAA;CAC/B,MAAM,CAAC,eAAe,oBAAoB,SAAS,YAAY;CAC/D,MAAM,CAAC,eAAe,oBAAoB,SAAS,KAAK;CAExD,MAAM,eAAe,eAAe,QAAQ;CAC5C,MAAM,cAAc,WAAW;CAE/B,SAAS,aAAa,OAAsC;EAC1D,MAAM,OAAO,MAAM,OAAO;EAC1B,IAAI,CAAC,cAAc,iBAAiB,IAAI;EAExC,IAAI,eAAe,iBAAiB,KAAK;EACzC,gBAAgB,IAAI;CACtB;CAEA,SAAS,WAAW,OAAqC;EACvD,MAAM,UAAU,aAAa,KAAK;EAClC,iBAAiB,QAAQ,SAAS,KAAK,CAAC,aAAa,OAAO,CAAC;EAC7D,SAAS,KAAK;CAChB;CAEA,OACE,qBAAC,MAAM,MAAP;EACE,GAAI;EACO;EACL;EACN,SAAS;EACC;EACV,uBAAoB;EANtB,UAAA;GAQG,QAAQ,oBAAC,MAAM,OAAP,EAAA,UAAc,MAAmB,CAAA,IAAI;GAC9C,oBAAC,MAAM,SAAP;IACE,MAAK;IACC;IACQ;IACJ;IACG;IACH;IACV,UAAU;IACV,QAAQ;IACR,GAAK,eAAe,EAAE,OAAO,aAAa,IAAI,EAAE,aAAa;GAC9D,CAAA;GACA,eAAe,eAAe,oBAAC,MAAM,OAAP;IAAa,OAAA;IAAO,UAAA;GAA0B,CAAA,IAAI;EACvE;;AAEhB"}
@@ -132,6 +132,7 @@ function FooterLinkGroup({ heading, links, $content, className, ...props }) {
132
132
  className,
133
133
  "data-fs-footer-link-group": "",
134
134
  children: [/* @__PURE__ */ jsx(AccordionRoot, {
135
+ role: "group",
135
136
  "data-fs-footer-link-group-accordion": "",
136
137
  children: /* @__PURE__ */ jsxs(AccordionItem, {
137
138
  value: ACCORDION_ITEM_VALUE,
@@ -1 +1 @@
1
- {"version":3,"file":"footer-link-group.js","names":[],"sources":["../../../src/particles/footer-link-group/footer-link-group.tsx"],"sourcesContent":["import { type ContentValue, defineComponent, defineContentType } from '@vtex/fs-core';\nimport type { ComponentPropsWithRef } from 'react';\nimport type { PageRef } from '../../sdk/navigation/types.js';\nimport { resolveSafeHref } from '../../utils/safe-href.js';\nimport {\n AccordionHeader,\n AccordionItem,\n AccordionPanel,\n AccordionRoot,\n AccordionTrigger,\n} from '../accordion/accordion.js';\nimport { NavigationLink } from '../navigation-link/navigation-link.js';\n\n// ---------------------------------------------------------------------------\n// Content model\n// ---------------------------------------------------------------------------\n\nexport const FooterLinkGroupContent = defineContentType({\n id: 'footer-link-group',\n title: 'Footer Link Group',\n description: 'A heading and its ordered list of institutional links.',\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. The\n // render gate holds the heading invariant instead, being the only point that sees both channels.\n properties: {\n heading: { type: 'string', minLength: 1, title: 'Group heading' },\n links: {\n type: 'array',\n title: 'Links',\n minItems: 1,\n items: {\n type: 'object',\n additionalProperties: false,\n required: ['label', 'href'],\n properties: {\n label: { type: 'string', minLength: 1, title: 'Label' },\n href: {\n type: 'string',\n minLength: 1,\n title: 'URL',\n format: 'uri-reference',\n // Author-time guidance only, and deliberately lookahead-free: nothing in this repo\n // compiles it, so its one consumer is the Content Platform Admin's form, whose regex\n // engine may be an RE2 family that rejects lookahead outright.\n pattern: '^(?:https?://.*|mailto:.+|tel:.+|/(?:[^/].*)?)$',\n },\n target: { type: 'string', enum: ['_self', '_blank'], default: '_self', title: 'Open in' },\n },\n },\n },\n },\n },\n});\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\ntype FooterLinkGroupContentValue = ContentValue<typeof FooterLinkGroupContent>;\n\ntype FooterLinkGroupContentLink = NonNullable<FooterLinkGroupContentValue['links']>[number];\n\n/** One authored link. The prop accepts a page reference; a CMS href stays a string. */\nexport type FooterLinkGroupLink = Omit<FooterLinkGroupContentLink, 'href'> & {\n href: PageRef | string;\n};\n\nexport type FooterLinkGroupProps = ComponentPropsWithRef<'div'> & {\n /** Authored fallback for the group heading, used when no CMS entry supplies one. */\n heading?: string;\n /** Authored fallback for the link list, used when no CMS entry supplies one. */\n links?: readonly FooterLinkGroupLink[];\n /** Injected by the compiler, sliced from the page's or layout's composite content entry. */\n $content?: FooterLinkGroupContentValue;\n};\n\n// ---------------------------------------------------------------------------\n// Definition\n// ---------------------------------------------------------------------------\n\nexport const FooterLinkGroupDefinition = defineComponent({\n name: 'FooterLinkGroup',\n importPath: '@vtex/faststore/components',\n component: FooterLinkGroup,\n content: FooterLinkGroupContent,\n editor: { label: 'Footer Link Group', category: 'navigation' },\n schema: {\n heading: { type: 'string', label: 'Group heading' },\n links: { type: 'array', label: 'Links' },\n },\n guideline:\n \"One heading and its institutional links, both CMS-editable. Renders as a desktop column and a mobile accordion at the same time; the store's swatch pair decides which one a breakpoint shows. See footer-link-group.md.\",\n});\n\n// ---------------------------------------------------------------------------\n// Implementation\n// ---------------------------------------------------------------------------\n\n/** A resolved link, ready for both forms. A null `href` is a destination the allowlist refused. */\ntype ResolvedLink = {\n label: string;\n href: PageRef | string | null;\n target: FooterLinkGroupLink['target'];\n};\n\nfunction readLinks(\n content: readonly FooterLinkGroupContentLink[] | undefined,\n authored: readonly FooterLinkGroupLink[] | undefined,\n): readonly FooterLinkGroupLink[] {\n if (content !== undefined) return content;\n return authored ?? [];\n}\n\nfunction resolveDestination(href: PageRef | string, index: number): PageRef | string | null {\n if (typeof href !== 'string') return href;\n\n const destination = resolveSafeHref(href);\n if (!destination.safe) {\n // A bounded reason and no authored value, the convention the content runtime's own log follows.\n console.warn('[FooterLinkGroup] link destination rejected', { index, reason: destination.reason });\n return null;\n }\n return destination.href;\n}\n\n/** Unique within its own root, and every group renders its own root. */\nconst ACCORDION_ITEM_VALUE = 'links';\n\n/**\n * Resolves the whole list once per render, so both forms show the same links and a refused\n * destination logs one line rather than two.\n */\nfunction resolveLinks(links: readonly FooterLinkGroupLink[]): ResolvedLink[] {\n const resolved: ResolvedLink[] = [];\n\n links.forEach((link, index) => {\n // `minLength` is enforced by neither the runtime slice nor the preflight, so a blank label\n // reaches the component. Drop the link: an anchor with no accessible name is a WCAG failure.\n if (link.label.trim().length === 0) {\n return;\n }\n resolved.push({\n label: link.label,\n href: resolveDestination(link.href, index),\n target: link.target,\n });\n });\n\n return resolved;\n}\n\nexport function FooterLinkGroup({ heading, links, $content, className, ...props }: FooterLinkGroupProps) {\n const groupHeading = $content?.heading ?? heading;\n // An entry supplying `links: []` beats an authored prop: a merchant who cleared the list cleared it.\n const resolved = resolveLinks(readLinks($content?.links, links));\n\n if (!groupHeading?.trim() || resolved.length === 0) {\n return null;\n }\n\n // One element rendered in both forms, so the two cannot drift.\n const list = (\n <ul data-fs-footer-link-group-list=\"\">\n {resolved.map((link, index) => (\n <li key={index} data-fs-footer-link-group-item=\"\">\n {link.href === null ? (\n <span data-fs-text=\"\" data-fs-footer-link-group-text=\"\">\n {link.label}\n </span>\n ) : (\n <NavigationLink href={link.href} target={link.target} data-fs-footer-link-group-link=\"\">\n {link.label}\n </NavigationLink>\n )}\n </li>\n ))}\n </ul>\n );\n\n return (\n <div {...props} className={className} data-fs-footer-link-group=\"\">\n <AccordionRoot data-fs-footer-link-group-accordion=\"\">\n <AccordionItem value={ACCORDION_ITEM_VALUE}>\n <AccordionHeader data-fs-footer-link-group-heading=\"\">\n <AccordionTrigger data-fs-text=\"\" data-fs-footer-link-group-trigger=\"\">\n {groupHeading}\n </AccordionTrigger>\n </AccordionHeader>\n {/* `hiddenUntilFound` requires the panel to stay mounted while closed, and the wrapper\n defaults `keepMounted` to false, so passing it keeps Base UI from warning about the pair. */}\n <AccordionPanel hiddenUntilFound keepMounted data-fs-footer-link-group-panel=\"\">\n {list}\n </AccordionPanel>\n </AccordionItem>\n </AccordionRoot>\n <div data-fs-footer-link-group-column=\"\">\n <h3 data-fs-text=\"\" data-fs-footer-link-group-heading=\"\">\n {groupHeading}\n </h3>\n {list}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;AAiBA,MAAa,yBAAyB,kBAAkB;CACtD,IAAI;CACJ,OAAO;CACP,aAAa;CACb,QAAQ;EACN,MAAM;EACN,sBAAsB;EAKtB,YAAY;GACV,SAAS;IAAE,MAAM;IAAU,WAAW;IAAG,OAAO;GAAgB;GAChE,OAAO;IACL,MAAM;IACN,OAAO;IACP,UAAU;IACV,OAAO;KACL,MAAM;KACN,sBAAsB;KACtB,UAAU,CAAC,SAAS,MAAM;KAC1B,YAAY;MACV,OAAO;OAAE,MAAM;OAAU,WAAW;OAAG,OAAO;MAAQ;MACtD,MAAM;OACJ,MAAM;OACN,WAAW;OACX,OAAO;OACP,QAAQ;OAIR,SAAS;MACX;MACA,QAAQ;OAAE,MAAM;OAAU,MAAM,CAAC,SAAS,QAAQ;OAAG,SAAS;OAAS,OAAO;MAAU;KAC1F;IACF;GACF;EACF;CACF;AACF,CAAC;AA4BD,MAAa,4BAA4B,gBAAgB;CACvD,MAAM;CACN,YAAY;CACZ,WAAW;CACX,SAAS;CACT,QAAQ;EAAE,OAAO;EAAqB,UAAU;CAAa;CAC7D,QAAQ;EACN,SAAS;GAAE,MAAM;GAAU,OAAO;EAAgB;EAClD,OAAO;GAAE,MAAM;GAAS,OAAO;EAAQ;CACzC;CACA,WACE;AACJ,CAAC;AAaD,SAAS,UACP,SACA,UACgC;CAChC,IAAI,YAAY,KAAA,GAAW,OAAO;CAClC,OAAO,YAAY,CAAC;AACtB;AAEA,SAAS,mBAAmB,MAAwB,OAAwC;CAC1F,IAAI,OAAO,SAAS,UAAU,OAAO;CAErC,MAAM,cAAc,gBAAgB,IAAI;CACxC,IAAI,CAAC,YAAY,MAAM;EAErB,QAAQ,KAAK,+CAA+C;GAAE;GAAO,QA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AAA;KAAiB,aAAA;KAAY,mCAAgC;KAC1E,UAAA;IACa,CAAA,CACH;;EACF,CAAA,GACf,qBAAC,OAAD;GAAK,oCAAiC;GAAtC,UAAA,CACE,oBAAC,MAAD;IAAI,gBAAa;IAAG,qCAAkC;IACnD,UAAA;GACC,CAAA,GACH,IACE;EACF,CAAA,CAAA;;AAET"}
1
+ {"version":3,"file":"footer-link-group.js","names":[],"sources":["../../../src/particles/footer-link-group/footer-link-group.tsx"],"sourcesContent":["import { type ContentValue, defineComponent, defineContentType } from '@vtex/fs-core';\nimport type { ComponentPropsWithRef } from 'react';\nimport type { PageRef } from '../../sdk/navigation/types.js';\nimport { resolveSafeHref } from '../../utils/safe-href.js';\nimport {\n AccordionHeader,\n AccordionItem,\n AccordionPanel,\n AccordionRoot,\n AccordionTrigger,\n} from '../accordion/accordion.js';\nimport { NavigationLink } from '../navigation-link/navigation-link.js';\n\n// ---------------------------------------------------------------------------\n// Content model\n// ---------------------------------------------------------------------------\n\nexport const FooterLinkGroupContent = defineContentType({\n id: 'footer-link-group',\n title: 'Footer Link Group',\n description: 'A heading and its ordered list of institutional links.',\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. The\n // render gate holds the heading invariant instead, being the only point that sees both channels.\n properties: {\n heading: { type: 'string', minLength: 1, title: 'Group heading' },\n links: {\n type: 'array',\n title: 'Links',\n minItems: 1,\n items: {\n type: 'object',\n additionalProperties: false,\n required: ['label', 'href'],\n properties: {\n label: { type: 'string', minLength: 1, title: 'Label' },\n href: {\n type: 'string',\n minLength: 1,\n title: 'URL',\n format: 'uri-reference',\n // Author-time guidance only, and deliberately lookahead-free: nothing in this repo\n // compiles it, so its one consumer is the Content Platform Admin's form, whose regex\n // engine may be an RE2 family that rejects lookahead outright.\n pattern: '^(?:https?://.*|mailto:.+|tel:.+|/(?:[^/].*)?)$',\n },\n target: { type: 'string', enum: ['_self', '_blank'], default: '_self', title: 'Open in' },\n },\n },\n },\n },\n },\n});\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\ntype FooterLinkGroupContentValue = ContentValue<typeof FooterLinkGroupContent>;\n\ntype FooterLinkGroupContentLink = NonNullable<FooterLinkGroupContentValue['links']>[number];\n\n/** One authored link. The prop accepts a page reference; a CMS href stays a string. */\nexport type FooterLinkGroupLink = Omit<FooterLinkGroupContentLink, 'href'> & {\n href: PageRef | string;\n};\n\nexport type FooterLinkGroupProps = ComponentPropsWithRef<'div'> & {\n /** Authored fallback for the group heading, used when no CMS entry supplies one. */\n heading?: string;\n /** Authored fallback for the link list, used when no CMS entry supplies one. */\n links?: readonly FooterLinkGroupLink[];\n /** Injected by the compiler, sliced from the page's or layout's composite content entry. */\n $content?: FooterLinkGroupContentValue;\n};\n\n// ---------------------------------------------------------------------------\n// Definition\n// ---------------------------------------------------------------------------\n\nexport const FooterLinkGroupDefinition = defineComponent({\n name: 'FooterLinkGroup',\n importPath: '@vtex/faststore/components',\n component: FooterLinkGroup,\n content: FooterLinkGroupContent,\n editor: { label: 'Footer Link Group', category: 'navigation' },\n schema: {\n heading: { type: 'string', label: 'Group heading' },\n links: { type: 'array', label: 'Links' },\n },\n guideline:\n \"One heading and its institutional links, both CMS-editable. Renders as a desktop column and a mobile accordion at the same time; the store's swatch pair decides which one a breakpoint shows. See footer-link-group.md.\",\n});\n\n// ---------------------------------------------------------------------------\n// Implementation\n// ---------------------------------------------------------------------------\n\n/** A resolved link, ready for both forms. A null `href` is a destination the allowlist refused. */\ntype ResolvedLink = {\n label: string;\n href: PageRef | string | null;\n target: FooterLinkGroupLink['target'];\n};\n\nfunction readLinks(\n content: readonly FooterLinkGroupContentLink[] | undefined,\n authored: readonly FooterLinkGroupLink[] | undefined,\n): readonly FooterLinkGroupLink[] {\n if (content !== undefined) return content;\n return authored ?? [];\n}\n\nfunction resolveDestination(href: PageRef | string, index: number): PageRef | string | null {\n if (typeof href !== 'string') return href;\n\n const destination = resolveSafeHref(href);\n if (!destination.safe) {\n // A bounded reason and no authored value, the convention the content runtime's own log follows.\n console.warn('[FooterLinkGroup] link destination rejected', { index, reason: destination.reason });\n return null;\n }\n return destination.href;\n}\n\n/** Unique within its own root, and every group renders its own root. */\nconst ACCORDION_ITEM_VALUE = 'links';\n\n/**\n * Resolves the whole list once per render, so both forms show the same links and a refused\n * destination logs one line rather than two.\n */\nfunction resolveLinks(links: readonly FooterLinkGroupLink[]): ResolvedLink[] {\n const resolved: ResolvedLink[] = [];\n\n links.forEach((link, index) => {\n // `minLength` is enforced by neither the runtime slice nor the preflight, so a blank label\n // reaches the component. Drop the link: an anchor with no accessible name is a WCAG failure.\n if (link.label.trim().length === 0) {\n return;\n }\n resolved.push({\n label: link.label,\n href: resolveDestination(link.href, index),\n target: link.target,\n });\n });\n\n return resolved;\n}\n\nexport function FooterLinkGroup({ heading, links, $content, className, ...props }: FooterLinkGroupProps) {\n const groupHeading = $content?.heading ?? heading;\n // An entry supplying `links: []` beats an authored prop: a merchant who cleared the list cleared it.\n const resolved = resolveLinks(readLinks($content?.links, links));\n\n if (!groupHeading?.trim() || resolved.length === 0) {\n return null;\n }\n\n // One element rendered in both forms, so the two cannot drift.\n const list = (\n <ul data-fs-footer-link-group-list=\"\">\n {resolved.map((link, index) => (\n <li key={index} data-fs-footer-link-group-item=\"\">\n {link.href === null ? (\n <span data-fs-text=\"\" data-fs-footer-link-group-text=\"\">\n {link.label}\n </span>\n ) : (\n <NavigationLink href={link.href} target={link.target} data-fs-footer-link-group-link=\"\">\n {link.label}\n </NavigationLink>\n )}\n </li>\n ))}\n </ul>\n );\n\n return (\n <div {...props} className={className} data-fs-footer-link-group=\"\">\n {/* Base UI makes the root a `region`; an unnamed one repeats once per group. A `group` keeps the\n grouping and adds no landmark. */}\n <AccordionRoot role=\"group\" data-fs-footer-link-group-accordion=\"\">\n <AccordionItem value={ACCORDION_ITEM_VALUE}>\n <AccordionHeader data-fs-footer-link-group-heading=\"\">\n <AccordionTrigger data-fs-text=\"\" data-fs-footer-link-group-trigger=\"\">\n {groupHeading}\n </AccordionTrigger>\n </AccordionHeader>\n {/* `hiddenUntilFound` requires the panel to stay mounted while closed, and the wrapper\n defaults `keepMounted` to false, so passing it keeps Base UI from warning about the pair. */}\n <AccordionPanel hiddenUntilFound keepMounted data-fs-footer-link-group-panel=\"\">\n {list}\n </AccordionPanel>\n </AccordionItem>\n </AccordionRoot>\n <div data-fs-footer-link-group-column=\"\">\n <h3 data-fs-text=\"\" data-fs-footer-link-group-heading=\"\">\n {groupHeading}\n </h3>\n {list}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;AAiBA,MAAa,yBAAyB,kBAAkB;CACtD,IAAI;CACJ,OAAO;CACP,aAAa;CACb,QAAQ;EACN,MAAM;EACN,sBAAsB;EAKtB,YAAY;GACV,SAAS;IAAE,MAAM;IAAU,WAAW;IAAG,OAAO;GAAgB;GAChE,OAAO;IACL,MAAM;IACN,OAAO;IACP,UAAU;IACV,OAAO;KACL,MAAM;KACN,sBAAsB;KACtB,UAAU,CAAC,SAAS,MAAM;KAC1B,YAAY;MACV,OAAO;OAAE,MAAM;OAAU,WAAW;OAAG,OAAO;MAAQ;MACtD,MAAM;OACJ,MAAM;OACN,WAAW;OACX,OAAO;OACP,QAAQ;OAIR,SAAS;MACX;MACA,QAAQ;OAAE,MAAM;OAAU,MAAM,CAAC,SAAS,QAAQ;OAAG,SAAS;OAAS,OAAO;MAAU;KAC1F;IACF;GACF;EACF;CACF;AACF,CAAC;AA4BD,MAAa,4BAA4B,gBAAgB;CACvD,MAAM;CACN,YAAY;CACZ,WAAW;CACX,SAAS;CACT,QAAQ;EAAE,OAAO;EAAqB,UAAU;CAAa;CAC7D,QAAQ;EACN,SAAS;GAAE,MAAM;GAAU,OAAO;EAAgB;EAClD,OAAO;GAAE,MAAM;GAAS,OAAO;EAAQ;CACzC;CACA,WACE;AACJ,CAAC;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AkB;EAAW,6BAA0B;EAAhE,UAAA,CAGE,oBAAC,eAAD;GAAe,MAAK;GAAQ,uCAAoC;GAC9D,UAAA,qBAAC,eAAD;IAAe,OAAO;IAAtB,UAAA,CACE,oBAAC,iBAAD;KAAiB,qCAAkC;KACjD,UAAA,oBAAC,kBAAD;MAAkB,gBAAa;MAAG,qCAAkC;MACjE,UAAA;KACe,CAAA;IACH,CAAA,GAGjB,oBAAC,gBAAD;KAAgB,kBAAA;KAAiB,aAAA;KAAY,mCAAgC;KAC1E,UAAA;IACa,CAAA,CACH;;EACF,CAAA,GACf,qBAAC,OAAD;GAAK,oCAAiC;GAAtC,UAAA,CACE,oBAAC,MAAD;IAAI,gBAAa;IAAG,qCAAkC;IACnD,UAAA;GACC,CAAA,GACH,IACE;EACF,CAAA,CAAA;;AAET"}
@@ -57,7 +57,7 @@ export declare const FooterSocialContent: {
57
57
  };
58
58
  /**
59
59
  * The platform glyphs `platform` admits, every one verified to resolve. Exported because a store's
60
- * `global.json` has to list them under `icons.include` for a CMS-chosen name to resolve at runtime —
60
+ * foundation has to list them under `icons.include` for a CMS-chosen name to resolve at runtime —
61
61
  * one import there instead of five retyped strings. Reading it off the model rather than declaring it
62
62
  * beside one makes the two impossible to drift apart.
63
63
  */
@@ -65,7 +65,7 @@ const FooterSocialContent = defineContentType({
65
65
  });
66
66
  /**
67
67
  * The platform glyphs `platform` admits, every one verified to resolve. Exported because a store's
68
- * `global.json` has to list them under `icons.include` for a CMS-chosen name to resolve at runtime —
68
+ * foundation has to list them under `icons.include` for a CMS-chosen name to resolve at runtime —
69
69
  * one import there instead of five retyped strings. Reading it off the model rather than declaring it
70
70
  * beside one makes the two impossible to drift apart.
71
71
  */
@@ -1 +1 @@
1
- {"version":3,"file":"footer-social.js","names":[],"sources":["../../../src/particles/footer-social/footer-social.tsx"],"sourcesContent":["import { type ContentValue, defineComponent, defineContentType } from '@vtex/fs-core';\nimport type { ComponentPropsWithRef } from 'react';\nimport { resolveSafeHref } from '../../utils/safe-href.js';\nimport { Icon } from '../icon/icon.js';\nimport { Image } from '../image/image.js';\nimport { NavigationLink } from '../navigation-link/navigation-link.js';\n\n// ---------------------------------------------------------------------------\n// Content model\n// ---------------------------------------------------------------------------\n\nexport const FooterSocialContent = defineContentType({\n id: 'footer-social',\n title: 'Footer Social',\n description: \"Links to the store's official social profiles, shown as a row of platform 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 entries: {\n type: 'array',\n title: 'Social profiles',\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 brand is on as many platforms as it is on.\n minItems: 1,\n items: {\n type: 'object',\n additionalProperties: false,\n required: ['label', 'url'],\n properties: {\n // Inline rather than a named constant: the catalog scanner reads this file statically\n // and rejects an identifier it cannot evaluate. `SOCIAL_PLATFORM_NAMES` derives from here.\n // Every name resolves: facebook, instagram and pinterest through the base dialect's\n // embedded floor, linkedin and youtube only through a provisioned lucide. No twitter —\n // both vocabularies still draw the old bird, and an enum member cannot be narrowed once\n // published, so Twitter/X rides iconUrl alongside TikTok and WhatsApp.\n platform: {\n type: 'string',\n enum: ['facebook', 'instagram', 'linkedin', 'pinterest', 'youtube'],\n title: 'Platform',\n },\n url: {\n type: 'string',\n minLength: 1,\n title: 'Profile URL',\n format: 'uri-reference',\n // Author-time guidance only, and deliberately identical to FooterLinkGroup's: the Admin\n // form must not reject a destination `resolveSafeHref` would have accepted. Lookahead-free\n // because the Admin's regex engine may be an RE2 family that rejects lookahead outright.\n pattern: '^(?:https?://.*|mailto:.+|tel:.+|/(?:[^/].*)?)$',\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 platform glyphs `platform` admits, every one verified to resolve. Exported because a store's\n * `global.json` has to list them under `icons.include` for a CMS-chosen name to resolve at runtime —\n * one import there instead of five retyped strings. Reading it off the model rather than declaring it\n * beside one makes the two impossible to drift apart.\n */\nexport const SOCIAL_PLATFORM_NAMES = FooterSocialContent.schema.properties.entries.items.properties.platform.enum;\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\ntype FooterSocialContentValue = ContentValue<typeof FooterSocialContent>;\n\n/** One profile in the row. Derived from the model so the prop and content channels cannot drift. */\nexport type FooterSocialEntry = NonNullable<FooterSocialContentValue['entries']>[number];\n\ntype SocialPlatformName = NonNullable<FooterSocialEntry['platform']>;\n\nexport type FooterSocialProps = ComponentPropsWithRef<'div'> & {\n /** Authored fallback for the section heading, used when no CMS entry supplies one. */\n heading?: string;\n /** Authored fallback for the profile list, used when no CMS entry supplies one. */\n entries?: readonly FooterSocialEntry[];\n /** Injected by the compiler, sliced from the page's or layout's composite content entry. */\n $content?: FooterSocialContentValue;\n};\n\n// ---------------------------------------------------------------------------\n// Definition\n// ---------------------------------------------------------------------------\n\nexport const FooterSocialDefinition = defineComponent({\n name: 'FooterSocial',\n importPath: '@vtex/faststore/components',\n component: FooterSocial,\n content: FooterSocialContent,\n editor: { label: 'Footer Social', category: 'navigation' },\n schema: {\n heading: { type: 'string', label: 'Heading' },\n entries: { type: 'array', label: 'Social profiles' },\n },\n guideline:\n \"The store's official social profiles as a row of icon links, both the heading and the list CMS-editable. Every link opens in a new tab. Every predefined platform name must be listed in the store's icons.include. See footer-social.md.\",\n});\n\n// ---------------------------------------------------------------------------\n// Implementation\n// ---------------------------------------------------------------------------\n\n/**\n * An entry that can render: a non-blank label, one glyph source, and a destination the allowlist\n * either cleared or refused. The render branches on `href` first — a null one renders the label as\n * text and no glyph at all — so on that path the glyph source survives only to key the discriminator.\n */\ntype ResolvedEntry =\n | { label: string; href: string | null; platform: SocialPlatformName; src?: undefined }\n | { label: string; href: string | null; platform?: SocialPlatformName; src: string };\n\n/**\n * Drops every entry that cannot render both a glyph and an accessible name, then vets what is left.\n * Neither read-time gate enforces `minLength`, so a blank label reaches the component, and `platform`\n * is optional so TikTok can arrive through `iconUrl` — which leaves an entry carrying neither, also\n * legal and also unrenderable. An icon with no name is the one thing F3 must not ship.\n *\n * Renderability is settled before the destination is looked at, so a dropped entry never logs: the\n * filter answers whether this is a social entry at all, and the destination only decides which form\n * it takes.\n */\nfunction resolveEntries(entries: readonly FooterSocialEntry[]): ResolvedEntry[] {\n const resolved: ResolvedEntry[] = [];\n\n entries.forEach((entry, index) => {\n if (!entry.label.trim() || !(entry.iconUrl?.trim() || entry.platform)) {\n return;\n }\n\n const destination = resolveSafeHref(entry.url);\n if (!destination.safe) {\n // A bounded reason and no authored value, the convention the content runtime's own log follows.\n console.warn('[FooterSocial] link destination rejected', { index, reason: destination.reason });\n }\n const href = destination.safe ? destination.href : null;\n\n if (entry.iconUrl?.trim()) {\n resolved.push({ label: entry.label, href, platform: entry.platform, src: entry.iconUrl });\n } else if (entry.platform) {\n resolved.push({ label: entry.label, href, platform: entry.platform });\n }\n });\n\n return resolved;\n}\n\nexport function FooterSocial({ heading, entries, $content, className, ...props }: FooterSocialProps) {\n const sectionHeading = $content?.heading ?? heading;\n // An entry supplying `entries: []` beats an authored prop: a merchant who cleared the row cleared it.\n const resolved = resolveEntries($content?.entries ?? entries ?? []);\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-footer-social=\"\">\n {named ? (\n <h3 data-fs-text=\"\" data-fs-footer-social-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-footer-social-list=\"\" aria-label={named ? sectionHeading : undefined}>\n {resolved.map((entry, index) => (\n <li key={index} data-fs-footer-social-item=\"\" data-fs-footer-social-platform={entry.platform}>\n {entry.href === null ? (\n <span data-fs-text=\"\" data-fs-footer-social-text=\"\">\n {entry.label}\n </span>\n ) : (\n <NavigationLink href={entry.href} target=\"_blank\" data-fs-footer-social-link=\"\">\n {entry.src === undefined ? (\n <>\n <Icon name={entry.platform} data-fs-footer-social-icon=\"\" />\n <span data-fs-sr-only=\"\" className=\"sr-only\">\n {entry.label}\n </span>\n </>\n ) : (\n <Image src={entry.src} alt={entry.label} data-fs-footer-social-icon=\"\" />\n )}\n </NavigationLink>\n )}\n </li>\n ))}\n </ul>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;AAWA,MAAa,sBAAsB,kBAAkB;CACnD,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,SAAS,KAAK;KACzB,YAAY;MAOV,UAAU;OACR,MAAM;OACN,MAAM;QAAC;QAAY;QAAa;QAAY;QAAa;OAAS;OAClE,OAAO;MACT;MACA,KAAK;OACH,MAAM;OACN,WAAW;OACX,OAAO;OACP,QAAQ;OAIR,SAAS;MACX;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,wBAAwB,oBAAoB,OAAO,WAAW,QAAQ,MAAM,WAAW,SAAS;AA0B7G,MAAa,yB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AAI,MAAK;GAAO,8BAA2B;GAAG,cAAY,QAAQ,iBAAiB,KAAA;GAChF,UAAA,SAAS,KAAK,OAAO,UACpB,oBAAC,MAAD;IAAgB,8BAA2B;IAAG,kCAAgC,MAAM;IACjF,UAAA,MAAM,SAAS,OACd,oBAAC,QAAD;KAAM,gBAAa;KAAG,8BAA2B;KAC9C,UAAA,MAAM;IACH,CAAA,IAEN,oBAAC,gBAAD;KAAgB,MAAM,MAAM;KAAM,QAAO;KAAS,8BAA2B;KAC1E,UAAA,MAAM,QAAQ,KAAA,IACb,qBAAA,UAAA,EAAA,UAAA,CACE,oBAAC,MAAD;MAAM,MAAM,MAAM;MAAU,8BAA2B;KAAI,CAAA,GAC3D,oBAAC,QAAD;MAAM,mBAAgB;MAAG,WAAU;MAChC,UAAA,MAAM;KACH,CAAA,CACN,EAAA,CAAA,IAEF,oBAAC,OAAD;MAAO,KAAK,MAAM;MAAK,KAAK,MAAM;MAAO,8BAA2B;KAAI,CAAA;IAE5D,CAAA;GAEhB,GAnBK,KAmBL,CACL;EACC,CAAA,CACD;;AAET"}
1
+ {"version":3,"file":"footer-social.js","names":[],"sources":["../../../src/particles/footer-social/footer-social.tsx"],"sourcesContent":["import { type ContentValue, defineComponent, defineContentType } from '@vtex/fs-core';\nimport type { ComponentPropsWithRef } from 'react';\nimport { resolveSafeHref } from '../../utils/safe-href.js';\nimport { Icon } from '../icon/icon.js';\nimport { Image } from '../image/image.js';\nimport { NavigationLink } from '../navigation-link/navigation-link.js';\n\n// ---------------------------------------------------------------------------\n// Content model\n// ---------------------------------------------------------------------------\n\nexport const FooterSocialContent = defineContentType({\n id: 'footer-social',\n title: 'Footer Social',\n description: \"Links to the store's official social profiles, shown as a row of platform 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 entries: {\n type: 'array',\n title: 'Social profiles',\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 brand is on as many platforms as it is on.\n minItems: 1,\n items: {\n type: 'object',\n additionalProperties: false,\n required: ['label', 'url'],\n properties: {\n // Inline rather than a named constant: the catalog scanner reads this file statically\n // and rejects an identifier it cannot evaluate. `SOCIAL_PLATFORM_NAMES` derives from here.\n // Every name resolves: facebook, instagram and pinterest through the base dialect's\n // embedded floor, linkedin and youtube only through a provisioned lucide. No twitter —\n // both vocabularies still draw the old bird, and an enum member cannot be narrowed once\n // published, so Twitter/X rides iconUrl alongside TikTok and WhatsApp.\n platform: {\n type: 'string',\n enum: ['facebook', 'instagram', 'linkedin', 'pinterest', 'youtube'],\n title: 'Platform',\n },\n url: {\n type: 'string',\n minLength: 1,\n title: 'Profile URL',\n format: 'uri-reference',\n // Author-time guidance only, and deliberately identical to FooterLinkGroup's: the Admin\n // form must not reject a destination `resolveSafeHref` would have accepted. Lookahead-free\n // because the Admin's regex engine may be an RE2 family that rejects lookahead outright.\n pattern: '^(?:https?://.*|mailto:.+|tel:.+|/(?:[^/].*)?)$',\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 platform glyphs `platform` admits, every one verified to resolve. Exported because a store's\n * foundation has to list them under `icons.include` for a CMS-chosen name to resolve at runtime —\n * one import there instead of five retyped strings. Reading it off the model rather than declaring it\n * beside one makes the two impossible to drift apart.\n */\nexport const SOCIAL_PLATFORM_NAMES = FooterSocialContent.schema.properties.entries.items.properties.platform.enum;\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\ntype FooterSocialContentValue = ContentValue<typeof FooterSocialContent>;\n\n/** One profile in the row. Derived from the model so the prop and content channels cannot drift. */\nexport type FooterSocialEntry = NonNullable<FooterSocialContentValue['entries']>[number];\n\ntype SocialPlatformName = NonNullable<FooterSocialEntry['platform']>;\n\nexport type FooterSocialProps = ComponentPropsWithRef<'div'> & {\n /** Authored fallback for the section heading, used when no CMS entry supplies one. */\n heading?: string;\n /** Authored fallback for the profile list, used when no CMS entry supplies one. */\n entries?: readonly FooterSocialEntry[];\n /** Injected by the compiler, sliced from the page's or layout's composite content entry. */\n $content?: FooterSocialContentValue;\n};\n\n// ---------------------------------------------------------------------------\n// Definition\n// ---------------------------------------------------------------------------\n\nexport const FooterSocialDefinition = defineComponent({\n name: 'FooterSocial',\n importPath: '@vtex/faststore/components',\n component: FooterSocial,\n content: FooterSocialContent,\n editor: { label: 'Footer Social', category: 'navigation' },\n schema: {\n heading: { type: 'string', label: 'Heading' },\n entries: { type: 'array', label: 'Social profiles' },\n },\n guideline:\n \"The store's official social profiles as a row of icon links, both the heading and the list CMS-editable. Every link opens in a new tab. Every predefined platform name must be listed in the store's icons.include. See footer-social.md.\",\n});\n\n// ---------------------------------------------------------------------------\n// Implementation\n// ---------------------------------------------------------------------------\n\n/**\n * An entry that can render: a non-blank label, one glyph source, and a destination the allowlist\n * either cleared or refused. The render branches on `href` first — a null one renders the label as\n * text and no glyph at all — so on that path the glyph source survives only to key the discriminator.\n */\ntype ResolvedEntry =\n | { label: string; href: string | null; platform: SocialPlatformName; src?: undefined }\n | { label: string; href: string | null; platform?: SocialPlatformName; src: string };\n\n/**\n * Drops every entry that cannot render both a glyph and an accessible name, then vets what is left.\n * Neither read-time gate enforces `minLength`, so a blank label reaches the component, and `platform`\n * is optional so TikTok can arrive through `iconUrl` — which leaves an entry carrying neither, also\n * legal and also unrenderable. An icon with no name is the one thing F3 must not ship.\n *\n * Renderability is settled before the destination is looked at, so a dropped entry never logs: the\n * filter answers whether this is a social entry at all, and the destination only decides which form\n * it takes.\n */\nfunction resolveEntries(entries: readonly FooterSocialEntry[]): ResolvedEntry[] {\n const resolved: ResolvedEntry[] = [];\n\n entries.forEach((entry, index) => {\n if (!entry.label.trim() || !(entry.iconUrl?.trim() || entry.platform)) {\n return;\n }\n\n const destination = resolveSafeHref(entry.url);\n if (!destination.safe) {\n // A bounded reason and no authored value, the convention the content runtime's own log follows.\n console.warn('[FooterSocial] link destination rejected', { index, reason: destination.reason });\n }\n const href = destination.safe ? destination.href : null;\n\n if (entry.iconUrl?.trim()) {\n resolved.push({ label: entry.label, href, platform: entry.platform, src: entry.iconUrl });\n } else if (entry.platform) {\n resolved.push({ label: entry.label, href, platform: entry.platform });\n }\n });\n\n return resolved;\n}\n\nexport function FooterSocial({ heading, entries, $content, className, ...props }: FooterSocialProps) {\n const sectionHeading = $content?.heading ?? heading;\n // An entry supplying `entries: []` beats an authored prop: a merchant who cleared the row cleared it.\n const resolved = resolveEntries($content?.entries ?? entries ?? []);\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-footer-social=\"\">\n {named ? (\n <h3 data-fs-text=\"\" data-fs-footer-social-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-footer-social-list=\"\" aria-label={named ? sectionHeading : undefined}>\n {resolved.map((entry, index) => (\n <li key={index} data-fs-footer-social-item=\"\" data-fs-footer-social-platform={entry.platform}>\n {entry.href === null ? (\n <span data-fs-text=\"\" data-fs-footer-social-text=\"\">\n {entry.label}\n </span>\n ) : (\n <NavigationLink href={entry.href} target=\"_blank\" data-fs-footer-social-link=\"\">\n {entry.src === undefined ? (\n <>\n <Icon name={entry.platform} data-fs-footer-social-icon=\"\" />\n <span data-fs-sr-only=\"\" className=\"sr-only\">\n {entry.label}\n </span>\n </>\n ) : (\n <Image src={entry.src} alt={entry.label} data-fs-footer-social-icon=\"\" />\n )}\n </NavigationLink>\n )}\n </li>\n ))}\n </ul>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;AAWA,MAAa,sBAAsB,kBAAkB;CACnD,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,SAAS,KAAK;KACzB,YAAY;MAOV,UAAU;OACR,MAAM;OACN,MAAM;QAAC;QAAY;QAAa;QAAY;QAAa;OAAS;OAClE,OAAO;MACT;MACA,KAAK;OACH,MAAM;OACN,WAAW;OACX,OAAO;OACP,QAAQ;OAIR,SAAS;MACX;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,wBAAwB,oBAAoB,OAAO,WAAW,QAAQ,MAAM,WAAW,SAAS;AA0B7G,MAAa,yBAAyB,gBAAgB;CACpD,MAAM;CACN,YAAY;CACZ,WAAW;CACX,SAAS;CACT,QAAQ;EAAE,OAAO;EAAiB,UAAU;CAAa;CACzD,QAAQ;EACN,SAAS;GAAE,MAAM;GAAU,OAAO;EAAU;EAC5C,SAAS;GAAE,MAAM;GAAS,OAAO;EAAkB;CACrD;CACA,WACE;AACJ,CAAC;;;;;;;;;;;AAyBD,SAAS,eAAe,SAAwD;CAC9E,MAAM,WAA4B,CAAC;CAEnC,QAAQ,SAAS,OAAO,UAAU;EAChC,IAAI,CAAC,MAAM,MAAM,KAAK,KAAK,EAAE,MAAM,SAAS,KAAK,KAA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MAAM,MAAM;MAAU,8BAA2B;KAAI,CAAA,GAC3D,oBAAC,QAAD;MAAM,mBAAgB;MAAG,WAAU;MAChC,UAAA,MAAM;KACH,CAAA,CACN,EAAA,CAAA,IAEF,oBAAC,OAAD;MAAO,KAAK,MAAM;MAAK,KAAK,MAAM;MAAO,8BAA2B;KAAI,CAAA;IAE5D,CAAA;GAEhB,GAnBK,KAmBL,CACL;EACC,CAAA,CACD;;AAET"}
@@ -1,3 +1,4 @@
1
+ import { ContentValue, MessageLocaleProp } from "../../core/dist/define-content-type.js";
1
2
  import { ComponentDefinition } from "../../core/dist/define-component.js";
2
3
  import "../../core/dist/index.js";
3
4
  import { ComponentPropsWithRef, ReactNode } from "react";
@@ -24,7 +25,8 @@ export type FieldsetRegistration = Readonly<{
24
25
  * Must settle: the form gives up on a dispatch still pending after `FORM_DISPATCH_TIMEOUT_MS` and
25
26
  * reports it as a failed write. Must also be idempotent: giving up on a dispatch does not cancel it,
26
27
  * so a timed-out write may already be landing on the server, and the same payload is re-dispatched on
27
- * the shopper's next submit while the field stays dirty.
28
+ * the shopper's next submit while the field stays dirty. Each resolved error's `message` is already
29
+ * worded from the fieldset's own `$content`, keyed on its `code`: `FormError` renders it as is.
28
30
  */
29
31
  dispatch: (payload: Record<string, unknown>) => Promise<readonly FormUserError[]>;
30
32
  /** Shapes react-hook-form's raw values into the mutation's payload, including type coercion. */
@@ -32,7 +34,8 @@ export type FieldsetRegistration = Readonly<{
32
34
  /**
33
35
  * Machine identifier for this fieldset's write. `FormError` renders it as the
34
36
  * `data-fs-form-error-item` attribute value and uses it in two React keys; it is never displayed,
35
- * because the visible text is each `userError`'s own `message` or `FormError`'s `fallbackMessage`.
37
+ * because the visible text is each `userError`'s `message` (the fieldset's own copy) or `FormError`'s
38
+ * `fallbackMessage`.
36
39
  * Its value is the kebab-case ASCII rendering of this registration's own `namespace`
37
40
  * (`shippingAddress` → `shipping-address`), so a stylesheet selecting
38
41
  * `[data-fs-form-error-item="…"]` needs one predictable shape and no diacritics.
@@ -56,30 +59,99 @@ export type FormRegistry = Readonly<{
56
59
  /** Throws when no FormRoot is above the caller. */
57
60
  export declare function useFormRegistry(): FormRegistry;
58
61
  export type FormRootProps = Omit<ComponentPropsWithRef<'form'>, 'onSubmit' | 'action' | 'method' | 'target' | 'encType' | 'dangerouslySetInnerHTML'>;
59
- export type FormSubmitProps = {
62
+ export type FormSubmitProps = MessageLocaleProp & {
63
+ $content?: ContentValue<typeof FormSubmitContent>;
60
64
  className?: string;
61
- label?: string;
62
65
  children?: ReactNode;
63
66
  };
64
- export type FormClearProps = {
67
+ export type FormClearProps = MessageLocaleProp & {
68
+ $content?: ContentValue<typeof FormClearContent>;
65
69
  className?: string;
66
- label?: string;
67
70
  children?: ReactNode;
68
71
  };
69
- export type FormResetProps = {
72
+ export type FormResetProps = MessageLocaleProp & {
73
+ $content?: ContentValue<typeof FormResetContent>;
70
74
  className?: string;
71
- label?: string;
72
75
  children?: ReactNode;
73
76
  };
74
- export type FormErrorProps = {
77
+ export type FormErrorProps = MessageLocaleProp & {
78
+ /** The message shown for a fieldset whose write rejected rather than resolving with userErrors. */
79
+ $content?: ContentValue<typeof FormErrorContent>;
75
80
  className?: string;
76
- fallbackMessage?: string;
77
81
  };
78
82
  export declare const FormRootDefinition: ComponentDefinition<FormRootProps>;
83
+ export declare const FormSubmitContent: {
84
+ readonly id: "form-submit";
85
+ readonly title: "Form Submit";
86
+ readonly description: "Label of the button that submits the form.";
87
+ readonly schema: {
88
+ readonly type: "object";
89
+ readonly additionalProperties: false;
90
+ readonly properties: {
91
+ readonly label: {
92
+ readonly type: "string";
93
+ readonly title: "Label";
94
+ readonly format: "icu-message";
95
+ readonly messageSource: "Continue";
96
+ };
97
+ };
98
+ };
99
+ };
79
100
  export declare const FormSubmitDefinition: ComponentDefinition<FormSubmitProps>;
80
101
  export declare const FormEnterSubmitDefinition: ComponentDefinition<FormSubmitProps>;
102
+ export declare const FormErrorContent: {
103
+ readonly id: "form-error";
104
+ readonly title: "Form Error";
105
+ readonly description: "Message shown for a fieldset whose write failed without saying why.";
106
+ readonly schema: {
107
+ readonly type: "object";
108
+ readonly additionalProperties: false;
109
+ readonly properties: {
110
+ readonly fallbackMessage: {
111
+ readonly type: "string";
112
+ readonly title: "Fallback message";
113
+ readonly format: "icu-message";
114
+ readonly messageSource: "Something went wrong. Please try again.";
115
+ };
116
+ };
117
+ };
118
+ };
81
119
  export declare const FormErrorDefinition: ComponentDefinition<FormErrorProps>;
120
+ export declare const FormClearContent: {
121
+ readonly id: "form-clear";
122
+ readonly title: "Form Clear";
123
+ readonly description: "Label of the button that empties the form's fields.";
124
+ readonly schema: {
125
+ readonly type: "object";
126
+ readonly additionalProperties: false;
127
+ readonly properties: {
128
+ readonly label: {
129
+ readonly type: "string";
130
+ readonly title: "Label";
131
+ readonly format: "icu-message";
132
+ readonly messageSource: "Clear";
133
+ };
134
+ };
135
+ };
136
+ };
82
137
  export declare const FormClearDefinition: ComponentDefinition<FormClearProps>;
138
+ export declare const FormResetContent: {
139
+ readonly id: "form-reset";
140
+ readonly title: "Form Reset";
141
+ readonly description: "Label of the button that returns the form's fields to their baseline.";
142
+ readonly schema: {
143
+ readonly type: "object";
144
+ readonly additionalProperties: false;
145
+ readonly properties: {
146
+ readonly label: {
147
+ readonly type: "string";
148
+ readonly title: "Label";
149
+ readonly format: "icu-message";
150
+ readonly messageSource: "Reset";
151
+ };
152
+ };
153
+ };
154
+ };
83
155
  export declare const FormResetDefinition: ComponentDefinition<FormResetProps>;
84
156
  export declare function FormRoot({ className, children, onKeyDown, ...props }: FormRootProps): ReactNode;
85
157
  export declare function FormSubmit(props: FormSubmitProps): ReactNode;
@@ -89,9 +161,9 @@ export declare function FormSubmit(props: FormSubmitProps): ReactNode;
89
161
  * the IME carve-out.
90
162
  */
91
163
  export declare function FormEnterSubmit(props: FormSubmitProps): ReactNode;
92
- export declare function FormError({ className, fallbackMessage }: FormErrorProps): ReactNode;
93
- export declare function FormClear({ className, label, children }: FormClearProps): ReactNode;
94
- export declare function FormReset({ className, label, children }: FormResetProps): ReactNode;
164
+ export declare function FormError({ $content, className }: FormErrorProps): ReactNode;
165
+ export declare function FormClear({ $content, className, children }: Readonly<FormClearProps>): ReactNode;
166
+ export declare function FormReset({ $content, className, children }: Readonly<FormResetProps>): ReactNode;
95
167
  export declare const Form: {
96
168
  Root: typeof FormRoot;
97
169
  Submit: typeof FormSubmit;