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.
62 lines
1.4 KiB
TypeScript
62 lines
1.4 KiB
TypeScript
"use client"
|
|
|
|
import { Button } from "@/examples/base/ui-rtl/button"
|
|
import { Spinner } from "@/examples/base/ui-rtl/spinner"
|
|
import { ArrowRightIcon, PlusIcon } from "lucide-react"
|
|
|
|
import {
|
|
useTranslation,
|
|
type Translations,
|
|
} from "@/components/language-selector"
|
|
|
|
const translations: Translations = {
|
|
en: {
|
|
dir: "ltr",
|
|
values: {
|
|
button: "Button",
|
|
submit: "Submit",
|
|
delete: "Delete",
|
|
loading: "Loading",
|
|
},
|
|
},
|
|
ar: {
|
|
dir: "rtl",
|
|
values: {
|
|
button: "زر",
|
|
submit: "إرسال",
|
|
delete: "حذف",
|
|
loading: "جاري التحميل",
|
|
},
|
|
},
|
|
he: {
|
|
dir: "rtl",
|
|
values: {
|
|
button: "כפתור",
|
|
submit: "שלח",
|
|
delete: "מחק",
|
|
loading: "טוען",
|
|
},
|
|
},
|
|
}
|
|
|
|
export function ButtonRtl() {
|
|
const { dir, t } = useTranslation(translations, "ar")
|
|
|
|
return (
|
|
<div className="flex flex-wrap items-center gap-2 md:flex-row" dir={dir}>
|
|
<Button variant="outline">{t.button}</Button>
|
|
<Button variant="destructive">{t.delete}</Button>
|
|
<Button variant="outline">
|
|
{t.submit}{" "}
|
|
<ArrowRightIcon className="rtl:rotate-180" data-icon="inline-end" />
|
|
</Button>
|
|
<Button variant="outline" size="icon" aria-label="Add">
|
|
<PlusIcon />
|
|
</Button>
|
|
<Button variant="secondary" disabled>
|
|
<Spinner data-icon="inline-start" /> {t.loading}
|
|
</Button>
|
|
</div>
|
|
)
|
|
}
|