بلاک‌ها · پنل مدیریت
ری‌اکت ۱۹ و Next.js با پیاده‌سازی دسترس‌پذیری داخلی دیگویو ۳ با Composition APISvelte ۵ با runesانگولار با signals و دایرکتیوهای standaloneجتپک کامپوز با KotliniOS — هنوز پورت نشده

صفحهٔ تعمیرات، هم‌سبکِ ۴۰۴ و ۵۰۲: تابلوی خطی با آچار، متنِ صمیمی، پیشرفتِ کار با شمارنده و زمانِ تقریبیِ برگشت، و «خبرم کن».

۱. نصب کامپوننت‌ها

این بلاک از ۶ آیتم دیگ استفاده می‌کند: buttoncontrol-sizecount-upiconsprogresstoast

پکیج‌منیجر پیش‌فرض Node.jsنصب سریع با لینک سخت و دیسک مشترکYarn نسخهٔ ۲ به بالا (Berry)رانتایم و پکیج‌منیجر Bun
npx digdesign@latest add https://docs.digdesign.ir/r/button.json https://docs.digdesign.ir/r/control-size.json https://docs.digdesign.ir/r/count-up.json https://docs.digdesign.ir/r/icons.json https://docs.digdesign.ir/r/progress.json https://docs.digdesign.ir/r/toast.json
pnpm dlx digdesign@latest add https://docs.digdesign.ir/r/button.json https://docs.digdesign.ir/r/control-size.json https://docs.digdesign.ir/r/count-up.json https://docs.digdesign.ir/r/icons.json https://docs.digdesign.ir/r/progress.json https://docs.digdesign.ir/r/toast.json
yarn dlx digdesign@latest add https://docs.digdesign.ir/r/button.json https://docs.digdesign.ir/r/control-size.json https://docs.digdesign.ir/r/count-up.json https://docs.digdesign.ir/r/icons.json https://docs.digdesign.ir/r/progress.json https://docs.digdesign.ir/r/toast.json
bunx --bun digdesign@latest add https://docs.digdesign.ir/r/button.json https://docs.digdesign.ir/r/control-size.json https://docs.digdesign.ir/r/count-up.json https://docs.digdesign.ir/r/icons.json https://docs.digdesign.ir/r/progress.json https://docs.digdesign.ir/r/toast.json
پکیج‌منیجر پیش‌فرض Node.jsنصب سریع با لینک سخت و دیسک مشترکYarn نسخهٔ ۲ به بالا (Berry)رانتایم و پکیج‌منیجر Bun
npx digdesign@latest add button control-size count-up progress toast --framework vue
pnpm dlx digdesign@latest add button control-size count-up progress toast --framework vue
yarn dlx digdesign@latest add button control-size count-up progress toast --framework vue
bunx --bun digdesign@latest add button control-size count-up progress toast --framework vue
پکیج‌منیجر پیش‌فرض Node.jsنصب سریع با لینک سخت و دیسک مشترکYarn نسخهٔ ۲ به بالا (Berry)رانتایم و پکیج‌منیجر Bun
npx digdesign@latest add button --framework svelte
pnpm dlx digdesign@latest add button --framework svelte
yarn dlx digdesign@latest add button --framework svelte
bunx --bun digdesign@latest add button --framework svelte
پکیج‌منیجر پیش‌فرض Node.jsنصب سریع با لینک سخت و دیسک مشترکYarn نسخهٔ ۲ به بالا (Berry)رانتایم و پکیج‌منیجر Bun
npx digdesign@latest add button control-size count-up icons progress toast --framework angular
pnpm dlx digdesign@latest add button control-size count-up icons progress toast --framework angular
yarn dlx digdesign@latest add button control-size count-up icons progress toast --framework angular
bunx --bun digdesign@latest add button control-size count-up icons progress toast --framework angular
پکیج‌منیجر پیش‌فرض Node.jsنصب سریع با لینک سخت و دیسک مشترکYarn نسخهٔ ۲ به بالا (Berry)رانتایم و پکیج‌منیجر Bun
npx digdesign@latest add button control-size count-up progress toast --framework android
pnpm dlx digdesign@latest add button control-size count-up progress toast --framework android
yarn dlx digdesign@latest add button control-size count-up progress toast --framework android
bunx --bun digdesign@latest add button control-size count-up progress toast --framework android

۲. کد صفحه

کد را در صفحهٔ پروژه‌تان بگذارید (React: app/<route>/page.tsx) و متن‌ها، داده و هندلرها را با محصول خودتان عوض کنید. با سوییچر فریم‌ورک کدِ همین صفحه در فریم‌ورک دیگر را ببینید.

maintenance.tsx
"use client"

import * as React from "react"

import { BellIcon } from "@/components/icons"
import { Button } from "@/components/ui/button"
import { ControlSizeProvider } from "@/components/ui/control-size"
import { CountUp } from "@/components/ui/count-up"
import { Progress } from "@/components/ui/progress"
import { toast } from "@/components/ui/toast"

/**
 * تصویرِ خطی تابلوی آویزان، هم‌خانوادهٔ صفحه‌های ۴۰۴ و ۵۰۲؛ فقط رنگِ متن و
 * پس‌زمینهٔ تم، پس در حالتِ تیره هم درست است. محتوای وسطِ تابلو را children می‌دهد.
 */
function HangingSign({ label, className, children }: { label: string; className?: string; children: React.ReactNode }) {
  return (
    <svg viewBox="-10 0 320 290" role="img" aria-label={label} className={className}>
      <circle cx="150" cy="26" r="6" fill="var(--background)" stroke="currentColor" strokeWidth="2" />
      <path d="M150 20v-8" stroke="currentColor" strokeWidth="2" strokeLinecap="round" />
      <path d="M150 30 96 108M150 30l58 78" fill="none" stroke="currentColor" strokeWidth="1.75" strokeLinecap="round" />
      <path d="M58 114h200v122H58z" transform="translate(8 7)" fill="var(--background)" stroke="currentColor" strokeWidth="2" strokeLinejoin="round" />
      <path d="M258 114l8 7v122l-8-7M58 236l8 7h200" fill="none" stroke="currentColor" strokeWidth="2" strokeLinejoin="round" />
      <rect x="50" y="108" width="208" height="126" fill="var(--background)" stroke="currentColor" strokeWidth="2" />
      <path d="M50 128h208" stroke="currentColor" strokeWidth="2" />
      <path d="M60 114h10M60 118h10M60 122h10" stroke="currentColor" strokeWidth="1.75" strokeLinecap="round" />
      <circle cx="236" cy="118" r="2.6" fill="none" stroke="currentColor" strokeWidth="1.6" />
      <circle cx="246" cy="118" r="2.6" fill="none" stroke="currentColor" strokeWidth="1.6" />
      <circle cx="96" cy="112" r="3.2" fill="var(--background)" stroke="currentColor" strokeWidth="1.75" />
      <circle cx="208" cy="112" r="3.2" fill="var(--background)" stroke="currentColor" strokeWidth="1.75" />
      <rect x="56" y="134" width="196" height="94" fill="currentColor" />
      {children}
    </svg>
  )
}

/** صفحهٔ تعمیرات؛ هم‌سبکِ ۴۰۴ و ۵۰۲، با زمانِ تقریبی برگشت و «خبرم کن». */
export default function MaintenanceBlock() {
  const [notify, setNotify] = React.useState(false)

  return (
    <ControlSizeProvider size="xl" asChild>
      <main className="flex min-h-svh flex-col items-center justify-center gap-8 p-6 text-center">
        <HangingSign label="تابلوی در حالِ تعمیر با آچار" className="w-64 max-w-full text-foreground sm:w-80">
          {/* آچار و پیچ‌گوشتی ضربدری */}
          <g fill="none" stroke="var(--background)" strokeWidth="5" strokeLinecap="round">
            <path d="m134 206 36-36" />
            <path d="M166 160a10 10 0 1 0 14 14l-6-2-4-4z" strokeWidth="4" strokeLinejoin="round" />
            <path d="m174 206-36-36" />
            <path d="m132 166 8-8" strokeWidth="6" />
          </g>
        </HangingSign>
        <div className="flex max-w-md flex-col items-center gap-3">
          <h1 className="text-3xl leading-snug font-bold">داریم سفت‌وسختش می‌کنیم</h1>
          <p className="leading-7 text-muted-foreground">برای بهترشدنِ سرویس چند دقیقه‌ای در دسترس نیستیم. اطلاعاتت امنه و زود برمی‌گردیم.</p>
        </div>
        <div className="flex w-full max-w-xs flex-col gap-2 text-sm">
          <div className="flex justify-between text-muted-foreground">
            <span>پیشرفتِ کار</span>
            <CountUp value={72} suffix="٪" className="font-semibold text-foreground" />
          </div>
          <Progress value={72} aria-label="پیشرفتِ تعمیرات" />
          <span className="text-muted-foreground">برگشتِ تقریبی: حدودِ ۱۵ دقیقهٔ دیگه</span>
        </div>
        <Button
          variant={notify ? "outline" : "default"}
          onClick={() => {
            setNotify(true)
            toast.success("برگشتیم، پیامک می‌زنیم.")
          }}
          disabled={notify}
        >
          <BellIcon />
          {notify ? "خبرت می‌کنیم" : "وقتی برگشتید خبرم کن"}
        </Button>
      </main>
    </ControlSizeProvider>
  )
}
maintenance.vue
<script setup lang="ts">
import { ref } from "vue"

import Button from "@/components/ui/Button.vue"
import ControlSize from "@/components/ui/ControlSize.vue"
import CountUp from "@/components/ui/CountUp.vue"
import Progress from "@/components/ui/Progress.vue"
import { toast } from "@/components/ui/Toast.vue"
import { DigIcon } from "@/lib/icons"

/** صفحهٔ تعمیرات؛ هم‌سبکِ ۴۰۴ و ۵۰۲، با زمانِ تقریبی برگشت و «خبرم کن». */
const notify = ref(false)

function notifyMe() {
  notify.value = true
  toast.success("برگشتیم، پیامک می‌زنیم.")
}
</script>

<template>
  <ControlSize size="xl" as-child>
    <main class="flex min-h-svh flex-col items-center justify-center gap-8 p-6 text-center">
      <svg viewBox="-10 0 320 290" role="img" aria-label="تابلوی در حالِ تعمیر با آچار" class="w-64 max-w-full text-foreground sm:w-80">
      <circle cx="150" cy="26" r="6" fill="var(--background)" stroke="currentColor" stroke-width="2" />
      <path d="M150 20v-8" stroke="currentColor" stroke-width="2" stroke-linecap="round" />
      <path d="M150 30 96 108M150 30l58 78" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" />
      <path d="M58 114h200v122H58z" transform="translate(8 7)" fill="var(--background)" stroke="currentColor" stroke-width="2" stroke-linejoin="round" />
      <path d="M258 114l8 7v122l-8-7M58 236l8 7h200" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round" />
      <rect x="50" y="108" width="208" height="126" fill="var(--background)" stroke="currentColor" stroke-width="2" />
      <path d="M50 128h208" stroke="currentColor" stroke-width="2" />
      <path d="M60 114h10M60 118h10M60 122h10" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" />
      <circle cx="236" cy="118" r="2.6" fill="none" stroke="currentColor" stroke-width="1.6" />
      <circle cx="246" cy="118" r="2.6" fill="none" stroke="currentColor" stroke-width="1.6" />
      <circle cx="96" cy="112" r="3.2" fill="var(--background)" stroke="currentColor" stroke-width="1.75" />
      <circle cx="208" cy="112" r="3.2" fill="var(--background)" stroke="currentColor" stroke-width="1.75" />
      <rect x="56" y="134" width="196" height="94" fill="currentColor" />
        <g fill="none" stroke="var(--background)" stroke-width="5" stroke-linecap="round">
          <path d="m134 206 36-36" />
          <path d="M166 160a10 10 0 1 0 14 14l-6-2-4-4z" stroke-width="4" stroke-linejoin="round" />
          <path d="m174 206-36-36" />
          <path d="m132 166 8-8" stroke-width="6" />
        </g>
      </svg>
      <div class="flex max-w-md flex-col items-center gap-3">
        <h1 class="text-3xl leading-snug font-bold">داریم سفت‌وسختش می‌کنیم</h1>
        <p class="leading-7 text-muted-foreground">برای بهترشدنِ سرویس چند دقیقه‌ای در دسترس نیستیم. اطلاعاتت امنه و زود برمی‌گردیم.</p>
      </div>
      <div class="flex w-full max-w-xs flex-col gap-2 text-sm">
        <div class="flex justify-between text-muted-foreground">
          <span>پیشرفتِ کار</span>
          <CountUp :value="72" suffix="٪" class="font-semibold text-foreground" />
        </div>
        <Progress :value="72" aria-label="پیشرفتِ تعمیرات" />
        <span class="text-muted-foreground">برگشتِ تقریبی: حدودِ ۱۵ دقیقهٔ دیگه</span>
      </div>
      <Button :variant="notify ? 'outline' : 'default'" :disabled="notify" @click="notifyMe">
        <DigIcon name="bell" />
        {{ notify ? "خبرت می‌کنیم" : "وقتی برگشتید خبرم کن" }}
      </Button>
    </main>
  </ControlSize>
</template>

کدِ این بلاک هنوز برای Svelte نوشته نشده است.

این موارد هنوز برای Svelte آماده نیستند: control-sizecount-upprogresstoastآیکون bell

کدِ React همین بلاک مرجع است. با MCP دیگ و get_block با framework="svelte" ایجنت آن را با کامپوننت‌های Svelte می‌سازد.

maintenance.ts
import { ChangeDetectionStrategy, Component, signal } from "@angular/core"

import { DigButton } from "@/components/ui/button"
import { DigControlSize } from "@/components/ui/control-size"
import { DigCountUp } from "@/components/ui/count-up"
import { DigIcon } from "@/lib/icons"
import { DigProgress } from "@/components/ui/progress"
import { DigToaster, toast } from "@/components/ui/toast"

@Component({
  selector: "dig-block-maintenance",
  changeDetection: ChangeDetectionStrategy.OnPush,
  imports: [
    DigButton,
    DigControlSize,
    DigCountUp,
    DigIcon,
    DigProgress,
    DigToaster,
  ],
  template: `
    <main
      digControlSize="xl"
      class="flex min-h-svh flex-col items-center justify-center gap-8 p-6 text-center"
    >
      <svg
        viewBox="-10 0 320 290"
        role="img"
        aria-label="تابلوی در حالِ تعمیر با آچار"
        class="w-64 max-w-full text-foreground sm:w-80"
      >
        <circle
          cx="150"
          cy="26"
          r="6"
          fill="var(--background)"
          stroke="currentColor"
          strokeWidth="2"
        ></circle>
        <path
          d="M150 20v-8"
          stroke="currentColor"
          strokeWidth="2"
          strokeLinecap="round"
        ></path>
        <path
          d="M150 30 96 108M150 30l58 78"
          fill="none"
          stroke="currentColor"
          strokeWidth="1.75"
          strokeLinecap="round"
        ></path>
        <path
          d="M58 114h200v122H58z"
          transform="translate(8 7)"
          fill="var(--background)"
          stroke="currentColor"
          strokeWidth="2"
          strokeLinejoin="round"
        ></path>
        <path
          d="M258 114l8 7v122l-8-7M58 236l8 7h200"
          fill="none"
          stroke="currentColor"
          strokeWidth="2"
          strokeLinejoin="round"
        ></path>
        <rect
          x="50"
          y="108"
          width="208"
          height="126"
          fill="var(--background)"
          stroke="currentColor"
          strokeWidth="2"
        ></rect>
        <path d="M50 128h208" stroke="currentColor" strokeWidth="2"></path>
        <path
          d="M60 114h10M60 118h10M60 122h10"
          stroke="currentColor"
          strokeWidth="1.75"
          strokeLinecap="round"
        ></path>
        <circle
          cx="236"
          cy="118"
          r="2.6"
          fill="none"
          stroke="currentColor"
          strokeWidth="1.6"
        ></circle>
        <circle
          cx="246"
          cy="118"
          r="2.6"
          fill="none"
          stroke="currentColor"
          strokeWidth="1.6"
        ></circle>
        <circle
          cx="96"
          cy="112"
          r="3.2"
          fill="var(--background)"
          stroke="currentColor"
          strokeWidth="1.75"
        ></circle>
        <circle
          cx="208"
          cy="112"
          r="3.2"
          fill="var(--background)"
          stroke="currentColor"
          strokeWidth="1.75"
        ></circle>
        <rect x="56" y="134" width="196" height="94" fill="currentColor"></rect>
        <g
          fill="none"
          stroke="var(--background)"
          strokeWidth="5"
          strokeLinecap="round"
        >
          <path d="m134 206 36-36"></path>
          <path
            d="M166 160a10 10 0 1 0 14 14l-6-2-4-4z"
            strokeWidth="4"
            strokeLinejoin="round"
          ></path>
          <path d="m174 206-36-36"></path>
          <path d="m132 166 8-8" strokeWidth="6"></path>
        </g>
      </svg>
      <div class="flex max-w-md flex-col items-center gap-3">
        <h1 class="text-3xl leading-snug font-bold">داریم سفت‌وسختش می‌کنیم</h1>
        <p class="leading-7 text-muted-foreground">
          برای بهترشدنِ سرویس چند دقیقه‌ای در دسترس نیستیم. اطلاعاتت امنه و زود
          برمی‌گردیم.
        </p>
      </div>
      <div class="flex w-full max-w-xs flex-col gap-2 text-sm">
        <div class="flex justify-between text-muted-foreground">
          <span>پیشرفتِ کار</span>
          <span
            digCountUp
            [value]="72"
            suffix="٪"
            class="font-semibold text-foreground"
          ></span>
        </div>
        <div digProgress [value]="72" aria-label="پیشرفتِ تعمیرات"></div>
        <span class="text-muted-foreground"
          >برگشتِ تقریبی: حدودِ ۱۵ دقیقهٔ دیگه</span
        >
      </div>
      <button
        digButton
        type="button"
        [variant]="notify() ? 'outline' : 'default'"
        [disabled]="notify()"
        (click)="notifyMe()"
      >
        <svg digIcon="bell"></svg>
        {{ notify() ? "خبرت می‌کنیم" : "وقتی برگشتید خبرم کن" }}
      </button>
    </main>
    <div digToaster></div>
  `,
})
export class MaintenanceBlock {
  readonly notify = signal(false)

  notifyMe() {
    // Replace this demo handler with your notification subscription.
    this.notify.set(true)
    toast.success("برگشتیم، پیامک می‌زنیم.")
  }
}

کدِ این بلاک هنوز برای Android نوشته نشده است.

همهٔ کامپوننت‌های لازم برای Android آماده‌اند؛ با MCP می‌توانید همین صفحه را از روی نسخهٔ React بسازید.

کدِ React همین بلاک مرجع است. با MCP دیگ و get_block با framework="android" ایجنت آن را با کامپوننت‌های Android می‌سازد.