نوارِ کناری با زیرمنو
پیشنمایش تمامصفحهبخشهای منو با زیرمنوی باز و بستهشونده و خطِ راهنما؛ بخشِ صفحهٔ فعلی از اول باز است.
۱. نصب کامپوننتها
این بلاک از ۷ آیتم دیگ استفاده میکند: breadcrumbcollapsibleiconspersianprogressseparatorsidebar
npx digdesign@latest add https://docs.digdesign.ir/r/breadcrumb.json https://docs.digdesign.ir/r/collapsible.json https://docs.digdesign.ir/r/icons.json https://docs.digdesign.ir/r/persian.json https://docs.digdesign.ir/r/progress.json https://docs.digdesign.ir/r/separator.json https://docs.digdesign.ir/r/sidebar.jsonpnpm dlx digdesign@latest add https://docs.digdesign.ir/r/breadcrumb.json https://docs.digdesign.ir/r/collapsible.json https://docs.digdesign.ir/r/icons.json https://docs.digdesign.ir/r/persian.json https://docs.digdesign.ir/r/progress.json https://docs.digdesign.ir/r/separator.json https://docs.digdesign.ir/r/sidebar.jsonyarn dlx digdesign@latest add https://docs.digdesign.ir/r/breadcrumb.json https://docs.digdesign.ir/r/collapsible.json https://docs.digdesign.ir/r/icons.json https://docs.digdesign.ir/r/persian.json https://docs.digdesign.ir/r/progress.json https://docs.digdesign.ir/r/separator.json https://docs.digdesign.ir/r/sidebar.jsonbunx --bun digdesign@latest add https://docs.digdesign.ir/r/breadcrumb.json https://docs.digdesign.ir/r/collapsible.json https://docs.digdesign.ir/r/icons.json https://docs.digdesign.ir/r/persian.json https://docs.digdesign.ir/r/progress.json https://docs.digdesign.ir/r/separator.json https://docs.digdesign.ir/r/sidebar.jsonnpx digdesign@latest add breadcrumb collapsible persian progress separator sidebar --framework vuepnpm dlx digdesign@latest add breadcrumb collapsible persian progress separator sidebar --framework vueyarn dlx digdesign@latest add breadcrumb collapsible persian progress separator sidebar --framework vuebunx --bun digdesign@latest add breadcrumb collapsible persian progress separator sidebar --framework vueهیچکدام از کامپوننتهای این بلاک هنوز برای Svelte پورت نشده است.
npx digdesign@latest add breadcrumb collapsible icons persian progress separator sidebar --framework angularpnpm dlx digdesign@latest add breadcrumb collapsible icons persian progress separator sidebar --framework angularyarn dlx digdesign@latest add breadcrumb collapsible icons persian progress separator sidebar --framework angularbunx --bun digdesign@latest add breadcrumb collapsible icons persian progress separator sidebar --framework angularnpx digdesign@latest add breadcrumb collapsible persian progress separator sidebar --framework androidpnpm dlx digdesign@latest add breadcrumb collapsible persian progress separator sidebar --framework androidyarn dlx digdesign@latest add breadcrumb collapsible persian progress separator sidebar --framework androidbunx --bun digdesign@latest add breadcrumb collapsible persian progress separator sidebar --framework android۲. کد صفحه
کد را در صفحهٔ پروژهتان بگذارید (React: app/<route>/page.tsx) و متنها، داده و هندلرها را با محصول خودتان عوض کنید. با سوییچر فریمورک کدِ همین صفحه در فریمورک دیگر را ببینید.
"use client"
import * as React from "react"
import { BarChartIcon, ChevronDownIcon, DashboardIcon, DigLogo, GridIcon, SettingsIcon, UsersIcon } from "@/components/icons"
import { Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator } from "@/components/ui/breadcrumb"
import { Progress } from "@/components/ui/progress"
import { Separator } from "@/components/ui/separator"
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@/components/ui/collapsible"
import {
Sidebar,
SidebarBrand,
SidebarContent,
SidebarGroup,
SidebarGroupContent,
SidebarGroupLabel,
SidebarHeader,
SidebarInset,
SidebarMenu,
SidebarMenuButton,
SidebarMenuItem,
SidebarMenuSub,
SidebarMenuSubButton,
SidebarMenuSubItem,
SidebarProvider,
SidebarTrigger,
} from "@/components/ui/sidebar"
import { toFaDigits } from "@/lib/persian"
const NAV = [
{ title: "پیشخوان", icon: <DashboardIcon />, items: [] as string[] },
{ title: "پروژهها", icon: <GridIcon />, items: ["همهٔ پروژهها", "بایگانی", "الگوها"] },
{ title: "گزارشها", icon: <BarChartIcon />, items: ["عملکردِ تیم", "زمانِ ثبتشده", "بودجه"] },
{ title: "تیم", icon: <UsersIcon />, items: ["اعضا", "دعوتها", "نقشها"] },
{ title: "تنظیمات", icon: <SettingsIcon />, items: ["عمومی", "صورتحساب", "یکپارچهسازیها"] },
]
/**
* پوستهٔ اپ با زیرمنو: هر بخش با یک لمس باز و بسته میشود و زیرمنو با خطِ راهنما زیرِ والدش مینشیند؛ بخشِ
* صفحهٔ فعلی از اول باز است. برای اپهایی با چند سطحِ صفحه (پروژه ← بایگانی) که منوی تخت شلوغ میشود.
*/
export default function AppShellSubmenusBlock() {
const [active, setActive] = React.useState("همهٔ پروژهها")
return (
<SidebarProvider>
<Sidebar>
<SidebarHeader className="p-3">
<SidebarBrand logo={<DigLogo />} title="فضای کارِ آوند" subtitle={`${toFaDigits(4)} پروژهٔ فعال`} />
</SidebarHeader>
<SidebarContent>
<SidebarGroup>
<SidebarGroupLabel>منو</SidebarGroupLabel>
<SidebarGroupContent>
<SidebarMenu>
{NAV.map((section) =>
section.items.length === 0 ? (
<SidebarMenuItem key={section.title}>
<SidebarMenuButton isActive={active === section.title} onClick={() => setActive(section.title)}>
{section.icon}
<span>{section.title}</span>
</SidebarMenuButton>
</SidebarMenuItem>
) : (
<SidebarMenuItem key={section.title}>
<Collapsible defaultOpen={section.items.includes(active)}>
<CollapsibleTrigger asChild>
<SidebarMenuButton className="group/collapsible">
{section.icon}
<span>{section.title}</span>
<ChevronDownIcon className="ms-auto size-4! transition-transform group-data-[state=open]/collapsible:rotate-180" />
</SidebarMenuButton>
</CollapsibleTrigger>
<CollapsibleContent>
<SidebarMenuSub>
{section.items.map((item) => (
<SidebarMenuSubItem key={item}>
<SidebarMenuSubButton
href="#"
isActive={active === item}
onClick={(event) => {
event.preventDefault()
setActive(item)
}}
>
{item}
</SidebarMenuSubButton>
</SidebarMenuSubItem>
))}
</SidebarMenuSub>
</CollapsibleContent>
</Collapsible>
</SidebarMenuItem>
)
)}
</SidebarMenu>
</SidebarGroupContent>
</SidebarGroup>
</SidebarContent>
</Sidebar>
<SidebarInset>
<ShellBody title={active} />
</SidebarInset>
</SidebarProvider>
)
}
/** بدنهٔ مشترکِ پوسته: سرصفحه با دکمهٔ نوار و مسیر، سه آمار و فهرستِ پروژهها؛ جای صفحهٔ واقعیِ محصول. */
function ShellBody({ title = "پروژهها", children }: { title?: string; children?: React.ReactNode }) {
return (
<>
<header className="sticky top-0 z-10 flex h-14 shrink-0 items-center gap-2 border-b border-border bg-background px-4">
<SidebarTrigger className="-ms-1" />
<Separator orientation="vertical" className="mx-1 h-5" />
<Breadcrumb>
<BreadcrumbList>
<BreadcrumbItem className="max-sm:hidden">
<BreadcrumbLink href="#">فضای کار</BreadcrumbLink>
</BreadcrumbItem>
<BreadcrumbSeparator className="max-sm:hidden" />
<BreadcrumbItem>
<BreadcrumbPage>{title}</BreadcrumbPage>
</BreadcrumbItem>
</BreadcrumbList>
</Breadcrumb>
</header>
<div className="flex flex-1 flex-col gap-6 p-4 sm:p-6">
{children}
<div className="grid grid-cols-1 gap-3 sm:grid-cols-3">
{STATS.map((stat) => (
<div key={stat.label} className="flex flex-col gap-1 rounded-xl border border-border bg-card p-4">
<span className="text-sm text-muted-foreground">{stat.label}</span>
<span className="text-2xl font-bold tabular-nums">{stat.value}</span>
</div>
))}
</div>
<section aria-labelledby="shell-projects" className="flex flex-col gap-3">
<h2 id="shell-projects" className="text-lg leading-snug font-bold">
پروژههای فعال
</h2>
<ul className="flex flex-col divide-y divide-border rounded-xl border border-border bg-card">
{PROJECTS.map((project) => (
<li key={project.name} className="flex flex-col gap-2 p-4 sm:flex-row sm:items-center sm:gap-6">
<span className="flex min-w-0 flex-1 flex-col">
<span className="truncate font-semibold">{project.name}</span>
<span className="text-sm text-muted-foreground">{project.owner}</span>
</span>
<span className="flex items-center gap-3 sm:w-56">
<Progress value={project.progress} aria-label={`پیشرفتِ ${project.name}`} className="flex-1" />
<span className="w-10 text-end text-sm tabular-nums">٪{toFaDigits(project.progress)}</span>
</span>
</li>
))}
</ul>
</section>
</div>
</>
)
}
const STATS = [
{ label: "کارهای باز", value: "۲۴" },
{ label: "سررسیدِ این هفته", value: "۷" },
{ label: "انجامشده در مهر", value: "۱۱۸" },
]
const PROJECTS = [
{ name: "بازطراحیِ اپِ بانکی", owner: "نگار احمدی", progress: 72 },
{ name: "داشبوردِ فروشِ فصل", owner: "امیر رضایی", progress: 45 },
{ name: "سیستمِ نوبتدهیِ کلینیک", owner: "سارا محمدی", progress: 88 },
{ name: "کمپینِ پاییزه", owner: "کیان مرادی", progress: 20 },
]
<script setup lang="ts">
import { ref } from "vue"
import Breadcrumb from "@/components/ui/Breadcrumb.vue"
import BreadcrumbItem from "@/components/ui/BreadcrumbItem.vue"
import BreadcrumbLink from "@/components/ui/BreadcrumbLink.vue"
import BreadcrumbList from "@/components/ui/BreadcrumbList.vue"
import BreadcrumbPage from "@/components/ui/BreadcrumbPage.vue"
import BreadcrumbSeparator from "@/components/ui/BreadcrumbSeparator.vue"
import Progress from "@/components/ui/Progress.vue"
import Separator from "@/components/ui/Separator.vue"
import SidebarInset from "@/components/ui/SidebarInset.vue"
import SidebarTrigger from "@/components/ui/SidebarTrigger.vue"
import Collapsible from "@/components/ui/Collapsible.vue"
import CollapsibleContent from "@/components/ui/CollapsibleContent.vue"
import CollapsibleTrigger from "@/components/ui/CollapsibleTrigger.vue"
import Sidebar from "@/components/ui/Sidebar.vue"
import SidebarBrand from "@/components/ui/SidebarBrand.vue"
import SidebarContent from "@/components/ui/SidebarContent.vue"
import SidebarGroup from "@/components/ui/SidebarGroup.vue"
import SidebarGroupContent from "@/components/ui/SidebarGroupContent.vue"
import SidebarGroupLabel from "@/components/ui/SidebarGroupLabel.vue"
import SidebarHeader from "@/components/ui/SidebarHeader.vue"
import SidebarMenu from "@/components/ui/SidebarMenu.vue"
import SidebarMenuButton from "@/components/ui/SidebarMenuButton.vue"
import SidebarMenuItem from "@/components/ui/SidebarMenuItem.vue"
import SidebarMenuSub from "@/components/ui/SidebarMenuSub.vue"
import SidebarMenuSubButton from "@/components/ui/SidebarMenuSubButton.vue"
import SidebarMenuSubItem from "@/components/ui/SidebarMenuSubItem.vue"
import SidebarProvider from "@/components/ui/SidebarProvider.vue"
import { DigIcon, type DigIconName } from "@/lib/icons"
import { toFaDigits } from "@/lib/persian"
/**
* پوستهٔ اپ با زیرمنو: هر بخش با یک لمس باز و بسته میشود و زیرمنو با خطِ راهنما زیرِ والدش مینشیند؛ بخشِ
* صفحهٔ فعلی از اول باز است. برای اپهایی با چند سطحِ صفحه (پروژه ← بایگانی) که منوی تخت شلوغ میشود.
*/
const NAV: { title: string; icon: DigIconName; items: string[] }[] = [
{ title: "پیشخوان", icon: "dashboard", items: [] },
{ title: "پروژهها", icon: "grid", items: ["همهٔ پروژهها", "بایگانی", "الگوها"] },
{ title: "گزارشها", icon: "bar-chart", items: ["عملکردِ تیم", "زمانِ ثبتشده", "بودجه"] },
{ title: "تیم", icon: "users", items: ["اعضا", "دعوتها", "نقشها"] },
{ title: "تنظیمات", icon: "settings", items: ["عمومی", "صورتحساب", "یکپارچهسازیها"] },
]
const active = ref("همهٔ پروژهها")
/** دادههای بدنهٔ مشترکِ پوسته (آمار و پروژهها). */
const STATS = [
{ label: "کارهای باز", value: "۲۴" },
{ label: "سررسیدِ این هفته", value: "۷" },
{ label: "انجامشده در مهر", value: "۱۱۸" },
]
const PROJECTS = [
{ name: "بازطراحیِ اپِ بانکی", owner: "نگار احمدی", progress: 72 },
{ name: "داشبوردِ فروشِ فصل", owner: "امیر رضایی", progress: 45 },
{ name: "سیستمِ نوبتدهیِ کلینیک", owner: "سارا محمدی", progress: 88 },
{ name: "کمپینِ پاییزه", owner: "کیان مرادی", progress: 20 },
]
</script>
<template>
<SidebarProvider>
<Sidebar>
<SidebarHeader class="p-3">
<SidebarBrand title="فضای کارِ آوند" :subtitle="`${toFaDigits(4)} پروژهٔ فعال`">
<template #logo>
<svg viewBox="0 0 120 110" fill="currentColor" aria-hidden="true">
<path d="m110,50C110,22.43,87.57,0,60,0S10,22.43,10,50H0c0,33.08,26.92,60,60,60s60-26.92,60-60h-10Zm-50,40c-22.06,0-40-17.94-40-40h10c0-16.54,13.46-30,30-30,12.27,0,22.84,7.41,27.48,17.98l-57.33,12.02h61s8.85,0,8.85,0c0,22.06-17.94,40-40,40Z" />
</svg>
</template>
</SidebarBrand>
</SidebarHeader>
<SidebarContent>
<SidebarGroup>
<SidebarGroupLabel>منو</SidebarGroupLabel>
<SidebarGroupContent>
<SidebarMenu>
<template v-for="section in NAV" :key="section.title">
<SidebarMenuItem v-if="section.items.length === 0">
<SidebarMenuButton :is-active="active === section.title" @click="active = section.title">
<DigIcon :name="section.icon" />
<span>{{ section.title }}</span>
</SidebarMenuButton>
</SidebarMenuItem>
<SidebarMenuItem v-else>
<Collapsible :default-open="section.items.includes(active)">
<CollapsibleTrigger as-child>
<SidebarMenuButton class="group/collapsible">
<DigIcon :name="section.icon" />
<span>{{ section.title }}</span>
<DigIcon name="chevron-down" class="ms-auto size-4! transition-transform group-data-[state=open]/collapsible:rotate-180" />
</SidebarMenuButton>
</CollapsibleTrigger>
<CollapsibleContent>
<SidebarMenuSub>
<SidebarMenuSubItem v-for="item in section.items" :key="item">
<SidebarMenuSubButton href="#" :is-active="active === item" @click.prevent="active = item">
{{ item }}
</SidebarMenuSubButton>
</SidebarMenuSubItem>
</SidebarMenuSub>
</CollapsibleContent>
</Collapsible>
</SidebarMenuItem>
</template>
</SidebarMenu>
</SidebarGroupContent>
</SidebarGroup>
</SidebarContent>
</Sidebar>
<SidebarInset>
<!-- بدنهٔ مشترکِ پوسته: سرصفحه با دکمهٔ نوار و مسیر، سه آمار و فهرستِ پروژهها؛ جای صفحهٔ واقعیِ محصول. -->
<header class="sticky top-0 z-10 flex h-14 shrink-0 items-center gap-2 border-b border-border bg-background px-4">
<SidebarTrigger class="-ms-1" />
<Separator orientation="vertical" class="mx-1 h-5" />
<Breadcrumb>
<BreadcrumbList>
<BreadcrumbItem class="max-sm:hidden">
<BreadcrumbLink href="#">فضای کار</BreadcrumbLink>
</BreadcrumbItem>
<BreadcrumbSeparator class="max-sm:hidden" />
<BreadcrumbItem>
<BreadcrumbPage>{{ active }}</BreadcrumbPage>
</BreadcrumbItem>
</BreadcrumbList>
</Breadcrumb>
</header>
<div class="flex flex-1 flex-col gap-6 p-4 sm:p-6">
<div class="grid grid-cols-1 gap-3 sm:grid-cols-3">
<div v-for="stat in STATS" :key="stat.label" class="flex flex-col gap-1 rounded-xl border border-border bg-card p-4">
<span class="text-sm text-muted-foreground">{{ stat.label }}</span>
<span class="text-2xl font-bold tabular-nums">{{ stat.value }}</span>
</div>
</div>
<section aria-labelledby="shell-projects" class="flex flex-col gap-3">
<h2 id="shell-projects" class="text-lg leading-snug font-bold">
پروژههای فعال
</h2>
<ul class="flex flex-col divide-y divide-border rounded-xl border border-border bg-card">
<li v-for="project in PROJECTS" :key="project.name" class="flex flex-col gap-2 p-4 sm:flex-row sm:items-center sm:gap-6">
<span class="flex min-w-0 flex-1 flex-col">
<span class="truncate font-semibold">{{ project.name }}</span>
<span class="text-sm text-muted-foreground">{{ project.owner }}</span>
</span>
<span class="flex items-center gap-3 sm:w-56">
<Progress :value="project.progress" :aria-label="`پیشرفتِ ${project.name}`" class="flex-1" />
<span class="w-10 text-end text-sm tabular-nums">٪{{ toFaDigits(project.progress) }}</span>
</span>
</li>
</ul>
</section>
</div>
</SidebarInset>
</SidebarProvider>
</template>
کدِ این بلاک هنوز برای Svelte نوشته نشده است.
این موارد هنوز برای Svelte آماده نیستند: breadcrumbcollapsiblepersianprogressseparatorsidebarآیکون bar-chartآیکون chevron-downآیکون dashboardآیکون dig-logoآیکون gridآیکون settingsآیکون users
کدِ React همین بلاک مرجع است. با MCP دیگ و get_block با framework="svelte" ایجنت آن را با کامپوننتهای Svelte میسازد.
import { Component, ChangeDetectionStrategy, signal } from "@angular/core"
import {
DigSidebarProvider,
DigSidebar,
DigSidebarHeader,
DigSidebarBrand,
DigSidebarBrandLogo,
DigSidebarContent,
DigSidebarGroup,
DigSidebarGroupLabel,
DigSidebarGroupContent,
DigSidebarMenu,
DigSidebarMenuItem,
DigSidebarMenuButton,
DigSidebarMenuSub,
DigSidebarMenuSubItem,
DigSidebarMenuSubButton,
DigSidebarInset,
DigSidebarTrigger,
} from "@/components/ui/sidebar"
import { DigIcon, type DigIconName } from "@/lib/icons"
import { DigCollapsible, DigCollapsibleTrigger, DigCollapsibleContent } from "@/components/ui/collapsible"
import { DigSeparator } from "@/components/ui/separator"
import {
DigBreadcrumb,
DigBreadcrumbList,
DigBreadcrumbItem,
DigBreadcrumbLink,
DigBreadcrumbSeparator,
DigBreadcrumbPage,
} from "@/components/ui/breadcrumb"
import { DigProgress } from "@/components/ui/progress"
import { toFaDigits } from "@/lib/persian"
const NAV: { title: string; icon: DigIconName; items: string[] }[] = [
{ title: "پیشخوان", icon: "dashboard", items: [] },
{
title: "پروژهها",
icon: "grid",
items: ["همهٔ پروژهها", "بایگانی", "الگوها"],
},
{
title: "گزارشها",
icon: "bar-chart",
items: ["عملکردِ تیم", "زمانِ ثبتشده", "بودجه"],
},
{ title: "تیم", icon: "users", items: ["اعضا", "دعوتها", "نقشها"] },
{
title: "تنظیمات",
icon: "settings",
items: ["عمومی", "صورتحساب", "یکپارچهسازیها"],
},
]
const STATS = [
{ label: "کارهای باز", value: "۲۴" },
{ label: "سررسیدِ این هفته", value: "۷" },
{ label: "انجامشده در مهر", value: "۱۱۸" },
]
const PROJECTS = [
{ name: "بازطراحیِ اپِ بانکی", owner: "نگار احمدی", progress: 72 },
{ name: "داشبوردِ فروشِ فصل", owner: "امیر رضایی", progress: 45 },
{ name: "سیستمِ نوبتدهیِ کلینیک", owner: "سارا محمدی", progress: 88 },
{ name: "کمپینِ پاییزه", owner: "کیان مرادی", progress: 20 },
]
@Component({
selector: "dig-block-app-shell-submenus",
imports: [
DigSidebarProvider,
DigSidebar,
DigSidebarHeader,
DigSidebarBrand,
DigSidebarBrandLogo,
DigSidebarContent,
DigSidebarGroup,
DigSidebarGroupLabel,
DigSidebarGroupContent,
DigSidebarMenu,
DigSidebarMenuItem,
DigSidebarMenuButton,
DigSidebarMenuSub,
DigSidebarMenuSubItem,
DigSidebarMenuSubButton,
DigSidebarInset,
DigSidebarTrigger,
DigIcon,
DigCollapsible,
DigCollapsibleTrigger,
DigCollapsibleContent,
DigSeparator,
DigBreadcrumb,
DigBreadcrumbList,
DigBreadcrumbItem,
DigBreadcrumbLink,
DigBreadcrumbSeparator,
DigBreadcrumbPage,
DigProgress,
],
changeDetection: ChangeDetectionStrategy.OnPush,
template: `
<div digSidebarProvider>
<div digSidebar>
<div digSidebarHeader class="p-3">
<div digSidebarBrand title="فضای کارِ آوند" [subtitle]="\`\${toFaDigits(4)} پروژهٔ فعال\`">
<span digSidebarBrandLogo
><svg viewBox="0 0 120 110" fill="currentColor" aria-hidden="true">
<path
d="m110,50C110,22.43,87.57,0,60,0S10,22.43,10,50H0c0,33.08,26.92,60,60,60s60-26.92,60-60h-10Zm-50,40c-22.06,0-40-17.94-40-40h10c0-16.54,13.46-30,30-30,12.27,0,22.84,7.41,27.48,17.98l-57.33,12.02h61s8.85,0,8.85,0c0,22.06-17.94,40-40,40Z"
></path></svg
></span>
</div>
</div>
<div digSidebarContent>
<div digSidebarGroup>
<div digSidebarGroupLabel>منو</div>
<div digSidebarGroupContent>
<ul digSidebarMenu>
@for (section of NAV; track section.title) {
@if (section.items.length === 0) {
<li digSidebarMenuItem>
<button
digSidebarMenuButton
[isActive]="active() === section.title"
(click)="active.set(section.title)"
>
<svg [digIcon]="section.icon"></svg>
<span>{{ section.title }}</span>
</button>
</li>
} @else {
<li digSidebarMenuItem>
<div digCollapsible [open]="section.items.includes(active())">
<button digCollapsibleTrigger digSidebarMenuButton class="group/collapsible">
<svg [digIcon]="section.icon"></svg>
<span>{{ section.title }}</span>
<svg
digIcon="chevron-down"
class="ms-auto size-4! transition-transform group-data-[state=open]/collapsible:rotate-180"
></svg>
</button>
<div digCollapsibleContent>
<ul digSidebarMenuSub>
@for (item of section.items; track item) {
<li digSidebarMenuSubItem>
<a
digSidebarMenuSubButton
href="#"
[isActive]="active() === item"
(click)="$event.preventDefault(); active.set(item)"
>{{ item }}</a
>
</li>
}
</ul>
</div>
</div>
</li>
}
}
</ul>
</div>
</div>
</div>
</div>
<main digSidebarInset>
<!-- بدنهٔ مشترکِ پوسته: سرصفحه با دکمهٔ نوار و مسیر، سه آمار و فهرستِ پروژهها؛ جای صفحهٔ واقعیِ محصول. -->
<header
class="sticky top-0 z-10 flex h-14 shrink-0 items-center gap-2 border-b border-border bg-background px-4"
>
<button digSidebarTrigger class="-ms-1"></button>
<div digSeparator orientation="vertical" class="mx-1 h-5"></div>
<nav digBreadcrumb>
<ol digBreadcrumbList>
<li digBreadcrumbItem class="max-sm:hidden">
<a digBreadcrumbLink href="#">فضای کار</a>
</li>
<li digBreadcrumbSeparator class="max-sm:hidden"></li>
<li digBreadcrumbItem>
<span digBreadcrumbPage>{{ active() }}</span>
</li>
</ol>
</nav>
</header>
<div class="flex flex-1 flex-col gap-6 p-4 sm:p-6">
<div class="grid grid-cols-1 gap-3 sm:grid-cols-3">
@for (stat of STATS; track stat.label) {
<div class="flex flex-col gap-1 rounded-xl border border-border bg-card p-4">
<span class="text-sm text-muted-foreground">{{ stat.label }}</span>
<span class="text-2xl font-bold tabular-nums">{{ stat.value }}</span>
</div>
}
</div>
<section aria-labelledby="shell-projects" class="flex flex-col gap-3">
<h2 id="shell-projects" class="text-lg leading-snug font-bold">پروژههای فعال</h2>
<ul class="flex flex-col divide-y divide-border rounded-xl border border-border bg-card">
@for (project of PROJECTS; track project.name) {
<li class="flex flex-col gap-2 p-4 sm:flex-row sm:items-center sm:gap-6">
<span class="flex min-w-0 flex-1 flex-col"
><span class="truncate font-semibold">{{ project.name }}</span>
<span class="text-sm text-muted-foreground">{{ project.owner }}</span></span
>
<span class="flex items-center gap-3 sm:w-56"
><div
digProgress
[value]="project.progress"
[attr.aria-label]="\`پیشرفتِ \${project.name}\`"
class="flex-1"
></div>
<span class="w-10 text-end text-sm tabular-nums">٪{{ toFaDigits(project.progress) }}</span></span
>
</li>
}
</ul>
</section>
</div>
</main>
</div>
`,
})
export class AppShellSubmenusBlock {
readonly toFaDigits = toFaDigits
readonly PROJECTS = PROJECTS
readonly STATS = STATS
readonly NAV = NAV
readonly active = signal("همهٔ پروژهها")
}
کدِ این بلاک هنوز برای Android نوشته نشده است.
همهٔ کامپوننتهای لازم برای Android آمادهاند؛ با MCP میتوانید همین صفحه را از روی نسخهٔ React بسازید.
کدِ React همین بلاک مرجع است. با MCP دیگ و get_block با framework="android" ایجنت آن را با کامپوننتهای Android میسازد.