create-react-scaffold-cli 1.0.2 → 1.0.5
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/package.json +1 -1
- package/templates/base/{readme.md → README.md} +165 -95
- package/templates/base/docs/DOCS.md +7 -0
- package/templates/base/index.html +3 -3
- package/templates/base/package.json +2 -0
- package/templates/base/public/icons/react.svg +1 -0
- package/templates/base/src/app/App.jsx +8 -6
- package/templates/base/src/app/Router.jsx +42 -2
- package/templates/base/src/app/index.css +36 -0
- package/templates/base/src/app/main.jsx +1 -1
- package/templates/base/src/app/middlewares/AuthMiddleware.jsx +5 -0
- package/templates/base/src/app/middlewares/index.js +1 -0
- package/templates/base/src/app/providers/QueryProvider.jsx +1 -1
- package/templates/base/src/app/routes.registry.js +8 -0
- package/templates/base/src/features/sample/constants/index.js +3 -0
- package/templates/base/src/features/sample/constants/sample.assets.js +8 -0
- package/templates/base/src/features/sample/constants/sample.navigations.js +5 -0
- package/templates/base/src/features/sample/constants/sample.queryKeys.js +3 -0
- package/templates/base/src/features/sample/index.js +1 -0
- package/templates/base/src/features/sample/pages/SamplePage.jsx +8 -0
- package/templates/base/src/features/sample/pages/index.js +3 -0
- package/templates/base/src/features/sample/sample.routes.js +12 -0
- package/templates/base/src/features/welcome/components/CodeLine.jsx +54 -0
- package/templates/base/src/features/welcome/components/Divider.jsx +7 -0
- package/templates/base/src/features/welcome/components/Footer.jsx +78 -0
- package/templates/base/src/features/welcome/components/Hero.jsx +131 -0
- package/templates/base/src/features/welcome/components/IconLink.jsx +18 -0
- package/templates/base/src/features/welcome/components/QuickStartPanel.jsx +63 -0
- package/templates/base/src/features/welcome/components/RingSoft.jsx +16 -0
- package/templates/base/src/features/welcome/components/StorySections.jsx +63 -0
- package/templates/base/src/features/welcome/components/WhatYouGet.jsx +49 -0
- package/templates/base/src/features/welcome/components/index.js +5 -0
- package/templates/base/src/features/welcome/constants/index.js +2 -0
- package/templates/base/src/features/welcome/constants/welcome.constants.js +21 -0
- package/templates/base/src/features/welcome/constants/welcome.navigations.js +3 -0
- package/templates/base/src/features/welcome/index.js +1 -0
- package/templates/base/src/features/welcome/pages/WelcomePage.jsx +28 -0
- package/templates/base/src/features/welcome/pages/index.js +3 -0
- package/templates/base/src/features/welcome/welcome.routes.js +12 -0
- package/templates/base/src/shared/{shared_readme.md → SHARED.md} +7 -1
- package/templates/base/src/shared/constants/app.constants.js +6 -0
- package/templates/base/src/shared/constants/assets.constants.js +5 -0
- package/templates/base/src/shared/constants/index.js +2 -0
- package/templates/base/src/shared/theme/theme.js +26 -15
- package/templates/base/src/shared/ui/Box.jsx +1 -14
- package/templates/base/src/shared/ui/Button.jsx +4 -5
- package/templates/base/src/shared/ui/DropdownMenu.jsx +57 -91
- package/templates/base/src/shared/ui/GridItem.jsx +1 -0
- package/templates/base/src/shared/ui/Modal.jsx +1 -0
- package/templates/base/src/shared/ui/Text.jsx +3 -3
- package/templates/base/src/shared/ui/index.js +17 -0
- package/templates/base/src/shared/utils/localStorage.js +18 -0
- package/templates/base/src/shared/utils/memo.js +6 -0
- package/templates/base/src/shared/utils/regix.js +3 -0
- package/templates/base/vercel.json +3 -0
- package/templates/base/vite.config.js +4 -5
- package/templates/base/src/features/sample/sample.assets.js +0 -0
- package/templates/base/src/features/sample/sample.navigations.js +0 -0
- package/templates/base/src/features/sample/sample.queryKeys.js +0 -0
- package/templates/base/src/features/sample/sample.routes.jsx +0 -0
- /package/templates/base/src/app/{app_readme.md → APP.md} +0 -0
- /package/templates/base/src/features/{features_readme.md → FEATURES.md} +0 -0
- /package/templates/base/src/{features/index.js → shared/utils/motion.js} +0 -0
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Box, Button, Flex, FlexItem, Grid, Text } from '@/shared/ui';
|
|
3
|
+
import { FaGithub, FaLinkedin, FaNpm } from 'react-icons/fa';
|
|
4
|
+
import { QuickStartPanel } from './QuickStartPanel';
|
|
5
|
+
import { Links } from '../constants';
|
|
6
|
+
import { IconLink } from './IconLink';
|
|
7
|
+
|
|
8
|
+
export const Hero = React.memo(() => {
|
|
9
|
+
return (
|
|
10
|
+
<Grid
|
|
11
|
+
align="start"
|
|
12
|
+
gap={{ base: 10, md: 12 }}
|
|
13
|
+
className="md:grid-cols-[1.25fr_0.75fr] md:gap-12"
|
|
14
|
+
>
|
|
15
|
+
<Flex gap={5} direction="column">
|
|
16
|
+
<Box padding={{ x: 3, y: 1 }} width="fit" className="rounded-full bg-badge">
|
|
17
|
+
<Flex gap={2} align="center">
|
|
18
|
+
<FlexItem>
|
|
19
|
+
<Box radius="full" className="size-1.5 bg-primary" />
|
|
20
|
+
</FlexItem>
|
|
21
|
+
<FlexItem>
|
|
22
|
+
<Text size="sm" weight="semibold">
|
|
23
|
+
React Scaffold
|
|
24
|
+
</Text>
|
|
25
|
+
</FlexItem>
|
|
26
|
+
</Flex>
|
|
27
|
+
</Box>
|
|
28
|
+
|
|
29
|
+
<Flex gap={2} align="center" className="-mt-2">
|
|
30
|
+
<FlexItem>
|
|
31
|
+
<Text size="sm" color="muted">
|
|
32
|
+
Created by
|
|
33
|
+
</Text>
|
|
34
|
+
</FlexItem>
|
|
35
|
+
<FlexItem>
|
|
36
|
+
<a
|
|
37
|
+
href={Links.CreatorGithub}
|
|
38
|
+
target="_blank"
|
|
39
|
+
rel="noreferrer"
|
|
40
|
+
className="font-semibold text-ink hover:text-primary transition-colors"
|
|
41
|
+
>
|
|
42
|
+
{Links.CreatorName}
|
|
43
|
+
</a>
|
|
44
|
+
</FlexItem>
|
|
45
|
+
</Flex>
|
|
46
|
+
|
|
47
|
+
<FlexItem>
|
|
48
|
+
<Text
|
|
49
|
+
weight="black"
|
|
50
|
+
font="plus-jakarta-sans"
|
|
51
|
+
size={{ base: '4xl', lg: '5xl', '2xl': '6xl' }}
|
|
52
|
+
className="tracking-tight bg-linear-to-r from-ink to-primary bg-clip-text text-transparent"
|
|
53
|
+
>
|
|
54
|
+
Start building with React Scaffold
|
|
55
|
+
</Text>
|
|
56
|
+
</FlexItem>
|
|
57
|
+
|
|
58
|
+
<FlexItem>
|
|
59
|
+
<Text size="base" color="muted" className="max-w-xl text-base leading-relaxed">
|
|
60
|
+
A modern, opinionated starter that keeps your codebase clean as it grows — feature-first
|
|
61
|
+
structure, shared UI primitives, and best-practice tooling out of the box.
|
|
62
|
+
</Text>
|
|
63
|
+
</FlexItem>
|
|
64
|
+
|
|
65
|
+
<FlexItem>
|
|
66
|
+
<Text size="sm" color="muted" className="max-w-xl">
|
|
67
|
+
This is the default starter page. Replace it with your product UI when you’re ready.
|
|
68
|
+
</Text>
|
|
69
|
+
</FlexItem>
|
|
70
|
+
|
|
71
|
+
<FlexItem>
|
|
72
|
+
<Flex gap={3} direction={{ base: 'column', md: 'row' }} className="mt-2">
|
|
73
|
+
<FlexItem>
|
|
74
|
+
<Button
|
|
75
|
+
className="rounded-full"
|
|
76
|
+
onClick={() => window.open(Links.AppGithub, '_blank', 'noopener,noreferrer')}
|
|
77
|
+
>
|
|
78
|
+
Open Project Repo
|
|
79
|
+
</Button>
|
|
80
|
+
</FlexItem>
|
|
81
|
+
|
|
82
|
+
<FlexItem>
|
|
83
|
+
<Button
|
|
84
|
+
variant="outline"
|
|
85
|
+
className="rounded-full"
|
|
86
|
+
onClick={() => window.open(Links.NpmPackage, '_blank', 'noopener,noreferrer')}
|
|
87
|
+
>
|
|
88
|
+
View NPM Package
|
|
89
|
+
</Button>
|
|
90
|
+
</FlexItem>
|
|
91
|
+
</Flex>
|
|
92
|
+
</FlexItem>
|
|
93
|
+
|
|
94
|
+
<FlexItem>
|
|
95
|
+
<Flex gap={2} align="center">
|
|
96
|
+
<FlexItem>
|
|
97
|
+
<IconLink
|
|
98
|
+
href={Links.AppGithub}
|
|
99
|
+
label="App Repo"
|
|
100
|
+
icon={<FaGithub className="size-4" />}
|
|
101
|
+
/>
|
|
102
|
+
</FlexItem>
|
|
103
|
+
<FlexItem>
|
|
104
|
+
<IconLink
|
|
105
|
+
href={Links.CliGithub}
|
|
106
|
+
label="CLI Repo"
|
|
107
|
+
icon={<FaGithub className="size-4" />}
|
|
108
|
+
/>
|
|
109
|
+
</FlexItem>
|
|
110
|
+
<FlexItem>
|
|
111
|
+
<IconLink href={Links.NpmPackage} label="NPM" icon={<FaNpm className="size-4" />} />
|
|
112
|
+
</FlexItem>
|
|
113
|
+
|
|
114
|
+
<>
|
|
115
|
+
<span className="text-border -mt-1">•</span>
|
|
116
|
+
<FlexItem>
|
|
117
|
+
<IconLink
|
|
118
|
+
href={Links.CreatorLinkedIn}
|
|
119
|
+
label="Creator"
|
|
120
|
+
icon={<FaLinkedin className="size-4" />}
|
|
121
|
+
/>
|
|
122
|
+
</FlexItem>
|
|
123
|
+
</>
|
|
124
|
+
</Flex>
|
|
125
|
+
</FlexItem>
|
|
126
|
+
</Flex>
|
|
127
|
+
|
|
128
|
+
<QuickStartPanel />
|
|
129
|
+
</Grid>
|
|
130
|
+
);
|
|
131
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Text } from '@/shared/ui';
|
|
3
|
+
|
|
4
|
+
export const IconLink = React.memo(({ href, icon, label }) => {
|
|
5
|
+
return (
|
|
6
|
+
<a
|
|
7
|
+
href={href}
|
|
8
|
+
target="_blank"
|
|
9
|
+
rel="noreferrer"
|
|
10
|
+
className="inline-flex items-center gap-2 text-muted hover:text-primary transition-colors"
|
|
11
|
+
>
|
|
12
|
+
<span className="text-primary">{icon}</span>
|
|
13
|
+
<Text size="sm" className="leading-none">
|
|
14
|
+
{label}
|
|
15
|
+
</Text>
|
|
16
|
+
</a>
|
|
17
|
+
);
|
|
18
|
+
});
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Box, Flex, FlexItem, Text } from '@/shared/ui';
|
|
3
|
+
import { RingSoft } from './RingSoft';
|
|
4
|
+
import { CodeLine } from './CodeLine';
|
|
5
|
+
import { Commands } from '../constants';
|
|
6
|
+
|
|
7
|
+
function StepLight({ label, children }) {
|
|
8
|
+
return (
|
|
9
|
+
<Box>
|
|
10
|
+
<Text className="text-sm font-semibold text-ink">{label}</Text>
|
|
11
|
+
<Box className="mt-2">{children}</Box>
|
|
12
|
+
</Box>
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const QuickStartPanel = React.memo(() => {
|
|
17
|
+
return (
|
|
18
|
+
<Box className="relative overflow-hidden rounded-2xl bg-surface/70 p-6 md:p-7 ring-1 ring-border">
|
|
19
|
+
<Box className="pointer-events-none absolute inset-0 opacity-100">
|
|
20
|
+
<RingSoft className="right-[-7rem] top-[-6rem]" size="22rem" />
|
|
21
|
+
<RingSoft className="right-[-5rem] top-[9rem]" size="14rem" />
|
|
22
|
+
<RingSoft className="right-[-3.5rem] top-[16rem]" size="6rem" />
|
|
23
|
+
</Box>
|
|
24
|
+
|
|
25
|
+
<Box className="relative z-10 space-y-6">
|
|
26
|
+
<Flex gap={1} direction="column">
|
|
27
|
+
<FlexItem>
|
|
28
|
+
<Text
|
|
29
|
+
size="base"
|
|
30
|
+
weight="bold"
|
|
31
|
+
font="plus-jakarta-sans"
|
|
32
|
+
className="tracking-tight bg-linear-to-r from-primary to-ink bg-clip-text text-transparent"
|
|
33
|
+
>
|
|
34
|
+
Quick start
|
|
35
|
+
</Text>
|
|
36
|
+
</FlexItem>
|
|
37
|
+
<FlexItem>
|
|
38
|
+
<Text size="sm" color="muted">
|
|
39
|
+
Create an app in seconds — clean architecture, ready to scale.
|
|
40
|
+
</Text>
|
|
41
|
+
</FlexItem>
|
|
42
|
+
</Flex>
|
|
43
|
+
|
|
44
|
+
<Flex gap={4} direction="column">
|
|
45
|
+
<FlexItem>
|
|
46
|
+
<StepLight label="1) Scaffold">
|
|
47
|
+
<CodeLine value={Commands.Scaffold} variant="light" />
|
|
48
|
+
</StepLight>
|
|
49
|
+
</FlexItem>
|
|
50
|
+
<FlexItem>
|
|
51
|
+
<StepLight label="2) Run">
|
|
52
|
+
<CodeLine value={Commands.Run} variant="light" />
|
|
53
|
+
</StepLight>
|
|
54
|
+
</FlexItem>
|
|
55
|
+
</Flex>
|
|
56
|
+
|
|
57
|
+
<Text size="sm" color="muted">
|
|
58
|
+
Tip: add your first feature inside your feature modules and delete this page when ready.
|
|
59
|
+
</Text>
|
|
60
|
+
</Box>
|
|
61
|
+
</Box>
|
|
62
|
+
);
|
|
63
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Box } from '@/shared/ui/Box';
|
|
3
|
+
import { cn } from '@/shared/libs';
|
|
4
|
+
|
|
5
|
+
export const RingSoft = React.memo(({ className, size }) => {
|
|
6
|
+
return (
|
|
7
|
+
<Box
|
|
8
|
+
className={cn('absolute rounded-full', className)}
|
|
9
|
+
style={{
|
|
10
|
+
width: size,
|
|
11
|
+
height: size,
|
|
12
|
+
border: '1px solid rgba(52, 82, 255, 0.22)',
|
|
13
|
+
}}
|
|
14
|
+
/>
|
|
15
|
+
);
|
|
16
|
+
});
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Divider } from './Divider';
|
|
3
|
+
import { CodeLine } from './CodeLine';
|
|
4
|
+
import { Box, Flex, FlexItem, Grid, GridItem, Text } from '@/shared/ui';
|
|
5
|
+
import { Commands } from '../constants';
|
|
6
|
+
|
|
7
|
+
function Block({ title, body }) {
|
|
8
|
+
return (
|
|
9
|
+
<Box>
|
|
10
|
+
<Text className="text-sm font-bold tracking-tight">{title}</Text>
|
|
11
|
+
<Text className="mt-2 text-muted leading-relaxed">{body}</Text>
|
|
12
|
+
</Box>
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function StorySections() {
|
|
17
|
+
return (
|
|
18
|
+
<Grid gap={{ base: 10, md: 12 }} columns={{ base: 1, md: 2 }}>
|
|
19
|
+
<GridItem>
|
|
20
|
+
<Flex gap={2} direction="column">
|
|
21
|
+
<FlexItem>
|
|
22
|
+
<Text
|
|
23
|
+
weight="black"
|
|
24
|
+
font="plus-jakarta-sans"
|
|
25
|
+
size={{ base: '2xl', md: '3xl' }}
|
|
26
|
+
className="tracking-tight bg-linear-to-r from-primary to-ink bg-clip-text text-transparent"
|
|
27
|
+
>
|
|
28
|
+
Why this exists
|
|
29
|
+
</Text>
|
|
30
|
+
</FlexItem>
|
|
31
|
+
|
|
32
|
+
<FlexItem className="max-w-2xl">
|
|
33
|
+
<Text size="base" color="muted">
|
|
34
|
+
Less starter bloat, more clarity. You get patterns that keep apps maintainable as
|
|
35
|
+
teams grow.
|
|
36
|
+
</Text>
|
|
37
|
+
</FlexItem>
|
|
38
|
+
</Flex>
|
|
39
|
+
</GridItem>
|
|
40
|
+
<GridItem className="space-y-7">
|
|
41
|
+
<Block
|
|
42
|
+
title="Project purpose"
|
|
43
|
+
body="React Scaffold helps teams start real apps fast—with structure, shared UI primitives, and a clean foundation for long-term maintainability."
|
|
44
|
+
/>
|
|
45
|
+
<Divider />
|
|
46
|
+
<Block
|
|
47
|
+
title="Problem it solves"
|
|
48
|
+
body="Most starters don’t scale. This scaffold enforces patterns so features stay isolated, UI stays consistent, and refactoring remains safe."
|
|
49
|
+
/>
|
|
50
|
+
<Divider />
|
|
51
|
+
<Box>
|
|
52
|
+
<Text size="sm" className="font-bold tracking-tight">
|
|
53
|
+
How to start
|
|
54
|
+
</Text>
|
|
55
|
+
<Box className="mt-3 space-y-3">
|
|
56
|
+
<CodeLine isStorySection value={Commands.Scaffold} />
|
|
57
|
+
<CodeLine isStorySection value={Commands.Run} />
|
|
58
|
+
</Box>
|
|
59
|
+
</Box>
|
|
60
|
+
</GridItem>
|
|
61
|
+
</Grid>
|
|
62
|
+
);
|
|
63
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SOLUTIONS } from '../constants';
|
|
3
|
+
import { Flex, FlexItem, Text } from '@/shared/ui';
|
|
4
|
+
|
|
5
|
+
export const WhatYouGet = React.memo(() => {
|
|
6
|
+
return (
|
|
7
|
+
<Flex gap={2} direction="column">
|
|
8
|
+
<FlexItem>
|
|
9
|
+
<Text
|
|
10
|
+
weight="black"
|
|
11
|
+
font="plus-jakarta-sans"
|
|
12
|
+
size={{ base: '2xl', md: '3xl' }}
|
|
13
|
+
className="tracking-tight bg-linear-to-r from-primary to-ink bg-clip-text text-transparent"
|
|
14
|
+
>
|
|
15
|
+
What you get
|
|
16
|
+
</Text>
|
|
17
|
+
</FlexItem>
|
|
18
|
+
|
|
19
|
+
<FlexItem className="max-w-2xl">
|
|
20
|
+
<Text size="base" color="muted">
|
|
21
|
+
A real-world scaffold: structure + UI foundations + modern stack.
|
|
22
|
+
</Text>
|
|
23
|
+
</FlexItem>
|
|
24
|
+
<FlexItem>
|
|
25
|
+
<Flex gap={2} className="mt-4 flex-wrap">
|
|
26
|
+
{SOLUTIONS.map((x) => (
|
|
27
|
+
<Flex
|
|
28
|
+
gap={2}
|
|
29
|
+
key={x.label}
|
|
30
|
+
align="center"
|
|
31
|
+
className="inline-flex items-center gap-2 rounded-full bg-surface/80 px-4 py-2"
|
|
32
|
+
>
|
|
33
|
+
<FlexItem>
|
|
34
|
+
<Text size="sm" color="muted">
|
|
35
|
+
{x.label}:
|
|
36
|
+
</Text>
|
|
37
|
+
</FlexItem>
|
|
38
|
+
<FlexItem>
|
|
39
|
+
<Text color="ink" weight="semibold">
|
|
40
|
+
{x.value}
|
|
41
|
+
</Text>
|
|
42
|
+
</FlexItem>
|
|
43
|
+
</Flex>
|
|
44
|
+
))}
|
|
45
|
+
</Flex>
|
|
46
|
+
</FlexItem>
|
|
47
|
+
</Flex>
|
|
48
|
+
);
|
|
49
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export const Links = {
|
|
2
|
+
CliGithub: 'https://github.com/arsalanirshad57/create-react-scaffold-cli',
|
|
3
|
+
AppGithub: 'https://github.com/arsalanirshad57/react-scaffold-app',
|
|
4
|
+
NpmPackage: 'https://www.npmjs.com/package/create-react-scaffold-cli',
|
|
5
|
+
|
|
6
|
+
CreatorName: 'Muhammad Arsalan',
|
|
7
|
+
CreatorGithub: 'https://github.com/arsalanirshad57',
|
|
8
|
+
CreatorLinkedIn: 'https://www.linkedin.com/in/heyarsalanhere/',
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const Commands = {
|
|
12
|
+
Scaffold: 'npx create-react-scaffold-cli',
|
|
13
|
+
Run: 'npm run dev',
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const SOLUTIONS = [
|
|
17
|
+
{ label: 'Architecture', value: 'Feature-first' },
|
|
18
|
+
{ label: 'UI System', value: 'Primitives + Radix' },
|
|
19
|
+
{ label: 'Data', value: 'React Query + Axios' },
|
|
20
|
+
{ label: 'Tooling', value: 'ESLint + Prettier + Husky' },
|
|
21
|
+
];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { welcomeRoutes } from './welcome.routes';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Box } from '@/shared/ui';
|
|
3
|
+
import { Divider, Footer, Hero, StorySections, WhatYouGet } from '../components';
|
|
4
|
+
|
|
5
|
+
const WelcomePage = React.memo(() => {
|
|
6
|
+
return (
|
|
7
|
+
<Box className="min-h-screen bg-bg text-ink ">
|
|
8
|
+
<Box
|
|
9
|
+
className="mx-auto max-w-6xl"
|
|
10
|
+
padding={{ x: { base: 4, md: 6 }, y: { base: 10, md: 14 } }}
|
|
11
|
+
>
|
|
12
|
+
<Hero />
|
|
13
|
+
|
|
14
|
+
<Divider className="my-10 md:my-12" />
|
|
15
|
+
|
|
16
|
+
<WhatYouGet />
|
|
17
|
+
|
|
18
|
+
<Divider className="my-10 md:my-12" />
|
|
19
|
+
|
|
20
|
+
<StorySections />
|
|
21
|
+
|
|
22
|
+
<Footer />
|
|
23
|
+
</Box>
|
|
24
|
+
</Box>
|
|
25
|
+
);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export default WelcomePage;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Layouts } from '@/shared/constants';
|
|
2
|
+
import { WelcomePage } from './pages';
|
|
3
|
+
import { WelcomeNavigation } from './constants';
|
|
4
|
+
|
|
5
|
+
export const welcomeRoutes = [
|
|
6
|
+
{
|
|
7
|
+
path: WelcomeNavigation.Root,
|
|
8
|
+
element: WelcomePage,
|
|
9
|
+
protected: false,
|
|
10
|
+
layout: Layouts.None,
|
|
11
|
+
},
|
|
12
|
+
];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# Shared Module
|
|
2
2
|
|
|
3
3
|
## Purpose
|
|
4
|
+
|
|
4
5
|
The `shared` folder contains **cross-feature reusable code**.
|
|
5
6
|
|
|
6
7
|
It exists to prevent duplication — not to become a dumping ground.
|
|
@@ -12,6 +13,7 @@ It exists to prevent duplication — not to become a dumping ground.
|
|
|
12
13
|
## What Belongs in Shared
|
|
13
14
|
|
|
14
15
|
Only code that is:
|
|
16
|
+
|
|
15
17
|
- Used by **multiple features**
|
|
16
18
|
- **Stateless or generic**
|
|
17
19
|
- Independent of business rules
|
|
@@ -38,12 +40,14 @@ shared/
|
|
|
38
40
|
## Rules
|
|
39
41
|
|
|
40
42
|
### ✅ Allowed
|
|
43
|
+
|
|
41
44
|
- UI primitives (Button, Modal)
|
|
42
45
|
- Generic hooks (useDebounce)
|
|
43
46
|
- Axios/query setup
|
|
44
47
|
- Theme tokens
|
|
45
48
|
|
|
46
49
|
### ❌ Not Allowed
|
|
50
|
+
|
|
47
51
|
- Feature logic
|
|
48
52
|
- Business rules
|
|
49
53
|
- Feature-specific constants
|
|
@@ -67,11 +71,13 @@ import { authQueryKeys } from '@/features/auth';
|
|
|
67
71
|
## Constants Policy
|
|
68
72
|
|
|
69
73
|
Shared constants should be:
|
|
74
|
+
|
|
70
75
|
- Truly global
|
|
71
76
|
- Stable
|
|
72
77
|
- Rarely changed
|
|
73
78
|
|
|
74
79
|
Examples:
|
|
80
|
+
|
|
75
81
|
- Pagination defaults
|
|
76
82
|
- Environment keys
|
|
77
83
|
- Generic route params
|
|
@@ -83,6 +89,7 @@ Examples:
|
|
|
83
89
|
Global contexts should be rare.
|
|
84
90
|
|
|
85
91
|
Before adding one, ask:
|
|
92
|
+
|
|
86
93
|
1. Is this needed by multiple unrelated features?
|
|
87
94
|
2. Can this live inside a feature instead?
|
|
88
95
|
|
|
@@ -95,4 +102,3 @@ If unsure — **do not add it here**.
|
|
|
95
102
|
Shared code is a **dependency magnet**.
|
|
96
103
|
|
|
97
104
|
The smaller it stays, the healthier the system remains.
|
|
98
|
-
|
|
@@ -2073,7 +2073,8 @@ export const size2xlLookup = {
|
|
|
2073
2073
|
|
|
2074
2074
|
export const colorLookup = {
|
|
2075
2075
|
primary: 'text-primary',
|
|
2076
|
-
|
|
2076
|
+
ink: 'text-ink',
|
|
2077
|
+
muted: 'text-muted',
|
|
2077
2078
|
success: 'text-green-500',
|
|
2078
2079
|
danger: 'text-red-500',
|
|
2079
2080
|
white: 'text-white',
|
|
@@ -2082,7 +2083,8 @@ export const colorLookup = {
|
|
|
2082
2083
|
|
|
2083
2084
|
export const color2XlLookup = {
|
|
2084
2085
|
primary: '2xl:text-primary',
|
|
2085
|
-
|
|
2086
|
+
ink: '2xl:text-ink',
|
|
2087
|
+
muted: 'xl:text-muted',
|
|
2086
2088
|
success: '2xl:text-green-500',
|
|
2087
2089
|
danger: '2xl:text-red-500',
|
|
2088
2090
|
white: '2xl:text-white',
|
|
@@ -2091,7 +2093,8 @@ export const color2XlLookup = {
|
|
|
2091
2093
|
|
|
2092
2094
|
export const colorXlLookup = {
|
|
2093
2095
|
primary: 'xl:text-primary',
|
|
2094
|
-
|
|
2096
|
+
ink: 'xl:text-ink',
|
|
2097
|
+
muted: 'xl:text-muted',
|
|
2095
2098
|
success: 'xl:text-green-500',
|
|
2096
2099
|
danger: 'xl:text-red-500',
|
|
2097
2100
|
white: 'xl:text-white',
|
|
@@ -2100,7 +2103,8 @@ export const colorXlLookup = {
|
|
|
2100
2103
|
|
|
2101
2104
|
export const colorLgLookup = {
|
|
2102
2105
|
primary: 'lg:text-primary',
|
|
2103
|
-
|
|
2106
|
+
ink: 'lg:text-ink',
|
|
2107
|
+
muted: 'lg:text-muted',
|
|
2104
2108
|
success: 'lg:text-green-500',
|
|
2105
2109
|
danger: 'lg:text-red-500',
|
|
2106
2110
|
white: 'lg:text-white',
|
|
@@ -2109,7 +2113,8 @@ export const colorLgLookup = {
|
|
|
2109
2113
|
|
|
2110
2114
|
export const colorMdLookup = {
|
|
2111
2115
|
primary: 'md:text-primary',
|
|
2112
|
-
|
|
2116
|
+
ink: 'md:text-ink',
|
|
2117
|
+
muted: 'md:text-muted',
|
|
2113
2118
|
success: 'md:text-green-500',
|
|
2114
2119
|
danger: 'md:text-red-500',
|
|
2115
2120
|
white: 'md:text-white',
|
|
@@ -2123,16 +2128,22 @@ export const bgColorLookup = {
|
|
|
2123
2128
|
danger: 'bg-red-500',
|
|
2124
2129
|
};
|
|
2125
2130
|
|
|
2126
|
-
export const fontFamilyLookup = {
|
|
2131
|
+
export const fontFamilyLookup = {
|
|
2132
|
+
'plus-jakarta-sans': 'font-plus-jakarta-sans',
|
|
2133
|
+
inter: 'font-inter',
|
|
2134
|
+
};
|
|
2127
2135
|
|
|
2128
|
-
export const fontFamilyMdLookup =
|
|
2129
|
-
|
|
2130
|
-
|
|
2136
|
+
export const fontFamilyMdLookup = {
|
|
2137
|
+
'plus-jakarta-sans': 'md:font-plus-jakarta-sans',
|
|
2138
|
+
inter: 'md:font-inter',
|
|
2139
|
+
};
|
|
2131
2140
|
|
|
2132
|
-
export const fontFamilyLgLookup =
|
|
2133
|
-
|
|
2134
|
-
|
|
2141
|
+
export const fontFamilyLgLookup = {
|
|
2142
|
+
'plus-jakarta-sans': 'lg:font-plus-jakarta-sans',
|
|
2143
|
+
inter: 'lg:font-inter',
|
|
2144
|
+
};
|
|
2135
2145
|
|
|
2136
|
-
export const fontFamilyXlLookup =
|
|
2137
|
-
|
|
2138
|
-
|
|
2146
|
+
export const fontFamilyXlLookup = {
|
|
2147
|
+
'plus-jakarta-sans': 'xl:font-plus-jakarta-sans',
|
|
2148
|
+
inter: 'xl:font-inter',
|
|
2149
|
+
};
|
|
@@ -27,10 +27,6 @@ import {
|
|
|
27
27
|
paddingXXlLookup,
|
|
28
28
|
paddingYXlLookup,
|
|
29
29
|
marginXlgLookup,
|
|
30
|
-
AnimationLookup,
|
|
31
|
-
AnimationMdLookup,
|
|
32
|
-
AnimationLgLookup,
|
|
33
|
-
AnimationXlLookup,
|
|
34
30
|
radiusLookup,
|
|
35
31
|
radiusMdLookup,
|
|
36
32
|
radiusLgLookup,
|
|
@@ -122,15 +118,11 @@ import { cn } from '../libs';
|
|
|
122
118
|
* | Record<Axis, Record<Breakpoint, Padding>>} [padding]
|
|
123
119
|
* @property {Width | Record<Breakpoint, Width>} [width]
|
|
124
120
|
* @property {Radius} [radius]
|
|
125
|
-
* @property {Animation} [animation]
|
|
126
121
|
* @param {React.ComponentProps<'div'> & ComponentProps} props
|
|
127
122
|
* @returns {JSX.Element}
|
|
128
123
|
*/
|
|
129
124
|
|
|
130
|
-
const Component = (
|
|
131
|
-
{ hide, grow, margin, radius, padding, width, animation, className, ...rest },
|
|
132
|
-
ref
|
|
133
|
-
) => {
|
|
125
|
+
const Component = ({ hide, grow, margin, radius, padding, width, className, ...rest }, ref) => {
|
|
134
126
|
return (
|
|
135
127
|
<div
|
|
136
128
|
ref={ref}
|
|
@@ -180,11 +172,6 @@ const Component = (
|
|
|
180
172
|
getClassName(width?.base, widthLookup),
|
|
181
173
|
getClassName(width?.md, widthMdLookup),
|
|
182
174
|
getClassName(width?.lg, widthLgLookup),
|
|
183
|
-
typeof font !== 'object' && getClassName(animation, AnimationLookup),
|
|
184
|
-
getClassName(animation?.base, AnimationLookup),
|
|
185
|
-
getClassName(animation?.md, AnimationMdLookup),
|
|
186
|
-
getClassName(animation?.lg, AnimationLgLookup),
|
|
187
|
-
getClassName(animation?.xl, AnimationXlLookup),
|
|
188
175
|
typeof radius !== 'object' && getClassName(radius, radiusLookup),
|
|
189
176
|
getClassName(radius?.base, radiusLookup),
|
|
190
177
|
getClassName(radius?.md, radiusMdLookup),
|