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

calendar-rtl.tsx — ui Source File

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

File tsx DocumentationAtlas SearchAPI 4 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  992ea758_fb20_dd80_12d7_d07aaa9c65a5["calendar-rtl.tsx"]
  1d141819_425e_b5fd_4c8e_32f7c6a42cf2["react"]
  992ea758_fb20_dd80_12d7_d07aaa9c65a5 --> 1d141819_425e_b5fd_4c8e_32f7c6a42cf2
  d5e8c512_aeec_6ed6_0dbb_897351a21570["calendar"]
  992ea758_fb20_dd80_12d7_d07aaa9c65a5 --> d5e8c512_aeec_6ed6_0dbb_897351a21570
  dde83612_b728_e23b_d3a8_dccad8858873["locale"]
  992ea758_fb20_dd80_12d7_d07aaa9c65a5 --> dde83612_b728_e23b_d3a8_dccad8858873
  2c1404ab_bf28_6225_f9a0_b9e29400c66c["language-selector"]
  992ea758_fb20_dd80_12d7_d07aaa9c65a5 --> 2c1404ab_bf28_6225_f9a0_b9e29400c66c
  style 992ea758_fb20_dd80_12d7_d07aaa9c65a5 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

"use client"

import * as React from "react"
import { Calendar } from "@/examples/radix/ui-rtl/calendar"
import { arSA, he } from "react-day-picker/locale"

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

const translations: Translations = {
  en: {
    dir: "ltr",
    values: {},
  },
  ar: {
    dir: "rtl",
    values: {},
  },
  he: {
    dir: "rtl",
    values: {},
  },
}

const locales = {
  ar: arSA,
  he: he,
} as const

export function CalendarRtl() {
  const { dir, language } = useTranslation(translations, "ar")
  const [date, setDate] = React.useState<Date | undefined>(new Date())

  return (
    <Calendar
      mode="single"
      selected={date}
      onSelect={setDate}
      className="rounded-lg border [--cell-size:--spacing(9)]"
      captionLayout="dropdown"
      dir={dir}
      locale={
        dir === "rtl" ? locales[language as keyof typeof locales] : undefined
      }
    />
  )
}

Subdomains

Functions

Dependencies

  • calendar
  • language-selector
  • locale
  • react

Frequently Asked Questions

What does calendar-rtl.tsx do?
calendar-rtl.tsx is a source file in the ui codebase, written in tsx. It belongs to the DocumentationAtlas domain, SearchAPI subdomain.
What functions are defined in calendar-rtl.tsx?
calendar-rtl.tsx defines 1 function(s): CalendarRtl.
What does calendar-rtl.tsx depend on?
calendar-rtl.tsx imports 4 module(s): calendar, language-selector, locale, react.
Where is calendar-rtl.tsx in the architecture?
calendar-rtl.tsx is located at apps/v4/examples/radix/calendar-rtl.tsx (domain: DocumentationAtlas, subdomain: SearchAPI, 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