Skip to content

Commit

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

* chore(changeset): remove unchanged package

* chore(pagination): undo change

* chore(pagination): no chevronPrev slot

* fix(theme): avoid rotate chevron in rtl

---------

Co-authored-by: amirhhashemi <[email protected]>
Co-authored-by: WK Wong <[email protected]>
  • Loading branch information
3 people authored Sep 8, 2024
1 parent 6f44cd6 commit fe30dc8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changeset/two-radios-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 pagination component
18 changes: 11 additions & 7 deletions packages/core/theme/src/components/pagination.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,12 @@ const pagination = tv({
"pointer-events-none",
"z-20",
],
forwardIcon:
"hidden group-hover:block group-data-[focus-visible=true]:block data-[before=true]:rotate-180",
forwardIcon: [
"hidden",
"group-hover:block",
"group-data-[focus-visible=true]:block",
"data-[before=true]:rotate-180",
],
ellipsis: "group-hover:hidden group-data-[focus-visible=true]:hidden",
chevronNext: "rotate-180",
},
Expand Down Expand Up @@ -108,12 +112,12 @@ const pagination = tv({
wrapper: "gap-0 shadow-sm",
item: [
"shadow-none",
"first-of-type:rounded-r-none",
"last-of-type:rounded-l-none",
"first-of-type:rounded-e-none",
"last-of-type:rounded-s-none",
"[&:not(:first-of-type):not(:last-of-type)]:rounded-none",
],
prev: "!rounded-r-none",
next: "!rounded-l-none",
prev: "!rounded-e-none",
next: "!rounded-s-none",
},
},
isDisabled: {
Expand Down Expand Up @@ -205,7 +209,7 @@ const pagination = tv({
isCompact: true,
variant: "bordered",
class: {
item: "[&:not(:first-of-type)]:ml-[calc(theme(borderWidth.2)*-1)]",
item: "[&:not(:first-of-type)]:ms-[calc(theme(borderWidth.2)*-1)]",
},
},
/**
Expand Down

0 comments on commit fe30dc8

Please sign in to comment.