@digdir/designsystemet 0.0.0-chore-remove-cli-tsx-20260701060359

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 (266) hide show
  1. package/LICENSE +7 -0
  2. package/README.md +104 -0
  3. package/dist/bin/config.d.ts +14 -0
  4. package/dist/bin/config.d.ts.map +1 -0
  5. package/dist/bin/config.js +58 -0
  6. package/dist/bin/config.js.map +1 -0
  7. package/dist/bin/designsystemet.d.ts +1 -0
  8. package/dist/bin/designsystemet.js +174 -0
  9. package/dist/bin/designsystemet.js.map +1 -0
  10. package/dist/bin/options.d.ts +24 -0
  11. package/dist/bin/options.d.ts.map +1 -0
  12. package/dist/bin/options.js +25 -0
  13. package/dist/bin/options.js.map +1 -0
  14. package/dist/config.schema.json +181 -0
  15. package/dist/node_modules/.pnpm/@tokens-studio_types@0.5.2/node_modules/@tokens-studio/types/dist/constants/BorderValues.js +11 -0
  16. package/dist/node_modules/.pnpm/@tokens-studio_types@0.5.2/node_modules/@tokens-studio/types/dist/constants/BorderValues.js.map +1 -0
  17. package/dist/node_modules/.pnpm/@tokens-studio_types@0.5.2/node_modules/@tokens-studio/types/dist/constants/BoxShadowTypes.js +10 -0
  18. package/dist/node_modules/.pnpm/@tokens-studio_types@0.5.2/node_modules/@tokens-studio/types/dist/constants/BoxShadowTypes.js.map +1 -0
  19. package/dist/node_modules/.pnpm/@tokens-studio_types@0.5.2/node_modules/@tokens-studio/types/dist/constants/BoxShadowValues.js +15 -0
  20. package/dist/node_modules/.pnpm/@tokens-studio_types@0.5.2/node_modules/@tokens-studio/types/dist/constants/BoxShadowValues.js.map +1 -0
  21. package/dist/node_modules/.pnpm/@tokens-studio_types@0.5.2/node_modules/@tokens-studio/types/dist/constants/ColorModifierTypes.js +12 -0
  22. package/dist/node_modules/.pnpm/@tokens-studio_types@0.5.2/node_modules/@tokens-studio/types/dist/constants/ColorModifierTypes.js.map +1 -0
  23. package/dist/node_modules/.pnpm/@tokens-studio_types@0.5.2/node_modules/@tokens-studio/types/dist/constants/ColorSpaceTypes.js +12 -0
  24. package/dist/node_modules/.pnpm/@tokens-studio_types@0.5.2/node_modules/@tokens-studio/types/dist/constants/ColorSpaceTypes.js.map +1 -0
  25. package/dist/node_modules/.pnpm/@tokens-studio_types@0.5.2/node_modules/@tokens-studio/types/dist/constants/Properties.js +55 -0
  26. package/dist/node_modules/.pnpm/@tokens-studio_types@0.5.2/node_modules/@tokens-studio/types/dist/constants/Properties.js.map +1 -0
  27. package/dist/node_modules/.pnpm/@tokens-studio_types@0.5.2/node_modules/@tokens-studio/types/dist/constants/StrokeStyleValues.js +16 -0
  28. package/dist/node_modules/.pnpm/@tokens-studio_types@0.5.2/node_modules/@tokens-studio/types/dist/constants/StrokeStyleValues.js.map +1 -0
  29. package/dist/node_modules/.pnpm/@tokens-studio_types@0.5.2/node_modules/@tokens-studio/types/dist/constants/TokenSetStatus.d.ts +11 -0
  30. package/dist/node_modules/.pnpm/@tokens-studio_types@0.5.2/node_modules/@tokens-studio/types/dist/constants/TokenSetStatus.d.ts.map +1 -0
  31. package/dist/node_modules/.pnpm/@tokens-studio_types@0.5.2/node_modules/@tokens-studio/types/dist/constants/TokenSetStatus.js +11 -0
  32. package/dist/node_modules/.pnpm/@tokens-studio_types@0.5.2/node_modules/@tokens-studio/types/dist/constants/TokenSetStatus.js.map +1 -0
  33. package/dist/node_modules/.pnpm/@tokens-studio_types@0.5.2/node_modules/@tokens-studio/types/dist/constants/TokenTypes.js +34 -0
  34. package/dist/node_modules/.pnpm/@tokens-studio_types@0.5.2/node_modules/@tokens-studio/types/dist/constants/TokenTypes.js.map +1 -0
  35. package/dist/node_modules/.pnpm/@tokens-studio_types@0.5.2/node_modules/@tokens-studio/types/dist/constants/TypographyValues.js +17 -0
  36. package/dist/node_modules/.pnpm/@tokens-studio_types@0.5.2/node_modules/@tokens-studio/types/dist/constants/TypographyValues.js.map +1 -0
  37. package/dist/node_modules/.pnpm/@tokens-studio_types@0.5.2/node_modules/@tokens-studio/types/dist/types/ThemeObject.d.ts +16 -0
  38. package/dist/node_modules/.pnpm/@tokens-studio_types@0.5.2/node_modules/@tokens-studio/types/dist/types/ThemeObject.d.ts.map +1 -0
  39. package/dist/node_modules/.pnpm/@tokens-studio_types@0.5.2/node_modules/@tokens-studio/types/dist/types/index.js +11 -0
  40. package/dist/package.js +7 -0
  41. package/dist/package.js.map +1 -0
  42. package/dist/src/automigrate.d.ts +5 -0
  43. package/dist/src/automigrate.d.ts.map +1 -0
  44. package/dist/src/automigrate.js +35 -0
  45. package/dist/src/automigrate.js.map +1 -0
  46. package/dist/src/colors/colorMetadata.d.ts +60 -0
  47. package/dist/src/colors/colorMetadata.d.ts.map +1 -0
  48. package/dist/src/colors/colorMetadata.js +261 -0
  49. package/dist/src/colors/colorMetadata.js.map +1 -0
  50. package/dist/src/colors/index.d.ts +5 -0
  51. package/dist/src/colors/index.js +5 -0
  52. package/dist/src/colors/theme.d.ts +34 -0
  53. package/dist/src/colors/theme.d.ts.map +1 -0
  54. package/dist/src/colors/theme.js +113 -0
  55. package/dist/src/colors/theme.js.map +1 -0
  56. package/dist/src/colors/types.d.ts +67 -0
  57. package/dist/src/colors/types.d.ts.map +1 -0
  58. package/dist/src/colors/types.js +26 -0
  59. package/dist/src/colors/types.js.map +1 -0
  60. package/dist/src/colors/utils.d.ts +132 -0
  61. package/dist/src/colors/utils.d.ts.map +1 -0
  62. package/dist/src/colors/utils.js +246 -0
  63. package/dist/src/colors/utils.js.map +1 -0
  64. package/dist/src/index.d.ts +10 -0
  65. package/dist/src/index.js +11 -0
  66. package/dist/src/migrations/beta-to-v1.d.ts +5 -0
  67. package/dist/src/migrations/beta-to-v1.d.ts.map +1 -0
  68. package/dist/src/migrations/beta-to-v1.js +342 -0
  69. package/dist/src/migrations/beta-to-v1.js.map +1 -0
  70. package/dist/src/migrations/codemods/css/plugins.d.ts +9 -0
  71. package/dist/src/migrations/codemods/css/plugins.d.ts.map +1 -0
  72. package/dist/src/migrations/codemods/css/plugins.js +37 -0
  73. package/dist/src/migrations/codemods/css/plugins.js.map +1 -0
  74. package/dist/src/migrations/codemods/css/run.d.ts +14 -0
  75. package/dist/src/migrations/codemods/css/run.d.ts.map +1 -0
  76. package/dist/src/migrations/codemods/css/run.js +25 -0
  77. package/dist/src/migrations/codemods/css/run.js.map +1 -0
  78. package/dist/src/migrations/color-rename-next49.d.ts +5 -0
  79. package/dist/src/migrations/color-rename-next49.d.ts.map +1 -0
  80. package/dist/src/migrations/color-rename-next49.js +48 -0
  81. package/dist/src/migrations/color-rename-next49.js.map +1 -0
  82. package/dist/src/migrations/flatten-color-categories.d.ts +12 -0
  83. package/dist/src/migrations/flatten-color-categories.d.ts.map +1 -0
  84. package/dist/src/migrations/flatten-color-categories.js +58 -0
  85. package/dist/src/migrations/flatten-color-categories.js.map +1 -0
  86. package/dist/src/migrations/index.d.ts +17 -0
  87. package/dist/src/migrations/index.d.ts.map +1 -0
  88. package/dist/src/migrations/index.js +13 -0
  89. package/dist/src/migrations/index.js.map +1 -0
  90. package/dist/src/schemas/helpers.d.ts +42 -0
  91. package/dist/src/schemas/helpers.d.ts.map +1 -0
  92. package/dist/src/schemas/helpers.js +96 -0
  93. package/dist/src/schemas/helpers.js.map +1 -0
  94. package/dist/src/schemas/v1/schema.d.ts +173 -0
  95. package/dist/src/schemas/v1/schema.d.ts.map +1 -0
  96. package/dist/src/schemas/v1/schema.js +65 -0
  97. package/dist/src/schemas/v1/schema.js.map +1 -0
  98. package/dist/src/schemas/v1.1/schema.d.ts +165 -0
  99. package/dist/src/schemas/v1.1/schema.d.ts.map +1 -0
  100. package/dist/src/schemas/v1.1/schema.js +56 -0
  101. package/dist/src/schemas/v1.1/schema.js.map +1 -0
  102. package/dist/src/tokens/build.d.ts +8 -0
  103. package/dist/src/tokens/build.d.ts.map +1 -0
  104. package/dist/src/tokens/build.js +43 -0
  105. package/dist/src/tokens/build.js.map +1 -0
  106. package/dist/src/tokens/create/files.d.ts +19 -0
  107. package/dist/src/tokens/create/files.d.ts.map +1 -0
  108. package/dist/src/tokens/create/files.js +48 -0
  109. package/dist/src/tokens/create/files.js.map +1 -0
  110. package/dist/src/tokens/create/generators/$designsystemet.d.ts +8 -0
  111. package/dist/src/tokens/create/generators/$designsystemet.d.ts.map +1 -0
  112. package/dist/src/tokens/create/generators/$designsystemet.js +12 -0
  113. package/dist/src/tokens/create/generators/$designsystemet.js.map +1 -0
  114. package/dist/src/tokens/create/generators/$metadata.d.ts +15 -0
  115. package/dist/src/tokens/create/generators/$metadata.d.ts.map +1 -0
  116. package/dist/src/tokens/create/generators/$metadata.js +25 -0
  117. package/dist/src/tokens/create/generators/$metadata.js.map +1 -0
  118. package/dist/src/tokens/create/generators/$themes.d.ts +28 -0
  119. package/dist/src/tokens/create/generators/$themes.d.ts.map +1 -0
  120. package/dist/src/tokens/create/generators/$themes.js +158 -0
  121. package/dist/src/tokens/create/generators/$themes.js.map +1 -0
  122. package/dist/src/tokens/create/generators/primitives/color-scheme.d.ts +9 -0
  123. package/dist/src/tokens/create/generators/primitives/color-scheme.d.ts.map +1 -0
  124. package/dist/src/tokens/create/generators/primitives/color-scheme.js +71 -0
  125. package/dist/src/tokens/create/generators/primitives/color-scheme.js.map +1 -0
  126. package/dist/src/tokens/create/generators/primitives/globals.d.ts +7 -0
  127. package/dist/src/tokens/create/generators/primitives/globals.d.ts.map +1 -0
  128. package/dist/src/tokens/create/generators/primitives/globals.js +144 -0
  129. package/dist/src/tokens/create/generators/primitives/globals.js.map +1 -0
  130. package/dist/src/tokens/create/generators/primitives/size.d.ts +8 -0
  131. package/dist/src/tokens/create/generators/primitives/size.d.ts.map +1 -0
  132. package/dist/src/tokens/create/generators/primitives/size.js +149 -0
  133. package/dist/src/tokens/create/generators/primitives/size.js.map +1 -0
  134. package/dist/src/tokens/create/generators/primitives/typography.d.ts +10 -0
  135. package/dist/src/tokens/create/generators/primitives/typography.d.ts.map +1 -0
  136. package/dist/src/tokens/create/generators/primitives/typography.js +218 -0
  137. package/dist/src/tokens/create/generators/primitives/typography.js.map +1 -0
  138. package/dist/src/tokens/create/generators/semantic/color.d.ts +7 -0
  139. package/dist/src/tokens/create/generators/semantic/color.d.ts.map +1 -0
  140. package/dist/src/tokens/create/generators/semantic/color.js +19 -0
  141. package/dist/src/tokens/create/generators/semantic/color.js.map +1 -0
  142. package/dist/src/tokens/create/generators/semantic/style.d.ts +7 -0
  143. package/dist/src/tokens/create/generators/semantic/style.d.ts.map +1 -0
  144. package/dist/src/tokens/create/generators/semantic/style.js +420 -0
  145. package/dist/src/tokens/create/generators/semantic/style.js.map +1 -0
  146. package/dist/src/tokens/create/generators/themes/theme.d.ts +7 -0
  147. package/dist/src/tokens/create/generators/themes/theme.d.ts.map +1 -0
  148. package/dist/src/tokens/create/generators/themes/theme.js +105 -0
  149. package/dist/src/tokens/create/generators/themes/theme.js.map +1 -0
  150. package/dist/src/tokens/create.d.ts +10 -0
  151. package/dist/src/tokens/create.d.ts.map +1 -0
  152. package/dist/src/tokens/create.js +40 -0
  153. package/dist/src/tokens/create.js.map +1 -0
  154. package/dist/src/tokens/format.d.ts +19 -0
  155. package/dist/src/tokens/format.d.ts.map +1 -0
  156. package/dist/src/tokens/format.js +42 -0
  157. package/dist/src/tokens/format.js.map +1 -0
  158. package/dist/src/tokens/generate-config.d.ts +14 -0
  159. package/dist/src/tokens/generate-config.d.ts.map +1 -0
  160. package/dist/src/tokens/generate-config.js +154 -0
  161. package/dist/src/tokens/generate-config.js.map +1 -0
  162. package/dist/src/tokens/index.d.ts +5 -0
  163. package/dist/src/tokens/index.js +4 -0
  164. package/dist/src/tokens/process/configs/color.d.ts +8 -0
  165. package/dist/src/tokens/process/configs/color.d.ts.map +1 -0
  166. package/dist/src/tokens/process/configs/color.js +50 -0
  167. package/dist/src/tokens/process/configs/color.js.map +1 -0
  168. package/dist/src/tokens/process/configs/semantic.d.ts +7 -0
  169. package/dist/src/tokens/process/configs/semantic.d.ts.map +1 -0
  170. package/dist/src/tokens/process/configs/semantic.js +49 -0
  171. package/dist/src/tokens/process/configs/semantic.js.map +1 -0
  172. package/dist/src/tokens/process/configs/shared.d.ts +14 -0
  173. package/dist/src/tokens/process/configs/shared.d.ts.map +1 -0
  174. package/dist/src/tokens/process/configs/shared.js +21 -0
  175. package/dist/src/tokens/process/configs/shared.js.map +1 -0
  176. package/dist/src/tokens/process/configs/size-mode.d.ts +7 -0
  177. package/dist/src/tokens/process/configs/size-mode.d.ts.map +1 -0
  178. package/dist/src/tokens/process/configs/size-mode.js +30 -0
  179. package/dist/src/tokens/process/configs/size-mode.js.map +1 -0
  180. package/dist/src/tokens/process/configs/size.d.ts +7 -0
  181. package/dist/src/tokens/process/configs/size.d.ts.map +1 -0
  182. package/dist/src/tokens/process/configs/size.js +36 -0
  183. package/dist/src/tokens/process/configs/size.js.map +1 -0
  184. package/dist/src/tokens/process/configs/type-scale.d.ts +7 -0
  185. package/dist/src/tokens/process/configs/type-scale.d.ts.map +1 -0
  186. package/dist/src/tokens/process/configs/type-scale.js +51 -0
  187. package/dist/src/tokens/process/configs/type-scale.js.map +1 -0
  188. package/dist/src/tokens/process/configs/typography.d.ts +7 -0
  189. package/dist/src/tokens/process/configs/typography.d.ts.map +1 -0
  190. package/dist/src/tokens/process/configs/typography.js +66 -0
  191. package/dist/src/tokens/process/configs/typography.js.map +1 -0
  192. package/dist/src/tokens/process/configs.d.ts +18 -0
  193. package/dist/src/tokens/process/configs.d.ts.map +1 -0
  194. package/dist/src/tokens/process/configs.js +74 -0
  195. package/dist/src/tokens/process/configs.js.map +1 -0
  196. package/dist/src/tokens/process/formats/css/color.d.ts +8 -0
  197. package/dist/src/tokens/process/formats/css/color.d.ts.map +1 -0
  198. package/dist/src/tokens/process/formats/css/color.js +64 -0
  199. package/dist/src/tokens/process/formats/css/color.js.map +1 -0
  200. package/dist/src/tokens/process/formats/css/semantic.d.ts +7 -0
  201. package/dist/src/tokens/process/formats/css/semantic.d.ts.map +1 -0
  202. package/dist/src/tokens/process/formats/css/semantic.js +31 -0
  203. package/dist/src/tokens/process/formats/css/semantic.js.map +1 -0
  204. package/dist/src/tokens/process/formats/css/size-mode.d.ts +7 -0
  205. package/dist/src/tokens/process/formats/css/size-mode.d.ts.map +1 -0
  206. package/dist/src/tokens/process/formats/css/size-mode.js +52 -0
  207. package/dist/src/tokens/process/formats/css/size-mode.js.map +1 -0
  208. package/dist/src/tokens/process/formats/css/size.d.ts +16 -0
  209. package/dist/src/tokens/process/formats/css/size.d.ts.map +1 -0
  210. package/dist/src/tokens/process/formats/css/size.js +95 -0
  211. package/dist/src/tokens/process/formats/css/size.js.map +1 -0
  212. package/dist/src/tokens/process/formats/css/type-scale.d.ts +7 -0
  213. package/dist/src/tokens/process/formats/css/type-scale.d.ts.map +1 -0
  214. package/dist/src/tokens/process/formats/css/type-scale.js +57 -0
  215. package/dist/src/tokens/process/formats/css/type-scale.js.map +1 -0
  216. package/dist/src/tokens/process/formats/css/typography.d.ts +7 -0
  217. package/dist/src/tokens/process/formats/css/typography.d.ts.map +1 -0
  218. package/dist/src/tokens/process/formats/css/typography.js +31 -0
  219. package/dist/src/tokens/process/formats/css/typography.js.map +1 -0
  220. package/dist/src/tokens/process/formats/css.d.ts +15 -0
  221. package/dist/src/tokens/process/formats/css.d.ts.map +1 -0
  222. package/dist/src/tokens/process/formats/css.js +20 -0
  223. package/dist/src/tokens/process/formats/css.js.map +1 -0
  224. package/dist/src/tokens/process/output/declarations.d.ts +9 -0
  225. package/dist/src/tokens/process/output/declarations.d.ts.map +1 -0
  226. package/dist/src/tokens/process/output/declarations.js +38 -0
  227. package/dist/src/tokens/process/output/declarations.js.map +1 -0
  228. package/dist/src/tokens/process/output/tailwind.d.ts +7 -0
  229. package/dist/src/tokens/process/output/tailwind.d.ts.map +1 -0
  230. package/dist/src/tokens/process/output/tailwind.js +47 -0
  231. package/dist/src/tokens/process/output/tailwind.js.map +1 -0
  232. package/dist/src/tokens/process/output/theme.d.ts +31 -0
  233. package/dist/src/tokens/process/output/theme.d.ts.map +1 -0
  234. package/dist/src/tokens/process/output/theme.js +85 -0
  235. package/dist/src/tokens/process/output/theme.js.map +1 -0
  236. package/dist/src/tokens/process/platform.d.ts +69 -0
  237. package/dist/src/tokens/process/platform.d.ts.map +1 -0
  238. package/dist/src/tokens/process/platform.js +128 -0
  239. package/dist/src/tokens/process/platform.js.map +1 -0
  240. package/dist/src/tokens/process/transformers.d.ts +10 -0
  241. package/dist/src/tokens/process/transformers.d.ts.map +1 -0
  242. package/dist/src/tokens/process/transformers.js +56 -0
  243. package/dist/src/tokens/process/transformers.js.map +1 -0
  244. package/dist/src/tokens/process/utils/getMultidimensionalThemes.d.ts +38 -0
  245. package/dist/src/tokens/process/utils/getMultidimensionalThemes.d.ts.map +1 -0
  246. package/dist/src/tokens/process/utils/getMultidimensionalThemes.js +112 -0
  247. package/dist/src/tokens/process/utils/getMultidimensionalThemes.js.map +1 -0
  248. package/dist/src/tokens/process/utils/kebab-case.d.ts +8 -0
  249. package/dist/src/tokens/process/utils/kebab-case.d.ts.map +1 -0
  250. package/dist/src/tokens/process/utils/kebab-case.js +11 -0
  251. package/dist/src/tokens/process/utils/kebab-case.js.map +1 -0
  252. package/dist/src/tokens/types.d.ts +71 -0
  253. package/dist/src/tokens/types.d.ts.map +1 -0
  254. package/dist/src/tokens/types.js +1 -0
  255. package/dist/src/tokens/utils.d.ts +62 -0
  256. package/dist/src/tokens/utils.d.ts.map +1 -0
  257. package/dist/src/tokens/utils.js +123 -0
  258. package/dist/src/tokens/utils.js.map +1 -0
  259. package/dist/src/types.d.ts +1 -0
  260. package/dist/src/types.js +10 -0
  261. package/dist/src/types.js.map +1 -0
  262. package/dist/src/utils/filesystem.d.ts +47 -0
  263. package/dist/src/utils/filesystem.d.ts.map +1 -0
  264. package/dist/src/utils/filesystem.js +117 -0
  265. package/dist/src/utils/filesystem.js.map +1 -0
  266. package/package.json +87 -0
@@ -0,0 +1,71 @@
1
+ import { ConfigSchemaTheme } from "../schemas/v1.1/schema.js";
2
+ import { ColorScheme } from "../colors/types.js";
3
+ import { GetStyleDictionaryConfig } from "./process/configs/shared.js";
4
+ import { Config } from "style-dictionary/types";
5
+
6
+ //#region src/tokens/types.d.ts
7
+ type Token = {
8
+ $value: string | Record<string, string>[];
9
+ $type: string;
10
+ } | {
11
+ $type: 'boxShadow';
12
+ $value: Record<'x' | 'y' | 'blur' | 'spread' | 'color', string>[];
13
+ } | {
14
+ $type: 'typography';
15
+ $value: Record<'fontFamily' | 'fontWeight' | 'lineHeight' | 'fontSize' | 'letterSpacing', string>;
16
+ };
17
+ type TokenSet = {
18
+ [key: string]: Token | TokenSet;
19
+ };
20
+ type TokenSets = Map<string, TokenSet>;
21
+ type Colors = Theme['colors'];
22
+ type Typography = Theme['typography'];
23
+ type Theme = {
24
+ name: string;
25
+ } & Required<Omit<ConfigSchemaTheme, 'overrides'>> & Pick<ConfigSchemaTheme, 'overrides'>;
26
+ type SizeModes = 'small' | 'medium' | 'large';
27
+ /**
28
+ * A multi-dimensional theme is a concrete permutation of the possible theme dimensions
29
+ */
30
+ type ThemePermutation = {
31
+ 'color-scheme': string;
32
+ color: string;
33
+ semantic: string;
34
+ size: string;
35
+ theme: string;
36
+ typography: string;
37
+ };
38
+ type ThemeDimension = keyof ThemePermutation;
39
+ type TokenSetDimensions = {
40
+ colorSchemes: ColorScheme[];
41
+ sizeModes: SizeModes[];
42
+ };
43
+ type GetSDConfigOptions = {
44
+ tokensDir?: string;
45
+ dry?: boolean;
46
+ tokenSets?: TokenSets;
47
+ };
48
+ type BuildConfig = {
49
+ /** Optional name of the build config - only used in the console output */name?: string; /** Style Dictionary configuration creator */
50
+ getConfig: GetStyleDictionaryConfig; /** Which theme dimensions to include. `theme` is always included. */
51
+ dimensions: ThemeDimension[]; /** Whether the build config is enabled. @default () => true */
52
+ enabled?: () => boolean; /** Custom log message. */
53
+ log?: (config: SDConfigForThemePermutation) => string;
54
+ };
55
+ type SDConfigForThemePermutation = {
56
+ permutation: ThemePermutation;
57
+ config: Config;
58
+ };
59
+ /** This type is taken from Style Dictionary `formatPlatform`.
60
+ * Metadata for a file output */
61
+ type OutputFile = {
62
+ output: string;
63
+ destination: string;
64
+ };
65
+ type DesignsystemetObject = {
66
+ name: string;
67
+ version: string;
68
+ };
69
+ //#endregion
70
+ export { BuildConfig, Colors, DesignsystemetObject, GetSDConfigOptions, OutputFile, SDConfigForThemePermutation, SizeModes, Theme, ThemeDimension, ThemePermutation, Token, TokenSet, TokenSetDimensions, TokenSets, Typography };
71
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","names":[],"sources":["../../../src/tokens/types.ts"],"mappings":";;;;;;KAKY,KAAA;EACN,MAAA,WAAiB,MAAA;EAA0B,KAAA;AAAA;EAC3C,KAAA;EAAoB,MAAA,EAAQ,MAAA;AAAA;EAE5B,KAAA;EACA,MAAA,EAAQ,MAAA;AAAA;AAAA,KAGF,QAAA;EAAA,CACT,GAAA,WAAc,KAAA,GAAQ,QAAQ;AAAA;AAAA,KAErB,SAAA,GAAY,GAAG,SAAS,QAAA;AAAA,KAExB,MAAA,GAAS,KAAK;AAAA,KACd,UAAA,GAAa,KAAK;AAAA,KAElB,KAAA;EACV,IAAA;AAAA,IACE,QAAA,CAAS,IAAA,CAAK,iBAAA,kBAChB,IAAA,CAAK,iBAAA;AAAA,KAEK,SAAA;;AAhBQ;AAGpB;KAkBY,gBAAA;EACV,cAAA;EACA,KAAA;EACA,QAAA;EACA,IAAA;EACA,KAAA;EACA,UAAA;AAAA;AAAA,KAGU,cAAA,SAAuB,gBAAgB;AAAA,KAEvC,kBAAA;EACV,YAAA,EAAc,WAAA;EACd,SAAA,EAAW,SAAS;AAAA;AAAA,KAGV,kBAAA;EACV,SAAA;EACA,GAAA;EACA,SAAA,GAAY,SAAS;AAAA;AAAA,KAGX,WAAA;EAlCU,0EAoCpB,IAAA,WApC4B;EAsC5B,SAAA,EAAW,wBAAA,EApCD;EAsCV,UAAA,EAAY,cAAA;EAEZ,OAAA,kBAtCW;EAwCX,GAAA,IAAO,MAAA,EAAQ,2BAAA;AAAA;AAAA,KAGL,2BAAA;EAAgC,WAAA,EAAa,gBAAA;EAAkB,MAAA,EAAQ,MAAQ;AAAA;;;KAI/E,UAAA;EACV,MAAA;EACA,WAAW;AAAA;AAAA,KAGD,oBAAA;EACV,IAAA;EACA,OAAO;AAAA"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,62 @@
1
+ import { CssColor } from "../colors/types.js";
2
+ import { Theme, TokenSet } from "./types.js";
3
+ import { Tokens } from "style-dictionary";
4
+ import { DesignToken, TransformedToken as TransformedToken$1 } from "style-dictionary/types";
5
+
6
+ //#region src/tokens/utils.d.ts
7
+ /**
8
+ * Returns value based on design token format used. Read more:https://v4.styledictionary.com/info/dtcg/
9
+ *
10
+ * Use generic (`<T>`) to define return value type
11
+ * @param token Transformed or Design token
12
+ * @returns value
13
+ */
14
+ declare const getValue: <T>(token: TransformedToken$1 | DesignToken) => T;
15
+ /**
16
+ * Check if token type matches provided type
17
+ * This function is curried
18
+ * @param types Type or array of types to check against
19
+ * @param token Transformed token
20
+ * @returns boolean
21
+ */
22
+ declare const typeEquals: (types: string[] | string, token: TransformedToken$1) => boolean;
23
+ declare const pathStartsWithOneOf: ((paths: (string | string[])[], token: TransformedToken$1) => boolean) & ((paths: (string | string[])[]) => (token: TransformedToken$1) => boolean);
24
+ declare function isSemanticToken(token: TransformedToken$1): boolean;
25
+ declare function isSemanticColorToken(token: TransformedToken$1, color: string): boolean;
26
+ declare const isDigit: (s: string) => boolean;
27
+ /** Copied from Style Dictionary and added types
28
+ @see https://github.com/amzn/style-dictionary/blob/31c29df0382a61b085f6392dc3225c5009fbffc5/lib/utils/combineJSON.js#L33 */
29
+ declare function traverseObj(obj: Tokens | TokenSet, fn: (obj: TokenSet | Tokens | DesignToken, key: keyof Tokens | string, slice: Tokens | DesignToken | string) => void): TokenSet | import("style-dictionary/types").DesignTokens;
30
+ /**
31
+ * In the given tokens array, inline and remove tokens that match the predicate
32
+ *
33
+ * Example: In pseudo-code, given the predicate `(token) => token.path === ['size', '1']` and the following tokens
34
+ * ```js
35
+ * [
36
+ * { path: ['size', 'base'], original: { $value: '8px' } },
37
+ * { path: ['size', '1'], original: { $value: '{size.base} * 2' } },
38
+ * { path: ['size', 'sm']: original: { $value: 'min({size.1}, 12px)' } }
39
+ * ]
40
+ * ```
41
+ * would return
42
+ * ```js
43
+ * [
44
+ * { path: ['size', 'base'], original: { $value: '8px' } },
45
+ * { path: ['size', 'sm']: original: { $value: 'min({size.base} * 2, 12px)' } }
46
+ * ]
47
+ * ```
48
+ *
49
+ * @param shouldInline - predicate to determine if token should be inlined
50
+ * @param tokens - array of tokens to transform
51
+ * @returns copy of `tokens` without those that matched the predicate,
52
+ * where references to the matching tokens have been inlined
53
+ */
54
+ declare function inlineTokens(shouldInline: (t: TransformedToken$1) => boolean, tokens: TransformedToken$1[]): TransformedToken$1[];
55
+ declare function shortSizeName(size: string): string;
56
+ declare const sizeComparator: (size: string) => number;
57
+ declare function orderBySize(sizes: string[]): string[];
58
+ declare function addSeverityColors(colors: Theme['colors']): Record<string, CssColor>;
59
+ declare function toColorNames(themeColors: Theme['colors']): string[];
60
+ //#endregion
61
+ export { addSeverityColors, getValue, inlineTokens, isDigit, isSemanticColorToken, isSemanticToken, orderBySize, pathStartsWithOneOf, shortSizeName, sizeComparator, toColorNames, traverseObj, typeEquals };
62
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","names":[],"sources":["../../../src/tokens/utils.ts"],"mappings":";;;;;;;;;AAyBA;;;;cAAa,QAAA,MAAe,KAAA,EAAO,kBAAA,GAAmB,WAAA,KAAc,CAAA;;;;;;;;cASvD,UAAA,GAAa,KAAA,qBAA0B,KAAA,EAAO,kBAAgB;AAAA,cAU9D,mBAAA,IAAuB,KAAA,yBAA8B,KAAA,EAAO,kBAAA,kBACrE,KAAA,6BAAkC,KAAA,EAAO,kBAAgB;AAAA,iBAgB7C,eAAA,CAAgB,KAAuB,EAAhB,kBAAgB;AAAA,iBAIvC,oBAAA,CAAqB,KAAA,EAAO,kBAAgB,EAAE,KAAA;AAAA,cAIjD,OAAA,GAAW,CAAS;;;iBAIjB,WAAA,CACd,GAAA,EAAK,MAAA,GAAS,QAAA,EACd,EAAA,GAAK,GAAA,EAAK,QAAA,GAAW,MAAA,GAAS,WAAA,EAAa,GAAA,QAAW,MAAA,WAAiB,KAAA,EAAO,MAAA,GAAS,WAAA,qBAA6B,QAAA,oCAAA,YAAA;;;;AAzC3C;AAU3E;;;;;;;;;;;AAC6D;AAgB7D;;;;AAAuD;AAIvD;;;iBAgDgB,YAAA,CAAa,YAAA,GAAe,CAAA,EAAG,kBAAA,cAA8B,MAAA,EAAQ,kBAAA,KAAkB,kBAAA;AAAA,iBAyBvF,aAAA,CAAc,IAAY;AAAA,cAI7B,cAAA,GAAkB,IAAY;AAAA,iBAK3B,WAAA,CAAY,KAAe;AAAA,iBAI3B,iBAAA,CAAkB,MAAA,EAAQ,KAAA,aAAkB,MAAA,SAAe,QAAA;AAAA,iBAK3D,YAAA,CAAa,WAA4B,EAAf,KAAK"}
@@ -0,0 +1,123 @@
1
+ import { baseColors } from "../colors/colorMetadata.js";
2
+ import * as R from "ramda";
3
+ //#region src/tokens/utils.ts
4
+ const mapToLowerCase = R.map(R.toLower);
5
+ const hasAnyTruth = R.any(R.equals(true));
6
+ /**
7
+ * Returns type based on design token format used. Read more:https://v4.styledictionary.com/info/dtcg/
8
+ * @param token Transformed token
9
+ * @returns type
10
+ */
11
+ const getType = (token) => (token.$type ?? token.type) || "";
12
+ /**
13
+ * Returns value based on design token format used. Read more:https://v4.styledictionary.com/info/dtcg/
14
+ *
15
+ * Use generic (`<T>`) to define return value type
16
+ * @param token Transformed or Design token
17
+ * @returns value
18
+ */
19
+ const getValue = (token) => token.$value ?? token.value;
20
+ /**
21
+ * Check if token type matches provided type
22
+ * This function is curried
23
+ * @param types Type or array of types to check against
24
+ * @param token Transformed token
25
+ * @returns boolean
26
+ */
27
+ const typeEquals = R.curry((types, token) => {
28
+ if (R.isNil(token)) return false;
29
+ return R.includes(R.toLower(getType(token)), R.map(R.toLower, Array.isArray(types) ? types : [types]));
30
+ });
31
+ const pathStartsWithOneOf = R.curry((paths, token) => {
32
+ if (R.isNil(token)) return false;
33
+ const tokenPath = mapToLowerCase(token.path);
34
+ return hasAnyTruth(R.map((pathOrString) => {
35
+ const path = typeof pathOrString === "string" ? [pathOrString] : pathOrString;
36
+ return R.startsWith(mapToLowerCase(path), tokenPath);
37
+ }, paths));
38
+ });
39
+ function isSemanticToken(token) {
40
+ return token.filePath.includes("semantic/");
41
+ }
42
+ function isSemanticColorToken(token, color) {
43
+ return token.filePath.includes("semantic/") && R.startsWith(["color", color], token.path);
44
+ }
45
+ const isDigit = (s) => /^\d+$/.test(s);
46
+ /** Copied from Style Dictionary and added types
47
+ @see https://github.com/amzn/style-dictionary/blob/31c29df0382a61b085f6392dc3225c5009fbffc5/lib/utils/combineJSON.js#L33 */
48
+ function traverseObj(obj, fn) {
49
+ for (const key in obj) {
50
+ const prop = obj[key];
51
+ if (prop != null) {
52
+ fn.apply(null, [
53
+ obj,
54
+ key,
55
+ prop
56
+ ]);
57
+ if (typeof prop === "object") traverseObj(prop, fn);
58
+ }
59
+ }
60
+ return obj;
61
+ }
62
+ /**
63
+ * In the given tokens array, inline and remove tokens that match the predicate
64
+ *
65
+ * Example: In pseudo-code, given the predicate `(token) => token.path === ['size', '1']` and the following tokens
66
+ * ```js
67
+ * [
68
+ * { path: ['size', 'base'], original: { $value: '8px' } },
69
+ * { path: ['size', '1'], original: { $value: '{size.base} * 2' } },
70
+ * { path: ['size', 'sm']: original: { $value: 'min({size.1}, 12px)' } }
71
+ * ]
72
+ * ```
73
+ * would return
74
+ * ```js
75
+ * [
76
+ * { path: ['size', 'base'], original: { $value: '8px' } },
77
+ * { path: ['size', 'sm']: original: { $value: 'min({size.base} * 2, 12px)' } }
78
+ * ]
79
+ * ```
80
+ *
81
+ * @param shouldInline - predicate to determine if token should be inlined
82
+ * @param tokens - array of tokens to transform
83
+ * @returns copy of `tokens` without those that matched the predicate,
84
+ * where references to the matching tokens have been inlined
85
+ */
86
+ function inlineTokens(shouldInline, tokens) {
87
+ const [inlineableTokens, otherTokens] = R.partition(shouldInline, tokens);
88
+ return otherTokens.map((token) => {
89
+ let transformed = getValue(token.original);
90
+ for (const ref of inlineableTokens) {
91
+ const refName = ref.path.join(".");
92
+ if (typeof transformed === "string") transformed = transformed.replaceAll(`{${refName}}`, getValue(ref.original));
93
+ }
94
+ return R.set(R.lensPath(["original", "$value"]), transformed, token);
95
+ });
96
+ }
97
+ const sizeMap = {
98
+ xsmall: "xs",
99
+ small: "sm",
100
+ medium: "md",
101
+ large: "lg",
102
+ xlarge: "xl"
103
+ };
104
+ function shortSizeName(size) {
105
+ return sizeMap[size] ?? size;
106
+ }
107
+ const sizeComparator = (size) => {
108
+ return Object.entries(sizeMap).findIndex(([key, val]) => key === size || val === size) ?? 0;
109
+ };
110
+ function orderBySize(sizes) {
111
+ return R.sortBy(sizeComparator, sizes);
112
+ }
113
+ function addSeverityColors(colors) {
114
+ return R.mergeDeepLeft(colors, baseColors);
115
+ }
116
+ function toColorNames(themeColors) {
117
+ const colors = addSeverityColors(themeColors);
118
+ return Object.keys(colors);
119
+ }
120
+ //#endregion
121
+ export { addSeverityColors, getValue, inlineTokens, isDigit, isSemanticColorToken, isSemanticToken, orderBySize, pathStartsWithOneOf, shortSizeName, sizeComparator, toColorNames, traverseObj, typeEquals };
122
+
123
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","names":[],"sources":["../../../src/tokens/utils.ts"],"sourcesContent":["import * as R from 'ramda';\nimport type { Tokens } from 'style-dictionary';\nimport type { DesignToken, TransformedToken } from 'style-dictionary/types';\nimport { baseColors } from '../colors/colorMetadata.ts';\nimport type { CssColor } from '../index.ts';\nimport type { Theme, TokenSet } from './types.ts';\n\nconst mapToLowerCase = R.map<string, string>(R.toLower);\n\nconst hasAnyTruth = R.any(R.equals(true));\n\n/**\n * Returns type based on design token format used. Read more:https://v4.styledictionary.com/info/dtcg/\n * @param token Transformed token\n * @returns type\n */\nconst getType = (token: TransformedToken) => ((token.$type ?? token.type) as string) || '';\n\n/**\n * Returns value based on design token format used. Read more:https://v4.styledictionary.com/info/dtcg/\n *\n * Use generic (`<T>`) to define return value type\n * @param token Transformed or Design token\n * @returns value\n */\nexport const getValue = <T>(token: TransformedToken | DesignToken): T => (token.$value ?? token.value) as T;\n\n/**\n * Check if token type matches provided type\n * This function is curried\n * @param types Type or array of types to check against\n * @param token Transformed token\n * @returns boolean\n */\nexport const typeEquals: (types: string[] | string, token: TransformedToken) => boolean = R.curry(\n (types: string[] | string, token: TransformedToken) => {\n if (R.isNil(token)) {\n return false;\n }\n\n return R.includes(R.toLower(getType(token)), R.map(R.toLower, Array.isArray(types) ? types : [types]));\n },\n);\n\nexport const pathStartsWithOneOf: ((paths: (string | string[])[], token: TransformedToken) => boolean) &\n ((paths: (string | string[])[]) => (token: TransformedToken) => boolean) = R.curry(\n (paths: (string | string[])[], token: TransformedToken) => {\n if (R.isNil(token)) {\n return false;\n }\n\n const tokenPath = mapToLowerCase(token.path);\n const matchPathsStartingWith = R.map((pathOrString) => {\n const path = typeof pathOrString === 'string' ? [pathOrString] : pathOrString;\n return R.startsWith(mapToLowerCase(path), tokenPath);\n }, paths);\n\n return hasAnyTruth(matchPathsStartingWith);\n },\n);\n\nexport function isSemanticToken(token: TransformedToken): boolean {\n return token.filePath.includes('semantic/');\n}\n\nexport function isSemanticColorToken(token: TransformedToken, color: string): boolean {\n return token.filePath.includes('semantic/') && R.startsWith(['color', color], token.path);\n}\n\nexport const isDigit = (s: string) => /^\\d+$/.test(s);\n\n/** Copied from Style Dictionary and added types\n@see https://github.com/amzn/style-dictionary/blob/31c29df0382a61b085f6392dc3225c5009fbffc5/lib/utils/combineJSON.js#L33 */\nexport function traverseObj(\n obj: Tokens | TokenSet,\n fn: (obj: TokenSet | Tokens | DesignToken, key: keyof Tokens | string, slice: Tokens | DesignToken | string) => void,\n) {\n for (const key in obj) {\n const prop = obj[key];\n if (prop != null) {\n fn.apply(null, [obj, key, prop]);\n if (typeof prop === 'object') {\n traverseObj(prop, fn);\n }\n }\n }\n return obj;\n}\n\n/**\n * In the given tokens array, inline and remove tokens that match the predicate\n *\n * Example: In pseudo-code, given the predicate `(token) => token.path === ['size', '1']` and the following tokens\n * ```js\n * [\n * { path: ['size', 'base'], original: { $value: '8px' } },\n * { path: ['size', '1'], original: { $value: '{size.base} * 2' } },\n * { path: ['size', 'sm']: original: { $value: 'min({size.1}, 12px)' } }\n * ]\n * ```\n * would return\n * ```js\n * [\n * { path: ['size', 'base'], original: { $value: '8px' } },\n * { path: ['size', 'sm']: original: { $value: 'min({size.base} * 2, 12px)' } }\n * ]\n * ```\n *\n * @param shouldInline - predicate to determine if token should be inlined\n * @param tokens - array of tokens to transform\n * @returns copy of `tokens` without those that matched the predicate,\n * where references to the matching tokens have been inlined\n */\nexport function inlineTokens(shouldInline: (t: TransformedToken) => boolean, tokens: TransformedToken[]) {\n const [inlineableTokens, otherTokens] = R.partition(shouldInline, tokens);\n return otherTokens.map((token: TransformedToken) => {\n // Inline the tokens that satisfy shouldInline().\n let transformed = getValue<string>(token.original);\n for (const ref of inlineableTokens) {\n const refName = ref.path.join('.');\n\n if (typeof transformed === 'string') {\n transformed = transformed.replaceAll(`{${refName}}`, getValue<string>(ref.original));\n }\n }\n const tokenWithInlinedRefs = R.set(R.lensPath(['original', '$value']), transformed, token);\n return tokenWithInlinedRefs;\n });\n}\n\nconst sizeMap: Record<string, string | undefined> = {\n xsmall: 'xs',\n small: 'sm',\n medium: 'md',\n large: 'lg',\n xlarge: 'xl',\n};\n\nexport function shortSizeName(size: string): string {\n return sizeMap[size] ?? size;\n}\n\nexport const sizeComparator = (size: string): number => {\n const sortIndex = Object.entries(sizeMap).findIndex(([key, val]) => key === size || val === size);\n return sortIndex ?? 0;\n};\n\nexport function orderBySize(sizes: string[]): string[] {\n return R.sortBy(sizeComparator, sizes);\n}\n\nexport function addSeverityColors(colors: Theme['colors']): Record<string, CssColor> {\n // Add severity colors if not present\n return R.mergeDeepLeft(colors, baseColors);\n}\n\nexport function toColorNames(themeColors: Theme['colors']): string[] {\n const colors = addSeverityColors(themeColors);\n\n return Object.keys(colors);\n}\n"],"mappings":";;;AAOA,MAAM,iBAAiB,EAAE,IAAoB,EAAE,OAAO;AAEtD,MAAM,cAAc,EAAE,IAAI,EAAE,OAAO,IAAI,CAAC;;;;;;AAOxC,MAAM,WAAW,WAA8B,MAAM,SAAS,MAAM,SAAoB;;;;;;;;AASxF,MAAa,YAAe,UAA8C,MAAM,UAAU,MAAM;;;;;;;;AAShG,MAAa,aAA6E,EAAE,OACzF,OAA0B,UAA4B;CACrD,IAAI,EAAE,MAAM,KAAK,GACf,OAAO;CAGT,OAAO,EAAE,SAAS,EAAE,QAAQ,QAAQ,KAAK,CAAC,GAAG,EAAE,IAAI,EAAE,SAAS,MAAM,QAAQ,KAAK,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC;AACvG,CACF;AAEA,MAAa,sBACgE,EAAE,OAC5E,OAA8B,UAA4B;CACzD,IAAI,EAAE,MAAM,KAAK,GACf,OAAO;CAGT,MAAM,YAAY,eAAe,MAAM,IAAI;CAM3C,OAAO,YALwB,EAAE,KAAK,iBAAiB;EACrD,MAAM,OAAO,OAAO,iBAAiB,WAAW,CAAC,YAAY,IAAI;EACjE,OAAO,EAAE,WAAW,eAAe,IAAI,GAAG,SAAS;CACrD,GAAG,KAEqC,CAAC;AAC3C,CACF;AAEA,SAAgB,gBAAgB,OAAkC;CAChE,OAAO,MAAM,SAAS,SAAS,WAAW;AAC5C;AAEA,SAAgB,qBAAqB,OAAyB,OAAwB;CACpF,OAAO,MAAM,SAAS,SAAS,WAAW,KAAK,EAAE,WAAW,CAAC,SAAS,KAAK,GAAG,MAAM,IAAI;AAC1F;AAEA,MAAa,WAAW,MAAc,QAAQ,KAAK,CAAC;;;AAIpD,SAAgB,YACd,KACA,IACA;CACA,KAAK,MAAM,OAAO,KAAK;EACrB,MAAM,OAAO,IAAI;EACjB,IAAI,QAAQ,MAAM;GAChB,GAAG,MAAM,MAAM;IAAC;IAAK;IAAK;GAAI,CAAC;GAC/B,IAAI,OAAO,SAAS,UAClB,YAAY,MAAM,EAAE;EAExB;CACF;CACA,OAAO;AACT;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,SAAgB,aAAa,cAAgD,QAA4B;CACvG,MAAM,CAAC,kBAAkB,eAAe,EAAE,UAAU,cAAc,MAAM;CACxE,OAAO,YAAY,KAAK,UAA4B;EAElD,IAAI,cAAc,SAAiB,MAAM,QAAQ;EACjD,KAAK,MAAM,OAAO,kBAAkB;GAClC,MAAM,UAAU,IAAI,KAAK,KAAK,GAAG;GAEjC,IAAI,OAAO,gBAAgB,UACzB,cAAc,YAAY,WAAW,IAAI,QAAQ,IAAI,SAAiB,IAAI,QAAQ,CAAC;EAEvF;EAEA,OAD6B,EAAE,IAAI,EAAE,SAAS,CAAC,YAAY,QAAQ,CAAC,GAAG,aAAa,KAC1D;CAC5B,CAAC;AACH;AAEA,MAAM,UAA8C;CAClD,QAAQ;CACR,OAAO;CACP,QAAQ;CACR,OAAO;CACP,QAAQ;AACV;AAEA,SAAgB,cAAc,MAAsB;CAClD,OAAO,QAAQ,SAAS;AAC1B;AAEA,MAAa,kBAAkB,SAAyB;CAEtD,OADkB,OAAO,QAAQ,OAAO,CAAC,CAAC,WAAW,CAAC,KAAK,SAAS,QAAQ,QAAQ,QAAQ,IAC7E,KAAK;AACtB;AAEA,SAAgB,YAAY,OAA2B;CACrD,OAAO,EAAE,OAAO,gBAAgB,KAAK;AACvC;AAEA,SAAgB,kBAAkB,QAAmD;CAEnF,OAAO,EAAE,cAAc,QAAQ,UAAU;AAC3C;AAEA,SAAgB,aAAa,aAAwC;CACnE,MAAM,SAAS,kBAAkB,WAAW;CAE5C,OAAO,OAAO,KAAK,MAAM;AAC3B"}
@@ -0,0 +1 @@
1
+ export * from "@digdir/designsystemet-types";
@@ -0,0 +1,10 @@
1
+ export * from "@digdir/designsystemet-types";
2
+ //#region src/types.ts
3
+ /*!
4
+ * This file is deprecated and will be removed in a future release.
5
+ * Use @digdir/designsystemet-types instead
6
+ */
7
+ //#endregion
8
+ export {};
9
+
10
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../src/types.ts"],"sourcesContent":["/*!\n * This file is deprecated and will be removed in a future release.\n * Use @digdir/designsystemet-types instead\n */\n\nexport * from '@digdir/designsystemet-types';\n"],"mappings":""}
@@ -0,0 +1,47 @@
1
+ import { OutputFile } from "../tokens/types.js";
2
+ import { CopyOptions, PathLike } from "node:fs";
3
+
4
+ //#region src/utils/filesystem.d.ts
5
+ declare class FileSystem {
6
+ private isInitialized;
7
+ private dry;
8
+ private verbose;
9
+ /** Default working directory is where the process was started */
10
+ workingDir: string;
11
+ outDir: string;
12
+ /** Initialize the file system */
13
+ init({
14
+ dry,
15
+ outdir,
16
+ verbose
17
+ }: {
18
+ dry?: boolean;
19
+ outdir?: string;
20
+ verbose?: boolean;
21
+ }): void;
22
+ /**
23
+ * Creates a directory if it does not already exist.
24
+ *
25
+ * @param dir - The path of the directory to create.
26
+ *
27
+ * @returns A promise that resolves when the operation is complete.
28
+ * If the directory already exists or `dry` is `true`, the promise resolves immediately.
29
+ */
30
+ mkdir: (dir: PathLike) => Promise<string | void>;
31
+ writeFile: (path: PathLike, data: string) => Promise<void>;
32
+ cp: (src: string, dest: string, filter?: CopyOptions["filter"]) => Promise<void>;
33
+ copyFile: (src: PathLike, dest: PathLike) => Promise<void>;
34
+ cleanDir: (dir: string) => Promise<void>;
35
+ readFile: (path: PathLike, allowFileNotFound?: boolean) => Promise<string>;
36
+ readdir: (path: PathLike) => Promise<string[]>;
37
+ writeFiles: (files: OutputFile[], outDir: string, log?: boolean) => Promise<void>;
38
+ }
39
+ /**
40
+ * An abstraction of Node's file system API and helper functions for Designsystemet CLI interaction with the file system.
41
+ *
42
+ * Allows dry-running destructive operations, logging and store relevant file system state.
43
+ */
44
+ declare const dsfs: FileSystem;
45
+ //#endregion
46
+ export { dsfs };
47
+ //# sourceMappingURL=filesystem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filesystem.d.ts","names":[],"sources":["../../../src/utils/filesystem.ts"],"mappings":";;;;cAMM,UAAA;EAAA,QACI,aAAA;EAAA,QACA,GAAA;EAAA,QACA,OAAA;;EAER,UAAA;EACA,MAAA;EAGoB;EAApB,IAAA;IAAO,GAAA;IAAK,MAAA;IAAQ;EAAA;IAAa,GAAA;IAAe,MAAA;IAAiB,OAAA;EAAA;EA+DI;;;;;;;;EA/BrE,KAAA,GAAe,GAAA,EAAK,QAAA,KAAQ,OAAA;EAkB5B,SAAA,GAAmB,IAAA,EAAM,QAAA,EAAU,IAAA,aAAY,OAAA;EAa/C,EAAA,GAAY,GAAA,UAAa,IAAA,UAAc,MAAA,GAAS,WAAA,eAAqB,OAAA;EASrE,QAAA,GAAkB,GAAA,EAAK,QAAA,EAAU,IAAA,EAAM,QAAA,KAAQ,OAAA;EAS/C,QAAA,GAAkB,GAAA,aAAW,OAAA;EAW7B,QAAA,GAAkB,IAAA,EAAM,QAAA,EAAU,iBAAA,eAA2B,OAAA;EAc7D,OAAA,GAAiB,IAAA,EAAM,QAAA,KAAQ,OAAA;EAc/B,UAAA,GAAoB,KAAA,EAAO,UAAA,IAAc,MAAA,UAAgB,GAAA,eAAa,OAAA;AAAA;;;;;;cAsB3D,IAAA,EAAI,UAAmB"}
@@ -0,0 +1,117 @@
1
+ import pc from "picocolors";
2
+ import fs from "node:fs/promises";
3
+ import path from "node:path";
4
+ //#region src/utils/filesystem.ts
5
+ var FileSystem = class {
6
+ isInitialized = false;
7
+ dry = false;
8
+ verbose = false;
9
+ /** Default working directory is where the process was started */
10
+ workingDir = process.cwd();
11
+ outDir = this.workingDir;
12
+ /** Initialize the file system */
13
+ init({ dry, outdir, verbose }) {
14
+ if (this.isInitialized) {
15
+ console.warn(pc.yellow("FileSystem is already initialized. Ignoring subsequent init call."));
16
+ return;
17
+ }
18
+ if (dry) console.log(pc.blue("Initializing FileSystem in dry-run mode. No files will be written."));
19
+ this.dry = dry ?? false;
20
+ this.verbose = verbose ?? false;
21
+ this.outDir = outdir ? path.isAbsolute(outdir) ? outdir : path.join(this.workingDir, outdir) : this.workingDir;
22
+ if (this.verbose) console.log(`FileSystem initialized with workingDir: ${pc.green(this.workingDir)}, outDir: ${pc.green(this.outDir)}`);
23
+ this.isInitialized = true;
24
+ }
25
+ /**
26
+ * Creates a directory if it does not already exist.
27
+ *
28
+ * @param dir - The path of the directory to create.
29
+ *
30
+ * @returns A promise that resolves when the operation is complete.
31
+ * If the directory already exists or `dry` is `true`, the promise resolves immediately.
32
+ */
33
+ mkdir = async (dir) => {
34
+ if (this.dry) {
35
+ console.log(`${pc.blue("mkdir")} ${dir}`);
36
+ return Promise.resolve();
37
+ }
38
+ if (await fs.access(dir, fs.constants.F_OK).then(() => true).catch(() => false)) return Promise.resolve();
39
+ return fs.mkdir(dir, { recursive: true });
40
+ };
41
+ writeFile = async (path, data) => {
42
+ if (this.dry) {
43
+ console.log(`${pc.blue("writeFile")} ${path}`);
44
+ return Promise.resolve();
45
+ }
46
+ return fs.writeFile(path, data, { encoding: "utf-8" }).catch((error) => {
47
+ console.error(pc.red(`Error writing file: ${path}`));
48
+ console.error(pc.red(error));
49
+ throw error;
50
+ });
51
+ };
52
+ cp = async (src, dest, filter) => {
53
+ if (this.dry) {
54
+ console.log(`${pc.blue("cp")} ${src} ${dest}`);
55
+ return Promise.resolve();
56
+ }
57
+ return fs.cp(src, dest, {
58
+ recursive: true,
59
+ filter
60
+ });
61
+ };
62
+ copyFile = async (src, dest) => {
63
+ if (this.dry) {
64
+ console.log(`${pc.blue("copyFile")} ${src} to ${dest}`);
65
+ return Promise.resolve();
66
+ }
67
+ return fs.copyFile(src, dest);
68
+ };
69
+ cleanDir = async (dir) => {
70
+ if (this.dry) {
71
+ console.log(`${pc.blue("cleanDir")} ${dir}`);
72
+ return Promise.resolve();
73
+ }
74
+ console.log(`\n🔥 Cleaning dir ${pc.red(`${dir.trim()}`)} `);
75
+ return fs.rm(dir, {
76
+ recursive: true,
77
+ force: true
78
+ });
79
+ };
80
+ readFile = async (path, allowFileNotFound) => {
81
+ if (this.dry) console.log(`${pc.blue("readFile")} ${path}`);
82
+ try {
83
+ return await fs.readFile(path, "utf-8");
84
+ } catch (error) {
85
+ if (allowFileNotFound && error.code === "ENOENT") return "";
86
+ throw error;
87
+ }
88
+ };
89
+ readdir = async (path) => {
90
+ if (this.dry) console.log(`${pc.blue("readdir")} ${path}`);
91
+ try {
92
+ return await fs.readdir(path);
93
+ } catch (error) {
94
+ if (error.code === "ENOENT") return [];
95
+ throw error;
96
+ }
97
+ };
98
+ writeFiles = async (files, outDir, log) => {
99
+ for (const { destination: filename, output } of files) if (filename) {
100
+ const filePath = path.join(outDir, filename);
101
+ const fileDir = path.dirname(filePath);
102
+ if (log) console.log(filename);
103
+ await this.mkdir(fileDir);
104
+ await this.writeFile(filePath, output);
105
+ }
106
+ };
107
+ };
108
+ /**
109
+ * An abstraction of Node's file system API and helper functions for Designsystemet CLI interaction with the file system.
110
+ *
111
+ * Allows dry-running destructive operations, logging and store relevant file system state.
112
+ */
113
+ const dsfs = new FileSystem();
114
+ //#endregion
115
+ export { dsfs };
116
+
117
+ //# sourceMappingURL=filesystem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filesystem.js","names":[],"sources":["../../../src/utils/filesystem.ts"],"sourcesContent":["import type { CopyOptions, PathLike } from 'node:fs';\nimport fs from 'node:fs/promises';\nimport path from 'node:path';\nimport pc from 'picocolors';\nimport type { OutputFile } from '../tokens/types.ts';\n\nclass FileSystem {\n private isInitialized = false;\n private dry = false;\n private verbose = false;\n /** Default working directory is where the process was started */\n workingDir = process.cwd();\n outDir = this.workingDir;\n\n /** Initialize the file system */\n init({ dry, outdir, verbose }: { dry?: boolean; outdir?: string; verbose?: boolean }) {\n if (this.isInitialized) {\n console.warn(pc.yellow('FileSystem is already initialized. Ignoring subsequent init call.'));\n return;\n }\n\n if (dry) {\n console.log(pc.blue('Initializing FileSystem in dry-run mode. No files will be written.'));\n }\n\n this.dry = dry ?? false;\n this.verbose = verbose ?? false;\n // If a config file path is provided, set the working directory to the config file's directory. This allows relative paths in the config file to be resolved correctly. If no config file path is provided, use the current working directory.\n // this.workingDir = configFilePath ? path.dirname(configFilePath) : this.workingDir;\n // If an output directory is provided, resolve it relative to the working directory. Otherwise, use the working directory as the output directory.\n this.outDir = outdir ? (path.isAbsolute(outdir) ? outdir : path.join(this.workingDir, outdir)) : this.workingDir;\n if (this.verbose) {\n console.log(\n `FileSystem initialized with workingDir: ${pc.green(this.workingDir)}, outDir: ${pc.green(this.outDir)}`,\n );\n }\n this.isInitialized = true;\n }\n\n /**\n * Creates a directory if it does not already exist.\n *\n * @param dir - The path of the directory to create.\n *\n * @returns A promise that resolves when the operation is complete.\n * If the directory already exists or `dry` is `true`, the promise resolves immediately.\n */\n mkdir = async (dir: PathLike) => {\n if (this.dry) {\n console.log(`${pc.blue('mkdir')} ${dir}`);\n return Promise.resolve();\n }\n\n const exists = await fs\n .access(dir, fs.constants.F_OK)\n .then(() => true)\n .catch(() => false);\n\n if (exists) {\n return Promise.resolve();\n }\n\n return fs.mkdir(dir, { recursive: true });\n };\n\n writeFile = async (path: PathLike, data: string) => {\n if (this.dry) {\n console.log(`${pc.blue('writeFile')} ${path}`);\n return Promise.resolve();\n }\n\n return fs.writeFile(path, data, { encoding: 'utf-8' }).catch((error) => {\n console.error(pc.red(`Error writing file: ${path}`));\n console.error(pc.red(error));\n throw error;\n });\n };\n\n cp = async (src: string, dest: string, filter?: CopyOptions['filter']) => {\n if (this.dry) {\n console.log(`${pc.blue('cp')} ${src} ${dest}`);\n return Promise.resolve();\n }\n\n return fs.cp(src, dest, { recursive: true, filter });\n };\n\n copyFile = async (src: PathLike, dest: PathLike) => {\n if (this.dry) {\n console.log(`${pc.blue('copyFile')} ${src} to ${dest}`);\n return Promise.resolve();\n }\n\n return fs.copyFile(src, dest);\n };\n\n cleanDir = async (dir: string) => {\n if (this.dry) {\n console.log(`${pc.blue('cleanDir')} ${dir}`);\n return Promise.resolve();\n }\n\n console.log(`\\n🔥 Cleaning dir ${pc.red(`${dir.trim()}`)} `);\n\n return fs.rm(dir, { recursive: true, force: true });\n };\n\n readFile = async (path: PathLike, allowFileNotFound?: boolean) => {\n if (this.dry) {\n console.log(`${pc.blue('readFile')} ${path}`);\n }\n\n try {\n return await fs.readFile(path, 'utf-8');\n } catch (error) {\n if (allowFileNotFound && (error as NodeJS.ErrnoException).code === 'ENOENT') {\n return '';\n }\n throw error;\n }\n };\n readdir = async (path: PathLike) => {\n if (this.dry) {\n console.log(`${pc.blue('readdir')} ${path}`);\n }\n\n try {\n return await fs.readdir(path);\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === 'ENOENT') {\n return [];\n }\n throw error;\n }\n };\n writeFiles = async (files: OutputFile[], outDir: string, log?: boolean) => {\n for (const { destination: filename, output } of files) {\n if (filename) {\n const filePath = path.join(outDir, filename);\n const fileDir = path.dirname(filePath);\n\n if (log) {\n console.log(filename);\n }\n\n await this.mkdir(fileDir);\n await this.writeFile(filePath, output);\n }\n }\n };\n}\n\n/**\n * An abstraction of Node's file system API and helper functions for Designsystemet CLI interaction with the file system.\n *\n * Allows dry-running destructive operations, logging and store relevant file system state.\n */\nexport const dsfs = new FileSystem();\n"],"mappings":"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"}
package/package.json ADDED
@@ -0,0 +1,87 @@
1
+ {
2
+ "name": "@digdir/designsystemet",
3
+ "version": "0.0.0-chore-remove-cli-tsx-20260701060359",
4
+ "description": "CLI for Designsystemet",
5
+ "author": "Designsystemet team",
6
+ "engines": {
7
+ "node": ">=24.18.0"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/digdir/designsystemet.git"
12
+ },
13
+ "homepage": "https://github.com/digdir/designsystemet/tree/main/packages/cli",
14
+ "license": "MIT",
15
+ "type": "module",
16
+ "main": "./dist/src/index.js",
17
+ "files": [
18
+ "./dist/**"
19
+ ],
20
+ "bin": "dist/bin/designsystemet.js",
21
+ "exports": {
22
+ ".": {
23
+ "import": "./dist/src/index.js"
24
+ },
25
+ "./color": {
26
+ "import": "./dist/src/colors/index.js"
27
+ },
28
+ "./tokens": {
29
+ "import": "./dist/src/tokens/index.js"
30
+ },
31
+ "./types": {
32
+ "import": "./dist/src/types.js"
33
+ },
34
+ "./schemas/*": {
35
+ "import": "./dist/src/schemas/*"
36
+ }
37
+ },
38
+ "publishConfig": {
39
+ "access": "public"
40
+ },
41
+ "dependencies": {
42
+ "@commander-js/extra-typings": "^14.0.0",
43
+ "@digdir/designsystemet-types": "0.0.0-chore-remove-cli-tsx-20260701060359",
44
+ "@inquirer/confirm": "^6.1.1",
45
+ "@tokens-studio/sd-transforms": "2.0.3",
46
+ "chroma-js": "^3.2.0",
47
+ "colorjs.io": "^0.6.1",
48
+ "commander": "^14.0.3",
49
+ "fast-glob": "^3.3.3",
50
+ "hsluv": "^1.0.2",
51
+ "jsonc-parser": "^3.3.1",
52
+ "object-hash": "^3.0.0",
53
+ "picocolors": "^1.1.1",
54
+ "postcss": "^8.5.15",
55
+ "ramda": "^0.32.0",
56
+ "style-dictionary": "^5.5.0",
57
+ "zod": "^4.4.3",
58
+ "zod-validation-error": "^5.0.0"
59
+ },
60
+ "devDependencies": {
61
+ "@tokens-studio/types": "0.5.2",
62
+ "@types/chroma-js": "3.1.2",
63
+ "@types/node": "24.13.2",
64
+ "@types/object-hash": "3.0.6",
65
+ "@types/ramda": "0.31.1",
66
+ "tsdown": "0.22.2",
67
+ "typescript": "5.9.3"
68
+ },
69
+ "scripts": {
70
+ "designsystemet": "pnpm node ./bin/designsystemet.ts",
71
+ "designsystemet:inspect": "pnpm node --inspect-brk ./bin/designsystemet.ts",
72
+ "build": "tsdown && pnpm build:json-schema",
73
+ "build:json-schema": "pnpm node ./src/scripts/createJsonSchema.ts",
74
+ "types": "tsc --noEmit",
75
+ "test:tokens-create-options": "pnpm run designsystemet tokens create -m dominant:\"#007682\" -n \"#003333\" -b 99 -o ./temp/options/design-tokens --theme options --clean",
76
+ "test:tokens-create-config": "pnpm run designsystemet tokens create --config ./tests/test-tokens.config.jsonc",
77
+ "test:tokens-build-options": "pnpm run designsystemet tokens build -t ./temp/options/design-tokens -o ./temp/options/build --clean --experimental-tailwind",
78
+ "test:tokens-build-config": "pnpm run designsystemet tokens build -t ./tests/config/design-tokens -o ./tests/config/build --clean --experimental-tailwind",
79
+ "test:tokens-build-config:inspect": "pnpm run designsystemet:inspect tokens build -t ./tests/config/design-tokens -o ./tests/config/build --clean",
80
+ "test:tokens-create-and-build-options": "pnpm test:tokens-create-options && pnpm test:tokens-build-options",
81
+ "test:tokens-create-and-build-config": "pnpm test:tokens-create-config && pnpm test:tokens-build-config",
82
+ "test:generate-config-from-tokens": "pnpm run designsystemet generate-config-from-tokens -d ../../design-tokens --dry",
83
+ "test": "node -v && pnpm test:tokens-create-and-build-options && pnpm test:generate-config-from-tokens && pnpm test:tokens-create-and-build-config",
84
+ "update:preview-tokens": "pnpm node ./src/scripts/update-preview-tokens.ts",
85
+ "verify": "pnpm test && pnpm update:template && pnpm --filter @internal/digdir update:theme-digdir"
86
+ }
87
+ }