Skip to content

Commit 2d581a0

Browse files
General improvements (#305)
Co-authored-by: WendellAdriel <11641518+WendellAdriel@users.noreply.github.com> Co-authored-by: WendellAdriel <me@wendelladriel.com>
1 parent 68d226b commit 2d581a0

30 files changed

+345
-37
lines changed

resources/js/app.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { resolvePageComponent } from 'laravel-vite-plugin/inertia-helpers';
33
import type { DefineComponent } from 'vue';
44
import { createApp, h } from 'vue';
55
import '../css/app.css';
6-
import { initializeTheme } from './composables/useAppearance';
6+
import { initializeTheme } from '@/composables/useAppearance';
77

88
const appName = import.meta.env.VITE_APP_NAME || 'Laravel';
99

resources/js/components/AppHeader.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ const rightNavItems: NavItem[] = [
9393
</SheetTrigger>
9494
<SheetContent side="left" class="w-[300px] p-6">
9595
<SheetTitle class="sr-only"
96-
>Navigation Menu</SheetTitle
96+
>Navigation menu</SheetTitle
9797
>
9898
<SheetHeader class="flex justify-start text-left">
9999
<AppLogoIcon

resources/js/components/AppSidebar.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<script setup lang="ts">
22
import { Link } from '@inertiajs/vue3';
3-
import { BookOpen, Folder, LayoutGrid } from 'lucide-vue-next';
3+
import { BookOpen, FolderGit2, LayoutGrid } from 'lucide-vue-next';
4+
import AppLogo from '@/components/AppLogo.vue';
45
import NavFooter from '@/components/NavFooter.vue';
56
import NavMain from '@/components/NavMain.vue';
67
import NavUser from '@/components/NavUser.vue';
@@ -14,7 +15,6 @@ import {
1415
SidebarMenuItem,
1516
} from '@/components/ui/sidebar';
1617
import type { NavItem } from '@/types';
17-
import AppLogo from './AppLogo.vue';
1818
import { dashboard } from '@/routes';
1919
2020
const mainNavItems: NavItem[] = [
@@ -27,9 +27,9 @@ const mainNavItems: NavItem[] = [
2727
2828
const footerNavItems: NavItem[] = [
2929
{
30-
title: 'Github Repo',
30+
title: 'Repository',
3131
href: 'https://github.com/laravel/vue-starter-kit',
32-
icon: Folder,
32+
icon: FolderGit2,
3333
},
3434
{
3535
title: 'Documentation',

resources/js/components/NavUser.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
useSidebar,
1515
} from '@/components/ui/sidebar';
1616
import UserInfo from '@/components/UserInfo.vue';
17-
import UserMenuContent from './UserMenuContent.vue';
17+
import UserMenuContent from '@/components/UserMenuContent.vue';
1818
1919
const page = usePage();
2020
const user = computed(() => page.props.auth.user);

resources/js/components/TwoFactorRecoveryCodes.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ onMounted(async () => {
4242
<Card class="w-full">
4343
<CardHeader>
4444
<CardTitle class="flex gap-3">
45-
<LockKeyhole class="size-4" />2FA Recovery Codes
45+
<LockKeyhole class="size-4" />2FA recovery codes
4646
</CardTitle>
4747
<CardDescription>
4848
Recovery codes let you regain access if you lose your 2FA
@@ -58,8 +58,8 @@ onMounted(async () => {
5858
:is="isRecoveryCodesVisible ? EyeOff : Eye"
5959
class="size-4"
6060
/>
61-
{{ isRecoveryCodesVisible ? 'Hide' : 'View' }} Recovery
62-
Codes
61+
{{ isRecoveryCodesVisible ? 'Hide' : 'View' }} recovery
62+
codes
6363
</Button>
6464

6565
<Form
@@ -75,7 +75,7 @@ onMounted(async () => {
7575
type="submit"
7676
:disabled="processing"
7777
>
78-
<RefreshCw /> Regenerate Codes
78+
<RefreshCw /> Regenerate codes
7979
</Button>
8080
</Form>
8181
</div>
@@ -114,7 +114,7 @@ onMounted(async () => {
114114
Each recovery code can be used once to access your
115115
account and will be removed after use. If you need more,
116116
click
117-
<span class="font-bold">Regenerate Codes</span> above.
117+
<span class="font-bold">Regenerate codes</span> above.
118118
</p>
119119
</div>
120120
</div>

resources/js/components/TwoFactorSetupModal.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const pinInputContainerRef = useTemplateRef('pinInputContainerRef');
4646
const modalConfig = computed<TwoFactorConfigContent>(() => {
4747
if (props.twoFactorEnabled) {
4848
return {
49-
title: 'Two-Factor Authentication Enabled',
49+
title: 'Two-factor authentication enabled',
5050
description:
5151
'Two-factor authentication is now enabled. Scan the QR code or enter the setup key in your authenticator app.',
5252
buttonText: 'Close',
@@ -55,14 +55,14 @@ const modalConfig = computed<TwoFactorConfigContent>(() => {
5555
5656
if (showVerificationStep.value) {
5757
return {
58-
title: 'Verify Authentication Code',
58+
title: 'Verify authentication code',
5959
description: 'Enter the 6-digit code from your authenticator app',
6060
buttonText: 'Continue',
6161
};
6262
}
6363
6464
return {
65-
title: 'Enable Two-Factor Authentication',
65+
title: 'Enable two-factor authentication',
6666
description:
6767
'To finish enabling two-factor authentication, scan the QR code or enter the setup key in your authenticator app',
6868
buttonText: 'Continue',
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<script setup lang="ts">
2+
import type { SelectRootEmits, SelectRootProps } from "reka-ui"
3+
import { SelectRoot, useForwardPropsEmits } from "reka-ui"
4+
5+
const props = defineProps<SelectRootProps>()
6+
const emits = defineEmits<SelectRootEmits>()
7+
8+
const forwarded = useForwardPropsEmits(props, emits)
9+
</script>
10+
11+
<template>
12+
<SelectRoot
13+
v-slot="slotProps"
14+
data-slot="select"
15+
v-bind="forwarded"
16+
>
17+
<slot v-bind="slotProps" />
18+
</SelectRoot>
19+
</template>
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<script setup lang="ts">
2+
import type { SelectContentEmits, SelectContentProps } from "reka-ui"
3+
import type { HTMLAttributes } from "vue"
4+
import { reactiveOmit } from "@vueuse/core"
5+
import {
6+
SelectContent,
7+
SelectPortal,
8+
SelectViewport,
9+
useForwardPropsEmits,
10+
} from "reka-ui"
11+
import { cn } from "@/lib/utils"
12+
import { SelectScrollDownButton, SelectScrollUpButton } from "."
13+
14+
defineOptions({
15+
inheritAttrs: false,
16+
})
17+
18+
const props = withDefaults(
19+
defineProps<SelectContentProps & { class?: HTMLAttributes["class"] }>(),
20+
{
21+
position: "popper",
22+
},
23+
)
24+
const emits = defineEmits<SelectContentEmits>()
25+
26+
const delegatedProps = reactiveOmit(props, "class")
27+
28+
const forwarded = useForwardPropsEmits(delegatedProps, emits)
29+
</script>
30+
31+
<template>
32+
<SelectPortal>
33+
<SelectContent
34+
data-slot="select-content"
35+
v-bind="{ ...$attrs, ...forwarded }"
36+
:class="cn(
37+
'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--reka-select-content-available-height) min-w-[8rem] overflow-x-hidden overflow-y-auto rounded-md border shadow-md',
38+
position === 'popper'
39+
&& 'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',
40+
props.class,
41+
)
42+
"
43+
>
44+
<SelectScrollUpButton />
45+
<SelectViewport :class="cn('p-1', position === 'popper' && 'h-[var(--reka-select-trigger-height)] w-full min-w-[var(--reka-select-trigger-width)] scroll-my-1')">
46+
<slot />
47+
</SelectViewport>
48+
<SelectScrollDownButton />
49+
</SelectContent>
50+
</SelectPortal>
51+
</template>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<script setup lang="ts">
2+
import type { SelectGroupProps } from "reka-ui"
3+
import { SelectGroup } from "reka-ui"
4+
5+
const props = defineProps<SelectGroupProps>()
6+
</script>
7+
8+
<template>
9+
<SelectGroup
10+
data-slot="select-group"
11+
v-bind="props"
12+
>
13+
<slot />
14+
</SelectGroup>
15+
</template>
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<script setup lang="ts">
2+
import type { SelectItemProps } from "reka-ui"
3+
import type { HTMLAttributes } from "vue"
4+
import { reactiveOmit } from "@vueuse/core"
5+
import { Check } from "lucide-vue-next"
6+
import {
7+
SelectItem,
8+
SelectItemIndicator,
9+
SelectItemText,
10+
useForwardProps,
11+
} from "reka-ui"
12+
import { cn } from "@/lib/utils"
13+
14+
const props = defineProps<SelectItemProps & { class?: HTMLAttributes["class"] }>()
15+
16+
const delegatedProps = reactiveOmit(props, "class")
17+
18+
const forwardedProps = useForwardProps(delegatedProps)
19+
</script>
20+
21+
<template>
22+
<SelectItem
23+
data-slot="select-item"
24+
v-bind="forwardedProps"
25+
:class="
26+
cn(
27+
'focus:bg-accent focus:text-accent-foreground [&_svg:not([class*=\'text-\'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=\'size-\'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2',
28+
props.class,
29+
)
30+
"
31+
>
32+
<span class="absolute right-2 flex size-3.5 items-center justify-center">
33+
<SelectItemIndicator>
34+
<slot name="indicator-icon">
35+
<Check class="size-4" />
36+
</slot>
37+
</SelectItemIndicator>
38+
</span>
39+
40+
<SelectItemText>
41+
<slot />
42+
</SelectItemText>
43+
</SelectItem>
44+
</template>

0 commit comments

Comments
 (0)