@faststore/ui 2.0.2-alpha.0 → 2.0.4-alpha.0

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 (317) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/assets/ShoppingCart.d.ts +2 -2
  3. package/dist/assets/ShoppingCart.js.map +1 -1
  4. package/dist/assets/X.d.ts +2 -2
  5. package/dist/assets/X.js.map +1 -1
  6. package/package.json +30 -37
  7. package/src/assets/ShoppingCart.tsx +50 -0
  8. package/src/assets/X.tsx +38 -0
  9. package/src/base/layout.scss +78 -0
  10. package/src/base/tokens.scss +274 -0
  11. package/src/base/typography.scss +64 -0
  12. package/src/components/atoms/Badge/Badge.stories.mdx +156 -0
  13. package/src/components/atoms/Badge/styles.scss +209 -0
  14. package/src/components/atoms/Button/Button.stories.mdx +110 -0
  15. package/src/components/atoms/Button/styles.scss +316 -0
  16. package/src/components/atoms/Checkbox/styles.scss +155 -0
  17. package/src/{atoms → components/atoms}/Incentive/Incentive.tsx +0 -0
  18. package/src/{atoms → components/atoms}/Incentive/index.tsx +0 -0
  19. package/src/{atoms → components/atoms}/Incentive/stories/Incentive.mdx +0 -0
  20. package/src/{atoms → components/atoms}/Incentive/stories/Incentive.stories.tsx +0 -0
  21. package/src/{atoms → components/atoms}/Incentive/stories/assets/Icons.tsx +0 -0
  22. package/src/{atoms → components/atoms}/Input/Input.tsx +0 -0
  23. package/src/{atoms → components/atoms}/Input/index.ts +0 -0
  24. package/src/{atoms → components/atoms}/Input/stories/Input.mdx +0 -0
  25. package/src/{atoms → components/atoms}/Input/stories/Input.stories.tsx +1 -1
  26. package/src/components/atoms/Label/Label.stories.mdx +65 -0
  27. package/src/{atoms → components/atoms}/Link/Link.tsx +1 -1
  28. package/src/{atoms → components/atoms}/Link/index.tsx +0 -0
  29. package/src/{atoms → components/atoms}/Link/stories/Link.mdx +0 -0
  30. package/src/{atoms → components/atoms}/Link/stories/Link.stories.tsx +0 -0
  31. package/src/{atoms → components/atoms}/List/List.tsx +0 -0
  32. package/src/{atoms → components/atoms}/List/index.ts +0 -0
  33. package/src/{atoms → components/atoms}/List/stories/List.mdx +0 -0
  34. package/src/{atoms → components/atoms}/List/stories/List.stories.tsx +1 -1
  35. package/src/{atoms → components/atoms}/Overlay/Overlay.tsx +0 -0
  36. package/src/{atoms → components/atoms}/Overlay/index.ts +0 -0
  37. package/src/{atoms → components/atoms}/Overlay/stories/Overlay.mdx +0 -0
  38. package/src/{atoms → components/atoms}/Overlay/stories/Overlay.stories.tsx +1 -1
  39. package/src/{atoms → components/atoms}/Popover/Popover.tsx +0 -0
  40. package/src/{atoms → components/atoms}/Popover/index.ts +0 -0
  41. package/src/{atoms → components/atoms}/Popover/stories/Popover.mdx +0 -0
  42. package/src/{atoms → components/atoms}/Popover/stories/Popover.stories.tsx +1 -1
  43. package/src/{atoms → components/atoms}/Price/Price.tsx +0 -0
  44. package/src/{atoms → components/atoms}/Price/index.ts +0 -0
  45. package/src/{atoms → components/atoms}/Price/stories/Price.mdx +0 -0
  46. package/src/{atoms → components/atoms}/Price/stories/Price.stories.tsx +1 -1
  47. package/src/components/atoms/Radio/Radio.stories.mdx +101 -0
  48. package/src/components/atoms/Radio/styles.scss +108 -0
  49. package/src/{atoms → components/atoms}/Select/Select.tsx +0 -0
  50. package/src/{atoms → components/atoms}/Select/index.ts +0 -0
  51. package/src/{atoms → components/atoms}/Select/stories/Select.mdx +0 -0
  52. package/src/{atoms → components/atoms}/Select/stories/Select.stories.tsx +1 -1
  53. package/src/{atoms → components/atoms}/Skeleton/Skeleton.tsx +0 -0
  54. package/src/{atoms → components/atoms}/Skeleton/index.ts +0 -0
  55. package/src/{atoms → components/atoms}/Skeleton/stories/Skeleton.mdx +0 -0
  56. package/src/{atoms → components/atoms}/Skeleton/stories/Skeleton.stories.tsx +0 -0
  57. package/src/{atoms → components/atoms}/Slider/Slider.tsx +0 -0
  58. package/src/{atoms → components/atoms}/Slider/index.ts +0 -0
  59. package/src/{atoms → components/atoms}/Slider/stories/Slider.mdx +0 -0
  60. package/src/{atoms → components/atoms}/Slider/stories/Slider.stories.tsx +1 -1
  61. package/src/{atoms → components/atoms}/Spinner/Spinner.tsx +0 -0
  62. package/src/{atoms → components/atoms}/Spinner/index.tsx +0 -0
  63. package/src/{atoms → components/atoms}/Spinner/stories/Spinner.mdx +0 -0
  64. package/src/{atoms → components/atoms}/Spinner/stories/Spinner.stories.tsx +0 -0
  65. package/src/{atoms → components/atoms}/TextArea/TextArea.tsx +0 -0
  66. package/src/{atoms → components/atoms}/TextArea/index.ts +0 -0
  67. package/src/{atoms → components/atoms}/TextArea/stories/TextArea.mdx +0 -0
  68. package/src/{atoms → components/atoms}/TextArea/stories/TextArea.stories.tsx +1 -1
  69. package/src/{molecules → components/molecules}/Accordion/Accordion.tsx +0 -0
  70. package/src/{molecules → components/molecules}/Accordion/AccordionButton.tsx +4 -4
  71. package/src/{molecules → components/molecules}/Accordion/AccordionItem.tsx +1 -1
  72. package/src/{molecules → components/molecules}/Accordion/AccordionPanel.tsx +0 -0
  73. package/src/{molecules → components/molecules}/Accordion/index.ts +0 -0
  74. package/src/{molecules → components/molecules}/Accordion/stories/Accordion.mdx +0 -0
  75. package/src/{molecules → components/molecules}/Accordion/stories/Accordion.stories.tsx +1 -1
  76. package/src/{molecules → components/molecules}/AggregateRating/AggregateRating.tsx +0 -0
  77. package/src/{molecules → components/molecules}/AggregateRating/index.ts +0 -0
  78. package/src/{molecules → components/molecules}/AggregateRating/stories/AggregateRating.mdx +0 -0
  79. package/src/{molecules → components/molecules}/AggregateRating/stories/AggregateRating.stories.tsx +1 -1
  80. package/src/{molecules → components/molecules}/Alert/Alert.tsx +0 -0
  81. package/src/{molecules → components/molecules}/Alert/index.ts +0 -0
  82. package/src/{molecules → components/molecules}/Alert/stories/Alert.mdx +0 -0
  83. package/src/{molecules → components/molecules}/Alert/stories/Alert.stories.tsx +3 -3
  84. package/src/{molecules → components/molecules}/Banner/Banner.tsx +0 -0
  85. package/src/{molecules → components/molecules}/Banner/BannerContent.tsx +0 -0
  86. package/src/{molecules → components/molecules}/Banner/BannerImage.tsx +0 -0
  87. package/src/{molecules → components/molecules}/Banner/BannerLink.tsx +0 -0
  88. package/src/{molecules → components/molecules}/Banner/index.ts +0 -0
  89. package/src/{molecules → components/molecules}/Banner/stories/Banner.mdx +0 -0
  90. package/src/{molecules → components/molecules}/Banner/stories/Banner.stories.tsx +1 -1
  91. package/src/{molecules → components/molecules}/Breadcrumb/Breadcrumb.tsx +0 -0
  92. package/src/{molecules → components/molecules}/Breadcrumb/index.ts +0 -0
  93. package/src/{molecules → components/molecules}/Breadcrumb/stories/Breadcrumb.mdx +0 -0
  94. package/src/{molecules → components/molecules}/Breadcrumb/stories/Breadcrumb.stories.tsx +1 -1
  95. package/src/{molecules → components/molecules}/Bullets/Bullets.tsx +1 -1
  96. package/src/{molecules → components/molecules}/Bullets/index.ts +0 -0
  97. package/src/{molecules → components/molecules}/Bullets/stories/Bullets.mdx +0 -0
  98. package/src/{molecules → components/molecules}/Bullets/stories/Bullets.stories.tsx +1 -1
  99. package/src/{molecules → components/molecules}/Card/Card.tsx +0 -0
  100. package/src/{molecules → components/molecules}/Card/CardActions.tsx +0 -0
  101. package/src/{molecules → components/molecules}/Card/CardContent.tsx +0 -0
  102. package/src/{molecules → components/molecules}/Card/CardImage.tsx +0 -0
  103. package/src/{molecules → components/molecules}/Card/index.tsx +0 -0
  104. package/src/{molecules → components/molecules}/Card/stories/Card.mdx +0 -0
  105. package/src/{molecules → components/molecules}/Card/stories/Card.stories.tsx +5 -5
  106. package/src/{molecules → components/molecules}/Carousel/Arrows.tsx +0 -0
  107. package/src/{molecules → components/molecules}/Carousel/Carousel.tsx +2 -2
  108. package/src/{molecules → components/molecules}/Carousel/CarouselItem.tsx +1 -1
  109. package/src/{molecules → components/molecules}/Carousel/hooks/useSlideVisibility.ts +0 -0
  110. package/src/{molecules → components/molecules}/Carousel/index.ts +0 -0
  111. package/src/{molecules → components/molecules}/Carousel/stories/Carousel.mdx +0 -0
  112. package/src/{molecules → components/molecules}/Carousel/stories/Carousel.stories.tsx +1 -1
  113. package/src/{molecules → components/molecules}/CartItem/CartItem.tsx +0 -0
  114. package/src/{molecules → components/molecules}/CartItem/CartItemActions.tsx +0 -0
  115. package/src/{molecules → components/molecules}/CartItem/CartItemContent.tsx +0 -0
  116. package/src/{molecules → components/molecules}/CartItem/CartItemImage.tsx +0 -0
  117. package/src/{molecules → components/molecules}/CartItem/CartItemPrices.tsx +0 -0
  118. package/src/{molecules → components/molecules}/CartItem/CartItemSummary.tsx +0 -0
  119. package/src/{molecules → components/molecules}/CartItem/CartItemTitle.tsx +0 -0
  120. package/src/{molecules → components/molecules}/CartItem/index.tsx +0 -0
  121. package/src/{molecules → components/molecules}/CartItem/stories/CartItem.mdx +0 -0
  122. package/src/{molecules → components/molecules}/CartItem/stories/CartItem.stories.tsx +1 -1
  123. package/src/components/molecules/CheckboxField/CheckboxField.stories.mdx +38 -0
  124. package/src/components/molecules/CheckboxField/styles.scss +12 -0
  125. package/src/{molecules → components/molecules}/Dropdown/Dropdown.tsx +0 -0
  126. package/src/{molecules → components/molecules}/Dropdown/DropdownButton.tsx +0 -0
  127. package/src/{molecules → components/molecules}/Dropdown/DropdownItem.tsx +0 -0
  128. package/src/{molecules → components/molecules}/Dropdown/DropdownMenu.tsx +0 -0
  129. package/src/{molecules → components/molecules}/Dropdown/contexts/DropdownContext.ts +0 -0
  130. package/src/{molecules → components/molecules}/Dropdown/hooks/useDropdown.ts +0 -0
  131. package/src/{molecules → components/molecules}/Dropdown/hooks/useDropdownPosition.ts +0 -0
  132. package/src/{molecules → components/molecules}/Dropdown/index.ts +0 -0
  133. package/src/{molecules → components/molecules}/Dropdown/stories/Dropdown.mdx +0 -0
  134. package/src/{molecules → components/molecules}/Dropdown/stories/Dropdown.stories.tsx +1 -1
  135. package/src/{molecules → components/molecules}/Dropdown/stories/assets/Caret.tsx +0 -0
  136. package/src/{molecules → components/molecules}/Form/Form.tsx +0 -0
  137. package/src/{molecules → components/molecules}/Form/index.ts +0 -0
  138. package/src/{molecules → components/molecules}/Form/stories/Form.mdx +0 -0
  139. package/src/{molecules → components/molecules}/Form/stories/Form.stories.tsx +2 -1
  140. package/src/{molecules → components/molecules}/Gift/Gift.tsx +2 -3
  141. package/src/{molecules → components/molecules}/Gift/GiftContent.tsx +0 -0
  142. package/src/{molecules → components/molecules}/Gift/GiftImage.tsx +0 -0
  143. package/src/{molecules → components/molecules}/Gift/index.tsx +0 -0
  144. package/src/{molecules → components/molecules}/Gift/stories/Gift.mdx +0 -0
  145. package/src/{molecules → components/molecules}/Gift/stories/Gift.stories.tsx +1 -1
  146. package/src/components/molecules/IconButton/IconButton.stories.mdx +47 -0
  147. package/src/{molecules → components/molecules}/LoadingButton/LoadingButton.tsx +3 -8
  148. package/src/{molecules → components/molecules}/LoadingButton/index.tsx +0 -0
  149. package/src/{molecules → components/molecules}/LoadingButton/stories/LoadingButton.mdx +0 -0
  150. package/src/{molecules → components/molecules}/LoadingButton/stories/LoadingButton.stories.tsx +1 -1
  151. package/src/{molecules → components/molecules}/Modal/Modal.tsx +0 -0
  152. package/src/{molecules → components/molecules}/Modal/ModalContent.tsx +0 -0
  153. package/src/{molecules → components/molecules}/Modal/index.tsx +0 -0
  154. package/src/{molecules → components/molecules}/Modal/stories/Modal.mdx +0 -0
  155. package/src/{molecules → components/molecules}/Modal/stories/Modal.stories.tsx +1 -1
  156. package/src/{molecules → components/molecules}/Modal/useTrapFocus.ts +0 -0
  157. package/src/{molecules → components/molecules}/OrderSummary/OrderSummary.tsx +0 -0
  158. package/src/{molecules → components/molecules}/OrderSummary/index.tsx +0 -0
  159. package/src/{molecules → components/molecules}/OrderSummary/stories/OrderSummary.mdx +0 -0
  160. package/src/{molecules → components/molecules}/OrderSummary/stories/OrderSummary.stories.tsx +0 -0
  161. package/src/{molecules → components/molecules}/PaymentMethods/PaymentMethods.tsx +0 -0
  162. package/src/{molecules → components/molecules}/PaymentMethods/index.tsx +0 -0
  163. package/src/{molecules → components/molecules}/PaymentMethods/stories/PaymentMethods.mdx +0 -0
  164. package/src/{molecules → components/molecules}/PaymentMethods/stories/PaymentMethods.stories.tsx +0 -0
  165. package/src/{molecules → components/molecules}/PaymentMethods/stories/assets/Icons.tsx +0 -0
  166. package/src/{molecules → components/molecules}/PriceRange/PriceRange.tsx +0 -0
  167. package/src/{molecules → components/molecules}/PriceRange/index.ts +0 -0
  168. package/src/{molecules → components/molecules}/PriceRange/stories/PriceRange.mdx +0 -0
  169. package/src/{molecules → components/molecules}/PriceRange/stories/PriceRange.stories.tsx +1 -1
  170. package/src/{molecules → components/molecules}/ProductCard/ProductCard.tsx +0 -0
  171. package/src/{molecules → components/molecules}/ProductCard/ProductCardActions.tsx +0 -0
  172. package/src/{molecules → components/molecules}/ProductCard/ProductCardContent.tsx +0 -0
  173. package/src/{molecules → components/molecules}/ProductCard/ProductCardImage.tsx +0 -0
  174. package/src/{molecules → components/molecules}/ProductCard/index.tsx +0 -0
  175. package/src/{molecules → components/molecules}/ProductCard/stories/ProductCard.mdx +0 -0
  176. package/src/{molecules → components/molecules}/ProductCard/stories/ProductCard.stories.tsx +1 -2
  177. package/src/{molecules → components/molecules}/ProductTitle/ProductTitle.tsx +0 -0
  178. package/src/{molecules → components/molecules}/ProductTitle/index.tsx +0 -0
  179. package/src/{molecules → components/molecules}/ProductTitle/stories/ProductTitle.mdx +0 -0
  180. package/src/{molecules → components/molecules}/ProductTitle/stories/ProductTitle.stories.tsx +3 -3
  181. package/src/{molecules → components/molecules}/QuantitySelector/QuantitySelector.tsx +2 -2
  182. package/src/{molecules → components/molecules}/QuantitySelector/index.ts +0 -0
  183. package/src/{molecules → components/molecules}/QuantitySelector/stories/QuantitySelector.mdx +0 -0
  184. package/src/{molecules → components/molecules}/QuantitySelector/stories/QuantitySelector.stories.tsx +0 -0
  185. package/src/{molecules → components/molecules}/QuantitySelector/stories/assets/Icons.tsx +0 -0
  186. package/src/components/molecules/RadioField/RadioField.stories.mdx +38 -0
  187. package/src/components/molecules/RadioField/styles.scss +12 -0
  188. package/src/{molecules → components/molecules}/RadioGroup/RadioGroup.tsx +0 -0
  189. package/src/{molecules → components/molecules}/RadioGroup/RadioOption.tsx +1 -1
  190. package/src/{molecules → components/molecules}/RadioGroup/index.tsx +0 -0
  191. package/src/{molecules → components/molecules}/RadioGroup/stories/RadioGroup.mdx +0 -0
  192. package/src/{molecules → components/molecules}/RadioGroup/stories/RadioGroup.stories.tsx +0 -0
  193. package/src/{molecules → components/molecules}/RadioGroup/useRadioGroup.ts +0 -0
  194. package/src/{molecules → components/molecules}/SearchInput/SearchInput.tsx +2 -3
  195. package/src/{molecules → components/molecules}/SearchInput/index.ts +0 -0
  196. package/src/{molecules → components/molecules}/SearchInput/stories/SearchInput.mdx +0 -0
  197. package/src/{molecules → components/molecules}/SearchInput/stories/SearchInput.stories.tsx +1 -1
  198. package/src/{molecules → components/molecules}/SearchInput/stories/assets/CustomIcon.tsx +0 -0
  199. package/src/{molecules → components/molecules}/SkuSelector/SkuSelector.tsx +3 -2
  200. package/src/{molecules → components/molecules}/SkuSelector/index.tsx +0 -0
  201. package/src/{molecules → components/molecules}/SkuSelector/stories/SkuSelector.mdx +0 -0
  202. package/src/{molecules → components/molecules}/SkuSelector/stories/SkuSelector.stories.tsx +1 -1
  203. package/src/{molecules → components/molecules}/Table/Table.tsx +0 -0
  204. package/src/{molecules → components/molecules}/Table/TableBody.tsx +0 -0
  205. package/src/{molecules → components/molecules}/Table/TableCell.tsx +0 -0
  206. package/src/{molecules → components/molecules}/Table/TableFooter.tsx +0 -0
  207. package/src/{molecules → components/molecules}/Table/TableHead.tsx +0 -0
  208. package/src/{molecules → components/molecules}/Table/TableRow.tsx +0 -0
  209. package/src/{molecules → components/molecules}/Table/index.ts +0 -0
  210. package/src/{molecules → components/molecules}/Table/stories/Table.mdx +0 -0
  211. package/src/{molecules → components/molecules}/Table/stories/Table.stories.tsx +0 -0
  212. package/src/components/molecules/Tag/Tag.stories.mdx +31 -0
  213. package/src/components/molecules/Tag/styles.scss +99 -0
  214. package/src/{organisms → components/organisms}/Hero/Hero.tsx +0 -0
  215. package/src/{organisms → components/organisms}/Hero/HeroHeading.tsx +0 -0
  216. package/src/{organisms → components/organisms}/Hero/HeroImage.tsx +0 -0
  217. package/src/{organisms → components/organisms}/Hero/index.tsx +0 -0
  218. package/src/{organisms → components/organisms}/Hero/stories/Hero.mdx +0 -0
  219. package/src/{organisms → components/organisms}/Hero/stories/Hero.stories.tsx +1 -1
  220. package/src/{organisms → components/organisms}/OutOfStock/OutOfStock.tsx +0 -0
  221. package/src/{organisms → components/organisms}/OutOfStock/OutOfStockMessage.tsx +0 -0
  222. package/src/{organisms → components/organisms}/OutOfStock/OutOfStockTitle.tsx +0 -0
  223. package/src/{organisms → components/organisms}/OutOfStock/index.tsx +0 -0
  224. package/src/{organisms → components/organisms}/OutOfStock/stories/OutOfStock.mdx +0 -0
  225. package/src/{organisms → components/organisms}/OutOfStock/stories/OutOfStock.stories.tsx +1 -1
  226. package/src/{organisms → components/organisms}/Tiles/Tile.tsx +0 -0
  227. package/src/{organisms → components/organisms}/Tiles/Tiles.tsx +0 -0
  228. package/src/{organisms → components/organisms}/Tiles/index.ts +0 -0
  229. package/src/{organisms → components/organisms}/Tiles/stories/Tiles.mdx +0 -0
  230. package/src/{organisms → components/organisms}/Tiles/stories/Tiles.stories.tsx +0 -0
  231. package/src/index.ts +97 -99
  232. package/src/styles/base.scss +3 -0
  233. package/src/styles/components.scss +10 -0
  234. package/src/styles/global.scss +4 -0
  235. package/src/styles/reset.scss +54 -0
  236. package/src/styles/utilities.scss +75 -0
  237. package/src/typings/utils.d.ts +2 -2
  238. package/dist/assets/index.d.ts +0 -2
  239. package/dist/assets/index.js +0 -3
  240. package/dist/assets/index.js.map +0 -1
  241. package/src/atoms/Badge/Badge.test.tsx +0 -23
  242. package/src/atoms/Badge/Badge.tsx +0 -23
  243. package/src/atoms/Badge/index.ts +0 -2
  244. package/src/atoms/Badge/stories/Badge.mdx +0 -18
  245. package/src/atoms/Badge/stories/Badge.stories.tsx +0 -37
  246. package/src/atoms/Button/Button.test.tsx +0 -12
  247. package/src/atoms/Button/Button.tsx +0 -23
  248. package/src/atoms/Button/index.ts +0 -2
  249. package/src/atoms/Button/stories/Button.mdx +0 -18
  250. package/src/atoms/Button/stories/Button.stories.tsx +0 -36
  251. package/src/atoms/Checkbox/Checkbox.test.tsx +0 -65
  252. package/src/atoms/Checkbox/Checkbox.tsx +0 -27
  253. package/src/atoms/Checkbox/index.ts +0 -2
  254. package/src/atoms/Checkbox/stories/Checkbox.mdx +0 -18
  255. package/src/atoms/Checkbox/stories/Checkbox.stories.tsx +0 -65
  256. package/src/atoms/Icon/Icon.test.tsx +0 -43
  257. package/src/atoms/Icon/Icon.tsx +0 -26
  258. package/src/atoms/Icon/index.ts +0 -2
  259. package/src/atoms/Icon/stories/Icon.mdx +0 -18
  260. package/src/atoms/Icon/stories/Icon.stories.tsx +0 -40
  261. package/src/atoms/Icon/stories/assets/ShoppingCart.tsx +0 -23
  262. package/src/atoms/Incentive/Incentive.test.tsx +0 -36
  263. package/src/atoms/Input/Input.test.tsx +0 -73
  264. package/src/atoms/Label/Label.test.tsx +0 -71
  265. package/src/atoms/Label/Label.tsx +0 -22
  266. package/src/atoms/Label/index.ts +0 -2
  267. package/src/atoms/Label/stories/Label.mdx +0 -18
  268. package/src/atoms/Label/stories/Label.stories.tsx +0 -30
  269. package/src/atoms/Link/Link.test.tsx +0 -53
  270. package/src/atoms/List/List.test.tsx +0 -195
  271. package/src/atoms/Overlay/Overlay.test.tsx +0 -23
  272. package/src/atoms/Popover/Popover.test.tsx +0 -39
  273. package/src/atoms/Price/Price.test.tsx +0 -63
  274. package/src/atoms/Radio/Radio.test.tsx +0 -59
  275. package/src/atoms/Radio/Radio.tsx +0 -24
  276. package/src/atoms/Radio/index.ts +0 -2
  277. package/src/atoms/Radio/stories/Radio.mdx +0 -18
  278. package/src/atoms/Radio/stories/Radio.stories.tsx +0 -41
  279. package/src/atoms/Select/Select.test.tsx +0 -71
  280. package/src/atoms/Skeleton/Skeleton.test.tsx +0 -13
  281. package/src/atoms/Slider/Slider.test.tsx +0 -32
  282. package/src/atoms/Spinner/Spinner.test.tsx +0 -12
  283. package/src/atoms/TextArea/TextArea.test.tsx +0 -77
  284. package/src/hooks/useSlider/useSlider.test.ts +0 -176
  285. package/src/molecules/Accordion/Accordion.test.tsx +0 -226
  286. package/src/molecules/AggregateRating/AggregateRating.test.tsx +0 -87
  287. package/src/molecules/Alert/Alert.test.tsx +0 -23
  288. package/src/molecules/Banner/Banner.test.tsx +0 -67
  289. package/src/molecules/Breadcrumb/Breadcrumb.test.tsx +0 -124
  290. package/src/molecules/Bullets/Bullets.test.tsx +0 -128
  291. package/src/molecules/Card/Card.test.tsx +0 -68
  292. package/src/molecules/Carousel/Carousel.test.tsx +0 -587
  293. package/src/molecules/Carousel/hooks/hooks.test.ts +0 -109
  294. package/src/molecules/CartItem/CartItem.test.tsx +0 -79
  295. package/src/molecules/Dropdown/Dropdown.test.tsx +0 -275
  296. package/src/molecules/Form/Form.test.tsx +0 -61
  297. package/src/molecules/Gift/Gift.test.tsx +0 -53
  298. package/src/molecules/IconButton/IconButton.test.tsx +0 -31
  299. package/src/molecules/IconButton/IconButton.tsx +0 -35
  300. package/src/molecules/IconButton/index.tsx +0 -2
  301. package/src/molecules/IconButton/stories/IconButton.mdx +0 -27
  302. package/src/molecules/IconButton/stories/IconButton.stories.tsx +0 -35
  303. package/src/molecules/LoadingButton/LoadingButton.test.tsx +0 -14
  304. package/src/molecules/Modal/Modal.test.tsx +0 -241
  305. package/src/molecules/OrderSummary/OrderSummary.test.tsx +0 -103
  306. package/src/molecules/PaymentMethods/PaymentMethods.test.tsx +0 -37
  307. package/src/molecules/PriceRange/PriceRange.test.tsx +0 -70
  308. package/src/molecules/ProductCard/ProductCard.test.tsx +0 -75
  309. package/src/molecules/QuantitySelector/QuantitySelector.test.tsx +0 -93
  310. package/src/molecules/RadioGroup/RadioGroup.test.tsx +0 -107
  311. package/src/molecules/SearchInput/SearchInput.test.tsx +0 -34
  312. package/src/molecules/SkuSelector/SkuSelector.test.tsx +0 -42
  313. package/src/molecules/Table/Table.test.tsx +0 -233
  314. package/src/organisms/Hero/Hero.test.tsx +0 -60
  315. package/src/organisms/OutOfStock/OutOfStock.test.tsx +0 -122
  316. package/src/setupTests.ts +0 -7
  317. package/src/utils/toHaveNoIncomplete.ts +0 -76
@@ -1,241 +0,0 @@
1
- import type { ReactNode } from 'react'
2
- import React, { useState } from 'react'
3
- import { fireEvent, render } from '@testing-library/react'
4
- import { axe } from 'jest-axe'
5
-
6
- import Modal from './Modal'
7
- import Button from '../../atoms/Button'
8
- import Input from '../../atoms/Input'
9
-
10
- const modalTestId = 'store-modal'
11
-
12
- const TestModal = ({
13
- children,
14
- onDismiss: mockOnDismiss,
15
- }: {
16
- children?: ReactNode
17
- onDismiss?: () => void
18
- }) => {
19
- const [isOpen, setIsOpen] = useState(false)
20
- const handleOpen = () => {
21
- setIsOpen(true)
22
- }
23
-
24
- const onDismiss = () => {
25
- setIsOpen(false)
26
- mockOnDismiss?.()
27
- }
28
-
29
- return (
30
- <>
31
- <Button testId="trigger" onClick={handleOpen}>
32
- OpenModal
33
- </Button>
34
- <Modal isOpen={isOpen} testId={modalTestId} onDismiss={onDismiss}>
35
- <Input testId="first-input" />
36
- <Button testId="first-button" />
37
- {children}
38
- </Modal>
39
- </>
40
- )
41
- }
42
-
43
- describe('Modal', () => {
44
- it('The attribute data-fs-modal-content should be present', () => {
45
- const { getByTestId } = render(
46
- <Modal aria-label="test modal" testId="store-modal" isOpen>
47
- Foo
48
- </Modal>
49
- )
50
-
51
- expect(getByTestId('store-modal')).toHaveAttribute(
52
- 'data-fs-modal-content'
53
- )
54
- })
55
-
56
- it('Modal should only be rendered if isOpen is true', () => {
57
- // Check that modal won't be rendered
58
- const { getByTestId } = render(<TestModal />)
59
-
60
- expect(document.querySelector(`[data-testid="${modalTestId}"]`)).toBeNull()
61
-
62
- fireEvent.click(getByTestId('trigger'))
63
-
64
- expect(getByTestId('store-modal')).toBeInTheDocument()
65
- })
66
- })
67
-
68
- describe('Modal WAI-ARIA Specifications', () => {
69
- // WAI-ARIA tests
70
- // https://www.w3.org/TR/wai-aria-practices-1.1/#dialog_modal
71
- it('AXE Test', async () => {
72
- render(
73
- <Modal aria-label="test modal" testId="store-modal" isOpen>
74
- Foo
75
- </Modal>
76
- )
77
-
78
- expect(await axe(document.body)).toHaveNoViolations()
79
- // This is disabled because the useTrapFocus use sentinel div elements
80
- // with tabindex and aria-hidden true. This is intentionally, because
81
- // these divs shouldn't be considered to accessibility API.
82
- expect(
83
- await axe(document.body, {
84
- rules: { 'aria-hidden-focus': { enabled: false } },
85
- })
86
- ).toHaveNoIncompletes()
87
- })
88
-
89
- it('Focus first element', () => {
90
- const { getByTestId } = render(<TestModal />)
91
-
92
- // Open the modal
93
- fireEvent.click(getByTestId('trigger'))
94
-
95
- // Check if the first tabbable is focused
96
- expect(getByTestId('first-input')).toHaveFocus()
97
- })
98
-
99
- it('Loop focus', () => {
100
- const { getByTestId } = render(<TestModal />)
101
-
102
- // Open the modal
103
- fireEvent.click(getByTestId('trigger'))
104
-
105
- expect(getByTestId('first-input')).toHaveFocus()
106
-
107
- // Simulate loop back: from first to last element
108
- fireEvent.keyDown(document.activeElement!, {
109
- key: 'Tab',
110
- shiftKey: true,
111
- })
112
-
113
- fireEvent.focus(getByTestId('beforeElement'))
114
- expect(getByTestId('first-button')).toHaveFocus()
115
-
116
- // Simulate loop back: from last to first element
117
- fireEvent.keyDown(document.activeElement!, {
118
- key: 'Tab',
119
- })
120
-
121
- fireEvent.focus(getByTestId('afterElement'))
122
- expect(getByTestId('first-input')).toHaveFocus()
123
- })
124
-
125
- it('Loop focus inside the child modal', () => {
126
- const { getByTestId, getAllByTestId } = render(
127
- <TestModal>
128
- <TestModal />
129
- </TestModal>
130
- )
131
-
132
- // Open the first modal
133
- fireEvent.click(getByTestId('trigger'))
134
-
135
- const [, secondTrigger] = getAllByTestId('trigger')
136
-
137
- // Open the internal modal
138
- fireEvent.click(secondTrigger)
139
-
140
- // Check if the first input of the internal modal is focused
141
- expect(secondTrigger).not.toHaveFocus()
142
- expect(getAllByTestId('first-input')[1]).toHaveFocus()
143
-
144
- // Simulate loop back: from first to last element of the internal modal
145
- fireEvent.keyDown(document.activeElement!, {
146
- key: 'Tab',
147
- shiftKey: true,
148
- })
149
-
150
- fireEvent.focus(getAllByTestId('beforeElement')[1])
151
- const [firstButton, secondButton] = getAllByTestId('first-button')
152
-
153
- expect(secondButton).toHaveFocus()
154
- expect(firstButton).not.toHaveFocus()
155
- })
156
-
157
- it('Focus last element before the modal was opened', () => {
158
- const { getByTestId } = render(<TestModal />)
159
- const triggerModalButton = getByTestId('trigger')
160
-
161
- // Focus the trigger button that's outside the modal
162
- triggerModalButton.focus()
163
- expect(triggerModalButton).toHaveFocus()
164
-
165
- fireEvent.click(triggerModalButton)
166
-
167
- // Modal focused something inside, so make sure that's not focused
168
- expect(triggerModalButton).not.toHaveFocus()
169
-
170
- // Close the modal
171
- fireEvent.click(getByTestId('store-overlay'))
172
-
173
- // Make sure that modal focused back the trigger button after close.
174
- expect(triggerModalButton).toHaveFocus()
175
- })
176
-
177
- it('Call onDismiss when press escape without tabbable children', () => {
178
- const mockDismiss = jest.fn()
179
- const { getByTestId } = render(
180
- <Modal isOpen testId="store-modal" onDismiss={mockDismiss}>
181
- Not focable content
182
- </Modal>
183
- )
184
-
185
- fireEvent.keyDown(getByTestId('store-modal'), { key: 'Escape' })
186
- expect(mockDismiss).toHaveBeenCalled()
187
- })
188
-
189
- it('Call onDismiss when press escape with tabbable children', () => {
190
- const mockDismiss = jest.fn()
191
- const { getByTestId } = render(<TestModal onDismiss={mockDismiss} />)
192
-
193
- fireEvent.click(getByTestId('trigger'))
194
-
195
- // Pressing any key other than 'Escape' won't close the modal
196
- fireEvent.keyPress(getByTestId('store-modal'), { key: 'j' })
197
- expect(mockDismiss).not.toHaveBeenCalled()
198
-
199
- // Press Escape
200
- fireEvent.keyDown(getByTestId('store-modal'), {
201
- key: 'Escape',
202
- })
203
-
204
- expect(mockDismiss).toHaveBeenCalled()
205
- })
206
-
207
- it('Call only the onDismiss from internal modal when press escape', () => {
208
- const mockExternalDismiss = jest.fn()
209
- const mockInternalDismiss = jest.fn()
210
- const { getByTestId, getAllByTestId } = render(
211
- <TestModal onDismiss={mockExternalDismiss}>
212
- <TestModal onDismiss={mockInternalDismiss} />
213
- </TestModal>
214
- )
215
-
216
- fireEvent.click(getByTestId('trigger'))
217
- fireEvent.click(getAllByTestId('trigger')[1])
218
-
219
- expect(getAllByTestId('store-modal')[1]).toBeInTheDocument()
220
-
221
- // Press Escape on internal modal. Only the internal modal should close
222
- fireEvent.keyDown(getAllByTestId('store-modal')[1], {
223
- key: 'Escape',
224
- })
225
-
226
- expect(mockExternalDismiss).not.toHaveBeenCalled()
227
- expect(mockInternalDismiss).toHaveBeenCalled()
228
- })
229
-
230
- it('Call onDismiss when click outside the modal', () => {
231
- const mockDismiss = jest.fn()
232
- const { getByTestId } = render(<TestModal onDismiss={mockDismiss} />)
233
-
234
- fireEvent.click(getByTestId('trigger'))
235
-
236
- // Close the modal
237
- fireEvent.click(getByTestId('store-overlay'))
238
-
239
- expect(mockDismiss).toHaveBeenCalled()
240
- })
241
- })
@@ -1,103 +0,0 @@
1
- import { render } from '@testing-library/react'
2
- import { axe } from 'jest-axe'
3
- import React from 'react'
4
-
5
- import OrderSummary from './OrderSummary'
6
-
7
- const ELEMENT_NOT_FOUND_MESSAGE = 'Unable to find an element by:'
8
-
9
- describe('OrderSummary', () => {
10
- it('should have `data-fs-order-summary` attribute', () => {
11
- const { getByTestId } = render(<OrderSummary />)
12
-
13
- expect(getByTestId('store-order-summary')).toHaveAttribute(
14
- 'data-fs-order-summary'
15
- )
16
- })
17
-
18
- it('should always render total labels and values elements', async () => {
19
- const { getByTestId } = render(<OrderSummary />)
20
-
21
- expect(getByTestId('store-order-summary-total-label')).toBeInTheDocument()
22
- expect(getByTestId('store-order-summary-total-value')).toBeInTheDocument()
23
- })
24
-
25
- it('should not render subtotal or discount labels and values if subtotalValue or discountValue are not provided', async () => {
26
- const { getByTestId } = render(
27
- <OrderSummary totalLabel="Total" totalValue="250$" />
28
- )
29
-
30
- expect(() =>
31
- getByTestId('store-order-summary-subtotal-label')
32
- ).toThrowError(ELEMENT_NOT_FOUND_MESSAGE)
33
- expect(() => getByTestId('store-order-summary-subtotal-value')).toThrow(
34
- ELEMENT_NOT_FOUND_MESSAGE
35
- )
36
-
37
- expect(() => getByTestId('store-order-summary-discount-label')).toThrow(
38
- ELEMENT_NOT_FOUND_MESSAGE
39
- )
40
- expect(() => getByTestId('store-order-summary-discount-value')).toThrow(
41
- ELEMENT_NOT_FOUND_MESSAGE
42
- )
43
- })
44
-
45
- it('should render subtotal label and value if subtotalValue is provided', async () => {
46
- const { getByTestId } = render(
47
- <OrderSummary
48
- subtotalLabel="Subtotal"
49
- totalLabel="Total"
50
- subtotalValue="300$"
51
- totalValue="250$"
52
- />
53
- )
54
-
55
- expect(
56
- getByTestId('store-order-summary-subtotal-label')
57
- ).toBeInTheDocument()
58
- expect(getByTestId('store-order-summary-subtotal-label')).toHaveTextContent(
59
- 'Subtotal'
60
- )
61
-
62
- expect(
63
- getByTestId('store-order-summary-subtotal-value')
64
- ).toBeInTheDocument()
65
- expect(getByTestId('store-order-summary-subtotal-value')).toHaveTextContent(
66
- '300$'
67
- )
68
- })
69
-
70
- it('should render discount label and value if discountValue is provided', async () => {
71
- const { getByTestId } = render(
72
- <OrderSummary
73
- subtotalLabel="Subtotal"
74
- totalLabel="Total"
75
- subtotalValue="300$"
76
- totalValue="250$"
77
- discountLabel="Discount"
78
- discountValue="-50$"
79
- />
80
- )
81
-
82
- expect(
83
- getByTestId('store-order-summary-discount-label')
84
- ).toBeInTheDocument()
85
- expect(getByTestId('store-order-summary-discount-label')).toHaveTextContent(
86
- 'Discount'
87
- )
88
- expect(
89
- getByTestId('store-order-summary-discount-value')
90
- ).toBeInTheDocument()
91
- expect(getByTestId('store-order-summary-discount-value')).toHaveTextContent(
92
- '-50$'
93
- )
94
- })
95
-
96
- describe('Accessibility', () => {
97
- it('should have no violations', async () => {
98
- const { getByTestId } = render(<OrderSummary />)
99
-
100
- expect(await axe(getByTestId('store-order-summary'))).toHaveNoViolations()
101
- })
102
- })
103
- })
@@ -1,37 +0,0 @@
1
- import { render } from '@testing-library/react'
2
- import { axe } from 'jest-axe'
3
- import React from 'react'
4
-
5
- import PaymentMethods from './PaymentMethods'
6
-
7
- describe('Payment methods', () => {
8
- let paymentMethodsData: HTMLElement
9
-
10
- beforeEach(() => {
11
- const { getByTestId } = render(
12
- <PaymentMethods title="I am a title">
13
- <h3>I am a flag</h3>
14
- </PaymentMethods>
15
- )
16
-
17
- paymentMethodsData = getByTestId('store-payment-methods')
18
- })
19
-
20
- it('should have `data-fs-payment-methods` attribute', () => {
21
- expect(paymentMethodsData).toHaveAttribute('data-fs-payment-methods')
22
- })
23
-
24
- it('Should render PaymentMethods Children', () => {
25
- expect(paymentMethodsData).toHaveTextContent('I am a flag')
26
- })
27
-
28
- it('Should render PaymentMethods title', () => {
29
- expect(paymentMethodsData).toHaveTextContent('I am a title')
30
- })
31
-
32
- describe('Accessibility', () => {
33
- it('should have no violations', async () => {
34
- expect(await axe(paymentMethodsData)).toHaveNoViolations()
35
- })
36
- })
37
- })
@@ -1,70 +0,0 @@
1
- import { render } from '@testing-library/react'
2
- import { axe } from 'jest-axe'
3
- import React from 'react'
4
-
5
- import PriceRange from './PriceRange'
6
-
7
- function formatter(price: number) {
8
- return new Intl.NumberFormat('en-US', {
9
- style: 'currency',
10
- currency: 'USD',
11
- }).format(price)
12
- }
13
-
14
- const props = {
15
- formatter,
16
- min: {
17
- absolute: 0,
18
- selected: 0,
19
- },
20
- max: {
21
- absolute: 100,
22
- selected: 100,
23
- },
24
- ariaLabel: 'My price range',
25
- }
26
-
27
- describe('PriceRange', () => {
28
- it('`data-fs-price-range` is present', () => {
29
- const { getByTestId } = render(<PriceRange {...props} />)
30
-
31
- expect(getByTestId('store-price-range')).toHaveAttribute(
32
- 'data-fs-price-range'
33
- )
34
- })
35
-
36
- describe('Accessibility', () => {
37
- it('should have no violations', async () => {
38
- const { container } = render(<PriceRange {...props} />)
39
-
40
- expect(await axe(container)).toHaveNoViolations()
41
- })
42
-
43
- it('should have expected aria and role attributes', () => {
44
- const { getByTestId } = render(<PriceRange {...props} />)
45
-
46
- // check aria-valuemin, aria-valuemax
47
- expect(
48
- getByTestId('store-price-range').querySelectorAll('[aria-valuemin="0"]')
49
- ).toHaveLength(2)
50
- expect(
51
- getByTestId('store-price-range').querySelectorAll(
52
- '[aria-valuemax="100"]'
53
- )
54
- ).toHaveLength(2)
55
-
56
- expect(
57
- getByTestId('store-price-range').querySelector('[aria-valuenow="0"]')
58
- ).toBeInTheDocument()
59
-
60
- expect(
61
- getByTestId('store-price-range').querySelector('[aria-valuenow="100"]')
62
- ).toBeInTheDocument()
63
-
64
- // check role slider. input type=range has implicit role slider
65
- expect(
66
- getByTestId('store-price-range').querySelectorAll('input[type="range"]')
67
- ).toHaveLength(2)
68
- })
69
- })
70
- })
@@ -1,75 +0,0 @@
1
- import { render } from '@testing-library/react'
2
- import { axe } from 'jest-axe'
3
- import React from 'react'
4
-
5
- import ProductCard from './ProductCard'
6
- import ProductCardImage from './ProductCardImage'
7
- import ProductCardContent from './ProductCardContent'
8
- import ProductCardActions from './ProductCardActions'
9
-
10
- const TestProductCard = () => {
11
- return (
12
- <ProductCard>
13
- <ProductCardImage>
14
- <div>An image</div>
15
- </ProductCardImage>
16
- <ProductCardContent>
17
- <h3>A title</h3>
18
- <p>A little text here: The quick brown fox jumps over the lazy dog.</p>
19
- </ProductCardContent>
20
- <ProductCardActions>
21
- <button>A button</button>
22
- </ProductCardActions>
23
- </ProductCard>
24
- )
25
- }
26
-
27
- describe('ProductCard', () => {
28
- let productCard: HTMLElement
29
- let productCardImage: HTMLElement
30
- let productCardContent: HTMLElement
31
- let productCardActions: HTMLElement
32
- let productCardContainer: HTMLElement
33
-
34
- beforeEach(() => {
35
- const { getByTestId, container } = render(<TestProductCard />)
36
-
37
- productCardContainer = container
38
- productCard = getByTestId('store-product-card')
39
- productCardImage = getByTestId('store-product-card-image')
40
- productCardContent = getByTestId('store-product-card-content')
41
- productCardActions = getByTestId('store-product-card-actions')
42
- })
43
-
44
- describe('Data attributes', () => {
45
- it('`ProductCard` component should have `data-fs-product-card` attribute', () => {
46
- expect(productCard).toHaveAttribute('data-fs-product-card')
47
- })
48
-
49
- it('`ProductCardContent` component should have `data-product-card-content` attribute', () => {
50
- expect(productCardContent).toHaveAttribute('data-product-card-content')
51
- })
52
-
53
- it('`ProductCardImage` component should have `data-product-card-image` attribute', () => {
54
- expect(productCardImage).toHaveAttribute('data-product-card-image')
55
- })
56
-
57
- it('`ProductCardActions` component should have `data-product-card-actions` attribute', () => {
58
- expect(productCardActions).toHaveAttribute('data-product-card-actions')
59
- })
60
- })
61
-
62
- describe('Accessibility', () => {
63
- it('should not have violations', async () => {
64
- expect(await axe(productCardContainer)).toHaveNoViolations()
65
- })
66
-
67
- it('`ProductCard` component should be an `article`', () => {
68
- expect(productCard.tagName).toEqual('ARTICLE')
69
- })
70
-
71
- it('`productCardContent` component should be an `section`', () => {
72
- expect(productCardContent.tagName).toEqual('SECTION')
73
- })
74
- })
75
- })
@@ -1,93 +0,0 @@
1
- import { render } from '@testing-library/react'
2
- import React, { useState } from 'react'
3
- import userEvent from '@testing-library/user-event'
4
- import { axe } from 'jest-axe'
5
-
6
- import QuantitySelector from '.'
7
-
8
- describe('QuantitySelector', () => {
9
- it('should render', () => {
10
- const { getByTestId } = render(
11
- <QuantitySelector
12
- name="quantity-selector"
13
- quantity={1}
14
- leftButtonProps={{ icon: <span>-</span> }}
15
- rightButtonProps={{ icon: <span>+</span> }}
16
- inputProps={{ readOnly: true }}
17
- />
18
- )
19
-
20
- expect(getByTestId('store-quantity-selector')).toBeInTheDocument()
21
- })
22
-
23
- it('should render with the correct quantity', () => {
24
- const { getByLabelText } = render(
25
- <QuantitySelector
26
- name="quantity-selector"
27
- quantity={123}
28
- leftButtonProps={{ icon: <span>-</span> }}
29
- rightButtonProps={{ icon: <span>+</span> }}
30
- inputProps={{ readOnly: true }}
31
- />
32
- )
33
-
34
- expect(getByLabelText('Quantity')).toHaveValue('123')
35
- })
36
-
37
- it('should update correctly according to event changes', () => {
38
- const QuantitySelectorTest = () => {
39
- const [quantity, setQuantity] = useState(1)
40
-
41
- return (
42
- <QuantitySelector
43
- name="quantity-selector"
44
- quantity={quantity}
45
- leftButtonProps={{
46
- icon: <span>-</span>,
47
- onClick: () => {
48
- setQuantity((curr) => curr - 1)
49
- },
50
- }}
51
- rightButtonProps={{
52
- icon: <span>+</span>,
53
- onClick: () => {
54
- setQuantity((curr) => curr + 1)
55
- },
56
- }}
57
- inputProps={{ readOnly: true }}
58
- />
59
- )
60
- }
61
-
62
- const { getByLabelText } = render(<QuantitySelectorTest />)
63
-
64
- expect(getByLabelText('Quantity')).toHaveValue('1')
65
-
66
- const rightButton = getByLabelText('Increment Quantity')
67
- const leftButton = getByLabelText('Decrement Quantity')
68
-
69
- userEvent.click(rightButton)
70
- expect(getByLabelText('Quantity')).toHaveValue('2')
71
- userEvent.click(leftButton)
72
- expect(getByLabelText('Quantity')).toHaveValue('1')
73
- })
74
-
75
- describe('QuantitySelector Accessibility', () => {
76
- it('should pass the AXE tests', async () => {
77
- render(
78
- <main>
79
- <QuantitySelector
80
- name="quantity-selector"
81
- quantity={1}
82
- leftButtonProps={{ icon: <span>-</span> }}
83
- rightButtonProps={{ icon: <span>+</span> }}
84
- inputProps={{ readOnly: true }}
85
- />
86
- </main>
87
- )
88
-
89
- expect(await axe(document.body)).toHaveNoViolations()
90
- expect(await axe(document.body)).toHaveNoIncompletes()
91
- })
92
- })
93
- })