@dropins/storefront-checkout 0.1.0-alpha4 → 0.1.0-alpha40

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 (357) hide show
  1. package/__generated__/types.d.ts +15363 -0
  2. package/api/errors/errors.d.ts +27 -0
  3. package/api/errors/index.d.ts +2 -0
  4. package/api/estimateShippingMethods/estimateShippingMethods.d.ts +13 -0
  5. package/api/estimateShippingMethods/fixtures.d.ts +8 -0
  6. package/api/estimateShippingMethods/graphql/estimateShippingMethods.graphql.d.ts +2 -0
  7. package/api/estimateShippingMethods/graphql/index.d.ts +2 -0
  8. package/api/estimateShippingMethods/index.d.ts +2 -0
  9. package/api/fetch-graphql/fetch-graphql.d.ts +9 -0
  10. package/api/fetch-graphql/index.d.ts +2 -0
  11. package/api/fetchAddressFormFields/fetchAddressFormFields.d.ts +2 -0
  12. package/api/fetchAddressFormFields/fixtures.d.ts +5 -0
  13. package/api/fetchAddressFormFields/graphql/fetchAddressFormFields.graphql.d.ts +2 -0
  14. package/api/fetchAddressFormFields/index.d.ts +3 -0
  15. package/api/getCart/fixtures.d.ts +12 -0
  16. package/api/getCart/getCart.d.ts +2 -0
  17. package/api/getCart/graphql/getCart.graphql.d.ts +4 -0
  18. package/api/getCart/graphql/index.d.ts +2 -0
  19. package/api/getCart/index.d.ts +2 -0
  20. package/api/getCheckoutData/getCheckoutData.d.ts +2 -0
  21. package/api/getCheckoutData/index.d.ts +2 -0
  22. package/api/getCountries/fixtures.d.ts +6 -0
  23. package/api/getCountries/getCountries.d.ts +2 -0
  24. package/api/getCountries/graphql/getCountries.graphql.d.ts +2 -0
  25. package/api/getCountries/index.d.ts +2 -0
  26. package/api/getCustomer/fixtures.d.ts +5 -0
  27. package/api/getCustomer/getCustomer.d.ts +4 -0
  28. package/api/getCustomer/graphql/getCustomer.graphql.d.ts +2 -0
  29. package/api/getCustomer/graphql/index.d.ts +2 -0
  30. package/api/getCustomer/index.d.ts +2 -0
  31. package/api/getRegions/fixtures.d.ts +5 -0
  32. package/api/getRegions/getRegions.d.ts +5 -0
  33. package/api/getRegions/graphql/getRegions.graphql.d.ts +2 -0
  34. package/api/getRegions/index.d.ts +2 -0
  35. package/api/getStoreConfig/getStoreConfig.d.ts +6 -0
  36. package/api/getStoreConfig/graphql/getStoreConfig.graphql.d.ts +2 -0
  37. package/api/getStoreConfig/index.d.ts +2 -0
  38. package/api/index.d.ts +23 -0
  39. package/api/initialize/index.d.ts +2 -0
  40. package/api/initialize/initialize.d.ts +10 -0
  41. package/api/initialize/listeners.d.ts +4 -0
  42. package/api/initializeCheckout/index.d.ts +2 -0
  43. package/api/initializeCheckout/initializeCheckout.d.ts +2 -0
  44. package/api/isEmailAvailable/graphql/isEmailAvailable.graphql.d.ts +2 -0
  45. package/api/isEmailAvailable/index.d.ts +2 -0
  46. package/api/isEmailAvailable/isEmailAvailable.d.ts +4 -0
  47. package/api/placeOrder/fixtures.d.ts +6 -0
  48. package/api/placeOrder/graphql/index.d.ts +2 -0
  49. package/api/placeOrder/graphql/placeOrder.graphql.d.ts +2 -0
  50. package/api/placeOrder/index.d.ts +2 -0
  51. package/api/placeOrder/placeOrder.d.ts +2 -0
  52. package/api/redirect/index.d.ts +2 -0
  53. package/api/redirect/redirect.d.ts +2 -0
  54. package/api/resetCheckout/index.d.ts +2 -0
  55. package/api/resetCheckout/resetCheckout.d.ts +2 -0
  56. package/api/resetCustomer/index.d.ts +2 -0
  57. package/api/resetCustomer/resetCustomer.d.ts +2 -0
  58. package/api/setBillingAddress/graphql/setBillingAddress.graphql.d.ts +2 -0
  59. package/api/setBillingAddress/index.d.ts +2 -0
  60. package/api/setBillingAddress/setBillingAddress.d.ts +13 -0
  61. package/api/setGuestEmailOnCart/graphql/setGuestEmailOnCart.graphql.d.ts +2 -0
  62. package/api/setGuestEmailOnCart/index.d.ts +2 -0
  63. package/api/setGuestEmailOnCart/setGuestEmailOnCart.d.ts +2 -0
  64. package/api/setPaymentMethod/graphql/setPaymentMethod.graphql.d.ts +2 -0
  65. package/api/setPaymentMethod/index.d.ts +2 -0
  66. package/api/setPaymentMethod/setPaymentMethod.d.ts +2 -0
  67. package/api/setShippingAddress/graphql/setShippingAddress.graphql.d.ts +2 -0
  68. package/api/setShippingAddress/index.d.ts +2 -0
  69. package/api/setShippingAddress/setShippingAddress.d.ts +30 -0
  70. package/api/setShippingMethods/graphql/setShippingMethodsOnCart.graphql.d.ts +2 -0
  71. package/api/setShippingMethods/index.d.ts +2 -0
  72. package/api/setShippingMethods/setShippingMethods.d.ts +2 -0
  73. package/api/utils/dispatchApiCall.d.ts +54 -0
  74. package/api/utils/enqueueRequest.d.ts +2 -0
  75. package/api/utils/filterControlledErrors.d.ts +18 -0
  76. package/api.d.ts +1 -0
  77. package/api.js +1 -2
  78. package/chunks/BillToShippingAddress2.js +1 -0
  79. package/chunks/BillingForm.js +1 -0
  80. package/chunks/ErrorBanner.js +1 -0
  81. package/chunks/LoginForm.js +1 -0
  82. package/chunks/MergedCartBanner.js +1 -0
  83. package/chunks/OutOfStock.js +1 -0
  84. package/chunks/PlaceOrder.js +1 -0
  85. package/chunks/ShippingForm.js +1 -0
  86. package/chunks/ShippingMethods.js +1 -0
  87. package/chunks/ToggleButton.js +1 -0
  88. package/chunks/ToggleButton2.js +1 -0
  89. package/chunks/constants.js +1 -0
  90. package/chunks/constants2.js +1 -0
  91. package/chunks/constants3.js +1 -0
  92. package/chunks/fixtures.js +15 -0
  93. package/chunks/getCart.graphql.js +119 -0
  94. package/chunks/getCustomer.js +34 -0
  95. package/chunks/getMultilineValues.js +43 -0
  96. package/chunks/placeOrder2.js +127 -0
  97. package/chunks/resetCustomer.js +36 -0
  98. package/chunks/setBillingAddress.js +13 -0
  99. package/chunks/setGuestEmailOnCart.js +17 -0
  100. package/chunks/setPaymentMethod.js +13 -0
  101. package/chunks/setShippingAddress.js +13 -0
  102. package/chunks/setShippingMethods.js +16 -0
  103. package/components/AddressForm/AddressForm.d.ts +22 -0
  104. package/components/AddressForm/constants.d.ts +4 -0
  105. package/components/AddressForm/index.d.ts +7 -0
  106. package/components/AddressForm/useAddressBackup.d.ts +8 -0
  107. package/components/AddressForm/useAddressForm.d.ts +39 -0
  108. package/components/AddressForm/useCheckoutAddressEventEmitter.d.ts +9 -0
  109. package/components/AddressForm/usePreselectedFields.d.ts +9 -0
  110. package/components/AddressForm/utils.d.ts +13 -0
  111. package/components/BillToShippingAddress/BillToShippingAddress.d.ts +8 -0
  112. package/components/BillToShippingAddress/BillToShippingAddressSkeleton.d.ts +4 -0
  113. package/components/BillToShippingAddress/index.d.ts +4 -0
  114. package/components/Checkout/Checkout.d.ts +32 -0
  115. package/components/Checkout/index.d.ts +3 -0
  116. package/components/EmptyCart/EmptyCart.d.ts +9 -0
  117. package/components/EmptyCart/index.d.ts +3 -0
  118. package/components/EstimateShipping/EstimateShipping.d.ts +12 -0
  119. package/components/EstimateShipping/EstimateShippingSkeleton.d.ts +4 -0
  120. package/components/EstimateShipping/index.d.ts +4 -0
  121. package/components/FieldsForm/FieldsForm.d.ts +13 -0
  122. package/components/FieldsForm/FieldsFormSkeleton.d.ts +4 -0
  123. package/components/FieldsForm/fieldFactory.d.ts +9 -0
  124. package/components/FieldsForm/fixtures.d.ts +5 -0
  125. package/components/FieldsForm/index.d.ts +6 -0
  126. package/components/FieldsForm/validation.d.ts +18 -0
  127. package/components/Heading/Heading.d.ts +8 -0
  128. package/components/Heading/index.d.ts +3 -0
  129. package/components/LoginForm/Email.d.ts +13 -0
  130. package/components/LoginForm/LoginForm.d.ts +16 -0
  131. package/components/LoginForm/LoginFormSkeleton.d.ts +4 -0
  132. package/components/LoginForm/SignIn.d.ts +9 -0
  133. package/components/LoginForm/SignOut.d.ts +8 -0
  134. package/components/LoginForm/index.d.ts +6 -0
  135. package/components/OutOfStock/OutOfStock.d.ts +11 -0
  136. package/components/OutOfStock/index.d.ts +3 -0
  137. package/components/OverlayLoader/OverlayLoader.d.ts +6 -0
  138. package/components/OverlayLoader/index.d.ts +2 -0
  139. package/components/PaymentMethods/PaymentMethods.d.ts +13 -0
  140. package/components/PaymentMethods/PaymentMethodsSkeleton.d.ts +4 -0
  141. package/components/PaymentMethods/index.d.ts +4 -0
  142. package/components/PlaceOrder/PlaceOrder.d.ts +9 -0
  143. package/components/PlaceOrder/PlaceOrderSkeleton.d.ts +4 -0
  144. package/components/PlaceOrder/index.d.ts +3 -0
  145. package/components/ServerError/ServerError.d.ts +10 -0
  146. package/components/ServerError/index.d.ts +3 -0
  147. package/components/ShippingMethods/ShippingMethods.d.ts +12 -0
  148. package/components/ShippingMethods/ShippingMethodsSkeleton.d.ts +4 -0
  149. package/components/ShippingMethods/index.d.ts +4 -0
  150. package/components/ToggleButton/ToggleButton.d.ts +14 -0
  151. package/components/ToggleButton/assets/icons/index.d.ts +2 -0
  152. package/components/ToggleButton/assets/images/index.d.ts +2 -0
  153. package/components/ToggleButton/index.d.ts +3 -0
  154. package/components/index.d.ts +16 -0
  155. package/containers/BillToShippingAddress/BillToShippingAddress.d.ts +10 -0
  156. package/containers/BillToShippingAddress/constants.d.ts +2 -0
  157. package/containers/BillToShippingAddress/index.d.ts +4 -0
  158. package/containers/BillToShippingAddress.d.ts +3 -0
  159. package/containers/BillToShippingAddress.js +1 -1
  160. package/containers/BillingForm/BillingForm.d.ts +7 -0
  161. package/containers/BillingForm/constants.d.ts +2 -0
  162. package/containers/BillingForm/index.d.ts +4 -0
  163. package/containers/BillingForm.d.ts +3 -0
  164. package/containers/BillingForm.js +1 -2
  165. package/containers/Checkout/Checkout.d.ts +39 -0
  166. package/containers/Checkout/constants.d.ts +2 -0
  167. package/containers/Checkout/index.d.ts +4 -0
  168. package/containers/Checkout.d.ts +3 -0
  169. package/containers/Checkout.js +1 -1
  170. package/containers/ErrorBanner/ErrorBanner.d.ts +5 -0
  171. package/containers/ErrorBanner/index.d.ts +3 -0
  172. package/containers/ErrorBanner.d.ts +3 -0
  173. package/containers/ErrorBanner.js +1 -0
  174. package/containers/EstimateShipping/EstimateShipping.d.ts +4 -0
  175. package/containers/EstimateShipping/index.d.ts +3 -0
  176. package/containers/EstimateShipping.d.ts +3 -0
  177. package/containers/EstimateShipping.js +1 -0
  178. package/containers/LoginForm/LoginForm.d.ts +10 -0
  179. package/containers/LoginForm/constants.d.ts +2 -0
  180. package/containers/LoginForm/index.d.ts +4 -0
  181. package/containers/LoginForm.d.ts +3 -0
  182. package/containers/LoginForm.js +1 -1
  183. package/containers/MergedCartBanner/MergedCartBanner.d.ts +5 -0
  184. package/containers/MergedCartBanner/index.d.ts +3 -0
  185. package/containers/MergedCartBanner.d.ts +3 -0
  186. package/containers/MergedCartBanner.js +1 -0
  187. package/containers/OutOfStock/OutOfStock.d.ts +13 -0
  188. package/containers/OutOfStock/index.d.ts +3 -0
  189. package/containers/OutOfStock.d.ts +3 -0
  190. package/containers/OutOfStock.js +1 -0
  191. package/containers/PaymentMethods/PaymentMethods.d.ts +23 -0
  192. package/containers/PaymentMethods/defaultHandlers.d.ts +11 -0
  193. package/containers/PaymentMethods/index.d.ts +3 -0
  194. package/containers/PaymentMethods.d.ts +3 -0
  195. package/containers/PaymentMethods.js +1 -1
  196. package/containers/PlaceOrder/PlaceOrder.d.ts +9 -0
  197. package/containers/PlaceOrder/index.d.ts +3 -0
  198. package/containers/PlaceOrder.d.ts +3 -0
  199. package/containers/PlaceOrder.js +1 -1
  200. package/containers/ShippingForm/ShippingForm.d.ts +10 -0
  201. package/containers/ShippingForm/constants.d.ts +2 -0
  202. package/containers/ShippingForm/index.d.ts +4 -0
  203. package/containers/ShippingForm.d.ts +3 -0
  204. package/containers/ShippingForm.js +1 -1
  205. package/containers/ShippingMethods/ShippingMethods.d.ts +10 -0
  206. package/containers/ShippingMethods/hooks/useShippingEstimateEventEmitter.d.ts +3 -0
  207. package/containers/ShippingMethods/index.d.ts +3 -0
  208. package/containers/ShippingMethods.d.ts +3 -0
  209. package/containers/ShippingMethods.js +1 -1
  210. package/containers/index.d.ts +13 -0
  211. package/data/models/acdl.d.ts +99 -0
  212. package/data/models/address-form-fields.d.ts +52 -0
  213. package/data/models/address.d.ts +21 -0
  214. package/data/models/cart.d.ts +14 -0
  215. package/data/models/country.d.ts +5 -0
  216. package/data/models/custom-attribute.d.ts +5 -0
  217. package/data/models/customer.d.ts +25 -0
  218. package/data/models/email-availability.d.ts +2 -0
  219. package/data/models/index.d.ts +14 -0
  220. package/data/models/order.d.ts +81 -0
  221. package/data/models/payment-method.d.ts +5 -0
  222. package/data/models/price.d.ts +5 -0
  223. package/data/models/region.d.ts +6 -0
  224. package/data/models/shipping-estimate.d.ts +17 -0
  225. package/data/models/shipping-method.d.ts +19 -0
  226. package/data/models/store-config.d.ts +17 -0
  227. package/data/transforms/index.d.ts +12 -0
  228. package/data/transforms/transform-acdl.d.ts +6 -0
  229. package/data/transforms/transform-address-form-fields.d.ts +66 -0
  230. package/data/transforms/transform-address.d.ts +89 -0
  231. package/data/transforms/transform-cart.d.ts +7 -0
  232. package/data/transforms/transform-countries.d.ts +5 -0
  233. package/data/transforms/transform-customer.d.ts +14 -0
  234. package/data/transforms/transform-email-availability.d.ts +6 -0
  235. package/data/transforms/transform-order.d.ts +7 -0
  236. package/data/transforms/transform-payment-methods.d.ts +9 -0
  237. package/data/transforms/transform-regions.d.ts +8 -0
  238. package/data/transforms/transform-shipping-estimate.d.ts +5 -0
  239. package/data/transforms/transform-shipping-methods.d.ts +14 -0
  240. package/data/transforms/transform-store-config.d.ts +6 -0
  241. package/hooks/index.d.ts +4 -0
  242. package/hooks/useBreakpoint/index.d.ts +2 -0
  243. package/hooks/useBreakpoint/useBreakpoint.d.ts +2 -0
  244. package/hooks/useLockScroll/index.d.ts +2 -0
  245. package/hooks/useLockScroll/useLockScroll.d.ts +5 -0
  246. package/hooks/useValidity/index.d.ts +2 -0
  247. package/hooks/useValidity/useValidity.d.ts +19 -0
  248. package/i18n/en_US.json.d.ts +97 -0
  249. package/lib/acdl.d.ts +18 -0
  250. package/lib/backup-data.d.ts +4 -0
  251. package/lib/fetch-error.d.ts +7 -0
  252. package/lib/index.d.ts +3 -0
  253. package/lib/network-error.d.ts +6 -0
  254. package/lib/redirect.d.ts +2 -0
  255. package/lib/state.d.ts +7 -0
  256. package/msw/browser.d.ts +2 -0
  257. package/msw/fixtures/fragments/american-regions.d.ts +4 -0
  258. package/msw/fixtures/fragments/available-shipping-methods.d.ts +23 -0
  259. package/msw/fixtures/fragments/billing-address.d.ts +36 -0
  260. package/msw/fixtures/fragments/cart.d.ts +122 -0
  261. package/msw/fixtures/fragments/countries.d.ts +4 -0
  262. package/msw/fixtures/fragments/form-fields.d.ts +4 -0
  263. package/msw/fixtures/fragments/index.d.ts +8 -0
  264. package/msw/fixtures/fragments/shipping-address.d.ts +42 -0
  265. package/msw/fixtures/index.d.ts +4 -0
  266. package/msw/fixtures/mutations/estimate-shipping-methods.d.ts +4 -0
  267. package/msw/fixtures/mutations/index.d.ts +8 -0
  268. package/msw/fixtures/mutations/place-order.d.ts +4 -0
  269. package/msw/fixtures/mutations/set-billing-address.d.ts +5 -0
  270. package/msw/fixtures/mutations/set-guest-email.d.ts +4 -0
  271. package/msw/fixtures/mutations/set-payment-method.d.ts +4 -0
  272. package/msw/fixtures/mutations/set-shipping-address.d.ts +4 -0
  273. package/msw/fixtures/mutations/set-shipping-methods.d.ts +4 -0
  274. package/msw/fixtures/queries/fetch-address-form-fields.d.ts +4 -0
  275. package/msw/fixtures/queries/get-cart.d.ts +4 -0
  276. package/msw/fixtures/queries/get-countries.d.ts +4 -0
  277. package/msw/fixtures/queries/get-customer-cart-stock-status.d.ts +4 -0
  278. package/msw/fixtures/queries/get-customer.d.ts +5 -0
  279. package/msw/fixtures/queries/get-regions.d.ts +4 -0
  280. package/msw/fixtures/queries/get-stock-status.d.ts +4 -0
  281. package/msw/fixtures/queries/get-store-config.d.ts +4 -0
  282. package/msw/fixtures/queries/index.d.ts +10 -0
  283. package/msw/fixtures/queries/is-email-available.d.ts +4 -0
  284. package/msw/handlers.d.ts +4 -0
  285. package/msw/server.d.ts +2 -0
  286. package/package.json +1 -1
  287. package/render/Provider.d.ts +8 -0
  288. package/render/index.d.ts +2 -0
  289. package/render/render.d.ts +6 -0
  290. package/render.d.ts +1 -0
  291. package/render.js +3 -1
  292. package/signals/AddressFormFieldsSignal.d.ts +7 -0
  293. package/signals/CartSignal.d.ts +7 -0
  294. package/signals/CountryListSignal.d.ts +7 -0
  295. package/signals/CustomerSignal.d.ts +7 -0
  296. package/signals/EstimateShippingMethodsSignal.d.ts +7 -0
  297. package/signals/IsBillToShippingSignal.d.ts +6 -0
  298. package/signals/RegionsSignal.d.ts +12 -0
  299. package/signals/SelectedShippingMethodSignal.d.ts +4 -0
  300. package/signals/StoreConfigSignal.d.ts +7 -0
  301. package/signals/index.d.ts +10 -0
  302. package/tests/constants.d.ts +3 -0
  303. package/tests/integration/utils/index.d.ts +3 -0
  304. package/tests/integration/utils/setup.d.ts +6 -0
  305. package/tests/integration/utils/user-actions.d.ts +2 -0
  306. package/tests/mocks/svg.d.ts +4 -0
  307. package/tests/utils/expectError.d.ts +9 -0
  308. package/tests/utils/index.d.ts +3 -0
  309. package/tests/utils/mockEvents.d.ts +5 -0
  310. package/utils/autocompleteFieldCodes/autocompleteFieldCodes.d.ts +18 -0
  311. package/utils/autocompleteFieldCodes/index.d.ts +2 -0
  312. package/utils/getMultilineValues/getMultilineValues.d.ts +3 -0
  313. package/utils/getMultilineValues/index.d.ts +2 -0
  314. package/utils/index.d.ts +7 -0
  315. package/utils/isEmpty/index.d.ts +2 -0
  316. package/utils/isEmpty/isEmpty.d.ts +2 -0
  317. package/utils/isNullish/index.d.ts +2 -0
  318. package/utils/isNullish/isNullish.d.ts +2 -0
  319. package/utils/parseRegionId/index.d.ts +2 -0
  320. package/utils/parseRegionId/parseRegionId.d.ts +2 -0
  321. package/utils/processFormFields/index.d.ts +2 -0
  322. package/utils/processFormFields/processFormFields.d.ts +21 -0
  323. package/utils/refetchEstimatedShippingMethods/index.d.ts +2 -0
  324. package/utils/refetchEstimatedShippingMethods/refetchEstimatedShippingMethods.d.ts +4 -0
  325. package/utils/shippingMethods/index.d.ts +2 -0
  326. package/utils/shippingMethods/isEqual.d.ts +4 -0
  327. package/181.js +0 -1
  328. package/212.js +0 -2
  329. package/212.js.LICENSE.txt +0 -1
  330. package/261.js +0 -2
  331. package/261.js.LICENSE.txt +0 -1
  332. package/299.js +0 -2
  333. package/299.js.LICENSE.txt +0 -1
  334. package/325.js +0 -2
  335. package/325.js.LICENSE.txt +0 -1
  336. package/350.js +0 -2
  337. package/350.js.LICENSE.txt +0 -1
  338. package/494.js +0 -2
  339. package/494.js.LICENSE.txt +0 -1
  340. package/548.js +0 -1
  341. package/549.js +0 -2
  342. package/549.js.LICENSE.txt +0 -1
  343. package/60.js +0 -2
  344. package/60.js.LICENSE.txt +0 -1
  345. package/627.js +0 -1
  346. package/645.js +0 -1
  347. package/757.js +0 -1
  348. package/805.js +0 -2
  349. package/805.js.LICENSE.txt +0 -1
  350. package/985.js +0 -2
  351. package/985.js.LICENSE.txt +0 -1
  352. package/994.js +0 -1
  353. package/api.js.LICENSE.txt +0 -1
  354. package/containers/AddressForm.js +0 -1
  355. package/containers/BillingForm.js.LICENSE.txt +0 -1
  356. package/containers/OrderSummary.js +0 -1
  357. package/runtime.js +0 -1
@@ -0,0 +1,17 @@
1
+ export declare enum TaxDisplay {
2
+ EXCLUDING_TAX = "EXCLUDING_TAX",
3
+ INCLUDING_EXCLUDING_TAX = "INCLUDING_AND_EXCLUDING_TAX",
4
+ INCLUDING_TAX = "INCLUDING_TAX"
5
+ }
6
+ export interface StoreConfig {
7
+ defaultCountry: string;
8
+ countriesWithRequiredRegion: string[];
9
+ displayStateIfOptional: boolean;
10
+ countriesWithOptionalZipCode: string[];
11
+ isGuestCheckoutEnabled: boolean;
12
+ isOnePageCheckoutEnabled: boolean;
13
+ shoppingCartDisplaySetting: {
14
+ shipping: TaxDisplay;
15
+ };
16
+ }
17
+ //# sourceMappingURL=store-config.d.ts.map
@@ -0,0 +1,12 @@
1
+ export * from './transform-acdl';
2
+ export * from './transform-address-form-fields';
3
+ export * from './transform-cart';
4
+ export * from './transform-countries';
5
+ export * from './transform-customer';
6
+ export * from './transform-email-availability';
7
+ export * from './transform-order';
8
+ export * from './transform-regions';
9
+ export * from './transform-shipping-estimate';
10
+ export * from './transform-shipping-methods';
11
+ export * from './transform-store-config';
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,6 @@
1
+ import { OrderContext, ShoppingCartContext } from '../models/acdl';
2
+ import { Order } from '../models/order';
3
+
4
+ export declare const transformShoppingCartContext: (order: Order) => ShoppingCartContext;
5
+ export declare const transformOrderContext: (order: Order) => OrderContext;
6
+ //# sourceMappingURL=transform-acdl.d.ts.map
@@ -0,0 +1,66 @@
1
+ import { FetchAddressFormFieldsQuery, ValidationRuleEnum } from '../../__generated__/types';
2
+ import { AddressFormField } from '../models';
3
+
4
+ type AttributesForm = FetchAddressFormFieldsQuery['attributesForm'];
5
+ declare const transformAddressFormFields: (data: ({
6
+ __typename?: "AttributeMetadata" | undefined;
7
+ frontend_input?: import('../../__generated__/types').AttributeFrontendInputEnum | null | undefined;
8
+ code: string;
9
+ label?: string | null | undefined;
10
+ default_value?: string | null | undefined;
11
+ is_required: boolean;
12
+ options: ({
13
+ __typename?: "AttributeOptionMetadata" | undefined;
14
+ label: string;
15
+ value: string;
16
+ is_default: boolean;
17
+ } | null)[];
18
+ } | {
19
+ __typename?: "CatalogAttributeMetadata" | undefined;
20
+ frontend_input?: import('../../__generated__/types').AttributeFrontendInputEnum | null | undefined;
21
+ code: string;
22
+ label?: string | null | undefined;
23
+ default_value?: string | null | undefined;
24
+ is_required: boolean;
25
+ options: ({
26
+ __typename?: "AttributeOptionMetadata" | undefined;
27
+ label: string;
28
+ value: string;
29
+ is_default: boolean;
30
+ } | null)[];
31
+ } | {
32
+ __typename?: "CustomerAttributeMetadata" | undefined;
33
+ multiline_count?: number | null | undefined;
34
+ sort_order?: number | null | undefined;
35
+ frontend_input?: import('../../__generated__/types').AttributeFrontendInputEnum | null | undefined;
36
+ code: string;
37
+ label?: string | null | undefined;
38
+ default_value?: string | null | undefined;
39
+ is_required: boolean;
40
+ validate_rules?: ({
41
+ __typename?: "ValidationRule" | undefined;
42
+ name?: ValidationRuleEnum | null | undefined;
43
+ value?: string | null | undefined;
44
+ } | null)[] | null | undefined;
45
+ options: ({
46
+ __typename?: "AttributeOptionMetadata" | undefined;
47
+ label: string;
48
+ value: string;
49
+ is_default: boolean;
50
+ } | null)[];
51
+ } | {
52
+ __typename?: "ReturnItemAttributeMetadata" | undefined;
53
+ frontend_input?: import('../../__generated__/types').AttributeFrontendInputEnum | null | undefined;
54
+ code: string;
55
+ label?: string | null | undefined;
56
+ default_value?: string | null | undefined;
57
+ is_required: boolean;
58
+ options: ({
59
+ __typename?: "AttributeOptionMetadata" | undefined;
60
+ label: string;
61
+ value: string;
62
+ is_default: boolean;
63
+ } | null)[];
64
+ } | null)[]) => AddressFormField[];
65
+ export { AttributesForm, transformAddressFormFields };
66
+ //# sourceMappingURL=transform-address-form-fields.d.ts.map
@@ -0,0 +1,89 @@
1
+ import { GetCartQuery } from '../../__generated__/types';
2
+ import { ShippingAddress as ShippingAddressModel, BillingAddress as BillingAddressModel } from '../models/address';
3
+ import { CustomAttribute as CustomAttributeModel } from '../models';
4
+
5
+ type ShippingAddresses = NonNullable<GetCartQuery['cart']>['shipping_addresses'];
6
+ type ShippingAddress = ShippingAddresses[0];
7
+ type NonNullableShippingAddress = NonNullable<ShippingAddress>;
8
+ type BillingAddress = NonNullable<GetCartQuery['cart']>['billing_address'];
9
+ type NonNullableBillingAddress = NonNullable<BillingAddress>;
10
+ type CustomAttributes = NonNullableShippingAddress['custom_attributes'] | NonNullableBillingAddress['custom_attributes'];
11
+ export declare const transformCustomAttributes: (data: CustomAttributes) => CustomAttributeModel[];
12
+ declare const transformBillingAddress: (data: BillingAddress) => BillingAddressModel | undefined;
13
+ declare const transformShippingAddresses: (data: ({
14
+ __typename?: "ShippingCartAddress" | undefined;
15
+ firstname: string;
16
+ lastname: string;
17
+ company?: string | null | undefined;
18
+ street: (string | null)[];
19
+ city: string;
20
+ postcode?: string | null | undefined;
21
+ vat_id?: string | null | undefined;
22
+ telephone?: string | null | undefined;
23
+ region?: {
24
+ __typename?: "CartAddressRegion" | undefined;
25
+ region_id?: number | null | undefined;
26
+ code?: string | null | undefined;
27
+ label?: string | null | undefined;
28
+ } | null | undefined;
29
+ country: {
30
+ __typename?: "CartAddressCountry" | undefined;
31
+ code: string;
32
+ label: string;
33
+ };
34
+ custom_attributes: ({
35
+ __typename?: "AttributeSelectedOptions" | undefined;
36
+ } | {
37
+ __typename?: "AttributeValue" | undefined;
38
+ code: string;
39
+ value: string;
40
+ } | null)[];
41
+ available_shipping_methods?: ({
42
+ __typename?: "AvailableShippingMethod" | undefined;
43
+ available: boolean;
44
+ carrier_code: string;
45
+ carrier_title: string;
46
+ error_message?: string | null | undefined;
47
+ method_code?: string | null | undefined;
48
+ method_title?: string | null | undefined;
49
+ amount: {
50
+ __typename?: "Money" | undefined;
51
+ currency?: import('../../__generated__/types').CurrencyEnum | null | undefined;
52
+ value?: number | null | undefined;
53
+ };
54
+ price_excl_tax: {
55
+ __typename?: "Money" | undefined;
56
+ value?: number | null | undefined;
57
+ currency?: import('../../__generated__/types').CurrencyEnum | null | undefined;
58
+ };
59
+ price_incl_tax: {
60
+ __typename?: "Money" | undefined;
61
+ value?: number | null | undefined;
62
+ currency?: import('../../__generated__/types').CurrencyEnum | null | undefined;
63
+ };
64
+ } | null)[] | null | undefined;
65
+ selected_shipping_method?: {
66
+ __typename?: "SelectedShippingMethod" | undefined;
67
+ carrier_code: string;
68
+ carrier_title: string;
69
+ method_code: string;
70
+ method_title: string;
71
+ amount: {
72
+ __typename?: "Money" | undefined;
73
+ value?: number | null | undefined;
74
+ currency?: import('../../__generated__/types').CurrencyEnum | null | undefined;
75
+ };
76
+ price_excl_tax: {
77
+ __typename?: "Money" | undefined;
78
+ value?: number | null | undefined;
79
+ currency?: import('../../__generated__/types').CurrencyEnum | null | undefined;
80
+ };
81
+ price_incl_tax: {
82
+ __typename?: "Money" | undefined;
83
+ value?: number | null | undefined;
84
+ currency?: import('../../__generated__/types').CurrencyEnum | null | undefined;
85
+ };
86
+ } | null | undefined;
87
+ } | null)[]) => ShippingAddressModel[] | undefined;
88
+ export { ShippingAddress, BillingAddress, transformBillingAddress, transformShippingAddresses, };
89
+ //# sourceMappingURL=transform-address.d.ts.map
@@ -0,0 +1,7 @@
1
+ import { GetCartQuery } from '../../__generated__/types';
2
+ import { Cart as CartModel } from '../models';
3
+
4
+ type Cart = NonNullable<GetCartQuery['cart']>;
5
+ declare const transformCart: (cart: Cart) => CartModel;
6
+ export { Cart, transformCart };
7
+ //# sourceMappingURL=transform-cart.d.ts.map
@@ -0,0 +1,5 @@
1
+ import { Country as CountryModel } from '../models/country';
2
+ import { GetCountriesQuery } from '../../__generated__/types';
3
+
4
+ export declare const transformCountries: (data: GetCountriesQuery['countries']) => CountryModel[] | undefined;
5
+ //# sourceMappingURL=transform-countries.d.ts.map
@@ -0,0 +1,14 @@
1
+ import { GetCustomerQuery } from '../../__generated__/types';
2
+ import { Customer as CustomerModel, CustomAttribute as CustomAttributeModel } from '../models';
3
+
4
+ type Customer = GetCustomerQuery['customer'];
5
+ export declare const transformCustomAttributesV2: (data: ({
6
+ __typename?: "AttributeSelectedOptions" | undefined;
7
+ } | {
8
+ __typename?: "AttributeValue" | undefined;
9
+ code: string;
10
+ value: string;
11
+ } | null)[]) => CustomAttributeModel[];
12
+ declare const transformCustomer: (data: Customer) => CustomerModel | undefined;
13
+ export { transformCustomer };
14
+ //# sourceMappingURL=transform-customer.d.ts.map
@@ -0,0 +1,6 @@
1
+ import { IsEmailAvailableQuery } from '../../__generated__/types';
2
+ import { EmailAvailability } from '../models';
3
+
4
+ declare const transformEmailAvailability: (data: IsEmailAvailableQuery['isEmailAvailable']) => EmailAvailability;
5
+ export { transformEmailAvailability };
6
+ //# sourceMappingURL=transform-email-availability.d.ts.map
@@ -0,0 +1,7 @@
1
+ import { Order as OrderModel } from '../models/order';
2
+ import { PlaceOrderMutation } from '../../__generated__/types';
3
+
4
+ type Order = NonNullable<NonNullable<PlaceOrderMutation['placeOrder']>['orderV2']>;
5
+ export declare const transformOrder: (order: Order) => OrderModel;
6
+ export {};
7
+ //# sourceMappingURL=transform-order.d.ts.map
@@ -0,0 +1,9 @@
1
+ import { GetCartQuery } from '../../__generated__/types';
2
+ import { PaymentMethod } from '../models/payment-method';
3
+
4
+ type SelectedPaymentMethod = NonNullable<GetCartQuery['cart']>['selected_payment_method'];
5
+ type AvailablePaymentMethods = NonNullable<GetCartQuery['cart']>['available_payment_methods'];
6
+ declare const transformSelectedPaymentMethod: (data: SelectedPaymentMethod) => PaymentMethod | undefined;
7
+ declare const transformAvailablePaymentMethods: (data: AvailablePaymentMethods) => PaymentMethod[] | undefined;
8
+ export { transformAvailablePaymentMethods, transformSelectedPaymentMethod };
9
+ //# sourceMappingURL=transform-payment-methods.d.ts.map
@@ -0,0 +1,8 @@
1
+ import { Region as RegionModel } from '../models/region';
2
+ import { GetRegionsQuery } from '../../__generated__/types';
3
+
4
+ type RegionsCountry = NonNullable<GetRegionsQuery['country']>;
5
+ type AvailableRegions = RegionsCountry['available_regions'];
6
+ declare const transformRegions: (data: RegionsCountry['available_regions']) => RegionModel[] | undefined;
7
+ export { AvailableRegions, transformRegions };
8
+ //# sourceMappingURL=transform-regions.d.ts.map
@@ -0,0 +1,5 @@
1
+ import { ShippingEstimatePartialAddress, ShippingEstimateShippingMethod, ShippingMethod } from '../models';
2
+
3
+ export declare const transformShippingEstimatePartialAddress: (data: Record<string, string>) => ShippingEstimatePartialAddress;
4
+ export declare const transformShippingEstimateShippingMethod: (data: ShippingMethod) => ShippingEstimateShippingMethod;
5
+ //# sourceMappingURL=transform-shipping-estimate.d.ts.map
@@ -0,0 +1,14 @@
1
+ import { GetCartQuery } from '../../__generated__/types';
2
+ import { ShippingMethod } from '../models/shipping-method';
3
+
4
+ type Cart = NonNullable<GetCartQuery['cart']>;
5
+ type ShippingAddresses = Cart['shipping_addresses'];
6
+ type ShippingAddress = NonNullable<NonNullable<ShippingAddresses>[number]>;
7
+ type AvailableShippingMethods = ShippingAddress['available_shipping_methods'];
8
+ type AvailableShippingMethod = NonNullable<AvailableShippingMethods>[number];
9
+ type SelectedShippingMethod = ShippingAddress['selected_shipping_method'];
10
+ export declare const transformSelectedShippingMethod: (data: SelectedShippingMethod) => ShippingMethod | undefined;
11
+ export declare const transformAvailableShippingMethod: (data: AvailableShippingMethod) => ShippingMethod | undefined;
12
+ export declare const transformShippingMethods: (data: AvailableShippingMethods) => ShippingMethod[] | undefined;
13
+ export {};
14
+ //# sourceMappingURL=transform-shipping-methods.d.ts.map
@@ -0,0 +1,6 @@
1
+ import { GetStoreConfigQuery } from '../../__generated__/types';
2
+ import { StoreConfig, TaxDisplay } from '../models';
3
+
4
+ export declare function transformTaxDisplay(data: number | null | undefined): TaxDisplay;
5
+ export declare function transformStoreConfig(data: GetStoreConfigQuery['storeConfig']): StoreConfig;
6
+ //# sourceMappingURL=transform-store-config.d.ts.map
@@ -0,0 +1,4 @@
1
+ export * from './useBreakpoint';
2
+ export * from './useLockScroll';
3
+ export * from './useValidity';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,2 @@
1
+ export * from './useBreakpoint';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,2 @@
1
+ export declare const useBreakpoint: () => "small" | "medium" | "large" | "xlarge" | "xxlarge";
2
+ //# sourceMappingURL=useBreakpoint.d.ts.map
@@ -0,0 +1,2 @@
1
+ export * from './useLockScroll';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,5 @@
1
+ export declare const useScrollLock: () => {
2
+ lockScroll: () => void;
3
+ unlockScroll: () => void;
4
+ };
5
+ //# sourceMappingURL=useLockScroll.d.ts.map
@@ -0,0 +1,2 @@
1
+ export * from './useValidity';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,19 @@
1
+ export type Translations = {
2
+ badInput: string;
3
+ patternMismatch: string;
4
+ rangeOverflow: string;
5
+ rangeUnderflow: string;
6
+ tooLong: string;
7
+ tooShort: string;
8
+ typeMismatch: string;
9
+ valueMissing: string;
10
+ };
11
+ type FormElement = HTMLInputElement | HTMLSelectElement;
12
+ export declare const useValidity: (translations: Translations) => {
13
+ errors: Record<string, string>;
14
+ dismissError: (code: string) => void;
15
+ validateFormElement: (formElement: FormElement) => void;
16
+ resetErrors: () => void;
17
+ };
18
+ export {};
19
+ //# sourceMappingURL=useValidity.d.ts.map
@@ -0,0 +1,97 @@
1
+ declare const _default: {
2
+ "Checkout": {
3
+ "title": "Checkout",
4
+ "LoginForm": {
5
+ "title": "Contact details",
6
+ "account": "Already have an account?",
7
+ "ariaLabel": "Email",
8
+ "invalidEmailError": "Please enter a valid email address.",
9
+ "missingEmailError": "Enter an email address.",
10
+ "emailExists": {
11
+ "alreadyHaveAccount": "It looks like you already have an account.",
12
+ "signInButton": "Sign in",
13
+ "forFasterCheckout": "for a faster checkout."
14
+ },
15
+ "floatingLabel": "Email *",
16
+ "placeholder": "Enter your email address",
17
+ "signIn": "Sign In",
18
+ "switch": "Do you want to switch account?",
19
+ "signOut": "Sign Out"
20
+ },
21
+ "ShippingMethods": {
22
+ "title": "Shipping options",
23
+ "emptyState": "This order can't be shipped to the address provided. Please review the address details you entered and make sure they're correct."
24
+ },
25
+ "ShippingAddress": {
26
+ "title": "Delivery"
27
+ },
28
+ "BillingAddress": {
29
+ "title": "Billing Address"
30
+ },
31
+ "AddressForm": {
32
+ "Validity": {
33
+ "badInput": "Provide a valid {field}.",
34
+ "patternMismatch": "Ensure you have entered a correct {field} format.",
35
+ "rangeOverflow": "Choose a valid {field} within the allowed range.",
36
+ "rangeUnderflow": "Choose a valid {field} within the allowed range.",
37
+ "tooLong": "This entry is too long. Keep it under {field} characters.",
38
+ "tooShort": "Use at least {field} characters.",
39
+ "typeMismatch": "Enter a valid {field}.",
40
+ "valueMissing": "Enter a {field}, this field is required."
41
+ }
42
+ },
43
+ "BillToShippingAddress": {
44
+ "title": "Bill to shipping address"
45
+ },
46
+ "PaymentMethods": {
47
+ "title": "Payment",
48
+ "emptyState": "No payment methods available"
49
+ },
50
+ "OutOfStock": {
51
+ "title": "Your cart contains items that are out of stock",
52
+ "message": "The following items are out of stock:",
53
+ "actions": {
54
+ "reviewCart": "Review cart",
55
+ "removeOutOfStock": "Remove out of stock items"
56
+ },
57
+ "lowInventory": {
58
+ "one": "Last item!",
59
+ "many": "Only {{count}} left!"
60
+ },
61
+ "alert": "Out of stock!"
62
+ },
63
+ "PlaceOrder": {
64
+ "button": "Place Order"
65
+ },
66
+ "ServerError": {
67
+ "title": "We were unable to process your order",
68
+ "contactSupport": "If you continue to have issues, please contact support.",
69
+ "unexpected": "An unexpected error occurred while processing your order. Please try again later.",
70
+ "button": "Try again"
71
+ },
72
+ "EmptyCart": {
73
+ "title": "Your cart is empty",
74
+ "button": "Start shopping"
75
+ },
76
+ "ErrorBanner": {
77
+ "genericMessage": "Server error detected. Please check your connection and try again."
78
+ },
79
+ "MergedCartBanner": {
80
+ "items": {
81
+ "one": "1 item from a previous session was added to your cart. Please review your new subtotal.",
82
+ "many": "{{count}} items from a previous session were added to your cart. Please review your new subtotal."
83
+ }
84
+ },
85
+ "EstimateShipping": {
86
+ "estimated": "Estimated Shipping",
87
+ "freeShipping": "Free",
88
+ "label": "Shipping",
89
+ "taxToBeDetermined": "TBD",
90
+ "withTaxes": "Including taxes",
91
+ "withoutTaxes": "Excluding taxes"
92
+ }
93
+ }
94
+ }
95
+ ;
96
+
97
+ export default _default;
package/lib/acdl.d.ts ADDED
@@ -0,0 +1,18 @@
1
+ import { Order } from '../data/models/order';
2
+
3
+ /**
4
+ * See: https://github.com/adobe/commerce-events/blob/main/packages/storefront-events-sdk/src/contexts.ts
5
+ */
6
+ export declare const contexts: {
7
+ SHOPPING_CART_CONTEXT: string;
8
+ ORDER_CONTEXT: string;
9
+ };
10
+ /**
11
+ * See: https://github.com/adobe/commerce-events/blob/main/packages/storefront-events-sdk/src/events.ts
12
+ */
13
+ export declare const events: {
14
+ PLACE_ORDER: string;
15
+ };
16
+ export declare function getAdobeDataLayer(): any;
17
+ export declare function publishPlaceOrderEvent(order: Order): void;
18
+ //# sourceMappingURL=acdl.d.ts.map
@@ -0,0 +1,4 @@
1
+ export declare const createBackup: <T>(key: string, value: T) => void;
2
+ export declare const restoreBackup: <T>(key: string) => T | null;
3
+ export declare const removeBackup: (key: string) => void;
4
+ //# sourceMappingURL=backup-data.d.ts.map
@@ -0,0 +1,7 @@
1
+ export declare const handleFetchErrors: (errors?: Array<{
2
+ message: string;
3
+ extensions: {
4
+ category: string;
5
+ };
6
+ }>) => void;
7
+ //# sourceMappingURL=fetch-error.d.ts.map
package/lib/index.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ export * from './fetch-error';
2
+ export * from './redirect';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,6 @@
1
+ /**
2
+ * A function which can be attached to fetchGraphQL to handle thrown errors in
3
+ * a generic way.
4
+ */
5
+ export declare const handleNetworkError: (error: Error) => never;
6
+ //# sourceMappingURL=network-error.d.ts.map
@@ -0,0 +1,2 @@
1
+ export declare function redirect(location: string): void;
2
+ //# sourceMappingURL=redirect.d.ts.map
package/lib/state.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ type State = {
2
+ cartId: string | null;
3
+ authenticated: boolean;
4
+ };
5
+ export declare const state: State;
6
+ export {};
7
+ //# sourceMappingURL=state.d.ts.map
@@ -0,0 +1,2 @@
1
+ export declare const worker: import('msw/browser').SetupWorker;
2
+ //# sourceMappingURL=browser.d.ts.map
@@ -0,0 +1,4 @@
1
+ import { GetRegionsQuery } from '../../../__generated__/types';
2
+
3
+ export declare const americanRegionsFixture: NonNullable<GetRegionsQuery['country']>['available_regions'];
4
+ //# sourceMappingURL=american-regions.d.ts.map
@@ -0,0 +1,23 @@
1
+ import { CurrencyEnum } from '../../../__generated__/types';
2
+
3
+ export declare const availableShippingMethodsFixture: {
4
+ amount: {
5
+ currency: CurrencyEnum;
6
+ value: number;
7
+ };
8
+ available: boolean;
9
+ carrier_code: string;
10
+ carrier_title: string;
11
+ error_message: string;
12
+ method_code: string;
13
+ method_title: string;
14
+ price_excl_tax: {
15
+ value: number;
16
+ currency: CurrencyEnum;
17
+ };
18
+ price_incl_tax: {
19
+ value: number;
20
+ currency: CurrencyEnum;
21
+ };
22
+ }[];
23
+ //# sourceMappingURL=available-shipping-methods.d.ts.map
@@ -0,0 +1,36 @@
1
+ export declare const billingAddressFixture: {
2
+ firstname: string;
3
+ lastname: string;
4
+ company: null;
5
+ street: string[];
6
+ city: string;
7
+ postcode: string;
8
+ vat_id: null;
9
+ country: {
10
+ code: string;
11
+ label: string;
12
+ };
13
+ region: {
14
+ region_id: number;
15
+ code: string;
16
+ label: string;
17
+ };
18
+ telephone: string;
19
+ custom_attributes: {}[];
20
+ };
21
+ export declare const ukBillingAddressFixture: {
22
+ firstname: string;
23
+ lastname: string;
24
+ company: null;
25
+ street: string[];
26
+ city: string;
27
+ postcode: string;
28
+ vat_id: null;
29
+ country: {
30
+ code: string;
31
+ label: string;
32
+ };
33
+ telephone: string;
34
+ custom_attributes: {}[];
35
+ };
36
+ //# sourceMappingURL=billing-address.d.ts.map