import { isNumber, isString } from "../utils/assertion.js";
import { cs } from "../utils/styles.js";
import "../utils/index.js";
import { useStyleConfig } from "../core/theme.js";
import { vui } from "../core/vui.js";
import box_default from "../box/box.js";
import "../box/index.js";
import "../core/index.js";
import { usePaginationContext } from "./context.js";
import paginationButton_default from "./paginationButton.js";
import paginationEllipsis_default from "./paginationEllipsis.js";
import paginationPrevNext_default from "./paginationPrevNext.js";
import { Fragment } from "react";
import { jsx, jsxs } from "react/jsx-runtime";

//#region src/pagination/paginationNavigation.tsx
/** Displays a set of page navigation buttons. */
const PaginationNavigation = vui((props, ref) => {
	const { children, className, ...rest } = props;
	const { items } = usePaginationContext();
	const styles = useStyleConfig("Pagination", usePaginationContext());
	return /* @__PURE__ */ jsx(box_default, {
		className: cs("vui-paginationNavigation", className),
		gap: 1,
		ref,
		wrap: true,
		...styles.navigation,
		...rest,
		children: children ?? items.map((item) => /* @__PURE__ */ jsxs(Fragment, { children: [
			item === "previous" && /* @__PURE__ */ jsx(paginationPrevNext_default, {
				"aria-label": "previous",
				direction: "previous"
			}),
			isNumber(item) && /* @__PURE__ */ jsx(paginationButton_default, { page: item }),
			isString(item) && item.includes("ellipsis") && /* @__PURE__ */ jsx(paginationEllipsis_default, {}),
			item === "next" && /* @__PURE__ */ jsx(paginationPrevNext_default, {
				"aria-label": "next",
				direction: "next"
			})
		] }, item))
	});
});
PaginationNavigation.displayName = "PaginationNavigation";
var paginationNavigation_default = PaginationNavigation;

//#endregion
export { PaginationNavigation, paginationNavigation_default as default };
globalThis.__vuiVersion__ = "4.0.0-beta.1"
//# sourceMappingURL=paginationNavigation.js.map