mirror of
https://github.com/hanzoai/shadcn.git
synced 2026-10-30 18:22:59 +00:00
Squash merge of shadcn-ui/ui main branch into hanzo/ui, bringing in: - [email protected] through [email protected] releases - New apps/v4 directory structure - Registry system improvements and MCP server - Framework support (Vue, Svelte, React Native) - New templates (vite-app, monorepo-next, laravel) - Zod 4 compatibility (scoped override for zod@>4) - Test fixture corrections for alias resolution All 867 merge conflicts resolved preserving Hanzo customizations. 1020/1020 shadcn tests pass.
68 lines
1.4 KiB
TypeScript
68 lines
1.4 KiB
TypeScript
"use client"
|
|
|
|
import { Button } from "@/examples/radix/ui-rtl/button"
|
|
import {
|
|
Tooltip,
|
|
TooltipContent,
|
|
TooltipTrigger,
|
|
} from "@/examples/radix/ui-rtl/tooltip"
|
|
|
|
import {
|
|
useTranslation,
|
|
type Translations,
|
|
} from "@/components/language-selector"
|
|
|
|
const translations: Translations = {
|
|
en: {
|
|
dir: "ltr",
|
|
values: {
|
|
content: "Add to library",
|
|
left: "Left",
|
|
top: "Top",
|
|
bottom: "Bottom",
|
|
right: "Right",
|
|
},
|
|
},
|
|
ar: {
|
|
dir: "rtl",
|
|
values: {
|
|
content: "إضافة إلى المكتبة",
|
|
left: "يسار",
|
|
top: "أعلى",
|
|
bottom: "أسفل",
|
|
right: "يمين",
|
|
},
|
|
},
|
|
he: {
|
|
dir: "rtl",
|
|
values: {
|
|
content: "הוסף לספרייה",
|
|
left: "שמאל",
|
|
top: "למעלה",
|
|
bottom: "למטה",
|
|
right: "ימין",
|
|
},
|
|
},
|
|
}
|
|
|
|
const sides = ["left", "top", "bottom", "right"] as const
|
|
|
|
export function TooltipRtl() {
|
|
const { t } = useTranslation(translations, "ar")
|
|
|
|
return (
|
|
<div className="flex flex-wrap gap-2">
|
|
{sides.map((side) => (
|
|
<Tooltip key={side}>
|
|
<TooltipTrigger asChild>
|
|
<Button variant="outline" className="w-fit capitalize">
|
|
{t[side]}
|
|
</Button>
|
|
</TooltipTrigger>
|
|
<TooltipContent side={side}>{t.content}</TooltipContent>
|
|
</Tooltip>
|
|
))}
|
|
</div>
|
|
)
|
|
}
|