create-react-forge 1.6.0 → 1.6.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/README.md +1 -1
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/parser.d.ts.map +1 -1
- package/dist/cli/parser.js +3 -2
- package/dist/cli/parser.js.map +1 -1
- package/dist/config/defaults.d.ts +1 -1
- package/dist/config/defaults.js +2 -2
- package/dist/config/defaults.js.map +1 -1
- package/dist/config/schema.d.ts +11 -9
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/schema.js +4 -3
- package/dist/config/schema.js.map +1 -1
- package/dist/templates/registry.d.ts +6 -2
- package/dist/templates/registry.d.ts.map +1 -1
- package/dist/templates/registry.js +31 -16
- package/dist/templates/registry.js.map +1 -1
- package/dist/templates/utils.js +4 -4
- package/dist/templates/utils.js.map +1 -1
- package/package.json +1 -1
- package/src/templates/overlays/base/manifest.json +4 -3
- package/src/templates/overlays/base/src/components/ui/Button.tsx +103 -31
- package/src/templates/overlays/base/src/components/ui/Input.tsx +55 -29
- package/src/templates/overlays/base/src/lib/utils.ts +0 -10
- package/src/templates/overlays/runtime/nextjs/src/app/error.tsx +39 -10
- package/src/templates/overlays/runtime/nextjs/src/app/loading.tsx +25 -7
- package/src/templates/overlays/runtime/nextjs/src/app/not-found.tsx +54 -13
- package/src/templates/overlays/runtime/nextjs/src/app/page.tsx +55 -13
- package/src/templates/overlays/runtime/nextjs/src/styles/globals.css +1 -1
- package/src/templates/overlays/runtime/vite/src/components/errors/ErrorFallback.tsx +49 -15
- package/src/templates/overlays/runtime/vite/src/components/ui/LoadingSpinner.tsx +33 -13
- package/src/templates/overlays/runtime/vite/src/features/misc/routes/Landing.tsx +78 -21
- package/src/templates/overlays/runtime/vite/src/features/misc/routes/NotFound.tsx +77 -19
- package/src/templates/overlays/runtime/vite/src/main.tsx +0 -2
- package/src/templates/overlays/styling/css/_nextjs/src/app/error.css +49 -0
- package/src/templates/overlays/styling/css/_nextjs/src/app/error.tsx +34 -0
- package/src/templates/overlays/styling/css/_nextjs/src/app/loading.css +28 -0
- package/src/templates/overlays/styling/css/_nextjs/src/app/loading.tsx +13 -0
- package/src/templates/overlays/styling/css/_nextjs/src/app/not-found.css +70 -0
- package/src/templates/overlays/styling/css/_nextjs/src/app/not-found.tsx +25 -0
- package/src/templates/overlays/styling/css/_nextjs/src/app/page.css +73 -0
- package/src/templates/overlays/styling/css/_nextjs/src/app/page.tsx +32 -0
- package/src/templates/overlays/styling/css/_vite/src/components/errors/ErrorFallback.css +49 -0
- package/src/templates/overlays/styling/css/_vite/src/components/errors/ErrorFallback.tsx +22 -0
- package/src/templates/overlays/styling/css/_vite/src/components/ui/LoadingSpinner.css +40 -0
- package/src/templates/overlays/styling/css/_vite/src/components/ui/LoadingSpinner.tsx +21 -0
- package/src/templates/overlays/styling/css/_vite/src/features/misc/routes/Landing.css +73 -0
- package/src/templates/overlays/styling/css/_vite/src/features/misc/routes/Landing.tsx +32 -0
- package/src/templates/overlays/styling/css/_vite/src/features/misc/routes/NotFound.css +70 -0
- package/src/templates/overlays/styling/css/_vite/src/features/misc/routes/NotFound.tsx +25 -0
- package/src/templates/overlays/styling/css/manifest.json +17 -0
- package/src/templates/overlays/styling/css/src/styles/globals.css +107 -0
- package/src/templates/overlays/styling/css-modules/_nextjs/src/app/loading.tsx +13 -0
- package/src/templates/overlays/styling/css-modules/_nextjs/src/app/page.module.css +73 -0
- package/src/templates/overlays/styling/css-modules/_nextjs/src/app/page.tsx +32 -0
- package/src/templates/overlays/styling/css-modules/_vite/src/components/errors/ErrorFallback.module.css +45 -0
- package/src/templates/overlays/styling/css-modules/_vite/src/components/errors/ErrorFallback.tsx +22 -0
- package/src/templates/overlays/styling/css-modules/_vite/src/components/ui/LoadingSpinner.module.css +40 -0
- package/src/templates/overlays/styling/css-modules/_vite/src/components/ui/LoadingSpinner.tsx +23 -0
- package/src/templates/overlays/styling/css-modules/_vite/src/features/misc/routes/Landing.module.css +73 -0
- package/src/templates/overlays/styling/css-modules/_vite/src/features/misc/routes/Landing.tsx +32 -0
- package/src/templates/overlays/styling/css-modules/_vite/src/features/misc/routes/NotFound.module.css +67 -0
- package/src/templates/overlays/styling/css-modules/_vite/src/features/misc/routes/NotFound.tsx +25 -0
- package/src/templates/overlays/styling/css-modules/manifest.json +6 -3
- package/src/templates/overlays/styling/css-modules/src/css.d.ts +13 -0
- package/src/templates/overlays/styling/styled-components/_nextjs/src/app/error.tsx +72 -0
- package/src/templates/overlays/styling/styled-components/_nextjs/src/app/layout.tsx +25 -0
- package/src/templates/overlays/styling/styled-components/_nextjs/src/app/loading.tsx +40 -0
- package/src/templates/overlays/styling/styled-components/_nextjs/src/app/not-found.tsx +91 -0
- package/src/templates/overlays/styling/styled-components/_nextjs/src/app/page.tsx +102 -0
- package/src/templates/overlays/styling/styled-components/_nextjs/src/app/providers.tsx +22 -0
- package/src/templates/overlays/styling/styled-components/{src → _nextjs/src}/lib/StyledComponentsRegistry.tsx +10 -2
- package/src/templates/overlays/styling/styled-components/_vite/src/app/provider.tsx +27 -0
- package/src/templates/overlays/styling/styled-components/_vite/src/components/errors/ErrorFallback.tsx +59 -0
- package/src/templates/overlays/styling/styled-components/_vite/src/components/ui/LoadingSpinner.tsx +47 -0
- package/src/templates/overlays/styling/styled-components/_vite/src/features/misc/routes/Landing.tsx +100 -0
- package/src/templates/overlays/styling/styled-components/_vite/src/features/misc/routes/NotFound.tsx +89 -0
- package/src/templates/overlays/styling/styled-components/_vite/src/main.tsx +13 -0
- package/src/templates/overlays/styling/styled-components/manifest.json +5 -1
- package/src/templates/overlays/styling/tailwind/_nextjs/src/app/error.tsx +33 -0
- package/src/templates/overlays/styling/tailwind/_nextjs/src/app/loading.tsx +12 -0
- package/src/templates/overlays/styling/tailwind/_nextjs/src/app/not-found.tsx +26 -0
- package/src/templates/overlays/styling/tailwind/_nextjs/src/app/page.tsx +33 -0
- package/src/templates/overlays/styling/tailwind/manifest.json +5 -3
- package/src/templates/overlays/runtime/vite/src/styles/globals.css +0 -55
- package/src/templates/overlays/styling/css-modules/src/components/ui/Button.module.css +0 -87
- package/src/templates/overlays/styling/css-modules/src/styles/globals.css +0 -91
|
@@ -1,26 +1,84 @@
|
|
|
1
1
|
import { Link } from 'react-router-dom';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
const Container = styled.div`
|
|
5
|
+
display: flex;
|
|
6
|
+
min-height: 100vh;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
align-items: center;
|
|
9
|
+
justify-content: center;
|
|
10
|
+
`;
|
|
11
|
+
|
|
12
|
+
const Content = styled.div`
|
|
13
|
+
text-align: center;
|
|
14
|
+
`;
|
|
15
|
+
|
|
16
|
+
const ErrorCode = styled.p`
|
|
17
|
+
font-size: 1rem;
|
|
18
|
+
font-weight: 600;
|
|
19
|
+
color: #4f46e5;
|
|
20
|
+
`;
|
|
21
|
+
|
|
22
|
+
const Title = styled.h1`
|
|
23
|
+
margin-top: 1rem;
|
|
24
|
+
font-size: 1.875rem;
|
|
25
|
+
font-weight: 700;
|
|
26
|
+
letter-spacing: -0.025em;
|
|
27
|
+
|
|
28
|
+
@media (min-width: 640px) {
|
|
29
|
+
font-size: 3rem;
|
|
30
|
+
}
|
|
31
|
+
`;
|
|
32
|
+
|
|
33
|
+
const Description = styled.p`
|
|
34
|
+
margin-top: 1.5rem;
|
|
35
|
+
font-size: 1rem;
|
|
36
|
+
line-height: 1.75rem;
|
|
37
|
+
color: #4b5563;
|
|
38
|
+
`;
|
|
39
|
+
|
|
40
|
+
const Actions = styled.div`
|
|
41
|
+
margin-top: 2.5rem;
|
|
42
|
+
display: flex;
|
|
43
|
+
align-items: center;
|
|
44
|
+
justify-content: center;
|
|
45
|
+
gap: 1.5rem;
|
|
46
|
+
`;
|
|
47
|
+
|
|
48
|
+
const HomeLink = styled(Link)`
|
|
49
|
+
padding: 0.625rem 0.875rem;
|
|
50
|
+
font-size: 0.875rem;
|
|
51
|
+
font-weight: 600;
|
|
52
|
+
color: white;
|
|
53
|
+
background-color: #4f46e5;
|
|
54
|
+
border-radius: 0.375rem;
|
|
55
|
+
box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
|
|
56
|
+
text-decoration: none;
|
|
57
|
+
transition: background-color 0.2s;
|
|
58
|
+
|
|
59
|
+
&:hover {
|
|
60
|
+
background-color: #6366f1;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&:focus-visible {
|
|
64
|
+
outline: 2px solid #4f46e5;
|
|
65
|
+
outline-offset: 2px;
|
|
66
|
+
}
|
|
67
|
+
`;
|
|
2
68
|
|
|
3
69
|
export function NotFound() {
|
|
4
70
|
return (
|
|
5
|
-
<
|
|
6
|
-
<
|
|
7
|
-
<
|
|
8
|
-
<
|
|
9
|
-
|
|
10
|
-
</h1>
|
|
11
|
-
<p className="mt-6 text-base leading-7 text-gray-600">
|
|
71
|
+
<Container>
|
|
72
|
+
<Content>
|
|
73
|
+
<ErrorCode>404</ErrorCode>
|
|
74
|
+
<Title>Page not found</Title>
|
|
75
|
+
<Description>
|
|
12
76
|
Sorry, we couldn't find the page you're looking for.
|
|
13
|
-
</
|
|
14
|
-
<
|
|
15
|
-
<
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
Go back home
|
|
20
|
-
</Link>
|
|
21
|
-
</div>
|
|
22
|
-
</div>
|
|
23
|
-
</div>
|
|
77
|
+
</Description>
|
|
78
|
+
<Actions>
|
|
79
|
+
<HomeLink to="/">Go back home</HomeLink>
|
|
80
|
+
</Actions>
|
|
81
|
+
</Content>
|
|
82
|
+
</Container>
|
|
24
83
|
);
|
|
25
84
|
}
|
|
26
|
-
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
.error-container {
|
|
2
|
+
display: flex;
|
|
3
|
+
min-height: 100vh;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
align-items: center;
|
|
6
|
+
justify-content: center;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.error-content {
|
|
10
|
+
text-align: center;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.error-title {
|
|
14
|
+
font-size: 1.5rem;
|
|
15
|
+
font-weight: 700;
|
|
16
|
+
color: var(--color-danger);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.error-message {
|
|
20
|
+
margin-top: 1rem;
|
|
21
|
+
color: var(--color-text-muted);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.btn {
|
|
25
|
+
display: inline-block;
|
|
26
|
+
font-weight: 600;
|
|
27
|
+
text-decoration: none;
|
|
28
|
+
transition: all 0.2s;
|
|
29
|
+
border: none;
|
|
30
|
+
cursor: pointer;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.btn-primary {
|
|
34
|
+
margin-top: 1.5rem;
|
|
35
|
+
border-radius: var(--radius-md);
|
|
36
|
+
background-color: var(--color-primary);
|
|
37
|
+
padding: 0.625rem 0.875rem;
|
|
38
|
+
font-size: 0.875rem;
|
|
39
|
+
color: white;
|
|
40
|
+
box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.btn-primary:hover {
|
|
44
|
+
background-color: var(--color-primary-hover);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useEffect } from 'react';
|
|
4
|
+
import './error.css';
|
|
5
|
+
|
|
6
|
+
export default function Error({
|
|
7
|
+
error,
|
|
8
|
+
reset,
|
|
9
|
+
}: {
|
|
10
|
+
error: Error & { digest?: string };
|
|
11
|
+
reset: () => void;
|
|
12
|
+
}) {
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
console.error(error);
|
|
15
|
+
}, [error]);
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<div className="error-container" role="alert">
|
|
19
|
+
<div className="error-content">
|
|
20
|
+
<h1 className="error-title">Something went wrong</h1>
|
|
21
|
+
<p className="error-message">
|
|
22
|
+
{error.message || 'An unexpected error occurred'}
|
|
23
|
+
</p>
|
|
24
|
+
<button onClick={reset} className="btn btn-primary">
|
|
25
|
+
Try again
|
|
26
|
+
</button>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
.spinner-container {
|
|
2
|
+
display: flex;
|
|
3
|
+
min-height: 100vh;
|
|
4
|
+
align-items: center;
|
|
5
|
+
justify-content: center;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.spinner {
|
|
9
|
+
width: 2rem;
|
|
10
|
+
height: 2rem;
|
|
11
|
+
border-radius: 50%;
|
|
12
|
+
border: 2px solid var(--color-border);
|
|
13
|
+
border-top-color: var(--color-primary);
|
|
14
|
+
animation: spin 1s linear infinite;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@keyframes spin {
|
|
18
|
+
from {
|
|
19
|
+
transform: rotate(0deg);
|
|
20
|
+
}
|
|
21
|
+
to {
|
|
22
|
+
transform: rotate(360deg);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
.not-found-container {
|
|
2
|
+
display: flex;
|
|
3
|
+
min-height: 100vh;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
align-items: center;
|
|
6
|
+
justify-content: center;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.not-found-content {
|
|
10
|
+
text-align: center;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.not-found-code {
|
|
14
|
+
font-size: 1rem;
|
|
15
|
+
font-weight: 600;
|
|
16
|
+
color: var(--color-primary);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.not-found-title {
|
|
20
|
+
margin-top: 1rem;
|
|
21
|
+
font-size: 1.875rem;
|
|
22
|
+
font-weight: 700;
|
|
23
|
+
letter-spacing: -0.025em;
|
|
24
|
+
color: var(--color-text);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@media (min-width: 640px) {
|
|
28
|
+
.not-found-title {
|
|
29
|
+
font-size: 3rem;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.not-found-description {
|
|
34
|
+
margin-top: 1.5rem;
|
|
35
|
+
font-size: 1rem;
|
|
36
|
+
line-height: 1.75rem;
|
|
37
|
+
color: var(--color-text-muted);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.not-found-buttons {
|
|
41
|
+
margin-top: 2.5rem;
|
|
42
|
+
display: flex;
|
|
43
|
+
align-items: center;
|
|
44
|
+
justify-content: center;
|
|
45
|
+
gap: 1.5rem;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.btn {
|
|
49
|
+
display: inline-block;
|
|
50
|
+
font-weight: 600;
|
|
51
|
+
text-decoration: none;
|
|
52
|
+
transition: all 0.2s;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.btn-primary {
|
|
56
|
+
border-radius: var(--radius-md);
|
|
57
|
+
background-color: var(--color-primary);
|
|
58
|
+
padding: 0.625rem 0.875rem;
|
|
59
|
+
font-size: 0.875rem;
|
|
60
|
+
color: white;
|
|
61
|
+
box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.btn-primary:hover {
|
|
65
|
+
background-color: var(--color-primary-hover);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import Link from 'next/link';
|
|
2
|
+
import './not-found.css';
|
|
3
|
+
|
|
4
|
+
export default function NotFound() {
|
|
5
|
+
return (
|
|
6
|
+
<div className="not-found-container">
|
|
7
|
+
<div className="not-found-content">
|
|
8
|
+
<p className="not-found-code">404</p>
|
|
9
|
+
<h1 className="not-found-title">Page not found</h1>
|
|
10
|
+
<p className="not-found-description">
|
|
11
|
+
Sorry, we couldn't find the page you're looking for.
|
|
12
|
+
</p>
|
|
13
|
+
<div className="not-found-buttons">
|
|
14
|
+
<Link href="/" className="btn btn-primary">
|
|
15
|
+
Go back home
|
|
16
|
+
</Link>
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
.landing-container {
|
|
2
|
+
display: flex;
|
|
3
|
+
min-height: 100vh;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
align-items: center;
|
|
6
|
+
justify-content: center;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.landing-content {
|
|
10
|
+
text-align: center;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.landing-title {
|
|
14
|
+
font-size: 2.25rem;
|
|
15
|
+
font-weight: 700;
|
|
16
|
+
letter-spacing: -0.025em;
|
|
17
|
+
color: var(--color-text);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@media (min-width: 640px) {
|
|
21
|
+
.landing-title {
|
|
22
|
+
font-size: 3.75rem;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.landing-description {
|
|
27
|
+
margin-top: 1.5rem;
|
|
28
|
+
font-size: 1.125rem;
|
|
29
|
+
line-height: 2rem;
|
|
30
|
+
color: var(--color-text-muted);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.landing-buttons {
|
|
34
|
+
margin-top: 2.5rem;
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
justify-content: center;
|
|
38
|
+
gap: 1.5rem;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.btn {
|
|
42
|
+
display: inline-block;
|
|
43
|
+
font-weight: 600;
|
|
44
|
+
text-decoration: none;
|
|
45
|
+
transition: all 0.2s;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.btn-primary {
|
|
49
|
+
border-radius: var(--radius-md);
|
|
50
|
+
background-color: var(--color-primary);
|
|
51
|
+
padding: 0.625rem 0.875rem;
|
|
52
|
+
font-size: 0.875rem;
|
|
53
|
+
color: white;
|
|
54
|
+
box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.btn-primary:hover {
|
|
58
|
+
background-color: var(--color-primary-hover);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.btn-link {
|
|
62
|
+
font-size: 0.875rem;
|
|
63
|
+
line-height: 1.5rem;
|
|
64
|
+
color: var(--color-text);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.btn-link:hover {
|
|
68
|
+
color: var(--color-primary);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import Link from 'next/link';
|
|
2
|
+
import './page.css';
|
|
3
|
+
|
|
4
|
+
export default function HomePage() {
|
|
5
|
+
return (
|
|
6
|
+
<div className="landing-container">
|
|
7
|
+
<div className="landing-content">
|
|
8
|
+
<h1 className="landing-title">Welcome to Your App</h1>
|
|
9
|
+
<p className="landing-description">
|
|
10
|
+
A production-ready Next.js application scaffolded with create-react-forge.
|
|
11
|
+
</p>
|
|
12
|
+
<div className="landing-buttons">
|
|
13
|
+
<Link href="/dashboard" className="btn btn-primary">
|
|
14
|
+
Get started
|
|
15
|
+
</Link>
|
|
16
|
+
<a
|
|
17
|
+
href="https://github.com/alan2207/bulletproof-react"
|
|
18
|
+
className="btn btn-link"
|
|
19
|
+
target="_blank"
|
|
20
|
+
rel="noopener noreferrer"
|
|
21
|
+
>
|
|
22
|
+
Learn more <span aria-hidden="true">→</span>
|
|
23
|
+
</a>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
.error-container {
|
|
2
|
+
display: flex;
|
|
3
|
+
min-height: 100vh;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
align-items: center;
|
|
6
|
+
justify-content: center;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.error-content {
|
|
10
|
+
text-align: center;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.error-title {
|
|
14
|
+
font-size: 1.5rem;
|
|
15
|
+
font-weight: 700;
|
|
16
|
+
color: var(--color-danger);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.error-message {
|
|
20
|
+
margin-top: 1rem;
|
|
21
|
+
color: var(--color-text-muted);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.btn {
|
|
25
|
+
display: inline-block;
|
|
26
|
+
font-weight: 600;
|
|
27
|
+
text-decoration: none;
|
|
28
|
+
transition: all 0.2s;
|
|
29
|
+
border: none;
|
|
30
|
+
cursor: pointer;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.btn-primary {
|
|
34
|
+
margin-top: 1.5rem;
|
|
35
|
+
border-radius: var(--radius-md);
|
|
36
|
+
background-color: var(--color-primary);
|
|
37
|
+
padding: 0.625rem 0.875rem;
|
|
38
|
+
font-size: 0.875rem;
|
|
39
|
+
color: white;
|
|
40
|
+
box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.btn-primary:hover {
|
|
44
|
+
background-color: var(--color-primary-hover);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { FallbackProps } from 'react-error-boundary';
|
|
2
|
+
import './ErrorFallback.css';
|
|
3
|
+
|
|
4
|
+
export function ErrorFallback({ error, resetErrorBoundary }: FallbackProps) {
|
|
5
|
+
return (
|
|
6
|
+
<div className="error-container" role="alert">
|
|
7
|
+
<div className="error-content">
|
|
8
|
+
<h1 className="error-title">Something went wrong</h1>
|
|
9
|
+
<p className="error-message">
|
|
10
|
+
{error.message || 'An unexpected error occurred'}
|
|
11
|
+
</p>
|
|
12
|
+
<button onClick={resetErrorBoundary} className="btn btn-primary">
|
|
13
|
+
Try again
|
|
14
|
+
</button>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
.spinner-container {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.spinner {
|
|
8
|
+
border-radius: 50%;
|
|
9
|
+
border: 2px solid var(--color-border);
|
|
10
|
+
border-top-color: var(--color-primary);
|
|
11
|
+
animation: spin 1s linear infinite;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.spinner-sm {
|
|
15
|
+
width: 1rem;
|
|
16
|
+
height: 1rem;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.spinner-md {
|
|
20
|
+
width: 2rem;
|
|
21
|
+
height: 2rem;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.spinner-lg {
|
|
25
|
+
width: 4rem;
|
|
26
|
+
height: 4rem;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@keyframes spin {
|
|
30
|
+
from {
|
|
31
|
+
transform: rotate(0deg);
|
|
32
|
+
}
|
|
33
|
+
to {
|
|
34
|
+
transform: rotate(360deg);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import './LoadingSpinner.css';
|
|
2
|
+
|
|
3
|
+
type LoadingSpinnerProps = {
|
|
4
|
+
size?: 'sm' | 'md' | 'lg';
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export function LoadingSpinner({ size = 'md' }: LoadingSpinnerProps) {
|
|
8
|
+
return (
|
|
9
|
+
<div className="spinner-container">
|
|
10
|
+
<div
|
|
11
|
+
className={`spinner spinner-${size}`}
|
|
12
|
+
role="status"
|
|
13
|
+
aria-label="Loading"
|
|
14
|
+
/>
|
|
15
|
+
</div>
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
.landing-container {
|
|
2
|
+
display: flex;
|
|
3
|
+
min-height: 100vh;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
align-items: center;
|
|
6
|
+
justify-content: center;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.landing-content {
|
|
10
|
+
text-align: center;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.landing-title {
|
|
14
|
+
font-size: 2.25rem;
|
|
15
|
+
font-weight: 700;
|
|
16
|
+
letter-spacing: -0.025em;
|
|
17
|
+
color: var(--color-text);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@media (min-width: 640px) {
|
|
21
|
+
.landing-title {
|
|
22
|
+
font-size: 3.75rem;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.landing-description {
|
|
27
|
+
margin-top: 1.5rem;
|
|
28
|
+
font-size: 1.125rem;
|
|
29
|
+
line-height: 2rem;
|
|
30
|
+
color: var(--color-text-muted);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.landing-buttons {
|
|
34
|
+
margin-top: 2.5rem;
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
justify-content: center;
|
|
38
|
+
gap: 1.5rem;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.btn {
|
|
42
|
+
display: inline-block;
|
|
43
|
+
font-weight: 600;
|
|
44
|
+
text-decoration: none;
|
|
45
|
+
transition: all 0.2s;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.btn-primary {
|
|
49
|
+
border-radius: var(--radius-md);
|
|
50
|
+
background-color: var(--color-primary);
|
|
51
|
+
padding: 0.625rem 0.875rem;
|
|
52
|
+
font-size: 0.875rem;
|
|
53
|
+
color: white;
|
|
54
|
+
box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.btn-primary:hover {
|
|
58
|
+
background-color: var(--color-primary-hover);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.btn-link {
|
|
62
|
+
font-size: 0.875rem;
|
|
63
|
+
line-height: 1.5rem;
|
|
64
|
+
color: var(--color-text);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.btn-link:hover {
|
|
68
|
+
color: var(--color-primary);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Link } from 'react-router-dom';
|
|
2
|
+
import './Landing.css';
|
|
3
|
+
|
|
4
|
+
export function Landing() {
|
|
5
|
+
return (
|
|
6
|
+
<div className="landing-container">
|
|
7
|
+
<div className="landing-content">
|
|
8
|
+
<h1 className="landing-title">Welcome to Your App</h1>
|
|
9
|
+
<p className="landing-description">
|
|
10
|
+
A production-ready React application scaffolded with create-react-forge.
|
|
11
|
+
</p>
|
|
12
|
+
<div className="landing-buttons">
|
|
13
|
+
<Link to="/dashboard" className="btn btn-primary">
|
|
14
|
+
Get started
|
|
15
|
+
</Link>
|
|
16
|
+
<a
|
|
17
|
+
href="https://github.com/alan2207/bulletproof-react"
|
|
18
|
+
className="btn btn-link"
|
|
19
|
+
target="_blank"
|
|
20
|
+
rel="noopener noreferrer"
|
|
21
|
+
>
|
|
22
|
+
Learn more <span aria-hidden="true">→</span>
|
|
23
|
+
</a>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|