@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.
- package/LICENSE +7 -0
- package/dist/bin/designsystemet.js +49 -42
- 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.js +1 -0
- package/dist/src/index.js +80 -42
- package/dist/src/scripts/createJsonSchema.js +39 -38
- package/dist/src/tokens/build.js +48 -42
- package/dist/src/tokens/create/generators/$designsystemet.js +22 -20
- 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 +32 -30
- package/dist/src/tokens/create.js +1 -0
- package/dist/src/tokens/format.js +49 -42
- package/dist/src/tokens/index.js +49 -42
- 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.js +22 -20
- 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/package.json +31 -29
package/dist/src/tokens/build.js
CHANGED
|
@@ -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.
|
|
55
|
+
version: "1.0.6",
|
|
56
56
|
description: "CLI for Designsystemet",
|
|
57
57
|
author: "Designsystemet team",
|
|
58
58
|
engines: {
|
|
59
|
-
node: ">=22.
|
|
59
|
+
node: ">=22.15.0"
|
|
60
60
|
},
|
|
61
61
|
repository: {
|
|
62
62
|
type: "git",
|
|
@@ -86,56 +86,58 @@ var package_default = {
|
|
|
86
86
|
},
|
|
87
87
|
scripts: {
|
|
88
88
|
designsystemet: "tsx ./bin/designsystemet.ts",
|
|
89
|
-
"build:tokens": "
|
|
89
|
+
"build:tokens": "pnpm run designsystemet tokens build -p -t ../../design-tokens -o ../../packages/theme/brand --clean",
|
|
90
90
|
"build:tokens:debug": "tsx --inspect-brk ./bin/designsystemet.ts tokens build -p -t ../../design-tokens -o ../../packages/theme/brand --clean",
|
|
91
|
-
build: "tsup &&
|
|
91
|
+
build: "tsup && pnpm build:types && pnpm build:json-schema",
|
|
92
92
|
"build:types": "tsc --emitDeclarationOnly --declaration",
|
|
93
93
|
"build:json-schema": "tsx ./src/scripts/createJsonSchema.ts",
|
|
94
94
|
types: "tsc --noEmit",
|
|
95
|
-
"test:tokens-create-options":
|
|
96
|
-
"test:tokens-create-config": "
|
|
97
|
-
"test:tokens-build": "
|
|
98
|
-
"test:tokens-build-config": "
|
|
99
|
-
"test:tokens-create-and-build-options": "
|
|
100
|
-
"test:tokens-create-and-build-config": "
|
|
101
|
-
test: "
|
|
102
|
-
"internal:tokens-create": "
|
|
95
|
+
"test:tokens-create-options": 'pnpm run designsystemet tokens create -m dominant:"#007682" -n "#003333" -b 99 -o ./test-tokens/options --theme options --clean',
|
|
96
|
+
"test:tokens-create-config": "pnpm run designsystemet tokens create --config ./test/test-tokens.config.json",
|
|
97
|
+
"test:tokens-build": "pnpm run designsystemet tokens build -t ./test-tokens/options -o ./test-tokens/options-build --clean",
|
|
98
|
+
"test:tokens-build-config": "pnpm run designsystemet tokens build -t ./test-tokens/config -o ./test-tokens/config-build --clean",
|
|
99
|
+
"test:tokens-create-and-build-options": "pnpm test:tokens-create-options && pnpm test:tokens-build",
|
|
100
|
+
"test:tokens-create-and-build-config": "pnpm test:tokens-create-config && pnpm test:tokens-build-config",
|
|
101
|
+
test: "pnpm test:tokens-create-and-build-options && pnpm test:tokens-create-and-build-config",
|
|
102
|
+
"internal:tokens-create": "pnpm run designsystemet tokens create --config ./internal.config.json",
|
|
103
103
|
"update:template": "tsx ./src/scripts/update-template.ts",
|
|
104
|
-
"update:design-tokens": "
|
|
105
|
-
verify: "
|
|
104
|
+
"update:design-tokens": "pnpm internal:tokens-create && tsx ./src/scripts/update-design-tokens.ts",
|
|
105
|
+
verify: "pnpm test && pnpm update:template && pnpm update:design-tokens"
|
|
106
106
|
},
|
|
107
107
|
dependencies: {
|
|
108
108
|
"@commander-js/extra-typings": "^13.1.0",
|
|
109
|
-
"@tokens-studio/sd-transforms": "1.
|
|
109
|
+
"@tokens-studio/sd-transforms": "1.3.0",
|
|
110
110
|
"apca-w3": "^0.1.9",
|
|
111
111
|
chalk: "^5.4.1",
|
|
112
112
|
"change-case": "^5.4.4",
|
|
113
113
|
"chroma-js": "^3.1.2",
|
|
114
|
+
"colorjs.io": "^0.6.0-alpha.1",
|
|
114
115
|
commander: "^13.1.0",
|
|
115
116
|
"fast-glob": "^3.3.3",
|
|
116
117
|
hsluv: "^1.0.1",
|
|
117
118
|
"object-hash": "^3.0.0",
|
|
118
119
|
postcss: "^8.5.3",
|
|
119
120
|
ramda: "^0.30.1",
|
|
120
|
-
"style-dictionary": "^4.
|
|
121
|
-
zod: "^3.24.
|
|
121
|
+
"style-dictionary": "^4.4.0",
|
|
122
|
+
zod: "^3.24.4",
|
|
122
123
|
"zod-validation-error": "^3.4.0"
|
|
123
124
|
},
|
|
124
125
|
devDependencies: {
|
|
126
|
+
"@tokens-studio/types": "0.5.2",
|
|
125
127
|
"@types/apca-w3": "^0.1.3",
|
|
126
128
|
"@types/chroma-js": "^3.1.1",
|
|
127
129
|
"@types/fs-extra": "^11.0.4",
|
|
128
130
|
"@types/glob": "^8.1.0",
|
|
129
131
|
"@types/jscodeshift": "^0.12.0",
|
|
130
|
-
"@types/node": "^22.
|
|
132
|
+
"@types/node": "^22.15.3",
|
|
131
133
|
"@types/object-hash": "^3.0.6",
|
|
132
134
|
"@types/ramda": "^0.30.2",
|
|
133
135
|
"fs-extra": "^11.3.0",
|
|
134
136
|
"ts-toolbelt": "^9.6.0",
|
|
135
137
|
tslib: "^2.8.1",
|
|
136
138
|
tsup: "^8.4.0",
|
|
137
|
-
tsx: "^4.19.
|
|
138
|
-
typescript: "^5.8.
|
|
139
|
+
tsx: "^4.19.4",
|
|
140
|
+
typescript: "^5.8.3",
|
|
139
141
|
"zod-to-json-schema": "^3.24.5"
|
|
140
142
|
}
|
|
141
143
|
};
|
|
@@ -236,20 +238,24 @@ var mapToLowerCase = R2.map(R2.toLower);
|
|
|
236
238
|
var hasAnyTruth = R2.any(R2.equals(true));
|
|
237
239
|
var getType = (token) => (token.$type ?? token.type) || "";
|
|
238
240
|
var getValue = (token) => token.$value ?? token.value;
|
|
239
|
-
var typeEquals = R2.curry(
|
|
240
|
-
|
|
241
|
-
|
|
241
|
+
var typeEquals = R2.curry(
|
|
242
|
+
(types, token) => {
|
|
243
|
+
if (R2.isNil(token)) {
|
|
244
|
+
return false;
|
|
245
|
+
}
|
|
246
|
+
return R2.includes(R2.toLower(getType(token)), R2.map(R2.toLower, Array.isArray(types) ? types : [types]));
|
|
242
247
|
}
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
+
);
|
|
249
|
+
var pathStartsWithOneOf = R2.curry(
|
|
250
|
+
(paths, token) => {
|
|
251
|
+
if (R2.isNil(token)) {
|
|
252
|
+
return false;
|
|
253
|
+
}
|
|
254
|
+
const tokenPath = mapToLowerCase(token.path);
|
|
255
|
+
const matchPathsStartingWith = R2.map((path2) => R2.startsWith([path2], tokenPath), mapToLowerCase(paths));
|
|
256
|
+
return hasAnyTruth(matchPathsStartingWith);
|
|
248
257
|
}
|
|
249
|
-
|
|
250
|
-
const matchPathsStartingWith = R2.map((path2) => R2.startsWith([path2], tokenPath), mapToLowerCase(paths));
|
|
251
|
-
return hasAnyTruth(matchPathsStartingWith);
|
|
252
|
-
});
|
|
258
|
+
);
|
|
253
259
|
function isSemanticToken(token) {
|
|
254
260
|
return token.filePath.includes("semantic/");
|
|
255
261
|
}
|
|
@@ -805,14 +811,14 @@ var typographyVariables = ({ theme, typography: typography2 }) => {
|
|
|
805
811
|
};
|
|
806
812
|
};
|
|
807
813
|
|
|
808
|
-
// ../../node_modules/@tokens-studio/types/dist/constants/BoxShadowTypes.js
|
|
814
|
+
// ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/BoxShadowTypes.js
|
|
809
815
|
var BoxShadowTypes;
|
|
810
816
|
(function(BoxShadowTypes2) {
|
|
811
817
|
BoxShadowTypes2["DROP_SHADOW"] = "dropShadow";
|
|
812
818
|
BoxShadowTypes2["INNER_SHADOW"] = "innerShadow";
|
|
813
819
|
})(BoxShadowTypes || (BoxShadowTypes = {}));
|
|
814
820
|
|
|
815
|
-
// ../../node_modules/@tokens-studio/types/dist/constants/ColorModifierTypes.js
|
|
821
|
+
// ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/ColorModifierTypes.js
|
|
816
822
|
var ColorModifierTypes;
|
|
817
823
|
(function(ColorModifierTypes2) {
|
|
818
824
|
ColorModifierTypes2["LIGHTEN"] = "lighten";
|
|
@@ -821,7 +827,7 @@ var ColorModifierTypes;
|
|
|
821
827
|
ColorModifierTypes2["ALPHA"] = "alpha";
|
|
822
828
|
})(ColorModifierTypes || (ColorModifierTypes = {}));
|
|
823
829
|
|
|
824
|
-
// ../../node_modules/@tokens-studio/types/dist/constants/ColorSpaceTypes.js
|
|
830
|
+
// ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/ColorSpaceTypes.js
|
|
825
831
|
var ColorSpaceTypes;
|
|
826
832
|
(function(ColorSpaceTypes2) {
|
|
827
833
|
ColorSpaceTypes2["LCH"] = "lch";
|
|
@@ -830,7 +836,7 @@ var ColorSpaceTypes;
|
|
|
830
836
|
ColorSpaceTypes2["HSL"] = "hsl";
|
|
831
837
|
})(ColorSpaceTypes || (ColorSpaceTypes = {}));
|
|
832
838
|
|
|
833
|
-
// ../../node_modules/@tokens-studio/types/dist/constants/Properties.js
|
|
839
|
+
// ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/Properties.js
|
|
834
840
|
var Properties;
|
|
835
841
|
(function(Properties2) {
|
|
836
842
|
Properties2["sizing"] = "sizing";
|
|
@@ -882,7 +888,7 @@ var Properties;
|
|
|
882
888
|
Properties2["description"] = "description";
|
|
883
889
|
})(Properties || (Properties = {}));
|
|
884
890
|
|
|
885
|
-
// ../../node_modules/@tokens-studio/types/dist/constants/TokenSetStatus.js
|
|
891
|
+
// ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/TokenSetStatus.js
|
|
886
892
|
var TokenSetStatus;
|
|
887
893
|
(function(TokenSetStatus2) {
|
|
888
894
|
TokenSetStatus2["DISABLED"] = "disabled";
|
|
@@ -890,7 +896,7 @@ var TokenSetStatus;
|
|
|
890
896
|
TokenSetStatus2["ENABLED"] = "enabled";
|
|
891
897
|
})(TokenSetStatus || (TokenSetStatus = {}));
|
|
892
898
|
|
|
893
|
-
// ../../node_modules/@tokens-studio/types/dist/constants/TokenTypes.js
|
|
899
|
+
// ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/TokenTypes.js
|
|
894
900
|
var TokenTypes;
|
|
895
901
|
(function(TokenTypes2) {
|
|
896
902
|
TokenTypes2["OTHER"] = "other";
|
|
@@ -921,7 +927,7 @@ var TokenTypes;
|
|
|
921
927
|
TokenTypes2["NUMBER"] = "number";
|
|
922
928
|
})(TokenTypes || (TokenTypes = {}));
|
|
923
929
|
|
|
924
|
-
// ../../node_modules/@tokens-studio/types/dist/constants/BorderValues.js
|
|
930
|
+
// ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/BorderValues.js
|
|
925
931
|
var BorderValues;
|
|
926
932
|
(function(BorderValues2) {
|
|
927
933
|
BorderValues2["BORDER_COLOR"] = "color";
|
|
@@ -929,7 +935,7 @@ var BorderValues;
|
|
|
929
935
|
BorderValues2["BORDER_STYLE"] = "style";
|
|
930
936
|
})(BorderValues || (BorderValues = {}));
|
|
931
937
|
|
|
932
|
-
// ../../node_modules/@tokens-studio/types/dist/constants/StrokeStyleValues.js
|
|
938
|
+
// ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/StrokeStyleValues.js
|
|
933
939
|
var StrokeStyleValues;
|
|
934
940
|
(function(StrokeStyleValues2) {
|
|
935
941
|
StrokeStyleValues2["SOLID"] = "solid";
|
|
@@ -942,7 +948,7 @@ var StrokeStyleValues;
|
|
|
942
948
|
StrokeStyleValues2["INSET"] = "inset";
|
|
943
949
|
})(StrokeStyleValues || (StrokeStyleValues = {}));
|
|
944
950
|
|
|
945
|
-
// ../../node_modules/@tokens-studio/types/dist/constants/BoxShadowValues.js
|
|
951
|
+
// ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/BoxShadowValues.js
|
|
946
952
|
var BoxShadowValues;
|
|
947
953
|
(function(BoxShadowValues2) {
|
|
948
954
|
BoxShadowValues2["TYPE"] = "type";
|
|
@@ -954,7 +960,7 @@ var BoxShadowValues;
|
|
|
954
960
|
BoxShadowValues2["BLEND_MODE"] = "blendMode";
|
|
955
961
|
})(BoxShadowValues || (BoxShadowValues = {}));
|
|
956
962
|
|
|
957
|
-
// ../../node_modules/@tokens-studio/types/dist/constants/TypographyValues.js
|
|
963
|
+
// ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/TypographyValues.js
|
|
958
964
|
var TypographyValues;
|
|
959
965
|
(function(TypographyValues2) {
|
|
960
966
|
TypographyValues2["FONT_FAMILY"] = "fontFamily";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// package.json
|
|
2
2
|
var package_default = {
|
|
3
3
|
name: "@digdir/designsystemet",
|
|
4
|
-
version: "1.0.
|
|
4
|
+
version: "1.0.6",
|
|
5
5
|
description: "CLI for Designsystemet",
|
|
6
6
|
author: "Designsystemet team",
|
|
7
7
|
engines: {
|
|
8
|
-
node: ">=22.
|
|
8
|
+
node: ">=22.15.0"
|
|
9
9
|
},
|
|
10
10
|
repository: {
|
|
11
11
|
type: "git",
|
|
@@ -35,56 +35,58 @@ var package_default = {
|
|
|
35
35
|
},
|
|
36
36
|
scripts: {
|
|
37
37
|
designsystemet: "tsx ./bin/designsystemet.ts",
|
|
38
|
-
"build:tokens": "
|
|
38
|
+
"build:tokens": "pnpm run designsystemet tokens build -p -t ../../design-tokens -o ../../packages/theme/brand --clean",
|
|
39
39
|
"build:tokens:debug": "tsx --inspect-brk ./bin/designsystemet.ts tokens build -p -t ../../design-tokens -o ../../packages/theme/brand --clean",
|
|
40
|
-
build: "tsup &&
|
|
40
|
+
build: "tsup && pnpm build:types && pnpm build:json-schema",
|
|
41
41
|
"build:types": "tsc --emitDeclarationOnly --declaration",
|
|
42
42
|
"build:json-schema": "tsx ./src/scripts/createJsonSchema.ts",
|
|
43
43
|
types: "tsc --noEmit",
|
|
44
|
-
"test:tokens-create-options":
|
|
45
|
-
"test:tokens-create-config": "
|
|
46
|
-
"test:tokens-build": "
|
|
47
|
-
"test:tokens-build-config": "
|
|
48
|
-
"test:tokens-create-and-build-options": "
|
|
49
|
-
"test:tokens-create-and-build-config": "
|
|
50
|
-
test: "
|
|
51
|
-
"internal:tokens-create": "
|
|
44
|
+
"test:tokens-create-options": 'pnpm run designsystemet tokens create -m dominant:"#007682" -n "#003333" -b 99 -o ./test-tokens/options --theme options --clean',
|
|
45
|
+
"test:tokens-create-config": "pnpm run designsystemet tokens create --config ./test/test-tokens.config.json",
|
|
46
|
+
"test:tokens-build": "pnpm run designsystemet tokens build -t ./test-tokens/options -o ./test-tokens/options-build --clean",
|
|
47
|
+
"test:tokens-build-config": "pnpm run designsystemet tokens build -t ./test-tokens/config -o ./test-tokens/config-build --clean",
|
|
48
|
+
"test:tokens-create-and-build-options": "pnpm test:tokens-create-options && pnpm test:tokens-build",
|
|
49
|
+
"test:tokens-create-and-build-config": "pnpm test:tokens-create-config && pnpm test:tokens-build-config",
|
|
50
|
+
test: "pnpm test:tokens-create-and-build-options && pnpm test:tokens-create-and-build-config",
|
|
51
|
+
"internal:tokens-create": "pnpm run designsystemet tokens create --config ./internal.config.json",
|
|
52
52
|
"update:template": "tsx ./src/scripts/update-template.ts",
|
|
53
|
-
"update:design-tokens": "
|
|
54
|
-
verify: "
|
|
53
|
+
"update:design-tokens": "pnpm internal:tokens-create && tsx ./src/scripts/update-design-tokens.ts",
|
|
54
|
+
verify: "pnpm test && pnpm update:template && pnpm update:design-tokens"
|
|
55
55
|
},
|
|
56
56
|
dependencies: {
|
|
57
57
|
"@commander-js/extra-typings": "^13.1.0",
|
|
58
|
-
"@tokens-studio/sd-transforms": "1.
|
|
58
|
+
"@tokens-studio/sd-transforms": "1.3.0",
|
|
59
59
|
"apca-w3": "^0.1.9",
|
|
60
60
|
chalk: "^5.4.1",
|
|
61
61
|
"change-case": "^5.4.4",
|
|
62
62
|
"chroma-js": "^3.1.2",
|
|
63
|
+
"colorjs.io": "^0.6.0-alpha.1",
|
|
63
64
|
commander: "^13.1.0",
|
|
64
65
|
"fast-glob": "^3.3.3",
|
|
65
66
|
hsluv: "^1.0.1",
|
|
66
67
|
"object-hash": "^3.0.0",
|
|
67
68
|
postcss: "^8.5.3",
|
|
68
69
|
ramda: "^0.30.1",
|
|
69
|
-
"style-dictionary": "^4.
|
|
70
|
-
zod: "^3.24.
|
|
70
|
+
"style-dictionary": "^4.4.0",
|
|
71
|
+
zod: "^3.24.4",
|
|
71
72
|
"zod-validation-error": "^3.4.0"
|
|
72
73
|
},
|
|
73
74
|
devDependencies: {
|
|
75
|
+
"@tokens-studio/types": "0.5.2",
|
|
74
76
|
"@types/apca-w3": "^0.1.3",
|
|
75
77
|
"@types/chroma-js": "^3.1.1",
|
|
76
78
|
"@types/fs-extra": "^11.0.4",
|
|
77
79
|
"@types/glob": "^8.1.0",
|
|
78
80
|
"@types/jscodeshift": "^0.12.0",
|
|
79
|
-
"@types/node": "^22.
|
|
81
|
+
"@types/node": "^22.15.3",
|
|
80
82
|
"@types/object-hash": "^3.0.6",
|
|
81
83
|
"@types/ramda": "^0.30.2",
|
|
82
84
|
"fs-extra": "^11.3.0",
|
|
83
85
|
"ts-toolbelt": "^9.6.0",
|
|
84
86
|
tslib: "^2.8.1",
|
|
85
87
|
tsup: "^8.4.0",
|
|
86
|
-
tsx: "^4.19.
|
|
87
|
-
typescript: "^5.8.
|
|
88
|
+
tsx: "^4.19.4",
|
|
89
|
+
typescript: "^5.8.3",
|
|
88
90
|
"zod-to-json-schema": "^3.24.5"
|
|
89
91
|
}
|
|
90
92
|
};
|
|
@@ -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";
|
|
@@ -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.6",
|
|
43
43
|
description: "CLI for Designsystemet",
|
|
44
44
|
author: "Designsystemet team",
|
|
45
45
|
engines: {
|
|
46
|
-
node: ">=22.
|
|
46
|
+
node: ">=22.15.0"
|
|
47
47
|
},
|
|
48
48
|
repository: {
|
|
49
49
|
type: "git",
|
|
@@ -73,56 +73,58 @@ var package_default = {
|
|
|
73
73
|
},
|
|
74
74
|
scripts: {
|
|
75
75
|
designsystemet: "tsx ./bin/designsystemet.ts",
|
|
76
|
-
"build:tokens": "
|
|
76
|
+
"build:tokens": "pnpm run designsystemet tokens build -p -t ../../design-tokens -o ../../packages/theme/brand --clean",
|
|
77
77
|
"build:tokens:debug": "tsx --inspect-brk ./bin/designsystemet.ts tokens build -p -t ../../design-tokens -o ../../packages/theme/brand --clean",
|
|
78
|
-
build: "tsup &&
|
|
78
|
+
build: "tsup && pnpm build:types && pnpm build:json-schema",
|
|
79
79
|
"build:types": "tsc --emitDeclarationOnly --declaration",
|
|
80
80
|
"build:json-schema": "tsx ./src/scripts/createJsonSchema.ts",
|
|
81
81
|
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
|
-
"internal:tokens-create": "
|
|
82
|
+
"test:tokens-create-options": 'pnpm run designsystemet tokens create -m dominant:"#007682" -n "#003333" -b 99 -o ./test-tokens/options --theme options --clean',
|
|
83
|
+
"test:tokens-create-config": "pnpm run designsystemet tokens create --config ./test/test-tokens.config.json",
|
|
84
|
+
"test:tokens-build": "pnpm run designsystemet tokens build -t ./test-tokens/options -o ./test-tokens/options-build --clean",
|
|
85
|
+
"test:tokens-build-config": "pnpm run designsystemet tokens build -t ./test-tokens/config -o ./test-tokens/config-build --clean",
|
|
86
|
+
"test:tokens-create-and-build-options": "pnpm test:tokens-create-options && pnpm test:tokens-build",
|
|
87
|
+
"test:tokens-create-and-build-config": "pnpm test:tokens-create-config && pnpm test:tokens-build-config",
|
|
88
|
+
test: "pnpm test:tokens-create-and-build-options && pnpm test:tokens-create-and-build-config",
|
|
89
|
+
"internal:tokens-create": "pnpm run designsystemet tokens create --config ./internal.config.json",
|
|
90
90
|
"update:template": "tsx ./src/scripts/update-template.ts",
|
|
91
|
-
"update:design-tokens": "
|
|
92
|
-
verify: "
|
|
91
|
+
"update:design-tokens": "pnpm internal:tokens-create && tsx ./src/scripts/update-design-tokens.ts",
|
|
92
|
+
verify: "pnpm test && pnpm update:template && pnpm update:design-tokens"
|
|
93
93
|
},
|
|
94
94
|
dependencies: {
|
|
95
95
|
"@commander-js/extra-typings": "^13.1.0",
|
|
96
|
-
"@tokens-studio/sd-transforms": "1.
|
|
96
|
+
"@tokens-studio/sd-transforms": "1.3.0",
|
|
97
97
|
"apca-w3": "^0.1.9",
|
|
98
98
|
chalk: "^5.4.1",
|
|
99
99
|
"change-case": "^5.4.4",
|
|
100
100
|
"chroma-js": "^3.1.2",
|
|
101
|
+
"colorjs.io": "^0.6.0-alpha.1",
|
|
101
102
|
commander: "^13.1.0",
|
|
102
103
|
"fast-glob": "^3.3.3",
|
|
103
104
|
hsluv: "^1.0.1",
|
|
104
105
|
"object-hash": "^3.0.0",
|
|
105
106
|
postcss: "^8.5.3",
|
|
106
107
|
ramda: "^0.30.1",
|
|
107
|
-
"style-dictionary": "^4.
|
|
108
|
-
zod: "^3.24.
|
|
108
|
+
"style-dictionary": "^4.4.0",
|
|
109
|
+
zod: "^3.24.4",
|
|
109
110
|
"zod-validation-error": "^3.4.0"
|
|
110
111
|
},
|
|
111
112
|
devDependencies: {
|
|
113
|
+
"@tokens-studio/types": "0.5.2",
|
|
112
114
|
"@types/apca-w3": "^0.1.3",
|
|
113
115
|
"@types/chroma-js": "^3.1.1",
|
|
114
116
|
"@types/fs-extra": "^11.0.4",
|
|
115
117
|
"@types/glob": "^8.1.0",
|
|
116
118
|
"@types/jscodeshift": "^0.12.0",
|
|
117
|
-
"@types/node": "^22.
|
|
119
|
+
"@types/node": "^22.15.3",
|
|
118
120
|
"@types/object-hash": "^3.0.6",
|
|
119
121
|
"@types/ramda": "^0.30.2",
|
|
120
122
|
"fs-extra": "^11.3.0",
|
|
121
123
|
"ts-toolbelt": "^9.6.0",
|
|
122
124
|
tslib: "^2.8.1",
|
|
123
125
|
tsup: "^8.4.0",
|
|
124
|
-
tsx: "^4.19.
|
|
125
|
-
typescript: "^5.8.
|
|
126
|
+
tsx: "^4.19.4",
|
|
127
|
+
typescript: "^5.8.3",
|
|
126
128
|
"zod-to-json-schema": "^3.24.5"
|
|
127
129
|
}
|
|
128
130
|
};
|
|
@@ -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";
|