@digdir/designsystemet 0.0.0-deps-tsdown-20260421103939

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 (195) hide show
  1. package/LICENSE +7 -0
  2. package/README.md +115 -0
  3. package/configs/test-tokens.config.json +82 -0
  4. package/dist/bin/config.d.ts +12 -0
  5. package/dist/bin/config.d.ts.map +1 -0
  6. package/dist/bin/config.js +58 -0
  7. package/dist/bin/designsystemet.d.ts +3 -0
  8. package/dist/bin/designsystemet.d.ts.map +1 -0
  9. package/dist/bin/designsystemet.js +156 -0
  10. package/dist/bin/options.d.ts +21 -0
  11. package/dist/bin/options.d.ts.map +1 -0
  12. package/dist/bin/options.js +23 -0
  13. package/dist/config.schema.json +209 -0
  14. package/dist/node_modules/.pnpm/@tokens-studio_types@0.5.2/node_modules/@tokens-studio/types/dist/constants/BorderValues.js +9 -0
  15. package/dist/node_modules/.pnpm/@tokens-studio_types@0.5.2/node_modules/@tokens-studio/types/dist/constants/BoxShadowTypes.js +8 -0
  16. package/dist/node_modules/.pnpm/@tokens-studio_types@0.5.2/node_modules/@tokens-studio/types/dist/constants/BoxShadowValues.js +13 -0
  17. package/dist/node_modules/.pnpm/@tokens-studio_types@0.5.2/node_modules/@tokens-studio/types/dist/constants/ColorModifierTypes.js +10 -0
  18. package/dist/node_modules/.pnpm/@tokens-studio_types@0.5.2/node_modules/@tokens-studio/types/dist/constants/ColorSpaceTypes.js +10 -0
  19. package/dist/node_modules/.pnpm/@tokens-studio_types@0.5.2/node_modules/@tokens-studio/types/dist/constants/Properties.js +53 -0
  20. package/dist/node_modules/.pnpm/@tokens-studio_types@0.5.2/node_modules/@tokens-studio/types/dist/constants/StrokeStyleValues.js +14 -0
  21. package/dist/node_modules/.pnpm/@tokens-studio_types@0.5.2/node_modules/@tokens-studio/types/dist/constants/TokenSetStatus.js +9 -0
  22. package/dist/node_modules/.pnpm/@tokens-studio_types@0.5.2/node_modules/@tokens-studio/types/dist/constants/TokenTypes.js +32 -0
  23. package/dist/node_modules/.pnpm/@tokens-studio_types@0.5.2/node_modules/@tokens-studio/types/dist/constants/TypographyValues.js +15 -0
  24. package/dist/node_modules/.pnpm/@tokens-studio_types@0.5.2/node_modules/@tokens-studio/types/dist/types/index.js +11 -0
  25. package/dist/package.js +5 -0
  26. package/dist/src/colors/colorMetadata.d.ts +56 -0
  27. package/dist/src/colors/colorMetadata.d.ts.map +1 -0
  28. package/dist/src/colors/colorMetadata.js +259 -0
  29. package/dist/src/colors/index.d.ts +5 -0
  30. package/dist/src/colors/index.d.ts.map +1 -0
  31. package/dist/src/colors/index.js +5 -0
  32. package/dist/src/colors/theme.d.ts +30 -0
  33. package/dist/src/colors/theme.d.ts.map +1 -0
  34. package/dist/src/colors/theme.js +111 -0
  35. package/dist/src/colors/types.d.ts +69 -0
  36. package/dist/src/colors/types.d.ts.map +1 -0
  37. package/dist/src/colors/types.js +24 -0
  38. package/dist/src/colors/utils.d.ts +128 -0
  39. package/dist/src/colors/utils.d.ts.map +1 -0
  40. package/dist/src/colors/utils.js +244 -0
  41. package/dist/src/config.d.ts +181 -0
  42. package/dist/src/config.d.ts.map +1 -0
  43. package/dist/src/config.js +118 -0
  44. package/dist/src/index.d.ts +4 -0
  45. package/dist/src/index.d.ts.map +1 -0
  46. package/dist/src/index.js +10 -0
  47. package/dist/src/migrations/beta-to-v1.d.ts +3 -0
  48. package/dist/src/migrations/beta-to-v1.d.ts.map +1 -0
  49. package/dist/src/migrations/beta-to-v1.js +340 -0
  50. package/dist/src/migrations/codemods/css/plugins.d.ts +6 -0
  51. package/dist/src/migrations/codemods/css/plugins.d.ts.map +1 -0
  52. package/dist/src/migrations/codemods/css/plugins.js +35 -0
  53. package/dist/src/migrations/codemods/css/run.d.ts +8 -0
  54. package/dist/src/migrations/codemods/css/run.d.ts.map +1 -0
  55. package/dist/src/migrations/codemods/css/run.js +23 -0
  56. package/dist/src/migrations/color-rename-next49.d.ts +3 -0
  57. package/dist/src/migrations/color-rename-next49.d.ts.map +1 -0
  58. package/dist/src/migrations/color-rename-next49.js +46 -0
  59. package/dist/src/migrations/index.d.ts +6 -0
  60. package/dist/src/migrations/index.d.ts.map +1 -0
  61. package/dist/src/migrations/index.js +9 -0
  62. package/dist/src/scripts/createJsonSchema.d.ts +2 -0
  63. package/dist/src/scripts/createJsonSchema.d.ts.map +1 -0
  64. package/dist/src/scripts/update-preview-tokens.d.ts +3 -0
  65. package/dist/src/scripts/update-preview-tokens.d.ts.map +1 -0
  66. package/dist/src/tokens/build.d.ts +4 -0
  67. package/dist/src/tokens/build.d.ts.map +1 -0
  68. package/dist/src/tokens/build.js +41 -0
  69. package/dist/src/tokens/create/files.d.ts +11 -0
  70. package/dist/src/tokens/create/files.d.ts.map +1 -0
  71. package/dist/src/tokens/create/files.js +44 -0
  72. package/dist/src/tokens/create/generators/$designsystemet.d.ts +5 -0
  73. package/dist/src/tokens/create/generators/$designsystemet.d.ts.map +1 -0
  74. package/dist/src/tokens/create/generators/$designsystemet.js +10 -0
  75. package/dist/src/tokens/create/generators/$metadata.d.ts +8 -0
  76. package/dist/src/tokens/create/generators/$metadata.d.ts.map +1 -0
  77. package/dist/src/tokens/create/generators/$metadata.js +19 -0
  78. package/dist/src/tokens/create/generators/$themes.d.ts +27 -0
  79. package/dist/src/tokens/create/generators/$themes.d.ts.map +1 -0
  80. package/dist/src/tokens/create/generators/$themes.js +158 -0
  81. package/dist/src/tokens/create/generators/primitives/color-scheme.d.ts +5 -0
  82. package/dist/src/tokens/create/generators/primitives/color-scheme.d.ts.map +1 -0
  83. package/dist/src/tokens/create/generators/primitives/color-scheme.js +71 -0
  84. package/dist/src/tokens/create/generators/primitives/globals.d.ts +3 -0
  85. package/dist/src/tokens/create/generators/primitives/globals.d.ts.map +1 -0
  86. package/dist/src/tokens/create/generators/primitives/globals.js +142 -0
  87. package/dist/src/tokens/create/generators/primitives/size.d.ts +4 -0
  88. package/dist/src/tokens/create/generators/primitives/size.d.ts.map +1 -0
  89. package/dist/src/tokens/create/generators/primitives/size.js +147 -0
  90. package/dist/src/tokens/create/generators/primitives/typography.d.ts +4 -0
  91. package/dist/src/tokens/create/generators/primitives/typography.d.ts.map +1 -0
  92. package/dist/src/tokens/create/generators/primitives/typography.js +216 -0
  93. package/dist/src/tokens/create/generators/semantic/color-modes.d.ts +8 -0
  94. package/dist/src/tokens/create/generators/semantic/color-modes.d.ts.map +1 -0
  95. package/dist/src/tokens/create/generators/semantic/color-modes.js +26 -0
  96. package/dist/src/tokens/create/generators/semantic/color.d.ts +5 -0
  97. package/dist/src/tokens/create/generators/semantic/color.d.ts.map +1 -0
  98. package/dist/src/tokens/create/generators/semantic/color.js +46 -0
  99. package/dist/src/tokens/create/generators/semantic/style.d.ts +3 -0
  100. package/dist/src/tokens/create/generators/semantic/style.d.ts.map +1 -0
  101. package/dist/src/tokens/create/generators/semantic/style.js +381 -0
  102. package/dist/src/tokens/create/generators/themes/theme.d.ts +3 -0
  103. package/dist/src/tokens/create/generators/themes/theme.d.ts.map +1 -0
  104. package/dist/src/tokens/create/generators/themes/theme.js +112 -0
  105. package/dist/src/tokens/create.d.ts +21 -0
  106. package/dist/src/tokens/create.d.ts.map +1 -0
  107. package/dist/src/tokens/create.js +47 -0
  108. package/dist/src/tokens/format.d.ts +15 -0
  109. package/dist/src/tokens/format.d.ts.map +1 -0
  110. package/dist/src/tokens/format.js +41 -0
  111. package/dist/src/tokens/generate-config.d.ts +10 -0
  112. package/dist/src/tokens/generate-config.d.ts.map +1 -0
  113. package/dist/src/tokens/generate-config.js +178 -0
  114. package/dist/src/tokens/index.d.ts +4 -0
  115. package/dist/src/tokens/index.d.ts.map +1 -0
  116. package/dist/src/tokens/index.js +3 -0
  117. package/dist/src/tokens/process/configs/color.d.ts +12 -0
  118. package/dist/src/tokens/process/configs/color.d.ts.map +1 -0
  119. package/dist/src/tokens/process/configs/color.js +51 -0
  120. package/dist/src/tokens/process/configs/semantic.d.ts +3 -0
  121. package/dist/src/tokens/process/configs/semantic.d.ts.map +1 -0
  122. package/dist/src/tokens/process/configs/semantic.js +47 -0
  123. package/dist/src/tokens/process/configs/shared.d.ts +10 -0
  124. package/dist/src/tokens/process/configs/shared.d.ts.map +1 -0
  125. package/dist/src/tokens/process/configs/shared.js +19 -0
  126. package/dist/src/tokens/process/configs/size-mode.d.ts +3 -0
  127. package/dist/src/tokens/process/configs/size-mode.d.ts.map +1 -0
  128. package/dist/src/tokens/process/configs/size-mode.js +28 -0
  129. package/dist/src/tokens/process/configs/size.d.ts +3 -0
  130. package/dist/src/tokens/process/configs/size.d.ts.map +1 -0
  131. package/dist/src/tokens/process/configs/size.js +34 -0
  132. package/dist/src/tokens/process/configs/type-scale.d.ts +3 -0
  133. package/dist/src/tokens/process/configs/type-scale.d.ts.map +1 -0
  134. package/dist/src/tokens/process/configs/type-scale.js +49 -0
  135. package/dist/src/tokens/process/configs/typography.d.ts +3 -0
  136. package/dist/src/tokens/process/configs/typography.d.ts.map +1 -0
  137. package/dist/src/tokens/process/configs/typography.js +64 -0
  138. package/dist/src/tokens/process/configs.d.ts +20 -0
  139. package/dist/src/tokens/process/configs.d.ts.map +1 -0
  140. package/dist/src/tokens/process/configs.js +90 -0
  141. package/dist/src/tokens/process/formats/css/color.d.ts +4 -0
  142. package/dist/src/tokens/process/formats/css/color.d.ts.map +1 -0
  143. package/dist/src/tokens/process/formats/css/color.js +63 -0
  144. package/dist/src/tokens/process/formats/css/semantic.d.ts +3 -0
  145. package/dist/src/tokens/process/formats/css/semantic.d.ts.map +1 -0
  146. package/dist/src/tokens/process/formats/css/semantic.js +29 -0
  147. package/dist/src/tokens/process/formats/css/size-mode.d.ts +4 -0
  148. package/dist/src/tokens/process/formats/css/size-mode.d.ts.map +1 -0
  149. package/dist/src/tokens/process/formats/css/size-mode.js +50 -0
  150. package/dist/src/tokens/process/formats/css/size.d.ts +21 -0
  151. package/dist/src/tokens/process/formats/css/size.d.ts.map +1 -0
  152. package/dist/src/tokens/process/formats/css/size.js +93 -0
  153. package/dist/src/tokens/process/formats/css/type-scale.d.ts +3 -0
  154. package/dist/src/tokens/process/formats/css/type-scale.d.ts.map +1 -0
  155. package/dist/src/tokens/process/formats/css/type-scale.js +55 -0
  156. package/dist/src/tokens/process/formats/css/typography.d.ts +3 -0
  157. package/dist/src/tokens/process/formats/css/typography.d.ts.map +1 -0
  158. package/dist/src/tokens/process/formats/css/typography.js +29 -0
  159. package/dist/src/tokens/process/formats/css.d.ts +11 -0
  160. package/dist/src/tokens/process/formats/css.d.ts.map +1 -0
  161. package/dist/src/tokens/process/formats/css.js +18 -0
  162. package/dist/src/tokens/process/output/declarations.d.ts +5 -0
  163. package/dist/src/tokens/process/output/declarations.d.ts.map +1 -0
  164. package/dist/src/tokens/process/output/declarations.js +38 -0
  165. package/dist/src/tokens/process/output/tailwind.d.ts +3 -0
  166. package/dist/src/tokens/process/output/tailwind.d.ts.map +1 -0
  167. package/dist/src/tokens/process/output/tailwind.js +45 -0
  168. package/dist/src/tokens/process/output/theme.d.ts +27 -0
  169. package/dist/src/tokens/process/output/theme.d.ts.map +1 -0
  170. package/dist/src/tokens/process/output/theme.js +83 -0
  171. package/dist/src/tokens/process/platform.d.ts +106 -0
  172. package/dist/src/tokens/process/platform.d.ts.map +1 -0
  173. package/dist/src/tokens/process/platform.js +168 -0
  174. package/dist/src/tokens/process/transformers.d.ts +6 -0
  175. package/dist/src/tokens/process/transformers.d.ts.map +1 -0
  176. package/dist/src/tokens/process/transformers.js +54 -0
  177. package/dist/src/tokens/process/utils/getMultidimensionalThemes.d.ts +36 -0
  178. package/dist/src/tokens/process/utils/getMultidimensionalThemes.d.ts.map +1 -0
  179. package/dist/src/tokens/process/utils/getMultidimensionalThemes.js +114 -0
  180. package/dist/src/tokens/process/utils/kebab-case.d.ts +5 -0
  181. package/dist/src/tokens/process/utils/kebab-case.d.ts.map +1 -0
  182. package/dist/src/tokens/process/utils/kebab-case.js +9 -0
  183. package/dist/src/tokens/types.d.ts +74 -0
  184. package/dist/src/tokens/types.d.ts.map +1 -0
  185. package/dist/src/tokens/types.js +7 -0
  186. package/dist/src/tokens/utils.d.ts +63 -0
  187. package/dist/src/tokens/utils.d.ts.map +1 -0
  188. package/dist/src/tokens/utils.js +121 -0
  189. package/dist/src/types.d.ts +6 -0
  190. package/dist/src/types.d.ts.map +1 -0
  191. package/dist/src/types.js +2 -0
  192. package/dist/src/utils/filesystem.d.ts +40 -0
  193. package/dist/src/utils/filesystem.d.ts.map +1 -0
  194. package/dist/src/utils/filesystem.js +115 -0
  195. package/package.json +87 -0
@@ -0,0 +1,216 @@
1
+ //#region src/tokens/create/generators/primitives/typography.ts
2
+ const generateTypography = (themeName, { fontFamily }) => ({ [themeName]: {
3
+ "font-family": {
4
+ $type: "fontFamilies",
5
+ $value: fontFamily
6
+ },
7
+ "font-weight": {
8
+ medium: {
9
+ $type: "fontWeights",
10
+ $value: "Medium"
11
+ },
12
+ semibold: {
13
+ $type: "fontWeights",
14
+ $value: "Semi bold"
15
+ },
16
+ regular: {
17
+ $type: "fontWeights",
18
+ $value: "Regular"
19
+ }
20
+ }
21
+ } });
22
+ const generateFontSizes = (size) => fontSizes[size];
23
+ const lineHeights = {
24
+ sm: {
25
+ $type: "lineHeights",
26
+ $value: "130%"
27
+ },
28
+ md: {
29
+ $type: "lineHeights",
30
+ $value: "150%"
31
+ },
32
+ lg: {
33
+ $type: "lineHeights",
34
+ $value: "170%"
35
+ }
36
+ };
37
+ const letterSpacings = {
38
+ "1": {
39
+ $type: "letterSpacing",
40
+ $value: "-1%"
41
+ },
42
+ "2": {
43
+ $type: "letterSpacing",
44
+ $value: "-0.5%"
45
+ },
46
+ "3": {
47
+ $type: "letterSpacing",
48
+ $value: "-0.25%"
49
+ },
50
+ "4": {
51
+ $type: "letterSpacing",
52
+ $value: "-0.15%"
53
+ },
54
+ "5": {
55
+ $type: "letterSpacing",
56
+ $value: "0%"
57
+ },
58
+ "6": {
59
+ $type: "letterSpacing",
60
+ $value: "0.15%"
61
+ },
62
+ "7": {
63
+ $type: "letterSpacing",
64
+ $value: "0.25%"
65
+ },
66
+ "8": {
67
+ $type: "letterSpacing",
68
+ $value: "0.5%"
69
+ },
70
+ "9": {
71
+ $type: "letterSpacing",
72
+ $value: "1.5%"
73
+ }
74
+ };
75
+ const fontSizes = {
76
+ large: {
77
+ "line-height": lineHeights,
78
+ "font-size": {
79
+ "1": {
80
+ $type: "fontSizes",
81
+ $value: "13"
82
+ },
83
+ "2": {
84
+ $type: "fontSizes",
85
+ $value: "16"
86
+ },
87
+ "3": {
88
+ $type: "fontSizes",
89
+ $value: "18"
90
+ },
91
+ "4": {
92
+ $type: "fontSizes",
93
+ $value: "21"
94
+ },
95
+ "5": {
96
+ $type: "fontSizes",
97
+ $value: "24"
98
+ },
99
+ "6": {
100
+ $type: "fontSizes",
101
+ $value: "30"
102
+ },
103
+ "7": {
104
+ $type: "fontSizes",
105
+ $value: "36"
106
+ },
107
+ "8": {
108
+ $type: "fontSizes",
109
+ $value: "48"
110
+ },
111
+ "9": {
112
+ $type: "fontSizes",
113
+ $value: "60"
114
+ },
115
+ "10": {
116
+ $type: "fontSizes",
117
+ $value: "72"
118
+ }
119
+ },
120
+ "letter-spacing": letterSpacings
121
+ },
122
+ medium: {
123
+ "line-height": lineHeights,
124
+ "font-size": {
125
+ "1": {
126
+ $type: "fontSizes",
127
+ $value: "12"
128
+ },
129
+ "2": {
130
+ $type: "fontSizes",
131
+ $value: "14"
132
+ },
133
+ "3": {
134
+ $type: "fontSizes",
135
+ $value: "16"
136
+ },
137
+ "4": {
138
+ $type: "fontSizes",
139
+ $value: "18"
140
+ },
141
+ "5": {
142
+ $type: "fontSizes",
143
+ $value: "21"
144
+ },
145
+ "6": {
146
+ $type: "fontSizes",
147
+ $value: "24"
148
+ },
149
+ "7": {
150
+ $type: "fontSizes",
151
+ $value: "30"
152
+ },
153
+ "8": {
154
+ $type: "fontSizes",
155
+ $value: "36"
156
+ },
157
+ "9": {
158
+ $type: "fontSizes",
159
+ $value: "48"
160
+ },
161
+ "10": {
162
+ $type: "fontSizes",
163
+ $value: "60"
164
+ }
165
+ },
166
+ "letter-spacing": letterSpacings
167
+ },
168
+ small: {
169
+ "line-height": lineHeights,
170
+ "font-size": {
171
+ "1": {
172
+ $type: "fontSizes",
173
+ $value: "11"
174
+ },
175
+ "2": {
176
+ $type: "fontSizes",
177
+ $value: "13"
178
+ },
179
+ "3": {
180
+ $type: "fontSizes",
181
+ $value: "14"
182
+ },
183
+ "4": {
184
+ $type: "fontSizes",
185
+ $value: "16"
186
+ },
187
+ "5": {
188
+ $type: "fontSizes",
189
+ $value: "18"
190
+ },
191
+ "6": {
192
+ $type: "fontSizes",
193
+ $value: "21"
194
+ },
195
+ "7": {
196
+ $type: "fontSizes",
197
+ $value: "24"
198
+ },
199
+ "8": {
200
+ $type: "fontSizes",
201
+ $value: "30"
202
+ },
203
+ "9": {
204
+ $type: "fontSizes",
205
+ $value: "36"
206
+ },
207
+ "10": {
208
+ $type: "fontSizes",
209
+ $value: "48"
210
+ }
211
+ },
212
+ "letter-spacing": letterSpacings
213
+ }
214
+ };
215
+ //#endregion
216
+ export { generateFontSizes, generateTypography };
@@ -0,0 +1,8 @@
1
+ import type { Colors, TokenSet } from '../../../types.js';
2
+ type SemanticModes = {
3
+ 'main-color': Record<string, TokenSet>;
4
+ 'support-color': Record<string, TokenSet>;
5
+ };
6
+ export declare const generateColorModes: (colors: Colors, _themeName: string) => SemanticModes;
7
+ export {};
8
+ //# sourceMappingURL=color-modes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color-modes.d.ts","sourceRoot":"","sources":["../../../../../../src/tokens/create/generators/semantic/color-modes.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAS,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAEjE,KAAK,aAAa,GAAG;IACnB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACvC,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;CAC3C,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,QAAQ,MAAM,EAAE,YAAY,MAAM,kBA4BpE,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { semanticColorNames } from "../../../../colors/types.js";
2
+ //#region src/tokens/create/generators/semantic/color-modes.ts
3
+ const generateColorModes = (colors, _themeName) => {
4
+ const mainColorNames = Object.keys(colors.main);
5
+ const supportColorNames = Object.keys(colors.support);
6
+ const modes = {
7
+ "main-color": {},
8
+ "support-color": {}
9
+ };
10
+ const categories = [["main-color", mainColorNames], ["support-color", supportColorNames]];
11
+ for (const [colorCategory, colorNames] of categories) for (const colorName of colorNames) {
12
+ const customColorTokens = { color: { [colorCategory.replace("-color", "")]: generateColorScaleTokens(colorName) } };
13
+ modes[colorCategory][colorName] = customColorTokens;
14
+ }
15
+ return modes;
16
+ };
17
+ const generateColorScaleTokens = (colorName) => {
18
+ const colorScale = {};
19
+ for (const colorSemantic of semanticColorNames) colorScale[colorSemantic] = {
20
+ $type: "color",
21
+ $value: `{color.${colorName}.${colorSemantic}}`
22
+ };
23
+ return colorScale;
24
+ };
25
+ //#endregion
26
+ export { generateColorModes };
@@ -0,0 +1,5 @@
1
+ import type { Colors } from '../../../types.js';
2
+ export declare const generateSemanticColors: (colors: Colors, _themeName: string) => {
3
+ color: any;
4
+ };
5
+ //# sourceMappingURL=color.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../../../../../src/tokens/create/generators/semantic/color.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAmB,MAAM,mBAAmB,CAAC;AAEjE,eAAO,MAAM,sBAAsB,GAAI,QAAQ,MAAM,EAAE,YAAY,MAAM;;CAiBxE,CAAC"}
@@ -0,0 +1,46 @@
1
+ import { baseColorNames } from "../../../../colors/colorMetadata.js";
2
+ import { semanticColorMap } from "../../../../colors/types.js";
3
+ import * as R from "ramda";
4
+ //#region src/tokens/create/generators/semantic/color.ts
5
+ const generateSemanticColors = (colors, _themeName) => {
6
+ const mainColorNames = Object.keys(colors.main);
7
+ const supportColorNames = Object.keys(colors.support);
8
+ const semanticColorTokens = [...[
9
+ ...mainColorNames,
10
+ "neutral",
11
+ ...supportColorNames
12
+ ], ...baseColorNames].map((colorName) => [colorName, generateColorScaleTokens(colorName)]);
13
+ return {
14
+ ...baseColorTemplate,
15
+ color: {
16
+ ...Object.fromEntries(semanticColorTokens),
17
+ ...baseColorTemplate.color
18
+ }
19
+ };
20
+ };
21
+ const baseColorTemplate = {
22
+ color: { focus: {
23
+ inner: {
24
+ $type: "color",
25
+ $value: "{color.focus.inner-color}"
26
+ },
27
+ outer: {
28
+ $type: "color",
29
+ $value: "{color.focus.outer-color}"
30
+ }
31
+ } },
32
+ link: { color: { visited: {
33
+ $type: "color",
34
+ $value: "{color.link.visited}"
35
+ } } }
36
+ };
37
+ const generateColorScaleTokens = (colorName) => {
38
+ const colorScale = {};
39
+ for (const [colorSemantic, colorNumber] of R.toPairs(semanticColorMap)) colorScale[colorSemantic] = {
40
+ $type: "color",
41
+ $value: `{color.${colorName}.${colorNumber}}`
42
+ };
43
+ return colorScale;
44
+ };
45
+ //#endregion
46
+ export { generateSemanticColors };
@@ -0,0 +1,3 @@
1
+ import type { TokenSet } from '../../../types.js';
2
+ export declare function generateSemanticStyle(): TokenSet;
3
+ //# sourceMappingURL=style.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../../../../../src/tokens/create/generators/semantic/style.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAS,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAEzD,wBAAgB,qBAAqB,IAAI,QAAQ,CA2XhD"}
@@ -0,0 +1,381 @@
1
+ //#region src/tokens/create/generators/semantic/style.ts
2
+ function generateSemanticStyle() {
3
+ return {
4
+ typography: {
5
+ heading: {
6
+ "2xl": {
7
+ $type: "typography",
8
+ $value: {
9
+ fontFamily: "{font-family}",
10
+ fontWeight: "{font-weight.medium}",
11
+ lineHeight: "{line-height.sm}",
12
+ fontSize: "{font-size.10}",
13
+ letterSpacing: "{letter-spacing.1}"
14
+ }
15
+ },
16
+ xl: {
17
+ $type: "typography",
18
+ $value: {
19
+ fontFamily: "{font-family}",
20
+ fontWeight: "{font-weight.medium}",
21
+ lineHeight: "{line-height.sm}",
22
+ fontSize: "{font-size.9}",
23
+ letterSpacing: "{letter-spacing.1}"
24
+ }
25
+ },
26
+ lg: {
27
+ $type: "typography",
28
+ $value: {
29
+ fontFamily: "{font-family}",
30
+ fontWeight: "{font-weight.medium}",
31
+ lineHeight: "{line-height.sm}",
32
+ fontSize: "{font-size.8}",
33
+ letterSpacing: "{letter-spacing.2}"
34
+ }
35
+ },
36
+ md: {
37
+ $type: "typography",
38
+ $value: {
39
+ fontFamily: "{font-family}",
40
+ fontWeight: "{font-weight.medium}",
41
+ lineHeight: "{line-height.sm}",
42
+ fontSize: "{font-size.7}",
43
+ letterSpacing: "{letter-spacing.3}"
44
+ }
45
+ },
46
+ sm: {
47
+ $type: "typography",
48
+ $value: {
49
+ fontFamily: "{font-family}",
50
+ fontWeight: "{font-weight.medium}",
51
+ lineHeight: "{line-height.sm}",
52
+ fontSize: "{font-size.6}",
53
+ letterSpacing: "{letter-spacing.5}"
54
+ }
55
+ },
56
+ xs: {
57
+ $type: "typography",
58
+ $value: {
59
+ fontFamily: "{font-family}",
60
+ fontWeight: "{font-weight.medium}",
61
+ lineHeight: "{line-height.sm}",
62
+ fontSize: "{font-size.5}",
63
+ letterSpacing: "{letter-spacing.6}"
64
+ }
65
+ },
66
+ "2xs": {
67
+ $type: "typography",
68
+ $value: {
69
+ fontFamily: "{font-family}",
70
+ fontWeight: "{font-weight.medium}",
71
+ lineHeight: "{line-height.sm}",
72
+ fontSize: "{font-size.4}",
73
+ letterSpacing: "{letter-spacing.6}"
74
+ }
75
+ }
76
+ },
77
+ body: {
78
+ xl: {
79
+ $type: "typography",
80
+ $value: {
81
+ fontFamily: "{font-family}",
82
+ fontWeight: "{font-weight.regular}",
83
+ lineHeight: "{line-height.md}",
84
+ fontSize: "{font-size.6}",
85
+ letterSpacing: "{letter-spacing.8}"
86
+ }
87
+ },
88
+ lg: {
89
+ $type: "typography",
90
+ $value: {
91
+ fontFamily: "{font-family}",
92
+ fontWeight: "{font-weight.regular}",
93
+ lineHeight: "{line-height.md}",
94
+ fontSize: "{font-size.5}",
95
+ letterSpacing: "{letter-spacing.8}"
96
+ }
97
+ },
98
+ md: {
99
+ $type: "typography",
100
+ $value: {
101
+ fontFamily: "{font-family}",
102
+ fontWeight: "{font-weight.regular}",
103
+ lineHeight: "{line-height.md}",
104
+ fontSize: "{font-size.4}",
105
+ letterSpacing: "{letter-spacing.8}"
106
+ }
107
+ },
108
+ sm: {
109
+ $type: "typography",
110
+ $value: {
111
+ fontFamily: "{font-family}",
112
+ fontWeight: "{font-weight.regular}",
113
+ lineHeight: "{line-height.md}",
114
+ fontSize: "{font-size.3}",
115
+ letterSpacing: "{letter-spacing.7}"
116
+ }
117
+ },
118
+ xs: {
119
+ $type: "typography",
120
+ $value: {
121
+ fontFamily: "{font-family}",
122
+ fontWeight: "{font-weight.regular}",
123
+ lineHeight: "{line-height.md}",
124
+ fontSize: "{font-size.2}",
125
+ letterSpacing: "{letter-spacing.6}"
126
+ }
127
+ },
128
+ short: {
129
+ xl: {
130
+ $type: "typography",
131
+ $value: {
132
+ fontFamily: "{font-family}",
133
+ fontWeight: "{font-weight.regular}",
134
+ lineHeight: "{line-height.sm}",
135
+ fontSize: "{font-size.6}",
136
+ letterSpacing: "{letter-spacing.8}"
137
+ }
138
+ },
139
+ lg: {
140
+ $type: "typography",
141
+ $value: {
142
+ fontFamily: "{font-family}",
143
+ fontWeight: "{font-weight.regular}",
144
+ lineHeight: "{line-height.sm}",
145
+ fontSize: "{font-size.5}",
146
+ letterSpacing: "{letter-spacing.8}"
147
+ }
148
+ },
149
+ md: {
150
+ $type: "typography",
151
+ $value: {
152
+ fontFamily: "{font-family}",
153
+ fontWeight: "{font-weight.regular}",
154
+ lineHeight: "{line-height.sm}",
155
+ fontSize: "{font-size.4}",
156
+ letterSpacing: "{letter-spacing.8}"
157
+ }
158
+ },
159
+ sm: {
160
+ $type: "typography",
161
+ $value: {
162
+ fontFamily: "{font-family}",
163
+ fontWeight: "{font-weight.regular}",
164
+ lineHeight: "{line-height.sm}",
165
+ fontSize: "{font-size.3}",
166
+ letterSpacing: "{letter-spacing.7}"
167
+ }
168
+ },
169
+ xs: {
170
+ $type: "typography",
171
+ $value: {
172
+ fontFamily: "{font-family}",
173
+ fontWeight: "{font-weight.regular}",
174
+ lineHeight: "{line-height.sm}",
175
+ fontSize: "{font-size.2}",
176
+ letterSpacing: "{letter-spacing.6}"
177
+ }
178
+ }
179
+ },
180
+ long: {
181
+ xl: {
182
+ $type: "typography",
183
+ $value: {
184
+ fontFamily: "{font-family}",
185
+ fontWeight: "{font-weight.regular}",
186
+ lineHeight: "{line-height.lg}",
187
+ fontSize: "{font-size.6}",
188
+ letterSpacing: "{letter-spacing.8}"
189
+ }
190
+ },
191
+ lg: {
192
+ $type: "typography",
193
+ $value: {
194
+ fontFamily: "{font-family}",
195
+ fontWeight: "{font-weight.regular}",
196
+ lineHeight: "{line-height.lg}",
197
+ fontSize: "{font-size.5}",
198
+ letterSpacing: "{letter-spacing.8}"
199
+ }
200
+ },
201
+ md: {
202
+ $type: "typography",
203
+ $value: {
204
+ fontFamily: "{font-family}",
205
+ fontWeight: "{font-weight.regular}",
206
+ lineHeight: "{line-height.lg}",
207
+ fontSize: "{font-size.4}",
208
+ letterSpacing: "{letter-spacing.8}"
209
+ }
210
+ },
211
+ sm: {
212
+ $type: "typography",
213
+ $value: {
214
+ fontFamily: "{font-family}",
215
+ fontWeight: "{font-weight.regular}",
216
+ lineHeight: "{line-height.lg}",
217
+ fontSize: "{font-size.3}",
218
+ letterSpacing: "{letter-spacing.7}"
219
+ }
220
+ },
221
+ xs: {
222
+ $type: "typography",
223
+ $value: {
224
+ fontFamily: "{font-family}",
225
+ fontWeight: "{font-weight.regular}",
226
+ lineHeight: "{line-height.lg}",
227
+ fontSize: "{font-size.2}",
228
+ letterSpacing: "{letter-spacing.6}"
229
+ }
230
+ }
231
+ }
232
+ }
233
+ },
234
+ opacity: { disabled: {
235
+ $type: "opacity",
236
+ $value: "{opacity.30}"
237
+ } },
238
+ "border-width": {
239
+ default: {
240
+ $type: "borderWidth",
241
+ $value: "{border-width.1}"
242
+ },
243
+ focus: {
244
+ $type: "borderWidth",
245
+ $value: "{border-width.3}"
246
+ }
247
+ },
248
+ shadow: {
249
+ xs: {
250
+ $type: "boxShadow",
251
+ $value: "{shadow.100}"
252
+ },
253
+ sm: {
254
+ $type: "boxShadow",
255
+ $value: "{shadow.200}"
256
+ },
257
+ md: {
258
+ $type: "boxShadow",
259
+ $value: "{shadow.300}"
260
+ },
261
+ lg: {
262
+ $type: "boxShadow",
263
+ $value: "{shadow.400}"
264
+ },
265
+ xl: {
266
+ $type: "boxShadow",
267
+ $value: "{shadow.500}"
268
+ }
269
+ },
270
+ "border-radius": {
271
+ sm: {
272
+ $type: "dimension",
273
+ $value: "{border-radius.1}"
274
+ },
275
+ md: {
276
+ $type: "dimension",
277
+ $value: "{border-radius.2}"
278
+ },
279
+ lg: {
280
+ $type: "dimension",
281
+ $value: "{border-radius.3}"
282
+ },
283
+ xl: {
284
+ $type: "dimension",
285
+ $value: "{border-radius.4}"
286
+ },
287
+ default: {
288
+ $type: "dimension",
289
+ $value: "{border-radius.5}"
290
+ },
291
+ full: {
292
+ $type: "dimension",
293
+ $value: "{border-radius.6}"
294
+ }
295
+ },
296
+ size: {
297
+ "0": {
298
+ $type: "dimension",
299
+ $value: "{_size.0}"
300
+ },
301
+ "1": {
302
+ $type: "dimension",
303
+ $value: "{_size.1}"
304
+ },
305
+ "2": {
306
+ $type: "dimension",
307
+ $value: "{_size.2}"
308
+ },
309
+ "3": {
310
+ $type: "dimension",
311
+ $value: "{_size.3}"
312
+ },
313
+ "4": {
314
+ $type: "dimension",
315
+ $value: "{_size.4}"
316
+ },
317
+ "5": {
318
+ $type: "dimension",
319
+ $value: "{_size.5}"
320
+ },
321
+ "6": {
322
+ $type: "dimension",
323
+ $value: "{_size.6}"
324
+ },
325
+ "7": {
326
+ $type: "dimension",
327
+ $value: "{_size.7}"
328
+ },
329
+ "8": {
330
+ $type: "dimension",
331
+ $value: "{_size.8}"
332
+ },
333
+ "9": {
334
+ $type: "dimension",
335
+ $value: "{_size.9}"
336
+ },
337
+ "10": {
338
+ $type: "dimension",
339
+ $value: "{_size.10}"
340
+ },
341
+ "11": {
342
+ $type: "dimension",
343
+ $value: "{_size.11}"
344
+ },
345
+ "12": {
346
+ $type: "dimension",
347
+ $value: "{_size.12}"
348
+ },
349
+ "13": {
350
+ $type: "dimension",
351
+ $value: "{_size.13}"
352
+ },
353
+ "14": {
354
+ $type: "dimension",
355
+ $value: "{_size.14}"
356
+ },
357
+ "15": {
358
+ $type: "dimension",
359
+ $value: "{_size.15}"
360
+ },
361
+ "18": {
362
+ $type: "dimension",
363
+ $value: "{_size.18}"
364
+ },
365
+ "22": {
366
+ $type: "dimension",
367
+ $value: "{_size.22}"
368
+ },
369
+ "26": {
370
+ $type: "dimension",
371
+ $value: "{_size.26}"
372
+ },
373
+ "30": {
374
+ $type: "dimension",
375
+ $value: "{_size.30}"
376
+ }
377
+ }
378
+ };
379
+ }
380
+ //#endregion
381
+ export { generateSemanticStyle };
@@ -0,0 +1,3 @@
1
+ import type { Colors, TokenSet } from '../../../types.js';
2
+ export declare const generateTheme: (colors: Colors, themeName: string, borderRadius: number) => TokenSet;
3
+ //# sourceMappingURL=theme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../../../../src/tokens/create/generators/themes/theme.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAS,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAEjE,eAAO,MAAM,aAAa,GAAI,QAAQ,MAAM,EAAE,WAAW,MAAM,EAAE,cAAc,MAAM,aAmDpF,CAAC"}