@js-smart/react-kit 5.11.0 → 5.12.0-beta.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 (135) hide show
  1. package/.editorconfig +13 -0
  2. package/.eslintignore +1 -0
  3. package/.eslintrc.json +41 -0
  4. package/.github/copilot-instructions.md +11 -0
  5. package/.github/workflows/build.yml +45 -0
  6. package/.github/workflows/release.yml +65 -0
  7. package/.prettierignore +5 -0
  8. package/.prettierrc +9 -0
  9. package/.vscode/extensions.json +7 -0
  10. package/CHANGELOG.md +24 -0
  11. package/CODE_OF_CONDUCT.md +128 -0
  12. package/FUNDING.yml +1 -0
  13. package/LICENSE +21 -0
  14. package/README.md +1 -0
  15. package/apps/react-kit-demo/.eslintrc.json +22 -0
  16. package/apps/react-kit-demo/index.html +16 -0
  17. package/apps/react-kit-demo/project.json +9 -0
  18. package/apps/react-kit-demo/public/favicon.ico +0 -0
  19. package/apps/react-kit-demo/src/app/Home.tsx +17 -0
  20. package/apps/react-kit-demo/src/app/all-books/AllBooks.tsx +68 -0
  21. package/apps/react-kit-demo/src/app/app.module.scss +1 -0
  22. package/apps/react-kit-demo/src/app/app.tsx +29 -0
  23. package/apps/react-kit-demo/src/app/buttons/ButtonsDemo.tsx +58 -0
  24. package/apps/react-kit-demo/src/app/dialog/DialogDemo.tsx +23 -0
  25. package/apps/react-kit-demo/src/app/links/LinksDemo.tsx +20 -0
  26. package/apps/react-kit-demo/src/app/progress-bar/CenterCircularProgressDemo.tsx +10 -0
  27. package/apps/react-kit-demo/src/app/react-if/ReactIfDemo.tsx +44 -0
  28. package/apps/react-kit-demo/src/app/snack-bar/SnackBarDemo.tsx +35 -0
  29. package/apps/react-kit-demo/src/assets/.gitkeep +0 -0
  30. package/apps/react-kit-demo/src/constants/ApiConstants.ts +7 -0
  31. package/apps/react-kit-demo/src/constants/DialogMode.ts +2 -0
  32. package/apps/react-kit-demo/src/constants/HttpConstants.ts +18 -0
  33. package/apps/react-kit-demo/src/constants/StateConstants.ts +2 -0
  34. package/apps/react-kit-demo/src/main.tsx +17 -0
  35. package/apps/react-kit-demo/src/routes/Routes.tsx +55 -0
  36. package/apps/react-kit-demo/src/services/BookService.ts +21 -0
  37. package/apps/react-kit-demo/src/styles.scss +36 -0
  38. package/apps/react-kit-demo/src/theme.ts +46 -0
  39. package/apps/react-kit-demo/src/types/Book.ts +8 -0
  40. package/{lib/utils/CssUtils.d.ts → apps/react-kit-demo/src/utils/CssUtils.ts} +3 -1
  41. package/apps/react-kit-demo/tsconfig.app.json +18 -0
  42. package/apps/react-kit-demo/tsconfig.json +21 -0
  43. package/apps/react-kit-demo/tsconfig.spec.json +28 -0
  44. package/apps/react-kit-demo/vite.config.ts +50 -0
  45. package/nx.json +52 -0
  46. package/package.json +99 -44
  47. package/react-kit/.babelrc +12 -0
  48. package/react-kit/.eslintrc.json +18 -0
  49. package/react-kit/README.md +7 -0
  50. package/react-kit/package-lock.json +1330 -0
  51. package/react-kit/package.json +45 -0
  52. package/react-kit/project.json +10 -0
  53. package/{index.d.ts → react-kit/src/index.ts} +9 -0
  54. package/react-kit/src/lib/components/CenteredCircularProgress.tsx +15 -0
  55. package/react-kit/src/lib/components/ConfirmationDialog.tsx +28 -0
  56. package/react-kit/src/lib/components/DismissibleAlert.tsx +60 -0
  57. package/react-kit/src/lib/components/NextLink.tsx +26 -0
  58. package/react-kit/src/lib/components/OpenInNewIconLink.tsx +42 -0
  59. package/react-kit/src/lib/components/ReactIf.tsx +53 -0
  60. package/react-kit/src/lib/components/buttons/CancelButton.tsx +45 -0
  61. package/react-kit/src/lib/components/buttons/DeleteButton.tsx +35 -0
  62. package/react-kit/src/lib/components/buttons/EditIconButton.tsx +23 -0
  63. package/react-kit/src/lib/components/buttons/ExcelButton.tsx +43 -0
  64. package/react-kit/src/lib/components/buttons/GoBackButton.tsx +22 -0
  65. package/react-kit/src/lib/components/buttons/HistoryButton.tsx +45 -0
  66. package/react-kit/src/lib/components/buttons/LoadingSuccessButton.tsx +53 -0
  67. package/react-kit/src/lib/components/buttons/ManageButton.tsx +31 -0
  68. package/react-kit/src/lib/components/buttons/SuccessButton.tsx +44 -0
  69. package/react-kit/src/lib/components/snack-bar/AppSnackBar.tsx +46 -0
  70. package/react-kit/src/lib/components/snack-bar/QuerySnackBar.tsx +62 -0
  71. package/react-kit/src/lib/components/table/TablePaginationActions.tsx +58 -0
  72. package/react-kit/src/lib/components/tabs/TabPanel.tsx +26 -0
  73. package/react-kit/src/lib/constants/AppConstants.ts +17 -0
  74. package/react-kit/src/lib/types/ProgressState.ts +7 -0
  75. package/react-kit/src/lib/utils/BooleanUtils.ts +13 -0
  76. package/react-kit/src/lib/utils/CssUtils.ts +13 -0
  77. package/react-kit/src/lib/utils/DateUtils.ts +43 -0
  78. package/react-kit/src/lib/utils/NumberUtils.ts +12 -0
  79. package/react-kit/src/lib/utils/ProgressStateUtils.ts +68 -0
  80. package/react-kit/src/lib/utils/StringUtils.ts +14 -0
  81. package/react-kit/src/lib/utils/UrlUtils.ts +19 -0
  82. package/react-kit/src/lib/utils/fetchClient.ts +64 -0
  83. package/react-kit/src/tests/buttons/CancelButton.test.tsx +69 -0
  84. package/react-kit/src/tests/buttons/DeleteButton.test.tsx +63 -0
  85. package/react-kit/src/tests/buttons/EditIconButton.test.tsx +34 -0
  86. package/react-kit/src/tests/buttons/HistoryButton.test.tsx +46 -0
  87. package/react-kit/src/tests/buttons/LoadingSuccessButton.test.tsx +53 -0
  88. package/react-kit/src/tests/buttons/ManageButton.test.tsx +49 -0
  89. package/react-kit/src/tests/buttons/SuccessButton.test.tsx +46 -0
  90. package/react-kit/src/tests/snack-bar/AppSnackBar.test.tsx +54 -0
  91. package/react-kit/src/tests/utils/BooleanUtils.test.ts +35 -0
  92. package/react-kit/src/tests/utils/CssUtils.test.ts +17 -0
  93. package/react-kit/src/tests/utils/DateUtils.test.ts +46 -0
  94. package/react-kit/src/tests/utils/NumberUtils.test.ts +19 -0
  95. package/react-kit/src/tests/utils/ProgressStateUtils.test.ts +131 -0
  96. package/react-kit/src/tests/utils/StringUtils.test.ts +33 -0
  97. package/react-kit/src/tests/utils/UrlUtils.test.ts +19 -0
  98. package/react-kit/tsconfig.json +22 -0
  99. package/react-kit/tsconfig.lib.json +24 -0
  100. package/react-kit/tsconfig.spec.json +27 -0
  101. package/react-kit/vite.config.ts +72 -0
  102. package/release.sh +28 -0
  103. package/tsconfig.base.json +22 -0
  104. package/vitest.workspace.js +3 -0
  105. package/vitest.workspace.ts +1 -0
  106. package/index.cjs +0 -74
  107. package/index.js +0 -4120
  108. package/lib/components/CenteredCircularProgress.d.ts +0 -7
  109. package/lib/components/ConfirmationDialog.d.ts +0 -11
  110. package/lib/components/DismissibleAlert.d.ts +0 -17
  111. package/lib/components/NextLink.d.ts +0 -17
  112. package/lib/components/OpenInNewIconLink.d.ts +0 -17
  113. package/lib/components/ReactIf.d.ts +0 -36
  114. package/lib/components/buttons/CancelButton.d.ts +0 -28
  115. package/lib/components/buttons/DeleteButton.d.ts +0 -16
  116. package/lib/components/buttons/EditIconButton.d.ts +0 -8
  117. package/lib/components/buttons/ExcelButton.d.ts +0 -26
  118. package/lib/components/buttons/GoBackButton.d.ts +0 -10
  119. package/lib/components/buttons/HistoryButton.d.ts +0 -28
  120. package/lib/components/buttons/LoadingSuccessButton.d.ts +0 -28
  121. package/lib/components/buttons/ManageButton.d.ts +0 -14
  122. package/lib/components/buttons/SuccessButton.d.ts +0 -28
  123. package/lib/components/snack-bar/AppSnackBar.d.ts +0 -6
  124. package/lib/components/snack-bar/QuerySnackBar.d.ts +0 -18
  125. package/lib/components/table/TablePaginationActions.d.ts +0 -9
  126. package/lib/components/tabs/TabPanel.d.ts +0 -12
  127. package/lib/constants/AppConstants.d.ts +0 -15
  128. package/lib/types/ProgressState.d.ts +0 -7
  129. package/lib/utils/BooleanUtils.d.ts +0 -7
  130. package/lib/utils/DateUtils.d.ts +0 -22
  131. package/lib/utils/NumberUtils.d.ts +0 -7
  132. package/lib/utils/ProgressStateUtils.d.ts +0 -38
  133. package/lib/utils/StringUtils.d.ts +0 -7
  134. package/lib/utils/UrlUtils.d.ts +0 -11
  135. package/lib/utils/fetchClient.d.ts +0 -12
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { CenteredCircularProgress } from '@react-kit/*';
3
+
4
+ export default function CenterCircularProgressDemo() {
5
+ return (
6
+ <div style={{ textAlign: 'center' }}>
7
+ <CenteredCircularProgress />
8
+ </div>
9
+ );
10
+ }
@@ -0,0 +1,44 @@
1
+ import React, { useState } from 'react';
2
+ import { DismissibleAlert, ManageButton, ReactIf } from '@react-kit/react-kit';
3
+ import { Card, Divider } from '@mui/material';
4
+
5
+ export default function ReactIfDemo() {
6
+ const [show, setShow] = useState(true);
7
+
8
+ return (
9
+ <div style={{ textAlign: 'center' }}>
10
+ <h2>React If Demo</h2>
11
+
12
+ <Divider sx={{ mb: 3 }} />
13
+ <ManageButton startIcon={''} onClick={() => setShow((prev) => !prev)}>
14
+ Click to toggle
15
+ </ManageButton>
16
+
17
+ <Card sx={{ m: 5, mb: 5 }} elevation={24}>
18
+ {/* Section 1: ReactIf with only condition */}
19
+ <div style={{ marginTop: 32 }}>
20
+ <h3>
21
+ 1. ReactIf with <code>condition</code> only
22
+ </h3>
23
+ <ReactIf condition={show}>
24
+ <DismissibleAlert message={'Main content (condition is true)'} severity={'success'} dismissOnTimeOut={false} />
25
+ </ReactIf>
26
+ </div>
27
+ </Card>
28
+
29
+ <Card sx={{ m: 3 }} elevation={24}>
30
+ {/* Section 2: ReactIf with condition and else */}
31
+ <div style={{ marginTop: 32 }}>
32
+ <h3>
33
+ 2. ReactIf with <code>condition</code> and <code>else</code>
34
+ </h3>
35
+ <ReactIf
36
+ condition={show}
37
+ else={<DismissibleAlert message={'Else content (condition is false)'} severity={'warning'} dismissOnTimeOut={false} />}>
38
+ <DismissibleAlert message={'Main content (condition is true)'} severity={'success'} dismissOnTimeOut={false} />
39
+ </ReactIf>
40
+ </div>
41
+ </Card>
42
+ </div>
43
+ );
44
+ }
@@ -0,0 +1,35 @@
1
+ import React, { useState } from 'react';
2
+ import { Button } from '@mui/material';
3
+ import { AppSnackBar, initializeState, markError, markSuccess } from '@react-kit/*';
4
+
5
+ export default function SnackBarDemo() {
6
+ const [open, setOpen] = useState(false);
7
+ const [progressState, setProgressState] = useState(initializeState());
8
+ return (
9
+ <div style={{ margin: '1rem', textAlign: 'center' }}>
10
+ <Button
11
+ variant={'contained'}
12
+ color={'primary'}
13
+ sx={{ m: 1 }}
14
+ onClick={() => {
15
+ setProgressState(markSuccess(progressState, `Successfully shown success SnackBar!`));
16
+ setOpen(true);
17
+ }}>
18
+ Show Success SnackBar
19
+ </Button>
20
+
21
+ <Button
22
+ sx={{ m: 1 }}
23
+ variant={'contained'}
24
+ color={'error'}
25
+ onClick={() => {
26
+ setProgressState(markError(progressState, `Successfully shown error SnackBar!`));
27
+ setOpen(true);
28
+ }}>
29
+ Show Error SnackBar
30
+ </Button>
31
+
32
+ <AppSnackBar open={open} progressState={progressState} />
33
+ </div>
34
+ );
35
+ }
File without changes
@@ -0,0 +1,7 @@
1
+ export const BASE_API_URL = 'https://my-json-server.typicode.com/pavankjadda/typicode-data';
2
+
3
+ //Core URLs
4
+ export const USER_API_URL = '';
5
+
6
+ // API URLs
7
+ export const BOOK_API_URL = '';
@@ -0,0 +1,2 @@
1
+ export const NEW = 'NEW';
2
+ export const EDIT = 'EDIT';
@@ -0,0 +1,18 @@
1
+ // Success Statuses
2
+ export const HTTP_200 = 200;
3
+ export const HTTP_201 = 201;
4
+
5
+ // Authentication Statuses
6
+ export const HTTP_401 = 401;
7
+ export const HTTP_403 = 403;
8
+ export const HTTP_404 = 404;
9
+ export const HTTP_405 = 405;
10
+ export const HTTP_409 = 409;
11
+
12
+ // Internal Server Statuses
13
+ export const HTTP_500 = 500;
14
+ export const HTTP_501 = 501;
15
+ export const HTTP_502 = 502;
16
+ export const HTTP_503 = 503;
17
+ export const HTTP_504 = 504;
18
+ export const HTTP_505 = 505;
@@ -0,0 +1,2 @@
1
+ export const SUCCESS = 'success';
2
+ export const ERROR = 'error';
@@ -0,0 +1,17 @@
1
+ import { StrictMode } from 'react';
2
+ import * as ReactDOM from 'react-dom/client';
3
+ import { RouterProvider } from 'react-router-dom';
4
+ import { router } from './routes/Routes';
5
+ import { CssBaseline, ThemeProvider } from '@mui/material';
6
+ import theme from './theme';
7
+
8
+ const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement);
9
+
10
+ root.render(
11
+ <StrictMode>
12
+ <ThemeProvider theme={theme}>
13
+ <CssBaseline />
14
+ <RouterProvider router={router} />
15
+ </ThemeProvider>
16
+ </StrictMode>
17
+ );
@@ -0,0 +1,55 @@
1
+ import { createBrowserRouter } from 'react-router-dom';
2
+ import Home from '../app/Home';
3
+ import AllBooks from '../app/all-books/AllBooks';
4
+ import App from '../app/app';
5
+ import ButtonsDemo from '../app/buttons/ButtonsDemo';
6
+ import DialogDemo from '../app/dialog/DialogDemo';
7
+ import LinksDemo from '../app/links/LinksDemo';
8
+ import CenterCircularProgressDemo from '../app/progress-bar/CenterCircularProgressDemo';
9
+ import ReactIfDemo from '../app/react-if/ReactIfDemo';
10
+ import SnackBarDemo from '../app/snack-bar/SnackBarDemo';
11
+
12
+ export const router = createBrowserRouter([
13
+ {
14
+ path: '/',
15
+ element: <App />,
16
+ children: [
17
+ {
18
+ path: '/',
19
+ element: <Home />,
20
+ },
21
+ {
22
+ path: 'home',
23
+ element: <Home />,
24
+ },
25
+ {
26
+ path: '/buttons',
27
+ element: <ButtonsDemo />,
28
+ },
29
+ {
30
+ path: '/snack-bar',
31
+ element: <SnackBarDemo />,
32
+ },
33
+ {
34
+ path: '/dialog',
35
+ element: <DialogDemo />,
36
+ },
37
+ {
38
+ path: '/circular-progress',
39
+ element: <CenterCircularProgressDemo />,
40
+ },
41
+ {
42
+ path: '/books',
43
+ element: <AllBooks />,
44
+ },
45
+ {
46
+ path: '/react-if',
47
+ element: <ReactIfDemo />,
48
+ },
49
+ {
50
+ path: '/links',
51
+ element: <LinksDemo />,
52
+ },
53
+ ],
54
+ },
55
+ ]);
@@ -0,0 +1,21 @@
1
+ import { Book } from '../types/Book';
2
+ import { fetchClient } from '@react-kit/*';
3
+ import { BASE_API_URL, BOOK_API_URL } from '../constants/ApiConstants';
4
+
5
+ /**
6
+ * Utility class for Books operations
7
+ *
8
+ * @author Pavan Kumar Jadda
9
+ * @since 1.0.0
10
+ */
11
+ export class BookService {
12
+ /**
13
+ * Get All Books
14
+ *
15
+ * @author Pavan Kumar Jadda
16
+ * @since 1.0.0
17
+ */
18
+ static async getAllBooks(): Promise<Book[]> {
19
+ return await fetchClient<Book[]>(`${BASE_API_URL + BOOK_API_URL}/books`);
20
+ }
21
+ }
@@ -0,0 +1,36 @@
1
+ :root {
2
+ --primary-color: #153d77;
3
+ --secondary-color: #607d8b;
4
+ --success-color: #198754;
5
+ --error-color: #ff1744;
6
+ --white-color: #fff;
7
+ --background-color: #dedede;
8
+ --pdf-color: #f40f02;
9
+ --word-document-color: #2b579a;
10
+ }
11
+
12
+
13
+ /* The sidebar menu */
14
+ .sidenav {
15
+ height: 100%; /* Full-height: remove this if you want "auto" height */
16
+ width: 300px; /* Set the width of the sidebar */
17
+ position: fixed; /* Fixed Sidebar (stay in place on scroll) */
18
+ z-index: 1; /* Stay on top */
19
+ top: 0; /* Stay at the top */
20
+ left: 0;
21
+ overflow-x: hidden; /* Disable horizontal scroll */
22
+ padding-top: 20px;
23
+ border-right: 1px solid black;
24
+ }
25
+ /* Style page content */
26
+ .main {
27
+ margin-left: 300px; /* Same as the width of the sidebar */
28
+ }
29
+
30
+ /* The navigation menu links */
31
+ .sidenav a {
32
+ padding: 6px 8px 6px 16px;
33
+ text-decoration: none;
34
+ font-size: 20px;
35
+ display: block;
36
+ }
@@ -0,0 +1,46 @@
1
+ import { createTheme } from '@mui/material/styles';
2
+ import { getCssVariable } from './utils/CssUtils';
3
+
4
+ declare module '@mui/material/styles' {
5
+ interface BreakpointOverrides {
6
+ xs: true;
7
+ sm: true;
8
+ md: true;
9
+ lg: true;
10
+ xl: true;
11
+ xxl: true;
12
+ xxxl: true;
13
+ }
14
+ }
15
+
16
+ // A custom theme for this app
17
+ const theme = createTheme({
18
+ cssVariables: true,
19
+ breakpoints: {
20
+ values: {
21
+ xs: 0,
22
+ sm: 600,
23
+ md: 900,
24
+ lg: 1200,
25
+ xl: 1536,
26
+ xxl: 1920,
27
+ xxxl: 2200,
28
+ },
29
+ },
30
+ palette: {
31
+ primary: {
32
+ main: getCssVariable('--primary-color'),
33
+ },
34
+ secondary: {
35
+ main: getCssVariable('--secondary-color'),
36
+ },
37
+ success: {
38
+ main: getCssVariable('--success-color'),
39
+ },
40
+ error: {
41
+ main: getCssVariable('--error-color'),
42
+ },
43
+ },
44
+ });
45
+
46
+ export default theme;
@@ -0,0 +1,8 @@
1
+ export interface Book {
2
+ id: number;
3
+ number: string;
4
+ title: string;
5
+ price: number;
6
+ isbn: string;
7
+ author: string;
8
+ }
@@ -8,4 +8,6 @@
8
8
  * @author Pavan Kumar Jadda
9
9
  * @since 1.6.0
10
10
  */
11
- export declare function getCssVariable(variable: string): string;
11
+ export function getCssVariable(variable: string): string {
12
+ return getComputedStyle(document.documentElement).getPropertyValue(variable).trim();
13
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "outDir": "../../dist/out-tsc",
5
+ "types": ["node", "@nx/react/typings/cssmodule.d.ts", "@nx/react/typings/image.d.ts", "vite/client"]
6
+ },
7
+ "exclude": [
8
+ "src/**/*.spec.ts",
9
+ "src/**/*.test.ts",
10
+ "src/**/*.spec.tsx",
11
+ "src/**/*.test.tsx",
12
+ "src/**/*.spec.js",
13
+ "src/**/*.test.js",
14
+ "src/**/*.spec.jsx",
15
+ "src/**/*.test.jsx"
16
+ ],
17
+ "include": ["src/**/*.js", "src/**/*.jsx", "src/**/*.ts", "src/**/*.tsx"]
18
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "compilerOptions": {
3
+ "jsx": "react-jsx",
4
+ "allowJs": false,
5
+ "esModuleInterop": false,
6
+ "allowSyntheticDefaultImports": true,
7
+ "strict": true,
8
+ "types": ["vite/client", "vitest"]
9
+ },
10
+ "files": [],
11
+ "include": [],
12
+ "references": [
13
+ {
14
+ "path": "./tsconfig.app.json"
15
+ },
16
+ {
17
+ "path": "./tsconfig.spec.json"
18
+ }
19
+ ],
20
+ "extends": "../../tsconfig.base.json"
21
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "outDir": "../../dist/out-tsc",
5
+ "types": [
6
+ "vitest/globals",
7
+ "vitest/importMeta",
8
+ "vite/client",
9
+ "node",
10
+ "vitest",
11
+ "@nx/react/typings/cssmodule.d.ts",
12
+ "@nx/react/typings/image.d.ts"
13
+ ]
14
+ },
15
+ "include": [
16
+ "vite.config.ts",
17
+ "vitest.config.ts",
18
+ "src/**/*.test.ts",
19
+ "src/**/*.spec.ts",
20
+ "src/**/*.test.tsx",
21
+ "src/**/*.spec.tsx",
22
+ "src/**/*.test.js",
23
+ "src/**/*.spec.js",
24
+ "src/**/*.test.jsx",
25
+ "src/**/*.spec.jsx",
26
+ "src/**/*.d.ts"
27
+ ]
28
+ }
@@ -0,0 +1,50 @@
1
+ /// <reference types='vitest' />
2
+ import { defineConfig } from 'vite';
3
+ import react from '@vitejs/plugin-react';
4
+ import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
5
+ import mkcert from 'vite-plugin-mkcert';
6
+
7
+ export default defineConfig({
8
+ root: __dirname,
9
+ cacheDir: '../../node_modules/.vite/apps/react-kit-demo',
10
+
11
+ server: {
12
+ port: 3007,
13
+ host: 'localhost',
14
+ },
15
+
16
+ preview: {
17
+ port: 4300,
18
+ host: 'localhost',
19
+ },
20
+
21
+ plugins: [react(), mkcert(), nxViteTsPaths()],
22
+
23
+ // Uncomment this if you are using workers.
24
+ // worker: {
25
+ // plugins: [ nxViteTsPaths() ],
26
+ // },
27
+
28
+ build: {
29
+ outDir: '../../dist/apps/react-kit-demo',
30
+ reportCompressedSize: true,
31
+ commonjsOptions: {
32
+ transformMixedEsModules: true,
33
+ },
34
+ },
35
+
36
+ test: {
37
+ globals: true,
38
+ cache: {
39
+ dir: '../../node_modules/.vitest/apps/react-kit-demo',
40
+ },
41
+ environment: 'jsdom',
42
+ include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
43
+
44
+ reporters: ['default'],
45
+ coverage: {
46
+ reportsDirectory: '../../coverage/apps/react-kit-demo',
47
+ provider: 'v8',
48
+ },
49
+ },
50
+ });
package/nx.json ADDED
@@ -0,0 +1,52 @@
1
+ {
2
+ "$schema": "./node_modules/nx/schemas/nx-schema.json",
3
+ "defaultProject": "react-kit-demo",
4
+ "namedInputs": {
5
+ "default": ["{projectRoot}/**/*", "sharedGlobals"],
6
+ "production": [
7
+ "default",
8
+ "!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)",
9
+ "!{projectRoot}/tsconfig.spec.json",
10
+ "!{projectRoot}/.eslintrc.json",
11
+ "!{projectRoot}/eslint.config.js"
12
+ ],
13
+ "sharedGlobals": []
14
+ },
15
+ "plugins": [
16
+ {
17
+ "plugin": "@nx/vite/plugin",
18
+ "options": {
19
+ "buildTargetName": "build",
20
+ "testTargetName": "test",
21
+ "serveTargetName": "serve",
22
+ "previewTargetName": "preview",
23
+ "serveStaticTargetName": "serve-static"
24
+ }
25
+ },
26
+ {
27
+ "plugin": "@nx/eslint/plugin",
28
+ "options": {
29
+ "targetName": "lint"
30
+ }
31
+ }
32
+ ],
33
+ "generators": {
34
+ "@nx/react": {
35
+ "application": {
36
+ "babel": true,
37
+ "style": "scss",
38
+ "linter": "eslint",
39
+ "bundler": "vite"
40
+ },
41
+ "component": {
42
+ "style": "scss"
43
+ },
44
+ "library": {
45
+ "style": "scss",
46
+ "linter": "eslint",
47
+ "unitTestRunner": "vitest"
48
+ }
49
+ }
50
+ },
51
+ "nxCloudId": "670ebadac0c313acbf9ee13c"
52
+ }
package/package.json CHANGED
@@ -1,46 +1,101 @@
1
1
  {
2
- "name": "@js-smart/react-kit",
3
- "private": false,
4
- "version": "5.11.0",
5
- "main": "./index.js",
6
- "types": "./index.d.ts",
7
- "type": "module",
8
- "publishConfig": {
9
- "access": "public"
10
- },
11
- "peerDependencies": {
12
- "@emotion/react": "^11.14.0",
13
- "@emotion/styled": "^11.14.1",
14
- "@mui/icons-material": "^7.2.0",
15
- "@mui/material": "^7.2.0",
16
- "date-fns": "^4.1.0",
17
- "react": "^18.3.1 || ^19.0.0",
18
- "react-dom": "^18.3.1 || ^19.0.0",
19
- "react-router-dom": "^7.6.3"
20
- },
21
- "exports": {
22
- ".": {
23
- "import": "./index.mjs",
24
- "require": "./index.js"
25
- }
26
- },
27
- "repository": {
28
- "type": "git",
29
- "url": "https://github.com/js-smart/react-kit"
30
- },
31
- "author": {
32
- "name": "Pavan Kumar Jadda",
33
- "email": "contact@pavankjadda.dev"
34
- },
35
- "keywords": [
36
- "react",
37
- "react-kit",
38
- "react-components",
39
- "react-utils",
40
- "typescript"
41
- ],
42
- "license": "MIT",
43
- "bugs": {
44
- "url": "https://github.com/js-smart/react-kit/issues"
45
- }
2
+ "name": "@js-smart/react-kit",
3
+ "version": "5.12.0-beta.1",
4
+ "license": "MIT",
5
+ "private": false,
6
+ "type": "module",
7
+ "scripts": {
8
+ "nx": "nx",
9
+ "start": "nx serve",
10
+ "build": "nx build react-kit",
11
+ "build:demo": "nx build",
12
+ "test": "nx test react-kit ",
13
+ "update": "nx migrate latest"
14
+ },
15
+ "dependencies": {
16
+ "@emotion/react": "^11.14.0",
17
+ "@emotion/styled": "^11.14.1",
18
+ "@mui/icons-material": "^7.2.0",
19
+ "@mui/material": "^7.2.0",
20
+ "@mui/x-data-grid": "^7.29.8",
21
+ "date-fns": "^4.1.0",
22
+ "react": "^18.3.1 || ^19.0.0",
23
+ "react-dom": "^18.3.1 || ^19.0.0",
24
+ "react-router-dom": "^7.7.1"
25
+ },
26
+ "devDependencies": {
27
+ "@babel/core": "^7.28.0",
28
+ "@babel/preset-react": "^7.27.1",
29
+ "@nx/cypress": "21.2.1",
30
+ "@nx/devkit": "21.2.1",
31
+ "@nx/eslint": "21.2.1",
32
+ "@nx/eslint-plugin": "21.2.1",
33
+ "@nx/js": "21.2.1",
34
+ "@nx/react": "21.2.1",
35
+ "@nx/vite": "21.2.1",
36
+ "@nx/web": "21.2.1",
37
+ "@nx/workspace": "21.2.1",
38
+ "@semantic-release/git": "^10.0.1",
39
+ "@semantic-release/npm": "^12.0.1",
40
+ "@swc-node/register": "1.10.10",
41
+ "@swc/cli": "0.6.0",
42
+ "@swc/core": "1.11.24",
43
+ "@swc/helpers": "0.5.17",
44
+ "@testing-library/jest-dom": "^6.5.0",
45
+ "@testing-library/react": "16.3.0",
46
+ "@types/node": "22.15.14",
47
+ "@types/react": "19.1.3",
48
+ "@types/react-dom": "19.1.3",
49
+ "@typescript-eslint/eslint-plugin": "8.32.0",
50
+ "@typescript-eslint/parser": "8.32.0",
51
+ "@vitejs/plugin-react": "^4.4.1",
52
+ "@vitest/coverage-v8": "^3.1.3",
53
+ "@vitest/ui": "^3.1.3",
54
+ "eslint": "~9.26.0",
55
+ "eslint-config-prettier": "10.1.2",
56
+ "eslint-plugin-import": "2.31.0",
57
+ "eslint-plugin-jsx-a11y": "6.10.2",
58
+ "eslint-plugin-react": "7.37.5",
59
+ "eslint-plugin-react-hooks": "5.2.0",
60
+ "jest-mock": "^29.7.0",
61
+ "jiti": "2.4.2",
62
+ "jsdom": "~26.1.0",
63
+ "nx": "21.2.1",
64
+ "prettier": "^3.5.3",
65
+ "sass": "^1.87.0",
66
+ "semantic-release": "^24.2.3",
67
+ "typescript": "^5.8.3",
68
+ "vite": "^6.3.5",
69
+ "vite-plugin-dts": "^4.5.3",
70
+ "vite-plugin-mkcert": "^1.17.8",
71
+ "vitest": "^3.1.3"
72
+ },
73
+ "peerDependencies": {
74
+ "@emotion/react": "^11.14.0",
75
+ "@emotion/styled": "^11.14.0",
76
+ "@mui/icons-material": "^7.1.0",
77
+ "@mui/material": "^7.1.0",
78
+ "@mui/x-data-grid": "^8.2.0",
79
+ "date-fns": "^4.1.0",
80
+ "react": "^18.3.1 || ^19.0.0",
81
+ "react-dom": "^18.3.1 || ^19.0.0",
82
+ "react-router-dom": "^7.5.3"
83
+ },
84
+ "release": {
85
+ "branches": [
86
+ "main"
87
+ ],
88
+ "plugins": [
89
+ "@semantic-release/commit-analyzer",
90
+ "@semantic-release/release-notes-generator",
91
+ [
92
+ "@semantic-release/npm",
93
+ {
94
+ "pkgRoot": "dist/react-kit"
95
+ }
96
+ ],
97
+ "@semantic-release/git",
98
+ "@semantic-release/github"
99
+ ]
100
+ }
46
101
  }
@@ -0,0 +1,12 @@
1
+ {
2
+ "presets": [
3
+ [
4
+ "@nx/react/babel",
5
+ {
6
+ "runtime": "automatic",
7
+ "useBuiltIns": "usage"
8
+ }
9
+ ]
10
+ ],
11
+ "plugins": []
12
+ }