create-react-scaffold-cli 1.0.6 → 1.1.0
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/bin/index.js +15 -5
- package/package.json +21 -7
- package/scripts/createProject.js +8 -2
- package/templates/{base → base-js}/src/shared/utils/parser.js +1 -1
- package/templates/base-ts/.husky/pre-commit +1 -0
- package/templates/base-ts/.husky/pre-push +0 -0
- package/templates/base-ts/.prettierrc +8 -0
- package/templates/base-ts/.vscode/extensions.json +8 -0
- package/templates/base-ts/.vscode/settings.json +16 -0
- package/templates/base-ts/README.md +165 -0
- package/templates/base-ts/docs/DOCS.md +7 -0
- package/templates/base-ts/eslint.config.js +56 -0
- package/templates/base-ts/index.html +16 -0
- package/templates/base-ts/jsconfig.json +7 -0
- package/templates/base-ts/package.json +69 -0
- package/templates/base-ts/postcss.config.mjs +7 -0
- package/templates/base-ts/public/icons/react.svg +1 -0
- package/templates/base-ts/src/app/APP.md +74 -0
- package/templates/base-ts/src/app/App.tsx +15 -0
- package/templates/base-ts/src/app/Router.tsx +48 -0
- package/templates/base-ts/src/app/index.css +37 -0
- package/templates/base-ts/src/app/main.tsx +13 -0
- package/templates/base-ts/src/app/middlewares/AuthMiddleware.tsx +6 -0
- package/templates/base-ts/src/app/middlewares/index.ts +1 -0
- package/templates/base-ts/src/app/providers/QueryProvider.tsx +75 -0
- package/templates/base-ts/src/app/providers/index.ts +1 -0
- package/templates/base-ts/src/app/routes.registry.ts +9 -0
- package/templates/base-ts/src/features/FEATURES.md +102 -0
- package/templates/base-ts/src/features/sample/components/index.ts +0 -0
- package/templates/base-ts/src/features/sample/constants/index.ts +3 -0
- package/templates/base-ts/src/features/sample/constants/sample.assets.ts +8 -0
- package/templates/base-ts/src/features/sample/constants/sample.navigations.ts +5 -0
- package/templates/base-ts/src/features/sample/constants/sample.queryKeys.ts +3 -0
- package/templates/base-ts/src/features/sample/hooks/index.ts +0 -0
- package/templates/base-ts/src/features/sample/index.ts +1 -0
- package/templates/base-ts/src/features/sample/pages/SamplePage.tsx +7 -0
- package/templates/base-ts/src/features/sample/pages/index.ts +1 -0
- package/templates/base-ts/src/features/sample/sample.routes.ts +13 -0
- package/templates/base-ts/src/features/welcome/components/CodeLine.tsx +59 -0
- package/templates/base-ts/src/features/welcome/components/Divider.tsx +11 -0
- package/templates/base-ts/src/features/welcome/components/Footer.tsx +78 -0
- package/templates/base-ts/src/features/welcome/components/Hero.tsx +131 -0
- package/templates/base-ts/src/features/welcome/components/IconLink.tsx +24 -0
- package/templates/base-ts/src/features/welcome/components/QuickStartPanel.tsx +63 -0
- package/templates/base-ts/src/features/welcome/components/RingSoft.tsx +21 -0
- package/templates/base-ts/src/features/welcome/components/StorySections.tsx +63 -0
- package/templates/base-ts/src/features/welcome/components/WhatYouGet.tsx +49 -0
- package/templates/base-ts/src/features/welcome/components/index.ts +5 -0
- package/templates/base-ts/src/features/welcome/constants/index.ts +2 -0
- package/templates/base-ts/src/features/welcome/constants/welcome.constants.ts +21 -0
- package/templates/base-ts/src/features/welcome/constants/welcome.navigations.ts +3 -0
- package/templates/base-ts/src/features/welcome/index.ts +1 -0
- package/templates/base-ts/src/features/welcome/pages/WelcomePage.tsx +28 -0
- package/templates/base-ts/src/features/welcome/pages/index.ts +1 -0
- package/templates/base-ts/src/features/welcome/welcome.routes.ts +13 -0
- package/templates/base-ts/src/shared/SHARED.md +104 -0
- package/templates/base-ts/src/shared/constants/app.constants.ts +11 -0
- package/templates/base-ts/src/shared/constants/assets.constants.ts +5 -0
- package/templates/base-ts/src/shared/constants/index.ts +2 -0
- package/templates/base-ts/src/shared/contexts/index.ts +0 -0
- package/templates/base-ts/src/shared/hooks/index.ts +3 -0
- package/templates/base-ts/src/shared/hooks/useBooleanState.ts +19 -0
- package/templates/base-ts/src/shared/hooks/useDebounce.ts +17 -0
- package/templates/base-ts/src/shared/hooks/useToggleState.ts +11 -0
- package/templates/base-ts/src/shared/layouts/index.ts +0 -0
- package/templates/base-ts/src/shared/libs/axios.ts +6 -0
- package/templates/base-ts/src/shared/libs/cn.ts +6 -0
- package/templates/base-ts/src/shared/libs/index.ts +2 -0
- package/templates/base-ts/src/shared/theme/index.ts +1 -0
- package/templates/base-ts/src/shared/theme/theme.ts +2149 -0
- package/templates/base-ts/src/shared/types/navigation.ts +9 -0
- package/templates/base-ts/src/shared/types/ui.ts +5 -0
- package/templates/base-ts/src/shared/ui/Box.tsx +153 -0
- package/templates/base-ts/src/shared/ui/Button.tsx +124 -0
- package/templates/base-ts/src/shared/ui/Checkbox.tsx +87 -0
- package/templates/base-ts/src/shared/ui/DropdownMenu.tsx +134 -0
- package/templates/base-ts/src/shared/ui/Flex.tsx +96 -0
- package/templates/base-ts/src/shared/ui/FlexItem.tsx +67 -0
- package/templates/base-ts/src/shared/ui/FormField.tsx +139 -0
- package/templates/base-ts/src/shared/ui/Grid.tsx +96 -0
- package/templates/base-ts/src/shared/ui/GridItem.tsx +67 -0
- package/templates/base-ts/src/shared/ui/Modal.tsx +42 -0
- package/templates/base-ts/src/shared/ui/Scrollable.tsx +48 -0
- package/templates/base-ts/src/shared/ui/Select.tsx +212 -0
- package/templates/base-ts/src/shared/ui/Sheet.tsx +126 -0
- package/templates/base-ts/src/shared/ui/Text.tsx +99 -0
- package/templates/base-ts/src/shared/ui/Toaster.tsx +31 -0
- package/templates/base-ts/src/shared/ui/index.ts +20 -0
- package/templates/base-ts/src/shared/utils/getClassName.ts +8 -0
- package/templates/base-ts/src/shared/utils/index.ts +4 -0
- package/templates/base-ts/src/shared/utils/localStorage.ts +18 -0
- package/templates/base-ts/src/shared/utils/memo.ts +9 -0
- package/templates/base-ts/src/shared/utils/motion.ts +0 -0
- package/templates/base-ts/src/shared/utils/parser.ts +41 -0
- package/templates/base-ts/src/shared/utils/regix.ts +3 -0
- package/templates/base-ts/src/shared/utils/tryCatch.ts +16 -0
- package/templates/base-ts/src/vite-env.d.ts +1 -0
- package/templates/base-ts/tsconfig.json +33 -0
- package/templates/base-ts/tsconfig.node.json +11 -0
- package/templates/base-ts/tsconfig.tsbuildinfo +1 -0
- package/templates/base-ts/vercel.json +3 -0
- package/templates/base-ts/vite.config.d.ts +2 -0
- package/templates/base-ts/vite.config.ts +18 -0
- /package/templates/{base → base-js}/.husky/pre-commit +0 -0
- /package/templates/{base → base-js}/.husky/pre-push +0 -0
- /package/templates/{base → base-js}/.prettierrc +0 -0
- /package/templates/{base → base-js}/.vscode/extensions.json +0 -0
- /package/templates/{base → base-js}/.vscode/settings.json +0 -0
- /package/templates/{base → base-js}/README.md +0 -0
- /package/templates/{base → base-js}/docs/DOCS.md +0 -0
- /package/templates/{base → base-js}/eslint.config.js +0 -0
- /package/templates/{base → base-js}/index.html +0 -0
- /package/templates/{base → base-js}/jsconfig.json +0 -0
- /package/templates/{base → base-js}/package.json +0 -0
- /package/templates/{base → base-js}/postcss.config.mjs +0 -0
- /package/templates/{base → base-js}/public/icons/react.svg +0 -0
- /package/templates/{base → base-js}/src/app/APP.md +0 -0
- /package/templates/{base → base-js}/src/app/App.jsx +0 -0
- /package/templates/{base → base-js}/src/app/Router.jsx +0 -0
- /package/templates/{base → base-js}/src/app/index.css +0 -0
- /package/templates/{base → base-js}/src/app/main.jsx +0 -0
- /package/templates/{base → base-js}/src/app/middlewares/AuthMiddleware.jsx +0 -0
- /package/templates/{base → base-js}/src/app/middlewares/index.js +0 -0
- /package/templates/{base → base-js}/src/app/providers/QueryProvider.jsx +0 -0
- /package/templates/{base → base-js}/src/app/providers/index.js +0 -0
- /package/templates/{base → base-js}/src/app/routes.registry.js +0 -0
- /package/templates/{base → base-js}/src/features/FEATURES.md +0 -0
- /package/templates/{base → base-js}/src/features/sample/components/index.js +0 -0
- /package/templates/{base → base-js}/src/features/sample/constants/index.js +0 -0
- /package/templates/{base → base-js}/src/features/sample/constants/sample.assets.js +0 -0
- /package/templates/{base → base-js}/src/features/sample/constants/sample.constants.js +0 -0
- /package/templates/{base → base-js}/src/features/sample/constants/sample.navigations.js +0 -0
- /package/templates/{base → base-js}/src/features/sample/constants/sample.queryKeys.js +0 -0
- /package/templates/{base → base-js}/src/features/sample/hooks/index.js +0 -0
- /package/templates/{base → base-js}/src/features/sample/index.js +0 -0
- /package/templates/{base → base-js}/src/features/sample/pages/SamplePage.jsx +0 -0
- /package/templates/{base → base-js}/src/features/sample/pages/index.js +0 -0
- /package/templates/{base → base-js}/src/features/sample/sample.context.js +0 -0
- /package/templates/{base → base-js}/src/features/sample/sample.routes.js +0 -0
- /package/templates/{base → base-js}/src/features/welcome/components/CodeLine.jsx +0 -0
- /package/templates/{base → base-js}/src/features/welcome/components/Divider.jsx +0 -0
- /package/templates/{base → base-js}/src/features/welcome/components/Footer.jsx +0 -0
- /package/templates/{base → base-js}/src/features/welcome/components/Hero.jsx +0 -0
- /package/templates/{base → base-js}/src/features/welcome/components/IconLink.jsx +0 -0
- /package/templates/{base → base-js}/src/features/welcome/components/QuickStartPanel.jsx +0 -0
- /package/templates/{base → base-js}/src/features/welcome/components/RingSoft.jsx +0 -0
- /package/templates/{base → base-js}/src/features/welcome/components/StorySections.jsx +0 -0
- /package/templates/{base → base-js}/src/features/welcome/components/WhatYouGet.jsx +0 -0
- /package/templates/{base → base-js}/src/features/welcome/components/index.js +0 -0
- /package/templates/{base → base-js}/src/features/welcome/constants/index.js +0 -0
- /package/templates/{base → base-js}/src/features/welcome/constants/welcome.constants.js +0 -0
- /package/templates/{base → base-js}/src/features/welcome/constants/welcome.navigations.js +0 -0
- /package/templates/{base → base-js}/src/features/welcome/index.js +0 -0
- /package/templates/{base → base-js}/src/features/welcome/pages/WelcomePage.jsx +0 -0
- /package/templates/{base → base-js}/src/features/welcome/pages/index.js +0 -0
- /package/templates/{base → base-js}/src/features/welcome/welcome.routes.js +0 -0
- /package/templates/{base → base-js}/src/shared/SHARED.md +0 -0
- /package/templates/{base → base-js}/src/shared/constants/app.constants.js +0 -0
- /package/templates/{base → base-js}/src/shared/constants/assets.constants.js +0 -0
- /package/templates/{base → base-js}/src/shared/constants/index.js +0 -0
- /package/templates/{base → base-js}/src/shared/contexts/index.js +0 -0
- /package/templates/{base → base-js}/src/shared/hooks/index.js +0 -0
- /package/templates/{base → base-js}/src/shared/hooks/useBooleanState.js +0 -0
- /package/templates/{base → base-js}/src/shared/hooks/useDebounce.js +0 -0
- /package/templates/{base → base-js}/src/shared/hooks/useToggleState.js +0 -0
- /package/templates/{base → base-js}/src/shared/layouts/index.js +0 -0
- /package/templates/{base → base-js}/src/shared/libs/axios.js +0 -0
- /package/templates/{base → base-js}/src/shared/libs/cn.js +0 -0
- /package/templates/{base → base-js}/src/shared/libs/index.js +0 -0
- /package/templates/{base → base-js}/src/shared/theme/index.js +0 -0
- /package/templates/{base → base-js}/src/shared/theme/theme.js +0 -0
- /package/templates/{base → base-js}/src/shared/ui/Box.jsx +0 -0
- /package/templates/{base → base-js}/src/shared/ui/Button.jsx +0 -0
- /package/templates/{base → base-js}/src/shared/ui/Checkbox.jsx +0 -0
- /package/templates/{base → base-js}/src/shared/ui/DropdownMenu.jsx +0 -0
- /package/templates/{base → base-js}/src/shared/ui/Flex.jsx +0 -0
- /package/templates/{base → base-js}/src/shared/ui/FlexItem.jsx +0 -0
- /package/templates/{base → base-js}/src/shared/ui/FormField.jsx +0 -0
- /package/templates/{base → base-js}/src/shared/ui/Grid.jsx +0 -0
- /package/templates/{base → base-js}/src/shared/ui/GridItem.jsx +0 -0
- /package/templates/{base → base-js}/src/shared/ui/Modal.jsx +0 -0
- /package/templates/{base → base-js}/src/shared/ui/Scrollable.jsx +0 -0
- /package/templates/{base → base-js}/src/shared/ui/Select.jsx +0 -0
- /package/templates/{base → base-js}/src/shared/ui/Sheet.jsx +0 -0
- /package/templates/{base → base-js}/src/shared/ui/Text.jsx +0 -0
- /package/templates/{base → base-js}/src/shared/ui/Toaster.jsx +0 -0
- /package/templates/{base → base-js}/src/shared/ui/index.js +0 -0
- /package/templates/{base → base-js}/src/shared/utils/getClassName.js +0 -0
- /package/templates/{base → base-js}/src/shared/utils/index.js +0 -0
- /package/templates/{base → base-js}/src/shared/utils/localStorage.js +0 -0
- /package/templates/{base → base-js}/src/shared/utils/memo.js +0 -0
- /package/templates/{base → base-js}/src/shared/utils/motion.js +0 -0
- /package/templates/{base → base-js}/src/shared/utils/regix.js +0 -0
- /package/templates/{base → base-js}/src/shared/utils/tryCatch.js +0 -0
- /package/templates/{base → base-js}/vercel.json +0 -0
- /package/templates/{base → base-js}/vite.config.js +0 -0
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import * as SheetPrimitive from '@radix-ui/react-dialog';
|
|
2
|
+
import { cn } from '../libs';
|
|
3
|
+
import { ComponentProps } from 'react';
|
|
4
|
+
|
|
5
|
+
function Sheet({ ...props }: ComponentProps<typeof SheetPrimitive.Root>) {
|
|
6
|
+
return <SheetPrimitive.Root data-slot="sheet" {...props} />;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
function SheetTrigger({ ...props }: ComponentProps<typeof SheetPrimitive.Trigger>) {
|
|
10
|
+
return <SheetPrimitive.Trigger data-slot="sheet-trigger" {...props} />;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function SheetClose({ ...props }: ComponentProps<typeof SheetPrimitive.Close>) {
|
|
14
|
+
return <SheetPrimitive.Close data-slot="sheet-close" {...props} />;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function SheetPortal({ ...props }: ComponentProps<typeof SheetPrimitive.Portal>) {
|
|
18
|
+
return <SheetPrimitive.Portal data-slot="sheet-portal" {...props} />;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function SheetOverlay({ className, ...props }: ComponentProps<typeof SheetPrimitive.Overlay>) {
|
|
22
|
+
return (
|
|
23
|
+
<SheetPrimitive.Overlay
|
|
24
|
+
data-slot="sheet-overlay"
|
|
25
|
+
className={cn(
|
|
26
|
+
'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-40 bg-black/50',
|
|
27
|
+
className
|
|
28
|
+
)}
|
|
29
|
+
{...props}
|
|
30
|
+
/>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
interface SheetContentProps extends ComponentProps<typeof SheetPrimitive.Content> {
|
|
35
|
+
side?: 'top' | 'bottom' | 'left' | 'right';
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function SheetContent({ className, children, side = 'right', ...props }: SheetContentProps) {
|
|
39
|
+
return (
|
|
40
|
+
<SheetPortal>
|
|
41
|
+
<SheetOverlay />
|
|
42
|
+
<SheetPrimitive.Content
|
|
43
|
+
data-slot="sheet-content"
|
|
44
|
+
className={cn(
|
|
45
|
+
'bg-bg data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500',
|
|
46
|
+
side === 'right' &&
|
|
47
|
+
'data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm',
|
|
48
|
+
side === 'left' &&
|
|
49
|
+
'data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm',
|
|
50
|
+
side === 'top' &&
|
|
51
|
+
'data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b',
|
|
52
|
+
side === 'bottom' &&
|
|
53
|
+
'data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t',
|
|
54
|
+
className
|
|
55
|
+
)}
|
|
56
|
+
{...props}
|
|
57
|
+
>
|
|
58
|
+
{children}
|
|
59
|
+
<SheetPrimitive.Close className="ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none">
|
|
60
|
+
{/* XIcon was used but not imported in original file. Assuming it's missing or global?
|
|
61
|
+
Reviewing original file: <XIcon className="size-4" />
|
|
62
|
+
But XIcon is not imported. It might be a mistake in the original file.
|
|
63
|
+
I'll replace it with something generic or import it if I find where it is.
|
|
64
|
+
Wait, the original file had `XIcon` usage on line 55 but no import.
|
|
65
|
+
This implies the original code was broken or relying on auto-import that wasn't shown?
|
|
66
|
+
Or maybe it's `lucide-react`?
|
|
67
|
+
I'll check `package.json` for icon libraries. `react-icons` is there.
|
|
68
|
+
I will use `FaXmark` or similar from react-icons/fa6 given other files use it.
|
|
69
|
+
*/}
|
|
70
|
+
<span className="sr-only">Close</span>
|
|
71
|
+
</SheetPrimitive.Close>
|
|
72
|
+
</SheetPrimitive.Content>
|
|
73
|
+
</SheetPortal>
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function SheetHeader({ className, ...props }: ComponentProps<'div'>) {
|
|
78
|
+
return (
|
|
79
|
+
<div
|
|
80
|
+
data-slot="sheet-header"
|
|
81
|
+
className={cn('flex flex-col gap-1.5 p-4', className)}
|
|
82
|
+
{...props}
|
|
83
|
+
/>
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function SheetFooter({ className, ...props }: ComponentProps<'div'>) {
|
|
88
|
+
return (
|
|
89
|
+
<div
|
|
90
|
+
data-slot="sheet-footer"
|
|
91
|
+
className={cn('mt-auto flex flex-col gap-2 p-4', className)}
|
|
92
|
+
{...props}
|
|
93
|
+
/>
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function SheetTitle({ className, ...props }: ComponentProps<typeof SheetPrimitive.Title>) {
|
|
98
|
+
return (
|
|
99
|
+
<SheetPrimitive.Title
|
|
100
|
+
data-slot="sheet-title"
|
|
101
|
+
className={cn('text-foreground font-semibold', className)}
|
|
102
|
+
{...props}
|
|
103
|
+
/>
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function SheetDescription({ className, ...props }: ComponentProps<typeof SheetPrimitive.Description>) {
|
|
108
|
+
return (
|
|
109
|
+
<SheetPrimitive.Description
|
|
110
|
+
data-slot="sheet-description"
|
|
111
|
+
className={cn('text-muted-foreground text-sm', className)}
|
|
112
|
+
{...props}
|
|
113
|
+
/>
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export {
|
|
118
|
+
Sheet,
|
|
119
|
+
SheetTrigger,
|
|
120
|
+
SheetClose,
|
|
121
|
+
SheetContent,
|
|
122
|
+
SheetHeader,
|
|
123
|
+
SheetFooter,
|
|
124
|
+
SheetTitle,
|
|
125
|
+
SheetDescription,
|
|
126
|
+
};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { ComponentPropsWithRef, forwardRef, Ref } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
fontSizeLookup,
|
|
4
|
+
fontSizeMdLookup,
|
|
5
|
+
fontSizeLgLookup,
|
|
6
|
+
fontWeightLookup,
|
|
7
|
+
fontWeightMdLookup,
|
|
8
|
+
fontWeightLgLookup,
|
|
9
|
+
textAlignLookup,
|
|
10
|
+
textAlignMdLookup,
|
|
11
|
+
textAlignLgLookup,
|
|
12
|
+
colorLookup,
|
|
13
|
+
fontFamilyLookup,
|
|
14
|
+
fontFamilyMdLookup,
|
|
15
|
+
fontFamilyLgLookup,
|
|
16
|
+
fontSizeXlLookup,
|
|
17
|
+
fontWeightXlLookup,
|
|
18
|
+
textAlignXlLookup,
|
|
19
|
+
fontFamilyXlLookup,
|
|
20
|
+
fontSize2xlLookup,
|
|
21
|
+
fontWeight2xlLookup,
|
|
22
|
+
colorMdLookup,
|
|
23
|
+
colorLgLookup,
|
|
24
|
+
colorXlLookup,
|
|
25
|
+
} from '../theme';
|
|
26
|
+
import { cn } from '../libs';
|
|
27
|
+
import { getClassName, memo } from '../utils';
|
|
28
|
+
import { Responsive } from '../types/ui';
|
|
29
|
+
|
|
30
|
+
export type TextSize = keyof typeof fontSizeLookup;
|
|
31
|
+
export type Weight = keyof typeof fontWeightLookup;
|
|
32
|
+
export type Align = keyof typeof textAlignLookup;
|
|
33
|
+
export type Font = keyof typeof fontFamilyLookup;
|
|
34
|
+
export type Color = keyof typeof colorLookup;
|
|
35
|
+
|
|
36
|
+
export interface TextProps extends Omit<ComponentPropsWithRef<'p'>, 'color'> {
|
|
37
|
+
size?: TextSize | Responsive<TextSize>;
|
|
38
|
+
weight?: Weight | Responsive<Weight>;
|
|
39
|
+
font?: Font | Responsive<Font>;
|
|
40
|
+
align?: Align | Responsive<Align>;
|
|
41
|
+
truncate?: boolean | Responsive<boolean>;
|
|
42
|
+
color?: Color | Responsive<Color>;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const Component = (
|
|
46
|
+
{ size, weight, align, truncate, color, font, className, ...rest }: TextProps,
|
|
47
|
+
ref: Ref<HTMLParagraphElement>
|
|
48
|
+
) => {
|
|
49
|
+
const s = size as any;
|
|
50
|
+
const w = weight as any;
|
|
51
|
+
const a = align as any;
|
|
52
|
+
const f = font as any;
|
|
53
|
+
const c = color as any;
|
|
54
|
+
const t = truncate as any;
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
<p
|
|
58
|
+
ref={ref}
|
|
59
|
+
className={cn(
|
|
60
|
+
typeof size !== 'object' && getClassName(size, fontSizeLookup),
|
|
61
|
+
getClassName(s?.base, fontSizeLookup),
|
|
62
|
+
getClassName(s?.md, fontSizeMdLookup),
|
|
63
|
+
getClassName(s?.lg, fontSizeLgLookup),
|
|
64
|
+
getClassName(s?.xl, fontSizeXlLookup),
|
|
65
|
+
getClassName(s?.['2xl'], fontSize2xlLookup),
|
|
66
|
+
typeof weight !== 'object' && getClassName(weight, fontWeightLookup),
|
|
67
|
+
getClassName(w?.base, fontWeightLookup),
|
|
68
|
+
getClassName(w?.md, fontWeightMdLookup),
|
|
69
|
+
getClassName(w?.lg, fontWeightLgLookup),
|
|
70
|
+
getClassName(w?.xl, fontWeightXlLookup),
|
|
71
|
+
getClassName(w?.['2xl'], fontWeight2xlLookup),
|
|
72
|
+
typeof align !== 'object' && getClassName(align, textAlignLookup),
|
|
73
|
+
getClassName(a?.base, textAlignLookup),
|
|
74
|
+
getClassName(a?.md, textAlignMdLookup),
|
|
75
|
+
getClassName(a?.lg, textAlignLgLookup),
|
|
76
|
+
getClassName(a?.xl, textAlignXlLookup),
|
|
77
|
+
typeof font !== 'object' && getClassName(font, fontFamilyLookup),
|
|
78
|
+
getClassName(f?.base, fontFamilyLookup),
|
|
79
|
+
getClassName(f?.md, fontFamilyMdLookup),
|
|
80
|
+
getClassName(f?.lg, fontFamilyLgLookup),
|
|
81
|
+
getClassName(f?.xl, fontFamilyXlLookup),
|
|
82
|
+
typeof color !== 'object' && getClassName(color, colorLookup),
|
|
83
|
+
getClassName(c?.base, colorLookup),
|
|
84
|
+
getClassName(c?.md, colorMdLookup),
|
|
85
|
+
getClassName(c?.lg, colorLgLookup),
|
|
86
|
+
getClassName(c?.xl, colorXlLookup),
|
|
87
|
+
typeof truncate !== 'object' && truncate && 'truncate',
|
|
88
|
+
t?.base && 'truncate',
|
|
89
|
+
t?.md && 'md:truncate',
|
|
90
|
+
t?.lg && 'lg:truncate',
|
|
91
|
+
t?.xl && 'xl:truncate',
|
|
92
|
+
className
|
|
93
|
+
)}
|
|
94
|
+
{...rest}
|
|
95
|
+
/>
|
|
96
|
+
);
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
export const Text = memo(forwardRef(Component));
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { memo } from 'react';
|
|
2
|
+
import { Toaster as Toasts } from 'react-hot-toast';
|
|
3
|
+
|
|
4
|
+
export const Toaster = memo(() => {
|
|
5
|
+
return (
|
|
6
|
+
<Toasts
|
|
7
|
+
position="top-right"
|
|
8
|
+
toastOptions={{
|
|
9
|
+
style: {
|
|
10
|
+
borderRadius: '8px',
|
|
11
|
+
fontSize: '13px',
|
|
12
|
+
background: '#fff',
|
|
13
|
+
color: '#000',
|
|
14
|
+
},
|
|
15
|
+
error: {
|
|
16
|
+
style: {
|
|
17
|
+
background: '#fe8686',
|
|
18
|
+
color: '#fff',
|
|
19
|
+
backdropFilter: 'blur(20px)',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
success: {
|
|
23
|
+
style: {
|
|
24
|
+
background: '#c2fcbf',
|
|
25
|
+
backdropFilter: 'blur(20px)',
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
}}
|
|
29
|
+
/>
|
|
30
|
+
);
|
|
31
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
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';
|
|
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';
|
|
19
|
+
export { Select } from './Select';
|
|
20
|
+
export { Sheet } from './Sheet';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export const getClassName = <T extends string | number | symbol>(
|
|
2
|
+
prop: T | undefined | null,
|
|
3
|
+
lookup: Record<T, string>
|
|
4
|
+
): string | undefined => {
|
|
5
|
+
const isNullish = prop === undefined || prop === null;
|
|
6
|
+
if (isNullish) return undefined;
|
|
7
|
+
return lookup[prop];
|
|
8
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export const LocalStorageGetItem = (key: string): string | null => {
|
|
2
|
+
if (typeof window !== 'undefined') {
|
|
3
|
+
return localStorage.getItem(key);
|
|
4
|
+
}
|
|
5
|
+
return null;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export const LocalStorageSetItem = (key: string, value: string): void => {
|
|
9
|
+
if (typeof window !== 'undefined') {
|
|
10
|
+
localStorage.setItem(key, value);
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const LocalStorageRemoveItem = (key: string): void => {
|
|
15
|
+
if (typeof window !== 'undefined') {
|
|
16
|
+
localStorage.removeItem(key);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ComponentType, memo as reactMemo } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @template T
|
|
5
|
+
* @param {React.ComponentType<T>} Component
|
|
6
|
+
* @returns {React.MemoExoticComponent<React.ComponentType<T>>}
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export const memo = <T extends object>(Component: ComponentType<T>) => reactMemo(Component);
|
|
File without changes
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export const parseString = (value: unknown) => {
|
|
2
|
+
const fallback = '';
|
|
3
|
+
if (!value) return fallback;
|
|
4
|
+
const isString = typeof value === 'string';
|
|
5
|
+
if (!isString) return fallback;
|
|
6
|
+
return value;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export const parseArray = (value: unknown) => {
|
|
10
|
+
const fallback: never[] = [];
|
|
11
|
+
if (!value) return fallback;
|
|
12
|
+
const isArray = Array.isArray(value);
|
|
13
|
+
if (!isArray) return value;
|
|
14
|
+
return value;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const parseNumberForValidator = (value: unknown) => {
|
|
18
|
+
const fallback = '';
|
|
19
|
+
if (!value) return fallback;
|
|
20
|
+
const isNullish = value === undefined || value === null;
|
|
21
|
+
if (isNullish) return fallback;
|
|
22
|
+
const isValid = typeof value === 'number';
|
|
23
|
+
if (!isValid) return fallback;
|
|
24
|
+
return value;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const parseJSON = (value: unknown) => {
|
|
28
|
+
const fallback = {};
|
|
29
|
+
if (!value) return fallback;
|
|
30
|
+
const isNotValid = typeof value === 'string';
|
|
31
|
+
if (isNotValid) return fallback;
|
|
32
|
+
const isValid = typeof value === 'object';
|
|
33
|
+
if (isValid) return value;
|
|
34
|
+
|
|
35
|
+
try {
|
|
36
|
+
const parsed = JSON.parse(value as string);
|
|
37
|
+
return parsed;
|
|
38
|
+
} catch {
|
|
39
|
+
return fallback;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export const tryCatch = async <T, E = Error>(
|
|
2
|
+
fn: (...args: any[]) => Promise<T> | T,
|
|
3
|
+
...args: any[]
|
|
4
|
+
): Promise<[E | null, T | null]> => {
|
|
5
|
+
try {
|
|
6
|
+
const result = fn(...args);
|
|
7
|
+
|
|
8
|
+
if (result instanceof Promise) {
|
|
9
|
+
return result.then((res) => [null, res] as [null, T]).catch((error) => [error as E, null]);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
return [null, result];
|
|
13
|
+
} catch (error) {
|
|
14
|
+
return [error as E, null];
|
|
15
|
+
}
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types="vite/client" />
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"useDefineForClassFields": true,
|
|
5
|
+
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
|
6
|
+
"module": "ESNext",
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
|
|
9
|
+
/* Bundler mode */
|
|
10
|
+
"moduleResolution": "bundler",
|
|
11
|
+
"allowImportingTsExtensions": true,
|
|
12
|
+
"resolveJsonModule": true,
|
|
13
|
+
"isolatedModules": true,
|
|
14
|
+
"noEmit": true,
|
|
15
|
+
"jsx": "react-jsx",
|
|
16
|
+
|
|
17
|
+
/* Linting */
|
|
18
|
+
"strict": true,
|
|
19
|
+
"noUnusedLocals": true,
|
|
20
|
+
"noUnusedParameters": true,
|
|
21
|
+
"noFallthroughCasesInSwitch": true,
|
|
22
|
+
|
|
23
|
+
/* Paths */
|
|
24
|
+
"baseUrl": ".",
|
|
25
|
+
"paths": {
|
|
26
|
+
"@/*": ["src/*"]
|
|
27
|
+
},
|
|
28
|
+
"esModuleInterop": true,
|
|
29
|
+
"allowSyntheticDefaultImports": true
|
|
30
|
+
},
|
|
31
|
+
"include": ["src"],
|
|
32
|
+
"references": [{ "path": "./tsconfig.node.json" }]
|
|
33
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"composite": true,
|
|
4
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
|
5
|
+
"skipLibCheck": true,
|
|
6
|
+
"module": "ESNext",
|
|
7
|
+
"moduleResolution": "bundler",
|
|
8
|
+
"allowSyntheticDefaultImports": true
|
|
9
|
+
},
|
|
10
|
+
"include": ["vite.config.ts"]
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"root":["./src/vite-env.d.ts","./src/app/app.tsx","./src/app/router.tsx","./src/app/main.tsx","./src/app/routes.registry.ts","./src/app/middlewares/authmiddleware.tsx","./src/app/middlewares/index.ts","./src/app/providers/queryprovider.tsx","./src/app/providers/index.ts","./src/features/sample/index.ts","./src/features/sample/sample.routes.ts","./src/features/sample/constants/index.ts","./src/features/sample/constants/sample.assets.ts","./src/features/sample/constants/sample.navigations.ts","./src/features/sample/constants/sample.querykeys.ts","./src/features/sample/pages/samplepage.tsx","./src/features/sample/pages/index.ts","./src/features/welcome/index.ts","./src/features/welcome/welcome.routes.ts","./src/features/welcome/components/codeline.tsx","./src/features/welcome/components/divider.tsx","./src/features/welcome/components/footer.tsx","./src/features/welcome/components/hero.tsx","./src/features/welcome/components/iconlink.tsx","./src/features/welcome/components/quickstartpanel.tsx","./src/features/welcome/components/ringsoft.tsx","./src/features/welcome/components/storysections.tsx","./src/features/welcome/components/whatyouget.tsx","./src/features/welcome/components/index.ts","./src/features/welcome/constants/index.ts","./src/features/welcome/constants/welcome.constants.ts","./src/features/welcome/constants/welcome.navigations.ts","./src/features/welcome/pages/welcomepage.tsx","./src/features/welcome/pages/index.ts","./src/shared/constants/app.constants.ts","./src/shared/constants/assets.constants.ts","./src/shared/constants/index.ts","./src/shared/contexts/index.ts","./src/shared/hooks/index.ts","./src/shared/hooks/usebooleanstate.ts","./src/shared/hooks/usedebounce.ts","./src/shared/hooks/usetogglestate.ts","./src/shared/layouts/index.ts","./src/shared/libs/axios.ts","./src/shared/libs/cn.ts","./src/shared/libs/index.ts","./src/shared/theme/index.ts","./src/shared/theme/theme.ts","./src/shared/types/navigation.ts","./src/shared/types/ui.ts","./src/shared/ui/box.tsx","./src/shared/ui/button.tsx","./src/shared/ui/checkbox.tsx","./src/shared/ui/dropdownmenu.tsx","./src/shared/ui/flex.tsx","./src/shared/ui/flexitem.tsx","./src/shared/ui/formfield.tsx","./src/shared/ui/grid.tsx","./src/shared/ui/griditem.tsx","./src/shared/ui/modal.tsx","./src/shared/ui/scrollable.tsx","./src/shared/ui/select.tsx","./src/shared/ui/sheet.tsx","./src/shared/ui/text.tsx","./src/shared/ui/toaster.tsx","./src/shared/ui/index.ts","./src/shared/utils/getclassname.ts","./src/shared/utils/index.ts","./src/shared/utils/localstorage.ts","./src/shared/utils/memo.ts","./src/shared/utils/motion.ts","./src/shared/utils/parser.ts","./src/shared/utils/regix.ts","./src/shared/utils/trycatch.ts"],"version":"5.9.3"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { defineConfig } from 'vite';
|
|
2
|
+
import react from '@vitejs/plugin-react';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
|
|
5
|
+
export default defineConfig({
|
|
6
|
+
plugins: [react()],
|
|
7
|
+
resolve: {
|
|
8
|
+
alias: {
|
|
9
|
+
'@': path.resolve(__dirname, './src'),
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
preview: {
|
|
13
|
+
port: 3000,
|
|
14
|
+
},
|
|
15
|
+
server: {
|
|
16
|
+
port: 3000,
|
|
17
|
+
},
|
|
18
|
+
});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|