Files
KanbanGit/resources/js/components/ui/sidebar/SidebarTrigger.vue
T
Twyco 718f6b991d
CI/CD / test_and_check_app (push) Successful in 4m31s
CI/CD / Publish immutable image (push) Skipped
CI/CD / test_and_check_app (pull_request) Canceled after 0s
CI/CD / Publish immutable image (pull_request) Canceled after 0s
feat(KAN-19): add responsive permission-aware navigation
2026-09-09 23:09:25 +02:00

45 lines
1.3 KiB
Vue

<script setup lang="ts">
import type { HTMLAttributes } from "vue";
import { PanelLeftClose, PanelLeftOpen } from "lucide-vue-next";
import { cn } from "@/lib/utils";
import { Button } from "@/components/ui/button";
import { useSidebar } from "./utils";
import { useLocalization } from "@/composables/useLocalization";
const props = defineProps<{
class?: HTMLAttributes["class"];
}>();
const { isMobile, state, openMobile, toggleSidebar } = useSidebar();
const { t } = useLocalization();
</script>
<template>
<Button
data-sidebar="trigger"
data-slot="sidebar-trigger"
variant="ghost"
size="icon"
type="button"
aria-controls="app-navigation"
:aria-expanded="isMobile ? openMobile : state === 'expanded'"
:aria-label="
isMobile
? t(openMobile ? 'navigation.close' : 'navigation.open')
: t(
state === 'collapsed'
? 'navigation.expand'
: 'navigation.collapse',
)
"
:class="cn('size-control', props.class)"
@click="toggleSidebar"
>
<PanelLeftOpen
v-if="isMobile || state === 'collapsed'"
aria-hidden="true"
/>
<PanelLeftClose v-else aria-hidden="true" />
</Button>
</template>