@ebubekirylmaz/link-test 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 (409) hide show
  1. package/.babelrc +3 -0
  2. package/.browserslistrc +1 -0
  3. package/.env +2 -0
  4. package/.eslintignore +3 -0
  5. package/.eslintrc.json +58 -0
  6. package/.gitattributes +1 -0
  7. package/.github/workflows/publish.yml +66 -0
  8. package/.prettierignore +1 -0
  9. package/.prettierrc +10 -0
  10. package/.storybook/main.js +15 -0
  11. package/.storybook/preview.js +17 -0
  12. package/.storybook/vitest.setup.js +6 -0
  13. package/README.md +1 -0
  14. package/cypress.config.js +11 -0
  15. package/index.js +1 -0
  16. package/package.json +111 -0
  17. package/project/.eslintrc.cjs +22 -0
  18. package/project/config.js +18 -0
  19. package/project/config.menu.js +39 -0
  20. package/project/config.template.js +31 -0
  21. package/project/cypress/e2e/layouts.cy.js +170 -0
  22. package/project/cypress/e2e/login.cy.js +35 -0
  23. package/project/cypress/e2e/selectbar.cy.js +80 -0
  24. package/project/cypress/fixtures/CONFIG/MENU_CONFIG.js +39 -0
  25. package/project/cypress/fixtures/EMPEROR/EMPERORS_GET.json +51 -0
  26. package/project/cypress/fixtures/EMPEROR/EMPERORS_POST.json +9 -0
  27. package/project/cypress/fixtures/OAUTH/GITHUB/user.json +46 -0
  28. package/project/cypress/fixtures/example.json +5 -0
  29. package/project/cypress/support/commands.js +104 -0
  30. package/project/cypress/support/e2e.js +1 -0
  31. package/project/cypress.config.js +10 -0
  32. package/project/index.html +12 -0
  33. package/project/media/ProjectIcons/3d.png +0 -0
  34. package/project/media/ProjectIcons/box.png +0 -0
  35. package/project/media/ProjectIcons/cafe.png +0 -0
  36. package/project/media/ProjectIcons/cargo.png +0 -0
  37. package/project/media/ProjectIcons/cloud.png +0 -0
  38. package/project/media/ProjectIcons/code.png +0 -0
  39. package/project/media/ProjectIcons/company.png +0 -0
  40. package/project/media/ProjectIcons/conversation.png +0 -0
  41. package/project/media/ProjectIcons/distributed.png +0 -0
  42. package/project/media/ProjectIcons/fingerprint.png +0 -0
  43. package/project/media/ProjectIcons/forest.png +0 -0
  44. package/project/media/ProjectIcons/headphones.png +0 -0
  45. package/project/media/ProjectIcons/office.png +0 -0
  46. package/project/media/ProjectIcons/path.png +0 -0
  47. package/project/media/ProjectIcons/printer.png +0 -0
  48. package/project/media/ProjectIcons/project.png +0 -0
  49. package/project/media/ProjectIcons/resume.png +0 -0
  50. package/project/media/ProjectIcons/rocket.png +0 -0
  51. package/project/media/ProjectIcons/rtruck.png +0 -0
  52. package/project/media/ProjectIcons/sign.png +0 -0
  53. package/project/media/ProjectIcons/site.png +0 -0
  54. package/project/media/ProjectIcons/truck.png +0 -0
  55. package/project/media/logo.png +0 -0
  56. package/project/package-lock.json +22434 -0
  57. package/project/package.json +42 -0
  58. package/project/public/assets/background/overlay_2.jpg +0 -0
  59. package/project/public/assets/illustrations/illustration_dashboard.png +0 -0
  60. package/project/public/media/largeLogo.png +0 -0
  61. package/project/public/media/logo.png +0 -0
  62. package/project/public/vite.svg +1 -0
  63. package/project/routes.jsx +47 -0
  64. package/project/server/mock.json +110 -0
  65. package/project/server/oauthMock.js +27 -0
  66. package/project/server/package-lock.json +1505 -0
  67. package/project/server/package.json +20 -0
  68. package/project/server/server.js +127 -0
  69. package/project/src/Container.jsx +7 -0
  70. package/project/src/components/ActionButton.jsx +18 -0
  71. package/project/src/hooks/useEmperor.jsx +21 -0
  72. package/project/src/http/index.js +39 -0
  73. package/project/src/main.jsx +10 -0
  74. package/project/src/pages/Battles.jsx +16 -0
  75. package/project/src/pages/Emperor.jsx +50 -0
  76. package/project/src/pages/index.jsx +33 -0
  77. package/project/src/theme.js +151 -0
  78. package/project/src/widgets/ActionButton.jsx +68 -0
  79. package/project/src/widgets/AddNewEmperor.jsx +120 -0
  80. package/project/src/widgets/ProjectContainer.jsx +27 -0
  81. package/project/vite.config.js +6 -0
  82. package/project/vite.config.js.timestamp-1709564450418-45fdd27900806.mjs +341 -0
  83. package/public/assets/background/overlay_2.jpg +0 -0
  84. package/public/assets/illustrations/illustration_dashboard.png +0 -0
  85. package/public/vite.svg +1 -0
  86. package/src/ContextProvider/ContextProvider.jsx +19 -0
  87. package/src/GlobalSnackMessage/GlobalSnackMessage.jsx +45 -0
  88. package/src/GlobalSnackMessage/index.js +1 -0
  89. package/src/GlobalSnackMessage/styles.js +3 -0
  90. package/src/Platform.jsx +76 -0
  91. package/src/RouteManager/RouteManager.jsx +56 -0
  92. package/src/RouteManager/index.js +1 -0
  93. package/src/assets/illustrations/avatar-shape.jsx +31 -0
  94. package/src/assets/illustrations/background-shape.jsx +37 -0
  95. package/src/assets/illustrations/booking-illustration.jsx +335 -0
  96. package/src/assets/illustrations/check-in-illustration.jsx +96 -0
  97. package/src/assets/illustrations/check-out-illustration.jsx +69 -0
  98. package/src/assets/illustrations/coming-soon-illustration.jsx +125 -0
  99. package/src/assets/illustrations/forbidden-illustration.jsx +95 -0
  100. package/src/assets/illustrations/index.js +2 -0
  101. package/src/assets/illustrations/maintenance-illustration.jsx +228 -0
  102. package/src/assets/illustrations/motivation-illustration.jsx +74 -0
  103. package/src/assets/illustrations/order-complete-illustration.jsx +126 -0
  104. package/src/assets/illustrations/page-not-found-illustration.jsx +81 -0
  105. package/src/assets/illustrations/seo-illustration.jsx +244 -0
  106. package/src/assets/illustrations/sever-error-illustration.jsx +152 -0
  107. package/src/assets/illustrations/upgrade-storage-illustration.jsx +161 -0
  108. package/src/assets/illustrations/upload-illustration.jsx +622 -0
  109. package/src/components/Iconify/Iconify.jsx +18 -0
  110. package/src/components/Iconify/index.js +1 -0
  111. package/src/components/MiniTopBar/MiniTopBar.jsx +25 -0
  112. package/src/components/MiniTopBar/index.js +1 -0
  113. package/src/components/MiniTopBar/styles.js +6 -0
  114. package/src/components/NucleoidLoginForm/NucleoidLoginForm.jsx +69 -0
  115. package/src/components/NucleoidLoginForm/index.js +1 -0
  116. package/src/components/NucleoidLoginForm/styles.js +3 -0
  117. package/src/components/Sidebar/Sidebar.jsx +76 -0
  118. package/src/components/Sidebar/index.js +1 -0
  119. package/src/components/Sidebar/styles.js +25 -0
  120. package/src/components/SocialLoginButtons/SocialLoginButtons.jsx +55 -0
  121. package/src/components/SocialLoginButtons/index.js +1 -0
  122. package/src/components/SocialLoginButtons/styles.js +3 -0
  123. package/src/components/TopNavBar/TopNavBar.jsx +186 -0
  124. package/src/components/TopNavBar/index.js +1 -0
  125. package/src/components/TopNavBar/styles.js +7 -0
  126. package/src/components/animate/index.js +4 -0
  127. package/src/components/animate/motion-container.jsx +38 -0
  128. package/src/components/animate/motion-lazy.jsx +11 -0
  129. package/src/components/animate/motion-viewport.jsx +30 -0
  130. package/src/components/animate/variants/actions.js +4 -0
  131. package/src/components/animate/variants/background.js +97 -0
  132. package/src/components/animate/variants/bounce.js +107 -0
  133. package/src/components/animate/variants/container.js +20 -0
  134. package/src/components/animate/variants/fade.js +127 -0
  135. package/src/components/animate/variants/flip.js +54 -0
  136. package/src/components/animate/variants/index.js +12 -0
  137. package/src/components/animate/variants/path.js +12 -0
  138. package/src/components/animate/variants/rotate.js +33 -0
  139. package/src/components/animate/variants/scale.js +54 -0
  140. package/src/components/animate/variants/slide.js +65 -0
  141. package/src/components/animate/variants/transition.js +20 -0
  142. package/src/components/animate/variants/zoom.js +130 -0
  143. package/src/components/chart/chart.js +69 -0
  144. package/src/components/chart/index.js +5 -0
  145. package/src/components/chart/use-chart.js +215 -0
  146. package/src/components/custom-popover/custom-popover.jsx +46 -0
  147. package/src/components/custom-popover/index.js +3 -0
  148. package/src/components/custom-popover/styles.js +84 -0
  149. package/src/components/custom-popover/use-popover.js +22 -0
  150. package/src/components/custom-popover/utils.js +100 -0
  151. package/src/components/file-thumbnail/download-button.jsx +39 -0
  152. package/src/components/file-thumbnail/file-thumbnail.jsx +72 -0
  153. package/src/components/file-thumbnail/index.js +5 -0
  154. package/src/components/file-thumbnail/utils.js +148 -0
  155. package/src/components/image/image.jsx +119 -0
  156. package/src/components/image/index.js +1 -0
  157. package/src/components/image/utils.js +15 -0
  158. package/src/components/label/index.js +1 -0
  159. package/src/components/label/label.jsx +51 -0
  160. package/src/components/label/styles.js +78 -0
  161. package/src/components/loading-screen/index.js +2 -0
  162. package/src/components/loading-screen/loading-screen.jsx +23 -0
  163. package/src/components/loading-screen/splash-screen.jsx +95 -0
  164. package/src/components/logo/index.js +1 -0
  165. package/src/components/logo/logo.jsx +61 -0
  166. package/src/components/logo/styles.js +17 -0
  167. package/src/components/nav-section/horizontal/index.js +1 -0
  168. package/src/components/nav-section/horizontal/nav-item.jsx +224 -0
  169. package/src/components/nav-section/horizontal/nav-list.jsx +113 -0
  170. package/src/components/nav-section/horizontal/nav-section-horizontal.jsx +41 -0
  171. package/src/components/nav-section/index.js +3 -0
  172. package/src/components/nav-section/mini/index.js +1 -0
  173. package/src/components/nav-section/mini/nav-item.jsx +242 -0
  174. package/src/components/nav-section/mini/nav-list.jsx +107 -0
  175. package/src/components/nav-section/mini/nav-section-mini.jsx +35 -0
  176. package/src/components/nav-section/vertical/index.js +1 -0
  177. package/src/components/nav-section/vertical/nav-item.jsx +294 -0
  178. package/src/components/nav-section/vertical/nav-list.jsx +66 -0
  179. package/src/components/nav-section/vertical/nav-section-vertical.jsx +74 -0
  180. package/src/components/scrollbar/index.js +1 -0
  181. package/src/components/scrollbar/scrollbar.jsx +39 -0
  182. package/src/components/scrollbar/styles.js +27 -0
  183. package/src/components/search-not-found/index.js +1 -0
  184. package/src/components/search-not-found/search-not-found.jsx +29 -0
  185. package/src/components/settings/context/index.js +2 -0
  186. package/src/components/settings/context/settings-context.js +14 -0
  187. package/src/components/settings/context/settings-provider.jsx +46 -0
  188. package/src/components/settings/drawer/base-option.jsx +52 -0
  189. package/src/components/settings/drawer/fullscreen-option.jsx +58 -0
  190. package/src/components/settings/drawer/index.js +1 -0
  191. package/src/components/settings/drawer/layout-options.jsx +144 -0
  192. package/src/components/settings/drawer/presets-options.jsx +53 -0
  193. package/src/components/settings/drawer/settings-drawer.jsx +189 -0
  194. package/src/components/settings/drawer/stretch-options.jsx +67 -0
  195. package/src/components/settings/index.js +3 -0
  196. package/src/components/svg-color/index.js +1 -0
  197. package/src/components/svg-color/svg-color.jsx +23 -0
  198. package/src/config/config.js +48 -0
  199. package/src/config/schemas.js +148 -0
  200. package/src/context/reducer.js +52 -0
  201. package/src/global.css +2 -0
  202. package/src/hooks/index.js +2 -0
  203. package/src/hooks/use-boolean.js +27 -0
  204. package/src/hooks/use-event-listener.js +34 -0
  205. package/src/hooks/use-local-storage.js +89 -0
  206. package/src/hooks/use-off-set-top.js +37 -0
  207. package/src/hooks/use-responsive.js +47 -0
  208. package/src/hooks/use-scroll-to-top.js +14 -0
  209. package/src/hooks/use-user.js +58 -0
  210. package/src/hooks/useApi.js +25 -0
  211. package/src/hooks/useItemsState.js +23 -0
  212. package/src/hooks/useProjects.js +24 -0
  213. package/src/hooks/useSettings.jsx +51 -0
  214. package/src/http/index.js +155 -0
  215. package/src/http/oauth.js +27 -0
  216. package/src/http/user.js +110 -0
  217. package/src/layouts/AppLayout.jsx +113 -0
  218. package/src/layouts/CompactLayout/CompactLayout.jsx +32 -0
  219. package/src/layouts/CompactLayout/index.js +1 -0
  220. package/src/layouts/DashboardLayout/DashboardLayout.jsx +87 -0
  221. package/src/layouts/DashboardLayout/config-navigation.jsx +0 -0
  222. package/src/layouts/DashboardLayout/header.jsx +104 -0
  223. package/src/layouts/DashboardLayout/index.js +2 -0
  224. package/src/layouts/DashboardLayout/main.jsx +64 -0
  225. package/src/layouts/DashboardLayout/nav-horizontal.jsx +62 -0
  226. package/src/layouts/DashboardLayout/nav-mini.jsx +99 -0
  227. package/src/layouts/DashboardLayout/nav-vertical.jsx +201 -0
  228. package/src/layouts/FullScreenLayout/FullScreenLayout.jsx +101 -0
  229. package/src/layouts/FullScreenLayout/index.js +1 -0
  230. package/src/layouts/FullScreenLayout/nav-horizontal.jsx +50 -0
  231. package/src/layouts/FullScreenLayout/nav-vertical.jsx +136 -0
  232. package/src/layouts/MainLayout/MainLayout.jsx +21 -0
  233. package/src/layouts/MainLayout/footer.jsx +153 -0
  234. package/src/layouts/MainLayout/header.jsx +81 -0
  235. package/src/layouts/MainLayout/index.js +1 -0
  236. package/src/layouts/MainLayout/nav/desktop/index.jsx +20 -0
  237. package/src/layouts/MainLayout/nav/desktop/nav-item.jsx +186 -0
  238. package/src/layouts/MainLayout/nav/desktop/nav-list.jsx +145 -0
  239. package/src/layouts/MainLayout/nav/mobile/index.jsx +60 -0
  240. package/src/layouts/MainLayout/nav/mobile/nav-item.jsx +90 -0
  241. package/src/layouts/MainLayout/nav/mobile/nav-list.jsx +72 -0
  242. package/src/layouts/Page.jsx +16 -0
  243. package/src/layouts/SimpleLayout/SimpleLayout.jsx +8 -0
  244. package/src/layouts/SimpleLayout/index.js +1 -0
  245. package/src/layouts/TwoSideLayout/TwoSideLayout.jsx +31 -0
  246. package/src/layouts/TwoSideLayout/index.js +1 -0
  247. package/src/layouts/auth/classic.jsx +95 -0
  248. package/src/layouts/auth/modern-compact.jsx +51 -0
  249. package/src/layouts/auth/modern.jsx +94 -0
  250. package/src/layouts/common/ProjectBar/index.jsx +325 -0
  251. package/src/layouts/common/ProjectBar/result-item.jsx +90 -0
  252. package/src/layouts/common/ProjectBar/utils.js +86 -0
  253. package/src/layouts/common/account-popover.jsx +116 -0
  254. package/src/layouts/common/header-shadow.jsx +26 -0
  255. package/src/layouts/common/header-sim.jsx +52 -0
  256. package/src/layouts/common/header-simple.jsx +76 -0
  257. package/src/layouts/common/nav-toggle-button.jsx +57 -0
  258. package/src/layouts/common/notifications-popover/index.jsx +177 -0
  259. package/src/layouts/common/notifications-popover/notification-item.jsx +252 -0
  260. package/src/layouts/common/settings-button.jsx +48 -0
  261. package/src/layouts/config-layout.js +12 -0
  262. package/src/layouts/index.js +7 -0
  263. package/src/lib/AddItemWizard/AddItemWizard.jsx +211 -0
  264. package/src/lib/AddItemWizard/index.js +1 -0
  265. package/src/lib/CustomBreadcrumbs/CustomBreadcrumbs.jsx +88 -0
  266. package/src/lib/CustomBreadcrumbs/index.js +1 -0
  267. package/src/lib/CustomBreadcrumbs/link-item.jsx +58 -0
  268. package/src/lib/CustomPopover/CustomPopover.jsx +46 -0
  269. package/src/lib/CustomPopover/index.js +3 -0
  270. package/src/lib/CustomPopover/styles.js +82 -0
  271. package/src/lib/CustomPopover/usePopover.js +20 -0
  272. package/src/lib/CustomPopover/utils.js +100 -0
  273. package/src/lib/Flow/connectors/DynamicConnector.jsx +247 -0
  274. package/src/lib/Flow/core/Flow.jsx +79 -0
  275. package/src/lib/Flow/core/FlowNode.jsx +68 -0
  276. package/src/lib/Flow/core/FlowViewport.jsx +259 -0
  277. package/src/lib/Flow/graph/FloatingGraph.jsx +44 -0
  278. package/src/lib/Flow/hooks/useGraphOperations.js +362 -0
  279. package/src/lib/Flow/hooks/useNodeStyle.js +56 -0
  280. package/src/lib/Flow/index.js +1 -0
  281. package/src/lib/Flow/layouts/ActionNode.jsx +78 -0
  282. package/src/lib/Flow/layouts/AnimatedNode.jsx +22 -0
  283. package/src/lib/Flow/layouts/CardLayout.jsx +397 -0
  284. package/src/lib/Flow/layouts/InfoNode.jsx +255 -0
  285. package/src/lib/Flow/layouts/LoadingNode.jsx +37 -0
  286. package/src/lib/Flow/nodes/DefaultCard.jsx +107 -0
  287. package/src/lib/Flow/nodes/DraggableNode.jsx +162 -0
  288. package/src/lib/Flow/nodes/FlowNodeView.jsx +214 -0
  289. package/src/lib/Flow/selection/SelectionContext.jsx +259 -0
  290. package/src/lib/Flow/selection/SelectionOverlay.jsx +31 -0
  291. package/src/lib/Flow/styles.js +154 -0
  292. package/src/lib/Flow/utils/flowUtils.js +268 -0
  293. package/src/lib/FormProvider/FormProvider.jsx +16 -0
  294. package/src/lib/FormProvider/index.js +1 -0
  295. package/src/lib/IconSelector/IconSelector.jsx +89 -0
  296. package/src/lib/Iconify/Iconify.jsx +17 -0
  297. package/src/lib/Iconify/index.js +1 -0
  298. package/src/lib/Image/Image.jsx +116 -0
  299. package/src/lib/Image/index.js +1 -0
  300. package/src/lib/Image/utils.js +15 -0
  301. package/src/lib/ItemSummary/ItemSummary.jsx +77 -0
  302. package/src/lib/ItemSummary/ItemsSummary.jsx +163 -0
  303. package/src/lib/Label/Label.jsx +51 -0
  304. package/src/lib/Label/index.js +1 -0
  305. package/src/lib/Label/styles.js +76 -0
  306. package/src/lib/ProjectWizard.jsx +137 -0
  307. package/src/lib/RHFTextfield/RHFTextfield.jsx +39 -0
  308. package/src/lib/RHFTextfield/index.js +1 -0
  309. package/src/lib/Scrollbar/Scrollbar.jsx +39 -0
  310. package/src/lib/Scrollbar/index.js +1 -0
  311. package/src/lib/Scrollbar/styles.js +27 -0
  312. package/src/lib/SearchNotFound/SearchNotFound.jsx +29 -0
  313. package/src/lib/SearchNotFound/index.js +1 -0
  314. package/src/lib/SparkleInput/SparkleInput.jsx +51 -0
  315. package/src/lib/StepComponent/StepComponent.jsx +98 -0
  316. package/src/lib/SvgColor/SvgColor.jsx +28 -0
  317. package/src/lib/SvgColor/index.js +1 -0
  318. package/src/lib/TableHeadCustom/TableHeadCustom.jsx +87 -0
  319. package/src/lib/TableHeadCustom/index.js +1 -0
  320. package/src/lib/TableSelectedAction/TableSelectedAction.jsx +72 -0
  321. package/src/lib/TableSelectedAction/index.js +1 -0
  322. package/src/lib/index.js +36 -0
  323. package/src/lib/lib/Icons.js +40 -0
  324. package/src/lib/lib/context.json +272 -0
  325. package/src/lib/useChart/useChart.js +179 -0
  326. package/src/lib/useTable/useTable.js +121 -0
  327. package/src/pages/404.jsx +17 -0
  328. package/src/pages/Callback.jsx +126 -0
  329. package/src/pages/ConfigError.jsx +49 -0
  330. package/src/pages/LoginPage.jsx +43 -0
  331. package/src/routes/components/index.js +1 -0
  332. package/src/routes/components/router-link.jsx +11 -0
  333. package/src/routes/hooks/index.js +4 -0
  334. package/src/routes/hooks/use-active-link.js +15 -0
  335. package/src/routes/hooks/use-pathname.js +10 -0
  336. package/src/routes/hooks/use-router.js +21 -0
  337. package/src/stories/FlowChart.stories.jsx +333 -0
  338. package/src/stories/Iconify.stories.jsx +183 -0
  339. package/src/stories/Label.stories.jsx +447 -0
  340. package/src/stories/Navbar.stories.jsx +588 -0
  341. package/src/theme/css.js +152 -0
  342. package/src/theme/custom-shadows.js +47 -0
  343. package/src/theme/index.jsx +100 -0
  344. package/src/theme/options/contrast.js +34 -0
  345. package/src/theme/options/presets.js +89 -0
  346. package/src/theme/options/right-to-left.jsx +26 -0
  347. package/src/theme/overrides/components/accordion.js +43 -0
  348. package/src/theme/overrides/components/alert.js +69 -0
  349. package/src/theme/overrides/components/appbar.js +13 -0
  350. package/src/theme/overrides/components/autocomplete.js +44 -0
  351. package/src/theme/overrides/components/avatar.js +111 -0
  352. package/src/theme/overrides/components/backdrop.js +18 -0
  353. package/src/theme/overrides/components/badge.js +90 -0
  354. package/src/theme/overrides/components/breadcrumbs.js +21 -0
  355. package/src/theme/overrides/components/button-group.js +90 -0
  356. package/src/theme/overrides/components/button.js +145 -0
  357. package/src/theme/overrides/components/card.js +30 -0
  358. package/src/theme/overrides/components/checkbox.js +13 -0
  359. package/src/theme/overrides/components/chip.js +129 -0
  360. package/src/theme/overrides/components/css-baseline.js +48 -0
  361. package/src/theme/overrides/components/data-grid.js +94 -0
  362. package/src/theme/overrides/components/date-picker.jsx +94 -0
  363. package/src/theme/overrides/components/dialog.js +49 -0
  364. package/src/theme/overrides/components/drawer.js +39 -0
  365. package/src/theme/overrides/components/fab.js +165 -0
  366. package/src/theme/overrides/components/list.js +33 -0
  367. package/src/theme/overrides/components/loading-button.js +30 -0
  368. package/src/theme/overrides/components/menu.js +15 -0
  369. package/src/theme/overrides/components/pagination.js +81 -0
  370. package/src/theme/overrides/components/paper.js +18 -0
  371. package/src/theme/overrides/components/popover.js +20 -0
  372. package/src/theme/overrides/components/progress.js +40 -0
  373. package/src/theme/overrides/components/radio.js +22 -0
  374. package/src/theme/overrides/components/rating.js +40 -0
  375. package/src/theme/overrides/components/select.js +26 -0
  376. package/src/theme/overrides/components/skeleton.js +16 -0
  377. package/src/theme/overrides/components/slider.js +30 -0
  378. package/src/theme/overrides/components/stepper.js +13 -0
  379. package/src/theme/overrides/components/svg-icon.js +15 -0
  380. package/src/theme/overrides/components/switch.js +66 -0
  381. package/src/theme/overrides/components/table.js +79 -0
  382. package/src/theme/overrides/components/tabs.js +39 -0
  383. package/src/theme/overrides/components/textfield.js +146 -0
  384. package/src/theme/overrides/components/timeline.js +20 -0
  385. package/src/theme/overrides/components/toggle-button.js +70 -0
  386. package/src/theme/overrides/components/tooltip.js +18 -0
  387. package/src/theme/overrides/components/tree-view.js +16 -0
  388. package/src/theme/overrides/components/typography.js +16 -0
  389. package/src/theme/overrides/default-props.jsx +238 -0
  390. package/src/theme/overrides/index.js +100 -0
  391. package/src/theme/palette.js +144 -0
  392. package/src/theme/shadows.js +41 -0
  393. package/src/theme/typography.js +107 -0
  394. package/src/utils/flatten-array.js +16 -0
  395. package/src/utils/format-number.js +37 -0
  396. package/src/utils/format-time.js +27 -0
  397. package/src/utils/storage-available.js +24 -0
  398. package/src/widgets/Login/CognitoLogin.jsx +43 -0
  399. package/src/widgets/Login/Login.jsx +58 -0
  400. package/src/widgets/Login/cognitoAuth.jsx +26 -0
  401. package/src/widgets/LoginForm/LoginForm.jsx +87 -0
  402. package/src/widgets/LoginForm/LoginFormStyles.js +43 -0
  403. package/src/widgets/LoginForm/index.js +1 -0
  404. package/src/widgets/SettingsDialog.jsx +308 -0
  405. package/src/widgets/error/index.js +1 -0
  406. package/src/widgets/error/not-found-view.jsx +42 -0
  407. package/vite/vite.js +77 -0
  408. package/vite.config.js +7 -0
  409. package/vitest.config.js +32 -0
@@ -0,0 +1,27 @@
1
+ import { format, formatDistanceToNow, getTime } from "date-fns";
2
+
3
+ // ----------------------------------------------------------------------
4
+
5
+ export function fDate(date, newFormat) {
6
+ const fm = newFormat || "dd MMM yyyy";
7
+
8
+ return date ? format(new Date(date), fm) : "";
9
+ }
10
+
11
+ export function fDateTime(date, newFormat) {
12
+ const fm = newFormat || "dd MMM yyyy p";
13
+
14
+ return date ? format(new Date(date), fm) : "";
15
+ }
16
+
17
+ export function fTimestamp(date) {
18
+ return date ? getTime(new Date(date)) : "";
19
+ }
20
+
21
+ export function fToNow(date) {
22
+ return date
23
+ ? formatDistanceToNow(new Date(date), {
24
+ addSuffix: true,
25
+ })
26
+ : "";
27
+ }
@@ -0,0 +1,24 @@
1
+ // ----------------------------------------------------------------------
2
+
3
+ export function localStorageAvailable() {
4
+ try {
5
+ const key = "__some_random_key_you_are_not_going_to_use__";
6
+ window.localStorage.setItem(key, key);
7
+ window.localStorage.removeItem(key);
8
+ return true;
9
+ } catch (error) {
10
+ return false;
11
+ }
12
+ }
13
+
14
+ export function localStorageGetItem(key, defaultValue = "") {
15
+ const storageAvailable = localStorageAvailable();
16
+
17
+ let value;
18
+
19
+ if (storageAvailable) {
20
+ value = localStorage.getItem(key) || defaultValue;
21
+ }
22
+
23
+ return value;
24
+ }
@@ -0,0 +1,43 @@
1
+ import { loginWithCognito } from "./cognitoAuth";
2
+ import { useState } from "react";
3
+
4
+ import { Button, Stack, TextField, Typography } from "@mui/material";
5
+
6
+ export default function CognitoLogin() {
7
+ const [username, setUsername] = useState("");
8
+ const [password, setPassword] = useState("");
9
+
10
+ const handleLogin = async () => {
11
+ try {
12
+ const tokens = await loginWithCognito(username, password);
13
+ console.log(tokens);
14
+ localStorage.setItem("link", "accessToken", tokens.AccessToken);
15
+ localStorage.setItem("link", "refreshToken", tokens.RefreshToken);
16
+ window.location.href = "/";
17
+ } catch (e) {
18
+ alert("Login failed");
19
+ }
20
+ };
21
+
22
+ return (
23
+ <>
24
+ <Typography variant="h4">Login</Typography>
25
+ <Stack spacing={2}>
26
+ <TextField
27
+ label="Username or Email"
28
+ value={username}
29
+ onChange={(e) => setUsername(e.target.value)}
30
+ />
31
+ <TextField
32
+ type="password"
33
+ label="Password"
34
+ value={password}
35
+ onChange={(e) => setPassword(e.target.value)}
36
+ />
37
+ <Button variant="contained" onClick={handleLogin}>
38
+ Login
39
+ </Button>
40
+ </Stack>
41
+ </>
42
+ );
43
+ }
@@ -0,0 +1,58 @@
1
+ import Button from "@mui/material/Button";
2
+ import Divider from "@mui/material/Divider";
3
+ import React from "react";
4
+ import Stack from "@mui/material/Stack";
5
+ import Typography from "@mui/material/Typography";
6
+ import config from "../../config/config";
7
+ import { storage } from "@nucleoidjs/webstorage";
8
+ import { useEffect } from "react";
9
+ import { useNavigate } from "react-router-dom";
10
+
11
+ // ----------------------------------------------------------------------
12
+
13
+ export default function Auth0LoginView() {
14
+ const { name, project } = config();
15
+
16
+ const handleOAuthLogin = ({ authUrl, clientId, redirectUri, scope }) => {
17
+ window.location.href = `${authUrl}?client_id=${clientId}&redirect_uri=${redirectUri}&scope=${scope}&response_type=code`;
18
+ };
19
+ const navigate = useNavigate();
20
+
21
+ function token() {
22
+ if (
23
+ storage.get("link", "refreshToken") &&
24
+ storage.get("link", "accessToken")
25
+ ) {
26
+ return true;
27
+ } else {
28
+ return false;
29
+ }
30
+ }
31
+
32
+ useEffect(() => {
33
+ if (token()) {
34
+ navigate("/");
35
+ }
36
+ // eslint-disable-next-line react-hooks/exhaustive-deps
37
+ }, [navigate]);
38
+
39
+ return (
40
+ <>
41
+ <Typography variant="h4" sx={{ mb: 5 }}>
42
+ Sign in to {name}
43
+ </Typography>
44
+ <Divider />
45
+ <Stack spacing={2}>
46
+ <Button
47
+ fullWidth={true}
48
+ color="primary"
49
+ size="large"
50
+ variant="contained"
51
+ onClick={() => handleOAuthLogin({ ...project.github })}
52
+ >
53
+ Login with Github
54
+ </Button>
55
+ </Stack>
56
+ </>
57
+ );
58
+ }
@@ -0,0 +1,26 @@
1
+ import {
2
+ CognitoIdentityProviderClient,
3
+ InitiateAuthCommand,
4
+ } from "@aws-sdk/client-cognito-identity-provider";
5
+
6
+ import config from "../../config/config";
7
+
8
+ const { credentials } = config();
9
+
10
+ const client = new CognitoIdentityProviderClient({
11
+ region: credentials?.region,
12
+ });
13
+
14
+ export async function loginWithCognito(username, password) {
15
+ const command = new InitiateAuthCommand({
16
+ AuthFlow: "USER_PASSWORD_AUTH",
17
+ ClientId: credentials.clientId,
18
+ AuthParameters: {
19
+ USERNAME: username,
20
+ PASSWORD: password,
21
+ },
22
+ });
23
+
24
+ const response = await client.send(command);
25
+ return response.AuthenticationResult;
26
+ }
@@ -0,0 +1,87 @@
1
+ import NucleoidLoginForm from "../../components/NucleoidLoginForm";
2
+ import SocialLoginButtons from "../../components/SocialLoginButtons";
3
+ import Stack from "@mui/material/Stack";
4
+ import config from "../../config/config";
5
+
6
+ import { Box, Divider, Link as MuiLink, Typography } from "@mui/material";
7
+ import React, { useState } from "react";
8
+
9
+ const handleOAuthLogin = (
10
+ { redirectUri, authUrl, clientId, scope },
11
+ identityProvider
12
+ ) => {
13
+ const state = JSON.stringify({
14
+ identityProvider: identityProvider,
15
+ });
16
+ const encodedState = encodeURIComponent(state);
17
+ window.location.href = `${authUrl}?client_id=${clientId}&scope=${scope}&response_type=code&redirect_uri=${redirectUri}&state=${encodedState}`;
18
+ };
19
+
20
+ function LoginForm() {
21
+ const { name, project } = config();
22
+
23
+ const [email, setEmail] = useState("");
24
+ const [password, setPassword] = useState("");
25
+
26
+ const renderHead = (
27
+ <Stack spacing={2} sx={{ mb: 5 }}>
28
+ <Typography variant="h4">Sign in to {name}</Typography>
29
+ {project.nucleoid && (
30
+ <Stack direction="row" spacing={0.5}>
31
+ <Typography variant="body2">New user?</Typography>
32
+
33
+ <MuiLink variant="subtitle2">Create an account</MuiLink>
34
+ </Stack>
35
+ )}
36
+ </Stack>
37
+ );
38
+
39
+ const renderForm = (
40
+ <>
41
+ {!!project.nucleoid && (
42
+ <>
43
+ <NucleoidLoginForm
44
+ email={email}
45
+ password={password}
46
+ setEmail={setEmail}
47
+ setPassword={setPassword}
48
+ // TODO: Add function for login without Oauth 2.0
49
+ onSubmit={() => handleOAuthLogin(config.login.nucleoid)}
50
+ />
51
+ <Typography
52
+ variant="body2"
53
+ sx={{ width: "100%", textAlign: "center" }}
54
+ >
55
+ Don&apos;t have an account ?
56
+ <MuiLink
57
+ href="/console/login2"
58
+ variant="body2"
59
+ sx={{ display: "flex", justifyContent: "center" }}
60
+ >
61
+ Sign Up Now
62
+ </MuiLink>
63
+ </Typography>
64
+
65
+ <Divider sx={{ width: "100%", margin: "1rem 0" }}>
66
+ <Box sx={{ px: 2 }}>or</Box>
67
+ </Divider>
68
+ </>
69
+ )}
70
+ <SocialLoginButtons
71
+ googleEnable={!!project.google}
72
+ onGoogle={() => handleOAuthLogin({ ...project.google }, "google")}
73
+ githubEnable={!!project.github}
74
+ onGithub={() => handleOAuthLogin({ ...project.github }, "github")}
75
+ linkedinEnable={!!project.linkedin}
76
+ onLinkedin={() => handleOAuthLogin({ ...project.linkedin }, "linkedin")}
77
+ />
78
+ </>
79
+ );
80
+
81
+ return (
82
+ <>
83
+ {renderHead} {renderForm}
84
+ </>
85
+ );
86
+ }
87
+ export default LoginForm;
@@ -0,0 +1,43 @@
1
+ const LoginFormStyles = {
2
+ mainBoxStyle: {
3
+ display: "flex",
4
+ flexDirection: "column",
5
+ alignItems: "center",
6
+ padding: "1rem",
7
+ borderRadius: "10px",
8
+ justifyContent: "center",
9
+ },
10
+
11
+ formBoxStyle: {
12
+ display: "flex",
13
+ flexDirection: "column",
14
+ alignItems: "center",
15
+ justifyContent: "center",
16
+ width: "100%",
17
+ },
18
+ signInButtonStyle: {
19
+ margin: "1rem 0 2rem",
20
+ width: "100%",
21
+ color: "#f4f4f4",
22
+ },
23
+ githubButtonStyle: {
24
+ margin: "0.5rem 0 ",
25
+ width: "100%",
26
+ color: "#f4f4f4",
27
+ backgroundColor: "#333",
28
+ },
29
+ googleButtonStyle: {
30
+ margin: "0.5rem 0",
31
+ width: "100%",
32
+ backgroundColor: "#fff",
33
+ color: "#3C3C3C",
34
+ borderColor: "#DB4437",
35
+ },
36
+ linkedinButtonStyle: {
37
+ margin: "0.5rem 0 1rem",
38
+ width: "100%",
39
+ backgroundColor: "#0077b5",
40
+ color: "#f4f4f4",
41
+ },
42
+ };
43
+ export default LoginFormStyles;
@@ -0,0 +1 @@
1
+ export { default } from "./LoginForm";
@@ -0,0 +1,308 @@
1
+ import {
2
+ Avatar,
3
+ Box,
4
+ FormControl,
5
+ Grow,
6
+ IconButton,
7
+ InputLabel,
8
+ List,
9
+ ListItem,
10
+ ListItemAvatar,
11
+ ListItemSecondaryAction,
12
+ ListItemText,
13
+ NativeSelect,
14
+ Stack,
15
+ Tab,
16
+ Tabs,
17
+ TextField,
18
+ Typography,
19
+ } from "@mui/material";
20
+ import { Button, Dialog, DialogActions, DialogContent } from "@mui/material";
21
+ import React, { useEffect, useState } from "react";
22
+
23
+ import Iconify from "../components/Iconify";
24
+ import config from "../config/config";
25
+ import { useEvent } from "@nucleoidai/react-event";
26
+ import useSettings from "../hooks/useSettings";
27
+ import { useUser } from "../hooks/use-user";
28
+
29
+ function a11yProps(index) {
30
+ return {
31
+ id: `vertical-tab-${index}`,
32
+ "aria-controls": `vertical-tabpanel-${index}`,
33
+ };
34
+ }
35
+
36
+ const TabPanel = (props) => {
37
+ const { children, value, index } = props;
38
+
39
+ return <>{value === index && <Box sx={{ pl: 2, pr: 1 }}>{children}</Box>}</>;
40
+ };
41
+
42
+ const SettingsDialogTabs = ({ tabs }) => {
43
+ const [value, setValue] = useState(0);
44
+
45
+ const handleChange = (event, newValue) => {
46
+ setValue(newValue);
47
+ };
48
+
49
+ return (
50
+ <>
51
+ <Box
52
+ sx={{
53
+ flexGrow: 1,
54
+ bgcolor: "background.paper",
55
+ display: "flex",
56
+ height: 515,
57
+ }}
58
+ >
59
+ <Tabs
60
+ value={value}
61
+ onChange={handleChange}
62
+ orientation="vertical"
63
+ variant="scrollable"
64
+ sx={{
65
+ borderRight: 1,
66
+ borderColor: "divider",
67
+ width: 120,
68
+ display: "flex",
69
+ flexDirection: "flex-end",
70
+ ml: -2,
71
+ mt: 1,
72
+ "& .MuiTabs-indicator": {
73
+ backgroundColor: "primary.main",
74
+ height: 3,
75
+ },
76
+ "& .MuiTab-root.Mui-selected": {
77
+ color: "custom.grey",
78
+ bgcolor: "rgba(0,0,0,0.1)",
79
+ borderTopLeftRadius: 8,
80
+ borderBottomLeftRadius: 8,
81
+ },
82
+ "& .MuiTab-root": {
83
+ color: "custom.grey",
84
+ width: 1,
85
+ },
86
+ }}
87
+ >
88
+ <Tab
89
+ label={"Permissions"}
90
+ sx={{ "& label": { color: "custom.grey" } }}
91
+ {...a11yProps(0)}
92
+ />
93
+ <Tab
94
+ label={"Settings"}
95
+ sx={{ "& label": { color: "custom.grey" } }}
96
+ {...a11yProps(1)}
97
+ />
98
+ {tabs?.map((tab, index) => (
99
+ <Tab
100
+ key={tab.label}
101
+ iconPosition="start"
102
+ label={tab.label}
103
+ sx={{ "& label": { color: "custom.grey" } }}
104
+ {...a11yProps(index + 2)}
105
+ />
106
+ ))}
107
+ </Tabs>
108
+ <Box sx={{ width: "100%" }}>
109
+ <TabPanel value={value} index={0}>
110
+ <Permission />
111
+ </TabPanel>
112
+ <TabPanel value={value} index={1}>
113
+ <Settings />
114
+ </TabPanel>
115
+ {tabs?.map((tab, index) => (
116
+ <TabPanel key={tab.label} value={value} index={index + 2}>
117
+ <tab.panel />
118
+ </TabPanel>
119
+ ))}
120
+ </Box>
121
+ </Box>
122
+ </>
123
+ );
124
+ };
125
+
126
+ function SettingsDialog({ handleClose, open }) {
127
+ const { settings } = config().template;
128
+ return (
129
+ <Dialog
130
+ open={open}
131
+ fullWidth
132
+ maxWidth={"md"}
133
+ onClose={() => handleClose()}
134
+ sx={{ bgcolor: "custom.darkDialogBg", zIndex: 2147483647 }}
135
+ PaperProps={{
136
+ style: {
137
+ color: "white",
138
+ minHeight: 600,
139
+ },
140
+ }}
141
+ >
142
+ <DialogContent>
143
+ <Typography variant="h5" sx={{ my: 2 }}>
144
+ Settings
145
+ </Typography>
146
+ <SettingsDialogTabs tabs={settings.tabs} />
147
+ </DialogContent>
148
+ <DialogActions
149
+ sx={{
150
+ borderTop: 1,
151
+ borderColor: "divider",
152
+ display: "flex",
153
+ justifyContent: "flex-end",
154
+ }}
155
+ >
156
+ <Button
157
+ sx={{ color: "white" }}
158
+ autoFocus
159
+ onClick={() => console.log("save")}
160
+ >
161
+ Save
162
+ </Button>
163
+ </DialogActions>
164
+ </Dialog>
165
+ );
166
+ }
167
+
168
+ const Permission = () => {
169
+ const [newUserId, setNewUserId] = useState(null);
170
+ const { getPermittedUsers, users, createPermission, deletePermission } =
171
+ useUser();
172
+ const [event] = useEvent("PERMISSION_CREATED", null);
173
+ const [event2] = useEvent("PERMISSION_DELETED", null);
174
+
175
+ useEffect(() => {
176
+ getPermittedUsers();
177
+ }, [event, event2]);
178
+
179
+ return (
180
+ <Stack direction="column" spacing={2} p={2}>
181
+ <Typography variant="h6">Users</Typography>
182
+ <Typography variant="subtitle2" color="text.secondary">
183
+ Users with access to the project.
184
+ </Typography>
185
+ <List>
186
+ {users?.map((user) => (
187
+ <ListItem
188
+ key={user.id}
189
+ sx={{
190
+ backgroundColor: "background.paper",
191
+ boxShadow: 1,
192
+ borderRadius: 1,
193
+ m: 1,
194
+ p: 2,
195
+ ":hover": { boxShadow: 3 },
196
+ transition: "all 0.2s ease-in-out",
197
+ }}
198
+ >
199
+ <ListItemAvatar>
200
+ <Avatar src={user.avatar_url} alt={user.name} />
201
+ </ListItemAvatar>
202
+ <ListItemText primary={user.name} />
203
+ <ListItemSecondaryAction>
204
+ <IconButton
205
+ onClick={async () => {
206
+ await deletePermission(user.id);
207
+ }}
208
+ sx={{ color: "error.main" }}
209
+ >
210
+ <Iconify icon="solar:trash-bin-minimalistic-bold-duotone" />
211
+ </IconButton>
212
+ </ListItemSecondaryAction>
213
+ </ListItem>
214
+ ))}
215
+ {newUserId !== null && (
216
+ <Grow in={true}>
217
+ <TextField
218
+ label="User ID"
219
+ value={newUserId}
220
+ onChange={(e) => setNewUserId(e.target.value)}
221
+ sx={{ width: "calc(100% - 16px)", m: 1 }}
222
+ />
223
+ </Grow>
224
+ )}
225
+ </List>
226
+ <Button
227
+ variant="contained"
228
+ size="medium"
229
+ fullWidth
230
+ sx={{
231
+ backgroundColor: "primary.main",
232
+ ":hover": { backgroundColor: "primary.dark" },
233
+ }}
234
+ onClick={async () => {
235
+ if (newUserId) {
236
+ await createPermission(newUserId);
237
+ setNewUserId(null);
238
+ } else {
239
+ setNewUserId("");
240
+ }
241
+ }}
242
+ >
243
+ {newUserId ? "Add User" : "Enter User ID"}
244
+ </Button>
245
+ </Stack>
246
+ );
247
+ };
248
+
249
+ const Settings = () => {
250
+ const projectId = localStorage.getItem("projectId");
251
+ const { settings, updateSettings } = useSettings(projectId);
252
+
253
+ const timeZones = [
254
+ "Asia/Kolkata",
255
+ "Asia/Dubai",
256
+ "America/New_York",
257
+ "America/Los_Angeles",
258
+ "Europe/London",
259
+ ];
260
+
261
+ const handleChange = (event) => {
262
+ const newTimeZone = event.target.value;
263
+ updateSettings(projectId, newTimeZone);
264
+ };
265
+
266
+ return (
267
+ <Stack direction="column" spacing={2} p={2}>
268
+ <Typography variant="h6">Settings</Typography>
269
+ <Typography variant="subtitle2" color="text.secondary">
270
+ Configure your application settings.
271
+ </Typography>
272
+ <List>
273
+ <ListItem
274
+ sx={{
275
+ backgroundColor: "background.paper",
276
+ boxShadow: 1,
277
+ borderRadius: 1,
278
+ m: 1,
279
+ p: 2,
280
+ ":hover": { boxShadow: 3 },
281
+ transition: "all 0.2s ease-in-out",
282
+ }}
283
+ >
284
+ <FormControl fullWidth>
285
+ <InputLabel variant="standard" shrink>
286
+ Time Zone
287
+ </InputLabel>
288
+ <NativeSelect
289
+ defaultValue={settings.timeZone || ""}
290
+ onChange={(event) => handleChange(event)}
291
+ >
292
+ <option value="" disabled>
293
+ {settings.timeZone || "Select Time Zone"}
294
+ </option>
295
+ {timeZones.map((time, index) => (
296
+ <option key={index} value={time}>
297
+ {time}
298
+ </option>
299
+ ))}
300
+ </NativeSelect>
301
+ </FormControl>
302
+ </ListItem>
303
+ </List>
304
+ </Stack>
305
+ );
306
+ };
307
+
308
+ export default SettingsDialog;
@@ -0,0 +1 @@
1
+ export { default as NotFoundView } from "./not-found-view";
@@ -0,0 +1,42 @@
1
+ import Button from "@mui/material/Button";
2
+ import { PageNotFoundIllustration } from "../../assets/illustrations";
3
+ import React from "react";
4
+ import { RouterLink } from "../../routes/components";
5
+ import Typography from "@mui/material/Typography";
6
+ import { motion } from "framer-motion";
7
+
8
+ import { MotionContainer, varBounce } from "../../components/animate";
9
+
10
+ // ----------------------------------------------------------------------
11
+
12
+ export default function NotFoundView() {
13
+ return (
14
+ <MotionContainer>
15
+ <motion.div variants={varBounce().in}>
16
+ <Typography variant="h3" sx={{ mb: 2 }}>
17
+ Sorry, Page Not Found!
18
+ </Typography>
19
+ </motion.div>
20
+
21
+ <motion.div variants={varBounce().in}>
22
+ <Typography sx={{ color: "text.secondary" }}>
23
+ Sorry, we couldn’t find the page you’re looking for. Perhaps you’ve
24
+ mistyped the URL? Be sure to check your spelling.
25
+ </Typography>
26
+ </motion.div>
27
+
28
+ <motion.div variants={varBounce().in}>
29
+ <PageNotFoundIllustration
30
+ sx={{
31
+ height: 260,
32
+ my: { xs: 5, sm: 10 },
33
+ }}
34
+ />
35
+ </motion.div>
36
+
37
+ <Button component={RouterLink} href="/" size="large" variant="contained">
38
+ Go to Home
39
+ </Button>
40
+ </MotionContainer>
41
+ );
42
+ }