import { cs } from "../utils/styles.js";
import "../utils/index.js";
import { useStyleConfig } from "../core/theme.js";
import { vui } from "../core/vui.js";
import button_default from "../button/button.js";
import "../button/index.js";
import "../core/index.js";
import { usePaginationContext } from "./context.js";
import { jsx } from "react/jsx-runtime";

//#region src/pagination/paginationButton.tsx
/** Displays a page navigation button within the Pagination. */
const PaginationButton = vui((props, ref) => {
	const { className, isActive: isActiveProp, page: pageProp, ...rest } = props;
	const { onPageChange, page } = usePaginationContext();
	const styles = useStyleConfig("Pagination", usePaginationContext());
	const activeProps = isActiveProp ?? pageProp === page ? { bg: "skyBlue.85" } : {};
	return /* @__PURE__ */ jsx(button_default, {
		className: cs("vui-paginationButton", className),
		onClick: () => onPageChange(pageProp),
		ref,
		size: "sm",
		text: pageProp,
		variant: "text",
		...styles.button,
		...activeProps,
		...rest
	});
});
PaginationButton.displayName = "PaginationButton";
var paginationButton_default = PaginationButton;

//#endregion
export { PaginationButton, paginationButton_default as default };
globalThis.__vuiVersion__ = "4.0.0-beta.1"
//# sourceMappingURL=paginationButton.js.map