File tree Expand file tree Collapse file tree 7 files changed +43
-35
lines changed Expand file tree Collapse file tree 7 files changed +43
-35
lines changed Original file line number Diff line number Diff line change 11<script setup lang="ts">
2- import { Github , BookOpenText } from ' lucide-vue-next' ;
2+ import { BookOpenText , FolderGit2 , LayoutDashboard } from ' lucide-vue-next' ;
33import NavMain from ' @/components/NavMain.vue' ;
44import NavFooter from ' @/components/NavFooter.vue' ;
55import NavUser from ' @/components/NavUser.vue' ;
6+ import { type NavItemType } from ' @/types'
67import {
78 Sidebar ,
89 SidebarContent ,
@@ -14,17 +15,19 @@ import {
1415} from ' @/components/ui/sidebar' ;
1516import ApplicationLogo from ' ./ApplicationLogo.vue' ;
1617
17- interface NavItem {
18- title: string ;
19- url: string ;
20- icon: any ; // Using any for now since Vue's type system handles components differently
21- }
18+ const mainNavItems: NavItemType [] = [
19+ {
20+ title: " Dashboard" ,
21+ url: " /dashboard" ,
22+ icon: LayoutDashboard ,
23+ },
24+ ]
2225
23- const footerNavItems: NavItem [] = [
26+ const footerNavItems: NavItemType [] = [
2427 {
2528 title: ' Github Repo' ,
2629 url: ' https://github.com/laravel/vue-starter-kit' ,
27- icon: Github ,
30+ icon: FolderGit2 ,
2831 },
2932 {
3033 title: ' Documentation' ,
@@ -55,7 +58,7 @@ const footerNavItems: NavItem[] = [
5558 </SidebarHeader >
5659
5760 <SidebarContent >
58- <NavMain />
61+ <NavMain :items = " mainNavItems " />
5962 </SidebarContent >
6063
6164 <SidebarFooter >
Original file line number Diff line number Diff line change 11<script setup lang="ts">
2- import { LayoutDashboard , type LucideIcon } from ' lucide-vue-next ' ;
3- import { Link } from ' @inertiajs/vue3 ' ;
2+ import { Link , usePage } from ' @inertiajs/vue3 ' ;
3+ import { type NavItemType } from ' @/types '
44import {
55 SidebarGroup ,
66 SidebarMenu ,
7- SidebarMenuButton ,
87 SidebarMenuItem ,
8+ SidebarMenuButton ,
99} from ' @/components/ui/sidebar' ;
1010
11- interface NavItem {
12- title: string ;
13- url: string ;
14- icon: any ; // Using any for now since Vue's type system handles components differently
15- isActive? : boolean ;
16- }
17-
1811interface Props {
19- items? : NavItem [];
12+ items? : NavItemType [];
2013}
2114
15+ const page = usePage ();
16+
2217withDefaults (defineProps <Props >(), {
2318 items : () => [],
2419});
@@ -27,16 +22,8 @@ withDefaults(defineProps<Props>(), {
2722<template >
2823 <SidebarGroup >
2924 <SidebarMenu >
30- <SidebarMenuItem >
31- <SidebarMenuButton as-child :is-active =" true" >
32- <Link :href =" route('dashboard')" >
33- <LayoutDashboard />
34- <span >Dashboard</span >
35- </Link >
36- </SidebarMenuButton >
37- </SidebarMenuItem >
3825 <SidebarMenuItem v-for =" item in items" :key =" item.title" >
39- <SidebarMenuButton as-child :is-active =" item.isActive " >
26+ <SidebarMenuButton as-child :is-active =" item.url === page.url " >
4027 <Link :href =" item.url" >
4128 <component :is =" item.icon" />
4229 <span >{{ item.title }}</span >
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ defineProps<Props>()
1212<template >
1313 <div >
1414 <header >
15- <h3 class =" text-lg font-medium" >{{ title }}</h3 >
15+ <h3 class =" text-lg font-medium mb-1 " >{{ title }}</h3 >
1616 <p v-if =" description" class =" text-sm text-muted-foreground" >
1717 {{ description }}
1818 </p >
Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ const submit = () => {
3939 id =" email"
4040 type =" email"
4141 name =" email"
42+ autocomplete =" off"
4243 v-model =" form.email"
4344 autofocus
4445 />
Original file line number Diff line number Diff line change @@ -46,6 +46,8 @@ const submit = () => {
4646 type =" email"
4747 required
4848 autofocus
49+ tabindex =" 1"
50+ autocomplete =" email"
4951 v-model =" form.email"
5052 />
5153 <InputError :message =" form.errors.email" />
@@ -58,6 +60,7 @@ const submit = () => {
5860 v-if =" canResetPassword"
5961 :href =" route('password.request')"
6062 class =" text-sm underline-offset-4 hover:underline"
63+ tabindex =" 5"
6164 >
6265 Forgot your password?
6366 </Link >
@@ -66,14 +69,17 @@ const submit = () => {
6669 id =" password"
6770 type =" password"
6871 required
72+ tabindex =" 2"
73+ autocomplete =" current-password"
6974 v-model =" form.password"
7075 />
7176 <InputError :message =" form.errors.password" />
7277 </div >
7378
7479 <Button
7580 type =" submit"
76- class =" w-full"
81+ class =" w-full"
82+ tabindex =" 3"
7783 :disabled =" form.processing"
7884 >
7985 <LoaderCircle v-if =" form.processing" class =" h-4 w-4 animate-spin" />
@@ -88,6 +94,7 @@ const submit = () => {
8894 <Link
8995 :href =" route('register')"
9096 class =" underline underline-offset-4"
97+ tabindex =" 4"
9198 >
9299 Sign up
93100 </Link >
Original file line number Diff line number Diff line change @@ -38,6 +38,8 @@ const submit = () => {
3838 type =" text"
3939 required
4040 autofocus
41+ tabindex =" 1"
42+ autocomplete =" name"
4143 v-model =" form.name"
4244 />
4345 <InputError :message =" form.errors.name" />
@@ -49,6 +51,8 @@ const submit = () => {
4951 id =" email"
5052 type =" email"
5153 required
54+ tabindex =" 2"
55+ autocomplete =" email"
5256 v-model =" form.email"
5357 />
5458 <InputError :message =" form.errors.email" />
@@ -60,6 +64,8 @@ const submit = () => {
6064 id =" password"
6165 type =" password"
6266 required
67+ tabindex =" 3"
68+ autocomplete =" new-password"
6369 v-model =" form.password"
6470 />
6571 <InputError :message =" form.errors.password" />
@@ -71,14 +77,17 @@ const submit = () => {
7177 id =" password_confirmation"
7278 type =" password"
7379 required
80+ tabindex =" 4"
81+ autocomplete =" new-password"
7482 v-model =" form.password_confirmation"
7583 />
7684 <InputError :message =" form.errors.password_confirmation" />
7785 </div >
7886
7987 <Button
8088 type =" submit"
81- class =" w-full"
89+ class =" w-full"
90+ tabindex =" 5"
8291 :disabled =" form.processing"
8392 >
8493 <LoaderCircle v-if =" form.processing" class =" h-4 w-4 animate-spin" />
@@ -93,6 +102,7 @@ const submit = () => {
93102 <Link
94103 :href =" route('login')"
95104 class =" underline underline-offset-4"
105+ tabindex =" 6"
96106 >
97107 Log in
98108 </Link >
Original file line number Diff line number Diff line change @@ -45,9 +45,9 @@ const submit = () => {
4545 id =" email"
4646 type =" email"
4747 name =" email"
48+ autocomplete =" email"
4849 v-model =" form.email"
4950 class =" mt-1 block w-full"
50- autocomplete =" username"
5151 readonly
5252 />
5353 <InputError :message =" form.errors.email" class =" mt-2" />
@@ -59,9 +59,9 @@ const submit = () => {
5959 id =" password"
6060 type =" password"
6161 name =" password"
62+ autocomplete =" new-password"
6263 v-model =" form.password"
6364 class =" mt-1 block w-full"
64- autocomplete =" new-password"
6565 autofocus
6666 />
6767 <InputError :message =" form.errors.password" class =" mt-2" />
@@ -75,9 +75,9 @@ const submit = () => {
7575 id =" password_confirmation"
7676 type =" password"
7777 name =" password_confirmation"
78+ autocomplete =" new-password"
7879 v-model =" form.password_confirmation"
7980 class =" mt-1 block w-full"
80- autocomplete =" new-password"
8181 />
8282 <InputError :message =" form.errors.password_confirmation" class =" mt-2" />
8383 </div >
You can’t perform that action at this time.
0 commit comments