@jbpark/live-editor 0.1.0

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.
@@ -0,0 +1,2072 @@
1
+ import { n as CONFIG, o as REGEX, s as TS_PATTERNS } from "./enums-3yleLgqV.mjs";
2
+ import React from "react";
3
+ import * as Babel from "@babel/standalone";
4
+ import * as ui from "@jbpark/ui-kit";
5
+ import * as utils from "@jbpark/ui-kit/utils";
6
+
7
+ //#region node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
8
+ function r(e) {
9
+ var t, f, n = "";
10
+ if ("string" == typeof e || "number" == typeof e) n += e;
11
+ else if ("object" == typeof e) if (Array.isArray(e)) {
12
+ var o = e.length;
13
+ for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
14
+ } else for (f in e) e[f] && (n && (n += " "), n += f);
15
+ return n;
16
+ }
17
+ function clsx() {
18
+ for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
19
+ return n;
20
+ }
21
+
22
+ //#endregion
23
+ //#region node_modules/.pnpm/tailwind-merge@3.4.0/node_modules/tailwind-merge/dist/bundle-mjs.mjs
24
+ /**
25
+ * Concatenates two arrays faster than the array spread operator.
26
+ */
27
+ const concatArrays = (array1, array2) => {
28
+ const combinedArray = new Array(array1.length + array2.length);
29
+ for (let i = 0; i < array1.length; i++) combinedArray[i] = array1[i];
30
+ for (let i = 0; i < array2.length; i++) combinedArray[array1.length + i] = array2[i];
31
+ return combinedArray;
32
+ };
33
+ const createClassValidatorObject = (classGroupId, validator) => ({
34
+ classGroupId,
35
+ validator
36
+ });
37
+ const createClassPartObject = (nextPart = /* @__PURE__ */ new Map(), validators = null, classGroupId) => ({
38
+ nextPart,
39
+ validators,
40
+ classGroupId
41
+ });
42
+ const CLASS_PART_SEPARATOR = "-";
43
+ const EMPTY_CONFLICTS = [];
44
+ const ARBITRARY_PROPERTY_PREFIX = "arbitrary..";
45
+ const createClassGroupUtils = (config) => {
46
+ const classMap = createClassMap(config);
47
+ const { conflictingClassGroups, conflictingClassGroupModifiers } = config;
48
+ const getClassGroupId = (className) => {
49
+ if (className.startsWith("[") && className.endsWith("]")) return getGroupIdForArbitraryProperty(className);
50
+ const classParts = className.split(CLASS_PART_SEPARATOR);
51
+ return getGroupRecursive(classParts, classParts[0] === "" && classParts.length > 1 ? 1 : 0, classMap);
52
+ };
53
+ const getConflictingClassGroupIds = (classGroupId, hasPostfixModifier) => {
54
+ if (hasPostfixModifier) {
55
+ const modifierConflicts = conflictingClassGroupModifiers[classGroupId];
56
+ const baseConflicts = conflictingClassGroups[classGroupId];
57
+ if (modifierConflicts) {
58
+ if (baseConflicts) return concatArrays(baseConflicts, modifierConflicts);
59
+ return modifierConflicts;
60
+ }
61
+ return baseConflicts || EMPTY_CONFLICTS;
62
+ }
63
+ return conflictingClassGroups[classGroupId] || EMPTY_CONFLICTS;
64
+ };
65
+ return {
66
+ getClassGroupId,
67
+ getConflictingClassGroupIds
68
+ };
69
+ };
70
+ const getGroupRecursive = (classParts, startIndex, classPartObject) => {
71
+ if (classParts.length - startIndex === 0) return classPartObject.classGroupId;
72
+ const currentClassPart = classParts[startIndex];
73
+ const nextClassPartObject = classPartObject.nextPart.get(currentClassPart);
74
+ if (nextClassPartObject) {
75
+ const result = getGroupRecursive(classParts, startIndex + 1, nextClassPartObject);
76
+ if (result) return result;
77
+ }
78
+ const validators = classPartObject.validators;
79
+ if (validators === null) return;
80
+ const classRest = startIndex === 0 ? classParts.join(CLASS_PART_SEPARATOR) : classParts.slice(startIndex).join(CLASS_PART_SEPARATOR);
81
+ const validatorsLength = validators.length;
82
+ for (let i = 0; i < validatorsLength; i++) {
83
+ const validatorObj = validators[i];
84
+ if (validatorObj.validator(classRest)) return validatorObj.classGroupId;
85
+ }
86
+ };
87
+ /**
88
+ * Get the class group ID for an arbitrary property.
89
+ *
90
+ * @param className - The class name to get the group ID for. Is expected to be string starting with `[` and ending with `]`.
91
+ */
92
+ const getGroupIdForArbitraryProperty = (className) => className.slice(1, -1).indexOf(":") === -1 ? void 0 : (() => {
93
+ const content = className.slice(1, -1);
94
+ const colonIndex = content.indexOf(":");
95
+ const property = content.slice(0, colonIndex);
96
+ return property ? ARBITRARY_PROPERTY_PREFIX + property : void 0;
97
+ })();
98
+ /**
99
+ * Exported for testing only
100
+ */
101
+ const createClassMap = (config) => {
102
+ const { theme, classGroups } = config;
103
+ return processClassGroups(classGroups, theme);
104
+ };
105
+ const processClassGroups = (classGroups, theme) => {
106
+ const classMap = createClassPartObject();
107
+ for (const classGroupId in classGroups) {
108
+ const group = classGroups[classGroupId];
109
+ processClassesRecursively(group, classMap, classGroupId, theme);
110
+ }
111
+ return classMap;
112
+ };
113
+ const processClassesRecursively = (classGroup, classPartObject, classGroupId, theme) => {
114
+ const len = classGroup.length;
115
+ for (let i = 0; i < len; i++) {
116
+ const classDefinition = classGroup[i];
117
+ processClassDefinition(classDefinition, classPartObject, classGroupId, theme);
118
+ }
119
+ };
120
+ const processClassDefinition = (classDefinition, classPartObject, classGroupId, theme) => {
121
+ if (typeof classDefinition === "string") {
122
+ processStringDefinition(classDefinition, classPartObject, classGroupId);
123
+ return;
124
+ }
125
+ if (typeof classDefinition === "function") {
126
+ processFunctionDefinition(classDefinition, classPartObject, classGroupId, theme);
127
+ return;
128
+ }
129
+ processObjectDefinition(classDefinition, classPartObject, classGroupId, theme);
130
+ };
131
+ const processStringDefinition = (classDefinition, classPartObject, classGroupId) => {
132
+ const classPartObjectToEdit = classDefinition === "" ? classPartObject : getPart(classPartObject, classDefinition);
133
+ classPartObjectToEdit.classGroupId = classGroupId;
134
+ };
135
+ const processFunctionDefinition = (classDefinition, classPartObject, classGroupId, theme) => {
136
+ if (isThemeGetter(classDefinition)) {
137
+ processClassesRecursively(classDefinition(theme), classPartObject, classGroupId, theme);
138
+ return;
139
+ }
140
+ if (classPartObject.validators === null) classPartObject.validators = [];
141
+ classPartObject.validators.push(createClassValidatorObject(classGroupId, classDefinition));
142
+ };
143
+ const processObjectDefinition = (classDefinition, classPartObject, classGroupId, theme) => {
144
+ const entries = Object.entries(classDefinition);
145
+ const len = entries.length;
146
+ for (let i = 0; i < len; i++) {
147
+ const [key, value] = entries[i];
148
+ processClassesRecursively(value, getPart(classPartObject, key), classGroupId, theme);
149
+ }
150
+ };
151
+ const getPart = (classPartObject, path) => {
152
+ let current = classPartObject;
153
+ const parts = path.split(CLASS_PART_SEPARATOR);
154
+ const len = parts.length;
155
+ for (let i = 0; i < len; i++) {
156
+ const part = parts[i];
157
+ let next = current.nextPart.get(part);
158
+ if (!next) {
159
+ next = createClassPartObject();
160
+ current.nextPart.set(part, next);
161
+ }
162
+ current = next;
163
+ }
164
+ return current;
165
+ };
166
+ const isThemeGetter = (func) => "isThemeGetter" in func && func.isThemeGetter === true;
167
+ const createLruCache = (maxCacheSize) => {
168
+ if (maxCacheSize < 1) return {
169
+ get: () => void 0,
170
+ set: () => {}
171
+ };
172
+ let cacheSize = 0;
173
+ let cache = Object.create(null);
174
+ let previousCache = Object.create(null);
175
+ const update = (key, value) => {
176
+ cache[key] = value;
177
+ cacheSize++;
178
+ if (cacheSize > maxCacheSize) {
179
+ cacheSize = 0;
180
+ previousCache = cache;
181
+ cache = Object.create(null);
182
+ }
183
+ };
184
+ return {
185
+ get(key) {
186
+ let value = cache[key];
187
+ if (value !== void 0) return value;
188
+ if ((value = previousCache[key]) !== void 0) {
189
+ update(key, value);
190
+ return value;
191
+ }
192
+ },
193
+ set(key, value) {
194
+ if (key in cache) cache[key] = value;
195
+ else update(key, value);
196
+ }
197
+ };
198
+ };
199
+ const IMPORTANT_MODIFIER = "!";
200
+ const MODIFIER_SEPARATOR = ":";
201
+ const EMPTY_MODIFIERS = [];
202
+ const createResultObject = (modifiers, hasImportantModifier, baseClassName, maybePostfixModifierPosition, isExternal) => ({
203
+ modifiers,
204
+ hasImportantModifier,
205
+ baseClassName,
206
+ maybePostfixModifierPosition,
207
+ isExternal
208
+ });
209
+ const createParseClassName = (config) => {
210
+ const { prefix, experimentalParseClassName } = config;
211
+ /**
212
+ * Parse class name into parts.
213
+ *
214
+ * Inspired by `splitAtTopLevelOnly` used in Tailwind CSS
215
+ * @see https://github.com/tailwindlabs/tailwindcss/blob/v3.2.2/src/util/splitAtTopLevelOnly.js
216
+ */
217
+ let parseClassName = (className) => {
218
+ const modifiers = [];
219
+ let bracketDepth = 0;
220
+ let parenDepth = 0;
221
+ let modifierStart = 0;
222
+ let postfixModifierPosition;
223
+ const len = className.length;
224
+ for (let index = 0; index < len; index++) {
225
+ const currentCharacter = className[index];
226
+ if (bracketDepth === 0 && parenDepth === 0) {
227
+ if (currentCharacter === MODIFIER_SEPARATOR) {
228
+ modifiers.push(className.slice(modifierStart, index));
229
+ modifierStart = index + 1;
230
+ continue;
231
+ }
232
+ if (currentCharacter === "/") {
233
+ postfixModifierPosition = index;
234
+ continue;
235
+ }
236
+ }
237
+ if (currentCharacter === "[") bracketDepth++;
238
+ else if (currentCharacter === "]") bracketDepth--;
239
+ else if (currentCharacter === "(") parenDepth++;
240
+ else if (currentCharacter === ")") parenDepth--;
241
+ }
242
+ const baseClassNameWithImportantModifier = modifiers.length === 0 ? className : className.slice(modifierStart);
243
+ let baseClassName = baseClassNameWithImportantModifier;
244
+ let hasImportantModifier = false;
245
+ if (baseClassNameWithImportantModifier.endsWith(IMPORTANT_MODIFIER)) {
246
+ baseClassName = baseClassNameWithImportantModifier.slice(0, -1);
247
+ hasImportantModifier = true;
248
+ } else if (baseClassNameWithImportantModifier.startsWith(IMPORTANT_MODIFIER)) {
249
+ baseClassName = baseClassNameWithImportantModifier.slice(1);
250
+ hasImportantModifier = true;
251
+ }
252
+ const maybePostfixModifierPosition = postfixModifierPosition && postfixModifierPosition > modifierStart ? postfixModifierPosition - modifierStart : void 0;
253
+ return createResultObject(modifiers, hasImportantModifier, baseClassName, maybePostfixModifierPosition);
254
+ };
255
+ if (prefix) {
256
+ const fullPrefix = prefix + MODIFIER_SEPARATOR;
257
+ const parseClassNameOriginal = parseClassName;
258
+ parseClassName = (className) => className.startsWith(fullPrefix) ? parseClassNameOriginal(className.slice(fullPrefix.length)) : createResultObject(EMPTY_MODIFIERS, false, className, void 0, true);
259
+ }
260
+ if (experimentalParseClassName) {
261
+ const parseClassNameOriginal = parseClassName;
262
+ parseClassName = (className) => experimentalParseClassName({
263
+ className,
264
+ parseClassName: parseClassNameOriginal
265
+ });
266
+ }
267
+ return parseClassName;
268
+ };
269
+ /**
270
+ * Sorts modifiers according to following schema:
271
+ * - Predefined modifiers are sorted alphabetically
272
+ * - When an arbitrary variant appears, it must be preserved which modifiers are before and after it
273
+ */
274
+ const createSortModifiers = (config) => {
275
+ const modifierWeights = /* @__PURE__ */ new Map();
276
+ config.orderSensitiveModifiers.forEach((mod, index) => {
277
+ modifierWeights.set(mod, 1e6 + index);
278
+ });
279
+ return (modifiers) => {
280
+ const result = [];
281
+ let currentSegment = [];
282
+ for (let i = 0; i < modifiers.length; i++) {
283
+ const modifier = modifiers[i];
284
+ const isArbitrary = modifier[0] === "[";
285
+ const isOrderSensitive = modifierWeights.has(modifier);
286
+ if (isArbitrary || isOrderSensitive) {
287
+ if (currentSegment.length > 0) {
288
+ currentSegment.sort();
289
+ result.push(...currentSegment);
290
+ currentSegment = [];
291
+ }
292
+ result.push(modifier);
293
+ } else currentSegment.push(modifier);
294
+ }
295
+ if (currentSegment.length > 0) {
296
+ currentSegment.sort();
297
+ result.push(...currentSegment);
298
+ }
299
+ return result;
300
+ };
301
+ };
302
+ const createConfigUtils = (config) => ({
303
+ cache: createLruCache(config.cacheSize),
304
+ parseClassName: createParseClassName(config),
305
+ sortModifiers: createSortModifiers(config),
306
+ ...createClassGroupUtils(config)
307
+ });
308
+ const SPLIT_CLASSES_REGEX = /\s+/;
309
+ const mergeClassList = (classList, configUtils) => {
310
+ const { parseClassName, getClassGroupId, getConflictingClassGroupIds, sortModifiers } = configUtils;
311
+ /**
312
+ * Set of classGroupIds in following format:
313
+ * `{importantModifier}{variantModifiers}{classGroupId}`
314
+ * @example 'float'
315
+ * @example 'hover:focus:bg-color'
316
+ * @example 'md:!pr'
317
+ */
318
+ const classGroupsInConflict = [];
319
+ const classNames = classList.trim().split(SPLIT_CLASSES_REGEX);
320
+ let result = "";
321
+ for (let index = classNames.length - 1; index >= 0; index -= 1) {
322
+ const originalClassName = classNames[index];
323
+ const { isExternal, modifiers, hasImportantModifier, baseClassName, maybePostfixModifierPosition } = parseClassName(originalClassName);
324
+ if (isExternal) {
325
+ result = originalClassName + (result.length > 0 ? " " + result : result);
326
+ continue;
327
+ }
328
+ let hasPostfixModifier = !!maybePostfixModifierPosition;
329
+ let classGroupId = getClassGroupId(hasPostfixModifier ? baseClassName.substring(0, maybePostfixModifierPosition) : baseClassName);
330
+ if (!classGroupId) {
331
+ if (!hasPostfixModifier) {
332
+ result = originalClassName + (result.length > 0 ? " " + result : result);
333
+ continue;
334
+ }
335
+ classGroupId = getClassGroupId(baseClassName);
336
+ if (!classGroupId) {
337
+ result = originalClassName + (result.length > 0 ? " " + result : result);
338
+ continue;
339
+ }
340
+ hasPostfixModifier = false;
341
+ }
342
+ const variantModifier = modifiers.length === 0 ? "" : modifiers.length === 1 ? modifiers[0] : sortModifiers(modifiers).join(":");
343
+ const modifierId = hasImportantModifier ? variantModifier + IMPORTANT_MODIFIER : variantModifier;
344
+ const classId = modifierId + classGroupId;
345
+ if (classGroupsInConflict.indexOf(classId) > -1) continue;
346
+ classGroupsInConflict.push(classId);
347
+ const conflictGroups = getConflictingClassGroupIds(classGroupId, hasPostfixModifier);
348
+ for (let i = 0; i < conflictGroups.length; ++i) {
349
+ const group = conflictGroups[i];
350
+ classGroupsInConflict.push(modifierId + group);
351
+ }
352
+ result = originalClassName + (result.length > 0 ? " " + result : result);
353
+ }
354
+ return result;
355
+ };
356
+ /**
357
+ * The code in this file is copied from https://github.com/lukeed/clsx and modified to suit the needs of tailwind-merge better.
358
+ *
359
+ * Specifically:
360
+ * - Runtime code from https://github.com/lukeed/clsx/blob/v1.2.1/src/index.js
361
+ * - TypeScript types from https://github.com/lukeed/clsx/blob/v1.2.1/clsx.d.ts
362
+ *
363
+ * Original code has MIT license: Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeed.com)
364
+ */
365
+ const twJoin = (...classLists) => {
366
+ let index = 0;
367
+ let argument;
368
+ let resolvedValue;
369
+ let string = "";
370
+ while (index < classLists.length) if (argument = classLists[index++]) {
371
+ if (resolvedValue = toValue(argument)) {
372
+ string && (string += " ");
373
+ string += resolvedValue;
374
+ }
375
+ }
376
+ return string;
377
+ };
378
+ const toValue = (mix) => {
379
+ if (typeof mix === "string") return mix;
380
+ let resolvedValue;
381
+ let string = "";
382
+ for (let k = 0; k < mix.length; k++) if (mix[k]) {
383
+ if (resolvedValue = toValue(mix[k])) {
384
+ string && (string += " ");
385
+ string += resolvedValue;
386
+ }
387
+ }
388
+ return string;
389
+ };
390
+ const createTailwindMerge = (createConfigFirst, ...createConfigRest) => {
391
+ let configUtils;
392
+ let cacheGet;
393
+ let cacheSet;
394
+ let functionToCall;
395
+ const initTailwindMerge = (classList) => {
396
+ configUtils = createConfigUtils(createConfigRest.reduce((previousConfig, createConfigCurrent) => createConfigCurrent(previousConfig), createConfigFirst()));
397
+ cacheGet = configUtils.cache.get;
398
+ cacheSet = configUtils.cache.set;
399
+ functionToCall = tailwindMerge;
400
+ return tailwindMerge(classList);
401
+ };
402
+ const tailwindMerge = (classList) => {
403
+ const cachedResult = cacheGet(classList);
404
+ if (cachedResult) return cachedResult;
405
+ const result = mergeClassList(classList, configUtils);
406
+ cacheSet(classList, result);
407
+ return result;
408
+ };
409
+ functionToCall = initTailwindMerge;
410
+ return (...args) => functionToCall(twJoin(...args));
411
+ };
412
+ const fallbackThemeArr = [];
413
+ const fromTheme = (key) => {
414
+ const themeGetter = (theme) => theme[key] || fallbackThemeArr;
415
+ themeGetter.isThemeGetter = true;
416
+ return themeGetter;
417
+ };
418
+ const arbitraryValueRegex = /^\[(?:(\w[\w-]*):)?(.+)\]$/i;
419
+ const arbitraryVariableRegex = /^\((?:(\w[\w-]*):)?(.+)\)$/i;
420
+ const fractionRegex = /^\d+\/\d+$/;
421
+ const tshirtUnitRegex = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/;
422
+ 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$/;
423
+ const colorFunctionRegex = /^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/;
424
+ const shadowRegex = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/;
425
+ const imageRegex = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;
426
+ const isFraction = (value) => fractionRegex.test(value);
427
+ const isNumber = (value) => !!value && !Number.isNaN(Number(value));
428
+ const isInteger = (value) => !!value && Number.isInteger(Number(value));
429
+ const isPercent = (value) => value.endsWith("%") && isNumber(value.slice(0, -1));
430
+ const isTshirtSize = (value) => tshirtUnitRegex.test(value);
431
+ const isAny = () => true;
432
+ const isLengthOnly = (value) => lengthUnitRegex.test(value) && !colorFunctionRegex.test(value);
433
+ const isNever = () => false;
434
+ const isShadow = (value) => shadowRegex.test(value);
435
+ const isImage = (value) => imageRegex.test(value);
436
+ const isAnyNonArbitrary = (value) => !isArbitraryValue(value) && !isArbitraryVariable(value);
437
+ const isArbitrarySize = (value) => getIsArbitraryValue(value, isLabelSize, isNever);
438
+ const isArbitraryValue = (value) => arbitraryValueRegex.test(value);
439
+ const isArbitraryLength = (value) => getIsArbitraryValue(value, isLabelLength, isLengthOnly);
440
+ const isArbitraryNumber = (value) => getIsArbitraryValue(value, isLabelNumber, isNumber);
441
+ const isArbitraryPosition = (value) => getIsArbitraryValue(value, isLabelPosition, isNever);
442
+ const isArbitraryImage = (value) => getIsArbitraryValue(value, isLabelImage, isImage);
443
+ const isArbitraryShadow = (value) => getIsArbitraryValue(value, isLabelShadow, isShadow);
444
+ const isArbitraryVariable = (value) => arbitraryVariableRegex.test(value);
445
+ const isArbitraryVariableLength = (value) => getIsArbitraryVariable(value, isLabelLength);
446
+ const isArbitraryVariableFamilyName = (value) => getIsArbitraryVariable(value, isLabelFamilyName);
447
+ const isArbitraryVariablePosition = (value) => getIsArbitraryVariable(value, isLabelPosition);
448
+ const isArbitraryVariableSize = (value) => getIsArbitraryVariable(value, isLabelSize);
449
+ const isArbitraryVariableImage = (value) => getIsArbitraryVariable(value, isLabelImage);
450
+ const isArbitraryVariableShadow = (value) => getIsArbitraryVariable(value, isLabelShadow, true);
451
+ const getIsArbitraryValue = (value, testLabel, testValue) => {
452
+ const result = arbitraryValueRegex.exec(value);
453
+ if (result) {
454
+ if (result[1]) return testLabel(result[1]);
455
+ return testValue(result[2]);
456
+ }
457
+ return false;
458
+ };
459
+ const getIsArbitraryVariable = (value, testLabel, shouldMatchNoLabel = false) => {
460
+ const result = arbitraryVariableRegex.exec(value);
461
+ if (result) {
462
+ if (result[1]) return testLabel(result[1]);
463
+ return shouldMatchNoLabel;
464
+ }
465
+ return false;
466
+ };
467
+ const isLabelPosition = (label) => label === "position" || label === "percentage";
468
+ const isLabelImage = (label) => label === "image" || label === "url";
469
+ const isLabelSize = (label) => label === "length" || label === "size" || label === "bg-size";
470
+ const isLabelLength = (label) => label === "length";
471
+ const isLabelNumber = (label) => label === "number";
472
+ const isLabelFamilyName = (label) => label === "family-name";
473
+ const isLabelShadow = (label) => label === "shadow";
474
+ const getDefaultConfig = () => {
475
+ /**
476
+ * Theme getters for theme variable namespaces
477
+ * @see https://tailwindcss.com/docs/theme#theme-variable-namespaces
478
+ */
479
+ const themeColor = fromTheme("color");
480
+ const themeFont = fromTheme("font");
481
+ const themeText = fromTheme("text");
482
+ const themeFontWeight = fromTheme("font-weight");
483
+ const themeTracking = fromTheme("tracking");
484
+ const themeLeading = fromTheme("leading");
485
+ const themeBreakpoint = fromTheme("breakpoint");
486
+ const themeContainer = fromTheme("container");
487
+ const themeSpacing = fromTheme("spacing");
488
+ const themeRadius = fromTheme("radius");
489
+ const themeShadow = fromTheme("shadow");
490
+ const themeInsetShadow = fromTheme("inset-shadow");
491
+ const themeTextShadow = fromTheme("text-shadow");
492
+ const themeDropShadow = fromTheme("drop-shadow");
493
+ const themeBlur = fromTheme("blur");
494
+ const themePerspective = fromTheme("perspective");
495
+ const themeAspect = fromTheme("aspect");
496
+ const themeEase = fromTheme("ease");
497
+ const themeAnimate = fromTheme("animate");
498
+ /**
499
+ * Helpers to avoid repeating the same scales
500
+ *
501
+ * We use functions that create a new array every time they're called instead of static arrays.
502
+ * This ensures that users who modify any scale by mutating the array (e.g. with `array.push(element)`) don't accidentally mutate arrays in other parts of the config.
503
+ */
504
+ const scaleBreak = () => [
505
+ "auto",
506
+ "avoid",
507
+ "all",
508
+ "avoid-page",
509
+ "page",
510
+ "left",
511
+ "right",
512
+ "column"
513
+ ];
514
+ const scalePosition = () => [
515
+ "center",
516
+ "top",
517
+ "bottom",
518
+ "left",
519
+ "right",
520
+ "top-left",
521
+ "left-top",
522
+ "top-right",
523
+ "right-top",
524
+ "bottom-right",
525
+ "right-bottom",
526
+ "bottom-left",
527
+ "left-bottom"
528
+ ];
529
+ const scalePositionWithArbitrary = () => [
530
+ ...scalePosition(),
531
+ isArbitraryVariable,
532
+ isArbitraryValue
533
+ ];
534
+ const scaleOverflow = () => [
535
+ "auto",
536
+ "hidden",
537
+ "clip",
538
+ "visible",
539
+ "scroll"
540
+ ];
541
+ const scaleOverscroll = () => [
542
+ "auto",
543
+ "contain",
544
+ "none"
545
+ ];
546
+ const scaleUnambiguousSpacing = () => [
547
+ isArbitraryVariable,
548
+ isArbitraryValue,
549
+ themeSpacing
550
+ ];
551
+ const scaleInset = () => [
552
+ isFraction,
553
+ "full",
554
+ "auto",
555
+ ...scaleUnambiguousSpacing()
556
+ ];
557
+ const scaleGridTemplateColsRows = () => [
558
+ isInteger,
559
+ "none",
560
+ "subgrid",
561
+ isArbitraryVariable,
562
+ isArbitraryValue
563
+ ];
564
+ const scaleGridColRowStartAndEnd = () => [
565
+ "auto",
566
+ { span: [
567
+ "full",
568
+ isInteger,
569
+ isArbitraryVariable,
570
+ isArbitraryValue
571
+ ] },
572
+ isInteger,
573
+ isArbitraryVariable,
574
+ isArbitraryValue
575
+ ];
576
+ const scaleGridColRowStartOrEnd = () => [
577
+ isInteger,
578
+ "auto",
579
+ isArbitraryVariable,
580
+ isArbitraryValue
581
+ ];
582
+ const scaleGridAutoColsRows = () => [
583
+ "auto",
584
+ "min",
585
+ "max",
586
+ "fr",
587
+ isArbitraryVariable,
588
+ isArbitraryValue
589
+ ];
590
+ const scaleAlignPrimaryAxis = () => [
591
+ "start",
592
+ "end",
593
+ "center",
594
+ "between",
595
+ "around",
596
+ "evenly",
597
+ "stretch",
598
+ "baseline",
599
+ "center-safe",
600
+ "end-safe"
601
+ ];
602
+ const scaleAlignSecondaryAxis = () => [
603
+ "start",
604
+ "end",
605
+ "center",
606
+ "stretch",
607
+ "center-safe",
608
+ "end-safe"
609
+ ];
610
+ const scaleMargin = () => ["auto", ...scaleUnambiguousSpacing()];
611
+ const scaleSizing = () => [
612
+ isFraction,
613
+ "auto",
614
+ "full",
615
+ "dvw",
616
+ "dvh",
617
+ "lvw",
618
+ "lvh",
619
+ "svw",
620
+ "svh",
621
+ "min",
622
+ "max",
623
+ "fit",
624
+ ...scaleUnambiguousSpacing()
625
+ ];
626
+ const scaleColor = () => [
627
+ themeColor,
628
+ isArbitraryVariable,
629
+ isArbitraryValue
630
+ ];
631
+ const scaleBgPosition = () => [
632
+ ...scalePosition(),
633
+ isArbitraryVariablePosition,
634
+ isArbitraryPosition,
635
+ { position: [isArbitraryVariable, isArbitraryValue] }
636
+ ];
637
+ const scaleBgRepeat = () => ["no-repeat", { repeat: [
638
+ "",
639
+ "x",
640
+ "y",
641
+ "space",
642
+ "round"
643
+ ] }];
644
+ const scaleBgSize = () => [
645
+ "auto",
646
+ "cover",
647
+ "contain",
648
+ isArbitraryVariableSize,
649
+ isArbitrarySize,
650
+ { size: [isArbitraryVariable, isArbitraryValue] }
651
+ ];
652
+ const scaleGradientStopPosition = () => [
653
+ isPercent,
654
+ isArbitraryVariableLength,
655
+ isArbitraryLength
656
+ ];
657
+ const scaleRadius = () => [
658
+ "",
659
+ "none",
660
+ "full",
661
+ themeRadius,
662
+ isArbitraryVariable,
663
+ isArbitraryValue
664
+ ];
665
+ const scaleBorderWidth = () => [
666
+ "",
667
+ isNumber,
668
+ isArbitraryVariableLength,
669
+ isArbitraryLength
670
+ ];
671
+ const scaleLineStyle = () => [
672
+ "solid",
673
+ "dashed",
674
+ "dotted",
675
+ "double"
676
+ ];
677
+ const scaleBlendMode = () => [
678
+ "normal",
679
+ "multiply",
680
+ "screen",
681
+ "overlay",
682
+ "darken",
683
+ "lighten",
684
+ "color-dodge",
685
+ "color-burn",
686
+ "hard-light",
687
+ "soft-light",
688
+ "difference",
689
+ "exclusion",
690
+ "hue",
691
+ "saturation",
692
+ "color",
693
+ "luminosity"
694
+ ];
695
+ const scaleMaskImagePosition = () => [
696
+ isNumber,
697
+ isPercent,
698
+ isArbitraryVariablePosition,
699
+ isArbitraryPosition
700
+ ];
701
+ const scaleBlur = () => [
702
+ "",
703
+ "none",
704
+ themeBlur,
705
+ isArbitraryVariable,
706
+ isArbitraryValue
707
+ ];
708
+ const scaleRotate = () => [
709
+ "none",
710
+ isNumber,
711
+ isArbitraryVariable,
712
+ isArbitraryValue
713
+ ];
714
+ const scaleScale = () => [
715
+ "none",
716
+ isNumber,
717
+ isArbitraryVariable,
718
+ isArbitraryValue
719
+ ];
720
+ const scaleSkew = () => [
721
+ isNumber,
722
+ isArbitraryVariable,
723
+ isArbitraryValue
724
+ ];
725
+ const scaleTranslate = () => [
726
+ isFraction,
727
+ "full",
728
+ ...scaleUnambiguousSpacing()
729
+ ];
730
+ return {
731
+ cacheSize: 500,
732
+ theme: {
733
+ animate: [
734
+ "spin",
735
+ "ping",
736
+ "pulse",
737
+ "bounce"
738
+ ],
739
+ aspect: ["video"],
740
+ blur: [isTshirtSize],
741
+ breakpoint: [isTshirtSize],
742
+ color: [isAny],
743
+ container: [isTshirtSize],
744
+ "drop-shadow": [isTshirtSize],
745
+ ease: [
746
+ "in",
747
+ "out",
748
+ "in-out"
749
+ ],
750
+ font: [isAnyNonArbitrary],
751
+ "font-weight": [
752
+ "thin",
753
+ "extralight",
754
+ "light",
755
+ "normal",
756
+ "medium",
757
+ "semibold",
758
+ "bold",
759
+ "extrabold",
760
+ "black"
761
+ ],
762
+ "inset-shadow": [isTshirtSize],
763
+ leading: [
764
+ "none",
765
+ "tight",
766
+ "snug",
767
+ "normal",
768
+ "relaxed",
769
+ "loose"
770
+ ],
771
+ perspective: [
772
+ "dramatic",
773
+ "near",
774
+ "normal",
775
+ "midrange",
776
+ "distant",
777
+ "none"
778
+ ],
779
+ radius: [isTshirtSize],
780
+ shadow: [isTshirtSize],
781
+ spacing: ["px", isNumber],
782
+ text: [isTshirtSize],
783
+ "text-shadow": [isTshirtSize],
784
+ tracking: [
785
+ "tighter",
786
+ "tight",
787
+ "normal",
788
+ "wide",
789
+ "wider",
790
+ "widest"
791
+ ]
792
+ },
793
+ classGroups: {
794
+ aspect: [{ aspect: [
795
+ "auto",
796
+ "square",
797
+ isFraction,
798
+ isArbitraryValue,
799
+ isArbitraryVariable,
800
+ themeAspect
801
+ ] }],
802
+ container: ["container"],
803
+ columns: [{ columns: [
804
+ isNumber,
805
+ isArbitraryValue,
806
+ isArbitraryVariable,
807
+ themeContainer
808
+ ] }],
809
+ "break-after": [{ "break-after": scaleBreak() }],
810
+ "break-before": [{ "break-before": scaleBreak() }],
811
+ "break-inside": [{ "break-inside": [
812
+ "auto",
813
+ "avoid",
814
+ "avoid-page",
815
+ "avoid-column"
816
+ ] }],
817
+ "box-decoration": [{ "box-decoration": ["slice", "clone"] }],
818
+ box: [{ box: ["border", "content"] }],
819
+ display: [
820
+ "block",
821
+ "inline-block",
822
+ "inline",
823
+ "flex",
824
+ "inline-flex",
825
+ "table",
826
+ "inline-table",
827
+ "table-caption",
828
+ "table-cell",
829
+ "table-column",
830
+ "table-column-group",
831
+ "table-footer-group",
832
+ "table-header-group",
833
+ "table-row-group",
834
+ "table-row",
835
+ "flow-root",
836
+ "grid",
837
+ "inline-grid",
838
+ "contents",
839
+ "list-item",
840
+ "hidden"
841
+ ],
842
+ sr: ["sr-only", "not-sr-only"],
843
+ float: [{ float: [
844
+ "right",
845
+ "left",
846
+ "none",
847
+ "start",
848
+ "end"
849
+ ] }],
850
+ clear: [{ clear: [
851
+ "left",
852
+ "right",
853
+ "both",
854
+ "none",
855
+ "start",
856
+ "end"
857
+ ] }],
858
+ isolation: ["isolate", "isolation-auto"],
859
+ "object-fit": [{ object: [
860
+ "contain",
861
+ "cover",
862
+ "fill",
863
+ "none",
864
+ "scale-down"
865
+ ] }],
866
+ "object-position": [{ object: scalePositionWithArbitrary() }],
867
+ overflow: [{ overflow: scaleOverflow() }],
868
+ "overflow-x": [{ "overflow-x": scaleOverflow() }],
869
+ "overflow-y": [{ "overflow-y": scaleOverflow() }],
870
+ overscroll: [{ overscroll: scaleOverscroll() }],
871
+ "overscroll-x": [{ "overscroll-x": scaleOverscroll() }],
872
+ "overscroll-y": [{ "overscroll-y": scaleOverscroll() }],
873
+ position: [
874
+ "static",
875
+ "fixed",
876
+ "absolute",
877
+ "relative",
878
+ "sticky"
879
+ ],
880
+ inset: [{ inset: scaleInset() }],
881
+ "inset-x": [{ "inset-x": scaleInset() }],
882
+ "inset-y": [{ "inset-y": scaleInset() }],
883
+ start: [{ start: scaleInset() }],
884
+ end: [{ end: scaleInset() }],
885
+ top: [{ top: scaleInset() }],
886
+ right: [{ right: scaleInset() }],
887
+ bottom: [{ bottom: scaleInset() }],
888
+ left: [{ left: scaleInset() }],
889
+ visibility: [
890
+ "visible",
891
+ "invisible",
892
+ "collapse"
893
+ ],
894
+ z: [{ z: [
895
+ isInteger,
896
+ "auto",
897
+ isArbitraryVariable,
898
+ isArbitraryValue
899
+ ] }],
900
+ basis: [{ basis: [
901
+ isFraction,
902
+ "full",
903
+ "auto",
904
+ themeContainer,
905
+ ...scaleUnambiguousSpacing()
906
+ ] }],
907
+ "flex-direction": [{ flex: [
908
+ "row",
909
+ "row-reverse",
910
+ "col",
911
+ "col-reverse"
912
+ ] }],
913
+ "flex-wrap": [{ flex: [
914
+ "nowrap",
915
+ "wrap",
916
+ "wrap-reverse"
917
+ ] }],
918
+ flex: [{ flex: [
919
+ isNumber,
920
+ isFraction,
921
+ "auto",
922
+ "initial",
923
+ "none",
924
+ isArbitraryValue
925
+ ] }],
926
+ grow: [{ grow: [
927
+ "",
928
+ isNumber,
929
+ isArbitraryVariable,
930
+ isArbitraryValue
931
+ ] }],
932
+ shrink: [{ shrink: [
933
+ "",
934
+ isNumber,
935
+ isArbitraryVariable,
936
+ isArbitraryValue
937
+ ] }],
938
+ order: [{ order: [
939
+ isInteger,
940
+ "first",
941
+ "last",
942
+ "none",
943
+ isArbitraryVariable,
944
+ isArbitraryValue
945
+ ] }],
946
+ "grid-cols": [{ "grid-cols": scaleGridTemplateColsRows() }],
947
+ "col-start-end": [{ col: scaleGridColRowStartAndEnd() }],
948
+ "col-start": [{ "col-start": scaleGridColRowStartOrEnd() }],
949
+ "col-end": [{ "col-end": scaleGridColRowStartOrEnd() }],
950
+ "grid-rows": [{ "grid-rows": scaleGridTemplateColsRows() }],
951
+ "row-start-end": [{ row: scaleGridColRowStartAndEnd() }],
952
+ "row-start": [{ "row-start": scaleGridColRowStartOrEnd() }],
953
+ "row-end": [{ "row-end": scaleGridColRowStartOrEnd() }],
954
+ "grid-flow": [{ "grid-flow": [
955
+ "row",
956
+ "col",
957
+ "dense",
958
+ "row-dense",
959
+ "col-dense"
960
+ ] }],
961
+ "auto-cols": [{ "auto-cols": scaleGridAutoColsRows() }],
962
+ "auto-rows": [{ "auto-rows": scaleGridAutoColsRows() }],
963
+ gap: [{ gap: scaleUnambiguousSpacing() }],
964
+ "gap-x": [{ "gap-x": scaleUnambiguousSpacing() }],
965
+ "gap-y": [{ "gap-y": scaleUnambiguousSpacing() }],
966
+ "justify-content": [{ justify: [...scaleAlignPrimaryAxis(), "normal"] }],
967
+ "justify-items": [{ "justify-items": [...scaleAlignSecondaryAxis(), "normal"] }],
968
+ "justify-self": [{ "justify-self": ["auto", ...scaleAlignSecondaryAxis()] }],
969
+ "align-content": [{ content: ["normal", ...scaleAlignPrimaryAxis()] }],
970
+ "align-items": [{ items: [...scaleAlignSecondaryAxis(), { baseline: ["", "last"] }] }],
971
+ "align-self": [{ self: [
972
+ "auto",
973
+ ...scaleAlignSecondaryAxis(),
974
+ { baseline: ["", "last"] }
975
+ ] }],
976
+ "place-content": [{ "place-content": scaleAlignPrimaryAxis() }],
977
+ "place-items": [{ "place-items": [...scaleAlignSecondaryAxis(), "baseline"] }],
978
+ "place-self": [{ "place-self": ["auto", ...scaleAlignSecondaryAxis()] }],
979
+ p: [{ p: scaleUnambiguousSpacing() }],
980
+ px: [{ px: scaleUnambiguousSpacing() }],
981
+ py: [{ py: scaleUnambiguousSpacing() }],
982
+ ps: [{ ps: scaleUnambiguousSpacing() }],
983
+ pe: [{ pe: scaleUnambiguousSpacing() }],
984
+ pt: [{ pt: scaleUnambiguousSpacing() }],
985
+ pr: [{ pr: scaleUnambiguousSpacing() }],
986
+ pb: [{ pb: scaleUnambiguousSpacing() }],
987
+ pl: [{ pl: scaleUnambiguousSpacing() }],
988
+ m: [{ m: scaleMargin() }],
989
+ mx: [{ mx: scaleMargin() }],
990
+ my: [{ my: scaleMargin() }],
991
+ ms: [{ ms: scaleMargin() }],
992
+ me: [{ me: scaleMargin() }],
993
+ mt: [{ mt: scaleMargin() }],
994
+ mr: [{ mr: scaleMargin() }],
995
+ mb: [{ mb: scaleMargin() }],
996
+ ml: [{ ml: scaleMargin() }],
997
+ "space-x": [{ "space-x": scaleUnambiguousSpacing() }],
998
+ "space-x-reverse": ["space-x-reverse"],
999
+ "space-y": [{ "space-y": scaleUnambiguousSpacing() }],
1000
+ "space-y-reverse": ["space-y-reverse"],
1001
+ size: [{ size: scaleSizing() }],
1002
+ w: [{ w: [
1003
+ themeContainer,
1004
+ "screen",
1005
+ ...scaleSizing()
1006
+ ] }],
1007
+ "min-w": [{ "min-w": [
1008
+ themeContainer,
1009
+ "screen",
1010
+ "none",
1011
+ ...scaleSizing()
1012
+ ] }],
1013
+ "max-w": [{ "max-w": [
1014
+ themeContainer,
1015
+ "screen",
1016
+ "none",
1017
+ "prose",
1018
+ { screen: [themeBreakpoint] },
1019
+ ...scaleSizing()
1020
+ ] }],
1021
+ h: [{ h: [
1022
+ "screen",
1023
+ "lh",
1024
+ ...scaleSizing()
1025
+ ] }],
1026
+ "min-h": [{ "min-h": [
1027
+ "screen",
1028
+ "lh",
1029
+ "none",
1030
+ ...scaleSizing()
1031
+ ] }],
1032
+ "max-h": [{ "max-h": [
1033
+ "screen",
1034
+ "lh",
1035
+ ...scaleSizing()
1036
+ ] }],
1037
+ "font-size": [{ text: [
1038
+ "base",
1039
+ themeText,
1040
+ isArbitraryVariableLength,
1041
+ isArbitraryLength
1042
+ ] }],
1043
+ "font-smoothing": ["antialiased", "subpixel-antialiased"],
1044
+ "font-style": ["italic", "not-italic"],
1045
+ "font-weight": [{ font: [
1046
+ themeFontWeight,
1047
+ isArbitraryVariable,
1048
+ isArbitraryNumber
1049
+ ] }],
1050
+ "font-stretch": [{ "font-stretch": [
1051
+ "ultra-condensed",
1052
+ "extra-condensed",
1053
+ "condensed",
1054
+ "semi-condensed",
1055
+ "normal",
1056
+ "semi-expanded",
1057
+ "expanded",
1058
+ "extra-expanded",
1059
+ "ultra-expanded",
1060
+ isPercent,
1061
+ isArbitraryValue
1062
+ ] }],
1063
+ "font-family": [{ font: [
1064
+ isArbitraryVariableFamilyName,
1065
+ isArbitraryValue,
1066
+ themeFont
1067
+ ] }],
1068
+ "fvn-normal": ["normal-nums"],
1069
+ "fvn-ordinal": ["ordinal"],
1070
+ "fvn-slashed-zero": ["slashed-zero"],
1071
+ "fvn-figure": ["lining-nums", "oldstyle-nums"],
1072
+ "fvn-spacing": ["proportional-nums", "tabular-nums"],
1073
+ "fvn-fraction": ["diagonal-fractions", "stacked-fractions"],
1074
+ tracking: [{ tracking: [
1075
+ themeTracking,
1076
+ isArbitraryVariable,
1077
+ isArbitraryValue
1078
+ ] }],
1079
+ "line-clamp": [{ "line-clamp": [
1080
+ isNumber,
1081
+ "none",
1082
+ isArbitraryVariable,
1083
+ isArbitraryNumber
1084
+ ] }],
1085
+ leading: [{ leading: [themeLeading, ...scaleUnambiguousSpacing()] }],
1086
+ "list-image": [{ "list-image": [
1087
+ "none",
1088
+ isArbitraryVariable,
1089
+ isArbitraryValue
1090
+ ] }],
1091
+ "list-style-position": [{ list: ["inside", "outside"] }],
1092
+ "list-style-type": [{ list: [
1093
+ "disc",
1094
+ "decimal",
1095
+ "none",
1096
+ isArbitraryVariable,
1097
+ isArbitraryValue
1098
+ ] }],
1099
+ "text-alignment": [{ text: [
1100
+ "left",
1101
+ "center",
1102
+ "right",
1103
+ "justify",
1104
+ "start",
1105
+ "end"
1106
+ ] }],
1107
+ "placeholder-color": [{ placeholder: scaleColor() }],
1108
+ "text-color": [{ text: scaleColor() }],
1109
+ "text-decoration": [
1110
+ "underline",
1111
+ "overline",
1112
+ "line-through",
1113
+ "no-underline"
1114
+ ],
1115
+ "text-decoration-style": [{ decoration: [...scaleLineStyle(), "wavy"] }],
1116
+ "text-decoration-thickness": [{ decoration: [
1117
+ isNumber,
1118
+ "from-font",
1119
+ "auto",
1120
+ isArbitraryVariable,
1121
+ isArbitraryLength
1122
+ ] }],
1123
+ "text-decoration-color": [{ decoration: scaleColor() }],
1124
+ "underline-offset": [{ "underline-offset": [
1125
+ isNumber,
1126
+ "auto",
1127
+ isArbitraryVariable,
1128
+ isArbitraryValue
1129
+ ] }],
1130
+ "text-transform": [
1131
+ "uppercase",
1132
+ "lowercase",
1133
+ "capitalize",
1134
+ "normal-case"
1135
+ ],
1136
+ "text-overflow": [
1137
+ "truncate",
1138
+ "text-ellipsis",
1139
+ "text-clip"
1140
+ ],
1141
+ "text-wrap": [{ text: [
1142
+ "wrap",
1143
+ "nowrap",
1144
+ "balance",
1145
+ "pretty"
1146
+ ] }],
1147
+ indent: [{ indent: scaleUnambiguousSpacing() }],
1148
+ "vertical-align": [{ align: [
1149
+ "baseline",
1150
+ "top",
1151
+ "middle",
1152
+ "bottom",
1153
+ "text-top",
1154
+ "text-bottom",
1155
+ "sub",
1156
+ "super",
1157
+ isArbitraryVariable,
1158
+ isArbitraryValue
1159
+ ] }],
1160
+ whitespace: [{ whitespace: [
1161
+ "normal",
1162
+ "nowrap",
1163
+ "pre",
1164
+ "pre-line",
1165
+ "pre-wrap",
1166
+ "break-spaces"
1167
+ ] }],
1168
+ break: [{ break: [
1169
+ "normal",
1170
+ "words",
1171
+ "all",
1172
+ "keep"
1173
+ ] }],
1174
+ wrap: [{ wrap: [
1175
+ "break-word",
1176
+ "anywhere",
1177
+ "normal"
1178
+ ] }],
1179
+ hyphens: [{ hyphens: [
1180
+ "none",
1181
+ "manual",
1182
+ "auto"
1183
+ ] }],
1184
+ content: [{ content: [
1185
+ "none",
1186
+ isArbitraryVariable,
1187
+ isArbitraryValue
1188
+ ] }],
1189
+ "bg-attachment": [{ bg: [
1190
+ "fixed",
1191
+ "local",
1192
+ "scroll"
1193
+ ] }],
1194
+ "bg-clip": [{ "bg-clip": [
1195
+ "border",
1196
+ "padding",
1197
+ "content",
1198
+ "text"
1199
+ ] }],
1200
+ "bg-origin": [{ "bg-origin": [
1201
+ "border",
1202
+ "padding",
1203
+ "content"
1204
+ ] }],
1205
+ "bg-position": [{ bg: scaleBgPosition() }],
1206
+ "bg-repeat": [{ bg: scaleBgRepeat() }],
1207
+ "bg-size": [{ bg: scaleBgSize() }],
1208
+ "bg-image": [{ bg: [
1209
+ "none",
1210
+ {
1211
+ linear: [
1212
+ { to: [
1213
+ "t",
1214
+ "tr",
1215
+ "r",
1216
+ "br",
1217
+ "b",
1218
+ "bl",
1219
+ "l",
1220
+ "tl"
1221
+ ] },
1222
+ isInteger,
1223
+ isArbitraryVariable,
1224
+ isArbitraryValue
1225
+ ],
1226
+ radial: [
1227
+ "",
1228
+ isArbitraryVariable,
1229
+ isArbitraryValue
1230
+ ],
1231
+ conic: [
1232
+ isInteger,
1233
+ isArbitraryVariable,
1234
+ isArbitraryValue
1235
+ ]
1236
+ },
1237
+ isArbitraryVariableImage,
1238
+ isArbitraryImage
1239
+ ] }],
1240
+ "bg-color": [{ bg: scaleColor() }],
1241
+ "gradient-from-pos": [{ from: scaleGradientStopPosition() }],
1242
+ "gradient-via-pos": [{ via: scaleGradientStopPosition() }],
1243
+ "gradient-to-pos": [{ to: scaleGradientStopPosition() }],
1244
+ "gradient-from": [{ from: scaleColor() }],
1245
+ "gradient-via": [{ via: scaleColor() }],
1246
+ "gradient-to": [{ to: scaleColor() }],
1247
+ rounded: [{ rounded: scaleRadius() }],
1248
+ "rounded-s": [{ "rounded-s": scaleRadius() }],
1249
+ "rounded-e": [{ "rounded-e": scaleRadius() }],
1250
+ "rounded-t": [{ "rounded-t": scaleRadius() }],
1251
+ "rounded-r": [{ "rounded-r": scaleRadius() }],
1252
+ "rounded-b": [{ "rounded-b": scaleRadius() }],
1253
+ "rounded-l": [{ "rounded-l": scaleRadius() }],
1254
+ "rounded-ss": [{ "rounded-ss": scaleRadius() }],
1255
+ "rounded-se": [{ "rounded-se": scaleRadius() }],
1256
+ "rounded-ee": [{ "rounded-ee": scaleRadius() }],
1257
+ "rounded-es": [{ "rounded-es": scaleRadius() }],
1258
+ "rounded-tl": [{ "rounded-tl": scaleRadius() }],
1259
+ "rounded-tr": [{ "rounded-tr": scaleRadius() }],
1260
+ "rounded-br": [{ "rounded-br": scaleRadius() }],
1261
+ "rounded-bl": [{ "rounded-bl": scaleRadius() }],
1262
+ "border-w": [{ border: scaleBorderWidth() }],
1263
+ "border-w-x": [{ "border-x": scaleBorderWidth() }],
1264
+ "border-w-y": [{ "border-y": scaleBorderWidth() }],
1265
+ "border-w-s": [{ "border-s": scaleBorderWidth() }],
1266
+ "border-w-e": [{ "border-e": scaleBorderWidth() }],
1267
+ "border-w-t": [{ "border-t": scaleBorderWidth() }],
1268
+ "border-w-r": [{ "border-r": scaleBorderWidth() }],
1269
+ "border-w-b": [{ "border-b": scaleBorderWidth() }],
1270
+ "border-w-l": [{ "border-l": scaleBorderWidth() }],
1271
+ "divide-x": [{ "divide-x": scaleBorderWidth() }],
1272
+ "divide-x-reverse": ["divide-x-reverse"],
1273
+ "divide-y": [{ "divide-y": scaleBorderWidth() }],
1274
+ "divide-y-reverse": ["divide-y-reverse"],
1275
+ "border-style": [{ border: [
1276
+ ...scaleLineStyle(),
1277
+ "hidden",
1278
+ "none"
1279
+ ] }],
1280
+ "divide-style": [{ divide: [
1281
+ ...scaleLineStyle(),
1282
+ "hidden",
1283
+ "none"
1284
+ ] }],
1285
+ "border-color": [{ border: scaleColor() }],
1286
+ "border-color-x": [{ "border-x": scaleColor() }],
1287
+ "border-color-y": [{ "border-y": scaleColor() }],
1288
+ "border-color-s": [{ "border-s": scaleColor() }],
1289
+ "border-color-e": [{ "border-e": scaleColor() }],
1290
+ "border-color-t": [{ "border-t": scaleColor() }],
1291
+ "border-color-r": [{ "border-r": scaleColor() }],
1292
+ "border-color-b": [{ "border-b": scaleColor() }],
1293
+ "border-color-l": [{ "border-l": scaleColor() }],
1294
+ "divide-color": [{ divide: scaleColor() }],
1295
+ "outline-style": [{ outline: [
1296
+ ...scaleLineStyle(),
1297
+ "none",
1298
+ "hidden"
1299
+ ] }],
1300
+ "outline-offset": [{ "outline-offset": [
1301
+ isNumber,
1302
+ isArbitraryVariable,
1303
+ isArbitraryValue
1304
+ ] }],
1305
+ "outline-w": [{ outline: [
1306
+ "",
1307
+ isNumber,
1308
+ isArbitraryVariableLength,
1309
+ isArbitraryLength
1310
+ ] }],
1311
+ "outline-color": [{ outline: scaleColor() }],
1312
+ shadow: [{ shadow: [
1313
+ "",
1314
+ "none",
1315
+ themeShadow,
1316
+ isArbitraryVariableShadow,
1317
+ isArbitraryShadow
1318
+ ] }],
1319
+ "shadow-color": [{ shadow: scaleColor() }],
1320
+ "inset-shadow": [{ "inset-shadow": [
1321
+ "none",
1322
+ themeInsetShadow,
1323
+ isArbitraryVariableShadow,
1324
+ isArbitraryShadow
1325
+ ] }],
1326
+ "inset-shadow-color": [{ "inset-shadow": scaleColor() }],
1327
+ "ring-w": [{ ring: scaleBorderWidth() }],
1328
+ "ring-w-inset": ["ring-inset"],
1329
+ "ring-color": [{ ring: scaleColor() }],
1330
+ "ring-offset-w": [{ "ring-offset": [isNumber, isArbitraryLength] }],
1331
+ "ring-offset-color": [{ "ring-offset": scaleColor() }],
1332
+ "inset-ring-w": [{ "inset-ring": scaleBorderWidth() }],
1333
+ "inset-ring-color": [{ "inset-ring": scaleColor() }],
1334
+ "text-shadow": [{ "text-shadow": [
1335
+ "none",
1336
+ themeTextShadow,
1337
+ isArbitraryVariableShadow,
1338
+ isArbitraryShadow
1339
+ ] }],
1340
+ "text-shadow-color": [{ "text-shadow": scaleColor() }],
1341
+ opacity: [{ opacity: [
1342
+ isNumber,
1343
+ isArbitraryVariable,
1344
+ isArbitraryValue
1345
+ ] }],
1346
+ "mix-blend": [{ "mix-blend": [
1347
+ ...scaleBlendMode(),
1348
+ "plus-darker",
1349
+ "plus-lighter"
1350
+ ] }],
1351
+ "bg-blend": [{ "bg-blend": scaleBlendMode() }],
1352
+ "mask-clip": [{ "mask-clip": [
1353
+ "border",
1354
+ "padding",
1355
+ "content",
1356
+ "fill",
1357
+ "stroke",
1358
+ "view"
1359
+ ] }, "mask-no-clip"],
1360
+ "mask-composite": [{ mask: [
1361
+ "add",
1362
+ "subtract",
1363
+ "intersect",
1364
+ "exclude"
1365
+ ] }],
1366
+ "mask-image-linear-pos": [{ "mask-linear": [isNumber] }],
1367
+ "mask-image-linear-from-pos": [{ "mask-linear-from": scaleMaskImagePosition() }],
1368
+ "mask-image-linear-to-pos": [{ "mask-linear-to": scaleMaskImagePosition() }],
1369
+ "mask-image-linear-from-color": [{ "mask-linear-from": scaleColor() }],
1370
+ "mask-image-linear-to-color": [{ "mask-linear-to": scaleColor() }],
1371
+ "mask-image-t-from-pos": [{ "mask-t-from": scaleMaskImagePosition() }],
1372
+ "mask-image-t-to-pos": [{ "mask-t-to": scaleMaskImagePosition() }],
1373
+ "mask-image-t-from-color": [{ "mask-t-from": scaleColor() }],
1374
+ "mask-image-t-to-color": [{ "mask-t-to": scaleColor() }],
1375
+ "mask-image-r-from-pos": [{ "mask-r-from": scaleMaskImagePosition() }],
1376
+ "mask-image-r-to-pos": [{ "mask-r-to": scaleMaskImagePosition() }],
1377
+ "mask-image-r-from-color": [{ "mask-r-from": scaleColor() }],
1378
+ "mask-image-r-to-color": [{ "mask-r-to": scaleColor() }],
1379
+ "mask-image-b-from-pos": [{ "mask-b-from": scaleMaskImagePosition() }],
1380
+ "mask-image-b-to-pos": [{ "mask-b-to": scaleMaskImagePosition() }],
1381
+ "mask-image-b-from-color": [{ "mask-b-from": scaleColor() }],
1382
+ "mask-image-b-to-color": [{ "mask-b-to": scaleColor() }],
1383
+ "mask-image-l-from-pos": [{ "mask-l-from": scaleMaskImagePosition() }],
1384
+ "mask-image-l-to-pos": [{ "mask-l-to": scaleMaskImagePosition() }],
1385
+ "mask-image-l-from-color": [{ "mask-l-from": scaleColor() }],
1386
+ "mask-image-l-to-color": [{ "mask-l-to": scaleColor() }],
1387
+ "mask-image-x-from-pos": [{ "mask-x-from": scaleMaskImagePosition() }],
1388
+ "mask-image-x-to-pos": [{ "mask-x-to": scaleMaskImagePosition() }],
1389
+ "mask-image-x-from-color": [{ "mask-x-from": scaleColor() }],
1390
+ "mask-image-x-to-color": [{ "mask-x-to": scaleColor() }],
1391
+ "mask-image-y-from-pos": [{ "mask-y-from": scaleMaskImagePosition() }],
1392
+ "mask-image-y-to-pos": [{ "mask-y-to": scaleMaskImagePosition() }],
1393
+ "mask-image-y-from-color": [{ "mask-y-from": scaleColor() }],
1394
+ "mask-image-y-to-color": [{ "mask-y-to": scaleColor() }],
1395
+ "mask-image-radial": [{ "mask-radial": [isArbitraryVariable, isArbitraryValue] }],
1396
+ "mask-image-radial-from-pos": [{ "mask-radial-from": scaleMaskImagePosition() }],
1397
+ "mask-image-radial-to-pos": [{ "mask-radial-to": scaleMaskImagePosition() }],
1398
+ "mask-image-radial-from-color": [{ "mask-radial-from": scaleColor() }],
1399
+ "mask-image-radial-to-color": [{ "mask-radial-to": scaleColor() }],
1400
+ "mask-image-radial-shape": [{ "mask-radial": ["circle", "ellipse"] }],
1401
+ "mask-image-radial-size": [{ "mask-radial": [{
1402
+ closest: ["side", "corner"],
1403
+ farthest: ["side", "corner"]
1404
+ }] }],
1405
+ "mask-image-radial-pos": [{ "mask-radial-at": scalePosition() }],
1406
+ "mask-image-conic-pos": [{ "mask-conic": [isNumber] }],
1407
+ "mask-image-conic-from-pos": [{ "mask-conic-from": scaleMaskImagePosition() }],
1408
+ "mask-image-conic-to-pos": [{ "mask-conic-to": scaleMaskImagePosition() }],
1409
+ "mask-image-conic-from-color": [{ "mask-conic-from": scaleColor() }],
1410
+ "mask-image-conic-to-color": [{ "mask-conic-to": scaleColor() }],
1411
+ "mask-mode": [{ mask: [
1412
+ "alpha",
1413
+ "luminance",
1414
+ "match"
1415
+ ] }],
1416
+ "mask-origin": [{ "mask-origin": [
1417
+ "border",
1418
+ "padding",
1419
+ "content",
1420
+ "fill",
1421
+ "stroke",
1422
+ "view"
1423
+ ] }],
1424
+ "mask-position": [{ mask: scaleBgPosition() }],
1425
+ "mask-repeat": [{ mask: scaleBgRepeat() }],
1426
+ "mask-size": [{ mask: scaleBgSize() }],
1427
+ "mask-type": [{ "mask-type": ["alpha", "luminance"] }],
1428
+ "mask-image": [{ mask: [
1429
+ "none",
1430
+ isArbitraryVariable,
1431
+ isArbitraryValue
1432
+ ] }],
1433
+ filter: [{ filter: [
1434
+ "",
1435
+ "none",
1436
+ isArbitraryVariable,
1437
+ isArbitraryValue
1438
+ ] }],
1439
+ blur: [{ blur: scaleBlur() }],
1440
+ brightness: [{ brightness: [
1441
+ isNumber,
1442
+ isArbitraryVariable,
1443
+ isArbitraryValue
1444
+ ] }],
1445
+ contrast: [{ contrast: [
1446
+ isNumber,
1447
+ isArbitraryVariable,
1448
+ isArbitraryValue
1449
+ ] }],
1450
+ "drop-shadow": [{ "drop-shadow": [
1451
+ "",
1452
+ "none",
1453
+ themeDropShadow,
1454
+ isArbitraryVariableShadow,
1455
+ isArbitraryShadow
1456
+ ] }],
1457
+ "drop-shadow-color": [{ "drop-shadow": scaleColor() }],
1458
+ grayscale: [{ grayscale: [
1459
+ "",
1460
+ isNumber,
1461
+ isArbitraryVariable,
1462
+ isArbitraryValue
1463
+ ] }],
1464
+ "hue-rotate": [{ "hue-rotate": [
1465
+ isNumber,
1466
+ isArbitraryVariable,
1467
+ isArbitraryValue
1468
+ ] }],
1469
+ invert: [{ invert: [
1470
+ "",
1471
+ isNumber,
1472
+ isArbitraryVariable,
1473
+ isArbitraryValue
1474
+ ] }],
1475
+ saturate: [{ saturate: [
1476
+ isNumber,
1477
+ isArbitraryVariable,
1478
+ isArbitraryValue
1479
+ ] }],
1480
+ sepia: [{ sepia: [
1481
+ "",
1482
+ isNumber,
1483
+ isArbitraryVariable,
1484
+ isArbitraryValue
1485
+ ] }],
1486
+ "backdrop-filter": [{ "backdrop-filter": [
1487
+ "",
1488
+ "none",
1489
+ isArbitraryVariable,
1490
+ isArbitraryValue
1491
+ ] }],
1492
+ "backdrop-blur": [{ "backdrop-blur": scaleBlur() }],
1493
+ "backdrop-brightness": [{ "backdrop-brightness": [
1494
+ isNumber,
1495
+ isArbitraryVariable,
1496
+ isArbitraryValue
1497
+ ] }],
1498
+ "backdrop-contrast": [{ "backdrop-contrast": [
1499
+ isNumber,
1500
+ isArbitraryVariable,
1501
+ isArbitraryValue
1502
+ ] }],
1503
+ "backdrop-grayscale": [{ "backdrop-grayscale": [
1504
+ "",
1505
+ isNumber,
1506
+ isArbitraryVariable,
1507
+ isArbitraryValue
1508
+ ] }],
1509
+ "backdrop-hue-rotate": [{ "backdrop-hue-rotate": [
1510
+ isNumber,
1511
+ isArbitraryVariable,
1512
+ isArbitraryValue
1513
+ ] }],
1514
+ "backdrop-invert": [{ "backdrop-invert": [
1515
+ "",
1516
+ isNumber,
1517
+ isArbitraryVariable,
1518
+ isArbitraryValue
1519
+ ] }],
1520
+ "backdrop-opacity": [{ "backdrop-opacity": [
1521
+ isNumber,
1522
+ isArbitraryVariable,
1523
+ isArbitraryValue
1524
+ ] }],
1525
+ "backdrop-saturate": [{ "backdrop-saturate": [
1526
+ isNumber,
1527
+ isArbitraryVariable,
1528
+ isArbitraryValue
1529
+ ] }],
1530
+ "backdrop-sepia": [{ "backdrop-sepia": [
1531
+ "",
1532
+ isNumber,
1533
+ isArbitraryVariable,
1534
+ isArbitraryValue
1535
+ ] }],
1536
+ "border-collapse": [{ border: ["collapse", "separate"] }],
1537
+ "border-spacing": [{ "border-spacing": scaleUnambiguousSpacing() }],
1538
+ "border-spacing-x": [{ "border-spacing-x": scaleUnambiguousSpacing() }],
1539
+ "border-spacing-y": [{ "border-spacing-y": scaleUnambiguousSpacing() }],
1540
+ "table-layout": [{ table: ["auto", "fixed"] }],
1541
+ caption: [{ caption: ["top", "bottom"] }],
1542
+ transition: [{ transition: [
1543
+ "",
1544
+ "all",
1545
+ "colors",
1546
+ "opacity",
1547
+ "shadow",
1548
+ "transform",
1549
+ "none",
1550
+ isArbitraryVariable,
1551
+ isArbitraryValue
1552
+ ] }],
1553
+ "transition-behavior": [{ transition: ["normal", "discrete"] }],
1554
+ duration: [{ duration: [
1555
+ isNumber,
1556
+ "initial",
1557
+ isArbitraryVariable,
1558
+ isArbitraryValue
1559
+ ] }],
1560
+ ease: [{ ease: [
1561
+ "linear",
1562
+ "initial",
1563
+ themeEase,
1564
+ isArbitraryVariable,
1565
+ isArbitraryValue
1566
+ ] }],
1567
+ delay: [{ delay: [
1568
+ isNumber,
1569
+ isArbitraryVariable,
1570
+ isArbitraryValue
1571
+ ] }],
1572
+ animate: [{ animate: [
1573
+ "none",
1574
+ themeAnimate,
1575
+ isArbitraryVariable,
1576
+ isArbitraryValue
1577
+ ] }],
1578
+ backface: [{ backface: ["hidden", "visible"] }],
1579
+ perspective: [{ perspective: [
1580
+ themePerspective,
1581
+ isArbitraryVariable,
1582
+ isArbitraryValue
1583
+ ] }],
1584
+ "perspective-origin": [{ "perspective-origin": scalePositionWithArbitrary() }],
1585
+ rotate: [{ rotate: scaleRotate() }],
1586
+ "rotate-x": [{ "rotate-x": scaleRotate() }],
1587
+ "rotate-y": [{ "rotate-y": scaleRotate() }],
1588
+ "rotate-z": [{ "rotate-z": scaleRotate() }],
1589
+ scale: [{ scale: scaleScale() }],
1590
+ "scale-x": [{ "scale-x": scaleScale() }],
1591
+ "scale-y": [{ "scale-y": scaleScale() }],
1592
+ "scale-z": [{ "scale-z": scaleScale() }],
1593
+ "scale-3d": ["scale-3d"],
1594
+ skew: [{ skew: scaleSkew() }],
1595
+ "skew-x": [{ "skew-x": scaleSkew() }],
1596
+ "skew-y": [{ "skew-y": scaleSkew() }],
1597
+ transform: [{ transform: [
1598
+ isArbitraryVariable,
1599
+ isArbitraryValue,
1600
+ "",
1601
+ "none",
1602
+ "gpu",
1603
+ "cpu"
1604
+ ] }],
1605
+ "transform-origin": [{ origin: scalePositionWithArbitrary() }],
1606
+ "transform-style": [{ transform: ["3d", "flat"] }],
1607
+ translate: [{ translate: scaleTranslate() }],
1608
+ "translate-x": [{ "translate-x": scaleTranslate() }],
1609
+ "translate-y": [{ "translate-y": scaleTranslate() }],
1610
+ "translate-z": [{ "translate-z": scaleTranslate() }],
1611
+ "translate-none": ["translate-none"],
1612
+ accent: [{ accent: scaleColor() }],
1613
+ appearance: [{ appearance: ["none", "auto"] }],
1614
+ "caret-color": [{ caret: scaleColor() }],
1615
+ "color-scheme": [{ scheme: [
1616
+ "normal",
1617
+ "dark",
1618
+ "light",
1619
+ "light-dark",
1620
+ "only-dark",
1621
+ "only-light"
1622
+ ] }],
1623
+ cursor: [{ cursor: [
1624
+ "auto",
1625
+ "default",
1626
+ "pointer",
1627
+ "wait",
1628
+ "text",
1629
+ "move",
1630
+ "help",
1631
+ "not-allowed",
1632
+ "none",
1633
+ "context-menu",
1634
+ "progress",
1635
+ "cell",
1636
+ "crosshair",
1637
+ "vertical-text",
1638
+ "alias",
1639
+ "copy",
1640
+ "no-drop",
1641
+ "grab",
1642
+ "grabbing",
1643
+ "all-scroll",
1644
+ "col-resize",
1645
+ "row-resize",
1646
+ "n-resize",
1647
+ "e-resize",
1648
+ "s-resize",
1649
+ "w-resize",
1650
+ "ne-resize",
1651
+ "nw-resize",
1652
+ "se-resize",
1653
+ "sw-resize",
1654
+ "ew-resize",
1655
+ "ns-resize",
1656
+ "nesw-resize",
1657
+ "nwse-resize",
1658
+ "zoom-in",
1659
+ "zoom-out",
1660
+ isArbitraryVariable,
1661
+ isArbitraryValue
1662
+ ] }],
1663
+ "field-sizing": [{ "field-sizing": ["fixed", "content"] }],
1664
+ "pointer-events": [{ "pointer-events": ["auto", "none"] }],
1665
+ resize: [{ resize: [
1666
+ "none",
1667
+ "",
1668
+ "y",
1669
+ "x"
1670
+ ] }],
1671
+ "scroll-behavior": [{ scroll: ["auto", "smooth"] }],
1672
+ "scroll-m": [{ "scroll-m": scaleUnambiguousSpacing() }],
1673
+ "scroll-mx": [{ "scroll-mx": scaleUnambiguousSpacing() }],
1674
+ "scroll-my": [{ "scroll-my": scaleUnambiguousSpacing() }],
1675
+ "scroll-ms": [{ "scroll-ms": scaleUnambiguousSpacing() }],
1676
+ "scroll-me": [{ "scroll-me": scaleUnambiguousSpacing() }],
1677
+ "scroll-mt": [{ "scroll-mt": scaleUnambiguousSpacing() }],
1678
+ "scroll-mr": [{ "scroll-mr": scaleUnambiguousSpacing() }],
1679
+ "scroll-mb": [{ "scroll-mb": scaleUnambiguousSpacing() }],
1680
+ "scroll-ml": [{ "scroll-ml": scaleUnambiguousSpacing() }],
1681
+ "scroll-p": [{ "scroll-p": scaleUnambiguousSpacing() }],
1682
+ "scroll-px": [{ "scroll-px": scaleUnambiguousSpacing() }],
1683
+ "scroll-py": [{ "scroll-py": scaleUnambiguousSpacing() }],
1684
+ "scroll-ps": [{ "scroll-ps": scaleUnambiguousSpacing() }],
1685
+ "scroll-pe": [{ "scroll-pe": scaleUnambiguousSpacing() }],
1686
+ "scroll-pt": [{ "scroll-pt": scaleUnambiguousSpacing() }],
1687
+ "scroll-pr": [{ "scroll-pr": scaleUnambiguousSpacing() }],
1688
+ "scroll-pb": [{ "scroll-pb": scaleUnambiguousSpacing() }],
1689
+ "scroll-pl": [{ "scroll-pl": scaleUnambiguousSpacing() }],
1690
+ "snap-align": [{ snap: [
1691
+ "start",
1692
+ "end",
1693
+ "center",
1694
+ "align-none"
1695
+ ] }],
1696
+ "snap-stop": [{ snap: ["normal", "always"] }],
1697
+ "snap-type": [{ snap: [
1698
+ "none",
1699
+ "x",
1700
+ "y",
1701
+ "both"
1702
+ ] }],
1703
+ "snap-strictness": [{ snap: ["mandatory", "proximity"] }],
1704
+ touch: [{ touch: [
1705
+ "auto",
1706
+ "none",
1707
+ "manipulation"
1708
+ ] }],
1709
+ "touch-x": [{ "touch-pan": [
1710
+ "x",
1711
+ "left",
1712
+ "right"
1713
+ ] }],
1714
+ "touch-y": [{ "touch-pan": [
1715
+ "y",
1716
+ "up",
1717
+ "down"
1718
+ ] }],
1719
+ "touch-pz": ["touch-pinch-zoom"],
1720
+ select: [{ select: [
1721
+ "none",
1722
+ "text",
1723
+ "all",
1724
+ "auto"
1725
+ ] }],
1726
+ "will-change": [{ "will-change": [
1727
+ "auto",
1728
+ "scroll",
1729
+ "contents",
1730
+ "transform",
1731
+ isArbitraryVariable,
1732
+ isArbitraryValue
1733
+ ] }],
1734
+ fill: [{ fill: ["none", ...scaleColor()] }],
1735
+ "stroke-w": [{ stroke: [
1736
+ isNumber,
1737
+ isArbitraryVariableLength,
1738
+ isArbitraryLength,
1739
+ isArbitraryNumber
1740
+ ] }],
1741
+ stroke: [{ stroke: ["none", ...scaleColor()] }],
1742
+ "forced-color-adjust": [{ "forced-color-adjust": ["auto", "none"] }]
1743
+ },
1744
+ conflictingClassGroups: {
1745
+ overflow: ["overflow-x", "overflow-y"],
1746
+ overscroll: ["overscroll-x", "overscroll-y"],
1747
+ inset: [
1748
+ "inset-x",
1749
+ "inset-y",
1750
+ "start",
1751
+ "end",
1752
+ "top",
1753
+ "right",
1754
+ "bottom",
1755
+ "left"
1756
+ ],
1757
+ "inset-x": ["right", "left"],
1758
+ "inset-y": ["top", "bottom"],
1759
+ flex: [
1760
+ "basis",
1761
+ "grow",
1762
+ "shrink"
1763
+ ],
1764
+ gap: ["gap-x", "gap-y"],
1765
+ p: [
1766
+ "px",
1767
+ "py",
1768
+ "ps",
1769
+ "pe",
1770
+ "pt",
1771
+ "pr",
1772
+ "pb",
1773
+ "pl"
1774
+ ],
1775
+ px: ["pr", "pl"],
1776
+ py: ["pt", "pb"],
1777
+ m: [
1778
+ "mx",
1779
+ "my",
1780
+ "ms",
1781
+ "me",
1782
+ "mt",
1783
+ "mr",
1784
+ "mb",
1785
+ "ml"
1786
+ ],
1787
+ mx: ["mr", "ml"],
1788
+ my: ["mt", "mb"],
1789
+ size: ["w", "h"],
1790
+ "font-size": ["leading"],
1791
+ "fvn-normal": [
1792
+ "fvn-ordinal",
1793
+ "fvn-slashed-zero",
1794
+ "fvn-figure",
1795
+ "fvn-spacing",
1796
+ "fvn-fraction"
1797
+ ],
1798
+ "fvn-ordinal": ["fvn-normal"],
1799
+ "fvn-slashed-zero": ["fvn-normal"],
1800
+ "fvn-figure": ["fvn-normal"],
1801
+ "fvn-spacing": ["fvn-normal"],
1802
+ "fvn-fraction": ["fvn-normal"],
1803
+ "line-clamp": ["display", "overflow"],
1804
+ rounded: [
1805
+ "rounded-s",
1806
+ "rounded-e",
1807
+ "rounded-t",
1808
+ "rounded-r",
1809
+ "rounded-b",
1810
+ "rounded-l",
1811
+ "rounded-ss",
1812
+ "rounded-se",
1813
+ "rounded-ee",
1814
+ "rounded-es",
1815
+ "rounded-tl",
1816
+ "rounded-tr",
1817
+ "rounded-br",
1818
+ "rounded-bl"
1819
+ ],
1820
+ "rounded-s": ["rounded-ss", "rounded-es"],
1821
+ "rounded-e": ["rounded-se", "rounded-ee"],
1822
+ "rounded-t": ["rounded-tl", "rounded-tr"],
1823
+ "rounded-r": ["rounded-tr", "rounded-br"],
1824
+ "rounded-b": ["rounded-br", "rounded-bl"],
1825
+ "rounded-l": ["rounded-tl", "rounded-bl"],
1826
+ "border-spacing": ["border-spacing-x", "border-spacing-y"],
1827
+ "border-w": [
1828
+ "border-w-x",
1829
+ "border-w-y",
1830
+ "border-w-s",
1831
+ "border-w-e",
1832
+ "border-w-t",
1833
+ "border-w-r",
1834
+ "border-w-b",
1835
+ "border-w-l"
1836
+ ],
1837
+ "border-w-x": ["border-w-r", "border-w-l"],
1838
+ "border-w-y": ["border-w-t", "border-w-b"],
1839
+ "border-color": [
1840
+ "border-color-x",
1841
+ "border-color-y",
1842
+ "border-color-s",
1843
+ "border-color-e",
1844
+ "border-color-t",
1845
+ "border-color-r",
1846
+ "border-color-b",
1847
+ "border-color-l"
1848
+ ],
1849
+ "border-color-x": ["border-color-r", "border-color-l"],
1850
+ "border-color-y": ["border-color-t", "border-color-b"],
1851
+ translate: [
1852
+ "translate-x",
1853
+ "translate-y",
1854
+ "translate-none"
1855
+ ],
1856
+ "translate-none": [
1857
+ "translate",
1858
+ "translate-x",
1859
+ "translate-y",
1860
+ "translate-z"
1861
+ ],
1862
+ "scroll-m": [
1863
+ "scroll-mx",
1864
+ "scroll-my",
1865
+ "scroll-ms",
1866
+ "scroll-me",
1867
+ "scroll-mt",
1868
+ "scroll-mr",
1869
+ "scroll-mb",
1870
+ "scroll-ml"
1871
+ ],
1872
+ "scroll-mx": ["scroll-mr", "scroll-ml"],
1873
+ "scroll-my": ["scroll-mt", "scroll-mb"],
1874
+ "scroll-p": [
1875
+ "scroll-px",
1876
+ "scroll-py",
1877
+ "scroll-ps",
1878
+ "scroll-pe",
1879
+ "scroll-pt",
1880
+ "scroll-pr",
1881
+ "scroll-pb",
1882
+ "scroll-pl"
1883
+ ],
1884
+ "scroll-px": ["scroll-pr", "scroll-pl"],
1885
+ "scroll-py": ["scroll-pt", "scroll-pb"],
1886
+ touch: [
1887
+ "touch-x",
1888
+ "touch-y",
1889
+ "touch-pz"
1890
+ ],
1891
+ "touch-x": ["touch"],
1892
+ "touch-y": ["touch"],
1893
+ "touch-pz": ["touch"]
1894
+ },
1895
+ conflictingClassGroupModifiers: { "font-size": ["leading"] },
1896
+ orderSensitiveModifiers: [
1897
+ "*",
1898
+ "**",
1899
+ "after",
1900
+ "backdrop",
1901
+ "before",
1902
+ "details-content",
1903
+ "file",
1904
+ "first-letter",
1905
+ "first-line",
1906
+ "marker",
1907
+ "placeholder",
1908
+ "selection"
1909
+ ]
1910
+ };
1911
+ };
1912
+ const twMerge = /* @__PURE__ */ createTailwindMerge(getDefaultConfig);
1913
+
1914
+ //#endregion
1915
+ //#region src/utils/index.ts
1916
+ const ts = await import("typescript");
1917
+ function cn(...inputs) {
1918
+ return twMerge(clsx(inputs));
1919
+ }
1920
+ const baseModules = {
1921
+ "ui-kit": ui,
1922
+ "ui-kit/utils": utils
1923
+ };
1924
+ const compilationCache = /* @__PURE__ */ new Map();
1925
+ const simpleHash = (str) => {
1926
+ let hash = 0;
1927
+ if (str.length === 0) return "0";
1928
+ for (let i = 0; i < str.length; i++) {
1929
+ const char = str.charCodeAt(i);
1930
+ hash = (hash << 5) - hash + char;
1931
+ hash = hash & hash;
1932
+ }
1933
+ return Math.abs(hash).toString(36);
1934
+ };
1935
+ const createCacheKey = (code, modules) => {
1936
+ const moduleKeys = Object.keys(modules).sort().join(",");
1937
+ return simpleHash(code + "|" + moduleKeys);
1938
+ };
1939
+ const compile = (code, modules) => {
1940
+ const cacheKey = createCacheKey(code, modules);
1941
+ if (compilationCache.has(cacheKey)) return compilationCache.get(cacheKey);
1942
+ const result = compileModule(code, modules);
1943
+ if (compilationCache.size >= CONFIG.CACHE_LIMIT) {
1944
+ const firstKey = compilationCache.keys().next().value;
1945
+ if (firstKey) compilationCache.delete(firstKey);
1946
+ }
1947
+ compilationCache.set(cacheKey, result);
1948
+ return result;
1949
+ };
1950
+ const clearCompilationCache = () => {
1951
+ compilationCache.clear();
1952
+ console.log("🧹 Compilation cache cleared");
1953
+ };
1954
+ const TS_COMPILER_OPTIONS = {
1955
+ target: ts.ScriptTarget.ES2020,
1956
+ module: ts.ModuleKind.CommonJS,
1957
+ jsx: ts.JsxEmit.React,
1958
+ strict: false,
1959
+ esModuleInterop: true,
1960
+ skipLibCheck: true,
1961
+ declaration: false
1962
+ };
1963
+ const compileTypeScript = (code) => {
1964
+ try {
1965
+ return ts.transpileModule(code, { compilerOptions: TS_COMPILER_OPTIONS }).outputText;
1966
+ } catch (e) {
1967
+ console.error("❌ TypeScript compilation error:", e);
1968
+ return code;
1969
+ }
1970
+ };
1971
+ const transformCode = (code) => {
1972
+ try {
1973
+ return Babel.transform(code, {
1974
+ presets: ["env", "react"],
1975
+ sourceType: "module",
1976
+ plugins: [[Babel.availablePlugins["transform-modules-commonjs"]]]
1977
+ }).code || "";
1978
+ } catch (e) {
1979
+ console.error("❌ Babel transformation error:", e);
1980
+ return code;
1981
+ }
1982
+ };
1983
+ const detectTypeScript = (code) => {
1984
+ return TS_PATTERNS.some((pattern) => pattern.test(code));
1985
+ };
1986
+ const compileModule = (code, modules) => {
1987
+ const jsCode = detectTypeScript(code) ? compileTypeScript(code) : code;
1988
+ let render;
1989
+ try {
1990
+ render = new Function("exports", "require", "module", "React", transformCode(jsCode));
1991
+ } catch (e) {
1992
+ return {
1993
+ exports: {},
1994
+ error: e instanceof Error ? e.message : "Syntax error"
1995
+ };
1996
+ }
1997
+ const module = { exports: {} };
1998
+ const customRequire = (name) => {
1999
+ if (name === "react") return React;
2000
+ if (modules?.[name]) return modules[name];
2001
+ throw new Error(`λͺ¨λ“ˆμ„ 찾을 수 μ—†μŒ: ${name}`);
2002
+ };
2003
+ try {
2004
+ render(module.exports, customRequire, module, React);
2005
+ } catch (e) {
2006
+ return {
2007
+ exports: {},
2008
+ error: e instanceof Error ? e.message : "λŸ°νƒ€μž„ μ—λŸ¬"
2009
+ };
2010
+ }
2011
+ return module;
2012
+ };
2013
+ const extractSections = (code) => {
2014
+ return [...code.replace(REGEX.COMMENT, "").matchAll(REGEX.SECTION)].map((m, i) => {
2015
+ const sectionCode = m[0];
2016
+ const dataNameMatch = sectionCode.match(REGEX.DATA_NAME);
2017
+ return {
2018
+ code: sectionCode,
2019
+ id: `${i}`,
2020
+ name: dataNameMatch?.[1] || `${i + 1}번째 μ»΄ν¬λ„ŒνŠΈ`
2021
+ };
2022
+ });
2023
+ };
2024
+ const replaceSections = (code, sections) => {
2025
+ const comments = [...code.matchAll(REGEX.COMMENT)].map((match) => match[0]);
2026
+ const cleanCode = code.replace(REGEX.SECTION, "");
2027
+ const match = cleanCode.match(REGEX.CONTAINER);
2028
+ if (match) {
2029
+ const [, openTag, , closeTag] = match;
2030
+ const allContent = [...sections, ...comments].join("\n");
2031
+ return cleanCode.replace(REGEX.CONTAINER, `${openTag}\n${allContent}\n${closeTag}`);
2032
+ }
2033
+ return code;
2034
+ };
2035
+ const generateSection = (code, fullCode) => {
2036
+ const match = fullCode.match(REGEX.CONTAINER);
2037
+ if (!match) return fullCode;
2038
+ const [, openTag, , closeTag] = match;
2039
+ return fullCode.replace(REGEX.CONTAINER, `${openTag}\n${code}\n${closeTag}`);
2040
+ };
2041
+ const scriptCache = /* @__PURE__ */ new Map();
2042
+ const loadingScriptCache = /* @__PURE__ */ new Map();
2043
+ const getCachedScriptBlob = async (src) => {
2044
+ const cached = scriptCache.get(src);
2045
+ if (cached) return cached;
2046
+ const existing = loadingScriptCache.get(src);
2047
+ if (existing) return existing;
2048
+ const promise = fetch(src).then((res) => res.text()).then((text) => {
2049
+ const blob = new Blob([text], { type: "application/javascript" });
2050
+ const blobUrl = URL.createObjectURL(blob);
2051
+ if (scriptCache.size >= CONFIG.CACHE_LIMIT) {
2052
+ const firstKey = scriptCache.keys().next().value;
2053
+ if (firstKey) {
2054
+ const evictedUrl = scriptCache.get(firstKey);
2055
+ if (evictedUrl) URL.revokeObjectURL(evictedUrl);
2056
+ scriptCache.delete(firstKey);
2057
+ }
2058
+ }
2059
+ scriptCache.set(src, blobUrl);
2060
+ loadingScriptCache.delete(src);
2061
+ return blobUrl;
2062
+ });
2063
+ loadingScriptCache.set(src, promise);
2064
+ return promise;
2065
+ };
2066
+ const preloadScripts = (scripts) => {
2067
+ scripts.forEach((src) => getCachedScriptBlob(src));
2068
+ };
2069
+
2070
+ //#endregion
2071
+ export { detectTypeScript as a, getCachedScriptBlob as c, transformCode as d, compile as i, preloadScripts as l, clearCompilationCache as n, extractSections as o, cn as r, generateSection as s, baseModules as t, replaceSections as u };
2072
+ //# sourceMappingURL=utils-INSWI9h0.mjs.map