@digdir/designsystemet 1.0.0-next.37 → 1.0.0-next.38

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.
@@ -1,11 +1,11 @@
1
1
  import { type ThemeObject } from '@tokens-studio/types';
2
2
  import type { ColorMode } from '../../colors/types.js';
3
3
  import type { Colors } from '../types.js';
4
- type ColorModes = Array<ColorMode>;
4
+ type ColorSchemes = Array<ColorMode>;
5
5
  type ThemeObject_ = ThemeObject & {
6
6
  $figmaCollectionId?: string;
7
7
  $figmaModeId?: string;
8
8
  };
9
- export declare function generateThemesJson(modes: ColorModes, themes: string[], colors: Colors): ThemeObject_[];
9
+ export declare function generateThemesJson(colorSchemes: ColorSchemes, themes: string[], colors: Colors): ThemeObject_[];
10
10
  export {};
11
11
  //# sourceMappingURL=generate$themes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"generate$themes.d.ts","sourceRoot":"","sources":["../../../../src/tokens/write/generate$themes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,WAAW,EAAkB,MAAM,sBAAsB,CAAC;AAExE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAM1C,KAAK,UAAU,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC;AAEnC,KAAK,YAAY,GAAG,WAAW,GAAG;IAChC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,GAAG,YAAY,EAAE,CAUtG"}
1
+ {"version":3,"file":"generate$themes.d.ts","sourceRoot":"","sources":["../../../../src/tokens/write/generate$themes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,WAAW,EAAkB,MAAM,sBAAsB,CAAC;AAExE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAM1C,KAAK,YAAY,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC;AAErC,KAAK,YAAY,GAAG,WAAW,GAAG;IAChC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,YAAY,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,GAAG,YAAY,EAAE,CAU/G"}
@@ -2,12 +2,12 @@ import crypto from "node:crypto";
2
2
  import { TokenSetStatus } from "@tokens-studio/types";
3
3
  const capitalize = (word) => word.charAt(0).toUpperCase() + word.slice(1);
4
4
  const createHash = (text) => crypto.hash("sha1", text);
5
- function generateThemesJson(modes, themes, colors) {
5
+ function generateThemesJson(colorSchemes, themes, colors) {
6
6
  return [
7
7
  ...generateSizeGroup(),
8
8
  ...generateThemesGroup(themes),
9
9
  ...generateTypographyGroup(themes),
10
- ...generateModesGroup(modes, themes),
10
+ ...generateColorSchemesGroup(colorSchemes, themes),
11
11
  generateSemanticGroup(),
12
12
  ...generateColorGroup("main", colors),
13
13
  ...generateColorGroup("support", colors)
@@ -49,15 +49,15 @@ const colorSchemeDefaults = {
49
49
  $figmaModeId: "34811:2"
50
50
  }
51
51
  };
52
- function generateModesGroup(modes, themes) {
53
- return modes.map(
54
- (mode) => ({
55
- ...colorSchemeDefaults[mode],
52
+ function generateColorSchemesGroup(colorSchemes, themes) {
53
+ return colorSchemes.map(
54
+ (scheme) => ({
55
+ ...colorSchemeDefaults[scheme],
56
56
  selectedTokenSets: Object.fromEntries([
57
- [`primitives/modes/color-scheme/${mode}/global`, TokenSetStatus.ENABLED],
58
- ...themes.map((theme) => [`primitives/modes/color-scheme/${mode}/${theme}`, TokenSetStatus.ENABLED])
57
+ [`primitives/modes/color-scheme/${scheme}/global`, TokenSetStatus.ENABLED],
58
+ ...themes.map((theme) => [`primitives/modes/color-scheme/${scheme}/${theme}`, TokenSetStatus.ENABLED])
59
59
  ]),
60
- group: "Mode"
60
+ group: "Color scheme"
61
61
  })
62
62
  );
63
63
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digdir/designsystemet",
3
- "version": "1.0.0-next.37",
3
+ "version": "1.0.0-next.38",
4
4
  "description": "CLI for Designsystemet",
5
5
  "author": "Designsystemet team",
6
6
  "repository": {