@digdir/designsystemet 1.1.3 → 1.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/bin/designsystemet.js +130 -186
  2. package/dist/src/index.js +88 -145
  3. package/dist/src/scripts/update-preview-tokens.d.ts +3 -0
  4. package/dist/src/scripts/update-preview-tokens.d.ts.map +1 -0
  5. package/dist/src/scripts/update-preview-tokens.js +3446 -0
  6. package/dist/src/tokens/build.d.ts +1 -1
  7. package/dist/src/tokens/build.d.ts.map +1 -1
  8. package/dist/src/tokens/build.js +98 -154
  9. package/dist/src/tokens/create/generators/$designsystemet.js +6 -6
  10. package/dist/src/tokens/create/write.js +6 -6
  11. package/dist/src/tokens/format.d.ts +1 -1
  12. package/dist/src/tokens/format.d.ts.map +1 -1
  13. package/dist/src/tokens/format.js +88 -145
  14. package/dist/src/tokens/index.js +88 -145
  15. package/dist/src/tokens/process/configs/color.js +234 -293
  16. package/dist/src/tokens/process/configs/semantic.js +509 -113
  17. package/dist/src/tokens/process/configs/typography.d.ts.map +1 -1
  18. package/dist/src/tokens/process/configs/typography.js +504 -110
  19. package/dist/src/tokens/process/configs.d.ts +0 -1
  20. package/dist/src/tokens/process/configs.d.ts.map +1 -1
  21. package/dist/src/tokens/process/configs.js +231 -290
  22. package/dist/src/tokens/process/formats/css/color.d.ts.map +1 -1
  23. package/dist/src/tokens/process/formats/css/color.js +644 -12
  24. package/dist/src/tokens/process/formats/css/semantic.d.ts.map +1 -1
  25. package/dist/src/tokens/process/formats/css/semantic.js +679 -23
  26. package/dist/src/tokens/process/formats/css/typography.d.ts.map +1 -1
  27. package/dist/src/tokens/process/formats/css/typography.js +741 -8
  28. package/dist/src/tokens/process/formats/css.js +549 -38
  29. package/dist/src/tokens/process/output/declarations.js +60 -121
  30. package/dist/src/tokens/process/output/theme.js +6 -6
  31. package/dist/src/tokens/process/platform.d.ts +9 -4
  32. package/dist/src/tokens/process/platform.d.ts.map +1 -1
  33. package/dist/src/tokens/process/platform.js +76 -133
  34. package/dist/src/tokens/process/utils/getMultidimensionalThemes.js +62 -123
  35. package/package.json +6 -6
  36. package/dist/src/tokens/process/configs/storefront.d.ts +0 -3
  37. package/dist/src/tokens/process/configs/storefront.d.ts.map +0 -1
  38. package/dist/src/tokens/process/configs/storefront.js +0 -234
  39. package/dist/src/tokens/process/formats/js-tokens.d.ts +0 -6
  40. package/dist/src/tokens/process/formats/js-tokens.d.ts.map +0 -1
  41. package/dist/src/tokens/process/formats/js-tokens.js +0 -123
@@ -2089,7 +2089,7 @@ var createTokens = async (opts) => {
2089
2089
  };
2090
2090
 
2091
2091
  // src/tokens/format.ts
2092
- import * as R20 from "ramda";
2092
+ import * as R18 from "ramda";
2093
2093
 
2094
2094
  // ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/BoxShadowTypes.js
2095
2095
  var BoxShadowTypes;
@@ -2429,11 +2429,11 @@ import * as R7 from "ramda";
2429
2429
  // package.json
2430
2430
  var package_default = {
2431
2431
  name: "@digdir/designsystemet",
2432
- version: "1.1.3",
2432
+ version: "1.1.5",
2433
2433
  description: "CLI for Designsystemet",
2434
2434
  author: "Designsystemet team",
2435
2435
  engines: {
2436
- node: ">=22.16.0"
2436
+ node: ">=22.17.0"
2437
2437
  },
2438
2438
  repository: {
2439
2439
  type: "git",
@@ -2482,6 +2482,7 @@ var package_default = {
2482
2482
  "digdir:tokens-build": "pnpm run designsystemet tokens build -t ../../internal/design-tokens -o ../../packages/theme/brand --clean --experimental-tailwind",
2483
2483
  "digdir:tokens-create": "pnpm run designsystemet tokens create --config ./configs/digdir.config.json",
2484
2484
  "update:template": "tsx ./src/scripts/update-template.ts",
2485
+ "update:preview-tokens": "tsx ./src/scripts/update-preview-tokens.ts",
2485
2486
  "update:theme-digdir": "pnpm digdir:tokens-create && tsx ./src/scripts/update-design-tokens.ts && pnpm digdir:tokens-build",
2486
2487
  verify: "pnpm test && pnpm update:template && pnpm update:theme-digdir && pnpm build:tokens"
2487
2488
  },
@@ -2499,8 +2500,8 @@ var package_default = {
2499
2500
  "object-hash": "^3.0.0",
2500
2501
  postcss: "^8.5.6",
2501
2502
  ramda: "^0.31.3",
2502
- "style-dictionary": "^5.0.0",
2503
- zod: "^3.25.67",
2503
+ "style-dictionary": "^5.0.1",
2504
+ zod: "^3.25.74",
2504
2505
  "zod-validation-error": "^3.5.2"
2505
2506
  },
2506
2507
  devDependencies: {
@@ -2508,8 +2509,7 @@ var package_default = {
2508
2509
  "@types/apca-w3": "^0.1.3",
2509
2510
  "@types/chroma-js": "^3.1.1",
2510
2511
  "@types/fs-extra": "^11.0.4",
2511
- "@types/glob": "^8.1.0",
2512
- "@types/node": "^22.15.32",
2512
+ "@types/node": "^22.16.0",
2513
2513
  "@types/object-hash": "^3.0.6",
2514
2514
  "@types/ramda": "^0.30.2",
2515
2515
  "fs-extra": "^11.3.0",
@@ -2524,7 +2524,7 @@ var package_default = {
2524
2524
  var defaultFileHeader = `build: v${package_default.version}`;
2525
2525
  var createThemeCSSFiles = ({
2526
2526
  processedBuilds,
2527
- fileHeader: fileHeader2 = defaultFileHeader
2527
+ fileHeader = defaultFileHeader
2528
2528
  }) => {
2529
2529
  const groupedByTheme = {};
2530
2530
  for (const [_, buildResults] of Object.entries(processedBuilds)) {
@@ -2571,7 +2571,7 @@ order may change due to nondeterminism.`.trim()
2571
2571
  });
2572
2572
  const header = `@charset "UTF-8";
2573
2573
  /*
2574
- ${fileHeader2}
2574
+ ${fileHeader}
2575
2575
  */
2576
2576
 
2577
2577
  `;
@@ -2593,7 +2593,7 @@ ${fileHeader2}
2593
2593
 
2594
2594
  // src/tokens/process/platform.ts
2595
2595
  import chalk3 from "chalk";
2596
- import * as R19 from "ramda";
2596
+ import * as R17 from "ramda";
2597
2597
  import StyleDictionary2 from "style-dictionary";
2598
2598
 
2599
2599
  // src/tokens/types.ts
@@ -2604,7 +2604,7 @@ var colorCategories = {
2604
2604
 
2605
2605
  // src/tokens/process/configs.ts
2606
2606
  import { register } from "@tokens-studio/sd-transforms";
2607
- import * as R18 from "ramda";
2607
+ import * as R16 from "ramda";
2608
2608
  import StyleDictionary from "style-dictionary";
2609
2609
 
2610
2610
  // src/tokens/utils.ts
@@ -2715,7 +2715,11 @@ var colorScheme = {
2715
2715
  (t) => !isColorCategoryToken(t)
2716
2716
  ])
2717
2717
  );
2718
- const formattedTokens = filteredAllTokens.map(format).join("\n");
2718
+ const formattedMap = filteredAllTokens.map((token) => ({
2719
+ token,
2720
+ formatted: format(token)
2721
+ }));
2722
+ const formattedTokens = formattedMap.map(R9.view(R9.lensProp("formatted"))).join("\n");
2719
2723
  const content = `{
2720
2724
  ${formattedTokens}
2721
2725
  ${colorSchemeProperty}}
@@ -2733,7 +2737,8 @@ var colorCategory = {
2733
2737
  name: "ds/css-colorcategory",
2734
2738
  format: async ({ dictionary, options, platform }) => {
2735
2739
  const { outputReferences, usesDtcg } = options;
2736
- const { selector, layer } = platform;
2740
+ const { selector, layer, files } = platform;
2741
+ const destination = files?.[0]?.destination;
2737
2742
  const format = R9.compose(
2738
2743
  createPropertyFormatter({
2739
2744
  outputReferences,
@@ -2750,7 +2755,12 @@ var colorCategory = {
2750
2755
  }
2751
2756
  })
2752
2757
  );
2753
- const formattedTokens = dictionary.allTokens.map(format).join("\n");
2758
+ const formattedMap = dictionary.allTokens.map((token) => ({
2759
+ token,
2760
+ formatted: format(token)
2761
+ }));
2762
+ buildOptions.buildTokenFormats[destination] = formattedMap;
2763
+ const formattedTokens = formattedMap.map(R9.view(R9.lensProp("formatted"))).join("\n");
2754
2764
  const content = `{
2755
2765
  ${formattedTokens}
2756
2766
  }
@@ -2781,30 +2791,30 @@ var overrideSizingFormula = (format, token) => {
2781
2791
  calc
2782
2792
  };
2783
2793
  };
2784
- var formatSizingTokens = (format, tokens) => {
2785
- const { round, calc } = R10.reduce(
2786
- (acc, token) => {
2787
- const { round: round2, calc: calc2, name } = overrideSizingFormula(format, token);
2788
- return {
2789
- round: [...acc.round, `${name}: ${round2};`],
2790
- calc: [...acc.calc, `${name}: ${calc2};`]
2791
- };
2792
- },
2793
- { round: [], calc: [] },
2794
- tokens
2795
- );
2796
- return `
2794
+ var formatSizingTokens = (format, tokens) => R10.reduce(
2795
+ (acc, token) => {
2796
+ const { round, calc, name } = overrideSizingFormula(format, token);
2797
+ return {
2798
+ tokens: [...acc.tokens, token],
2799
+ round: [...acc.round, `${name}: ${round};`],
2800
+ calc: [...acc.calc, `${name}: ${calc};`]
2801
+ };
2802
+ },
2803
+ { tokens: [], round: [], calc: [] },
2804
+ tokens
2805
+ );
2806
+ var sizingTemplate = ({ round, calc }) => `
2797
2807
  ${calc.join("\n")}
2798
2808
 
2799
2809
  @supports (width: round(down, .1em, 1px)) {
2800
2810
  ${round.join("\n")}
2801
2811
  }`;
2802
- };
2803
2812
  var semantic = {
2804
2813
  name: "ds/css-semantic",
2805
2814
  format: async ({ dictionary, options, platform }) => {
2806
2815
  const { outputReferences, usesDtcg } = options;
2807
- const { selector, layer } = platform;
2816
+ const { selector, layer, files } = platform;
2817
+ const destination = files?.[0]?.destination;
2808
2818
  const format = createPropertyFormatter2({
2809
2819
  outputReferences,
2810
2820
  dictionary,
@@ -2817,7 +2827,18 @@ var semantic = {
2817
2827
  (t) => pathStartsWithOneOf(["_size"], t) && isDigit(t.path[1]),
2818
2828
  filteredTokens
2819
2829
  );
2820
- const formattedTokens = [R10.map(format, restTokens).join("\n"), formatSizingTokens(format, sizingTokens)];
2830
+ const formattedSizingTokens = formatSizingTokens(format, sizingTokens);
2831
+ const formattedMap = restTokens.map((token) => ({
2832
+ token,
2833
+ formatted: format(token)
2834
+ }));
2835
+ const formattedSizingMap = formattedSizingTokens.round.map((t, i) => ({
2836
+ token: formattedSizingTokens.tokens[i],
2837
+ formatted: t
2838
+ }));
2839
+ buildOptions.buildTokenFormats[destination] = [...formattedMap, ...formattedSizingMap];
2840
+ const sizingSnippet = sizingTemplate(formattedSizingTokens);
2841
+ const formattedTokens = formattedMap.map(R10.view(R10.lensProp("formatted"))).concat(sizingSnippet);
2821
2842
  const content = `{
2822
2843
  ${formattedTokens.join("\n")}
2823
2844
  }
@@ -2842,7 +2863,8 @@ var typography = {
2842
2863
  name: "ds/css-typography",
2843
2864
  format: async ({ dictionary, options, platform }) => {
2844
2865
  const { outputReferences, usesDtcg } = options;
2845
- const { selector, layer } = platform;
2866
+ const { selector, layer, files } = platform;
2867
+ const destination = files?.[0]?.destination;
2846
2868
  const format = createPropertyFormatter3({
2847
2869
  outputReferences,
2848
2870
  dictionary,
@@ -2850,7 +2872,12 @@ var typography = {
2850
2872
  usesDtcg
2851
2873
  });
2852
2874
  const filteredTokens = R11.reject(typographyFontFamilyPredicate, dictionary.allTokens);
2853
- const formattedTokens = R11.pipe(R11.map(format), R11.join("\n"))(filteredTokens);
2875
+ const formattedMap = filteredTokens.map((token) => ({
2876
+ token,
2877
+ formatted: format(token)
2878
+ }));
2879
+ buildOptions.buildTokenFormats[destination] = formattedMap;
2880
+ const formattedTokens = formattedMap.map(R11.view(R11.lensProp("formatted"))).join("\n");
2854
2881
  const content = selector ? `${selector} {
2855
2882
  ${formattedTokens}
2856
2883
  }` : formattedTokens;
@@ -3057,90 +3084,6 @@ var semanticVariables = ({ theme }) => {
3057
3084
  };
3058
3085
  };
3059
3086
 
3060
- // src/tokens/process/configs/storefront.ts
3061
- import * as R16 from "ramda";
3062
- import { outputReferencesFilter as outputReferencesFilter2 } from "style-dictionary/utils";
3063
-
3064
- // src/tokens/process/formats/js-tokens.ts
3065
- import * as R15 from "ramda";
3066
- import { createPropertyFormatter as createPropertyFormatter4, fileHeader } from "style-dictionary/utils";
3067
- var groupByType = R15.groupBy((token) => getType(token));
3068
- var removeUnwatedTokens = R15.pipe(
3069
- R15.reject((token) => isColorCategoryToken(token)),
3070
- R15.reject((token) => R15.any((path) => path.startsWith("_"))(token.path))
3071
- );
3072
- var dissocExtensions = R15.pipe(R15.dissoc("$extensions"), R15.dissocPath(["original", "$extensions"]));
3073
- var removeUnwatedProps = R15.map((token) => dissocExtensions(token));
3074
- var toCssVarName = R15.pipe(R15.split(":"), R15.head, R15.trim);
3075
- var jsTokens = {
3076
- name: "ds/js-tokens",
3077
- format: async ({ dictionary, file, options }) => {
3078
- const { usesDtcg, outputReferences } = options;
3079
- const format = createPropertyFormatter4({
3080
- outputReferences,
3081
- dictionary,
3082
- format: "css",
3083
- usesDtcg
3084
- });
3085
- const formatTokens2 = R15.map((token) => {
3086
- if (pathStartsWithOneOf(["size", "_size"], token)) {
3087
- const { calc, name } = overrideSizingFormula(format, token);
3088
- return {
3089
- ...token,
3090
- name: name.trim(),
3091
- $value: calc.trim()
3092
- };
3093
- }
3094
- return {
3095
- ...token,
3096
- name: toCssVarName(format(token))
3097
- };
3098
- });
3099
- const processTokens = R15.pipe(removeUnwatedTokens, removeUnwatedProps, formatTokens2, groupByType);
3100
- const tokens = processTokens(inlineTokens(isInlineTokens, dictionary.allTokens));
3101
- const content = Object.entries(tokens).map(
3102
- ([name, token]) => `export const ${name} = ${JSON.stringify(token, null, 2).replace(/"([^"]+)":/g, "$1:")}
3103
- `
3104
- ).join("\n");
3105
- return fileHeader({ file }).then((fileHeaderText) => fileHeaderText + content);
3106
- }
3107
- };
3108
-
3109
- // src/tokens/process/configs/storefront.ts
3110
- var typescriptTokens = ({ "color-scheme": colorScheme2, theme }) => {
3111
- return {
3112
- preprocessors: ["tokens-studio"],
3113
- platforms: {
3114
- ts: {
3115
- prefix,
3116
- basePxFontSize,
3117
- transforms: dsTransformers,
3118
- buildPath: `${theme}/`,
3119
- files: [
3120
- {
3121
- destination: `${colorScheme2}.ts`,
3122
- format: jsTokens.name,
3123
- filter: (token) => {
3124
- if (pathStartsWithOneOf(["border-width", "letter-spacing", "border-radius"], token) && !R16.includes("semantic", token.filePath))
3125
- return false;
3126
- const isSemanticColor = R16.includes("semantic", token.filePath) && typeEquals(["color"], token);
3127
- const wantedTypes = typeEquals(["shadow", "dimension", "typography", "opacity"], token);
3128
- return isSemanticColor || wantedTypes;
3129
- }
3130
- }
3131
- ],
3132
- options: {
3133
- outputReferences: (token, options) => {
3134
- const include = pathStartsWithOneOf(["border-radius"], token);
3135
- const isWantedSize = pathStartsWithOneOf(["size", "_size"], token) && isDigit(token.path[1]);
3136
- return (include || isWantedSize) && outputReferencesFilter2(token, options);
3137
- }
3138
- }
3139
- }
3140
- }
3141
- };
3142
- };
3143
-
3144
3087
  // src/tokens/process/configs/typography.ts
3145
3088
  import { expandTypesMap } from "@tokens-studio/sd-transforms";
3146
3089
  var typographyVariables = ({ theme, typography: typography2 }) => {
@@ -3167,6 +3110,7 @@ var typographyVariables = ({ theme, typography: typography2 }) => {
3167
3110
  sizeRem.name,
3168
3111
  "ts/size/lineheight",
3169
3112
  "ts/typography/fontWeight",
3113
+ "ts/size/css/letterspacing",
3170
3114
  typographyName.name
3171
3115
  ],
3172
3116
  files: [
@@ -3191,13 +3135,13 @@ var typographyVariables = ({ theme, typography: typography2 }) => {
3191
3135
  // src/tokens/process/utils/getMultidimensionalThemes.ts
3192
3136
  import chalk2 from "chalk";
3193
3137
  import { kebabCase } from "change-case";
3194
- import * as R17 from "ramda";
3138
+ import * as R15 from "ramda";
3195
3139
  var getMultidimensionalThemes = (processed$themes, dimensions) => {
3196
3140
  const verboseLogging = buildOptions?.verbose;
3197
3141
  const grouped$themes = groupThemes(processed$themes);
3198
3142
  const permutations = permutateThemes(grouped$themes);
3199
3143
  const ALL_DEPENDENT_ON = ["theme"];
3200
- const keys2 = R17.keys(grouped$themes);
3144
+ const keys2 = R15.keys(grouped$themes);
3201
3145
  const nonDependentKeys = keys2.filter((x) => ![...ALL_DEPENDENT_ON, ...dimensions].includes(x));
3202
3146
  if (verboseLogging) {
3203
3147
  console.log(chalk2.cyan(`\u{1F50E} Finding theme permutations for ${dimensions}`));
@@ -3237,7 +3181,7 @@ function groupThemes(themes) {
3237
3181
  }
3238
3182
  return groups;
3239
3183
  }
3240
- var hasUnknownProps = R17.pipe(R17.values, R17.none(R17.equals("unknown")), R17.not);
3184
+ var hasUnknownProps = R15.pipe(R15.values, R15.none(R15.equals("unknown")), R15.not);
3241
3185
  function permutateThemes(groups) {
3242
3186
  const separator = "_";
3243
3187
  const permutations = cartesian(Object.values(groups));
@@ -3247,8 +3191,8 @@ function permutateThemes(groups) {
3247
3191
  const { group, name, selectedTokenSets } = theme;
3248
3192
  let updatedPermutation = acc.permutation;
3249
3193
  if (group) {
3250
- const groupProp = R17.lensProp(group);
3251
- updatedPermutation = R17.set(groupProp, name, updatedPermutation);
3194
+ const groupProp = R15.lensProp(group);
3195
+ updatedPermutation = R15.set(groupProp, name, updatedPermutation);
3252
3196
  }
3253
3197
  const updatedName = `${String(acc.name)}${acc ? separator : ""}${name}`;
3254
3198
  const sets = [...acc.selectedTokenSets, ...filterTokenSets(selectedTokenSets)];
@@ -3307,7 +3251,6 @@ StyleDictionary.registerTransform(sizeRem);
3307
3251
  StyleDictionary.registerTransform(typographyName);
3308
3252
  StyleDictionary.registerTransform(resolveMath);
3309
3253
  StyleDictionary.registerTransform(unitless);
3310
- StyleDictionary.registerFormat(jsTokens);
3311
3254
  for (const format of Object.values(formats)) {
3312
3255
  StyleDictionary.registerFormat(format);
3313
3256
  }
@@ -3321,8 +3264,7 @@ var configs = {
3321
3264
  warningColorVariables: colorCategoryVariables({ category: "builtin", color: "warning" }),
3322
3265
  infoColorVariables: colorCategoryVariables({ category: "builtin", color: "info" }),
3323
3266
  typographyVariables,
3324
- semanticVariables,
3325
- typescriptTokens
3267
+ semanticVariables
3326
3268
  };
3327
3269
  var getConfigsForThemeDimensions = (getConfig, processed$themes, dimensions, options) => {
3328
3270
  const { tokensDir, tokenSets } = options;
@@ -3338,7 +3280,7 @@ var getConfigsForThemeDimensions = (getConfig, processed$themes, dimensions, opt
3338
3280
  obj.filePath = tokenSet;
3339
3281
  }
3340
3282
  });
3341
- tokenSource.tokens = R18.mergeDeepRight(tokenSource.tokens, tokensWithFilePath);
3283
+ tokenSource.tokens = R16.mergeDeepRight(tokenSource.tokens, tokensWithFilePath);
3342
3284
  }
3343
3285
  }
3344
3286
  } else {
@@ -3370,6 +3312,7 @@ var getConfigsForThemeDimensions = (getConfig, processed$themes, dimensions, opt
3370
3312
  // src/tokens/process/platform.ts
3371
3313
  var initResult = {
3372
3314
  formatted: [],
3315
+ tokens: [],
3373
3316
  permutation: {
3374
3317
  "color-scheme": "",
3375
3318
  "main-color": "",
@@ -3380,7 +3323,11 @@ var initResult = {
3380
3323
  typography: ""
3381
3324
  }
3382
3325
  };
3383
- var buildOptions;
3326
+ var buildOptions = {
3327
+ verbose: false,
3328
+ processed$themes: [],
3329
+ buildTokenFormats: {}
3330
+ };
3384
3331
  var sd = new StyleDictionary2();
3385
3332
  var buildConfigs = {
3386
3333
  typography: { getConfig: configs.typographyVariables, dimensions: ["typography"] },
@@ -3413,19 +3360,15 @@ var buildConfigs = {
3413
3360
  log: ({ permutation: { theme } }) => `${theme} - info`
3414
3361
  },
3415
3362
  semantic: { getConfig: configs.semanticVariables, dimensions: ["semantic"] }
3416
- // storefront: {
3417
- // name: 'Storefront preview tokens',
3418
- // getConfig: configs.typescriptTokens,
3419
- // dimensions: ['color-scheme'],
3420
- // options: { outPath: path.resolve('../../apps/storefront/tokens') },
3421
- // enabled: () => buildOptions?.preview ?? false,
3422
- // },
3423
3363
  };
3424
3364
  async function processPlatform(options) {
3425
3365
  const { type, processed$themes } = options;
3426
3366
  const platform = "css";
3427
3367
  const tokenSets = type === "format" ? options.tokenSets : void 0;
3428
3368
  const tokensDir = type === "build" ? options.tokensDir : void 0;
3369
+ const filteredProcessed$themes = processed$themes.filter(
3370
+ (theme) => R17.not(theme.group === "size" && theme.name !== "medium")
3371
+ );
3429
3372
  const UNSAFE_DEFAULT_COLOR = process.env.UNSAFE_DEFAULT_COLOR ?? "";
3430
3373
  if (UNSAFE_DEFAULT_COLOR) {
3431
3374
  console.warn(
@@ -3448,19 +3391,16 @@ async function processPlatform(options) {
3448
3391
  buildOptions = options;
3449
3392
  buildOptions.defaultColor = UNSAFE_DEFAULT_COLOR;
3450
3393
  buildOptions.colorGroups = colorGroups;
3451
- const filteredProcessed$themes = processed$themes.filter(
3452
- (theme) => R19.not(theme.group === "size" && theme.name !== "medium")
3453
- );
3454
- const customColors = getCustomColors(filteredProcessed$themes, colorGroups);
3455
3394
  if (!buildOptions.defaultColor) {
3456
- const firstMainColor = R19.head(customColors);
3395
+ const customColors = getCustomColors(filteredProcessed$themes, colorGroups);
3396
+ const firstMainColor = R17.head(customColors);
3457
3397
  buildOptions.defaultColor = firstMainColor;
3458
3398
  }
3459
3399
  if (buildOptions.defaultColor) {
3460
3400
  console.log(`
3461
3401
  \u{1F3A8} Using ${chalk3.blue(buildOptions.defaultColor)} as default color`);
3462
3402
  }
3463
- const buildAndSdConfigs = R19.map((buildConfig) => {
3403
+ const buildAndSdConfigs = R17.map((buildConfig) => {
3464
3404
  const sdConfigs = getConfigsForThemeDimensions(
3465
3405
  buildConfig.getConfig,
3466
3406
  filteredProcessed$themes,
@@ -3496,7 +3436,7 @@ async function processPlatform(options) {
3496
3436
  typography: [initResult]
3497
3437
  };
3498
3438
  try {
3499
- for (const [buildName, { buildConfig, sdConfigs }] of R19.toPairs(buildAndSdConfigs)) {
3439
+ for (const [buildName, { buildConfig, sdConfigs }] of R17.toPairs(buildAndSdConfigs)) {
3500
3440
  if (!(buildConfig.enabled?.() ?? true)) {
3501
3441
  continue;
3502
3442
  }
@@ -3508,13 +3448,16 @@ async function processPlatform(options) {
3508
3448
  const { config, permutation } = sdConfig;
3509
3449
  const modes = ["theme", ...buildConfig.dimensions];
3510
3450
  const modeMessage = modes.map((x) => permutation[x]).join(" - ");
3511
- const logMessage = R19.isNil(buildConfig.log) ? modeMessage : buildConfig?.log(sdConfig);
3451
+ const logMessage = R17.isNil(buildConfig.log) ? modeMessage : buildConfig?.log(sdConfig);
3512
3452
  console.log(logMessage);
3513
3453
  const sdOptions = { cache: true };
3514
3454
  const sdExtended = await sd.extend(config);
3455
+ const formatted = await sdExtended.formatPlatform(platform, sdOptions);
3456
+ const tokens = (await sdExtended.getPlatformTokens(platform, sdOptions)).allTokens;
3515
3457
  const result = {
3516
3458
  permutation,
3517
- formatted: await sdExtended.formatPlatform(platform, sdOptions)
3459
+ formatted,
3460
+ tokens
3518
3461
  };
3519
3462
  return Promise.resolve(result);
3520
3463
  })
@@ -3535,6 +3478,7 @@ async function processPlatform(options) {
3535
3478
  var formatTokens = async (options) => {
3536
3479
  const processedBuilds = await processPlatform({
3537
3480
  type: "format",
3481
+ buildTokenFormats: {},
3538
3482
  ...options
3539
3483
  });
3540
3484
  return processedBuilds;
@@ -3546,15 +3490,14 @@ var formatTheme = async (themeConfig) => {
3546
3490
  const processedBuilds = await formatTokens({
3547
3491
  tokenSets,
3548
3492
  processed$themes,
3549
- verbose: false,
3550
- preview: false
3493
+ verbose: false
3551
3494
  });
3552
3495
  return processedBuilds;
3553
3496
  };
3554
3497
  var formatThemeCSS = async (themeConfig) => {
3555
3498
  const processedBuilds = await formatTheme(themeConfig);
3556
3499
  const themeCSSFiles = createThemeCSSFiles({ processedBuilds });
3557
- return R20.head(themeCSSFiles)?.output ?? "";
3500
+ return R18.head(themeCSSFiles)?.output ?? "";
3558
3501
  };
3559
3502
  export {
3560
3503
  cliOptions,