import { r as FormOnColor } from "./constants2.js";
import classNames from "classnames";
import { jsx } from "react/jsx-runtime";
import styles from "./components/MaxCharacters/styles.module.scss";
var MaxCharacters = ({ maxCharacters, maxText, length, onColor, maxWidth }) => {
	const progress = length / maxCharacters;
	const counterTextClass = classNames(styles["max-characters"], {
		[styles[`max-characters--on-dark`]]: onColor === FormOnColor.ondark,
		[styles[`max-characters--invalid`]]: progress > 1
	});
	const ariaLevel = progress > .95 ? "polite" : "off";
	return /* @__PURE__ */ jsx("div", {
		"aria-live": ariaLevel,
		"aria-atomic": "true",
		className: counterTextClass,
		style: { maxWidth },
		children: `${length}/${maxCharacters} ${maxText}`
	});
};
var MaxCharacters_default = MaxCharacters;
export { MaxCharacters_default as t };

//# sourceMappingURL=MaxCharacters.js.map