Skip to content

Commit 1b8fb55

Browse files
Merge branch 'development' into DSD-1924/heading-line-height
2 parents 261ff8e + b80eca2 commit 1b8fb55

File tree

5 files changed

+19
-6
lines changed

5 files changed

+19
-6
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Currently, this repo is in Prerelease. When it is released, this project will ad
1010

1111
### Updates
1212

13+
- Updates the `Pagination` component to handle 4 digit page counts.
1314
- Updates the `Heading` component to add `line-height` styles for mobile.
1415

1516
## 3.5.2 (January 16, 2025)

src/components/Pagination/Pagination.mdx

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ import Link from "../Link/Link";
99

1010
# Pagination
1111

12-
| Component Version | DS Version |
13-
| ----------------- | ---------- |
14-
| Added | `0.0.10` |
15-
| Latest | `3.5.2` |
12+
| Component Version | DS Version |
13+
| ----------------- | ------------ |
14+
| Added | `0.0.10` |
15+
| Latest | `Prerelease` |
1616

1717
## Table of Contents
1818

src/components/Pagination/Pagination.tsx

+6-1
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,12 @@ export const Pagination: ChakraComponent<
298298
Math.min(
299299
// If the current page is in the middle, start the range
300300
// one number before the current page.
301-
selected - 1,
301+
// But if page number has 4 digits and is fourth from the end,
302+
// start the range at that number.
303+
// Ex. 1 ... 1998, 1999, 2000, 2001
304+
pageCount > 999 && selected === pageCount - 3
305+
? selected
306+
: selected - 1,
302307
// If the current page is near the end, show the last five items.
303308
// If the page number has 4 digits, show only the last four items.
304309
pageCount > 999 ? pageCount - 3 : pageCount - 4

src/components/Pagination/paginationChangelogData.ts

+7
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@
99
import { ChangelogData } from "../../utils/ComponentChangelogTable";
1010

1111
export const changelogData: ChangelogData[] = [
12+
{
13+
date: "Prerelease",
14+
version: "Prerelease",
15+
type: "Update",
16+
affects: ["Functionality"],
17+
notes: ["Handling for 4 digit page counts"],
18+
},
1219
{
1320
date: "2025-01-16",
1421
version: "3.5.2",

src/theme/components/pagination.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const Pagination = defineMultiStyleConfig({
1313
minWidth: { base: "320px", md: "unset" },
1414
width: "100%",
1515
link: {
16-
lineHeight: "1.15",
16+
lineHeight: "1",
1717
textDecoration: "none",
1818
_hover: {
1919
textDecoration: "none",

0 commit comments

Comments
 (0)