@digdir/designsystemet 1.0.5 → 1.0.6

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 (36) hide show
  1. package/LICENSE +7 -0
  2. package/dist/bin/designsystemet.js +49 -42
  3. package/dist/src/colors/index.js +32 -0
  4. package/dist/src/colors/theme.js +1 -0
  5. package/dist/src/colors/utils.d.ts +13 -0
  6. package/dist/src/colors/utils.d.ts.map +1 -1
  7. package/dist/src/colors/utils.js +32 -0
  8. package/dist/src/config.js +1 -0
  9. package/dist/src/index.js +80 -42
  10. package/dist/src/scripts/createJsonSchema.js +39 -38
  11. package/dist/src/tokens/build.js +48 -42
  12. package/dist/src/tokens/create/generators/$designsystemet.js +22 -20
  13. package/dist/src/tokens/create/generators/$themes.js +10 -10
  14. package/dist/src/tokens/create/generators/color.js +1 -0
  15. package/dist/src/tokens/create/write.js +32 -30
  16. package/dist/src/tokens/create.js +1 -0
  17. package/dist/src/tokens/format.js +49 -42
  18. package/dist/src/tokens/index.js +49 -42
  19. package/dist/src/tokens/process/configs/color.js +26 -22
  20. package/dist/src/tokens/process/configs/semantic.js +16 -12
  21. package/dist/src/tokens/process/configs/shared.js +16 -12
  22. package/dist/src/tokens/process/configs/storefront.js +16 -12
  23. package/dist/src/tokens/process/configs/typography.js +16 -12
  24. package/dist/src/tokens/process/configs.js +26 -22
  25. package/dist/src/tokens/process/formats/css/color.js +16 -12
  26. package/dist/src/tokens/process/formats/css/semantic.js +16 -12
  27. package/dist/src/tokens/process/formats/css.js +16 -12
  28. package/dist/src/tokens/process/formats/js-tokens.js +16 -12
  29. package/dist/src/tokens/process/platform.js +26 -22
  30. package/dist/src/tokens/process/theme.js +22 -20
  31. package/dist/src/tokens/process/transformers.js +16 -12
  32. package/dist/src/tokens/process/utils/getMultidimensionalThemes.js +26 -22
  33. package/dist/src/tokens/utils.d.ts +2 -2
  34. package/dist/src/tokens/utils.d.ts.map +1 -1
  35. package/dist/src/tokens/utils.js +16 -12
  36. package/package.json +31 -29
@@ -997,6 +997,7 @@ import * as R4 from "ramda";
997
997
 
998
998
  // src/colors/utils.ts
999
999
  import chroma from "chroma-js";
1000
+ import Colorjs from "colorjs.io";
1000
1001
  import { Hsluv } from "hsluv";
1001
1002
  var getLuminanceFromLightness = (lightness) => {
1002
1003
  const conv = new Hsluv();
@@ -2074,14 +2075,14 @@ var createTokens = async (opts) => {
2074
2075
  return { tokenSets };
2075
2076
  };
2076
2077
 
2077
- // ../../node_modules/@tokens-studio/types/dist/constants/BoxShadowTypes.js
2078
+ // ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/BoxShadowTypes.js
2078
2079
  var BoxShadowTypes;
2079
2080
  (function(BoxShadowTypes2) {
2080
2081
  BoxShadowTypes2["DROP_SHADOW"] = "dropShadow";
2081
2082
  BoxShadowTypes2["INNER_SHADOW"] = "innerShadow";
2082
2083
  })(BoxShadowTypes || (BoxShadowTypes = {}));
2083
2084
 
2084
- // ../../node_modules/@tokens-studio/types/dist/constants/ColorModifierTypes.js
2085
+ // ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/ColorModifierTypes.js
2085
2086
  var ColorModifierTypes;
2086
2087
  (function(ColorModifierTypes2) {
2087
2088
  ColorModifierTypes2["LIGHTEN"] = "lighten";
@@ -2090,7 +2091,7 @@ var ColorModifierTypes;
2090
2091
  ColorModifierTypes2["ALPHA"] = "alpha";
2091
2092
  })(ColorModifierTypes || (ColorModifierTypes = {}));
2092
2093
 
2093
- // ../../node_modules/@tokens-studio/types/dist/constants/ColorSpaceTypes.js
2094
+ // ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/ColorSpaceTypes.js
2094
2095
  var ColorSpaceTypes;
2095
2096
  (function(ColorSpaceTypes2) {
2096
2097
  ColorSpaceTypes2["LCH"] = "lch";
@@ -2099,7 +2100,7 @@ var ColorSpaceTypes;
2099
2100
  ColorSpaceTypes2["HSL"] = "hsl";
2100
2101
  })(ColorSpaceTypes || (ColorSpaceTypes = {}));
2101
2102
 
2102
- // ../../node_modules/@tokens-studio/types/dist/constants/Properties.js
2103
+ // ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/Properties.js
2103
2104
  var Properties;
2104
2105
  (function(Properties2) {
2105
2106
  Properties2["sizing"] = "sizing";
@@ -2151,7 +2152,7 @@ var Properties;
2151
2152
  Properties2["description"] = "description";
2152
2153
  })(Properties || (Properties = {}));
2153
2154
 
2154
- // ../../node_modules/@tokens-studio/types/dist/constants/TokenSetStatus.js
2155
+ // ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/TokenSetStatus.js
2155
2156
  var TokenSetStatus;
2156
2157
  (function(TokenSetStatus2) {
2157
2158
  TokenSetStatus2["DISABLED"] = "disabled";
@@ -2159,7 +2160,7 @@ var TokenSetStatus;
2159
2160
  TokenSetStatus2["ENABLED"] = "enabled";
2160
2161
  })(TokenSetStatus || (TokenSetStatus = {}));
2161
2162
 
2162
- // ../../node_modules/@tokens-studio/types/dist/constants/TokenTypes.js
2163
+ // ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/TokenTypes.js
2163
2164
  var TokenTypes;
2164
2165
  (function(TokenTypes2) {
2165
2166
  TokenTypes2["OTHER"] = "other";
@@ -2190,7 +2191,7 @@ var TokenTypes;
2190
2191
  TokenTypes2["NUMBER"] = "number";
2191
2192
  })(TokenTypes || (TokenTypes = {}));
2192
2193
 
2193
- // ../../node_modules/@tokens-studio/types/dist/constants/BorderValues.js
2194
+ // ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/BorderValues.js
2194
2195
  var BorderValues;
2195
2196
  (function(BorderValues2) {
2196
2197
  BorderValues2["BORDER_COLOR"] = "color";
@@ -2198,7 +2199,7 @@ var BorderValues;
2198
2199
  BorderValues2["BORDER_STYLE"] = "style";
2199
2200
  })(BorderValues || (BorderValues = {}));
2200
2201
 
2201
- // ../../node_modules/@tokens-studio/types/dist/constants/StrokeStyleValues.js
2202
+ // ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/StrokeStyleValues.js
2202
2203
  var StrokeStyleValues;
2203
2204
  (function(StrokeStyleValues2) {
2204
2205
  StrokeStyleValues2["SOLID"] = "solid";
@@ -2211,7 +2212,7 @@ var StrokeStyleValues;
2211
2212
  StrokeStyleValues2["INSET"] = "inset";
2212
2213
  })(StrokeStyleValues || (StrokeStyleValues = {}));
2213
2214
 
2214
- // ../../node_modules/@tokens-studio/types/dist/constants/BoxShadowValues.js
2215
+ // ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/BoxShadowValues.js
2215
2216
  var BoxShadowValues;
2216
2217
  (function(BoxShadowValues2) {
2217
2218
  BoxShadowValues2["TYPE"] = "type";
@@ -2223,7 +2224,7 @@ var BoxShadowValues;
2223
2224
  BoxShadowValues2["BLEND_MODE"] = "blendMode";
2224
2225
  })(BoxShadowValues || (BoxShadowValues = {}));
2225
2226
 
2226
- // ../../node_modules/@tokens-studio/types/dist/constants/TypographyValues.js
2227
+ // ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/TypographyValues.js
2227
2228
  var TypographyValues;
2228
2229
  (function(TypographyValues2) {
2229
2230
  TypographyValues2["FONT_FAMILY"] = "fontFamily";
@@ -2427,20 +2428,24 @@ var mapToLowerCase = R7.map(R7.toLower);
2427
2428
  var hasAnyTruth = R7.any(R7.equals(true));
2428
2429
  var getType = (token) => (token.$type ?? token.type) || "";
2429
2430
  var getValue = (token) => token.$value ?? token.value;
2430
- var typeEquals = R7.curry((types, token) => {
2431
- if (R7.isNil(token)) {
2432
- return false;
2431
+ var typeEquals = R7.curry(
2432
+ (types, token) => {
2433
+ if (R7.isNil(token)) {
2434
+ return false;
2435
+ }
2436
+ return R7.includes(R7.toLower(getType(token)), R7.map(R7.toLower, Array.isArray(types) ? types : [types]));
2433
2437
  }
2434
- return R7.includes(R7.toLower(getType(token)), R7.map(R7.toLower, Array.isArray(types) ? types : [types]));
2435
- });
2436
- var pathStartsWithOneOf = R7.curry((paths, token) => {
2437
- if (R7.isNil(token)) {
2438
- return false;
2438
+ );
2439
+ var pathStartsWithOneOf = R7.curry(
2440
+ (paths, token) => {
2441
+ if (R7.isNil(token)) {
2442
+ return false;
2443
+ }
2444
+ const tokenPath = mapToLowerCase(token.path);
2445
+ const matchPathsStartingWith = R7.map((path) => R7.startsWith([path], tokenPath), mapToLowerCase(paths));
2446
+ return hasAnyTruth(matchPathsStartingWith);
2439
2447
  }
2440
- const tokenPath = mapToLowerCase(token.path);
2441
- const matchPathsStartingWith = R7.map((path) => R7.startsWith([path], tokenPath), mapToLowerCase(paths));
2442
- return hasAnyTruth(matchPathsStartingWith);
2443
- });
2448
+ );
2444
2449
  function isSemanticToken(token) {
2445
2450
  return token.filePath.includes("semantic/");
2446
2451
  }
@@ -3336,11 +3341,11 @@ import chalk3 from "chalk";
3336
3341
  // package.json
3337
3342
  var package_default = {
3338
3343
  name: "@digdir/designsystemet",
3339
- version: "1.0.5",
3344
+ version: "1.0.6",
3340
3345
  description: "CLI for Designsystemet",
3341
3346
  author: "Designsystemet team",
3342
3347
  engines: {
3343
- node: ">=22.14.0"
3348
+ node: ">=22.15.0"
3344
3349
  },
3345
3350
  repository: {
3346
3351
  type: "git",
@@ -3370,56 +3375,58 @@ var package_default = {
3370
3375
  },
3371
3376
  scripts: {
3372
3377
  designsystemet: "tsx ./bin/designsystemet.ts",
3373
- "build:tokens": "yarn designsystemet tokens build -p -t ../../design-tokens -o ../../packages/theme/brand --clean",
3378
+ "build:tokens": "pnpm run designsystemet tokens build -p -t ../../design-tokens -o ../../packages/theme/brand --clean",
3374
3379
  "build:tokens:debug": "tsx --inspect-brk ./bin/designsystemet.ts tokens build -p -t ../../design-tokens -o ../../packages/theme/brand --clean",
3375
- build: "tsup && yarn build:types && yarn build:json-schema",
3380
+ build: "tsup && pnpm build:types && pnpm build:json-schema",
3376
3381
  "build:types": "tsc --emitDeclarationOnly --declaration",
3377
3382
  "build:json-schema": "tsx ./src/scripts/createJsonSchema.ts",
3378
3383
  types: "tsc --noEmit",
3379
- "test:tokens-create-options": "yarn designsystemet tokens create -m dominant:#007682 -n #003333 -b 99 -o ./test-tokens/options --theme options --clean",
3380
- "test:tokens-create-config": "yarn designsystemet tokens create --config ./test/test-tokens.config.json",
3381
- "test:tokens-build": "yarn designsystemet tokens build -t ./test-tokens/options -o ./test-tokens/options-build --clean",
3382
- "test:tokens-build-config": "yarn designsystemet tokens build -t ./test-tokens/config -o ./test-tokens/config-build --clean",
3383
- "test:tokens-create-and-build-options": "yarn test:tokens-create-options && yarn test:tokens-build",
3384
- "test:tokens-create-and-build-config": "yarn test:tokens-create-config && yarn test:tokens-build-config",
3385
- test: "yarn test:tokens-create-and-build-options && yarn test:tokens-create-and-build-config",
3386
- "internal:tokens-create": "yarn designsystemet tokens create --config ./internal.config.json",
3384
+ "test:tokens-create-options": 'pnpm run designsystemet tokens create -m dominant:"#007682" -n "#003333" -b 99 -o ./test-tokens/options --theme options --clean',
3385
+ "test:tokens-create-config": "pnpm run designsystemet tokens create --config ./test/test-tokens.config.json",
3386
+ "test:tokens-build": "pnpm run designsystemet tokens build -t ./test-tokens/options -o ./test-tokens/options-build --clean",
3387
+ "test:tokens-build-config": "pnpm run designsystemet tokens build -t ./test-tokens/config -o ./test-tokens/config-build --clean",
3388
+ "test:tokens-create-and-build-options": "pnpm test:tokens-create-options && pnpm test:tokens-build",
3389
+ "test:tokens-create-and-build-config": "pnpm test:tokens-create-config && pnpm test:tokens-build-config",
3390
+ test: "pnpm test:tokens-create-and-build-options && pnpm test:tokens-create-and-build-config",
3391
+ "internal:tokens-create": "pnpm run designsystemet tokens create --config ./internal.config.json",
3387
3392
  "update:template": "tsx ./src/scripts/update-template.ts",
3388
- "update:design-tokens": "yarn internal:tokens-create && tsx ./src/scripts/update-design-tokens.ts",
3389
- verify: "yarn test && yarn update:template && yarn update:design-tokens"
3393
+ "update:design-tokens": "pnpm internal:tokens-create && tsx ./src/scripts/update-design-tokens.ts",
3394
+ verify: "pnpm test && pnpm update:template && pnpm update:design-tokens"
3390
3395
  },
3391
3396
  dependencies: {
3392
3397
  "@commander-js/extra-typings": "^13.1.0",
3393
- "@tokens-studio/sd-transforms": "1.2.12",
3398
+ "@tokens-studio/sd-transforms": "1.3.0",
3394
3399
  "apca-w3": "^0.1.9",
3395
3400
  chalk: "^5.4.1",
3396
3401
  "change-case": "^5.4.4",
3397
3402
  "chroma-js": "^3.1.2",
3403
+ "colorjs.io": "^0.6.0-alpha.1",
3398
3404
  commander: "^13.1.0",
3399
3405
  "fast-glob": "^3.3.3",
3400
3406
  hsluv: "^1.0.1",
3401
3407
  "object-hash": "^3.0.0",
3402
3408
  postcss: "^8.5.3",
3403
3409
  ramda: "^0.30.1",
3404
- "style-dictionary": "^4.3.3",
3405
- zod: "^3.24.2",
3410
+ "style-dictionary": "^4.4.0",
3411
+ zod: "^3.24.4",
3406
3412
  "zod-validation-error": "^3.4.0"
3407
3413
  },
3408
3414
  devDependencies: {
3415
+ "@tokens-studio/types": "0.5.2",
3409
3416
  "@types/apca-w3": "^0.1.3",
3410
3417
  "@types/chroma-js": "^3.1.1",
3411
3418
  "@types/fs-extra": "^11.0.4",
3412
3419
  "@types/glob": "^8.1.0",
3413
3420
  "@types/jscodeshift": "^0.12.0",
3414
- "@types/node": "^22.14.0",
3421
+ "@types/node": "^22.15.3",
3415
3422
  "@types/object-hash": "^3.0.6",
3416
3423
  "@types/ramda": "^0.30.2",
3417
3424
  "fs-extra": "^11.3.0",
3418
3425
  "ts-toolbelt": "^9.6.0",
3419
3426
  tslib: "^2.8.1",
3420
3427
  tsup: "^8.4.0",
3421
- tsx: "^4.19.3",
3422
- typescript: "^5.8.2",
3428
+ tsx: "^4.19.4",
3429
+ typescript: "^5.8.3",
3423
3430
  "zod-to-json-schema": "^3.24.5"
3424
3431
  }
3425
3432
  };
@@ -994,6 +994,7 @@ import * as R4 from "ramda";
994
994
 
995
995
  // src/colors/utils.ts
996
996
  import chroma from "chroma-js";
997
+ import Colorjs from "colorjs.io";
997
998
  import { Hsluv } from "hsluv";
998
999
  var getLuminanceFromLightness = (lightness) => {
999
1000
  const conv = new Hsluv();
@@ -2089,14 +2090,14 @@ var createTokens = async (opts) => {
2089
2090
  // src/tokens/format.ts
2090
2091
  import * as R20 from "ramda";
2091
2092
 
2092
- // ../../node_modules/@tokens-studio/types/dist/constants/BoxShadowTypes.js
2093
+ // ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/BoxShadowTypes.js
2093
2094
  var BoxShadowTypes;
2094
2095
  (function(BoxShadowTypes2) {
2095
2096
  BoxShadowTypes2["DROP_SHADOW"] = "dropShadow";
2096
2097
  BoxShadowTypes2["INNER_SHADOW"] = "innerShadow";
2097
2098
  })(BoxShadowTypes || (BoxShadowTypes = {}));
2098
2099
 
2099
- // ../../node_modules/@tokens-studio/types/dist/constants/ColorModifierTypes.js
2100
+ // ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/ColorModifierTypes.js
2100
2101
  var ColorModifierTypes;
2101
2102
  (function(ColorModifierTypes2) {
2102
2103
  ColorModifierTypes2["LIGHTEN"] = "lighten";
@@ -2105,7 +2106,7 @@ var ColorModifierTypes;
2105
2106
  ColorModifierTypes2["ALPHA"] = "alpha";
2106
2107
  })(ColorModifierTypes || (ColorModifierTypes = {}));
2107
2108
 
2108
- // ../../node_modules/@tokens-studio/types/dist/constants/ColorSpaceTypes.js
2109
+ // ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/ColorSpaceTypes.js
2109
2110
  var ColorSpaceTypes;
2110
2111
  (function(ColorSpaceTypes2) {
2111
2112
  ColorSpaceTypes2["LCH"] = "lch";
@@ -2114,7 +2115,7 @@ var ColorSpaceTypes;
2114
2115
  ColorSpaceTypes2["HSL"] = "hsl";
2115
2116
  })(ColorSpaceTypes || (ColorSpaceTypes = {}));
2116
2117
 
2117
- // ../../node_modules/@tokens-studio/types/dist/constants/Properties.js
2118
+ // ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/Properties.js
2118
2119
  var Properties;
2119
2120
  (function(Properties2) {
2120
2121
  Properties2["sizing"] = "sizing";
@@ -2166,7 +2167,7 @@ var Properties;
2166
2167
  Properties2["description"] = "description";
2167
2168
  })(Properties || (Properties = {}));
2168
2169
 
2169
- // ../../node_modules/@tokens-studio/types/dist/constants/TokenSetStatus.js
2170
+ // ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/TokenSetStatus.js
2170
2171
  var TokenSetStatus;
2171
2172
  (function(TokenSetStatus2) {
2172
2173
  TokenSetStatus2["DISABLED"] = "disabled";
@@ -2174,7 +2175,7 @@ var TokenSetStatus;
2174
2175
  TokenSetStatus2["ENABLED"] = "enabled";
2175
2176
  })(TokenSetStatus || (TokenSetStatus = {}));
2176
2177
 
2177
- // ../../node_modules/@tokens-studio/types/dist/constants/TokenTypes.js
2178
+ // ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/TokenTypes.js
2178
2179
  var TokenTypes;
2179
2180
  (function(TokenTypes2) {
2180
2181
  TokenTypes2["OTHER"] = "other";
@@ -2205,7 +2206,7 @@ var TokenTypes;
2205
2206
  TokenTypes2["NUMBER"] = "number";
2206
2207
  })(TokenTypes || (TokenTypes = {}));
2207
2208
 
2208
- // ../../node_modules/@tokens-studio/types/dist/constants/BorderValues.js
2209
+ // ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/BorderValues.js
2209
2210
  var BorderValues;
2210
2211
  (function(BorderValues2) {
2211
2212
  BorderValues2["BORDER_COLOR"] = "color";
@@ -2213,7 +2214,7 @@ var BorderValues;
2213
2214
  BorderValues2["BORDER_STYLE"] = "style";
2214
2215
  })(BorderValues || (BorderValues = {}));
2215
2216
 
2216
- // ../../node_modules/@tokens-studio/types/dist/constants/StrokeStyleValues.js
2217
+ // ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/StrokeStyleValues.js
2217
2218
  var StrokeStyleValues;
2218
2219
  (function(StrokeStyleValues2) {
2219
2220
  StrokeStyleValues2["SOLID"] = "solid";
@@ -2226,7 +2227,7 @@ var StrokeStyleValues;
2226
2227
  StrokeStyleValues2["INSET"] = "inset";
2227
2228
  })(StrokeStyleValues || (StrokeStyleValues = {}));
2228
2229
 
2229
- // ../../node_modules/@tokens-studio/types/dist/constants/BoxShadowValues.js
2230
+ // ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/BoxShadowValues.js
2230
2231
  var BoxShadowValues;
2231
2232
  (function(BoxShadowValues2) {
2232
2233
  BoxShadowValues2["TYPE"] = "type";
@@ -2238,7 +2239,7 @@ var BoxShadowValues;
2238
2239
  BoxShadowValues2["BLEND_MODE"] = "blendMode";
2239
2240
  })(BoxShadowValues || (BoxShadowValues = {}));
2240
2241
 
2241
- // ../../node_modules/@tokens-studio/types/dist/constants/TypographyValues.js
2242
+ // ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/TypographyValues.js
2242
2243
  var TypographyValues;
2243
2244
  (function(TypographyValues2) {
2244
2245
  TypographyValues2["FONT_FAMILY"] = "fontFamily";
@@ -2442,20 +2443,24 @@ var mapToLowerCase = R7.map(R7.toLower);
2442
2443
  var hasAnyTruth = R7.any(R7.equals(true));
2443
2444
  var getType = (token) => (token.$type ?? token.type) || "";
2444
2445
  var getValue = (token) => token.$value ?? token.value;
2445
- var typeEquals = R7.curry((types, token) => {
2446
- if (R7.isNil(token)) {
2447
- return false;
2446
+ var typeEquals = R7.curry(
2447
+ (types, token) => {
2448
+ if (R7.isNil(token)) {
2449
+ return false;
2450
+ }
2451
+ return R7.includes(R7.toLower(getType(token)), R7.map(R7.toLower, Array.isArray(types) ? types : [types]));
2448
2452
  }
2449
- return R7.includes(R7.toLower(getType(token)), R7.map(R7.toLower, Array.isArray(types) ? types : [types]));
2450
- });
2451
- var pathStartsWithOneOf = R7.curry((paths, token) => {
2452
- if (R7.isNil(token)) {
2453
- return false;
2453
+ );
2454
+ var pathStartsWithOneOf = R7.curry(
2455
+ (paths, token) => {
2456
+ if (R7.isNil(token)) {
2457
+ return false;
2458
+ }
2459
+ const tokenPath = mapToLowerCase(token.path);
2460
+ const matchPathsStartingWith = R7.map((path) => R7.startsWith([path], tokenPath), mapToLowerCase(paths));
2461
+ return hasAnyTruth(matchPathsStartingWith);
2454
2462
  }
2455
- const tokenPath = mapToLowerCase(token.path);
2456
- const matchPathsStartingWith = R7.map((path) => R7.startsWith([path], tokenPath), mapToLowerCase(paths));
2457
- return hasAnyTruth(matchPathsStartingWith);
2458
- });
2463
+ );
2459
2464
  function isSemanticToken(token) {
2460
2465
  return token.filePath.includes("semantic/");
2461
2466
  }
@@ -3351,11 +3356,11 @@ import chalk3 from "chalk";
3351
3356
  // package.json
3352
3357
  var package_default = {
3353
3358
  name: "@digdir/designsystemet",
3354
- version: "1.0.5",
3359
+ version: "1.0.6",
3355
3360
  description: "CLI for Designsystemet",
3356
3361
  author: "Designsystemet team",
3357
3362
  engines: {
3358
- node: ">=22.14.0"
3363
+ node: ">=22.15.0"
3359
3364
  },
3360
3365
  repository: {
3361
3366
  type: "git",
@@ -3385,56 +3390,58 @@ var package_default = {
3385
3390
  },
3386
3391
  scripts: {
3387
3392
  designsystemet: "tsx ./bin/designsystemet.ts",
3388
- "build:tokens": "yarn designsystemet tokens build -p -t ../../design-tokens -o ../../packages/theme/brand --clean",
3393
+ "build:tokens": "pnpm run designsystemet tokens build -p -t ../../design-tokens -o ../../packages/theme/brand --clean",
3389
3394
  "build:tokens:debug": "tsx --inspect-brk ./bin/designsystemet.ts tokens build -p -t ../../design-tokens -o ../../packages/theme/brand --clean",
3390
- build: "tsup && yarn build:types && yarn build:json-schema",
3395
+ build: "tsup && pnpm build:types && pnpm build:json-schema",
3391
3396
  "build:types": "tsc --emitDeclarationOnly --declaration",
3392
3397
  "build:json-schema": "tsx ./src/scripts/createJsonSchema.ts",
3393
3398
  types: "tsc --noEmit",
3394
- "test:tokens-create-options": "yarn designsystemet tokens create -m dominant:#007682 -n #003333 -b 99 -o ./test-tokens/options --theme options --clean",
3395
- "test:tokens-create-config": "yarn designsystemet tokens create --config ./test/test-tokens.config.json",
3396
- "test:tokens-build": "yarn designsystemet tokens build -t ./test-tokens/options -o ./test-tokens/options-build --clean",
3397
- "test:tokens-build-config": "yarn designsystemet tokens build -t ./test-tokens/config -o ./test-tokens/config-build --clean",
3398
- "test:tokens-create-and-build-options": "yarn test:tokens-create-options && yarn test:tokens-build",
3399
- "test:tokens-create-and-build-config": "yarn test:tokens-create-config && yarn test:tokens-build-config",
3400
- test: "yarn test:tokens-create-and-build-options && yarn test:tokens-create-and-build-config",
3401
- "internal:tokens-create": "yarn designsystemet tokens create --config ./internal.config.json",
3399
+ "test:tokens-create-options": 'pnpm run designsystemet tokens create -m dominant:"#007682" -n "#003333" -b 99 -o ./test-tokens/options --theme options --clean',
3400
+ "test:tokens-create-config": "pnpm run designsystemet tokens create --config ./test/test-tokens.config.json",
3401
+ "test:tokens-build": "pnpm run designsystemet tokens build -t ./test-tokens/options -o ./test-tokens/options-build --clean",
3402
+ "test:tokens-build-config": "pnpm run designsystemet tokens build -t ./test-tokens/config -o ./test-tokens/config-build --clean",
3403
+ "test:tokens-create-and-build-options": "pnpm test:tokens-create-options && pnpm test:tokens-build",
3404
+ "test:tokens-create-and-build-config": "pnpm test:tokens-create-config && pnpm test:tokens-build-config",
3405
+ test: "pnpm test:tokens-create-and-build-options && pnpm test:tokens-create-and-build-config",
3406
+ "internal:tokens-create": "pnpm run designsystemet tokens create --config ./internal.config.json",
3402
3407
  "update:template": "tsx ./src/scripts/update-template.ts",
3403
- "update:design-tokens": "yarn internal:tokens-create && tsx ./src/scripts/update-design-tokens.ts",
3404
- verify: "yarn test && yarn update:template && yarn update:design-tokens"
3408
+ "update:design-tokens": "pnpm internal:tokens-create && tsx ./src/scripts/update-design-tokens.ts",
3409
+ verify: "pnpm test && pnpm update:template && pnpm update:design-tokens"
3405
3410
  },
3406
3411
  dependencies: {
3407
3412
  "@commander-js/extra-typings": "^13.1.0",
3408
- "@tokens-studio/sd-transforms": "1.2.12",
3413
+ "@tokens-studio/sd-transforms": "1.3.0",
3409
3414
  "apca-w3": "^0.1.9",
3410
3415
  chalk: "^5.4.1",
3411
3416
  "change-case": "^5.4.4",
3412
3417
  "chroma-js": "^3.1.2",
3418
+ "colorjs.io": "^0.6.0-alpha.1",
3413
3419
  commander: "^13.1.0",
3414
3420
  "fast-glob": "^3.3.3",
3415
3421
  hsluv: "^1.0.1",
3416
3422
  "object-hash": "^3.0.0",
3417
3423
  postcss: "^8.5.3",
3418
3424
  ramda: "^0.30.1",
3419
- "style-dictionary": "^4.3.3",
3420
- zod: "^3.24.2",
3425
+ "style-dictionary": "^4.4.0",
3426
+ zod: "^3.24.4",
3421
3427
  "zod-validation-error": "^3.4.0"
3422
3428
  },
3423
3429
  devDependencies: {
3430
+ "@tokens-studio/types": "0.5.2",
3424
3431
  "@types/apca-w3": "^0.1.3",
3425
3432
  "@types/chroma-js": "^3.1.1",
3426
3433
  "@types/fs-extra": "^11.0.4",
3427
3434
  "@types/glob": "^8.1.0",
3428
3435
  "@types/jscodeshift": "^0.12.0",
3429
- "@types/node": "^22.14.0",
3436
+ "@types/node": "^22.15.3",
3430
3437
  "@types/object-hash": "^3.0.6",
3431
3438
  "@types/ramda": "^0.30.2",
3432
3439
  "fs-extra": "^11.3.0",
3433
3440
  "ts-toolbelt": "^9.6.0",
3434
3441
  tslib: "^2.8.1",
3435
3442
  tsup: "^8.4.0",
3436
- tsx: "^4.19.3",
3437
- typescript: "^5.8.2",
3443
+ tsx: "^4.19.4",
3444
+ typescript: "^5.8.3",
3438
3445
  "zod-to-json-schema": "^3.24.5"
3439
3446
  }
3440
3447
  };
@@ -7,20 +7,24 @@ var mapToLowerCase = R.map(R.toLower);
7
7
  var hasAnyTruth = R.any(R.equals(true));
8
8
  var getType = (token) => (token.$type ?? token.type) || "";
9
9
  var getValue = (token) => token.$value ?? token.value;
10
- var typeEquals = R.curry((types, token) => {
11
- if (R.isNil(token)) {
12
- return false;
10
+ var typeEquals = R.curry(
11
+ (types, token) => {
12
+ if (R.isNil(token)) {
13
+ return false;
14
+ }
15
+ return R.includes(R.toLower(getType(token)), R.map(R.toLower, Array.isArray(types) ? types : [types]));
13
16
  }
14
- return R.includes(R.toLower(getType(token)), R.map(R.toLower, Array.isArray(types) ? types : [types]));
15
- });
16
- var pathStartsWithOneOf = R.curry((paths, token) => {
17
- if (R.isNil(token)) {
18
- return false;
17
+ );
18
+ var pathStartsWithOneOf = R.curry(
19
+ (paths, token) => {
20
+ if (R.isNil(token)) {
21
+ return false;
22
+ }
23
+ const tokenPath = mapToLowerCase(token.path);
24
+ const matchPathsStartingWith = R.map((path) => R.startsWith([path], tokenPath), mapToLowerCase(paths));
25
+ return hasAnyTruth(matchPathsStartingWith);
19
26
  }
20
- const tokenPath = mapToLowerCase(token.path);
21
- const matchPathsStartingWith = R.map((path) => R.startsWith([path], tokenPath), mapToLowerCase(paths));
22
- return hasAnyTruth(matchPathsStartingWith);
23
- });
27
+ );
24
28
  function isSemanticToken(token) {
25
29
  return token.filePath.includes("semantic/");
26
30
  }
@@ -510,14 +514,14 @@ var typographyVariables = ({ theme, typography: typography2 }) => {
510
514
  };
511
515
  };
512
516
 
513
- // ../../node_modules/@tokens-studio/types/dist/constants/BoxShadowTypes.js
517
+ // ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/BoxShadowTypes.js
514
518
  var BoxShadowTypes;
515
519
  (function(BoxShadowTypes2) {
516
520
  BoxShadowTypes2["DROP_SHADOW"] = "dropShadow";
517
521
  BoxShadowTypes2["INNER_SHADOW"] = "innerShadow";
518
522
  })(BoxShadowTypes || (BoxShadowTypes = {}));
519
523
 
520
- // ../../node_modules/@tokens-studio/types/dist/constants/ColorModifierTypes.js
524
+ // ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/ColorModifierTypes.js
521
525
  var ColorModifierTypes;
522
526
  (function(ColorModifierTypes2) {
523
527
  ColorModifierTypes2["LIGHTEN"] = "lighten";
@@ -526,7 +530,7 @@ var ColorModifierTypes;
526
530
  ColorModifierTypes2["ALPHA"] = "alpha";
527
531
  })(ColorModifierTypes || (ColorModifierTypes = {}));
528
532
 
529
- // ../../node_modules/@tokens-studio/types/dist/constants/ColorSpaceTypes.js
533
+ // ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/ColorSpaceTypes.js
530
534
  var ColorSpaceTypes;
531
535
  (function(ColorSpaceTypes2) {
532
536
  ColorSpaceTypes2["LCH"] = "lch";
@@ -535,7 +539,7 @@ var ColorSpaceTypes;
535
539
  ColorSpaceTypes2["HSL"] = "hsl";
536
540
  })(ColorSpaceTypes || (ColorSpaceTypes = {}));
537
541
 
538
- // ../../node_modules/@tokens-studio/types/dist/constants/Properties.js
542
+ // ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/Properties.js
539
543
  var Properties;
540
544
  (function(Properties2) {
541
545
  Properties2["sizing"] = "sizing";
@@ -587,7 +591,7 @@ var Properties;
587
591
  Properties2["description"] = "description";
588
592
  })(Properties || (Properties = {}));
589
593
 
590
- // ../../node_modules/@tokens-studio/types/dist/constants/TokenSetStatus.js
594
+ // ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/TokenSetStatus.js
591
595
  var TokenSetStatus;
592
596
  (function(TokenSetStatus2) {
593
597
  TokenSetStatus2["DISABLED"] = "disabled";
@@ -595,7 +599,7 @@ var TokenSetStatus;
595
599
  TokenSetStatus2["ENABLED"] = "enabled";
596
600
  })(TokenSetStatus || (TokenSetStatus = {}));
597
601
 
598
- // ../../node_modules/@tokens-studio/types/dist/constants/TokenTypes.js
602
+ // ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/TokenTypes.js
599
603
  var TokenTypes;
600
604
  (function(TokenTypes2) {
601
605
  TokenTypes2["OTHER"] = "other";
@@ -626,7 +630,7 @@ var TokenTypes;
626
630
  TokenTypes2["NUMBER"] = "number";
627
631
  })(TokenTypes || (TokenTypes = {}));
628
632
 
629
- // ../../node_modules/@tokens-studio/types/dist/constants/BorderValues.js
633
+ // ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/BorderValues.js
630
634
  var BorderValues;
631
635
  (function(BorderValues2) {
632
636
  BorderValues2["BORDER_COLOR"] = "color";
@@ -634,7 +638,7 @@ var BorderValues;
634
638
  BorderValues2["BORDER_STYLE"] = "style";
635
639
  })(BorderValues || (BorderValues = {}));
636
640
 
637
- // ../../node_modules/@tokens-studio/types/dist/constants/StrokeStyleValues.js
641
+ // ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/StrokeStyleValues.js
638
642
  var StrokeStyleValues;
639
643
  (function(StrokeStyleValues2) {
640
644
  StrokeStyleValues2["SOLID"] = "solid";
@@ -647,7 +651,7 @@ var StrokeStyleValues;
647
651
  StrokeStyleValues2["INSET"] = "inset";
648
652
  })(StrokeStyleValues || (StrokeStyleValues = {}));
649
653
 
650
- // ../../node_modules/@tokens-studio/types/dist/constants/BoxShadowValues.js
654
+ // ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/BoxShadowValues.js
651
655
  var BoxShadowValues;
652
656
  (function(BoxShadowValues2) {
653
657
  BoxShadowValues2["TYPE"] = "type";
@@ -659,7 +663,7 @@ var BoxShadowValues;
659
663
  BoxShadowValues2["BLEND_MODE"] = "blendMode";
660
664
  })(BoxShadowValues || (BoxShadowValues = {}));
661
665
 
662
- // ../../node_modules/@tokens-studio/types/dist/constants/TypographyValues.js
666
+ // ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/TypographyValues.js
663
667
  var TypographyValues;
664
668
  (function(TypographyValues2) {
665
669
  TypographyValues2["FONT_FAMILY"] = "fontFamily";
@@ -8,20 +8,24 @@ var mapToLowerCase = R.map(R.toLower);
8
8
  var hasAnyTruth = R.any(R.equals(true));
9
9
  var getType = (token) => (token.$type ?? token.type) || "";
10
10
  var getValue = (token) => token.$value ?? token.value;
11
- var typeEquals = R.curry((types, token) => {
12
- if (R.isNil(token)) {
13
- return false;
11
+ var typeEquals = R.curry(
12
+ (types, token) => {
13
+ if (R.isNil(token)) {
14
+ return false;
15
+ }
16
+ return R.includes(R.toLower(getType(token)), R.map(R.toLower, Array.isArray(types) ? types : [types]));
14
17
  }
15
- return R.includes(R.toLower(getType(token)), R.map(R.toLower, Array.isArray(types) ? types : [types]));
16
- });
17
- var pathStartsWithOneOf = R.curry((paths, token) => {
18
- if (R.isNil(token)) {
19
- return false;
18
+ );
19
+ var pathStartsWithOneOf = R.curry(
20
+ (paths, token) => {
21
+ if (R.isNil(token)) {
22
+ return false;
23
+ }
24
+ const tokenPath = mapToLowerCase(token.path);
25
+ const matchPathsStartingWith = R.map((path) => R.startsWith([path], tokenPath), mapToLowerCase(paths));
26
+ return hasAnyTruth(matchPathsStartingWith);
20
27
  }
21
- const tokenPath = mapToLowerCase(token.path);
22
- const matchPathsStartingWith = R.map((path) => R.startsWith([path], tokenPath), mapToLowerCase(paths));
23
- return hasAnyTruth(matchPathsStartingWith);
24
- });
28
+ );
25
29
  function isSemanticToken(token) {
26
30
  return token.filePath.includes("semantic/");
27
31
  }
@@ -8,20 +8,24 @@ var mapToLowerCase = R.map(R.toLower);
8
8
  var hasAnyTruth = R.any(R.equals(true));
9
9
  var getType = (token) => (token.$type ?? token.type) || "";
10
10
  var getValue = (token) => token.$value ?? token.value;
11
- var typeEquals = R.curry((types, token) => {
12
- if (R.isNil(token)) {
13
- return false;
11
+ var typeEquals = R.curry(
12
+ (types, token) => {
13
+ if (R.isNil(token)) {
14
+ return false;
15
+ }
16
+ return R.includes(R.toLower(getType(token)), R.map(R.toLower, Array.isArray(types) ? types : [types]));
14
17
  }
15
- return R.includes(R.toLower(getType(token)), R.map(R.toLower, Array.isArray(types) ? types : [types]));
16
- });
17
- var pathStartsWithOneOf = R.curry((paths, token) => {
18
- if (R.isNil(token)) {
19
- return false;
18
+ );
19
+ var pathStartsWithOneOf = R.curry(
20
+ (paths, token) => {
21
+ if (R.isNil(token)) {
22
+ return false;
23
+ }
24
+ const tokenPath = mapToLowerCase(token.path);
25
+ const matchPathsStartingWith = R.map((path) => R.startsWith([path], tokenPath), mapToLowerCase(paths));
26
+ return hasAnyTruth(matchPathsStartingWith);
20
27
  }
21
- const tokenPath = mapToLowerCase(token.path);
22
- const matchPathsStartingWith = R.map((path) => R.startsWith([path], tokenPath), mapToLowerCase(paths));
23
- return hasAnyTruth(matchPathsStartingWith);
24
- });
28
+ );
25
29
 
26
30
  // src/tokens/process/transformers.ts
27
31
  var isPx = R2.test(/\b\d+px\b/g);