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.
58 lines
1.4 KiB
TypeScript
58 lines
1.4 KiB
TypeScript
"use client"
|
|
|
|
import * as React from "react"
|
|
import {
|
|
Field,
|
|
FieldContent,
|
|
FieldDescription,
|
|
FieldLabel,
|
|
} from "@/examples/base/ui-rtl/field"
|
|
import { Switch } from "@/examples/base/ui-rtl/switch"
|
|
|
|
import {
|
|
useTranslation,
|
|
type Translations,
|
|
} from "@/components/language-selector"
|
|
|
|
const translations: Translations = {
|
|
en: {
|
|
dir: "ltr",
|
|
values: {
|
|
label: "Share across devices",
|
|
description:
|
|
"Focus is shared across devices, and turns off when you leave the app.",
|
|
},
|
|
},
|
|
ar: {
|
|
dir: "rtl",
|
|
values: {
|
|
label: "المشاركة عبر الأجهزة",
|
|
description:
|
|
"يتم مشاركة التركيز عبر الأجهزة، ويتم إيقاف تشغيله عند مغادرة التطبيق.",
|
|
},
|
|
},
|
|
he: {
|
|
dir: "rtl",
|
|
values: {
|
|
label: "שיתוף בין מכשירים",
|
|
description: "המיקוד משותף בין מכשירים, וכבה כשאתה עוזב את האפליקציה.",
|
|
},
|
|
},
|
|
}
|
|
|
|
export function SwitchRtl() {
|
|
const { dir, t } = useTranslation(translations, "ar")
|
|
|
|
return (
|
|
<Field orientation="horizontal" className="max-w-sm" dir={dir}>
|
|
<FieldContent>
|
|
<FieldLabel htmlFor="switch-focus-mode-rtl" dir={dir}>
|
|
{t.label}
|
|
</FieldLabel>
|
|
<FieldDescription dir={dir}>{t.description}</FieldDescription>
|
|
</FieldContent>
|
|
<Switch id="switch-focus-mode-rtl" dir={dir} />
|
|
</Field>
|
|
)
|
|
}
|