create-reactivite 1.3.0 → 1.6.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/README.md +326 -235
- package/index.js +157 -34
- package/package.json +5 -3
- package/template/package.json +22 -22
- package/template/pnpm-lock.yaml +3274 -3274
- package/template/src/components/author-credit.tsx +25 -25
- package/template2/.env.example +8 -8
- package/template2/.husky/pre-commit +4 -4
- package/template2/.prettierrc +5 -5
- package/template2/README.md +73 -73
- package/template2/__tests__/example.test.ts +20 -20
- package/template2/_gitignore +37 -37
- package/template2/app/[locale]/(private)/dashboard/page.tsx +52 -52
- package/template2/app/[locale]/(public)/login/page.tsx +83 -83
- package/template2/app/[locale]/layout.tsx +58 -58
- package/template2/app/[locale]/locales.ts +10 -10
- package/template2/app/[locale]/page.tsx +38 -38
- package/template2/app/api/clear-session/route.ts +10 -10
- package/template2/app/globals.css +127 -127
- package/template2/app/layout.tsx +7 -7
- package/template2/app/page.tsx +6 -6
- package/template2/components/AuthEventListener.tsx +22 -22
- package/template2/components/author-credit.tsx +25 -25
- package/template2/components/theme-provider.tsx +78 -78
- package/template2/components/ui/button.tsx +60 -60
- package/template2/components/ui/card.tsx +92 -92
- package/template2/components/ui/input.tsx +21 -21
- package/template2/components/ui/label.tsx +24 -24
- package/template2/components/ui/sonner.tsx +40 -40
- package/template2/components.json +22 -22
- package/template2/config/constants.ts +7 -7
- package/template2/config/env.ts +5 -5
- package/template2/contexts/translation-context.tsx +70 -70
- package/template2/eslint.config.mjs +18 -18
- package/template2/hoc/provider.tsx +27 -27
- package/template2/lib/paramsSerializer.ts +40 -40
- package/template2/lib/utils.ts +6 -6
- package/template2/locales/az.json +20 -20
- package/template2/locales/en.json +20 -20
- package/template2/next-env.d.ts +1 -1
- package/template2/next.config.ts +17 -17
- package/template2/orval.config.ts +66 -66
- package/template2/package.json +62 -62
- package/template2/postcss.config.mjs +7 -7
- package/template2/scripts/fix-generated-types.mjs +13 -13
- package/template2/services/generated/.gitkeep +2 -2
- package/template2/services/httpClient/httpClient.ts +70 -70
- package/template2/services/httpClient/orvalMutator.ts +10 -10
- package/template2/store/example-store.tsx +16 -16
- package/template2/store/user-store.tsx +29 -29
- package/template2/testing/msw/handlers/index.ts +6 -6
- package/template2/testing/msw/server.ts +4 -4
- package/template2/tsconfig.json +34 -34
- package/template2/vitest.config.ts +17 -17
- package/template2/vitest.setup.ts +7 -7
- package/template3/README.md +34 -34
- package/template3/_gitignore +16 -16
- package/template3/components.json +21 -0
- package/template3/index.html +8 -2
- package/template3/package-lock.json +3934 -0
- package/template3/package.json +48 -22
- package/template3/postcss.config.mjs +5 -0
- package/template3/rspack.config.mjs +59 -51
- package/template3/src/App.tsx +16 -11
- package/template3/src/components/author-credit.tsx +42 -42
- package/template3/src/components/layout.tsx +59 -0
- package/template3/src/components/matrix-rain.tsx +71 -0
- package/template3/src/components/ui/accordion.tsx +64 -0
- package/template3/src/components/ui/alert-dialog.tsx +196 -0
- package/template3/src/components/ui/alert.tsx +66 -0
- package/template3/src/components/ui/aspect-ratio.tsx +11 -0
- package/template3/src/components/ui/avatar.tsx +107 -0
- package/template3/src/components/ui/badge.tsx +48 -0
- package/template3/src/components/ui/breadcrumb.tsx +109 -0
- package/template3/src/components/ui/button-group.tsx +83 -0
- package/template3/src/components/ui/button.tsx +64 -0
- package/template3/src/components/ui/calendar.tsx +218 -0
- package/template3/src/components/ui/card.tsx +92 -0
- package/template3/src/components/ui/carousel.tsx +241 -0
- package/template3/src/components/ui/chart.tsx +372 -0
- package/template3/src/components/ui/checkbox.tsx +32 -0
- package/template3/src/components/ui/collapsible.tsx +31 -0
- package/template3/src/components/ui/combobox.tsx +310 -0
- package/template3/src/components/ui/command.tsx +184 -0
- package/template3/src/components/ui/context-menu.tsx +252 -0
- package/template3/src/components/ui/dialog.tsx +156 -0
- package/template3/src/components/ui/direction.tsx +22 -0
- package/template3/src/components/ui/drawer.tsx +133 -0
- package/template3/src/components/ui/dropdown-menu.tsx +257 -0
- package/template3/src/components/ui/empty.tsx +104 -0
- package/template3/src/components/ui/field.tsx +248 -0
- package/template3/src/components/ui/form.tsx +165 -0
- package/template3/src/components/ui/hover-card.tsx +42 -0
- package/template3/src/components/ui/input-group.tsx +168 -0
- package/template3/src/components/ui/input-otp.tsx +77 -0
- package/template3/src/components/ui/input.tsx +21 -0
- package/template3/src/components/ui/item.tsx +193 -0
- package/template3/src/components/ui/kbd.tsx +28 -0
- package/template3/src/components/ui/label.tsx +22 -0
- package/template3/src/components/ui/menubar.tsx +276 -0
- package/template3/src/components/ui/native-select.tsx +62 -0
- package/template3/src/components/ui/navigation-menu.tsx +168 -0
- package/template3/src/components/ui/pagination.tsx +127 -0
- package/template3/src/components/ui/popover.tsx +87 -0
- package/template3/src/components/ui/progress.tsx +31 -0
- package/template3/src/components/ui/radio-group.tsx +43 -0
- package/template3/src/components/ui/resizable.tsx +53 -0
- package/template3/src/components/ui/scroll-area.tsx +56 -0
- package/template3/src/components/ui/select.tsx +190 -0
- package/template3/src/components/ui/separator.tsx +26 -0
- package/template3/src/components/ui/sheet.tsx +143 -0
- package/template3/src/components/ui/sidebar.tsx +724 -0
- package/template3/src/components/ui/skeleton.tsx +13 -0
- package/template3/src/components/ui/slider.tsx +61 -0
- package/template3/src/components/ui/sonner.tsx +40 -0
- package/template3/src/components/ui/spinner.tsx +16 -0
- package/template3/src/components/ui/switch.tsx +33 -0
- package/template3/src/components/ui/table.tsx +116 -0
- package/template3/src/components/ui/tabs.tsx +89 -0
- package/template3/src/components/ui/textarea.tsx +18 -0
- package/template3/src/components/ui/toggle-group.tsx +83 -0
- package/template3/src/components/ui/toggle.tsx +47 -0
- package/template3/src/components/ui/tooltip.tsx +55 -0
- package/template3/src/hooks/use-mobile.ts +19 -0
- package/template3/src/index.css +175 -32
- package/template3/src/lib/utils.ts +6 -0
- package/template3/src/main.tsx +10 -10
- package/template3/src/pages/about.tsx +113 -0
- package/template3/src/pages/contact.tsx +111 -0
- package/template3/src/pages/home.tsx +81 -0
- package/template3/tsconfig.json +24 -20
- package/template2/tsconfig.tsbuildinfo +0 -1
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
import type React from 'react';
|
|
2
|
-
import type { Metadata } from 'next';
|
|
3
|
-
import { Geist } from 'next/font/google';
|
|
4
|
-
import { Suspense } from 'react';
|
|
5
|
-
import { notFound } from 'next/navigation';
|
|
6
|
-
import '../globals.css';
|
|
7
|
-
import { ThemeProvider } from '@/components/theme-provider';
|
|
8
|
-
import { TranslationProvider } from '@/contexts/translation-context';
|
|
9
|
-
import { Toaster } from '@/components/ui/sonner';
|
|
10
|
-
import { QueryProvider } from '@/hoc/provider';
|
|
11
|
-
import { AuthEventListener } from '@/components/AuthEventListener';
|
|
12
|
-
import { AuthorCredit } from '@/components/author-credit';
|
|
13
|
-
import { LOCALES, type Locale } from '@/config/constants';
|
|
14
|
-
import { getDictionary } from './locales';
|
|
15
|
-
|
|
16
|
-
const geist = Geist({ subsets: ['latin'] });
|
|
17
|
-
|
|
18
|
-
export const metadata: Metadata = {
|
|
19
|
-
title: 'Nextivite',
|
|
20
|
-
description: 'Next.js boilerplate scaffolded by create-reactivite.',
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export function generateStaticParams() {
|
|
24
|
-
return LOCALES.map((locale) => ({ locale }));
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export default async function LocaleLayout({
|
|
28
|
-
children,
|
|
29
|
-
params,
|
|
30
|
-
}: Readonly<{
|
|
31
|
-
children: React.ReactNode;
|
|
32
|
-
params: Promise<{ locale: string }>;
|
|
33
|
-
}>) {
|
|
34
|
-
const { locale } = await params;
|
|
35
|
-
|
|
36
|
-
if (!LOCALES.includes(locale as Locale)) {
|
|
37
|
-
notFound();
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const messages = await getDictionary(locale as Locale);
|
|
41
|
-
|
|
42
|
-
return (
|
|
43
|
-
<html lang={locale} suppressHydrationWarning>
|
|
44
|
-
<body className={`${geist.className} font-sans antialiased`}>
|
|
45
|
-
<QueryProvider>
|
|
46
|
-
<ThemeProvider defaultMode="light" storageKey="app-theme">
|
|
47
|
-
<TranslationProvider locale={locale} messages={messages}>
|
|
48
|
-
<AuthEventListener />
|
|
49
|
-
<Suspense fallback={null}>{children}</Suspense>
|
|
50
|
-
<AuthorCredit />
|
|
51
|
-
</TranslationProvider>
|
|
52
|
-
<Toaster />
|
|
53
|
-
</ThemeProvider>
|
|
54
|
-
</QueryProvider>
|
|
55
|
-
</body>
|
|
56
|
-
</html>
|
|
57
|
-
);
|
|
58
|
-
}
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { Metadata } from 'next';
|
|
3
|
+
import { Geist } from 'next/font/google';
|
|
4
|
+
import { Suspense } from 'react';
|
|
5
|
+
import { notFound } from 'next/navigation';
|
|
6
|
+
import '../globals.css';
|
|
7
|
+
import { ThemeProvider } from '@/components/theme-provider';
|
|
8
|
+
import { TranslationProvider } from '@/contexts/translation-context';
|
|
9
|
+
import { Toaster } from '@/components/ui/sonner';
|
|
10
|
+
import { QueryProvider } from '@/hoc/provider';
|
|
11
|
+
import { AuthEventListener } from '@/components/AuthEventListener';
|
|
12
|
+
import { AuthorCredit } from '@/components/author-credit';
|
|
13
|
+
import { LOCALES, type Locale } from '@/config/constants';
|
|
14
|
+
import { getDictionary } from './locales';
|
|
15
|
+
|
|
16
|
+
const geist = Geist({ subsets: ['latin'] });
|
|
17
|
+
|
|
18
|
+
export const metadata: Metadata = {
|
|
19
|
+
title: 'Nextivite',
|
|
20
|
+
description: 'Next.js boilerplate scaffolded by create-reactivite.',
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export function generateStaticParams() {
|
|
24
|
+
return LOCALES.map((locale) => ({ locale }));
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export default async function LocaleLayout({
|
|
28
|
+
children,
|
|
29
|
+
params,
|
|
30
|
+
}: Readonly<{
|
|
31
|
+
children: React.ReactNode;
|
|
32
|
+
params: Promise<{ locale: string }>;
|
|
33
|
+
}>) {
|
|
34
|
+
const { locale } = await params;
|
|
35
|
+
|
|
36
|
+
if (!LOCALES.includes(locale as Locale)) {
|
|
37
|
+
notFound();
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const messages = await getDictionary(locale as Locale);
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<html lang={locale} suppressHydrationWarning>
|
|
44
|
+
<body className={`${geist.className} font-sans antialiased`}>
|
|
45
|
+
<QueryProvider>
|
|
46
|
+
<ThemeProvider defaultMode="light" storageKey="app-theme">
|
|
47
|
+
<TranslationProvider locale={locale} messages={messages}>
|
|
48
|
+
<AuthEventListener />
|
|
49
|
+
<Suspense fallback={null}>{children}</Suspense>
|
|
50
|
+
<AuthorCredit />
|
|
51
|
+
</TranslationProvider>
|
|
52
|
+
<Toaster />
|
|
53
|
+
</ThemeProvider>
|
|
54
|
+
</QueryProvider>
|
|
55
|
+
</body>
|
|
56
|
+
</html>
|
|
57
|
+
);
|
|
58
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import 'server-only';
|
|
2
|
-
import type { Locale } from '@/config/constants';
|
|
3
|
-
|
|
4
|
-
const locales = {
|
|
5
|
-
az: () => import('../../locales/az.json').then((m) => m.default),
|
|
6
|
-
en: () => import('../../locales/en.json').then((m) => m.default),
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export const getDictionary = async (locale: Locale) =>
|
|
10
|
-
locales[locale]?.() ?? locales.az();
|
|
1
|
+
import 'server-only';
|
|
2
|
+
import type { Locale } from '@/config/constants';
|
|
3
|
+
|
|
4
|
+
const locales = {
|
|
5
|
+
az: () => import('../../locales/az.json').then((m) => m.default),
|
|
6
|
+
en: () => import('../../locales/en.json').then((m) => m.default),
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export const getDictionary = async (locale: Locale) =>
|
|
10
|
+
locales[locale]?.() ?? locales.az();
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import Link from 'next/link';
|
|
2
|
-
import { Button } from '@/components/ui/button';
|
|
3
|
-
import {
|
|
4
|
-
Card,
|
|
5
|
-
CardContent,
|
|
6
|
-
CardDescription,
|
|
7
|
-
CardHeader,
|
|
8
|
-
CardTitle,
|
|
9
|
-
} from '@/components/ui/card';
|
|
10
|
-
import { getDictionary } from './locales';
|
|
11
|
-
import type { Locale } from '@/config/constants';
|
|
12
|
-
|
|
13
|
-
export default async function HomePage({
|
|
14
|
-
params,
|
|
15
|
-
}: Readonly<{ params: Promise<{ locale: Locale }> }>) {
|
|
16
|
-
const { locale } = await params;
|
|
17
|
-
const dict = await getDictionary(locale);
|
|
18
|
-
const t = dict.home;
|
|
19
|
-
|
|
20
|
-
return (
|
|
21
|
-
<main className="flex min-h-screen items-center justify-center p-6">
|
|
22
|
-
<Card className="w-full max-w-xl">
|
|
23
|
-
<CardHeader>
|
|
24
|
-
<CardTitle className="text-2xl">{t.title}</CardTitle>
|
|
25
|
-
<CardDescription>{t.subtitle}</CardDescription>
|
|
26
|
-
</CardHeader>
|
|
27
|
-
<CardContent className="flex flex-wrap gap-3">
|
|
28
|
-
<Button asChild>
|
|
29
|
-
<Link href={`/${locale}/login`}>{t.login}</Link>
|
|
30
|
-
</Button>
|
|
31
|
-
<Button asChild variant="outline">
|
|
32
|
-
<Link href={`/${locale}/dashboard`}>{t.dashboard}</Link>
|
|
33
|
-
</Button>
|
|
34
|
-
</CardContent>
|
|
35
|
-
</Card>
|
|
36
|
-
</main>
|
|
37
|
-
);
|
|
38
|
-
}
|
|
1
|
+
import Link from 'next/link';
|
|
2
|
+
import { Button } from '@/components/ui/button';
|
|
3
|
+
import {
|
|
4
|
+
Card,
|
|
5
|
+
CardContent,
|
|
6
|
+
CardDescription,
|
|
7
|
+
CardHeader,
|
|
8
|
+
CardTitle,
|
|
9
|
+
} from '@/components/ui/card';
|
|
10
|
+
import { getDictionary } from './locales';
|
|
11
|
+
import type { Locale } from '@/config/constants';
|
|
12
|
+
|
|
13
|
+
export default async function HomePage({
|
|
14
|
+
params,
|
|
15
|
+
}: Readonly<{ params: Promise<{ locale: Locale }> }>) {
|
|
16
|
+
const { locale } = await params;
|
|
17
|
+
const dict = await getDictionary(locale);
|
|
18
|
+
const t = dict.home;
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<main className="flex min-h-screen items-center justify-center p-6">
|
|
22
|
+
<Card className="w-full max-w-xl">
|
|
23
|
+
<CardHeader>
|
|
24
|
+
<CardTitle className="text-2xl">{t.title}</CardTitle>
|
|
25
|
+
<CardDescription>{t.subtitle}</CardDescription>
|
|
26
|
+
</CardHeader>
|
|
27
|
+
<CardContent className="flex flex-wrap gap-3">
|
|
28
|
+
<Button asChild>
|
|
29
|
+
<Link href={`/${locale}/login`}>{t.login}</Link>
|
|
30
|
+
</Button>
|
|
31
|
+
<Button asChild variant="outline">
|
|
32
|
+
<Link href={`/${locale}/dashboard`}>{t.dashboard}</Link>
|
|
33
|
+
</Button>
|
|
34
|
+
</CardContent>
|
|
35
|
+
</Card>
|
|
36
|
+
</main>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { NextResponse } from 'next/server';
|
|
2
|
-
|
|
3
|
-
// Clears the auth cookie(s) when the backend logout call fails or is skipped.
|
|
4
|
-
// Add the cookie names your backend sets.
|
|
5
|
-
export async function POST() {
|
|
6
|
-
const res = NextResponse.json({ ok: true });
|
|
7
|
-
res.cookies.delete('access_token');
|
|
8
|
-
res.cookies.delete('refresh_token');
|
|
9
|
-
return res;
|
|
10
|
-
}
|
|
1
|
+
import { NextResponse } from 'next/server';
|
|
2
|
+
|
|
3
|
+
// Clears the auth cookie(s) when the backend logout call fails or is skipped.
|
|
4
|
+
// Add the cookie names your backend sets.
|
|
5
|
+
export async function POST() {
|
|
6
|
+
const res = NextResponse.json({ ok: true });
|
|
7
|
+
res.cookies.delete('access_token');
|
|
8
|
+
res.cookies.delete('refresh_token');
|
|
9
|
+
return res;
|
|
10
|
+
}
|
|
@@ -1,127 +1,127 @@
|
|
|
1
|
-
@import "tailwindcss";
|
|
2
|
-
@import "tw-animate-css";
|
|
3
|
-
|
|
4
|
-
@custom-variant dark (&:is(.dark *));
|
|
5
|
-
|
|
6
|
-
:root,
|
|
7
|
-
.default {
|
|
8
|
-
--background: oklch(0.99 0 0);
|
|
9
|
-
--foreground: oklch(0.15 0 0);
|
|
10
|
-
--card: oklch(1 0 0);
|
|
11
|
-
--card-foreground: oklch(0.15 0 0);
|
|
12
|
-
--popover: oklch(1 0 0);
|
|
13
|
-
--popover-foreground: oklch(0.15 0 0);
|
|
14
|
-
--primary: oklch(0.55 0.18 250);
|
|
15
|
-
--primary-foreground: oklch(0.99 0 0);
|
|
16
|
-
--secondary: oklch(0.96 0 0);
|
|
17
|
-
--secondary-foreground: oklch(0.15 0 0);
|
|
18
|
-
--muted: oklch(0.96 0.01 250);
|
|
19
|
-
--muted-foreground: oklch(0.5 0 0);
|
|
20
|
-
--accent: oklch(0.65 0.2 30);
|
|
21
|
-
--accent-foreground: oklch(0.99 0 0);
|
|
22
|
-
--destructive: oklch(0.577 0.245 27.325);
|
|
23
|
-
--destructive-foreground: oklch(0.99 0 0);
|
|
24
|
-
--border: oklch(0.9 0 0);
|
|
25
|
-
--input: oklch(0.9 0 0);
|
|
26
|
-
--ring: oklch(0.55 0.18 250);
|
|
27
|
-
--chart-1: oklch(0.55 0.18 250);
|
|
28
|
-
--chart-2: oklch(0.65 0.2 30);
|
|
29
|
-
--chart-3: oklch(0.6 0.15 180);
|
|
30
|
-
--chart-4: oklch(0.7 0.18 320);
|
|
31
|
-
--chart-5: oklch(0.65 0.16 140);
|
|
32
|
-
--radius: 0.75rem;
|
|
33
|
-
--sidebar: oklch(0.99 0 0);
|
|
34
|
-
--sidebar-foreground: oklch(0.15 0 0);
|
|
35
|
-
--sidebar-primary: oklch(0.55 0.18 250);
|
|
36
|
-
--sidebar-primary-foreground: oklch(0.99 0 0);
|
|
37
|
-
--sidebar-accent: oklch(0.96 0 0);
|
|
38
|
-
--sidebar-accent-foreground: oklch(0.15 0 0);
|
|
39
|
-
--sidebar-border: oklch(0.9 0 0);
|
|
40
|
-
--sidebar-ring: oklch(0.55 0.18 250);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.dark {
|
|
44
|
-
--background: oklch(0.12 0 0);
|
|
45
|
-
--foreground: oklch(0.98 0 0);
|
|
46
|
-
--card: oklch(0.15 0 0);
|
|
47
|
-
--card-foreground: oklch(0.98 0 0);
|
|
48
|
-
--popover: oklch(0.15 0 0);
|
|
49
|
-
--popover-foreground: oklch(0.98 0 0);
|
|
50
|
-
--primary: oklch(0.65 0.2 250);
|
|
51
|
-
--primary-foreground: oklch(0.12 0 0);
|
|
52
|
-
--secondary: oklch(0.2 0 0);
|
|
53
|
-
--secondary-foreground: oklch(0.98 0 0);
|
|
54
|
-
--muted: oklch(0.2 0.01 250);
|
|
55
|
-
--muted-foreground: oklch(0.6 0 0);
|
|
56
|
-
--accent: oklch(0.7 0.22 30);
|
|
57
|
-
--accent-foreground: oklch(0.12 0 0);
|
|
58
|
-
--destructive: oklch(0.5 0.2 27);
|
|
59
|
-
--destructive-foreground: oklch(0.98 0 0);
|
|
60
|
-
--border: oklch(0.25 0 0);
|
|
61
|
-
--input: oklch(0.25 0 0);
|
|
62
|
-
--ring: oklch(0.65 0.2 250);
|
|
63
|
-
--chart-1: oklch(0.65 0.2 250);
|
|
64
|
-
--chart-2: oklch(0.7 0.22 30);
|
|
65
|
-
--chart-3: oklch(0.6 0.15 180);
|
|
66
|
-
--chart-4: oklch(0.7 0.18 320);
|
|
67
|
-
--chart-5: oklch(0.65 0.16 140);
|
|
68
|
-
--sidebar: oklch(0.15 0 0);
|
|
69
|
-
--sidebar-foreground: oklch(0.98 0 0);
|
|
70
|
-
--sidebar-primary: oklch(0.65 0.2 250);
|
|
71
|
-
--sidebar-primary-foreground: oklch(0.12 0 0);
|
|
72
|
-
--sidebar-accent: oklch(0.2 0 0);
|
|
73
|
-
--sidebar-accent-foreground: oklch(0.98 0 0);
|
|
74
|
-
--sidebar-border: oklch(0.25 0 0);
|
|
75
|
-
--sidebar-ring: oklch(0.65 0.2 250);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
@theme inline {
|
|
79
|
-
--font-sans: "Geist", "Geist Fallback";
|
|
80
|
-
--font-mono: "Geist Mono", "Geist Mono Fallback";
|
|
81
|
-
--color-background: var(--background);
|
|
82
|
-
--color-foreground: var(--foreground);
|
|
83
|
-
--color-card: var(--card);
|
|
84
|
-
--color-card-foreground: var(--card-foreground);
|
|
85
|
-
--color-popover: var(--popover);
|
|
86
|
-
--color-popover-foreground: var(--popover-foreground);
|
|
87
|
-
--color-primary: var(--primary);
|
|
88
|
-
--color-primary-foreground: var(--primary-foreground);
|
|
89
|
-
--color-secondary: var(--secondary);
|
|
90
|
-
--color-secondary-foreground: var(--secondary-foreground);
|
|
91
|
-
--color-muted: var(--muted);
|
|
92
|
-
--color-muted-foreground: var(--muted-foreground);
|
|
93
|
-
--color-accent: var(--accent);
|
|
94
|
-
--color-accent-foreground: var(--accent-foreground);
|
|
95
|
-
--color-destructive: var(--destructive);
|
|
96
|
-
--color-destructive-foreground: var(--destructive-foreground);
|
|
97
|
-
--color-border: var(--border);
|
|
98
|
-
--color-input: var(--input);
|
|
99
|
-
--color-ring: var(--ring);
|
|
100
|
-
--color-chart-1: var(--chart-1);
|
|
101
|
-
--color-chart-2: var(--chart-2);
|
|
102
|
-
--color-chart-3: var(--chart-3);
|
|
103
|
-
--color-chart-4: var(--chart-4);
|
|
104
|
-
--color-chart-5: var(--chart-5);
|
|
105
|
-
--radius-sm: calc(var(--radius) - 4px);
|
|
106
|
-
--radius-md: calc(var(--radius) - 2px);
|
|
107
|
-
--radius-lg: var(--radius);
|
|
108
|
-
--radius-xl: calc(var(--radius) + 4px);
|
|
109
|
-
--color-sidebar: var(--sidebar);
|
|
110
|
-
--color-sidebar-foreground: var(--sidebar-foreground);
|
|
111
|
-
--color-sidebar-primary: var(--sidebar-primary);
|
|
112
|
-
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
|
113
|
-
--color-sidebar-accent: var(--sidebar-accent);
|
|
114
|
-
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
|
115
|
-
--color-sidebar-border: var(--sidebar-border);
|
|
116
|
-
--color-sidebar-ring: var(--sidebar-ring);
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
@layer base {
|
|
120
|
-
* {
|
|
121
|
-
@apply border-border outline-ring/50;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
body {
|
|
125
|
-
@apply bg-background text-foreground;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
1
|
+
@import "tailwindcss";
|
|
2
|
+
@import "tw-animate-css";
|
|
3
|
+
|
|
4
|
+
@custom-variant dark (&:is(.dark *));
|
|
5
|
+
|
|
6
|
+
:root,
|
|
7
|
+
.default {
|
|
8
|
+
--background: oklch(0.99 0 0);
|
|
9
|
+
--foreground: oklch(0.15 0 0);
|
|
10
|
+
--card: oklch(1 0 0);
|
|
11
|
+
--card-foreground: oklch(0.15 0 0);
|
|
12
|
+
--popover: oklch(1 0 0);
|
|
13
|
+
--popover-foreground: oklch(0.15 0 0);
|
|
14
|
+
--primary: oklch(0.55 0.18 250);
|
|
15
|
+
--primary-foreground: oklch(0.99 0 0);
|
|
16
|
+
--secondary: oklch(0.96 0 0);
|
|
17
|
+
--secondary-foreground: oklch(0.15 0 0);
|
|
18
|
+
--muted: oklch(0.96 0.01 250);
|
|
19
|
+
--muted-foreground: oklch(0.5 0 0);
|
|
20
|
+
--accent: oklch(0.65 0.2 30);
|
|
21
|
+
--accent-foreground: oklch(0.99 0 0);
|
|
22
|
+
--destructive: oklch(0.577 0.245 27.325);
|
|
23
|
+
--destructive-foreground: oklch(0.99 0 0);
|
|
24
|
+
--border: oklch(0.9 0 0);
|
|
25
|
+
--input: oklch(0.9 0 0);
|
|
26
|
+
--ring: oklch(0.55 0.18 250);
|
|
27
|
+
--chart-1: oklch(0.55 0.18 250);
|
|
28
|
+
--chart-2: oklch(0.65 0.2 30);
|
|
29
|
+
--chart-3: oklch(0.6 0.15 180);
|
|
30
|
+
--chart-4: oklch(0.7 0.18 320);
|
|
31
|
+
--chart-5: oklch(0.65 0.16 140);
|
|
32
|
+
--radius: 0.75rem;
|
|
33
|
+
--sidebar: oklch(0.99 0 0);
|
|
34
|
+
--sidebar-foreground: oklch(0.15 0 0);
|
|
35
|
+
--sidebar-primary: oklch(0.55 0.18 250);
|
|
36
|
+
--sidebar-primary-foreground: oklch(0.99 0 0);
|
|
37
|
+
--sidebar-accent: oklch(0.96 0 0);
|
|
38
|
+
--sidebar-accent-foreground: oklch(0.15 0 0);
|
|
39
|
+
--sidebar-border: oklch(0.9 0 0);
|
|
40
|
+
--sidebar-ring: oklch(0.55 0.18 250);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.dark {
|
|
44
|
+
--background: oklch(0.12 0 0);
|
|
45
|
+
--foreground: oklch(0.98 0 0);
|
|
46
|
+
--card: oklch(0.15 0 0);
|
|
47
|
+
--card-foreground: oklch(0.98 0 0);
|
|
48
|
+
--popover: oklch(0.15 0 0);
|
|
49
|
+
--popover-foreground: oklch(0.98 0 0);
|
|
50
|
+
--primary: oklch(0.65 0.2 250);
|
|
51
|
+
--primary-foreground: oklch(0.12 0 0);
|
|
52
|
+
--secondary: oklch(0.2 0 0);
|
|
53
|
+
--secondary-foreground: oklch(0.98 0 0);
|
|
54
|
+
--muted: oklch(0.2 0.01 250);
|
|
55
|
+
--muted-foreground: oklch(0.6 0 0);
|
|
56
|
+
--accent: oklch(0.7 0.22 30);
|
|
57
|
+
--accent-foreground: oklch(0.12 0 0);
|
|
58
|
+
--destructive: oklch(0.5 0.2 27);
|
|
59
|
+
--destructive-foreground: oklch(0.98 0 0);
|
|
60
|
+
--border: oklch(0.25 0 0);
|
|
61
|
+
--input: oklch(0.25 0 0);
|
|
62
|
+
--ring: oklch(0.65 0.2 250);
|
|
63
|
+
--chart-1: oklch(0.65 0.2 250);
|
|
64
|
+
--chart-2: oklch(0.7 0.22 30);
|
|
65
|
+
--chart-3: oklch(0.6 0.15 180);
|
|
66
|
+
--chart-4: oklch(0.7 0.18 320);
|
|
67
|
+
--chart-5: oklch(0.65 0.16 140);
|
|
68
|
+
--sidebar: oklch(0.15 0 0);
|
|
69
|
+
--sidebar-foreground: oklch(0.98 0 0);
|
|
70
|
+
--sidebar-primary: oklch(0.65 0.2 250);
|
|
71
|
+
--sidebar-primary-foreground: oklch(0.12 0 0);
|
|
72
|
+
--sidebar-accent: oklch(0.2 0 0);
|
|
73
|
+
--sidebar-accent-foreground: oklch(0.98 0 0);
|
|
74
|
+
--sidebar-border: oklch(0.25 0 0);
|
|
75
|
+
--sidebar-ring: oklch(0.65 0.2 250);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
@theme inline {
|
|
79
|
+
--font-sans: "Geist", "Geist Fallback";
|
|
80
|
+
--font-mono: "Geist Mono", "Geist Mono Fallback";
|
|
81
|
+
--color-background: var(--background);
|
|
82
|
+
--color-foreground: var(--foreground);
|
|
83
|
+
--color-card: var(--card);
|
|
84
|
+
--color-card-foreground: var(--card-foreground);
|
|
85
|
+
--color-popover: var(--popover);
|
|
86
|
+
--color-popover-foreground: var(--popover-foreground);
|
|
87
|
+
--color-primary: var(--primary);
|
|
88
|
+
--color-primary-foreground: var(--primary-foreground);
|
|
89
|
+
--color-secondary: var(--secondary);
|
|
90
|
+
--color-secondary-foreground: var(--secondary-foreground);
|
|
91
|
+
--color-muted: var(--muted);
|
|
92
|
+
--color-muted-foreground: var(--muted-foreground);
|
|
93
|
+
--color-accent: var(--accent);
|
|
94
|
+
--color-accent-foreground: var(--accent-foreground);
|
|
95
|
+
--color-destructive: var(--destructive);
|
|
96
|
+
--color-destructive-foreground: var(--destructive-foreground);
|
|
97
|
+
--color-border: var(--border);
|
|
98
|
+
--color-input: var(--input);
|
|
99
|
+
--color-ring: var(--ring);
|
|
100
|
+
--color-chart-1: var(--chart-1);
|
|
101
|
+
--color-chart-2: var(--chart-2);
|
|
102
|
+
--color-chart-3: var(--chart-3);
|
|
103
|
+
--color-chart-4: var(--chart-4);
|
|
104
|
+
--color-chart-5: var(--chart-5);
|
|
105
|
+
--radius-sm: calc(var(--radius) - 4px);
|
|
106
|
+
--radius-md: calc(var(--radius) - 2px);
|
|
107
|
+
--radius-lg: var(--radius);
|
|
108
|
+
--radius-xl: calc(var(--radius) + 4px);
|
|
109
|
+
--color-sidebar: var(--sidebar);
|
|
110
|
+
--color-sidebar-foreground: var(--sidebar-foreground);
|
|
111
|
+
--color-sidebar-primary: var(--sidebar-primary);
|
|
112
|
+
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
|
113
|
+
--color-sidebar-accent: var(--sidebar-accent);
|
|
114
|
+
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
|
115
|
+
--color-sidebar-border: var(--sidebar-border);
|
|
116
|
+
--color-sidebar-ring: var(--sidebar-ring);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
@layer base {
|
|
120
|
+
* {
|
|
121
|
+
@apply border-border outline-ring/50;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
body {
|
|
125
|
+
@apply bg-background text-foreground;
|
|
126
|
+
}
|
|
127
|
+
}
|
package/template2/app/layout.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
// Root layout is a passthrough — the real <html>/<body> shell lives in
|
|
4
|
-
// app/[locale]/layout.tsx so every page is locale-scoped.
|
|
5
|
-
export default function RootLayout({ children }: { children: ReactNode }) {
|
|
6
|
-
return children;
|
|
7
|
-
}
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
// Root layout is a passthrough — the real <html>/<body> shell lives in
|
|
4
|
+
// app/[locale]/layout.tsx so every page is locale-scoped.
|
|
5
|
+
export default function RootLayout({ children }: { children: ReactNode }) {
|
|
6
|
+
return children;
|
|
7
|
+
}
|
package/template2/app/page.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { redirect } from 'next/navigation';
|
|
2
|
-
import { DEFAULT_LOCALE } from '@/config/constants';
|
|
3
|
-
|
|
4
|
-
export default function RootPage() {
|
|
5
|
-
redirect(`/${DEFAULT_LOCALE}`);
|
|
6
|
-
}
|
|
1
|
+
import { redirect } from 'next/navigation';
|
|
2
|
+
import { DEFAULT_LOCALE } from '@/config/constants';
|
|
3
|
+
|
|
4
|
+
export default function RootPage() {
|
|
5
|
+
redirect(`/${DEFAULT_LOCALE}`);
|
|
6
|
+
}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { useEffect } from 'react';
|
|
4
|
-
import { usePathname } from 'next/navigation';
|
|
5
|
-
|
|
6
|
-
// Listens for the `auth:unauthorized` event dispatched by the axios interceptor
|
|
7
|
-
// (see services/httpClient/httpClient.ts) and bounces the user to /login.
|
|
8
|
-
export function AuthEventListener() {
|
|
9
|
-
const pathname = usePathname();
|
|
10
|
-
|
|
11
|
-
useEffect(() => {
|
|
12
|
-
const locale = pathname.split('/')[1] || 'az';
|
|
13
|
-
const handler = async () => {
|
|
14
|
-
await fetch('/api/clear-session', { method: 'POST' }).catch(() => {});
|
|
15
|
-
window.location.href = `/${locale}/login`;
|
|
16
|
-
};
|
|
17
|
-
window.addEventListener('auth:unauthorized', handler);
|
|
18
|
-
return () => window.removeEventListener('auth:unauthorized', handler);
|
|
19
|
-
}, [pathname]);
|
|
20
|
-
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useEffect } from 'react';
|
|
4
|
+
import { usePathname } from 'next/navigation';
|
|
5
|
+
|
|
6
|
+
// Listens for the `auth:unauthorized` event dispatched by the axios interceptor
|
|
7
|
+
// (see services/httpClient/httpClient.ts) and bounces the user to /login.
|
|
8
|
+
export function AuthEventListener() {
|
|
9
|
+
const pathname = usePathname();
|
|
10
|
+
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
const locale = pathname.split('/')[1] || 'az';
|
|
13
|
+
const handler = async () => {
|
|
14
|
+
await fetch('/api/clear-session', { method: 'POST' }).catch(() => {});
|
|
15
|
+
window.location.href = `/${locale}/login`;
|
|
16
|
+
};
|
|
17
|
+
window.addEventListener('auth:unauthorized', handler);
|
|
18
|
+
return () => window.removeEventListener('auth:unauthorized', handler);
|
|
19
|
+
}, [pathname]);
|
|
20
|
+
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
const links = [
|
|
2
|
-
{ label: 'GitHub', href: 'https://github.com/javidselimov' },
|
|
3
|
-
{ label: 'LinkedIn', href: 'https://www.linkedin.com/in/javidsalim/' },
|
|
4
|
-
{ label: 'npm', href: 'https://www.npmjs.com/~ubuligan' },
|
|
5
|
-
];
|
|
6
|
-
|
|
7
|
-
export function AuthorCredit() {
|
|
8
|
-
return (
|
|
9
|
-
<div className="fixed bottom-4 right-4 z-50 flex items-center gap-3 rounded-full border bg-background/80 px-4 py-2 text-sm shadow-lg backdrop-blur">
|
|
10
|
-
<span className="font-medium">Javid Salimov</span>
|
|
11
|
-
<span className="text-muted-foreground">·</span>
|
|
12
|
-
{links.map((l) => (
|
|
13
|
-
<a
|
|
14
|
-
key={l.label}
|
|
15
|
-
href={l.href}
|
|
16
|
-
target="_blank"
|
|
17
|
-
rel="noreferrer"
|
|
18
|
-
className="text-muted-foreground transition-colors hover:text-foreground"
|
|
19
|
-
>
|
|
20
|
-
{l.label}
|
|
21
|
-
</a>
|
|
22
|
-
))}
|
|
23
|
-
</div>
|
|
24
|
-
);
|
|
25
|
-
}
|
|
1
|
+
const links = [
|
|
2
|
+
{ label: 'GitHub', href: 'https://github.com/javidselimov' },
|
|
3
|
+
{ label: 'LinkedIn', href: 'https://www.linkedin.com/in/javidsalim/' },
|
|
4
|
+
{ label: 'npm', href: 'https://www.npmjs.com/~ubuligan' },
|
|
5
|
+
];
|
|
6
|
+
|
|
7
|
+
export function AuthorCredit() {
|
|
8
|
+
return (
|
|
9
|
+
<div className="fixed bottom-4 right-4 z-50 flex items-center gap-3 rounded-full border bg-background/80 px-4 py-2 text-sm shadow-lg backdrop-blur">
|
|
10
|
+
<span className="font-medium">Javid Salimov</span>
|
|
11
|
+
<span className="text-muted-foreground">·</span>
|
|
12
|
+
{links.map((l) => (
|
|
13
|
+
<a
|
|
14
|
+
key={l.label}
|
|
15
|
+
href={l.href}
|
|
16
|
+
target="_blank"
|
|
17
|
+
rel="noreferrer"
|
|
18
|
+
className="text-muted-foreground transition-colors hover:text-foreground"
|
|
19
|
+
>
|
|
20
|
+
{l.label}
|
|
21
|
+
</a>
|
|
22
|
+
))}
|
|
23
|
+
</div>
|
|
24
|
+
);
|
|
25
|
+
}
|