reso-ui 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (445) hide show
  1. package/.github/workflows/cd.yml +49 -0
  2. package/.github/workflows/ci.yml +55 -0
  3. package/.github/workflows/release.yml +41 -0
  4. package/.husky/commit-msg +4 -0
  5. package/.storybook/main.js +51 -0
  6. package/.storybook/preview.js +9 -0
  7. package/CHANGELOG.md +20 -0
  8. package/README.md +209 -0
  9. package/__mocks__/fileMock.js +2 -0
  10. package/__mocks__/styleMock.js +2 -0
  11. package/commitlint.config.js +6 -0
  12. package/custom.d.ts +8 -0
  13. package/dist/09f84f6035cfbf7c3984b6177d36b516.ttf +0 -0
  14. package/dist/0d5fdfd739931f51a5df.ttf +1 -0
  15. package/dist/0e407c5680c91e584bb084ebfb5c086b.ttf +0 -0
  16. package/dist/2e942562af5b9b655c1f.ttf +1 -0
  17. package/dist/2f6d81277badc25ac944.ttf +1 -0
  18. package/dist/32743a4d0c4282e2070b574e6e5038ab.ttf +0 -0
  19. package/dist/3727d88dec67e1e78cf987dab60d9887.ttf +0 -0
  20. package/dist/3fcedd69c66d642ae94c.ttf +1 -0
  21. package/dist/404e299be26d78e6679447ea7cb2d41f.ttf +0 -0
  22. package/dist/47afb8d0034314dd9508.ttf +1 -0
  23. package/dist/4a24733ca942ad738fa2.ttf +1 -0
  24. package/dist/4e860c8656d815bb2429.ttf +1 -0
  25. package/dist/4e8cea18952c83074ec35f7bf1b176c4.ttf +0 -0
  26. package/dist/4ed78cd5d64af4efc3c714622b9372d4.ttf +0 -0
  27. package/dist/5568b72206d0e08121c5.ttf +1 -0
  28. package/dist/5ccd942a8800a68d44b6d3f5431909ec.ttf +0 -0
  29. package/dist/6fca6423291a2d06943a.ttf +1 -0
  30. package/dist/791134e64e8ef9da3f77.ttf +1 -0
  31. package/dist/8081832fc5cfbf634aa664a9eff0350e.ttf +0 -0
  32. package/dist/8c5e890c33607ed0e632.ttf +1 -0
  33. package/dist/9445d60ed014306b6aec1c69bf9d0174.ttf +0 -0
  34. package/dist/94b768c07879dde09ab4d5f6ad92cbc6.ttf +0 -0
  35. package/dist/9e1bb626874ed49aa343d66b8d66ceaf.ttf +0 -0
  36. package/dist/9e50c04f0efdf7813013.ttf +1 -0
  37. package/dist/9f57e7d4017ef9b93ae75e2c86f00d60.ttf +0 -0
  38. package/dist/a61eaf4c2e4d44d6db6a576706e9e6ae.ttf +0 -0
  39. package/dist/b10e7a6e913ca664cbdcb17894f9b419.ttf +0 -0
  40. package/dist/c0ee626f116bbcc4c721.ttf +1 -0
  41. package/dist/c27d458a5358094ac974.ttf +1 -0
  42. package/dist/c27efdacccfbcbd14ff2.ttf +1 -0
  43. package/dist/c76ea376f095f2e1e5138b226ad0f9cd.ttf +0 -0
  44. package/dist/cc7ee35ca49c83d4cfca932a03139f99.ttf +0 -0
  45. package/dist/cce5625b56ec678e42021270b84ef400.ttf +0 -0
  46. package/dist/ce3fff31c0f262aca227664f6f0d2fa2.ttf +0 -0
  47. package/dist/d01ea7f941ca3838ae97.ttf +1 -0
  48. package/dist/db767bc3ab4b2e42b4b1.ttf +1 -0
  49. package/dist/eacee5bb9c7fee5939aebf2335e5106a.ttf +0 -0
  50. package/dist/eebe2ceaa4fd239fe3fb.ttf +1 -0
  51. package/dist/eef56d4542bc2932ff9f.ttf +1 -0
  52. package/dist/f072662071f642a2e2b9.ttf +1 -0
  53. package/dist/f41b63c0bb0963ace821a2b99458c1cd.ttf +0 -0
  54. package/dist/f456d233db96b6889eeb.ttf +1 -0
  55. package/dist/fb248a35b11180453c6879a29d94eff4.ttf +0 -0
  56. package/dist/fb71f2d88c40660bb2e0.ttf +1 -0
  57. package/dist/main.js +2 -0
  58. package/dist/main.js.LICENSE.txt +20 -0
  59. package/jest-dom-setup.ts +1 -0
  60. package/jest.config.js +194 -0
  61. package/package.json +71 -0
  62. package/public/fallback-image-example.jpg +0 -0
  63. package/public/hero-example.jpg +0 -0
  64. package/public/image-example-2.jpg +0 -0
  65. package/public/image-example-3.jpg +0 -0
  66. package/public/image-example-4.jpg +0 -0
  67. package/public/image-example.jpg +0 -0
  68. package/public/index.html +12 -0
  69. package/release.config.js +29 -0
  70. package/src/App.scss +35 -0
  71. package/src/components/Banners/Banner/Banner.tsx +60 -0
  72. package/src/components/Banners/Banner/__test__/Banner.test.tsx +88 -0
  73. package/src/components/Banners/Banner/index.ts +3 -0
  74. package/src/components/Banners/Banner/stories/Banner.stories.tsx +81 -0
  75. package/src/components/Banners/Banner/stories/storiesStyle.scss +4 -0
  76. package/src/components/Banners/Banner/styles/Banner.layout.scss +51 -0
  77. package/src/components/Banners/Banner-Wrapper/Banner-Wrapper.tsx +45 -0
  78. package/src/components/Banners/Banner-Wrapper/__test__/Banner-Wrapper.test.tsx +72 -0
  79. package/src/components/Banners/Banner-Wrapper/index.ts +3 -0
  80. package/src/components/Banners/Banner-Wrapper/stories/Banner-Wrapper.stories.tsx +90 -0
  81. package/src/components/Banners/Banner-Wrapper/styles/Banner-Wrapper.layout.scss +18 -0
  82. package/src/components/Banners/index.ts +3 -0
  83. package/src/components/Buttons/Back/Back.tsx +80 -0
  84. package/src/components/Buttons/Back/__test__/Back.test.tsx +51 -0
  85. package/src/components/Buttons/Back/index.ts +3 -0
  86. package/src/components/Buttons/Back/stories/Back.stories.tsx +74 -0
  87. package/src/components/Buttons/Back/stories/storiesStyle.scss +11 -0
  88. package/src/components/Buttons/Back/styles/Back.layout.scss +12 -0
  89. package/src/components/Buttons/Back/styles/Back.theme.scss +7 -0
  90. package/src/components/Buttons/Button/Button.tsx +85 -0
  91. package/src/components/Buttons/Button/__test__/Button.test.tsx +66 -0
  92. package/src/components/Buttons/Button/index.ts +2 -0
  93. package/src/components/Buttons/Button/stories/Button.stories.tsx +90 -0
  94. package/src/components/Buttons/Button/stories/storiesStyle.scss +7 -0
  95. package/src/components/Buttons/Button/styles/Button.layout.scss +30 -0
  96. package/src/components/Buttons/Button/styles/Button.theme.scss +42 -0
  97. package/src/components/Buttons/index.ts +3 -0
  98. package/src/components/Card/Card-Container/Card-Container.tsx +59 -0
  99. package/src/components/Card/Card-Container/__test__/Card-Container.test.tsx +62 -0
  100. package/src/components/Card/Card-Container/index.ts +3 -0
  101. package/src/components/Card/Card-Container/stories/Card-Container.stories.tsx +45 -0
  102. package/src/components/Card/Card-Container/styles/Card-Container.layout.scss +8 -0
  103. package/src/components/Card/Card-Container/styles/Card-Container.theme.scss +9 -0
  104. package/src/components/Card/Card-Content/Card-Content.tsx +51 -0
  105. package/src/components/Card/Card-Content/__test__/Card-Content.test.tsx +84 -0
  106. package/src/components/Card/Card-Content/index.ts +3 -0
  107. package/src/components/Card/Card-Content/stories/Card-Content.stories.tsx +62 -0
  108. package/src/components/Card/Card-Content/styles/Card-Content.layout.scss +12 -0
  109. package/src/components/Card/Card-Summary-Value/Card-Summary-Value.tsx +39 -0
  110. package/src/components/Card/Card-Summary-Value/__test__/Card-Summary-Value.test.tsx +43 -0
  111. package/src/components/Card/Card-Summary-Value/index.ts +3 -0
  112. package/src/components/Card/Card-Summary-Value/stories/Card-Summary-Value.stories.tsx +60 -0
  113. package/src/components/Card/Card-Summary-Value/styles/Card-Summary-Value.layout.scss +7 -0
  114. package/src/components/Card/index.ts +4 -0
  115. package/src/components/Containers/Center-Container/Center-Container.tsx +40 -0
  116. package/src/components/Containers/Center-Container/__test__/Center-Container.test.tsx +39 -0
  117. package/src/components/Containers/Center-Container/index.ts +3 -0
  118. package/src/components/Containers/Center-Container/stories/Center-Container.stories.tsx +35 -0
  119. package/src/components/Containers/Center-Container/stories/storiesStyle.scss +10 -0
  120. package/src/components/Containers/Center-Container/styles/Center-Container.layout.scss +6 -0
  121. package/src/components/Containers/Flex/Flex.tsx +93 -0
  122. package/src/components/Containers/Flex/__test__/Flex.test.tsx +359 -0
  123. package/src/components/Containers/Flex/index.ts +3 -0
  124. package/src/components/Containers/Flex/stories/Flex.stories.tsx +73 -0
  125. package/src/components/Containers/Flex/stories/storiesStyle.scss +6 -0
  126. package/src/components/Containers/Flex/styles/Flex.layout.scss +54 -0
  127. package/src/components/Containers/Horizontal-Scroll-Container/Horizontal-Scroll-Container.tsx +51 -0
  128. package/src/components/Containers/Horizontal-Scroll-Container/__test__/Horizontal-Scroll-Container.test.tsx +50 -0
  129. package/src/components/Containers/Horizontal-Scroll-Container/index.ts +3 -0
  130. package/src/components/Containers/Horizontal-Scroll-Container/stories/Horizontal-Scroll-Container.stories.tsx +89 -0
  131. package/src/components/Containers/Horizontal-Scroll-Container/styles/Horizontal-Scroll-Container.layout.scss +12 -0
  132. package/src/components/Containers/Horizontal-Scroll-Item/Horizontal-Scroll-Item.tsx +48 -0
  133. package/src/components/Containers/Horizontal-Scroll-Item/__test__/Horizontal-Scroll-Item.test.tsx +50 -0
  134. package/src/components/Containers/Horizontal-Scroll-Item/index.ts +3 -0
  135. package/src/components/Containers/Horizontal-Scroll-Item/stories/Horizontal-Scroll-Item.stories.tsx +59 -0
  136. package/src/components/Containers/Horizontal-Scroll-Item/styles/Horizontal-Scroll-Item.layout.scss +5 -0
  137. package/src/components/Containers/Loading-Container/Loading-Container.tsx +100 -0
  138. package/src/components/Containers/Loading-Container/__test__/Loading-Container.test.tsx +197 -0
  139. package/src/components/Containers/Loading-Container/index.ts +3 -0
  140. package/src/components/Containers/Loading-Container/stories/Loading-Container.stories.tsx +113 -0
  141. package/src/components/Containers/Loading-Container/styles/Loading-Container.layout.scss +13 -0
  142. package/src/components/Containers/View/View.tsx +57 -0
  143. package/src/components/Containers/View/__test__/View.test.tsx +61 -0
  144. package/src/components/Containers/View/index.ts +3 -0
  145. package/src/components/Containers/View/stories/View.stories.tsx +60 -0
  146. package/src/components/Containers/View/stories/storiesStyle.scss +12 -0
  147. package/src/components/Containers/View/styles/View.layout.scss +6 -0
  148. package/src/components/Containers/View/styles/View.theme.scss +7 -0
  149. package/src/components/Containers/index.ts +7 -0
  150. package/src/components/Date-Selector/Date-Selector.tsx +266 -0
  151. package/src/components/Date-Selector/__test__/Date-Selector.test.tsx +435 -0
  152. package/src/components/Date-Selector/components/Date-Component-Navigation/Date-Component-Navigation.tsx +178 -0
  153. package/src/components/Date-Selector/components/Date-Component-Navigation/__test__/Date-Component-Navigation.test.tsx +297 -0
  154. package/src/components/Date-Selector/components/Date-Component-Navigation/styles/Date-Component-Navigation.layout.scss +26 -0
  155. package/src/components/Date-Selector/components/Date-Component-Navigation/styles/Date-Component-Navigation.theme.scss +12 -0
  156. package/src/components/Date-Selector/components/Date-Day-Name/Date-Day-Name.tsx +52 -0
  157. package/src/components/Date-Selector/components/Date-Day-Name/__test__/Date-Day-Name.test.tsx +52 -0
  158. package/src/components/Date-Selector/components/Date-Day-Name/styles/Date-Day-Name.layout.scss +5 -0
  159. package/src/components/Date-Selector/components/Date-Day-Name/styles/Date-Day-Name.theme.scss +4 -0
  160. package/src/components/Date-Selector/components/Date-Day-Number/Date-Day-Number.tsx +119 -0
  161. package/src/components/Date-Selector/components/Date-Day-Number/__test__/Date-Day-Number.test.tsx +201 -0
  162. package/src/components/Date-Selector/components/Date-Day-Number/styles/Date-Day-Number.layout.scss +22 -0
  163. package/src/components/Date-Selector/components/Date-Day-Number/styles/Date-Day-Number.theme.scss +15 -0
  164. package/src/components/Date-Selector/components/Date-Days-Grid/Date-Days-Grid.tsx +300 -0
  165. package/src/components/Date-Selector/components/Date-Days-Grid/__test__/Date-Days-Grid.test.tsx +536 -0
  166. package/src/components/Date-Selector/components/Date-Days-Grid/styles/Date-Days-Grid.layout.scss +11 -0
  167. package/src/components/Date-Selector/components/Date-Days-Grid/styles/Date-Days-Grid.theme.scss +3 -0
  168. package/src/components/Date-Selector/components/Date-Selector-Header/Date-Selector-Header.tsx +65 -0
  169. package/src/components/Date-Selector/components/Date-Selector-Header/__test__/Date-Selector-Header.test.tsx +101 -0
  170. package/src/components/Date-Selector/components/Date-Selector-Header/styles/Date-Selector-Header.layout.scss +27 -0
  171. package/src/components/Date-Selector/components/Date-Selector-Header/styles/Date-Selector-Header.theme.scss +4 -0
  172. package/src/components/Date-Selector/index.ts +3 -0
  173. package/src/components/Date-Selector/stories/Date-Selector.stories.tsx +140 -0
  174. package/src/components/Date-Selector/stories/storiesStyle.scss +4 -0
  175. package/src/components/Date-Selector/styles/Date-Selector.layout.scss +36 -0
  176. package/src/components/Date-Selector/styles/Date-Selector.shared.scss +4 -0
  177. package/src/components/Date-Selector/styles/Date-Selector.theme.scss +9 -0
  178. package/src/components/Date-Selector/types/index.ts +77 -0
  179. package/src/components/Date-Selector/utils/__test__/Date-Selector-Utils.test.ts +62 -0
  180. package/src/components/Date-Selector/utils/index.ts +76 -0
  181. package/src/components/Dialog/Dialog.tsx +213 -0
  182. package/src/components/Dialog/__test__/Dialog.test.tsx +220 -0
  183. package/src/components/Dialog/index.ts +3 -0
  184. package/src/components/Dialog/stories/Dialog.stories.tsx +124 -0
  185. package/src/components/Dialog/styles/Dialog.layout.scss +38 -0
  186. package/src/components/Dialog/styles/Dialog.theme.scss +21 -0
  187. package/src/components/Errors/Component-Error/Component-Error.tsx +92 -0
  188. package/src/components/Errors/Component-Error/__test__/Component-Error.test.tsx +93 -0
  189. package/src/components/Errors/Component-Error/index.ts +3 -0
  190. package/src/components/Errors/Component-Error/stories/Component-Error.stories.tsx +55 -0
  191. package/src/components/Errors/Component-Error/stories/storiesStyle.scss +4 -0
  192. package/src/components/Errors/Component-Error/styles/Component-Error.layout.scss +27 -0
  193. package/src/components/Errors/Component-Error/styles/Component-Error.theme.scss +12 -0
  194. package/src/components/Errors/Full-Screen-Error/Full-Screen-Error.tsx +91 -0
  195. package/src/components/Errors/Full-Screen-Error/__test__/Full-Screen-Error.test.tsx +81 -0
  196. package/src/components/Errors/Full-Screen-Error/index.ts +3 -0
  197. package/src/components/Errors/Full-Screen-Error/stories/Full-Screen-Error.stories.tsx +69 -0
  198. package/src/components/Errors/Full-Screen-Error/styles/Full-Screen-Error.layout.scss +26 -0
  199. package/src/components/Errors/Full-Screen-Error/styles/Full-Screen-Error.theme.scss +7 -0
  200. package/src/components/Errors/index.ts +3 -0
  201. package/src/components/Example/Example.tsx +51 -0
  202. package/src/components/Example/__test__/Example.test.tsx +12 -0
  203. package/src/components/Example/index.ts +3 -0
  204. package/src/components/Example/stories/Example.stories.tsx +48 -0
  205. package/src/components/Example/stories/storiesStyle.scss +4 -0
  206. package/src/components/Example/styles/Example.layout.scss +3 -0
  207. package/src/components/Example/styles/Example.theme.scss +8 -0
  208. package/src/components/External-Links/External-Links.tsx +93 -0
  209. package/src/components/External-Links/__test__/External-Links.test.tsx +81 -0
  210. package/src/components/External-Links/index.ts +3 -0
  211. package/src/components/External-Links/stories/External-Links.stories.tsx +111 -0
  212. package/src/components/External-Links/stories/storiesStyle.scss +7 -0
  213. package/src/components/External-Links/styles/External-Links.layout.scss +14 -0
  214. package/src/components/External-Links/styles/External-Links.theme.scss +4 -0
  215. package/src/components/Footer/Footer.tsx +56 -0
  216. package/src/components/Footer/__test__/Footer.test.tsx +63 -0
  217. package/src/components/Footer/index.ts +3 -0
  218. package/src/components/Footer/stories/Footer.stories.tsx +52 -0
  219. package/src/components/Footer/stories/storiesStyle.scss +5 -0
  220. package/src/components/Footer/styles/Footer.layout.scss +13 -0
  221. package/src/components/Footer/styles/Footer.theme.scss +4 -0
  222. package/src/components/Form/Form-Container/Form-Container.tsx +62 -0
  223. package/src/components/Form/Form-Container/__test__/Form-Container.test.tsx +75 -0
  224. package/src/components/Form/Form-Container/index.ts +3 -0
  225. package/src/components/Form/Form-Container/stories/Form-Container.stories.tsx +105 -0
  226. package/src/components/Form/Form-Container/styles/Form-Container.layout.scss +2 -0
  227. package/src/components/Form/Form-Container/styles/Form-Container.theme.scss +2 -0
  228. package/src/components/Form/Form-Input-Container/Form-Input-Container.tsx +61 -0
  229. package/src/components/Form/Form-Input-Container/__test__/Form-Input-Container.test.tsx +97 -0
  230. package/src/components/Form/Form-Input-Container/index.ts +3 -0
  231. package/src/components/Form/Form-Input-Container/stories/Form-Input-Container.stories.tsx +72 -0
  232. package/src/components/Form/Form-Input-Container/styles/Form-Input-Container.layout.scss +2 -0
  233. package/src/components/Form/Form-Input-Container/styles/Form-Input-Container.theme.scss +2 -0
  234. package/src/components/Form/Form-Types.ts +20 -0
  235. package/src/components/Form/Inputs/Input-Label/Input-Label.tsx +110 -0
  236. package/src/components/Form/Inputs/Input-Label/index.ts +3 -0
  237. package/src/components/Form/Inputs/Input-Label/styles/Input-Label.layout.scss +35 -0
  238. package/src/components/Form/Inputs/Input-Label/styles/Input-Label.theme.scss +7 -0
  239. package/src/components/Form/Inputs/Submit-Button/Submit-Button.tsx +61 -0
  240. package/src/components/Form/Inputs/Submit-Button/index.ts +3 -0
  241. package/src/components/Form/Inputs/Submit-Button/styles/Submit-Button.layout.scss +11 -0
  242. package/src/components/Form/Inputs/Submit-Button/styles/Submit-Button.theme.scss +6 -0
  243. package/src/components/Form/Inputs/Text-Input/Text-Input.tsx +100 -0
  244. package/src/components/Form/Inputs/Text-Input/index.ts +3 -0
  245. package/src/components/Form/Inputs/Text-Input/styles/Text-Input.layout.scss +12 -0
  246. package/src/components/Form/Inputs/Text-Input/styles/Text-Input.theme.scss +10 -0
  247. package/src/components/Form/Inputs/sharedStyles.scss +11 -0
  248. package/src/components/Form/Modular/Form-Contexts-Repository.ts +26 -0
  249. package/src/components/Form/Modular/Form-Data-Context.ts +11 -0
  250. package/src/components/Form/Modular/Hooks.ts +127 -0
  251. package/src/components/Form/Modular/Parent-Form-Context-Provider.tsx +22 -0
  252. package/src/components/Form/Sub-Form-Container/Sub-Form-Container.tsx +83 -0
  253. package/src/components/Form/Sub-Form-Container/__test__/Sub-Form-Container.test.tsx +82 -0
  254. package/src/components/Form/Sub-Form-Container/index.ts +3 -0
  255. package/src/components/Form/Sub-Form-Container/stories/Sub-Form-Container.stories.tsx +121 -0
  256. package/src/components/Form/Sub-Form-Container/styles/Sub-Form-Container.layout.scss +7 -0
  257. package/src/components/Form/Sub-Form-Container/styles/Sub-Form-Container.theme.scss +19 -0
  258. package/src/components/Form/index.ts +12 -0
  259. package/src/components/Icon/Icon.tsx +71 -0
  260. package/src/components/Icon/__test__/Icon.test.tsx +56 -0
  261. package/src/components/Icon/index.ts +3 -0
  262. package/src/components/Icon/stories/Icon.stories.tsx +98 -0
  263. package/src/components/Icon/styles/Icon.layout.scss +8 -0
  264. package/src/components/Icon/styles/Icon.theme.scss +0 -0
  265. package/src/components/Images/Hero/Hero.tsx +59 -0
  266. package/src/components/Images/Hero/__test__/Hero.test.tsx +102 -0
  267. package/src/components/Images/Hero/index.ts +3 -0
  268. package/src/components/Images/Hero/stories/Hero.stories.tsx +52 -0
  269. package/src/components/Images/Hero/stories/storyStyles.scss +3 -0
  270. package/src/components/Images/Hero/styles/Hero.layout.scss +13 -0
  271. package/src/components/Images/Image/Image.tsx +134 -0
  272. package/src/components/Images/Image/__test__/Image.test.tsx +149 -0
  273. package/src/components/Images/Image/index.ts +3 -0
  274. package/src/components/Images/Image/stories/Image.stories.tsx +90 -0
  275. package/src/components/Images/Image/stories/storyStyles.scss +3 -0
  276. package/src/components/Images/Image/styles/Image.layout.scss +48 -0
  277. package/src/components/Images/Multi-Image-Viewer/Multi-Image-Viewer.tsx +199 -0
  278. package/src/components/Images/Multi-Image-Viewer/__test__/Multi-Image-Viewer.test.tsx +317 -0
  279. package/src/components/Images/Multi-Image-Viewer/index.ts +3 -0
  280. package/src/components/Images/Multi-Image-Viewer/stories/Multi-Image-Viewer.stories.tsx +155 -0
  281. package/src/components/Images/Multi-Image-Viewer/stories/storiesStyle.scss +8 -0
  282. package/src/components/Images/Multi-Image-Viewer/styles/Multi-Image-Viewer.layout.scss +29 -0
  283. package/src/components/Images/Multi-Image-Viewer/styles/Multi-Image-Viewer.theme.scss +3 -0
  284. package/src/components/Images/index.ts +4 -0
  285. package/src/components/Loaders/Loader/Loader.tsx +77 -0
  286. package/src/components/Loaders/Loader/__test__/Loader.test.tsx +51 -0
  287. package/src/components/Loaders/Loader/index.ts +3 -0
  288. package/src/components/Loaders/Loader/stories/Loader.stories.tsx +49 -0
  289. package/src/components/Loaders/Loader/stories/storiesStyle.scss +7 -0
  290. package/src/components/Loaders/Loader/styles/Component-Loader.layout.scss +43 -0
  291. package/src/components/Loaders/Loader/styles/Component-Loader.theme.scss +9 -0
  292. package/src/components/Loaders/index.ts +2 -0
  293. package/src/components/Modal/Modal-Body/Modal-Body.tsx +52 -0
  294. package/src/components/Modal/Modal-Body/__test__/Modal-Body.test.tsx +61 -0
  295. package/src/components/Modal/Modal-Body/index.ts +3 -0
  296. package/src/components/Modal/Modal-Body/stories/Modal-Body.stories.tsx +75 -0
  297. package/src/components/Modal/Modal-Body/styles/Modal-Body.layout.scss +4 -0
  298. package/src/components/Modal/Modal-Container/Modal-Container.tsx +79 -0
  299. package/src/components/Modal/Modal-Container/__test__/Modal-Container.test.tsx +88 -0
  300. package/src/components/Modal/Modal-Container/index.ts +3 -0
  301. package/src/components/Modal/Modal-Container/stories/Modal-Container.stories.tsx +73 -0
  302. package/src/components/Modal/Modal-Container/stories/storiesStyle.scss +5 -0
  303. package/src/components/Modal/Modal-Container/styles/Modal-Container.layout.scss +21 -0
  304. package/src/components/Modal/Modal-Container/styles/Modal-Container.theme.scss +3 -0
  305. package/src/components/Modal/Modal-Header/Modal-Header.tsx +65 -0
  306. package/src/components/Modal/Modal-Header/__test__/Modal-Header.test.tsx +74 -0
  307. package/src/components/Modal/Modal-Header/index.ts +3 -0
  308. package/src/components/Modal/Modal-Header/stories/Modal-Header.stories.tsx +74 -0
  309. package/src/components/Modal/Modal-Header/styles/Modal-Header.layout.scss +15 -0
  310. package/src/components/Modal/Modal-Header/styles/Modal-Header.theme.scss +4 -0
  311. package/src/components/Modal/index.ts +4 -0
  312. package/src/components/Panel/Panel-Container/Panel-Container.tsx +47 -0
  313. package/src/components/Panel/Panel-Container/__test__/Panel-Container.test.tsx +50 -0
  314. package/src/components/Panel/Panel-Container/index.ts +3 -0
  315. package/src/components/Panel/Panel-Container/stories/Panel-Container.stories.tsx +49 -0
  316. package/src/components/Panel/Panel-Container/stories/storiesStyle.scss +3 -0
  317. package/src/components/Panel/Panel-Container/styles/Panel-Container.layout.scss +9 -0
  318. package/src/components/Panel/Panel-Container/styles/Panel-Container.theme.scss +4 -0
  319. package/src/components/Panel/Panel-Row/Panel-Row.tsx +80 -0
  320. package/src/components/Panel/Panel-Row/__test__/Panel-Row.test.tsx +45 -0
  321. package/src/components/Panel/Panel-Row/index.ts +3 -0
  322. package/src/components/Panel/Panel-Row/stories/Panel-Row.stories.tsx +57 -0
  323. package/src/components/Panel/Panel-Row/styles/Panel-Row.layout.scss +16 -0
  324. package/src/components/Panel/Panel-Title/Panel-Title.tsx +47 -0
  325. package/src/components/Panel/Panel-Title/__test__/Panel-Title.test.tsx +28 -0
  326. package/src/components/Panel/Panel-Title/index.ts +3 -0
  327. package/src/components/Panel/Panel-Title/stories/Panel-Title.stories.tsx +47 -0
  328. package/src/components/Panel/Panel-Title/styles/Panel-Title.layout.scss +7 -0
  329. package/src/components/Panel/Panel-Title/styles/Panel-Title.theme.scss +3 -0
  330. package/src/components/Panel/index.ts +4 -0
  331. package/src/components/Quantity-Counter/Quantity-Counter.tsx +73 -0
  332. package/src/components/Quantity-Counter/__test__/Quantity-Counter.test.tsx +75 -0
  333. package/src/components/Quantity-Counter/index.ts +3 -0
  334. package/src/components/Quantity-Counter/stories/Quantity-Counter.stories.tsx +26 -0
  335. package/src/components/Quantity-Counter/styles/Quantity-Counter.layout.scss +18 -0
  336. package/src/components/Quantity-Counter/styles/Quantity-Counter.theme.scss +3 -0
  337. package/src/hooks/useClickOutside.ts +21 -0
  338. package/src/hooks/useDisableBodyScroll.ts +15 -0
  339. package/src/icons/index.ts +50 -0
  340. package/src/icons/svg/ChevronDoubleLeft.svg +4 -0
  341. package/src/icons/svg/ChevronDoubleRight.svg +4 -0
  342. package/src/icons/svg/ChevronSingleLeft.svg +3 -0
  343. package/src/icons/svg/ChevronSingleRight.svg +3 -0
  344. package/src/icons/svg/about.svg +3 -0
  345. package/src/icons/svg/cart.svg +5 -0
  346. package/src/icons/svg/dashboard.svg +13 -0
  347. package/src/icons/svg/delete.svg +3 -0
  348. package/src/icons/svg/dropdown_down.svg +3 -0
  349. package/src/icons/svg/dropdown_up.svg +3 -0
  350. package/src/icons/svg/edit.svg +4 -0
  351. package/src/icons/svg/home.svg +3 -0
  352. package/src/icons/svg/loader.svg +10 -0
  353. package/src/icons/svg/logout.svg +12 -0
  354. package/src/icons/svg/orders.svg +3 -0
  355. package/src/icons/svg/products.svg +11 -0
  356. package/src/icons/svg/profile.svg +3 -0
  357. package/src/icons/svg/settings.svg +3 -0
  358. package/src/icons/svg/star-empty.svg +3 -0
  359. package/src/icons/svg/star-full.svg +3 -0
  360. package/src/icons/svg/star-half.svg +4 -0
  361. package/src/icons/svg/upload.svg +4 -0
  362. package/src/icons/svg/users.svg +15 -0
  363. package/src/index.ts +35 -0
  364. package/src/index.tsx +6 -0
  365. package/src/pending_components/form/check-box/check-box.js +30 -0
  366. package/src/pending_components/form/check-box/check-box.scss +34 -0
  367. package/src/pending_components/form/clickable-button/clickable-button.js +30 -0
  368. package/src/pending_components/form/clickable-button/clickable-button.scss +24 -0
  369. package/src/pending_components/form/dropdown-select/dropdown-select.js +87 -0
  370. package/src/pending_components/form/dropdown-select/dropdown-select.scss +108 -0
  371. package/src/pending_components/form/external-links-array-input/external-link-array-input.scss +39 -0
  372. package/src/pending_components/form/external-links-array-input/external-links-array-input.js +234 -0
  373. package/src/pending_components/form/form/form.js +17 -0
  374. package/src/pending_components/form/form/form.scss +0 -0
  375. package/src/pending_components/form/form-group/form-group.js +20 -0
  376. package/src/pending_components/form/form-group/form-group.scss +21 -0
  377. package/src/pending_components/form/input-field/input-field.js +57 -0
  378. package/src/pending_components/form/input-field/input-field.scss +22 -0
  379. package/src/pending_components/form/input-file/input-file.js +124 -0
  380. package/src/pending_components/form/input-file/input-file.scss +76 -0
  381. package/src/pending_components/form/input-label/input-label.js +47 -0
  382. package/src/pending_components/form/input-label/input-label.scss +17 -0
  383. package/src/pending_components/form/radio-button/radio-button.js +37 -0
  384. package/src/pending_components/form/radio-button/radio-button.scss +18 -0
  385. package/src/pending_components/form/submit-button/submit-button.js +18 -0
  386. package/src/pending_components/form/submit-button/submit-button.scss +24 -0
  387. package/src/pending_components/form/submit-button-fixed-button/submit-button-fixed-button.js +17 -0
  388. package/src/pending_components/form/submit-button-fixed-button/submit-button-fixed-button.scss +23 -0
  389. package/src/pending_components/form/submit-button-fixed-container/submit-button-fixed-container.js +9 -0
  390. package/src/pending_components/form/submit-button-fixed-container/submit-button-fixed-container.scss +15 -0
  391. package/src/pending_components/form/text-area/text-area.js +42 -0
  392. package/src/pending_components/form/text-area/text-area.scss +16 -0
  393. package/src/styles/_defaults.scss +22 -0
  394. package/src/styles/_fonts.scss +153 -0
  395. package/src/styles/_mixins.scss +33 -0
  396. package/src/styles/_spacings.scss +497 -0
  397. package/src/styles/_transitions.scss +27 -0
  398. package/src/styles/_typography.scss +85 -0
  399. package/src/styles/_variables.scss +5 -0
  400. package/src/styles/fonts/Dancing_Script/OFL.txt +93 -0
  401. package/src/styles/fonts/Dancing_Script/README.txt +66 -0
  402. package/src/styles/fonts/Dancing_Script/static/DancingScript-Bold.ttf +0 -0
  403. package/src/styles/fonts/Dancing_Script/static/DancingScript-Medium.ttf +0 -0
  404. package/src/styles/fonts/Dancing_Script/static/DancingScript-Regular.ttf +0 -0
  405. package/src/styles/fonts/Dancing_Script/static/DancingScript-SemiBold.ttf +0 -0
  406. package/src/styles/fonts/Poppins/OFL.txt +93 -0
  407. package/src/styles/fonts/Poppins/Poppins-Black.ttf +0 -0
  408. package/src/styles/fonts/Poppins/Poppins-BlackItalic.ttf +0 -0
  409. package/src/styles/fonts/Poppins/Poppins-Bold.ttf +0 -0
  410. package/src/styles/fonts/Poppins/Poppins-BoldItalic.ttf +0 -0
  411. package/src/styles/fonts/Poppins/Poppins-ExtraBold.ttf +0 -0
  412. package/src/styles/fonts/Poppins/Poppins-ExtraBoldItalic.ttf +0 -0
  413. package/src/styles/fonts/Poppins/Poppins-ExtraLight.ttf +0 -0
  414. package/src/styles/fonts/Poppins/Poppins-ExtraLightItalic.ttf +0 -0
  415. package/src/styles/fonts/Poppins/Poppins-Italic.ttf +0 -0
  416. package/src/styles/fonts/Poppins/Poppins-Light.ttf +0 -0
  417. package/src/styles/fonts/Poppins/Poppins-LightItalic.ttf +0 -0
  418. package/src/styles/fonts/Poppins/Poppins-Medium.ttf +0 -0
  419. package/src/styles/fonts/Poppins/Poppins-MediumItalic.ttf +0 -0
  420. package/src/styles/fonts/Poppins/Poppins-Regular.ttf +0 -0
  421. package/src/styles/fonts/Poppins/Poppins-SemiBold.ttf +0 -0
  422. package/src/styles/fonts/Poppins/Poppins-SemiBoldItalic.ttf +0 -0
  423. package/src/styles/fonts/Poppins/Poppins-Thin.ttf +0 -0
  424. package/src/styles/fonts/Poppins/Poppins-ThinItalic.ttf +0 -0
  425. package/src/styles/global.scss +113 -0
  426. package/src/styles/vars/_colors.scss +48 -0
  427. package/src/styles/vars/_fontSizes.scss +10 -0
  428. package/src/styles/vars/_layout.scss +67 -0
  429. package/src/styles/vars/_palette.scss +27 -0
  430. package/src/styles/vars/_transitions.scss +2 -0
  431. package/src/styles/vars_and_mixins.scss +2 -0
  432. package/src/types/IComponent.ts +9 -0
  433. package/src/types/IImageObject.ts +4 -0
  434. package/src/types/ILink.ts +4 -0
  435. package/src/types/IProduct.ts +6 -0
  436. package/src/types/ISpacingsProps.ts +28 -0
  437. package/src/types/ImageClickable.ts +3 -0
  438. package/src/types/Theme.ts +10 -0
  439. package/src/utils/arrays.ts +3 -0
  440. package/src/utils/styles.ts +128 -0
  441. package/src/utils/validations.ts +23 -0
  442. package/tsconfig.json +24 -0
  443. package/tslint.json +36 -0
  444. package/webpack.config.js +79 -0
  445. package/webpack.prod.js +24 -0
@@ -0,0 +1,359 @@
1
+ import React from "react";
2
+ import { render, screen } from "@testing-library/react";
3
+ import { Flex } from "@components/Containers/Flex";
4
+
5
+ const SampleComponent = () => {
6
+ return (
7
+ <div data-testid="flex-container-child-test">
8
+ <p>This is a sample component</p>
9
+ </div>
10
+ );
11
+ };
12
+
13
+ describe("Flex Container Component Unit Tests", () => {
14
+ const defaultProps = {};
15
+
16
+ test("should render itself and children without error", () => {
17
+ const { debug } = render(
18
+ <Flex>
19
+ <SampleComponent />
20
+ </Flex>
21
+ );
22
+
23
+ // debug();
24
+ const component = screen.queryByTestId("flex-container-root");
25
+ expect(component).toBeTruthy();
26
+
27
+ const child = screen.queryByTestId("flex-container-child-test");
28
+ expect(child).toBeTruthy();
29
+ });
30
+
31
+ test("should have class default classes when no props are passed", () => {
32
+ render(
33
+ <Flex>
34
+ <SampleComponent />
35
+ </Flex>
36
+ );
37
+
38
+ const component = screen.queryByTestId("flex-container-root");
39
+ expect(component).toHaveClass("flex_container");
40
+ expect(component).toHaveClass("flex_row");
41
+ expect(component).toHaveClass("flex_justify_space-between");
42
+ expect(component).toHaveClass("flex_align_center");
43
+ expect(component).toHaveClass("flex_shrink");
44
+ expect(component).not.toHaveClass("flex_wrap");
45
+ expect(component).not.toHaveClass("flex_grow");
46
+ });
47
+
48
+ test("should set class [flex_column] when passed as prop", () => {
49
+ render(
50
+ <Flex direction="column">
51
+ <SampleComponent />
52
+ </Flex>
53
+ );
54
+
55
+ const component = screen.queryByTestId("flex-container-root");
56
+ expect(component).toHaveClass("flex_column");
57
+ });
58
+
59
+ test("should set class [flex_justify_start] when passed as prop", () => {
60
+ render(
61
+ <Flex justify="start">
62
+ <SampleComponent />
63
+ </Flex>
64
+ );
65
+
66
+ const component = screen.queryByTestId("flex-container-root");
67
+ expect(component).toHaveClass("flex_justify_start");
68
+ });
69
+
70
+ test("should set class [flex_align_end] when passed as prop", () => {
71
+ render(
72
+ <Flex align="end">
73
+ <SampleComponent />
74
+ </Flex>
75
+ );
76
+
77
+ const component = screen.queryByTestId("flex-container-root");
78
+ expect(component).toHaveClass("flex_align_end");
79
+ });
80
+
81
+ test("should have class [flex_wrap] when passed as prop", () => {
82
+ render(
83
+ <Flex wrap>
84
+ <SampleComponent />
85
+ </Flex>
86
+ );
87
+
88
+ const component = screen.queryByTestId("flex-container-root");
89
+ expect(component).toHaveClass("flex_wrap");
90
+ });
91
+
92
+ test("should set class [flex_no_shrink] when passed as prop", () => {
93
+ render(
94
+ <Flex shrink={false}>
95
+ <SampleComponent />
96
+ </Flex>
97
+ );
98
+
99
+ const component = screen.queryByTestId("flex-container-root");
100
+ expect(component).toHaveClass("flex_no_shrink");
101
+ });
102
+
103
+ test("should set class [flex_grow] when passed as prop", () => {
104
+ render(
105
+ <Flex grow={true}>
106
+ <SampleComponent />
107
+ </Flex>
108
+ );
109
+
110
+ const component = screen.queryByTestId("flex-container-root");
111
+ expect(component).toHaveClass("flex_grow");
112
+ });
113
+
114
+ test("should have class [width_full] when passed as prop", () => {
115
+ render(
116
+ <Flex fullWidth>
117
+ <SampleComponent />
118
+ </Flex>
119
+ );
120
+
121
+ const component = screen.queryByTestId("flex-container-root");
122
+ expect(component).toHaveClass("width_full");
123
+ });
124
+
125
+ test("should have class [width_fit_content] when passed as prop", () => {
126
+ render(
127
+ <Flex widthFitContent>
128
+ <SampleComponent />
129
+ </Flex>
130
+ );
131
+
132
+ const component = screen.queryByTestId("flex-container-root");
133
+ expect(component).toHaveClass("width_fit_content");
134
+ });
135
+
136
+ test("should have custom className when passed as prop", () => {
137
+ render(
138
+ <Flex rootClassName="test_custom_className">
139
+ <SampleComponent />
140
+ </Flex>
141
+ );
142
+
143
+ const component = screen.queryByTestId("flex-container-root");
144
+ expect(component).toHaveClass("test_custom_className");
145
+ });
146
+
147
+ test("should set styles [flex-basis] when passed auto as prop", () => {
148
+ render(
149
+ <Flex basis={"auto"}>
150
+ <SampleComponent />
151
+ </Flex>
152
+ );
153
+
154
+ const component = screen.queryByTestId("flex-container-root");
155
+ expect(component).toHaveStyle("flex-basis: auto");
156
+ });
157
+
158
+ test("should set styles [flex-basis] when passed string value as prop", () => {
159
+ render(
160
+ <Flex basis={"200px"}>
161
+ <SampleComponent />
162
+ </Flex>
163
+ );
164
+
165
+ const component = screen.queryByTestId("flex-container-root");
166
+ expect(component).toHaveStyle("flex-basis: 200px");
167
+ });
168
+
169
+ test("should set styles [flex-basis] when passed falsy value as prop", () => {
170
+ render(
171
+ <Flex basis={false}>
172
+ <SampleComponent />
173
+ </Flex>
174
+ );
175
+
176
+ const component = screen.queryByTestId("flex-container-root");
177
+ expect(component).toHaveStyle("flex-basis: 0");
178
+ });
179
+ });
180
+
181
+ describe("Flex Container Margins Unit Tests", () => {
182
+ test("should have class [spacing-ma-0] when passed as prop", () => {
183
+ render(
184
+ <Flex ma={0}>
185
+ <SampleComponent />
186
+ </Flex>
187
+ );
188
+
189
+ const component = screen.queryByTestId("flex-container-root");
190
+ expect(component).toHaveClass("spacing-ma-0");
191
+ });
192
+
193
+ test("should have class [spacing-ma-5] when passed as prop", () => {
194
+ render(
195
+ <Flex ma={5}>
196
+ <SampleComponent />
197
+ </Flex>
198
+ );
199
+
200
+ const component = screen.queryByTestId("flex-container-root");
201
+ expect(component).toHaveClass("spacing-ma-5");
202
+ });
203
+
204
+ test("should have class [spacing-mv-5] when passed as prop", () => {
205
+ render(
206
+ <Flex mv={5}>
207
+ <SampleComponent />
208
+ </Flex>
209
+ );
210
+
211
+ const component = screen.queryByTestId("flex-container-root");
212
+ expect(component).toHaveClass("spacing-mv-5");
213
+ });
214
+
215
+ test("should have class [spacing-mh-5] when passed as prop", () => {
216
+ render(
217
+ <Flex mh={5}>
218
+ <SampleComponent />
219
+ </Flex>
220
+ );
221
+
222
+ const component = screen.queryByTestId("flex-container-root");
223
+ expect(component).toHaveClass("spacing-mh-5");
224
+ });
225
+
226
+ test("should have class [spacing-mt-5] when passed as prop", () => {
227
+ render(
228
+ <Flex mt={5}>
229
+ <SampleComponent />
230
+ </Flex>
231
+ );
232
+
233
+ const component = screen.queryByTestId("flex-container-root");
234
+ expect(component).toHaveClass("spacing-mt-5");
235
+ });
236
+
237
+ test("should have class [spacing-mb-5] when passed as prop", () => {
238
+ render(
239
+ <Flex mb={5}>
240
+ <SampleComponent />
241
+ </Flex>
242
+ );
243
+
244
+ const component = screen.queryByTestId("flex-container-root");
245
+ expect(component).toHaveClass("spacing-mb-5");
246
+ });
247
+
248
+ test("should have class [spacing-mr-5] when passed as prop", () => {
249
+ render(
250
+ <Flex mr={5}>
251
+ <SampleComponent />
252
+ </Flex>
253
+ );
254
+
255
+ const component = screen.queryByTestId("flex-container-root");
256
+ expect(component).toHaveClass("spacing-mr-5");
257
+ });
258
+
259
+ test("should have class [spacing-ml-5] when passed as prop", () => {
260
+ render(
261
+ <Flex ml={5}>
262
+ <SampleComponent />
263
+ </Flex>
264
+ );
265
+
266
+ const component = screen.queryByTestId("flex-container-root");
267
+ expect(component).toHaveClass("spacing-ml-5");
268
+ });
269
+ });
270
+
271
+ describe("Flex Container Paddings Unit Tests", () => {
272
+ test("should have class [spacing-pa-0] when passed as prop", () => {
273
+ render(
274
+ <Flex pa={0}>
275
+ <SampleComponent />
276
+ </Flex>
277
+ );
278
+
279
+ const component = screen.queryByTestId("flex-container-root");
280
+ expect(component).toHaveClass("spacing-pa-0");
281
+ });
282
+
283
+ test("should have class [spacing-pa-5] when passed as prop", () => {
284
+ render(
285
+ <Flex pa={5}>
286
+ <SampleComponent />
287
+ </Flex>
288
+ );
289
+
290
+ const component = screen.queryByTestId("flex-container-root");
291
+ expect(component).toHaveClass("spacing-pa-5");
292
+ });
293
+
294
+ test("should have class [spacing-pv-5] when passed as prop", () => {
295
+ render(
296
+ <Flex pv={5}>
297
+ <SampleComponent />
298
+ </Flex>
299
+ );
300
+
301
+ const component = screen.queryByTestId("flex-container-root");
302
+ expect(component).toHaveClass("spacing-pv-5");
303
+ });
304
+
305
+ test("should have class [spacing-ph-5] when passed as prop", () => {
306
+ render(
307
+ <Flex ph={5}>
308
+ <SampleComponent />
309
+ </Flex>
310
+ );
311
+
312
+ const component = screen.queryByTestId("flex-container-root");
313
+ expect(component).toHaveClass("spacing-ph-5");
314
+ });
315
+
316
+ test("should have class [spacing-pt-5] when passed as prop", () => {
317
+ render(
318
+ <Flex pt={5}>
319
+ <SampleComponent />
320
+ </Flex>
321
+ );
322
+
323
+ const component = screen.queryByTestId("flex-container-root");
324
+ expect(component).toHaveClass("spacing-pt-5");
325
+ });
326
+
327
+ test("should have class [spacing-pb-5] when passed as prop", () => {
328
+ render(
329
+ <Flex pb={5}>
330
+ <SampleComponent />
331
+ </Flex>
332
+ );
333
+
334
+ const component = screen.queryByTestId("flex-container-root");
335
+ expect(component).toHaveClass("spacing-pb-5");
336
+ });
337
+
338
+ test("should have class [spacing-pr-5] when passed as prop", () => {
339
+ render(
340
+ <Flex pr={5}>
341
+ <SampleComponent />
342
+ </Flex>
343
+ );
344
+
345
+ const component = screen.queryByTestId("flex-container-root");
346
+ expect(component).toHaveClass("spacing-pr-5");
347
+ });
348
+
349
+ test("should have class [spacing-pl-5] when passed as prop", () => {
350
+ render(
351
+ <Flex pl={5}>
352
+ <SampleComponent />
353
+ </Flex>
354
+ );
355
+
356
+ const component = screen.queryByTestId("flex-container-root");
357
+ expect(component).toHaveClass("spacing-pl-5");
358
+ });
359
+ });
@@ -0,0 +1,3 @@
1
+ /* istanbul ignore file */
2
+ import "@styles/global.scss";
3
+ export * from "./Flex";
@@ -0,0 +1,73 @@
1
+ import React from "react";
2
+ import { ComponentStory, ComponentMeta } from "@storybook/react";
3
+
4
+ // always import from index to include global styles
5
+ import { Flex } from "@components/Containers/Flex";
6
+ import "./storiesStyle.scss";
7
+
8
+ import dedent from "ts-dedent";
9
+
10
+ const SampleChildComponent = () => {
11
+ return <div className="story_test_box">Test Child</div>;
12
+ };
13
+
14
+ // More on default export: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
15
+ export default {
16
+ title: "Containers/Flex",
17
+ component: Flex,
18
+ // More on argTypes: https://storybook.js.org/docs/react/api/argtypes
19
+ argTypes: {
20
+ // backgroundColor: { control: "color" },
21
+ },
22
+ parameters: {
23
+ docs: {
24
+ description: {
25
+ component: dedent`
26
+ A container component with Display Flex features enabled.
27
+
28
+ It supports both Margin and Padding props.
29
+ `,
30
+ },
31
+ },
32
+ },
33
+ } as ComponentMeta<typeof Flex>;
34
+
35
+ const ComponentTemplate: ComponentStory<typeof Flex> = (args) => (
36
+ <Flex {...args}>
37
+ <>
38
+ <SampleChildComponent />
39
+ <SampleChildComponent />
40
+ </>
41
+ </Flex>
42
+ );
43
+
44
+ export const DefaultWithBorder = ComponentTemplate.bind({});
45
+ DefaultWithBorder.args = {
46
+ borderColor: "blue",
47
+ };
48
+
49
+ export const DefaultWithPaddingAll = ComponentTemplate.bind({});
50
+ DefaultWithPaddingAll.args = {
51
+ borderColor: "blue",
52
+ pa: 5,
53
+ };
54
+
55
+ export const DirectionColumn = ComponentTemplate.bind({});
56
+ DirectionColumn.args = {
57
+ borderColor: "blue",
58
+ direction: "column",
59
+ };
60
+
61
+ export const JustifyStart = ComponentTemplate.bind({});
62
+ JustifyStart.args = {
63
+ borderColor: "blue",
64
+ justify: "start",
65
+ };
66
+
67
+ export const CustomStylesAndAlign = ComponentTemplate.bind({});
68
+ CustomStylesAndAlign.args = {
69
+ borderColor: "blue",
70
+ justify: "start",
71
+ rootStyles: { height: "300px" },
72
+ align: "end",
73
+ };
@@ -0,0 +1,6 @@
1
+ .story_test_box {
2
+ height: 200px;
3
+ width: 200px;
4
+ border: 2px solid red;
5
+ background-color: yellow;
6
+ }
@@ -0,0 +1,54 @@
1
+ .flex_container {
2
+ display: flex;
3
+ // min-height: $main_height;
4
+ // border: 2px solid blue;
5
+ }
6
+ .flex_row {
7
+ flex-direction: row;
8
+ }
9
+ .flex_column {
10
+ flex-direction: column;
11
+ }
12
+ .flex_justify_start {
13
+ justify-content: flex-start;
14
+ }
15
+ .flex_justify_end {
16
+ justify-content: flex-end;
17
+ }
18
+ .flex_justify_space-between {
19
+ justify-content: space-between;
20
+ }
21
+ .flex_justify_space-around {
22
+ justify-content: space-around;
23
+ }
24
+ .flex_justify_center {
25
+ justify-content: center;
26
+ }
27
+ .flex_align_start {
28
+ align-items: flex-start;
29
+ }
30
+ .flex_align_end {
31
+ align-items: flex-end;
32
+ }
33
+ .flex_align_center {
34
+ align-items: center;
35
+ }
36
+ .flex_grow {
37
+ flex-grow: 1;
38
+ }
39
+ .flex_shrink {
40
+ flex-shrink: 1;
41
+ }
42
+ .flex_no_shrink {
43
+ flex-shrink: 0;
44
+ }
45
+ .flex_wrap {
46
+ flex-wrap: wrap;
47
+ }
48
+
49
+ .flex_half {
50
+ flex: 0.48;
51
+ }
52
+ .flex_full {
53
+ flex: 1;
54
+ }
@@ -0,0 +1,51 @@
1
+ import React from "react";
2
+
3
+ // import base interface
4
+ import IComponent from "@interfaces/IComponent";
5
+ import { IPaddingProps, IMarginProps } from "@interfaces/ISpacingsProps";
6
+
7
+ // styles
8
+ import "./styles/Horizontal-Scroll-Container.layout.scss";
9
+
10
+ // utils
11
+ import {
12
+ createComponentStyles,
13
+ createLayoutStyles,
14
+ withSpacingsProps,
15
+ } from "@utils/styles";
16
+
17
+ export interface IHSCProps extends IComponent, IPaddingProps, IMarginProps {
18
+ children: React.ReactNode;
19
+ inheritWidth?: boolean;
20
+ }
21
+
22
+ export const HorizontalScrollContainer = ({
23
+ children,
24
+ inheritWidth = false,
25
+ rootClassName,
26
+ rootStyles = {},
27
+ ...spacingsProps
28
+ }: IHSCProps) => {
29
+ const containerStyles = createComponentStyles(
30
+ createLayoutStyles(
31
+ withSpacingsProps(
32
+ {
33
+ hsc_container: true,
34
+ hsc_container_inheritWidth: inheritWidth,
35
+ },
36
+ spacingsProps
37
+ ),
38
+ rootClassName
39
+ )
40
+ );
41
+
42
+ return (
43
+ <div
44
+ className={containerStyles}
45
+ style={rootStyles}
46
+ data-testid="horizontal-scroll-container-root"
47
+ >
48
+ {children}
49
+ </div>
50
+ );
51
+ };
@@ -0,0 +1,50 @@
1
+ import React from "react";
2
+ import { render, screen } from "@testing-library/react";
3
+ import { HorizontalScrollContainer } from "@components/Containers/Horizontal-Scroll-Container";
4
+
5
+ const SampleComponent = () => {
6
+ return (
7
+ <div data-testid="hsc-container-child-test">
8
+ <p>This is a sample component</p>
9
+ </div>
10
+ );
11
+ };
12
+
13
+ describe("Horizontal Scoll Container Component Unit Tests", () => {
14
+ test("should render itself and children without error", () => {
15
+ const { debug } = render(
16
+ <HorizontalScrollContainer>
17
+ <SampleComponent />
18
+ </HorizontalScrollContainer>
19
+ );
20
+
21
+ // debug();
22
+ const component = screen.queryByTestId("horizontal-scroll-container-root");
23
+ expect(component).toBeTruthy();
24
+
25
+ const child = screen.queryByTestId("hsc-container-child-test");
26
+ expect(child).toBeTruthy();
27
+ });
28
+
29
+ test("should apply custom className when provided as prop", () => {
30
+ render(
31
+ <HorizontalScrollContainer rootClassName="sample_class">
32
+ <SampleComponent />
33
+ </HorizontalScrollContainer>
34
+ );
35
+
36
+ const component = screen.queryByTestId("horizontal-scroll-container-root");
37
+ expect(component).toHaveClass("sample_class");
38
+ });
39
+
40
+ test("should apply custom styles when provided as prop", () => {
41
+ render(
42
+ <HorizontalScrollContainer rootStyles={{ border: "2px solid red" }}>
43
+ <SampleComponent />
44
+ </HorizontalScrollContainer>
45
+ );
46
+
47
+ const component = screen.queryByTestId("horizontal-scroll-container-root");
48
+ expect(component).toHaveStyle("border: 2px solid red");
49
+ });
50
+ });
@@ -0,0 +1,3 @@
1
+ /* istanbul ignore file */
2
+ import "@styles/global.scss";
3
+ export * from "./Horizontal-Scroll-Container";
@@ -0,0 +1,89 @@
1
+ import React from "react";
2
+ import { ComponentStory, ComponentMeta } from "@storybook/react";
3
+
4
+ // always import from index to include global styles
5
+ import { HorizontalScrollContainer } from "@components/Containers/Horizontal-Scroll-Container";
6
+ import { HorizontalScrollItem } from "@components/Containers/Horizontal-Scroll-Item";
7
+
8
+ import dedent from "ts-dedent";
9
+
10
+ // More on default export: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
11
+ export default {
12
+ title: "Containers/Horizontal Scroll Container",
13
+ component: HorizontalScrollContainer,
14
+ // More on argTypes: https://storybook.js.org/docs/react/api/argtypes
15
+ argTypes: {
16
+ // backgroundColor: { control: "color" },
17
+ },
18
+ parameters: {
19
+ docs: {
20
+ description: {
21
+ component: dedent`
22
+ A container component that enables horizontal arrangements of children, scrollable when overflown.
23
+
24
+ The children to this component must have \`display: inline-block\`. Alternatively, you can use the HorizontalScrollItem to wrap your children component.
25
+
26
+ If you wish to have children with \`display: flex\`, you can wrap that component with the HorizontalScrollItem.
27
+
28
+ It supports both Margin and Padding props.
29
+ `,
30
+ },
31
+ },
32
+ },
33
+ } as ComponentMeta<typeof HorizontalScrollContainer>;
34
+
35
+ const ComponentTemplate: ComponentStory<typeof HorizontalScrollContainer> = (
36
+ args
37
+ ) => (
38
+ <HorizontalScrollContainer {...args}>
39
+ <HorizontalScrollItem mh={5}>
40
+ <div
41
+ style={{
42
+ width: "200px",
43
+ height: "200px",
44
+ border: "2px solid red",
45
+ }}
46
+ >
47
+ sample child
48
+ </div>
49
+ </HorizontalScrollItem>
50
+ <HorizontalScrollItem mh={5}>
51
+ <div
52
+ style={{
53
+ width: "200px",
54
+ height: "200px",
55
+ border: "2px solid red",
56
+ }}
57
+ >
58
+ sample child
59
+ </div>
60
+ </HorizontalScrollItem>
61
+ <HorizontalScrollItem mh={5}>
62
+ <div
63
+ style={{
64
+ width: "200px",
65
+ height: "200px",
66
+ border: "2px solid red",
67
+ }}
68
+ >
69
+ sample child
70
+ </div>
71
+ </HorizontalScrollItem>
72
+ </HorizontalScrollContainer>
73
+ );
74
+
75
+ export const DefaultWithBorder = ComponentTemplate.bind({});
76
+ DefaultWithBorder.args = {
77
+ rootStyles: {
78
+ border: "2px solid blue",
79
+ },
80
+ pv: 3,
81
+ };
82
+
83
+ export const withPaddingProps = ComponentTemplate.bind({});
84
+ withPaddingProps.args = {
85
+ rootStyles: {
86
+ border: "2px solid blue",
87
+ },
88
+ pa: 5,
89
+ };
@@ -0,0 +1,12 @@
1
+ .hsc_container {
2
+ // border: 2px solid $primary-grey-medium;
3
+ // border-radius: 0 0 $border-radius-small $border-radius-small;
4
+ width: 540px;
5
+ overflow-x: auto;
6
+ white-space: nowrap;
7
+ }
8
+
9
+ .hsc_container_inheritWidth {
10
+ width: 100%;
11
+ min-width: inherit;
12
+ }