Home / File/ dialog-rtl.tsx — ui Source File

dialog-rtl.tsx — ui Source File

Architecture documentation for dialog-rtl.tsx, a tsx file in the ui codebase. 6 imports, 0 dependents.

File tsx DocumentationAtlas ContentSourcing 6 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  c42e91c3_604e_8ded_ff41_545df21c1395["dialog-rtl.tsx"]
  43bb9fc1_6eab_13df_a99b_981eb13b9ec1["button"]
  c42e91c3_604e_8ded_ff41_545df21c1395 --> 43bb9fc1_6eab_13df_a99b_981eb13b9ec1
  ef356dc8_3581_3cd6_6d52_5bd9073b4f5e["dialog"]
  c42e91c3_604e_8ded_ff41_545df21c1395 --> ef356dc8_3581_3cd6_6d52_5bd9073b4f5e
  7e9c1e20_5a8a_4152_90a3_40c280dc340e["field"]
  c42e91c3_604e_8ded_ff41_545df21c1395 --> 7e9c1e20_5a8a_4152_90a3_40c280dc340e
  480dda64_480e_8d00_f8b9_f67f82fb7c4b["input"]
  c42e91c3_604e_8ded_ff41_545df21c1395 --> 480dda64_480e_8d00_f8b9_f67f82fb7c4b
  7ef314f6_7093_dcb4_c528_ee12b9a57e00["label"]
  c42e91c3_604e_8ded_ff41_545df21c1395 --> 7ef314f6_7093_dcb4_c528_ee12b9a57e00
  2c1404ab_bf28_6225_f9a0_b9e29400c66c["language-selector"]
  c42e91c3_604e_8ded_ff41_545df21c1395 --> 2c1404ab_bf28_6225_f9a0_b9e29400c66c
  style c42e91c3_604e_8ded_ff41_545df21c1395 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

"use client"

import { Button } from "@/examples/base/ui-rtl/button"
import {
  Dialog,
  DialogClose,
  DialogContent,
  DialogDescription,
  DialogFooter,
  DialogHeader,
  DialogTitle,
  DialogTrigger,
} from "@/examples/base/ui-rtl/dialog"
import { Field, FieldGroup } from "@/examples/base/ui-rtl/field"
import { Input } from "@/examples/base/ui-rtl/input"
import { Label } from "@/examples/base/ui-rtl/label"

import {
  useTranslation,
  type Translations,
} from "@/components/language-selector"

const translations: Translations = {
  en: {
    dir: "ltr",
    values: {
      openDialog: "Open Dialog",
      editProfile: "Edit profile",
      description:
        "Make changes to your profile here. Click save when you're done.",
      name: "Name",
      username: "Username",
      cancel: "Cancel",
      saveChanges: "Save changes",
    },
  },
  ar: {
    dir: "rtl",
    values: {
      openDialog: "فتح الحوار",
      editProfile: "تعديل الملف الشخصي",
      description:
        "قم بإجراء تغييرات على ملفك الشخصي هنا. انقر فوق حفظ عند الانتهاء.",
      name: "الاسم",
      username: "اسم المستخدم",
      cancel: "إلغاء",
      saveChanges: "حفظ التغييرات",
    },
  },
  he: {
    dir: "rtl",
    values: {
      openDialog: "פתח דיאלוג",
      editProfile: "ערוך פרופיל",
      description: "בצע שינויים בפרופיל שלך כאן. לחץ על שמור כשתסיים.",
      name: "שם",
      username: "שם משתמש",
      cancel: "בטל",
      saveChanges: "שמור שינויים",
    },
  },
}

export function DialogRtl() {
  const { dir, t, language } = useTranslation(translations, "ar")

  return (
    <Dialog>
      <form>
        <DialogTrigger render={<Button variant="outline" />}>
          {t.openDialog}
        </DialogTrigger>
        <DialogContent
          className="sm:max-w-sm"
          dir={dir}
          data-lang={dir === "rtl" ? language : undefined}
        >
          <DialogHeader>
            <DialogTitle>{t.editProfile}</DialogTitle>
            <DialogDescription>{t.description}</DialogDescription>
          </DialogHeader>
          <FieldGroup>
            <Field>
              <Label htmlFor="name-1">{t.name}</Label>
              <Input id="name-1" name="name" defaultValue="Pedro Duarte" />
            </Field>
            <Field>
              <Label htmlFor="username-1">{t.username}</Label>
              <Input id="username-1" name="username" defaultValue="@peduarte" />
            </Field>
          </FieldGroup>
          <DialogFooter>
            <DialogClose render={<Button variant="outline" />}>
              {t.cancel}
            </DialogClose>
            <Button type="submit">{t.saveChanges}</Button>
          </DialogFooter>
        </DialogContent>
      </form>
    </Dialog>
  )
}

Subdomains

Functions

Dependencies

  • button
  • dialog
  • field
  • input
  • label
  • language-selector

Frequently Asked Questions

What does dialog-rtl.tsx do?
dialog-rtl.tsx is a source file in the ui codebase, written in tsx. It belongs to the DocumentationAtlas domain, ContentSourcing subdomain.
What functions are defined in dialog-rtl.tsx?
dialog-rtl.tsx defines 1 function(s): DialogRtl.
What does dialog-rtl.tsx depend on?
dialog-rtl.tsx imports 6 module(s): button, dialog, field, input, label, language-selector.
Where is dialog-rtl.tsx in the architecture?
dialog-rtl.tsx is located at apps/v4/examples/base/dialog-rtl.tsx (domain: DocumentationAtlas, subdomain: ContentSourcing, directory: apps/v4/examples/base).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free