@fibery/ui-kit 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (373) hide show
  1. package/index.ts +2 -0
  2. package/package.json +100 -0
  3. package/src/Button.d.ts +24 -0
  4. package/src/Button.js +361 -0
  5. package/src/FormFieldLoader.js +30 -0
  6. package/src/Item.tsx +127 -0
  7. package/src/Loaders.d.ts +16 -0
  8. package/src/Loaders.js +144 -0
  9. package/src/Select/components.js +64 -0
  10. package/src/Select/index.d.ts +11 -0
  11. package/src/Select/index.js +140 -0
  12. package/src/Select/lazy.js +35 -0
  13. package/src/Select/select-loader.tsx +8 -0
  14. package/src/Select/styles.js +133 -0
  15. package/src/ThemeProvider.tsx +14 -0
  16. package/src/create-inline-theme.ts +55 -0
  17. package/src/designSystem.ts +877 -0
  18. package/src/icons/Icon.tsx +56 -0
  19. package/src/icons/IconAsBackground.tsx +15 -0
  20. package/src/icons/IconAsPaths.ts +50 -0
  21. package/src/icons/ast/Activity.ts +8 -0
  22. package/src/icons/ast/ActivityLog.ts +8 -0
  23. package/src/icons/ast/Add.ts +8 -0
  24. package/src/icons/ast/AddCompact.ts +8 -0
  25. package/src/icons/ast/AddReactions.ts +8 -0
  26. package/src/icons/ast/AntdFilledCheckCircle.ts +8 -0
  27. package/src/icons/ast/AntdFilledCloseCircle.ts +8 -0
  28. package/src/icons/ast/AntdFilledExclamationCircle.ts +8 -0
  29. package/src/icons/ast/AntdFilledInfoCircle.ts +8 -0
  30. package/src/icons/ast/App.ts +8 -0
  31. package/src/icons/ast/AppDetails.ts +8 -0
  32. package/src/icons/ast/AppStore.ts +8 -0
  33. package/src/icons/ast/AppStoreOneColor.ts +8 -0
  34. package/src/icons/ast/AppTemplates.ts +8 -0
  35. package/src/icons/ast/AppTemplatesOneColor.ts +8 -0
  36. package/src/icons/ast/AppWebhooks.ts +8 -0
  37. package/src/icons/ast/AppWiki.ts +8 -0
  38. package/src/icons/ast/ArrowBottom.ts +8 -0
  39. package/src/icons/ast/ArrowCollapse.ts +8 -0
  40. package/src/icons/ast/ArrowCollapseVertical.ts +8 -0
  41. package/src/icons/ast/ArrowLeft.ts +8 -0
  42. package/src/icons/ast/ArrowRight.ts +8 -0
  43. package/src/icons/ast/ArrowTop.ts +8 -0
  44. package/src/icons/ast/AskForInput.ts +8 -0
  45. package/src/icons/ast/Back.ts +8 -0
  46. package/src/icons/ast/BacklogIcon.ts +8 -0
  47. package/src/icons/ast/BatchActionsIcon.ts +8 -0
  48. package/src/icons/ast/Cards.ts +8 -0
  49. package/src/icons/ast/Checked.ts +8 -0
  50. package/src/icons/ast/ClearValue.ts +8 -0
  51. package/src/icons/ast/Close.ts +8 -0
  52. package/src/icons/ast/ColorCoding.ts +8 -0
  53. package/src/icons/ast/Columns.ts +8 -0
  54. package/src/icons/ast/CopyUrl.ts +8 -0
  55. package/src/icons/ast/Database.ts +8 -0
  56. package/src/icons/ast/Delete.ts +8 -0
  57. package/src/icons/ast/Demo.ts +8 -0
  58. package/src/icons/ast/DoubleArrowLeft.ts +8 -0
  59. package/src/icons/ast/DoubleArrowRight.ts +8 -0
  60. package/src/icons/ast/DragBlockHandle.ts +8 -0
  61. package/src/icons/ast/DragHandle.ts +8 -0
  62. package/src/icons/ast/ExtensionAssignments.ts +8 -0
  63. package/src/icons/ast/ExtensionAvatar.ts +8 -0
  64. package/src/icons/ast/ExtensionComments.ts +8 -0
  65. package/src/icons/ast/ExtensionFiles.ts +8 -0
  66. package/src/icons/ast/ExtensionReferences.ts +8 -0
  67. package/src/icons/ast/ExtensionWorkflow.ts +8 -0
  68. package/src/icons/ast/Favorites.ts +8 -0
  69. package/src/icons/ast/FavoritesChecked.ts +8 -0
  70. package/src/icons/ast/FavoritesMenu.ts +8 -0
  71. package/src/icons/ast/Fields.ts +8 -0
  72. package/src/icons/ast/Filter.ts +8 -0
  73. package/src/icons/ast/FocusMode.ts +8 -0
  74. package/src/icons/ast/FocusModeOff.ts +8 -0
  75. package/src/icons/ast/Globe.ts +8 -0
  76. package/src/icons/ast/Hide.ts +8 -0
  77. package/src/icons/ast/Hint.ts +8 -0
  78. package/src/icons/ast/Home.ts +8 -0
  79. package/src/icons/ast/Integration.ts +8 -0
  80. package/src/icons/ast/InvitePeople.ts +8 -0
  81. package/src/icons/ast/Items.ts +8 -0
  82. package/src/icons/ast/LeftPanel.ts +8 -0
  83. package/src/icons/ast/Levels.ts +8 -0
  84. package/src/icons/ast/Lock.ts +8 -0
  85. package/src/icons/ast/MenuCollapser.ts +8 -0
  86. package/src/icons/ast/Milestones.ts +8 -0
  87. package/src/icons/ast/More.ts +8 -0
  88. package/src/icons/ast/MoreCompact.ts +8 -0
  89. package/src/icons/ast/MySpace.ts +8 -0
  90. package/src/icons/ast/Notifications.ts +8 -0
  91. package/src/icons/ast/ObjChild.ts +8 -0
  92. package/src/icons/ast/ObjM2M.ts +8 -0
  93. package/src/icons/ast/ObjO2O.ts +8 -0
  94. package/src/icons/ast/ObjParent.ts +8 -0
  95. package/src/icons/ast/ObjSelf.ts +8 -0
  96. package/src/icons/ast/OnSchedule.ts +8 -0
  97. package/src/icons/ast/OpenAsPage.ts +8 -0
  98. package/src/icons/ast/PageRegularMode.ts +8 -0
  99. package/src/icons/ast/PageWideMode.ts +8 -0
  100. package/src/icons/ast/Photo.ts +8 -0
  101. package/src/icons/ast/Popup.ts +8 -0
  102. package/src/icons/ast/Posts.ts +8 -0
  103. package/src/icons/ast/Remove.ts +8 -0
  104. package/src/icons/ast/Reply.ts +8 -0
  105. package/src/icons/ast/Restore.ts +8 -0
  106. package/src/icons/ast/RicheditorActionsMore.ts +8 -0
  107. package/src/icons/ast/RicheditorBlockCode.ts +8 -0
  108. package/src/icons/ast/RicheditorBlockEntity.ts +8 -0
  109. package/src/icons/ast/RicheditorBlockH1.ts +8 -0
  110. package/src/icons/ast/RicheditorBlockH2.ts +8 -0
  111. package/src/icons/ast/RicheditorBlockH3.ts +8 -0
  112. package/src/icons/ast/RicheditorBlockH4.ts +8 -0
  113. package/src/icons/ast/RicheditorBlockMention.ts +8 -0
  114. package/src/icons/ast/RicheditorBlockParagraph.ts +8 -0
  115. package/src/icons/ast/RicheditorBlockQuote.ts +8 -0
  116. package/src/icons/ast/RicheditorChecklistCreate.ts +8 -0
  117. package/src/icons/ast/RicheditorCommentCreate.ts +8 -0
  118. package/src/icons/ast/RicheditorEntityLinkCreate.ts +8 -0
  119. package/src/icons/ast/RicheditorHistoryRedo.ts +8 -0
  120. package/src/icons/ast/RicheditorHistoryUndo.ts +8 -0
  121. package/src/icons/ast/RicheditorImageAlignCenter.ts +8 -0
  122. package/src/icons/ast/RicheditorImageAlignLeft.ts +8 -0
  123. package/src/icons/ast/RicheditorImageAlignRight.ts +8 -0
  124. package/src/icons/ast/RicheditorImageUpload.ts +8 -0
  125. package/src/icons/ast/RicheditorImageWrapCenter.ts +8 -0
  126. package/src/icons/ast/RicheditorImageWrapLeft.ts +8 -0
  127. package/src/icons/ast/RicheditorImageWrapRight.ts +8 -0
  128. package/src/icons/ast/RicheditorImageZoom.ts +8 -0
  129. package/src/icons/ast/RicheditorLinkCreate.ts +8 -0
  130. package/src/icons/ast/RicheditorLinkedhighlightCreate.ts +8 -0
  131. package/src/icons/ast/RicheditorListBullet.ts +8 -0
  132. package/src/icons/ast/RicheditorListIndent.ts +8 -0
  133. package/src/icons/ast/RicheditorListOrdered.ts +8 -0
  134. package/src/icons/ast/RicheditorListUnindent.ts +8 -0
  135. package/src/icons/ast/RicheditorMarkCode.ts +8 -0
  136. package/src/icons/ast/RicheditorMarkEm.ts +8 -0
  137. package/src/icons/ast/RicheditorMarkHighlight.ts +8 -0
  138. package/src/icons/ast/RicheditorMarkStrike.ts +8 -0
  139. package/src/icons/ast/RicheditorMarkStrong.ts +8 -0
  140. package/src/icons/ast/RicheditorMarkUnderline.ts +8 -0
  141. package/src/icons/ast/RicheditorOpenLink.ts +8 -0
  142. package/src/icons/ast/RicheditorTableCreate.ts +8 -0
  143. package/src/icons/ast/RicheditorUnlink.ts +8 -0
  144. package/src/icons/ast/RicheditorVideoUpload.ts +8 -0
  145. package/src/icons/ast/RightPanel.ts +8 -0
  146. package/src/icons/ast/Rows.ts +8 -0
  147. package/src/icons/ast/Search.ts +8 -0
  148. package/src/icons/ast/SelfReferenceOff.ts +8 -0
  149. package/src/icons/ast/SelfReferenceOn.ts +8 -0
  150. package/src/icons/ast/Settings.ts +8 -0
  151. package/src/icons/ast/Share.ts +8 -0
  152. package/src/icons/ast/Shared.ts +8 -0
  153. package/src/icons/ast/Sidebar.ts +8 -0
  154. package/src/icons/ast/Slack.ts +8 -0
  155. package/src/icons/ast/SmartFolder.ts +8 -0
  156. package/src/icons/ast/Sort.ts +8 -0
  157. package/src/icons/ast/SortOnBottom.ts +8 -0
  158. package/src/icons/ast/SortOnTop.ts +8 -0
  159. package/src/icons/ast/Spinner.ts +8 -0
  160. package/src/icons/ast/TypeBoolean.ts +8 -0
  161. package/src/icons/ast/TypeButton.ts +8 -0
  162. package/src/icons/ast/TypeCheckbox.ts +8 -0
  163. package/src/icons/ast/TypeDate.ts +8 -0
  164. package/src/icons/ast/TypeEmail.ts +8 -0
  165. package/src/icons/ast/TypeEmoji.ts +8 -0
  166. package/src/icons/ast/TypeFormula.ts +8 -0
  167. package/src/icons/ast/TypeFunction.ts +8 -0
  168. package/src/icons/ast/TypeLookup.ts +8 -0
  169. package/src/icons/ast/TypeMoney.ts +8 -0
  170. package/src/icons/ast/TypeMultiSelect.ts +8 -0
  171. package/src/icons/ast/TypeNumber.ts +8 -0
  172. package/src/icons/ast/TypePercent.ts +8 -0
  173. package/src/icons/ast/TypePhone.ts +8 -0
  174. package/src/icons/ast/TypeRelation.ts +8 -0
  175. package/src/icons/ast/TypeRichText.ts +8 -0
  176. package/src/icons/ast/TypeRule.ts +8 -0
  177. package/src/icons/ast/TypeSingleSelect.ts +8 -0
  178. package/src/icons/ast/TypeText.ts +8 -0
  179. package/src/icons/ast/TypeUrl.ts +8 -0
  180. package/src/icons/ast/Upgrade.ts +8 -0
  181. package/src/icons/ast/ViewBoard.ts +8 -0
  182. package/src/icons/ast/ViewCalendar.ts +8 -0
  183. package/src/icons/ast/ViewCanvas.ts +8 -0
  184. package/src/icons/ast/ViewChart.ts +8 -0
  185. package/src/icons/ast/ViewDetails.ts +8 -0
  186. package/src/icons/ast/ViewDocument.ts +8 -0
  187. package/src/icons/ast/ViewFeed.ts +8 -0
  188. package/src/icons/ast/ViewList.ts +8 -0
  189. package/src/icons/ast/ViewPage.ts +8 -0
  190. package/src/icons/ast/ViewTable.ts +8 -0
  191. package/src/icons/ast/ViewTimeline.ts +8 -0
  192. package/src/icons/ast/Views.ts +8 -0
  193. package/src/icons/ast/Warning.ts +8 -0
  194. package/src/icons/ast/index.tsx +174 -0
  195. package/src/icons/generateIconFromAst.ts +29 -0
  196. package/src/icons/getIconContainerStyle.tsx +13 -0
  197. package/src/icons/getShiftStyle.ts +21 -0
  198. package/src/icons/react/Activity.tsx +12 -0
  199. package/src/icons/react/ActivityLog.tsx +12 -0
  200. package/src/icons/react/Add.tsx +12 -0
  201. package/src/icons/react/AddCompact.tsx +12 -0
  202. package/src/icons/react/AddReactions.tsx +12 -0
  203. package/src/icons/react/AntdFilledCheckCircle.tsx +12 -0
  204. package/src/icons/react/AntdFilledCloseCircle.tsx +12 -0
  205. package/src/icons/react/AntdFilledExclamationCircle.tsx +12 -0
  206. package/src/icons/react/AntdFilledInfoCircle.tsx +12 -0
  207. package/src/icons/react/App.tsx +12 -0
  208. package/src/icons/react/AppDetails.tsx +12 -0
  209. package/src/icons/react/AppStore.tsx +12 -0
  210. package/src/icons/react/AppStoreOneColor.tsx +12 -0
  211. package/src/icons/react/AppTemplates.tsx +12 -0
  212. package/src/icons/react/AppTemplatesOneColor.tsx +12 -0
  213. package/src/icons/react/AppWebhooks.tsx +12 -0
  214. package/src/icons/react/AppWiki.tsx +12 -0
  215. package/src/icons/react/ArrowBottom.tsx +12 -0
  216. package/src/icons/react/ArrowCollapse.tsx +12 -0
  217. package/src/icons/react/ArrowCollapseVertical.tsx +12 -0
  218. package/src/icons/react/ArrowLeft.tsx +12 -0
  219. package/src/icons/react/ArrowRight.tsx +12 -0
  220. package/src/icons/react/ArrowTop.tsx +12 -0
  221. package/src/icons/react/AskForInput.tsx +12 -0
  222. package/src/icons/react/Back.tsx +12 -0
  223. package/src/icons/react/BacklogIcon.tsx +12 -0
  224. package/src/icons/react/BatchActionsIcon.tsx +12 -0
  225. package/src/icons/react/Cards.tsx +12 -0
  226. package/src/icons/react/Checked.tsx +12 -0
  227. package/src/icons/react/ClearValue.tsx +12 -0
  228. package/src/icons/react/Close.tsx +12 -0
  229. package/src/icons/react/ColorCoding.tsx +12 -0
  230. package/src/icons/react/Columns.tsx +12 -0
  231. package/src/icons/react/CopyUrl.tsx +12 -0
  232. package/src/icons/react/Database.tsx +12 -0
  233. package/src/icons/react/Delete.tsx +12 -0
  234. package/src/icons/react/Demo.tsx +12 -0
  235. package/src/icons/react/DoubleArrowLeft.tsx +12 -0
  236. package/src/icons/react/DoubleArrowRight.tsx +12 -0
  237. package/src/icons/react/DragBlockHandle.tsx +12 -0
  238. package/src/icons/react/DragHandle.tsx +12 -0
  239. package/src/icons/react/ExtensionAssignments.tsx +12 -0
  240. package/src/icons/react/ExtensionAvatar.tsx +12 -0
  241. package/src/icons/react/ExtensionComments.tsx +12 -0
  242. package/src/icons/react/ExtensionFiles.tsx +12 -0
  243. package/src/icons/react/ExtensionReferences.tsx +12 -0
  244. package/src/icons/react/ExtensionWorkflow.tsx +12 -0
  245. package/src/icons/react/Favorites.tsx +12 -0
  246. package/src/icons/react/FavoritesChecked.tsx +12 -0
  247. package/src/icons/react/FavoritesMenu.tsx +12 -0
  248. package/src/icons/react/Fields.tsx +12 -0
  249. package/src/icons/react/Filter.tsx +12 -0
  250. package/src/icons/react/FocusMode.tsx +12 -0
  251. package/src/icons/react/FocusModeOff.tsx +12 -0
  252. package/src/icons/react/Globe.tsx +12 -0
  253. package/src/icons/react/Hide.tsx +12 -0
  254. package/src/icons/react/Hint.tsx +12 -0
  255. package/src/icons/react/Home.tsx +12 -0
  256. package/src/icons/react/Integration.tsx +12 -0
  257. package/src/icons/react/InvitePeople.tsx +12 -0
  258. package/src/icons/react/Items.tsx +12 -0
  259. package/src/icons/react/LeftPanel.tsx +12 -0
  260. package/src/icons/react/Levels.tsx +12 -0
  261. package/src/icons/react/Lock.tsx +12 -0
  262. package/src/icons/react/MenuCollapser.tsx +12 -0
  263. package/src/icons/react/Milestones.tsx +12 -0
  264. package/src/icons/react/More.tsx +12 -0
  265. package/src/icons/react/MoreCompact.tsx +12 -0
  266. package/src/icons/react/MySpace.tsx +12 -0
  267. package/src/icons/react/Notifications.tsx +12 -0
  268. package/src/icons/react/ObjChild.tsx +12 -0
  269. package/src/icons/react/ObjM2M.tsx +12 -0
  270. package/src/icons/react/ObjO2O.tsx +12 -0
  271. package/src/icons/react/ObjParent.tsx +12 -0
  272. package/src/icons/react/ObjSelf.tsx +12 -0
  273. package/src/icons/react/OnSchedule.tsx +12 -0
  274. package/src/icons/react/OpenAsPage.tsx +12 -0
  275. package/src/icons/react/PageRegularMode.tsx +12 -0
  276. package/src/icons/react/PageWideMode.tsx +12 -0
  277. package/src/icons/react/Photo.tsx +12 -0
  278. package/src/icons/react/Popup.tsx +12 -0
  279. package/src/icons/react/Posts.tsx +12 -0
  280. package/src/icons/react/Remove.tsx +12 -0
  281. package/src/icons/react/Reply.tsx +12 -0
  282. package/src/icons/react/Restore.tsx +12 -0
  283. package/src/icons/react/RicheditorActionsMore.tsx +12 -0
  284. package/src/icons/react/RicheditorBlockCode.tsx +12 -0
  285. package/src/icons/react/RicheditorBlockEntity.tsx +12 -0
  286. package/src/icons/react/RicheditorBlockH1.tsx +12 -0
  287. package/src/icons/react/RicheditorBlockH2.tsx +12 -0
  288. package/src/icons/react/RicheditorBlockH3.tsx +12 -0
  289. package/src/icons/react/RicheditorBlockH4.tsx +12 -0
  290. package/src/icons/react/RicheditorBlockMention.tsx +12 -0
  291. package/src/icons/react/RicheditorBlockParagraph.tsx +12 -0
  292. package/src/icons/react/RicheditorBlockQuote.tsx +12 -0
  293. package/src/icons/react/RicheditorChecklistCreate.tsx +12 -0
  294. package/src/icons/react/RicheditorCommentCreate.tsx +12 -0
  295. package/src/icons/react/RicheditorEntityLinkCreate.tsx +12 -0
  296. package/src/icons/react/RicheditorHistoryRedo.tsx +12 -0
  297. package/src/icons/react/RicheditorHistoryUndo.tsx +12 -0
  298. package/src/icons/react/RicheditorImageAlignCenter.tsx +12 -0
  299. package/src/icons/react/RicheditorImageAlignLeft.tsx +12 -0
  300. package/src/icons/react/RicheditorImageAlignRight.tsx +12 -0
  301. package/src/icons/react/RicheditorImageUpload.tsx +12 -0
  302. package/src/icons/react/RicheditorImageWrapCenter.tsx +12 -0
  303. package/src/icons/react/RicheditorImageWrapLeft.tsx +12 -0
  304. package/src/icons/react/RicheditorImageWrapRight.tsx +12 -0
  305. package/src/icons/react/RicheditorImageZoom.tsx +12 -0
  306. package/src/icons/react/RicheditorLinkCreate.tsx +12 -0
  307. package/src/icons/react/RicheditorLinkedhighlightCreate.tsx +12 -0
  308. package/src/icons/react/RicheditorListBullet.tsx +12 -0
  309. package/src/icons/react/RicheditorListIndent.tsx +12 -0
  310. package/src/icons/react/RicheditorListOrdered.tsx +12 -0
  311. package/src/icons/react/RicheditorListUnindent.tsx +12 -0
  312. package/src/icons/react/RicheditorMarkCode.tsx +12 -0
  313. package/src/icons/react/RicheditorMarkEm.tsx +12 -0
  314. package/src/icons/react/RicheditorMarkHighlight.tsx +12 -0
  315. package/src/icons/react/RicheditorMarkStrike.tsx +12 -0
  316. package/src/icons/react/RicheditorMarkStrong.tsx +12 -0
  317. package/src/icons/react/RicheditorMarkUnderline.tsx +12 -0
  318. package/src/icons/react/RicheditorOpenLink.tsx +12 -0
  319. package/src/icons/react/RicheditorTableCreate.tsx +12 -0
  320. package/src/icons/react/RicheditorUnlink.tsx +12 -0
  321. package/src/icons/react/RicheditorVideoUpload.tsx +12 -0
  322. package/src/icons/react/RightPanel.tsx +12 -0
  323. package/src/icons/react/Rows.tsx +12 -0
  324. package/src/icons/react/Search.tsx +12 -0
  325. package/src/icons/react/SelfReferenceOff.tsx +12 -0
  326. package/src/icons/react/SelfReferenceOn.tsx +12 -0
  327. package/src/icons/react/Settings.tsx +12 -0
  328. package/src/icons/react/Share.tsx +12 -0
  329. package/src/icons/react/Shared.tsx +12 -0
  330. package/src/icons/react/Sidebar.tsx +12 -0
  331. package/src/icons/react/Slack.tsx +12 -0
  332. package/src/icons/react/SmartFolder.tsx +12 -0
  333. package/src/icons/react/Sort.tsx +12 -0
  334. package/src/icons/react/SortOnBottom.tsx +12 -0
  335. package/src/icons/react/SortOnTop.tsx +12 -0
  336. package/src/icons/react/Spinner.tsx +12 -0
  337. package/src/icons/react/TypeBoolean.tsx +12 -0
  338. package/src/icons/react/TypeButton.tsx +12 -0
  339. package/src/icons/react/TypeCheckbox.tsx +12 -0
  340. package/src/icons/react/TypeDate.tsx +12 -0
  341. package/src/icons/react/TypeEmail.tsx +12 -0
  342. package/src/icons/react/TypeEmoji.tsx +12 -0
  343. package/src/icons/react/TypeFormula.tsx +12 -0
  344. package/src/icons/react/TypeFunction.tsx +12 -0
  345. package/src/icons/react/TypeLookup.tsx +12 -0
  346. package/src/icons/react/TypeMoney.tsx +12 -0
  347. package/src/icons/react/TypeMultiSelect.tsx +12 -0
  348. package/src/icons/react/TypeNumber.tsx +12 -0
  349. package/src/icons/react/TypePercent.tsx +12 -0
  350. package/src/icons/react/TypePhone.tsx +12 -0
  351. package/src/icons/react/TypeRelation.tsx +12 -0
  352. package/src/icons/react/TypeRichText.tsx +12 -0
  353. package/src/icons/react/TypeRule.tsx +12 -0
  354. package/src/icons/react/TypeSingleSelect.tsx +12 -0
  355. package/src/icons/react/TypeText.tsx +12 -0
  356. package/src/icons/react/TypeUrl.tsx +12 -0
  357. package/src/icons/react/Upgrade.tsx +12 -0
  358. package/src/icons/react/ViewBoard.tsx +12 -0
  359. package/src/icons/react/ViewCalendar.tsx +12 -0
  360. package/src/icons/react/ViewCanvas.tsx +12 -0
  361. package/src/icons/react/ViewChart.tsx +12 -0
  362. package/src/icons/react/ViewDetails.tsx +12 -0
  363. package/src/icons/react/ViewDocument.tsx +12 -0
  364. package/src/icons/react/ViewFeed.tsx +12 -0
  365. package/src/icons/react/ViewList.tsx +12 -0
  366. package/src/icons/react/ViewPage.tsx +12 -0
  367. package/src/icons/react/ViewTable.tsx +12 -0
  368. package/src/icons/react/ViewTimeline.tsx +12 -0
  369. package/src/icons/react/Views.tsx +12 -0
  370. package/src/icons/react/Warning.tsx +12 -0
  371. package/src/icons/react/index.tsx +174 -0
  372. package/src/icons/types.ts +29 -0
  373. package/src/loading-sausage.tsx +171 -0
@@ -0,0 +1,877 @@
1
+ /* eslint-disable max-lines */
2
+ import chroma from "chroma-js";
3
+ import ColorHash from "color-hash";
4
+ import {blackA, indigo, indigoDark, red, redDark, sage, slate, slateDark, whiteA, yellow, yellowDark} from "./Pallete";
5
+ import _ from "lodash";
6
+ import {createInlineTheme as createInlineStyles} from "./create-inline-theme";
7
+
8
+ export const typeSizes = [28, 24, 18, 16, 14, 12, 10, 8] as const;
9
+
10
+ export const fontWeight = {
11
+ regular: 400,
12
+ bold: 500,
13
+ bolder: 600,
14
+ } as const;
15
+
16
+ const transparent = "rgba(255, 255, 255, 0)";
17
+
18
+ export const opacity = {
19
+ opaque: 1,
20
+ overlay: 0.9,
21
+ tiny: 0.8,
22
+ tiniest: 0.7,
23
+ half: 0.5,
24
+ regular: 0.4,
25
+ light: 0.25,
26
+ notSoThin: 0.14,
27
+ thin: 0.1,
28
+ thinner: 0.07,
29
+ hairline: 0.04,
30
+ transparent: 0,
31
+ opacity100: 1,
32
+ opacity95: 0.95,
33
+ opacity90: 0.9,
34
+ opacity85: 0.85,
35
+ opacity80: 0.8,
36
+ opacity75: 0.75,
37
+ opacity70: 0.7,
38
+ opacity65: 0.65,
39
+ opacity60: 0.6,
40
+ opacity55: 0.55,
41
+ opacity50: 0.5,
42
+ opacity45: 0.45,
43
+ opacity40: 0.4,
44
+ opacity35: 0.35,
45
+ opacity30: 0.3,
46
+ opacity25: 0.25,
47
+ opacity20: 0.2,
48
+ opacity15: 0.15,
49
+ opacity10: 0.1,
50
+ opacity5: 0.05,
51
+ opacity0: 0,
52
+ } as const;
53
+
54
+ // switch to chroma.valid once we start using 2.0.1
55
+ const makeChromaColor = (color: string) => {
56
+ try {
57
+ return chroma(color);
58
+ } catch (e) {
59
+ return chroma(brandColors.green);
60
+ }
61
+ };
62
+
63
+ export const getOpacities = _.memoize((color: string) =>
64
+ _.mapValues(opacity, (opacity) => {
65
+ if (color === transparent) {
66
+ return transparent;
67
+ }
68
+ return makeChromaColor(color).alpha(opacity).css();
69
+ })
70
+ );
71
+
72
+ const shades = getOpacities("#000000");
73
+ const lights = getOpacities("#FFFFFF");
74
+
75
+ export const separators = {
76
+ ..._.mapValues(shades, (shade) => `1px solid ${shade}`),
77
+ } as const;
78
+
79
+ export const inversedSeparators = {
80
+ ..._.mapValues(lights, (light) => `1px solid ${light}`),
81
+ } as const;
82
+
83
+ export const fontFamily =
84
+ "-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif";
85
+
86
+ const stateColors = {
87
+ success: "rgba(8, 189, 159, 1)",
88
+ error: "rgba(234, 105, 63, 1)",
89
+ progress: "rgba(74, 126, 244, 1)",
90
+ canceled: "rgba(233, 163, 76, 1)",
91
+ unknown: "rgba(147, 157, 168, 1)",
92
+ };
93
+
94
+ const brandColors = {
95
+ red: "#FF5400",
96
+ green: "#08BD9F",
97
+ blue: "#4568FB",
98
+ } as const;
99
+
100
+ export const getDarkenColor = (color: string): string => {
101
+ return makeChromaColor(color).darken(0.4).css();
102
+ };
103
+
104
+ const lightColors = {
105
+ mode: "light",
106
+ brandColors,
107
+ stateColors,
108
+ //light theme
109
+ whiteColor: whiteA.whiteA0,
110
+ blackColor: blackA.blackA0,
111
+ mainBg: sage.sage3,
112
+ panelBg: whiteA.whiteA0,
113
+ panelContentBg: sage.sage2,
114
+ pageBg: whiteA.whiteA0,
115
+ pageContentBg: whiteA.whiteA0,
116
+ sidebarBg: whiteA.whiteA0,
117
+ sidebarShadow: `-3px 0px 10px 0px ${getOpacities(sage.sage2).opacity80}`,
118
+ menuBg: sage.sage3,
119
+ menuFooterColor: getOpacities(whiteA.whiteA0).opacity20,
120
+ menuFooterHoverColor: getOpacities(whiteA.whiteA0).opacity40,
121
+ textColor: slateDark.slate3,
122
+ accentTextColor: slate.slate10,
123
+ disabledTextColor: slate.slate9,
124
+ inversedTextColor: slateDark.slate3,
125
+ linkColor: indigoDark.indigo10,
126
+ linkBorder: `1px solid ${getOpacities(indigoDark.indigo10).opacity20}`,
127
+ linkHoverColor: indigo.indigo10,
128
+ linkBorderHover: `1px solid ${getOpacities(indigo.indigo10).opacity80}`,
129
+ entityNodeColor: slateDark.slate3,
130
+ entityNodeBorder: `1px solid ${getOpacities(slateDark.slate3).opacity30}`,
131
+ entityNodeHoverColor: slateDark.slate7,
132
+ entityNodeBorderHover: `1px solid ${getOpacities(slate.slate11).opacity80}`,
133
+ entityNodeBgColor: getOpacities(slate.slate3).opacity80,
134
+ shortcutTextColor: slate.slate9,
135
+ shortcutBorderColor: `1px solid ${getOpacities(slate.slate8).opacity20}`,
136
+ inputBgColor: whiteA.whiteA0,
137
+ inputDisabledBgColor: slate.slate2,
138
+ inputCopyBgColor: slate.slate3,
139
+ inputBorderColor: `0 0 0 1px ${getOpacities(slate.slate6).opacity70}`,
140
+ inputBorderHoverColor: `0 0 0 1px ${getOpacities(slate.slate6).opacity100}`,
141
+ inputPlaceholderTextColor: slate.slate10,
142
+ buttonColor: slate.slate10,
143
+ menuTextColor: slate.slate12,
144
+ selectedMenuTextColor: slate.slate2,
145
+ actionMenuBg: whiteA.whiteA0,
146
+ actionMenuInnerBg: whiteA.whiteA0,
147
+ actionMenuShadow: `0 0 0 1px ${getOpacities(slate.slate10).opacity10}, 0 12px 16px -4px ${
148
+ getOpacities(slate.slate10).opacity30
149
+ }`,
150
+ actionMenuHover: slate.slate3,
151
+ actionMenuInnerHover: slate.slate3,
152
+ actionMenuButtonColor: whiteA.whiteA0,
153
+ actionMenuButtonHoverColor: slate.slate1,
154
+ separatorColor: getOpacities(slate.slate4).opacity50,
155
+ iconColor: slate.slate10,
156
+ menuIconColor: getOpacities(slate.slate10).opacity90,
157
+ selectedMenuIconColor: getOpacities(slate.slate1).opacity90,
158
+ appIconColor: getOpacities(slate.slate1).opacity90,
159
+ mentionBgColor: slate.slate3,
160
+ entityCardBgColor: whiteA.whiteA0,
161
+ entityCardSelectedColor: whiteA.whiteA0,
162
+ entityCardHoverColor: getOpacities(slate.slate1).opacity95,
163
+ entityCardDoneColor: getOpacities(slate.slate4).opacity30,
164
+ entityCardShadow: `0 0 0 1px ${getOpacities(slate.slate10).opacity10}, 0 2px 4px -4px ${
165
+ getOpacities(slate.slate10).opacity20
166
+ }`,
167
+ entityCardShadowHover: `0 0 0 1px ${getOpacities(slate.slate10).opacity10}, 0 6px 8px -4px ${
168
+ getOpacities(slate.slate10).opacity30
169
+ }`,
170
+ unitBg: slate.slate3,
171
+ unitBgHover: slate.slate4,
172
+ badgeBgColor: getOpacities(slate.slate10).opacity20,
173
+ tooltipBgColor: slateDark.slate5,
174
+ todayMarkerColor: red.red8,
175
+ viewBgOverlayColor: getOpacities(slate.slate8).opacity20,
176
+ floatEditorMenuBg: slate.slate1,
177
+ floatEditorActiveColor: indigoDark.indigo10,
178
+ commentColor: getOpacities(yellow.yellow6).opacity60,
179
+ cellBorderColor: getOpacities(slate.slate8).opacity50,
180
+ tableRowWarningColor: getOpacities(yellow.yellow6).opacity60,
181
+ warningBgColor: yellow.yellow6,
182
+ warningButtonColor: yellow.yellow11,
183
+ appCardBgColor: whiteA.whiteA0,
184
+ appCardHoverColor: getOpacities(slate.slate1).opacity95,
185
+ appCardShadow: `0 0 0 1px ${getOpacities(slate.slate10).opacity10}, 0 2px 4px -4px ${
186
+ getOpacities(slate.slate10).opacity20
187
+ }`,
188
+ appCardShadowHover: `0 0 0 1px ${getOpacities(slate.slate10).opacity10}, 0 6px 8px -4px ${
189
+ getOpacities(slate.slate10).opacity30
190
+ }`,
191
+ modalBg: getOpacities(slate.slate11).opacity20,
192
+ //end
193
+ placeholderTextColor: "#65788B",
194
+ disabledInversedTextColor: shades.light,
195
+ codeColor: "#F24461",
196
+ codeBgColor: makeChromaColor("#F24461").luminance(0.88).desaturate(0.1).css(),
197
+ danger: brandColors.red,
198
+ active: brandColors.red,
199
+ warning: "#FFD41E",
200
+ cardBg: "#FFFFFF",
201
+ cardSelected: "#FFFB8F",
202
+ cardSelectedHover: "rgba(240, 244, 247, 0.6)",
203
+ menuSelected: "rgba(240, 244, 247, 1)",
204
+ menuSelectedHover: "rgba(240, 244, 247, 1)",
205
+ menuBg1: "hsl(151, 10.6%, 95.2%)",
206
+ menuBg2: "rgba(255, 255, 255, 0.1)",
207
+ menuBg3: "rgba(255, 255, 255, 0.3)",
208
+ infoBox: "rgba(255, 212, 0, 0.2)",
209
+ errorBg: "rgba(255, 241, 240, 1)",
210
+ timelineCard: "#FCE07D",
211
+ transparent,
212
+ shades: lights,
213
+ lights: shades,
214
+ separators,
215
+ inversedSeparators,
216
+ } as const;
217
+
218
+ const darkColors = {
219
+ mode: "dark",
220
+ brandColors,
221
+ stateColors,
222
+ //dark theme
223
+ whiteColor: whiteA.whiteA0,
224
+ blackColor: blackA.blackA0,
225
+ mainBg: slateDark.slate1,
226
+ panelBg: slateDark.slate2,
227
+ panelContentBg: slateDark.slate2,
228
+ pageBg: slateDark.slate1,
229
+ pageContentBg: slateDark.slate2,
230
+ sidebarBg: slateDark.slate2,
231
+ sidebarShadow: `-3px 0px 10px 0px ${getOpacities(slateDark.slate1).opacity80}`,
232
+ menuBg: slateDark.slate2,
233
+ menuFooterColor: getOpacities(slateDark.slate3).opacity20,
234
+ menuFooterHoverColor: getOpacities(slateDark.slate3).opacity40,
235
+ textColor: slate.slate6,
236
+ accentTextColor: slate.slate10,
237
+ disabledTextColor: slateDark.slate9,
238
+ inversedTextColor: slate.slate6,
239
+ linkColor: indigoDark.indigo11,
240
+ linkBorder: `1px solid ${getOpacities(indigoDark.indigo11).opacity40}`,
241
+ linkHoverColor: indigoDark.indigo10,
242
+ linkBorderHover: `1px solid ${getOpacities(indigoDark.indigo10).opacity80}`,
243
+ entityNodeColor: slate.slate8,
244
+ entityNodeBorder: `1px solid ${getOpacities(slate.slate8).opacity40}`,
245
+ entityNodeHoverColor: slate.slate7,
246
+ entityNodeBorderHover: `1px solid ${getOpacities(slate.slate7).opacity80}`,
247
+ entityNodeBgColor: getOpacities(slateDark.slate6).opacity80,
248
+ shortcutTextColor: slateDark.slate11,
249
+ shortcutBorderColor: `1px solid ${getOpacities(slateDark.slate10).opacity20}`,
250
+ inputBgColor: slateDark.slate2,
251
+ inputDisabledBgColor: slateDark.slate3,
252
+ inputCopyBgColor: slateDark.slate4,
253
+ inputBorderColor: `0 0 0 1px ${getOpacities(slateDark.slate8).opacity70}`,
254
+ inputBorderHoverColor: `0 0 0 1px ${getOpacities(slateDark.slate8).opacity70}`,
255
+ inputPlaceholderTextColor: slate.slate10,
256
+ buttonColor: slate.slate10,
257
+ menuTextColor: slate.slate8,
258
+ selectedMenuTextColor: slate.slate2,
259
+ actionMenuBg: slateDark.slate4,
260
+ actionMenuInnerBg: slateDark.slate5,
261
+ actionMenuShadow: `0 0 0 1px ${getOpacities(slateDark.slate1).opacity10}, 0 12px 16px -4px ${
262
+ getOpacities(slateDark.slate1).opacity40
263
+ }`,
264
+ actionMenuHover: slateDark.slate6,
265
+ actionMenuInnerHover: getOpacities(slateDark.slate7).opacity50,
266
+ actionMenuButtonColor: slateDark.slate2,
267
+ actionMenuButtonHoverColor: slateDark.slate3,
268
+ separatorColor: getOpacities(slateDark.slate8).opacity50,
269
+ iconColor: slate.slate9,
270
+ menuIconColor: getOpacities(slate.slate10).opacity90,
271
+ selectedMenuIconColor: getOpacities(slate.slate1).opacity90,
272
+ appIconColor: getOpacities(slate.slate2).opacity70,
273
+ mentionBgColor: slateDark.slate5,
274
+ entityCardBgColor: slateDark.slate4,
275
+ entityCardSelectedColor: slateDark.slate5,
276
+ entityCardHoverColor: getOpacities(slateDark.slate5).opacity95,
277
+ entityCardDoneColor: slateDark.slate3,
278
+ entityCardShadow: `0 0 0 1px ${getOpacities(slateDark.slate2).opacity10}, 0 2px 4px -4px ${
279
+ getOpacities(slateDark.slate2).opacity20
280
+ }`,
281
+ entityCardShadowHover: `0 0 0 1px ${getOpacities(slateDark.slate2).opacity10}, 0 6px 8px -4px ${
282
+ getOpacities(slateDark.slate2).opacity30
283
+ }`,
284
+ unitBg: slateDark.slate6,
285
+ unitBgHover: slateDark.slate7,
286
+ badgeBgColor: getOpacities(slate.slate10).opacity20,
287
+ tooltipBgColor: slateDark.slate7,
288
+ todayMarkerColor: redDark.red6,
289
+ viewBgOverlayColor: getOpacities(slateDark.slate1).opacity60,
290
+ floatEditorMenuBg: slateDark.slate6,
291
+ floatEditorActiveColor: indigoDark.indigo11,
292
+ commentColor: getOpacities(yellowDark.yellow9).opacity40,
293
+ cellBorderColor: getOpacities(slateDark.slate9).opacity50,
294
+ tableRowWarningColor: getOpacities(yellowDark.yellow9).opacity40,
295
+ warningBgColor: getOpacities(yellowDark.yellow9).opacity40,
296
+ warningButtonColor: yellowDark.yellow11,
297
+ appCardBgColor: slateDark.slate2,
298
+ appCardHoverColor: slateDark.slate2,
299
+ appCardShadow: `0 0 0 1px ${getOpacities(slateDark.slate8).opacity50}, 0 2px 4px -4px ${
300
+ getOpacities(slateDark.slate1).opacity50
301
+ }`,
302
+ appCardShadowHover: `0 0 0 1px ${getOpacities(slateDark.slate8).opacity60}, 0 6px 8px -4px ${
303
+ getOpacities(slateDark.slate1).opacity100
304
+ }`,
305
+ modalBg: getOpacities(slateDark.slate8).opacity20,
306
+ //end
307
+ placeholderTextColor: "#65788B",
308
+ disabledInversedTextColor: lights.light,
309
+ codeColor: "#F24461",
310
+ codeBgColor: makeChromaColor("#F24461").luminance(0.88).desaturate(0.1).css(),
311
+ danger: brandColors.red,
312
+ active: brandColors.red,
313
+ warning: "#FFD41E",
314
+ cardBg: slateDark.slate6,
315
+ cardSelected: slateDark.slate5,
316
+ cardSelectedHover: slateDark.slate5,
317
+ menuSelected: "rgba(240, 244, 247, 1)",
318
+ menuSelectedHover: "rgba(240, 244, 247, 1)",
319
+ menuBg1: "#132331",
320
+ menuBg2: "rgba(255, 255, 255, 0.05)",
321
+ menuBg3: "rgba(255, 255, 255, 0.08)",
322
+ infoBox: "rgba(255, 212, 0, 0.2)",
323
+ errorBg: "rgba(255, 241, 240, 1)",
324
+ timelineCard: "#FCE07D",
325
+ transparent,
326
+ shades,
327
+ lights,
328
+ separators: inversedSeparators,
329
+ inversedSeparators: separators,
330
+ } as const;
331
+
332
+ const oldColors = {
333
+ mode: "old",
334
+ brandColors,
335
+ stateColors,
336
+ //old theme
337
+ whiteColor: whiteA.whiteA0,
338
+ blackColor: blackA.blackA0,
339
+ mainBg: sage.sage3,
340
+ panelBg: whiteA.whiteA0,
341
+ panelContentBg: sage.sage2,
342
+ pageBg: whiteA.whiteA0,
343
+ pageContentBg: whiteA.whiteA0,
344
+ sidebarBg: whiteA.whiteA0,
345
+ sidebarShadow: `-3px 0px 10px 0px ${getOpacities(sage.sage2).opacity80}`,
346
+ menuBg: "#132331",
347
+ menuFooterColor: "rgba(255, 255, 255, 0.05)",
348
+ menuFooterHoverColor: "rgba(255, 255, 255, 0.08)",
349
+ textColor: "#2A3844",
350
+ accentTextColor: "#65788B",
351
+ disabledTextColor: shades.regular,
352
+ inversedTextColor: "#FFFFFF",
353
+ linkColor: indigoDark.indigo10,
354
+ linkBorder: `1px solid ${getOpacities(indigoDark.indigo10).opacity30}`,
355
+ linkHoverColor: indigo.indigo10,
356
+ linkBorderHover: `1px solid ${getOpacities(indigo.indigo10).opacity80}`,
357
+ entityNodeColor: slateDark.slate3,
358
+ entityNodeBorder: `1px solid ${getOpacities(slateDark.slate3).opacity30}`,
359
+ entityNodeHoverColor: slateDark.slate7,
360
+ entityNodeBorderHover: `1px solid ${getOpacities(slate.slate11).opacity80}`,
361
+ entityNodeBgColor: getOpacities(slate.slate3).opacity80,
362
+ shortcutTextColor: slate.slate9,
363
+ shortcutBorderColor: `1px solid ${getOpacities(slate.slate8).opacity20}`,
364
+ inputBgColor: whiteA.whiteA0,
365
+ inputDisabledBgColor: slate.slate2,
366
+ inputCopyBgColor: slate.slate2,
367
+ inputBorderColor: `0 0 0 1px ${shades.thin}`,
368
+ inputBorderHoverColor: `0 0 0 1px ${shades.light}`,
369
+ inputPlaceholderTextColor: "#65788B",
370
+ buttonColor: slate.slate10,
371
+ menuTextColor: "#FFFFFF",
372
+ selectedMenuTextColor: "#FFFFFF",
373
+ actionMenuBg: whiteA.whiteA0,
374
+ actionMenuInnerBg: whiteA.whiteA0,
375
+ actionMenuShadow: `0 0 0 1px rgba(17, 33, 58, 0.05), 0 16px 24px -8px rgba(17, 33, 58, 0.32)`,
376
+ actionMenuHover: "rgba(240, 244, 247, 1)",
377
+ actionMenuInnerHover: "rgba(240, 244, 247, 1)",
378
+ actionMenuButtonColor: whiteA.whiteA0,
379
+ actionMenuButtonHoverColor: slate.slate1,
380
+ separatorColor: slate.slate3,
381
+ iconColor: "#65788B",
382
+ menuIconColor: "#65788B",
383
+ selectedMenuIconColor: whiteA.whiteA0,
384
+ appIconColor: getOpacities(whiteA.whiteA0).opacity90,
385
+ mentionBgColor: slate.slate3,
386
+ entityCardBgColor: "#FFFFFF",
387
+ entityCardSelectedColor: "#FFFB8F",
388
+ entityCardHoverColor: "#FFFFFF",
389
+ entityCardDoneColor: lights.regular,
390
+ entityCardShadow: `0 0 0 1px rgba(17, 33, 58, .08), 0 4px 4px -4px rgba(17, 33, 58, .40)`,
391
+ entityCardShadowHover: `0 0 0 1px rgba(17, 33, 58, .1), 0 4px 8px -4px rgba(17, 33, 58, .68)`,
392
+ unitBg: "rgba(220, 224, 228, 0.33)",
393
+ unitBgHover: "rgba(220, 224, 228, 0.63)",
394
+ badgeBgColor: getOpacities("#65788B").regular,
395
+ tooltipBgColor: slateDark.slate5,
396
+ todayMarkerColor: red.red8,
397
+ viewBgOverlayColor: getOpacities(slate.slate8).opacity20,
398
+ floatEditorMenuBg: slate.slate1,
399
+ floatEditorActiveColor: indigoDark.indigo10,
400
+ commentColor: getOpacities(yellow.yellow6).opacity60,
401
+ cellBorderColor: getOpacities(slate.slate4).opacity50,
402
+ tableRowWarningColor: getOpacities(yellow.yellow6).opacity60,
403
+ warningBgColor: yellow.yellow6,
404
+ warningButtonColor: yellow.yellow11,
405
+ appCardBgColor: whiteA.whiteA0,
406
+ appCardHoverColor: getOpacities(slate.slate1).opacity95,
407
+ appCardShadow: `0 0 0 1px ${getOpacities(slate.slate10).opacity10}, 0 2px 4px -4px ${
408
+ getOpacities(slate.slate10).opacity20
409
+ }`,
410
+ appCardShadowHover: `0 0 0 1px ${getOpacities(slate.slate10).opacity10}, 0 6px 8px -4px ${
411
+ getOpacities(slate.slate10).opacity30
412
+ }`,
413
+ modalBg: getOpacities(slate.slate11).opacity20,
414
+ //end
415
+ placeholderTextColor: "#65788B",
416
+ disabledInversedTextColor: lights.light,
417
+ codeColor: "#F24461",
418
+ codeBgColor: makeChromaColor("#F24461").luminance(0.88).desaturate(0.1).css(),
419
+ danger: brandColors.red,
420
+ active: brandColors.red,
421
+ warning: "#FFD41E",
422
+ cardBg: "#FFFFFF",
423
+ cardSelected: "#FFFB8F",
424
+ cardSelectedHover: "rgba(240, 244, 247, 0.6)",
425
+ menuSelected: "rgba(240, 244, 247, 1)",
426
+ menuSelectedHover: "rgba(240, 244, 247, 1)",
427
+ menuBg1: "#132331",
428
+ menuBg2: "rgba(255, 255, 255, 0.05)",
429
+ menuBg3: "rgba(255, 255, 255, 0.08)",
430
+ infoBox: "rgba(255, 212, 0, 0.2)",
431
+ errorBg: "rgba(255, 241, 240, 1)",
432
+ timelineCard: "#FCE07D",
433
+ transparent,
434
+ shades,
435
+ lights,
436
+ separators: inversedSeparators,
437
+ inversedSeparators: separators,
438
+ } as const;
439
+
440
+ export function getLightColors(): typeof lightColors {
441
+ if (process.env.NODE_ENV !== "test") {
442
+ throw new Error("Only for test purpose");
443
+ }
444
+ return lightColors;
445
+ }
446
+
447
+ export function getDarkColors(): typeof darkColors {
448
+ if (process.env.NODE_ENV !== "test") {
449
+ throw new Error("Only for test purpose");
450
+ }
451
+ return darkColors;
452
+ }
453
+
454
+ export function getOldColors(): typeof oldColors {
455
+ if (process.env.NODE_ENV !== "test") {
456
+ throw new Error("Only for test purpose");
457
+ }
458
+ return oldColors;
459
+ }
460
+
461
+ const getDefaultTheme = () => {
462
+ if (typeof URLSearchParams !== "undefined" && typeof document !== "undefined") {
463
+ let theme = null;
464
+ try {
465
+ const flagsValue = localStorage.getItem("persist:flags");
466
+ const local = flagsValue ? JSON.parse(flagsValue) : {};
467
+ theme = local["not-light-theme"] ? null : "light";
468
+ } catch (e) {
469
+ // sl
470
+ }
471
+ return new URLSearchParams(document.location.search).get("theme") || theme || "old";
472
+ }
473
+ return "old";
474
+ };
475
+
476
+ type Mode = "dark" | "light" | "old";
477
+
478
+ export function getThemeValue<T>(mode: Mode, values: Record<Mode, T>): T {
479
+ return values[mode];
480
+ }
481
+
482
+ function getTypeColors(themeColor: string) {
483
+ let color;
484
+ // switch to chroma.valid once we start using 2.0.1
485
+ try {
486
+ chroma(themeColor);
487
+ color = themeColor;
488
+ } catch (e) {
489
+ color = brandColors.green;
490
+ }
491
+ const boardBg = chroma(color).luminance(0.85).desaturate(0.2).set("hsl.h", "+2");
492
+ return {
493
+ primary: color,
494
+ opacity: getOpacities(color),
495
+ darkenPrimary: getDarkenColor(color),
496
+ brightenPrimary: chroma(color).luminance(0.92).desaturate(0.1).alpha(0.98).css(),
497
+ boardBg: boardBg.hex(),
498
+ boardBgOverlay: boardBg.alpha(0.8).css(),
499
+ headerBg: chroma(color).luminance(0.7).desaturate(0.5).set("hsl.h", "+2").css(),
500
+ detailsBg: chroma(color).luminance(0.85).hex(),
501
+ focus: chroma(color).alpha(0.25).css(),
502
+ separator: chroma(color).alpha(0.3).css(),
503
+ };
504
+ }
505
+
506
+ type DesignColor = typeof darkColors | typeof lightColors | typeof oldColors;
507
+
508
+ export type ThemeColors = ReturnType<typeof getTypeColors> & DesignColor;
509
+
510
+ const colorsByTheme: Record<string, DesignColor> = {
511
+ dark: darkColors,
512
+ light: lightColors,
513
+ old: oldColors,
514
+ };
515
+
516
+ export const getThemeColors = _.memoize((themeColor: string, theme: string = getDefaultTheme()): ThemeColors => {
517
+ const colors = colorsByTheme[theme];
518
+ return {
519
+ ...getTypeColors(themeColor),
520
+ ...colors,
521
+ };
522
+ });
523
+
524
+ export const getTextColor = (color: string): string => {
525
+ return makeChromaColor(color).luminance() > 0.45 ? makeChromaColor(color).luminance(0.1).saturate(3).hex() : "white";
526
+ };
527
+
528
+ export const getBrightenColor = (color: string): string => {
529
+ return makeChromaColor(color).brighten(0.15).hex();
530
+ };
531
+
532
+ export const getLinkedHighlightBackgroundColor = (color: string): string => {
533
+ return makeChromaColor(color).luminance(0.85).hex();
534
+ };
535
+
536
+ export const cardTypeColors = [
537
+ "#D40915",
538
+ "#E72065",
539
+ "#9C2BAF",
540
+ "#673DB6",
541
+ "#3E53B4",
542
+ "#2978FB",
543
+ "#199EE3",
544
+ "#1FBED3",
545
+ "#159789",
546
+ "#4FAF54",
547
+ "#8EC351",
548
+ "#FBA32F",
549
+ "#FC551F",
550
+ "#B04E31",
551
+ "#6A849B",
552
+ "#4A4A4A",
553
+ ] as const;
554
+
555
+ export const pastelColors = cardTypeColors.map((color) => makeChromaColor(color).luminance(0.8).hex());
556
+
557
+ export const colors = {
558
+ ...getTypeColors(brandColors.green),
559
+ brandColors,
560
+ stateColors,
561
+ textColor: "#2A3844",
562
+ placeholderTextColor: "#65788B",
563
+ disabledTextColor: shades.regular,
564
+ inversedTextColor: "#FFFFFF",
565
+ disabledInversedTextColor: lights.light,
566
+ linkColor: brandColors.blue,
567
+ codeColor: "#F24461",
568
+ codeBgColor: makeChromaColor("#F24461").luminance(0.88).desaturate(0.1).css(),
569
+ danger: brandColors.red,
570
+ active: brandColors.red,
571
+ warning: "#FFD41E",
572
+ cardBg: "#FFFFFF",
573
+ cardSelected: "#FFFB8F",
574
+ cardSelectedHover: "rgba(240, 244, 247, 0.6)",
575
+ menuSelected: "rgba(240, 244, 247, 1)",
576
+ menuSelectedHover: "rgba(240, 244, 247, 1)",
577
+ unitBg: "rgba(220, 224, 228, 0.33)",
578
+ menuBg1: "#132331",
579
+ menuBg2: "rgba(255, 255, 255, 0.075)",
580
+ menuBg3: "rgba(81, 182, 157, 0.2)",
581
+ infoBox: "rgba(255, 212, 0, 0.2)",
582
+ modalBg: "rgba(26, 42, 94, 0.3)",
583
+ errorBg: "rgba(255, 241, 240, 1)",
584
+ timelineCard: "#FCE07D",
585
+ timelineScaleSelectBorderColor: chroma("#FFFFFF").alpha(opacity.regular).css(),
586
+ transparent,
587
+ shades,
588
+ lights,
589
+ } as const;
590
+
591
+ export const space = {
592
+ xxs: 2, // Not recommended
593
+ xs: 4,
594
+ s: 6,
595
+ m: 8,
596
+ l: 12,
597
+ xl: 24,
598
+ xxl: 48, // Not recommended
599
+ } as const;
600
+
601
+ export const layout = {
602
+ logoSize: 24,
603
+ menuDefaultWidth: 243,
604
+ menuMinWidth: 46, //TODO: make dependency to itemHeight
605
+ menuMaxWidth: 480,
606
+ menuItemMinWidth: 80,
607
+ menuGroupHeaderIndent: 40, // I'm ok
608
+ menuItemLevelIndent: 24,
609
+ itemHeight: 36,
610
+ itemWithSubtitleHeight: 52,
611
+ groupTitleHeight: 30,
612
+ menuItemHeight: 32,
613
+ newMenuItemHeight: 30, // I'm ok
614
+ viewHeaderHeight: space.l * 7,
615
+ viewHeaderCompactHeight: 52,
616
+ columnMinWidth: 240,
617
+ columnWidths: {compact: 200, default: 240, list: 280, full: 320},
618
+ objectEditorMinWidth: 480,
619
+ typeEditorWidth: "30vw",
620
+ typeEditorMinWidth: 480,
621
+ viewSetupWidth: "30vw",
622
+ viewSetupMinWidth: 525,
623
+ inputHeight: 36, //TODO: merge input and item height?
624
+ timelineLineHeight: 40,
625
+ timelineGroupPadding: 6,
626
+ timelineItemHeightRatio: 34 / 40,
627
+ timelineHeaderHeight: 30,
628
+ calendarEventHeight: 30,
629
+ calendarHeaderHeight: 30,
630
+ calendarToolbarHeight: 60,
631
+ checkboxSize: 17,
632
+ fakeBoardWidth: 260,
633
+ fakeBoardHeight: 160,
634
+ menuHeight: 32,
635
+ popupTopMargin: 48,
636
+ unitHeight: 18,
637
+ } as const;
638
+
639
+ export const radius = 3;
640
+
641
+ export const border = {
642
+ radius0: 0,
643
+ radius1: 1,
644
+ radius2: 2,
645
+ radius3: 3,
646
+ radius4: 4,
647
+ radius5: 5,
648
+ radius6: 6,
649
+ radius8: 8,
650
+ radius10: 10,
651
+ radius12: 12,
652
+ } as const;
653
+
654
+ export const lineHeight = {
655
+ text: 1.6,
656
+ regular: 1.5,
657
+ heading: 1.225,
658
+ nowrap: 1,
659
+ } as const;
660
+
661
+ export const tooltipDelay = {
662
+ enter: 0.4,
663
+ leave: 0,
664
+ } as const;
665
+
666
+ export const duration = 120;
667
+ export const easing = "ease-in-out";
668
+ export const transition = `${duration}ms ${easing}`;
669
+
670
+ export const iconSize = 20;
671
+ export const viewBoxSize = "0 0 20 20";
672
+ export const avatarSize = 24;
673
+
674
+ export const shadows = {
675
+ light: `0 1px 3px ${shades.hairline}`,
676
+ lightReverted: `0 -1px 3px ${shades.hairline}`,
677
+ border: `0 0 0 1px ${shades.thin}`,
678
+ inversedBorder: `0 0 0 1px ${lights.thin}`,
679
+ cardRegular: "0 0 0 1px rgba(17, 33, 58, .08), 0 4px 4px -4px rgba(17, 33, 58, .40)",
680
+ cardHover: "0 0 0 1px rgba(17, 33, 58, .1), 0 4px 8px -4px rgba(17, 33, 58, .68)",
681
+ dragging: "0 0 0 1px rgba(17, 33, 58, .08), 0 4px 4px -4px rgba(17, 33, 58, .40)",
682
+ videoPreview: "0 4px 30px 4px rgba(0, 0, 0, .15)",
683
+ } as const;
684
+
685
+ export const dateFormat = "MMM D, YYYY";
686
+ export const dateTimeFormat = "MMM D, YYYY HH:mm";
687
+ export const timeFormat = "HH:mm";
688
+
689
+ export const getLinearGradient = (backgroundColors: Array<string>): string => {
690
+ const parts = _.flatMap(
691
+ backgroundColors.map((color, index, arr) => [
692
+ `${color} ${(index / arr.length) * 100}%`,
693
+ `${color} ${((index + 1) / arr.length) * 100}%`,
694
+ ])
695
+ );
696
+ return `linear-gradient(to bottom, ${parts.join(", ")})`;
697
+ };
698
+
699
+ export const getObjectColorMemoized = _.memoize((name) => {
700
+ if (!name) {
701
+ return "#999999";
702
+ }
703
+ const colorHash = new ColorHash({
704
+ lightness: [0.4, 0.5, 0.6],
705
+ saturation: [0.6, 0.7, 0.8, 0.9, 1],
706
+ });
707
+ return colorHash.hex(name);
708
+ });
709
+
710
+ export const themeVars = Object.keys(getThemeColors("#FFFFFF")).reduce((vars, key) => {
711
+ if (key === "opacity") {
712
+ vars[key] = Object.fromEntries(
713
+ Object.keys(opacity).map((opacityKey) => [opacityKey, `var(--fibery-opacity-${opacityKey})`])
714
+ );
715
+ } else if (key === "stateColors") {
716
+ vars[key] = Object.fromEntries(
717
+ Object.keys(stateColors).map((stateColorKey) => [stateColorKey, `var(--fibery-state-colors-${stateColorKey})`])
718
+ );
719
+ } else if (key === "brandColors") {
720
+ vars[key] = Object.fromEntries(
721
+ Object.keys(brandColors).map((brandColorKey) => [brandColorKey, `var(--fibery-brand-colors-${brandColorKey})`])
722
+ );
723
+ } else if (key === "shades") {
724
+ vars[key] = Object.fromEntries(
725
+ Object.keys(shades).map((shadeKey) => [shadeKey, `var(--fibery-shades-${shadeKey})`])
726
+ );
727
+ } else if (key === "lights") {
728
+ vars[key] = Object.fromEntries(
729
+ Object.keys(lights).map((lightKey) => [lightKey, `var(--fibery-lights-${lightKey})`])
730
+ );
731
+ } else if (key === "separators") {
732
+ vars[key] = Object.fromEntries(
733
+ Object.keys(separators).map((separatorKey) => [separatorKey, `var(--fibery-separator-${separatorKey})`])
734
+ );
735
+ } else if (key === "inversedSeparators") {
736
+ vars[key] = Object.fromEntries(
737
+ Object.keys(inversedSeparators).map((separatorKey) => [
738
+ separatorKey,
739
+ `var(--fibery-inversed-separator-${separatorKey})`,
740
+ ])
741
+ );
742
+ } else {
743
+ vars[key] = `var(--fibery-color-${key})`;
744
+ }
745
+ return vars;
746
+ }, {} as Record<string, string | {[k: string]: string}>) as ThemeColors;
747
+
748
+ export const createInlineTheme = (theme: ThemeColors) => createInlineStyles<ThemeColors>(theme);
749
+
750
+ export const textStyles = {
751
+ heading1: {
752
+ fontFamily,
753
+ fontSize: typeSizes[0],
754
+ letterSpacing: "-0.003em",
755
+ lineHeight: lineHeight.heading,
756
+ fontWeight: fontWeight.bold,
757
+ color: themeVars.textColor,
758
+ },
759
+ heading2: {
760
+ fontFamily,
761
+ fontSize: typeSizes[1],
762
+ letterSpacing: "-0.002em",
763
+ lineHeight: lineHeight.heading,
764
+ fontWeight: fontWeight.bold,
765
+ color: themeVars.textColor,
766
+ },
767
+ heading3: {
768
+ fontFamily,
769
+ fontSize: typeSizes[2],
770
+ letterSpacing: "-0.002em",
771
+ lineHeight: lineHeight.heading,
772
+ fontWeight: fontWeight.bold,
773
+ color: themeVars.textColor,
774
+ },
775
+ heading4: {
776
+ fontFamily,
777
+ fontSize: typeSizes[3],
778
+ lineHeight: lineHeight.heading,
779
+ fontWeight: fontWeight.bold,
780
+ color: themeVars.textColor,
781
+ },
782
+ heading5: {
783
+ fontFamily,
784
+ fontSize: typeSizes[4],
785
+ lineHeight: lineHeight.heading,
786
+ fontWeight: fontWeight.bold,
787
+ color: themeVars.textColor,
788
+ },
789
+ heading6: {
790
+ fontFamily,
791
+ fontSize: typeSizes[5],
792
+ lineHeight: lineHeight.heading,
793
+ letterSpacing: 0.6,
794
+ textTransform: "uppercase",
795
+ fontWeight: fontWeight.regular,
796
+ color: themeVars.textColor,
797
+ },
798
+ heading7: {
799
+ fontFamily,
800
+ fontSize: typeSizes[6],
801
+ lineHeight: lineHeight.heading,
802
+ letterSpacing: 0.6,
803
+ textTransform: "uppercase",
804
+ fontWeight: fontWeight.regular,
805
+ color: themeVars.textColor,
806
+ },
807
+ big: {
808
+ fontFamily,
809
+ fontSize: typeSizes[3],
810
+ lineHeight: lineHeight.regular,
811
+ fontWeight: fontWeight.regular,
812
+ color: themeVars.textColor,
813
+ },
814
+ regular: {
815
+ fontFamily,
816
+ fontSize: typeSizes[4],
817
+ lineHeight: lineHeight.regular,
818
+ fontWeight: fontWeight.regular,
819
+ color: themeVars.textColor,
820
+ textTransform: "none",
821
+ letterSpacing: "normal",
822
+ },
823
+ small: {
824
+ fontFamily,
825
+ fontSize: typeSizes[5],
826
+ lineHeight: lineHeight.regular,
827
+ fontWeight: fontWeight.regular,
828
+ color: themeVars.textColor,
829
+ textTransform: "none",
830
+ },
831
+ code: {
832
+ fontFamily: "Consolas, Menlo, Courier, monospace",
833
+ fontSize: typeSizes[4],
834
+ lineHeight: lineHeight.regular,
835
+ fontWeight: fontWeight.regular,
836
+ color: themeVars.textColor,
837
+ },
838
+ fake: {
839
+ fontFamily,
840
+ fontSize: typeSizes[7],
841
+ lineHeight: lineHeight.regular,
842
+ fontWeight: fontWeight.regular,
843
+ color: colors.shades.light,
844
+ },
845
+ link: {
846
+ color: themeVars.linkColor,
847
+ borderBottom: themeVars.linkBorder,
848
+ textDecoration: "none",
849
+ cursor: "pointer",
850
+ transition: `border ${transition}`,
851
+ },
852
+ inversedLink: {
853
+ color: colors.inversedTextColor,
854
+ cursor: "pointer",
855
+ textDecoration: "underline",
856
+ textDecorationColor: lights.light,
857
+ },
858
+ note: {
859
+ fontFamily,
860
+ fontSize: typeSizes[3],
861
+ lineHeight: lineHeight.regular,
862
+ fontWeight: fontWeight.regular,
863
+ color: themeVars.textColor,
864
+ backgroundColor: colors.timelineCard,
865
+ border: `1px solid ${colors.timelineCard}`,
866
+ borderRadius: radius,
867
+ },
868
+ important: {
869
+ fontFamily,
870
+ fontSize: typeSizes[3],
871
+ lineHeight: lineHeight.regular,
872
+ fontWeight: fontWeight.regular,
873
+ color: themeVars.textColor,
874
+ border: `1px solid ${colors.active}`,
875
+ borderRadius: radius,
876
+ },
877
+ } as const;