import {color} from '@coveord/plasma-tokens';
import {MantineColorsTuple} from '@mantine/core';

const toMantineColor = (plasmaColor: Record<string, string>): MantineColorsTuple =>
    Object.values(plasmaColor) as unknown as MantineColorsTuple;

const navy = toMantineColor(color.primary.navy);
const red = toMantineColor(color.accent.red);
const yellow = toMantineColor(color.accent.yellow);
const teal = toMantineColor(color.accent.teal);
const lime = [
    color.secondary.lime[0],
    color.secondary.lime[0],
    color.secondary.lime[0],
    color.secondary.lime[0],
    color.secondary.lime[6],
    color.secondary.lime[6],
    color.secondary.lime[6],
    color.secondary.lime[9],
    color.secondary.lime[9],
    color.secondary.lime[9],
] as MantineColorsTuple;

export const PlasmaColors = {
    // Primary
    blue: [
        '#f8f9ff',
        '#eef2ff',
        '#d5defe',
        '#a6bcfe',
        '#6e99fd',
        '#1169da',
        '#063c82',
        '#03275a',
        '#01193f',
        '#010e29',
    ] satisfies MantineColorsTuple,
    red: [
        '#fff8f8',
        '#feefee',
        '#fdd5d5',
        '#fca7a5',
        '#fb6f6c',
        '#d2271b',
        '#7e0f17',
        '#58050f',
        '#3e020a',
        '#280104',
    ] satisfies MantineColorsTuple,
    gray: [
        '#f9f9fa',
        '#f1f2f4',
        '#dddfe3',
        '#b9bdc7',
        '#959cab',
        '#676d7a',
        '#3b3e46',
        '#26292f',
        '#191b1f',
        '#0e0f12',
    ] satisfies MantineColorsTuple,
    dark: [
        '#c9c9c9',
        '#b8b8b8',
        '#828282',
        '#696969',
        '#424242',
        '#3b3b3b',
        '#2e2e2e',
        '#242424',
        '#1f1f1f',
        '#141414',
    ] satisfies MantineColorsTuple,
    teal: [
        '#e5fff9',
        '#bffff0',
        '#1efadc',
        '#18d4bb',
        '#0faf99',
        '#077b6b',
        '#02473e',
        '#012f2a',
        '#011f1b',
        '#001210',
    ] satisfies MantineColorsTuple,
    yellow: [
        '#fff9e5',
        '#fff2c0',
        '#fbe000',
        '#e5b800',
        '#c89300',
        '#936400',
        '#593700',
        '#3c2301',
        '#291700',
        '#180d00',
    ] satisfies MantineColorsTuple,
    violet: [
        '#faf8ff',
        '#f4f0ff',
        '#e3daff',
        '#c7b2ff',
        '#ac86ff',
        '#8a36ff',
        '#5500aa',
        '#390076',
        '#270054',
        '#180037',
    ] satisfies MantineColorsTuple,
    grape: [
        '#fbf8fd',
        '#f6f0fb',
        '#e7d6f5',
        '#d2b0ed',
        '#bc85e3',
        '#9946c7',
        '#592676',
        '#3c1851',
        '#290e38',
        '#190624',
    ] satisfies MantineColorsTuple,
    cyan: [
        '#e3fafc',
        '#c5f6fa',
        '#99e9f2',
        '#66d9e8',
        '#3bc9db',
        '#22b8cf',
        '#15aabf',
        '#1098ad',
        '#0c8599',
        '#0b7285',
    ] satisfies MantineColorsTuple,
    orange: [
        '#fff8f5',
        '#ffefe8',
        '#ffeedd',
        '#fea980',
        '#f27a38',
        '#b84b11',
        '#6c2a00',
        '#491b02',
        '#301301',
        '#1c0a00',
    ] satisfies MantineColorsTuple,
    indigo: [
        '#f9f9fb',
        '#f1f1f9',
        '#dbdbf2',
        '#babadf',
        '#9797cb',
        '#6767a4',
        '#393968',
        '#252547',
        '#181831',
        '#0d0d1f',
    ] satisfies MantineColorsTuple,
    green: [
        '#e9ffed',
        '#cdfed5',
        '#73fa84',
        '#32d961',
        '#15b43c',
        '#0b7e2f',
        '#044918',
        '#02300f',
        '#012008',
        '#001304',
    ] satisfies MantineColorsTuple,
    navy,
    info: navy,
    // Accent
    critical: red,
    new: teal,
    warning: yellow,
    // Secondary
    lime,
    success: lime,
    purple: toMantineColor(color.secondary.purple),
};
