@digdir/designsystemet 1.0.5 → 1.0.7

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 (49) hide show
  1. package/LICENSE +7 -0
  2. package/configs/digdir.config.json +59 -0
  3. package/configs/test-tokens.config.json +45 -0
  4. package/dist/bin/designsystemet.js +82 -88
  5. package/dist/config.schema.json +38 -27
  6. package/dist/src/colors/index.js +32 -0
  7. package/dist/src/colors/theme.js +1 -0
  8. package/dist/src/colors/utils.d.ts +13 -0
  9. package/dist/src/colors/utils.d.ts.map +1 -1
  10. package/dist/src/colors/utils.js +32 -0
  11. package/dist/src/config.d.ts +24 -176
  12. package/dist/src/config.d.ts.map +1 -1
  13. package/dist/src/config.js +23 -32
  14. package/dist/src/index.js +85 -50
  15. package/dist/src/migrations/beta-to-v1.js +2 -2
  16. package/dist/src/migrations/codemods/css/run.js +2 -2
  17. package/dist/src/migrations/color-rename-next49.js +2 -2
  18. package/dist/src/migrations/index.js +2 -2
  19. package/dist/src/scripts/createJsonSchema.js +33 -1292
  20. package/dist/src/scripts/update-design-tokens.js +4 -4
  21. package/dist/src/scripts/update-template.js +7 -7
  22. package/dist/src/tokens/build.js +56 -53
  23. package/dist/src/tokens/create/generators/$designsystemet.js +27 -25
  24. package/dist/src/tokens/create/generators/$themes.js +10 -10
  25. package/dist/src/tokens/create/generators/color.js +1 -0
  26. package/dist/src/tokens/create/write.js +39 -37
  27. package/dist/src/tokens/create.js +1 -0
  28. package/dist/src/tokens/format.js +54 -50
  29. package/dist/src/tokens/index.js +54 -50
  30. package/dist/src/tokens/process/configs/color.js +26 -22
  31. package/dist/src/tokens/process/configs/semantic.js +16 -12
  32. package/dist/src/tokens/process/configs/shared.js +16 -12
  33. package/dist/src/tokens/process/configs/storefront.js +16 -12
  34. package/dist/src/tokens/process/configs/typography.js +16 -12
  35. package/dist/src/tokens/process/configs.js +26 -22
  36. package/dist/src/tokens/process/formats/css/color.js +16 -12
  37. package/dist/src/tokens/process/formats/css/semantic.js +16 -12
  38. package/dist/src/tokens/process/formats/css.js +16 -12
  39. package/dist/src/tokens/process/formats/js-tokens.js +16 -12
  40. package/dist/src/tokens/process/platform.js +26 -22
  41. package/dist/src/tokens/process/theme.d.ts.map +1 -1
  42. package/dist/src/tokens/process/theme.js +27 -28
  43. package/dist/src/tokens/process/transformers.js +16 -12
  44. package/dist/src/tokens/process/utils/getMultidimensionalThemes.js +26 -22
  45. package/dist/src/tokens/utils.d.ts +2 -2
  46. package/dist/src/tokens/utils.d.ts.map +1 -1
  47. package/dist/src/tokens/utils.js +16 -12
  48. package/dist/src/utils.js +1 -1
  49. package/package.json +35 -33
@@ -1,8 +1,8 @@
1
1
  // src/scripts/update-design-tokens.ts
2
- import path from "node:path";
2
+ import path from "path";
3
3
 
4
4
  // src/utils.ts
5
- import fs from "node:fs/promises";
5
+ import fs from "fs/promises";
6
6
  import chalk from "chalk";
7
7
  var cp = async (src, dest, dry, filter) => {
8
8
  if (dry) {
@@ -14,8 +14,8 @@ var cp = async (src, dest, dry, filter) => {
14
14
 
15
15
  // src/scripts/update-design-tokens.ts
16
16
  var DIRNAME = import.meta.dirname || __dirname;
17
- var TARGET = path.join(DIRNAME, "../../../../design-tokens");
18
- var INTERNAL = path.join(DIRNAME, "../../internal/design-tokens");
17
+ var TARGET = path.join(DIRNAME, "../../../../internal/design-tokens");
18
+ var INTERNAL = path.join(DIRNAME, "../../temp/digdir/design-tokens");
19
19
  async function updateDesignTokens() {
20
20
  console.log("\n\u{1F4C1} Copying design tokens");
21
21
  await cp(path.join(INTERNAL, "primitives/modes/color-scheme"), path.join(TARGET, "primitives/modes/color-scheme"));
@@ -1,9 +1,9 @@
1
1
  // src/scripts/update-template.ts
2
- import path from "node:path";
2
+ import path from "path";
3
3
  import chalk2 from "chalk";
4
4
  import * as R from "ramda";
5
5
 
6
- // ../../design-tokens/semantic/color.json
6
+ // ../../internal/design-tokens/semantic/color.json
7
7
  var color_default = {
8
8
  color: {
9
9
  accent: {
@@ -621,7 +621,7 @@ var color_default = {
621
621
  }
622
622
  };
623
623
 
624
- // ../../design-tokens/semantic/modes/main-color/accent.json
624
+ // ../../internal/design-tokens/semantic/modes/main-color/accent.json
625
625
  var accent_default = {
626
626
  color: {
627
627
  main: {
@@ -693,7 +693,7 @@ var accent_default = {
693
693
  }
694
694
  };
695
695
 
696
- // ../../design-tokens/themes/digdir.json
696
+ // ../../internal/design-tokens/themes/digdir.json
697
697
  var digdir_default = {
698
698
  color: {
699
699
  accent: {
@@ -1082,7 +1082,7 @@ var digdir_default = {
1082
1082
  };
1083
1083
 
1084
1084
  // src/utils.ts
1085
- import fs from "node:fs/promises";
1085
+ import fs from "fs/promises";
1086
1086
  import chalk from "chalk";
1087
1087
  var mkdir = async (dir, dry) => {
1088
1088
  if (dry) {
@@ -1132,9 +1132,9 @@ var readFile = async (path2, dry) => {
1132
1132
 
1133
1133
  // src/scripts/update-template.ts
1134
1134
  var DIRNAME = import.meta.dirname || __dirname;
1135
- var SOURCE_FILES_PATH = path.join(DIRNAME, "../../../../design-tokens");
1135
+ var SOURCE_FILES_PATH = path.join(DIRNAME, "../../../../internal/design-tokens");
1136
1136
  var TEMPLATE_FILES_PATH = path.join(DIRNAME, "../tokens/template/design-tokens");
1137
- var designTokensPath = (_path) => path.join(DIRNAME, "../../../../design-tokens", _path);
1137
+ var designTokensPath = (_path) => path.join(SOURCE_FILES_PATH, _path);
1138
1138
  var argsFromToPaths = (path_) => [
1139
1139
  path.join(SOURCE_FILES_PATH, path_),
1140
1140
  path.join(TEMPLATE_FILES_PATH, path_)
@@ -1,10 +1,10 @@
1
1
  // src/tokens/build.ts
2
- import path from "node:path";
2
+ import path from "path";
3
3
  import chalk5 from "chalk";
4
4
  import * as R14 from "ramda";
5
5
 
6
6
  // src/utils.ts
7
- import fs from "node:fs/promises";
7
+ import fs from "fs/promises";
8
8
  import chalk from "chalk";
9
9
  var mkdir = async (dir, dry) => {
10
10
  if (dry) {
@@ -52,11 +52,11 @@ import chalk2 from "chalk";
52
52
  // package.json
53
53
  var package_default = {
54
54
  name: "@digdir/designsystemet",
55
- version: "1.0.5",
55
+ version: "1.0.7",
56
56
  description: "CLI for Designsystemet",
57
57
  author: "Designsystemet team",
58
58
  engines: {
59
- node: ">=22.14.0"
59
+ node: ">=22.16.0"
60
60
  },
61
61
  repository: {
62
62
  type: "git",
@@ -67,7 +67,8 @@ var package_default = {
67
67
  type: "module",
68
68
  main: "./dist/src/index.js",
69
69
  files: [
70
- "./dist/**"
70
+ "./dist/**",
71
+ "./configs/**"
71
72
  ],
72
73
  bin: "dist/bin/designsystemet.js",
73
74
  exports: {
@@ -86,57 +87,58 @@ var package_default = {
86
87
  },
87
88
  scripts: {
88
89
  designsystemet: "tsx ./bin/designsystemet.ts",
89
- "build:tokens": "yarn designsystemet tokens build -p -t ../../design-tokens -o ../../packages/theme/brand --clean",
90
- "build:tokens:debug": "tsx --inspect-brk ./bin/designsystemet.ts tokens build -p -t ../../design-tokens -o ../../packages/theme/brand --clean",
91
- build: "tsup && yarn build:types && yarn build:json-schema",
90
+ "build:tokens": "pnpm run designsystemet tokens build -p -t ../../internal/design-tokens -o ../../packages/theme/brand --clean",
91
+ "build:tokens:debug": "tsx --inspect-brk ./bin/designsystemet.ts tokens build -p -t ../../internal/design-tokens -o ../../packages/theme/brand --clean",
92
+ build: "tsup && pnpm build:types && pnpm build:json-schema",
92
93
  "build:types": "tsc --emitDeclarationOnly --declaration",
93
94
  "build:json-schema": "tsx ./src/scripts/createJsonSchema.ts",
94
95
  types: "tsc --noEmit",
95
- "test:tokens-create-options": "yarn designsystemet tokens create -m dominant:#007682 -n #003333 -b 99 -o ./test-tokens/options --theme options --clean",
96
- "test:tokens-create-config": "yarn designsystemet tokens create --config ./test/test-tokens.config.json",
97
- "test:tokens-build": "yarn designsystemet tokens build -t ./test-tokens/options -o ./test-tokens/options-build --clean",
98
- "test:tokens-build-config": "yarn designsystemet tokens build -t ./test-tokens/config -o ./test-tokens/config-build --clean",
99
- "test:tokens-create-and-build-options": "yarn test:tokens-create-options && yarn test:tokens-build",
100
- "test:tokens-create-and-build-config": "yarn test:tokens-create-config && yarn test:tokens-build-config",
101
- test: "yarn test:tokens-create-and-build-options && yarn test:tokens-create-and-build-config",
102
- "internal:tokens-create": "yarn designsystemet tokens create --config ./internal.config.json",
96
+ "test:tokens-create-options": 'pnpm run designsystemet tokens create -m dominant:"#007682" -n "#003333" -b 99 -o ./temp/options/design-tokens --theme options --clean',
97
+ "test:tokens-create-config": "pnpm run designsystemet tokens create --config ./configs/test-tokens.config.json",
98
+ "test:tokens-build": "pnpm run designsystemet tokens build -t ./temp/options/design-tokens -o ./temp/options/build --clean",
99
+ "test:tokens-build-config": "pnpm run designsystemet tokens build -t ./temp/config/design-tokens -o ./temp/config/build --clean",
100
+ "test:tokens-create-and-build-options": "pnpm test:tokens-create-options && pnpm test:tokens-build",
101
+ "test:tokens-create-and-build-config": "pnpm test:tokens-create-config && pnpm test:tokens-build-config",
102
+ test: "pnpm test:tokens-create-and-build-options && pnpm test:tokens-create-and-build-config",
103
+ "digdir:tokens-create": "pnpm run designsystemet tokens create --config ./configs/digdir.config.json",
103
104
  "update:template": "tsx ./src/scripts/update-template.ts",
104
- "update:design-tokens": "yarn internal:tokens-create && tsx ./src/scripts/update-design-tokens.ts",
105
- verify: "yarn test && yarn update:template && yarn update:design-tokens"
105
+ "update:design-tokens": "pnpm digdir:tokens-create && tsx ./src/scripts/update-design-tokens.ts",
106
+ verify: "pnpm test && pnpm update:template && pnpm update:design-tokens"
106
107
  },
107
108
  dependencies: {
108
109
  "@commander-js/extra-typings": "^13.1.0",
109
- "@tokens-studio/sd-transforms": "1.2.12",
110
+ "@tokens-studio/sd-transforms": "1.3.0",
110
111
  "apca-w3": "^0.1.9",
111
112
  chalk: "^5.4.1",
112
113
  "change-case": "^5.4.4",
113
114
  "chroma-js": "^3.1.2",
115
+ "colorjs.io": "^0.6.0-alpha.1",
114
116
  commander: "^13.1.0",
115
117
  "fast-glob": "^3.3.3",
116
118
  hsluv: "^1.0.1",
117
119
  "object-hash": "^3.0.0",
118
120
  postcss: "^8.5.3",
119
121
  ramda: "^0.30.1",
120
- "style-dictionary": "^4.3.3",
121
- zod: "^3.24.2",
122
- "zod-validation-error": "^3.4.0"
122
+ "style-dictionary": "^4.4.0",
123
+ zod: "^3.25.30",
124
+ "zod-validation-error": "^3.4.1"
123
125
  },
124
126
  devDependencies: {
127
+ "@tokens-studio/types": "0.5.2",
125
128
  "@types/apca-w3": "^0.1.3",
126
129
  "@types/chroma-js": "^3.1.1",
127
130
  "@types/fs-extra": "^11.0.4",
128
131
  "@types/glob": "^8.1.0",
129
132
  "@types/jscodeshift": "^0.12.0",
130
- "@types/node": "^22.14.0",
133
+ "@types/node": "^22.15.21",
131
134
  "@types/object-hash": "^3.0.6",
132
135
  "@types/ramda": "^0.30.2",
133
136
  "fs-extra": "^11.3.0",
134
137
  "ts-toolbelt": "^9.6.0",
135
138
  tslib: "^2.8.1",
136
- tsup: "^8.4.0",
137
- tsx: "^4.19.3",
138
- typescript: "^5.8.2",
139
- "zod-to-json-schema": "^3.24.5"
139
+ tsup: "^8.5.0",
140
+ tsx: "^4.19.4",
141
+ typescript: "^5.8.3"
140
142
  }
141
143
  };
142
144
 
@@ -190,9 +192,6 @@ order may change due to nondeterminism.`.trim()
190
192
  return sortIndex;
191
193
  });
192
194
  const header = `@charset "UTF-8";
193
-
194
- @layer ds.theme, ds.base, ds.utilities, ds.components;
195
-
196
195
  /*
197
196
  ${fileHeader2}
198
197
  */
@@ -236,20 +235,24 @@ var mapToLowerCase = R2.map(R2.toLower);
236
235
  var hasAnyTruth = R2.any(R2.equals(true));
237
236
  var getType = (token) => (token.$type ?? token.type) || "";
238
237
  var getValue = (token) => token.$value ?? token.value;
239
- var typeEquals = R2.curry((types, token) => {
240
- if (R2.isNil(token)) {
241
- return false;
238
+ var typeEquals = R2.curry(
239
+ (types, token) => {
240
+ if (R2.isNil(token)) {
241
+ return false;
242
+ }
243
+ return R2.includes(R2.toLower(getType(token)), R2.map(R2.toLower, Array.isArray(types) ? types : [types]));
242
244
  }
243
- return R2.includes(R2.toLower(getType(token)), R2.map(R2.toLower, Array.isArray(types) ? types : [types]));
244
- });
245
- var pathStartsWithOneOf = R2.curry((paths, token) => {
246
- if (R2.isNil(token)) {
247
- return false;
245
+ );
246
+ var pathStartsWithOneOf = R2.curry(
247
+ (paths, token) => {
248
+ if (R2.isNil(token)) {
249
+ return false;
250
+ }
251
+ const tokenPath = mapToLowerCase(token.path);
252
+ const matchPathsStartingWith = R2.map((path2) => R2.startsWith([path2], tokenPath), mapToLowerCase(paths));
253
+ return hasAnyTruth(matchPathsStartingWith);
248
254
  }
249
- const tokenPath = mapToLowerCase(token.path);
250
- const matchPathsStartingWith = R2.map((path2) => R2.startsWith([path2], tokenPath), mapToLowerCase(paths));
251
- return hasAnyTruth(matchPathsStartingWith);
252
- });
255
+ );
253
256
  function isSemanticToken(token) {
254
257
  return token.filePath.includes("semantic/");
255
258
  }
@@ -805,14 +808,14 @@ var typographyVariables = ({ theme, typography: typography2 }) => {
805
808
  };
806
809
  };
807
810
 
808
- // ../../node_modules/@tokens-studio/types/dist/constants/BoxShadowTypes.js
811
+ // ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/BoxShadowTypes.js
809
812
  var BoxShadowTypes;
810
813
  (function(BoxShadowTypes2) {
811
814
  BoxShadowTypes2["DROP_SHADOW"] = "dropShadow";
812
815
  BoxShadowTypes2["INNER_SHADOW"] = "innerShadow";
813
816
  })(BoxShadowTypes || (BoxShadowTypes = {}));
814
817
 
815
- // ../../node_modules/@tokens-studio/types/dist/constants/ColorModifierTypes.js
818
+ // ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/ColorModifierTypes.js
816
819
  var ColorModifierTypes;
817
820
  (function(ColorModifierTypes2) {
818
821
  ColorModifierTypes2["LIGHTEN"] = "lighten";
@@ -821,7 +824,7 @@ var ColorModifierTypes;
821
824
  ColorModifierTypes2["ALPHA"] = "alpha";
822
825
  })(ColorModifierTypes || (ColorModifierTypes = {}));
823
826
 
824
- // ../../node_modules/@tokens-studio/types/dist/constants/ColorSpaceTypes.js
827
+ // ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/ColorSpaceTypes.js
825
828
  var ColorSpaceTypes;
826
829
  (function(ColorSpaceTypes2) {
827
830
  ColorSpaceTypes2["LCH"] = "lch";
@@ -830,7 +833,7 @@ var ColorSpaceTypes;
830
833
  ColorSpaceTypes2["HSL"] = "hsl";
831
834
  })(ColorSpaceTypes || (ColorSpaceTypes = {}));
832
835
 
833
- // ../../node_modules/@tokens-studio/types/dist/constants/Properties.js
836
+ // ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/Properties.js
834
837
  var Properties;
835
838
  (function(Properties2) {
836
839
  Properties2["sizing"] = "sizing";
@@ -882,7 +885,7 @@ var Properties;
882
885
  Properties2["description"] = "description";
883
886
  })(Properties || (Properties = {}));
884
887
 
885
- // ../../node_modules/@tokens-studio/types/dist/constants/TokenSetStatus.js
888
+ // ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/TokenSetStatus.js
886
889
  var TokenSetStatus;
887
890
  (function(TokenSetStatus2) {
888
891
  TokenSetStatus2["DISABLED"] = "disabled";
@@ -890,7 +893,7 @@ var TokenSetStatus;
890
893
  TokenSetStatus2["ENABLED"] = "enabled";
891
894
  })(TokenSetStatus || (TokenSetStatus = {}));
892
895
 
893
- // ../../node_modules/@tokens-studio/types/dist/constants/TokenTypes.js
896
+ // ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/TokenTypes.js
894
897
  var TokenTypes;
895
898
  (function(TokenTypes2) {
896
899
  TokenTypes2["OTHER"] = "other";
@@ -921,7 +924,7 @@ var TokenTypes;
921
924
  TokenTypes2["NUMBER"] = "number";
922
925
  })(TokenTypes || (TokenTypes = {}));
923
926
 
924
- // ../../node_modules/@tokens-studio/types/dist/constants/BorderValues.js
927
+ // ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/BorderValues.js
925
928
  var BorderValues;
926
929
  (function(BorderValues2) {
927
930
  BorderValues2["BORDER_COLOR"] = "color";
@@ -929,7 +932,7 @@ var BorderValues;
929
932
  BorderValues2["BORDER_STYLE"] = "style";
930
933
  })(BorderValues || (BorderValues = {}));
931
934
 
932
- // ../../node_modules/@tokens-studio/types/dist/constants/StrokeStyleValues.js
935
+ // ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/StrokeStyleValues.js
933
936
  var StrokeStyleValues;
934
937
  (function(StrokeStyleValues2) {
935
938
  StrokeStyleValues2["SOLID"] = "solid";
@@ -942,7 +945,7 @@ var StrokeStyleValues;
942
945
  StrokeStyleValues2["INSET"] = "inset";
943
946
  })(StrokeStyleValues || (StrokeStyleValues = {}));
944
947
 
945
- // ../../node_modules/@tokens-studio/types/dist/constants/BoxShadowValues.js
948
+ // ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/BoxShadowValues.js
946
949
  var BoxShadowValues;
947
950
  (function(BoxShadowValues2) {
948
951
  BoxShadowValues2["TYPE"] = "type";
@@ -954,7 +957,7 @@ var BoxShadowValues;
954
957
  BoxShadowValues2["BLEND_MODE"] = "blendMode";
955
958
  })(BoxShadowValues || (BoxShadowValues = {}));
956
959
 
957
- // ../../node_modules/@tokens-studio/types/dist/constants/TypographyValues.js
960
+ // ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/TypographyValues.js
958
961
  var TypographyValues;
959
962
  (function(TypographyValues2) {
960
963
  TypographyValues2["FONT_FAMILY"] = "fontFamily";
@@ -1343,7 +1346,7 @@ var buildTokens = async (options) => {
1343
1346
  const fileHeader2 = R14.join("")([
1344
1347
  defaultFileHeader,
1345
1348
  $designsystemet ? `
1346
- design-tokens: v${$designsystemet.version} ` : ""
1349
+ design-tokens: v${$designsystemet.version}` : ""
1347
1350
  ]);
1348
1351
  await write(createThemeCSSFiles({ processedBuilds, fileHeader: fileHeader2 }), outDir, options.dry);
1349
1352
  console.log(`
@@ -1,11 +1,11 @@
1
1
  // package.json
2
2
  var package_default = {
3
3
  name: "@digdir/designsystemet",
4
- version: "1.0.5",
4
+ version: "1.0.7",
5
5
  description: "CLI for Designsystemet",
6
6
  author: "Designsystemet team",
7
7
  engines: {
8
- node: ">=22.14.0"
8
+ node: ">=22.16.0"
9
9
  },
10
10
  repository: {
11
11
  type: "git",
@@ -16,7 +16,8 @@ var package_default = {
16
16
  type: "module",
17
17
  main: "./dist/src/index.js",
18
18
  files: [
19
- "./dist/**"
19
+ "./dist/**",
20
+ "./configs/**"
20
21
  ],
21
22
  bin: "dist/bin/designsystemet.js",
22
23
  exports: {
@@ -35,57 +36,58 @@ var package_default = {
35
36
  },
36
37
  scripts: {
37
38
  designsystemet: "tsx ./bin/designsystemet.ts",
38
- "build:tokens": "yarn designsystemet tokens build -p -t ../../design-tokens -o ../../packages/theme/brand --clean",
39
- "build:tokens:debug": "tsx --inspect-brk ./bin/designsystemet.ts tokens build -p -t ../../design-tokens -o ../../packages/theme/brand --clean",
40
- build: "tsup && yarn build:types && yarn build:json-schema",
39
+ "build:tokens": "pnpm run designsystemet tokens build -p -t ../../internal/design-tokens -o ../../packages/theme/brand --clean",
40
+ "build:tokens:debug": "tsx --inspect-brk ./bin/designsystemet.ts tokens build -p -t ../../internal/design-tokens -o ../../packages/theme/brand --clean",
41
+ build: "tsup && pnpm build:types && pnpm build:json-schema",
41
42
  "build:types": "tsc --emitDeclarationOnly --declaration",
42
43
  "build:json-schema": "tsx ./src/scripts/createJsonSchema.ts",
43
44
  types: "tsc --noEmit",
44
- "test:tokens-create-options": "yarn designsystemet tokens create -m dominant:#007682 -n #003333 -b 99 -o ./test-tokens/options --theme options --clean",
45
- "test:tokens-create-config": "yarn designsystemet tokens create --config ./test/test-tokens.config.json",
46
- "test:tokens-build": "yarn designsystemet tokens build -t ./test-tokens/options -o ./test-tokens/options-build --clean",
47
- "test:tokens-build-config": "yarn designsystemet tokens build -t ./test-tokens/config -o ./test-tokens/config-build --clean",
48
- "test:tokens-create-and-build-options": "yarn test:tokens-create-options && yarn test:tokens-build",
49
- "test:tokens-create-and-build-config": "yarn test:tokens-create-config && yarn test:tokens-build-config",
50
- test: "yarn test:tokens-create-and-build-options && yarn test:tokens-create-and-build-config",
51
- "internal:tokens-create": "yarn designsystemet tokens create --config ./internal.config.json",
45
+ "test:tokens-create-options": 'pnpm run designsystemet tokens create -m dominant:"#007682" -n "#003333" -b 99 -o ./temp/options/design-tokens --theme options --clean',
46
+ "test:tokens-create-config": "pnpm run designsystemet tokens create --config ./configs/test-tokens.config.json",
47
+ "test:tokens-build": "pnpm run designsystemet tokens build -t ./temp/options/design-tokens -o ./temp/options/build --clean",
48
+ "test:tokens-build-config": "pnpm run designsystemet tokens build -t ./temp/config/design-tokens -o ./temp/config/build --clean",
49
+ "test:tokens-create-and-build-options": "pnpm test:tokens-create-options && pnpm test:tokens-build",
50
+ "test:tokens-create-and-build-config": "pnpm test:tokens-create-config && pnpm test:tokens-build-config",
51
+ test: "pnpm test:tokens-create-and-build-options && pnpm test:tokens-create-and-build-config",
52
+ "digdir:tokens-create": "pnpm run designsystemet tokens create --config ./configs/digdir.config.json",
52
53
  "update:template": "tsx ./src/scripts/update-template.ts",
53
- "update:design-tokens": "yarn internal:tokens-create && tsx ./src/scripts/update-design-tokens.ts",
54
- verify: "yarn test && yarn update:template && yarn update:design-tokens"
54
+ "update:design-tokens": "pnpm digdir:tokens-create && tsx ./src/scripts/update-design-tokens.ts",
55
+ verify: "pnpm test && pnpm update:template && pnpm update:design-tokens"
55
56
  },
56
57
  dependencies: {
57
58
  "@commander-js/extra-typings": "^13.1.0",
58
- "@tokens-studio/sd-transforms": "1.2.12",
59
+ "@tokens-studio/sd-transforms": "1.3.0",
59
60
  "apca-w3": "^0.1.9",
60
61
  chalk: "^5.4.1",
61
62
  "change-case": "^5.4.4",
62
63
  "chroma-js": "^3.1.2",
64
+ "colorjs.io": "^0.6.0-alpha.1",
63
65
  commander: "^13.1.0",
64
66
  "fast-glob": "^3.3.3",
65
67
  hsluv: "^1.0.1",
66
68
  "object-hash": "^3.0.0",
67
69
  postcss: "^8.5.3",
68
70
  ramda: "^0.30.1",
69
- "style-dictionary": "^4.3.3",
70
- zod: "^3.24.2",
71
- "zod-validation-error": "^3.4.0"
71
+ "style-dictionary": "^4.4.0",
72
+ zod: "^3.25.30",
73
+ "zod-validation-error": "^3.4.1"
72
74
  },
73
75
  devDependencies: {
76
+ "@tokens-studio/types": "0.5.2",
74
77
  "@types/apca-w3": "^0.1.3",
75
78
  "@types/chroma-js": "^3.1.1",
76
79
  "@types/fs-extra": "^11.0.4",
77
80
  "@types/glob": "^8.1.0",
78
81
  "@types/jscodeshift": "^0.12.0",
79
- "@types/node": "^22.14.0",
82
+ "@types/node": "^22.15.21",
80
83
  "@types/object-hash": "^3.0.6",
81
84
  "@types/ramda": "^0.30.2",
82
85
  "fs-extra": "^11.3.0",
83
86
  "ts-toolbelt": "^9.6.0",
84
87
  tslib: "^2.8.1",
85
- tsup: "^8.4.0",
86
- tsx: "^4.19.3",
87
- typescript: "^5.8.2",
88
- "zod-to-json-schema": "^3.24.5"
88
+ tsup: "^8.5.0",
89
+ tsx: "^4.19.4",
90
+ typescript: "^5.8.3"
89
91
  }
90
92
  };
91
93
 
@@ -1,11 +1,11 @@
1
- // ../../node_modules/@tokens-studio/types/dist/constants/BoxShadowTypes.js
1
+ // ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/BoxShadowTypes.js
2
2
  var BoxShadowTypes;
3
3
  (function(BoxShadowTypes2) {
4
4
  BoxShadowTypes2["DROP_SHADOW"] = "dropShadow";
5
5
  BoxShadowTypes2["INNER_SHADOW"] = "innerShadow";
6
6
  })(BoxShadowTypes || (BoxShadowTypes = {}));
7
7
 
8
- // ../../node_modules/@tokens-studio/types/dist/constants/ColorModifierTypes.js
8
+ // ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/ColorModifierTypes.js
9
9
  var ColorModifierTypes;
10
10
  (function(ColorModifierTypes2) {
11
11
  ColorModifierTypes2["LIGHTEN"] = "lighten";
@@ -14,7 +14,7 @@ var ColorModifierTypes;
14
14
  ColorModifierTypes2["ALPHA"] = "alpha";
15
15
  })(ColorModifierTypes || (ColorModifierTypes = {}));
16
16
 
17
- // ../../node_modules/@tokens-studio/types/dist/constants/ColorSpaceTypes.js
17
+ // ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/ColorSpaceTypes.js
18
18
  var ColorSpaceTypes;
19
19
  (function(ColorSpaceTypes2) {
20
20
  ColorSpaceTypes2["LCH"] = "lch";
@@ -23,7 +23,7 @@ var ColorSpaceTypes;
23
23
  ColorSpaceTypes2["HSL"] = "hsl";
24
24
  })(ColorSpaceTypes || (ColorSpaceTypes = {}));
25
25
 
26
- // ../../node_modules/@tokens-studio/types/dist/constants/Properties.js
26
+ // ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/Properties.js
27
27
  var Properties;
28
28
  (function(Properties2) {
29
29
  Properties2["sizing"] = "sizing";
@@ -75,7 +75,7 @@ var Properties;
75
75
  Properties2["description"] = "description";
76
76
  })(Properties || (Properties = {}));
77
77
 
78
- // ../../node_modules/@tokens-studio/types/dist/constants/TokenSetStatus.js
78
+ // ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/TokenSetStatus.js
79
79
  var TokenSetStatus;
80
80
  (function(TokenSetStatus2) {
81
81
  TokenSetStatus2["DISABLED"] = "disabled";
@@ -83,7 +83,7 @@ var TokenSetStatus;
83
83
  TokenSetStatus2["ENABLED"] = "enabled";
84
84
  })(TokenSetStatus || (TokenSetStatus = {}));
85
85
 
86
- // ../../node_modules/@tokens-studio/types/dist/constants/TokenTypes.js
86
+ // ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/TokenTypes.js
87
87
  var TokenTypes;
88
88
  (function(TokenTypes2) {
89
89
  TokenTypes2["OTHER"] = "other";
@@ -114,7 +114,7 @@ var TokenTypes;
114
114
  TokenTypes2["NUMBER"] = "number";
115
115
  })(TokenTypes || (TokenTypes = {}));
116
116
 
117
- // ../../node_modules/@tokens-studio/types/dist/constants/BorderValues.js
117
+ // ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/BorderValues.js
118
118
  var BorderValues;
119
119
  (function(BorderValues2) {
120
120
  BorderValues2["BORDER_COLOR"] = "color";
@@ -122,7 +122,7 @@ var BorderValues;
122
122
  BorderValues2["BORDER_STYLE"] = "style";
123
123
  })(BorderValues || (BorderValues = {}));
124
124
 
125
- // ../../node_modules/@tokens-studio/types/dist/constants/StrokeStyleValues.js
125
+ // ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/StrokeStyleValues.js
126
126
  var StrokeStyleValues;
127
127
  (function(StrokeStyleValues2) {
128
128
  StrokeStyleValues2["SOLID"] = "solid";
@@ -135,7 +135,7 @@ var StrokeStyleValues;
135
135
  StrokeStyleValues2["INSET"] = "inset";
136
136
  })(StrokeStyleValues || (StrokeStyleValues = {}));
137
137
 
138
- // ../../node_modules/@tokens-studio/types/dist/constants/BoxShadowValues.js
138
+ // ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/BoxShadowValues.js
139
139
  var BoxShadowValues;
140
140
  (function(BoxShadowValues2) {
141
141
  BoxShadowValues2["TYPE"] = "type";
@@ -147,7 +147,7 @@ var BoxShadowValues;
147
147
  BoxShadowValues2["BLEND_MODE"] = "blendMode";
148
148
  })(BoxShadowValues || (BoxShadowValues = {}));
149
149
 
150
- // ../../node_modules/@tokens-studio/types/dist/constants/TypographyValues.js
150
+ // ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/TypographyValues.js
151
151
  var TypographyValues;
152
152
  (function(TypographyValues2) {
153
153
  TypographyValues2["FONT_FAMILY"] = "fontFamily";
@@ -3,6 +3,7 @@ import * as R3 from "ramda";
3
3
 
4
4
  // src/colors/utils.ts
5
5
  import chroma from "chroma-js";
6
+ import Colorjs from "colorjs.io";
6
7
  import { Hsluv } from "hsluv";
7
8
  var getLuminanceFromLightness = (lightness) => {
8
9
  const conv = new Hsluv();