@digdir/designsystemet 0.0.0-ci-snapshot-release-pr-comment-20260612060845

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 (194) hide show
  1. package/LICENSE +7 -0
  2. package/README.md +115 -0
  3. package/dist/bin/config.d.ts +12 -0
  4. package/dist/bin/config.d.ts.map +1 -0
  5. package/dist/bin/config.js +58 -0
  6. package/dist/bin/designsystemet.d.ts +3 -0
  7. package/dist/bin/designsystemet.d.ts.map +1 -0
  8. package/dist/bin/designsystemet.js +163 -0
  9. package/dist/bin/options.d.ts +21 -0
  10. package/dist/bin/options.d.ts.map +1 -0
  11. package/dist/bin/options.js +23 -0
  12. package/dist/config.schema.json +209 -0
  13. package/dist/node_modules/.pnpm/@tokens-studio_types@0.5.2/node_modules/@tokens-studio/types/dist/constants/BorderValues.js +9 -0
  14. package/dist/node_modules/.pnpm/@tokens-studio_types@0.5.2/node_modules/@tokens-studio/types/dist/constants/BoxShadowTypes.js +8 -0
  15. package/dist/node_modules/.pnpm/@tokens-studio_types@0.5.2/node_modules/@tokens-studio/types/dist/constants/BoxShadowValues.js +13 -0
  16. package/dist/node_modules/.pnpm/@tokens-studio_types@0.5.2/node_modules/@tokens-studio/types/dist/constants/ColorModifierTypes.js +10 -0
  17. package/dist/node_modules/.pnpm/@tokens-studio_types@0.5.2/node_modules/@tokens-studio/types/dist/constants/ColorSpaceTypes.js +10 -0
  18. package/dist/node_modules/.pnpm/@tokens-studio_types@0.5.2/node_modules/@tokens-studio/types/dist/constants/Properties.js +53 -0
  19. package/dist/node_modules/.pnpm/@tokens-studio_types@0.5.2/node_modules/@tokens-studio/types/dist/constants/StrokeStyleValues.js +14 -0
  20. package/dist/node_modules/.pnpm/@tokens-studio_types@0.5.2/node_modules/@tokens-studio/types/dist/constants/TokenSetStatus.js +9 -0
  21. package/dist/node_modules/.pnpm/@tokens-studio_types@0.5.2/node_modules/@tokens-studio/types/dist/constants/TokenTypes.js +32 -0
  22. package/dist/node_modules/.pnpm/@tokens-studio_types@0.5.2/node_modules/@tokens-studio/types/dist/constants/TypographyValues.js +15 -0
  23. package/dist/node_modules/.pnpm/@tokens-studio_types@0.5.2/node_modules/@tokens-studio/types/dist/types/index.js +11 -0
  24. package/dist/package.js +5 -0
  25. package/dist/src/colors/colorMetadata.d.ts +56 -0
  26. package/dist/src/colors/colorMetadata.d.ts.map +1 -0
  27. package/dist/src/colors/colorMetadata.js +259 -0
  28. package/dist/src/colors/index.d.ts +5 -0
  29. package/dist/src/colors/index.d.ts.map +1 -0
  30. package/dist/src/colors/index.js +5 -0
  31. package/dist/src/colors/theme.d.ts +30 -0
  32. package/dist/src/colors/theme.d.ts.map +1 -0
  33. package/dist/src/colors/theme.js +111 -0
  34. package/dist/src/colors/types.d.ts +69 -0
  35. package/dist/src/colors/types.d.ts.map +1 -0
  36. package/dist/src/colors/types.js +24 -0
  37. package/dist/src/colors/utils.d.ts +128 -0
  38. package/dist/src/colors/utils.d.ts.map +1 -0
  39. package/dist/src/colors/utils.js +244 -0
  40. package/dist/src/config.d.ts +181 -0
  41. package/dist/src/config.d.ts.map +1 -0
  42. package/dist/src/config.js +118 -0
  43. package/dist/src/index.d.ts +4 -0
  44. package/dist/src/index.d.ts.map +1 -0
  45. package/dist/src/index.js +10 -0
  46. package/dist/src/migrations/beta-to-v1.d.ts +3 -0
  47. package/dist/src/migrations/beta-to-v1.d.ts.map +1 -0
  48. package/dist/src/migrations/beta-to-v1.js +340 -0
  49. package/dist/src/migrations/codemods/css/plugins.d.ts +6 -0
  50. package/dist/src/migrations/codemods/css/plugins.d.ts.map +1 -0
  51. package/dist/src/migrations/codemods/css/plugins.js +35 -0
  52. package/dist/src/migrations/codemods/css/run.d.ts +8 -0
  53. package/dist/src/migrations/codemods/css/run.d.ts.map +1 -0
  54. package/dist/src/migrations/codemods/css/run.js +23 -0
  55. package/dist/src/migrations/color-rename-next49.d.ts +3 -0
  56. package/dist/src/migrations/color-rename-next49.d.ts.map +1 -0
  57. package/dist/src/migrations/color-rename-next49.js +46 -0
  58. package/dist/src/migrations/index.d.ts +6 -0
  59. package/dist/src/migrations/index.d.ts.map +1 -0
  60. package/dist/src/migrations/index.js +9 -0
  61. package/dist/src/scripts/createJsonSchema.d.ts +2 -0
  62. package/dist/src/scripts/createJsonSchema.d.ts.map +1 -0
  63. package/dist/src/scripts/update-preview-tokens.d.ts +3 -0
  64. package/dist/src/scripts/update-preview-tokens.d.ts.map +1 -0
  65. package/dist/src/tokens/build.d.ts +4 -0
  66. package/dist/src/tokens/build.d.ts.map +1 -0
  67. package/dist/src/tokens/build.js +41 -0
  68. package/dist/src/tokens/create/files.d.ts +16 -0
  69. package/dist/src/tokens/create/files.d.ts.map +1 -0
  70. package/dist/src/tokens/create/files.js +46 -0
  71. package/dist/src/tokens/create/generators/$designsystemet.d.ts +5 -0
  72. package/dist/src/tokens/create/generators/$designsystemet.d.ts.map +1 -0
  73. package/dist/src/tokens/create/generators/$designsystemet.js +10 -0
  74. package/dist/src/tokens/create/generators/$metadata.d.ts +12 -0
  75. package/dist/src/tokens/create/generators/$metadata.d.ts.map +1 -0
  76. package/dist/src/tokens/create/generators/$metadata.js +25 -0
  77. package/dist/src/tokens/create/generators/$themes.d.ts +25 -0
  78. package/dist/src/tokens/create/generators/$themes.d.ts.map +1 -0
  79. package/dist/src/tokens/create/generators/$themes.js +159 -0
  80. package/dist/src/tokens/create/generators/primitives/color-scheme.d.ts +5 -0
  81. package/dist/src/tokens/create/generators/primitives/color-scheme.d.ts.map +1 -0
  82. package/dist/src/tokens/create/generators/primitives/color-scheme.js +71 -0
  83. package/dist/src/tokens/create/generators/primitives/globals.d.ts +3 -0
  84. package/dist/src/tokens/create/generators/primitives/globals.d.ts.map +1 -0
  85. package/dist/src/tokens/create/generators/primitives/globals.js +142 -0
  86. package/dist/src/tokens/create/generators/primitives/size.d.ts +4 -0
  87. package/dist/src/tokens/create/generators/primitives/size.d.ts.map +1 -0
  88. package/dist/src/tokens/create/generators/primitives/size.js +147 -0
  89. package/dist/src/tokens/create/generators/primitives/typography.d.ts +4 -0
  90. package/dist/src/tokens/create/generators/primitives/typography.d.ts.map +1 -0
  91. package/dist/src/tokens/create/generators/primitives/typography.js +216 -0
  92. package/dist/src/tokens/create/generators/semantic/color-modes.d.ts +8 -0
  93. package/dist/src/tokens/create/generators/semantic/color-modes.d.ts.map +1 -0
  94. package/dist/src/tokens/create/generators/semantic/color-modes.js +26 -0
  95. package/dist/src/tokens/create/generators/semantic/color.d.ts +5 -0
  96. package/dist/src/tokens/create/generators/semantic/color.d.ts.map +1 -0
  97. package/dist/src/tokens/create/generators/semantic/color.js +46 -0
  98. package/dist/src/tokens/create/generators/semantic/style.d.ts +3 -0
  99. package/dist/src/tokens/create/generators/semantic/style.d.ts.map +1 -0
  100. package/dist/src/tokens/create/generators/semantic/style.js +381 -0
  101. package/dist/src/tokens/create/generators/themes/theme.d.ts +3 -0
  102. package/dist/src/tokens/create/generators/themes/theme.d.ts.map +1 -0
  103. package/dist/src/tokens/create/generators/themes/theme.js +112 -0
  104. package/dist/src/tokens/create.d.ts +22 -0
  105. package/dist/src/tokens/create.d.ts.map +1 -0
  106. package/dist/src/tokens/create.js +50 -0
  107. package/dist/src/tokens/format.d.ts +15 -0
  108. package/dist/src/tokens/format.d.ts.map +1 -0
  109. package/dist/src/tokens/format.js +38 -0
  110. package/dist/src/tokens/generate-config.d.ts +10 -0
  111. package/dist/src/tokens/generate-config.d.ts.map +1 -0
  112. package/dist/src/tokens/generate-config.js +178 -0
  113. package/dist/src/tokens/index.d.ts +4 -0
  114. package/dist/src/tokens/index.d.ts.map +1 -0
  115. package/dist/src/tokens/index.js +3 -0
  116. package/dist/src/tokens/process/configs/color.d.ts +12 -0
  117. package/dist/src/tokens/process/configs/color.d.ts.map +1 -0
  118. package/dist/src/tokens/process/configs/color.js +51 -0
  119. package/dist/src/tokens/process/configs/semantic.d.ts +3 -0
  120. package/dist/src/tokens/process/configs/semantic.d.ts.map +1 -0
  121. package/dist/src/tokens/process/configs/semantic.js +47 -0
  122. package/dist/src/tokens/process/configs/shared.d.ts +10 -0
  123. package/dist/src/tokens/process/configs/shared.d.ts.map +1 -0
  124. package/dist/src/tokens/process/configs/shared.js +19 -0
  125. package/dist/src/tokens/process/configs/size-mode.d.ts +3 -0
  126. package/dist/src/tokens/process/configs/size-mode.d.ts.map +1 -0
  127. package/dist/src/tokens/process/configs/size-mode.js +28 -0
  128. package/dist/src/tokens/process/configs/size.d.ts +3 -0
  129. package/dist/src/tokens/process/configs/size.d.ts.map +1 -0
  130. package/dist/src/tokens/process/configs/size.js +34 -0
  131. package/dist/src/tokens/process/configs/type-scale.d.ts +3 -0
  132. package/dist/src/tokens/process/configs/type-scale.d.ts.map +1 -0
  133. package/dist/src/tokens/process/configs/type-scale.js +49 -0
  134. package/dist/src/tokens/process/configs/typography.d.ts +3 -0
  135. package/dist/src/tokens/process/configs/typography.d.ts.map +1 -0
  136. package/dist/src/tokens/process/configs/typography.js +64 -0
  137. package/dist/src/tokens/process/configs.d.ts +20 -0
  138. package/dist/src/tokens/process/configs.d.ts.map +1 -0
  139. package/dist/src/tokens/process/configs.js +93 -0
  140. package/dist/src/tokens/process/formats/css/color.d.ts +4 -0
  141. package/dist/src/tokens/process/formats/css/color.d.ts.map +1 -0
  142. package/dist/src/tokens/process/formats/css/color.js +63 -0
  143. package/dist/src/tokens/process/formats/css/semantic.d.ts +3 -0
  144. package/dist/src/tokens/process/formats/css/semantic.d.ts.map +1 -0
  145. package/dist/src/tokens/process/formats/css/semantic.js +29 -0
  146. package/dist/src/tokens/process/formats/css/size-mode.d.ts +4 -0
  147. package/dist/src/tokens/process/formats/css/size-mode.d.ts.map +1 -0
  148. package/dist/src/tokens/process/formats/css/size-mode.js +50 -0
  149. package/dist/src/tokens/process/formats/css/size.d.ts +21 -0
  150. package/dist/src/tokens/process/formats/css/size.d.ts.map +1 -0
  151. package/dist/src/tokens/process/formats/css/size.js +93 -0
  152. package/dist/src/tokens/process/formats/css/type-scale.d.ts +3 -0
  153. package/dist/src/tokens/process/formats/css/type-scale.d.ts.map +1 -0
  154. package/dist/src/tokens/process/formats/css/type-scale.js +55 -0
  155. package/dist/src/tokens/process/formats/css/typography.d.ts +3 -0
  156. package/dist/src/tokens/process/formats/css/typography.d.ts.map +1 -0
  157. package/dist/src/tokens/process/formats/css/typography.js +29 -0
  158. package/dist/src/tokens/process/formats/css.d.ts +11 -0
  159. package/dist/src/tokens/process/formats/css.d.ts.map +1 -0
  160. package/dist/src/tokens/process/formats/css.js +18 -0
  161. package/dist/src/tokens/process/output/declarations.d.ts +5 -0
  162. package/dist/src/tokens/process/output/declarations.d.ts.map +1 -0
  163. package/dist/src/tokens/process/output/declarations.js +38 -0
  164. package/dist/src/tokens/process/output/tailwind.d.ts +3 -0
  165. package/dist/src/tokens/process/output/tailwind.d.ts.map +1 -0
  166. package/dist/src/tokens/process/output/tailwind.js +45 -0
  167. package/dist/src/tokens/process/output/theme.d.ts +27 -0
  168. package/dist/src/tokens/process/output/theme.d.ts.map +1 -0
  169. package/dist/src/tokens/process/output/theme.js +83 -0
  170. package/dist/src/tokens/process/platform.d.ts +106 -0
  171. package/dist/src/tokens/process/platform.d.ts.map +1 -0
  172. package/dist/src/tokens/process/platform.js +168 -0
  173. package/dist/src/tokens/process/transformers.d.ts +6 -0
  174. package/dist/src/tokens/process/transformers.d.ts.map +1 -0
  175. package/dist/src/tokens/process/transformers.js +54 -0
  176. package/dist/src/tokens/process/utils/getMultidimensionalThemes.d.ts +36 -0
  177. package/dist/src/tokens/process/utils/getMultidimensionalThemes.d.ts.map +1 -0
  178. package/dist/src/tokens/process/utils/getMultidimensionalThemes.js +114 -0
  179. package/dist/src/tokens/process/utils/kebab-case.d.ts +5 -0
  180. package/dist/src/tokens/process/utils/kebab-case.d.ts.map +1 -0
  181. package/dist/src/tokens/process/utils/kebab-case.js +9 -0
  182. package/dist/src/tokens/types.d.ts +80 -0
  183. package/dist/src/tokens/types.d.ts.map +1 -0
  184. package/dist/src/tokens/types.js +7 -0
  185. package/dist/src/tokens/utils.d.ts +64 -0
  186. package/dist/src/tokens/utils.d.ts.map +1 -0
  187. package/dist/src/tokens/utils.js +126 -0
  188. package/dist/src/types.d.ts +6 -0
  189. package/dist/src/types.d.ts.map +1 -0
  190. package/dist/src/types.js +8 -0
  191. package/dist/src/utils/filesystem.d.ts +40 -0
  192. package/dist/src/utils/filesystem.d.ts.map +1 -0
  193. package/dist/src/utils/filesystem.js +115 -0
  194. package/package.json +84 -0
package/LICENSE ADDED
@@ -0,0 +1,7 @@
1
+ Copyright 2024 Digitaliseringsdirektoratet (Digdir)
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,115 @@
1
+ # @digdir/designsystemet
2
+
3
+ CLI and tooling for Designsystemet
4
+
5
+ Use `--help` for available commands and options
6
+
7
+ Read the Designsystemet [README](https://github.com/digdir/designsystemet) to get started.
8
+
9
+
10
+ ## Usage
11
+
12
+ ### Create tokens
13
+
14
+ Use `npx @digdir/designsystemet tokens create <options>` to create design tokens for use with Designsystemet.
15
+
16
+ This allows you to define themes including custom colors, font-family, and border-radius.
17
+ We recommend using the [Designsystemet theme builder](https://theme.designsystemet.no/) for generating a valid command with correct options.
18
+
19
+ #### Update tokens
20
+
21
+ Whenever a new version of the CLI is released, or you have done changes, we recommend to update design tokens with the `--clean` option to potentially remove any changes deprecated files or unneeded files.
22
+
23
+ To update design tokens, re-run `npx @digdir/designsystemet tokens create <options> --clean`.
24
+ If a [config file](#using-a-config-file) you can also re-run with `"clean": true`.
25
+
26
+ > ⚠️ **WARNING** ⚠️
27
+ > The design tokens created by this tool are considered an implementation detail, and is subject
28
+ > to change at any time without being considered a breaking change. We **only** support customisations
29
+ > done through the CLI options and config. Direct editing of the design tokens are **not** supported.
30
+ >
31
+ > Since tokens may be added or removed at any time, it is necessary to routinely re-run this
32
+ > command when upgrading the libraries. This will remove any direct edits to the design tokens.
33
+
34
+ ### Build CSS from tokens
35
+
36
+ Use `npx @digdir/designsystemet tokens build <options>` to build CSS from design tokens generated in the previous step.
37
+
38
+ > ⚠️ **WARNING** ⚠️
39
+ > The CSS files from created by this tool are considered build artifacts. They should **not** be
40
+ > edited directly. While the CSS will not change unexpectedly, new variables may be added at any
41
+ > time. Therefore, it is necessary to routinely re-run this command when upgrading the libraries.
42
+ > This will remove any direct edits to the CSS.
43
+
44
+ #### Update built CSS
45
+
46
+ Whenever a new version of the CLI is released, or you have done changes, we recommend to build a new set of CSS from design tokens with the `--clean` option to potentially remove any changes deprecated files or unneeded files.
47
+
48
+
49
+ ### Using a config file
50
+
51
+ > ⚠️ **WARNING** ⚠️
52
+ > The typography feature is experimental. The config schema may change at any time.
53
+
54
+
55
+ The `tokens create` command supports a config file. It will auto-detect a `designsystemet.config.json` file in the current directory. You can also use the `--config <path>` option to supply a different config name and location.
56
+
57
+ The main advantage of using a config file is for automation in scenarios with multiple themes.
58
+
59
+ To get started, use this template for a `designsystemet.config.json` file:
60
+
61
+ ```jsonc
62
+ {
63
+ "$schema": "node_modules/@digdir/designsystemet/dist/config.schema.json",
64
+ }
65
+ ```
66
+
67
+ In editors which support JSON Schema, the `$schema` will then give you editor hints for the structure of the file.
68
+
69
+ #### Minimal config example
70
+ As a minimal example, the following CLI snippet from the theme builder
71
+
72
+ ```
73
+ npx @digdir/designsystemet tokens create \
74
+ --main-colors "primary:#0062BA" "accent:#1E98F5" \
75
+ --neutral-color "#1E2B3C" \
76
+ --support-colors "extra1:#F45F63" "extra2:#E5AA20" \
77
+ --border-radius 4 \
78
+ --theme "theme"
79
+ ```
80
+
81
+ ...is equivalent to this `designsystemet.config.json` file
82
+ ```jsonc
83
+ {
84
+ "$schema": "./node_modules/@digdir/designsystemet/dist/config.schema.json",
85
+ "outDir": "../path/to/design-tokens",
86
+ "themes": {
87
+ "theme": {
88
+ "colors": {
89
+ "main": { "primary": "#0062BA", "accent": "#1E98F5" },
90
+ "neutral": "#1E2B3C",
91
+ "support": { "extra1": "#F45F63", "extra2": "#E5AA20" }
92
+ },
93
+ "borderRadius": 4
94
+ }
95
+ }
96
+ }
97
+ ```
98
+ To generate new design tokens and CSS files, you would then run.
99
+
100
+ ```
101
+ npx @digdir/designsystemet tokens create
102
+ npx @digdir/designsystemet tokens build
103
+ ```
104
+
105
+ #### Complex config example
106
+
107
+ Have a look at the `*.config.json` files under the `packages/cli` in the Github repo for more complex examples.
108
+
109
+ #### Create config from existing tokens
110
+
111
+ You can get a minimal config file, meaning without overrides, generated from existing design tokens using the following command:
112
+
113
+ ```sh
114
+ npx @digdir/designsystemet generate-config-from-tokens --dir <path to design tokens>
115
+ ```
@@ -0,0 +1,12 @@
1
+ import type { Command, OptionValues } from '@commander-js/extra-typings';
2
+ import { type BuildConfigSchema, type CreateConfigSchema } from '../src/config.js';
3
+ export declare function readConfigFile(configFilePath: string, allowFileNotFound?: boolean): Promise<string>;
4
+ export declare function parseCreateConfig(configFile: string, options: {
5
+ theme: string;
6
+ cmd: Command<unknown[], OptionValues>;
7
+ configFilePath: string;
8
+ }): Promise<CreateConfigSchema>;
9
+ export declare function parseBuildConfig(configFile: string, { configFilePath }: {
10
+ configFilePath: string;
11
+ }): Promise<BuildConfigSchema>;
12
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../bin/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAGzE,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EAKxB,MAAM,kBAAkB,CAAC;AAI1B,wBAAsB,cAAc,CAAC,cAAc,EAAE,MAAM,EAAE,iBAAiB,UAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAkBtG;AAED,wBAAsB,iBAAiB,CACrC,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,OAAO,CAAC,OAAO,EAAE,EAAE,YAAY,CAAC,CAAC;IAAC,cAAc,EAAE,MAAM,CAAA;CAAE,GACxF,OAAO,CAAC,kBAAkB,CAAC,CAiE7B;AAED,wBAAsB,gBAAgB,CACpC,UAAU,EAAE,MAAM,EAClB,EAAE,cAAc,EAAE,EAAE;IAAE,cAAc,EAAE,MAAM,CAAA;CAAE,GAC7C,OAAO,CAAC,iBAAiB,CAAC,CAI5B"}
@@ -0,0 +1,58 @@
1
+ import { commonConfig, configFileCreateSchema, parseConfig, validateConfig } from "../src/config.js";
2
+ import { dsfs } from "../src/utils/filesystem.js";
3
+ import { getCliOption, getDefaultCliOption, getSuppliedCliOption } from "./options.js";
4
+ import pc from "picocolors";
5
+ import * as R from "ramda";
6
+ //#region bin/config.ts
7
+ async function readConfigFile(configFilePath, allowFileNotFound = true) {
8
+ let configFile;
9
+ try {
10
+ configFile = await dsfs.readFile(configFilePath, allowFileNotFound);
11
+ } catch (err) {
12
+ if (allowFileNotFound) return "";
13
+ console.error(pc.redBright(`Could not read config file at ${pc.blue(configFilePath)}`));
14
+ throw err;
15
+ }
16
+ if (configFile) console.log(`Found config file: ${pc.green(configFilePath)}`);
17
+ return configFile;
18
+ }
19
+ async function parseCreateConfig(configFile, options) {
20
+ const { cmd, theme = "theme", configFilePath } = options;
21
+ const configParsed = parseConfig(configFile, configFilePath);
22
+ const themeColors = Object.values(configParsed?.themes ?? {}).map((x) => new Set([...R.keys(x.colors.main), ...R.keys(x.colors.support)]));
23
+ if (!R.all(R.equals(R.__, themeColors[0]), themeColors)) {
24
+ console.error(pc.redBright(`In config, all themes must have the same custom color names, but we found:`));
25
+ const themeNames = R.keys(configParsed.themes ?? {});
26
+ themeColors.forEach((colors, index) => {
27
+ const colorNames = Array.from(colors);
28
+ console.log(` - ${themeNames[index]}: ${colorNames.join(", ")}`);
29
+ });
30
+ console.log();
31
+ process.exit(1);
32
+ }
33
+ const noUndefined = R.reject(R.isNil);
34
+ const getThemeOptions = (optionGetter) => noUndefined({
35
+ colors: noUndefined({
36
+ main: optionGetter(cmd, "mainColors"),
37
+ support: optionGetter(cmd, "supportColors"),
38
+ neutral: optionGetter(cmd, "neutralColor")
39
+ }),
40
+ typography: noUndefined({ fontFamily: optionGetter(cmd, "fontFamily") }),
41
+ borderRadius: optionGetter(cmd, "borderRadius"),
42
+ defaultColor: optionGetter(cmd, "defaultColor")
43
+ });
44
+ return validateConfig(configFileCreateSchema, noUndefined({
45
+ outDir: configParsed?.outDir ?? getCliOption(cmd, "outDir"),
46
+ clean: configParsed?.clean ?? getCliOption(cmd, "clean"),
47
+ themes: configParsed?.themes ? R.map((jsonThemeValues) => {
48
+ const defaultThemeValues = getThemeOptions(getDefaultCliOption);
49
+ const cliThemeValues = getThemeOptions(getSuppliedCliOption);
50
+ return R.mergeDeepRight(defaultThemeValues, R.mergeDeepRight(jsonThemeValues, cliThemeValues));
51
+ }, configParsed.themes) : { [theme]: getThemeOptions(getCliOption) }
52
+ }), configFilePath);
53
+ }
54
+ async function parseBuildConfig(configFile, { configFilePath }) {
55
+ return validateConfig(commonConfig, parseConfig(configFile, configFilePath), configFilePath);
56
+ }
57
+ //#endregion
58
+ export { parseBuildConfig, parseCreateConfig, readConfigFile };
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export declare const figletAscii = "\n _____ _ _ _\n| __ \\ (_) | | | |\n| | | | ___ ___ _ __ _ _ __ ___ _ _ ___| |_ ___ _ __ ___ ___| |_\n| | | |/ _ \\/ __| |/ _` | '_ \\/ __| | | / __| __/ _ \\ '_ ` _ \\ / _ \\ __|\n| |__| | __/\\__ \\ | (_| | | | \\__ \\ |_| \\__ \\ || __/ | | | | | __/ |_\n|_____/ \\___||___/_|\\__, |_| |_|___/\\__, |___/\\__\\___|_| |_| |_|\\___|\\__|\n __/ | __/ |\n |___/ |___/\n";
3
+ //# sourceMappingURL=designsystemet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"designsystemet.d.ts","sourceRoot":"","sources":["../../bin/designsystemet.ts"],"names":[],"mappings":";AAiBA,eAAO,MAAM,WAAW,4iBASvB,CAAC"}
@@ -0,0 +1,163 @@
1
+ #!/usr/bin/env node
2
+ import { convertToHex } from "../src/colors/utils.js";
3
+ import "../src/colors/index.js";
4
+ import { cliOptions, createTokens, tokenSetDimensions } from "../src/tokens/create.js";
5
+ import { dsfs } from "../src/utils/filesystem.js";
6
+ import { parseCreateConfig, readConfigFile } from "./config.js";
7
+ import migrations_default from "../src/migrations/index.js";
8
+ import { colorNamesByCategory } from "../src/tokens/utils.js";
9
+ import { buildTokens } from "../src/tokens/build.js";
10
+ import { createSystemTokenFiles, tokenSetsToFiles } from "../src/tokens/create/files.js";
11
+ import { generateConfigFromTokens } from "../src/tokens/generate-config.js";
12
+ import pc from "picocolors";
13
+ import * as R from "ramda";
14
+ import path from "node:path";
15
+ import { Argument, createCommand, program } from "@commander-js/extra-typings";
16
+ //#region bin/designsystemet.ts
17
+ const figletAscii = `
18
+ _____ _ _ _
19
+ | __ \\ (_) | | | |
20
+ | | | | ___ ___ _ __ _ _ __ ___ _ _ ___| |_ ___ _ __ ___ ___| |_
21
+ | | | |/ _ \\/ __| |/ _\` | '_ \\/ __| | | / __| __/ _ \\ '_ \` _ \\ / _ \\ __|
22
+ | |__| | __/\\__ \\ | (_| | | | \\__ \\ |_| \\__ \\ || __/ | | | | | __/ |_
23
+ |_____/ \\___||___/_|\\__, |_| |_|___/\\__, |___/\\__\\___|_| |_| |_|\\___|\\__|
24
+ __/ | __/ |
25
+ |___/ |___/
26
+ `;
27
+ program.name("designsystemet").description("CLI for working with Designsystemet").showHelpAfterError();
28
+ const DEFAULT_TOKENS_CREATE_DIR = "./design-tokens";
29
+ const DEFAULT_TOKENS_BUILD_DIR = "./design-tokens-build";
30
+ const DEFAULT_FONT = "Inter";
31
+ const DEFAULT_THEME_NAME = "theme";
32
+ const DEFAULT_CONFIG_FILEPATH = "designsystemet.config.json";
33
+ function makeTokenCommands() {
34
+ const tokenCmd = createCommand("tokens");
35
+ tokenCmd.command("build").description("Build Designsystemet tokens").option("-t, --tokens <string>", `Path to ${pc.blue("design-tokens")}`, DEFAULT_TOKENS_CREATE_DIR).option("-o, --out-dir <string>", `Output directory for built ${pc.blue("design-tokens")}`, DEFAULT_TOKENS_BUILD_DIR).option(`--${cliOptions.clean} [boolean]`, "Clean output directory before building tokens", parseBoolean, false).option("--dry [boolean]", `Dry run for built ${pc.blue("design-tokens")}`, parseBoolean, false).option("--verbose", "Enable verbose output", false).option("--config <string>", `Path to config file (default: "${DEFAULT_CONFIG_FILEPATH}")`).option("--experimental-tailwind", "Generate Tailwind CSS classes for tokens", false).action(async (opts) => {
36
+ console.log(figletAscii);
37
+ const { verbose, clean, dry, experimentalTailwind, tokens } = opts;
38
+ dsfs.init({
39
+ dry,
40
+ outdir: opts.outDir,
41
+ verbose
42
+ });
43
+ const outDir = dsfs.outDir;
44
+ if (clean) await dsfs.cleanDir(outDir);
45
+ const files = await buildTokens({
46
+ tokensDir: tokens,
47
+ verbose,
48
+ tailwind: experimentalTailwind
49
+ });
50
+ console.log(`\n💾 Writing build to ${pc.green(outDir)}`);
51
+ await dsfs.writeFiles(files, outDir, true);
52
+ console.log(`\n✅ Finished building tokens in ${pc.green(outDir)}`);
53
+ return Promise.resolve();
54
+ });
55
+ tokenCmd.command("create").description("Create Designsystemet tokens").option("--config <string>", `Path to config file (default: "${DEFAULT_CONFIG_FILEPATH}")`).option(`--${cliOptions.clean} [boolean]`, "Clean output directory before creating tokens", parseBoolean, false).option("--dry [boolean]", `Dry run for created ${pc.blue("design-tokens")}`, parseBoolean, false).option(`-m, --${cliOptions.theme.colors.main} <name:hex...>`, `Main colors (deprecated, use JSON config file instead)`, parseColorValues).option(`-s, --${cliOptions.theme.colors.support} <name:hex...>`, `Support colors (deprecated, use JSON config file instead)`, parseColorValues).option(`-n, --${cliOptions.theme.colors.neutral} <hex>`, `Neutral hex color (deprecated, use JSON config file instead)`, convertToHex).option(`-o, --${cliOptions.outDir} <string>`, `Output directory for created ${pc.blue("design-tokens")}`, DEFAULT_TOKENS_CREATE_DIR).option(`-f, --${cliOptions.theme.typography.fontFamily} <string>`, `Font family (experimental, deprecated, use JSON config file instead)`, DEFAULT_FONT).option(`-b, --${cliOptions.theme.borderRadius} <number>`, `Unitless base border-radius in px (deprecated, use JSON config file instead)`, (radiusAsString) => Number(radiusAsString), 4).option("--theme <string>", "Theme name (deprecated, use JSON config file instead)", DEFAULT_THEME_NAME).action(async (opts, cmd) => {
56
+ if (opts.mainColors || opts.supportColors || opts.neutralColor || opts.borderRadius && opts.borderRadius !== 4 || opts.theme && opts.theme !== DEFAULT_THEME_NAME || opts.fontFamily && opts.fontFamily !== DEFAULT_FONT) console.warn(pc.yellow(`\n ⚠️ Using CLI options for ${pc.bold(`colors, border radius, theme, or font family is deprecated`)} and will be removed in a future release.
57
+ \n ⚠️ Please use a JSON config file instead.`));
58
+ console.log(figletAscii);
59
+ if (opts.dry) console.log(`Performing dry run, no files will be written`);
60
+ const themeName = opts.theme;
61
+ const { configFile, configFilePath } = await getConfigFile(opts.config);
62
+ const config = await parseCreateConfig(configFile, {
63
+ theme: themeName,
64
+ cmd,
65
+ configFilePath
66
+ });
67
+ const themeNames = Object.keys(config.themes);
68
+ if (themeNames.length > 0) console.log(`Using themes from config file: ${pc.blue(themeNames.join(", "))}`);
69
+ dsfs.init({
70
+ dry: opts.dry,
71
+ outdir: config.outDir
72
+ });
73
+ const outDir = dsfs.outDir;
74
+ const files = [];
75
+ for (const [name, themeConfig] of Object.entries(config.themes)) {
76
+ const { tokenSets } = await createTokens({
77
+ name,
78
+ ...themeConfig
79
+ });
80
+ files.push(...tokenSetsToFiles(tokenSets));
81
+ }
82
+ const colors = config.themes?.[themeNames[0]]?.colors ?? {
83
+ main: {},
84
+ support: {}
85
+ };
86
+ files.push(...await createSystemTokenFiles({
87
+ tokenSetDimensions,
88
+ themeNames,
89
+ colors: colorNamesByCategory(colors)
90
+ }));
91
+ if (config.clean) await dsfs.cleanDir(outDir);
92
+ await dsfs.mkdir(outDir);
93
+ await dsfs.writeFiles(files, outDir);
94
+ console.log(`\n✅ Finished creating tokens in ${pc.green(outDir)} for themes: ${pc.blue(themeNames.join(", "))}`);
95
+ return Promise.resolve();
96
+ });
97
+ return tokenCmd;
98
+ }
99
+ program.addCommand(makeTokenCommands());
100
+ program.command("generate-config-from-tokens").description("Generate a config file from existing design tokens. Will not include overrides.").option("-d, --dir <string>", "Path to design tokens directory", DEFAULT_TOKENS_CREATE_DIR).option("-o, --out <string>", "Output path for config file", DEFAULT_CONFIG_FILEPATH).option("--dry [boolean]", "Dry run - show config without writing file", parseBoolean, false).action(async (opts) => {
101
+ console.log(figletAscii);
102
+ const { dry } = opts;
103
+ const tokensDir = path.resolve(opts.dir);
104
+ const configFilePath = path.resolve(opts.out);
105
+ dsfs.init({
106
+ dry,
107
+ outdir: path.dirname(configFilePath)
108
+ });
109
+ try {
110
+ const config = await generateConfigFromTokens({
111
+ tokensDir,
112
+ outFile: configFilePath
113
+ });
114
+ if (dry) {
115
+ console.log();
116
+ console.log("Generated config (dry run):");
117
+ console.log(JSON.stringify(config, null, 2));
118
+ }
119
+ if (configFilePath) {
120
+ const configJson = JSON.stringify(config, null, 2);
121
+ await dsfs.writeFile(configFilePath, configJson);
122
+ console.log();
123
+ console.log(`\n✅ Config file written to ${pc.blue(configFilePath)}`);
124
+ }
125
+ } catch (error) {
126
+ console.error(pc.redBright("Error generating config:"));
127
+ console.error(error instanceof Error ? error.message : String(error));
128
+ process.exit(1);
129
+ }
130
+ });
131
+ program.command("migrate").description("run a Designsystemet migration").addArgument(new Argument("[migration]", "Available migrations").choices(Object.keys(migrations_default))).option("-l --list", "List available migrations").option("-g --glob <glob>", "Glob for files upon which to apply the migration", "./**/*.(tsx|css)").action((migrationKey, opts) => {
132
+ console.log(figletAscii);
133
+ const { glob, list } = opts;
134
+ if (list) for (const key of Object.keys(migrations_default)) console.log(key);
135
+ else if (migrationKey) {
136
+ const migration = migrations_default[migrationKey];
137
+ if (!migration) {
138
+ console.error("Migration not found!");
139
+ throw "Aborting";
140
+ }
141
+ console.log(`Applying migration ${pc.blue(migrationKey)} with glob: ${pc.green(glob)}`);
142
+ migration?.(glob).then(() => console.log(`Migration ${pc.blue(migrationKey)} finished`)).catch((error) => console.log(error));
143
+ } else console.log("Migrate: please specify a migration name or --list");
144
+ });
145
+ await program.parseAsync(process.argv);
146
+ function parseColorValues(value, previous = {}) {
147
+ const [name, hex] = value.split(":");
148
+ previous[name] = convertToHex(hex);
149
+ return previous;
150
+ }
151
+ function parseBoolean(value) {
152
+ return value === "true" || value === true;
153
+ }
154
+ async function getConfigFile(userConfigFilePath) {
155
+ const allowFileNotFound = R.isNil(userConfigFilePath) || userConfigFilePath === DEFAULT_CONFIG_FILEPATH;
156
+ const configFilePath = userConfigFilePath ?? DEFAULT_CONFIG_FILEPATH;
157
+ return {
158
+ configFile: await readConfigFile(configFilePath, allowFileNotFound),
159
+ configFilePath
160
+ };
161
+ }
162
+ //#endregion
163
+ export { figletAscii };
@@ -0,0 +1,21 @@
1
+ import type { Command, OptionValueSource, OptionValues } from '@commander-js/extra-typings';
2
+ declare const getOptionIfMatchingSource: (...sources: OptionValueSource[]) => <Args extends unknown[], Opts extends OptionValues, K extends keyof Opts>(command: Command<Args, Opts>, option: K) => Opts[K] | undefined;
3
+ export type OptionGetter = ReturnType<typeof getOptionIfMatchingSource>;
4
+ /**
5
+ * Get an option value if it is explicitly supplied to the CLI command.
6
+ * The difference between this and using the option directly is that we return undefined
7
+ * instead of the default value if the option was not explicitly set.
8
+ */
9
+ export declare const getSuppliedCliOption: <Args extends unknown[], Opts extends OptionValues, K extends keyof Opts>(command: Command<Args, Opts>, option: K) => Opts[K] | undefined;
10
+ /**
11
+ * Get the default value specified for a CLI command option.
12
+ * Mostly useful for getting values which may later be overridden.
13
+ */
14
+ export declare const getDefaultCliOption: <Args extends unknown[], Opts extends OptionValues, K extends keyof Opts>(command: Command<Args, Opts>, option: K) => Opts[K] | undefined;
15
+ /**
16
+ * Try to get the explicitly supplied CLI option, and fall back to the default value
17
+ * for the option as defined in the {@link Command}
18
+ */
19
+ export declare const getCliOption: <Args extends unknown[], Opts extends OptionValues, K extends keyof Opts>(command: Command<Args, Opts>, option: K) => Opts[K] | undefined;
20
+ export {};
21
+ //# sourceMappingURL=options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../bin/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAE5F,QAAA,MAAM,yBAAyB,GAC5B,GAAG,SAAS,iBAAiB,EAAE,MAC/B,IAAI,SAAS,OAAO,EAAE,EAAE,IAAI,SAAS,YAAY,EAAE,CAAC,SAAS,MAAM,IAAI,EACtE,SAAS,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,EAC5B,QAAQ,CAAC,wBAMV,CAAC;AAEJ,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAExE;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,GAjB9B,IAAI,SAAS,OAAO,EAAE,EAAE,IAAI,SAAS,YAAY,EAAE,CAAC,SAAS,MAAM,IAAI,WAC7D,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,UACpB,CAAC,wBAeuD,CAAC;AAErE;;;GAGG;AACH,eAAO,MAAM,mBAAmB,GAvB7B,IAAI,SAAS,OAAO,EAAE,EAAE,IAAI,SAAS,YAAY,EAAE,CAAC,SAAS,MAAM,IAAI,WAC7D,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,UACpB,CAAC,wBAqB0D,CAAC;AAExE;;;GAGG;AACH,eAAO,MAAM,YAAY,GA7BtB,IAAI,SAAS,OAAO,EAAE,EAAE,IAAI,SAAS,YAAY,EAAE,CAAC,SAAS,MAAM,IAAI,WAC7D,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,UACpB,CAAC,wBA2B0D,CAAC"}
@@ -0,0 +1,23 @@
1
+ //#region bin/options.ts
2
+ const getOptionIfMatchingSource = (...sources) => (command, option) => {
3
+ const source = command.getOptionValueSource(option);
4
+ if (sources.includes(source)) return command.getOptionValue(option);
5
+ };
6
+ /**
7
+ * Get an option value if it is explicitly supplied to the CLI command.
8
+ * The difference between this and using the option directly is that we return undefined
9
+ * instead of the default value if the option was not explicitly set.
10
+ */
11
+ const getSuppliedCliOption = getOptionIfMatchingSource("cli");
12
+ /**
13
+ * Get the default value specified for a CLI command option.
14
+ * Mostly useful for getting values which may later be overridden.
15
+ */
16
+ const getDefaultCliOption = getOptionIfMatchingSource("default");
17
+ /**
18
+ * Try to get the explicitly supplied CLI option, and fall back to the default value
19
+ * for the option as defined in the {@link Command}
20
+ */
21
+ const getCliOption = getOptionIfMatchingSource("cli", "default");
22
+ //#endregion
23
+ export { getCliOption, getDefaultCliOption, getSuppliedCliOption };
@@ -0,0 +1,209 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "$schema": {
6
+ "type": "string"
7
+ },
8
+ "outDir": {
9
+ "type": "string",
10
+ "description": "Path to the output directory for the created design tokens"
11
+ },
12
+ "themes": {
13
+ "type": "object",
14
+ "propertyNames": {
15
+ "type": "string"
16
+ },
17
+ "additionalProperties": {
18
+ "type": "object",
19
+ "properties": {
20
+ "colors": {
21
+ "type": "object",
22
+ "properties": {
23
+ "main": {
24
+ "type": "object",
25
+ "propertyNames": {
26
+ "type": "string",
27
+ "pattern": "^(?!(?:neutral|success|warning|danger|info)$)"
28
+ },
29
+ "additionalProperties": {
30
+ "description": "A hex color, which is used for creating a color scale. Invalid color names: neutral, success, warning, danger, info"
31
+ },
32
+ "description": "An object with one or more color definitions. The property name is used as the color name."
33
+ },
34
+ "support": {
35
+ "default": {},
36
+ "type": "object",
37
+ "propertyNames": {
38
+ "type": "string",
39
+ "pattern": "^(?!(?:neutral|success|warning|danger|info)$)"
40
+ },
41
+ "additionalProperties": {
42
+ "description": "A hex color, which is used for creating a color scale. Invalid color names: neutral, success, warning, danger, info"
43
+ },
44
+ "description": "An object with one or more color definitions. The property name is used as the color name."
45
+ },
46
+ "neutral": {
47
+ "description": "A hex color, which is used for creating a color scale."
48
+ }
49
+ },
50
+ "required": [
51
+ "main",
52
+ "support",
53
+ "neutral"
54
+ ],
55
+ "additionalProperties": false,
56
+ "description": "Defines the colors for this theme"
57
+ },
58
+ "typography": {
59
+ "type": "object",
60
+ "properties": {
61
+ "fontFamily": {
62
+ "type": "string",
63
+ "description": "Sets the font-family for this theme"
64
+ }
65
+ },
66
+ "required": [
67
+ "fontFamily"
68
+ ],
69
+ "additionalProperties": false,
70
+ "description": "Defines the typography for a given theme"
71
+ },
72
+ "borderRadius": {
73
+ "type": "number",
74
+ "description": "Defines the border-radius for this theme"
75
+ },
76
+ "overrides": {
77
+ "type": "object",
78
+ "properties": {
79
+ "colors": {
80
+ "type": "object",
81
+ "propertyNames": {
82
+ "type": "string"
83
+ },
84
+ "additionalProperties": {
85
+ "type": "object",
86
+ "propertyNames": {
87
+ "type": "string",
88
+ "enum": [
89
+ "background-default",
90
+ "background-tinted",
91
+ "surface-default",
92
+ "surface-tinted",
93
+ "surface-hover",
94
+ "surface-active",
95
+ "border-subtle",
96
+ "border-default",
97
+ "border-strong",
98
+ "text-subtle",
99
+ "text-default",
100
+ "base-default",
101
+ "base-hover",
102
+ "base-active",
103
+ "base-contrast-subtle",
104
+ "base-contrast-default"
105
+ ]
106
+ },
107
+ "additionalProperties": {
108
+ "type": "object",
109
+ "properties": {
110
+ "light": {
111
+ "description": "A hex color that overrides light mode"
112
+ },
113
+ "dark": {
114
+ "description": "A hex color that overrides dark mode"
115
+ }
116
+ },
117
+ "additionalProperties": false,
118
+ "description": "Override values for semantic color tokens like \"background-subtle\", \"border-default\", etc."
119
+ },
120
+ "description": "The name of the color to add overrides for, e.g. \"accent\""
121
+ },
122
+ "description": "An object with color names as keys"
123
+ },
124
+ "severity": {
125
+ "description": "An object with severity color names as keys",
126
+ "type": "object",
127
+ "propertyNames": {
128
+ "type": "string",
129
+ "enum": [
130
+ "info",
131
+ "success",
132
+ "warning",
133
+ "danger"
134
+ ]
135
+ },
136
+ "additionalProperties": {
137
+ "description": "A hex color, which is used for creating a color scale"
138
+ }
139
+ },
140
+ "linkVisited": {
141
+ "type": "object",
142
+ "properties": {
143
+ "light": {
144
+ "description": "A hex color that overrides light mode"
145
+ },
146
+ "dark": {
147
+ "description": "A hex color that overrides dark mode"
148
+ }
149
+ },
150
+ "additionalProperties": false,
151
+ "description": "Overrides for the \"link-visited\" color"
152
+ },
153
+ "focus": {
154
+ "type": "object",
155
+ "properties": {
156
+ "inner": {
157
+ "description": "Overrides for the \"focus-inner\" color",
158
+ "type": "object",
159
+ "properties": {
160
+ "light": {
161
+ "description": "A hex color that overrides light mode"
162
+ },
163
+ "dark": {
164
+ "description": "A hex color that overrides dark mode"
165
+ }
166
+ },
167
+ "additionalProperties": false
168
+ },
169
+ "outer": {
170
+ "description": "Overrides for the \"focus-outer\" color",
171
+ "type": "object",
172
+ "properties": {
173
+ "light": {
174
+ "description": "A hex color that overrides light mode"
175
+ },
176
+ "dark": {
177
+ "description": "A hex color that overrides dark mode"
178
+ }
179
+ },
180
+ "additionalProperties": false
181
+ }
182
+ },
183
+ "additionalProperties": false,
184
+ "description": "Overrides for the focus colors"
185
+ }
186
+ },
187
+ "additionalProperties": false,
188
+ "description": "Overrides for generated design tokens. Currently only supports colors defined in your theme"
189
+ }
190
+ },
191
+ "required": [
192
+ "colors"
193
+ ],
194
+ "additionalProperties": false,
195
+ "description": "An object defining a theme. The property name holding the object becomes the theme name."
196
+ },
197
+ "description": "An object with one or more themes. Each property defines a theme, and the property name is used as the theme name."
198
+ },
199
+ "clean": {
200
+ "type": "boolean",
201
+ "description": "Delete the output directory before building or creating tokens"
202
+ }
203
+ },
204
+ "required": [
205
+ "outDir",
206
+ "themes"
207
+ ],
208
+ "additionalProperties": false
209
+ }
@@ -0,0 +1,9 @@
1
+ //#region ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/BorderValues.js
2
+ var BorderValues;
3
+ (function(BorderValues) {
4
+ BorderValues["BORDER_COLOR"] = "color";
5
+ BorderValues["BORDER_WIDTH"] = "width";
6
+ BorderValues["BORDER_STYLE"] = "style";
7
+ })(BorderValues || (BorderValues = {}));
8
+ //#endregion
9
+ export { BorderValues };
@@ -0,0 +1,8 @@
1
+ //#region ../../node_modules/.pnpm/@tokens-studio+types@0.5.2/node_modules/@tokens-studio/types/dist/constants/BoxShadowTypes.js
2
+ var BoxShadowTypes;
3
+ (function(BoxShadowTypes) {
4
+ BoxShadowTypes["DROP_SHADOW"] = "dropShadow";
5
+ BoxShadowTypes["INNER_SHADOW"] = "innerShadow";
6
+ })(BoxShadowTypes || (BoxShadowTypes = {}));
7
+ //#endregion
8
+ export { BoxShadowTypes };