@salesforce/retail-react-app 1.0.0 → 1.1.0-dev.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 (249) hide show
  1. package/CHANGELOG.md +1 -0
  2. package/app/components/_app/index.jsx +6 -2
  3. package/app/components/_app-config/index.jsx +1 -1
  4. package/app/components/_app-config/index.test.js +3 -1
  5. package/app/components/_error/index.jsx +9 -1
  6. package/app/components/action-card/index.jsx +1 -1
  7. package/app/components/address-display/index.jsx +1 -1
  8. package/app/components/basic-tile/index.jsx +7 -1
  9. package/app/components/breadcrumb/index.jsx +1 -1
  10. package/app/components/confirmation-modal/index.jsx +1 -1
  11. package/app/components/confirmation-modal/index.test.js +1 -1
  12. package/app/components/drawer-menu/index.jsx +1 -1
  13. package/app/components/dynamic-image/index.jsx +1 -1
  14. package/app/components/field/index.jsx +1 -1
  15. package/app/components/footer/index.jsx +2 -2
  16. package/app/components/forms/address-fields.jsx +6 -1
  17. package/app/components/forms/credit-card-fields.jsx +9 -1
  18. package/app/components/forms/form-action-buttons.jsx +1 -1
  19. package/app/components/forms/login-fields.jsx +1 -1
  20. package/app/components/forms/password-requirements.jsx +1 -1
  21. package/app/components/forms/post-checkout-registration-fields.jsx +1 -1
  22. package/app/components/forms/profile-fields.jsx +1 -1
  23. package/app/components/forms/promo-code-fields.jsx +1 -1
  24. package/app/components/forms/registration-fields.jsx +1 -1
  25. package/app/components/forms/reset-password-fields.jsx +1 -1
  26. package/app/components/forms/update-password-fields.jsx +6 -1
  27. package/app/components/header/index.jsx +1 -1
  28. package/app/components/header/index.test.js +4 -2
  29. package/app/components/hero/index.jsx +7 -1
  30. package/app/components/icons/index.jsx +1 -1
  31. package/app/components/image-gallery/index.jsx +1 -1
  32. package/app/components/item-variant/item-attributes.jsx +1 -1
  33. package/app/components/item-variant/item-image.jsx +1 -1
  34. package/app/components/item-variant/item-price.jsx +1 -1
  35. package/app/components/link/index.jsx +1 -1
  36. package/app/components/links-list/index.jsx +8 -1
  37. package/app/components/links-list/index.test.js +4 -1
  38. package/app/components/list-menu/index.jsx +1 -1
  39. package/app/components/loading-spinner/index.jsx +1 -1
  40. package/app/components/locale-selector/index.jsx +1 -1
  41. package/app/components/login/index.jsx +7 -1
  42. package/app/components/nested-accordion/index.jsx +1 -1
  43. package/app/components/offline-banner/index.jsx +1 -1
  44. package/app/components/offline-boundary/index.jsx +1 -1
  45. package/app/components/order-summary/index.jsx +9 -1
  46. package/app/components/page-action-placeholder/index.jsx +1 -1
  47. package/app/components/pagination/index.jsx +1 -1
  48. package/app/components/product-item/index.jsx +1 -1
  49. package/app/components/product-scroller/index.jsx +8 -1
  50. package/app/components/product-tile/index.jsx +1 -1
  51. package/app/components/product-view/index.jsx +17 -4
  52. package/app/components/product-view/index.test.js +26 -1
  53. package/app/components/product-view-modal/index.jsx +7 -1
  54. package/app/components/product-view-modal/index.test.js +1 -1
  55. package/app/components/promo-code/index.jsx +1 -1
  56. package/app/components/promo-popover/index.jsx +1 -1
  57. package/app/components/quantity-picker/index.jsx +6 -1
  58. package/app/components/radio-card/index.jsx +1 -1
  59. package/app/components/recommended-products/index.jsx +1 -1
  60. package/app/components/register/index.jsx +7 -1
  61. package/app/components/reset-password/index.jsx +1 -1
  62. package/app/components/responsive/index.jsx +1 -1
  63. package/app/components/search/index.jsx +1 -1
  64. package/app/components/search/partials/recent-searches.jsx +1 -1
  65. package/app/components/search/partials/search-suggestions.jsx +1 -1
  66. package/app/components/search/partials/suggestions.jsx +1 -1
  67. package/app/components/section/index.jsx +7 -1
  68. package/app/components/shared/theme/index.jsx +10 -0
  69. package/app/components/shared/ui/Accordion/index.jsx +8 -0
  70. package/app/components/shared/ui/AccordionButton/index.jsx +8 -0
  71. package/app/components/shared/ui/AccordionIcon/index.jsx +8 -0
  72. package/app/components/shared/ui/AccordionItem/index.jsx +8 -0
  73. package/app/components/shared/ui/AccordionPanel/index.jsx +8 -0
  74. package/app/components/shared/ui/Alert/index.jsx +8 -0
  75. package/app/components/shared/ui/AlertDialog/index.jsx +8 -0
  76. package/app/components/shared/ui/AlertDialogBody/index.jsx +8 -0
  77. package/app/components/shared/ui/AlertDialogContent/index.jsx +8 -0
  78. package/app/components/shared/ui/AlertDialogFooter/index.jsx +8 -0
  79. package/app/components/shared/ui/AlertDialogHeader/index.jsx +8 -0
  80. package/app/components/shared/ui/AlertDialogOverlay/index.jsx +8 -0
  81. package/app/components/shared/ui/AlertIcon/index.jsx +8 -0
  82. package/app/components/shared/ui/AlertTitle/index.jsx +8 -0
  83. package/app/components/shared/ui/AspectRatio/index.jsx +8 -0
  84. package/app/components/shared/ui/Badge/index.jsx +8 -0
  85. package/app/components/shared/ui/Box/index.jsx +8 -0
  86. package/app/components/shared/ui/Breadcrumb/index.jsx +8 -0
  87. package/app/components/shared/ui/BreadcrumbItem/index.jsx +8 -0
  88. package/app/components/shared/ui/BreadcrumbLink/index.jsx +8 -0
  89. package/app/components/shared/ui/Button/index.jsx +8 -0
  90. package/app/components/shared/ui/ButtonGroup/index.jsx +8 -0
  91. package/app/components/shared/ui/Center/index.jsx +8 -0
  92. package/app/components/shared/ui/ChakraProvider/index.jsx +8 -0
  93. package/app/components/shared/ui/Checkbox/index.jsx +8 -0
  94. package/app/components/shared/ui/CloseButton/index.jsx +8 -0
  95. package/app/components/shared/ui/Container/index.jsx +8 -0
  96. package/app/components/shared/ui/Divider/index.jsx +8 -0
  97. package/app/components/shared/ui/Drawer/index.jsx +8 -0
  98. package/app/components/shared/ui/DrawerBody/index.jsx +8 -0
  99. package/app/components/shared/ui/DrawerCloseButton/index.jsx +8 -0
  100. package/app/components/shared/ui/DrawerContent/index.jsx +8 -0
  101. package/app/components/shared/ui/DrawerFooter/index.jsx +8 -0
  102. package/app/components/shared/ui/DrawerHeader/index.jsx +8 -0
  103. package/app/components/shared/ui/DrawerOverlay/index.jsx +8 -0
  104. package/app/components/shared/ui/Fade/index.jsx +8 -0
  105. package/app/components/shared/ui/Flex/index.jsx +8 -0
  106. package/app/components/shared/ui/FormControl/index.jsx +8 -0
  107. package/app/components/shared/ui/FormErrorMessage/index.jsx +8 -0
  108. package/app/components/shared/ui/FormLabel/index.jsx +8 -0
  109. package/app/components/shared/ui/Grid/index.jsx +8 -0
  110. package/app/components/shared/ui/GridItem/index.jsx +8 -0
  111. package/app/components/shared/ui/HStack/index.jsx +8 -0
  112. package/app/components/shared/ui/Heading/index.jsx +8 -0
  113. package/app/components/shared/ui/Icon/index.jsx +8 -0
  114. package/app/components/shared/ui/IconButton/index.jsx +8 -0
  115. package/app/components/shared/ui/Image/index.jsx +8 -0
  116. package/app/components/shared/ui/Img/index.jsx +8 -0
  117. package/app/components/shared/ui/Input/index.jsx +8 -0
  118. package/app/components/shared/ui/InputGroup/index.jsx +8 -0
  119. package/app/components/shared/ui/InputLeftElement/index.jsx +8 -0
  120. package/app/components/shared/ui/InputRightElement/index.jsx +8 -0
  121. package/app/components/shared/ui/Link/index.jsx +8 -0
  122. package/app/components/shared/ui/List/index.jsx +8 -0
  123. package/app/components/shared/ui/ListItem/index.jsx +8 -0
  124. package/app/components/shared/ui/Modal/index.jsx +8 -0
  125. package/app/components/shared/ui/ModalBody/index.jsx +8 -0
  126. package/app/components/shared/ui/ModalCloseButton/index.jsx +8 -0
  127. package/app/components/shared/ui/ModalContent/index.jsx +8 -0
  128. package/app/components/shared/ui/ModalFooter/index.jsx +8 -0
  129. package/app/components/shared/ui/ModalHeader/index.jsx +8 -0
  130. package/app/components/shared/ui/ModalOverlay/index.jsx +8 -0
  131. package/app/components/shared/ui/Popover/index.jsx +8 -0
  132. package/app/components/shared/ui/PopoverArrow/index.jsx +8 -0
  133. package/app/components/shared/ui/PopoverBody/index.jsx +8 -0
  134. package/app/components/shared/ui/PopoverCloseButton/index.jsx +8 -0
  135. package/app/components/shared/ui/PopoverContent/index.jsx +8 -0
  136. package/app/components/shared/ui/PopoverFooter/index.jsx +8 -0
  137. package/app/components/shared/ui/PopoverHeader/index.jsx +8 -0
  138. package/app/components/shared/ui/PopoverTrigger/index.jsx +8 -0
  139. package/app/components/shared/ui/Portal/index.jsx +8 -0
  140. package/app/components/shared/ui/Radio/index.jsx +8 -0
  141. package/app/components/shared/ui/RadioGroup/index.jsx +8 -0
  142. package/app/components/shared/ui/Select/index.jsx +8 -0
  143. package/app/components/shared/ui/SimpleGrid/index.jsx +8 -0
  144. package/app/components/shared/ui/Skeleton/index.jsx +8 -0
  145. package/app/components/shared/ui/Spacer/index.jsx +8 -0
  146. package/app/components/shared/ui/Spinner/index.jsx +8 -0
  147. package/app/components/shared/ui/Stack/index.jsx +8 -0
  148. package/app/components/shared/ui/StackDivider/index.jsx +8 -0
  149. package/app/components/shared/ui/StylesProvider/index.jsx +8 -0
  150. package/app/components/shared/ui/Text/index.jsx +8 -0
  151. package/app/components/shared/ui/Tooltip/index.jsx +8 -0
  152. package/app/components/shared/ui/VStack/index.jsx +8 -0
  153. package/app/components/shared/ui/Wrap/index.jsx +8 -0
  154. package/app/components/shared/ui/WrapItem/index.jsx +8 -0
  155. package/app/components/shared/ui/createStylesContext/index.jsx +8 -0
  156. package/app/components/shared/ui/extendTheme/index.jsx +8 -0
  157. package/app/components/shared/ui/index.jsx +107 -0
  158. package/app/components/shared/ui/useBreakpoint/index.jsx +8 -0
  159. package/app/components/shared/ui/useBreakpointValue/index.jsx +8 -0
  160. package/app/components/shared/ui/useDisclosure/index.jsx +8 -0
  161. package/app/components/shared/ui/useMediaQuery/index.jsx +8 -0
  162. package/app/components/shared/ui/useMultiStyleConfig/index.jsx +8 -0
  163. package/app/components/shared/ui/useNumberInput/index.jsx +8 -0
  164. package/app/components/shared/ui/useRadio/index.jsx +8 -0
  165. package/app/components/shared/ui/useRadioGroup/index.jsx +8 -0
  166. package/app/components/shared/ui/useStyleConfig/index.jsx +8 -0
  167. package/app/components/shared/ui/useStyles/index.jsx +8 -0
  168. package/app/components/shared/ui/useTheme/index.jsx +8 -0
  169. package/app/components/shared/ui/useToast/index.jsx +8 -0
  170. package/app/components/shared/util/SkipNavContent/index.jsx +8 -0
  171. package/app/components/shared/util/SkipNavLink/index.jsx +8 -0
  172. package/app/components/shared/util/index.jsx +9 -0
  173. package/app/components/social-icons/index.jsx +1 -1
  174. package/app/components/swatch-group/index.jsx +6 -1
  175. package/app/components/swatch-group/index.test.js +1 -1
  176. package/app/components/swatch-group/swatch.jsx +6 -1
  177. package/app/components/toggle-card/index.jsx +7 -1
  178. package/app/components/with-registration/index.test.js +1 -1
  179. package/app/hooks/use-add-to-cart-modal.js +1 -1
  180. package/app/hooks/use-auth-modal.js +1 -1
  181. package/app/hooks/use-current-basket.js +3 -6
  182. package/app/hooks/use-toast.js +1 -1
  183. package/app/hooks/use-toast.test.js +1 -1
  184. package/app/page-designer/README.md +2 -2
  185. package/app/page-designer/assets/image-tile/index.jsx +1 -1
  186. package/app/page-designer/assets/image-with-text/index.jsx +6 -1
  187. package/app/page-designer/layouts/carousel/index.jsx +1 -1
  188. package/app/page-designer/layouts/mobileGrid1r1c/index.jsx +1 -1
  189. package/app/page-designer/layouts/mobileGrid2r1c/index.jsx +1 -1
  190. package/app/page-designer/layouts/mobileGrid2r2c/index.jsx +1 -1
  191. package/app/page-designer/layouts/mobileGrid2r3c/index.jsx +1 -1
  192. package/app/page-designer/layouts/mobileGrid3r1c/index.jsx +1 -1
  193. package/app/page-designer/layouts/mobileGrid3r2c/index.jsx +1 -1
  194. package/app/pages/account/addresses.jsx +1 -1
  195. package/app/pages/account/index.jsx +1 -1
  196. package/app/pages/account/order-detail.jsx +1 -1
  197. package/app/pages/account/order-history.jsx +1 -1
  198. package/app/pages/account/profile.jsx +1 -1
  199. package/app/pages/account/wishlist/index.jsx +1 -1
  200. package/app/pages/account/wishlist/partials/wishlist-primary-action.jsx +1 -1
  201. package/app/pages/account/wishlist/partials/wishlist-secondary-button-group.jsx +5 -1
  202. package/app/pages/cart/index.jsx +9 -1
  203. package/app/pages/cart/partials/cart-cta.jsx +1 -1
  204. package/app/pages/cart/partials/cart-secondary-button-group.jsx +1 -1
  205. package/app/pages/cart/partials/cart-skeleton.jsx +1 -1
  206. package/app/pages/cart/partials/cart-title.jsx +1 -1
  207. package/app/pages/cart/partials/empty-cart.jsx +7 -1
  208. package/app/pages/checkout/confirmation.jsx +1 -1
  209. package/app/pages/checkout/index.jsx +10 -1
  210. package/app/pages/checkout/index.test.js +10 -0
  211. package/app/pages/checkout/partials/cc-radio-group.jsx +9 -1
  212. package/app/pages/checkout/partials/checkout-footer.jsx +1 -1
  213. package/app/pages/checkout/partials/checkout-header.jsx +7 -1
  214. package/app/pages/checkout/partials/checkout-skeleton.jsx +8 -1
  215. package/app/pages/checkout/partials/contact-info.jsx +8 -2
  216. package/app/pages/checkout/partials/payment-form.jsx +9 -1
  217. package/app/pages/checkout/partials/payment.jsx +10 -1
  218. package/app/pages/checkout/partials/shipping-address-selection.jsx +8 -1
  219. package/app/pages/checkout/partials/shipping-options.jsx +10 -1
  220. package/app/pages/home/index.jsx +1 -1
  221. package/app/pages/login/index.jsx +1 -1
  222. package/app/pages/page-not-found/index.jsx +8 -1
  223. package/app/pages/product-detail/index.jsx +8 -1
  224. package/app/pages/product-detail/index.mock.js +14 -0
  225. package/app/pages/product-detail/index.test.js +69 -6
  226. package/app/pages/product-detail/partials/information-accordion.jsx +1 -1
  227. package/app/pages/product-list/index.jsx +1 -1
  228. package/app/pages/product-list/partials/checkbox-refinements.jsx +1 -1
  229. package/app/pages/product-list/partials/color-refinements.jsx +9 -1
  230. package/app/pages/product-list/partials/empty-results.jsx +7 -1
  231. package/app/pages/product-list/partials/link-refinements.jsx +1 -1
  232. package/app/pages/product-list/partials/page-header.jsx +1 -1
  233. package/app/pages/product-list/partials/radio-refinements.jsx +7 -1
  234. package/app/pages/product-list/partials/refinements.jsx +1 -1
  235. package/app/pages/product-list/partials/selected-refinements.jsx +1 -1
  236. package/app/pages/product-list/partials/size-refinements.jsx +6 -1
  237. package/app/pages/registration/index.jsx +1 -1
  238. package/app/pages/reset-password/index.jsx +7 -1
  239. package/app/routes.jsx +1 -1
  240. package/app/ssr.js +9 -8
  241. package/app/theme/components/project/_app.js +1 -1
  242. package/app/theme/index.js +1 -1
  243. package/app/utils/responsive-image.js +1 -1
  244. package/app/utils/test-utils.js +1 -1
  245. package/config/default.js +1 -1
  246. package/config/mocks/default.js +1 -1
  247. package/jest-setup.js +3 -2
  248. package/jsconfig.json +1 -1
  249. package/package.json +6 -6
@@ -0,0 +1,8 @@
1
+ /*
2
+ * Copyright (c) 2023, salesforce.com, inc.
3
+ * All rights reserved.
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
+ */
7
+
8
+ export {useBreakpoint} from '@chakra-ui/react'
@@ -0,0 +1,8 @@
1
+ /*
2
+ * Copyright (c) 2023, salesforce.com, inc.
3
+ * All rights reserved.
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
+ */
7
+
8
+ export {useBreakpointValue} from '@chakra-ui/react'
@@ -0,0 +1,8 @@
1
+ /*
2
+ * Copyright (c) 2023, salesforce.com, inc.
3
+ * All rights reserved.
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
+ */
7
+
8
+ export {useDisclosure} from '@chakra-ui/react'
@@ -0,0 +1,8 @@
1
+ /*
2
+ * Copyright (c) 2023, salesforce.com, inc.
3
+ * All rights reserved.
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
+ */
7
+
8
+ export {useMediaQuery} from '@chakra-ui/react'
@@ -0,0 +1,8 @@
1
+ /*
2
+ * Copyright (c) 2023, salesforce.com, inc.
3
+ * All rights reserved.
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
+ */
7
+
8
+ export {useMultiStyleConfig} from '@chakra-ui/react'
@@ -0,0 +1,8 @@
1
+ /*
2
+ * Copyright (c) 2023, salesforce.com, inc.
3
+ * All rights reserved.
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
+ */
7
+
8
+ export {useNumberInput} from '@chakra-ui/react'
@@ -0,0 +1,8 @@
1
+ /*
2
+ * Copyright (c) 2023, salesforce.com, inc.
3
+ * All rights reserved.
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
+ */
7
+
8
+ export {useRadio} from '@chakra-ui/react'
@@ -0,0 +1,8 @@
1
+ /*
2
+ * Copyright (c) 2023, salesforce.com, inc.
3
+ * All rights reserved.
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
+ */
7
+
8
+ export {useRadioGroup} from '@chakra-ui/react'
@@ -0,0 +1,8 @@
1
+ /*
2
+ * Copyright (c) 2023, salesforce.com, inc.
3
+ * All rights reserved.
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
+ */
7
+
8
+ export {useStyleConfig} from '@chakra-ui/react'
@@ -0,0 +1,8 @@
1
+ /*
2
+ * Copyright (c) 2023, salesforce.com, inc.
3
+ * All rights reserved.
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
+ */
7
+
8
+ export {useStyles} from '@chakra-ui/react'
@@ -0,0 +1,8 @@
1
+ /*
2
+ * Copyright (c) 2023, salesforce.com, inc.
3
+ * All rights reserved.
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
+ */
7
+
8
+ export {useTheme} from '@chakra-ui/react'
@@ -0,0 +1,8 @@
1
+ /*
2
+ * Copyright (c) 2023, salesforce.com, inc.
3
+ * All rights reserved.
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
+ */
7
+
8
+ export {useToast} from '@chakra-ui/react'
@@ -0,0 +1,8 @@
1
+ /*
2
+ * Copyright (c) 2023, Salesforce, Inc.
3
+ * All rights reserved.
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
+ */
7
+
8
+ export {SkipNavContent} from '@chakra-ui/react'
@@ -0,0 +1,8 @@
1
+ /*
2
+ * Copyright (c) 2023, Salesforce, Inc.
3
+ * All rights reserved.
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
+ */
7
+
8
+ export {SkipNavLink} from '@chakra-ui/react'
@@ -0,0 +1,9 @@
1
+ /*
2
+ * Copyright (c) 2023, salesforce.com, inc.
3
+ * All rights reserved.
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
+ */
7
+
8
+ export {SkipNavContent} from './SkipNavContent'
9
+ export {SkipNavLink} from './SkipNavLink/'
@@ -15,7 +15,7 @@ import {
15
15
 
16
16
  // Hooks
17
17
  useMultiStyleConfig
18
- } from '@chakra-ui/react'
18
+ } from '@salesforce/retail-react-app/app/components/shared/ui'
19
19
 
20
20
  // Icons
21
21
  import {
@@ -7,7 +7,12 @@
7
7
 
8
8
  import React from 'react'
9
9
  import PropTypes from 'prop-types'
10
- import {Flex, Box, HStack, useStyleConfig} from '@chakra-ui/react'
10
+ import {
11
+ Flex,
12
+ Box,
13
+ HStack,
14
+ useStyleConfig
15
+ } from '@salesforce/retail-react-app/app/components/shared/ui'
11
16
  import {noop} from '@salesforce/retail-react-app/app/utils/utils'
12
17
 
13
18
  /**
@@ -8,7 +8,7 @@ import React from 'react'
8
8
  import {screen, render, fireEvent, waitFor} from '@testing-library/react'
9
9
  import {Router, useHistory, useLocation} from 'react-router-dom'
10
10
  import SwatchGroup from '@salesforce/retail-react-app/app/components/swatch-group/index'
11
- import {Box} from '@chakra-ui/react'
11
+ import {Box} from '@salesforce/retail-react-app/app/components/shared/ui'
12
12
  import Swatch from '@salesforce/retail-react-app/app/components/swatch-group/swatch'
13
13
  import {createMemoryHistory} from 'history'
14
14
 
@@ -7,7 +7,12 @@
7
7
 
8
8
  import React from 'react'
9
9
  import PropTypes from 'prop-types'
10
- import {Button, Box, Center, useMultiStyleConfig} from '@chakra-ui/react'
10
+ import {
11
+ Button,
12
+ Box,
13
+ Center,
14
+ useMultiStyleConfig
15
+ } from '@salesforce/retail-react-app/app/components/shared/ui'
11
16
  import {Link as RouteLink} from 'react-router-dom'
12
17
 
13
18
  /**
@@ -7,7 +7,13 @@
7
7
  import React, {useContext, createContext} from 'react'
8
8
  import PropTypes from 'prop-types'
9
9
  import {FormattedMessage} from 'react-intl'
10
- import {Box, Button, Flex, Heading, Stack} from '@chakra-ui/react'
10
+ import {
11
+ Box,
12
+ Button,
13
+ Flex,
14
+ Heading,
15
+ Stack
16
+ } from '@salesforce/retail-react-app/app/components/shared/ui'
11
17
  import LoadingSpinner from '@salesforce/retail-react-app/app/components/loading-spinner'
12
18
 
13
19
  const ToggleCardContext = createContext()
@@ -5,7 +5,7 @@
5
5
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
6
  */
7
7
  import React from 'react'
8
- import {Button} from '@chakra-ui/react'
8
+ import {Button} from '@salesforce/retail-react-app/app/components/shared/ui'
9
9
  import {screen, waitFor} from '@testing-library/react'
10
10
  import withRegistration from '@salesforce/retail-react-app/app/components/with-registration/index'
11
11
  import {renderWithProviders} from '@salesforce/retail-react-app/app/utils/test-utils'
@@ -23,7 +23,7 @@ import {
23
23
  ModalOverlay,
24
24
  Stack,
25
25
  useBreakpointValue
26
- } from '@chakra-ui/react'
26
+ } from '@salesforce/retail-react-app/app/components/shared/ui'
27
27
  import {useCurrentBasket} from '@salesforce/retail-react-app/app/hooks/use-current-basket'
28
28
  import Link from '@salesforce/retail-react-app/app/components/link'
29
29
  import RecommendedProducts from '@salesforce/retail-react-app/app/components/recommended-products'
@@ -19,7 +19,7 @@ import {
19
19
  Text,
20
20
  useDisclosure,
21
21
  useToast
22
- } from '@chakra-ui/react'
22
+ } from '@salesforce/retail-react-app/app/components/shared/ui'
23
23
  import {
24
24
  AuthHelpers,
25
25
  useAuthHelper,
@@ -4,8 +4,7 @@
4
4
  * SPDX-License-Identifier: BSD-3-Clause
5
5
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
6
  */
7
- import {useCustomerBaskets} from '@salesforce/commerce-sdk-react'
8
- import {useCurrentCustomer} from '@salesforce/retail-react-app/app/hooks/use-current-customer'
7
+ import {useCustomerId, useCustomerBaskets} from '@salesforce/commerce-sdk-react'
9
8
  import {isServer} from '@salesforce/retail-react-app/app/utils/utils'
10
9
 
11
10
  /**
@@ -14,8 +13,7 @@ import {isServer} from '@salesforce/retail-react-app/app/utils/utils'
14
13
  * @param shouldFetchProductDetail - boolean to indicate if the baskets should fetch product details based on basket items
15
14
  */
16
15
  export const useCurrentBasket = ({id = ''} = {}) => {
17
- const {data: customer} = useCurrentCustomer()
18
- const {customerId} = customer
16
+ const customerId = useCustomerId()
19
17
  const {data: basketsData, ...restOfQuery} = useCustomerBaskets(
20
18
  {parameters: {customerId}},
21
19
  {
@@ -23,9 +21,8 @@ export const useCurrentBasket = ({id = ''} = {}) => {
23
21
  }
24
22
  )
25
23
 
26
- // if id is not defined, by default use the first basket in the list
27
24
  const currentBasket =
28
- basketsData?.baskets?.find((basket) => basket.basketId === id) || basketsData?.baskets?.[0]
25
+ basketsData?.baskets?.find((basket) => basket?.basketId === id) || basketsData?.baskets?.[0]
29
26
 
30
27
  return {
31
28
  ...restOfQuery,
@@ -12,7 +12,7 @@ import {
12
12
  CloseButton,
13
13
  Spacer,
14
14
  useToast as useChakraToast
15
- } from '@chakra-ui/react'
15
+ } from '@salesforce/retail-react-app/app/components/shared/ui'
16
16
 
17
17
  /**
18
18
  * Display a toast message on the screen.
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import React from 'react'
8
8
  import {useToast} from '@salesforce/retail-react-app/app/hooks/use-toast'
9
- import {Button} from '@chakra-ui/react'
9
+ import {Button} from '@salesforce/retail-react-app/app/components/shared/ui'
10
10
  import {renderWithProviders} from '@salesforce/retail-react-app/app/utils/test-utils'
11
11
  import {screen, waitFor} from '@testing-library/react'
12
12
  import userEvent from '@testing-library/user-event'
@@ -34,7 +34,7 @@ Create a new file called `app/pages/page-viewer/index.jsx`, and add the followin
34
34
 
35
35
  import React from 'react'
36
36
  import {useParams} from 'react-router-dom'
37
- import {Box} from '@chakra-ui/react'
37
+ import {Box} from '@salesforce/retail-react-app/app/components/shared/ui'
38
38
  import {usePage} from '@salesforce/commerce-sdk-react'
39
39
  import {Page} from '@salesforce/commerce-sdk-react/components'
40
40
  import {ImageTile, ImageWithText} from '../../page-designer/assets'
@@ -64,7 +64,7 @@ const PAGEDESIGNER_TO_COMPONENT = {
64
64
 
65
65
  const PageViewer = () => {
66
66
  const {pageId} = useParams()
67
- const {data: page, error}= usePage({parameters: {pageId}})
67
+ const {data: page, error} = usePage({parameters: {pageId}})
68
68
 
69
69
  if (error) {
70
70
  let ErrorClass = error.response?.status === 404 ? HTTPNotFound : HTTPError
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import React from 'react'
8
8
  import PropTypes from 'prop-types'
9
- import {Box, Image} from '@chakra-ui/react'
9
+ import {Box, Image} from '@salesforce/retail-react-app/app/components/shared/ui'
10
10
 
11
11
  /**
12
12
  * Simple ImageTile component that can be used inside any Layout component.
@@ -6,7 +6,12 @@
6
6
  */
7
7
  import React from 'react'
8
8
  import PropTypes from 'prop-types'
9
- import {Box, Image, Link as ChakraLink, Text} from '@chakra-ui/react'
9
+ import {
10
+ Box,
11
+ Image,
12
+ Link as ChakraLink,
13
+ Text
14
+ } from '@salesforce/retail-react-app/app/components/shared/ui'
10
15
  import Link from '@salesforce/retail-react-app/app/components/link'
11
16
  import {isAbsoluteURL} from '@salesforce/retail-react-app/app/page-designer/utils'
12
17
 
@@ -14,7 +14,7 @@ import {
14
14
  Stack,
15
15
  useBreakpoint,
16
16
  useBreakpointValue
17
- } from '@chakra-ui/react'
17
+ } from '@salesforce/retail-react-app/app/components/shared/ui'
18
18
  import {Component, regionPropType} from '@salesforce/commerce-sdk-react/components'
19
19
  import {ChevronLeftIcon, ChevronRightIcon} from '@salesforce/retail-react-app/app/components/icons'
20
20
  import {useEffect} from 'react'
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import React from 'react'
8
8
  import PropTypes from 'prop-types'
9
- import {SimpleGrid} from '@chakra-ui/react'
9
+ import {SimpleGrid} from '@salesforce/retail-react-app/app/components/shared/ui'
10
10
  import {Region, regionPropType} from '@salesforce/commerce-sdk-react/components'
11
11
 
12
12
  /**
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import React from 'react'
8
8
  import PropTypes from 'prop-types'
9
- import {SimpleGrid} from '@chakra-ui/react'
9
+ import {SimpleGrid} from '@salesforce/retail-react-app/app/components/shared/ui'
10
10
  import {Region, regionPropType} from '@salesforce/commerce-sdk-react/components'
11
11
 
12
12
  /**
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import React from 'react'
8
8
  import PropTypes from 'prop-types'
9
- import {SimpleGrid} from '@chakra-ui/react'
9
+ import {SimpleGrid} from '@salesforce/retail-react-app/app/components/shared/ui'
10
10
  import {Region, regionPropType} from '@salesforce/commerce-sdk-react/components'
11
11
 
12
12
  /**
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import React from 'react'
8
8
  import PropTypes from 'prop-types'
9
- import {SimpleGrid} from '@chakra-ui/react'
9
+ import {SimpleGrid} from '@salesforce/retail-react-app/app/components/shared/ui'
10
10
  import {Region, regionPropType} from '@salesforce/commerce-sdk-react/components'
11
11
 
12
12
  /**
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import React from 'react'
8
8
  import PropTypes from 'prop-types'
9
- import {SimpleGrid} from '@chakra-ui/react'
9
+ import {SimpleGrid} from '@salesforce/retail-react-app/app/components/shared/ui'
10
10
  import {Region, regionPropType} from '@salesforce/commerce-sdk-react/components'
11
11
 
12
12
  /**
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import React from 'react'
8
8
  import PropTypes from 'prop-types'
9
- import {SimpleGrid} from '@chakra-ui/react'
9
+ import {SimpleGrid} from '@salesforce/retail-react-app/app/components/shared/ui'
10
10
  import {Region, regionPropType} from '@salesforce/commerce-sdk-react/components'
11
11
 
12
12
  /**
@@ -21,7 +21,7 @@ import {
21
21
  Skeleton,
22
22
  Stack,
23
23
  Text
24
- } from '@chakra-ui/react'
24
+ } from '@salesforce/retail-react-app/app/components/shared/ui'
25
25
  import FormActionButtons from '@salesforce/retail-react-app/app/components/forms/form-action-buttons'
26
26
  import {useForm} from 'react-hook-form'
27
27
  import {useToast} from '@salesforce/retail-react-app/app/hooks/use-toast'
@@ -22,7 +22,7 @@ import {
22
22
  Stack,
23
23
  Text,
24
24
  Divider
25
- } from '@chakra-ui/react'
25
+ } from '@salesforce/retail-react-app/app/components/shared/ui'
26
26
  import Seo from '@salesforce/retail-react-app/app/components/seo'
27
27
  import Link from '@salesforce/retail-react-app/app/components/link'
28
28
  import {
@@ -20,7 +20,7 @@ import {
20
20
  Grid,
21
21
  SimpleGrid,
22
22
  Skeleton
23
- } from '@chakra-ui/react'
23
+ } from '@salesforce/retail-react-app/app/components/shared/ui'
24
24
  import {getCreditCardIcon} from '@salesforce/retail-react-app/app/utils/cc-utils'
25
25
  import {useOrder, useProducts} from '@salesforce/commerce-sdk-react'
26
26
  import Link from '@salesforce/retail-react-app/app/components/link'
@@ -21,7 +21,7 @@ import {
21
21
  AspectRatio,
22
22
  Img,
23
23
  Skeleton
24
- } from '@chakra-ui/react'
24
+ } from '@salesforce/retail-react-app/app/components/shared/ui'
25
25
  import {useCurrentCustomer} from '@salesforce/retail-react-app/app/hooks/use-current-customer'
26
26
  import {useCustomerOrders, useProducts} from '@salesforce/commerce-sdk-react'
27
27
  import useNavigation from '@salesforce/retail-react-app/app/hooks/use-navigation'
@@ -17,7 +17,7 @@ import {
17
17
  Stack,
18
18
  Text,
19
19
  useToast
20
- } from '@chakra-ui/react'
20
+ } from '@salesforce/retail-react-app/app/components/shared/ui'
21
21
  import {useForm} from 'react-hook-form'
22
22
  import {AlertIcon} from '@salesforce/retail-react-app/app/components/icons'
23
23
  import {
@@ -7,7 +7,7 @@
7
7
  import React, {useState} from 'react'
8
8
  import {Stack, Heading} from '@chakra-ui/layout'
9
9
  import {FormattedMessage, useIntl} from 'react-intl'
10
- import {Box, Flex, Skeleton} from '@chakra-ui/react'
10
+ import {Box, Flex, Skeleton} from '@salesforce/retail-react-app/app/components/shared/ui'
11
11
  import {useProducts, useShopperCustomersMutation} from '@salesforce/commerce-sdk-react'
12
12
 
13
13
  import useNavigation from '@salesforce/retail-react-app/app/hooks/use-navigation'
@@ -5,7 +5,7 @@
5
5
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
6
  */
7
7
  import React, {useState} from 'react'
8
- import {Button, useDisclosure} from '@chakra-ui/react'
8
+ import {Button, useDisclosure} from '@salesforce/retail-react-app/app/components/shared/ui'
9
9
  import {useShopperBasketsMutation} from '@salesforce/commerce-sdk-react'
10
10
  import {FormattedMessage, useIntl} from 'react-intl'
11
11
  import {useItemVariant} from '@salesforce/retail-react-app/app/components/item-variant'
@@ -6,7 +6,11 @@
6
6
  */
7
7
  import React from 'react'
8
8
  import PropTypes from 'prop-types'
9
- import {Button, ButtonGroup, useDisclosure} from '@chakra-ui/react'
9
+ import {
10
+ Button,
11
+ ButtonGroup,
12
+ useDisclosure
13
+ } from '@salesforce/retail-react-app/app/components/shared/ui'
10
14
  import {useIntl, defineMessage, FormattedMessage} from 'react-intl'
11
15
  import {useShopperCustomersMutation} from '@salesforce/commerce-sdk-react'
12
16
 
@@ -8,7 +8,15 @@ import React, {useState} from 'react'
8
8
  import {FormattedMessage, useIntl} from 'react-intl'
9
9
 
10
10
  // Chakra Components
11
- import {Box, Stack, Grid, GridItem, Container, useDisclosure, Button} from '@chakra-ui/react'
11
+ import {
12
+ Box,
13
+ Stack,
14
+ Grid,
15
+ GridItem,
16
+ Container,
17
+ useDisclosure,
18
+ Button
19
+ } from '@salesforce/retail-react-app/app/components/shared/ui'
12
20
 
13
21
  // Project Components
14
22
  import CartCta from '@salesforce/retail-react-app/app/pages/cart/partials/cart-cta'
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import React, {Fragment} from 'react'
8
8
  import {FormattedMessage} from 'react-intl'
9
- import {Flex, Button} from '@chakra-ui/react'
9
+ import {Flex, Button} from '@salesforce/retail-react-app/app/components/shared/ui'
10
10
  import {
11
11
  AmexIcon,
12
12
  DiscoverIcon,
@@ -15,7 +15,7 @@ import {
15
15
  Flex,
16
16
  Stack,
17
17
  useDisclosure
18
- } from '@chakra-ui/react'
18
+ } from '@salesforce/retail-react-app/app/components/shared/ui'
19
19
  import {defineMessage, FormattedMessage} from 'react-intl'
20
20
  import {useItemVariant} from '@salesforce/retail-react-app/app/components/item-variant'
21
21
  import ConfirmationModal from '@salesforce/retail-react-app/app/components/confirmation-modal/index'
@@ -15,7 +15,7 @@ import {
15
15
  Text,
16
16
  Heading,
17
17
  Box
18
- } from '@chakra-ui/react'
18
+ } from '@salesforce/retail-react-app/app/components/shared/ui'
19
19
  import {FormattedMessage} from 'react-intl'
20
20
 
21
21
  const CartItemSkeleton = () => {
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import React from 'react'
8
8
  import {FormattedMessage} from 'react-intl'
9
- import {Text} from '@chakra-ui/react'
9
+ import {Text} from '@salesforce/retail-react-app/app/components/shared/ui'
10
10
  import {useCurrentBasket} from '@salesforce/retail-react-app/app/hooks/use-current-basket'
11
11
 
12
12
  const CartTitle = () => {
@@ -7,7 +7,13 @@
7
7
  import React from 'react'
8
8
  import PropTypes from 'prop-types'
9
9
  import {FormattedMessage} from 'react-intl'
10
- import {Box, Button, Stack, Center, Text} from '@chakra-ui/react'
10
+ import {
11
+ Box,
12
+ Button,
13
+ Stack,
14
+ Center,
15
+ Text
16
+ } from '@salesforce/retail-react-app/app/components/shared/ui'
11
17
  import {AccountIcon, BasketIcon} from '@salesforce/retail-react-app/app/components/icons'
12
18
  import Link from '@salesforce/retail-react-app/app/components/link'
13
19
 
@@ -19,7 +19,7 @@ import {
19
19
  Alert,
20
20
  AlertIcon,
21
21
  Divider
22
- } from '@chakra-ui/react'
22
+ } from '@salesforce/retail-react-app/app/components/shared/ui'
23
23
  import {useForm} from 'react-hook-form'
24
24
  import {useParams} from 'react-router-dom'
25
25
  import {useOrder, useProducts, useAuthHelper, AuthHelpers} from '@salesforce/commerce-sdk-react'
@@ -6,7 +6,16 @@
6
6
  */
7
7
  import React, {useEffect, useState} from 'react'
8
8
  import {FormattedMessage, useIntl} from 'react-intl'
9
- import {Alert, AlertIcon, Box, Button, Container, Grid, GridItem, Stack} from '@chakra-ui/react'
9
+ import {
10
+ Alert,
11
+ AlertIcon,
12
+ Box,
13
+ Button,
14
+ Container,
15
+ Grid,
16
+ GridItem,
17
+ Stack
18
+ } from '@salesforce/retail-react-app/app/components/shared/ui'
10
19
  import useNavigation from '@salesforce/retail-react-app/app/hooks/use-navigation'
11
20
  import {
12
21
  CheckoutProvider,
@@ -299,6 +299,16 @@ test('Can proceed through checkout steps as guest', async () => {
299
299
  await user.click(screen.getByText(/2 items in cart/i))
300
300
  expect(await screen.findByText(/Long Sleeve Crew Neck/i)).toBeInTheDocument()
301
301
 
302
+ // Verify password field is reset if customer toggles login form
303
+ const loginToggleButton = screen.getByText(/Already have an account\? Log in/i)
304
+ await user.click(loginToggleButton)
305
+ // Provide customer email and submit
306
+ const passwordInput = document.querySelector('input[type="password"]')
307
+ await user.type(passwordInput, 'Password1!')
308
+
309
+ const checkoutAsGuestButton = screen.getByText(/Checkout as guest/i)
310
+ await user.click(checkoutAsGuestButton)
311
+
302
312
  // Provide customer email and submit
303
313
  const emailInput = screen.getByLabelText(/email/i)
304
314
  const submitBtn = screen.getByText(/checkout as guest/i)