diff --git a/apps/www/__registry__/default/blocks/fullscreen-calendar/page.tsx b/apps/www/__registry__/default/blocks/fullscreen-calendar/page.tsx new file mode 100644 index 00000000000..9e413c6efed --- /dev/null +++ b/apps/www/__registry__/default/blocks/fullscreen-calendar/page.tsx @@ -0,0 +1,9 @@ +import { FullScreenCalendar } from "@/registry/default/blocks/fullscreen-calendar/components/fullscreen-calendar" + +export default function Page() { + return ( +
+ +
+ ) +} diff --git a/apps/www/__registry__/new-york/blocks/fullscreen-calendar/page.tsx b/apps/www/__registry__/new-york/blocks/fullscreen-calendar/page.tsx new file mode 100644 index 00000000000..486735d1ae8 --- /dev/null +++ b/apps/www/__registry__/new-york/blocks/fullscreen-calendar/page.tsx @@ -0,0 +1,9 @@ +import { FullScreenCalendar } from "@/registry/new-york/blocks/fullscreen-calendar/components/fullscreen-calendar" + +export default function Page() { + return ( +
+ +
+ ) +} diff --git a/apps/www/public/r/styles/default/fullscreen-calendar.json b/apps/www/public/r/styles/default/fullscreen-calendar.json new file mode 100644 index 00000000000..f63acd2c895 --- /dev/null +++ b/apps/www/public/r/styles/default/fullscreen-calendar.json @@ -0,0 +1,50 @@ +{ + "$schema": "https://ui.shadcn.com/schema/registry-item.json", + "name": "fullscreen-calendar", + "type": "registry:block", + "title": "Fullscreen Calendar", + "author": "Ahmed Mayara (https://ahmedmayara.vercel.app)", + "description": "A simple fullscreen calendar that allows to navigate between months and displays events.", + "dependencies": [ + "date-fns" + ], + "registryDependencies": [ + "button", + "separator" + ], + "files": [ + { + "path": "blocks/fullscreen-calendar/page.tsx", + "content": "import { FullScreenCalendar } from \"@/registry/default/blocks/fullscreen-calendar/components/fullscreen-calendar\"\n\nexport default function Page() {\n return (\n
\n \n
\n )\n}\n", + "type": "registry:page", + "target": "app/fullscreen-calendar/page.tsx" + }, + { + "path": "blocks/fullscreen-calendar/components/fullscreen-calendar.tsx", + "content": "\"use client\"\n\nimport React from \"react\"\nimport {\n add,\n eachDayOfInterval,\n endOfMonth,\n endOfWeek,\n format,\n parse,\n startOfToday,\n startOfWeek,\n} from \"date-fns\"\n\nimport { FullScreenCalendarDay } from \"@/registry/default/blocks/fullscreen-calendar/components/fullscreen-calendar-day\"\nimport { FullScreenCalendarHeader } from \"@/registry/default/blocks/fullscreen-calendar/components/fullscreen-calendar-header\"\nimport { FullScreenCalendarWeekDays } from \"@/registry/default/blocks/fullscreen-calendar/components/fullscreen-calendar-week-days\"\n\n// Dummy data\nconst data = [\n {\n day: new Date(\"2025-01-02\"),\n events: [\n {\n id: 1,\n name: \"Q1 Planning Session\",\n time: \"10:00 AM\",\n datetime: \"2025-01-02T00:00\",\n },\n {\n id: 2,\n name: \"Team Sync\",\n time: \"2:00 PM\",\n datetime: \"2025-01-02T00:00\",\n },\n ],\n },\n {\n day: new Date(\"2025-01-07\"),\n events: [\n {\n id: 3,\n name: \"Product Launch Review\",\n time: \"2:00 PM\",\n datetime: \"2025-01-07T00:00\",\n },\n {\n id: 4,\n name: \"Marketing Sync\",\n time: \"11:00 AM\",\n datetime: \"2025-01-07T00:00\",\n },\n {\n id: 5,\n name: \"Vendor Meeting\",\n time: \"4:30 PM\",\n datetime: \"2025-01-07T00:00\",\n },\n ],\n },\n {\n day: new Date(\"2025-01-10\"),\n events: [\n {\n id: 6,\n name: \"Team Building Workshop\",\n time: \"11:00 AM\",\n datetime: \"2025-01-10T00:00\",\n },\n ],\n },\n {\n day: new Date(\"2025-01-13\"),\n events: [\n {\n id: 7,\n name: \"Budget Analysis Meeting\",\n time: \"3:30 PM\",\n datetime: \"2025-01-14T00:00\",\n },\n {\n id: 8,\n name: \"Sprint Planning\",\n time: \"9:00 AM\",\n datetime: \"2025-01-14T00:00\",\n },\n {\n id: 9,\n name: \"Design Review\",\n time: \"1:00 PM\",\n datetime: \"2025-01-14T00:00\",\n },\n ],\n },\n {\n day: new Date(\"2025-01-16\"),\n events: [\n {\n id: 10,\n name: \"Client Presentation\",\n time: \"10:00 AM\",\n datetime: \"2025-01-16T00:00\",\n },\n {\n id: 11,\n name: \"Team Lunch\",\n time: \"12:30 PM\",\n datetime: \"2025-01-16T00:00\",\n },\n {\n id: 12,\n name: \"Project Status Update\",\n time: \"2:00 PM\",\n datetime: \"2025-01-16T00:00\",\n },\n ],\n },\n {\n day: new Date(\"2025-01-21\"),\n events: [\n {\n id: 13,\n name: \"Tech Stack Review\",\n time: \"1:00 PM\",\n datetime: \"2025-01-21T00:00\",\n },\n {\n id: 14,\n name: \"Security Training\",\n time: \"3:00 PM\",\n datetime: \"2025-01-21T00:00\",\n },\n ],\n },\n {\n day: new Date(\"2025-01-23\"),\n events: [\n {\n id: 15,\n name: \"Marketing Strategy Session\",\n time: \"2:30 PM\",\n datetime: \"2025-01-23T00:00\",\n },\n {\n id: 16,\n name: \"Social Media Planning\",\n time: \"10:00 AM\",\n datetime: \"2025-01-23T00:00\",\n },\n {\n id: 17,\n name: \"Content Review\",\n time: \"4:00 PM\",\n datetime: \"2025-01-23T00:00\",\n },\n ],\n },\n {\n day: new Date(\"2025-01-28\"),\n events: [\n {\n id: 18,\n name: \"Monthly All-Hands\",\n time: \"4:00 PM\",\n datetime: \"2025-01-28T00:00\",\n },\n {\n id: 19,\n name: \"Department Sync\",\n time: \"10:30 AM\",\n datetime: \"2025-01-28T00:00\",\n },\n ],\n },\n {\n day: new Date(\"2025-01-30\"),\n events: [\n {\n id: 20,\n name: \"Project Retrospective\",\n time: \"11:30 AM\",\n datetime: \"2025-01-30T00:00\",\n },\n {\n id: 21,\n name: \"Sprint Demo\",\n time: \"2:00 PM\",\n datetime: \"2025-01-30T00:00\",\n },\n ],\n },\n {\n day: new Date(\"2025-01-31\"),\n events: [\n {\n id: 22,\n name: \"Quarterly Report Review\",\n time: \"3:00 PM\",\n datetime: \"2025-01-31T00:00\",\n },\n {\n id: 23,\n name: \"Year Planning\",\n time: \"9:30 AM\",\n datetime: \"2025-01-31T00:00\",\n },\n {\n id: 24,\n name: \"Team Happy Hour\",\n time: \"5:00 PM\",\n datetime: \"2025-01-31T00:00\",\n },\n ],\n },\n]\n\nexport function FullScreenCalendar() {\n const today = startOfToday()\n const [selectedDay, setSelectedDay] = React.useState(today)\n const [currentMonth, setCurrentMonth] = React.useState(\n format(today, \"MMM-yyyy\")\n )\n const firstDayCurrentMonth = parse(currentMonth, \"MMM-yyyy\", new Date())\n\n const days = eachDayOfInterval({\n start: startOfWeek(firstDayCurrentMonth),\n end: endOfWeek(endOfMonth(firstDayCurrentMonth)),\n })\n\n function previousMonth() {\n const firstDayNextMonth = add(firstDayCurrentMonth, { months: -1 })\n setCurrentMonth(format(firstDayNextMonth, \"MMM-yyyy\"))\n }\n\n function nextMonth() {\n const firstDayNextMonth = add(firstDayCurrentMonth, { months: 1 })\n setCurrentMonth(format(firstDayNextMonth, \"MMM-yyyy\"))\n }\n\n function goToToday() {\n setCurrentMonth(format(today, \"MMM-yyyy\"))\n }\n\n return (\n
\n \n
\n \n
\n
\n {days.map((day, dayIdx) => (\n \n ))}\n
\n\n
\n {days.map((day, dayIdx) => (\n \n ))}\n
\n
\n
\n
\n )\n}\n", + "type": "registry:component", + "target": "" + }, + { + "path": "blocks/fullscreen-calendar/components/fullscreen-calendar-day.tsx", + "content": "\"use client\"\n\nimport React from \"react\"\nimport {\n format,\n getDay,\n isEqual,\n isSameDay,\n isSameMonth,\n isToday,\n} from \"date-fns\"\n\nimport { cn } from \"@/lib/utils\"\nimport { useMediaQuery } from \"@/hooks/use-media-query\"\n\ninterface FullscreenCalendarDayProps {\n day: Date\n selectedDay: Date\n setSelectedDay: React.Dispatch>\n firstDayCurrentMonth: Date\n dayIndex: number\n data: {\n day: Date\n events: {\n id: number\n name: string\n time: string\n datetime: string\n }[]\n }[]\n}\n\nconst colStartClasses = [\n \"\",\n \"col-start-2\",\n \"col-start-3\",\n \"col-start-4\",\n \"col-start-5\",\n \"col-start-6\",\n \"col-start-7\",\n]\n\nexport function FullScreenCalendarDay({\n day,\n selectedDay,\n setSelectedDay,\n firstDayCurrentMonth,\n dayIndex,\n data,\n}: FullscreenCalendarDayProps) {\n const isDesktop = useMediaQuery(\"(min-width: 768px)\")\n\n if (!isDesktop) {\n return (\n setSelectedDay(day)}\n key={dayIndex}\n type=\"button\"\n className={cn(\n isEqual(day, selectedDay) && \"text-primary-foreground\",\n !isEqual(day, selectedDay) &&\n !isToday(day) &&\n isSameMonth(day, firstDayCurrentMonth) &&\n \"text-foreground\",\n !isEqual(day, selectedDay) &&\n !isToday(day) &&\n !isSameMonth(day, firstDayCurrentMonth) &&\n \"text-muted-foreground\",\n (isEqual(day, selectedDay) || isToday(day)) && \"font-semibold\",\n \"flex h-14 flex-col border-b border-r px-3 py-2 hover:bg-muted focus:z-10\"\n )}\n >\n \n {format(day, \"d\")}\n \n {data.filter((date) => isSameDay(date.day, day)).length > 0 && (\n
\n {data\n .filter((date) => isSameDay(date.day, day))\n .map((date) => (\n \n {date.events.map((event) => (\n \n ))}\n
\n ))}\n \n )}\n \n )\n }\n\n return (\n setSelectedDay(day)}\n className={cn(\n dayIndex === 0 && colStartClasses[getDay(day)],\n !isEqual(day, selectedDay) &&\n !isToday(day) &&\n !isSameMonth(day, firstDayCurrentMonth) &&\n \"bg-accent/50 text-muted-foreground\",\n \"relative flex flex-col border-b border-r hover:bg-muted focus:z-10\",\n !isEqual(day, selectedDay) && \"hover:bg-accent/75\"\n )}\n >\n
\n \n \n \n
\n
\n {data\n .filter((event) => isSameDay(event.day, day))\n .map((day) => (\n
\n {day.events.slice(0, 1).map((event) => (\n \n

{event.name}

\n

\n {event.time}\n

\n
\n ))}\n {day.events.length > 1 && (\n
\n + {day.events.length - 1} more\n
\n )}\n
\n ))}\n \n \n )\n}\n", + "type": "registry:component", + "target": "" + }, + { + "path": "blocks/fullscreen-calendar/components/fullscreen-calendar-header.tsx", + "content": "\"use client\"\n\nimport React from \"react\"\nimport { format, startOfToday } from \"date-fns\"\nimport {\n ChevronLeftIcon,\n ChevronRightIcon,\n PlusCircleIcon,\n SearchIcon,\n} from \"lucide-react\"\n\nimport { Button } from \"@/registry/default/ui/button\"\nimport { Separator } from \"@/registry/default/ui/separator\"\n\ninterface FullScreenCalendarHeaderProps {\n startOfMonth: Date\n endOfMonth: Date\n nextMonth: () => void\n goToToday: () => void\n previousMonth: () => void\n}\n\nexport function FullScreenCalendarHeader({\n nextMonth,\n goToToday,\n previousMonth,\n startOfMonth,\n endOfMonth,\n}: FullScreenCalendarHeaderProps) {\n const today = startOfToday()\n\n return (\n
\n
\n
\n
\n

\n {format(today, \"MMM\")}\n

\n
\n {format(today, \"d\")}\n
\n
\n
\n

\n {format(startOfMonth, \"MMMM, yyyy\")}\n

\n

\n {format(startOfMonth, \"MMM d, yyyy\")} -{\" \"}\n {format(endOfMonth, \"MMM d, yyyy\")}\n

\n
\n
\n
\n\n
\n \n\n \n\n
\n \n \n \n \n Today\n \n \n \n \n
\n\n \n\n \n\n \n
\n
\n )\n}\n", + "type": "registry:component", + "target": "" + }, + { + "path": "blocks/fullscreen-calendar/components/fullscreen-calendar-week-days.tsx", + "content": "import React from \"react\"\n\nexport function FullScreenCalendarWeekDays() {\n return (\n
\n
Sun
\n
Mon
\n
Tue
\n
Wed
\n
Thu
\n
Fri
\n
Sat
\n
\n )\n}\n", + "type": "registry:component", + "target": "" + } + ], + "categories": [ + "calendars" + ] +} \ No newline at end of file diff --git a/apps/www/public/r/styles/new-york/fullscreen-calendar-dark.png b/apps/www/public/r/styles/new-york/fullscreen-calendar-dark.png new file mode 100644 index 00000000000..2d8ac5307cc Binary files /dev/null and b/apps/www/public/r/styles/new-york/fullscreen-calendar-dark.png differ diff --git a/apps/www/public/r/styles/new-york/fullscreen-calendar-light.png b/apps/www/public/r/styles/new-york/fullscreen-calendar-light.png new file mode 100644 index 00000000000..2e6ddfcff2e Binary files /dev/null and b/apps/www/public/r/styles/new-york/fullscreen-calendar-light.png differ diff --git a/apps/www/public/r/styles/new-york/fullscreen-calendar.json b/apps/www/public/r/styles/new-york/fullscreen-calendar.json new file mode 100644 index 00000000000..c69ee66854c --- /dev/null +++ b/apps/www/public/r/styles/new-york/fullscreen-calendar.json @@ -0,0 +1,50 @@ +{ + "$schema": "https://ui.shadcn.com/schema/registry-item.json", + "name": "fullscreen-calendar", + "type": "registry:block", + "title": "Fullscreen Calendar", + "author": "Ahmed Mayara (https://ahmedmayara.vercel.app)", + "description": "A simple fullscreen calendar that allows to navigate between months and displays events.", + "dependencies": [ + "date-fns" + ], + "registryDependencies": [ + "button", + "separator" + ], + "files": [ + { + "path": "blocks/fullscreen-calendar/page.tsx", + "content": "import { FullScreenCalendar } from \"@/registry/new-york/blocks/fullscreen-calendar/components/fullscreen-calendar\"\n\nexport default function Page() {\n return (\n
\n \n
\n )\n}\n", + "type": "registry:page", + "target": "app/fullscreen-calendar/page.tsx" + }, + { + "path": "blocks/fullscreen-calendar/components/fullscreen-calendar.tsx", + "content": "\"use client\"\n\nimport React from \"react\"\nimport {\n add,\n eachDayOfInterval,\n endOfMonth,\n endOfWeek,\n format,\n parse,\n startOfToday,\n startOfWeek,\n} from \"date-fns\"\n\nimport { FullScreenCalendarDay } from \"@/registry/new-york/blocks/fullscreen-calendar/components/fullscreen-calendar-day\"\nimport { FullScreenCalendarHeader } from \"@/registry/new-york/blocks/fullscreen-calendar/components/fullscreen-calendar-header\"\nimport { FullScreenCalendarWeekDays } from \"@/registry/new-york/blocks/fullscreen-calendar/components/fullscreen-calendar-week-days\"\n\n// Dummy data\nconst data = [\n {\n day: new Date(\"2025-01-02\"),\n events: [\n {\n id: 1,\n name: \"Q1 Planning Session\",\n time: \"10:00 AM\",\n datetime: \"2025-01-02T00:00\",\n },\n {\n id: 2,\n name: \"Team Sync\",\n time: \"2:00 PM\",\n datetime: \"2025-01-02T00:00\",\n },\n ],\n },\n {\n day: new Date(\"2025-01-07\"),\n events: [\n {\n id: 3,\n name: \"Product Launch Review\",\n time: \"2:00 PM\",\n datetime: \"2025-01-07T00:00\",\n },\n {\n id: 4,\n name: \"Marketing Sync\",\n time: \"11:00 AM\",\n datetime: \"2025-01-07T00:00\",\n },\n {\n id: 5,\n name: \"Vendor Meeting\",\n time: \"4:30 PM\",\n datetime: \"2025-01-07T00:00\",\n },\n ],\n },\n {\n day: new Date(\"2025-01-10\"),\n events: [\n {\n id: 6,\n name: \"Team Building Workshop\",\n time: \"11:00 AM\",\n datetime: \"2025-01-10T00:00\",\n },\n ],\n },\n {\n day: new Date(\"2025-01-13\"),\n events: [\n {\n id: 7,\n name: \"Budget Analysis Meeting\",\n time: \"3:30 PM\",\n datetime: \"2025-01-14T00:00\",\n },\n {\n id: 8,\n name: \"Sprint Planning\",\n time: \"9:00 AM\",\n datetime: \"2025-01-14T00:00\",\n },\n {\n id: 9,\n name: \"Design Review\",\n time: \"1:00 PM\",\n datetime: \"2025-01-14T00:00\",\n },\n ],\n },\n {\n day: new Date(\"2025-01-16\"),\n events: [\n {\n id: 10,\n name: \"Client Presentation\",\n time: \"10:00 AM\",\n datetime: \"2025-01-16T00:00\",\n },\n {\n id: 11,\n name: \"Team Lunch\",\n time: \"12:30 PM\",\n datetime: \"2025-01-16T00:00\",\n },\n {\n id: 12,\n name: \"Project Status Update\",\n time: \"2:00 PM\",\n datetime: \"2025-01-16T00:00\",\n },\n ],\n },\n {\n day: new Date(\"2025-01-21\"),\n events: [\n {\n id: 13,\n name: \"Tech Stack Review\",\n time: \"1:00 PM\",\n datetime: \"2025-01-21T00:00\",\n },\n {\n id: 14,\n name: \"Security Training\",\n time: \"3:00 PM\",\n datetime: \"2025-01-21T00:00\",\n },\n ],\n },\n {\n day: new Date(\"2025-01-23\"),\n events: [\n {\n id: 15,\n name: \"Marketing Strategy Session\",\n time: \"2:30 PM\",\n datetime: \"2025-01-23T00:00\",\n },\n {\n id: 16,\n name: \"Social Media Planning\",\n time: \"10:00 AM\",\n datetime: \"2025-01-23T00:00\",\n },\n {\n id: 17,\n name: \"Content Review\",\n time: \"4:00 PM\",\n datetime: \"2025-01-23T00:00\",\n },\n ],\n },\n {\n day: new Date(\"2025-01-28\"),\n events: [\n {\n id: 18,\n name: \"Monthly All-Hands\",\n time: \"4:00 PM\",\n datetime: \"2025-01-28T00:00\",\n },\n {\n id: 19,\n name: \"Department Sync\",\n time: \"10:30 AM\",\n datetime: \"2025-01-28T00:00\",\n },\n ],\n },\n {\n day: new Date(\"2025-01-30\"),\n events: [\n {\n id: 20,\n name: \"Project Retrospective\",\n time: \"11:30 AM\",\n datetime: \"2025-01-30T00:00\",\n },\n {\n id: 21,\n name: \"Sprint Demo\",\n time: \"2:00 PM\",\n datetime: \"2025-01-30T00:00\",\n },\n ],\n },\n {\n day: new Date(\"2025-01-31\"),\n events: [\n {\n id: 22,\n name: \"Quarterly Report Review\",\n time: \"3:00 PM\",\n datetime: \"2025-01-31T00:00\",\n },\n {\n id: 23,\n name: \"Year Planning\",\n time: \"9:30 AM\",\n datetime: \"2025-01-31T00:00\",\n },\n {\n id: 24,\n name: \"Team Happy Hour\",\n time: \"5:00 PM\",\n datetime: \"2025-01-31T00:00\",\n },\n ],\n },\n]\n\nexport function FullScreenCalendar() {\n const today = startOfToday()\n const [selectedDay, setSelectedDay] = React.useState(today)\n const [currentMonth, setCurrentMonth] = React.useState(\n format(today, \"MMM-yyyy\")\n )\n const firstDayCurrentMonth = parse(currentMonth, \"MMM-yyyy\", new Date())\n\n const days = eachDayOfInterval({\n start: startOfWeek(firstDayCurrentMonth),\n end: endOfWeek(endOfMonth(firstDayCurrentMonth)),\n })\n\n function previousMonth() {\n const firstDayNextMonth = add(firstDayCurrentMonth, { months: -1 })\n setCurrentMonth(format(firstDayNextMonth, \"MMM-yyyy\"))\n }\n\n function nextMonth() {\n const firstDayNextMonth = add(firstDayCurrentMonth, { months: 1 })\n setCurrentMonth(format(firstDayNextMonth, \"MMM-yyyy\"))\n }\n\n function goToToday() {\n setCurrentMonth(format(today, \"MMM-yyyy\"))\n }\n\n return (\n
\n \n
\n \n
\n
\n {days.map((day, dayIdx) => (\n \n ))}\n
\n\n
\n {days.map((day, dayIdx) => (\n \n ))}\n
\n
\n
\n
\n )\n}\n", + "type": "registry:component", + "target": "" + }, + { + "path": "blocks/fullscreen-calendar/components/fullscreen-calendar-day.tsx", + "content": "\"use client\"\n\nimport React from \"react\"\nimport {\n format,\n getDay,\n isEqual,\n isSameDay,\n isSameMonth,\n isToday,\n} from \"date-fns\"\n\nimport { cn } from \"@/lib/utils\"\nimport { useMediaQuery } from \"@/hooks/use-media-query\"\n\ninterface FullscreenCalendarDayProps {\n day: Date\n selectedDay: Date\n setSelectedDay: React.Dispatch>\n firstDayCurrentMonth: Date\n dayIndex: number\n data: {\n day: Date\n events: {\n id: number\n name: string\n time: string\n datetime: string\n }[]\n }[]\n}\n\nconst colStartClasses = [\n \"\",\n \"col-start-2\",\n \"col-start-3\",\n \"col-start-4\",\n \"col-start-5\",\n \"col-start-6\",\n \"col-start-7\",\n]\n\nexport function FullScreenCalendarDay({\n day,\n selectedDay,\n setSelectedDay,\n firstDayCurrentMonth,\n dayIndex,\n data,\n}: FullscreenCalendarDayProps) {\n const isDesktop = useMediaQuery(\"(min-width: 768px)\")\n\n if (!isDesktop) {\n return (\n setSelectedDay(day)}\n key={dayIndex}\n type=\"button\"\n className={cn(\n isEqual(day, selectedDay) && \"text-primary-foreground\",\n !isEqual(day, selectedDay) &&\n !isToday(day) &&\n isSameMonth(day, firstDayCurrentMonth) &&\n \"text-foreground\",\n !isEqual(day, selectedDay) &&\n !isToday(day) &&\n !isSameMonth(day, firstDayCurrentMonth) &&\n \"text-muted-foreground\",\n (isEqual(day, selectedDay) || isToday(day)) && \"font-semibold\",\n \"flex h-14 flex-col border-b border-r px-3 py-2 hover:bg-muted focus:z-10\"\n )}\n >\n \n {format(day, \"d\")}\n \n {data.filter((date) => isSameDay(date.day, day)).length > 0 && (\n
\n {data\n .filter((date) => isSameDay(date.day, day))\n .map((date) => (\n \n {date.events.map((event) => (\n \n ))}\n
\n ))}\n \n )}\n \n )\n }\n\n return (\n setSelectedDay(day)}\n className={cn(\n dayIndex === 0 && colStartClasses[getDay(day)],\n !isEqual(day, selectedDay) &&\n !isToday(day) &&\n !isSameMonth(day, firstDayCurrentMonth) &&\n \"bg-accent/50 text-muted-foreground\",\n \"relative flex flex-col border-b border-r hover:bg-muted focus:z-10\",\n !isEqual(day, selectedDay) && \"hover:bg-accent/75\"\n )}\n >\n
\n \n \n \n
\n
\n {data\n .filter((event) => isSameDay(event.day, day))\n .map((day) => (\n
\n {day.events.slice(0, 1).map((event) => (\n \n

{event.name}

\n

\n {event.time}\n

\n
\n ))}\n {day.events.length > 1 && (\n
\n + {day.events.length - 1} more\n
\n )}\n
\n ))}\n \n \n )\n}\n", + "type": "registry:component", + "target": "" + }, + { + "path": "blocks/fullscreen-calendar/components/fullscreen-calendar-header.tsx", + "content": "\"use client\"\n\nimport React from \"react\"\nimport { format, startOfToday } from \"date-fns\"\nimport {\n ChevronLeftIcon,\n ChevronRightIcon,\n PlusCircleIcon,\n SearchIcon,\n} from \"lucide-react\"\n\nimport { Button } from \"@/registry/new-york/ui/button\"\nimport { Separator } from \"@/registry/new-york/ui/separator\"\n\ninterface FullScreenCalendarHeaderProps {\n startOfMonth: Date\n endOfMonth: Date\n nextMonth: () => void\n goToToday: () => void\n previousMonth: () => void\n}\n\nexport function FullScreenCalendarHeader({\n nextMonth,\n goToToday,\n previousMonth,\n startOfMonth,\n endOfMonth,\n}: FullScreenCalendarHeaderProps) {\n const today = startOfToday()\n\n return (\n
\n
\n
\n
\n

\n {format(today, \"MMM\")}\n

\n
\n {format(today, \"d\")}\n
\n
\n
\n

\n {format(startOfMonth, \"MMMM, yyyy\")}\n

\n

\n {format(startOfMonth, \"MMM d, yyyy\")} -{\" \"}\n {format(endOfMonth, \"MMM d, yyyy\")}\n

\n
\n
\n
\n\n
\n \n\n \n\n
\n \n \n \n \n Today\n \n \n \n \n
\n\n \n\n \n\n \n
\n
\n )\n}\n", + "type": "registry:component", + "target": "" + }, + { + "path": "blocks/fullscreen-calendar/components/fullscreen-calendar-week-days.tsx", + "content": "import React from \"react\"\n\nexport function FullScreenCalendarWeekDays() {\n return (\n
\n
Sun
\n
Mon
\n
Tue
\n
Wed
\n
Thu
\n
Fri
\n
Sat
\n
\n )\n}\n", + "type": "registry:component", + "target": "" + } + ], + "categories": [ + "calendars" + ] +} \ No newline at end of file diff --git a/apps/www/registry/default/blocks/fullscreen-calendar/components/fullscreen-calendar-day.tsx b/apps/www/registry/default/blocks/fullscreen-calendar/components/fullscreen-calendar-day.tsx new file mode 100644 index 00000000000..27a45083bb7 --- /dev/null +++ b/apps/www/registry/default/blocks/fullscreen-calendar/components/fullscreen-calendar-day.tsx @@ -0,0 +1,174 @@ +"use client" + +import React from "react" +import { + format, + getDay, + isEqual, + isSameDay, + isSameMonth, + isToday, +} from "date-fns" + +import { cn } from "@/lib/utils" +import { useMediaQuery } from "@/hooks/use-media-query" + +interface FullscreenCalendarDayProps { + day: Date + selectedDay: Date + setSelectedDay: React.Dispatch> + firstDayCurrentMonth: Date + dayIndex: number + data: { + day: Date + events: { + id: number + name: string + time: string + datetime: string + }[] + }[] +} + +const colStartClasses = [ + "", + "col-start-2", + "col-start-3", + "col-start-4", + "col-start-5", + "col-start-6", + "col-start-7", +] + +export function FullScreenCalendarDay({ + day, + selectedDay, + setSelectedDay, + firstDayCurrentMonth, + dayIndex, + data, +}: FullscreenCalendarDayProps) { + const isDesktop = useMediaQuery("(min-width: 768px)") + + if (!isDesktop) { + return ( + + ) + } + + return ( +
setSelectedDay(day)} + className={cn( + dayIndex === 0 && colStartClasses[getDay(day)], + !isEqual(day, selectedDay) && + !isToday(day) && + !isSameMonth(day, firstDayCurrentMonth) && + "bg-accent/50 text-muted-foreground", + "relative flex flex-col border-b border-r hover:bg-muted focus:z-10", + !isEqual(day, selectedDay) && "hover:bg-accent/75" + )} + > +
+ +
+
+ {data + .filter((event) => isSameDay(event.day, day)) + .map((day) => ( +
+ {day.events.slice(0, 1).map((event) => ( +
+

{event.name}

+

+ {event.time} +

+
+ ))} + {day.events.length > 1 && ( +
+ + {day.events.length - 1} more +
+ )} +
+ ))} +
+
+ ) +} diff --git a/apps/www/registry/default/blocks/fullscreen-calendar/components/fullscreen-calendar-header.tsx b/apps/www/registry/default/blocks/fullscreen-calendar/components/fullscreen-calendar-header.tsx new file mode 100644 index 00000000000..7af48917fbb --- /dev/null +++ b/apps/www/registry/default/blocks/fullscreen-calendar/components/fullscreen-calendar-header.tsx @@ -0,0 +1,105 @@ +"use client" + +import React from "react" +import { format, startOfToday } from "date-fns" +import { + ChevronLeftIcon, + ChevronRightIcon, + PlusCircleIcon, + SearchIcon, +} from "lucide-react" + +import { Button } from "@/registry/default/ui/button" +import { Separator } from "@/registry/default/ui/separator" + +interface FullScreenCalendarHeaderProps { + startOfMonth: Date + endOfMonth: Date + nextMonth: () => void + goToToday: () => void + previousMonth: () => void +} + +export function FullScreenCalendarHeader({ + nextMonth, + goToToday, + previousMonth, + startOfMonth, + endOfMonth, +}: FullScreenCalendarHeaderProps) { + const today = startOfToday() + + return ( +
+
+
+
+

+ {format(today, "MMM")} +

+
+ {format(today, "d")} +
+
+
+

+ {format(startOfMonth, "MMMM, yyyy")} +

+

+ {format(startOfMonth, "MMM d, yyyy")} -{" "} + {format(endOfMonth, "MMM d, yyyy")} +

+
+
+
+ +
+ + + + +
+ + + +
+ + + + + + +
+
+ ) +} diff --git a/apps/www/registry/default/blocks/fullscreen-calendar/components/fullscreen-calendar-week-days.tsx b/apps/www/registry/default/blocks/fullscreen-calendar/components/fullscreen-calendar-week-days.tsx new file mode 100644 index 00000000000..8b584c318ce --- /dev/null +++ b/apps/www/registry/default/blocks/fullscreen-calendar/components/fullscreen-calendar-week-days.tsx @@ -0,0 +1,15 @@ +import React from "react" + +export function FullScreenCalendarWeekDays() { + return ( +
+
Sun
+
Mon
+
Tue
+
Wed
+
Thu
+
Fri
+
Sat
+
+ ) +} diff --git a/apps/www/registry/default/blocks/fullscreen-calendar/components/fullscreen-calendar.tsx b/apps/www/registry/default/blocks/fullscreen-calendar/components/fullscreen-calendar.tsx new file mode 100644 index 00000000000..aa1c25e7f38 --- /dev/null +++ b/apps/www/registry/default/blocks/fullscreen-calendar/components/fullscreen-calendar.tsx @@ -0,0 +1,287 @@ +"use client" + +import React from "react" +import { + add, + eachDayOfInterval, + endOfMonth, + endOfWeek, + format, + parse, + startOfToday, + startOfWeek, +} from "date-fns" + +import { FullScreenCalendarDay } from "@/registry/default/blocks/fullscreen-calendar/components/fullscreen-calendar-day" +import { FullScreenCalendarHeader } from "@/registry/default/blocks/fullscreen-calendar/components/fullscreen-calendar-header" +import { FullScreenCalendarWeekDays } from "@/registry/default/blocks/fullscreen-calendar/components/fullscreen-calendar-week-days" + +// Dummy data +const data = [ + { + day: new Date("2025-01-02"), + events: [ + { + id: 1, + name: "Q1 Planning Session", + time: "10:00 AM", + datetime: "2025-01-02T00:00", + }, + { + id: 2, + name: "Team Sync", + time: "2:00 PM", + datetime: "2025-01-02T00:00", + }, + ], + }, + { + day: new Date("2025-01-07"), + events: [ + { + id: 3, + name: "Product Launch Review", + time: "2:00 PM", + datetime: "2025-01-07T00:00", + }, + { + id: 4, + name: "Marketing Sync", + time: "11:00 AM", + datetime: "2025-01-07T00:00", + }, + { + id: 5, + name: "Vendor Meeting", + time: "4:30 PM", + datetime: "2025-01-07T00:00", + }, + ], + }, + { + day: new Date("2025-01-10"), + events: [ + { + id: 6, + name: "Team Building Workshop", + time: "11:00 AM", + datetime: "2025-01-10T00:00", + }, + ], + }, + { + day: new Date("2025-01-13"), + events: [ + { + id: 7, + name: "Budget Analysis Meeting", + time: "3:30 PM", + datetime: "2025-01-14T00:00", + }, + { + id: 8, + name: "Sprint Planning", + time: "9:00 AM", + datetime: "2025-01-14T00:00", + }, + { + id: 9, + name: "Design Review", + time: "1:00 PM", + datetime: "2025-01-14T00:00", + }, + ], + }, + { + day: new Date("2025-01-16"), + events: [ + { + id: 10, + name: "Client Presentation", + time: "10:00 AM", + datetime: "2025-01-16T00:00", + }, + { + id: 11, + name: "Team Lunch", + time: "12:30 PM", + datetime: "2025-01-16T00:00", + }, + { + id: 12, + name: "Project Status Update", + time: "2:00 PM", + datetime: "2025-01-16T00:00", + }, + ], + }, + { + day: new Date("2025-01-21"), + events: [ + { + id: 13, + name: "Tech Stack Review", + time: "1:00 PM", + datetime: "2025-01-21T00:00", + }, + { + id: 14, + name: "Security Training", + time: "3:00 PM", + datetime: "2025-01-21T00:00", + }, + ], + }, + { + day: new Date("2025-01-23"), + events: [ + { + id: 15, + name: "Marketing Strategy Session", + time: "2:30 PM", + datetime: "2025-01-23T00:00", + }, + { + id: 16, + name: "Social Media Planning", + time: "10:00 AM", + datetime: "2025-01-23T00:00", + }, + { + id: 17, + name: "Content Review", + time: "4:00 PM", + datetime: "2025-01-23T00:00", + }, + ], + }, + { + day: new Date("2025-01-28"), + events: [ + { + id: 18, + name: "Monthly All-Hands", + time: "4:00 PM", + datetime: "2025-01-28T00:00", + }, + { + id: 19, + name: "Department Sync", + time: "10:30 AM", + datetime: "2025-01-28T00:00", + }, + ], + }, + { + day: new Date("2025-01-30"), + events: [ + { + id: 20, + name: "Project Retrospective", + time: "11:30 AM", + datetime: "2025-01-30T00:00", + }, + { + id: 21, + name: "Sprint Demo", + time: "2:00 PM", + datetime: "2025-01-30T00:00", + }, + ], + }, + { + day: new Date("2025-01-31"), + events: [ + { + id: 22, + name: "Quarterly Report Review", + time: "3:00 PM", + datetime: "2025-01-31T00:00", + }, + { + id: 23, + name: "Year Planning", + time: "9:30 AM", + datetime: "2025-01-31T00:00", + }, + { + id: 24, + name: "Team Happy Hour", + time: "5:00 PM", + datetime: "2025-01-31T00:00", + }, + ], + }, +] + +export function FullScreenCalendar() { + const today = startOfToday() + const [selectedDay, setSelectedDay] = React.useState(today) + const [currentMonth, setCurrentMonth] = React.useState( + format(today, "MMM-yyyy") + ) + const firstDayCurrentMonth = parse(currentMonth, "MMM-yyyy", new Date()) + + const days = eachDayOfInterval({ + start: startOfWeek(firstDayCurrentMonth), + end: endOfWeek(endOfMonth(firstDayCurrentMonth)), + }) + + function previousMonth() { + const firstDayNextMonth = add(firstDayCurrentMonth, { months: -1 }) + setCurrentMonth(format(firstDayNextMonth, "MMM-yyyy")) + } + + function nextMonth() { + const firstDayNextMonth = add(firstDayCurrentMonth, { months: 1 }) + setCurrentMonth(format(firstDayNextMonth, "MMM-yyyy")) + } + + function goToToday() { + setCurrentMonth(format(today, "MMM-yyyy")) + } + + return ( +
+ +
+ +
+
+ {days.map((day, dayIdx) => ( + + ))} +
+ +
+ {days.map((day, dayIdx) => ( + + ))} +
+
+
+
+ ) +} diff --git a/apps/www/registry/default/blocks/fullscreen-calendar/page.tsx b/apps/www/registry/default/blocks/fullscreen-calendar/page.tsx new file mode 100644 index 00000000000..9e413c6efed --- /dev/null +++ b/apps/www/registry/default/blocks/fullscreen-calendar/page.tsx @@ -0,0 +1,9 @@ +import { FullScreenCalendar } from "@/registry/default/blocks/fullscreen-calendar/components/fullscreen-calendar" + +export default function Page() { + return ( +
+ +
+ ) +} diff --git a/apps/www/registry/new-york/blocks/fullscreen-calendar/components/fullscreen-calendar-day.tsx b/apps/www/registry/new-york/blocks/fullscreen-calendar/components/fullscreen-calendar-day.tsx new file mode 100644 index 00000000000..27a45083bb7 --- /dev/null +++ b/apps/www/registry/new-york/blocks/fullscreen-calendar/components/fullscreen-calendar-day.tsx @@ -0,0 +1,174 @@ +"use client" + +import React from "react" +import { + format, + getDay, + isEqual, + isSameDay, + isSameMonth, + isToday, +} from "date-fns" + +import { cn } from "@/lib/utils" +import { useMediaQuery } from "@/hooks/use-media-query" + +interface FullscreenCalendarDayProps { + day: Date + selectedDay: Date + setSelectedDay: React.Dispatch> + firstDayCurrentMonth: Date + dayIndex: number + data: { + day: Date + events: { + id: number + name: string + time: string + datetime: string + }[] + }[] +} + +const colStartClasses = [ + "", + "col-start-2", + "col-start-3", + "col-start-4", + "col-start-5", + "col-start-6", + "col-start-7", +] + +export function FullScreenCalendarDay({ + day, + selectedDay, + setSelectedDay, + firstDayCurrentMonth, + dayIndex, + data, +}: FullscreenCalendarDayProps) { + const isDesktop = useMediaQuery("(min-width: 768px)") + + if (!isDesktop) { + return ( + + ) + } + + return ( +
setSelectedDay(day)} + className={cn( + dayIndex === 0 && colStartClasses[getDay(day)], + !isEqual(day, selectedDay) && + !isToday(day) && + !isSameMonth(day, firstDayCurrentMonth) && + "bg-accent/50 text-muted-foreground", + "relative flex flex-col border-b border-r hover:bg-muted focus:z-10", + !isEqual(day, selectedDay) && "hover:bg-accent/75" + )} + > +
+ +
+
+ {data + .filter((event) => isSameDay(event.day, day)) + .map((day) => ( +
+ {day.events.slice(0, 1).map((event) => ( +
+

{event.name}

+

+ {event.time} +

+
+ ))} + {day.events.length > 1 && ( +
+ + {day.events.length - 1} more +
+ )} +
+ ))} +
+
+ ) +} diff --git a/apps/www/registry/new-york/blocks/fullscreen-calendar/components/fullscreen-calendar-header.tsx b/apps/www/registry/new-york/blocks/fullscreen-calendar/components/fullscreen-calendar-header.tsx new file mode 100644 index 00000000000..61ede970824 --- /dev/null +++ b/apps/www/registry/new-york/blocks/fullscreen-calendar/components/fullscreen-calendar-header.tsx @@ -0,0 +1,105 @@ +"use client" + +import React from "react" +import { format, startOfToday } from "date-fns" +import { + ChevronLeftIcon, + ChevronRightIcon, + PlusCircleIcon, + SearchIcon, +} from "lucide-react" + +import { Button } from "@/registry/new-york/ui/button" +import { Separator } from "@/registry/new-york/ui/separator" + +interface FullScreenCalendarHeaderProps { + startOfMonth: Date + endOfMonth: Date + nextMonth: () => void + goToToday: () => void + previousMonth: () => void +} + +export function FullScreenCalendarHeader({ + nextMonth, + goToToday, + previousMonth, + startOfMonth, + endOfMonth, +}: FullScreenCalendarHeaderProps) { + const today = startOfToday() + + return ( +
+
+
+
+

+ {format(today, "MMM")} +

+
+ {format(today, "d")} +
+
+
+

+ {format(startOfMonth, "MMMM, yyyy")} +

+

+ {format(startOfMonth, "MMM d, yyyy")} -{" "} + {format(endOfMonth, "MMM d, yyyy")} +

+
+
+
+ +
+ + + + +
+ + + +
+ + + + + + +
+
+ ) +} diff --git a/apps/www/registry/new-york/blocks/fullscreen-calendar/components/fullscreen-calendar-week-days.tsx b/apps/www/registry/new-york/blocks/fullscreen-calendar/components/fullscreen-calendar-week-days.tsx new file mode 100644 index 00000000000..8b584c318ce --- /dev/null +++ b/apps/www/registry/new-york/blocks/fullscreen-calendar/components/fullscreen-calendar-week-days.tsx @@ -0,0 +1,15 @@ +import React from "react" + +export function FullScreenCalendarWeekDays() { + return ( +
+
Sun
+
Mon
+
Tue
+
Wed
+
Thu
+
Fri
+
Sat
+
+ ) +} diff --git a/apps/www/registry/new-york/blocks/fullscreen-calendar/components/fullscreen-calendar.tsx b/apps/www/registry/new-york/blocks/fullscreen-calendar/components/fullscreen-calendar.tsx new file mode 100644 index 00000000000..dff0d178c98 --- /dev/null +++ b/apps/www/registry/new-york/blocks/fullscreen-calendar/components/fullscreen-calendar.tsx @@ -0,0 +1,287 @@ +"use client" + +import React from "react" +import { + add, + eachDayOfInterval, + endOfMonth, + endOfWeek, + format, + parse, + startOfToday, + startOfWeek, +} from "date-fns" + +import { FullScreenCalendarDay } from "@/registry/new-york/blocks/fullscreen-calendar/components/fullscreen-calendar-day" +import { FullScreenCalendarHeader } from "@/registry/new-york/blocks/fullscreen-calendar/components/fullscreen-calendar-header" +import { FullScreenCalendarWeekDays } from "@/registry/new-york/blocks/fullscreen-calendar/components/fullscreen-calendar-week-days" + +// Dummy data +const data = [ + { + day: new Date("2025-01-02"), + events: [ + { + id: 1, + name: "Q1 Planning Session", + time: "10:00 AM", + datetime: "2025-01-02T00:00", + }, + { + id: 2, + name: "Team Sync", + time: "2:00 PM", + datetime: "2025-01-02T00:00", + }, + ], + }, + { + day: new Date("2025-01-07"), + events: [ + { + id: 3, + name: "Product Launch Review", + time: "2:00 PM", + datetime: "2025-01-07T00:00", + }, + { + id: 4, + name: "Marketing Sync", + time: "11:00 AM", + datetime: "2025-01-07T00:00", + }, + { + id: 5, + name: "Vendor Meeting", + time: "4:30 PM", + datetime: "2025-01-07T00:00", + }, + ], + }, + { + day: new Date("2025-01-10"), + events: [ + { + id: 6, + name: "Team Building Workshop", + time: "11:00 AM", + datetime: "2025-01-10T00:00", + }, + ], + }, + { + day: new Date("2025-01-13"), + events: [ + { + id: 7, + name: "Budget Analysis Meeting", + time: "3:30 PM", + datetime: "2025-01-14T00:00", + }, + { + id: 8, + name: "Sprint Planning", + time: "9:00 AM", + datetime: "2025-01-14T00:00", + }, + { + id: 9, + name: "Design Review", + time: "1:00 PM", + datetime: "2025-01-14T00:00", + }, + ], + }, + { + day: new Date("2025-01-16"), + events: [ + { + id: 10, + name: "Client Presentation", + time: "10:00 AM", + datetime: "2025-01-16T00:00", + }, + { + id: 11, + name: "Team Lunch", + time: "12:30 PM", + datetime: "2025-01-16T00:00", + }, + { + id: 12, + name: "Project Status Update", + time: "2:00 PM", + datetime: "2025-01-16T00:00", + }, + ], + }, + { + day: new Date("2025-01-21"), + events: [ + { + id: 13, + name: "Tech Stack Review", + time: "1:00 PM", + datetime: "2025-01-21T00:00", + }, + { + id: 14, + name: "Security Training", + time: "3:00 PM", + datetime: "2025-01-21T00:00", + }, + ], + }, + { + day: new Date("2025-01-23"), + events: [ + { + id: 15, + name: "Marketing Strategy Session", + time: "2:30 PM", + datetime: "2025-01-23T00:00", + }, + { + id: 16, + name: "Social Media Planning", + time: "10:00 AM", + datetime: "2025-01-23T00:00", + }, + { + id: 17, + name: "Content Review", + time: "4:00 PM", + datetime: "2025-01-23T00:00", + }, + ], + }, + { + day: new Date("2025-01-28"), + events: [ + { + id: 18, + name: "Monthly All-Hands", + time: "4:00 PM", + datetime: "2025-01-28T00:00", + }, + { + id: 19, + name: "Department Sync", + time: "10:30 AM", + datetime: "2025-01-28T00:00", + }, + ], + }, + { + day: new Date("2025-01-30"), + events: [ + { + id: 20, + name: "Project Retrospective", + time: "11:30 AM", + datetime: "2025-01-30T00:00", + }, + { + id: 21, + name: "Sprint Demo", + time: "2:00 PM", + datetime: "2025-01-30T00:00", + }, + ], + }, + { + day: new Date("2025-01-31"), + events: [ + { + id: 22, + name: "Quarterly Report Review", + time: "3:00 PM", + datetime: "2025-01-31T00:00", + }, + { + id: 23, + name: "Year Planning", + time: "9:30 AM", + datetime: "2025-01-31T00:00", + }, + { + id: 24, + name: "Team Happy Hour", + time: "5:00 PM", + datetime: "2025-01-31T00:00", + }, + ], + }, +] + +export function FullScreenCalendar() { + const today = startOfToday() + const [selectedDay, setSelectedDay] = React.useState(today) + const [currentMonth, setCurrentMonth] = React.useState( + format(today, "MMM-yyyy") + ) + const firstDayCurrentMonth = parse(currentMonth, "MMM-yyyy", new Date()) + + const days = eachDayOfInterval({ + start: startOfWeek(firstDayCurrentMonth), + end: endOfWeek(endOfMonth(firstDayCurrentMonth)), + }) + + function previousMonth() { + const firstDayNextMonth = add(firstDayCurrentMonth, { months: -1 }) + setCurrentMonth(format(firstDayNextMonth, "MMM-yyyy")) + } + + function nextMonth() { + const firstDayNextMonth = add(firstDayCurrentMonth, { months: 1 }) + setCurrentMonth(format(firstDayNextMonth, "MMM-yyyy")) + } + + function goToToday() { + setCurrentMonth(format(today, "MMM-yyyy")) + } + + return ( +
+ +
+ +
+
+ {days.map((day, dayIdx) => ( + + ))} +
+ +
+ {days.map((day, dayIdx) => ( + + ))} +
+
+
+
+ ) +} diff --git a/apps/www/registry/new-york/blocks/fullscreen-calendar/page.tsx b/apps/www/registry/new-york/blocks/fullscreen-calendar/page.tsx new file mode 100644 index 00000000000..486735d1ae8 --- /dev/null +++ b/apps/www/registry/new-york/blocks/fullscreen-calendar/page.tsx @@ -0,0 +1,9 @@ +import { FullScreenCalendar } from "@/registry/new-york/blocks/fullscreen-calendar/components/fullscreen-calendar" + +export default function Page() { + return ( +
+ +
+ ) +} diff --git a/apps/www/registry/registry-blocks.ts b/apps/www/registry/registry-blocks.ts index 956be895488..47a045c1954 100644 --- a/apps/www/registry/registry-blocks.ts +++ b/apps/www/registry/registry-blocks.ts @@ -567,4 +567,38 @@ export const blocks: Registry["items"] = [ ], categories: ["authentication", "login"], }, + { + name: "fullscreen-calendar", + author: "Ahmed Mayara (https://ahmedmayara.vercel.app)", + title: "Fullscreen Calendar", + description: + "A simple fullscreen calendar that allows to navigate between months and displays events.", + type: "registry:block", + registryDependencies: ["button", "separator"], + dependencies: ["date-fns"], + files: [ + { + path: "blocks/fullscreen-calendar/page.tsx", + type: "registry:page", + target: "app/fullscreen-calendar/page.tsx", + }, + { + path: "blocks/fullscreen-calendar/components/fullscreen-calendar.tsx", + type: "registry:component", + }, + { + path: "blocks/fullscreen-calendar/components/fullscreen-calendar-day.tsx", + type: "registry:component", + }, + { + path: "blocks/fullscreen-calendar/components/fullscreen-calendar-header.tsx", + type: "registry:component", + }, + { + path: "blocks/fullscreen-calendar/components/fullscreen-calendar-week-days.tsx", + type: "registry:component", + }, + ], + categories: ["calendars"], + }, ] diff --git a/apps/www/registry/registry-categories.ts b/apps/www/registry/registry-categories.ts index 8687469fd0e..82328fb2deb 100644 --- a/apps/www/registry/registry-categories.ts +++ b/apps/www/registry/registry-categories.ts @@ -59,4 +59,9 @@ export const registryCategories = [ slug: "charts-tooltip", hidden: true, }, + { + name: "Calendars", + slug: "calendars", + hidden: false, + }, ]