@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,450 @@
1
+ # VariantSelector
2
+
3
+ **Category:** commerce
4
+ **Purpose:** Renders the variant (SKU) swatches of a PDP — one selectable group per option axis (Color, Size, Material, …). Derives the axes and per-value availability from the product's variants and publishes the shopper's selection so sibling blocks (gallery, pricing, buy button) update in place.
5
+
6
+ ---
7
+
8
+ ## Visual cues (how to identify in an image)
9
+
10
+ Use these signals to detect that a VariantSelector block is present. Position on the page is irrelevant for detection — it can appear anywhere, in any orientation. The image is the source of truth for layout.
11
+
12
+ A VariantSelector block contains any combination of:
13
+
14
+ - One or more **rows of small selectable options** representing a single product's variants — not a list of different products.
15
+ - An **axis label** like *"Color: Red"* / *"Tamanho: M"* — the option name followed by the currently selected value (often the value is bold).
16
+ - **Color circles/squares** — solid color chips, one per color.
17
+ - **Size/label pills or boxes** — short text like *P / M / G*, *38 / 39 / 40*, *Único*.
18
+ - **Thumbnail swatches** — small product images, one per variant (image swatches).
19
+ - A **radio-dot list** — a control circle with a dot when selected, beside a value label (common for voltage/material lists).
20
+ - A **selected swatch** with a visible highlight (ring, border, or filled background).
21
+ - **Greyed-out / struck-through / dimmed** options — unavailable (out-of-stock) variants, shown but not selectable.
22
+ - A **"+N more"** pill/button at the end of a row when there are more swatches than fit.
23
+
24
+ If the image shows **any one** of the above for a single product, use `VariantSelectorRoot` with one `VariantSelectorOptionGroup` per axis visible — composing inside each a title, the swatch list whose look matches the image, and (when a "+N more" pill shows) an overflow trigger (see Composition).
25
+
26
+ ---
27
+
28
+ ## When to use
29
+
30
+ - PDP variant/SKU selection (canonical use) — Color, Size, Material, or any option axis the product defines.
31
+
32
+ ## When NOT to use
33
+
34
+ - Product image gallery / thumbnail strip → use `ProductGalleryRoot`. Those thumbnails switch the *displayed image*, not the *selected variant*.
35
+ - Quantity steppers → not a variant axis.
36
+ - PLP/search facets and filters (Color/Size filters across many products) → those are search facets, not this component.
37
+ - Tabbed content or generic option pickers unrelated to a product's variants → use `TabsRoot` / a plain control.
38
+
39
+ ---
40
+
41
+ ## Composition
42
+
43
+ `VariantSelectorRoot` is the only entry point. Inside it add **one `VariantSelectorOptionGroup` per option axis** visible in the image, in top-to-bottom visual order. The group is a **container**: it binds the axis (and owns the collapse/expand state) but draws nothing itself — you compose its contents from these parts, in any order:
44
+
45
+ - `VariantSelectorGroupTitle` — the **axis name** (`Color`). Omit it when the design shows no axis label.
46
+ - `VariantSelectorGroupValue` — the **live selected value** (`Red`), a separate placeable part. Compose it beside the title (usually both inside a `Container`) to render the common `Color: Red` header; the colon separator and the value weight are **styling** on the `data-fs-*` hooks, not props. Omit it when the design shows only the axis name (e.g. above a radio list, whose selected dot already conveys the choice).
47
+ - **One swatch list** — the radiogroup of swatches. **The look is chosen by which list component you reference — there is no `displayMode` prop.** Pick one per group:
48
+ - `VariantSelectorColorSwatches` — solid color chips.
49
+ - `VariantSelectorImageSwatches` — variant thumbnail swatches.
50
+ - `VariantSelectorLabelSwatches` — text pills/boxes (sizes, materials, voltages).
51
+ - `VariantSelectorRadioSwatches` — a radio-dot list (control circle + dot + label).
52
+ - `VariantSelectorSwatches` — **auto**: infers color/image/label from the option data when you cannot tell, or want the data to decide. It never infers radio.
53
+ - `VariantSelectorOverflow` — the "+N more" trigger. Add it when the design shows the pill (or whenever a long swatch row should collapse to fit its width); it renders nothing when the swatches already fit. Composing it is what opts the group into automatic space-based collapse — there is no cap prop.
54
+
55
+ The individual swatches (`VariantSelectorOption`) are **rendered automatically** by the swatch list from the product's option values — you do **not** place `VariantSelectorOption` nodes in the schema yourself.
56
+
57
+ ```text
58
+ VariantSelectorRoot
59
+ ├── VariantSelectorOptionGroup (optionIndex=0) ← one group (container) per axis, in visual order
60
+ │ ├── Container ← "Color: Red" header (layout by composition)
61
+ │ │ ├── VariantSelectorGroupTitle "Color" → data-fs-variant-selector-group-title
62
+ │ │ └── VariantSelectorGroupValue "Red" → data-fs-variant-selector-group-value (aria-hidden echo)
63
+ │ ├── VariantSelectorColorSwatches ← the look = the swatch-list component
64
+ │ │ └── VariantSelectorOption (auto-rendered per value; rarely authored by hand)
65
+ │ └── VariantSelectorOverflow (add to collapse a row that overflows its width)
66
+ └── VariantSelectorOptionGroup (optionIndex=1)
67
+ ├── VariantSelectorGroupTitle "Size" (no value part → shows the axis name alone)
68
+ └── VariantSelectorLabelSwatches
69
+ └── VariantSelectorOption (auto-rendered per value)
70
+ ```
71
+
72
+ Child order reflects visual order. Because the parts read the axis and selection from the group via context, they can be placed freely — e.g. the title in an accordion header and the swatch list in its panel. Showing the selected value is **composition** — place a `VariantSelectorGroupValue` (usually beside the title in a `Container`) or leave it out — not a boolean prop.
73
+
74
+ **Composition rules:**
75
+
76
+ - Every `VariantSelectorOptionGroup` must be a descendant of `VariantSelectorRoot` (it throws otherwise).
77
+ - `VariantSelectorGroupTitle`, `VariantSelectorGroupValue`, the swatch list, `VariantSelectorOverflow`, and `VariantSelectorOption` must each be a descendant of a `VariantSelectorOptionGroup` (they throw otherwise) — and prefer letting the swatch list render its options automatically rather than authoring `VariantSelectorOption`.
78
+ - **Put exactly one swatch list inside each group** — its component is the look. Add a `VariantSelectorGroupTitle` unless the design shows no label, a `VariantSelectorGroupValue` beside it when the header echoes the selection (`Color: Red`), and a `VariantSelectorOverflow` only when a "+N more" pill is visible.
79
+ - **Bind the group to its axis — prefer `optionIndex`.** `optionIndex` is the zero-based axis position in the product's option order. Because you place one group per axis in top-to-bottom visual order, the index you assign lines up with the product's options by construction — this is the reliable binding when authoring from an image. Use `optionName` only when you actually know the exact catalog `ProductOption.name` (e.g. you were given the product's option list): it is matched ignoring case and accents only — the runtime does **no** plural or translation guessing, so a label read off the image (`"Voltagem"`, `"Cor"`, `"Sizes"`) will not match a differing catalog name (`"Voltagens"`, `"Color"`, `"Size"`). You may set both: a successful `optionName` match wins, and `optionIndex` is the fallback — so passing `optionIndex` as a safety net is recommended whenever you also pass `optionName`.
80
+ - A group that resolves no axis renders nothing and logs a dev warning listing the available axes (index and name) — check that warning if a group is missing.
81
+ - The `VariantSelectorGroupTitle` defaults to the catalog axis name, not the `optionName` you pass — so a tolerant or positional match still shows the correct localized label. To reproduce a design's prompt copy (e.g. `"Selecione a cor"`) set the title's `label` prop; it only changes the displayed axis name, never the axis binding. The separator (a colon) is styling, not part of the `label`.
82
+ - One group per axis — do not create two groups for the same axis.
83
+
84
+ ---
85
+
86
+ ## Components
87
+
88
+ ### VariantSelectorRoot
89
+
90
+ Root container. Derives the option axes, per-value availability, and active selection from the product, provides them via context, and publishes the selected variant id for sibling blocks. Renders a `<div data-fs-variant-selector>`.
91
+
92
+ | Prop | Type | Default | Notes |
93
+ |------|------|---------|-------|
94
+ | `selectedVariantId` | string | — | Pre-selects the viewed SKU before the shopper interacts (the page supplies it, since `productBySlug` resolves to the product group). The shopper's in-page selection wins once a swatch is activated; this prop is only the initial fallback. Usually bound by the page, not authored by hand. |
95
+
96
+ **Data:** declares `fragment VariantSelectorData on Query` (`productBySlug.options` + `productBySlug.variants`). The compiler merges it into the page query — no explicit `dataSources` entry needed.
97
+
98
+ ### VariantSelectorOptionGroup
99
+
100
+ The **container** for one option axis. Binds the axis, owns the collapse/expand state, and renders whatever you compose inside it (a title, a swatch list, an overflow trigger). Renders a `<div data-fs-variant-selector-group>` carrying `data-fs-variant-selector-group-overflow` (`"true" | "false"`). Draws no title or swatches by itself.
101
+
102
+ | Prop | Type | Default | Notes |
103
+ |------|------|---------|-------|
104
+ | `optionIndex` | number | — | Zero-based axis position, in the product's option order. **Preferred binding when authoring from an image** — you place groups in visual order, which matches the product's option order. Robust when the on-image label differs from the catalog name. With both set, an `optionName` match wins and this is the fallback |
105
+ | `optionName` | string | — | Exact catalog option name to bind (e.g. `"Color"`). Matched ignoring case and accents only — **no** plural or translation guessing. Use only when you know the real catalog name; otherwise bind by `optionIndex` |
106
+ | `reserveTriggerSpace` | boolean | `false` | Reserve space for the `+N more` trigger in the fit. Off by default: the trigger is a sibling of the swatch list (its own space), so the swatches use the full row width. Turn it **on** only when the trigger is styled **inline at the end of the swatch row** (content-sized) so it stays on the line — its measured width is then subtracted from the space available to the swatches |
107
+
108
+ > **Space-based overflow (no cap prop).** When a `VariantSelectorOverflow` is composed inside the group, the group measures its swatch row and keeps only the swatches that fit on one line, collapsing the rest behind the `+N more` trigger; the visible count re-fits on resize. The currently selected swatch is always kept visible. Without a composed `VariantSelectorOverflow`, the group never collapses (every swatch shows). There is no cap prop — space is the sole driver. By default the trigger sits in its own space (a separate line/slot), so the swatches use the full row width; set `reserveTriggerSpace` when the design places the trigger inline at the end of the swatch row.
109
+ >
110
+ > **The collapse assumes a horizontal-row swatch list.** The measurement sums the swatches' widths and reads `column-gap`, so it only makes sense when the swatch list flows as a horizontal (wrapping) row — the common case. Do **not** compose a `VariantSelectorOverflow` on a list styled as a vertical stack (`flex-col`), where a width-based fit does not apply and would collapse swatches that actually fit; a column list should simply show all its swatches.
111
+
112
+ ### VariantSelectorGroupTitle
113
+
114
+ The **axis name** inside a `VariantSelectorOptionGroup` (catalog axis name, or your `label`). Reads the axis from group context, so it stays correct wherever it is placed (including an accordion header). Renders a `<span data-fs-variant-selector-group-title>` — it labels the *radiogroup* (via `aria-labelledby`), not a single control, so it is a `<span>`, not a `<label>`. It renders the name only; compose a `VariantSelectorGroupValue` beside it to echo the selection.
115
+
116
+ | Prop | Type | Default | Notes |
117
+ |------|------|---------|-------|
118
+ | `label` | string | — | Overrides the displayed **axis name**. Defaults to the catalog axis name (`"Color"`). Set it to match a design's prompt copy (e.g. `"Selecione a cor"`). Does **not** change which axis the group binds to (that is still the group's `optionName`/`optionIndex`). Any separator (a trailing colon) is **styling** on the title's `data-fs-*` hook, not part of `label` |
119
+
120
+ ### VariantSelectorGroupValue
121
+
122
+ The **live selected value** of a `VariantSelectorOptionGroup` (`"Red"`), as its own placeable part. Compose it beside a `VariantSelectorGroupTitle` — typically both inside a `Container` — to render the common `Color: Red` header. Reads the selection from group context, so it stays live wherever it is placed. Renders a `<span data-fs-variant-selector-group-value aria-hidden="true">`. **Decorative:** the selection is announced per option, so this echo never participates in the radiogroup's accessible name (which stays the axis name). Omit it when the design shows only the axis name (e.g. above a radio list). No editor props.
123
+
124
+ ### Swatch lists — `VariantSelectorColorSwatches` / `VariantSelectorImageSwatches` / `VariantSelectorLabelSwatches` / `VariantSelectorRadioSwatches` / `VariantSelectorSwatches`
125
+
126
+ The radiogroup of swatches inside a `VariantSelectorOptionGroup`. Renders a `<div data-fs-variant-selector-group-list>` carrying `data-fs-variant-selector-group-mode` (`"color" | "image" | "label" | "radio"`) for styling, and one swatch (`VariantSelectorOption`) per option value **automatically**. **They differ only in the swatch they render** — choose the component, don't pass a mode. They take no binding props (the axis comes from the group). Use **exactly one** per group.
127
+
128
+ - **`VariantSelectorColorSwatches`** — solid color chips. A value with no hex color (hex has no catalog source — see below) degrades **per value** to its variant image, then to the value label, so a chip is never empty. Safe to choose from a design's colored swatches even when you can't supply hex.
129
+ - **`VariantSelectorImageSwatches`** — variant thumbnail swatches; degrades to the value label when a value has no image.
130
+ - **`VariantSelectorLabelSwatches`** — text pills/boxes. Use for sizes, materials, voltages, and any axis that should read as text.
131
+ - **`VariantSelectorRadioSwatches`** — a radio-dot list: a control circle showing a dot when selected, beside the value label. Use when the design shows a radio list (common for voltage/material). Typically show only the `VariantSelectorGroupTitle` (axis name) and omit the `VariantSelectorGroupValue`, since the selected dot already conveys the choice.
132
+ - **`VariantSelectorSwatches`** (auto) — infers `color` (every value has a hex color), `image` (values resolve to differing variant images), else `label`. It **never** infers radio. Reach for an explicit list when you know the look and don't want the data to decide.
133
+
134
+ > **Prefer an explicit swatch list over auto for non-color axes.** Swatch images are derived per variant, so the auto `VariantSelectorSwatches` can resolve to `image` for an axis (e.g. Size) whose values happen to map to differing variant photos. When an axis should read as text, choose `VariantSelectorLabelSwatches` rather than relying on auto. (Auto never resolves to radio — choose `VariantSelectorRadioSwatches` for a radio list.)
135
+ >
136
+ > **Shape is styling, not a component.** Swatch shape (square vs circle vs pill), size, and the selected-state highlight are expressed via the `data-fs-*` hooks in `style`. The component chooses *what content* a swatch shows; CSS chooses *how it looks*. A square radio control is `VariantSelectorRadioSwatches` + `rounded-none` on `data-fs-variant-selector-option-control` — not a different component.
137
+ >
138
+ > **`VariantSelectorColorSwatches` is safe even without a hex source.** Per-value hex (`hexColor`) has no Core Graph origin — it only reaches the component when a host injects it through context. A color list whose values carry no hex no longer renders blank chips: it falls back **per value** to the variant image, and then to the value label. So choosing the color list from a design's colored swatches is safe — worst case the chip reads as a thumbnail or text rather than an empty square.
139
+ >
140
+ > **The rendered group count follows the live product's axes, not the design.** A product may expose fewer axes — or in a different order — than the image showed, so do not assume every axis in the screenshot exists at runtime. A group bound by position (`optionIndex`) attaches to whatever axis lands at that index; with `VariantSelectorLabelSwatches` that is harmless (a mismatch just shows different text), but with `VariantSelectorImageSwatches`/`VariantSelectorColorSwatches` it is visible — an image list paints the wrong axis's variant photo, e.g. a size axis rendered as clothing photos when the catalog carries only `Tamanho`. So when a design mixes swatch looks across axes, prefer binding the group of a non-label list by `optionName` — set only when you know the exact catalog `ProductOption.name`, never the on-image label (the runtime does no plural/translation guessing) — so the look pairs with its intended axis. This is a trade-off, not an absolute: a name that does not match renders nothing, which is acceptable for an image/color list (a phantom photo-swatch is worse) but not for the only label list, whose group should keep an `optionIndex` fallback so a lone axis still renders as readable text.
141
+
142
+ ### VariantSelectorOverflow
143
+
144
+ 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 (the count is `data-fs-variant-selector-overflow-count`). Renders a `<button data-fs-variant-selector-overflow-trigger>`, or nothing while the swatches fit. Author it after the swatch list; omit it when the row should never collapse. No editor props.
145
+
146
+ ### VariantSelectorOption
147
+
148
+ A single swatch within a swatch list. Reflects checked/disabled state and activates the matching variant on selection. Rendered automatically by the swatch list from the axis values — usually not authored directly in a schema. Renders the swatch per its list: a text label (`data-fs-variant-selector-option-label`), `<img data-fs-variant-selector-option-image>`, a color chip `data-fs-variant-selector-option-color`, or — in a radio list — a control circle (`data-fs-variant-selector-option-control`) holding the dot (`data-fs-variant-selector-option-indicator`, shown when checked) beside the value label (`data-fs-variant-selector-option-label`). The value text carries `data-fs-variant-selector-option-label` in every list (label, image/color fallback, and radio), so "an option's value text" has one selector everywhere. In a color list a value with no hex falls back to its variant image, then to the value label, so a swatch is never empty. No editor props.
149
+
150
+ ---
151
+
152
+ ## Canonical schema example
153
+
154
+ A two-axis PDP variant selector as it would appear in a generated page schema — color chips for the first axis, text pills for the second. The color group shows the `Color: Red` header composed from a `Container` wrapping the axis-name title and the selected-value part; the size group shows the axis name alone:
155
+
156
+ ```json
157
+ {
158
+ "variant-selector": {
159
+ "type": "VariantSelectorRoot",
160
+ "children": ["variant-color", "variant-size"]
161
+ },
162
+ "variant-color": {
163
+ "type": "VariantSelectorOptionGroup",
164
+ "props": { "optionIndex": 0 },
165
+ "children": ["variant-color-header", "variant-color-swatches"]
166
+ },
167
+ "variant-color-header": {
168
+ "type": "Container",
169
+ "children": ["variant-color-title", "variant-color-value"],
170
+ "style": ["inline-flex", "items-center", "gap-[4px]", "[&_[data-fs-variant-selector-group-title]]:after:content-[':']", "[&_[data-fs-variant-selector-group-value]]:font-bold"]
171
+ },
172
+ "variant-color-title": { "type": "VariantSelectorGroupTitle" },
173
+ "variant-color-value": { "type": "VariantSelectorGroupValue" },
174
+ "variant-color-swatches": { "type": "VariantSelectorColorSwatches" },
175
+ "variant-size": {
176
+ "type": "VariantSelectorOptionGroup",
177
+ "props": { "optionIndex": 1 },
178
+ "children": ["variant-size-title", "variant-size-swatches"]
179
+ },
180
+ "variant-size-title": { "type": "VariantSelectorGroupTitle" },
181
+ "variant-size-swatches": { "type": "VariantSelectorLabelSwatches" }
182
+ }
183
+ ```
184
+
185
+ > Groups bind by `optionIndex` in visual order (0 = first axis from the top). Add `"optionName"` only when you know the exact catalog name; the index stays as the safety net. The swatch look is the swatch-list `type` — no `displayMode` prop. The colon and value weight in the `Color: Red` header are **styling** on the `Container` (targeting the title/value hooks); showing the value at all is composition — include a `VariantSelectorGroupValue` or leave it out.
186
+
187
+ ### Custom axis-name label (design prompt copy)
188
+
189
+ When the design labels the axis with prompt copy (`"Selecione a cor"`, `"Choose a size"`) instead of the bare catalog name, set `label` on the title. The axis still binds on the group (`optionIndex`/`optionName`); only the displayed axis name changes. The selected value stays a separate `VariantSelectorGroupValue`, and the colon between them is styling — so keep the colon **out** of `label`.
190
+
191
+ ```json
192
+ {
193
+ "variant-color": {
194
+ "type": "VariantSelectorOptionGroup",
195
+ "props": { "optionIndex": 0 },
196
+ "children": ["variant-color-header", "variant-color-swatches"]
197
+ },
198
+ "variant-color-header": {
199
+ "type": "Container",
200
+ "children": ["variant-color-title", "variant-color-value"],
201
+ "style": ["inline-flex", "items-center", "gap-[4px]", "[&_[data-fs-variant-selector-group-title]]:after:content-[':']", "[&_[data-fs-variant-selector-group-value]]:font-bold"]
202
+ },
203
+ "variant-color-title": {
204
+ "type": "VariantSelectorGroupTitle",
205
+ "props": { "label": "Selecione a cor" }
206
+ },
207
+ "variant-color-value": { "type": "VariantSelectorGroupValue" },
208
+ "variant-color-swatches": { "type": "VariantSelectorColorSwatches" }
209
+ }
210
+ ```
211
+
212
+ ### Single-axis variant (only one axis visible in the image)
213
+
214
+ ```json
215
+ {
216
+ "variant-selector": {
217
+ "type": "VariantSelectorRoot",
218
+ "children": ["variant-size"]
219
+ },
220
+ "variant-size": {
221
+ "type": "VariantSelectorOptionGroup",
222
+ "props": { "optionIndex": 0 },
223
+ "children": ["variant-size-title", "variant-size-swatches"]
224
+ },
225
+ "variant-size-title": { "type": "VariantSelectorGroupTitle" },
226
+ "variant-size-swatches": { "type": "VariantSelectorLabelSwatches" }
227
+ }
228
+ ```
229
+
230
+ ### Radio-dot variant (a stacked voltage list with the design's prompt copy)
231
+
232
+ ```json
233
+ {
234
+ "variant-voltage": {
235
+ "type": "VariantSelectorOptionGroup",
236
+ "props": { "optionIndex": 1 },
237
+ "children": ["variant-voltage-title", "variant-voltage-swatches"]
238
+ },
239
+ "variant-voltage-title": {
240
+ "type": "VariantSelectorGroupTitle",
241
+ "props": { "label": "Selecione a voltagem:" }
242
+ },
243
+ "variant-voltage-swatches": { "type": "VariantSelectorRadioSwatches" }
244
+ }
245
+ ```
246
+
247
+ > The radio dot already conveys the selection, so this group composes **only** the title (no `VariantSelectorGroupValue`) — the way to "not echo the value" is to leave the value part out, not a boolean prop.
248
+
249
+ ### Overflow variant ("+N more" pill visible on a long row)
250
+
251
+ Add a `VariantSelectorOverflow` after the swatch list — composing it is what enables the collapse; the group measures the row and keeps only the swatches that fit, revealing the rest via the trigger. There is no cap prop:
252
+
253
+ ```json
254
+ {
255
+ "variant-selector": {
256
+ "type": "VariantSelectorRoot",
257
+ "children": ["variant-size"]
258
+ },
259
+ "variant-size": {
260
+ "type": "VariantSelectorOptionGroup",
261
+ "props": { "optionIndex": 0 },
262
+ "children": ["variant-size-title", "variant-size-swatches", "variant-size-overflow"]
263
+ },
264
+ "variant-size-title": { "type": "VariantSelectorGroupTitle" },
265
+ "variant-size-swatches": { "type": "VariantSelectorLabelSwatches" },
266
+ "variant-size-overflow": { "type": "VariantSelectorOverflow" }
267
+ }
268
+ ```
269
+
270
+ By default the trigger sits in its **own space** (a separate line/slot below the swatch row). To place it **inline at the end of the swatch row**, set `reserveTriggerSpace` on the group and style the trigger out of flow at the row's end (pin it with `absolute`); the reserved width keeps the last visible swatch clear of it. The style hooks live on the group, targeting the `data-fs-variant-selector-overflow-trigger` descendant:
271
+
272
+ ```json
273
+ {
274
+ "variant-size": {
275
+ "type": "VariantSelectorOptionGroup",
276
+ "props": { "optionIndex": 0, "reserveTriggerSpace": true },
277
+ "children": ["variant-size-swatches", "variant-size-overflow"],
278
+ "style": [
279
+ "relative",
280
+ "[&_[data-fs-variant-selector-group-list]]:flex",
281
+ "[&_[data-fs-variant-selector-group-list]]:flex-wrap",
282
+ "[&_[data-fs-variant-selector-group-list]]:gap-[8px]",
283
+ "[&_[data-fs-variant-selector-overflow-trigger]]:absolute",
284
+ "[&_[data-fs-variant-selector-overflow-trigger]]:right-0",
285
+ "[&_[data-fs-variant-selector-overflow-trigger]]:bottom-0"
286
+ ]
287
+ },
288
+ "variant-size-swatches": { "type": "VariantSelectorLabelSwatches" },
289
+ "variant-size-overflow": { "type": "VariantSelectorOverflow" }
290
+ }
291
+ ```
292
+
293
+ > A trigger that should flow **right after** the swatches (rather than pinned to the row's end) needs no `reserveTriggerSpace`: lay the group out as a flex row with a `flex-1` swatch list, and flexbox makes room for the trigger on its own.
294
+
295
+ ---
296
+
297
+ ## Common mistakes
298
+
299
+ - **Inventing `SkuSelector`, `Swatch`, `VariantPicker`, `OptionSelector`.** The root is `VariantSelectorRoot`; each axis is a `VariantSelectorOptionGroup` holding a title and a swatch list.
300
+ - **Passing a `displayMode` / `variant` / `type` / `mode` prop to pick the look.** There is no such prop. The swatch look is the swatch-list component you reference: `VariantSelectorColorSwatches`, `VariantSelectorImageSwatches`, `VariantSelectorLabelSwatches`, `VariantSelectorRadioSwatches`, or `VariantSelectorSwatches` (auto). Picking the wrong component, not a wrong prop value, is the failure mode to avoid.
301
+ - **Leaving the group empty, or with no swatch list.** `VariantSelectorOptionGroup` is a container that draws nothing itself — it needs a swatch list inside it (plus, usually, a `VariantSelectorGroupTitle`). Put **exactly one** swatch list per group; two lists for the same axis is wrong.
302
+ - **Putting the title/swatch list/overflow on the old `VariantSelectorColorGroup` etc.** Those merged components no longer exist. Use `VariantSelectorOptionGroup` as the container and compose the parts inside it.
303
+ - **Inventing a `shape`/`variant` prop, or a component per shape (`square`, `circle`, `pill`).** Shape, size, and the selected-state highlight are styling — express them with the `data-fs-*` hooks in `style`. The component chooses *what content* a swatch shows; CSS chooses *how it looks*. A square radio control is `VariantSelectorRadioSwatches` + `rounded-none` on `data-fs-variant-selector-option-control`.
304
+ - **Authoring a `VariantSelectorOption` per value.** The swatch list renders its options automatically from the product data — only compose `VariantSelectorRoot` + one group per axis, each holding a title and a swatch list.
305
+ - **Putting a `VariantSelectorOptionGroup` outside `VariantSelectorRoot`, or a title/swatch list/overflow outside a group.** They read context and throw otherwise.
306
+ - **One group with multiple axes, or two groups for the same axis.** Use exactly one group per distinct axis.
307
+ - **Relying on auto (`VariantSelectorSwatches`) for a text axis.** Per-variant images can make auto resolve a Size axis to image (clothing photos instead of size pills). Choose `VariantSelectorLabelSwatches` when the axis should read as text. Auto also never picks radio — choose `VariantSelectorRadioSwatches` for a radio list.
308
+ - **Putting `label` on the group.** `label` is a `VariantSelectorGroupTitle` prop. The group only takes `optionName`, `optionIndex`, and `reserveTriggerSpace`.
309
+ - **Looking for a `showSelectedValue` prop to hide the selection.** There is none. The selected value is its own part (`VariantSelectorGroupValue`): to show `Color: Red`, compose a value beside the title (usually in a `Container`); to show only the axis name, leave the value out. The colon and value weight are styling on the `data-fs-*` hooks, never props or hard-coded text.
310
+ - **Expecting the radiogroup's accessible name to be `Color: Red`.** It is the axis name alone (`Color`). The value is `aria-hidden` and the selection is announced per option, so the group name never churns on selection.
311
+ - **Copying the on-image label into `optionName`.** The image label is a display hint; matching is case/accent-insensitive only — it does not guess plurals or translations (`"Voltagem"`≠`"Voltagens"`, `"Cor"`≠`"Color"`, `"Sizes"`≠`"Size"`). Bind with `optionIndex` (the group's visual position) and only add `optionName` when you know the exact catalog name. If you want the on-image prompt text (`"Selecione a cor:"`) shown, put it in the title's `label`, not `optionName`.
312
+ - **Assuming every axis in the design renders, and letting an image/color list fall onto the wrong one.** The rendered group count follows the live product's axes, not the screenshot. A group bound only by `optionIndex` attaches to whatever axis sits at that index, so when the product exposes fewer/reordered axes an image list paints that axis's variant photo (sizes shown as clothing photos). Prefer binding the group of an image/color list by `optionName`; keep the `optionIndex` fallback on the label list's group, where a positional mismatch only swaps text.
313
+ - **Using it for the image gallery thumbnails.** Those switch the displayed image only — use `ProductGalleryRoot`. VariantSelector changes the *selected variant* (which in turn refreshes the gallery).
314
+ - **Using it for PLP/search Color/Size filters.** Those are search facets across many products, not a single product's variants.
315
+ - **Passing variant data as props (`options`, `variants`, `value`).** The component reads from `$data` (the merged fragment); the only configuration props are `optionName`/`optionIndex`/`reserveTriggerSpace` on the group and `label` on the title.
316
+ - **Wrapping `VariantSelectorRoot` on a non-PDP page.** It requires `productBySlug` in the page query context. Use only on routes that resolve a product.
317
+
318
+ ---
319
+
320
+ ## Styling
321
+
322
+ Style `VariantSelectorRoot` as a vertical stack of axis groups. Each `VariantSelectorOptionGroup` styles its own header and lays its swatches out in a wrapping row; because the swatch list renders the swatches and the group is their common ancestor, per-swatch styling is expressed on the **group's** `style` via descendant arbitrary variants targeting the `data-fs-*` hooks (e.g. `[&_[data-fs-variant-selector-option]]:rounded-full`). Read swatch shape, size, and the selected-state highlight off the image. All swatch lists expose the same `data-fs-*` hooks, so the style sets below apply regardless of which list you chose.
323
+
324
+ **The `Color: Red` header is styling, not baked in.** The title (`data-fs-variant-selector-group-title`) renders only the axis name and the value (`data-fs-variant-selector-group-value`) renders only the selection — the **separator, weight, and spacing** between them are yours to set. Put the pair in a row (a `Container`, or the group itself) and express:
325
+
326
+ - **separator** (the colon): `[&_[data-fs-variant-selector-group-title]]:after:content-[':']` — or an em-dash, or nothing.
327
+ - **value weight:** `[&_[data-fs-variant-selector-group-value]]:font-bold`.
328
+ - **spacing / layout:** `inline-flex items-center gap-[4px]` on the row.
329
+
330
+ A design wanting no colon, the value beside the swatches, or no value at all just changes the composition/styling.
331
+
332
+ | Component | What you style | Plausible classes |
333
+ |---|---|---|
334
+ | `VariantSelectorRoot` | Stacks the axis groups | `flex flex-col gap-[24px]` |
335
+ | `VariantSelectorOptionGroup` | The axis: header + wrapping swatch row, plus per-swatch look via descendant selectors | `flex flex-col gap-[8px]` · `[&_[data-fs-variant-selector-group-title]]:text-[13px] [&_[data-fs-variant-selector-group-title]]:text-[#666]` · `[&_[data-fs-variant-selector-group-list]]:flex [&_[data-fs-variant-selector-group-list]]:flex-wrap [&_[data-fs-variant-selector-group-list]]:gap-[8px]` |
336
+ | `VariantSelectorGroupTitle` / `VariantSelectorGroupValue` | The `axis-name : value` header, laid out in a row (Container or the group) | `inline-flex items-center gap-[4px]` · `[&_[data-fs-variant-selector-group-title]]:after:content-[':']` · `[&_[data-fs-variant-selector-group-value]]:font-bold` |
337
+
338
+ Per-swatch descendant variants you place on the group's `style` (pick the set matching the swatch list inside it):
339
+
340
+ - **`VariantSelectorLabelSwatches` (label/box swatches):** `[&_[data-fs-variant-selector-option]]:rounded-[6px] [&_[data-fs-variant-selector-option]]:border [&_[data-fs-variant-selector-option]]:border-[#ccc] [&_[data-fs-variant-selector-option]]:px-[16px] [&_[data-fs-variant-selector-option]]:py-[8px] [&_[data-fs-variant-selector-option][data-fs-variant-selector-option-checked=true]]:border-[#111] [&_[data-fs-variant-selector-option][data-fs-variant-selector-option-checked=true]]:bg-[#111] [&_[data-fs-variant-selector-option][data-fs-variant-selector-option-checked=true]]:text-white [&_[data-fs-variant-selector-option][data-fs-variant-selector-option-disabled=true]]:opacity-40 [&_[data-fs-variant-selector-option][data-fs-variant-selector-option-disabled=true]]:line-through`
341
+ - **`VariantSelectorColorSwatches` (color chips):** `[&_[data-fs-variant-selector-option-color]]:h-[28px] [&_[data-fs-variant-selector-option-color]]:w-[28px] [&_[data-fs-variant-selector-option-color]]:rounded-full [&_[data-fs-variant-selector-option-color]]:[background-color:var(--fs-variant-selector-option-color-bkg-color)] [&_[data-fs-variant-selector-option][data-fs-variant-selector-option-checked=true]]:ring-2 [&_[data-fs-variant-selector-option][data-fs-variant-selector-option-checked=true]]:ring-[#111]`
342
+ - **`VariantSelectorImageSwatches` (image swatches):** `[&_[data-fs-variant-selector-option-image]]:block [&_[data-fs-variant-selector-option-image]]:h-[64px] [&_[data-fs-variant-selector-option-image]]:w-[64px] [&_[data-fs-variant-selector-option-image]]:object-cover [&_[data-fs-variant-selector-option]]:rounded-[6px] [&_[data-fs-variant-selector-option]]:border-2 [&_[data-fs-variant-selector-option]]:border-transparent [&_[data-fs-variant-selector-option][data-fs-variant-selector-option-checked=true]]:border-[#111]`
343
+ - **`VariantSelectorRadioSwatches` (radio-dot):** lay each option out as a row and draw the ring + dot on the control/indicator hooks. For a square control swap `rounded-full` → `rounded-none` — no component change. `[&_[data-fs-variant-selector-option]]:flex [&_[data-fs-variant-selector-option]]:items-center [&_[data-fs-variant-selector-option]]:gap-[8px] [&_[data-fs-variant-selector-option-control]]:grid [&_[data-fs-variant-selector-option-control]]:place-items-center [&_[data-fs-variant-selector-option-control]]:h-[18px] [&_[data-fs-variant-selector-option-control]]:w-[18px] [&_[data-fs-variant-selector-option-control]]:rounded-full [&_[data-fs-variant-selector-option-control]]:border [&_[data-fs-variant-selector-option-control]]:border-[#8A8A8A] [&_[data-fs-variant-selector-option][data-fs-variant-selector-option-checked=true]_[data-fs-variant-selector-option-control]]:border-[#C8102E] [&_[data-fs-variant-selector-option-indicator]]:h-[10px] [&_[data-fs-variant-selector-option-indicator]]:w-[10px] [&_[data-fs-variant-selector-option-indicator]]:rounded-full [&_[data-fs-variant-selector-option-indicator]]:bg-[#C8102E]`
344
+ - **`VariantSelectorOverflow` ("+N more" trigger):** `[&_[data-fs-variant-selector-overflow-trigger]]:rounded-[6px] [&_[data-fs-variant-selector-overflow-trigger]]:border [&_[data-fs-variant-selector-overflow-trigger]]:border-dashed [&_[data-fs-variant-selector-overflow-trigger]]:px-[16px] [&_[data-fs-variant-selector-overflow-trigger]]:py-[8px] [&_[data-fs-variant-selector-overflow-trigger]]:text-[13px]`
345
+
346
+ Styled example (color + label-size; the color row composes a `VariantSelectorOverflow`, so it collapses to fit its width):
347
+
348
+ ```json
349
+ {
350
+ "variant-selector": {
351
+ "type": "VariantSelectorRoot",
352
+ "children": ["variant-color", "variant-size"],
353
+ "style": ["flex", "flex-col", "gap-[24px]"]
354
+ },
355
+ "variant-color": {
356
+ "type": "VariantSelectorOptionGroup",
357
+ "props": { "optionIndex": 0 },
358
+ "children": ["variant-color-title", "variant-color-swatches", "variant-color-overflow"],
359
+ "style": [
360
+ "flex", "flex-col", "gap-[8px]",
361
+ "[&_[data-fs-variant-selector-group-title]]:text-[13px]",
362
+ "[&_[data-fs-variant-selector-group-list]]:flex",
363
+ "[&_[data-fs-variant-selector-group-list]]:flex-wrap",
364
+ "[&_[data-fs-variant-selector-group-list]]:gap-[8px]",
365
+ "[&_[data-fs-variant-selector-option-color]]:h-[28px]",
366
+ "[&_[data-fs-variant-selector-option-color]]:w-[28px]",
367
+ "[&_[data-fs-variant-selector-option-color]]:rounded-full",
368
+ "[&_[data-fs-variant-selector-option-color]]:[background-color:var(--fs-variant-selector-option-color-bkg-color)]",
369
+ "[&_[data-fs-variant-selector-option][data-fs-variant-selector-option-checked=true]]:ring-2",
370
+ "[&_[data-fs-variant-selector-option][data-fs-variant-selector-option-checked=true]]:ring-[#111]"
371
+ ]
372
+ },
373
+ "variant-color-title": { "type": "VariantSelectorGroupTitle" },
374
+ "variant-color-swatches": { "type": "VariantSelectorColorSwatches" },
375
+ "variant-color-overflow": { "type": "VariantSelectorOverflow" },
376
+ "variant-size": {
377
+ "type": "VariantSelectorOptionGroup",
378
+ "props": { "optionIndex": 1 },
379
+ "children": ["variant-size-title", "variant-size-swatches"],
380
+ "style": [
381
+ "flex", "flex-col", "gap-[8px]",
382
+ "[&_[data-fs-variant-selector-group-list]]:flex",
383
+ "[&_[data-fs-variant-selector-group-list]]:flex-wrap",
384
+ "[&_[data-fs-variant-selector-group-list]]:gap-[8px]",
385
+ "[&_[data-fs-variant-selector-option]]:rounded-[6px]",
386
+ "[&_[data-fs-variant-selector-option]]:border",
387
+ "[&_[data-fs-variant-selector-option]]:border-[#ccc]",
388
+ "[&_[data-fs-variant-selector-option]]:px-[16px]",
389
+ "[&_[data-fs-variant-selector-option]]:py-[8px]",
390
+ "[&_[data-fs-variant-selector-option][data-fs-variant-selector-option-checked=true]]:border-[#111]",
391
+ "[&_[data-fs-variant-selector-option][data-fs-variant-selector-option-checked=true]]:bg-[#111]",
392
+ "[&_[data-fs-variant-selector-option][data-fs-variant-selector-option-checked=true]]:text-white",
393
+ "[&_[data-fs-variant-selector-option][data-fs-variant-selector-option-disabled=true]]:opacity-40",
394
+ "[&_[data-fs-variant-selector-option][data-fs-variant-selector-option-disabled=true]]:line-through"
395
+ ]
396
+ },
397
+ "variant-size-title": { "type": "VariantSelectorGroupTitle" },
398
+ "variant-size-swatches": { "type": "VariantSelectorLabelSwatches" }
399
+ }
400
+ ```
401
+
402
+ The per-swatch style lives on the group (the swatches' common ancestor); the title, swatch list, and overflow children carry no `style` of their own unless you need to tweak one in isolation.
403
+
404
+ Radio-dot example (a stacked voltage list with the design's prompt copy):
405
+
406
+ ```json
407
+ {
408
+ "variant-voltage": {
409
+ "type": "VariantSelectorOptionGroup",
410
+ "props": { "optionIndex": 1 },
411
+ "children": ["variant-voltage-title", "variant-voltage-swatches"],
412
+ "style": [
413
+ "flex", "flex-col", "gap-[8px]",
414
+ "[&_[data-fs-variant-selector-group-list]]:flex",
415
+ "[&_[data-fs-variant-selector-group-list]]:flex-col",
416
+ "[&_[data-fs-variant-selector-group-list]]:gap-[12px]",
417
+ "[&_[data-fs-variant-selector-option]]:flex",
418
+ "[&_[data-fs-variant-selector-option]]:items-center",
419
+ "[&_[data-fs-variant-selector-option]]:gap-[8px]",
420
+ "[&_[data-fs-variant-selector-option]]:cursor-pointer",
421
+ "[&_[data-fs-variant-selector-option-control]]:grid",
422
+ "[&_[data-fs-variant-selector-option-control]]:place-items-center",
423
+ "[&_[data-fs-variant-selector-option-control]]:h-[18px]",
424
+ "[&_[data-fs-variant-selector-option-control]]:w-[18px]",
425
+ "[&_[data-fs-variant-selector-option-control]]:rounded-full",
426
+ "[&_[data-fs-variant-selector-option-control]]:border",
427
+ "[&_[data-fs-variant-selector-option-control]]:border-[#8A8A8A]",
428
+ "[&_[data-fs-variant-selector-option][data-fs-variant-selector-option-checked=true]_[data-fs-variant-selector-option-control]]:border-[#C8102E]",
429
+ "[&_[data-fs-variant-selector-option-indicator]]:h-[10px]",
430
+ "[&_[data-fs-variant-selector-option-indicator]]:w-[10px]",
431
+ "[&_[data-fs-variant-selector-option-indicator]]:rounded-full",
432
+ "[&_[data-fs-variant-selector-option-indicator]]:bg-[#C8102E]",
433
+ "[&_[data-fs-variant-selector-option][data-fs-variant-selector-option-disabled=true]]:opacity-40"
434
+ ]
435
+ },
436
+ "variant-voltage-title": {
437
+ "type": "VariantSelectorGroupTitle",
438
+ "props": { "label": "Selecione a voltagem:" }
439
+ },
440
+ "variant-voltage-swatches": { "type": "VariantSelectorRadioSwatches" }
441
+ }
442
+ ```
443
+
444
+ ---
445
+
446
+ ## Related
447
+
448
+ - [[product-gallery]] — the product media gallery. It *consumes* the variant the selector publishes: picking a swatch refreshes the gallery image in place. Distinct block; do not nest.
449
+ - [[pricing]] — the product offer block; updates to reflect the selected variant. Distinct block; do not nest.
450
+ - [[buy-button]] — the add-to-cart action for the selected variant. Distinct block; do not nest.
@@ -0,0 +1,12 @@
1
+ import { SubgraphDefinition } from "./types.js";
2
+ //#region src/graphql/define-subgraph.d.ts
3
+ /**
4
+ * The single authoring primitive: a validating identity. `defineSubgraph`
5
+ * does not build a schema (see `buildSubgraph`); it hands the declaration
6
+ * back unchanged so the same object can be inspected by the runner, printed
7
+ * by `printSubgraphSdl`, and built by `buildSubgraph` — one declaration,
8
+ * three consumers.
9
+ */
10
+ export declare function defineSubgraph(definition: SubgraphDefinition): SubgraphDefinition;
11
+ //#endregion
12
+ //# sourceMappingURL=define-subgraph.d.ts.map
@@ -0,0 +1,15 @@
1
+ //#region src/graphql/define-subgraph.ts
2
+ /**
3
+ * The single authoring primitive: a validating identity. `defineSubgraph`
4
+ * does not build a schema (see `buildSubgraph`); it hands the declaration
5
+ * back unchanged so the same object can be inspected by the runner, printed
6
+ * by `printSubgraphSdl`, and built by `buildSubgraph` — one declaration,
7
+ * three consumers.
8
+ */
9
+ function defineSubgraph(definition) {
10
+ return definition;
11
+ }
12
+ //#endregion
13
+ export { defineSubgraph };
14
+
15
+ //# sourceMappingURL=define-subgraph.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"define-subgraph.js","names":[],"sources":["../../src/graphql/define-subgraph.ts"],"sourcesContent":["import type { SubgraphDefinition } from './types';\n\n/**\n * The single authoring primitive: a validating identity. `defineSubgraph`\n * does not build a schema (see `buildSubgraph`); it hands the declaration\n * back unchanged so the same object can be inspected by the runner, printed\n * by `printSubgraphSdl`, and built by `buildSubgraph` — one declaration,\n * three consumers.\n */\nexport function defineSubgraph(definition: SubgraphDefinition): SubgraphDefinition {\n return definition;\n}\n"],"mappings":";;;;;;;;AASA,SAAgB,eAAe,YAAoD;CACjF,OAAO;AACT"}
@@ -0,0 +1,10 @@
1
+ //#region src/graphql/gql.d.ts
2
+ /**
3
+ * Identity template literal tag: returns the interpolated string unchanged.
4
+ * `typeDefs` is a plain SDL string (see `SubgraphDefinition`); `gql` exists
5
+ * purely so editor tooling (GraphQL syntax highlighting, embedded-language
6
+ * plugins) recognizes the literal. It performs no parsing.
7
+ */
8
+ export declare function gql(literals: TemplateStringsArray, ...args: unknown[]): string;
9
+ //#endregion
10
+ //# sourceMappingURL=gql.d.ts.map
@@ -0,0 +1,16 @@
1
+ //#region src/graphql/gql.ts
2
+ /**
3
+ * Identity template literal tag: returns the interpolated string unchanged.
4
+ * `typeDefs` is a plain SDL string (see `SubgraphDefinition`); `gql` exists
5
+ * purely so editor tooling (GraphQL syntax highlighting, embedded-language
6
+ * plugins) recognizes the literal. It performs no parsing.
7
+ */
8
+ function gql(literals, ...args) {
9
+ let result = literals[0] ?? "";
10
+ for (let i = 0; i < args.length; i++) result += String(args[i]) + (literals[i + 1] ?? "");
11
+ return result;
12
+ }
13
+ //#endregion
14
+ export { gql };
15
+
16
+ //# sourceMappingURL=gql.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gql.js","names":[],"sources":["../../src/graphql/gql.ts"],"sourcesContent":["/**\n * Identity template literal tag: returns the interpolated string unchanged.\n * `typeDefs` is a plain SDL string (see `SubgraphDefinition`); `gql` exists\n * purely so editor tooling (GraphQL syntax highlighting, embedded-language\n * plugins) recognizes the literal. It performs no parsing.\n */\nexport function gql(literals: TemplateStringsArray, ...args: unknown[]): string {\n let result = literals[0] ?? '';\n\n for (let i = 0; i < args.length; i++) {\n result += String(args[i]) + (literals[i + 1] ?? '');\n }\n\n return result;\n}\n"],"mappings":";;;;;;;AAMA,SAAgB,IAAI,UAAgC,GAAG,MAAyB;CAC9E,IAAI,SAAS,SAAS,MAAM;CAE5B,KAAK,IAAI,IAAI,GAAG,IAAI,KAAK,QAAQ,KAC/B,UAAU,OAAO,KAAK,EAAE,KAAK,SAAS,IAAI,MAAM;CAGlD,OAAO;AACT"}
@@ -0,0 +1,88 @@
1
+ import { GraphQLFieldResolver, GraphQLScalarType } from "graphql";
2
+ //#region src/graphql/types.d.ts
3
+ /**
4
+ * The extension's entire resolver security surface — exactly five keys, and
5
+ * nothing more (see ADR-0003). `buildContext` assembles it from the inbound
6
+ * subgraph request plus the declared secrets; the Seam A key-set test pins
7
+ * that a resolver sees these five keys and no raw request state.
8
+ */
9
+ export type SubgraphContext = {
10
+ /** Canonical `x-vtex-account`, verbatim; `''` when absent (router-bypass). */
11
+ account: string;
12
+ /** Canonical `x-vtex-workspace`, verbatim; `''` when absent. */
13
+ workspace: string;
14
+ /**
15
+ * The curated allow-list of forwarded `x-vtex-*` headers (locale, segment,
16
+ * session) — never `authorization` (that is `token`) or the tenant pair
17
+ * (that is `account`/`workspace`). Values keep Node's `string | string[]`
18
+ * shape; absent allow-listed headers are omitted.
19
+ */
20
+ headers: Record<string, string | string[]>;
21
+ /** Forwarded `authorization` header, verbatim (no `Bearer`-stripping); `''` when absent. */
22
+ token: string;
23
+ /**
24
+ * The declared secret names present in the environment, mapped to their
25
+ * values. Undeclared and declared-but-unset names are both absent (open
26
+ * record — declared-names typing holds at runtime, not in TS generics).
27
+ */
28
+ secrets: Record<string, string | undefined>;
29
+ };
30
+ /**
31
+ * The same resolver map shape `buildSubgraphSchema` accepts, with the context an author's
32
+ * resolver actually receives as the default.
33
+ *
34
+ * `TContext` defaults to `SubgraphContext` rather than being fixed to `unknown`, because under
35
+ * `strictFunctionTypes` an `unknown` context makes the third argument contravariant, and that
36
+ * rejects the very annotation this type is meant to support:
37
+ * `(_parent, _args, ctx: SubgraphContext) => …` did not compile. Naming it also lets an
38
+ * unannotated `ctx` infer instead of widening to `unknown`.
39
+ *
40
+ * The runner passes `SubgraphResolvers<unknown>` where it hands the map to
41
+ * `buildSubgraphSchema`, whose own signature is context-agnostic (`GraphQLResolverMap<any>`).
42
+ *
43
+ * Restated locally, rather than imported from `@apollo/subgraph`'s `GraphQLResolverMap<unknown>`,
44
+ * so `./graphql` stays a zero-import island with no `@apollo/subgraph` dependency.
45
+ */
46
+ export type SubgraphResolvers<TContext = SubgraphContext> = {
47
+ [typeName: string]: {
48
+ [fieldName: string]: GraphQLFieldResolver<any, TContext> | {
49
+ requires?: string;
50
+ resolve?: GraphQLFieldResolver<any, TContext>;
51
+ subscribe?: GraphQLFieldResolver<any, TContext>;
52
+ };
53
+ } | GraphQLScalarType | {
54
+ [enumValue: string]: string | number;
55
+ };
56
+ };
57
+ /**
58
+ * The single primitive an extension author calls. `typeDefs` is plain SDL:
59
+ * the author writes `@key`/`@external` on entities they extend; the SDK
60
+ * injects the federation `@link` preamble, generates each entity's
61
+ * `__resolveReference`, and prefixes every name the extension contributes
62
+ * with `vendor_` (see `applyVendorPrefix` in `./vendor-prefix`).
63
+ */
64
+ export type SubgraphDefinition = {
65
+ /**
66
+ * Required. The publisher's VTEX vendor; validated `^[a-z][a-z0-9]*$`.
67
+ * Prefixes every name this subgraph contributes (entity-extension fields,
68
+ * root fields, and declared types) — applied by the SDK, never typed by
69
+ * the author. See ADR-0001.
70
+ */
71
+ vendor: string;
72
+ /** Defaults to the package name; the subgraph name used at compose time. */
73
+ name?: string;
74
+ /** Plain SDL, authored with bare names. The SDK applies the vendor prefix. */
75
+ typeDefs: string;
76
+ /** Core entities this subgraph extends (e.g. `['Product']`); must be on the bundled allow-list. */
77
+ extends: string[];
78
+ /** Author resolvers keyed by bare names; the SDK remaps keys to the prefixed names and merges __resolveReference. */
79
+ resolvers: SubgraphResolvers;
80
+ /**
81
+ * Env-var names this extension declares it needs. Their values populate
82
+ * `ctx.secrets` (read from `process.env`); undeclared names never reach a
83
+ * resolver. Optional — an extension with no secrets omits it. See ADR-0003.
84
+ */
85
+ secrets?: string[];
86
+ };
87
+ //#endregion
88
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,4 @@
1
+ import { SubgraphContext, SubgraphDefinition, SubgraphResolvers } from "./graphql/types.js";
2
+ import { defineSubgraph } from "./graphql/define-subgraph.js";
3
+ import { gql } from "./graphql/gql.js";
4
+ export { type SubgraphContext, type SubgraphDefinition, type SubgraphResolvers, defineSubgraph, gql };