@vtex/faststore 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (538) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/LICENSE +21 -0
  3. package/README.md +95 -0
  4. package/dist/actions.json +334 -0
  5. package/dist/catalog.json +6615 -0
  6. package/dist/client.d.ts +17 -0
  7. package/dist/client.js +8 -0
  8. package/dist/components.d.ts +87 -0
  9. package/dist/components.js +87 -0
  10. package/dist/content-types.json +684 -0
  11. package/dist/core/dist/actions/mock-action.d.ts +24 -0
  12. package/dist/core/dist/actions/mock-action.js +28 -0
  13. package/dist/core/dist/actions/mock-action.js.map +1 -0
  14. package/dist/core/dist/actions/registry.d.ts +24 -0
  15. package/dist/core/dist/actions/registry.js +28 -0
  16. package/dist/core/dist/actions/registry.js.map +1 -0
  17. package/dist/core/dist/define-component.d.ts +100 -0
  18. package/dist/core/dist/define-component.js +8 -0
  19. package/dist/core/dist/define-component.js.map +1 -0
  20. package/dist/core/dist/define-content-type.d.ts +95 -0
  21. package/dist/core/dist/define-content-type.js +283 -0
  22. package/dist/core/dist/define-content-type.js.map +1 -0
  23. package/dist/core/dist/index.d.ts +7 -0
  24. package/dist/core/dist/index.js +5 -0
  25. package/dist/core/dist/schema/generated/schema.d.ts +28 -0
  26. package/dist/core/dist/types.d.ts +1 -0
  27. package/dist/docs/access-code-field.md +100 -0
  28. package/dist/docs/access-code-sign-in.md +174 -0
  29. package/dist/docs/account-entry-point.md +155 -0
  30. package/dist/docs/address-summary.md +50 -0
  31. package/dist/docs/buy-button.md +162 -0
  32. package/dist/docs/carousel.md +105 -0
  33. package/dist/docs/cart-item.md +162 -0
  34. package/dist/docs/cart-totalizer.md +197 -0
  35. package/dist/docs/cart.md +495 -0
  36. package/dist/docs/client-preferences.md +184 -0
  37. package/dist/docs/client-profile-form.md +192 -0
  38. package/dist/docs/client-profile.md +117 -0
  39. package/dist/docs/container.md +97 -0
  40. package/dist/docs/document-field.md +97 -0
  41. package/dist/docs/email-field.md +93 -0
  42. package/dist/docs/email-identification.md +102 -0
  43. package/dist/docs/footer-copyright.md +112 -0
  44. package/dist/docs/footer-link-group.md +162 -0
  45. package/dist/docs/footer-root.md +145 -0
  46. package/dist/docs/footer-social.md +151 -0
  47. package/dist/docs/free-shipping-progress.md +87 -0
  48. package/dist/docs/gallery.md +84 -0
  49. package/dist/docs/header-root.md +150 -0
  50. package/dist/docs/identity-edit.md +88 -0
  51. package/dist/docs/identity-summary.md +106 -0
  52. package/dist/docs/incentives.md +151 -0
  53. package/dist/docs/logo.md +135 -0
  54. package/dist/docs/meter.md +67 -0
  55. package/dist/docs/navigation-link-list.md +171 -0
  56. package/dist/docs/navigation-link.md +163 -0
  57. package/dist/docs/navigation-menu.md +264 -0
  58. package/dist/docs/payment-methods.md +139 -0
  59. package/dist/docs/phone-field.md +106 -0
  60. package/dist/docs/postal-code-field.md +126 -0
  61. package/dist/docs/pricing.md +499 -0
  62. package/dist/docs/product-gallery.md +409 -0
  63. package/dist/docs/product-information.md +295 -0
  64. package/dist/docs/product-list.md +170 -0
  65. package/dist/docs/product-quantity.md +88 -0
  66. package/dist/docs/product-shelf.md +141 -0
  67. package/dist/docs/promotion.md +109 -0
  68. package/dist/docs/region.md +225 -0
  69. package/dist/docs/session.md +123 -0
  70. package/dist/docs/shipping-address.md +390 -0
  71. package/dist/docs/shipping-simulator.md +147 -0
  72. package/dist/docs/sign-in-form.md +117 -0
  73. package/dist/docs/tabs.md +176 -0
  74. package/dist/docs/toast.md +124 -0
  75. package/dist/docs/variant-selector.md +450 -0
  76. package/dist/graphql/define-subgraph.d.ts +12 -0
  77. package/dist/graphql/define-subgraph.js +15 -0
  78. package/dist/graphql/define-subgraph.js.map +1 -0
  79. package/dist/graphql/gql.d.ts +10 -0
  80. package/dist/graphql/gql.js +16 -0
  81. package/dist/graphql/gql.js.map +1 -0
  82. package/dist/graphql/types.d.ts +88 -0
  83. package/dist/graphql.d.ts +4 -0
  84. package/dist/graphql.js +3 -0
  85. package/dist/index.d.ts +19 -0
  86. package/dist/index.js +5 -0
  87. package/dist/internal/client.d.ts +24 -0
  88. package/dist/internal/client.js +23 -0
  89. package/dist/internal/content.d.ts +2 -0
  90. package/dist/internal/content.js +2 -0
  91. package/dist/internal/server.d.ts +7 -0
  92. package/dist/internal/server.js +6 -0
  93. package/dist/matter/access-code-sign-in/access-code-sign-in.d.ts +111 -0
  94. package/dist/matter/access-code-sign-in/access-code-sign-in.js +387 -0
  95. package/dist/matter/access-code-sign-in/access-code-sign-in.js.map +1 -0
  96. package/dist/matter/account-entry-point/account-entry-point.d.ts +64 -0
  97. package/dist/matter/account-entry-point/account-entry-point.js +151 -0
  98. package/dist/matter/account-entry-point/account-entry-point.js.map +1 -0
  99. package/dist/matter/breadcrumb/breadcrumb.d.ts +40 -0
  100. package/dist/matter/breadcrumb/breadcrumb.js +155 -0
  101. package/dist/matter/breadcrumb/breadcrumb.js.map +1 -0
  102. package/dist/matter/buy-button/buy-button.d.ts +95 -0
  103. package/dist/matter/buy-button/buy-button.js +259 -0
  104. package/dist/matter/buy-button/buy-button.js.map +1 -0
  105. package/dist/matter/cart/cart-namespace.d.ts +48 -0
  106. package/dist/matter/cart/cart-namespace.js +50 -0
  107. package/dist/matter/cart/cart-namespace.js.map +1 -0
  108. package/dist/matter/cart/cart.d.ts +312 -0
  109. package/dist/matter/cart/cart.js +1034 -0
  110. package/dist/matter/cart/cart.js.map +1 -0
  111. package/dist/matter/cart-item/cart-item.d.ts +103 -0
  112. package/dist/matter/cart-item/cart-item.js +672 -0
  113. package/dist/matter/cart-item/cart-item.js.map +1 -0
  114. package/dist/matter/cart-item-compositions/cart-item-compositions.d.ts +49 -0
  115. package/dist/matter/cart-item-compositions/cart-item-compositions.js +165 -0
  116. package/dist/matter/cart-item-compositions/cart-item-compositions.js.map +1 -0
  117. package/dist/matter/cart-item-customizations/cart-item-customizations.d.ts +28 -0
  118. package/dist/matter/cart-item-customizations/cart-item-customizations.js +73 -0
  119. package/dist/matter/cart-item-customizations/cart-item-customizations.js.map +1 -0
  120. package/dist/matter/cart-item-discounts/cart-item-discounts.d.ts +33 -0
  121. package/dist/matter/cart-item-discounts/cart-item-discounts.js +70 -0
  122. package/dist/matter/cart-item-discounts/cart-item-discounts.js.map +1 -0
  123. package/dist/matter/cart-item-seller-info/cart-item-seller-info.d.ts +24 -0
  124. package/dist/matter/cart-item-seller-info/cart-item-seller-info.js +54 -0
  125. package/dist/matter/cart-item-seller-info/cart-item-seller-info.js.map +1 -0
  126. package/dist/matter/cart-item-variations/cart-item-variations.d.ts +27 -0
  127. package/dist/matter/cart-item-variations/cart-item-variations.js +69 -0
  128. package/dist/matter/cart-item-variations/cart-item-variations.js.map +1 -0
  129. package/dist/matter/cart-totalizer/cart-totalizer.d.ts +78 -0
  130. package/dist/matter/cart-totalizer/cart-totalizer.js +220 -0
  131. package/dist/matter/cart-totalizer/cart-totalizer.js.map +1 -0
  132. package/dist/matter/client-preferences/client-preferences.d.ts +50 -0
  133. package/dist/matter/client-preferences/client-preferences.js +206 -0
  134. package/dist/matter/client-preferences/client-preferences.js.map +1 -0
  135. package/dist/matter/client-profile/client-profile.d.ts +59 -0
  136. package/dist/matter/client-profile/client-profile.js +185 -0
  137. package/dist/matter/client-profile/client-profile.js.map +1 -0
  138. package/dist/matter/client-profile-form/client-profile-form.d.ts +126 -0
  139. package/dist/matter/client-profile-form/client-profile-form.js +660 -0
  140. package/dist/matter/client-profile-form/client-profile-form.js.map +1 -0
  141. package/dist/matter/delivery-options/delivery-options-accordion.d.ts +30 -0
  142. package/dist/matter/delivery-options/delivery-options-accordion.js +189 -0
  143. package/dist/matter/delivery-options/delivery-options-accordion.js.map +1 -0
  144. package/dist/matter/delivery-options/delivery-options-controller.d.ts +49 -0
  145. package/dist/matter/delivery-options/delivery-options-controller.js +203 -0
  146. package/dist/matter/delivery-options/delivery-options-controller.js.map +1 -0
  147. package/dist/matter/delivery-options/delivery-options.d.ts +31 -0
  148. package/dist/matter/delivery-options/delivery-options.js +103 -0
  149. package/dist/matter/delivery-options/delivery-options.js.map +1 -0
  150. package/dist/matter/delivery-options/use-delivery-option-selection.d.ts +9 -0
  151. package/dist/matter/delivery-options/use-delivery-option-selection.js +76 -0
  152. package/dist/matter/delivery-options/use-delivery-option-selection.js.map +1 -0
  153. package/dist/matter/email-identification/email-identification.d.ts +37 -0
  154. package/dist/matter/email-identification/email-identification.js +111 -0
  155. package/dist/matter/email-identification/email-identification.js.map +1 -0
  156. package/dist/matter/free-shipping-progress/free-shipping-progress.d.ts +44 -0
  157. package/dist/matter/free-shipping-progress/free-shipping-progress.js +170 -0
  158. package/dist/matter/free-shipping-progress/free-shipping-progress.js.map +1 -0
  159. package/dist/matter/identity-edit/identity-edit.d.ts +52 -0
  160. package/dist/matter/identity-edit/identity-edit.js +148 -0
  161. package/dist/matter/identity-edit/identity-edit.js.map +1 -0
  162. package/dist/matter/identity-summary/identity-summary.d.ts +128 -0
  163. package/dist/matter/identity-summary/identity-summary.js +344 -0
  164. package/dist/matter/identity-summary/identity-summary.js.map +1 -0
  165. package/dist/matter/pricing/pricing.d.ts +162 -0
  166. package/dist/matter/pricing/pricing.js +793 -0
  167. package/dist/matter/pricing/pricing.js.map +1 -0
  168. package/dist/matter/product-gallery/product-gallery.d.ts +23 -0
  169. package/dist/matter/product-gallery/product-gallery.js +188 -0
  170. package/dist/matter/product-gallery/product-gallery.js.map +1 -0
  171. package/dist/matter/product-information/product-information.d.ts +61 -0
  172. package/dist/matter/product-information/product-information.js +355 -0
  173. package/dist/matter/product-information/product-information.js.map +1 -0
  174. package/dist/matter/product-list/product-list.d.ts +86 -0
  175. package/dist/matter/product-list/product-list.js +342 -0
  176. package/dist/matter/product-list/product-list.js.map +1 -0
  177. package/dist/matter/product-quantity/product-quantity.d.ts +50 -0
  178. package/dist/matter/product-quantity/product-quantity.js +111 -0
  179. package/dist/matter/product-quantity/product-quantity.js.map +1 -0
  180. package/dist/matter/product-shelf/product-shelf.d.ts +125 -0
  181. package/dist/matter/product-shelf/product-shelf.js +376 -0
  182. package/dist/matter/product-shelf/product-shelf.js.map +1 -0
  183. package/dist/matter/region/region.d.ts +211 -0
  184. package/dist/matter/region/region.js +579 -0
  185. package/dist/matter/region/region.js.map +1 -0
  186. package/dist/matter/session/session.d.ts +58 -0
  187. package/dist/matter/session/session.js +112 -0
  188. package/dist/matter/session/session.js.map +1 -0
  189. package/dist/matter/shipping-address/country-descriptors.js +101 -0
  190. package/dist/matter/shipping-address/country-descriptors.js.map +1 -0
  191. package/dist/matter/shipping-address/shipping-address.d.ts +284 -0
  192. package/dist/matter/shipping-address/shipping-address.js +1036 -0
  193. package/dist/matter/shipping-address/shipping-address.js.map +1 -0
  194. package/dist/matter/shipping-simulator/shipping-simulator.d.ts +143 -0
  195. package/dist/matter/shipping-simulator/shipping-simulator.js +644 -0
  196. package/dist/matter/shipping-simulator/shipping-simulator.js.map +1 -0
  197. package/dist/matter/sign-in-form/sign-in-form.d.ts +79 -0
  198. package/dist/matter/sign-in-form/sign-in-form.js +226 -0
  199. package/dist/matter/sign-in-form/sign-in-form.js.map +1 -0
  200. package/dist/matter/variant-selector/variant-selector.d.ts +183 -0
  201. package/dist/matter/variant-selector/variant-selector.js +840 -0
  202. package/dist/matter/variant-selector/variant-selector.js.map +1 -0
  203. package/dist/message-locales.json +7 -0
  204. package/dist/particles/access-code-field/access-code-field.d.ts +33 -0
  205. package/dist/particles/access-code-field/access-code-field.js +95 -0
  206. package/dist/particles/access-code-field/access-code-field.js.map +1 -0
  207. package/dist/particles/accordion/accordion.d.ts +45 -0
  208. package/dist/particles/accordion/accordion.js +156 -0
  209. package/dist/particles/accordion/accordion.js.map +1 -0
  210. package/dist/particles/address-summary/address-summary.d.ts +50 -0
  211. package/dist/particles/address-summary/address-summary.js +129 -0
  212. package/dist/particles/address-summary/address-summary.js.map +1 -0
  213. package/dist/particles/badge/badge.d.ts +10 -0
  214. package/dist/particles/badge/badge.js +27 -0
  215. package/dist/particles/badge/badge.js.map +1 -0
  216. package/dist/particles/button/button.d.ts +18 -0
  217. package/dist/particles/button/button.js +37 -0
  218. package/dist/particles/button/button.js.map +1 -0
  219. package/dist/particles/carousel/carousel.d.ts +60 -0
  220. package/dist/particles/carousel/carousel.js +335 -0
  221. package/dist/particles/carousel/carousel.js.map +1 -0
  222. package/dist/particles/checkbox/checkbox.d.ts +40 -0
  223. package/dist/particles/checkbox/checkbox.js +82 -0
  224. package/dist/particles/checkbox/checkbox.js.map +1 -0
  225. package/dist/particles/container/container.d.ts +20 -0
  226. package/dist/particles/container/container.js +36 -0
  227. package/dist/particles/container/container.js.map +1 -0
  228. package/dist/particles/dialog/dialog.d.ts +54 -0
  229. package/dist/particles/dialog/dialog.js +192 -0
  230. package/dist/particles/dialog/dialog.js.map +1 -0
  231. package/dist/particles/document-field/document-field.d.ts +61 -0
  232. package/dist/particles/document-field/document-field.js +146 -0
  233. package/dist/particles/document-field/document-field.js.map +1 -0
  234. package/dist/particles/drawer/drawer.d.ts +52 -0
  235. package/dist/particles/drawer/drawer.js +183 -0
  236. package/dist/particles/drawer/drawer.js.map +1 -0
  237. package/dist/particles/email-field/email-field.d.ts +37 -0
  238. package/dist/particles/email-field/email-field.js +106 -0
  239. package/dist/particles/email-field/email-field.js.map +1 -0
  240. package/dist/particles/field/field.d.ts +50 -0
  241. package/dist/particles/field/field.js +133 -0
  242. package/dist/particles/field/field.js.map +1 -0
  243. package/dist/particles/fieldset/fieldset.d.ts +16 -0
  244. package/dist/particles/fieldset/fieldset.js +52 -0
  245. package/dist/particles/fieldset/fieldset.js.map +1 -0
  246. package/dist/particles/footer-copyright/footer-copyright.d.ts +32 -0
  247. package/dist/particles/footer-copyright/footer-copyright.js +50 -0
  248. package/dist/particles/footer-copyright/footer-copyright.js.map +1 -0
  249. package/dist/particles/footer-link-group/footer-link-group.d.ts +66 -0
  250. package/dist/particles/footer-link-group/footer-link-group.js +154 -0
  251. package/dist/particles/footer-link-group/footer-link-group.js.map +1 -0
  252. package/dist/particles/footer-root/footer-root.d.ts +21 -0
  253. package/dist/particles/footer-root/footer-root.js +38 -0
  254. package/dist/particles/footer-root/footer-root.js.map +1 -0
  255. package/dist/particles/footer-social/footer-social.d.ts +79 -0
  256. package/dist/particles/footer-social/footer-social.js +176 -0
  257. package/dist/particles/footer-social/footer-social.js.map +1 -0
  258. package/dist/particles/gallery/gallery.d.ts +181 -0
  259. package/dist/particles/gallery/gallery.js +920 -0
  260. package/dist/particles/gallery/gallery.js.map +1 -0
  261. package/dist/particles/header-root/header-root.d.ts +21 -0
  262. package/dist/particles/header-root/header-root.js +38 -0
  263. package/dist/particles/header-root/header-root.js.map +1 -0
  264. package/dist/particles/icon/icon.d.ts +22 -0
  265. package/dist/particles/icon/icon.js +48 -0
  266. package/dist/particles/icon/icon.js.map +1 -0
  267. package/dist/particles/image/image.d.ts +13 -0
  268. package/dist/particles/image/image.js +59 -0
  269. package/dist/particles/image/image.js.map +1 -0
  270. package/dist/particles/incentives/incentives.d.ts +85 -0
  271. package/dist/particles/incentives/incentives.js +200 -0
  272. package/dist/particles/incentives/incentives.js.map +1 -0
  273. package/dist/particles/input/input.d.ts +9 -0
  274. package/dist/particles/input/input.js +28 -0
  275. package/dist/particles/input/input.js.map +1 -0
  276. package/dist/particles/logo/logo.d.ts +55 -0
  277. package/dist/particles/logo/logo.js +96 -0
  278. package/dist/particles/logo/logo.js.map +1 -0
  279. package/dist/particles/menu/menu.d.ts +103 -0
  280. package/dist/particles/menu/menu.js +409 -0
  281. package/dist/particles/menu/menu.js.map +1 -0
  282. package/dist/particles/menubar/menubar.d.ts +18 -0
  283. package/dist/particles/menubar/menubar.js +42 -0
  284. package/dist/particles/menubar/menubar.js.map +1 -0
  285. package/dist/particles/meter/meter.d.ts +36 -0
  286. package/dist/particles/meter/meter.js +132 -0
  287. package/dist/particles/meter/meter.js.map +1 -0
  288. package/dist/particles/navigation-link/navigation-link.d.ts +43 -0
  289. package/dist/particles/navigation-link/navigation-link.js +82 -0
  290. package/dist/particles/navigation-link/navigation-link.js.map +1 -0
  291. package/dist/particles/navigation-link-list/navigation-link-list.d.ts +59 -0
  292. package/dist/particles/navigation-link-list/navigation-link-list.js +103 -0
  293. package/dist/particles/navigation-link-list/navigation-link-list.js.map +1 -0
  294. package/dist/particles/navigation-menu/navigation-menu.d.ts +78 -0
  295. package/dist/particles/navigation-menu/navigation-menu.js +295 -0
  296. package/dist/particles/navigation-menu/navigation-menu.js.map +1 -0
  297. package/dist/particles/number-field/number-field.d.ts +46 -0
  298. package/dist/particles/number-field/number-field.js +169 -0
  299. package/dist/particles/number-field/number-field.js.map +1 -0
  300. package/dist/particles/password-field/password-field.d.ts +31 -0
  301. package/dist/particles/password-field/password-field.js +109 -0
  302. package/dist/particles/password-field/password-field.js.map +1 -0
  303. package/dist/particles/payment-methods/payment-methods.d.ts +72 -0
  304. package/dist/particles/payment-methods/payment-methods.js +151 -0
  305. package/dist/particles/payment-methods/payment-methods.js.map +1 -0
  306. package/dist/particles/phone-field/phone-field.d.ts +67 -0
  307. package/dist/particles/phone-field/phone-field.js +250 -0
  308. package/dist/particles/phone-field/phone-field.js.map +1 -0
  309. package/dist/particles/popover/popover.d.ts +68 -0
  310. package/dist/particles/popover/popover.js +284 -0
  311. package/dist/particles/popover/popover.js.map +1 -0
  312. package/dist/particles/postal-code-field/postal-code-field.d.ts +75 -0
  313. package/dist/particles/postal-code-field/postal-code-field.js +169 -0
  314. package/dist/particles/postal-code-field/postal-code-field.js.map +1 -0
  315. package/dist/particles/promotion/promotion.d.ts +46 -0
  316. package/dist/particles/promotion/promotion.js +78 -0
  317. package/dist/particles/promotion/promotion.js.map +1 -0
  318. package/dist/particles/quantity-selector/quantity-selector.d.ts +30 -0
  319. package/dist/particles/quantity-selector/quantity-selector.js +116 -0
  320. package/dist/particles/quantity-selector/quantity-selector.js.map +1 -0
  321. package/dist/particles/radio/radio.d.ts +36 -0
  322. package/dist/particles/radio/radio.js +76 -0
  323. package/dist/particles/radio/radio.js.map +1 -0
  324. package/dist/particles/scroll-area/scroll-area.d.ts +36 -0
  325. package/dist/particles/scroll-area/scroll-area.js +145 -0
  326. package/dist/particles/scroll-area/scroll-area.js.map +1 -0
  327. package/dist/particles/select/select.d.ts +125 -0
  328. package/dist/particles/select/select.js +478 -0
  329. package/dist/particles/select/select.js.map +1 -0
  330. package/dist/particles/separator/separator.d.ts +12 -0
  331. package/dist/particles/separator/separator.js +33 -0
  332. package/dist/particles/separator/separator.js.map +1 -0
  333. package/dist/particles/shared/input-mask.d.ts +5 -0
  334. package/dist/particles/shared/input-mask.js +58 -0
  335. package/dist/particles/shared/input-mask.js.map +1 -0
  336. package/dist/particles/spinner/spinner.d.ts +13 -0
  337. package/dist/particles/spinner/spinner.js +31 -0
  338. package/dist/particles/spinner/spinner.js.map +1 -0
  339. package/dist/particles/switch/switch.d.ts +27 -0
  340. package/dist/particles/switch/switch.js +59 -0
  341. package/dist/particles/switch/switch.js.map +1 -0
  342. package/dist/particles/tabs/tabs.d.ts +45 -0
  343. package/dist/particles/tabs/tabs.js +164 -0
  344. package/dist/particles/tabs/tabs.js.map +1 -0
  345. package/dist/particles/text/text.d.ts +24 -0
  346. package/dist/particles/text/text.js +40 -0
  347. package/dist/particles/text/text.js.map +1 -0
  348. package/dist/particles/toast/toast.d.ts +83 -0
  349. package/dist/particles/toast/toast.js +194 -0
  350. package/dist/particles/toast/toast.js.map +1 -0
  351. package/dist/particles/toggle/toggle.d.ts +26 -0
  352. package/dist/particles/toggle/toggle.js +61 -0
  353. package/dist/particles/toggle/toggle.js.map +1 -0
  354. package/dist/particles/tooltip/tooltip.d.ts +61 -0
  355. package/dist/particles/tooltip/tooltip.js +240 -0
  356. package/dist/particles/tooltip/tooltip.js.map +1 -0
  357. package/dist/schema.graphql +2953 -0
  358. package/dist/sdk/actions/cart-action-provider.d.ts +19 -0
  359. package/dist/sdk/actions/cart-action-provider.js +23 -0
  360. package/dist/sdk/actions/cart-action-provider.js.map +1 -0
  361. package/dist/sdk/actions/identity-action-provider.d.ts +15 -0
  362. package/dist/sdk/actions/identity-action-provider.js +19 -0
  363. package/dist/sdk/actions/identity-action-provider.js.map +1 -0
  364. package/dist/sdk/actions/index.d.ts +7 -0
  365. package/dist/sdk/actions/index.js +6 -0
  366. package/dist/sdk/actions/inject-actions.d.ts +14 -0
  367. package/dist/sdk/actions/inject-actions.js +36 -0
  368. package/dist/sdk/actions/inject-actions.js.map +1 -0
  369. package/dist/sdk/actions/region-action-provider.d.ts +15 -0
  370. package/dist/sdk/actions/region-action-provider.js +19 -0
  371. package/dist/sdk/actions/region-action-provider.js.map +1 -0
  372. package/dist/sdk/actions/session-action-provider.d.ts +15 -0
  373. package/dist/sdk/actions/session-action-provider.js +19 -0
  374. package/dist/sdk/actions/session-action-provider.js.map +1 -0
  375. package/dist/sdk/actions/shipping-action-provider.d.ts +15 -0
  376. package/dist/sdk/actions/shipping-action-provider.js +19 -0
  377. package/dist/sdk/actions/shipping-action-provider.js.map +1 -0
  378. package/dist/sdk/actions/types.d.ts +21 -0
  379. package/dist/sdk/cache/storefront-cache.js +35 -0
  380. package/dist/sdk/cache/storefront-cache.js.map +1 -0
  381. package/dist/sdk/cart/operations.d.ts +31 -0
  382. package/dist/sdk/cart/operations.js +215 -0
  383. package/dist/sdk/cart/operations.js.map +1 -0
  384. package/dist/sdk/cart/optimistic.d.ts +24 -0
  385. package/dist/sdk/cart/optimistic.js +164 -0
  386. package/dist/sdk/cart/optimistic.js.map +1 -0
  387. package/dist/sdk/cart/use-cart-actions.d.ts +56 -0
  388. package/dist/sdk/cart/use-cart-actions.js +348 -0
  389. package/dist/sdk/cart/use-cart-actions.js.map +1 -0
  390. package/dist/sdk/cart/use-cart-validate-on-open.js +50 -0
  391. package/dist/sdk/cart/use-cart-validate-on-open.js.map +1 -0
  392. package/dist/sdk/cart/write-gate.js +54 -0
  393. package/dist/sdk/cart/write-gate.js.map +1 -0
  394. package/dist/sdk/client/assert-api-url.js +20 -0
  395. package/dist/sdk/client/assert-api-url.js.map +1 -0
  396. package/dist/sdk/client/create-client.d.ts +23 -0
  397. package/dist/sdk/client/create-client.js +46 -0
  398. package/dist/sdk/client/create-client.js.map +1 -0
  399. package/dist/sdk/client/fetch-page-data.d.ts +39 -0
  400. package/dist/sdk/client/fetch-page-data.js +33 -0
  401. package/dist/sdk/client/fetch-page-data.js.map +1 -0
  402. package/dist/sdk/client/register-preload-query.d.ts +24 -0
  403. package/dist/sdk/client/register-preload-query.js +33 -0
  404. package/dist/sdk/client/register-preload-query.js.map +1 -0
  405. package/dist/sdk/content/create-content-runtime.d.ts +68 -0
  406. package/dist/sdk/content/create-content-runtime.js +503 -0
  407. package/dist/sdk/content/create-content-runtime.js.map +1 -0
  408. package/dist/sdk/context/headers.d.ts +15 -0
  409. package/dist/sdk/context/headers.js +21 -0
  410. package/dist/sdk/context/headers.js.map +1 -0
  411. package/dist/sdk/context/storefront-context.d.ts +11 -0
  412. package/dist/sdk/context/storefront-context.js +29 -0
  413. package/dist/sdk/context/storefront-context.js.map +1 -0
  414. package/dist/sdk/data/data-override-context.d.ts +12 -0
  415. package/dist/sdk/data/data-override-context.js +19 -0
  416. package/dist/sdk/data/data-override-context.js.map +1 -0
  417. package/dist/sdk/data/entity-subscriber.js +28 -0
  418. package/dist/sdk/data/entity-subscriber.js.map +1 -0
  419. package/dist/sdk/data/hot-data-provider.d.ts +19 -0
  420. package/dist/sdk/data/hot-data-provider.js +33 -0
  421. package/dist/sdk/data/hot-data-provider.js.map +1 -0
  422. package/dist/sdk/data/index.d.ts +8 -0
  423. package/dist/sdk/data/index.js +8 -0
  424. package/dist/sdk/data/list-item-ref-context.d.ts +20 -0
  425. package/dist/sdk/data/list-item-ref-context.js +11 -0
  426. package/dist/sdk/data/list-item-ref-context.js.map +1 -0
  427. package/dist/sdk/data/multiple-reactive-data-provider.d.ts +32 -0
  428. package/dist/sdk/data/multiple-reactive-data-provider.js +20 -0
  429. package/dist/sdk/data/multiple-reactive-data-provider.js.map +1 -0
  430. package/dist/sdk/data/page-reactive-data-root.d.ts +53 -0
  431. package/dist/sdk/data/page-reactive-data-root.js +153 -0
  432. package/dist/sdk/data/page-reactive-data-root.js.map +1 -0
  433. package/dist/sdk/data/reactive-data-provider.d.ts +25 -0
  434. package/dist/sdk/data/reactive-data-provider.js +24 -0
  435. package/dist/sdk/data/reactive-data-provider.js.map +1 -0
  436. package/dist/sdk/data/reactive-list-item-data-provider.d.ts +26 -0
  437. package/dist/sdk/data/reactive-list-item-data-provider.js +42 -0
  438. package/dist/sdk/data/reactive-list-item-data-provider.js.map +1 -0
  439. package/dist/sdk/data/use-reactive-entity.js +40 -0
  440. package/dist/sdk/data/use-reactive-entity.js.map +1 -0
  441. package/dist/sdk/format/client.d.ts +12 -0
  442. package/dist/sdk/format/client.js +20 -0
  443. package/dist/sdk/format/client.js.map +1 -0
  444. package/dist/sdk/format/formatters.d.ts +32 -0
  445. package/dist/sdk/format/formatters.js +45 -0
  446. package/dist/sdk/format/formatters.js.map +1 -0
  447. package/dist/sdk/generated/fragment-types.js +23 -0
  448. package/dist/sdk/generated/fragment-types.js.map +1 -0
  449. package/dist/sdk/generated/gql.js +51 -0
  450. package/dist/sdk/generated/gql.js.map +1 -0
  451. package/dist/sdk/generated/graphql.d.ts +622 -0
  452. package/dist/sdk/generated/graphql.js +11917 -0
  453. package/dist/sdk/generated/graphql.js.map +1 -0
  454. package/dist/sdk/graphql-tag.d.ts +10 -0
  455. package/dist/sdk/graphql-tag.js +21 -0
  456. package/dist/sdk/graphql-tag.js.map +1 -0
  457. package/dist/sdk/i18n/client.d.ts +4 -0
  458. package/dist/sdk/i18n/client.js +4 -0
  459. package/dist/sdk/i18n/locales.d.ts +8 -0
  460. package/dist/sdk/i18n/locales.js +57 -0
  461. package/dist/sdk/i18n/locales.js.map +1 -0
  462. package/dist/sdk/i18n/messages/en-US.js +24 -0
  463. package/dist/sdk/i18n/messages/en-US.js.map +1 -0
  464. package/dist/sdk/i18n/messages/en-US.json +19 -0
  465. package/dist/sdk/i18n/messages/en-US.json.d.ts +23 -0
  466. package/dist/sdk/i18n/messages/es-ES.js +24 -0
  467. package/dist/sdk/i18n/messages/es-ES.js.map +1 -0
  468. package/dist/sdk/i18n/messages/es-ES.json +19 -0
  469. package/dist/sdk/i18n/messages/pt-BR.js +24 -0
  470. package/dist/sdk/i18n/messages/pt-BR.js.map +1 -0
  471. package/dist/sdk/i18n/messages/pt-BR.json +19 -0
  472. package/dist/sdk/i18n/provider.d.ts +1 -0
  473. package/dist/sdk/i18n/provider.js +30 -0
  474. package/dist/sdk/i18n/provider.js.map +1 -0
  475. package/dist/sdk/i18n/server.d.ts +28 -0
  476. package/dist/sdk/i18n/server.js +59 -0
  477. package/dist/sdk/i18n/server.js.map +1 -0
  478. package/dist/sdk/identity/operations.d.ts +34 -0
  479. package/dist/sdk/identity/operations.js +78 -0
  480. package/dist/sdk/identity/operations.js.map +1 -0
  481. package/dist/sdk/identity/use-identity-actions.d.ts +62 -0
  482. package/dist/sdk/identity/use-identity-actions.js +180 -0
  483. package/dist/sdk/identity/use-identity-actions.js.map +1 -0
  484. package/dist/sdk/provider/index.d.ts +2 -0
  485. package/dist/sdk/provider/index.js +2 -0
  486. package/dist/sdk/provider/storefront-provider.d.ts +32 -0
  487. package/dist/sdk/provider/storefront-provider.js +111 -0
  488. package/dist/sdk/provider/storefront-provider.js.map +1 -0
  489. package/dist/sdk/region/operations.d.ts +6 -0
  490. package/dist/sdk/region/region-operations.d.ts +30 -0
  491. package/dist/sdk/region/region-operations.js +23 -0
  492. package/dist/sdk/region/region-operations.js.map +1 -0
  493. package/dist/sdk/region/use-region-actions.d.ts +23 -0
  494. package/dist/sdk/region/use-region-actions.js +66 -0
  495. package/dist/sdk/region/use-region-actions.js.map +1 -0
  496. package/dist/sdk/seller.js +11 -0
  497. package/dist/sdk/seller.js.map +1 -0
  498. package/dist/sdk/session/auth-operations.d.ts +47 -0
  499. package/dist/sdk/session/auth-operations.js +79 -0
  500. package/dist/sdk/session/auth-operations.js.map +1 -0
  501. package/dist/sdk/session/operations.d.ts +6 -0
  502. package/dist/sdk/session/use-session-actions.d.ts +27 -0
  503. package/dist/sdk/session/use-session-actions.js +126 -0
  504. package/dist/sdk/session/use-session-actions.js.map +1 -0
  505. package/dist/sdk/shipping/cart-operations.d.ts +3 -0
  506. package/dist/sdk/shipping/cart-operations.js +33 -0
  507. package/dist/sdk/shipping/cart-operations.js.map +1 -0
  508. package/dist/sdk/shipping/operations.d.ts +3 -0
  509. package/dist/sdk/shipping/operations.js +33 -0
  510. package/dist/sdk/shipping/operations.js.map +1 -0
  511. package/dist/sdk/shipping/option-select-operations.d.ts +24 -0
  512. package/dist/sdk/shipping/option-select-operations.js +45 -0
  513. package/dist/sdk/shipping/option-select-operations.js.map +1 -0
  514. package/dist/sdk/shipping/request-timeout.js +41 -0
  515. package/dist/sdk/shipping/request-timeout.js.map +1 -0
  516. package/dist/sdk/shipping/shipping-operations.d.ts +38 -0
  517. package/dist/sdk/shipping/shipping-operations.js +77 -0
  518. package/dist/sdk/shipping/shipping-operations.js.map +1 -0
  519. package/dist/sdk/shipping/use-cart-shipping-simulation.d.ts +7 -0
  520. package/dist/sdk/shipping/use-cart-shipping-simulation.js +72 -0
  521. package/dist/sdk/shipping/use-cart-shipping-simulation.js.map +1 -0
  522. package/dist/sdk/shipping/use-shipping-actions.d.ts +27 -0
  523. package/dist/sdk/shipping/use-shipping-actions.js +113 -0
  524. package/dist/sdk/shipping/use-shipping-actions.js.map +1 -0
  525. package/dist/sdk/shipping/use-shipping-simulation.d.ts +7 -0
  526. package/dist/sdk/shipping/use-shipping-simulation.js +72 -0
  527. package/dist/sdk/shipping/use-shipping-simulation.js.map +1 -0
  528. package/dist/sdk/state/cart.d.ts +42 -0
  529. package/dist/sdk/state/cart.js +64 -0
  530. package/dist/sdk/state/cart.js.map +1 -0
  531. package/dist/sdk/state/index.js +3 -0
  532. package/dist/sdk/state/variant-selector.d.ts +17 -0
  533. package/dist/sdk/state/variant-selector.js +14 -0
  534. package/dist/sdk/state/variant-selector.js.map +1 -0
  535. package/dist/utils/safe-href.js +63 -0
  536. package/dist/utils/safe-href.js.map +1 -0
  537. package/package.json +84 -0
  538. package/src/styles/tailwind.css +32 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"variant-selector.js","names":["BaseRadio"],"sources":["../../../src/matter/variant-selector/variant-selector.tsx"],"sourcesContent":["'use client';\n\nimport { useReactiveVar } from '@apollo/client/react';\nimport { Radio as BaseRadio } from '@base-ui/react/radio';\nimport { defineComponent } from '@vtex/fs-core';\nimport {\n type ComponentPropsWithRef,\n type CSSProperties,\n createContext,\n type FunctionComponent,\n useCallback,\n useContext,\n useEffect,\n useId,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { RadioGroup } from '../../particles/radio/radio.js';\nimport { useDataOverride } from '../../sdk/data/data-override-context.js';\nimport { graphql } from '../../sdk/generated/gql.js';\nimport type { VariantSelectorDataFragment } from '../../sdk/generated/graphql.js';\nimport { publishedVariantIdFor, selectedVariantVar } from '../../sdk/state/variant-selector.js';\n\n// `useLayoutEffect` on the client, `useEffect` on the server: keeps the pre-paint (no-flash) measurement\n// and overflow registration on the client while silencing React 19's \"useLayoutEffect does nothing on the\n// server\" SSR warning. Mirrors the useEffect-for-SSR convention in `sdk/data/page-reactive-data-root.tsx`.\nconst useIsomorphicLayoutEffect = typeof window === 'undefined' ? useEffect : useLayoutEffect;\n\n// ---------------------------------------------------------------------------\n// GraphQL Fragment — typed via @graphql-codegen client-preset\n// ---------------------------------------------------------------------------\n\nconst fragment = graphql(`\n fragment VariantSelectorData on Query {\n productBySlug(slug: $slug) {\n __typename\n id\n options {\n name\n values\n }\n variants(first: 50) {\n edges {\n node {\n __typename\n id\n name\n sku\n availableForSale\n selectedOptions {\n name\n value\n }\n images(first: 1) {\n edges {\n node {\n url\n altText\n }\n }\n }\n }\n }\n }\n }\n }\n`);\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\ntype ProductSlice = NonNullable<VariantSelectorDataFragment['productBySlug']>;\n\n/** The swatch kinds a swatch list can render. Each maps to a dedicated swatch-content component and to a\n * `data-fs-variant-selector-group-mode` value; `inferDisplayMode` resolves one for the auto swatch list\n * (`VariantSelectorSwatches`), and the explicit lists (`VariantSelectorColorSwatches`, …) fix one directly. */\ntype ResolvedDisplayMode = 'label' | 'image' | 'color' | 'radio';\n\n/** Per-value swatch media. `imageUrl`/`alt` are derived from the matching variant's primary image\n * (`Variant.images`) so the `image`/`auto` display modes work from live data. `hexColor` has no\n * Core Graph source (`ProductOption.values: [String!]!`) and is populated only when a host injects\n * it through context — see specs/sku-selector.md gap row 2. */\nexport type VariantSelectorSwatch = {\n hexColor?: string;\n imageUrl?: string;\n alt?: string;\n};\n\nexport type VariantSelectorOptionData = {\n value: string;\n available: boolean;\n variantId: string | null;\n swatch?: VariantSelectorSwatch;\n};\n\nexport type VariantSelectorAxis = {\n name: string;\n activeValue: string | null;\n options: VariantSelectorOptionData[];\n};\n\nexport type VariantSelectorContextValue = {\n axes: VariantSelectorAxis[];\n selectedVariantId: string | null;\n select: (axisName: string, value: string) => void;\n} | null;\n\n/** Provided by `VariantSelectorOptionGroup` to its composed parts (title, swatch list, overflow, and the\n * options the list renders). The group owns the axis binding and the collapse/expand state; the parts read\n * what they need from here, so the author can place them freely — e.g. the title in an accordion header\n * and the swatch list in its panel. */\ntype VariantSelectorGroupContextValue = {\n axis: VariantSelectorAxis;\n /** Stable id shared by the title (`id`) and the swatch list (`aria-labelledby`) to label the radiogroup. */\n titleId: string;\n /** Whether a `VariantSelectorGroupTitle` is composed in this group. The swatch list points its\n * `aria-labelledby` at the title only when one exists; otherwise it relies on the `aria-label`\n * axis-name floor, so the radiogroup is never labelled by a dangling idref. */\n hasTitle: boolean;\n /** Registers a mounted `VariantSelectorGroupTitle`, returning an unregister for cleanup. Ref-counted so\n * the title can be placed freely (e.g. an accordion header) and still flip `hasTitle`. */\n registerTitle: () => () => void;\n /** Registers a mounted `VariantSelectorOverflow`, returning an unregister for cleanup. Ref-counted like\n * `registerTitle`, so the trigger can be placed freely and still flip `hasOverflow`. Space-based collapse\n * runs only while a trigger is composed, so hidden swatches always have a reveal affordance. */\n registerOverflow: () => () => void;\n /** Whether a `VariantSelectorOverflow` is composed in this group — gates the measured collapse. */\n hasOverflow: boolean;\n /** Ref callback the swatch list hands its container element to, so the group can measure the row width. */\n registerListElement: (el: HTMLElement | null) => void;\n visibleOptions: VariantSelectorOptionData[];\n hiddenCount: number;\n overflowing: boolean;\n expand: () => void;\n /** Activates `value` on this group's axis. */\n select: (value: string) => void;\n ImageComponent: FunctionComponent<{ src: string; alt: string }>;\n};\n\nexport type VariantSelectorRootProps = ComponentPropsWithRef<'div'> & {\n $data?: ProductSlice | null;\n /** Pre-selects the variant the page is showing (the viewed SKU) before the shopper interacts.\n * `productBySlug` resolves to the product group, so the page supplies the viewed variant id here\n * — mirroring `ProductGalleryRoot.selectedVariantId`. The published `selectedVariantVar` wins\n * once a swatch is activated; this prop is only the initial fallback. */\n selectedVariantId?: string;\n};\n\nexport type VariantSelectorOptionGroupProps = ComponentPropsWithRef<'div'> & {\n /** Catalog `ProductOption.name` this group binds (e.g. `\"Color\"`). Matched case/accent/whitespace-\n * insensitively but otherwise exactly — the runtime does no plural or translation guessing. Use this\n * only when the exact catalog name is known; otherwise bind by `optionIndex`. When both are given, a\n * successful name match wins and `optionIndex` is the fallback. */\n optionName?: string;\n /** Zero-based axis position, in the order the product defines its options. The preferred binding for\n * generated schemas: the author places one group per axis in visual top-to-bottom order, which lines\n * up with the product's option order — reliable even when the on-image label differs from the catalog\n * name. Used when `optionName` is absent or does not match any axis. */\n optionIndex?: number;\n /** Reserve space for the `VariantSelectorOverflow` trigger in the fit calculation. Off by default: the\n * trigger is a sibling of the swatch list (its own space), so the swatches use the full row width. Turn\n * it on only when the trigger is styled inline at the end of the swatch row (content-sized) so it stays\n * on the line — its measured width is then subtracted from the space available to the swatches. */\n reserveTriggerSpace?: boolean;\n /** Image renderer used by image/color swatches; defaults to a plain `<img>`. Hosts inject e.g. next/image. */\n ImageComponent?: FunctionComponent<{ src: string; alt: string }>;\n};\n\n/** Title for a `VariantSelectorOptionGroup`: renders the axis name (or your `label`). Reads the axis from\n * group context, so it can be placed anywhere inside the group (e.g. an accordion header). Compose a\n * `VariantSelectorGroupValue` beside it to echo the live selection — the separator, weight, and spacing\n * between the two are brand styling on the `data-fs-*` hooks, not baked into this component. */\nexport type VariantSelectorGroupTitleProps = Omit<ComponentPropsWithRef<'span'>, 'children'> & {\n /** Overrides the displayed axis name. Defaults to the catalog axis name (e.g. `\"Color\"`). Use it to match\n * a design's prompt copy such as `\"Selecione a cor\"`; it never changes which axis the group binds. Any\n * separator (e.g. a trailing colon) is styling — add it to the title's `data-fs-*` hook, not the text. */\n label?: string;\n};\n\n/** The live selected value of a `VariantSelectorOptionGroup`, as a standalone placeable part (e.g. beside\n * the title inside a container). Decorative/`aria-hidden`: the selection is already announced per option,\n * so echoing it here would make the group's accessible name churn on every change. */\nexport type VariantSelectorGroupValueProps = Omit<ComponentPropsWithRef<'span'>, 'children'>;\n\n/** The swatch list for a `VariantSelectorOptionGroup`: a radiogroup of the axis' option swatches,\n * auto-rendered from the product data. The component chooses the swatch look — `VariantSelectorSwatches`\n * infers it, the explicit variants fix it — so the kind is selected by composition, not a prop. */\nexport type VariantSelectorSwatchesProps = Omit<ComponentPropsWithRef<'div'>, 'children' | 'defaultValue'>;\n\n/** The \"+N more\" trigger for a `VariantSelectorOptionGroup`: composing it opts the group into measured,\n * space-based collapse, and it renders only while the row actually overflows, expanding it in place.\n * Reads the hidden count and expand action from group context. */\nexport type VariantSelectorOverflowProps = Omit<ComponentPropsWithRef<'button'>, 'children'>;\n\nexport type VariantSelectorOptionProps = {\n value: string;\n className?: string;\n ImageComponent?: FunctionComponent<{ src: string; alt: string }>;\n};\n\n// ---------------------------------------------------------------------------\n// Context\n// ---------------------------------------------------------------------------\n\nconst VARIANT_SELECTOR_CONTEXT_UNSET = Symbol('VariantSelectorContextUnset');\n\nconst VariantSelectorContextInternal = createContext<\n VariantSelectorContextValue | typeof VARIANT_SELECTOR_CONTEXT_UNSET\n>(VARIANT_SELECTOR_CONTEXT_UNSET);\n\n/** Exposed for advanced composition and tests that mount group/option in isolation. */\nexport const VariantSelectorContext = VariantSelectorContextInternal as React.Context<VariantSelectorContextValue>;\n\nexport const VariantSelectorGroupContext = createContext<VariantSelectorGroupContextValue | null>(null);\n\n/** Carries the swatch-content component the active swatch list chose, read by `VariantSelectorOption`.\n * Null when an option renders outside a swatch list, in which case the option degrades to a text label. */\nconst VariantSelectorSwatchContext = createContext<FunctionComponent<SwatchContentProps> | null>(null);\n\nfunction useVariantSelector(): VariantSelectorContextValue {\n const ctx = useContext(VariantSelectorContextInternal);\n if (ctx === VARIANT_SELECTOR_CONTEXT_UNSET) {\n throw new Error('VariantSelector components must be used inside VariantSelectorRoot.');\n }\n return ctx;\n}\n\nfunction useVariantSelectorGroup(): VariantSelectorGroupContextValue {\n const ctx = useContext(VariantSelectorGroupContext);\n if (ctx === null) {\n throw new Error(\n 'VariantSelector group parts (Title, swatch lists, Overflow, Option) must be used inside VariantSelectorOptionGroup.',\n );\n }\n return ctx;\n}\n\n// ---------------------------------------------------------------------------\n// Derivation\n// ---------------------------------------------------------------------------\n\ntype DerivedVariant = {\n id: string;\n name: string;\n sku: string;\n availableForSale: boolean;\n options: Record<string, string>;\n image: { url: string; alt: string | null } | null;\n};\n\nfunction deriveVariants(data: ProductSlice): DerivedVariant[] {\n return data.variants.edges.map(({ node }) => {\n const options: Record<string, string> = {};\n for (const selected of node.selectedOptions) {\n options[selected.name] = selected.value;\n }\n const primaryImage = node.images.edges[0]?.node ?? null;\n return {\n id: node.id,\n name: node.name,\n sku: node.sku,\n availableForSale: node.availableForSale,\n options,\n image: primaryImage ? { url: primaryImage.url, alt: primaryImage.altText } : null,\n };\n });\n}\n\n/**\n * Resolve the variant activated by setting `axisName` to `value` while keeping the current\n * selection on the other axes. Mirrors the legacy `getSkuSlug` dominant-axis fallback: an exact\n * match across every current selection wins; otherwise the first variant carrying `value` on the\n * activated axis is used. String equality keeps `Size-7` distinct from `Size-7.5`.\n */\nfunction resolveVariant(\n variants: DerivedVariant[],\n currentSelection: Record<string, string>,\n axisName: string,\n value: string,\n): DerivedVariant | null {\n const target = { ...currentSelection, [axisName]: value };\n const exact = variants.find((variant) =>\n Object.entries(target).every(([name, selected]) => variant.options[name] === selected),\n );\n if (exact) return exact;\n return variants.find((variant) => variant.options[axisName] === value) ?? null;\n}\n\nfunction deriveAxes(\n data: ProductSlice,\n variants: DerivedVariant[],\n currentSelection: Record<string, string>,\n): VariantSelectorAxis[] {\n return data.options.map((option) => ({\n name: option.name,\n activeValue: currentSelection[option.name] ?? null,\n options: option.values.map((value) => {\n const resolved = resolveVariant(variants, currentSelection, option.name, value);\n const swatch: VariantSelectorSwatch | undefined = resolved?.image\n ? { imageUrl: resolved.image.url, alt: resolved.image.alt ?? undefined }\n : undefined;\n return {\n value,\n available: resolved?.availableForSale ?? false,\n variantId: resolved?.id ?? null,\n swatch,\n };\n }),\n }));\n}\n\n/**\n * Swatch inference for the auto swatch list `VariantSelectorSwatches` (legacy `useDefineVariant`): `color`\n * when every option carries a `hexColor`; `image` when a single option has an image, or when image sources\n * differ across options; `label` otherwise. Never returns `radio` — that look is explicit only.\n */\nexport function inferDisplayMode(options: VariantSelectorOptionData[]): ResolvedDisplayMode {\n if (options.length > 0 && options.every((option) => Boolean(option.swatch?.hexColor))) {\n return 'color';\n }\n\n const imageUrls = options.map((option) => option.swatch?.imageUrl).filter((url): url is string => Boolean(url));\n if (imageUrls.length === 1) return 'image';\n\n const firstImageUrl = imageUrls[0];\n const sourcesDiffer = imageUrls.some((url) => url !== firstImageUrl);\n if (firstImageUrl !== undefined && sourcesDiffer) return 'image';\n\n return 'label';\n}\n\nfunction DefaultVariantImage({ src, alt }: Readonly<{ src: string; alt: string }>) {\n // biome-ignore lint/performance/noImgElement: default swatch fallback; production hosts inject ImageComponent (e.g. next/image).\n return <img src={src} alt={alt} data-fs-variant-selector-option-image=\"\" />;\n}\n\n/**\n * Props shared by every swatch-content component. Each component renders the decorative (aria-hidden)\n * body of one option — the accessible name lives in the sibling sr-only span owned by the option shell,\n * so everything here is purely visual. Shape (square/circle/pill) and the selected-state highlight are\n * owned by styling, never by this code.\n */\ntype SwatchContentProps = Readonly<{\n swatch: VariantSelectorSwatch | undefined;\n value: string;\n Image: FunctionComponent<{ src: string; alt: string }>;\n}>;\n\n/** Plain text body: the value label, hooked as `data-fs-variant-selector-option-label` so an option's\n * value text is styleable through the same selector everywhere (matching the radio swatch's label). */\nfunction LabelSwatchContent({ value }: SwatchContentProps) {\n return (\n <span data-fs-variant-selector-option-label=\"\" aria-hidden=\"true\">\n {value}\n </span>\n );\n}\n\n/** Image body: the variant thumbnail, degrading to the value label when no image source is present. */\nfunction ImageSwatchContent({ swatch, value, Image }: SwatchContentProps) {\n if (swatch?.imageUrl) {\n return (\n <span aria-hidden=\"true\">\n <Image src={swatch.imageUrl} alt={swatch.alt ?? value} />\n </span>\n );\n }\n return <LabelSwatchContent swatch={swatch} value={value} Image={Image} />;\n}\n\n/**\n * Color body: a color chip, degrading gracefully when the value lacks a hex source. `hexColor` has no\n * Core Graph origin (see `VariantSelectorSwatch`), so a `color` group authored from a design may resolve\n * to values with no color: paint the chip when a hex is present, else fall back to the variant image,\n * else the value label — never an empty chip.\n */\nfunction ColorSwatchContent({ swatch, value, Image }: SwatchContentProps) {\n if (swatch?.hexColor) {\n return (\n <span aria-hidden=\"true\">\n <div\n data-fs-variant-selector-option-color=\"\"\n title={value}\n style={{ '--fs-variant-selector-option-color-bkg-color': swatch.hexColor } as CSSProperties}\n />\n </span>\n );\n }\n return <ImageSwatchContent swatch={swatch} value={value} Image={Image} />;\n}\n\n/**\n * Radio body: a classic radio row — a control circle holding Base UI's indicator (the dot, shown when\n * checked) next to the value label. Both are direct children of the option root (no wrapper span) so the\n * group's `flex` on `data-fs-variant-selector-option` lays the control and label out as a row; each is\n * `aria-hidden` because the sibling sr-only span already owns the accessible name. Style `-control` as\n * the ring and `-indicator` as the dot.\n */\nfunction RadioSwatchContent({ value }: SwatchContentProps) {\n return (\n <>\n <span data-fs-variant-selector-option-control=\"\" aria-hidden=\"true\">\n <BaseRadio.Indicator data-fs-variant-selector-option-indicator=\"\" />\n </span>\n <span data-fs-variant-selector-option-label=\"\" aria-hidden=\"true\">\n {value}\n </span>\n </>\n );\n}\n\n/**\n * A swatch kind: the `data-fs-variant-selector-group-mode` value it advertises for styling, paired with\n * the component that renders it. Each explicit swatch list (`VariantSelectorColorSwatches`, …) references\n * one of these constants directly, so the swatch is chosen by composition rather than by mapping a\n * `displayMode` string at render time.\n */\ntype SwatchKind = {\n mode: ResolvedDisplayMode;\n SwatchContent: FunctionComponent<SwatchContentProps>;\n};\n\nconst LABEL_SWATCH: SwatchKind = { mode: 'label', SwatchContent: LabelSwatchContent };\nconst IMAGE_SWATCH: SwatchKind = { mode: 'image', SwatchContent: ImageSwatchContent };\nconst COLOR_SWATCH: SwatchKind = { mode: 'color', SwatchContent: ColorSwatchContent };\nconst RADIO_SWATCH: SwatchKind = { mode: 'radio', SwatchContent: RadioSwatchContent };\n\n/**\n * The swatch kinds the auto swatch list `VariantSelectorSwatches` can land on. `auto` is a runtime\n * decision — it cannot be a static component reference — so the inferred mode is mapped back to its kind\n * here. The explicit swatch lists bypass this entirely. `inferDisplayMode` never returns `radio`, but the\n * `Record` stays exhaustive over `ResolvedDisplayMode` so the lookup is total.\n */\nconst SWATCH_BY_INFERRED_MODE: Record<ResolvedDisplayMode, SwatchKind> = {\n label: LABEL_SWATCH,\n image: IMAGE_SWATCH,\n color: COLOR_SWATCH,\n radio: RADIO_SWATCH,\n};\n\n// ---------------------------------------------------------------------------\n// Axis resolution\n// ---------------------------------------------------------------------------\n\n/**\n * Normalizes an axis name for matching: strips accents and case and collapses whitespace. This is a\n * deterministic normalization, not a linguistic guess — it only bridges trivial casing/accent/spacing\n * differences between an authored `optionName` and the catalog `ProductOption.name` (e.g. \"cólor\" vs\n * \"Color\"). Anything beyond that — translations, paraphrases, singular/plural — is resolved at\n * authoring time via `optionIndex`, which the schema author reads from the axis' visual order. The\n * runtime deliberately does no morphology. See variant-selector.md.\n */\nfunction normalizeAxisName(name: string): string {\n return name\n .normalize('NFD')\n .replaceAll(/[\\u0300-\\u036f]/g, '')\n .toLowerCase()\n .trim()\n .replaceAll(/\\s+/g, ' ');\n}\n\n/**\n * Finds the axis an `optionName` refers to via a normalized (case/accent/whitespace-insensitive)\n * match, and only when it is unambiguous (exactly one axis), so a match can never silently bind to\n * the wrong axis. Non-trivial label differences are handled by `optionIndex`, never guessed here.\n */\nfunction findAxisByName(axes: VariantSelectorAxis[], optionName: string): VariantSelectorAxis | null {\n const exact = axes.find((axis) => axis.name === optionName);\n if (exact) return exact;\n const target = normalizeAxisName(optionName);\n const matches = axes.filter((axis) => normalizeAxisName(axis.name) === target);\n return matches.length === 1 ? (matches[0] ?? null) : null;\n}\n\n/**\n * Resolves the axis a group binds to. `optionName` (tolerant) takes precedence; `optionIndex`\n * (zero-based position) is the fallback so a generated schema can bind by visual order when the\n * localized label does not match the catalog name. Returns `null` when neither resolves.\n */\nfunction resolveAxis(\n axes: VariantSelectorAxis[],\n optionName: string | undefined,\n optionIndex: number | undefined,\n): VariantSelectorAxis | null {\n if (optionName !== undefined) {\n const byName = findAxisByName(axes, optionName);\n if (byName) return byName;\n }\n if (optionIndex !== undefined && Number.isInteger(optionIndex) && optionIndex >= 0 && optionIndex < axes.length) {\n return axes[optionIndex] ?? null;\n }\n return null;\n}\n\n/**\n * Resolves the swatch kind a swatch list renders: an explicit kind passes through; `'auto'` infers from\n * the axis' options (and falls back to `label` for an unresolved axis).\n */\nfunction resolveSwatchKind(swatch: SwatchKind | 'auto', axis: VariantSelectorAxis | null): SwatchKind {\n if (swatch !== 'auto') return swatch;\n return axis ? SWATCH_BY_INFERRED_MODE[inferDisplayMode(axis.options)] : LABEL_SWATCH;\n}\n\n/**\n * Computes the swatches to render under an effective `cap` (the count that fits the measured row, resolved\n * upstream). Collapses to the first `cap` options while always keeping the active swatch visible. `cap` is\n * by construction the most that fit one line, so when the active swatch sits past it we **swap** it for the\n * last head swatch (`cap - 1` head + active = `cap`) instead of appending (`cap + 1`, which would wrap or\n * overflow). Dropping the *last* head swatch keeps the leading options stable across selections and never\n * hides the primary (first) option. A `null` cap (measurement unavailable, no trigger, or expanded) shows\n * every swatch.\n */\nfunction getVisibleOptions(\n axis: VariantSelectorAxis,\n cap: number | null,\n expanded: boolean,\n): { visibleOptions: VariantSelectorOptionData[]; hiddenCount: number; overflowing: boolean } {\n if (cap === null || cap <= 0 || expanded || axis.options.length <= cap) {\n return { visibleOptions: axis.options, hiddenCount: 0, overflowing: false };\n }\n const head = axis.options.slice(0, cap);\n const activeHidden =\n axis.activeValue !== null &&\n !head.some((option) => option.value === axis.activeValue) &&\n axis.options.some((option) => option.value === axis.activeValue);\n const activeOption = activeHidden ? axis.options.find((option) => option.value === axis.activeValue) : undefined;\n // Swap the active swatch in for the last head swatch (keeping the count at `cap`) rather than appending it.\n const visibleOptions = activeOption ? [...head.slice(0, cap - 1), activeOption] : head;\n const hiddenCount = axis.options.length - visibleOptions.length;\n return { visibleOptions, hiddenCount, overflowing: hiddenCount > 0 };\n}\n\n// ---------------------------------------------------------------------------\n// Space measurement (the swatch overflow driver)\n// ---------------------------------------------------------------------------\n\n/**\n * Pure fit math: given each option's outer width, the row `gap`, the list's available inner width, and an\n * optional `triggerWidth` to reserve for the \"+N more\" control, return how many options fit on one line.\n * By default the trigger is a sibling of the swatch list (its own space), so `triggerWidth` is 0 and the\n * swatches get the full width; pass the trigger's width when it sits inline at the end of the swatch row so\n * it stays on the line. When every option fits it returns the full count; otherwise the prefix that fits,\n * floored at 1 so an oversized single swatch never yields zero. Isolated from the DOM so the algorithm is\n * unit-testable with plain numbers.\n */\nexport function computeVisibleCount(optionWidths: number[], gap: number, available: number, triggerWidth = 0): number {\n const total = optionWidths.length;\n if (total === 0) return 0;\n\n // Single accumulating pass (O(n)): total row width is the sum of widths plus one gap between each pair.\n let full = 0;\n for (const w of optionWidths) full += w;\n full += gap * (total - 1);\n if (full <= available) return total;\n\n // Reserve the trigger (and the gap before it) only when it shares the swatch row.\n const budget = triggerWidth > 0 ? available - triggerWidth - gap : available;\n let used = 0;\n let count = 0;\n for (const w of optionWidths) {\n const next = w + (count > 0 ? gap : 0);\n if (used + next > budget) break;\n used += next;\n count++;\n }\n return Math.max(1, count);\n}\n\n/** Reads the swatch list's content-box inner width (the space the swatches actually lay out in) and the\n * resolved horizontal row gap, from a single `getComputedStyle`. `clientWidth` includes horizontal padding,\n * so a list styled with `px-*` would otherwise overestimate the space and fit one extra swatch. `columnGap`\n * already resolves to a px value when `gap` is set (else `\"normal\"` → 0). */\nfunction readRowMetrics(el: HTMLElement): { available: number; gap: number } {\n const style = getComputedStyle(el);\n const px = (value: string) => {\n const parsed = Number.parseFloat(value);\n return Number.isFinite(parsed) ? parsed : 0;\n };\n const available = el.clientWidth - px(style.paddingLeft) - px(style.paddingRight);\n return { available, gap: px(style.columnGap) };\n}\n\n/**\n * Measures how many swatches fit the list's width and returns that count, or `null` when measurement is\n * unavailable (collapse disabled, no trigger composed, no element, zero width, or no `ResizeObserver` — SSR\n * and jsdom) so the caller shows every swatch. Recomputes on `ResizeObserver` resize.\n *\n * The option-width cache is refreshed only while the full set is on screen (count `null` → all shown); once\n * collapsed we can no longer see every swatch, so a later resize recomputes from the cached widths.\n *\n * When `reserveTriggerSpace` is set (the author placed the \"+N more\" trigger inline at the end of the swatch\n * row), the sibling trigger's width is reserved from the fit. The trigger only mounts after the first\n * collapse, so a second pass (keyed on `count`) folds its width in; the trigger width is accumulated\n * monotonically so a shrinking \"+N more\" label can never flip-flop the fitting count.\n */\nfunction useMeasuredVisibleCount({\n listEl,\n optionCount,\n hasOverflow,\n enabled,\n reserveTriggerSpace,\n}: {\n listEl: HTMLElement | null;\n optionCount: number;\n hasOverflow: boolean;\n enabled: boolean;\n reserveTriggerSpace: boolean;\n}): number | null {\n const [count, setCount] = useState<number | null>(null);\n const widthsRef = useRef<number[]>([]);\n const triggerWidthRef = useRef(0);\n const measureRef = useRef<() => void>(() => {});\n\n useIsomorphicLayoutEffect(() => {\n if (!enabled || !hasOverflow || !listEl || typeof ResizeObserver === 'undefined') {\n widthsRef.current = [];\n triggerWidthRef.current = 0;\n // Disable the count-keyed re-measure below, so an expanded group is never re-collapsed.\n measureRef.current = () => {};\n setCount(null);\n return;\n }\n // Re-measure fresh for this configuration (this effect re-runs when `optionCount` changes, so a\n // client-side navigation that reuses this group with a different option set can never keep serving\n // a stale width cache). The cache only persists across resizes (the ResizeObserver, which does not\n // re-run this effect). The trigger width is likewise kept monotonic only across resizes below.\n widthsRef.current = [];\n triggerWidthRef.current = 0;\n\n const measure = () => {\n const { available, gap } = readRowMetrics(listEl);\n if (available <= 0) {\n setCount(null);\n return;\n }\n const optionEls = Array.from(listEl.querySelectorAll<HTMLElement>('[data-fs-variant-selector-option]'));\n // Refresh the width cache only when every option is on screen; a collapsed row cannot see them all.\n if (optionCount > 0 && optionEls.length === optionCount) {\n widthsRef.current = optionEls.map((el) => el.offsetWidth);\n }\n if (reserveTriggerSpace) {\n const triggerEl = listEl.parentElement?.querySelector<HTMLElement>(\n '[data-fs-variant-selector-overflow-trigger]',\n );\n triggerWidthRef.current = Math.max(triggerWidthRef.current, triggerEl?.offsetWidth ?? 0);\n }\n\n const widths = widthsRef.current;\n if (widths.length === 0) {\n setCount(null);\n return;\n }\n const next = computeVisibleCount(widths, gap, available, triggerWidthRef.current);\n setCount((prev) => (prev === next ? prev : next));\n };\n\n measureRef.current = measure;\n measure();\n\n const observer = new ResizeObserver(() => measure());\n observer.observe(listEl);\n return () => observer.disconnect();\n }, [listEl, optionCount, hasOverflow, enabled, reserveTriggerSpace]);\n\n // Re-measure on any count change, so convergence never depends on the ResizeObserver firing. After the\n // cache is reset (e.g. the option set changed) the group first shows every swatch; this pass then measures\n // the full set and collapses — the state-equality bail-out in `measure` stops it once it settles (two\n // passes). It is also where the inline trigger's width (which mounts only after the first collapse) enters\n // the fit in `reserveTriggerSpace` mode, accumulated monotonically so it can't flip-flop. `measureRef` is a\n // no-op while measurement is disabled (expanded / no geometry), so an expanded group is never re-collapsed.\n useIsomorphicLayoutEffect(() => {\n measureRef.current();\n }, [count]);\n\n return count;\n}\n\n// Dedup dev warnings so a re-rendering group does not flood the console; keyed by the binding plus\n// the available axes so a later data change still surfaces a fresh warning.\nconst warnedUnresolvedAxes = new Set<string>();\n\nfunction warnUnresolvedAxis(\n optionName: string | undefined,\n optionIndex: number | undefined,\n axes: VariantSelectorAxis[],\n): void {\n // Surface authoring/data mismatches during development and tests (the screenshot→store pipeline\n // runs `next dev`); stay silent in production where the catalog is the source of truth.\n if (process.env.NODE_ENV === 'production') return;\n const available = axes.map((axis) => axis.name);\n const key = `${optionName ?? ''}\\u0000${optionIndex ?? ''}\\u0000${available.join('\\u0001')}`;\n if (warnedUnresolvedAxes.has(key)) return;\n warnedUnresolvedAxes.add(key);\n const list = available.length > 0 ? available.map((name, index) => `${index}:\"${name}\"`).join(', ') : '(none)';\n console.warn(\n `[VariantSelector] Could not resolve an option axis for ${\n optionName === undefined ? `optionIndex ${optionIndex}` : `optionName \"${optionName}\"`\n }. Available axes (index:name): ${list}. ` +\n 'optionName must reference a catalog ProductOption.name (matched ignoring case and accents only); ' +\n 'otherwise set optionIndex to the axis position (0-based, in the product option order).',\n );\n}\n\n// ---------------------------------------------------------------------------\n// Definitions\n// ---------------------------------------------------------------------------\n\nexport const VariantSelectorRootDefinition = defineComponent<VariantSelectorRootProps>({\n name: 'VariantSelectorRoot',\n importPath: '@vtex/faststore/components',\n component: VariantSelectorRoot,\n fragment,\n fetchStrategy: 'reactive',\n editor: { label: 'Variant Selector', category: 'commerce' },\n schema: {\n selectedVariantId: { type: 'string', label: 'Selected Variant ID' },\n },\n providesContext: 'variant-selector',\n guideline:\n 'Root container for PDP variant swatches — derives option axes and availability from the product variants and publishes the selected variant for sibling components. Wraps one VariantSelectorOptionGroup per axis. The selectedVariantId prop pre-selects the viewed SKU before the shopper interacts; the live selection wins once a swatch is activated.',\n});\n\nexport const VariantSelectorOptionGroupDefinition = defineComponent<VariantSelectorOptionGroupProps>({\n name: 'VariantSelectorOptionGroup',\n importPath: '@vtex/faststore/components',\n component: VariantSelectorOptionGroup,\n editor: { label: 'Variant Option Group', category: 'commerce' },\n schema: {\n optionName: { type: 'string', label: 'Option axis name (catalog ProductOption.name)' },\n optionIndex: { type: 'number', label: 'Option axis index (0-based; fallback for optionName)' },\n reserveTriggerSpace: { type: 'boolean', default: false, label: 'Reserve space for the \"+N more\" trigger' },\n },\n requiresContext: 'variant-selector',\n providesContext: 'variant-selector-group',\n guideline:\n 'One option axis (e.g. Color) inside a VariantSelectorRoot. A container only — it binds the axis and owns the collapse/expand state, then renders whatever you compose inside it. Fill it, in any order, with: a VariantSelectorGroupTitle (the axis name) and optionally a VariantSelectorGroupValue beside it to echo the selection, exactly one swatch list (VariantSelectorSwatches to auto-infer the look, or VariantSelectorColorSwatches / VariantSelectorImageSwatches / VariantSelectorLabelSwatches / VariantSelectorRadioSwatches to fix it), and optionally a VariantSelectorOverflow (\"+N more\") to collapse a row that does not fit its width. Because the parts read the group via context, you can place them freely — e.g. the title in an accordion header and the swatch list in its panel. Bind the axis with optionIndex (0-based, in the product\\'s option order — the reliable choice when authoring from an image, since groups are placed in visual order) or, when the exact catalog option name is known, optionName (matched case/accent-insensitively, no plural/translation guessing). Compose a VariantSelectorOverflow to opt into automatic space-based collapse: the group measures the swatch row and keeps only the swatches that fit on one line, revealing the rest via the trigger — no cap prop. The trigger sits in its own space by default; set reserveTriggerSpace when it is styled inline at the end of the swatch row, so its width is reserved and it stays on the line.',\n});\n\nexport const VariantSelectorGroupTitleDefinition = defineComponent<VariantSelectorGroupTitleProps>({\n name: 'VariantSelectorGroupTitle',\n importPath: '@vtex/faststore/components',\n component: VariantSelectorGroupTitle,\n editor: { label: 'Variant Group Title', category: 'commerce' },\n schema: {\n label: { type: 'string', label: 'Axis name override (defaults to the catalog axis name)' },\n },\n requiresContext: 'variant-selector-group',\n guideline:\n 'The axis name inside a VariantSelectorOptionGroup (e.g. \"Color\"). Reads the axis from context, so it stays correct even when placed apart from the swatches (e.g. in an accordion header). Set label to match a design prompt (\"Selecione a cor\") without changing the axis binding. It renders the name only — to echo the selected value place a VariantSelectorGroupValue beside it (e.g. both inside a Container); the separator (a colon), the value weight, and the spacing are brand styling on the data-fs hooks, not props.',\n});\n\nexport const VariantSelectorGroupValueDefinition = defineComponent<VariantSelectorGroupValueProps>({\n name: 'VariantSelectorGroupValue',\n importPath: '@vtex/faststore/components',\n component: VariantSelectorGroupValue,\n editor: { label: 'Variant Group Value', category: 'commerce' },\n schema: {},\n requiresContext: 'variant-selector-group',\n guideline:\n 'The live selected value of a VariantSelectorOptionGroup (e.g. \"Red\"), as its own placeable part. Compose it beside a VariantSelectorGroupTitle — typically both inside a Container — to render \"Color: Red\", where the colon and the value weight are styling on the data-fs hooks. Omit it entirely when the design shows only the axis name (e.g. above a radio list, whose selected dot already conveys the choice). It is decorative (aria-hidden): the selection is announced per option, so the group is named by the axis alone.',\n});\n\nexport const VariantSelectorSwatchesDefinition = defineComponent<VariantSelectorSwatchesProps>({\n name: 'VariantSelectorSwatches',\n importPath: '@vtex/faststore/components',\n component: VariantSelectorSwatches,\n editor: { label: 'Variant Swatches (auto)', category: 'commerce' },\n schema: {},\n requiresContext: 'variant-selector-group',\n guideline:\n 'The swatch list inside a VariantSelectorOptionGroup, auto-inferring the look from the option data: color when every value has a hex color, image when values resolve to differing variant images, else label (it never infers radio). Renders one swatch per option automatically — do not author VariantSelectorOption children. To fix the look instead of inferring it, use a sibling list: VariantSelectorColorSwatches / VariantSelectorImageSwatches / VariantSelectorLabelSwatches / VariantSelectorRadioSwatches. Swatch shape (square vs circle) is styling. Use exactly one swatch list per group.',\n});\n\nexport const VariantSelectorLabelSwatchesDefinition = defineComponent<VariantSelectorSwatchesProps>({\n name: 'VariantSelectorLabelSwatches',\n importPath: '@vtex/faststore/components',\n component: VariantSelectorLabelSwatches,\n editor: { label: 'Variant Label Swatches', category: 'commerce' },\n schema: {},\n requiresContext: 'variant-selector-group',\n guideline:\n 'Swatch list rendered as text-label swatches (size pills, materials, voltages, any axis that should read as text). Use inside a VariantSelectorOptionGroup when the look must always be text regardless of the data (auto can resolve a size axis to image when its values map to differing variant photos). Renders its options automatically. Use exactly one swatch list per group.',\n});\n\nexport const VariantSelectorImageSwatchesDefinition = defineComponent<VariantSelectorSwatchesProps>({\n name: 'VariantSelectorImageSwatches',\n importPath: '@vtex/faststore/components',\n component: VariantSelectorImageSwatches,\n editor: { label: 'Variant Image Swatches', category: 'commerce' },\n schema: {},\n requiresContext: 'variant-selector-group',\n guideline:\n \"Swatch list rendered as image (thumbnail) swatches; each shows the variant's primary image, degrading to the value label when no image is available. Use inside a VariantSelectorOptionGroup; prefer binding that group by optionName so the photo pairs with its intended axis — a positionally-bound group with an image list can hijack a text axis (e.g. sizes shown as clothing photos) when the live product exposes fewer or reordered axes than the design. Renders its options automatically. Use exactly one swatch list per group.\",\n});\n\nexport const VariantSelectorColorSwatchesDefinition = defineComponent<VariantSelectorSwatchesProps>({\n name: 'VariantSelectorColorSwatches',\n importPath: '@vtex/faststore/components',\n component: VariantSelectorColorSwatches,\n editor: { label: 'Variant Color Swatches', category: 'commerce' },\n schema: {},\n requiresContext: 'variant-selector-group',\n guideline:\n \"Swatch list rendered as color-chip swatches. Use inside a VariantSelectorOptionGroup when the design shows solid color chips. A value with no hex color (hexColor has no catalog source and is injection-only) degrades per value to its variant image, then to the value label, so a chip is never empty — choosing this from a design's colored swatches is always safe. Shape (circle vs square) is styling. Renders its options automatically. Use exactly one swatch list per group.\",\n});\n\nexport const VariantSelectorRadioSwatchesDefinition = defineComponent<VariantSelectorSwatchesProps>({\n name: 'VariantSelectorRadioSwatches',\n importPath: '@vtex/faststore/components',\n component: VariantSelectorRadioSwatches,\n editor: { label: 'Variant Radio Swatches', category: 'commerce' },\n schema: {},\n requiresContext: 'variant-selector-group',\n guideline:\n 'Swatch list rendered as a radio-dot list — a control circle showing a dot when selected, beside the value label (common for voltage/material lists). Use inside a VariantSelectorOptionGroup; auto never picks this look, so reference it directly when the design shows a radio list. A square control or a checkmark is styling. Typically pair with a VariantSelectorGroupTitle (the axis name) and omit the VariantSelectorGroupValue, since the selected dot already conveys the choice. Renders its options automatically. Use exactly one swatch list per group.',\n});\n\nexport const VariantSelectorOverflowDefinition = defineComponent<VariantSelectorOverflowProps>({\n name: 'VariantSelectorOverflow',\n importPath: '@vtex/faststore/components',\n component: VariantSelectorOverflow,\n editor: { label: 'Variant Overflow Trigger', category: 'commerce' },\n schema: {},\n requiresContext: 'variant-selector-group',\n guideline:\n 'The \"+N more\" trigger inside a VariantSelectorOptionGroup. Composing it opts the group into automatic space-based collapse: the group measures the swatch row and, when the swatches do not fit on one line, collapses the extras behind this trigger, which expands them in place when clicked. It renders only while the row actually overflows. Author it after the swatch list; omit it when the row should never collapse.',\n});\n\nexport const VariantSelectorOptionDefinition = defineComponent<VariantSelectorOptionProps>({\n name: 'VariantSelectorOption',\n importPath: '@vtex/faststore/components',\n component: VariantSelectorOption,\n editor: { label: 'Variant Option', category: 'commerce' },\n schema: {},\n requiresContext: 'variant-selector-group',\n guideline:\n 'One swatch within a swatch list; reflects checked/disabled states and activates the matching variant on selection. Rendered automatically by the swatch list from the product data — do not author it directly.',\n});\n\n// ---------------------------------------------------------------------------\n// Implementations\n// ---------------------------------------------------------------------------\n\nexport function VariantSelectorRoot({\n $data: $dataProp,\n selectedVariantId,\n className,\n children,\n ...props\n}: VariantSelectorRootProps) {\n const $data = useDataOverride($dataProp);\n const publishedSelection = useReactiveVar(selectedVariantVar);\n // Only honour a published selection that belongs to this product — a selection made on another\n // PDP must not leak through this module-global var after client-side navigation.\n const publishedVariantId = publishedVariantIdFor(publishedSelection, $data?.id ?? null);\n // Precedence: the shopper's published in-page selection wins; otherwise the page-supplied viewed\n // SKU (`selectedVariantId` prop) seeds the initial selection; falling back to the first variant.\n const activeVariantId = publishedVariantId ?? selectedVariantId ?? null;\n\n let contextValue: VariantSelectorContextValue = null;\n if ($data) {\n const productId = $data.id;\n const variants = deriveVariants($data);\n const selectedVariant = variants.find((variant) => variant.id === activeVariantId) ?? variants[0] ?? null;\n const currentSelection = selectedVariant?.options ?? {};\n const axes = deriveAxes($data, variants, currentSelection);\n\n contextValue = {\n axes,\n selectedVariantId: selectedVariant?.id ?? null,\n select: (axisName, value) => {\n const resolved = resolveVariant(variants, currentSelection, axisName, value);\n if (resolved) selectedVariantVar({ productId, variantId: resolved.id });\n },\n };\n }\n\n return (\n <VariantSelectorContextInternal value={contextValue}>\n <div {...props} className={className} data-fs-variant-selector=\"\">\n {children}\n </div>\n </VariantSelectorContextInternal>\n );\n}\n\n/** Axis container: binds the axis and owns the collapse/expand state, then renders whatever the author\n * composes inside it (title, a swatch list, an overflow trigger). The parts read the axis and overflow\n * state from the group context it provides, so they can be placed freely. */\nexport function VariantSelectorOptionGroup({\n optionName,\n optionIndex,\n reserveTriggerSpace = false,\n ImageComponent = DefaultVariantImage,\n className,\n children,\n ...props\n}: VariantSelectorOptionGroupProps) {\n const [expanded, setExpanded] = useState(false);\n const [titleCount, setTitleCount] = useState(0);\n const [overflowCount, setOverflowCount] = useState(0);\n const [listEl, setListEl] = useState<HTMLElement | null>(null);\n // Stable, collision-free id for the title→radiogroup `aria-labelledby` wiring. Deriving it from the\n // axis name would break for multi-word catalog names (a space in an id/idref is parsed as multiple\n // tokens, dropping the accessible name) and could collide across groups bound to the same axis.\n const titleId = useId();\n const ctx = useVariantSelector();\n const axis = ctx ? resolveAxis(ctx.axes, optionName, optionIndex) : null;\n\n // Ref-counted so a freely-placed title (even one nested in an accordion header, outside this DOM\n // subtree) still flips `hasTitle` — which gates the swatch list's `aria-labelledby` so it never\n // points at a title id that no element carries.\n const registerTitle = useCallback(() => {\n setTitleCount((count) => count + 1);\n return () => setTitleCount((count) => count - 1);\n }, []);\n const hasTitle = titleCount > 0;\n\n // Ref-counted like the title, so composing a VariantSelectorOverflow (wherever it is placed) opts the\n // group into space-based collapse. No trigger ⇒ never collapse, so hidden swatches always have a reveal.\n const registerOverflow = useCallback(() => {\n setOverflowCount((count) => count + 1);\n return () => setOverflowCount((count) => count - 1);\n }, []);\n const hasOverflow = overflowCount > 0;\n\n // Stable ref callback the swatch list attaches to its container, so the group can measure the row.\n const registerListElement = useCallback((el: HTMLElement | null) => setListEl(el), []);\n\n // Measured count of swatches that fit the row (null when unavailable → show all). Disabled once the\n // shopper expands, so an explicit expand stays sticky against later resizes.\n const measuredVisibleCount = useMeasuredVisibleCount({\n listEl,\n optionCount: axis?.options.length ?? 0,\n hasOverflow,\n enabled: hasOverflow && !expanded,\n reserveTriggerSpace,\n });\n const effectiveCap = expanded || !hasOverflow ? null : measuredVisibleCount;\n\n const groupContextValue = useMemo<VariantSelectorGroupContextValue | null>(() => {\n if (!ctx || !axis) return null;\n const { visibleOptions, hiddenCount, overflowing } = getVisibleOptions(axis, effectiveCap, expanded);\n return {\n axis,\n titleId,\n hasTitle,\n registerTitle,\n registerOverflow,\n hasOverflow,\n registerListElement,\n visibleOptions,\n hiddenCount,\n overflowing,\n expand: () => setExpanded(true),\n select: (value: string) => ctx.select(axis.name, value),\n ImageComponent,\n };\n }, [\n ctx,\n axis,\n effectiveCap,\n expanded,\n titleId,\n hasTitle,\n registerTitle,\n registerOverflow,\n hasOverflow,\n registerListElement,\n ImageComponent,\n ]);\n\n if (!groupContextValue) {\n if (ctx) warnUnresolvedAxis(optionName, optionIndex, ctx.axes);\n return null;\n }\n\n return (\n <VariantSelectorGroupContext.Provider value={groupContextValue}>\n <div\n {...props}\n className={className}\n data-fs-variant-selector-group=\"\"\n data-fs-variant-selector-group-overflow={groupContextValue.overflowing ? 'true' : 'false'}\n >\n {children}\n </div>\n </VariantSelectorGroupContext.Provider>\n );\n}\n\n/** The axis name (the catalog axis name or `label`). Reads the axis from group context, so it reflects\n * the bound axis wherever it is placed (including an accordion header). It is a `<span>`, not a `<label>`:\n * it names the radiogroup via `aria-labelledby`, not a single control. Compose a `VariantSelectorGroupValue`\n * beside it to echo the selection; the separator and value weight are styling on the `data-fs-*` hooks. */\nexport function VariantSelectorGroupTitle({ label, className, ...props }: VariantSelectorGroupTitleProps) {\n const { axis, titleId, registerTitle } = useVariantSelectorGroup();\n // Announce this title's presence so the swatch list wires `aria-labelledby` to it; unregister on unmount.\n useEffect(() => registerTitle(), [registerTitle]);\n return (\n <span {...props} id={titleId} className={className} data-fs-variant-selector-group-title=\"\">\n {label ?? axis.name}\n </span>\n );\n}\n\n/** The live selected value of the group's axis, as a standalone placeable part. Decorative (`aria-hidden`):\n * the selection is announced per option, so it never participates in the group's accessible name. */\nexport function VariantSelectorGroupValue({ className, ...props }: VariantSelectorGroupValueProps) {\n const { axis } = useVariantSelectorGroup();\n return (\n <span {...props} aria-hidden=\"true\" className={className} data-fs-variant-selector-group-value=\"\">\n {axis.activeValue ?? ''}\n </span>\n );\n}\n\n/** Internal: the swatch list shared by every kind, parametrized by the swatch it renders. The public\n * lists fix `swatch` — `VariantSelectorSwatches` to `'auto'` and the explicit ones to a concrete kind.\n * Provides the resolved swatch component to its options via context. Not registered in the catalog. */\nfunction VariantSelectorSwatchesBase({\n swatch,\n className,\n ref: consumerRef,\n ...props\n}: VariantSelectorSwatchesProps & { swatch: SwatchKind | 'auto' }) {\n const group = useVariantSelectorGroup();\n const { registerListElement } = group;\n const resolvedSwatch = resolveSwatchKind(swatch, group.axis);\n // Register the list element for measurement and still honour a ref the consumer passed (compose, not\n // discard) — otherwise `ref={registerListElement}` after `{...props}` would silently drop the consumer's.\n const setListRef = useCallback(\n (el: HTMLDivElement | null) => {\n registerListElement(el);\n if (typeof consumerRef === 'function') consumerRef(el);\n else if (consumerRef) (consumerRef as { current: HTMLDivElement | null }).current = el;\n },\n [registerListElement, consumerRef],\n );\n return (\n <VariantSelectorSwatchContext.Provider value={resolvedSwatch.SwatchContent}>\n <RadioGroup\n {...props}\n ref={setListRef}\n className={className}\n aria-labelledby={group.hasTitle ? group.titleId : undefined}\n aria-label={group.axis.name}\n value={group.axis.activeValue ?? ''}\n onValueChange={group.select}\n data-fs-variant-selector-group-list=\"\"\n data-fs-variant-selector-group-mode={resolvedSwatch.mode}\n >\n {group.visibleOptions.map((option) => (\n <VariantSelectorOption key={option.value} value={option.value} />\n ))}\n </RadioGroup>\n </VariantSelectorSwatchContext.Provider>\n );\n}\n\n/** Auto-inferring swatch list: derives the look from the option data (color/image/label, never radio).\n * Use an explicit sibling list to fix the look instead of inferring it. */\nexport function VariantSelectorSwatches(props: VariantSelectorSwatchesProps) {\n return <VariantSelectorSwatchesBase swatch=\"auto\" {...props} />;\n}\n\n/** Swatch list with text-label swatches. */\nexport function VariantSelectorLabelSwatches(props: VariantSelectorSwatchesProps) {\n return <VariantSelectorSwatchesBase swatch={LABEL_SWATCH} {...props} />;\n}\n\n/** Swatch list with image (thumbnail) swatches. */\nexport function VariantSelectorImageSwatches(props: VariantSelectorSwatchesProps) {\n return <VariantSelectorSwatchesBase swatch={IMAGE_SWATCH} {...props} />;\n}\n\n/** Swatch list with color-chip swatches (degrades per value to image, then label). */\nexport function VariantSelectorColorSwatches(props: VariantSelectorSwatchesProps) {\n return <VariantSelectorSwatchesBase swatch={COLOR_SWATCH} {...props} />;\n}\n\n/** Swatch list rendered as a radio-dot list (control circle + dot + label). */\nexport function VariantSelectorRadioSwatches(props: VariantSelectorSwatchesProps) {\n return <VariantSelectorSwatchesBase swatch={RADIO_SWATCH} {...props} />;\n}\n\n/** The \"+N more\" trigger: composing it opts the group into space-based collapse (via `registerOverflow`),\n * and it renders only while the row overflows, expanding it in place when clicked. Registers in a\n * layout effect so the group can measure and collapse before the browser paints (no full-row flash). */\nexport function VariantSelectorOverflow({ className, ...props }: VariantSelectorOverflowProps) {\n const group = useVariantSelectorGroup();\n const { registerOverflow } = group;\n useIsomorphicLayoutEffect(() => registerOverflow(), [registerOverflow]);\n if (!group.overflowing) return null;\n return (\n <button\n {...props}\n type=\"button\"\n onClick={group.expand}\n className={className}\n data-fs-variant-selector-overflow-trigger=\"\"\n data-fs-variant-selector-overflow-count={group.hiddenCount}\n >\n +{group.hiddenCount} more\n </button>\n );\n}\n\nexport function VariantSelectorOption({ value, ImageComponent, className }: Readonly<VariantSelectorOptionProps>) {\n const group = useVariantSelectorGroup();\n // The swatch list provides the resolved swatch component; degrade to a text label when an option is\n // somehow rendered outside a list (it always has a label-shaped fallback rather than an empty body).\n const SwatchContent = useContext(VariantSelectorSwatchContext) ?? LabelSwatchContent;\n const option = group.axis.options.find((candidate) => candidate.value === value) ?? null;\n if (!option) return null;\n\n const checked = group.axis.activeValue === value;\n const disabled = !option.available;\n const Image = ImageComponent ?? group.ImageComponent;\n\n return (\n <BaseRadio.Root\n value={value}\n disabled={disabled}\n title={value}\n className={className}\n data-fs-variant-selector-option=\"\"\n data-fs-variant-selector-option-checked={checked ? 'true' : 'false'}\n data-fs-variant-selector-option-disabled={disabled ? 'true' : 'false'}\n >\n {/* Axis-qualified accessible name (e.g. \"Color: Red\"); the visual content below is hidden from\n assistive tech so the radio is announced once, not duplicated by the label/image. */}\n <span data-fs-sr-only=\"\" className=\"sr-only\">\n {group.axis.name}: {value}\n </span>\n <SwatchContent swatch={option.swatch} value={value} Image={Image} />\n </BaseRadio.Root>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Namespace export\n// ---------------------------------------------------------------------------\n\nexport const VariantSelector = {\n Root: VariantSelectorRoot,\n OptionGroup: VariantSelectorOptionGroup,\n Title: VariantSelectorGroupTitle,\n Value: VariantSelectorGroupValue,\n Swatches: VariantSelectorSwatches,\n LabelSwatches: VariantSelectorLabelSwatches,\n ImageSwatches: VariantSelectorImageSwatches,\n ColorSwatches: VariantSelectorColorSwatches,\n RadioSwatches: VariantSelectorRadioSwatches,\n Overflow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@ -0,0 +1,7 @@
1
+ {
2
+ "locales": [
3
+ "en-US",
4
+ "es-ES",
5
+ "pt-BR"
6
+ ]
7
+ }
@@ -0,0 +1,33 @@
1
+ import { ComponentDefinition } from "../../core/dist/define-component.js";
2
+ import "../../core/dist/index.js";
3
+ import { ComponentPropsWithRef, FocusEvent } from "react";
4
+ //#region src/particles/access-code-field/access-code-field.d.ts
5
+ export type AccessCodeFieldProps = Omit<ComponentPropsWithRef<'div'>, 'defaultValue' | 'value' | 'onChange' | 'onBlur'> & {
6
+ value?: string;
7
+ defaultValue?: string;
8
+ onValueChange?: (value: string) => void;
9
+ onBlur?: (event: FocusEvent<HTMLInputElement>) => void;
10
+ invalid?: boolean;
11
+ errorMessage?: string;
12
+ label?: string;
13
+ placeholder?: string;
14
+ disabled?: boolean;
15
+ required?: boolean;
16
+ name?: string;
17
+ autoComplete?: string;
18
+ inputMode?: ComponentPropsWithRef<'input'>['inputMode'];
19
+ maxLength?: number;
20
+ };
21
+ export declare const AccessCodeFieldDefinition: ComponentDefinition<AccessCodeFieldProps>;
22
+ /**
23
+ * Presentational one-time-code input (particle). Composes the `Field` particle (`Field.Root` +
24
+ * `Field.Label` + `Field.Control` + `Field.Error`), mirroring `EmailField`'s shape. Unlike
25
+ * `EmailField`, it performs **no** client-side format validation — a code's validity is entirely
26
+ * server-decided, so `invalid`/`errorMessage` are host-driven only. Sets `autoComplete="one-time-code"`
27
+ * by default so browser/OS-level SMS/email-code autofill still works despite the single-line shape,
28
+ * and hardens the input for code entry: `inputMode="numeric"` (overridable for alphanumeric codes),
29
+ * an optional `maxLength` cap, and spellcheck/autocapitalize/autocorrect disabled.
30
+ */
31
+ export declare function AccessCodeField({ value, defaultValue, onValueChange, onBlur, invalid, errorMessage, label, placeholder, disabled, required, name, autoComplete, inputMode, maxLength, className, ...props }: AccessCodeFieldProps): import("react/jsx-runtime").JSX.Element;
32
+ //#endregion
33
+ //# sourceMappingURL=access-code-field.d.ts.map
@@ -0,0 +1,95 @@
1
+ "use client";
2
+ import { defineComponent } from "../../core/dist/define-component.js";
3
+ import "../../core/dist/index.js";
4
+ import { Field } from "../field/field.js";
5
+ import { useState } from "react";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ //#region src/particles/access-code-field/access-code-field.tsx
8
+ const AccessCodeFieldDefinition = defineComponent({
9
+ name: "AccessCodeField",
10
+ importPath: "@vtex/faststore/components",
11
+ component: AccessCodeField,
12
+ editor: {
13
+ label: "Access Code Field",
14
+ category: "content"
15
+ },
16
+ schema: {
17
+ label: {
18
+ type: "string",
19
+ label: "Label"
20
+ },
21
+ placeholder: {
22
+ type: "string",
23
+ label: "Placeholder"
24
+ },
25
+ errorMessage: {
26
+ type: "string",
27
+ label: "Error message"
28
+ },
29
+ required: {
30
+ type: "boolean",
31
+ default: true,
32
+ label: "Required"
33
+ },
34
+ disabled: {
35
+ type: "boolean",
36
+ default: false,
37
+ label: "Disabled"
38
+ }
39
+ },
40
+ guideline: "Presentational one-time-code input with no client-side format check — invalid/errorMessage are host-driven. For the checkout access-code sign-in flow, use it inside AccessCodeSignIn.Validate. See access-code-field.md."
41
+ });
42
+ /**
43
+ * Presentational one-time-code input (particle). Composes the `Field` particle (`Field.Root` +
44
+ * `Field.Label` + `Field.Control` + `Field.Error`), mirroring `EmailField`'s shape. Unlike
45
+ * `EmailField`, it performs **no** client-side format validation — a code's validity is entirely
46
+ * server-decided, so `invalid`/`errorMessage` are host-driven only. Sets `autoComplete="one-time-code"`
47
+ * by default so browser/OS-level SMS/email-code autofill still works despite the single-line shape,
48
+ * and hardens the input for code entry: `inputMode="numeric"` (overridable for alphanumeric codes),
49
+ * an optional `maxLength` cap, and spellcheck/autocapitalize/autocorrect disabled.
50
+ */
51
+ function AccessCodeField({ value, defaultValue = "", onValueChange, onBlur, invalid = false, errorMessage, label, placeholder, disabled = false, required = true, name = "accessCode", autoComplete = "one-time-code", inputMode = "numeric", maxLength, className, ...props }) {
52
+ const isControlled = value !== void 0;
53
+ const [internalValue, setInternalValue] = useState(defaultValue);
54
+ const currentValue = isControlled ? value : internalValue;
55
+ function handleChange(event) {
56
+ const next = event.target.value;
57
+ if (!isControlled) setInternalValue(next);
58
+ onValueChange?.(next);
59
+ }
60
+ return /* @__PURE__ */ jsxs(Field.Root, {
61
+ ...props,
62
+ className,
63
+ name,
64
+ invalid,
65
+ disabled,
66
+ "data-fs-access-code-field": "",
67
+ children: [
68
+ label ? /* @__PURE__ */ jsx(Field.Label, { children: label }) : null,
69
+ /* @__PURE__ */ jsx(Field.Control, {
70
+ type: "text",
71
+ name,
72
+ autoComplete,
73
+ inputMode,
74
+ maxLength,
75
+ spellCheck: false,
76
+ autoCapitalize: "none",
77
+ autoCorrect: "off",
78
+ required,
79
+ placeholder,
80
+ disabled,
81
+ onChange: handleChange,
82
+ onBlur,
83
+ ...isControlled ? { value: currentValue } : { defaultValue }
84
+ }),
85
+ invalid && errorMessage ? /* @__PURE__ */ jsx(Field.Error, {
86
+ match: true,
87
+ children: errorMessage
88
+ }) : null
89
+ ]
90
+ });
91
+ }
92
+ //#endregion
93
+ export { AccessCodeField, AccessCodeFieldDefinition };
94
+
95
+ //# sourceMappingURL=access-code-field.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"access-code-field.js","names":[],"sources":["../../../src/particles/access-code-field/access-code-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 AccessCodeFieldProps = Omit<\n ComponentPropsWithRef<'div'>,\n 'defaultValue' | 'value' | 'onChange' | 'onBlur'\n> & {\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 inputMode?: ComponentPropsWithRef<'input'>['inputMode'];\n maxLength?: number;\n};\n\nexport const AccessCodeFieldDefinition = defineComponent<AccessCodeFieldProps>({\n name: 'AccessCodeField',\n importPath: '@vtex/faststore/components',\n component: AccessCodeField,\n editor: { label: 'Access Code 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 one-time-code input with no client-side format check — invalid/errorMessage are host-driven. For the checkout access-code sign-in flow, use it inside AccessCodeSignIn.Validate. See access-code-field.md.',\n});\n\n/**\n * Presentational one-time-code input (particle). Composes the `Field` particle (`Field.Root` +\n * `Field.Label` + `Field.Control` + `Field.Error`), mirroring `EmailField`'s shape. Unlike\n * `EmailField`, it performs **no** client-side format validation — a code's validity is entirely\n * server-decided, so `invalid`/`errorMessage` are host-driven only. Sets `autoComplete=\"one-time-code\"`\n * by default so browser/OS-level SMS/email-code autofill still works despite the single-line shape,\n * and hardens the input for code entry: `inputMode=\"numeric\"` (overridable for alphanumeric codes),\n * an optional `maxLength` cap, and spellcheck/autocapitalize/autocorrect disabled.\n */\nexport function AccessCodeField({\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 = 'accessCode',\n autoComplete = 'one-time-code',\n inputMode = 'numeric',\n maxLength,\n className,\n ...props\n}: AccessCodeFieldProps) {\n const isControlled = value !== undefined;\n const [internalValue, setInternalValue] = useState(defaultValue);\n const currentValue = isControlled ? value : internalValue;\n\n function handleChange(event: ChangeEvent<HTMLInputElement>) {\n const next = event.target.value;\n if (!isControlled) setInternalValue(next);\n onValueChange?.(next);\n }\n\n return (\n <Field.Root\n {...props}\n className={className}\n name={name}\n invalid={invalid}\n disabled={disabled}\n data-fs-access-code-field=\"\"\n >\n {label ? <Field.Label>{label}</Field.Label> : null}\n <Field.Control\n type=\"text\"\n name={name}\n autoComplete={autoComplete}\n inputMode={inputMode}\n maxLength={maxLength}\n spellCheck={false}\n autoCapitalize=\"none\"\n autoCorrect=\"off\"\n required={required}\n placeholder={placeholder}\n disabled={disabled}\n onChange={handleChange}\n onBlur={onBlur}\n {...(isControlled ? { value: currentValue } : { defaultValue })}\n />\n {invalid && errorMessage ? <Field.Error match>{errorMessage}</Field.Error> : null}\n </Field.Root>\n );\n}\n"],"mappings":";;;;;;;AA0BA,MAAa,4BAA4B,gBAAsC;CAC7E,MAAM;CACN,YAAY;CACZ,WAAW;CACX,QAAQ;EAAE,OAAO;EAAqB,UAAU;CAAU;CAC1D,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;;;;;;;;;;AAWD,SAAgB,gBAAgB,EAC9B,OACA,eAAe,IACf,eACA,QACA,UAAU,OACV,cACA,OACA,aACA,WAAW,OACX,WAAW,MACX,OAAO,cACP,eAAe,iBACf,YAAY,WACZ,WACA,WACA,GAAG,SACoB;CACvB,MAAM,eAAe,UAAU,KAAA;CAC/B,MAAM,CAAC,eAAe,oBAAoB,SAAS,YAAY;CAC/D,MAAM,eAAe,eAAe,QAAQ;CAE5C,SAAS,aAAa,OAAsC;EAC1D,MAAM,OAAO,MAAM,OAAO;EAC1B,IAAI,CAAC,cAAc,iBAAiB,IAAI;EACxC,gBAAgB,IAAI;CACtB;CAEA,OACE,qBAAC,MAAM,MAAP;EACE,GAAI;EACO;EACL;EACG;EACC;EACV,6BAA0B;EAN5B,UAAA;GAQG,QAAQ,oBAAC,MAAM,OAAP,EAAA,UAAc,MAAmB,CAAA,IAAI;GAC9C,oBAAC,MAAM,SAAP;IACE,MAAK;IACC;IACQ;IACH;IACA;IACX,YAAY;IACZ,gBAAe;IACf,aAAY;IACF;IACG;IACH;IACV,UAAU;IACF;IACR,GAAK,eAAe,EAAE,OAAO,aAAa,IAAI,EAAE,aAAa;GAC9D,CAAA;GACA,WAAW,eAAe,oBAAC,MAAM,OAAP;IAAa,OAAA;IAAO,UAAA;GAA0B,CAAA,IAAI;EACnE;;AAEhB"}
@@ -0,0 +1,45 @@
1
+ import { ComponentDefinition } from "../../core/dist/define-component.js";
2
+ import "../../core/dist/index.js";
3
+ import { ComponentPropsWithRef } from "react";
4
+ //#region src/particles/accordion/accordion.d.ts
5
+ export type AccordionOrientation = 'horizontal' | 'vertical';
6
+ export type AccordionRootProps = Omit<ComponentPropsWithRef<'div'>, 'defaultValue'> & {
7
+ openMultiple?: boolean;
8
+ disabled?: boolean;
9
+ orientation?: AccordionOrientation;
10
+ /** Controlled list of open item values (single-element when `openMultiple` is false). */
11
+ value?: string[];
12
+ /** Uncontrolled initial list of open item values. */
13
+ defaultValue?: string[];
14
+ /** Fires with the new list of open item values whenever an item expands or collapses. */
15
+ onValueChange?: (value: string[]) => void;
16
+ };
17
+ export type AccordionItemProps = ComponentPropsWithRef<'div'> & {
18
+ value: string;
19
+ disabled?: boolean;
20
+ };
21
+ export type AccordionHeaderProps = ComponentPropsWithRef<'h3'>;
22
+ export type AccordionTriggerProps = ComponentPropsWithRef<'button'>;
23
+ export type AccordionPanelProps = ComponentPropsWithRef<'div'> & {
24
+ hiddenUntilFound?: boolean;
25
+ keepMounted?: boolean;
26
+ };
27
+ export declare const AccordionRootDefinition: ComponentDefinition<AccordionRootProps>;
28
+ export declare const AccordionItemDefinition: ComponentDefinition<AccordionItemProps>;
29
+ export declare const AccordionHeaderDefinition: ComponentDefinition<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>>;
30
+ export declare const AccordionTriggerDefinition: ComponentDefinition<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>>;
31
+ export declare const AccordionPanelDefinition: ComponentDefinition<AccordionPanelProps>;
32
+ export declare function AccordionRoot({ openMultiple, disabled, orientation, className, children, ...props }: AccordionRootProps): import("react/jsx-runtime").JSX.Element;
33
+ export declare function AccordionItem({ value, disabled, className, children, ...props }: AccordionItemProps): import("react/jsx-runtime").JSX.Element;
34
+ export declare function AccordionHeader({ className, children, ...props }: AccordionHeaderProps): import("react/jsx-runtime").JSX.Element;
35
+ export declare function AccordionTrigger({ className, children, ...props }: AccordionTriggerProps): import("react/jsx-runtime").JSX.Element;
36
+ export declare function AccordionPanel({ hiddenUntilFound, keepMounted, className, children, ...props }: AccordionPanelProps): import("react/jsx-runtime").JSX.Element;
37
+ export declare const Accordion: {
38
+ Root: typeof AccordionRoot;
39
+ Item: typeof AccordionItem;
40
+ Header: typeof AccordionHeader;
41
+ Trigger: typeof AccordionTrigger;
42
+ Panel: typeof AccordionPanel;
43
+ };
44
+ //#endregion
45
+ //# sourceMappingURL=accordion.d.ts.map
@@ -0,0 +1,156 @@
1
+ "use client";
2
+ import { defineComponent } from "../../core/dist/define-component.js";
3
+ import "../../core/dist/index.js";
4
+ import { jsx } from "react/jsx-runtime";
5
+ import { Accordion } from "@base-ui/react/accordion";
6
+ //#region src/particles/accordion/accordion.tsx
7
+ const AccordionRootDefinition = defineComponent({
8
+ name: "AccordionRoot",
9
+ importPath: "@vtex/faststore/components",
10
+ component: AccordionRoot,
11
+ editor: {
12
+ label: "Accordion Root",
13
+ category: "layout"
14
+ },
15
+ schema: {
16
+ openMultiple: {
17
+ type: "boolean",
18
+ default: true,
19
+ label: "Open Multiple"
20
+ },
21
+ disabled: {
22
+ type: "boolean",
23
+ default: false,
24
+ label: "Disabled"
25
+ },
26
+ orientation: {
27
+ type: ["horizontal", "vertical"],
28
+ default: "vertical",
29
+ label: "Orientation"
30
+ }
31
+ },
32
+ guideline: "Root of the accordion. Manages open/close state for collapsible panels. Compose as: AccordionRoot > [AccordionItem > AccordionHeader > AccordionTrigger + AccordionPanel]. Set openMultiple=false for FAQ-style single-open behavior; orientation controls arrow-key navigation axis."
33
+ });
34
+ const AccordionItemDefinition = defineComponent({
35
+ name: "AccordionItem",
36
+ importPath: "@vtex/faststore/components",
37
+ component: AccordionItem,
38
+ editor: {
39
+ label: "Accordion Item",
40
+ category: "layout"
41
+ },
42
+ schema: {
43
+ value: {
44
+ type: "string",
45
+ label: "Value"
46
+ },
47
+ disabled: {
48
+ type: "boolean",
49
+ default: false,
50
+ label: "Disabled"
51
+ }
52
+ },
53
+ guideline: "One collapsible section inside Accordion.Root. Requires a unique value prop that matches the Root's controlled value. Disable individually without affecting sibling items."
54
+ });
55
+ const AccordionHeaderDefinition = defineComponent({
56
+ name: "AccordionHeader",
57
+ importPath: "@vtex/faststore/components",
58
+ component: AccordionHeader,
59
+ editor: {
60
+ label: "Accordion Header",
61
+ category: "layout"
62
+ },
63
+ schema: {},
64
+ guideline: "Heading element inside Accordion.Item. Always contains Accordion.Trigger. Renders as <h3> by default for correct document outline and accessibility."
65
+ });
66
+ const AccordionTriggerDefinition = defineComponent({
67
+ name: "AccordionTrigger",
68
+ importPath: "@vtex/faststore/components",
69
+ component: AccordionTrigger,
70
+ editor: {
71
+ label: "Accordion Trigger",
72
+ category: "action"
73
+ },
74
+ schema: {},
75
+ guideline: "Toggle button inside Accordion.Header. Receives ARIA expanded/controls attributes automatically. Style the open state via the data-open CSS attribute set by Base-UI."
76
+ });
77
+ const AccordionPanelDefinition = defineComponent({
78
+ name: "AccordionPanel",
79
+ importPath: "@vtex/faststore/components",
80
+ component: AccordionPanel,
81
+ editor: {
82
+ label: "Accordion Panel",
83
+ category: "layout"
84
+ },
85
+ schema: {
86
+ hiddenUntilFound: {
87
+ type: "boolean",
88
+ default: false,
89
+ label: "Hidden Until Found"
90
+ },
91
+ keepMounted: {
92
+ type: "boolean",
93
+ default: false,
94
+ label: "Keep Mounted"
95
+ }
96
+ },
97
+ guideline: "Collapsible content area placed after Accordion.Header inside Accordion.Item. Set hiddenUntilFound=true to make content discoverable by browser find-in-page and search engines without being visible."
98
+ });
99
+ function AccordionRoot({ openMultiple = true, disabled = false, orientation = "vertical", className, children, ...props }) {
100
+ return /* @__PURE__ */ jsx(Accordion.Root, {
101
+ ...props,
102
+ multiple: openMultiple,
103
+ disabled,
104
+ orientation,
105
+ className,
106
+ "data-fs-accordion-root": "",
107
+ children
108
+ });
109
+ }
110
+ function AccordionItem({ value, disabled = false, className, children, ...props }) {
111
+ return /* @__PURE__ */ jsx(Accordion.Item, {
112
+ ...props,
113
+ value,
114
+ disabled,
115
+ className,
116
+ "data-fs-accordion-item": "",
117
+ children
118
+ });
119
+ }
120
+ function AccordionHeader({ className, children, ...props }) {
121
+ return /* @__PURE__ */ jsx(Accordion.Header, {
122
+ ...props,
123
+ className,
124
+ "data-fs-accordion-header": "",
125
+ children
126
+ });
127
+ }
128
+ function AccordionTrigger({ className, children, ...props }) {
129
+ return /* @__PURE__ */ jsx(Accordion.Trigger, {
130
+ ...props,
131
+ className,
132
+ "data-fs-accordion-trigger": "",
133
+ children
134
+ });
135
+ }
136
+ function AccordionPanel({ hiddenUntilFound = false, keepMounted = false, className, children, ...props }) {
137
+ return /* @__PURE__ */ jsx(Accordion.Panel, {
138
+ ...props,
139
+ hiddenUntilFound,
140
+ keepMounted,
141
+ className,
142
+ "data-fs-accordion-panel": "",
143
+ children
144
+ });
145
+ }
146
+ const Accordion$1 = {
147
+ Root: AccordionRoot,
148
+ Item: AccordionItem,
149
+ Header: AccordionHeader,
150
+ Trigger: AccordionTrigger,
151
+ Panel: AccordionPanel
152
+ };
153
+ //#endregion
154
+ export { Accordion$1 as Accordion, AccordionHeader, AccordionHeaderDefinition, AccordionItem, AccordionItemDefinition, AccordionPanel, AccordionPanelDefinition, AccordionRoot, AccordionRootDefinition, AccordionTrigger, AccordionTriggerDefinition };
155
+
156
+ //# sourceMappingURL=accordion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accordion.js","names":["BaseAccordion","Accordion"],"sources":["../../../src/particles/accordion/accordion.tsx"],"sourcesContent":["'use client';\nimport { Accordion as BaseAccordion } from '@base-ui/react/accordion';\nimport { defineComponent } from '@vtex/fs-core';\nimport type { ComponentPropsWithRef } from 'react';\n\nexport type AccordionOrientation = 'horizontal' | 'vertical';\n\nexport type AccordionRootProps = Omit<ComponentPropsWithRef<'div'>, 'defaultValue'> & {\n openMultiple?: boolean;\n disabled?: boolean;\n orientation?: AccordionOrientation;\n /** Controlled list of open item values (single-element when `openMultiple` is false). */\n value?: string[];\n /** Uncontrolled initial list of open item values. */\n defaultValue?: string[];\n /** Fires with the new list of open item values whenever an item expands or collapses. */\n onValueChange?: (value: string[]) => void;\n};\n\nexport type AccordionItemProps = ComponentPropsWithRef<'div'> & {\n value: string;\n disabled?: boolean;\n};\n\nexport type AccordionHeaderProps = ComponentPropsWithRef<'h3'>;\n\nexport type AccordionTriggerProps = ComponentPropsWithRef<'button'>;\n\nexport type AccordionPanelProps = ComponentPropsWithRef<'div'> & {\n hiddenUntilFound?: boolean;\n keepMounted?: boolean;\n};\n\nexport const AccordionRootDefinition = defineComponent<AccordionRootProps>({\n name: 'AccordionRoot',\n importPath: '@vtex/faststore/components',\n component: AccordionRoot,\n editor: { label: 'Accordion Root', category: 'layout' },\n schema: {\n openMultiple: { type: 'boolean', default: true, label: 'Open Multiple' },\n disabled: { type: 'boolean', default: false, label: 'Disabled' },\n orientation: { type: ['horizontal', 'vertical'] as const, default: 'vertical', label: 'Orientation' },\n },\n guideline:\n 'Root of the accordion. Manages open/close state for collapsible panels. Compose as: AccordionRoot > [AccordionItem > AccordionHeader > AccordionTrigger + AccordionPanel]. Set openMultiple=false for FAQ-style single-open behavior; orientation controls arrow-key navigation axis.',\n});\n\nexport const AccordionItemDefinition = defineComponent<AccordionItemProps>({\n name: 'AccordionItem',\n importPath: '@vtex/faststore/components',\n component: AccordionItem,\n editor: { label: 'Accordion Item', category: 'layout' },\n schema: {\n value: { type: 'string', label: 'Value' },\n disabled: { type: 'boolean', default: false, label: 'Disabled' },\n },\n guideline:\n \"One collapsible section inside Accordion.Root. Requires a unique value prop that matches the Root's controlled value. Disable individually without affecting sibling items.\",\n});\n\nexport const AccordionHeaderDefinition = defineComponent<AccordionHeaderProps>({\n name: 'AccordionHeader',\n importPath: '@vtex/faststore/components',\n component: AccordionHeader,\n editor: { label: 'Accordion Header', category: 'layout' },\n schema: {},\n guideline:\n 'Heading element inside Accordion.Item. Always contains Accordion.Trigger. Renders as <h3> by default for correct document outline and accessibility.',\n});\n\nexport const AccordionTriggerDefinition = defineComponent<AccordionTriggerProps>({\n name: 'AccordionTrigger',\n importPath: '@vtex/faststore/components',\n component: AccordionTrigger,\n editor: { label: 'Accordion Trigger', category: 'action' },\n schema: {},\n guideline:\n 'Toggle button inside Accordion.Header. Receives ARIA expanded/controls attributes automatically. Style the open state via the data-open CSS attribute set by Base-UI.',\n});\n\nexport const AccordionPanelDefinition = defineComponent<AccordionPanelProps>({\n name: 'AccordionPanel',\n importPath: '@vtex/faststore/components',\n component: AccordionPanel,\n editor: { label: 'Accordion Panel', category: 'layout' },\n schema: {\n hiddenUntilFound: { type: 'boolean', default: false, label: 'Hidden Until Found' },\n keepMounted: { type: 'boolean', default: false, label: 'Keep Mounted' },\n },\n guideline:\n 'Collapsible content area placed after Accordion.Header inside Accordion.Item. Set hiddenUntilFound=true to make content discoverable by browser find-in-page and search engines without being visible.',\n});\n\nexport function AccordionRoot({\n openMultiple = true,\n disabled = false,\n orientation = 'vertical',\n className,\n children,\n ...props\n}: AccordionRootProps) {\n return (\n <BaseAccordion.Root\n {...props}\n multiple={openMultiple}\n disabled={disabled}\n orientation={orientation}\n className={className}\n data-fs-accordion-root=\"\"\n >\n {children}\n </BaseAccordion.Root>\n );\n}\n\nexport function AccordionItem({ value, disabled = false, className, children, ...props }: AccordionItemProps) {\n return (\n <BaseAccordion.Item {...props} value={value} disabled={disabled} className={className} data-fs-accordion-item=\"\">\n {children}\n </BaseAccordion.Item>\n );\n}\n\nexport function AccordionHeader({ className, children, ...props }: AccordionHeaderProps) {\n return (\n <BaseAccordion.Header {...props} className={className} data-fs-accordion-header=\"\">\n {children}\n </BaseAccordion.Header>\n );\n}\n\nexport function AccordionTrigger({ className, children, ...props }: AccordionTriggerProps) {\n return (\n <BaseAccordion.Trigger {...props} className={className} data-fs-accordion-trigger=\"\">\n {children}\n </BaseAccordion.Trigger>\n );\n}\n\nexport function AccordionPanel({\n hiddenUntilFound = false,\n keepMounted = false,\n className,\n children,\n ...props\n}: AccordionPanelProps) {\n return (\n <BaseAccordion.Panel\n {...props}\n hiddenUntilFound={hiddenUntilFound}\n keepMounted={keepMounted}\n className={className}\n data-fs-accordion-panel=\"\"\n >\n {children}\n </BaseAccordion.Panel>\n );\n}\n\nexport const Accordion = {\n Root: AccordionRoot,\n Item: AccordionItem,\n Header: AccordionHeader,\n Trigger: AccordionTrigger,\n Panel: AccordionPanel,\n};\n"],"mappings":";;;;;;AAiCA,MAAa,0BAA0B,gBAAoC;CACzE,MAAM;CACN,YAAY;CACZ,WAAW;CACX,QAAQ;EAAE,OAAO;EAAkB,UAAU;CAAS;CACtD,QAAQ;EACN,cAAc;GAAE,MAAM;GAAW,SAAS;GAAM,OAAO;EAAgB;EACvE,UAAU;GAAE,MAAM;GAAW,SAAS;GAAO,OAAO;EAAW;EAC/D,aAAa;GAAE,MAAM,CAAC,cAAc,UAAU;GAAY,SAAS;GAAY,OAAO;EAAc;CACtG;CACA,WACE;AACJ,CAAC;AAED,MAAa,0BAA0B,gBAAoC;CACzE,MAAM;CACN,YAAY;CACZ,WAAW;CACX,QAAQ;EAAE,OAAO;EAAkB,UAAU;CAAS;CACtD,QAAQ;EACN,OAAO;GAAE,MAAM;GAAU,OAAO;EAAQ;EACxC,UAAU;GAAE,MAAM;GAAW,SAAS;GAAO,OAAO;EAAW;CACjE;CACA,WACE;AACJ,CAAC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AAmB,OACnB,cAAc,OACd,WACA,UACA,GAAG,SACmB;CACtB,OACE,oBAACA,UAAc,OAAf;EACE,GAAI;EACc;EACL;EACF;EACX,2BAAwB;EAEvB;CACkB,CAAA;AAEzB;AAEA,MAAaC,cAAY;CACvB,MAAM;CACN,MAAM;CACN,QAAQ;CACR,SAAS;CACT,OAAO;AACT"}
@@ -0,0 +1,50 @@
1
+ import { ComponentDefinition } from "../../core/dist/define-component.js";
2
+ import "../../core/dist/index.js";
3
+ import { ReactNode } from "react";
4
+ //#region src/particles/address-summary/address-summary.d.ts
5
+ /**
6
+ * AddressSummary particle (no business coupling — ADR-0001): a presentational display for a
7
+ * postal address, driven entirely by AddressSummaryRoot's context rather than props. Any matter
8
+ * component that owns address data (e.g. ShippingAddressSelectedSummary, ShippingAddressSavedOption)
9
+ * provides it via AddressSummaryRoot; AddressSummary reads and renders it. A future alternative
10
+ * presentation (e.g. a "LeanAddressSummary") would read the same context and could be composed in
11
+ * its place — swapping the presentation is a composition change, not a new data-binding.
12
+ */
13
+ export type AddressSummaryFields = Readonly<{
14
+ recipientName?: string | null;
15
+ street?: string | null;
16
+ number?: string | null;
17
+ complement?: string | null;
18
+ neighborhood?: string | null;
19
+ city?: string | null;
20
+ state?: string | null;
21
+ postalCode?: string | null;
22
+ }>;
23
+ export type AddressSummaryRootProps = {
24
+ /** The address fields provided to descendant presentational components via context. */
25
+ address: AddressSummaryFields;
26
+ children?: ReactNode;
27
+ };
28
+ export type AddressSummaryProps = {
29
+ className?: string;
30
+ /** The lines to render, in order. Defaults to recipient, street, locality when omitted. */
31
+ children?: ReactNode;
32
+ };
33
+ export type AddressSummaryLineProps = {
34
+ className?: string;
35
+ };
36
+ export declare const AddressSummaryRootDefinition: ComponentDefinition<AddressSummaryRootProps>;
37
+ export declare const AddressSummaryDefinition: ComponentDefinition<AddressSummaryProps>;
38
+ export declare const AddressSummaryRecipientDefinition: ComponentDefinition<AddressSummaryLineProps>;
39
+ export declare const AddressSummaryStreetDefinition: ComponentDefinition<AddressSummaryLineProps>;
40
+ export declare const AddressSummaryLocalityDefinition: ComponentDefinition<AddressSummaryLineProps>;
41
+ export declare function AddressSummaryRoot({ address, children }: AddressSummaryRootProps): import("react/jsx-runtime").JSX.Element;
42
+ export declare function AddressSummary({ className, children }: AddressSummaryProps): import("react/jsx-runtime").JSX.Element;
43
+ /** Who the delivery is addressed to. Renders nothing when the address carries no recipient. */
44
+ export declare function AddressSummaryRecipient({ className }: AddressSummaryLineProps): import("react/jsx-runtime").JSX.Element | null;
45
+ /** Street, number and complement on one line. Renders nothing when all three are absent. */
46
+ export declare function AddressSummaryStreet({ className }: AddressSummaryLineProps): import("react/jsx-runtime").JSX.Element | null;
47
+ /** Neighborhood, city, state and postal code on one line. Renders nothing when all are absent. */
48
+ export declare function AddressSummaryLocality({ className }: AddressSummaryLineProps): import("react/jsx-runtime").JSX.Element | null;
49
+ //#endregion
50
+ //# sourceMappingURL=address-summary.d.ts.map