From 7017b0badf7ebccd775fc4e1f3c0d0f6b981bad9 Mon Sep 17 00:00:00 2001 From: seojcarlos Date: Sun, 5 Apr 2026 02:14:47 +0200 Subject: [PATCH 1/5] feat(pagination): add getPageUrl prop for SEO-friendly anchor links When getPageUrl is provided, pagination buttons render as elements instead of ); From 09f4ae4598c71a34a5af59fd565e4ca9d61ab16b Mon Sep 17 00:00:00 2001 From: seojcarlos Date: Sun, 5 Apr 2026 02:26:55 +0200 Subject: [PATCH 3/5] refactor(pagination): use discriminated union types for button/anchor variants Replace unsafe type casts with a proper discriminated union pattern. PaginationButtonProps and PaginationPrevButtonProps now use href as the discriminator: when href is provided, anchor-specific props apply; otherwise, button-specific props apply. This removes all 'as unknown as' casts and ensures type safety at compile time. Also removes redundant aria-disabled on enabled anchor elements. --- .../src/components/Pagination/Pagination.tsx | 32 ++++---- .../Pagination/PaginationButton.tsx | 73 ++++++++++--------- 2 files changed, 59 insertions(+), 46 deletions(-) diff --git a/packages/ui/src/components/Pagination/Pagination.tsx b/packages/ui/src/components/Pagination/Pagination.tsx index 192a994917..4caf0aa001 100644 --- a/packages/ui/src/components/Pagination/Pagination.tsx +++ b/packages/ui/src/components/Pagination/Pagination.tsx @@ -121,6 +121,9 @@ const DefaultPagination = forwardRef((props onPageChange(previousPage); } + const previousHref = getPageUrl && currentPage > 1 ? getPageUrl(previousPage) : undefined; + const nextHref = getPageUrl && currentPage < totalPages ? getPageUrl(nextPage) : undefined; + return (