@js-smart/react-kit 5.12.0-beta.4 → 5.13.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/index.cjs +74 -0
- package/{react-kit/src/index.ts → index.d.ts} +9 -16
- package/index.js +75 -0
- package/index.mjs +6326 -0
- package/lib/components/CenteredCircularProgress.d.ts +7 -0
- package/lib/components/ConfirmationDialog.d.ts +11 -0
- package/lib/components/DismissibleAlert.d.ts +17 -0
- package/lib/components/NextLink.d.ts +17 -0
- package/lib/components/OpenInNewIconLink.d.ts +17 -0
- package/lib/components/ReactIf.d.ts +36 -0
- package/lib/components/buttons/CancelButton.d.ts +28 -0
- package/lib/components/buttons/DeleteButton.d.ts +16 -0
- package/lib/components/buttons/EditIconButton.d.ts +8 -0
- package/lib/components/buttons/ExcelButton.d.ts +26 -0
- package/lib/components/buttons/GoBackButton.d.ts +10 -0
- package/lib/components/buttons/HistoryButton.d.ts +28 -0
- package/lib/components/buttons/LoadingSuccessButton.d.ts +28 -0
- package/lib/components/buttons/ManageButton.d.ts +14 -0
- package/lib/components/buttons/SuccessButton.d.ts +28 -0
- package/lib/components/snack-bar/AppSnackBar.d.ts +6 -0
- package/lib/components/snack-bar/QuerySnackBar.d.ts +18 -0
- package/lib/components/table/TablePaginationActions.d.ts +9 -0
- package/lib/components/tabs/TabPanel.d.ts +12 -0
- package/lib/config/fetch/FetchClient.d.ts +58 -0
- package/lib/config/fetch/FetchClientTypes.d.ts +39 -0
- package/lib/config/fetch/FetchInterceptor.d.ts +21 -0
- package/lib/constants/AppConstants.d.ts +15 -0
- package/lib/constants/HttpConstants.d.ts +13 -0
- package/lib/types/ProgressState.d.ts +7 -0
- package/lib/utils/BooleanUtils.d.ts +7 -0
- package/{react-kit/src/lib/utils/CssUtils.ts → lib/utils/CssUtils.d.ts} +1 -3
- package/lib/utils/DateUtils.d.ts +22 -0
- package/lib/utils/NumberUtils.d.ts +7 -0
- package/lib/utils/ProgressStateUtils.d.ts +38 -0
- package/lib/utils/StringUtils.d.ts +7 -0
- package/lib/utils/UrlUtils.d.ts +11 -0
- package/lib/utils/fetchClient.d.ts +12 -0
- package/package.json +31 -86
- package/.editorconfig +0 -13
- package/.eslintignore +0 -1
- package/.eslintrc.json +0 -41
- package/.github/copilot-instructions.md +0 -11
- package/.github/workflows/build.yml +0 -45
- package/.github/workflows/release.yml +0 -65
- package/.prettierignore +0 -5
- package/.prettierrc +0 -9
- package/.vscode/extensions.json +0 -7
- package/CHANGELOG.md +0 -24
- package/CODE_OF_CONDUCT.md +0 -128
- package/FUNDING.yml +0 -1
- package/LICENSE +0 -21
- package/README.md +0 -1
- package/apps/react-kit-demo/.eslintrc.json +0 -22
- package/apps/react-kit-demo/index.html +0 -16
- package/apps/react-kit-demo/project.json +0 -9
- package/apps/react-kit-demo/public/favicon.ico +0 -0
- package/apps/react-kit-demo/src/app/Home.tsx +0 -17
- package/apps/react-kit-demo/src/app/all-books/AllBooks.tsx +0 -68
- package/apps/react-kit-demo/src/app/app.module.scss +0 -1
- package/apps/react-kit-demo/src/app/app.tsx +0 -29
- package/apps/react-kit-demo/src/app/buttons/ButtonsDemo.tsx +0 -58
- package/apps/react-kit-demo/src/app/dialog/DialogDemo.tsx +0 -23
- package/apps/react-kit-demo/src/app/links/LinksDemo.tsx +0 -20
- package/apps/react-kit-demo/src/app/progress-bar/CenterCircularProgressDemo.tsx +0 -10
- package/apps/react-kit-demo/src/app/react-if/ReactIfDemo.tsx +0 -44
- package/apps/react-kit-demo/src/app/snack-bar/SnackBarDemo.tsx +0 -35
- package/apps/react-kit-demo/src/assets/.gitkeep +0 -0
- package/apps/react-kit-demo/src/constants/ApiConstants.ts +0 -7
- package/apps/react-kit-demo/src/constants/DialogMode.ts +0 -2
- package/apps/react-kit-demo/src/constants/HttpConstants.ts +0 -18
- package/apps/react-kit-demo/src/constants/StateConstants.ts +0 -2
- package/apps/react-kit-demo/src/main.tsx +0 -17
- package/apps/react-kit-demo/src/routes/Routes.tsx +0 -55
- package/apps/react-kit-demo/src/services/BookService.ts +0 -21
- package/apps/react-kit-demo/src/styles.scss +0 -36
- package/apps/react-kit-demo/src/theme.ts +0 -46
- package/apps/react-kit-demo/src/types/Book.ts +0 -8
- package/apps/react-kit-demo/src/utils/CssUtils.ts +0 -13
- package/apps/react-kit-demo/tsconfig.app.json +0 -18
- package/apps/react-kit-demo/tsconfig.json +0 -21
- package/apps/react-kit-demo/tsconfig.spec.json +0 -28
- package/apps/react-kit-demo/vite.config.ts +0 -50
- package/nx.json +0 -52
- package/react-kit/.babelrc +0 -12
- package/react-kit/.eslintrc.json +0 -18
- package/react-kit/README.md +0 -7
- package/react-kit/package-lock.json +0 -1330
- package/react-kit/package.json +0 -45
- package/react-kit/project.json +0 -10
- package/react-kit/src/lib/components/CenteredCircularProgress.tsx +0 -15
- package/react-kit/src/lib/components/ConfirmationDialog.tsx +0 -28
- package/react-kit/src/lib/components/DismissibleAlert.tsx +0 -60
- package/react-kit/src/lib/components/NextLink.tsx +0 -26
- package/react-kit/src/lib/components/OpenInNewIconLink.tsx +0 -42
- package/react-kit/src/lib/components/ReactIf.tsx +0 -53
- package/react-kit/src/lib/components/buttons/CancelButton.tsx +0 -45
- package/react-kit/src/lib/components/buttons/DeleteButton.tsx +0 -35
- package/react-kit/src/lib/components/buttons/EditIconButton.tsx +0 -23
- package/react-kit/src/lib/components/buttons/ExcelButton.tsx +0 -43
- package/react-kit/src/lib/components/buttons/GoBackButton.tsx +0 -22
- package/react-kit/src/lib/components/buttons/HistoryButton.tsx +0 -45
- package/react-kit/src/lib/components/buttons/LoadingSuccessButton.tsx +0 -53
- package/react-kit/src/lib/components/buttons/ManageButton.tsx +0 -31
- package/react-kit/src/lib/components/buttons/SuccessButton.tsx +0 -44
- package/react-kit/src/lib/components/snack-bar/AppSnackBar.tsx +0 -46
- package/react-kit/src/lib/components/snack-bar/QuerySnackBar.tsx +0 -62
- package/react-kit/src/lib/components/table/TablePaginationActions.tsx +0 -58
- package/react-kit/src/lib/components/tabs/TabPanel.tsx +0 -26
- package/react-kit/src/lib/constants/AppConstants.ts +0 -17
- package/react-kit/src/lib/types/ProgressState.ts +0 -7
- package/react-kit/src/lib/utils/BooleanUtils.ts +0 -13
- package/react-kit/src/lib/utils/DateUtils.ts +0 -43
- package/react-kit/src/lib/utils/NumberUtils.ts +0 -12
- package/react-kit/src/lib/utils/ProgressStateUtils.ts +0 -68
- package/react-kit/src/lib/utils/StringUtils.ts +0 -14
- package/react-kit/src/lib/utils/UrlUtils.ts +0 -19
- package/react-kit/src/lib/utils/fetchClient.ts +0 -64
- package/react-kit/src/tests/buttons/CancelButton.test.tsx +0 -69
- package/react-kit/src/tests/buttons/DeleteButton.test.tsx +0 -63
- package/react-kit/src/tests/buttons/EditIconButton.test.tsx +0 -34
- package/react-kit/src/tests/buttons/HistoryButton.test.tsx +0 -46
- package/react-kit/src/tests/buttons/LoadingSuccessButton.test.tsx +0 -53
- package/react-kit/src/tests/buttons/ManageButton.test.tsx +0 -49
- package/react-kit/src/tests/buttons/SuccessButton.test.tsx +0 -46
- package/react-kit/src/tests/snack-bar/AppSnackBar.test.tsx +0 -54
- package/react-kit/src/tests/utils/BooleanUtils.test.ts +0 -35
- package/react-kit/src/tests/utils/CssUtils.test.ts +0 -17
- package/react-kit/src/tests/utils/DateUtils.test.ts +0 -46
- package/react-kit/src/tests/utils/NumberUtils.test.ts +0 -19
- package/react-kit/src/tests/utils/ProgressStateUtils.test.ts +0 -131
- package/react-kit/src/tests/utils/StringUtils.test.ts +0 -33
- package/react-kit/src/tests/utils/UrlUtils.test.ts +0 -19
- package/react-kit/tsconfig.json +0 -21
- package/react-kit/tsconfig.lib.json +0 -18
- package/react-kit/tsconfig.spec.json +0 -27
- package/react-kit/vite.config.ts +0 -72
- package/release.sh +0 -28
- package/tsconfig.base.json +0 -22
- package/vitest.workspace.js +0 -3
- package/vitest.workspace.ts +0 -1
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { Link, Outlet } from 'react-router-dom';
|
|
2
|
-
|
|
3
|
-
export default function App() {
|
|
4
|
-
return (
|
|
5
|
-
<>
|
|
6
|
-
<div className="sidenav">
|
|
7
|
-
<ul>
|
|
8
|
-
<Link to="/">Home</Link> <br />
|
|
9
|
-
<Link to="/buttons">Buttons</Link> <br />
|
|
10
|
-
<Link to="/snack-bar">Snack Bar</Link> <br />
|
|
11
|
-
<Link to="/dialog">Dialog</Link> <br />
|
|
12
|
-
<Link to="/circular-progress">Circular Progress</Link> <br />
|
|
13
|
-
<Link to="/books">All Books</Link> <br />
|
|
14
|
-
<Link to="/react-if">React If Demo</Link> <br />
|
|
15
|
-
<Link to="/links">Links Demo</Link> <br />
|
|
16
|
-
</ul>
|
|
17
|
-
</div>
|
|
18
|
-
|
|
19
|
-
<div className={'main'}>
|
|
20
|
-
<h1 style={{ textAlign: 'center' }}>React Kit Demo</h1>
|
|
21
|
-
<hr />
|
|
22
|
-
<main>
|
|
23
|
-
{/* Nested routes render here */}
|
|
24
|
-
<Outlet />
|
|
25
|
-
</main>
|
|
26
|
-
</div>
|
|
27
|
-
</>
|
|
28
|
-
);
|
|
29
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CancelButton,
|
|
3
|
-
DeleteButton,
|
|
4
|
-
ExcelButton,
|
|
5
|
-
GoBackButton,
|
|
6
|
-
HistoryButton,
|
|
7
|
-
LoadingSuccessButton,
|
|
8
|
-
ManageButton,
|
|
9
|
-
SuccessButton,
|
|
10
|
-
} from '@react-kit/react-kit';
|
|
11
|
-
import { useNavigate } from 'react-router-dom';
|
|
12
|
-
import { Divider } from '@mui/material';
|
|
13
|
-
|
|
14
|
-
export default function ButtonsDemo() {
|
|
15
|
-
const navigate = useNavigate();
|
|
16
|
-
return (
|
|
17
|
-
<div style={{ marginInline: '1rem', textAlign: 'center' }}>
|
|
18
|
-
<h2>Buttons Demo</h2>
|
|
19
|
-
<Divider sx={{ mb: 3 }} />
|
|
20
|
-
Cancel Button:
|
|
21
|
-
<CancelButton onClick={() => console.log('Clicked Cancel Button')} name={'Cancel'}></CancelButton> <br />
|
|
22
|
-
Delete Button:
|
|
23
|
-
<DeleteButton loading={false} onClick={() => console.log('Clicked Delete Button')} /> <br />
|
|
24
|
-
<br />
|
|
25
|
-
<br />
|
|
26
|
-
Excel Button:
|
|
27
|
-
<ExcelButton onClick={() => console.log('Clicked Excel Button')}>Export to Excel</ExcelButton> <br />
|
|
28
|
-
<br />
|
|
29
|
-
<div>
|
|
30
|
-
Success Button:
|
|
31
|
-
<SuccessButton onClick={() => console.log('Clicked Success Button')}>Success</SuccessButton> <br />
|
|
32
|
-
<br />
|
|
33
|
-
</div>
|
|
34
|
-
<div>
|
|
35
|
-
Loading Success Button:
|
|
36
|
-
<LoadingSuccessButton loading={false} onClick={() => console.log('Clicked Loading Success Button')}>
|
|
37
|
-
Save
|
|
38
|
-
</LoadingSuccessButton>
|
|
39
|
-
<br />
|
|
40
|
-
</div>
|
|
41
|
-
<div>
|
|
42
|
-
Go back Button:
|
|
43
|
-
<GoBackButton navigate={navigate}></GoBackButton>
|
|
44
|
-
<br />
|
|
45
|
-
</div>
|
|
46
|
-
<div>
|
|
47
|
-
History Button:
|
|
48
|
-
<HistoryButton onClick={() => console.log('Clicked History Button')}>History</HistoryButton>
|
|
49
|
-
<br />
|
|
50
|
-
</div>
|
|
51
|
-
<div>
|
|
52
|
-
Manage Button:
|
|
53
|
-
<ManageButton onClick={() => console.log('Clicked Manage Button')}>Manage</ManageButton>
|
|
54
|
-
<br />
|
|
55
|
-
</div>
|
|
56
|
-
</div>
|
|
57
|
-
);
|
|
58
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { ConfirmDialog } from '@react-kit/ConfirmDialog';
|
|
2
|
-
import { useState } from 'react';
|
|
3
|
-
import { Button } from '@mui/material';
|
|
4
|
-
|
|
5
|
-
export default function DialogDemo() {
|
|
6
|
-
const [open, setOpen] = useState(false);
|
|
7
|
-
return (
|
|
8
|
-
<div style={{ margin: '1rem', textAlign: 'center' }}>
|
|
9
|
-
<Button onClick={() => setOpen(true)}>Open Dialog</Button>
|
|
10
|
-
|
|
11
|
-
<ConfirmDialog
|
|
12
|
-
id={'confirm-dialog'}
|
|
13
|
-
keepMounted
|
|
14
|
-
message={'Do you want to proceed?'}
|
|
15
|
-
onClose={() => {
|
|
16
|
-
setOpen(false);
|
|
17
|
-
}}
|
|
18
|
-
open={open}
|
|
19
|
-
value={'Yes'}
|
|
20
|
-
/>
|
|
21
|
-
</div>
|
|
22
|
-
);
|
|
23
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Divider } from "@mui/material";
|
|
2
|
-
import { NextLink, OpenInNewIconLink } from "@react-kit/*";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export default function LinksDemo() {
|
|
6
|
-
return (
|
|
7
|
-
<div>
|
|
8
|
-
<div style={{ marginInline: '1rem', textAlign: 'center' }}>
|
|
9
|
-
<h2>Links Demo</h2>
|
|
10
|
-
<Divider sx={{ mb: 3 }} />
|
|
11
|
-
MUI Link:
|
|
12
|
-
<NextLink href={"/buttons-demo"}> Buttons Demo</NextLink>
|
|
13
|
-
<br />
|
|
14
|
-
Open In New Icon Link :
|
|
15
|
-
<OpenInNewIconLink href={`https://www.google.com/`} target="_blank" linkText={'Open In New Tab'} />
|
|
16
|
-
<br />
|
|
17
|
-
</div>
|
|
18
|
-
</div>
|
|
19
|
-
);
|
|
20
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
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
|
|
@@ -1,18 +0,0 @@
|
|
|
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;
|
|
@@ -1,17 +0,0 @@
|
|
|
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
|
-
);
|
|
@@ -1,55 +0,0 @@
|
|
|
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
|
-
]);
|
|
@@ -1,21 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
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;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Get the value of a CSS variable
|
|
3
|
-
*
|
|
4
|
-
* @param variable The name of the CSS variable
|
|
5
|
-
*
|
|
6
|
-
* @returns The value of the CSS variable
|
|
7
|
-
*
|
|
8
|
-
* @author Pavan Kumar Jadda
|
|
9
|
-
* @since 1.6.0
|
|
10
|
-
*/
|
|
11
|
-
export function getCssVariable(variable: string): string {
|
|
12
|
-
return getComputedStyle(document.documentElement).getPropertyValue(variable).trim();
|
|
13
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
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
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
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/react-kit/.babelrc
DELETED
package/react-kit/.eslintrc.json
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": ["plugin:@nx/react", "../.eslintrc.json"],
|
|
3
|
-
"ignorePatterns": ["!**/*", "**/vite.config.*.timestamp*", "**/vitest.config.*.timestamp*"],
|
|
4
|
-
"overrides": [
|
|
5
|
-
{
|
|
6
|
-
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
|
7
|
-
"rules": {}
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
"files": ["*.ts", "*.tsx"],
|
|
11
|
-
"rules": {}
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
"files": ["*.js", "*.jsx"],
|
|
15
|
-
"rules": {}
|
|
16
|
-
}
|
|
17
|
-
]
|
|
18
|
-
}
|