@codezee/sixtify-brahma 0.1.1

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 (267) hide show
  1. package/.github/workflows/deploy-storybook.yml +40 -0
  2. package/.husky/commit-msg +4 -0
  3. package/.husky/pre-commit +4 -0
  4. package/.husky/pre-push +4 -0
  5. package/.lintstagedrc +5 -0
  6. package/.prettierignore +11 -0
  7. package/.prettierrc +22 -0
  8. package/.vscode/extensions.json +22 -0
  9. package/.vscode/settings.json +17 -0
  10. package/README.md +81 -0
  11. package/apps/docs/.eslintrc.cjs +4 -0
  12. package/apps/docs/.eslintrc.js +9 -0
  13. package/apps/docs/.storybook/main.ts +23 -0
  14. package/apps/docs/.storybook/preview.tsx +27 -0
  15. package/apps/docs/next-env.d.ts +5 -0
  16. package/apps/docs/next.config.mjs +4 -0
  17. package/apps/docs/package.json +38 -0
  18. package/apps/docs/public/globals.css +25 -0
  19. package/apps/docs/stories/AgGrid/AgGrid.stories.tsx +69 -0
  20. package/apps/docs/stories/AppBar/AppBar.stories.tsx +39 -0
  21. package/apps/docs/stories/Breadcrumbs/Breadcrumbs.stories.tsx +37 -0
  22. package/apps/docs/stories/Button/ButtonGroup.stories.tsx +99 -0
  23. package/apps/docs/stories/Button/button.stories.tsx +99 -0
  24. package/apps/docs/stories/Card/AttendanceCard.stories.tsx +37 -0
  25. package/apps/docs/stories/Card/Card.stories.tsx +39 -0
  26. package/apps/docs/stories/Charts/PieChart.stories.tsx +264 -0
  27. package/apps/docs/stories/Chips/Chip.stories.tsx +141 -0
  28. package/apps/docs/stories/Chips/ChipWithBorder.stories.tsx +18 -0
  29. package/apps/docs/stories/Chips/FilterPill.stories.tsx +24 -0
  30. package/apps/docs/stories/Color/Color.stories.tsx +14 -0
  31. package/apps/docs/stories/Dialog/ButtomDialog.stories.tsx +47 -0
  32. package/apps/docs/stories/Dialog/DeleteDialog.stories.tsx +31 -0
  33. package/apps/docs/stories/Dialog/Dialog.stories.tsx +47 -0
  34. package/apps/docs/stories/Drawer/Drawer.stories.tsx +94 -0
  35. package/apps/docs/stories/FilterList/FilterList.stories.tsx +88 -0
  36. package/apps/docs/stories/FilterList/FilterListV2.stories.tsx +92 -0
  37. package/apps/docs/stories/FormFields/AutoComplete.stories.tsx +87 -0
  38. package/apps/docs/stories/FormFields/CheckBox.stories.tsx +61 -0
  39. package/apps/docs/stories/FormFields/DatePicker.stories.tsx +98 -0
  40. package/apps/docs/stories/FormFields/DateRangePicker.stories.tsx +37 -0
  41. package/apps/docs/stories/FormFields/FileUpload.stories.tsx +83 -0
  42. package/apps/docs/stories/FormFields/ImageUpload.stories.tsx +69 -0
  43. package/apps/docs/stories/FormFields/ListItemButton.stories.tsx +59 -0
  44. package/apps/docs/stories/FormFields/RadioGroupField.stories.tsx +170 -0
  45. package/apps/docs/stories/FormFields/SearchField.stories.tsx +72 -0
  46. package/apps/docs/stories/FormFields/TextField.stories.tsx +111 -0
  47. package/apps/docs/stories/FormFields/TimeField.stories.tsx +82 -0
  48. package/apps/docs/stories/FormFields/TimePicker.stories.tsx +82 -0
  49. package/apps/docs/stories/Indicator/Indicator.stories.tsx +33 -0
  50. package/apps/docs/stories/Indicator/SeverityIndicator.stories.tsx +27 -0
  51. package/apps/docs/stories/Layouts/FormRow.stories.tsx +45 -0
  52. package/apps/docs/stories/PadBox/PadBox.stories.tsx +49 -0
  53. package/apps/docs/stories/Stepper/Stepper.stories.tsx +75 -0
  54. package/apps/docs/stories/Stepper/StepperV2.stories.tsx +44 -0
  55. package/apps/docs/stories/Timeline/AttendanceStatus.stories.tsx +29 -0
  56. package/apps/docs/stories/Timeline/Timeline.stories.tsx +38 -0
  57. package/apps/docs/stories/Tooltip/Tooltip.stories.tsx +30 -0
  58. package/apps/docs/stories/UserProfileMenu/UserProfileMenu.stories.tsx +112 -0
  59. package/apps/docs/tsconfig.json +19 -0
  60. package/commitlint.config.cjs +6 -0
  61. package/index.ts +1 -0
  62. package/package.json +74 -0
  63. package/packages/eslint-config/README.md +3 -0
  64. package/packages/eslint-config/library.js +88 -0
  65. package/packages/eslint-config/next.js +85 -0
  66. package/packages/eslint-config/package.json +19 -0
  67. package/packages/eslint-config/react-internal.js +89 -0
  68. package/packages/shared-components/.eslintrc.js +10 -0
  69. package/packages/shared-components/package.json +22 -0
  70. package/packages/shared-components/src/Actions/AddAction.tsx +13 -0
  71. package/packages/shared-components/src/Actions/CalendarAction.tsx +13 -0
  72. package/packages/shared-components/src/Actions/DeleteAction.tsx +13 -0
  73. package/packages/shared-components/src/Actions/DownloadAction.tsx +13 -0
  74. package/packages/shared-components/src/Actions/EditAction.tsx +13 -0
  75. package/packages/shared-components/src/Actions/HistoryAction.tsx +13 -0
  76. package/packages/shared-components/src/Actions/index.ts +6 -0
  77. package/packages/shared-components/src/AgGrid/ActionCell/ActionCell.tsx +55 -0
  78. package/packages/shared-components/src/AgGrid/ActionCell/Popover.tsx +32 -0
  79. package/packages/shared-components/src/AgGrid/AgGrid.tsx +87 -0
  80. package/packages/shared-components/src/AgGrid/LoadingCell.tsx +5 -0
  81. package/packages/shared-components/src/AgGrid/index.ts +3 -0
  82. package/packages/shared-components/src/AppBar/AppBar.styled.tsx +25 -0
  83. package/packages/shared-components/src/AppBar/AppBar.tsx +20 -0
  84. package/packages/shared-components/src/AppBar/index.ts +1 -0
  85. package/packages/shared-components/src/Breadcrumbs/Breadcrumbs.tsx +76 -0
  86. package/packages/shared-components/src/Breadcrumbs/index.ts +1 -0
  87. package/packages/shared-components/src/Button/ActionButton.tsx +38 -0
  88. package/packages/shared-components/src/Button/Button.tsx +19 -0
  89. package/packages/shared-components/src/Button/ButtonGroup.tsx +37 -0
  90. package/packages/shared-components/src/Button/index.ts +3 -0
  91. package/packages/shared-components/src/Card/AttendanceCard.tsx +51 -0
  92. package/packages/shared-components/src/Card/Card.tsx +34 -0
  93. package/packages/shared-components/src/Card/CardItem/CardItem.tsx +33 -0
  94. package/packages/shared-components/src/Card/CardItem/CardItemValue.tsx +98 -0
  95. package/packages/shared-components/src/Card/CardItem/index.ts +2 -0
  96. package/packages/shared-components/src/Card/ProfileCard/ProfileCard.tsx +40 -0
  97. package/packages/shared-components/src/Card/ProfileCard/ProfileCardItem/ProfileCardBody.tsx +53 -0
  98. package/packages/shared-components/src/Card/ProfileCard/ProfileCardItem/ProfileCardHeader.tsx +96 -0
  99. package/packages/shared-components/src/Card/index.ts +6 -0
  100. package/packages/shared-components/src/Charts/PieChart.tsx +69 -0
  101. package/packages/shared-components/src/Charts/index.ts +1 -0
  102. package/packages/shared-components/src/Chips/Chip.tsx +26 -0
  103. package/packages/shared-components/src/Chips/ChipWithBorder.tsx +39 -0
  104. package/packages/shared-components/src/Chips/FilterPill.tsx +47 -0
  105. package/packages/shared-components/src/Chips/index.ts +3 -0
  106. package/packages/shared-components/src/Dialog/BottomDialog.styled.tsx +28 -0
  107. package/packages/shared-components/src/Dialog/BottomDialog.tsx +37 -0
  108. package/packages/shared-components/src/Dialog/DeleteDialog.tsx +48 -0
  109. package/packages/shared-components/src/Dialog/Dialog.tsx +61 -0
  110. package/packages/shared-components/src/Dialog/index.ts +3 -0
  111. package/packages/shared-components/src/Drawer/Bullet.tsx +12 -0
  112. package/packages/shared-components/src/Drawer/CloseDrawer/CloseDrawerMenuItem.tsx +50 -0
  113. package/packages/shared-components/src/Drawer/CloseDrawer/CloseDrawerMenuItemList.tsx +105 -0
  114. package/packages/shared-components/src/Drawer/CloseDrawer/CloseDrawerSubMenuItemList.tsx +125 -0
  115. package/packages/shared-components/src/Drawer/CloseDrawer/MenuItem.tsx +0 -0
  116. package/packages/shared-components/src/Drawer/CloseDrawer/Popover.tsx +45 -0
  117. package/packages/shared-components/src/Drawer/CloseDrawer/Popper.tsx +43 -0
  118. package/packages/shared-components/src/Drawer/Drawer.styled.tsx +51 -0
  119. package/packages/shared-components/src/Drawer/Drawer.tsx +55 -0
  120. package/packages/shared-components/src/Drawer/MenuItem.tsx +69 -0
  121. package/packages/shared-components/src/Drawer/OpenDrawer/OpenDrawerCollapse.tsx +13 -0
  122. package/packages/shared-components/src/Drawer/OpenDrawer/OpenDrawerMenuItem.tsx +46 -0
  123. package/packages/shared-components/src/Drawer/OpenDrawer/OpenDrawerMenuItemList.tsx +249 -0
  124. package/packages/shared-components/src/Drawer/index.ts +1 -0
  125. package/packages/shared-components/src/FilterList/FilterList.tsx +172 -0
  126. package/packages/shared-components/src/FilterList/FilterListV2.tsx +504 -0
  127. package/packages/shared-components/src/FilterList/FilterPopup.tsx +148 -0
  128. package/packages/shared-components/src/FilterList/FilterPopupWrapper.tsx +113 -0
  129. package/packages/shared-components/src/FilterList/FilterTypeWrapper.tsx +58 -0
  130. package/packages/shared-components/src/FilterList/getFormData.ts +29 -0
  131. package/packages/shared-components/src/FilterList/index.ts +3 -0
  132. package/packages/shared-components/src/FormFields/Autocomplete/Autocomplete.tsx +428 -0
  133. package/packages/shared-components/src/FormFields/Autocomplete/Skeleton.tsx +26 -0
  134. package/packages/shared-components/src/FormFields/Autocomplete/index.ts +1 -0
  135. package/packages/shared-components/src/FormFields/CheckBox/CheckBox.styled.tsx +67 -0
  136. package/packages/shared-components/src/FormFields/CheckBox/CheckBox.tsx +44 -0
  137. package/packages/shared-components/src/FormFields/CheckBox/Skeleton.tsx +12 -0
  138. package/packages/shared-components/src/FormFields/CheckBox/index.ts +1 -0
  139. package/packages/shared-components/src/FormFields/DatePicker/DatePicker.tsx +206 -0
  140. package/packages/shared-components/src/FormFields/DatePicker/Skeleton.tsx +21 -0
  141. package/packages/shared-components/src/FormFields/DatePicker/index.ts +1 -0
  142. package/packages/shared-components/src/FormFields/DateRangePicker/DateRangePicker.tsx +96 -0
  143. package/packages/shared-components/src/FormFields/DateRangePicker/Skeleton.tsx +38 -0
  144. package/packages/shared-components/src/FormFields/DateRangePicker/index.ts +1 -0
  145. package/packages/shared-components/src/FormFields/DateTimePicker/DateTimePicker.tsx +245 -0
  146. package/packages/shared-components/src/FormFields/DateTimePicker/Skeleton.tsx +24 -0
  147. package/packages/shared-components/src/FormFields/DateTimePicker/index.ts +1 -0
  148. package/packages/shared-components/src/FormFields/FileUpload/FileUpload.styled.tsx +22 -0
  149. package/packages/shared-components/src/FormFields/FileUpload/FileUpload.tsx +197 -0
  150. package/packages/shared-components/src/FormFields/FileUpload/Skeleton.tsx +21 -0
  151. package/packages/shared-components/src/FormFields/FileUpload/UploadedFileName.tsx +27 -0
  152. package/packages/shared-components/src/FormFields/FileUpload/index.ts +1 -0
  153. package/packages/shared-components/src/FormFields/ImageUpload/ImageUpload.styled.tsx +16 -0
  154. package/packages/shared-components/src/FormFields/ImageUpload/ImageUpload.tsx +181 -0
  155. package/packages/shared-components/src/FormFields/ImageUpload/ImageUploadView.tsx +65 -0
  156. package/packages/shared-components/src/FormFields/ImageUpload/PhotoCaptureDialog.tsx +74 -0
  157. package/packages/shared-components/src/FormFields/ImageUpload/Skeleton.tsx +31 -0
  158. package/packages/shared-components/src/FormFields/ImageUpload/index.ts +2 -0
  159. package/packages/shared-components/src/FormFields/ListItemButton/ListItemButton.styled.tsx +22 -0
  160. package/packages/shared-components/src/FormFields/ListItemButton/ListItemButton.tsx +37 -0
  161. package/packages/shared-components/src/FormFields/ListItemButton/index.ts +1 -0
  162. package/packages/shared-components/src/FormFields/PasswordField/PasswordField.tsx +50 -0
  163. package/packages/shared-components/src/FormFields/PasswordField/index.ts +1 -0
  164. package/packages/shared-components/src/FormFields/RadioGroupField/RadioGroupField.tsx +105 -0
  165. package/packages/shared-components/src/FormFields/RadioGroupField/Skeleton.tsx +26 -0
  166. package/packages/shared-components/src/FormFields/RadioGroupField/index.ts +1 -0
  167. package/packages/shared-components/src/FormFields/SearchField/SearchField.tsx +21 -0
  168. package/packages/shared-components/src/FormFields/SearchField/index.ts +1 -0
  169. package/packages/shared-components/src/FormFields/Switch/Skeleton.tsx +12 -0
  170. package/packages/shared-components/src/FormFields/Switch/Switch.tsx +33 -0
  171. package/packages/shared-components/src/FormFields/Switch/index.ts +1 -0
  172. package/packages/shared-components/src/FormFields/TextField/Skeleton.tsx +26 -0
  173. package/packages/shared-components/src/FormFields/TextField/TextField.tsx +92 -0
  174. package/packages/shared-components/src/FormFields/TextField/index.ts +1 -0
  175. package/packages/shared-components/src/FormFields/TimeField/Skeleton.tsx +24 -0
  176. package/packages/shared-components/src/FormFields/TimeField/TimeField.tsx +120 -0
  177. package/packages/shared-components/src/FormFields/TimeField/index.ts +1 -0
  178. package/packages/shared-components/src/FormFields/TimePicker/Skeleton.tsx +24 -0
  179. package/packages/shared-components/src/FormFields/TimePicker/TimePicker.tsx +162 -0
  180. package/packages/shared-components/src/FormFields/TimePicker/index.ts +1 -0
  181. package/packages/shared-components/src/FormFields/index.ts +13 -0
  182. package/packages/shared-components/src/Indicator/Indicator.tsx +17 -0
  183. package/packages/shared-components/src/Indicator/SeverityIndicator.tsx +34 -0
  184. package/packages/shared-components/src/Indicator/index.ts +2 -0
  185. package/packages/shared-components/src/Layouts/FormContainer.tsx +6 -0
  186. package/packages/shared-components/src/Layouts/FormRow/FormRow.styled.tsx +39 -0
  187. package/packages/shared-components/src/Layouts/FormRow/FormRow.tsx +20 -0
  188. package/packages/shared-components/src/Layouts/FormRow/index.ts +1 -0
  189. package/packages/shared-components/src/Layouts/FormSection.tsx +22 -0
  190. package/packages/shared-components/src/Layouts/index.ts +3 -0
  191. package/packages/shared-components/src/Loader/FacebookCircularProgress.tsx +41 -0
  192. package/packages/shared-components/src/Loader/index.ts +1 -0
  193. package/packages/shared-components/src/PadBox/PadBox.tsx +21 -0
  194. package/packages/shared-components/src/PadBox/index.ts +1 -0
  195. package/packages/shared-components/src/Stepper/Stepper.tsx +54 -0
  196. package/packages/shared-components/src/Stepper/StepperV2.tsx +115 -0
  197. package/packages/shared-components/src/Stepper/StepperV3.tsx +72 -0
  198. package/packages/shared-components/src/Stepper/index.ts +3 -0
  199. package/packages/shared-components/src/Svgs/AppLogo/AppLogoMedium.tsx +65 -0
  200. package/packages/shared-components/src/Svgs/AppLogo/AppLogoSmall.tsx +48 -0
  201. package/packages/shared-components/src/Svgs/ArrowUp.tsx +11 -0
  202. package/packages/shared-components/src/Svgs/Company/CompanyBanner.tsx +480 -0
  203. package/packages/shared-components/src/Svgs/Company/index.ts +1 -0
  204. package/packages/shared-components/src/Svgs/Drawer/SettingIcon.tsx +51 -0
  205. package/packages/shared-components/src/Svgs/Drawer/SvgsEmployees.tsx +25 -0
  206. package/packages/shared-components/src/Svgs/Drawer/SvgsOrganization.tsx +36 -0
  207. package/packages/shared-components/src/Svgs/Drawer/SvgsTransaction.tsx +79 -0
  208. package/packages/shared-components/src/Svgs/Drawer/index.ts +4 -0
  209. package/packages/shared-components/src/Svgs/FormAction.tsx +118 -0
  210. package/packages/shared-components/src/Svgs/LogoIcon.tsx +74 -0
  211. package/packages/shared-components/src/Svgs/SvgAdd.tsx +28 -0
  212. package/packages/shared-components/src/Svgs/SvgCalendar.tsx +89 -0
  213. package/packages/shared-components/src/Svgs/SvgDelete.tsx +55 -0
  214. package/packages/shared-components/src/Svgs/SvgDownload.tsx +20 -0
  215. package/packages/shared-components/src/Svgs/SvgFilterList.tsx +19 -0
  216. package/packages/shared-components/src/Svgs/SvgNoLogo.tsx +66 -0
  217. package/packages/shared-components/src/Svgs/SvgNoSign.tsx +28 -0
  218. package/packages/shared-components/src/Svgs/SvgsDrop.tsx +44 -0
  219. package/packages/shared-components/src/Svgs/SvgsEdit.tsx +42 -0
  220. package/packages/shared-components/src/Svgs/SvgsHistory.tsx +40 -0
  221. package/packages/shared-components/src/Svgs/SvgsHome.tsx +16 -0
  222. package/packages/shared-components/src/Svgs/SvgsIndicator.tsx +20 -0
  223. package/packages/shared-components/src/Svgs/index.ts +12 -0
  224. package/packages/shared-components/src/Tab/Skeleton.tsx +15 -0
  225. package/packages/shared-components/src/Tab/Tabs.tsx +64 -0
  226. package/packages/shared-components/src/Tab/index.ts +1 -0
  227. package/packages/shared-components/src/Timeline/AttendanceStatus.tsx +56 -0
  228. package/packages/shared-components/src/Timeline/Timeline.tsx +171 -0
  229. package/packages/shared-components/src/Timeline/TimelineTrackSegments.tsx +121 -0
  230. package/packages/shared-components/src/Timeline/index.ts +2 -0
  231. package/packages/shared-components/src/Toast/Toast.tsx +59 -0
  232. package/packages/shared-components/src/Toast/ToastBody.tsx +26 -0
  233. package/packages/shared-components/src/Toast/ToastFooterLink.tsx +19 -0
  234. package/packages/shared-components/src/Toast/Toaster.styled.tsx +76 -0
  235. package/packages/shared-components/src/Toast/Toaster.tsx +21 -0
  236. package/packages/shared-components/src/Toast/index.ts +3 -0
  237. package/packages/shared-components/src/Toast/toasts.tsx +28 -0
  238. package/packages/shared-components/src/Toast/types.ts +13 -0
  239. package/packages/shared-components/src/Tooltip/Tooltip.tsx +36 -0
  240. package/packages/shared-components/src/Tooltip/index.ts +1 -0
  241. package/packages/shared-components/src/UserProfileMenu/UserProfileMenu.styled.tsx +37 -0
  242. package/packages/shared-components/src/UserProfileMenu/UserProfileMenu.tsx +107 -0
  243. package/packages/shared-components/src/UserProfileMenu/index.ts +1 -0
  244. package/packages/shared-components/src/index.ts +24 -0
  245. package/packages/shared-components/src/utils/colorVariant.ts +142 -0
  246. package/packages/shared-components/src/utils/date.ts +11 -0
  247. package/packages/shared-components/src/utils/file.ts +20 -0
  248. package/packages/shared-components/src/utils/fileSizeValidate.ts +5 -0
  249. package/packages/shared-components/src/utils/index.ts +5 -0
  250. package/packages/shared-components/src/utils/theme/colorPalette.ts +110 -0
  251. package/packages/shared-components/src/utils/theme/colorPaletteUI.tsx +44 -0
  252. package/packages/shared-components/src/utils/theme/paletteDark.ts +10 -0
  253. package/packages/shared-components/src/utils/theme/paletteLight.ts +31 -0
  254. package/packages/shared-components/src/utils/theme/theme.ts +289 -0
  255. package/packages/shared-components/src/utils/theme/types.ts +18 -0
  256. package/packages/shared-components/src/utils/theme/typography.ts +52 -0
  257. package/packages/shared-components/src/utils/urlToNestedObject.ts +9 -0
  258. package/packages/shared-components/tsconfig.json +8 -0
  259. package/packages/shared-components/tsconfig.lint.json +8 -0
  260. package/packages/shared-components/turbo/generators/config.ts +33 -0
  261. package/packages/shared-components/turbo/generators/templates/component.hbs +8 -0
  262. package/packages/typescript-config/base.json +20 -0
  263. package/packages/typescript-config/nextjs.json +13 -0
  264. package/packages/typescript-config/package.json +9 -0
  265. package/packages/typescript-config/react-library.json +8 -0
  266. package/pnpm-workspace.yaml +3 -0
  267. package/turbo.json +44 -0
@@ -0,0 +1,88 @@
1
+ const { resolve } = require("node:path");
2
+
3
+ const project = resolve(process.cwd(), "tsconfig.json");
4
+
5
+ /** @type {import("eslint").Linter.Config} */
6
+ module.exports = {
7
+ extends: [
8
+ "eslint:recommended",
9
+ "plugin:react/recommended",
10
+ "prettier",
11
+ "turbo",
12
+ "plugin:@typescript-eslint/recommended",
13
+ "plugin:sonarjs/recommended-legacy",
14
+ "plugin:import/recommended",
15
+ ],
16
+ plugins: ["sonarjs", "import"],
17
+
18
+ globals: {
19
+ React: true,
20
+ JSX: true,
21
+ },
22
+ env: {
23
+ node: true,
24
+ },
25
+ settings: {
26
+ react: {
27
+ version: "detect",
28
+ },
29
+ "import/resolver": {
30
+ typescript: {
31
+ project,
32
+ },
33
+ },
34
+ },
35
+ ignorePatterns: [".*.js", "node_modules/", "dist/"],
36
+ overrides: [
37
+ {
38
+ files: ["*.js?(x)", "*.ts?(x)"],
39
+ },
40
+ ],
41
+ rules: {
42
+ "@typescript-eslint/consistent-type-definitions": ["error", "type"],
43
+ "react/jsx-curly-brace-presence": [
44
+ "error",
45
+ { props: "never", children: "never" },
46
+ ],
47
+ "object-shorthand": ["error", "always"],
48
+ "import/no-duplicates": ["error"],
49
+ curly: "error",
50
+ quotes: ["error", "double"],
51
+ "import/no-default-export": "off",
52
+ "sonarjs/todo-tag": "off",
53
+ "no-template-curly-in-string": "error",
54
+ "@typescript-eslint/consistent-type-imports": "error",
55
+ "no-use-before-define": "error",
56
+ "no-console": "error",
57
+ "no-empty-function": "error",
58
+ "no-lone-blocks": "error",
59
+ "no-lonely-if": "error",
60
+ "no-else-return": "error",
61
+ "padding-line-between-statements": [
62
+ "error",
63
+ { blankLine: "always", prev: ["case", "default"], next: "*" },
64
+ { blankLine: "always", prev: "directive", next: "*" },
65
+ { blankLine: "any", prev: "directive", next: "directive" },
66
+ {
67
+ blankLine: "always",
68
+ prev: ["var", "let", "const"],
69
+ next: "*",
70
+ },
71
+ {
72
+ blankLine: "always",
73
+ prev: "*",
74
+ next: ["var", "let", "const"],
75
+ },
76
+ {
77
+ blankLine: "always",
78
+ prev: "*",
79
+ next: "return",
80
+ },
81
+ {
82
+ blankLine: "always",
83
+ prev: "*",
84
+ next: "if",
85
+ },
86
+ ],
87
+ },
88
+ };
@@ -0,0 +1,85 @@
1
+ const { resolve } = require("node:path");
2
+
3
+ const project = resolve(process.cwd(), "tsconfig.json");
4
+
5
+ /** @type {import("eslint").Linter.Config} */
6
+ module.exports = {
7
+ extends: [
8
+ "eslint:recommended",
9
+ "plugin:react/recommended",
10
+ "plugin:sonarjs/recommended-legacy",
11
+ "prettier",
12
+ require.resolve("@vercel/style-guide/eslint/next"),
13
+ "plugin:@typescript-eslint/recommended",
14
+ "turbo",
15
+ "plugin:import/recommended",
16
+ ],
17
+ plugins: ["sonarjs", "import"],
18
+ globals: {
19
+ React: true,
20
+ JSX: true,
21
+ },
22
+ env: {
23
+ node: true,
24
+ browser: true,
25
+ },
26
+ settings: {
27
+ react: {
28
+ version: "detect",
29
+ },
30
+
31
+ "import/resolver": {
32
+ typescript: {
33
+ project,
34
+ },
35
+ },
36
+ },
37
+ ignorePatterns: [".*.js", "node_modules/"],
38
+ overrides: [{ files: ["*.js?(x)", "*.ts?(x)"] }],
39
+ rules: {
40
+ "@typescript-eslint/consistent-type-definitions": ["error", "type"],
41
+ "react/jsx-curly-brace-presence": [
42
+ "error",
43
+ { props: "never", children: "never" },
44
+ ],
45
+ "object-shorthand": ["error", "always"],
46
+ curly: "error",
47
+ quotes: ["error", "double"],
48
+ "import/no-duplicates": ["error"],
49
+ "@typescript-eslint/consistent-type-imports": "error",
50
+ "no-template-curly-in-string": "error",
51
+ "no-use-before-define": "error",
52
+ "no-console": "error",
53
+ "no-empty-function": "error",
54
+ "no-lone-blocks": "error",
55
+ "no-lonely-if": "error",
56
+ "sonarjs/todo-tag": "off",
57
+ "no-else-return": "error",
58
+ "padding-line-between-statements": [
59
+ "error",
60
+ { blankLine: "always", prev: ["case", "default"], next: "*" },
61
+ { blankLine: "always", prev: "directive", next: "*" },
62
+ { blankLine: "any", prev: "directive", next: "directive" },
63
+ {
64
+ blankLine: "always",
65
+ prev: ["var", "let", "const"],
66
+ next: "*",
67
+ },
68
+ {
69
+ blankLine: "always",
70
+ prev: "*",
71
+ next: ["var", "let", "const"],
72
+ },
73
+ {
74
+ blankLine: "always",
75
+ prev: "*",
76
+ next: "return",
77
+ },
78
+ {
79
+ blankLine: "always",
80
+ prev: "*",
81
+ next: "if",
82
+ },
83
+ ],
84
+ },
85
+ };
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "@repo/eslint-config",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "files": [
6
+ "library.js",
7
+ "next.js",
8
+ "react-internal.js"
9
+ ],
10
+ "devDependencies": {
11
+ "@vercel/style-guide": "^5.2.0",
12
+ "eslint-config-turbo": "^2.0.0",
13
+ "eslint-config-prettier": "^9.1.0",
14
+ "eslint-plugin-only-warn": "^1.1.0",
15
+ "@typescript-eslint/parser": "^7.1.0",
16
+ "@typescript-eslint/eslint-plugin": "^7.1.0",
17
+ "typescript": "^5.3.3"
18
+ }
19
+ }
@@ -0,0 +1,89 @@
1
+ const { resolve } = require("node:path");
2
+
3
+ const project = resolve(process.cwd(), "tsconfig.json");
4
+
5
+ /*
6
+ * This is a custom ESLint configuration for use with
7
+ * internal (bundled by their consumer) libraries
8
+ * that utilize React.
9
+ */
10
+
11
+ /** @type {import("eslint").Linter.Config} */
12
+ module.exports = {
13
+ extends: [
14
+ "eslint:recommended",
15
+ "plugin:react/recommended",
16
+ "prettier",
17
+ "turbo",
18
+ "plugin:@typescript-eslint/recommended",
19
+ "plugin:sonarjs/recommended-legacy",
20
+ "plugin:import/recommended",
21
+ ],
22
+ plugins: ["sonarjs", "import"],
23
+ globals: {
24
+ React: true,
25
+ JSX: true,
26
+ },
27
+ env: {
28
+ browser: true,
29
+ },
30
+ settings: {
31
+ react: {
32
+ version: "detect",
33
+ },
34
+ "import/resolver": {
35
+ typescript: {
36
+ project,
37
+ },
38
+ },
39
+ },
40
+ ignorePatterns: [".*.js", "node_modules/", "dist/"],
41
+ overrides: [{ files: ["*.js?(x)", "*.ts?(x)"] }],
42
+ rules: {
43
+ "@typescript-eslint/consistent-type-definitions": ["error", "type"],
44
+ "import/no-duplicates": ["error"],
45
+ "react/jsx-curly-brace-presence": [
46
+ "error",
47
+ { props: "never", children: "never" },
48
+ ],
49
+ "object-shorthand": ["error", "always"],
50
+ curly: "error",
51
+ quotes: ["error", "double"],
52
+ "import/no-default-export": "error",
53
+ "no-template-curly-in-string": "error",
54
+ "sonarjs/todo-tag": "off",
55
+ "no-use-before-define": "error",
56
+ "@typescript-eslint/consistent-type-imports": "error",
57
+ "no-console": "error",
58
+ "no-empty-function": "error",
59
+ "no-lone-blocks": "error",
60
+ "no-lonely-if": "error",
61
+ "no-else-return": "error",
62
+ "padding-line-between-statements": [
63
+ "error",
64
+ { blankLine: "always", prev: ["case", "default"], next: "*" },
65
+ { blankLine: "always", prev: "directive", next: "*" },
66
+ { blankLine: "any", prev: "directive", next: "directive" },
67
+ {
68
+ blankLine: "always",
69
+ prev: ["var", "let", "const"],
70
+ next: "*",
71
+ },
72
+ {
73
+ blankLine: "always",
74
+ prev: "*",
75
+ next: ["var", "let", "const"],
76
+ },
77
+ {
78
+ blankLine: "always",
79
+ prev: "*",
80
+ next: "return",
81
+ },
82
+ {
83
+ blankLine: "always",
84
+ prev: "*",
85
+ next: "if",
86
+ },
87
+ ],
88
+ },
89
+ };
@@ -0,0 +1,10 @@
1
+ /** @type {import("eslint").Linter.Config} */
2
+ module.exports = {
3
+ root: true,
4
+ extends: ["@repo/eslint-config/react-internal.js"],
5
+ parser: "@typescript-eslint/parser",
6
+ parserOptions: {
7
+ project: "./tsconfig.lint.json",
8
+ tsconfigRootDir: __dirname,
9
+ },
10
+ };
@@ -0,0 +1,22 @@
1
+ {
2
+ "devDependencies": {
3
+ "@repo/eslint-config": "workspace:*",
4
+ "@repo/typescript-config": "workspace:*",
5
+ "@turbo/gen": "^1.12.4",
6
+ "@types/eslint": "^8.56.5",
7
+ "@types/node": "^20.11.24",
8
+ "@types/react": "^18.2.61",
9
+ "@types/react-dom": "^18.2.19",
10
+ "eslint": "^8.57.0",
11
+ "react": "^18.2.0",
12
+ "typescript": "^5.3.3"
13
+ },
14
+ "main": "src/index.ts",
15
+ "name": "@repo/shared-components",
16
+ "private": true,
17
+ "scripts": {
18
+ "generate:component": "turbo gen react-component",
19
+ "lint": "eslint . --max-warnings 0"
20
+ },
21
+ "version": "0.0.0"
22
+ }
@@ -0,0 +1,13 @@
1
+ import type { IconButtonProps } from "@mui/material";
2
+ import { IconButton } from "@mui/material";
3
+ import { SvgAdd } from "../Svgs";
4
+
5
+ export type AddActionProps = IconButtonProps;
6
+
7
+ export const AddAction = (props: AddActionProps) => {
8
+ return (
9
+ <IconButton {...props}>
10
+ <SvgAdd />
11
+ </IconButton>
12
+ );
13
+ };
@@ -0,0 +1,13 @@
1
+ import type { IconButtonProps } from "@mui/material";
2
+ import { IconButton } from "@mui/material";
3
+ import { SvgCalendar } from "../Svgs";
4
+
5
+ export type CalendarActionProps = IconButtonProps;
6
+
7
+ export const CalendarAction = (props: CalendarActionProps) => {
8
+ return (
9
+ <IconButton sx={{ color: "#4C5D70" }} {...props}>
10
+ <SvgCalendar />
11
+ </IconButton>
12
+ );
13
+ };
@@ -0,0 +1,13 @@
1
+ import type { IconButtonProps } from "@mui/material";
2
+ import { IconButton } from "@mui/material";
3
+ import { SvgDelete } from "../Svgs/SvgDelete";
4
+
5
+ export type DeleteActionProps = IconButtonProps;
6
+
7
+ export const DeleteAction = (props: DeleteActionProps) => {
8
+ return (
9
+ <IconButton {...props}>
10
+ <SvgDelete />
11
+ </IconButton>
12
+ );
13
+ };
@@ -0,0 +1,13 @@
1
+ import type { IconButtonProps } from "@mui/material";
2
+ import { IconButton } from "@mui/material";
3
+ import { SvgDownload } from "../Svgs";
4
+
5
+ export type DownloadActionProps = IconButtonProps;
6
+
7
+ export const DownloadAction = (props: DownloadActionProps) => {
8
+ return (
9
+ <IconButton {...props}>
10
+ <SvgDownload />
11
+ </IconButton>
12
+ );
13
+ };
@@ -0,0 +1,13 @@
1
+ import type { IconButtonProps } from "@mui/material";
2
+ import { IconButton } from "@mui/material";
3
+ import { SvgsEdit } from "../Svgs/SvgsEdit";
4
+
5
+ export type EditActionProps = IconButtonProps;
6
+
7
+ export const EditAction = (props: EditActionProps) => {
8
+ return (
9
+ <IconButton {...props}>
10
+ <SvgsEdit />
11
+ </IconButton>
12
+ );
13
+ };
@@ -0,0 +1,13 @@
1
+ import type { IconButtonProps } from "@mui/material";
2
+ import { IconButton } from "@mui/material";
3
+ import { SvgsHistory } from "../Svgs/SvgsHistory";
4
+
5
+ export type HistoryActionProps = IconButtonProps;
6
+
7
+ export const HistoryAction = (props: HistoryActionProps) => {
8
+ return (
9
+ <IconButton {...props}>
10
+ <SvgsHistory />
11
+ </IconButton>
12
+ );
13
+ };
@@ -0,0 +1,6 @@
1
+ export * from "./CalendarAction";
2
+ export * from "./DeleteAction";
3
+ export * from "./DownloadAction";
4
+ export * from "./EditAction";
5
+ export * from "./HistoryAction";
6
+ export * from "./AddAction";
@@ -0,0 +1,55 @@
1
+ import MoreVertIcon from "@mui/icons-material/MoreVert";
2
+ import { Box, IconButton, ListItemButton, Stack } from "@mui/material";
3
+ import { type MouseEvent, useState } from "react";
4
+ import { PadBox } from "../../PadBox";
5
+ import { Popover } from "./Popover";
6
+
7
+ type AgGridActionColumn = {
8
+ title: string;
9
+ onClick: () => void;
10
+ };
11
+
12
+ type ActionColumnProps = {
13
+ items: AgGridActionColumn[];
14
+ };
15
+ export const ActionCell = ({ items }: ActionColumnProps) => {
16
+ const [anchorEl, setAnchorEl] = useState<HTMLDivElement | null>(null);
17
+
18
+ const HandleClose = () => {
19
+ setAnchorEl(null);
20
+ };
21
+
22
+ const HandleClick = (event: MouseEvent<HTMLDivElement>) => {
23
+ setAnchorEl(event.currentTarget);
24
+ };
25
+
26
+ return (
27
+ <Box sx={{ width: "100%" }}>
28
+ <IconButton
29
+ component="div"
30
+ sx={{ cursor: "pointer", alignItems: "center", width: "100%" }}
31
+ onClick={HandleClick}
32
+ >
33
+ <MoreVertIcon />
34
+ </IconButton>
35
+ {!!anchorEl && (
36
+ <Popover open={true} anchorEl={anchorEl} onClose={HandleClose}>
37
+ <PadBox padding={{ padding: "2px" }}>
38
+ {items.map((item) => {
39
+ return (
40
+ <Stack key={item.title}>
41
+ <ListItemButton
42
+ sx={{ width: "100%", textAlign: "center" }}
43
+ onClick={() => item?.onClick()}
44
+ >
45
+ {item.title}
46
+ </ListItemButton>
47
+ </Stack>
48
+ );
49
+ })}
50
+ </PadBox>
51
+ </Popover>
52
+ )}
53
+ </Box>
54
+ );
55
+ };
@@ -0,0 +1,32 @@
1
+ import type { PopoverProps } from "@mui/material";
2
+ import { Popover as MuiPopover } from "@mui/material";
3
+
4
+ export const Popover = ({
5
+ open,
6
+ anchorEl,
7
+ children,
8
+ onClose,
9
+ }: PopoverProps) => {
10
+ return (
11
+ <MuiPopover
12
+ open={open}
13
+ anchorEl={anchorEl}
14
+ onClose={onClose}
15
+ anchorOrigin={{
16
+ vertical: "bottom",
17
+ horizontal: "center",
18
+ }}
19
+ transformOrigin={{
20
+ vertical: "top",
21
+ horizontal: "right",
22
+ }}
23
+ sx={{
24
+ "& .MuiPaper-root": {
25
+ width: "auto",
26
+ },
27
+ }}
28
+ >
29
+ {children}
30
+ </MuiPopover>
31
+ );
32
+ };
@@ -0,0 +1,87 @@
1
+ import { Box, Typography, useTheme } from "@mui/material";
2
+ import type { AgGridReactProps } from "ag-grid-react";
3
+ import { AgGridReact } from "ag-grid-react";
4
+ import type { Ref } from "react";
5
+ import { forwardRef } from "react";
6
+
7
+ export const defaultPageSize = 25;
8
+
9
+ //TODO: jaydip, fix unknown type
10
+ export type AgGridProps<T = unknown> = AgGridReactProps<T> & {
11
+ height?: string;
12
+ ref?: Ref<AgGridReact<T>>;
13
+ totalRecords?: number;
14
+ overlayNoRowsTemplate?: string;
15
+ };
16
+
17
+ type AgGridType = React.ForwardRefExoticComponent<AgGridProps> &
18
+ (<GenericType>(props: AgGridProps<GenericType>) => JSX.Element);
19
+
20
+ export const AgGrid = forwardRef(
21
+ <T,>(props: AgGridProps<T>, ref: Ref<AgGridReact<T>>) => {
22
+ const {
23
+ cacheBlockSize = defaultPageSize,
24
+ defaultColDef = {
25
+ flex: 1,
26
+ floatingFilter: false,
27
+ filterParams: {
28
+ buttons: ["apply", "reset"],
29
+ closeOnApply: true,
30
+ contains: false,
31
+ },
32
+ },
33
+ height = "597px",
34
+ rowHeight = 50,
35
+ rowModelType = "infinite",
36
+ rowBuffer = 5,
37
+ totalRecords,
38
+ // eslint-disable-next-line quotes
39
+ overlayNoRowsTemplate = '<span class="ag-overlay-no-rows-center">No Data Found</span>',
40
+ infiniteInitialRowCount = defaultPageSize,
41
+ ...rest
42
+ } = props;
43
+
44
+ const {
45
+ palette: {
46
+ app: { color },
47
+ },
48
+ } = useTheme();
49
+
50
+ if (totalRecords === 0) {
51
+ return (
52
+ <Box
53
+ sx={{
54
+ borderRadius: "4px",
55
+ margin: "20px",
56
+ display: "flex",
57
+ justifyContent: "center",
58
+ alignItems: "center",
59
+ height: "300px",
60
+ textAlign: "center",
61
+ backgroundColor: color.butterflyBlue[700],
62
+ }}
63
+ >
64
+ <Typography variant="h6">No result found</Typography>
65
+ </Box>
66
+ );
67
+ }
68
+
69
+ return (
70
+ <div className="ag-theme-quartz " style={{ width: "100%", height }}>
71
+ <AgGridReact<T>
72
+ ref={ref}
73
+ cacheBlockSize={cacheBlockSize}
74
+ defaultColDef={defaultColDef}
75
+ rowHeight={rowHeight}
76
+ rowModelType={rowModelType}
77
+ rowBuffer={rowBuffer}
78
+ infiniteInitialRowCount={infiniteInitialRowCount}
79
+ overlayNoRowsTemplate={overlayNoRowsTemplate}
80
+ {...rest}
81
+ />
82
+ </div>
83
+ );
84
+ }
85
+ ) as AgGridType;
86
+
87
+ AgGrid.displayName = "AgGrid";
@@ -0,0 +1,5 @@
1
+ import { Skeleton } from "@mui/material";
2
+
3
+ export const LoadingCell = () => {
4
+ return <Skeleton animation="pulse" width="100%" />;
5
+ };
@@ -0,0 +1,3 @@
1
+ export * from "./AgGrid";
2
+ export * from "./LoadingCell";
3
+ export * from "./ActionCell/ActionCell";
@@ -0,0 +1,25 @@
1
+ import { styled } from "@mui/material";
2
+ import type { AppBarProps as MuiAppBarProps } from "@mui/material/AppBar";
3
+ import MuiAppBar from "@mui/material/AppBar";
4
+
5
+ export const StyledAppBar = styled(MuiAppBar, {
6
+ shouldForwardProp: (prop) => prop !== "open",
7
+ })<MuiAppBarProps & { open?: boolean }>(({ theme, open }) => ({
8
+ background: theme.palette.app.color.iron[600],
9
+ boxShadow: "unset",
10
+ zIndex: theme.zIndex.drawer + 1,
11
+ transition: theme.transitions.create(["width", "margin"], {
12
+ easing: theme.transitions.easing.sharp,
13
+ duration: theme.transitions.duration.leavingScreen,
14
+ }),
15
+ marginLeft: "80px",
16
+ width: "calc(100% - 80px)",
17
+ ...(open && {
18
+ marginLeft: "300px",
19
+ width: "calc(100% - 300px)",
20
+ transition: theme.transitions.create(["width", "margin"], {
21
+ easing: theme.transitions.easing.sharp,
22
+ duration: theme.transitions.duration.enteringScreen,
23
+ }),
24
+ }),
25
+ }));
@@ -0,0 +1,20 @@
1
+ "use client";
2
+
3
+ import { Toolbar } from "@mui/material";
4
+ import type { PropsWithChildren } from "react";
5
+ import { StyledAppBar } from "./AppBar.styled";
6
+
7
+ export type AppBarProps = {
8
+ drawerOpen: boolean;
9
+ };
10
+
11
+ export const AppBar = ({
12
+ drawerOpen,
13
+ children,
14
+ }: PropsWithChildren<AppBarProps>) => {
15
+ return (
16
+ <StyledAppBar position="fixed" open={drawerOpen}>
17
+ <Toolbar>{children}</Toolbar>
18
+ </StyledAppBar>
19
+ );
20
+ };
@@ -0,0 +1 @@
1
+ export { AppBar } from "./AppBar";