@breadstone-infrastructure/style-dictionary 0.0.206 → 0.0.210
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.
- package/CHANGELOG.md +182 -0
- package/formats/tailwind/v4/buildTailwindV4Config.d.ts +83 -0
- package/formats/tailwind/v4/buildTailwindV4Config.d.ts.map +1 -0
- package/formats/tailwind/v4/buildTailwindV4Config.js +338 -0
- package/formats/tailwind/v4/buildTailwindV4Config.js.map +1 -0
- package/formats/tailwind/v4/index.d.ts +2 -0
- package/formats/tailwind/v4/index.d.ts.map +1 -1
- package/formats/tailwind/v4/index.js +2 -0
- package/formats/tailwind/v4/index.js.map +1 -1
- package/formats/tailwind/v4/tailwindV4Format.d.ts +64 -0
- package/formats/tailwind/v4/tailwindV4Format.d.ts.map +1 -1
- package/formats/tailwind/v4/tailwindV4Format.js +82 -1
- package/formats/tailwind/v4/tailwindV4Format.js.map +1 -1
- package/package.json +3 -3
- package/formats/tailwind/DesignTokenType.d.ts +0 -10
- package/formats/tailwind/DesignTokenType.d.ts.map +0 -1
- package/formats/tailwind/DesignTokenType.js +0 -3
- package/formats/tailwind/DesignTokenType.js.map +0 -1
- package/formats/tailwind/TailwindPropertyMapping.d.ts +0 -61
- package/formats/tailwind/TailwindPropertyMapping.d.ts.map +0 -1
- package/formats/tailwind/TailwindPropertyMapping.js +0 -421
- package/formats/tailwind/TailwindPropertyMapping.js.map +0 -1
- package/formats/tailwind/buildTailwindConfig.d.ts +0 -23
- package/formats/tailwind/buildTailwindConfig.d.ts.map +0 -1
- package/formats/tailwind/buildTailwindConfig.js +0 -280
- package/formats/tailwind/buildTailwindConfig.js.map +0 -1
- package/formats/tailwind/index.d.ts +0 -3
- package/formats/tailwind/index.d.ts.map +0 -1
- package/formats/tailwind/index.js +0 -19
- package/formats/tailwind/index.js.map +0 -1
- package/formats/tailwind/tailwindFormat.d.ts +0 -13
- package/formats/tailwind/tailwindFormat.d.ts.map +0 -1
- package/formats/tailwind/tailwindFormat.js +0 -57
- package/formats/tailwind/tailwindFormat.js.map +0 -1
- package/formats/tailwind/tailwindFormat2.d.ts +0 -13
- package/formats/tailwind/tailwindFormat2.d.ts.map +0 -1
- package/formats/tailwind/tailwindFormat2.js +0 -65
- package/formats/tailwind/tailwindFormat2.js.map +0 -1
- package/formats/tailwind/v3/TailwindPropertyMapping.d.ts +0 -61
- package/formats/tailwind/v3/TailwindPropertyMapping.d.ts.map +0 -1
- package/formats/tailwind/v3/TailwindPropertyMapping.js +0 -421
- package/formats/tailwind/v3/TailwindPropertyMapping.js.map +0 -1
- package/formats/tailwind/v3/buildTailwindConfig.d.ts +0 -23
- package/formats/tailwind/v3/buildTailwindConfig.d.ts.map +0 -1
- package/formats/tailwind/v3/buildTailwindConfig.js +0 -281
- package/formats/tailwind/v3/buildTailwindConfig.js.map +0 -1
- package/formats/tailwind/v3/tailwindFormat.d.ts +0 -13
- package/formats/tailwind/v3/tailwindFormat.d.ts.map +0 -1
- package/formats/tailwind/v3/tailwindFormat.js +0 -57
- package/formats/tailwind/v3/tailwindFormat.js.map +0 -1
- package/formats/tailwind/v3/tailwindFormat2.d.ts +0 -13
- package/formats/tailwind/v3/tailwindFormat2.d.ts.map +0 -1
- package/formats/tailwind/v3/tailwindFormat2.js +0 -65
- package/formats/tailwind/v3/tailwindFormat2.js.map +0 -1
|
@@ -1,281 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/* eslint-disable max-depth */
|
|
3
|
-
// #region Imports
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.buildTailwindConfig = buildTailwindConfig;
|
|
6
|
-
const utilities_1 = require("@breadstone-infrastructure/utilities");
|
|
7
|
-
const getType_js_1 = require("../../../utilities/getType.js");
|
|
8
|
-
const getValue_js_1 = require("../../../utilities/getValue.js");
|
|
9
|
-
const TailwindPropertyMapping_js_1 = require("./TailwindPropertyMapping.js");
|
|
10
|
-
// #endregion
|
|
11
|
-
/**
|
|
12
|
-
* Normalizes a raw token value into a JS value suitable for a Tailwind config.
|
|
13
|
-
*
|
|
14
|
-
* @param value Raw token value.
|
|
15
|
-
* @returns Normalized value (string, number, or array) that can be used in Tailwind config.
|
|
16
|
-
* @private
|
|
17
|
-
*/
|
|
18
|
-
function normalizeValue(value) {
|
|
19
|
-
if (Array.isArray(value)) {
|
|
20
|
-
return value.map((v) => String(v));
|
|
21
|
-
}
|
|
22
|
-
if (typeof value === 'string' || typeof value === 'number') {
|
|
23
|
-
return value;
|
|
24
|
-
}
|
|
25
|
-
return String(value);
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Deeply sets a value on an object via a path array. Similar to lodash.set.
|
|
29
|
-
*
|
|
30
|
-
* @param obj Target object.
|
|
31
|
-
* @param path Array of keys.
|
|
32
|
-
* @param value Value to set.
|
|
33
|
-
* @private
|
|
34
|
-
*/
|
|
35
|
-
function deepSet(obj, path, value) {
|
|
36
|
-
let current = obj;
|
|
37
|
-
for (let i = 0; i < path.length; i++) {
|
|
38
|
-
const key = path[i];
|
|
39
|
-
if (i === path.length - 1) {
|
|
40
|
-
current[key] = value;
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
if (!current[key] || typeof current[key] !== 'object') {
|
|
44
|
-
current[key] = {};
|
|
45
|
-
}
|
|
46
|
-
current = current[key];
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Validates that tokens use supported logical types and logs warnings
|
|
52
|
-
* for those that cannot be mapped to Tailwind.
|
|
53
|
-
*
|
|
54
|
-
* This does not throw, it only logs — matching the original behavior.
|
|
55
|
-
*
|
|
56
|
-
* @param tokens All transformed tokens.
|
|
57
|
-
* @param ignoredNames Optional substrings; tokens whose name contains any of them are ignored.
|
|
58
|
-
* @private
|
|
59
|
-
*/
|
|
60
|
-
function validateTokenTypes(tokens, ignoredNames = []) {
|
|
61
|
-
const supported = new Set(TailwindPropertyMapping_js_1.SUPPORTED_TOKEN_TYPES);
|
|
62
|
-
tokens
|
|
63
|
-
.filter((token) => {
|
|
64
|
-
const lower = token.name.toLowerCase();
|
|
65
|
-
return !ignoredNames.some((substr) => lower.includes(substr.toLowerCase()));
|
|
66
|
-
})
|
|
67
|
-
.forEach((token) => {
|
|
68
|
-
// If token has a valid category mapping, skip type validation
|
|
69
|
-
const rawCategory = token.category;
|
|
70
|
-
if (rawCategory) {
|
|
71
|
-
const categoryKey = rawCategory;
|
|
72
|
-
if (TailwindPropertyMapping_js_1.CATEGORY_TO_KEY_MAPPING[categoryKey]) {
|
|
73
|
-
return; // Category is valid, no need to check type
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
const type = (0, getType_js_1.getType)(token);
|
|
77
|
-
if (!type) {
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
if (!supported.has(type)) {
|
|
81
|
-
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}".`)}`);
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Resolves the mapping for a token in three steps:
|
|
87
|
-
*
|
|
88
|
-
* 1. If a `category` is present and mapped, use that mapping.
|
|
89
|
-
* 2. Otherwise, fall back to token type via `getType` and `TOKEN_TYPE_TO_KEY_MAPPING`.
|
|
90
|
-
* 3. If neither yields a mapping, return undefined (caller will log and skip).
|
|
91
|
-
*
|
|
92
|
-
* @param token The token to resolve mapping for.
|
|
93
|
-
* @returns An IKeyMapping when resolvable, otherwise undefined.
|
|
94
|
-
* @private
|
|
95
|
-
*/
|
|
96
|
-
function resolveMappingForToken(token) {
|
|
97
|
-
const rawCategory = token.category;
|
|
98
|
-
// 1. Category-based mapping (if present)
|
|
99
|
-
if (rawCategory) {
|
|
100
|
-
const categoryKey = rawCategory;
|
|
101
|
-
const byCategory = TailwindPropertyMapping_js_1.CATEGORY_TO_KEY_MAPPING[categoryKey];
|
|
102
|
-
if (byCategory) {
|
|
103
|
-
return byCategory;
|
|
104
|
-
}
|
|
105
|
-
// Category was provided but not recognized; we fall back to type-based logic.
|
|
106
|
-
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.`)}`);
|
|
107
|
-
}
|
|
108
|
-
// 2. Type-based mapping
|
|
109
|
-
// Try multiple type properties: token.type (set by transforms), token.$type (original), token.original.type, token.original.$type
|
|
110
|
-
const type = (token.type ?? token.$type ?? token.original.type ?? token.original.$type);
|
|
111
|
-
if (type) {
|
|
112
|
-
const byType = TailwindPropertyMapping_js_1.TOKEN_TYPE_TO_KEY_MAPPING[type];
|
|
113
|
-
if (byType) {
|
|
114
|
-
return byType;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
// 3. Nothing found: no mapping available
|
|
118
|
-
return undefined;
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* Builds a TailwindConfig object (with `theme.extend`) from a list of Style-Dictionary tokens.
|
|
122
|
-
*
|
|
123
|
-
* Resolution priority per token:
|
|
124
|
-
*
|
|
125
|
-
* 1. If `token.category` is present and matches a known Tailwind theme key
|
|
126
|
-
* (configured in CATEGORY_TO_KEY_MAPPING), that mapping is used.
|
|
127
|
-
* 2. Otherwise, the token's logical type (`getType(token)`) is used with
|
|
128
|
-
* TOKEN_TYPE_TO_KEY_MAPPING as a fallback routing.
|
|
129
|
-
* 3. If neither category nor type yields a mapping, the token is skipped
|
|
130
|
-
* and a warning is logged.
|
|
131
|
-
*
|
|
132
|
-
* Additionally, this function validates token types up-front and logs warnings
|
|
133
|
-
* for unsupported types (non-blocking).
|
|
134
|
-
*
|
|
135
|
-
* @param allTokens All transformed tokens from Style-Dictionary.
|
|
136
|
-
* @param ignoredTokenNameSubstrings Optional substrings; tokens whose name contains any of them are ignored entirely.
|
|
137
|
-
* @returns A TailwindConfig where `theme.extend` contains the mapped tokens.
|
|
138
|
-
*/
|
|
139
|
-
function buildTailwindConfig(allTokens, ignoredTokenNameSubstrings = []) {
|
|
140
|
-
// Pre-validation of token types (non-blocking, only logs)
|
|
141
|
-
validateTokenTypes(allTokens, ignoredTokenNameSubstrings);
|
|
142
|
-
const config = { theme: { extend: {} } };
|
|
143
|
-
for (const token of allTokens) {
|
|
144
|
-
const lowerName = token.name.toLowerCase();
|
|
145
|
-
const tokenPath = token.path.join('.');
|
|
146
|
-
// Check if any ignored substring appears in the token name OR path
|
|
147
|
-
if (ignoredTokenNameSubstrings.some((substr) => lowerName.includes(substr.toLowerCase()) ||
|
|
148
|
-
tokenPath.toLowerCase().includes(substr.toLowerCase()))) {
|
|
149
|
-
continue;
|
|
150
|
-
}
|
|
151
|
-
// Skip expanded shadow parts (offsetX, offsetY, blur, spread, color sub-tokens)
|
|
152
|
-
// These are created by expandShadowPreprocessor and should be ignored for Tailwind
|
|
153
|
-
const shadowPartPattern = /\.(offsetX|offsetY|blur|spread|color)\.\d+$/i;
|
|
154
|
-
if (shadowPartPattern.test(tokenPath)) {
|
|
155
|
-
continue;
|
|
156
|
-
}
|
|
157
|
-
// Skip duration tokens (they're typically enums/metadata)
|
|
158
|
-
if (token.path[0] === 'duration' && !token.value) {
|
|
159
|
-
continue;
|
|
160
|
-
}
|
|
161
|
-
const mapping = resolveMappingForToken(token);
|
|
162
|
-
if (!mapping) {
|
|
163
|
-
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.`)}`);
|
|
164
|
-
continue;
|
|
165
|
-
}
|
|
166
|
-
const { themeKey, strategy } = mapping;
|
|
167
|
-
if (!config.theme?.extend) {
|
|
168
|
-
if (!config.theme) {
|
|
169
|
-
config.theme = {};
|
|
170
|
-
config.theme.extend = {};
|
|
171
|
-
}
|
|
172
|
-
else {
|
|
173
|
-
config.theme.extend = {};
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
const extend = config.theme.extend;
|
|
177
|
-
// eslint-disable-next-line no-multi-assign
|
|
178
|
-
const section = extend[themeKey] ??= {};
|
|
179
|
-
const rawValue = (0, getValue_js_1.getValue)(token);
|
|
180
|
-
const normalized = normalizeValue(rawValue);
|
|
181
|
-
const rawPath = token.path.length > 0 ? token.path : [token.name];
|
|
182
|
-
// Apply pathTransform if defined
|
|
183
|
-
const transformedPath = mapping.pathTransform
|
|
184
|
-
? mapping.pathTransform(rawPath)
|
|
185
|
-
: rawPath;
|
|
186
|
-
// Warn if pathTransform returned original path unchanged (meaning it couldn't transform)
|
|
187
|
-
// Compare content, not reference, for arrays
|
|
188
|
-
const pathsAreEqual = Array.isArray(transformedPath) && Array.isArray(rawPath)
|
|
189
|
-
? transformedPath.length === rawPath.length && transformedPath.every((val, idx) => val === rawPath[idx])
|
|
190
|
-
: transformedPath === rawPath;
|
|
191
|
-
if (mapping.pathTransform && pathsAreEqual) {
|
|
192
|
-
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.`)}`);
|
|
193
|
-
}
|
|
194
|
-
switch (strategy) {
|
|
195
|
-
case 'flat': {
|
|
196
|
-
// For flat strategy, use the transformed path as a single key
|
|
197
|
-
const key = typeof transformedPath === 'string'
|
|
198
|
-
? transformedPath
|
|
199
|
-
: Array.isArray(transformedPath)
|
|
200
|
-
? transformedPath.join('-')
|
|
201
|
-
: rawPath.join('-');
|
|
202
|
-
section[key] = normalized;
|
|
203
|
-
break;
|
|
204
|
-
}
|
|
205
|
-
case 'nested': {
|
|
206
|
-
// For nested strategy, split the transformed path if it's a string
|
|
207
|
-
const path = typeof transformedPath === 'string'
|
|
208
|
-
? transformedPath.split('.')
|
|
209
|
-
: Array.isArray(transformedPath)
|
|
210
|
-
? transformedPath
|
|
211
|
-
: rawPath;
|
|
212
|
-
deepSet(section, path, normalized);
|
|
213
|
-
break;
|
|
214
|
-
}
|
|
215
|
-
case 'shadeMap': {
|
|
216
|
-
// For shadeMap strategy, use the transformed path as array [group, shade]
|
|
217
|
-
// Example: ['primary', '500'] -> colors.primary['500']
|
|
218
|
-
// Example: ['primary-dark', '500'] -> colors['primary-dark']['500']
|
|
219
|
-
// Special case: if only DEFAULT exists, output direct value instead of { DEFAULT: value }
|
|
220
|
-
const path = Array.isArray(transformedPath)
|
|
221
|
-
? transformedPath
|
|
222
|
-
: typeof transformedPath === 'string'
|
|
223
|
-
? transformedPath.split('-')
|
|
224
|
-
: rawPath;
|
|
225
|
-
const [group, ...rest] = path;
|
|
226
|
-
const shadeKey = rest.join('-') || 'DEFAULT';
|
|
227
|
-
// If this is the first value for this group, we don't know yet if it will be a single value or object
|
|
228
|
-
// Store values temporarily and resolve at the end
|
|
229
|
-
section[group] ??= {};
|
|
230
|
-
section[group][shadeKey] = normalized;
|
|
231
|
-
break;
|
|
232
|
-
}
|
|
233
|
-
case 'shadow': {
|
|
234
|
-
// For shadow strategy, use the transformed path as a single key
|
|
235
|
-
const key = typeof transformedPath === 'string'
|
|
236
|
-
? transformedPath
|
|
237
|
-
: Array.isArray(transformedPath)
|
|
238
|
-
? transformedPath.join('-')
|
|
239
|
-
: rawPath.join('-');
|
|
240
|
-
section[key] = Array.isArray(normalized) ? normalized.map((v) => String(v)).join(', ') : String(normalized);
|
|
241
|
-
break;
|
|
242
|
-
}
|
|
243
|
-
default: {
|
|
244
|
-
console.warn(`${(0, utilities_1.symbol)('warning')} ${(0, utilities_1.yellow)(`Unsupported mapping strategy "${String(strategy)}" for token "${token.name}".`)}`);
|
|
245
|
-
break;
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
// Post-process: normalize single-entry objects to use DEFAULT key
|
|
250
|
-
// If a category has only one key-value pair that is NOT already "DEFAULT", rename it to "DEFAULT"
|
|
251
|
-
// Example: { "borderRadius": { "layout-radius": "12px" } } -> { "borderRadius": { "DEFAULT": "12px" } }
|
|
252
|
-
if (config.theme?.extend) {
|
|
253
|
-
const extend = config.theme.extend;
|
|
254
|
-
for (const [categoryKey, categoryValue] of Object.entries(extend)) {
|
|
255
|
-
if (typeof categoryValue === 'object' && categoryValue !== null && !Array.isArray(categoryValue)) {
|
|
256
|
-
const obj = categoryValue;
|
|
257
|
-
const keys = Object.keys(obj);
|
|
258
|
-
// If only one entry exists and it's not already "DEFAULT", rename it to "DEFAULT"
|
|
259
|
-
if (keys.length === 1 && keys[0] !== 'DEFAULT') {
|
|
260
|
-
const value = obj[keys[0]];
|
|
261
|
-
extend[categoryKey] = { DEFAULT: value };
|
|
262
|
-
}
|
|
263
|
-
else if (categoryKey === 'colors') {
|
|
264
|
-
// For colors, recursively normalize nested single-entry objects to use DEFAULT
|
|
265
|
-
// Example: { "background": { "some-key": "..." } } -> { "background": { "DEFAULT": "..." } }
|
|
266
|
-
for (const [colorKey, colorValue] of Object.entries(obj)) {
|
|
267
|
-
if (typeof colorValue === 'object' && colorValue !== null && !Array.isArray(colorValue)) {
|
|
268
|
-
const colorObj = colorValue;
|
|
269
|
-
const colorKeys = Object.keys(colorObj);
|
|
270
|
-
if (colorKeys.length === 1 && colorKeys[0] !== 'DEFAULT') {
|
|
271
|
-
obj[colorKey] = { DEFAULT: colorObj[colorKeys[0]] };
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
return config;
|
|
280
|
-
}
|
|
281
|
-
//# sourceMappingURL=buildTailwindConfig.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"buildTailwindConfig.js","sourceRoot":"","sources":["../../../../src/formats/tailwind/v3/buildTailwindConfig.ts"],"names":[],"mappings":";AAAA,8BAA8B;AAC9B,kBAAkB;;AA0JlB,kDAgKC;AAtTD,oEAAsE;AACtE,8DAAwD;AACxD,gEAA0D;AAE1D,6E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
-
* 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/v3/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/v3/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/v3/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/v3/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"}
|