@digdir/designsystemet 1.7.3 → 1.9.0

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.
Files changed (30) hide show
  1. package/configs/test-tokens.config.json +10 -0
  2. package/dist/bin/config.js +12 -1
  3. package/dist/bin/designsystemet.js +52 -14
  4. package/dist/{color.base.template-QGZJKXMN.json → color.base.template-5XWYH2F5.json} +3 -3
  5. package/dist/config.schema.json +33 -0
  6. package/dist/src/config.d.ts +30 -0
  7. package/dist/src/config.d.ts.map +1 -1
  8. package/dist/src/config.js +12 -1
  9. package/dist/src/index.js +50 -12
  10. package/dist/src/scripts/createJsonSchema.js +12 -1
  11. package/dist/src/scripts/update-preview-tokens.js +30 -4
  12. package/dist/src/scripts/update-template.js +12 -2
  13. package/dist/src/tokens/build.js +10 -9
  14. package/dist/src/tokens/create/generators/$designsystemet.js +8 -7
  15. package/dist/src/tokens/create/generators/color.d.ts.map +1 -1
  16. package/dist/src/tokens/create/generators/color.js +18 -2
  17. package/dist/src/tokens/create/generators/semantic.js +2 -2
  18. package/dist/src/tokens/create/generators/theme.d.ts.map +1 -1
  19. package/dist/src/tokens/create/generators/theme.js +10 -0
  20. package/dist/src/tokens/create/write.js +8 -7
  21. package/dist/src/tokens/create.js +30 -4
  22. package/dist/src/tokens/format.js +38 -11
  23. package/dist/src/tokens/index.js +38 -11
  24. package/dist/src/tokens/process/output/declarations.js +10 -9
  25. package/dist/src/tokens/process/output/theme.js +8 -7
  26. package/dist/src/tokens/template/design-tokens/semantic/color.base.template.js +1 -1
  27. package/dist/src/types.d.ts +4 -50
  28. package/dist/src/types.d.ts.map +1 -1
  29. package/dist/src/types.js +6 -0
  30. package/package.json +9 -8
@@ -1,5 +1,5 @@
1
1
  // src/tokens/template/design-tokens/semantic/color.base.template.json
2
- var color_base_template_default = "../../../../../color.base.template-QGZJKXMN.json";
2
+ var color_base_template_default = "../../../../../color.base.template-5XWYH2F5.json";
3
3
  export {
4
4
  color_base_template_default as default
5
5
  };
@@ -1,52 +1,6 @@
1
- declare const emptyObjectSymbol: unique symbol;
2
- type EmptyObject = {
3
- [emptyObjectSymbol]?: never;
4
- };
5
- /**
6
- * Base interface for available colors in Designsystemet.
7
- * The CLI will generate augmentations of this interface to allow
8
- * type safety of custom color names.
1
+ /*!
2
+ * This file is deprecated and will be removed in a future release.
3
+ * Use @digdir/designsystemet-types instead
9
4
  */
10
- export interface ColorDefinitions {
11
- }
12
- export interface SeverityColorDefinitions {
13
- }
14
- /**
15
- * If {@link ColorDefinitions} or {@link SeverityColorDefinitions} has been extended to include color names, return T,
16
- * otherwise return the arbitrary string type.
17
- */
18
- type ColorWithFallback<T> = ColorDefinitions extends EmptyObject ? string : T;
19
- /**
20
- * Represents the available severity colors for the Designsystemet variables.
21
- * These are predefined colors that can be used to indicate different levels of severity.
22
- * - `'info'`: Use the info color.
23
- * - `'success'`: Use the success color.
24
- * - `'warning'`: Use the warning color.
25
- * - `'danger'`: Use the danger color.
26
- */
27
- export type SeverityColors = ColorWithFallback<keyof SeverityColorDefinitions>;
28
- /**
29
- * Represents the available color options for the Designsystemet variables.
30
- *
31
- * These are augmented based on your theme configuration.
32
- *
33
- * Consist of both main and support colors
34
- * @link https://theme.designsystemet.no
35
- */
36
- export type Color = ColorWithFallback<keyof ColorDefinitions>;
37
- /**
38
- * Represents the recommended size options for the Designsystemet variables.
39
- * - `'sm'`: Use the small size.
40
- * - `'md'`: Use the medium size.
41
- * - `'lg'`: Use the large size.
42
- */
43
- export type Size = 'sm' | 'md' | 'lg';
44
- /**
45
- * Represents the available color scheme options for the Designsystemet variables.
46
- * - `'light'`: Use the light color scheme.
47
- * - `'dark'`: Use the dark color scheme.
48
- * - `'auto'`: Automatically select the color scheme based on system preferences.
49
- */
50
- export type ColorScheme = 'light' | 'dark' | 'auto';
51
- export {};
5
+ export * from '@digdir/designsystemet-types';
52
6
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAGA,OAAO,CAAC,MAAM,iBAAiB,EAAE,OAAO,MAAM,CAAC;AAC/C,KAAK,WAAW,GAAG;IAAE,CAAC,iBAAiB,CAAC,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AAEnD;;;;GAIG;AAGH,MAAM,WAAW,gBAAgB;CAAG;AAEpC,MAAM,WAAW,wBAAwB;CAAG;AAE5C;;;GAGG;AACH,KAAK,iBAAiB,CAAC,CAAC,IAAI,gBAAgB,SAAS,WAAW,GAAG,MAAM,GAAG,CAAC,CAAC;AAE9E;;;;;;;GAOG;AACH,MAAM,MAAM,cAAc,GAAG,iBAAiB,CAAC,MAAM,wBAAwB,CAAC,CAAC;AAC/E;;;;;;;GAOG;AACH,MAAM,MAAM,KAAK,GAAG,iBAAiB,CAAC,MAAM,gBAAgB,CAAC,CAAC;AAC9D;;;;;GAKG;AACH,MAAM,MAAM,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AACtC;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,8BAA8B,CAAC"}
package/dist/src/types.js CHANGED
@@ -0,0 +1,6 @@
1
+ // src/types.ts
2
+ export * from "@digdir/designsystemet-types";
3
+ /*!
4
+ * This file is deprecated and will be removed in a future release.
5
+ * Use @digdir/designsystemet-types instead
6
+ */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digdir/designsystemet",
3
- "version": "1.7.3",
3
+ "version": "1.9.0",
4
4
  "description": "CLI for Designsystemet",
5
5
  "author": "Designsystemet team",
6
6
  "engines": {
@@ -38,10 +38,10 @@
38
38
  },
39
39
  "dependencies": {
40
40
  "@commander-js/extra-typings": "^14.0.0",
41
- "@tokens-studio/sd-transforms": "1.3.0",
41
+ "@tokens-studio/sd-transforms": "2.0.3",
42
42
  "apca-w3": "^0.1.9",
43
43
  "change-case": "^5.4.4",
44
- "chroma-js": "^3.1.2",
44
+ "chroma-js": "^3.2.0",
45
45
  "colorjs.io": "^0.6.0-alpha.1",
46
46
  "commander": "^14.0.2",
47
47
  "fast-glob": "^3.3.3",
@@ -51,21 +51,22 @@
51
51
  "postcss": "^8.5.6",
52
52
  "ramda": "^0.32.0",
53
53
  "style-dictionary": "^5.1.1",
54
- "zod": "^4.1.12",
55
- "zod-validation-error": "^4.0.2"
54
+ "zod": "^4.1.13",
55
+ "zod-validation-error": "^4.0.2",
56
+ "@digdir/designsystemet-types": "^1.9.0"
56
57
  },
57
58
  "devDependencies": {
58
59
  "@tokens-studio/types": "0.5.2",
59
60
  "@types/apca-w3": "^0.1.3",
60
61
  "@types/chroma-js": "^3.1.2",
61
62
  "@types/fs-extra": "^11.0.4",
62
- "@types/node": "^22.19.0",
63
+ "@types/node": "^22.19.1",
63
64
  "@types/object-hash": "^3.0.6",
64
65
  "@types/ramda": "^0.31.1",
65
66
  "fs-extra": "^11.3.2",
66
67
  "tslib": "^2.8.1",
67
- "tsup": "^8.5.0",
68
- "tsx": "^4.20.6",
68
+ "tsup": "^8.5.1",
69
+ "tsx": "^4.21.0",
69
70
  "typescript": "^5.9.3"
70
71
  },
71
72
  "scripts": {