@devkitlab/create-nextjs 0.2.9

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.
Files changed (38) hide show
  1. package/README.md +69 -0
  2. package/bin/create-nextjs.mjs +100 -0
  3. package/package.json +35 -0
  4. package/template/.eslintrc.json +10 -0
  5. package/template/.husky/pre-commit +5 -0
  6. package/template/.prettierrc +11 -0
  7. package/template/.vscode/settings.json +11 -0
  8. package/template/README.md +70 -0
  9. package/template/app/(home)/page.tsx +14 -0
  10. package/template/app/(home)/sub-components/another-section.tsx +12 -0
  11. package/template/app/(home)/sub-components/hero-section.tsx +29 -0
  12. package/template/app/_layout/footer.tsx +12 -0
  13. package/template/app/_layout/header.tsx +41 -0
  14. package/template/app/favicon.ico +0 -0
  15. package/template/app/layout.tsx +31 -0
  16. package/template/app/provider.tsx +15 -0
  17. package/template/app/styles.css +72 -0
  18. package/template/next.config.ts +9 -0
  19. package/template/package.json +50 -0
  20. package/template/postcss.config.mjs +8 -0
  21. package/template/public/next.svg +1 -0
  22. package/template/public/vercel.svg +1 -0
  23. package/template/src/components/button/index.tsx +42 -0
  24. package/template/src/components/button/interface.ts +6 -0
  25. package/template/src/components/container/index.tsx +13 -0
  26. package/template/src/components/container/interface.ts +6 -0
  27. package/template/src/components/icon-store/arrow-icons.tsx +19 -0
  28. package/template/src/components/icon-store/index.tsx +26 -0
  29. package/template/src/components/icon-store/interface.ts +10 -0
  30. package/template/src/components/icon-store/weather-icons.tsx +45 -0
  31. package/template/src/components/loader/index.tsx +20 -0
  32. package/template/src/components/loader/interface.ts +3 -0
  33. package/template/src/components/typography/index.tsx +10 -0
  34. package/template/src/components/typography/interface.ts +13 -0
  35. package/template/src/utils/class-merge.ts +4 -0
  36. package/template/tailwind.config.ts +52 -0
  37. package/template/tsconfig.json +23 -0
  38. package/template/yarn.lock +4312 -0
@@ -0,0 +1,6 @@
1
+ import type { ButtonHTMLAttributes, PropsWithChildren } from 'react';
2
+
3
+ export interface IButtonProps extends PropsWithChildren, ButtonHTMLAttributes<HTMLButtonElement> {
4
+ size?: 'lg' | 'md' | 'sm';
5
+ variant?: 'primary' | 'secondary' | 'transparent';
6
+ }
@@ -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,6 @@
1
+ import type { ClassValue } from 'clsx';
2
+ import type { PropsWithChildren } from 'react';
3
+
4
+ export interface IContainerProps extends PropsWithChildren {
5
+ className?: ClassValue;
6
+ }
@@ -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,3 @@
1
+ export interface ILoadingState {
2
+ viewport?: boolean;
3
+ }
@@ -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,4 @@
1
+ import { clsx, type ClassValue } from 'clsx';
2
+ import { twMerge } from 'tailwind-merge';
3
+
4
+ export const cn = (...inputs: ClassValue[]) => twMerge(clsx(inputs));
@@ -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
+ }