@rootui/button 0.0.2 → 0.0.4

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 CHANGED
@@ -1,2332 +1 @@
1
- // src/base-ui/Button.tsx
2
- import { LoaderCircle } from "lucide-react";
3
-
4
- // node_modules/tailwind-variants/dist/chunk-LQJYWU4O.js
5
- var SPACE_REGEX = /\s+/g;
6
- var removeExtraSpaces = (str) => {
7
- if (typeof str !== "string" || !str)
8
- return str;
9
- return str.replace(SPACE_REGEX, " ").trim();
10
- };
11
- var cx = (...classnames) => {
12
- const classList = [];
13
- const buildClassString = (input) => {
14
- if (!input && input !== 0 && input !== 0n)
15
- return;
16
- if (Array.isArray(input)) {
17
- for (let i = 0, len = input.length;i < len; i++)
18
- buildClassString(input[i]);
19
- return;
20
- }
21
- const type = typeof input;
22
- if (type === "string" || type === "number" || type === "bigint") {
23
- if (type === "number" && input !== input)
24
- return;
25
- classList.push(String(input));
26
- } else if (type === "object") {
27
- const keys = Object.keys(input);
28
- for (let i = 0, len = keys.length;i < len; i++) {
29
- const key = keys[i];
30
- if (input[key])
31
- classList.push(key);
32
- }
33
- }
34
- };
35
- for (let i = 0, len = classnames.length;i < len; i++) {
36
- const c = classnames[i];
37
- if (c !== null && c !== undefined)
38
- buildClassString(c);
39
- }
40
- return classList.length > 0 ? removeExtraSpaces(classList.join(" ")) : undefined;
41
- };
42
- var falsyToString = (value) => value === false ? "false" : value === true ? "true" : value === 0 ? "0" : value;
43
- var isEmptyObject = (obj) => {
44
- if (!obj || typeof obj !== "object")
45
- return true;
46
- for (const _ in obj)
47
- return false;
48
- return true;
49
- };
50
- var isEqual = (obj1, obj2) => {
51
- if (obj1 === obj2)
52
- return true;
53
- if (!obj1 || !obj2)
54
- return false;
55
- const keys1 = Object.keys(obj1);
56
- const keys2 = Object.keys(obj2);
57
- if (keys1.length !== keys2.length)
58
- return false;
59
- for (let i = 0;i < keys1.length; i++) {
60
- const key = keys1[i];
61
- if (!keys2.includes(key))
62
- return false;
63
- if (obj1[key] !== obj2[key])
64
- return false;
65
- }
66
- return true;
67
- };
68
- var joinObjects = (obj1, obj2) => {
69
- for (const key in obj2) {
70
- if (Object.prototype.hasOwnProperty.call(obj2, key)) {
71
- const val2 = obj2[key];
72
- if (key in obj1) {
73
- obj1[key] = cx(obj1[key], val2);
74
- } else {
75
- obj1[key] = val2;
76
- }
77
- }
78
- }
79
- return obj1;
80
- };
81
- var flat = (arr, target) => {
82
- for (let i = 0;i < arr.length; i++) {
83
- const el = arr[i];
84
- if (Array.isArray(el))
85
- flat(el, target);
86
- else if (el)
87
- target.push(el);
88
- }
89
- };
90
- var flatMergeArrays = (...arrays) => {
91
- const result = [];
92
- flat(arrays, result);
93
- const filtered = [];
94
- for (let i = 0;i < result.length; i++) {
95
- if (result[i])
96
- filtered.push(result[i]);
97
- }
98
- return filtered;
99
- };
100
- var mergeObjects = (obj1, obj2) => {
101
- const result = {};
102
- for (const key in obj1) {
103
- const val1 = obj1[key];
104
- if (key in obj2) {
105
- const val2 = obj2[key];
106
- if (Array.isArray(val1) || Array.isArray(val2)) {
107
- result[key] = flatMergeArrays(val2, val1);
108
- } else if (typeof val1 === "object" && typeof val2 === "object" && val1 && val2) {
109
- result[key] = mergeObjects(val1, val2);
110
- } else {
111
- result[key] = val2 + " " + val1;
112
- }
113
- } else {
114
- result[key] = val1;
115
- }
116
- }
117
- for (const key in obj2) {
118
- if (!(key in obj1)) {
119
- result[key] = obj2[key];
120
- }
121
- }
122
- return result;
123
- };
124
-
125
- // node_modules/tailwind-variants/dist/chunk-RZF76H2U.js
126
- var defaultConfig = {
127
- twMerge: true,
128
- twMergeConfig: {}
129
- };
130
- function createState() {
131
- let cachedTwMerge = null;
132
- let cachedTwMergeConfig = {};
133
- let didTwMergeConfigChange = false;
134
- return {
135
- get cachedTwMerge() {
136
- return cachedTwMerge;
137
- },
138
- set cachedTwMerge(value) {
139
- cachedTwMerge = value;
140
- },
141
- get cachedTwMergeConfig() {
142
- return cachedTwMergeConfig;
143
- },
144
- set cachedTwMergeConfig(value) {
145
- cachedTwMergeConfig = value;
146
- },
147
- get didTwMergeConfigChange() {
148
- return didTwMergeConfigChange;
149
- },
150
- set didTwMergeConfigChange(value) {
151
- didTwMergeConfigChange = value;
152
- },
153
- reset() {
154
- cachedTwMerge = null;
155
- cachedTwMergeConfig = {};
156
- didTwMergeConfigChange = false;
157
- }
158
- };
159
- }
160
- var state = createState();
161
- var getTailwindVariants = (cn) => {
162
- const tv = (options, configProp) => {
163
- const {
164
- extend = null,
165
- slots: slotProps = {},
166
- variants: variantsProps = {},
167
- compoundVariants: compoundVariantsProps = [],
168
- compoundSlots = [],
169
- defaultVariants: defaultVariantsProps = {}
170
- } = options;
171
- const config = { ...defaultConfig, ...configProp };
172
- const base = extend?.base ? cx(extend.base, options?.base) : options?.base;
173
- const variants = extend?.variants && !isEmptyObject(extend.variants) ? mergeObjects(variantsProps, extend.variants) : variantsProps;
174
- const defaultVariants = extend?.defaultVariants && !isEmptyObject(extend.defaultVariants) ? { ...extend.defaultVariants, ...defaultVariantsProps } : defaultVariantsProps;
175
- if (!isEmptyObject(config.twMergeConfig) && !isEqual(config.twMergeConfig, state.cachedTwMergeConfig)) {
176
- state.didTwMergeConfigChange = true;
177
- state.cachedTwMergeConfig = config.twMergeConfig;
178
- }
179
- const isExtendedSlotsEmpty = isEmptyObject(extend?.slots);
180
- const componentSlots = !isEmptyObject(slotProps) ? {
181
- base: cx(options?.base, isExtendedSlotsEmpty && extend?.base),
182
- ...slotProps
183
- } : {};
184
- const slots = isExtendedSlotsEmpty ? componentSlots : joinObjects({ ...extend?.slots }, isEmptyObject(componentSlots) ? { base: options?.base } : componentSlots);
185
- const compoundVariants = isEmptyObject(extend?.compoundVariants) ? compoundVariantsProps : flatMergeArrays(extend?.compoundVariants, compoundVariantsProps);
186
- const component = (props) => {
187
- if (isEmptyObject(variants) && isEmptyObject(slotProps) && isExtendedSlotsEmpty) {
188
- return cn(base, props?.class, props?.className)(config);
189
- }
190
- if (compoundVariants && !Array.isArray(compoundVariants)) {
191
- throw new TypeError(`The "compoundVariants" prop must be an array. Received: ${typeof compoundVariants}`);
192
- }
193
- if (compoundSlots && !Array.isArray(compoundSlots)) {
194
- throw new TypeError(`The "compoundSlots" prop must be an array. Received: ${typeof compoundSlots}`);
195
- }
196
- const getVariantValue = (variant, vrs = variants, _slotKey = null, slotProps2 = null) => {
197
- const variantObj = vrs[variant];
198
- if (!variantObj || isEmptyObject(variantObj)) {
199
- return null;
200
- }
201
- const variantProp = slotProps2?.[variant] ?? props?.[variant];
202
- if (variantProp === null)
203
- return null;
204
- const variantKey = falsyToString(variantProp);
205
- if (typeof variantKey === "object") {
206
- return null;
207
- }
208
- const defaultVariantProp = defaultVariants?.[variant];
209
- const key = variantKey != null ? variantKey : falsyToString(defaultVariantProp);
210
- const value = variantObj[key || "false"];
211
- return value;
212
- };
213
- const getVariantClassNames = () => {
214
- if (!variants)
215
- return null;
216
- const keys = Object.keys(variants);
217
- const result = [];
218
- for (let i = 0;i < keys.length; i++) {
219
- const value = getVariantValue(keys[i], variants);
220
- if (value)
221
- result.push(value);
222
- }
223
- return result;
224
- };
225
- const getVariantClassNamesBySlotKey = (slotKey, slotProps2) => {
226
- if (!variants || typeof variants !== "object")
227
- return null;
228
- const result = [];
229
- for (const variant in variants) {
230
- const variantValue = getVariantValue(variant, variants, slotKey, slotProps2);
231
- const value = slotKey === "base" && typeof variantValue === "string" ? variantValue : variantValue && variantValue[slotKey];
232
- if (value)
233
- result.push(value);
234
- }
235
- return result;
236
- };
237
- const propsWithoutUndefined = {};
238
- for (const prop in props) {
239
- const value = props[prop];
240
- if (value !== undefined)
241
- propsWithoutUndefined[prop] = value;
242
- }
243
- const getCompleteProps = (key, slotProps2) => {
244
- const initialProp = typeof props?.[key] === "object" ? {
245
- [key]: props[key]?.initial
246
- } : {};
247
- return {
248
- ...defaultVariants,
249
- ...propsWithoutUndefined,
250
- ...initialProp,
251
- ...slotProps2
252
- };
253
- };
254
- const getCompoundVariantsValue = (cv = [], slotProps2) => {
255
- const result = [];
256
- const cvLength = cv.length;
257
- for (let i = 0;i < cvLength; i++) {
258
- const { class: tvClass, className: tvClassName, ...compoundVariantOptions } = cv[i];
259
- let isValid = true;
260
- const completeProps = getCompleteProps(null, slotProps2);
261
- for (const key in compoundVariantOptions) {
262
- const value = compoundVariantOptions[key];
263
- const completePropsValue = completeProps[key];
264
- if (Array.isArray(value)) {
265
- if (!value.includes(completePropsValue)) {
266
- isValid = false;
267
- break;
268
- }
269
- } else {
270
- if ((value == null || value === false) && (completePropsValue == null || completePropsValue === false))
271
- continue;
272
- if (completePropsValue !== value) {
273
- isValid = false;
274
- break;
275
- }
276
- }
277
- }
278
- if (isValid) {
279
- if (tvClass)
280
- result.push(tvClass);
281
- if (tvClassName)
282
- result.push(tvClassName);
283
- }
284
- }
285
- return result;
286
- };
287
- const getCompoundVariantClassNamesBySlot = (slotProps2) => {
288
- const compoundClassNames = getCompoundVariantsValue(compoundVariants, slotProps2);
289
- if (!Array.isArray(compoundClassNames))
290
- return compoundClassNames;
291
- const result = {};
292
- const cnFn = cn;
293
- for (let i = 0;i < compoundClassNames.length; i++) {
294
- const className = compoundClassNames[i];
295
- if (typeof className === "string") {
296
- result.base = cnFn(result.base, className)(config);
297
- } else if (typeof className === "object") {
298
- for (const slot in className) {
299
- result[slot] = cnFn(result[slot], className[slot])(config);
300
- }
301
- }
302
- }
303
- return result;
304
- };
305
- const getCompoundSlotClassNameBySlot = (slotProps2) => {
306
- if (compoundSlots.length < 1)
307
- return null;
308
- const result = {};
309
- const completeProps = getCompleteProps(null, slotProps2);
310
- for (let i = 0;i < compoundSlots.length; i++) {
311
- const {
312
- slots: slots2 = [],
313
- class: slotClass,
314
- className: slotClassName,
315
- ...slotVariants
316
- } = compoundSlots[i];
317
- if (!isEmptyObject(slotVariants)) {
318
- let isValid = true;
319
- for (const key in slotVariants) {
320
- const completePropsValue = completeProps[key];
321
- const slotVariantValue = slotVariants[key];
322
- if (completePropsValue === undefined || (Array.isArray(slotVariantValue) ? !slotVariantValue.includes(completePropsValue) : slotVariantValue !== completePropsValue)) {
323
- isValid = false;
324
- break;
325
- }
326
- }
327
- if (!isValid)
328
- continue;
329
- }
330
- for (let j = 0;j < slots2.length; j++) {
331
- const slotName = slots2[j];
332
- if (!result[slotName])
333
- result[slotName] = [];
334
- result[slotName].push([slotClass, slotClassName]);
335
- }
336
- }
337
- return result;
338
- };
339
- if (!isEmptyObject(slotProps) || !isExtendedSlotsEmpty) {
340
- const slotsFns = {};
341
- if (typeof slots === "object" && !isEmptyObject(slots)) {
342
- const cnFn = cn;
343
- for (const slotKey in slots) {
344
- slotsFns[slotKey] = (slotProps2) => {
345
- const compoundVariantClasses = getCompoundVariantClassNamesBySlot(slotProps2);
346
- const compoundSlotClasses = getCompoundSlotClassNameBySlot(slotProps2);
347
- return cnFn(slots[slotKey], getVariantClassNamesBySlotKey(slotKey, slotProps2), compoundVariantClasses ? compoundVariantClasses[slotKey] : undefined, compoundSlotClasses ? compoundSlotClasses[slotKey] : undefined, slotProps2?.class, slotProps2?.className)(config);
348
- };
349
- }
350
- }
351
- return slotsFns;
352
- }
353
- return cn(base, getVariantClassNames(), getCompoundVariantsValue(compoundVariants), props?.class, props?.className)(config);
354
- };
355
- const getVariantKeys = () => {
356
- if (!variants || typeof variants !== "object")
357
- return;
358
- return Object.keys(variants);
359
- };
360
- component.variantKeys = getVariantKeys();
361
- component.extend = extend;
362
- component.base = base;
363
- component.slots = slots;
364
- component.variants = variants;
365
- component.defaultVariants = defaultVariants;
366
- component.compoundSlots = compoundSlots;
367
- component.compoundVariants = compoundVariants;
368
- return component;
369
- };
370
- const createTV = (configProp) => {
371
- return (options, config) => tv(options, config ? mergeObjects(configProp, config) : configProp);
372
- };
373
- return {
374
- tv,
375
- createTV
376
- };
377
- };
378
- // node_modules/tailwind-merge/dist/bundle-mjs.mjs
379
- var concatArrays = (array1, array2) => {
380
- const combinedArray = new Array(array1.length + array2.length);
381
- for (let i = 0;i < array1.length; i++) {
382
- combinedArray[i] = array1[i];
383
- }
384
- for (let i = 0;i < array2.length; i++) {
385
- combinedArray[array1.length + i] = array2[i];
386
- }
387
- return combinedArray;
388
- };
389
- var createClassValidatorObject = (classGroupId, validator) => ({
390
- classGroupId,
391
- validator
392
- });
393
- var createClassPartObject = (nextPart = new Map, validators = null, classGroupId) => ({
394
- nextPart,
395
- validators,
396
- classGroupId
397
- });
398
- var CLASS_PART_SEPARATOR = "-";
399
- var EMPTY_CONFLICTS = [];
400
- var ARBITRARY_PROPERTY_PREFIX = "arbitrary..";
401
- var createClassGroupUtils = (config) => {
402
- const classMap = createClassMap(config);
403
- const {
404
- conflictingClassGroups,
405
- conflictingClassGroupModifiers
406
- } = config;
407
- const getClassGroupId = (className) => {
408
- if (className.startsWith("[") && className.endsWith("]")) {
409
- return getGroupIdForArbitraryProperty(className);
410
- }
411
- const classParts = className.split(CLASS_PART_SEPARATOR);
412
- const startIndex = classParts[0] === "" && classParts.length > 1 ? 1 : 0;
413
- return getGroupRecursive(classParts, startIndex, classMap);
414
- };
415
- const getConflictingClassGroupIds = (classGroupId, hasPostfixModifier) => {
416
- if (hasPostfixModifier) {
417
- const modifierConflicts = conflictingClassGroupModifiers[classGroupId];
418
- const baseConflicts = conflictingClassGroups[classGroupId];
419
- if (modifierConflicts) {
420
- if (baseConflicts) {
421
- return concatArrays(baseConflicts, modifierConflicts);
422
- }
423
- return modifierConflicts;
424
- }
425
- return baseConflicts || EMPTY_CONFLICTS;
426
- }
427
- return conflictingClassGroups[classGroupId] || EMPTY_CONFLICTS;
428
- };
429
- return {
430
- getClassGroupId,
431
- getConflictingClassGroupIds
432
- };
433
- };
434
- var getGroupRecursive = (classParts, startIndex, classPartObject) => {
435
- const classPathsLength = classParts.length - startIndex;
436
- if (classPathsLength === 0) {
437
- return classPartObject.classGroupId;
438
- }
439
- const currentClassPart = classParts[startIndex];
440
- const nextClassPartObject = classPartObject.nextPart.get(currentClassPart);
441
- if (nextClassPartObject) {
442
- const result = getGroupRecursive(classParts, startIndex + 1, nextClassPartObject);
443
- if (result)
444
- return result;
445
- }
446
- const validators = classPartObject.validators;
447
- if (validators === null) {
448
- return;
449
- }
450
- const classRest = startIndex === 0 ? classParts.join(CLASS_PART_SEPARATOR) : classParts.slice(startIndex).join(CLASS_PART_SEPARATOR);
451
- const validatorsLength = validators.length;
452
- for (let i = 0;i < validatorsLength; i++) {
453
- const validatorObj = validators[i];
454
- if (validatorObj.validator(classRest)) {
455
- return validatorObj.classGroupId;
456
- }
457
- }
458
- return;
459
- };
460
- var getGroupIdForArbitraryProperty = (className) => className.slice(1, -1).indexOf(":") === -1 ? undefined : (() => {
461
- const content = className.slice(1, -1);
462
- const colonIndex = content.indexOf(":");
463
- const property = content.slice(0, colonIndex);
464
- return property ? ARBITRARY_PROPERTY_PREFIX + property : undefined;
465
- })();
466
- var createClassMap = (config) => {
467
- const {
468
- theme,
469
- classGroups
470
- } = config;
471
- return processClassGroups(classGroups, theme);
472
- };
473
- var processClassGroups = (classGroups, theme) => {
474
- const classMap = createClassPartObject();
475
- for (const classGroupId in classGroups) {
476
- const group = classGroups[classGroupId];
477
- processClassesRecursively(group, classMap, classGroupId, theme);
478
- }
479
- return classMap;
480
- };
481
- var processClassesRecursively = (classGroup, classPartObject, classGroupId, theme) => {
482
- const len = classGroup.length;
483
- for (let i = 0;i < len; i++) {
484
- const classDefinition = classGroup[i];
485
- processClassDefinition(classDefinition, classPartObject, classGroupId, theme);
486
- }
487
- };
488
- var processClassDefinition = (classDefinition, classPartObject, classGroupId, theme) => {
489
- if (typeof classDefinition === "string") {
490
- processStringDefinition(classDefinition, classPartObject, classGroupId);
491
- return;
492
- }
493
- if (typeof classDefinition === "function") {
494
- processFunctionDefinition(classDefinition, classPartObject, classGroupId, theme);
495
- return;
496
- }
497
- processObjectDefinition(classDefinition, classPartObject, classGroupId, theme);
498
- };
499
- var processStringDefinition = (classDefinition, classPartObject, classGroupId) => {
500
- const classPartObjectToEdit = classDefinition === "" ? classPartObject : getPart(classPartObject, classDefinition);
501
- classPartObjectToEdit.classGroupId = classGroupId;
502
- };
503
- var processFunctionDefinition = (classDefinition, classPartObject, classGroupId, theme) => {
504
- if (isThemeGetter(classDefinition)) {
505
- processClassesRecursively(classDefinition(theme), classPartObject, classGroupId, theme);
506
- return;
507
- }
508
- if (classPartObject.validators === null) {
509
- classPartObject.validators = [];
510
- }
511
- classPartObject.validators.push(createClassValidatorObject(classGroupId, classDefinition));
512
- };
513
- var processObjectDefinition = (classDefinition, classPartObject, classGroupId, theme) => {
514
- const entries = Object.entries(classDefinition);
515
- const len = entries.length;
516
- for (let i = 0;i < len; i++) {
517
- const [key, value] = entries[i];
518
- processClassesRecursively(value, getPart(classPartObject, key), classGroupId, theme);
519
- }
520
- };
521
- var getPart = (classPartObject, path) => {
522
- let current = classPartObject;
523
- const parts = path.split(CLASS_PART_SEPARATOR);
524
- const len = parts.length;
525
- for (let i = 0;i < len; i++) {
526
- const part = parts[i];
527
- let next = current.nextPart.get(part);
528
- if (!next) {
529
- next = createClassPartObject();
530
- current.nextPart.set(part, next);
531
- }
532
- current = next;
533
- }
534
- return current;
535
- };
536
- var isThemeGetter = (func) => ("isThemeGetter" in func) && func.isThemeGetter === true;
537
- var createLruCache = (maxCacheSize) => {
538
- if (maxCacheSize < 1) {
539
- return {
540
- get: () => {
541
- return;
542
- },
543
- set: () => {}
544
- };
545
- }
546
- let cacheSize = 0;
547
- let cache = Object.create(null);
548
- let previousCache = Object.create(null);
549
- const update = (key, value) => {
550
- cache[key] = value;
551
- cacheSize++;
552
- if (cacheSize > maxCacheSize) {
553
- cacheSize = 0;
554
- previousCache = cache;
555
- cache = Object.create(null);
556
- }
557
- };
558
- return {
559
- get(key) {
560
- let value = cache[key];
561
- if (value !== undefined) {
562
- return value;
563
- }
564
- if ((value = previousCache[key]) !== undefined) {
565
- update(key, value);
566
- return value;
567
- }
568
- },
569
- set(key, value) {
570
- if (key in cache) {
571
- cache[key] = value;
572
- } else {
573
- update(key, value);
574
- }
575
- }
576
- };
577
- };
578
- var IMPORTANT_MODIFIER = "!";
579
- var MODIFIER_SEPARATOR = ":";
580
- var EMPTY_MODIFIERS = [];
581
- var createResultObject = (modifiers, hasImportantModifier, baseClassName, maybePostfixModifierPosition, isExternal) => ({
582
- modifiers,
583
- hasImportantModifier,
584
- baseClassName,
585
- maybePostfixModifierPosition,
586
- isExternal
587
- });
588
- var createParseClassName = (config) => {
589
- const {
590
- prefix,
591
- experimentalParseClassName
592
- } = config;
593
- let parseClassName = (className) => {
594
- const modifiers = [];
595
- let bracketDepth = 0;
596
- let parenDepth = 0;
597
- let modifierStart = 0;
598
- let postfixModifierPosition;
599
- const len = className.length;
600
- for (let index = 0;index < len; index++) {
601
- const currentCharacter = className[index];
602
- if (bracketDepth === 0 && parenDepth === 0) {
603
- if (currentCharacter === MODIFIER_SEPARATOR) {
604
- modifiers.push(className.slice(modifierStart, index));
605
- modifierStart = index + 1;
606
- continue;
607
- }
608
- if (currentCharacter === "/") {
609
- postfixModifierPosition = index;
610
- continue;
611
- }
612
- }
613
- if (currentCharacter === "[")
614
- bracketDepth++;
615
- else if (currentCharacter === "]")
616
- bracketDepth--;
617
- else if (currentCharacter === "(")
618
- parenDepth++;
619
- else if (currentCharacter === ")")
620
- parenDepth--;
621
- }
622
- const baseClassNameWithImportantModifier = modifiers.length === 0 ? className : className.slice(modifierStart);
623
- let baseClassName = baseClassNameWithImportantModifier;
624
- let hasImportantModifier = false;
625
- if (baseClassNameWithImportantModifier.endsWith(IMPORTANT_MODIFIER)) {
626
- baseClassName = baseClassNameWithImportantModifier.slice(0, -1);
627
- hasImportantModifier = true;
628
- } else if (baseClassNameWithImportantModifier.startsWith(IMPORTANT_MODIFIER)) {
629
- baseClassName = baseClassNameWithImportantModifier.slice(1);
630
- hasImportantModifier = true;
631
- }
632
- const maybePostfixModifierPosition = postfixModifierPosition && postfixModifierPosition > modifierStart ? postfixModifierPosition - modifierStart : undefined;
633
- return createResultObject(modifiers, hasImportantModifier, baseClassName, maybePostfixModifierPosition);
634
- };
635
- if (prefix) {
636
- const fullPrefix = prefix + MODIFIER_SEPARATOR;
637
- const parseClassNameOriginal = parseClassName;
638
- parseClassName = (className) => className.startsWith(fullPrefix) ? parseClassNameOriginal(className.slice(fullPrefix.length)) : createResultObject(EMPTY_MODIFIERS, false, className, undefined, true);
639
- }
640
- if (experimentalParseClassName) {
641
- const parseClassNameOriginal = parseClassName;
642
- parseClassName = (className) => experimentalParseClassName({
643
- className,
644
- parseClassName: parseClassNameOriginal
645
- });
646
- }
647
- return parseClassName;
648
- };
649
- var createSortModifiers = (config) => {
650
- const modifierWeights = new Map;
651
- config.orderSensitiveModifiers.forEach((mod, index) => {
652
- modifierWeights.set(mod, 1e6 + index);
653
- });
654
- return (modifiers) => {
655
- const result = [];
656
- let currentSegment = [];
657
- for (let i = 0;i < modifiers.length; i++) {
658
- const modifier = modifiers[i];
659
- const isArbitrary = modifier[0] === "[";
660
- const isOrderSensitive = modifierWeights.has(modifier);
661
- if (isArbitrary || isOrderSensitive) {
662
- if (currentSegment.length > 0) {
663
- currentSegment.sort();
664
- result.push(...currentSegment);
665
- currentSegment = [];
666
- }
667
- result.push(modifier);
668
- } else {
669
- currentSegment.push(modifier);
670
- }
671
- }
672
- if (currentSegment.length > 0) {
673
- currentSegment.sort();
674
- result.push(...currentSegment);
675
- }
676
- return result;
677
- };
678
- };
679
- var createConfigUtils = (config) => ({
680
- cache: createLruCache(config.cacheSize),
681
- parseClassName: createParseClassName(config),
682
- sortModifiers: createSortModifiers(config),
683
- ...createClassGroupUtils(config)
684
- });
685
- var SPLIT_CLASSES_REGEX = /\s+/;
686
- var mergeClassList = (classList, configUtils) => {
687
- const {
688
- parseClassName,
689
- getClassGroupId,
690
- getConflictingClassGroupIds,
691
- sortModifiers
692
- } = configUtils;
693
- const classGroupsInConflict = [];
694
- const classNames = classList.trim().split(SPLIT_CLASSES_REGEX);
695
- let result = "";
696
- for (let index = classNames.length - 1;index >= 0; index -= 1) {
697
- const originalClassName = classNames[index];
698
- const {
699
- isExternal,
700
- modifiers,
701
- hasImportantModifier,
702
- baseClassName,
703
- maybePostfixModifierPosition
704
- } = parseClassName(originalClassName);
705
- if (isExternal) {
706
- result = originalClassName + (result.length > 0 ? " " + result : result);
707
- continue;
708
- }
709
- let hasPostfixModifier = !!maybePostfixModifierPosition;
710
- let classGroupId = getClassGroupId(hasPostfixModifier ? baseClassName.substring(0, maybePostfixModifierPosition) : baseClassName);
711
- if (!classGroupId) {
712
- if (!hasPostfixModifier) {
713
- result = originalClassName + (result.length > 0 ? " " + result : result);
714
- continue;
715
- }
716
- classGroupId = getClassGroupId(baseClassName);
717
- if (!classGroupId) {
718
- result = originalClassName + (result.length > 0 ? " " + result : result);
719
- continue;
720
- }
721
- hasPostfixModifier = false;
722
- }
723
- const variantModifier = modifiers.length === 0 ? "" : modifiers.length === 1 ? modifiers[0] : sortModifiers(modifiers).join(":");
724
- const modifierId = hasImportantModifier ? variantModifier + IMPORTANT_MODIFIER : variantModifier;
725
- const classId = modifierId + classGroupId;
726
- if (classGroupsInConflict.indexOf(classId) > -1) {
727
- continue;
728
- }
729
- classGroupsInConflict.push(classId);
730
- const conflictGroups = getConflictingClassGroupIds(classGroupId, hasPostfixModifier);
731
- for (let i = 0;i < conflictGroups.length; ++i) {
732
- const group = conflictGroups[i];
733
- classGroupsInConflict.push(modifierId + group);
734
- }
735
- result = originalClassName + (result.length > 0 ? " " + result : result);
736
- }
737
- return result;
738
- };
739
- var twJoin = (...classLists) => {
740
- let index = 0;
741
- let argument;
742
- let resolvedValue;
743
- let string = "";
744
- while (index < classLists.length) {
745
- if (argument = classLists[index++]) {
746
- if (resolvedValue = toValue(argument)) {
747
- string && (string += " ");
748
- string += resolvedValue;
749
- }
750
- }
751
- }
752
- return string;
753
- };
754
- var toValue = (mix) => {
755
- if (typeof mix === "string") {
756
- return mix;
757
- }
758
- let resolvedValue;
759
- let string = "";
760
- for (let k = 0;k < mix.length; k++) {
761
- if (mix[k]) {
762
- if (resolvedValue = toValue(mix[k])) {
763
- string && (string += " ");
764
- string += resolvedValue;
765
- }
766
- }
767
- }
768
- return string;
769
- };
770
- var createTailwindMerge = (createConfigFirst, ...createConfigRest) => {
771
- let configUtils;
772
- let cacheGet;
773
- let cacheSet;
774
- let functionToCall;
775
- const initTailwindMerge = (classList) => {
776
- const config = createConfigRest.reduce((previousConfig, createConfigCurrent) => createConfigCurrent(previousConfig), createConfigFirst());
777
- configUtils = createConfigUtils(config);
778
- cacheGet = configUtils.cache.get;
779
- cacheSet = configUtils.cache.set;
780
- functionToCall = tailwindMerge;
781
- return tailwindMerge(classList);
782
- };
783
- const tailwindMerge = (classList) => {
784
- const cachedResult = cacheGet(classList);
785
- if (cachedResult) {
786
- return cachedResult;
787
- }
788
- const result = mergeClassList(classList, configUtils);
789
- cacheSet(classList, result);
790
- return result;
791
- };
792
- functionToCall = initTailwindMerge;
793
- return (...args) => functionToCall(twJoin(...args));
794
- };
795
- var fallbackThemeArr = [];
796
- var fromTheme = (key) => {
797
- const themeGetter = (theme) => theme[key] || fallbackThemeArr;
798
- themeGetter.isThemeGetter = true;
799
- return themeGetter;
800
- };
801
- var arbitraryValueRegex = /^\[(?:(\w[\w-]*):)?(.+)\]$/i;
802
- var arbitraryVariableRegex = /^\((?:(\w[\w-]*):)?(.+)\)$/i;
803
- var fractionRegex = /^\d+\/\d+$/;
804
- var tshirtUnitRegex = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/;
805
- var 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$/;
806
- var colorFunctionRegex = /^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/;
807
- var shadowRegex = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/;
808
- var imageRegex = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;
809
- var isFraction = (value) => fractionRegex.test(value);
810
- var isNumber = (value) => !!value && !Number.isNaN(Number(value));
811
- var isInteger = (value) => !!value && Number.isInteger(Number(value));
812
- var isPercent = (value) => value.endsWith("%") && isNumber(value.slice(0, -1));
813
- var isTshirtSize = (value) => tshirtUnitRegex.test(value);
814
- var isAny = () => true;
815
- var isLengthOnly = (value) => lengthUnitRegex.test(value) && !colorFunctionRegex.test(value);
816
- var isNever = () => false;
817
- var isShadow = (value) => shadowRegex.test(value);
818
- var isImage = (value) => imageRegex.test(value);
819
- var isAnyNonArbitrary = (value) => !isArbitraryValue(value) && !isArbitraryVariable(value);
820
- var isArbitrarySize = (value) => getIsArbitraryValue(value, isLabelSize, isNever);
821
- var isArbitraryValue = (value) => arbitraryValueRegex.test(value);
822
- var isArbitraryLength = (value) => getIsArbitraryValue(value, isLabelLength, isLengthOnly);
823
- var isArbitraryNumber = (value) => getIsArbitraryValue(value, isLabelNumber, isNumber);
824
- var isArbitraryPosition = (value) => getIsArbitraryValue(value, isLabelPosition, isNever);
825
- var isArbitraryImage = (value) => getIsArbitraryValue(value, isLabelImage, isImage);
826
- var isArbitraryShadow = (value) => getIsArbitraryValue(value, isLabelShadow, isShadow);
827
- var isArbitraryVariable = (value) => arbitraryVariableRegex.test(value);
828
- var isArbitraryVariableLength = (value) => getIsArbitraryVariable(value, isLabelLength);
829
- var isArbitraryVariableFamilyName = (value) => getIsArbitraryVariable(value, isLabelFamilyName);
830
- var isArbitraryVariablePosition = (value) => getIsArbitraryVariable(value, isLabelPosition);
831
- var isArbitraryVariableSize = (value) => getIsArbitraryVariable(value, isLabelSize);
832
- var isArbitraryVariableImage = (value) => getIsArbitraryVariable(value, isLabelImage);
833
- var isArbitraryVariableShadow = (value) => getIsArbitraryVariable(value, isLabelShadow, true);
834
- var getIsArbitraryValue = (value, testLabel, testValue) => {
835
- const result = arbitraryValueRegex.exec(value);
836
- if (result) {
837
- if (result[1]) {
838
- return testLabel(result[1]);
839
- }
840
- return testValue(result[2]);
841
- }
842
- return false;
843
- };
844
- var getIsArbitraryVariable = (value, testLabel, shouldMatchNoLabel = false) => {
845
- const result = arbitraryVariableRegex.exec(value);
846
- if (result) {
847
- if (result[1]) {
848
- return testLabel(result[1]);
849
- }
850
- return shouldMatchNoLabel;
851
- }
852
- return false;
853
- };
854
- var isLabelPosition = (label) => label === "position" || label === "percentage";
855
- var isLabelImage = (label) => label === "image" || label === "url";
856
- var isLabelSize = (label) => label === "length" || label === "size" || label === "bg-size";
857
- var isLabelLength = (label) => label === "length";
858
- var isLabelNumber = (label) => label === "number";
859
- var isLabelFamilyName = (label) => label === "family-name";
860
- var isLabelShadow = (label) => label === "shadow";
861
- var getDefaultConfig = () => {
862
- const themeColor = fromTheme("color");
863
- const themeFont = fromTheme("font");
864
- const themeText = fromTheme("text");
865
- const themeFontWeight = fromTheme("font-weight");
866
- const themeTracking = fromTheme("tracking");
867
- const themeLeading = fromTheme("leading");
868
- const themeBreakpoint = fromTheme("breakpoint");
869
- const themeContainer = fromTheme("container");
870
- const themeSpacing = fromTheme("spacing");
871
- const themeRadius = fromTheme("radius");
872
- const themeShadow = fromTheme("shadow");
873
- const themeInsetShadow = fromTheme("inset-shadow");
874
- const themeTextShadow = fromTheme("text-shadow");
875
- const themeDropShadow = fromTheme("drop-shadow");
876
- const themeBlur = fromTheme("blur");
877
- const themePerspective = fromTheme("perspective");
878
- const themeAspect = fromTheme("aspect");
879
- const themeEase = fromTheme("ease");
880
- const themeAnimate = fromTheme("animate");
881
- const scaleBreak = () => ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"];
882
- const scalePosition = () => [
883
- "center",
884
- "top",
885
- "bottom",
886
- "left",
887
- "right",
888
- "top-left",
889
- "left-top",
890
- "top-right",
891
- "right-top",
892
- "bottom-right",
893
- "right-bottom",
894
- "bottom-left",
895
- "left-bottom"
896
- ];
897
- const scalePositionWithArbitrary = () => [...scalePosition(), isArbitraryVariable, isArbitraryValue];
898
- const scaleOverflow = () => ["auto", "hidden", "clip", "visible", "scroll"];
899
- const scaleOverscroll = () => ["auto", "contain", "none"];
900
- const scaleUnambiguousSpacing = () => [isArbitraryVariable, isArbitraryValue, themeSpacing];
901
- const scaleInset = () => [isFraction, "full", "auto", ...scaleUnambiguousSpacing()];
902
- const scaleGridTemplateColsRows = () => [isInteger, "none", "subgrid", isArbitraryVariable, isArbitraryValue];
903
- const scaleGridColRowStartAndEnd = () => ["auto", {
904
- span: ["full", isInteger, isArbitraryVariable, isArbitraryValue]
905
- }, isInteger, isArbitraryVariable, isArbitraryValue];
906
- const scaleGridColRowStartOrEnd = () => [isInteger, "auto", isArbitraryVariable, isArbitraryValue];
907
- const scaleGridAutoColsRows = () => ["auto", "min", "max", "fr", isArbitraryVariable, isArbitraryValue];
908
- const scaleAlignPrimaryAxis = () => ["start", "end", "center", "between", "around", "evenly", "stretch", "baseline", "center-safe", "end-safe"];
909
- const scaleAlignSecondaryAxis = () => ["start", "end", "center", "stretch", "center-safe", "end-safe"];
910
- const scaleMargin = () => ["auto", ...scaleUnambiguousSpacing()];
911
- const scaleSizing = () => [isFraction, "auto", "full", "dvw", "dvh", "lvw", "lvh", "svw", "svh", "min", "max", "fit", ...scaleUnambiguousSpacing()];
912
- const scaleColor = () => [themeColor, isArbitraryVariable, isArbitraryValue];
913
- const scaleBgPosition = () => [...scalePosition(), isArbitraryVariablePosition, isArbitraryPosition, {
914
- position: [isArbitraryVariable, isArbitraryValue]
915
- }];
916
- const scaleBgRepeat = () => ["no-repeat", {
917
- repeat: ["", "x", "y", "space", "round"]
918
- }];
919
- const scaleBgSize = () => ["auto", "cover", "contain", isArbitraryVariableSize, isArbitrarySize, {
920
- size: [isArbitraryVariable, isArbitraryValue]
921
- }];
922
- const scaleGradientStopPosition = () => [isPercent, isArbitraryVariableLength, isArbitraryLength];
923
- const scaleRadius = () => [
924
- "",
925
- "none",
926
- "full",
927
- themeRadius,
928
- isArbitraryVariable,
929
- isArbitraryValue
930
- ];
931
- const scaleBorderWidth = () => ["", isNumber, isArbitraryVariableLength, isArbitraryLength];
932
- const scaleLineStyle = () => ["solid", "dashed", "dotted", "double"];
933
- const scaleBlendMode = () => ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"];
934
- const scaleMaskImagePosition = () => [isNumber, isPercent, isArbitraryVariablePosition, isArbitraryPosition];
935
- const scaleBlur = () => [
936
- "",
937
- "none",
938
- themeBlur,
939
- isArbitraryVariable,
940
- isArbitraryValue
941
- ];
942
- const scaleRotate = () => ["none", isNumber, isArbitraryVariable, isArbitraryValue];
943
- const scaleScale = () => ["none", isNumber, isArbitraryVariable, isArbitraryValue];
944
- const scaleSkew = () => [isNumber, isArbitraryVariable, isArbitraryValue];
945
- const scaleTranslate = () => [isFraction, "full", ...scaleUnambiguousSpacing()];
946
- return {
947
- cacheSize: 500,
948
- theme: {
949
- animate: ["spin", "ping", "pulse", "bounce"],
950
- aspect: ["video"],
951
- blur: [isTshirtSize],
952
- breakpoint: [isTshirtSize],
953
- color: [isAny],
954
- container: [isTshirtSize],
955
- "drop-shadow": [isTshirtSize],
956
- ease: ["in", "out", "in-out"],
957
- font: [isAnyNonArbitrary],
958
- "font-weight": ["thin", "extralight", "light", "normal", "medium", "semibold", "bold", "extrabold", "black"],
959
- "inset-shadow": [isTshirtSize],
960
- leading: ["none", "tight", "snug", "normal", "relaxed", "loose"],
961
- perspective: ["dramatic", "near", "normal", "midrange", "distant", "none"],
962
- radius: [isTshirtSize],
963
- shadow: [isTshirtSize],
964
- spacing: ["px", isNumber],
965
- text: [isTshirtSize],
966
- "text-shadow": [isTshirtSize],
967
- tracking: ["tighter", "tight", "normal", "wide", "wider", "widest"]
968
- },
969
- classGroups: {
970
- aspect: [{
971
- aspect: ["auto", "square", isFraction, isArbitraryValue, isArbitraryVariable, themeAspect]
972
- }],
973
- container: ["container"],
974
- columns: [{
975
- columns: [isNumber, isArbitraryValue, isArbitraryVariable, themeContainer]
976
- }],
977
- "break-after": [{
978
- "break-after": scaleBreak()
979
- }],
980
- "break-before": [{
981
- "break-before": scaleBreak()
982
- }],
983
- "break-inside": [{
984
- "break-inside": ["auto", "avoid", "avoid-page", "avoid-column"]
985
- }],
986
- "box-decoration": [{
987
- "box-decoration": ["slice", "clone"]
988
- }],
989
- box: [{
990
- box: ["border", "content"]
991
- }],
992
- 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"],
993
- sr: ["sr-only", "not-sr-only"],
994
- float: [{
995
- float: ["right", "left", "none", "start", "end"]
996
- }],
997
- clear: [{
998
- clear: ["left", "right", "both", "none", "start", "end"]
999
- }],
1000
- isolation: ["isolate", "isolation-auto"],
1001
- "object-fit": [{
1002
- object: ["contain", "cover", "fill", "none", "scale-down"]
1003
- }],
1004
- "object-position": [{
1005
- object: scalePositionWithArbitrary()
1006
- }],
1007
- overflow: [{
1008
- overflow: scaleOverflow()
1009
- }],
1010
- "overflow-x": [{
1011
- "overflow-x": scaleOverflow()
1012
- }],
1013
- "overflow-y": [{
1014
- "overflow-y": scaleOverflow()
1015
- }],
1016
- overscroll: [{
1017
- overscroll: scaleOverscroll()
1018
- }],
1019
- "overscroll-x": [{
1020
- "overscroll-x": scaleOverscroll()
1021
- }],
1022
- "overscroll-y": [{
1023
- "overscroll-y": scaleOverscroll()
1024
- }],
1025
- position: ["static", "fixed", "absolute", "relative", "sticky"],
1026
- inset: [{
1027
- inset: scaleInset()
1028
- }],
1029
- "inset-x": [{
1030
- "inset-x": scaleInset()
1031
- }],
1032
- "inset-y": [{
1033
- "inset-y": scaleInset()
1034
- }],
1035
- start: [{
1036
- start: scaleInset()
1037
- }],
1038
- end: [{
1039
- end: scaleInset()
1040
- }],
1041
- top: [{
1042
- top: scaleInset()
1043
- }],
1044
- right: [{
1045
- right: scaleInset()
1046
- }],
1047
- bottom: [{
1048
- bottom: scaleInset()
1049
- }],
1050
- left: [{
1051
- left: scaleInset()
1052
- }],
1053
- visibility: ["visible", "invisible", "collapse"],
1054
- z: [{
1055
- z: [isInteger, "auto", isArbitraryVariable, isArbitraryValue]
1056
- }],
1057
- basis: [{
1058
- basis: [isFraction, "full", "auto", themeContainer, ...scaleUnambiguousSpacing()]
1059
- }],
1060
- "flex-direction": [{
1061
- flex: ["row", "row-reverse", "col", "col-reverse"]
1062
- }],
1063
- "flex-wrap": [{
1064
- flex: ["nowrap", "wrap", "wrap-reverse"]
1065
- }],
1066
- flex: [{
1067
- flex: [isNumber, isFraction, "auto", "initial", "none", isArbitraryValue]
1068
- }],
1069
- grow: [{
1070
- grow: ["", isNumber, isArbitraryVariable, isArbitraryValue]
1071
- }],
1072
- shrink: [{
1073
- shrink: ["", isNumber, isArbitraryVariable, isArbitraryValue]
1074
- }],
1075
- order: [{
1076
- order: [isInteger, "first", "last", "none", isArbitraryVariable, isArbitraryValue]
1077
- }],
1078
- "grid-cols": [{
1079
- "grid-cols": scaleGridTemplateColsRows()
1080
- }],
1081
- "col-start-end": [{
1082
- col: scaleGridColRowStartAndEnd()
1083
- }],
1084
- "col-start": [{
1085
- "col-start": scaleGridColRowStartOrEnd()
1086
- }],
1087
- "col-end": [{
1088
- "col-end": scaleGridColRowStartOrEnd()
1089
- }],
1090
- "grid-rows": [{
1091
- "grid-rows": scaleGridTemplateColsRows()
1092
- }],
1093
- "row-start-end": [{
1094
- row: scaleGridColRowStartAndEnd()
1095
- }],
1096
- "row-start": [{
1097
- "row-start": scaleGridColRowStartOrEnd()
1098
- }],
1099
- "row-end": [{
1100
- "row-end": scaleGridColRowStartOrEnd()
1101
- }],
1102
- "grid-flow": [{
1103
- "grid-flow": ["row", "col", "dense", "row-dense", "col-dense"]
1104
- }],
1105
- "auto-cols": [{
1106
- "auto-cols": scaleGridAutoColsRows()
1107
- }],
1108
- "auto-rows": [{
1109
- "auto-rows": scaleGridAutoColsRows()
1110
- }],
1111
- gap: [{
1112
- gap: scaleUnambiguousSpacing()
1113
- }],
1114
- "gap-x": [{
1115
- "gap-x": scaleUnambiguousSpacing()
1116
- }],
1117
- "gap-y": [{
1118
- "gap-y": scaleUnambiguousSpacing()
1119
- }],
1120
- "justify-content": [{
1121
- justify: [...scaleAlignPrimaryAxis(), "normal"]
1122
- }],
1123
- "justify-items": [{
1124
- "justify-items": [...scaleAlignSecondaryAxis(), "normal"]
1125
- }],
1126
- "justify-self": [{
1127
- "justify-self": ["auto", ...scaleAlignSecondaryAxis()]
1128
- }],
1129
- "align-content": [{
1130
- content: ["normal", ...scaleAlignPrimaryAxis()]
1131
- }],
1132
- "align-items": [{
1133
- items: [...scaleAlignSecondaryAxis(), {
1134
- baseline: ["", "last"]
1135
- }]
1136
- }],
1137
- "align-self": [{
1138
- self: ["auto", ...scaleAlignSecondaryAxis(), {
1139
- baseline: ["", "last"]
1140
- }]
1141
- }],
1142
- "place-content": [{
1143
- "place-content": scaleAlignPrimaryAxis()
1144
- }],
1145
- "place-items": [{
1146
- "place-items": [...scaleAlignSecondaryAxis(), "baseline"]
1147
- }],
1148
- "place-self": [{
1149
- "place-self": ["auto", ...scaleAlignSecondaryAxis()]
1150
- }],
1151
- p: [{
1152
- p: scaleUnambiguousSpacing()
1153
- }],
1154
- px: [{
1155
- px: scaleUnambiguousSpacing()
1156
- }],
1157
- py: [{
1158
- py: scaleUnambiguousSpacing()
1159
- }],
1160
- ps: [{
1161
- ps: scaleUnambiguousSpacing()
1162
- }],
1163
- pe: [{
1164
- pe: scaleUnambiguousSpacing()
1165
- }],
1166
- pt: [{
1167
- pt: scaleUnambiguousSpacing()
1168
- }],
1169
- pr: [{
1170
- pr: scaleUnambiguousSpacing()
1171
- }],
1172
- pb: [{
1173
- pb: scaleUnambiguousSpacing()
1174
- }],
1175
- pl: [{
1176
- pl: scaleUnambiguousSpacing()
1177
- }],
1178
- m: [{
1179
- m: scaleMargin()
1180
- }],
1181
- mx: [{
1182
- mx: scaleMargin()
1183
- }],
1184
- my: [{
1185
- my: scaleMargin()
1186
- }],
1187
- ms: [{
1188
- ms: scaleMargin()
1189
- }],
1190
- me: [{
1191
- me: scaleMargin()
1192
- }],
1193
- mt: [{
1194
- mt: scaleMargin()
1195
- }],
1196
- mr: [{
1197
- mr: scaleMargin()
1198
- }],
1199
- mb: [{
1200
- mb: scaleMargin()
1201
- }],
1202
- ml: [{
1203
- ml: scaleMargin()
1204
- }],
1205
- "space-x": [{
1206
- "space-x": scaleUnambiguousSpacing()
1207
- }],
1208
- "space-x-reverse": ["space-x-reverse"],
1209
- "space-y": [{
1210
- "space-y": scaleUnambiguousSpacing()
1211
- }],
1212
- "space-y-reverse": ["space-y-reverse"],
1213
- size: [{
1214
- size: scaleSizing()
1215
- }],
1216
- w: [{
1217
- w: [themeContainer, "screen", ...scaleSizing()]
1218
- }],
1219
- "min-w": [{
1220
- "min-w": [
1221
- themeContainer,
1222
- "screen",
1223
- "none",
1224
- ...scaleSizing()
1225
- ]
1226
- }],
1227
- "max-w": [{
1228
- "max-w": [
1229
- themeContainer,
1230
- "screen",
1231
- "none",
1232
- "prose",
1233
- {
1234
- screen: [themeBreakpoint]
1235
- },
1236
- ...scaleSizing()
1237
- ]
1238
- }],
1239
- h: [{
1240
- h: ["screen", "lh", ...scaleSizing()]
1241
- }],
1242
- "min-h": [{
1243
- "min-h": ["screen", "lh", "none", ...scaleSizing()]
1244
- }],
1245
- "max-h": [{
1246
- "max-h": ["screen", "lh", ...scaleSizing()]
1247
- }],
1248
- "font-size": [{
1249
- text: ["base", themeText, isArbitraryVariableLength, isArbitraryLength]
1250
- }],
1251
- "font-smoothing": ["antialiased", "subpixel-antialiased"],
1252
- "font-style": ["italic", "not-italic"],
1253
- "font-weight": [{
1254
- font: [themeFontWeight, isArbitraryVariable, isArbitraryNumber]
1255
- }],
1256
- "font-stretch": [{
1257
- "font-stretch": ["ultra-condensed", "extra-condensed", "condensed", "semi-condensed", "normal", "semi-expanded", "expanded", "extra-expanded", "ultra-expanded", isPercent, isArbitraryValue]
1258
- }],
1259
- "font-family": [{
1260
- font: [isArbitraryVariableFamilyName, isArbitraryValue, themeFont]
1261
- }],
1262
- "fvn-normal": ["normal-nums"],
1263
- "fvn-ordinal": ["ordinal"],
1264
- "fvn-slashed-zero": ["slashed-zero"],
1265
- "fvn-figure": ["lining-nums", "oldstyle-nums"],
1266
- "fvn-spacing": ["proportional-nums", "tabular-nums"],
1267
- "fvn-fraction": ["diagonal-fractions", "stacked-fractions"],
1268
- tracking: [{
1269
- tracking: [themeTracking, isArbitraryVariable, isArbitraryValue]
1270
- }],
1271
- "line-clamp": [{
1272
- "line-clamp": [isNumber, "none", isArbitraryVariable, isArbitraryNumber]
1273
- }],
1274
- leading: [{
1275
- leading: [
1276
- themeLeading,
1277
- ...scaleUnambiguousSpacing()
1278
- ]
1279
- }],
1280
- "list-image": [{
1281
- "list-image": ["none", isArbitraryVariable, isArbitraryValue]
1282
- }],
1283
- "list-style-position": [{
1284
- list: ["inside", "outside"]
1285
- }],
1286
- "list-style-type": [{
1287
- list: ["disc", "decimal", "none", isArbitraryVariable, isArbitraryValue]
1288
- }],
1289
- "text-alignment": [{
1290
- text: ["left", "center", "right", "justify", "start", "end"]
1291
- }],
1292
- "placeholder-color": [{
1293
- placeholder: scaleColor()
1294
- }],
1295
- "text-color": [{
1296
- text: scaleColor()
1297
- }],
1298
- "text-decoration": ["underline", "overline", "line-through", "no-underline"],
1299
- "text-decoration-style": [{
1300
- decoration: [...scaleLineStyle(), "wavy"]
1301
- }],
1302
- "text-decoration-thickness": [{
1303
- decoration: [isNumber, "from-font", "auto", isArbitraryVariable, isArbitraryLength]
1304
- }],
1305
- "text-decoration-color": [{
1306
- decoration: scaleColor()
1307
- }],
1308
- "underline-offset": [{
1309
- "underline-offset": [isNumber, "auto", isArbitraryVariable, isArbitraryValue]
1310
- }],
1311
- "text-transform": ["uppercase", "lowercase", "capitalize", "normal-case"],
1312
- "text-overflow": ["truncate", "text-ellipsis", "text-clip"],
1313
- "text-wrap": [{
1314
- text: ["wrap", "nowrap", "balance", "pretty"]
1315
- }],
1316
- indent: [{
1317
- indent: scaleUnambiguousSpacing()
1318
- }],
1319
- "vertical-align": [{
1320
- align: ["baseline", "top", "middle", "bottom", "text-top", "text-bottom", "sub", "super", isArbitraryVariable, isArbitraryValue]
1321
- }],
1322
- whitespace: [{
1323
- whitespace: ["normal", "nowrap", "pre", "pre-line", "pre-wrap", "break-spaces"]
1324
- }],
1325
- break: [{
1326
- break: ["normal", "words", "all", "keep"]
1327
- }],
1328
- wrap: [{
1329
- wrap: ["break-word", "anywhere", "normal"]
1330
- }],
1331
- hyphens: [{
1332
- hyphens: ["none", "manual", "auto"]
1333
- }],
1334
- content: [{
1335
- content: ["none", isArbitraryVariable, isArbitraryValue]
1336
- }],
1337
- "bg-attachment": [{
1338
- bg: ["fixed", "local", "scroll"]
1339
- }],
1340
- "bg-clip": [{
1341
- "bg-clip": ["border", "padding", "content", "text"]
1342
- }],
1343
- "bg-origin": [{
1344
- "bg-origin": ["border", "padding", "content"]
1345
- }],
1346
- "bg-position": [{
1347
- bg: scaleBgPosition()
1348
- }],
1349
- "bg-repeat": [{
1350
- bg: scaleBgRepeat()
1351
- }],
1352
- "bg-size": [{
1353
- bg: scaleBgSize()
1354
- }],
1355
- "bg-image": [{
1356
- bg: ["none", {
1357
- linear: [{
1358
- to: ["t", "tr", "r", "br", "b", "bl", "l", "tl"]
1359
- }, isInteger, isArbitraryVariable, isArbitraryValue],
1360
- radial: ["", isArbitraryVariable, isArbitraryValue],
1361
- conic: [isInteger, isArbitraryVariable, isArbitraryValue]
1362
- }, isArbitraryVariableImage, isArbitraryImage]
1363
- }],
1364
- "bg-color": [{
1365
- bg: scaleColor()
1366
- }],
1367
- "gradient-from-pos": [{
1368
- from: scaleGradientStopPosition()
1369
- }],
1370
- "gradient-via-pos": [{
1371
- via: scaleGradientStopPosition()
1372
- }],
1373
- "gradient-to-pos": [{
1374
- to: scaleGradientStopPosition()
1375
- }],
1376
- "gradient-from": [{
1377
- from: scaleColor()
1378
- }],
1379
- "gradient-via": [{
1380
- via: scaleColor()
1381
- }],
1382
- "gradient-to": [{
1383
- to: scaleColor()
1384
- }],
1385
- rounded: [{
1386
- rounded: scaleRadius()
1387
- }],
1388
- "rounded-s": [{
1389
- "rounded-s": scaleRadius()
1390
- }],
1391
- "rounded-e": [{
1392
- "rounded-e": scaleRadius()
1393
- }],
1394
- "rounded-t": [{
1395
- "rounded-t": scaleRadius()
1396
- }],
1397
- "rounded-r": [{
1398
- "rounded-r": scaleRadius()
1399
- }],
1400
- "rounded-b": [{
1401
- "rounded-b": scaleRadius()
1402
- }],
1403
- "rounded-l": [{
1404
- "rounded-l": scaleRadius()
1405
- }],
1406
- "rounded-ss": [{
1407
- "rounded-ss": scaleRadius()
1408
- }],
1409
- "rounded-se": [{
1410
- "rounded-se": scaleRadius()
1411
- }],
1412
- "rounded-ee": [{
1413
- "rounded-ee": scaleRadius()
1414
- }],
1415
- "rounded-es": [{
1416
- "rounded-es": scaleRadius()
1417
- }],
1418
- "rounded-tl": [{
1419
- "rounded-tl": scaleRadius()
1420
- }],
1421
- "rounded-tr": [{
1422
- "rounded-tr": scaleRadius()
1423
- }],
1424
- "rounded-br": [{
1425
- "rounded-br": scaleRadius()
1426
- }],
1427
- "rounded-bl": [{
1428
- "rounded-bl": scaleRadius()
1429
- }],
1430
- "border-w": [{
1431
- border: scaleBorderWidth()
1432
- }],
1433
- "border-w-x": [{
1434
- "border-x": scaleBorderWidth()
1435
- }],
1436
- "border-w-y": [{
1437
- "border-y": scaleBorderWidth()
1438
- }],
1439
- "border-w-s": [{
1440
- "border-s": scaleBorderWidth()
1441
- }],
1442
- "border-w-e": [{
1443
- "border-e": scaleBorderWidth()
1444
- }],
1445
- "border-w-t": [{
1446
- "border-t": scaleBorderWidth()
1447
- }],
1448
- "border-w-r": [{
1449
- "border-r": scaleBorderWidth()
1450
- }],
1451
- "border-w-b": [{
1452
- "border-b": scaleBorderWidth()
1453
- }],
1454
- "border-w-l": [{
1455
- "border-l": scaleBorderWidth()
1456
- }],
1457
- "divide-x": [{
1458
- "divide-x": scaleBorderWidth()
1459
- }],
1460
- "divide-x-reverse": ["divide-x-reverse"],
1461
- "divide-y": [{
1462
- "divide-y": scaleBorderWidth()
1463
- }],
1464
- "divide-y-reverse": ["divide-y-reverse"],
1465
- "border-style": [{
1466
- border: [...scaleLineStyle(), "hidden", "none"]
1467
- }],
1468
- "divide-style": [{
1469
- divide: [...scaleLineStyle(), "hidden", "none"]
1470
- }],
1471
- "border-color": [{
1472
- border: scaleColor()
1473
- }],
1474
- "border-color-x": [{
1475
- "border-x": scaleColor()
1476
- }],
1477
- "border-color-y": [{
1478
- "border-y": scaleColor()
1479
- }],
1480
- "border-color-s": [{
1481
- "border-s": scaleColor()
1482
- }],
1483
- "border-color-e": [{
1484
- "border-e": scaleColor()
1485
- }],
1486
- "border-color-t": [{
1487
- "border-t": scaleColor()
1488
- }],
1489
- "border-color-r": [{
1490
- "border-r": scaleColor()
1491
- }],
1492
- "border-color-b": [{
1493
- "border-b": scaleColor()
1494
- }],
1495
- "border-color-l": [{
1496
- "border-l": scaleColor()
1497
- }],
1498
- "divide-color": [{
1499
- divide: scaleColor()
1500
- }],
1501
- "outline-style": [{
1502
- outline: [...scaleLineStyle(), "none", "hidden"]
1503
- }],
1504
- "outline-offset": [{
1505
- "outline-offset": [isNumber, isArbitraryVariable, isArbitraryValue]
1506
- }],
1507
- "outline-w": [{
1508
- outline: ["", isNumber, isArbitraryVariableLength, isArbitraryLength]
1509
- }],
1510
- "outline-color": [{
1511
- outline: scaleColor()
1512
- }],
1513
- shadow: [{
1514
- shadow: [
1515
- "",
1516
- "none",
1517
- themeShadow,
1518
- isArbitraryVariableShadow,
1519
- isArbitraryShadow
1520
- ]
1521
- }],
1522
- "shadow-color": [{
1523
- shadow: scaleColor()
1524
- }],
1525
- "inset-shadow": [{
1526
- "inset-shadow": ["none", themeInsetShadow, isArbitraryVariableShadow, isArbitraryShadow]
1527
- }],
1528
- "inset-shadow-color": [{
1529
- "inset-shadow": scaleColor()
1530
- }],
1531
- "ring-w": [{
1532
- ring: scaleBorderWidth()
1533
- }],
1534
- "ring-w-inset": ["ring-inset"],
1535
- "ring-color": [{
1536
- ring: scaleColor()
1537
- }],
1538
- "ring-offset-w": [{
1539
- "ring-offset": [isNumber, isArbitraryLength]
1540
- }],
1541
- "ring-offset-color": [{
1542
- "ring-offset": scaleColor()
1543
- }],
1544
- "inset-ring-w": [{
1545
- "inset-ring": scaleBorderWidth()
1546
- }],
1547
- "inset-ring-color": [{
1548
- "inset-ring": scaleColor()
1549
- }],
1550
- "text-shadow": [{
1551
- "text-shadow": ["none", themeTextShadow, isArbitraryVariableShadow, isArbitraryShadow]
1552
- }],
1553
- "text-shadow-color": [{
1554
- "text-shadow": scaleColor()
1555
- }],
1556
- opacity: [{
1557
- opacity: [isNumber, isArbitraryVariable, isArbitraryValue]
1558
- }],
1559
- "mix-blend": [{
1560
- "mix-blend": [...scaleBlendMode(), "plus-darker", "plus-lighter"]
1561
- }],
1562
- "bg-blend": [{
1563
- "bg-blend": scaleBlendMode()
1564
- }],
1565
- "mask-clip": [{
1566
- "mask-clip": ["border", "padding", "content", "fill", "stroke", "view"]
1567
- }, "mask-no-clip"],
1568
- "mask-composite": [{
1569
- mask: ["add", "subtract", "intersect", "exclude"]
1570
- }],
1571
- "mask-image-linear-pos": [{
1572
- "mask-linear": [isNumber]
1573
- }],
1574
- "mask-image-linear-from-pos": [{
1575
- "mask-linear-from": scaleMaskImagePosition()
1576
- }],
1577
- "mask-image-linear-to-pos": [{
1578
- "mask-linear-to": scaleMaskImagePosition()
1579
- }],
1580
- "mask-image-linear-from-color": [{
1581
- "mask-linear-from": scaleColor()
1582
- }],
1583
- "mask-image-linear-to-color": [{
1584
- "mask-linear-to": scaleColor()
1585
- }],
1586
- "mask-image-t-from-pos": [{
1587
- "mask-t-from": scaleMaskImagePosition()
1588
- }],
1589
- "mask-image-t-to-pos": [{
1590
- "mask-t-to": scaleMaskImagePosition()
1591
- }],
1592
- "mask-image-t-from-color": [{
1593
- "mask-t-from": scaleColor()
1594
- }],
1595
- "mask-image-t-to-color": [{
1596
- "mask-t-to": scaleColor()
1597
- }],
1598
- "mask-image-r-from-pos": [{
1599
- "mask-r-from": scaleMaskImagePosition()
1600
- }],
1601
- "mask-image-r-to-pos": [{
1602
- "mask-r-to": scaleMaskImagePosition()
1603
- }],
1604
- "mask-image-r-from-color": [{
1605
- "mask-r-from": scaleColor()
1606
- }],
1607
- "mask-image-r-to-color": [{
1608
- "mask-r-to": scaleColor()
1609
- }],
1610
- "mask-image-b-from-pos": [{
1611
- "mask-b-from": scaleMaskImagePosition()
1612
- }],
1613
- "mask-image-b-to-pos": [{
1614
- "mask-b-to": scaleMaskImagePosition()
1615
- }],
1616
- "mask-image-b-from-color": [{
1617
- "mask-b-from": scaleColor()
1618
- }],
1619
- "mask-image-b-to-color": [{
1620
- "mask-b-to": scaleColor()
1621
- }],
1622
- "mask-image-l-from-pos": [{
1623
- "mask-l-from": scaleMaskImagePosition()
1624
- }],
1625
- "mask-image-l-to-pos": [{
1626
- "mask-l-to": scaleMaskImagePosition()
1627
- }],
1628
- "mask-image-l-from-color": [{
1629
- "mask-l-from": scaleColor()
1630
- }],
1631
- "mask-image-l-to-color": [{
1632
- "mask-l-to": scaleColor()
1633
- }],
1634
- "mask-image-x-from-pos": [{
1635
- "mask-x-from": scaleMaskImagePosition()
1636
- }],
1637
- "mask-image-x-to-pos": [{
1638
- "mask-x-to": scaleMaskImagePosition()
1639
- }],
1640
- "mask-image-x-from-color": [{
1641
- "mask-x-from": scaleColor()
1642
- }],
1643
- "mask-image-x-to-color": [{
1644
- "mask-x-to": scaleColor()
1645
- }],
1646
- "mask-image-y-from-pos": [{
1647
- "mask-y-from": scaleMaskImagePosition()
1648
- }],
1649
- "mask-image-y-to-pos": [{
1650
- "mask-y-to": scaleMaskImagePosition()
1651
- }],
1652
- "mask-image-y-from-color": [{
1653
- "mask-y-from": scaleColor()
1654
- }],
1655
- "mask-image-y-to-color": [{
1656
- "mask-y-to": scaleColor()
1657
- }],
1658
- "mask-image-radial": [{
1659
- "mask-radial": [isArbitraryVariable, isArbitraryValue]
1660
- }],
1661
- "mask-image-radial-from-pos": [{
1662
- "mask-radial-from": scaleMaskImagePosition()
1663
- }],
1664
- "mask-image-radial-to-pos": [{
1665
- "mask-radial-to": scaleMaskImagePosition()
1666
- }],
1667
- "mask-image-radial-from-color": [{
1668
- "mask-radial-from": scaleColor()
1669
- }],
1670
- "mask-image-radial-to-color": [{
1671
- "mask-radial-to": scaleColor()
1672
- }],
1673
- "mask-image-radial-shape": [{
1674
- "mask-radial": ["circle", "ellipse"]
1675
- }],
1676
- "mask-image-radial-size": [{
1677
- "mask-radial": [{
1678
- closest: ["side", "corner"],
1679
- farthest: ["side", "corner"]
1680
- }]
1681
- }],
1682
- "mask-image-radial-pos": [{
1683
- "mask-radial-at": scalePosition()
1684
- }],
1685
- "mask-image-conic-pos": [{
1686
- "mask-conic": [isNumber]
1687
- }],
1688
- "mask-image-conic-from-pos": [{
1689
- "mask-conic-from": scaleMaskImagePosition()
1690
- }],
1691
- "mask-image-conic-to-pos": [{
1692
- "mask-conic-to": scaleMaskImagePosition()
1693
- }],
1694
- "mask-image-conic-from-color": [{
1695
- "mask-conic-from": scaleColor()
1696
- }],
1697
- "mask-image-conic-to-color": [{
1698
- "mask-conic-to": scaleColor()
1699
- }],
1700
- "mask-mode": [{
1701
- mask: ["alpha", "luminance", "match"]
1702
- }],
1703
- "mask-origin": [{
1704
- "mask-origin": ["border", "padding", "content", "fill", "stroke", "view"]
1705
- }],
1706
- "mask-position": [{
1707
- mask: scaleBgPosition()
1708
- }],
1709
- "mask-repeat": [{
1710
- mask: scaleBgRepeat()
1711
- }],
1712
- "mask-size": [{
1713
- mask: scaleBgSize()
1714
- }],
1715
- "mask-type": [{
1716
- "mask-type": ["alpha", "luminance"]
1717
- }],
1718
- "mask-image": [{
1719
- mask: ["none", isArbitraryVariable, isArbitraryValue]
1720
- }],
1721
- filter: [{
1722
- filter: [
1723
- "",
1724
- "none",
1725
- isArbitraryVariable,
1726
- isArbitraryValue
1727
- ]
1728
- }],
1729
- blur: [{
1730
- blur: scaleBlur()
1731
- }],
1732
- brightness: [{
1733
- brightness: [isNumber, isArbitraryVariable, isArbitraryValue]
1734
- }],
1735
- contrast: [{
1736
- contrast: [isNumber, isArbitraryVariable, isArbitraryValue]
1737
- }],
1738
- "drop-shadow": [{
1739
- "drop-shadow": [
1740
- "",
1741
- "none",
1742
- themeDropShadow,
1743
- isArbitraryVariableShadow,
1744
- isArbitraryShadow
1745
- ]
1746
- }],
1747
- "drop-shadow-color": [{
1748
- "drop-shadow": scaleColor()
1749
- }],
1750
- grayscale: [{
1751
- grayscale: ["", isNumber, isArbitraryVariable, isArbitraryValue]
1752
- }],
1753
- "hue-rotate": [{
1754
- "hue-rotate": [isNumber, isArbitraryVariable, isArbitraryValue]
1755
- }],
1756
- invert: [{
1757
- invert: ["", isNumber, isArbitraryVariable, isArbitraryValue]
1758
- }],
1759
- saturate: [{
1760
- saturate: [isNumber, isArbitraryVariable, isArbitraryValue]
1761
- }],
1762
- sepia: [{
1763
- sepia: ["", isNumber, isArbitraryVariable, isArbitraryValue]
1764
- }],
1765
- "backdrop-filter": [{
1766
- "backdrop-filter": [
1767
- "",
1768
- "none",
1769
- isArbitraryVariable,
1770
- isArbitraryValue
1771
- ]
1772
- }],
1773
- "backdrop-blur": [{
1774
- "backdrop-blur": scaleBlur()
1775
- }],
1776
- "backdrop-brightness": [{
1777
- "backdrop-brightness": [isNumber, isArbitraryVariable, isArbitraryValue]
1778
- }],
1779
- "backdrop-contrast": [{
1780
- "backdrop-contrast": [isNumber, isArbitraryVariable, isArbitraryValue]
1781
- }],
1782
- "backdrop-grayscale": [{
1783
- "backdrop-grayscale": ["", isNumber, isArbitraryVariable, isArbitraryValue]
1784
- }],
1785
- "backdrop-hue-rotate": [{
1786
- "backdrop-hue-rotate": [isNumber, isArbitraryVariable, isArbitraryValue]
1787
- }],
1788
- "backdrop-invert": [{
1789
- "backdrop-invert": ["", isNumber, isArbitraryVariable, isArbitraryValue]
1790
- }],
1791
- "backdrop-opacity": [{
1792
- "backdrop-opacity": [isNumber, isArbitraryVariable, isArbitraryValue]
1793
- }],
1794
- "backdrop-saturate": [{
1795
- "backdrop-saturate": [isNumber, isArbitraryVariable, isArbitraryValue]
1796
- }],
1797
- "backdrop-sepia": [{
1798
- "backdrop-sepia": ["", isNumber, isArbitraryVariable, isArbitraryValue]
1799
- }],
1800
- "border-collapse": [{
1801
- border: ["collapse", "separate"]
1802
- }],
1803
- "border-spacing": [{
1804
- "border-spacing": scaleUnambiguousSpacing()
1805
- }],
1806
- "border-spacing-x": [{
1807
- "border-spacing-x": scaleUnambiguousSpacing()
1808
- }],
1809
- "border-spacing-y": [{
1810
- "border-spacing-y": scaleUnambiguousSpacing()
1811
- }],
1812
- "table-layout": [{
1813
- table: ["auto", "fixed"]
1814
- }],
1815
- caption: [{
1816
- caption: ["top", "bottom"]
1817
- }],
1818
- transition: [{
1819
- transition: ["", "all", "colors", "opacity", "shadow", "transform", "none", isArbitraryVariable, isArbitraryValue]
1820
- }],
1821
- "transition-behavior": [{
1822
- transition: ["normal", "discrete"]
1823
- }],
1824
- duration: [{
1825
- duration: [isNumber, "initial", isArbitraryVariable, isArbitraryValue]
1826
- }],
1827
- ease: [{
1828
- ease: ["linear", "initial", themeEase, isArbitraryVariable, isArbitraryValue]
1829
- }],
1830
- delay: [{
1831
- delay: [isNumber, isArbitraryVariable, isArbitraryValue]
1832
- }],
1833
- animate: [{
1834
- animate: ["none", themeAnimate, isArbitraryVariable, isArbitraryValue]
1835
- }],
1836
- backface: [{
1837
- backface: ["hidden", "visible"]
1838
- }],
1839
- perspective: [{
1840
- perspective: [themePerspective, isArbitraryVariable, isArbitraryValue]
1841
- }],
1842
- "perspective-origin": [{
1843
- "perspective-origin": scalePositionWithArbitrary()
1844
- }],
1845
- rotate: [{
1846
- rotate: scaleRotate()
1847
- }],
1848
- "rotate-x": [{
1849
- "rotate-x": scaleRotate()
1850
- }],
1851
- "rotate-y": [{
1852
- "rotate-y": scaleRotate()
1853
- }],
1854
- "rotate-z": [{
1855
- "rotate-z": scaleRotate()
1856
- }],
1857
- scale: [{
1858
- scale: scaleScale()
1859
- }],
1860
- "scale-x": [{
1861
- "scale-x": scaleScale()
1862
- }],
1863
- "scale-y": [{
1864
- "scale-y": scaleScale()
1865
- }],
1866
- "scale-z": [{
1867
- "scale-z": scaleScale()
1868
- }],
1869
- "scale-3d": ["scale-3d"],
1870
- skew: [{
1871
- skew: scaleSkew()
1872
- }],
1873
- "skew-x": [{
1874
- "skew-x": scaleSkew()
1875
- }],
1876
- "skew-y": [{
1877
- "skew-y": scaleSkew()
1878
- }],
1879
- transform: [{
1880
- transform: [isArbitraryVariable, isArbitraryValue, "", "none", "gpu", "cpu"]
1881
- }],
1882
- "transform-origin": [{
1883
- origin: scalePositionWithArbitrary()
1884
- }],
1885
- "transform-style": [{
1886
- transform: ["3d", "flat"]
1887
- }],
1888
- translate: [{
1889
- translate: scaleTranslate()
1890
- }],
1891
- "translate-x": [{
1892
- "translate-x": scaleTranslate()
1893
- }],
1894
- "translate-y": [{
1895
- "translate-y": scaleTranslate()
1896
- }],
1897
- "translate-z": [{
1898
- "translate-z": scaleTranslate()
1899
- }],
1900
- "translate-none": ["translate-none"],
1901
- accent: [{
1902
- accent: scaleColor()
1903
- }],
1904
- appearance: [{
1905
- appearance: ["none", "auto"]
1906
- }],
1907
- "caret-color": [{
1908
- caret: scaleColor()
1909
- }],
1910
- "color-scheme": [{
1911
- scheme: ["normal", "dark", "light", "light-dark", "only-dark", "only-light"]
1912
- }],
1913
- cursor: [{
1914
- 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]
1915
- }],
1916
- "field-sizing": [{
1917
- "field-sizing": ["fixed", "content"]
1918
- }],
1919
- "pointer-events": [{
1920
- "pointer-events": ["auto", "none"]
1921
- }],
1922
- resize: [{
1923
- resize: ["none", "", "y", "x"]
1924
- }],
1925
- "scroll-behavior": [{
1926
- scroll: ["auto", "smooth"]
1927
- }],
1928
- "scroll-m": [{
1929
- "scroll-m": scaleUnambiguousSpacing()
1930
- }],
1931
- "scroll-mx": [{
1932
- "scroll-mx": scaleUnambiguousSpacing()
1933
- }],
1934
- "scroll-my": [{
1935
- "scroll-my": scaleUnambiguousSpacing()
1936
- }],
1937
- "scroll-ms": [{
1938
- "scroll-ms": scaleUnambiguousSpacing()
1939
- }],
1940
- "scroll-me": [{
1941
- "scroll-me": scaleUnambiguousSpacing()
1942
- }],
1943
- "scroll-mt": [{
1944
- "scroll-mt": scaleUnambiguousSpacing()
1945
- }],
1946
- "scroll-mr": [{
1947
- "scroll-mr": scaleUnambiguousSpacing()
1948
- }],
1949
- "scroll-mb": [{
1950
- "scroll-mb": scaleUnambiguousSpacing()
1951
- }],
1952
- "scroll-ml": [{
1953
- "scroll-ml": scaleUnambiguousSpacing()
1954
- }],
1955
- "scroll-p": [{
1956
- "scroll-p": scaleUnambiguousSpacing()
1957
- }],
1958
- "scroll-px": [{
1959
- "scroll-px": scaleUnambiguousSpacing()
1960
- }],
1961
- "scroll-py": [{
1962
- "scroll-py": scaleUnambiguousSpacing()
1963
- }],
1964
- "scroll-ps": [{
1965
- "scroll-ps": scaleUnambiguousSpacing()
1966
- }],
1967
- "scroll-pe": [{
1968
- "scroll-pe": scaleUnambiguousSpacing()
1969
- }],
1970
- "scroll-pt": [{
1971
- "scroll-pt": scaleUnambiguousSpacing()
1972
- }],
1973
- "scroll-pr": [{
1974
- "scroll-pr": scaleUnambiguousSpacing()
1975
- }],
1976
- "scroll-pb": [{
1977
- "scroll-pb": scaleUnambiguousSpacing()
1978
- }],
1979
- "scroll-pl": [{
1980
- "scroll-pl": scaleUnambiguousSpacing()
1981
- }],
1982
- "snap-align": [{
1983
- snap: ["start", "end", "center", "align-none"]
1984
- }],
1985
- "snap-stop": [{
1986
- snap: ["normal", "always"]
1987
- }],
1988
- "snap-type": [{
1989
- snap: ["none", "x", "y", "both"]
1990
- }],
1991
- "snap-strictness": [{
1992
- snap: ["mandatory", "proximity"]
1993
- }],
1994
- touch: [{
1995
- touch: ["auto", "none", "manipulation"]
1996
- }],
1997
- "touch-x": [{
1998
- "touch-pan": ["x", "left", "right"]
1999
- }],
2000
- "touch-y": [{
2001
- "touch-pan": ["y", "up", "down"]
2002
- }],
2003
- "touch-pz": ["touch-pinch-zoom"],
2004
- select: [{
2005
- select: ["none", "text", "all", "auto"]
2006
- }],
2007
- "will-change": [{
2008
- "will-change": ["auto", "scroll", "contents", "transform", isArbitraryVariable, isArbitraryValue]
2009
- }],
2010
- fill: [{
2011
- fill: ["none", ...scaleColor()]
2012
- }],
2013
- "stroke-w": [{
2014
- stroke: [isNumber, isArbitraryVariableLength, isArbitraryLength, isArbitraryNumber]
2015
- }],
2016
- stroke: [{
2017
- stroke: ["none", ...scaleColor()]
2018
- }],
2019
- "forced-color-adjust": [{
2020
- "forced-color-adjust": ["auto", "none"]
2021
- }]
2022
- },
2023
- conflictingClassGroups: {
2024
- overflow: ["overflow-x", "overflow-y"],
2025
- overscroll: ["overscroll-x", "overscroll-y"],
2026
- inset: ["inset-x", "inset-y", "start", "end", "top", "right", "bottom", "left"],
2027
- "inset-x": ["right", "left"],
2028
- "inset-y": ["top", "bottom"],
2029
- flex: ["basis", "grow", "shrink"],
2030
- gap: ["gap-x", "gap-y"],
2031
- p: ["px", "py", "ps", "pe", "pt", "pr", "pb", "pl"],
2032
- px: ["pr", "pl"],
2033
- py: ["pt", "pb"],
2034
- m: ["mx", "my", "ms", "me", "mt", "mr", "mb", "ml"],
2035
- mx: ["mr", "ml"],
2036
- my: ["mt", "mb"],
2037
- size: ["w", "h"],
2038
- "font-size": ["leading"],
2039
- "fvn-normal": ["fvn-ordinal", "fvn-slashed-zero", "fvn-figure", "fvn-spacing", "fvn-fraction"],
2040
- "fvn-ordinal": ["fvn-normal"],
2041
- "fvn-slashed-zero": ["fvn-normal"],
2042
- "fvn-figure": ["fvn-normal"],
2043
- "fvn-spacing": ["fvn-normal"],
2044
- "fvn-fraction": ["fvn-normal"],
2045
- "line-clamp": ["display", "overflow"],
2046
- 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"],
2047
- "rounded-s": ["rounded-ss", "rounded-es"],
2048
- "rounded-e": ["rounded-se", "rounded-ee"],
2049
- "rounded-t": ["rounded-tl", "rounded-tr"],
2050
- "rounded-r": ["rounded-tr", "rounded-br"],
2051
- "rounded-b": ["rounded-br", "rounded-bl"],
2052
- "rounded-l": ["rounded-tl", "rounded-bl"],
2053
- "border-spacing": ["border-spacing-x", "border-spacing-y"],
2054
- "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"],
2055
- "border-w-x": ["border-w-r", "border-w-l"],
2056
- "border-w-y": ["border-w-t", "border-w-b"],
2057
- "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"],
2058
- "border-color-x": ["border-color-r", "border-color-l"],
2059
- "border-color-y": ["border-color-t", "border-color-b"],
2060
- translate: ["translate-x", "translate-y", "translate-none"],
2061
- "translate-none": ["translate", "translate-x", "translate-y", "translate-z"],
2062
- "scroll-m": ["scroll-mx", "scroll-my", "scroll-ms", "scroll-me", "scroll-mt", "scroll-mr", "scroll-mb", "scroll-ml"],
2063
- "scroll-mx": ["scroll-mr", "scroll-ml"],
2064
- "scroll-my": ["scroll-mt", "scroll-mb"],
2065
- "scroll-p": ["scroll-px", "scroll-py", "scroll-ps", "scroll-pe", "scroll-pt", "scroll-pr", "scroll-pb", "scroll-pl"],
2066
- "scroll-px": ["scroll-pr", "scroll-pl"],
2067
- "scroll-py": ["scroll-pt", "scroll-pb"],
2068
- touch: ["touch-x", "touch-y", "touch-pz"],
2069
- "touch-x": ["touch"],
2070
- "touch-y": ["touch"],
2071
- "touch-pz": ["touch"]
2072
- },
2073
- conflictingClassGroupModifiers: {
2074
- "font-size": ["leading"]
2075
- },
2076
- orderSensitiveModifiers: ["*", "**", "after", "backdrop", "before", "details-content", "file", "first-letter", "first-line", "marker", "placeholder", "selection"]
2077
- };
2078
- };
2079
- var mergeConfigs = (baseConfig, {
2080
- cacheSize,
2081
- prefix,
2082
- experimentalParseClassName,
2083
- extend = {},
2084
- override = {}
2085
- }) => {
2086
- overrideProperty(baseConfig, "cacheSize", cacheSize);
2087
- overrideProperty(baseConfig, "prefix", prefix);
2088
- overrideProperty(baseConfig, "experimentalParseClassName", experimentalParseClassName);
2089
- overrideConfigProperties(baseConfig.theme, override.theme);
2090
- overrideConfigProperties(baseConfig.classGroups, override.classGroups);
2091
- overrideConfigProperties(baseConfig.conflictingClassGroups, override.conflictingClassGroups);
2092
- overrideConfigProperties(baseConfig.conflictingClassGroupModifiers, override.conflictingClassGroupModifiers);
2093
- overrideProperty(baseConfig, "orderSensitiveModifiers", override.orderSensitiveModifiers);
2094
- mergeConfigProperties(baseConfig.theme, extend.theme);
2095
- mergeConfigProperties(baseConfig.classGroups, extend.classGroups);
2096
- mergeConfigProperties(baseConfig.conflictingClassGroups, extend.conflictingClassGroups);
2097
- mergeConfigProperties(baseConfig.conflictingClassGroupModifiers, extend.conflictingClassGroupModifiers);
2098
- mergeArrayProperties(baseConfig, extend, "orderSensitiveModifiers");
2099
- return baseConfig;
2100
- };
2101
- var overrideProperty = (baseObject, overrideKey, overrideValue) => {
2102
- if (overrideValue !== undefined) {
2103
- baseObject[overrideKey] = overrideValue;
2104
- }
2105
- };
2106
- var overrideConfigProperties = (baseObject, overrideObject) => {
2107
- if (overrideObject) {
2108
- for (const key in overrideObject) {
2109
- overrideProperty(baseObject, key, overrideObject[key]);
2110
- }
2111
- }
2112
- };
2113
- var mergeConfigProperties = (baseObject, mergeObject) => {
2114
- if (mergeObject) {
2115
- for (const key in mergeObject) {
2116
- mergeArrayProperties(baseObject, mergeObject, key);
2117
- }
2118
- }
2119
- };
2120
- var mergeArrayProperties = (baseObject, mergeObject, key) => {
2121
- const mergeValue = mergeObject[key];
2122
- if (mergeValue !== undefined) {
2123
- baseObject[key] = baseObject[key] ? baseObject[key].concat(mergeValue) : mergeValue;
2124
- }
2125
- };
2126
- var extendTailwindMerge = (configExtension, ...createConfig) => typeof configExtension === "function" ? createTailwindMerge(getDefaultConfig, configExtension, ...createConfig) : createTailwindMerge(() => mergeConfigs(getDefaultConfig(), configExtension), ...createConfig);
2127
- var twMerge = /* @__PURE__ */ createTailwindMerge(getDefaultConfig);
2128
-
2129
- // node_modules/tailwind-variants/dist/index.js
2130
- var createTwMerge = (cachedTwMergeConfig) => {
2131
- return isEmptyObject(cachedTwMergeConfig) ? twMerge : extendTailwindMerge({
2132
- ...cachedTwMergeConfig,
2133
- extend: {
2134
- theme: cachedTwMergeConfig.theme,
2135
- classGroups: cachedTwMergeConfig.classGroups,
2136
- conflictingClassGroupModifiers: cachedTwMergeConfig.conflictingClassGroupModifiers,
2137
- conflictingClassGroups: cachedTwMergeConfig.conflictingClassGroups,
2138
- ...cachedTwMergeConfig.extend
2139
- }
2140
- });
2141
- };
2142
- var executeMerge = (classnames, config) => {
2143
- const base = cx(classnames);
2144
- if (!base || !(config?.twMerge ?? true))
2145
- return base;
2146
- if (!state.cachedTwMerge || state.didTwMergeConfigChange) {
2147
- state.didTwMergeConfigChange = false;
2148
- state.cachedTwMerge = createTwMerge(state.cachedTwMergeConfig);
2149
- }
2150
- return state.cachedTwMerge(base) || undefined;
2151
- };
2152
- var cnMerge = (...classnames) => {
2153
- return (config) => executeMerge(classnames, config);
2154
- };
2155
- var { createTV, tv } = getTailwindVariants(cnMerge);
2156
-
2157
- // src/base-ui/Button.tsx
2158
- import {
2159
- Button as BaseUIButton
2160
- } from "@base-ui/react/button";
2161
- import { jsxDEV, Fragment } from "react/jsx-dev-runtime";
2162
- "use client";
2163
- defaultConfig.twMerge = false;
2164
- var button = tv({
2165
- base: "button-base w-fit relative whitespace-nowrap inline-flex items-center justify-center text-center motion-safe:transition-button shrink-0",
2166
- variants: {
2167
- isPending: {
2168
- false: [
2169
- "cursor-pointer",
2170
- "will-change-transform",
2171
- "motion-safe:hover:animate-button-hover",
2172
- "motion-safe:active:animate-button-active"
2173
- ],
2174
- true: "pointer-events-none opacity-80"
2175
- },
2176
- isDisabled: {
2177
- true: "pointer-events-none opacity-40"
2178
- },
2179
- size: {
2180
- sm: "button-size-sm",
2181
- md: "button-size-md",
2182
- lg: "button-size-lg"
2183
- },
2184
- variant: {
2185
- filled: "",
2186
- outlined: "",
2187
- subtle: "",
2188
- transparent: ""
2189
- },
2190
- severity: {
2191
- neutral: "",
2192
- primary: "",
2193
- secondary: "",
2194
- info: "",
2195
- success: "",
2196
- warning: "",
2197
- danger: "",
2198
- magic: ""
2199
- }
2200
- },
2201
- compoundVariants: [
2202
- {
2203
- variant: "filled",
2204
- severity: "primary",
2205
- className: "text-on-primary bg-primary hover:bg-primary-hover active:bg-primary-active"
2206
- },
2207
- {
2208
- variant: "subtle",
2209
- severity: "primary",
2210
- className: "text-on-primary-subtle bg-primary-subtle hover:bg-primary-subtle-hover active:bg-primary-subtle-active"
2211
- },
2212
- {
2213
- variant: "outlined",
2214
- severity: "primary",
2215
- className: "text-primary bg-transparent outline outline-primary hover:bg-primary/5 active:bg-primary/10"
2216
- },
2217
- {
2218
- variant: "transparent",
2219
- severity: "primary",
2220
- className: "text-primary bg-transparent hover:bg-primary/10 active:bg-primary/15"
2221
- },
2222
- {
2223
- variant: "filled",
2224
- severity: "neutral",
2225
- className: "text-on-neutral bg-neutral hover:bg-neutral-hover active:bg-neutral-active"
2226
- },
2227
- {
2228
- variant: "subtle",
2229
- severity: "neutral",
2230
- className: "text-on-neutral-subtle bg-neutral-subtle hover:bg-neutral-subtle-hover active:bg-neutral-subtle-active"
2231
- },
2232
- {
2233
- variant: "outlined",
2234
- severity: "neutral",
2235
- className: "text-neutral bg-transparent outline outline-default hover:bg-neutral/15 active:bg-neutral/20"
2236
- },
2237
- {
2238
- variant: "transparent",
2239
- severity: "neutral",
2240
- className: "text-neutral bg-transparent hover:bg-neutral/20 active:bg-neutral/30"
2241
- },
2242
- {
2243
- variant: "filled",
2244
- severity: "info",
2245
- className: "text-on-info bg-info hover:bg-info-hover active:bg-info-active"
2246
- },
2247
- {
2248
- variant: "subtle",
2249
- severity: "info",
2250
- className: "text-on-info-subtle bg-info-subtle hover:bg-info-subtle-hover active:bg-info-subtle-active"
2251
- },
2252
- {
2253
- variant: "outlined",
2254
- severity: "info",
2255
- className: "text-info bg-transparent outline outline-info hover:bg-info/5 active:bg-info/10"
2256
- },
2257
- {
2258
- variant: "transparent",
2259
- severity: "info",
2260
- className: "text-info bg-transparent hover:bg-info/10 active:bg-info/15"
2261
- },
2262
- {
2263
- variant: "filled",
2264
- severity: "success",
2265
- className: "text-on-success bg-success hover:bg-success-hover active:bg-success-active"
2266
- },
2267
- {
2268
- variant: "subtle",
2269
- severity: "success",
2270
- className: "text-on-success-subtle bg-success-subtle hover:bg-success-subtle-hover active:bg-success-subtle-active"
2271
- },
2272
- {
2273
- variant: "outlined",
2274
- severity: "success",
2275
- className: "text-success bg-transparent outline outline-success hover:bg-success/5 active:bg-success/10"
2276
- },
2277
- {
2278
- variant: "transparent",
2279
- severity: "success",
2280
- className: "text-success bg-transparent hover:bg-success/10 active:bg-success/15"
2281
- }
2282
- ],
2283
- defaultVariants: {
2284
- size: "md",
2285
- variant: "filled",
2286
- severity: "primary",
2287
- isDisabled: false,
2288
- isPending: false
2289
- }
2290
- });
2291
- function Button({
2292
- children,
2293
- className,
2294
- isPending = false,
2295
- isDisabled = false,
2296
- size,
2297
- variant,
2298
- severity,
2299
- ...props
2300
- }) {
2301
- return /* @__PURE__ */ jsxDEV(BaseUIButton, {
2302
- disabled: isDisabled,
2303
- ...props,
2304
- className: twMerge(button({
2305
- size,
2306
- variant,
2307
- severity,
2308
- isDisabled,
2309
- isPending
2310
- }), className),
2311
- children: /* @__PURE__ */ jsxDEV(Fragment, {
2312
- children: [
2313
- /* @__PURE__ */ jsxDEV("span", {
2314
- className: isPending ? "text-transparent select-none" : "",
2315
- children
2316
- }, undefined, false, undefined, this),
2317
- isPending && /* @__PURE__ */ jsxDEV("span", {
2318
- className: "flex absolute inset-0 justify-center items-center",
2319
- children: /* @__PURE__ */ jsxDEV(LoaderCircle, {
2320
- className: "animate-spin",
2321
- size: 16
2322
- }, undefined, false, undefined, this)
2323
- }, undefined, false, undefined, this)
2324
- ]
2325
- }, undefined, true, undefined, this)
2326
- }, undefined, false, undefined, this);
2327
- }
2328
- export {
2329
- Button
2330
- };
2331
-
2332
- //# debugId=B0E09DFF642792CC64756E2164756E21
1
+ export { Button } from './chunk-W3ZTRXNP.js';