@iconoma/cli 0.0.1-beta.1
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/README.md +374 -0
- package/bin/run.cmd +3 -0
- package/bin/run.js +5 -0
- package/dist/commands/studio.d.ts +11 -0
- package/dist/commands/studio.d.ts.map +1 -0
- package/dist/commands/studio.js +34 -0
- package/dist/get-studio.d.ts +9 -0
- package/dist/get-studio.d.ts.map +1 -0
- package/dist/get-studio.js +4 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -0
- package/dist/studio/128.index.js +55 -0
- package/dist/studio/143.index.js +2457 -0
- package/dist/studio/148.index.js +744 -0
- package/dist/studio/211.index.js +47186 -0
- package/dist/studio/22.index.js +5942 -0
- package/dist/studio/437.index.js +20 -0
- package/dist/studio/509.index.js +2240 -0
- package/dist/studio/533.index.js +883 -0
- package/dist/studio/537.index.js +62 -0
- package/dist/studio/542.index.js +22 -0
- package/dist/studio/543.index.js +8172 -0
- package/dist/studio/593.index.js +38099 -0
- package/dist/studio/777.index.js +24 -0
- package/dist/studio/786.index.js +1065 -0
- package/dist/studio/860.index.js +13 -0
- package/dist/studio/876.index.js +3848 -0
- package/dist/studio/940.index.js +6772 -0
- package/dist/studio/951.index.js +98 -0
- package/dist/studio/c4c9b2153fb0d143f75f.js +1 -0
- package/dist/studio/client/assets/index-BD3Y-97G.css +2 -0
- package/dist/studio/client/assets/index-Dk8OjIgh.js +53 -0
- package/dist/studio/client/favicon.ico +0 -0
- package/dist/studio/client/index.html +21 -0
- package/dist/studio/index.js +22188 -0
- package/dist/studio/package.json +3 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/oclif.manifest.json +37 -0
- package/package.json +75 -0
|
@@ -0,0 +1,3848 @@
|
|
|
1
|
+
export const id = 876;
|
|
2
|
+
export const ids = [876];
|
|
3
|
+
export const modules = {
|
|
4
|
+
|
|
5
|
+
/***/ 2876:
|
|
6
|
+
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
7
|
+
|
|
8
|
+
var react__WEBPACK_IMPORTED_MODULE_0___namespace_cache;
|
|
9
|
+
__webpack_require__.r(__webpack_exports__);
|
|
10
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
11
|
+
/* harmony export */ render: () => (/* binding */ render)
|
|
12
|
+
/* harmony export */ });
|
|
13
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(236);
|
|
14
|
+
/* harmony import */ var react_dom_server__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8150);
|
|
15
|
+
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(32);
|
|
16
|
+
/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5);
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
var ThemeProviderContext = (0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)({
|
|
24
|
+
theme: "system",
|
|
25
|
+
setTheme: () => null
|
|
26
|
+
});
|
|
27
|
+
function ThemeProvider({ children, defaultTheme = "system", storageKey = "iconoma-studio-theme", ...props }) {
|
|
28
|
+
const [theme, setTheme] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(() => (typeof window !== "undefined" ? localStorage.getItem(storageKey) : defaultTheme) || defaultTheme);
|
|
29
|
+
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
|
30
|
+
const root = window.document.documentElement;
|
|
31
|
+
root.classList.remove("light", "dark");
|
|
32
|
+
if (theme === "system") {
|
|
33
|
+
const systemTheme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
34
|
+
root.classList.add(systemTheme);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
root.classList.add(theme);
|
|
38
|
+
}, [theme]);
|
|
39
|
+
const value = {
|
|
40
|
+
theme,
|
|
41
|
+
setTheme: (theme$1) => {
|
|
42
|
+
setTheme(theme$1);
|
|
43
|
+
if (typeof window === "undefined") return;
|
|
44
|
+
localStorage.setItem(storageKey, theme$1);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(ThemeProviderContext.Provider, {
|
|
48
|
+
...props,
|
|
49
|
+
value,
|
|
50
|
+
children
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
function setRef(ref, value) {
|
|
54
|
+
if (typeof ref === "function") return ref(value);
|
|
55
|
+
else if (ref !== null && ref !== void 0) ref.current = value;
|
|
56
|
+
}
|
|
57
|
+
function composeRefs(...refs) {
|
|
58
|
+
return (node) => {
|
|
59
|
+
let hasCleanup = false;
|
|
60
|
+
const cleanups = refs.map((ref) => {
|
|
61
|
+
const cleanup = setRef(ref, node);
|
|
62
|
+
if (!hasCleanup && typeof cleanup == "function") hasCleanup = true;
|
|
63
|
+
return cleanup;
|
|
64
|
+
});
|
|
65
|
+
if (hasCleanup) return () => {
|
|
66
|
+
for (let i = 0; i < cleanups.length; i++) {
|
|
67
|
+
const cleanup = cleanups[i];
|
|
68
|
+
if (typeof cleanup == "function") cleanup();
|
|
69
|
+
else setRef(refs[i], null);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
function useComposedRefs(...refs) {
|
|
75
|
+
return react__WEBPACK_IMPORTED_MODULE_0__.useCallback(composeRefs(...refs), refs);
|
|
76
|
+
}
|
|
77
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
78
|
+
function createSlot(ownerName) {
|
|
79
|
+
const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
|
|
80
|
+
const Slot2 = react__WEBPACK_IMPORTED_MODULE_0__.forwardRef((props, forwardedRef) => {
|
|
81
|
+
const { children, ...slotProps } = props;
|
|
82
|
+
const childrenArray = react__WEBPACK_IMPORTED_MODULE_0__.Children.toArray(children);
|
|
83
|
+
const slottable = childrenArray.find(isSlottable);
|
|
84
|
+
if (slottable) {
|
|
85
|
+
const newElement = slottable.props.children;
|
|
86
|
+
const newChildren = childrenArray.map((child) => {
|
|
87
|
+
if (child === slottable) {
|
|
88
|
+
if (react__WEBPACK_IMPORTED_MODULE_0__.Children.count(newElement) > 1) return react__WEBPACK_IMPORTED_MODULE_0__.Children.only(null);
|
|
89
|
+
return react__WEBPACK_IMPORTED_MODULE_0__.isValidElement(newElement) ? newElement.props.children : null;
|
|
90
|
+
} else return child;
|
|
91
|
+
});
|
|
92
|
+
return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(SlotClone, {
|
|
93
|
+
...slotProps,
|
|
94
|
+
ref: forwardedRef,
|
|
95
|
+
children: react__WEBPACK_IMPORTED_MODULE_0__.isValidElement(newElement) ? react__WEBPACK_IMPORTED_MODULE_0__.cloneElement(newElement, void 0, newChildren) : null
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(SlotClone, {
|
|
99
|
+
...slotProps,
|
|
100
|
+
ref: forwardedRef,
|
|
101
|
+
children
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
Slot2.displayName = `${ownerName}.Slot`;
|
|
105
|
+
return Slot2;
|
|
106
|
+
}
|
|
107
|
+
var Slot$1 = /* @__PURE__ */ createSlot("Slot");
|
|
108
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
109
|
+
function createSlotClone(ownerName) {
|
|
110
|
+
const SlotClone = react__WEBPACK_IMPORTED_MODULE_0__.forwardRef((props, forwardedRef) => {
|
|
111
|
+
const { children, ...slotProps } = props;
|
|
112
|
+
if (react__WEBPACK_IMPORTED_MODULE_0__.isValidElement(children)) {
|
|
113
|
+
const childrenRef = getElementRef$1(children);
|
|
114
|
+
const props2 = mergeProps(slotProps, children.props);
|
|
115
|
+
if (children.type !== react__WEBPACK_IMPORTED_MODULE_0__.Fragment) props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
116
|
+
return react__WEBPACK_IMPORTED_MODULE_0__.cloneElement(children, props2);
|
|
117
|
+
}
|
|
118
|
+
return react__WEBPACK_IMPORTED_MODULE_0__.Children.count(children) > 1 ? react__WEBPACK_IMPORTED_MODULE_0__.Children.only(null) : null;
|
|
119
|
+
});
|
|
120
|
+
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
121
|
+
return SlotClone;
|
|
122
|
+
}
|
|
123
|
+
var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
|
|
124
|
+
function isSlottable(child) {
|
|
125
|
+
return react__WEBPACK_IMPORTED_MODULE_0__.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
|
126
|
+
}
|
|
127
|
+
function mergeProps(slotProps, childProps) {
|
|
128
|
+
const overrideProps = { ...childProps };
|
|
129
|
+
for (const propName in childProps) {
|
|
130
|
+
const slotPropValue = slotProps[propName];
|
|
131
|
+
const childPropValue = childProps[propName];
|
|
132
|
+
if (/^on[A-Z]/.test(propName)) {
|
|
133
|
+
if (slotPropValue && childPropValue) overrideProps[propName] = (...args) => {
|
|
134
|
+
const result = childPropValue(...args);
|
|
135
|
+
slotPropValue(...args);
|
|
136
|
+
return result;
|
|
137
|
+
};
|
|
138
|
+
else if (slotPropValue) overrideProps[propName] = slotPropValue;
|
|
139
|
+
} else if (propName === "style") overrideProps[propName] = {
|
|
140
|
+
...slotPropValue,
|
|
141
|
+
...childPropValue
|
|
142
|
+
};
|
|
143
|
+
else if (propName === "className") overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
|
|
144
|
+
}
|
|
145
|
+
return {
|
|
146
|
+
...slotProps,
|
|
147
|
+
...overrideProps
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
function getElementRef$1(element) {
|
|
151
|
+
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
|
152
|
+
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
153
|
+
if (mayWarn) return element.ref;
|
|
154
|
+
getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
|
|
155
|
+
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
156
|
+
if (mayWarn) return element.props.ref;
|
|
157
|
+
return element.props.ref || element.ref;
|
|
158
|
+
}
|
|
159
|
+
function r(e) {
|
|
160
|
+
var t, f, n = "";
|
|
161
|
+
if ("string" == typeof e || "number" == typeof e) n += e;
|
|
162
|
+
else if ("object" == typeof e) if (Array.isArray(e)) {
|
|
163
|
+
var o = e.length;
|
|
164
|
+
for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
165
|
+
} else for (f in e) e[f] && (n && (n += " "), n += f);
|
|
166
|
+
return n;
|
|
167
|
+
}
|
|
168
|
+
function clsx() {
|
|
169
|
+
for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
170
|
+
return n;
|
|
171
|
+
}
|
|
172
|
+
var falsyToString = (value) => typeof value === "boolean" ? `${value}` : value === 0 ? "0" : value;
|
|
173
|
+
const cx = clsx;
|
|
174
|
+
const cva = (base, config) => (props) => {
|
|
175
|
+
var _config_compoundVariants;
|
|
176
|
+
if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
|
|
177
|
+
const { variants, defaultVariants } = config;
|
|
178
|
+
const getVariantClassNames = Object.keys(variants).map((variant) => {
|
|
179
|
+
const variantProp = props === null || props === void 0 ? void 0 : props[variant];
|
|
180
|
+
const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];
|
|
181
|
+
if (variantProp === null) return null;
|
|
182
|
+
const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);
|
|
183
|
+
return variants[variant][variantKey];
|
|
184
|
+
});
|
|
185
|
+
const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param) => {
|
|
186
|
+
let [key, value] = param;
|
|
187
|
+
if (value === void 0) return acc;
|
|
188
|
+
acc[key] = value;
|
|
189
|
+
return acc;
|
|
190
|
+
}, {});
|
|
191
|
+
return cx(base, getVariantClassNames, config === null || config === void 0 ? void 0 : (_config_compoundVariants = config.compoundVariants) === null || _config_compoundVariants === void 0 ? void 0 : _config_compoundVariants.reduce((acc, param) => {
|
|
192
|
+
let { class: cvClass, className: cvClassName, ...compoundVariantOptions } = param;
|
|
193
|
+
return Object.entries(compoundVariantOptions).every((param$1) => {
|
|
194
|
+
let [key, value] = param$1;
|
|
195
|
+
return Array.isArray(value) ? value.includes({
|
|
196
|
+
...defaultVariants,
|
|
197
|
+
...propsWithoutUndefined
|
|
198
|
+
}[key]) : {
|
|
199
|
+
...defaultVariants,
|
|
200
|
+
...propsWithoutUndefined
|
|
201
|
+
}[key] === value;
|
|
202
|
+
}) ? [
|
|
203
|
+
...acc,
|
|
204
|
+
cvClass,
|
|
205
|
+
cvClassName
|
|
206
|
+
] : acc;
|
|
207
|
+
}, []), props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
|
|
208
|
+
};
|
|
209
|
+
var CLASS_PART_SEPARATOR = "-";
|
|
210
|
+
var createClassGroupUtils = (config) => {
|
|
211
|
+
const classMap = createClassMap(config);
|
|
212
|
+
const { conflictingClassGroups, conflictingClassGroupModifiers } = config;
|
|
213
|
+
const getClassGroupId = (className) => {
|
|
214
|
+
const classParts = className.split(CLASS_PART_SEPARATOR);
|
|
215
|
+
if (classParts[0] === "" && classParts.length !== 1) classParts.shift();
|
|
216
|
+
return getGroupRecursive(classParts, classMap) || getGroupIdForArbitraryProperty(className);
|
|
217
|
+
};
|
|
218
|
+
const getConflictingClassGroupIds = (classGroupId, hasPostfixModifier) => {
|
|
219
|
+
const conflicts = conflictingClassGroups[classGroupId] || [];
|
|
220
|
+
if (hasPostfixModifier && conflictingClassGroupModifiers[classGroupId]) return [...conflicts, ...conflictingClassGroupModifiers[classGroupId]];
|
|
221
|
+
return conflicts;
|
|
222
|
+
};
|
|
223
|
+
return {
|
|
224
|
+
getClassGroupId,
|
|
225
|
+
getConflictingClassGroupIds
|
|
226
|
+
};
|
|
227
|
+
};
|
|
228
|
+
var getGroupRecursive = (classParts, classPartObject) => {
|
|
229
|
+
if (classParts.length === 0) return classPartObject.classGroupId;
|
|
230
|
+
const currentClassPart = classParts[0];
|
|
231
|
+
const nextClassPartObject = classPartObject.nextPart.get(currentClassPart);
|
|
232
|
+
const classGroupFromNextClassPart = nextClassPartObject ? getGroupRecursive(classParts.slice(1), nextClassPartObject) : void 0;
|
|
233
|
+
if (classGroupFromNextClassPart) return classGroupFromNextClassPart;
|
|
234
|
+
if (classPartObject.validators.length === 0) return;
|
|
235
|
+
const classRest = classParts.join(CLASS_PART_SEPARATOR);
|
|
236
|
+
return classPartObject.validators.find(({ validator }) => validator(classRest))?.classGroupId;
|
|
237
|
+
};
|
|
238
|
+
var arbitraryPropertyRegex = /^\[(.+)\]$/;
|
|
239
|
+
var getGroupIdForArbitraryProperty = (className) => {
|
|
240
|
+
if (arbitraryPropertyRegex.test(className)) {
|
|
241
|
+
const arbitraryPropertyClassName = arbitraryPropertyRegex.exec(className)[1];
|
|
242
|
+
const property = arbitraryPropertyClassName?.substring(0, arbitraryPropertyClassName.indexOf(":"));
|
|
243
|
+
if (property) return "arbitrary.." + property;
|
|
244
|
+
}
|
|
245
|
+
};
|
|
246
|
+
var createClassMap = (config) => {
|
|
247
|
+
const { theme, classGroups } = config;
|
|
248
|
+
const classMap = {
|
|
249
|
+
nextPart: /* @__PURE__ */ new Map(),
|
|
250
|
+
validators: []
|
|
251
|
+
};
|
|
252
|
+
for (const classGroupId in classGroups) processClassesRecursively(classGroups[classGroupId], classMap, classGroupId, theme);
|
|
253
|
+
return classMap;
|
|
254
|
+
};
|
|
255
|
+
var processClassesRecursively = (classGroup, classPartObject, classGroupId, theme) => {
|
|
256
|
+
classGroup.forEach((classDefinition) => {
|
|
257
|
+
if (typeof classDefinition === "string") {
|
|
258
|
+
const classPartObjectToEdit = classDefinition === "" ? classPartObject : getPart(classPartObject, classDefinition);
|
|
259
|
+
classPartObjectToEdit.classGroupId = classGroupId;
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
if (typeof classDefinition === "function") {
|
|
263
|
+
if (isThemeGetter(classDefinition)) {
|
|
264
|
+
processClassesRecursively(classDefinition(theme), classPartObject, classGroupId, theme);
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
classPartObject.validators.push({
|
|
268
|
+
validator: classDefinition,
|
|
269
|
+
classGroupId
|
|
270
|
+
});
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
273
|
+
Object.entries(classDefinition).forEach(([key, classGroup$1]) => {
|
|
274
|
+
processClassesRecursively(classGroup$1, getPart(classPartObject, key), classGroupId, theme);
|
|
275
|
+
});
|
|
276
|
+
});
|
|
277
|
+
};
|
|
278
|
+
var getPart = (classPartObject, path) => {
|
|
279
|
+
let currentClassPartObject = classPartObject;
|
|
280
|
+
path.split(CLASS_PART_SEPARATOR).forEach((pathPart) => {
|
|
281
|
+
if (!currentClassPartObject.nextPart.has(pathPart)) currentClassPartObject.nextPart.set(pathPart, {
|
|
282
|
+
nextPart: /* @__PURE__ */ new Map(),
|
|
283
|
+
validators: []
|
|
284
|
+
});
|
|
285
|
+
currentClassPartObject = currentClassPartObject.nextPart.get(pathPart);
|
|
286
|
+
});
|
|
287
|
+
return currentClassPartObject;
|
|
288
|
+
};
|
|
289
|
+
var isThemeGetter = (func) => func.isThemeGetter;
|
|
290
|
+
var createLruCache = (maxCacheSize) => {
|
|
291
|
+
if (maxCacheSize < 1) return {
|
|
292
|
+
get: () => void 0,
|
|
293
|
+
set: () => {}
|
|
294
|
+
};
|
|
295
|
+
let cacheSize = 0;
|
|
296
|
+
let cache = /* @__PURE__ */ new Map();
|
|
297
|
+
let previousCache = /* @__PURE__ */ new Map();
|
|
298
|
+
const update = (key, value) => {
|
|
299
|
+
cache.set(key, value);
|
|
300
|
+
cacheSize++;
|
|
301
|
+
if (cacheSize > maxCacheSize) {
|
|
302
|
+
cacheSize = 0;
|
|
303
|
+
previousCache = cache;
|
|
304
|
+
cache = /* @__PURE__ */ new Map();
|
|
305
|
+
}
|
|
306
|
+
};
|
|
307
|
+
return {
|
|
308
|
+
get(key) {
|
|
309
|
+
let value = cache.get(key);
|
|
310
|
+
if (value !== void 0) return value;
|
|
311
|
+
if ((value = previousCache.get(key)) !== void 0) {
|
|
312
|
+
update(key, value);
|
|
313
|
+
return value;
|
|
314
|
+
}
|
|
315
|
+
},
|
|
316
|
+
set(key, value) {
|
|
317
|
+
if (cache.has(key)) cache.set(key, value);
|
|
318
|
+
else update(key, value);
|
|
319
|
+
}
|
|
320
|
+
};
|
|
321
|
+
};
|
|
322
|
+
var IMPORTANT_MODIFIER = "!";
|
|
323
|
+
var MODIFIER_SEPARATOR = ":";
|
|
324
|
+
var MODIFIER_SEPARATOR_LENGTH = 1;
|
|
325
|
+
var createParseClassName = (config) => {
|
|
326
|
+
const { prefix, experimentalParseClassName } = config;
|
|
327
|
+
let parseClassName = (className) => {
|
|
328
|
+
const modifiers = [];
|
|
329
|
+
let bracketDepth = 0;
|
|
330
|
+
let parenDepth = 0;
|
|
331
|
+
let modifierStart = 0;
|
|
332
|
+
let postfixModifierPosition;
|
|
333
|
+
for (let index = 0; index < className.length; index++) {
|
|
334
|
+
let currentCharacter = className[index];
|
|
335
|
+
if (bracketDepth === 0 && parenDepth === 0) {
|
|
336
|
+
if (currentCharacter === MODIFIER_SEPARATOR) {
|
|
337
|
+
modifiers.push(className.slice(modifierStart, index));
|
|
338
|
+
modifierStart = index + MODIFIER_SEPARATOR_LENGTH;
|
|
339
|
+
continue;
|
|
340
|
+
}
|
|
341
|
+
if (currentCharacter === "/") {
|
|
342
|
+
postfixModifierPosition = index;
|
|
343
|
+
continue;
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
if (currentCharacter === "[") bracketDepth++;
|
|
347
|
+
else if (currentCharacter === "]") bracketDepth--;
|
|
348
|
+
else if (currentCharacter === "(") parenDepth++;
|
|
349
|
+
else if (currentCharacter === ")") parenDepth--;
|
|
350
|
+
}
|
|
351
|
+
const baseClassNameWithImportantModifier = modifiers.length === 0 ? className : className.substring(modifierStart);
|
|
352
|
+
const baseClassName = stripImportantModifier(baseClassNameWithImportantModifier);
|
|
353
|
+
return {
|
|
354
|
+
modifiers,
|
|
355
|
+
hasImportantModifier: baseClassName !== baseClassNameWithImportantModifier,
|
|
356
|
+
baseClassName,
|
|
357
|
+
maybePostfixModifierPosition: postfixModifierPosition && postfixModifierPosition > modifierStart ? postfixModifierPosition - modifierStart : void 0
|
|
358
|
+
};
|
|
359
|
+
};
|
|
360
|
+
if (prefix) {
|
|
361
|
+
const fullPrefix = prefix + MODIFIER_SEPARATOR;
|
|
362
|
+
const parseClassNameOriginal = parseClassName;
|
|
363
|
+
parseClassName = (className) => className.startsWith(fullPrefix) ? parseClassNameOriginal(className.substring(fullPrefix.length)) : {
|
|
364
|
+
isExternal: true,
|
|
365
|
+
modifiers: [],
|
|
366
|
+
hasImportantModifier: false,
|
|
367
|
+
baseClassName: className,
|
|
368
|
+
maybePostfixModifierPosition: void 0
|
|
369
|
+
};
|
|
370
|
+
}
|
|
371
|
+
if (experimentalParseClassName) {
|
|
372
|
+
const parseClassNameOriginal = parseClassName;
|
|
373
|
+
parseClassName = (className) => experimentalParseClassName({
|
|
374
|
+
className,
|
|
375
|
+
parseClassName: parseClassNameOriginal
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
return parseClassName;
|
|
379
|
+
};
|
|
380
|
+
var stripImportantModifier = (baseClassName) => {
|
|
381
|
+
if (baseClassName.endsWith(IMPORTANT_MODIFIER)) return baseClassName.substring(0, baseClassName.length - 1);
|
|
382
|
+
if (baseClassName.startsWith(IMPORTANT_MODIFIER)) return baseClassName.substring(1);
|
|
383
|
+
return baseClassName;
|
|
384
|
+
};
|
|
385
|
+
var createSortModifiers = (config) => {
|
|
386
|
+
const orderSensitiveModifiers = Object.fromEntries(config.orderSensitiveModifiers.map((modifier) => [modifier, true]));
|
|
387
|
+
const sortModifiers = (modifiers) => {
|
|
388
|
+
if (modifiers.length <= 1) return modifiers;
|
|
389
|
+
const sortedModifiers = [];
|
|
390
|
+
let unsortedModifiers = [];
|
|
391
|
+
modifiers.forEach((modifier) => {
|
|
392
|
+
if (modifier[0] === "[" || orderSensitiveModifiers[modifier]) {
|
|
393
|
+
sortedModifiers.push(...unsortedModifiers.sort(), modifier);
|
|
394
|
+
unsortedModifiers = [];
|
|
395
|
+
} else unsortedModifiers.push(modifier);
|
|
396
|
+
});
|
|
397
|
+
sortedModifiers.push(...unsortedModifiers.sort());
|
|
398
|
+
return sortedModifiers;
|
|
399
|
+
};
|
|
400
|
+
return sortModifiers;
|
|
401
|
+
};
|
|
402
|
+
var createConfigUtils = (config) => ({
|
|
403
|
+
cache: createLruCache(config.cacheSize),
|
|
404
|
+
parseClassName: createParseClassName(config),
|
|
405
|
+
sortModifiers: createSortModifiers(config),
|
|
406
|
+
...createClassGroupUtils(config)
|
|
407
|
+
});
|
|
408
|
+
var SPLIT_CLASSES_REGEX = /\s+/;
|
|
409
|
+
var mergeClassList = (classList, configUtils) => {
|
|
410
|
+
const { parseClassName, getClassGroupId, getConflictingClassGroupIds, sortModifiers } = configUtils;
|
|
411
|
+
const classGroupsInConflict = [];
|
|
412
|
+
const classNames = classList.trim().split(SPLIT_CLASSES_REGEX);
|
|
413
|
+
let result = "";
|
|
414
|
+
for (let index = classNames.length - 1; index >= 0; index -= 1) {
|
|
415
|
+
const originalClassName = classNames[index];
|
|
416
|
+
const { isExternal, modifiers, hasImportantModifier, baseClassName, maybePostfixModifierPosition } = parseClassName(originalClassName);
|
|
417
|
+
if (isExternal) {
|
|
418
|
+
result = originalClassName + (result.length > 0 ? " " + result : result);
|
|
419
|
+
continue;
|
|
420
|
+
}
|
|
421
|
+
let hasPostfixModifier = !!maybePostfixModifierPosition;
|
|
422
|
+
let classGroupId = getClassGroupId(hasPostfixModifier ? baseClassName.substring(0, maybePostfixModifierPosition) : baseClassName);
|
|
423
|
+
if (!classGroupId) {
|
|
424
|
+
if (!hasPostfixModifier) {
|
|
425
|
+
result = originalClassName + (result.length > 0 ? " " + result : result);
|
|
426
|
+
continue;
|
|
427
|
+
}
|
|
428
|
+
classGroupId = getClassGroupId(baseClassName);
|
|
429
|
+
if (!classGroupId) {
|
|
430
|
+
result = originalClassName + (result.length > 0 ? " " + result : result);
|
|
431
|
+
continue;
|
|
432
|
+
}
|
|
433
|
+
hasPostfixModifier = false;
|
|
434
|
+
}
|
|
435
|
+
const variantModifier = sortModifiers(modifiers).join(":");
|
|
436
|
+
const modifierId = hasImportantModifier ? variantModifier + IMPORTANT_MODIFIER : variantModifier;
|
|
437
|
+
const classId = modifierId + classGroupId;
|
|
438
|
+
if (classGroupsInConflict.includes(classId)) continue;
|
|
439
|
+
classGroupsInConflict.push(classId);
|
|
440
|
+
const conflictGroups = getConflictingClassGroupIds(classGroupId, hasPostfixModifier);
|
|
441
|
+
for (let i = 0; i < conflictGroups.length; ++i) {
|
|
442
|
+
const group = conflictGroups[i];
|
|
443
|
+
classGroupsInConflict.push(modifierId + group);
|
|
444
|
+
}
|
|
445
|
+
result = originalClassName + (result.length > 0 ? " " + result : result);
|
|
446
|
+
}
|
|
447
|
+
return result;
|
|
448
|
+
};
|
|
449
|
+
function twJoin() {
|
|
450
|
+
let index = 0;
|
|
451
|
+
let argument;
|
|
452
|
+
let resolvedValue;
|
|
453
|
+
let string = "";
|
|
454
|
+
while (index < arguments.length) if (argument = arguments[index++]) {
|
|
455
|
+
if (resolvedValue = toValue(argument)) {
|
|
456
|
+
string && (string += " ");
|
|
457
|
+
string += resolvedValue;
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
return string;
|
|
461
|
+
}
|
|
462
|
+
var toValue = (mix) => {
|
|
463
|
+
if (typeof mix === "string") return mix;
|
|
464
|
+
let resolvedValue;
|
|
465
|
+
let string = "";
|
|
466
|
+
for (let k = 0; k < mix.length; k++) if (mix[k]) {
|
|
467
|
+
if (resolvedValue = toValue(mix[k])) {
|
|
468
|
+
string && (string += " ");
|
|
469
|
+
string += resolvedValue;
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
return string;
|
|
473
|
+
};
|
|
474
|
+
function createTailwindMerge(createConfigFirst, ...createConfigRest) {
|
|
475
|
+
let configUtils;
|
|
476
|
+
let cacheGet;
|
|
477
|
+
let cacheSet;
|
|
478
|
+
let functionToCall = initTailwindMerge;
|
|
479
|
+
function initTailwindMerge(classList) {
|
|
480
|
+
configUtils = createConfigUtils(createConfigRest.reduce((previousConfig, createConfigCurrent) => createConfigCurrent(previousConfig), createConfigFirst()));
|
|
481
|
+
cacheGet = configUtils.cache.get;
|
|
482
|
+
cacheSet = configUtils.cache.set;
|
|
483
|
+
functionToCall = tailwindMerge;
|
|
484
|
+
return tailwindMerge(classList);
|
|
485
|
+
}
|
|
486
|
+
function tailwindMerge(classList) {
|
|
487
|
+
const cachedResult = cacheGet(classList);
|
|
488
|
+
if (cachedResult) return cachedResult;
|
|
489
|
+
const result = mergeClassList(classList, configUtils);
|
|
490
|
+
cacheSet(classList, result);
|
|
491
|
+
return result;
|
|
492
|
+
}
|
|
493
|
+
return function callTailwindMerge() {
|
|
494
|
+
return functionToCall(twJoin.apply(null, arguments));
|
|
495
|
+
};
|
|
496
|
+
}
|
|
497
|
+
var fromTheme = (key) => {
|
|
498
|
+
const themeGetter = (theme) => theme[key] || [];
|
|
499
|
+
themeGetter.isThemeGetter = true;
|
|
500
|
+
return themeGetter;
|
|
501
|
+
};
|
|
502
|
+
var arbitraryValueRegex = /^\[(?:(\w[\w-]*):)?(.+)\]$/i;
|
|
503
|
+
var arbitraryVariableRegex = /^\((?:(\w[\w-]*):)?(.+)\)$/i;
|
|
504
|
+
var fractionRegex = /^\d+\/\d+$/;
|
|
505
|
+
var tshirtUnitRegex = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/;
|
|
506
|
+
var lengthUnitRegex = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/;
|
|
507
|
+
var colorFunctionRegex = /^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/;
|
|
508
|
+
var shadowRegex = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/;
|
|
509
|
+
var imageRegex = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;
|
|
510
|
+
var isFraction = (value) => fractionRegex.test(value);
|
|
511
|
+
var isNumber = (value) => !!value && !Number.isNaN(Number(value));
|
|
512
|
+
var isInteger = (value) => !!value && Number.isInteger(Number(value));
|
|
513
|
+
var isPercent = (value) => value.endsWith("%") && isNumber(value.slice(0, -1));
|
|
514
|
+
var isTshirtSize = (value) => tshirtUnitRegex.test(value);
|
|
515
|
+
var isAny = () => true;
|
|
516
|
+
var isLengthOnly = (value) => lengthUnitRegex.test(value) && !colorFunctionRegex.test(value);
|
|
517
|
+
var isNever = () => false;
|
|
518
|
+
var isShadow = (value) => shadowRegex.test(value);
|
|
519
|
+
var isImage = (value) => imageRegex.test(value);
|
|
520
|
+
var isAnyNonArbitrary = (value) => !isArbitraryValue(value) && !isArbitraryVariable(value);
|
|
521
|
+
var isArbitrarySize = (value) => getIsArbitraryValue(value, isLabelSize, isNever);
|
|
522
|
+
var isArbitraryValue = (value) => arbitraryValueRegex.test(value);
|
|
523
|
+
var isArbitraryLength = (value) => getIsArbitraryValue(value, isLabelLength, isLengthOnly);
|
|
524
|
+
var isArbitraryNumber = (value) => getIsArbitraryValue(value, isLabelNumber, isNumber);
|
|
525
|
+
var isArbitraryPosition = (value) => getIsArbitraryValue(value, isLabelPosition, isNever);
|
|
526
|
+
var isArbitraryImage = (value) => getIsArbitraryValue(value, isLabelImage, isImage);
|
|
527
|
+
var isArbitraryShadow = (value) => getIsArbitraryValue(value, isLabelShadow, isShadow);
|
|
528
|
+
var isArbitraryVariable = (value) => arbitraryVariableRegex.test(value);
|
|
529
|
+
var isArbitraryVariableLength = (value) => getIsArbitraryVariable(value, isLabelLength);
|
|
530
|
+
var isArbitraryVariableFamilyName = (value) => getIsArbitraryVariable(value, isLabelFamilyName);
|
|
531
|
+
var isArbitraryVariablePosition = (value) => getIsArbitraryVariable(value, isLabelPosition);
|
|
532
|
+
var isArbitraryVariableSize = (value) => getIsArbitraryVariable(value, isLabelSize);
|
|
533
|
+
var isArbitraryVariableImage = (value) => getIsArbitraryVariable(value, isLabelImage);
|
|
534
|
+
var isArbitraryVariableShadow = (value) => getIsArbitraryVariable(value, isLabelShadow, true);
|
|
535
|
+
var getIsArbitraryValue = (value, testLabel, testValue) => {
|
|
536
|
+
const result = arbitraryValueRegex.exec(value);
|
|
537
|
+
if (result) {
|
|
538
|
+
if (result[1]) return testLabel(result[1]);
|
|
539
|
+
return testValue(result[2]);
|
|
540
|
+
}
|
|
541
|
+
return false;
|
|
542
|
+
};
|
|
543
|
+
var getIsArbitraryVariable = (value, testLabel, shouldMatchNoLabel = false) => {
|
|
544
|
+
const result = arbitraryVariableRegex.exec(value);
|
|
545
|
+
if (result) {
|
|
546
|
+
if (result[1]) return testLabel(result[1]);
|
|
547
|
+
return shouldMatchNoLabel;
|
|
548
|
+
}
|
|
549
|
+
return false;
|
|
550
|
+
};
|
|
551
|
+
var isLabelPosition = (label) => label === "position" || label === "percentage";
|
|
552
|
+
var isLabelImage = (label) => label === "image" || label === "url";
|
|
553
|
+
var isLabelSize = (label) => label === "length" || label === "size" || label === "bg-size";
|
|
554
|
+
var isLabelLength = (label) => label === "length";
|
|
555
|
+
var isLabelNumber = (label) => label === "number";
|
|
556
|
+
var isLabelFamilyName = (label) => label === "family-name";
|
|
557
|
+
var isLabelShadow = (label) => label === "shadow";
|
|
558
|
+
var getDefaultConfig = () => {
|
|
559
|
+
const themeColor = fromTheme("color");
|
|
560
|
+
const themeFont = fromTheme("font");
|
|
561
|
+
const themeText = fromTheme("text");
|
|
562
|
+
const themeFontWeight = fromTheme("font-weight");
|
|
563
|
+
const themeTracking = fromTheme("tracking");
|
|
564
|
+
const themeLeading = fromTheme("leading");
|
|
565
|
+
const themeBreakpoint = fromTheme("breakpoint");
|
|
566
|
+
const themeContainer = fromTheme("container");
|
|
567
|
+
const themeSpacing = fromTheme("spacing");
|
|
568
|
+
const themeRadius = fromTheme("radius");
|
|
569
|
+
const themeShadow = fromTheme("shadow");
|
|
570
|
+
const themeInsetShadow = fromTheme("inset-shadow");
|
|
571
|
+
const themeTextShadow = fromTheme("text-shadow");
|
|
572
|
+
const themeDropShadow = fromTheme("drop-shadow");
|
|
573
|
+
const themeBlur = fromTheme("blur");
|
|
574
|
+
const themePerspective = fromTheme("perspective");
|
|
575
|
+
const themeAspect = fromTheme("aspect");
|
|
576
|
+
const themeEase = fromTheme("ease");
|
|
577
|
+
const themeAnimate = fromTheme("animate");
|
|
578
|
+
const scaleBreak = () => [
|
|
579
|
+
"auto",
|
|
580
|
+
"avoid",
|
|
581
|
+
"all",
|
|
582
|
+
"avoid-page",
|
|
583
|
+
"page",
|
|
584
|
+
"left",
|
|
585
|
+
"right",
|
|
586
|
+
"column"
|
|
587
|
+
];
|
|
588
|
+
const scalePosition = () => [
|
|
589
|
+
"center",
|
|
590
|
+
"top",
|
|
591
|
+
"bottom",
|
|
592
|
+
"left",
|
|
593
|
+
"right",
|
|
594
|
+
"top-left",
|
|
595
|
+
"left-top",
|
|
596
|
+
"top-right",
|
|
597
|
+
"right-top",
|
|
598
|
+
"bottom-right",
|
|
599
|
+
"right-bottom",
|
|
600
|
+
"bottom-left",
|
|
601
|
+
"left-bottom"
|
|
602
|
+
];
|
|
603
|
+
const scalePositionWithArbitrary = () => [
|
|
604
|
+
...scalePosition(),
|
|
605
|
+
isArbitraryVariable,
|
|
606
|
+
isArbitraryValue
|
|
607
|
+
];
|
|
608
|
+
const scaleOverflow = () => [
|
|
609
|
+
"auto",
|
|
610
|
+
"hidden",
|
|
611
|
+
"clip",
|
|
612
|
+
"visible",
|
|
613
|
+
"scroll"
|
|
614
|
+
];
|
|
615
|
+
const scaleOverscroll = () => [
|
|
616
|
+
"auto",
|
|
617
|
+
"contain",
|
|
618
|
+
"none"
|
|
619
|
+
];
|
|
620
|
+
const scaleUnambiguousSpacing = () => [
|
|
621
|
+
isArbitraryVariable,
|
|
622
|
+
isArbitraryValue,
|
|
623
|
+
themeSpacing
|
|
624
|
+
];
|
|
625
|
+
const scaleInset = () => [
|
|
626
|
+
isFraction,
|
|
627
|
+
"full",
|
|
628
|
+
"auto",
|
|
629
|
+
...scaleUnambiguousSpacing()
|
|
630
|
+
];
|
|
631
|
+
const scaleGridTemplateColsRows = () => [
|
|
632
|
+
isInteger,
|
|
633
|
+
"none",
|
|
634
|
+
"subgrid",
|
|
635
|
+
isArbitraryVariable,
|
|
636
|
+
isArbitraryValue
|
|
637
|
+
];
|
|
638
|
+
const scaleGridColRowStartAndEnd = () => [
|
|
639
|
+
"auto",
|
|
640
|
+
{ span: [
|
|
641
|
+
"full",
|
|
642
|
+
isInteger,
|
|
643
|
+
isArbitraryVariable,
|
|
644
|
+
isArbitraryValue
|
|
645
|
+
] },
|
|
646
|
+
isInteger,
|
|
647
|
+
isArbitraryVariable,
|
|
648
|
+
isArbitraryValue
|
|
649
|
+
];
|
|
650
|
+
const scaleGridColRowStartOrEnd = () => [
|
|
651
|
+
isInteger,
|
|
652
|
+
"auto",
|
|
653
|
+
isArbitraryVariable,
|
|
654
|
+
isArbitraryValue
|
|
655
|
+
];
|
|
656
|
+
const scaleGridAutoColsRows = () => [
|
|
657
|
+
"auto",
|
|
658
|
+
"min",
|
|
659
|
+
"max",
|
|
660
|
+
"fr",
|
|
661
|
+
isArbitraryVariable,
|
|
662
|
+
isArbitraryValue
|
|
663
|
+
];
|
|
664
|
+
const scaleAlignPrimaryAxis = () => [
|
|
665
|
+
"start",
|
|
666
|
+
"end",
|
|
667
|
+
"center",
|
|
668
|
+
"between",
|
|
669
|
+
"around",
|
|
670
|
+
"evenly",
|
|
671
|
+
"stretch",
|
|
672
|
+
"baseline",
|
|
673
|
+
"center-safe",
|
|
674
|
+
"end-safe"
|
|
675
|
+
];
|
|
676
|
+
const scaleAlignSecondaryAxis = () => [
|
|
677
|
+
"start",
|
|
678
|
+
"end",
|
|
679
|
+
"center",
|
|
680
|
+
"stretch",
|
|
681
|
+
"center-safe",
|
|
682
|
+
"end-safe"
|
|
683
|
+
];
|
|
684
|
+
const scaleMargin = () => ["auto", ...scaleUnambiguousSpacing()];
|
|
685
|
+
const scaleSizing = () => [
|
|
686
|
+
isFraction,
|
|
687
|
+
"auto",
|
|
688
|
+
"full",
|
|
689
|
+
"dvw",
|
|
690
|
+
"dvh",
|
|
691
|
+
"lvw",
|
|
692
|
+
"lvh",
|
|
693
|
+
"svw",
|
|
694
|
+
"svh",
|
|
695
|
+
"min",
|
|
696
|
+
"max",
|
|
697
|
+
"fit",
|
|
698
|
+
...scaleUnambiguousSpacing()
|
|
699
|
+
];
|
|
700
|
+
const scaleColor = () => [
|
|
701
|
+
themeColor,
|
|
702
|
+
isArbitraryVariable,
|
|
703
|
+
isArbitraryValue
|
|
704
|
+
];
|
|
705
|
+
const scaleBgPosition = () => [
|
|
706
|
+
...scalePosition(),
|
|
707
|
+
isArbitraryVariablePosition,
|
|
708
|
+
isArbitraryPosition,
|
|
709
|
+
{ position: [isArbitraryVariable, isArbitraryValue] }
|
|
710
|
+
];
|
|
711
|
+
const scaleBgRepeat = () => ["no-repeat", { repeat: [
|
|
712
|
+
"",
|
|
713
|
+
"x",
|
|
714
|
+
"y",
|
|
715
|
+
"space",
|
|
716
|
+
"round"
|
|
717
|
+
] }];
|
|
718
|
+
const scaleBgSize = () => [
|
|
719
|
+
"auto",
|
|
720
|
+
"cover",
|
|
721
|
+
"contain",
|
|
722
|
+
isArbitraryVariableSize,
|
|
723
|
+
isArbitrarySize,
|
|
724
|
+
{ size: [isArbitraryVariable, isArbitraryValue] }
|
|
725
|
+
];
|
|
726
|
+
const scaleGradientStopPosition = () => [
|
|
727
|
+
isPercent,
|
|
728
|
+
isArbitraryVariableLength,
|
|
729
|
+
isArbitraryLength
|
|
730
|
+
];
|
|
731
|
+
const scaleRadius = () => [
|
|
732
|
+
"",
|
|
733
|
+
"none",
|
|
734
|
+
"full",
|
|
735
|
+
themeRadius,
|
|
736
|
+
isArbitraryVariable,
|
|
737
|
+
isArbitraryValue
|
|
738
|
+
];
|
|
739
|
+
const scaleBorderWidth = () => [
|
|
740
|
+
"",
|
|
741
|
+
isNumber,
|
|
742
|
+
isArbitraryVariableLength,
|
|
743
|
+
isArbitraryLength
|
|
744
|
+
];
|
|
745
|
+
const scaleLineStyle = () => [
|
|
746
|
+
"solid",
|
|
747
|
+
"dashed",
|
|
748
|
+
"dotted",
|
|
749
|
+
"double"
|
|
750
|
+
];
|
|
751
|
+
const scaleBlendMode = () => [
|
|
752
|
+
"normal",
|
|
753
|
+
"multiply",
|
|
754
|
+
"screen",
|
|
755
|
+
"overlay",
|
|
756
|
+
"darken",
|
|
757
|
+
"lighten",
|
|
758
|
+
"color-dodge",
|
|
759
|
+
"color-burn",
|
|
760
|
+
"hard-light",
|
|
761
|
+
"soft-light",
|
|
762
|
+
"difference",
|
|
763
|
+
"exclusion",
|
|
764
|
+
"hue",
|
|
765
|
+
"saturation",
|
|
766
|
+
"color",
|
|
767
|
+
"luminosity"
|
|
768
|
+
];
|
|
769
|
+
const scaleMaskImagePosition = () => [
|
|
770
|
+
isNumber,
|
|
771
|
+
isPercent,
|
|
772
|
+
isArbitraryVariablePosition,
|
|
773
|
+
isArbitraryPosition
|
|
774
|
+
];
|
|
775
|
+
const scaleBlur = () => [
|
|
776
|
+
"",
|
|
777
|
+
"none",
|
|
778
|
+
themeBlur,
|
|
779
|
+
isArbitraryVariable,
|
|
780
|
+
isArbitraryValue
|
|
781
|
+
];
|
|
782
|
+
const scaleRotate = () => [
|
|
783
|
+
"none",
|
|
784
|
+
isNumber,
|
|
785
|
+
isArbitraryVariable,
|
|
786
|
+
isArbitraryValue
|
|
787
|
+
];
|
|
788
|
+
const scaleScale = () => [
|
|
789
|
+
"none",
|
|
790
|
+
isNumber,
|
|
791
|
+
isArbitraryVariable,
|
|
792
|
+
isArbitraryValue
|
|
793
|
+
];
|
|
794
|
+
const scaleSkew = () => [
|
|
795
|
+
isNumber,
|
|
796
|
+
isArbitraryVariable,
|
|
797
|
+
isArbitraryValue
|
|
798
|
+
];
|
|
799
|
+
const scaleTranslate = () => [
|
|
800
|
+
isFraction,
|
|
801
|
+
"full",
|
|
802
|
+
...scaleUnambiguousSpacing()
|
|
803
|
+
];
|
|
804
|
+
return {
|
|
805
|
+
cacheSize: 500,
|
|
806
|
+
theme: {
|
|
807
|
+
animate: [
|
|
808
|
+
"spin",
|
|
809
|
+
"ping",
|
|
810
|
+
"pulse",
|
|
811
|
+
"bounce"
|
|
812
|
+
],
|
|
813
|
+
aspect: ["video"],
|
|
814
|
+
blur: [isTshirtSize],
|
|
815
|
+
breakpoint: [isTshirtSize],
|
|
816
|
+
color: [isAny],
|
|
817
|
+
container: [isTshirtSize],
|
|
818
|
+
"drop-shadow": [isTshirtSize],
|
|
819
|
+
ease: [
|
|
820
|
+
"in",
|
|
821
|
+
"out",
|
|
822
|
+
"in-out"
|
|
823
|
+
],
|
|
824
|
+
font: [isAnyNonArbitrary],
|
|
825
|
+
"font-weight": [
|
|
826
|
+
"thin",
|
|
827
|
+
"extralight",
|
|
828
|
+
"light",
|
|
829
|
+
"normal",
|
|
830
|
+
"medium",
|
|
831
|
+
"semibold",
|
|
832
|
+
"bold",
|
|
833
|
+
"extrabold",
|
|
834
|
+
"black"
|
|
835
|
+
],
|
|
836
|
+
"inset-shadow": [isTshirtSize],
|
|
837
|
+
leading: [
|
|
838
|
+
"none",
|
|
839
|
+
"tight",
|
|
840
|
+
"snug",
|
|
841
|
+
"normal",
|
|
842
|
+
"relaxed",
|
|
843
|
+
"loose"
|
|
844
|
+
],
|
|
845
|
+
perspective: [
|
|
846
|
+
"dramatic",
|
|
847
|
+
"near",
|
|
848
|
+
"normal",
|
|
849
|
+
"midrange",
|
|
850
|
+
"distant",
|
|
851
|
+
"none"
|
|
852
|
+
],
|
|
853
|
+
radius: [isTshirtSize],
|
|
854
|
+
shadow: [isTshirtSize],
|
|
855
|
+
spacing: ["px", isNumber],
|
|
856
|
+
text: [isTshirtSize],
|
|
857
|
+
"text-shadow": [isTshirtSize],
|
|
858
|
+
tracking: [
|
|
859
|
+
"tighter",
|
|
860
|
+
"tight",
|
|
861
|
+
"normal",
|
|
862
|
+
"wide",
|
|
863
|
+
"wider",
|
|
864
|
+
"widest"
|
|
865
|
+
]
|
|
866
|
+
},
|
|
867
|
+
classGroups: {
|
|
868
|
+
aspect: [{ aspect: [
|
|
869
|
+
"auto",
|
|
870
|
+
"square",
|
|
871
|
+
isFraction,
|
|
872
|
+
isArbitraryValue,
|
|
873
|
+
isArbitraryVariable,
|
|
874
|
+
themeAspect
|
|
875
|
+
] }],
|
|
876
|
+
container: ["container"],
|
|
877
|
+
columns: [{ columns: [
|
|
878
|
+
isNumber,
|
|
879
|
+
isArbitraryValue,
|
|
880
|
+
isArbitraryVariable,
|
|
881
|
+
themeContainer
|
|
882
|
+
] }],
|
|
883
|
+
"break-after": [{ "break-after": scaleBreak() }],
|
|
884
|
+
"break-before": [{ "break-before": scaleBreak() }],
|
|
885
|
+
"break-inside": [{ "break-inside": [
|
|
886
|
+
"auto",
|
|
887
|
+
"avoid",
|
|
888
|
+
"avoid-page",
|
|
889
|
+
"avoid-column"
|
|
890
|
+
] }],
|
|
891
|
+
"box-decoration": [{ "box-decoration": ["slice", "clone"] }],
|
|
892
|
+
box: [{ box: ["border", "content"] }],
|
|
893
|
+
display: [
|
|
894
|
+
"block",
|
|
895
|
+
"inline-block",
|
|
896
|
+
"inline",
|
|
897
|
+
"flex",
|
|
898
|
+
"inline-flex",
|
|
899
|
+
"table",
|
|
900
|
+
"inline-table",
|
|
901
|
+
"table-caption",
|
|
902
|
+
"table-cell",
|
|
903
|
+
"table-column",
|
|
904
|
+
"table-column-group",
|
|
905
|
+
"table-footer-group",
|
|
906
|
+
"table-header-group",
|
|
907
|
+
"table-row-group",
|
|
908
|
+
"table-row",
|
|
909
|
+
"flow-root",
|
|
910
|
+
"grid",
|
|
911
|
+
"inline-grid",
|
|
912
|
+
"contents",
|
|
913
|
+
"list-item",
|
|
914
|
+
"hidden"
|
|
915
|
+
],
|
|
916
|
+
sr: ["sr-only", "not-sr-only"],
|
|
917
|
+
float: [{ float: [
|
|
918
|
+
"right",
|
|
919
|
+
"left",
|
|
920
|
+
"none",
|
|
921
|
+
"start",
|
|
922
|
+
"end"
|
|
923
|
+
] }],
|
|
924
|
+
clear: [{ clear: [
|
|
925
|
+
"left",
|
|
926
|
+
"right",
|
|
927
|
+
"both",
|
|
928
|
+
"none",
|
|
929
|
+
"start",
|
|
930
|
+
"end"
|
|
931
|
+
] }],
|
|
932
|
+
isolation: ["isolate", "isolation-auto"],
|
|
933
|
+
"object-fit": [{ object: [
|
|
934
|
+
"contain",
|
|
935
|
+
"cover",
|
|
936
|
+
"fill",
|
|
937
|
+
"none",
|
|
938
|
+
"scale-down"
|
|
939
|
+
] }],
|
|
940
|
+
"object-position": [{ object: scalePositionWithArbitrary() }],
|
|
941
|
+
overflow: [{ overflow: scaleOverflow() }],
|
|
942
|
+
"overflow-x": [{ "overflow-x": scaleOverflow() }],
|
|
943
|
+
"overflow-y": [{ "overflow-y": scaleOverflow() }],
|
|
944
|
+
overscroll: [{ overscroll: scaleOverscroll() }],
|
|
945
|
+
"overscroll-x": [{ "overscroll-x": scaleOverscroll() }],
|
|
946
|
+
"overscroll-y": [{ "overscroll-y": scaleOverscroll() }],
|
|
947
|
+
position: [
|
|
948
|
+
"static",
|
|
949
|
+
"fixed",
|
|
950
|
+
"absolute",
|
|
951
|
+
"relative",
|
|
952
|
+
"sticky"
|
|
953
|
+
],
|
|
954
|
+
inset: [{ inset: scaleInset() }],
|
|
955
|
+
"inset-x": [{ "inset-x": scaleInset() }],
|
|
956
|
+
"inset-y": [{ "inset-y": scaleInset() }],
|
|
957
|
+
start: [{ start: scaleInset() }],
|
|
958
|
+
end: [{ end: scaleInset() }],
|
|
959
|
+
top: [{ top: scaleInset() }],
|
|
960
|
+
right: [{ right: scaleInset() }],
|
|
961
|
+
bottom: [{ bottom: scaleInset() }],
|
|
962
|
+
left: [{ left: scaleInset() }],
|
|
963
|
+
visibility: [
|
|
964
|
+
"visible",
|
|
965
|
+
"invisible",
|
|
966
|
+
"collapse"
|
|
967
|
+
],
|
|
968
|
+
z: [{ z: [
|
|
969
|
+
isInteger,
|
|
970
|
+
"auto",
|
|
971
|
+
isArbitraryVariable,
|
|
972
|
+
isArbitraryValue
|
|
973
|
+
] }],
|
|
974
|
+
basis: [{ basis: [
|
|
975
|
+
isFraction,
|
|
976
|
+
"full",
|
|
977
|
+
"auto",
|
|
978
|
+
themeContainer,
|
|
979
|
+
...scaleUnambiguousSpacing()
|
|
980
|
+
] }],
|
|
981
|
+
"flex-direction": [{ flex: [
|
|
982
|
+
"row",
|
|
983
|
+
"row-reverse",
|
|
984
|
+
"col",
|
|
985
|
+
"col-reverse"
|
|
986
|
+
] }],
|
|
987
|
+
"flex-wrap": [{ flex: [
|
|
988
|
+
"nowrap",
|
|
989
|
+
"wrap",
|
|
990
|
+
"wrap-reverse"
|
|
991
|
+
] }],
|
|
992
|
+
flex: [{ flex: [
|
|
993
|
+
isNumber,
|
|
994
|
+
isFraction,
|
|
995
|
+
"auto",
|
|
996
|
+
"initial",
|
|
997
|
+
"none",
|
|
998
|
+
isArbitraryValue
|
|
999
|
+
] }],
|
|
1000
|
+
grow: [{ grow: [
|
|
1001
|
+
"",
|
|
1002
|
+
isNumber,
|
|
1003
|
+
isArbitraryVariable,
|
|
1004
|
+
isArbitraryValue
|
|
1005
|
+
] }],
|
|
1006
|
+
shrink: [{ shrink: [
|
|
1007
|
+
"",
|
|
1008
|
+
isNumber,
|
|
1009
|
+
isArbitraryVariable,
|
|
1010
|
+
isArbitraryValue
|
|
1011
|
+
] }],
|
|
1012
|
+
order: [{ order: [
|
|
1013
|
+
isInteger,
|
|
1014
|
+
"first",
|
|
1015
|
+
"last",
|
|
1016
|
+
"none",
|
|
1017
|
+
isArbitraryVariable,
|
|
1018
|
+
isArbitraryValue
|
|
1019
|
+
] }],
|
|
1020
|
+
"grid-cols": [{ "grid-cols": scaleGridTemplateColsRows() }],
|
|
1021
|
+
"col-start-end": [{ col: scaleGridColRowStartAndEnd() }],
|
|
1022
|
+
"col-start": [{ "col-start": scaleGridColRowStartOrEnd() }],
|
|
1023
|
+
"col-end": [{ "col-end": scaleGridColRowStartOrEnd() }],
|
|
1024
|
+
"grid-rows": [{ "grid-rows": scaleGridTemplateColsRows() }],
|
|
1025
|
+
"row-start-end": [{ row: scaleGridColRowStartAndEnd() }],
|
|
1026
|
+
"row-start": [{ "row-start": scaleGridColRowStartOrEnd() }],
|
|
1027
|
+
"row-end": [{ "row-end": scaleGridColRowStartOrEnd() }],
|
|
1028
|
+
"grid-flow": [{ "grid-flow": [
|
|
1029
|
+
"row",
|
|
1030
|
+
"col",
|
|
1031
|
+
"dense",
|
|
1032
|
+
"row-dense",
|
|
1033
|
+
"col-dense"
|
|
1034
|
+
] }],
|
|
1035
|
+
"auto-cols": [{ "auto-cols": scaleGridAutoColsRows() }],
|
|
1036
|
+
"auto-rows": [{ "auto-rows": scaleGridAutoColsRows() }],
|
|
1037
|
+
gap: [{ gap: scaleUnambiguousSpacing() }],
|
|
1038
|
+
"gap-x": [{ "gap-x": scaleUnambiguousSpacing() }],
|
|
1039
|
+
"gap-y": [{ "gap-y": scaleUnambiguousSpacing() }],
|
|
1040
|
+
"justify-content": [{ justify: [...scaleAlignPrimaryAxis(), "normal"] }],
|
|
1041
|
+
"justify-items": [{ "justify-items": [...scaleAlignSecondaryAxis(), "normal"] }],
|
|
1042
|
+
"justify-self": [{ "justify-self": ["auto", ...scaleAlignSecondaryAxis()] }],
|
|
1043
|
+
"align-content": [{ content: ["normal", ...scaleAlignPrimaryAxis()] }],
|
|
1044
|
+
"align-items": [{ items: [...scaleAlignSecondaryAxis(), { baseline: ["", "last"] }] }],
|
|
1045
|
+
"align-self": [{ self: [
|
|
1046
|
+
"auto",
|
|
1047
|
+
...scaleAlignSecondaryAxis(),
|
|
1048
|
+
{ baseline: ["", "last"] }
|
|
1049
|
+
] }],
|
|
1050
|
+
"place-content": [{ "place-content": scaleAlignPrimaryAxis() }],
|
|
1051
|
+
"place-items": [{ "place-items": [...scaleAlignSecondaryAxis(), "baseline"] }],
|
|
1052
|
+
"place-self": [{ "place-self": ["auto", ...scaleAlignSecondaryAxis()] }],
|
|
1053
|
+
p: [{ p: scaleUnambiguousSpacing() }],
|
|
1054
|
+
px: [{ px: scaleUnambiguousSpacing() }],
|
|
1055
|
+
py: [{ py: scaleUnambiguousSpacing() }],
|
|
1056
|
+
ps: [{ ps: scaleUnambiguousSpacing() }],
|
|
1057
|
+
pe: [{ pe: scaleUnambiguousSpacing() }],
|
|
1058
|
+
pt: [{ pt: scaleUnambiguousSpacing() }],
|
|
1059
|
+
pr: [{ pr: scaleUnambiguousSpacing() }],
|
|
1060
|
+
pb: [{ pb: scaleUnambiguousSpacing() }],
|
|
1061
|
+
pl: [{ pl: scaleUnambiguousSpacing() }],
|
|
1062
|
+
m: [{ m: scaleMargin() }],
|
|
1063
|
+
mx: [{ mx: scaleMargin() }],
|
|
1064
|
+
my: [{ my: scaleMargin() }],
|
|
1065
|
+
ms: [{ ms: scaleMargin() }],
|
|
1066
|
+
me: [{ me: scaleMargin() }],
|
|
1067
|
+
mt: [{ mt: scaleMargin() }],
|
|
1068
|
+
mr: [{ mr: scaleMargin() }],
|
|
1069
|
+
mb: [{ mb: scaleMargin() }],
|
|
1070
|
+
ml: [{ ml: scaleMargin() }],
|
|
1071
|
+
"space-x": [{ "space-x": scaleUnambiguousSpacing() }],
|
|
1072
|
+
"space-x-reverse": ["space-x-reverse"],
|
|
1073
|
+
"space-y": [{ "space-y": scaleUnambiguousSpacing() }],
|
|
1074
|
+
"space-y-reverse": ["space-y-reverse"],
|
|
1075
|
+
size: [{ size: scaleSizing() }],
|
|
1076
|
+
w: [{ w: [
|
|
1077
|
+
themeContainer,
|
|
1078
|
+
"screen",
|
|
1079
|
+
...scaleSizing()
|
|
1080
|
+
] }],
|
|
1081
|
+
"min-w": [{ "min-w": [
|
|
1082
|
+
themeContainer,
|
|
1083
|
+
"screen",
|
|
1084
|
+
"none",
|
|
1085
|
+
...scaleSizing()
|
|
1086
|
+
] }],
|
|
1087
|
+
"max-w": [{ "max-w": [
|
|
1088
|
+
themeContainer,
|
|
1089
|
+
"screen",
|
|
1090
|
+
"none",
|
|
1091
|
+
"prose",
|
|
1092
|
+
{ screen: [themeBreakpoint] },
|
|
1093
|
+
...scaleSizing()
|
|
1094
|
+
] }],
|
|
1095
|
+
h: [{ h: [
|
|
1096
|
+
"screen",
|
|
1097
|
+
"lh",
|
|
1098
|
+
...scaleSizing()
|
|
1099
|
+
] }],
|
|
1100
|
+
"min-h": [{ "min-h": [
|
|
1101
|
+
"screen",
|
|
1102
|
+
"lh",
|
|
1103
|
+
"none",
|
|
1104
|
+
...scaleSizing()
|
|
1105
|
+
] }],
|
|
1106
|
+
"max-h": [{ "max-h": [
|
|
1107
|
+
"screen",
|
|
1108
|
+
"lh",
|
|
1109
|
+
...scaleSizing()
|
|
1110
|
+
] }],
|
|
1111
|
+
"font-size": [{ text: [
|
|
1112
|
+
"base",
|
|
1113
|
+
themeText,
|
|
1114
|
+
isArbitraryVariableLength,
|
|
1115
|
+
isArbitraryLength
|
|
1116
|
+
] }],
|
|
1117
|
+
"font-smoothing": ["antialiased", "subpixel-antialiased"],
|
|
1118
|
+
"font-style": ["italic", "not-italic"],
|
|
1119
|
+
"font-weight": [{ font: [
|
|
1120
|
+
themeFontWeight,
|
|
1121
|
+
isArbitraryVariable,
|
|
1122
|
+
isArbitraryNumber
|
|
1123
|
+
] }],
|
|
1124
|
+
"font-stretch": [{ "font-stretch": [
|
|
1125
|
+
"ultra-condensed",
|
|
1126
|
+
"extra-condensed",
|
|
1127
|
+
"condensed",
|
|
1128
|
+
"semi-condensed",
|
|
1129
|
+
"normal",
|
|
1130
|
+
"semi-expanded",
|
|
1131
|
+
"expanded",
|
|
1132
|
+
"extra-expanded",
|
|
1133
|
+
"ultra-expanded",
|
|
1134
|
+
isPercent,
|
|
1135
|
+
isArbitraryValue
|
|
1136
|
+
] }],
|
|
1137
|
+
"font-family": [{ font: [
|
|
1138
|
+
isArbitraryVariableFamilyName,
|
|
1139
|
+
isArbitraryValue,
|
|
1140
|
+
themeFont
|
|
1141
|
+
] }],
|
|
1142
|
+
"fvn-normal": ["normal-nums"],
|
|
1143
|
+
"fvn-ordinal": ["ordinal"],
|
|
1144
|
+
"fvn-slashed-zero": ["slashed-zero"],
|
|
1145
|
+
"fvn-figure": ["lining-nums", "oldstyle-nums"],
|
|
1146
|
+
"fvn-spacing": ["proportional-nums", "tabular-nums"],
|
|
1147
|
+
"fvn-fraction": ["diagonal-fractions", "stacked-fractions"],
|
|
1148
|
+
tracking: [{ tracking: [
|
|
1149
|
+
themeTracking,
|
|
1150
|
+
isArbitraryVariable,
|
|
1151
|
+
isArbitraryValue
|
|
1152
|
+
] }],
|
|
1153
|
+
"line-clamp": [{ "line-clamp": [
|
|
1154
|
+
isNumber,
|
|
1155
|
+
"none",
|
|
1156
|
+
isArbitraryVariable,
|
|
1157
|
+
isArbitraryNumber
|
|
1158
|
+
] }],
|
|
1159
|
+
leading: [{ leading: [themeLeading, ...scaleUnambiguousSpacing()] }],
|
|
1160
|
+
"list-image": [{ "list-image": [
|
|
1161
|
+
"none",
|
|
1162
|
+
isArbitraryVariable,
|
|
1163
|
+
isArbitraryValue
|
|
1164
|
+
] }],
|
|
1165
|
+
"list-style-position": [{ list: ["inside", "outside"] }],
|
|
1166
|
+
"list-style-type": [{ list: [
|
|
1167
|
+
"disc",
|
|
1168
|
+
"decimal",
|
|
1169
|
+
"none",
|
|
1170
|
+
isArbitraryVariable,
|
|
1171
|
+
isArbitraryValue
|
|
1172
|
+
] }],
|
|
1173
|
+
"text-alignment": [{ text: [
|
|
1174
|
+
"left",
|
|
1175
|
+
"center",
|
|
1176
|
+
"right",
|
|
1177
|
+
"justify",
|
|
1178
|
+
"start",
|
|
1179
|
+
"end"
|
|
1180
|
+
] }],
|
|
1181
|
+
"placeholder-color": [{ placeholder: scaleColor() }],
|
|
1182
|
+
"text-color": [{ text: scaleColor() }],
|
|
1183
|
+
"text-decoration": [
|
|
1184
|
+
"underline",
|
|
1185
|
+
"overline",
|
|
1186
|
+
"line-through",
|
|
1187
|
+
"no-underline"
|
|
1188
|
+
],
|
|
1189
|
+
"text-decoration-style": [{ decoration: [...scaleLineStyle(), "wavy"] }],
|
|
1190
|
+
"text-decoration-thickness": [{ decoration: [
|
|
1191
|
+
isNumber,
|
|
1192
|
+
"from-font",
|
|
1193
|
+
"auto",
|
|
1194
|
+
isArbitraryVariable,
|
|
1195
|
+
isArbitraryLength
|
|
1196
|
+
] }],
|
|
1197
|
+
"text-decoration-color": [{ decoration: scaleColor() }],
|
|
1198
|
+
"underline-offset": [{ "underline-offset": [
|
|
1199
|
+
isNumber,
|
|
1200
|
+
"auto",
|
|
1201
|
+
isArbitraryVariable,
|
|
1202
|
+
isArbitraryValue
|
|
1203
|
+
] }],
|
|
1204
|
+
"text-transform": [
|
|
1205
|
+
"uppercase",
|
|
1206
|
+
"lowercase",
|
|
1207
|
+
"capitalize",
|
|
1208
|
+
"normal-case"
|
|
1209
|
+
],
|
|
1210
|
+
"text-overflow": [
|
|
1211
|
+
"truncate",
|
|
1212
|
+
"text-ellipsis",
|
|
1213
|
+
"text-clip"
|
|
1214
|
+
],
|
|
1215
|
+
"text-wrap": [{ text: [
|
|
1216
|
+
"wrap",
|
|
1217
|
+
"nowrap",
|
|
1218
|
+
"balance",
|
|
1219
|
+
"pretty"
|
|
1220
|
+
] }],
|
|
1221
|
+
indent: [{ indent: scaleUnambiguousSpacing() }],
|
|
1222
|
+
"vertical-align": [{ align: [
|
|
1223
|
+
"baseline",
|
|
1224
|
+
"top",
|
|
1225
|
+
"middle",
|
|
1226
|
+
"bottom",
|
|
1227
|
+
"text-top",
|
|
1228
|
+
"text-bottom",
|
|
1229
|
+
"sub",
|
|
1230
|
+
"super",
|
|
1231
|
+
isArbitraryVariable,
|
|
1232
|
+
isArbitraryValue
|
|
1233
|
+
] }],
|
|
1234
|
+
whitespace: [{ whitespace: [
|
|
1235
|
+
"normal",
|
|
1236
|
+
"nowrap",
|
|
1237
|
+
"pre",
|
|
1238
|
+
"pre-line",
|
|
1239
|
+
"pre-wrap",
|
|
1240
|
+
"break-spaces"
|
|
1241
|
+
] }],
|
|
1242
|
+
break: [{ break: [
|
|
1243
|
+
"normal",
|
|
1244
|
+
"words",
|
|
1245
|
+
"all",
|
|
1246
|
+
"keep"
|
|
1247
|
+
] }],
|
|
1248
|
+
wrap: [{ wrap: [
|
|
1249
|
+
"break-word",
|
|
1250
|
+
"anywhere",
|
|
1251
|
+
"normal"
|
|
1252
|
+
] }],
|
|
1253
|
+
hyphens: [{ hyphens: [
|
|
1254
|
+
"none",
|
|
1255
|
+
"manual",
|
|
1256
|
+
"auto"
|
|
1257
|
+
] }],
|
|
1258
|
+
content: [{ content: [
|
|
1259
|
+
"none",
|
|
1260
|
+
isArbitraryVariable,
|
|
1261
|
+
isArbitraryValue
|
|
1262
|
+
] }],
|
|
1263
|
+
"bg-attachment": [{ bg: [
|
|
1264
|
+
"fixed",
|
|
1265
|
+
"local",
|
|
1266
|
+
"scroll"
|
|
1267
|
+
] }],
|
|
1268
|
+
"bg-clip": [{ "bg-clip": [
|
|
1269
|
+
"border",
|
|
1270
|
+
"padding",
|
|
1271
|
+
"content",
|
|
1272
|
+
"text"
|
|
1273
|
+
] }],
|
|
1274
|
+
"bg-origin": [{ "bg-origin": [
|
|
1275
|
+
"border",
|
|
1276
|
+
"padding",
|
|
1277
|
+
"content"
|
|
1278
|
+
] }],
|
|
1279
|
+
"bg-position": [{ bg: scaleBgPosition() }],
|
|
1280
|
+
"bg-repeat": [{ bg: scaleBgRepeat() }],
|
|
1281
|
+
"bg-size": [{ bg: scaleBgSize() }],
|
|
1282
|
+
"bg-image": [{ bg: [
|
|
1283
|
+
"none",
|
|
1284
|
+
{
|
|
1285
|
+
linear: [
|
|
1286
|
+
{ to: [
|
|
1287
|
+
"t",
|
|
1288
|
+
"tr",
|
|
1289
|
+
"r",
|
|
1290
|
+
"br",
|
|
1291
|
+
"b",
|
|
1292
|
+
"bl",
|
|
1293
|
+
"l",
|
|
1294
|
+
"tl"
|
|
1295
|
+
] },
|
|
1296
|
+
isInteger,
|
|
1297
|
+
isArbitraryVariable,
|
|
1298
|
+
isArbitraryValue
|
|
1299
|
+
],
|
|
1300
|
+
radial: [
|
|
1301
|
+
"",
|
|
1302
|
+
isArbitraryVariable,
|
|
1303
|
+
isArbitraryValue
|
|
1304
|
+
],
|
|
1305
|
+
conic: [
|
|
1306
|
+
isInteger,
|
|
1307
|
+
isArbitraryVariable,
|
|
1308
|
+
isArbitraryValue
|
|
1309
|
+
]
|
|
1310
|
+
},
|
|
1311
|
+
isArbitraryVariableImage,
|
|
1312
|
+
isArbitraryImage
|
|
1313
|
+
] }],
|
|
1314
|
+
"bg-color": [{ bg: scaleColor() }],
|
|
1315
|
+
"gradient-from-pos": [{ from: scaleGradientStopPosition() }],
|
|
1316
|
+
"gradient-via-pos": [{ via: scaleGradientStopPosition() }],
|
|
1317
|
+
"gradient-to-pos": [{ to: scaleGradientStopPosition() }],
|
|
1318
|
+
"gradient-from": [{ from: scaleColor() }],
|
|
1319
|
+
"gradient-via": [{ via: scaleColor() }],
|
|
1320
|
+
"gradient-to": [{ to: scaleColor() }],
|
|
1321
|
+
rounded: [{ rounded: scaleRadius() }],
|
|
1322
|
+
"rounded-s": [{ "rounded-s": scaleRadius() }],
|
|
1323
|
+
"rounded-e": [{ "rounded-e": scaleRadius() }],
|
|
1324
|
+
"rounded-t": [{ "rounded-t": scaleRadius() }],
|
|
1325
|
+
"rounded-r": [{ "rounded-r": scaleRadius() }],
|
|
1326
|
+
"rounded-b": [{ "rounded-b": scaleRadius() }],
|
|
1327
|
+
"rounded-l": [{ "rounded-l": scaleRadius() }],
|
|
1328
|
+
"rounded-ss": [{ "rounded-ss": scaleRadius() }],
|
|
1329
|
+
"rounded-se": [{ "rounded-se": scaleRadius() }],
|
|
1330
|
+
"rounded-ee": [{ "rounded-ee": scaleRadius() }],
|
|
1331
|
+
"rounded-es": [{ "rounded-es": scaleRadius() }],
|
|
1332
|
+
"rounded-tl": [{ "rounded-tl": scaleRadius() }],
|
|
1333
|
+
"rounded-tr": [{ "rounded-tr": scaleRadius() }],
|
|
1334
|
+
"rounded-br": [{ "rounded-br": scaleRadius() }],
|
|
1335
|
+
"rounded-bl": [{ "rounded-bl": scaleRadius() }],
|
|
1336
|
+
"border-w": [{ border: scaleBorderWidth() }],
|
|
1337
|
+
"border-w-x": [{ "border-x": scaleBorderWidth() }],
|
|
1338
|
+
"border-w-y": [{ "border-y": scaleBorderWidth() }],
|
|
1339
|
+
"border-w-s": [{ "border-s": scaleBorderWidth() }],
|
|
1340
|
+
"border-w-e": [{ "border-e": scaleBorderWidth() }],
|
|
1341
|
+
"border-w-t": [{ "border-t": scaleBorderWidth() }],
|
|
1342
|
+
"border-w-r": [{ "border-r": scaleBorderWidth() }],
|
|
1343
|
+
"border-w-b": [{ "border-b": scaleBorderWidth() }],
|
|
1344
|
+
"border-w-l": [{ "border-l": scaleBorderWidth() }],
|
|
1345
|
+
"divide-x": [{ "divide-x": scaleBorderWidth() }],
|
|
1346
|
+
"divide-x-reverse": ["divide-x-reverse"],
|
|
1347
|
+
"divide-y": [{ "divide-y": scaleBorderWidth() }],
|
|
1348
|
+
"divide-y-reverse": ["divide-y-reverse"],
|
|
1349
|
+
"border-style": [{ border: [
|
|
1350
|
+
...scaleLineStyle(),
|
|
1351
|
+
"hidden",
|
|
1352
|
+
"none"
|
|
1353
|
+
] }],
|
|
1354
|
+
"divide-style": [{ divide: [
|
|
1355
|
+
...scaleLineStyle(),
|
|
1356
|
+
"hidden",
|
|
1357
|
+
"none"
|
|
1358
|
+
] }],
|
|
1359
|
+
"border-color": [{ border: scaleColor() }],
|
|
1360
|
+
"border-color-x": [{ "border-x": scaleColor() }],
|
|
1361
|
+
"border-color-y": [{ "border-y": scaleColor() }],
|
|
1362
|
+
"border-color-s": [{ "border-s": scaleColor() }],
|
|
1363
|
+
"border-color-e": [{ "border-e": scaleColor() }],
|
|
1364
|
+
"border-color-t": [{ "border-t": scaleColor() }],
|
|
1365
|
+
"border-color-r": [{ "border-r": scaleColor() }],
|
|
1366
|
+
"border-color-b": [{ "border-b": scaleColor() }],
|
|
1367
|
+
"border-color-l": [{ "border-l": scaleColor() }],
|
|
1368
|
+
"divide-color": [{ divide: scaleColor() }],
|
|
1369
|
+
"outline-style": [{ outline: [
|
|
1370
|
+
...scaleLineStyle(),
|
|
1371
|
+
"none",
|
|
1372
|
+
"hidden"
|
|
1373
|
+
] }],
|
|
1374
|
+
"outline-offset": [{ "outline-offset": [
|
|
1375
|
+
isNumber,
|
|
1376
|
+
isArbitraryVariable,
|
|
1377
|
+
isArbitraryValue
|
|
1378
|
+
] }],
|
|
1379
|
+
"outline-w": [{ outline: [
|
|
1380
|
+
"",
|
|
1381
|
+
isNumber,
|
|
1382
|
+
isArbitraryVariableLength,
|
|
1383
|
+
isArbitraryLength
|
|
1384
|
+
] }],
|
|
1385
|
+
"outline-color": [{ outline: scaleColor() }],
|
|
1386
|
+
shadow: [{ shadow: [
|
|
1387
|
+
"",
|
|
1388
|
+
"none",
|
|
1389
|
+
themeShadow,
|
|
1390
|
+
isArbitraryVariableShadow,
|
|
1391
|
+
isArbitraryShadow
|
|
1392
|
+
] }],
|
|
1393
|
+
"shadow-color": [{ shadow: scaleColor() }],
|
|
1394
|
+
"inset-shadow": [{ "inset-shadow": [
|
|
1395
|
+
"none",
|
|
1396
|
+
themeInsetShadow,
|
|
1397
|
+
isArbitraryVariableShadow,
|
|
1398
|
+
isArbitraryShadow
|
|
1399
|
+
] }],
|
|
1400
|
+
"inset-shadow-color": [{ "inset-shadow": scaleColor() }],
|
|
1401
|
+
"ring-w": [{ ring: scaleBorderWidth() }],
|
|
1402
|
+
"ring-w-inset": ["ring-inset"],
|
|
1403
|
+
"ring-color": [{ ring: scaleColor() }],
|
|
1404
|
+
"ring-offset-w": [{ "ring-offset": [isNumber, isArbitraryLength] }],
|
|
1405
|
+
"ring-offset-color": [{ "ring-offset": scaleColor() }],
|
|
1406
|
+
"inset-ring-w": [{ "inset-ring": scaleBorderWidth() }],
|
|
1407
|
+
"inset-ring-color": [{ "inset-ring": scaleColor() }],
|
|
1408
|
+
"text-shadow": [{ "text-shadow": [
|
|
1409
|
+
"none",
|
|
1410
|
+
themeTextShadow,
|
|
1411
|
+
isArbitraryVariableShadow,
|
|
1412
|
+
isArbitraryShadow
|
|
1413
|
+
] }],
|
|
1414
|
+
"text-shadow-color": [{ "text-shadow": scaleColor() }],
|
|
1415
|
+
opacity: [{ opacity: [
|
|
1416
|
+
isNumber,
|
|
1417
|
+
isArbitraryVariable,
|
|
1418
|
+
isArbitraryValue
|
|
1419
|
+
] }],
|
|
1420
|
+
"mix-blend": [{ "mix-blend": [
|
|
1421
|
+
...scaleBlendMode(),
|
|
1422
|
+
"plus-darker",
|
|
1423
|
+
"plus-lighter"
|
|
1424
|
+
] }],
|
|
1425
|
+
"bg-blend": [{ "bg-blend": scaleBlendMode() }],
|
|
1426
|
+
"mask-clip": [{ "mask-clip": [
|
|
1427
|
+
"border",
|
|
1428
|
+
"padding",
|
|
1429
|
+
"content",
|
|
1430
|
+
"fill",
|
|
1431
|
+
"stroke",
|
|
1432
|
+
"view"
|
|
1433
|
+
] }, "mask-no-clip"],
|
|
1434
|
+
"mask-composite": [{ mask: [
|
|
1435
|
+
"add",
|
|
1436
|
+
"subtract",
|
|
1437
|
+
"intersect",
|
|
1438
|
+
"exclude"
|
|
1439
|
+
] }],
|
|
1440
|
+
"mask-image-linear-pos": [{ "mask-linear": [isNumber] }],
|
|
1441
|
+
"mask-image-linear-from-pos": [{ "mask-linear-from": scaleMaskImagePosition() }],
|
|
1442
|
+
"mask-image-linear-to-pos": [{ "mask-linear-to": scaleMaskImagePosition() }],
|
|
1443
|
+
"mask-image-linear-from-color": [{ "mask-linear-from": scaleColor() }],
|
|
1444
|
+
"mask-image-linear-to-color": [{ "mask-linear-to": scaleColor() }],
|
|
1445
|
+
"mask-image-t-from-pos": [{ "mask-t-from": scaleMaskImagePosition() }],
|
|
1446
|
+
"mask-image-t-to-pos": [{ "mask-t-to": scaleMaskImagePosition() }],
|
|
1447
|
+
"mask-image-t-from-color": [{ "mask-t-from": scaleColor() }],
|
|
1448
|
+
"mask-image-t-to-color": [{ "mask-t-to": scaleColor() }],
|
|
1449
|
+
"mask-image-r-from-pos": [{ "mask-r-from": scaleMaskImagePosition() }],
|
|
1450
|
+
"mask-image-r-to-pos": [{ "mask-r-to": scaleMaskImagePosition() }],
|
|
1451
|
+
"mask-image-r-from-color": [{ "mask-r-from": scaleColor() }],
|
|
1452
|
+
"mask-image-r-to-color": [{ "mask-r-to": scaleColor() }],
|
|
1453
|
+
"mask-image-b-from-pos": [{ "mask-b-from": scaleMaskImagePosition() }],
|
|
1454
|
+
"mask-image-b-to-pos": [{ "mask-b-to": scaleMaskImagePosition() }],
|
|
1455
|
+
"mask-image-b-from-color": [{ "mask-b-from": scaleColor() }],
|
|
1456
|
+
"mask-image-b-to-color": [{ "mask-b-to": scaleColor() }],
|
|
1457
|
+
"mask-image-l-from-pos": [{ "mask-l-from": scaleMaskImagePosition() }],
|
|
1458
|
+
"mask-image-l-to-pos": [{ "mask-l-to": scaleMaskImagePosition() }],
|
|
1459
|
+
"mask-image-l-from-color": [{ "mask-l-from": scaleColor() }],
|
|
1460
|
+
"mask-image-l-to-color": [{ "mask-l-to": scaleColor() }],
|
|
1461
|
+
"mask-image-x-from-pos": [{ "mask-x-from": scaleMaskImagePosition() }],
|
|
1462
|
+
"mask-image-x-to-pos": [{ "mask-x-to": scaleMaskImagePosition() }],
|
|
1463
|
+
"mask-image-x-from-color": [{ "mask-x-from": scaleColor() }],
|
|
1464
|
+
"mask-image-x-to-color": [{ "mask-x-to": scaleColor() }],
|
|
1465
|
+
"mask-image-y-from-pos": [{ "mask-y-from": scaleMaskImagePosition() }],
|
|
1466
|
+
"mask-image-y-to-pos": [{ "mask-y-to": scaleMaskImagePosition() }],
|
|
1467
|
+
"mask-image-y-from-color": [{ "mask-y-from": scaleColor() }],
|
|
1468
|
+
"mask-image-y-to-color": [{ "mask-y-to": scaleColor() }],
|
|
1469
|
+
"mask-image-radial": [{ "mask-radial": [isArbitraryVariable, isArbitraryValue] }],
|
|
1470
|
+
"mask-image-radial-from-pos": [{ "mask-radial-from": scaleMaskImagePosition() }],
|
|
1471
|
+
"mask-image-radial-to-pos": [{ "mask-radial-to": scaleMaskImagePosition() }],
|
|
1472
|
+
"mask-image-radial-from-color": [{ "mask-radial-from": scaleColor() }],
|
|
1473
|
+
"mask-image-radial-to-color": [{ "mask-radial-to": scaleColor() }],
|
|
1474
|
+
"mask-image-radial-shape": [{ "mask-radial": ["circle", "ellipse"] }],
|
|
1475
|
+
"mask-image-radial-size": [{ "mask-radial": [{
|
|
1476
|
+
closest: ["side", "corner"],
|
|
1477
|
+
farthest: ["side", "corner"]
|
|
1478
|
+
}] }],
|
|
1479
|
+
"mask-image-radial-pos": [{ "mask-radial-at": scalePosition() }],
|
|
1480
|
+
"mask-image-conic-pos": [{ "mask-conic": [isNumber] }],
|
|
1481
|
+
"mask-image-conic-from-pos": [{ "mask-conic-from": scaleMaskImagePosition() }],
|
|
1482
|
+
"mask-image-conic-to-pos": [{ "mask-conic-to": scaleMaskImagePosition() }],
|
|
1483
|
+
"mask-image-conic-from-color": [{ "mask-conic-from": scaleColor() }],
|
|
1484
|
+
"mask-image-conic-to-color": [{ "mask-conic-to": scaleColor() }],
|
|
1485
|
+
"mask-mode": [{ mask: [
|
|
1486
|
+
"alpha",
|
|
1487
|
+
"luminance",
|
|
1488
|
+
"match"
|
|
1489
|
+
] }],
|
|
1490
|
+
"mask-origin": [{ "mask-origin": [
|
|
1491
|
+
"border",
|
|
1492
|
+
"padding",
|
|
1493
|
+
"content",
|
|
1494
|
+
"fill",
|
|
1495
|
+
"stroke",
|
|
1496
|
+
"view"
|
|
1497
|
+
] }],
|
|
1498
|
+
"mask-position": [{ mask: scaleBgPosition() }],
|
|
1499
|
+
"mask-repeat": [{ mask: scaleBgRepeat() }],
|
|
1500
|
+
"mask-size": [{ mask: scaleBgSize() }],
|
|
1501
|
+
"mask-type": [{ "mask-type": ["alpha", "luminance"] }],
|
|
1502
|
+
"mask-image": [{ mask: [
|
|
1503
|
+
"none",
|
|
1504
|
+
isArbitraryVariable,
|
|
1505
|
+
isArbitraryValue
|
|
1506
|
+
] }],
|
|
1507
|
+
filter: [{ filter: [
|
|
1508
|
+
"",
|
|
1509
|
+
"none",
|
|
1510
|
+
isArbitraryVariable,
|
|
1511
|
+
isArbitraryValue
|
|
1512
|
+
] }],
|
|
1513
|
+
blur: [{ blur: scaleBlur() }],
|
|
1514
|
+
brightness: [{ brightness: [
|
|
1515
|
+
isNumber,
|
|
1516
|
+
isArbitraryVariable,
|
|
1517
|
+
isArbitraryValue
|
|
1518
|
+
] }],
|
|
1519
|
+
contrast: [{ contrast: [
|
|
1520
|
+
isNumber,
|
|
1521
|
+
isArbitraryVariable,
|
|
1522
|
+
isArbitraryValue
|
|
1523
|
+
] }],
|
|
1524
|
+
"drop-shadow": [{ "drop-shadow": [
|
|
1525
|
+
"",
|
|
1526
|
+
"none",
|
|
1527
|
+
themeDropShadow,
|
|
1528
|
+
isArbitraryVariableShadow,
|
|
1529
|
+
isArbitraryShadow
|
|
1530
|
+
] }],
|
|
1531
|
+
"drop-shadow-color": [{ "drop-shadow": scaleColor() }],
|
|
1532
|
+
grayscale: [{ grayscale: [
|
|
1533
|
+
"",
|
|
1534
|
+
isNumber,
|
|
1535
|
+
isArbitraryVariable,
|
|
1536
|
+
isArbitraryValue
|
|
1537
|
+
] }],
|
|
1538
|
+
"hue-rotate": [{ "hue-rotate": [
|
|
1539
|
+
isNumber,
|
|
1540
|
+
isArbitraryVariable,
|
|
1541
|
+
isArbitraryValue
|
|
1542
|
+
] }],
|
|
1543
|
+
invert: [{ invert: [
|
|
1544
|
+
"",
|
|
1545
|
+
isNumber,
|
|
1546
|
+
isArbitraryVariable,
|
|
1547
|
+
isArbitraryValue
|
|
1548
|
+
] }],
|
|
1549
|
+
saturate: [{ saturate: [
|
|
1550
|
+
isNumber,
|
|
1551
|
+
isArbitraryVariable,
|
|
1552
|
+
isArbitraryValue
|
|
1553
|
+
] }],
|
|
1554
|
+
sepia: [{ sepia: [
|
|
1555
|
+
"",
|
|
1556
|
+
isNumber,
|
|
1557
|
+
isArbitraryVariable,
|
|
1558
|
+
isArbitraryValue
|
|
1559
|
+
] }],
|
|
1560
|
+
"backdrop-filter": [{ "backdrop-filter": [
|
|
1561
|
+
"",
|
|
1562
|
+
"none",
|
|
1563
|
+
isArbitraryVariable,
|
|
1564
|
+
isArbitraryValue
|
|
1565
|
+
] }],
|
|
1566
|
+
"backdrop-blur": [{ "backdrop-blur": scaleBlur() }],
|
|
1567
|
+
"backdrop-brightness": [{ "backdrop-brightness": [
|
|
1568
|
+
isNumber,
|
|
1569
|
+
isArbitraryVariable,
|
|
1570
|
+
isArbitraryValue
|
|
1571
|
+
] }],
|
|
1572
|
+
"backdrop-contrast": [{ "backdrop-contrast": [
|
|
1573
|
+
isNumber,
|
|
1574
|
+
isArbitraryVariable,
|
|
1575
|
+
isArbitraryValue
|
|
1576
|
+
] }],
|
|
1577
|
+
"backdrop-grayscale": [{ "backdrop-grayscale": [
|
|
1578
|
+
"",
|
|
1579
|
+
isNumber,
|
|
1580
|
+
isArbitraryVariable,
|
|
1581
|
+
isArbitraryValue
|
|
1582
|
+
] }],
|
|
1583
|
+
"backdrop-hue-rotate": [{ "backdrop-hue-rotate": [
|
|
1584
|
+
isNumber,
|
|
1585
|
+
isArbitraryVariable,
|
|
1586
|
+
isArbitraryValue
|
|
1587
|
+
] }],
|
|
1588
|
+
"backdrop-invert": [{ "backdrop-invert": [
|
|
1589
|
+
"",
|
|
1590
|
+
isNumber,
|
|
1591
|
+
isArbitraryVariable,
|
|
1592
|
+
isArbitraryValue
|
|
1593
|
+
] }],
|
|
1594
|
+
"backdrop-opacity": [{ "backdrop-opacity": [
|
|
1595
|
+
isNumber,
|
|
1596
|
+
isArbitraryVariable,
|
|
1597
|
+
isArbitraryValue
|
|
1598
|
+
] }],
|
|
1599
|
+
"backdrop-saturate": [{ "backdrop-saturate": [
|
|
1600
|
+
isNumber,
|
|
1601
|
+
isArbitraryVariable,
|
|
1602
|
+
isArbitraryValue
|
|
1603
|
+
] }],
|
|
1604
|
+
"backdrop-sepia": [{ "backdrop-sepia": [
|
|
1605
|
+
"",
|
|
1606
|
+
isNumber,
|
|
1607
|
+
isArbitraryVariable,
|
|
1608
|
+
isArbitraryValue
|
|
1609
|
+
] }],
|
|
1610
|
+
"border-collapse": [{ border: ["collapse", "separate"] }],
|
|
1611
|
+
"border-spacing": [{ "border-spacing": scaleUnambiguousSpacing() }],
|
|
1612
|
+
"border-spacing-x": [{ "border-spacing-x": scaleUnambiguousSpacing() }],
|
|
1613
|
+
"border-spacing-y": [{ "border-spacing-y": scaleUnambiguousSpacing() }],
|
|
1614
|
+
"table-layout": [{ table: ["auto", "fixed"] }],
|
|
1615
|
+
caption: [{ caption: ["top", "bottom"] }],
|
|
1616
|
+
transition: [{ transition: [
|
|
1617
|
+
"",
|
|
1618
|
+
"all",
|
|
1619
|
+
"colors",
|
|
1620
|
+
"opacity",
|
|
1621
|
+
"shadow",
|
|
1622
|
+
"transform",
|
|
1623
|
+
"none",
|
|
1624
|
+
isArbitraryVariable,
|
|
1625
|
+
isArbitraryValue
|
|
1626
|
+
] }],
|
|
1627
|
+
"transition-behavior": [{ transition: ["normal", "discrete"] }],
|
|
1628
|
+
duration: [{ duration: [
|
|
1629
|
+
isNumber,
|
|
1630
|
+
"initial",
|
|
1631
|
+
isArbitraryVariable,
|
|
1632
|
+
isArbitraryValue
|
|
1633
|
+
] }],
|
|
1634
|
+
ease: [{ ease: [
|
|
1635
|
+
"linear",
|
|
1636
|
+
"initial",
|
|
1637
|
+
themeEase,
|
|
1638
|
+
isArbitraryVariable,
|
|
1639
|
+
isArbitraryValue
|
|
1640
|
+
] }],
|
|
1641
|
+
delay: [{ delay: [
|
|
1642
|
+
isNumber,
|
|
1643
|
+
isArbitraryVariable,
|
|
1644
|
+
isArbitraryValue
|
|
1645
|
+
] }],
|
|
1646
|
+
animate: [{ animate: [
|
|
1647
|
+
"none",
|
|
1648
|
+
themeAnimate,
|
|
1649
|
+
isArbitraryVariable,
|
|
1650
|
+
isArbitraryValue
|
|
1651
|
+
] }],
|
|
1652
|
+
backface: [{ backface: ["hidden", "visible"] }],
|
|
1653
|
+
perspective: [{ perspective: [
|
|
1654
|
+
themePerspective,
|
|
1655
|
+
isArbitraryVariable,
|
|
1656
|
+
isArbitraryValue
|
|
1657
|
+
] }],
|
|
1658
|
+
"perspective-origin": [{ "perspective-origin": scalePositionWithArbitrary() }],
|
|
1659
|
+
rotate: [{ rotate: scaleRotate() }],
|
|
1660
|
+
"rotate-x": [{ "rotate-x": scaleRotate() }],
|
|
1661
|
+
"rotate-y": [{ "rotate-y": scaleRotate() }],
|
|
1662
|
+
"rotate-z": [{ "rotate-z": scaleRotate() }],
|
|
1663
|
+
scale: [{ scale: scaleScale() }],
|
|
1664
|
+
"scale-x": [{ "scale-x": scaleScale() }],
|
|
1665
|
+
"scale-y": [{ "scale-y": scaleScale() }],
|
|
1666
|
+
"scale-z": [{ "scale-z": scaleScale() }],
|
|
1667
|
+
"scale-3d": ["scale-3d"],
|
|
1668
|
+
skew: [{ skew: scaleSkew() }],
|
|
1669
|
+
"skew-x": [{ "skew-x": scaleSkew() }],
|
|
1670
|
+
"skew-y": [{ "skew-y": scaleSkew() }],
|
|
1671
|
+
transform: [{ transform: [
|
|
1672
|
+
isArbitraryVariable,
|
|
1673
|
+
isArbitraryValue,
|
|
1674
|
+
"",
|
|
1675
|
+
"none",
|
|
1676
|
+
"gpu",
|
|
1677
|
+
"cpu"
|
|
1678
|
+
] }],
|
|
1679
|
+
"transform-origin": [{ origin: scalePositionWithArbitrary() }],
|
|
1680
|
+
"transform-style": [{ transform: ["3d", "flat"] }],
|
|
1681
|
+
translate: [{ translate: scaleTranslate() }],
|
|
1682
|
+
"translate-x": [{ "translate-x": scaleTranslate() }],
|
|
1683
|
+
"translate-y": [{ "translate-y": scaleTranslate() }],
|
|
1684
|
+
"translate-z": [{ "translate-z": scaleTranslate() }],
|
|
1685
|
+
"translate-none": ["translate-none"],
|
|
1686
|
+
accent: [{ accent: scaleColor() }],
|
|
1687
|
+
appearance: [{ appearance: ["none", "auto"] }],
|
|
1688
|
+
"caret-color": [{ caret: scaleColor() }],
|
|
1689
|
+
"color-scheme": [{ scheme: [
|
|
1690
|
+
"normal",
|
|
1691
|
+
"dark",
|
|
1692
|
+
"light",
|
|
1693
|
+
"light-dark",
|
|
1694
|
+
"only-dark",
|
|
1695
|
+
"only-light"
|
|
1696
|
+
] }],
|
|
1697
|
+
cursor: [{ cursor: [
|
|
1698
|
+
"auto",
|
|
1699
|
+
"default",
|
|
1700
|
+
"pointer",
|
|
1701
|
+
"wait",
|
|
1702
|
+
"text",
|
|
1703
|
+
"move",
|
|
1704
|
+
"help",
|
|
1705
|
+
"not-allowed",
|
|
1706
|
+
"none",
|
|
1707
|
+
"context-menu",
|
|
1708
|
+
"progress",
|
|
1709
|
+
"cell",
|
|
1710
|
+
"crosshair",
|
|
1711
|
+
"vertical-text",
|
|
1712
|
+
"alias",
|
|
1713
|
+
"copy",
|
|
1714
|
+
"no-drop",
|
|
1715
|
+
"grab",
|
|
1716
|
+
"grabbing",
|
|
1717
|
+
"all-scroll",
|
|
1718
|
+
"col-resize",
|
|
1719
|
+
"row-resize",
|
|
1720
|
+
"n-resize",
|
|
1721
|
+
"e-resize",
|
|
1722
|
+
"s-resize",
|
|
1723
|
+
"w-resize",
|
|
1724
|
+
"ne-resize",
|
|
1725
|
+
"nw-resize",
|
|
1726
|
+
"se-resize",
|
|
1727
|
+
"sw-resize",
|
|
1728
|
+
"ew-resize",
|
|
1729
|
+
"ns-resize",
|
|
1730
|
+
"nesw-resize",
|
|
1731
|
+
"nwse-resize",
|
|
1732
|
+
"zoom-in",
|
|
1733
|
+
"zoom-out",
|
|
1734
|
+
isArbitraryVariable,
|
|
1735
|
+
isArbitraryValue
|
|
1736
|
+
] }],
|
|
1737
|
+
"field-sizing": [{ "field-sizing": ["fixed", "content"] }],
|
|
1738
|
+
"pointer-events": [{ "pointer-events": ["auto", "none"] }],
|
|
1739
|
+
resize: [{ resize: [
|
|
1740
|
+
"none",
|
|
1741
|
+
"",
|
|
1742
|
+
"y",
|
|
1743
|
+
"x"
|
|
1744
|
+
] }],
|
|
1745
|
+
"scroll-behavior": [{ scroll: ["auto", "smooth"] }],
|
|
1746
|
+
"scroll-m": [{ "scroll-m": scaleUnambiguousSpacing() }],
|
|
1747
|
+
"scroll-mx": [{ "scroll-mx": scaleUnambiguousSpacing() }],
|
|
1748
|
+
"scroll-my": [{ "scroll-my": scaleUnambiguousSpacing() }],
|
|
1749
|
+
"scroll-ms": [{ "scroll-ms": scaleUnambiguousSpacing() }],
|
|
1750
|
+
"scroll-me": [{ "scroll-me": scaleUnambiguousSpacing() }],
|
|
1751
|
+
"scroll-mt": [{ "scroll-mt": scaleUnambiguousSpacing() }],
|
|
1752
|
+
"scroll-mr": [{ "scroll-mr": scaleUnambiguousSpacing() }],
|
|
1753
|
+
"scroll-mb": [{ "scroll-mb": scaleUnambiguousSpacing() }],
|
|
1754
|
+
"scroll-ml": [{ "scroll-ml": scaleUnambiguousSpacing() }],
|
|
1755
|
+
"scroll-p": [{ "scroll-p": scaleUnambiguousSpacing() }],
|
|
1756
|
+
"scroll-px": [{ "scroll-px": scaleUnambiguousSpacing() }],
|
|
1757
|
+
"scroll-py": [{ "scroll-py": scaleUnambiguousSpacing() }],
|
|
1758
|
+
"scroll-ps": [{ "scroll-ps": scaleUnambiguousSpacing() }],
|
|
1759
|
+
"scroll-pe": [{ "scroll-pe": scaleUnambiguousSpacing() }],
|
|
1760
|
+
"scroll-pt": [{ "scroll-pt": scaleUnambiguousSpacing() }],
|
|
1761
|
+
"scroll-pr": [{ "scroll-pr": scaleUnambiguousSpacing() }],
|
|
1762
|
+
"scroll-pb": [{ "scroll-pb": scaleUnambiguousSpacing() }],
|
|
1763
|
+
"scroll-pl": [{ "scroll-pl": scaleUnambiguousSpacing() }],
|
|
1764
|
+
"snap-align": [{ snap: [
|
|
1765
|
+
"start",
|
|
1766
|
+
"end",
|
|
1767
|
+
"center",
|
|
1768
|
+
"align-none"
|
|
1769
|
+
] }],
|
|
1770
|
+
"snap-stop": [{ snap: ["normal", "always"] }],
|
|
1771
|
+
"snap-type": [{ snap: [
|
|
1772
|
+
"none",
|
|
1773
|
+
"x",
|
|
1774
|
+
"y",
|
|
1775
|
+
"both"
|
|
1776
|
+
] }],
|
|
1777
|
+
"snap-strictness": [{ snap: ["mandatory", "proximity"] }],
|
|
1778
|
+
touch: [{ touch: [
|
|
1779
|
+
"auto",
|
|
1780
|
+
"none",
|
|
1781
|
+
"manipulation"
|
|
1782
|
+
] }],
|
|
1783
|
+
"touch-x": [{ "touch-pan": [
|
|
1784
|
+
"x",
|
|
1785
|
+
"left",
|
|
1786
|
+
"right"
|
|
1787
|
+
] }],
|
|
1788
|
+
"touch-y": [{ "touch-pan": [
|
|
1789
|
+
"y",
|
|
1790
|
+
"up",
|
|
1791
|
+
"down"
|
|
1792
|
+
] }],
|
|
1793
|
+
"touch-pz": ["touch-pinch-zoom"],
|
|
1794
|
+
select: [{ select: [
|
|
1795
|
+
"none",
|
|
1796
|
+
"text",
|
|
1797
|
+
"all",
|
|
1798
|
+
"auto"
|
|
1799
|
+
] }],
|
|
1800
|
+
"will-change": [{ "will-change": [
|
|
1801
|
+
"auto",
|
|
1802
|
+
"scroll",
|
|
1803
|
+
"contents",
|
|
1804
|
+
"transform",
|
|
1805
|
+
isArbitraryVariable,
|
|
1806
|
+
isArbitraryValue
|
|
1807
|
+
] }],
|
|
1808
|
+
fill: [{ fill: ["none", ...scaleColor()] }],
|
|
1809
|
+
"stroke-w": [{ stroke: [
|
|
1810
|
+
isNumber,
|
|
1811
|
+
isArbitraryVariableLength,
|
|
1812
|
+
isArbitraryLength,
|
|
1813
|
+
isArbitraryNumber
|
|
1814
|
+
] }],
|
|
1815
|
+
stroke: [{ stroke: ["none", ...scaleColor()] }],
|
|
1816
|
+
"forced-color-adjust": [{ "forced-color-adjust": ["auto", "none"] }]
|
|
1817
|
+
},
|
|
1818
|
+
conflictingClassGroups: {
|
|
1819
|
+
overflow: ["overflow-x", "overflow-y"],
|
|
1820
|
+
overscroll: ["overscroll-x", "overscroll-y"],
|
|
1821
|
+
inset: [
|
|
1822
|
+
"inset-x",
|
|
1823
|
+
"inset-y",
|
|
1824
|
+
"start",
|
|
1825
|
+
"end",
|
|
1826
|
+
"top",
|
|
1827
|
+
"right",
|
|
1828
|
+
"bottom",
|
|
1829
|
+
"left"
|
|
1830
|
+
],
|
|
1831
|
+
"inset-x": ["right", "left"],
|
|
1832
|
+
"inset-y": ["top", "bottom"],
|
|
1833
|
+
flex: [
|
|
1834
|
+
"basis",
|
|
1835
|
+
"grow",
|
|
1836
|
+
"shrink"
|
|
1837
|
+
],
|
|
1838
|
+
gap: ["gap-x", "gap-y"],
|
|
1839
|
+
p: [
|
|
1840
|
+
"px",
|
|
1841
|
+
"py",
|
|
1842
|
+
"ps",
|
|
1843
|
+
"pe",
|
|
1844
|
+
"pt",
|
|
1845
|
+
"pr",
|
|
1846
|
+
"pb",
|
|
1847
|
+
"pl"
|
|
1848
|
+
],
|
|
1849
|
+
px: ["pr", "pl"],
|
|
1850
|
+
py: ["pt", "pb"],
|
|
1851
|
+
m: [
|
|
1852
|
+
"mx",
|
|
1853
|
+
"my",
|
|
1854
|
+
"ms",
|
|
1855
|
+
"me",
|
|
1856
|
+
"mt",
|
|
1857
|
+
"mr",
|
|
1858
|
+
"mb",
|
|
1859
|
+
"ml"
|
|
1860
|
+
],
|
|
1861
|
+
mx: ["mr", "ml"],
|
|
1862
|
+
my: ["mt", "mb"],
|
|
1863
|
+
size: ["w", "h"],
|
|
1864
|
+
"font-size": ["leading"],
|
|
1865
|
+
"fvn-normal": [
|
|
1866
|
+
"fvn-ordinal",
|
|
1867
|
+
"fvn-slashed-zero",
|
|
1868
|
+
"fvn-figure",
|
|
1869
|
+
"fvn-spacing",
|
|
1870
|
+
"fvn-fraction"
|
|
1871
|
+
],
|
|
1872
|
+
"fvn-ordinal": ["fvn-normal"],
|
|
1873
|
+
"fvn-slashed-zero": ["fvn-normal"],
|
|
1874
|
+
"fvn-figure": ["fvn-normal"],
|
|
1875
|
+
"fvn-spacing": ["fvn-normal"],
|
|
1876
|
+
"fvn-fraction": ["fvn-normal"],
|
|
1877
|
+
"line-clamp": ["display", "overflow"],
|
|
1878
|
+
rounded: [
|
|
1879
|
+
"rounded-s",
|
|
1880
|
+
"rounded-e",
|
|
1881
|
+
"rounded-t",
|
|
1882
|
+
"rounded-r",
|
|
1883
|
+
"rounded-b",
|
|
1884
|
+
"rounded-l",
|
|
1885
|
+
"rounded-ss",
|
|
1886
|
+
"rounded-se",
|
|
1887
|
+
"rounded-ee",
|
|
1888
|
+
"rounded-es",
|
|
1889
|
+
"rounded-tl",
|
|
1890
|
+
"rounded-tr",
|
|
1891
|
+
"rounded-br",
|
|
1892
|
+
"rounded-bl"
|
|
1893
|
+
],
|
|
1894
|
+
"rounded-s": ["rounded-ss", "rounded-es"],
|
|
1895
|
+
"rounded-e": ["rounded-se", "rounded-ee"],
|
|
1896
|
+
"rounded-t": ["rounded-tl", "rounded-tr"],
|
|
1897
|
+
"rounded-r": ["rounded-tr", "rounded-br"],
|
|
1898
|
+
"rounded-b": ["rounded-br", "rounded-bl"],
|
|
1899
|
+
"rounded-l": ["rounded-tl", "rounded-bl"],
|
|
1900
|
+
"border-spacing": ["border-spacing-x", "border-spacing-y"],
|
|
1901
|
+
"border-w": [
|
|
1902
|
+
"border-w-x",
|
|
1903
|
+
"border-w-y",
|
|
1904
|
+
"border-w-s",
|
|
1905
|
+
"border-w-e",
|
|
1906
|
+
"border-w-t",
|
|
1907
|
+
"border-w-r",
|
|
1908
|
+
"border-w-b",
|
|
1909
|
+
"border-w-l"
|
|
1910
|
+
],
|
|
1911
|
+
"border-w-x": ["border-w-r", "border-w-l"],
|
|
1912
|
+
"border-w-y": ["border-w-t", "border-w-b"],
|
|
1913
|
+
"border-color": [
|
|
1914
|
+
"border-color-x",
|
|
1915
|
+
"border-color-y",
|
|
1916
|
+
"border-color-s",
|
|
1917
|
+
"border-color-e",
|
|
1918
|
+
"border-color-t",
|
|
1919
|
+
"border-color-r",
|
|
1920
|
+
"border-color-b",
|
|
1921
|
+
"border-color-l"
|
|
1922
|
+
],
|
|
1923
|
+
"border-color-x": ["border-color-r", "border-color-l"],
|
|
1924
|
+
"border-color-y": ["border-color-t", "border-color-b"],
|
|
1925
|
+
translate: [
|
|
1926
|
+
"translate-x",
|
|
1927
|
+
"translate-y",
|
|
1928
|
+
"translate-none"
|
|
1929
|
+
],
|
|
1930
|
+
"translate-none": [
|
|
1931
|
+
"translate",
|
|
1932
|
+
"translate-x",
|
|
1933
|
+
"translate-y",
|
|
1934
|
+
"translate-z"
|
|
1935
|
+
],
|
|
1936
|
+
"scroll-m": [
|
|
1937
|
+
"scroll-mx",
|
|
1938
|
+
"scroll-my",
|
|
1939
|
+
"scroll-ms",
|
|
1940
|
+
"scroll-me",
|
|
1941
|
+
"scroll-mt",
|
|
1942
|
+
"scroll-mr",
|
|
1943
|
+
"scroll-mb",
|
|
1944
|
+
"scroll-ml"
|
|
1945
|
+
],
|
|
1946
|
+
"scroll-mx": ["scroll-mr", "scroll-ml"],
|
|
1947
|
+
"scroll-my": ["scroll-mt", "scroll-mb"],
|
|
1948
|
+
"scroll-p": [
|
|
1949
|
+
"scroll-px",
|
|
1950
|
+
"scroll-py",
|
|
1951
|
+
"scroll-ps",
|
|
1952
|
+
"scroll-pe",
|
|
1953
|
+
"scroll-pt",
|
|
1954
|
+
"scroll-pr",
|
|
1955
|
+
"scroll-pb",
|
|
1956
|
+
"scroll-pl"
|
|
1957
|
+
],
|
|
1958
|
+
"scroll-px": ["scroll-pr", "scroll-pl"],
|
|
1959
|
+
"scroll-py": ["scroll-pt", "scroll-pb"],
|
|
1960
|
+
touch: [
|
|
1961
|
+
"touch-x",
|
|
1962
|
+
"touch-y",
|
|
1963
|
+
"touch-pz"
|
|
1964
|
+
],
|
|
1965
|
+
"touch-x": ["touch"],
|
|
1966
|
+
"touch-y": ["touch"],
|
|
1967
|
+
"touch-pz": ["touch"]
|
|
1968
|
+
},
|
|
1969
|
+
conflictingClassGroupModifiers: { "font-size": ["leading"] },
|
|
1970
|
+
orderSensitiveModifiers: [
|
|
1971
|
+
"*",
|
|
1972
|
+
"**",
|
|
1973
|
+
"after",
|
|
1974
|
+
"backdrop",
|
|
1975
|
+
"before",
|
|
1976
|
+
"details-content",
|
|
1977
|
+
"file",
|
|
1978
|
+
"first-letter",
|
|
1979
|
+
"first-line",
|
|
1980
|
+
"marker",
|
|
1981
|
+
"placeholder",
|
|
1982
|
+
"selection"
|
|
1983
|
+
]
|
|
1984
|
+
};
|
|
1985
|
+
};
|
|
1986
|
+
var twMerge = /* @__PURE__ */ createTailwindMerge(getDefaultConfig);
|
|
1987
|
+
function cn(...inputs) {
|
|
1988
|
+
return twMerge(clsx(inputs));
|
|
1989
|
+
}
|
|
1990
|
+
var buttonVariants = cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", {
|
|
1991
|
+
variants: {
|
|
1992
|
+
variant: {
|
|
1993
|
+
default: "bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
|
|
1994
|
+
destructive: "bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
1995
|
+
outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
|
|
1996
|
+
secondary: "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
|
|
1997
|
+
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
1998
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
1999
|
+
},
|
|
2000
|
+
size: {
|
|
2001
|
+
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
2002
|
+
sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
|
|
2003
|
+
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
|
|
2004
|
+
icon: "size-9"
|
|
2005
|
+
}
|
|
2006
|
+
},
|
|
2007
|
+
defaultVariants: {
|
|
2008
|
+
variant: "default",
|
|
2009
|
+
size: "default"
|
|
2010
|
+
}
|
|
2011
|
+
});
|
|
2012
|
+
function Button({ className, variant, size, asChild = false, ...props }) {
|
|
2013
|
+
return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(asChild ? Slot$1 : "button", {
|
|
2014
|
+
"data-slot": "button",
|
|
2015
|
+
className: cn(buttonVariants({
|
|
2016
|
+
variant,
|
|
2017
|
+
size,
|
|
2018
|
+
className
|
|
2019
|
+
})),
|
|
2020
|
+
...props
|
|
2021
|
+
});
|
|
2022
|
+
}
|
|
2023
|
+
typeof window !== "undefined" && window.document && window.document.createElement;
|
|
2024
|
+
function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
|
|
2025
|
+
return function handleEvent(event) {
|
|
2026
|
+
originalEventHandler?.(event);
|
|
2027
|
+
if (checkForDefaultPrevented === false || !event.defaultPrevented) return ourEventHandler?.(event);
|
|
2028
|
+
};
|
|
2029
|
+
}
|
|
2030
|
+
function createContext2(rootComponentName, defaultContext) {
|
|
2031
|
+
const Context = react__WEBPACK_IMPORTED_MODULE_0__.createContext(defaultContext);
|
|
2032
|
+
const Provider = (props) => {
|
|
2033
|
+
const { children, ...context } = props;
|
|
2034
|
+
const value = react__WEBPACK_IMPORTED_MODULE_0__.useMemo(() => context, Object.values(context));
|
|
2035
|
+
return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(Context.Provider, {
|
|
2036
|
+
value,
|
|
2037
|
+
children
|
|
2038
|
+
});
|
|
2039
|
+
};
|
|
2040
|
+
Provider.displayName = rootComponentName + "Provider";
|
|
2041
|
+
function useContext2(consumerName) {
|
|
2042
|
+
const context = react__WEBPACK_IMPORTED_MODULE_0__.useContext(Context);
|
|
2043
|
+
if (context) return context;
|
|
2044
|
+
if (defaultContext !== void 0) return defaultContext;
|
|
2045
|
+
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
2046
|
+
}
|
|
2047
|
+
return [Provider, useContext2];
|
|
2048
|
+
}
|
|
2049
|
+
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
2050
|
+
let defaultContexts = [];
|
|
2051
|
+
function createContext3(rootComponentName, defaultContext) {
|
|
2052
|
+
const BaseContext = react__WEBPACK_IMPORTED_MODULE_0__.createContext(defaultContext);
|
|
2053
|
+
const index = defaultContexts.length;
|
|
2054
|
+
defaultContexts = [...defaultContexts, defaultContext];
|
|
2055
|
+
const Provider = (props) => {
|
|
2056
|
+
const { scope, children, ...context } = props;
|
|
2057
|
+
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
2058
|
+
const value = react__WEBPACK_IMPORTED_MODULE_0__.useMemo(() => context, Object.values(context));
|
|
2059
|
+
return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(Context.Provider, {
|
|
2060
|
+
value,
|
|
2061
|
+
children
|
|
2062
|
+
});
|
|
2063
|
+
};
|
|
2064
|
+
Provider.displayName = rootComponentName + "Provider";
|
|
2065
|
+
function useContext2(consumerName, scope) {
|
|
2066
|
+
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
2067
|
+
const context = react__WEBPACK_IMPORTED_MODULE_0__.useContext(Context);
|
|
2068
|
+
if (context) return context;
|
|
2069
|
+
if (defaultContext !== void 0) return defaultContext;
|
|
2070
|
+
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
2071
|
+
}
|
|
2072
|
+
return [Provider, useContext2];
|
|
2073
|
+
}
|
|
2074
|
+
const createScope = () => {
|
|
2075
|
+
const scopeContexts = defaultContexts.map((defaultContext) => {
|
|
2076
|
+
return react__WEBPACK_IMPORTED_MODULE_0__.createContext(defaultContext);
|
|
2077
|
+
});
|
|
2078
|
+
return function useScope(scope) {
|
|
2079
|
+
const contexts = scope?.[scopeName] || scopeContexts;
|
|
2080
|
+
return react__WEBPACK_IMPORTED_MODULE_0__.useMemo(() => ({ [`__scope${scopeName}`]: {
|
|
2081
|
+
...scope,
|
|
2082
|
+
[scopeName]: contexts
|
|
2083
|
+
} }), [scope, contexts]);
|
|
2084
|
+
};
|
|
2085
|
+
};
|
|
2086
|
+
createScope.scopeName = scopeName;
|
|
2087
|
+
return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];
|
|
2088
|
+
}
|
|
2089
|
+
function composeContextScopes(...scopes) {
|
|
2090
|
+
const baseScope = scopes[0];
|
|
2091
|
+
if (scopes.length === 1) return baseScope;
|
|
2092
|
+
const createScope = () => {
|
|
2093
|
+
const scopeHooks = scopes.map((createScope2) => ({
|
|
2094
|
+
useScope: createScope2(),
|
|
2095
|
+
scopeName: createScope2.scopeName
|
|
2096
|
+
}));
|
|
2097
|
+
return function useComposedScopes(overrideScopes) {
|
|
2098
|
+
const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
|
|
2099
|
+
const currentScope = useScope(overrideScopes)[`__scope${scopeName}`];
|
|
2100
|
+
return {
|
|
2101
|
+
...nextScopes2,
|
|
2102
|
+
...currentScope
|
|
2103
|
+
};
|
|
2104
|
+
}, {});
|
|
2105
|
+
return react__WEBPACK_IMPORTED_MODULE_0__.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
2106
|
+
};
|
|
2107
|
+
};
|
|
2108
|
+
createScope.scopeName = baseScope.scopeName;
|
|
2109
|
+
return createScope;
|
|
2110
|
+
}
|
|
2111
|
+
var useLayoutEffect2 = globalThis?.document ? react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect : () => {};
|
|
2112
|
+
var useReactId = /*#__PURE__*/ (react__WEBPACK_IMPORTED_MODULE_0___namespace_cache || (react__WEBPACK_IMPORTED_MODULE_0___namespace_cache = __webpack_require__.t(react__WEBPACK_IMPORTED_MODULE_0__, 2)))[" useId ".trim().toString()] || (() => void 0);
|
|
2113
|
+
var count$1 = 0;
|
|
2114
|
+
function useId(deterministicId) {
|
|
2115
|
+
const [id, setId] = react__WEBPACK_IMPORTED_MODULE_0__.useState(useReactId());
|
|
2116
|
+
useLayoutEffect2(() => {
|
|
2117
|
+
if (!deterministicId) setId((reactId) => reactId ?? String(count$1++));
|
|
2118
|
+
}, [deterministicId]);
|
|
2119
|
+
return deterministicId || (id ? `radix-${id}` : "");
|
|
2120
|
+
}
|
|
2121
|
+
var useInsertionEffect = /*#__PURE__*/ (react__WEBPACK_IMPORTED_MODULE_0___namespace_cache || (react__WEBPACK_IMPORTED_MODULE_0___namespace_cache = __webpack_require__.t(react__WEBPACK_IMPORTED_MODULE_0__, 2)))[" useInsertionEffect ".trim().toString()] || useLayoutEffect2;
|
|
2122
|
+
function useControllableState({ prop, defaultProp, onChange = () => {}, caller }) {
|
|
2123
|
+
const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({
|
|
2124
|
+
defaultProp,
|
|
2125
|
+
onChange
|
|
2126
|
+
});
|
|
2127
|
+
const isControlled = prop !== void 0;
|
|
2128
|
+
const value = isControlled ? prop : uncontrolledProp;
|
|
2129
|
+
{
|
|
2130
|
+
const isControlledRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(prop !== void 0);
|
|
2131
|
+
react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {
|
|
2132
|
+
const wasControlled = isControlledRef.current;
|
|
2133
|
+
if (wasControlled !== isControlled) {
|
|
2134
|
+
const from = wasControlled ? "controlled" : "uncontrolled";
|
|
2135
|
+
const to = isControlled ? "controlled" : "uncontrolled";
|
|
2136
|
+
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.`);
|
|
2137
|
+
}
|
|
2138
|
+
isControlledRef.current = isControlled;
|
|
2139
|
+
}, [isControlled, caller]);
|
|
2140
|
+
}
|
|
2141
|
+
return [value, react__WEBPACK_IMPORTED_MODULE_0__.useCallback((nextValue) => {
|
|
2142
|
+
if (isControlled) {
|
|
2143
|
+
const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;
|
|
2144
|
+
if (value2 !== prop) onChangeRef.current?.(value2);
|
|
2145
|
+
} else setUncontrolledProp(nextValue);
|
|
2146
|
+
}, [
|
|
2147
|
+
isControlled,
|
|
2148
|
+
prop,
|
|
2149
|
+
setUncontrolledProp,
|
|
2150
|
+
onChangeRef
|
|
2151
|
+
])];
|
|
2152
|
+
}
|
|
2153
|
+
function useUncontrolledState({ defaultProp, onChange }) {
|
|
2154
|
+
const [value, setValue] = react__WEBPACK_IMPORTED_MODULE_0__.useState(defaultProp);
|
|
2155
|
+
const prevValueRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(value);
|
|
2156
|
+
const onChangeRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(onChange);
|
|
2157
|
+
useInsertionEffect(() => {
|
|
2158
|
+
onChangeRef.current = onChange;
|
|
2159
|
+
}, [onChange]);
|
|
2160
|
+
react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {
|
|
2161
|
+
if (prevValueRef.current !== value) {
|
|
2162
|
+
onChangeRef.current?.(value);
|
|
2163
|
+
prevValueRef.current = value;
|
|
2164
|
+
}
|
|
2165
|
+
}, [value, prevValueRef]);
|
|
2166
|
+
return [
|
|
2167
|
+
value,
|
|
2168
|
+
setValue,
|
|
2169
|
+
onChangeRef
|
|
2170
|
+
];
|
|
2171
|
+
}
|
|
2172
|
+
function isFunction(value) {
|
|
2173
|
+
return typeof value === "function";
|
|
2174
|
+
}
|
|
2175
|
+
var Primitive = [
|
|
2176
|
+
"a",
|
|
2177
|
+
"button",
|
|
2178
|
+
"div",
|
|
2179
|
+
"form",
|
|
2180
|
+
"h2",
|
|
2181
|
+
"h3",
|
|
2182
|
+
"img",
|
|
2183
|
+
"input",
|
|
2184
|
+
"label",
|
|
2185
|
+
"li",
|
|
2186
|
+
"nav",
|
|
2187
|
+
"ol",
|
|
2188
|
+
"p",
|
|
2189
|
+
"select",
|
|
2190
|
+
"span",
|
|
2191
|
+
"svg",
|
|
2192
|
+
"ul"
|
|
2193
|
+
].reduce((primitive, node) => {
|
|
2194
|
+
const Slot$2 = /* @__PURE__ */ createSlot(`Primitive.${node}`);
|
|
2195
|
+
const Node$1 = react__WEBPACK_IMPORTED_MODULE_0__.forwardRef((props, forwardedRef) => {
|
|
2196
|
+
const { asChild, ...primitiveProps } = props;
|
|
2197
|
+
const Comp = asChild ? Slot$2 : node;
|
|
2198
|
+
if (typeof window !== "undefined") window[Symbol.for("radix-ui")] = true;
|
|
2199
|
+
return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(Comp, {
|
|
2200
|
+
...primitiveProps,
|
|
2201
|
+
ref: forwardedRef
|
|
2202
|
+
});
|
|
2203
|
+
});
|
|
2204
|
+
Node$1.displayName = `Primitive.${node}`;
|
|
2205
|
+
return {
|
|
2206
|
+
...primitive,
|
|
2207
|
+
[node]: Node$1
|
|
2208
|
+
};
|
|
2209
|
+
}, {});
|
|
2210
|
+
function dispatchDiscreteCustomEvent(target, event) {
|
|
2211
|
+
if (target) react_dom__WEBPACK_IMPORTED_MODULE_3__.flushSync(() => target.dispatchEvent(event));
|
|
2212
|
+
}
|
|
2213
|
+
function useCallbackRef$1(callback) {
|
|
2214
|
+
const callbackRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(callback);
|
|
2215
|
+
react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {
|
|
2216
|
+
callbackRef.current = callback;
|
|
2217
|
+
});
|
|
2218
|
+
return react__WEBPACK_IMPORTED_MODULE_0__.useMemo(() => (...args) => callbackRef.current?.(...args), []);
|
|
2219
|
+
}
|
|
2220
|
+
function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.document) {
|
|
2221
|
+
const onEscapeKeyDown = useCallbackRef$1(onEscapeKeyDownProp);
|
|
2222
|
+
react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {
|
|
2223
|
+
const handleKeyDown = (event) => {
|
|
2224
|
+
if (event.key === "Escape") onEscapeKeyDown(event);
|
|
2225
|
+
};
|
|
2226
|
+
ownerDocument.addEventListener("keydown", handleKeyDown, { capture: true });
|
|
2227
|
+
return () => ownerDocument.removeEventListener("keydown", handleKeyDown, { capture: true });
|
|
2228
|
+
}, [onEscapeKeyDown, ownerDocument]);
|
|
2229
|
+
}
|
|
2230
|
+
var DISMISSABLE_LAYER_NAME = "DismissableLayer";
|
|
2231
|
+
var CONTEXT_UPDATE = "dismissableLayer.update";
|
|
2232
|
+
var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside";
|
|
2233
|
+
var FOCUS_OUTSIDE = "dismissableLayer.focusOutside";
|
|
2234
|
+
var originalBodyPointerEvents;
|
|
2235
|
+
var DismissableLayerContext = react__WEBPACK_IMPORTED_MODULE_0__.createContext({
|
|
2236
|
+
layers: /* @__PURE__ */ new Set(),
|
|
2237
|
+
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
2238
|
+
branches: /* @__PURE__ */ new Set()
|
|
2239
|
+
});
|
|
2240
|
+
var DismissableLayer = react__WEBPACK_IMPORTED_MODULE_0__.forwardRef((props, forwardedRef) => {
|
|
2241
|
+
const { disableOutsidePointerEvents = false, onEscapeKeyDown, onPointerDownOutside, onFocusOutside, onInteractOutside, onDismiss, ...layerProps } = props;
|
|
2242
|
+
const context = react__WEBPACK_IMPORTED_MODULE_0__.useContext(DismissableLayerContext);
|
|
2243
|
+
const [node, setNode] = react__WEBPACK_IMPORTED_MODULE_0__.useState(null);
|
|
2244
|
+
const ownerDocument = node?.ownerDocument ?? globalThis?.document;
|
|
2245
|
+
const [, force] = react__WEBPACK_IMPORTED_MODULE_0__.useState({});
|
|
2246
|
+
const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));
|
|
2247
|
+
const layers = Array.from(context.layers);
|
|
2248
|
+
const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);
|
|
2249
|
+
const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled);
|
|
2250
|
+
const index = node ? layers.indexOf(node) : -1;
|
|
2251
|
+
const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;
|
|
2252
|
+
const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;
|
|
2253
|
+
const pointerDownOutside = usePointerDownOutside((event) => {
|
|
2254
|
+
const target = event.target;
|
|
2255
|
+
const isPointerDownOnBranch = [...context.branches].some((branch) => branch.contains(target));
|
|
2256
|
+
if (!isPointerEventsEnabled || isPointerDownOnBranch) return;
|
|
2257
|
+
onPointerDownOutside?.(event);
|
|
2258
|
+
onInteractOutside?.(event);
|
|
2259
|
+
if (!event.defaultPrevented) onDismiss?.();
|
|
2260
|
+
}, ownerDocument);
|
|
2261
|
+
const focusOutside = useFocusOutside((event) => {
|
|
2262
|
+
const target = event.target;
|
|
2263
|
+
if ([...context.branches].some((branch) => branch.contains(target))) return;
|
|
2264
|
+
onFocusOutside?.(event);
|
|
2265
|
+
onInteractOutside?.(event);
|
|
2266
|
+
if (!event.defaultPrevented) onDismiss?.();
|
|
2267
|
+
}, ownerDocument);
|
|
2268
|
+
useEscapeKeydown((event) => {
|
|
2269
|
+
if (!(index === context.layers.size - 1)) return;
|
|
2270
|
+
onEscapeKeyDown?.(event);
|
|
2271
|
+
if (!event.defaultPrevented && onDismiss) {
|
|
2272
|
+
event.preventDefault();
|
|
2273
|
+
onDismiss();
|
|
2274
|
+
}
|
|
2275
|
+
}, ownerDocument);
|
|
2276
|
+
react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {
|
|
2277
|
+
if (!node) return;
|
|
2278
|
+
if (disableOutsidePointerEvents) {
|
|
2279
|
+
if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
|
|
2280
|
+
originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;
|
|
2281
|
+
ownerDocument.body.style.pointerEvents = "none";
|
|
2282
|
+
}
|
|
2283
|
+
context.layersWithOutsidePointerEventsDisabled.add(node);
|
|
2284
|
+
}
|
|
2285
|
+
context.layers.add(node);
|
|
2286
|
+
dispatchUpdate();
|
|
2287
|
+
return () => {
|
|
2288
|
+
if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) ownerDocument.body.style.pointerEvents = originalBodyPointerEvents;
|
|
2289
|
+
};
|
|
2290
|
+
}, [
|
|
2291
|
+
node,
|
|
2292
|
+
ownerDocument,
|
|
2293
|
+
disableOutsidePointerEvents,
|
|
2294
|
+
context
|
|
2295
|
+
]);
|
|
2296
|
+
react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {
|
|
2297
|
+
return () => {
|
|
2298
|
+
if (!node) return;
|
|
2299
|
+
context.layers.delete(node);
|
|
2300
|
+
context.layersWithOutsidePointerEventsDisabled.delete(node);
|
|
2301
|
+
dispatchUpdate();
|
|
2302
|
+
};
|
|
2303
|
+
}, [node, context]);
|
|
2304
|
+
react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {
|
|
2305
|
+
const handleUpdate = () => force({});
|
|
2306
|
+
document.addEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
2307
|
+
return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
2308
|
+
}, []);
|
|
2309
|
+
return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(Primitive.div, {
|
|
2310
|
+
...layerProps,
|
|
2311
|
+
ref: composedRefs,
|
|
2312
|
+
style: {
|
|
2313
|
+
pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? "auto" : "none" : void 0,
|
|
2314
|
+
...props.style
|
|
2315
|
+
},
|
|
2316
|
+
onFocusCapture: composeEventHandlers(props.onFocusCapture, focusOutside.onFocusCapture),
|
|
2317
|
+
onBlurCapture: composeEventHandlers(props.onBlurCapture, focusOutside.onBlurCapture),
|
|
2318
|
+
onPointerDownCapture: composeEventHandlers(props.onPointerDownCapture, pointerDownOutside.onPointerDownCapture)
|
|
2319
|
+
});
|
|
2320
|
+
});
|
|
2321
|
+
DismissableLayer.displayName = DISMISSABLE_LAYER_NAME;
|
|
2322
|
+
var BRANCH_NAME = "DismissableLayerBranch";
|
|
2323
|
+
var DismissableLayerBranch = react__WEBPACK_IMPORTED_MODULE_0__.forwardRef((props, forwardedRef) => {
|
|
2324
|
+
const context = react__WEBPACK_IMPORTED_MODULE_0__.useContext(DismissableLayerContext);
|
|
2325
|
+
const ref = react__WEBPACK_IMPORTED_MODULE_0__.useRef(null);
|
|
2326
|
+
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
2327
|
+
react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {
|
|
2328
|
+
const node = ref.current;
|
|
2329
|
+
if (node) {
|
|
2330
|
+
context.branches.add(node);
|
|
2331
|
+
return () => {
|
|
2332
|
+
context.branches.delete(node);
|
|
2333
|
+
};
|
|
2334
|
+
}
|
|
2335
|
+
}, [context.branches]);
|
|
2336
|
+
return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(Primitive.div, {
|
|
2337
|
+
...props,
|
|
2338
|
+
ref: composedRefs
|
|
2339
|
+
});
|
|
2340
|
+
});
|
|
2341
|
+
DismissableLayerBranch.displayName = BRANCH_NAME;
|
|
2342
|
+
function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) {
|
|
2343
|
+
const handlePointerDownOutside = useCallbackRef$1(onPointerDownOutside);
|
|
2344
|
+
const isPointerInsideReactTreeRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(false);
|
|
2345
|
+
const handleClickRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(() => {});
|
|
2346
|
+
react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {
|
|
2347
|
+
const handlePointerDown = (event) => {
|
|
2348
|
+
if (event.target && !isPointerInsideReactTreeRef.current) {
|
|
2349
|
+
let handleAndDispatchPointerDownOutsideEvent2 = function() {
|
|
2350
|
+
handleAndDispatchCustomEvent(POINTER_DOWN_OUTSIDE, handlePointerDownOutside, eventDetail, { discrete: true });
|
|
2351
|
+
};
|
|
2352
|
+
const eventDetail = { originalEvent: event };
|
|
2353
|
+
if (event.pointerType === "touch") {
|
|
2354
|
+
ownerDocument.removeEventListener("click", handleClickRef.current);
|
|
2355
|
+
handleClickRef.current = handleAndDispatchPointerDownOutsideEvent2;
|
|
2356
|
+
ownerDocument.addEventListener("click", handleClickRef.current, { once: true });
|
|
2357
|
+
} else handleAndDispatchPointerDownOutsideEvent2();
|
|
2358
|
+
} else ownerDocument.removeEventListener("click", handleClickRef.current);
|
|
2359
|
+
isPointerInsideReactTreeRef.current = false;
|
|
2360
|
+
};
|
|
2361
|
+
const timerId = window.setTimeout(() => {
|
|
2362
|
+
ownerDocument.addEventListener("pointerdown", handlePointerDown);
|
|
2363
|
+
}, 0);
|
|
2364
|
+
return () => {
|
|
2365
|
+
window.clearTimeout(timerId);
|
|
2366
|
+
ownerDocument.removeEventListener("pointerdown", handlePointerDown);
|
|
2367
|
+
ownerDocument.removeEventListener("click", handleClickRef.current);
|
|
2368
|
+
};
|
|
2369
|
+
}, [ownerDocument, handlePointerDownOutside]);
|
|
2370
|
+
return { onPointerDownCapture: () => isPointerInsideReactTreeRef.current = true };
|
|
2371
|
+
}
|
|
2372
|
+
function useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {
|
|
2373
|
+
const handleFocusOutside = useCallbackRef$1(onFocusOutside);
|
|
2374
|
+
const isFocusInsideReactTreeRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(false);
|
|
2375
|
+
react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {
|
|
2376
|
+
const handleFocus = (event) => {
|
|
2377
|
+
if (event.target && !isFocusInsideReactTreeRef.current) handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, { originalEvent: event }, { discrete: false });
|
|
2378
|
+
};
|
|
2379
|
+
ownerDocument.addEventListener("focusin", handleFocus);
|
|
2380
|
+
return () => ownerDocument.removeEventListener("focusin", handleFocus);
|
|
2381
|
+
}, [ownerDocument, handleFocusOutside]);
|
|
2382
|
+
return {
|
|
2383
|
+
onFocusCapture: () => isFocusInsideReactTreeRef.current = true,
|
|
2384
|
+
onBlurCapture: () => isFocusInsideReactTreeRef.current = false
|
|
2385
|
+
};
|
|
2386
|
+
}
|
|
2387
|
+
function dispatchUpdate() {
|
|
2388
|
+
const event = new CustomEvent(CONTEXT_UPDATE);
|
|
2389
|
+
document.dispatchEvent(event);
|
|
2390
|
+
}
|
|
2391
|
+
function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
|
|
2392
|
+
const target = detail.originalEvent.target;
|
|
2393
|
+
const event = new CustomEvent(name, {
|
|
2394
|
+
bubbles: false,
|
|
2395
|
+
cancelable: true,
|
|
2396
|
+
detail
|
|
2397
|
+
});
|
|
2398
|
+
if (handler) target.addEventListener(name, handler, { once: true });
|
|
2399
|
+
if (discrete) dispatchDiscreteCustomEvent(target, event);
|
|
2400
|
+
else target.dispatchEvent(event);
|
|
2401
|
+
}
|
|
2402
|
+
var AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount";
|
|
2403
|
+
var AUTOFOCUS_ON_UNMOUNT = "focusScope.autoFocusOnUnmount";
|
|
2404
|
+
var EVENT_OPTIONS = {
|
|
2405
|
+
bubbles: false,
|
|
2406
|
+
cancelable: true
|
|
2407
|
+
};
|
|
2408
|
+
var FOCUS_SCOPE_NAME = "FocusScope";
|
|
2409
|
+
var FocusScope = react__WEBPACK_IMPORTED_MODULE_0__.forwardRef((props, forwardedRef) => {
|
|
2410
|
+
const { loop = false, trapped = false, onMountAutoFocus: onMountAutoFocusProp, onUnmountAutoFocus: onUnmountAutoFocusProp, ...scopeProps } = props;
|
|
2411
|
+
const [container, setContainer] = react__WEBPACK_IMPORTED_MODULE_0__.useState(null);
|
|
2412
|
+
const onMountAutoFocus = useCallbackRef$1(onMountAutoFocusProp);
|
|
2413
|
+
const onUnmountAutoFocus = useCallbackRef$1(onUnmountAutoFocusProp);
|
|
2414
|
+
const lastFocusedElementRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(null);
|
|
2415
|
+
const composedRefs = useComposedRefs(forwardedRef, (node) => setContainer(node));
|
|
2416
|
+
const focusScope = react__WEBPACK_IMPORTED_MODULE_0__.useRef({
|
|
2417
|
+
paused: false,
|
|
2418
|
+
pause() {
|
|
2419
|
+
this.paused = true;
|
|
2420
|
+
},
|
|
2421
|
+
resume() {
|
|
2422
|
+
this.paused = false;
|
|
2423
|
+
}
|
|
2424
|
+
}).current;
|
|
2425
|
+
react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {
|
|
2426
|
+
if (trapped) {
|
|
2427
|
+
let handleFocusIn2 = function(event) {
|
|
2428
|
+
if (focusScope.paused || !container) return;
|
|
2429
|
+
const target = event.target;
|
|
2430
|
+
if (container.contains(target)) lastFocusedElementRef.current = target;
|
|
2431
|
+
else focus(lastFocusedElementRef.current, { select: true });
|
|
2432
|
+
}, handleFocusOut2 = function(event) {
|
|
2433
|
+
if (focusScope.paused || !container) return;
|
|
2434
|
+
const relatedTarget = event.relatedTarget;
|
|
2435
|
+
if (relatedTarget === null) return;
|
|
2436
|
+
if (!container.contains(relatedTarget)) focus(lastFocusedElementRef.current, { select: true });
|
|
2437
|
+
}, handleMutations2 = function(mutations) {
|
|
2438
|
+
if (document.activeElement !== document.body) return;
|
|
2439
|
+
for (const mutation of mutations) if (mutation.removedNodes.length > 0) focus(container);
|
|
2440
|
+
};
|
|
2441
|
+
document.addEventListener("focusin", handleFocusIn2);
|
|
2442
|
+
document.addEventListener("focusout", handleFocusOut2);
|
|
2443
|
+
const mutationObserver = new MutationObserver(handleMutations2);
|
|
2444
|
+
if (container) mutationObserver.observe(container, {
|
|
2445
|
+
childList: true,
|
|
2446
|
+
subtree: true
|
|
2447
|
+
});
|
|
2448
|
+
return () => {
|
|
2449
|
+
document.removeEventListener("focusin", handleFocusIn2);
|
|
2450
|
+
document.removeEventListener("focusout", handleFocusOut2);
|
|
2451
|
+
mutationObserver.disconnect();
|
|
2452
|
+
};
|
|
2453
|
+
}
|
|
2454
|
+
}, [
|
|
2455
|
+
trapped,
|
|
2456
|
+
container,
|
|
2457
|
+
focusScope.paused
|
|
2458
|
+
]);
|
|
2459
|
+
react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {
|
|
2460
|
+
if (container) {
|
|
2461
|
+
focusScopesStack.add(focusScope);
|
|
2462
|
+
const previouslyFocusedElement = document.activeElement;
|
|
2463
|
+
if (!container.contains(previouslyFocusedElement)) {
|
|
2464
|
+
const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS);
|
|
2465
|
+
container.addEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
|
|
2466
|
+
container.dispatchEvent(mountEvent);
|
|
2467
|
+
if (!mountEvent.defaultPrevented) {
|
|
2468
|
+
focusFirst(removeLinks(getTabbableCandidates(container)), { select: true });
|
|
2469
|
+
if (document.activeElement === previouslyFocusedElement) focus(container);
|
|
2470
|
+
}
|
|
2471
|
+
}
|
|
2472
|
+
return () => {
|
|
2473
|
+
container.removeEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
|
|
2474
|
+
setTimeout(() => {
|
|
2475
|
+
const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS);
|
|
2476
|
+
container.addEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
|
|
2477
|
+
container.dispatchEvent(unmountEvent);
|
|
2478
|
+
if (!unmountEvent.defaultPrevented) focus(previouslyFocusedElement ?? document.body, { select: true });
|
|
2479
|
+
container.removeEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
|
|
2480
|
+
focusScopesStack.remove(focusScope);
|
|
2481
|
+
}, 0);
|
|
2482
|
+
};
|
|
2483
|
+
}
|
|
2484
|
+
}, [
|
|
2485
|
+
container,
|
|
2486
|
+
onMountAutoFocus,
|
|
2487
|
+
onUnmountAutoFocus,
|
|
2488
|
+
focusScope
|
|
2489
|
+
]);
|
|
2490
|
+
const handleKeyDown = react__WEBPACK_IMPORTED_MODULE_0__.useCallback((event) => {
|
|
2491
|
+
if (!loop && !trapped) return;
|
|
2492
|
+
if (focusScope.paused) return;
|
|
2493
|
+
const isTabKey = event.key === "Tab" && !event.altKey && !event.ctrlKey && !event.metaKey;
|
|
2494
|
+
const focusedElement = document.activeElement;
|
|
2495
|
+
if (isTabKey && focusedElement) {
|
|
2496
|
+
const container2 = event.currentTarget;
|
|
2497
|
+
const [first, last] = getTabbableEdges(container2);
|
|
2498
|
+
if (!(first && last)) {
|
|
2499
|
+
if (focusedElement === container2) event.preventDefault();
|
|
2500
|
+
} else if (!event.shiftKey && focusedElement === last) {
|
|
2501
|
+
event.preventDefault();
|
|
2502
|
+
if (loop) focus(first, { select: true });
|
|
2503
|
+
} else if (event.shiftKey && focusedElement === first) {
|
|
2504
|
+
event.preventDefault();
|
|
2505
|
+
if (loop) focus(last, { select: true });
|
|
2506
|
+
}
|
|
2507
|
+
}
|
|
2508
|
+
}, [
|
|
2509
|
+
loop,
|
|
2510
|
+
trapped,
|
|
2511
|
+
focusScope.paused
|
|
2512
|
+
]);
|
|
2513
|
+
return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(Primitive.div, {
|
|
2514
|
+
tabIndex: -1,
|
|
2515
|
+
...scopeProps,
|
|
2516
|
+
ref: composedRefs,
|
|
2517
|
+
onKeyDown: handleKeyDown
|
|
2518
|
+
});
|
|
2519
|
+
});
|
|
2520
|
+
FocusScope.displayName = FOCUS_SCOPE_NAME;
|
|
2521
|
+
function focusFirst(candidates, { select = false } = {}) {
|
|
2522
|
+
const previouslyFocusedElement = document.activeElement;
|
|
2523
|
+
for (const candidate of candidates) {
|
|
2524
|
+
focus(candidate, { select });
|
|
2525
|
+
if (document.activeElement !== previouslyFocusedElement) return;
|
|
2526
|
+
}
|
|
2527
|
+
}
|
|
2528
|
+
function getTabbableEdges(container) {
|
|
2529
|
+
const candidates = getTabbableCandidates(container);
|
|
2530
|
+
return [findVisible(candidates, container), findVisible(candidates.reverse(), container)];
|
|
2531
|
+
}
|
|
2532
|
+
function getTabbableCandidates(container) {
|
|
2533
|
+
const nodes = [];
|
|
2534
|
+
const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, { acceptNode: (node) => {
|
|
2535
|
+
const isHiddenInput = node.tagName === "INPUT" && node.type === "hidden";
|
|
2536
|
+
if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP;
|
|
2537
|
+
return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
2538
|
+
} });
|
|
2539
|
+
while (walker.nextNode()) nodes.push(walker.currentNode);
|
|
2540
|
+
return nodes;
|
|
2541
|
+
}
|
|
2542
|
+
function findVisible(elements, container) {
|
|
2543
|
+
for (const element of elements) if (!isHidden(element, { upTo: container })) return element;
|
|
2544
|
+
}
|
|
2545
|
+
function isHidden(node, { upTo }) {
|
|
2546
|
+
if (getComputedStyle(node).visibility === "hidden") return true;
|
|
2547
|
+
while (node) {
|
|
2548
|
+
if (upTo !== void 0 && node === upTo) return false;
|
|
2549
|
+
if (getComputedStyle(node).display === "none") return true;
|
|
2550
|
+
node = node.parentElement;
|
|
2551
|
+
}
|
|
2552
|
+
return false;
|
|
2553
|
+
}
|
|
2554
|
+
function isSelectableInput(element) {
|
|
2555
|
+
return element instanceof HTMLInputElement && "select" in element;
|
|
2556
|
+
}
|
|
2557
|
+
function focus(element, { select = false } = {}) {
|
|
2558
|
+
if (element && element.focus) {
|
|
2559
|
+
const previouslyFocusedElement = document.activeElement;
|
|
2560
|
+
element.focus({ preventScroll: true });
|
|
2561
|
+
if (element !== previouslyFocusedElement && isSelectableInput(element) && select) element.select();
|
|
2562
|
+
}
|
|
2563
|
+
}
|
|
2564
|
+
var focusScopesStack = createFocusScopesStack();
|
|
2565
|
+
function createFocusScopesStack() {
|
|
2566
|
+
let stack = [];
|
|
2567
|
+
return {
|
|
2568
|
+
add(focusScope) {
|
|
2569
|
+
const activeFocusScope = stack[0];
|
|
2570
|
+
if (focusScope !== activeFocusScope) activeFocusScope?.pause();
|
|
2571
|
+
stack = arrayRemove(stack, focusScope);
|
|
2572
|
+
stack.unshift(focusScope);
|
|
2573
|
+
},
|
|
2574
|
+
remove(focusScope) {
|
|
2575
|
+
stack = arrayRemove(stack, focusScope);
|
|
2576
|
+
stack[0]?.resume();
|
|
2577
|
+
}
|
|
2578
|
+
};
|
|
2579
|
+
}
|
|
2580
|
+
function arrayRemove(array, item) {
|
|
2581
|
+
const updatedArray = [...array];
|
|
2582
|
+
const index = updatedArray.indexOf(item);
|
|
2583
|
+
if (index !== -1) updatedArray.splice(index, 1);
|
|
2584
|
+
return updatedArray;
|
|
2585
|
+
}
|
|
2586
|
+
function removeLinks(items) {
|
|
2587
|
+
return items.filter((item) => item.tagName !== "A");
|
|
2588
|
+
}
|
|
2589
|
+
var PORTAL_NAME$1 = "Portal";
|
|
2590
|
+
var Portal = react__WEBPACK_IMPORTED_MODULE_0__.forwardRef((props, forwardedRef) => {
|
|
2591
|
+
const { container: containerProp, ...portalProps } = props;
|
|
2592
|
+
const [mounted, setMounted] = react__WEBPACK_IMPORTED_MODULE_0__.useState(false);
|
|
2593
|
+
useLayoutEffect2(() => setMounted(true), []);
|
|
2594
|
+
const container = containerProp || mounted && globalThis?.document?.body;
|
|
2595
|
+
return container ? react_dom__WEBPACK_IMPORTED_MODULE_3__.createPortal(/* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(Primitive.div, {
|
|
2596
|
+
...portalProps,
|
|
2597
|
+
ref: forwardedRef
|
|
2598
|
+
}), container) : null;
|
|
2599
|
+
});
|
|
2600
|
+
Portal.displayName = PORTAL_NAME$1;
|
|
2601
|
+
function useStateMachine(initialState, machine) {
|
|
2602
|
+
return react__WEBPACK_IMPORTED_MODULE_0__.useReducer((state, event) => {
|
|
2603
|
+
return machine[state][event] ?? state;
|
|
2604
|
+
}, initialState);
|
|
2605
|
+
}
|
|
2606
|
+
var Presence = (props) => {
|
|
2607
|
+
const { present, children } = props;
|
|
2608
|
+
const presence = usePresence(present);
|
|
2609
|
+
const child = typeof children === "function" ? children({ present: presence.isPresent }) : react__WEBPACK_IMPORTED_MODULE_0__.Children.only(children);
|
|
2610
|
+
const ref = useComposedRefs(presence.ref, getElementRef(child));
|
|
2611
|
+
return typeof children === "function" || presence.isPresent ? react__WEBPACK_IMPORTED_MODULE_0__.cloneElement(child, { ref }) : null;
|
|
2612
|
+
};
|
|
2613
|
+
Presence.displayName = "Presence";
|
|
2614
|
+
function usePresence(present) {
|
|
2615
|
+
const [node, setNode] = react__WEBPACK_IMPORTED_MODULE_0__.useState();
|
|
2616
|
+
const stylesRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(null);
|
|
2617
|
+
const prevPresentRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(present);
|
|
2618
|
+
const prevAnimationNameRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef("none");
|
|
2619
|
+
const [state, send] = useStateMachine(present ? "mounted" : "unmounted", {
|
|
2620
|
+
mounted: {
|
|
2621
|
+
UNMOUNT: "unmounted",
|
|
2622
|
+
ANIMATION_OUT: "unmountSuspended"
|
|
2623
|
+
},
|
|
2624
|
+
unmountSuspended: {
|
|
2625
|
+
MOUNT: "mounted",
|
|
2626
|
+
ANIMATION_END: "unmounted"
|
|
2627
|
+
},
|
|
2628
|
+
unmounted: { MOUNT: "mounted" }
|
|
2629
|
+
});
|
|
2630
|
+
react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {
|
|
2631
|
+
const currentAnimationName = getAnimationName(stylesRef.current);
|
|
2632
|
+
prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
|
|
2633
|
+
}, [state]);
|
|
2634
|
+
useLayoutEffect2(() => {
|
|
2635
|
+
const styles = stylesRef.current;
|
|
2636
|
+
const wasPresent = prevPresentRef.current;
|
|
2637
|
+
if (wasPresent !== present) {
|
|
2638
|
+
const prevAnimationName = prevAnimationNameRef.current;
|
|
2639
|
+
const currentAnimationName = getAnimationName(styles);
|
|
2640
|
+
if (present) send("MOUNT");
|
|
2641
|
+
else if (currentAnimationName === "none" || styles?.display === "none") send("UNMOUNT");
|
|
2642
|
+
else if (wasPresent && prevAnimationName !== currentAnimationName) send("ANIMATION_OUT");
|
|
2643
|
+
else send("UNMOUNT");
|
|
2644
|
+
prevPresentRef.current = present;
|
|
2645
|
+
}
|
|
2646
|
+
}, [present, send]);
|
|
2647
|
+
useLayoutEffect2(() => {
|
|
2648
|
+
if (node) {
|
|
2649
|
+
let timeoutId;
|
|
2650
|
+
const ownerWindow = node.ownerDocument.defaultView ?? window;
|
|
2651
|
+
const handleAnimationEnd = (event) => {
|
|
2652
|
+
const isCurrentAnimation = getAnimationName(stylesRef.current).includes(CSS.escape(event.animationName));
|
|
2653
|
+
if (event.target === node && isCurrentAnimation) {
|
|
2654
|
+
send("ANIMATION_END");
|
|
2655
|
+
if (!prevPresentRef.current) {
|
|
2656
|
+
const currentFillMode = node.style.animationFillMode;
|
|
2657
|
+
node.style.animationFillMode = "forwards";
|
|
2658
|
+
timeoutId = ownerWindow.setTimeout(() => {
|
|
2659
|
+
if (node.style.animationFillMode === "forwards") node.style.animationFillMode = currentFillMode;
|
|
2660
|
+
});
|
|
2661
|
+
}
|
|
2662
|
+
}
|
|
2663
|
+
};
|
|
2664
|
+
const handleAnimationStart = (event) => {
|
|
2665
|
+
if (event.target === node) prevAnimationNameRef.current = getAnimationName(stylesRef.current);
|
|
2666
|
+
};
|
|
2667
|
+
node.addEventListener("animationstart", handleAnimationStart);
|
|
2668
|
+
node.addEventListener("animationcancel", handleAnimationEnd);
|
|
2669
|
+
node.addEventListener("animationend", handleAnimationEnd);
|
|
2670
|
+
return () => {
|
|
2671
|
+
ownerWindow.clearTimeout(timeoutId);
|
|
2672
|
+
node.removeEventListener("animationstart", handleAnimationStart);
|
|
2673
|
+
node.removeEventListener("animationcancel", handleAnimationEnd);
|
|
2674
|
+
node.removeEventListener("animationend", handleAnimationEnd);
|
|
2675
|
+
};
|
|
2676
|
+
} else send("ANIMATION_END");
|
|
2677
|
+
}, [node, send]);
|
|
2678
|
+
return {
|
|
2679
|
+
isPresent: ["mounted", "unmountSuspended"].includes(state),
|
|
2680
|
+
ref: react__WEBPACK_IMPORTED_MODULE_0__.useCallback((node2) => {
|
|
2681
|
+
stylesRef.current = node2 ? getComputedStyle(node2) : null;
|
|
2682
|
+
setNode(node2);
|
|
2683
|
+
}, [])
|
|
2684
|
+
};
|
|
2685
|
+
}
|
|
2686
|
+
function getAnimationName(styles) {
|
|
2687
|
+
return styles?.animationName || "none";
|
|
2688
|
+
}
|
|
2689
|
+
function getElementRef(element) {
|
|
2690
|
+
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
|
2691
|
+
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
2692
|
+
if (mayWarn) return element.ref;
|
|
2693
|
+
getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
|
|
2694
|
+
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
2695
|
+
if (mayWarn) return element.props.ref;
|
|
2696
|
+
return element.props.ref || element.ref;
|
|
2697
|
+
}
|
|
2698
|
+
var count = 0;
|
|
2699
|
+
function useFocusGuards() {
|
|
2700
|
+
react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {
|
|
2701
|
+
const edgeGuards = document.querySelectorAll("[data-radix-focus-guard]");
|
|
2702
|
+
document.body.insertAdjacentElement("afterbegin", edgeGuards[0] ?? createFocusGuard());
|
|
2703
|
+
document.body.insertAdjacentElement("beforeend", edgeGuards[1] ?? createFocusGuard());
|
|
2704
|
+
count++;
|
|
2705
|
+
return () => {
|
|
2706
|
+
if (count === 1) document.querySelectorAll("[data-radix-focus-guard]").forEach((node) => node.remove());
|
|
2707
|
+
count--;
|
|
2708
|
+
};
|
|
2709
|
+
}, []);
|
|
2710
|
+
}
|
|
2711
|
+
function createFocusGuard() {
|
|
2712
|
+
const element = document.createElement("span");
|
|
2713
|
+
element.setAttribute("data-radix-focus-guard", "");
|
|
2714
|
+
element.tabIndex = 0;
|
|
2715
|
+
element.style.outline = "none";
|
|
2716
|
+
element.style.opacity = "0";
|
|
2717
|
+
element.style.position = "fixed";
|
|
2718
|
+
element.style.pointerEvents = "none";
|
|
2719
|
+
return element;
|
|
2720
|
+
}
|
|
2721
|
+
var __assign = function() {
|
|
2722
|
+
__assign = Object.assign || function __assign$1(t) {
|
|
2723
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
2724
|
+
s = arguments[i];
|
|
2725
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
2726
|
+
}
|
|
2727
|
+
return t;
|
|
2728
|
+
};
|
|
2729
|
+
return __assign.apply(this, arguments);
|
|
2730
|
+
};
|
|
2731
|
+
function __rest(s, e) {
|
|
2732
|
+
var t = {};
|
|
2733
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
2734
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") {
|
|
2735
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
2736
|
+
}
|
|
2737
|
+
return t;
|
|
2738
|
+
}
|
|
2739
|
+
function __spreadArray(to, from, pack) {
|
|
2740
|
+
if (pack || arguments.length === 2) {
|
|
2741
|
+
for (var i = 0, l = from.length, ar; i < l; i++) if (ar || !(i in from)) {
|
|
2742
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
2743
|
+
ar[i] = from[i];
|
|
2744
|
+
}
|
|
2745
|
+
}
|
|
2746
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
2747
|
+
}
|
|
2748
|
+
var zeroRightClassName = "right-scroll-bar-position";
|
|
2749
|
+
var fullWidthClassName = "width-before-scroll-bar";
|
|
2750
|
+
var noScrollbarsClassName = "with-scroll-bars-hidden";
|
|
2751
|
+
var removedBarSizeVariable = "--removed-body-scroll-bar-size";
|
|
2752
|
+
function assignRef(ref, value) {
|
|
2753
|
+
if (typeof ref === "function") ref(value);
|
|
2754
|
+
else if (ref) ref.current = value;
|
|
2755
|
+
return ref;
|
|
2756
|
+
}
|
|
2757
|
+
function useCallbackRef(initialValue, callback) {
|
|
2758
|
+
var ref = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(function() {
|
|
2759
|
+
return {
|
|
2760
|
+
value: initialValue,
|
|
2761
|
+
callback,
|
|
2762
|
+
facade: {
|
|
2763
|
+
get current() {
|
|
2764
|
+
return ref.value;
|
|
2765
|
+
},
|
|
2766
|
+
set current(value) {
|
|
2767
|
+
var last = ref.value;
|
|
2768
|
+
if (last !== value) {
|
|
2769
|
+
ref.value = value;
|
|
2770
|
+
ref.callback(value, last);
|
|
2771
|
+
}
|
|
2772
|
+
}
|
|
2773
|
+
}
|
|
2774
|
+
};
|
|
2775
|
+
})[0];
|
|
2776
|
+
ref.callback = callback;
|
|
2777
|
+
return ref.facade;
|
|
2778
|
+
}
|
|
2779
|
+
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect : react__WEBPACK_IMPORTED_MODULE_0__.useEffect;
|
|
2780
|
+
var currentValues = /* @__PURE__ */ new WeakMap();
|
|
2781
|
+
function useMergeRefs(refs, defaultValue) {
|
|
2782
|
+
var callbackRef = useCallbackRef(defaultValue || null, function(newValue) {
|
|
2783
|
+
return refs.forEach(function(ref) {
|
|
2784
|
+
return assignRef(ref, newValue);
|
|
2785
|
+
});
|
|
2786
|
+
});
|
|
2787
|
+
useIsomorphicLayoutEffect(function() {
|
|
2788
|
+
var oldValue = currentValues.get(callbackRef);
|
|
2789
|
+
if (oldValue) {
|
|
2790
|
+
var prevRefs_1 = new Set(oldValue);
|
|
2791
|
+
var nextRefs_1 = new Set(refs);
|
|
2792
|
+
var current_1 = callbackRef.current;
|
|
2793
|
+
prevRefs_1.forEach(function(ref) {
|
|
2794
|
+
if (!nextRefs_1.has(ref)) assignRef(ref, null);
|
|
2795
|
+
});
|
|
2796
|
+
nextRefs_1.forEach(function(ref) {
|
|
2797
|
+
if (!prevRefs_1.has(ref)) assignRef(ref, current_1);
|
|
2798
|
+
});
|
|
2799
|
+
}
|
|
2800
|
+
currentValues.set(callbackRef, refs);
|
|
2801
|
+
}, [refs]);
|
|
2802
|
+
return callbackRef;
|
|
2803
|
+
}
|
|
2804
|
+
function ItoI(a) {
|
|
2805
|
+
return a;
|
|
2806
|
+
}
|
|
2807
|
+
function innerCreateMedium(defaults, middleware) {
|
|
2808
|
+
if (middleware === void 0) middleware = ItoI;
|
|
2809
|
+
var buffer = [];
|
|
2810
|
+
var assigned = false;
|
|
2811
|
+
return {
|
|
2812
|
+
read: function() {
|
|
2813
|
+
if (assigned) throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
|
|
2814
|
+
if (buffer.length) return buffer[buffer.length - 1];
|
|
2815
|
+
return defaults;
|
|
2816
|
+
},
|
|
2817
|
+
useMedium: function(data) {
|
|
2818
|
+
var item = middleware(data, assigned);
|
|
2819
|
+
buffer.push(item);
|
|
2820
|
+
return function() {
|
|
2821
|
+
buffer = buffer.filter(function(x) {
|
|
2822
|
+
return x !== item;
|
|
2823
|
+
});
|
|
2824
|
+
};
|
|
2825
|
+
},
|
|
2826
|
+
assignSyncMedium: function(cb) {
|
|
2827
|
+
assigned = true;
|
|
2828
|
+
while (buffer.length) {
|
|
2829
|
+
var cbs = buffer;
|
|
2830
|
+
buffer = [];
|
|
2831
|
+
cbs.forEach(cb);
|
|
2832
|
+
}
|
|
2833
|
+
buffer = {
|
|
2834
|
+
push: function(x) {
|
|
2835
|
+
return cb(x);
|
|
2836
|
+
},
|
|
2837
|
+
filter: function() {
|
|
2838
|
+
return buffer;
|
|
2839
|
+
}
|
|
2840
|
+
};
|
|
2841
|
+
},
|
|
2842
|
+
assignMedium: function(cb) {
|
|
2843
|
+
assigned = true;
|
|
2844
|
+
var pendingQueue = [];
|
|
2845
|
+
if (buffer.length) {
|
|
2846
|
+
var cbs = buffer;
|
|
2847
|
+
buffer = [];
|
|
2848
|
+
cbs.forEach(cb);
|
|
2849
|
+
pendingQueue = buffer;
|
|
2850
|
+
}
|
|
2851
|
+
var executeQueue = function() {
|
|
2852
|
+
var cbs$1 = pendingQueue;
|
|
2853
|
+
pendingQueue = [];
|
|
2854
|
+
cbs$1.forEach(cb);
|
|
2855
|
+
};
|
|
2856
|
+
var cycle = function() {
|
|
2857
|
+
return Promise.resolve().then(executeQueue);
|
|
2858
|
+
};
|
|
2859
|
+
cycle();
|
|
2860
|
+
buffer = {
|
|
2861
|
+
push: function(x) {
|
|
2862
|
+
pendingQueue.push(x);
|
|
2863
|
+
cycle();
|
|
2864
|
+
},
|
|
2865
|
+
filter: function(filter) {
|
|
2866
|
+
pendingQueue = pendingQueue.filter(filter);
|
|
2867
|
+
return buffer;
|
|
2868
|
+
}
|
|
2869
|
+
};
|
|
2870
|
+
}
|
|
2871
|
+
};
|
|
2872
|
+
}
|
|
2873
|
+
function createSidecarMedium(options$1) {
|
|
2874
|
+
if (options$1 === void 0) options$1 = {};
|
|
2875
|
+
var medium = innerCreateMedium(null);
|
|
2876
|
+
medium.options = __assign({
|
|
2877
|
+
async: true,
|
|
2878
|
+
ssr: false
|
|
2879
|
+
}, options$1);
|
|
2880
|
+
return medium;
|
|
2881
|
+
}
|
|
2882
|
+
var SideCar = function(_a) {
|
|
2883
|
+
var sideCar = _a.sideCar, rest = __rest(_a, ["sideCar"]);
|
|
2884
|
+
if (!sideCar) throw new Error("Sidecar: please provide `sideCar` property to import the right car");
|
|
2885
|
+
var Target = sideCar.read();
|
|
2886
|
+
if (!Target) throw new Error("Sidecar medium not found");
|
|
2887
|
+
return react__WEBPACK_IMPORTED_MODULE_0__.createElement(Target, __assign({}, rest));
|
|
2888
|
+
};
|
|
2889
|
+
SideCar.isSideCarExport = true;
|
|
2890
|
+
function exportSidecar(medium, exported) {
|
|
2891
|
+
medium.useMedium(exported);
|
|
2892
|
+
return SideCar;
|
|
2893
|
+
}
|
|
2894
|
+
var effectCar = createSidecarMedium();
|
|
2895
|
+
var nothing = function() {};
|
|
2896
|
+
var RemoveScroll = react__WEBPACK_IMPORTED_MODULE_0__.forwardRef(function(props, parentRef) {
|
|
2897
|
+
var ref = react__WEBPACK_IMPORTED_MODULE_0__.useRef(null);
|
|
2898
|
+
var _a = react__WEBPACK_IMPORTED_MODULE_0__.useState({
|
|
2899
|
+
onScrollCapture: nothing,
|
|
2900
|
+
onWheelCapture: nothing,
|
|
2901
|
+
onTouchMoveCapture: nothing
|
|
2902
|
+
}), callbacks = _a[0], setCallbacks = _a[1];
|
|
2903
|
+
var forwardProps = props.forwardProps, children = props.children, className = props.className, removeScrollBar = props.removeScrollBar, enabled = props.enabled, shards = props.shards, sideCar = props.sideCar, noRelative = props.noRelative, noIsolation = props.noIsolation, inert = props.inert, allowPinchZoom = props.allowPinchZoom, _b = props.as, Container = _b === void 0 ? "div" : _b, gapMode = props.gapMode, rest = __rest(props, [
|
|
2904
|
+
"forwardProps",
|
|
2905
|
+
"children",
|
|
2906
|
+
"className",
|
|
2907
|
+
"removeScrollBar",
|
|
2908
|
+
"enabled",
|
|
2909
|
+
"shards",
|
|
2910
|
+
"sideCar",
|
|
2911
|
+
"noRelative",
|
|
2912
|
+
"noIsolation",
|
|
2913
|
+
"inert",
|
|
2914
|
+
"allowPinchZoom",
|
|
2915
|
+
"as",
|
|
2916
|
+
"gapMode"
|
|
2917
|
+
]);
|
|
2918
|
+
var SideCar$1 = sideCar;
|
|
2919
|
+
var containerRef = useMergeRefs([ref, parentRef]);
|
|
2920
|
+
var containerProps = __assign(__assign({}, rest), callbacks);
|
|
2921
|
+
return react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, enabled && react__WEBPACK_IMPORTED_MODULE_0__.createElement(SideCar$1, {
|
|
2922
|
+
sideCar: effectCar,
|
|
2923
|
+
removeScrollBar,
|
|
2924
|
+
shards,
|
|
2925
|
+
noRelative,
|
|
2926
|
+
noIsolation,
|
|
2927
|
+
inert,
|
|
2928
|
+
setCallbacks,
|
|
2929
|
+
allowPinchZoom: !!allowPinchZoom,
|
|
2930
|
+
lockRef: ref,
|
|
2931
|
+
gapMode
|
|
2932
|
+
}), forwardProps ? react__WEBPACK_IMPORTED_MODULE_0__.cloneElement(react__WEBPACK_IMPORTED_MODULE_0__.Children.only(children), __assign(__assign({}, containerProps), { ref: containerRef })) : react__WEBPACK_IMPORTED_MODULE_0__.createElement(Container, __assign({}, containerProps, {
|
|
2933
|
+
className,
|
|
2934
|
+
ref: containerRef
|
|
2935
|
+
}), children));
|
|
2936
|
+
});
|
|
2937
|
+
RemoveScroll.defaultProps = {
|
|
2938
|
+
enabled: true,
|
|
2939
|
+
removeScrollBar: true,
|
|
2940
|
+
inert: false
|
|
2941
|
+
};
|
|
2942
|
+
RemoveScroll.classNames = {
|
|
2943
|
+
fullWidth: fullWidthClassName,
|
|
2944
|
+
zeroRight: zeroRightClassName
|
|
2945
|
+
};
|
|
2946
|
+
var currentNonce;
|
|
2947
|
+
var getNonce = function() {
|
|
2948
|
+
if (currentNonce) return currentNonce;
|
|
2949
|
+
if (true) return __webpack_require__.nc;
|
|
2950
|
+
};
|
|
2951
|
+
function makeStyleTag() {
|
|
2952
|
+
if (!document) return null;
|
|
2953
|
+
var tag = document.createElement("style");
|
|
2954
|
+
tag.type = "text/css";
|
|
2955
|
+
var nonce = getNonce();
|
|
2956
|
+
if (nonce) tag.setAttribute("nonce", nonce);
|
|
2957
|
+
return tag;
|
|
2958
|
+
}
|
|
2959
|
+
function injectStyles(tag, css) {
|
|
2960
|
+
if (tag.styleSheet) tag.styleSheet.cssText = css;
|
|
2961
|
+
else tag.appendChild(document.createTextNode(css));
|
|
2962
|
+
}
|
|
2963
|
+
function insertStyleTag(tag) {
|
|
2964
|
+
(document.head || document.getElementsByTagName("head")[0]).appendChild(tag);
|
|
2965
|
+
}
|
|
2966
|
+
var stylesheetSingleton = function() {
|
|
2967
|
+
var counter = 0;
|
|
2968
|
+
var stylesheet = null;
|
|
2969
|
+
return {
|
|
2970
|
+
add: function(style) {
|
|
2971
|
+
if (counter == 0) {
|
|
2972
|
+
if (stylesheet = makeStyleTag()) {
|
|
2973
|
+
injectStyles(stylesheet, style);
|
|
2974
|
+
insertStyleTag(stylesheet);
|
|
2975
|
+
}
|
|
2976
|
+
}
|
|
2977
|
+
counter++;
|
|
2978
|
+
},
|
|
2979
|
+
remove: function() {
|
|
2980
|
+
counter--;
|
|
2981
|
+
if (!counter && stylesheet) {
|
|
2982
|
+
stylesheet.parentNode && stylesheet.parentNode.removeChild(stylesheet);
|
|
2983
|
+
stylesheet = null;
|
|
2984
|
+
}
|
|
2985
|
+
}
|
|
2986
|
+
};
|
|
2987
|
+
};
|
|
2988
|
+
var styleHookSingleton = function() {
|
|
2989
|
+
var sheet = stylesheetSingleton();
|
|
2990
|
+
return function(styles, isDynamic) {
|
|
2991
|
+
react__WEBPACK_IMPORTED_MODULE_0__.useEffect(function() {
|
|
2992
|
+
sheet.add(styles);
|
|
2993
|
+
return function() {
|
|
2994
|
+
sheet.remove();
|
|
2995
|
+
};
|
|
2996
|
+
}, [styles && isDynamic]);
|
|
2997
|
+
};
|
|
2998
|
+
};
|
|
2999
|
+
var styleSingleton = function() {
|
|
3000
|
+
var useStyle = styleHookSingleton();
|
|
3001
|
+
var Sheet = function(_a) {
|
|
3002
|
+
var styles = _a.styles, dynamic = _a.dynamic;
|
|
3003
|
+
useStyle(styles, dynamic);
|
|
3004
|
+
return null;
|
|
3005
|
+
};
|
|
3006
|
+
return Sheet;
|
|
3007
|
+
};
|
|
3008
|
+
var zeroGap = {
|
|
3009
|
+
left: 0,
|
|
3010
|
+
top: 0,
|
|
3011
|
+
right: 0,
|
|
3012
|
+
gap: 0
|
|
3013
|
+
};
|
|
3014
|
+
var parse = function(x) {
|
|
3015
|
+
return parseInt(x || "", 10) || 0;
|
|
3016
|
+
};
|
|
3017
|
+
var getOffset = function(gapMode) {
|
|
3018
|
+
var cs = window.getComputedStyle(document.body);
|
|
3019
|
+
var left = cs[gapMode === "padding" ? "paddingLeft" : "marginLeft"];
|
|
3020
|
+
var top = cs[gapMode === "padding" ? "paddingTop" : "marginTop"];
|
|
3021
|
+
var right = cs[gapMode === "padding" ? "paddingRight" : "marginRight"];
|
|
3022
|
+
return [
|
|
3023
|
+
parse(left),
|
|
3024
|
+
parse(top),
|
|
3025
|
+
parse(right)
|
|
3026
|
+
];
|
|
3027
|
+
};
|
|
3028
|
+
var getGapWidth = function(gapMode) {
|
|
3029
|
+
if (gapMode === void 0) gapMode = "margin";
|
|
3030
|
+
if (typeof window === "undefined") return zeroGap;
|
|
3031
|
+
var offsets = getOffset(gapMode);
|
|
3032
|
+
var documentWidth = document.documentElement.clientWidth;
|
|
3033
|
+
var windowWidth = window.innerWidth;
|
|
3034
|
+
return {
|
|
3035
|
+
left: offsets[0],
|
|
3036
|
+
top: offsets[1],
|
|
3037
|
+
right: offsets[2],
|
|
3038
|
+
gap: Math.max(0, windowWidth - documentWidth + offsets[2] - offsets[0])
|
|
3039
|
+
};
|
|
3040
|
+
};
|
|
3041
|
+
var Style = styleSingleton();
|
|
3042
|
+
var lockAttribute = "data-scroll-locked";
|
|
3043
|
+
var getStyles = function(_a, allowRelative, gapMode, important) {
|
|
3044
|
+
var left = _a.left, top = _a.top, right = _a.right, gap = _a.gap;
|
|
3045
|
+
if (gapMode === void 0) gapMode = "margin";
|
|
3046
|
+
return "\n .".concat(noScrollbarsClassName, " {\n overflow: hidden ").concat(important, ";\n padding-right: ").concat(gap, "px ").concat(important, ";\n }\n body[").concat(lockAttribute, "] {\n overflow: hidden ").concat(important, ";\n overscroll-behavior: contain;\n ").concat([
|
|
3047
|
+
allowRelative && "position: relative ".concat(important, ";"),
|
|
3048
|
+
gapMode === "margin" && "\n padding-left: ".concat(left, "px;\n padding-top: ").concat(top, "px;\n padding-right: ").concat(right, "px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(gap, "px ").concat(important, ";\n "),
|
|
3049
|
+
gapMode === "padding" && "padding-right: ".concat(gap, "px ").concat(important, ";")
|
|
3050
|
+
].filter(Boolean).join(""), "\n }\n \n .").concat(zeroRightClassName, " {\n right: ").concat(gap, "px ").concat(important, ";\n }\n \n .").concat(fullWidthClassName, " {\n margin-right: ").concat(gap, "px ").concat(important, ";\n }\n \n .").concat(zeroRightClassName, " .").concat(zeroRightClassName, " {\n right: 0 ").concat(important, ";\n }\n \n .").concat(fullWidthClassName, " .").concat(fullWidthClassName, " {\n margin-right: 0 ").concat(important, ";\n }\n \n body[").concat(lockAttribute, "] {\n ").concat(removedBarSizeVariable, ": ").concat(gap, "px;\n }\n");
|
|
3051
|
+
};
|
|
3052
|
+
var getCurrentUseCounter = function() {
|
|
3053
|
+
var counter = parseInt(document.body.getAttribute("data-scroll-locked") || "0", 10);
|
|
3054
|
+
return isFinite(counter) ? counter : 0;
|
|
3055
|
+
};
|
|
3056
|
+
var useLockAttribute = function() {
|
|
3057
|
+
react__WEBPACK_IMPORTED_MODULE_0__.useEffect(function() {
|
|
3058
|
+
document.body.setAttribute(lockAttribute, (getCurrentUseCounter() + 1).toString());
|
|
3059
|
+
return function() {
|
|
3060
|
+
var newCounter = getCurrentUseCounter() - 1;
|
|
3061
|
+
if (newCounter <= 0) document.body.removeAttribute(lockAttribute);
|
|
3062
|
+
else document.body.setAttribute(lockAttribute, newCounter.toString());
|
|
3063
|
+
};
|
|
3064
|
+
}, []);
|
|
3065
|
+
};
|
|
3066
|
+
var RemoveScrollBar = function(_a) {
|
|
3067
|
+
var noRelative = _a.noRelative, noImportant = _a.noImportant, _b = _a.gapMode, gapMode = _b === void 0 ? "margin" : _b;
|
|
3068
|
+
useLockAttribute();
|
|
3069
|
+
var gap = react__WEBPACK_IMPORTED_MODULE_0__.useMemo(function() {
|
|
3070
|
+
return getGapWidth(gapMode);
|
|
3071
|
+
}, [gapMode]);
|
|
3072
|
+
return react__WEBPACK_IMPORTED_MODULE_0__.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? "!important" : "") });
|
|
3073
|
+
};
|
|
3074
|
+
var passiveSupported = false;
|
|
3075
|
+
if (typeof window !== "undefined") try {
|
|
3076
|
+
var options = Object.defineProperty({}, "passive", { get: function() {
|
|
3077
|
+
passiveSupported = true;
|
|
3078
|
+
return true;
|
|
3079
|
+
} });
|
|
3080
|
+
window.addEventListener("test", options, options);
|
|
3081
|
+
window.removeEventListener("test", options, options);
|
|
3082
|
+
} catch (err) {
|
|
3083
|
+
passiveSupported = false;
|
|
3084
|
+
}
|
|
3085
|
+
var nonPassive = passiveSupported ? { passive: false } : false;
|
|
3086
|
+
var alwaysContainsScroll = function(node) {
|
|
3087
|
+
return node.tagName === "TEXTAREA";
|
|
3088
|
+
};
|
|
3089
|
+
var elementCanBeScrolled = function(node, overflow) {
|
|
3090
|
+
if (!(node instanceof Element)) return false;
|
|
3091
|
+
var styles = window.getComputedStyle(node);
|
|
3092
|
+
return styles[overflow] !== "hidden" && !(styles.overflowY === styles.overflowX && !alwaysContainsScroll(node) && styles[overflow] === "visible");
|
|
3093
|
+
};
|
|
3094
|
+
var elementCouldBeVScrolled = function(node) {
|
|
3095
|
+
return elementCanBeScrolled(node, "overflowY");
|
|
3096
|
+
};
|
|
3097
|
+
var elementCouldBeHScrolled = function(node) {
|
|
3098
|
+
return elementCanBeScrolled(node, "overflowX");
|
|
3099
|
+
};
|
|
3100
|
+
var locationCouldBeScrolled = function(axis, node) {
|
|
3101
|
+
var ownerDocument = node.ownerDocument;
|
|
3102
|
+
var current = node;
|
|
3103
|
+
do {
|
|
3104
|
+
if (typeof ShadowRoot !== "undefined" && current instanceof ShadowRoot) current = current.host;
|
|
3105
|
+
if (elementCouldBeScrolled(axis, current)) {
|
|
3106
|
+
var _a = getScrollVariables(axis, current);
|
|
3107
|
+
if (_a[1] > _a[2]) return true;
|
|
3108
|
+
}
|
|
3109
|
+
current = current.parentNode;
|
|
3110
|
+
} while (current && current !== ownerDocument.body);
|
|
3111
|
+
return false;
|
|
3112
|
+
};
|
|
3113
|
+
var getVScrollVariables = function(_a) {
|
|
3114
|
+
return [
|
|
3115
|
+
_a.scrollTop,
|
|
3116
|
+
_a.scrollHeight,
|
|
3117
|
+
_a.clientHeight
|
|
3118
|
+
];
|
|
3119
|
+
};
|
|
3120
|
+
var getHScrollVariables = function(_a) {
|
|
3121
|
+
return [
|
|
3122
|
+
_a.scrollLeft,
|
|
3123
|
+
_a.scrollWidth,
|
|
3124
|
+
_a.clientWidth
|
|
3125
|
+
];
|
|
3126
|
+
};
|
|
3127
|
+
var elementCouldBeScrolled = function(axis, node) {
|
|
3128
|
+
return axis === "v" ? elementCouldBeVScrolled(node) : elementCouldBeHScrolled(node);
|
|
3129
|
+
};
|
|
3130
|
+
var getScrollVariables = function(axis, node) {
|
|
3131
|
+
return axis === "v" ? getVScrollVariables(node) : getHScrollVariables(node);
|
|
3132
|
+
};
|
|
3133
|
+
var getDirectionFactor = function(axis, direction) {
|
|
3134
|
+
return axis === "h" && direction === "rtl" ? -1 : 1;
|
|
3135
|
+
};
|
|
3136
|
+
var handleScroll = function(axis, endTarget, event, sourceDelta, noOverscroll) {
|
|
3137
|
+
var directionFactor = getDirectionFactor(axis, window.getComputedStyle(endTarget).direction);
|
|
3138
|
+
var delta = directionFactor * sourceDelta;
|
|
3139
|
+
var target = event.target;
|
|
3140
|
+
var targetInLock = endTarget.contains(target);
|
|
3141
|
+
var shouldCancelScroll = false;
|
|
3142
|
+
var isDeltaPositive = delta > 0;
|
|
3143
|
+
var availableScroll = 0;
|
|
3144
|
+
var availableScrollTop = 0;
|
|
3145
|
+
do {
|
|
3146
|
+
if (!target) break;
|
|
3147
|
+
var _a = getScrollVariables(axis, target), position = _a[0];
|
|
3148
|
+
var elementScroll = _a[1] - _a[2] - directionFactor * position;
|
|
3149
|
+
if (position || elementScroll) {
|
|
3150
|
+
if (elementCouldBeScrolled(axis, target)) {
|
|
3151
|
+
availableScroll += elementScroll;
|
|
3152
|
+
availableScrollTop += position;
|
|
3153
|
+
}
|
|
3154
|
+
}
|
|
3155
|
+
var parent_1 = target.parentNode;
|
|
3156
|
+
target = parent_1 && parent_1.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? parent_1.host : parent_1;
|
|
3157
|
+
} while (!targetInLock && target !== document.body || targetInLock && (endTarget.contains(target) || endTarget === target));
|
|
3158
|
+
if (isDeltaPositive && (noOverscroll && Math.abs(availableScroll) < 1 || !noOverscroll && delta > availableScroll)) shouldCancelScroll = true;
|
|
3159
|
+
else if (!isDeltaPositive && (noOverscroll && Math.abs(availableScrollTop) < 1 || !noOverscroll && -delta > availableScrollTop)) shouldCancelScroll = true;
|
|
3160
|
+
return shouldCancelScroll;
|
|
3161
|
+
};
|
|
3162
|
+
var getTouchXY = function(event) {
|
|
3163
|
+
return "changedTouches" in event ? [event.changedTouches[0].clientX, event.changedTouches[0].clientY] : [0, 0];
|
|
3164
|
+
};
|
|
3165
|
+
var getDeltaXY = function(event) {
|
|
3166
|
+
return [event.deltaX, event.deltaY];
|
|
3167
|
+
};
|
|
3168
|
+
var extractRef = function(ref) {
|
|
3169
|
+
return ref && "current" in ref ? ref.current : ref;
|
|
3170
|
+
};
|
|
3171
|
+
var deltaCompare = function(x, y) {
|
|
3172
|
+
return x[0] === y[0] && x[1] === y[1];
|
|
3173
|
+
};
|
|
3174
|
+
var generateStyle = function(id) {
|
|
3175
|
+
return "\n .block-interactivity-".concat(id, " {pointer-events: none;}\n .allow-interactivity-").concat(id, " {pointer-events: all;}\n");
|
|
3176
|
+
};
|
|
3177
|
+
var idCounter = 0;
|
|
3178
|
+
var lockStack = [];
|
|
3179
|
+
function RemoveScrollSideCar(props) {
|
|
3180
|
+
var shouldPreventQueue = react__WEBPACK_IMPORTED_MODULE_0__.useRef([]);
|
|
3181
|
+
var touchStartRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef([0, 0]);
|
|
3182
|
+
var activeAxis = react__WEBPACK_IMPORTED_MODULE_0__.useRef();
|
|
3183
|
+
var id = react__WEBPACK_IMPORTED_MODULE_0__.useState(idCounter++)[0];
|
|
3184
|
+
var Style$1 = react__WEBPACK_IMPORTED_MODULE_0__.useState(styleSingleton)[0];
|
|
3185
|
+
var lastProps = react__WEBPACK_IMPORTED_MODULE_0__.useRef(props);
|
|
3186
|
+
react__WEBPACK_IMPORTED_MODULE_0__.useEffect(function() {
|
|
3187
|
+
lastProps.current = props;
|
|
3188
|
+
}, [props]);
|
|
3189
|
+
react__WEBPACK_IMPORTED_MODULE_0__.useEffect(function() {
|
|
3190
|
+
if (props.inert) {
|
|
3191
|
+
document.body.classList.add("block-interactivity-".concat(id));
|
|
3192
|
+
var allow_1 = __spreadArray([props.lockRef.current], (props.shards || []).map(extractRef), true).filter(Boolean);
|
|
3193
|
+
allow_1.forEach(function(el) {
|
|
3194
|
+
return el.classList.add("allow-interactivity-".concat(id));
|
|
3195
|
+
});
|
|
3196
|
+
return function() {
|
|
3197
|
+
document.body.classList.remove("block-interactivity-".concat(id));
|
|
3198
|
+
allow_1.forEach(function(el) {
|
|
3199
|
+
return el.classList.remove("allow-interactivity-".concat(id));
|
|
3200
|
+
});
|
|
3201
|
+
};
|
|
3202
|
+
}
|
|
3203
|
+
}, [
|
|
3204
|
+
props.inert,
|
|
3205
|
+
props.lockRef.current,
|
|
3206
|
+
props.shards
|
|
3207
|
+
]);
|
|
3208
|
+
var shouldCancelEvent = react__WEBPACK_IMPORTED_MODULE_0__.useCallback(function(event, parent) {
|
|
3209
|
+
if ("touches" in event && event.touches.length === 2 || event.type === "wheel" && event.ctrlKey) return !lastProps.current.allowPinchZoom;
|
|
3210
|
+
var touch = getTouchXY(event);
|
|
3211
|
+
var touchStart = touchStartRef.current;
|
|
3212
|
+
var deltaX = "deltaX" in event ? event.deltaX : touchStart[0] - touch[0];
|
|
3213
|
+
var deltaY = "deltaY" in event ? event.deltaY : touchStart[1] - touch[1];
|
|
3214
|
+
var currentAxis;
|
|
3215
|
+
var target = event.target;
|
|
3216
|
+
var moveDirection = Math.abs(deltaX) > Math.abs(deltaY) ? "h" : "v";
|
|
3217
|
+
if ("touches" in event && moveDirection === "h" && target.type === "range") return false;
|
|
3218
|
+
var selection = window.getSelection();
|
|
3219
|
+
var anchorNode = selection && selection.anchorNode;
|
|
3220
|
+
if (anchorNode ? anchorNode === target || anchorNode.contains(target) : false) return false;
|
|
3221
|
+
var canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
|
|
3222
|
+
if (!canBeScrolledInMainDirection) return true;
|
|
3223
|
+
if (canBeScrolledInMainDirection) currentAxis = moveDirection;
|
|
3224
|
+
else {
|
|
3225
|
+
currentAxis = moveDirection === "v" ? "h" : "v";
|
|
3226
|
+
canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
|
|
3227
|
+
}
|
|
3228
|
+
if (!canBeScrolledInMainDirection) return false;
|
|
3229
|
+
if (!activeAxis.current && "changedTouches" in event && (deltaX || deltaY)) activeAxis.current = currentAxis;
|
|
3230
|
+
if (!currentAxis) return true;
|
|
3231
|
+
var cancelingAxis = activeAxis.current || currentAxis;
|
|
3232
|
+
return handleScroll(cancelingAxis, parent, event, cancelingAxis === "h" ? deltaX : deltaY, true);
|
|
3233
|
+
}, []);
|
|
3234
|
+
var shouldPrevent = react__WEBPACK_IMPORTED_MODULE_0__.useCallback(function(_event) {
|
|
3235
|
+
var event = _event;
|
|
3236
|
+
if (!lockStack.length || lockStack[lockStack.length - 1] !== Style$1) return;
|
|
3237
|
+
var delta = "deltaY" in event ? getDeltaXY(event) : getTouchXY(event);
|
|
3238
|
+
var sourceEvent = shouldPreventQueue.current.filter(function(e) {
|
|
3239
|
+
return e.name === event.type && (e.target === event.target || event.target === e.shadowParent) && deltaCompare(e.delta, delta);
|
|
3240
|
+
})[0];
|
|
3241
|
+
if (sourceEvent && sourceEvent.should) {
|
|
3242
|
+
if (event.cancelable) event.preventDefault();
|
|
3243
|
+
return;
|
|
3244
|
+
}
|
|
3245
|
+
if (!sourceEvent) {
|
|
3246
|
+
var shardNodes = (lastProps.current.shards || []).map(extractRef).filter(Boolean).filter(function(node) {
|
|
3247
|
+
return node.contains(event.target);
|
|
3248
|
+
});
|
|
3249
|
+
if (shardNodes.length > 0 ? shouldCancelEvent(event, shardNodes[0]) : !lastProps.current.noIsolation) {
|
|
3250
|
+
if (event.cancelable) event.preventDefault();
|
|
3251
|
+
}
|
|
3252
|
+
}
|
|
3253
|
+
}, []);
|
|
3254
|
+
var shouldCancel = react__WEBPACK_IMPORTED_MODULE_0__.useCallback(function(name, delta, target, should) {
|
|
3255
|
+
var event = {
|
|
3256
|
+
name,
|
|
3257
|
+
delta,
|
|
3258
|
+
target,
|
|
3259
|
+
should,
|
|
3260
|
+
shadowParent: getOutermostShadowParent(target)
|
|
3261
|
+
};
|
|
3262
|
+
shouldPreventQueue.current.push(event);
|
|
3263
|
+
setTimeout(function() {
|
|
3264
|
+
shouldPreventQueue.current = shouldPreventQueue.current.filter(function(e) {
|
|
3265
|
+
return e !== event;
|
|
3266
|
+
});
|
|
3267
|
+
}, 1);
|
|
3268
|
+
}, []);
|
|
3269
|
+
var scrollTouchStart = react__WEBPACK_IMPORTED_MODULE_0__.useCallback(function(event) {
|
|
3270
|
+
touchStartRef.current = getTouchXY(event);
|
|
3271
|
+
activeAxis.current = void 0;
|
|
3272
|
+
}, []);
|
|
3273
|
+
var scrollWheel = react__WEBPACK_IMPORTED_MODULE_0__.useCallback(function(event) {
|
|
3274
|
+
shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
|
3275
|
+
}, []);
|
|
3276
|
+
var scrollTouchMove = react__WEBPACK_IMPORTED_MODULE_0__.useCallback(function(event) {
|
|
3277
|
+
shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
|
3278
|
+
}, []);
|
|
3279
|
+
react__WEBPACK_IMPORTED_MODULE_0__.useEffect(function() {
|
|
3280
|
+
lockStack.push(Style$1);
|
|
3281
|
+
props.setCallbacks({
|
|
3282
|
+
onScrollCapture: scrollWheel,
|
|
3283
|
+
onWheelCapture: scrollWheel,
|
|
3284
|
+
onTouchMoveCapture: scrollTouchMove
|
|
3285
|
+
});
|
|
3286
|
+
document.addEventListener("wheel", shouldPrevent, nonPassive);
|
|
3287
|
+
document.addEventListener("touchmove", shouldPrevent, nonPassive);
|
|
3288
|
+
document.addEventListener("touchstart", scrollTouchStart, nonPassive);
|
|
3289
|
+
return function() {
|
|
3290
|
+
lockStack = lockStack.filter(function(inst) {
|
|
3291
|
+
return inst !== Style$1;
|
|
3292
|
+
});
|
|
3293
|
+
document.removeEventListener("wheel", shouldPrevent, nonPassive);
|
|
3294
|
+
document.removeEventListener("touchmove", shouldPrevent, nonPassive);
|
|
3295
|
+
document.removeEventListener("touchstart", scrollTouchStart, nonPassive);
|
|
3296
|
+
};
|
|
3297
|
+
}, []);
|
|
3298
|
+
var removeScrollBar = props.removeScrollBar, inert = props.inert;
|
|
3299
|
+
return react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, inert ? react__WEBPACK_IMPORTED_MODULE_0__.createElement(Style$1, { styles: generateStyle(id) }) : null, removeScrollBar ? react__WEBPACK_IMPORTED_MODULE_0__.createElement(RemoveScrollBar, {
|
|
3300
|
+
noRelative: props.noRelative,
|
|
3301
|
+
gapMode: props.gapMode
|
|
3302
|
+
}) : null);
|
|
3303
|
+
}
|
|
3304
|
+
function getOutermostShadowParent(node) {
|
|
3305
|
+
var shadowParent = null;
|
|
3306
|
+
while (node !== null) {
|
|
3307
|
+
if (node instanceof ShadowRoot) {
|
|
3308
|
+
shadowParent = node.host;
|
|
3309
|
+
node = node.host;
|
|
3310
|
+
}
|
|
3311
|
+
node = node.parentNode;
|
|
3312
|
+
}
|
|
3313
|
+
return shadowParent;
|
|
3314
|
+
}
|
|
3315
|
+
var sidecar_default = exportSidecar(effectCar, RemoveScrollSideCar);
|
|
3316
|
+
var ReactRemoveScroll = react__WEBPACK_IMPORTED_MODULE_0__.forwardRef(function(props, ref) {
|
|
3317
|
+
return react__WEBPACK_IMPORTED_MODULE_0__.createElement(RemoveScroll, __assign({}, props, {
|
|
3318
|
+
ref,
|
|
3319
|
+
sideCar: sidecar_default
|
|
3320
|
+
}));
|
|
3321
|
+
});
|
|
3322
|
+
ReactRemoveScroll.classNames = RemoveScroll.classNames;
|
|
3323
|
+
var Combination_default = ReactRemoveScroll;
|
|
3324
|
+
var getDefaultParent = function(originalTarget) {
|
|
3325
|
+
if (typeof document === "undefined") return null;
|
|
3326
|
+
return (Array.isArray(originalTarget) ? originalTarget[0] : originalTarget).ownerDocument.body;
|
|
3327
|
+
};
|
|
3328
|
+
var counterMap = /* @__PURE__ */ new WeakMap();
|
|
3329
|
+
var uncontrolledNodes = /* @__PURE__ */ new WeakMap();
|
|
3330
|
+
var markerMap = {};
|
|
3331
|
+
var lockCount = 0;
|
|
3332
|
+
var unwrapHost = function(node) {
|
|
3333
|
+
return node && (node.host || unwrapHost(node.parentNode));
|
|
3334
|
+
};
|
|
3335
|
+
var correctTargets = function(parent, targets) {
|
|
3336
|
+
return targets.map(function(target) {
|
|
3337
|
+
if (parent.contains(target)) return target;
|
|
3338
|
+
var correctedTarget = unwrapHost(target);
|
|
3339
|
+
if (correctedTarget && parent.contains(correctedTarget)) return correctedTarget;
|
|
3340
|
+
console.error("aria-hidden", target, "in not contained inside", parent, ". Doing nothing");
|
|
3341
|
+
return null;
|
|
3342
|
+
}).filter(function(x) {
|
|
3343
|
+
return Boolean(x);
|
|
3344
|
+
});
|
|
3345
|
+
};
|
|
3346
|
+
var applyAttributeToOthers = function(originalTarget, parentNode, markerName, controlAttribute) {
|
|
3347
|
+
var targets = correctTargets(parentNode, Array.isArray(originalTarget) ? originalTarget : [originalTarget]);
|
|
3348
|
+
if (!markerMap[markerName]) markerMap[markerName] = /* @__PURE__ */ new WeakMap();
|
|
3349
|
+
var markerCounter = markerMap[markerName];
|
|
3350
|
+
var hiddenNodes = [];
|
|
3351
|
+
var elementsToKeep = /* @__PURE__ */ new Set();
|
|
3352
|
+
var elementsToStop = new Set(targets);
|
|
3353
|
+
var keep = function(el) {
|
|
3354
|
+
if (!el || elementsToKeep.has(el)) return;
|
|
3355
|
+
elementsToKeep.add(el);
|
|
3356
|
+
keep(el.parentNode);
|
|
3357
|
+
};
|
|
3358
|
+
targets.forEach(keep);
|
|
3359
|
+
var deep = function(parent) {
|
|
3360
|
+
if (!parent || elementsToStop.has(parent)) return;
|
|
3361
|
+
Array.prototype.forEach.call(parent.children, function(node) {
|
|
3362
|
+
if (elementsToKeep.has(node)) deep(node);
|
|
3363
|
+
else try {
|
|
3364
|
+
var attr = node.getAttribute(controlAttribute);
|
|
3365
|
+
var alreadyHidden = attr !== null && attr !== "false";
|
|
3366
|
+
var counterValue = (counterMap.get(node) || 0) + 1;
|
|
3367
|
+
var markerValue = (markerCounter.get(node) || 0) + 1;
|
|
3368
|
+
counterMap.set(node, counterValue);
|
|
3369
|
+
markerCounter.set(node, markerValue);
|
|
3370
|
+
hiddenNodes.push(node);
|
|
3371
|
+
if (counterValue === 1 && alreadyHidden) uncontrolledNodes.set(node, true);
|
|
3372
|
+
if (markerValue === 1) node.setAttribute(markerName, "true");
|
|
3373
|
+
if (!alreadyHidden) node.setAttribute(controlAttribute, "true");
|
|
3374
|
+
} catch (e) {
|
|
3375
|
+
console.error("aria-hidden: cannot operate on ", node, e);
|
|
3376
|
+
}
|
|
3377
|
+
});
|
|
3378
|
+
};
|
|
3379
|
+
deep(parentNode);
|
|
3380
|
+
elementsToKeep.clear();
|
|
3381
|
+
lockCount++;
|
|
3382
|
+
return function() {
|
|
3383
|
+
hiddenNodes.forEach(function(node) {
|
|
3384
|
+
var counterValue = counterMap.get(node) - 1;
|
|
3385
|
+
var markerValue = markerCounter.get(node) - 1;
|
|
3386
|
+
counterMap.set(node, counterValue);
|
|
3387
|
+
markerCounter.set(node, markerValue);
|
|
3388
|
+
if (!counterValue) {
|
|
3389
|
+
if (!uncontrolledNodes.has(node)) node.removeAttribute(controlAttribute);
|
|
3390
|
+
uncontrolledNodes.delete(node);
|
|
3391
|
+
}
|
|
3392
|
+
if (!markerValue) node.removeAttribute(markerName);
|
|
3393
|
+
});
|
|
3394
|
+
lockCount--;
|
|
3395
|
+
if (!lockCount) {
|
|
3396
|
+
counterMap = /* @__PURE__ */ new WeakMap();
|
|
3397
|
+
counterMap = /* @__PURE__ */ new WeakMap();
|
|
3398
|
+
uncontrolledNodes = /* @__PURE__ */ new WeakMap();
|
|
3399
|
+
markerMap = {};
|
|
3400
|
+
}
|
|
3401
|
+
};
|
|
3402
|
+
};
|
|
3403
|
+
var hideOthers = function(originalTarget, parentNode, markerName) {
|
|
3404
|
+
if (markerName === void 0) markerName = "data-aria-hidden";
|
|
3405
|
+
var targets = Array.from(Array.isArray(originalTarget) ? originalTarget : [originalTarget]);
|
|
3406
|
+
var activeParentNode = parentNode || getDefaultParent(originalTarget);
|
|
3407
|
+
if (!activeParentNode) return function() {
|
|
3408
|
+
return null;
|
|
3409
|
+
};
|
|
3410
|
+
targets.push.apply(targets, Array.from(activeParentNode.querySelectorAll("[aria-live], script")));
|
|
3411
|
+
return applyAttributeToOthers(targets, activeParentNode, markerName, "aria-hidden");
|
|
3412
|
+
};
|
|
3413
|
+
var DIALOG_NAME = "Dialog";
|
|
3414
|
+
var [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME);
|
|
3415
|
+
var [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME);
|
|
3416
|
+
var Dialog$1 = (props) => {
|
|
3417
|
+
const { __scopeDialog, children, open: openProp, defaultOpen, onOpenChange, modal = true } = props;
|
|
3418
|
+
const triggerRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(null);
|
|
3419
|
+
const contentRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(null);
|
|
3420
|
+
const [open, setOpen] = useControllableState({
|
|
3421
|
+
prop: openProp,
|
|
3422
|
+
defaultProp: defaultOpen ?? false,
|
|
3423
|
+
onChange: onOpenChange,
|
|
3424
|
+
caller: DIALOG_NAME
|
|
3425
|
+
});
|
|
3426
|
+
return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(DialogProvider, {
|
|
3427
|
+
scope: __scopeDialog,
|
|
3428
|
+
triggerRef,
|
|
3429
|
+
contentRef,
|
|
3430
|
+
contentId: useId(),
|
|
3431
|
+
titleId: useId(),
|
|
3432
|
+
descriptionId: useId(),
|
|
3433
|
+
open,
|
|
3434
|
+
onOpenChange: setOpen,
|
|
3435
|
+
onOpenToggle: react__WEBPACK_IMPORTED_MODULE_0__.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
|
3436
|
+
modal,
|
|
3437
|
+
children
|
|
3438
|
+
});
|
|
3439
|
+
};
|
|
3440
|
+
Dialog$1.displayName = DIALOG_NAME;
|
|
3441
|
+
var TRIGGER_NAME = "DialogTrigger";
|
|
3442
|
+
var DialogTrigger$1 = react__WEBPACK_IMPORTED_MODULE_0__.forwardRef((props, forwardedRef) => {
|
|
3443
|
+
const { __scopeDialog, ...triggerProps } = props;
|
|
3444
|
+
const context = useDialogContext(TRIGGER_NAME, __scopeDialog);
|
|
3445
|
+
const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);
|
|
3446
|
+
return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(Primitive.button, {
|
|
3447
|
+
type: "button",
|
|
3448
|
+
"aria-haspopup": "dialog",
|
|
3449
|
+
"aria-expanded": context.open,
|
|
3450
|
+
"aria-controls": context.contentId,
|
|
3451
|
+
"data-state": getState(context.open),
|
|
3452
|
+
...triggerProps,
|
|
3453
|
+
ref: composedTriggerRef,
|
|
3454
|
+
onClick: composeEventHandlers(props.onClick, context.onOpenToggle)
|
|
3455
|
+
});
|
|
3456
|
+
});
|
|
3457
|
+
DialogTrigger$1.displayName = TRIGGER_NAME;
|
|
3458
|
+
var PORTAL_NAME = "DialogPortal";
|
|
3459
|
+
var [PortalProvider, usePortalContext] = createDialogContext(PORTAL_NAME, { forceMount: void 0 });
|
|
3460
|
+
var DialogPortal$1 = (props) => {
|
|
3461
|
+
const { __scopeDialog, forceMount, children, container } = props;
|
|
3462
|
+
const context = useDialogContext(PORTAL_NAME, __scopeDialog);
|
|
3463
|
+
return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(PortalProvider, {
|
|
3464
|
+
scope: __scopeDialog,
|
|
3465
|
+
forceMount,
|
|
3466
|
+
children: react__WEBPACK_IMPORTED_MODULE_0__.Children.map(children, (child) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(Presence, {
|
|
3467
|
+
present: forceMount || context.open,
|
|
3468
|
+
children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(Portal, {
|
|
3469
|
+
asChild: true,
|
|
3470
|
+
container,
|
|
3471
|
+
children: child
|
|
3472
|
+
})
|
|
3473
|
+
}))
|
|
3474
|
+
});
|
|
3475
|
+
};
|
|
3476
|
+
DialogPortal$1.displayName = PORTAL_NAME;
|
|
3477
|
+
var OVERLAY_NAME = "DialogOverlay";
|
|
3478
|
+
var DialogOverlay$1 = react__WEBPACK_IMPORTED_MODULE_0__.forwardRef((props, forwardedRef) => {
|
|
3479
|
+
const portalContext = usePortalContext(OVERLAY_NAME, props.__scopeDialog);
|
|
3480
|
+
const { forceMount = portalContext.forceMount, ...overlayProps } = props;
|
|
3481
|
+
const context = useDialogContext(OVERLAY_NAME, props.__scopeDialog);
|
|
3482
|
+
return context.modal ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(Presence, {
|
|
3483
|
+
present: forceMount || context.open,
|
|
3484
|
+
children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(DialogOverlayImpl, {
|
|
3485
|
+
...overlayProps,
|
|
3486
|
+
ref: forwardedRef
|
|
3487
|
+
})
|
|
3488
|
+
}) : null;
|
|
3489
|
+
});
|
|
3490
|
+
DialogOverlay$1.displayName = OVERLAY_NAME;
|
|
3491
|
+
var Slot = /* @__PURE__ */ createSlot("DialogOverlay.RemoveScroll");
|
|
3492
|
+
var DialogOverlayImpl = react__WEBPACK_IMPORTED_MODULE_0__.forwardRef((props, forwardedRef) => {
|
|
3493
|
+
const { __scopeDialog, ...overlayProps } = props;
|
|
3494
|
+
const context = useDialogContext(OVERLAY_NAME, __scopeDialog);
|
|
3495
|
+
return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(Combination_default, {
|
|
3496
|
+
as: Slot,
|
|
3497
|
+
allowPinchZoom: true,
|
|
3498
|
+
shards: [context.contentRef],
|
|
3499
|
+
children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(Primitive.div, {
|
|
3500
|
+
"data-state": getState(context.open),
|
|
3501
|
+
...overlayProps,
|
|
3502
|
+
ref: forwardedRef,
|
|
3503
|
+
style: {
|
|
3504
|
+
pointerEvents: "auto",
|
|
3505
|
+
...overlayProps.style
|
|
3506
|
+
}
|
|
3507
|
+
})
|
|
3508
|
+
});
|
|
3509
|
+
});
|
|
3510
|
+
var CONTENT_NAME = "DialogContent";
|
|
3511
|
+
var DialogContent$1 = react__WEBPACK_IMPORTED_MODULE_0__.forwardRef((props, forwardedRef) => {
|
|
3512
|
+
const portalContext = usePortalContext(CONTENT_NAME, props.__scopeDialog);
|
|
3513
|
+
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
3514
|
+
const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
|
|
3515
|
+
return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(Presence, {
|
|
3516
|
+
present: forceMount || context.open,
|
|
3517
|
+
children: context.modal ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(DialogContentModal, {
|
|
3518
|
+
...contentProps,
|
|
3519
|
+
ref: forwardedRef
|
|
3520
|
+
}) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(DialogContentNonModal, {
|
|
3521
|
+
...contentProps,
|
|
3522
|
+
ref: forwardedRef
|
|
3523
|
+
})
|
|
3524
|
+
});
|
|
3525
|
+
});
|
|
3526
|
+
DialogContent$1.displayName = CONTENT_NAME;
|
|
3527
|
+
var DialogContentModal = react__WEBPACK_IMPORTED_MODULE_0__.forwardRef((props, forwardedRef) => {
|
|
3528
|
+
const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
|
|
3529
|
+
const contentRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(null);
|
|
3530
|
+
const composedRefs = useComposedRefs(forwardedRef, context.contentRef, contentRef);
|
|
3531
|
+
react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {
|
|
3532
|
+
const content = contentRef.current;
|
|
3533
|
+
if (content) return hideOthers(content);
|
|
3534
|
+
}, []);
|
|
3535
|
+
return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(DialogContentImpl, {
|
|
3536
|
+
...props,
|
|
3537
|
+
ref: composedRefs,
|
|
3538
|
+
trapFocus: context.open,
|
|
3539
|
+
disableOutsidePointerEvents: true,
|
|
3540
|
+
onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {
|
|
3541
|
+
event.preventDefault();
|
|
3542
|
+
context.triggerRef.current?.focus();
|
|
3543
|
+
}),
|
|
3544
|
+
onPointerDownOutside: composeEventHandlers(props.onPointerDownOutside, (event) => {
|
|
3545
|
+
const originalEvent = event.detail.originalEvent;
|
|
3546
|
+
const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
|
|
3547
|
+
if (originalEvent.button === 2 || ctrlLeftClick) event.preventDefault();
|
|
3548
|
+
}),
|
|
3549
|
+
onFocusOutside: composeEventHandlers(props.onFocusOutside, (event) => event.preventDefault())
|
|
3550
|
+
});
|
|
3551
|
+
});
|
|
3552
|
+
var DialogContentNonModal = react__WEBPACK_IMPORTED_MODULE_0__.forwardRef((props, forwardedRef) => {
|
|
3553
|
+
const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
|
|
3554
|
+
const hasInteractedOutsideRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(false);
|
|
3555
|
+
const hasPointerDownOutsideRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(false);
|
|
3556
|
+
return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(DialogContentImpl, {
|
|
3557
|
+
...props,
|
|
3558
|
+
ref: forwardedRef,
|
|
3559
|
+
trapFocus: false,
|
|
3560
|
+
disableOutsidePointerEvents: false,
|
|
3561
|
+
onCloseAutoFocus: (event) => {
|
|
3562
|
+
props.onCloseAutoFocus?.(event);
|
|
3563
|
+
if (!event.defaultPrevented) {
|
|
3564
|
+
if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();
|
|
3565
|
+
event.preventDefault();
|
|
3566
|
+
}
|
|
3567
|
+
hasInteractedOutsideRef.current = false;
|
|
3568
|
+
hasPointerDownOutsideRef.current = false;
|
|
3569
|
+
},
|
|
3570
|
+
onInteractOutside: (event) => {
|
|
3571
|
+
props.onInteractOutside?.(event);
|
|
3572
|
+
if (!event.defaultPrevented) {
|
|
3573
|
+
hasInteractedOutsideRef.current = true;
|
|
3574
|
+
if (event.detail.originalEvent.type === "pointerdown") hasPointerDownOutsideRef.current = true;
|
|
3575
|
+
}
|
|
3576
|
+
const target = event.target;
|
|
3577
|
+
if (context.triggerRef.current?.contains(target)) event.preventDefault();
|
|
3578
|
+
if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.current) event.preventDefault();
|
|
3579
|
+
}
|
|
3580
|
+
});
|
|
3581
|
+
});
|
|
3582
|
+
var DialogContentImpl = react__WEBPACK_IMPORTED_MODULE_0__.forwardRef((props, forwardedRef) => {
|
|
3583
|
+
const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props;
|
|
3584
|
+
const context = useDialogContext(CONTENT_NAME, __scopeDialog);
|
|
3585
|
+
const contentRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(null);
|
|
3586
|
+
const composedRefs = useComposedRefs(forwardedRef, contentRef);
|
|
3587
|
+
useFocusGuards();
|
|
3588
|
+
return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.Fragment, { children: [/* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(FocusScope, {
|
|
3589
|
+
asChild: true,
|
|
3590
|
+
loop: true,
|
|
3591
|
+
trapped: trapFocus,
|
|
3592
|
+
onMountAutoFocus: onOpenAutoFocus,
|
|
3593
|
+
onUnmountAutoFocus: onCloseAutoFocus,
|
|
3594
|
+
children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(DismissableLayer, {
|
|
3595
|
+
role: "dialog",
|
|
3596
|
+
id: context.contentId,
|
|
3597
|
+
"aria-describedby": context.descriptionId,
|
|
3598
|
+
"aria-labelledby": context.titleId,
|
|
3599
|
+
"data-state": getState(context.open),
|
|
3600
|
+
...contentProps,
|
|
3601
|
+
ref: composedRefs,
|
|
3602
|
+
onDismiss: () => context.onOpenChange(false)
|
|
3603
|
+
})
|
|
3604
|
+
}), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.Fragment, { children: [/* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(TitleWarning, { titleId: context.titleId }), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(DescriptionWarning, {
|
|
3605
|
+
contentRef,
|
|
3606
|
+
descriptionId: context.descriptionId
|
|
3607
|
+
})] })] });
|
|
3608
|
+
});
|
|
3609
|
+
var TITLE_NAME = "DialogTitle";
|
|
3610
|
+
var DialogTitle$1 = react__WEBPACK_IMPORTED_MODULE_0__.forwardRef((props, forwardedRef) => {
|
|
3611
|
+
const { __scopeDialog, ...titleProps } = props;
|
|
3612
|
+
const context = useDialogContext(TITLE_NAME, __scopeDialog);
|
|
3613
|
+
return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(Primitive.h2, {
|
|
3614
|
+
id: context.titleId,
|
|
3615
|
+
...titleProps,
|
|
3616
|
+
ref: forwardedRef
|
|
3617
|
+
});
|
|
3618
|
+
});
|
|
3619
|
+
DialogTitle$1.displayName = TITLE_NAME;
|
|
3620
|
+
var DESCRIPTION_NAME = "DialogDescription";
|
|
3621
|
+
var DialogDescription$1 = react__WEBPACK_IMPORTED_MODULE_0__.forwardRef((props, forwardedRef) => {
|
|
3622
|
+
const { __scopeDialog, ...descriptionProps } = props;
|
|
3623
|
+
const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog);
|
|
3624
|
+
return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(Primitive.p, {
|
|
3625
|
+
id: context.descriptionId,
|
|
3626
|
+
...descriptionProps,
|
|
3627
|
+
ref: forwardedRef
|
|
3628
|
+
});
|
|
3629
|
+
});
|
|
3630
|
+
DialogDescription$1.displayName = DESCRIPTION_NAME;
|
|
3631
|
+
var CLOSE_NAME = "DialogClose";
|
|
3632
|
+
var DialogClose = react__WEBPACK_IMPORTED_MODULE_0__.forwardRef((props, forwardedRef) => {
|
|
3633
|
+
const { __scopeDialog, ...closeProps } = props;
|
|
3634
|
+
const context = useDialogContext(CLOSE_NAME, __scopeDialog);
|
|
3635
|
+
return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(Primitive.button, {
|
|
3636
|
+
type: "button",
|
|
3637
|
+
...closeProps,
|
|
3638
|
+
ref: forwardedRef,
|
|
3639
|
+
onClick: composeEventHandlers(props.onClick, () => context.onOpenChange(false))
|
|
3640
|
+
});
|
|
3641
|
+
});
|
|
3642
|
+
DialogClose.displayName = CLOSE_NAME;
|
|
3643
|
+
function getState(open) {
|
|
3644
|
+
return open ? "open" : "closed";
|
|
3645
|
+
}
|
|
3646
|
+
var TITLE_WARNING_NAME = "DialogTitleWarning";
|
|
3647
|
+
var [WarningProvider, useWarningContext] = createContext2(TITLE_WARNING_NAME, {
|
|
3648
|
+
contentName: CONTENT_NAME,
|
|
3649
|
+
titleName: TITLE_NAME,
|
|
3650
|
+
docsSlug: "dialog"
|
|
3651
|
+
});
|
|
3652
|
+
var TitleWarning = ({ titleId }) => {
|
|
3653
|
+
const titleWarningContext = useWarningContext(TITLE_WARNING_NAME);
|
|
3654
|
+
const MESSAGE = `\`${titleWarningContext.contentName}\` requires a \`${titleWarningContext.titleName}\` for the component to be accessible for screen reader users.
|
|
3655
|
+
|
|
3656
|
+
If you want to hide the \`${titleWarningContext.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
3657
|
+
|
|
3658
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${titleWarningContext.docsSlug}`;
|
|
3659
|
+
react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {
|
|
3660
|
+
if (titleId) {
|
|
3661
|
+
if (!document.getElementById(titleId)) console.error(MESSAGE);
|
|
3662
|
+
}
|
|
3663
|
+
}, [MESSAGE, titleId]);
|
|
3664
|
+
return null;
|
|
3665
|
+
};
|
|
3666
|
+
var DESCRIPTION_WARNING_NAME = "DialogDescriptionWarning";
|
|
3667
|
+
var DescriptionWarning = ({ contentRef, descriptionId }) => {
|
|
3668
|
+
const MESSAGE = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${useWarningContext(DESCRIPTION_WARNING_NAME).contentName}}.`;
|
|
3669
|
+
react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {
|
|
3670
|
+
const describedById = contentRef.current?.getAttribute("aria-describedby");
|
|
3671
|
+
if (descriptionId && describedById) {
|
|
3672
|
+
if (!document.getElementById(descriptionId)) console.warn(MESSAGE);
|
|
3673
|
+
}
|
|
3674
|
+
}, [
|
|
3675
|
+
MESSAGE,
|
|
3676
|
+
contentRef,
|
|
3677
|
+
descriptionId
|
|
3678
|
+
]);
|
|
3679
|
+
return null;
|
|
3680
|
+
};
|
|
3681
|
+
var Root = Dialog$1;
|
|
3682
|
+
var Trigger = DialogTrigger$1;
|
|
3683
|
+
var Portal$1 = DialogPortal$1;
|
|
3684
|
+
var Overlay = DialogOverlay$1;
|
|
3685
|
+
var Content = DialogContent$1;
|
|
3686
|
+
var Title = DialogTitle$1;
|
|
3687
|
+
var Description = DialogDescription$1;
|
|
3688
|
+
var Close = DialogClose;
|
|
3689
|
+
/**
|
|
3690
|
+
* @license lucide-react v0.475.0 - ISC
|
|
3691
|
+
*
|
|
3692
|
+
* This source code is licensed under the ISC license.
|
|
3693
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
3694
|
+
*/
|
|
3695
|
+
var toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
3696
|
+
var mergeClasses = (...classes) => classes.filter((className, index, array) => {
|
|
3697
|
+
return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index;
|
|
3698
|
+
}).join(" ").trim();
|
|
3699
|
+
/**
|
|
3700
|
+
* @license lucide-react v0.475.0 - ISC
|
|
3701
|
+
*
|
|
3702
|
+
* This source code is licensed under the ISC license.
|
|
3703
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
3704
|
+
*/
|
|
3705
|
+
var defaultAttributes = {
|
|
3706
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3707
|
+
width: 24,
|
|
3708
|
+
height: 24,
|
|
3709
|
+
viewBox: "0 0 24 24",
|
|
3710
|
+
fill: "none",
|
|
3711
|
+
stroke: "currentColor",
|
|
3712
|
+
strokeWidth: 2,
|
|
3713
|
+
strokeLinecap: "round",
|
|
3714
|
+
strokeLinejoin: "round"
|
|
3715
|
+
};
|
|
3716
|
+
/**
|
|
3717
|
+
* @license lucide-react v0.475.0 - ISC
|
|
3718
|
+
*
|
|
3719
|
+
* This source code is licensed under the ISC license.
|
|
3720
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
3721
|
+
*/
|
|
3722
|
+
var Icon = (0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(({ color = "currentColor", size = 24, strokeWidth = 2, absoluteStrokeWidth, className = "", children, iconNode, ...rest }, ref) => {
|
|
3723
|
+
return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("svg", {
|
|
3724
|
+
ref,
|
|
3725
|
+
...defaultAttributes,
|
|
3726
|
+
width: size,
|
|
3727
|
+
height: size,
|
|
3728
|
+
stroke: color,
|
|
3729
|
+
strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,
|
|
3730
|
+
className: mergeClasses("lucide", className),
|
|
3731
|
+
...rest
|
|
3732
|
+
}, [...iconNode.map(([tag, attrs]) => (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(tag, attrs)), ...Array.isArray(children) ? children : [children]]);
|
|
3733
|
+
});
|
|
3734
|
+
/**
|
|
3735
|
+
* @license lucide-react v0.475.0 - ISC
|
|
3736
|
+
*
|
|
3737
|
+
* This source code is licensed under the ISC license.
|
|
3738
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
3739
|
+
*/
|
|
3740
|
+
var createLucideIcon = (iconName, iconNode) => {
|
|
3741
|
+
const Component = (0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(({ className, ...props }, ref) => (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(Icon, {
|
|
3742
|
+
ref,
|
|
3743
|
+
iconNode,
|
|
3744
|
+
className: mergeClasses(`lucide-${toKebabCase(iconName)}`, className),
|
|
3745
|
+
...props
|
|
3746
|
+
}));
|
|
3747
|
+
Component.displayName = `${iconName}`;
|
|
3748
|
+
return Component;
|
|
3749
|
+
};
|
|
3750
|
+
var X = createLucideIcon("X", [["path", {
|
|
3751
|
+
d: "M18 6 6 18",
|
|
3752
|
+
key: "1bl5f8"
|
|
3753
|
+
}], ["path", {
|
|
3754
|
+
d: "m6 6 12 12",
|
|
3755
|
+
key: "d8bk6v"
|
|
3756
|
+
}]]);
|
|
3757
|
+
function Dialog({ ...props }) {
|
|
3758
|
+
return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(Root, {
|
|
3759
|
+
"data-slot": "dialog",
|
|
3760
|
+
...props
|
|
3761
|
+
});
|
|
3762
|
+
}
|
|
3763
|
+
function DialogTrigger({ ...props }) {
|
|
3764
|
+
return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(Trigger, {
|
|
3765
|
+
"data-slot": "dialog-trigger",
|
|
3766
|
+
...props
|
|
3767
|
+
});
|
|
3768
|
+
}
|
|
3769
|
+
function DialogPortal({ ...props }) {
|
|
3770
|
+
return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(Portal$1, {
|
|
3771
|
+
"data-slot": "dialog-portal",
|
|
3772
|
+
...props
|
|
3773
|
+
});
|
|
3774
|
+
}
|
|
3775
|
+
function DialogOverlay({ className, ...props }) {
|
|
3776
|
+
return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(Overlay, {
|
|
3777
|
+
"data-slot": "dialog-overlay",
|
|
3778
|
+
className: cn("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50", className),
|
|
3779
|
+
...props
|
|
3780
|
+
});
|
|
3781
|
+
}
|
|
3782
|
+
function DialogContent({ className, children, showCloseButton = true, ...props }) {
|
|
3783
|
+
return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)(DialogPortal, {
|
|
3784
|
+
"data-slot": "dialog-portal",
|
|
3785
|
+
children: [/* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(DialogOverlay, {}), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)(Content, {
|
|
3786
|
+
"data-slot": "dialog-content",
|
|
3787
|
+
className: cn("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 outline-none sm:max-w-lg", className),
|
|
3788
|
+
...props,
|
|
3789
|
+
children: [children, showCloseButton && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)(Close, {
|
|
3790
|
+
"data-slot": "dialog-close",
|
|
3791
|
+
className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
3792
|
+
children: [/* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(X, {}), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("span", {
|
|
3793
|
+
className: "sr-only",
|
|
3794
|
+
children: "Close"
|
|
3795
|
+
})]
|
|
3796
|
+
})]
|
|
3797
|
+
})]
|
|
3798
|
+
});
|
|
3799
|
+
}
|
|
3800
|
+
function DialogHeader({ className, ...props }) {
|
|
3801
|
+
return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
|
|
3802
|
+
"data-slot": "dialog-header",
|
|
3803
|
+
className: cn("flex flex-col gap-2 text-center sm:text-left", className),
|
|
3804
|
+
...props
|
|
3805
|
+
});
|
|
3806
|
+
}
|
|
3807
|
+
function DialogTitle({ className, ...props }) {
|
|
3808
|
+
return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(Title, {
|
|
3809
|
+
"data-slot": "dialog-title",
|
|
3810
|
+
className: cn("text-lg leading-none font-semibold", className),
|
|
3811
|
+
...props
|
|
3812
|
+
});
|
|
3813
|
+
}
|
|
3814
|
+
function DialogDescription({ className, ...props }) {
|
|
3815
|
+
return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(Description, {
|
|
3816
|
+
"data-slot": "dialog-description",
|
|
3817
|
+
className: cn("text-muted-foreground text-sm", className),
|
|
3818
|
+
...props
|
|
3819
|
+
});
|
|
3820
|
+
}
|
|
3821
|
+
function App() {
|
|
3822
|
+
return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(ThemeProvider, {
|
|
3823
|
+
defaultTheme: "dark",
|
|
3824
|
+
storageKey: "iconoma-studio-theme",
|
|
3825
|
+
children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div", {
|
|
3826
|
+
className: "flex flex-col items-center justify-center gap-4",
|
|
3827
|
+
children: [/* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("h1", {
|
|
3828
|
+
className: "text-2xl font-bold",
|
|
3829
|
+
children: "Iconoma Studio"
|
|
3830
|
+
}), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)(Dialog, { children: [/* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(DialogTrigger, {
|
|
3831
|
+
asChild: true,
|
|
3832
|
+
children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(Button, {
|
|
3833
|
+
size: "sm",
|
|
3834
|
+
children: "Open Dialog"
|
|
3835
|
+
})
|
|
3836
|
+
}), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(DialogContent, { children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)(DialogHeader, { children: [/* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(DialogTitle, { children: "Dialog Title" }), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(DialogDescription, { children: "Dialog Description" })] }) })] })]
|
|
3837
|
+
})
|
|
3838
|
+
});
|
|
3839
|
+
}
|
|
3840
|
+
function render(_url) {
|
|
3841
|
+
return { html: (0,react_dom_server__WEBPACK_IMPORTED_MODULE_1__/* .renderToString */ .F0)(/* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(react__WEBPACK_IMPORTED_MODULE_0__.StrictMode, { children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(App, {}) })) };
|
|
3842
|
+
}
|
|
3843
|
+
|
|
3844
|
+
|
|
3845
|
+
|
|
3846
|
+
/***/ })
|
|
3847
|
+
|
|
3848
|
+
};
|