import { n as e } from "../chunks/popover-IztNF45J.js";
import { useMemo as t } from "react";
import { cn as n } from "@ryuzaki13/react-foundation-lib/utils";
import { jsx as r } from "react/jsx-runtime";
import { normalizeTextWithFallback as i } from "@ryuzaki13/react-foundation-lib/formatters";
//#region src/text/HighlightText.tsx
var a = ({ text: e, highlight: t }) => t ? e.split(RegExp(`(${t})`, "gi")).map((e, n) => e.toLowerCase() === t.toLowerCase() ? /* @__PURE__ */ r("mark", { children: e }, n) : e) : e, o = {
	primary: "content0",
	secondary: "content1",
	muted: "content2",
	info: "statusInfo",
	success: "statusSuccess",
	warning: "statusWarning",
	error: "statusError",
	brand: "statusBrand",
	accent: "contentAccent"
}, s = {
	xs: "fontSizeXs",
	sm: "fontSizeSm",
	md: "fontSizeMd",
	lg: "fontSizeLg",
	xl: "fontSizeXl"
}, c = {
	lighter: "fontLighter",
	light: "fontLight",
	regular: "fontRegular",
	medium: "fontMedium",
	bold: "fontBold",
	bolder: "fontBolder"
}, l = {
	wrap: "textWrap",
	noWrap: "textNoWrap"
}, u = ({ size: e, color: r, weight: i, italic: a, uppercase: u, wrap: d, className: f }) => t(() => {
	let t = [];
	return e && t.push(s[e]), i && t.push(c[i]), d && t.push(l[d]), a && t.push("fontItalic"), u && t.push("textUppercase"), r && t.push(o[r]), n(...t, f);
}, [
	e,
	i,
	r,
	a,
	u,
	d,
	f
]), d = ({ children: e, as: t, style: n, ...i }) => {
	let a = u(i);
	return /* @__PURE__ */ r(t || "span", {
		className: a,
		style: n,
		children: e
	});
};
//#endregion
//#region src/text/TextOverflow.tsx
function f({ maxChar: t, placement: n = "left", closeDelay: a = 0, maxWidth: o, children: s, block: c, state: l, textWrap: u, textWrapProps: d }) {
	let f = i(s);
	if (!f.length || t && f.length < t) return /* @__PURE__ */ r("span", { children: f });
	let p = u ?? "div", m = {
		style: {
			display: c ? "block" : "inline-block",
			width: t ? `${t - 3}ch` : "auto"
		},
		className: "textOverflow"
	}, h = {
		...d,
		...m,
		style: {
			...d?.style,
			...m.style
		},
		className: [d?.className, m.className].filter(Boolean).join(" ")
	};
	return /* @__PURE__ */ r(e, {
		state: l,
		placement: n,
		openOnHover: !0,
		content: f,
		closeDelay: a,
		maxWidth: o,
		children: /* @__PURE__ */ r(p, {
			...h,
			children: f
		})
	});
}
//#endregion
export { a as HighlightText, d as Text, f as TextOverflow };

//# sourceMappingURL=index.js.map