/*! ratio-ui · design system for knowledge sharing · https://github.com/losol/ratio-ui · (c) 2026 Losol AS · MPL-2.0 */
"use client";
import { createContext, useContext } from "react";
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
import { Breadcrumb, Breadcrumbs } from "react-aria-components";
//#region src/core/Breadcrumbs/Breadcrumbs.tsx
var LinkContext = createContext(void 0);
/**
* Breadcrumbs component for navigation hierarchy
*
* @example
* ```tsx
* import { Link } from '@eventuras/ratio-ui-next';
*
* <Breadcrumbs LinkComponent={Link}>
*   <Breadcrumb href="/">Home</Breadcrumb>
*   <Breadcrumb href="/docs">Docs</Breadcrumb>
*   <Breadcrumb>Current Page</Breadcrumb>
* </Breadcrumbs>
* ```
*/
function Breadcrumbs$1({ className = "", LinkComponent, children, ...props }) {
	return /* @__PURE__ */ jsx(LinkContext.Provider, {
		value: LinkComponent,
		children: /* @__PURE__ */ jsx(Breadcrumbs, {
			className: `flex items-center text-sm gap-2 ${className}`,
			...props,
			children
		})
	});
}
/**
* Individual breadcrumb item
*/
function Breadcrumb$1({ href, className = "", children, ...props }) {
	const LinkComponent = useContext(LinkContext);
	const linkClasses = `text-(--primary) hover:underline ${className}`;
	let content;
	if (href && LinkComponent) content = /* @__PURE__ */ jsx(LinkComponent, {
		href,
		className: linkClasses,
		children
	});
	else if (href) content = /* @__PURE__ */ jsx("a", {
		href,
		className: linkClasses,
		children
	});
	else content = /* @__PURE__ */ jsx("span", {
		className: `text-(--text-muted) ${className}`,
		children
	});
	return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Breadcrumb, {
		...props,
		children: content
	}), /* @__PURE__ */ jsx("span", {
		className: "text-(--text-subtle) last:hidden",
		"aria-hidden": "true",
		children: "/"
	})] });
}
//#endregion
export { Breadcrumb$1 as Breadcrumb, Breadcrumbs$1 as Breadcrumbs };

//# sourceMappingURL=Breadcrumbs.js.map