snapshot of https://github.com/shadcn-ui/ui.git (main, 2026-09-15; blobs > 131072B omitted)
This commit is contained in:
55
apps/v4/examples/aria/textarea-rtl.tsx
Normal file
55
apps/v4/examples/aria/textarea-rtl.tsx
Normal file
@@ -0,0 +1,55 @@
|
||||
"use client"
|
||||
|
||||
import * as React from "react"
|
||||
|
||||
import {
|
||||
useTranslation,
|
||||
type Translations,
|
||||
} from "@/components/language-selector"
|
||||
import {
|
||||
Field,
|
||||
FieldDescription,
|
||||
FieldLabel,
|
||||
} from "@/styles/aria-nova/ui-rtl/field"
|
||||
import { Textarea } from "@/styles/aria-nova/ui-rtl/textarea"
|
||||
|
||||
const translations: Translations = {
|
||||
en: {
|
||||
dir: "ltr",
|
||||
values: {
|
||||
label: "Feedback",
|
||||
placeholder: "Your feedback helps us improve...",
|
||||
description: "Share your thoughts about our service.",
|
||||
},
|
||||
},
|
||||
ar: {
|
||||
dir: "rtl",
|
||||
values: {
|
||||
label: "التعليقات",
|
||||
placeholder: "تعليقاتك تساعدنا على التحسين...",
|
||||
description: "شاركنا أفكارك حول خدمتنا.",
|
||||
},
|
||||
},
|
||||
he: {
|
||||
dir: "rtl",
|
||||
values: {
|
||||
label: "משוב",
|
||||
placeholder: "המשוב שלך עוזר לנו להשתפר...",
|
||||
description: "שתף את מחשבותיך על השירות שלנו.",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
export default function TextareaRtl() {
|
||||
const { dir, t } = useTranslation(translations, "ar")
|
||||
|
||||
return (
|
||||
<Field className="w-full max-w-xs" dir={dir}>
|
||||
<FieldLabel htmlFor="feedback" dir={dir}>
|
||||
{t.label}
|
||||
</FieldLabel>
|
||||
<Textarea id="feedback" placeholder={t.placeholder} dir={dir} rows={4} />
|
||||
<FieldDescription dir={dir}>{t.description}</FieldDescription>
|
||||
</Field>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user