@digdir/designsystemet 1.0.3 → 1.0.5
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/dist/bin/designsystemet.js +4287 -45
- package/dist/bin/options.js +5 -4
- package/dist/src/colors/colorMetadata.js +5 -4
- package/dist/src/colors/index.js +470 -4
- package/dist/src/colors/theme.js +286 -20
- package/dist/src/colors/utils.js +16 -15
- package/dist/{bin → src}/config.d.ts +46 -1
- package/dist/src/config.d.ts.map +1 -0
- package/dist/src/config.js +377 -0
- package/dist/src/index.js +3682 -2
- package/dist/src/migrations/beta-to-v1.js +85 -4
- package/dist/src/migrations/codemods/css/plugins.js +5 -4
- package/dist/src/migrations/codemods/css/run.d.ts.map +1 -1
- package/dist/src/migrations/codemods/css/run.js +18 -4
- package/dist/src/migrations/color-rename-next49.js +77 -6
- package/dist/src/migrations/index.d.ts +0 -1
- package/dist/src/migrations/index.d.ts.map +1 -1
- package/dist/src/migrations/index.js +461 -6
- package/dist/src/scripts/createJsonSchema.js +1608 -4
- package/dist/src/scripts/update-design-tokens.d.ts +2 -0
- package/dist/src/scripts/update-design-tokens.d.ts.map +1 -0
- package/dist/src/scripts/update-design-tokens.js +37 -0
- package/dist/src/{tokens/template.d.ts → scripts/update-template.d.ts} +1 -1
- package/dist/src/scripts/update-template.d.ts.map +1 -0
- package/dist/src/scripts/update-template.js +1200 -0
- package/dist/src/tokens/build.d.ts +2 -19
- package/dist/src/tokens/build.d.ts.map +1 -1
- package/dist/src/tokens/build.js +1268 -70
- package/dist/src/tokens/create/defaults.d.ts +7 -0
- package/dist/src/tokens/create/defaults.d.ts.map +1 -0
- package/dist/src/tokens/create/defaults.js +994 -0
- package/dist/src/tokens/create/generators/$designsystemet.d.ts +5 -0
- package/dist/src/tokens/create/generators/$designsystemet.d.ts.map +1 -0
- package/dist/src/tokens/create/generators/$designsystemet.js +101 -0
- package/dist/src/tokens/create/generators/$metadata.d.ts +8 -0
- package/dist/src/tokens/create/generators/$metadata.d.ts.map +1 -0
- package/dist/src/tokens/{write/generate$metadata.js → create/generators/$metadata.js} +3 -2
- package/dist/src/tokens/create/generators/$themes.d.ts +12 -0
- package/dist/src/tokens/create/generators/$themes.d.ts.map +1 -0
- package/dist/src/tokens/create/generators/$themes.js +333 -0
- package/dist/src/tokens/create/generators/color.d.ts +5 -0
- package/dist/src/tokens/create/generators/color.d.ts.map +1 -0
- package/dist/src/tokens/create/generators/color.js +374 -0
- package/dist/src/tokens/create/generators/semantic.d.ts +296 -0
- package/dist/src/tokens/create/generators/semantic.d.ts.map +1 -0
- package/dist/src/tokens/create/generators/semantic.js +483 -0
- package/dist/src/tokens/create/generators/theme.d.ts +3 -0
- package/dist/src/tokens/create/generators/theme.d.ts.map +1 -0
- package/dist/src/tokens/create/generators/theme.js +168 -0
- package/dist/src/tokens/create/generators/typography.d.ts +3 -0
- package/dist/src/tokens/create/generators/typography.d.ts.map +1 -0
- package/dist/src/tokens/create/generators/typography.js +33 -0
- package/dist/src/tokens/{write.d.ts → create/write.d.ts} +2 -2
- package/dist/src/tokens/create/write.d.ts.map +1 -0
- package/dist/src/tokens/create/write.js +547 -0
- package/dist/src/tokens/create.d.ts +4 -2
- package/dist/src/tokens/create.d.ts.map +1 -1
- package/dist/src/tokens/create.js +2049 -59
- package/dist/src/tokens/format.d.ts +15 -0
- package/dist/src/tokens/format.d.ts.map +1 -0
- package/dist/src/tokens/format.js +3529 -0
- package/dist/src/tokens/index.d.ts +1 -0
- package/dist/src/tokens/index.d.ts.map +1 -1
- package/dist/src/tokens/index.js +3542 -2
- package/dist/src/tokens/process/configs/color.d.ts +12 -0
- package/dist/src/tokens/process/configs/color.d.ts.map +1 -0
- package/dist/src/tokens/process/configs/color.js +823 -0
- package/dist/src/tokens/process/configs/semantic.d.ts +3 -0
- package/dist/src/tokens/process/configs/semantic.d.ts.map +1 -0
- package/dist/src/tokens/process/configs/semantic.js +367 -0
- package/dist/src/tokens/process/configs/shared.d.ts +10 -0
- package/dist/src/tokens/process/configs/shared.d.ts.map +1 -0
- package/dist/src/tokens/process/configs/shared.js +99 -0
- package/dist/src/tokens/process/configs/storefront.d.ts +3 -0
- package/dist/src/tokens/process/configs/storefront.d.ts.map +1 -0
- package/dist/src/tokens/process/configs/storefront.js +220 -0
- package/dist/src/tokens/process/configs/typography.d.ts +3 -0
- package/dist/src/tokens/process/configs/typography.d.ts.map +1 -0
- package/dist/src/tokens/process/configs/typography.js +369 -0
- package/dist/src/tokens/{build → process}/configs.d.ts +3 -11
- package/dist/src/tokens/process/configs.d.ts.map +1 -0
- package/dist/src/tokens/process/configs.js +976 -0
- package/dist/src/tokens/process/formats/css/color.d.ts +4 -0
- package/dist/src/tokens/process/formats/css/color.d.ts.map +1 -0
- package/dist/src/tokens/process/formats/css/color.js +128 -0
- package/dist/src/tokens/process/formats/css/semantic.d.ts +17 -0
- package/dist/src/tokens/process/formats/css/semantic.d.ts.map +1 -0
- package/dist/src/tokens/process/formats/css/semantic.js +109 -0
- package/dist/src/tokens/process/formats/css/typography.d.ts +3 -0
- package/dist/src/tokens/process/formats/css/typography.d.ts.map +1 -0
- package/dist/src/tokens/process/formats/css/typography.js +32 -0
- package/dist/src/tokens/process/formats/css.d.ts +8 -0
- package/dist/src/tokens/process/formats/css.d.ts.map +1 -0
- package/dist/src/tokens/{build → process}/formats/css.js +94 -57
- package/dist/src/tokens/process/formats/js-tokens.d.ts.map +1 -0
- package/dist/src/tokens/process/formats/js-tokens.js +109 -0
- package/dist/src/tokens/process/platform.d.ts +87 -0
- package/dist/src/tokens/process/platform.d.ts.map +1 -0
- package/dist/src/tokens/process/platform.js +1090 -0
- package/dist/src/tokens/process/theme.d.ts +27 -0
- package/dist/src/tokens/process/theme.d.ts.map +1 -0
- package/dist/src/tokens/process/theme.js +172 -0
- package/dist/src/tokens/process/transformers.d.ts.map +1 -0
- package/dist/src/tokens/{build → process}/transformers.js +29 -6
- package/dist/src/tokens/{build → process}/utils/getMultidimensionalThemes.d.ts +3 -3
- package/dist/src/tokens/process/utils/getMultidimensionalThemes.d.ts.map +1 -0
- package/dist/src/tokens/process/utils/getMultidimensionalThemes.js +922 -0
- package/dist/src/tokens/template/design-tokens/primitives/globals.js +5 -0
- package/dist/src/tokens/template/design-tokens/primitives/modes/size/global.js +5 -0
- package/dist/src/tokens/template/design-tokens/primitives/modes/size/large.js +5 -0
- package/dist/src/tokens/template/design-tokens/primitives/modes/size/medium.js +5 -0
- package/dist/src/tokens/template/design-tokens/primitives/modes/size/small.js +5 -0
- package/dist/src/tokens/template/design-tokens/primitives/modes/typography/size/large.js +5 -0
- package/dist/src/tokens/template/design-tokens/primitives/modes/typography/size/medium.js +5 -0
- package/dist/src/tokens/template/design-tokens/primitives/modes/typography/size/small.js +5 -0
- package/dist/src/tokens/template/design-tokens/primitives/modes/typography/typography.template.js +5 -0
- package/dist/src/tokens/template/design-tokens/semantic/color.base.template.js +5 -0
- package/dist/src/tokens/template/design-tokens/semantic/color.template.js +5 -0
- package/dist/src/tokens/template/design-tokens/semantic/modes/color.template.js +5 -0
- package/dist/src/tokens/template/design-tokens/semantic/style.js +5 -0
- package/dist/src/tokens/template/design-tokens/themes/theme.base.template.js +5 -0
- package/dist/src/tokens/template/design-tokens/themes/theme.template.js +5 -0
- package/dist/src/tokens/types.d.ts +58 -38
- package/dist/src/tokens/types.d.ts.map +1 -1
- package/dist/src/tokens/types.js +8 -0
- package/dist/src/tokens/utils.d.ts +30 -5
- package/dist/src/tokens/utils.d.ts.map +1 -1
- package/dist/src/tokens/utils.js +36 -50
- package/dist/src/utils.d.ts +18 -0
- package/dist/src/utils.d.ts.map +1 -0
- package/dist/src/utils.js +63 -0
- package/dist/typography.template-4N5YLH7F.json +22 -0
- package/package.json +22 -20
- package/dist/bin/config.d.ts.map +0 -1
- package/dist/bin/config.js +0 -71
- package/dist/src/migrations/codemods/jsx/classname-prefix.d.ts +0 -10
- package/dist/src/migrations/codemods/jsx/classname-prefix.d.ts.map +0 -1
- package/dist/src/migrations/codemods/jsx/classname-prefix.js +0 -64
- package/dist/src/migrations/codemods/jsx/run.d.ts +0 -7
- package/dist/src/migrations/codemods/jsx/run.d.ts.map +0 -1
- package/dist/src/migrations/codemods/jsx/run.js +0 -22
- package/dist/src/migrations/react-beta-to-v1.d.ts +0 -3
- package/dist/src/migrations/react-beta-to-v1.d.ts.map +0 -1
- package/dist/src/migrations/react-beta-to-v1.js +0 -5
- package/dist/src/scripts/copy-internal-tokens.d.ts +0 -2
- package/dist/src/scripts/copy-internal-tokens.d.ts.map +0 -1
- package/dist/src/scripts/copy-internal-tokens.js +0 -28
- package/dist/src/tokens/build/configs.d.ts.map +0 -1
- package/dist/src/tokens/build/configs.js +0 -280
- package/dist/src/tokens/build/formats/css.d.ts +0 -53
- package/dist/src/tokens/build/formats/css.d.ts.map +0 -1
- package/dist/src/tokens/build/formats/js-tokens.d.ts.map +0 -1
- package/dist/src/tokens/build/formats/js-tokens.js +0 -48
- package/dist/src/tokens/build/transformers.d.ts.map +0 -1
- package/dist/src/tokens/build/types.d.ts +0 -48
- package/dist/src/tokens/build/types.d.ts.map +0 -1
- package/dist/src/tokens/build/types.js +0 -7
- package/dist/src/tokens/build/utils/entryfile.d.ts +0 -12
- package/dist/src/tokens/build/utils/entryfile.d.ts.map +0 -1
- package/dist/src/tokens/build/utils/entryfile.js +0 -67
- package/dist/src/tokens/build/utils/getMultidimensionalThemes.d.ts.map +0 -1
- package/dist/src/tokens/build/utils/getMultidimensionalThemes.js +0 -112
- package/dist/src/tokens/design-tokens/template/$metadata.json +0 -25
- package/dist/src/tokens/design-tokens/template/$themes.json +0 -1498
- package/dist/src/tokens/template.d.ts.map +0 -1
- package/dist/src/tokens/template.js +0 -99
- package/dist/src/tokens/write/generate$metadata.d.ts +0 -9
- package/dist/src/tokens/write/generate$metadata.d.ts.map +0 -1
- package/dist/src/tokens/write/generate$themes.d.ts +0 -12
- package/dist/src/tokens/write/generate$themes.d.ts.map +0 -1
- package/dist/src/tokens/write/generate$themes.js +0 -161
- package/dist/src/tokens/write.d.ts.map +0 -1
- package/dist/src/tokens/write.js +0 -177
- /package/dist/{src/tokens/design-tokens/template/semantic/color-base-file.json → color.base.template-M7BHS4OV.json} +0 -0
- /package/dist/{src/tokens/design-tokens/template/semantic/modes/category-color/category-color-template.json → color.template-LMPUQ72A.json} +0 -0
- /package/dist/{src/tokens/design-tokens/template/semantic/semantic-color-template.json → color.template-XQNSHLTU.json} +0 -0
- /package/dist/{src/tokens/design-tokens/default/primitives/modes/size/global.json → global-XVXVBKM6.json} +0 -0
- /package/dist/{src/tokens/design-tokens/default/primitives/globals.json → globals-76VAFMDF.json} +0 -0
- /package/dist/{src/tokens/design-tokens/default/primitives/modes/typography/size/large.json → large-CIIHO7AY.json} +0 -0
- /package/dist/{src/tokens/design-tokens/default/primitives/modes/size/large.json → large-UUOZ6DYI.json} +0 -0
- /package/dist/{src/tokens/design-tokens/default/primitives/modes/size/medium.json → medium-OQ7S7P4P.json} +0 -0
- /package/dist/{src/tokens/design-tokens/default/primitives/modes/typography/size/medium.json → medium-VSB2S4X3.json} +0 -0
- /package/dist/{src/tokens/design-tokens/default/primitives/modes/typography/size/small.json → small-AEXJ6U7Z.json} +0 -0
- /package/dist/{src/tokens/design-tokens/default/primitives/modes/size/small.json → small-ZY4KOJWX.json} +0 -0
- /package/dist/src/tokens/{build → process}/formats/js-tokens.d.ts +0 -0
- /package/dist/src/tokens/{build → process}/transformers.d.ts +0 -0
- /package/dist/{src/tokens/design-tokens/default/semantic/style.json → style-FP5XVCUD.json} +0 -0
- /package/dist/{src/tokens/design-tokens/template/themes/theme-base-file.json → theme.base.template-Y4RMFBQY.json} +0 -0
- /package/dist/{src/tokens/design-tokens/template/themes/theme-color-template.json → theme.template-CTQRNOMO.json} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"$designsystemet.d.ts","sourceRoot":"","sources":["../../../../../src/tokens/create/generators/$designsystemet.ts"],"names":[],"mappings":"AAEA,wBAAgB,uBAAuB;;;EAKtC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
// package.json
|
|
2
|
+
var package_default = {
|
|
3
|
+
name: "@digdir/designsystemet",
|
|
4
|
+
version: "1.0.5",
|
|
5
|
+
description: "CLI for Designsystemet",
|
|
6
|
+
author: "Designsystemet team",
|
|
7
|
+
engines: {
|
|
8
|
+
node: ">=22.14.0"
|
|
9
|
+
},
|
|
10
|
+
repository: {
|
|
11
|
+
type: "git",
|
|
12
|
+
url: "git+https://github.com/digdir/designsystemet.git"
|
|
13
|
+
},
|
|
14
|
+
homepage: "https://github.com/digdir/designsystemet/tree/main/scripts/cli",
|
|
15
|
+
license: "MIT",
|
|
16
|
+
type: "module",
|
|
17
|
+
main: "./dist/src/index.js",
|
|
18
|
+
files: [
|
|
19
|
+
"./dist/**"
|
|
20
|
+
],
|
|
21
|
+
bin: "dist/bin/designsystemet.js",
|
|
22
|
+
exports: {
|
|
23
|
+
".": {
|
|
24
|
+
import: "./dist/src/index.js"
|
|
25
|
+
},
|
|
26
|
+
"./color": {
|
|
27
|
+
import: "./dist/src/colors/index.js"
|
|
28
|
+
},
|
|
29
|
+
"./tokens": {
|
|
30
|
+
import: "./dist/src/tokens/index.js"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
publishConfig: {
|
|
34
|
+
access: "public"
|
|
35
|
+
},
|
|
36
|
+
scripts: {
|
|
37
|
+
designsystemet: "tsx ./bin/designsystemet.ts",
|
|
38
|
+
"build:tokens": "yarn designsystemet tokens build -p -t ../../design-tokens -o ../../packages/theme/brand --clean",
|
|
39
|
+
"build:tokens:debug": "tsx --inspect-brk ./bin/designsystemet.ts tokens build -p -t ../../design-tokens -o ../../packages/theme/brand --clean",
|
|
40
|
+
build: "tsup && yarn build:types && yarn build:json-schema",
|
|
41
|
+
"build:types": "tsc --emitDeclarationOnly --declaration",
|
|
42
|
+
"build:json-schema": "tsx ./src/scripts/createJsonSchema.ts",
|
|
43
|
+
types: "tsc --noEmit",
|
|
44
|
+
"test:tokens-create-options": "yarn designsystemet tokens create -m dominant:#007682 -n #003333 -b 99 -o ./test-tokens/options --theme options --clean",
|
|
45
|
+
"test:tokens-create-config": "yarn designsystemet tokens create --config ./test/test-tokens.config.json",
|
|
46
|
+
"test:tokens-build": "yarn designsystemet tokens build -t ./test-tokens/options -o ./test-tokens/options-build --clean",
|
|
47
|
+
"test:tokens-build-config": "yarn designsystemet tokens build -t ./test-tokens/config -o ./test-tokens/config-build --clean",
|
|
48
|
+
"test:tokens-create-and-build-options": "yarn test:tokens-create-options && yarn test:tokens-build",
|
|
49
|
+
"test:tokens-create-and-build-config": "yarn test:tokens-create-config && yarn test:tokens-build-config",
|
|
50
|
+
test: "yarn test:tokens-create-and-build-options && yarn test:tokens-create-and-build-config",
|
|
51
|
+
"internal:tokens-create": "yarn designsystemet tokens create --config ./internal.config.json",
|
|
52
|
+
"update:template": "tsx ./src/scripts/update-template.ts",
|
|
53
|
+
"update:design-tokens": "yarn internal:tokens-create && tsx ./src/scripts/update-design-tokens.ts",
|
|
54
|
+
verify: "yarn test && yarn update:template && yarn update:design-tokens"
|
|
55
|
+
},
|
|
56
|
+
dependencies: {
|
|
57
|
+
"@commander-js/extra-typings": "^13.1.0",
|
|
58
|
+
"@tokens-studio/sd-transforms": "1.2.12",
|
|
59
|
+
"apca-w3": "^0.1.9",
|
|
60
|
+
chalk: "^5.4.1",
|
|
61
|
+
"change-case": "^5.4.4",
|
|
62
|
+
"chroma-js": "^3.1.2",
|
|
63
|
+
commander: "^13.1.0",
|
|
64
|
+
"fast-glob": "^3.3.3",
|
|
65
|
+
hsluv: "^1.0.1",
|
|
66
|
+
"object-hash": "^3.0.0",
|
|
67
|
+
postcss: "^8.5.3",
|
|
68
|
+
ramda: "^0.30.1",
|
|
69
|
+
"style-dictionary": "^4.3.3",
|
|
70
|
+
zod: "^3.24.2",
|
|
71
|
+
"zod-validation-error": "^3.4.0"
|
|
72
|
+
},
|
|
73
|
+
devDependencies: {
|
|
74
|
+
"@types/apca-w3": "^0.1.3",
|
|
75
|
+
"@types/chroma-js": "^3.1.1",
|
|
76
|
+
"@types/fs-extra": "^11.0.4",
|
|
77
|
+
"@types/glob": "^8.1.0",
|
|
78
|
+
"@types/jscodeshift": "^0.12.0",
|
|
79
|
+
"@types/node": "^22.14.0",
|
|
80
|
+
"@types/object-hash": "^3.0.6",
|
|
81
|
+
"@types/ramda": "^0.30.2",
|
|
82
|
+
"fs-extra": "^11.3.0",
|
|
83
|
+
"ts-toolbelt": "^9.6.0",
|
|
84
|
+
tslib: "^2.8.1",
|
|
85
|
+
tsup: "^8.4.0",
|
|
86
|
+
tsx: "^4.19.3",
|
|
87
|
+
typescript: "^5.8.2",
|
|
88
|
+
"zod-to-json-schema": "^3.24.5"
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
// src/tokens/create/generators/$designsystemet.ts
|
|
93
|
+
function generate$Designsystemet() {
|
|
94
|
+
return {
|
|
95
|
+
name: package_default.name,
|
|
96
|
+
version: package_default.version
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
export {
|
|
100
|
+
generate$Designsystemet
|
|
101
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ColorScheme } from '../../../colors/types.js';
|
|
2
|
+
import type { Colors } from '../../types.js';
|
|
3
|
+
type Metadata = {
|
|
4
|
+
tokenSetOrder: string[];
|
|
5
|
+
};
|
|
6
|
+
export declare function generate$Metadata(schemes: ColorScheme[], themes: string[], colors: Colors): Metadata;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=$metadata.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"$metadata.d.ts","sourceRoot":"","sources":["../../../../../src/tokens/create/generators/$metadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAE7C,KAAK,QAAQ,GAAG;IACd,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,WAAW,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,GAAG,QAAQ,CAwBpG"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
// src/tokens/create/generators/$metadata.ts
|
|
2
|
+
function generate$Metadata(schemes, themes, colors) {
|
|
2
3
|
return {
|
|
3
4
|
tokenSetOrder: [
|
|
4
5
|
"primitives/globals",
|
|
@@ -24,5 +25,5 @@ function generateMetadataJson(schemes, themes, colors) {
|
|
|
24
25
|
};
|
|
25
26
|
}
|
|
26
27
|
export {
|
|
27
|
-
|
|
28
|
+
generate$Metadata
|
|
28
29
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type ThemeObject } from '@tokens-studio/types';
|
|
2
|
+
import type { ColorScheme } from '../../../colors/types.js';
|
|
3
|
+
import type { Colors } from '../../types.js';
|
|
4
|
+
type ColorSchemes = Array<ColorScheme>;
|
|
5
|
+
type ThemeObject_ = ThemeObject & {
|
|
6
|
+
$figmaCollectionId?: string;
|
|
7
|
+
$figmaModeId?: string;
|
|
8
|
+
$figmaVariableReferences?: Record<string, string>;
|
|
9
|
+
};
|
|
10
|
+
export declare function generate$Themes(colorSchemes: ColorSchemes, themes: string[], colors: Colors): Promise<ThemeObject_[]>;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=$themes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"$themes.d.ts","sourceRoot":"","sources":["../../../../../src/tokens/create/generators/$themes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAkB,MAAM,sBAAsB,CAAC;AAExE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAW7C,KAAK,YAAY,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC;AAEvC,KAAK,YAAY,GAAG,WAAW,GAAG;IAChC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,wBAAwB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACnD,CAAC;AAEF,wBAAsB,eAAe,CACnC,YAAY,EAAE,YAAY,EAC1B,MAAM,EAAE,MAAM,EAAE,EAChB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,YAAY,EAAE,CAAC,CAUzB"}
|
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
// ../../node_modules/@tokens-studio/types/dist/constants/BoxShadowTypes.js
|
|
2
|
+
var BoxShadowTypes;
|
|
3
|
+
(function(BoxShadowTypes2) {
|
|
4
|
+
BoxShadowTypes2["DROP_SHADOW"] = "dropShadow";
|
|
5
|
+
BoxShadowTypes2["INNER_SHADOW"] = "innerShadow";
|
|
6
|
+
})(BoxShadowTypes || (BoxShadowTypes = {}));
|
|
7
|
+
|
|
8
|
+
// ../../node_modules/@tokens-studio/types/dist/constants/ColorModifierTypes.js
|
|
9
|
+
var ColorModifierTypes;
|
|
10
|
+
(function(ColorModifierTypes2) {
|
|
11
|
+
ColorModifierTypes2["LIGHTEN"] = "lighten";
|
|
12
|
+
ColorModifierTypes2["DARKEN"] = "darken";
|
|
13
|
+
ColorModifierTypes2["MIX"] = "mix";
|
|
14
|
+
ColorModifierTypes2["ALPHA"] = "alpha";
|
|
15
|
+
})(ColorModifierTypes || (ColorModifierTypes = {}));
|
|
16
|
+
|
|
17
|
+
// ../../node_modules/@tokens-studio/types/dist/constants/ColorSpaceTypes.js
|
|
18
|
+
var ColorSpaceTypes;
|
|
19
|
+
(function(ColorSpaceTypes2) {
|
|
20
|
+
ColorSpaceTypes2["LCH"] = "lch";
|
|
21
|
+
ColorSpaceTypes2["SRGB"] = "srgb";
|
|
22
|
+
ColorSpaceTypes2["P3"] = "p3";
|
|
23
|
+
ColorSpaceTypes2["HSL"] = "hsl";
|
|
24
|
+
})(ColorSpaceTypes || (ColorSpaceTypes = {}));
|
|
25
|
+
|
|
26
|
+
// ../../node_modules/@tokens-studio/types/dist/constants/Properties.js
|
|
27
|
+
var Properties;
|
|
28
|
+
(function(Properties2) {
|
|
29
|
+
Properties2["sizing"] = "sizing";
|
|
30
|
+
Properties2["height"] = "height";
|
|
31
|
+
Properties2["width"] = "width";
|
|
32
|
+
Properties2["spacing"] = "spacing";
|
|
33
|
+
Properties2["verticalPadding"] = "verticalPadding";
|
|
34
|
+
Properties2["horizontalPadding"] = "horizontalPadding";
|
|
35
|
+
Properties2["paddingTop"] = "paddingTop";
|
|
36
|
+
Properties2["paddingRight"] = "paddingRight";
|
|
37
|
+
Properties2["paddingBottom"] = "paddingBottom";
|
|
38
|
+
Properties2["paddingLeft"] = "paddingLeft";
|
|
39
|
+
Properties2["itemSpacing"] = "itemSpacing";
|
|
40
|
+
Properties2["fill"] = "fill";
|
|
41
|
+
Properties2["backgroundBlur"] = "backgroundBlur";
|
|
42
|
+
Properties2["border"] = "border";
|
|
43
|
+
Properties2["borderTop"] = "borderTop";
|
|
44
|
+
Properties2["borderRight"] = "borderRight";
|
|
45
|
+
Properties2["borderBottom"] = "borderBottom";
|
|
46
|
+
Properties2["borderLeft"] = "borderLeft";
|
|
47
|
+
Properties2["borderColor"] = "borderColor";
|
|
48
|
+
Properties2["borderRadius"] = "borderRadius";
|
|
49
|
+
Properties2["borderRadiusTopLeft"] = "borderRadiusTopLeft";
|
|
50
|
+
Properties2["borderRadiusTopRight"] = "borderRadiusTopRight";
|
|
51
|
+
Properties2["borderRadiusBottomRight"] = "borderRadiusBottomRight";
|
|
52
|
+
Properties2["borderRadiusBottomLeft"] = "borderRadiusBottomLeft";
|
|
53
|
+
Properties2["borderWidth"] = "borderWidth";
|
|
54
|
+
Properties2["borderWidthTop"] = "borderWidthTop";
|
|
55
|
+
Properties2["borderWidthRight"] = "borderWidthRight";
|
|
56
|
+
Properties2["borderWidthBottom"] = "borderWidthBottom";
|
|
57
|
+
Properties2["borderWidthLeft"] = "borderWidthLeft";
|
|
58
|
+
Properties2["boxShadow"] = "boxShadow";
|
|
59
|
+
Properties2["opacity"] = "opacity";
|
|
60
|
+
Properties2["fontFamilies"] = "fontFamilies";
|
|
61
|
+
Properties2["fontWeights"] = "fontWeights";
|
|
62
|
+
Properties2["fontSizes"] = "fontSizes";
|
|
63
|
+
Properties2["lineHeights"] = "lineHeights";
|
|
64
|
+
Properties2["typography"] = "typography";
|
|
65
|
+
Properties2["composition"] = "composition";
|
|
66
|
+
Properties2["letterSpacing"] = "letterSpacing";
|
|
67
|
+
Properties2["paragraphSpacing"] = "paragraphSpacing";
|
|
68
|
+
Properties2["textCase"] = "textCase";
|
|
69
|
+
Properties2["dimension"] = "dimension";
|
|
70
|
+
Properties2["textDecoration"] = "textDecoration";
|
|
71
|
+
Properties2["asset"] = "asset";
|
|
72
|
+
Properties2["tokenValue"] = "tokenValue";
|
|
73
|
+
Properties2["value"] = "value";
|
|
74
|
+
Properties2["tokenName"] = "tokenName";
|
|
75
|
+
Properties2["description"] = "description";
|
|
76
|
+
})(Properties || (Properties = {}));
|
|
77
|
+
|
|
78
|
+
// ../../node_modules/@tokens-studio/types/dist/constants/TokenSetStatus.js
|
|
79
|
+
var TokenSetStatus;
|
|
80
|
+
(function(TokenSetStatus2) {
|
|
81
|
+
TokenSetStatus2["DISABLED"] = "disabled";
|
|
82
|
+
TokenSetStatus2["SOURCE"] = "source";
|
|
83
|
+
TokenSetStatus2["ENABLED"] = "enabled";
|
|
84
|
+
})(TokenSetStatus || (TokenSetStatus = {}));
|
|
85
|
+
|
|
86
|
+
// ../../node_modules/@tokens-studio/types/dist/constants/TokenTypes.js
|
|
87
|
+
var TokenTypes;
|
|
88
|
+
(function(TokenTypes2) {
|
|
89
|
+
TokenTypes2["OTHER"] = "other";
|
|
90
|
+
TokenTypes2["COLOR"] = "color";
|
|
91
|
+
TokenTypes2["BORDER_RADIUS"] = "borderRadius";
|
|
92
|
+
TokenTypes2["SIZING"] = "sizing";
|
|
93
|
+
TokenTypes2["SPACING"] = "spacing";
|
|
94
|
+
TokenTypes2["TEXT"] = "text";
|
|
95
|
+
TokenTypes2["TYPOGRAPHY"] = "typography";
|
|
96
|
+
TokenTypes2["OPACITY"] = "opacity";
|
|
97
|
+
TokenTypes2["BORDER_WIDTH"] = "borderWidth";
|
|
98
|
+
TokenTypes2["STROKE_STYLE"] = "strokeStyle";
|
|
99
|
+
TokenTypes2["BOX_SHADOW"] = "boxShadow";
|
|
100
|
+
TokenTypes2["FONT_FAMILIES"] = "fontFamilies";
|
|
101
|
+
TokenTypes2["FONT_WEIGHTS"] = "fontWeights";
|
|
102
|
+
TokenTypes2["LINE_HEIGHTS"] = "lineHeights";
|
|
103
|
+
TokenTypes2["FONT_SIZES"] = "fontSizes";
|
|
104
|
+
TokenTypes2["LETTER_SPACING"] = "letterSpacing";
|
|
105
|
+
TokenTypes2["PARAGRAPH_SPACING"] = "paragraphSpacing";
|
|
106
|
+
TokenTypes2["PARAGRAPH_INDENT"] = "paragraphIndent";
|
|
107
|
+
TokenTypes2["TEXT_DECORATION"] = "textDecoration";
|
|
108
|
+
TokenTypes2["TEXT_CASE"] = "textCase";
|
|
109
|
+
TokenTypes2["COMPOSITION"] = "composition";
|
|
110
|
+
TokenTypes2["DIMENSION"] = "dimension";
|
|
111
|
+
TokenTypes2["BORDER"] = "border";
|
|
112
|
+
TokenTypes2["ASSET"] = "asset";
|
|
113
|
+
TokenTypes2["BOOLEAN"] = "boolean";
|
|
114
|
+
TokenTypes2["NUMBER"] = "number";
|
|
115
|
+
})(TokenTypes || (TokenTypes = {}));
|
|
116
|
+
|
|
117
|
+
// ../../node_modules/@tokens-studio/types/dist/constants/BorderValues.js
|
|
118
|
+
var BorderValues;
|
|
119
|
+
(function(BorderValues2) {
|
|
120
|
+
BorderValues2["BORDER_COLOR"] = "color";
|
|
121
|
+
BorderValues2["BORDER_WIDTH"] = "width";
|
|
122
|
+
BorderValues2["BORDER_STYLE"] = "style";
|
|
123
|
+
})(BorderValues || (BorderValues = {}));
|
|
124
|
+
|
|
125
|
+
// ../../node_modules/@tokens-studio/types/dist/constants/StrokeStyleValues.js
|
|
126
|
+
var StrokeStyleValues;
|
|
127
|
+
(function(StrokeStyleValues2) {
|
|
128
|
+
StrokeStyleValues2["SOLID"] = "solid";
|
|
129
|
+
StrokeStyleValues2["DASHED"] = "dashed";
|
|
130
|
+
StrokeStyleValues2["DOTTED"] = "dotted";
|
|
131
|
+
StrokeStyleValues2["DOUBLE"] = "double";
|
|
132
|
+
StrokeStyleValues2["GROOVE"] = "groove";
|
|
133
|
+
StrokeStyleValues2["RIDGE"] = "ridge";
|
|
134
|
+
StrokeStyleValues2["OUTSET"] = "outset";
|
|
135
|
+
StrokeStyleValues2["INSET"] = "inset";
|
|
136
|
+
})(StrokeStyleValues || (StrokeStyleValues = {}));
|
|
137
|
+
|
|
138
|
+
// ../../node_modules/@tokens-studio/types/dist/constants/BoxShadowValues.js
|
|
139
|
+
var BoxShadowValues;
|
|
140
|
+
(function(BoxShadowValues2) {
|
|
141
|
+
BoxShadowValues2["TYPE"] = "type";
|
|
142
|
+
BoxShadowValues2["COLOR"] = "color";
|
|
143
|
+
BoxShadowValues2["X"] = "x";
|
|
144
|
+
BoxShadowValues2["Y"] = "y";
|
|
145
|
+
BoxShadowValues2["BLUR"] = "blur";
|
|
146
|
+
BoxShadowValues2["SPREAD"] = "spread";
|
|
147
|
+
BoxShadowValues2["BLEND_MODE"] = "blendMode";
|
|
148
|
+
})(BoxShadowValues || (BoxShadowValues = {}));
|
|
149
|
+
|
|
150
|
+
// ../../node_modules/@tokens-studio/types/dist/constants/TypographyValues.js
|
|
151
|
+
var TypographyValues;
|
|
152
|
+
(function(TypographyValues2) {
|
|
153
|
+
TypographyValues2["FONT_FAMILY"] = "fontFamily";
|
|
154
|
+
TypographyValues2["FONT_WEIGHT"] = "fontWeight";
|
|
155
|
+
TypographyValues2["LINE_HEIGHT"] = "lineHeight";
|
|
156
|
+
TypographyValues2["FONT_SIZE"] = "fontSize";
|
|
157
|
+
TypographyValues2["LETTER_SPACING"] = "letterSpacing";
|
|
158
|
+
TypographyValues2["PARAGRAPH_SPACING"] = "paragraphSpacing";
|
|
159
|
+
TypographyValues2["PARAGRAPH_INDENT"] = "paragraphIndent";
|
|
160
|
+
TypographyValues2["TEXT_DECORATION"] = "textDecoration";
|
|
161
|
+
TypographyValues2["TEXT_CASE"] = "textCase";
|
|
162
|
+
})(TypographyValues || (TypographyValues = {}));
|
|
163
|
+
|
|
164
|
+
// src/tokens/create/generators/$themes.ts
|
|
165
|
+
var capitalize = (word) => word.charAt(0).toUpperCase() + word.slice(1);
|
|
166
|
+
async function createHash(text, algo = "SHA-1") {
|
|
167
|
+
const crypto = globalThis.crypto;
|
|
168
|
+
return Array.from(
|
|
169
|
+
new Uint8Array(await crypto.subtle.digest(algo, new TextEncoder().encode(text))),
|
|
170
|
+
(byte) => byte.toString(16).padStart(2, "0")
|
|
171
|
+
).join("");
|
|
172
|
+
}
|
|
173
|
+
async function generate$Themes(colorSchemes, themes, colors) {
|
|
174
|
+
return [
|
|
175
|
+
...generateSizeGroup(),
|
|
176
|
+
...await generateThemesGroup(themes),
|
|
177
|
+
...generateTypographyGroup(themes),
|
|
178
|
+
...generateColorSchemesGroup(colorSchemes, themes),
|
|
179
|
+
generateSemanticGroup(),
|
|
180
|
+
...await generateColorGroup("main", colors),
|
|
181
|
+
...await generateColorGroup("support", colors)
|
|
182
|
+
];
|
|
183
|
+
}
|
|
184
|
+
function generateSizeGroup() {
|
|
185
|
+
return [
|
|
186
|
+
{
|
|
187
|
+
id: "8b2c8cc86611a34b135cb22948666779361fd729",
|
|
188
|
+
name: "medium",
|
|
189
|
+
$figmaStyleReferences: {},
|
|
190
|
+
selectedTokenSets: {
|
|
191
|
+
"primitives/modes/size/medium": TokenSetStatus.SOURCE,
|
|
192
|
+
"primitives/modes/size/global": TokenSetStatus.ENABLED,
|
|
193
|
+
"primitives/modes/typography/size/medium": TokenSetStatus.ENABLED
|
|
194
|
+
},
|
|
195
|
+
$figmaCollectionId: "VariableCollectionId:36248:20757",
|
|
196
|
+
$figmaModeId: "41630:1",
|
|
197
|
+
group: "Size"
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
id: "d49b9eebeb48a4f165a74b7261733d0a73370f0e",
|
|
201
|
+
name: "large",
|
|
202
|
+
$figmaStyleReferences: {},
|
|
203
|
+
selectedTokenSets: {
|
|
204
|
+
"primitives/modes/size/large": TokenSetStatus.SOURCE,
|
|
205
|
+
"primitives/modes/size/global": TokenSetStatus.ENABLED,
|
|
206
|
+
"primitives/modes/typography/size/large": TokenSetStatus.ENABLED
|
|
207
|
+
},
|
|
208
|
+
$figmaCollectionId: "VariableCollectionId:36248:20757",
|
|
209
|
+
$figmaModeId: "41630:2",
|
|
210
|
+
group: "Size"
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
id: "fb11567729c298ca37c9da4e3a27716a23480824",
|
|
214
|
+
name: "small",
|
|
215
|
+
$figmaStyleReferences: {},
|
|
216
|
+
selectedTokenSets: {
|
|
217
|
+
"primitives/modes/size/small": TokenSetStatus.SOURCE,
|
|
218
|
+
"primitives/modes/size/global": TokenSetStatus.ENABLED,
|
|
219
|
+
"primitives/modes/typography/size/small": TokenSetStatus.ENABLED
|
|
220
|
+
},
|
|
221
|
+
$figmaCollectionId: "VariableCollectionId:36248:20757",
|
|
222
|
+
$figmaModeId: "41630:3",
|
|
223
|
+
group: "Size"
|
|
224
|
+
}
|
|
225
|
+
];
|
|
226
|
+
}
|
|
227
|
+
var colorSchemeDefaults = {
|
|
228
|
+
light: {
|
|
229
|
+
name: "Light",
|
|
230
|
+
selectedTokenSets: {},
|
|
231
|
+
id: "0daa3ca0b427b9349da7e7dc00101b5668972926",
|
|
232
|
+
$figmaCollectionId: "VariableCollectionId:34811:5472",
|
|
233
|
+
$figmaModeId: "34811:0"
|
|
234
|
+
},
|
|
235
|
+
dark: {
|
|
236
|
+
name: "Dark",
|
|
237
|
+
selectedTokenSets: {},
|
|
238
|
+
id: "9ebd8aed52afbffc17e2666e8b4653a53498b257",
|
|
239
|
+
$figmaCollectionId: "VariableCollectionId:34811:5472",
|
|
240
|
+
$figmaModeId: "34811:1"
|
|
241
|
+
},
|
|
242
|
+
contrast: {
|
|
243
|
+
name: "Contrast",
|
|
244
|
+
selectedTokenSets: {},
|
|
245
|
+
id: "9ebd8aed52afbffc17e2666e8b4653a53498b123",
|
|
246
|
+
$figmaCollectionId: "VariableCollectionId:34811:5472",
|
|
247
|
+
$figmaModeId: "34811:2"
|
|
248
|
+
}
|
|
249
|
+
};
|
|
250
|
+
function generateColorSchemesGroup(colorSchemes, themes) {
|
|
251
|
+
return colorSchemes.map(
|
|
252
|
+
(scheme) => ({
|
|
253
|
+
...colorSchemeDefaults[scheme],
|
|
254
|
+
selectedTokenSets: Object.fromEntries([
|
|
255
|
+
[`primitives/modes/color-scheme/${scheme}/global`, TokenSetStatus.ENABLED],
|
|
256
|
+
...themes.map((theme) => [`primitives/modes/color-scheme/${scheme}/${theme}`, TokenSetStatus.ENABLED])
|
|
257
|
+
]),
|
|
258
|
+
group: "Color scheme"
|
|
259
|
+
})
|
|
260
|
+
);
|
|
261
|
+
}
|
|
262
|
+
async function generateThemesGroup(themes) {
|
|
263
|
+
return Promise.all(
|
|
264
|
+
themes.map(
|
|
265
|
+
async (theme, index) => ({
|
|
266
|
+
id: await createHash(theme),
|
|
267
|
+
$figmaCollectionId: "VariableCollectionId:36528:61712",
|
|
268
|
+
$figmaModeId: `40960:${index + 6}`,
|
|
269
|
+
// Start on 6 in Token Studio and Community file for some reason
|
|
270
|
+
name: theme,
|
|
271
|
+
selectedTokenSets: {
|
|
272
|
+
[`themes/${theme}`]: TokenSetStatus.ENABLED
|
|
273
|
+
},
|
|
274
|
+
group: "Theme"
|
|
275
|
+
})
|
|
276
|
+
)
|
|
277
|
+
);
|
|
278
|
+
}
|
|
279
|
+
function generateSemanticGroup() {
|
|
280
|
+
return {
|
|
281
|
+
id: "541629445ef90ad5363f9e88f52a1ccb617e6f84",
|
|
282
|
+
name: "Semantic",
|
|
283
|
+
selectedTokenSets: {
|
|
284
|
+
"semantic/style": TokenSetStatus.ENABLED,
|
|
285
|
+
"semantic/color": TokenSetStatus.ENABLED,
|
|
286
|
+
"primitives/globals": TokenSetStatus.SOURCE
|
|
287
|
+
},
|
|
288
|
+
$figmaCollectionId: "VariableCollectionId:34811:5976",
|
|
289
|
+
$figmaModeId: "34811:5",
|
|
290
|
+
group: "Semantic"
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
async function generateColorGroup(group, colors) {
|
|
294
|
+
return Promise.all(
|
|
295
|
+
Object.entries(colors[group]).map(
|
|
296
|
+
async ([color]) => ({
|
|
297
|
+
id: await createHash(`${group}-${color}`),
|
|
298
|
+
name: color,
|
|
299
|
+
selectedTokenSets: {
|
|
300
|
+
[`semantic/modes/${group}-color/${color}`]: TokenSetStatus.ENABLED
|
|
301
|
+
},
|
|
302
|
+
group: `${capitalize(group)} color`
|
|
303
|
+
})
|
|
304
|
+
)
|
|
305
|
+
);
|
|
306
|
+
}
|
|
307
|
+
function generateTypographyGroup(themes) {
|
|
308
|
+
return [
|
|
309
|
+
{
|
|
310
|
+
id: "368d753fcac4455f289500eaa42e70dc0a03522f",
|
|
311
|
+
$figmaCollectionId: "VariableCollectionId:36248:20769",
|
|
312
|
+
$figmaModeId: "36248:2",
|
|
313
|
+
name: "Primary",
|
|
314
|
+
selectedTokenSets: Object.fromEntries(
|
|
315
|
+
themes.map((theme) => [`primitives/modes/typography/primary/${theme}`, TokenSetStatus.ENABLED])
|
|
316
|
+
),
|
|
317
|
+
group: "Typography"
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
id: "264b8bd1d40b364e1ea3acf09e49795ddd4c513c",
|
|
321
|
+
$figmaCollectionId: "VariableCollectionId:36248:20769",
|
|
322
|
+
$figmaModeId: "36248:3",
|
|
323
|
+
name: "Secondary",
|
|
324
|
+
selectedTokenSets: Object.fromEntries(
|
|
325
|
+
themes.map((theme) => [`primitives/modes/typography/secondary/${theme}`, TokenSetStatus.ENABLED])
|
|
326
|
+
),
|
|
327
|
+
group: "Typography"
|
|
328
|
+
}
|
|
329
|
+
];
|
|
330
|
+
}
|
|
331
|
+
export {
|
|
332
|
+
generate$Themes
|
|
333
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ColorScheme } from '../../../colors/types.js';
|
|
2
|
+
import type { Colors, TokenSet } from '../../types.js';
|
|
3
|
+
export declare const generateColorScheme: (themeName: string, colorScheme: ColorScheme, colors: Colors) => TokenSet;
|
|
4
|
+
export declare const generateColorGlobal: (colorScheme: ColorScheme) => TokenSet;
|
|
5
|
+
//# sourceMappingURL=color.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../../../../src/tokens/create/generators/color.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAS,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEnE,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAWvD,eAAO,MAAM,mBAAmB,GAAI,WAAW,MAAM,EAAE,aAAa,WAAW,EAAE,QAAQ,MAAM,KAAG,QAYjG,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,aAAa,WAAW,KAAG,QAgB9D,CAAC"}
|