From 7e0720388afe01b7046f07efaf1ebd05a564607f Mon Sep 17 00:00:00 2001 From: Robert Knight Date: Tue, 3 Dec 2024 12:21:14 +0000 Subject: [PATCH] Import `PaginationNavigation` from client as `Pagination` Import the `PaginationNavigation` component from the hypothesis/client repository and rename it to the more succinct `Pagination`. --- src/components/navigation/Pagination.tsx | 148 ++++++++++++++++++ src/components/navigation/index.ts | 2 + .../navigation/test/Pagination-test.js | 132 ++++++++++++++++ src/index.ts | 1 + .../patterns/navigation/PaginationPage.tsx | 71 +++++++++ src/pattern-library/routes.ts | 7 + src/util/pagination.ts | 73 +++++++++ src/util/test/pagination-test.js | 22 +++ 8 files changed, 456 insertions(+) create mode 100644 src/components/navigation/Pagination.tsx create mode 100644 src/components/navigation/test/Pagination-test.js create mode 100644 src/pattern-library/components/patterns/navigation/PaginationPage.tsx create mode 100644 src/util/pagination.ts create mode 100644 src/util/test/pagination-test.js diff --git a/src/components/navigation/Pagination.tsx b/src/components/navigation/Pagination.tsx new file mode 100644 index 000000000..f543905ed --- /dev/null +++ b/src/components/navigation/Pagination.tsx @@ -0,0 +1,148 @@ +import classnames from 'classnames'; +import type { JSX } from 'preact'; + +import type { PresentationalProps } from '../../types'; +import { pageNumberOptions } from '../../util/pagination'; +import { ArrowLeftIcon, ArrowRightIcon } from '../icons'; +import Button from '../input/Button'; +import type { ButtonProps } from '../input/Button'; + +type NavigationButtonProps = PresentationalProps & + ButtonProps & + Omit, 'icon' | 'size'>; + +function NavigationButton({ ...buttonProps }: NavigationButtonProps) { + return ( +