@faststore/ui 1.9.8 → 1.9.11

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 (435) hide show
  1. package/CHANGELOG.md +742 -2289
  2. package/README.md +2 -0
  3. package/dist/atoms/Badge/Badge.d.ts +11 -11
  4. package/dist/atoms/Badge/Badge.js +6 -0
  5. package/dist/atoms/Badge/Badge.js.map +1 -0
  6. package/dist/atoms/Badge/index.d.ts +2 -2
  7. package/dist/atoms/Badge/index.js +2 -0
  8. package/dist/atoms/Badge/index.js.map +1 -0
  9. package/dist/atoms/Button/Button.d.ts +10 -10
  10. package/dist/atoms/Button/Button.js +6 -0
  11. package/dist/atoms/Button/Button.js.map +1 -0
  12. package/dist/atoms/Button/index.d.ts +2 -2
  13. package/dist/atoms/Button/index.js +2 -0
  14. package/dist/atoms/Button/index.js.map +1 -0
  15. package/dist/atoms/Checkbox/Checkbox.d.ts +10 -10
  16. package/dist/atoms/Checkbox/Checkbox.js +6 -0
  17. package/dist/atoms/Checkbox/Checkbox.js.map +1 -0
  18. package/dist/atoms/Checkbox/index.d.ts +2 -2
  19. package/dist/atoms/Checkbox/index.js +2 -0
  20. package/dist/atoms/Checkbox/index.js.map +1 -0
  21. package/dist/atoms/Icon/Icon.d.ts +14 -14
  22. package/dist/atoms/Icon/Icon.js +6 -0
  23. package/dist/atoms/Icon/Icon.js.map +1 -0
  24. package/dist/atoms/Icon/index.d.ts +2 -2
  25. package/dist/atoms/Icon/index.js +2 -0
  26. package/dist/atoms/Icon/index.js.map +1 -0
  27. package/dist/atoms/Icon/stories/assets/ShoppingCart.d.ts +3 -3
  28. package/dist/atoms/Icon/stories/assets/ShoppingCart.js +8 -0
  29. package/dist/atoms/Icon/stories/assets/ShoppingCart.js.map +1 -0
  30. package/dist/atoms/Incentive/Incentive.d.ts +11 -11
  31. package/dist/atoms/Incentive/Incentive.js +6 -0
  32. package/dist/atoms/Incentive/Incentive.js.map +1 -0
  33. package/dist/atoms/Incentive/index.d.ts +2 -2
  34. package/dist/atoms/Incentive/index.js +2 -0
  35. package/dist/atoms/Incentive/index.js.map +1 -0
  36. package/dist/atoms/Incentive/stories/assets/Icons.d.ts +2 -2
  37. package/dist/atoms/Incentive/stories/assets/Icons.js +6 -0
  38. package/dist/atoms/Incentive/stories/assets/Icons.js.map +1 -0
  39. package/dist/atoms/Input/Input.d.ts +14 -14
  40. package/dist/atoms/Input/Input.js +10 -0
  41. package/dist/atoms/Input/Input.js.map +1 -0
  42. package/dist/atoms/Input/index.d.ts +2 -2
  43. package/dist/atoms/Input/index.js +2 -0
  44. package/dist/atoms/Input/index.js.map +1 -0
  45. package/dist/atoms/Label/Label.d.ts +10 -10
  46. package/dist/atoms/Label/Label.js +6 -0
  47. package/dist/atoms/Label/Label.js.map +1 -0
  48. package/dist/atoms/Label/index.d.ts +2 -2
  49. package/dist/atoms/Label/index.js +2 -0
  50. package/dist/atoms/Label/index.js.map +1 -0
  51. package/dist/atoms/Link/Link.d.ts +19 -19
  52. package/dist/atoms/Link/Link.js +13 -0
  53. package/dist/atoms/Link/Link.js.map +1 -0
  54. package/dist/atoms/Link/index.d.ts +2 -2
  55. package/dist/atoms/Link/index.js +2 -0
  56. package/dist/atoms/Link/index.js.map +1 -0
  57. package/dist/atoms/List/List.d.ts +12 -12
  58. package/dist/atoms/List/List.js +16 -0
  59. package/dist/atoms/List/List.js.map +1 -0
  60. package/dist/atoms/List/index.d.ts +2 -2
  61. package/dist/atoms/List/index.js +2 -0
  62. package/dist/atoms/List/index.js.map +1 -0
  63. package/dist/atoms/Overlay/Overlay.d.ts +10 -10
  64. package/dist/atoms/Overlay/Overlay.js +6 -0
  65. package/dist/atoms/Overlay/Overlay.js.map +1 -0
  66. package/dist/atoms/Overlay/index.d.ts +2 -2
  67. package/dist/atoms/Overlay/index.js +2 -0
  68. package/dist/atoms/Overlay/index.js.map +1 -0
  69. package/dist/atoms/Popover/Popover.d.ts +15 -15
  70. package/dist/atoms/Popover/Popover.js +7 -0
  71. package/dist/atoms/Popover/Popover.js.map +1 -0
  72. package/dist/atoms/Popover/index.d.ts +2 -2
  73. package/dist/atoms/Popover/index.js +2 -0
  74. package/dist/atoms/Popover/index.js.map +1 -0
  75. package/dist/atoms/Price/Price.d.ts +28 -28
  76. package/dist/atoms/Price/Price.js +7 -0
  77. package/dist/atoms/Price/Price.js.map +1 -0
  78. package/dist/atoms/Price/index.d.ts +2 -2
  79. package/dist/atoms/Price/index.js +2 -0
  80. package/dist/atoms/Price/index.js.map +1 -0
  81. package/dist/atoms/Radio/Radio.d.ts +7 -7
  82. package/dist/atoms/Radio/Radio.js +6 -0
  83. package/dist/atoms/Radio/Radio.js.map +1 -0
  84. package/dist/atoms/Radio/index.d.ts +2 -2
  85. package/dist/atoms/Radio/index.js +2 -0
  86. package/dist/atoms/Radio/index.js.map +1 -0
  87. package/dist/atoms/Select/Select.d.ts +10 -10
  88. package/dist/atoms/Select/Select.js +6 -0
  89. package/dist/atoms/Select/Select.js.map +1 -0
  90. package/dist/atoms/Select/index.d.ts +2 -2
  91. package/dist/atoms/Select/index.js +2 -0
  92. package/dist/atoms/Select/index.js.map +1 -0
  93. package/dist/atoms/Skeleton/Skeleton.d.ts +10 -10
  94. package/dist/atoms/Skeleton/Skeleton.js +6 -0
  95. package/dist/atoms/Skeleton/Skeleton.js.map +1 -0
  96. package/dist/atoms/Skeleton/index.d.ts +2 -2
  97. package/dist/atoms/Skeleton/index.js +2 -0
  98. package/dist/atoms/Skeleton/index.js.map +1 -0
  99. package/dist/atoms/Slider/Slider.d.ts +45 -37
  100. package/dist/atoms/Slider/Slider.js +30 -0
  101. package/dist/atoms/Slider/Slider.js.map +1 -0
  102. package/dist/atoms/Slider/index.d.ts +2 -2
  103. package/dist/atoms/Slider/index.js +2 -0
  104. package/dist/atoms/Slider/index.js.map +1 -0
  105. package/dist/atoms/Spinner/Spinner.d.ts +11 -11
  106. package/dist/atoms/Spinner/Spinner.js +6 -0
  107. package/dist/atoms/Spinner/Spinner.js.map +1 -0
  108. package/dist/atoms/Spinner/index.d.ts +2 -2
  109. package/dist/atoms/Spinner/index.js +2 -0
  110. package/dist/atoms/Spinner/index.js.map +1 -0
  111. package/dist/atoms/TextArea/TextArea.d.ts +14 -14
  112. package/dist/atoms/TextArea/TextArea.js +10 -0
  113. package/dist/atoms/TextArea/TextArea.js.map +1 -0
  114. package/dist/atoms/TextArea/index.d.ts +2 -2
  115. package/dist/atoms/TextArea/index.js +2 -0
  116. package/dist/atoms/TextArea/index.js.map +1 -0
  117. package/dist/hooks/useSlider/index.d.ts +2 -2
  118. package/dist/hooks/useSlider/index.js +3 -0
  119. package/dist/hooks/useSlider/index.js.map +1 -0
  120. package/dist/hooks/useSlider/useSlider.d.ts +62 -62
  121. package/dist/hooks/useSlider/useSlider.js +108 -0
  122. package/dist/hooks/useSlider/useSlider.js.map +1 -0
  123. package/dist/index.d.ts +80 -80
  124. package/dist/index.js +45 -8
  125. package/dist/index.js.map +1 -0
  126. package/dist/molecules/Accordion/Accordion.d.ts +26 -26
  127. package/dist/molecules/Accordion/Accordion.js +21 -0
  128. package/dist/molecules/Accordion/Accordion.js.map +1 -0
  129. package/dist/molecules/Accordion/AccordionButton.d.ts +10 -10
  130. package/dist/molecules/Accordion/AccordionButton.js +37 -0
  131. package/dist/molecules/Accordion/AccordionButton.js.map +1 -0
  132. package/dist/molecules/Accordion/AccordionItem.d.ts +28 -28
  133. package/dist/molecules/Accordion/AccordionItem.js +21 -0
  134. package/dist/molecules/Accordion/AccordionItem.js.map +1 -0
  135. package/dist/molecules/Accordion/AccordionPanel.d.ts +10 -10
  136. package/dist/molecules/Accordion/AccordionPanel.js +10 -0
  137. package/dist/molecules/Accordion/AccordionPanel.js.map +1 -0
  138. package/dist/molecules/Accordion/index.d.ts +8 -8
  139. package/dist/molecules/Accordion/index.js +5 -0
  140. package/dist/molecules/Accordion/index.js.map +1 -0
  141. package/dist/molecules/AggregateRating/AggregateRating.d.ts +18 -18
  142. package/dist/molecules/AggregateRating/AggregateRating.js +26 -0
  143. package/dist/molecules/AggregateRating/AggregateRating.js.map +1 -0
  144. package/dist/molecules/AggregateRating/index.d.ts +2 -2
  145. package/dist/molecules/AggregateRating/index.js +2 -0
  146. package/dist/molecules/AggregateRating/index.js.map +1 -0
  147. package/dist/molecules/Alert/Alert.d.ts +11 -11
  148. package/dist/molecules/Alert/Alert.js +6 -0
  149. package/dist/molecules/Alert/Alert.js.map +1 -0
  150. package/dist/molecules/Alert/index.d.ts +2 -2
  151. package/dist/molecules/Alert/index.js +2 -0
  152. package/dist/molecules/Alert/index.js.map +1 -0
  153. package/dist/molecules/Banner/Banner.d.ts +14 -14
  154. package/dist/molecules/Banner/Banner.js +6 -0
  155. package/dist/molecules/Banner/Banner.js.map +1 -0
  156. package/dist/molecules/Banner/BannerContent.d.ts +10 -10
  157. package/dist/molecules/Banner/BannerContent.js +6 -0
  158. package/dist/molecules/Banner/BannerContent.js.map +1 -0
  159. package/dist/molecules/Banner/BannerImage.d.ts +10 -10
  160. package/dist/molecules/Banner/BannerImage.js +6 -0
  161. package/dist/molecules/Banner/BannerImage.js.map +1 -0
  162. package/dist/molecules/Banner/BannerLink.d.ts +10 -10
  163. package/dist/molecules/Banner/BannerLink.js +6 -0
  164. package/dist/molecules/Banner/BannerLink.js.map +1 -0
  165. package/dist/molecules/Banner/index.d.ts +8 -8
  166. package/dist/molecules/Banner/index.js +5 -0
  167. package/dist/molecules/Banner/index.js.map +1 -0
  168. package/dist/molecules/Breadcrumb/Breadcrumb.d.ts +14 -14
  169. package/dist/molecules/Breadcrumb/Breadcrumb.js +38 -0
  170. package/dist/molecules/Breadcrumb/Breadcrumb.js.map +1 -0
  171. package/dist/molecules/Breadcrumb/index.d.ts +2 -2
  172. package/dist/molecules/Breadcrumb/index.js +2 -0
  173. package/dist/molecules/Breadcrumb/index.js.map +1 -0
  174. package/dist/molecules/Bullets/Bullets.d.ts +35 -35
  175. package/dist/molecules/Bullets/Bullets.js +12 -0
  176. package/dist/molecules/Bullets/Bullets.js.map +1 -0
  177. package/dist/molecules/Bullets/index.d.ts +2 -2
  178. package/dist/molecules/Bullets/index.js +2 -0
  179. package/dist/molecules/Bullets/index.js.map +1 -0
  180. package/dist/molecules/Card/Card.d.ts +10 -10
  181. package/dist/molecules/Card/Card.js +6 -0
  182. package/dist/molecules/Card/Card.js.map +1 -0
  183. package/dist/molecules/Card/CardActions.d.ts +10 -10
  184. package/dist/molecules/Card/CardActions.js +6 -0
  185. package/dist/molecules/Card/CardActions.js.map +1 -0
  186. package/dist/molecules/Card/CardContent.d.ts +10 -10
  187. package/dist/molecules/Card/CardContent.js +6 -0
  188. package/dist/molecules/Card/CardContent.js.map +1 -0
  189. package/dist/molecules/Card/CardImage.d.ts +10 -10
  190. package/dist/molecules/Card/CardImage.js +6 -0
  191. package/dist/molecules/Card/CardImage.js.map +1 -0
  192. package/dist/molecules/Card/index.d.ts +8 -8
  193. package/dist/molecules/Card/index.js +5 -0
  194. package/dist/molecules/Card/index.js.map +1 -0
  195. package/dist/molecules/Carousel/Arrows.d.ts +12 -12
  196. package/dist/molecules/Carousel/Arrows.js +6 -0
  197. package/dist/molecules/Carousel/Arrows.js.map +1 -0
  198. package/dist/molecules/Carousel/Carousel.d.ts +16 -16
  199. package/dist/molecules/Carousel/Carousel.js +124 -0
  200. package/dist/molecules/Carousel/Carousel.js.map +1 -0
  201. package/dist/molecules/Carousel/hooks/useSlideVisibility.d.ts +9 -9
  202. package/dist/molecules/Carousel/hooks/useSlideVisibility.js +29 -0
  203. package/dist/molecules/Carousel/hooks/useSlideVisibility.js.map +1 -0
  204. package/dist/molecules/Carousel/index.d.ts +2 -2
  205. package/dist/molecules/Carousel/index.js +3 -0
  206. package/dist/molecules/Carousel/index.js.map +1 -0
  207. package/dist/molecules/Dropdown/Dropdown.d.ts +9 -9
  208. package/dist/molecules/Dropdown/Dropdown.js +67 -0
  209. package/dist/molecules/Dropdown/Dropdown.js.map +1 -0
  210. package/dist/molecules/Dropdown/DropdownButton.d.ts +10 -10
  211. package/dist/molecules/Dropdown/DropdownButton.js +11 -0
  212. package/dist/molecules/Dropdown/DropdownButton.js.map +1 -0
  213. package/dist/molecules/Dropdown/DropdownItem.d.ts +10 -10
  214. package/dist/molecules/Dropdown/DropdownItem.js +26 -0
  215. package/dist/molecules/Dropdown/DropdownItem.js.map +1 -0
  216. package/dist/molecules/Dropdown/DropdownMenu.d.ts +22 -22
  217. package/dist/molecules/Dropdown/DropdownMenu.js +65 -0
  218. package/dist/molecules/Dropdown/DropdownMenu.js.map +1 -0
  219. package/dist/molecules/Dropdown/contexts/DropdownContext.d.ts +41 -41
  220. package/dist/molecules/Dropdown/contexts/DropdownContext.js +11 -0
  221. package/dist/molecules/Dropdown/contexts/DropdownContext.js.map +1 -0
  222. package/dist/molecules/Dropdown/hooks/useDropdown.d.ts +6 -6
  223. package/dist/molecules/Dropdown/hooks/useDropdown.js +14 -0
  224. package/dist/molecules/Dropdown/hooks/useDropdown.js.map +1 -0
  225. package/dist/molecules/Dropdown/hooks/useDropdownPosition.d.ts +8 -8
  226. package/dist/molecules/Dropdown/hooks/useDropdownPosition.js +25 -0
  227. package/dist/molecules/Dropdown/hooks/useDropdownPosition.js.map +1 -0
  228. package/dist/molecules/Dropdown/index.d.ts +8 -8
  229. package/dist/molecules/Dropdown/index.js +5 -0
  230. package/dist/molecules/Dropdown/index.js.map +1 -0
  231. package/dist/molecules/Dropdown/stories/assets/Caret.d.ts +2 -2
  232. package/dist/molecules/Dropdown/stories/assets/Caret.js +4 -0
  233. package/dist/molecules/Dropdown/stories/assets/Caret.js.map +1 -0
  234. package/dist/molecules/Form/Form.d.ts +11 -11
  235. package/dist/molecules/Form/Form.js +6 -0
  236. package/dist/molecules/Form/Form.js.map +1 -0
  237. package/dist/molecules/Form/index.d.ts +2 -2
  238. package/dist/molecules/Form/index.js +2 -0
  239. package/dist/molecules/Form/index.js.map +1 -0
  240. package/dist/molecules/IconButton/IconButton.d.ts +19 -19
  241. package/dist/molecules/IconButton/IconButton.js +9 -0
  242. package/dist/molecules/IconButton/IconButton.js.map +1 -0
  243. package/dist/molecules/IconButton/index.d.ts +2 -2
  244. package/dist/molecules/IconButton/index.js +2 -0
  245. package/dist/molecules/IconButton/index.js.map +1 -0
  246. package/dist/molecules/LoadingButton/LoadingButton.d.ts +14 -14
  247. package/dist/molecules/LoadingButton/LoadingButton.js +8 -0
  248. package/dist/molecules/LoadingButton/LoadingButton.js.map +1 -0
  249. package/dist/molecules/LoadingButton/index.d.ts +2 -2
  250. package/dist/molecules/LoadingButton/index.js +2 -0
  251. package/dist/molecules/LoadingButton/index.js.map +1 -0
  252. package/dist/molecules/Modal/Modal.d.ts +25 -25
  253. package/dist/molecules/Modal/Modal.js +31 -0
  254. package/dist/molecules/Modal/Modal.js.map +1 -0
  255. package/dist/molecules/Modal/ModalContent.d.ts +10 -10
  256. package/dist/molecules/Modal/ModalContent.js +23 -0
  257. package/dist/molecules/Modal/ModalContent.js.map +1 -0
  258. package/dist/molecules/Modal/index.d.ts +2 -2
  259. package/dist/molecules/Modal/index.js +2 -0
  260. package/dist/molecules/Modal/index.js.map +1 -0
  261. package/dist/molecules/Modal/useTrapFocus.d.ts +8 -8
  262. package/dist/molecules/Modal/useTrapFocus.js +76 -0
  263. package/dist/molecules/Modal/useTrapFocus.js.map +1 -0
  264. package/dist/molecules/PaymentMethods/PaymentMethods.d.ts +26 -26
  265. package/dist/molecules/PaymentMethods/PaymentMethods.js +8 -0
  266. package/dist/molecules/PaymentMethods/PaymentMethods.js.map +1 -0
  267. package/dist/molecules/PaymentMethods/index.d.ts +2 -2
  268. package/dist/molecules/PaymentMethods/index.js +2 -0
  269. package/dist/molecules/PaymentMethods/index.js.map +1 -0
  270. package/dist/molecules/PaymentMethods/stories/assets/Icons.d.ts +9 -9
  271. package/dist/molecules/PaymentMethods/stories/assets/Icons.js +26 -0
  272. package/dist/molecules/PaymentMethods/stories/assets/Icons.js.map +1 -0
  273. package/dist/molecules/PriceRange/PriceRange.d.ts +23 -23
  274. package/dist/molecules/PriceRange/PriceRange.js +16 -0
  275. package/dist/molecules/PriceRange/PriceRange.js.map +1 -0
  276. package/dist/molecules/PriceRange/index.d.ts +2 -2
  277. package/dist/molecules/PriceRange/index.js +2 -0
  278. package/dist/molecules/PriceRange/index.js.map +1 -0
  279. package/dist/molecules/ProductCard/ProductCard.d.ts +11 -11
  280. package/dist/molecules/ProductCard/ProductCard.js +6 -0
  281. package/dist/molecules/ProductCard/ProductCard.js.map +1 -0
  282. package/dist/molecules/ProductCard/ProductCardActions.d.ts +10 -10
  283. package/dist/molecules/ProductCard/ProductCardActions.js +6 -0
  284. package/dist/molecules/ProductCard/ProductCardActions.js.map +1 -0
  285. package/dist/molecules/ProductCard/ProductCardContent.d.ts +10 -10
  286. package/dist/molecules/ProductCard/ProductCardContent.js +6 -0
  287. package/dist/molecules/ProductCard/ProductCardContent.js.map +1 -0
  288. package/dist/molecules/ProductCard/ProductCardImage.d.ts +10 -10
  289. package/dist/molecules/ProductCard/ProductCardImage.js +6 -0
  290. package/dist/molecules/ProductCard/ProductCardImage.js.map +1 -0
  291. package/dist/molecules/ProductCard/index.d.ts +8 -8
  292. package/dist/molecules/ProductCard/index.js +5 -0
  293. package/dist/molecules/ProductCard/index.js.map +1 -0
  294. package/dist/molecules/QuantitySelector/QuantitySelector.d.ts +30 -30
  295. package/dist/molecules/QuantitySelector/QuantitySelector.js +11 -0
  296. package/dist/molecules/QuantitySelector/QuantitySelector.js.map +1 -0
  297. package/dist/molecules/QuantitySelector/index.d.ts +2 -2
  298. package/dist/molecules/QuantitySelector/index.js +2 -0
  299. package/dist/molecules/QuantitySelector/index.js.map +1 -0
  300. package/dist/molecules/QuantitySelector/stories/assets/Icons.d.ts +7 -7
  301. package/dist/molecules/QuantitySelector/stories/assets/Icons.js +11 -0
  302. package/dist/molecules/QuantitySelector/stories/assets/Icons.js.map +1 -0
  303. package/dist/molecules/RadioGroup/RadioGroup.d.ts +5 -5
  304. package/dist/molecules/RadioGroup/RadioGroup.js +10 -0
  305. package/dist/molecules/RadioGroup/RadioGroup.js.map +1 -0
  306. package/dist/molecules/RadioGroup/RadioOption.d.ts +19 -19
  307. package/dist/molecules/RadioGroup/RadioOption.js +11 -0
  308. package/dist/molecules/RadioGroup/RadioOption.js.map +1 -0
  309. package/dist/molecules/RadioGroup/index.d.ts +4 -4
  310. package/dist/molecules/RadioGroup/index.js +3 -0
  311. package/dist/molecules/RadioGroup/index.js.map +1 -0
  312. package/dist/molecules/RadioGroup/useRadioGroup.d.ts +17 -17
  313. package/dist/molecules/RadioGroup/useRadioGroup.js +10 -0
  314. package/dist/molecules/RadioGroup/useRadioGroup.js.map +1 -0
  315. package/dist/molecules/SearchInput/SearchInput.d.ts +28 -28
  316. package/dist/molecules/SearchInput/SearchInput.js +28 -0
  317. package/dist/molecules/SearchInput/SearchInput.js.map +1 -0
  318. package/dist/molecules/SearchInput/index.d.ts +2 -2
  319. package/dist/molecules/SearchInput/index.js +2 -0
  320. package/dist/molecules/SearchInput/index.js.map +1 -0
  321. package/dist/molecules/SearchInput/stories/assets/CustomIcon.d.ts +3 -3
  322. package/dist/molecules/SearchInput/stories/assets/CustomIcon.js +7 -0
  323. package/dist/molecules/SearchInput/stories/assets/CustomIcon.js.map +1 -0
  324. package/dist/molecules/Table/Table.d.ts +11 -11
  325. package/dist/molecules/Table/Table.js +6 -0
  326. package/dist/molecules/Table/Table.js.map +1 -0
  327. package/dist/molecules/Table/TableBody.d.ts +11 -11
  328. package/dist/molecules/Table/TableBody.js +6 -0
  329. package/dist/molecules/Table/TableBody.js.map +1 -0
  330. package/dist/molecules/Table/TableCell.d.ts +20 -20
  331. package/dist/molecules/Table/TableCell.js +7 -0
  332. package/dist/molecules/Table/TableCell.js.map +1 -0
  333. package/dist/molecules/Table/TableFooter.d.ts +11 -11
  334. package/dist/molecules/Table/TableFooter.js +6 -0
  335. package/dist/molecules/Table/TableFooter.js.map +1 -0
  336. package/dist/molecules/Table/TableHead.d.ts +11 -11
  337. package/dist/molecules/Table/TableHead.js +6 -0
  338. package/dist/molecules/Table/TableHead.js.map +1 -0
  339. package/dist/molecules/Table/TableRow.d.ts +11 -11
  340. package/dist/molecules/Table/TableRow.js +6 -0
  341. package/dist/molecules/Table/TableRow.js.map +1 -0
  342. package/dist/molecules/Table/index.d.ts +12 -12
  343. package/dist/molecules/Table/index.js +7 -0
  344. package/dist/molecules/Table/index.js.map +1 -0
  345. package/dist/organisms/Hero/Hero.d.ts +11 -11
  346. package/dist/organisms/Hero/Hero.js +6 -0
  347. package/dist/organisms/Hero/Hero.js.map +1 -0
  348. package/dist/organisms/Hero/HeroHeading.d.ts +10 -10
  349. package/dist/organisms/Hero/HeroHeading.js +6 -0
  350. package/dist/organisms/Hero/HeroHeading.js.map +1 -0
  351. package/dist/organisms/Hero/HeroImage.d.ts +10 -10
  352. package/dist/organisms/Hero/HeroImage.js +6 -0
  353. package/dist/organisms/Hero/HeroImage.js.map +1 -0
  354. package/dist/organisms/Hero/index.d.ts +6 -6
  355. package/dist/organisms/Hero/index.js +4 -0
  356. package/dist/organisms/Hero/index.js.map +1 -0
  357. package/dist/organisms/OutOfStock/OutOfStock.d.ts +21 -21
  358. package/dist/organisms/OutOfStock/OutOfStock.js +8 -0
  359. package/dist/organisms/OutOfStock/OutOfStock.js.map +1 -0
  360. package/dist/organisms/OutOfStock/OutOfStockMessage.d.ts +9 -9
  361. package/dist/organisms/OutOfStock/OutOfStockMessage.js +5 -0
  362. package/dist/organisms/OutOfStock/OutOfStockMessage.js.map +1 -0
  363. package/dist/organisms/OutOfStock/OutOfStockTitle.d.ts +9 -9
  364. package/dist/organisms/OutOfStock/OutOfStockTitle.js +5 -0
  365. package/dist/organisms/OutOfStock/OutOfStockTitle.js.map +1 -0
  366. package/dist/organisms/OutOfStock/index.d.ts +6 -6
  367. package/dist/organisms/OutOfStock/index.js +4 -0
  368. package/dist/organisms/OutOfStock/index.js.map +1 -0
  369. package/dist/setupTests.d.ts +1 -1
  370. package/dist/setupTests.js +6 -0
  371. package/dist/setupTests.js.map +1 -0
  372. package/dist/typings/PolymorphicGenerics.d.ts +28 -28
  373. package/dist/typings/PolymorphicGenerics.js +8 -0
  374. package/dist/typings/PolymorphicGenerics.js.map +1 -0
  375. package/dist/typings/index.d.ts +1 -1
  376. package/dist/typings/index.js +2 -0
  377. package/dist/typings/index.js.map +1 -0
  378. package/dist/utils/toHaveNoIncomplete.d.ts +17 -17
  379. package/dist/utils/toHaveNoIncomplete.js +43 -0
  380. package/dist/utils/toHaveNoIncomplete.js.map +1 -0
  381. package/package.json +6 -11
  382. package/src/atoms/Slider/Slider.test.tsx +13 -2
  383. package/src/atoms/Slider/Slider.tsx +50 -55
  384. package/src/molecules/AggregateRating/stories/AggregateRating.stories.tsx +2 -3
  385. package/src/molecules/Bullets/Bullets.tsx +4 -3
  386. package/src/molecules/Dropdown/DropdownItem.tsx +2 -5
  387. package/src/molecules/Dropdown/DropdownMenu.tsx +2 -7
  388. package/src/molecules/PriceRange/PriceRange.test.tsx +8 -2
  389. package/src/molecules/PriceRange/PriceRange.tsx +12 -20
  390. package/src/typings/PolymorphicGenerics.ts +2 -3
  391. package/dist/atoms/Badge/stories/Badge.stories.d.ts +0 -17
  392. package/dist/atoms/Button/stories/Button.stories.d.ts +0 -14
  393. package/dist/atoms/Checkbox/stories/Checkbox.stories.d.ts +0 -4
  394. package/dist/atoms/Icon/stories/Icon.stories.d.ts +0 -14
  395. package/dist/atoms/Incentive/stories/Incentive.stories.d.ts +0 -4
  396. package/dist/atoms/Input/stories/Input.stories.d.ts +0 -14
  397. package/dist/atoms/Label/stories/Label.stories.d.ts +0 -14
  398. package/dist/atoms/List/stories/List.stories.d.ts +0 -22
  399. package/dist/atoms/Overlay/stories/Overlay.stories.d.ts +0 -8
  400. package/dist/atoms/Popover/stories/Popover.stories.d.ts +0 -14
  401. package/dist/atoms/Price/stories/Price.stories.d.ts +0 -18
  402. package/dist/atoms/Radio/stories/Radio.stories.d.ts +0 -4
  403. package/dist/atoms/Select/stories/Select.stories.d.ts +0 -20
  404. package/dist/atoms/Skeleton/stories/Skeleton.stories.d.ts +0 -12
  405. package/dist/atoms/Slider/stories/Slider.stories.d.ts +0 -4
  406. package/dist/atoms/Spinner/stories/Spinner.stories.d.ts +0 -12
  407. package/dist/atoms/TextArea/stories/TextArea.stories.d.ts +0 -4
  408. package/dist/molecules/Accordion/stories/Accordion.stories.d.ts +0 -14
  409. package/dist/molecules/AggregateRating/stories/AggregateRating.stories.d.ts +0 -16
  410. package/dist/molecules/Alert/stories/Alert.stories.d.ts +0 -5
  411. package/dist/molecules/Banner/stories/Banner.stories.d.ts +0 -4
  412. package/dist/molecules/Breadcrumb/stories/Breadcrumb.stories.d.ts +0 -15
  413. package/dist/molecules/Bullets/stories/Bullets.stories.d.ts +0 -15
  414. package/dist/molecules/Card/stories/Card.stories.d.ts +0 -4
  415. package/dist/molecules/Carousel/stories/Carousel.stories.d.ts +0 -18
  416. package/dist/molecules/Dropdown/stories/Dropdown.stories.d.ts +0 -7
  417. package/dist/molecules/Form/stories/Form.stories.d.ts +0 -12
  418. package/dist/molecules/IconButton/stories/IconButton.stories.d.ts +0 -5
  419. package/dist/molecules/LoadingButton/stories/LoadingButton.stories.d.ts +0 -14
  420. package/dist/molecules/Modal/stories/Modal.stories.d.ts +0 -5
  421. package/dist/molecules/PaymentMethods/stories/PaymentMethods.stories.d.ts +0 -4
  422. package/dist/molecules/PriceRange/stories/PriceRange.stories.d.ts +0 -4
  423. package/dist/molecules/ProductCard/stories/ProductCard.stories.d.ts +0 -4
  424. package/dist/molecules/QuantitySelector/stories/QuantitySelector.stories.d.ts +0 -5
  425. package/dist/molecules/RadioGroup/stories/RadioGroup.stories.d.ts +0 -15
  426. package/dist/molecules/SearchInput/stories/SearchInput.stories.d.ts +0 -15
  427. package/dist/molecules/Table/stories/Table.stories.d.ts +0 -12
  428. package/dist/organisms/Hero/stories/Hero.stories.d.ts +0 -4
  429. package/dist/organisms/OutOfStock/stories/OutOfStock.stories.d.ts +0 -10
  430. package/dist/ui.cjs.development.js +0 -2109
  431. package/dist/ui.cjs.development.js.map +0 -1
  432. package/dist/ui.cjs.production.min.js +0 -2
  433. package/dist/ui.cjs.production.min.js.map +0 -1
  434. package/dist/ui.esm.js +0 -2037
  435. package/dist/ui.esm.js.map +0 -1
@@ -0,0 +1,43 @@
1
+ import { printReceived, matcherHint } from 'jest-matcher-utils';
2
+ import chalk from 'chalk';
3
+ // This code is based on jest-axe library.
4
+ // https://github.com/nickcolley/jest-axe
5
+ export const toHaveNoIncompletes = {
6
+ toHaveNoIncompletes: (results) => {
7
+ if (typeof results.incomplete === 'undefined') {
8
+ throw new Error('No incompletes found in aXe results object');
9
+ }
10
+ const reporter = (incompletes) => {
11
+ if (incompletes.length === 0) {
12
+ return [];
13
+ }
14
+ const lineBreak = '\n\n';
15
+ const horizontalLine = '\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500';
16
+ return incompletes
17
+ .map((incomplete) => {
18
+ const errorBody = incomplete.nodes
19
+ .map((node) => {
20
+ const selector = node.target.join(', ');
21
+ const expectedText = `Expected the HTML found at $('${selector}') to have no incompletes:${lineBreak}`;
22
+ return `${expectedText + chalk.grey(node.html) + lineBreak}Received:${lineBreak}${printReceived(`${incomplete.help} (${incomplete.id})`)}${lineBreak}${chalk.yellow(node.failureSummary)}${lineBreak}${incomplete.helpUrl
23
+ ? `You can find more information on this issue here: \n${chalk.blue(incomplete.helpUrl)}`
24
+ : ''}`;
25
+ })
26
+ .join(lineBreak);
27
+ return errorBody;
28
+ })
29
+ .join(lineBreak + horizontalLine + lineBreak);
30
+ };
31
+ const { incomplete: incompletes } = results;
32
+ const formatedIncompletes = reporter(incompletes);
33
+ const pass = formatedIncompletes.length === 0;
34
+ const message = () => {
35
+ if (pass) {
36
+ return '';
37
+ }
38
+ return (`${matcherHint('.toHaveNoIncompletes')}\n\n` + `${formatedIncompletes}`);
39
+ };
40
+ return { actual: incompletes, message, pass };
41
+ },
42
+ };
43
+ //# sourceMappingURL=toHaveNoIncomplete.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toHaveNoIncomplete.js","sourceRoot":"","sources":["../../src/utils/toHaveNoIncomplete.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAC/D,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,0CAA0C;AAC1C,yCAAyC;AACzC,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,mBAAmB,EAAE,CAAC,OAAmB,EAAE,EAAE;QAC3C,IAAI,OAAO,OAAO,CAAC,UAAU,KAAK,WAAW,EAAE;YAC7C,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAA;SAC9D;QAED,MAAM,QAAQ,GAAG,CAAC,WAAqC,EAAE,EAAE;YACzD,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC5B,OAAO,EAAE,CAAA;aACV;YAED,MAAM,SAAS,GAAG,MAAM,CAAA;YACxB,MAAM,cAAc,GAAG,kDAAkD,CAAA;YAEzE,OAAO,WAAW;iBACf,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE;gBAClB,MAAM,SAAS,GAAG,UAAU,CAAC,KAAK;qBAC/B,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;oBACZ,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;oBACvC,MAAM,YAAY,GAAG,iCAAiC,QAAQ,6BAA6B,SAAS,EAAE,CAAA;oBAEtG,OAAO,GACL,YAAY,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,SACzC,YAAY,SAAS,GAAG,aAAa,CACnC,GAAG,UAAU,CAAC,IAAI,KAAK,UAAU,CAAC,EAAE,GAAG,CACxC,GAAG,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,GAAG,SAAS,GAC3D,UAAU,CAAC,OAAO;wBAChB,CAAC,CAAC,uDAAuD,KAAK,CAAC,IAAI,CAC/D,UAAU,CAAC,OAAO,CACnB,EAAE;wBACL,CAAC,CAAC,EACN,EAAE,CAAA;gBACJ,CAAC,CAAC;qBACD,IAAI,CAAC,SAAS,CAAC,CAAA;gBAElB,OAAO,SAAS,CAAA;YAClB,CAAC,CAAC;iBACD,IAAI,CAAC,SAAS,GAAG,cAAc,GAAG,SAAS,CAAC,CAAA;QACjD,CAAC,CAAA;QAED,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,GAAG,OAAO,CAAA;QAC3C,MAAM,mBAAmB,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAA;QACjD,MAAM,IAAI,GAAG,mBAAmB,CAAC,MAAM,KAAK,CAAC,CAAA;QAE7C,MAAM,OAAO,GAAG,GAAG,EAAE;YACnB,IAAI,IAAI,EAAE;gBACR,OAAO,EAAE,CAAA;aACV;YAED,OAAO,CACL,GAAG,WAAW,CAAC,sBAAsB,CAAC,MAAM,GAAG,GAAG,mBAAmB,EAAE,CACxE,CAAA;QACH,CAAC,CAAA;QAED,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,IAAI,EAAE,CAAA;IAC/C,CAAC;CACF,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faststore/ui",
3
- "version": "1.9.8",
3
+ "version": "1.9.11",
4
4
  "description": "A lightweight, framework agnostic component library for React",
5
5
  "author": "emersonlaurentino",
6
6
  "license": "MIT",
@@ -10,8 +10,7 @@
10
10
  "directory": "packages/ui"
11
11
  },
12
12
  "browserslist": "supports es6-module and not dead and last 2 version",
13
- "main": "dist/index.js",
14
- "module": "dist/ui.esm.js",
13
+ "module": "dist/index.js",
15
14
  "typings": "dist/index.d.ts",
16
15
  "sideEffects": false,
17
16
  "engines": {
@@ -43,11 +42,7 @@
43
42
  },
44
43
  "size-limit": [
45
44
  {
46
- "path": "dist/ui.cjs.production.min.js",
47
- "limit": "20 KB"
48
- },
49
- {
50
- "path": "dist/ui.esm.js",
45
+ "path": "dist/index.js",
51
46
  "limit": "20 KB"
52
47
  }
53
48
  ],
@@ -62,7 +57,7 @@
62
57
  "react-dom": "^17.0.2"
63
58
  },
64
59
  "devDependencies": {
65
- "@size-limit/preset-small-lib": "^4.11.0",
60
+ "@size-limit/preset-small-lib": "^7.0.8",
66
61
  "@storybook/addon-actions": "^6.4.4",
67
62
  "@storybook/addon-docs": "^6.4.4",
68
63
  "@storybook/addon-essentials": "^6.4.4",
@@ -85,10 +80,10 @@
85
80
  "react": "^17.0.2",
86
81
  "react-docgen-typescript-loader": "^3.7.2",
87
82
  "react-dom": "^17.0.2",
88
- "size-limit": "^4.11.0",
83
+ "size-limit": "^7.0.8",
89
84
  "storybook-addon-themes": "^6.1.0",
90
85
  "tsdx": "^0.14.1",
91
86
  "typescript": "^4.2.4"
92
87
  },
93
- "gitHead": "f8e0cb3d43978426228addcc28055e537eaf7752"
88
+ "gitHead": "78e4520e4588669f0f3382ccd441737b98c57d11"
94
89
  }
@@ -4,16 +4,27 @@ import React from 'react'
4
4
 
5
5
  import Slider from './Slider'
6
6
 
7
+ const props = {
8
+ min: {
9
+ absolute: 0,
10
+ selected: 0,
11
+ },
12
+ max: {
13
+ absolute: 100,
14
+ selected: 100,
15
+ },
16
+ }
17
+
7
18
  describe('Slider', () => {
8
19
  it('`data-store-slider` is present', () => {
9
- const { getByTestId } = render(<Slider min={0} max={100} />)
20
+ const { getByTestId } = render(<Slider {...props} />)
10
21
 
11
22
  expect(getByTestId('store-slider')).toHaveAttribute('data-store-slider')
12
23
  })
13
24
 
14
25
  describe('Accessibility', () => {
15
26
  it('should have no violations', async () => {
16
- const { getByTestId } = render(<Slider min={0} max={100} />)
27
+ const { getByTestId } = render(<Slider {...props} />)
17
28
 
18
29
  expect(await axe(getByTestId('store-slider'))).toHaveNoViolations()
19
30
  })
@@ -1,18 +1,22 @@
1
1
  /**
2
2
  * This code is inspired by the work of [sandra-lewis](https://codesandbox.io/u/sandra-lewis)
3
3
  */
4
+ import React, { useState, useMemo } from 'react'
4
5
 
5
- import React, { useCallback, useEffect, useRef, useState } from 'react'
6
+ interface Range {
7
+ absolute: number
8
+ selected: number
9
+ }
6
10
 
7
11
  export type SliderProps = {
8
12
  /**
9
13
  * The minimum value of the slider.
10
14
  */
11
- min: number
15
+ min: Range
12
16
  /**
13
17
  * The maximum value of the slider.
14
18
  */
15
- max: number
19
+ max: Range
16
20
  /**
17
21
  * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
18
22
  *
@@ -23,6 +27,10 @@ export type SliderProps = {
23
27
  * Callback that fires when the slider value changes.
24
28
  */
25
29
  onChange?: (value: { min: number; max: number }) => void
30
+ /**
31
+ * Callback that fires when the slider value ends changing.
32
+ */
33
+ onEnd?: (value: { min: number; max: number }) => void
26
34
  /**
27
35
  * A function used to set a human-readable value text based on the slider's current value.
28
36
  */
@@ -33,93 +41,80 @@ export type SliderProps = {
33
41
  className?: string
34
42
  }
35
43
 
44
+ const percent = (value: number, min: number, max: number) =>
45
+ Math.round(((value - min) / (max - min)) * 100)
46
+
36
47
  const Slider = ({
37
48
  min,
38
49
  max,
39
50
  onChange,
51
+ onEnd,
40
52
  testId = 'store-slider',
41
53
  getAriaValueText,
42
54
  className,
43
55
  }: SliderProps) => {
44
- const [minVal, setMinVal] = useState(min)
45
- const [maxVal, setMaxVal] = useState(max)
46
-
47
- const minValRef = useRef(min)
48
- const maxValRef = useRef(max)
49
- const range = useRef<HTMLDivElement>(null)
50
-
51
- const getPercent = useCallback(
52
- (value: number) => Math.round(((value - min) / (max - min)) * 100),
53
- [min, max]
56
+ const [minPercent, setMinPercent] = useState(() =>
57
+ percent(min.selected, min.absolute, max.absolute)
54
58
  )
55
59
 
56
- // width of the range to reduce from the left side
57
- useEffect(() => {
58
- const minPercent = getPercent(minVal)
59
- const maxPercent = getPercent(maxValRef.current)
60
-
61
- if (range.current) {
62
- range.current.style.left = `${minPercent}%`
63
- range.current.style.width = `${maxPercent - minPercent}%`
64
- }
65
- }, [minVal, getPercent])
60
+ const [maxPercent, setMaxPercent] = useState(() =>
61
+ percent(max.selected, min.absolute, max.absolute)
62
+ )
66
63
 
67
- // width of the range to reduce from the right side
68
- useEffect(() => {
69
- const minPercent = getPercent(minValRef.current)
70
- const maxPercent = getPercent(maxVal)
64
+ const { minVal, maxVal } = useMemo(() => {
65
+ const widthPercent = (max.absolute - min.absolute) / 100
71
66
 
72
- if (range.current) {
73
- range.current.style.width = `${maxPercent - minPercent}%`
67
+ return {
68
+ minVal: min.absolute + minPercent * widthPercent,
69
+ maxVal: min.absolute + maxPercent * widthPercent,
74
70
  }
75
- }, [maxVal, getPercent])
76
-
77
- useEffect(() => {
78
- onChange?.({ min: minVal, max: maxVal })
79
- }, [minVal, maxVal, onChange])
71
+ }, [min, max, maxPercent, minPercent])
80
72
 
81
73
  return (
82
74
  <div data-store-slider data-testid={testId} className={className}>
83
- <div ref={range} data-slider-range />
75
+ <div
76
+ style={{ left: `${minPercent}%`, width: `${maxPercent - minPercent}%` }}
77
+ data-slider-range
78
+ />
84
79
  <input
85
80
  type="range"
86
- min={min}
87
- max={max}
81
+ min={min.absolute}
82
+ max={max.absolute}
88
83
  value={minVal}
84
+ onMouseUp={() => onEnd?.({ min: minVal, max: maxVal })}
85
+ onTouchEnd={() => onEnd?.({ min: minVal, max: maxVal })}
89
86
  onChange={(event) => {
90
- const value = Math.min(Number(event.target.value), maxVal - 1)
87
+ const minValue = Math.min(Number(event.target.value), maxVal)
91
88
 
92
- setMinVal(value)
93
- minValRef.current = value
89
+ setMinPercent(percent(minValue, min.absolute, max.absolute))
90
+ onChange?.({ min: minValue, max: maxVal })
94
91
  }}
95
92
  data-slider-thumb="left"
96
- aria-valuemin={min}
97
- aria-valuemax={max}
93
+ aria-valuemin={min.absolute}
94
+ aria-valuemax={max.absolute}
98
95
  aria-valuenow={minVal}
99
96
  aria-label={String(minVal)}
100
- aria-labelledby={
101
- getAriaValueText ? getAriaValueText(minVal, 'min') : undefined
102
- }
97
+ aria-labelledby={getAriaValueText?.(minVal, 'min')}
103
98
  />
104
99
  <input
105
100
  type="range"
106
- min={min}
107
- max={max}
101
+ min={min.absolute}
102
+ max={max.absolute}
108
103
  value={maxVal}
104
+ onMouseUp={() => onEnd?.({ min: minVal, max: maxVal })}
105
+ onTouchEnd={() => onEnd?.({ min: minVal, max: maxVal })}
109
106
  onChange={(event) => {
110
- const value = Math.max(Number(event.target.value), minVal + 1)
107
+ const maxValue = Math.max(Number(event.target.value), minVal)
111
108
 
112
- setMaxVal(value)
113
- maxValRef.current = value
109
+ setMaxPercent(percent(maxValue, min.absolute, max.absolute))
110
+ onChange?.({ min: minVal, max: maxValue })
114
111
  }}
115
112
  data-slider-thumb="right"
116
- aria-valuemin={min}
117
- aria-valuemax={max}
113
+ aria-valuemin={min.absolute}
114
+ aria-valuemax={max.absolute}
118
115
  aria-valuenow={maxVal}
119
116
  aria-label={String(maxVal)}
120
- aria-labelledby={
121
- getAriaValueText ? getAriaValueText(maxVal, 'max') : undefined
122
- }
117
+ aria-labelledby={getAriaValueText?.(maxVal, 'max')}
123
118
  />
124
119
  </div>
125
120
  )
@@ -72,9 +72,8 @@ const AggregateRatingWithoutIconTemplate: Story<AggregateRatingProps> = ({
72
72
  )
73
73
  }
74
74
 
75
- export const AggregateRatingWithoutIcon = AggregateRatingWithoutIconTemplate.bind(
76
- {}
77
- )
75
+ export const AggregateRatingWithoutIcon =
76
+ AggregateRatingWithoutIconTemplate.bind({})
78
77
  AggregateRatingWithoutIcon.args = { value: 3 }
79
78
 
80
79
  const AggregateRatingWithCSSTemplate: Story<AggregateRatingProps> = ({
@@ -51,9 +51,10 @@ const Bullets = forwardRef<HTMLDivElement, BulletsProps>(function Bullets(
51
51
  },
52
52
  ref
53
53
  ) {
54
- const bulletIndexes = useMemo(() => Array(totalQuantity).fill(0), [
55
- totalQuantity,
56
- ])
54
+ const bulletIndexes = useMemo(
55
+ () => Array(totalQuantity).fill(0),
56
+ [totalQuantity]
57
+ )
57
58
 
58
59
  return (
59
60
  <div
@@ -16,11 +16,8 @@ const DropdownItem = forwardRef<HTMLButtonElement, DropdownItemProps>(
16
16
  { children, onClick, testId = 'store-dropdown-item', ...otherProps },
17
17
  ref
18
18
  ) {
19
- const {
20
- dropdownItemsRef,
21
- selectedDropdownItemIndexRef,
22
- close,
23
- } = useDropdown()
19
+ const { dropdownItemsRef, selectedDropdownItemIndexRef, close } =
20
+ useDropdown()
24
21
 
25
22
  const [dropdownItemIndex, setDropdownItemIndex] = useState(0)
26
23
  const dropdownItemRef = useRef<HTMLButtonElement>()
@@ -44,13 +44,8 @@ const DropdownMenu = ({
44
44
  style,
45
45
  ...otherProps
46
46
  }: PropsWithChildren<DropdownMenuProps>) => {
47
- const {
48
- isOpen,
49
- close,
50
- dropdownItemsRef,
51
- selectedDropdownItemIndexRef,
52
- id,
53
- } = useDropdown()
47
+ const { isOpen, close, dropdownItemsRef, selectedDropdownItemIndexRef, id } =
48
+ useDropdown()
54
49
 
55
50
  const dropdownPosition = useDropdownPosition()
56
51
 
@@ -13,8 +13,14 @@ function formatter(price: number) {
13
13
 
14
14
  const props = {
15
15
  formatter,
16
- min: 0,
17
- max: 100,
16
+ min: {
17
+ absolute: 0,
18
+ selected: 0,
19
+ },
20
+ max: {
21
+ absolute: 100,
22
+ selected: 100,
23
+ },
18
24
  ariaLabel: 'My price range',
19
25
  }
20
26
 
@@ -1,10 +1,10 @@
1
- import type { AriaAttributes } from 'react'
2
1
  import React, { useState } from 'react'
2
+ import type { AriaAttributes } from 'react'
3
3
 
4
- import type { PriceProps } from '../../atoms/Price'
5
4
  import Price from '../../atoms/Price'
6
- import type { SliderProps } from '../../atoms/Slider'
7
5
  import Slider from '../../atoms/Slider'
6
+ import type { PriceProps } from '../../atoms/Price'
7
+ import type { SliderProps } from '../../atoms/Slider'
8
8
 
9
9
  export type PriceRangeProps = SliderProps & {
10
10
  /**
@@ -31,44 +31,36 @@ const PriceRange = ({
31
31
  max,
32
32
  min,
33
33
  onChange,
34
+ onEnd,
34
35
  testId = 'store-price-range',
35
36
  variant,
36
37
  'aria-label': ariaLabel,
37
38
  }: PriceRangeProps) => {
38
- const [minVal, setMinVal] = useState(min)
39
- const [maxVal, setMaxVal] = useState(max)
40
-
41
- const handleChange: SliderProps['onChange'] = (values) => {
42
- if (values.min !== minVal) {
43
- setMinVal(values.min)
44
- }
45
-
46
- if (values.max !== maxVal) {
47
- setMaxVal(values.max)
48
- }
49
-
50
- onChange?.(values)
51
- }
39
+ const [edges, setEdges] = useState({ min: min.selected, max: max.selected })
52
40
 
53
41
  return (
54
42
  <div data-store-price-range data-testid={testId} className={className}>
55
43
  <Slider
56
44
  min={min}
57
45
  max={max}
58
- onChange={handleChange}
46
+ onEnd={onEnd}
47
+ onChange={(value) => {
48
+ setEdges(value)
49
+ onChange?.(value)
50
+ }}
59
51
  aria-label={ariaLabel}
60
52
  />
61
53
  <div data-price-range-values>
62
54
  <Price
63
55
  formatter={formatter}
64
56
  data-price-range-value="min"
65
- value={minVal}
57
+ value={edges.min}
66
58
  variant={variant}
67
59
  />
68
60
  <Price
69
61
  formatter={formatter}
70
62
  data-price-range-value="max"
71
- value={maxVal}
63
+ value={edges.max}
72
64
  variant={variant}
73
65
  />
74
66
  </div>
@@ -46,6 +46,5 @@ export type PolymorphicComponentPropsWithRef<
46
46
  > = PolymorphicComponentProps<C, P> & { ref?: ComponentPropsWithRef<C>['ref'] }
47
47
 
48
48
  // Extract the `ref` prop from a polymorphic component
49
- export type PolymorphicRef<
50
- C extends ElementType
51
- > = PolymorphicComponentPropsWithRef<C>['ref']
49
+ export type PolymorphicRef<C extends ElementType> =
50
+ PolymorphicComponentPropsWithRef<C>['ref']
@@ -1,17 +0,0 @@
1
- /// <reference types="react" />
2
- import type { ComponentArgTypes } from '../../../typings/utils';
3
- interface StoryControls {
4
- badgeText: string;
5
- }
6
- export declare const Badge: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, StoryControls>;
7
- declare const _default: {
8
- title: string;
9
- component: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, StoryControls>;
10
- argTypes: ComponentArgTypes<StoryControls>;
11
- parameters: {
12
- docs: {
13
- page: (props: any) => JSX.Element;
14
- };
15
- };
16
- };
17
- export default _default;
@@ -1,14 +0,0 @@
1
- /// <reference types="react" />
2
- import type { ComponentArgTypes } from '../../../typings/utils';
3
- import type { ButtonProps } from '../Button';
4
- export declare const Button: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, ButtonProps<HTMLButtonElement>>;
5
- declare const _default: {
6
- title: string;
7
- argTypes: ComponentArgTypes<ButtonProps<HTMLButtonElement>>;
8
- parameters: {
9
- docs: {
10
- page: (props: any) => JSX.Element;
11
- };
12
- };
13
- };
14
- export default _default;
@@ -1,4 +0,0 @@
1
- import type { CheckboxProps } from '../Checkbox';
2
- export declare const Checkbox: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, CheckboxProps>;
3
- declare const _default: import("@storybook/csf").ComponentAnnotations<import("@storybook/react").ReactFramework, import("@storybook/react").Args>;
4
- export default _default;
@@ -1,14 +0,0 @@
1
- /// <reference types="react" />
2
- import type { IconProps } from '../Icon';
3
- import type { ComponentArgTypes } from '../../../typings/utils';
4
- export declare const Icon: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, IconProps>;
5
- declare const _default: {
6
- title: string;
7
- argTypes: ComponentArgTypes<Pick<IconProps, "testId" | "children" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "css">>;
8
- parameters: {
9
- docs: {
10
- page: (props: any) => JSX.Element;
11
- };
12
- };
13
- };
14
- export default _default;
@@ -1,4 +0,0 @@
1
- import type { IncentiveProps } from '../Incentive';
2
- export declare const Incentive: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, IncentiveProps>;
3
- declare const _default: import("@storybook/csf").ComponentAnnotations<import("@storybook/react").ReactFramework, import("@storybook/react").Args>;
4
- export default _default;
@@ -1,14 +0,0 @@
1
- /// <reference types="react" />
2
- import type { ComponentArgTypes } from '../../../typings/utils';
3
- import type { InputProps } from '../Input';
4
- export declare const Input: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, InputProps>;
5
- declare const _default: {
6
- title: string;
7
- argTypes: ComponentArgTypes<InputProps>;
8
- parameters: {
9
- docs: {
10
- page: (props: any) => JSX.Element;
11
- };
12
- };
13
- };
14
- export default _default;
@@ -1,14 +0,0 @@
1
- /// <reference types="react" />
2
- import type { ComponentArgTypes } from '../../../typings/utils';
3
- import type { LabelProps } from '../Label';
4
- export declare const Label: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, LabelProps>;
5
- declare const _default: {
6
- title: string;
7
- argTypes: ComponentArgTypes<LabelProps>;
8
- parameters: {
9
- docs: {
10
- page: (props: any) => JSX.Element;
11
- };
12
- };
13
- };
14
- export default _default;
@@ -1,22 +0,0 @@
1
- /// <reference types="react" />
2
- import type { ComponentArgTypes } from '../../../typings/utils';
3
- import type { ListProps } from '../List';
4
- declare type ListStoryProps = ListProps & {
5
- options: string[];
6
- };
7
- declare type DescriptionListStoryProps = ListProps & {
8
- options: string[][];
9
- };
10
- export declare const UnorderedList: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, ListStoryProps>;
11
- export declare const OrderedList: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, ListStoryProps>;
12
- export declare const DescriptionList: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, DescriptionListStoryProps>;
13
- declare const _default: {
14
- title: string;
15
- argTypes: ComponentArgTypes<ListStoryProps>;
16
- parameters: {
17
- docs: {
18
- page: (props: any) => JSX.Element;
19
- };
20
- };
21
- };
22
- export default _default;
@@ -1,8 +0,0 @@
1
- import type { Props as OverlayProps } from '../Overlay';
2
- declare type ColorType = 'black' | 'green';
3
- declare type OverlayStoryProps = OverlayProps & {
4
- color: ColorType;
5
- };
6
- export declare const Overlay: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, OverlayStoryProps>;
7
- declare const _default: import("@storybook/csf").ComponentAnnotations<import("@storybook/react").ReactFramework, import("@storybook/react").Args>;
8
- export default _default;
@@ -1,14 +0,0 @@
1
- /// <reference types="react" />
2
- import type { PopoverProps } from '../Popover';
3
- import type { ComponentArgTypes } from '../../../typings/utils';
4
- export declare const Popover: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, PopoverProps>;
5
- declare const _default: {
6
- title: string;
7
- argTypes: ComponentArgTypes<Pick<PopoverProps, "testId" | "children" | "hidden" | "unstable_observableRefs">>;
8
- parameters: {
9
- docs: {
10
- page: (props: any) => JSX.Element;
11
- };
12
- };
13
- };
14
- export default _default;
@@ -1,18 +0,0 @@
1
- /// <reference types="react" />
2
- import type { Story } from '@storybook/react';
3
- import type { PriceProps } from '../Price';
4
- import type { ComponentArgTypes } from '../../../typings/utils';
5
- export declare const Default: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, PriceProps>;
6
- export declare const INTLFormatted: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, PriceProps>;
7
- export declare const INTLFormattedToParts: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, PriceProps>;
8
- export declare const Custom: Story<PriceProps>;
9
- declare const _default: {
10
- title: string;
11
- argTypes: ComponentArgTypes<Pick<PriceProps, "testId" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "css" | "variant" | "as" | "formatter">>;
12
- parameters: {
13
- docs: {
14
- page: (props: any) => JSX.Element;
15
- };
16
- };
17
- };
18
- export default _default;