@veeqo/ui 0.0.1 → 0.0.4

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 (777) hide show
  1. package/.eslintrc.json +105 -0
  2. package/.storybook/Intro.mdx +22 -0
  3. package/.storybook/main.ts +1 -1
  4. package/.storybook/preview.ts +7 -0
  5. package/CHANGELOG.md +29 -0
  6. package/README.md +77 -0
  7. package/jest.config.js +16 -0
  8. package/lib/components/Accordion/Accordion.d.ts +12 -0
  9. package/lib/components/Accordion/index.d.ts +1 -0
  10. package/lib/components/Accordion/styled.d.ts +12 -0
  11. package/lib/components/ActionList/ActionList.d.ts +3 -0
  12. package/lib/components/ActionList/index.d.ts +1 -0
  13. package/lib/components/ActionList/styled.d.ts +36 -0
  14. package/lib/components/ActionList/types.d.ts +19 -0
  15. package/lib/components/Anchor/Anchor.d.ts +9 -0
  16. package/lib/components/Anchor/index.d.ts +1 -0
  17. package/lib/components/Anchor/styled.d.ts +1 -0
  18. package/lib/components/AnimatedDropdown/AnimatedDropdown.d.ts +3 -0
  19. package/lib/components/AnimatedDropdown/components/BasicDropdown.d.ts +5 -0
  20. package/lib/components/AnimatedDropdown/components/styled.d.ts +1 -0
  21. package/lib/components/AnimatedDropdown/index.d.ts +1 -0
  22. package/lib/components/AnimatedDropdown/styled.d.ts +10 -0
  23. package/lib/components/AnimatedDropdown/types.d.ts +14 -0
  24. package/lib/components/Avatar/Avatar.d.ts +3 -0
  25. package/lib/components/Avatar/index.d.ts +1 -0
  26. package/lib/components/Avatar/styled.d.ts +2 -0
  27. package/lib/components/Avatar/types.d.ts +11 -0
  28. package/lib/components/Badge/Badge.d.ts +3 -0
  29. package/lib/components/Badge/index.d.ts +1 -0
  30. package/lib/components/Badge/styled.d.ts +7 -0
  31. package/lib/components/Badge/types.d.ts +35 -0
  32. package/lib/components/Banner/Banner.d.ts +6 -0
  33. package/lib/components/Banner/index.d.ts +1 -0
  34. package/lib/components/Banner/styled.d.ts +7 -0
  35. package/lib/components/Banner/types.d.ts +20 -0
  36. package/lib/components/BaseContainer/BaseContainer.d.ts +1 -0
  37. package/lib/components/BaseContainer/index.d.ts +1 -0
  38. package/lib/components/Breadcrumbs/Breadcrumbs.d.ts +3 -0
  39. package/lib/components/Breadcrumbs/components/Breadcrumb.d.ts +3 -0
  40. package/lib/components/Breadcrumbs/components/styled.d.ts +2 -0
  41. package/lib/components/Breadcrumbs/index.d.ts +1 -0
  42. package/lib/components/Breadcrumbs/types.d.ts +22 -0
  43. package/lib/components/Button/Button.d.ts +9 -0
  44. package/lib/components/Button/components/styled.d.ts +20 -0
  45. package/lib/components/Button/index.d.ts +1 -0
  46. package/lib/components/Button/types.d.ts +18 -0
  47. package/lib/components/Card/Card.d.ts +28 -0
  48. package/lib/components/Card/index.d.ts +1 -0
  49. package/lib/components/Card/styled.d.ts +16 -0
  50. package/lib/components/CardHeader/CardHeader.d.ts +19 -0
  51. package/lib/components/CardHeader/index.d.ts +1 -0
  52. package/lib/components/CardHeader/styled.d.ts +2 -0
  53. package/lib/components/Checkbox/Checkbox.d.ts +13 -0
  54. package/lib/components/Checkbox/index.d.ts +1 -0
  55. package/lib/components/Checkbox/styled.d.ts +1 -0
  56. package/lib/components/Choice/Choice.d.ts +17 -0
  57. package/lib/components/Choice/components/styled.d.ts +17 -0
  58. package/lib/components/Choice/index.d.ts +1 -0
  59. package/lib/components/ChoiceList/ChoiceList.d.ts +29 -0
  60. package/lib/components/ChoiceList/index.d.ts +1 -0
  61. package/lib/components/ChoiceList/styled.d.ts +2 -0
  62. package/lib/components/CopyToClipboard/CopyToClipboard.d.ts +10 -0
  63. package/lib/components/CopyToClipboard/index.d.ts +1 -0
  64. package/lib/components/DataTable/DataTable.d.ts +21 -0
  65. package/lib/components/DataTable/SkeletonContent/SkeletonContent.d.ts +7 -0
  66. package/lib/components/DataTable/SkeletonContent/index.d.ts +1 -0
  67. package/lib/components/DataTable/SpecificState/SpecificState.d.ts +7 -0
  68. package/lib/components/DataTable/SpecificState/index.d.ts +1 -0
  69. package/lib/components/DataTable/SpecificState/styled.d.ts +8 -0
  70. package/lib/components/DataTable/StickyHeader.d.ts +10 -0
  71. package/lib/components/DataTable/cells/ClickableCell.d.ts +7 -0
  72. package/lib/components/DataTable/cells/EditableCell.d.ts +7 -0
  73. package/lib/components/DataTable/cells/SkeletonCell.d.ts +11 -0
  74. package/lib/components/DataTable/cells/SkeletonHeaderCell.d.ts +8 -0
  75. package/lib/components/DataTable/cells/index.d.ts +3 -0
  76. package/lib/components/DataTable/cells/styled.d.ts +1 -0
  77. package/lib/components/DataTable/index.d.ts +1 -0
  78. package/lib/components/DataTable/styled.d.ts +46 -0
  79. package/lib/components/DataTable/utils/constants.d.ts +9 -0
  80. package/lib/components/DataTable/utils/hooks.d.ts +4 -0
  81. package/lib/components/DataTable/utils/index.d.ts +2 -0
  82. package/lib/components/DataTable/utils/types.d.ts +106 -0
  83. package/lib/components/DataTableExp/DataTable.d.ts +22 -0
  84. package/lib/components/DataTableExp/components/ActionBar.d.ts +9 -0
  85. package/lib/components/DataTableExp/components/Cell.d.ts +7 -0
  86. package/lib/components/DataTableExp/components/ColumnHeader.d.ts +6 -0
  87. package/lib/components/DataTableExp/components/ColumnMenu.d.ts +8 -0
  88. package/lib/components/DataTableExp/components/EmptyBodyContent.d.ts +5 -0
  89. package/lib/components/DataTableExp/components/Header.d.ts +2 -0
  90. package/lib/components/DataTableExp/components/LoadingCellContent.d.ts +1 -0
  91. package/lib/components/DataTableExp/components/NoWrap.d.ts +1 -0
  92. package/lib/components/DataTableExp/components/Row.d.ts +7 -0
  93. package/lib/components/DataTableExp/components/ScrollContainer.d.ts +1 -0
  94. package/lib/components/DataTableExp/components/SelectionCell.d.ts +11 -0
  95. package/lib/components/DataTableExp/components/SelectionHeader.d.ts +3 -0
  96. package/lib/components/DataTableExp/components/StickyHead.d.ts +9 -0
  97. package/lib/components/DataTableExp/components/TableGrid.d.ts +4 -0
  98. package/lib/components/DataTableExp/components/Truncate.d.ts +1 -0
  99. package/lib/components/DataTableExp/components/Wrapper.d.ts +5 -0
  100. package/lib/components/DataTableExp/constants.d.ts +3 -0
  101. package/lib/components/DataTableExp/hooks/index.d.ts +6 -0
  102. package/lib/components/DataTableExp/hooks/useCellWidths.d.ts +2 -0
  103. package/lib/components/DataTableExp/hooks/useColumns.d.ts +6 -0
  104. package/lib/components/DataTableExp/hooks/useDragToScroll.d.ts +2 -0
  105. package/lib/components/DataTableExp/hooks/useNested.d.ts +7 -0
  106. package/lib/components/DataTableExp/hooks/useScrollPosition.d.ts +6 -0
  107. package/lib/components/DataTableExp/hooks/useSelection.d.ts +12 -0
  108. package/lib/components/DataTableExp/index.d.ts +1 -0
  109. package/lib/components/DataTableExp/renderers/index.d.ts +5 -0
  110. package/lib/components/DataTableExp/renderers/renderCell.d.ts +10 -0
  111. package/lib/components/DataTableExp/renderers/renderFooter.d.ts +13 -0
  112. package/lib/components/DataTableExp/renderers/renderHeader.d.ts +15 -0
  113. package/lib/components/DataTableExp/renderers/renderLoadingCell.d.ts +9 -0
  114. package/lib/components/DataTableExp/renderers/renderNestedCell.d.ts +10 -0
  115. package/lib/components/DataTableExp/types.d.ts +116 -0
  116. package/lib/components/DataTableExp/utils/GetSortIcon.d.ts +9 -0
  117. package/lib/components/DataTableExp/utils/alignmentToFlex.d.ts +2 -0
  118. package/lib/components/DataTableExp/utils/generateTableCss.d.ts +10 -0
  119. package/lib/components/DataTableExp/utils/getNextSortState.d.ts +7 -0
  120. package/lib/components/DataTableExp/utils/getRowState.d.ts +10 -0
  121. package/lib/components/DataTableExp/utils/index.d.ts +6 -0
  122. package/lib/components/DataTableExp/utils/parseWidth.d.ts +1 -0
  123. package/lib/components/DataTableExp/utils/sumAll.d.ts +2 -0
  124. package/lib/components/DescriptionList/DescriptionList.d.ts +11 -0
  125. package/lib/components/DescriptionList/index.d.ts +1 -0
  126. package/lib/components/DetailPage/DetailPage.d.ts +6 -0
  127. package/lib/components/DetailPage/index.d.ts +1 -0
  128. package/lib/components/DetailPage/styled.d.ts +2 -0
  129. package/lib/components/DimensionsInput/DimensionsInput.d.ts +3 -0
  130. package/lib/components/DimensionsInput/index.d.ts +1 -0
  131. package/lib/components/DimensionsInput/styled.d.ts +34 -0
  132. package/lib/components/DimensionsInput/types.d.ts +15 -0
  133. package/lib/components/FilterTag/FilterTag.d.ts +8 -0
  134. package/lib/components/FilterTag/index.d.ts +1 -0
  135. package/lib/components/FilterTag/styled.d.ts +12 -0
  136. package/lib/components/FilterTag/types.d.ts +14 -0
  137. package/lib/components/Grid/index.d.ts +2 -0
  138. package/lib/components/Grid/types.d.ts +8 -0
  139. package/lib/components/Image/Image.d.ts +20 -0
  140. package/lib/components/Image/components/PlaceholderImage.d.ts +2 -0
  141. package/lib/components/Image/components/styled.d.ts +6 -0
  142. package/lib/components/Image/index.d.ts +1 -0
  143. package/lib/components/Image/types.d.ts +6 -0
  144. package/lib/components/Image/utils.d.ts +2 -0
  145. package/lib/components/InputGroup/index.d.ts +1 -0
  146. package/lib/components/Loader/Grid.d.ts +1 -2
  147. package/lib/components/Loader/TailSpin.d.ts +1 -2
  148. package/lib/components/Loader/ThreeDots.d.ts +1 -2
  149. package/lib/components/LoginWithAmazonButton/LoginWithAmazonButton.d.ts +7 -0
  150. package/lib/components/LoginWithAmazonButton/index.d.ts +1 -0
  151. package/lib/components/LoginWithAmazonButton/styled.d.ts +1 -0
  152. package/lib/components/Modal/Modal.d.ts +3 -0
  153. package/lib/components/Modal/components/Dialog/Dialog.d.ts +8 -0
  154. package/lib/components/Modal/components/Dialog/constants.d.ts +44 -0
  155. package/lib/components/Modal/components/Dialog/styled.d.ts +24 -0
  156. package/lib/components/Modal/components/styled.d.ts +5 -0
  157. package/lib/components/Modal/index.d.ts +1 -0
  158. package/lib/components/Modal/types.d.ts +40 -0
  159. package/lib/components/PageHeader/PageHeader.d.ts +29 -0
  160. package/lib/components/PageHeader/index.d.ts +1 -0
  161. package/lib/components/PageHeader/styled.d.ts +23 -0
  162. package/lib/components/Pagination/Pagination.d.ts +3 -0
  163. package/lib/components/Pagination/components.d.ts +4 -0
  164. package/lib/components/Pagination/hooks/usePagination.d.ts +13 -0
  165. package/lib/components/Pagination/index.d.ts +1 -0
  166. package/lib/components/Pagination/styled.d.ts +29 -0
  167. package/lib/components/Pagination/types.d.ts +8 -0
  168. package/lib/components/PaginationRange/Items/Item/Item.d.ts +3 -0
  169. package/lib/components/PaginationRange/Items/Item/index.d.ts +1 -0
  170. package/lib/components/PaginationRange/Items/Item/styled.d.ts +3 -0
  171. package/lib/components/PaginationRange/Items/Item/types.d.ts +5 -0
  172. package/lib/components/PaginationRange/Items/Items.d.ts +7 -0
  173. package/lib/components/PaginationRange/Items/index.d.ts +1 -0
  174. package/lib/components/PaginationRange/PaginationRange.d.ts +9 -0
  175. package/lib/components/PaginationRange/index.d.ts +1 -0
  176. package/lib/components/PaginationRange/styled.d.ts +6 -0
  177. package/lib/components/PaginationRange/types.d.ts +15 -0
  178. package/lib/components/Popover/Popover.d.ts +15 -0
  179. package/lib/components/Popover/PopoverDemo.d.ts +3 -0
  180. package/lib/components/Popover/index.d.ts +1 -0
  181. package/lib/components/Portal/Portal.d.ts +20 -0
  182. package/lib/components/Portal/index.d.ts +1 -0
  183. package/lib/components/PriceInput/PriceInput.d.ts +3 -0
  184. package/lib/components/PriceInput/index.d.ts +1 -0
  185. package/lib/components/PriceInput/styled.d.ts +29 -0
  186. package/lib/components/PriceInput/types.d.ts +12 -0
  187. package/lib/components/Radio/Radio.d.ts +12 -0
  188. package/lib/components/Radio/index.d.ts +1 -0
  189. package/lib/components/Radio/styled.d.ts +1 -0
  190. package/lib/components/Search/Search.d.ts +3 -0
  191. package/lib/components/Search/index.d.ts +1 -0
  192. package/lib/components/Search/styled.d.ts +26 -0
  193. package/lib/components/Search/types.d.ts +9 -0
  194. package/lib/components/SegmentedControl/SegmentedControl.d.ts +3 -0
  195. package/lib/components/SegmentedControl/index.d.ts +1 -0
  196. package/lib/components/SegmentedControl/styled.d.ts +1 -0
  197. package/lib/components/SegmentedControl/types.d.ts +13 -0
  198. package/lib/components/Select/Select.d.ts +17 -0
  199. package/lib/components/Select/index.d.ts +1 -0
  200. package/lib/components/Select/styled.d.ts +1 -0
  201. package/lib/components/SimpleTable/SimpleTable.d.ts +15 -0
  202. package/lib/components/SimpleTable/index.d.ts +1 -0
  203. package/lib/components/SimpleTable/styled.d.ts +15 -0
  204. package/lib/components/SimpleTable/types.d.ts +6 -0
  205. package/lib/components/Slider/Slider.d.ts +3 -0
  206. package/lib/components/Slider/index.d.ts +1 -0
  207. package/lib/components/Slider/styled.d.ts +8 -0
  208. package/lib/components/Slider/types.d.ts +26 -0
  209. package/lib/components/Stack/Alignments.d.ts +1 -2
  210. package/lib/components/Stack/Stack.d.ts +1 -2
  211. package/lib/components/Stack/types.d.ts +1 -1
  212. package/lib/components/Stepper/Stepper.d.ts +9 -0
  213. package/lib/components/Stepper/index.d.ts +1 -0
  214. package/lib/components/Stepper/styled.d.ts +5 -0
  215. package/lib/components/Tag/Tag.d.ts +5 -0
  216. package/lib/components/Tag/index.d.ts +1 -0
  217. package/lib/components/Text/Text.d.ts +2 -0
  218. package/lib/components/Text/index.d.ts +1 -0
  219. package/lib/components/Text/textVariants.d.ts +4 -0
  220. package/lib/components/Text/types.d.ts +14 -0
  221. package/lib/components/Text/utils.d.ts +2 -0
  222. package/lib/components/TextField/TextField.d.ts +3 -0
  223. package/lib/components/TextField/index.d.ts +20 -0
  224. package/lib/components/TextField/styled.d.ts +2 -0
  225. package/lib/components/TextField/types.d.ts +26 -0
  226. package/lib/components/ToastsLayout/ToastsLayout.d.ts +3 -0
  227. package/lib/components/ToastsLayout/components/Toast.d.ts +3 -0
  228. package/lib/components/ToastsLayout/components/styled.d.ts +10 -0
  229. package/lib/components/ToastsLayout/index.d.ts +1 -0
  230. package/lib/components/ToastsLayout/types.d.ts +38 -0
  231. package/lib/components/Toggle/Toggle.d.ts +6 -0
  232. package/lib/components/Toggle/index.d.ts +1 -0
  233. package/lib/components/Toggle/styled.d.ts +11 -0
  234. package/lib/components/Toggle/types.d.ts +9 -0
  235. package/lib/components/ToggleButton/ToggleButton.d.ts +9 -0
  236. package/lib/components/ToggleButton/index.d.ts +1 -0
  237. package/lib/components/ToggleButton/styled.d.ts +1 -0
  238. package/lib/components/Tooltip/Tooltip.d.ts +2 -0
  239. package/lib/components/Tooltip/index.d.ts +1 -0
  240. package/lib/components/Tooltip/styled.d.ts +8 -0
  241. package/lib/components/Tooltip/types.d.ts +36 -0
  242. package/lib/components/VideoModal/VideoModal.d.ts +3 -0
  243. package/lib/components/VideoModal/VideoModalDemo.d.ts +2 -0
  244. package/lib/components/VideoModal/components/Popup.d.ts +8 -0
  245. package/lib/components/VideoModal/components/styled.d.ts +7 -0
  246. package/lib/components/VideoModal/index.d.ts +1 -0
  247. package/lib/components/VideoModal/styled.d.ts +11 -0
  248. package/lib/components/VideoModal/types.d.ts +9 -0
  249. package/lib/components/View/View.d.ts +11 -0
  250. package/lib/components/View/index.d.ts +1 -0
  251. package/lib/components/View/styled.d.ts +13 -0
  252. package/lib/components/View/types.d.ts +30 -0
  253. package/lib/components/WeightInput/WeightInput.d.ts +3 -0
  254. package/lib/components/WeightInput/index.d.ts +1 -0
  255. package/lib/components/WeightInput/styled.d.ts +33 -0
  256. package/lib/components/WeightInput/types.d.ts +21 -0
  257. package/lib/components/index.d.ts +50 -0
  258. package/lib/components/types.d.ts +20 -0
  259. package/lib/hoc/index.d.ts +2 -0
  260. package/lib/hoc/withDeprecated.d.ts +2 -0
  261. package/lib/hoc/withLabels/index.d.ts +1 -0
  262. package/lib/hoc/withLabels/styled.d.ts +5 -0
  263. package/lib/hoc/withLabels/withLabels.d.ts +8 -0
  264. package/lib/hooks/index.d.ts +7 -0
  265. package/lib/hooks/useClickOutside.d.ts +5 -0
  266. package/lib/hooks/useDebounce.d.ts +1 -0
  267. package/lib/hooks/useDropdown.d.ts +6 -0
  268. package/lib/hooks/useFocusVisible.d.ts +11 -0
  269. package/lib/hooks/useHover.d.ts +1 -0
  270. package/lib/hooks/useIsOverflowing.d.ts +9 -0
  271. package/lib/hooks/useTabs.d.ts +6 -0
  272. package/lib/index.d.ts +5 -520
  273. package/lib/index.esm.js +1 -1
  274. package/lib/index.esm.js.map +1 -1
  275. package/lib/index.js +1 -1
  276. package/lib/index.js.map +1 -1
  277. package/lib/tempIcons/ArrowDownIcon.d.ts +2 -0
  278. package/lib/tempIcons/ArrowUpIcon.d.ts +2 -0
  279. package/lib/tempIcons/AttentionIcon.d.ts +2 -0
  280. package/lib/tempIcons/CalendarIcon.d.ts +2 -0
  281. package/lib/tempIcons/ClipboardIcon.d.ts +2 -0
  282. package/lib/tempIcons/CrossIcon.d.ts +2 -0
  283. package/lib/tempIcons/DoubleArrowAscIcon.d.ts +2 -0
  284. package/lib/tempIcons/DoubleArrowDescIcon.d.ts +2 -0
  285. package/lib/tempIcons/DoubleArrowIcon.d.ts +2 -0
  286. package/lib/tempIcons/DoubleArrowIconIcon.d.ts +2 -0
  287. package/lib/tempIcons/DownArrowIcon.d.ts +2 -0
  288. package/lib/tempIcons/DropdownIcon.d.ts +2 -0
  289. package/lib/tempIcons/EditIcon.d.ts +2 -0
  290. package/lib/tempIcons/EndArrowIcon.d.ts +2 -0
  291. package/lib/tempIcons/FailIcon.d.ts +2 -0
  292. package/lib/tempIcons/HelpIcon.d.ts +2 -0
  293. package/lib/tempIcons/InfoIcon.d.ts +2 -0
  294. package/lib/tempIcons/LeftArrowIcon.d.ts +2 -0
  295. package/lib/tempIcons/MergeIcon.d.ts +2 -0
  296. package/lib/tempIcons/MoreHorizIcon.d.ts +2 -0
  297. package/lib/tempIcons/ReorderIcon.d.ts +2 -0
  298. package/lib/tempIcons/RightArrowIcon.d.ts +2 -0
  299. package/lib/tempIcons/SearchIcon.d.ts +2 -0
  300. package/lib/tempIcons/StartArrowIcon.d.ts +2 -0
  301. package/lib/tempIcons/SuccessIcon.d.ts +2 -0
  302. package/lib/tempIcons/UpArrowIcon.d.ts +2 -0
  303. package/lib/tempIcons/VisibilityIcon.d.ts +2 -0
  304. package/lib/tempIcons/VisibilityOffIcon.d.ts +2 -0
  305. package/lib/theme/index.d.ts +2 -2
  306. package/lib/theme/modules/shadows.d.ts +1 -1
  307. package/lib/utils/buildClassnames.d.ts +1 -0
  308. package/lib/utils/color.d.ts +13 -0
  309. package/lib/utils/generateId.d.ts +1 -0
  310. package/lib/utils/index.d.ts +3 -0
  311. package/lib/utils/paginationList.d.ts +4 -0
  312. package/lib/utils/setupIntersectionObserverMock.d.ts +18 -0
  313. package/package.json +68 -14
  314. package/rollup.config.mjs +6 -19
  315. package/setupJestMock.js +5 -0
  316. package/setupTests.js +6 -0
  317. package/src/components/Accordion/Accordion.stories.mdx +41 -0
  318. package/src/components/Accordion/Accordion.stories.tsx +29 -0
  319. package/src/components/Accordion/Accordion.test.tsx +34 -0
  320. package/src/components/Accordion/Accordion.tsx +62 -0
  321. package/src/components/Accordion/__snapshots__/Accordion.test.tsx.snap +152 -0
  322. package/src/components/Accordion/index.ts +1 -0
  323. package/src/components/Accordion/styled.ts +102 -0
  324. package/src/components/ActionList/ActionList.stories.tsx +23 -0
  325. package/src/components/ActionList/ActionList.test.tsx +39 -0
  326. package/src/components/ActionList/ActionList.tsx +72 -0
  327. package/src/components/ActionList/__snapshots__/ActionList.test.tsx.snap +247 -0
  328. package/src/components/ActionList/index.ts +1 -0
  329. package/src/components/ActionList/styled.ts +62 -0
  330. package/src/components/ActionList/types.ts +22 -0
  331. package/src/components/Anchor/Anchor.stories.tsx +35 -0
  332. package/src/components/Anchor/Anchor.test.tsx +10 -0
  333. package/src/components/Anchor/Anchor.tsx +17 -0
  334. package/src/components/Anchor/__snapshots__/Anchor.test.tsx.snap +34 -0
  335. package/src/components/Anchor/index.ts +1 -0
  336. package/src/components/Anchor/styled.ts +22 -0
  337. package/src/components/AnimatedDropdown/AnimatedDropdown.stories.tsx +44 -0
  338. package/src/components/AnimatedDropdown/AnimatedDropdown.test.tsx +14 -0
  339. package/src/components/AnimatedDropdown/AnimatedDropdown.tsx +54 -0
  340. package/src/components/AnimatedDropdown/__snapshots__/AnimatedDropdown.test.tsx.snap +117 -0
  341. package/src/components/AnimatedDropdown/components/BasicDropdown.test.tsx +14 -0
  342. package/src/components/AnimatedDropdown/components/BasicDropdown.tsx +17 -0
  343. package/src/components/AnimatedDropdown/components/__snapshots__/BasicDropdown.test.tsx.snap +31 -0
  344. package/src/components/AnimatedDropdown/components/styled.ts +11 -0
  345. package/src/components/AnimatedDropdown/index.ts +1 -0
  346. package/src/components/AnimatedDropdown/styled.ts +51 -0
  347. package/src/components/AnimatedDropdown/types.ts +16 -0
  348. package/src/components/Avatar/Avatar.stories.tsx +30 -0
  349. package/src/components/Avatar/Avatar.test.tsx +10 -0
  350. package/src/components/Avatar/Avatar.tsx +23 -0
  351. package/src/components/Avatar/__snapshots__/Avatar.test.tsx.snap +47 -0
  352. package/src/components/Avatar/index.ts +1 -0
  353. package/src/components/Avatar/styled.ts +24 -0
  354. package/src/components/Avatar/types.ts +12 -0
  355. package/src/components/Badge/Badge.stories.tsx +29 -0
  356. package/src/components/Badge/Badge.test.tsx +15 -0
  357. package/src/components/Badge/Badge.tsx +33 -0
  358. package/src/components/Badge/__snapshots__/Badge.test.tsx.snap +78 -0
  359. package/src/components/Badge/index.ts +1 -0
  360. package/src/components/Badge/styled.ts +50 -0
  361. package/src/components/Badge/types.ts +43 -0
  362. package/src/components/Banner/Banner.stories.tsx +30 -0
  363. package/src/components/Banner/Banner.test.tsx +10 -0
  364. package/src/components/Banner/Banner.tsx +45 -0
  365. package/src/components/Banner/__snapshots__/Banner.test.tsx.snap +124 -0
  366. package/src/components/Banner/index.ts +1 -0
  367. package/src/components/Banner/styled.ts +49 -0
  368. package/src/components/Banner/types.ts +23 -0
  369. package/src/components/BaseContainer/BaseContainer.test.tsx +10 -0
  370. package/src/components/BaseContainer/BaseContainer.ts +8 -0
  371. package/src/components/BaseContainer/__snapshots__/BaseContainer.test.tsx.snap +18 -0
  372. package/src/components/BaseContainer/index.ts +1 -0
  373. package/src/components/Breadcrumbs/Breadcrumbs.stories.tsx +43 -0
  374. package/src/components/Breadcrumbs/Breadcrumbs.test.tsx +21 -0
  375. package/src/components/Breadcrumbs/Breadcrumbs.tsx +31 -0
  376. package/src/components/Breadcrumbs/__snapshots__/Breadcrumbs.test.tsx.snap +91 -0
  377. package/src/components/Breadcrumbs/components/Breadcrumb.tsx +20 -0
  378. package/src/components/Breadcrumbs/components/styled.ts +31 -0
  379. package/src/components/Breadcrumbs/index.ts +1 -0
  380. package/src/components/Breadcrumbs/types.ts +23 -0
  381. package/src/components/Button/Button.stories.tsx +111 -0
  382. package/src/components/Button/Button.test.tsx +101 -0
  383. package/src/components/Button/Button.tsx +82 -0
  384. package/src/components/Button/Docs.mdx +19 -0
  385. package/src/components/Button/__snapshots__/Button.test.tsx.snap +1570 -0
  386. package/src/components/Button/components/styled.ts +271 -0
  387. package/src/components/Button/index.ts +1 -0
  388. package/src/components/Button/types.ts +27 -0
  389. package/src/components/Card/Card.stories.tsx +85 -0
  390. package/src/components/Card/Card.test.tsx +26 -0
  391. package/src/components/Card/Card.tsx +88 -0
  392. package/src/components/Card/Docs.mdx +134 -0
  393. package/src/components/Card/__snapshots__/Card.test.tsx.snap +390 -0
  394. package/src/components/Card/index.ts +1 -0
  395. package/src/components/Card/styled.ts +93 -0
  396. package/src/components/CardHeader/CardHeader.stories.tsx +38 -0
  397. package/src/components/CardHeader/CardHeader.test.tsx +12 -0
  398. package/src/components/CardHeader/CardHeader.tsx +63 -0
  399. package/src/components/CardHeader/__snapshots__/CardHeader.test.tsx.snap +218 -0
  400. package/src/components/CardHeader/index.ts +1 -0
  401. package/src/components/CardHeader/styled.ts +30 -0
  402. package/src/components/Checkbox/Checkbox.stories.tsx +64 -0
  403. package/src/components/Checkbox/Checkbox.test.tsx +57 -0
  404. package/src/components/Checkbox/Checkbox.tsx +62 -0
  405. package/src/components/Checkbox/__snapshots__/Checkbox.test.tsx.snap +129 -0
  406. package/src/components/Checkbox/index.ts +1 -0
  407. package/src/components/Checkbox/styled.ts +67 -0
  408. package/src/components/Choice/Choice.tsx +89 -0
  409. package/src/components/Choice/components/styled.ts +98 -0
  410. package/src/components/Choice/index.ts +1 -0
  411. package/src/components/ChoiceList/ChoiceList.stories.tsx +23 -0
  412. package/src/components/ChoiceList/ChoiceList.test.tsx +39 -0
  413. package/src/components/ChoiceList/ChoiceList.tsx +86 -0
  414. package/src/components/ChoiceList/__snapshots__/ChoiceList.test.tsx.snap +352 -0
  415. package/src/components/ChoiceList/index.ts +1 -0
  416. package/src/components/ChoiceList/styled.ts +23 -0
  417. package/src/components/CopyToClipboard/CopyToClipboard.stories.tsx +18 -0
  418. package/src/components/CopyToClipboard/CopyToClipboard.test.tsx +10 -0
  419. package/src/components/CopyToClipboard/CopyToClipboard.tsx +53 -0
  420. package/src/components/CopyToClipboard/__snapshots__/CopyToClipboard.test.tsx.snap +129 -0
  421. package/src/components/CopyToClipboard/index.ts +1 -0
  422. package/src/components/DataTable/DataTable.stories.tsx +99 -0
  423. package/src/components/DataTable/DataTable.test.tsx +104 -0
  424. package/src/components/DataTable/DataTable.tsx +634 -0
  425. package/src/components/DataTable/DataTableDocs.mdx +625 -0
  426. package/src/components/DataTable/SkeletonContent/SkeletonContent.tsx +46 -0
  427. package/src/components/DataTable/SkeletonContent/index.ts +1 -0
  428. package/src/components/DataTable/SpecificState/SpecificState.tsx +17 -0
  429. package/src/components/DataTable/SpecificState/index.ts +1 -0
  430. package/src/components/DataTable/SpecificState/styled.ts +42 -0
  431. package/src/components/DataTable/StickyHeader.tsx +64 -0
  432. package/src/components/DataTable/__snapshots__/DataTable.test.tsx.snap +439 -0
  433. package/src/components/DataTable/cells/ClickableCell.tsx +21 -0
  434. package/src/components/DataTable/cells/EditableCell.tsx +22 -0
  435. package/src/components/DataTable/cells/SkeletonCell.tsx +17 -0
  436. package/src/components/DataTable/cells/SkeletonHeaderCell.tsx +20 -0
  437. package/src/components/DataTable/cells/index.ts +3 -0
  438. package/src/components/DataTable/cells/styled.ts +25 -0
  439. package/src/components/DataTable/index.ts +1 -0
  440. package/src/components/DataTable/styled.ts +291 -0
  441. package/src/components/DataTable/utils/constants.tsx +25 -0
  442. package/src/components/DataTable/utils/hooks.ts +38 -0
  443. package/src/components/DataTable/utils/index.ts +23 -0
  444. package/src/components/DataTable/utils/types.ts +117 -0
  445. package/src/components/DataTableExp/DataTable.test.tsx +214 -0
  446. package/src/components/DataTableExp/DataTable.tsx +291 -0
  447. package/src/components/DataTableExp/DataTableExp.stories.tsx +329 -0
  448. package/src/components/DataTableExp/Docs.mdx +74 -0
  449. package/src/components/DataTableExp/components/ActionBar.tsx +87 -0
  450. package/src/components/DataTableExp/components/Cell.ts +41 -0
  451. package/src/components/DataTableExp/components/ColumnHeader.tsx +52 -0
  452. package/src/components/DataTableExp/components/ColumnMenu.tsx +96 -0
  453. package/src/components/DataTableExp/components/EmptyBodyContent.ts +23 -0
  454. package/src/components/DataTableExp/components/Header.ts +20 -0
  455. package/src/components/DataTableExp/components/LoadingCellContent.ts +39 -0
  456. package/src/components/DataTableExp/components/NoWrap.ts +5 -0
  457. package/src/components/DataTableExp/components/Row.ts +39 -0
  458. package/src/components/DataTableExp/components/ScrollContainer.ts +8 -0
  459. package/src/components/DataTableExp/components/SelectionCell.tsx +36 -0
  460. package/src/components/DataTableExp/components/SelectionHeader.tsx +20 -0
  461. package/src/components/DataTableExp/components/StickyHead.tsx +134 -0
  462. package/src/components/DataTableExp/components/TableGrid.ts +28 -0
  463. package/src/components/DataTableExp/components/Truncate.ts +7 -0
  464. package/src/components/DataTableExp/components/Wrapper.ts +26 -0
  465. package/src/components/DataTableExp/constants.ts +4 -0
  466. package/src/components/DataTableExp/hooks/index.tsx +6 -0
  467. package/src/components/DataTableExp/hooks/useCellWidths.ts +34 -0
  468. package/src/components/DataTableExp/hooks/useColumns.ts +14 -0
  469. package/src/components/DataTableExp/hooks/useDragToScroll.ts +48 -0
  470. package/src/components/DataTableExp/hooks/useNested.ts +31 -0
  471. package/src/components/DataTableExp/hooks/useScrollPosition.ts +45 -0
  472. package/src/components/DataTableExp/hooks/useSelection.tsx +92 -0
  473. package/src/components/DataTableExp/index.tsx +1 -0
  474. package/src/components/DataTableExp/renderers/index.tsx +5 -0
  475. package/src/components/DataTableExp/renderers/renderCell.ts +31 -0
  476. package/src/components/DataTableExp/renderers/renderFooter.tsx +33 -0
  477. package/src/components/DataTableExp/renderers/renderHeader.tsx +83 -0
  478. package/src/components/DataTableExp/renderers/renderLoadingCell.tsx +29 -0
  479. package/src/components/DataTableExp/renderers/renderNestedCell.tsx +33 -0
  480. package/src/components/DataTableExp/types.ts +168 -0
  481. package/src/components/DataTableExp/utils/GetSortIcon.tsx +24 -0
  482. package/src/components/DataTableExp/utils/alignmentToFlex.ts +14 -0
  483. package/src/components/DataTableExp/utils/generateTableCss.ts +114 -0
  484. package/src/components/DataTableExp/utils/getNextSortState.ts +18 -0
  485. package/src/components/DataTableExp/utils/getRowState.test.ts +33 -0
  486. package/src/components/DataTableExp/utils/getRowState.ts +17 -0
  487. package/src/components/DataTableExp/utils/index.ts +6 -0
  488. package/src/components/DataTableExp/utils/parseWidth.ts +12 -0
  489. package/src/components/DataTableExp/utils/sumAll.ts +7 -0
  490. package/src/components/DescriptionList/DescriptionList.stories.tsx +24 -0
  491. package/src/components/DescriptionList/DescriptionList.test.tsx +16 -0
  492. package/src/components/DescriptionList/DescriptionList.tsx +90 -0
  493. package/src/components/DescriptionList/__snapshots__/DescriptionList.test.tsx.snap +86 -0
  494. package/src/components/DescriptionList/index.ts +1 -0
  495. package/src/components/DetailPage/DetailPage.stories.tsx +45 -0
  496. package/src/components/DetailPage/DetailPage.test.tsx +15 -0
  497. package/src/components/DetailPage/DetailPage.tsx +23 -0
  498. package/src/components/DetailPage/__snapshots__/DetailPage.test.tsx.snap +52 -0
  499. package/src/components/DetailPage/index.ts +1 -0
  500. package/src/components/DetailPage/styled.ts +27 -0
  501. package/src/components/DimensionsInput/DimensionsInput.stories.tsx +33 -0
  502. package/src/components/DimensionsInput/DimensionsInput.test.tsx +98 -0
  503. package/src/components/DimensionsInput/DimensionsInput.tsx +63 -0
  504. package/src/components/DimensionsInput/__snapshots__/DimensionsInput.test.tsx.snap +303 -0
  505. package/src/components/DimensionsInput/index.ts +1 -0
  506. package/src/components/DimensionsInput/styled.ts +66 -0
  507. package/src/components/DimensionsInput/types.ts +16 -0
  508. package/src/components/FilterTag/FilterTag.stories.tsx +32 -0
  509. package/src/components/FilterTag/FilterTag.test.tsx +10 -0
  510. package/src/components/FilterTag/FilterTag.tsx +111 -0
  511. package/src/components/FilterTag/__snapshots__/FilterTag.test.tsx.snap +117 -0
  512. package/src/components/FilterTag/index.ts +1 -0
  513. package/src/components/FilterTag/styled.ts +77 -0
  514. package/src/components/FilterTag/types.ts +15 -0
  515. package/src/components/Grid/Grid.stories.mdx +34 -0
  516. package/src/components/Grid/Grid.test.tsx +14 -0
  517. package/src/components/Grid/__snapshots__/Grid.test.tsx.snap +32 -0
  518. package/src/components/Grid/index.ts +12 -0
  519. package/src/components/Grid/types.ts +10 -0
  520. package/src/components/Image/Image.stories.tsx +20 -0
  521. package/src/components/Image/Image.test.tsx +10 -0
  522. package/src/components/Image/Image.tsx +122 -0
  523. package/src/components/Image/__snapshots__/Image.test.tsx.snap +34 -0
  524. package/src/components/Image/components/PlaceholderImage.tsx +19 -0
  525. package/src/components/Image/components/styled.ts +17 -0
  526. package/src/components/Image/index.ts +1 -0
  527. package/src/components/Image/types.ts +6 -0
  528. package/src/components/Image/utils.ts +8 -0
  529. package/src/components/InputGroup/InputGroup.stories.tsx +33 -0
  530. package/src/components/InputGroup/InputGroup.test.tsx +15 -0
  531. package/src/components/InputGroup/__snapshots__/InputGroup.test.tsx.snap +182 -0
  532. package/src/components/InputGroup/index.ts +46 -0
  533. package/src/components/Loader/Docs.mdx +1 -1
  534. package/src/components/Loader/Grid.tsx +1 -3
  535. package/src/components/Loader/Loader.stories.tsx +1 -1
  536. package/src/components/Loader/Loader.test.tsx +14 -0
  537. package/src/components/Loader/Loader.tsx +5 -5
  538. package/src/components/Loader/TailSpin.tsx +1 -3
  539. package/src/components/Loader/ThreeDots.tsx +1 -3
  540. package/src/components/Loader/__snapshots__/Loader.test.tsx.snap +315 -13
  541. package/src/components/LoginWithAmazonButton/LoginWithAmazonButton.stories.tsx +14 -0
  542. package/src/components/LoginWithAmazonButton/LoginWithAmazonButton.test.tsx +19 -0
  543. package/src/components/LoginWithAmazonButton/LoginWithAmazonButton.tsx +38 -0
  544. package/src/components/LoginWithAmazonButton/index.tsx +1 -0
  545. package/src/components/LoginWithAmazonButton/styled.ts +14 -0
  546. package/src/components/Modal/Modal.stories.tsx +455 -0
  547. package/src/components/Modal/Modal.test.tsx +211 -0
  548. package/src/components/Modal/Modal.tsx +110 -0
  549. package/src/components/Modal/__snapshots__/Modal.test.tsx.snap +1940 -0
  550. package/src/components/Modal/components/Dialog/Dialog.tsx +11 -0
  551. package/src/components/Modal/components/Dialog/constants.ts +48 -0
  552. package/src/components/Modal/components/Dialog/styled.ts +104 -0
  553. package/src/components/Modal/components/styled.ts +24 -0
  554. package/src/components/Modal/index.tsx +1 -0
  555. package/src/components/Modal/types.ts +61 -0
  556. package/src/components/PageHeader/PageHeader.test.tsx +40 -0
  557. package/src/components/PageHeader/PageHeader.tsx +119 -0
  558. package/src/components/PageHeader/PageHeaderDocs.mdx +69 -0
  559. package/src/components/PageHeader/__snapshots__/PageHeader.test.tsx.snap +906 -0
  560. package/src/components/PageHeader/index.ts +1 -0
  561. package/src/components/PageHeader/styled.ts +81 -0
  562. package/src/components/Pagination/Docs.mdx +61 -0
  563. package/src/components/Pagination/Pagination.stories.tsx +27 -0
  564. package/src/components/Pagination/Pagination.test.tsx +102 -0
  565. package/src/components/Pagination/Pagination.tsx +105 -0
  566. package/src/components/Pagination/__snapshots__/Pagination.test.tsx.snap +395 -0
  567. package/src/components/Pagination/components.tsx +16 -0
  568. package/src/components/Pagination/hooks/usePagination.ts +88 -0
  569. package/src/components/Pagination/index.ts +1 -0
  570. package/src/components/Pagination/styled.ts +31 -0
  571. package/src/components/Pagination/types.ts +9 -0
  572. package/src/components/PaginationRange/Items/Item/Item.tsx +14 -0
  573. package/src/components/PaginationRange/Items/Item/index.ts +1 -0
  574. package/src/components/PaginationRange/Items/Item/styled.ts +26 -0
  575. package/src/components/PaginationRange/Items/Item/types.ts +6 -0
  576. package/src/components/PaginationRange/Items/Items.tsx +27 -0
  577. package/src/components/PaginationRange/Items/index.ts +1 -0
  578. package/src/components/PaginationRange/PaginationRange.stories.tsx +14 -0
  579. package/src/components/PaginationRange/PaginationRange.test.tsx +10 -0
  580. package/src/components/PaginationRange/PaginationRange.tsx +69 -0
  581. package/src/components/PaginationRange/__snapshots__/PaginationRange.test.tsx.snap +155 -0
  582. package/src/components/PaginationRange/index.ts +1 -0
  583. package/src/components/PaginationRange/styled.ts +39 -0
  584. package/src/components/PaginationRange/types.ts +17 -0
  585. package/src/components/Popover/Popover.test.tsx +87 -0
  586. package/src/components/Popover/Popover.tsx +82 -0
  587. package/src/components/Popover/PopoverDemo.tsx +53 -0
  588. package/src/components/Popover/PopoverDocs.mdx +64 -0
  589. package/src/components/Popover/__snapshots__/Popover.test.tsx.snap +35 -0
  590. package/src/components/Popover/index.ts +1 -0
  591. package/src/components/Portal/Portal.stories.tsx +18 -0
  592. package/src/components/Portal/Portal.tsx +62 -0
  593. package/src/components/Portal/index.ts +1 -0
  594. package/src/components/PriceInput/PriceInput.stories.tsx +36 -0
  595. package/src/components/PriceInput/PriceInput.test.tsx +22 -0
  596. package/src/components/PriceInput/PriceInput.tsx +101 -0
  597. package/src/components/PriceInput/index.tsx +1 -0
  598. package/src/components/PriceInput/styled.ts +116 -0
  599. package/src/components/PriceInput/types.ts +13 -0
  600. package/src/components/Radio/Radio.stories.tsx +57 -0
  601. package/src/components/Radio/Radio.test.tsx +8 -0
  602. package/src/components/Radio/Radio.tsx +39 -0
  603. package/src/components/Radio/__snapshots__/Radio.test.tsx.snap +128 -0
  604. package/src/components/Radio/index.ts +1 -0
  605. package/src/components/Radio/styled.ts +58 -0
  606. package/src/components/Search/Search.stories.mdx +23 -0
  607. package/src/components/Search/Search.stories.tsx +31 -0
  608. package/src/components/Search/Search.test.tsx +12 -0
  609. package/src/components/Search/Search.tsx +87 -0
  610. package/src/components/Search/__snapshots__/Search.test.tsx.snap +162 -0
  611. package/src/components/Search/index.ts +1 -0
  612. package/src/components/Search/styled.ts +46 -0
  613. package/src/components/Search/types.ts +10 -0
  614. package/src/components/SegmentedControl/SegmentedControl.stories.tsx +43 -0
  615. package/src/components/SegmentedControl/SegmentedControl.test.tsx +67 -0
  616. package/src/components/SegmentedControl/SegmentedControl.tsx +27 -0
  617. package/src/components/SegmentedControl/__snapshots__/SegmentedControl.test.tsx.snap +825 -0
  618. package/src/components/SegmentedControl/index.ts +1 -0
  619. package/src/components/SegmentedControl/styled.ts +50 -0
  620. package/src/components/SegmentedControl/types.ts +13 -0
  621. package/src/components/Select/Select.stories.tsx +37 -0
  622. package/src/components/Select/Select.test.tsx +37 -0
  623. package/src/components/Select/Select.tsx +58 -0
  624. package/src/components/Select/__snapshots__/Select.test.tsx.snap +199 -0
  625. package/src/components/Select/index.ts +1 -0
  626. package/src/components/Select/styled.ts +53 -0
  627. package/src/components/SimpleTable/SimpleTable.stories.tsx +60 -0
  628. package/src/components/SimpleTable/SimpleTable.test.tsx +28 -0
  629. package/src/components/SimpleTable/SimpleTable.tsx +18 -0
  630. package/src/components/SimpleTable/__snapshots__/SimpleTable.test.tsx.snap +87 -0
  631. package/src/components/SimpleTable/index.ts +1 -0
  632. package/src/components/SimpleTable/styled.ts +68 -0
  633. package/src/components/SimpleTable/types.ts +7 -0
  634. package/src/components/Slider/Select.stories.tsx +43 -0
  635. package/src/components/Slider/Slider.test.tsx +19 -0
  636. package/src/components/Slider/Slider.tsx +197 -0
  637. package/src/components/Slider/__snapshots__/Slider.test.tsx.snap +109 -0
  638. package/src/components/Slider/index.ts +1 -0
  639. package/src/components/Slider/styled.ts +53 -0
  640. package/src/components/Slider/types.ts +30 -0
  641. package/src/components/Stack/Alignments.ts +1 -3
  642. package/src/components/Stack/Stack.test.tsx +46 -0
  643. package/src/components/Stack/Stack.tsx +1 -2
  644. package/src/components/Stack/__snapshots__/Stack.test.tsx.snap +240 -10
  645. package/src/components/Stack/types.ts +1 -1
  646. package/src/components/Stepper/Stepper.stories.tsx +14 -0
  647. package/src/components/Stepper/Stepper.test.tsx +8 -0
  648. package/src/components/Stepper/Stepper.tsx +33 -0
  649. package/src/components/Stepper/__snapshots__/Stepper.test.tsx.snap +142 -0
  650. package/src/components/Stepper/index.ts +1 -0
  651. package/src/components/Stepper/styled.ts +83 -0
  652. package/src/components/Tag/Tag.stories.tsx +43 -0
  653. package/src/components/Tag/Tag.test.tsx +18 -0
  654. package/src/components/Tag/Tag.ts +23 -0
  655. package/src/components/Tag/__snapshots__/Tag.test.tsx.snap +78 -0
  656. package/src/components/Tag/index.ts +1 -0
  657. package/src/components/Text/Docs.mdx +112 -0
  658. package/src/components/Text/Text.stories.tsx +27 -0
  659. package/src/components/Text/Text.test.tsx +38 -0
  660. package/src/components/Text/Text.ts +44 -0
  661. package/src/components/Text/__snapshots__/Text.test.tsx.snap +1158 -0
  662. package/src/components/Text/index.ts +1 -0
  663. package/src/components/Text/textVariants.ts +41 -0
  664. package/src/components/Text/types.ts +33 -0
  665. package/src/components/Text/utils.ts +23 -0
  666. package/src/components/TextField/Docs.mdx +14 -0
  667. package/src/components/TextField/TextField.stories.tsx +38 -0
  668. package/src/components/TextField/TextField.test.tsx +27 -0
  669. package/src/components/TextField/TextField.tsx +92 -0
  670. package/src/components/TextField/__snapshots__/TextField.test.tsx.snap +205 -0
  671. package/src/components/TextField/index.ts +4 -0
  672. package/src/components/TextField/styled.ts +95 -0
  673. package/src/components/TextField/types.ts +41 -0
  674. package/src/components/ToastsLayout/ToastsLayout.stories.tsx +88 -0
  675. package/src/components/ToastsLayout/ToastsLayout.tsx +39 -0
  676. package/src/components/ToastsLayout/components/Toast.tsx +78 -0
  677. package/src/components/ToastsLayout/components/styled.ts +76 -0
  678. package/src/components/ToastsLayout/index.ts +1 -0
  679. package/src/components/ToastsLayout/types.ts +41 -0
  680. package/src/components/Toggle/Toggle.stories.tsx +41 -0
  681. package/src/components/Toggle/Toggle.test.tsx +57 -0
  682. package/src/components/Toggle/Toggle.tsx +31 -0
  683. package/src/components/Toggle/__snapshots__/Toggle.test.tsx.snap +219 -0
  684. package/src/components/Toggle/index.ts +1 -0
  685. package/src/components/Toggle/styled.ts +84 -0
  686. package/src/components/Toggle/types.ts +10 -0
  687. package/src/components/ToggleButton/ToggleButton.stories.tsx +19 -0
  688. package/src/components/ToggleButton/ToggleButton.test.tsx +12 -0
  689. package/src/components/ToggleButton/ToggleButton.tsx +31 -0
  690. package/src/components/ToggleButton/__snapshots__/ToggleButton.test.tsx.snap +83 -0
  691. package/src/components/ToggleButton/index.ts +1 -0
  692. package/src/components/ToggleButton/styled.ts +92 -0
  693. package/src/components/Tooltip/Docs.mdx +14 -0
  694. package/src/components/Tooltip/Tooltip.stories.tsx +26 -0
  695. package/src/components/Tooltip/Tooltip.test.tsx +25 -0
  696. package/src/components/Tooltip/Tooltip.tsx +95 -0
  697. package/src/components/Tooltip/__snapshots__/Tooltip.test.tsx.snap +17 -0
  698. package/src/components/Tooltip/index.ts +1 -0
  699. package/src/components/Tooltip/styled.ts +74 -0
  700. package/src/components/Tooltip/types.ts +44 -0
  701. package/src/components/VideoModal/VideoModal.stories.tsx +36 -0
  702. package/src/components/VideoModal/VideoModal.test.tsx +36 -0
  703. package/src/components/VideoModal/VideoModal.tsx +40 -0
  704. package/src/components/VideoModal/VideoModalDemo.tsx +19 -0
  705. package/src/components/VideoModal/__snapshots__/VideoModal.test.tsx.snap +165 -0
  706. package/src/components/VideoModal/components/Popup.tsx +44 -0
  707. package/src/components/VideoModal/components/styled.ts +34 -0
  708. package/src/components/VideoModal/index.ts +1 -0
  709. package/src/components/VideoModal/styled.ts +24 -0
  710. package/src/components/VideoModal/types.ts +9 -0
  711. package/src/components/View/View.stories.tsx +26 -0
  712. package/src/components/View/View.test.tsx +10 -0
  713. package/src/components/View/View.tsx +120 -0
  714. package/src/components/View/__snapshots__/View.test.tsx.snap +80 -0
  715. package/src/components/View/index.ts +1 -0
  716. package/src/components/View/styled.ts +82 -0
  717. package/src/components/View/types.ts +42 -0
  718. package/src/components/WeightInput/WeightInput.stories.tsx +26 -0
  719. package/src/components/WeightInput/WeightInput.test.tsx +11 -0
  720. package/src/components/WeightInput/WeightInput.tsx +66 -0
  721. package/src/components/WeightInput/__snapshots__/WeightInput.test.tsx.snap +272 -0
  722. package/src/components/WeightInput/index.ts +1 -0
  723. package/src/components/WeightInput/styled.ts +39 -0
  724. package/src/components/WeightInput/types.ts +31 -0
  725. package/src/components/index.ts +50 -0
  726. package/src/components/types.ts +23 -0
  727. package/src/hoc/index.ts +2 -0
  728. package/src/hoc/withDeprecated.tsx +11 -0
  729. package/src/hoc/withLabels/index.ts +1 -0
  730. package/src/hoc/withLabels/styled.ts +54 -0
  731. package/src/hoc/withLabels/withLabels.tsx +46 -0
  732. package/src/hooks/index.ts +7 -0
  733. package/src/hooks/useClickOutside.ts +40 -0
  734. package/src/hooks/useDebounce.ts +15 -0
  735. package/src/hooks/useDropdown.ts +22 -0
  736. package/src/hooks/useFocusVisible.tsx +157 -0
  737. package/src/hooks/useHover.ts +9 -0
  738. package/src/hooks/useIsOverflowing.ts +32 -0
  739. package/src/hooks/useTabs.ts +24 -0
  740. package/src/index.ts +3 -0
  741. package/src/tempIcons/ArrowDownIcon.tsx +12 -0
  742. package/src/tempIcons/ArrowUpIcon.tsx +12 -0
  743. package/src/tempIcons/AttentionIcon.tsx +12 -0
  744. package/src/tempIcons/CalendarIcon.tsx +12 -0
  745. package/src/tempIcons/ClipboardIcon.tsx +10 -0
  746. package/src/tempIcons/CrossIcon.tsx +20 -0
  747. package/src/tempIcons/DoubleArrowAscIcon.tsx +8 -0
  748. package/src/tempIcons/DoubleArrowDescIcon.tsx +8 -0
  749. package/src/tempIcons/DoubleArrowIcon.tsx +8 -0
  750. package/src/tempIcons/DoubleArrowIconIcon.tsx +8 -0
  751. package/src/tempIcons/DownArrowIcon.tsx +20 -0
  752. package/src/tempIcons/DropdownIcon.tsx +14 -0
  753. package/src/tempIcons/EditIcon.tsx +12 -0
  754. package/src/tempIcons/EndArrowIcon.tsx +18 -0
  755. package/src/tempIcons/FailIcon.tsx +12 -0
  756. package/src/tempIcons/HelpIcon.tsx +12 -0
  757. package/src/tempIcons/InfoIcon.tsx +14 -0
  758. package/src/tempIcons/LeftArrowIcon.tsx +12 -0
  759. package/src/tempIcons/MergeIcon.tsx +12 -0
  760. package/src/tempIcons/MoreHorizIcon.tsx +10 -0
  761. package/src/tempIcons/ReorderIcon.tsx +10 -0
  762. package/src/tempIcons/RightArrowIcon.tsx +12 -0
  763. package/src/tempIcons/SearchIcon.tsx +12 -0
  764. package/src/tempIcons/StartArrowIcon.tsx +16 -0
  765. package/src/tempIcons/SuccessIcon.tsx +12 -0
  766. package/src/tempIcons/UpArrowIcon.tsx +20 -0
  767. package/src/tempIcons/VisibilityIcon.tsx +10 -0
  768. package/src/tempIcons/VisibilityOffIcon.tsx +10 -0
  769. package/src/theme/index.ts +2 -2
  770. package/src/theme/modules/shadows.ts +1 -1
  771. package/src/utils/buildClassnames.ts +2 -0
  772. package/src/utils/color.ts +27 -0
  773. package/src/utils/generateId.ts +4 -0
  774. package/src/utils/index.ts +3 -0
  775. package/src/utils/paginationList.ts +6 -0
  776. package/src/utils/setupIntersectionObserverMock.ts +46 -0
  777. package/tsconfig.json +1 -1
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const ArrowDownIcon: (props: any) => React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const ArrowUpIcon: (props: any) => React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const AttentionIcon: (props: any) => React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const CalanderIcon: (props: any) => React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const ClipboardIcon: (props: any) => React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const CrossIcon: (props: any) => React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const DoubleArrowAscIcon: (props: any) => React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const DoubleArrowDescIcon: (props: any) => React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const DoubleArrowIcon: (props: any) => React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const DoubleArrowIcon: (props: any) => React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const DownArrowIcon: (props: any) => React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const DropdownIcon: (props: any) => React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const EditIcon: (props: any) => React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const EndArrowIcon: (props: any) => React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const FailIcon: (props: any) => React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const HelpIcon: (props: any) => React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const InfoIcon: (props: any) => React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const LeftArrowIcon: (props: any) => React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const MergeIcon: (props: any) => React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const MoreHorizIcon: (props: any) => React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const ReorderIcon: (props: any) => React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const RightArrowIcon: (props: any) => React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const SearchIcon: (props: any) => React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const StartArrowIcon: (props: any) => React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const SuccessIcon: (props: any) => React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const UpArrowIcon: (props: any) => React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const VisiblityIcon: (props: any) => React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const VisiblityOffIcon: (props: any) => React.JSX.Element;
@@ -1,4 +1,4 @@
1
- import { shadows } from './modules/shadows';
1
+ import { Shadows } from './modules/shadows';
2
2
  export declare const theme: {
3
3
  breakpoints: {
4
4
  readonly mobile: "640px";
@@ -136,7 +136,7 @@ export declare const theme: {
136
136
  lg: string;
137
137
  full: string;
138
138
  };
139
- shadows: typeof shadows;
139
+ shadows: typeof Shadows;
140
140
  sizes: import("./modules/sizes").SizeScale;
141
141
  text: {
142
142
  headingXXL: {
@@ -1,4 +1,4 @@
1
- export declare enum shadows {
1
+ export declare enum Shadows {
2
2
  sm = "0px 1px 3px rgba(55, 66, 77, 0.15)",
3
3
  base = "0px 4px 6px rgba(27, 33, 38, 0.2)",
4
4
  md = "0px 10px 15px rgba(27, 33, 38, 0.2)",
@@ -0,0 +1 @@
1
+ export declare const buildClassnames: (names: (string | undefined)[]) => string;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * A function to convert hex color to rgb.
3
+ */
4
+ export declare const hexToRgb: (hex: string) => {
5
+ r: number;
6
+ g: number;
7
+ b: number;
8
+ } | null;
9
+ /**
10
+ * A function to get a hex color with opacity, after converting to `rgba`.
11
+ * @param hex color in hex format
12
+ */
13
+ export declare const getOpaqueHexColor: (hex: string, opacity: number) => string;
@@ -0,0 +1 @@
1
+ export declare const generateId: (prefix: string) => string;
@@ -0,0 +1,3 @@
1
+ export { buildClassnames } from './buildClassnames';
2
+ export { getOpaqueHexColor, hexToRgb } from './color';
3
+ export { generateId } from './generateId';
@@ -0,0 +1,4 @@
1
+ export declare const paginationDefaultRangeList: {
2
+ label: string;
3
+ value: number;
4
+ }[];
@@ -0,0 +1,18 @@
1
+ /**
2
+ * https://stackoverflow.com/a/58651649
3
+ *
4
+ * Utility function that mocks the `IntersectionObserver` API. Necessary for components that rely
5
+ * on it, otherwise the tests will crash. Recommended to execute inside `beforeEach`.
6
+ * @param intersectionObserverMock - Parameter that is sent to the `Object.defineProperty`
7
+ * overwrite method. `jest.fn()` mock functions can be passed here if the goal is to not only
8
+ * mock the intersection observer, but its methods.
9
+ */
10
+ export declare function setupIntersectionObserverMock({ root, rootMargin, thresholds, disconnect, observe, takeRecords, unobserve, }?: {
11
+ root?: null | undefined;
12
+ rootMargin?: string | undefined;
13
+ thresholds?: never[] | undefined;
14
+ disconnect?: (() => null) | undefined;
15
+ observe?: (() => null) | undefined;
16
+ takeRecords?: (() => never[]) | undefined;
17
+ unobserve?: (() => null) | undefined;
18
+ }): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veeqo/ui",
3
- "version": "0.0.1",
3
+ "version": "0.0.4",
4
4
  "description": "New optimised component library for Veeqo.",
5
5
  "author": "Robert Wealthall",
6
6
  "license": "UNLICENSED",
@@ -12,13 +12,27 @@
12
12
  "lib": "lib"
13
13
  },
14
14
  "scripts": {
15
- "test": "echo \"Error: no test specified\" && exit 1",
15
+ "test": "jest",
16
+ "test:watch": "jest --watch",
16
17
  "storybook": "storybook dev -p 6006",
17
18
  "build-storybook": "storybook build",
18
19
  "build": "rollup -c",
19
- "release": "release-it && npm publish"
20
+ "lint": "eslint --quiet src/* --ext .ts,.tsx",
21
+ "lint:fix": "eslint --quiet src/* --ext .ts,.tsx --fix",
22
+ "patch": "npm version patch && npm run changelog:update",
23
+ "minor": "npm version minor && npm run changelog:update",
24
+ "major": "npm version major && npm run changelog:update",
25
+ "changelog:update": "auto-changelog -p && git add CHANGELOG.md",
26
+ "posttest": "npm run lint",
27
+ "prepublishOnly": "npm run test && npm run build"
28
+ },
29
+ "auto-changelog": {
30
+ "issueUrl": "https://sim.amazon.com/issues/{id}",
31
+ "issuePattern": "VQCL-[0-9]+"
20
32
  },
21
33
  "devDependencies": {
34
+ "@babel/eslint-parser": "^7.22.15",
35
+ "@popperjs/core": "^2.11.8",
22
36
  "@rollup/plugin-node-resolve": "^15.2.1",
23
37
  "@rollup/plugin-terser": "^0.4.3",
24
38
  "@rollup/plugin-typescript": "^11.1.3",
@@ -30,23 +44,63 @@
30
44
  "@storybook/react": "^7.4.1",
31
45
  "@storybook/react-vite": "^7.4.1",
32
46
  "@storybook/testing-library": "^0.2.0",
33
- "@types/react": "^18.2.21",
34
- "framer-motion": "^10.16.4",
47
+ "@testing-library/jest-dom": "~5.16.5",
48
+ "@testing-library/react": "~11.2.7",
49
+ "@testing-library/user-event": "~13.1.9",
50
+ "@types/jest": "^29.5.5",
51
+ "@types/jest-axe": "^3.5.6",
52
+ "@types/lodash.throttle": "^4.1.7",
53
+ "@types/react": "^17.0.5",
54
+ "@types/react-dom": "^16.9.12",
55
+ "@types/react-transition-group": "^4.4.6",
56
+ "@types/styled-components": "^5.1.27",
57
+ "@typescript-eslint/eslint-plugin": "^6.7.3",
58
+ "@typescript-eslint/parser": "^6.7.3",
59
+ "auto-changelog": "^2.4.0",
60
+ "eslint": "^8.44.0",
61
+ "eslint-config-airbnb": "^19.0.4",
62
+ "eslint-config-airbnb-typescript": "^17.1.0",
63
+ "eslint-config-prettier": "^8.8.0",
64
+ "eslint-plugin-import": "^2.27.5",
65
+ "eslint-plugin-jest": "^27.4.0",
66
+ "eslint-plugin-jsx-a11y": "^6.7.1",
67
+ "eslint-plugin-prettier": "^5.0.0",
68
+ "eslint-plugin-react": "^7.32.2",
69
+ "eslint-plugin-react-hooks": "^4.6.0",
70
+ "framer-motion": "^3.10.6",
71
+ "jest": "~29.0.3",
72
+ "jest-axe": "~6.0.0",
73
+ "jest-cli": "~29.0.3",
74
+ "jest-environment-jsdom": "~29.0.3",
75
+ "jest-styled-components": "~7.1.1",
76
+ "lodash.throttle": "^4.1.1",
35
77
  "prettier": "^3.0.3",
36
- "react": "^18.2.0",
37
- "react-dom": "^18.2.0",
38
- "release-it": "^16.1.5",
78
+ "react": "^16.12.0",
79
+ "react-dom": "^16.12.0",
80
+ "react-popper": "^2.2.5",
81
+ "react-scrolllock-configurable": "^4.0.5",
82
+ "react-transition-group": "^4.3.0",
83
+ "react-use": "^14.0.0",
84
+ "resize-observer-polyfill": "^1.5.1",
39
85
  "rollup": "^3.29.2",
40
86
  "rollup-plugin-dts": "^6.0.2",
41
87
  "rollup-plugin-peer-deps-external": "^2.2.4",
42
88
  "storybook": "^7.4.1",
43
- "styled-components": "^6.0.8",
89
+ "styled-components": "^5.1.1",
90
+ "ts-jest": "^29.1.1",
44
91
  "typescript": "^5.2.2"
45
92
  },
46
93
  "peerDependencies": {
47
- "framer-motion": "^10.16.4",
48
- "react": "^18.2.0",
49
- "react-dom": "^18.2.0",
50
- "styled-components": "^6.0.8"
94
+ "@popperjs/core": "^2.11.8",
95
+ "framer-motion": "^3.10.6",
96
+ "lodash.throttle": "^4.1.1",
97
+ "react": "^16.12.0",
98
+ "react-dom": "^16.12.0",
99
+ "react-popper": "^2.2.5",
100
+ "react-scrolllock-configurable": "^4.0.5",
101
+ "react-transition-group": "^4.3.0",
102
+ "react-use": "^14.0.0",
103
+ "resize-observer-polyfill": "^1.5.1",
104
+ "styled-components": "^5.1.1"
51
105
  }
52
- }
106
+ }
package/rollup.config.mjs CHANGED
@@ -1,4 +1,3 @@
1
- import typescriptEngine from 'typescript';
2
1
  import dts from 'rollup-plugin-dts';
3
2
  import terser from '@rollup/plugin-terser';
4
3
  import peerDepsExternal from 'rollup-plugin-peer-deps-external';
@@ -9,7 +8,7 @@ import packageJson from './package.json' assert { type: 'json' };
9
8
 
10
9
  export default [
11
10
  {
12
- input: 'src/index.ts',
11
+ input: './src/index.ts',
13
12
  output: [
14
13
  {
15
14
  file: packageJson.main,
@@ -19,31 +18,19 @@ export default [
19
18
  {
20
19
  file: packageJson.module,
21
20
  format: 'esm',
21
+ exports: 'named',
22
22
  sourcemap: true,
23
23
  },
24
24
  ],
25
25
  plugins: [
26
- peerDepsExternal(), // Don't include peer dependencies, should be given by client.
27
- resolve(), // Resolve paths
28
26
  typescript({
29
27
  tsconfig: './tsconfig.json',
30
- typescript: typescriptEngine,
31
- sourceMap: true,
32
- exclude: [
33
- '**/__snapshots__/*',
34
- '**/__tests__',
35
- '**/*.test.ts+(|x)',
36
- '**/*.story.ts+(|x)',
37
- '**/*.stories.ts+(|x)',
38
- '**/*.mdx',
39
- ],
28
+ sourceMap: false,
29
+ exclude: ['**/__snapshots__/*', '**/*.test.ts+(|x)', '**/*.stories.ts+(|x)', '**/*.mdx'],
40
30
  }),
31
+ peerDepsExternal(), // Don't include peer dependencies, should be given by client.
32
+ resolve(), // Resolve paths
41
33
  terser(),
42
34
  ],
43
35
  },
44
- {
45
- input: 'lib/index.d.ts',
46
- output: [{ file: 'lib/index.d.ts', format: 'esm' }],
47
- plugins: [dts()],
48
- },
49
36
  ];
@@ -0,0 +1,5 @@
1
+ jest.mock('./src/utils/generateId', () => ({
2
+ generateId: jest.fn(() => 'test-id'),
3
+ }));
4
+
5
+ global.ResizeObserver = require('resize-observer-polyfill');
package/setupTests.js ADDED
@@ -0,0 +1,6 @@
1
+ require('@testing-library/jest-dom');
2
+ require('jest-styled-components');
3
+ require('@testing-library/jest-dom/extend-expect');
4
+ const { toHaveNoViolations } = require('jest-axe');
5
+
6
+ expect.extend(toHaveNoViolations);
@@ -0,0 +1,41 @@
1
+ import { Meta, Canvas, Props } from '@storybook/addon-docs/blocks';
2
+ import Accordion from './Accordion';
3
+ import Integration from '../../common/Integration';
4
+
5
+ <Meta title="Components/UI/Accordion" component={Accordion} />
6
+
7
+ # Accordion
8
+
9
+ <Canvas>
10
+ <div style={{ width: 328, display: 'flex', flexDirection: 'column', gap: '20px' }}>
11
+ <Accordion label="Label">
12
+ Content goes here...
13
+ </Accordion>
14
+ <Accordion label="Label" glyphName="info" glyphColor="#37424D">
15
+ Content goes here...
16
+ </Accordion>
17
+ <Accordion label="Label" accessorySlot={<Integration name="fedex" style={{ marginRight: '12px', width: '40px', height: '40px' }} />}>
18
+ Content goes here...
19
+ </Accordion>
20
+ </div>
21
+ </Canvas>
22
+
23
+ ## Usage
24
+
25
+ ```jsx
26
+ import { VeeqoUI, VeeqoCommon } from '@veeqo/components';s
27
+ const { Accordion } = VeeqoUI;
28
+
29
+ <Accordion label="Label">
30
+ Content goes here...
31
+ </Accordion>
32
+
33
+ // With an accessorySlot
34
+ <Accordion label="Label" accessorySlot={<VeeqoCommon.Glyph name="info" />}>
35
+ Content goes here...
36
+ </Accordion>
37
+ ```
38
+
39
+ ## Props
40
+
41
+ <Props of={Accordion} />
@@ -0,0 +1,29 @@
1
+ import React from 'react';
2
+ import type { Meta, StoryObj } from '@storybook/react';
3
+ import { Accordion } from '.';
4
+ import { CrossIcon } from '../../tempIcons/CrossIcon';
5
+
6
+ const meta = {
7
+ title: 'Components/UI/Accordion',
8
+ component: Accordion,
9
+ tags: ['autodocs'],
10
+ } satisfies Meta<typeof Accordion>;
11
+
12
+ export default meta;
13
+
14
+ type Story = StoryObj<typeof meta>;
15
+
16
+ export const Default: Story = {
17
+ args: {
18
+ label: 'Label text',
19
+ children: 'Accordion content',
20
+ },
21
+ };
22
+
23
+ export const WithIcon: Story = {
24
+ args: {
25
+ label: 'Label text',
26
+ iconSlot: <CrossIcon />,
27
+ children: 'Accordion content',
28
+ },
29
+ };
@@ -0,0 +1,34 @@
1
+ import React from 'react';
2
+ import { render, screen } from '@testing-library/react';
3
+ import { Accordion } from '.';
4
+
5
+ describe('Accordion', () => {
6
+ it('renders correctly', () => {
7
+ const { container } = render(
8
+ <Accordion label="test-label">
9
+ <p>Accordion content</p>
10
+ </Accordion>,
11
+ );
12
+ expect(container).toMatchSnapshot();
13
+ });
14
+
15
+ it('hides content on mount', () => {
16
+ render(
17
+ <Accordion label="test-label">
18
+ <p>Test content</p>
19
+ </Accordion>,
20
+ );
21
+ const content = screen.queryByText('Test content');
22
+ expect(content).toBeNull();
23
+ });
24
+
25
+ it('shows content on mount when overidden', () => {
26
+ render(
27
+ <Accordion label="test-label" shouldOpenOnMount>
28
+ <p>Test content</p>
29
+ </Accordion>,
30
+ );
31
+ const content = screen.queryByText('Test content');
32
+ expect(content).toBeVisible();
33
+ });
34
+ });
@@ -0,0 +1,62 @@
1
+ import React, { FC, ReactNode, useState, useCallback, useEffect } from 'react';
2
+ import { CSSTransition } from 'react-transition-group';
3
+
4
+ import { Content, TapBar, Top, Text, Arrow, Left, Right, Description } from './styled';
5
+ import { BaseContainer } from '../BaseContainer';
6
+
7
+ export interface AccordionProps {
8
+ children: ReactNode;
9
+ label: string;
10
+ iconSlot?: ReactNode;
11
+ className?: string;
12
+ timeout?: number;
13
+ transitionClassnames?: string;
14
+ description?: string;
15
+ shouldOpenOnMount?: boolean;
16
+ }
17
+
18
+ export const Accordion: FC<AccordionProps> = ({
19
+ className,
20
+ children,
21
+ label,
22
+ iconSlot,
23
+ timeout = 350,
24
+ transitionClassnames = 'content',
25
+ description,
26
+ shouldOpenOnMount,
27
+ }: AccordionProps) => {
28
+ const [shouldOpen, setShouldOpen] = useState(false);
29
+ const handleOpen = useCallback(() => setShouldOpen(!shouldOpen), [shouldOpen]);
30
+
31
+ useEffect(() => {
32
+ if (!shouldOpenOnMount) return;
33
+ if (shouldOpenOnMount === shouldOpen) return;
34
+ setShouldOpen(shouldOpenOnMount);
35
+ // eslint-disable-next-line react-hooks/exhaustive-deps
36
+ }, []);
37
+
38
+ return (
39
+ <BaseContainer className={className}>
40
+ <TapBar shouldOpen={shouldOpen} onClick={handleOpen}>
41
+ <Top>
42
+ <Left>
43
+ {iconSlot}
44
+ <Text variant="body">{label}</Text>
45
+ </Left>
46
+ <Right>
47
+ <Arrow name="downArrow" shouldOpen={shouldOpen} />
48
+ </Right>
49
+ </Top>
50
+ {description && <Description variant="hintText">{description}</Description>}
51
+ </TapBar>
52
+ <CSSTransition
53
+ in={shouldOpen}
54
+ timeout={timeout}
55
+ classNames={transitionClassnames}
56
+ unmountOnExit
57
+ >
58
+ <Content>{children}</Content>
59
+ </CSSTransition>
60
+ </BaseContainer>
61
+ );
62
+ };