@easy-editor/setters 0.0.2

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/index.js ADDED
@@ -0,0 +1,3764 @@
1
+ /* @easy-editor/setters v0.0.1 */
2
+ (function (global, factory) {
3
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('@radix-ui/react-slot'), require('react/jsx-runtime'), require('@radix-ui/react-popover'), require('@uiw/react-color-sketch'), require('@radix-ui/react-switch'), require('lucide-react'), require('@radix-ui/react-collapsible'), require('@radix-ui/react-tabs'), require('@radix-ui/react-label')) :
4
+ typeof define === 'function' && define.amd ? define(['exports', 'react', '@radix-ui/react-slot', 'react/jsx-runtime', '@radix-ui/react-popover', '@uiw/react-color-sketch', '@radix-ui/react-switch', 'lucide-react', '@radix-ui/react-collapsible', '@radix-ui/react-tabs', '@radix-ui/react-label'], factory) :
5
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.EasyEditorSetters = {}, global.React, global.reactSlot, global.jsxRuntime, global.PopoverPrimitive, global.Sketch, global.SwitchPrimitive, global.lucideReact, global.CollapsiblePrimitive, global.TabsPrimitive, global.LabelPrimitive));
6
+ })(this, (function (exports, React, reactSlot, jsxRuntime, PopoverPrimitive, Sketch, SwitchPrimitive, lucideReact, CollapsiblePrimitive, TabsPrimitive, LabelPrimitive) { 'use strict';
7
+
8
+ function _interopNamespaceDefault(e) {
9
+ var n = Object.create(null);
10
+ if (e) {
11
+ Object.keys(e).forEach(function (k) {
12
+ if (k !== 'default') {
13
+ var d = Object.getOwnPropertyDescriptor(e, k);
14
+ Object.defineProperty(n, k, d.get ? d : {
15
+ enumerable: true,
16
+ get: function () { return e[k]; }
17
+ });
18
+ }
19
+ });
20
+ }
21
+ n.default = e;
22
+ return Object.freeze(n);
23
+ }
24
+
25
+ var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
26
+ var PopoverPrimitive__namespace = /*#__PURE__*/_interopNamespaceDefault(PopoverPrimitive);
27
+ var SwitchPrimitive__namespace = /*#__PURE__*/_interopNamespaceDefault(SwitchPrimitive);
28
+ var CollapsiblePrimitive__namespace = /*#__PURE__*/_interopNamespaceDefault(CollapsiblePrimitive);
29
+ var TabsPrimitive__namespace = /*#__PURE__*/_interopNamespaceDefault(TabsPrimitive);
30
+ var LabelPrimitive__namespace = /*#__PURE__*/_interopNamespaceDefault(LabelPrimitive);
31
+
32
+ function styleInject(css, ref) {
33
+ if (ref === void 0) ref = {};
34
+ var insertAt = ref.insertAt;
35
+ if (typeof document === 'undefined') {
36
+ return;
37
+ }
38
+ var head = document.head || document.getElementsByTagName('head')[0];
39
+ var style = document.createElement('style');
40
+ style.type = 'text/css';
41
+ if (insertAt === 'top') {
42
+ if (head.firstChild) {
43
+ head.insertBefore(style, head.firstChild);
44
+ } else {
45
+ head.appendChild(style);
46
+ }
47
+ } else {
48
+ head.appendChild(style);
49
+ }
50
+ if (style.styleSheet) {
51
+ style.styleSheet.cssText = css;
52
+ } else {
53
+ style.appendChild(document.createTextNode(css));
54
+ }
55
+ }
56
+
57
+ var css_248z = "@import \"tailwindcss\";@import \"tw-animate-css\";@custom-variant dark (&:is(.dark *));:root{--background:#fff;--foreground:#09090b;--card:#fff;--card-foreground:#09090b;--popover:#fff;--popover-foreground:#09090b;--primary:#18181b;--primary-foreground:#fafafa;--secondary:#f4f4f5;--secondary-foreground:#18181b;--muted:#f4f4f5;--muted-foreground:#71717a;--accent:#f4f4f5;--accent-foreground:#18181b;--destructive:#ef4444;--destructive-foreground:#fafafa;--border:#e4e4e7;--input:#e4e4e7;--ring:#09090b;--chart-1:#e76e50;--chart-2:#2a9d90;--chart-3:#274754;--chart-4:#e8c468;--chart-5:#f4a462;--radius:0.6rem;--sidebar:#fafafa;--sidebar-foreground:#3f3f46;--sidebar-primary:#18181b;--sidebar-primary-foreground:#fafafa;--sidebar-accent:#f4f4f5;--sidebar-accent-foreground:#18181b;--sidebar-border:#e5e7eb;--sidebar-ring:#3b82f6}.dark{--background:#09090b;--foreground:#fafafa;--card:#09090b;--card-foreground:#fafafa;--popover:#09090b;--popover-foreground:#fafafa;--primary:#fafafa;--primary-foreground:#18181b;--secondary:#27272a;--secondary-foreground:#fafafa;--muted:#27272a;--muted-foreground:#a1a1aa;--accent:#27272a;--accent-foreground:#fafafa;--destructive:#7f1d1d;--destructive-foreground:#fafafa;--border:#27272a;--input:#27272a;--ring:#d4d4d8;--chart-1:#2662d9;--chart-2:#2eb88a;--chart-3:#e88c30;--chart-4:#af57db;--chart-5:#e23670;--sidebar:#18181b;--sidebar-foreground:#f4f4f5;--sidebar-primary:#1d4ed8;--sidebar-primary-foreground:#fff;--sidebar-accent:#27272a;--sidebar-accent-foreground:#f4f4f5;--sidebar-border:#27272a;--sidebar-ring:#3b82f6}@theme inline{--color-background:var(--background);--color-foreground:var(--foreground);--color-card:var(--card);--color-card-foreground:var(--card-foreground);--color-popover:var(--popover);--color-popover-foreground:var(--popover-foreground);--color-primary:var(--primary);--color-primary-foreground:var(--primary-foreground);--color-secondary:var(--secondary);--color-secondary-foreground:var(--secondary-foreground);--color-muted:var(--muted);--color-muted-foreground:var(--muted-foreground);--color-accent:var(--accent);--color-accent-foreground:var(--accent-foreground);--color-destructive:var(--destructive);--color-destructive-foreground:var(--destructive-foreground);--color-border:var(--border);--color-input:var(--input);--color-ring:var(--ring);--color-chart-1:var(--chart-1);--color-chart-2:var(--chart-2);--color-chart-3:var(--chart-3);--color-chart-4:var(--chart-4);--color-chart-5:var(--chart-5);--radius-sm:calc(var(--radius) - 4px);--radius-md:calc(var(--radius) - 2px);--radius-lg:var(--radius);--radius-xl:calc(var(--radius) + 4px);--color-sidebar:var(--sidebar);--color-sidebar-foreground:var(--sidebar-foreground);--color-sidebar-primary:var(--sidebar-primary);--color-sidebar-primary-foreground:var(--sidebar-primary-foreground);--color-sidebar-accent:var(--sidebar-accent);--color-sidebar-accent-foreground:var(--sidebar-accent-foreground);--color-sidebar-border:var(--sidebar-border);--color-sidebar-ring:var(--sidebar-ring)}@layer base{*,body{@apply bg-background text-foreground}}[data-color-mode*=dark] .w-color-sketch{--sketch-background:var(--popover)!important}[data-color-mode*=dark] .w-color-swatch{--sketch-swatch-border-top:1px solid var(--border)!important}[data-color-mode*=dark] .w-color-editable-input{--editable-input-label-color:var(--primary)!important;--editable-input-box-shadow:var(--border) 0px 0px 0px 1px inset!important;--editable-input-color:var(--primary)!important}[data-color-mode*=dark] .w-color-alpha{--alpha-pointer-background-color:var(--popover)!important;--alpha-pointer-box-shadow:transparent 0px 1px 4px 0px!important}";
58
+ styleInject(css_248z,{"insertAt":"top"});
59
+
60
+ 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}
61
+
62
+ const falsyToString = (value)=>typeof value === "boolean" ? `${value}` : value === 0 ? "0" : value;
63
+ const cx = clsx;
64
+ const cva = (base, config)=>(props)=>{
65
+ var _config_compoundVariants;
66
+ if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
67
+ const { variants, defaultVariants } = config;
68
+ const getVariantClassNames = Object.keys(variants).map((variant)=>{
69
+ const variantProp = props === null || props === void 0 ? void 0 : props[variant];
70
+ const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];
71
+ if (variantProp === null) return null;
72
+ const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);
73
+ return variants[variant][variantKey];
74
+ });
75
+ const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param)=>{
76
+ let [key, value] = param;
77
+ if (value === undefined) {
78
+ return acc;
79
+ }
80
+ acc[key] = value;
81
+ return acc;
82
+ }, {});
83
+ const getCompoundVariantClassNames = config === null || config === void 0 ? void 0 : (_config_compoundVariants = config.compoundVariants) === null || _config_compoundVariants === void 0 ? void 0 : _config_compoundVariants.reduce((acc, param)=>{
84
+ let { class: cvClass, className: cvClassName, ...compoundVariantOptions } = param;
85
+ return Object.entries(compoundVariantOptions).every((param)=>{
86
+ let [key, value] = param;
87
+ return Array.isArray(value) ? value.includes({
88
+ ...defaultVariants,
89
+ ...propsWithoutUndefined
90
+ }[key]) : ({
91
+ ...defaultVariants,
92
+ ...propsWithoutUndefined
93
+ })[key] === value;
94
+ }) ? [
95
+ ...acc,
96
+ cvClass,
97
+ cvClassName
98
+ ] : acc;
99
+ }, []);
100
+ return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
101
+ };
102
+
103
+ /**
104
+ * Concatenates two arrays faster than the array spread operator.
105
+ */
106
+ const concatArrays = (array1, array2) => {
107
+ // Pre-allocate for better V8 optimization
108
+ const combinedArray = new Array(array1.length + array2.length);
109
+ for (let i = 0; i < array1.length; i++) {
110
+ combinedArray[i] = array1[i];
111
+ }
112
+ for (let i = 0; i < array2.length; i++) {
113
+ combinedArray[array1.length + i] = array2[i];
114
+ }
115
+ return combinedArray;
116
+ };
117
+
118
+ // Factory function ensures consistent object shapes
119
+ const createClassValidatorObject = (classGroupId, validator) => ({
120
+ classGroupId,
121
+ validator
122
+ });
123
+ // Factory ensures consistent ClassPartObject shape
124
+ const createClassPartObject = (nextPart = new Map(), validators = null, classGroupId) => ({
125
+ nextPart,
126
+ validators,
127
+ classGroupId
128
+ });
129
+ const CLASS_PART_SEPARATOR = '-';
130
+ const EMPTY_CONFLICTS = [];
131
+ // I use two dots here because one dot is used as prefix for class groups in plugins
132
+ const ARBITRARY_PROPERTY_PREFIX = 'arbitrary..';
133
+ const createClassGroupUtils = config => {
134
+ const classMap = createClassMap(config);
135
+ const {
136
+ conflictingClassGroups,
137
+ conflictingClassGroupModifiers
138
+ } = config;
139
+ const getClassGroupId = className => {
140
+ if (className.startsWith('[') && className.endsWith(']')) {
141
+ return getGroupIdForArbitraryProperty(className);
142
+ }
143
+ const classParts = className.split(CLASS_PART_SEPARATOR);
144
+ // Classes like `-inset-1` produce an empty string as first classPart. We assume that classes for negative values are used correctly and skip it.
145
+ const startIndex = classParts[0] === '' && classParts.length > 1 ? 1 : 0;
146
+ return getGroupRecursive(classParts, startIndex, classMap);
147
+ };
148
+ const getConflictingClassGroupIds = (classGroupId, hasPostfixModifier) => {
149
+ if (hasPostfixModifier) {
150
+ const modifierConflicts = conflictingClassGroupModifiers[classGroupId];
151
+ const baseConflicts = conflictingClassGroups[classGroupId];
152
+ if (modifierConflicts) {
153
+ if (baseConflicts) {
154
+ // Merge base conflicts with modifier conflicts
155
+ return concatArrays(baseConflicts, modifierConflicts);
156
+ }
157
+ // Only modifier conflicts
158
+ return modifierConflicts;
159
+ }
160
+ // Fall back to without postfix if no modifier conflicts
161
+ return baseConflicts || EMPTY_CONFLICTS;
162
+ }
163
+ return conflictingClassGroups[classGroupId] || EMPTY_CONFLICTS;
164
+ };
165
+ return {
166
+ getClassGroupId,
167
+ getConflictingClassGroupIds
168
+ };
169
+ };
170
+ const getGroupRecursive = (classParts, startIndex, classPartObject) => {
171
+ const classPathsLength = classParts.length - startIndex;
172
+ if (classPathsLength === 0) {
173
+ return classPartObject.classGroupId;
174
+ }
175
+ const currentClassPart = classParts[startIndex];
176
+ const nextClassPartObject = classPartObject.nextPart.get(currentClassPart);
177
+ if (nextClassPartObject) {
178
+ const result = getGroupRecursive(classParts, startIndex + 1, nextClassPartObject);
179
+ if (result) return result;
180
+ }
181
+ const validators = classPartObject.validators;
182
+ if (validators === null) {
183
+ return undefined;
184
+ }
185
+ // Build classRest string efficiently by joining from startIndex onwards
186
+ const classRest = startIndex === 0 ? classParts.join(CLASS_PART_SEPARATOR) : classParts.slice(startIndex).join(CLASS_PART_SEPARATOR);
187
+ const validatorsLength = validators.length;
188
+ for (let i = 0; i < validatorsLength; i++) {
189
+ const validatorObj = validators[i];
190
+ if (validatorObj.validator(classRest)) {
191
+ return validatorObj.classGroupId;
192
+ }
193
+ }
194
+ return undefined;
195
+ };
196
+ /**
197
+ * Get the class group ID for an arbitrary property.
198
+ *
199
+ * @param className - The class name to get the group ID for. Is expected to be string starting with `[` and ending with `]`.
200
+ */
201
+ const getGroupIdForArbitraryProperty = className => className.slice(1, -1).indexOf(':') === -1 ? undefined : (() => {
202
+ const content = className.slice(1, -1);
203
+ const colonIndex = content.indexOf(':');
204
+ const property = content.slice(0, colonIndex);
205
+ return property ? ARBITRARY_PROPERTY_PREFIX + property : undefined;
206
+ })();
207
+ /**
208
+ * Exported for testing only
209
+ */
210
+ const createClassMap = config => {
211
+ const {
212
+ theme,
213
+ classGroups
214
+ } = config;
215
+ return processClassGroups(classGroups, theme);
216
+ };
217
+ // Split into separate functions to maintain monomorphic call sites
218
+ const processClassGroups = (classGroups, theme) => {
219
+ const classMap = createClassPartObject();
220
+ for (const classGroupId in classGroups) {
221
+ const group = classGroups[classGroupId];
222
+ processClassesRecursively(group, classMap, classGroupId, theme);
223
+ }
224
+ return classMap;
225
+ };
226
+ const processClassesRecursively = (classGroup, classPartObject, classGroupId, theme) => {
227
+ const len = classGroup.length;
228
+ for (let i = 0; i < len; i++) {
229
+ const classDefinition = classGroup[i];
230
+ processClassDefinition(classDefinition, classPartObject, classGroupId, theme);
231
+ }
232
+ };
233
+ // Split into separate functions for each type to maintain monomorphic call sites
234
+ const processClassDefinition = (classDefinition, classPartObject, classGroupId, theme) => {
235
+ if (typeof classDefinition === 'string') {
236
+ processStringDefinition(classDefinition, classPartObject, classGroupId);
237
+ return;
238
+ }
239
+ if (typeof classDefinition === 'function') {
240
+ processFunctionDefinition(classDefinition, classPartObject, classGroupId, theme);
241
+ return;
242
+ }
243
+ processObjectDefinition(classDefinition, classPartObject, classGroupId, theme);
244
+ };
245
+ const processStringDefinition = (classDefinition, classPartObject, classGroupId) => {
246
+ const classPartObjectToEdit = classDefinition === '' ? classPartObject : getPart(classPartObject, classDefinition);
247
+ classPartObjectToEdit.classGroupId = classGroupId;
248
+ };
249
+ const processFunctionDefinition = (classDefinition, classPartObject, classGroupId, theme) => {
250
+ if (isThemeGetter(classDefinition)) {
251
+ processClassesRecursively(classDefinition(theme), classPartObject, classGroupId, theme);
252
+ return;
253
+ }
254
+ if (classPartObject.validators === null) {
255
+ classPartObject.validators = [];
256
+ }
257
+ classPartObject.validators.push(createClassValidatorObject(classGroupId, classDefinition));
258
+ };
259
+ const processObjectDefinition = (classDefinition, classPartObject, classGroupId, theme) => {
260
+ const entries = Object.entries(classDefinition);
261
+ const len = entries.length;
262
+ for (let i = 0; i < len; i++) {
263
+ const [key, value] = entries[i];
264
+ processClassesRecursively(value, getPart(classPartObject, key), classGroupId, theme);
265
+ }
266
+ };
267
+ const getPart = (classPartObject, path) => {
268
+ let current = classPartObject;
269
+ const parts = path.split(CLASS_PART_SEPARATOR);
270
+ const len = parts.length;
271
+ for (let i = 0; i < len; i++) {
272
+ const part = parts[i];
273
+ let next = current.nextPart.get(part);
274
+ if (!next) {
275
+ next = createClassPartObject();
276
+ current.nextPart.set(part, next);
277
+ }
278
+ current = next;
279
+ }
280
+ return current;
281
+ };
282
+ // Type guard maintains monomorphic check
283
+ const isThemeGetter = func => 'isThemeGetter' in func && func.isThemeGetter === true;
284
+
285
+ // LRU cache implementation using plain objects for simplicity
286
+ const createLruCache = maxCacheSize => {
287
+ if (maxCacheSize < 1) {
288
+ return {
289
+ get: () => undefined,
290
+ set: () => {}
291
+ };
292
+ }
293
+ let cacheSize = 0;
294
+ let cache = Object.create(null);
295
+ let previousCache = Object.create(null);
296
+ const update = (key, value) => {
297
+ cache[key] = value;
298
+ cacheSize++;
299
+ if (cacheSize > maxCacheSize) {
300
+ cacheSize = 0;
301
+ previousCache = cache;
302
+ cache = Object.create(null);
303
+ }
304
+ };
305
+ return {
306
+ get(key) {
307
+ let value = cache[key];
308
+ if (value !== undefined) {
309
+ return value;
310
+ }
311
+ if ((value = previousCache[key]) !== undefined) {
312
+ update(key, value);
313
+ return value;
314
+ }
315
+ },
316
+ set(key, value) {
317
+ if (key in cache) {
318
+ cache[key] = value;
319
+ } else {
320
+ update(key, value);
321
+ }
322
+ }
323
+ };
324
+ };
325
+ const IMPORTANT_MODIFIER = '!';
326
+ const MODIFIER_SEPARATOR = ':';
327
+ const EMPTY_MODIFIERS = [];
328
+ // Pre-allocated result object shape for consistency
329
+ const createResultObject = (modifiers, hasImportantModifier, baseClassName, maybePostfixModifierPosition, isExternal) => ({
330
+ modifiers,
331
+ hasImportantModifier,
332
+ baseClassName,
333
+ maybePostfixModifierPosition,
334
+ isExternal
335
+ });
336
+ const createParseClassName = config => {
337
+ const {
338
+ prefix,
339
+ experimentalParseClassName
340
+ } = config;
341
+ /**
342
+ * Parse class name into parts.
343
+ *
344
+ * Inspired by `splitAtTopLevelOnly` used in Tailwind CSS
345
+ * @see https://github.com/tailwindlabs/tailwindcss/blob/v3.2.2/src/util/splitAtTopLevelOnly.js
346
+ */
347
+ let parseClassName = className => {
348
+ // Use simple array with push for better performance
349
+ const modifiers = [];
350
+ let bracketDepth = 0;
351
+ let parenDepth = 0;
352
+ let modifierStart = 0;
353
+ let postfixModifierPosition;
354
+ const len = className.length;
355
+ for (let index = 0; index < len; index++) {
356
+ const currentCharacter = className[index];
357
+ if (bracketDepth === 0 && parenDepth === 0) {
358
+ if (currentCharacter === MODIFIER_SEPARATOR) {
359
+ modifiers.push(className.slice(modifierStart, index));
360
+ modifierStart = index + 1;
361
+ continue;
362
+ }
363
+ if (currentCharacter === '/') {
364
+ postfixModifierPosition = index;
365
+ continue;
366
+ }
367
+ }
368
+ if (currentCharacter === '[') bracketDepth++;else if (currentCharacter === ']') bracketDepth--;else if (currentCharacter === '(') parenDepth++;else if (currentCharacter === ')') parenDepth--;
369
+ }
370
+ const baseClassNameWithImportantModifier = modifiers.length === 0 ? className : className.slice(modifierStart);
371
+ // Inline important modifier check
372
+ let baseClassName = baseClassNameWithImportantModifier;
373
+ let hasImportantModifier = false;
374
+ if (baseClassNameWithImportantModifier.endsWith(IMPORTANT_MODIFIER)) {
375
+ baseClassName = baseClassNameWithImportantModifier.slice(0, -1);
376
+ hasImportantModifier = true;
377
+ } else if (
378
+ /**
379
+ * In Tailwind CSS v3 the important modifier was at the start of the base class name. This is still supported for legacy reasons.
380
+ * @see https://github.com/dcastil/tailwind-merge/issues/513#issuecomment-2614029864
381
+ */
382
+ baseClassNameWithImportantModifier.startsWith(IMPORTANT_MODIFIER)) {
383
+ baseClassName = baseClassNameWithImportantModifier.slice(1);
384
+ hasImportantModifier = true;
385
+ }
386
+ const maybePostfixModifierPosition = postfixModifierPosition && postfixModifierPosition > modifierStart ? postfixModifierPosition - modifierStart : undefined;
387
+ return createResultObject(modifiers, hasImportantModifier, baseClassName, maybePostfixModifierPosition);
388
+ };
389
+ if (prefix) {
390
+ const fullPrefix = prefix + MODIFIER_SEPARATOR;
391
+ const parseClassNameOriginal = parseClassName;
392
+ parseClassName = className => className.startsWith(fullPrefix) ? parseClassNameOriginal(className.slice(fullPrefix.length)) : createResultObject(EMPTY_MODIFIERS, false, className, undefined, true);
393
+ }
394
+ if (experimentalParseClassName) {
395
+ const parseClassNameOriginal = parseClassName;
396
+ parseClassName = className => experimentalParseClassName({
397
+ className,
398
+ parseClassName: parseClassNameOriginal
399
+ });
400
+ }
401
+ return parseClassName;
402
+ };
403
+
404
+ /**
405
+ * Sorts modifiers according to following schema:
406
+ * - Predefined modifiers are sorted alphabetically
407
+ * - When an arbitrary variant appears, it must be preserved which modifiers are before and after it
408
+ */
409
+ const createSortModifiers = config => {
410
+ // Pre-compute weights for all known modifiers for O(1) comparison
411
+ const modifierWeights = new Map();
412
+ // Assign weights to sensitive modifiers (highest priority, but preserve order)
413
+ config.orderSensitiveModifiers.forEach((mod, index) => {
414
+ modifierWeights.set(mod, 1000000 + index); // High weights for sensitive mods
415
+ });
416
+ return modifiers => {
417
+ const result = [];
418
+ let currentSegment = [];
419
+ // Process modifiers in one pass
420
+ for (let i = 0; i < modifiers.length; i++) {
421
+ const modifier = modifiers[i];
422
+ // Check if modifier is sensitive (starts with '[' or in orderSensitiveModifiers)
423
+ const isArbitrary = modifier[0] === '[';
424
+ const isOrderSensitive = modifierWeights.has(modifier);
425
+ if (isArbitrary || isOrderSensitive) {
426
+ // Sort and flush current segment alphabetically
427
+ if (currentSegment.length > 0) {
428
+ currentSegment.sort();
429
+ result.push(...currentSegment);
430
+ currentSegment = [];
431
+ }
432
+ result.push(modifier);
433
+ } else {
434
+ // Regular modifier - add to current segment for batch sorting
435
+ currentSegment.push(modifier);
436
+ }
437
+ }
438
+ // Sort and add any remaining segment items
439
+ if (currentSegment.length > 0) {
440
+ currentSegment.sort();
441
+ result.push(...currentSegment);
442
+ }
443
+ return result;
444
+ };
445
+ };
446
+ const createConfigUtils = config => ({
447
+ cache: createLruCache(config.cacheSize),
448
+ parseClassName: createParseClassName(config),
449
+ sortModifiers: createSortModifiers(config),
450
+ ...createClassGroupUtils(config)
451
+ });
452
+ const SPLIT_CLASSES_REGEX = /\s+/;
453
+ const mergeClassList = (classList, configUtils) => {
454
+ const {
455
+ parseClassName,
456
+ getClassGroupId,
457
+ getConflictingClassGroupIds,
458
+ sortModifiers
459
+ } = configUtils;
460
+ /**
461
+ * Set of classGroupIds in following format:
462
+ * `{importantModifier}{variantModifiers}{classGroupId}`
463
+ * @example 'float'
464
+ * @example 'hover:focus:bg-color'
465
+ * @example 'md:!pr'
466
+ */
467
+ const classGroupsInConflict = [];
468
+ const classNames = classList.trim().split(SPLIT_CLASSES_REGEX);
469
+ let result = '';
470
+ for (let index = classNames.length - 1; index >= 0; index -= 1) {
471
+ const originalClassName = classNames[index];
472
+ const {
473
+ isExternal,
474
+ modifiers,
475
+ hasImportantModifier,
476
+ baseClassName,
477
+ maybePostfixModifierPosition
478
+ } = parseClassName(originalClassName);
479
+ if (isExternal) {
480
+ result = originalClassName + (result.length > 0 ? ' ' + result : result);
481
+ continue;
482
+ }
483
+ let hasPostfixModifier = !!maybePostfixModifierPosition;
484
+ let classGroupId = getClassGroupId(hasPostfixModifier ? baseClassName.substring(0, maybePostfixModifierPosition) : baseClassName);
485
+ if (!classGroupId) {
486
+ if (!hasPostfixModifier) {
487
+ // Not a Tailwind class
488
+ result = originalClassName + (result.length > 0 ? ' ' + result : result);
489
+ continue;
490
+ }
491
+ classGroupId = getClassGroupId(baseClassName);
492
+ if (!classGroupId) {
493
+ // Not a Tailwind class
494
+ result = originalClassName + (result.length > 0 ? ' ' + result : result);
495
+ continue;
496
+ }
497
+ hasPostfixModifier = false;
498
+ }
499
+ // Fast path: skip sorting for empty or single modifier
500
+ const variantModifier = modifiers.length === 0 ? '' : modifiers.length === 1 ? modifiers[0] : sortModifiers(modifiers).join(':');
501
+ const modifierId = hasImportantModifier ? variantModifier + IMPORTANT_MODIFIER : variantModifier;
502
+ const classId = modifierId + classGroupId;
503
+ if (classGroupsInConflict.indexOf(classId) > -1) {
504
+ // Tailwind class omitted due to conflict
505
+ continue;
506
+ }
507
+ classGroupsInConflict.push(classId);
508
+ const conflictGroups = getConflictingClassGroupIds(classGroupId, hasPostfixModifier);
509
+ for (let i = 0; i < conflictGroups.length; ++i) {
510
+ const group = conflictGroups[i];
511
+ classGroupsInConflict.push(modifierId + group);
512
+ }
513
+ // Tailwind class not in conflict
514
+ result = originalClassName + (result.length > 0 ? ' ' + result : result);
515
+ }
516
+ return result;
517
+ };
518
+
519
+ /**
520
+ * The code in this file is copied from https://github.com/lukeed/clsx and modified to suit the needs of tailwind-merge better.
521
+ *
522
+ * Specifically:
523
+ * - Runtime code from https://github.com/lukeed/clsx/blob/v1.2.1/src/index.js
524
+ * - TypeScript types from https://github.com/lukeed/clsx/blob/v1.2.1/clsx.d.ts
525
+ *
526
+ * Original code has MIT license: Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeed.com)
527
+ */
528
+ const twJoin = (...classLists) => {
529
+ let index = 0;
530
+ let argument;
531
+ let resolvedValue;
532
+ let string = '';
533
+ while (index < classLists.length) {
534
+ if (argument = classLists[index++]) {
535
+ if (resolvedValue = toValue(argument)) {
536
+ string && (string += ' ');
537
+ string += resolvedValue;
538
+ }
539
+ }
540
+ }
541
+ return string;
542
+ };
543
+ const toValue = mix => {
544
+ // Fast path for strings
545
+ if (typeof mix === 'string') {
546
+ return mix;
547
+ }
548
+ let resolvedValue;
549
+ let string = '';
550
+ for (let k = 0; k < mix.length; k++) {
551
+ if (mix[k]) {
552
+ if (resolvedValue = toValue(mix[k])) {
553
+ string && (string += ' ');
554
+ string += resolvedValue;
555
+ }
556
+ }
557
+ }
558
+ return string;
559
+ };
560
+ const createTailwindMerge = (createConfigFirst, ...createConfigRest) => {
561
+ let configUtils;
562
+ let cacheGet;
563
+ let cacheSet;
564
+ let functionToCall;
565
+ const initTailwindMerge = classList => {
566
+ const config = createConfigRest.reduce((previousConfig, createConfigCurrent) => createConfigCurrent(previousConfig), createConfigFirst());
567
+ configUtils = createConfigUtils(config);
568
+ cacheGet = configUtils.cache.get;
569
+ cacheSet = configUtils.cache.set;
570
+ functionToCall = tailwindMerge;
571
+ return tailwindMerge(classList);
572
+ };
573
+ const tailwindMerge = classList => {
574
+ const cachedResult = cacheGet(classList);
575
+ if (cachedResult) {
576
+ return cachedResult;
577
+ }
578
+ const result = mergeClassList(classList, configUtils);
579
+ cacheSet(classList, result);
580
+ return result;
581
+ };
582
+ functionToCall = initTailwindMerge;
583
+ return (...args) => functionToCall(twJoin(...args));
584
+ };
585
+ const fallbackThemeArr = [];
586
+ const fromTheme = key => {
587
+ const themeGetter = theme => theme[key] || fallbackThemeArr;
588
+ themeGetter.isThemeGetter = true;
589
+ return themeGetter;
590
+ };
591
+ const arbitraryValueRegex = /^\[(?:(\w[\w-]*):)?(.+)\]$/i;
592
+ const arbitraryVariableRegex = /^\((?:(\w[\w-]*):)?(.+)\)$/i;
593
+ const fractionRegex = /^\d+\/\d+$/;
594
+ const tshirtUnitRegex = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/;
595
+ 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$/;
596
+ const colorFunctionRegex = /^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/;
597
+ // Shadow always begins with x and y offset separated by underscore optionally prepended by inset
598
+ const shadowRegex = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/;
599
+ const imageRegex = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;
600
+ const isFraction = value => fractionRegex.test(value);
601
+ const isNumber = value => !!value && !Number.isNaN(Number(value));
602
+ const isInteger = value => !!value && Number.isInteger(Number(value));
603
+ const isPercent = value => value.endsWith('%') && isNumber(value.slice(0, -1));
604
+ const isTshirtSize = value => tshirtUnitRegex.test(value);
605
+ const isAny = () => true;
606
+ const isLengthOnly = value =>
607
+ // `colorFunctionRegex` check is necessary because color functions can have percentages in them which which would be incorrectly classified as lengths.
608
+ // For example, `hsl(0 0% 0%)` would be classified as a length without this check.
609
+ // I could also use lookbehind assertion in `lengthUnitRegex` but that isn't supported widely enough.
610
+ lengthUnitRegex.test(value) && !colorFunctionRegex.test(value);
611
+ const isNever = () => false;
612
+ const isShadow = value => shadowRegex.test(value);
613
+ const isImage = value => imageRegex.test(value);
614
+ const isAnyNonArbitrary = value => !isArbitraryValue(value) && !isArbitraryVariable(value);
615
+ const isArbitrarySize = value => getIsArbitraryValue(value, isLabelSize, isNever);
616
+ const isArbitraryValue = value => arbitraryValueRegex.test(value);
617
+ const isArbitraryLength = value => getIsArbitraryValue(value, isLabelLength, isLengthOnly);
618
+ const isArbitraryNumber = value => getIsArbitraryValue(value, isLabelNumber, isNumber);
619
+ const isArbitraryPosition = value => getIsArbitraryValue(value, isLabelPosition, isNever);
620
+ const isArbitraryImage = value => getIsArbitraryValue(value, isLabelImage, isImage);
621
+ const isArbitraryShadow = value => getIsArbitraryValue(value, isLabelShadow, isShadow);
622
+ const isArbitraryVariable = value => arbitraryVariableRegex.test(value);
623
+ const isArbitraryVariableLength = value => getIsArbitraryVariable(value, isLabelLength);
624
+ const isArbitraryVariableFamilyName = value => getIsArbitraryVariable(value, isLabelFamilyName);
625
+ const isArbitraryVariablePosition = value => getIsArbitraryVariable(value, isLabelPosition);
626
+ const isArbitraryVariableSize = value => getIsArbitraryVariable(value, isLabelSize);
627
+ const isArbitraryVariableImage = value => getIsArbitraryVariable(value, isLabelImage);
628
+ const isArbitraryVariableShadow = value => getIsArbitraryVariable(value, isLabelShadow, true);
629
+ // Helpers
630
+ const getIsArbitraryValue = (value, testLabel, testValue) => {
631
+ const result = arbitraryValueRegex.exec(value);
632
+ if (result) {
633
+ if (result[1]) {
634
+ return testLabel(result[1]);
635
+ }
636
+ return testValue(result[2]);
637
+ }
638
+ return false;
639
+ };
640
+ const getIsArbitraryVariable = (value, testLabel, shouldMatchNoLabel = false) => {
641
+ const result = arbitraryVariableRegex.exec(value);
642
+ if (result) {
643
+ if (result[1]) {
644
+ return testLabel(result[1]);
645
+ }
646
+ return shouldMatchNoLabel;
647
+ }
648
+ return false;
649
+ };
650
+ // Labels
651
+ const isLabelPosition = label => label === 'position' || label === 'percentage';
652
+ const isLabelImage = label => label === 'image' || label === 'url';
653
+ const isLabelSize = label => label === 'length' || label === 'size' || label === 'bg-size';
654
+ const isLabelLength = label => label === 'length';
655
+ const isLabelNumber = label => label === 'number';
656
+ const isLabelFamilyName = label => label === 'family-name';
657
+ const isLabelShadow = label => label === 'shadow';
658
+ const getDefaultConfig = () => {
659
+ /**
660
+ * Theme getters for theme variable namespaces
661
+ * @see https://tailwindcss.com/docs/theme#theme-variable-namespaces
662
+ */
663
+ /***/
664
+ const themeColor = fromTheme('color');
665
+ const themeFont = fromTheme('font');
666
+ const themeText = fromTheme('text');
667
+ const themeFontWeight = fromTheme('font-weight');
668
+ const themeTracking = fromTheme('tracking');
669
+ const themeLeading = fromTheme('leading');
670
+ const themeBreakpoint = fromTheme('breakpoint');
671
+ const themeContainer = fromTheme('container');
672
+ const themeSpacing = fromTheme('spacing');
673
+ const themeRadius = fromTheme('radius');
674
+ const themeShadow = fromTheme('shadow');
675
+ const themeInsetShadow = fromTheme('inset-shadow');
676
+ const themeTextShadow = fromTheme('text-shadow');
677
+ const themeDropShadow = fromTheme('drop-shadow');
678
+ const themeBlur = fromTheme('blur');
679
+ const themePerspective = fromTheme('perspective');
680
+ const themeAspect = fromTheme('aspect');
681
+ const themeEase = fromTheme('ease');
682
+ const themeAnimate = fromTheme('animate');
683
+ /**
684
+ * Helpers to avoid repeating the same scales
685
+ *
686
+ * We use functions that create a new array every time they're called instead of static arrays.
687
+ * 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.
688
+ */
689
+ /***/
690
+ const scaleBreak = () => ['auto', 'avoid', 'all', 'avoid-page', 'page', 'left', 'right', 'column'];
691
+ const scalePosition = () => ['center', 'top', 'bottom', 'left', 'right', 'top-left',
692
+ // Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378
693
+ 'left-top', 'top-right',
694
+ // Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378
695
+ 'right-top', 'bottom-right',
696
+ // Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378
697
+ 'right-bottom', 'bottom-left',
698
+ // Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378
699
+ 'left-bottom'];
700
+ const scalePositionWithArbitrary = () => [...scalePosition(), isArbitraryVariable, isArbitraryValue];
701
+ const scaleOverflow = () => ['auto', 'hidden', 'clip', 'visible', 'scroll'];
702
+ const scaleOverscroll = () => ['auto', 'contain', 'none'];
703
+ const scaleUnambiguousSpacing = () => [isArbitraryVariable, isArbitraryValue, themeSpacing];
704
+ const scaleInset = () => [isFraction, 'full', 'auto', ...scaleUnambiguousSpacing()];
705
+ const scaleGridTemplateColsRows = () => [isInteger, 'none', 'subgrid', isArbitraryVariable, isArbitraryValue];
706
+ const scaleGridColRowStartAndEnd = () => ['auto', {
707
+ span: ['full', isInteger, isArbitraryVariable, isArbitraryValue]
708
+ }, isInteger, isArbitraryVariable, isArbitraryValue];
709
+ const scaleGridColRowStartOrEnd = () => [isInteger, 'auto', isArbitraryVariable, isArbitraryValue];
710
+ const scaleGridAutoColsRows = () => ['auto', 'min', 'max', 'fr', isArbitraryVariable, isArbitraryValue];
711
+ const scaleAlignPrimaryAxis = () => ['start', 'end', 'center', 'between', 'around', 'evenly', 'stretch', 'baseline', 'center-safe', 'end-safe'];
712
+ const scaleAlignSecondaryAxis = () => ['start', 'end', 'center', 'stretch', 'center-safe', 'end-safe'];
713
+ const scaleMargin = () => ['auto', ...scaleUnambiguousSpacing()];
714
+ const scaleSizing = () => [isFraction, 'auto', 'full', 'dvw', 'dvh', 'lvw', 'lvh', 'svw', 'svh', 'min', 'max', 'fit', ...scaleUnambiguousSpacing()];
715
+ const scaleColor = () => [themeColor, isArbitraryVariable, isArbitraryValue];
716
+ const scaleBgPosition = () => [...scalePosition(), isArbitraryVariablePosition, isArbitraryPosition, {
717
+ position: [isArbitraryVariable, isArbitraryValue]
718
+ }];
719
+ const scaleBgRepeat = () => ['no-repeat', {
720
+ repeat: ['', 'x', 'y', 'space', 'round']
721
+ }];
722
+ const scaleBgSize = () => ['auto', 'cover', 'contain', isArbitraryVariableSize, isArbitrarySize, {
723
+ size: [isArbitraryVariable, isArbitraryValue]
724
+ }];
725
+ const scaleGradientStopPosition = () => [isPercent, isArbitraryVariableLength, isArbitraryLength];
726
+ const scaleRadius = () => [
727
+ // Deprecated since Tailwind CSS v4.0.0
728
+ '', 'none', 'full', themeRadius, isArbitraryVariable, isArbitraryValue];
729
+ const scaleBorderWidth = () => ['', isNumber, isArbitraryVariableLength, isArbitraryLength];
730
+ const scaleLineStyle = () => ['solid', 'dashed', 'dotted', 'double'];
731
+ const scaleBlendMode = () => ['normal', 'multiply', 'screen', 'overlay', 'darken', 'lighten', 'color-dodge', 'color-burn', 'hard-light', 'soft-light', 'difference', 'exclusion', 'hue', 'saturation', 'color', 'luminosity'];
732
+ const scaleMaskImagePosition = () => [isNumber, isPercent, isArbitraryVariablePosition, isArbitraryPosition];
733
+ const scaleBlur = () => [
734
+ // Deprecated since Tailwind CSS v4.0.0
735
+ '', 'none', themeBlur, isArbitraryVariable, isArbitraryValue];
736
+ const scaleRotate = () => ['none', isNumber, isArbitraryVariable, isArbitraryValue];
737
+ const scaleScale = () => ['none', isNumber, isArbitraryVariable, isArbitraryValue];
738
+ const scaleSkew = () => [isNumber, isArbitraryVariable, isArbitraryValue];
739
+ const scaleTranslate = () => [isFraction, 'full', ...scaleUnambiguousSpacing()];
740
+ return {
741
+ cacheSize: 500,
742
+ theme: {
743
+ animate: ['spin', 'ping', 'pulse', 'bounce'],
744
+ aspect: ['video'],
745
+ blur: [isTshirtSize],
746
+ breakpoint: [isTshirtSize],
747
+ color: [isAny],
748
+ container: [isTshirtSize],
749
+ 'drop-shadow': [isTshirtSize],
750
+ ease: ['in', 'out', 'in-out'],
751
+ font: [isAnyNonArbitrary],
752
+ 'font-weight': ['thin', 'extralight', 'light', 'normal', 'medium', 'semibold', 'bold', 'extrabold', 'black'],
753
+ 'inset-shadow': [isTshirtSize],
754
+ leading: ['none', 'tight', 'snug', 'normal', 'relaxed', 'loose'],
755
+ perspective: ['dramatic', 'near', 'normal', 'midrange', 'distant', 'none'],
756
+ radius: [isTshirtSize],
757
+ shadow: [isTshirtSize],
758
+ spacing: ['px', isNumber],
759
+ text: [isTshirtSize],
760
+ 'text-shadow': [isTshirtSize],
761
+ tracking: ['tighter', 'tight', 'normal', 'wide', 'wider', 'widest']
762
+ },
763
+ classGroups: {
764
+ // --------------
765
+ // --- Layout ---
766
+ // --------------
767
+ /**
768
+ * Aspect Ratio
769
+ * @see https://tailwindcss.com/docs/aspect-ratio
770
+ */
771
+ aspect: [{
772
+ aspect: ['auto', 'square', isFraction, isArbitraryValue, isArbitraryVariable, themeAspect]
773
+ }],
774
+ /**
775
+ * Container
776
+ * @see https://tailwindcss.com/docs/container
777
+ * @deprecated since Tailwind CSS v4.0.0
778
+ */
779
+ container: ['container'],
780
+ /**
781
+ * Columns
782
+ * @see https://tailwindcss.com/docs/columns
783
+ */
784
+ columns: [{
785
+ columns: [isNumber, isArbitraryValue, isArbitraryVariable, themeContainer]
786
+ }],
787
+ /**
788
+ * Break After
789
+ * @see https://tailwindcss.com/docs/break-after
790
+ */
791
+ 'break-after': [{
792
+ 'break-after': scaleBreak()
793
+ }],
794
+ /**
795
+ * Break Before
796
+ * @see https://tailwindcss.com/docs/break-before
797
+ */
798
+ 'break-before': [{
799
+ 'break-before': scaleBreak()
800
+ }],
801
+ /**
802
+ * Break Inside
803
+ * @see https://tailwindcss.com/docs/break-inside
804
+ */
805
+ 'break-inside': [{
806
+ 'break-inside': ['auto', 'avoid', 'avoid-page', 'avoid-column']
807
+ }],
808
+ /**
809
+ * Box Decoration Break
810
+ * @see https://tailwindcss.com/docs/box-decoration-break
811
+ */
812
+ 'box-decoration': [{
813
+ 'box-decoration': ['slice', 'clone']
814
+ }],
815
+ /**
816
+ * Box Sizing
817
+ * @see https://tailwindcss.com/docs/box-sizing
818
+ */
819
+ box: [{
820
+ box: ['border', 'content']
821
+ }],
822
+ /**
823
+ * Display
824
+ * @see https://tailwindcss.com/docs/display
825
+ */
826
+ display: ['block', 'inline-block', 'inline', 'flex', 'inline-flex', 'table', 'inline-table', 'table-caption', 'table-cell', 'table-column', 'table-column-group', 'table-footer-group', 'table-header-group', 'table-row-group', 'table-row', 'flow-root', 'grid', 'inline-grid', 'contents', 'list-item', 'hidden'],
827
+ /**
828
+ * Screen Reader Only
829
+ * @see https://tailwindcss.com/docs/display#screen-reader-only
830
+ */
831
+ sr: ['sr-only', 'not-sr-only'],
832
+ /**
833
+ * Floats
834
+ * @see https://tailwindcss.com/docs/float
835
+ */
836
+ float: [{
837
+ float: ['right', 'left', 'none', 'start', 'end']
838
+ }],
839
+ /**
840
+ * Clear
841
+ * @see https://tailwindcss.com/docs/clear
842
+ */
843
+ clear: [{
844
+ clear: ['left', 'right', 'both', 'none', 'start', 'end']
845
+ }],
846
+ /**
847
+ * Isolation
848
+ * @see https://tailwindcss.com/docs/isolation
849
+ */
850
+ isolation: ['isolate', 'isolation-auto'],
851
+ /**
852
+ * Object Fit
853
+ * @see https://tailwindcss.com/docs/object-fit
854
+ */
855
+ 'object-fit': [{
856
+ object: ['contain', 'cover', 'fill', 'none', 'scale-down']
857
+ }],
858
+ /**
859
+ * Object Position
860
+ * @see https://tailwindcss.com/docs/object-position
861
+ */
862
+ 'object-position': [{
863
+ object: scalePositionWithArbitrary()
864
+ }],
865
+ /**
866
+ * Overflow
867
+ * @see https://tailwindcss.com/docs/overflow
868
+ */
869
+ overflow: [{
870
+ overflow: scaleOverflow()
871
+ }],
872
+ /**
873
+ * Overflow X
874
+ * @see https://tailwindcss.com/docs/overflow
875
+ */
876
+ 'overflow-x': [{
877
+ 'overflow-x': scaleOverflow()
878
+ }],
879
+ /**
880
+ * Overflow Y
881
+ * @see https://tailwindcss.com/docs/overflow
882
+ */
883
+ 'overflow-y': [{
884
+ 'overflow-y': scaleOverflow()
885
+ }],
886
+ /**
887
+ * Overscroll Behavior
888
+ * @see https://tailwindcss.com/docs/overscroll-behavior
889
+ */
890
+ overscroll: [{
891
+ overscroll: scaleOverscroll()
892
+ }],
893
+ /**
894
+ * Overscroll Behavior X
895
+ * @see https://tailwindcss.com/docs/overscroll-behavior
896
+ */
897
+ 'overscroll-x': [{
898
+ 'overscroll-x': scaleOverscroll()
899
+ }],
900
+ /**
901
+ * Overscroll Behavior Y
902
+ * @see https://tailwindcss.com/docs/overscroll-behavior
903
+ */
904
+ 'overscroll-y': [{
905
+ 'overscroll-y': scaleOverscroll()
906
+ }],
907
+ /**
908
+ * Position
909
+ * @see https://tailwindcss.com/docs/position
910
+ */
911
+ position: ['static', 'fixed', 'absolute', 'relative', 'sticky'],
912
+ /**
913
+ * Top / Right / Bottom / Left
914
+ * @see https://tailwindcss.com/docs/top-right-bottom-left
915
+ */
916
+ inset: [{
917
+ inset: scaleInset()
918
+ }],
919
+ /**
920
+ * Right / Left
921
+ * @see https://tailwindcss.com/docs/top-right-bottom-left
922
+ */
923
+ 'inset-x': [{
924
+ 'inset-x': scaleInset()
925
+ }],
926
+ /**
927
+ * Top / Bottom
928
+ * @see https://tailwindcss.com/docs/top-right-bottom-left
929
+ */
930
+ 'inset-y': [{
931
+ 'inset-y': scaleInset()
932
+ }],
933
+ /**
934
+ * Start
935
+ * @see https://tailwindcss.com/docs/top-right-bottom-left
936
+ */
937
+ start: [{
938
+ start: scaleInset()
939
+ }],
940
+ /**
941
+ * End
942
+ * @see https://tailwindcss.com/docs/top-right-bottom-left
943
+ */
944
+ end: [{
945
+ end: scaleInset()
946
+ }],
947
+ /**
948
+ * Top
949
+ * @see https://tailwindcss.com/docs/top-right-bottom-left
950
+ */
951
+ top: [{
952
+ top: scaleInset()
953
+ }],
954
+ /**
955
+ * Right
956
+ * @see https://tailwindcss.com/docs/top-right-bottom-left
957
+ */
958
+ right: [{
959
+ right: scaleInset()
960
+ }],
961
+ /**
962
+ * Bottom
963
+ * @see https://tailwindcss.com/docs/top-right-bottom-left
964
+ */
965
+ bottom: [{
966
+ bottom: scaleInset()
967
+ }],
968
+ /**
969
+ * Left
970
+ * @see https://tailwindcss.com/docs/top-right-bottom-left
971
+ */
972
+ left: [{
973
+ left: scaleInset()
974
+ }],
975
+ /**
976
+ * Visibility
977
+ * @see https://tailwindcss.com/docs/visibility
978
+ */
979
+ visibility: ['visible', 'invisible', 'collapse'],
980
+ /**
981
+ * Z-Index
982
+ * @see https://tailwindcss.com/docs/z-index
983
+ */
984
+ z: [{
985
+ z: [isInteger, 'auto', isArbitraryVariable, isArbitraryValue]
986
+ }],
987
+ // ------------------------
988
+ // --- Flexbox and Grid ---
989
+ // ------------------------
990
+ /**
991
+ * Flex Basis
992
+ * @see https://tailwindcss.com/docs/flex-basis
993
+ */
994
+ basis: [{
995
+ basis: [isFraction, 'full', 'auto', themeContainer, ...scaleUnambiguousSpacing()]
996
+ }],
997
+ /**
998
+ * Flex Direction
999
+ * @see https://tailwindcss.com/docs/flex-direction
1000
+ */
1001
+ 'flex-direction': [{
1002
+ flex: ['row', 'row-reverse', 'col', 'col-reverse']
1003
+ }],
1004
+ /**
1005
+ * Flex Wrap
1006
+ * @see https://tailwindcss.com/docs/flex-wrap
1007
+ */
1008
+ 'flex-wrap': [{
1009
+ flex: ['nowrap', 'wrap', 'wrap-reverse']
1010
+ }],
1011
+ /**
1012
+ * Flex
1013
+ * @see https://tailwindcss.com/docs/flex
1014
+ */
1015
+ flex: [{
1016
+ flex: [isNumber, isFraction, 'auto', 'initial', 'none', isArbitraryValue]
1017
+ }],
1018
+ /**
1019
+ * Flex Grow
1020
+ * @see https://tailwindcss.com/docs/flex-grow
1021
+ */
1022
+ grow: [{
1023
+ grow: ['', isNumber, isArbitraryVariable, isArbitraryValue]
1024
+ }],
1025
+ /**
1026
+ * Flex Shrink
1027
+ * @see https://tailwindcss.com/docs/flex-shrink
1028
+ */
1029
+ shrink: [{
1030
+ shrink: ['', isNumber, isArbitraryVariable, isArbitraryValue]
1031
+ }],
1032
+ /**
1033
+ * Order
1034
+ * @see https://tailwindcss.com/docs/order
1035
+ */
1036
+ order: [{
1037
+ order: [isInteger, 'first', 'last', 'none', isArbitraryVariable, isArbitraryValue]
1038
+ }],
1039
+ /**
1040
+ * Grid Template Columns
1041
+ * @see https://tailwindcss.com/docs/grid-template-columns
1042
+ */
1043
+ 'grid-cols': [{
1044
+ 'grid-cols': scaleGridTemplateColsRows()
1045
+ }],
1046
+ /**
1047
+ * Grid Column Start / End
1048
+ * @see https://tailwindcss.com/docs/grid-column
1049
+ */
1050
+ 'col-start-end': [{
1051
+ col: scaleGridColRowStartAndEnd()
1052
+ }],
1053
+ /**
1054
+ * Grid Column Start
1055
+ * @see https://tailwindcss.com/docs/grid-column
1056
+ */
1057
+ 'col-start': [{
1058
+ 'col-start': scaleGridColRowStartOrEnd()
1059
+ }],
1060
+ /**
1061
+ * Grid Column End
1062
+ * @see https://tailwindcss.com/docs/grid-column
1063
+ */
1064
+ 'col-end': [{
1065
+ 'col-end': scaleGridColRowStartOrEnd()
1066
+ }],
1067
+ /**
1068
+ * Grid Template Rows
1069
+ * @see https://tailwindcss.com/docs/grid-template-rows
1070
+ */
1071
+ 'grid-rows': [{
1072
+ 'grid-rows': scaleGridTemplateColsRows()
1073
+ }],
1074
+ /**
1075
+ * Grid Row Start / End
1076
+ * @see https://tailwindcss.com/docs/grid-row
1077
+ */
1078
+ 'row-start-end': [{
1079
+ row: scaleGridColRowStartAndEnd()
1080
+ }],
1081
+ /**
1082
+ * Grid Row Start
1083
+ * @see https://tailwindcss.com/docs/grid-row
1084
+ */
1085
+ 'row-start': [{
1086
+ 'row-start': scaleGridColRowStartOrEnd()
1087
+ }],
1088
+ /**
1089
+ * Grid Row End
1090
+ * @see https://tailwindcss.com/docs/grid-row
1091
+ */
1092
+ 'row-end': [{
1093
+ 'row-end': scaleGridColRowStartOrEnd()
1094
+ }],
1095
+ /**
1096
+ * Grid Auto Flow
1097
+ * @see https://tailwindcss.com/docs/grid-auto-flow
1098
+ */
1099
+ 'grid-flow': [{
1100
+ 'grid-flow': ['row', 'col', 'dense', 'row-dense', 'col-dense']
1101
+ }],
1102
+ /**
1103
+ * Grid Auto Columns
1104
+ * @see https://tailwindcss.com/docs/grid-auto-columns
1105
+ */
1106
+ 'auto-cols': [{
1107
+ 'auto-cols': scaleGridAutoColsRows()
1108
+ }],
1109
+ /**
1110
+ * Grid Auto Rows
1111
+ * @see https://tailwindcss.com/docs/grid-auto-rows
1112
+ */
1113
+ 'auto-rows': [{
1114
+ 'auto-rows': scaleGridAutoColsRows()
1115
+ }],
1116
+ /**
1117
+ * Gap
1118
+ * @see https://tailwindcss.com/docs/gap
1119
+ */
1120
+ gap: [{
1121
+ gap: scaleUnambiguousSpacing()
1122
+ }],
1123
+ /**
1124
+ * Gap X
1125
+ * @see https://tailwindcss.com/docs/gap
1126
+ */
1127
+ 'gap-x': [{
1128
+ 'gap-x': scaleUnambiguousSpacing()
1129
+ }],
1130
+ /**
1131
+ * Gap Y
1132
+ * @see https://tailwindcss.com/docs/gap
1133
+ */
1134
+ 'gap-y': [{
1135
+ 'gap-y': scaleUnambiguousSpacing()
1136
+ }],
1137
+ /**
1138
+ * Justify Content
1139
+ * @see https://tailwindcss.com/docs/justify-content
1140
+ */
1141
+ 'justify-content': [{
1142
+ justify: [...scaleAlignPrimaryAxis(), 'normal']
1143
+ }],
1144
+ /**
1145
+ * Justify Items
1146
+ * @see https://tailwindcss.com/docs/justify-items
1147
+ */
1148
+ 'justify-items': [{
1149
+ 'justify-items': [...scaleAlignSecondaryAxis(), 'normal']
1150
+ }],
1151
+ /**
1152
+ * Justify Self
1153
+ * @see https://tailwindcss.com/docs/justify-self
1154
+ */
1155
+ 'justify-self': [{
1156
+ 'justify-self': ['auto', ...scaleAlignSecondaryAxis()]
1157
+ }],
1158
+ /**
1159
+ * Align Content
1160
+ * @see https://tailwindcss.com/docs/align-content
1161
+ */
1162
+ 'align-content': [{
1163
+ content: ['normal', ...scaleAlignPrimaryAxis()]
1164
+ }],
1165
+ /**
1166
+ * Align Items
1167
+ * @see https://tailwindcss.com/docs/align-items
1168
+ */
1169
+ 'align-items': [{
1170
+ items: [...scaleAlignSecondaryAxis(), {
1171
+ baseline: ['', 'last']
1172
+ }]
1173
+ }],
1174
+ /**
1175
+ * Align Self
1176
+ * @see https://tailwindcss.com/docs/align-self
1177
+ */
1178
+ 'align-self': [{
1179
+ self: ['auto', ...scaleAlignSecondaryAxis(), {
1180
+ baseline: ['', 'last']
1181
+ }]
1182
+ }],
1183
+ /**
1184
+ * Place Content
1185
+ * @see https://tailwindcss.com/docs/place-content
1186
+ */
1187
+ 'place-content': [{
1188
+ 'place-content': scaleAlignPrimaryAxis()
1189
+ }],
1190
+ /**
1191
+ * Place Items
1192
+ * @see https://tailwindcss.com/docs/place-items
1193
+ */
1194
+ 'place-items': [{
1195
+ 'place-items': [...scaleAlignSecondaryAxis(), 'baseline']
1196
+ }],
1197
+ /**
1198
+ * Place Self
1199
+ * @see https://tailwindcss.com/docs/place-self
1200
+ */
1201
+ 'place-self': [{
1202
+ 'place-self': ['auto', ...scaleAlignSecondaryAxis()]
1203
+ }],
1204
+ // Spacing
1205
+ /**
1206
+ * Padding
1207
+ * @see https://tailwindcss.com/docs/padding
1208
+ */
1209
+ p: [{
1210
+ p: scaleUnambiguousSpacing()
1211
+ }],
1212
+ /**
1213
+ * Padding X
1214
+ * @see https://tailwindcss.com/docs/padding
1215
+ */
1216
+ px: [{
1217
+ px: scaleUnambiguousSpacing()
1218
+ }],
1219
+ /**
1220
+ * Padding Y
1221
+ * @see https://tailwindcss.com/docs/padding
1222
+ */
1223
+ py: [{
1224
+ py: scaleUnambiguousSpacing()
1225
+ }],
1226
+ /**
1227
+ * Padding Start
1228
+ * @see https://tailwindcss.com/docs/padding
1229
+ */
1230
+ ps: [{
1231
+ ps: scaleUnambiguousSpacing()
1232
+ }],
1233
+ /**
1234
+ * Padding End
1235
+ * @see https://tailwindcss.com/docs/padding
1236
+ */
1237
+ pe: [{
1238
+ pe: scaleUnambiguousSpacing()
1239
+ }],
1240
+ /**
1241
+ * Padding Top
1242
+ * @see https://tailwindcss.com/docs/padding
1243
+ */
1244
+ pt: [{
1245
+ pt: scaleUnambiguousSpacing()
1246
+ }],
1247
+ /**
1248
+ * Padding Right
1249
+ * @see https://tailwindcss.com/docs/padding
1250
+ */
1251
+ pr: [{
1252
+ pr: scaleUnambiguousSpacing()
1253
+ }],
1254
+ /**
1255
+ * Padding Bottom
1256
+ * @see https://tailwindcss.com/docs/padding
1257
+ */
1258
+ pb: [{
1259
+ pb: scaleUnambiguousSpacing()
1260
+ }],
1261
+ /**
1262
+ * Padding Left
1263
+ * @see https://tailwindcss.com/docs/padding
1264
+ */
1265
+ pl: [{
1266
+ pl: scaleUnambiguousSpacing()
1267
+ }],
1268
+ /**
1269
+ * Margin
1270
+ * @see https://tailwindcss.com/docs/margin
1271
+ */
1272
+ m: [{
1273
+ m: scaleMargin()
1274
+ }],
1275
+ /**
1276
+ * Margin X
1277
+ * @see https://tailwindcss.com/docs/margin
1278
+ */
1279
+ mx: [{
1280
+ mx: scaleMargin()
1281
+ }],
1282
+ /**
1283
+ * Margin Y
1284
+ * @see https://tailwindcss.com/docs/margin
1285
+ */
1286
+ my: [{
1287
+ my: scaleMargin()
1288
+ }],
1289
+ /**
1290
+ * Margin Start
1291
+ * @see https://tailwindcss.com/docs/margin
1292
+ */
1293
+ ms: [{
1294
+ ms: scaleMargin()
1295
+ }],
1296
+ /**
1297
+ * Margin End
1298
+ * @see https://tailwindcss.com/docs/margin
1299
+ */
1300
+ me: [{
1301
+ me: scaleMargin()
1302
+ }],
1303
+ /**
1304
+ * Margin Top
1305
+ * @see https://tailwindcss.com/docs/margin
1306
+ */
1307
+ mt: [{
1308
+ mt: scaleMargin()
1309
+ }],
1310
+ /**
1311
+ * Margin Right
1312
+ * @see https://tailwindcss.com/docs/margin
1313
+ */
1314
+ mr: [{
1315
+ mr: scaleMargin()
1316
+ }],
1317
+ /**
1318
+ * Margin Bottom
1319
+ * @see https://tailwindcss.com/docs/margin
1320
+ */
1321
+ mb: [{
1322
+ mb: scaleMargin()
1323
+ }],
1324
+ /**
1325
+ * Margin Left
1326
+ * @see https://tailwindcss.com/docs/margin
1327
+ */
1328
+ ml: [{
1329
+ ml: scaleMargin()
1330
+ }],
1331
+ /**
1332
+ * Space Between X
1333
+ * @see https://tailwindcss.com/docs/margin#adding-space-between-children
1334
+ */
1335
+ 'space-x': [{
1336
+ 'space-x': scaleUnambiguousSpacing()
1337
+ }],
1338
+ /**
1339
+ * Space Between X Reverse
1340
+ * @see https://tailwindcss.com/docs/margin#adding-space-between-children
1341
+ */
1342
+ 'space-x-reverse': ['space-x-reverse'],
1343
+ /**
1344
+ * Space Between Y
1345
+ * @see https://tailwindcss.com/docs/margin#adding-space-between-children
1346
+ */
1347
+ 'space-y': [{
1348
+ 'space-y': scaleUnambiguousSpacing()
1349
+ }],
1350
+ /**
1351
+ * Space Between Y Reverse
1352
+ * @see https://tailwindcss.com/docs/margin#adding-space-between-children
1353
+ */
1354
+ 'space-y-reverse': ['space-y-reverse'],
1355
+ // --------------
1356
+ // --- Sizing ---
1357
+ // --------------
1358
+ /**
1359
+ * Size
1360
+ * @see https://tailwindcss.com/docs/width#setting-both-width-and-height
1361
+ */
1362
+ size: [{
1363
+ size: scaleSizing()
1364
+ }],
1365
+ /**
1366
+ * Width
1367
+ * @see https://tailwindcss.com/docs/width
1368
+ */
1369
+ w: [{
1370
+ w: [themeContainer, 'screen', ...scaleSizing()]
1371
+ }],
1372
+ /**
1373
+ * Min-Width
1374
+ * @see https://tailwindcss.com/docs/min-width
1375
+ */
1376
+ 'min-w': [{
1377
+ 'min-w': [themeContainer, 'screen', /** Deprecated. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */
1378
+ 'none', ...scaleSizing()]
1379
+ }],
1380
+ /**
1381
+ * Max-Width
1382
+ * @see https://tailwindcss.com/docs/max-width
1383
+ */
1384
+ 'max-w': [{
1385
+ 'max-w': [themeContainer, 'screen', 'none', /** Deprecated since Tailwind CSS v4.0.0. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */
1386
+ 'prose', /** Deprecated since Tailwind CSS v4.0.0. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */
1387
+ {
1388
+ screen: [themeBreakpoint]
1389
+ }, ...scaleSizing()]
1390
+ }],
1391
+ /**
1392
+ * Height
1393
+ * @see https://tailwindcss.com/docs/height
1394
+ */
1395
+ h: [{
1396
+ h: ['screen', 'lh', ...scaleSizing()]
1397
+ }],
1398
+ /**
1399
+ * Min-Height
1400
+ * @see https://tailwindcss.com/docs/min-height
1401
+ */
1402
+ 'min-h': [{
1403
+ 'min-h': ['screen', 'lh', 'none', ...scaleSizing()]
1404
+ }],
1405
+ /**
1406
+ * Max-Height
1407
+ * @see https://tailwindcss.com/docs/max-height
1408
+ */
1409
+ 'max-h': [{
1410
+ 'max-h': ['screen', 'lh', ...scaleSizing()]
1411
+ }],
1412
+ // ------------------
1413
+ // --- Typography ---
1414
+ // ------------------
1415
+ /**
1416
+ * Font Size
1417
+ * @see https://tailwindcss.com/docs/font-size
1418
+ */
1419
+ 'font-size': [{
1420
+ text: ['base', themeText, isArbitraryVariableLength, isArbitraryLength]
1421
+ }],
1422
+ /**
1423
+ * Font Smoothing
1424
+ * @see https://tailwindcss.com/docs/font-smoothing
1425
+ */
1426
+ 'font-smoothing': ['antialiased', 'subpixel-antialiased'],
1427
+ /**
1428
+ * Font Style
1429
+ * @see https://tailwindcss.com/docs/font-style
1430
+ */
1431
+ 'font-style': ['italic', 'not-italic'],
1432
+ /**
1433
+ * Font Weight
1434
+ * @see https://tailwindcss.com/docs/font-weight
1435
+ */
1436
+ 'font-weight': [{
1437
+ font: [themeFontWeight, isArbitraryVariable, isArbitraryNumber]
1438
+ }],
1439
+ /**
1440
+ * Font Stretch
1441
+ * @see https://tailwindcss.com/docs/font-stretch
1442
+ */
1443
+ 'font-stretch': [{
1444
+ 'font-stretch': ['ultra-condensed', 'extra-condensed', 'condensed', 'semi-condensed', 'normal', 'semi-expanded', 'expanded', 'extra-expanded', 'ultra-expanded', isPercent, isArbitraryValue]
1445
+ }],
1446
+ /**
1447
+ * Font Family
1448
+ * @see https://tailwindcss.com/docs/font-family
1449
+ */
1450
+ 'font-family': [{
1451
+ font: [isArbitraryVariableFamilyName, isArbitraryValue, themeFont]
1452
+ }],
1453
+ /**
1454
+ * Font Variant Numeric
1455
+ * @see https://tailwindcss.com/docs/font-variant-numeric
1456
+ */
1457
+ 'fvn-normal': ['normal-nums'],
1458
+ /**
1459
+ * Font Variant Numeric
1460
+ * @see https://tailwindcss.com/docs/font-variant-numeric
1461
+ */
1462
+ 'fvn-ordinal': ['ordinal'],
1463
+ /**
1464
+ * Font Variant Numeric
1465
+ * @see https://tailwindcss.com/docs/font-variant-numeric
1466
+ */
1467
+ 'fvn-slashed-zero': ['slashed-zero'],
1468
+ /**
1469
+ * Font Variant Numeric
1470
+ * @see https://tailwindcss.com/docs/font-variant-numeric
1471
+ */
1472
+ 'fvn-figure': ['lining-nums', 'oldstyle-nums'],
1473
+ /**
1474
+ * Font Variant Numeric
1475
+ * @see https://tailwindcss.com/docs/font-variant-numeric
1476
+ */
1477
+ 'fvn-spacing': ['proportional-nums', 'tabular-nums'],
1478
+ /**
1479
+ * Font Variant Numeric
1480
+ * @see https://tailwindcss.com/docs/font-variant-numeric
1481
+ */
1482
+ 'fvn-fraction': ['diagonal-fractions', 'stacked-fractions'],
1483
+ /**
1484
+ * Letter Spacing
1485
+ * @see https://tailwindcss.com/docs/letter-spacing
1486
+ */
1487
+ tracking: [{
1488
+ tracking: [themeTracking, isArbitraryVariable, isArbitraryValue]
1489
+ }],
1490
+ /**
1491
+ * Line Clamp
1492
+ * @see https://tailwindcss.com/docs/line-clamp
1493
+ */
1494
+ 'line-clamp': [{
1495
+ 'line-clamp': [isNumber, 'none', isArbitraryVariable, isArbitraryNumber]
1496
+ }],
1497
+ /**
1498
+ * Line Height
1499
+ * @see https://tailwindcss.com/docs/line-height
1500
+ */
1501
+ leading: [{
1502
+ leading: [/** Deprecated since Tailwind CSS v4.0.0. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */
1503
+ themeLeading, ...scaleUnambiguousSpacing()]
1504
+ }],
1505
+ /**
1506
+ * List Style Image
1507
+ * @see https://tailwindcss.com/docs/list-style-image
1508
+ */
1509
+ 'list-image': [{
1510
+ 'list-image': ['none', isArbitraryVariable, isArbitraryValue]
1511
+ }],
1512
+ /**
1513
+ * List Style Position
1514
+ * @see https://tailwindcss.com/docs/list-style-position
1515
+ */
1516
+ 'list-style-position': [{
1517
+ list: ['inside', 'outside']
1518
+ }],
1519
+ /**
1520
+ * List Style Type
1521
+ * @see https://tailwindcss.com/docs/list-style-type
1522
+ */
1523
+ 'list-style-type': [{
1524
+ list: ['disc', 'decimal', 'none', isArbitraryVariable, isArbitraryValue]
1525
+ }],
1526
+ /**
1527
+ * Text Alignment
1528
+ * @see https://tailwindcss.com/docs/text-align
1529
+ */
1530
+ 'text-alignment': [{
1531
+ text: ['left', 'center', 'right', 'justify', 'start', 'end']
1532
+ }],
1533
+ /**
1534
+ * Placeholder Color
1535
+ * @deprecated since Tailwind CSS v3.0.0
1536
+ * @see https://v3.tailwindcss.com/docs/placeholder-color
1537
+ */
1538
+ 'placeholder-color': [{
1539
+ placeholder: scaleColor()
1540
+ }],
1541
+ /**
1542
+ * Text Color
1543
+ * @see https://tailwindcss.com/docs/text-color
1544
+ */
1545
+ 'text-color': [{
1546
+ text: scaleColor()
1547
+ }],
1548
+ /**
1549
+ * Text Decoration
1550
+ * @see https://tailwindcss.com/docs/text-decoration
1551
+ */
1552
+ 'text-decoration': ['underline', 'overline', 'line-through', 'no-underline'],
1553
+ /**
1554
+ * Text Decoration Style
1555
+ * @see https://tailwindcss.com/docs/text-decoration-style
1556
+ */
1557
+ 'text-decoration-style': [{
1558
+ decoration: [...scaleLineStyle(), 'wavy']
1559
+ }],
1560
+ /**
1561
+ * Text Decoration Thickness
1562
+ * @see https://tailwindcss.com/docs/text-decoration-thickness
1563
+ */
1564
+ 'text-decoration-thickness': [{
1565
+ decoration: [isNumber, 'from-font', 'auto', isArbitraryVariable, isArbitraryLength]
1566
+ }],
1567
+ /**
1568
+ * Text Decoration Color
1569
+ * @see https://tailwindcss.com/docs/text-decoration-color
1570
+ */
1571
+ 'text-decoration-color': [{
1572
+ decoration: scaleColor()
1573
+ }],
1574
+ /**
1575
+ * Text Underline Offset
1576
+ * @see https://tailwindcss.com/docs/text-underline-offset
1577
+ */
1578
+ 'underline-offset': [{
1579
+ 'underline-offset': [isNumber, 'auto', isArbitraryVariable, isArbitraryValue]
1580
+ }],
1581
+ /**
1582
+ * Text Transform
1583
+ * @see https://tailwindcss.com/docs/text-transform
1584
+ */
1585
+ 'text-transform': ['uppercase', 'lowercase', 'capitalize', 'normal-case'],
1586
+ /**
1587
+ * Text Overflow
1588
+ * @see https://tailwindcss.com/docs/text-overflow
1589
+ */
1590
+ 'text-overflow': ['truncate', 'text-ellipsis', 'text-clip'],
1591
+ /**
1592
+ * Text Wrap
1593
+ * @see https://tailwindcss.com/docs/text-wrap
1594
+ */
1595
+ 'text-wrap': [{
1596
+ text: ['wrap', 'nowrap', 'balance', 'pretty']
1597
+ }],
1598
+ /**
1599
+ * Text Indent
1600
+ * @see https://tailwindcss.com/docs/text-indent
1601
+ */
1602
+ indent: [{
1603
+ indent: scaleUnambiguousSpacing()
1604
+ }],
1605
+ /**
1606
+ * Vertical Alignment
1607
+ * @see https://tailwindcss.com/docs/vertical-align
1608
+ */
1609
+ 'vertical-align': [{
1610
+ align: ['baseline', 'top', 'middle', 'bottom', 'text-top', 'text-bottom', 'sub', 'super', isArbitraryVariable, isArbitraryValue]
1611
+ }],
1612
+ /**
1613
+ * Whitespace
1614
+ * @see https://tailwindcss.com/docs/whitespace
1615
+ */
1616
+ whitespace: [{
1617
+ whitespace: ['normal', 'nowrap', 'pre', 'pre-line', 'pre-wrap', 'break-spaces']
1618
+ }],
1619
+ /**
1620
+ * Word Break
1621
+ * @see https://tailwindcss.com/docs/word-break
1622
+ */
1623
+ break: [{
1624
+ break: ['normal', 'words', 'all', 'keep']
1625
+ }],
1626
+ /**
1627
+ * Overflow Wrap
1628
+ * @see https://tailwindcss.com/docs/overflow-wrap
1629
+ */
1630
+ wrap: [{
1631
+ wrap: ['break-word', 'anywhere', 'normal']
1632
+ }],
1633
+ /**
1634
+ * Hyphens
1635
+ * @see https://tailwindcss.com/docs/hyphens
1636
+ */
1637
+ hyphens: [{
1638
+ hyphens: ['none', 'manual', 'auto']
1639
+ }],
1640
+ /**
1641
+ * Content
1642
+ * @see https://tailwindcss.com/docs/content
1643
+ */
1644
+ content: [{
1645
+ content: ['none', isArbitraryVariable, isArbitraryValue]
1646
+ }],
1647
+ // -------------------
1648
+ // --- Backgrounds ---
1649
+ // -------------------
1650
+ /**
1651
+ * Background Attachment
1652
+ * @see https://tailwindcss.com/docs/background-attachment
1653
+ */
1654
+ 'bg-attachment': [{
1655
+ bg: ['fixed', 'local', 'scroll']
1656
+ }],
1657
+ /**
1658
+ * Background Clip
1659
+ * @see https://tailwindcss.com/docs/background-clip
1660
+ */
1661
+ 'bg-clip': [{
1662
+ 'bg-clip': ['border', 'padding', 'content', 'text']
1663
+ }],
1664
+ /**
1665
+ * Background Origin
1666
+ * @see https://tailwindcss.com/docs/background-origin
1667
+ */
1668
+ 'bg-origin': [{
1669
+ 'bg-origin': ['border', 'padding', 'content']
1670
+ }],
1671
+ /**
1672
+ * Background Position
1673
+ * @see https://tailwindcss.com/docs/background-position
1674
+ */
1675
+ 'bg-position': [{
1676
+ bg: scaleBgPosition()
1677
+ }],
1678
+ /**
1679
+ * Background Repeat
1680
+ * @see https://tailwindcss.com/docs/background-repeat
1681
+ */
1682
+ 'bg-repeat': [{
1683
+ bg: scaleBgRepeat()
1684
+ }],
1685
+ /**
1686
+ * Background Size
1687
+ * @see https://tailwindcss.com/docs/background-size
1688
+ */
1689
+ 'bg-size': [{
1690
+ bg: scaleBgSize()
1691
+ }],
1692
+ /**
1693
+ * Background Image
1694
+ * @see https://tailwindcss.com/docs/background-image
1695
+ */
1696
+ 'bg-image': [{
1697
+ bg: ['none', {
1698
+ linear: [{
1699
+ to: ['t', 'tr', 'r', 'br', 'b', 'bl', 'l', 'tl']
1700
+ }, isInteger, isArbitraryVariable, isArbitraryValue],
1701
+ radial: ['', isArbitraryVariable, isArbitraryValue],
1702
+ conic: [isInteger, isArbitraryVariable, isArbitraryValue]
1703
+ }, isArbitraryVariableImage, isArbitraryImage]
1704
+ }],
1705
+ /**
1706
+ * Background Color
1707
+ * @see https://tailwindcss.com/docs/background-color
1708
+ */
1709
+ 'bg-color': [{
1710
+ bg: scaleColor()
1711
+ }],
1712
+ /**
1713
+ * Gradient Color Stops From Position
1714
+ * @see https://tailwindcss.com/docs/gradient-color-stops
1715
+ */
1716
+ 'gradient-from-pos': [{
1717
+ from: scaleGradientStopPosition()
1718
+ }],
1719
+ /**
1720
+ * Gradient Color Stops Via Position
1721
+ * @see https://tailwindcss.com/docs/gradient-color-stops
1722
+ */
1723
+ 'gradient-via-pos': [{
1724
+ via: scaleGradientStopPosition()
1725
+ }],
1726
+ /**
1727
+ * Gradient Color Stops To Position
1728
+ * @see https://tailwindcss.com/docs/gradient-color-stops
1729
+ */
1730
+ 'gradient-to-pos': [{
1731
+ to: scaleGradientStopPosition()
1732
+ }],
1733
+ /**
1734
+ * Gradient Color Stops From
1735
+ * @see https://tailwindcss.com/docs/gradient-color-stops
1736
+ */
1737
+ 'gradient-from': [{
1738
+ from: scaleColor()
1739
+ }],
1740
+ /**
1741
+ * Gradient Color Stops Via
1742
+ * @see https://tailwindcss.com/docs/gradient-color-stops
1743
+ */
1744
+ 'gradient-via': [{
1745
+ via: scaleColor()
1746
+ }],
1747
+ /**
1748
+ * Gradient Color Stops To
1749
+ * @see https://tailwindcss.com/docs/gradient-color-stops
1750
+ */
1751
+ 'gradient-to': [{
1752
+ to: scaleColor()
1753
+ }],
1754
+ // ---------------
1755
+ // --- Borders ---
1756
+ // ---------------
1757
+ /**
1758
+ * Border Radius
1759
+ * @see https://tailwindcss.com/docs/border-radius
1760
+ */
1761
+ rounded: [{
1762
+ rounded: scaleRadius()
1763
+ }],
1764
+ /**
1765
+ * Border Radius Start
1766
+ * @see https://tailwindcss.com/docs/border-radius
1767
+ */
1768
+ 'rounded-s': [{
1769
+ 'rounded-s': scaleRadius()
1770
+ }],
1771
+ /**
1772
+ * Border Radius End
1773
+ * @see https://tailwindcss.com/docs/border-radius
1774
+ */
1775
+ 'rounded-e': [{
1776
+ 'rounded-e': scaleRadius()
1777
+ }],
1778
+ /**
1779
+ * Border Radius Top
1780
+ * @see https://tailwindcss.com/docs/border-radius
1781
+ */
1782
+ 'rounded-t': [{
1783
+ 'rounded-t': scaleRadius()
1784
+ }],
1785
+ /**
1786
+ * Border Radius Right
1787
+ * @see https://tailwindcss.com/docs/border-radius
1788
+ */
1789
+ 'rounded-r': [{
1790
+ 'rounded-r': scaleRadius()
1791
+ }],
1792
+ /**
1793
+ * Border Radius Bottom
1794
+ * @see https://tailwindcss.com/docs/border-radius
1795
+ */
1796
+ 'rounded-b': [{
1797
+ 'rounded-b': scaleRadius()
1798
+ }],
1799
+ /**
1800
+ * Border Radius Left
1801
+ * @see https://tailwindcss.com/docs/border-radius
1802
+ */
1803
+ 'rounded-l': [{
1804
+ 'rounded-l': scaleRadius()
1805
+ }],
1806
+ /**
1807
+ * Border Radius Start Start
1808
+ * @see https://tailwindcss.com/docs/border-radius
1809
+ */
1810
+ 'rounded-ss': [{
1811
+ 'rounded-ss': scaleRadius()
1812
+ }],
1813
+ /**
1814
+ * Border Radius Start End
1815
+ * @see https://tailwindcss.com/docs/border-radius
1816
+ */
1817
+ 'rounded-se': [{
1818
+ 'rounded-se': scaleRadius()
1819
+ }],
1820
+ /**
1821
+ * Border Radius End End
1822
+ * @see https://tailwindcss.com/docs/border-radius
1823
+ */
1824
+ 'rounded-ee': [{
1825
+ 'rounded-ee': scaleRadius()
1826
+ }],
1827
+ /**
1828
+ * Border Radius End Start
1829
+ * @see https://tailwindcss.com/docs/border-radius
1830
+ */
1831
+ 'rounded-es': [{
1832
+ 'rounded-es': scaleRadius()
1833
+ }],
1834
+ /**
1835
+ * Border Radius Top Left
1836
+ * @see https://tailwindcss.com/docs/border-radius
1837
+ */
1838
+ 'rounded-tl': [{
1839
+ 'rounded-tl': scaleRadius()
1840
+ }],
1841
+ /**
1842
+ * Border Radius Top Right
1843
+ * @see https://tailwindcss.com/docs/border-radius
1844
+ */
1845
+ 'rounded-tr': [{
1846
+ 'rounded-tr': scaleRadius()
1847
+ }],
1848
+ /**
1849
+ * Border Radius Bottom Right
1850
+ * @see https://tailwindcss.com/docs/border-radius
1851
+ */
1852
+ 'rounded-br': [{
1853
+ 'rounded-br': scaleRadius()
1854
+ }],
1855
+ /**
1856
+ * Border Radius Bottom Left
1857
+ * @see https://tailwindcss.com/docs/border-radius
1858
+ */
1859
+ 'rounded-bl': [{
1860
+ 'rounded-bl': scaleRadius()
1861
+ }],
1862
+ /**
1863
+ * Border Width
1864
+ * @see https://tailwindcss.com/docs/border-width
1865
+ */
1866
+ 'border-w': [{
1867
+ border: scaleBorderWidth()
1868
+ }],
1869
+ /**
1870
+ * Border Width X
1871
+ * @see https://tailwindcss.com/docs/border-width
1872
+ */
1873
+ 'border-w-x': [{
1874
+ 'border-x': scaleBorderWidth()
1875
+ }],
1876
+ /**
1877
+ * Border Width Y
1878
+ * @see https://tailwindcss.com/docs/border-width
1879
+ */
1880
+ 'border-w-y': [{
1881
+ 'border-y': scaleBorderWidth()
1882
+ }],
1883
+ /**
1884
+ * Border Width Start
1885
+ * @see https://tailwindcss.com/docs/border-width
1886
+ */
1887
+ 'border-w-s': [{
1888
+ 'border-s': scaleBorderWidth()
1889
+ }],
1890
+ /**
1891
+ * Border Width End
1892
+ * @see https://tailwindcss.com/docs/border-width
1893
+ */
1894
+ 'border-w-e': [{
1895
+ 'border-e': scaleBorderWidth()
1896
+ }],
1897
+ /**
1898
+ * Border Width Top
1899
+ * @see https://tailwindcss.com/docs/border-width
1900
+ */
1901
+ 'border-w-t': [{
1902
+ 'border-t': scaleBorderWidth()
1903
+ }],
1904
+ /**
1905
+ * Border Width Right
1906
+ * @see https://tailwindcss.com/docs/border-width
1907
+ */
1908
+ 'border-w-r': [{
1909
+ 'border-r': scaleBorderWidth()
1910
+ }],
1911
+ /**
1912
+ * Border Width Bottom
1913
+ * @see https://tailwindcss.com/docs/border-width
1914
+ */
1915
+ 'border-w-b': [{
1916
+ 'border-b': scaleBorderWidth()
1917
+ }],
1918
+ /**
1919
+ * Border Width Left
1920
+ * @see https://tailwindcss.com/docs/border-width
1921
+ */
1922
+ 'border-w-l': [{
1923
+ 'border-l': scaleBorderWidth()
1924
+ }],
1925
+ /**
1926
+ * Divide Width X
1927
+ * @see https://tailwindcss.com/docs/border-width#between-children
1928
+ */
1929
+ 'divide-x': [{
1930
+ 'divide-x': scaleBorderWidth()
1931
+ }],
1932
+ /**
1933
+ * Divide Width X Reverse
1934
+ * @see https://tailwindcss.com/docs/border-width#between-children
1935
+ */
1936
+ 'divide-x-reverse': ['divide-x-reverse'],
1937
+ /**
1938
+ * Divide Width Y
1939
+ * @see https://tailwindcss.com/docs/border-width#between-children
1940
+ */
1941
+ 'divide-y': [{
1942
+ 'divide-y': scaleBorderWidth()
1943
+ }],
1944
+ /**
1945
+ * Divide Width Y Reverse
1946
+ * @see https://tailwindcss.com/docs/border-width#between-children
1947
+ */
1948
+ 'divide-y-reverse': ['divide-y-reverse'],
1949
+ /**
1950
+ * Border Style
1951
+ * @see https://tailwindcss.com/docs/border-style
1952
+ */
1953
+ 'border-style': [{
1954
+ border: [...scaleLineStyle(), 'hidden', 'none']
1955
+ }],
1956
+ /**
1957
+ * Divide Style
1958
+ * @see https://tailwindcss.com/docs/border-style#setting-the-divider-style
1959
+ */
1960
+ 'divide-style': [{
1961
+ divide: [...scaleLineStyle(), 'hidden', 'none']
1962
+ }],
1963
+ /**
1964
+ * Border Color
1965
+ * @see https://tailwindcss.com/docs/border-color
1966
+ */
1967
+ 'border-color': [{
1968
+ border: scaleColor()
1969
+ }],
1970
+ /**
1971
+ * Border Color X
1972
+ * @see https://tailwindcss.com/docs/border-color
1973
+ */
1974
+ 'border-color-x': [{
1975
+ 'border-x': scaleColor()
1976
+ }],
1977
+ /**
1978
+ * Border Color Y
1979
+ * @see https://tailwindcss.com/docs/border-color
1980
+ */
1981
+ 'border-color-y': [{
1982
+ 'border-y': scaleColor()
1983
+ }],
1984
+ /**
1985
+ * Border Color S
1986
+ * @see https://tailwindcss.com/docs/border-color
1987
+ */
1988
+ 'border-color-s': [{
1989
+ 'border-s': scaleColor()
1990
+ }],
1991
+ /**
1992
+ * Border Color E
1993
+ * @see https://tailwindcss.com/docs/border-color
1994
+ */
1995
+ 'border-color-e': [{
1996
+ 'border-e': scaleColor()
1997
+ }],
1998
+ /**
1999
+ * Border Color Top
2000
+ * @see https://tailwindcss.com/docs/border-color
2001
+ */
2002
+ 'border-color-t': [{
2003
+ 'border-t': scaleColor()
2004
+ }],
2005
+ /**
2006
+ * Border Color Right
2007
+ * @see https://tailwindcss.com/docs/border-color
2008
+ */
2009
+ 'border-color-r': [{
2010
+ 'border-r': scaleColor()
2011
+ }],
2012
+ /**
2013
+ * Border Color Bottom
2014
+ * @see https://tailwindcss.com/docs/border-color
2015
+ */
2016
+ 'border-color-b': [{
2017
+ 'border-b': scaleColor()
2018
+ }],
2019
+ /**
2020
+ * Border Color Left
2021
+ * @see https://tailwindcss.com/docs/border-color
2022
+ */
2023
+ 'border-color-l': [{
2024
+ 'border-l': scaleColor()
2025
+ }],
2026
+ /**
2027
+ * Divide Color
2028
+ * @see https://tailwindcss.com/docs/divide-color
2029
+ */
2030
+ 'divide-color': [{
2031
+ divide: scaleColor()
2032
+ }],
2033
+ /**
2034
+ * Outline Style
2035
+ * @see https://tailwindcss.com/docs/outline-style
2036
+ */
2037
+ 'outline-style': [{
2038
+ outline: [...scaleLineStyle(), 'none', 'hidden']
2039
+ }],
2040
+ /**
2041
+ * Outline Offset
2042
+ * @see https://tailwindcss.com/docs/outline-offset
2043
+ */
2044
+ 'outline-offset': [{
2045
+ 'outline-offset': [isNumber, isArbitraryVariable, isArbitraryValue]
2046
+ }],
2047
+ /**
2048
+ * Outline Width
2049
+ * @see https://tailwindcss.com/docs/outline-width
2050
+ */
2051
+ 'outline-w': [{
2052
+ outline: ['', isNumber, isArbitraryVariableLength, isArbitraryLength]
2053
+ }],
2054
+ /**
2055
+ * Outline Color
2056
+ * @see https://tailwindcss.com/docs/outline-color
2057
+ */
2058
+ 'outline-color': [{
2059
+ outline: scaleColor()
2060
+ }],
2061
+ // ---------------
2062
+ // --- Effects ---
2063
+ // ---------------
2064
+ /**
2065
+ * Box Shadow
2066
+ * @see https://tailwindcss.com/docs/box-shadow
2067
+ */
2068
+ shadow: [{
2069
+ shadow: [
2070
+ // Deprecated since Tailwind CSS v4.0.0
2071
+ '', 'none', themeShadow, isArbitraryVariableShadow, isArbitraryShadow]
2072
+ }],
2073
+ /**
2074
+ * Box Shadow Color
2075
+ * @see https://tailwindcss.com/docs/box-shadow#setting-the-shadow-color
2076
+ */
2077
+ 'shadow-color': [{
2078
+ shadow: scaleColor()
2079
+ }],
2080
+ /**
2081
+ * Inset Box Shadow
2082
+ * @see https://tailwindcss.com/docs/box-shadow#adding-an-inset-shadow
2083
+ */
2084
+ 'inset-shadow': [{
2085
+ 'inset-shadow': ['none', themeInsetShadow, isArbitraryVariableShadow, isArbitraryShadow]
2086
+ }],
2087
+ /**
2088
+ * Inset Box Shadow Color
2089
+ * @see https://tailwindcss.com/docs/box-shadow#setting-the-inset-shadow-color
2090
+ */
2091
+ 'inset-shadow-color': [{
2092
+ 'inset-shadow': scaleColor()
2093
+ }],
2094
+ /**
2095
+ * Ring Width
2096
+ * @see https://tailwindcss.com/docs/box-shadow#adding-a-ring
2097
+ */
2098
+ 'ring-w': [{
2099
+ ring: scaleBorderWidth()
2100
+ }],
2101
+ /**
2102
+ * Ring Width Inset
2103
+ * @see https://v3.tailwindcss.com/docs/ring-width#inset-rings
2104
+ * @deprecated since Tailwind CSS v4.0.0
2105
+ * @see https://github.com/tailwindlabs/tailwindcss/blob/v4.0.0/packages/tailwindcss/src/utilities.ts#L4158
2106
+ */
2107
+ 'ring-w-inset': ['ring-inset'],
2108
+ /**
2109
+ * Ring Color
2110
+ * @see https://tailwindcss.com/docs/box-shadow#setting-the-ring-color
2111
+ */
2112
+ 'ring-color': [{
2113
+ ring: scaleColor()
2114
+ }],
2115
+ /**
2116
+ * Ring Offset Width
2117
+ * @see https://v3.tailwindcss.com/docs/ring-offset-width
2118
+ * @deprecated since Tailwind CSS v4.0.0
2119
+ * @see https://github.com/tailwindlabs/tailwindcss/blob/v4.0.0/packages/tailwindcss/src/utilities.ts#L4158
2120
+ */
2121
+ 'ring-offset-w': [{
2122
+ 'ring-offset': [isNumber, isArbitraryLength]
2123
+ }],
2124
+ /**
2125
+ * Ring Offset Color
2126
+ * @see https://v3.tailwindcss.com/docs/ring-offset-color
2127
+ * @deprecated since Tailwind CSS v4.0.0
2128
+ * @see https://github.com/tailwindlabs/tailwindcss/blob/v4.0.0/packages/tailwindcss/src/utilities.ts#L4158
2129
+ */
2130
+ 'ring-offset-color': [{
2131
+ 'ring-offset': scaleColor()
2132
+ }],
2133
+ /**
2134
+ * Inset Ring Width
2135
+ * @see https://tailwindcss.com/docs/box-shadow#adding-an-inset-ring
2136
+ */
2137
+ 'inset-ring-w': [{
2138
+ 'inset-ring': scaleBorderWidth()
2139
+ }],
2140
+ /**
2141
+ * Inset Ring Color
2142
+ * @see https://tailwindcss.com/docs/box-shadow#setting-the-inset-ring-color
2143
+ */
2144
+ 'inset-ring-color': [{
2145
+ 'inset-ring': scaleColor()
2146
+ }],
2147
+ /**
2148
+ * Text Shadow
2149
+ * @see https://tailwindcss.com/docs/text-shadow
2150
+ */
2151
+ 'text-shadow': [{
2152
+ 'text-shadow': ['none', themeTextShadow, isArbitraryVariableShadow, isArbitraryShadow]
2153
+ }],
2154
+ /**
2155
+ * Text Shadow Color
2156
+ * @see https://tailwindcss.com/docs/text-shadow#setting-the-shadow-color
2157
+ */
2158
+ 'text-shadow-color': [{
2159
+ 'text-shadow': scaleColor()
2160
+ }],
2161
+ /**
2162
+ * Opacity
2163
+ * @see https://tailwindcss.com/docs/opacity
2164
+ */
2165
+ opacity: [{
2166
+ opacity: [isNumber, isArbitraryVariable, isArbitraryValue]
2167
+ }],
2168
+ /**
2169
+ * Mix Blend Mode
2170
+ * @see https://tailwindcss.com/docs/mix-blend-mode
2171
+ */
2172
+ 'mix-blend': [{
2173
+ 'mix-blend': [...scaleBlendMode(), 'plus-darker', 'plus-lighter']
2174
+ }],
2175
+ /**
2176
+ * Background Blend Mode
2177
+ * @see https://tailwindcss.com/docs/background-blend-mode
2178
+ */
2179
+ 'bg-blend': [{
2180
+ 'bg-blend': scaleBlendMode()
2181
+ }],
2182
+ /**
2183
+ * Mask Clip
2184
+ * @see https://tailwindcss.com/docs/mask-clip
2185
+ */
2186
+ 'mask-clip': [{
2187
+ 'mask-clip': ['border', 'padding', 'content', 'fill', 'stroke', 'view']
2188
+ }, 'mask-no-clip'],
2189
+ /**
2190
+ * Mask Composite
2191
+ * @see https://tailwindcss.com/docs/mask-composite
2192
+ */
2193
+ 'mask-composite': [{
2194
+ mask: ['add', 'subtract', 'intersect', 'exclude']
2195
+ }],
2196
+ /**
2197
+ * Mask Image
2198
+ * @see https://tailwindcss.com/docs/mask-image
2199
+ */
2200
+ 'mask-image-linear-pos': [{
2201
+ 'mask-linear': [isNumber]
2202
+ }],
2203
+ 'mask-image-linear-from-pos': [{
2204
+ 'mask-linear-from': scaleMaskImagePosition()
2205
+ }],
2206
+ 'mask-image-linear-to-pos': [{
2207
+ 'mask-linear-to': scaleMaskImagePosition()
2208
+ }],
2209
+ 'mask-image-linear-from-color': [{
2210
+ 'mask-linear-from': scaleColor()
2211
+ }],
2212
+ 'mask-image-linear-to-color': [{
2213
+ 'mask-linear-to': scaleColor()
2214
+ }],
2215
+ 'mask-image-t-from-pos': [{
2216
+ 'mask-t-from': scaleMaskImagePosition()
2217
+ }],
2218
+ 'mask-image-t-to-pos': [{
2219
+ 'mask-t-to': scaleMaskImagePosition()
2220
+ }],
2221
+ 'mask-image-t-from-color': [{
2222
+ 'mask-t-from': scaleColor()
2223
+ }],
2224
+ 'mask-image-t-to-color': [{
2225
+ 'mask-t-to': scaleColor()
2226
+ }],
2227
+ 'mask-image-r-from-pos': [{
2228
+ 'mask-r-from': scaleMaskImagePosition()
2229
+ }],
2230
+ 'mask-image-r-to-pos': [{
2231
+ 'mask-r-to': scaleMaskImagePosition()
2232
+ }],
2233
+ 'mask-image-r-from-color': [{
2234
+ 'mask-r-from': scaleColor()
2235
+ }],
2236
+ 'mask-image-r-to-color': [{
2237
+ 'mask-r-to': scaleColor()
2238
+ }],
2239
+ 'mask-image-b-from-pos': [{
2240
+ 'mask-b-from': scaleMaskImagePosition()
2241
+ }],
2242
+ 'mask-image-b-to-pos': [{
2243
+ 'mask-b-to': scaleMaskImagePosition()
2244
+ }],
2245
+ 'mask-image-b-from-color': [{
2246
+ 'mask-b-from': scaleColor()
2247
+ }],
2248
+ 'mask-image-b-to-color': [{
2249
+ 'mask-b-to': scaleColor()
2250
+ }],
2251
+ 'mask-image-l-from-pos': [{
2252
+ 'mask-l-from': scaleMaskImagePosition()
2253
+ }],
2254
+ 'mask-image-l-to-pos': [{
2255
+ 'mask-l-to': scaleMaskImagePosition()
2256
+ }],
2257
+ 'mask-image-l-from-color': [{
2258
+ 'mask-l-from': scaleColor()
2259
+ }],
2260
+ 'mask-image-l-to-color': [{
2261
+ 'mask-l-to': scaleColor()
2262
+ }],
2263
+ 'mask-image-x-from-pos': [{
2264
+ 'mask-x-from': scaleMaskImagePosition()
2265
+ }],
2266
+ 'mask-image-x-to-pos': [{
2267
+ 'mask-x-to': scaleMaskImagePosition()
2268
+ }],
2269
+ 'mask-image-x-from-color': [{
2270
+ 'mask-x-from': scaleColor()
2271
+ }],
2272
+ 'mask-image-x-to-color': [{
2273
+ 'mask-x-to': scaleColor()
2274
+ }],
2275
+ 'mask-image-y-from-pos': [{
2276
+ 'mask-y-from': scaleMaskImagePosition()
2277
+ }],
2278
+ 'mask-image-y-to-pos': [{
2279
+ 'mask-y-to': scaleMaskImagePosition()
2280
+ }],
2281
+ 'mask-image-y-from-color': [{
2282
+ 'mask-y-from': scaleColor()
2283
+ }],
2284
+ 'mask-image-y-to-color': [{
2285
+ 'mask-y-to': scaleColor()
2286
+ }],
2287
+ 'mask-image-radial': [{
2288
+ 'mask-radial': [isArbitraryVariable, isArbitraryValue]
2289
+ }],
2290
+ 'mask-image-radial-from-pos': [{
2291
+ 'mask-radial-from': scaleMaskImagePosition()
2292
+ }],
2293
+ 'mask-image-radial-to-pos': [{
2294
+ 'mask-radial-to': scaleMaskImagePosition()
2295
+ }],
2296
+ 'mask-image-radial-from-color': [{
2297
+ 'mask-radial-from': scaleColor()
2298
+ }],
2299
+ 'mask-image-radial-to-color': [{
2300
+ 'mask-radial-to': scaleColor()
2301
+ }],
2302
+ 'mask-image-radial-shape': [{
2303
+ 'mask-radial': ['circle', 'ellipse']
2304
+ }],
2305
+ 'mask-image-radial-size': [{
2306
+ 'mask-radial': [{
2307
+ closest: ['side', 'corner'],
2308
+ farthest: ['side', 'corner']
2309
+ }]
2310
+ }],
2311
+ 'mask-image-radial-pos': [{
2312
+ 'mask-radial-at': scalePosition()
2313
+ }],
2314
+ 'mask-image-conic-pos': [{
2315
+ 'mask-conic': [isNumber]
2316
+ }],
2317
+ 'mask-image-conic-from-pos': [{
2318
+ 'mask-conic-from': scaleMaskImagePosition()
2319
+ }],
2320
+ 'mask-image-conic-to-pos': [{
2321
+ 'mask-conic-to': scaleMaskImagePosition()
2322
+ }],
2323
+ 'mask-image-conic-from-color': [{
2324
+ 'mask-conic-from': scaleColor()
2325
+ }],
2326
+ 'mask-image-conic-to-color': [{
2327
+ 'mask-conic-to': scaleColor()
2328
+ }],
2329
+ /**
2330
+ * Mask Mode
2331
+ * @see https://tailwindcss.com/docs/mask-mode
2332
+ */
2333
+ 'mask-mode': [{
2334
+ mask: ['alpha', 'luminance', 'match']
2335
+ }],
2336
+ /**
2337
+ * Mask Origin
2338
+ * @see https://tailwindcss.com/docs/mask-origin
2339
+ */
2340
+ 'mask-origin': [{
2341
+ 'mask-origin': ['border', 'padding', 'content', 'fill', 'stroke', 'view']
2342
+ }],
2343
+ /**
2344
+ * Mask Position
2345
+ * @see https://tailwindcss.com/docs/mask-position
2346
+ */
2347
+ 'mask-position': [{
2348
+ mask: scaleBgPosition()
2349
+ }],
2350
+ /**
2351
+ * Mask Repeat
2352
+ * @see https://tailwindcss.com/docs/mask-repeat
2353
+ */
2354
+ 'mask-repeat': [{
2355
+ mask: scaleBgRepeat()
2356
+ }],
2357
+ /**
2358
+ * Mask Size
2359
+ * @see https://tailwindcss.com/docs/mask-size
2360
+ */
2361
+ 'mask-size': [{
2362
+ mask: scaleBgSize()
2363
+ }],
2364
+ /**
2365
+ * Mask Type
2366
+ * @see https://tailwindcss.com/docs/mask-type
2367
+ */
2368
+ 'mask-type': [{
2369
+ 'mask-type': ['alpha', 'luminance']
2370
+ }],
2371
+ /**
2372
+ * Mask Image
2373
+ * @see https://tailwindcss.com/docs/mask-image
2374
+ */
2375
+ 'mask-image': [{
2376
+ mask: ['none', isArbitraryVariable, isArbitraryValue]
2377
+ }],
2378
+ // ---------------
2379
+ // --- Filters ---
2380
+ // ---------------
2381
+ /**
2382
+ * Filter
2383
+ * @see https://tailwindcss.com/docs/filter
2384
+ */
2385
+ filter: [{
2386
+ filter: [
2387
+ // Deprecated since Tailwind CSS v3.0.0
2388
+ '', 'none', isArbitraryVariable, isArbitraryValue]
2389
+ }],
2390
+ /**
2391
+ * Blur
2392
+ * @see https://tailwindcss.com/docs/blur
2393
+ */
2394
+ blur: [{
2395
+ blur: scaleBlur()
2396
+ }],
2397
+ /**
2398
+ * Brightness
2399
+ * @see https://tailwindcss.com/docs/brightness
2400
+ */
2401
+ brightness: [{
2402
+ brightness: [isNumber, isArbitraryVariable, isArbitraryValue]
2403
+ }],
2404
+ /**
2405
+ * Contrast
2406
+ * @see https://tailwindcss.com/docs/contrast
2407
+ */
2408
+ contrast: [{
2409
+ contrast: [isNumber, isArbitraryVariable, isArbitraryValue]
2410
+ }],
2411
+ /**
2412
+ * Drop Shadow
2413
+ * @see https://tailwindcss.com/docs/drop-shadow
2414
+ */
2415
+ 'drop-shadow': [{
2416
+ 'drop-shadow': [
2417
+ // Deprecated since Tailwind CSS v4.0.0
2418
+ '', 'none', themeDropShadow, isArbitraryVariableShadow, isArbitraryShadow]
2419
+ }],
2420
+ /**
2421
+ * Drop Shadow Color
2422
+ * @see https://tailwindcss.com/docs/filter-drop-shadow#setting-the-shadow-color
2423
+ */
2424
+ 'drop-shadow-color': [{
2425
+ 'drop-shadow': scaleColor()
2426
+ }],
2427
+ /**
2428
+ * Grayscale
2429
+ * @see https://tailwindcss.com/docs/grayscale
2430
+ */
2431
+ grayscale: [{
2432
+ grayscale: ['', isNumber, isArbitraryVariable, isArbitraryValue]
2433
+ }],
2434
+ /**
2435
+ * Hue Rotate
2436
+ * @see https://tailwindcss.com/docs/hue-rotate
2437
+ */
2438
+ 'hue-rotate': [{
2439
+ 'hue-rotate': [isNumber, isArbitraryVariable, isArbitraryValue]
2440
+ }],
2441
+ /**
2442
+ * Invert
2443
+ * @see https://tailwindcss.com/docs/invert
2444
+ */
2445
+ invert: [{
2446
+ invert: ['', isNumber, isArbitraryVariable, isArbitraryValue]
2447
+ }],
2448
+ /**
2449
+ * Saturate
2450
+ * @see https://tailwindcss.com/docs/saturate
2451
+ */
2452
+ saturate: [{
2453
+ saturate: [isNumber, isArbitraryVariable, isArbitraryValue]
2454
+ }],
2455
+ /**
2456
+ * Sepia
2457
+ * @see https://tailwindcss.com/docs/sepia
2458
+ */
2459
+ sepia: [{
2460
+ sepia: ['', isNumber, isArbitraryVariable, isArbitraryValue]
2461
+ }],
2462
+ /**
2463
+ * Backdrop Filter
2464
+ * @see https://tailwindcss.com/docs/backdrop-filter
2465
+ */
2466
+ 'backdrop-filter': [{
2467
+ 'backdrop-filter': [
2468
+ // Deprecated since Tailwind CSS v3.0.0
2469
+ '', 'none', isArbitraryVariable, isArbitraryValue]
2470
+ }],
2471
+ /**
2472
+ * Backdrop Blur
2473
+ * @see https://tailwindcss.com/docs/backdrop-blur
2474
+ */
2475
+ 'backdrop-blur': [{
2476
+ 'backdrop-blur': scaleBlur()
2477
+ }],
2478
+ /**
2479
+ * Backdrop Brightness
2480
+ * @see https://tailwindcss.com/docs/backdrop-brightness
2481
+ */
2482
+ 'backdrop-brightness': [{
2483
+ 'backdrop-brightness': [isNumber, isArbitraryVariable, isArbitraryValue]
2484
+ }],
2485
+ /**
2486
+ * Backdrop Contrast
2487
+ * @see https://tailwindcss.com/docs/backdrop-contrast
2488
+ */
2489
+ 'backdrop-contrast': [{
2490
+ 'backdrop-contrast': [isNumber, isArbitraryVariable, isArbitraryValue]
2491
+ }],
2492
+ /**
2493
+ * Backdrop Grayscale
2494
+ * @see https://tailwindcss.com/docs/backdrop-grayscale
2495
+ */
2496
+ 'backdrop-grayscale': [{
2497
+ 'backdrop-grayscale': ['', isNumber, isArbitraryVariable, isArbitraryValue]
2498
+ }],
2499
+ /**
2500
+ * Backdrop Hue Rotate
2501
+ * @see https://tailwindcss.com/docs/backdrop-hue-rotate
2502
+ */
2503
+ 'backdrop-hue-rotate': [{
2504
+ 'backdrop-hue-rotate': [isNumber, isArbitraryVariable, isArbitraryValue]
2505
+ }],
2506
+ /**
2507
+ * Backdrop Invert
2508
+ * @see https://tailwindcss.com/docs/backdrop-invert
2509
+ */
2510
+ 'backdrop-invert': [{
2511
+ 'backdrop-invert': ['', isNumber, isArbitraryVariable, isArbitraryValue]
2512
+ }],
2513
+ /**
2514
+ * Backdrop Opacity
2515
+ * @see https://tailwindcss.com/docs/backdrop-opacity
2516
+ */
2517
+ 'backdrop-opacity': [{
2518
+ 'backdrop-opacity': [isNumber, isArbitraryVariable, isArbitraryValue]
2519
+ }],
2520
+ /**
2521
+ * Backdrop Saturate
2522
+ * @see https://tailwindcss.com/docs/backdrop-saturate
2523
+ */
2524
+ 'backdrop-saturate': [{
2525
+ 'backdrop-saturate': [isNumber, isArbitraryVariable, isArbitraryValue]
2526
+ }],
2527
+ /**
2528
+ * Backdrop Sepia
2529
+ * @see https://tailwindcss.com/docs/backdrop-sepia
2530
+ */
2531
+ 'backdrop-sepia': [{
2532
+ 'backdrop-sepia': ['', isNumber, isArbitraryVariable, isArbitraryValue]
2533
+ }],
2534
+ // --------------
2535
+ // --- Tables ---
2536
+ // --------------
2537
+ /**
2538
+ * Border Collapse
2539
+ * @see https://tailwindcss.com/docs/border-collapse
2540
+ */
2541
+ 'border-collapse': [{
2542
+ border: ['collapse', 'separate']
2543
+ }],
2544
+ /**
2545
+ * Border Spacing
2546
+ * @see https://tailwindcss.com/docs/border-spacing
2547
+ */
2548
+ 'border-spacing': [{
2549
+ 'border-spacing': scaleUnambiguousSpacing()
2550
+ }],
2551
+ /**
2552
+ * Border Spacing X
2553
+ * @see https://tailwindcss.com/docs/border-spacing
2554
+ */
2555
+ 'border-spacing-x': [{
2556
+ 'border-spacing-x': scaleUnambiguousSpacing()
2557
+ }],
2558
+ /**
2559
+ * Border Spacing Y
2560
+ * @see https://tailwindcss.com/docs/border-spacing
2561
+ */
2562
+ 'border-spacing-y': [{
2563
+ 'border-spacing-y': scaleUnambiguousSpacing()
2564
+ }],
2565
+ /**
2566
+ * Table Layout
2567
+ * @see https://tailwindcss.com/docs/table-layout
2568
+ */
2569
+ 'table-layout': [{
2570
+ table: ['auto', 'fixed']
2571
+ }],
2572
+ /**
2573
+ * Caption Side
2574
+ * @see https://tailwindcss.com/docs/caption-side
2575
+ */
2576
+ caption: [{
2577
+ caption: ['top', 'bottom']
2578
+ }],
2579
+ // ---------------------------------
2580
+ // --- Transitions and Animation ---
2581
+ // ---------------------------------
2582
+ /**
2583
+ * Transition Property
2584
+ * @see https://tailwindcss.com/docs/transition-property
2585
+ */
2586
+ transition: [{
2587
+ transition: ['', 'all', 'colors', 'opacity', 'shadow', 'transform', 'none', isArbitraryVariable, isArbitraryValue]
2588
+ }],
2589
+ /**
2590
+ * Transition Behavior
2591
+ * @see https://tailwindcss.com/docs/transition-behavior
2592
+ */
2593
+ 'transition-behavior': [{
2594
+ transition: ['normal', 'discrete']
2595
+ }],
2596
+ /**
2597
+ * Transition Duration
2598
+ * @see https://tailwindcss.com/docs/transition-duration
2599
+ */
2600
+ duration: [{
2601
+ duration: [isNumber, 'initial', isArbitraryVariable, isArbitraryValue]
2602
+ }],
2603
+ /**
2604
+ * Transition Timing Function
2605
+ * @see https://tailwindcss.com/docs/transition-timing-function
2606
+ */
2607
+ ease: [{
2608
+ ease: ['linear', 'initial', themeEase, isArbitraryVariable, isArbitraryValue]
2609
+ }],
2610
+ /**
2611
+ * Transition Delay
2612
+ * @see https://tailwindcss.com/docs/transition-delay
2613
+ */
2614
+ delay: [{
2615
+ delay: [isNumber, isArbitraryVariable, isArbitraryValue]
2616
+ }],
2617
+ /**
2618
+ * Animation
2619
+ * @see https://tailwindcss.com/docs/animation
2620
+ */
2621
+ animate: [{
2622
+ animate: ['none', themeAnimate, isArbitraryVariable, isArbitraryValue]
2623
+ }],
2624
+ // ------------------
2625
+ // --- Transforms ---
2626
+ // ------------------
2627
+ /**
2628
+ * Backface Visibility
2629
+ * @see https://tailwindcss.com/docs/backface-visibility
2630
+ */
2631
+ backface: [{
2632
+ backface: ['hidden', 'visible']
2633
+ }],
2634
+ /**
2635
+ * Perspective
2636
+ * @see https://tailwindcss.com/docs/perspective
2637
+ */
2638
+ perspective: [{
2639
+ perspective: [themePerspective, isArbitraryVariable, isArbitraryValue]
2640
+ }],
2641
+ /**
2642
+ * Perspective Origin
2643
+ * @see https://tailwindcss.com/docs/perspective-origin
2644
+ */
2645
+ 'perspective-origin': [{
2646
+ 'perspective-origin': scalePositionWithArbitrary()
2647
+ }],
2648
+ /**
2649
+ * Rotate
2650
+ * @see https://tailwindcss.com/docs/rotate
2651
+ */
2652
+ rotate: [{
2653
+ rotate: scaleRotate()
2654
+ }],
2655
+ /**
2656
+ * Rotate X
2657
+ * @see https://tailwindcss.com/docs/rotate
2658
+ */
2659
+ 'rotate-x': [{
2660
+ 'rotate-x': scaleRotate()
2661
+ }],
2662
+ /**
2663
+ * Rotate Y
2664
+ * @see https://tailwindcss.com/docs/rotate
2665
+ */
2666
+ 'rotate-y': [{
2667
+ 'rotate-y': scaleRotate()
2668
+ }],
2669
+ /**
2670
+ * Rotate Z
2671
+ * @see https://tailwindcss.com/docs/rotate
2672
+ */
2673
+ 'rotate-z': [{
2674
+ 'rotate-z': scaleRotate()
2675
+ }],
2676
+ /**
2677
+ * Scale
2678
+ * @see https://tailwindcss.com/docs/scale
2679
+ */
2680
+ scale: [{
2681
+ scale: scaleScale()
2682
+ }],
2683
+ /**
2684
+ * Scale X
2685
+ * @see https://tailwindcss.com/docs/scale
2686
+ */
2687
+ 'scale-x': [{
2688
+ 'scale-x': scaleScale()
2689
+ }],
2690
+ /**
2691
+ * Scale Y
2692
+ * @see https://tailwindcss.com/docs/scale
2693
+ */
2694
+ 'scale-y': [{
2695
+ 'scale-y': scaleScale()
2696
+ }],
2697
+ /**
2698
+ * Scale Z
2699
+ * @see https://tailwindcss.com/docs/scale
2700
+ */
2701
+ 'scale-z': [{
2702
+ 'scale-z': scaleScale()
2703
+ }],
2704
+ /**
2705
+ * Scale 3D
2706
+ * @see https://tailwindcss.com/docs/scale
2707
+ */
2708
+ 'scale-3d': ['scale-3d'],
2709
+ /**
2710
+ * Skew
2711
+ * @see https://tailwindcss.com/docs/skew
2712
+ */
2713
+ skew: [{
2714
+ skew: scaleSkew()
2715
+ }],
2716
+ /**
2717
+ * Skew X
2718
+ * @see https://tailwindcss.com/docs/skew
2719
+ */
2720
+ 'skew-x': [{
2721
+ 'skew-x': scaleSkew()
2722
+ }],
2723
+ /**
2724
+ * Skew Y
2725
+ * @see https://tailwindcss.com/docs/skew
2726
+ */
2727
+ 'skew-y': [{
2728
+ 'skew-y': scaleSkew()
2729
+ }],
2730
+ /**
2731
+ * Transform
2732
+ * @see https://tailwindcss.com/docs/transform
2733
+ */
2734
+ transform: [{
2735
+ transform: [isArbitraryVariable, isArbitraryValue, '', 'none', 'gpu', 'cpu']
2736
+ }],
2737
+ /**
2738
+ * Transform Origin
2739
+ * @see https://tailwindcss.com/docs/transform-origin
2740
+ */
2741
+ 'transform-origin': [{
2742
+ origin: scalePositionWithArbitrary()
2743
+ }],
2744
+ /**
2745
+ * Transform Style
2746
+ * @see https://tailwindcss.com/docs/transform-style
2747
+ */
2748
+ 'transform-style': [{
2749
+ transform: ['3d', 'flat']
2750
+ }],
2751
+ /**
2752
+ * Translate
2753
+ * @see https://tailwindcss.com/docs/translate
2754
+ */
2755
+ translate: [{
2756
+ translate: scaleTranslate()
2757
+ }],
2758
+ /**
2759
+ * Translate X
2760
+ * @see https://tailwindcss.com/docs/translate
2761
+ */
2762
+ 'translate-x': [{
2763
+ 'translate-x': scaleTranslate()
2764
+ }],
2765
+ /**
2766
+ * Translate Y
2767
+ * @see https://tailwindcss.com/docs/translate
2768
+ */
2769
+ 'translate-y': [{
2770
+ 'translate-y': scaleTranslate()
2771
+ }],
2772
+ /**
2773
+ * Translate Z
2774
+ * @see https://tailwindcss.com/docs/translate
2775
+ */
2776
+ 'translate-z': [{
2777
+ 'translate-z': scaleTranslate()
2778
+ }],
2779
+ /**
2780
+ * Translate None
2781
+ * @see https://tailwindcss.com/docs/translate
2782
+ */
2783
+ 'translate-none': ['translate-none'],
2784
+ // ---------------------
2785
+ // --- Interactivity ---
2786
+ // ---------------------
2787
+ /**
2788
+ * Accent Color
2789
+ * @see https://tailwindcss.com/docs/accent-color
2790
+ */
2791
+ accent: [{
2792
+ accent: scaleColor()
2793
+ }],
2794
+ /**
2795
+ * Appearance
2796
+ * @see https://tailwindcss.com/docs/appearance
2797
+ */
2798
+ appearance: [{
2799
+ appearance: ['none', 'auto']
2800
+ }],
2801
+ /**
2802
+ * Caret Color
2803
+ * @see https://tailwindcss.com/docs/just-in-time-mode#caret-color-utilities
2804
+ */
2805
+ 'caret-color': [{
2806
+ caret: scaleColor()
2807
+ }],
2808
+ /**
2809
+ * Color Scheme
2810
+ * @see https://tailwindcss.com/docs/color-scheme
2811
+ */
2812
+ 'color-scheme': [{
2813
+ scheme: ['normal', 'dark', 'light', 'light-dark', 'only-dark', 'only-light']
2814
+ }],
2815
+ /**
2816
+ * Cursor
2817
+ * @see https://tailwindcss.com/docs/cursor
2818
+ */
2819
+ cursor: [{
2820
+ cursor: ['auto', 'default', 'pointer', 'wait', 'text', 'move', 'help', 'not-allowed', 'none', 'context-menu', 'progress', 'cell', 'crosshair', 'vertical-text', 'alias', 'copy', 'no-drop', 'grab', 'grabbing', 'all-scroll', 'col-resize', 'row-resize', 'n-resize', 'e-resize', 's-resize', 'w-resize', 'ne-resize', 'nw-resize', 'se-resize', 'sw-resize', 'ew-resize', 'ns-resize', 'nesw-resize', 'nwse-resize', 'zoom-in', 'zoom-out', isArbitraryVariable, isArbitraryValue]
2821
+ }],
2822
+ /**
2823
+ * Field Sizing
2824
+ * @see https://tailwindcss.com/docs/field-sizing
2825
+ */
2826
+ 'field-sizing': [{
2827
+ 'field-sizing': ['fixed', 'content']
2828
+ }],
2829
+ /**
2830
+ * Pointer Events
2831
+ * @see https://tailwindcss.com/docs/pointer-events
2832
+ */
2833
+ 'pointer-events': [{
2834
+ 'pointer-events': ['auto', 'none']
2835
+ }],
2836
+ /**
2837
+ * Resize
2838
+ * @see https://tailwindcss.com/docs/resize
2839
+ */
2840
+ resize: [{
2841
+ resize: ['none', '', 'y', 'x']
2842
+ }],
2843
+ /**
2844
+ * Scroll Behavior
2845
+ * @see https://tailwindcss.com/docs/scroll-behavior
2846
+ */
2847
+ 'scroll-behavior': [{
2848
+ scroll: ['auto', 'smooth']
2849
+ }],
2850
+ /**
2851
+ * Scroll Margin
2852
+ * @see https://tailwindcss.com/docs/scroll-margin
2853
+ */
2854
+ 'scroll-m': [{
2855
+ 'scroll-m': scaleUnambiguousSpacing()
2856
+ }],
2857
+ /**
2858
+ * Scroll Margin X
2859
+ * @see https://tailwindcss.com/docs/scroll-margin
2860
+ */
2861
+ 'scroll-mx': [{
2862
+ 'scroll-mx': scaleUnambiguousSpacing()
2863
+ }],
2864
+ /**
2865
+ * Scroll Margin Y
2866
+ * @see https://tailwindcss.com/docs/scroll-margin
2867
+ */
2868
+ 'scroll-my': [{
2869
+ 'scroll-my': scaleUnambiguousSpacing()
2870
+ }],
2871
+ /**
2872
+ * Scroll Margin Start
2873
+ * @see https://tailwindcss.com/docs/scroll-margin
2874
+ */
2875
+ 'scroll-ms': [{
2876
+ 'scroll-ms': scaleUnambiguousSpacing()
2877
+ }],
2878
+ /**
2879
+ * Scroll Margin End
2880
+ * @see https://tailwindcss.com/docs/scroll-margin
2881
+ */
2882
+ 'scroll-me': [{
2883
+ 'scroll-me': scaleUnambiguousSpacing()
2884
+ }],
2885
+ /**
2886
+ * Scroll Margin Top
2887
+ * @see https://tailwindcss.com/docs/scroll-margin
2888
+ */
2889
+ 'scroll-mt': [{
2890
+ 'scroll-mt': scaleUnambiguousSpacing()
2891
+ }],
2892
+ /**
2893
+ * Scroll Margin Right
2894
+ * @see https://tailwindcss.com/docs/scroll-margin
2895
+ */
2896
+ 'scroll-mr': [{
2897
+ 'scroll-mr': scaleUnambiguousSpacing()
2898
+ }],
2899
+ /**
2900
+ * Scroll Margin Bottom
2901
+ * @see https://tailwindcss.com/docs/scroll-margin
2902
+ */
2903
+ 'scroll-mb': [{
2904
+ 'scroll-mb': scaleUnambiguousSpacing()
2905
+ }],
2906
+ /**
2907
+ * Scroll Margin Left
2908
+ * @see https://tailwindcss.com/docs/scroll-margin
2909
+ */
2910
+ 'scroll-ml': [{
2911
+ 'scroll-ml': scaleUnambiguousSpacing()
2912
+ }],
2913
+ /**
2914
+ * Scroll Padding
2915
+ * @see https://tailwindcss.com/docs/scroll-padding
2916
+ */
2917
+ 'scroll-p': [{
2918
+ 'scroll-p': scaleUnambiguousSpacing()
2919
+ }],
2920
+ /**
2921
+ * Scroll Padding X
2922
+ * @see https://tailwindcss.com/docs/scroll-padding
2923
+ */
2924
+ 'scroll-px': [{
2925
+ 'scroll-px': scaleUnambiguousSpacing()
2926
+ }],
2927
+ /**
2928
+ * Scroll Padding Y
2929
+ * @see https://tailwindcss.com/docs/scroll-padding
2930
+ */
2931
+ 'scroll-py': [{
2932
+ 'scroll-py': scaleUnambiguousSpacing()
2933
+ }],
2934
+ /**
2935
+ * Scroll Padding Start
2936
+ * @see https://tailwindcss.com/docs/scroll-padding
2937
+ */
2938
+ 'scroll-ps': [{
2939
+ 'scroll-ps': scaleUnambiguousSpacing()
2940
+ }],
2941
+ /**
2942
+ * Scroll Padding End
2943
+ * @see https://tailwindcss.com/docs/scroll-padding
2944
+ */
2945
+ 'scroll-pe': [{
2946
+ 'scroll-pe': scaleUnambiguousSpacing()
2947
+ }],
2948
+ /**
2949
+ * Scroll Padding Top
2950
+ * @see https://tailwindcss.com/docs/scroll-padding
2951
+ */
2952
+ 'scroll-pt': [{
2953
+ 'scroll-pt': scaleUnambiguousSpacing()
2954
+ }],
2955
+ /**
2956
+ * Scroll Padding Right
2957
+ * @see https://tailwindcss.com/docs/scroll-padding
2958
+ */
2959
+ 'scroll-pr': [{
2960
+ 'scroll-pr': scaleUnambiguousSpacing()
2961
+ }],
2962
+ /**
2963
+ * Scroll Padding Bottom
2964
+ * @see https://tailwindcss.com/docs/scroll-padding
2965
+ */
2966
+ 'scroll-pb': [{
2967
+ 'scroll-pb': scaleUnambiguousSpacing()
2968
+ }],
2969
+ /**
2970
+ * Scroll Padding Left
2971
+ * @see https://tailwindcss.com/docs/scroll-padding
2972
+ */
2973
+ 'scroll-pl': [{
2974
+ 'scroll-pl': scaleUnambiguousSpacing()
2975
+ }],
2976
+ /**
2977
+ * Scroll Snap Align
2978
+ * @see https://tailwindcss.com/docs/scroll-snap-align
2979
+ */
2980
+ 'snap-align': [{
2981
+ snap: ['start', 'end', 'center', 'align-none']
2982
+ }],
2983
+ /**
2984
+ * Scroll Snap Stop
2985
+ * @see https://tailwindcss.com/docs/scroll-snap-stop
2986
+ */
2987
+ 'snap-stop': [{
2988
+ snap: ['normal', 'always']
2989
+ }],
2990
+ /**
2991
+ * Scroll Snap Type
2992
+ * @see https://tailwindcss.com/docs/scroll-snap-type
2993
+ */
2994
+ 'snap-type': [{
2995
+ snap: ['none', 'x', 'y', 'both']
2996
+ }],
2997
+ /**
2998
+ * Scroll Snap Type Strictness
2999
+ * @see https://tailwindcss.com/docs/scroll-snap-type
3000
+ */
3001
+ 'snap-strictness': [{
3002
+ snap: ['mandatory', 'proximity']
3003
+ }],
3004
+ /**
3005
+ * Touch Action
3006
+ * @see https://tailwindcss.com/docs/touch-action
3007
+ */
3008
+ touch: [{
3009
+ touch: ['auto', 'none', 'manipulation']
3010
+ }],
3011
+ /**
3012
+ * Touch Action X
3013
+ * @see https://tailwindcss.com/docs/touch-action
3014
+ */
3015
+ 'touch-x': [{
3016
+ 'touch-pan': ['x', 'left', 'right']
3017
+ }],
3018
+ /**
3019
+ * Touch Action Y
3020
+ * @see https://tailwindcss.com/docs/touch-action
3021
+ */
3022
+ 'touch-y': [{
3023
+ 'touch-pan': ['y', 'up', 'down']
3024
+ }],
3025
+ /**
3026
+ * Touch Action Pinch Zoom
3027
+ * @see https://tailwindcss.com/docs/touch-action
3028
+ */
3029
+ 'touch-pz': ['touch-pinch-zoom'],
3030
+ /**
3031
+ * User Select
3032
+ * @see https://tailwindcss.com/docs/user-select
3033
+ */
3034
+ select: [{
3035
+ select: ['none', 'text', 'all', 'auto']
3036
+ }],
3037
+ /**
3038
+ * Will Change
3039
+ * @see https://tailwindcss.com/docs/will-change
3040
+ */
3041
+ 'will-change': [{
3042
+ 'will-change': ['auto', 'scroll', 'contents', 'transform', isArbitraryVariable, isArbitraryValue]
3043
+ }],
3044
+ // -----------
3045
+ // --- SVG ---
3046
+ // -----------
3047
+ /**
3048
+ * Fill
3049
+ * @see https://tailwindcss.com/docs/fill
3050
+ */
3051
+ fill: [{
3052
+ fill: ['none', ...scaleColor()]
3053
+ }],
3054
+ /**
3055
+ * Stroke Width
3056
+ * @see https://tailwindcss.com/docs/stroke-width
3057
+ */
3058
+ 'stroke-w': [{
3059
+ stroke: [isNumber, isArbitraryVariableLength, isArbitraryLength, isArbitraryNumber]
3060
+ }],
3061
+ /**
3062
+ * Stroke
3063
+ * @see https://tailwindcss.com/docs/stroke
3064
+ */
3065
+ stroke: [{
3066
+ stroke: ['none', ...scaleColor()]
3067
+ }],
3068
+ // ---------------------
3069
+ // --- Accessibility ---
3070
+ // ---------------------
3071
+ /**
3072
+ * Forced Color Adjust
3073
+ * @see https://tailwindcss.com/docs/forced-color-adjust
3074
+ */
3075
+ 'forced-color-adjust': [{
3076
+ 'forced-color-adjust': ['auto', 'none']
3077
+ }]
3078
+ },
3079
+ conflictingClassGroups: {
3080
+ overflow: ['overflow-x', 'overflow-y'],
3081
+ overscroll: ['overscroll-x', 'overscroll-y'],
3082
+ inset: ['inset-x', 'inset-y', 'start', 'end', 'top', 'right', 'bottom', 'left'],
3083
+ 'inset-x': ['right', 'left'],
3084
+ 'inset-y': ['top', 'bottom'],
3085
+ flex: ['basis', 'grow', 'shrink'],
3086
+ gap: ['gap-x', 'gap-y'],
3087
+ p: ['px', 'py', 'ps', 'pe', 'pt', 'pr', 'pb', 'pl'],
3088
+ px: ['pr', 'pl'],
3089
+ py: ['pt', 'pb'],
3090
+ m: ['mx', 'my', 'ms', 'me', 'mt', 'mr', 'mb', 'ml'],
3091
+ mx: ['mr', 'ml'],
3092
+ my: ['mt', 'mb'],
3093
+ size: ['w', 'h'],
3094
+ 'font-size': ['leading'],
3095
+ 'fvn-normal': ['fvn-ordinal', 'fvn-slashed-zero', 'fvn-figure', 'fvn-spacing', 'fvn-fraction'],
3096
+ 'fvn-ordinal': ['fvn-normal'],
3097
+ 'fvn-slashed-zero': ['fvn-normal'],
3098
+ 'fvn-figure': ['fvn-normal'],
3099
+ 'fvn-spacing': ['fvn-normal'],
3100
+ 'fvn-fraction': ['fvn-normal'],
3101
+ 'line-clamp': ['display', 'overflow'],
3102
+ rounded: ['rounded-s', 'rounded-e', 'rounded-t', 'rounded-r', 'rounded-b', 'rounded-l', 'rounded-ss', 'rounded-se', 'rounded-ee', 'rounded-es', 'rounded-tl', 'rounded-tr', 'rounded-br', 'rounded-bl'],
3103
+ 'rounded-s': ['rounded-ss', 'rounded-es'],
3104
+ 'rounded-e': ['rounded-se', 'rounded-ee'],
3105
+ 'rounded-t': ['rounded-tl', 'rounded-tr'],
3106
+ 'rounded-r': ['rounded-tr', 'rounded-br'],
3107
+ 'rounded-b': ['rounded-br', 'rounded-bl'],
3108
+ 'rounded-l': ['rounded-tl', 'rounded-bl'],
3109
+ 'border-spacing': ['border-spacing-x', 'border-spacing-y'],
3110
+ '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'],
3111
+ 'border-w-x': ['border-w-r', 'border-w-l'],
3112
+ 'border-w-y': ['border-w-t', 'border-w-b'],
3113
+ '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'],
3114
+ 'border-color-x': ['border-color-r', 'border-color-l'],
3115
+ 'border-color-y': ['border-color-t', 'border-color-b'],
3116
+ translate: ['translate-x', 'translate-y', 'translate-none'],
3117
+ 'translate-none': ['translate', 'translate-x', 'translate-y', 'translate-z'],
3118
+ 'scroll-m': ['scroll-mx', 'scroll-my', 'scroll-ms', 'scroll-me', 'scroll-mt', 'scroll-mr', 'scroll-mb', 'scroll-ml'],
3119
+ 'scroll-mx': ['scroll-mr', 'scroll-ml'],
3120
+ 'scroll-my': ['scroll-mt', 'scroll-mb'],
3121
+ 'scroll-p': ['scroll-px', 'scroll-py', 'scroll-ps', 'scroll-pe', 'scroll-pt', 'scroll-pr', 'scroll-pb', 'scroll-pl'],
3122
+ 'scroll-px': ['scroll-pr', 'scroll-pl'],
3123
+ 'scroll-py': ['scroll-pt', 'scroll-pb'],
3124
+ touch: ['touch-x', 'touch-y', 'touch-pz'],
3125
+ 'touch-x': ['touch'],
3126
+ 'touch-y': ['touch'],
3127
+ 'touch-pz': ['touch']
3128
+ },
3129
+ conflictingClassGroupModifiers: {
3130
+ 'font-size': ['leading']
3131
+ },
3132
+ orderSensitiveModifiers: ['*', '**', 'after', 'backdrop', 'before', 'details-content', 'file', 'first-letter', 'first-line', 'marker', 'placeholder', 'selection']
3133
+ };
3134
+ };
3135
+ const twMerge = /*#__PURE__*/createTailwindMerge(getDefaultConfig);
3136
+
3137
+ function cn(...inputs) {
3138
+ return twMerge(clsx(inputs));
3139
+ }
3140
+
3141
+ const buttonVariants = cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", {
3142
+ variants: {
3143
+ variant: {
3144
+ default: "bg-primary text-primary-foreground hover:bg-primary/90",
3145
+ destructive: "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
3146
+ outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
3147
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
3148
+ ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
3149
+ link: "text-primary underline-offset-4 hover:underline"
3150
+ },
3151
+ size: {
3152
+ default: "h-9 px-4 py-2 has-[>svg]:px-3",
3153
+ sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
3154
+ lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
3155
+ icon: "size-9",
3156
+ "icon-sm": "size-8",
3157
+ "icon-lg": "size-10"
3158
+ }
3159
+ },
3160
+ defaultVariants: {
3161
+ variant: "default",
3162
+ size: "default"
3163
+ }
3164
+ });
3165
+ const Button = /*#__PURE__*/React__namespace.forwardRef(({
3166
+ className,
3167
+ variant = "default",
3168
+ size = "default",
3169
+ asChild = false,
3170
+ ...props
3171
+ }, ref) => {
3172
+ const Comp = asChild ? reactSlot.Slot : "button";
3173
+ return /*#__PURE__*/jsxRuntime.jsx(Comp, {
3174
+ ref: ref,
3175
+ "data-slot": "button",
3176
+ "data-variant": variant,
3177
+ "data-size": size,
3178
+ className: cn(buttonVariants({
3179
+ variant,
3180
+ size,
3181
+ className
3182
+ })),
3183
+ ...props
3184
+ });
3185
+ });
3186
+ Button.displayName = "Button";
3187
+
3188
+ function Popover({
3189
+ ...props
3190
+ }) {
3191
+ return /*#__PURE__*/jsxRuntime.jsx(PopoverPrimitive__namespace.Root, {
3192
+ "data-slot": "popover",
3193
+ ...props
3194
+ });
3195
+ }
3196
+ function PopoverTrigger({
3197
+ ...props
3198
+ }) {
3199
+ return /*#__PURE__*/jsxRuntime.jsx(PopoverPrimitive__namespace.Trigger, {
3200
+ "data-slot": "popover-trigger",
3201
+ ...props
3202
+ });
3203
+ }
3204
+ function PopoverContent({
3205
+ className,
3206
+ align = "center",
3207
+ sideOffset = 4,
3208
+ ...props
3209
+ }) {
3210
+ return /*#__PURE__*/jsxRuntime.jsx(PopoverPrimitive__namespace.Portal, {
3211
+ children: /*#__PURE__*/jsxRuntime.jsx(PopoverPrimitive__namespace.Content, {
3212
+ "data-slot": "popover-content",
3213
+ align: align,
3214
+ sideOffset: sideOffset,
3215
+ className: cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden", className),
3216
+ ...props
3217
+ })
3218
+ });
3219
+ }
3220
+
3221
+ const ColorSetter = props => {
3222
+ const {
3223
+ value,
3224
+ initialValue,
3225
+ onChange,
3226
+ disableAlpha = false
3227
+ } = props;
3228
+ return /*#__PURE__*/jsxRuntime.jsxs(Popover, {
3229
+ children: [/*#__PURE__*/jsxRuntime.jsx(PopoverTrigger, {
3230
+ asChild: true,
3231
+ children: /*#__PURE__*/jsxRuntime.jsxs(Button, {
3232
+ "aria-label": "Select color",
3233
+ className: 'h-8 w-full justify-start gap-2 bg-transparent px-2 py-[5px] text-left font-normal text-xs',
3234
+ variant: 'outline',
3235
+ children: [/*#__PURE__*/jsxRuntime.jsx("div", {
3236
+ "aria-label": "Current color",
3237
+ className: "h-3.5 w-3.5 rounded-full border border-muted-foreground",
3238
+ style: {
3239
+ backgroundColor: value ?? initialValue
3240
+ }
3241
+ }), /*#__PURE__*/jsxRuntime.jsx("span", {
3242
+ className: "truncate font-mono",
3243
+ children: value ?? initialValue
3244
+ })]
3245
+ })
3246
+ }), /*#__PURE__*/jsxRuntime.jsx(PopoverContent, {
3247
+ align: "start",
3248
+ className: "w-auto p-0",
3249
+ children: /*#__PURE__*/jsxRuntime.jsx(Sketch, {
3250
+ color: value,
3251
+ disableAlpha: disableAlpha,
3252
+ onChange: res => onChange(res.hexa),
3253
+ presetColors: []
3254
+ })
3255
+ })]
3256
+ });
3257
+ };
3258
+
3259
+ const NodeIdSetter = props => {
3260
+ const {
3261
+ selected
3262
+ } = props;
3263
+ return /*#__PURE__*/jsxRuntime.jsxs("div", {
3264
+ className: "flex flex-col",
3265
+ children: [/*#__PURE__*/jsxRuntime.jsx("p", {
3266
+ className: "leading-7",
3267
+ children: selected.id
3268
+ }), /*#__PURE__*/jsxRuntime.jsx("p", {
3269
+ className: "text-muted-foreground text-xs",
3270
+ children: selected.componentMeta.title
3271
+ })]
3272
+ });
3273
+ };
3274
+
3275
+ function Input({
3276
+ className,
3277
+ type,
3278
+ ...props
3279
+ }) {
3280
+ return /*#__PURE__*/jsxRuntime.jsx("input", {
3281
+ type: type,
3282
+ "data-slot": "input",
3283
+ className: cn("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]", "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", className),
3284
+ ...props
3285
+ });
3286
+ }
3287
+
3288
+ const NumberSetter = props => {
3289
+ const {
3290
+ value,
3291
+ initialValue,
3292
+ placeholder,
3293
+ onChange,
3294
+ suffix
3295
+ } = props;
3296
+ return /*#__PURE__*/jsxRuntime.jsxs("div", {
3297
+ className: "relative w-full",
3298
+ children: [/*#__PURE__*/jsxRuntime.jsx(Input, {
3299
+ className: cn('!text-xs h-8 px-2 py-[5px] pr-8 [-moz-appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none', !!suffix && 'pr-8'),
3300
+ onChange: e => onChange(+e.target.value),
3301
+ placeholder: placeholder || '',
3302
+ type: "number",
3303
+ value: value ?? initialValue
3304
+ }), !!suffix && /*#__PURE__*/jsxRuntime.jsx("span", {
3305
+ "aria-label": `Unit: ${suffix}`,
3306
+ className: "-translate-y-1/2 pointer-events-none absolute top-1/2 right-3 text-muted-foreground",
3307
+ children: suffix
3308
+ })]
3309
+ });
3310
+ };
3311
+
3312
+ const RectSetter = props => {
3313
+ const {
3314
+ value,
3315
+ onChange
3316
+ } = props;
3317
+ const handleChange = (key, newValue) => {
3318
+ onChange({
3319
+ ...value,
3320
+ [key]: newValue
3321
+ });
3322
+ };
3323
+ return /*#__PURE__*/jsxRuntime.jsxs("div", {
3324
+ className: "flex w-full flex-wrap gap-2",
3325
+ children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
3326
+ className: "relative w-[calc(50%_-_4px)]",
3327
+ children: [/*#__PURE__*/jsxRuntime.jsx(Input, {
3328
+ className: "!text-xs h-8 px-2 py-[5px] pr-8 [-moz-appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",
3329
+ onChange: e => handleChange('x', Number(e.target.value)),
3330
+ type: "number",
3331
+ value: formatDecimal(value.x)
3332
+ }), /*#__PURE__*/jsxRuntime.jsx("span", {
3333
+ "aria-label": 'Unit: X',
3334
+ className: "-translate-y-1/2 pointer-events-none absolute top-1/2 right-3 text-muted-foreground",
3335
+ children: "X"
3336
+ })]
3337
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
3338
+ className: "relative w-[calc(50%_-_4px)]",
3339
+ children: [/*#__PURE__*/jsxRuntime.jsx(Input, {
3340
+ className: "!text-xs h-8 px-2 py-[5px] pr-8 [-moz-appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",
3341
+ onChange: e => handleChange('y', Number(e.target.value)),
3342
+ type: "number",
3343
+ value: formatDecimal(value.y)
3344
+ }), /*#__PURE__*/jsxRuntime.jsx("span", {
3345
+ "aria-label": 'Unit: Y',
3346
+ className: "-translate-y-1/2 pointer-events-none absolute top-1/2 right-3 text-muted-foreground",
3347
+ children: "Y"
3348
+ })]
3349
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
3350
+ className: "relative w-[calc(50%_-_4px)]",
3351
+ children: [/*#__PURE__*/jsxRuntime.jsx(Input, {
3352
+ className: "!text-xs h-8 px-2 py-[5px] pr-8 [-moz-appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",
3353
+ onChange: e => handleChange('width', Number(e.target.value)),
3354
+ type: "number",
3355
+ value: formatDecimal(value.width)
3356
+ }), /*#__PURE__*/jsxRuntime.jsx("span", {
3357
+ "aria-label": 'Unit: W',
3358
+ className: "-translate-y-1/2 pointer-events-none absolute top-1/2 right-3 text-muted-foreground",
3359
+ children: "W"
3360
+ })]
3361
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
3362
+ className: "relative w-[calc(50%_-_4px)]",
3363
+ children: [/*#__PURE__*/jsxRuntime.jsx(Input, {
3364
+ className: "!text-xs h-8 px-2 py-[5px] pr-8 [-moz-appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",
3365
+ onChange: e => handleChange('height', Number(e.target.value)),
3366
+ type: "number",
3367
+ value: formatDecimal(value.height)
3368
+ }), /*#__PURE__*/jsxRuntime.jsx("span", {
3369
+ "aria-label": 'Unit: H',
3370
+ className: "-translate-y-1/2 pointer-events-none absolute top-1/2 right-3 text-muted-foreground",
3371
+ children: "H"
3372
+ })]
3373
+ })]
3374
+ });
3375
+ };
3376
+ const decimalRegex = /(\.\d{2})\d+$/;
3377
+ const formatDecimal = num => num.toString().replace(decimalRegex, '$1');
3378
+
3379
+ const StringSetter = props => {
3380
+ const {
3381
+ value,
3382
+ initialValue,
3383
+ placeholder,
3384
+ onChange,
3385
+ suffix
3386
+ } = props;
3387
+ return /*#__PURE__*/jsxRuntime.jsxs("div", {
3388
+ className: "relative w-full",
3389
+ children: [/*#__PURE__*/jsxRuntime.jsx(Input, {
3390
+ className: cn('!text-xs h-8 px-2 py-[5px]', !!suffix && 'pr-8'),
3391
+ onChange: e => onChange(e.target.value),
3392
+ placeholder: placeholder || '',
3393
+ value: value || initialValue
3394
+ }), !!suffix && /*#__PURE__*/jsxRuntime.jsx("span", {
3395
+ "aria-label": `Unit: ${suffix}`,
3396
+ className: "-translate-y-1/2 pointer-events-none absolute top-1/2 right-3 text-muted-foreground",
3397
+ children: suffix
3398
+ })]
3399
+ });
3400
+ };
3401
+
3402
+ function Switch({
3403
+ className,
3404
+ ...props
3405
+ }) {
3406
+ return /*#__PURE__*/jsxRuntime.jsx(SwitchPrimitive__namespace.Root, {
3407
+ "data-slot": "switch",
3408
+ className: cn("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50", className),
3409
+ ...props,
3410
+ children: /*#__PURE__*/jsxRuntime.jsx(SwitchPrimitive__namespace.Thumb, {
3411
+ "data-slot": "switch-thumb",
3412
+ className: cn("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")
3413
+ })
3414
+ });
3415
+ }
3416
+
3417
+ const SwitchSetter = props => {
3418
+ const {
3419
+ value,
3420
+ initialValue,
3421
+ onChange
3422
+ } = props;
3423
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
3424
+ className: "py-0.5",
3425
+ children: /*#__PURE__*/jsxRuntime.jsx(Switch, {
3426
+ checked: value || initialValue,
3427
+ onCheckedChange: onChange
3428
+ })
3429
+ });
3430
+ };
3431
+
3432
+ const UploadSetter = props => {
3433
+ const {
3434
+ value,
3435
+ onChange,
3436
+ accept = '.jpg,.jpeg,.png,.gif',
3437
+ maxSize = 10 * 1024 * 1024
3438
+ } = props;
3439
+ const [error, setError] = React.useState('');
3440
+ const inputRef = React.useRef(null);
3441
+ const handleFileChange = async e => {
3442
+ const file = e.target.files?.[0];
3443
+ setError('');
3444
+ if (!file) {
3445
+ onChange(null);
3446
+ return;
3447
+ }
3448
+
3449
+ // 验证文件类型
3450
+ const ext = `.${file.name.split('.').pop()?.toLowerCase()}`;
3451
+ if (!accept.includes(ext)) {
3452
+ setError(`仅支持 ${accept} 格式文件`);
3453
+ onChange(null);
3454
+ return;
3455
+ }
3456
+
3457
+ // 验证文件大小
3458
+ if (file.size > maxSize) {
3459
+ setError(`文件大小不能超过 ${maxSize / 1024 / 1024}MB`);
3460
+ onChange(null);
3461
+ return;
3462
+ }
3463
+ try {
3464
+ const [base64, dimensions] = await Promise.all([
3465
+ // 读取Base64
3466
+ new Promise((resolve, reject) => {
3467
+ const reader = new FileReader();
3468
+ reader.onload = () => resolve(reader.result);
3469
+ reader.onerror = err => reject(err);
3470
+ reader.readAsDataURL(file);
3471
+ }),
3472
+ // 读取图片尺寸
3473
+ new Promise((resolve, reject) => {
3474
+ const img = new Image();
3475
+ img.onload = () => resolve({
3476
+ width: img.naturalWidth,
3477
+ height: img.naturalHeight
3478
+ });
3479
+ img.onerror = reject;
3480
+ img.src = URL.createObjectURL(file);
3481
+ })]);
3482
+ onChange({
3483
+ raw: {
3484
+ name: file.name,
3485
+ size: file.size,
3486
+ type: file.type,
3487
+ width: dimensions.width,
3488
+ height: dimensions.height
3489
+ },
3490
+ base64
3491
+ });
3492
+ } catch (_) {
3493
+ setError('文件读取失败,请重试');
3494
+ onChange(null);
3495
+ }
3496
+ };
3497
+ const handleClear = () => {
3498
+ onChange(null);
3499
+ if (inputRef.current) {
3500
+ inputRef.current.value = '';
3501
+ }
3502
+ };
3503
+ return /*#__PURE__*/jsxRuntime.jsxs("div", {
3504
+ className: "group relative w-full overflow-hidden",
3505
+ children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
3506
+ className: "flex gap-2",
3507
+ children: [/*#__PURE__*/jsxRuntime.jsxs("label", {
3508
+ className: "flex-1 cursor-pointer",
3509
+ children: [/*#__PURE__*/jsxRuntime.jsx("input", {
3510
+ accept: accept,
3511
+ className: cn('h-8 cursor-pointer px-2 py-[5px] text-xs', 'border-dashed transition-colors hover:border-primary', 'absolute h-0 w-0 opacity-0'),
3512
+ onChange: handleFileChange,
3513
+ ref: inputRef,
3514
+ type: "file"
3515
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
3516
+ className: "flex h-8 w-full items-center justify-center rounded-md border border-dashed text-muted-foreground text-xs transition-colors hover:border-primary",
3517
+ children: [/*#__PURE__*/jsxRuntime.jsx(lucideReact.Upload, {
3518
+ className: "mr-2 h-4 w-4"
3519
+ }), /*#__PURE__*/jsxRuntime.jsx("span", {
3520
+ children: value ? '更换文件' : '点击上传'
3521
+ })]
3522
+ })]
3523
+ }), !!value && /*#__PURE__*/jsxRuntime.jsx(Button, {
3524
+ "aria-label": "\u6E05\u9664\u6587\u4EF6",
3525
+ className: "h-8 px-2 text-muted-foreground hover:text-destructive",
3526
+ onClick: handleClear,
3527
+ size: "sm",
3528
+ type: "button",
3529
+ variant: "ghost",
3530
+ children: /*#__PURE__*/jsxRuntime.jsx(lucideReact.X, {
3531
+ className: "h-4 w-4"
3532
+ })
3533
+ })]
3534
+ }), !!value && /*#__PURE__*/jsxRuntime.jsxs("div", {
3535
+ className: "mt-2 flex w-full items-center gap-2 text-foreground/80 text-xs",
3536
+ children: [/*#__PURE__*/jsxRuntime.jsx("span", {
3537
+ className: "min-w-0 flex-1 truncate",
3538
+ children: value.raw?.name
3539
+ }), /*#__PURE__*/jsxRuntime.jsxs("span", {
3540
+ className: "shrink-0 whitespace-nowrap text-muted-foreground/50",
3541
+ children: [(value.raw?.size / 1024).toFixed(1), "KB"]
3542
+ })]
3543
+ }), !!error && /*#__PURE__*/jsxRuntime.jsx("p", {
3544
+ className: "mt-1 text-destructive text-xs",
3545
+ role: "alert",
3546
+ children: error
3547
+ })]
3548
+ });
3549
+ };
3550
+
3551
+ function Collapsible({
3552
+ ...props
3553
+ }) {
3554
+ return /*#__PURE__*/jsxRuntime.jsx(CollapsiblePrimitive__namespace.Root, {
3555
+ "data-slot": "collapsible",
3556
+ ...props
3557
+ });
3558
+ }
3559
+ function CollapsibleTrigger({
3560
+ ...props
3561
+ }) {
3562
+ return /*#__PURE__*/jsxRuntime.jsx(CollapsiblePrimitive__namespace.CollapsibleTrigger, {
3563
+ "data-slot": "collapsible-trigger",
3564
+ ...props
3565
+ });
3566
+ }
3567
+ function CollapsibleContent({
3568
+ ...props
3569
+ }) {
3570
+ return /*#__PURE__*/jsxRuntime.jsx(CollapsiblePrimitive__namespace.CollapsibleContent, {
3571
+ "data-slot": "collapsible-content",
3572
+ ...props
3573
+ });
3574
+ }
3575
+
3576
+ const CollapseSetter = props => {
3577
+ const {
3578
+ field,
3579
+ children,
3580
+ initialValue,
3581
+ icon = true
3582
+ } = props;
3583
+ const [isOpen, setIsOpen] = React.useState(initialValue ?? true);
3584
+ return /*#__PURE__*/jsxRuntime.jsxs(Collapsible, {
3585
+ className: "-translate-x-4 w-[calc(100%_+_32px)] space-y-2",
3586
+ onOpenChange: setIsOpen,
3587
+ open: isOpen,
3588
+ children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
3589
+ className: "flex h-8 items-center justify-between space-x-4 bg-muted px-4",
3590
+ children: [/*#__PURE__*/jsxRuntime.jsx("h4", {
3591
+ children: field.title
3592
+ }), !!icon && /*#__PURE__*/jsxRuntime.jsx(CollapsibleTrigger, {
3593
+ asChild: true,
3594
+ children: /*#__PURE__*/jsxRuntime.jsxs(Button, {
3595
+ size: "sm",
3596
+ variant: "ghost",
3597
+ children: [/*#__PURE__*/jsxRuntime.jsx(lucideReact.ChevronsUpDown, {
3598
+ className: "h-4 w-4"
3599
+ }), /*#__PURE__*/jsxRuntime.jsx("span", {
3600
+ className: "sr-only",
3601
+ children: "Toggle"
3602
+ })]
3603
+ })
3604
+ })]
3605
+ }), /*#__PURE__*/jsxRuntime.jsx(CollapsibleContent, {
3606
+ className: "space-y-3 px-4 py-2",
3607
+ children: children
3608
+ })]
3609
+ });
3610
+ };
3611
+
3612
+ function Tabs({
3613
+ className,
3614
+ ...props
3615
+ }) {
3616
+ return /*#__PURE__*/jsxRuntime.jsx(TabsPrimitive__namespace.Root, {
3617
+ "data-slot": "tabs",
3618
+ className: cn("flex flex-col gap-2", className),
3619
+ ...props
3620
+ });
3621
+ }
3622
+ function TabsList({
3623
+ className,
3624
+ ...props
3625
+ }) {
3626
+ return /*#__PURE__*/jsxRuntime.jsx(TabsPrimitive__namespace.List, {
3627
+ "data-slot": "tabs-list",
3628
+ className: cn("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]", className),
3629
+ ...props
3630
+ });
3631
+ }
3632
+ function TabsTrigger({
3633
+ className,
3634
+ ...props
3635
+ }) {
3636
+ return /*#__PURE__*/jsxRuntime.jsx(TabsPrimitive__namespace.Trigger, {
3637
+ "data-slot": "tabs-trigger",
3638
+ className: cn("data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
3639
+ ...props
3640
+ });
3641
+ }
3642
+ function TabsContent({
3643
+ className,
3644
+ ...props
3645
+ }) {
3646
+ return /*#__PURE__*/jsxRuntime.jsx(TabsPrimitive__namespace.Content, {
3647
+ "data-slot": "tabs-content",
3648
+ className: cn("flex-1 outline-none", className),
3649
+ ...props
3650
+ });
3651
+ }
3652
+
3653
+ const TabSetter = props => {
3654
+ const {
3655
+ tabs,
3656
+ initialValue,
3657
+ children
3658
+ } = props;
3659
+ const tabsList = React.useMemo(() => {
3660
+ if (tabs) return tabs;
3661
+ if (Array.isArray(children) && children.length > 0) {
3662
+ return children.map(child => ({
3663
+ label: child.props.field.config.title,
3664
+ value: child.props.field.config.key
3665
+ }));
3666
+ }
3667
+ throw new Error('TabSetter: children or tabs must be an array');
3668
+ }, [tabs, children]);
3669
+ const firstTabValue = React.useMemo(() => tabsList[0]?.value, [tabsList]);
3670
+ return /*#__PURE__*/jsxRuntime.jsxs(Tabs, {
3671
+ className: "w-full",
3672
+ defaultValue: initialValue ?? firstTabValue,
3673
+ children: [/*#__PURE__*/jsxRuntime.jsx(TabsList, {
3674
+ className: "grid w-full",
3675
+ style: {
3676
+ gridTemplateColumns: `repeat(${tabsList.length}, minmax(0, 1fr))`
3677
+ },
3678
+ children: tabsList.map(tab => /*#__PURE__*/jsxRuntime.jsx(TabsTrigger, {
3679
+ value: tab.value,
3680
+ children: tab.label
3681
+ }, tab.value))
3682
+ }), Array.isArray(children) && children.map(child => /*#__PURE__*/jsxRuntime.jsx(TabsContent, {
3683
+ className: "mt-0 box-border space-y-3 p-2",
3684
+ value: child.props.field.config.key,
3685
+ children: child
3686
+ }, child.props.field.config.key))]
3687
+ });
3688
+ };
3689
+
3690
+ const SetterGroup = {
3691
+ BASIC: 'basic',
3692
+ ADVANCED: 'advanced',
3693
+ LAYOUT: 'layout',
3694
+ GROUP: 'group'
3695
+ };
3696
+
3697
+ function Label({
3698
+ className,
3699
+ ...props
3700
+ }) {
3701
+ return /*#__PURE__*/jsxRuntime.jsx(LabelPrimitive__namespace.Root, {
3702
+ "data-slot": "label",
3703
+ className: cn("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50", className),
3704
+ ...props
3705
+ });
3706
+ }
3707
+
3708
+ const customFieldItem = (field, setter) => {
3709
+ const {
3710
+ label = true,
3711
+ wrap = false
3712
+ } = field.config.extraProps || {};
3713
+ if (typeof label === 'boolean' && !label) {
3714
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
3715
+ className: "flex w-full items-center",
3716
+ children: setter
3717
+ });
3718
+ }
3719
+ return /*#__PURE__*/jsxRuntime.jsxs("div", {
3720
+ className: cn('flex w-full text-xs', wrap ? 'flex-col' : 'items-center'),
3721
+ children: [/*#__PURE__*/jsxRuntime.jsx(Label, {
3722
+ className: cn('shrink-0 grow-0 text-xs', wrap ? 'basis-[26px]' : 'basis-[100px]'),
3723
+ htmlFor: field.id,
3724
+ children: field.title
3725
+ }), /*#__PURE__*/jsxRuntime.jsx("div", {
3726
+ className: "flex flex-1 items-center justify-between",
3727
+ children: /*#__PURE__*/jsxRuntime.jsx("div", {
3728
+ className: "flex-1",
3729
+ children: setter
3730
+ })
3731
+ })]
3732
+ });
3733
+ };
3734
+
3735
+ const setterMap = {
3736
+ ColorSetter,
3737
+ NodeIdSetter,
3738
+ NumberSetter,
3739
+ RectSetter,
3740
+ StringSetter,
3741
+ SwitchSetter,
3742
+ UploadSetter,
3743
+ CollapseSetter,
3744
+ TabSetter
3745
+ };
3746
+
3747
+ exports.CollapseSetter = CollapseSetter;
3748
+ exports.ColorSetter = ColorSetter;
3749
+ exports.NodeIdSetter = NodeIdSetter;
3750
+ exports.NumberSetter = NumberSetter;
3751
+ exports.RectSetter = RectSetter;
3752
+ exports.SetterGroup = SetterGroup;
3753
+ exports.StringSetter = StringSetter;
3754
+ exports.SwitchSetter = SwitchSetter;
3755
+ exports.TabSetter = TabSetter;
3756
+ exports.UploadSetter = UploadSetter;
3757
+ exports.customFieldItem = customFieldItem;
3758
+ exports.default = setterMap;
3759
+ exports.setterMap = setterMap;
3760
+
3761
+ Object.defineProperty(exports, '__esModule', { value: true });
3762
+
3763
+ }));
3764
+ //# sourceMappingURL=index.js.map