@js-smart/react-kit 5.10.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.
- package/.editorconfig +13 -0
- package/.eslintignore +1 -0
- package/.eslintrc.json +41 -0
- package/.github/copilot-instructions.md +11 -0
- package/.github/workflows/build.yml +45 -0
- package/.github/workflows/release.yml +65 -0
- package/.prettierignore +5 -0
- package/.prettierrc +9 -0
- package/.vscode/extensions.json +7 -0
- package/CHANGELOG.md +24 -0
- package/CODE_OF_CONDUCT.md +128 -0
- package/FUNDING.yml +1 -0
- package/LICENSE +21 -0
- package/README.md +1 -0
- package/apps/react-kit-demo/.eslintrc.json +22 -0
- package/apps/react-kit-demo/index.html +16 -0
- package/apps/react-kit-demo/project.json +9 -0
- package/apps/react-kit-demo/public/favicon.ico +0 -0
- package/apps/react-kit-demo/src/app/Home.tsx +17 -0
- package/apps/react-kit-demo/src/app/all-books/AllBooks.tsx +68 -0
- package/apps/react-kit-demo/src/app/app.module.scss +1 -0
- package/apps/react-kit-demo/src/app/app.tsx +29 -0
- package/apps/react-kit-demo/src/app/buttons/ButtonsDemo.tsx +58 -0
- package/apps/react-kit-demo/src/app/dialog/DialogDemo.tsx +23 -0
- package/apps/react-kit-demo/src/app/links/LinksDemo.tsx +20 -0
- package/apps/react-kit-demo/src/app/progress-bar/CenterCircularProgressDemo.tsx +10 -0
- package/apps/react-kit-demo/src/app/react-if/ReactIfDemo.tsx +44 -0
- package/apps/react-kit-demo/src/app/snack-bar/SnackBarDemo.tsx +35 -0
- package/apps/react-kit-demo/src/assets/.gitkeep +0 -0
- package/apps/react-kit-demo/src/constants/ApiConstants.ts +7 -0
- package/apps/react-kit-demo/src/constants/DialogMode.ts +2 -0
- package/apps/react-kit-demo/src/constants/HttpConstants.ts +18 -0
- package/apps/react-kit-demo/src/constants/StateConstants.ts +2 -0
- package/apps/react-kit-demo/src/main.tsx +17 -0
- package/apps/react-kit-demo/src/routes/Routes.tsx +55 -0
- package/apps/react-kit-demo/src/services/BookService.ts +21 -0
- package/apps/react-kit-demo/src/styles.scss +36 -0
- package/apps/react-kit-demo/src/theme.ts +46 -0
- package/apps/react-kit-demo/src/types/Book.ts +8 -0
- package/{lib/utils/CssUtils.d.ts → apps/react-kit-demo/src/utils/CssUtils.ts} +3 -1
- package/apps/react-kit-demo/tsconfig.app.json +18 -0
- package/apps/react-kit-demo/tsconfig.json +21 -0
- package/apps/react-kit-demo/tsconfig.spec.json +28 -0
- package/apps/react-kit-demo/vite.config.ts +50 -0
- package/nx.json +52 -0
- package/package.json +99 -44
- package/react-kit/.babelrc +12 -0
- package/react-kit/.eslintrc.json +18 -0
- package/react-kit/README.md +7 -0
- package/react-kit/package-lock.json +1330 -0
- package/react-kit/package.json +45 -0
- package/react-kit/project.json +10 -0
- package/{index.d.ts → react-kit/src/index.ts} +9 -0
- package/react-kit/src/lib/components/CenteredCircularProgress.tsx +15 -0
- package/react-kit/src/lib/components/ConfirmationDialog.tsx +28 -0
- package/react-kit/src/lib/components/DismissibleAlert.tsx +60 -0
- package/react-kit/src/lib/components/NextLink.tsx +26 -0
- package/react-kit/src/lib/components/OpenInNewIconLink.tsx +42 -0
- package/react-kit/src/lib/components/ReactIf.tsx +53 -0
- package/react-kit/src/lib/components/buttons/CancelButton.tsx +45 -0
- package/react-kit/src/lib/components/buttons/DeleteButton.tsx +35 -0
- package/react-kit/src/lib/components/buttons/EditIconButton.tsx +23 -0
- package/react-kit/src/lib/components/buttons/ExcelButton.tsx +43 -0
- package/react-kit/src/lib/components/buttons/GoBackButton.tsx +22 -0
- package/react-kit/src/lib/components/buttons/HistoryButton.tsx +45 -0
- package/react-kit/src/lib/components/buttons/LoadingSuccessButton.tsx +53 -0
- package/react-kit/src/lib/components/buttons/ManageButton.tsx +31 -0
- package/react-kit/src/lib/components/buttons/SuccessButton.tsx +44 -0
- package/react-kit/src/lib/components/snack-bar/AppSnackBar.tsx +46 -0
- package/react-kit/src/lib/components/snack-bar/QuerySnackBar.tsx +62 -0
- package/react-kit/src/lib/components/table/TablePaginationActions.tsx +58 -0
- package/react-kit/src/lib/components/tabs/TabPanel.tsx +26 -0
- package/react-kit/src/lib/constants/AppConstants.ts +17 -0
- package/react-kit/src/lib/types/ProgressState.ts +7 -0
- package/react-kit/src/lib/utils/BooleanUtils.ts +13 -0
- package/react-kit/src/lib/utils/CssUtils.ts +13 -0
- package/react-kit/src/lib/utils/DateUtils.ts +43 -0
- package/react-kit/src/lib/utils/NumberUtils.ts +12 -0
- package/react-kit/src/lib/utils/ProgressStateUtils.ts +68 -0
- package/react-kit/src/lib/utils/StringUtils.ts +14 -0
- package/react-kit/src/lib/utils/UrlUtils.ts +19 -0
- package/react-kit/src/lib/utils/fetchClient.ts +64 -0
- package/react-kit/src/tests/buttons/CancelButton.test.tsx +69 -0
- package/react-kit/src/tests/buttons/DeleteButton.test.tsx +63 -0
- package/react-kit/src/tests/buttons/EditIconButton.test.tsx +34 -0
- package/react-kit/src/tests/buttons/HistoryButton.test.tsx +46 -0
- package/react-kit/src/tests/buttons/LoadingSuccessButton.test.tsx +53 -0
- package/react-kit/src/tests/buttons/ManageButton.test.tsx +49 -0
- package/react-kit/src/tests/buttons/SuccessButton.test.tsx +46 -0
- package/react-kit/src/tests/snack-bar/AppSnackBar.test.tsx +54 -0
- package/react-kit/src/tests/utils/BooleanUtils.test.ts +35 -0
- package/react-kit/src/tests/utils/CssUtils.test.ts +17 -0
- package/react-kit/src/tests/utils/DateUtils.test.ts +46 -0
- package/react-kit/src/tests/utils/NumberUtils.test.ts +19 -0
- package/react-kit/src/tests/utils/ProgressStateUtils.test.ts +131 -0
- package/react-kit/src/tests/utils/StringUtils.test.ts +33 -0
- package/react-kit/src/tests/utils/UrlUtils.test.ts +19 -0
- package/react-kit/tsconfig.json +22 -0
- package/react-kit/tsconfig.lib.json +24 -0
- package/react-kit/tsconfig.spec.json +27 -0
- package/react-kit/vite.config.ts +72 -0
- package/release.sh +28 -0
- package/tsconfig.base.json +22 -0
- package/vitest.workspace.js +3 -0
- package/vitest.workspace.ts +1 -0
- package/index.cjs +0 -74
- package/index.js +0 -4120
- package/index.mjs +0 -4108
- package/lib/components/CenteredCircularProgress.d.ts +0 -7
- package/lib/components/ConfirmationDialog.d.ts +0 -11
- package/lib/components/DismissibleAlert.d.ts +0 -17
- package/lib/components/NextLink.d.ts +0 -17
- package/lib/components/OpenInNewIconLink.d.ts +0 -17
- package/lib/components/ReactIf.d.ts +0 -36
- package/lib/components/buttons/CancelButton.d.ts +0 -28
- package/lib/components/buttons/DeleteButton.d.ts +0 -16
- package/lib/components/buttons/EditIconButton.d.ts +0 -8
- package/lib/components/buttons/ExcelButton.d.ts +0 -26
- package/lib/components/buttons/GoBackButton.d.ts +0 -10
- package/lib/components/buttons/HistoryButton.d.ts +0 -28
- package/lib/components/buttons/LoadingSuccessButton.d.ts +0 -28
- package/lib/components/buttons/ManageButton.d.ts +0 -14
- package/lib/components/buttons/SuccessButton.d.ts +0 -28
- package/lib/components/snack-bar/AppSnackBar.d.ts +0 -6
- package/lib/components/snack-bar/QuerySnackBar.d.ts +0 -18
- package/lib/components/table/TablePaginationActions.d.ts +0 -9
- package/lib/components/tabs/TabPanel.d.ts +0 -12
- package/lib/constants/AppConstants.d.ts +0 -15
- package/lib/types/ProgressState.d.ts +0 -7
- package/lib/utils/BooleanUtils.d.ts +0 -7
- package/lib/utils/DateUtils.d.ts +0 -22
- package/lib/utils/NumberUtils.d.ts +0 -7
- package/lib/utils/ProgressStateUtils.d.ts +0 -38
- package/lib/utils/StringUtils.d.ts +0 -7
- package/lib/utils/UrlUtils.d.ts +0 -11
- package/lib/utils/fetchClient.d.ts +0 -12
|
@@ -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,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,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;
|
|
@@ -8,4 +8,6 @@
|
|
|
8
8
|
* @author Pavan Kumar Jadda
|
|
9
9
|
* @since 1.6.0
|
|
10
10
|
*/
|
|
11
|
-
export
|
|
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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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
|
}
|