import {createRequire} from 'node:module';
const require = createRequire(import.meta.url);
// need this because of issue when using ESM : https://github.com/11ty/eleventy-dependency-tree-esm/issues/2
// This will get soon resolved

const tokens = require('./tokens.json');

export default {
  colors() {
    let response = [];

    Object.keys(tokens.colors).forEach(key => {
      response.push({
        value: tokens.colors[key],
        key
      });
    });

    return response;
  },
  sizes() {
    let response = [];

    Object.keys(tokens['size-scale']).forEach(key => {
      response.push({
        value: tokens['size-scale'][key],
        key
      });
    });

    return response;
  }
};
