+
diff --git a/resources/js/components/ui/field/index.ts b/resources/js/components/ui/field/index.ts
new file mode 100644
index 0000000..162ba14
--- /dev/null
+++ b/resources/js/components/ui/field/index.ts
@@ -0,0 +1,39 @@
+import type { VariantProps } from "class-variance-authority"
+import { cva } from "class-variance-authority"
+
+export const fieldVariants = cva(
+ "group/field flex w-full gap-3 data-[invalid=true]:text-destructive",
+ {
+ variants: {
+ orientation: {
+ vertical: ["flex-col [&>*]:w-full [&>.sr-only]:w-auto"],
+ horizontal: [
+ "flex-row items-center",
+ "[&>[data-slot=field-label]]:flex-auto",
+ "has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
+ ],
+ responsive: [
+ "flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto",
+ "@md/field-group:[&>[data-slot=field-label]]:flex-auto",
+ "@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
+ ],
+ },
+ },
+ defaultVariants: {
+ orientation: "vertical",
+ },
+ },
+)
+
+export type FieldVariants = VariantProps
+
+export { default as Field } from "./Field.vue"
+export { default as FieldContent } from "./FieldContent.vue"
+export { default as FieldDescription } from "./FieldDescription.vue"
+export { default as FieldError } from "./FieldError.vue"
+export { default as FieldGroup } from "./FieldGroup.vue"
+export { default as FieldLabel } from "./FieldLabel.vue"
+export { default as FieldLegend } from "./FieldLegend.vue"
+export { default as FieldSeparator } from "./FieldSeparator.vue"
+export { default as FieldSet } from "./FieldSet.vue"
+export { default as FieldTitle } from "./FieldTitle.vue"
diff --git a/resources/js/components/ui/input/Input.vue b/resources/js/components/ui/input/Input.vue
new file mode 100644
index 0000000..39c101b
--- /dev/null
+++ b/resources/js/components/ui/input/Input.vue
@@ -0,0 +1,29 @@
+
+
+
+
+
diff --git a/resources/js/components/ui/input/index.ts b/resources/js/components/ui/input/index.ts
new file mode 100644
index 0000000..9976b86
--- /dev/null
+++ b/resources/js/components/ui/input/index.ts
@@ -0,0 +1 @@
+export { default as Input } from "./Input.vue"
diff --git a/resources/js/components/ui/label/Label.vue b/resources/js/components/ui/label/Label.vue
new file mode 100644
index 0000000..ee63970
--- /dev/null
+++ b/resources/js/components/ui/label/Label.vue
@@ -0,0 +1,26 @@
+
+
+
+
+
diff --git a/resources/js/components/ui/label/index.ts b/resources/js/components/ui/label/index.ts
new file mode 100644
index 0000000..036e35c
--- /dev/null
+++ b/resources/js/components/ui/label/index.ts
@@ -0,0 +1 @@
+export { default as Label } from "./Label.vue"
diff --git a/resources/js/components/ui/separator/Separator.vue b/resources/js/components/ui/separator/Separator.vue
new file mode 100644
index 0000000..78d60ec
--- /dev/null
+++ b/resources/js/components/ui/separator/Separator.vue
@@ -0,0 +1,29 @@
+
+
+
+
+
diff --git a/resources/js/components/ui/separator/index.ts b/resources/js/components/ui/separator/index.ts
new file mode 100644
index 0000000..4407287
--- /dev/null
+++ b/resources/js/components/ui/separator/index.ts
@@ -0,0 +1 @@
+export { default as Separator } from "./Separator.vue"
diff --git a/resources/js/components/ui/sonner/Sonner.vue b/resources/js/components/ui/sonner/Sonner.vue
new file mode 100644
index 0000000..36d2951
--- /dev/null
+++ b/resources/js/components/ui/sonner/Sonner.vue
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/resources/js/components/ui/sonner/index.ts b/resources/js/components/ui/sonner/index.ts
new file mode 100644
index 0000000..6673112
--- /dev/null
+++ b/resources/js/components/ui/sonner/index.ts
@@ -0,0 +1 @@
+export { default as Toaster } from "./Sonner.vue"
diff --git a/resources/js/composables/useFlashToast.ts b/resources/js/composables/useFlashToast.ts
new file mode 100644
index 0000000..3eb90ab
--- /dev/null
+++ b/resources/js/composables/useFlashToast.ts
@@ -0,0 +1,27 @@
+import { router } from '@inertiajs/vue3';
+import { toast } from 'vue-sonner';
+
+type Flash = {
+ success?: string | null;
+ error?: string | null;
+};
+
+function showFlash(flash: Flash): void {
+ if (flash.success) {
+ toast.success(flash.success);
+ }
+
+ if (flash.error) {
+ toast.error(flash.error);
+ }
+}
+
+export function useFlashToast(): void {
+ router.on('success', (event) => {
+ const flash = event.detail.page.props.flash as Flash | undefined;
+
+ if (flash) {
+ showFlash(flash);
+ }
+ });
+}
diff --git a/resources/js/lib/new-york-v4/lib/utils.ts b/resources/js/lib/new-york-v4/lib/utils.ts
new file mode 100644
index 0000000..c66a9d9
--- /dev/null
+++ b/resources/js/lib/new-york-v4/lib/utils.ts
@@ -0,0 +1,7 @@
+import type { ClassValue } from "clsx"
+import { clsx } from "clsx"
+import { twMerge } from "tailwind-merge"
+
+export function cn(...inputs: ClassValue[]) {
+ return twMerge(clsx(inputs))
+}
diff --git a/resources/js/pages/auth/Login.vue b/resources/js/pages/auth/Login.vue
new file mode 100644
index 0000000..4ebbb06
--- /dev/null
+++ b/resources/js/pages/auth/Login.vue
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/resources/js/types/auth.ts b/resources/js/types/auth.ts
index f9a7fa4..f72009c 100644
--- a/resources/js/types/auth.ts
+++ b/resources/js/types/auth.ts
@@ -1,9 +1,9 @@
export type User = {
id: number;
- name: string;
email: string;
- avatar?: string;
- email_verified_at: string | null;
+ username: string;
+ is_active: boolean;
+ last_login_at: string | null;
created_at: string;
updated_at: string;
[key: string]: unknown;
diff --git a/resources/js/types/global.d.ts b/resources/js/types/global.d.ts
index a53aee2..1bfc830 100644
--- a/resources/js/types/global.d.ts
+++ b/resources/js/types/global.d.ts
@@ -18,6 +18,10 @@ declare module '@inertiajs/core' {
sharedPageProps: {
name: string;
auth: Auth;
+ flash: {
+ success: string | null;
+ error: string | null;
+ };
sidebarOpen: boolean;
[key: string]: unknown;
};
diff --git a/routes/web.php b/routes/web.php
index 8c10e0a..6dc73ea 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -1,5 +1,11 @@
name('home');
+
+Route::middleware('guest')->group(function () {
+ Route::get('/auth/login', [LoginController::class, 'index'])->name('login');
+ Route::post('/auth/login', [LoginController::class, 'store']);
+});
diff --git a/tsconfig.json b/tsconfig.json
index cab1dcd..32ad463 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -1,7 +1,6 @@
{
"compilerOptions": {
/* Visit https://aka.ms/tsconfig to read more about this file */
-
/* Projects */
// "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
@@ -9,7 +8,6 @@
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
-
/* Language and Environment */
"target": "ESNext" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
"useDefineForClassFields": true,
@@ -27,14 +25,15 @@
// "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
-
/* Modules */
"module": "ESNext" /* Specify what module code is generated. */,
// "rootDir": "./", /* Specify the root folder within your source files. */
"moduleResolution": "bundler" /* Specify how TypeScript looks up a file from a given module specifier. */,
- // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
+ "baseUrl": ".",
"paths": {
- /* Specify a set of entries that re-map imports to additional lookup locations. */ "@/*": ["./resources/js/*"],
+ "@/*": [
+ "resources/js/*"
+ ]
},
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
@@ -52,12 +51,10 @@
"resolveJsonModule": true /* Enable importing .json files. */,
// "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
// "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */
-
/* JavaScript Support */
"allowJs": true /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */,
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
-
/* Emit */
// "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
@@ -80,7 +77,6 @@
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
-
/* Interop Constraints */
"isolatedModules": true /* Ensure that each file can be safely transpiled without relying on other imports. */,
// "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
@@ -89,7 +85,6 @@
"esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
-
/* Type Checking */
"strict": true /* Enable all strict type-checking options. */,
// "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
@@ -111,7 +106,6 @@
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
-
/* Completeness */
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
"skipLibCheck": true /* Skip type checking all .d.ts files. */
@@ -119,7 +113,7 @@
"include": [
"resources/js/**/*.ts",
"resources/js/**/*.d.ts",
- "resources/js/**/*.tsx",
+ "resources/js/**/*.tsx",
"resources/js/**/*.vue"
]
}