@telepix-lab/telepix-ui 0.9.2 → 0.9.3
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/dist/cjs/client.js +358 -650
- package/dist/cjs/index.js +190 -434
- package/dist/color.css +1 -1
- package/dist/esm/client.js +358 -650
- package/dist/esm/index.js +190 -434
- package/dist/styles.css +1 -1
- package/dist/theme.css +1 -1
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -7,36 +7,7 @@ var sonner = require('sonner');
|
|
|
7
7
|
|
|
8
8
|
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
|
|
9
9
|
|
|
10
|
-
/**
|
|
11
|
-
* Concatenates two arrays faster than the array spread operator.
|
|
12
|
-
*/
|
|
13
|
-
const concatArrays = (array1, array2) => {
|
|
14
|
-
// Pre-allocate for better V8 optimization
|
|
15
|
-
const combinedArray = new Array(array1.length + array2.length);
|
|
16
|
-
for (let i = 0; i < array1.length; i++) {
|
|
17
|
-
combinedArray[i] = array1[i];
|
|
18
|
-
}
|
|
19
|
-
for (let i = 0; i < array2.length; i++) {
|
|
20
|
-
combinedArray[array1.length + i] = array2[i];
|
|
21
|
-
}
|
|
22
|
-
return combinedArray;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
// Factory function ensures consistent object shapes
|
|
26
|
-
const createClassValidatorObject = (classGroupId, validator) => ({
|
|
27
|
-
classGroupId,
|
|
28
|
-
validator
|
|
29
|
-
});
|
|
30
|
-
// Factory ensures consistent ClassPartObject shape
|
|
31
|
-
const createClassPartObject = (nextPart = new Map(), validators = null, classGroupId) => ({
|
|
32
|
-
nextPart,
|
|
33
|
-
validators,
|
|
34
|
-
classGroupId
|
|
35
|
-
});
|
|
36
10
|
const CLASS_PART_SEPARATOR = '-';
|
|
37
|
-
const EMPTY_CONFLICTS = [];
|
|
38
|
-
// I use two dots here because one dot is used as prefix for class groups in plugins
|
|
39
|
-
const ARBITRARY_PROPERTY_PREFIX = 'arbitrary..';
|
|
40
11
|
const createClassGroupUtils = config => {
|
|
41
12
|
const classMap = createClassMap(config);
|
|
42
13
|
const {
|
|
@@ -44,73 +15,54 @@ const createClassGroupUtils = config => {
|
|
|
44
15
|
conflictingClassGroupModifiers
|
|
45
16
|
} = config;
|
|
46
17
|
const getClassGroupId = className => {
|
|
47
|
-
if (className.startsWith('[') && className.endsWith(']')) {
|
|
48
|
-
return getGroupIdForArbitraryProperty(className);
|
|
49
|
-
}
|
|
50
18
|
const classParts = className.split(CLASS_PART_SEPARATOR);
|
|
51
|
-
// Classes like `-inset-1` produce an empty string as first classPart. We assume that classes for negative values are used correctly and
|
|
52
|
-
|
|
53
|
-
|
|
19
|
+
// Classes like `-inset-1` produce an empty string as first classPart. We assume that classes for negative values are used correctly and remove it from classParts.
|
|
20
|
+
if (classParts[0] === '' && classParts.length !== 1) {
|
|
21
|
+
classParts.shift();
|
|
22
|
+
}
|
|
23
|
+
return getGroupRecursive(classParts, classMap) || getGroupIdForArbitraryProperty(className);
|
|
54
24
|
};
|
|
55
25
|
const getConflictingClassGroupIds = (classGroupId, hasPostfixModifier) => {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
if (modifierConflicts) {
|
|
60
|
-
if (baseConflicts) {
|
|
61
|
-
// Merge base conflicts with modifier conflicts
|
|
62
|
-
return concatArrays(baseConflicts, modifierConflicts);
|
|
63
|
-
}
|
|
64
|
-
// Only modifier conflicts
|
|
65
|
-
return modifierConflicts;
|
|
66
|
-
}
|
|
67
|
-
// Fall back to without postfix if no modifier conflicts
|
|
68
|
-
return baseConflicts || EMPTY_CONFLICTS;
|
|
26
|
+
const conflicts = conflictingClassGroups[classGroupId] || [];
|
|
27
|
+
if (hasPostfixModifier && conflictingClassGroupModifiers[classGroupId]) {
|
|
28
|
+
return [...conflicts, ...conflictingClassGroupModifiers[classGroupId]];
|
|
69
29
|
}
|
|
70
|
-
return
|
|
30
|
+
return conflicts;
|
|
71
31
|
};
|
|
72
32
|
return {
|
|
73
33
|
getClassGroupId,
|
|
74
34
|
getConflictingClassGroupIds
|
|
75
35
|
};
|
|
76
36
|
};
|
|
77
|
-
const getGroupRecursive = (classParts,
|
|
78
|
-
|
|
79
|
-
if (classPathsLength === 0) {
|
|
37
|
+
const getGroupRecursive = (classParts, classPartObject) => {
|
|
38
|
+
if (classParts.length === 0) {
|
|
80
39
|
return classPartObject.classGroupId;
|
|
81
40
|
}
|
|
82
|
-
const currentClassPart = classParts[
|
|
41
|
+
const currentClassPart = classParts[0];
|
|
83
42
|
const nextClassPartObject = classPartObject.nextPart.get(currentClassPart);
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
43
|
+
const classGroupFromNextClassPart = nextClassPartObject ? getGroupRecursive(classParts.slice(1), nextClassPartObject) : undefined;
|
|
44
|
+
if (classGroupFromNextClassPart) {
|
|
45
|
+
return classGroupFromNextClassPart;
|
|
87
46
|
}
|
|
88
|
-
|
|
89
|
-
if (validators === null) {
|
|
47
|
+
if (classPartObject.validators.length === 0) {
|
|
90
48
|
return undefined;
|
|
91
49
|
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
50
|
+
const classRest = classParts.join(CLASS_PART_SEPARATOR);
|
|
51
|
+
return classPartObject.validators.find(({
|
|
52
|
+
validator
|
|
53
|
+
}) => validator(classRest))?.classGroupId;
|
|
54
|
+
};
|
|
55
|
+
const arbitraryPropertyRegex = /^\[(.+)\]$/;
|
|
56
|
+
const getGroupIdForArbitraryProperty = className => {
|
|
57
|
+
if (arbitraryPropertyRegex.test(className)) {
|
|
58
|
+
const arbitraryPropertyClassName = arbitraryPropertyRegex.exec(className)[1];
|
|
59
|
+
const property = arbitraryPropertyClassName?.substring(0, arbitraryPropertyClassName.indexOf(':'));
|
|
60
|
+
if (property) {
|
|
61
|
+
// I use two dots here because one dot is used as prefix for class groups in plugins
|
|
62
|
+
return 'arbitrary..' + property;
|
|
99
63
|
}
|
|
100
64
|
}
|
|
101
|
-
return undefined;
|
|
102
65
|
};
|
|
103
|
-
/**
|
|
104
|
-
* Get the class group ID for an arbitrary property.
|
|
105
|
-
*
|
|
106
|
-
* @param className - The class name to get the group ID for. Is expected to be string starting with `[` and ending with `]`.
|
|
107
|
-
*/
|
|
108
|
-
const getGroupIdForArbitraryProperty = className => className.slice(1, -1).indexOf(':') === -1 ? undefined : (() => {
|
|
109
|
-
const content = className.slice(1, -1);
|
|
110
|
-
const colonIndex = content.indexOf(':');
|
|
111
|
-
const property = content.slice(0, colonIndex);
|
|
112
|
-
return property ? ARBITRARY_PROPERTY_PREFIX + property : undefined;
|
|
113
|
-
})();
|
|
114
66
|
/**
|
|
115
67
|
* Exported for testing only
|
|
116
68
|
*/
|
|
@@ -119,77 +71,54 @@ const createClassMap = config => {
|
|
|
119
71
|
theme,
|
|
120
72
|
classGroups
|
|
121
73
|
} = config;
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
const classMap = createClassPartObject();
|
|
74
|
+
const classMap = {
|
|
75
|
+
nextPart: new Map(),
|
|
76
|
+
validators: []
|
|
77
|
+
};
|
|
127
78
|
for (const classGroupId in classGroups) {
|
|
128
|
-
|
|
129
|
-
processClassesRecursively(group, classMap, classGroupId, theme);
|
|
79
|
+
processClassesRecursively(classGroups[classGroupId], classMap, classGroupId, theme);
|
|
130
80
|
}
|
|
131
81
|
return classMap;
|
|
132
82
|
};
|
|
133
83
|
const processClassesRecursively = (classGroup, classPartObject, classGroupId, theme) => {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
};
|
|
156
|
-
const processFunctionDefinition = (classDefinition, classPartObject, classGroupId, theme) => {
|
|
157
|
-
if (isThemeGetter(classDefinition)) {
|
|
158
|
-
processClassesRecursively(classDefinition(theme), classPartObject, classGroupId, theme);
|
|
159
|
-
return;
|
|
160
|
-
}
|
|
161
|
-
if (classPartObject.validators === null) {
|
|
162
|
-
classPartObject.validators = [];
|
|
163
|
-
}
|
|
164
|
-
classPartObject.validators.push(createClassValidatorObject(classGroupId, classDefinition));
|
|
165
|
-
};
|
|
166
|
-
const processObjectDefinition = (classDefinition, classPartObject, classGroupId, theme) => {
|
|
167
|
-
const entries = Object.entries(classDefinition);
|
|
168
|
-
const len = entries.length;
|
|
169
|
-
for (let i = 0; i < len; i++) {
|
|
170
|
-
const [key, value] = entries[i];
|
|
171
|
-
processClassesRecursively(value, getPart(classPartObject, key), classGroupId, theme);
|
|
172
|
-
}
|
|
84
|
+
classGroup.forEach(classDefinition => {
|
|
85
|
+
if (typeof classDefinition === 'string') {
|
|
86
|
+
const classPartObjectToEdit = classDefinition === '' ? classPartObject : getPart(classPartObject, classDefinition);
|
|
87
|
+
classPartObjectToEdit.classGroupId = classGroupId;
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
if (typeof classDefinition === 'function') {
|
|
91
|
+
if (isThemeGetter(classDefinition)) {
|
|
92
|
+
processClassesRecursively(classDefinition(theme), classPartObject, classGroupId, theme);
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
classPartObject.validators.push({
|
|
96
|
+
validator: classDefinition,
|
|
97
|
+
classGroupId
|
|
98
|
+
});
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
Object.entries(classDefinition).forEach(([key, classGroup]) => {
|
|
102
|
+
processClassesRecursively(classGroup, getPart(classPartObject, key), classGroupId, theme);
|
|
103
|
+
});
|
|
104
|
+
});
|
|
173
105
|
};
|
|
174
106
|
const getPart = (classPartObject, path) => {
|
|
175
|
-
let
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
}
|
|
187
|
-
return current;
|
|
107
|
+
let currentClassPartObject = classPartObject;
|
|
108
|
+
path.split(CLASS_PART_SEPARATOR).forEach(pathPart => {
|
|
109
|
+
if (!currentClassPartObject.nextPart.has(pathPart)) {
|
|
110
|
+
currentClassPartObject.nextPart.set(pathPart, {
|
|
111
|
+
nextPart: new Map(),
|
|
112
|
+
validators: []
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
currentClassPartObject = currentClassPartObject.nextPart.get(pathPart);
|
|
116
|
+
});
|
|
117
|
+
return currentClassPartObject;
|
|
188
118
|
};
|
|
189
|
-
|
|
190
|
-
const isThemeGetter = func => 'isThemeGetter' in func && func.isThemeGetter === true;
|
|
119
|
+
const isThemeGetter = func => func.isThemeGetter;
|
|
191
120
|
|
|
192
|
-
// LRU cache
|
|
121
|
+
// LRU cache inspired from hashlru (https://github.com/dominictarr/hashlru/blob/v1.0.4/index.js) but object replaced with Map to improve performance
|
|
193
122
|
const createLruCache = maxCacheSize => {
|
|
194
123
|
if (maxCacheSize < 1) {
|
|
195
124
|
return {
|
|
@@ -198,31 +127,31 @@ const createLruCache = maxCacheSize => {
|
|
|
198
127
|
};
|
|
199
128
|
}
|
|
200
129
|
let cacheSize = 0;
|
|
201
|
-
let cache =
|
|
202
|
-
let previousCache =
|
|
130
|
+
let cache = new Map();
|
|
131
|
+
let previousCache = new Map();
|
|
203
132
|
const update = (key, value) => {
|
|
204
|
-
cache
|
|
133
|
+
cache.set(key, value);
|
|
205
134
|
cacheSize++;
|
|
206
135
|
if (cacheSize > maxCacheSize) {
|
|
207
136
|
cacheSize = 0;
|
|
208
137
|
previousCache = cache;
|
|
209
|
-
cache =
|
|
138
|
+
cache = new Map();
|
|
210
139
|
}
|
|
211
140
|
};
|
|
212
141
|
return {
|
|
213
142
|
get(key) {
|
|
214
|
-
let value = cache
|
|
143
|
+
let value = cache.get(key);
|
|
215
144
|
if (value !== undefined) {
|
|
216
145
|
return value;
|
|
217
146
|
}
|
|
218
|
-
if ((value = previousCache
|
|
147
|
+
if ((value = previousCache.get(key)) !== undefined) {
|
|
219
148
|
update(key, value);
|
|
220
149
|
return value;
|
|
221
150
|
}
|
|
222
151
|
},
|
|
223
152
|
set(key, value) {
|
|
224
|
-
if (key
|
|
225
|
-
cache
|
|
153
|
+
if (cache.has(key)) {
|
|
154
|
+
cache.set(key, value);
|
|
226
155
|
} else {
|
|
227
156
|
update(key, value);
|
|
228
157
|
}
|
|
@@ -231,15 +160,7 @@ const createLruCache = maxCacheSize => {
|
|
|
231
160
|
};
|
|
232
161
|
const IMPORTANT_MODIFIER = '!';
|
|
233
162
|
const MODIFIER_SEPARATOR = ':';
|
|
234
|
-
const
|
|
235
|
-
// Pre-allocated result object shape for consistency
|
|
236
|
-
const createResultObject = (modifiers, hasImportantModifier, baseClassName, maybePostfixModifierPosition, isExternal) => ({
|
|
237
|
-
modifiers,
|
|
238
|
-
hasImportantModifier,
|
|
239
|
-
baseClassName,
|
|
240
|
-
maybePostfixModifierPosition,
|
|
241
|
-
isExternal
|
|
242
|
-
});
|
|
163
|
+
const MODIFIER_SEPARATOR_LENGTH = MODIFIER_SEPARATOR.length;
|
|
243
164
|
const createParseClassName = config => {
|
|
244
165
|
const {
|
|
245
166
|
prefix,
|
|
@@ -252,19 +173,17 @@ const createParseClassName = config => {
|
|
|
252
173
|
* @see https://github.com/tailwindlabs/tailwindcss/blob/v3.2.2/src/util/splitAtTopLevelOnly.js
|
|
253
174
|
*/
|
|
254
175
|
let parseClassName = className => {
|
|
255
|
-
// Use simple array with push for better performance
|
|
256
176
|
const modifiers = [];
|
|
257
177
|
let bracketDepth = 0;
|
|
258
178
|
let parenDepth = 0;
|
|
259
179
|
let modifierStart = 0;
|
|
260
180
|
let postfixModifierPosition;
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
const currentCharacter = className[index];
|
|
181
|
+
for (let index = 0; index < className.length; index++) {
|
|
182
|
+
let currentCharacter = className[index];
|
|
264
183
|
if (bracketDepth === 0 && parenDepth === 0) {
|
|
265
184
|
if (currentCharacter === MODIFIER_SEPARATOR) {
|
|
266
185
|
modifiers.push(className.slice(modifierStart, index));
|
|
267
|
-
modifierStart = index +
|
|
186
|
+
modifierStart = index + MODIFIER_SEPARATOR_LENGTH;
|
|
268
187
|
continue;
|
|
269
188
|
}
|
|
270
189
|
if (currentCharacter === '/') {
|
|
@@ -272,31 +191,37 @@ const createParseClassName = config => {
|
|
|
272
191
|
continue;
|
|
273
192
|
}
|
|
274
193
|
}
|
|
275
|
-
if (currentCharacter === '[')
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
} else if (
|
|
285
|
-
/**
|
|
286
|
-
* In Tailwind CSS v3 the important modifier was at the start of the base class name. This is still supported for legacy reasons.
|
|
287
|
-
* @see https://github.com/dcastil/tailwind-merge/issues/513#issuecomment-2614029864
|
|
288
|
-
*/
|
|
289
|
-
baseClassNameWithImportantModifier.startsWith(IMPORTANT_MODIFIER)) {
|
|
290
|
-
baseClassName = baseClassNameWithImportantModifier.slice(1);
|
|
291
|
-
hasImportantModifier = true;
|
|
194
|
+
if (currentCharacter === '[') {
|
|
195
|
+
bracketDepth++;
|
|
196
|
+
} else if (currentCharacter === ']') {
|
|
197
|
+
bracketDepth--;
|
|
198
|
+
} else if (currentCharacter === '(') {
|
|
199
|
+
parenDepth++;
|
|
200
|
+
} else if (currentCharacter === ')') {
|
|
201
|
+
parenDepth--;
|
|
202
|
+
}
|
|
292
203
|
}
|
|
204
|
+
const baseClassNameWithImportantModifier = modifiers.length === 0 ? className : className.substring(modifierStart);
|
|
205
|
+
const baseClassName = stripImportantModifier(baseClassNameWithImportantModifier);
|
|
206
|
+
const hasImportantModifier = baseClassName !== baseClassNameWithImportantModifier;
|
|
293
207
|
const maybePostfixModifierPosition = postfixModifierPosition && postfixModifierPosition > modifierStart ? postfixModifierPosition - modifierStart : undefined;
|
|
294
|
-
return
|
|
208
|
+
return {
|
|
209
|
+
modifiers,
|
|
210
|
+
hasImportantModifier,
|
|
211
|
+
baseClassName,
|
|
212
|
+
maybePostfixModifierPosition
|
|
213
|
+
};
|
|
295
214
|
};
|
|
296
215
|
if (prefix) {
|
|
297
216
|
const fullPrefix = prefix + MODIFIER_SEPARATOR;
|
|
298
217
|
const parseClassNameOriginal = parseClassName;
|
|
299
|
-
parseClassName = className => className.startsWith(fullPrefix) ? parseClassNameOriginal(className.
|
|
218
|
+
parseClassName = className => className.startsWith(fullPrefix) ? parseClassNameOriginal(className.substring(fullPrefix.length)) : {
|
|
219
|
+
isExternal: true,
|
|
220
|
+
modifiers: [],
|
|
221
|
+
hasImportantModifier: false,
|
|
222
|
+
baseClassName: className,
|
|
223
|
+
maybePostfixModifierPosition: undefined
|
|
224
|
+
};
|
|
300
225
|
}
|
|
301
226
|
if (experimentalParseClassName) {
|
|
302
227
|
const parseClassNameOriginal = parseClassName;
|
|
@@ -307,6 +232,19 @@ const createParseClassName = config => {
|
|
|
307
232
|
}
|
|
308
233
|
return parseClassName;
|
|
309
234
|
};
|
|
235
|
+
const stripImportantModifier = baseClassName => {
|
|
236
|
+
if (baseClassName.endsWith(IMPORTANT_MODIFIER)) {
|
|
237
|
+
return baseClassName.substring(0, baseClassName.length - 1);
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* In Tailwind CSS v3 the important modifier was at the start of the base class name. This is still supported for legacy reasons.
|
|
241
|
+
* @see https://github.com/dcastil/tailwind-merge/issues/513#issuecomment-2614029864
|
|
242
|
+
*/
|
|
243
|
+
if (baseClassName.startsWith(IMPORTANT_MODIFIER)) {
|
|
244
|
+
return baseClassName.substring(1);
|
|
245
|
+
}
|
|
246
|
+
return baseClassName;
|
|
247
|
+
};
|
|
310
248
|
|
|
311
249
|
/**
|
|
312
250
|
* Sorts modifiers according to following schema:
|
|
@@ -314,41 +252,26 @@ const createParseClassName = config => {
|
|
|
314
252
|
* - When an arbitrary variant appears, it must be preserved which modifiers are before and after it
|
|
315
253
|
*/
|
|
316
254
|
const createSortModifiers = config => {
|
|
317
|
-
|
|
318
|
-
const
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
// Check if modifier is sensitive (starts with '[' or in orderSensitiveModifiers)
|
|
330
|
-
const isArbitrary = modifier[0] === '[';
|
|
331
|
-
const isOrderSensitive = modifierWeights.has(modifier);
|
|
332
|
-
if (isArbitrary || isOrderSensitive) {
|
|
333
|
-
// Sort and flush current segment alphabetically
|
|
334
|
-
if (currentSegment.length > 0) {
|
|
335
|
-
currentSegment.sort();
|
|
336
|
-
result.push(...currentSegment);
|
|
337
|
-
currentSegment = [];
|
|
338
|
-
}
|
|
339
|
-
result.push(modifier);
|
|
255
|
+
const orderSensitiveModifiers = Object.fromEntries(config.orderSensitiveModifiers.map(modifier => [modifier, true]));
|
|
256
|
+
const sortModifiers = modifiers => {
|
|
257
|
+
if (modifiers.length <= 1) {
|
|
258
|
+
return modifiers;
|
|
259
|
+
}
|
|
260
|
+
const sortedModifiers = [];
|
|
261
|
+
let unsortedModifiers = [];
|
|
262
|
+
modifiers.forEach(modifier => {
|
|
263
|
+
const isPositionSensitive = modifier[0] === '[' || orderSensitiveModifiers[modifier];
|
|
264
|
+
if (isPositionSensitive) {
|
|
265
|
+
sortedModifiers.push(...unsortedModifiers.sort(), modifier);
|
|
266
|
+
unsortedModifiers = [];
|
|
340
267
|
} else {
|
|
341
|
-
|
|
342
|
-
currentSegment.push(modifier);
|
|
268
|
+
unsortedModifiers.push(modifier);
|
|
343
269
|
}
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
currentSegment.sort();
|
|
348
|
-
result.push(...currentSegment);
|
|
349
|
-
}
|
|
350
|
-
return result;
|
|
270
|
+
});
|
|
271
|
+
sortedModifiers.push(...unsortedModifiers.sort());
|
|
272
|
+
return sortedModifiers;
|
|
351
273
|
};
|
|
274
|
+
return sortModifiers;
|
|
352
275
|
};
|
|
353
276
|
const createConfigUtils = config => ({
|
|
354
277
|
cache: createLruCache(config.cacheSize),
|
|
@@ -403,11 +326,10 @@ const mergeClassList = (classList, configUtils) => {
|
|
|
403
326
|
}
|
|
404
327
|
hasPostfixModifier = false;
|
|
405
328
|
}
|
|
406
|
-
|
|
407
|
-
const variantModifier = modifiers.length === 0 ? '' : modifiers.length === 1 ? modifiers[0] : sortModifiers(modifiers).join(':');
|
|
329
|
+
const variantModifier = sortModifiers(modifiers).join(':');
|
|
408
330
|
const modifierId = hasImportantModifier ? variantModifier + IMPORTANT_MODIFIER : variantModifier;
|
|
409
331
|
const classId = modifierId + classGroupId;
|
|
410
|
-
if (classGroupsInConflict.
|
|
332
|
+
if (classGroupsInConflict.includes(classId)) {
|
|
411
333
|
// Tailwind class omitted due to conflict
|
|
412
334
|
continue;
|
|
413
335
|
}
|
|
@@ -432,13 +354,13 @@ const mergeClassList = (classList, configUtils) => {
|
|
|
432
354
|
*
|
|
433
355
|
* Original code has MIT license: Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeed.com)
|
|
434
356
|
*/
|
|
435
|
-
|
|
357
|
+
function twJoin() {
|
|
436
358
|
let index = 0;
|
|
437
359
|
let argument;
|
|
438
360
|
let resolvedValue;
|
|
439
361
|
let string = '';
|
|
440
|
-
while (index <
|
|
441
|
-
if (argument =
|
|
362
|
+
while (index < arguments.length) {
|
|
363
|
+
if (argument = arguments[index++]) {
|
|
442
364
|
if (resolvedValue = toValue(argument)) {
|
|
443
365
|
string && (string += ' ');
|
|
444
366
|
string += resolvedValue;
|
|
@@ -446,9 +368,8 @@ const twJoin = (...classLists) => {
|
|
|
446
368
|
}
|
|
447
369
|
}
|
|
448
370
|
return string;
|
|
449
|
-
}
|
|
371
|
+
}
|
|
450
372
|
const toValue = mix => {
|
|
451
|
-
// Fast path for strings
|
|
452
373
|
if (typeof mix === 'string') {
|
|
453
374
|
return mix;
|
|
454
375
|
}
|
|
@@ -464,20 +385,20 @@ const toValue = mix => {
|
|
|
464
385
|
}
|
|
465
386
|
return string;
|
|
466
387
|
};
|
|
467
|
-
|
|
388
|
+
function createTailwindMerge(createConfigFirst, ...createConfigRest) {
|
|
468
389
|
let configUtils;
|
|
469
390
|
let cacheGet;
|
|
470
391
|
let cacheSet;
|
|
471
|
-
let functionToCall;
|
|
472
|
-
|
|
392
|
+
let functionToCall = initTailwindMerge;
|
|
393
|
+
function initTailwindMerge(classList) {
|
|
473
394
|
const config = createConfigRest.reduce((previousConfig, createConfigCurrent) => createConfigCurrent(previousConfig), createConfigFirst());
|
|
474
395
|
configUtils = createConfigUtils(config);
|
|
475
396
|
cacheGet = configUtils.cache.get;
|
|
476
397
|
cacheSet = configUtils.cache.set;
|
|
477
398
|
functionToCall = tailwindMerge;
|
|
478
399
|
return tailwindMerge(classList);
|
|
479
|
-
}
|
|
480
|
-
|
|
400
|
+
}
|
|
401
|
+
function tailwindMerge(classList) {
|
|
481
402
|
const cachedResult = cacheGet(classList);
|
|
482
403
|
if (cachedResult) {
|
|
483
404
|
return cachedResult;
|
|
@@ -485,19 +406,19 @@ const createTailwindMerge = (createConfigFirst, ...createConfigRest) => {
|
|
|
485
406
|
const result = mergeClassList(classList, configUtils);
|
|
486
407
|
cacheSet(classList, result);
|
|
487
408
|
return result;
|
|
409
|
+
}
|
|
410
|
+
return function callTailwindMerge() {
|
|
411
|
+
return functionToCall(twJoin.apply(null, arguments));
|
|
488
412
|
};
|
|
489
|
-
|
|
490
|
-
return (...args) => functionToCall(twJoin(...args));
|
|
491
|
-
};
|
|
492
|
-
const fallbackThemeArr = [];
|
|
413
|
+
}
|
|
493
414
|
const fromTheme = key => {
|
|
494
|
-
const themeGetter = theme => theme[key] ||
|
|
415
|
+
const themeGetter = theme => theme[key] || [];
|
|
495
416
|
themeGetter.isThemeGetter = true;
|
|
496
417
|
return themeGetter;
|
|
497
418
|
};
|
|
498
419
|
const arbitraryValueRegex = /^\[(?:(\w[\w-]*):)?(.+)\]$/i;
|
|
499
420
|
const arbitraryVariableRegex = /^\((?:(\w[\w-]*):)?(.+)\)$/i;
|
|
500
|
-
const fractionRegex = /^\d
|
|
421
|
+
const fractionRegex = /^\d+\/\d+$/;
|
|
501
422
|
const tshirtUnitRegex = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/;
|
|
502
423
|
const lengthUnitRegex = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/;
|
|
503
424
|
const colorFunctionRegex = /^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/;
|
|
@@ -523,8 +444,6 @@ const isArbitrarySize = value => getIsArbitraryValue(value, isLabelSize, isNever
|
|
|
523
444
|
const isArbitraryValue = value => arbitraryValueRegex.test(value);
|
|
524
445
|
const isArbitraryLength = value => getIsArbitraryValue(value, isLabelLength, isLengthOnly);
|
|
525
446
|
const isArbitraryNumber = value => getIsArbitraryValue(value, isLabelNumber, isNumber);
|
|
526
|
-
const isArbitraryWeight = value => getIsArbitraryValue(value, isLabelWeight, isAny);
|
|
527
|
-
const isArbitraryFamilyName = value => getIsArbitraryValue(value, isLabelFamilyName, isNever);
|
|
528
447
|
const isArbitraryPosition = value => getIsArbitraryValue(value, isLabelPosition, isNever);
|
|
529
448
|
const isArbitraryImage = value => getIsArbitraryValue(value, isLabelImage, isImage);
|
|
530
449
|
const isArbitraryShadow = value => getIsArbitraryValue(value, isLabelShadow, isShadow);
|
|
@@ -535,7 +454,6 @@ const isArbitraryVariablePosition = value => getIsArbitraryVariable(value, isLab
|
|
|
535
454
|
const isArbitraryVariableSize = value => getIsArbitraryVariable(value, isLabelSize);
|
|
536
455
|
const isArbitraryVariableImage = value => getIsArbitraryVariable(value, isLabelImage);
|
|
537
456
|
const isArbitraryVariableShadow = value => getIsArbitraryVariable(value, isLabelShadow, true);
|
|
538
|
-
const isArbitraryVariableWeight = value => getIsArbitraryVariable(value, isLabelWeight, true);
|
|
539
457
|
// Helpers
|
|
540
458
|
const getIsArbitraryValue = (value, testLabel, testValue) => {
|
|
541
459
|
const result = arbitraryValueRegex.exec(value);
|
|
@@ -564,7 +482,6 @@ const isLabelSize = label => label === 'length' || label === 'size' || label ===
|
|
|
564
482
|
const isLabelLength = label => label === 'length';
|
|
565
483
|
const isLabelNumber = label => label === 'number';
|
|
566
484
|
const isLabelFamilyName = label => label === 'family-name';
|
|
567
|
-
const isLabelWeight = label => label === 'number' || label === 'weight';
|
|
568
485
|
const isLabelShadow = label => label === 'shadow';
|
|
569
486
|
const getDefaultConfig = () => {
|
|
570
487
|
/**
|
|
@@ -623,8 +540,6 @@ const getDefaultConfig = () => {
|
|
|
623
540
|
const scaleAlignSecondaryAxis = () => ['start', 'end', 'center', 'stretch', 'center-safe', 'end-safe'];
|
|
624
541
|
const scaleMargin = () => ['auto', ...scaleUnambiguousSpacing()];
|
|
625
542
|
const scaleSizing = () => [isFraction, 'auto', 'full', 'dvw', 'dvh', 'lvw', 'lvh', 'svw', 'svh', 'min', 'max', 'fit', ...scaleUnambiguousSpacing()];
|
|
626
|
-
const scaleSizingInline = () => [isFraction, 'screen', 'full', 'dvw', 'lvw', 'svw', 'min', 'max', 'fit', ...scaleUnambiguousSpacing()];
|
|
627
|
-
const scaleSizingBlock = () => [isFraction, 'screen', 'full', 'lh', 'dvh', 'lvh', 'svh', 'min', 'max', 'fit', ...scaleUnambiguousSpacing()];
|
|
628
543
|
const scaleColor = () => [themeColor, isArbitraryVariable, isArbitraryValue];
|
|
629
544
|
const scaleBgPosition = () => [...scalePosition(), isArbitraryVariablePosition, isArbitraryPosition, {
|
|
630
545
|
position: [isArbitraryVariable, isArbitraryValue]
|
|
@@ -823,66 +738,40 @@ const getDefaultConfig = () => {
|
|
|
823
738
|
*/
|
|
824
739
|
position: ['static', 'fixed', 'absolute', 'relative', 'sticky'],
|
|
825
740
|
/**
|
|
826
|
-
*
|
|
741
|
+
* Top / Right / Bottom / Left
|
|
827
742
|
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
828
743
|
*/
|
|
829
744
|
inset: [{
|
|
830
745
|
inset: scaleInset()
|
|
831
746
|
}],
|
|
832
747
|
/**
|
|
833
|
-
*
|
|
748
|
+
* Right / Left
|
|
834
749
|
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
835
750
|
*/
|
|
836
751
|
'inset-x': [{
|
|
837
752
|
'inset-x': scaleInset()
|
|
838
753
|
}],
|
|
839
754
|
/**
|
|
840
|
-
*
|
|
755
|
+
* Top / Bottom
|
|
841
756
|
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
842
757
|
*/
|
|
843
758
|
'inset-y': [{
|
|
844
759
|
'inset-y': scaleInset()
|
|
845
760
|
}],
|
|
846
761
|
/**
|
|
847
|
-
*
|
|
762
|
+
* Start
|
|
848
763
|
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
849
|
-
* @todo class group will be renamed to `inset-s` in next major release
|
|
850
764
|
*/
|
|
851
765
|
start: [{
|
|
852
|
-
'inset-s': scaleInset(),
|
|
853
|
-
/**
|
|
854
|
-
* @deprecated since Tailwind CSS v4.2.0 in favor of `inset-s-*` utilities.
|
|
855
|
-
* @see https://github.com/tailwindlabs/tailwindcss/pull/19613
|
|
856
|
-
*/
|
|
857
766
|
start: scaleInset()
|
|
858
767
|
}],
|
|
859
768
|
/**
|
|
860
|
-
*
|
|
769
|
+
* End
|
|
861
770
|
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
862
|
-
* @todo class group will be renamed to `inset-e` in next major release
|
|
863
771
|
*/
|
|
864
772
|
end: [{
|
|
865
|
-
'inset-e': scaleInset(),
|
|
866
|
-
/**
|
|
867
|
-
* @deprecated since Tailwind CSS v4.2.0 in favor of `inset-e-*` utilities.
|
|
868
|
-
* @see https://github.com/tailwindlabs/tailwindcss/pull/19613
|
|
869
|
-
*/
|
|
870
773
|
end: scaleInset()
|
|
871
774
|
}],
|
|
872
|
-
/**
|
|
873
|
-
* Inset Block Start
|
|
874
|
-
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
875
|
-
*/
|
|
876
|
-
'inset-bs': [{
|
|
877
|
-
'inset-bs': scaleInset()
|
|
878
|
-
}],
|
|
879
|
-
/**
|
|
880
|
-
* Inset Block End
|
|
881
|
-
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
882
|
-
*/
|
|
883
|
-
'inset-be': [{
|
|
884
|
-
'inset-be': scaleInset()
|
|
885
|
-
}],
|
|
886
775
|
/**
|
|
887
776
|
* Top
|
|
888
777
|
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
@@ -1149,47 +1038,33 @@ const getDefaultConfig = () => {
|
|
|
1149
1038
|
p: scaleUnambiguousSpacing()
|
|
1150
1039
|
}],
|
|
1151
1040
|
/**
|
|
1152
|
-
* Padding
|
|
1041
|
+
* Padding X
|
|
1153
1042
|
* @see https://tailwindcss.com/docs/padding
|
|
1154
1043
|
*/
|
|
1155
1044
|
px: [{
|
|
1156
1045
|
px: scaleUnambiguousSpacing()
|
|
1157
1046
|
}],
|
|
1158
1047
|
/**
|
|
1159
|
-
* Padding
|
|
1048
|
+
* Padding Y
|
|
1160
1049
|
* @see https://tailwindcss.com/docs/padding
|
|
1161
1050
|
*/
|
|
1162
1051
|
py: [{
|
|
1163
1052
|
py: scaleUnambiguousSpacing()
|
|
1164
1053
|
}],
|
|
1165
1054
|
/**
|
|
1166
|
-
* Padding
|
|
1055
|
+
* Padding Start
|
|
1167
1056
|
* @see https://tailwindcss.com/docs/padding
|
|
1168
1057
|
*/
|
|
1169
1058
|
ps: [{
|
|
1170
1059
|
ps: scaleUnambiguousSpacing()
|
|
1171
1060
|
}],
|
|
1172
1061
|
/**
|
|
1173
|
-
* Padding
|
|
1062
|
+
* Padding End
|
|
1174
1063
|
* @see https://tailwindcss.com/docs/padding
|
|
1175
1064
|
*/
|
|
1176
1065
|
pe: [{
|
|
1177
1066
|
pe: scaleUnambiguousSpacing()
|
|
1178
1067
|
}],
|
|
1179
|
-
/**
|
|
1180
|
-
* Padding Block Start
|
|
1181
|
-
* @see https://tailwindcss.com/docs/padding
|
|
1182
|
-
*/
|
|
1183
|
-
pbs: [{
|
|
1184
|
-
pbs: scaleUnambiguousSpacing()
|
|
1185
|
-
}],
|
|
1186
|
-
/**
|
|
1187
|
-
* Padding Block End
|
|
1188
|
-
* @see https://tailwindcss.com/docs/padding
|
|
1189
|
-
*/
|
|
1190
|
-
pbe: [{
|
|
1191
|
-
pbe: scaleUnambiguousSpacing()
|
|
1192
|
-
}],
|
|
1193
1068
|
/**
|
|
1194
1069
|
* Padding Top
|
|
1195
1070
|
* @see https://tailwindcss.com/docs/padding
|
|
@@ -1226,47 +1101,33 @@ const getDefaultConfig = () => {
|
|
|
1226
1101
|
m: scaleMargin()
|
|
1227
1102
|
}],
|
|
1228
1103
|
/**
|
|
1229
|
-
* Margin
|
|
1104
|
+
* Margin X
|
|
1230
1105
|
* @see https://tailwindcss.com/docs/margin
|
|
1231
1106
|
*/
|
|
1232
1107
|
mx: [{
|
|
1233
1108
|
mx: scaleMargin()
|
|
1234
1109
|
}],
|
|
1235
1110
|
/**
|
|
1236
|
-
* Margin
|
|
1111
|
+
* Margin Y
|
|
1237
1112
|
* @see https://tailwindcss.com/docs/margin
|
|
1238
1113
|
*/
|
|
1239
1114
|
my: [{
|
|
1240
1115
|
my: scaleMargin()
|
|
1241
1116
|
}],
|
|
1242
1117
|
/**
|
|
1243
|
-
* Margin
|
|
1118
|
+
* Margin Start
|
|
1244
1119
|
* @see https://tailwindcss.com/docs/margin
|
|
1245
1120
|
*/
|
|
1246
1121
|
ms: [{
|
|
1247
1122
|
ms: scaleMargin()
|
|
1248
1123
|
}],
|
|
1249
1124
|
/**
|
|
1250
|
-
* Margin
|
|
1125
|
+
* Margin End
|
|
1251
1126
|
* @see https://tailwindcss.com/docs/margin
|
|
1252
1127
|
*/
|
|
1253
1128
|
me: [{
|
|
1254
1129
|
me: scaleMargin()
|
|
1255
1130
|
}],
|
|
1256
|
-
/**
|
|
1257
|
-
* Margin Block Start
|
|
1258
|
-
* @see https://tailwindcss.com/docs/margin
|
|
1259
|
-
*/
|
|
1260
|
-
mbs: [{
|
|
1261
|
-
mbs: scaleMargin()
|
|
1262
|
-
}],
|
|
1263
|
-
/**
|
|
1264
|
-
* Margin Block End
|
|
1265
|
-
* @see https://tailwindcss.com/docs/margin
|
|
1266
|
-
*/
|
|
1267
|
-
mbe: [{
|
|
1268
|
-
mbe: scaleMargin()
|
|
1269
|
-
}],
|
|
1270
1131
|
/**
|
|
1271
1132
|
* Margin Top
|
|
1272
1133
|
* @see https://tailwindcss.com/docs/margin
|
|
@@ -1329,48 +1190,6 @@ const getDefaultConfig = () => {
|
|
|
1329
1190
|
size: [{
|
|
1330
1191
|
size: scaleSizing()
|
|
1331
1192
|
}],
|
|
1332
|
-
/**
|
|
1333
|
-
* Inline Size
|
|
1334
|
-
* @see https://tailwindcss.com/docs/width
|
|
1335
|
-
*/
|
|
1336
|
-
'inline-size': [{
|
|
1337
|
-
inline: ['auto', ...scaleSizingInline()]
|
|
1338
|
-
}],
|
|
1339
|
-
/**
|
|
1340
|
-
* Min-Inline Size
|
|
1341
|
-
* @see https://tailwindcss.com/docs/min-width
|
|
1342
|
-
*/
|
|
1343
|
-
'min-inline-size': [{
|
|
1344
|
-
'min-inline': ['auto', ...scaleSizingInline()]
|
|
1345
|
-
}],
|
|
1346
|
-
/**
|
|
1347
|
-
* Max-Inline Size
|
|
1348
|
-
* @see https://tailwindcss.com/docs/max-width
|
|
1349
|
-
*/
|
|
1350
|
-
'max-inline-size': [{
|
|
1351
|
-
'max-inline': ['none', ...scaleSizingInline()]
|
|
1352
|
-
}],
|
|
1353
|
-
/**
|
|
1354
|
-
* Block Size
|
|
1355
|
-
* @see https://tailwindcss.com/docs/height
|
|
1356
|
-
*/
|
|
1357
|
-
'block-size': [{
|
|
1358
|
-
block: ['auto', ...scaleSizingBlock()]
|
|
1359
|
-
}],
|
|
1360
|
-
/**
|
|
1361
|
-
* Min-Block Size
|
|
1362
|
-
* @see https://tailwindcss.com/docs/min-height
|
|
1363
|
-
*/
|
|
1364
|
-
'min-block-size': [{
|
|
1365
|
-
'min-block': ['auto', ...scaleSizingBlock()]
|
|
1366
|
-
}],
|
|
1367
|
-
/**
|
|
1368
|
-
* Max-Block Size
|
|
1369
|
-
* @see https://tailwindcss.com/docs/max-height
|
|
1370
|
-
*/
|
|
1371
|
-
'max-block-size': [{
|
|
1372
|
-
'max-block': ['none', ...scaleSizingBlock()]
|
|
1373
|
-
}],
|
|
1374
1193
|
/**
|
|
1375
1194
|
* Width
|
|
1376
1195
|
* @see https://tailwindcss.com/docs/width
|
|
@@ -1443,7 +1262,7 @@ const getDefaultConfig = () => {
|
|
|
1443
1262
|
* @see https://tailwindcss.com/docs/font-weight
|
|
1444
1263
|
*/
|
|
1445
1264
|
'font-weight': [{
|
|
1446
|
-
font: [themeFontWeight,
|
|
1265
|
+
font: [themeFontWeight, isArbitraryVariable, isArbitraryNumber]
|
|
1447
1266
|
}],
|
|
1448
1267
|
/**
|
|
1449
1268
|
* Font Stretch
|
|
@@ -1457,14 +1276,7 @@ const getDefaultConfig = () => {
|
|
|
1457
1276
|
* @see https://tailwindcss.com/docs/font-family
|
|
1458
1277
|
*/
|
|
1459
1278
|
'font-family': [{
|
|
1460
|
-
font: [isArbitraryVariableFamilyName,
|
|
1461
|
-
}],
|
|
1462
|
-
/**
|
|
1463
|
-
* Font Feature Settings
|
|
1464
|
-
* @see https://tailwindcss.com/docs/font-feature-settings
|
|
1465
|
-
*/
|
|
1466
|
-
'font-features': [{
|
|
1467
|
-
'font-features': [isArbitraryValue]
|
|
1279
|
+
font: [isArbitraryVariableFamilyName, isArbitraryValue, themeFont]
|
|
1468
1280
|
}],
|
|
1469
1281
|
/**
|
|
1470
1282
|
* Font Variant Numeric
|
|
@@ -1883,47 +1695,33 @@ const getDefaultConfig = () => {
|
|
|
1883
1695
|
border: scaleBorderWidth()
|
|
1884
1696
|
}],
|
|
1885
1697
|
/**
|
|
1886
|
-
* Border Width
|
|
1698
|
+
* Border Width X
|
|
1887
1699
|
* @see https://tailwindcss.com/docs/border-width
|
|
1888
1700
|
*/
|
|
1889
1701
|
'border-w-x': [{
|
|
1890
1702
|
'border-x': scaleBorderWidth()
|
|
1891
1703
|
}],
|
|
1892
1704
|
/**
|
|
1893
|
-
* Border Width
|
|
1705
|
+
* Border Width Y
|
|
1894
1706
|
* @see https://tailwindcss.com/docs/border-width
|
|
1895
1707
|
*/
|
|
1896
1708
|
'border-w-y': [{
|
|
1897
1709
|
'border-y': scaleBorderWidth()
|
|
1898
1710
|
}],
|
|
1899
1711
|
/**
|
|
1900
|
-
* Border Width
|
|
1712
|
+
* Border Width Start
|
|
1901
1713
|
* @see https://tailwindcss.com/docs/border-width
|
|
1902
1714
|
*/
|
|
1903
1715
|
'border-w-s': [{
|
|
1904
1716
|
'border-s': scaleBorderWidth()
|
|
1905
1717
|
}],
|
|
1906
1718
|
/**
|
|
1907
|
-
* Border Width
|
|
1719
|
+
* Border Width End
|
|
1908
1720
|
* @see https://tailwindcss.com/docs/border-width
|
|
1909
1721
|
*/
|
|
1910
1722
|
'border-w-e': [{
|
|
1911
1723
|
'border-e': scaleBorderWidth()
|
|
1912
1724
|
}],
|
|
1913
|
-
/**
|
|
1914
|
-
* Border Width Block Start
|
|
1915
|
-
* @see https://tailwindcss.com/docs/border-width
|
|
1916
|
-
*/
|
|
1917
|
-
'border-w-bs': [{
|
|
1918
|
-
'border-bs': scaleBorderWidth()
|
|
1919
|
-
}],
|
|
1920
|
-
/**
|
|
1921
|
-
* Border Width Block End
|
|
1922
|
-
* @see https://tailwindcss.com/docs/border-width
|
|
1923
|
-
*/
|
|
1924
|
-
'border-w-be': [{
|
|
1925
|
-
'border-be': scaleBorderWidth()
|
|
1926
|
-
}],
|
|
1927
1725
|
/**
|
|
1928
1726
|
* Border Width Top
|
|
1929
1727
|
* @see https://tailwindcss.com/docs/border-width
|
|
@@ -1998,47 +1796,33 @@ const getDefaultConfig = () => {
|
|
|
1998
1796
|
border: scaleColor()
|
|
1999
1797
|
}],
|
|
2000
1798
|
/**
|
|
2001
|
-
* Border Color
|
|
1799
|
+
* Border Color X
|
|
2002
1800
|
* @see https://tailwindcss.com/docs/border-color
|
|
2003
1801
|
*/
|
|
2004
1802
|
'border-color-x': [{
|
|
2005
1803
|
'border-x': scaleColor()
|
|
2006
1804
|
}],
|
|
2007
1805
|
/**
|
|
2008
|
-
* Border Color
|
|
1806
|
+
* Border Color Y
|
|
2009
1807
|
* @see https://tailwindcss.com/docs/border-color
|
|
2010
1808
|
*/
|
|
2011
1809
|
'border-color-y': [{
|
|
2012
1810
|
'border-y': scaleColor()
|
|
2013
1811
|
}],
|
|
2014
1812
|
/**
|
|
2015
|
-
* Border Color
|
|
1813
|
+
* Border Color S
|
|
2016
1814
|
* @see https://tailwindcss.com/docs/border-color
|
|
2017
1815
|
*/
|
|
2018
1816
|
'border-color-s': [{
|
|
2019
1817
|
'border-s': scaleColor()
|
|
2020
1818
|
}],
|
|
2021
1819
|
/**
|
|
2022
|
-
* Border Color
|
|
1820
|
+
* Border Color E
|
|
2023
1821
|
* @see https://tailwindcss.com/docs/border-color
|
|
2024
1822
|
*/
|
|
2025
1823
|
'border-color-e': [{
|
|
2026
1824
|
'border-e': scaleColor()
|
|
2027
1825
|
}],
|
|
2028
|
-
/**
|
|
2029
|
-
* Border Color Block Start
|
|
2030
|
-
* @see https://tailwindcss.com/docs/border-color
|
|
2031
|
-
*/
|
|
2032
|
-
'border-color-bs': [{
|
|
2033
|
-
'border-bs': scaleColor()
|
|
2034
|
-
}],
|
|
2035
|
-
/**
|
|
2036
|
-
* Border Color Block End
|
|
2037
|
-
* @see https://tailwindcss.com/docs/border-color
|
|
2038
|
-
*/
|
|
2039
|
-
'border-color-be': [{
|
|
2040
|
-
'border-be': scaleColor()
|
|
2041
|
-
}],
|
|
2042
1826
|
/**
|
|
2043
1827
|
* Border Color Top
|
|
2044
1828
|
* @see https://tailwindcss.com/docs/border-color
|
|
@@ -2899,47 +2683,33 @@ const getDefaultConfig = () => {
|
|
|
2899
2683
|
'scroll-m': scaleUnambiguousSpacing()
|
|
2900
2684
|
}],
|
|
2901
2685
|
/**
|
|
2902
|
-
* Scroll Margin
|
|
2686
|
+
* Scroll Margin X
|
|
2903
2687
|
* @see https://tailwindcss.com/docs/scroll-margin
|
|
2904
2688
|
*/
|
|
2905
2689
|
'scroll-mx': [{
|
|
2906
2690
|
'scroll-mx': scaleUnambiguousSpacing()
|
|
2907
2691
|
}],
|
|
2908
2692
|
/**
|
|
2909
|
-
* Scroll Margin
|
|
2693
|
+
* Scroll Margin Y
|
|
2910
2694
|
* @see https://tailwindcss.com/docs/scroll-margin
|
|
2911
2695
|
*/
|
|
2912
2696
|
'scroll-my': [{
|
|
2913
2697
|
'scroll-my': scaleUnambiguousSpacing()
|
|
2914
2698
|
}],
|
|
2915
2699
|
/**
|
|
2916
|
-
* Scroll Margin
|
|
2700
|
+
* Scroll Margin Start
|
|
2917
2701
|
* @see https://tailwindcss.com/docs/scroll-margin
|
|
2918
2702
|
*/
|
|
2919
2703
|
'scroll-ms': [{
|
|
2920
2704
|
'scroll-ms': scaleUnambiguousSpacing()
|
|
2921
2705
|
}],
|
|
2922
2706
|
/**
|
|
2923
|
-
* Scroll Margin
|
|
2707
|
+
* Scroll Margin End
|
|
2924
2708
|
* @see https://tailwindcss.com/docs/scroll-margin
|
|
2925
2709
|
*/
|
|
2926
2710
|
'scroll-me': [{
|
|
2927
2711
|
'scroll-me': scaleUnambiguousSpacing()
|
|
2928
2712
|
}],
|
|
2929
|
-
/**
|
|
2930
|
-
* Scroll Margin Block Start
|
|
2931
|
-
* @see https://tailwindcss.com/docs/scroll-margin
|
|
2932
|
-
*/
|
|
2933
|
-
'scroll-mbs': [{
|
|
2934
|
-
'scroll-mbs': scaleUnambiguousSpacing()
|
|
2935
|
-
}],
|
|
2936
|
-
/**
|
|
2937
|
-
* Scroll Margin Block End
|
|
2938
|
-
* @see https://tailwindcss.com/docs/scroll-margin
|
|
2939
|
-
*/
|
|
2940
|
-
'scroll-mbe': [{
|
|
2941
|
-
'scroll-mbe': scaleUnambiguousSpacing()
|
|
2942
|
-
}],
|
|
2943
2713
|
/**
|
|
2944
2714
|
* Scroll Margin Top
|
|
2945
2715
|
* @see https://tailwindcss.com/docs/scroll-margin
|
|
@@ -2976,47 +2746,33 @@ const getDefaultConfig = () => {
|
|
|
2976
2746
|
'scroll-p': scaleUnambiguousSpacing()
|
|
2977
2747
|
}],
|
|
2978
2748
|
/**
|
|
2979
|
-
* Scroll Padding
|
|
2749
|
+
* Scroll Padding X
|
|
2980
2750
|
* @see https://tailwindcss.com/docs/scroll-padding
|
|
2981
2751
|
*/
|
|
2982
2752
|
'scroll-px': [{
|
|
2983
2753
|
'scroll-px': scaleUnambiguousSpacing()
|
|
2984
2754
|
}],
|
|
2985
2755
|
/**
|
|
2986
|
-
* Scroll Padding
|
|
2756
|
+
* Scroll Padding Y
|
|
2987
2757
|
* @see https://tailwindcss.com/docs/scroll-padding
|
|
2988
2758
|
*/
|
|
2989
2759
|
'scroll-py': [{
|
|
2990
2760
|
'scroll-py': scaleUnambiguousSpacing()
|
|
2991
2761
|
}],
|
|
2992
2762
|
/**
|
|
2993
|
-
* Scroll Padding
|
|
2763
|
+
* Scroll Padding Start
|
|
2994
2764
|
* @see https://tailwindcss.com/docs/scroll-padding
|
|
2995
2765
|
*/
|
|
2996
2766
|
'scroll-ps': [{
|
|
2997
2767
|
'scroll-ps': scaleUnambiguousSpacing()
|
|
2998
2768
|
}],
|
|
2999
2769
|
/**
|
|
3000
|
-
* Scroll Padding
|
|
2770
|
+
* Scroll Padding End
|
|
3001
2771
|
* @see https://tailwindcss.com/docs/scroll-padding
|
|
3002
2772
|
*/
|
|
3003
2773
|
'scroll-pe': [{
|
|
3004
2774
|
'scroll-pe': scaleUnambiguousSpacing()
|
|
3005
2775
|
}],
|
|
3006
|
-
/**
|
|
3007
|
-
* Scroll Padding Block Start
|
|
3008
|
-
* @see https://tailwindcss.com/docs/scroll-padding
|
|
3009
|
-
*/
|
|
3010
|
-
'scroll-pbs': [{
|
|
3011
|
-
'scroll-pbs': scaleUnambiguousSpacing()
|
|
3012
|
-
}],
|
|
3013
|
-
/**
|
|
3014
|
-
* Scroll Padding Block End
|
|
3015
|
-
* @see https://tailwindcss.com/docs/scroll-padding
|
|
3016
|
-
*/
|
|
3017
|
-
'scroll-pbe': [{
|
|
3018
|
-
'scroll-pbe': scaleUnambiguousSpacing()
|
|
3019
|
-
}],
|
|
3020
2776
|
/**
|
|
3021
2777
|
* Scroll Padding Top
|
|
3022
2778
|
* @see https://tailwindcss.com/docs/scroll-padding
|
|
@@ -3151,15 +2907,15 @@ const getDefaultConfig = () => {
|
|
|
3151
2907
|
conflictingClassGroups: {
|
|
3152
2908
|
overflow: ['overflow-x', 'overflow-y'],
|
|
3153
2909
|
overscroll: ['overscroll-x', 'overscroll-y'],
|
|
3154
|
-
inset: ['inset-x', 'inset-y', '
|
|
2910
|
+
inset: ['inset-x', 'inset-y', 'start', 'end', 'top', 'right', 'bottom', 'left'],
|
|
3155
2911
|
'inset-x': ['right', 'left'],
|
|
3156
2912
|
'inset-y': ['top', 'bottom'],
|
|
3157
2913
|
flex: ['basis', 'grow', 'shrink'],
|
|
3158
2914
|
gap: ['gap-x', 'gap-y'],
|
|
3159
|
-
p: ['px', 'py', 'ps', 'pe', '
|
|
2915
|
+
p: ['px', 'py', 'ps', 'pe', 'pt', 'pr', 'pb', 'pl'],
|
|
3160
2916
|
px: ['pr', 'pl'],
|
|
3161
2917
|
py: ['pt', 'pb'],
|
|
3162
|
-
m: ['mx', 'my', 'ms', 'me', '
|
|
2918
|
+
m: ['mx', 'my', 'ms', 'me', 'mt', 'mr', 'mb', 'ml'],
|
|
3163
2919
|
mx: ['mr', 'ml'],
|
|
3164
2920
|
my: ['mt', 'mb'],
|
|
3165
2921
|
size: ['w', 'h'],
|
|
@@ -3179,18 +2935,18 @@ const getDefaultConfig = () => {
|
|
|
3179
2935
|
'rounded-b': ['rounded-br', 'rounded-bl'],
|
|
3180
2936
|
'rounded-l': ['rounded-tl', 'rounded-bl'],
|
|
3181
2937
|
'border-spacing': ['border-spacing-x', 'border-spacing-y'],
|
|
3182
|
-
'border-w': ['border-w-x', 'border-w-y', 'border-w-s', 'border-w-e', 'border-w-
|
|
2938
|
+
'border-w': ['border-w-x', 'border-w-y', 'border-w-s', 'border-w-e', 'border-w-t', 'border-w-r', 'border-w-b', 'border-w-l'],
|
|
3183
2939
|
'border-w-x': ['border-w-r', 'border-w-l'],
|
|
3184
2940
|
'border-w-y': ['border-w-t', 'border-w-b'],
|
|
3185
|
-
'border-color': ['border-color-x', 'border-color-y', 'border-color-s', 'border-color-e', 'border-color-
|
|
2941
|
+
'border-color': ['border-color-x', 'border-color-y', 'border-color-s', 'border-color-e', 'border-color-t', 'border-color-r', 'border-color-b', 'border-color-l'],
|
|
3186
2942
|
'border-color-x': ['border-color-r', 'border-color-l'],
|
|
3187
2943
|
'border-color-y': ['border-color-t', 'border-color-b'],
|
|
3188
2944
|
translate: ['translate-x', 'translate-y', 'translate-none'],
|
|
3189
2945
|
'translate-none': ['translate', 'translate-x', 'translate-y', 'translate-z'],
|
|
3190
|
-
'scroll-m': ['scroll-mx', 'scroll-my', 'scroll-ms', 'scroll-me', 'scroll-
|
|
2946
|
+
'scroll-m': ['scroll-mx', 'scroll-my', 'scroll-ms', 'scroll-me', 'scroll-mt', 'scroll-mr', 'scroll-mb', 'scroll-ml'],
|
|
3191
2947
|
'scroll-mx': ['scroll-mr', 'scroll-ml'],
|
|
3192
2948
|
'scroll-my': ['scroll-mt', 'scroll-mb'],
|
|
3193
|
-
'scroll-p': ['scroll-px', 'scroll-py', 'scroll-ps', 'scroll-pe', 'scroll-
|
|
2949
|
+
'scroll-p': ['scroll-px', 'scroll-py', 'scroll-ps', 'scroll-pe', 'scroll-pt', 'scroll-pr', 'scroll-pb', 'scroll-pl'],
|
|
3194
2950
|
'scroll-px': ['scroll-pr', 'scroll-pl'],
|
|
3195
2951
|
'scroll-py': ['scroll-pt', 'scroll-pb'],
|
|
3196
2952
|
touch: ['touch-x', 'touch-y', 'touch-pz'],
|