@shopify/ui-extensions 2025.10.0-rc.46 → 2025.10.0-rc.48

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 (261) hide show
  1. package/build/cjs/surfaces/checkout/preact/api.js +1 -1
  2. package/build/cjs/surfaces/checkout/shared.js +1 -1
  3. package/build/esm/surfaces/checkout/preact/api.mjs +1 -1
  4. package/build/esm/surfaces/checkout/shared.mjs +1 -1
  5. package/build/esnext/surfaces/checkout/preact/api.esnext +1 -1
  6. package/build/esnext/surfaces/checkout/shared.esnext +1 -1
  7. package/build/ts/docs/shared/components/ConsentCheckbox.d.ts +4 -0
  8. package/build/ts/docs/shared/components/ConsentCheckbox.d.ts.map +1 -0
  9. package/build/ts/docs/shared/components/ConsentPhoneField.d.ts +4 -0
  10. package/build/ts/docs/shared/components/ConsentPhoneField.d.ts.map +1 -0
  11. package/build/ts/docs/shared/components/index.d.ts +2 -0
  12. package/build/ts/docs/shared/components/index.d.ts.map +1 -1
  13. package/build/ts/surfaces/admin/components/Chip.d.ts +1 -5
  14. package/build/ts/surfaces/admin/components/ClickableChip.d.ts +1 -5
  15. package/build/ts/surfaces/admin/components/ColorPicker.d.ts +1 -5
  16. package/build/ts/surfaces/admin/components/DateField.d.ts +1 -5
  17. package/build/ts/surfaces/admin/components/Menu.d.ts +1 -5
  18. package/build/ts/surfaces/admin/components/Modal.d.ts +1 -5
  19. package/build/ts/surfaces/admin/components/QueryContainer.d.ts +1 -5
  20. package/build/ts/surfaces/admin/components/shared.d.ts +30 -6
  21. package/build/ts/surfaces/checkout/components/ConsentCheckbox/ConsentCheckbox.doc.d.ts +4 -0
  22. package/build/ts/surfaces/checkout/components/ConsentCheckbox/ConsentCheckbox.doc.d.ts.map +1 -0
  23. package/build/ts/surfaces/checkout/components/ConsentCheckbox.d.ts +84 -0
  24. package/build/ts/surfaces/checkout/components/ConsentPhoneField/ConsentPhoneField.doc.d.ts +4 -0
  25. package/build/ts/surfaces/checkout/components/ConsentPhoneField/ConsentPhoneField.doc.d.ts.map +1 -0
  26. package/build/ts/surfaces/checkout/components/ConsentPhoneField.d.ts +129 -0
  27. package/build/ts/surfaces/checkout/components/NumberField/NumberField.doc.d.ts +4 -0
  28. package/build/ts/surfaces/checkout/components/NumberField/NumberField.doc.d.ts.map +1 -0
  29. package/build/ts/surfaces/checkout/components/NumberField.d.ts +98 -0
  30. package/build/ts/surfaces/checkout/components/PasswordField.d.ts +1 -1
  31. package/build/ts/surfaces/checkout/components/components-shared.d.ts +17 -0
  32. package/build/ts/surfaces/checkout/components/components.d.ts +216 -144
  33. package/build/ts/surfaces/checkout/shared.d.ts +1 -1
  34. package/build/ts/surfaces/checkout/shared.d.ts.map +1 -1
  35. package/build/ts/surfaces/checkout/targets/Checkout::Actions::RenderBefore.d.ts +3 -0
  36. package/build/ts/surfaces/checkout/targets/Checkout::CartLineDetails::RenderAfter.d.ts +3 -0
  37. package/build/ts/surfaces/checkout/targets/Checkout::CartLineDetails::RenderLineComponents.d.ts +3 -0
  38. package/build/ts/surfaces/checkout/targets/Checkout::CartLines::RenderAfter.d.ts +3 -0
  39. package/build/ts/surfaces/checkout/targets/Checkout::Contact::RenderAfter.d.ts +3 -0
  40. package/build/ts/surfaces/checkout/targets/Checkout::CustomerInformation::RenderAfter.d.ts +3 -0
  41. package/build/ts/surfaces/checkout/targets/Checkout::DeliveryAddress::RenderBefore.d.ts +3 -0
  42. package/build/ts/surfaces/checkout/targets/Checkout::Dynamic::Render.d.ts +3 -0
  43. package/build/ts/surfaces/checkout/targets/Checkout::GiftCard::Render.d.ts +3 -0
  44. package/build/ts/surfaces/checkout/targets/Checkout::PaymentMethod::HostedFields::RenderAfter.d.ts +3 -0
  45. package/build/ts/surfaces/checkout/targets/Checkout::PaymentMethod::Render.d.ts +3 -0
  46. package/build/ts/surfaces/checkout/targets/Checkout::PaymentMethod::RenderRequiredAction.d.ts +3 -0
  47. package/build/ts/surfaces/checkout/targets/Checkout::PickupLocations::RenderAfter.d.ts +3 -0
  48. package/build/ts/surfaces/checkout/targets/Checkout::PickupLocations::RenderBefore.d.ts +3 -0
  49. package/build/ts/surfaces/checkout/targets/Checkout::PickupPoints::RenderAfter.d.ts +3 -0
  50. package/build/ts/surfaces/checkout/targets/Checkout::PickupPoints::RenderBefore.d.ts +3 -0
  51. package/build/ts/surfaces/checkout/targets/Checkout::Reductions::RenderAfter.d.ts +3 -0
  52. package/build/ts/surfaces/checkout/targets/Checkout::Reductions::RenderBefore.d.ts +3 -0
  53. package/build/ts/surfaces/checkout/targets/Checkout::ShippingMethodDetails::RenderAfter.d.ts +3 -0
  54. package/build/ts/surfaces/checkout/targets/Checkout::ShippingMethodDetails::RenderExpanded.d.ts +3 -0
  55. package/build/ts/surfaces/checkout/targets/Checkout::ShippingMethods::RenderAfter.d.ts +3 -0
  56. package/build/ts/surfaces/checkout/targets/Checkout::ShippingMethods::RenderBefore.d.ts +3 -0
  57. package/build/ts/surfaces/checkout/targets/Checkout::ThankYou::CartLineDetails::RenderAfter.d.ts +3 -0
  58. package/build/ts/surfaces/checkout/targets/Checkout::ThankYou::CartLines::RenderAfter.d.ts +3 -0
  59. package/build/ts/surfaces/checkout/targets/Checkout::ThankYou::CustomerInformation::RenderAfter.d.ts +3 -0
  60. package/build/ts/surfaces/checkout/targets/Checkout::ThankYou::Dynamic::Render.d.ts +3 -0
  61. package/build/ts/surfaces/checkout/targets/purchase.cart-line-item.line-components.render.d.ts +3 -0
  62. package/build/ts/surfaces/checkout/targets/purchase.checkout.actions.render-before.d.ts +3 -0
  63. package/build/ts/surfaces/checkout/targets/purchase.checkout.block.render.d.ts +3 -0
  64. package/build/ts/surfaces/checkout/targets/purchase.checkout.cart-line-item.render-after.d.ts +3 -0
  65. package/build/ts/surfaces/checkout/targets/purchase.checkout.cart-line-list.render-after.d.ts +3 -0
  66. package/build/ts/surfaces/checkout/targets/purchase.checkout.contact.render-after.d.ts +3 -0
  67. package/build/ts/surfaces/checkout/targets/purchase.checkout.delivery-address.render-after.d.ts +3 -0
  68. package/build/ts/surfaces/checkout/targets/purchase.checkout.delivery-address.render-before.d.ts +3 -0
  69. package/build/ts/surfaces/checkout/targets/purchase.checkout.footer.render-after.d.ts +3 -0
  70. package/build/ts/surfaces/checkout/targets/purchase.checkout.gift-card.render.d.ts +3 -0
  71. package/build/ts/surfaces/checkout/targets/purchase.checkout.header.render-after.d.ts +3 -0
  72. package/build/ts/surfaces/checkout/targets/purchase.checkout.payment-method-list.render-after.d.ts +3 -0
  73. package/build/ts/surfaces/checkout/targets/purchase.checkout.payment-method-list.render-before.d.ts +3 -0
  74. package/build/ts/surfaces/checkout/targets/purchase.checkout.payment-option-item.action-required.render.d.ts +3 -0
  75. package/build/ts/surfaces/checkout/targets/purchase.checkout.payment-option-item.details.render.d.ts +3 -0
  76. package/build/ts/surfaces/checkout/targets/purchase.checkout.payment-option-item.hosted-fields.render-after.d.ts +3 -0
  77. package/build/ts/surfaces/checkout/targets/purchase.checkout.pickup-location-list.render-after.d.ts +3 -0
  78. package/build/ts/surfaces/checkout/targets/purchase.checkout.pickup-location-list.render-before.d.ts +3 -0
  79. package/build/ts/surfaces/checkout/targets/purchase.checkout.pickup-location-option-item.render-after.d.ts +3 -0
  80. package/build/ts/surfaces/checkout/targets/purchase.checkout.pickup-point-list.render-after.d.ts +3 -0
  81. package/build/ts/surfaces/checkout/targets/purchase.checkout.pickup-point-list.render-before.d.ts +3 -0
  82. package/build/ts/surfaces/checkout/targets/purchase.checkout.reductions.render-after.d.ts +3 -0
  83. package/build/ts/surfaces/checkout/targets/purchase.checkout.reductions.render-before.d.ts +3 -0
  84. package/build/ts/surfaces/checkout/targets/purchase.checkout.shipping-option-item.details.render.d.ts +3 -0
  85. package/build/ts/surfaces/checkout/targets/purchase.checkout.shipping-option-item.render-after.d.ts +3 -0
  86. package/build/ts/surfaces/checkout/targets/purchase.checkout.shipping-option-list.render-after.d.ts +3 -0
  87. package/build/ts/surfaces/checkout/targets/purchase.checkout.shipping-option-list.render-before.d.ts +3 -0
  88. package/build/ts/surfaces/checkout/targets/purchase.thank-you.announcement.render.d.ts +3 -0
  89. package/build/ts/surfaces/checkout/targets/purchase.thank-you.block.render.d.ts +3 -0
  90. package/build/ts/surfaces/checkout/targets/purchase.thank-you.cart-line-item.render-after.d.ts +3 -0
  91. package/build/ts/surfaces/checkout/targets/purchase.thank-you.cart-line-list.render-after.d.ts +3 -0
  92. package/build/ts/surfaces/checkout/targets/purchase.thank-you.customer-information.render-after.d.ts +3 -0
  93. package/build/ts/surfaces/checkout/targets/purchase.thank-you.footer.render-after.d.ts +3 -0
  94. package/build/ts/surfaces/checkout/targets/purchase.thank-you.header.render-after.d.ts +3 -0
  95. package/build/ts/surfaces/customer-account/components/ConsentCheckbox.d.ts +84 -0
  96. package/build/ts/surfaces/customer-account/components/ConsentPhoneField.d.ts +129 -0
  97. package/build/ts/surfaces/customer-account/components/NumberField.d.ts +98 -0
  98. package/build/ts/surfaces/customer-account/components/PasswordField.d.ts +1 -1
  99. package/build/ts/surfaces/customer-account/components/components-shared.d.ts +17 -0
  100. package/build/ts/surfaces/customer-account/components/components.d.ts +216 -144
  101. package/build/ts/surfaces/customer-account/targets/customer-account.footer.render-after.d.ts +3 -0
  102. package/build/ts/surfaces/customer-account/targets/customer-account.order-index.announcement.render.d.ts +3 -0
  103. package/build/ts/surfaces/customer-account/targets/customer-account.order-index.block.render.d.ts +3 -0
  104. package/build/ts/surfaces/customer-account/targets/customer-account.order-status.announcement.render.d.ts +3 -0
  105. package/build/ts/surfaces/customer-account/targets/customer-account.order-status.block.render.d.ts +3 -0
  106. package/build/ts/surfaces/customer-account/targets/customer-account.order-status.cart-line-item.render-after.d.ts +3 -0
  107. package/build/ts/surfaces/customer-account/targets/customer-account.order-status.cart-line-list.render-after.d.ts +3 -0
  108. package/build/ts/surfaces/customer-account/targets/customer-account.order-status.customer-information.render-after.d.ts +3 -0
  109. package/build/ts/surfaces/customer-account/targets/customer-account.order-status.fulfillment-details.render-after.d.ts +3 -0
  110. package/build/ts/surfaces/customer-account/targets/customer-account.order-status.payment-details.render-after.d.ts +3 -0
  111. package/build/ts/surfaces/customer-account/targets/customer-account.order-status.return-details.render-after.d.ts +3 -0
  112. package/build/ts/surfaces/customer-account/targets/customer-account.order-status.unfulfilled-items.render-after.d.ts +3 -0
  113. package/build/ts/surfaces/customer-account/targets/customer-account.order.action.menu-item.render.d.ts +3 -0
  114. package/build/ts/surfaces/customer-account/targets/customer-account.order.action.render.d.ts +3 -0
  115. package/build/ts/surfaces/customer-account/targets/customer-account.order.page.render.d.ts +3 -0
  116. package/build/ts/surfaces/customer-account/targets/customer-account.page.render.d.ts +3 -0
  117. package/build/ts/surfaces/customer-account/targets/customer-account.profile.addresses.render-after.d.ts +3 -0
  118. package/build/ts/surfaces/customer-account/targets/customer-account.profile.announcement.render.d.ts +3 -0
  119. package/build/ts/surfaces/customer-account/targets/customer-account.profile.block.render.d.ts +3 -0
  120. package/build/ts/surfaces/customer-account/targets/customer-account.profile.company-details.render-after.d.ts +3 -0
  121. package/build/ts/surfaces/customer-account/targets/customer-account.profile.company-location-addresses.render-after.d.ts +3 -0
  122. package/build/ts/surfaces/customer-account/targets/customer-account.profile.company-location-payment.render-after.d.ts +3 -0
  123. package/build/ts/surfaces/customer-account/targets/customer-account.profile.company-location-staff.render-after.d.ts +3 -0
  124. package/build/ts/surfaces/customer-account/targets/customer-account.profile.payment.render-after.d.ts +3 -0
  125. package/build/ts/surfaces/point-of-sale/components/Badge.d.ts +10 -1
  126. package/build/ts/surfaces/point-of-sale/components/Banner.d.ts +12 -4
  127. package/build/ts/surfaces/point-of-sale/components/Box.d.ts +51 -14
  128. package/build/ts/surfaces/point-of-sale/components/Button.d.ts +12 -2
  129. package/build/ts/surfaces/point-of-sale/components/Choice.d.ts +3 -2
  130. package/build/ts/surfaces/point-of-sale/components/ChoiceList.d.ts +12 -5
  131. package/build/ts/surfaces/point-of-sale/components/Clickable.d.ts +11 -4
  132. package/build/ts/surfaces/point-of-sale/components/DateField.d.ts +17 -8
  133. package/build/ts/surfaces/point-of-sale/components/DatePicker.d.ts +14 -6
  134. package/build/ts/surfaces/point-of-sale/components/DateSpinner.d.ts +10 -6
  135. package/build/ts/surfaces/point-of-sale/components/Divider.d.ts +4 -3
  136. package/build/ts/surfaces/point-of-sale/components/EmailField.d.ts +17 -7
  137. package/build/ts/surfaces/point-of-sale/components/Heading.d.ts +7 -4
  138. package/build/ts/surfaces/point-of-sale/components/Icon.d.ts +13 -3
  139. package/build/ts/surfaces/point-of-sale/components/Image.d.ts +12 -5
  140. package/build/ts/surfaces/point-of-sale/components/Modal.d.ts +28 -7
  141. package/build/ts/surfaces/point-of-sale/components/NumberField.d.ts +17 -7
  142. package/build/ts/surfaces/point-of-sale/components/Page.d.ts +25 -11
  143. package/build/ts/surfaces/point-of-sale/components/PosBlock/PosBlock.doc.d.ts.map +1 -1
  144. package/build/ts/surfaces/point-of-sale/components/PosBlock.d.ts +12 -13
  145. package/build/ts/surfaces/point-of-sale/components/QrCode.d.ts +12 -8
  146. package/build/ts/surfaces/point-of-sale/components/ScrollBox.d.ts +47 -15
  147. package/build/ts/surfaces/point-of-sale/components/SearchField.d.ts +15 -7
  148. package/build/ts/surfaces/point-of-sale/components/Section.d.ts +15 -9
  149. package/build/ts/surfaces/point-of-sale/components/Stack.d.ts +67 -7
  150. package/build/ts/surfaces/point-of-sale/components/Text.d.ts +25 -4
  151. package/build/ts/surfaces/point-of-sale/components/TextArea.d.ts +17 -7
  152. package/build/ts/surfaces/point-of-sale/components/TextField.d.ts +9 -7
  153. package/build/ts/surfaces/point-of-sale/components/Tile.d.ts +12 -2
  154. package/build/ts/surfaces/point-of-sale/components/TimeField.d.ts +14 -6
  155. package/build/ts/surfaces/point-of-sale/components/TimePicker.d.ts +14 -6
  156. package/build/ts/surfaces/point-of-sale/components/components-shared.d.ts +102 -1
  157. package/build/tsconfig.tsbuildinfo +1 -1
  158. package/package.json +2 -1
  159. package/src/docs/shared/components/ConsentCheckbox.ts +12 -0
  160. package/src/docs/shared/components/ConsentPhoneField.ts +12 -0
  161. package/src/docs/shared/components/index.ts +2 -0
  162. package/src/surfaces/admin/components/Chip.d.ts +1 -5
  163. package/src/surfaces/admin/components/ClickableChip.d.ts +1 -5
  164. package/src/surfaces/admin/components/ColorPicker.d.ts +1 -5
  165. package/src/surfaces/admin/components/DateField.d.ts +1 -5
  166. package/src/surfaces/admin/components/Menu.d.ts +1 -5
  167. package/src/surfaces/admin/components/Modal.d.ts +1 -5
  168. package/src/surfaces/admin/components/QueryContainer.d.ts +1 -5
  169. package/src/surfaces/admin/components/shared.d.ts +30 -6
  170. package/src/surfaces/admin/components.d.ts +64 -152
  171. package/src/surfaces/checkout/components/ConsentCheckbox/examples/basic-consent-checkbox.example.html +5 -0
  172. package/src/surfaces/checkout/components/ConsentCheckbox.d.ts +84 -0
  173. package/src/surfaces/checkout/components/ConsentPhoneField/examples/basic-consent-phone-field.example.html +5 -0
  174. package/src/surfaces/checkout/components/ConsentPhoneField.d.ts +129 -0
  175. package/src/surfaces/checkout/components/NumberField/examples/basic-number-field.example.html +8 -0
  176. package/src/surfaces/checkout/components/NumberField.d.ts +98 -0
  177. package/src/surfaces/checkout/components/PasswordField.d.ts +1 -1
  178. package/src/surfaces/checkout/components/PhoneField/examples/basic-phone-field.example.html +2 -1
  179. package/src/surfaces/checkout/components/ProductThumbnail/examples/basic-product-thumbnail.example.html +4 -1
  180. package/src/surfaces/checkout/components/Stack/examples/basic-stack.example.html +20 -4
  181. package/src/surfaces/checkout/components/TextArea/examples/basic-text-area.example.html +5 -1
  182. package/src/surfaces/checkout/components/TextField/examples/basic-text-field.example.html +4 -1
  183. package/src/surfaces/checkout/components/components-shared.d.ts +17 -0
  184. package/src/surfaces/checkout/components/components.d.ts +216 -144
  185. package/src/surfaces/checkout/preact/api.ts +1 -1
  186. package/src/surfaces/checkout/preact/tests/api.test.tsx +22 -13
  187. package/src/surfaces/checkout/preact/tests/app-metafields.test.ts +52 -56
  188. package/src/surfaces/checkout/preact/tests/attributes.test.ts +34 -24
  189. package/src/surfaces/checkout/preact/tests/billing-address.test.ts +17 -7
  190. package/src/surfaces/checkout/preact/tests/buyer-identity-businessCustomer.test.ts +16 -9
  191. package/src/surfaces/checkout/preact/tests/buyer-identity.test.tsx +57 -26
  192. package/src/surfaces/checkout/preact/tests/buyer-journey.test.ts +71 -74
  193. package/src/surfaces/checkout/preact/tests/capabilities.test.ts +32 -28
  194. package/src/surfaces/checkout/preact/tests/cart-line-target.test.ts +31 -24
  195. package/src/surfaces/checkout/preact/tests/checkout-settings.test.ts +17 -9
  196. package/src/surfaces/checkout/preact/tests/checkout-token.test.ts +16 -6
  197. package/src/surfaces/checkout/preact/tests/configuration.test.ts +16 -6
  198. package/src/surfaces/checkout/preact/tests/country.test.tsx +18 -8
  199. package/src/surfaces/checkout/preact/tests/currency.test.tsx +18 -8
  200. package/src/surfaces/checkout/preact/tests/customer-privacy.test.ts +17 -8
  201. package/src/surfaces/checkout/preact/tests/delivery-group-list-target.test.ts +24 -18
  202. package/src/surfaces/checkout/preact/tests/delivery-group-target.test.ts +25 -19
  203. package/src/surfaces/checkout/preact/tests/delivery-group.test.ts +22 -16
  204. package/src/surfaces/checkout/preact/tests/delivery-groups.test.ts +17 -11
  205. package/src/surfaces/checkout/preact/tests/delivery-selection-groups.test.ts +31 -24
  206. package/src/surfaces/checkout/preact/tests/discounts.test.tsx +21 -14
  207. package/src/surfaces/checkout/preact/tests/extension-language.test.tsx +17 -8
  208. package/src/surfaces/checkout/preact/tests/gift-cards.test.tsx +17 -8
  209. package/src/surfaces/checkout/preact/tests/localized-fields.test.ts +58 -59
  210. package/src/surfaces/checkout/preact/tests/market.test.tsx +17 -7
  211. package/src/surfaces/checkout/preact/tests/metafield.test.tsx +33 -36
  212. package/src/surfaces/checkout/preact/tests/metafields.test.tsx +36 -53
  213. package/src/surfaces/checkout/preact/tests/mount.tsx +60 -17
  214. package/src/surfaces/checkout/preact/tests/notes.test.tsx +16 -6
  215. package/src/surfaces/checkout/preact/tests/payment-method.test.ts +87 -60
  216. package/src/surfaces/checkout/preact/tests/payment-options.test.tsx +26 -24
  217. package/src/surfaces/checkout/preact/tests/pickup-location-option-target.test.tsx +55 -46
  218. package/src/surfaces/checkout/preact/tests/redeemable.test.ts +30 -23
  219. package/src/surfaces/checkout/preact/tests/session-token.test.tsx +12 -6
  220. package/src/surfaces/checkout/preact/tests/shipping-address.test.ts +17 -7
  221. package/src/surfaces/checkout/preact/tests/shipping-option-target.test.ts +54 -50
  222. package/src/surfaces/checkout/preact/tests/shopping-address.test.tsx +18 -10
  223. package/src/surfaces/checkout/preact/tests/timezone.test.tsx +17 -7
  224. package/src/surfaces/checkout/preact/tests/translate.test.tsx +18 -13
  225. package/src/surfaces/checkout/preact/tests/tsconfig.json +1 -1
  226. package/src/surfaces/checkout/shared.ts +2 -0
  227. package/src/surfaces/point-of-sale/components/Badge.d.ts +10 -1
  228. package/src/surfaces/point-of-sale/components/Banner.d.ts +12 -4
  229. package/src/surfaces/point-of-sale/components/Box.d.ts +51 -14
  230. package/src/surfaces/point-of-sale/components/Button.d.ts +12 -2
  231. package/src/surfaces/point-of-sale/components/Choice.d.ts +3 -2
  232. package/src/surfaces/point-of-sale/components/ChoiceList.d.ts +12 -5
  233. package/src/surfaces/point-of-sale/components/Clickable.d.ts +11 -4
  234. package/src/surfaces/point-of-sale/components/DateField.d.ts +17 -8
  235. package/src/surfaces/point-of-sale/components/DatePicker.d.ts +14 -6
  236. package/src/surfaces/point-of-sale/components/DateSpinner.d.ts +10 -6
  237. package/src/surfaces/point-of-sale/components/Divider.d.ts +4 -3
  238. package/src/surfaces/point-of-sale/components/EmailField.d.ts +17 -7
  239. package/src/surfaces/point-of-sale/components/Heading.d.ts +7 -4
  240. package/src/surfaces/point-of-sale/components/Icon.d.ts +13 -3
  241. package/src/surfaces/point-of-sale/components/Image.d.ts +12 -5
  242. package/src/surfaces/point-of-sale/components/Modal.d.ts +28 -7
  243. package/src/surfaces/point-of-sale/components/NumberField.d.ts +17 -7
  244. package/src/surfaces/point-of-sale/components/Page.d.ts +25 -11
  245. package/src/surfaces/point-of-sale/components/PosBlock.d.ts +12 -13
  246. package/src/surfaces/point-of-sale/components/QrCode.d.ts +12 -8
  247. package/src/surfaces/point-of-sale/components/ScrollBox.d.ts +47 -15
  248. package/src/surfaces/point-of-sale/components/SearchField.d.ts +15 -7
  249. package/src/surfaces/point-of-sale/components/Section.d.ts +15 -9
  250. package/src/surfaces/point-of-sale/components/Stack.d.ts +67 -7
  251. package/src/surfaces/point-of-sale/components/Text.d.ts +25 -4
  252. package/src/surfaces/point-of-sale/components/TextArea.d.ts +17 -7
  253. package/src/surfaces/point-of-sale/components/TextField.d.ts +9 -7
  254. package/src/surfaces/point-of-sale/components/Tile.d.ts +12 -2
  255. package/src/surfaces/point-of-sale/components/TimeField.d.ts +14 -6
  256. package/src/surfaces/point-of-sale/components/TimePicker.d.ts +14 -6
  257. package/src/surfaces/point-of-sale/components/components-shared.d.ts +102 -1
  258. package/src/surfaces/point-of-sale/components.d.ts +869 -481
  259. package/build/ts/surfaces/checkout/errors.d.ts +0 -10
  260. package/build/ts/surfaces/checkout/errors.d.ts.map +0 -1
  261. package/src/surfaces/checkout/errors.ts +0 -13
@@ -1,14 +1,20 @@
1
- import type {
2
- DeliveryGroup,
3
- ExtensionTarget,
4
- ShippingOption,
5
- } from '@shopify/ui-extensions/checkout';
6
-
1
+ import type {DeliveryGroup, ShippingOption} from '../../api/standard/standard';
7
2
  import {useDeliveryGroupListTarget} from '../delivery-group-list-target';
8
3
 
9
- import {mount, createMockStatefulRemoteSubscribable} from './mount';
4
+ // See __mocks__/preact/hooks
5
+ jest.mock('preact/hooks');
6
+
7
+ import {
8
+ mount,
9
+ createMockSubscribableSignalLike,
10
+ setupGlobalShopifyMock,
11
+ tearDownGlobalShopifyMock,
12
+ createMockExtension,
13
+ } from './mount';
14
+
15
+ describe('useDeliveryGroupListTarget', () => {
16
+ afterEach(tearDownGlobalShopifyMock);
10
17
 
11
- describe.skip('useDeliveryGroupListTarget', () => {
12
18
  it('returns the DeliveryGroupList target if it exists', async () => {
13
19
  const deliveryGroup: DeliveryGroup = {
14
20
  selectedDeliveryOption: {
@@ -57,19 +63,19 @@ describe.skip('useDeliveryGroupListTarget', () => {
57
63
  ],
58
64
  };
59
65
 
60
- const target: ExtensionTarget =
61
- 'purchase.checkout.shipping-option-list.render-before';
66
+ const target =
67
+ 'purchase.checkout.shipping-option-list.render-before' as const;
62
68
 
63
- const {value} = mount.hook(() => useDeliveryGroupListTarget(), {
64
- extensionApi: {
65
- extension: {target},
66
- target: createMockStatefulRemoteSubscribable({
67
- groupType: 'oneTimePurchase',
68
- deliveryGroups: [deliveryGroup, deliveryGroup2],
69
- }) as any,
70
- },
69
+ setupGlobalShopifyMock<typeof target>({
70
+ extension: createMockExtension(target),
71
+ target: createMockSubscribableSignalLike({
72
+ groupType: 'oneTimePurchase',
73
+ deliveryGroups: [deliveryGroup, deliveryGroup2],
74
+ }),
71
75
  });
72
76
 
77
+ const {value} = mount.hook(() => useDeliveryGroupListTarget());
78
+
73
79
  expect(value).toStrictEqual({
74
80
  groupType: 'oneTimePurchase',
75
81
  deliveryGroups: [deliveryGroup, deliveryGroup2],
@@ -1,15 +1,21 @@
1
- import type {
2
- DeliveryGroup,
3
- ExtensionTarget,
4
- ShippingOption,
5
- } from '@shopify/ui-extensions/checkout';
6
-
1
+ import type {DeliveryGroup, ShippingOption} from '../../api/standard/standard';
7
2
  // eslint-disable-next-line import-x/no-deprecated
8
3
  import {useDeliveryGroupTarget} from '../delivery-group-target';
9
4
 
10
- import {mount, createMockStatefulRemoteSubscribable} from './mount';
5
+ // See __mocks__/preact/hooks
6
+ jest.mock('preact/hooks');
7
+
8
+ import {
9
+ mount,
10
+ createMockSubscribableSignalLike,
11
+ setupGlobalShopifyMock,
12
+ tearDownGlobalShopifyMock,
13
+ createMockExtension,
14
+ } from './mount';
15
+
16
+ describe('useDeliveryGroupTarget', () => {
17
+ afterEach(tearDownGlobalShopifyMock);
11
18
 
12
- describe.skip('useDeliveryGroupTarget', () => {
13
19
  it('returns the DeliveryGroup target if it exists', async () => {
14
20
  const deliveryGroup: DeliveryGroup = {
15
21
  selectedDeliveryOption: {
@@ -58,20 +64,20 @@ describe.skip('useDeliveryGroupTarget', () => {
58
64
  ],
59
65
  };
60
66
 
61
- const target: ExtensionTarget =
62
- 'purchase.checkout.shipping-option-list.render-before';
67
+ const target =
68
+ 'purchase.checkout.shipping-option-list.render-before' as const;
63
69
 
64
- // eslint-disable-next-line import-x/no-deprecated
65
- const {value} = mount.hook(() => useDeliveryGroupTarget(), {
66
- extensionApi: {
67
- extension: {target},
68
- target: createMockStatefulRemoteSubscribable({
69
- groupType: 'oneTimePurchase',
70
- deliveryGroups: [deliveryGroup, deliveryGroup2],
71
- }) as any,
72
- },
70
+ setupGlobalShopifyMock<typeof target>({
71
+ extension: createMockExtension(target),
72
+ target: createMockSubscribableSignalLike({
73
+ groupType: 'oneTimePurchase',
74
+ deliveryGroups: [deliveryGroup, deliveryGroup2],
75
+ }),
73
76
  });
74
77
 
78
+ // eslint-disable-next-line import-x/no-deprecated
79
+ const {value} = mount.hook(() => useDeliveryGroupTarget());
80
+
75
81
  expect(value).toStrictEqual(deliveryGroup);
76
82
  });
77
83
  });
@@ -2,14 +2,23 @@ import type {
2
2
  DeliveryGroup,
3
3
  ShippingOption,
4
4
  CartLine,
5
- } from '@shopify/ui-extensions/checkout';
5
+ } from '../../api/standard/standard';
6
6
 
7
7
  import {useDeliveryGroup} from '../delivery-group';
8
8
 
9
- import type {PartialExtensionApi} from './mount';
10
- import {mount, createMockStatefulRemoteSubscribable} from './mount';
9
+ import {
10
+ mount,
11
+ createMockSubscribableSignalLike,
12
+ setupGlobalShopifyMock,
13
+ tearDownGlobalShopifyMock,
14
+ } from './mount';
15
+
16
+ // See __mocks__/preact/hooks
17
+ jest.mock('preact/hooks');
18
+
19
+ describe('Delivery Group API hooks', () => {
20
+ afterEach(tearDownGlobalShopifyMock);
11
21
 
12
- describe.skip('Delivery Group API hooks', () => {
13
22
  describe('useDeliveryGroup', () => {
14
23
  const defaultLine = {
15
24
  id: 'gid://shopify/CartLine/stable_id',
@@ -35,17 +44,16 @@ describe.skip('Delivery Group API hooks', () => {
35
44
  },
36
45
  attributes: [],
37
46
  discountAllocations: [],
47
+ parentRelationship: null,
38
48
  } as CartLine;
39
49
 
40
50
  it('returns undefined when no delivery group is provided', async () => {
41
- const extensionApi: PartialExtensionApi = {
42
- lines: createMockStatefulRemoteSubscribable([defaultLine]),
43
- };
44
-
45
- const {value} = mount.hook(() => useDeliveryGroup(undefined), {
46
- extensionApi,
51
+ setupGlobalShopifyMock({
52
+ lines: createMockSubscribableSignalLike([defaultLine]),
47
53
  });
48
54
 
55
+ const {value} = mount.hook(() => useDeliveryGroup(undefined));
56
+
49
57
  expect(value).toBeUndefined();
50
58
  });
51
59
 
@@ -112,14 +120,12 @@ describe.skip('Delivery Group API hooks', () => {
112
120
  ],
113
121
  };
114
122
 
115
- const extensionApi: PartialExtensionApi = {
116
- lines: createMockStatefulRemoteSubscribable([defaultLine]),
117
- };
118
-
119
- const {value} = mount.hook(() => useDeliveryGroup(deliveryGroup), {
120
- extensionApi,
123
+ setupGlobalShopifyMock({
124
+ lines: createMockSubscribableSignalLike([defaultLine]),
121
125
  });
122
126
 
127
+ const {value} = mount.hook(() => useDeliveryGroup(deliveryGroup));
128
+
123
129
  const expectedDeliveryGroup = {
124
130
  ...deliveryGroup,
125
131
  selectedDeliveryOption: deliveryGroup.deliveryOptions[0],
@@ -1,14 +1,20 @@
1
- import type {
2
- DeliveryGroup,
3
- ShippingOption,
4
- } from '@shopify/ui-extensions/checkout';
1
+ import type {DeliveryGroup, ShippingOption} from '../../api/standard/standard';
5
2
 
6
3
  import {useDeliveryGroups} from '../delivery-groups';
7
4
 
8
- import type {PartialExtensionApi} from './mount';
9
- import {mount, createMockStatefulRemoteSubscribable} from './mount';
5
+ // See __mocks__/preact/hooks
6
+ jest.mock('preact/hooks');
7
+
8
+ import {
9
+ mount,
10
+ createMockSubscribableSignalLike,
11
+ setupGlobalShopifyMock,
12
+ tearDownGlobalShopifyMock,
13
+ } from './mount';
14
+
15
+ describe('Delivery Groups API hooks', () => {
16
+ afterEach(tearDownGlobalShopifyMock);
10
17
 
11
- describe.skip('Delivery Groups API hooks', () => {
12
18
  describe('useDeliveryGroups', () => {
13
19
  it('returns the current devliery groups', async () => {
14
20
  const deliveryGroups: DeliveryGroup[] = [
@@ -51,11 +57,11 @@ describe.skip('Delivery Groups API hooks', () => {
51
57
  },
52
58
  ];
53
59
 
54
- const extensionApi: PartialExtensionApi = {
55
- deliveryGroups: createMockStatefulRemoteSubscribable(deliveryGroups),
56
- };
60
+ setupGlobalShopifyMock({
61
+ deliveryGroups: createMockSubscribableSignalLike(deliveryGroups),
62
+ });
57
63
 
58
- const {value} = mount.hook(() => useDeliveryGroups(), {extensionApi});
64
+ const {value} = mount.hook(() => useDeliveryGroups());
59
65
 
60
66
  expect(value).toBe(deliveryGroups);
61
67
  });
@@ -1,12 +1,20 @@
1
1
  import {faker} from '@faker-js/faker';
2
2
 
3
- import type {ExtensionTarget} from '@shopify/ui-extensions/checkout';
4
-
5
3
  import {useDeliverySelectionGroups} from '../delivery-selection-groups';
6
4
 
7
- import {mount, createMockStatefulRemoteSubscribable} from './mount';
5
+ // See __mocks__/preact/hooks
6
+ jest.mock('preact/hooks');
7
+
8
+ import {
9
+ mount,
10
+ createMockSubscribableSignalLike,
11
+ setupGlobalShopifyMock,
12
+ tearDownGlobalShopifyMock,
13
+ createMockExtension,
14
+ } from './mount';
8
15
 
9
- describe.skip('useDeliverySelectionGroups', () => {
16
+ describe('useDeliverySelectionGroups', () => {
17
+ afterEach(tearDownGlobalShopifyMock);
10
18
  it('returns deliverySelectionGroups if it exists', async () => {
11
19
  const deliverySelectionGroup = {
12
20
  handle: faker.string.uuid(),
@@ -18,41 +26,40 @@ describe.skip('useDeliverySelectionGroups', () => {
18
26
  ],
19
27
  cost: {
20
28
  amount: 10,
21
- currencyCode: 'USD',
29
+ currencyCode: 'USD' as const,
22
30
  },
23
31
  costAfterDiscounts: {
24
32
  amount: 10,
25
- currencyCode: 'USD',
33
+ currencyCode: 'USD' as const,
26
34
  },
27
35
  };
28
36
 
29
- const target: ExtensionTarget =
30
- 'purchase.checkout.shipping-option-list.render-before';
37
+ const target =
38
+ 'purchase.checkout.shipping-option-list.render-before' as const;
31
39
 
32
- const {value} = mount.hook(() => useDeliverySelectionGroups(), {
33
- extensionApi: {
34
- extension: {target},
35
- deliverySelectionGroups: createMockStatefulRemoteSubscribable([
36
- deliverySelectionGroup,
37
- ]) as any,
38
- },
40
+ setupGlobalShopifyMock<typeof target>({
41
+ extension: createMockExtension(target),
42
+ deliverySelectionGroups: createMockSubscribableSignalLike([
43
+ deliverySelectionGroup,
44
+ ]),
39
45
  });
40
46
 
47
+ const {value} = mount.hook(() => useDeliverySelectionGroups());
48
+
41
49
  expect(value).toStrictEqual([deliverySelectionGroup]);
42
50
  });
43
51
 
44
52
  it('returns undefined if delivery selection groups are missing', async () => {
45
- const target: ExtensionTarget =
46
- 'purchase.checkout.shipping-option-list.render-before';
47
-
48
- const {value} = mount.hook(() => useDeliverySelectionGroups(), {
49
- extensionApi: {
50
- extension: {target},
51
- deliverySelectionGroups:
52
- createMockStatefulRemoteSubscribable(undefined),
53
- },
53
+ const target =
54
+ 'purchase.checkout.shipping-option-list.render-before' as const;
55
+
56
+ setupGlobalShopifyMock<typeof target>({
57
+ extension: createMockExtension(target),
58
+ deliverySelectionGroups: createMockSubscribableSignalLike(undefined),
54
59
  });
55
60
 
61
+ const {value} = mount.hook(() => useDeliverySelectionGroups());
62
+
56
63
  expect(value).toBeUndefined();
57
64
  });
58
65
  });
@@ -1,14 +1,23 @@
1
1
  import type {
2
2
  CartDiscountCode,
3
3
  CartDiscountAllocation,
4
- } from '@shopify/ui-extensions/checkout';
4
+ } from '../../api/standard/standard';
5
5
 
6
6
  import {useDiscountAllocations, useDiscountCodes} from '../discounts';
7
7
 
8
- import {mount, createMockStatefulRemoteSubscribable} from './mount';
9
- import type {PartialExtensionApi} from './mount';
8
+ // See __mocks__/preact/hooks
9
+ jest.mock('preact/hooks');
10
+
11
+ import {
12
+ mount,
13
+ createMockSubscribableSignalLike,
14
+ setupGlobalShopifyMock,
15
+ tearDownGlobalShopifyMock,
16
+ } from './mount';
17
+
18
+ describe('Discounts API hooks', () => {
19
+ afterEach(tearDownGlobalShopifyMock);
10
20
 
11
- describe.skip('Discounts API hooks', () => {
12
21
  describe('useDiscountCodes', () => {
13
22
  it('returns the current discount codes', async () => {
14
23
  const discountCodes: CartDiscountCode[] = [
@@ -16,11 +25,11 @@ describe.skip('Discounts API hooks', () => {
16
25
  {code: 'free_shipping'},
17
26
  ];
18
27
 
19
- const extensionApi: PartialExtensionApi = {
20
- discountCodes: createMockStatefulRemoteSubscribable(discountCodes),
21
- };
28
+ setupGlobalShopifyMock({
29
+ discountCodes: createMockSubscribableSignalLike(discountCodes),
30
+ });
22
31
 
23
- const {value} = mount.hook(() => useDiscountCodes(), {extensionApi});
32
+ const {value} = mount.hook(() => useDiscountCodes());
24
33
 
25
34
  expect(value).toBe(discountCodes);
26
35
  });
@@ -55,15 +64,13 @@ describe.skip('Discounts API hooks', () => {
55
64
  },
56
65
  ];
57
66
 
58
- const extensionApi: PartialExtensionApi = {
67
+ setupGlobalShopifyMock({
59
68
  discountAllocations:
60
- createMockStatefulRemoteSubscribable(discountAllocations),
61
- };
62
-
63
- const {value} = mount.hook(() => useDiscountAllocations(), {
64
- extensionApi,
69
+ createMockSubscribableSignalLike(discountAllocations),
65
70
  });
66
71
 
72
+ const {value} = mount.hook(() => useDiscountAllocations());
73
+
67
74
  expect(value).toBe(discountAllocations);
68
75
  });
69
76
  });
@@ -1,20 +1,29 @@
1
1
  import {useExtensionLanguage} from '../extension-language';
2
2
 
3
- import {mount, createMockStatefulRemoteSubscribable} from './mount';
3
+ // See __mocks__/preact/hooks
4
+ jest.mock('preact/hooks');
5
+
6
+ import {
7
+ mount,
8
+ createMockSubscribableSignalLike,
9
+ setupGlobalShopifyMock,
10
+ tearDownGlobalShopifyMock,
11
+ } from './mount';
12
+
13
+ describe('useExtensionLanguage', () => {
14
+ afterEach(tearDownGlobalShopifyMock);
4
15
 
5
- describe.skip('useExtensionLanguage', () => {
6
16
  it('returns extension language from api', () => {
7
17
  const extensionLanguage = {isoCode: 'en-CA'};
8
18
 
9
- const {value} = mount.hook(() => useExtensionLanguage(), {
10
- extensionApi: {
11
- localization: {
12
- extensionLanguage:
13
- createMockStatefulRemoteSubscribable(extensionLanguage),
14
- },
19
+ setupGlobalShopifyMock({
20
+ localization: {
21
+ extensionLanguage: createMockSubscribableSignalLike(extensionLanguage),
15
22
  },
16
23
  });
17
24
 
25
+ const {value} = mount.hook(() => useExtensionLanguage());
26
+
18
27
  expect(value).toStrictEqual(extensionLanguage);
19
28
  });
20
29
  });
@@ -1,11 +1,20 @@
1
- import type {AppliedGiftCard} from '@shopify/ui-extensions/checkout';
1
+ import type {AppliedGiftCard} from '../../api/standard/standard';
2
2
 
3
3
  import {useAppliedGiftCards} from '../gift-cards';
4
4
 
5
- import {mount, createMockStatefulRemoteSubscribable} from './mount';
6
- import type {PartialExtensionApi} from './mount';
5
+ // See __mocks__/preact/hooks
6
+ jest.mock('preact/hooks');
7
+
8
+ import {
9
+ mount,
10
+ createMockSubscribableSignalLike,
11
+ setupGlobalShopifyMock,
12
+ tearDownGlobalShopifyMock,
13
+ } from './mount';
14
+
15
+ describe('Gift cards API hooks', () => {
16
+ afterEach(tearDownGlobalShopifyMock);
7
17
 
8
- describe.skip('Gift cards API hooks', () => {
9
18
  describe('useAppliedGiftCards', () => {
10
19
  it('returns the current gift cards', async () => {
11
20
  const giftCards: AppliedGiftCard[] = [
@@ -21,11 +30,11 @@ describe.skip('Gift cards API hooks', () => {
21
30
  },
22
31
  ];
23
32
 
24
- const extensionApi: PartialExtensionApi = {
25
- appliedGiftCards: createMockStatefulRemoteSubscribable(giftCards),
26
- };
33
+ setupGlobalShopifyMock({
34
+ appliedGiftCards: createMockSubscribableSignalLike(giftCards),
35
+ });
27
36
 
28
- const {value} = mount.hook(() => useAppliedGiftCards(), {extensionApi});
37
+ const {value} = mount.hook(() => useAppliedGiftCards());
29
38
 
30
39
  expect(value).toBe(giftCards);
31
40
  });
@@ -1,21 +1,31 @@
1
- import type {LocalizedField} from '@shopify/ui-extensions/checkout';
1
+ import type {LocalizedField} from '../../api/standard/standard';
2
2
 
3
3
  import {useLocalizedFields, useLocalizedField} from '../localized-fields';
4
4
 
5
- import {mount, createMockStatefulRemoteSubscribable} from './mount';
5
+ // See __mocks__/preact/hooks
6
+ jest.mock('preact/hooks');
7
+
8
+ import {
9
+ mount,
10
+ createMockSubscribableSignalLike,
11
+ setupGlobalShopifyMock,
12
+ tearDownGlobalShopifyMock,
13
+ } from './mount';
14
+
15
+ describe('useLocalizedFields', () => {
16
+ afterEach(tearDownGlobalShopifyMock);
6
17
 
7
- describe.skip('useLocalizedFields', () => {
8
18
  it('throws an error if localized fields are not available', () => {
9
- const extensionApi = {
19
+ setupGlobalShopifyMock({
10
20
  localizedFields: undefined,
11
- };
21
+ });
12
22
 
13
23
  expect(() => {
14
- mount.hook(() => useLocalizedFields(['TAX_CREDENTIAL_BR']), {
15
- extensionApi,
16
- });
24
+ mount.hook(() => useLocalizedFields(['TAX_CREDENTIAL_BR']));
17
25
  }).toThrow(
18
- 'Using localized fields requires having personal customer data permissions granted to your app.',
26
+ expect.objectContaining({
27
+ name: 'ScopeNotGrantedError',
28
+ }),
19
29
  );
20
30
  });
21
31
 
@@ -33,11 +43,11 @@ describe.skip('useLocalizedFields', () => {
33
43
  },
34
44
  ];
35
45
 
36
- const extensionApi = {
37
- localizedFields: createMockStatefulRemoteSubscribable(localizedFields),
38
- };
46
+ setupGlobalShopifyMock({
47
+ localizedFields: createMockSubscribableSignalLike(localizedFields),
48
+ });
39
49
 
40
- const {value} = mount.hook(() => useLocalizedFields(), {extensionApi});
50
+ const {value} = mount.hook(() => useLocalizedFields());
41
51
 
42
52
  expect(value).toStrictEqual(localizedFields);
43
53
  });
@@ -56,11 +66,11 @@ describe.skip('useLocalizedFields', () => {
56
66
  },
57
67
  ];
58
68
 
59
- const extensionApi = {
60
- localizedFields: createMockStatefulRemoteSubscribable(localizedFields),
61
- };
69
+ setupGlobalShopifyMock({
70
+ localizedFields: createMockSubscribableSignalLike(localizedFields),
71
+ });
62
72
 
63
- const {value} = mount.hook(() => useLocalizedFields([]), {extensionApi});
73
+ const {value} = mount.hook(() => useLocalizedFields([]));
64
74
 
65
75
  expect(value).toStrictEqual([]);
66
76
  });
@@ -79,14 +89,11 @@ describe.skip('useLocalizedFields', () => {
79
89
  },
80
90
  ];
81
91
 
82
- const extensionApi = {
83
- localizedFields: createMockStatefulRemoteSubscribable(localizedFields),
84
- };
92
+ setupGlobalShopifyMock({
93
+ localizedFields: createMockSubscribableSignalLike(localizedFields),
94
+ });
85
95
 
86
- const {value} = mount.hook(
87
- () => useLocalizedFields(['TAX_CREDENTIAL_ES']),
88
- {extensionApi},
89
- );
96
+ const {value} = mount.hook(() => useLocalizedFields(['TAX_CREDENTIAL_ES']));
90
97
 
91
98
  expect(value).toStrictEqual([]);
92
99
  });
@@ -110,13 +117,12 @@ describe.skip('useLocalizedFields', () => {
110
117
  },
111
118
  ];
112
119
 
113
- const extensionApi = {
114
- localizedFields: createMockStatefulRemoteSubscribable(localizedFields),
115
- };
120
+ setupGlobalShopifyMock({
121
+ localizedFields: createMockSubscribableSignalLike(localizedFields),
122
+ });
116
123
 
117
- const {value} = mount.hook(
118
- () => useLocalizedFields(['TAX_CREDENTIAL_MX', 'TAX_CREDENTIAL_USE_MX']),
119
- {extensionApi},
124
+ const {value} = mount.hook(() =>
125
+ useLocalizedFields(['TAX_CREDENTIAL_MX', 'TAX_CREDENTIAL_USE_MX']),
120
126
  );
121
127
 
122
128
  expect(value).toMatchObject([localizedFields[0], localizedFields[2]]);
@@ -141,25 +147,24 @@ describe.skip('useLocalizedFields', () => {
141
147
  },
142
148
  ];
143
149
 
144
- const extensionApi = {
145
- localizedFields: createMockStatefulRemoteSubscribable(localizedFields),
146
- };
147
-
148
- const {value} = mount.hook(
149
- () =>
150
- useLocalizedFields([
151
- 'TAX_CREDENTIAL_MX',
152
- 'TAX_CREDENTIAL_BR',
153
- 'TAX_CREDENTIAL_USE_MX',
154
- ]),
155
- {extensionApi},
150
+ setupGlobalShopifyMock({
151
+ localizedFields: createMockSubscribableSignalLike(localizedFields),
152
+ });
153
+
154
+ const {value} = mount.hook(() =>
155
+ useLocalizedFields([
156
+ 'TAX_CREDENTIAL_MX',
157
+ 'TAX_CREDENTIAL_BR',
158
+ 'TAX_CREDENTIAL_USE_MX',
159
+ ]),
156
160
  );
157
161
 
158
162
  expect(value).toMatchObject([localizedFields[0], localizedFields[2]]);
159
163
  });
160
164
  });
161
165
 
162
- describe.skip('useLocalizedField', () => {
166
+ describe('useLocalizedField', () => {
167
+ afterEach(tearDownGlobalShopifyMock);
163
168
  it('returns the localized field that matches the passed key', async () => {
164
169
  const localizedFields: LocalizedField[] = [
165
170
  {
@@ -179,15 +184,12 @@ describe.skip('useLocalizedField', () => {
179
184
  },
180
185
  ];
181
186
 
182
- const extensionApi = {
183
- localizedFields: createMockStatefulRemoteSubscribable(localizedFields),
184
- };
187
+ setupGlobalShopifyMock({
188
+ localizedFields: createMockSubscribableSignalLike(localizedFields),
189
+ });
185
190
 
186
- const {value} = mount.hook(
187
- () => useLocalizedField('TAX_CREDENTIAL_USE_MX'),
188
- {
189
- extensionApi,
190
- },
191
+ const {value} = mount.hook(() =>
192
+ useLocalizedField('TAX_CREDENTIAL_USE_MX'),
191
193
  );
192
194
 
193
195
  expect(value).toStrictEqual(localizedFields[2]);
@@ -196,15 +198,12 @@ describe.skip('useLocalizedField', () => {
196
198
  it('returns undefined if no localized field matches the passed key', async () => {
197
199
  const localizedFields: LocalizedField[] = [];
198
200
 
199
- const extensionApi = {
200
- localizedFields: createMockStatefulRemoteSubscribable(localizedFields),
201
- };
201
+ setupGlobalShopifyMock({
202
+ localizedFields: createMockSubscribableSignalLike(localizedFields),
203
+ });
202
204
 
203
- const {value} = mount.hook(
204
- () => useLocalizedField('TAX_CREDENTIAL_USE_MX'),
205
- {
206
- extensionApi,
207
- },
205
+ const {value} = mount.hook(() =>
206
+ useLocalizedField('TAX_CREDENTIAL_USE_MX'),
208
207
  );
209
208
 
210
209
  expect(value).toBeUndefined();