@digdir/designsystemet 1.0.0-next.45 → 1.0.0-next.47
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 +162 -0
- package/dist/bin/config.d.ts.map +1 -0
- package/dist/bin/config.js +56 -0
- package/dist/bin/designsystemet.js +140 -29
- package/dist/bin/options.d.ts +16 -0
- package/dist/bin/options.d.ts.map +1 -0
- package/dist/bin/options.js +12 -0
- package/dist/config.schema.json +82 -0
- package/dist/src/build-scripts/createJsonSchema.d.ts +2 -0
- package/dist/src/build-scripts/createJsonSchema.d.ts.map +1 -0
- package/dist/src/build-scripts/createJsonSchema.js +15 -0
- package/dist/src/tokens/build/configs.d.ts.map +1 -1
- package/dist/src/tokens/build/configs.js +23 -12
- package/dist/src/tokens/build/formats/css.d.ts +4 -2
- package/dist/src/tokens/build/formats/css.d.ts.map +1 -1
- package/dist/src/tokens/build/formats/css.js +20 -12
- package/dist/src/tokens/build/formats/js-tokens.d.ts.map +1 -1
- package/dist/src/tokens/build/formats/js-tokens.js +7 -4
- package/dist/src/tokens/build/transformers.d.ts +0 -1
- package/dist/src/tokens/build/transformers.d.ts.map +1 -1
- package/dist/src/tokens/build/transformers.js +1 -13
- package/dist/src/tokens/build.d.ts +3 -1
- package/dist/src/tokens/build.d.ts.map +1 -1
- package/dist/src/tokens/build.js +5 -2
- package/dist/src/tokens/create.d.ts +16 -11
- package/dist/src/tokens/create.d.ts.map +1 -1
- package/dist/src/tokens/create.js +15 -5
- package/dist/src/tokens/design-tokens/default/Figma/components.json +3 -3
- package/dist/src/tokens/design-tokens/default/primitives/globals.json +1 -1
- package/dist/src/tokens/design-tokens/default/primitives/modes/size/global.json +21 -21
- package/dist/src/tokens/design-tokens/default/semantic/style.json +109 -27
- package/dist/src/tokens/design-tokens/template/$themes.json +63 -63
- package/dist/src/tokens/design-tokens/template/semantic/color-base-file.json +1 -1
- package/dist/src/tokens/design-tokens/template/themes/theme-base-file.json +8 -8
- package/dist/src/tokens/index.d.ts +2 -1
- package/dist/src/tokens/index.d.ts.map +1 -1
- package/dist/src/tokens/index.js +2 -2
- package/dist/src/tokens/types.d.ts +2 -8
- package/dist/src/tokens/types.d.ts.map +1 -1
- package/dist/src/tokens/utils.d.ts +2 -0
- package/dist/src/tokens/utils.d.ts.map +1 -1
- package/dist/src/tokens/utils.js +11 -0
- package/dist/src/tokens/write.d.ts +3 -0
- package/dist/src/tokens/write.d.ts.map +1 -1
- package/dist/src/tokens/write.js +6 -2
- package/package.json +23 -17
- package/dist/src/init/createTokensPackage.d.ts +0 -5
- package/dist/src/init/createTokensPackage.d.ts.map +0 -1
- package/dist/src/init/createTokensPackage.js +0 -273
- package/dist/src/init/generateMetadataJson.d.ts +0 -6
- package/dist/src/init/generateMetadataJson.d.ts.map +0 -1
- package/dist/src/init/generateMetadataJson.js +0 -24
- package/dist/src/init/generateThemesJson.d.ts +0 -3
- package/dist/src/init/generateThemesJson.d.ts.map +0 -1
- package/dist/src/init/generateThemesJson.js +0 -103
- package/dist/src/init/index.d.ts +0 -3
- package/dist/src/init/index.d.ts.map +0 -1
- package/dist/src/init/index.js +0 -10
- package/dist/src/init/nextStepsMarkdown.d.ts +0 -3
- package/dist/src/init/nextStepsMarkdown.d.ts.map +0 -1
- package/dist/src/init/nextStepsMarkdown.js +0 -92
- package/dist/src/init/template/default-files/README.md +0 -10
- package/dist/src/init/template/default-files/design-tokens/Figma/components.json +0 -22
- package/dist/src/init/template/default-files/design-tokens/README.md +0 -3
- package/dist/src/init/template/default-files/design-tokens/primitives/globals.json +0 -161
- package/dist/src/init/template/default-files/design-tokens/primitives/size/default.json +0 -175
- package/dist/src/init/template/default-files/design-tokens/semantic/color.json +0 -572
- package/dist/src/init/template/default-files/design-tokens/semantic/style.json +0 -564
- package/dist/src/init/template/default-files/design-tokens/themes/theme.json +0 -334
- package/dist/src/init/template/template-files/design-tokens/primitives/modes/colors/contrast/global.json +0 -376
- package/dist/src/init/template/template-files/design-tokens/primitives/modes/colors/contrast/theme-template.json +0 -314
- package/dist/src/init/template/template-files/design-tokens/primitives/modes/colors/dark/global.json +0 -376
- package/dist/src/init/template/template-files/design-tokens/primitives/modes/colors/dark/theme-template.json +0 -314
- package/dist/src/init/template/template-files/design-tokens/primitives/modes/colors/light/global.json +0 -376
- package/dist/src/init/template/template-files/design-tokens/primitives/modes/colors/light/theme-template.json +0 -314
- package/dist/src/init/template/template-files/design-tokens/primitives/modes/typography/primary/theme-template.json +0 -30
- package/dist/src/init/template/template-files/design-tokens/primitives/modes/typography/secondary/theme-template.json +0 -30
- package/dist/src/init/template/template-files/design-tokens/themes/theme-template.json +0 -334
- package/dist/src/init/template/template-files/package.json +0 -24
- package/dist/src/init/utils.d.ts +0 -4
- package/dist/src/init/utils.d.ts.map +0 -1
- package/dist/src/init/utils.js +0 -15
- package/dist/src/tokens/build/utils/noCase.d.ts +0 -11
- package/dist/src/tokens/build/utils/noCase.d.ts.map +0 -1
- package/dist/src/tokens/build/utils/noCase.js +0 -24
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "package-name-here",
|
|
3
|
-
"version": "1.0.0",
|
|
4
|
-
"description": "CSS variables for @digdir/designsystemet",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "dist/<default-theme>",
|
|
7
|
-
"files": [
|
|
8
|
-
"dist"
|
|
9
|
-
],
|
|
10
|
-
"exports": {
|
|
11
|
-
".": "./dist/<default-theme>",
|
|
12
|
-
"./*": "./dist/*"
|
|
13
|
-
},
|
|
14
|
-
"scripts": {
|
|
15
|
-
"build": "npm run clean && designsystemet tokens -o ./dist",
|
|
16
|
-
"clean": "rimraf dist"
|
|
17
|
-
},
|
|
18
|
-
"author": "",
|
|
19
|
-
"license": "ISC",
|
|
20
|
-
"devDependencies": {
|
|
21
|
-
"@digdir/designsystemet": "^0.1.0-next.22",
|
|
22
|
-
"rimraf": "^5.0.7"
|
|
23
|
-
}
|
|
24
|
-
}
|
package/dist/src/init/utils.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/init/utils.ts"],"names":[],"mappings":"AAEA,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE1D;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAG3D;AAED,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,UAOrD"}
|
package/dist/src/init/utils.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { kebabCase } from "change-case";
|
|
2
|
-
function normalizeTokenSetName(name) {
|
|
3
|
-
return kebabCase(name);
|
|
4
|
-
}
|
|
5
|
-
function toGeneratedCssFileName(name) {
|
|
6
|
-
return `${name.toLowerCase()}.css`;
|
|
7
|
-
}
|
|
8
|
-
function toValidPackageName(projectName) {
|
|
9
|
-
return projectName.trim().toLowerCase().replace(/\s+/g, "-").replace(/^[._]/, "").replace(/[^a-z\d\-~]+/g, "-");
|
|
10
|
-
}
|
|
11
|
-
export {
|
|
12
|
-
normalizeTokenSetName,
|
|
13
|
-
toGeneratedCssFileName,
|
|
14
|
-
toValidPackageName
|
|
15
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export interface Options {
|
|
2
|
-
splitRegexp?: RegExp | RegExp[];
|
|
3
|
-
stripRegexp?: RegExp | RegExp[];
|
|
4
|
-
delimiter?: string;
|
|
5
|
-
transform?: (part: string, index: number, parts: string[]) => string;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Normalize the string into something other libraries can manipulate easier.
|
|
9
|
-
*/
|
|
10
|
-
export declare function noCase(input: string, options?: Options): string;
|
|
11
|
-
//# sourceMappingURL=noCase.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"noCase.d.ts","sourceRoot":"","sources":["../../../../../src/tokens/build/utils/noCase.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,OAAO;IACtB,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,MAAM,CAAC;CACtE;AAQD;;GAEG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE,OAAY,UAkB1D"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
const lowerCase = (text = "") => text.toLowerCase();
|
|
2
|
-
const DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g];
|
|
3
|
-
const DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;
|
|
4
|
-
function noCase(input, options = {}) {
|
|
5
|
-
const {
|
|
6
|
-
splitRegexp = DEFAULT_SPLIT_REGEXP,
|
|
7
|
-
stripRegexp = DEFAULT_STRIP_REGEXP,
|
|
8
|
-
transform = lowerCase,
|
|
9
|
-
delimiter = " "
|
|
10
|
-
} = options;
|
|
11
|
-
const result = replace(replace(input, splitRegexp, "$1\0$2"), stripRegexp, "\0");
|
|
12
|
-
let start = 0;
|
|
13
|
-
let end = result.length;
|
|
14
|
-
while (result.charAt(start) === "\0") start++;
|
|
15
|
-
while (result.charAt(end - 1) === "\0") end--;
|
|
16
|
-
return result.slice(start, end).split("\0").map(transform).join(delimiter);
|
|
17
|
-
}
|
|
18
|
-
function replace(input, re, value) {
|
|
19
|
-
if (re instanceof RegExp) return input.replace(re, value);
|
|
20
|
-
return re.reduce((input2, re2) => input2.replace(re2, value), input);
|
|
21
|
-
}
|
|
22
|
-
export {
|
|
23
|
-
noCase
|
|
24
|
-
};
|