@mailstep/design-system 0.2.0-beta.0 → 0.2.0-beta.2

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 (378) hide show
  1. package/Blocks/CornerDialog/CornerDialog.d.ts +2 -0
  2. package/Blocks/CornerDialog/CornerDialog.js +18 -0
  3. package/Blocks/CornerDialog/index.d.ts +3 -0
  4. package/Blocks/CornerDialog/index.js +2 -0
  5. package/Blocks/CornerDialog/stories/CornerDialog.stories.d.ts +14 -0
  6. package/Blocks/CornerDialog/stories/CornerDialog.stories.js +50 -0
  7. package/Blocks/CornerDialog/styles.d.ts +12 -0
  8. package/Blocks/CornerDialog/styles.js +21 -0
  9. package/Blocks/CornerDialog/types.d.ts +16 -0
  10. package/Blocks/CornerDialog/types.js +1 -0
  11. package/Blocks/CornerDialog/utils.d.ts +3 -0
  12. package/Blocks/CornerDialog/utils.js +12 -0
  13. package/Blocks/ImageList/ImageList.d.ts +3 -0
  14. package/Blocks/ImageList/ImageList.js +29 -0
  15. package/Blocks/ImageList/components/AddPhoto/index.d.ts +7 -0
  16. package/Blocks/ImageList/components/AddPhoto/index.js +63 -0
  17. package/Blocks/ImageList/components/AddPhoto/styles.d.ts +2 -0
  18. package/Blocks/ImageList/components/AddPhoto/styles.js +8 -0
  19. package/Blocks/ImageList/components/CloseButton/index.d.ts +6 -0
  20. package/Blocks/ImageList/components/CloseButton/index.js +7 -0
  21. package/Blocks/ImageList/components/CloseButton/styles.d.ts +1 -0
  22. package/Blocks/ImageList/components/CloseButton/styles.js +7 -0
  23. package/Blocks/ImageList/components/ImageElement/index.d.ts +9 -0
  24. package/Blocks/ImageList/components/ImageElement/index.js +11 -0
  25. package/Blocks/ImageList/components/ImageElement/styles.d.ts +2 -0
  26. package/Blocks/ImageList/components/ImageElement/styles.js +8 -0
  27. package/Blocks/ImageList/components/ImageTag/index.d.ts +6 -0
  28. package/Blocks/ImageList/components/ImageTag/index.js +9 -0
  29. package/Blocks/ImageList/components/ImageTag/styles.d.ts +1 -0
  30. package/Blocks/ImageList/components/ImageTag/styles.js +7 -0
  31. package/Blocks/ImageList/index.d.ts +5 -0
  32. package/Blocks/ImageList/index.js +2 -0
  33. package/Blocks/ImageList/styles.d.ts +1 -0
  34. package/Blocks/ImageList/styles.js +7 -0
  35. package/Blocks/ImageList/types.d.ts +12 -0
  36. package/Blocks/ImageList/types.js +1 -0
  37. package/Blocks/LightBox/LightBox.d.ts +3 -0
  38. package/Blocks/LightBox/LightBox.js +15 -0
  39. package/Blocks/LightBox/hooks/useLightBox.d.ts +2 -0
  40. package/Blocks/LightBox/hooks/useLightBox.js +17 -0
  41. package/Blocks/LightBox/index.d.ts +4 -0
  42. package/Blocks/LightBox/index.js +3 -0
  43. package/Blocks/LightBox/styles.d.ts +3 -0
  44. package/Blocks/LightBox/styles.js +9 -0
  45. package/Blocks/LightBox/types.d.ts +24 -0
  46. package/Blocks/LightBox/types.js +1 -0
  47. package/Blocks/Modal/Modal.d.ts +3 -0
  48. package/Blocks/Modal/Modal.js +35 -0
  49. package/Blocks/Modal/hooks/useClickOutside.d.ts +3 -0
  50. package/Blocks/Modal/hooks/useClickOutside.js +30 -0
  51. package/Blocks/Modal/hooks/useModal.d.ts +2 -0
  52. package/Blocks/Modal/hooks/useModal.js +15 -0
  53. package/Blocks/Modal/index.d.ts +5 -0
  54. package/Blocks/Modal/index.js +4 -0
  55. package/Blocks/Modal/stories/Modal.stories.d.ts +26 -0
  56. package/Blocks/Modal/stories/Modal.stories.js +146 -0
  57. package/Blocks/Modal/styles.d.ts +22 -0
  58. package/Blocks/Modal/styles.js +45 -0
  59. package/Blocks/Modal/types.d.ts +45 -0
  60. package/Blocks/Modal/types.js +1 -0
  61. package/Blocks/Modal/utils.d.ts +3 -0
  62. package/Blocks/Modal/utils.js +11 -0
  63. package/Blocks/Tabs/TabContent.d.ts +2 -0
  64. package/Blocks/Tabs/TabContent.js +4 -0
  65. package/Blocks/Tabs/Tabs.d.ts +2 -0
  66. package/Blocks/Tabs/Tabs.js +19 -0
  67. package/Blocks/Tabs/hooks/useTabs.d.ts +2 -0
  68. package/Blocks/Tabs/hooks/useTabs.js +10 -0
  69. package/Blocks/Tabs/index.d.ts +5 -0
  70. package/Blocks/Tabs/index.js +4 -0
  71. package/Blocks/Tabs/stories/Tabs.stories.d.ts +13 -0
  72. package/Blocks/Tabs/stories/Tabs.stories.js +44 -0
  73. package/Blocks/Tabs/styles.d.ts +8 -0
  74. package/Blocks/Tabs/styles.js +15 -0
  75. package/Blocks/Tabs/types.d.ts +27 -0
  76. package/Blocks/Tabs/types.js +1 -0
  77. package/Elements/Alert/Alert.d.ts +3 -0
  78. package/Elements/Alert/Alert.js +32 -0
  79. package/Elements/Alert/index.d.ts +3 -0
  80. package/Elements/Alert/index.js +3 -0
  81. package/Elements/Alert/stories/Alert.stories.d.ts +17 -0
  82. package/Elements/Alert/stories/Alert.stories.js +73 -0
  83. package/Elements/Alert/styles.d.ts +44 -0
  84. package/Elements/Alert/styles.js +33 -0
  85. package/Elements/Alert/types.d.ts +18 -0
  86. package/Elements/Alert/types.js +1 -0
  87. package/Elements/Avatar/Avatar.d.ts +2 -0
  88. package/Elements/Avatar/Avatar.js +37 -0
  89. package/Elements/Avatar/index.d.ts +3 -0
  90. package/Elements/Avatar/index.js +3 -0
  91. package/Elements/Avatar/stories/Avatar.stories.d.ts +12 -0
  92. package/Elements/Avatar/stories/Avatar.stories.js +20 -0
  93. package/Elements/Avatar/types.d.ts +8 -0
  94. package/Elements/Avatar/types.js +1 -0
  95. package/Elements/Badge/Badge.d.ts +12 -0
  96. package/Elements/Badge/Badge.js +40 -0
  97. package/Elements/Badge/index.d.ts +3 -0
  98. package/Elements/Badge/index.js +3 -0
  99. package/Elements/Badge/stories/Badge.stories.d.ts +12 -0
  100. package/Elements/Badge/stories/Badge.stories.js +24 -0
  101. package/Elements/BorderedBox/BorderedBox.d.ts +3 -0
  102. package/Elements/BorderedBox/BorderedBox.js +35 -0
  103. package/Elements/BorderedBox/index.d.ts +3 -0
  104. package/Elements/BorderedBox/index.js +3 -0
  105. package/Elements/BorderedBox/stories/BorderedBox.stories.d.ts +11 -0
  106. package/Elements/BorderedBox/stories/BorderedBox.stories.js +13 -0
  107. package/Elements/BorderedBox/types.d.ts +6 -0
  108. package/Elements/BorderedBox/types.js +1 -0
  109. package/Elements/Button/Button.d.ts +3 -0
  110. package/Elements/Button/Button.js +30 -0
  111. package/Elements/Button/index.d.ts +5 -0
  112. package/Elements/Button/index.js +3 -0
  113. package/Elements/Button/stories/Button.stories.d.ts +20 -0
  114. package/Elements/Button/stories/Button.stories.js +70 -0
  115. package/Elements/Button/styles.d.ts +19 -0
  116. package/Elements/Button/styles.js +48 -0
  117. package/Elements/Button/types.d.ts +22 -0
  118. package/Elements/Button/types.js +1 -0
  119. package/Elements/Card/Card.d.ts +6 -0
  120. package/Elements/Card/Card.js +45 -0
  121. package/Elements/Card/index.d.ts +3 -0
  122. package/Elements/Card/index.js +3 -0
  123. package/Elements/Card/stories/Card.stories.d.ts +15 -0
  124. package/Elements/Card/stories/Card.stories.js +43 -0
  125. package/Elements/Card/stories/CardComponent.stories.d.ts +12 -0
  126. package/Elements/Card/stories/CardComponent.stories.js +27 -0
  127. package/Elements/Card/styles.d.ts +14 -0
  128. package/Elements/Card/styles.js +34 -0
  129. package/Elements/Card/types.d.ts +21 -0
  130. package/Elements/Card/types.js +1 -0
  131. package/Elements/Dropdown/Dropdown.d.ts +3 -0
  132. package/Elements/Dropdown/Dropdown.js +28 -0
  133. package/Elements/Dropdown/index.d.ts +3 -0
  134. package/Elements/Dropdown/index.js +3 -0
  135. package/Elements/Dropdown/stories/Dropdown.stories.d.ts +11 -0
  136. package/Elements/Dropdown/stories/Dropdown.stories.js +14 -0
  137. package/Elements/Dropdown/types.d.ts +10 -0
  138. package/Elements/Dropdown/types.js +1 -0
  139. package/Elements/ErrorMessage/ErrorMessage.d.ts +3 -0
  140. package/Elements/ErrorMessage/ErrorMessage.js +17 -0
  141. package/Elements/ErrorMessage/index.d.ts +3 -0
  142. package/Elements/ErrorMessage/index.js +3 -0
  143. package/Elements/ErrorMessage/stories/ErrorMessage.stories.d.ts +12 -0
  144. package/Elements/ErrorMessage/stories/ErrorMessage.stories.js +19 -0
  145. package/Elements/ErrorMessage/types.d.ts +5 -0
  146. package/Elements/ErrorMessage/types.js +1 -0
  147. package/Elements/Icon/BadgeIcon.d.ts +6 -0
  148. package/Elements/Icon/BadgeIcon.js +51 -0
  149. package/Elements/Icon/Icon.d.ts +8 -0
  150. package/Elements/Icon/Icon.js +245 -0
  151. package/Elements/Icon/icons/Complaint.d.ts +3 -0
  152. package/Elements/Icon/icons/Complaint.js +13 -0
  153. package/Elements/Icon/icons/Expeditions.d.ts +3 -0
  154. package/Elements/Icon/icons/Expeditions.js +13 -0
  155. package/Elements/Icon/icons/FlagCZ.d.ts +3 -0
  156. package/Elements/Icon/icons/FlagCZ.js +13 -0
  157. package/Elements/Icon/icons/FlagUSA.d.ts +3 -0
  158. package/Elements/Icon/icons/FlagUSA.js +13 -0
  159. package/Elements/Icon/icons/HamburgerMenu.d.ts +3 -0
  160. package/Elements/Icon/icons/HamburgerMenu.js +13 -0
  161. package/Elements/Icon/icons/HelpCircle1.d.ts +3 -0
  162. package/Elements/Icon/icons/HelpCircle1.js +13 -0
  163. package/Elements/Icon/icons/Income.d.ts +3 -0
  164. package/Elements/Icon/icons/Income.js +13 -0
  165. package/Elements/Icon/icons/Inventory.d.ts +3 -0
  166. package/Elements/Icon/icons/Inventory.js +13 -0
  167. package/Elements/Icon/icons/MenuItems.d.ts +3 -0
  168. package/Elements/Icon/icons/MenuItems.js +13 -0
  169. package/Elements/Icon/icons/MobileCancel.d.ts +3 -0
  170. package/Elements/Icon/icons/MobileCancel.js +13 -0
  171. package/Elements/Icon/icons/Notification2.d.ts +3 -0
  172. package/Elements/Icon/icons/Notification2.js +13 -0
  173. package/Elements/Icon/icons/Plus1.d.ts +3 -0
  174. package/Elements/Icon/icons/Plus1.js +13 -0
  175. package/Elements/Icon/icons/Products.d.ts +3 -0
  176. package/Elements/Icon/icons/Products.js +13 -0
  177. package/Elements/Icon/icons/Profile.d.ts +3 -0
  178. package/Elements/Icon/icons/Profile.js +13 -0
  179. package/Elements/Icon/icons/Return.d.ts +3 -0
  180. package/Elements/Icon/icons/Return.js +13 -0
  181. package/Elements/Icon/icons/Settings2.d.ts +3 -0
  182. package/Elements/Icon/icons/Settings2.js +13 -0
  183. package/Elements/Icon/icons/Transfer.d.ts +3 -0
  184. package/Elements/Icon/icons/Transfer.js +13 -0
  185. package/Elements/Icon/icons/index.d.ts +17 -0
  186. package/Elements/Icon/icons/index.js +17 -0
  187. package/Elements/Icon/index.d.ts +6 -0
  188. package/Elements/Icon/index.js +5 -0
  189. package/Elements/Icon/stories/BadgeIcon.stories.d.ts +24 -0
  190. package/Elements/Icon/stories/BadgeIcon.stories.js +18 -0
  191. package/Elements/Icon/stories/Icon.stories.d.ts +16 -0
  192. package/Elements/Icon/stories/Icon.stories.js +48 -0
  193. package/Elements/Icon/types.d.ts +22 -0
  194. package/Elements/Icon/types.js +1 -0
  195. package/Elements/Image/Image.d.ts +3 -0
  196. package/Elements/Image/Image.js +26 -0
  197. package/Elements/Image/index.d.ts +3 -0
  198. package/Elements/Image/index.js +3 -0
  199. package/Elements/Image/stories/Image.stories.d.ts +14 -0
  200. package/Elements/Image/stories/Image.stories.js +36 -0
  201. package/Elements/Image/types.d.ts +18 -0
  202. package/Elements/Image/types.js +1 -0
  203. package/Elements/Label/Label.d.ts +6 -0
  204. package/Elements/Label/Label.js +17 -0
  205. package/Elements/Label/index.d.ts +3 -0
  206. package/Elements/Label/index.js +3 -0
  207. package/Elements/Label/stories/Label.stories.d.ts +13 -0
  208. package/Elements/Label/stories/Label.stories.js +20 -0
  209. package/Elements/Line/Line.d.ts +3 -0
  210. package/Elements/Line/Line.js +25 -0
  211. package/Elements/Line/index.d.ts +3 -0
  212. package/Elements/Line/index.js +3 -0
  213. package/Elements/Line/stories/Line.stories.d.ts +16 -0
  214. package/Elements/Line/stories/Line.stories.js +41 -0
  215. package/Elements/Line/types.d.ts +12 -0
  216. package/Elements/Line/types.js +1 -0
  217. package/Elements/Link/Link.d.ts +29 -0
  218. package/Elements/Link/Link.js +56 -0
  219. package/Elements/Link/index.d.ts +3 -0
  220. package/Elements/Link/index.js +3 -0
  221. package/Elements/Link/stories/Link.stories.d.ts +42 -0
  222. package/Elements/Link/stories/Link.stories.js +63 -0
  223. package/Elements/Logo/Logo.d.ts +3 -0
  224. package/Elements/Logo/Logo.js +84 -0
  225. package/Elements/Logo/index.d.ts +3 -0
  226. package/Elements/Logo/index.js +3 -0
  227. package/Elements/Logo/stories/Logo.stories.d.ts +34 -0
  228. package/Elements/Logo/stories/Logo.stories.js +112 -0
  229. package/Elements/Logo/types.d.ts +10 -0
  230. package/Elements/Logo/types.js +1 -0
  231. package/Elements/Pagination/Pagination.d.ts +8 -0
  232. package/Elements/Pagination/Pagination.js +35 -0
  233. package/Elements/Pagination/index.d.ts +3 -0
  234. package/Elements/Pagination/index.js +3 -0
  235. package/Elements/Pagination/stories/Pagination.stories.d.ts +12 -0
  236. package/Elements/Pagination/stories/Pagination.stories.js +22 -0
  237. package/Elements/Pagination/styled.d.ts +15 -0
  238. package/Elements/Pagination/styled.js +26 -0
  239. package/Elements/Paragraph/Paragraph.d.ts +2 -0
  240. package/Elements/Paragraph/Paragraph.js +3 -0
  241. package/Elements/Paragraph/index.d.ts +3 -0
  242. package/Elements/Paragraph/index.js +3 -0
  243. package/Elements/Paragraph/stories/Paragraph.stories.d.ts +17 -0
  244. package/Elements/Paragraph/stories/Paragraph.stories.js +34 -0
  245. package/Elements/Portal/index.d.ts +5 -0
  246. package/Elements/Portal/index.js +14 -0
  247. package/Elements/ProgressBar/ProgressBar.d.ts +9 -0
  248. package/Elements/ProgressBar/ProgressBar.js +9 -0
  249. package/Elements/ProgressBar/index.d.ts +3 -0
  250. package/Elements/ProgressBar/index.js +3 -0
  251. package/Elements/ProgressBar/stories/ProgressBar.stories.d.ts +18 -0
  252. package/Elements/ProgressBar/stories/ProgressBar.stories.js +27 -0
  253. package/Elements/ProgressBar/styles.d.ts +9 -0
  254. package/Elements/ProgressBar/styles.js +19 -0
  255. package/Elements/SimpleLink/SimpleLink.d.ts +19 -0
  256. package/Elements/SimpleLink/SimpleLink.js +17 -0
  257. package/Elements/SimpleLink/index.d.ts +3 -0
  258. package/Elements/SimpleLink/index.js +3 -0
  259. package/Elements/SpaceAround/SpaceAround.d.ts +3 -0
  260. package/Elements/SpaceAround/SpaceAround.js +54 -0
  261. package/Elements/SpaceAround/index.d.ts +4 -0
  262. package/Elements/SpaceAround/index.js +3 -0
  263. package/Elements/SpaceAround/stories/SpaceAround.stories.d.ts +12 -0
  264. package/Elements/SpaceAround/stories/SpaceAround.stories.js +22 -0
  265. package/Elements/SpaceAround/types.d.ts +14 -0
  266. package/Elements/SpaceAround/types.js +1 -0
  267. package/Elements/Spinner/Spinner.d.ts +14 -0
  268. package/Elements/Spinner/Spinner.js +28 -0
  269. package/Elements/Spinner/index.d.ts +3 -0
  270. package/Elements/Spinner/index.js +3 -0
  271. package/Elements/Spinner/stories/Spinner.stories.d.ts +19 -0
  272. package/Elements/Spinner/stories/Spinner.stories.js +56 -0
  273. package/Elements/Spinner/styles.d.ts +4 -0
  274. package/Elements/Spinner/styles.js +20 -0
  275. package/Elements/Spinner/types.d.ts +7 -0
  276. package/Elements/Spinner/types.js +1 -0
  277. package/Elements/Tag/Tag.d.ts +3 -0
  278. package/Elements/Tag/Tag.js +59 -0
  279. package/Elements/Tag/index.d.ts +4 -0
  280. package/Elements/Tag/index.js +4 -0
  281. package/Elements/Tag/palletes.d.ts +5 -0
  282. package/Elements/Tag/palletes.js +10 -0
  283. package/Elements/Tag/stories/Tag.stories.d.ts +19 -0
  284. package/Elements/Tag/stories/Tag.stories.js +72 -0
  285. package/Elements/Tag/stories/components/predefinedTags.d.ts +2 -0
  286. package/Elements/Tag/stories/components/predefinedTags.js +8 -0
  287. package/Elements/Tag/types.d.ts +17 -0
  288. package/Elements/Tag/types.js +1 -0
  289. package/Elements/Text/Text.d.ts +3 -0
  290. package/Elements/Text/Text.js +15 -0
  291. package/Elements/Text/index.d.ts +3 -0
  292. package/Elements/Text/index.js +2 -0
  293. package/Elements/Text/stories/Text.stories.d.ts +16 -0
  294. package/Elements/Text/stories/Text.stories.js +43 -0
  295. package/Elements/Text/types.d.ts +13 -0
  296. package/Elements/Text/types.js +1 -0
  297. package/Elements/Toast/Toast.d.ts +11 -0
  298. package/Elements/Toast/Toast.js +24 -0
  299. package/Elements/Toast/index.d.ts +4 -0
  300. package/Elements/Toast/index.js +3 -0
  301. package/Elements/Toggle/Toggle.d.ts +3 -0
  302. package/Elements/Toggle/Toggle.js +52 -0
  303. package/Elements/Toggle/index.d.ts +3 -0
  304. package/Elements/Toggle/index.js +3 -0
  305. package/Elements/Toggle/stories/Toggle.stories.d.ts +14 -0
  306. package/Elements/Toggle/stories/Toggle.stories.js +33 -0
  307. package/Elements/Toggle/types.d.ts +21 -0
  308. package/Elements/Toggle/types.js +1 -0
  309. package/Elements/Typography/Typography.d.ts +117 -0
  310. package/Elements/Typography/Typography.js +41 -0
  311. package/Elements/Typography/index.d.ts +3 -0
  312. package/Elements/Typography/index.js +3 -0
  313. package/Elements/Typography/stories/Typography.stories.d.ts +20 -0
  314. package/Elements/Typography/stories/Typography.stories.js +20 -0
  315. package/Forms/Checkbox/Checkbox.d.ts +4 -0
  316. package/Forms/Checkbox/Checkbox.js +11 -0
  317. package/Forms/Checkbox/index.d.ts +3 -0
  318. package/Forms/Checkbox/index.js +3 -0
  319. package/Forms/Checkbox/stories/Checkbox.stories.d.ts +14 -0
  320. package/Forms/Checkbox/stories/Checkbox.stories.js +35 -0
  321. package/Forms/Checkbox/styles.d.ts +11 -0
  322. package/Forms/Checkbox/styles.js +26 -0
  323. package/Forms/Checkbox/types.d.ts +16 -0
  324. package/Forms/Checkbox/types.js +1 -0
  325. package/Forms/Input/Input.d.ts +2 -0
  326. package/Forms/Input/Input.js +60 -0
  327. package/Forms/Input/index.d.ts +5 -0
  328. package/Forms/Input/index.js +3 -0
  329. package/Forms/Input/stories/Input.stories.d.ts +17 -0
  330. package/Forms/Input/stories/Input.stories.js +71 -0
  331. package/Forms/Input/styles.d.ts +31 -0
  332. package/Forms/Input/styles.js +57 -0
  333. package/Forms/Input/types.d.ts +49 -0
  334. package/Forms/Input/types.js +1 -0
  335. package/Forms/RadioButton/RadioButton.d.ts +3 -0
  336. package/Forms/RadioButton/RadioButton.js +29 -0
  337. package/Forms/RadioButton/index.d.ts +3 -0
  338. package/Forms/RadioButton/index.js +3 -0
  339. package/Forms/RadioButton/stories/RadioButton.stories.d.ts +14 -0
  340. package/Forms/RadioButton/stories/RadioButton.stories.js +38 -0
  341. package/Forms/RadioButton/styles.d.ts +10 -0
  342. package/Forms/RadioButton/styles.js +15 -0
  343. package/Forms/RadioButton/types.d.ts +12 -0
  344. package/Forms/RadioButton/types.js +1 -0
  345. package/ThemeProvider/ThemeProvider.d.ts +3 -0
  346. package/ThemeProvider/ThemeProvider.js +8 -0
  347. package/ThemeProvider/index.d.ts +5 -0
  348. package/ThemeProvider/index.js +5 -0
  349. package/ThemeProvider/themes/default.d.ts +142 -0
  350. package/ThemeProvider/themes/default.js +144 -0
  351. package/ThemeProvider/themes/index.d.ts +351 -0
  352. package/ThemeProvider/themes/index.js +9 -0
  353. package/ThemeProvider/themes/light.d.ts +3 -0
  354. package/ThemeProvider/themes/light.js +7 -0
  355. package/ThemeProvider/themes/mailwise.d.ts +207 -0
  356. package/ThemeProvider/themes/mailwise.js +214 -0
  357. package/ThemeProvider/types.d.ts +50 -0
  358. package/ThemeProvider/types.js +1 -0
  359. package/index.d.ts +71 -0
  360. package/index.es.js +17500 -0
  361. package/index.js +71 -0
  362. package/index.umd.js +2427 -0
  363. package/package.json +1 -5
  364. package/style.css +1 -0
  365. package/utils/CreateRgba/createRgba.d.ts +3 -0
  366. package/utils/CreateRgba/createRgba.js +16 -0
  367. package/utils/CreateRgba/types.d.ts +1 -0
  368. package/utils/CreateRgba/types.js +1 -0
  369. package/utils/KeyPress/KeyPress.d.ts +3 -0
  370. package/utils/KeyPress/KeyPress.js +17 -0
  371. package/utils/KeyPress/KeyPress.stories.d.ts +10 -0
  372. package/utils/KeyPress/KeyPress.stories.js +18 -0
  373. package/utils/KeyPress/index.d.ts +2 -0
  374. package/utils/KeyPress/index.js +2 -0
  375. package/utils/KeyPress/types.d.ts +6 -0
  376. package/utils/KeyPress/types.js +1 -0
  377. package/utils/index.d.ts +8 -0
  378. package/utils/index.js +7 -0
@@ -0,0 +1,63 @@
1
+ import { Link } from '../';
2
+ var meta = {
3
+ title: 'Elements/Link',
4
+ component: Link,
5
+ tags: ['autodocs'],
6
+ argTypes: {},
7
+ decorators: [],
8
+ };
9
+ export default meta;
10
+ export var External = {
11
+ args: {
12
+ to: { pathname: 'https://www.inventi.cz/' },
13
+ size: 1,
14
+ target: '_blank',
15
+ children: "This is a link",
16
+ },
17
+ };
18
+ export var Success = {
19
+ args: {
20
+ to: { pathname: 'https://www.inventi.cz/' },
21
+ size: 1,
22
+ color: 'success',
23
+ children: "This is a link",
24
+ },
25
+ };
26
+ export var Warning = {
27
+ args: {
28
+ to: { pathname: 'https://www.inventi.cz/' },
29
+ size: 1,
30
+ color: 'success',
31
+ children: "This is a link",
32
+ },
33
+ };
34
+ export var Disabled = {
35
+ args: {
36
+ to: { pathname: 'https://www.inventi.cz/' },
37
+ size: 1,
38
+ target: '_blank',
39
+ disabled: true,
40
+ children: "This is a link",
41
+ },
42
+ };
43
+ export var Size3 = {
44
+ args: {
45
+ to: { pathname: 'https://www.inventi.cz/' },
46
+ size: 3,
47
+ children: "This is a link",
48
+ },
49
+ };
50
+ export var Size5 = {
51
+ args: {
52
+ to: { pathname: 'https://www.inventi.cz/' },
53
+ size: 5,
54
+ children: "This is a link",
55
+ },
56
+ };
57
+ export var Size7 = {
58
+ args: {
59
+ to: { pathname: 'https://www.inventi.cz/' },
60
+ size: 7,
61
+ children: "This is a link",
62
+ },
63
+ };
@@ -0,0 +1,3 @@
1
+ import { LogoProps } from './types';
2
+ declare const Logo: ({ brand, variant, size, width, height, ...rest }: LogoProps) => JSX.Element | null;
3
+ export default Logo;
@@ -0,0 +1,84 @@
1
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
+ return cooked;
4
+ };
5
+ var __assign = (this && this.__assign) || function () {
6
+ __assign = Object.assign || function(t) {
7
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
8
+ s = arguments[i];
9
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
10
+ t[p] = s[p];
11
+ }
12
+ return t;
13
+ };
14
+ return __assign.apply(this, arguments);
15
+ };
16
+ var __rest = (this && this.__rest) || function (s, e) {
17
+ var t = {};
18
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
19
+ t[p] = s[p];
20
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
21
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
22
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
23
+ t[p[i]] = s[p[i]];
24
+ }
25
+ return t;
26
+ };
27
+ import { jsx as _jsx } from "react/jsx-runtime";
28
+ import styled from '@xstyled/styled-components';
29
+ import logoWhiteImage from './assets/mailship/logo_white.png';
30
+ import logoBlackImage from './assets/mailship/logo_black.png';
31
+ import logoMImage from './assets/mailship/logo_m.png';
32
+ import logoSvg from './assets/mailship/mailship-logo.svg';
33
+ import logoMailstepBlack from './assets/mailstep/mailstep_black.svg';
34
+ import logoMailstepWhite from './assets/mailstep/mailstep_white.svg';
35
+ import logoMailwise from './assets/mailwise/mailwiseLogo.svg';
36
+ import logoMailwiseSmall from './assets/mailwise/mailwiseLogoSmall.svg';
37
+ import logoMailwrap from './assets/mailwrap/mailwrapLogo.svg';
38
+ import logoMailstock from './assets/mailstock/mailstock.svg';
39
+ var defaultSizes = {
40
+ small: '30px',
41
+ medium: '46px',
42
+ big: '61px', // cca 200px width on full logo
43
+ };
44
+ var variantMap = {
45
+ mailship: {
46
+ white: logoWhiteImage,
47
+ black: logoBlackImage,
48
+ m: logoMImage,
49
+ s: logoSvg,
50
+ },
51
+ mailwise: {
52
+ black: logoMailwise,
53
+ s: logoMailwiseSmall,
54
+ },
55
+ mailstock: {
56
+ black: logoMailstock,
57
+ },
58
+ mailstep: {
59
+ black: logoMailstepBlack,
60
+ white: logoMailstepWhite,
61
+ },
62
+ mailwrap: {
63
+ black: logoMailwrap,
64
+ },
65
+ };
66
+ var StyledImage = styled.img(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: ", ";\n height: ", ";\n"], ["\n width: ", ";\n height: ", ";\n"])), function (_a) {
67
+ var width = _a.width;
68
+ return width || 'auto';
69
+ }, function (_a) {
70
+ var height = _a.height, width = _a.width, size = _a.size;
71
+ return height || (width ? 'auto' : size ? defaultSizes[size] : defaultSizes['medium']);
72
+ });
73
+ var Logo = function (_a) {
74
+ var _b = _a.brand, brand = _b === void 0 ? 'mailship' : _b, variant = _a.variant, size = _a.size, width = _a.width, height = _a.height, rest = __rest(_a, ["brand", "variant", "size", "width", "height"]);
75
+ var variants = variantMap[brand];
76
+ var logo = variants[variant];
77
+ if (!logo) {
78
+ console.warn('No variant for this logo exists.');
79
+ return null;
80
+ }
81
+ return _jsx(StyledImage, __assign({ src: logo, size: size, width: width, height: height }, rest));
82
+ };
83
+ export default Logo;
84
+ var templateObject_1;
@@ -0,0 +1,3 @@
1
+ import Logo from './Logo';
2
+ export { Logo };
3
+ export default Logo;
@@ -0,0 +1,3 @@
1
+ import Logo from './Logo';
2
+ export { Logo };
3
+ export default Logo;
@@ -0,0 +1,34 @@
1
+ /// <reference types="react" />
2
+ import type { StoryObj } from '@storybook/react';
3
+ declare const meta: {
4
+ title: string;
5
+ component: ({ brand, variant, size, width, height, ...rest }: import("../types").LogoProps) => JSX.Element | null;
6
+ parameters: {
7
+ backgrounds: {
8
+ default: string;
9
+ values: {
10
+ name: string;
11
+ value: string;
12
+ }[];
13
+ };
14
+ };
15
+ tags: string[];
16
+ argTypes: {};
17
+ };
18
+ export default meta;
19
+ type Story = StoryObj<typeof meta>;
20
+ export declare const MailshipBlack: Story;
21
+ export declare const MailshipWhite: Story;
22
+ export declare const MailshipM: Story;
23
+ export declare const MailshipS: Story;
24
+ export declare const MailwiseBlack: Story;
25
+ export declare const MailwiseS: Story;
26
+ export declare const MailstockBlack: Story;
27
+ export declare const MailwrapBlack: Story;
28
+ export declare const MailstepBlack: Story;
29
+ export declare const MailstepWhite: Story;
30
+ export declare const SizeSmall: Story;
31
+ export declare const SizeMedium: Story;
32
+ export declare const SizeBig: Story;
33
+ export declare const SizeCustomWidth: Story;
34
+ export declare const SizeCustomHeight: Story;
@@ -0,0 +1,112 @@
1
+ import Logo from '../Logo';
2
+ var meta = {
3
+ title: 'Elements/Logo',
4
+ component: Logo,
5
+ parameters: {
6
+ backgrounds: {
7
+ default: 'darkGray',
8
+ values: [
9
+ { name: 'darkGray', value: '#333' },
10
+ { name: 'lightGray', value: '#eee' },
11
+ ],
12
+ },
13
+ },
14
+ tags: ['autodocs'],
15
+ argTypes: {},
16
+ };
17
+ export default meta;
18
+ export var MailshipBlack = {
19
+ args: {
20
+ variant: 'black',
21
+ brand: 'mailship',
22
+ },
23
+ };
24
+ export var MailshipWhite = {
25
+ args: {
26
+ brand: 'mailship',
27
+ variant: 'white',
28
+ },
29
+ };
30
+ export var MailshipM = {
31
+ args: {
32
+ brand: 'mailship',
33
+ variant: 'm',
34
+ },
35
+ };
36
+ export var MailshipS = {
37
+ args: {
38
+ brand: 'mailship',
39
+ variant: 's',
40
+ },
41
+ };
42
+ export var MailwiseBlack = {
43
+ args: {
44
+ brand: 'mailwise',
45
+ variant: 'black',
46
+ },
47
+ };
48
+ export var MailwiseS = {
49
+ args: {
50
+ brand: 'mailwise',
51
+ variant: 's',
52
+ },
53
+ };
54
+ export var MailstockBlack = {
55
+ args: {
56
+ brand: 'mailstock',
57
+ variant: 'black',
58
+ },
59
+ };
60
+ export var MailwrapBlack = {
61
+ args: {
62
+ brand: 'mailwrap',
63
+ variant: 'black',
64
+ },
65
+ };
66
+ export var MailstepBlack = {
67
+ args: {
68
+ brand: 'mailstep',
69
+ variant: 'black',
70
+ },
71
+ };
72
+ export var MailstepWhite = {
73
+ args: {
74
+ brand: 'mailstep',
75
+ variant: 'white',
76
+ },
77
+ };
78
+ export var SizeSmall = {
79
+ args: {
80
+ variant: 'black',
81
+ brand: 'mailship',
82
+ size: 'small',
83
+ },
84
+ };
85
+ export var SizeMedium = {
86
+ args: {
87
+ variant: 'black',
88
+ brand: 'mailship',
89
+ size: 'medium',
90
+ },
91
+ };
92
+ export var SizeBig = {
93
+ args: {
94
+ variant: 'black',
95
+ brand: 'mailship',
96
+ size: 'big',
97
+ },
98
+ };
99
+ export var SizeCustomWidth = {
100
+ args: {
101
+ variant: 'black',
102
+ brand: 'mailship',
103
+ width: '400px',
104
+ },
105
+ };
106
+ export var SizeCustomHeight = {
107
+ args: {
108
+ variant: 'black',
109
+ brand: 'mailship',
110
+ height: '200px',
111
+ },
112
+ };
@@ -0,0 +1,10 @@
1
+ export type Brand = 'mailship' | 'mailwise' | 'mailstock' | 'mailstep' | 'mailwrap';
2
+ export type Variant = 'white' | 'black' | 'm' | 's';
3
+ export type Size = 'small' | 'medium' | 'big' | undefined;
4
+ export type LogoProps = {
5
+ variant?: Variant;
6
+ size?: Size;
7
+ brand?: Brand;
8
+ width?: string;
9
+ height?: string;
10
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ export type Props = {
2
+ page?: number;
3
+ itemCount?: number;
4
+ itemPerPage?: number;
5
+ onPageChange?: (number: number) => void;
6
+ };
7
+ declare const Pagination: ({ onPageChange, itemPerPage, itemCount, page }: Props) => JSX.Element;
8
+ export default Pagination;
@@ -0,0 +1,35 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useCallback, useMemo } from 'react';
3
+ import { Btn, GoIcon, Wrapper, PageBtn, DotsWrapper } from './styled';
4
+ var Pagination = function (_a) {
5
+ var onPageChange = _a.onPageChange, itemPerPage = _a.itemPerPage, itemCount = _a.itemCount, page = _a.page;
6
+ var setPage = useCallback(function (number) { return function () {
7
+ if (onPageChange) {
8
+ onPageChange(number);
9
+ }
10
+ }; }, [onPageChange]);
11
+ var pageX = page !== null && page !== void 0 ? page : 1;
12
+ var pageCount = Math.max(Math.ceil((itemCount !== null && itemCount !== void 0 ? itemCount : 0) / (itemPerPage !== null && itemPerPage !== void 0 ? itemPerPage : 3)), 1);
13
+ var arrayOfPages = useMemo(function () {
14
+ var pageNumbers = Array.from({ length: pageCount }, function (_, i) { return i + 1; });
15
+ // first and last page are still visible
16
+ // if number of pages is less than 6 (display all pages without dots and duplication of first and last char)
17
+ if (pageCount < 6) {
18
+ return pageNumbers.slice(1, pageCount - 1);
19
+ // if current page is less than 5 (display first 5 pages)
20
+ }
21
+ else if (pageX < 5) {
22
+ return pageNumbers.slice(1, 5);
23
+ // display last 5 pages
24
+ }
25
+ else if (pageX > pageCount - 4) {
26
+ return pageNumbers.slice(pageCount - 5, pageCount - 1);
27
+ }
28
+ else {
29
+ // display dispersion of 2 chars from current page (part between dots)
30
+ return pageNumbers.slice(pageX - 3, pageX + 2);
31
+ }
32
+ }, [pageCount, pageX]);
33
+ return (_jsxs(Wrapper, { children: [_jsx(Btn, { disabled: pageX <= 1, onClick: setPage(pageX - 1), children: _jsx(GoIcon, { icon: "goLeft", isActive: pageX > 1 }) }), _jsx(PageBtn, { isCurrent: pageX === 1, onClick: setPage(1), children: 1 }), pageX >= 5 && pageCount > 6 && _jsx(DotsWrapper, { children: "..." }), arrayOfPages === null || arrayOfPages === void 0 ? void 0 : arrayOfPages.map(function (number) { return (_jsx(PageBtn, { isCurrent: pageX === number, onClick: setPage(number !== null && number !== void 0 ? number : 1), children: number }, number)); }), pageX < pageCount - 3 && pageCount > 6 && _jsx(DotsWrapper, { children: "..." }), pageCount !== 1 && (_jsx(PageBtn, { isCurrent: pageX === pageCount, onClick: setPage(pageCount), children: pageCount })), _jsx(Btn, { disabled: pageX >= pageCount, onClick: setPage(pageX + 1), children: _jsx(GoIcon, { icon: "goRight", isActive: pageX < pageCount }) })] }));
34
+ };
35
+ export default Pagination;
@@ -0,0 +1,3 @@
1
+ import Pagination from './Pagination';
2
+ export { Pagination };
3
+ export default Pagination;
@@ -0,0 +1,3 @@
1
+ import Pagination from './Pagination';
2
+ export { Pagination };
3
+ export default Pagination;
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ import type { StoryObj } from '@storybook/react';
3
+ declare const meta: {
4
+ title: string;
5
+ component: ({ onPageChange, itemPerPage, itemCount, page }: import("../Pagination").Props) => JSX.Element;
6
+ tags: string[];
7
+ argTypes: {};
8
+ };
9
+ export default meta;
10
+ type Story = StoryObj<typeof meta>;
11
+ export declare const Default: Story;
12
+ export declare const ManyPages: Story;
@@ -0,0 +1,22 @@
1
+ import { Pagination } from '../';
2
+ var meta = {
3
+ title: 'Elements/Pagination',
4
+ component: Pagination,
5
+ tags: ['autodocs'],
6
+ argTypes: {},
7
+ };
8
+ export default meta;
9
+ export var Default = {
10
+ args: {
11
+ itemCount: 100,
12
+ itemPerPage: 8,
13
+ page: 1,
14
+ },
15
+ };
16
+ export var ManyPages = {
17
+ args: {
18
+ itemCount: 1000,
19
+ itemPerPage: 8,
20
+ page: 1,
21
+ },
22
+ };
@@ -0,0 +1,15 @@
1
+ /// <reference types="react" />
2
+ export declare const Wrapper: import("styled-components").StyledComponent<(props: Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "color">) => import("react").ReactElement<any, "div">, import("@xstyled/system").Theme, import("@xstyled/system").SystemProps<import("@xstyled/system").Theme>, "color">;
3
+ export declare const Btn: import("styled-components").StyledComponent<"button", import("@xstyled/system").Theme, {
4
+ disabled: boolean;
5
+ }, never>;
6
+ export declare const ArrowIcon: import("styled-components").StyledComponent<({ icon, fill, style, size, className, secondaryColor, fixedWidth, spinning, }: import("../Icon").IconProps) => JSX.Element, import("@xstyled/system").Theme, {
7
+ isActive: boolean;
8
+ }, never>;
9
+ export declare const GoIcon: import("styled-components").StyledComponent<({ icon, fill, style, size, className, secondaryColor, fixedWidth, spinning, }: import("../Icon").IconProps) => JSX.Element, import("@xstyled/system").Theme, {
10
+ isActive: boolean;
11
+ }, never>;
12
+ export declare const DotsWrapper: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {}, never>;
13
+ export declare const PageBtn: import("styled-components").StyledComponent<"span", import("@xstyled/system").Theme, {
14
+ isCurrent: boolean;
15
+ }, never>;
@@ -0,0 +1,26 @@
1
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
+ return cooked;
4
+ };
5
+ import styled, { x } from '@xstyled/styled-components';
6
+ import { th } from '@xstyled/styled-components';
7
+ import { Icon } from '../Icon';
8
+ export var Wrapper = styled(x.div)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n\n & > *:not(:last-child) {\n margin-right: 4px;\n }\n"], ["\n display: inline-flex;\n align-items: center;\n\n & > *:not(:last-child) {\n margin-right: 4px;\n }\n"])));
9
+ export var Btn = styled.button(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background-color: transparent;\n border: none;\n cursor: ", ";\n opacity: ", ";\n"], ["\n background-color: transparent;\n border: none;\n cursor: ", ";\n opacity: ", ";\n"])), function (_a) {
10
+ var disabled = _a.disabled;
11
+ return (disabled ? 'default' : 'pointer');
12
+ }, function (_a) {
13
+ var disabled = _a.disabled;
14
+ return (disabled ? 0 : 1);
15
+ });
16
+ export var ArrowIcon = styled(Icon)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n border-radius: 50%;\n aspect-ratio: 1 / 1;\n width: 16px;\n display: flex;\n align-items: center;\n color: gray1;\n\n &:hover {\n color: blue2;\n }\n"], ["\n border-radius: 50%;\n aspect-ratio: 1 / 1;\n width: 16px;\n display: flex;\n align-items: center;\n color: gray1;\n\n &:hover {\n color: blue2;\n }\n"])));
17
+ export var GoIcon = styled(ArrowIcon)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n margin: 0 8px;\n font-size: 11px;\n & > svg {\n width: 10px;\n }\n"], ["\n margin: 0 8px;\n font-size: 11px;\n & > svg {\n width: 10px;\n }\n"])));
18
+ export var DotsWrapper = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n color: gray1;\n"], ["\n color: gray1;\n"])));
19
+ export var PageBtn = styled.span(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n height: 18px;\n min-width: 18px;\n display: flex;\n border-radius: 50%;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n margin: 0 4px;\n color: ", ";\n font-size: 14px;\n font-weight: ", ";\n font-family: ", ";\n line-height: 1em;\n\n &:hover {\n color: blue2;\n }\n"], ["\n height: 18px;\n min-width: 18px;\n display: flex;\n border-radius: 50%;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n margin: 0 4px;\n color: ", ";\n font-size: 14px;\n font-weight: ", ";\n font-family: ", ";\n line-height: 1em;\n\n &:hover {\n color: blue2;\n }\n"])), function (_a) {
20
+ var isCurrent = _a.isCurrent;
21
+ return (isCurrent ? th.color('red1') : th.color('gray1'));
22
+ }, function (_a) {
23
+ var isCurrent = _a.isCurrent;
24
+ return (isCurrent ? th.fontWeight('semiBold') : th.fontWeight('medium'));
25
+ }, th('fonts.primary'));
26
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
@@ -0,0 +1,2 @@
1
+ declare const Paragraph: () => import("react/jsx-runtime").JSX.Element;
2
+ export default Paragraph;
@@ -0,0 +1,3 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ var Paragraph = function () { return _jsx("p", { children: "paragraph" }); };
3
+ export default Paragraph;
@@ -0,0 +1,3 @@
1
+ import Paragraph from './Paragraph';
2
+ export { Paragraph };
3
+ export default Paragraph;
@@ -0,0 +1,3 @@
1
+ import Paragraph from './Paragraph';
2
+ export { Paragraph };
3
+ export default Paragraph;
@@ -0,0 +1,17 @@
1
+ import type { StoryObj } from '@storybook/react';
2
+ declare const meta: {
3
+ title: string;
4
+ component: () => import("react/jsx-runtime").JSX.Element;
5
+ tags: string[];
6
+ argTypes: {
7
+ backgroundColor: {
8
+ control: string;
9
+ };
10
+ };
11
+ };
12
+ export default meta;
13
+ type Story = StoryObj<typeof meta>;
14
+ export declare const Primary: Story;
15
+ export declare const Secondary: Story;
16
+ export declare const Large: Story;
17
+ export declare const Small: Story;
@@ -0,0 +1,34 @@
1
+ import { Paragraph } from '../';
2
+ var meta = {
3
+ title: 'Elements/Paragraph',
4
+ component: Paragraph,
5
+ tags: ['autodocs'],
6
+ argTypes: {
7
+ backgroundColor: { control: 'color' },
8
+ },
9
+ };
10
+ export default meta;
11
+ // More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
12
+ export var Primary = {
13
+ args: {
14
+ primary: true,
15
+ label: 'Paragraph',
16
+ },
17
+ };
18
+ export var Secondary = {
19
+ args: {
20
+ label: 'Paragraph',
21
+ },
22
+ };
23
+ export var Large = {
24
+ args: {
25
+ size: 'large',
26
+ label: 'Paragraph',
27
+ },
28
+ };
29
+ export var Small = {
30
+ args: {
31
+ size: 'small',
32
+ label: 'Paragraph',
33
+ },
34
+ };
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ export declare const Portal: ({ children }: {
3
+ children: JSX.Element;
4
+ }) => import("react").ReactPortal;
5
+ export default Portal;
@@ -0,0 +1,14 @@
1
+ import { useEffect, useState } from 'react';
2
+ import ReactDom from 'react-dom';
3
+ export var Portal = function (_a) {
4
+ var children = _a.children;
5
+ var container = useState(function () { return document.createElement('div'); })[0];
6
+ useEffect(function () {
7
+ document.body.appendChild(container);
8
+ return function () {
9
+ document.body.removeChild(container);
10
+ };
11
+ }, []);
12
+ return ReactDom.createPortal(children, container);
13
+ };
14
+ export default Portal;
@@ -0,0 +1,9 @@
1
+ type Props = {
2
+ progress?: number;
3
+ status?: 'loading' | 'finished' | 'error';
4
+ errorMessage?: string;
5
+ noText?: boolean;
6
+ variant?: 'normal' | 'thin';
7
+ };
8
+ declare const ProgressBar: ({ progress, status, errorMessage, noText, variant }: Props) => JSX.Element;
9
+ export default ProgressBar;
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { StyledProgressBar, Progress, ProgressDescription } from './styles';
3
+ var ProgressBar = function (_a) {
4
+ var _b = _a.progress, progress = _b === void 0 ? 0 : _b, status = _a.status, errorMessage = _a.errorMessage, noText = _a.noText, variant = _a.variant;
5
+ if (progress > 100 || progress < 0)
6
+ console.warn('Progress value should be number between 0 and 100.');
7
+ return (_jsxs(StyledProgressBar, { status: status, variant: variant, children: [_jsx(Progress, { progress: progress, status: status }), !noText && _jsx(ProgressDescription, { children: status === 'error' && errorMessage ? errorMessage : "".concat(progress, "%") })] }));
8
+ };
9
+ export default ProgressBar;
@@ -0,0 +1,3 @@
1
+ import ProgressBar from './ProgressBar';
2
+ export { ProgressBar };
3
+ export default ProgressBar;
@@ -0,0 +1,3 @@
1
+ import ProgressBar from './ProgressBar';
2
+ export { ProgressBar };
3
+ export default ProgressBar;
@@ -0,0 +1,18 @@
1
+ import type { StoryObj } from '@storybook/react';
2
+ declare const meta: {
3
+ title: string;
4
+ component: ({ progress, status, errorMessage, noText, variant }: {
5
+ progress?: number | undefined;
6
+ status?: "error" | "loading" | "finished" | undefined;
7
+ errorMessage?: string | undefined;
8
+ noText?: boolean | undefined;
9
+ variant?: "normal" | "thin" | undefined;
10
+ }) => JSX.Element;
11
+ tags: string[];
12
+ argTypes: {};
13
+ };
14
+ export default meta;
15
+ type Story = StoryObj<typeof meta>;
16
+ export declare const Loading: Story;
17
+ export declare const Finished: Story;
18
+ export declare const Error: Story;
@@ -0,0 +1,27 @@
1
+ import ProgressBar from '../ProgressBar';
2
+ var meta = {
3
+ title: 'Elements/ProgressBar',
4
+ component: ProgressBar,
5
+ tags: ['autodocs'],
6
+ argTypes: {},
7
+ };
8
+ export default meta;
9
+ export var Loading = {
10
+ args: {
11
+ progress: 10,
12
+ status: "loading"
13
+ },
14
+ };
15
+ export var Finished = {
16
+ args: {
17
+ progress: 100,
18
+ status: "finished"
19
+ },
20
+ };
21
+ export var Error = {
22
+ args: {
23
+ progress: 30,
24
+ status: "error",
25
+ errorMessage: "There has been some issues on the way."
26
+ },
27
+ };
@@ -0,0 +1,9 @@
1
+ export declare const StyledProgressBar: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {
2
+ status: string | null | undefined;
3
+ variant?: "normal" | "thin" | undefined;
4
+ }, never>;
5
+ export declare const Progress: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {
6
+ progress: number;
7
+ status: string | null | undefined;
8
+ }, never>;
9
+ export declare const ProgressDescription: import("styled-components").StyledComponent<"span", import("@xstyled/system").Theme, {}, never>;