Home / File/ calendar.tsx — ui Source File

calendar.tsx — ui Source File

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

File tsx ComponentRegistry UIPrimitives 5 imports 2 functions

Entity Profile

Dependency Diagram

graph LR
  edd21417_30fd_cfb7_e874_6bdcfe63a324["calendar.tsx"]
  1d141819_425e_b5fd_4c8e_32f7c6a42cf2["react"]
  edd21417_30fd_cfb7_e874_6bdcfe63a324 --> 1d141819_425e_b5fd_4c8e_32f7c6a42cf2
  bfc8708c_7488_3983_8998_32b793781735["react-day-picker"]
  edd21417_30fd_cfb7_e874_6bdcfe63a324 --> bfc8708c_7488_3983_8998_32b793781735
  8ad666ec_1b20_adda_0392_87a60bdb3a68["utils"]
  edd21417_30fd_cfb7_e874_6bdcfe63a324 --> 8ad666ec_1b20_adda_0392_87a60bdb3a68
  7328fa0a_98b6_fe77_42fd_0d1582b24604["button"]
  edd21417_30fd_cfb7_e874_6bdcfe63a324 --> 7328fa0a_98b6_fe77_42fd_0d1582b24604
  de6fac54_74ca_6c25_8f8b_d1ba3287dbf2["icon-placeholder"]
  edd21417_30fd_cfb7_e874_6bdcfe63a324 --> de6fac54_74ca_6c25_8f8b_d1ba3287dbf2
  style edd21417_30fd_cfb7_e874_6bdcfe63a324 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

"use client"

import * as React from "react"
import {
  DayPicker,
  getDefaultClassNames,
  type DayButton,
  type Locale,
} from "react-day-picker"

import { cn } from "@/registry/bases/base/lib/utils"
import { Button, buttonVariants } from "@/registry/bases/base/ui/button"
import { IconPlaceholder } from "@/app/(create)/components/icon-placeholder"

function Calendar({
  className,
  classNames,
  showOutsideDays = true,
  captionLayout = "label",
  buttonVariant = "ghost",
  locale,
  formatters,
  components,
  ...props
}: React.ComponentProps<typeof DayPicker> & {
  buttonVariant?: React.ComponentProps<typeof Button>["variant"]
}) {
  const defaultClassNames = getDefaultClassNames()

  return (
    <DayPicker
      showOutsideDays={showOutsideDays}
      className={cn(
        "cn-calendar bg-background group/calendar in-data-[slot=card-content]:bg-transparent in-data-[slot=popover-content]:bg-transparent",
        String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
        String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
        className
      )}
      captionLayout={captionLayout}
      locale={locale}
      formatters={{
        formatMonthDropdown: (date) =>
          date.toLocaleString(locale?.code, { month: "short" }),
        ...formatters,
      }}
      classNames={{
        root: cn("w-fit", defaultClassNames.root),
        months: cn(
          "flex gap-4 flex-col md:flex-row relative",
          defaultClassNames.months
        ),
        month: cn("flex flex-col w-full gap-4", defaultClassNames.month),
        nav: cn(
          "flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between",
          defaultClassNames.nav
        ),
        button_previous: cn(
          buttonVariants({ variant: buttonVariant }),
          "size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",
          defaultClassNames.button_previous
// ... (186 more lines)

Subdomains

Dependencies

  • button
  • icon-placeholder
  • react
  • react-day-picker
  • utils

Frequently Asked Questions

What does calendar.tsx do?
calendar.tsx is a source file in the ui codebase, written in tsx. It belongs to the ComponentRegistry domain, UIPrimitives subdomain.
What functions are defined in calendar.tsx?
calendar.tsx defines 2 function(s): Calendar, CalendarDayButton.
What does calendar.tsx depend on?
calendar.tsx imports 5 module(s): button, icon-placeholder, react, react-day-picker, utils.
Where is calendar.tsx in the architecture?
calendar.tsx is located at apps/v4/registry/bases/base/ui/calendar.tsx (domain: ComponentRegistry, subdomain: UIPrimitives, directory: apps/v4/registry/bases/base/ui).

Analyze Your Own Codebase

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

Try Supermodel Free