/**
 * @license MIT
 * author: Cube Dev Team
 * @cube-dev/ui-kit v0.0.0-canary-9f40d0e
 * Released under the MIT license.
 */

const SUGGESTED_PROP_MAP = {
    disabled: 'isDisabled',
    loading: 'isLoading',
    selected: 'isSelected',
};
const PREFIX = 'CubeUIKit';
const devMode = process.env.NODE_ENV !== 'production';
export function propDeprecationWarning(name, props, propList) {
    propList.forEach((prop) => {
        if (prop in props) {
            const suggestion = SUGGESTED_PROP_MAP[prop];
            warn(`"${prop}" property of "${name}" component is deprecated.${suggestion ? ` Use "${suggestion}" property instead.` : ''}`);
        }
    });
}
export function warn(...args) {
    if (devMode) {
        console.warn(`${PREFIX}:`, ...args);
    }
}
export function deprecationWarning(condition, { property, name, betterAlternative, reason, }) {
    if (condition)
        return;
    if (!devMode)
        return;
    // we can make deprecations even better if we add the md syntax in the console.
    // anyway, everything down below will be stripped in the production build
    console.group(`⚠️ ${PREFIX}: Deprecation in ${name}`);
    warn(`"${property}" is deprecated, consider better alternative: ${typeof betterAlternative === 'function'
        ? betterAlternative()
        : betterAlternative}`);
    reason &&
        warn(`Reason: ${typeof reason === 'function' ? reason() : reason}`);
    console.groupEnd();
}

        