feat: initial commit

This commit is contained in:
phaichayon
2026-04-17 09:51:52 +07:00
parent ba1ffed211
commit 0dcbb98f4c
10 changed files with 3052 additions and 71 deletions

View File

@@ -6,10 +6,12 @@
@import './theme.css';
@import "tw-animate-css";
@import "shadcn/tailwind.css";
:root {
--radius: 0.625rem;
--background: oklch(1 0 0);
--foreground: oklch(0.145 0 0);
--card: oklch(1 0 0);
--card-foreground: oklch(0.145 0 0);
--popover: oklch(1 0 0);
@@ -26,11 +28,11 @@
--border: oklch(0.922 0 0);
--input: oklch(0.922 0 0);
--ring: oklch(0.708 0 0);
--chart-1: oklch(0.646 0.222 41.116);
--chart-2: oklch(0.6 0.118 184.704);
--chart-3: oklch(0.398 0.07 227.392);
--chart-4: oklch(0.828 0.189 84.429);
--chart-5: oklch(0.769 0.188 70.08);
--chart-1: oklch(0.87 0 0);
--chart-2: oklch(0.556 0 0);
--chart-3: oklch(0.439 0 0);
--chart-4: oklch(0.371 0 0);
--chart-5: oklch(0.269 0 0);
--sidebar: oklch(0.985 0 0);
--sidebar-foreground: oklch(0.145 0 0);
--sidebar-primary: oklch(0.205 0 0);
@@ -39,6 +41,8 @@
--sidebar-accent-foreground: oklch(0.205 0 0);
--sidebar-border: oklch(0.922 0 0);
--sidebar-ring: oklch(0.708 0 0);
--background: oklch(1 0 0);
--foreground: oklch(0.145 0 0);
}
.dark {
@@ -46,7 +50,7 @@
--foreground: oklch(0.985 0 0);
--card: oklch(0.205 0 0);
--card-foreground: oklch(0.985 0 0);
--popover: oklch(0.269 0 0);
--popover: oklch(0.205 0 0);
--popover-foreground: oklch(0.985 0 0);
--primary: oklch(0.922 0 0);
--primary-foreground: oklch(0.205 0 0);
@@ -54,17 +58,17 @@
--secondary-foreground: oklch(0.985 0 0);
--muted: oklch(0.269 0 0);
--muted-foreground: oklch(0.708 0 0);
--accent: oklch(0.371 0 0);
--accent: oklch(0.269 0 0);
--accent-foreground: oklch(0.985 0 0);
--destructive: oklch(0.704 0.191 22.216);
--border: oklch(1 0 0 / 10%);
--input: oklch(1 0 0 / 15%);
--ring: oklch(0.556 0 0);
--chart-1: oklch(0.488 0.243 264.376);
--chart-2: oklch(0.696 0.17 162.48);
--chart-3: oklch(0.769 0.188 70.08);
--chart-4: oklch(0.627 0.265 303.9);
--chart-5: oklch(0.645 0.246 16.439);
--chart-1: oklch(0.87 0 0);
--chart-2: oklch(0.556 0 0);
--chart-3: oklch(0.439 0 0);
--chart-4: oklch(0.371 0 0);
--chart-5: oklch(0.269 0 0);
--sidebar: oklch(0.205 0 0);
--sidebar-foreground: oklch(0.985 0 0);
--sidebar-primary: oklch(0.488 0.243 264.376);
@@ -72,7 +76,7 @@
--sidebar-accent: oklch(0.269 0 0);
--sidebar-accent-foreground: oklch(0.985 0 0);
--sidebar-border: oklch(1 0 0 / 10%);
--sidebar-ring: oklch(0.439 0 0);
--sidebar-ring: oklch(0.556 0 0);
}
@theme inline {
@@ -111,6 +115,11 @@
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
--color-sidebar-border: var(--sidebar-border);
--color-sidebar-ring: var(--sidebar-ring);
--font-heading: var(--font-sans);
--font-sans: var(--font-sans);
--radius-2xl: calc(var(--radius) * 1.8);
--radius-3xl: calc(var(--radius) * 2.2);
--radius-4xl: calc(var(--radius) * 2.6);
}
@layer base {
@@ -120,6 +129,9 @@
body {
@apply bg-background text-foreground;
}
html {
@apply font-sans;
}
}
/* View Transition Wave Effect */
@@ -155,4 +167,4 @@
::view-transition-new(root) {
/* Apply the reveal animation */
animation: reveal 0.4s ease-in-out forwards;
}
}

View File

@@ -9,6 +9,9 @@ import NextTopLoader from 'nextjs-toploader';
import { NuqsAdapter } from 'nuqs/adapters/next/app';
import './globals.css';
import './theme.css';
import { Inter } from "next/font/google";
const inter = Inter({subsets:['latin'],variable:'--font-sans'});
const META_THEME_COLORS = {
light: '#ffffff',
@@ -34,7 +37,7 @@ export default async function RootLayout({
const isScaled = activeThemeValue?.endsWith('-scaled');
return (
<html lang='en' suppressHydrationWarning>
<html lang='en' suppressHydrationWarning className={cn("font-sans", inter.variable)}>
<head>
<script
dangerouslySetInnerHTML={{

View File

@@ -1,26 +1,6 @@
import { type ClassValue, clsx } from "clsx";
import { twMerge } from "tailwind-merge";
import { clsx, type ClassValue } from "clsx"
import { twMerge } from "tailwind-merge"
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}
export function formatBytes(
bytes: number,
opts: {
decimals?: number;
sizeType?: "accurate" | "normal";
} = {},
) {
const { decimals = 0, sizeType = "normal" } = opts;
const sizes = ["Bytes", "KB", "MB", "GB", "TB"];
const accurateSizes = ["Bytes", "KiB", "MiB", "GiB", "TiB"];
if (bytes === 0) return "0 Byte";
const i = Math.floor(Math.log(bytes) / Math.log(1024));
return `${(bytes / Math.pow(1024, i)).toFixed(decimals)} ${
sizeType === "accurate"
? (accurateSizes[i] ?? "Bytest")
: (sizes[i] ?? "Bytes")
}`;
return twMerge(clsx(inputs))
}

View File

@@ -1,8 +1,8 @@
import type { DataTableConfig } from '@/config/data-table';
import type { FilterItemSchema } from '@/lib/parsers';
import type { ColumnSort, Row, RowData } from '@tanstack/react-table';
import type { DataTableConfig } from "@/config/data-table";
import type { FilterItemSchema } from "@/lib/parsers";
import type { ColumnSort, Row, RowData } from "@tanstack/react-table";
declare module '@tanstack/react-table' {
declare module "@tanstack/react-table" {
// biome-ignore lint/correctness/noUnusedVariables: Interface type parameters required by @tanstack/react-table
interface ColumnMeta<TData extends RowData, TValue> {
label?: string;
@@ -22,11 +22,11 @@ export interface Option {
icon?: React.FC<React.SVGProps<SVGSVGElement>>;
}
export type FilterOperator = DataTableConfig['operators'][number];
export type FilterVariant = DataTableConfig['filterVariants'][number];
export type JoinOperator = DataTableConfig['joinOperators'][number];
export type FilterOperator = DataTableConfig["operators"][number];
export type FilterVariant = DataTableConfig["filterVariants"][number];
export type JoinOperator = DataTableConfig["joinOperators"][number];
export interface ExtendedColumnSort<TData> extends Omit<ColumnSort, 'id'> {
export interface ExtendedColumnSort<TData> extends Omit<ColumnSort, "id"> {
id: Extract<keyof TData, string>;
}
@@ -36,5 +36,5 @@ export interface ExtendedColumnFilter<TData> extends FilterItemSchema {
export interface DataTableRowAction<TData> {
row: Row<TData>;
variant: 'update' | 'delete';
variant: "update" | "delete";
}