Skip to content

Commit

Permalink
fix(components): improve RTL support for input component (#2038)
Browse files Browse the repository at this point in the history
* fix(components): improve RTL support for select component

* fix(theme): revise RTL styles

* chore(changeset): remove input package from changeset

---------

Co-authored-by: amirhhashemi <[email protected]>
Co-authored-by: WK Wong <[email protected]>
  • Loading branch information
3 people authored Sep 8, 2024
1 parent f4d16e1 commit deb1507
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
5 changes: 5 additions & 0 deletions .changeset/giant-sheep-attend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nextui-org/theme": patch
---

Improved RTL support for the input component
21 changes: 9 additions & 12 deletions packages/core/theme/src/components/input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,8 @@ const input = tv({
"z-10",
"hidden",
"absolute",
"right-3",
"rtl:right-auto",
"rtl:left-3",
"end-3",
"start-auto",
"appearance-none",
"outline-none",
"select-none",
Expand Down Expand Up @@ -174,7 +173,7 @@ const input = tv({
base: "flex-row items-center flex-nowrap data-[has-helper=true]:items-start",
inputWrapper: "flex-1",
mainWrapper: "flex flex-col",
label: "relative text-foreground pr-2 rtl:pr-0 rtl:pl-2 pointer-events-auto",
label: "relative text-foreground pe-2 ps-2 pointer-events-auto",
},
inside: {
label: "text-tiny cursor-text",
Expand Down Expand Up @@ -607,7 +606,7 @@ const input = tv({
"z-20",
"top-1/2",
"-translate-y-1/2",
"group-data-[filled-within=true]:left-0",
"group-data-[filled-within=true]:start-0",
],
},
},
Expand Down Expand Up @@ -757,7 +756,7 @@ const input = tv({
isMultiline: false,
class: {
label: [
"left-2",
"start-2",
"text-tiny",
"group-data-[filled-within=true]:-translate-y-[calc(100%_+_theme(fontSize.tiny)/2_+_16px)]",
],
Expand All @@ -770,9 +769,8 @@ const input = tv({
isMultiline: false,
class: {
label: [
"left-3",
"rtl:left-auto",
"rtl:right-3",
"start-3",
"end-auto",
"text-small",
"group-data-[filled-within=true]:-translate-y-[calc(100%_+_theme(fontSize.small)/2_+_20px)]",
],
Expand All @@ -785,9 +783,8 @@ const input = tv({
isMultiline: false,
class: {
label: [
"left-3",
"rtl:left-auto",
"rtl:right-3",
"start-3",
"end-auto",
"text-medium",
"group-data-[filled-within=true]:-translate-y-[calc(100%_+_theme(fontSize.small)/2_+_24px)]",
],
Expand Down

0 comments on commit deb1507

Please sign in to comment.