// Primitives
import colorDefault from "./tokens/global/colors/color.json";
import colorLight from "./tokens/global/colors/color.light.json";
import colorDark from "./tokens/global/colors/color.dark.json";
import fontDefault from "./tokens/global/font/font.json";
import spacingDefault from "./tokens/global/space/space.json";
import radiusDefault from "./tokens/global/radius/radius.json";
import opacityDefault from "./tokens/global/opacity/opacity.json";
import chroma from "chroma-js";
// Organized Tokens
export const tokens = {
    color: {
        default: colorDefault,
        light: colorLight,
        dark: colorDark,
    },
    font: {
        default: fontDefault,
    },
    space: {
        default: spacingDefault,
    },
    radius: {
        default: radiusDefault,
    },
    opacity: {
        default: opacityDefault,
    },
};
const getFactorFromFormula = (formula) => {
    const match = formula.match(/[\d\.]+/);
    return match ? parseFloat(match[0]) : 0; // Default to 0 if no value found
};
export const brighten = (value, formula) => {
    const factor = getFactorFromFormula(formula);
    return chroma(value).brighten(factor / 20).hex(); // Adjust brightness
};
export const darken = (value, formula) => {
    const factor = getFactorFromFormula(formula);
    return chroma(value).darken(factor / 20).hex(); // Adjust darkness
};
export const contrast = (value) => {
    return chroma.contrast(value, '#FFFFFF') > 4.5 ? "#ffffff" : '#000000';
};
export async function loadComponentTokens(componentName) {
    return import(`./tokens/components/${componentName}/${componentName}.json`);
}
export const componentsList = [
    "accordion",
    "anchor",
    "badge",
    "breadcrumb",
    "button",
    "button-group",
    "calendar",
    "cards",
    "carousel",
    "checkbox",
    "checkboxset",
    "chips",
    "composite",
    "container",
    "currency",
    "data-table",
    "date",
    "dropdown-menu",
    "fileupload",
    "grid-layout",
    "icon",
    "label",
    "list",
    "message",
    "modal-dialog",
    "nav",
    "page-layout",
    "pagination",
    "panel",
    "picture",
    "popover",
    "progress-bar",
    "progress-circle",
    "radioset",
    "rating",
    "richtext-editor",
    "scrollbar",
    "search",
    "spinner",
    "switch",
    "tabs",
    "tile",
    "time",
    "toast",
    "toggle",
    "wizard",
];
//# sourceMappingURL=index.js.map