@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 @@
1
+ {"version":3,"file":"style.js","names":[],"sources":["../../../../../../src/tokens/create/generators/semantic/style.ts"],"sourcesContent":["import * as R from 'ramda';\nimport { type ColorNames, semanticColorMap } from '../../../../colors/types.ts';\nimport type { Token, TokenSet } from '../../../types.ts';\n\nexport function generateSemanticStyle(colorNames: string[]): TokenSet {\n return {\n ...generateColors(colorNames),\n 'border-width': {\n default: {\n $type: 'borderWidth',\n $value: '{border-width.1}',\n },\n focus: {\n $type: 'borderWidth',\n $value: '{border-width.3}',\n },\n },\n 'border-radius': {\n sm: {\n $type: 'dimension',\n $value: '{border-radius.1}',\n },\n md: {\n $type: 'dimension',\n $value: '{border-radius.2}',\n },\n lg: {\n $type: 'dimension',\n $value: '{border-radius.3}',\n },\n xl: {\n $type: 'dimension',\n $value: '{border-radius.4}',\n },\n default: {\n $type: 'dimension',\n $value: '{border-radius.5}',\n },\n full: {\n $type: 'dimension',\n $value: '{border-radius.6}',\n },\n },\n opacity: {\n disabled: {\n $type: 'opacity',\n $value: '{opacity.30}',\n },\n },\n typography: {\n heading: {\n '2xl': {\n $type: 'typography',\n $value: {\n fontFamily: '{font-family}',\n fontWeight: '{font-weight.medium}',\n lineHeight: '{line-height.sm}',\n fontSize: '{font-size.10}',\n letterSpacing: '{letter-spacing.1}',\n },\n },\n xl: {\n $type: 'typography',\n $value: {\n fontFamily: '{font-family}',\n fontWeight: '{font-weight.medium}',\n lineHeight: '{line-height.sm}',\n fontSize: '{font-size.9}',\n letterSpacing: '{letter-spacing.1}',\n },\n },\n lg: {\n $type: 'typography',\n $value: {\n fontFamily: '{font-family}',\n fontWeight: '{font-weight.medium}',\n lineHeight: '{line-height.sm}',\n fontSize: '{font-size.8}',\n letterSpacing: '{letter-spacing.2}',\n },\n },\n md: {\n $type: 'typography',\n $value: {\n fontFamily: '{font-family}',\n fontWeight: '{font-weight.medium}',\n lineHeight: '{line-height.sm}',\n fontSize: '{font-size.7}',\n letterSpacing: '{letter-spacing.3}',\n },\n },\n sm: {\n $type: 'typography',\n $value: {\n fontFamily: '{font-family}',\n fontWeight: '{font-weight.medium}',\n lineHeight: '{line-height.sm}',\n fontSize: '{font-size.6}',\n letterSpacing: '{letter-spacing.5}',\n },\n },\n xs: {\n $type: 'typography',\n $value: {\n fontFamily: '{font-family}',\n fontWeight: '{font-weight.medium}',\n lineHeight: '{line-height.sm}',\n fontSize: '{font-size.5}',\n letterSpacing: '{letter-spacing.6}',\n },\n },\n '2xs': {\n $type: 'typography',\n $value: {\n fontFamily: '{font-family}',\n fontWeight: '{font-weight.medium}',\n lineHeight: '{line-height.sm}',\n fontSize: '{font-size.4}',\n letterSpacing: '{letter-spacing.6}',\n },\n },\n },\n body: {\n xl: {\n $type: 'typography',\n $value: {\n fontFamily: '{font-family}',\n fontWeight: '{font-weight.regular}',\n lineHeight: '{line-height.md}',\n fontSize: '{font-size.6}',\n letterSpacing: '{letter-spacing.8}',\n },\n },\n lg: {\n $type: 'typography',\n $value: {\n fontFamily: '{font-family}',\n fontWeight: '{font-weight.regular}',\n lineHeight: '{line-height.md}',\n fontSize: '{font-size.5}',\n letterSpacing: '{letter-spacing.8}',\n },\n },\n md: {\n $type: 'typography',\n $value: {\n fontFamily: '{font-family}',\n fontWeight: '{font-weight.regular}',\n lineHeight: '{line-height.md}',\n fontSize: '{font-size.4}',\n letterSpacing: '{letter-spacing.8}',\n },\n },\n sm: {\n $type: 'typography',\n $value: {\n fontFamily: '{font-family}',\n fontWeight: '{font-weight.regular}',\n lineHeight: '{line-height.md}',\n fontSize: '{font-size.3}',\n letterSpacing: '{letter-spacing.7}',\n },\n },\n xs: {\n $type: 'typography',\n $value: {\n fontFamily: '{font-family}',\n fontWeight: '{font-weight.regular}',\n lineHeight: '{line-height.md}',\n fontSize: '{font-size.2}',\n letterSpacing: '{letter-spacing.6}',\n },\n },\n short: {\n xl: {\n $type: 'typography',\n $value: {\n fontFamily: '{font-family}',\n fontWeight: '{font-weight.regular}',\n lineHeight: '{line-height.sm}',\n fontSize: '{font-size.6}',\n letterSpacing: '{letter-spacing.8}',\n },\n },\n lg: {\n $type: 'typography',\n $value: {\n fontFamily: '{font-family}',\n fontWeight: '{font-weight.regular}',\n lineHeight: '{line-height.sm}',\n fontSize: '{font-size.5}',\n letterSpacing: '{letter-spacing.8}',\n },\n },\n md: {\n $type: 'typography',\n $value: {\n fontFamily: '{font-family}',\n fontWeight: '{font-weight.regular}',\n lineHeight: '{line-height.sm}',\n fontSize: '{font-size.4}',\n letterSpacing: '{letter-spacing.8}',\n },\n },\n sm: {\n $type: 'typography',\n $value: {\n fontFamily: '{font-family}',\n fontWeight: '{font-weight.regular}',\n lineHeight: '{line-height.sm}',\n fontSize: '{font-size.3}',\n letterSpacing: '{letter-spacing.7}',\n },\n },\n xs: {\n $type: 'typography',\n $value: {\n fontFamily: '{font-family}',\n fontWeight: '{font-weight.regular}',\n lineHeight: '{line-height.sm}',\n fontSize: '{font-size.2}',\n letterSpacing: '{letter-spacing.6}',\n },\n },\n },\n long: {\n xl: {\n $type: 'typography',\n $value: {\n fontFamily: '{font-family}',\n fontWeight: '{font-weight.regular}',\n lineHeight: '{line-height.lg}',\n fontSize: '{font-size.6}',\n letterSpacing: '{letter-spacing.8}',\n },\n },\n lg: {\n $type: 'typography',\n $value: {\n fontFamily: '{font-family}',\n fontWeight: '{font-weight.regular}',\n lineHeight: '{line-height.lg}',\n fontSize: '{font-size.5}',\n letterSpacing: '{letter-spacing.8}',\n },\n },\n md: {\n $type: 'typography',\n $value: {\n fontFamily: '{font-family}',\n fontWeight: '{font-weight.regular}',\n lineHeight: '{line-height.lg}',\n fontSize: '{font-size.4}',\n letterSpacing: '{letter-spacing.8}',\n },\n },\n sm: {\n $type: 'typography',\n $value: {\n fontFamily: '{font-family}',\n fontWeight: '{font-weight.regular}',\n lineHeight: '{line-height.lg}',\n fontSize: '{font-size.3}',\n letterSpacing: '{letter-spacing.7}',\n },\n },\n xs: {\n $type: 'typography',\n $value: {\n fontFamily: '{font-family}',\n fontWeight: '{font-weight.regular}',\n lineHeight: '{line-height.lg}',\n fontSize: '{font-size.2}',\n letterSpacing: '{letter-spacing.6}',\n },\n },\n },\n },\n },\n shadow: {\n xs: {\n $type: 'boxShadow',\n $value: '{shadow.100}',\n },\n sm: {\n $type: 'boxShadow',\n $value: '{shadow.200}',\n },\n md: {\n $type: 'boxShadow',\n $value: '{shadow.300}',\n },\n lg: {\n $type: 'boxShadow',\n $value: '{shadow.400}',\n },\n xl: {\n $type: 'boxShadow',\n $value: '{shadow.500}',\n },\n },\n size: {\n '0': {\n $type: 'dimension',\n $value: '{_size.0}',\n },\n '1': {\n $type: 'dimension',\n $value: '{_size.1}',\n },\n '2': {\n $type: 'dimension',\n $value: '{_size.2}',\n },\n '3': {\n $type: 'dimension',\n $value: '{_size.3}',\n },\n '4': {\n $type: 'dimension',\n $value: '{_size.4}',\n },\n '5': {\n $type: 'dimension',\n $value: '{_size.5}',\n },\n '6': {\n $type: 'dimension',\n $value: '{_size.6}',\n },\n '7': {\n $type: 'dimension',\n $value: '{_size.7}',\n },\n '8': {\n $type: 'dimension',\n $value: '{_size.8}',\n },\n '9': {\n $type: 'dimension',\n $value: '{_size.9}',\n },\n '10': {\n $type: 'dimension',\n $value: '{_size.10}',\n },\n '11': {\n $type: 'dimension',\n $value: '{_size.11}',\n },\n '12': {\n $type: 'dimension',\n $value: '{_size.12}',\n },\n '13': {\n $type: 'dimension',\n $value: '{_size.13}',\n },\n '14': {\n $type: 'dimension',\n $value: '{_size.14}',\n },\n '15': {\n $type: 'dimension',\n $value: '{_size.15}',\n },\n '18': {\n $type: 'dimension',\n $value: '{_size.18}',\n },\n '22': {\n $type: 'dimension',\n $value: '{_size.22}',\n },\n '26': {\n $type: 'dimension',\n $value: '{_size.26}',\n },\n '30': {\n $type: 'dimension',\n $value: '{_size.30}',\n },\n },\n } satisfies TokenSet;\n}\n\nfunction generateSingleTypographyToken(component: 'heading' | 'body', size: string, variant?: 'short' | 'long'): Token {\n const prefix = `typography-mapping.${component}${variant ? `.${variant}` : ''}.${size}`;\n return {\n $type: 'typography',\n $value: {\n fontFamily: `{${prefix}.font-family}`,\n fontWeight: `{${prefix}.font-weight}`,\n lineHeight: `{${prefix}.line-height}`,\n fontSize: `{${prefix}.font-size}`,\n letterSpacing: `{${prefix}.letter-spacing}`,\n },\n };\n}\n\nfunction _generateTypography() {\n const headingSizes = ['2xl', 'xl', 'lg', 'md', 'sm', 'xs', '2xs'];\n const heading = Object.fromEntries(\n headingSizes.map((size) => [size, generateSingleTypographyToken('heading', size)] as const),\n );\n const bodySizes = ['xl', 'lg', 'md', 'sm', 'xs'];\n const body = Object.fromEntries(\n bodySizes.map((size) => [size, generateSingleTypographyToken('body', size)] as const),\n );\n const bodyShort = Object.fromEntries(\n bodySizes.map((size) => [size, generateSingleTypographyToken('body', size, 'short')] as const),\n );\n const bodyLong = Object.fromEntries(\n bodySizes.map((size) => [size, generateSingleTypographyToken('body', size, 'long')] as const),\n );\n return {\n heading,\n body: {\n ...body,\n short: bodyShort,\n long: bodyLong,\n },\n };\n}\n\nconst generateColors = (colorNames: string[]) => {\n const semanticColorTokens = colorNames.map((colorName) => [colorName, generateColorScaleTokens(colorName)]);\n\n return {\n ...baseColorTemplate,\n color: {\n ...Object.fromEntries(semanticColorTokens),\n ...baseColorTemplate.color,\n },\n };\n};\n\nconst baseColorTemplate: TokenSet = {\n color: {\n focus: {\n inner: {\n $type: 'color',\n $value: '{color.focus.inner-color}',\n },\n outer: {\n $type: 'color',\n $value: '{color.focus.outer-color}',\n },\n },\n },\n link: {\n color: {\n visited: {\n $type: 'color',\n $value: '{color.link.visited}',\n },\n },\n },\n};\n\nconst generateColorScaleTokens = (colorName: string): Record<ColorNames, Token> => {\n const colorScale = {} as Record<ColorNames, Token>;\n\n for (const [colorSemantic, colorNumber] of R.toPairs(semanticColorMap)) {\n colorScale[colorSemantic] = {\n $type: 'color',\n $value: `{color.${colorName}.${colorNumber}}`,\n };\n }\n\n return colorScale;\n};\n"],"mappings":";;;AAIA,SAAgB,sBAAsB,YAAgC;CACpE,OAAO;EACL,GAAG,e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AAQ;GACV;GACA,MAAM;IACJ,OAAO;IACP,QAAQ;GACV;EACF;CACF;AACF;AAyCA,MAAM,kBAAkB,eAAyB;CAC/C,MAAM,sBAAsB,WAAW,KAAK,cAAc,CAAC,WAAW,yBAAyB,SAAS,CAAC,CAAC;CAE1G,OAAO;EACL,GAAG;EACH,OAAO;GACL,GAAG,OAAO,YAAY,mBAAmB;GACzC,GAAG,kBAAkB;EACvB;CACF;AACF;AAEA,MAAM,oBAA8B;CAClC,OAAO,EACL,OAAO;EACL,OAAO;GACL,OAAO;GACP,QAAQ;EACV;EACA,OAAO;GACL,OAAO;GACP,QAAQ;EACV;CACF,EACF;CACA,MAAM,EACJ,OAAO,EACL,SAAS;EACP,OAAO;EACP,QAAQ;CACV,EACF,EACF;AACF;AAEA,MAAM,4BAA4B,cAAiD;CACjF,MAAM,aAAa,CAAC;CAEpB,KAAK,MAAM,CAAC,eAAe,gBAAgB,EAAE,QAAQ,gBAAgB,GACnE,WAAW,iBAAiB;EAC1B,OAAO;EACP,QAAQ,UAAU,UAAU,GAAG,YAAY;CAC7C;CAGF,OAAO;AACT"}
@@ -0,0 +1,7 @@
1
+ import { TokenSet } from "../../../types.js";
2
+
3
+ //#region src/tokens/create/generators/themes/theme.d.ts
4
+ declare const generateTheme: (colorNames: string[], themeName: string, borderRadius: number) => TokenSet;
5
+ //#endregion
6
+ export { generateTheme };
7
+ //# sourceMappingURL=theme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.d.ts","names":[],"sources":["../../../../../../src/tokens/create/generators/themes/theme.ts"],"mappings":";;;cAIa,aAAA,GAAiB,UAAA,YAAsB,SAAA,UAAmB,YAAA,aAAoB,QA+C1F"}
@@ -0,0 +1,105 @@
1
+ import { semanticColorMap } from "../../../../colors/types.js";
2
+ import * as R from "ramda";
3
+ //#region src/tokens/create/generators/themes/theme.ts
4
+ const generateTheme = (colorNames, themeName, borderRadius) => {
5
+ const themeColorTokens = Object.fromEntries(colorNames.map((colorName) => [colorName, generateColorScaleTokens(colorName, themeName)]));
6
+ const { color: themeBaseFileColor, ...remainingThemeFile } = generateBase(themeName);
7
+ const themeFile = {
8
+ color: {
9
+ ...themeColorTokens,
10
+ ...themeBaseFileColor,
11
+ link: { visited: {
12
+ $type: "color",
13
+ $value: `{${themeName}.link.visited}`
14
+ } },
15
+ focus: {
16
+ "inner-color": {
17
+ $type: "color",
18
+ $value: `{${themeName}.focus.inner}`
19
+ },
20
+ "outer-color": {
21
+ $type: "color",
22
+ $value: `{${themeName}.focus.outer}`
23
+ }
24
+ }
25
+ },
26
+ ...remainingThemeFile
27
+ };
28
+ const baseBorderRadius = R.lensPath([
29
+ "border-radius",
30
+ "base",
31
+ "$value"
32
+ ]);
33
+ const updatedThemeFile = R.set(baseBorderRadius, String(borderRadius), themeFile);
34
+ return JSON.parse(JSON.stringify(updatedThemeFile, (key, value) => {
35
+ if (key === "$value") return value.replace("<theme>", themeName);
36
+ return value;
37
+ }, 2));
38
+ };
39
+ const generateBase = (themeName) => ({
40
+ color: {},
41
+ "font-family": {
42
+ $type: "fontFamilies",
43
+ $value: `{${themeName}.font-family}`
44
+ },
45
+ "font-weight": {
46
+ medium: {
47
+ $type: "fontWeights",
48
+ $value: `{${themeName}.font-weight.medium}`
49
+ },
50
+ semibold: {
51
+ $type: "fontWeights",
52
+ $value: `{${themeName}.font-weight.semibold}`
53
+ },
54
+ regular: {
55
+ $type: "fontWeights",
56
+ $value: `{${themeName}.font-weight.regular}`
57
+ }
58
+ },
59
+ "border-radius": {
60
+ "1": {
61
+ $type: "dimension",
62
+ $value: "min({border-radius.base}*0.5,{border-radius.scale})"
63
+ },
64
+ "2": {
65
+ $type: "dimension",
66
+ $value: "min({border-radius.base},{border-radius.scale}*2)"
67
+ },
68
+ "3": {
69
+ $type: "dimension",
70
+ $value: "min({border-radius.base}*2,{border-radius.scale}*5)"
71
+ },
72
+ "4": {
73
+ $type: "dimension",
74
+ $value: "min({border-radius.base}*3,{border-radius.scale}*7)"
75
+ },
76
+ "5": {
77
+ $type: "dimension",
78
+ $value: "{border-radius.base}"
79
+ },
80
+ "6": {
81
+ $type: "dimension",
82
+ $value: "9999"
83
+ },
84
+ base: {
85
+ $type: "dimension",
86
+ $value: "4"
87
+ },
88
+ scale: {
89
+ $type: "dimension",
90
+ $value: "4"
91
+ }
92
+ }
93
+ });
94
+ const generateColorScaleTokens = (colorName, themeName) => {
95
+ const colorScale = {};
96
+ for (const [_, colorNumber] of R.toPairs(semanticColorMap)) colorScale[colorNumber] = {
97
+ $type: "color",
98
+ $value: `{${themeName}.${colorName}.${colorNumber}}`
99
+ };
100
+ return colorScale;
101
+ };
102
+ //#endregion
103
+ export { generateTheme };
104
+
105
+ //# sourceMappingURL=theme.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.js","names":[],"sources":["../../../../../../src/tokens/create/generators/themes/theme.ts"],"sourcesContent":["import * as R from 'ramda';\nimport { type ColorNumber, semanticColorMap } from '../../../../colors/types.ts';\nimport type { Token, TokenSet } from '../../../types.ts';\n\nexport const generateTheme = (colorNames: string[], themeName: string, borderRadius: number) => {\n const themeColorTokens = Object.fromEntries(\n colorNames.map((colorName) => [colorName, generateColorScaleTokens(colorName, themeName)]),\n );\n\n const { color: themeBaseFileColor, ...remainingThemeFile } = generateBase(themeName);\n const themeFile = {\n color: {\n ...themeColorTokens,\n ...themeBaseFileColor,\n link: {\n visited: {\n $type: 'color',\n $value: `{${themeName}.link.visited}`,\n },\n },\n focus: {\n 'inner-color': {\n $type: 'color',\n $value: `{${themeName}.focus.inner}`,\n },\n 'outer-color': {\n $type: 'color',\n $value: `{${themeName}.focus.outer}`,\n },\n },\n },\n ...remainingThemeFile,\n };\n\n const baseBorderRadius = R.lensPath(['border-radius', 'base', '$value']);\n const updatedThemeFile = R.set(baseBorderRadius, String(borderRadius), themeFile);\n const token = JSON.parse(\n JSON.stringify(\n updatedThemeFile,\n (key, value) => {\n if (key === '$value') {\n return (value as string).replace('<theme>', themeName);\n }\n\n return value;\n },\n 2,\n ),\n ) as TokenSet;\n\n return token;\n};\n\nconst generateBase = (themeName: string): TokenSet => ({\n color: {},\n 'font-family': {\n $type: 'fontFamilies',\n $value: `{${themeName}.font-family}`,\n },\n 'font-weight': {\n medium: {\n $type: 'fontWeights',\n $value: `{${themeName}.font-weight.medium}`,\n },\n semibold: {\n $type: 'fontWeights',\n $value: `{${themeName}.font-weight.semibold}`,\n },\n regular: {\n $type: 'fontWeights',\n $value: `{${themeName}.font-weight.regular}`,\n },\n },\n 'border-radius': {\n '1': {\n $type: 'dimension',\n $value: 'min({border-radius.base}*0.5,{border-radius.scale})',\n },\n '2': {\n $type: 'dimension',\n $value: 'min({border-radius.base},{border-radius.scale}*2)',\n },\n '3': {\n $type: 'dimension',\n $value: 'min({border-radius.base}*2,{border-radius.scale}*5)',\n },\n '4': {\n $type: 'dimension',\n $value: 'min({border-radius.base}*3,{border-radius.scale}*7)',\n },\n '5': {\n $type: 'dimension',\n $value: '{border-radius.base}',\n },\n '6': {\n $type: 'dimension',\n $value: '9999',\n },\n base: {\n $type: 'dimension',\n $value: '4',\n },\n scale: {\n $type: 'dimension',\n $value: '4',\n },\n },\n});\n\nconst generateColorScaleTokens = (colorName: string, themeName: string): Record<ColorNumber, Token> => {\n const colorScale = {} as Record<ColorNumber, Token>;\n\n for (const [_, colorNumber] of R.toPairs(semanticColorMap)) {\n colorScale[colorNumber] = {\n $type: 'color',\n $value: `{${themeName}.${colorName}.${colorNumber}}`,\n };\n }\n\n return colorScale;\n};\n"],"mappings":";;;AAIA,MAAa,iBAAiB,YAAsB,WAAmB,iBAAyB;CAC9F,MAAM,mBAAmB,OAAO,YAC9B,WAAW,KAAK,cAAc,CAAC,WAAW,yBAAyB,WAAW,SAAS,CAAC,CAAC,CAC3F;CAEA,MAAM,EAAE,OAAO,oBAAoB,GAAG,uBAAuB,aAAa,SAAS;CACnF,MAAM,YAAY;EAChB,OAAO;GACL,GAAG;GACH,GAAG;GACH,MAAM,EACJ,SAAS;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I,UAAU,GAAG,UAAU,GAAG,YAAY;CACpD;CAGF,OAAO;AACT"}
@@ -0,0 +1,10 @@
1
+ import { Theme, TokenSetDimensions, TokenSets } from "./types.js";
2
+
3
+ //#region src/tokens/create.d.ts
4
+ declare const tokenSetDimensions: TokenSetDimensions;
5
+ declare const createTokens: (theme: Theme) => Promise<{
6
+ tokenSets: TokenSets;
7
+ }>;
8
+ //#endregion
9
+ export { createTokens, tokenSetDimensions };
10
+ //# sourceMappingURL=create.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.d.ts","names":[],"sources":["../../../src/tokens/create.ts"],"mappings":";;;cAUa,kBAAA,EAAoB,kBAGhC;AAAA,cAEY,YAAA,GAAsB,KAAA,EAAO,KAAA,KAAK,OAAA"}
@@ -0,0 +1,40 @@
1
+ import { addSeverityColors, toColorNames } from "./utils.js";
2
+ import { generateColorScheme } from "./create/generators/primitives/color-scheme.js";
3
+ import { generateGlobals } from "./create/generators/primitives/globals.js";
4
+ import { generateSize, generateSizeGlobal } from "./create/generators/primitives/size.js";
5
+ import { generateFontSizes, generateTypography } from "./create/generators/primitives/typography.js";
6
+ import { generateColorTokens } from "./create/generators/semantic/color.js";
7
+ import { generateSemanticStyle } from "./create/generators/semantic/style.js";
8
+ import { generateTheme } from "./create/generators/themes/theme.js";
9
+ //#region src/tokens/create.ts
10
+ const tokenSetDimensions = {
11
+ colorSchemes: ["dark", "light"],
12
+ sizeModes: [
13
+ "small",
14
+ "medium",
15
+ "large"
16
+ ]
17
+ };
18
+ const createTokens = async (theme) => {
19
+ const { typography, name, borderRadius, overrides } = theme;
20
+ const { colorSchemes, sizeModes } = tokenSetDimensions;
21
+ const colors = addSeverityColors(theme.colors);
22
+ const colorNames = toColorNames(colors);
23
+ const colorTokens = Object.entries(generateColorTokens(colorNames, name));
24
+ return { tokenSets: new Map([
25
+ ["primitives/globals", generateGlobals()],
26
+ ...sizeModes.map((size) => [`primitives/modes/size/${size}`, generateSize(size)]),
27
+ ["primitives/modes/size/global", generateSizeGlobal()],
28
+ ...sizeModes.map((size) => [`primitives/modes/typography/size/${size}`, generateFontSizes(size)]),
29
+ [`primitives/modes/typography/primary/${name}`, generateTypography(name, typography)],
30
+ [`primitives/modes/typography/secondary/${name}`, generateTypography(name, typography)],
31
+ ...colorSchemes.flatMap((scheme) => [[`primitives/modes/color-scheme/${scheme}/${name}`, generateColorScheme(name, scheme, colors, overrides)]]),
32
+ [`themes/${name}`, generateTheme(colorNames, name, borderRadius)],
33
+ ...colorTokens.map(([colorName, colorSetTokens]) => [`semantic/color/${colorName}`, colorSetTokens]),
34
+ [`semantic/style`, generateSemanticStyle(colorNames)]
35
+ ]) };
36
+ };
37
+ //#endregion
38
+ export { createTokens, tokenSetDimensions };
39
+
40
+ //# sourceMappingURL=create.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.js","names":[],"sources":["../../../src/tokens/create.ts"],"sourcesContent":["import { generateColorScheme } from './create/generators/primitives/color-scheme.ts';\nimport { generateGlobals } from './create/generators/primitives/globals.ts';\nimport { generateSize, generateSizeGlobal } from './create/generators/primitives/size.ts';\nimport { generateFontSizes, generateTypography } from './create/generators/primitives/typography.ts';\nimport { generateColorTokens } from './create/generators/semantic/color.ts';\nimport { generateSemanticStyle } from './create/generators/semantic/style.ts';\nimport { generateTheme } from './create/generators/themes/theme.ts';\nimport type { Theme, TokenSet, TokenSetDimensions, TokenSets } from './types.ts';\nimport { addSeverityColors, toColorNames } from './utils.ts';\n\nexport const tokenSetDimensions: TokenSetDimensions = {\n colorSchemes: ['dark', 'light'],\n sizeModes: ['small', 'medium', 'large'],\n};\n\nexport const createTokens = async (theme: Theme) => {\n const { typography, name, borderRadius, overrides } = theme;\n const { colorSchemes, sizeModes } = tokenSetDimensions;\n\n const colors = addSeverityColors(theme.colors);\n const colorNames = toColorNames(colors);\n const colorTokens = Object.entries(generateColorTokens(colorNames, name));\n\n const tokenSets: TokenSets = new Map([\n ['primitives/globals', generateGlobals()],\n ...sizeModes.map((size): [string, TokenSet] => [`primitives/modes/size/${size}`, generateSize(size)]),\n ['primitives/modes/size/global', generateSizeGlobal()],\n ...sizeModes.map((size): [string, TokenSet] => [\n `primitives/modes/typography/size/${size}`,\n generateFontSizes(size),\n ]),\n [`primitives/modes/typography/primary/${name}`, generateTypography(name, typography)],\n [`primitives/modes/typography/secondary/${name}`, generateTypography(name, typography)],\n ...colorSchemes.flatMap((scheme): [string, TokenSet][] => [\n [`primitives/modes/color-scheme/${scheme}/${name}`, generateColorScheme(name, scheme, colors, overrides)],\n ]),\n [`themes/${name}`, generateTheme(colorNames, name, borderRadius)],\n ...colorTokens.map(([colorName, colorSetTokens]): [string, TokenSet] => [\n `semantic/color/${colorName}`,\n colorSetTokens,\n ]),\n [`semantic/style`, generateSemanticStyle(colorNames)],\n ]);\n\n return { tokenSets };\n};\n"],"mappings":";;;;;;;;;AAUA,MAAa,qBAAyC;CACpD,cAAc,CAAC,QAAQ,OAAO;CAC9B,WAAW;EAAC;EAAS;EAAU;CAAO;AACxC;AAEA,MAAa,eAAe,OAAO,UAAiB;CAClD,MAAM,EAAE,YAAY,MAAM,cAAc,cAAc;CACtD,MAAM,EAAE,cAAc,cAAc;CAEpC,MAAM,SAAS,kBAAkB,MAAM,MAAM;CAC7C,MAAM,aAAa,aAAa,MAAM;CACtC,MAAM,cAAc,OAAO,QAAQ,oBAAoB,YAAY,IAAI,CAAC;CAuBxE,OAAO,EAAE,WAAA,IArBwB,IAAI;EACnC,CAAC,sBAAsB,gBAAgB,CAAC;EACxC,GAAG,UAAU,KAAK,SAA6B,CAAC,yBAAyB,QAAQ,aAAa,IAAI,CAAC,CAAC;EACpG,CAAC,gCAAgC,mBAAmB,CAAC;EACrD,GAAG,UAAU,KAAK,SAA6B,CAC7C,oCAAoC,QACpC,kBAAkB,IAAI,CACxB,CAAC;EACD,CAAC,uCAAuC,QAAQ,mBAAmB,MAAM,UAAU,CAAC;EACpF,CAAC,yCAAyC,QAAQ,mBAAmB,MAAM,UAAU,CAAC;EACtF,GAAG,aAAa,SAAS,WAAiC,CACxD,CAAC,iCAAiC,OAAO,GAAG,QAAQ,oBAAoB,MAAM,QAAQ,QAAQ,SAAS,CAAC,CAC1G,CAAC;EACD,CAAC,UAAU,QAAQ,cAAc,YAAY,MAAM,YAAY,CAAC;EAChE,GAAG,YAAY,KAAK,CAAC,WAAW,oBAAwC,CACtE,kBAAkB,aAClB,cACF,CAAC;EACD,CAAC,kBAAkB,sBAAsB,UAAU,CAAC;CACtD,CAEiB,EAAE;AACrB"}
@@ -0,0 +1,19 @@
1
+ import { Theme } from "./types.js";
2
+ import { FormatOptions, ProcessReturn } from "./process/platform.js";
3
+
4
+ //#region src/tokens/format.d.ts
5
+ declare const formatTokens: (options: Omit<FormatOptions, "type" | "buildTokenFormats">) => Promise<ProcessReturn>;
6
+ declare const formatTheme: (themeConfig: Theme) => Promise<ProcessReturn>;
7
+ /**
8
+ * Formats a theme configuration into CSS.
9
+ *
10
+ * This function takes a `Theme` configuration object, processes it using the
11
+ * `formatTheme` function, and then generates CSS using the `createThemeCSS` function.
12
+ *
13
+ * @param themeConfig - The theme configuration object to be formatted.
14
+ * @returns A promise that resolves to the generated CSS string.
15
+ */
16
+ declare const formatThemeCSS: (themeConfig: Theme) => Promise<string>;
17
+ //#endregion
18
+ export { formatTheme, formatThemeCSS, formatTokens };
19
+ //# sourceMappingURL=format.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format.d.ts","names":[],"sources":["../../../src/tokens/format.ts"],"mappings":";;;;cASa,YAAA,GAAsB,OAAA,EAAS,IAAA,CAAK,aAAA,oCAA4C,OAAA,CAA7C,aAAA;AAAA,cAUnC,WAAA,GAAqB,WAAA,EAAa,KAAA,KAAK,OAAA,CAAA,aAAA;AAVpD;;;;;;;;;AAAA,cAqCa,cAAA,GAAwB,WAAA,EAAa,KAAA,KAAK,OAAA"}
@@ -0,0 +1,42 @@
1
+ import { toColorNames } from "./utils.js";
2
+ import { processPlatform } from "./process/platform.js";
3
+ import { processThemeObject } from "./process/utils/getMultidimensionalThemes.js";
4
+ import { createThemeCSSFiles } from "./process/output/theme.js";
5
+ import { generate$Themes } from "./create/generators/$themes.js";
6
+ import { createTokens, tokenSetDimensions } from "./create.js";
7
+ import * as R from "ramda";
8
+ //#region src/tokens/format.ts
9
+ const formatTokens = async (options) => {
10
+ return await processPlatform({
11
+ type: "format",
12
+ buildTokenFormats: {},
13
+ ...options
14
+ });
15
+ };
16
+ const formatTheme = async (themeConfig) => {
17
+ const themeNames = [themeConfig.name];
18
+ const colorNames = toColorNames(themeConfig.colors);
19
+ const { tokenSets } = await createTokens(themeConfig);
20
+ return await formatTokens({
21
+ tokenSets,
22
+ processed$themes: (await generate$Themes(tokenSetDimensions, themeNames, colorNames)).map(processThemeObject),
23
+ verbose: false
24
+ });
25
+ };
26
+ /**
27
+ * Formats a theme configuration into CSS.
28
+ *
29
+ * This function takes a `Theme` configuration object, processes it using the
30
+ * `formatTheme` function, and then generates CSS using the `createThemeCSS` function.
31
+ *
32
+ * @param themeConfig - The theme configuration object to be formatted.
33
+ * @returns A promise that resolves to the generated CSS string.
34
+ */
35
+ const formatThemeCSS = async (themeConfig) => {
36
+ const themeCSSFiles = createThemeCSSFiles({ processedBuilds: await formatTheme(themeConfig) });
37
+ return R.head(themeCSSFiles)?.output ?? "";
38
+ };
39
+ //#endregion
40
+ export { formatTheme, formatThemeCSS, formatTokens };
41
+
42
+ //# sourceMappingURL=format.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format.js","names":[],"sources":["../../../src/tokens/format.ts"],"sourcesContent":["import * as R from 'ramda';\nimport { generate$Themes } from './create/generators/$themes.ts';\nimport { createTokens, tokenSetDimensions } from './create.ts';\nimport { createThemeCSSFiles } from './process/output/theme.ts';\nimport { type FormatOptions, processPlatform } from './process/platform.ts';\nimport { processThemeObject } from './process/utils/getMultidimensionalThemes.ts';\nimport type { Theme } from './types.ts';\nimport { toColorNames } from './utils.ts';\n\nexport const formatTokens = async (options: Omit<FormatOptions, 'type' | 'buildTokenFormats'>) => {\n const processedBuilds = await processPlatform({\n type: 'format',\n buildTokenFormats: {},\n ...options,\n });\n\n return processedBuilds;\n};\n\nexport const formatTheme = async (themeConfig: Theme) => {\n const themeNames = [themeConfig.name];\n const colorNames = toColorNames(themeConfig.colors);\n\n const { tokenSets } = await createTokens(themeConfig);\n const $themes = await generate$Themes(tokenSetDimensions, themeNames, colorNames);\n\n const processed$themes = $themes.map(processThemeObject);\n\n const processedBuilds = await formatTokens({\n tokenSets,\n processed$themes,\n verbose: false,\n });\n\n return processedBuilds;\n};\n\n/**\n * Formats a theme configuration into CSS.\n *\n * This function takes a `Theme` configuration object, processes it using the\n * `formatTheme` function, and then generates CSS using the `createThemeCSS` function.\n *\n * @param themeConfig - The theme configuration object to be formatted.\n * @returns A promise that resolves to the generated CSS string.\n */\nexport const formatThemeCSS = async (themeConfig: Theme) => {\n const processedBuilds = await formatTheme(themeConfig);\n const themeCSSFiles = createThemeCSSFiles({ processedBuilds });\n return R.head(themeCSSFiles)?.output ?? '';\n};\n"],"mappings":";;;;;;;;AASA,MAAa,eAAe,OAAO,YAA+D;CAOhG,OAAO,MANuB,gBAAgB;EAC5C,MAAM;EACN,mBAAmB,CAAC;EACpB,GAAG;CACL,CAAC;AAGH;AAEA,MAAa,cAAc,OAAO,gBAAuB;CACvD,MAAM,aAAa,CAAC,YAAY,IAAI;CACpC,MAAM,aAAa,aAAa,YAAY,MAAM;CAElD,MAAM,EAAE,cAAc,MAAM,aAAa,WAAW;CAWpD,OAAO,MANuB,aAAa;EACzC;EACA,mBAJuB,MAFH,gBAAgB,oBAAoB,YAAY,UAAU,EAAA,CAE/C,IAAI,kBAIpB;EACf,SAAS;CACX,CAAC;AAGH;;;;;;;;;;AAWA,MAAa,iBAAiB,OAAO,gBAAuB;CAE1D,MAAM,gBAAgB,oBAAoB,EAAE,iBAAA,MADd,YAAY,WAAW,EACO,CAAC;CAC7D,OAAO,EAAE,KAAK,aAAa,CAAC,EAAE,UAAU;AAC1C"}
@@ -0,0 +1,14 @@
1
+ import { CreateConfigSchema } from "../schemas/v1.1/schema.js";
2
+
3
+ //#region src/tokens/generate-config.d.ts
4
+ type GenerateConfigOptions = {
5
+ tokensDir: string;
6
+ outFile?: string;
7
+ };
8
+ /**
9
+ * Generates a config file from existing design tokens
10
+ */
11
+ declare function generateConfigFromTokens(options: GenerateConfigOptions): Promise<CreateConfigSchema>;
12
+ //#endregion
13
+ export { generateConfigFromTokens };
14
+ //# sourceMappingURL=generate-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-config.d.ts","names":[],"sources":["../../../src/tokens/generate-config.ts"],"mappings":";;;KA6LK,qBAAA;EACH,SAAA;EACA,OAAO;AAAA;;;AAAA;iBAMa,wBAAA,CAAyB,OAAA,EAAS,qBAAA,GAAwB,OAAA,CAAQ,kBAAA"}
@@ -0,0 +1,154 @@
1
+ import { dsfs } from "../utils/filesystem.js";
2
+ import pc from "picocolors";
3
+ import path from "node:path";
4
+ //#region src/tokens/generate-config.ts
5
+ /**
6
+ * Reads a JSON file and returns its content as an object
7
+ */
8
+ async function readJsonFile(filePath) {
9
+ try {
10
+ const content = await dsfs.readFile(filePath);
11
+ return JSON.parse(content);
12
+ } catch (err) {
13
+ throw new Error(`Failed to read token file at ${filePath}: ${err instanceof Error ? err.message : String(err)}`);
14
+ }
15
+ }
16
+ /**
17
+ * Extract the base hex color from a color scale (color.12)
18
+ */
19
+ function extractBaseColor(colorScale) {
20
+ if ("12" in colorScale && typeof colorScale["12"] === "object" && "$value" in colorScale["12"]) {
21
+ const token = colorScale["12"];
22
+ if (token.$type === "color") return token.$value;
23
+ }
24
+ return null;
25
+ }
26
+ /**
27
+ * Discovers theme names from the primitives/modes/color-scheme/light/
28
+ */
29
+ async function discoverThemes(tokensDir) {
30
+ const lightModePath = path.join(tokensDir, "themes");
31
+ try {
32
+ return (await dsfs.readdir(lightModePath)).filter((file) => file.endsWith(".json")).map((file) => file.replace(".json", ""));
33
+ } catch {
34
+ throw new Error(`Could not find themes. Make sure ${pc.blue(lightModePath)} exists and contains theme JSON files.`);
35
+ }
36
+ }
37
+ /**
38
+ * Reads token information for a specific theme from primitives/modes/color-scheme/light/<theme>.json
39
+ */
40
+ async function readThemeTokens(tokensDir, themeName) {
41
+ return readJsonFile(path.join(tokensDir, "primitives", "modes", "color-scheme", "light", `${themeName}.json`));
42
+ }
43
+ /**
44
+ * Reads the theme configuration from themes/<theme>.json
45
+ */
46
+ async function readThemeConfig(tokensDir, themeName) {
47
+ const themeConfigPath = path.join(tokensDir, "themes", `${themeName}.json`);
48
+ try {
49
+ return await readJsonFile(themeConfigPath);
50
+ } catch {
51
+ return null;
52
+ }
53
+ }
54
+ /**
55
+ * Extract border-radius base value from theme config
56
+ */
57
+ function extractBorderRadius(themeConfig) {
58
+ if (!themeConfig || !("border-radius" in themeConfig)) return;
59
+ const borderRadius = themeConfig["border-radius"];
60
+ if ("base" in borderRadius && typeof borderRadius.base === "object" && "$value" in borderRadius.base) {
61
+ const token = borderRadius.base;
62
+ return Number(token.$value);
63
+ }
64
+ }
65
+ /**
66
+ * Extract font family from theme config
67
+ */
68
+ function extractFontFamily(themeConfig) {
69
+ if (!themeConfig || !("font-family" in themeConfig)) return;
70
+ const fontFamily = themeConfig["font-family"];
71
+ if (typeof fontFamily === "object" && "$value" in fontFamily) {
72
+ const value = fontFamily.$value;
73
+ if (value.startsWith("{") && value.endsWith("}")) return;
74
+ return value;
75
+ }
76
+ }
77
+ /**
78
+ * Reads the typography configuration from primitives/modes/typography/primary/<theme>.json
79
+ */
80
+ async function readTypographyConfig(tokensDir, themeName) {
81
+ const typographyConfigPath = path.join(tokensDir, "primitives", "modes", "typography", "primary", `${themeName}.json`);
82
+ try {
83
+ return await readJsonFile(typographyConfigPath);
84
+ } catch {
85
+ return null;
86
+ }
87
+ }
88
+ /**
89
+ * Extract font family from typography primitives
90
+ */
91
+ function extractFontFamilyFromPrimitives(typographyConfig, themeName) {
92
+ if (!typographyConfig) return;
93
+ const themeTypography = typographyConfig[themeName];
94
+ if (!themeTypography || !("font-family" in themeTypography)) return;
95
+ const fontFamily = themeTypography["font-family"];
96
+ if (typeof fontFamily === "object" && "$value" in fontFamily) return fontFamily.$value;
97
+ }
98
+ /**
99
+ * Extracts colors from the theme tokens, excluding reserved colors and extracting base colors from color scales.
100
+ */
101
+ function extractColors(themeTokens, themeName) {
102
+ const colors = {};
103
+ const specialKeys = ["link"];
104
+ const themeColors = themeTokens[themeName];
105
+ if (!themeColors) return colors;
106
+ for (const [colorName, colorValue] of Object.entries(themeColors)) {
107
+ if (specialKeys.includes(colorName)) continue;
108
+ if (typeof colorValue === "object" && !("$value" in colorValue)) {
109
+ const baseColor = extractBaseColor(colorValue);
110
+ if (baseColor) colors[colorName] = baseColor;
111
+ }
112
+ }
113
+ return colors;
114
+ }
115
+ /**
116
+ * Generates a config file from existing design tokens
117
+ */
118
+ async function generateConfigFromTokens(options) {
119
+ const { tokensDir } = options;
120
+ console.log(`\nReading tokens from ${pc.blue(tokensDir)}`);
121
+ const themes = await discoverThemes(tokensDir);
122
+ if (themes.length === 0) throw new Error(`\nNo themes found in ${pc.blue(tokensDir)}`);
123
+ console.log(`\nFound ${pc.green(String(themes.length))} theme(s): ${themes.map((t) => pc.cyan(t)).join(", ")}`);
124
+ const config = {
125
+ outDir: tokensDir,
126
+ themes: {}
127
+ };
128
+ for (const themeName of themes) {
129
+ console.log(`\nProcessing theme ${pc.cyan(themeName)}...`);
130
+ const themeTokens = await readThemeTokens(tokensDir, themeName);
131
+ const themeConfig = await readThemeConfig(tokensDir, themeName);
132
+ const typographyConfig = await readTypographyConfig(tokensDir, themeName);
133
+ const colors = extractColors(themeTokens, themeName);
134
+ if (!colors.neutral) {
135
+ console.warn(pc.yellow(`\nWarning: No neutral color found for theme ${themeName}`));
136
+ continue;
137
+ }
138
+ const borderRadius = extractBorderRadius(themeConfig);
139
+ const fontFamily = extractFontFamily(themeConfig) ?? extractFontFamilyFromPrimitives(typographyConfig, themeName);
140
+ config.themes[themeName] = {
141
+ colors,
142
+ borderRadius,
143
+ typography: fontFamily ? { fontFamily } : void 0
144
+ };
145
+ console.log(`\n✅ Colors: ${Object.keys(colors).map((c) => pc.cyan(c)).join(", ") || pc.dim("none")}`);
146
+ if (borderRadius !== void 0) console.log(`\n✅ Border radius: ${pc.cyan(String(borderRadius))}`);
147
+ if (fontFamily) console.log(`\n✅ Font family: ${pc.cyan(fontFamily)}`);
148
+ }
149
+ return config;
150
+ }
151
+ //#endregion
152
+ export { generateConfigFromTokens };
153
+
154
+ //# sourceMappingURL=generate-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-config.js","names":["token"],"sources":["../../../src/tokens/generate-config.ts"],"sourcesContent":["import path from 'node:path';\nimport pc from 'picocolors';\nimport type { CssColor } from '../colors/types.ts';\nimport type { CreateConfigSchema } from '../schemas/v1.1/schema.ts';\nimport { dsfs } from '../utils/filesystem.ts';\n\ntype TokenValue = {\n $type: string;\n $value: string;\n};\n\ntype TokenObject = {\n [key: string]: TokenValue | TokenObject;\n};\n\n/**\n * Reads a JSON file and returns its content as an object\n */\nasync function readJsonFile(filePath: string): Promise<TokenObject> {\n try {\n const content = await dsfs.readFile(filePath);\n return JSON.parse(content) as TokenObject;\n } catch (err) {\n throw new Error(`Failed to read token file at ${filePath}: ${err instanceof Error ? err.message : String(err)}`);\n }\n}\n\n/**\n * Extract the base hex color from a color scale (color.12)\n */\nfunction extractBaseColor(colorScale: TokenObject): string | null {\n if ('12' in colorScale && typeof colorScale['12'] === 'object' && '$value' in colorScale['12']) {\n const token = colorScale['12'] as TokenValue;\n if (token.$type === 'color') {\n return token.$value;\n }\n }\n return null;\n}\n\n/**\n * Discovers theme names from the primitives/modes/color-scheme/light/\n */\nasync function discoverThemes(tokensDir: string): Promise<string[]> {\n const lightModePath = path.join(tokensDir, 'themes');\n\n try {\n const files = await dsfs.readdir(lightModePath);\n const themes = files.filter((file) => file.endsWith('.json')).map((file) => file.replace('.json', ''));\n\n return themes;\n } catch {\n throw new Error(`Could not find themes. Make sure ${pc.blue(lightModePath)} exists and contains theme JSON files.`);\n }\n}\n\n/**\n * Reads token information for a specific theme from primitives/modes/color-scheme/light/<theme>.json\n */\nasync function readThemeTokens(tokensDir: string, themeName: string): Promise<TokenObject> {\n const themePath = path.join(tokensDir, 'primitives', 'modes', 'color-scheme', 'light', `${themeName}.json`);\n return readJsonFile(themePath);\n}\n\n/**\n * Reads the theme configuration from themes/<theme>.json\n */\nasync function readThemeConfig(tokensDir: string, themeName: string): Promise<TokenObject | null> {\n const themeConfigPath = path.join(tokensDir, 'themes', `${themeName}.json`);\n\n try {\n return await readJsonFile(themeConfigPath);\n } catch {\n return null;\n }\n}\n\n/**\n * Extract border-radius base value from theme config\n */\nfunction extractBorderRadius(themeConfig: TokenObject | null): number | undefined {\n if (!themeConfig || !('border-radius' in themeConfig)) {\n return undefined;\n }\n\n const borderRadius = themeConfig['border-radius'] as TokenObject;\n if ('base' in borderRadius && typeof borderRadius.base === 'object' && '$value' in borderRadius.base) {\n const token = borderRadius.base as TokenValue;\n return Number(token.$value);\n }\n\n return undefined;\n}\n\n/**\n * Extract font family from theme config\n */\nfunction extractFontFamily(themeConfig: TokenObject | null): string | undefined {\n if (!themeConfig || !('font-family' in themeConfig)) {\n return undefined;\n }\n\n const fontFamily = themeConfig['font-family'];\n if (typeof fontFamily === 'object' && '$value' in fontFamily) {\n const token = fontFamily as TokenValue;\n const value = token.$value;\n\n if (value.startsWith('{') && value.endsWith('}')) {\n return undefined;\n }\n return value;\n }\n\n return undefined;\n}\n\n/**\n * Reads the typography configuration from primitives/modes/typography/primary/<theme>.json\n */\nasync function readTypographyConfig(tokensDir: string, themeName: string): Promise<TokenObject | null> {\n const typographyConfigPath = path.join(\n tokensDir,\n 'primitives',\n 'modes',\n 'typography',\n 'primary',\n `${themeName}.json`,\n );\n\n try {\n return await readJsonFile(typographyConfigPath);\n } catch {\n return null;\n }\n}\n\n/**\n * Extract font family from typography primitives\n */\nfunction extractFontFamilyFromPrimitives(typographyConfig: TokenObject | null, themeName: string): string | undefined {\n if (!typographyConfig) {\n return undefined;\n }\n\n const themeTypography = typographyConfig[themeName] as TokenObject | undefined;\n if (!themeTypography || !('font-family' in themeTypography)) {\n return undefined;\n }\n\n const fontFamily = themeTypography['font-family'];\n if (typeof fontFamily === 'object' && '$value' in fontFamily) {\n const token = fontFamily as TokenValue;\n return token.$value;\n }\n\n return undefined;\n}\n\n/**\n * Extracts colors from the theme tokens, excluding reserved colors and extracting base colors from color scales.\n */\nfunction extractColors(themeTokens: TokenObject, themeName: string): Record<string, CssColor> {\n const colors: Record<string, CssColor> = {};\n\n // Reserved colors\n const specialKeys = ['link'];\n\n const themeColors = themeTokens[themeName] as TokenObject | undefined;\n if (!themeColors) {\n return colors;\n }\n\n for (const [colorName, colorValue] of Object.entries(themeColors)) {\n if (specialKeys.includes(colorName)) {\n continue;\n }\n\n if (typeof colorValue === 'object' && !('$value' in colorValue)) {\n const baseColor = extractBaseColor(colorValue as TokenObject);\n\n if (baseColor) {\n colors[colorName] = baseColor as CssColor;\n }\n }\n }\n\n return colors;\n}\n\ntype GenerateConfigOptions = {\n tokensDir: string;\n outFile?: string;\n};\n\n/**\n * Generates a config file from existing design tokens\n */\nexport async function generateConfigFromTokens(options: GenerateConfigOptions): Promise<CreateConfigSchema> {\n const { tokensDir } = options;\n\n console.log(`\\nReading tokens from ${pc.blue(tokensDir)}`);\n\n // Discover themes\n const themes = await discoverThemes(tokensDir);\n\n if (themes.length === 0) {\n throw new Error(`\\nNo themes found in ${pc.blue(tokensDir)}`);\n }\n\n console.log(`\\nFound ${pc.green(String(themes.length))} theme(s): ${themes.map((t) => pc.cyan(t)).join(', ')}`);\n\n // Generate config for each theme\n const config: CreateConfigSchema = {\n outDir: tokensDir,\n themes: {},\n };\n\n for (const themeName of themes) {\n console.log(`\\nProcessing theme ${pc.cyan(themeName)}...`);\n\n // Read theme tokens\n const themeTokens = await readThemeTokens(tokensDir, themeName);\n const themeConfig = await readThemeConfig(tokensDir, themeName);\n const typographyConfig = await readTypographyConfig(tokensDir, themeName);\n\n // Extract colors\n const colors = extractColors(themeTokens, themeName);\n\n if (!colors.neutral) {\n console.warn(pc.yellow(`\\nWarning: No neutral color found for theme ${themeName}`));\n continue; // Skip this theme as neutral is required\n }\n\n const borderRadius = extractBorderRadius(themeConfig);\n const fontFamily = extractFontFamily(themeConfig) ?? extractFontFamilyFromPrimitives(typographyConfig, themeName);\n\n config.themes[themeName] = {\n colors,\n borderRadius,\n typography: fontFamily ? { fontFamily } : undefined,\n };\n\n console.log(\n `\\n✅ Colors: ${\n Object.keys(colors)\n .map((c) => pc.cyan(c))\n .join(', ') || pc.dim('none')\n }`,\n );\n\n if (borderRadius !== undefined) {\n console.log(`\\n✅ Border radius: ${pc.cyan(String(borderRadius))}`);\n }\n if (fontFamily) {\n console.log(`\\n✅ Font family: ${pc.cyan(fontFamily)}`);\n }\n }\n\n return config;\n}\n"],"mappings":";;;;;;;AAkBA,eAAe,aAAa,UAAwC;CAClE,IAAI;EACF,MAAM,UAAU,MAAM,KAAK,SAAS,QAAQ;EAC5C,OAAO,KAAK,MAAM,OAAO;CAC3B,SAAS,KAAK;EACZ,MAAM,IAAI,MAAM,gCAAgC,SAAS,IAAI,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG,GAAG;CACjH;AACF;;;;AAKA,SAAS,iBAAiB,YAAwC;CAChE,IAAI,QAAQ,cAAc,OAAO,WAAW,UAAU,YAAY,YAAY,WAAW,OAAO;EAC9F,MAAM,QAAQ,WAAW;EACzB,IAAI,MAAM,UAAU,SAClB,OAAO,MAAM;CAEjB;CACA,OAAO;AACT;;;;AAKA,eAAe,eAAe,WAAsC;CAClE,MAAM,gBAAgB,KAAK,KAAK,WAAW,QAAQ;CAEnD,IAAI;EAIF,QAFe,MADK,KAAK,QAAQ,aAAa,EAAA,CACzB,QAAQ,SAAS,KAAK,SAAS,OAAO,CAAC,CAA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AAC,OAAO,SAAS;GACnB,QAAQ,KAAK,GAAG,OAAO,+CAA+C,WAAW,CAAC;GAClF;EACF;EAEA,MAAM,eAAe,oBAAoB,WAAW;EACpD,MAAM,aAAa,kBAAkB,WAAW,KAAK,gCAAgC,kBAAkB,SAAS;EAEhH,OAAO,OAAO,aAAa;GACzB;GACA;GACA,YAAY,aAAa,EAAE,WAAW,IAAI,KAAA;EAC5C;EAEA,QAAQ,IACN,eACE,OAAO,KAAK,MAAM,CAAC,CAChB,KAAK,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,CACtB,KAAK,IAAI,KAAK,GAAG,IAAI,MAAM,GAElC;EAEA,IAAI,iBAAiB,KAAA,GACnB,QAAQ,IAAI,sBAAsB,GAAG,KAAK,OAAO,YAAY,CAAC,GAAG;EAEnE,IAAI,YACF,QAAQ,IAAI,oBAAoB,GAAG,KAAK,UAAU,GAAG;CAEzD;CAEA,OAAO;AACT"}
@@ -0,0 +1,5 @@
1
+ import { deprecatedCLIOptions } from "../schemas/helpers.js";
2
+ import { Theme } from "./types.js";
3
+ import { createTokens } from "./create.js";
4
+ import { formatThemeCSS, formatTokens } from "./format.js";
5
+ export { type Theme as CreateTokensOptions, deprecatedCLIOptions as cliOptions, createTokens, formatThemeCSS, formatTokens };
@@ -0,0 +1,4 @@
1
+ import { deprecatedCLIOptions } from "../schemas/helpers.js";
2
+ import { createTokens } from "./create.js";
3
+ import { formatThemeCSS, formatTokens } from "./format.js";
4
+ export { deprecatedCLIOptions as cliOptions, createTokens, formatThemeCSS, formatTokens };
@@ -0,0 +1,8 @@
1
+ import { GetStyleDictionaryConfig } from "./shared.js";
2
+
3
+ //#region src/tokens/process/configs/color.d.ts
4
+ declare const colorSchemeVariables: GetStyleDictionaryConfig;
5
+ declare const colorVariables: GetStyleDictionaryConfig;
6
+ //#endregion
7
+ export { colorSchemeVariables, colorVariables };
8
+ //# sourceMappingURL=color.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color.d.ts","names":[],"sources":["../../../../../src/tokens/process/configs/color.ts"],"mappings":";;;cAOa,oBAAA,EAAsB,wBA8BlC;AAAA,cAEY,cAAA,EAAgB,wBAqC5B"}
@@ -0,0 +1,50 @@
1
+ import { isSemanticColorToken, pathStartsWithOneOf } from "../../utils.js";
2
+ import { dsTransformers } from "./shared.js";
3
+ import { formats } from "../formats/css.js";
4
+ import { buildOptions } from "../platform.js";
5
+ //#region src/tokens/process/configs/color.ts
6
+ const colorSchemeVariables = ({ "color-scheme": colorScheme = "light", theme }) => {
7
+ return {
8
+ preprocessors: ["tokens-studio"],
9
+ platforms: { css: {
10
+ colorScheme,
11
+ theme,
12
+ selector: `${colorScheme === "light" ? ":root, " : ""}[data-color-scheme="${colorScheme}"]`,
13
+ layer: `ds.theme.color-scheme.${colorScheme}`,
14
+ prefix: "ds",
15
+ buildPath: `${theme}/`,
16
+ transforms: dsTransformers,
17
+ files: [{
18
+ destination: `color-scheme/${colorScheme}.css`,
19
+ format: formats.colorScheme.name,
20
+ filter: (token) => pathStartsWithOneOf(["color"], token) || token.path[1] === "color"
21
+ }],
22
+ options: { outputReferences: false }
23
+ } }
24
+ };
25
+ };
26
+ const colorVariables = ({ "color-scheme": colorScheme, theme, ...permutation }) => {
27
+ const color = permutation.color;
28
+ return {
29
+ preprocessors: ["tokens-studio"],
30
+ platforms: { css: {
31
+ colorScheme,
32
+ theme,
33
+ selector: color === buildOptions?.defaultColor ? `:root, [data-color-scheme], [data-color="${color}"]` : `[data-color="${color}"], [data-color-scheme][data-color="${color}"]`,
34
+ layer: `ds.theme.color`,
35
+ prefix: "ds",
36
+ buildPath: `${theme}/`,
37
+ transforms: dsTransformers,
38
+ files: [{
39
+ destination: `color/${color}.css`,
40
+ format: formats.colorCategory.name,
41
+ filter: (token) => isSemanticColorToken(token, color)
42
+ }],
43
+ options: { outputReferences: true }
44
+ } }
45
+ };
46
+ };
47
+ //#endregion
48
+ export { colorSchemeVariables, colorVariables };
49
+
50
+ //# sourceMappingURL=color.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color.js","names":[],"sources":["../../../../../src/tokens/process/configs/color.ts"],"sourcesContent":["import type { Config as StyleDictionaryConfig } from 'style-dictionary/types';\nimport { isSemanticColorToken, pathStartsWithOneOf } from '../../utils.ts';\nimport { formats } from '../formats/css.ts';\nimport { buildOptions } from '../platform.ts';\n\nimport { dsTransformers, type GetStyleDictionaryConfig, prefix } from './shared.ts';\n\nexport const colorSchemeVariables: GetStyleDictionaryConfig = ({ 'color-scheme': colorScheme = 'light', theme }) => {\n const selector = `${colorScheme === 'light' ? ':root, ' : ''}[data-color-scheme=\"${colorScheme}\"]`;\n const layer = `ds.theme.color-scheme.${colorScheme}`;\n\n return {\n preprocessors: ['tokens-studio'],\n platforms: {\n css: {\n // custom\n colorScheme,\n theme,\n selector,\n layer,\n //\n prefix,\n buildPath: `${theme}/`,\n transforms: dsTransformers,\n files: [\n {\n destination: `color-scheme/${colorScheme}.css`,\n format: formats.colorScheme.name,\n filter: (token) => pathStartsWithOneOf(['color'], token) || token.path[1] === 'color', // link-visited tokens have \"color\" as the second segment of their path, e.g. \"ds.color.link-visited\"\n },\n ],\n options: {\n outputReferences: false,\n },\n },\n },\n };\n};\n\nexport const colorVariables: GetStyleDictionaryConfig = ({ 'color-scheme': colorScheme, theme, ...permutation }) => {\n const color = permutation.color;\n\n const layer = `ds.theme.color`;\n const isRootColor = color === buildOptions?.defaultColor;\n const selector = isRootColor\n ? `:root, [data-color-scheme], [data-color=\"${color}\"]`\n : `[data-color=\"${color}\"], [data-color-scheme][data-color=\"${color}\"]`;\n\n const config: StyleDictionaryConfig = {\n preprocessors: ['tokens-studio'],\n platforms: {\n css: {\n // custom\n colorScheme,\n theme,\n selector,\n layer,\n //\n prefix,\n buildPath: `${theme}/`,\n transforms: dsTransformers,\n files: [\n {\n destination: `color/${color}.css`,\n format: formats.colorCategory.name,\n filter: (token) => isSemanticColorToken(token, color),\n },\n ],\n options: {\n outputReferences: true,\n },\n },\n },\n };\n\n return config;\n};\n"],"mappings":";;;;;AAOA,MAAa,wBAAkD,EAAE,gBAAgB,cAAc,SAAS,YAAY;CAIlH,OAAO;EACL,eAAe,CAAC,eAAe;EAC/B,WAAW,EACT,KAAK;GAEH;GACA;GACA,UAAA,GAVc,gBAAgB,UAAU,YAAY,GAAG,sBAAsB,YAAY;GAWzF,OAAA,yBAViC;GAYjC,QAAA;GACA,WAAW,GAAG,MAAM;GACpB,YAAY;GACZ,OAAO,CACL;IACE,aAAa,gBAAgB,YAAY;IACzC,QAAQ,QAAQ,YAAY;IAC5B,SAAS,UAAU,oBAAoB,CAAC,OAAO,GAAG,KAAK,KAAK,MAAM,KAAK,OAAO;GAChF,CACF;GACA,SAAS,EACP,kBAAkB,MACpB;EACF,EACF;CACF;AACF;AAEA,MAAa,kBAA4C,EAAE,gBAAgB,aAAa,OAAO,GAAG,kBAAkB;CAClH,MAAM,QAAQ,YAAY;CAmC1B,OAAO;EA1BL,eAAe,CAAC,eAAe;EAC/B,WAAW,EACT,KAAK;GAEH;GACA;GACA,UAZc,UAAU,cAAc,eAExC,4CAA4C,MAAM,MAClD,gBAAgB,MAAM,sCAAsC,MAAM;GAUhE,OAAA;GAEA,QAAA;GACA,WAAW,GAAG,MAAM;GACpB,YAAY;GACZ,OAAO,CACL;IACE,aAAa,SAAS,MAAM;IAC5B,QAAQ,QAAQ,cAAc;IAC9B,SAAS,UAAU,qBAAqB,OAAO,KAAK;GACtD,CACF;GACA,SAAS,EACP,kBAAkB,KACpB;EACF,EACF;CAGU;AACd"}
@@ -0,0 +1,7 @@
1
+ import { GetStyleDictionaryConfig } from "./shared.js";
2
+
3
+ //#region src/tokens/process/configs/semantic.d.ts
4
+ declare const semanticVariables: GetStyleDictionaryConfig;
5
+ //#endregion
6
+ export { semanticVariables };
7
+ //# sourceMappingURL=semantic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"semantic.d.ts","names":[],"sources":["../../../../../src/tokens/process/configs/semantic.ts"],"mappings":";;;cAOa,iBAAA,EAAmB,wBA4C/B"}