@digdir/designsystemet 1.0.8 → 1.1.1
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/config.d.ts +3 -3
- package/dist/bin/config.d.ts.map +1 -1
- package/dist/bin/config.js +45 -45
- package/dist/bin/designsystemet.js +827 -748
- package/dist/config.schema.json +4 -4
- package/dist/src/colors/index.d.ts +2 -2
- package/dist/src/colors/index.d.ts.map +1 -1
- package/dist/src/colors/index.js +143 -143
- package/dist/src/colors/theme.d.ts +1 -2
- package/dist/src/colors/theme.d.ts.map +1 -1
- package/dist/src/config.d.ts +6 -21
- package/dist/src/config.d.ts.map +1 -1
- package/dist/src/config.js +43 -40
- package/dist/src/index.js +418 -430
- package/dist/src/scripts/createJsonSchema.js +23 -24
- package/dist/src/scripts/update-template.d.ts.map +1 -1
- package/dist/src/tokens/build.d.ts +1 -1
- package/dist/src/tokens/build.d.ts.map +1 -1
- package/dist/src/tokens/build.js +359 -280
- package/dist/src/tokens/create/generators/$designsystemet.js +16 -15
- package/dist/src/tokens/create/generators/color.js +21 -21
- package/dist/src/tokens/create/write.js +17 -16
- package/dist/src/tokens/create.d.ts +1 -0
- package/dist/src/tokens/create.d.ts.map +1 -1
- package/dist/src/tokens/create.js +22 -21
- package/dist/src/tokens/format.d.ts.map +1 -1
- package/dist/src/tokens/format.js +931 -944
- package/dist/src/tokens/index.d.ts +2 -2
- package/dist/src/tokens/index.d.ts.map +1 -1
- package/dist/src/tokens/index.js +295 -307
- package/dist/src/tokens/process/configs/color.d.ts.map +1 -1
- package/dist/src/tokens/process/configs/color.js +5 -5
- package/dist/src/tokens/process/configs/semantic.d.ts.map +1 -1
- package/dist/src/tokens/process/configs/semantic.js +5 -5
- package/dist/src/tokens/process/configs/storefront.d.ts.map +1 -1
- package/dist/src/tokens/process/configs/storefront.js +1 -1
- package/dist/src/tokens/process/configs/typography.d.ts.map +1 -1
- package/dist/src/tokens/process/configs/typography.js +5 -5
- package/dist/src/tokens/process/configs.d.ts.map +1 -1
- package/dist/src/tokens/process/configs.js +5 -5
- package/dist/src/tokens/process/formats/css/color.js +2 -2
- package/dist/src/tokens/process/formats/css/semantic.js +2 -2
- package/dist/src/tokens/process/formats/css/typography.js +1 -1
- package/dist/src/tokens/process/formats/css.js +5 -5
- package/dist/src/tokens/process/formats/js-tokens.js +1 -1
- package/dist/src/tokens/process/output/declarations.d.ts +4 -0
- package/dist/src/tokens/process/output/declarations.d.ts.map +1 -0
- package/dist/src/tokens/process/output/declarations.js +860 -0
- package/dist/src/tokens/process/output/tailwind.d.ts +3 -0
- package/dist/src/tokens/process/output/tailwind.d.ts.map +1 -0
- package/dist/src/tokens/process/output/tailwind.js +59 -0
- package/dist/src/tokens/process/{theme.d.ts → output/theme.d.ts} +2 -2
- package/dist/src/tokens/process/output/theme.d.ts.map +1 -0
- package/dist/src/tokens/process/{theme.js → output/theme.js} +20 -19
- package/dist/src/tokens/process/platform.d.ts +8 -4
- package/dist/src/tokens/process/platform.d.ts.map +1 -1
- package/dist/src/tokens/process/platform.js +27 -56
- package/dist/src/tokens/process/utils/getMultidimensionalThemes.d.ts +1 -0
- package/dist/src/tokens/process/utils/getMultidimensionalThemes.d.ts.map +1 -1
- package/dist/src/tokens/process/utils/getMultidimensionalThemes.js +12 -5
- package/dist/src/tokens/types.d.ts +1 -1
- package/dist/src/tokens/types.d.ts.map +1 -1
- package/dist/src/tokens/utils.d.ts.map +1 -1
- package/package.json +16 -15
- package/dist/src/tokens/process/theme.d.ts.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tailwind.d.ts","sourceRoot":"","sources":["../../../../../src/tokens/process/output/tailwind.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD,eAAO,MAAM,sBAAsB,GAAI,UAAU,UAAU,EAAE,KAAG,UAAU,EAezE,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// src/tokens/process/output/tailwind.ts
|
|
2
|
+
var createTailwindCSSFiles = (cssFiles) => {
|
|
3
|
+
console.log("\n\u{1F371} Creating Tailwind Config");
|
|
4
|
+
return cssFiles.map((file) => {
|
|
5
|
+
if (file.destination) {
|
|
6
|
+
const tailwindConfig = generateTailwind(file.output);
|
|
7
|
+
const tailwindFile = {
|
|
8
|
+
destination: file.destination.replace(".css", ".tailwind.css"),
|
|
9
|
+
output: tailwindConfig
|
|
10
|
+
};
|
|
11
|
+
return tailwindFile;
|
|
12
|
+
}
|
|
13
|
+
return void 0;
|
|
14
|
+
}).filter((item) => item !== void 0);
|
|
15
|
+
};
|
|
16
|
+
var generateTailwind = (css) => {
|
|
17
|
+
const tailwind = ["--font-sans: var(--ds-font-family)"];
|
|
18
|
+
const tokens = Array.from(new Set(css.match(/--ds-[^:)]+/g)), (m) => m).sort(
|
|
19
|
+
(a, b) => a.localeCompare(b, void 0, { numeric: true, sensitivity: "base" })
|
|
20
|
+
);
|
|
21
|
+
for (const token of tokens) {
|
|
22
|
+
if (token.startsWith("--ds-color-") && !token.startsWith("--ds-color-focus")) {
|
|
23
|
+
tailwind.push(`--color-${token.replace("--ds-color-", "")}: var(${token})`);
|
|
24
|
+
} else if (token.startsWith("--ds-font-weight-")) {
|
|
25
|
+
tailwind.push(`--font-weight-${token.replace("--ds-font-weight-", "")}: var(${token})`);
|
|
26
|
+
} else if (token.match(/--ds-border-radius-(sm|md|lg|xl)/)) {
|
|
27
|
+
tailwind.push(`--radius-${token.replace("--ds-border-radius-", "")}: var(${token})`);
|
|
28
|
+
} else if (token.match(/--ds-body-(sm|mg|lg)-body-font-size/)) {
|
|
29
|
+
tailwind.push(`--text-${token.replace("--ds-body-", "").replace("-font-size", "")}: var(${token})`);
|
|
30
|
+
} else if (token.match(/^--ds-size-\d+$/)) {
|
|
31
|
+
tailwind.push(`--spacing-${token.replace("--ds-size-", "")}: var(${token})`);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
const dynamicColors = `[data-color] {
|
|
35
|
+
--color-background-default: var(--ds-color-background-default);
|
|
36
|
+
--color-background-tinted: var(--ds-color-background-tinted);
|
|
37
|
+
--color-surface-default: var(--ds-color-surface-default);
|
|
38
|
+
--color-surface-tinted: var(--ds-color-surface-tinted);
|
|
39
|
+
--color-surface-hover: var(--ds-color-surface-hover);
|
|
40
|
+
--color-surface-active: var(--ds-color-surface-active);
|
|
41
|
+
--color-border-subtle: var(--ds-color-border-subtle);
|
|
42
|
+
--color-border-default: var(--ds-color-border-default);
|
|
43
|
+
--color-border-strong: var(--ds-color-border-strong);
|
|
44
|
+
--color-text-subtle: var(--ds-color-text-subtle);
|
|
45
|
+
--color-text-default: var(--ds-color-text-default);
|
|
46
|
+
--color-base-default: var(--ds-color-base-default);
|
|
47
|
+
--color-base-hover: var(--ds-color-base-hover);
|
|
48
|
+
--color-base-active: var(--ds-color-base-active);
|
|
49
|
+
--color-base-contrast-subtle: var(--ds-color-base-contrast-subtle);
|
|
50
|
+
--color-base-contrast-default: var(--ds-color-base-contrast-default);
|
|
51
|
+
}`;
|
|
52
|
+
return `@theme {${tailwind.map((str) => `
|
|
53
|
+
${str};`).join("")}
|
|
54
|
+
}
|
|
55
|
+
${dynamicColors}`;
|
|
56
|
+
};
|
|
57
|
+
export {
|
|
58
|
+
createTailwindCSSFiles
|
|
59
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { OutputFile } from '
|
|
2
|
-
import type { ProcessReturn } from '
|
|
1
|
+
import type { OutputFile } from '../../types.js';
|
|
2
|
+
import type { ProcessReturn } from '../platform.js';
|
|
3
3
|
export declare const defaultFileHeader: string;
|
|
4
4
|
type CreateThemeCSSFiles = {
|
|
5
5
|
/** The processed build results containing formatted CSS outputs grouped by themes and other permutations. */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../../../src/tokens/process/output/theme.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD,eAAO,MAAM,iBAAiB,QAA2B,CAAC;AAE1D,KAAK,mBAAmB,GAAG;IACzB,6GAA6G;IAC7G,eAAe,EAAE,aAAa,CAAC;IAC/B,iEAAiE;IACjE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,mBAAmB,GAAI,kCAGjC,mBAAmB,KAAG,UAAU,EA8ElC,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
// src/tokens/process/theme.ts
|
|
2
|
-
import * as R from "ramda";
|
|
1
|
+
// src/tokens/process/output/theme.ts
|
|
3
2
|
import chalk from "chalk";
|
|
3
|
+
import * as R from "ramda";
|
|
4
4
|
|
|
5
5
|
// package.json
|
|
6
6
|
var package_default = {
|
|
7
7
|
name: "@digdir/designsystemet",
|
|
8
|
-
version: "1.
|
|
8
|
+
version: "1.1.1",
|
|
9
9
|
description: "CLI for Designsystemet",
|
|
10
10
|
author: "Designsystemet team",
|
|
11
11
|
engines: {
|
|
@@ -15,7 +15,7 @@ var package_default = {
|
|
|
15
15
|
type: "git",
|
|
16
16
|
url: "git+https://github.com/digdir/designsystemet.git"
|
|
17
17
|
},
|
|
18
|
-
homepage: "https://github.com/digdir/designsystemet/tree/main/
|
|
18
|
+
homepage: "https://github.com/digdir/designsystemet/tree/main/packages/cli",
|
|
19
19
|
license: "MIT",
|
|
20
20
|
type: "module",
|
|
21
21
|
main: "./dist/src/index.js",
|
|
@@ -40,8 +40,7 @@ var package_default = {
|
|
|
40
40
|
},
|
|
41
41
|
scripts: {
|
|
42
42
|
designsystemet: "tsx ./bin/designsystemet.ts",
|
|
43
|
-
"
|
|
44
|
-
"build:tokens:debug": "tsx --inspect-brk ./bin/designsystemet.ts tokens build -p -t ../../internal/design-tokens -o ../../packages/theme/brand --clean",
|
|
43
|
+
"designsystemet:inspect": "tsx --inspect-brk ./bin/designsystemet.ts",
|
|
45
44
|
build: "tsup && pnpm build:types && pnpm build:json-schema",
|
|
46
45
|
"build:types": "tsc --emitDeclarationOnly --declaration",
|
|
47
46
|
"build:json-schema": "tsx ./src/scripts/createJsonSchema.ts",
|
|
@@ -49,32 +48,36 @@ var package_default = {
|
|
|
49
48
|
"test:tokens-create-options": 'pnpm run designsystemet tokens create -m dominant:"#007682" -n "#003333" -b 99 -o ./temp/options/design-tokens --theme options --clean',
|
|
50
49
|
"test:tokens-create-config": "pnpm run designsystemet tokens create --config ./configs/test-tokens.config.json",
|
|
51
50
|
"test:tokens-build": "pnpm run designsystemet tokens build -t ./temp/options/design-tokens -o ./temp/options/build --clean",
|
|
51
|
+
"test:tokens-build-tailwind": "pnpm run designsystemet tokens build -t ./temp/options/design-tokens -o ./temp/options/build --clean --experimental-tailwind",
|
|
52
52
|
"test:tokens-build-config": "pnpm run designsystemet tokens build -t ./temp/config/design-tokens -o ./temp/config/build --clean",
|
|
53
|
+
"test:tokens-build-config:inspect": "pnpm run designsystemet:inspect tokens build -t ./temp/config/design-tokens -o ./temp/config/build --clean",
|
|
54
|
+
"test:tokens-build-config-tailwind": "pnpm run designsystemet tokens build -t ./temp/config/design-tokens -o ./temp/config/build --clean --experimental-tailwind",
|
|
53
55
|
"test:tokens-create-and-build-options": "pnpm test:tokens-create-options && pnpm test:tokens-build",
|
|
54
56
|
"test:tokens-create-and-build-config": "pnpm test:tokens-create-config && pnpm test:tokens-build-config",
|
|
55
57
|
test: "pnpm test:tokens-create-and-build-options && pnpm test:tokens-create-and-build-config",
|
|
58
|
+
"digdir:tokens-build": "pnpm run designsystemet tokens build -t ../../internal/design-tokens -o ../../packages/theme/brand --clean --experimental-tailwind",
|
|
56
59
|
"digdir:tokens-create": "pnpm run designsystemet tokens create --config ./configs/digdir.config.json",
|
|
57
60
|
"update:template": "tsx ./src/scripts/update-template.ts",
|
|
58
|
-
"update:theme-digdir": "pnpm digdir:tokens-create && tsx ./src/scripts/update-design-tokens.ts",
|
|
61
|
+
"update:theme-digdir": "pnpm digdir:tokens-create && tsx ./src/scripts/update-design-tokens.ts && pnpm digdir:tokens-build",
|
|
59
62
|
verify: "pnpm test && pnpm update:template && pnpm update:theme-digdir && pnpm build:tokens"
|
|
60
63
|
},
|
|
61
64
|
dependencies: {
|
|
62
|
-
"@commander-js/extra-typings": "^
|
|
65
|
+
"@commander-js/extra-typings": "^14.0.0",
|
|
63
66
|
"@tokens-studio/sd-transforms": "1.3.0",
|
|
64
67
|
"apca-w3": "^0.1.9",
|
|
65
68
|
chalk: "^5.4.1",
|
|
66
69
|
"change-case": "^5.4.4",
|
|
67
70
|
"chroma-js": "^3.1.2",
|
|
68
71
|
"colorjs.io": "^0.6.0-alpha.1",
|
|
69
|
-
commander: "^
|
|
72
|
+
commander: "^14.0.0",
|
|
70
73
|
"fast-glob": "^3.3.3",
|
|
71
74
|
hsluv: "^1.0.1",
|
|
72
75
|
"object-hash": "^3.0.0",
|
|
73
|
-
postcss: "^8.5.
|
|
76
|
+
postcss: "^8.5.6",
|
|
74
77
|
ramda: "^0.30.1",
|
|
75
|
-
"style-dictionary": "^
|
|
76
|
-
zod: "^3.25.
|
|
77
|
-
"zod-validation-error": "^3.
|
|
78
|
+
"style-dictionary": "^5.0.0",
|
|
79
|
+
zod: "^3.25.67",
|
|
80
|
+
"zod-validation-error": "^3.5.2"
|
|
78
81
|
},
|
|
79
82
|
devDependencies: {
|
|
80
83
|
"@tokens-studio/types": "0.5.2",
|
|
@@ -82,27 +85,25 @@ var package_default = {
|
|
|
82
85
|
"@types/chroma-js": "^3.1.1",
|
|
83
86
|
"@types/fs-extra": "^11.0.4",
|
|
84
87
|
"@types/glob": "^8.1.0",
|
|
85
|
-
"@types/
|
|
86
|
-
"@types/node": "^22.15.21",
|
|
88
|
+
"@types/node": "^22.15.32",
|
|
87
89
|
"@types/object-hash": "^3.0.6",
|
|
88
90
|
"@types/ramda": "^0.30.2",
|
|
89
91
|
"fs-extra": "^11.3.0",
|
|
90
|
-
"ts-toolbelt": "^9.6.0",
|
|
91
92
|
tslib: "^2.8.1",
|
|
92
93
|
tsup: "^8.5.0",
|
|
93
|
-
tsx: "^4.
|
|
94
|
+
tsx: "^4.20.3",
|
|
94
95
|
typescript: "^5.8.3"
|
|
95
96
|
}
|
|
96
97
|
};
|
|
97
98
|
|
|
98
|
-
// src/tokens/process/theme.ts
|
|
99
|
+
// src/tokens/process/output/theme.ts
|
|
99
100
|
var defaultFileHeader = `build: v${package_default.version}`;
|
|
100
101
|
var createThemeCSSFiles = ({
|
|
101
102
|
processedBuilds,
|
|
102
103
|
fileHeader = defaultFileHeader
|
|
103
104
|
}) => {
|
|
104
105
|
const groupedByTheme = {};
|
|
105
|
-
for (const [_, buildResults] of Object.entries(
|
|
106
|
+
for (const [_, buildResults] of Object.entries(processedBuilds)) {
|
|
106
107
|
for (const buildResult of buildResults) {
|
|
107
108
|
const themeName = buildResult.permutation.theme;
|
|
108
109
|
const newOutputs = buildResult.formatted;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ThemeObject } from '@tokens-studio/types';
|
|
2
1
|
import type { OutputFile, TokenSet } from '../types.js';
|
|
3
2
|
import { type ThemePermutation } from '../types.js';
|
|
3
|
+
import { type ProcessedThemeObject } from './utils/getMultidimensionalThemes.js';
|
|
4
4
|
type SharedOptions = {
|
|
5
5
|
/** Enable verbose output */
|
|
6
6
|
verbose: boolean;
|
|
@@ -11,7 +11,9 @@ type SharedOptions = {
|
|
|
11
11
|
/** Generate preview tokens */
|
|
12
12
|
preview: boolean;
|
|
13
13
|
/** Token Studio `$themes.json` content */
|
|
14
|
-
$themes:
|
|
14
|
+
processed$themes: ProcessedThemeObject[];
|
|
15
|
+
/** Color groups */
|
|
16
|
+
colorGroups?: string[];
|
|
15
17
|
};
|
|
16
18
|
export type BuildOptions = {
|
|
17
19
|
type: 'build';
|
|
@@ -19,6 +21,8 @@ export type BuildOptions = {
|
|
|
19
21
|
tokensDir: string;
|
|
20
22
|
/** Output directory for built tokens */
|
|
21
23
|
outDir: string;
|
|
24
|
+
/** Tailwind CSS configuration */
|
|
25
|
+
tailwind?: boolean;
|
|
22
26
|
} & SharedOptions;
|
|
23
27
|
export type FormatOptions = {
|
|
24
28
|
type: 'format';
|
|
@@ -26,7 +30,7 @@ export type FormatOptions = {
|
|
|
26
30
|
tokenSets: Map<string, TokenSet>;
|
|
27
31
|
} & SharedOptions;
|
|
28
32
|
type ProcessOptions = BuildOptions | FormatOptions;
|
|
29
|
-
type ProcessedBuildConfigs<T> = Record<keyof typeof buildConfigs
|
|
33
|
+
type ProcessedBuildConfigs<T> = Record<keyof typeof buildConfigs, T>;
|
|
30
34
|
export type ProcessReturn = ProcessedBuildConfigs<BuildResult[]>;
|
|
31
35
|
type BuildResult = {
|
|
32
36
|
permutation: ThemePermutation;
|
|
@@ -80,6 +84,6 @@ declare const buildConfigs: {
|
|
|
80
84
|
dimensions: "semantic"[];
|
|
81
85
|
};
|
|
82
86
|
};
|
|
83
|
-
export declare function processPlatform
|
|
87
|
+
export declare function processPlatform(options: ProcessOptions): Promise<ProcessReturn>;
|
|
84
88
|
export {};
|
|
85
89
|
//# sourceMappingURL=platform.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../../../src/tokens/process/platform.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../../../src/tokens/process/platform.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAqC,KAAK,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEvF,OAAO,EAAmB,KAAK,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAElG,KAAK,aAAa,GAAG;IACnB,4BAA4B;IAC5B,O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
@@ -96,7 +96,7 @@ var prefersColorScheme = (colorScheme2, content) => `
|
|
|
96
96
|
`;
|
|
97
97
|
var colorScheme = {
|
|
98
98
|
name: "ds/css-colorscheme",
|
|
99
|
-
format: async ({ dictionary,
|
|
99
|
+
format: async ({ dictionary, options, platform }) => {
|
|
100
100
|
const { allTokens } = dictionary;
|
|
101
101
|
const { outputReferences, usesDtcg } = options;
|
|
102
102
|
const { selector, colorScheme: colorScheme2, layer } = platform;
|
|
@@ -138,7 +138,7 @@ ${selector} ${content} ${autoSelectorContent}
|
|
|
138
138
|
};
|
|
139
139
|
var colorCategory = {
|
|
140
140
|
name: "ds/css-colorcategory",
|
|
141
|
-
format: async ({ dictionary,
|
|
141
|
+
format: async ({ dictionary, options, platform }) => {
|
|
142
142
|
const { outputReferences, usesDtcg } = options;
|
|
143
143
|
const { selector, layer } = platform;
|
|
144
144
|
const format = R2.compose(
|
|
@@ -181,7 +181,7 @@ var isInlineTokens = R3.anyPass([isNumericBorderRadiusToken, isNumericSizeToken,
|
|
|
181
181
|
var overrideSizingFormula = (format, token) => {
|
|
182
182
|
const [name, value] = format(token).split(":");
|
|
183
183
|
const calc = value.replace(`var(--ds-size-mode-font-size)`, "1em").replace(/floor\((.*)\);/, "calc($1)");
|
|
184
|
-
const round = `round(down, ${calc},
|
|
184
|
+
const round = `round(down, ${calc}, 1px)`;
|
|
185
185
|
return {
|
|
186
186
|
name,
|
|
187
187
|
round,
|
|
@@ -209,7 +209,7 @@ ${round.join("\n")}
|
|
|
209
209
|
};
|
|
210
210
|
var semantic = {
|
|
211
211
|
name: "ds/css-semantic",
|
|
212
|
-
format: async ({ dictionary,
|
|
212
|
+
format: async ({ dictionary, options, platform }) => {
|
|
213
213
|
const { outputReferences, usesDtcg } = options;
|
|
214
214
|
const { selector, layer } = platform;
|
|
215
215
|
const format = createPropertyFormatter2({
|
|
@@ -247,7 +247,7 @@ var typographyFontFamilyPredicate = R4.allPass([
|
|
|
247
247
|
]);
|
|
248
248
|
var typography = {
|
|
249
249
|
name: "ds/css-typography",
|
|
250
|
-
format: async ({ dictionary,
|
|
250
|
+
format: async ({ dictionary, options, platform }) => {
|
|
251
251
|
const { outputReferences, usesDtcg } = options;
|
|
252
252
|
const { selector, layer } = platform;
|
|
253
253
|
const format = createPropertyFormatter3({
|
|
@@ -779,20 +779,6 @@ var getMultidimensionalThemes = (processed$themes, dimensions) => {
|
|
|
779
779
|
});
|
|
780
780
|
};
|
|
781
781
|
var processed = Symbol("Type brand for ProcessedThemeObject");
|
|
782
|
-
function isProcessed(theme) {
|
|
783
|
-
return Boolean(theme[processed]);
|
|
784
|
-
}
|
|
785
|
-
function processThemeObject(theme) {
|
|
786
|
-
if (isProcessed(theme)) {
|
|
787
|
-
return theme;
|
|
788
|
-
}
|
|
789
|
-
const result = { ...theme, [processed]: true };
|
|
790
|
-
if (result.group) {
|
|
791
|
-
result.group = kebabCase(result.group);
|
|
792
|
-
}
|
|
793
|
-
result.name = kebabCase(result.name);
|
|
794
|
-
return result;
|
|
795
|
-
}
|
|
796
782
|
function groupThemes(themes) {
|
|
797
783
|
const groups = {};
|
|
798
784
|
for (const theme of themes) {
|
|
@@ -864,6 +850,12 @@ function filterTokenSets(tokensets) {
|
|
|
864
850
|
function cartesian(a) {
|
|
865
851
|
return a.reduce((a2, b) => a2.flatMap((d) => b.map((e) => [d, e].flat())));
|
|
866
852
|
}
|
|
853
|
+
var getCustomColors = (processed$themes, colorGroups) => processed$themes.filter((x) => {
|
|
854
|
+
if (!x.group) {
|
|
855
|
+
return false;
|
|
856
|
+
}
|
|
857
|
+
return colorGroups.includes(x.group);
|
|
858
|
+
}).map((x) => x.name);
|
|
867
859
|
|
|
868
860
|
// src/tokens/process/configs.ts
|
|
869
861
|
void register(StyleDictionary, { withSDBuiltins: false });
|
|
@@ -946,12 +938,6 @@ var initResult = {
|
|
|
946
938
|
};
|
|
947
939
|
var buildOptions;
|
|
948
940
|
var sd = new StyleDictionary2();
|
|
949
|
-
var getCustomColors = (processed$themes, colorGroups) => processed$themes.filter((x) => {
|
|
950
|
-
if (!x.group) {
|
|
951
|
-
return false;
|
|
952
|
-
}
|
|
953
|
-
return colorGroups.includes(x.group);
|
|
954
|
-
}).map((x) => x.name);
|
|
955
941
|
var buildConfigs = {
|
|
956
942
|
typography: { getConfig: configs.typographyVariables, dimensions: ["typography"] },
|
|
957
943
|
"color-scheme": { getConfig: configs.colorSchemeVariables, dimensions: ["color-scheme"] },
|
|
@@ -992,7 +978,7 @@ var buildConfigs = {
|
|
|
992
978
|
// },
|
|
993
979
|
};
|
|
994
980
|
async function processPlatform(options) {
|
|
995
|
-
const { type, $themes } = options;
|
|
981
|
+
const { type, processed$themes } = options;
|
|
996
982
|
const platform = "css";
|
|
997
983
|
const tokenSets = type === "format" ? options.tokenSets : void 0;
|
|
998
984
|
const tokensDir = type === "build" ? options.tokensDir : void 0;
|
|
@@ -1017,8 +1003,11 @@ async function processPlatform(options) {
|
|
|
1017
1003
|
const colorGroups = UNSAFE_COLOR_GROUPS.length > 0 ? UNSAFE_COLOR_GROUPS : [colorCategories.main, colorCategories.support].map((c) => `${c}-color`);
|
|
1018
1004
|
buildOptions = options;
|
|
1019
1005
|
buildOptions.defaultColor = UNSAFE_DEFAULT_COLOR;
|
|
1020
|
-
|
|
1021
|
-
const
|
|
1006
|
+
buildOptions.colorGroups = colorGroups;
|
|
1007
|
+
const filteredProcessed$themes = processed$themes.filter(
|
|
1008
|
+
(theme) => R12.not(theme.group === "size" && theme.name !== "medium")
|
|
1009
|
+
);
|
|
1010
|
+
const customColors = getCustomColors(filteredProcessed$themes, colorGroups);
|
|
1022
1011
|
if (!buildOptions.defaultColor) {
|
|
1023
1012
|
const firstMainColor = R12.head(customColors);
|
|
1024
1013
|
buildOptions.defaultColor = firstMainColor;
|
|
@@ -1028,10 +1017,15 @@ async function processPlatform(options) {
|
|
|
1028
1017
|
\u{1F3A8} Using ${chalk2.blue(buildOptions.defaultColor)} as default color`);
|
|
1029
1018
|
}
|
|
1030
1019
|
const buildAndSdConfigs = R12.map((buildConfig) => {
|
|
1031
|
-
const sdConfigs = getConfigsForThemeDimensions(
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1020
|
+
const sdConfigs = getConfigsForThemeDimensions(
|
|
1021
|
+
buildConfig.getConfig,
|
|
1022
|
+
filteredProcessed$themes,
|
|
1023
|
+
buildConfig.dimensions,
|
|
1024
|
+
{
|
|
1025
|
+
tokensDir,
|
|
1026
|
+
tokenSets
|
|
1027
|
+
}
|
|
1028
|
+
);
|
|
1035
1029
|
const unknownConfigs = buildConfig.dimensions.map(
|
|
1036
1030
|
(dimension) => sdConfigs.filter((x) => x.permutation[dimension] === "unknown")
|
|
1037
1031
|
);
|
|
@@ -1055,8 +1049,7 @@ async function processPlatform(options) {
|
|
|
1055
1049
|
"warning-color": [initResult],
|
|
1056
1050
|
"info-color": [initResult],
|
|
1057
1051
|
semantic: [initResult],
|
|
1058
|
-
typography: [initResult]
|
|
1059
|
-
types: [initResult]
|
|
1052
|
+
typography: [initResult]
|
|
1060
1053
|
};
|
|
1061
1054
|
try {
|
|
1062
1055
|
for (const [buildName, { buildConfig, sdConfigs }] of R12.toPairs(buildAndSdConfigs)) {
|
|
@@ -1091,30 +1084,8 @@ async function processPlatform(options) {
|
|
|
1091
1084
|
}
|
|
1092
1085
|
throw err;
|
|
1093
1086
|
}
|
|
1094
|
-
const colorsFileName = "colors.d.ts";
|
|
1095
|
-
const reactColorTypes = await createColorTypeDeclaration(customColors);
|
|
1096
|
-
processedBuilds.types = [
|
|
1097
|
-
{
|
|
1098
|
-
...initResult,
|
|
1099
|
-
formatted: [{ output: reactColorTypes, destination: colorsFileName }]
|
|
1100
|
-
}
|
|
1101
|
-
];
|
|
1102
1087
|
return processedBuilds;
|
|
1103
1088
|
}
|
|
1104
|
-
async function createColorTypeDeclaration(colors) {
|
|
1105
|
-
console.log(`
|
|
1106
|
-
\u{1F371} Building ${chalk2.green("type declarations")}`);
|
|
1107
|
-
const typeDeclaration = `
|
|
1108
|
-
import type {} from '@digdir/designsystemet-react/colors';
|
|
1109
|
-
|
|
1110
|
-
declare module '@digdir/designsystemet-react/colors' {
|
|
1111
|
-
export interface MainAndSupportColors {
|
|
1112
|
-
${colors.map((color) => ` ${color}: never;`).join("\n")}
|
|
1113
|
-
}
|
|
1114
|
-
}
|
|
1115
|
-
`.trimStart();
|
|
1116
|
-
return typeDeclaration;
|
|
1117
|
-
}
|
|
1118
1089
|
export {
|
|
1119
1090
|
buildOptions,
|
|
1120
1091
|
processPlatform
|
|
@@ -31,5 +31,6 @@ export type ProcessedThemeObject = ThemeObject & {
|
|
|
31
31
|
*/
|
|
32
32
|
export declare function processThemeObject(theme: ThemeObject | ProcessedThemeObject): ProcessedThemeObject;
|
|
33
33
|
export type GroupedThemes = Record<keyof ThemePermutation, ProcessedThemeObject[]>;
|
|
34
|
+
export declare const getCustomColors: (processed$themes: ProcessedThemeObject[], colorGroups: (string | RegExp)[]) => string[];
|
|
34
35
|
export {};
|
|
35
36
|
//# sourceMappingURL=getMultidimensionalThemes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getMultidimensionalThemes.d.ts","sourceRoot":"","sources":["../../../../../src/tokens/process/utils/getMultidimensionalThemes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAKxD,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGvE;;;;;;;;;;GAUG;AACH,eAAO,MAAM,yBAAyB,GAAI,kBAAkB,oBAAoB,EAAE,EAAE,YAAY,cAAc,EAAE,sBAe/G,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,WAAW,EAAE,gBAAgB,CAAC;CAC/B,CAAC;AAEF,QAAA,MAAM,SAAS,EAAE,OAAO,MAAs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,MAAM,GAAG,MAAM,CAAC,EAAE,aASnF,CAAC"}
|
|
@@ -252,7 +252,7 @@ var prefersColorScheme = (colorScheme2, content) => `
|
|
|
252
252
|
`;
|
|
253
253
|
var colorScheme = {
|
|
254
254
|
name: "ds/css-colorscheme",
|
|
255
|
-
format: async ({ dictionary,
|
|
255
|
+
format: async ({ dictionary, options, platform }) => {
|
|
256
256
|
const { allTokens } = dictionary;
|
|
257
257
|
const { outputReferences, usesDtcg } = options;
|
|
258
258
|
const { selector, colorScheme: colorScheme2, layer } = platform;
|
|
@@ -294,7 +294,7 @@ ${selector} ${content} ${autoSelectorContent}
|
|
|
294
294
|
};
|
|
295
295
|
var colorCategory = {
|
|
296
296
|
name: "ds/css-colorcategory",
|
|
297
|
-
format: async ({ dictionary,
|
|
297
|
+
format: async ({ dictionary, options, platform }) => {
|
|
298
298
|
const { outputReferences, usesDtcg } = options;
|
|
299
299
|
const { selector, layer } = platform;
|
|
300
300
|
const format = R2.compose(
|
|
@@ -337,7 +337,7 @@ var isInlineTokens = R3.anyPass([isNumericBorderRadiusToken, isNumericSizeToken,
|
|
|
337
337
|
var overrideSizingFormula = (format, token) => {
|
|
338
338
|
const [name, value] = format(token).split(":");
|
|
339
339
|
const calc = value.replace(`var(--ds-size-mode-font-size)`, "1em").replace(/floor\((.*)\);/, "calc($1)");
|
|
340
|
-
const round = `round(down, ${calc},
|
|
340
|
+
const round = `round(down, ${calc}, 1px)`;
|
|
341
341
|
return {
|
|
342
342
|
name,
|
|
343
343
|
round,
|
|
@@ -365,7 +365,7 @@ ${round.join("\n")}
|
|
|
365
365
|
};
|
|
366
366
|
var semantic = {
|
|
367
367
|
name: "ds/css-semantic",
|
|
368
|
-
format: async ({ dictionary,
|
|
368
|
+
format: async ({ dictionary, options, platform }) => {
|
|
369
369
|
const { outputReferences, usesDtcg } = options;
|
|
370
370
|
const { selector, layer } = platform;
|
|
371
371
|
const format = createPropertyFormatter2({
|
|
@@ -403,7 +403,7 @@ var typographyFontFamilyPredicate = R4.allPass([
|
|
|
403
403
|
]);
|
|
404
404
|
var typography = {
|
|
405
405
|
name: "ds/css-typography",
|
|
406
|
-
format: async ({ dictionary,
|
|
406
|
+
format: async ({ dictionary, options, platform }) => {
|
|
407
407
|
const { outputReferences, usesDtcg } = options;
|
|
408
408
|
const { selector, layer } = platform;
|
|
409
409
|
const format = createPropertyFormatter3({
|
|
@@ -921,7 +921,14 @@ function filterTokenSets(tokensets) {
|
|
|
921
921
|
function cartesian(a) {
|
|
922
922
|
return a.reduce((a2, b) => a2.flatMap((d) => b.map((e) => [d, e].flat())));
|
|
923
923
|
}
|
|
924
|
+
var getCustomColors = (processed$themes, colorGroups) => processed$themes.filter((x) => {
|
|
925
|
+
if (!x.group) {
|
|
926
|
+
return false;
|
|
927
|
+
}
|
|
928
|
+
return colorGroups.includes(x.group);
|
|
929
|
+
}).map((x) => x.name);
|
|
924
930
|
export {
|
|
931
|
+
getCustomColors,
|
|
925
932
|
getMultidimensionalThemes,
|
|
926
933
|
processThemeObject
|
|
927
934
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/tokens/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAE5E,MAAM,MAAM,KAAK,GAAG;IAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AACjF,MAAM,MAAM,QAAQ,GAAG;IACrB,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,GAAG,QAAQ,CAAC;CACjC,CAAC;AACF,MAAM,MAAM,SAAS,GAAG,GAAG,CAAC,M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M,YAAoB,CAAC;AAEtD;2HAC2H;AAC3H,wBAAgB,WAAW,CACzB,GAAG,EAAE,MAAM,GAAG,QAAQ,EACtB,EAAE,EAAE,CAAC,GAAG,EAAE,QAAQ,GAAG,MAAM,GAAG,WAAW,EAAE,GAAG,EAAE,MAAM,MAAM,GAAG,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,WAAW,GAAG,MAAM,KAAK,IAAI,4DAYrH;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,YAAY,CAAC,YAAY,EAAE,CAAC,CAAC,EAAE,gBAAgB,KAAK,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,sBAetG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digdir/designsystemet",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "CLI for Designsystemet",
|
|
5
5
|
"author": "Designsystemet team",
|
|
6
6
|
"engines": {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"type": "git",
|
|
11
11
|
"url": "git+https://github.com/digdir/designsystemet.git"
|
|
12
12
|
},
|
|
13
|
-
"homepage": "https://github.com/digdir/designsystemet/tree/main/
|
|
13
|
+
"homepage": "https://github.com/digdir/designsystemet/tree/main/packages/cli",
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"type": "module",
|
|
16
16
|
"main": "./dist/src/index.js",
|
|
@@ -34,22 +34,22 @@
|
|
|
34
34
|
"access": "public"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@commander-js/extra-typings": "^
|
|
37
|
+
"@commander-js/extra-typings": "^14.0.0",
|
|
38
38
|
"@tokens-studio/sd-transforms": "1.3.0",
|
|
39
39
|
"apca-w3": "^0.1.9",
|
|
40
40
|
"chalk": "^5.4.1",
|
|
41
41
|
"change-case": "^5.4.4",
|
|
42
42
|
"chroma-js": "^3.1.2",
|
|
43
43
|
"colorjs.io": "^0.6.0-alpha.1",
|
|
44
|
-
"commander": "^
|
|
44
|
+
"commander": "^14.0.0",
|
|
45
45
|
"fast-glob": "^3.3.3",
|
|
46
46
|
"hsluv": "^1.0.1",
|
|
47
47
|
"object-hash": "^3.0.0",
|
|
48
|
-
"postcss": "^8.5.
|
|
48
|
+
"postcss": "^8.5.6",
|
|
49
49
|
"ramda": "^0.30.1",
|
|
50
|
-
"style-dictionary": "^
|
|
51
|
-
"zod": "^3.25.
|
|
52
|
-
"zod-validation-error": "^3.
|
|
50
|
+
"style-dictionary": "^5.0.0",
|
|
51
|
+
"zod": "^3.25.67",
|
|
52
|
+
"zod-validation-error": "^3.5.2"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@tokens-studio/types": "0.5.2",
|
|
@@ -57,21 +57,18 @@
|
|
|
57
57
|
"@types/chroma-js": "^3.1.1",
|
|
58
58
|
"@types/fs-extra": "^11.0.4",
|
|
59
59
|
"@types/glob": "^8.1.0",
|
|
60
|
-
"@types/
|
|
61
|
-
"@types/node": "^22.15.21",
|
|
60
|
+
"@types/node": "^22.15.32",
|
|
62
61
|
"@types/object-hash": "^3.0.6",
|
|
63
62
|
"@types/ramda": "^0.30.2",
|
|
64
63
|
"fs-extra": "^11.3.0",
|
|
65
|
-
"ts-toolbelt": "^9.6.0",
|
|
66
64
|
"tslib": "^2.8.1",
|
|
67
65
|
"tsup": "^8.5.0",
|
|
68
|
-
"tsx": "^4.
|
|
66
|
+
"tsx": "^4.20.3",
|
|
69
67
|
"typescript": "^5.8.3"
|
|
70
68
|
},
|
|
71
69
|
"scripts": {
|
|
72
70
|
"designsystemet": "tsx ./bin/designsystemet.ts",
|
|
73
|
-
"
|
|
74
|
-
"build:tokens:debug": "tsx --inspect-brk ./bin/designsystemet.ts tokens build -p -t ../../internal/design-tokens -o ../../packages/theme/brand --clean",
|
|
71
|
+
"designsystemet:inspect": "tsx --inspect-brk ./bin/designsystemet.ts",
|
|
75
72
|
"build": "tsup && pnpm build:types && pnpm build:json-schema",
|
|
76
73
|
"build:types": "tsc --emitDeclarationOnly --declaration",
|
|
77
74
|
"build:json-schema": "tsx ./src/scripts/createJsonSchema.ts",
|
|
@@ -79,13 +76,17 @@
|
|
|
79
76
|
"test:tokens-create-options": "pnpm run designsystemet tokens create -m dominant:\"#007682\" -n \"#003333\" -b 99 -o ./temp/options/design-tokens --theme options --clean",
|
|
80
77
|
"test:tokens-create-config": "pnpm run designsystemet tokens create --config ./configs/test-tokens.config.json",
|
|
81
78
|
"test:tokens-build": "pnpm run designsystemet tokens build -t ./temp/options/design-tokens -o ./temp/options/build --clean",
|
|
79
|
+
"test:tokens-build-tailwind": "pnpm run designsystemet tokens build -t ./temp/options/design-tokens -o ./temp/options/build --clean --experimental-tailwind",
|
|
82
80
|
"test:tokens-build-config": "pnpm run designsystemet tokens build -t ./temp/config/design-tokens -o ./temp/config/build --clean",
|
|
81
|
+
"test:tokens-build-config:inspect": "pnpm run designsystemet:inspect tokens build -t ./temp/config/design-tokens -o ./temp/config/build --clean",
|
|
82
|
+
"test:tokens-build-config-tailwind": "pnpm run designsystemet tokens build -t ./temp/config/design-tokens -o ./temp/config/build --clean --experimental-tailwind",
|
|
83
83
|
"test:tokens-create-and-build-options": "pnpm test:tokens-create-options && pnpm test:tokens-build",
|
|
84
84
|
"test:tokens-create-and-build-config": "pnpm test:tokens-create-config && pnpm test:tokens-build-config",
|
|
85
85
|
"test": "pnpm test:tokens-create-and-build-options && pnpm test:tokens-create-and-build-config",
|
|
86
|
+
"digdir:tokens-build": "pnpm run designsystemet tokens build -t ../../internal/design-tokens -o ../../packages/theme/brand --clean --experimental-tailwind",
|
|
86
87
|
"digdir:tokens-create": "pnpm run designsystemet tokens create --config ./configs/digdir.config.json",
|
|
87
88
|
"update:template": "tsx ./src/scripts/update-template.ts",
|
|
88
|
-
"update:theme-digdir": "pnpm digdir:tokens-create && tsx ./src/scripts/update-design-tokens.ts",
|
|
89
|
+
"update:theme-digdir": "pnpm digdir:tokens-create && tsx ./src/scripts/update-design-tokens.ts && pnpm digdir:tokens-build",
|
|
89
90
|
"verify": "pnpm test && pnpm update:template && pnpm update:theme-digdir && pnpm build:tokens"
|
|
90
91
|
}
|
|
91
92
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../../src/tokens/process/theme.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,eAAO,MAAM,iBAAiB,QAA2B,CAAC;AAE1D,KAAK,mBAAmB,GAAG;IACzB,6GAA6G;IAC7G,eAAe,EAAE,aAAa,CAAC;IAC/B,iEAAiE;IACjE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,mBAAmB,GAAI,kCAGjC,mBAAmB,KAAG,UAAU,EA8ElC,CAAC"}
|