import { _ as y, l as A, v as u, x as k } from "./vendor-preact-DThS2ZQ_.js";
import { n as cn, r as Spacer, t as LoadingIcon } from "./loadingIcon-B0ysgiNq.js";
import { t as Title } from "./typography-BZIpjo97.js";
//#region src/shared/spinner/spinner.tsx
var sizeMap = {
	small: 24,
	medium: 48,
	large: 64
};
var Spinner = ({ title, subtitle, size = "medium", fullScreen = true, className }) => {
	const iconSize = sizeMap[size];
	const titleRef = A(null);
	y(() => {
		if (title) titleRef.current?.focus();
	}, [title]);
	return /* @__PURE__ */ u("div", {
		class: cn("IncodeSpinner", fullScreen && "IncodeSpinnerFullScreen", className),
		"data-testid": "spinner",
		"data-title": title,
		"data-subtitle": subtitle,
		"data-size": size,
		role: "status",
		"aria-live": "polite",
		children: /* @__PURE__ */ u("div", {
			class: "IncodeSpinnerContent",
			children: [/* @__PURE__ */ u(LoadingIcon, { size: iconSize }), (title || subtitle) && /* @__PURE__ */ u(k, { children: [/* @__PURE__ */ u(Spacer, { size: 16 }), /* @__PURE__ */ u("div", {
				class: "IncodeSpinnerText",
				children: [title && /* @__PURE__ */ u(Title, {
					ref: titleRef,
					tabIndex: -1,
					className: "IncodeSpinnerTitle",
					children: title
				}), subtitle && /* @__PURE__ */ u(k, { children: [title && /* @__PURE__ */ u(Spacer, { size: 12 }), /* @__PURE__ */ u("p", {
					class: "IncodeSpinnerSubtitle",
					children: subtitle
				})] })]
			})] })]
		})
	});
};
//#endregion
export { Spinner as t };
