From 17c66908a62352f00b69f7fcdea1955ed4325b67 Mon Sep 17 00:00:00 2001 From: Mohamed Alnahhas Date: Wed, 11 Sep 2024 10:18:09 +0200 Subject: [PATCH 01/22] feat(alert-dialog): add rtl support --- apps/www/registry/default/ui/alert-dialog.tsx | 4 ++-- apps/www/registry/new-york/ui/alert-dialog.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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) => (
) => (
) => (
) => (
Date: Wed, 11 Sep 2024 10:21:43 +0200 Subject: [PATCH 02/22] feat(alert): add rtl support --- apps/www/registry/default/ui/alert.tsx | 2 +- apps/www/registry/new-york/ui/alert.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/www/registry/default/ui/alert.tsx b/apps/www/registry/default/ui/alert.tsx index 41fa7e0561a..8c6c5597cb4 100644 --- a/apps/www/registry/default/ui/alert.tsx +++ b/apps/www/registry/default/ui/alert.tsx @@ -4,7 +4,7 @@ import { cva, type VariantProps } from "class-variance-authority" import { cn } from "@/lib/utils" const alertVariants = cva( - "relative w-full rounded-lg border p-4 [&>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/new-york/ui/alert.tsx b/apps/www/registry/new-york/ui/alert.tsx index 5afd41d142c..5a0abb0bc0b 100644 --- a/apps/www/registry/new-york/ui/alert.tsx +++ b/apps/www/registry/new-york/ui/alert.tsx @@ -4,7 +4,7 @@ import { cva, type VariantProps } from "class-variance-authority" import { cn } from "@/lib/utils" const alertVariants = cva( - "relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7", + "relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:start-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:ps-7", { variants: { variant: { From a25fa152e94eb0a638131c4cd60dec47fb62b0d1 Mon Sep 17 00:00:00 2001 From: Mohamed Alnahhas Date: Wed, 11 Sep 2024 11:18:38 +0200 Subject: [PATCH 03/22] feat(carousel): add rtl support --- apps/www/package.json | 3 +- apps/www/registry/default/ui/carousel.tsx | 37 ++++- apps/www/registry/new-york/ui/carousel.tsx | 37 ++++- package.json | 2 + packages/cli/package.json | 2 + pnpm-lock.yaml | 170 ++++++++++----------- 6 files changed, 151 insertions(+), 100 deletions(-) diff --git a/apps/www/package.json b/apps/www/package.json index 53529b19b79..77cf0799796 100644 --- a/apps/www/package.json +++ b/apps/www/package.json @@ -29,6 +29,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", @@ -60,7 +61,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/carousel.tsx b/apps/www/registry/default/ui/carousel.tsx index 45311bfadf9..4fa7ff1482b 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, }} >
>(({ className, variant = "outline", size = "icon", ...props }, ref) => { - const { orientation, scrollPrev, canScrollPrev } = useCarousel() + const { orientation, scrollPrev, canScrollPrev, direction } = useCarousel() return ( ) @@ -227,7 +242,7 @@ const CarouselNext = React.forwardRef< HTMLButtonElement, React.ComponentProps >(({ className, variant = "outline", size = "icon", ...props }, ref) => { - const { orientation, scrollNext, canScrollNext } = useCarousel() + const { orientation, scrollNext, canScrollNext, direction } = useCarousel() return ( ) diff --git a/apps/www/registry/new-york/ui/carousel.tsx b/apps/www/registry/new-york/ui/carousel.tsx index 494acd23b7d..94c23c3912d 100644 --- a/apps/www/registry/new-york/ui/carousel.tsx +++ b/apps/www/registry/new-york/ui/carousel.tsx @@ -1,6 +1,7 @@ "use client" import * as React from "react" +import { useDirection } from "@radix-ui/react-direction" import { ArrowLeftIcon, ArrowRightIcon } from "@radix-ui/react-icons" import useEmblaCarousel, { type UseEmblaCarouselType, @@ -19,6 +20,7 @@ type CarouselProps = { plugins?: CarouselPlugin orientation?: "horizontal" | "vertical" setApi?: (api: CarouselApi) => void + direction: "ltr" | "rtl" } type CarouselContextProps = { @@ -58,10 +60,12 @@ const Carousel = React.forwardRef< }, ref ) => { + const dir = useDirection() const [carouselRef, api] = useEmblaCarousel( { ...opts, axis: orientation === "horizontal" ? "x" : "y", + direction: dir, }, plugins ) @@ -132,6 +136,7 @@ const Carousel = React.forwardRef< scrollNext, canScrollPrev, canScrollNext, + direction: dir, }} >
>(({ className, variant = "outline", size = "icon", ...props }, ref) => { - const { orientation, scrollPrev, canScrollPrev } = useCarousel() + const { orientation, scrollPrev, canScrollPrev, direction } = useCarousel() return ( ) @@ -227,7 +242,7 @@ const CarouselNext = React.forwardRef< HTMLButtonElement, React.ComponentProps >(({ className, variant = "outline", size = "icon", ...props }, ref) => { - const { orientation, scrollNext, canScrollNext } = useCarousel() + const { orientation, scrollNext, canScrollNext, direction } = useCarousel() return ( ) diff --git a/package.json b/package.json index 2e426be233b..6deacb76892 100644 --- a/package.json +++ b/package.json @@ -51,10 +51,12 @@ "@commitlint/config-conventional": "^17.6.3", "@ianvs/prettier-plugin-sort-imports": "^3.7.2", "@manypkg/cli": "^0.20.0", + "@radix-ui/react-direction": "^1.1.0", "@typescript-eslint/parser": "^5.59.7", "autoprefixer": "^10.4.14", "concurrently": "^8.0.1", "cross-env": "^7.0.3", + "embla-carousel-react": "8.0.1", "eslint": "^8.41.0", "eslint-config-next": "13.3.0", "eslint-config-prettier": "^8.8.0", diff --git a/packages/cli/package.json b/packages/cli/package.json index d38aec15788..225d7eb6700 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -48,10 +48,12 @@ "@babel/core": "^7.22.1", "@babel/parser": "^7.22.6", "@babel/plugin-transform-typescript": "^7.22.5", + "@radix-ui/react-direction": "^1.1.0", "chalk": "5.2.0", "commander": "^10.0.0", "cosmiconfig": "^8.1.3", "diff": "^5.1.0", + "embla-carousel-react": "8.0.1", "execa": "^7.0.0", "fast-glob": "^3.3.2", "fs-extra": "^11.1.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4d47adebaf4..1b64a5ccce3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -29,6 +29,9 @@ importers: '@manypkg/cli': specifier: ^0.20.0 version: 0.20.0 + '@radix-ui/react-direction': + specifier: ^1.1.0 + version: 1.1.0(@types/react@18.2.67)(react@18.2.0) '@typescript-eslint/parser': specifier: ^5.59.7 version: 5.61.0(eslint@8.44.0)(typescript@5.5.3) @@ -41,6 +44,9 @@ importers: cross-env: specifier: ^7.0.3 version: 7.0.3 + embla-carousel-react: + specifier: 8.0.1 + version: 8.0.1(react@18.2.0) eslint: specifier: ^8.41.0 version: 8.44.0 @@ -58,7 +64,7 @@ importers: version: 7.32.2(eslint@8.44.0) eslint-plugin-tailwindcss: specifier: 3.13.1 - version: 3.13.1(tailwindcss@3.3.7(ts-node@10.9.2(@types/node@20.5.1)(typescript@5.5.3))) + version: 3.13.1(tailwindcss@3.3.7(ts-node@10.9.2(@types/node@20.11.27)(typescript@5.5.3))) postcss: specifier: ^8.4.24 version: 8.4.24 @@ -70,10 +76,10 @@ importers: version: 3.1.3(prettier@2.8.8) tailwindcss: specifier: 3.3.7 - version: 3.3.7(ts-node@10.9.2(@types/node@20.5.1)(typescript@5.5.3)) + version: 3.3.7(ts-node@10.9.2(@types/node@20.11.27)(typescript@5.5.3)) tailwindcss-animate: specifier: ^1.0.5 - version: 1.0.6(tailwindcss@3.3.7(ts-node@10.9.2(@types/node@20.5.1)(typescript@5.5.3))) + version: 1.0.6(tailwindcss@3.3.7(ts-node@10.9.2(@types/node@20.11.27)(typescript@5.5.3))) tsx: specifier: ^4.1.4 version: 4.1.4 @@ -138,6 +144,9 @@ importers: '@radix-ui/react-dialog': specifier: ^1.1.1 version: 1.1.1(@types/react-dom@18.2.22)(@types/react@18.2.67)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + '@radix-ui/react-direction': + specifier: ^1.1.0 + version: 1.1.0(@types/react@18.2.67)(react@18.2.0) '@radix-ui/react-dropdown-menu': specifier: ^2.0.5 version: 2.0.5(@types/react-dom@18.2.22)(@types/react@18.2.67)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) @@ -230,10 +239,10 @@ importers: version: 2.30.0 embla-carousel-autoplay: specifier: 8.0.0-rc15 - version: 8.0.0-rc15(embla-carousel@8.0.0-rc15) + version: 8.0.0-rc15(embla-carousel@8.0.1) embla-carousel-react: - specifier: 8.0.0-rc15 - version: 8.0.0-rc15(react@18.2.0) + specifier: 8.0.1 + version: 8.0.1(react@18.2.0) framer-motion: specifier: ^11.0.24 version: 11.0.24(react-dom@18.2.0(react@18.2.0))(react@18.2.0) @@ -391,6 +400,9 @@ importers: '@babel/plugin-transform-typescript': specifier: ^7.22.5 version: 7.22.5(@babel/core@7.22.1) + '@radix-ui/react-direction': + specifier: ^1.1.0 + version: 1.1.0(@types/react@18.2.67)(react@18.2.0) chalk: specifier: 5.2.0 version: 5.2.0 @@ -403,6 +415,9 @@ importers: diff: specifier: ^5.1.0 version: 5.1.0 + embla-carousel-react: + specifier: 8.0.1 + version: 8.0.1(react@18.2.0) execa: specifier: ^7.0.0 version: 7.0.0 @@ -587,10 +602,10 @@ importers: version: 0.288.0(react@18.2.0) next: specifier: 14.1.3 - version: 14.1.3(@babel/core@7.24.6)(@opentelemetry/api@1.8.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + version: 14.1.3(@babel/core@7.22.1)(@opentelemetry/api@1.8.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) next-themes: specifier: ^0.2.1 - version: 0.2.1(next@14.1.3(@babel/core@7.24.6)(@opentelemetry/api@1.8.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + version: 0.2.1(next@14.1.3(@babel/core@7.22.1)(@opentelemetry/api@1.8.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(react-dom@18.2.0(react@18.2.0))(react@18.2.0) react: specifier: ^18.2.0 version: 18.2.0 @@ -2156,6 +2171,15 @@ packages: '@types/react': optional: true + '@radix-ui/react-direction@1.1.0': + resolution: {integrity: sha512-BUuBvgThEiAXh2DWu93XsT+a3aWrGqolGlqqw5VU1kG7p/ZH2cuDlM1sRLNnY3QcBS69UIz2mcKhMxDsdewhjg==} + peerDependencies: + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + '@radix-ui/react-dismissable-layer@1.0.4': resolution: {integrity: sha512-7UpBa/RKMoHJYjie1gkF1DlK8l1fdU/VKDpoS3rCCo8YBJR294GwcEHyxHw72yvphJ7ld0AXEcSLAzY2F/WyCg==} peerDependencies: @@ -3899,18 +3923,18 @@ packages: peerDependencies: embla-carousel: 8.0.0-rc15 - embla-carousel-react@8.0.0-rc15: - resolution: {integrity: sha512-PePOkyPMWsUDNJKYRhUmGScYhex9mfpEiYiKT8OgwP/4K60plW0qk8cAXWvS9N61A/3RkUq7uz+hQsmhAtYMcA==} + embla-carousel-react@8.0.1: + resolution: {integrity: sha512-cpFQ/HwCsjBjzpu9Z9IHmZ9DaCSf/wo4q+qUTcRW3SsNv+1Q8IY7Y8J2QIyTmz0vOWY7tliu3uE2gqRH7ZDwOQ==} peerDependencies: react: ^16.8.0 || ^17.0.1 || ^18.0.0 - embla-carousel-reactive-utils@8.0.0-rc15: - resolution: {integrity: sha512-17Pr+N2vULFS8Lxzi2jaebwVloiFJLpdJMJLKJKQ26NzEmX8pVtHSu3uuTWc8HPwye5HFugqCPJ2QoWWhKs6Kg==} + embla-carousel-reactive-utils@8.0.1: + resolution: {integrity: sha512-KBSkz2h9LwVFkOrwzIJKgXbmEDlIShkreeOHnV8Cph09AdBMzb412nRkcctbeDcuG9x3CVsqLzJrSXnZeYhFPQ==} peerDependencies: - embla-carousel: 8.0.0-rc15 + embla-carousel: 8.0.1 - embla-carousel@8.0.0-rc15: - resolution: {integrity: sha512-s7VPexK2h8VEYjEVQFnJAPcRnY5YqJYicFxKVVyWXP3Hk9FFDkT0kqVxMM1PcL187qHOUgmGVHOrfC8xWy3OKQ==} + embla-carousel@8.0.1: + resolution: {integrity: sha512-RsaMRyBCd144N95gb3XoI+H9zj3RI4y0qcfvKYEh2tIAIEenL9CW9vwzltCeoYkWYipGdkvup+HGT9ewG1YTEw==} emoji-regex@10.3.0: resolution: {integrity: sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==} @@ -5891,10 +5915,6 @@ packages: resolution: {integrity: sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==} engines: {node: ^10 || ^12 || >=14} - postcss@8.4.38: - resolution: {integrity: sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==} - engines: {node: ^10 || ^12 || >=14} - postcss@8.4.41: resolution: {integrity: sha512-TesUflQ0WKZqAvg52PWL6kHgLKP6xB6heTOdoYM0Wt2UHyxNa4K25EZZMgKns3BH1RLVbZCREPpLY0rhnNoHVQ==} engines: {node: ^10 || ^12 || >=14} @@ -7738,12 +7758,12 @@ snapshots: '@types/node': 20.5.1 chalk: 4.1.2 cosmiconfig: 8.3.6(typescript@5.5.3) - cosmiconfig-typescript-loader: 4.4.0(@types/node@20.5.1)(cosmiconfig@8.3.6(typescript@5.5.3))(ts-node@10.9.2(@types/node@20.5.1)(typescript@5.5.3))(typescript@5.5.3) + cosmiconfig-typescript-loader: 4.4.0(@types/node@20.5.1)(cosmiconfig@8.3.6(typescript@5.5.3))(ts-node@10.9.2(@types/node@20.11.27)(typescript@5.5.3))(typescript@5.5.3) lodash.isplainobject: 4.0.6 lodash.merge: 4.6.2 lodash.uniq: 4.5.0 resolve-from: 5.0.0 - ts-node: 10.9.2(@types/node@20.11.27)(typescript@5.5.3) + ts-node: 10.9.2(@types/node@20.5.1)(typescript@5.5.3) typescript: 5.5.3 transitivePeerDependencies: - '@swc/core' @@ -8880,6 +8900,12 @@ snapshots: optionalDependencies: '@types/react': 18.2.67 + '@radix-ui/react-direction@1.1.0(@types/react@18.2.67)(react@18.2.0)': + dependencies: + react: 18.2.0 + optionalDependencies: + '@types/react': 18.2.67 + '@radix-ui/react-dismissable-layer@1.0.4(@types/react-dom@18.2.22)(@types/react@18.2.67)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': dependencies: '@babel/runtime': 7.24.6 @@ -10443,11 +10469,11 @@ snapshots: core-util-is@1.0.3: {} - cosmiconfig-typescript-loader@4.4.0(@types/node@20.5.1)(cosmiconfig@8.3.6(typescript@5.5.3))(ts-node@10.9.2(@types/node@20.5.1)(typescript@5.5.3))(typescript@5.5.3): + cosmiconfig-typescript-loader@4.4.0(@types/node@20.5.1)(cosmiconfig@8.3.6(typescript@5.5.3))(ts-node@10.9.2(@types/node@20.11.27)(typescript@5.5.3))(typescript@5.5.3): dependencies: '@types/node': 20.5.1 cosmiconfig: 8.3.6(typescript@5.5.3) - ts-node: 10.9.2(@types/node@20.11.27)(typescript@5.5.3) + ts-node: 10.9.2(@types/node@20.5.1)(typescript@5.5.3) typescript: 5.5.3 cosmiconfig@8.1.3: @@ -10696,21 +10722,21 @@ snapshots: electron-to-chromium@1.4.788: {} - embla-carousel-autoplay@8.0.0-rc15(embla-carousel@8.0.0-rc15): + embla-carousel-autoplay@8.0.0-rc15(embla-carousel@8.0.1): dependencies: - embla-carousel: 8.0.0-rc15 + embla-carousel: 8.0.1 - embla-carousel-react@8.0.0-rc15(react@18.2.0): + embla-carousel-react@8.0.1(react@18.2.0): dependencies: - embla-carousel: 8.0.0-rc15 - embla-carousel-reactive-utils: 8.0.0-rc15(embla-carousel@8.0.0-rc15) + embla-carousel: 8.0.1 + embla-carousel-reactive-utils: 8.0.1(embla-carousel@8.0.1) react: 18.2.0 - embla-carousel-reactive-utils@8.0.0-rc15(embla-carousel@8.0.0-rc15): + embla-carousel-reactive-utils@8.0.1(embla-carousel@8.0.1): dependencies: - embla-carousel: 8.0.0-rc15 + embla-carousel: 8.0.1 - embla-carousel@8.0.0-rc15: {} + embla-carousel@8.0.1: {} emoji-regex@10.3.0: {} @@ -11121,11 +11147,11 @@ snapshots: postcss: 8.4.41 tailwindcss: 3.3.7(ts-node@10.9.2(@types/node@17.0.45)(typescript@5.5.3)) - eslint-plugin-tailwindcss@3.13.1(tailwindcss@3.3.7(ts-node@10.9.2(@types/node@20.5.1)(typescript@5.5.3))): + eslint-plugin-tailwindcss@3.13.1(tailwindcss@3.3.7(ts-node@10.9.2(@types/node@20.11.27)(typescript@5.5.3))): dependencies: fast-glob: 3.3.2 postcss: 8.4.41 - tailwindcss: 3.3.7(ts-node@10.9.2(@types/node@20.5.1)(typescript@5.5.3)) + tailwindcss: 3.3.7(ts-node@10.9.2(@types/node@20.11.27)(typescript@5.5.3)) eslint-plugin-turbo@1.9.9(eslint@8.44.0): dependencies: @@ -13061,9 +13087,9 @@ snapshots: - markdown-wasm - supports-color - next-themes@0.2.1(next@14.1.3(@babel/core@7.24.6)(@opentelemetry/api@1.8.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(react-dom@18.2.0(react@18.2.0))(react@18.2.0): + next-themes@0.2.1(next@14.1.3(@babel/core@7.22.1)(@opentelemetry/api@1.8.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(react-dom@18.2.0(react@18.2.0))(react@18.2.0): dependencies: - next: 14.1.3(@babel/core@7.24.6)(@opentelemetry/api@1.8.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + next: 14.1.3(@babel/core@7.22.1)(@opentelemetry/api@1.8.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -13073,7 +13099,7 @@ snapshots: react: 18.2.0 react-dom: 18.2.0(react@18.2.0) - next@14.1.3(@babel/core@7.24.6)(@opentelemetry/api@1.8.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0): + next@14.1.3(@babel/core@7.22.1)(@opentelemetry/api@1.8.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0): dependencies: '@next/env': 14.1.3 '@swc/helpers': 0.5.2 @@ -13083,7 +13109,7 @@ snapshots: postcss: 8.4.31 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) - styled-jsx: 5.1.1(@babel/core@7.24.6)(react@18.2.0) + styled-jsx: 5.1.1(@babel/core@7.22.1)(react@18.2.0) optionalDependencies: '@next/swc-darwin-arm64': 14.1.3 '@next/swc-darwin-x64': 14.1.3 @@ -13391,13 +13417,6 @@ snapshots: possible-typed-array-names@1.0.0: {} - postcss-import@15.1.0(postcss@8.4.38): - dependencies: - postcss: 8.4.38 - postcss-value-parser: 4.2.0 - read-cache: 1.0.0 - resolve: 1.22.8 - postcss-import@15.1.0(postcss@8.4.41): dependencies: postcss: 8.4.41 @@ -13405,11 +13424,6 @@ snapshots: read-cache: 1.0.0 resolve: 1.22.8 - postcss-js@4.0.1(postcss@8.4.38): - dependencies: - camelcase-css: 2.0.1 - postcss: 8.4.38 - postcss-js@4.0.1(postcss@8.4.41): dependencies: camelcase-css: 2.0.1 @@ -13423,26 +13437,21 @@ snapshots: postcss: 8.4.41 ts-node: 10.9.2(@types/node@20.14.0)(typescript@4.9.5) - postcss-load-config@4.0.2(postcss@8.4.38)(ts-node@10.9.2(@types/node@17.0.45)(typescript@5.5.3)): + postcss-load-config@4.0.2(postcss@8.4.41)(ts-node@10.9.2(@types/node@17.0.45)(typescript@5.5.3)): dependencies: lilconfig: 3.1.1 yaml: 2.4.3 optionalDependencies: - postcss: 8.4.38 + postcss: 8.4.41 ts-node: 10.9.2(@types/node@17.0.45)(typescript@5.5.3) - postcss-load-config@4.0.2(postcss@8.4.41)(ts-node@10.9.2(@types/node@20.5.1)(typescript@5.5.3)): + postcss-load-config@4.0.2(postcss@8.4.41)(ts-node@10.9.2(@types/node@20.11.27)(typescript@5.5.3)): dependencies: lilconfig: 3.1.1 yaml: 2.4.3 optionalDependencies: postcss: 8.4.41 - ts-node: 10.9.2(@types/node@20.11.27)(typescript@5.5.3) - - postcss-nested@6.0.1(postcss@8.4.38): - dependencies: - postcss: 8.4.38 - postcss-selector-parser: 6.1.0 + ts-node: 10.9.2(@types/node@20.5.1)(typescript@5.5.3) postcss-nested@6.0.1(postcss@8.4.41): dependencies: @@ -13468,12 +13477,6 @@ snapshots: picocolors: 1.0.1 source-map-js: 1.2.0 - postcss@8.4.38: - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.1 - source-map-js: 1.2.0 - postcss@8.4.41: dependencies: nanoid: 3.3.7 @@ -14315,13 +14318,6 @@ snapshots: optionalDependencies: '@babel/core': 7.22.1 - styled-jsx@5.1.1(@babel/core@7.24.6)(react@18.2.0): - dependencies: - client-only: 0.0.1 - react: 18.2.0 - optionalDependencies: - '@babel/core': 7.24.6 - sucrase@3.35.0: dependencies: '@jridgewell/gen-mapping': 0.3.5 @@ -14357,9 +14353,9 @@ snapshots: dependencies: tailwindcss: 3.3.7(ts-node@10.9.2(@types/node@17.0.45)(typescript@5.5.3)) - tailwindcss-animate@1.0.6(tailwindcss@3.3.7(ts-node@10.9.2(@types/node@20.5.1)(typescript@5.5.3))): + tailwindcss-animate@1.0.6(tailwindcss@3.3.7(ts-node@10.9.2(@types/node@20.11.27)(typescript@5.5.3))): dependencies: - tailwindcss: 3.3.7(ts-node@10.9.2(@types/node@20.5.1)(typescript@5.5.3)) + tailwindcss: 3.3.7(ts-node@10.9.2(@types/node@20.11.27)(typescript@5.5.3)) tailwindcss@3.3.7(ts-node@10.9.2(@types/node@17.0.45)(typescript@5.5.3)): dependencies: @@ -14377,18 +14373,18 @@ snapshots: normalize-path: 3.0.0 object-hash: 3.0.0 picocolors: 1.0.1 - postcss: 8.4.38 - postcss-import: 15.1.0(postcss@8.4.38) - postcss-js: 4.0.1(postcss@8.4.38) - postcss-load-config: 4.0.2(postcss@8.4.38)(ts-node@10.9.2(@types/node@17.0.45)(typescript@5.5.3)) - postcss-nested: 6.0.1(postcss@8.4.38) + postcss: 8.4.41 + postcss-import: 15.1.0(postcss@8.4.41) + postcss-js: 4.0.1(postcss@8.4.41) + postcss-load-config: 4.0.2(postcss@8.4.41)(ts-node@10.9.2(@types/node@17.0.45)(typescript@5.5.3)) + postcss-nested: 6.0.1(postcss@8.4.41) postcss-selector-parser: 6.1.0 resolve: 1.22.8 sucrase: 3.35.0 transitivePeerDependencies: - ts-node - tailwindcss@3.3.7(ts-node@10.9.2(@types/node@20.5.1)(typescript@5.5.3)): + tailwindcss@3.3.7(ts-node@10.9.2(@types/node@20.11.27)(typescript@5.5.3)): dependencies: '@alloc/quick-lru': 5.2.0 arg: 5.0.2 @@ -14407,7 +14403,7 @@ snapshots: postcss: 8.4.41 postcss-import: 15.1.0(postcss@8.4.41) postcss-js: 4.0.1(postcss@8.4.41) - postcss-load-config: 4.0.2(postcss@8.4.41)(ts-node@10.9.2(@types/node@20.5.1)(typescript@5.5.3)) + postcss-load-config: 4.0.2(postcss@8.4.41)(ts-node@10.9.2(@types/node@20.11.27)(typescript@5.5.3)) postcss-nested: 6.0.1(postcss@8.4.41) postcss-selector-parser: 6.1.0 resolve: 1.22.8 @@ -14538,42 +14534,42 @@ snapshots: yn: 3.1.1 optional: true - ts-node@10.9.2(@types/node@20.11.27)(typescript@5.5.3): + ts-node@10.9.2(@types/node@20.14.0)(typescript@4.9.5): dependencies: '@cspotcode/source-map-support': 0.8.1 '@tsconfig/node10': 1.0.11 '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.4 - '@types/node': 20.11.27 + '@types/node': 20.14.0 acorn: 8.11.3 acorn-walk: 8.3.2 arg: 4.1.3 create-require: 1.1.1 diff: 4.0.2 make-error: 1.3.6 - typescript: 5.5.3 + typescript: 4.9.5 v8-compile-cache-lib: 3.0.1 yn: 3.1.1 + optional: true - ts-node@10.9.2(@types/node@20.14.0)(typescript@4.9.5): + ts-node@10.9.2(@types/node@20.5.1)(typescript@5.5.3): dependencies: '@cspotcode/source-map-support': 0.8.1 '@tsconfig/node10': 1.0.11 '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.4 - '@types/node': 20.14.0 + '@types/node': 20.5.1 acorn: 8.11.3 acorn-walk: 8.3.2 arg: 4.1.3 create-require: 1.1.1 diff: 4.0.2 make-error: 1.3.6 - typescript: 4.9.5 + typescript: 5.5.3 v8-compile-cache-lib: 3.0.1 yn: 3.1.1 - optional: true ts-pattern@5.2.0: {} From cbe3c2ced60f0b2b1c26017729c6a8ea95b629b9 Mon Sep 17 00:00:00 2001 From: Mohamed Alnahhas Date: Wed, 11 Sep 2024 14:13:56 +0200 Subject: [PATCH 04/22] feat(command): add rtl support --- apps/www/registry/default/ui/command.tsx | 4 ++-- apps/www/registry/new-york/ui/command.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/www/registry/default/ui/command.tsx b/apps/www/registry/default/ui/command.tsx index 81549949632..1152a5976b1 100644 --- a/apps/www/registry/default/ui/command.tsx +++ b/apps/www/registry/default/ui/command.tsx @@ -42,7 +42,7 @@ const CommandInput = React.forwardRef< React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => (
- + Date: Wed, 11 Sep 2024 23:35:07 +0200 Subject: [PATCH 05/22] feat(context-menu): add rtl support --- apps/www/registry/default/ui/context-menu.tsx | 52 +++++++++++-------- .../www/registry/new-york/ui/context-menu.tsx | 51 ++++++++++-------- 2 files changed, 60 insertions(+), 43 deletions(-) diff --git a/apps/www/registry/default/ui/context-menu.tsx b/apps/www/registry/default/ui/context-menu.tsx index 93ef37ba98d..3dfeb09c4eb 100644 --- a/apps/www/registry/default/ui/context-menu.tsx +++ b/apps/www/registry/default/ui/context-menu.tsx @@ -2,7 +2,8 @@ import * as React from "react" import * as ContextMenuPrimitive from "@radix-ui/react-context-menu" -import { Check, ChevronRight, Circle } from "lucide-react" +import { useDirection } from "@radix-ui/react-direction" +import { Check, ChevronLeft, ChevronRight, Circle } from "lucide-react" import { cn } from "@/lib/utils" @@ -23,20 +24,27 @@ const ContextMenuSubTrigger = React.forwardRef< React.ComponentPropsWithoutRef & { inset?: boolean } ->(({ className, inset, children, ...props }, ref) => ( - - {children} - - -)) +>(({ className, inset, children, ...props }, ref) => { + const dir = useDirection() + return ( + + {children} + {dir === "rtl" ? ( + + ) : ( + + )} + + ) +}) ContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName const ContextMenuSubContent = React.forwardRef< @@ -81,7 +89,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 +104,13 @@ const ContextMenuCheckboxItem = React.forwardRef< - + @@ -120,12 +128,12 @@ const ContextMenuRadioItem = React.forwardRef< - + @@ -145,7 +153,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 +180,7 @@ const ContextMenuShortcut = ({ return ( & { inset?: boolean } ->(({ className, inset, children, ...props }, ref) => ( - - {children} - - -)) +>(({ className, inset, children, ...props }, ref) => { + const dir = useDirection() + return ( + + {children} + {dir === "rtl" ? ( + + ) : ( + + )} + + ) +}) ContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName const ContextMenuSubContent = React.forwardRef< @@ -85,7 +94,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} @@ -100,13 +109,13 @@ const ContextMenuCheckboxItem = React.forwardRef< - + @@ -124,12 +133,12 @@ const ContextMenuRadioItem = React.forwardRef< - + @@ -149,7 +158,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} @@ -176,7 +185,7 @@ const ContextMenuShortcut = ({ return ( Date: Wed, 11 Sep 2024 23:46:01 +0200 Subject: [PATCH 06/22] feat(dialog): add rtl support --- apps/www/registry/default/ui/dialog.tsx | 6 +++--- apps/www/registry/new-york/ui/dialog.tsx | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/www/registry/default/ui/dialog.tsx b/apps/www/registry/default/ui/dialog.tsx index 01ff19c7e45..00e92a62411 100644 --- a/apps/www/registry/default/ui/dialog.tsx +++ b/apps/www/registry/default/ui/dialog.tsx @@ -44,7 +44,7 @@ const DialogContent = React.forwardRef< {...props} > {children} - + Close @@ -59,7 +59,7 @@ const DialogHeader = ({ }: React.HTMLAttributes) => (
) => (
{children} - + Close @@ -59,7 +59,7 @@ const DialogHeader = ({ }: React.HTMLAttributes) => (
) => (
Date: Wed, 11 Sep 2024 23:48:41 +0200 Subject: [PATCH 07/22] feat(drawer): add rtl support --- apps/www/registry/default/ui/drawer.tsx | 2 +- apps/www/registry/new-york/ui/drawer.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/www/registry/default/ui/drawer.tsx b/apps/www/registry/default/ui/drawer.tsx index 6a0ef53dde8..1b3c70573c9 100644 --- a/apps/www/registry/default/ui/drawer.tsx +++ b/apps/www/registry/default/ui/drawer.tsx @@ -60,7 +60,7 @@ const DrawerHeader = ({ ...props }: React.HTMLAttributes) => (
) diff --git a/apps/www/registry/new-york/ui/drawer.tsx b/apps/www/registry/new-york/ui/drawer.tsx index 6a0ef53dde8..1b3c70573c9 100644 --- a/apps/www/registry/new-york/ui/drawer.tsx +++ b/apps/www/registry/new-york/ui/drawer.tsx @@ -60,7 +60,7 @@ const DrawerHeader = ({ ...props }: React.HTMLAttributes) => (
) From 6ae9bee554e0f7a4939a3767dbe85ea30e65b62a Mon Sep 17 00:00:00 2001 From: Mohamed Alnahhas Date: Thu, 12 Sep 2024 00:03:18 +0200 Subject: [PATCH 08/22] feat(dropdown-menu): add rtl support --- .../www/registry/default/ui/dropdown-menu.tsx | 52 +++++++++++-------- .../registry/new-york/ui/dropdown-menu.tsx | 51 ++++++++++-------- 2 files changed, 60 insertions(+), 43 deletions(-) diff --git a/apps/www/registry/default/ui/dropdown-menu.tsx b/apps/www/registry/default/ui/dropdown-menu.tsx index f69a0d64caf..6f307dd3d14 100644 --- a/apps/www/registry/default/ui/dropdown-menu.tsx +++ b/apps/www/registry/default/ui/dropdown-menu.tsx @@ -2,9 +2,10 @@ import * as React from "react" import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu" -import { Check, ChevronRight, Circle } from "lucide-react" +import { Check, ChevronLeft, ChevronRight, Circle } from "lucide-react" import { cn } from "@/lib/utils" +import { useDirection } from "@radix-ui/react-direction" const DropdownMenu = DropdownMenuPrimitive.Root @@ -23,20 +24,27 @@ const DropdownMenuSubTrigger = React.forwardRef< React.ComponentPropsWithoutRef & { inset?: boolean } ->(({ className, inset, children, ...props }, ref) => ( - - {children} - - -)) +>(({ className, inset, children, ...props }, ref) => { + const dir = useDirection() + return ( + + {children} + {dir === "rtl" ? ( + + ) : ( + + )} + + ) +}) DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName @@ -84,7 +92,7 @@ const DropdownMenuItem = 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 transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", - inset && "pl-8", + inset && "ps-8", className )} {...props} @@ -99,13 +107,13 @@ const DropdownMenuCheckboxItem = React.forwardRef< - + @@ -123,12 +131,12 @@ const DropdownMenuRadioItem = React.forwardRef< - + @@ -148,7 +156,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 +182,7 @@ const DropdownMenuShortcut = ({ }: React.HTMLAttributes) => { return ( ) diff --git a/apps/www/registry/new-york/ui/dropdown-menu.tsx b/apps/www/registry/new-york/ui/dropdown-menu.tsx index 242b07a63dd..bbc2b13671b 100644 --- a/apps/www/registry/new-york/ui/dropdown-menu.tsx +++ b/apps/www/registry/new-york/ui/dropdown-menu.tsx @@ -1,9 +1,11 @@ "use client" import * as React from "react" +import { useDirection } from "@radix-ui/react-direction" import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu" import { CheckIcon, + ChevronLeftIcon, ChevronRightIcon, DotFilledIcon, } from "@radix-ui/react-icons" @@ -27,20 +29,27 @@ const DropdownMenuSubTrigger = React.forwardRef< React.ComponentPropsWithoutRef & { inset?: boolean } ->(({ className, inset, children, ...props }, ref) => ( - - {children} - - -)) +>(({ className, inset, children, ...props }, ref) => { + const dir = useDirection() + return ( + + {children} + {dir === "rtl" ? ( + + ) : ( + + )} + + ) +}) DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName @@ -89,7 +98,7 @@ const DropdownMenuItem = 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 transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", - inset && "pl-8", + inset && "ps-8", className )} {...props} @@ -104,13 +113,13 @@ const DropdownMenuCheckboxItem = React.forwardRef< - + @@ -128,12 +137,12 @@ const DropdownMenuRadioItem = React.forwardRef< - + @@ -153,7 +162,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} @@ -179,7 +188,7 @@ const DropdownMenuShortcut = ({ }: React.HTMLAttributes) => { return ( ) From de6fe31d374ddab80824e671d1880f3a3ca856f9 Mon Sep 17 00:00:00 2001 From: Mohamed Alnahhas Date: Thu, 12 Sep 2024 10:09:22 +0200 Subject: [PATCH 09/22] feat(menubar): add rtl support --- apps/www/registry/default/ui/menubar.tsx | 54 +++++++++++++---------- apps/www/registry/new-york/ui/menubar.tsx | 53 +++++++++++++--------- 2 files changed, 62 insertions(+), 45 deletions(-) diff --git a/apps/www/registry/default/ui/menubar.tsx b/apps/www/registry/default/ui/menubar.tsx index 5586fa9b21f..08e675cc8bb 100644 --- a/apps/www/registry/default/ui/menubar.tsx +++ b/apps/www/registry/default/ui/menubar.tsx @@ -2,9 +2,10 @@ import * as React from "react" import * as MenubarPrimitive from "@radix-ui/react-menubar" -import { Check, ChevronRight, Circle } from "lucide-react" +import { Check, ChevronLeft, ChevronRight, Circle } from "lucide-react" import { cn } from "@/lib/utils" +import { useDirection } from "@radix-ui/react-direction" const MenubarMenu = MenubarPrimitive.Menu @@ -23,7 +24,7 @@ const Menubar = React.forwardRef< & { inset?: boolean } ->(({ className, inset, children, ...props }, ref) => ( - - {children} - - -)) +>(({ className, inset, children, ...props }, ref) => { + const dir = useDirection() + return ( + + {children} + {dir === "rtl" ? ( + + ) : ( + + )} + + ) +}) MenubarSubTrigger.displayName = MenubarPrimitive.SubTrigger.displayName const MenubarSubContent = React.forwardRef< @@ -117,7 +125,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 +140,13 @@ const MenubarCheckboxItem = React.forwardRef< - + @@ -155,12 +163,12 @@ const MenubarRadioItem = React.forwardRef< - + @@ -180,7 +188,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 +215,7 @@ const MenubarShortcut = ({ return ( & { inset?: boolean } ->(({ className, inset, children, ...props }, ref) => ( - - {children} - - -)) +>(({ className, inset, children, ...props }, ref) => { + const dir = useDirection() + return ( + + {children} + {dir === "rtl" ? ( + + ) : ( + + )}{" "} + + ) +}) MenubarSubTrigger.displayName = MenubarPrimitive.SubTrigger.displayName const MenubarSubContent = React.forwardRef< @@ -121,7 +130,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} @@ -136,13 +145,13 @@ const MenubarCheckboxItem = React.forwardRef< - + @@ -159,12 +168,12 @@ const MenubarRadioItem = React.forwardRef< - + @@ -184,7 +193,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} @@ -211,7 +220,7 @@ const MenubarShortcut = ({ return ( Date: Sun, 15 Sep 2024 23:19:13 +0200 Subject: [PATCH 10/22] feat(navigation-menu): add rtl support --- apps/www/registry/default/ui/navigation-menu.tsx | 8 ++++---- apps/www/registry/new-york/ui/navigation-menu.tsx | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/apps/www/registry/default/ui/navigation-menu.tsx b/apps/www/registry/default/ui/navigation-menu.tsx index 1419f56695b..cd134573407 100644 --- a/apps/www/registry/default/ui/navigation-menu.tsx +++ b/apps/www/registry/default/ui/navigation-menu.tsx @@ -30,7 +30,7 @@ const NavigationMenuList = React.forwardRef< {children}{" "}