Files
zeekay 16c4453cc1 feat: sync with upstream shadcn/ui (through [email protected])
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.
2026-02-09 10:44:26 -08:00

90 lines
2.7 KiB
TypeScript

"use client"
import * as React from "react"
import {
Field,
FieldContent,
FieldDescription,
FieldLabel,
} from "@/examples/base/ui-rtl/field"
import { RadioGroup, RadioGroupItem } from "@/examples/base/ui-rtl/radio-group"
import {
useTranslation,
type Translations,
} from "@/components/language-selector"
const translations: Translations = {
en: {
dir: "ltr",
values: {
default: "Default",
defaultDescription: "Standard spacing for most use cases.",
comfortable: "Comfortable",
comfortableDescription: "More space between elements.",
compact: "Compact",
compactDescription: "Minimal spacing for dense layouts.",
},
},
ar: {
dir: "rtl",
values: {
default: "افتراضي",
defaultDescription: "تباعد قياسي لمعظم حالات الاستخدام.",
comfortable: "مريح",
comfortableDescription: "مساحة أكبر بين العناصر.",
compact: "مضغوط",
compactDescription: "تباعد أدنى للتخطيطات الكثيفة.",
},
},
he: {
dir: "rtl",
values: {
default: "ברירת מחדל",
defaultDescription: "ריווח סטנדרטי לרוב מקרי השימוש.",
comfortable: "נוח",
comfortableDescription: "יותר מקום בין האלמנטים.",
compact: "קומפקטי",
compactDescription: "ריווח מינימלי לפריסות צפופות.",
},
},
}
export function RadioGroupRtl() {
const { dir, t } = useTranslation(translations, "ar")
return (
<RadioGroup defaultValue="comfortable" className="w-fit" dir={dir}>
<Field orientation="horizontal">
<RadioGroupItem value="default" id="r1-rtl" dir={dir} />
<FieldContent>
<FieldLabel htmlFor="r1-rtl" dir={dir}>
{t.default}
</FieldLabel>
<FieldDescription dir={dir}>{t.defaultDescription}</FieldDescription>
</FieldContent>
</Field>
<Field orientation="horizontal">
<RadioGroupItem value="comfortable" id="r2-rtl" dir={dir} />
<FieldContent>
<FieldLabel htmlFor="r2-rtl" dir={dir}>
{t.comfortable}
</FieldLabel>
<FieldDescription dir={dir}>
{t.comfortableDescription}
</FieldDescription>
</FieldContent>
</Field>
<Field orientation="horizontal">
<RadioGroupItem value="compact" id="r3-rtl" dir={dir} />
<FieldContent>
<FieldLabel htmlFor="r3-rtl" dir={dir}>
{t.compact}
</FieldLabel>
<FieldDescription dir={dir}>{t.compactDescription}</FieldDescription>
</FieldContent>
</Field>
</RadioGroup>
)
}