From 858388d64a655d5402c144ce50cf5bbe4fa57c1e Mon Sep 17 00:00:00 2001 From: shadcn Date: Sun, 25 Jan 2026 10:34:00 +0400 Subject: [PATCH] fix --- apps/v4/examples/base/tooltip-rtl.tsx | 51 ++++++++++++++----- .../bases/base/examples/tooltip-example.tsx | 51 ++++++++++--------- 2 files changed, 66 insertions(+), 36 deletions(-) diff --git a/apps/v4/examples/base/tooltip-rtl.tsx b/apps/v4/examples/base/tooltip-rtl.tsx index 2061d5d566..f3566ba543 100644 --- a/apps/v4/examples/base/tooltip-rtl.tsx +++ b/apps/v4/examples/base/tooltip-rtl.tsx @@ -1,12 +1,11 @@ "use client" -import * as React from "react" -import { Button } from "@/examples/base/ui-rtl/button" +import { Button } from "@/examples/base/ui/button" import { Tooltip, TooltipContent, TooltipTrigger, -} from "@/examples/base/ui-rtl/tooltip" +} from "@/examples/base/ui/tooltip" import { useTranslation, @@ -17,35 +16,63 @@ const translations: Translations = { en: { dir: "ltr", values: { - trigger: "Hover", content: "Add to library", + "inline-start": "Inline Start", + left: "Left", + top: "Top", + bottom: "Bottom", + right: "Right", + "inline-end": "Inline End", }, }, ar: { dir: "rtl", values: { - trigger: "مرر", content: "إضافة إلى المكتبة", + "inline-start": "بداية السطر", + left: "يسار", + top: "أعلى", + bottom: "أسفل", + right: "يمين", + "inline-end": "نهاية السطر", }, }, he: { dir: "rtl", values: { - trigger: "רחף", content: "הוסף לספרייה", + "inline-start": "תחילת השורה", + left: "שמאל", + top: "למעלה", + bottom: "למטה", + right: "ימין", + "inline-end": "סוף השורה", }, }, } +const sides = [ + "inline-start", + "left", + "top", + "bottom", + "right", + "inline-end", +] as const + export function TooltipRtl() { const { dir, t } = useTranslation(translations, "ar") return ( - - } dir={dir}> - {t.trigger} - - {t.content} - +
+ {sides.map((side) => ( + + }> + {t[side]} + + {t.content} + + ))} +
) } diff --git a/apps/v4/registry/bases/base/examples/tooltip-example.tsx b/apps/v4/registry/bases/base/examples/tooltip-example.tsx index e368c25250..f5a9f52f3d 100644 --- a/apps/v4/registry/bases/base/examples/tooltip-example.tsx +++ b/apps/v4/registry/bases/base/examples/tooltip-example.tsx @@ -12,6 +12,7 @@ import { TooltipTrigger, } from "@/registry/bases/base/ui/tooltip" import { IconPlaceholder } from "@/app/(create)/components/icon-placeholder" +import { DirectionProvider } from "@/examples/radix/ui/direction" export default function TooltipExample() { return ( @@ -45,30 +46,32 @@ function TooltipBasic() { function TooltipSides() { return ( - -
- {( - [ - "inline-start", - "left", - "top", - "bottom", - "right", - "inline-end", - ] as const - ).map((side) => ( - - } - > - {side.replace("-", " ")} - - -

Add to library

-
-
- ))} -
+ + +
+ {( + [ + "inline-start", + "left", + "top", + "bottom", + "right", + "inline-end", + ] as const + ).map((side) => ( + + } + > + {side.replace("-", " ")} + + +

Add to library

+
+
+ ))} +
+
) }