Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/large-tips-pump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nextui-org/select": patch
---

add RTL support to the select component
26 changes: 21 additions & 5 deletions packages/core/theme/src/components/select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const select = tv({
"absolute",
"z-10",
"origin-top-left",
"rtl:origin-top-right",
"subpixel-antialiased",
"text-small",
"text-foreground-500",
Expand All @@ -21,9 +22,9 @@ const select = tv({
"relative px-3 gap-3 w-full inline-flex flex-row items-center shadow-sm outline-none tap-highlight-transparent",
innerWrapper:
"inline-flex h-full w-[calc(100%_-_theme(spacing.unit-6))] min-h-unit-4 items-center gap-1.5 box-border",
selectorIcon: "absolute right-3 w-unit-4 h-unit-4",
spinner: "absolute right-3",
value: ["text-foreground-500", "font-normal", "w-full", "text-left"],
selectorIcon: "absolute right-3 rtl:left-3 rtl:right-[unset] w-unit-4 h-unit-4",
spinner: "absolute right-3 rtl:left-3 rtl:right-[unset]",
value: ["text-foreground-500", "font-normal", "w-full", "text-left", "rtl:text-right"],
listboxWrapper: "scroll-py-6 max-h-64 w-full",
listbox: "",
popoverContent: "w-full p-1 overflow-hidden",
Expand Down Expand Up @@ -132,7 +133,7 @@ const select = tv({
},
"outside-left": {
base: "flex-row items-center flex-nowrap items-start",
label: "relative pr-2 text-foreground",
label: "relative pr-2 rtl:pl-2 rtl:pr-[unset] text-foreground",
},
inside: {
label: "text-tiny cursor-pointer",
Expand Down Expand Up @@ -183,6 +184,7 @@ const select = tv({
label: [
"will-change-auto",
"origin-top-left",
"rtl:origin-top-right",
"!duration-200",
"!ease-out",
"transition-[transform,color,left,opacity]",
Expand Down Expand Up @@ -546,7 +548,15 @@ const select = tv({
isMultiline: false,
class: {
base: "group relative justify-end",
label: ["pb-0", "z-20", "top-1/2", "-translate-y-1/2", "group-data-[filled=true]:left-0"],
label: [
"pb-0",
"z-20",
"top-1/2",
"-translate-y-1/2",
"group-data-[filled=true]:left-0",
"rtl:group-data-[filled=true]:right-0",
"rtl:group-data-[filled=true]:left-[unset]",
],
},
},
// labelPlacement=[inside]
Expand Down Expand Up @@ -672,6 +682,8 @@ const select = tv({
class: {
label: [
"left-2",
"rtl:right-2",
"rtl:left-[unset]",
"text-tiny",
"group-data-[filled=true]:-translate-y-[calc(100%_+_theme(fontSize.tiny)/2_+_16px)]",
],
Expand All @@ -685,6 +697,8 @@ const select = tv({
class: {
label: [
"left-3",
"rtl:right-3",
"rtl:left-[unset]",
"text-small",
"group-data-[filled=true]:-translate-y-[calc(100%_+_theme(fontSize.small)/2_+_20px)]",
],
Expand All @@ -698,6 +712,8 @@ const select = tv({
class: {
label: [
"left-3",
"rtl:right-3",
"rtl:left-[unset]",
"text-medium",
"group-data-[filled=true]:-translate-y-[calc(100%_+_theme(fontSize.small)/2_+_24px)]",
],
Expand Down