import { isNumber, isString } from "../utils/assertion.js";
import { cs } from "../utils/styles.js";
import { useStyleConfig } from "../core/theme.js";
import vui from "../core/vui.js";
import Box from "../box/box.js";
import { usePaginationContext } from "./context.js";
import PaginationButton from "./paginationButton.js";
import PaginationEllipsis from "./paginationEllipsis.js";
import PaginationPrevNext 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, {
		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, {
				"aria-label": "previous",
				direction: "previous"
			}),
			isNumber(item) && /* @__PURE__ */ jsx(PaginationButton, { page: item }),
			isString(item) && item.includes("ellipsis") && /* @__PURE__ */ jsx(PaginationEllipsis, {}),
			item === "next" && /* @__PURE__ */ jsx(PaginationPrevNext, {
				"aria-label": "next",
				direction: "next"
			})
		] }, item))
	});
});
PaginationNavigation.displayName = "PaginationNavigation";

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