import { h as e } from "./chunk.BlbRoQQ3.js";
import { aa as t, ab as n, aj as r, al as i, ao as a, u as o } from "./system.DbMQd1I1.js";
import { c as s, d as c, m as l, n as u } from "./text.CvSXsyI-.js";
import { b as d } from "./height.props.DCx-mV3G.js";
import * as f from "react";
const p = [
	"0",
	"1",
	"2",
	"3",
	"4",
	"5",
	"6",
	"7",
	"8",
	"9"
], m = {
	p: {
		type: "enum | string",
		className: "rt-r-p",
		customProperties: ["--p"],
		values: p,
		responsive: !0
	},
	px: {
		type: "enum | string",
		className: "rt-r-px",
		customProperties: ["--pl", "--pr"],
		values: p,
		responsive: !0
	},
	py: {
		type: "enum | string",
		className: "rt-r-py",
		customProperties: ["--pt", "--pb"],
		values: p,
		responsive: !0
	},
	pt: {
		type: "enum | string",
		className: "rt-r-pt",
		customProperties: ["--pt"],
		values: p,
		responsive: !0
	},
	pr: {
		type: "enum | string",
		className: "rt-r-pr",
		customProperties: ["--pr"],
		values: p,
		responsive: !0
	},
	pb: {
		type: "enum | string",
		className: "rt-r-pb",
		customProperties: ["--pb"],
		values: p,
		responsive: !0
	},
	pl: {
		type: "enum | string",
		className: "rt-r-pl",
		customProperties: ["--pl"],
		values: p,
		responsive: !0
	}
}, h = [
	"visible",
	"hidden",
	"clip",
	"scroll",
	"auto"
], g = [
	"static",
	"relative",
	"absolute",
	"fixed",
	"sticky"
], _ = [
	"0",
	"1",
	"2",
	"3",
	"4",
	"5",
	"6",
	"7",
	"8",
	"9",
	"-1",
	"-2",
	"-3",
	"-4",
	"-5",
	"-6",
	"-7",
	"-8",
	"-9"
], v = ["0", "1"], y = ["0", "1"], b = {
	...m,
	...u,
	...d,
	position: {
		type: "enum",
		className: "rt-r-position",
		values: g,
		responsive: !0
	},
	inset: {
		type: "enum | string",
		className: "rt-r-inset",
		customProperties: ["--inset"],
		values: _,
		responsive: !0
	},
	top: {
		type: "enum | string",
		className: "rt-r-top",
		customProperties: ["--top"],
		values: _,
		responsive: !0
	},
	right: {
		type: "enum | string",
		className: "rt-r-right",
		customProperties: ["--right"],
		values: _,
		responsive: !0
	},
	bottom: {
		type: "enum | string",
		className: "rt-r-bottom",
		customProperties: ["--bottom"],
		values: _,
		responsive: !0
	},
	left: {
		type: "enum | string",
		className: "rt-r-left",
		customProperties: ["--left"],
		values: _,
		responsive: !0
	},
	overflow: {
		type: "enum",
		className: "rt-r-overflow",
		values: h,
		responsive: !0
	},
	overflowX: {
		type: "enum",
		className: "rt-r-ox",
		values: h,
		responsive: !0
	},
	overflowY: {
		type: "enum",
		className: "rt-r-oy",
		values: h,
		responsive: !0
	},
	flexBasis: {
		type: "string",
		className: "rt-r-fb",
		customProperties: ["--flex-basis"],
		responsive: !0
	},
	flexShrink: {
		type: "enum | string",
		className: "rt-r-fs",
		customProperties: ["--flex-shrink"],
		values: v,
		responsive: !0
	},
	flexGrow: {
		type: "enum | string",
		className: "rt-r-fg",
		customProperties: ["--flex-grow"],
		values: y,
		responsive: !0
	},
	gridArea: {
		type: "string",
		className: "rt-r-ga",
		customProperties: ["--grid-area"],
		responsive: !0
	},
	gridColumn: {
		type: "string",
		className: "rt-r-gc",
		customProperties: ["--grid-column"],
		responsive: !0
	},
	gridColumnStart: {
		type: "string",
		className: "rt-r-gcs",
		customProperties: ["--grid-column-start"],
		responsive: !0
	},
	gridColumnEnd: {
		type: "string",
		className: "rt-r-gce",
		customProperties: ["--grid-column-end"],
		responsive: !0
	},
	gridRow: {
		type: "string",
		className: "rt-r-gr",
		customProperties: ["--grid-row"],
		responsive: !0
	},
	gridRowStart: {
		type: "string",
		className: "rt-r-grs",
		customProperties: ["--grid-row-start"],
		responsive: !0
	},
	gridRowEnd: {
		type: "string",
		className: "rt-r-gre",
		customProperties: ["--grid-row-end"],
		responsive: !0
	}
}, x = [
	"1",
	"2",
	"3",
	"4"
], S = [
	"classic",
	"solid",
	"soft",
	"surface",
	"outline",
	"ghost"
], C = {
	...n,
	size: {
		type: "enum",
		className: "rt-r-size",
		values: x,
		default: "2",
		responsive: !0
	},
	variant: {
		type: "enum",
		className: "rt-variant",
		values: S,
		default: "solid"
	},
	...t,
	...l,
	...o,
	loading: {
		type: "boolean",
		className: "rt-loading",
		default: !1
	}
}, w = [
	"0",
	"1",
	"2",
	"3",
	"4",
	"5",
	"6",
	"7",
	"8",
	"9"
], T = {
	gap: {
		type: "enum | string",
		className: "rt-r-gap",
		customProperties: ["--gap"],
		values: w,
		responsive: !0
	},
	gapX: {
		type: "enum | string",
		className: "rt-r-cg",
		customProperties: ["--column-gap"],
		values: w,
		responsive: !0
	},
	gapY: {
		type: "enum | string",
		className: "rt-r-rg",
		customProperties: ["--row-gap"],
		values: w,
		responsive: !0
	}
}, E = ["div", "span"], D = [
	"none",
	"inline-flex",
	"flex"
], O = [
	"row",
	"column",
	"row-reverse",
	"column-reverse"
], k = [
	"start",
	"center",
	"end",
	"baseline",
	"stretch"
], A = [
	"start",
	"center",
	"end",
	"between"
], j = [
	"nowrap",
	"wrap",
	"wrap-reverse"
], M = {
	as: {
		type: "enum",
		values: E,
		default: "div"
	},
	...n,
	display: {
		type: "enum",
		className: "rt-r-display",
		values: D,
		responsive: !0
	},
	direction: {
		type: "enum",
		className: "rt-r-fd",
		values: O,
		responsive: !0
	},
	align: {
		type: "enum",
		className: "rt-r-ai",
		values: k,
		responsive: !0
	},
	justify: {
		type: "enum",
		className: "rt-r-jc",
		values: A,
		parseValue: N,
		responsive: !0
	},
	wrap: {
		type: "enum",
		className: "rt-r-fw",
		values: j,
		responsive: !0
	},
	...T
};
function N(e) {
	return e === "between" ? "space-between" : e;
}
var P = /* @__PURE__ */ e(r());
const F = f.forwardRef((e, t) => {
	let { className: n, asChild: r, as: i = "div",...o } = c(e, M, b, s);
	return f.createElement(r ? a : i, {
		...o,
		ref: t,
		className: (0, P.default)("rt-Flex", n)
	});
});
F.displayName = "Flex";
const I = [
	"1",
	"2",
	"3"
], L = {
	size: {
		type: "enum",
		className: "rt-r-size",
		values: I,
		default: "2",
		responsive: !0
	},
	loading: {
		type: "boolean",
		default: !0
	}
};
var R = /* @__PURE__ */ e(r());
const z = f.forwardRef((e, t) => {
	let { className: n, children: r, loading: i,...a } = c(e, L, s);
	if (!i) return r;
	let o = f.createElement("span", {
		...a,
		ref: t,
		className: (0, R.default)("rt-Spinner", n)
	}, f.createElement("span", { className: "rt-SpinnerLeaf" }), f.createElement("span", { className: "rt-SpinnerLeaf" }), f.createElement("span", { className: "rt-SpinnerLeaf" }), f.createElement("span", { className: "rt-SpinnerLeaf" }), f.createElement("span", { className: "rt-SpinnerLeaf" }), f.createElement("span", { className: "rt-SpinnerLeaf" }), f.createElement("span", { className: "rt-SpinnerLeaf" }), f.createElement("span", { className: "rt-SpinnerLeaf" }));
	return r === void 0 ? o : f.createElement(F, {
		asChild: !0,
		position: "relative",
		align: "center",
		justify: "center"
	}, f.createElement("span", null, f.createElement("span", {
		"aria-hidden": !0,
		style: {
			display: "contents",
			visibility: "hidden"
		},
		inert: void 0
	}, r), f.createElement(F, {
		asChild: !0,
		align: "center",
		justify: "center",
		position: "absolute",
		inset: "0"
	}, f.createElement("span", null, o))));
});
z.displayName = "Spinner";
const B = [
	"1",
	"2",
	"3"
], V = [
	"soft",
	"surface",
	"outline"
], H = {
	...n,
	size: {
		type: "enum",
		className: "rt-r-size",
		values: B,
		default: "2",
		responsive: !0
	},
	variant: {
		type: "enum",
		className: "rt-variant",
		values: V,
		default: "soft"
	},
	...t,
	...l
};
function U(e, t) {
	if (e !== void 0) return typeof e == "string" ? t(e) : Object.fromEntries(Object.entries(e).map(([e, n]) => [e, t(n)]));
}
function W(e) {
	return e === "3" ? "3" : "2";
}
function G(e) {
	switch (e) {
		case "1": return "1";
		case "2":
		case "3": return "2";
		case "4": return "3";
	}
}
var K = /* @__PURE__ */ e(r());
const q = f.forwardRef((e, t) => {
	let { size: n = C.size.default } = e, { className: r, children: o, asChild: l, color: u, radius: d, disabled: p = e.loading,...m } = c(e, C, s);
	return f.createElement(l ? a : "button", {
		"data-disabled": p || void 0,
		"data-accent-color": u,
		"data-radius": d,
		...m,
		ref: t,
		className: (0, K.default)("rt-reset", "rt-BaseButton", r),
		disabled: p
	}, e.loading ? f.createElement(f.Fragment, null, f.createElement("span", {
		style: {
			display: "contents",
			visibility: "hidden"
		},
		"aria-hidden": !0
	}, o), f.createElement(i, null, o), f.createElement(F, {
		asChild: !0,
		align: "center",
		justify: "center",
		position: "absolute",
		inset: "0"
	}, f.createElement("span", null, f.createElement(z, { size: U(n, G) })))) : o);
});
q.displayName = "BaseButton";
export { q as b, U as c, W as d, H as e, z as f, M as g, m as h };

//# sourceMappingURL=base-button.ClgpqKOM.js.map