diff --git a/apps/www/package.json b/apps/www/package.json index 29ed672c23c..a0ba7ff03ea 100644 --- a/apps/www/package.json +++ b/apps/www/package.json @@ -31,6 +31,7 @@ "@radix-ui/react-collapsible": "^1.0.3", "@radix-ui/react-context-menu": "^2.1.4", "@radix-ui/react-dialog": "^1.1.1", + "@radix-ui/react-direction": "^1.1.0", "@radix-ui/react-dropdown-menu": "^2.0.5", "@radix-ui/react-hover-card": "^1.0.6", "@radix-ui/react-icons": "^1.3.0", @@ -62,7 +63,7 @@ "contentlayer2": "^0.4.6", "date-fns": "^2.30.0", "embla-carousel-autoplay": "8.0.0-rc15", - "embla-carousel-react": "8.0.0-rc15", + "embla-carousel-react": "8.0.1", "framer-motion": "^11.0.24", "geist": "^1.2.2", "input-otp": "^1.2.2", diff --git a/apps/www/registry/default/ui/alert-dialog.tsx b/apps/www/registry/default/ui/alert-dialog.tsx index 1b6f99493c9..d1703f2b900 100644 --- a/apps/www/registry/default/ui/alert-dialog.tsx +++ b/apps/www/registry/default/ui/alert-dialog.tsx @@ -51,7 +51,7 @@ const AlertDialogHeader = ({ }: React.HTMLAttributes) => (
) => (
svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground", + "relative w-full rounded-lg border p-4 [&>svg~*]:ps-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:start-4 [&>svg]:top-4 [&>svg]:text-foreground", { variants: { variant: { diff --git a/apps/www/registry/default/ui/breadcrumb.tsx b/apps/www/registry/default/ui/breadcrumb.tsx index 60e6c96f72f..403f634a789 100644 --- a/apps/www/registry/default/ui/breadcrumb.tsx +++ b/apps/www/registry/default/ui/breadcrumb.tsx @@ -83,7 +83,7 @@ const BreadcrumbSeparator = ({ className={cn("[&>svg]:w-3.5 [&>svg]:h-3.5", className)} {...props} > - {children ?? } + {children ?? } ) BreadcrumbSeparator.displayName = "BreadcrumbSeparator" diff --git a/apps/www/registry/default/ui/calendar.tsx b/apps/www/registry/default/ui/calendar.tsx index b13169bec42..007b2776982 100644 --- a/apps/www/registry/default/ui/calendar.tsx +++ b/apps/www/registry/default/ui/calendar.tsx @@ -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: @@ -55,10 +55,10 @@ function Calendar({ }} components={{ IconLeft: ({ className, ...props }) => ( - + ), IconRight: ({ className, ...props }) => ( - + ), }} {...props} diff --git a/apps/www/registry/default/ui/carousel.tsx b/apps/www/registry/default/ui/carousel.tsx index 45311bfadf9..badba3074bb 100644 --- a/apps/www/registry/default/ui/carousel.tsx +++ b/apps/www/registry/default/ui/carousel.tsx @@ -1,6 +1,7 @@ "use client" import * as React from "react" +import { useDirection } from "@radix-ui/react-direction" import useEmblaCarousel, { type UseEmblaCarouselType, } from "embla-carousel-react" @@ -19,6 +20,7 @@ type CarouselProps = { plugins?: CarouselPlugin orientation?: "horizontal" | "vertical" setApi?: (api: CarouselApi) => void + direction: "ltr" | "rtl" } type CarouselContextProps = { @@ -58,9 +60,11 @@ const Carousel = React.forwardRef< }, ref ) => { + const dir = useDirection() const [carouselRef, api] = useEmblaCarousel( { ...opts, + direction: dir, axis: orientation === "horizontal" ? "x" : "y", }, plugins @@ -132,6 +136,7 @@ const Carousel = React.forwardRef< scrollNext, canScrollPrev, canScrollNext, + direction: dir, }} >
- + {orientation === "horizontal" ? ( + + ) : ( + + )} Previous slide ) @@ -237,7 +246,7 @@ const CarouselNext = React.forwardRef< className={cn( "absolute h-8 w-8 rounded-full", orientation === "horizontal" - ? "-right-12 top-1/2 -translate-y-1/2" + ? "-end-12 top-1/2 -translate-y-1/2" : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90", className )} @@ -245,7 +254,11 @@ const CarouselNext = React.forwardRef< onClick={scrollNext} {...props} > - + {orientation === "horizontal" ? ( + + ) : ( + + )} Next slide ) diff --git a/apps/www/registry/default/ui/command.tsx b/apps/www/registry/default/ui/command.tsx index 4603919587a..8f55513a397 100644 --- a/apps/www/registry/default/ui/command.tsx +++ b/apps/www/registry/default/ui/command.tsx @@ -40,7 +40,7 @@ const CommandInput = React.forwardRef< React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => (
- + {children} - + )) ContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName @@ -81,7 +81,7 @@ const ContextMenuItem = React.forwardRef< ref={ref} className={cn( "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", - inset && "pl-8", + inset && "ps-8", className )} {...props} @@ -96,13 +96,13 @@ const ContextMenuCheckboxItem = React.forwardRef< - + @@ -120,12 +120,12 @@ const ContextMenuRadioItem = React.forwardRef< - + @@ -145,7 +145,7 @@ const ContextMenuLabel = React.forwardRef< ref={ref} className={cn( "px-2 py-1.5 text-sm font-semibold text-foreground", - inset && "pl-8", + inset && "ps-8", className )} {...props} @@ -172,7 +172,7 @@ const ContextMenuShortcut = ({ return ( {children} - + Close @@ -59,7 +59,7 @@ const DialogHeader = ({ }: React.HTMLAttributes) => (
) => (
) => (
) diff --git a/apps/www/registry/default/ui/dropdown-menu.tsx b/apps/www/registry/default/ui/dropdown-menu.tsx index 0fc4c0e0714..e617ff0db16 100644 --- a/apps/www/registry/default/ui/dropdown-menu.tsx +++ b/apps/www/registry/default/ui/dropdown-menu.tsx @@ -27,14 +27,14 @@ const DropdownMenuSubTrigger = React.forwardRef< {children} - + )) DropdownMenuSubTrigger.displayName = @@ -83,8 +83,8 @@ const DropdownMenuItem = React.forwardRef< - + @@ -123,12 +123,12 @@ const DropdownMenuRadioItem = React.forwardRef< - + @@ -148,7 +148,7 @@ const DropdownMenuLabel = React.forwardRef< ref={ref} className={cn( "px-2 py-1.5 text-sm font-semibold", - inset && "pl-8", + inset && "ps-8", className )} {...props} @@ -174,7 +174,7 @@ const DropdownMenuShortcut = ({ }: React.HTMLAttributes) => { return ( ) diff --git a/apps/www/registry/default/ui/input-otp.tsx b/apps/www/registry/default/ui/input-otp.tsx index f66fcfa0ddb..026665f3354 100644 --- a/apps/www/registry/default/ui/input-otp.tsx +++ b/apps/www/registry/default/ui/input-otp.tsx @@ -16,7 +16,7 @@ const InputOTP = React.forwardRef< "flex items-center gap-2 has-[:disabled]:opacity-50", containerClassName )} - className={cn("disabled:cursor-not-allowed", className)} + className={cn("disabled:cursor-not-allowed rtl:-mr-[40px]", className)} {...props} /> )) @@ -41,7 +41,7 @@ const InputOTPSlot = React.forwardRef<
{children} - + )) MenubarSubTrigger.displayName = MenubarPrimitive.SubTrigger.displayName @@ -117,7 +117,7 @@ const MenubarItem = React.forwardRef< ref={ref} className={cn( "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", - inset && "pl-8", + inset && "ps-8", className )} {...props} @@ -132,13 +132,13 @@ const MenubarCheckboxItem = React.forwardRef< - + @@ -155,12 +155,12 @@ const MenubarRadioItem = React.forwardRef< - + @@ -180,7 +180,7 @@ const MenubarLabel = React.forwardRef< ref={ref} className={cn( "px-2 py-1.5 text-sm font-semibold", - inset && "pl-8", + inset && "ps-8", className )} {...props} @@ -207,7 +207,7 @@ const MenubarShortcut = ({ return ( {children}{" "}