/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-a795c5b | Cube Dev Team */
import { cacheWrapper } from "./cache-wrapper.js";
import { camelToKebab } from "./case-converter.js";

//#region src/tasty/utils/mod-attrs.ts
function modAttrs(map) {
	return map ? Object.keys(map).reduce((attrs, key) => {
		const value = map[key];
		if (value == null || value === false) return attrs;
		const attrName = `data-${camelToKebab(key)}`;
		if (value === true) attrs[attrName] = "";
		else if (typeof value === "string") attrs[attrName] = value;
		else if (typeof value === "number") attrs[attrName] = String(value);
		else console.warn(`CubeUIKit: Invalid mod value for "${key}". Expected boolean, string, or number, got ${typeof value}`);
		return attrs;
	}, {}) : null;
}
const _modAttrs = cacheWrapper(modAttrs);

//#endregion
export { _modAttrs };
//# sourceMappingURL=mod-attrs.js.map