Skip to content

Commit

Permalink
feat(calendar): add rtl support
Browse files Browse the repository at this point in the history
  • Loading branch information
jjeem committed Nov 27, 2024
1 parent 14ba98c commit 8525300
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions apps/www/registry/default/ui/calendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ function Calendar({
showOutsideDays={showOutsideDays}
className={cn("p-3", className)}
classNames={{
months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",
months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0 rtl:space-x-reverse",
month: "space-y-4",
caption: "flex justify-center pt-1 relative items-center",
caption_label: "text-sm font-medium",
nav: "space-x-1 flex items-center",
nav: "space-x-1 flex items-center rtl:space-x-reverse",
nav_button: cn(
buttonVariants({ variant: "outline" }),
"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"
),
nav_button_previous: "absolute left-1",
nav_button_next: "absolute right-1",
nav_button_previous: "absolute start-1",
nav_button_next: "absolute end-1",
table: "w-full border-collapse space-y-1",
head_row: "flex",
head_cell:
Expand All @@ -54,8 +54,8 @@ function Calendar({
...classNames,
}}
components={{
IconLeft: ({ ...props }) => <ChevronLeft className="h-4 w-4" />,
IconRight: ({ ...props }) => <ChevronRight className="h-4 w-4" />,
IconLeft: ({ ...props }) => <ChevronLeft className="h-4 w-4 rtl:rotate-180" />,
IconRight: ({ ...props }) => <ChevronRight className="h-4 w-4 rtl:rotate-180" />,
}}
{...props}
/>
Expand Down
12 changes: 6 additions & 6 deletions apps/www/registry/new-york/ui/calendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ function Calendar({
showOutsideDays={showOutsideDays}
className={cn("p-3", className)}
classNames={{
months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",
months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0 rtl:space-x-reverse",
month: "space-y-4",
caption: "flex justify-center pt-1 relative items-center",
caption_label: "text-sm font-medium",
nav: "space-x-1 flex items-center",
nav: "space-x-1 flex items-center rtl:space-x-reverse",
nav_button: cn(
buttonVariants({ variant: "outline" }),
"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"
),
nav_button_previous: "absolute left-1",
nav_button_next: "absolute right-1",
nav_button_previous: "absolute start-1",
nav_button_next: "absolute end-1",
table: "w-full border-collapse space-y-1",
head_row: "flex",
head_cell:
Expand Down Expand Up @@ -60,8 +60,8 @@ function Calendar({
...classNames,
}}
components={{
IconLeft: ({ ...props }) => <ChevronLeftIcon className="h-4 w-4" />,
IconRight: ({ ...props }) => <ChevronRightIcon className="h-4 w-4" />,
IconLeft: ({ ...props }) => <ChevronLeftIcon className="h-4 w-4 rtl:rotate-180" />,
IconRight: ({ ...props }) => <ChevronRightIcon className="h-4 w-4 rtl:rotate-180" />,
}}
{...props}
/>
Expand Down

0 comments on commit 8525300

Please sign in to comment.