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
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { PiSpinnerBold } from 'react-icons/pi';
|
|
3
3
|
import {
|
|
4
|
-
AnimationLookup,
|
|
5
4
|
colorLookup,
|
|
6
5
|
fieldSize2XlLookup,
|
|
7
6
|
fieldSizeLgLookup,
|
|
@@ -25,13 +24,14 @@ import {
|
|
|
25
24
|
radiusXlLookup,
|
|
26
25
|
} from '../theme';
|
|
27
26
|
import { getClassName, memo } from '../utils';
|
|
27
|
+
import { cn } from '../libs';
|
|
28
28
|
|
|
29
29
|
const variantLookup = {
|
|
30
30
|
primary:
|
|
31
31
|
'text-primary-foreground bg-primary hover:bg-primary/90 disabled:text-primary-foreground/70 disabled:bg-primary/50',
|
|
32
32
|
outline:
|
|
33
33
|
'border text-primary bg-primary-foreground hover:bg-neutral-50 disabled:text-primary/70 disabled:bg-neutral-50/50',
|
|
34
|
-
pill: 'text-primary-foreground bg-primary hover:bg-primary/90 disabled:text-primary-foreground/70 disabled:bg-primary/50
|
|
34
|
+
pill: 'text-primary-foreground bg-primary hover:bg-primary/90 disabled:text-primary-foreground/70 disabled:bg-primary/50',
|
|
35
35
|
};
|
|
36
36
|
|
|
37
37
|
/**
|
|
@@ -97,7 +97,6 @@ const Component = (
|
|
|
97
97
|
color,
|
|
98
98
|
isLoading,
|
|
99
99
|
className,
|
|
100
|
-
animation,
|
|
101
100
|
type = 'button',
|
|
102
101
|
children,
|
|
103
102
|
...rest
|
|
@@ -108,7 +107,8 @@ const Component = (
|
|
|
108
107
|
<button
|
|
109
108
|
ref={ref}
|
|
110
109
|
className={cn(
|
|
111
|
-
'h-
|
|
110
|
+
'h-14 px-8 inline-flex w-full items-center justify-center gap-2 transition-colors disabled:cursor-not-allowed text-primary-foreground cursor-pointer!',
|
|
111
|
+
'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/30',
|
|
112
112
|
typeof fontSize !== 'object' && getClassName(fontSize, fontSizeLookup),
|
|
113
113
|
getClassName(fontSize?.base, fontSizeLookup),
|
|
114
114
|
getClassName(fontSize?.md, fontSizeMdLookup),
|
|
@@ -135,7 +135,6 @@ const Component = (
|
|
|
135
135
|
variantLookup[variant],
|
|
136
136
|
fontFamilyLookup[font],
|
|
137
137
|
colorLookup[color],
|
|
138
|
-
AnimationLookup[animation],
|
|
139
138
|
className
|
|
140
139
|
)}
|
|
141
140
|
type={type}
|
|
@@ -1,46 +1,40 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
3
3
|
import { FaChevronRight } from 'react-icons/fa';
|
|
4
|
-
import { memo } from '
|
|
5
|
-
import { cn } from '
|
|
4
|
+
import { memo } from '../utils';
|
|
5
|
+
import { cn } from '../libs';
|
|
6
6
|
|
|
7
7
|
const DropdownMenuRoot = DropdownMenuPrimitive.Root;
|
|
8
8
|
|
|
9
9
|
const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
10
10
|
|
|
11
|
-
const DropdownMenuSubTrigger = React.forwardRef(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
);
|
|
27
|
-
DropdownMenuSubTrigger.displayName =
|
|
28
|
-
DropdownMenuPrimitive.SubTrigger.displayName;
|
|
11
|
+
const DropdownMenuSubTrigger = React.forwardRef(({ className, inset, children, ...props }, ref) => (
|
|
12
|
+
<DropdownMenuPrimitive.SubTrigger
|
|
13
|
+
ref={ref}
|
|
14
|
+
className={cn(
|
|
15
|
+
'flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',
|
|
16
|
+
inset && 'pl-8',
|
|
17
|
+
className
|
|
18
|
+
)}
|
|
19
|
+
{...props}
|
|
20
|
+
>
|
|
21
|
+
{children}
|
|
22
|
+
<FaChevronRight className="ml-auto" />
|
|
23
|
+
</DropdownMenuPrimitive.SubTrigger>
|
|
24
|
+
));
|
|
25
|
+
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
29
26
|
|
|
30
|
-
const DropdownMenuSubContent = React.forwardRef(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
);
|
|
42
|
-
DropdownMenuSubContent.displayName =
|
|
43
|
-
DropdownMenuPrimitive.SubContent.displayName;
|
|
27
|
+
const DropdownMenuSubContent = React.forwardRef(({ className, ...props }, ref) => (
|
|
28
|
+
<DropdownMenuPrimitive.SubContent
|
|
29
|
+
ref={ref}
|
|
30
|
+
className={cn(
|
|
31
|
+
'z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
|
|
32
|
+
className
|
|
33
|
+
)}
|
|
34
|
+
{...props}
|
|
35
|
+
/>
|
|
36
|
+
));
|
|
37
|
+
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
44
38
|
|
|
45
39
|
const DropdownMenuContent = React.forwardRef(
|
|
46
40
|
({ className, sideOffset = 4, contentClassName, ...props }, ref) => (
|
|
@@ -61,53 +55,40 @@ const DropdownMenuContent = React.forwardRef(
|
|
|
61
55
|
);
|
|
62
56
|
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
63
57
|
|
|
64
|
-
const DropdownMenuItem = React.forwardRef(
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
)
|
|
76
|
-
);
|
|
58
|
+
const DropdownMenuItem = React.forwardRef(({ className, inset, ...props }, ref) => (
|
|
59
|
+
<DropdownMenuPrimitive.Item
|
|
60
|
+
ref={ref}
|
|
61
|
+
className={cn(
|
|
62
|
+
'relative flex select-none items-center gap-2 font-inter cursor-pointer rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0',
|
|
63
|
+
inset && 'pl-8',
|
|
64
|
+
className
|
|
65
|
+
)}
|
|
66
|
+
{...props}
|
|
67
|
+
/>
|
|
68
|
+
));
|
|
77
69
|
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
78
70
|
|
|
79
|
-
const DropdownMenuLabel = React.forwardRef(
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
className
|
|
87
|
-
)}
|
|
88
|
-
{...props}
|
|
89
|
-
/>
|
|
90
|
-
)
|
|
91
|
-
);
|
|
71
|
+
const DropdownMenuLabel = React.forwardRef(({ className, inset, ...props }, ref) => (
|
|
72
|
+
<DropdownMenuPrimitive.Label
|
|
73
|
+
ref={ref}
|
|
74
|
+
className={cn('px-2 py-1.5 text-sm font-semibold font-inter', inset && 'pl-8', className)}
|
|
75
|
+
{...props}
|
|
76
|
+
/>
|
|
77
|
+
));
|
|
92
78
|
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
93
79
|
|
|
94
|
-
const DropdownMenuSeparator = React.forwardRef(
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
)
|
|
102
|
-
);
|
|
80
|
+
const DropdownMenuSeparator = React.forwardRef(({ className, ...props }, ref) => (
|
|
81
|
+
<DropdownMenuPrimitive.Separator
|
|
82
|
+
ref={ref}
|
|
83
|
+
className={cn('-mx-1 my-1 h-px bg-muted', className)}
|
|
84
|
+
{...props}
|
|
85
|
+
/>
|
|
86
|
+
));
|
|
103
87
|
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
|
|
104
88
|
|
|
105
89
|
const DropdownMenuShortcut = ({ className, ...props }) => {
|
|
106
90
|
return (
|
|
107
|
-
<span
|
|
108
|
-
className={cn('ml-auto text-xs tracking-widest opacity-60', className)}
|
|
109
|
-
{...props}
|
|
110
|
-
/>
|
|
91
|
+
<span className={cn('ml-auto text-xs tracking-widest opacity-60', className)} {...props} />
|
|
111
92
|
);
|
|
112
93
|
};
|
|
113
94
|
DropdownMenuShortcut.displayName = 'DropdownMenuShortcut';
|
|
@@ -121,19 +102,9 @@ DropdownMenuShortcut.displayName = 'DropdownMenuShortcut';
|
|
|
121
102
|
* @returns {JSX.Element}
|
|
122
103
|
*/
|
|
123
104
|
|
|
124
|
-
const Component = ({
|
|
125
|
-
open,
|
|
126
|
-
onOpenChange,
|
|
127
|
-
content,
|
|
128
|
-
children,
|
|
129
|
-
contentClassName,
|
|
130
|
-
}) => {
|
|
105
|
+
const Component = ({ open, onOpenChange, content, children, contentClassName }) => {
|
|
131
106
|
return (
|
|
132
|
-
<DropdownMenuRoot
|
|
133
|
-
className="border w-full "
|
|
134
|
-
open={open}
|
|
135
|
-
onOpenChange={onOpenChange}
|
|
136
|
-
>
|
|
107
|
+
<DropdownMenuRoot className="border w-full " open={open} onOpenChange={onOpenChange}>
|
|
137
108
|
<DropdownMenuTrigger className="w-full">{children}</DropdownMenuTrigger>
|
|
138
109
|
<DropdownMenuContent align="end" contentClassName={contentClassName}>
|
|
139
110
|
{content}
|
|
@@ -144,9 +115,4 @@ const Component = ({
|
|
|
144
115
|
|
|
145
116
|
const DropdownMenu = memo(Component);
|
|
146
117
|
|
|
147
|
-
export {
|
|
148
|
-
DropdownMenu,
|
|
149
|
-
DropdownMenuLabel,
|
|
150
|
-
DropdownMenuSeparator,
|
|
151
|
-
DropdownMenuItem,
|
|
152
|
-
};
|
|
118
|
+
export { DropdownMenu, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuItem };
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
colorXlLookup,
|
|
25
25
|
} from '../theme';
|
|
26
26
|
import { cn } from '../libs';
|
|
27
|
-
import { getClassName } from '../utils';
|
|
27
|
+
import { getClassName, memo } from '../utils';
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
30
|
* @typedef {'base' | 'md' | 'lg' | 'xl' | '2xl'} Breakpoint
|
|
@@ -57,9 +57,9 @@ import { getClassName } from '../utils';
|
|
|
57
57
|
* | 'black'} Weight
|
|
58
58
|
*
|
|
59
59
|
*
|
|
60
|
-
* @typedef {''} Font
|
|
60
|
+
* @typedef {'plus-jakarta-sans' | 'inter'} Font
|
|
61
61
|
*
|
|
62
|
-
* @typedef {'primary' | '
|
|
62
|
+
* @typedef {'primary' | 'ink' | 'muted' | 'success' | 'danger' | 'white' | 'black'} Color
|
|
63
63
|
*
|
|
64
64
|
* @typedef {object} ComponentProps
|
|
65
65
|
* @property {Size | Record<Breakpoint, Size>} [size]
|
|
@@ -1 +1,18 @@
|
|
|
1
|
+
export { Box } from './Box';
|
|
2
|
+
export { Button } from './Button';
|
|
3
|
+
export { Checkbox } from './Checkbox';
|
|
4
|
+
export { Flex } from './Flex';
|
|
5
|
+
export { FlexItem } from './FlexItem';
|
|
6
|
+
export { FormField } from './FormField';
|
|
7
|
+
export { Grid } from './Grid';
|
|
8
|
+
export { GridItem } from './GridItem';
|
|
9
|
+
export { Modal } from './Modal';
|
|
1
10
|
export { Toaster } from './Toaster';
|
|
11
|
+
export { Text } from './Text';
|
|
12
|
+
export { Scrollable } from './Scrollable';
|
|
13
|
+
export {
|
|
14
|
+
DropdownMenu,
|
|
15
|
+
DropdownMenuItem,
|
|
16
|
+
DropdownMenuLabel,
|
|
17
|
+
DropdownMenuSeparator,
|
|
18
|
+
} from './DropdownMenu';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export const LocalStorageGetItem = (key) => {
|
|
2
|
+
if (typeof window !== 'undefined') {
|
|
3
|
+
return localStorage.getItem(key);
|
|
4
|
+
}
|
|
5
|
+
return null;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export const LocalStorageSetItem = (key, value) => {
|
|
9
|
+
if (typeof window !== 'undefined') {
|
|
10
|
+
localStorage.setItem(key, value);
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const LocalStorageRemoveItem = (key) => {
|
|
15
|
+
if (typeof window !== 'undefined') {
|
|
16
|
+
localStorage.removeItem(key);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { defineConfig } from
|
|
2
|
-
import react from
|
|
3
|
-
import path from
|
|
1
|
+
import { defineConfig } from 'vite';
|
|
2
|
+
import react from '@vitejs/plugin-react';
|
|
3
|
+
import path from 'path';
|
|
4
4
|
|
|
5
|
-
// https://vite.dev/config/
|
|
6
5
|
export default defineConfig({
|
|
7
6
|
plugins: [react()],
|
|
8
7
|
resolve: {
|
|
9
8
|
alias: {
|
|
10
|
-
|
|
9
|
+
'@': path.resolve(import.meta.dirname, './src'),
|
|
11
10
|
},
|
|
12
11
|
},
|
|
13
12
|
preview: {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|