/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
"use client";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
require("../../../_virtual/_rolldown/runtime.cjs");
const require_utils_createSlot = require("../../../utils/createSlot.cjs");
const require_components_Icon = require("../../Icon.cjs");
const require_components_client_Pagination_paginationContext = require("./paginationContext.cjs");
const require_components_client_Pagination_paginationStyles = require("./paginationStyles.cjs");
let _yahoo_uds_icons = require("@yahoo/uds-icons");
let react = require("react");
let react_jsx_runtime = require("react/jsx-runtime");
//#region src/components/client/Pagination/PaginationNext.tsx
const Slot = require_utils_createSlot.createSlot();
const PaginationNext = (0, react.forwardRef)(function PaginationNext({ label = "Next", asChild = false, className, onClick, children, ...rest }, ref) {
	const { activePage, totalPages, size, variant, onPageChange } = require_components_client_Pagination_paginationContext.usePaginationContext();
	const controlClass = require_components_client_Pagination_paginationStyles.usePaginationPrevNextClassName(size, variant, className);
	const iconClass = require_components_client_Pagination_paginationStyles.usePaginationIconClassName(size);
	const textClass = require_components_client_Pagination_paginationStyles.usePaginationItemLabelClassName(size);
	const handleClick = (event) => {
		onClick?.(event);
		if (!event.defaultPrevented) onPageChange?.(activePage + 1);
	};
	if (activePage >= totalPages) return null;
	const Comp = asChild ? Slot : "button";
	const content = children ?? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
		className: textClass,
		children: label
	}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Icon.Icon, {
		name: _yahoo_uds_icons.ChevronRight,
		size: "sm",
		color: "current",
		className: iconClass,
		"aria-hidden": true
	})] });
	if (asChild && (0, react.isValidElement)(children)) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Comp, {
		ref,
		type: "button",
		className: controlClass,
		"aria-label": "Go to next page",
		onClick: handleClick,
		...rest,
		children
	});
	return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Comp, {
		ref,
		type: "button",
		className: controlClass,
		"aria-label": "Go to next page",
		onClick: handleClick,
		...rest,
		children: content
	});
});
PaginationNext.displayName = "PaginationNext";
//#endregion
exports.PaginationNext = PaginationNext;
