/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
"use client";
import { PaginationProvider, defaultGetItemAriaLabel } from "./paginationContext.js";
import { usePaginationRootClassName } from "./paginationStyles.js";
import { forwardRef, useMemo } from "react";
import { jsx } from "react/jsx-runtime";
//#region src/components/client/Pagination/Pagination.tsx
/**
* **Pagination — numbered page navigation component**
*
* @componentType Client component
*
* @description Compose with `PaginationPrev`, `PaginationNumbers`, and `PaginationNext`.
* The consumer owns `activePage` state.
*
* @example
* ```tsx
* <Pagination activePage={page} totalPages={10} onPageChange={setPage} aria-label="Results">
*   <PaginationPrev />
*   <PaginationNumbers />
*   <PaginationNext />
* </Pagination>
* ```
*/
const Pagination = forwardRef(function Pagination({ activePage, totalPages, maxVisiblePageNumbers = 7, ellipsisPlacement = "default", size = "md", variant = "default", getPageHref, getItemAriaLabel = defaultGetItemAriaLabel, onPageChange, children, className, "aria-label": ariaLabel = "Pagination", ...rest }, ref) {
	const rootClass = usePaginationRootClassName(size, className);
	return /* @__PURE__ */ jsx(PaginationProvider, {
		value: useMemo(() => ({
			activePage,
			totalPages,
			maxVisiblePageNumbers,
			ellipsisPlacement,
			size,
			variant,
			getPageHref,
			getItemAriaLabel,
			onPageChange
		}), [
			activePage,
			totalPages,
			maxVisiblePageNumbers,
			ellipsisPlacement,
			size,
			variant,
			getPageHref,
			getItemAriaLabel,
			onPageChange
		]),
		children: /* @__PURE__ */ jsx("nav", {
			ref,
			"aria-label": ariaLabel,
			className: rootClass,
			...rest,
			children
		})
	});
});
Pagination.displayName = "Pagination";
//#endregion
export { Pagination };
