@qoretechnologies/reqore 0.20.1 → 0.20.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (592) hide show
  1. package/__tests__/modal.test.tsx +3 -8
  2. package/__tests__/panel.test.tsx +3 -3
  3. package/dist/src/components/Breadcrumbs/index.d.ts +33 -0
  4. package/dist/src/components/Breadcrumbs/index.d.ts.map +1 -0
  5. package/dist/src/components/Breadcrumbs/index.js +167 -0
  6. package/dist/src/components/Breadcrumbs/index.js.map +1 -0
  7. package/dist/src/components/Breadcrumbs/item.d.ts +14 -0
  8. package/dist/src/components/Breadcrumbs/item.d.ts.map +1 -0
  9. package/dist/src/components/Breadcrumbs/item.js +84 -0
  10. package/dist/src/components/Breadcrumbs/item.js.map +1 -0
  11. package/dist/src/components/Button/index.d.ts +33 -0
  12. package/dist/src/components/Button/index.d.ts.map +1 -0
  13. package/dist/src/components/Button/index.js +154 -0
  14. package/dist/src/components/Button/index.js.map +1 -0
  15. package/dist/src/components/Checkbox/index.d.ts +26 -0
  16. package/dist/src/components/Checkbox/index.d.ts.map +1 -0
  17. package/dist/src/components/Checkbox/index.js +108 -0
  18. package/dist/src/components/Checkbox/index.js.map +1 -0
  19. package/dist/src/components/Columns/column.d.ts +5 -0
  20. package/dist/src/components/Columns/column.d.ts.map +1 -0
  21. package/dist/src/components/Columns/column.js +37 -0
  22. package/dist/src/components/Columns/column.js.map +1 -0
  23. package/dist/src/components/Columns/index.d.ts +17 -0
  24. package/dist/src/components/Columns/index.d.ts.map +1 -0
  25. package/dist/src/components/Columns/index.js +69 -0
  26. package/dist/src/components/Columns/index.js.map +1 -0
  27. package/dist/src/components/Comment/index.d.ts +24 -0
  28. package/dist/src/components/Comment/index.d.ts.map +1 -0
  29. package/dist/src/components/Comment/index.js +71 -0
  30. package/dist/src/components/Comment/index.js.map +1 -0
  31. package/dist/src/components/CommentFeed/index.d.ts +7 -0
  32. package/dist/src/components/CommentFeed/index.d.ts.map +1 -0
  33. package/dist/src/components/CommentFeed/index.js +49 -0
  34. package/dist/src/components/CommentFeed/index.js.map +1 -0
  35. package/dist/src/components/Content/index.d.ts +11 -0
  36. package/dist/src/components/Content/index.d.ts.map +1 -0
  37. package/dist/src/components/Content/index.js +70 -0
  38. package/dist/src/components/Content/index.js.map +1 -0
  39. package/dist/src/components/Content/wrapper.d.ts +11 -0
  40. package/dist/src/components/Content/wrapper.d.ts.map +1 -0
  41. package/dist/src/components/Content/wrapper.js +43 -0
  42. package/dist/src/components/Content/wrapper.js.map +1 -0
  43. package/dist/src/components/ControlGroup/index.d.ts +17 -0
  44. package/dist/src/components/ControlGroup/index.d.ts.map +1 -0
  45. package/dist/src/components/ControlGroup/index.js +90 -0
  46. package/dist/src/components/ControlGroup/index.js.map +1 -0
  47. package/dist/src/components/Drawer/index.d.ts +36 -0
  48. package/dist/src/components/Drawer/index.d.ts.map +1 -0
  49. package/dist/src/components/Drawer/index.js +251 -0
  50. package/dist/src/components/Drawer/index.js.map +1 -0
  51. package/dist/src/components/Dropdown/index.d.ts +24 -0
  52. package/dist/src/components/Dropdown/index.d.ts.map +1 -0
  53. package/dist/src/components/Dropdown/index.js +38 -0
  54. package/dist/src/components/Dropdown/index.js.map +1 -0
  55. package/dist/src/components/Dropdown/item.d.ts +10 -0
  56. package/dist/src/components/Dropdown/item.d.ts.map +1 -0
  57. package/dist/src/components/Dropdown/item.js +35 -0
  58. package/dist/src/components/Dropdown/item.js.map +1 -0
  59. package/dist/src/components/Dropdown/list.d.ts +14 -0
  60. package/dist/src/components/Dropdown/list.d.ts.map +1 -0
  61. package/dist/src/components/Dropdown/list.js +47 -0
  62. package/dist/src/components/Dropdown/list.js.map +1 -0
  63. package/dist/src/components/Header/index.d.ts +13 -0
  64. package/dist/src/components/Header/index.d.ts.map +1 -0
  65. package/dist/src/components/Header/index.js +44 -0
  66. package/dist/src/components/Header/index.js.map +1 -0
  67. package/dist/src/components/Icon/index.d.ts +16 -0
  68. package/dist/src/components/Icon/index.d.ts.map +1 -0
  69. package/dist/src/components/Icon/index.js +81 -0
  70. package/dist/src/components/Icon/index.js.map +1 -0
  71. package/dist/src/components/Input/index.d.ts +33 -0
  72. package/dist/src/components/Input/index.d.ts.map +1 -0
  73. package/dist/src/components/Input/index.js +115 -0
  74. package/dist/src/components/Input/index.js.map +1 -0
  75. package/dist/src/components/InputClearButton/index.d.ts +10 -0
  76. package/dist/src/components/InputClearButton/index.d.ts.map +1 -0
  77. package/dist/src/components/InputClearButton/index.js +49 -0
  78. package/dist/src/components/InputClearButton/index.js.map +1 -0
  79. package/dist/src/components/InternalPopover/index.d.ts +7 -0
  80. package/dist/src/components/InternalPopover/index.d.ts.map +1 -0
  81. package/dist/src/components/InternalPopover/index.js +132 -0
  82. package/dist/src/components/InternalPopover/index.js.map +1 -0
  83. package/dist/src/components/Layout/content.d.ts +8 -0
  84. package/dist/src/components/Layout/content.d.ts.map +1 -0
  85. package/dist/src/components/Layout/content.js +41 -0
  86. package/dist/src/components/Layout/content.js.map +1 -0
  87. package/dist/src/components/Layout/index.d.ts +8 -0
  88. package/dist/src/components/Layout/index.d.ts.map +1 -0
  89. package/dist/src/components/Layout/index.js +69 -0
  90. package/dist/src/components/Layout/index.js.map +1 -0
  91. package/dist/src/components/Menu/divider.d.ts +7 -0
  92. package/dist/src/components/Menu/divider.d.ts.map +1 -0
  93. package/dist/src/components/Menu/divider.js +49 -0
  94. package/dist/src/components/Menu/divider.js.map +1 -0
  95. package/dist/src/components/Menu/index.d.ts +17 -0
  96. package/dist/src/components/Menu/index.d.ts.map +1 -0
  97. package/dist/src/components/Menu/index.js +89 -0
  98. package/dist/src/components/Menu/index.js.map +1 -0
  99. package/dist/src/components/Menu/item.d.ts +31 -0
  100. package/dist/src/components/Menu/item.d.ts.map +1 -0
  101. package/dist/src/components/Menu/item.js +121 -0
  102. package/dist/src/components/Menu/item.js.map +1 -0
  103. package/dist/src/components/Message/index.d.ts +25 -0
  104. package/dist/src/components/Message/index.d.ts.map +1 -0
  105. package/dist/src/components/Message/index.js +54 -0
  106. package/dist/src/components/Message/index.js.map +1 -0
  107. package/dist/src/components/Modal/index.d.ts +14 -0
  108. package/dist/src/components/Modal/index.d.ts.map +1 -0
  109. package/dist/src/components/Modal/index.js +33 -0
  110. package/dist/src/components/Modal/index.js.map +1 -0
  111. package/dist/src/components/Navbar/divider.d.ts +9 -0
  112. package/dist/src/components/Navbar/divider.d.ts.map +1 -0
  113. package/dist/src/components/Navbar/divider.js +47 -0
  114. package/dist/src/components/Navbar/divider.js.map +1 -0
  115. package/dist/src/components/Navbar/group.d.ts +15 -0
  116. package/dist/src/components/Navbar/group.d.ts.map +1 -0
  117. package/dist/src/components/Navbar/group.js +75 -0
  118. package/dist/src/components/Navbar/group.js.map +1 -0
  119. package/dist/src/components/Navbar/index.d.ts +16 -0
  120. package/dist/src/components/Navbar/index.d.ts.map +1 -0
  121. package/dist/src/components/Navbar/index.js +86 -0
  122. package/dist/src/components/Navbar/index.js.map +1 -0
  123. package/dist/src/components/Navbar/item.d.ts +16 -0
  124. package/dist/src/components/Navbar/item.d.ts.map +1 -0
  125. package/dist/src/components/Navbar/item.js +81 -0
  126. package/dist/src/components/Navbar/item.js.map +1 -0
  127. package/dist/src/components/Notifications/index.d.ts +12 -0
  128. package/dist/src/components/Notifications/index.d.ts.map +1 -0
  129. package/dist/src/components/Notifications/index.js +60 -0
  130. package/dist/src/components/Notifications/index.js.map +1 -0
  131. package/dist/src/components/Notifications/notification.d.ts +43 -0
  132. package/dist/src/components/Notifications/notification.d.ts.map +1 -0
  133. package/dist/src/components/Notifications/notification.js +140 -0
  134. package/dist/src/components/Notifications/notification.js.map +1 -0
  135. package/dist/src/components/Panel/index.d.ts +49 -0
  136. package/dist/src/components/Panel/index.d.ts.map +1 -0
  137. package/dist/src/components/Panel/index.js +172 -0
  138. package/dist/src/components/Panel/index.js.map +1 -0
  139. package/dist/src/components/Panel/panel.screenshot.d.ts +3 -0
  140. package/dist/src/components/Panel/panel.screenshot.d.ts.map +1 -0
  141. package/dist/src/components/Panel/panel.screenshot.js +30 -0
  142. package/dist/src/components/Panel/panel.screenshot.js.map +1 -0
  143. package/dist/src/components/Paragraph/index.d.ts +8 -0
  144. package/dist/src/components/Paragraph/index.d.ts.map +1 -0
  145. package/dist/src/components/Paragraph/index.js +64 -0
  146. package/dist/src/components/Paragraph/index.js.map +1 -0
  147. package/dist/src/components/Popover/index.d.ts +16 -0
  148. package/dist/src/components/Popover/index.d.ts.map +1 -0
  149. package/dist/src/components/Popover/index.js +55 -0
  150. package/dist/src/components/Popover/index.js.map +1 -0
  151. package/dist/src/components/RadioGroup/index.d.ts +17 -0
  152. package/dist/src/components/RadioGroup/index.d.ts.map +1 -0
  153. package/dist/src/components/RadioGroup/index.js +48 -0
  154. package/dist/src/components/RadioGroup/index.js.map +1 -0
  155. package/dist/src/components/Sidebar/index.d.ts +60 -0
  156. package/dist/src/components/Sidebar/index.d.ts.map +1 -0
  157. package/dist/src/components/Sidebar/index.js +265 -0
  158. package/dist/src/components/Sidebar/index.js.map +1 -0
  159. package/dist/src/components/Sidebar/item.d.ts +36 -0
  160. package/dist/src/components/Sidebar/item.d.ts.map +1 -0
  161. package/dist/src/components/Sidebar/item.js +106 -0
  162. package/dist/src/components/Sidebar/item.js.map +1 -0
  163. package/dist/src/components/Table/body.d.ts +10 -0
  164. package/dist/src/components/Table/body.d.ts.map +1 -0
  165. package/dist/src/components/Table/body.js +44 -0
  166. package/dist/src/components/Table/body.js.map +1 -0
  167. package/dist/src/components/Table/header.d.ts +29 -0
  168. package/dist/src/components/Table/header.d.ts.map +1 -0
  169. package/dist/src/components/Table/header.js +106 -0
  170. package/dist/src/components/Table/header.js.map +1 -0
  171. package/dist/src/components/Table/headerCell.d.ts +18 -0
  172. package/dist/src/components/Table/headerCell.d.ts.map +1 -0
  173. package/dist/src/components/Table/headerCell.js +92 -0
  174. package/dist/src/components/Table/headerCell.js.map +1 -0
  175. package/dist/src/components/Table/helpers.d.ts +8 -0
  176. package/dist/src/components/Table/helpers.d.ts.map +1 -0
  177. package/dist/src/components/Table/helpers.js +41 -0
  178. package/dist/src/components/Table/helpers.js.map +1 -0
  179. package/dist/src/components/Table/index.d.ts +75 -0
  180. package/dist/src/components/Table/index.d.ts.map +1 -0
  181. package/dist/src/components/Table/index.js +165 -0
  182. package/dist/src/components/Table/index.js.map +1 -0
  183. package/dist/src/components/Table/row.d.ts +58 -0
  184. package/dist/src/components/Table/row.d.ts.map +1 -0
  185. package/dist/src/components/Table/row.js +204 -0
  186. package/dist/src/components/Table/row.js.map +1 -0
  187. package/dist/src/components/Tabs/content.d.ts +8 -0
  188. package/dist/src/components/Tabs/content.d.ts.map +1 -0
  189. package/dist/src/components/Tabs/content.js +41 -0
  190. package/dist/src/components/Tabs/content.js.map +1 -0
  191. package/dist/src/components/Tabs/index.d.ts +39 -0
  192. package/dist/src/components/Tabs/index.d.ts.map +1 -0
  193. package/dist/src/components/Tabs/index.js +83 -0
  194. package/dist/src/components/Tabs/index.js.map +1 -0
  195. package/dist/src/components/Tabs/item.d.ts +23 -0
  196. package/dist/src/components/Tabs/item.d.ts.map +1 -0
  197. package/dist/src/components/Tabs/item.js +71 -0
  198. package/dist/src/components/Tabs/item.js.map +1 -0
  199. package/dist/src/components/Tabs/list.d.ts +17 -0
  200. package/dist/src/components/Tabs/list.d.ts.map +1 -0
  201. package/dist/src/components/Tabs/list.js +189 -0
  202. package/dist/src/components/Tabs/list.js.map +1 -0
  203. package/dist/src/components/Tag/group.d.ts +10 -0
  204. package/dist/src/components/Tag/group.d.ts.map +1 -0
  205. package/dist/src/components/Tag/group.js +50 -0
  206. package/dist/src/components/Tag/group.js.map +1 -0
  207. package/dist/src/components/Tag/index.d.ts +36 -0
  208. package/dist/src/components/Tag/index.d.ts.map +1 -0
  209. package/dist/src/components/Tag/index.js +136 -0
  210. package/dist/src/components/Tag/index.js.map +1 -0
  211. package/dist/src/components/Textarea/index.d.ts +26 -0
  212. package/dist/src/components/Textarea/index.d.ts.map +1 -0
  213. package/dist/src/components/Textarea/index.js +85 -0
  214. package/dist/src/components/Textarea/index.js.map +1 -0
  215. package/dist/src/components/TimeAgo/index.d.ts +4 -0
  216. package/dist/src/components/TimeAgo/index.d.ts.map +1 -0
  217. package/dist/src/components/TimeAgo/index.js +21 -0
  218. package/dist/src/components/TimeAgo/index.js.map +1 -0
  219. package/dist/src/components/Tree/index.d.ts +16 -0
  220. package/dist/src/components/Tree/index.d.ts.map +1 -0
  221. package/dist/src/components/Tree/index.js +155 -0
  222. package/dist/src/components/Tree/index.js.map +1 -0
  223. package/dist/src/constants/animations.d.ts +5 -0
  224. package/dist/src/constants/animations.d.ts.map +1 -0
  225. package/dist/src/constants/animations.js +8 -0
  226. package/dist/src/constants/animations.js.map +1 -0
  227. package/dist/src/constants/colors.d.ts +10 -0
  228. package/dist/src/constants/colors.d.ts.map +1 -0
  229. package/dist/src/constants/colors.js +13 -0
  230. package/dist/src/constants/colors.js.map +1 -0
  231. package/dist/src/constants/sizes.d.ts +59 -0
  232. package/dist/src/constants/sizes.d.ts.map +1 -0
  233. package/dist/src/constants/sizes.js +60 -0
  234. package/dist/src/constants/sizes.js.map +1 -0
  235. package/dist/src/constants/theme.d.ts +81 -0
  236. package/dist/src/constants/theme.d.ts.map +1 -0
  237. package/dist/src/constants/theme.js +20 -0
  238. package/dist/src/constants/theme.js.map +1 -0
  239. package/dist/src/containers/PopoverProvider.d.ts +13 -0
  240. package/dist/src/containers/PopoverProvider.d.ts.map +1 -0
  241. package/dist/src/containers/PopoverProvider.js +81 -0
  242. package/dist/src/containers/PopoverProvider.js.map +1 -0
  243. package/dist/src/containers/ReqoreProvider.d.ts +40 -0
  244. package/dist/src/containers/ReqoreProvider.d.ts.map +1 -0
  245. package/dist/src/containers/ReqoreProvider.js +125 -0
  246. package/dist/src/containers/ReqoreProvider.js.map +1 -0
  247. package/dist/src/containers/ThemeProvider.d.ts +8 -0
  248. package/dist/src/containers/ThemeProvider.d.ts.map +1 -0
  249. package/dist/src/containers/ThemeProvider.js +27 -0
  250. package/dist/src/containers/ThemeProvider.js.map +1 -0
  251. package/dist/src/containers/UIProvider.d.ts +13 -0
  252. package/dist/src/containers/UIProvider.d.ts.map +1 -0
  253. package/dist/src/containers/UIProvider.js +43 -0
  254. package/dist/src/containers/UIProvider.js.map +1 -0
  255. package/dist/src/context/PopoverContext.d.ts +11 -0
  256. package/dist/src/context/PopoverContext.d.ts.map +1 -0
  257. package/dist/src/context/PopoverContext.js +5 -0
  258. package/dist/src/context/PopoverContext.js.map +1 -0
  259. package/dist/src/context/ReqoreContext.d.ts +15 -0
  260. package/dist/src/context/ReqoreContext.d.ts.map +1 -0
  261. package/dist/src/context/ReqoreContext.js +10 -0
  262. package/dist/src/context/ReqoreContext.js.map +1 -0
  263. package/dist/src/context/ThemeContext.d.ts +5 -0
  264. package/dist/src/context/ThemeContext.d.ts.map +1 -0
  265. package/dist/src/context/ThemeContext.js +6 -0
  266. package/dist/src/context/ThemeContext.js.map +1 -0
  267. package/dist/src/helpers/animations.d.ts +2 -0
  268. package/dist/src/helpers/animations.d.ts.map +1 -0
  269. package/dist/src/helpers/animations.js +11 -0
  270. package/dist/src/helpers/animations.js.map +1 -0
  271. package/dist/src/helpers/colors.d.ts +14 -0
  272. package/dist/src/helpers/colors.d.ts.map +1 -0
  273. package/dist/src/helpers/colors.js +108 -0
  274. package/dist/src/helpers/colors.js.map +1 -0
  275. package/dist/src/helpers/sidebar.d.ts +4 -0
  276. package/dist/src/helpers/sidebar.d.ts.map +1 -0
  277. package/dist/src/helpers/sidebar.js +90 -0
  278. package/dist/src/helpers/sidebar.js.map +1 -0
  279. package/dist/src/helpers/time.d.ts +8 -0
  280. package/dist/src/helpers/time.d.ts.map +1 -0
  281. package/dist/src/helpers/time.js +25 -0
  282. package/dist/src/helpers/time.js.map +1 -0
  283. package/dist/src/helpers/utils.d.ts +5 -0
  284. package/dist/src/helpers/utils.d.ts.map +1 -0
  285. package/dist/src/helpers/utils.js +103 -0
  286. package/dist/src/helpers/utils.js.map +1 -0
  287. package/dist/src/hooks/useCombinedRefs.d.ts +3 -0
  288. package/dist/src/hooks/useCombinedRefs.d.ts.map +1 -0
  289. package/dist/src/hooks/useCombinedRefs.js +29 -0
  290. package/dist/src/hooks/useCombinedRefs.js.map +1 -0
  291. package/dist/src/hooks/useLatestZIndex.d.ts +3 -0
  292. package/dist/src/hooks/useLatestZIndex.d.ts.map +1 -0
  293. package/dist/src/hooks/useLatestZIndex.js +11 -0
  294. package/dist/src/hooks/useLatestZIndex.js.map +1 -0
  295. package/dist/src/hooks/useOutsideClick.d.ts +4 -0
  296. package/dist/src/hooks/useOutsideClick.d.ts.map +1 -0
  297. package/dist/src/hooks/useOutsideClick.js +19 -0
  298. package/dist/src/hooks/useOutsideClick.js.map +1 -0
  299. package/dist/src/hooks/usePopover.d.ts +19 -0
  300. package/dist/src/hooks/usePopover.d.ts.map +1 -0
  301. package/dist/src/hooks/usePopover.js +86 -0
  302. package/dist/src/hooks/usePopover.js.map +1 -0
  303. package/dist/src/hooks/useShareForwardedRef.d.ts +3 -0
  304. package/dist/src/hooks/useShareForwardedRef.d.ts.map +1 -0
  305. package/dist/src/hooks/useShareForwardedRef.js +25 -0
  306. package/dist/src/hooks/useShareForwardedRef.js.map +1 -0
  307. package/dist/src/hooks/useTheme.d.ts +3 -0
  308. package/dist/src/hooks/useTheme.d.ts.map +1 -0
  309. package/dist/src/hooks/useTheme.js +21 -0
  310. package/dist/src/hooks/useTheme.js.map +1 -0
  311. package/dist/src/hooks/useTooltip.d.ts +3 -0
  312. package/dist/src/hooks/useTooltip.d.ts.map +1 -0
  313. package/dist/src/hooks/useTooltip.js +24 -0
  314. package/dist/src/hooks/useTooltip.js.map +1 -0
  315. package/dist/src/icons.json +2295 -0
  316. package/dist/src/index.d.ts +50 -0
  317. package/dist/src/index.d.ts.map +1 -0
  318. package/dist/src/index.js +122 -0
  319. package/dist/src/index.js.map +1 -0
  320. package/dist/src/mock/breadcrumbs.d.ts +5 -0
  321. package/dist/src/mock/breadcrumbs.d.ts.map +1 -0
  322. package/dist/src/mock/breadcrumbs.js +94 -0
  323. package/dist/src/mock/breadcrumbs.js.map +1 -0
  324. package/dist/src/mock/icons.d.ts +5 -0
  325. package/dist/src/mock/icons.d.ts.map +1 -0
  326. package/dist/src/mock/icons.js +34 -0
  327. package/dist/src/mock/icons.js.map +1 -0
  328. package/dist/src/mock/menu.d.ts +3 -0
  329. package/dist/src/mock/menu.d.ts.map +1 -0
  330. package/dist/src/mock/menu.js +97 -0
  331. package/dist/src/mock/menu.js.map +1 -0
  332. package/dist/src/mock/object.json +317 -0
  333. package/dist/src/mock/tableData.d.ts +8 -0
  334. package/dist/src/mock/tableData.d.ts.map +1 -0
  335. package/dist/src/mock/tableData.js +53 -0
  336. package/dist/src/mock/tableData.js.map +1 -0
  337. package/dist/src/stories/Breadcrumbs/Breadcrumbs.stories.d.ts +10 -0
  338. package/dist/src/stories/Breadcrumbs/Breadcrumbs.stories.d.ts.map +1 -0
  339. package/dist/src/stories/Breadcrumbs/Breadcrumbs.stories.js +72 -0
  340. package/dist/src/stories/Breadcrumbs/Breadcrumbs.stories.js.map +1 -0
  341. package/dist/src/stories/Button/Button.stories.d.ts +12 -0
  342. package/dist/src/stories/Button/Button.stories.d.ts.map +1 -0
  343. package/dist/src/stories/Button/Button.stories.js +57 -0
  344. package/dist/src/stories/Button/Button.stories.js.map +1 -0
  345. package/dist/src/stories/Checkbox/Checkbox.stories.d.ts +7 -0
  346. package/dist/src/stories/Checkbox/Checkbox.stories.d.ts.map +1 -0
  347. package/dist/src/stories/Checkbox/Checkbox.stories.js +29 -0
  348. package/dist/src/stories/Checkbox/Checkbox.stories.js.map +1 -0
  349. package/dist/src/stories/Columns/Columns.stories.d.ts +10 -0
  350. package/dist/src/stories/Columns/Columns.stories.d.ts.map +1 -0
  351. package/dist/src/stories/Columns/Columns.stories.js +49 -0
  352. package/dist/src/stories/Columns/Columns.stories.js.map +1 -0
  353. package/dist/src/stories/Comment/Comment.stories.d.ts +7 -0
  354. package/dist/src/stories/Comment/Comment.stories.d.ts.map +1 -0
  355. package/dist/src/stories/Comment/Comment.stories.js +43 -0
  356. package/dist/src/stories/Comment/Comment.stories.js.map +1 -0
  357. package/dist/src/stories/ControlGroup/ControlGroup.stories.d.ts +8 -0
  358. package/dist/src/stories/ControlGroup/ControlGroup.stories.d.ts.map +1 -0
  359. package/dist/src/stories/ControlGroup/ControlGroup.stories.js +44 -0
  360. package/dist/src/stories/ControlGroup/ControlGroup.stories.js.map +1 -0
  361. package/dist/src/stories/Drawer/Drawer.stories.d.ts +8 -0
  362. package/dist/src/stories/Drawer/Drawer.stories.d.ts.map +1 -0
  363. package/dist/src/stories/Drawer/Drawer.stories.js +97 -0
  364. package/dist/src/stories/Drawer/Drawer.stories.js.map +1 -0
  365. package/dist/src/stories/Dropdown/Dropdown.stories.d.ts +8 -0
  366. package/dist/src/stories/Dropdown/Dropdown.stories.d.ts.map +1 -0
  367. package/dist/src/stories/Dropdown/Dropdown.stories.js +141 -0
  368. package/dist/src/stories/Dropdown/Dropdown.stories.js.map +1 -0
  369. package/dist/src/stories/Icon/Icon.stories.d.ts +6 -0
  370. package/dist/src/stories/Icon/Icon.stories.d.ts.map +1 -0
  371. package/dist/src/stories/Icon/Icon.stories.js +13 -0
  372. package/dist/src/stories/Icon/Icon.stories.js.map +1 -0
  373. package/dist/src/stories/Input/Input.stories.d.ts +6 -0
  374. package/dist/src/stories/Input/Input.stories.d.ts.map +1 -0
  375. package/dist/src/stories/Input/Input.stories.js +38 -0
  376. package/dist/src/stories/Input/Input.stories.js.map +1 -0
  377. package/dist/src/stories/Menu/Menu.stories.d.ts +6 -0
  378. package/dist/src/stories/Menu/Menu.stories.d.ts.map +1 -0
  379. package/dist/src/stories/Menu/Menu.stories.js +48 -0
  380. package/dist/src/stories/Menu/Menu.stories.js.map +1 -0
  381. package/dist/src/stories/Message/Message.stories.d.ts +8 -0
  382. package/dist/src/stories/Message/Message.stories.d.ts.map +1 -0
  383. package/dist/src/stories/Message/Message.stories.js +50 -0
  384. package/dist/src/stories/Message/Message.stories.js.map +1 -0
  385. package/dist/src/stories/Modal/Modal.stories.d.ts +7 -0
  386. package/dist/src/stories/Modal/Modal.stories.d.ts.map +1 -0
  387. package/dist/src/stories/Modal/Modal.stories.js +77 -0
  388. package/dist/src/stories/Modal/Modal.stories.js.map +1 -0
  389. package/dist/src/stories/Navbar/Navbar.stories.d.ts +6 -0
  390. package/dist/src/stories/Navbar/Navbar.stories.d.ts.map +1 -0
  391. package/dist/src/stories/Navbar/Navbar.stories.js +33 -0
  392. package/dist/src/stories/Navbar/Navbar.stories.js.map +1 -0
  393. package/dist/src/stories/Notifications/Interactive.stories.d.ts +9 -0
  394. package/dist/src/stories/Notifications/Interactive.stories.d.ts.map +1 -0
  395. package/dist/src/stories/Notifications/Interactive.stories.js +100 -0
  396. package/dist/src/stories/Notifications/Interactive.stories.js.map +1 -0
  397. package/dist/src/stories/Notifications/Notification.stories.d.ts +9 -0
  398. package/dist/src/stories/Notifications/Notification.stories.d.ts.map +1 -0
  399. package/dist/src/stories/Notifications/Notification.stories.js +96 -0
  400. package/dist/src/stories/Notifications/Notification.stories.js.map +1 -0
  401. package/dist/src/stories/Notifications/Notifications.stories.d.ts +10 -0
  402. package/dist/src/stories/Notifications/Notifications.stories.d.ts.map +1 -0
  403. package/dist/src/stories/Notifications/Notifications.stories.js +63 -0
  404. package/dist/src/stories/Notifications/Notifications.stories.js.map +1 -0
  405. package/dist/src/stories/Panel/Panel.stories.d.ts +9 -0
  406. package/dist/src/stories/Panel/Panel.stories.d.ts.map +1 -0
  407. package/dist/src/stories/Panel/Panel.stories.js +79 -0
  408. package/dist/src/stories/Panel/Panel.stories.js.map +1 -0
  409. package/dist/src/stories/Popover/Popover.stories.d.ts +6 -0
  410. package/dist/src/stories/Popover/Popover.stories.d.ts.map +1 -0
  411. package/dist/src/stories/Popover/Popover.stories.js +46 -0
  412. package/dist/src/stories/Popover/Popover.stories.js.map +1 -0
  413. package/dist/src/stories/RadioGroup/RadioGroup.stories.d.ts +7 -0
  414. package/dist/src/stories/RadioGroup/RadioGroup.stories.d.ts.map +1 -0
  415. package/dist/src/stories/RadioGroup/RadioGroup.stories.js +54 -0
  416. package/dist/src/stories/RadioGroup/RadioGroup.stories.js.map +1 -0
  417. package/dist/src/stories/Sidebar/Sidebar.stories.d.ts +6 -0
  418. package/dist/src/stories/Sidebar/Sidebar.stories.d.ts.map +1 -0
  419. package/dist/src/stories/Sidebar/Sidebar.stories.js +65 -0
  420. package/dist/src/stories/Sidebar/Sidebar.stories.js.map +1 -0
  421. package/dist/src/stories/Table/Table.stories.d.ts +10 -0
  422. package/dist/src/stories/Table/Table.stories.d.ts.map +1 -0
  423. package/dist/src/stories/Table/Table.stories.js +157 -0
  424. package/dist/src/stories/Table/Table.stories.js.map +1 -0
  425. package/dist/src/stories/Tabs/Tabs.stories.d.ts +12 -0
  426. package/dist/src/stories/Tabs/Tabs.stories.d.ts.map +1 -0
  427. package/dist/src/stories/Tabs/Tabs.stories.js +127 -0
  428. package/dist/src/stories/Tabs/Tabs.stories.js.map +1 -0
  429. package/dist/src/stories/Tag/Tag.stories.d.ts +8 -0
  430. package/dist/src/stories/Tag/Tag.stories.d.ts.map +1 -0
  431. package/dist/src/stories/Tag/Tag.stories.js +79 -0
  432. package/dist/src/stories/Tag/Tag.stories.js.map +1 -0
  433. package/dist/src/stories/TextArea/TextArea.stories.d.ts +8 -0
  434. package/dist/src/stories/TextArea/TextArea.stories.d.ts.map +1 -0
  435. package/dist/src/stories/TextArea/TextArea.stories.js +65 -0
  436. package/dist/src/stories/TextArea/TextArea.stories.js.map +1 -0
  437. package/dist/src/stories/Tree/Tree.stories.d.ts +7 -0
  438. package/dist/src/stories/Tree/Tree.stories.d.ts.map +1 -0
  439. package/dist/src/stories/Tree/Tree.stories.js +52 -0
  440. package/dist/src/stories/Tree/Tree.stories.js.map +1 -0
  441. package/dist/src/stories/Wrapper.d.ts +4 -0
  442. package/dist/src/stories/Wrapper.d.ts.map +1 -0
  443. package/dist/src/stories/Wrapper.js +38 -0
  444. package/dist/src/stories/Wrapper.js.map +1 -0
  445. package/dist/src/stories/utils/args.d.ts +61 -0
  446. package/dist/src/stories/utils/args.d.ts.map +1 -0
  447. package/dist/src/stories/utils/args.js +120 -0
  448. package/dist/src/stories/utils/args.js.map +1 -0
  449. package/dist/src/stories/utils.d.ts +11 -0
  450. package/dist/src/stories/utils.d.ts.map +1 -0
  451. package/dist/src/stories/utils.js +17 -0
  452. package/dist/src/stories/utils.js.map +1 -0
  453. package/dist/src/styles.d.ts +5 -0
  454. package/dist/src/styles.d.ts.map +1 -0
  455. package/dist/src/styles.js +16 -0
  456. package/dist/src/styles.js.map +1 -0
  457. package/dist/src/types/global.d.ts +9 -0
  458. package/dist/src/types/global.d.ts.map +1 -0
  459. package/dist/src/types/global.js +3 -0
  460. package/dist/src/types/global.js.map +1 -0
  461. package/dist/src/types/icons.d.ts +2 -0
  462. package/dist/src/types/icons.d.ts.map +1 -0
  463. package/dist/src/types/icons.js +3 -0
  464. package/dist/src/types/icons.js.map +1 -0
  465. package/dist/src/types/icons____.d.ts +2 -0
  466. package/dist/src/types/icons____.d.ts.map +1 -0
  467. package/dist/src/types/icons____.js +5 -0
  468. package/dist/src/types/icons____.js.map +1 -0
  469. package/dist/tests.json +1 -1
  470. package/package.json +2 -2
  471. package/src/components/Breadcrumbs/index.tsx +286 -0
  472. package/src/components/Breadcrumbs/item.tsx +162 -0
  473. package/src/components/Button/index.tsx +270 -0
  474. package/src/components/Checkbox/index.tsx +161 -0
  475. package/src/components/Columns/column.tsx +26 -0
  476. package/src/components/Columns/index.tsx +40 -0
  477. package/src/components/Comment/index.tsx +139 -0
  478. package/src/components/CommentFeed/index.tsx +34 -0
  479. package/src/components/Content/index.tsx +39 -0
  480. package/src/components/Content/wrapper.tsx +37 -0
  481. package/src/components/ControlGroup/index.tsx +81 -0
  482. package/src/components/Drawer/index.tsx +387 -0
  483. package/src/components/Dropdown/index.tsx +81 -0
  484. package/src/components/Dropdown/item.tsx +20 -0
  485. package/src/components/Dropdown/list.tsx +76 -0
  486. package/src/components/Header/index.tsx +38 -0
  487. package/src/components/Icon/index.tsx +83 -0
  488. package/src/components/Input/index.tsx +185 -0
  489. package/src/components/InputClearButton/index.tsx +34 -0
  490. package/src/components/InternalPopover/index.tsx +185 -0
  491. package/src/components/Layout/content.tsx +31 -0
  492. package/src/components/Layout/index.tsx +55 -0
  493. package/src/components/Menu/divider.tsx +36 -0
  494. package/src/components/Menu/index.tsx +64 -0
  495. package/src/components/Menu/item.tsx +219 -0
  496. package/src/components/Message/index.tsx +136 -0
  497. package/src/components/Modal/index.tsx +26 -0
  498. package/src/components/Navbar/divider.tsx +51 -0
  499. package/src/components/Navbar/group.tsx +57 -0
  500. package/src/components/Navbar/index.tsx +81 -0
  501. package/src/components/Navbar/item.tsx +75 -0
  502. package/src/components/Notifications/index.tsx +56 -0
  503. package/src/components/Notifications/notification.tsx +288 -0
  504. package/src/components/Panel/__screenshots__/linux/panel-SomePanel.png +0 -0
  505. package/src/components/Panel/index.tsx +333 -0
  506. package/src/components/Panel/panel.screenshot.tsx +29 -0
  507. package/src/components/Paragraph/index.tsx +25 -0
  508. package/src/components/Popover/index.tsx +65 -0
  509. package/src/components/RadioGroup/index.tsx +52 -0
  510. package/src/components/Sidebar/index.tsx +526 -0
  511. package/src/components/Sidebar/item.tsx +269 -0
  512. package/src/components/Table/body.tsx +46 -0
  513. package/src/components/Table/header.tsx +173 -0
  514. package/src/components/Table/headerCell.tsx +117 -0
  515. package/src/components/Table/helpers.ts +19 -0
  516. package/src/components/Table/index.tsx +265 -0
  517. package/src/components/Table/row.tsx +355 -0
  518. package/src/components/Tabs/content.tsx +23 -0
  519. package/src/components/Tabs/index.tsx +117 -0
  520. package/src/components/Tabs/item.tsx +151 -0
  521. package/src/components/Tabs/list.tsx +281 -0
  522. package/src/components/Tag/group.tsx +32 -0
  523. package/src/components/Tag/index.tsx +237 -0
  524. package/src/components/Textarea/index.tsx +121 -0
  525. package/src/components/TimeAgo/index.tsx +15 -0
  526. package/src/components/Tree/index.tsx +255 -0
  527. package/src/constants/animations.ts +4 -0
  528. package/src/constants/colors.ts +9 -0
  529. package/src/constants/sizes.ts +66 -0
  530. package/src/constants/theme.ts +102 -0
  531. package/src/containers/PopoverProvider.tsx +85 -0
  532. package/src/containers/ReqoreProvider.tsx +194 -0
  533. package/src/containers/ThemeProvider.tsx +22 -0
  534. package/src/containers/UIProvider.tsx +54 -0
  535. package/src/context/PopoverContext.tsx +10 -0
  536. package/src/context/ReqoreContext.tsx +20 -0
  537. package/src/context/ThemeContext.tsx +4 -0
  538. package/src/helpers/animations.ts +13 -0
  539. package/src/helpers/colors.ts +127 -0
  540. package/src/helpers/sidebar.ts +105 -0
  541. package/src/helpers/time.ts +21 -0
  542. package/src/helpers/utils.ts +75 -0
  543. package/src/hooks/useCombinedRefs.ts +19 -0
  544. package/src/hooks/useLatestZIndex.ts +11 -0
  545. package/src/hooks/useOutsideClick.ts +29 -0
  546. package/src/hooks/usePopover.tsx +118 -0
  547. package/src/hooks/useShareForwardedRef.ts +23 -0
  548. package/src/hooks/useTheme.ts +20 -0
  549. package/src/hooks/useTooltip.ts +15 -0
  550. package/src/icons.json +2295 -0
  551. package/src/index.tsx +49 -0
  552. package/src/mock/breadcrumbs.ts +93 -0
  553. package/src/mock/icons.ts +32 -0
  554. package/src/mock/menu.ts +95 -0
  555. package/src/mock/object.json +317 -0
  556. package/src/mock/styleMock.js +1 -0
  557. package/src/mock/tableData.ts +40 -0
  558. package/src/stories/Breadcrumbs/Breadcrumbs.stories.tsx +38 -0
  559. package/src/stories/Button/Button.stories.tsx +69 -0
  560. package/src/stories/Checkbox/Checkbox.stories.tsx +26 -0
  561. package/src/stories/Columns/Columns.stories.tsx +71 -0
  562. package/src/stories/Comment/Comment.stories.tsx +127 -0
  563. package/src/stories/ControlGroup/ControlGroup.stories.tsx +43 -0
  564. package/src/stories/Drawer/Drawer.stories.tsx +181 -0
  565. package/src/stories/Dropdown/Dropdown.stories.tsx +160 -0
  566. package/src/stories/Icon/Icon.stories.tsx +35 -0
  567. package/src/stories/Input/Input.stories.tsx +77 -0
  568. package/src/stories/Menu/Menu.stories.tsx +94 -0
  569. package/src/stories/Message/Message.stories.tsx +52 -0
  570. package/src/stories/Modal/Modal.stories.tsx +148 -0
  571. package/src/stories/Navbar/Navbar.stories.tsx +109 -0
  572. package/src/stories/Notifications/Interactive.stories.tsx +105 -0
  573. package/src/stories/Notifications/Notification.stories.tsx +200 -0
  574. package/src/stories/Notifications/Notifications.stories.tsx +65 -0
  575. package/src/stories/Panel/Panel.stories.tsx +107 -0
  576. package/src/stories/Popover/Popover.stories.tsx +54 -0
  577. package/src/stories/RadioGroup/RadioGroup.stories.tsx +51 -0
  578. package/src/stories/Sidebar/Sidebar.stories.tsx +78 -0
  579. package/src/stories/Table/Table.stories.tsx +151 -0
  580. package/src/stories/Tabs/Tabs.stories.tsx +233 -0
  581. package/src/stories/Tag/Tag.stories.tsx +72 -0
  582. package/src/stories/TextArea/TextArea.stories.tsx +74 -0
  583. package/src/stories/Tree/Tree.stories.tsx +43 -0
  584. package/src/stories/Wrapper.tsx +13 -0
  585. package/src/stories/utils/args.ts +138 -0
  586. package/src/stories/utils.ts +17 -0
  587. package/src/styles.ts +38 -0
  588. package/src/types/global.ts +9 -0
  589. package/src/types/icons.ts +2272 -0
  590. package/src/types/icons____.ts +5 -0
  591. package/tests.json +1 -1
  592. package/tsconfig.prod.json +26 -0
@@ -0,0 +1,237 @@
1
+ import _size from 'lodash/size';
2
+ import React, { forwardRef, useContext, useRef } from 'react';
3
+ import styled, { css } from 'styled-components';
4
+ import { ReqorePopover } from '../..';
5
+ import {
6
+ PADDING_FROM_SIZE,
7
+ RADIUS_FROM_SIZE,
8
+ SIZE_TO_PX,
9
+ TEXT_FROM_SIZE,
10
+ TSizes,
11
+ } from '../../constants/sizes';
12
+ import { IReqoreIntent, IReqoreTheme } from '../../constants/theme';
13
+ import ThemeContext from '../../context/ThemeContext';
14
+ import { changeLightness, getReadableColor, getReadableColorFrom } from '../../helpers/colors';
15
+ import { useCombinedRefs } from '../../hooks/useCombinedRefs';
16
+ import usePopover from '../../hooks/usePopover';
17
+ import { IReqoreTooltip } from '../../types/global';
18
+ import { IReqoreIconName } from '../../types/icons';
19
+ import ReqoreIcon from '../Icon';
20
+
21
+ export interface IReqoreTagAction {
22
+ icon: IReqoreIconName;
23
+ onClick?: (event: React.MouseEvent<HTMLDivElement>) => void;
24
+ disabled?: boolean;
25
+ tooltip?: IReqoreTooltip;
26
+ intent?: IReqoreIntent;
27
+ }
28
+
29
+ export interface IReqoreTagProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, 'children'> {
30
+ size?: TSizes;
31
+ label?: string;
32
+ onRemoveClick?: (event: React.MouseEvent<HTMLDivElement>) => void;
33
+ onClick?: (event: React.MouseEvent<HTMLDivElement>) => void;
34
+ icon?: IReqoreIconName;
35
+ rightIcon?: IReqoreIconName;
36
+ color?: string;
37
+ tooltip?: IReqoreTooltip;
38
+ disabled?: boolean;
39
+ actions?: IReqoreTagAction[];
40
+ width?: string;
41
+ badge?: boolean;
42
+ intent?: IReqoreIntent;
43
+ }
44
+
45
+ export interface IReqoreTagStyle extends IReqoreTagProps {
46
+ theme: IReqoreTheme;
47
+ removable?: boolean;
48
+ interactive?: boolean;
49
+ }
50
+
51
+ export const StyledTag = styled.div<IReqoreTagStyle>`
52
+ display: inline-flex;
53
+ justify-content: center;
54
+ flex-shrink: 0;
55
+ align-items: center;
56
+ font-family: system-ui;
57
+ font-weight: 600;
58
+ overflow: hidden;
59
+ font-size: ${({ size }) => TEXT_FROM_SIZE[size]}px;
60
+ height: ${({ size }) => SIZE_TO_PX[size]}px;
61
+ min-width: ${({ size }) => SIZE_TO_PX[size]}px;
62
+ border-radius: ${({ badge, size }) => (badge ? 20 : RADIUS_FROM_SIZE[size])}px;
63
+ width: ${({ width }) => width || undefined};
64
+
65
+ ${({ theme, color }) =>
66
+ css`
67
+ background-color: ${color || changeLightness(theme.main, 0.1)};
68
+ color: ${color ? getReadableColorFrom(color) : getReadableColor(theme, undefined, undefined)};
69
+ }
70
+ `}
71
+
72
+ ${({ theme, color, interactive }) =>
73
+ interactive &&
74
+ css`
75
+ cursor: pointer;
76
+ &:hover {
77
+ background-color: ${changeLightness(color || theme.main, color ? 0.05 : 0.15)};
78
+ color: ${color
79
+ ? getReadableColorFrom(color)
80
+ : getReadableColor(theme, undefined, undefined)};
81
+ }
82
+ `}
83
+
84
+
85
+ ${({ disabled }) =>
86
+ disabled &&
87
+ css`
88
+ opacity: 0.5;
89
+ pointer-events: none;
90
+ cursor: not-allowed;
91
+ `}
92
+ `;
93
+
94
+ const StyledTagContentWrapper = styled.div<{ size: TSizes }>`
95
+ padding: 0 ${({ size }) => PADDING_FROM_SIZE[size]}px;
96
+ display: flex;
97
+ align-items: center;
98
+ justify-content: center;
99
+ flex-shrink: 0;
100
+ flex: 1;
101
+ overflow: hidden;
102
+ `;
103
+
104
+ const StyledTagContent = styled.span<{ size: TSizes }>`
105
+ height: 100%;
106
+ align-items: center;
107
+ overflow: hidden;
108
+ text-overflow: ellipsis;
109
+ white-space: nowrap;
110
+ `;
111
+
112
+ const StyledButtonWrapper = styled.div<IReqoreTagStyle>`
113
+ flex-shrink: 0;
114
+ font-size: ${({ size }) => TEXT_FROM_SIZE[size]}px;
115
+ height: ${({ size }) => SIZE_TO_PX[size]}px;
116
+ width: ${({ size }) => SIZE_TO_PX[size]}px;
117
+ display: flex;
118
+ justify-content: center;
119
+ align-items: center;
120
+ transition: background-color 0.2s ease-out;
121
+
122
+ ${({ theme, color }) =>
123
+ css`
124
+ .reqore-icon {
125
+ transform: scale(0.85);
126
+ }
127
+ &:hover {
128
+ cursor: pointer;
129
+ background-color: ${changeLightness(color || theme.main, color ? 0.09 : 0.19)};
130
+
131
+ .reqore-icon {
132
+ transform: scale(1);
133
+ }
134
+ }
135
+ `}
136
+ `;
137
+
138
+ const ReqoreTag = forwardRef(
139
+ (
140
+ {
141
+ tooltip,
142
+ label,
143
+ icon,
144
+ rightIcon,
145
+ className,
146
+ onClick,
147
+ size = 'normal',
148
+ onRemoveClick,
149
+ actions,
150
+ badge,
151
+ intent,
152
+ color,
153
+ ...rest
154
+ }: IReqoreTagProps,
155
+ ref
156
+ ) => {
157
+ const innerRef = useRef(null);
158
+ const combinedRef = useCombinedRefs(innerRef, ref);
159
+ const theme: IReqoreTheme = useContext<IReqoreTheme>(ThemeContext);
160
+
161
+ usePopover({
162
+ ...tooltip,
163
+ targetElement: combinedRef.current,
164
+ show: !!tooltip?.content,
165
+ });
166
+
167
+ // If color or intent was specified, set the color
168
+ const customColor = intent ? theme.intents[intent] : color;
169
+
170
+ return (
171
+ <StyledTag
172
+ {...rest}
173
+ color={customColor}
174
+ className={`${className || ''} reqore-tag`}
175
+ size={size}
176
+ ref={combinedRef}
177
+ badge={badge}
178
+ removable={!!onRemoveClick}
179
+ interactive={!!onClick && !rest.disabled}
180
+ >
181
+ <StyledTagContentWrapper size={size} className='reqore-tag-content' onClick={onClick}>
182
+ {icon && (
183
+ <ReqoreIcon
184
+ icon={icon}
185
+ size={`${TEXT_FROM_SIZE[size]}px`}
186
+ margin={label || rightIcon ? 'right' : undefined}
187
+ />
188
+ )}
189
+ {label && <StyledTagContent size={size}>{label}</StyledTagContent>}
190
+ {rightIcon && (
191
+ <ReqoreIcon
192
+ icon={rightIcon}
193
+ size={`${TEXT_FROM_SIZE[size]}px`}
194
+ margin={label ? 'left' : undefined}
195
+ />
196
+ )}
197
+ </StyledTagContentWrapper>
198
+ {_size(actions)
199
+ ? actions.map((action) => (
200
+ <>
201
+ <ReqorePopover
202
+ {...action.tooltip}
203
+ component={StyledButtonWrapper}
204
+ componentProps={{
205
+ size,
206
+ color: customColor,
207
+ className: 'reqore-tag-action',
208
+ onClick: action.onClick,
209
+ }}
210
+ noWrapper
211
+ >
212
+ <ReqoreIcon icon={action.icon} size={`${TEXT_FROM_SIZE[size]}px`} />
213
+ </ReqorePopover>
214
+ </>
215
+ ))
216
+ : null}
217
+ {onRemoveClick && !rest.disabled ? (
218
+ <ReqorePopover
219
+ component={StyledButtonWrapper}
220
+ componentProps={{
221
+ size,
222
+ color: customColor,
223
+ className: 'reqore-tag-remove',
224
+ onClick: onRemoveClick,
225
+ }}
226
+ noWrapper
227
+ content='Remove'
228
+ >
229
+ <ReqoreIcon icon='CloseLine' size={`${TEXT_FROM_SIZE[size]}px`} />
230
+ </ReqorePopover>
231
+ ) : null}
232
+ </StyledTag>
233
+ );
234
+ }
235
+ );
236
+
237
+ export default ReqoreTag;
@@ -0,0 +1,121 @@
1
+ import { darken, rgba } from 'polished';
2
+ import React, { forwardRef } from 'react';
3
+ import styled from 'styled-components';
4
+ import { TEXT_FROM_SIZE, TSizes } from '../../constants/sizes';
5
+ import { IReqoreTheme } from '../../constants/theme';
6
+ import { getReadableColor } from '../../helpers/colors';
7
+ import ReqoreInputClearButton from '../InputClearButton';
8
+
9
+ export interface IReqoreTextareaProps extends React.HTMLAttributes<HTMLTextAreaElement> {
10
+ autoFocus?: boolean;
11
+ disabled?: boolean;
12
+ width?: number;
13
+ height?: number;
14
+ scaleWithContent?: boolean;
15
+ size?: TSizes;
16
+ minimal?: boolean;
17
+ fluid?: boolean;
18
+ value?: string;
19
+ rows?: number;
20
+ cols?: number;
21
+ onClearClick?: () => any;
22
+ }
23
+
24
+ export interface IReqoreTextareaStyle extends IReqoreTextareaProps {
25
+ theme: IReqoreTheme;
26
+ _size?: TSizes;
27
+ }
28
+
29
+ export const StyledTextareaWrapper = styled.div<IReqoreTextareaStyle>`
30
+ height: ${({ height }) => (height ? `${height}px` : undefined)};
31
+ width: ${({ width, fluid }) => (fluid ? '100%' : width ? `${width}px` : 'auto')};
32
+ flex: ${({ fluid }) => (fluid ? '1' : undefined)};
33
+ position: relative;
34
+ overflow: hidden;
35
+ `;
36
+
37
+ export const StyledTextarea = styled.textarea<IReqoreTextareaStyle>`
38
+ height: 100%;
39
+ width: 100%;
40
+ font-size: ${({ _size }) => TEXT_FROM_SIZE[_size]}px;
41
+ margin: 0;
42
+ padding: 5px 7px;
43
+ resize: none;
44
+
45
+ background-color: ${({ theme, minimal }: IReqoreTextareaStyle) =>
46
+ minimal ? 'transparent' : darken(0.01, theme.main)};
47
+ color: ${({ theme }: IReqoreTextareaStyle) => getReadableColor(theme)};
48
+
49
+ border: ${({ minimal, theme }) =>
50
+ !minimal ? `1px solid ${rgba(getReadableColor(theme), 0.2)}` : 0};
51
+ border-bottom: ${({ minimal, theme }) =>
52
+ minimal ? `0.5px solid ${rgba(getReadableColor(theme), 0.2)}` : undefined};
53
+
54
+ border-radius: ${({ minimal }) => (minimal ? 0 : 3)}px;
55
+ transition: all 0.2s ease-out;
56
+
57
+ &:active,
58
+ &:focus,
59
+ &:hover {
60
+ outline: none;
61
+ border-color: ${({ theme }) => rgba(getReadableColor(theme), 0.3)};
62
+ }
63
+
64
+ &::placeholder {
65
+ transition: all 0.2s ease-out;
66
+ color: ${({ theme }) => rgba(getReadableColor(theme), 0.3)};
67
+ }
68
+
69
+ &:focus {
70
+ &::placeholder {
71
+ color: ${({ theme }) => rgba(getReadableColor(theme), 0.5)};
72
+ }
73
+ }
74
+
75
+ &:disabled {
76
+ pointer-events: none;
77
+ opacity: 0.3;
78
+ }
79
+ `;
80
+
81
+ const ReqoreInput = forwardRef(
82
+ (
83
+ {
84
+ width,
85
+ height,
86
+ scaleWithContent,
87
+ size = 'normal',
88
+ className,
89
+ onClearClick,
90
+ fluid,
91
+ ...rest
92
+ }: IReqoreTextareaProps,
93
+ ref: any
94
+ ) => {
95
+ return (
96
+ <StyledTextareaWrapper
97
+ className={`${className || ''} reqore-control-wrapper`}
98
+ width={width}
99
+ height={height}
100
+ fluid={fluid}
101
+ _size={size}
102
+ >
103
+ <StyledTextarea
104
+ {...rest}
105
+ className={`${className || ''} reqore-control reqore-textarea`}
106
+ _size={size}
107
+ ref={ref}
108
+ rows={scaleWithContent ? (rest?.value?.split(/\r\n|\r|\n/).length || 1) + 1 : rest.rows}
109
+ />
110
+ <ReqoreInputClearButton
111
+ enabled={!rest?.disabled && !!(onClearClick && rest?.onChange)}
112
+ show={rest?.value && rest.value !== ''}
113
+ onClick={onClearClick}
114
+ size='big'
115
+ />
116
+ </StyledTextareaWrapper>
117
+ );
118
+ }
119
+ );
120
+
121
+ export default ReqoreInput;
@@ -0,0 +1,15 @@
1
+ import timeago from 'epoch-timeago';
2
+ import { useState } from 'react';
3
+ import { useInterval } from 'react-use';
4
+ import { getTimeAgoIntervalDelay } from '../../helpers/time';
5
+
6
+ export const TimeAgo = ({ time }: { time: number | string }) => {
7
+ const [_lastUpdate, _setLastUpdate] = useState<number>(Date.now());
8
+ const _time = typeof time === 'number' ? time : Date.parse(time);
9
+
10
+ useInterval(() => {
11
+ _setLastUpdate(Date.now());
12
+ }, getTimeAgoIntervalDelay(_time));
13
+
14
+ return timeago(_time);
15
+ };
@@ -0,0 +1,255 @@
1
+ import { cloneDeep } from 'lodash';
2
+ import size from 'lodash/size';
3
+ import { rgba } from 'polished';
4
+ import { useContext, useState } from 'react';
5
+ import styled, { css } from 'styled-components';
6
+ import { ReqoreTextarea } from '../..';
7
+ import { IReqoreTheme } from '../../constants/theme';
8
+ import ReqoreContext from '../../context/ReqoreContext';
9
+ import { changeLightness } from '../../helpers/colors';
10
+ import { getLineCount, getTypeFromValue } from '../../helpers/utils';
11
+ import ReqoreButton from '../Button';
12
+ import ReqoreControlGroup from '../ControlGroup';
13
+ import ReqoreTag from '../Tag';
14
+
15
+ export interface IReqoreTreeProps {
16
+ data: Object | Array<any>;
17
+ mode?: 'tree' | 'copy';
18
+ expanded?: boolean;
19
+ showTypes?: boolean;
20
+ onItemClick?: (value: any, path?: string[]) => void;
21
+ withLabelCopy?: boolean;
22
+ }
23
+
24
+ const StyledTreeWrapper = styled.div`
25
+ display: flex;
26
+ flex-flow: column;
27
+ `;
28
+
29
+ export interface ITreeStyle {
30
+ interactive?: boolean;
31
+ theme: IReqoreTheme;
32
+ }
33
+
34
+ const StyledLabel = styled.span<ITreeStyle>`
35
+ display: inline-block;
36
+ line-height: 30px;
37
+ padding: 0 10px;
38
+ transition: all 0.2s ease-out;
39
+
40
+ ${({ interactive, theme }: ITreeStyle) =>
41
+ interactive &&
42
+ css`
43
+ cursor: pointer;
44
+
45
+ &:hover {
46
+ background-color: ${rgba(changeLightness(theme.main, 0.3), 0.2)};
47
+ border-radius: 5px;
48
+ }
49
+ `}
50
+ `;
51
+
52
+ export const ReqoreTree = ({
53
+ data,
54
+ mode = 'tree',
55
+ expanded,
56
+ showTypes,
57
+ onItemClick,
58
+ withLabelCopy,
59
+ }: IReqoreTreeProps) => {
60
+ const [_mode, setMode] = useState<'tree' | 'copy'>(mode);
61
+ const [items, setItems] = useState({});
62
+ const [allExpanded, setAllExpanded] = useState(expanded);
63
+ const [_showTypes, setShowTypes] = useState(showTypes);
64
+ const { addNotification } = useContext(ReqoreContext);
65
+
66
+ const handleCopyClick = () => {
67
+ setMode('copy');
68
+ };
69
+
70
+ const handleTypesClick = () => {
71
+ setShowTypes(!_showTypes);
72
+ };
73
+
74
+ const handleTreeClick = () => {
75
+ setMode('tree');
76
+ };
77
+
78
+ const handleExpandClick = () => {
79
+ setItems({});
80
+ setAllExpanded(true);
81
+ };
82
+
83
+ const handleCollapseClick = () => {
84
+ setItems({});
85
+ setAllExpanded(false);
86
+ };
87
+
88
+ const handleItemClick = (key: string, currentState?: boolean) => {
89
+ const newItems = cloneDeep(items);
90
+
91
+ newItems[key] = !currentState;
92
+
93
+ setItems(newItems);
94
+ };
95
+
96
+ const isDeep = () =>
97
+ Object.keys(data).some((key: string): boolean => typeof data[key] === 'object');
98
+
99
+ const renderTree = (data, k?: any, level = 1, path: string[] = []) => {
100
+ return Object.keys(data).map((key, index) => {
101
+ const dataType: string = getTypeFromValue(data[key]);
102
+ const displayKey: string = key;
103
+ const stateKey = k ? `${k}_${key}` : key;
104
+
105
+ let isObject = typeof data[key] === 'object' && data[key] !== null;
106
+ let isExpandable =
107
+ typeof data[key] !== 'object' ||
108
+ items[stateKey] ||
109
+ (allExpanded && items[stateKey] !== false);
110
+
111
+ if (isObject && size(data[key]) === 0) {
112
+ isObject = false;
113
+ isExpandable = false;
114
+ }
115
+
116
+ return (
117
+ <div key={index} style={{ margin: level === 1 ? '15px 0' : `15px` }}>
118
+ <ReqoreControlGroup>
119
+ {isObject ? (
120
+ <ReqoreButton
121
+ className='reqore-tree-toggle'
122
+ icon={isExpandable ? 'ArrowDownSFill' : 'ArrowRightSFill'}
123
+ active={isExpandable}
124
+ intent={isExpandable ? 'info' : undefined}
125
+ onClick={() => handleItemClick(stateKey, isExpandable)}
126
+ >
127
+ {displayKey}
128
+ </ReqoreButton>
129
+ ) : (
130
+ <ReqoreTag label={`${displayKey}: `} />
131
+ )}
132
+ {_showTypes && <ReqoreTag label={dataType} className='reqore-tree-type' />}
133
+ {!isObject && (
134
+ <StyledLabel
135
+ className='reqore-tree-label'
136
+ interactive={!!onItemClick}
137
+ onClick={onItemClick ? () => onItemClick(data[key], [...path, key]) : undefined}
138
+ >
139
+ {JSON.stringify(data[key])}
140
+ </StyledLabel>
141
+ )}
142
+ {withLabelCopy && (
143
+ <ReqoreButton
144
+ className='reqore-tree-copy'
145
+ icon='FileCopy2Fill'
146
+ onClick={() => {
147
+ navigator.clipboard.writeText(JSON.stringify(data[key]));
148
+ addNotification({
149
+ content: 'Successfuly copied to clipboard',
150
+ id: Date.now().toString(),
151
+ type: 'success',
152
+ duration: 3000,
153
+ });
154
+ }}
155
+ minimal
156
+ />
157
+ )}
158
+ </ReqoreControlGroup>
159
+ {isExpandable && isObject
160
+ ? renderTree(data[key], stateKey, level + 1, [...path, key])
161
+ : null}
162
+ </div>
163
+ );
164
+ });
165
+ };
166
+
167
+ const renderText = (data, tabs = '') => {
168
+ let text = '';
169
+
170
+ Object.keys(data).forEach((key) => {
171
+ if (typeof data[key] !== 'object' || !data[key]) {
172
+ text += `${tabs}${key}: ${data[key]}\r\n`;
173
+ } else {
174
+ text += `${tabs}${key}:\r\n`;
175
+ text += renderText(data[key], `${tabs}\t`);
176
+ }
177
+ });
178
+
179
+ return text;
180
+ };
181
+
182
+ if (!data || !Object.keys(data).length) {
183
+ return <p>No data</p>;
184
+ }
185
+
186
+ const textData: string = renderText(data);
187
+ const lineCount: number = getLineCount(textData);
188
+
189
+ return (
190
+ <StyledTreeWrapper className='reqore-tree'>
191
+ <ReqoreControlGroup stack>
192
+ {isDeep() && (
193
+ <>
194
+ {!allExpanded && (
195
+ <ReqoreButton
196
+ className='reqore-tree-expand-all'
197
+ icon='ArrowDownFill'
198
+ onClick={handleExpandClick}
199
+ key='expand-button'
200
+ >
201
+ Expand all
202
+ </ReqoreButton>
203
+ )}
204
+ {allExpanded || size(items) > 0 ? (
205
+ <ReqoreButton
206
+ className='reqore-tree-collapse-all'
207
+ icon='ArrowUpFill'
208
+ onClick={handleCollapseClick}
209
+ key='collapse-button'
210
+ >
211
+ {' '}
212
+ Collapse all{' '}
213
+ </ReqoreButton>
214
+ ) : null}
215
+ </>
216
+ )}
217
+ <ReqoreButton
218
+ className='reqore-tree-show-types'
219
+ icon='CodeBoxFill'
220
+ active={_showTypes}
221
+ onClick={handleTypesClick}
222
+ >
223
+ Show types
224
+ </ReqoreButton>
225
+ <ReqoreButton
226
+ className='reqore-tree-as-tree'
227
+ active={_mode === 'tree'}
228
+ onClick={handleTreeClick}
229
+ icon='Menu2Fill'
230
+ >
231
+ Tree View
232
+ </ReqoreButton>
233
+ <ReqoreButton
234
+ className='reqore-tree-as-text'
235
+ onClick={handleCopyClick}
236
+ active={_mode === 'copy'}
237
+ icon='ClipboardFill'
238
+ >
239
+ Text View
240
+ </ReqoreButton>
241
+ </ReqoreControlGroup>
242
+
243
+ {_mode === 'tree' && <div>{renderTree(data, true)}</div>}
244
+
245
+ {_mode === 'copy' && (
246
+ <ReqoreTextarea
247
+ className='reqore-tree-textarea'
248
+ id='tree-content'
249
+ defaultValue={textData}
250
+ rows={lineCount > 20 ? 20 : lineCount}
251
+ />
252
+ )}
253
+ </StyledTreeWrapper>
254
+ );
255
+ };
@@ -0,0 +1,4 @@
1
+ export const SPRING_CONFIG = {
2
+ tension: 120,
3
+ friction: 20,
4
+ };
@@ -0,0 +1,9 @@
1
+ export const Colors = {
2
+ DARK: '#222222',
3
+ LIGHT: '#ffffff',
4
+ BLUE: '#0E5A8A',
5
+ GREEN: '#0A6640',
6
+ YELLOW: '#d1a036',
7
+ ORANGE: '#A66321',
8
+ RED: '#A82A2A',
9
+ };
@@ -0,0 +1,66 @@
1
+ export type TSizes = 'tiny' | 'small' | 'normal' | 'big' | 'huge';
2
+ export type TWeights = 'soft' | 'normal' | 'heavy';
3
+
4
+ export const SIZE_TO_PX = {
5
+ tiny: 10,
6
+ small: 20,
7
+ normal: 30,
8
+ big: 40,
9
+ huge: 50,
10
+ };
11
+
12
+ export const TABS_SIZE_TO_PX = {
13
+ tiny: 20,
14
+ small: 30,
15
+ normal: 40,
16
+ big: 50,
17
+ huge: 60,
18
+ };
19
+
20
+ export const TABLE_SIZE_TO_PX = {
21
+ tiny: 20,
22
+ small: 30,
23
+ normal: 40,
24
+ big: 50,
25
+ huge: 60,
26
+ };
27
+
28
+ export const TABS_PADDING_TO_PX = {
29
+ tiny: 5,
30
+ small: 5,
31
+ normal: 5,
32
+ big: 5,
33
+ huge: 5,
34
+ };
35
+
36
+ export const MARGIN_FROM_SIZE = {
37
+ tiny: 0,
38
+ small: 0,
39
+ normal: 10,
40
+ big: 20,
41
+ huge: 30,
42
+ };
43
+
44
+ export const TEXT_FROM_SIZE = {
45
+ tiny: 9,
46
+ small: 12,
47
+ normal: 15,
48
+ big: 18,
49
+ huge: 21,
50
+ };
51
+
52
+ export const PADDING_FROM_SIZE = {
53
+ tiny: 2,
54
+ small: 5,
55
+ normal: 8,
56
+ big: 11,
57
+ huge: 14,
58
+ };
59
+
60
+ export const RADIUS_FROM_SIZE = {
61
+ tiny: 1,
62
+ small: 3,
63
+ normal: 5,
64
+ big: 7,
65
+ huge: 9,
66
+ };