@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,2 @@
1
+ import { CornerDialogProps } from './types';
2
+ export declare const CornerDialog: ({ title, children, onClose, statusToTitle, isOpen, intent: _intent, }: CornerDialogProps) => JSX.Element | null;
@@ -0,0 +1,18 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useState } from 'react';
3
+ import { statusToColors, statusToIcon } from './utils';
4
+ import { Portal } from '../../Elements/Portal';
5
+ import { Icon } from '../../Elements/Icon';
6
+ import { Container, Header, Status, StatusText, Wrapper, CloseBtn } from './styles';
7
+ export var CornerDialog = function (_a) {
8
+ var title = _a.title, children = _a.children, onClose = _a.onClose, statusToTitle = _a.statusToTitle, _b = _a.isOpen, isOpen = _b === void 0 ? true : _b, _intent = _a.intent;
9
+ var _c = useState(false), isMounted = _c[0], setIsMounted = _c[1];
10
+ useEffect(function () {
11
+ setIsMounted(true);
12
+ }, []);
13
+ var intent = _intent !== null && _intent !== void 0 ? _intent : 'info';
14
+ var _d = statusToColors[intent], fontColor = _d.fontColor, backgroundColor = _d.backgroundColor, fill = _d.fill;
15
+ if (!isOpen)
16
+ return null;
17
+ return (_jsx(Portal, { children: _jsxs(Container, { "$mounted": isMounted, children: [_jsxs(Status, { background: backgroundColor, children: [_jsx(Icon, { icon: statusToIcon[intent], fill: fill }), _jsx(StatusText, { fontColor: fontColor, children: statusToTitle[intent]() })] }), _jsx(Header, { children: title }), _jsx(CloseBtn, { onClick: onClose, children: _jsx(Icon, { icon: "close", size: "25px" }) }), _jsx(Wrapper, { children: children })] }) }));
18
+ };
@@ -0,0 +1,3 @@
1
+ import { CornerDialog } from './CornerDialog';
2
+ export type { Intent, CornerDialogProps } from './types';
3
+ export default CornerDialog;
@@ -0,0 +1,2 @@
1
+ import { CornerDialog } from './CornerDialog';
2
+ export default CornerDialog;
@@ -0,0 +1,14 @@
1
+ /// <reference types="react" />
2
+ import { StoryObj } from '@storybook/react';
3
+ declare const meta: {
4
+ title: string;
5
+ component: ({ title, children, onClose, statusToTitle, isOpen, intent: _intent, }: import("..").CornerDialogProps) => JSX.Element | null;
6
+ tags: string[];
7
+ argTypes: {};
8
+ };
9
+ export default meta;
10
+ type Story = StoryObj<typeof meta>;
11
+ export declare const InfoCornerDialog: Story;
12
+ export declare const SuccessCornerDialog: Story;
13
+ export declare const ErrorCornerDialog: Story;
14
+ export declare const WarningCornerDialog: Story;
@@ -0,0 +1,50 @@
1
+ import { CornerDialog } from '../CornerDialog';
2
+ var meta = {
3
+ title: 'Blocks/CornerDialog',
4
+ component: CornerDialog,
5
+ tags: ['autodocs'],
6
+ argTypes: {},
7
+ };
8
+ export default meta;
9
+ var statusToTitle = {
10
+ info: function () { return 'Info'; },
11
+ success: function () { return 'Success'; },
12
+ error: function () { return 'Error'; },
13
+ warning: function () { return 'Warning'; },
14
+ };
15
+ export var InfoCornerDialog = {
16
+ args: {
17
+ title: 'Info Title',
18
+ children: 'Info corner dialog content',
19
+ statusToTitle: statusToTitle,
20
+ intent: 'info',
21
+ isOpen: true,
22
+ },
23
+ };
24
+ export var SuccessCornerDialog = {
25
+ args: {
26
+ title: 'Success Title',
27
+ children: 'Success corner dialog content',
28
+ statusToTitle: statusToTitle,
29
+ intent: 'success',
30
+ isOpen: true,
31
+ },
32
+ };
33
+ export var ErrorCornerDialog = {
34
+ args: {
35
+ title: 'Error Title',
36
+ children: 'Error corner dialog content',
37
+ statusToTitle: statusToTitle,
38
+ intent: 'error',
39
+ isOpen: true,
40
+ },
41
+ };
42
+ export var WarningCornerDialog = {
43
+ args: {
44
+ title: 'Warning Title',
45
+ children: 'Warning corner dialog content',
46
+ statusToTitle: statusToTitle,
47
+ intent: 'warning',
48
+ isOpen: true,
49
+ },
50
+ };
@@ -0,0 +1,12 @@
1
+ export declare const Container: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {
2
+ $mounted: boolean;
3
+ }, never>;
4
+ export declare const Header: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {}, never>;
5
+ export declare const Wrapper: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {}, never>;
6
+ export declare const Status: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {
7
+ background: string;
8
+ }, never>;
9
+ export declare const CloseBtn: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {}, never>;
10
+ export declare const StatusText: import("styled-components").StyledComponent<"span", import("@xstyled/system").Theme, {
11
+ fontColor: string;
12
+ }, never>;
@@ -0,0 +1,21 @@
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, { th } from '@xstyled/styled-components';
6
+ export var Container = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: fixed;\n z-index: 10;\n bottom: 3rem;\n right: 3rem;\n background: white;\n border-radius: 12px;\n box-shadow: cornerDialogShadow;\n width: 400px;\n padding: 50px 30px 30px;\n color: typoPrimary;\n transition: opacity 225ms linear;\n opacity: ", ";\n"], ["\n position: fixed;\n z-index: 10;\n bottom: 3rem;\n right: 3rem;\n background: white;\n border-radius: 12px;\n box-shadow: cornerDialogShadow;\n width: 400px;\n padding: 50px 30px 30px;\n color: typoPrimary;\n transition: opacity 225ms linear;\n opacity: ", ";\n"])), function (_a) {
7
+ var $mounted = _a.$mounted;
8
+ return ($mounted ? 1 : 0);
9
+ });
10
+ export var Header = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n margin-bottom: 15px;\n color: typoPrimary;\n font-size: 18px;\n font-weight: bold;\n display: flex;\n align-items: center;\n"], ["\n margin-bottom: 15px;\n color: typoPrimary;\n font-size: 18px;\n font-weight: bold;\n display: flex;\n align-items: center;\n"])));
11
+ export var Wrapper = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-size: 14px;\n font-weight: 400;\n"], ["\n font-size: 14px;\n font-weight: 400;\n"])));
12
+ export var Status = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n position: absolute;\n left: 0;\n top: 0;\n padding: 6px 10px;\n text-transform: uppercase;\n border-radius: 12px 0 12px 0;\n background-color: ", ";\n"], ["\n position: absolute;\n left: 0;\n top: 0;\n padding: 6px 10px;\n text-transform: uppercase;\n border-radius: 12px 0 12px 0;\n background-color: ", ";\n"])), function (_a) {
13
+ var background = _a.background;
14
+ return th.color(background);
15
+ });
16
+ export var CloseBtn = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n cursor: pointer;\n position: absolute;\n top: 12px;\n right: 12px;\n"], ["\n cursor: pointer;\n position: absolute;\n top: 12px;\n right: 12px;\n"])));
17
+ export var StatusText = styled.span(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n display: inline-block;\n margin-left: 6px;\n font-size: 14px;\n font-weight: 700;\n color: ", ";\n"], ["\n display: inline-block;\n margin-left: 6px;\n font-size: 14px;\n font-weight: 700;\n color: ", ";\n"])), function (_a) {
18
+ var fontColor = _a.fontColor;
19
+ return th.color(fontColor);
20
+ });
21
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
@@ -0,0 +1,16 @@
1
+ import { ReactChild } from 'react';
2
+ export type Intent = 'success' | 'error' | 'warning' | 'info';
3
+ export interface CornerDialogProps {
4
+ title: JSX.Element | string;
5
+ children: ReactChild;
6
+ icon?: string;
7
+ onClose: () => void;
8
+ isOpen?: boolean;
9
+ intent?: Intent;
10
+ statusToTitle: Record<Intent, () => string>;
11
+ }
12
+ export interface ColorProps {
13
+ fontColor: string;
14
+ backgroundColor: string;
15
+ fill: string;
16
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ import { Intent, ColorProps } from './types';
2
+ export declare const statusToColors: Record<Intent, ColorProps>;
3
+ export declare const statusToIcon: Record<Intent, string>;
@@ -0,0 +1,12 @@
1
+ export var statusToColors = {
2
+ info: { fontColor: 'gray1', backgroundColor: 'lightGray7', fill: 'gray1' },
3
+ success: { fontColor: 'white', backgroundColor: 'green', fill: 'white' },
4
+ error: { fontColor: 'white', backgroundColor: 'red1', fill: 'white' },
5
+ warning: { fontColor: 'blue2', backgroundColor: 'yellow1', fill: 'blue2' },
6
+ };
7
+ export var statusToIcon = {
8
+ info: 'info',
9
+ success: 'circleCheck',
10
+ error: 'circleX',
11
+ warning: 'circleTriangle',
12
+ };
@@ -0,0 +1,3 @@
1
+ import { type FC } from 'react';
2
+ import { type ImageListProps } from './types';
3
+ export declare const ImageList: FC<ImageListProps>;
@@ -0,0 +1,29 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import { useRef } from 'react';
14
+ import { useDraggable } from 'react-use-draggable-scroll';
15
+ import LightBox, { useLightBox } from '../LightBox';
16
+ import { AddPhoto } from './components/AddPhoto';
17
+ import { ImageElement } from './components/ImageElement';
18
+ import { x } from '@xstyled/styled-components';
19
+ import { ImageListContainer } from './styles';
20
+ export var ImageList = function (_a) {
21
+ var onImageUpload = _a.onImageUpload, onImageRemove = _a.onImageRemove, lightBoxAction = _a.lightBoxAction, lightBoxActionTitle = _a.lightBoxActionTitle, images = _a.images;
22
+ var ref = useRef();
23
+ var events = useDraggable(ref, { isMounted: !!(images === null || images === void 0 ? void 0 : images.length) }).events;
24
+ var _b = useLightBox(), isLightBoxOpen = _b.isLightBoxOpen, onCloseLightBox = _b.onCloseLightBox, onOpenLightBox = _b.onOpenLightBox, lightBoxData = _b.lightBoxData;
25
+ return (_jsxs(x.div, { display: "flex", alignItems: "flex-end", children: [_jsx(AddPhoto, { onImageUpload: onImageUpload }), images && (_jsx(ImageListContainer, __assign({ ref: ref }, events, { children: images.map(function (item, index) {
26
+ var _a, _b;
27
+ return (_jsx(ImageElement, { imageUrl: (_a = item.smallUrl) !== null && _a !== void 0 ? _a : item.url, onImageRemove: onImageRemove === null || onImageRemove === void 0 ? void 0 : onImageRemove(item.id), onOpenLightBox: onOpenLightBox(index) }, (_b = item.id) !== null && _b !== void 0 ? _b : index));
28
+ }) }))), _jsx(LightBox, { initialSlide: lightBoxData === null || lightBoxData === void 0 ? void 0 : lightBoxData.initialSlide, isLightBoxOpen: isLightBoxOpen, onCloseLightBox: onCloseLightBox, lightBoxAction: lightBoxAction, lightBoxActionTitle: lightBoxActionTitle, images: images })] }));
29
+ };
@@ -0,0 +1,7 @@
1
+ import { type FC } from 'react';
2
+ import { type ImageUploadProps } from '../../types';
3
+ interface AddPhotoProps {
4
+ onImageUpload?: (props: ImageUploadProps) => Promise<void>;
5
+ }
6
+ export declare const AddPhoto: FC<AddPhotoProps>;
7
+ export {};
@@ -0,0 +1,63 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ var __generator = (this && this.__generator) || function (thisArg, body) {
11
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
12
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
13
+ function verb(n) { return function (v) { return step([n, v]); }; }
14
+ function step(op) {
15
+ if (f) throw new TypeError("Generator is already executing.");
16
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
17
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
18
+ if (y = 0, t) op = [op[0] & 2, t.value];
19
+ switch (op[0]) {
20
+ case 0: case 1: t = op; break;
21
+ case 4: _.label++; return { value: op[1], done: false };
22
+ case 5: _.label++; y = op[1]; op = [0]; continue;
23
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
24
+ default:
25
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
26
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
27
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
28
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
29
+ if (t[2]) _.ops.pop();
30
+ _.trys.pop(); continue;
31
+ }
32
+ op = body.call(thisArg, _);
33
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
34
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
+ }
36
+ };
37
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
38
+ import { useCallback } from 'react';
39
+ import { Container, HiddenInput } from './styles';
40
+ export var AddPhoto = function (_a) {
41
+ var onImageUpload = _a.onImageUpload;
42
+ var handleImageUpload = useCallback(function (event) {
43
+ var _a, _b;
44
+ if (!((_b = (_a = event.target) === null || _a === void 0 ? void 0 : _a.files) === null || _b === void 0 ? void 0 : _b[0]))
45
+ return;
46
+ var reader = new FileReader();
47
+ reader.readAsDataURL(event.target.files[0]);
48
+ reader.onload = function () { return __awaiter(void 0, void 0, void 0, function () {
49
+ var _a;
50
+ return __generator(this, function (_b) {
51
+ switch (_b.label) {
52
+ case 0: return [4 /*yield*/, (onImageUpload === null || onImageUpload === void 0 ? void 0 : onImageUpload({ base64: reader.result, file: (_a = event.target.files) === null || _a === void 0 ? void 0 : _a[0] }))];
53
+ case 1:
54
+ _b.sent();
55
+ return [2 /*return*/];
56
+ }
57
+ });
58
+ }); };
59
+ }, [onImageUpload]);
60
+ if (!onImageUpload)
61
+ return null;
62
+ return (_jsxs(Container, { children: [_jsx(HiddenInput, { onChange: handleImageUpload, type: "file", accept: "image/*" }), _jsxs("svg", { width: "36", height: "36", viewBox: "0 0 37 34", fill: "#DB2B19", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M9.82792 6.14124C10.7187 5.25044 11.9269 4.75 13.1867 4.75H19C19.8745 4.75 20.5833 5.45889 20.5833 6.33333C20.5833 7.20778 19.8745 7.91667 19 7.91667H13.1867C12.7668 7.91667 12.364 8.08349 12.0671 8.38041L10.7554 9.69209C9.86461 10.5829 8.65643 11.0833 7.39665 11.0833H4.75C3.87556 11.0833 3.16667 11.7922 3.16667 12.6667V28.5C3.16667 29.3745 3.87556 30.0833 4.75 30.0833H26.9167C27.7911 30.0833 28.5 29.3745 28.5 28.5V17.4167C28.5 16.5422 29.2089 15.8333 30.0833 15.8333C30.9578 15.8333 31.6667 16.5422 31.6667 17.4167V28.5C31.6667 31.1234 29.5401 33.25 26.9167 33.25H4.75C2.12665 33.25 0 31.1234 0 28.5V12.6667C0 10.0433 2.12665 7.91667 4.75 7.91667H7.39665C7.81658 7.91667 8.21931 7.74985 8.51624 7.45292L9.82792 6.14124Z" }), _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M7.9165 20.5834C7.9165 16.2112 11.4609 12.6667 15.8332 12.6667C20.2054 12.6667 23.7498 16.2112 23.7498 20.5834C23.7498 24.9556 20.2054 28.5001 15.8332 28.5001C11.4609 28.5001 7.9165 24.9556 7.9165 20.5834ZM15.8332 15.8334C13.2098 15.8334 11.0832 17.96 11.0832 20.5834C11.0832 23.2068 13.2098 25.3334 15.8332 25.3334C18.4566 25.3334 20.5832 23.2068 20.5832 20.5834C20.5832 17.96 18.4566 15.8334 15.8332 15.8334Z" }), _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M23.75 6.33333C23.75 5.45889 24.4589 4.75 25.3333 4.75H34.8333C35.7078 4.75 36.4167 5.45889 36.4167 6.33333C36.4167 7.20778 35.7078 7.91667 34.8333 7.91667H25.3333C24.4589 7.91667 23.75 7.20778 23.75 6.33333Z" }), _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M30.0833 0C30.9578 0 31.6667 0.70889 31.6667 1.58333V11.0833C31.6667 11.9578 30.9578 12.6667 30.0833 12.6667C29.2089 12.6667 28.5 11.9578 28.5 11.0833V1.58333C28.5 0.70889 29.2089 0 30.0833 0Z" })] })] }));
63
+ };
@@ -0,0 +1,2 @@
1
+ export declare const Container: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {}, never>;
2
+ export declare const HiddenInput: import("styled-components").StyledComponent<"input", import("@xstyled/system").Theme, {}, never>;
@@ -0,0 +1,8 @@
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, { th } from '@xstyled/styled-components';
6
+ export var Container = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n flex-shrink: 0;\n height: 85px !important;\n width: 85px !important;\n border-radius: ", ";\n border: ", ";\n border-color: ", ";\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n margin-right: 15px;\n"], ["\n position: relative;\n flex-shrink: 0;\n height: 85px !important;\n width: 85px !important;\n border-radius: ", ";\n border: ", ";\n border-color: ", ";\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n margin-right: 15px;\n"])), th.radius('lg'), th.border('mediumSlim'), th.color('red1'));
7
+ export var HiddenInput = styled.input(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n opacity: 0;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n cursor: pointer;\n"], ["\n opacity: 0;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n cursor: pointer;\n"])));
8
+ var templateObject_1, templateObject_2;
@@ -0,0 +1,6 @@
1
+ import { type FC } from 'react';
2
+ interface CloseButtonProps {
3
+ onImageRemove: () => void;
4
+ }
5
+ export declare const CloseButton: FC<CloseButtonProps>;
6
+ export {};
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Icon } from '../../../../Elements/Icon';
3
+ import { Container } from './styles';
4
+ export var CloseButton = function (_a) {
5
+ var onImageRemove = _a.onImageRemove;
6
+ return (_jsx(Container, { onClick: onImageRemove, children: _jsx(Icon, { icon: "close", size: "22px", fill: "red1" }) }));
7
+ };
@@ -0,0 +1 @@
1
+ export declare const Container: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {}, never>;
@@ -0,0 +1,7 @@
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, { th } from '@xstyled/styled-components';
6
+ export var Container = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: absolute;\n top: 0;\n right: 0;\n width: 30px;\n height: 30px;\n background-color: ", ";\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n"], ["\n position: absolute;\n top: 0;\n right: 0;\n width: 30px;\n height: 30px;\n background-color: ", ";\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n"])), th.color('red20'));
7
+ var templateObject_1;
@@ -0,0 +1,9 @@
1
+ import { type FC } from 'react';
2
+ interface ImageElementProps {
3
+ label?: string;
4
+ onImageRemove?: () => void;
5
+ onOpenLightBox: () => void;
6
+ imageUrl: string | undefined;
7
+ }
8
+ export declare const ImageElement: FC<ImageElementProps>;
9
+ export {};
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Image } from './styles';
3
+ import { ImageTag } from '../ImageTag';
4
+ import { CloseButton } from '../CloseButton';
5
+ import { x } from '@xstyled/styled-components';
6
+ export var ImageElement = function (_a) {
7
+ var label = _a.label, onImageRemove = _a.onImageRemove, onOpenLightBox = _a.onOpenLightBox, imageUrl = _a.imageUrl;
8
+ if (!imageUrl)
9
+ return null;
10
+ return (_jsxs(x.div, { position: "relative", pr: "15px", pt: "15px", w: "100px", children: [_jsx(Image, { src: imageUrl, alt: "", width: "85px", height: "85px", onClick: onOpenLightBox }), onImageRemove && _jsx(CloseButton, { onImageRemove: onImageRemove }), _jsx(ImageTag, { label: label })] }));
11
+ };
@@ -0,0 +1,2 @@
1
+ export declare const Container: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {}, never>;
2
+ export declare const Image: import("styled-components").StyledComponent<"img", import("@xstyled/system").Theme, {}, never>;
@@ -0,0 +1,8 @@
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, { th } from '@xstyled/styled-components';
6
+ export var Container = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject([""], [""])));
7
+ export var Image = styled.img(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n border-radius: ", ";\n"], ["\n border-radius: ", ";\n"])), th.radius('lg'));
8
+ var templateObject_1, templateObject_2;
@@ -0,0 +1,6 @@
1
+ import { type FC } from 'react';
2
+ interface ImageTagProps {
3
+ label?: string;
4
+ }
5
+ export declare const ImageTag: FC<ImageTagProps>;
6
+ export {};
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Tag } from '../../../../Elements/Tag';
3
+ import { Container } from './styles';
4
+ export var ImageTag = function (_a) {
5
+ var label = _a.label;
6
+ if (!label)
7
+ return null;
8
+ return (_jsx(Container, { children: _jsx(Tag, { size: "small", color: "darkGreen", textColor: "white", children: _jsx("b", { children: label }) }) }));
9
+ };
@@ -0,0 +1 @@
1
+ export declare const Container: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {}, never>;
@@ -0,0 +1,7 @@
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 from '@xstyled/styled-components';
6
+ export var Container = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: absolute;\n bottom: 2px;\n left: 2px;\n"], ["\n position: absolute;\n bottom: 2px;\n left: 2px;\n"])));
7
+ var templateObject_1;
@@ -0,0 +1,5 @@
1
+ import { ImageList } from './ImageList';
2
+ import { type ImageData } from '../LightBox';
3
+ export { type ImageUploadProps } from './types';
4
+ export { type ImageData };
5
+ export default ImageList;
@@ -0,0 +1,2 @@
1
+ import { ImageList } from './ImageList';
2
+ export default ImageList;
@@ -0,0 +1 @@
1
+ export declare const ImageListContainer: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {}, never>;
@@ -0,0 +1,7 @@
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 from '@xstyled/styled-components';
6
+ export var ImageListContainer = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n overflow-x: scroll;\n -ms-overflow-style: none;\n scrollbar-width: none;\n position: relative;\n\n &::-webkit-scrollbar {\n display: none;\n }\n"], ["\n display: flex;\n overflow-x: scroll;\n -ms-overflow-style: none;\n scrollbar-width: none;\n position: relative;\n\n &::-webkit-scrollbar {\n display: none;\n }\n"])));
7
+ var templateObject_1;
@@ -0,0 +1,12 @@
1
+ import { type ImageData } from '../LightBox';
2
+ export interface ImageUploadProps {
3
+ base64?: string;
4
+ file?: File;
5
+ }
6
+ export interface ImageListProps {
7
+ images: ImageData[] | undefined;
8
+ onImageUpload?: (props: ImageUploadProps) => Promise<void>;
9
+ onImageRemove?: (id?: string) => () => void;
10
+ lightBoxAction?: (id?: string) => () => Promise<void>;
11
+ lightBoxActionTitle?: string;
12
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ import { type FC } from 'react';
2
+ import { type LightBoxProps } from './types';
3
+ export declare const LightBox: FC<LightBoxProps>;
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Button } from '../../Elements/Button';
3
+ import Modal from '../Modal';
4
+ import 'swiper/css';
5
+ import { Swiper, SwiperSlide } from 'swiper/react';
6
+ import { Container, Image, ButtonContainer } from './styles';
7
+ export var LightBox = function (_a) {
8
+ var isLightBoxOpen = _a.isLightBoxOpen, onCloseLightBox = _a.onCloseLightBox, lightBoxAction = _a.lightBoxAction, lightBoxActionTitle = _a.lightBoxActionTitle, images = _a.images, _b = _a.initialSlide, initialSlide = _b === void 0 ? 0 : _b;
9
+ if (!(images === null || images === void 0 ? void 0 : images.length))
10
+ return null;
11
+ return (_jsx(Modal, { isShown: isLightBoxOpen, onClose: onCloseLightBox, mobileFullscreen: true, miniCloseBtn: true, withCloseIcon: true, children: _jsx(Swiper, { initialSlide: initialSlide, slidesPerView: 1, autoHeight: true, children: images.map(function (item) {
12
+ var _a;
13
+ return (_jsx(SwiperSlide, { children: _jsxs(Container, { children: [_jsx(Image, { src: (_a = item.originalUrl) !== null && _a !== void 0 ? _a : item.url, loading: "lazy", alt: "" }), !!item.withLightBoxAction && lightBoxAction && lightBoxActionTitle && (_jsx(ButtonContainer, { children: _jsx(Button, { onClick: lightBoxAction(item.id), appearance: "primaryLight", children: lightBoxActionTitle }) }))] }) }, item.id));
14
+ }) }) }));
15
+ };
@@ -0,0 +1,2 @@
1
+ import { type UseLightBoxHookType } from '../types';
2
+ export declare const useLightBox: UseLightBoxHookType;
@@ -0,0 +1,17 @@
1
+ import { useCallback } from 'react';
2
+ import { useModal } from '../../Modal';
3
+ export var useLightBox = function () {
4
+ var _a = useModal(), isOpen = _a.isOpen, onOpen = _a.onOpen, onClose = _a.onClose, data = _a.data;
5
+ var onOpenLightBox = useCallback(function (index) {
6
+ if (index === void 0) { index = 0; }
7
+ return function () {
8
+ onOpen({ initialSlide: index });
9
+ };
10
+ }, [onOpen]);
11
+ return {
12
+ onOpenLightBox: onOpenLightBox,
13
+ onCloseLightBox: onClose,
14
+ isLightBoxOpen: isOpen,
15
+ lightBoxData: data
16
+ };
17
+ };
@@ -0,0 +1,4 @@
1
+ import { LightBox } from './LightBox';
2
+ export { useLightBox } from './hooks/useLightBox';
3
+ export type { ImageData } from './types';
4
+ export default LightBox;
@@ -0,0 +1,3 @@
1
+ import { LightBox } from './LightBox';
2
+ export { useLightBox } from './hooks/useLightBox';
3
+ export default LightBox;
@@ -0,0 +1,3 @@
1
+ export declare const Container: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {}, never>;
2
+ export declare const Image: import("styled-components").StyledComponent<"img", import("@xstyled/system").Theme, {}, never>;
3
+ export declare const ButtonContainer: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {}, never>;
@@ -0,0 +1,9 @@
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 from '@xstyled/styled-components';
6
+ export var Container = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: 100%;\n height: 100%;\n position: relative;\n"], ["\n width: 100%;\n height: 100%;\n position: relative;\n"])));
7
+ export var Image = styled.img(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n width: 100%;\n height: 100%;\n"], ["\n width: 100%;\n height: 100%;\n"])));
8
+ export var ButtonContainer = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n width: 100%;\n display: flex;\n justify-content: center;\n position: absolute;\n bottom: -60px;\n"], ["\n width: 100%;\n display: flex;\n justify-content: center;\n position: absolute;\n bottom: -60px;\n"])));
9
+ var templateObject_1, templateObject_2, templateObject_3;
@@ -0,0 +1,24 @@
1
+ export interface LightBoxData {
2
+ initialSlide: number;
3
+ }
4
+ export type UseLightBoxHookType = () => {
5
+ onOpenLightBox: (index?: number) => () => void;
6
+ onCloseLightBox: () => void;
7
+ isLightBoxOpen: boolean;
8
+ lightBoxData?: LightBoxData;
9
+ };
10
+ export interface ImageData {
11
+ id: string;
12
+ url?: string;
13
+ smallUrl?: string;
14
+ originalUrl?: string;
15
+ withLightBoxAction?: boolean;
16
+ }
17
+ export interface LightBoxProps {
18
+ images: ImageData[] | undefined;
19
+ isLightBoxOpen: boolean;
20
+ onCloseLightBox: () => void;
21
+ lightBoxAction?: (id?: string) => () => Promise<void>;
22
+ lightBoxActionTitle?: string;
23
+ initialSlide?: number;
24
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ import { type FC } from 'react';
2
+ import { ModalProps } from './types';
3
+ export declare const Modal: FC<ModalProps>;
@@ -0,0 +1,35 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { memo, useCallback, useMemo, useEffect } from 'react';
3
+ import { Icon } from '../../Elements/Icon';
4
+ import { DialogOverlay, DialogWindow, HeaderContainer, ButtonsContainer, ContentContainer, TitleContainer, CloseButton, H4, } from './styles';
5
+ import { x } from '@xstyled/styled-components';
6
+ import { Button } from '../../Elements/Button';
7
+ import { Portal } from '../../Elements/Portal';
8
+ import { useClickOutside } from './hooks/useClickOutside';
9
+ import { topSpaceMap, widthMap } from './utils';
10
+ export var Modal = memo(function (_a) {
11
+ var children = _a.children, _b = _a.isShown, isShown = _b === void 0 ? true : _b, onCancel = _a.onCancel, title = _a.title, titleIcon = _a.titleIcon, onConfirm = _a.onConfirm, confirmLabel = _a.confirmLabel, cancelLabel = _a.cancelLabel, isLoading = _a.isLoading, isConfirmDisabled = _a.isConfirmDisabled, _c = _a.width, width = _c === void 0 ? 'narrow' : _c, _d = _a.topSpace, topSpace = _d === void 0 ? 'default' : _d, onClose = _a.onClose, _e = _a.hasFooter, hasFooter = _e === void 0 ? true : _e, _f = _a.hasHeader, hasHeader = _f === void 0 ? true : _f, _g = _a.whiteBg, whiteBg = _g === void 0 ? false : _g, _h = _a.miniCloseBtn, miniCloseBtn = _h === void 0 ? false : _h, _j = _a.ignoreClickOutside, ignoreClickOutside = _j === void 0 ? false : _j, _k = _a.closeEverywhere, closeEverywhere = _k === void 0 ? false : _k, _l = _a.withCloseIcon, withCloseIcon = _l === void 0 ? true : _l, _m = _a.mobileFullscreen, mobileFullscreen = _m === void 0 ? false : _m, overlayColor = _a.overlayColor, minWidth = _a.minWidth, minHeight = _a.minHeight, maxWidth = _a.maxWidth, maxHeight = _a.maxHeight;
12
+ var closeDialog = useCallback(function () {
13
+ if (onClose) {
14
+ onClose();
15
+ }
16
+ else if (onCancel) {
17
+ onCancel();
18
+ }
19
+ }, [onClose, onCancel]);
20
+ var dialogStyle = useMemo(function () { return ({ width: widthMap[width] }); }, [width]);
21
+ var dialogRef = useClickOutside({ onClose: closeDialog, ignoreClickOutside: ignoreClickOutside, closeCurrent: true, allowScrollbarClick: true });
22
+ var onDialogConfirmClick = useCallback(function () {
23
+ onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm(closeDialog);
24
+ }, [onConfirm, closeDialog]);
25
+ useEffect(function () {
26
+ window.addEventListener('popstate', closeDialog);
27
+ return function () {
28
+ window.removeEventListener('popstate', closeDialog);
29
+ };
30
+ }, []);
31
+ if (!isShown) {
32
+ return null;
33
+ }
34
+ return (_jsx(Portal, { children: _jsx(DialogOverlay, { backgroundColor: overlayColor, children: _jsxs(DialogWindow, { ref: dialogRef, style: dialogStyle, "$whiteBg": whiteBg, "data-cy": "dialogWindow", onClick: closeEverywhere ? closeDialog : undefined, "$minWidth": minWidth, "$minHeight": minHeight, "$maxWidth": maxWidth, "$maxHeight": maxHeight, "$mobileFullscreen": mobileFullscreen, children: [title && hasHeader && (_jsx(HeaderContainer, { topSpace: topSpaceMap[topSpace], children: _jsxs(TitleContainer, { children: [titleIcon && (_jsx(x.div, { as: "span", className: "icon", children: typeof titleIcon === 'string' ? _jsx(Icon, { icon: titleIcon, fill: "blue2" }) : titleIcon })), _jsx(H4, { children: title })] }) })), _jsx(ContentContainer, { topSpace: topSpaceMap[topSpace], "$mobileFullscreen": mobileFullscreen, children: children }), hasFooter && (onCancel || onConfirm) && (_jsxs(ButtonsContainer, { children: [onCancel && (_jsx(Button, { type: "button", onClick: onCancel, isLoading: isLoading, "data-cy": "cancelBtn", appearance: "primaryLight", children: cancelLabel ? cancelLabel : 'Cancel' })), onConfirm && (_jsx(Button, { type: "button", onClick: onDialogConfirmClick, isLoading: isLoading, disabled: isConfirmDisabled, "data-cy": "submitBtn", children: confirmLabel ? confirmLabel : 'Submit' }))] })), hasHeader && !closeEverywhere && withCloseIcon && (_jsx(CloseButton, { onClick: closeDialog, "data-cy": "dialogCloseBtn", children: _jsx(Icon, { icon: "close", size: miniCloseBtn ? '20px' : '26px' }) }))] }) }) }));
35
+ });
@@ -0,0 +1,3 @@
1
+ import { RefObject } from 'react';
2
+ import { UseClickOutsideProps } from '../types';
3
+ export declare const useClickOutside: ({ onClose, parentRef, ignoreClickOutside, closeCurrent, allowScrollbarClick, }: UseClickOutsideProps) => RefObject<HTMLDivElement>;