@breadstone-infrastructure/style-dictionary 0.0.206 → 0.0.209

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 (54) hide show
  1. package/CHANGELOG.md +182 -0
  2. package/formats/tailwind/v4/buildTailwindV4Config.d.ts +83 -0
  3. package/formats/tailwind/v4/buildTailwindV4Config.d.ts.map +1 -0
  4. package/formats/tailwind/v4/buildTailwindV4Config.js +338 -0
  5. package/formats/tailwind/v4/buildTailwindV4Config.js.map +1 -0
  6. package/formats/tailwind/v4/index.d.ts +2 -0
  7. package/formats/tailwind/v4/index.d.ts.map +1 -1
  8. package/formats/tailwind/v4/index.js +2 -0
  9. package/formats/tailwind/v4/index.js.map +1 -1
  10. package/formats/tailwind/v4/tailwindV4Format.d.ts +64 -0
  11. package/formats/tailwind/v4/tailwindV4Format.d.ts.map +1 -1
  12. package/formats/tailwind/v4/tailwindV4Format.js +82 -1
  13. package/formats/tailwind/v4/tailwindV4Format.js.map +1 -1
  14. package/package.json +3 -3
  15. package/formats/tailwind/DesignTokenType.d.ts +0 -10
  16. package/formats/tailwind/DesignTokenType.d.ts.map +0 -1
  17. package/formats/tailwind/DesignTokenType.js +0 -3
  18. package/formats/tailwind/DesignTokenType.js.map +0 -1
  19. package/formats/tailwind/TailwindPropertyMapping.d.ts +0 -61
  20. package/formats/tailwind/TailwindPropertyMapping.d.ts.map +0 -1
  21. package/formats/tailwind/TailwindPropertyMapping.js +0 -421
  22. package/formats/tailwind/TailwindPropertyMapping.js.map +0 -1
  23. package/formats/tailwind/buildTailwindConfig.d.ts +0 -23
  24. package/formats/tailwind/buildTailwindConfig.d.ts.map +0 -1
  25. package/formats/tailwind/buildTailwindConfig.js +0 -280
  26. package/formats/tailwind/buildTailwindConfig.js.map +0 -1
  27. package/formats/tailwind/index.d.ts +0 -3
  28. package/formats/tailwind/index.d.ts.map +0 -1
  29. package/formats/tailwind/index.js +0 -19
  30. package/formats/tailwind/index.js.map +0 -1
  31. package/formats/tailwind/tailwindFormat.d.ts +0 -13
  32. package/formats/tailwind/tailwindFormat.d.ts.map +0 -1
  33. package/formats/tailwind/tailwindFormat.js +0 -57
  34. package/formats/tailwind/tailwindFormat.js.map +0 -1
  35. package/formats/tailwind/tailwindFormat2.d.ts +0 -13
  36. package/formats/tailwind/tailwindFormat2.d.ts.map +0 -1
  37. package/formats/tailwind/tailwindFormat2.js +0 -65
  38. package/formats/tailwind/tailwindFormat2.js.map +0 -1
  39. package/formats/tailwind/v3/TailwindPropertyMapping.d.ts +0 -61
  40. package/formats/tailwind/v3/TailwindPropertyMapping.d.ts.map +0 -1
  41. package/formats/tailwind/v3/TailwindPropertyMapping.js +0 -421
  42. package/formats/tailwind/v3/TailwindPropertyMapping.js.map +0 -1
  43. package/formats/tailwind/v3/buildTailwindConfig.d.ts +0 -23
  44. package/formats/tailwind/v3/buildTailwindConfig.d.ts.map +0 -1
  45. package/formats/tailwind/v3/buildTailwindConfig.js +0 -281
  46. package/formats/tailwind/v3/buildTailwindConfig.js.map +0 -1
  47. package/formats/tailwind/v3/tailwindFormat.d.ts +0 -13
  48. package/formats/tailwind/v3/tailwindFormat.d.ts.map +0 -1
  49. package/formats/tailwind/v3/tailwindFormat.js +0 -57
  50. package/formats/tailwind/v3/tailwindFormat.js.map +0 -1
  51. package/formats/tailwind/v3/tailwindFormat2.d.ts +0 -13
  52. package/formats/tailwind/v3/tailwindFormat2.d.ts.map +0 -1
  53. package/formats/tailwind/v3/tailwindFormat2.js +0 -65
  54. package/formats/tailwind/v3/tailwindFormat2.js.map +0 -1
@@ -1,280 +0,0 @@
1
- "use strict";
2
- // #region Imports
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.buildTailwindConfig = buildTailwindConfig;
5
- const utilities_1 = require("@breadstone-infrastructure/utilities");
6
- const getType_js_1 = require("../../utilities/getType.js");
7
- const getValue_js_1 = require("../../utilities/getValue.js");
8
- const TailwindPropertyMapping_js_1 = require("./TailwindPropertyMapping.js");
9
- // #endregion
10
- /**
11
- * Normalizes a raw token value into a JS value suitable for a Tailwind config.
12
- *
13
- * @param value Raw token value.
14
- * @returns Normalized value (string, number, or array) that can be used in Tailwind config.
15
- * @private
16
- */
17
- function normalizeValue(value) {
18
- if (Array.isArray(value)) {
19
- return value.map((v) => String(v));
20
- }
21
- if (typeof value === 'string' || typeof value === 'number') {
22
- return value;
23
- }
24
- return String(value);
25
- }
26
- /**
27
- * Deeply sets a value on an object via a path array. Similar to lodash.set.
28
- *
29
- * @param obj Target object.
30
- * @param path Array of keys.
31
- * @param value Value to set.
32
- * @private
33
- */
34
- function deepSet(obj, path, value) {
35
- let current = obj;
36
- for (let i = 0; i < path.length; i++) {
37
- const key = path[i];
38
- if (i === path.length - 1) {
39
- current[key] = value;
40
- }
41
- else {
42
- if (!current[key] || typeof current[key] !== 'object') {
43
- current[key] = {};
44
- }
45
- current = current[key];
46
- }
47
- }
48
- }
49
- /**
50
- * Validates that tokens use supported logical types and logs warnings
51
- * for those that cannot be mapped to Tailwind.
52
- *
53
- * This does not throw, it only logs — matching the original behavior.
54
- *
55
- * @param tokens All transformed tokens.
56
- * @param ignoredNames Optional substrings; tokens whose name contains any of them are ignored.
57
- * @private
58
- */
59
- function validateTokenTypes(tokens, ignoredNames = []) {
60
- const supported = new Set(TailwindPropertyMapping_js_1.SUPPORTED_TOKEN_TYPES);
61
- tokens
62
- .filter((token) => {
63
- const lower = token.name.toLowerCase();
64
- return !ignoredNames.some((substr) => lower.includes(substr.toLowerCase()));
65
- })
66
- .forEach((token) => {
67
- // If token has a valid category mapping, skip type validation
68
- const rawCategory = token.category;
69
- if (rawCategory) {
70
- const categoryKey = rawCategory;
71
- if (TailwindPropertyMapping_js_1.CATEGORY_TO_KEY_MAPPING[categoryKey]) {
72
- return; // Category is valid, no need to check type
73
- }
74
- }
75
- const type = (0, getType_js_1.getType)(token);
76
- if (!type) {
77
- return;
78
- }
79
- if (!supported.has(type)) {
80
- console.warn(`${(0, utilities_1.symbol)('warning')} ${(0, utilities_1.yellow)(`Type "${type}" is not supported in Tailwind builder for token "${token.path.join('.')}:${token.name}".`)}`);
81
- }
82
- });
83
- }
84
- /**
85
- * Resolves the mapping for a token in three steps:
86
- *
87
- * 1. If a `category` is present and mapped, use that mapping.
88
- * 2. Otherwise, fall back to token type via `getType` and `TOKEN_TYPE_TO_KEY_MAPPING`.
89
- * 3. If neither yields a mapping, return undefined (caller will log and skip).
90
- *
91
- * @param token The token to resolve mapping for.
92
- * @returns An IKeyMapping when resolvable, otherwise undefined.
93
- * @private
94
- */
95
- function resolveMappingForToken(token) {
96
- const rawCategory = token.category;
97
- // 1. Category-based mapping (if present)
98
- if (rawCategory) {
99
- const categoryKey = rawCategory;
100
- const byCategory = TailwindPropertyMapping_js_1.CATEGORY_TO_KEY_MAPPING[categoryKey];
101
- if (byCategory) {
102
- return byCategory;
103
- }
104
- // Category was provided but not recognized; we fall back to type-based logic.
105
- console.warn(`${(0, utilities_1.symbol)('warning')} ${(0, utilities_1.yellow)(`Token "${token.name}" specifies category "${rawCategory}", which is not mapped. Falling back to token type.`)}`);
106
- }
107
- // 2. Type-based mapping
108
- // Try multiple type properties: token.type (set by transforms), token.$type (original), token.original.type, token.original.$type
109
- const type = (token.type ?? token.$type ?? token.original?.type ?? token.original?.$type);
110
- if (type) {
111
- const byType = TailwindPropertyMapping_js_1.TOKEN_TYPE_TO_KEY_MAPPING[type];
112
- if (byType) {
113
- return byType;
114
- }
115
- }
116
- // 3. Nothing found: no mapping available
117
- return undefined;
118
- }
119
- /**
120
- * Builds a TailwindConfig object (with `theme.extend`) from a list of Style-Dictionary tokens.
121
- *
122
- * Resolution priority per token:
123
- *
124
- * 1. If `token.category` is present and matches a known Tailwind theme key
125
- * (configured in CATEGORY_TO_KEY_MAPPING), that mapping is used.
126
- * 2. Otherwise, the token's logical type (`getType(token)`) is used with
127
- * TOKEN_TYPE_TO_KEY_MAPPING as a fallback routing.
128
- * 3. If neither category nor type yields a mapping, the token is skipped
129
- * and a warning is logged.
130
- *
131
- * Additionally, this function validates token types up-front and logs warnings
132
- * for unsupported types (non-blocking).
133
- *
134
- * @param allTokens All transformed tokens from Style-Dictionary.
135
- * @param ignoredTokenNameSubstrings Optional substrings; tokens whose name contains any of them are ignored entirely.
136
- * @returns A TailwindConfig where `theme.extend` contains the mapped tokens.
137
- */
138
- function buildTailwindConfig(allTokens, ignoredTokenNameSubstrings = []) {
139
- // Pre-validation of token types (non-blocking, only logs)
140
- validateTokenTypes(allTokens, ignoredTokenNameSubstrings);
141
- const config = { theme: { extend: {} } };
142
- for (const token of allTokens) {
143
- const lowerName = token.name.toLowerCase();
144
- const tokenPath = token.path.join('.');
145
- // Check if any ignored substring appears in the token name OR path
146
- if (ignoredTokenNameSubstrings.some((substr) => lowerName.includes(substr.toLowerCase()) ||
147
- tokenPath.toLowerCase().includes(substr.toLowerCase()))) {
148
- continue;
149
- }
150
- // Skip expanded shadow parts (offsetX, offsetY, blur, spread, color sub-tokens)
151
- // These are created by expandShadowPreprocessor and should be ignored for Tailwind
152
- const shadowPartPattern = /\.(offsetX|offsetY|blur|spread|color)\.\d+$/i;
153
- if (shadowPartPattern.test(tokenPath)) {
154
- continue;
155
- }
156
- // Skip duration tokens (they're typically enums/metadata)
157
- if (token.path[0] === 'duration' && !token.value) {
158
- continue;
159
- }
160
- const mapping = resolveMappingForToken(token);
161
- if (!mapping) {
162
- console.warn(`${(0, utilities_1.symbol)('warning')} ${(0, utilities_1.yellow)(`Token "${token.path.join('.')}:${token.name}" cannot be mapped to Tailwind (no valid category or type mapping). Skipping.`)}`);
163
- continue;
164
- }
165
- const { themeKey, strategy } = mapping;
166
- if (!config.theme?.extend) {
167
- if (!config.theme) {
168
- config.theme = {};
169
- config.theme.extend = {};
170
- }
171
- else {
172
- config.theme.extend = {};
173
- }
174
- }
175
- const extend = config.theme.extend;
176
- // eslint-disable-next-line no-multi-assign
177
- const section = extend[themeKey] ??= {};
178
- const rawValue = (0, getValue_js_1.getValue)(token);
179
- const normalized = normalizeValue(rawValue);
180
- const rawPath = token.path.length > 0 ? token.path : [token.name];
181
- // Apply pathTransform if defined
182
- const transformedPath = mapping.pathTransform
183
- ? mapping.pathTransform(rawPath)
184
- : rawPath;
185
- // Warn if pathTransform returned original path unchanged (meaning it couldn't transform)
186
- // Compare content, not reference, for arrays
187
- const pathsAreEqual = Array.isArray(transformedPath) && Array.isArray(rawPath)
188
- ? transformedPath.length === rawPath.length && transformedPath.every((val, idx) => val === rawPath[idx])
189
- : transformedPath === rawPath;
190
- if (mapping.pathTransform && pathsAreEqual) {
191
- console.warn(`${(0, utilities_1.symbol)('warning')} ${(0, utilities_1.yellow)(`Token "${token.path.join('.')}:${token.name}" could not be transformed by pathTransform. Using raw path.`)}`);
192
- }
193
- switch (strategy) {
194
- case 'flat': {
195
- // For flat strategy, use the transformed path as a single key
196
- const key = typeof transformedPath === 'string'
197
- ? transformedPath
198
- : Array.isArray(transformedPath)
199
- ? transformedPath.join('-')
200
- : rawPath.join('-');
201
- section[key] = normalized;
202
- break;
203
- }
204
- case 'nested': {
205
- // For nested strategy, split the transformed path if it's a string
206
- const path = typeof transformedPath === 'string'
207
- ? transformedPath.split('.')
208
- : Array.isArray(transformedPath)
209
- ? transformedPath
210
- : rawPath;
211
- deepSet(section, path, normalized);
212
- break;
213
- }
214
- case 'shadeMap': {
215
- // For shadeMap strategy, use the transformed path as array [group, shade]
216
- // Example: ['primary', '500'] -> colors.primary['500']
217
- // Example: ['primary-dark', '500'] -> colors['primary-dark']['500']
218
- // Special case: if only DEFAULT exists, output direct value instead of { DEFAULT: value }
219
- const path = Array.isArray(transformedPath)
220
- ? transformedPath
221
- : typeof transformedPath === 'string'
222
- ? transformedPath.split('-')
223
- : rawPath;
224
- const [group, ...rest] = path;
225
- const shadeKey = rest.join('-') || 'DEFAULT';
226
- // If this is the first value for this group, we don't know yet if it will be a single value or object
227
- // Store values temporarily and resolve at the end
228
- section[group] ??= {};
229
- section[group][shadeKey] = normalized;
230
- break;
231
- }
232
- case 'shadow': {
233
- // For shadow strategy, use the transformed path as a single key
234
- const key = typeof transformedPath === 'string'
235
- ? transformedPath
236
- : Array.isArray(transformedPath)
237
- ? transformedPath.join('-')
238
- : rawPath.join('-');
239
- section[key] = Array.isArray(normalized) ? normalized.map((v) => String(v)).join(', ') : String(normalized);
240
- break;
241
- }
242
- default: {
243
- console.warn(`${(0, utilities_1.symbol)('warning')} ${(0, utilities_1.yellow)(`Unsupported mapping strategy "${String(strategy)}" for token "${token.name}".`)}`);
244
- break;
245
- }
246
- }
247
- }
248
- // Post-process: normalize single-entry objects to use DEFAULT key
249
- // If a category has only one key-value pair that is NOT already "DEFAULT", rename it to "DEFAULT"
250
- // Example: { "borderRadius": { "layout-radius": "12px" } } -> { "borderRadius": { "DEFAULT": "12px" } }
251
- if (config.theme?.extend) {
252
- const extend = config.theme.extend;
253
- for (const [categoryKey, categoryValue] of Object.entries(extend)) {
254
- if (typeof categoryValue === 'object' && categoryValue !== null && !Array.isArray(categoryValue)) {
255
- const obj = categoryValue;
256
- const keys = Object.keys(obj);
257
- // If only one entry exists and it's not already "DEFAULT", rename it to "DEFAULT"
258
- if (keys.length === 1 && keys[0] !== 'DEFAULT') {
259
- const value = obj[keys[0]];
260
- extend[categoryKey] = { DEFAULT: value };
261
- }
262
- else if (categoryKey === 'colors') {
263
- // For colors, recursively normalize nested single-entry objects to use DEFAULT
264
- // Example: { "background": { "some-key": "..." } } -> { "background": { "DEFAULT": "..." } }
265
- for (const [colorKey, colorValue] of Object.entries(obj)) {
266
- if (typeof colorValue === 'object' && colorValue !== null && !Array.isArray(colorValue)) {
267
- const colorObj = colorValue;
268
- const colorKeys = Object.keys(colorObj);
269
- if (colorKeys.length === 1 && colorKeys[0] !== 'DEFAULT') {
270
- obj[colorKey] = { DEFAULT: colorObj[colorKeys[0]] };
271
- }
272
- }
273
- }
274
- }
275
- }
276
- }
277
- }
278
- return config;
279
- }
280
- //# sourceMappingURL=buildTailwindConfig.js.map
@@ -1 +0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;IACL,CAAC;IAED,OAAO,MAAM,CAAC;AAClB,CAAC"}
@@ -1,3 +0,0 @@
1
- export * from './tailwindFormat';
2
- export * from './tailwindFormat2';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/formats/tailwind/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC"}
@@ -1,19 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./tailwindFormat"), exports);
18
- __exportStar(require("./tailwindFormat2"), exports);
19
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/formats/tailwind/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC;AACjC,oDAAkC"}
@@ -1,13 +0,0 @@
1
- import type { Format } from 'style-dictionary/types';
2
- /**
3
- * Style-Dictionary format that outputs a CommonJS `tailwind.config.js`,
4
- * exporting the theme configuration as `module.exports = …`.
5
- */
6
- export declare const tailwindPresetFormat: Format;
7
- /**
8
- * Style-Dictionary format that generates a Tailwind plugin module.
9
- * Exports a proper Tailwind CSS plugin that can be added to the plugins array
10
- * in tailwind.config.js.
11
- */
12
- export declare const tailwindPluginFormat: Format;
13
- //# sourceMappingURL=tailwindFormat.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tailwindFormat.d.ts","sourceRoot":"","sources":["../../../src/formats/tailwind/tailwindFormat.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAsB,MAAM,EAAgB,MAAM,wBAAwB,CAAC;AAKvF;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,MAgBlC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,EAAE,MA8BlC,CAAC"}
@@ -1,57 +0,0 @@
1
- "use strict";
2
- // #region Imports
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.tailwindPluginFormat = exports.tailwindPresetFormat = void 0;
5
- const buildTailwindConfig_js_1 = require("./buildTailwindConfig.js");
6
- // #endregion
7
- /**
8
- * Style-Dictionary format that outputs a CommonJS `tailwind.config.js`,
9
- * exporting the theme configuration as `module.exports = …`.
10
- */
11
- exports.tailwindPresetFormat = {
12
- name: 'tailwind/preset/js',
13
- format({ dictionary, options }) {
14
- const config = (0, buildTailwindConfig_js_1.buildTailwindConfig)(dictionary.allTokens, options.ignoredTokenNames ?? []);
15
- const header = `// ------------------------------------------------------------------------------
16
- // <auto-generated>
17
- // This code was generated by a tool.
18
- // Changes to this file may cause incorrect behavior and will be lost if
19
- // the code is regenerated.
20
- // </auto-generated>
21
- // ------------------------------------------------------------------------------`;
22
- return `${header}\n\nmodule.exports = ${JSON.stringify(config, null, 2)};\n`;
23
- }
24
- };
25
- /**
26
- * Style-Dictionary format that generates a Tailwind plugin module.
27
- * Exports a proper Tailwind CSS plugin that can be added to the plugins array
28
- * in tailwind.config.js.
29
- */
30
- exports.tailwindPluginFormat = {
31
- name: 'tailwind/plugin/js',
32
- format({ dictionary, options }) {
33
- const config = (0, buildTailwindConfig_js_1.buildTailwindConfig)(dictionary.allTokens, options.ignoredTokenNames ?? []);
34
- const themeSection = JSON.stringify(config.theme, null, 2);
35
- const header = `// ------------------------------------------------------------------------------
36
- // <auto-generated>
37
- // This code was generated by a tool.
38
- // Changes to this file may cause incorrect behavior and will be lost if
39
- // the code is regenerated.
40
- // </auto-generated>
41
- // ------------------------------------------------------------------------------`;
42
- return `${header}\n\nconst plugin = require('tailwindcss/plugin');
43
-
44
- module.exports = plugin(function({ addUtilities, theme, e }) {
45
- // Optional: Add custom utilities here
46
- // Example: Custom shadow utilities
47
- // const shadows = theme('boxShadow') || {};
48
- // const shadowUtils = Object.entries(shadows).reduce((acc, [key, value]) => {
49
- // acc['.' + e('shadow-' + key)] = { boxShadow: value };
50
- // return acc;
51
- // }, {});
52
- // addUtilities(shadowUtils);
53
- }, ${themeSection});
54
- `;
55
- }
56
- };
57
- //# sourceMappingURL=tailwindFormat.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tailwindFormat.js","sourceRoot":"","sources":["../../../src/formats/tailwind/tailwindFormat.ts"],"names":[],"mappings":";AAAA,kBAAkB;;;AAGlB,qEAA+D;AAE/D,aAAa;AAEb;;;GAGG;AACU,QAAA,oBAAoB,GAAW;IACxC,IAAI,EAAE,oBAAoB;IAC1B,MAAM,CAAC,EAAE,UAAU,EAAE,OAAO,EAG3B;QACG,MAAM,MAAM,GAAG,IAAA,4CAAmB,EAAC,UAAU,CAAC,SAAS,EAAE,OAAO,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC;QAC1F,MAAM,MAAM,GAAG;;;;;;kFAM2D,CAAC;QAC3E,OAAO,GAAG,MAAM,wBAAwB,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC;IACjF,CAAC;CACJ,CAAC;AAEF;;;;GAIG;AACU,QAAA,oBAAoB,GAAW;IACxC,IAAI,EAAE,oBAAoB;IAC1B,MAAM,CAAC,EAAE,UAAU,EAAE,OAAO,EAG3B;QACG,MAAM,MAAM,GAAG,IAAA,4CAAmB,EAAC,UAAU,CAAC,SAAS,EAAE,OAAO,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC;QAC1F,MAAM,YAAY,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAC3D,MAAM,MAAM,GAAG;;;;;;kFAM2D,CAAC;QAE3E,OAAO,GAAG,MAAM;;;;;;;;;;;KAWnB,YAAY;CAChB,CAAC;IACE,CAAC;CACJ,CAAC"}
@@ -1,13 +0,0 @@
1
- import type { Format } from 'style-dictionary/types';
2
- /**
3
- * Style-Dictionary format that outputs a CommonJS `tailwind.config.js`,
4
- * exporting the theme configuration as `module.exports = …`.
5
- */
6
- export declare const tailwindPresetTsFormat: Format;
7
- /**
8
- * Style-Dictionary format that generates a Tailwind plugin module.
9
- * Exports a proper Tailwind CSS plugin that can be added to the plugins array
10
- * in tailwind.config.js.
11
- */
12
- export declare const tailwindPluginTsFormat: Format;
13
- //# sourceMappingURL=tailwindFormat2.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tailwindFormat2.d.ts","sourceRoot":"","sources":["../../../src/formats/tailwind/tailwindFormat2.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAsB,MAAM,EAAgB,MAAM,wBAAwB,CAAC;AAKvF;;;GAGG;AACH,eAAO,MAAM,sBAAsB,EAAE,MAuBpC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,EAAE,MAgCpC,CAAC"}
@@ -1,65 +0,0 @@
1
- "use strict";
2
- // #region Imports
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.tailwindPluginTsFormat = exports.tailwindPresetTsFormat = void 0;
5
- const buildTailwindConfig_js_1 = require("./buildTailwindConfig.js");
6
- // #endregion
7
- /**
8
- * Style-Dictionary format that outputs a CommonJS `tailwind.config.js`,
9
- * exporting the theme configuration as `module.exports = …`.
10
- */
11
- exports.tailwindPresetTsFormat = {
12
- name: 'tailwind/preset/ts',
13
- format({ dictionary, options }) {
14
- const config = (0, buildTailwindConfig_js_1.buildTailwindConfig)(dictionary.allTokens, options.ignoredTokenNames ?? []);
15
- const header = `// ------------------------------------------------------------------------------
16
- // <auto-generated>
17
- // This code was generated by a tool.
18
- // Changes to this file may cause incorrect behavior and will be lost if
19
- // the code is regenerated.
20
- // </auto-generated>
21
- // ------------------------------------------------------------------------------`;
22
- return `
23
- ${header}
24
-
25
- import { Config } from 'tailwindcss';
26
-
27
- module.exports = ${JSON.stringify(config, null, 2)} satisfies Partial<Config>;
28
- `.trim();
29
- }
30
- };
31
- /**
32
- * Style-Dictionary format that generates a Tailwind plugin module.
33
- * Exports a proper Tailwind CSS plugin that can be added to the plugins array
34
- * in tailwind.config.js.
35
- */
36
- exports.tailwindPluginTsFormat = {
37
- name: 'tailwind/plugin/ts',
38
- format({ dictionary, options }) {
39
- const config = (0, buildTailwindConfig_js_1.buildTailwindConfig)(dictionary.allTokens, options.ignoredTokenNames ?? []);
40
- const themeSection = JSON.stringify(config.theme, null, 2);
41
- const header = `// ------------------------------------------------------------------------------
42
- // <auto-generated>
43
- // This code was generated by a tool.
44
- // Changes to this file may cause incorrect behavior and will be lost if
45
- // the code is regenerated.
46
- // </auto-generated>
47
- // ------------------------------------------------------------------------------`;
48
- return `${header}
49
-
50
- import createPlugin from 'tailwindcss/plugin';
51
-
52
- module.exports = createPlugin(function({ addUtilities, theme, e }) {
53
- // Optional: Add custom utilities here
54
- // Example: Custom shadow utilities
55
- // const shadows = theme('boxShadow') || {};
56
- // const shadowUtils = Object.entries(shadows).reduce((acc, [key, value]) => {
57
- // acc['.' + e('shadow-' + key)] = { boxShadow: value };
58
- // return acc;
59
- // }, {});
60
- // addUtilities(shadowUtils);
61
- }, ${themeSection});
62
- `.trim();
63
- }
64
- };
65
- //# sourceMappingURL=tailwindFormat2.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tailwindFormat2.js","sourceRoot":"","sources":["../../../src/formats/tailwind/tailwindFormat2.ts"],"names":[],"mappings":";AAAA,kBAAkB;;;AAGlB,qEAA+D;AAE/D,aAAa;AAEb;;;GAGG;AACU,QAAA,sBAAsB,GAAW;IAC1C,IAAI,EAAE,oBAAoB;IAC1B,MAAM,CAAC,EAAE,UAAU,EAAE,OAAO,EAG3B;QACG,MAAM,MAAM,GAAG,IAAA,4CAAmB,EAAC,UAAU,CAAC,SAAS,EAAE,OAAO,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC;QAC1F,MAAM,MAAM,GAAG;;;;;;kFAM2D,CAAC;QAE3E,OAAO;EACb,MAAM;;;;mBAIW,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;SACzC,CAAC,IAAI,EAAE,CAAC;IACb,CAAC;CACJ,CAAC;AAEF;;;;GAIG;AACU,QAAA,sBAAsB,GAAW;IAC1C,IAAI,EAAE,oBAAoB;IAC1B,MAAM,CAAC,EAAE,UAAU,EAAE,OAAO,EAG3B;QACG,MAAM,MAAM,GAAG,IAAA,4CAAmB,EAAC,UAAU,CAAC,SAAS,EAAE,OAAO,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC;QAC1F,MAAM,YAAY,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAC3D,MAAM,MAAM,GAAG;;;;;;kFAM2D,CAAC;QAE3E,OAAO,GAAG,MAAM;;;;;;;;;;;;;KAanB,YAAY;CAChB,CAAC,IAAI,EAAE,CAAC;IACL,CAAC;CACJ,CAAC"}
@@ -1,61 +0,0 @@
1
- import type { Config as TailwindConfig } from 'tailwindcss';
2
- import type { DesignTokenType } from './DesignTokenType.js';
3
- /**
4
- * A valid key for the `theme` section of Tailwind config.
5
- *
6
- * @public
7
- */
8
- export type TailwindThemeKey = keyof NonNullable<TailwindConfig['theme']>;
9
- /**
10
- * Strategy describing how to map a token value under a given theme key.
11
- *
12
- * @private
13
- */
14
- type MappingStrategy = 'flat' | 'nested' | 'shadeMap' | 'shadow';
15
- /**
16
- * Function type for transforming token paths into Tailwind-compatible keys.
17
- * Can return either a string (for flat/shadow strategies) or an array (for nested/shadeMap strategies).
18
- *
19
- * @public
20
- */
21
- export type PathTransformFn = (path: ReadonlyArray<string>) => string | ReadonlyArray<string>;
22
- /**
23
- * Internal mapping definition: for a given Tailwind theme key,
24
- * which mapping strategy to apply when inserting tokens.
25
- *
26
- * @public
27
- */
28
- export interface IKeyMapping {
29
- readonly themeKey: TailwindThemeKey;
30
- readonly strategy: MappingStrategy;
31
- readonly pathTransform?: PathTransformFn;
32
- }
33
- /**
34
- * Set of supported design token types for validation.
35
- * Used only for logging; unsupported types are skipped.
36
- *
37
- * @public
38
- */
39
- export declare const SUPPORTED_TOKEN_TYPES: ReadonlyArray<DesignTokenType>;
40
- /**
41
- * Maps token-level `category` values (which MUST match Tailwind theme keys)
42
- * to Tailwind theme keys and the corresponding mapping strategy.
43
- *
44
- * This is the primary mapping: if a token specifies a `category` and it is
45
- * found here, it is used directly.
46
- *
47
- * @public
48
- */
49
- export declare const CATEGORY_TO_KEY_MAPPING: Partial<Record<TailwindThemeKey, IKeyMapping>>;
50
- /**
51
- * Fallback mapping from logical token type → Tailwind theme key + strategy.
52
- *
53
- * This is used when there is no valid `category` on the token.
54
- * It keeps the behavior close to the original formatter where routing
55
- * was based on `type`.
56
- *
57
- * @public
58
- */
59
- export declare const TOKEN_TYPE_TO_KEY_MAPPING: Partial<Record<DesignTokenType, IKeyMapping>>;
60
- export {};
61
- //# sourceMappingURL=TailwindPropertyMapping.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TailwindPropertyMapping.d.ts","sourceRoot":"","sources":["../../../../src/formats/tailwind/v3/TailwindPropertyMapping.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAM5D;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,WAAW,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;AAE1E;;;;GAIG;AACH,KAAK,eAAe,GAAG,MAAM,GAAG,QAAQ,GAAG,UAAU,GAAG,QAAQ,CAAC;AAEjE;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,KAAK,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;AAE9F;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IACxB,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAC;IACpC,QAAQ,CAAC,QAAQ,EAAE,eAAe,CAAC;IACnC,QAAQ,CAAC,aAAa,CAAC,EAAE,eAAe,CAAC;CAC5C;AAMD;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,EAAE,aAAa,CAAC,eAAe,CAwBhE,CAAC;AAMF;;;;;;;;GAQG;AACH,eAAO,MAAM,uBAAuB,EAAE,OAAO,CAAC,MAAM,CAAC,gBAAgB,EAAE,WAAW,CAAC,CAwNlF,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,yBAAyB,EAAE,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,WAAW,CAAC,CAwInF,CAAC"}