import { generate } from '@ant-design/colors';
import genControlHeight from '../shared/genControlHeight.mjs';
import genSizeMapToken from '../shared/genSizeMapToken.mjs';
import { defaultPresetColors } from '../seed.mjs';
import genColorMapToken from '../shared/genColorMapToken.mjs';
import genCommonMapToken from '../shared/genCommonMapToken.mjs';
import genFontMapToken from '../shared/genFontMapToken.mjs';
import { generateColorPalettes, generateNeutralColorPalettes } from './colors.mjs';

function derivative(token) {
  const colorPalettes = Object.keys(defaultPresetColors).map((colorKey) => {
    const colors = generate(token[colorKey]);
    return new Array(10).fill(1).reduce((prev, _, i) => {
      prev[`${colorKey}-${i + 1}`] = colors[i];
      return prev;
    }, {});
  }).reduce((prev, cur) => {
    prev = {
      ...prev,
      ...cur
    };
    return prev;
  }, {});
  return {
    ...token,
    ...colorPalettes,
    // Colors
    ...genColorMapToken(token, {
      generateColorPalettes,
      generateNeutralColorPalettes
    }),
    // Font
    ...genFontMapToken(token.fontSize),
    // Size
    ...genSizeMapToken(token),
    // Height
    ...genControlHeight(token),
    // Others
    ...genCommonMapToken(token)
  };
}

export { derivative as default };
//# sourceMappingURL=index.mjs.map
