- "content": "import { type VariantProps, cva } from \"class-variance-authority\";\nimport { DayPicker } from \"react-day-picker\";\n\nimport { cn } from \"@/lib/utils\";\n\nimport { Calendar as ShadcnCalendar } from \"@/components/ui/calendar\";\n\nimport { buttonVariants } from \"./button\";\nimport \"./styles/retro.css\";\n\nexport const calendarVariants = cva(\"\", {\n variants: {\n font: {\n normal: \"\",\n retro: \"retro\",\n },\n },\n defaultVariants: {\n font: \"retro\",\n },\n});\n\nexport type CalendarProps = React.ComponentProps<typeof DayPicker> &\n VariantProps<typeof calendarVariants>;\n\nfunction Calendar({ className, classNames, font, ...props }: CalendarProps) {\n return (\n <div\n className={cn(\n \"flex bg-popover justify-center relative border-y-6 border-foreground dark:border-ring !p-0\",\n className\n )}\n >\n <ShadcnCalendar\n className={cn(\n calendarVariants({\n className,\n font,\n })\n )}\n classNames={{\n nav_button: cn(\n buttonVariants({ variant: \"outline\" }),\n \"size-7 bg-transparent p-0 flex items-center justify-center hover:opacity-50 border-2 border-foreground dark:border-ring\"\n ),\n day: cn(\n buttonVariants({ variant: \"ghost\" }),\n \"size-9 p-0 font-normal aria-selected:opacity-100\"\n ),\n caption_label: \"text-xs font-medium\",\n ...classNames,\n }}\n components={{\n IconLeft: ({ className, ...props }) => (\n <svg\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n xmlns=\"http://www.w3.org/2000/svg\"\n stroke=\"currentColor\"\n strokeWidth=\"0.25\"\n color=\"\"\n className={cn(\"size-4 shrink-0\", className)}\n aria-label=\"chevron-left\"\n {...props}\n >\n <rect\n width=\"14\"\n height=\"14\"\n rx=\"1\"\n transform=\"matrix(-1 0 0 1 128 136)\"\n ></rect>\n <rect\n width=\"14\"\n height=\"14\"\n rx=\"1\"\n transform=\"matrix(-1 0 0 1 144 152)\"\n ></rect>\n <rect\n width=\"14\"\n height=\"14\"\n rx=\"1\"\n transform=\"matrix(-1 0 0 1 160 72)\"\n ></rect>\n <rect\n width=\"14\"\n height=\"14\"\n rx=\"1\"\n transform=\"matrix(-1 0 0 1 160 168)\"\n ></rect>\n <rect\n width=\"14\"\n height=\"14\"\n rx=\"1\"\n transform=\"matrix(-1 0 0 1 112 120)\"\n ></rect>\n <rect\n width=\"14\"\n height=\"14\"\n rx=\"1\"\n transform=\"matrix(-1 0 0 1 128 104)\"\n ></rect>\n <rect\n width=\"14\"\n height=\"14\"\n rx=\"1\"\n transform=\"matrix(-1 0 0 1 144 88)\"\n ></rect>\n </svg>\n ),\n IconRight: ({ className, ...props }) => (\n <svg\n viewBox=\"0 0 256 256\"\n fill=\"currentColor\"\n xmlns=\"http://www.w3.org/2000/svg\"\n stroke=\"currentColor\"\n strokeWidth=\"0.25\"\n color=\"\"\n className={cn(\"size-4 shrink-0\", className)}\n aria-label=\"chevron-right\"\n {...props}\n >\n <rect x=\"128\" y=\"136\" width=\"14\" height=\"14\" rx=\"1\"></rect>\n <rect x=\"112\" y=\"152\" width=\"14\" height=\"14\" rx=\"1\"></rect>\n <rect x=\"96\" y=\"72\" width=\"14\" height=\"14\" rx=\"1\"></rect>\n <rect x=\"96\" y=\"168\" width=\"14\" height=\"14\" rx=\"1\"></rect>\n <rect x=\"144\" y=\"120\" width=\"14\" height=\"14\" rx=\"1\"></rect>\n <rect x=\"128\" y=\"104\" width=\"14\" height=\"14\" rx=\"1\"></rect>\n <rect x=\"112\" y=\"88\" width=\"14\" height=\"14\" rx=\"1\"></rect>\n </svg>\n ),\n }}\n {...props}\n />\n\n <div\n className=\"absolute inset-0 border-x-6 -mx-1.5 border-foreground dark:border-ring pointer-events-none\"\n aria-hidden=\"true\"\n />\n </div>\n );\n}\n\nexport { Calendar };\n",
0 commit comments