@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.
- package/LICENSE +7 -0
- package/configs/digdir.config.json +59 -0
- package/configs/test-tokens.config.json +45 -0
- package/dist/bin/designsystemet.js +82 -88
- package/dist/config.schema.json +38 -27
- package/dist/src/colors/index.js +32 -0
- package/dist/src/colors/theme.js +1 -0
- package/dist/src/colors/utils.d.ts +13 -0
- package/dist/src/colors/utils.d.ts.map +1 -1
- package/dist/src/colors/utils.js +32 -0
- package/dist/src/config.d.ts +24 -176
- package/dist/src/config.d.ts.map +1 -1
- package/dist/src/config.js +23 -32
- package/dist/src/index.js +85 -50
- package/dist/src/migrations/beta-to-v1.js +2 -2
- package/dist/src/migrations/codemods/css/run.js +2 -2
- package/dist/src/migrations/color-rename-next49.js +2 -2
- package/dist/src/migrations/index.js +2 -2
- package/dist/src/scripts/createJsonSchema.js +33 -1292
- package/dist/src/scripts/update-design-tokens.js +4 -4
- package/dist/src/scripts/update-template.js +7 -7
- package/dist/src/tokens/build.js +56 -53
- package/dist/src/tokens/create/generators/$designsystemet.js +27 -25
- package/dist/src/tokens/create/generators/$themes.js +10 -10
- package/dist/src/tokens/create/generators/color.js +1 -0
- package/dist/src/tokens/create/write.js +39 -37
- package/dist/src/tokens/create.js +1 -0
- package/dist/src/tokens/format.js +54 -50
- package/dist/src/tokens/index.js +54 -50
- package/dist/src/tokens/process/configs/color.js +26 -22
- package/dist/src/tokens/process/configs/semantic.js +16 -12
- package/dist/src/tokens/process/configs/shared.js +16 -12
- package/dist/src/tokens/process/configs/storefront.js +16 -12
- package/dist/src/tokens/process/configs/typography.js +16 -12
- package/dist/src/tokens/process/configs.js +26 -22
- package/dist/src/tokens/process/formats/css/color.js +16 -12
- package/dist/src/tokens/process/formats/css/semantic.js +16 -12
- package/dist/src/tokens/process/formats/css.js +16 -12
- package/dist/src/tokens/process/formats/js-tokens.js +16 -12
- package/dist/src/tokens/process/platform.js +26 -22
- package/dist/src/tokens/process/theme.d.ts.map +1 -1
- package/dist/src/tokens/process/theme.js +27 -28
- package/dist/src/tokens/process/transformers.js +16 -12
- package/dist/src/tokens/process/utils/getMultidimensionalThemes.js +26 -22
- package/dist/src/tokens/utils.d.ts +2 -2
- package/dist/src/tokens/utils.d.ts.map +1 -1
- package/dist/src/tokens/utils.js +16 -12
- package/dist/src/utils.js +1 -1
- package/package.json +35 -33
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// src/tokens/create/write.ts
|
|
2
|
-
import path from "
|
|
2
|
+
import path from "path";
|
|
3
3
|
import chalk2 from "chalk";
|
|
4
4
|
import * as R from "ramda";
|
|
5
5
|
|
|
6
6
|
// src/utils.ts
|
|
7
|
-
import fs from "
|
|
7
|
+
import fs from "fs/promises";
|
|
8
8
|
import chalk from "chalk";
|
|
9
9
|
var mkdir = async (dir, dry) => {
|
|
10
10
|
if (dry) {
|
|
@@ -39,11 +39,11 @@ var readFile = async (path2, dry) => {
|
|
|
39
39
|
// package.json
|
|
40
40
|
var package_default = {
|
|
41
41
|
name: "@digdir/designsystemet",
|
|
42
|
-
version: "1.0.
|
|
42
|
+
version: "1.0.7",
|
|
43
43
|
description: "CLI for Designsystemet",
|
|
44
44
|
author: "Designsystemet team",
|
|
45
45
|
engines: {
|
|
46
|
-
node: ">=22.
|
|
46
|
+
node: ">=22.16.0"
|
|
47
47
|
},
|
|
48
48
|
repository: {
|
|
49
49
|
type: "git",
|
|
@@ -54,7 +54,8 @@ var package_default = {
|
|
|
54
54
|
type: "module",
|
|
55
55
|
main: "./dist/src/index.js",
|
|
56
56
|
files: [
|
|
57
|
-
"./dist/**"
|
|
57
|
+
"./dist/**",
|
|
58
|
+
"./configs/**"
|
|
58
59
|
],
|
|
59
60
|
bin: "dist/bin/designsystemet.js",
|
|
60
61
|
exports: {
|
|
@@ -73,57 +74,58 @@ var package_default = {
|
|
|
73
74
|
},
|
|
74
75
|
scripts: {
|
|
75
76
|
designsystemet: "tsx ./bin/designsystemet.ts",
|
|
76
|
-
"build:tokens": "
|
|
77
|
-
"build:tokens:debug": "tsx --inspect-brk ./bin/designsystemet.ts tokens build -p -t ../../design-tokens -o ../../packages/theme/brand --clean",
|
|
78
|
-
build: "tsup &&
|
|
77
|
+
"build:tokens": "pnpm run designsystemet tokens build -p -t ../../internal/design-tokens -o ../../packages/theme/brand --clean",
|
|
78
|
+
"build:tokens:debug": "tsx --inspect-brk ./bin/designsystemet.ts tokens build -p -t ../../internal/design-tokens -o ../../packages/theme/brand --clean",
|
|
79
|
+
build: "tsup && pnpm build:types && pnpm build:json-schema",
|
|
79
80
|
"build:types": "tsc --emitDeclarationOnly --declaration",
|
|
80
81
|
"build:json-schema": "tsx ./src/scripts/createJsonSchema.ts",
|
|
81
82
|
types: "tsc --noEmit",
|
|
82
|
-
"test:tokens-create-options":
|
|
83
|
-
"test:tokens-create-config": "
|
|
84
|
-
"test:tokens-build": "
|
|
85
|
-
"test:tokens-build-config": "
|
|
86
|
-
"test:tokens-create-and-build-options": "
|
|
87
|
-
"test:tokens-create-and-build-config": "
|
|
88
|
-
test: "
|
|
89
|
-
"
|
|
83
|
+
"test:tokens-create-options": 'pnpm run designsystemet tokens create -m dominant:"#007682" -n "#003333" -b 99 -o ./temp/options/design-tokens --theme options --clean',
|
|
84
|
+
"test:tokens-create-config": "pnpm run designsystemet tokens create --config ./configs/test-tokens.config.json",
|
|
85
|
+
"test:tokens-build": "pnpm run designsystemet tokens build -t ./temp/options/design-tokens -o ./temp/options/build --clean",
|
|
86
|
+
"test:tokens-build-config": "pnpm run designsystemet tokens build -t ./temp/config/design-tokens -o ./temp/config/build --clean",
|
|
87
|
+
"test:tokens-create-and-build-options": "pnpm test:tokens-create-options && pnpm test:tokens-build",
|
|
88
|
+
"test:tokens-create-and-build-config": "pnpm test:tokens-create-config && pnpm test:tokens-build-config",
|
|
89
|
+
test: "pnpm test:tokens-create-and-build-options && pnpm test:tokens-create-and-build-config",
|
|
90
|
+
"digdir:tokens-create": "pnpm run designsystemet tokens create --config ./configs/digdir.config.json",
|
|
90
91
|
"update:template": "tsx ./src/scripts/update-template.ts",
|
|
91
|
-
"update:design-tokens": "
|
|
92
|
-
verify: "
|
|
92
|
+
"update:design-tokens": "pnpm digdir:tokens-create && tsx ./src/scripts/update-design-tokens.ts",
|
|
93
|
+
verify: "pnpm test && pnpm update:template && pnpm update:design-tokens"
|
|
93
94
|
},
|
|
94
95
|
dependencies: {
|
|
95
96
|
"@commander-js/extra-typings": "^13.1.0",
|
|
96
|
-
"@tokens-studio/sd-transforms": "1.
|
|
97
|
+
"@tokens-studio/sd-transforms": "1.3.0",
|
|
97
98
|
"apca-w3": "^0.1.9",
|
|
98
99
|
chalk: "^5.4.1",
|
|
99
100
|
"change-case": "^5.4.4",
|
|
100
101
|
"chroma-js": "^3.1.2",
|
|
102
|
+
"colorjs.io": "^0.6.0-alpha.1",
|
|
101
103
|
commander: "^13.1.0",
|
|
102
104
|
"fast-glob": "^3.3.3",
|
|
103
105
|
hsluv: "^1.0.1",
|
|
104
106
|
"object-hash": "^3.0.0",
|
|
105
107
|
postcss: "^8.5.3",
|
|
106
108
|
ramda: "^0.30.1",
|
|
107
|
-
"style-dictionary": "^4.
|
|
108
|
-
zod: "^3.
|
|
109
|
-
"zod-validation-error": "^3.4.
|
|
109
|
+
"style-dictionary": "^4.4.0",
|
|
110
|
+
zod: "^3.25.30",
|
|
111
|
+
"zod-validation-error": "^3.4.1"
|
|
110
112
|
},
|
|
111
113
|
devDependencies: {
|
|
114
|
+
"@tokens-studio/types": "0.5.2",
|
|
112
115
|
"@types/apca-w3": "^0.1.3",
|
|
113
116
|
"@types/chroma-js": "^3.1.1",
|
|
114
117
|
"@types/fs-extra": "^11.0.4",
|
|
115
118
|
"@types/glob": "^8.1.0",
|
|
116
119
|
"@types/jscodeshift": "^0.12.0",
|
|
117
|
-
"@types/node": "^22.
|
|
120
|
+
"@types/node": "^22.15.21",
|
|
118
121
|
"@types/object-hash": "^3.0.6",
|
|
119
122
|
"@types/ramda": "^0.30.2",
|
|
120
123
|
"fs-extra": "^11.3.0",
|
|
121
124
|
"ts-toolbelt": "^9.6.0",
|
|
122
125
|
tslib: "^2.8.1",
|
|
123
|
-
tsup: "^8.
|
|
124
|
-
tsx: "^4.19.
|
|
125
|
-
typescript: "^5.8.
|
|
126
|
-
"zod-to-json-schema": "^3.24.5"
|
|
126
|
+
tsup: "^8.5.0",
|
|
127
|
+
tsx: "^4.19.4",
|
|
128
|
+
typescript: "^5.8.3"
|
|
127
129
|
}
|
|
128
130
|
};
|
|
129
131
|
|
|
@@ -162,14 +164,14 @@ function generate$Metadata(schemes, themes, colors) {
|
|
|
162
164
|
};
|
|
163
165
|
}
|
|
164
166
|
|
|
165
|
-
// ../../node_modules/@tokens-studio/types/dist/constants/BoxShadowTypes.js
|
|
167
|
+
// ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/BoxShadowTypes.js
|
|
166
168
|
var BoxShadowTypes;
|
|
167
169
|
(function(BoxShadowTypes2) {
|
|
168
170
|
BoxShadowTypes2["DROP_SHADOW"] = "dropShadow";
|
|
169
171
|
BoxShadowTypes2["INNER_SHADOW"] = "innerShadow";
|
|
170
172
|
})(BoxShadowTypes || (BoxShadowTypes = {}));
|
|
171
173
|
|
|
172
|
-
// ../../node_modules/@tokens-studio/types/dist/constants/ColorModifierTypes.js
|
|
174
|
+
// ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/ColorModifierTypes.js
|
|
173
175
|
var ColorModifierTypes;
|
|
174
176
|
(function(ColorModifierTypes2) {
|
|
175
177
|
ColorModifierTypes2["LIGHTEN"] = "lighten";
|
|
@@ -178,7 +180,7 @@ var ColorModifierTypes;
|
|
|
178
180
|
ColorModifierTypes2["ALPHA"] = "alpha";
|
|
179
181
|
})(ColorModifierTypes || (ColorModifierTypes = {}));
|
|
180
182
|
|
|
181
|
-
// ../../node_modules/@tokens-studio/types/dist/constants/ColorSpaceTypes.js
|
|
183
|
+
// ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/ColorSpaceTypes.js
|
|
182
184
|
var ColorSpaceTypes;
|
|
183
185
|
(function(ColorSpaceTypes2) {
|
|
184
186
|
ColorSpaceTypes2["LCH"] = "lch";
|
|
@@ -187,7 +189,7 @@ var ColorSpaceTypes;
|
|
|
187
189
|
ColorSpaceTypes2["HSL"] = "hsl";
|
|
188
190
|
})(ColorSpaceTypes || (ColorSpaceTypes = {}));
|
|
189
191
|
|
|
190
|
-
// ../../node_modules/@tokens-studio/types/dist/constants/Properties.js
|
|
192
|
+
// ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/Properties.js
|
|
191
193
|
var Properties;
|
|
192
194
|
(function(Properties2) {
|
|
193
195
|
Properties2["sizing"] = "sizing";
|
|
@@ -239,7 +241,7 @@ var Properties;
|
|
|
239
241
|
Properties2["description"] = "description";
|
|
240
242
|
})(Properties || (Properties = {}));
|
|
241
243
|
|
|
242
|
-
// ../../node_modules/@tokens-studio/types/dist/constants/TokenSetStatus.js
|
|
244
|
+
// ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/TokenSetStatus.js
|
|
243
245
|
var TokenSetStatus;
|
|
244
246
|
(function(TokenSetStatus2) {
|
|
245
247
|
TokenSetStatus2["DISABLED"] = "disabled";
|
|
@@ -247,7 +249,7 @@ var TokenSetStatus;
|
|
|
247
249
|
TokenSetStatus2["ENABLED"] = "enabled";
|
|
248
250
|
})(TokenSetStatus || (TokenSetStatus = {}));
|
|
249
251
|
|
|
250
|
-
// ../../node_modules/@tokens-studio/types/dist/constants/TokenTypes.js
|
|
252
|
+
// ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/TokenTypes.js
|
|
251
253
|
var TokenTypes;
|
|
252
254
|
(function(TokenTypes2) {
|
|
253
255
|
TokenTypes2["OTHER"] = "other";
|
|
@@ -278,7 +280,7 @@ var TokenTypes;
|
|
|
278
280
|
TokenTypes2["NUMBER"] = "number";
|
|
279
281
|
})(TokenTypes || (TokenTypes = {}));
|
|
280
282
|
|
|
281
|
-
// ../../node_modules/@tokens-studio/types/dist/constants/BorderValues.js
|
|
283
|
+
// ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/BorderValues.js
|
|
282
284
|
var BorderValues;
|
|
283
285
|
(function(BorderValues2) {
|
|
284
286
|
BorderValues2["BORDER_COLOR"] = "color";
|
|
@@ -286,7 +288,7 @@ var BorderValues;
|
|
|
286
288
|
BorderValues2["BORDER_STYLE"] = "style";
|
|
287
289
|
})(BorderValues || (BorderValues = {}));
|
|
288
290
|
|
|
289
|
-
// ../../node_modules/@tokens-studio/types/dist/constants/StrokeStyleValues.js
|
|
291
|
+
// ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/StrokeStyleValues.js
|
|
290
292
|
var StrokeStyleValues;
|
|
291
293
|
(function(StrokeStyleValues2) {
|
|
292
294
|
StrokeStyleValues2["SOLID"] = "solid";
|
|
@@ -299,7 +301,7 @@ var StrokeStyleValues;
|
|
|
299
301
|
StrokeStyleValues2["INSET"] = "inset";
|
|
300
302
|
})(StrokeStyleValues || (StrokeStyleValues = {}));
|
|
301
303
|
|
|
302
|
-
// ../../node_modules/@tokens-studio/types/dist/constants/BoxShadowValues.js
|
|
304
|
+
// ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/BoxShadowValues.js
|
|
303
305
|
var BoxShadowValues;
|
|
304
306
|
(function(BoxShadowValues2) {
|
|
305
307
|
BoxShadowValues2["TYPE"] = "type";
|
|
@@ -311,7 +313,7 @@ var BoxShadowValues;
|
|
|
311
313
|
BoxShadowValues2["BLEND_MODE"] = "blendMode";
|
|
312
314
|
})(BoxShadowValues || (BoxShadowValues = {}));
|
|
313
315
|
|
|
314
|
-
// ../../node_modules/@tokens-studio/types/dist/constants/TypographyValues.js
|
|
316
|
+
// ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/TypographyValues.js
|
|
315
317
|
var TypographyValues;
|
|
316
318
|
(function(TypographyValues2) {
|
|
317
319
|
TypographyValues2["FONT_FAMILY"] = "fontFamily";
|
|
@@ -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(
|
|
2431
|
-
|
|
2432
|
-
|
|
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
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
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
|
-
|
|
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.
|
|
3344
|
+
version: "1.0.7",
|
|
3340
3345
|
description: "CLI for Designsystemet",
|
|
3341
3346
|
author: "Designsystemet team",
|
|
3342
3347
|
engines: {
|
|
3343
|
-
node: ">=22.
|
|
3348
|
+
node: ">=22.16.0"
|
|
3344
3349
|
},
|
|
3345
3350
|
repository: {
|
|
3346
3351
|
type: "git",
|
|
@@ -3351,7 +3356,8 @@ var package_default = {
|
|
|
3351
3356
|
type: "module",
|
|
3352
3357
|
main: "./dist/src/index.js",
|
|
3353
3358
|
files: [
|
|
3354
|
-
"./dist/**"
|
|
3359
|
+
"./dist/**",
|
|
3360
|
+
"./configs/**"
|
|
3355
3361
|
],
|
|
3356
3362
|
bin: "dist/bin/designsystemet.js",
|
|
3357
3363
|
exports: {
|
|
@@ -3370,57 +3376,58 @@ var package_default = {
|
|
|
3370
3376
|
},
|
|
3371
3377
|
scripts: {
|
|
3372
3378
|
designsystemet: "tsx ./bin/designsystemet.ts",
|
|
3373
|
-
"build:tokens": "
|
|
3374
|
-
"build:tokens:debug": "tsx --inspect-brk ./bin/designsystemet.ts tokens build -p -t ../../design-tokens -o ../../packages/theme/brand --clean",
|
|
3375
|
-
build: "tsup &&
|
|
3379
|
+
"build:tokens": "pnpm run designsystemet tokens build -p -t ../../internal/design-tokens -o ../../packages/theme/brand --clean",
|
|
3380
|
+
"build:tokens:debug": "tsx --inspect-brk ./bin/designsystemet.ts tokens build -p -t ../../internal/design-tokens -o ../../packages/theme/brand --clean",
|
|
3381
|
+
build: "tsup && pnpm build:types && pnpm build:json-schema",
|
|
3376
3382
|
"build:types": "tsc --emitDeclarationOnly --declaration",
|
|
3377
3383
|
"build:json-schema": "tsx ./src/scripts/createJsonSchema.ts",
|
|
3378
3384
|
types: "tsc --noEmit",
|
|
3379
|
-
"test:tokens-create-options":
|
|
3380
|
-
"test:tokens-create-config": "
|
|
3381
|
-
"test:tokens-build": "
|
|
3382
|
-
"test:tokens-build-config": "
|
|
3383
|
-
"test:tokens-create-and-build-options": "
|
|
3384
|
-
"test:tokens-create-and-build-config": "
|
|
3385
|
-
test: "
|
|
3386
|
-
"
|
|
3385
|
+
"test:tokens-create-options": 'pnpm run designsystemet tokens create -m dominant:"#007682" -n "#003333" -b 99 -o ./temp/options/design-tokens --theme options --clean',
|
|
3386
|
+
"test:tokens-create-config": "pnpm run designsystemet tokens create --config ./configs/test-tokens.config.json",
|
|
3387
|
+
"test:tokens-build": "pnpm run designsystemet tokens build -t ./temp/options/design-tokens -o ./temp/options/build --clean",
|
|
3388
|
+
"test:tokens-build-config": "pnpm run designsystemet tokens build -t ./temp/config/design-tokens -o ./temp/config/build --clean",
|
|
3389
|
+
"test:tokens-create-and-build-options": "pnpm test:tokens-create-options && pnpm test:tokens-build",
|
|
3390
|
+
"test:tokens-create-and-build-config": "pnpm test:tokens-create-config && pnpm test:tokens-build-config",
|
|
3391
|
+
test: "pnpm test:tokens-create-and-build-options && pnpm test:tokens-create-and-build-config",
|
|
3392
|
+
"digdir:tokens-create": "pnpm run designsystemet tokens create --config ./configs/digdir.config.json",
|
|
3387
3393
|
"update:template": "tsx ./src/scripts/update-template.ts",
|
|
3388
|
-
"update:design-tokens": "
|
|
3389
|
-
verify: "
|
|
3394
|
+
"update:design-tokens": "pnpm digdir:tokens-create && tsx ./src/scripts/update-design-tokens.ts",
|
|
3395
|
+
verify: "pnpm test && pnpm update:template && pnpm update:design-tokens"
|
|
3390
3396
|
},
|
|
3391
3397
|
dependencies: {
|
|
3392
3398
|
"@commander-js/extra-typings": "^13.1.0",
|
|
3393
|
-
"@tokens-studio/sd-transforms": "1.
|
|
3399
|
+
"@tokens-studio/sd-transforms": "1.3.0",
|
|
3394
3400
|
"apca-w3": "^0.1.9",
|
|
3395
3401
|
chalk: "^5.4.1",
|
|
3396
3402
|
"change-case": "^5.4.4",
|
|
3397
3403
|
"chroma-js": "^3.1.2",
|
|
3404
|
+
"colorjs.io": "^0.6.0-alpha.1",
|
|
3398
3405
|
commander: "^13.1.0",
|
|
3399
3406
|
"fast-glob": "^3.3.3",
|
|
3400
3407
|
hsluv: "^1.0.1",
|
|
3401
3408
|
"object-hash": "^3.0.0",
|
|
3402
3409
|
postcss: "^8.5.3",
|
|
3403
3410
|
ramda: "^0.30.1",
|
|
3404
|
-
"style-dictionary": "^4.
|
|
3405
|
-
zod: "^3.
|
|
3406
|
-
"zod-validation-error": "^3.4.
|
|
3411
|
+
"style-dictionary": "^4.4.0",
|
|
3412
|
+
zod: "^3.25.30",
|
|
3413
|
+
"zod-validation-error": "^3.4.1"
|
|
3407
3414
|
},
|
|
3408
3415
|
devDependencies: {
|
|
3416
|
+
"@tokens-studio/types": "0.5.2",
|
|
3409
3417
|
"@types/apca-w3": "^0.1.3",
|
|
3410
3418
|
"@types/chroma-js": "^3.1.1",
|
|
3411
3419
|
"@types/fs-extra": "^11.0.4",
|
|
3412
3420
|
"@types/glob": "^8.1.0",
|
|
3413
3421
|
"@types/jscodeshift": "^0.12.0",
|
|
3414
|
-
"@types/node": "^22.
|
|
3422
|
+
"@types/node": "^22.15.21",
|
|
3415
3423
|
"@types/object-hash": "^3.0.6",
|
|
3416
3424
|
"@types/ramda": "^0.30.2",
|
|
3417
3425
|
"fs-extra": "^11.3.0",
|
|
3418
3426
|
"ts-toolbelt": "^9.6.0",
|
|
3419
3427
|
tslib: "^2.8.1",
|
|
3420
|
-
tsup: "^8.
|
|
3421
|
-
tsx: "^4.19.
|
|
3422
|
-
typescript: "^5.8.
|
|
3423
|
-
"zod-to-json-schema": "^3.24.5"
|
|
3428
|
+
tsup: "^8.5.0",
|
|
3429
|
+
tsx: "^4.19.4",
|
|
3430
|
+
typescript: "^5.8.3"
|
|
3424
3431
|
}
|
|
3425
3432
|
};
|
|
3426
3433
|
|
|
@@ -3474,9 +3481,6 @@ order may change due to nondeterminism.`.trim()
|
|
|
3474
3481
|
return sortIndex;
|
|
3475
3482
|
});
|
|
3476
3483
|
const header = `@charset "UTF-8";
|
|
3477
|
-
|
|
3478
|
-
@layer ds.theme, ds.base, ds.utilities, ds.components;
|
|
3479
|
-
|
|
3480
3484
|
/*
|
|
3481
3485
|
${fileHeader2}
|
|
3482
3486
|
*/
|