snapshot of https://github.com/shadcn-ui/ui.git (main, 2026-09-15; blobs > 131072B omitted)
This commit is contained in:
61
apps/v4/examples/base/native-select-rtl.tsx
Normal file
61
apps/v4/examples/base/native-select-rtl.tsx
Normal file
@@ -0,0 +1,61 @@
|
||||
"use client"
|
||||
|
||||
import * as React from "react"
|
||||
|
||||
import {
|
||||
useTranslation,
|
||||
type Translations,
|
||||
} from "@/components/language-selector"
|
||||
import {
|
||||
NativeSelect,
|
||||
NativeSelectOption,
|
||||
} from "@/styles/base-nova/ui-rtl/native-select"
|
||||
|
||||
const translations: Translations = {
|
||||
en: {
|
||||
dir: "ltr",
|
||||
values: {
|
||||
placeholder: "Select status",
|
||||
todo: "Todo",
|
||||
inProgress: "In Progress",
|
||||
done: "Done",
|
||||
cancelled: "Cancelled",
|
||||
},
|
||||
},
|
||||
ar: {
|
||||
dir: "rtl",
|
||||
values: {
|
||||
placeholder: "اختر الحالة",
|
||||
todo: "مهام",
|
||||
inProgress: "قيد التنفيذ",
|
||||
done: "منجز",
|
||||
cancelled: "ملغي",
|
||||
},
|
||||
},
|
||||
he: {
|
||||
dir: "rtl",
|
||||
values: {
|
||||
placeholder: "בחר סטטוס",
|
||||
todo: "לעשות",
|
||||
inProgress: "בתהליך",
|
||||
done: "הושלם",
|
||||
cancelled: "בוטל",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
export function NativeSelectRtl() {
|
||||
const { dir, t } = useTranslation(translations, "ar")
|
||||
|
||||
return (
|
||||
<NativeSelect dir={dir}>
|
||||
<NativeSelectOption value="">{t.placeholder}</NativeSelectOption>
|
||||
<NativeSelectOption value="todo">{t.todo}</NativeSelectOption>
|
||||
<NativeSelectOption value="in-progress">
|
||||
{t.inProgress}
|
||||
</NativeSelectOption>
|
||||
<NativeSelectOption value="done">{t.done}</NativeSelectOption>
|
||||
<NativeSelectOption value="cancelled">{t.cancelled}</NativeSelectOption>
|
||||
</NativeSelect>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user