diff --git a/public/r/calendar-lg-03.json b/public/r/calendar-lg-03.json index 3e7ed8d..7677c0a 100644 --- a/public/r/calendar-lg-03.json +++ b/public/r/calendar-lg-03.json @@ -14,7 +14,7 @@ "files": [ { "path": "registry/default/widgets/calendar/lg/calendar-03.tsx", - "content": "import React from \"react\";\nimport { ChevronLeftIcon, ChevronRightIcon } from \"lucide-react\";\n\nimport {\n Widget,\n WidgetContent,\n WidgetHeader,\n WidgetTitle,\n} from \"@/registry/default/ui/widget\";\nimport { Label } from \"@/registry/default/ui/label\";\nimport { Button } from \"@/registry/default/ui/button\";\nimport {\n Avatar,\n AvatarFallback,\n AvatarImage,\n} from \"@/registry/default/ui/avatar\";\n\nexport default function WidgetDemo() {\n const now = new Date();\n\n const monthName = now.toLocaleDateString(\"en-US\", { month: \"long\" });\n const date = now.getDate();\n\n const [selectedDate, setSelectedDate] = React.useState(now.getDate());\n\n const weekDates = Array.from(\n { length: 7 },\n (_, i) =>\n new Date(\n now.getFullYear(),\n now.getMonth(),\n now.getDate() - now.getDay() + i,\n ),\n );\n\n const lowerLimit = now.getDate() - 3;\n const upperLimit = now.getDate() + 3;\n\n const allTasks = [\n {\n imageURL: \"https://avatars.githubusercontent.com/u/6751787?v=4\",\n title: \"Teach Theo Elixir\",\n time: \"8:30 AM\",\n },\n {\n imageURL: \"https://avatars.githubusercontent.com/u/124599?v=4\",\n title: \"Meeting with ShadCN\",\n time: \"12:30 PM\",\n },\n {\n imageURL: \"https://owcdn.net/img/62bbebb185a7e.png\",\n title: \"PRX vs G2\",\n time: \"3:30 PM\",\n },\n {\n imageURL: \"https://avatars.githubusercontent.com/u/7549148?v=4\",\n title: \"Warcraft with Orc! ⚔️\",\n time: \"7:30 PM\",\n },\n {\n imageURL: \"https://avatars.githubusercontent.com/u/23276437?v=4\",\n title: \"Teaching Tailwind\",\n time: \"10:00 AM\",\n },\n {\n imageURL: \"https://avatars.githubusercontent.com/u/14985020?s=200&v=4\",\n title: \"Wigggle UI Vercel OSS\",\n time: \"4:30 PM\",\n },\n ];\n\n const getRandomTasks = () => {\n const count = Math.random() > 0.5 ? 2 : 3;\n const indices = new Set();\n while (indices.size < count) {\n indices.add(Math.floor(Math.random() * allTasks.length));\n }\n return Array.from(indices).map((i) => allTasks[i]);\n };\n\n const tasks = getRandomTasks();\n\n return (\n \n \n \n {date} {monthName}\n \n {\n setSelectedDate(now.getDate());\n }}\n variant=\"secondary\"\n size=\"sm\"\n >\n Today\n \n \n \n
\n {\n selectedDate > lowerLimit\n ? setSelectedDate(selectedDate - 1)\n : setSelectedDate(lowerLimit);\n }}\n variant=\"outline\"\n size=\"icon-sm\"\n >\n \n \n
\n {[\"S\", \"M\", \"T\", \"W\", \"T\", \"F\", \"S\"].map((day, i) => (\n \n {day}\n \n ))}\n {weekDates.map((d, i) => {\n const isToday = d.getDate() === selectedDate;\n return (\n \n {d.getDate()}\n \n );\n })}\n
\n {\n selectedDate < upperLimit\n ? setSelectedDate(selectedDate + 1)\n : setSelectedDate(upperLimit);\n }}\n variant=\"outline\"\n size=\"icon-sm\"\n >\n \n \n
\n {tasks.map((el) => (\n \n \n \n {el.title.slice(0, 1)}\n \n
\n \n \n
\n \n ))}\n
\n
\n );\n}\n", + "content": "import React from \"react\";\nimport { ChevronLeftIcon, ChevronRightIcon } from \"lucide-react\";\n\nimport {\n Widget,\n WidgetContent,\n WidgetHeader,\n WidgetTitle,\n} from \"@/registry/default/ui/widget\";\nimport { Label } from \"@/registry/default/ui/label\";\nimport { Button } from \"@/registry/default/ui/button\";\nimport {\n Avatar,\n AvatarFallback,\n AvatarImage,\n} from \"@/registry/default/ui/avatar\";\n\nexport default function WidgetDemo() {\n const now = new Date();\n\n const monthName = now.toLocaleDateString(\"en-US\", { month: \"long\" });\n const date = now.getDate();\n\n const [selectedDate, setSelectedDate] = React.useState(now.getDate());\n\n const weekDates = Array.from(\n { length: 7 },\n (_, i) =>\n new Date(\n now.getFullYear(),\n now.getMonth(),\n now.getDate() - now.getDay() + i,\n ),\n );\n\n const lowerLimit = now.getDate() - 3;\n const upperLimit = now.getDate() + 3;\n\n const allTasks = [\n {\n imageURL: \"https://avatars.githubusercontent.com/u/6751787?v=4\",\n title: \"Teach Theo Elixir\",\n time: \"8:30 AM\",\n },\n {\n imageURL: \"https://avatars.githubusercontent.com/u/124599?v=4\",\n title: \"Meeting with ShadCN\",\n time: \"12:30 PM\",\n },\n {\n imageURL: \"https://owcdn.net/img/62bbebb185a7e.png\",\n title: \"PRX vs G2\",\n time: \"3:30 PM\",\n },\n {\n imageURL: \"https://avatars.githubusercontent.com/u/7549148?v=4\",\n title: \"Warcraft with Orc! ⚔️\",\n time: \"7:30 PM\",\n },\n {\n imageURL: \"https://avatars.githubusercontent.com/u/23276437?v=4\",\n title: \"Teaching Tailwind\",\n time: \"10:00 AM\",\n },\n {\n imageURL: \"https://avatars.githubusercontent.com/u/14985020?s=200&v=4\",\n title: \"Wigggle UI Vercel OSS\",\n time: \"4:30 PM\",\n },\n ];\n\n const getRandomTasks = () => {\n const count = Math.random() > 0.5 ? 2 : 3;\n const indices = new Set();\n while (indices.size < count) {\n indices.add(Math.floor(Math.random() * allTasks.length));\n }\n return Array.from(indices).map((i) => allTasks[i]);\n };\n\n const tasks = getRandomTasks();\n\n return (\n \n \n \n {date} {monthName}\n \n {\n setSelectedDate(now.getDate());\n }}\n variant=\"secondary\"\n size=\"sm\"\n >\n Today\n \n \n \n
\n {\n selectedDate > lowerLimit\n ? setSelectedDate(selectedDate - 1)\n : setSelectedDate(lowerLimit);\n }}\n variant=\"outline\"\n size=\"icon-sm\"\n >\n \n \n
\n {[\"S\", \"M\", \"T\", \"W\", \"T\", \"F\", \"S\"].map((day, i) => (\n \n {day}\n \n ))}\n {weekDates.map((d, i) => {\n const isToday = d.getDate() === selectedDate;\n return (\n \n {d.getDate()}\n \n );\n })}\n
\n {\n selectedDate < upperLimit\n ? setSelectedDate(selectedDate + 1)\n : setSelectedDate(upperLimit);\n }}\n variant=\"outline\"\n size=\"icon-sm\"\n >\n \n \n
\n {tasks.map((el) => (\n \n \n \n {el.title.slice(0, 1)}\n \n
\n \n \n
\n \n ))}\n
\n
\n );\n}\n", "type": "registry:component" } ], diff --git a/public/r/calendar-lg-04.json b/public/r/calendar-lg-04.json index 1334788..180c653 100644 --- a/public/r/calendar-lg-04.json +++ b/public/r/calendar-lg-04.json @@ -10,7 +10,7 @@ "files": [ { "path": "registry/default/widgets/calendar/lg/calendar-04.tsx", - "content": "import {\n Widget,\n WidgetContent,\n WidgetHeader,\n WidgetTitle,\n} from \"@/registry/default/ui/widget\";\nimport { Label } from \"@/registry/default/ui/label\";\nimport { Separator } from \"@/registry/default/ui/separator\";\n\nexport default function WidgetDemo() {\n const now = new Date();\n\n const monthName = now.toLocaleDateString(\"en-US\", { month: \"long\" });\n const date = now.getDate();\n const day = now.toLocaleDateString(\"en-US\", { weekday: \"short\" });\n\n const tomorrow = new Date(now.getTime() + 86400000);\n const nextDate = tomorrow.getDate();\n const nextDay = tomorrow.toLocaleDateString(\"en-US\", { weekday: \"short\" });\n\n return (\n \n \n \n {monthName}\n \n \n \n
\n
\n \n \n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n
\n \n
\n
\n \n \n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n
\n
\n
\n );\n}\n", + "content": "import {\n Widget,\n WidgetContent,\n WidgetHeader,\n WidgetTitle,\n} from \"@/registry/default/ui/widget\";\nimport { Label } from \"@/registry/default/ui/label\";\nimport { Separator } from \"@/registry/default/ui/separator\";\n\nexport default function WidgetDemo() {\n const now = new Date();\n\n const monthName = now.toLocaleDateString(\"en-US\", { month: \"long\" });\n const date = now.getDate();\n const day = now.toLocaleDateString(\"en-US\", { weekday: \"short\" });\n\n const tomorrow = new Date(now.getTime() + 86400000);\n const nextDate = tomorrow.getDate();\n const nextDay = tomorrow.toLocaleDateString(\"en-US\", { weekday: \"short\" });\n\n return (\n \n \n \n {monthName}\n \n \n \n
\n
\n \n \n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n
\n \n
\n
\n \n \n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n
\n
\n
\n );\n}\n", "type": "registry:component" } ], diff --git a/public/r/calendar-sm-10.json b/public/r/calendar-sm-10.json index 1e1ab65..f4fb4f7 100644 --- a/public/r/calendar-sm-10.json +++ b/public/r/calendar-sm-10.json @@ -9,7 +9,7 @@ "files": [ { "path": "registry/default/widgets/calendar/sm/calendar-10.tsx", - "content": "import { Widget, WidgetContent } from \"@/registry/default/ui/widget\";\nimport { Label } from \"@/registry/default/ui/label\";\n\nexport default function WidgetDemo() {\n const now = new Date();\n\n const day = now.toLocaleDateString(\"en-US\", { weekday: \"long\" });\n const date = now.getDate().toString().padStart(2, \"0\");\n\n return (\n \n \n
\n
\n \n \n
\n
\n
\n \n
\n \n \n
\n
\n
\n
\n );\n}\n", + "content": "import { Widget, WidgetContent } from \"@/registry/default/ui/widget\";\nimport { Label } from \"@/registry/default/ui/label\";\n\nexport default function WidgetDemo() {\n const now = new Date();\n\n const day = now.toLocaleDateString(\"en-US\", { weekday: \"long\" });\n const date = now.getDate().toString().padStart(2, \"0\");\n\n return (\n \n \n
\n
\n \n \n
\n
\n
\n \n
\n \n \n
\n
\n
\n
\n );\n}\n", "type": "registry:component" } ], diff --git a/registry/default/widgets/calendar/lg/calendar-03.tsx b/registry/default/widgets/calendar/lg/calendar-03.tsx index 36fefd4..b887c04 100644 --- a/registry/default/widgets/calendar/lg/calendar-03.tsx +++ b/registry/default/widgets/calendar/lg/calendar-03.tsx @@ -83,7 +83,7 @@ export default function WidgetDemo() { return ( - + {date} {monthName}