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
  5090bdf0_415c_709b_043f_c15807bda580["dialog-rtl.tsx"]
  c79cdc74_50fb_62bd_465f_35936d2c5eac["button"]
  5090bdf0_415c_709b_043f_c15807bda580 --> c79cdc74_50fb_62bd_465f_35936d2c5eac
  0fabc85c_f609_a911_991c_af3a73d35255["dialog"]
  5090bdf0_415c_709b_043f_c15807bda580 --> 0fabc85c_f609_a911_991c_af3a73d35255
  68874b2d_841d_f625_bf4f_104dc94b730e["field"]
  5090bdf0_415c_709b_043f_c15807bda580 --> 68874b2d_841d_f625_bf4f_104dc94b730e
  3d4e1aa6_8242_bf41_73c3_09dcaa04d08b["input"]
  5090bdf0_415c_709b_043f_c15807bda580 --> 3d4e1aa6_8242_bf41_73c3_09dcaa04d08b
  1694dbfa_4abe_3ae7_75bf_e2205e001104["label"]
  5090bdf0_415c_709b_043f_c15807bda580 --> 1694dbfa_4abe_3ae7_75bf_e2205e001104
  2c1404ab_bf28_6225_f9a0_b9e29400c66c["language-selector"]
  5090bdf0_415c_709b_043f_c15807bda580 --> 2c1404ab_bf28_6225_f9a0_b9e29400c66c
  style 5090bdf0_415c_709b_043f_c15807bda580 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

"use client"

import { Button } from "@/examples/radix/ui-rtl/button"
import {
  Dialog,
  DialogClose,
  DialogContent,
  DialogDescription,
  DialogFooter,
  DialogHeader,
  DialogTitle,
  DialogTrigger,
} from "@/examples/radix/ui-rtl/dialog"
import { Field, FieldGroup } from "@/examples/radix/ui-rtl/field"
import { Input } from "@/examples/radix/ui-rtl/input"
import { Label } from "@/examples/radix/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 asChild>
          <Button variant="outline">{t.openDialog}</Button>
        </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 asChild>
              <Button variant="outline">{t.cancel}</Button>
            </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/radix/dialog-rtl.tsx (domain: DocumentationAtlas, subdomain: ContentSourcing, directory: apps/v4/examples/radix).

Analyze Your Own Codebase

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

Try Supermodel Free