import { cx as e } from "../../../theme/tools.js";
import { ButtonLoadingSpinnerSvg as t } from "../../../icons/ButtonLoadingSpinnerSvg.js";
import { useUiTranslation as n } from "../../../i18n/useUiTranslation.js";
import { button as r, content as i, iconLeft as a, iconRight as o, loadingIndicator as s, spinnerIcon as c } from "./button.css.js";
import "react";
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
//#region src/atomic/atoms/button/Button.tsx
var f = (f) => {
	let { t: p } = n(), { children: m, className: h, disabled: g, isLoading: _ = !1, loadingLabel: v, classes: y, leftIcon: b, rightIcon: x, size: S, variant: C, width: w, ref: T, ...E } = f, D = e(r({
		variant: C,
		size: S,
		width: w
	}), h), O = !!_ || !!g, k;
	if (_) {
		let n = v ?? p("common.loading");
		k = /* @__PURE__ */ d("span", {
			className: e(s, y?.loadingIndicator),
			children: [/* @__PURE__ */ u(t, {
				className: e(c, y?.spinnerIcon),
				width: 20,
				height: 20
			}), n]
		});
	} else {
		let t = [];
		b != null && t.push(/* @__PURE__ */ u("span", {
			className: e(a, y?.iconLeft),
			children: b
		}, "left-icon")), t.push(/* @__PURE__ */ u("span", {
			className: e(i, y?.content),
			children: m
		}, "content")), x != null && t.push(/* @__PURE__ */ u("span", {
			className: e(o, y?.iconRight),
			children: x
		}, "right-icon")), k = /* @__PURE__ */ u(l, { children: t });
	}
	return /* @__PURE__ */ u("button", {
		ref: T,
		className: D,
		disabled: O,
		...E,
		children: k
	});
};
//#endregion
export { f as Button };

//# sourceMappingURL=Button.js.map