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

calendar-20.tsx — ui Source File

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

File tsx ComponentRegistry ChartRegistry 4 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  dc3f7ccd_b8bb_e271_ba9c_3470cde0c388["calendar-20.tsx"]
  1d141819_425e_b5fd_4c8e_32f7c6a42cf2["react"]
  dc3f7ccd_b8bb_e271_ba9c_3470cde0c388 --> 1d141819_425e_b5fd_4c8e_32f7c6a42cf2
  aa2f3ec6_f291_3763_88ec_65a3f5ad5939["button"]
  dc3f7ccd_b8bb_e271_ba9c_3470cde0c388 --> aa2f3ec6_f291_3763_88ec_65a3f5ad5939
  5000e233_363d_e409_8b5c_7e80d38646fe["calendar"]
  dc3f7ccd_b8bb_e271_ba9c_3470cde0c388 --> 5000e233_363d_e409_8b5c_7e80d38646fe
  95a7752f_4b97_5bde_5d7d_fca03536ac35["card"]
  dc3f7ccd_b8bb_e271_ba9c_3470cde0c388 --> 95a7752f_4b97_5bde_5d7d_fca03536ac35
  style dc3f7ccd_b8bb_e271_ba9c_3470cde0c388 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

"use client"

import * as React from "react"

import { Button } from "@/registry/new-york/ui/button"
import { Calendar } from "@/registry/new-york/ui/calendar"
import { Card, CardContent, CardFooter } from "@/registry/new-york/ui/card"

export default function Calendar20() {
  const [date, setDate] = React.useState<Date | undefined>(
    new Date(2025, 5, 12)
  )
  const [selectedTime, setSelectedTime] = React.useState<string | null>("10:00")
  const timeSlots = Array.from({ length: 37 }, (_, i) => {
    const totalMinutes = i * 15
    const hour = Math.floor(totalMinutes / 60) + 9
    const minute = totalMinutes % 60
    return `${hour.toString().padStart(2, "0")}:${minute
      .toString()
      .padStart(2, "0")}`
  })

  const bookedDates = Array.from(
    { length: 3 },
    (_, i) => new Date(2025, 5, 17 + i)
  )

  return (
    <Card className="gap-0 p-0">
      <CardContent className="relative p-0 md:pr-48">
        <div className="p-6">
          <Calendar
            mode="single"
            selected={date}
            onSelect={setDate}
            defaultMonth={date}
            disabled={bookedDates}
            showOutsideDays={false}
            modifiers={{
              booked: bookedDates,
            }}
            modifiersClassNames={{
              booked: "[&>button]:line-through opacity-100",
            }}
            className="bg-transparent p-0 [--cell-size:2.5rem] md:[--cell-size:3rem]"
            formatters={{
              formatWeekdayName: (date) => {
                return date.toLocaleString("en-US", { weekday: "short" })
              },
            }}
          />
        </div>
        <div className="no-scrollbar inset-y-0 right-0 flex max-h-72 w-full scroll-pb-6 flex-col gap-4 overflow-y-auto border-t p-6 md:absolute md:max-h-none md:w-48 md:border-l md:border-t-0">
          <div className="grid gap-2">
            {timeSlots.map((time) => (
              <Button
                key={time}
                variant={selectedTime === time ? "default" : "outline"}
                onClick={() => setSelectedTime(time)}
                className="w-full shadow-none"
              >
                {time}
              </Button>
            ))}
          </div>
        </div>
      </CardContent>
      <CardFooter className="flex flex-col gap-4 border-t !py-5 px-6 md:flex-row">
        <div className="text-sm">
          {date && selectedTime ? (
            <>
              Your meeting is booked for{" "}
              <span className="font-medium">
                {" "}
                {date?.toLocaleDateString("en-US", {
                  weekday: "long",
                  day: "numeric",
                  month: "long",
                })}{" "}
              </span>
              at <span className="font-medium">{selectedTime}</span>.
            </>
          ) : (
            <>Select a date and time for your meeting.</>
          )}
        </div>
        <Button
          disabled={!date || !selectedTime}
          className="w-full md:ml-auto md:w-auto"
          variant="outline"
        >
          Continue
        </Button>
      </CardFooter>
    </Card>
  )
}

Subdomains

Functions

Dependencies

  • button
  • calendar
  • card
  • react

Frequently Asked Questions

What does calendar-20.tsx do?
calendar-20.tsx is a source file in the ui codebase, written in tsx. It belongs to the ComponentRegistry domain, ChartRegistry subdomain.
What functions are defined in calendar-20.tsx?
calendar-20.tsx defines 1 function(s): Calendar20.
What does calendar-20.tsx depend on?
calendar-20.tsx imports 4 module(s): button, calendar, card, react.
Where is calendar-20.tsx in the architecture?
calendar-20.tsx is located at deprecated/www/__registry__/new-york/blocks/calendar-20.tsx (domain: ComponentRegistry, subdomain: ChartRegistry, directory: deprecated/www/__registry__/new-york/blocks).

Analyze Your Own Codebase

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

Try Supermodel Free