calendar-01
Loading...
"use client"
import { Calendar } from "@/components/ui/calendar"
export function CalendarBasic() {
return <Calendar mode="single" className="rounded-lg border" />
}
calendar-02
Loading...
"use client"
import { Calendar } from "@/components/ui/calendar"
import * as React from "react"
import { addDays } from "date-fns"
import { type DateRange } from "react-day-picker"
import { Card, CardContent } from "@/components/ui/card"
export function CalendarRange() {
const [dateRange, setDateRange] = React.useState<DateRange | undefined>(() => {
const today = new Date()
const startDate = new Date(today.getFullYear(), 0, 12)
return {
from: startDate,
to: addDays(startDate, 30),
}
})
return (
<Card className="w-fit">
<CardContent className="p-4">
<Calendar
mode="range"
defaultMonth={dateRange?.from}
selected={dateRange}
onSelect={setDateRange}
numberOfMonths={2}
className="rounded-lg border"
/>
</CardContent>
</Card>
)
}calendar-03
Loading...
"use client"
import { Calendar } from "@/components/ui/calendar"
export function CalendarCaption() {
return (
<Calendar
mode="single"
captionLayout="dropdown"
className="rounded-lg border"
/>
)
}calendar-04
Loading...
"use client"
import { Calendar } from "@/components/ui/calendar"
import * as React from "react"
import { addDays } from "date-fns"
import { Button } from "@/components/ui/button"
import { Card, CardContent, CardFooter } from "@/components/ui/card"
export function CalendarWithPresets() {
const [date, setDate] = React.useState<Date | undefined>(
new Date(new Date().getFullYear(), 1, 12)
)
const [currentMonth, setCurrentMonth] = React.useState<Date>(
new Date(new Date().getFullYear(), new Date().getMonth(), 1)
)
return (
<Card className="mx-auto w-fit max-w-[300px]" size="sm">
<CardContent>
<Calendar
mode="single"
selected={date}
onSelect={setDate}
month={currentMonth}
onMonthChange={setCurrentMonth}
fixedWeeks
className="p-0 [--cell-size:--spacing(9.5)]"
/>
</CardContent>
<CardFooter className="flex flex-wrap gap-2 border-t">
{[
{ label: "Today", value: 0 },
{ label: "Tomorrow", value: 1 },
{ label: "In 3 days", value: 3 },
{ label: "In a week", value: 7 },
{ label: "In 2 weeks", value: 14 },
].map((preset) => (
<Button
key={preset.value}
variant="outline"
size="sm"
className="flex-1"
onClick={() => {
const newDate = addDays(new Date(), preset.value)
setDate(newDate)
setCurrentMonth(
new Date(newDate.getFullYear(), newDate.getMonth(), 1)
)
}}
>
{preset.label}
</Button>
))}
</CardFooter>
</Card>
)
}
calendar-05
Loading...
"use client"
import { Calendar } from "@/components/ui/calendar"
import * as React from "react"
import { Card, CardContent, CardFooter } from "@/components/ui/card"
import {
Clock2 as Clock2Icon,
} from "@designali/icons"
import { Field, FieldGroup, FieldLabel } from "@/components/ui/field"
import {
InputGroup,
InputGroupAddon,
InputGroupInput,
} from "@/components/ui/input-group"
export function CalendarWithTime() {
const [date, setDate] = React.useState<Date | undefined>(
new Date(new Date().getFullYear(), new Date().getMonth(), 12)
)
return (
<Card size="sm" className="mx-auto w-fit">
<CardContent>
<Calendar
mode="single"
selected={date}
onSelect={setDate}
className="p-0"
/>
</CardContent>
<CardFooter className="border-t bg-card">
<FieldGroup>
<Field>
<FieldLabel htmlFor="time-from">Start Time</FieldLabel>
<InputGroup>
<InputGroupInput
id="time-from"
type="time"
step="1"
defaultValue="10:30:00"
className="appearance-none [&::-webkit-calendar-picker-indicator]:hidden [&::-webkit-calendar-picker-indicator]:appearance-none"
/>
<InputGroupAddon>
<Clock2Icon className="text-muted-foreground" />
</InputGroupAddon>
</InputGroup>
</Field>
<Field>
<FieldLabel htmlFor="time-to">End Time</FieldLabel>
<InputGroup>
<InputGroupInput
id="time-to"
type="time"
step="1"
defaultValue="12:30:00"
className="appearance-none [&::-webkit-calendar-picker-indicator]:hidden [&::-webkit-calendar-picker-indicator]:appearance-none"
/>
<InputGroupAddon>
<Clock2Icon className="text-muted-foreground" />
</InputGroupAddon>
</InputGroup>
</Field>
</FieldGroup>
</CardFooter>
</Card>
)
}
calendar-06
Loading...
"use client"
import { Calendar } from "@/components/ui/calendar"
import * as React from "react"
import { Card, CardContent, CardFooter } from "@/components/ui/card"
export function CalendarBookedDates() {
const [date, setDate] = React.useState<Date | undefined>(
new Date(new Date().getFullYear(), 0, 6)
)
const bookedDates = Array.from(
{ length: 15 },
(_, i) => new Date(new Date().getFullYear(), 0, 12 + i)
)
return (
<Card className="mx-auto w-fit p-0">
<CardContent className="p-0">
<Calendar
mode="single"
defaultMonth={date}
selected={date}
onSelect={setDate}
disabled={bookedDates}
modifiers={{
booked: bookedDates,
}}
modifiersClassNames={{
booked: "[&>button]:line-through opacity-100",
}}
/>
</CardContent>
</Card>
)
}
calendar-07
Loading...
"use client"
import { Calendar, CalendarDayButton } from "@/components/ui/calendar"
import * as React from "react"
import { Card, CardContent } from "@/components/ui/card"
import { addDays } from "date-fns"
import { type DateRange } from "react-day-picker"
export function CalendarCustomDays() {
const [range, setRange] = React.useState<DateRange | undefined>({
from: new Date(new Date().getFullYear(), 11, 8),
to: addDays(new Date(new Date().getFullYear(), 11, 8), 10),
})
return (
<Card className="mx-auto w-fit p-0">
<CardContent className="p-0">
<Calendar
mode="range"
defaultMonth={range?.from}
selected={range}
onSelect={setRange}
numberOfMonths={1}
captionLayout="dropdown"
className="[--cell-size:--spacing(10)] md:[--cell-size:--spacing(12)]"
formatters={{
formatMonthDropdown: (date) => {
return date.toLocaleString("default", { month: "long" })
},
}}
components={{
DayButton: ({ children, modifiers, day, ...props }) => {
const isWeekend =
day.date.getDay() === 0 || day.date.getDay() === 6
return (
<CalendarDayButton day={day} modifiers={modifiers} {...props}>
{children}
{!modifiers.outside && (
<span>{isWeekend ? "$120" : "$100"}</span>
)}
</CalendarDayButton>
)
},
}}
/>
</CardContent>
</Card>
)
}
calendar-08
Loading...
"use client"
import { Calendar } from "@/components/ui/calendar"
import * as React from "react"
import { Card, CardContent } from "@/components/ui/card"
export function CalendarWeekNumbers() {
const [date, setDate] = React.useState<Date | undefined>(
new Date(new Date().getFullYear(), 0, 12)
)
return (
<Card className="mx-auto w-fit p-0">
<CardContent className="p-0">
<Calendar
mode="single"
defaultMonth={date}
selected={date}
onSelect={setDate}
showWeekNumber
/>
</CardContent>
</Card>
)
}
calendar-09
Loading...
"use client"
import * as React from "react"
import { format } from "date-fns"
import { Calendar } from "@/components/ui/calendar"
export function PublishDateRequired() {
const [date, setDate] = React.useState(() => new Date())
return (
<div className="flex w-full max-w-xs flex-col items-center gap-3">
<Calendar
mode="single"
required
selected={date}
onSelect={setDate}
className="border"
/>
<p className="text-center text-xs text-muted-foreground">
Designali blog post scheduled to publish on{" "}
<span className="font-medium text-foreground">
{format(date, "EEEE, MMMM d")}
</span>
</p>
</div>
)
}
calendar-10
Loading...
"use client"
import * as React from "react"
import { addDays, format, isSameDay } from "date-fns"
import {
X as XIcon,
} from "@designali/icons"
import { Badge } from "@/components/ui/badge"
import { Button } from "@/components/ui/button"
import { Calendar } from "@/components/ui/calendar"
import {
Card,
CardContent,
CardDescription,
CardFooter,
CardHeader,
CardTitle,
} from "@/components/ui/card"
const today = new Date()
export function MeetingPollDates() {
const [dates, setDates] = React.useState<Date[]>([
addDays(today, 2),
addDays(today, 4),
])
const sorted = [...dates].sort((a, b) => a.getTime() - b.getTime())
return (
<Card className="w-full max-w-xs">
<CardHeader>
<CardTitle>Propose design review dates</CardTitle>
<CardDescription>
Pick up to 5 options for the Designali team to vote on.
</CardDescription>
</CardHeader>
<CardContent className="flex flex-col items-center gap-3">
<Calendar
mode="multiple"
max={5}
selected={dates}
onSelect={(next) => setDates(next ?? [])}
disabled={{ before: today }}
className="p-0"
/>
<div className="flex min-h-6 w-full flex-wrap gap-1.5">
{sorted.length === 0 ? (
<span className="text-xs text-muted-foreground">
No dates selected yet.
</span>
) : null}
{sorted.map((d) => (
<Badge
key={d.toISOString()}
variant="secondary"
className="gap-1 pe-1"
>
{format(d, "EEE, MMM d")}
<button
type="button"
aria-label={"Remove " + format(d, "MMM d")}
onClick={() => setDates(dates.filter((x) => !isSameDay(x, d)))}
className="text-muted-foreground hover:text-foreground"
>
<XIcon className="size-3" />
</button>
</Badge>
))}
</div>
</CardContent>
<CardFooter className="justify-between">
<span className="text-xs text-muted-foreground">
{dates.length}/5 selected
</span>
<Button size="sm" disabled={dates.length < 2}>
Send poll
</Button>
</CardFooter>
</Card>
)
}
calendar-11
Loading...
"use client"
import * as React from "react"
import { addDays, differenceInCalendarDays, format } from "date-fns"
import { type DateRange } from "react-day-picker"
import { Badge } from "@/components/ui/badge"
import { Button } from "@/components/ui/button"
import { Calendar } from "@/components/ui/calendar"
import {
Card,
CardAction,
CardContent,
CardDescription,
CardFooter,
CardHeader,
CardTitle,
} from "@/components/ui/card"
const today = new Date()
const rate = 189
export function HotelStayRange() {
const [range, setRange] = React.useState<DateRange | undefined>({
from: addDays(today, 7),
to: addDays(today, 10),
})
const nights =
range?.from && range?.to
? differenceInCalendarDays(range.to, range.from)
: 0
return (
<Card className="w-full max-w-xs">
<CardHeader>
<CardTitle>Designali design sprint</CardTitle>
<CardDescription>Minimum 2 days, maximum 14.</CardDescription>
<CardAction>
<Badge variant="outline">{"$" + rate} / day</Badge>
</CardAction>
</CardHeader>
<CardContent className="flex justify-center">
<Calendar
mode="range"
min={2}
max={14}
selected={range}
onSelect={setRange}
defaultMonth={range?.from}
disabled={{ before: today }}
excludeDisabled
className="p-0"
/>
</CardContent>
<CardFooter className="flex-col items-stretch gap-3">
<div className="flex items-center justify-between text-xs">
<span className="text-muted-foreground">
{range?.from && range?.to
? format(range.from, "MMM d") + " - " + format(range.to, "MMM d")
: "Select sprint start and end"}
</span>
<span className="font-medium">
{nights} {nights === 1 ? "day" : "days"} ยท{" "}
{"$" + (nights * rate).toLocaleString()}
</span>
</div>
<Button disabled={nights < 2}>Book sprint</Button>
</CardFooter>
</Card>
)
}
calendar-12
Loading...
"use client"
import * as React from "react"
import { addDays, format, isWeekend } from "date-fns"
import {
Truck as TruckIcon,
} from "@designali/icons"
import { Button } from "@/components/ui/button"
import { Calendar } from "@/components/ui/calendar"
import {
Card,
CardContent,
CardDescription,
CardFooter,
CardHeader,
CardTitle,
} from "@/components/ui/card"
const today = new Date()
function firstDeliveryDay() {
let d = addDays(today, 2)
while (isWeekend(d)) d = addDays(d, 1)
return d
}
const holidays = [addDays(today, 9), addDays(today, 10)]
export function DeliveryDateCheckout() {
const [date, setDate] = React.useState<undefined | Date>(firstDeliveryDay)
return (
<Card className="w-full max-w-xs">
<CardHeader>
<CardTitle className="flex items-center gap-2">
<TruckIcon className="size-4 text-muted-foreground" />
Choose handoff date
</CardTitle>
<CardDescription>
Weekdays only. The Designali studio is closed on public holidays.
</CardDescription>
</CardHeader>
<CardContent className="flex justify-center">
<Calendar
mode="single"
selected={date}
onSelect={setDate}
disabled={[
{ before: addDays(today, 2) },
{ dayOfWeek: [0, 6] },
...holidays,
]}
modifiers={{ holiday: holidays }}
modifiersClassNames={{ holiday: "[&>button]:line-through" }}
className="p-0"
/>
</CardContent>
<CardFooter className="justify-between gap-2">
<div className="grid gap-0.5">
<span className="text-muted-foreground">Files delivered</span>
<span className="font-medium">
{date ? format(date, "EEEE, MMM d") : "No date selected"}
</span>
</div>
<Button size="sm" disabled={!date}>
Continue
</Button>
</CardFooter>
</Card>
)
}
calendar-13
Loading...
"use client"
import * as React from "react"
import { addDays, format, startOfMonth } from "date-fns"
import {
Info as InfoIcon,
} from "@designali/icons"
import { Button } from "@/components/ui/button"
import { Calendar } from "@/components/ui/calendar"
const today = new Date()
const lastDay = addDays(today, 30)
export function AppointmentWindow() {
const [date, setDate] = React.useState<undefined | Date>()
return (
<div className="flex w-full max-w-xs flex-col gap-3">
<div className="flex items-start gap-2 border bg-muted/40 p-3 text-xs">
<InfoIcon className="mt-0.5 size-4 shrink-0 text-muted-foreground" />
<p>
Discovery calls with Ali Imam open up to 30 days ahead, until{" "}
<span className="font-medium">{format(lastDay, "MMMM d")}</span>.
</p>
</div>
<Calendar
mode="single"
selected={date}
onSelect={setDate}
startMonth={startOfMonth(today)}
endMonth={lastDay}
disabled={[{ before: today }, { after: lastDay }]}
className="self-center border"
/>
<Button disabled={!date}>
{date ? "Book for " + format(date, "MMM d") : "Select a day"}
</Button>
</div>
)
}
calendar-14
Loading...
"use client"
import * as React from "react"
import { format } from "date-fns"
import {
Calendar as CalendarIcon,
} from "@designali/icons"
import { Button } from "@/components/ui/button"
import { Calendar } from "@/components/ui/calendar"
import {
Field,
FieldDescription,
FieldLabel,
} from "@/components/ui/field"
import {
Popover,
PopoverContent,
PopoverTrigger,
} from "@/components/ui/popover"
export function InvoiceDatePopover() {
const [open, setOpen] = React.useState(false)
const [date, setDate] = React.useState<undefined | Date>()
return (
<Field className="w-full max-w-60">
<FieldLabel htmlFor="invoice-date">Invoice date</FieldLabel>
<Popover open={open} onOpenChange={setOpen}>
<PopoverTrigger
render={
<Button
id="invoice-date"
variant="outline"
className="w-full justify-start font-normal"
/>
}
>
<CalendarIcon data-icon="inline-start" />
{date ? (
format(date, "PPP")
) : (
<span className="text-muted-foreground">Pick a date</span>
)}
</PopoverTrigger>
<PopoverContent className="w-auto p-0" align="start">
<Calendar
mode="single"
selected={date}
defaultMonth={date}
onSelect={(next) => {
setDate(next)
setOpen(false)
}}
/>
</PopoverContent>
</Popover>
<FieldDescription>Shown on the Designali invoice PDF sent to your client.</FieldDescription>
</Field>
)
}
calendar-15
Loading...
"use client"
import * as React from "react"
import { format, subDays } from "date-fns"
import { type DateRange } from "react-day-picker"
import {
CalendarRange as CalendarRangeIcon,
ChevronDown as ChevronDownIcon,
} from "@designali/icons"
import { Button } from "@/components/ui/button"
import { Calendar } from "@/components/ui/calendar"
import {
Popover,
PopoverContent,
PopoverTrigger,
} from "@/components/ui/popover"
const today = new Date()
export function ReportRangePopover() {
const [range, setRange] = React.useState<DateRange | undefined>({
from: subDays(today, 13),
to: today,
})
const label = range?.from
? range.to
? format(range.from, "MMM d") + " - " + format(range.to, "MMM d, yyyy")
: format(range.from, "MMM d, yyyy")
: "Select period"
return (
<div className="flex w-full max-w-xs flex-col gap-2">
<span className="text-xs font-medium">Reporting period</span>
<Popover>
<PopoverTrigger
render={
<Button
variant="outline"
className="w-full justify-between font-normal"
/>
}
>
<span className="flex items-center gap-2">
<CalendarRangeIcon className="size-4 text-muted-foreground" />
{label}
</span>
<ChevronDownIcon className="size-4 text-muted-foreground" />
</PopoverTrigger>
<PopoverContent className="w-auto p-0" align="start">
<Calendar
mode="range"
numberOfMonths={2}
defaultMonth={range?.from}
selected={range}
onSelect={setRange}
disabled={{ after: today }}
/>
</PopoverContent>
</Popover>
</div>
)
}
calendar-16
Loading...
"use client"
import * as React from "react"
import { differenceInYears, format } from "date-fns"
import {
Cake as CakeIcon,
} from "@designali/icons"
import { Button } from "@/components/ui/button"
import { Calendar } from "@/components/ui/calendar"
import {
Field,
FieldDescription,
FieldLabel,
} from "@/components/ui/field"
import {
Popover,
PopoverContent,
PopoverTrigger,
} from "@/components/ui/popover"
const today = new Date()
export function DateOfBirthPicker() {
const [date, setDate] = React.useState<undefined | Date>(
new Date(1994, 5, 18)
)
return (
<Field className="w-full max-w-60">
<FieldLabel htmlFor="dob">Date of birth</FieldLabel>
<Popover>
<PopoverTrigger
render={
<Button
id="dob"
variant="outline"
className="w-full justify-between font-normal"
/>
}
>
{date ? format(date, "MMMM d, yyyy") : "Select date"}
<CakeIcon className="size-4 text-muted-foreground" />
</PopoverTrigger>
<PopoverContent className="w-auto p-0" align="start">
<Calendar
mode="single"
captionLayout="dropdown"
selected={date}
onSelect={setDate}
defaultMonth={date}
startMonth={new Date(1930, 0)}
endMonth={today}
disabled={{ after: today }}
/>
</PopoverContent>
</Popover>
<FieldDescription>
{date
? "You are " + differenceInYears(today, date) + " years old."
: "Used to verify your age."}
</FieldDescription>
</Field>
)
}
calendar-17
Loading...
"use client"
import * as React from "react"
import { Calendar } from "@/components/ui/calendar"
import {
ToggleGroup,
ToggleGroupItem,
} from "@/components/ui/toggle-group"
const layouts = [
{ value: "label", label: "Label" },
{ value: "dropdown", label: "Both" },
{ value: "dropdown-months", label: "Month" },
{ value: "dropdown-years", label: "Year" },
] as const
type Layout = (typeof layouts)[number]["value"]
export function CaptionLayoutSwitcher() {
const [layout, setLayout] = React.useState<Layout>("dropdown")
const year = new Date().getFullYear()
return (
<div className="flex w-full max-w-xs flex-col items-center gap-3">
<ToggleGroup
variant="outline"
size="sm"
value={[layout]}
onValueChange={(value) => {
if (value[0]) setLayout(value[0] as Layout)
}}
>
{layouts.map((item) => (
<ToggleGroupItem key={item.value} value={item.value}>
{item.label}
</ToggleGroupItem>
))}
</ToggleGroup>
<Calendar
mode="single"
animate
captionLayout={layout}
startMonth={new Date(year - 10, 0)}
endMonth={new Date(year + 5, 11)}
className="border"
/>
</div>
)
}
calendar-18
Loading...
"use client"
import * as React from "react"
import { Calendar } from "@/components/ui/calendar"
import {
NativeSelect,
NativeSelectOption,
} from "@/components/ui/native-select"
const options = [
{ value: "0", label: "Sunday", region: "United States, Canada" },
{ value: "1", label: "Monday", region: "Europe, ISO 8601" },
{ value: "6", label: "Saturday", region: "Middle East" },
]
export function WeekStartSwitcher() {
const [start, setStart] = React.useState("1")
const current = options.find((o) => o.value === start)!
return (
<div className="flex w-full max-w-xs flex-col gap-3">
<div className="flex items-center justify-between gap-2">
<div className="grid">
<span className="text-xs font-medium">Week starts on</span>
<span className="text-xs text-muted-foreground">
{current.region}
</span>
</div>
<NativeSelect
size="sm"
value={start}
onChange={(e) => setStart(e.target.value)}
aria-label="Week starts on"
>
{options.map((o) => (
<NativeSelectOption key={o.value} value={o.value}>
{o.label}
</NativeSelectOption>
))}
</NativeSelect>
</div>
<Calendar
mode="single"
weekStartsOn={Number(start) as 0 | 1 | 6}
className="self-center border"
/>
</div>
)
}
calendar-19
Loading...
"use client"
import * as React from "react"
import { de, enUS, es, fr, ja } from "react-day-picker/locale"
import {
Languages as LanguagesIcon,
} from "@designali/icons"
import { Calendar } from "@/components/ui/calendar"
import {
NativeSelect,
NativeSelectOption,
} from "@/components/ui/native-select"
const locales = { enUS, es, fr, de, ja }
type LocaleKey = keyof typeof locales
const languages: { value: LocaleKey; label: string }[] = [
{ value: "enUS", label: "English" },
{ value: "es", label: "Espaรฑol" },
{ value: "fr", label: "Franรงais" },
{ value: "de", label: "Deutsch" },
{ value: "ja", label: "ๆฅๆฌ่ช" },
]
export function LocalizedCalendar() {
const [lang, setLang] = React.useState<LocaleKey>("fr")
const [date, setDate] = React.useState<undefined | Date>(() => new Date())
const locale = locales[lang]
return (
<div className="flex w-full max-w-xs flex-col gap-3">
<div className="flex items-center justify-between gap-2">
<span className="flex items-center gap-1.5 text-xs font-medium">
<LanguagesIcon className="size-4 text-muted-foreground" />
Display language
</span>
<NativeSelect
size="sm"
value={lang}
onChange={(e) => setLang(e.target.value as LocaleKey)}
aria-label="Language"
>
{languages.map((l) => (
<NativeSelectOption key={l.value} value={l.value}>
{l.label}
</NativeSelectOption>
))}
</NativeSelect>
</div>
<Calendar
mode="single"
locale={locale}
selected={date}
onSelect={setDate}
className="self-center border"
/>
<p className="text-center text-xs text-muted-foreground">
{date
? date.toLocaleDateString(locale.code, { dateStyle: "full" })
: "โ"}
</p>
</div>
)
}
calendar-20
Loading...
"use client"
import * as React from "react"
import { arSA } from "react-day-picker/locale"
import { Calendar } from "@/components/ui/calendar"
export function ArabicRtlCalendar() {
const [date, setDate] = React.useState<undefined | Date>(() => new Date())
return (
<div className="flex w-full max-w-xs flex-col items-center gap-2">
<Calendar
mode="single"
dir="rtl"
locale={arSA}
numerals="arab"
selected={date}
onSelect={setDate}
className="border"
/>
<span className="text-xs text-muted-foreground">
Right-to-left layout ยท Arabic numerals
</span>
</div>
)
}
calendar-21
Loading...
"use client"
import * as React from "react"
import { Calendar, CalendarDayButton } from "@/components/ui/calendar"
import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@/components/ui/card"
import { cn } from "@/lib/utils"
const levels = [
{ key: "open", label: "Open", dot: "bg-primary" },
{ key: "limited", label: "Limited", dot: "bg-primary" },
{ key: "full", label: "Full", dot: "bg-primary" },
]
function levelFor(date: Date) {
const n = (date.getDate() * 7 + date.getMonth()) % 5
return n < 3 ? levels[0]! : n === 3 ? levels[1]! : levels[2]!
}
function AvailabilityDayButton({
children,
day,
modifiers,
...props
}: React.ComponentProps<typeof CalendarDayButton>) {
const level = levelFor(day.date)
return (
<CalendarDayButton day={day} modifiers={modifiers} {...props}>
{children}
{!modifiers.outside && !modifiers.disabled ? (
<span className={cn("size-1 rounded-full opacity-100!", level.dot)} />
) : null}
</CalendarDayButton>
)
}
export function StudioAvailabilityDots() {
const [date, setDate] = React.useState<undefined | Date>()
const today = React.useMemo(() => new Date(), [])
return (
<Card className="w-fit">
<CardHeader>
<CardTitle>Designali studio sessions</CardTitle>
<CardDescription>
Dots show how many design review slots remain.
</CardDescription>
</CardHeader>
<CardContent className="flex flex-col items-center gap-3">
<Calendar
mode="single"
selected={date}
onSelect={setDate}
disabled={[{ before: today }, (d) => levelFor(d).key === "full"]}
components={{ DayButton: AvailabilityDayButton }}
className="p-0 [--cell-size:--spacing(9)]"
/>
<div className="flex gap-4 text-xs text-muted-foreground">
{levels.map((l) => (
<span key={l.key} className="flex items-center gap-1.5">
<span className={cn("size-1.5 rounded-full", l.dot)} />
{l.label}
</span>
))}
</div>
</CardContent>
</Card>
)
}
calendar-22
Loading...
"use client"
import * as React from "react"
import { format, isSameDay } from "date-fns"
import { Calendar } from "@/components/ui/calendar"
import { Card, CardContent } from "@/components/ui/card"
import { cn } from "@/lib/utils"
const base = new Date()
const y = base.getFullYear()
const m = base.getMonth()
const events = [
{
date: new Date(y, m, 4),
time: "09:30",
title: "Design review",
tone: "bg-primary",
},
{
date: new Date(y, m, 4),
time: "14:00",
title: "1:1 with Ali Imam",
tone: "bg-primary",
},
{
date: new Date(y, m, 11),
time: "11:00",
title: "Blocks sprint planning",
tone: "bg-primary",
},
{
date: new Date(y, m, 17),
time: "16:30",
title: "Client call: brand identity kickoff",
tone: "bg-primary",
},
{
date: new Date(y, m, 22),
time: "10:00",
title: "designali.com roadmap",
tone: "bg-primary",
},
{
date: new Date(y, m, 22),
time: "13:00",
title: "Studio lunch",
tone: "bg-primary",
},
]
export function EventsAgenda() {
const [date, setDate] = React.useState(new Date(y, m, 4))
const dayEvents = events.filter((e) => isSameDay(e.date, date))
return (
<Card className="w-fit max-w-full">
<CardContent className="flex flex-col gap-4">
<Calendar
mode="single"
required
selected={date}
onSelect={setDate}
modifiers={{ hasEvent: events.map((e) => e.date) }}
modifiersClassNames={{
hasEvent:
"[&>button]:after:absolute [&>button]:after:bottom-1 [&>button]:after:size-1 [&>button]:after:rounded-full [&>button]:after:bg-primary [&>button[data-selected-single=true]]:after:bg-primary-foreground",
}}
className="p-0"
/>
<div className="grid gap-2 border-t pt-3">
<span className="text-xs font-medium">
{format(date, "EEEE, MMMM d")}
</span>
{dayEvents.length === 0 ? (
<span className="text-xs text-muted-foreground">
Nothing scheduled.
</span>
) : (
dayEvents.map((e) => (
<div key={e.title} className="flex items-center gap-2 text-xs">
<span className={cn("h-4 w-0.5", e.tone)} />
<span className="w-10 text-muted-foreground tabular-nums">
{e.time}
</span>
<span>{e.title}</span>
</div>
))
)}
</div>
</CardContent>
</Card>
)
}
calendar-23
Loading...
"use client"
import * as React from "react"
import { addDays, format } from "date-fns"
import { type DateRange } from "react-day-picker"
import {
Plane as PlaneIcon,
} from "@designali/icons"
import { Calendar } from "@/components/ui/calendar"
import {
Card,
CardContent,
CardHeader,
CardTitle,
} from "@/components/ui/card"
import {
Tabs,
TabsContent,
TabsList,
TabsTrigger,
} from "@/components/ui/tabs"
const today = new Date()
export function FlightTripDates() {
const [departure, setDeparture] = React.useState<undefined | Date>(
addDays(today, 14)
)
const [trip, setTrip] = React.useState<DateRange | undefined>({
from: addDays(today, 14),
to: addDays(today, 21),
})
return (
<Card className="w-fit max-w-full">
<CardHeader>
<CardTitle className="flex items-center gap-2">
<PlaneIcon className="size-4 text-muted-foreground" />
Designali client workshop trip
</CardTitle>
</CardHeader>
<CardContent>
<Tabs defaultValue="round">
<TabsList>
<TabsTrigger value="round">Round trip</TabsTrigger>
<TabsTrigger value="oneway">One way</TabsTrigger>
</TabsList>
<TabsContent value="round" className="flex flex-col gap-2">
<Calendar
mode="range"
numberOfMonths={2}
pagedNavigation
selected={trip}
onSelect={setTrip}
defaultMonth={trip?.from}
disabled={{ before: today }}
className="p-0"
/>
<p className="text-xs text-muted-foreground">
{trip?.from && trip?.to
? "Depart " +
format(trip.from, "EEE, MMM d") +
" ยท Return " +
format(trip.to, "EEE, MMM d")
: "Select departure and return"}
</p>
</TabsContent>
<TabsContent value="oneway" className="flex flex-col gap-2">
<Calendar
mode="single"
selected={departure}
onSelect={setDeparture}
defaultMonth={departure}
disabled={{ before: today }}
className="p-0"
/>
<p className="text-xs text-muted-foreground">
{departure
? "Depart " + format(departure, "EEE, MMM d")
: "Select departure"}
</p>
</TabsContent>
</Tabs>
</CardContent>
</Card>
)
}
calendar-24
Loading...
"use client"
import * as React from "react"
import { Calendar } from "@/components/ui/calendar"
import { cn } from "@/lib/utils"
const upcoming = [
{ time: "10:00", title: "Studio standup", tone: "bg-primary" },
{ time: "13:30", title: "Icons library sync", tone: "bg-primary" },
{ time: "17:00", title: "Templates release go/no-go", tone: "bg-primary" },
]
export function CompactSidebarCalendar() {
const [date, setDate] = React.useState<undefined | Date>(() => new Date())
return (
<aside className="flex w-full max-w-60 flex-col border bg-sidebar text-sidebar-foreground">
<Calendar
mode="single"
selected={date}
onSelect={setDate}
navLayout="after"
showOutsideDays={false}
className="w-full bg-transparent [--cell-size:--spacing(6)] [&_.rdp-day]:text-xs"
/>
<div className="grid gap-1.5 border-t p-3">
<span className="text-[11px] font-medium tracking-wide text-muted-foreground uppercase">
Today
</span>
{upcoming.map((u) => (
<div key={u.title} className="flex items-center gap-2 text-xs">
<span className={cn("size-1.5 rounded-full", u.tone)} />
<span className="text-muted-foreground tabular-nums">{u.time}</span>
<span className="truncate">{u.title}</span>
</div>
))}
</div>
</aside>
)
}
calendar-25
Loading...
"use client"
import * as React from "react"
import {
Hand as HandIcon,
} from "@designali/icons"
import { Calendar } from "@/components/ui/calendar"
export function TouchFriendlyCalendar() {
const [date, setDate] = React.useState<undefined | Date>()
return (
<div className="flex w-full max-w-sm flex-col items-center gap-3">
<Calendar
mode="single"
selected={date}
onSelect={setDate}
fixedWeeks
buttonVariant="outline"
className="border [--cell-size:--spacing(10)] sm:[--cell-size:--spacing(11)]"
/>
<span className="flex items-center gap-1.5 text-xs text-muted-foreground">
<HandIcon className="size-3.5" />
44px targets for booking a Designali session on tablet
</span>
</div>
)
}
calendar-26
Loading...
"use client"
import * as React from "react"
import { format } from "date-fns"
import { Badge } from "@/components/ui/badge"
import { Calendar } from "@/components/ui/calendar"
import {
Card,
CardAction,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@/components/ui/card"
const now = new Date()
const fyStart = now.getMonth() >= 3 ? now.getFullYear() : now.getFullYear() - 1
const start = new Date(fyStart, 3, 1)
const end = new Date(fyStart + 1, 2, 31)
export function FiscalYearExpenseDate() {
const [date, setDate] = React.useState<undefined | Date>()
return (
<Card size="sm" className="w-fit">
<CardHeader>
<CardTitle>Expense date</CardTitle>
<CardDescription>
{format(start, "MMM yyyy")} - {format(end, "MMM yyyy")}
</CardDescription>
<CardAction>
<Badge variant="secondary">FY{String(fyStart + 1).slice(2)}</Badge>
</CardAction>
</CardHeader>
<CardContent>
<Calendar
mode="single"
captionLayout="dropdown-months"
selected={date}
onSelect={setDate}
startMonth={start}
endMonth={end}
disabled={[{ before: start }, { after: end }]}
className="p-0"
/>
</CardContent>
</Card>
)
}
calendar-27
Loading...
"use client"
import * as React from "react"
import {
addDays,
differenceInCalendarDays,
format,
isLastDayOfMonth,
} from "date-fns"
import {
Banknote as BanknoteIcon,
} from "@designali/icons"
import { Calendar } from "@/components/ui/calendar"
import {
Card,
CardContent,
CardDescription,
CardFooter,
CardHeader,
CardTitle,
} from "@/components/ui/card"
const isPayday = (d: Date) => d.getDate() === 15 || isLastDayOfMonth(d)
function nextPayday(from: Date) {
let d = from
while (!isPayday(d)) d = addDays(d, 1)
return d
}
export function PaydayCalendar() {
const today = React.useMemo(() => new Date(), [])
const next = nextPayday(today)
const days = differenceInCalendarDays(next, today)
return (
<Card className="w-fit">
<CardHeader>
<CardTitle className="flex items-center gap-2">
<BanknoteIcon className="size-4 text-muted-foreground" />
Pay schedule
</CardTitle>
<CardDescription>
Designali studio pays on the 15th and the last day of each month.
</CardDescription>
</CardHeader>
<CardContent>
<Calendar
modifiers={{ payday: isPayday }}
modifiersClassNames={{
payday:
"[&>button]:bg-primary/15 [&>button]:font-semibold [&>button]:text-chart-3 dark:[&>button]:text-primary",
}}
className="p-0"
/>
</CardContent>
<CardFooter className="justify-between">
<span className="text-muted-foreground">Next payday</span>
<span className="font-medium">
{format(next, "EEE, MMM d")} ยท{" "}
{days === 0
? "today"
: "in " + days + (days === 1 ? " day" : " days")}
</span>
</CardFooter>
</Card>
)
}
calendar-28
Loading...
import { Calendar } from "@/components/ui/calendar"
const year = new Date().getFullYear()
const fullDays = [
new Date(year, 11, 25),
new Date(year, 11, 26),
new Date(year + 1, 0, 1),
]
const halfDays = [new Date(year, 11, 24), new Date(year, 11, 31)]
export function HolidayLegendCalendar() {
return (
<div className="flex w-full max-w-xs flex-col items-center gap-3">
<Calendar
defaultMonth={new Date(year, 11)}
modifiers={{ holiday: fullDays, half: halfDays }}
modifiersClassNames={{
holiday:
"[&>button]:bg-primary/15 [&>button]:text-chart-3 dark:[&>button]:text-primary",
half: "[&>button]:bg-[linear-gradient(135deg,var(--color-primary)_50%,transparent_50%)]/20 [&>button]:text-chart-3 dark:[&>button]:text-primary",
}}
className="border"
/>
<div className="flex w-full justify-center gap-4 text-xs text-muted-foreground">
<span className="flex items-center gap-1.5">
<span className="size-2.5 bg-primary/30" /> Studio closed
</span>
<span className="flex items-center gap-1.5">
<span className="size-2.5 bg-primary/30" /> Half day
</span>
</div>
</div>
)
}
calendar-29
Loading...
"use client"
import * as React from "react"
import { isAfter, startOfDay } from "date-fns"
import {
Flame as FlameIcon,
} from "@designali/icons"
import { Calendar, CalendarDayButton } from "@/components/ui/calendar"
import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@/components/ui/card"
import { cn } from "@/lib/utils"
const pattern = [0, 25, 45, 30, 0, 60, 15]
const today = startOfDay(new Date())
function minutesFor(date: Date) {
if (isAfter(date, today)) return null
return pattern[(date.getDate() + date.getMonth()) % pattern.length]!
}
function shade(minutes: number | null) {
if (minutes === null) return ""
if (minutes === 0) return "bg-muted/40"
if (minutes < 30) return "bg-primary/25"
if (minutes < 50) return "bg-primary/50"
return "bg-primary/80 text-white"
}
function HeatmapDayButton({
day,
modifiers,
className,
...props
}: React.ComponentProps<typeof CalendarDayButton>) {
const minutes = modifiers.outside ? null : minutesFor(day.date)
return (
<CalendarDayButton
day={day}
modifiers={modifiers}
title={minutes === null ? undefined : minutes + " min"}
className={cn("rounded-none", shade(minutes), className)}
{...props}
/>
)
}
export function WorkoutStreakHeatmap() {
return (
<Card className="w-fit">
<CardHeader>
<CardTitle className="flex items-center gap-2">
<FlameIcon className="size-4 text-primary" />5 day streak
</CardTitle>
<CardDescription>Minutes spent designing in Figma this month.</CardDescription>
</CardHeader>
<CardContent className="flex flex-col gap-3">
<Calendar
components={{ DayButton: HeatmapDayButton }}
classNames={{ today: "font-semibold underline underline-offset-4" }}
className="p-0"
/>
<div className="flex items-center justify-end gap-1 text-[11px] text-muted-foreground">
Less
{[
"bg-muted/40",
"bg-primary/25",
"bg-primary/50",
"bg-primary/80",
].map((c) => (
<span key={c} className={cn("size-3", c)} />
))}
More
</div>
</CardContent>
</Card>
)
}
calendar-30
Loading...
"use client"
import * as React from "react"
import { addDays, format } from "date-fns"
import { Button } from "@/components/ui/button"
import { Calendar } from "@/components/ui/calendar"
import {
Card,
CardContent,
CardDescription,
CardFooter,
CardHeader,
CardTitle,
} from "@/components/ui/card"
import {
ToggleGroup,
ToggleGroupItem,
} from "@/components/ui/toggle-group"
const slots = [
"09:00",
"09:30",
"10:30",
"11:00",
"13:00",
"14:30",
"15:00",
"16:30",
]
const today = new Date()
export function TimeSlotBooking() {
const [date, setDate] = React.useState<undefined | Date>(addDays(today, 1))
const [slot, setSlot] = React.useState<string | undefined>()
const taken = date
? [
slots[date.getDate() % slots.length],
slots[(date.getDate() + 3) % slots.length],
]
: []
return (
<Card className="w-fit max-w-full">
<CardHeader>
<CardTitle>Book a 30 min intro call with Ali</CardTitle>
<CardDescription>
All times are in your local time zone.
</CardDescription>
</CardHeader>
<CardContent className="flex flex-col gap-4 sm:flex-row">
<Calendar
mode="single"
selected={date}
onSelect={(d) => {
setDate(d)
setSlot(undefined)
}}
disabled={[{ before: today }, { dayOfWeek: [0, 6] }]}
className="p-0"
/>
<ToggleGroup
variant="outline"
size="sm"
value={slot ? [slot] : []}
onValueChange={(value) => setSlot(value[0])}
className="grid grid-cols-2 gap-1.5 self-start sm:grid-cols-1"
>
{slots.map((s) => (
<ToggleGroupItem
key={s}
value={s}
disabled={!date || taken.includes(s)}
className="w-full tabular-nums"
>
{s}
</ToggleGroupItem>
))}
</ToggleGroup>
</CardContent>
<CardFooter>
<Button className="w-full" disabled={!date || !slot}>
{date && slot
? "Confirm " + format(date, "EEE, MMM d") + " at " + slot
: "Pick a day and time"}
</Button>
</CardFooter>
</Card>
)
}
calendar-31
Loading...
"use client"
import * as React from "react"
import {
endOfMonth,
format,
startOfMonth,
startOfYear,
subDays,
subMonths,
} from "date-fns"
import { type DateRange } from "react-day-picker"
import { Button } from "@/components/ui/button"
import { Calendar } from "@/components/ui/calendar"
import { Card, CardContent, CardFooter } from "@/components/ui/card"
const today = new Date()
const presets: { label: string; range: DateRange }[] = [
{ label: "Last 7 days", range: { from: subDays(today, 6), to: today } },
{ label: "Last 30 days", range: { from: subDays(today, 29), to: today } },
{ label: "This month", range: { from: startOfMonth(today), to: today } },
{
label: "Last month",
range: {
from: startOfMonth(subMonths(today, 1)),
to: endOfMonth(subMonths(today, 1)),
},
},
{ label: "Year to date", range: { from: startOfYear(today), to: today } },
]
export function AnalyticsRangePresets() {
const [active, setActive] = React.useState<string | null>("Last 7 days")
const [range, setRange] = React.useState<DateRange | undefined>(
presets[0]!.range
)
const [month, setMonth] = React.useState(today)
return (
<Card className="w-fit max-w-full">
<CardContent className="flex flex-col gap-3 sm:flex-row">
<div className="flex flex-wrap gap-1 sm:w-32 sm:flex-col">
{presets.map((p) => (
<Button
key={p.label}
size="sm"
variant={active === p.label ? "secondary" : "ghost"}
className="justify-start"
onClick={() => {
setActive(p.label)
setRange(p.range)
setMonth(p.range.to ?? today)
}}
>
{p.label}
</Button>
))}
</div>
<Calendar
mode="range"
selected={range}
onSelect={(r) => {
setRange(r)
setActive(null)
}}
month={month}
onMonthChange={setMonth}
disabled={{ after: today }}
className="p-0"
/>
</CardContent>
<CardFooter className="justify-between gap-2">
<span className="text-muted-foreground">
{range?.from && range?.to
? format(range.from, "MMM d") +
" - " +
format(range.to, "MMM d, yyyy")
: "Custom range"}
</span>
<Button size="sm">Apply</Button>
</CardFooter>
</Card>
)
}
calendar-32
Loading...
"use client"
import * as React from "react"
import { addDays, differenceInBusinessDays } from "date-fns"
import { type DateRange } from "react-day-picker"
import { Button } from "@/components/ui/button"
import { Calendar } from "@/components/ui/calendar"
import {
Card,
CardContent,
CardDescription,
CardFooter,
CardHeader,
CardTitle,
} from "@/components/ui/card"
import {
Field,
FieldDescription,
FieldError,
FieldLabel,
} from "@/components/ui/field"
import {
NativeSelect,
NativeSelectOption,
} from "@/components/ui/native-select"
const today = new Date()
const balance = 8
export function LeaveRequestBusinessDays() {
const [range, setRange] = React.useState<DateRange | undefined>()
const days =
range?.from && range?.to
? differenceInBusinessDays(addDays(range.to, 1), range.from)
: 0
const over = days > balance
return (
<Card className="w-full max-w-xs">
<CardHeader>
<CardTitle>Request time off</CardTitle>
<CardDescription>
{balance} vacation days remaining this year.
</CardDescription>
</CardHeader>
<CardContent className="flex flex-col gap-4">
<Field>
<FieldLabel htmlFor="leave-type">Leave type</FieldLabel>
<NativeSelect
id="leave-type"
defaultValue="vacation"
className="w-full"
>
<NativeSelectOption value="vacation">Vacation</NativeSelectOption>
<NativeSelectOption value="sick">Sick leave</NativeSelectOption>
<NativeSelectOption value="parental">
Parental leave
</NativeSelectOption>
</NativeSelect>
</Field>
<Field data-invalid={over || undefined}>
<Calendar
mode="range"
selected={range}
onSelect={setRange}
disabled={[{ before: today }, { dayOfWeek: [0, 6] }]}
excludeDisabled
className="self-center p-0"
/>
{over ? (
<FieldError>
That's {days} working days, which exceeds your balance.
</FieldError>
) : (
<FieldDescription>
{days > 0
? days + " working days requested."
: "Weekends are not counted."}
</FieldDescription>
)}
</Field>
</CardContent>
<CardFooter>
<Button className="w-full" disabled={days === 0 || over}>
Submit request
</Button>
</CardFooter>
</Card>
)
}
calendar-33
Loading...
"use client"
import * as React from "react"
import { eachDayOfInterval, endOfMonth, startOfMonth } from "date-fns"
import { Calendar } from "@/components/ui/calendar"
import {
Card,
CardContent,
CardDescription,
CardFooter,
CardHeader,
CardTitle,
} from "@/components/ui/card"
import {
ToggleGroup,
ToggleGroupItem,
} from "@/components/ui/toggle-group"
const weekdays = [
{ value: "1", label: "M" },
{ value: "2", label: "T" },
{ value: "3", label: "W" },
{ value: "4", label: "T" },
{ value: "5", label: "F" },
{ value: "6", label: "S" },
{ value: "0", label: "S" },
]
const names = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
export function RecurringClassSchedule() {
const [days, setDays] = React.useState<string[]>(["1", "3"])
const [month, setMonth] = React.useState(() => new Date())
const isSession = (d: Date) => days.includes(String(d.getDay()))
const count = eachDayOfInterval({
start: startOfMonth(month),
end: endOfMonth(month),
}).filter(isSession).length
return (
<Card className="w-fit">
<CardHeader>
<CardTitle>Designali Figma workshop</CardTitle>
<CardDescription>
{days.length
? "Every " + days.map((d) => names[Number(d)]).join(", ")
: "No repeat days"}
</CardDescription>
</CardHeader>
<CardContent className="flex flex-col gap-3">
<ToggleGroup
multiple
variant="outline"
size="sm"
value={days}
onValueChange={(v) => setDays(v as string[])}
className="w-full"
>
{weekdays.map((w) => (
<ToggleGroupItem
key={w.value}
value={w.value}
aria-label={names[Number(w.value)]}
className="flex-1"
>
{w.label}
</ToggleGroupItem>
))}
</ToggleGroup>
<Calendar
month={month}
onMonthChange={setMonth}
modifiers={{ session: isSession }}
modifiersClassNames={{
session: "[&>button]:bg-primary [&>button]:text-primary-foreground",
}}
weekStartsOn={1}
className="p-0"
/>
</CardContent>
<CardFooter className="text-muted-foreground">
{count} sessions this month
</CardFooter>
</Card>
)
}
calendar-34
Loading...
"use client"
import * as React from "react"
import { addDays, differenceInCalendarDays, format } from "date-fns"
import { Badge } from "@/components/ui/badge"
import { Calendar } from "@/components/ui/calendar"
import {
Card,
CardAction,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@/components/ui/card"
export function MilestoneCountdown() {
const today = React.useMemo(() => new Date(), [])
const [date, setDate] = React.useState<undefined | Date>(() =>
addDays(new Date(), 12)
)
const diff = date ? differenceInCalendarDays(date, today) : null
const status =
diff === null
? { label: "No date", variant: "outline" as const }
: diff < 0
? {
label: Math.abs(diff) + "d overdue",
variant: "destructive" as const,
}
: diff === 0
? { label: "Due today", variant: "default" as const }
: { label: "In " + diff + " days", variant: "secondary" as const }
return (
<Card className="w-fit">
<CardHeader>
<CardTitle>Designali Blocks launch</CardTitle>
<CardDescription>
{date ? format(date, "EEEE, MMMM d, yyyy") : "Set a target date"}
</CardDescription>
<CardAction>
<Badge variant={status.variant}>{status.label}</Badge>
</CardAction>
</CardHeader>
<CardContent>
<Calendar
mode="single"
selected={date}
onSelect={setDate}
defaultMonth={date}
className="p-0"
/>
</CardContent>
</Card>
)
}
calendar-35
Loading...
"use client"
import * as React from "react"
import {
Globe as GlobeIcon,
} from "@designali/icons"
import { Calendar } from "@/components/ui/calendar"
import {
NativeSelect,
NativeSelectOption,
} from "@/components/ui/native-select"
const zones = [
{ value: "America/Los_Angeles", label: "Los Angeles" },
{ value: "Europe/London", label: "London" },
{ value: "Asia/Tokyo", label: "Tokyo" },
{ value: "Pacific/Auckland", label: "Auckland" },
]
export function TimeZoneCalendar() {
const [zone, setZone] = React.useState("Asia/Tokyo")
const [date, setDate] = React.useState<undefined | Date>()
const [now] = React.useState(() => new Date())
const fmt = (d: Date, opts: Intl.DateTimeFormatOptions) =>
d.toLocaleString("en-US", { timeZone: zone, ...opts })
return (
<div className="flex w-full max-w-xs flex-col gap-3">
<div className="flex items-center justify-between gap-2">
<span className="flex items-center gap-1.5 text-xs font-medium">
<GlobeIcon className="size-4 text-muted-foreground" />
Time zone
</span>
<NativeSelect
size="sm"
value={zone}
onChange={(e) => setZone(e.target.value)}
aria-label="Time zone"
>
{zones.map((z) => (
<NativeSelectOption key={z.value} value={z.value}>
{z.label}
</NativeSelectOption>
))}
</NativeSelect>
</div>
<Calendar
key={zone}
mode="single"
timeZone={zone}
selected={date}
onSelect={setDate}
className="self-center border"
/>
<p className="text-center text-xs text-muted-foreground">
It's{" "}
{fmt(now, {
weekday: "short",
month: "short",
day: "numeric",
hour: "numeric",
minute: "2-digit",
})}{" "}
in {zones.find((z) => z.value === zone)?.label}
{date
? " ยท Selected " + fmt(date, { month: "short", day: "numeric" })
: ""}
</p>
</div>
)
}
calendar-36
Loading...
"use client"
import * as React from "react"
import { endOfISOWeek, format, getISOWeek, startOfISOWeek } from "date-fns"
import { type DateRange } from "react-day-picker"
import { Badge } from "@/components/ui/badge"
import { Calendar } from "@/components/ui/calendar"
import {
Card,
CardAction,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@/components/ui/card"
function weekOf(date: Date): DateRange {
return { from: startOfISOWeek(date), to: endOfISOWeek(date) }
}
export function TimesheetWeekPicker() {
const [week, setWeek] = React.useState<DateRange>(() => weekOf(new Date()))
return (
<Card className="w-fit">
<CardHeader>
<CardTitle>Timesheet</CardTitle>
<CardDescription>
Week {getISOWeek(week.from!)} ยท {format(week.from!, "MMM d")} -{" "}
{format(week.to!, "MMM d")}
</CardDescription>
<CardAction>
<Badge variant="outline">38.5 h</Badge>
</CardAction>
</CardHeader>
<CardContent>
<Calendar
mode="range"
required
ISOWeek
showWeekNumber
selected={week}
onSelect={(_, day) => setWeek(weekOf(day))}
className="p-0"
/>
</CardContent>
</Card>
)
}
calendar-37
Loading...
"use client"
import * as React from "react"
import { addMonths, format, isSameMonth, subMonths } from "date-fns"
import {
ChevronLeft as ChevronLeftIcon,
ChevronRight as ChevronRightIcon,
} from "@designali/icons"
import { Button } from "@/components/ui/button"
import { Calendar } from "@/components/ui/calendar"
export function CustomHeaderNavigation() {
const [today] = React.useState(() => new Date())
const [month, setMonth] = React.useState(today)
const [date, setDate] = React.useState<undefined | Date>(today)
return (
<div className="w-fit border">
<div className="flex items-center gap-1 border-b p-2">
<span className="flex-1 ps-1 text-sm font-medium">
{format(month, "MMMM yyyy")}
</span>
<Button
variant="outline"
size="sm"
disabled={isSameMonth(month, today)}
onClick={() => {
setMonth(today)
setDate(today)
}}
>
Today
</Button>
<Button
variant="ghost"
size="icon-sm"
aria-label="Previous month"
onClick={() => setMonth(subMonths(month, 1))}
>
<ChevronLeftIcon />
</Button>
<Button
variant="ghost"
size="icon-sm"
aria-label="Next month"
onClick={() => setMonth(addMonths(month, 1))}
>
<ChevronRightIcon />
</Button>
</div>
<Calendar
mode="single"
hideNavigation
month={month}
onMonthChange={setMonth}
selected={date}
onSelect={setDate}
classNames={{ month_caption: "hidden" }}
/>
</div>
)
}
calendar-38
Loading...
"use client"
import * as React from "react"
import {
Pause as PauseIcon,
} from "@designali/icons"
import { Badge } from "@/components/ui/badge"
import { Calendar } from "@/components/ui/calendar"
import {
Card,
CardAction,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@/components/ui/card"
import { Switch } from "@/components/ui/switch"
export function BookingsPausedToggle() {
const [paused, setPaused] = React.useState(true)
const [date, setDate] = React.useState<undefined | Date>()
return (
<Card className="w-fit">
<CardHeader>
<CardTitle>designali.com/contact booking page</CardTitle>
<CardDescription>
{paused
? "Guests can't pick a date right now."
: "Accepting new bookings."}
</CardDescription>
<CardAction>
<Switch
checked={!paused}
onCheckedChange={(on) => setPaused(!on)}
aria-label="Accept bookings"
/>
</CardAction>
</CardHeader>
<CardContent className="relative">
<Calendar
mode="single"
selected={date}
onSelect={setDate}
disabled={paused}
className="p-0"
/>
{paused ? (
<div className="absolute inset-0 flex items-center justify-center">
<Badge variant="secondary" className="gap-1">
<PauseIcon className="size-3" />
Bookings paused
</Badge>
</div>
) : null}
</CardContent>
</Card>
)
}
calendar-39
Loading...
"use client"
import * as React from "react"
import { Calendar } from "@/components/ui/calendar"
import { Spinner } from "@/components/ui/spinner"
function isBooked(d: Date) {
return (d.getDate() * 3 + d.getMonth()) % 4 === 0
}
export function LoadingAvailability() {
const [loading, setLoading] = React.useState(false)
const [date, setDate] = React.useState<undefined | Date>()
const timer = React.useRef<ReturnType<typeof setTimeout>>(undefined)
React.useEffect(() => () => clearTimeout(timer.current), [])
return (
<div className="relative w-fit border">
<Calendar
mode="single"
selected={date}
onSelect={setDate}
onMonthChange={() => {
setLoading(true)
clearTimeout(timer.current)
timer.current = setTimeout(() => setLoading(false), 900)
}}
disabled={loading ? true : isBooked}
aria-busy={loading}
/>
{loading ? (
<div className="absolute inset-x-0 top-10 bottom-0 flex items-center justify-center gap-2 bg-background/70 text-xs text-muted-foreground">
<Spinner />
Checking availability...
</div>
) : null}
</div>
)
}
calendar-40
Loading...
"use client"
import * as React from "react"
import { addMonths, isSameMonth } from "date-fns"
import {
CalendarX2 as CalendarX2Icon,
} from "@designali/icons"
import { Button } from "@/components/ui/button"
import { Calendar } from "@/components/ui/calendar"
import {
Empty,
EmptyContent,
EmptyDescription,
EmptyHeader,
EmptyMedia,
EmptyTitle,
} from "@/components/ui/empty"
export function FullyBookedMonth() {
const [today] = React.useState(() => new Date())
const [month, setMonth] = React.useState(today)
const [date, setDate] = React.useState<undefined | Date>()
const soldOut = isSameMonth(month, today)
return (
<div className="flex w-full max-w-xs flex-col border">
<Calendar
mode="single"
month={month}
onMonthChange={setMonth}
selected={date}
onSelect={setDate}
disabled={[(d) => isSameMonth(d, today), { before: today }]}
className="self-center"
/>
{soldOut ? (
<Empty className="border-t p-4">
<EmptyHeader>
<EmptyMedia variant="icon">
<CalendarX2Icon />
</EmptyMedia>
<EmptyTitle>Designali is fully booked this month</EmptyTitle>
<EmptyDescription>New project slots open next month.</EmptyDescription>
</EmptyHeader>
<EmptyContent>
<Button size="sm" onClick={() => setMonth(addMonths(today, 1))}>
Show next month
</Button>
</EmptyContent>
</Empty>
) : null}
</div>
)
}
calendar-41
Loading...
"use client"
import * as React from "react"
import { addDays, format, isBefore, isWeekend, startOfDay } from "date-fns"
import { Calendar } from "@/components/ui/calendar"
import {
Field,
FieldDescription,
FieldError,
FieldLabel,
} from "@/components/ui/field"
import { cn } from "@/lib/utils"
export function StartDateValidation() {
const [minDate] = React.useState(() => addDays(startOfDay(new Date()), 3))
const [date, setDate] = React.useState<undefined | Date>(() =>
addDays(new Date(), 1)
)
const error = !date
? "Choose a start date."
: isBefore(date, minDate)
? "Designali projects need at least 3 days' notice."
: isWeekend(date)
? "Start dates must fall on a weekday."
: null
return (
<Field data-invalid={error ? true : undefined} className="w-fit">
<FieldLabel>Project start date</FieldLabel>
<Calendar
mode="single"
selected={date}
onSelect={setDate}
aria-invalid={error ? true : undefined}
className={cn("border", error && "border-destructive")}
/>
{error ? (
<FieldError>{error}</FieldError>
) : (
<FieldDescription>
Starts {format(date!, "EEEE, MMMM d")}.
</FieldDescription>
)}
</Field>
)
}
calendar-42
Loading...
"use client"
import * as React from "react"
import { format } from "date-fns"
import { type DateRange } from "react-day-picker"
import { Button } from "@/components/ui/button"
import { Calendar } from "@/components/ui/calendar"
import {
Card,
CardAction,
CardContent,
CardDescription,
CardFooter,
CardHeader,
CardTitle,
} from "@/components/ui/card"
import { Switch } from "@/components/ui/switch"
import { Textarea } from "@/components/ui/textarea"
import { cn } from "@/lib/utils"
export function OutOfOfficeSettings() {
const [enabled, setEnabled] = React.useState(false)
const [range, setRange] = React.useState<DateRange | undefined>()
return (
<Card className="w-full max-w-xs">
<CardHeader>
<CardTitle>Out of office</CardTitle>
<CardDescription>
{enabled && range?.from && range?.to
? "Away " +
format(range.from, "MMM d") +
" - " +
format(range.to, "MMM d")
: "Let teammates know when you're away."}
</CardDescription>
<CardAction>
<Switch
checked={enabled}
onCheckedChange={setEnabled}
aria-label="Enable out of office"
/>
</CardAction>
</CardHeader>
<CardContent
className={cn(
"flex flex-col gap-3 transition-opacity",
!enabled && "opacity-50"
)}
>
<Calendar
mode="range"
selected={range}
onSelect={setRange}
disabled={!enabled}
className="self-center p-0"
/>
<Textarea
disabled={!enabled}
placeholder="I'm away with limited access to email. For urgent issues contact hello@designali.com."
className="min-h-16 text-xs"
/>
</CardContent>
<CardFooter className="justify-end">
<Button size="sm" disabled={!enabled || !range?.to}>
Save
</Button>
</CardFooter>
</Card>
)
}
calendar-43
Loading...
"use client"
import * as React from "react"
import { addMonths, format, setDate } from "date-fns"
import { Button } from "@/components/ui/button"
import { Calendar } from "@/components/ui/calendar"
import {
Card,
CardContent,
CardDescription,
CardFooter,
CardHeader,
CardTitle,
} from "@/components/ui/card"
function ordinal(n: number) {
const s = ["th", "st", "nd", "rd"]
const v = n % 100
return n + (s[(v - 20) % 10] || s[v] || "th")
}
export function BillingAnchorDay() {
const [month] = React.useState(() => new Date())
const [day, setDay] = React.useState(() => setDate(new Date(), 1))
const next = setDate(addMonths(month, 1), day.getDate())
return (
<Card className="w-fit">
<CardHeader>
<CardTitle>Billing date</CardTitle>
<CardDescription>
Your Designali Pro plan renews on the {ordinal(day.getDate())} of every month.
</CardDescription>
</CardHeader>
<CardContent>
<Calendar
mode="single"
required
month={month}
disableNavigation
showOutsideDays={false}
selected={day}
onSelect={setDay}
disabled={(d) => d.getDate() > 28}
formatters={{ formatCaption: () => "Day of month" }}
className="p-0"
/>
</CardContent>
<CardFooter className="justify-between gap-3">
<span className="text-muted-foreground">
Next charge {format(next, "MMM d, yyyy")}
</span>
<Button size="sm">Update</Button>
</CardFooter>
</Card>
)
}
calendar-44
Loading...
"use client"
import * as React from "react"
import { format } from "date-fns"
import { Calendar } from "@/components/ui/calendar"
import {
ToggleGroup,
ToggleGroupItem,
} from "@/components/ui/toggle-group"
const styles = {
narrow: { weekday: "EEEEE", caption: "MMM ''yy" },
short: { weekday: "EEEEEE", caption: "MMMM yyyy" },
long: { weekday: "EEE", caption: "MMMM, yyyy" },
} as const
type Style = keyof typeof styles
export function WeekdayFormatOptions() {
const [style, setStyle] = React.useState<Style>("narrow")
const current = styles[style]
return (
<div className="flex w-full max-w-xs flex-col items-center gap-3">
<ToggleGroup
variant="outline"
size="sm"
value={[style]}
onValueChange={(v) => {
if (v[0]) setStyle(v[0] as Style)
}}
>
<ToggleGroupItem value="narrow">M</ToggleGroupItem>
<ToggleGroupItem value="short">Mo</ToggleGroupItem>
<ToggleGroupItem value="long">Mon</ToggleGroupItem>
</ToggleGroup>
<Calendar
mode="single"
formatters={{
formatWeekdayName: (d) => format(d, current.weekday),
formatCaption: (m) => format(m, current.caption),
}}
className="border"
/>
</div>
)
}
calendar-45
Loading...
"use client"
import * as React from "react"
import { addDays, format, isValid, parseISO } from "date-fns"
import { type DateRange } from "react-day-picker"
import { Calendar } from "@/components/ui/calendar"
import { Field, FieldLabel } from "@/components/ui/field"
import { Input } from "@/components/ui/input"
const toInput = (d?: Date) => (d ? format(d, "yyyy-MM-dd") : "")
export function RangeWithDateInputs() {
const [range, setRange] = React.useState<DateRange | undefined>(() => {
const from = new Date()
return { from, to: addDays(from, 5) }
})
const [month, setMonth] = React.useState<undefined | Date>(range?.from)
const update = (key: "from" | "to", value: string) => {
const parsed = parseISO(value)
if (!isValid(parsed)) return
setRange(
(prev) => ({ from: prev?.from, to: prev?.to, [key]: parsed }) as DateRange
)
setMonth(parsed)
}
return (
<div className="flex w-fit max-w-full flex-col gap-3 border p-3">
<div className="grid grid-cols-2 gap-2">
<Field>
<FieldLabel htmlFor="range-start">Start</FieldLabel>
<Input
id="range-start"
type="date"
value={toInput(range?.from)}
onChange={(e) => update("from", e.target.value)}
/>
</Field>
<Field>
<FieldLabel htmlFor="range-end">End</FieldLabel>
<Input
id="range-end"
type="date"
value={toInput(range?.to)}
onChange={(e) => update("to", e.target.value)}
/>
</Field>
</div>
<Calendar
mode="range"
selected={range}
onSelect={setRange}
month={month}
onMonthChange={setMonth}
className="p-0"
/>
</div>
)
}
calendar-46
Loading...
"use client"
import * as React from "react"
import { format, isValid } from "date-fns"
import {
Calendar as CalendarIcon,
} from "@designali/icons"
import { Calendar } from "@/components/ui/calendar"
import {
Field,
FieldDescription,
FieldError,
FieldLabel,
} from "@/components/ui/field"
import {
InputGroup,
InputGroupAddon,
InputGroupButton,
InputGroupInput,
} from "@/components/ui/input-group"
import {
Popover,
PopoverContent,
PopoverTrigger,
} from "@/components/ui/popover"
export function TypedDateInput() {
const [date, setDate] = React.useState<undefined | Date>(() => new Date())
const [text, setText] = React.useState(() =>
format(new Date(), "MMM d, yyyy")
)
const [month, setMonth] = React.useState<undefined | Date>(date)
const [open, setOpen] = React.useState(false)
const invalid = text.length > 0 && !isValid(new Date(text))
return (
<Field data-invalid={invalid || undefined} className="w-full max-w-60">
<FieldLabel htmlFor="typed-date">Client follow-up date</FieldLabel>
<InputGroup>
<InputGroupInput
id="typed-date"
value={text}
placeholder="e.g. Dec 3, 2026"
aria-invalid={invalid || undefined}
onChange={(e) => {
setText(e.target.value)
const parsed = new Date(e.target.value)
if (isValid(parsed)) {
setDate(parsed)
setMonth(parsed)
}
}}
/>
<InputGroupAddon align="inline-end">
<Popover open={open} onOpenChange={setOpen}>
<PopoverTrigger
render={
<InputGroupButton size="icon-xs" aria-label="Open calendar" />
}
>
<CalendarIcon />
</PopoverTrigger>
<PopoverContent className="w-auto p-0" align="end">
<Calendar
mode="single"
selected={date}
month={month}
onMonthChange={setMonth}
onSelect={(d) => {
setDate(d)
setText(d ? format(d, "MMM d, yyyy") : "")
setOpen(false)
}}
/>
</PopoverContent>
</Popover>
</InputGroupAddon>
</InputGroup>
{invalid ? (
<FieldError>We couldn't read that date.</FieldError>
) : (
<FieldDescription>Type a date or pick one.</FieldDescription>
)}
</Field>
)
}
calendar-47
Loading...
"use client"
import * as React from "react"
import { differenceInCalendarDays } from "date-fns"
import {
Moon as MoonIcon,
Sun as SunIcon,
} from "@designali/icons"
import { Calendar, CalendarDayButton } from "@/components/ui/calendar"
import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@/components/ui/card"
import { cn } from "@/lib/utils"
const rotation = ["D", "D", "N", "N", "-", "-", "-", "-"]
const anchor = new Date(2026, 0, 1)
const shiftStyles: Record<string, string> = {
D: "text-primary dark:text-primary",
N: "text-primary dark:text-primary",
"-": "text-muted-foreground",
}
function shiftFor(date: Date) {
const i =
((differenceInCalendarDays(date, anchor) % rotation.length) +
rotation.length) %
rotation.length
return rotation[i]!
}
function ShiftDayButton({
children,
day,
modifiers,
...props
}: React.ComponentProps<typeof CalendarDayButton>) {
const shift = shiftFor(day.date)
return (
<CalendarDayButton day={day} modifiers={modifiers} {...props}>
{children}
{!modifiers.outside ? (
<span
className={cn(
"text-[10px] font-semibold",
!modifiers.selected && shiftStyles[shift]
)}
>
{shift === "-" ? "off" : shift}
</span>
) : null}
</CalendarDayButton>
)
}
export function ShiftRotaCalendar() {
const [date, setDate] = React.useState<undefined | Date>()
return (
<Card className="w-fit">
<CardHeader>
<CardTitle>Designali support rota</CardTitle>
<CardDescription>2 days, 2 late shifts, 4 off.</CardDescription>
</CardHeader>
<CardContent className="flex flex-col gap-3">
<Calendar
mode="single"
selected={date}
onSelect={setDate}
components={{ DayButton: ShiftDayButton }}
className="p-0 [--cell-size:--spacing(9)]"
/>
<div className="flex gap-4 text-xs">
<span className="flex items-center gap-1.5">
<SunIcon className="size-3.5 text-primary" /> Day 07-19
</span>
<span className="flex items-center gap-1.5">
<MoonIcon className="size-3.5 text-primary" /> Night 19-07
</span>
</div>
</CardContent>
</Card>
)
}
calendar-48
Loading...
"use client"
import * as React from "react"
import {
Tv as TvIcon,
} from "@designali/icons"
import { Calendar } from "@/components/ui/calendar"
import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@/components/ui/card"
export function BroadcastMonthCalendar() {
const [date, setDate] = React.useState<undefined | Date>()
return (
<Card className="w-fit">
<CardHeader>
<CardTitle className="flex items-center gap-2">
<TvIcon className="size-4 text-muted-foreground" />
Designali launch campaign
</CardTitle>
<CardDescription>
Broadcast months always start on a Monday.
</CardDescription>
</CardHeader>
<CardContent>
<Calendar
mode="single"
broadcastCalendar
showWeekNumber
selected={date}
onSelect={setDate}
className="p-0"
/>
</CardContent>
</Card>
)
}
calendar-49
Loading...
"use client"
import * as React from "react"
import { addDays, format, isBefore, nextMonday, startOfDay } from "date-fns"
import {
Ban as BanIcon,
CalendarArrowUp as CalendarArrowUpIcon,
CalendarClock as CalendarClockIcon,
Sun as SunIcon,
Sunrise as SunriseIcon,
} from "@designali/icons"
import { Button } from "@/components/ui/button"
import { Calendar } from "@/components/ui/calendar"
import { Checkbox } from "@/components/ui/checkbox"
import {
Popover,
PopoverContent,
PopoverTrigger,
} from "@/components/ui/popover"
import { cn } from "@/lib/utils"
export function TaskDueDatePopover() {
const [today] = React.useState(() => startOfDay(new Date()))
const [due, setDue] = React.useState<undefined | Date>()
const [open, setOpen] = React.useState(false)
const quick = [
{ label: "Today", icon: SunIcon, date: today },
{ label: "Tomorrow", icon: SunriseIcon, date: addDays(today, 1) },
{ label: "Next week", icon: CalendarArrowUpIcon, date: nextMonday(today) },
]
const pick = (d: Date | undefined) => {
setDue(d)
setOpen(false)
}
const overdue = due && isBefore(due, today)
return (
<div className="flex w-full max-w-sm items-center justify-between gap-3 border p-3">
<div className="flex min-w-0 items-center gap-2">
<Checkbox aria-label="Complete task" />
<span className="truncate text-sm">
Send revised website quote to a Designali client
</span>
</div>
<Popover open={open} onOpenChange={setOpen}>
<PopoverTrigger
render={
<Button
variant="outline"
size="sm"
className={cn(
"shrink-0 font-normal",
overdue && "text-destructive"
)}
/>
}
>
<CalendarClockIcon data-icon="inline-start" />
{due ? format(due, "MMM d") : "Due date"}
</PopoverTrigger>
<PopoverContent className="w-auto p-0" align="end">
<div className="grid border-b p-1">
{quick.map((q) => (
<Button
key={q.label}
variant="ghost"
size="sm"
className="justify-start"
onClick={() => pick(q.date)}
>
<q.icon data-icon="inline-start" />
{q.label}
<span className="ms-auto text-muted-foreground">
{format(q.date, "EEE")}
</span>
</Button>
))}
<Button
variant="ghost"
size="sm"
className="justify-start text-muted-foreground"
onClick={() => pick(undefined)}
>
<BanIcon data-icon="inline-start" />
No date
</Button>
</div>
<Calendar
mode="single"
selected={due}
onSelect={pick}
defaultMonth={due}
/>
</PopoverContent>
</Popover>
</div>
)
}
calendar-50
Loading...
"use client"
import * as React from "react"
import { format, isAfter, startOfDay } from "date-fns"
import {
Frown as FrownIcon,
Laugh as LaughIcon,
Meh as MehIcon,
Smile as SmileIcon,
} from "@designali/icons"
import { Calendar, CalendarDayButton } from "@/components/ui/calendar"
import { Card, CardContent } from "@/components/ui/card"
import { cn } from "@/lib/utils"
const moods = [
{ icon: LaughIcon, label: "Great", tone: "text-primary" },
{ icon: SmileIcon, label: "Good", tone: "text-primary" },
{ icon: MehIcon, label: "Okay", tone: "text-primary" },
{ icon: FrownIcon, label: "Low", tone: "text-primary" },
]
const today = startOfDay(new Date())
function moodFor(date: Date) {
if (isAfter(date, today)) return null
return moods[(date.getDate() * 5 + date.getMonth()) % moods.length]!
}
function MoodDayButton({
children,
day,
modifiers,
...props
}: React.ComponentProps<typeof CalendarDayButton>) {
const mood = modifiers.outside ? null : moodFor(day.date)
return (
<CalendarDayButton day={day} modifiers={modifiers} {...props}>
{children}
{mood ? (
<mood.icon
className={cn(
"size-3 opacity-100!",
!modifiers.selected && mood.tone
)}
/>
) : null}
</CalendarDayButton>
)
}
export function MoodTrackerCalendar() {
const [date, setDate] = React.useState(today)
const mood = moodFor(date)
return (
<Card className="w-fit">
<CardContent className="flex flex-col gap-3">
<Calendar
mode="single"
required
selected={date}
onSelect={setDate}
disabled={{ after: today }}
components={{ DayButton: MoodDayButton }}
className="p-0 [--cell-size:--spacing(9)]"
/>
<div className="flex items-center gap-3 border-t pt-3">
{mood ? <mood.icon className={cn("size-5", mood.tone)} /> : null}
<div className="grid">
<span className="text-xs font-medium">
{format(date, "EEEE, MMM d")} ยท {mood?.label}
</span>
<span className="text-xs text-muted-foreground">
Shipped new Designali blocks and finished the icon set.
</span>
</div>
</div>
</CardContent>
</Card>
)
}
Categories
- Accordion
- Alert
- Alert Dialog
- Aspect Ratio
- Avatar
- Badge
- Breadcrumb
- Button
- Calendar
- Card
- Carousel
- Checkbox
- Collapsible
- Combobox
- Command
- Context Menu
- Dialog
- Drawer
- Dropdown Menu
- Field
- Hover Card
- Input
- Input OTP
- Label
- Menubar
- Navigation Menu
- Pagination
- Popover
- Progress
- Radio Group
- Resizable
- Scroll Area
- Select
- Separator
- Sheet
- Skeleton
- Slider
- Spinner
- Switch
- Table
- Tabs
- Textarea
- Toast
- Toggle
- Toggle Group
- Tooltip