@powerhousedao/powerhouse-vetra-packages 6.1.0-dev.2 → 6.1.0-dev.21
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/browser/assets/entry-Bzani6_n.js +313 -0
- package/dist/browser/assets/projection-entry-Bpu-8SnI.js +406 -0
- package/dist/browser/{dist-DOMEWT3x.js → connect-ZnLjvmRt.js} +13013 -10302
- package/dist/browser/connect-ZnLjvmRt.js.map +1 -0
- package/dist/browser/dist-C1nRM9t2.js +3768 -0
- package/dist/browser/dist-C1nRM9t2.js.map +1 -0
- package/dist/browser/{schemas-Bqem6NRm.js → dist-CXoKspdx.js} +131 -2
- package/dist/browser/dist-CXoKspdx.js.map +1 -0
- package/dist/browser/dist-D8H48e8N.js +2692 -0
- package/dist/browser/dist-D8H48e8N.js.map +1 -0
- package/dist/browser/{dist-CC1E3l2O.js → dist-DLFI75Zd.js} +37 -9
- package/dist/browser/dist-DLFI75Zd.js.map +1 -0
- package/dist/browser/{dist-DQgJ8n4d.js → document-drive-oqv68jDU.js} +432 -290
- package/dist/browser/document-drive-oqv68jDU.js.map +1 -0
- package/dist/browser/document-models/index.js +1 -1
- package/dist/browser/{documents-Bpu0aSLb.js → documents-D4ek7Ubv.js} +3 -3
- package/dist/browser/{documents-Bpu0aSLb.js.map → documents-D4ek7Ubv.js.map} +1 -1
- package/dist/browser/{editor-B3yz7YdR.js → editor-CoTq6fqT.js} +32 -31
- package/dist/browser/editor-CoTq6fqT.js.map +1 -0
- package/dist/browser/{editor-Dm_73jiz.js → editor-DC3bigBu.js} +5 -5
- package/dist/browser/{editor-Dm_73jiz.js.map → editor-DC3bigBu.js.map} +1 -1
- package/dist/browser/editors/document-model-editor/module.js +1 -1
- package/dist/browser/editors/generic-drive-explorer/index.js +6 -6
- package/dist/browser/editors/generic-drive-explorer/index.js.map +1 -1
- package/dist/browser/editors/generic-drive-explorer/module.js +1 -1
- package/dist/browser/{folder-view-H2ov-zId.js → folder-view-DmYBf2pP.js} +13 -12
- package/dist/browser/folder-view-DmYBf2pP.js.map +1 -0
- package/dist/browser/{graphql-editor-CnaQ3XWx.js → graphql-editor-CiGd_Li7.js} +15 -7
- package/dist/browser/{graphql-editor-CnaQ3XWx.js.map → graphql-editor-CiGd_Li7.js.map} +1 -1
- package/dist/{node/hooks-Lbsf6g-v.mjs → browser/hooks-CORHBNHb.js} +6 -4
- package/dist/browser/{hooks-Beny0xpe.js.map → hooks-CORHBNHb.js.map} +1 -1
- package/dist/browser/index.js +2 -2
- package/dist/{node/json-editor-CVGgDVh2.mjs → browser/json-editor-sEqd5piI.js} +12 -4
- package/dist/browser/json-editor-sEqd5piI.js.map +1 -0
- package/dist/browser/{style-DYS_RFSN.js → linting-Dn6pXRkK.js} +7 -14
- package/dist/browser/linting-Dn6pXRkK.js.map +1 -0
- package/dist/browser/{parser-B0sh99Kk.js → parser-CkF6Qt8V.js} +1 -1
- package/dist/browser/{parser-B0sh99Kk.js.map → parser-CkF6Qt8V.js.map} +1 -1
- package/dist/browser/{schema-context-C0GpuR27.js → schema-context-DY-GEGnY.js} +4 -4
- package/dist/browser/schema-context-DY-GEGnY.js.map +1 -0
- package/dist/browser/state-schemas-DJmzG_M8.js +308 -0
- package/dist/browser/state-schemas-DJmzG_M8.js.map +1 -0
- package/dist/node/{dist-1kPMPFPD.mjs → connect-BLC4PXD9.mjs} +13953 -11229
- package/dist/node/connect-BLC4PXD9.mjs.map +1 -0
- package/dist/node/dist-BeZaEP6S.mjs +2692 -0
- package/dist/node/dist-BeZaEP6S.mjs.map +1 -0
- package/dist/node/dist-Bm05eoTg.mjs +3769 -0
- package/dist/node/dist-Bm05eoTg.mjs.map +1 -0
- package/dist/node/{tslib.es6-DwVpIYUS.mjs → dist-Cn3iExnV.mjs} +489 -3
- package/dist/node/dist-Cn3iExnV.mjs.map +1 -0
- package/dist/node/{schemas-Cb8uEF9u.mjs → dist-fA4EItr0.mjs} +131 -2
- package/dist/node/dist-fA4EItr0.mjs.map +1 -0
- package/dist/node/{dist-Bz4SgEHs.mjs → document-drive-sM33juXr.mjs} +432 -290
- package/dist/node/document-drive-sM33juXr.mjs.map +1 -0
- package/dist/node/document-models/index.mjs +1 -1
- package/dist/node/{documents-BWJpUm9f.mjs → documents-BFBPmyw1.mjs} +3 -3
- package/dist/node/{documents-BWJpUm9f.mjs.map → documents-BFBPmyw1.mjs.map} +1 -1
- package/dist/node/{editor-W8QOlGXD.mjs → editor-BFBa9nsO.mjs} +32 -31
- package/dist/node/editor-BFBa9nsO.mjs.map +1 -0
- package/dist/node/{editor-BaXuDsby.mjs → editor-BrS98lEH.mjs} +5 -5
- package/dist/node/{editor-BaXuDsby.mjs.map → editor-BrS98lEH.mjs.map} +1 -1
- package/dist/node/editors/document-model-editor/module.mjs +1 -1
- package/dist/node/editors/generic-drive-explorer/index.mjs +6 -6
- package/dist/node/editors/generic-drive-explorer/index.mjs.map +1 -1
- package/dist/node/editors/generic-drive-explorer/module.mjs +1 -1
- package/dist/node/{folder-view-B0FNXbc0.mjs → folder-view-DHph3Yuu.mjs} +13 -12
- package/dist/node/folder-view-DHph3Yuu.mjs.map +1 -0
- package/dist/node/{graphql-Du2phcBf.mjs → graphql-DskHmkMe.mjs} +2 -2
- package/dist/node/{graphql-Du2phcBf.mjs.map → graphql-DskHmkMe.mjs.map} +1 -1
- package/dist/node/{graphql-editor-D1koK5kR.mjs → graphql-editor-CPq7oIbf.mjs} +14 -6
- package/dist/node/{graphql-editor-D1koK5kR.mjs.map → graphql-editor-CPq7oIbf.mjs.map} +1 -1
- package/dist/{browser/hooks-Beny0xpe.js → node/hooks-DJrjfVaS.mjs} +6 -4
- package/dist/node/{hooks-Lbsf6g-v.mjs.map → hooks-DJrjfVaS.mjs.map} +1 -1
- package/dist/node/index.mjs +2 -2
- package/dist/{browser/json-editor-h3cffF6X.js → node/json-editor-L32CP7TS.mjs} +12 -4
- package/dist/node/json-editor-L32CP7TS.mjs.map +1 -0
- package/dist/node/{style-CxHkfyna.mjs → linting-Dx50GuLN.mjs} +7 -14
- package/dist/node/linting-Dx50GuLN.mjs.map +1 -0
- package/dist/node/{schema-context-mLgEY1Hh.mjs → schema-context-CX5ml_9t.mjs} +4 -4
- package/dist/node/schema-context-CX5ml_9t.mjs.map +1 -0
- package/dist/node/state-schemas-XTTjQZOe.mjs +309 -0
- package/dist/node/state-schemas-XTTjQZOe.mjs.map +1 -0
- package/package.json +10 -10
- package/style.css +1 -0
- package/dist/browser/connect-CKdlDSUw.js +0 -9460
- package/dist/browser/connect-CKdlDSUw.js.map +0 -1
- package/dist/browser/dist-BXygvBtd.js +0 -132
- package/dist/browser/dist-BXygvBtd.js.map +0 -1
- package/dist/browser/dist-CC1E3l2O.js.map +0 -1
- package/dist/browser/dist-DOMEWT3x.js.map +0 -1
- package/dist/browser/dist-DQgJ8n4d.js.map +0 -1
- package/dist/browser/editor-B3yz7YdR.js.map +0 -1
- package/dist/browser/folder-view-H2ov-zId.js.map +0 -1
- package/dist/browser/json-editor-h3cffF6X.js.map +0 -1
- package/dist/browser/schema-context-C0GpuR27.js.map +0 -1
- package/dist/browser/schemas-Bqem6NRm.js.map +0 -1
- package/dist/browser/state-schemas-C5NPeV6-.js +0 -674
- package/dist/browser/state-schemas-C5NPeV6-.js.map +0 -1
- package/dist/browser/style-DYS_RFSN.js.map +0 -1
- package/dist/browser/tslib.es6-DRuVAsR8.js +0 -32
- package/dist/browser/tslib.es6-DRuVAsR8.js.map +0 -1
- package/dist/node/connect-SGvLzr5K.mjs +0 -9475
- package/dist/node/connect-SGvLzr5K.mjs.map +0 -1
- package/dist/node/dist-1kPMPFPD.mjs.map +0 -1
- package/dist/node/dist-BQTIepWC.mjs +0 -132
- package/dist/node/dist-BQTIepWC.mjs.map +0 -1
- package/dist/node/dist-Bz4SgEHs.mjs.map +0 -1
- package/dist/node/dist-Cay1iRRr.mjs +0 -491
- package/dist/node/dist-Cay1iRRr.mjs.map +0 -1
- package/dist/node/editor-W8QOlGXD.mjs.map +0 -1
- package/dist/node/folder-view-B0FNXbc0.mjs.map +0 -1
- package/dist/node/json-editor-CVGgDVh2.mjs.map +0 -1
- package/dist/node/schema-context-mLgEY1Hh.mjs.map +0 -1
- package/dist/node/schemas-Cb8uEF9u.mjs.map +0 -1
- package/dist/node/state-schemas-DAthoEEk.mjs +0 -675
- package/dist/node/state-schemas-DAthoEEk.mjs.map +0 -1
- package/dist/node/style-CxHkfyna.mjs.map +0 -1
- package/dist/node/tslib.es6-DwVpIYUS.mjs.map +0 -1
- package/dist/style.css +0 -906
|
@@ -0,0 +1,2692 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import * as ReactDOM$1 from "react-dom";
|
|
5
|
+
//#region ../../node_modules/.pnpm/tailwind-merge@3.4.0/node_modules/tailwind-merge/dist/bundle-mjs.mjs
|
|
6
|
+
/**
|
|
7
|
+
* Concatenates two arrays faster than the array spread operator.
|
|
8
|
+
*/
|
|
9
|
+
const concatArrays = (array1, array2) => {
|
|
10
|
+
const combinedArray = new Array(array1.length + array2.length);
|
|
11
|
+
for (let i = 0; i < array1.length; i++) combinedArray[i] = array1[i];
|
|
12
|
+
for (let i = 0; i < array2.length; i++) combinedArray[array1.length + i] = array2[i];
|
|
13
|
+
return combinedArray;
|
|
14
|
+
};
|
|
15
|
+
const createClassValidatorObject = (classGroupId, validator) => ({
|
|
16
|
+
classGroupId,
|
|
17
|
+
validator
|
|
18
|
+
});
|
|
19
|
+
const createClassPartObject = (nextPart = /* @__PURE__ */ new Map(), validators = null, classGroupId) => ({
|
|
20
|
+
nextPart,
|
|
21
|
+
validators,
|
|
22
|
+
classGroupId
|
|
23
|
+
});
|
|
24
|
+
const CLASS_PART_SEPARATOR = "-";
|
|
25
|
+
const EMPTY_CONFLICTS = [];
|
|
26
|
+
const ARBITRARY_PROPERTY_PREFIX = "arbitrary..";
|
|
27
|
+
const createClassGroupUtils = (config) => {
|
|
28
|
+
const classMap = createClassMap(config);
|
|
29
|
+
const { conflictingClassGroups, conflictingClassGroupModifiers } = config;
|
|
30
|
+
const getClassGroupId = (className) => {
|
|
31
|
+
if (className.startsWith("[") && className.endsWith("]")) return getGroupIdForArbitraryProperty(className);
|
|
32
|
+
const classParts = className.split(CLASS_PART_SEPARATOR);
|
|
33
|
+
return getGroupRecursive(classParts, classParts[0] === "" && classParts.length > 1 ? 1 : 0, classMap);
|
|
34
|
+
};
|
|
35
|
+
const getConflictingClassGroupIds = (classGroupId, hasPostfixModifier) => {
|
|
36
|
+
if (hasPostfixModifier) {
|
|
37
|
+
const modifierConflicts = conflictingClassGroupModifiers[classGroupId];
|
|
38
|
+
const baseConflicts = conflictingClassGroups[classGroupId];
|
|
39
|
+
if (modifierConflicts) {
|
|
40
|
+
if (baseConflicts) return concatArrays(baseConflicts, modifierConflicts);
|
|
41
|
+
return modifierConflicts;
|
|
42
|
+
}
|
|
43
|
+
return baseConflicts || EMPTY_CONFLICTS;
|
|
44
|
+
}
|
|
45
|
+
return conflictingClassGroups[classGroupId] || EMPTY_CONFLICTS;
|
|
46
|
+
};
|
|
47
|
+
return {
|
|
48
|
+
getClassGroupId,
|
|
49
|
+
getConflictingClassGroupIds
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
const getGroupRecursive = (classParts, startIndex, classPartObject) => {
|
|
53
|
+
if (classParts.length - startIndex === 0) return classPartObject.classGroupId;
|
|
54
|
+
const currentClassPart = classParts[startIndex];
|
|
55
|
+
const nextClassPartObject = classPartObject.nextPart.get(currentClassPart);
|
|
56
|
+
if (nextClassPartObject) {
|
|
57
|
+
const result = getGroupRecursive(classParts, startIndex + 1, nextClassPartObject);
|
|
58
|
+
if (result) return result;
|
|
59
|
+
}
|
|
60
|
+
const validators = classPartObject.validators;
|
|
61
|
+
if (validators === null) return;
|
|
62
|
+
const classRest = startIndex === 0 ? classParts.join(CLASS_PART_SEPARATOR) : classParts.slice(startIndex).join(CLASS_PART_SEPARATOR);
|
|
63
|
+
const validatorsLength = validators.length;
|
|
64
|
+
for (let i = 0; i < validatorsLength; i++) {
|
|
65
|
+
const validatorObj = validators[i];
|
|
66
|
+
if (validatorObj.validator(classRest)) return validatorObj.classGroupId;
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Get the class group ID for an arbitrary property.
|
|
71
|
+
*
|
|
72
|
+
* @param className - The class name to get the group ID for. Is expected to be string starting with `[` and ending with `]`.
|
|
73
|
+
*/
|
|
74
|
+
const getGroupIdForArbitraryProperty = (className) => className.slice(1, -1).indexOf(":") === -1 ? void 0 : (() => {
|
|
75
|
+
const content = className.slice(1, -1);
|
|
76
|
+
const colonIndex = content.indexOf(":");
|
|
77
|
+
const property = content.slice(0, colonIndex);
|
|
78
|
+
return property ? ARBITRARY_PROPERTY_PREFIX + property : void 0;
|
|
79
|
+
})();
|
|
80
|
+
/**
|
|
81
|
+
* Exported for testing only
|
|
82
|
+
*/
|
|
83
|
+
const createClassMap = (config) => {
|
|
84
|
+
const { theme, classGroups } = config;
|
|
85
|
+
return processClassGroups(classGroups, theme);
|
|
86
|
+
};
|
|
87
|
+
const processClassGroups = (classGroups, theme) => {
|
|
88
|
+
const classMap = createClassPartObject();
|
|
89
|
+
for (const classGroupId in classGroups) {
|
|
90
|
+
const group = classGroups[classGroupId];
|
|
91
|
+
processClassesRecursively(group, classMap, classGroupId, theme);
|
|
92
|
+
}
|
|
93
|
+
return classMap;
|
|
94
|
+
};
|
|
95
|
+
const processClassesRecursively = (classGroup, classPartObject, classGroupId, theme) => {
|
|
96
|
+
const len = classGroup.length;
|
|
97
|
+
for (let i = 0; i < len; i++) {
|
|
98
|
+
const classDefinition = classGroup[i];
|
|
99
|
+
processClassDefinition(classDefinition, classPartObject, classGroupId, theme);
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
const processClassDefinition = (classDefinition, classPartObject, classGroupId, theme) => {
|
|
103
|
+
if (typeof classDefinition === "string") {
|
|
104
|
+
processStringDefinition(classDefinition, classPartObject, classGroupId);
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
if (typeof classDefinition === "function") {
|
|
108
|
+
processFunctionDefinition(classDefinition, classPartObject, classGroupId, theme);
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
processObjectDefinition(classDefinition, classPartObject, classGroupId, theme);
|
|
112
|
+
};
|
|
113
|
+
const processStringDefinition = (classDefinition, classPartObject, classGroupId) => {
|
|
114
|
+
const classPartObjectToEdit = classDefinition === "" ? classPartObject : getPart(classPartObject, classDefinition);
|
|
115
|
+
classPartObjectToEdit.classGroupId = classGroupId;
|
|
116
|
+
};
|
|
117
|
+
const processFunctionDefinition = (classDefinition, classPartObject, classGroupId, theme) => {
|
|
118
|
+
if (isThemeGetter(classDefinition)) {
|
|
119
|
+
processClassesRecursively(classDefinition(theme), classPartObject, classGroupId, theme);
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
if (classPartObject.validators === null) classPartObject.validators = [];
|
|
123
|
+
classPartObject.validators.push(createClassValidatorObject(classGroupId, classDefinition));
|
|
124
|
+
};
|
|
125
|
+
const processObjectDefinition = (classDefinition, classPartObject, classGroupId, theme) => {
|
|
126
|
+
const entries = Object.entries(classDefinition);
|
|
127
|
+
const len = entries.length;
|
|
128
|
+
for (let i = 0; i < len; i++) {
|
|
129
|
+
const [key, value] = entries[i];
|
|
130
|
+
processClassesRecursively(value, getPart(classPartObject, key), classGroupId, theme);
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
const getPart = (classPartObject, path) => {
|
|
134
|
+
let current = classPartObject;
|
|
135
|
+
const parts = path.split(CLASS_PART_SEPARATOR);
|
|
136
|
+
const len = parts.length;
|
|
137
|
+
for (let i = 0; i < len; i++) {
|
|
138
|
+
const part = parts[i];
|
|
139
|
+
let next = current.nextPart.get(part);
|
|
140
|
+
if (!next) {
|
|
141
|
+
next = createClassPartObject();
|
|
142
|
+
current.nextPart.set(part, next);
|
|
143
|
+
}
|
|
144
|
+
current = next;
|
|
145
|
+
}
|
|
146
|
+
return current;
|
|
147
|
+
};
|
|
148
|
+
const isThemeGetter = (func) => "isThemeGetter" in func && func.isThemeGetter === true;
|
|
149
|
+
const createLruCache = (maxCacheSize) => {
|
|
150
|
+
if (maxCacheSize < 1) return {
|
|
151
|
+
get: () => void 0,
|
|
152
|
+
set: () => {}
|
|
153
|
+
};
|
|
154
|
+
let cacheSize = 0;
|
|
155
|
+
let cache = Object.create(null);
|
|
156
|
+
let previousCache = Object.create(null);
|
|
157
|
+
const update = (key, value) => {
|
|
158
|
+
cache[key] = value;
|
|
159
|
+
cacheSize++;
|
|
160
|
+
if (cacheSize > maxCacheSize) {
|
|
161
|
+
cacheSize = 0;
|
|
162
|
+
previousCache = cache;
|
|
163
|
+
cache = Object.create(null);
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
return {
|
|
167
|
+
get(key) {
|
|
168
|
+
let value = cache[key];
|
|
169
|
+
if (value !== void 0) return value;
|
|
170
|
+
if ((value = previousCache[key]) !== void 0) {
|
|
171
|
+
update(key, value);
|
|
172
|
+
return value;
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
set(key, value) {
|
|
176
|
+
if (key in cache) cache[key] = value;
|
|
177
|
+
else update(key, value);
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
const IMPORTANT_MODIFIER = "!";
|
|
182
|
+
const MODIFIER_SEPARATOR = ":";
|
|
183
|
+
const EMPTY_MODIFIERS = [];
|
|
184
|
+
const createResultObject = (modifiers, hasImportantModifier, baseClassName, maybePostfixModifierPosition, isExternal) => ({
|
|
185
|
+
modifiers,
|
|
186
|
+
hasImportantModifier,
|
|
187
|
+
baseClassName,
|
|
188
|
+
maybePostfixModifierPosition,
|
|
189
|
+
isExternal
|
|
190
|
+
});
|
|
191
|
+
const createParseClassName = (config) => {
|
|
192
|
+
const { prefix, experimentalParseClassName } = config;
|
|
193
|
+
/**
|
|
194
|
+
* Parse class name into parts.
|
|
195
|
+
*
|
|
196
|
+
* Inspired by `splitAtTopLevelOnly` used in Tailwind CSS
|
|
197
|
+
* @see https://github.com/tailwindlabs/tailwindcss/blob/v3.2.2/src/util/splitAtTopLevelOnly.js
|
|
198
|
+
*/
|
|
199
|
+
let parseClassName = (className) => {
|
|
200
|
+
const modifiers = [];
|
|
201
|
+
let bracketDepth = 0;
|
|
202
|
+
let parenDepth = 0;
|
|
203
|
+
let modifierStart = 0;
|
|
204
|
+
let postfixModifierPosition;
|
|
205
|
+
const len = className.length;
|
|
206
|
+
for (let index = 0; index < len; index++) {
|
|
207
|
+
const currentCharacter = className[index];
|
|
208
|
+
if (bracketDepth === 0 && parenDepth === 0) {
|
|
209
|
+
if (currentCharacter === MODIFIER_SEPARATOR) {
|
|
210
|
+
modifiers.push(className.slice(modifierStart, index));
|
|
211
|
+
modifierStart = index + 1;
|
|
212
|
+
continue;
|
|
213
|
+
}
|
|
214
|
+
if (currentCharacter === "/") {
|
|
215
|
+
postfixModifierPosition = index;
|
|
216
|
+
continue;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
if (currentCharacter === "[") bracketDepth++;
|
|
220
|
+
else if (currentCharacter === "]") bracketDepth--;
|
|
221
|
+
else if (currentCharacter === "(") parenDepth++;
|
|
222
|
+
else if (currentCharacter === ")") parenDepth--;
|
|
223
|
+
}
|
|
224
|
+
const baseClassNameWithImportantModifier = modifiers.length === 0 ? className : className.slice(modifierStart);
|
|
225
|
+
let baseClassName = baseClassNameWithImportantModifier;
|
|
226
|
+
let hasImportantModifier = false;
|
|
227
|
+
if (baseClassNameWithImportantModifier.endsWith(IMPORTANT_MODIFIER)) {
|
|
228
|
+
baseClassName = baseClassNameWithImportantModifier.slice(0, -1);
|
|
229
|
+
hasImportantModifier = true;
|
|
230
|
+
} else if (baseClassNameWithImportantModifier.startsWith(IMPORTANT_MODIFIER)) {
|
|
231
|
+
baseClassName = baseClassNameWithImportantModifier.slice(1);
|
|
232
|
+
hasImportantModifier = true;
|
|
233
|
+
}
|
|
234
|
+
const maybePostfixModifierPosition = postfixModifierPosition && postfixModifierPosition > modifierStart ? postfixModifierPosition - modifierStart : void 0;
|
|
235
|
+
return createResultObject(modifiers, hasImportantModifier, baseClassName, maybePostfixModifierPosition);
|
|
236
|
+
};
|
|
237
|
+
if (prefix) {
|
|
238
|
+
const fullPrefix = prefix + MODIFIER_SEPARATOR;
|
|
239
|
+
const parseClassNameOriginal = parseClassName;
|
|
240
|
+
parseClassName = (className) => className.startsWith(fullPrefix) ? parseClassNameOriginal(className.slice(fullPrefix.length)) : createResultObject(EMPTY_MODIFIERS, false, className, void 0, true);
|
|
241
|
+
}
|
|
242
|
+
if (experimentalParseClassName) {
|
|
243
|
+
const parseClassNameOriginal = parseClassName;
|
|
244
|
+
parseClassName = (className) => experimentalParseClassName({
|
|
245
|
+
className,
|
|
246
|
+
parseClassName: parseClassNameOriginal
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
return parseClassName;
|
|
250
|
+
};
|
|
251
|
+
/**
|
|
252
|
+
* Sorts modifiers according to following schema:
|
|
253
|
+
* - Predefined modifiers are sorted alphabetically
|
|
254
|
+
* - When an arbitrary variant appears, it must be preserved which modifiers are before and after it
|
|
255
|
+
*/
|
|
256
|
+
const createSortModifiers = (config) => {
|
|
257
|
+
const modifierWeights = /* @__PURE__ */ new Map();
|
|
258
|
+
config.orderSensitiveModifiers.forEach((mod, index) => {
|
|
259
|
+
modifierWeights.set(mod, 1e6 + index);
|
|
260
|
+
});
|
|
261
|
+
return (modifiers) => {
|
|
262
|
+
const result = [];
|
|
263
|
+
let currentSegment = [];
|
|
264
|
+
for (let i = 0; i < modifiers.length; i++) {
|
|
265
|
+
const modifier = modifiers[i];
|
|
266
|
+
const isArbitrary = modifier[0] === "[";
|
|
267
|
+
const isOrderSensitive = modifierWeights.has(modifier);
|
|
268
|
+
if (isArbitrary || isOrderSensitive) {
|
|
269
|
+
if (currentSegment.length > 0) {
|
|
270
|
+
currentSegment.sort();
|
|
271
|
+
result.push(...currentSegment);
|
|
272
|
+
currentSegment = [];
|
|
273
|
+
}
|
|
274
|
+
result.push(modifier);
|
|
275
|
+
} else currentSegment.push(modifier);
|
|
276
|
+
}
|
|
277
|
+
if (currentSegment.length > 0) {
|
|
278
|
+
currentSegment.sort();
|
|
279
|
+
result.push(...currentSegment);
|
|
280
|
+
}
|
|
281
|
+
return result;
|
|
282
|
+
};
|
|
283
|
+
};
|
|
284
|
+
const createConfigUtils = (config) => ({
|
|
285
|
+
cache: createLruCache(config.cacheSize),
|
|
286
|
+
parseClassName: createParseClassName(config),
|
|
287
|
+
sortModifiers: createSortModifiers(config),
|
|
288
|
+
...createClassGroupUtils(config)
|
|
289
|
+
});
|
|
290
|
+
const SPLIT_CLASSES_REGEX = /\s+/;
|
|
291
|
+
const mergeClassList = (classList, configUtils) => {
|
|
292
|
+
const { parseClassName, getClassGroupId, getConflictingClassGroupIds, sortModifiers } = configUtils;
|
|
293
|
+
/**
|
|
294
|
+
* Set of classGroupIds in following format:
|
|
295
|
+
* `{importantModifier}{variantModifiers}{classGroupId}`
|
|
296
|
+
* @example 'float'
|
|
297
|
+
* @example 'hover:focus:bg-color'
|
|
298
|
+
* @example 'md:!pr'
|
|
299
|
+
*/
|
|
300
|
+
const classGroupsInConflict = [];
|
|
301
|
+
const classNames = classList.trim().split(SPLIT_CLASSES_REGEX);
|
|
302
|
+
let result = "";
|
|
303
|
+
for (let index = classNames.length - 1; index >= 0; index -= 1) {
|
|
304
|
+
const originalClassName = classNames[index];
|
|
305
|
+
const { isExternal, modifiers, hasImportantModifier, baseClassName, maybePostfixModifierPosition } = parseClassName(originalClassName);
|
|
306
|
+
if (isExternal) {
|
|
307
|
+
result = originalClassName + (result.length > 0 ? " " + result : result);
|
|
308
|
+
continue;
|
|
309
|
+
}
|
|
310
|
+
let hasPostfixModifier = !!maybePostfixModifierPosition;
|
|
311
|
+
let classGroupId = getClassGroupId(hasPostfixModifier ? baseClassName.substring(0, maybePostfixModifierPosition) : baseClassName);
|
|
312
|
+
if (!classGroupId) {
|
|
313
|
+
if (!hasPostfixModifier) {
|
|
314
|
+
result = originalClassName + (result.length > 0 ? " " + result : result);
|
|
315
|
+
continue;
|
|
316
|
+
}
|
|
317
|
+
classGroupId = getClassGroupId(baseClassName);
|
|
318
|
+
if (!classGroupId) {
|
|
319
|
+
result = originalClassName + (result.length > 0 ? " " + result : result);
|
|
320
|
+
continue;
|
|
321
|
+
}
|
|
322
|
+
hasPostfixModifier = false;
|
|
323
|
+
}
|
|
324
|
+
const variantModifier = modifiers.length === 0 ? "" : modifiers.length === 1 ? modifiers[0] : sortModifiers(modifiers).join(":");
|
|
325
|
+
const modifierId = hasImportantModifier ? variantModifier + IMPORTANT_MODIFIER : variantModifier;
|
|
326
|
+
const classId = modifierId + classGroupId;
|
|
327
|
+
if (classGroupsInConflict.indexOf(classId) > -1) continue;
|
|
328
|
+
classGroupsInConflict.push(classId);
|
|
329
|
+
const conflictGroups = getConflictingClassGroupIds(classGroupId, hasPostfixModifier);
|
|
330
|
+
for (let i = 0; i < conflictGroups.length; ++i) {
|
|
331
|
+
const group = conflictGroups[i];
|
|
332
|
+
classGroupsInConflict.push(modifierId + group);
|
|
333
|
+
}
|
|
334
|
+
result = originalClassName + (result.length > 0 ? " " + result : result);
|
|
335
|
+
}
|
|
336
|
+
return result;
|
|
337
|
+
};
|
|
338
|
+
/**
|
|
339
|
+
* The code in this file is copied from https://github.com/lukeed/clsx and modified to suit the needs of tailwind-merge better.
|
|
340
|
+
*
|
|
341
|
+
* Specifically:
|
|
342
|
+
* - Runtime code from https://github.com/lukeed/clsx/blob/v1.2.1/src/index.js
|
|
343
|
+
* - TypeScript types from https://github.com/lukeed/clsx/blob/v1.2.1/clsx.d.ts
|
|
344
|
+
*
|
|
345
|
+
* Original code has MIT license: Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeed.com)
|
|
346
|
+
*/
|
|
347
|
+
const twJoin = (...classLists) => {
|
|
348
|
+
let index = 0;
|
|
349
|
+
let argument;
|
|
350
|
+
let resolvedValue;
|
|
351
|
+
let string = "";
|
|
352
|
+
while (index < classLists.length) if (argument = classLists[index++]) {
|
|
353
|
+
if (resolvedValue = toValue(argument)) {
|
|
354
|
+
string && (string += " ");
|
|
355
|
+
string += resolvedValue;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
return string;
|
|
359
|
+
};
|
|
360
|
+
const toValue = (mix) => {
|
|
361
|
+
if (typeof mix === "string") return mix;
|
|
362
|
+
let resolvedValue;
|
|
363
|
+
let string = "";
|
|
364
|
+
for (let k = 0; k < mix.length; k++) if (mix[k]) {
|
|
365
|
+
if (resolvedValue = toValue(mix[k])) {
|
|
366
|
+
string && (string += " ");
|
|
367
|
+
string += resolvedValue;
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
return string;
|
|
371
|
+
};
|
|
372
|
+
const createTailwindMerge = (createConfigFirst, ...createConfigRest) => {
|
|
373
|
+
let configUtils;
|
|
374
|
+
let cacheGet;
|
|
375
|
+
let cacheSet;
|
|
376
|
+
let functionToCall;
|
|
377
|
+
const initTailwindMerge = (classList) => {
|
|
378
|
+
configUtils = createConfigUtils(createConfigRest.reduce((previousConfig, createConfigCurrent) => createConfigCurrent(previousConfig), createConfigFirst()));
|
|
379
|
+
cacheGet = configUtils.cache.get;
|
|
380
|
+
cacheSet = configUtils.cache.set;
|
|
381
|
+
functionToCall = tailwindMerge;
|
|
382
|
+
return tailwindMerge(classList);
|
|
383
|
+
};
|
|
384
|
+
const tailwindMerge = (classList) => {
|
|
385
|
+
const cachedResult = cacheGet(classList);
|
|
386
|
+
if (cachedResult) return cachedResult;
|
|
387
|
+
const result = mergeClassList(classList, configUtils);
|
|
388
|
+
cacheSet(classList, result);
|
|
389
|
+
return result;
|
|
390
|
+
};
|
|
391
|
+
functionToCall = initTailwindMerge;
|
|
392
|
+
return (...args) => functionToCall(twJoin(...args));
|
|
393
|
+
};
|
|
394
|
+
const fallbackThemeArr = [];
|
|
395
|
+
const fromTheme = (key) => {
|
|
396
|
+
const themeGetter = (theme) => theme[key] || fallbackThemeArr;
|
|
397
|
+
themeGetter.isThemeGetter = true;
|
|
398
|
+
return themeGetter;
|
|
399
|
+
};
|
|
400
|
+
const arbitraryValueRegex = /^\[(?:(\w[\w-]*):)?(.+)\]$/i;
|
|
401
|
+
const arbitraryVariableRegex = /^\((?:(\w[\w-]*):)?(.+)\)$/i;
|
|
402
|
+
const fractionRegex = /^\d+\/\d+$/;
|
|
403
|
+
const tshirtUnitRegex = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/;
|
|
404
|
+
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$/;
|
|
405
|
+
const colorFunctionRegex = /^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/;
|
|
406
|
+
const shadowRegex = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/;
|
|
407
|
+
const imageRegex = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;
|
|
408
|
+
const isFraction = (value) => fractionRegex.test(value);
|
|
409
|
+
const isNumber = (value) => !!value && !Number.isNaN(Number(value));
|
|
410
|
+
const isInteger = (value) => !!value && Number.isInteger(Number(value));
|
|
411
|
+
const isPercent = (value) => value.endsWith("%") && isNumber(value.slice(0, -1));
|
|
412
|
+
const isTshirtSize = (value) => tshirtUnitRegex.test(value);
|
|
413
|
+
const isAny = () => true;
|
|
414
|
+
const isLengthOnly = (value) => lengthUnitRegex.test(value) && !colorFunctionRegex.test(value);
|
|
415
|
+
const isNever = () => false;
|
|
416
|
+
const isShadow = (value) => shadowRegex.test(value);
|
|
417
|
+
const isImage = (value) => imageRegex.test(value);
|
|
418
|
+
const isAnyNonArbitrary = (value) => !isArbitraryValue(value) && !isArbitraryVariable(value);
|
|
419
|
+
const isArbitrarySize = (value) => getIsArbitraryValue(value, isLabelSize, isNever);
|
|
420
|
+
const isArbitraryValue = (value) => arbitraryValueRegex.test(value);
|
|
421
|
+
const isArbitraryLength = (value) => getIsArbitraryValue(value, isLabelLength, isLengthOnly);
|
|
422
|
+
const isArbitraryNumber = (value) => getIsArbitraryValue(value, isLabelNumber, isNumber);
|
|
423
|
+
const isArbitraryPosition = (value) => getIsArbitraryValue(value, isLabelPosition, isNever);
|
|
424
|
+
const isArbitraryImage = (value) => getIsArbitraryValue(value, isLabelImage, isImage);
|
|
425
|
+
const isArbitraryShadow = (value) => getIsArbitraryValue(value, isLabelShadow, isShadow);
|
|
426
|
+
const isArbitraryVariable = (value) => arbitraryVariableRegex.test(value);
|
|
427
|
+
const isArbitraryVariableLength = (value) => getIsArbitraryVariable(value, isLabelLength);
|
|
428
|
+
const isArbitraryVariableFamilyName = (value) => getIsArbitraryVariable(value, isLabelFamilyName);
|
|
429
|
+
const isArbitraryVariablePosition = (value) => getIsArbitraryVariable(value, isLabelPosition);
|
|
430
|
+
const isArbitraryVariableSize = (value) => getIsArbitraryVariable(value, isLabelSize);
|
|
431
|
+
const isArbitraryVariableImage = (value) => getIsArbitraryVariable(value, isLabelImage);
|
|
432
|
+
const isArbitraryVariableShadow = (value) => getIsArbitraryVariable(value, isLabelShadow, true);
|
|
433
|
+
const getIsArbitraryValue = (value, testLabel, testValue) => {
|
|
434
|
+
const result = arbitraryValueRegex.exec(value);
|
|
435
|
+
if (result) {
|
|
436
|
+
if (result[1]) return testLabel(result[1]);
|
|
437
|
+
return testValue(result[2]);
|
|
438
|
+
}
|
|
439
|
+
return false;
|
|
440
|
+
};
|
|
441
|
+
const getIsArbitraryVariable = (value, testLabel, shouldMatchNoLabel = false) => {
|
|
442
|
+
const result = arbitraryVariableRegex.exec(value);
|
|
443
|
+
if (result) {
|
|
444
|
+
if (result[1]) return testLabel(result[1]);
|
|
445
|
+
return shouldMatchNoLabel;
|
|
446
|
+
}
|
|
447
|
+
return false;
|
|
448
|
+
};
|
|
449
|
+
const isLabelPosition = (label) => label === "position" || label === "percentage";
|
|
450
|
+
const isLabelImage = (label) => label === "image" || label === "url";
|
|
451
|
+
const isLabelSize = (label) => label === "length" || label === "size" || label === "bg-size";
|
|
452
|
+
const isLabelLength = (label) => label === "length";
|
|
453
|
+
const isLabelNumber = (label) => label === "number";
|
|
454
|
+
const isLabelFamilyName = (label) => label === "family-name";
|
|
455
|
+
const isLabelShadow = (label) => label === "shadow";
|
|
456
|
+
const getDefaultConfig = () => {
|
|
457
|
+
/**
|
|
458
|
+
* Theme getters for theme variable namespaces
|
|
459
|
+
* @see https://tailwindcss.com/docs/theme#theme-variable-namespaces
|
|
460
|
+
*/
|
|
461
|
+
const themeColor = fromTheme("color");
|
|
462
|
+
const themeFont = fromTheme("font");
|
|
463
|
+
const themeText = fromTheme("text");
|
|
464
|
+
const themeFontWeight = fromTheme("font-weight");
|
|
465
|
+
const themeTracking = fromTheme("tracking");
|
|
466
|
+
const themeLeading = fromTheme("leading");
|
|
467
|
+
const themeBreakpoint = fromTheme("breakpoint");
|
|
468
|
+
const themeContainer = fromTheme("container");
|
|
469
|
+
const themeSpacing = fromTheme("spacing");
|
|
470
|
+
const themeRadius = fromTheme("radius");
|
|
471
|
+
const themeShadow = fromTheme("shadow");
|
|
472
|
+
const themeInsetShadow = fromTheme("inset-shadow");
|
|
473
|
+
const themeTextShadow = fromTheme("text-shadow");
|
|
474
|
+
const themeDropShadow = fromTheme("drop-shadow");
|
|
475
|
+
const themeBlur = fromTheme("blur");
|
|
476
|
+
const themePerspective = fromTheme("perspective");
|
|
477
|
+
const themeAspect = fromTheme("aspect");
|
|
478
|
+
const themeEase = fromTheme("ease");
|
|
479
|
+
const themeAnimate = fromTheme("animate");
|
|
480
|
+
/**
|
|
481
|
+
* Helpers to avoid repeating the same scales
|
|
482
|
+
*
|
|
483
|
+
* We use functions that create a new array every time they're called instead of static arrays.
|
|
484
|
+
* 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.
|
|
485
|
+
*/
|
|
486
|
+
const scaleBreak = () => [
|
|
487
|
+
"auto",
|
|
488
|
+
"avoid",
|
|
489
|
+
"all",
|
|
490
|
+
"avoid-page",
|
|
491
|
+
"page",
|
|
492
|
+
"left",
|
|
493
|
+
"right",
|
|
494
|
+
"column"
|
|
495
|
+
];
|
|
496
|
+
const scalePosition = () => [
|
|
497
|
+
"center",
|
|
498
|
+
"top",
|
|
499
|
+
"bottom",
|
|
500
|
+
"left",
|
|
501
|
+
"right",
|
|
502
|
+
"top-left",
|
|
503
|
+
"left-top",
|
|
504
|
+
"top-right",
|
|
505
|
+
"right-top",
|
|
506
|
+
"bottom-right",
|
|
507
|
+
"right-bottom",
|
|
508
|
+
"bottom-left",
|
|
509
|
+
"left-bottom"
|
|
510
|
+
];
|
|
511
|
+
const scalePositionWithArbitrary = () => [
|
|
512
|
+
...scalePosition(),
|
|
513
|
+
isArbitraryVariable,
|
|
514
|
+
isArbitraryValue
|
|
515
|
+
];
|
|
516
|
+
const scaleOverflow = () => [
|
|
517
|
+
"auto",
|
|
518
|
+
"hidden",
|
|
519
|
+
"clip",
|
|
520
|
+
"visible",
|
|
521
|
+
"scroll"
|
|
522
|
+
];
|
|
523
|
+
const scaleOverscroll = () => [
|
|
524
|
+
"auto",
|
|
525
|
+
"contain",
|
|
526
|
+
"none"
|
|
527
|
+
];
|
|
528
|
+
const scaleUnambiguousSpacing = () => [
|
|
529
|
+
isArbitraryVariable,
|
|
530
|
+
isArbitraryValue,
|
|
531
|
+
themeSpacing
|
|
532
|
+
];
|
|
533
|
+
const scaleInset = () => [
|
|
534
|
+
isFraction,
|
|
535
|
+
"full",
|
|
536
|
+
"auto",
|
|
537
|
+
...scaleUnambiguousSpacing()
|
|
538
|
+
];
|
|
539
|
+
const scaleGridTemplateColsRows = () => [
|
|
540
|
+
isInteger,
|
|
541
|
+
"none",
|
|
542
|
+
"subgrid",
|
|
543
|
+
isArbitraryVariable,
|
|
544
|
+
isArbitraryValue
|
|
545
|
+
];
|
|
546
|
+
const scaleGridColRowStartAndEnd = () => [
|
|
547
|
+
"auto",
|
|
548
|
+
{ span: [
|
|
549
|
+
"full",
|
|
550
|
+
isInteger,
|
|
551
|
+
isArbitraryVariable,
|
|
552
|
+
isArbitraryValue
|
|
553
|
+
] },
|
|
554
|
+
isInteger,
|
|
555
|
+
isArbitraryVariable,
|
|
556
|
+
isArbitraryValue
|
|
557
|
+
];
|
|
558
|
+
const scaleGridColRowStartOrEnd = () => [
|
|
559
|
+
isInteger,
|
|
560
|
+
"auto",
|
|
561
|
+
isArbitraryVariable,
|
|
562
|
+
isArbitraryValue
|
|
563
|
+
];
|
|
564
|
+
const scaleGridAutoColsRows = () => [
|
|
565
|
+
"auto",
|
|
566
|
+
"min",
|
|
567
|
+
"max",
|
|
568
|
+
"fr",
|
|
569
|
+
isArbitraryVariable,
|
|
570
|
+
isArbitraryValue
|
|
571
|
+
];
|
|
572
|
+
const scaleAlignPrimaryAxis = () => [
|
|
573
|
+
"start",
|
|
574
|
+
"end",
|
|
575
|
+
"center",
|
|
576
|
+
"between",
|
|
577
|
+
"around",
|
|
578
|
+
"evenly",
|
|
579
|
+
"stretch",
|
|
580
|
+
"baseline",
|
|
581
|
+
"center-safe",
|
|
582
|
+
"end-safe"
|
|
583
|
+
];
|
|
584
|
+
const scaleAlignSecondaryAxis = () => [
|
|
585
|
+
"start",
|
|
586
|
+
"end",
|
|
587
|
+
"center",
|
|
588
|
+
"stretch",
|
|
589
|
+
"center-safe",
|
|
590
|
+
"end-safe"
|
|
591
|
+
];
|
|
592
|
+
const scaleMargin = () => ["auto", ...scaleUnambiguousSpacing()];
|
|
593
|
+
const scaleSizing = () => [
|
|
594
|
+
isFraction,
|
|
595
|
+
"auto",
|
|
596
|
+
"full",
|
|
597
|
+
"dvw",
|
|
598
|
+
"dvh",
|
|
599
|
+
"lvw",
|
|
600
|
+
"lvh",
|
|
601
|
+
"svw",
|
|
602
|
+
"svh",
|
|
603
|
+
"min",
|
|
604
|
+
"max",
|
|
605
|
+
"fit",
|
|
606
|
+
...scaleUnambiguousSpacing()
|
|
607
|
+
];
|
|
608
|
+
const scaleColor = () => [
|
|
609
|
+
themeColor,
|
|
610
|
+
isArbitraryVariable,
|
|
611
|
+
isArbitraryValue
|
|
612
|
+
];
|
|
613
|
+
const scaleBgPosition = () => [
|
|
614
|
+
...scalePosition(),
|
|
615
|
+
isArbitraryVariablePosition,
|
|
616
|
+
isArbitraryPosition,
|
|
617
|
+
{ position: [isArbitraryVariable, isArbitraryValue] }
|
|
618
|
+
];
|
|
619
|
+
const scaleBgRepeat = () => ["no-repeat", { repeat: [
|
|
620
|
+
"",
|
|
621
|
+
"x",
|
|
622
|
+
"y",
|
|
623
|
+
"space",
|
|
624
|
+
"round"
|
|
625
|
+
] }];
|
|
626
|
+
const scaleBgSize = () => [
|
|
627
|
+
"auto",
|
|
628
|
+
"cover",
|
|
629
|
+
"contain",
|
|
630
|
+
isArbitraryVariableSize,
|
|
631
|
+
isArbitrarySize,
|
|
632
|
+
{ size: [isArbitraryVariable, isArbitraryValue] }
|
|
633
|
+
];
|
|
634
|
+
const scaleGradientStopPosition = () => [
|
|
635
|
+
isPercent,
|
|
636
|
+
isArbitraryVariableLength,
|
|
637
|
+
isArbitraryLength
|
|
638
|
+
];
|
|
639
|
+
const scaleRadius = () => [
|
|
640
|
+
"",
|
|
641
|
+
"none",
|
|
642
|
+
"full",
|
|
643
|
+
themeRadius,
|
|
644
|
+
isArbitraryVariable,
|
|
645
|
+
isArbitraryValue
|
|
646
|
+
];
|
|
647
|
+
const scaleBorderWidth = () => [
|
|
648
|
+
"",
|
|
649
|
+
isNumber,
|
|
650
|
+
isArbitraryVariableLength,
|
|
651
|
+
isArbitraryLength
|
|
652
|
+
];
|
|
653
|
+
const scaleLineStyle = () => [
|
|
654
|
+
"solid",
|
|
655
|
+
"dashed",
|
|
656
|
+
"dotted",
|
|
657
|
+
"double"
|
|
658
|
+
];
|
|
659
|
+
const scaleBlendMode = () => [
|
|
660
|
+
"normal",
|
|
661
|
+
"multiply",
|
|
662
|
+
"screen",
|
|
663
|
+
"overlay",
|
|
664
|
+
"darken",
|
|
665
|
+
"lighten",
|
|
666
|
+
"color-dodge",
|
|
667
|
+
"color-burn",
|
|
668
|
+
"hard-light",
|
|
669
|
+
"soft-light",
|
|
670
|
+
"difference",
|
|
671
|
+
"exclusion",
|
|
672
|
+
"hue",
|
|
673
|
+
"saturation",
|
|
674
|
+
"color",
|
|
675
|
+
"luminosity"
|
|
676
|
+
];
|
|
677
|
+
const scaleMaskImagePosition = () => [
|
|
678
|
+
isNumber,
|
|
679
|
+
isPercent,
|
|
680
|
+
isArbitraryVariablePosition,
|
|
681
|
+
isArbitraryPosition
|
|
682
|
+
];
|
|
683
|
+
const scaleBlur = () => [
|
|
684
|
+
"",
|
|
685
|
+
"none",
|
|
686
|
+
themeBlur,
|
|
687
|
+
isArbitraryVariable,
|
|
688
|
+
isArbitraryValue
|
|
689
|
+
];
|
|
690
|
+
const scaleRotate = () => [
|
|
691
|
+
"none",
|
|
692
|
+
isNumber,
|
|
693
|
+
isArbitraryVariable,
|
|
694
|
+
isArbitraryValue
|
|
695
|
+
];
|
|
696
|
+
const scaleScale = () => [
|
|
697
|
+
"none",
|
|
698
|
+
isNumber,
|
|
699
|
+
isArbitraryVariable,
|
|
700
|
+
isArbitraryValue
|
|
701
|
+
];
|
|
702
|
+
const scaleSkew = () => [
|
|
703
|
+
isNumber,
|
|
704
|
+
isArbitraryVariable,
|
|
705
|
+
isArbitraryValue
|
|
706
|
+
];
|
|
707
|
+
const scaleTranslate = () => [
|
|
708
|
+
isFraction,
|
|
709
|
+
"full",
|
|
710
|
+
...scaleUnambiguousSpacing()
|
|
711
|
+
];
|
|
712
|
+
return {
|
|
713
|
+
cacheSize: 500,
|
|
714
|
+
theme: {
|
|
715
|
+
animate: [
|
|
716
|
+
"spin",
|
|
717
|
+
"ping",
|
|
718
|
+
"pulse",
|
|
719
|
+
"bounce"
|
|
720
|
+
],
|
|
721
|
+
aspect: ["video"],
|
|
722
|
+
blur: [isTshirtSize],
|
|
723
|
+
breakpoint: [isTshirtSize],
|
|
724
|
+
color: [isAny],
|
|
725
|
+
container: [isTshirtSize],
|
|
726
|
+
"drop-shadow": [isTshirtSize],
|
|
727
|
+
ease: [
|
|
728
|
+
"in",
|
|
729
|
+
"out",
|
|
730
|
+
"in-out"
|
|
731
|
+
],
|
|
732
|
+
font: [isAnyNonArbitrary],
|
|
733
|
+
"font-weight": [
|
|
734
|
+
"thin",
|
|
735
|
+
"extralight",
|
|
736
|
+
"light",
|
|
737
|
+
"normal",
|
|
738
|
+
"medium",
|
|
739
|
+
"semibold",
|
|
740
|
+
"bold",
|
|
741
|
+
"extrabold",
|
|
742
|
+
"black"
|
|
743
|
+
],
|
|
744
|
+
"inset-shadow": [isTshirtSize],
|
|
745
|
+
leading: [
|
|
746
|
+
"none",
|
|
747
|
+
"tight",
|
|
748
|
+
"snug",
|
|
749
|
+
"normal",
|
|
750
|
+
"relaxed",
|
|
751
|
+
"loose"
|
|
752
|
+
],
|
|
753
|
+
perspective: [
|
|
754
|
+
"dramatic",
|
|
755
|
+
"near",
|
|
756
|
+
"normal",
|
|
757
|
+
"midrange",
|
|
758
|
+
"distant",
|
|
759
|
+
"none"
|
|
760
|
+
],
|
|
761
|
+
radius: [isTshirtSize],
|
|
762
|
+
shadow: [isTshirtSize],
|
|
763
|
+
spacing: ["px", isNumber],
|
|
764
|
+
text: [isTshirtSize],
|
|
765
|
+
"text-shadow": [isTshirtSize],
|
|
766
|
+
tracking: [
|
|
767
|
+
"tighter",
|
|
768
|
+
"tight",
|
|
769
|
+
"normal",
|
|
770
|
+
"wide",
|
|
771
|
+
"wider",
|
|
772
|
+
"widest"
|
|
773
|
+
]
|
|
774
|
+
},
|
|
775
|
+
classGroups: {
|
|
776
|
+
aspect: [{ aspect: [
|
|
777
|
+
"auto",
|
|
778
|
+
"square",
|
|
779
|
+
isFraction,
|
|
780
|
+
isArbitraryValue,
|
|
781
|
+
isArbitraryVariable,
|
|
782
|
+
themeAspect
|
|
783
|
+
] }],
|
|
784
|
+
container: ["container"],
|
|
785
|
+
columns: [{ columns: [
|
|
786
|
+
isNumber,
|
|
787
|
+
isArbitraryValue,
|
|
788
|
+
isArbitraryVariable,
|
|
789
|
+
themeContainer
|
|
790
|
+
] }],
|
|
791
|
+
"break-after": [{ "break-after": scaleBreak() }],
|
|
792
|
+
"break-before": [{ "break-before": scaleBreak() }],
|
|
793
|
+
"break-inside": [{ "break-inside": [
|
|
794
|
+
"auto",
|
|
795
|
+
"avoid",
|
|
796
|
+
"avoid-page",
|
|
797
|
+
"avoid-column"
|
|
798
|
+
] }],
|
|
799
|
+
"box-decoration": [{ "box-decoration": ["slice", "clone"] }],
|
|
800
|
+
box: [{ box: ["border", "content"] }],
|
|
801
|
+
display: [
|
|
802
|
+
"block",
|
|
803
|
+
"inline-block",
|
|
804
|
+
"inline",
|
|
805
|
+
"flex",
|
|
806
|
+
"inline-flex",
|
|
807
|
+
"table",
|
|
808
|
+
"inline-table",
|
|
809
|
+
"table-caption",
|
|
810
|
+
"table-cell",
|
|
811
|
+
"table-column",
|
|
812
|
+
"table-column-group",
|
|
813
|
+
"table-footer-group",
|
|
814
|
+
"table-header-group",
|
|
815
|
+
"table-row-group",
|
|
816
|
+
"table-row",
|
|
817
|
+
"flow-root",
|
|
818
|
+
"grid",
|
|
819
|
+
"inline-grid",
|
|
820
|
+
"contents",
|
|
821
|
+
"list-item",
|
|
822
|
+
"hidden"
|
|
823
|
+
],
|
|
824
|
+
sr: ["sr-only", "not-sr-only"],
|
|
825
|
+
float: [{ float: [
|
|
826
|
+
"right",
|
|
827
|
+
"left",
|
|
828
|
+
"none",
|
|
829
|
+
"start",
|
|
830
|
+
"end"
|
|
831
|
+
] }],
|
|
832
|
+
clear: [{ clear: [
|
|
833
|
+
"left",
|
|
834
|
+
"right",
|
|
835
|
+
"both",
|
|
836
|
+
"none",
|
|
837
|
+
"start",
|
|
838
|
+
"end"
|
|
839
|
+
] }],
|
|
840
|
+
isolation: ["isolate", "isolation-auto"],
|
|
841
|
+
"object-fit": [{ object: [
|
|
842
|
+
"contain",
|
|
843
|
+
"cover",
|
|
844
|
+
"fill",
|
|
845
|
+
"none",
|
|
846
|
+
"scale-down"
|
|
847
|
+
] }],
|
|
848
|
+
"object-position": [{ object: scalePositionWithArbitrary() }],
|
|
849
|
+
overflow: [{ overflow: scaleOverflow() }],
|
|
850
|
+
"overflow-x": [{ "overflow-x": scaleOverflow() }],
|
|
851
|
+
"overflow-y": [{ "overflow-y": scaleOverflow() }],
|
|
852
|
+
overscroll: [{ overscroll: scaleOverscroll() }],
|
|
853
|
+
"overscroll-x": [{ "overscroll-x": scaleOverscroll() }],
|
|
854
|
+
"overscroll-y": [{ "overscroll-y": scaleOverscroll() }],
|
|
855
|
+
position: [
|
|
856
|
+
"static",
|
|
857
|
+
"fixed",
|
|
858
|
+
"absolute",
|
|
859
|
+
"relative",
|
|
860
|
+
"sticky"
|
|
861
|
+
],
|
|
862
|
+
inset: [{ inset: scaleInset() }],
|
|
863
|
+
"inset-x": [{ "inset-x": scaleInset() }],
|
|
864
|
+
"inset-y": [{ "inset-y": scaleInset() }],
|
|
865
|
+
start: [{ start: scaleInset() }],
|
|
866
|
+
end: [{ end: scaleInset() }],
|
|
867
|
+
top: [{ top: scaleInset() }],
|
|
868
|
+
right: [{ right: scaleInset() }],
|
|
869
|
+
bottom: [{ bottom: scaleInset() }],
|
|
870
|
+
left: [{ left: scaleInset() }],
|
|
871
|
+
visibility: [
|
|
872
|
+
"visible",
|
|
873
|
+
"invisible",
|
|
874
|
+
"collapse"
|
|
875
|
+
],
|
|
876
|
+
z: [{ z: [
|
|
877
|
+
isInteger,
|
|
878
|
+
"auto",
|
|
879
|
+
isArbitraryVariable,
|
|
880
|
+
isArbitraryValue
|
|
881
|
+
] }],
|
|
882
|
+
basis: [{ basis: [
|
|
883
|
+
isFraction,
|
|
884
|
+
"full",
|
|
885
|
+
"auto",
|
|
886
|
+
themeContainer,
|
|
887
|
+
...scaleUnambiguousSpacing()
|
|
888
|
+
] }],
|
|
889
|
+
"flex-direction": [{ flex: [
|
|
890
|
+
"row",
|
|
891
|
+
"row-reverse",
|
|
892
|
+
"col",
|
|
893
|
+
"col-reverse"
|
|
894
|
+
] }],
|
|
895
|
+
"flex-wrap": [{ flex: [
|
|
896
|
+
"nowrap",
|
|
897
|
+
"wrap",
|
|
898
|
+
"wrap-reverse"
|
|
899
|
+
] }],
|
|
900
|
+
flex: [{ flex: [
|
|
901
|
+
isNumber,
|
|
902
|
+
isFraction,
|
|
903
|
+
"auto",
|
|
904
|
+
"initial",
|
|
905
|
+
"none",
|
|
906
|
+
isArbitraryValue
|
|
907
|
+
] }],
|
|
908
|
+
grow: [{ grow: [
|
|
909
|
+
"",
|
|
910
|
+
isNumber,
|
|
911
|
+
isArbitraryVariable,
|
|
912
|
+
isArbitraryValue
|
|
913
|
+
] }],
|
|
914
|
+
shrink: [{ shrink: [
|
|
915
|
+
"",
|
|
916
|
+
isNumber,
|
|
917
|
+
isArbitraryVariable,
|
|
918
|
+
isArbitraryValue
|
|
919
|
+
] }],
|
|
920
|
+
order: [{ order: [
|
|
921
|
+
isInteger,
|
|
922
|
+
"first",
|
|
923
|
+
"last",
|
|
924
|
+
"none",
|
|
925
|
+
isArbitraryVariable,
|
|
926
|
+
isArbitraryValue
|
|
927
|
+
] }],
|
|
928
|
+
"grid-cols": [{ "grid-cols": scaleGridTemplateColsRows() }],
|
|
929
|
+
"col-start-end": [{ col: scaleGridColRowStartAndEnd() }],
|
|
930
|
+
"col-start": [{ "col-start": scaleGridColRowStartOrEnd() }],
|
|
931
|
+
"col-end": [{ "col-end": scaleGridColRowStartOrEnd() }],
|
|
932
|
+
"grid-rows": [{ "grid-rows": scaleGridTemplateColsRows() }],
|
|
933
|
+
"row-start-end": [{ row: scaleGridColRowStartAndEnd() }],
|
|
934
|
+
"row-start": [{ "row-start": scaleGridColRowStartOrEnd() }],
|
|
935
|
+
"row-end": [{ "row-end": scaleGridColRowStartOrEnd() }],
|
|
936
|
+
"grid-flow": [{ "grid-flow": [
|
|
937
|
+
"row",
|
|
938
|
+
"col",
|
|
939
|
+
"dense",
|
|
940
|
+
"row-dense",
|
|
941
|
+
"col-dense"
|
|
942
|
+
] }],
|
|
943
|
+
"auto-cols": [{ "auto-cols": scaleGridAutoColsRows() }],
|
|
944
|
+
"auto-rows": [{ "auto-rows": scaleGridAutoColsRows() }],
|
|
945
|
+
gap: [{ gap: scaleUnambiguousSpacing() }],
|
|
946
|
+
"gap-x": [{ "gap-x": scaleUnambiguousSpacing() }],
|
|
947
|
+
"gap-y": [{ "gap-y": scaleUnambiguousSpacing() }],
|
|
948
|
+
"justify-content": [{ justify: [...scaleAlignPrimaryAxis(), "normal"] }],
|
|
949
|
+
"justify-items": [{ "justify-items": [...scaleAlignSecondaryAxis(), "normal"] }],
|
|
950
|
+
"justify-self": [{ "justify-self": ["auto", ...scaleAlignSecondaryAxis()] }],
|
|
951
|
+
"align-content": [{ content: ["normal", ...scaleAlignPrimaryAxis()] }],
|
|
952
|
+
"align-items": [{ items: [...scaleAlignSecondaryAxis(), { baseline: ["", "last"] }] }],
|
|
953
|
+
"align-self": [{ self: [
|
|
954
|
+
"auto",
|
|
955
|
+
...scaleAlignSecondaryAxis(),
|
|
956
|
+
{ baseline: ["", "last"] }
|
|
957
|
+
] }],
|
|
958
|
+
"place-content": [{ "place-content": scaleAlignPrimaryAxis() }],
|
|
959
|
+
"place-items": [{ "place-items": [...scaleAlignSecondaryAxis(), "baseline"] }],
|
|
960
|
+
"place-self": [{ "place-self": ["auto", ...scaleAlignSecondaryAxis()] }],
|
|
961
|
+
p: [{ p: scaleUnambiguousSpacing() }],
|
|
962
|
+
px: [{ px: scaleUnambiguousSpacing() }],
|
|
963
|
+
py: [{ py: scaleUnambiguousSpacing() }],
|
|
964
|
+
ps: [{ ps: scaleUnambiguousSpacing() }],
|
|
965
|
+
pe: [{ pe: scaleUnambiguousSpacing() }],
|
|
966
|
+
pt: [{ pt: scaleUnambiguousSpacing() }],
|
|
967
|
+
pr: [{ pr: scaleUnambiguousSpacing() }],
|
|
968
|
+
pb: [{ pb: scaleUnambiguousSpacing() }],
|
|
969
|
+
pl: [{ pl: scaleUnambiguousSpacing() }],
|
|
970
|
+
m: [{ m: scaleMargin() }],
|
|
971
|
+
mx: [{ mx: scaleMargin() }],
|
|
972
|
+
my: [{ my: scaleMargin() }],
|
|
973
|
+
ms: [{ ms: scaleMargin() }],
|
|
974
|
+
me: [{ me: scaleMargin() }],
|
|
975
|
+
mt: [{ mt: scaleMargin() }],
|
|
976
|
+
mr: [{ mr: scaleMargin() }],
|
|
977
|
+
mb: [{ mb: scaleMargin() }],
|
|
978
|
+
ml: [{ ml: scaleMargin() }],
|
|
979
|
+
"space-x": [{ "space-x": scaleUnambiguousSpacing() }],
|
|
980
|
+
"space-x-reverse": ["space-x-reverse"],
|
|
981
|
+
"space-y": [{ "space-y": scaleUnambiguousSpacing() }],
|
|
982
|
+
"space-y-reverse": ["space-y-reverse"],
|
|
983
|
+
size: [{ size: scaleSizing() }],
|
|
984
|
+
w: [{ w: [
|
|
985
|
+
themeContainer,
|
|
986
|
+
"screen",
|
|
987
|
+
...scaleSizing()
|
|
988
|
+
] }],
|
|
989
|
+
"min-w": [{ "min-w": [
|
|
990
|
+
themeContainer,
|
|
991
|
+
"screen",
|
|
992
|
+
"none",
|
|
993
|
+
...scaleSizing()
|
|
994
|
+
] }],
|
|
995
|
+
"max-w": [{ "max-w": [
|
|
996
|
+
themeContainer,
|
|
997
|
+
"screen",
|
|
998
|
+
"none",
|
|
999
|
+
"prose",
|
|
1000
|
+
{ screen: [themeBreakpoint] },
|
|
1001
|
+
...scaleSizing()
|
|
1002
|
+
] }],
|
|
1003
|
+
h: [{ h: [
|
|
1004
|
+
"screen",
|
|
1005
|
+
"lh",
|
|
1006
|
+
...scaleSizing()
|
|
1007
|
+
] }],
|
|
1008
|
+
"min-h": [{ "min-h": [
|
|
1009
|
+
"screen",
|
|
1010
|
+
"lh",
|
|
1011
|
+
"none",
|
|
1012
|
+
...scaleSizing()
|
|
1013
|
+
] }],
|
|
1014
|
+
"max-h": [{ "max-h": [
|
|
1015
|
+
"screen",
|
|
1016
|
+
"lh",
|
|
1017
|
+
...scaleSizing()
|
|
1018
|
+
] }],
|
|
1019
|
+
"font-size": [{ text: [
|
|
1020
|
+
"base",
|
|
1021
|
+
themeText,
|
|
1022
|
+
isArbitraryVariableLength,
|
|
1023
|
+
isArbitraryLength
|
|
1024
|
+
] }],
|
|
1025
|
+
"font-smoothing": ["antialiased", "subpixel-antialiased"],
|
|
1026
|
+
"font-style": ["italic", "not-italic"],
|
|
1027
|
+
"font-weight": [{ font: [
|
|
1028
|
+
themeFontWeight,
|
|
1029
|
+
isArbitraryVariable,
|
|
1030
|
+
isArbitraryNumber
|
|
1031
|
+
] }],
|
|
1032
|
+
"font-stretch": [{ "font-stretch": [
|
|
1033
|
+
"ultra-condensed",
|
|
1034
|
+
"extra-condensed",
|
|
1035
|
+
"condensed",
|
|
1036
|
+
"semi-condensed",
|
|
1037
|
+
"normal",
|
|
1038
|
+
"semi-expanded",
|
|
1039
|
+
"expanded",
|
|
1040
|
+
"extra-expanded",
|
|
1041
|
+
"ultra-expanded",
|
|
1042
|
+
isPercent,
|
|
1043
|
+
isArbitraryValue
|
|
1044
|
+
] }],
|
|
1045
|
+
"font-family": [{ font: [
|
|
1046
|
+
isArbitraryVariableFamilyName,
|
|
1047
|
+
isArbitraryValue,
|
|
1048
|
+
themeFont
|
|
1049
|
+
] }],
|
|
1050
|
+
"fvn-normal": ["normal-nums"],
|
|
1051
|
+
"fvn-ordinal": ["ordinal"],
|
|
1052
|
+
"fvn-slashed-zero": ["slashed-zero"],
|
|
1053
|
+
"fvn-figure": ["lining-nums", "oldstyle-nums"],
|
|
1054
|
+
"fvn-spacing": ["proportional-nums", "tabular-nums"],
|
|
1055
|
+
"fvn-fraction": ["diagonal-fractions", "stacked-fractions"],
|
|
1056
|
+
tracking: [{ tracking: [
|
|
1057
|
+
themeTracking,
|
|
1058
|
+
isArbitraryVariable,
|
|
1059
|
+
isArbitraryValue
|
|
1060
|
+
] }],
|
|
1061
|
+
"line-clamp": [{ "line-clamp": [
|
|
1062
|
+
isNumber,
|
|
1063
|
+
"none",
|
|
1064
|
+
isArbitraryVariable,
|
|
1065
|
+
isArbitraryNumber
|
|
1066
|
+
] }],
|
|
1067
|
+
leading: [{ leading: [themeLeading, ...scaleUnambiguousSpacing()] }],
|
|
1068
|
+
"list-image": [{ "list-image": [
|
|
1069
|
+
"none",
|
|
1070
|
+
isArbitraryVariable,
|
|
1071
|
+
isArbitraryValue
|
|
1072
|
+
] }],
|
|
1073
|
+
"list-style-position": [{ list: ["inside", "outside"] }],
|
|
1074
|
+
"list-style-type": [{ list: [
|
|
1075
|
+
"disc",
|
|
1076
|
+
"decimal",
|
|
1077
|
+
"none",
|
|
1078
|
+
isArbitraryVariable,
|
|
1079
|
+
isArbitraryValue
|
|
1080
|
+
] }],
|
|
1081
|
+
"text-alignment": [{ text: [
|
|
1082
|
+
"left",
|
|
1083
|
+
"center",
|
|
1084
|
+
"right",
|
|
1085
|
+
"justify",
|
|
1086
|
+
"start",
|
|
1087
|
+
"end"
|
|
1088
|
+
] }],
|
|
1089
|
+
"placeholder-color": [{ placeholder: scaleColor() }],
|
|
1090
|
+
"text-color": [{ text: scaleColor() }],
|
|
1091
|
+
"text-decoration": [
|
|
1092
|
+
"underline",
|
|
1093
|
+
"overline",
|
|
1094
|
+
"line-through",
|
|
1095
|
+
"no-underline"
|
|
1096
|
+
],
|
|
1097
|
+
"text-decoration-style": [{ decoration: [...scaleLineStyle(), "wavy"] }],
|
|
1098
|
+
"text-decoration-thickness": [{ decoration: [
|
|
1099
|
+
isNumber,
|
|
1100
|
+
"from-font",
|
|
1101
|
+
"auto",
|
|
1102
|
+
isArbitraryVariable,
|
|
1103
|
+
isArbitraryLength
|
|
1104
|
+
] }],
|
|
1105
|
+
"text-decoration-color": [{ decoration: scaleColor() }],
|
|
1106
|
+
"underline-offset": [{ "underline-offset": [
|
|
1107
|
+
isNumber,
|
|
1108
|
+
"auto",
|
|
1109
|
+
isArbitraryVariable,
|
|
1110
|
+
isArbitraryValue
|
|
1111
|
+
] }],
|
|
1112
|
+
"text-transform": [
|
|
1113
|
+
"uppercase",
|
|
1114
|
+
"lowercase",
|
|
1115
|
+
"capitalize",
|
|
1116
|
+
"normal-case"
|
|
1117
|
+
],
|
|
1118
|
+
"text-overflow": [
|
|
1119
|
+
"truncate",
|
|
1120
|
+
"text-ellipsis",
|
|
1121
|
+
"text-clip"
|
|
1122
|
+
],
|
|
1123
|
+
"text-wrap": [{ text: [
|
|
1124
|
+
"wrap",
|
|
1125
|
+
"nowrap",
|
|
1126
|
+
"balance",
|
|
1127
|
+
"pretty"
|
|
1128
|
+
] }],
|
|
1129
|
+
indent: [{ indent: scaleUnambiguousSpacing() }],
|
|
1130
|
+
"vertical-align": [{ align: [
|
|
1131
|
+
"baseline",
|
|
1132
|
+
"top",
|
|
1133
|
+
"middle",
|
|
1134
|
+
"bottom",
|
|
1135
|
+
"text-top",
|
|
1136
|
+
"text-bottom",
|
|
1137
|
+
"sub",
|
|
1138
|
+
"super",
|
|
1139
|
+
isArbitraryVariable,
|
|
1140
|
+
isArbitraryValue
|
|
1141
|
+
] }],
|
|
1142
|
+
whitespace: [{ whitespace: [
|
|
1143
|
+
"normal",
|
|
1144
|
+
"nowrap",
|
|
1145
|
+
"pre",
|
|
1146
|
+
"pre-line",
|
|
1147
|
+
"pre-wrap",
|
|
1148
|
+
"break-spaces"
|
|
1149
|
+
] }],
|
|
1150
|
+
break: [{ break: [
|
|
1151
|
+
"normal",
|
|
1152
|
+
"words",
|
|
1153
|
+
"all",
|
|
1154
|
+
"keep"
|
|
1155
|
+
] }],
|
|
1156
|
+
wrap: [{ wrap: [
|
|
1157
|
+
"break-word",
|
|
1158
|
+
"anywhere",
|
|
1159
|
+
"normal"
|
|
1160
|
+
] }],
|
|
1161
|
+
hyphens: [{ hyphens: [
|
|
1162
|
+
"none",
|
|
1163
|
+
"manual",
|
|
1164
|
+
"auto"
|
|
1165
|
+
] }],
|
|
1166
|
+
content: [{ content: [
|
|
1167
|
+
"none",
|
|
1168
|
+
isArbitraryVariable,
|
|
1169
|
+
isArbitraryValue
|
|
1170
|
+
] }],
|
|
1171
|
+
"bg-attachment": [{ bg: [
|
|
1172
|
+
"fixed",
|
|
1173
|
+
"local",
|
|
1174
|
+
"scroll"
|
|
1175
|
+
] }],
|
|
1176
|
+
"bg-clip": [{ "bg-clip": [
|
|
1177
|
+
"border",
|
|
1178
|
+
"padding",
|
|
1179
|
+
"content",
|
|
1180
|
+
"text"
|
|
1181
|
+
] }],
|
|
1182
|
+
"bg-origin": [{ "bg-origin": [
|
|
1183
|
+
"border",
|
|
1184
|
+
"padding",
|
|
1185
|
+
"content"
|
|
1186
|
+
] }],
|
|
1187
|
+
"bg-position": [{ bg: scaleBgPosition() }],
|
|
1188
|
+
"bg-repeat": [{ bg: scaleBgRepeat() }],
|
|
1189
|
+
"bg-size": [{ bg: scaleBgSize() }],
|
|
1190
|
+
"bg-image": [{ bg: [
|
|
1191
|
+
"none",
|
|
1192
|
+
{
|
|
1193
|
+
linear: [
|
|
1194
|
+
{ to: [
|
|
1195
|
+
"t",
|
|
1196
|
+
"tr",
|
|
1197
|
+
"r",
|
|
1198
|
+
"br",
|
|
1199
|
+
"b",
|
|
1200
|
+
"bl",
|
|
1201
|
+
"l",
|
|
1202
|
+
"tl"
|
|
1203
|
+
] },
|
|
1204
|
+
isInteger,
|
|
1205
|
+
isArbitraryVariable,
|
|
1206
|
+
isArbitraryValue
|
|
1207
|
+
],
|
|
1208
|
+
radial: [
|
|
1209
|
+
"",
|
|
1210
|
+
isArbitraryVariable,
|
|
1211
|
+
isArbitraryValue
|
|
1212
|
+
],
|
|
1213
|
+
conic: [
|
|
1214
|
+
isInteger,
|
|
1215
|
+
isArbitraryVariable,
|
|
1216
|
+
isArbitraryValue
|
|
1217
|
+
]
|
|
1218
|
+
},
|
|
1219
|
+
isArbitraryVariableImage,
|
|
1220
|
+
isArbitraryImage
|
|
1221
|
+
] }],
|
|
1222
|
+
"bg-color": [{ bg: scaleColor() }],
|
|
1223
|
+
"gradient-from-pos": [{ from: scaleGradientStopPosition() }],
|
|
1224
|
+
"gradient-via-pos": [{ via: scaleGradientStopPosition() }],
|
|
1225
|
+
"gradient-to-pos": [{ to: scaleGradientStopPosition() }],
|
|
1226
|
+
"gradient-from": [{ from: scaleColor() }],
|
|
1227
|
+
"gradient-via": [{ via: scaleColor() }],
|
|
1228
|
+
"gradient-to": [{ to: scaleColor() }],
|
|
1229
|
+
rounded: [{ rounded: scaleRadius() }],
|
|
1230
|
+
"rounded-s": [{ "rounded-s": scaleRadius() }],
|
|
1231
|
+
"rounded-e": [{ "rounded-e": scaleRadius() }],
|
|
1232
|
+
"rounded-t": [{ "rounded-t": scaleRadius() }],
|
|
1233
|
+
"rounded-r": [{ "rounded-r": scaleRadius() }],
|
|
1234
|
+
"rounded-b": [{ "rounded-b": scaleRadius() }],
|
|
1235
|
+
"rounded-l": [{ "rounded-l": scaleRadius() }],
|
|
1236
|
+
"rounded-ss": [{ "rounded-ss": scaleRadius() }],
|
|
1237
|
+
"rounded-se": [{ "rounded-se": scaleRadius() }],
|
|
1238
|
+
"rounded-ee": [{ "rounded-ee": scaleRadius() }],
|
|
1239
|
+
"rounded-es": [{ "rounded-es": scaleRadius() }],
|
|
1240
|
+
"rounded-tl": [{ "rounded-tl": scaleRadius() }],
|
|
1241
|
+
"rounded-tr": [{ "rounded-tr": scaleRadius() }],
|
|
1242
|
+
"rounded-br": [{ "rounded-br": scaleRadius() }],
|
|
1243
|
+
"rounded-bl": [{ "rounded-bl": scaleRadius() }],
|
|
1244
|
+
"border-w": [{ border: scaleBorderWidth() }],
|
|
1245
|
+
"border-w-x": [{ "border-x": scaleBorderWidth() }],
|
|
1246
|
+
"border-w-y": [{ "border-y": scaleBorderWidth() }],
|
|
1247
|
+
"border-w-s": [{ "border-s": scaleBorderWidth() }],
|
|
1248
|
+
"border-w-e": [{ "border-e": scaleBorderWidth() }],
|
|
1249
|
+
"border-w-t": [{ "border-t": scaleBorderWidth() }],
|
|
1250
|
+
"border-w-r": [{ "border-r": scaleBorderWidth() }],
|
|
1251
|
+
"border-w-b": [{ "border-b": scaleBorderWidth() }],
|
|
1252
|
+
"border-w-l": [{ "border-l": scaleBorderWidth() }],
|
|
1253
|
+
"divide-x": [{ "divide-x": scaleBorderWidth() }],
|
|
1254
|
+
"divide-x-reverse": ["divide-x-reverse"],
|
|
1255
|
+
"divide-y": [{ "divide-y": scaleBorderWidth() }],
|
|
1256
|
+
"divide-y-reverse": ["divide-y-reverse"],
|
|
1257
|
+
"border-style": [{ border: [
|
|
1258
|
+
...scaleLineStyle(),
|
|
1259
|
+
"hidden",
|
|
1260
|
+
"none"
|
|
1261
|
+
] }],
|
|
1262
|
+
"divide-style": [{ divide: [
|
|
1263
|
+
...scaleLineStyle(),
|
|
1264
|
+
"hidden",
|
|
1265
|
+
"none"
|
|
1266
|
+
] }],
|
|
1267
|
+
"border-color": [{ border: scaleColor() }],
|
|
1268
|
+
"border-color-x": [{ "border-x": scaleColor() }],
|
|
1269
|
+
"border-color-y": [{ "border-y": scaleColor() }],
|
|
1270
|
+
"border-color-s": [{ "border-s": scaleColor() }],
|
|
1271
|
+
"border-color-e": [{ "border-e": scaleColor() }],
|
|
1272
|
+
"border-color-t": [{ "border-t": scaleColor() }],
|
|
1273
|
+
"border-color-r": [{ "border-r": scaleColor() }],
|
|
1274
|
+
"border-color-b": [{ "border-b": scaleColor() }],
|
|
1275
|
+
"border-color-l": [{ "border-l": scaleColor() }],
|
|
1276
|
+
"divide-color": [{ divide: scaleColor() }],
|
|
1277
|
+
"outline-style": [{ outline: [
|
|
1278
|
+
...scaleLineStyle(),
|
|
1279
|
+
"none",
|
|
1280
|
+
"hidden"
|
|
1281
|
+
] }],
|
|
1282
|
+
"outline-offset": [{ "outline-offset": [
|
|
1283
|
+
isNumber,
|
|
1284
|
+
isArbitraryVariable,
|
|
1285
|
+
isArbitraryValue
|
|
1286
|
+
] }],
|
|
1287
|
+
"outline-w": [{ outline: [
|
|
1288
|
+
"",
|
|
1289
|
+
isNumber,
|
|
1290
|
+
isArbitraryVariableLength,
|
|
1291
|
+
isArbitraryLength
|
|
1292
|
+
] }],
|
|
1293
|
+
"outline-color": [{ outline: scaleColor() }],
|
|
1294
|
+
shadow: [{ shadow: [
|
|
1295
|
+
"",
|
|
1296
|
+
"none",
|
|
1297
|
+
themeShadow,
|
|
1298
|
+
isArbitraryVariableShadow,
|
|
1299
|
+
isArbitraryShadow
|
|
1300
|
+
] }],
|
|
1301
|
+
"shadow-color": [{ shadow: scaleColor() }],
|
|
1302
|
+
"inset-shadow": [{ "inset-shadow": [
|
|
1303
|
+
"none",
|
|
1304
|
+
themeInsetShadow,
|
|
1305
|
+
isArbitraryVariableShadow,
|
|
1306
|
+
isArbitraryShadow
|
|
1307
|
+
] }],
|
|
1308
|
+
"inset-shadow-color": [{ "inset-shadow": scaleColor() }],
|
|
1309
|
+
"ring-w": [{ ring: scaleBorderWidth() }],
|
|
1310
|
+
"ring-w-inset": ["ring-inset"],
|
|
1311
|
+
"ring-color": [{ ring: scaleColor() }],
|
|
1312
|
+
"ring-offset-w": [{ "ring-offset": [isNumber, isArbitraryLength] }],
|
|
1313
|
+
"ring-offset-color": [{ "ring-offset": scaleColor() }],
|
|
1314
|
+
"inset-ring-w": [{ "inset-ring": scaleBorderWidth() }],
|
|
1315
|
+
"inset-ring-color": [{ "inset-ring": scaleColor() }],
|
|
1316
|
+
"text-shadow": [{ "text-shadow": [
|
|
1317
|
+
"none",
|
|
1318
|
+
themeTextShadow,
|
|
1319
|
+
isArbitraryVariableShadow,
|
|
1320
|
+
isArbitraryShadow
|
|
1321
|
+
] }],
|
|
1322
|
+
"text-shadow-color": [{ "text-shadow": scaleColor() }],
|
|
1323
|
+
opacity: [{ opacity: [
|
|
1324
|
+
isNumber,
|
|
1325
|
+
isArbitraryVariable,
|
|
1326
|
+
isArbitraryValue
|
|
1327
|
+
] }],
|
|
1328
|
+
"mix-blend": [{ "mix-blend": [
|
|
1329
|
+
...scaleBlendMode(),
|
|
1330
|
+
"plus-darker",
|
|
1331
|
+
"plus-lighter"
|
|
1332
|
+
] }],
|
|
1333
|
+
"bg-blend": [{ "bg-blend": scaleBlendMode() }],
|
|
1334
|
+
"mask-clip": [{ "mask-clip": [
|
|
1335
|
+
"border",
|
|
1336
|
+
"padding",
|
|
1337
|
+
"content",
|
|
1338
|
+
"fill",
|
|
1339
|
+
"stroke",
|
|
1340
|
+
"view"
|
|
1341
|
+
] }, "mask-no-clip"],
|
|
1342
|
+
"mask-composite": [{ mask: [
|
|
1343
|
+
"add",
|
|
1344
|
+
"subtract",
|
|
1345
|
+
"intersect",
|
|
1346
|
+
"exclude"
|
|
1347
|
+
] }],
|
|
1348
|
+
"mask-image-linear-pos": [{ "mask-linear": [isNumber] }],
|
|
1349
|
+
"mask-image-linear-from-pos": [{ "mask-linear-from": scaleMaskImagePosition() }],
|
|
1350
|
+
"mask-image-linear-to-pos": [{ "mask-linear-to": scaleMaskImagePosition() }],
|
|
1351
|
+
"mask-image-linear-from-color": [{ "mask-linear-from": scaleColor() }],
|
|
1352
|
+
"mask-image-linear-to-color": [{ "mask-linear-to": scaleColor() }],
|
|
1353
|
+
"mask-image-t-from-pos": [{ "mask-t-from": scaleMaskImagePosition() }],
|
|
1354
|
+
"mask-image-t-to-pos": [{ "mask-t-to": scaleMaskImagePosition() }],
|
|
1355
|
+
"mask-image-t-from-color": [{ "mask-t-from": scaleColor() }],
|
|
1356
|
+
"mask-image-t-to-color": [{ "mask-t-to": scaleColor() }],
|
|
1357
|
+
"mask-image-r-from-pos": [{ "mask-r-from": scaleMaskImagePosition() }],
|
|
1358
|
+
"mask-image-r-to-pos": [{ "mask-r-to": scaleMaskImagePosition() }],
|
|
1359
|
+
"mask-image-r-from-color": [{ "mask-r-from": scaleColor() }],
|
|
1360
|
+
"mask-image-r-to-color": [{ "mask-r-to": scaleColor() }],
|
|
1361
|
+
"mask-image-b-from-pos": [{ "mask-b-from": scaleMaskImagePosition() }],
|
|
1362
|
+
"mask-image-b-to-pos": [{ "mask-b-to": scaleMaskImagePosition() }],
|
|
1363
|
+
"mask-image-b-from-color": [{ "mask-b-from": scaleColor() }],
|
|
1364
|
+
"mask-image-b-to-color": [{ "mask-b-to": scaleColor() }],
|
|
1365
|
+
"mask-image-l-from-pos": [{ "mask-l-from": scaleMaskImagePosition() }],
|
|
1366
|
+
"mask-image-l-to-pos": [{ "mask-l-to": scaleMaskImagePosition() }],
|
|
1367
|
+
"mask-image-l-from-color": [{ "mask-l-from": scaleColor() }],
|
|
1368
|
+
"mask-image-l-to-color": [{ "mask-l-to": scaleColor() }],
|
|
1369
|
+
"mask-image-x-from-pos": [{ "mask-x-from": scaleMaskImagePosition() }],
|
|
1370
|
+
"mask-image-x-to-pos": [{ "mask-x-to": scaleMaskImagePosition() }],
|
|
1371
|
+
"mask-image-x-from-color": [{ "mask-x-from": scaleColor() }],
|
|
1372
|
+
"mask-image-x-to-color": [{ "mask-x-to": scaleColor() }],
|
|
1373
|
+
"mask-image-y-from-pos": [{ "mask-y-from": scaleMaskImagePosition() }],
|
|
1374
|
+
"mask-image-y-to-pos": [{ "mask-y-to": scaleMaskImagePosition() }],
|
|
1375
|
+
"mask-image-y-from-color": [{ "mask-y-from": scaleColor() }],
|
|
1376
|
+
"mask-image-y-to-color": [{ "mask-y-to": scaleColor() }],
|
|
1377
|
+
"mask-image-radial": [{ "mask-radial": [isArbitraryVariable, isArbitraryValue] }],
|
|
1378
|
+
"mask-image-radial-from-pos": [{ "mask-radial-from": scaleMaskImagePosition() }],
|
|
1379
|
+
"mask-image-radial-to-pos": [{ "mask-radial-to": scaleMaskImagePosition() }],
|
|
1380
|
+
"mask-image-radial-from-color": [{ "mask-radial-from": scaleColor() }],
|
|
1381
|
+
"mask-image-radial-to-color": [{ "mask-radial-to": scaleColor() }],
|
|
1382
|
+
"mask-image-radial-shape": [{ "mask-radial": ["circle", "ellipse"] }],
|
|
1383
|
+
"mask-image-radial-size": [{ "mask-radial": [{
|
|
1384
|
+
closest: ["side", "corner"],
|
|
1385
|
+
farthest: ["side", "corner"]
|
|
1386
|
+
}] }],
|
|
1387
|
+
"mask-image-radial-pos": [{ "mask-radial-at": scalePosition() }],
|
|
1388
|
+
"mask-image-conic-pos": [{ "mask-conic": [isNumber] }],
|
|
1389
|
+
"mask-image-conic-from-pos": [{ "mask-conic-from": scaleMaskImagePosition() }],
|
|
1390
|
+
"mask-image-conic-to-pos": [{ "mask-conic-to": scaleMaskImagePosition() }],
|
|
1391
|
+
"mask-image-conic-from-color": [{ "mask-conic-from": scaleColor() }],
|
|
1392
|
+
"mask-image-conic-to-color": [{ "mask-conic-to": scaleColor() }],
|
|
1393
|
+
"mask-mode": [{ mask: [
|
|
1394
|
+
"alpha",
|
|
1395
|
+
"luminance",
|
|
1396
|
+
"match"
|
|
1397
|
+
] }],
|
|
1398
|
+
"mask-origin": [{ "mask-origin": [
|
|
1399
|
+
"border",
|
|
1400
|
+
"padding",
|
|
1401
|
+
"content",
|
|
1402
|
+
"fill",
|
|
1403
|
+
"stroke",
|
|
1404
|
+
"view"
|
|
1405
|
+
] }],
|
|
1406
|
+
"mask-position": [{ mask: scaleBgPosition() }],
|
|
1407
|
+
"mask-repeat": [{ mask: scaleBgRepeat() }],
|
|
1408
|
+
"mask-size": [{ mask: scaleBgSize() }],
|
|
1409
|
+
"mask-type": [{ "mask-type": ["alpha", "luminance"] }],
|
|
1410
|
+
"mask-image": [{ mask: [
|
|
1411
|
+
"none",
|
|
1412
|
+
isArbitraryVariable,
|
|
1413
|
+
isArbitraryValue
|
|
1414
|
+
] }],
|
|
1415
|
+
filter: [{ filter: [
|
|
1416
|
+
"",
|
|
1417
|
+
"none",
|
|
1418
|
+
isArbitraryVariable,
|
|
1419
|
+
isArbitraryValue
|
|
1420
|
+
] }],
|
|
1421
|
+
blur: [{ blur: scaleBlur() }],
|
|
1422
|
+
brightness: [{ brightness: [
|
|
1423
|
+
isNumber,
|
|
1424
|
+
isArbitraryVariable,
|
|
1425
|
+
isArbitraryValue
|
|
1426
|
+
] }],
|
|
1427
|
+
contrast: [{ contrast: [
|
|
1428
|
+
isNumber,
|
|
1429
|
+
isArbitraryVariable,
|
|
1430
|
+
isArbitraryValue
|
|
1431
|
+
] }],
|
|
1432
|
+
"drop-shadow": [{ "drop-shadow": [
|
|
1433
|
+
"",
|
|
1434
|
+
"none",
|
|
1435
|
+
themeDropShadow,
|
|
1436
|
+
isArbitraryVariableShadow,
|
|
1437
|
+
isArbitraryShadow
|
|
1438
|
+
] }],
|
|
1439
|
+
"drop-shadow-color": [{ "drop-shadow": scaleColor() }],
|
|
1440
|
+
grayscale: [{ grayscale: [
|
|
1441
|
+
"",
|
|
1442
|
+
isNumber,
|
|
1443
|
+
isArbitraryVariable,
|
|
1444
|
+
isArbitraryValue
|
|
1445
|
+
] }],
|
|
1446
|
+
"hue-rotate": [{ "hue-rotate": [
|
|
1447
|
+
isNumber,
|
|
1448
|
+
isArbitraryVariable,
|
|
1449
|
+
isArbitraryValue
|
|
1450
|
+
] }],
|
|
1451
|
+
invert: [{ invert: [
|
|
1452
|
+
"",
|
|
1453
|
+
isNumber,
|
|
1454
|
+
isArbitraryVariable,
|
|
1455
|
+
isArbitraryValue
|
|
1456
|
+
] }],
|
|
1457
|
+
saturate: [{ saturate: [
|
|
1458
|
+
isNumber,
|
|
1459
|
+
isArbitraryVariable,
|
|
1460
|
+
isArbitraryValue
|
|
1461
|
+
] }],
|
|
1462
|
+
sepia: [{ sepia: [
|
|
1463
|
+
"",
|
|
1464
|
+
isNumber,
|
|
1465
|
+
isArbitraryVariable,
|
|
1466
|
+
isArbitraryValue
|
|
1467
|
+
] }],
|
|
1468
|
+
"backdrop-filter": [{ "backdrop-filter": [
|
|
1469
|
+
"",
|
|
1470
|
+
"none",
|
|
1471
|
+
isArbitraryVariable,
|
|
1472
|
+
isArbitraryValue
|
|
1473
|
+
] }],
|
|
1474
|
+
"backdrop-blur": [{ "backdrop-blur": scaleBlur() }],
|
|
1475
|
+
"backdrop-brightness": [{ "backdrop-brightness": [
|
|
1476
|
+
isNumber,
|
|
1477
|
+
isArbitraryVariable,
|
|
1478
|
+
isArbitraryValue
|
|
1479
|
+
] }],
|
|
1480
|
+
"backdrop-contrast": [{ "backdrop-contrast": [
|
|
1481
|
+
isNumber,
|
|
1482
|
+
isArbitraryVariable,
|
|
1483
|
+
isArbitraryValue
|
|
1484
|
+
] }],
|
|
1485
|
+
"backdrop-grayscale": [{ "backdrop-grayscale": [
|
|
1486
|
+
"",
|
|
1487
|
+
isNumber,
|
|
1488
|
+
isArbitraryVariable,
|
|
1489
|
+
isArbitraryValue
|
|
1490
|
+
] }],
|
|
1491
|
+
"backdrop-hue-rotate": [{ "backdrop-hue-rotate": [
|
|
1492
|
+
isNumber,
|
|
1493
|
+
isArbitraryVariable,
|
|
1494
|
+
isArbitraryValue
|
|
1495
|
+
] }],
|
|
1496
|
+
"backdrop-invert": [{ "backdrop-invert": [
|
|
1497
|
+
"",
|
|
1498
|
+
isNumber,
|
|
1499
|
+
isArbitraryVariable,
|
|
1500
|
+
isArbitraryValue
|
|
1501
|
+
] }],
|
|
1502
|
+
"backdrop-opacity": [{ "backdrop-opacity": [
|
|
1503
|
+
isNumber,
|
|
1504
|
+
isArbitraryVariable,
|
|
1505
|
+
isArbitraryValue
|
|
1506
|
+
] }],
|
|
1507
|
+
"backdrop-saturate": [{ "backdrop-saturate": [
|
|
1508
|
+
isNumber,
|
|
1509
|
+
isArbitraryVariable,
|
|
1510
|
+
isArbitraryValue
|
|
1511
|
+
] }],
|
|
1512
|
+
"backdrop-sepia": [{ "backdrop-sepia": [
|
|
1513
|
+
"",
|
|
1514
|
+
isNumber,
|
|
1515
|
+
isArbitraryVariable,
|
|
1516
|
+
isArbitraryValue
|
|
1517
|
+
] }],
|
|
1518
|
+
"border-collapse": [{ border: ["collapse", "separate"] }],
|
|
1519
|
+
"border-spacing": [{ "border-spacing": scaleUnambiguousSpacing() }],
|
|
1520
|
+
"border-spacing-x": [{ "border-spacing-x": scaleUnambiguousSpacing() }],
|
|
1521
|
+
"border-spacing-y": [{ "border-spacing-y": scaleUnambiguousSpacing() }],
|
|
1522
|
+
"table-layout": [{ table: ["auto", "fixed"] }],
|
|
1523
|
+
caption: [{ caption: ["top", "bottom"] }],
|
|
1524
|
+
transition: [{ transition: [
|
|
1525
|
+
"",
|
|
1526
|
+
"all",
|
|
1527
|
+
"colors",
|
|
1528
|
+
"opacity",
|
|
1529
|
+
"shadow",
|
|
1530
|
+
"transform",
|
|
1531
|
+
"none",
|
|
1532
|
+
isArbitraryVariable,
|
|
1533
|
+
isArbitraryValue
|
|
1534
|
+
] }],
|
|
1535
|
+
"transition-behavior": [{ transition: ["normal", "discrete"] }],
|
|
1536
|
+
duration: [{ duration: [
|
|
1537
|
+
isNumber,
|
|
1538
|
+
"initial",
|
|
1539
|
+
isArbitraryVariable,
|
|
1540
|
+
isArbitraryValue
|
|
1541
|
+
] }],
|
|
1542
|
+
ease: [{ ease: [
|
|
1543
|
+
"linear",
|
|
1544
|
+
"initial",
|
|
1545
|
+
themeEase,
|
|
1546
|
+
isArbitraryVariable,
|
|
1547
|
+
isArbitraryValue
|
|
1548
|
+
] }],
|
|
1549
|
+
delay: [{ delay: [
|
|
1550
|
+
isNumber,
|
|
1551
|
+
isArbitraryVariable,
|
|
1552
|
+
isArbitraryValue
|
|
1553
|
+
] }],
|
|
1554
|
+
animate: [{ animate: [
|
|
1555
|
+
"none",
|
|
1556
|
+
themeAnimate,
|
|
1557
|
+
isArbitraryVariable,
|
|
1558
|
+
isArbitraryValue
|
|
1559
|
+
] }],
|
|
1560
|
+
backface: [{ backface: ["hidden", "visible"] }],
|
|
1561
|
+
perspective: [{ perspective: [
|
|
1562
|
+
themePerspective,
|
|
1563
|
+
isArbitraryVariable,
|
|
1564
|
+
isArbitraryValue
|
|
1565
|
+
] }],
|
|
1566
|
+
"perspective-origin": [{ "perspective-origin": scalePositionWithArbitrary() }],
|
|
1567
|
+
rotate: [{ rotate: scaleRotate() }],
|
|
1568
|
+
"rotate-x": [{ "rotate-x": scaleRotate() }],
|
|
1569
|
+
"rotate-y": [{ "rotate-y": scaleRotate() }],
|
|
1570
|
+
"rotate-z": [{ "rotate-z": scaleRotate() }],
|
|
1571
|
+
scale: [{ scale: scaleScale() }],
|
|
1572
|
+
"scale-x": [{ "scale-x": scaleScale() }],
|
|
1573
|
+
"scale-y": [{ "scale-y": scaleScale() }],
|
|
1574
|
+
"scale-z": [{ "scale-z": scaleScale() }],
|
|
1575
|
+
"scale-3d": ["scale-3d"],
|
|
1576
|
+
skew: [{ skew: scaleSkew() }],
|
|
1577
|
+
"skew-x": [{ "skew-x": scaleSkew() }],
|
|
1578
|
+
"skew-y": [{ "skew-y": scaleSkew() }],
|
|
1579
|
+
transform: [{ transform: [
|
|
1580
|
+
isArbitraryVariable,
|
|
1581
|
+
isArbitraryValue,
|
|
1582
|
+
"",
|
|
1583
|
+
"none",
|
|
1584
|
+
"gpu",
|
|
1585
|
+
"cpu"
|
|
1586
|
+
] }],
|
|
1587
|
+
"transform-origin": [{ origin: scalePositionWithArbitrary() }],
|
|
1588
|
+
"transform-style": [{ transform: ["3d", "flat"] }],
|
|
1589
|
+
translate: [{ translate: scaleTranslate() }],
|
|
1590
|
+
"translate-x": [{ "translate-x": scaleTranslate() }],
|
|
1591
|
+
"translate-y": [{ "translate-y": scaleTranslate() }],
|
|
1592
|
+
"translate-z": [{ "translate-z": scaleTranslate() }],
|
|
1593
|
+
"translate-none": ["translate-none"],
|
|
1594
|
+
accent: [{ accent: scaleColor() }],
|
|
1595
|
+
appearance: [{ appearance: ["none", "auto"] }],
|
|
1596
|
+
"caret-color": [{ caret: scaleColor() }],
|
|
1597
|
+
"color-scheme": [{ scheme: [
|
|
1598
|
+
"normal",
|
|
1599
|
+
"dark",
|
|
1600
|
+
"light",
|
|
1601
|
+
"light-dark",
|
|
1602
|
+
"only-dark",
|
|
1603
|
+
"only-light"
|
|
1604
|
+
] }],
|
|
1605
|
+
cursor: [{ cursor: [
|
|
1606
|
+
"auto",
|
|
1607
|
+
"default",
|
|
1608
|
+
"pointer",
|
|
1609
|
+
"wait",
|
|
1610
|
+
"text",
|
|
1611
|
+
"move",
|
|
1612
|
+
"help",
|
|
1613
|
+
"not-allowed",
|
|
1614
|
+
"none",
|
|
1615
|
+
"context-menu",
|
|
1616
|
+
"progress",
|
|
1617
|
+
"cell",
|
|
1618
|
+
"crosshair",
|
|
1619
|
+
"vertical-text",
|
|
1620
|
+
"alias",
|
|
1621
|
+
"copy",
|
|
1622
|
+
"no-drop",
|
|
1623
|
+
"grab",
|
|
1624
|
+
"grabbing",
|
|
1625
|
+
"all-scroll",
|
|
1626
|
+
"col-resize",
|
|
1627
|
+
"row-resize",
|
|
1628
|
+
"n-resize",
|
|
1629
|
+
"e-resize",
|
|
1630
|
+
"s-resize",
|
|
1631
|
+
"w-resize",
|
|
1632
|
+
"ne-resize",
|
|
1633
|
+
"nw-resize",
|
|
1634
|
+
"se-resize",
|
|
1635
|
+
"sw-resize",
|
|
1636
|
+
"ew-resize",
|
|
1637
|
+
"ns-resize",
|
|
1638
|
+
"nesw-resize",
|
|
1639
|
+
"nwse-resize",
|
|
1640
|
+
"zoom-in",
|
|
1641
|
+
"zoom-out",
|
|
1642
|
+
isArbitraryVariable,
|
|
1643
|
+
isArbitraryValue
|
|
1644
|
+
] }],
|
|
1645
|
+
"field-sizing": [{ "field-sizing": ["fixed", "content"] }],
|
|
1646
|
+
"pointer-events": [{ "pointer-events": ["auto", "none"] }],
|
|
1647
|
+
resize: [{ resize: [
|
|
1648
|
+
"none",
|
|
1649
|
+
"",
|
|
1650
|
+
"y",
|
|
1651
|
+
"x"
|
|
1652
|
+
] }],
|
|
1653
|
+
"scroll-behavior": [{ scroll: ["auto", "smooth"] }],
|
|
1654
|
+
"scroll-m": [{ "scroll-m": scaleUnambiguousSpacing() }],
|
|
1655
|
+
"scroll-mx": [{ "scroll-mx": scaleUnambiguousSpacing() }],
|
|
1656
|
+
"scroll-my": [{ "scroll-my": scaleUnambiguousSpacing() }],
|
|
1657
|
+
"scroll-ms": [{ "scroll-ms": scaleUnambiguousSpacing() }],
|
|
1658
|
+
"scroll-me": [{ "scroll-me": scaleUnambiguousSpacing() }],
|
|
1659
|
+
"scroll-mt": [{ "scroll-mt": scaleUnambiguousSpacing() }],
|
|
1660
|
+
"scroll-mr": [{ "scroll-mr": scaleUnambiguousSpacing() }],
|
|
1661
|
+
"scroll-mb": [{ "scroll-mb": scaleUnambiguousSpacing() }],
|
|
1662
|
+
"scroll-ml": [{ "scroll-ml": scaleUnambiguousSpacing() }],
|
|
1663
|
+
"scroll-p": [{ "scroll-p": scaleUnambiguousSpacing() }],
|
|
1664
|
+
"scroll-px": [{ "scroll-px": scaleUnambiguousSpacing() }],
|
|
1665
|
+
"scroll-py": [{ "scroll-py": scaleUnambiguousSpacing() }],
|
|
1666
|
+
"scroll-ps": [{ "scroll-ps": scaleUnambiguousSpacing() }],
|
|
1667
|
+
"scroll-pe": [{ "scroll-pe": scaleUnambiguousSpacing() }],
|
|
1668
|
+
"scroll-pt": [{ "scroll-pt": scaleUnambiguousSpacing() }],
|
|
1669
|
+
"scroll-pr": [{ "scroll-pr": scaleUnambiguousSpacing() }],
|
|
1670
|
+
"scroll-pb": [{ "scroll-pb": scaleUnambiguousSpacing() }],
|
|
1671
|
+
"scroll-pl": [{ "scroll-pl": scaleUnambiguousSpacing() }],
|
|
1672
|
+
"snap-align": [{ snap: [
|
|
1673
|
+
"start",
|
|
1674
|
+
"end",
|
|
1675
|
+
"center",
|
|
1676
|
+
"align-none"
|
|
1677
|
+
] }],
|
|
1678
|
+
"snap-stop": [{ snap: ["normal", "always"] }],
|
|
1679
|
+
"snap-type": [{ snap: [
|
|
1680
|
+
"none",
|
|
1681
|
+
"x",
|
|
1682
|
+
"y",
|
|
1683
|
+
"both"
|
|
1684
|
+
] }],
|
|
1685
|
+
"snap-strictness": [{ snap: ["mandatory", "proximity"] }],
|
|
1686
|
+
touch: [{ touch: [
|
|
1687
|
+
"auto",
|
|
1688
|
+
"none",
|
|
1689
|
+
"manipulation"
|
|
1690
|
+
] }],
|
|
1691
|
+
"touch-x": [{ "touch-pan": [
|
|
1692
|
+
"x",
|
|
1693
|
+
"left",
|
|
1694
|
+
"right"
|
|
1695
|
+
] }],
|
|
1696
|
+
"touch-y": [{ "touch-pan": [
|
|
1697
|
+
"y",
|
|
1698
|
+
"up",
|
|
1699
|
+
"down"
|
|
1700
|
+
] }],
|
|
1701
|
+
"touch-pz": ["touch-pinch-zoom"],
|
|
1702
|
+
select: [{ select: [
|
|
1703
|
+
"none",
|
|
1704
|
+
"text",
|
|
1705
|
+
"all",
|
|
1706
|
+
"auto"
|
|
1707
|
+
] }],
|
|
1708
|
+
"will-change": [{ "will-change": [
|
|
1709
|
+
"auto",
|
|
1710
|
+
"scroll",
|
|
1711
|
+
"contents",
|
|
1712
|
+
"transform",
|
|
1713
|
+
isArbitraryVariable,
|
|
1714
|
+
isArbitraryValue
|
|
1715
|
+
] }],
|
|
1716
|
+
fill: [{ fill: ["none", ...scaleColor()] }],
|
|
1717
|
+
"stroke-w": [{ stroke: [
|
|
1718
|
+
isNumber,
|
|
1719
|
+
isArbitraryVariableLength,
|
|
1720
|
+
isArbitraryLength,
|
|
1721
|
+
isArbitraryNumber
|
|
1722
|
+
] }],
|
|
1723
|
+
stroke: [{ stroke: ["none", ...scaleColor()] }],
|
|
1724
|
+
"forced-color-adjust": [{ "forced-color-adjust": ["auto", "none"] }]
|
|
1725
|
+
},
|
|
1726
|
+
conflictingClassGroups: {
|
|
1727
|
+
overflow: ["overflow-x", "overflow-y"],
|
|
1728
|
+
overscroll: ["overscroll-x", "overscroll-y"],
|
|
1729
|
+
inset: [
|
|
1730
|
+
"inset-x",
|
|
1731
|
+
"inset-y",
|
|
1732
|
+
"start",
|
|
1733
|
+
"end",
|
|
1734
|
+
"top",
|
|
1735
|
+
"right",
|
|
1736
|
+
"bottom",
|
|
1737
|
+
"left"
|
|
1738
|
+
],
|
|
1739
|
+
"inset-x": ["right", "left"],
|
|
1740
|
+
"inset-y": ["top", "bottom"],
|
|
1741
|
+
flex: [
|
|
1742
|
+
"basis",
|
|
1743
|
+
"grow",
|
|
1744
|
+
"shrink"
|
|
1745
|
+
],
|
|
1746
|
+
gap: ["gap-x", "gap-y"],
|
|
1747
|
+
p: [
|
|
1748
|
+
"px",
|
|
1749
|
+
"py",
|
|
1750
|
+
"ps",
|
|
1751
|
+
"pe",
|
|
1752
|
+
"pt",
|
|
1753
|
+
"pr",
|
|
1754
|
+
"pb",
|
|
1755
|
+
"pl"
|
|
1756
|
+
],
|
|
1757
|
+
px: ["pr", "pl"],
|
|
1758
|
+
py: ["pt", "pb"],
|
|
1759
|
+
m: [
|
|
1760
|
+
"mx",
|
|
1761
|
+
"my",
|
|
1762
|
+
"ms",
|
|
1763
|
+
"me",
|
|
1764
|
+
"mt",
|
|
1765
|
+
"mr",
|
|
1766
|
+
"mb",
|
|
1767
|
+
"ml"
|
|
1768
|
+
],
|
|
1769
|
+
mx: ["mr", "ml"],
|
|
1770
|
+
my: ["mt", "mb"],
|
|
1771
|
+
size: ["w", "h"],
|
|
1772
|
+
"font-size": ["leading"],
|
|
1773
|
+
"fvn-normal": [
|
|
1774
|
+
"fvn-ordinal",
|
|
1775
|
+
"fvn-slashed-zero",
|
|
1776
|
+
"fvn-figure",
|
|
1777
|
+
"fvn-spacing",
|
|
1778
|
+
"fvn-fraction"
|
|
1779
|
+
],
|
|
1780
|
+
"fvn-ordinal": ["fvn-normal"],
|
|
1781
|
+
"fvn-slashed-zero": ["fvn-normal"],
|
|
1782
|
+
"fvn-figure": ["fvn-normal"],
|
|
1783
|
+
"fvn-spacing": ["fvn-normal"],
|
|
1784
|
+
"fvn-fraction": ["fvn-normal"],
|
|
1785
|
+
"line-clamp": ["display", "overflow"],
|
|
1786
|
+
rounded: [
|
|
1787
|
+
"rounded-s",
|
|
1788
|
+
"rounded-e",
|
|
1789
|
+
"rounded-t",
|
|
1790
|
+
"rounded-r",
|
|
1791
|
+
"rounded-b",
|
|
1792
|
+
"rounded-l",
|
|
1793
|
+
"rounded-ss",
|
|
1794
|
+
"rounded-se",
|
|
1795
|
+
"rounded-ee",
|
|
1796
|
+
"rounded-es",
|
|
1797
|
+
"rounded-tl",
|
|
1798
|
+
"rounded-tr",
|
|
1799
|
+
"rounded-br",
|
|
1800
|
+
"rounded-bl"
|
|
1801
|
+
],
|
|
1802
|
+
"rounded-s": ["rounded-ss", "rounded-es"],
|
|
1803
|
+
"rounded-e": ["rounded-se", "rounded-ee"],
|
|
1804
|
+
"rounded-t": ["rounded-tl", "rounded-tr"],
|
|
1805
|
+
"rounded-r": ["rounded-tr", "rounded-br"],
|
|
1806
|
+
"rounded-b": ["rounded-br", "rounded-bl"],
|
|
1807
|
+
"rounded-l": ["rounded-tl", "rounded-bl"],
|
|
1808
|
+
"border-spacing": ["border-spacing-x", "border-spacing-y"],
|
|
1809
|
+
"border-w": [
|
|
1810
|
+
"border-w-x",
|
|
1811
|
+
"border-w-y",
|
|
1812
|
+
"border-w-s",
|
|
1813
|
+
"border-w-e",
|
|
1814
|
+
"border-w-t",
|
|
1815
|
+
"border-w-r",
|
|
1816
|
+
"border-w-b",
|
|
1817
|
+
"border-w-l"
|
|
1818
|
+
],
|
|
1819
|
+
"border-w-x": ["border-w-r", "border-w-l"],
|
|
1820
|
+
"border-w-y": ["border-w-t", "border-w-b"],
|
|
1821
|
+
"border-color": [
|
|
1822
|
+
"border-color-x",
|
|
1823
|
+
"border-color-y",
|
|
1824
|
+
"border-color-s",
|
|
1825
|
+
"border-color-e",
|
|
1826
|
+
"border-color-t",
|
|
1827
|
+
"border-color-r",
|
|
1828
|
+
"border-color-b",
|
|
1829
|
+
"border-color-l"
|
|
1830
|
+
],
|
|
1831
|
+
"border-color-x": ["border-color-r", "border-color-l"],
|
|
1832
|
+
"border-color-y": ["border-color-t", "border-color-b"],
|
|
1833
|
+
translate: [
|
|
1834
|
+
"translate-x",
|
|
1835
|
+
"translate-y",
|
|
1836
|
+
"translate-none"
|
|
1837
|
+
],
|
|
1838
|
+
"translate-none": [
|
|
1839
|
+
"translate",
|
|
1840
|
+
"translate-x",
|
|
1841
|
+
"translate-y",
|
|
1842
|
+
"translate-z"
|
|
1843
|
+
],
|
|
1844
|
+
"scroll-m": [
|
|
1845
|
+
"scroll-mx",
|
|
1846
|
+
"scroll-my",
|
|
1847
|
+
"scroll-ms",
|
|
1848
|
+
"scroll-me",
|
|
1849
|
+
"scroll-mt",
|
|
1850
|
+
"scroll-mr",
|
|
1851
|
+
"scroll-mb",
|
|
1852
|
+
"scroll-ml"
|
|
1853
|
+
],
|
|
1854
|
+
"scroll-mx": ["scroll-mr", "scroll-ml"],
|
|
1855
|
+
"scroll-my": ["scroll-mt", "scroll-mb"],
|
|
1856
|
+
"scroll-p": [
|
|
1857
|
+
"scroll-px",
|
|
1858
|
+
"scroll-py",
|
|
1859
|
+
"scroll-ps",
|
|
1860
|
+
"scroll-pe",
|
|
1861
|
+
"scroll-pt",
|
|
1862
|
+
"scroll-pr",
|
|
1863
|
+
"scroll-pb",
|
|
1864
|
+
"scroll-pl"
|
|
1865
|
+
],
|
|
1866
|
+
"scroll-px": ["scroll-pr", "scroll-pl"],
|
|
1867
|
+
"scroll-py": ["scroll-pt", "scroll-pb"],
|
|
1868
|
+
touch: [
|
|
1869
|
+
"touch-x",
|
|
1870
|
+
"touch-y",
|
|
1871
|
+
"touch-pz"
|
|
1872
|
+
],
|
|
1873
|
+
"touch-x": ["touch"],
|
|
1874
|
+
"touch-y": ["touch"],
|
|
1875
|
+
"touch-pz": ["touch"]
|
|
1876
|
+
},
|
|
1877
|
+
conflictingClassGroupModifiers: { "font-size": ["leading"] },
|
|
1878
|
+
orderSensitiveModifiers: [
|
|
1879
|
+
"*",
|
|
1880
|
+
"**",
|
|
1881
|
+
"after",
|
|
1882
|
+
"backdrop",
|
|
1883
|
+
"before",
|
|
1884
|
+
"details-content",
|
|
1885
|
+
"file",
|
|
1886
|
+
"first-letter",
|
|
1887
|
+
"first-line",
|
|
1888
|
+
"marker",
|
|
1889
|
+
"placeholder",
|
|
1890
|
+
"selection"
|
|
1891
|
+
]
|
|
1892
|
+
};
|
|
1893
|
+
};
|
|
1894
|
+
const twMerge = /* @__PURE__ */ createTailwindMerge(getDefaultConfig);
|
|
1895
|
+
typeof window !== "undefined" && window.document && window.document.createElement;
|
|
1896
|
+
function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
|
|
1897
|
+
return function handleEvent(event) {
|
|
1898
|
+
originalEventHandler?.(event);
|
|
1899
|
+
if (checkForDefaultPrevented === false || !event.defaultPrevented) return ourEventHandler?.(event);
|
|
1900
|
+
};
|
|
1901
|
+
}
|
|
1902
|
+
//#endregion
|
|
1903
|
+
//#region ../../node_modules/.pnpm/@radix-ui+react-compose-refs@1.1.2_@types+react@19.2.14_react@19.2.6/node_modules/@radix-ui/react-compose-refs/dist/index.mjs
|
|
1904
|
+
function setRef(ref, value) {
|
|
1905
|
+
if (typeof ref === "function") return ref(value);
|
|
1906
|
+
else if (ref !== null && ref !== void 0) ref.current = value;
|
|
1907
|
+
}
|
|
1908
|
+
function composeRefs(...refs) {
|
|
1909
|
+
return (node) => {
|
|
1910
|
+
let hasCleanup = false;
|
|
1911
|
+
const cleanups = refs.map((ref) => {
|
|
1912
|
+
const cleanup = setRef(ref, node);
|
|
1913
|
+
if (!hasCleanup && typeof cleanup == "function") hasCleanup = true;
|
|
1914
|
+
return cleanup;
|
|
1915
|
+
});
|
|
1916
|
+
if (hasCleanup) return () => {
|
|
1917
|
+
for (let i = 0; i < cleanups.length; i++) {
|
|
1918
|
+
const cleanup = cleanups[i];
|
|
1919
|
+
if (typeof cleanup == "function") cleanup();
|
|
1920
|
+
else setRef(refs[i], null);
|
|
1921
|
+
}
|
|
1922
|
+
};
|
|
1923
|
+
};
|
|
1924
|
+
}
|
|
1925
|
+
function useComposedRefs(...refs) {
|
|
1926
|
+
return React$1.useCallback(composeRefs(...refs), refs);
|
|
1927
|
+
}
|
|
1928
|
+
//#endregion
|
|
1929
|
+
//#region ../../node_modules/.pnpm/@radix-ui+react-context@1.1.2_@types+react@19.2.14_react@19.2.6/node_modules/@radix-ui/react-context/dist/index.mjs
|
|
1930
|
+
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
1931
|
+
let defaultContexts = [];
|
|
1932
|
+
function createContext3(rootComponentName, defaultContext) {
|
|
1933
|
+
const BaseContext = React$1.createContext(defaultContext);
|
|
1934
|
+
const index = defaultContexts.length;
|
|
1935
|
+
defaultContexts = [...defaultContexts, defaultContext];
|
|
1936
|
+
const Provider = (props) => {
|
|
1937
|
+
const { scope, children, ...context } = props;
|
|
1938
|
+
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
1939
|
+
const value = React$1.useMemo(() => context, Object.values(context));
|
|
1940
|
+
return /* @__PURE__ */ jsx(Context.Provider, {
|
|
1941
|
+
value,
|
|
1942
|
+
children
|
|
1943
|
+
});
|
|
1944
|
+
};
|
|
1945
|
+
Provider.displayName = rootComponentName + "Provider";
|
|
1946
|
+
function useContext2(consumerName, scope) {
|
|
1947
|
+
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
1948
|
+
const context = React$1.useContext(Context);
|
|
1949
|
+
if (context) return context;
|
|
1950
|
+
if (defaultContext !== void 0) return defaultContext;
|
|
1951
|
+
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
1952
|
+
}
|
|
1953
|
+
return [Provider, useContext2];
|
|
1954
|
+
}
|
|
1955
|
+
const createScope = () => {
|
|
1956
|
+
const scopeContexts = defaultContexts.map((defaultContext) => {
|
|
1957
|
+
return React$1.createContext(defaultContext);
|
|
1958
|
+
});
|
|
1959
|
+
return function useScope(scope) {
|
|
1960
|
+
const contexts = scope?.[scopeName] || scopeContexts;
|
|
1961
|
+
return React$1.useMemo(() => ({ [`__scope${scopeName}`]: {
|
|
1962
|
+
...scope,
|
|
1963
|
+
[scopeName]: contexts
|
|
1964
|
+
} }), [scope, contexts]);
|
|
1965
|
+
};
|
|
1966
|
+
};
|
|
1967
|
+
createScope.scopeName = scopeName;
|
|
1968
|
+
return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];
|
|
1969
|
+
}
|
|
1970
|
+
function composeContextScopes(...scopes) {
|
|
1971
|
+
const baseScope = scopes[0];
|
|
1972
|
+
if (scopes.length === 1) return baseScope;
|
|
1973
|
+
const createScope = () => {
|
|
1974
|
+
const scopeHooks = scopes.map((createScope2) => ({
|
|
1975
|
+
useScope: createScope2(),
|
|
1976
|
+
scopeName: createScope2.scopeName
|
|
1977
|
+
}));
|
|
1978
|
+
return function useComposedScopes(overrideScopes) {
|
|
1979
|
+
const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
|
|
1980
|
+
const currentScope = useScope(overrideScopes)[`__scope${scopeName}`];
|
|
1981
|
+
return {
|
|
1982
|
+
...nextScopes2,
|
|
1983
|
+
...currentScope
|
|
1984
|
+
};
|
|
1985
|
+
}, {});
|
|
1986
|
+
return React$1.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
1987
|
+
};
|
|
1988
|
+
};
|
|
1989
|
+
createScope.scopeName = baseScope.scopeName;
|
|
1990
|
+
return createScope;
|
|
1991
|
+
}
|
|
1992
|
+
//#endregion
|
|
1993
|
+
//#region ../../node_modules/.pnpm/@radix-ui+react-use-layout-effect@1.1.1_@types+react@19.2.14_react@19.2.6/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
|
|
1994
|
+
var useLayoutEffect2 = globalThis?.document ? React$1.useLayoutEffect : () => {};
|
|
1995
|
+
//#endregion
|
|
1996
|
+
//#region ../../node_modules/.pnpm/@radix-ui+react-use-controllable-state@1.2.2_@types+react@19.2.14_react@19.2.6/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
|
|
1997
|
+
var useInsertionEffect = React$1[" useInsertionEffect ".trim().toString()] || useLayoutEffect2;
|
|
1998
|
+
function useControllableState({ prop, defaultProp, onChange = () => {}, caller }) {
|
|
1999
|
+
const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({
|
|
2000
|
+
defaultProp,
|
|
2001
|
+
onChange
|
|
2002
|
+
});
|
|
2003
|
+
const isControlled = prop !== void 0;
|
|
2004
|
+
const value = isControlled ? prop : uncontrolledProp;
|
|
2005
|
+
{
|
|
2006
|
+
const isControlledRef = React$1.useRef(prop !== void 0);
|
|
2007
|
+
React$1.useEffect(() => {
|
|
2008
|
+
const wasControlled = isControlledRef.current;
|
|
2009
|
+
if (wasControlled !== isControlled) {
|
|
2010
|
+
const from = wasControlled ? "controlled" : "uncontrolled";
|
|
2011
|
+
const to = isControlled ? "controlled" : "uncontrolled";
|
|
2012
|
+
console.warn(`${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`);
|
|
2013
|
+
}
|
|
2014
|
+
isControlledRef.current = isControlled;
|
|
2015
|
+
}, [isControlled, caller]);
|
|
2016
|
+
}
|
|
2017
|
+
return [value, React$1.useCallback((nextValue) => {
|
|
2018
|
+
if (isControlled) {
|
|
2019
|
+
const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;
|
|
2020
|
+
if (value2 !== prop) onChangeRef.current?.(value2);
|
|
2021
|
+
} else setUncontrolledProp(nextValue);
|
|
2022
|
+
}, [
|
|
2023
|
+
isControlled,
|
|
2024
|
+
prop,
|
|
2025
|
+
setUncontrolledProp,
|
|
2026
|
+
onChangeRef
|
|
2027
|
+
])];
|
|
2028
|
+
}
|
|
2029
|
+
function useUncontrolledState({ defaultProp, onChange }) {
|
|
2030
|
+
const [value, setValue] = React$1.useState(defaultProp);
|
|
2031
|
+
const prevValueRef = React$1.useRef(value);
|
|
2032
|
+
const onChangeRef = React$1.useRef(onChange);
|
|
2033
|
+
useInsertionEffect(() => {
|
|
2034
|
+
onChangeRef.current = onChange;
|
|
2035
|
+
}, [onChange]);
|
|
2036
|
+
React$1.useEffect(() => {
|
|
2037
|
+
if (prevValueRef.current !== value) {
|
|
2038
|
+
onChangeRef.current?.(value);
|
|
2039
|
+
prevValueRef.current = value;
|
|
2040
|
+
}
|
|
2041
|
+
}, [value, prevValueRef]);
|
|
2042
|
+
return [
|
|
2043
|
+
value,
|
|
2044
|
+
setValue,
|
|
2045
|
+
onChangeRef
|
|
2046
|
+
];
|
|
2047
|
+
}
|
|
2048
|
+
function isFunction(value) {
|
|
2049
|
+
return typeof value === "function";
|
|
2050
|
+
}
|
|
2051
|
+
//#endregion
|
|
2052
|
+
//#region ../../node_modules/.pnpm/@radix-ui+react-slot@1.2.3_@types+react@19.2.14_react@19.2.6/node_modules/@radix-ui/react-slot/dist/index.mjs
|
|
2053
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2054
|
+
function createSlot(ownerName) {
|
|
2055
|
+
const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
|
|
2056
|
+
const Slot2 = React$1.forwardRef((props, forwardedRef) => {
|
|
2057
|
+
const { children, ...slotProps } = props;
|
|
2058
|
+
const childrenArray = React$1.Children.toArray(children);
|
|
2059
|
+
const slottable = childrenArray.find(isSlottable);
|
|
2060
|
+
if (slottable) {
|
|
2061
|
+
const newElement = slottable.props.children;
|
|
2062
|
+
const newChildren = childrenArray.map((child) => {
|
|
2063
|
+
if (child === slottable) {
|
|
2064
|
+
if (React$1.Children.count(newElement) > 1) return React$1.Children.only(null);
|
|
2065
|
+
return React$1.isValidElement(newElement) ? newElement.props.children : null;
|
|
2066
|
+
} else return child;
|
|
2067
|
+
});
|
|
2068
|
+
return /* @__PURE__ */ jsx(SlotClone, {
|
|
2069
|
+
...slotProps,
|
|
2070
|
+
ref: forwardedRef,
|
|
2071
|
+
children: React$1.isValidElement(newElement) ? React$1.cloneElement(newElement, void 0, newChildren) : null
|
|
2072
|
+
});
|
|
2073
|
+
}
|
|
2074
|
+
return /* @__PURE__ */ jsx(SlotClone, {
|
|
2075
|
+
...slotProps,
|
|
2076
|
+
ref: forwardedRef,
|
|
2077
|
+
children
|
|
2078
|
+
});
|
|
2079
|
+
});
|
|
2080
|
+
Slot2.displayName = `${ownerName}.Slot`;
|
|
2081
|
+
return Slot2;
|
|
2082
|
+
}
|
|
2083
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2084
|
+
function createSlotClone(ownerName) {
|
|
2085
|
+
const SlotClone = React$1.forwardRef((props, forwardedRef) => {
|
|
2086
|
+
const { children, ...slotProps } = props;
|
|
2087
|
+
if (React$1.isValidElement(children)) {
|
|
2088
|
+
const childrenRef = getElementRef$1(children);
|
|
2089
|
+
const props2 = mergeProps(slotProps, children.props);
|
|
2090
|
+
if (children.type !== React$1.Fragment) props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
2091
|
+
return React$1.cloneElement(children, props2);
|
|
2092
|
+
}
|
|
2093
|
+
return React$1.Children.count(children) > 1 ? React$1.Children.only(null) : null;
|
|
2094
|
+
});
|
|
2095
|
+
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
2096
|
+
return SlotClone;
|
|
2097
|
+
}
|
|
2098
|
+
var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
|
|
2099
|
+
function isSlottable(child) {
|
|
2100
|
+
return React$1.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
|
2101
|
+
}
|
|
2102
|
+
function mergeProps(slotProps, childProps) {
|
|
2103
|
+
const overrideProps = { ...childProps };
|
|
2104
|
+
for (const propName in childProps) {
|
|
2105
|
+
const slotPropValue = slotProps[propName];
|
|
2106
|
+
const childPropValue = childProps[propName];
|
|
2107
|
+
if (/^on[A-Z]/.test(propName)) {
|
|
2108
|
+
if (slotPropValue && childPropValue) overrideProps[propName] = (...args) => {
|
|
2109
|
+
const result = childPropValue(...args);
|
|
2110
|
+
slotPropValue(...args);
|
|
2111
|
+
return result;
|
|
2112
|
+
};
|
|
2113
|
+
else if (slotPropValue) overrideProps[propName] = slotPropValue;
|
|
2114
|
+
} else if (propName === "style") overrideProps[propName] = {
|
|
2115
|
+
...slotPropValue,
|
|
2116
|
+
...childPropValue
|
|
2117
|
+
};
|
|
2118
|
+
else if (propName === "className") overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
|
|
2119
|
+
}
|
|
2120
|
+
return {
|
|
2121
|
+
...slotProps,
|
|
2122
|
+
...overrideProps
|
|
2123
|
+
};
|
|
2124
|
+
}
|
|
2125
|
+
function getElementRef$1(element) {
|
|
2126
|
+
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
|
2127
|
+
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
2128
|
+
if (mayWarn) return element.ref;
|
|
2129
|
+
getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
|
|
2130
|
+
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
2131
|
+
if (mayWarn) return element.props.ref;
|
|
2132
|
+
return element.props.ref || element.ref;
|
|
2133
|
+
}
|
|
2134
|
+
//#endregion
|
|
2135
|
+
//#region ../../node_modules/.pnpm/@radix-ui+react-primitive@2.1.3_@types+react-dom@19.2.3_@types+react@19.2.14__@types+re_0935c7b95cefcdb4f10a34e92035e5e3/node_modules/@radix-ui/react-primitive/dist/index.mjs
|
|
2136
|
+
var Primitive = [
|
|
2137
|
+
"a",
|
|
2138
|
+
"button",
|
|
2139
|
+
"div",
|
|
2140
|
+
"form",
|
|
2141
|
+
"h2",
|
|
2142
|
+
"h3",
|
|
2143
|
+
"img",
|
|
2144
|
+
"input",
|
|
2145
|
+
"label",
|
|
2146
|
+
"li",
|
|
2147
|
+
"nav",
|
|
2148
|
+
"ol",
|
|
2149
|
+
"p",
|
|
2150
|
+
"select",
|
|
2151
|
+
"span",
|
|
2152
|
+
"svg",
|
|
2153
|
+
"ul"
|
|
2154
|
+
].reduce((primitive, node) => {
|
|
2155
|
+
const Slot = /* @__PURE__ */ createSlot(`Primitive.${node}`);
|
|
2156
|
+
const Node = React$1.forwardRef((props, forwardedRef) => {
|
|
2157
|
+
const { asChild, ...primitiveProps } = props;
|
|
2158
|
+
const Comp = asChild ? Slot : node;
|
|
2159
|
+
if (typeof window !== "undefined") window[Symbol.for("radix-ui")] = true;
|
|
2160
|
+
return /* @__PURE__ */ jsx(Comp, {
|
|
2161
|
+
...primitiveProps,
|
|
2162
|
+
ref: forwardedRef
|
|
2163
|
+
});
|
|
2164
|
+
});
|
|
2165
|
+
Node.displayName = `Primitive.${node}`;
|
|
2166
|
+
return {
|
|
2167
|
+
...primitive,
|
|
2168
|
+
[node]: Node
|
|
2169
|
+
};
|
|
2170
|
+
}, {});
|
|
2171
|
+
function dispatchDiscreteCustomEvent(target, event) {
|
|
2172
|
+
if (target) ReactDOM$1.flushSync(() => target.dispatchEvent(event));
|
|
2173
|
+
}
|
|
2174
|
+
//#endregion
|
|
2175
|
+
//#region ../../node_modules/.pnpm/@radix-ui+react-collection@1.1.7_@types+react-dom@19.2.3_@types+react@19.2.14__@types+r_b94f5365b88697a700662930c56ccffc/node_modules/@radix-ui/react-collection/dist/index.mjs
|
|
2176
|
+
function createCollection(name) {
|
|
2177
|
+
const PROVIDER_NAME = name + "CollectionProvider";
|
|
2178
|
+
const [createCollectionContext, createCollectionScope] = createContextScope(PROVIDER_NAME);
|
|
2179
|
+
const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(PROVIDER_NAME, {
|
|
2180
|
+
collectionRef: { current: null },
|
|
2181
|
+
itemMap: /* @__PURE__ */ new Map()
|
|
2182
|
+
});
|
|
2183
|
+
const CollectionProvider = (props) => {
|
|
2184
|
+
const { scope, children } = props;
|
|
2185
|
+
const ref = React.useRef(null);
|
|
2186
|
+
const itemMap = React.useRef(/* @__PURE__ */ new Map()).current;
|
|
2187
|
+
return /* @__PURE__ */ jsx(CollectionProviderImpl, {
|
|
2188
|
+
scope,
|
|
2189
|
+
itemMap,
|
|
2190
|
+
collectionRef: ref,
|
|
2191
|
+
children
|
|
2192
|
+
});
|
|
2193
|
+
};
|
|
2194
|
+
CollectionProvider.displayName = PROVIDER_NAME;
|
|
2195
|
+
const COLLECTION_SLOT_NAME = name + "CollectionSlot";
|
|
2196
|
+
const CollectionSlotImpl = /* @__PURE__ */ createSlot(COLLECTION_SLOT_NAME);
|
|
2197
|
+
const CollectionSlot = React.forwardRef((props, forwardedRef) => {
|
|
2198
|
+
const { scope, children } = props;
|
|
2199
|
+
return /* @__PURE__ */ jsx(CollectionSlotImpl, {
|
|
2200
|
+
ref: useComposedRefs(forwardedRef, useCollectionContext(COLLECTION_SLOT_NAME, scope).collectionRef),
|
|
2201
|
+
children
|
|
2202
|
+
});
|
|
2203
|
+
});
|
|
2204
|
+
CollectionSlot.displayName = COLLECTION_SLOT_NAME;
|
|
2205
|
+
const ITEM_SLOT_NAME = name + "CollectionItemSlot";
|
|
2206
|
+
const ITEM_DATA_ATTR = "data-radix-collection-item";
|
|
2207
|
+
const CollectionItemSlotImpl = /* @__PURE__ */ createSlot(ITEM_SLOT_NAME);
|
|
2208
|
+
const CollectionItemSlot = React.forwardRef((props, forwardedRef) => {
|
|
2209
|
+
const { scope, children, ...itemData } = props;
|
|
2210
|
+
const ref = React.useRef(null);
|
|
2211
|
+
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
2212
|
+
const context = useCollectionContext(ITEM_SLOT_NAME, scope);
|
|
2213
|
+
React.useEffect(() => {
|
|
2214
|
+
context.itemMap.set(ref, {
|
|
2215
|
+
ref,
|
|
2216
|
+
...itemData
|
|
2217
|
+
});
|
|
2218
|
+
return () => void context.itemMap.delete(ref);
|
|
2219
|
+
});
|
|
2220
|
+
return /* @__PURE__ */ jsx(CollectionItemSlotImpl, {
|
|
2221
|
+
[ITEM_DATA_ATTR]: "",
|
|
2222
|
+
ref: composedRefs,
|
|
2223
|
+
children
|
|
2224
|
+
});
|
|
2225
|
+
});
|
|
2226
|
+
CollectionItemSlot.displayName = ITEM_SLOT_NAME;
|
|
2227
|
+
function useCollection(scope) {
|
|
2228
|
+
const context = useCollectionContext(name + "CollectionConsumer", scope);
|
|
2229
|
+
return React.useCallback(() => {
|
|
2230
|
+
const collectionNode = context.collectionRef.current;
|
|
2231
|
+
if (!collectionNode) return [];
|
|
2232
|
+
const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));
|
|
2233
|
+
return Array.from(context.itemMap.values()).sort((a, b) => orderedNodes.indexOf(a.ref.current) - orderedNodes.indexOf(b.ref.current));
|
|
2234
|
+
}, [context.collectionRef, context.itemMap]);
|
|
2235
|
+
}
|
|
2236
|
+
return [
|
|
2237
|
+
{
|
|
2238
|
+
Provider: CollectionProvider,
|
|
2239
|
+
Slot: CollectionSlot,
|
|
2240
|
+
ItemSlot: CollectionItemSlot
|
|
2241
|
+
},
|
|
2242
|
+
useCollection,
|
|
2243
|
+
createCollectionScope
|
|
2244
|
+
];
|
|
2245
|
+
}
|
|
2246
|
+
//#endregion
|
|
2247
|
+
//#region ../../node_modules/.pnpm/@radix-ui+react-direction@1.1.1_@types+react@19.2.14_react@19.2.6/node_modules/@radix-ui/react-direction/dist/index.mjs
|
|
2248
|
+
var DirectionContext = React$1.createContext(void 0);
|
|
2249
|
+
function useDirection(localDir) {
|
|
2250
|
+
const globalDir = React$1.useContext(DirectionContext);
|
|
2251
|
+
return localDir || globalDir || "ltr";
|
|
2252
|
+
}
|
|
2253
|
+
//#endregion
|
|
2254
|
+
//#region ../../node_modules/.pnpm/@radix-ui+react-use-callback-ref@1.1.1_@types+react@19.2.14_react@19.2.6/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs
|
|
2255
|
+
function useCallbackRef(callback) {
|
|
2256
|
+
const callbackRef = React$1.useRef(callback);
|
|
2257
|
+
React$1.useEffect(() => {
|
|
2258
|
+
callbackRef.current = callback;
|
|
2259
|
+
});
|
|
2260
|
+
return React$1.useMemo(() => (...args) => callbackRef.current?.(...args), []);
|
|
2261
|
+
}
|
|
2262
|
+
//#endregion
|
|
2263
|
+
//#region ../../node_modules/.pnpm/@radix-ui+react-id@1.1.1_@types+react@19.2.14_react@19.2.6/node_modules/@radix-ui/react-id/dist/index.mjs
|
|
2264
|
+
var useReactId = React$1[" useId ".trim().toString()] || (() => void 0);
|
|
2265
|
+
var count = 0;
|
|
2266
|
+
function useId$1(deterministicId) {
|
|
2267
|
+
const [id, setId] = React$1.useState(useReactId());
|
|
2268
|
+
useLayoutEffect2(() => {
|
|
2269
|
+
if (!deterministicId) setId((reactId) => reactId ?? String(count++));
|
|
2270
|
+
}, [deterministicId]);
|
|
2271
|
+
return deterministicId || (id ? `radix-${id}` : "");
|
|
2272
|
+
}
|
|
2273
|
+
//#endregion
|
|
2274
|
+
//#region ../../node_modules/.pnpm/@radix-ui+react-presence@1.1.5_@types+react-dom@19.2.3_@types+react@19.2.14__@types+rea_abbc8bcf75333b39bfe32b13ef7abc0e/node_modules/@radix-ui/react-presence/dist/index.mjs
|
|
2275
|
+
function useStateMachine(initialState, machine) {
|
|
2276
|
+
return React$1.useReducer((state, event) => {
|
|
2277
|
+
return machine[state][event] ?? state;
|
|
2278
|
+
}, initialState);
|
|
2279
|
+
}
|
|
2280
|
+
var Presence = (props) => {
|
|
2281
|
+
const { present, children } = props;
|
|
2282
|
+
const presence = usePresence(present);
|
|
2283
|
+
const child = typeof children === "function" ? children({ present: presence.isPresent }) : React$1.Children.only(children);
|
|
2284
|
+
const ref = useComposedRefs(presence.ref, getElementRef(child));
|
|
2285
|
+
return typeof children === "function" || presence.isPresent ? React$1.cloneElement(child, { ref }) : null;
|
|
2286
|
+
};
|
|
2287
|
+
Presence.displayName = "Presence";
|
|
2288
|
+
function usePresence(present) {
|
|
2289
|
+
const [node, setNode] = React$1.useState();
|
|
2290
|
+
const stylesRef = React$1.useRef(null);
|
|
2291
|
+
const prevPresentRef = React$1.useRef(present);
|
|
2292
|
+
const prevAnimationNameRef = React$1.useRef("none");
|
|
2293
|
+
const [state, send] = useStateMachine(present ? "mounted" : "unmounted", {
|
|
2294
|
+
mounted: {
|
|
2295
|
+
UNMOUNT: "unmounted",
|
|
2296
|
+
ANIMATION_OUT: "unmountSuspended"
|
|
2297
|
+
},
|
|
2298
|
+
unmountSuspended: {
|
|
2299
|
+
MOUNT: "mounted",
|
|
2300
|
+
ANIMATION_END: "unmounted"
|
|
2301
|
+
},
|
|
2302
|
+
unmounted: { MOUNT: "mounted" }
|
|
2303
|
+
});
|
|
2304
|
+
React$1.useEffect(() => {
|
|
2305
|
+
const currentAnimationName = getAnimationName(stylesRef.current);
|
|
2306
|
+
prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
|
|
2307
|
+
}, [state]);
|
|
2308
|
+
useLayoutEffect2(() => {
|
|
2309
|
+
const styles = stylesRef.current;
|
|
2310
|
+
const wasPresent = prevPresentRef.current;
|
|
2311
|
+
if (wasPresent !== present) {
|
|
2312
|
+
const prevAnimationName = prevAnimationNameRef.current;
|
|
2313
|
+
const currentAnimationName = getAnimationName(styles);
|
|
2314
|
+
if (present) send("MOUNT");
|
|
2315
|
+
else if (currentAnimationName === "none" || styles?.display === "none") send("UNMOUNT");
|
|
2316
|
+
else if (wasPresent && prevAnimationName !== currentAnimationName) send("ANIMATION_OUT");
|
|
2317
|
+
else send("UNMOUNT");
|
|
2318
|
+
prevPresentRef.current = present;
|
|
2319
|
+
}
|
|
2320
|
+
}, [present, send]);
|
|
2321
|
+
useLayoutEffect2(() => {
|
|
2322
|
+
if (node) {
|
|
2323
|
+
let timeoutId;
|
|
2324
|
+
const ownerWindow = node.ownerDocument.defaultView ?? window;
|
|
2325
|
+
const handleAnimationEnd = (event) => {
|
|
2326
|
+
const isCurrentAnimation = getAnimationName(stylesRef.current).includes(CSS.escape(event.animationName));
|
|
2327
|
+
if (event.target === node && isCurrentAnimation) {
|
|
2328
|
+
send("ANIMATION_END");
|
|
2329
|
+
if (!prevPresentRef.current) {
|
|
2330
|
+
const currentFillMode = node.style.animationFillMode;
|
|
2331
|
+
node.style.animationFillMode = "forwards";
|
|
2332
|
+
timeoutId = ownerWindow.setTimeout(() => {
|
|
2333
|
+
if (node.style.animationFillMode === "forwards") node.style.animationFillMode = currentFillMode;
|
|
2334
|
+
});
|
|
2335
|
+
}
|
|
2336
|
+
}
|
|
2337
|
+
};
|
|
2338
|
+
const handleAnimationStart = (event) => {
|
|
2339
|
+
if (event.target === node) prevAnimationNameRef.current = getAnimationName(stylesRef.current);
|
|
2340
|
+
};
|
|
2341
|
+
node.addEventListener("animationstart", handleAnimationStart);
|
|
2342
|
+
node.addEventListener("animationcancel", handleAnimationEnd);
|
|
2343
|
+
node.addEventListener("animationend", handleAnimationEnd);
|
|
2344
|
+
return () => {
|
|
2345
|
+
ownerWindow.clearTimeout(timeoutId);
|
|
2346
|
+
node.removeEventListener("animationstart", handleAnimationStart);
|
|
2347
|
+
node.removeEventListener("animationcancel", handleAnimationEnd);
|
|
2348
|
+
node.removeEventListener("animationend", handleAnimationEnd);
|
|
2349
|
+
};
|
|
2350
|
+
} else send("ANIMATION_END");
|
|
2351
|
+
}, [node, send]);
|
|
2352
|
+
return {
|
|
2353
|
+
isPresent: ["mounted", "unmountSuspended"].includes(state),
|
|
2354
|
+
ref: React$1.useCallback((node2) => {
|
|
2355
|
+
stylesRef.current = node2 ? getComputedStyle(node2) : null;
|
|
2356
|
+
setNode(node2);
|
|
2357
|
+
}, [])
|
|
2358
|
+
};
|
|
2359
|
+
}
|
|
2360
|
+
function getAnimationName(styles) {
|
|
2361
|
+
return styles?.animationName || "none";
|
|
2362
|
+
}
|
|
2363
|
+
function getElementRef(element) {
|
|
2364
|
+
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
|
2365
|
+
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
2366
|
+
if (mayWarn) return element.ref;
|
|
2367
|
+
getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
|
|
2368
|
+
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
2369
|
+
if (mayWarn) return element.props.ref;
|
|
2370
|
+
return element.props.ref || element.ref;
|
|
2371
|
+
}
|
|
2372
|
+
//#endregion
|
|
2373
|
+
//#region ../../node_modules/.pnpm/@radix-ui+react-roving-focus@1.1.11_@types+react-dom@19.2.3_@types+react@19.2.14__@type_b849ea542e77d5b397b1fe12d9f00b2e/node_modules/@radix-ui/react-roving-focus/dist/index.mjs
|
|
2374
|
+
var ENTRY_FOCUS = "rovingFocusGroup.onEntryFocus";
|
|
2375
|
+
var EVENT_OPTIONS = {
|
|
2376
|
+
bubbles: false,
|
|
2377
|
+
cancelable: true
|
|
2378
|
+
};
|
|
2379
|
+
var GROUP_NAME = "RovingFocusGroup";
|
|
2380
|
+
var [Collection, useCollection, createCollectionScope] = createCollection(GROUP_NAME);
|
|
2381
|
+
var [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContextScope(GROUP_NAME, [createCollectionScope]);
|
|
2382
|
+
var [RovingFocusProvider, useRovingFocusContext] = createRovingFocusGroupContext(GROUP_NAME);
|
|
2383
|
+
var RovingFocusGroup = React$1.forwardRef((props, forwardedRef) => {
|
|
2384
|
+
return /* @__PURE__ */ jsx(Collection.Provider, {
|
|
2385
|
+
scope: props.__scopeRovingFocusGroup,
|
|
2386
|
+
children: /* @__PURE__ */ jsx(Collection.Slot, {
|
|
2387
|
+
scope: props.__scopeRovingFocusGroup,
|
|
2388
|
+
children: /* @__PURE__ */ jsx(RovingFocusGroupImpl, {
|
|
2389
|
+
...props,
|
|
2390
|
+
ref: forwardedRef
|
|
2391
|
+
})
|
|
2392
|
+
})
|
|
2393
|
+
});
|
|
2394
|
+
});
|
|
2395
|
+
RovingFocusGroup.displayName = GROUP_NAME;
|
|
2396
|
+
var RovingFocusGroupImpl = React$1.forwardRef((props, forwardedRef) => {
|
|
2397
|
+
const { __scopeRovingFocusGroup, orientation, loop = false, dir, currentTabStopId: currentTabStopIdProp, defaultCurrentTabStopId, onCurrentTabStopIdChange, onEntryFocus, preventScrollOnEntryFocus = false, ...groupProps } = props;
|
|
2398
|
+
const ref = React$1.useRef(null);
|
|
2399
|
+
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
2400
|
+
const direction = useDirection(dir);
|
|
2401
|
+
const [currentTabStopId, setCurrentTabStopId] = useControllableState({
|
|
2402
|
+
prop: currentTabStopIdProp,
|
|
2403
|
+
defaultProp: defaultCurrentTabStopId ?? null,
|
|
2404
|
+
onChange: onCurrentTabStopIdChange,
|
|
2405
|
+
caller: GROUP_NAME
|
|
2406
|
+
});
|
|
2407
|
+
const [isTabbingBackOut, setIsTabbingBackOut] = React$1.useState(false);
|
|
2408
|
+
const handleEntryFocus = useCallbackRef(onEntryFocus);
|
|
2409
|
+
const getItems = useCollection(__scopeRovingFocusGroup);
|
|
2410
|
+
const isClickFocusRef = React$1.useRef(false);
|
|
2411
|
+
const [focusableItemsCount, setFocusableItemsCount] = React$1.useState(0);
|
|
2412
|
+
React$1.useEffect(() => {
|
|
2413
|
+
const node = ref.current;
|
|
2414
|
+
if (node) {
|
|
2415
|
+
node.addEventListener(ENTRY_FOCUS, handleEntryFocus);
|
|
2416
|
+
return () => node.removeEventListener(ENTRY_FOCUS, handleEntryFocus);
|
|
2417
|
+
}
|
|
2418
|
+
}, [handleEntryFocus]);
|
|
2419
|
+
return /* @__PURE__ */ jsx(RovingFocusProvider, {
|
|
2420
|
+
scope: __scopeRovingFocusGroup,
|
|
2421
|
+
orientation,
|
|
2422
|
+
dir: direction,
|
|
2423
|
+
loop,
|
|
2424
|
+
currentTabStopId,
|
|
2425
|
+
onItemFocus: React$1.useCallback((tabStopId) => setCurrentTabStopId(tabStopId), [setCurrentTabStopId]),
|
|
2426
|
+
onItemShiftTab: React$1.useCallback(() => setIsTabbingBackOut(true), []),
|
|
2427
|
+
onFocusableItemAdd: React$1.useCallback(() => setFocusableItemsCount((prevCount) => prevCount + 1), []),
|
|
2428
|
+
onFocusableItemRemove: React$1.useCallback(() => setFocusableItemsCount((prevCount) => prevCount - 1), []),
|
|
2429
|
+
children: /* @__PURE__ */ jsx(Primitive.div, {
|
|
2430
|
+
tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,
|
|
2431
|
+
"data-orientation": orientation,
|
|
2432
|
+
...groupProps,
|
|
2433
|
+
ref: composedRefs,
|
|
2434
|
+
style: {
|
|
2435
|
+
outline: "none",
|
|
2436
|
+
...props.style
|
|
2437
|
+
},
|
|
2438
|
+
onMouseDown: composeEventHandlers(props.onMouseDown, () => {
|
|
2439
|
+
isClickFocusRef.current = true;
|
|
2440
|
+
}),
|
|
2441
|
+
onFocus: composeEventHandlers(props.onFocus, (event) => {
|
|
2442
|
+
const isKeyboardFocus = !isClickFocusRef.current;
|
|
2443
|
+
if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) {
|
|
2444
|
+
const entryFocusEvent = new CustomEvent(ENTRY_FOCUS, EVENT_OPTIONS);
|
|
2445
|
+
event.currentTarget.dispatchEvent(entryFocusEvent);
|
|
2446
|
+
if (!entryFocusEvent.defaultPrevented) {
|
|
2447
|
+
const items = getItems().filter((item) => item.focusable);
|
|
2448
|
+
focusFirst([
|
|
2449
|
+
items.find((item) => item.active),
|
|
2450
|
+
items.find((item) => item.id === currentTabStopId),
|
|
2451
|
+
...items
|
|
2452
|
+
].filter(Boolean).map((item) => item.ref.current), preventScrollOnEntryFocus);
|
|
2453
|
+
}
|
|
2454
|
+
}
|
|
2455
|
+
isClickFocusRef.current = false;
|
|
2456
|
+
}),
|
|
2457
|
+
onBlur: composeEventHandlers(props.onBlur, () => setIsTabbingBackOut(false))
|
|
2458
|
+
})
|
|
2459
|
+
});
|
|
2460
|
+
});
|
|
2461
|
+
var ITEM_NAME = "RovingFocusGroupItem";
|
|
2462
|
+
var RovingFocusGroupItem = React$1.forwardRef((props, forwardedRef) => {
|
|
2463
|
+
const { __scopeRovingFocusGroup, focusable = true, active = false, tabStopId, children, ...itemProps } = props;
|
|
2464
|
+
const autoId = useId$1();
|
|
2465
|
+
const id = tabStopId || autoId;
|
|
2466
|
+
const context = useRovingFocusContext(ITEM_NAME, __scopeRovingFocusGroup);
|
|
2467
|
+
const isCurrentTabStop = context.currentTabStopId === id;
|
|
2468
|
+
const getItems = useCollection(__scopeRovingFocusGroup);
|
|
2469
|
+
const { onFocusableItemAdd, onFocusableItemRemove, currentTabStopId } = context;
|
|
2470
|
+
React$1.useEffect(() => {
|
|
2471
|
+
if (focusable) {
|
|
2472
|
+
onFocusableItemAdd();
|
|
2473
|
+
return () => onFocusableItemRemove();
|
|
2474
|
+
}
|
|
2475
|
+
}, [
|
|
2476
|
+
focusable,
|
|
2477
|
+
onFocusableItemAdd,
|
|
2478
|
+
onFocusableItemRemove
|
|
2479
|
+
]);
|
|
2480
|
+
return /* @__PURE__ */ jsx(Collection.ItemSlot, {
|
|
2481
|
+
scope: __scopeRovingFocusGroup,
|
|
2482
|
+
id,
|
|
2483
|
+
focusable,
|
|
2484
|
+
active,
|
|
2485
|
+
children: /* @__PURE__ */ jsx(Primitive.span, {
|
|
2486
|
+
tabIndex: isCurrentTabStop ? 0 : -1,
|
|
2487
|
+
"data-orientation": context.orientation,
|
|
2488
|
+
...itemProps,
|
|
2489
|
+
ref: forwardedRef,
|
|
2490
|
+
onMouseDown: composeEventHandlers(props.onMouseDown, (event) => {
|
|
2491
|
+
if (!focusable) event.preventDefault();
|
|
2492
|
+
else context.onItemFocus(id);
|
|
2493
|
+
}),
|
|
2494
|
+
onFocus: composeEventHandlers(props.onFocus, () => context.onItemFocus(id)),
|
|
2495
|
+
onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {
|
|
2496
|
+
if (event.key === "Tab" && event.shiftKey) {
|
|
2497
|
+
context.onItemShiftTab();
|
|
2498
|
+
return;
|
|
2499
|
+
}
|
|
2500
|
+
if (event.target !== event.currentTarget) return;
|
|
2501
|
+
const focusIntent = getFocusIntent(event, context.orientation, context.dir);
|
|
2502
|
+
if (focusIntent !== void 0) {
|
|
2503
|
+
if (event.metaKey || event.ctrlKey || event.altKey || event.shiftKey) return;
|
|
2504
|
+
event.preventDefault();
|
|
2505
|
+
let candidateNodes = getItems().filter((item) => item.focusable).map((item) => item.ref.current);
|
|
2506
|
+
if (focusIntent === "last") candidateNodes.reverse();
|
|
2507
|
+
else if (focusIntent === "prev" || focusIntent === "next") {
|
|
2508
|
+
if (focusIntent === "prev") candidateNodes.reverse();
|
|
2509
|
+
const currentIndex = candidateNodes.indexOf(event.currentTarget);
|
|
2510
|
+
candidateNodes = context.loop ? wrapArray(candidateNodes, currentIndex + 1) : candidateNodes.slice(currentIndex + 1);
|
|
2511
|
+
}
|
|
2512
|
+
setTimeout(() => focusFirst(candidateNodes));
|
|
2513
|
+
}
|
|
2514
|
+
}),
|
|
2515
|
+
children: typeof children === "function" ? children({
|
|
2516
|
+
isCurrentTabStop,
|
|
2517
|
+
hasTabStop: currentTabStopId != null
|
|
2518
|
+
}) : children
|
|
2519
|
+
})
|
|
2520
|
+
});
|
|
2521
|
+
});
|
|
2522
|
+
RovingFocusGroupItem.displayName = ITEM_NAME;
|
|
2523
|
+
var MAP_KEY_TO_FOCUS_INTENT = {
|
|
2524
|
+
ArrowLeft: "prev",
|
|
2525
|
+
ArrowUp: "prev",
|
|
2526
|
+
ArrowRight: "next",
|
|
2527
|
+
ArrowDown: "next",
|
|
2528
|
+
PageUp: "first",
|
|
2529
|
+
Home: "first",
|
|
2530
|
+
PageDown: "last",
|
|
2531
|
+
End: "last"
|
|
2532
|
+
};
|
|
2533
|
+
function getDirectionAwareKey(key, dir) {
|
|
2534
|
+
if (dir !== "rtl") return key;
|
|
2535
|
+
return key === "ArrowLeft" ? "ArrowRight" : key === "ArrowRight" ? "ArrowLeft" : key;
|
|
2536
|
+
}
|
|
2537
|
+
function getFocusIntent(event, orientation, dir) {
|
|
2538
|
+
const key = getDirectionAwareKey(event.key, dir);
|
|
2539
|
+
if (orientation === "vertical" && ["ArrowLeft", "ArrowRight"].includes(key)) return void 0;
|
|
2540
|
+
if (orientation === "horizontal" && ["ArrowUp", "ArrowDown"].includes(key)) return void 0;
|
|
2541
|
+
return MAP_KEY_TO_FOCUS_INTENT[key];
|
|
2542
|
+
}
|
|
2543
|
+
function focusFirst(candidates, preventScroll = false) {
|
|
2544
|
+
const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;
|
|
2545
|
+
for (const candidate of candidates) {
|
|
2546
|
+
if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;
|
|
2547
|
+
candidate.focus({ preventScroll });
|
|
2548
|
+
if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;
|
|
2549
|
+
}
|
|
2550
|
+
}
|
|
2551
|
+
function wrapArray(array, startIndex) {
|
|
2552
|
+
return array.map((_, index) => array[(startIndex + index) % array.length]);
|
|
2553
|
+
}
|
|
2554
|
+
var Root = RovingFocusGroup;
|
|
2555
|
+
var Item = RovingFocusGroupItem;
|
|
2556
|
+
//#endregion
|
|
2557
|
+
//#region ../../node_modules/.pnpm/@radix-ui+react-tabs@1.1.13_@types+react-dom@19.2.3_@types+react@19.2.14__@types+react@_08684373bbac196273bdefb5472f93a8/node_modules/@radix-ui/react-tabs/dist/index.mjs
|
|
2558
|
+
var TABS_NAME = "Tabs";
|
|
2559
|
+
var [createTabsContext, createTabsScope] = createContextScope(TABS_NAME, [createRovingFocusGroupScope]);
|
|
2560
|
+
var useRovingFocusGroupScope = createRovingFocusGroupScope();
|
|
2561
|
+
var [TabsProvider, useTabsContext] = createTabsContext(TABS_NAME);
|
|
2562
|
+
var Tabs = React$1.forwardRef((props, forwardedRef) => {
|
|
2563
|
+
const { __scopeTabs, value: valueProp, onValueChange, defaultValue, orientation = "horizontal", dir, activationMode = "automatic", ...tabsProps } = props;
|
|
2564
|
+
const direction = useDirection(dir);
|
|
2565
|
+
const [value, setValue] = useControllableState({
|
|
2566
|
+
prop: valueProp,
|
|
2567
|
+
onChange: onValueChange,
|
|
2568
|
+
defaultProp: defaultValue ?? "",
|
|
2569
|
+
caller: TABS_NAME
|
|
2570
|
+
});
|
|
2571
|
+
return /* @__PURE__ */ jsx(TabsProvider, {
|
|
2572
|
+
scope: __scopeTabs,
|
|
2573
|
+
baseId: useId$1(),
|
|
2574
|
+
value,
|
|
2575
|
+
onValueChange: setValue,
|
|
2576
|
+
orientation,
|
|
2577
|
+
dir: direction,
|
|
2578
|
+
activationMode,
|
|
2579
|
+
children: /* @__PURE__ */ jsx(Primitive.div, {
|
|
2580
|
+
dir: direction,
|
|
2581
|
+
"data-orientation": orientation,
|
|
2582
|
+
...tabsProps,
|
|
2583
|
+
ref: forwardedRef
|
|
2584
|
+
})
|
|
2585
|
+
});
|
|
2586
|
+
});
|
|
2587
|
+
Tabs.displayName = TABS_NAME;
|
|
2588
|
+
var TAB_LIST_NAME = "TabsList";
|
|
2589
|
+
var TabsList = React$1.forwardRef((props, forwardedRef) => {
|
|
2590
|
+
const { __scopeTabs, loop = true, ...listProps } = props;
|
|
2591
|
+
const context = useTabsContext(TAB_LIST_NAME, __scopeTabs);
|
|
2592
|
+
return /* @__PURE__ */ jsx(Root, {
|
|
2593
|
+
asChild: true,
|
|
2594
|
+
...useRovingFocusGroupScope(__scopeTabs),
|
|
2595
|
+
orientation: context.orientation,
|
|
2596
|
+
dir: context.dir,
|
|
2597
|
+
loop,
|
|
2598
|
+
children: /* @__PURE__ */ jsx(Primitive.div, {
|
|
2599
|
+
role: "tablist",
|
|
2600
|
+
"aria-orientation": context.orientation,
|
|
2601
|
+
...listProps,
|
|
2602
|
+
ref: forwardedRef
|
|
2603
|
+
})
|
|
2604
|
+
});
|
|
2605
|
+
});
|
|
2606
|
+
TabsList.displayName = TAB_LIST_NAME;
|
|
2607
|
+
var TRIGGER_NAME = "TabsTrigger";
|
|
2608
|
+
var TabsTrigger = React$1.forwardRef((props, forwardedRef) => {
|
|
2609
|
+
const { __scopeTabs, value, disabled = false, ...triggerProps } = props;
|
|
2610
|
+
const context = useTabsContext(TRIGGER_NAME, __scopeTabs);
|
|
2611
|
+
const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeTabs);
|
|
2612
|
+
const triggerId = makeTriggerId(context.baseId, value);
|
|
2613
|
+
const contentId = makeContentId(context.baseId, value);
|
|
2614
|
+
const isSelected = value === context.value;
|
|
2615
|
+
return /* @__PURE__ */ jsx(Item, {
|
|
2616
|
+
asChild: true,
|
|
2617
|
+
...rovingFocusGroupScope,
|
|
2618
|
+
focusable: !disabled,
|
|
2619
|
+
active: isSelected,
|
|
2620
|
+
children: /* @__PURE__ */ jsx(Primitive.button, {
|
|
2621
|
+
type: "button",
|
|
2622
|
+
role: "tab",
|
|
2623
|
+
"aria-selected": isSelected,
|
|
2624
|
+
"aria-controls": contentId,
|
|
2625
|
+
"data-state": isSelected ? "active" : "inactive",
|
|
2626
|
+
"data-disabled": disabled ? "" : void 0,
|
|
2627
|
+
disabled,
|
|
2628
|
+
id: triggerId,
|
|
2629
|
+
...triggerProps,
|
|
2630
|
+
ref: forwardedRef,
|
|
2631
|
+
onMouseDown: composeEventHandlers(props.onMouseDown, (event) => {
|
|
2632
|
+
if (!disabled && event.button === 0 && event.ctrlKey === false) context.onValueChange(value);
|
|
2633
|
+
else event.preventDefault();
|
|
2634
|
+
}),
|
|
2635
|
+
onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {
|
|
2636
|
+
if ([" ", "Enter"].includes(event.key)) context.onValueChange(value);
|
|
2637
|
+
}),
|
|
2638
|
+
onFocus: composeEventHandlers(props.onFocus, () => {
|
|
2639
|
+
const isAutomaticActivation = context.activationMode !== "manual";
|
|
2640
|
+
if (!isSelected && !disabled && isAutomaticActivation) context.onValueChange(value);
|
|
2641
|
+
})
|
|
2642
|
+
})
|
|
2643
|
+
});
|
|
2644
|
+
});
|
|
2645
|
+
TabsTrigger.displayName = TRIGGER_NAME;
|
|
2646
|
+
var CONTENT_NAME = "TabsContent";
|
|
2647
|
+
var TabsContent = React$1.forwardRef((props, forwardedRef) => {
|
|
2648
|
+
const { __scopeTabs, value, forceMount, children, ...contentProps } = props;
|
|
2649
|
+
const context = useTabsContext(CONTENT_NAME, __scopeTabs);
|
|
2650
|
+
const triggerId = makeTriggerId(context.baseId, value);
|
|
2651
|
+
const contentId = makeContentId(context.baseId, value);
|
|
2652
|
+
const isSelected = value === context.value;
|
|
2653
|
+
const isMountAnimationPreventedRef = React$1.useRef(isSelected);
|
|
2654
|
+
React$1.useEffect(() => {
|
|
2655
|
+
const rAF = requestAnimationFrame(() => isMountAnimationPreventedRef.current = false);
|
|
2656
|
+
return () => cancelAnimationFrame(rAF);
|
|
2657
|
+
}, []);
|
|
2658
|
+
return /* @__PURE__ */ jsx(Presence, {
|
|
2659
|
+
present: forceMount || isSelected,
|
|
2660
|
+
children: ({ present }) => /* @__PURE__ */ jsx(Primitive.div, {
|
|
2661
|
+
"data-state": isSelected ? "active" : "inactive",
|
|
2662
|
+
"data-orientation": context.orientation,
|
|
2663
|
+
role: "tabpanel",
|
|
2664
|
+
"aria-labelledby": triggerId,
|
|
2665
|
+
hidden: !present,
|
|
2666
|
+
id: contentId,
|
|
2667
|
+
tabIndex: 0,
|
|
2668
|
+
...contentProps,
|
|
2669
|
+
ref: forwardedRef,
|
|
2670
|
+
style: {
|
|
2671
|
+
...props.style,
|
|
2672
|
+
animationDuration: isMountAnimationPreventedRef.current ? "0s" : void 0
|
|
2673
|
+
},
|
|
2674
|
+
children: present && children
|
|
2675
|
+
})
|
|
2676
|
+
});
|
|
2677
|
+
});
|
|
2678
|
+
TabsContent.displayName = CONTENT_NAME;
|
|
2679
|
+
function makeTriggerId(baseId, value) {
|
|
2680
|
+
return `${baseId}-trigger-${value}`;
|
|
2681
|
+
}
|
|
2682
|
+
function makeContentId(baseId, value) {
|
|
2683
|
+
return `${baseId}-content-${value}`;
|
|
2684
|
+
}
|
|
2685
|
+
var Root2 = Tabs;
|
|
2686
|
+
var List = TabsList;
|
|
2687
|
+
var Trigger = TabsTrigger;
|
|
2688
|
+
var Content = TabsContent;
|
|
2689
|
+
//#endregion
|
|
2690
|
+
export { twMerge as C, twJoin as S, useLayoutEffect2 as _, Item as a, useComposedRefs as b, Presence as c, useDirection as d, createCollection as f, useControllableState as g, createSlot as h, Trigger as i, useId$1 as l, dispatchDiscreteCustomEvent as m, List as n, Root as o, Primitive as p, Root2 as r, createRovingFocusGroupScope as s, Content as t, useCallbackRef as u, createContextScope as v, composeEventHandlers as x, composeRefs as y };
|
|
2691
|
+
|
|
2692
|
+
//# sourceMappingURL=dist-BeZaEP6S.mjs.map
|