@devkitlab/create-devkitlab-nextjs 0.1.3
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 +82 -0
- package/bin/create-devkitlab-nextjs.mjs +100 -0
- package/package.json +36 -0
- package/template/.eslintrc.json +10 -0
- package/template/.husky/pre-commit +5 -0
- package/template/.prettierrc +11 -0
- package/template/.vscode/settings.json +11 -0
- package/template/README.md +70 -0
- package/template/app/(home)/page.tsx +14 -0
- package/template/app/(home)/sub-components/another-section.tsx +12 -0
- package/template/app/(home)/sub-components/hero-section.tsx +29 -0
- package/template/app/_layout/footer.tsx +12 -0
- package/template/app/_layout/header.tsx +41 -0
- package/template/app/favicon.ico +0 -0
- package/template/app/layout.tsx +31 -0
- package/template/app/provider.tsx +15 -0
- package/template/app/styles.css +72 -0
- package/template/next.config.ts +9 -0
- package/template/package.json +50 -0
- package/template/postcss.config.mjs +8 -0
- package/template/public/next.svg +1 -0
- package/template/public/vercel.svg +1 -0
- package/template/src/components/button/index.tsx +42 -0
- package/template/src/components/button/interface.ts +6 -0
- package/template/src/components/container/index.tsx +13 -0
- package/template/src/components/container/interface.ts +6 -0
- package/template/src/components/icon-store/arrow-icons.tsx +19 -0
- package/template/src/components/icon-store/index.tsx +26 -0
- package/template/src/components/icon-store/interface.ts +10 -0
- package/template/src/components/icon-store/weather-icons.tsx +45 -0
- package/template/src/components/loader/index.tsx +20 -0
- package/template/src/components/loader/interface.ts +3 -0
- package/template/src/components/typography/index.tsx +10 -0
- package/template/src/components/typography/interface.ts +13 -0
- package/template/src/utils/class-merge.ts +4 -0
- package/template/tailwind.config.ts +52 -0
- package/template/tsconfig.json +23 -0
- package/template/yarn.lock +4312 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { cn } from '@/utils/class-merge';
|
|
4
|
+
import { TERipple } from 'tw-elements-react';
|
|
5
|
+
import type { IButtonProps } from './interface';
|
|
6
|
+
|
|
7
|
+
export default function Button({
|
|
8
|
+
children,
|
|
9
|
+
className,
|
|
10
|
+
size = 'md',
|
|
11
|
+
variant = 'primary',
|
|
12
|
+
disabled = false,
|
|
13
|
+
...rest
|
|
14
|
+
}: IButtonProps) {
|
|
15
|
+
return (
|
|
16
|
+
<TERipple>
|
|
17
|
+
<button
|
|
18
|
+
className={cn(
|
|
19
|
+
{
|
|
20
|
+
'py-3 px-5 text-lg': size === 'lg',
|
|
21
|
+
'py-2 px-4': size === 'md',
|
|
22
|
+
'py-1.5 px-3 text-sm': size === 'sm',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
'bg-primary': variant === 'primary',
|
|
26
|
+
'bg-primary-light': variant === 'secondary',
|
|
27
|
+
'bg-transparent border': variant === 'transparent',
|
|
28
|
+
},
|
|
29
|
+
disabled ? 'disabled:cursor-not-allowed' : 'hover:shadow-md',
|
|
30
|
+
'flex items-center gap-2 rounded transition-all dark:bg-primary',
|
|
31
|
+
className
|
|
32
|
+
)}
|
|
33
|
+
disabled={disabled}
|
|
34
|
+
{...rest}
|
|
35
|
+
>
|
|
36
|
+
{children}
|
|
37
|
+
</button>
|
|
38
|
+
</TERipple>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
Button.displayName = 'Button';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { cn } from '@/utils/class-merge';
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import type { IContainerProps } from './interface';
|
|
4
|
+
|
|
5
|
+
const Container = forwardRef<HTMLDivElement, IContainerProps>(({ children, className }, ref) => (
|
|
6
|
+
<div ref={ref} className={cn('container', className)}>
|
|
7
|
+
{children}
|
|
8
|
+
</div>
|
|
9
|
+
));
|
|
10
|
+
|
|
11
|
+
Container.displayName = 'Container';
|
|
12
|
+
|
|
13
|
+
export default Container;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export function ArrowRightLong() {
|
|
2
|
+
return (
|
|
3
|
+
<svg
|
|
4
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
5
|
+
height="1em"
|
|
6
|
+
width="1em"
|
|
7
|
+
viewBox="0 0 24 24"
|
|
8
|
+
fill="none"
|
|
9
|
+
strokeWidth={1.5}
|
|
10
|
+
stroke="currentColor"
|
|
11
|
+
>
|
|
12
|
+
<path
|
|
13
|
+
strokeLinecap="round"
|
|
14
|
+
strokeLinejoin="round"
|
|
15
|
+
d="M17.25 8.25L21 12m0 0l-3.75 3.75M21 12H3"
|
|
16
|
+
/>
|
|
17
|
+
</svg>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { cn } from '@/utils/class-merge';
|
|
2
|
+
import { ArrowRightLong } from './arrow-icons';
|
|
3
|
+
import type { IIconProps } from './interface';
|
|
4
|
+
import { MoonIcon, SunIcon } from './weather-icons';
|
|
5
|
+
|
|
6
|
+
function IconStore({ name }: Pick<IIconProps, 'name'>) {
|
|
7
|
+
switch (name) {
|
|
8
|
+
// arrow icons
|
|
9
|
+
case 'arrow-right-long':
|
|
10
|
+
return <ArrowRightLong />;
|
|
11
|
+
|
|
12
|
+
// weather icons
|
|
13
|
+
case 'sun':
|
|
14
|
+
return <SunIcon />;
|
|
15
|
+
case 'moon':
|
|
16
|
+
return <MoonIcon />;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export default function Icon({ name, className, ...rest }: IIconProps) {
|
|
21
|
+
return (
|
|
22
|
+
<span className={cn(className)} {...rest}>
|
|
23
|
+
<IconStore name={name} />
|
|
24
|
+
</span>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ClassValue } from 'clsx';
|
|
2
|
+
|
|
3
|
+
export type ArrowIcons = 'arrow-right-long' | 'arrow-left-long';
|
|
4
|
+
export type WeatherIcons = 'moon' | 'sun';
|
|
5
|
+
|
|
6
|
+
export interface IIconProps {
|
|
7
|
+
name: ArrowIcons | WeatherIcons;
|
|
8
|
+
className?: ClassValue;
|
|
9
|
+
onClick?: () => void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export function SunIcon() {
|
|
2
|
+
return (
|
|
3
|
+
<svg
|
|
4
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
5
|
+
width="1em"
|
|
6
|
+
height="1em"
|
|
7
|
+
viewBox="0 0 24 24"
|
|
8
|
+
fill="none"
|
|
9
|
+
stroke="currentColor"
|
|
10
|
+
strokeWidth={2}
|
|
11
|
+
strokeLinecap="round"
|
|
12
|
+
strokeLinejoin="round"
|
|
13
|
+
>
|
|
14
|
+
<circle cx="12" cy="12" r="4" />
|
|
15
|
+
<path d="M12 2v2" />
|
|
16
|
+
<path d="M12 20v2" />
|
|
17
|
+
<path d="m4.93 4.93 1.41 1.41" />
|
|
18
|
+
<path d="m17.66 17.66 1.41 1.41" />
|
|
19
|
+
<path d="M2 12h2" />
|
|
20
|
+
<path d="M20 12h2" />
|
|
21
|
+
<path d="m6.34 17.66-1.41 1.41" />
|
|
22
|
+
<path d="m19.07 4.93-1.41 1.41" />
|
|
23
|
+
</svg>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function MoonIcon() {
|
|
28
|
+
return (
|
|
29
|
+
<svg
|
|
30
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
31
|
+
width="1em"
|
|
32
|
+
height="1em"
|
|
33
|
+
viewBox="0 0 24 24"
|
|
34
|
+
fill="none"
|
|
35
|
+
stroke="currentColor"
|
|
36
|
+
strokeWidth={2}
|
|
37
|
+
strokeLinecap="round"
|
|
38
|
+
strokeLinejoin="round"
|
|
39
|
+
>
|
|
40
|
+
<path d="M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9" />
|
|
41
|
+
<path d="M20 3v4" />
|
|
42
|
+
<path d="M22 5h-4" />
|
|
43
|
+
</svg>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { cn } from '@/utils/class-merge';
|
|
2
|
+
import type { ILoadingState } from './interface';
|
|
3
|
+
|
|
4
|
+
export default function Loader({ viewport }: ILoadingState) {
|
|
5
|
+
return (
|
|
6
|
+
<section
|
|
7
|
+
className={cn(
|
|
8
|
+
'flex items-center justify-center relative py-10 h-full flex-grow',
|
|
9
|
+
viewport && 'h-screen absolute inset-0'
|
|
10
|
+
)}
|
|
11
|
+
>
|
|
12
|
+
<span className="relative flex h-10 w-10">
|
|
13
|
+
<span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-primary opacity-75"></span>
|
|
14
|
+
<span className="relative inline-flex rounded-full h-full w-full bg-primary"></span>
|
|
15
|
+
</span>
|
|
16
|
+
</section>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
Loader.displayName = 'Loader';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { cn } from '@/utils/class-merge';
|
|
2
|
+
import type ITypography from './interface';
|
|
3
|
+
|
|
4
|
+
export default function Typography({ children, variant = 'p', className }: ITypography) {
|
|
5
|
+
const Wrapper = variant;
|
|
6
|
+
|
|
7
|
+
return <Wrapper className={cn(className)}>{children}</Wrapper>;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
Typography.displayName = 'Typography';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ClassValue } from 'clsx';
|
|
2
|
+
import type { PropsWithChildren } from 'react';
|
|
3
|
+
|
|
4
|
+
// the possible heading, paragraph, and other sizes.
|
|
5
|
+
type Heading = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
6
|
+
type Paragraph = 'p';
|
|
7
|
+
|
|
8
|
+
interface ITypography extends PropsWithChildren {
|
|
9
|
+
variant?: Heading | Paragraph | 'span';
|
|
10
|
+
className?: ClassValue;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default ITypography;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { Config } from 'tailwindcss';
|
|
2
|
+
|
|
3
|
+
const config: Config = {
|
|
4
|
+
darkMode: 'class',
|
|
5
|
+
content: [
|
|
6
|
+
'./src/**/*.{js,ts,jsx,tsx,mdx}',
|
|
7
|
+
'./app/**/*.{js,ts,jsx,tsx,mdx}',
|
|
8
|
+
'./node_modules/tw-elements-react/dist/js/**/*.js',
|
|
9
|
+
],
|
|
10
|
+
theme: {
|
|
11
|
+
extend: {
|
|
12
|
+
colors: {
|
|
13
|
+
primary: {
|
|
14
|
+
DEFAULT: '#ff4733',
|
|
15
|
+
light: '#ffada2',
|
|
16
|
+
lighter: '#ffc6bf',
|
|
17
|
+
},
|
|
18
|
+
|
|
19
|
+
white: {
|
|
20
|
+
DEFAULT: '#EEEEEE',
|
|
21
|
+
deep: '#ffffff',
|
|
22
|
+
light: '#edf6f9',
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
dark: {
|
|
26
|
+
DEFAULT: '#26282B',
|
|
27
|
+
deep: '#1e1e1e',
|
|
28
|
+
light: '#363B4E',
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
gray: {
|
|
32
|
+
DEFAULT: '#555555',
|
|
33
|
+
deep: '#404040',
|
|
34
|
+
light: '#999999',
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
fontFamily: {
|
|
38
|
+
heading: ['"Averia Serif Libre"', 'serif'],
|
|
39
|
+
body: ['"Roboto Slab"', 'Roboto', 'serif'],
|
|
40
|
+
},
|
|
41
|
+
container: {
|
|
42
|
+
center: true,
|
|
43
|
+
screens: {
|
|
44
|
+
sm: '100%',
|
|
45
|
+
'2xl': '1280px',
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
plugins: [require('tw-elements-react/dist/plugin.cjs')],
|
|
51
|
+
};
|
|
52
|
+
export default config;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"lib": ["dom", "dom.iterable", "esnext"],
|
|
4
|
+
"allowJs": true,
|
|
5
|
+
"skipLibCheck": true,
|
|
6
|
+
"strict": true,
|
|
7
|
+
"noEmit": true,
|
|
8
|
+
"esModuleInterop": true,
|
|
9
|
+
"module": "esnext",
|
|
10
|
+
"moduleResolution": "bundler",
|
|
11
|
+
"resolveJsonModule": true,
|
|
12
|
+
"isolatedModules": true,
|
|
13
|
+
"jsx": "preserve",
|
|
14
|
+
"incremental": true,
|
|
15
|
+
"plugins": [{ "name": "next" }],
|
|
16
|
+
"paths": {
|
|
17
|
+
"@/*": ["./src/*"]
|
|
18
|
+
},
|
|
19
|
+
"target": "ES2017"
|
|
20
|
+
},
|
|
21
|
+
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
|
|
22
|
+
"exclude": ["node_modules"]
|
|
23
|
+
}
|