@cherrystudio/file-preview 0.1.3 → 0.2.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 +48 -5
- package/dist/{Combination-BLg27FvF.js → Combination-i8Z9CJHc.js} +2 -1
- package/dist/{FilePreviewTooLarge-DkHa6toZ.js → FilePreviewTooLarge-DC7vPyMI.js} +1 -1
- package/dist/{useTranslation-DMhY277o.js → FilePreviewToolbarButton-ptqwCTnz.js} +11 -3634
- package/dist/{ImageFilePreview-Be0jdBJ-.js → ImageFilePreview-C_P1iIEi.js} +27 -11
- package/dist/{PdfFilePreview-D3Ie0_mm.js → PdfFilePreview-CbrMcPzo.js} +132 -25
- package/dist/{PowerPointFilePreview-CyQHTp4B.js → PowerPointFilePreview-9E6kUy_A.js} +55 -21
- package/dist/RtfFilePreview-Bgl6lmWy.js +21434 -0
- package/dist/{SpreadsheetFilePreview-DJdoyeis.js → SpreadsheetFilePreview-PWFG3UY3.js} +61 -32
- package/dist/{WordFilePreview-Tvm-vK91.js → WordFilePreview-hfALJk2N.js} +26 -23
- package/dist/circle-alert-sByhBDN4.js +31 -0
- package/dist/{imageFilePreviewPlugin-CYLM2bwR.js → imageFilePreviewPlugin-D6hV1Hm1.js} +1 -1
- package/dist/react.js +55 -24
- package/dist/{rotate-ccw-YWx7RzY9.js → rotate-ccw-Bx-jjhVm.js} +1 -1
- package/dist/{selection-CQPD5a6C.js → selection-B0INvh6t.js} +1 -31
- package/dist/styles.css +44 -1
- package/dist/useTranslation-BJY4EKsz.js +3631 -0
- package/dist/{zoom-out-DLOQGt1e.js → zoom-out-B2XJ64Kx.js} +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,3631 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import { createContext, createElement, forwardRef, use, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
3
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { createPortal } from "react-dom";
|
|
5
|
+
//#region ../../node_modules/.pnpm/@radix-ui+react-compose-refs@1.1.3_@types+react@19.2.7_react@19.2.3/node_modules/@radix-ui/react-compose-refs/dist/index.mjs
|
|
6
|
+
function setRef(ref, value) {
|
|
7
|
+
if (typeof ref === "function") return ref(value);
|
|
8
|
+
else if (ref !== null && ref !== void 0) ref.current = value;
|
|
9
|
+
}
|
|
10
|
+
function composeRefs(...refs) {
|
|
11
|
+
return (node) => {
|
|
12
|
+
let hasCleanup = false;
|
|
13
|
+
const cleanups = refs.map((ref) => {
|
|
14
|
+
const cleanup = setRef(ref, node);
|
|
15
|
+
if (!hasCleanup && typeof cleanup == "function") hasCleanup = true;
|
|
16
|
+
return cleanup;
|
|
17
|
+
});
|
|
18
|
+
if (hasCleanup) return () => {
|
|
19
|
+
for (let i = 0; i < cleanups.length; i++) {
|
|
20
|
+
const cleanup = cleanups[i];
|
|
21
|
+
if (typeof cleanup == "function") cleanup();
|
|
22
|
+
else setRef(refs[i], null);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function useComposedRefs(...refs) {
|
|
28
|
+
return React$1.useCallback(composeRefs(...refs), refs);
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
//#region ../../node_modules/.pnpm/@radix-ui+react-slot@1.3.0_@types+react@19.2.7_react@19.2.3/node_modules/@radix-ui/react-slot/dist/index.mjs
|
|
32
|
+
// @__NO_SIDE_EFFECTS__
|
|
33
|
+
function createSlot(ownerName) {
|
|
34
|
+
const Slot2 = React$1.forwardRef((props, forwardedRef) => {
|
|
35
|
+
let { children, ...slotProps } = props;
|
|
36
|
+
let slottableElement = null;
|
|
37
|
+
let hasSlottable = false;
|
|
38
|
+
const newChildren = [];
|
|
39
|
+
if (isLazyComponent(children) && typeof use$1 === "function") children = use$1(children._payload);
|
|
40
|
+
React$1.Children.forEach(children, (maybeSlottable) => {
|
|
41
|
+
if (isSlottable(maybeSlottable)) {
|
|
42
|
+
hasSlottable = true;
|
|
43
|
+
const slottable = maybeSlottable;
|
|
44
|
+
let child = "child" in slottable.props ? slottable.props.child : slottable.props.children;
|
|
45
|
+
if (isLazyComponent(child) && typeof use$1 === "function") child = use$1(child._payload);
|
|
46
|
+
slottableElement = getSlottableElementFromSlottable(slottable, child);
|
|
47
|
+
newChildren.push(slottableElement?.props?.children);
|
|
48
|
+
} else newChildren.push(maybeSlottable);
|
|
49
|
+
});
|
|
50
|
+
if (slottableElement) slottableElement = React$1.cloneElement(slottableElement, void 0, newChildren);
|
|
51
|
+
else if (!hasSlottable && React$1.Children.count(children) === 1 && React$1.isValidElement(children)) slottableElement = children;
|
|
52
|
+
const slottableElementRef = slottableElement ? getElementRef(slottableElement) : void 0;
|
|
53
|
+
const composedRef = useComposedRefs(forwardedRef, slottableElementRef);
|
|
54
|
+
if (!slottableElement) {
|
|
55
|
+
if (children || children === 0) throw new Error(hasSlottable ? createSlottableError(ownerName) : createSlotError(ownerName));
|
|
56
|
+
return children;
|
|
57
|
+
}
|
|
58
|
+
const mergedProps = mergeProps(slotProps, slottableElement.props ?? {});
|
|
59
|
+
if (slottableElement.type !== React$1.Fragment) mergedProps.ref = forwardedRef ? composedRef : slottableElementRef;
|
|
60
|
+
return React$1.cloneElement(slottableElement, mergedProps);
|
|
61
|
+
});
|
|
62
|
+
Slot2.displayName = `${ownerName}.Slot`;
|
|
63
|
+
return Slot2;
|
|
64
|
+
}
|
|
65
|
+
var Slot = /* @__PURE__ */ createSlot("Slot");
|
|
66
|
+
var SLOTTABLE_IDENTIFIER = Symbol.for("radix.slottable");
|
|
67
|
+
// @__NO_SIDE_EFFECTS__
|
|
68
|
+
function createSlottable(ownerName) {
|
|
69
|
+
const Slottable2 = (props) => "child" in props ? props.children(props.child) : props.children;
|
|
70
|
+
Slottable2.displayName = `${ownerName}.Slottable`;
|
|
71
|
+
Slottable2.__radixId = SLOTTABLE_IDENTIFIER;
|
|
72
|
+
return Slottable2;
|
|
73
|
+
}
|
|
74
|
+
var getSlottableElementFromSlottable = (slottable, child) => {
|
|
75
|
+
if ("child" in slottable.props) {
|
|
76
|
+
const child2 = slottable.props.child;
|
|
77
|
+
if (!React$1.isValidElement(child2)) return null;
|
|
78
|
+
return React$1.cloneElement(child2, void 0, slottable.props.children(child2.props.children));
|
|
79
|
+
}
|
|
80
|
+
return React$1.isValidElement(child) ? child : null;
|
|
81
|
+
};
|
|
82
|
+
function mergeProps(slotProps, childProps) {
|
|
83
|
+
const overrideProps = { ...childProps };
|
|
84
|
+
for (const propName in childProps) {
|
|
85
|
+
const slotPropValue = slotProps[propName];
|
|
86
|
+
const childPropValue = childProps[propName];
|
|
87
|
+
if (/^on[A-Z]/.test(propName)) {
|
|
88
|
+
if (slotPropValue && childPropValue) overrideProps[propName] = (...args) => {
|
|
89
|
+
const result = childPropValue(...args);
|
|
90
|
+
slotPropValue(...args);
|
|
91
|
+
return result;
|
|
92
|
+
};
|
|
93
|
+
else if (slotPropValue) overrideProps[propName] = slotPropValue;
|
|
94
|
+
} else if (propName === "style") overrideProps[propName] = {
|
|
95
|
+
...slotPropValue,
|
|
96
|
+
...childPropValue
|
|
97
|
+
};
|
|
98
|
+
else if (propName === "className") overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
|
|
99
|
+
}
|
|
100
|
+
return {
|
|
101
|
+
...slotProps,
|
|
102
|
+
...overrideProps
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
function getElementRef(element) {
|
|
106
|
+
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
|
107
|
+
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
108
|
+
if (mayWarn) return element.ref;
|
|
109
|
+
getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
|
|
110
|
+
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
111
|
+
if (mayWarn) return element.props.ref;
|
|
112
|
+
return element.props.ref || element.ref;
|
|
113
|
+
}
|
|
114
|
+
function isSlottable(child) {
|
|
115
|
+
return React$1.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
|
116
|
+
}
|
|
117
|
+
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
|
118
|
+
function isLazyComponent(element) {
|
|
119
|
+
return element != null && typeof element === "object" && "$$typeof" in element && element.$$typeof === REACT_LAZY_TYPE && "_payload" in element && isPromiseLike(element._payload);
|
|
120
|
+
}
|
|
121
|
+
function isPromiseLike(value) {
|
|
122
|
+
return typeof value === "object" && value !== null && "then" in value;
|
|
123
|
+
}
|
|
124
|
+
var createSlotError = (ownerName) => {
|
|
125
|
+
return `${ownerName} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`;
|
|
126
|
+
};
|
|
127
|
+
var createSlottableError = (ownerName) => {
|
|
128
|
+
return `${ownerName} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`;
|
|
129
|
+
};
|
|
130
|
+
var use$1 = React$1[" use ".trim().toString()];
|
|
131
|
+
//#endregion
|
|
132
|
+
//#region ../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
133
|
+
function r(e) {
|
|
134
|
+
var t, f, n = "";
|
|
135
|
+
if ("string" == typeof e || "number" == typeof e) n += e;
|
|
136
|
+
else if ("object" == typeof e) if (Array.isArray(e)) {
|
|
137
|
+
var o = e.length;
|
|
138
|
+
for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
139
|
+
} else for (f in e) e[f] && (n && (n += " "), n += f);
|
|
140
|
+
return n;
|
|
141
|
+
}
|
|
142
|
+
function clsx() {
|
|
143
|
+
for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
144
|
+
return n;
|
|
145
|
+
}
|
|
146
|
+
//#endregion
|
|
147
|
+
//#region ../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.mjs
|
|
148
|
+
/**
|
|
149
|
+
* Copyright 2022 Joe Bell. All rights reserved.
|
|
150
|
+
*
|
|
151
|
+
* This file is licensed to you under the Apache License, Version 2.0
|
|
152
|
+
* (the "License"); you may not use this file except in compliance with the
|
|
153
|
+
* License. You may obtain a copy of the License at
|
|
154
|
+
*
|
|
155
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
156
|
+
*
|
|
157
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
158
|
+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
159
|
+
* WARRANTIES OR REPRESENTATIONS OF ANY KIND, either express or implied. See the
|
|
160
|
+
* License for the specific language governing permissions and limitations under
|
|
161
|
+
* the License.
|
|
162
|
+
*/ var falsyToString = (value) => typeof value === "boolean" ? `${value}` : value === 0 ? "0" : value;
|
|
163
|
+
var cx = clsx;
|
|
164
|
+
var cva = (base, config) => (props) => {
|
|
165
|
+
var _config_compoundVariants;
|
|
166
|
+
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);
|
|
167
|
+
const { variants, defaultVariants } = config;
|
|
168
|
+
const getVariantClassNames = Object.keys(variants).map((variant) => {
|
|
169
|
+
const variantProp = props === null || props === void 0 ? void 0 : props[variant];
|
|
170
|
+
const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];
|
|
171
|
+
if (variantProp === null) return null;
|
|
172
|
+
const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);
|
|
173
|
+
return variants[variant][variantKey];
|
|
174
|
+
});
|
|
175
|
+
const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param) => {
|
|
176
|
+
let [key, value] = param;
|
|
177
|
+
if (value === void 0) return acc;
|
|
178
|
+
acc[key] = value;
|
|
179
|
+
return acc;
|
|
180
|
+
}, {});
|
|
181
|
+
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) => {
|
|
182
|
+
let { class: cvClass, className: cvClassName, ...compoundVariantOptions } = param;
|
|
183
|
+
return Object.entries(compoundVariantOptions).every((param) => {
|
|
184
|
+
let [key, value] = param;
|
|
185
|
+
return Array.isArray(value) ? value.includes({
|
|
186
|
+
...defaultVariants,
|
|
187
|
+
...propsWithoutUndefined
|
|
188
|
+
}[key]) : {
|
|
189
|
+
...defaultVariants,
|
|
190
|
+
...propsWithoutUndefined
|
|
191
|
+
}[key] === value;
|
|
192
|
+
}) ? [
|
|
193
|
+
...acc,
|
|
194
|
+
cvClass,
|
|
195
|
+
cvClassName
|
|
196
|
+
] : acc;
|
|
197
|
+
}, []), props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
|
|
198
|
+
};
|
|
199
|
+
//#endregion
|
|
200
|
+
//#region ../../node_modules/.pnpm/lucide-react@0.545.0_react@19.2.3/node_modules/lucide-react/dist/esm/shared/src/utils.js
|
|
201
|
+
/**
|
|
202
|
+
* @license lucide-react v0.545.0 - ISC
|
|
203
|
+
*
|
|
204
|
+
* This source code is licensed under the ISC license.
|
|
205
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
206
|
+
*/
|
|
207
|
+
var toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
208
|
+
var toCamelCase = (string) => string.replace(/^([A-Z])|[\s-_]+(\w)/g, (match, p1, p2) => p2 ? p2.toUpperCase() : p1.toLowerCase());
|
|
209
|
+
var toPascalCase = (string) => {
|
|
210
|
+
const camelCase = toCamelCase(string);
|
|
211
|
+
return camelCase.charAt(0).toUpperCase() + camelCase.slice(1);
|
|
212
|
+
};
|
|
213
|
+
var mergeClasses = (...classes) => classes.filter((className, index, array) => {
|
|
214
|
+
return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index;
|
|
215
|
+
}).join(" ").trim();
|
|
216
|
+
var hasA11yProp = (props) => {
|
|
217
|
+
for (const prop in props) if (prop.startsWith("aria-") || prop === "role" || prop === "title") return true;
|
|
218
|
+
};
|
|
219
|
+
//#endregion
|
|
220
|
+
//#region ../../node_modules/.pnpm/lucide-react@0.545.0_react@19.2.3/node_modules/lucide-react/dist/esm/defaultAttributes.js
|
|
221
|
+
/**
|
|
222
|
+
* @license lucide-react v0.545.0 - ISC
|
|
223
|
+
*
|
|
224
|
+
* This source code is licensed under the ISC license.
|
|
225
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
226
|
+
*/
|
|
227
|
+
var defaultAttributes = {
|
|
228
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
229
|
+
width: 24,
|
|
230
|
+
height: 24,
|
|
231
|
+
viewBox: "0 0 24 24",
|
|
232
|
+
fill: "none",
|
|
233
|
+
stroke: "currentColor",
|
|
234
|
+
strokeWidth: 2,
|
|
235
|
+
strokeLinecap: "round",
|
|
236
|
+
strokeLinejoin: "round"
|
|
237
|
+
};
|
|
238
|
+
//#endregion
|
|
239
|
+
//#region ../../node_modules/.pnpm/lucide-react@0.545.0_react@19.2.3/node_modules/lucide-react/dist/esm/Icon.js
|
|
240
|
+
/**
|
|
241
|
+
* @license lucide-react v0.545.0 - ISC
|
|
242
|
+
*
|
|
243
|
+
* This source code is licensed under the ISC license.
|
|
244
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
245
|
+
*/
|
|
246
|
+
var Icon = forwardRef(({ color = "currentColor", size = 24, strokeWidth = 2, absoluteStrokeWidth, className = "", children, iconNode, ...rest }, ref) => createElement("svg", {
|
|
247
|
+
ref,
|
|
248
|
+
...defaultAttributes,
|
|
249
|
+
width: size,
|
|
250
|
+
height: size,
|
|
251
|
+
stroke: color,
|
|
252
|
+
strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,
|
|
253
|
+
className: mergeClasses("lucide", className),
|
|
254
|
+
...!children && !hasA11yProp(rest) && { "aria-hidden": "true" },
|
|
255
|
+
...rest
|
|
256
|
+
}, [...iconNode.map(([tag, attrs]) => createElement(tag, attrs)), ...Array.isArray(children) ? children : [children]]));
|
|
257
|
+
//#endregion
|
|
258
|
+
//#region ../../node_modules/.pnpm/lucide-react@0.545.0_react@19.2.3/node_modules/lucide-react/dist/esm/createLucideIcon.js
|
|
259
|
+
/**
|
|
260
|
+
* @license lucide-react v0.545.0 - ISC
|
|
261
|
+
*
|
|
262
|
+
* This source code is licensed under the ISC license.
|
|
263
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
264
|
+
*/
|
|
265
|
+
var createLucideIcon = (iconName, iconNode) => {
|
|
266
|
+
const Component = forwardRef(({ className, ...props }, ref) => createElement(Icon, {
|
|
267
|
+
ref,
|
|
268
|
+
iconNode,
|
|
269
|
+
className: mergeClasses(`lucide-${toKebabCase(toPascalCase(iconName))}`, `lucide-${iconName}`, className),
|
|
270
|
+
...props
|
|
271
|
+
}));
|
|
272
|
+
Component.displayName = toPascalCase(iconName);
|
|
273
|
+
return Component;
|
|
274
|
+
};
|
|
275
|
+
/**
|
|
276
|
+
* @license lucide-react v0.545.0 - ISC
|
|
277
|
+
*
|
|
278
|
+
* This source code is licensed under the ISC license.
|
|
279
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
280
|
+
*/
|
|
281
|
+
var FileWarning = createLucideIcon("file-warning", [
|
|
282
|
+
["path", {
|
|
283
|
+
d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",
|
|
284
|
+
key: "1rqfz7"
|
|
285
|
+
}],
|
|
286
|
+
["path", {
|
|
287
|
+
d: "M12 9v4",
|
|
288
|
+
key: "juzpu7"
|
|
289
|
+
}],
|
|
290
|
+
["path", {
|
|
291
|
+
d: "M12 17h.01",
|
|
292
|
+
key: "p32p05"
|
|
293
|
+
}]
|
|
294
|
+
]);
|
|
295
|
+
/**
|
|
296
|
+
* @license lucide-react v0.545.0 - ISC
|
|
297
|
+
*
|
|
298
|
+
* This source code is licensed under the ISC license.
|
|
299
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
300
|
+
*/
|
|
301
|
+
var LoaderCircle = createLucideIcon("loader-circle", [["path", {
|
|
302
|
+
d: "M21 12a9 9 0 1 1-6.219-8.56",
|
|
303
|
+
key: "13zald"
|
|
304
|
+
}]]);
|
|
305
|
+
/**
|
|
306
|
+
* @license lucide-react v0.545.0 - ISC
|
|
307
|
+
*
|
|
308
|
+
* This source code is licensed under the ISC license.
|
|
309
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
310
|
+
*/
|
|
311
|
+
var Loader = createLucideIcon("loader", [
|
|
312
|
+
["path", {
|
|
313
|
+
d: "M12 2v4",
|
|
314
|
+
key: "3427ic"
|
|
315
|
+
}],
|
|
316
|
+
["path", {
|
|
317
|
+
d: "m16.2 7.8 2.9-2.9",
|
|
318
|
+
key: "r700ao"
|
|
319
|
+
}],
|
|
320
|
+
["path", {
|
|
321
|
+
d: "M18 12h4",
|
|
322
|
+
key: "wj9ykh"
|
|
323
|
+
}],
|
|
324
|
+
["path", {
|
|
325
|
+
d: "m16.2 16.2 2.9 2.9",
|
|
326
|
+
key: "1bxg5t"
|
|
327
|
+
}],
|
|
328
|
+
["path", {
|
|
329
|
+
d: "M12 18v4",
|
|
330
|
+
key: "jadmvz"
|
|
331
|
+
}],
|
|
332
|
+
["path", {
|
|
333
|
+
d: "m4.9 19.1 2.9-2.9",
|
|
334
|
+
key: "bwix9q"
|
|
335
|
+
}],
|
|
336
|
+
["path", {
|
|
337
|
+
d: "M2 12h4",
|
|
338
|
+
key: "j09sii"
|
|
339
|
+
}],
|
|
340
|
+
["path", {
|
|
341
|
+
d: "m4.9 4.9 2.9 2.9",
|
|
342
|
+
key: "giyufr"
|
|
343
|
+
}]
|
|
344
|
+
]);
|
|
345
|
+
//#endregion
|
|
346
|
+
//#region ../../node_modules/.pnpm/tailwind-merge@2.6.1/node_modules/tailwind-merge/dist/bundle-mjs.mjs
|
|
347
|
+
var CLASS_PART_SEPARATOR = "-";
|
|
348
|
+
var createClassGroupUtils = (config) => {
|
|
349
|
+
const classMap = createClassMap(config);
|
|
350
|
+
const { conflictingClassGroups, conflictingClassGroupModifiers } = config;
|
|
351
|
+
const getClassGroupId = (className) => {
|
|
352
|
+
const classParts = className.split(CLASS_PART_SEPARATOR);
|
|
353
|
+
if (classParts[0] === "" && classParts.length !== 1) classParts.shift();
|
|
354
|
+
return getGroupRecursive(classParts, classMap) || getGroupIdForArbitraryProperty(className);
|
|
355
|
+
};
|
|
356
|
+
const getConflictingClassGroupIds = (classGroupId, hasPostfixModifier) => {
|
|
357
|
+
const conflicts = conflictingClassGroups[classGroupId] || [];
|
|
358
|
+
if (hasPostfixModifier && conflictingClassGroupModifiers[classGroupId]) return [...conflicts, ...conflictingClassGroupModifiers[classGroupId]];
|
|
359
|
+
return conflicts;
|
|
360
|
+
};
|
|
361
|
+
return {
|
|
362
|
+
getClassGroupId,
|
|
363
|
+
getConflictingClassGroupIds
|
|
364
|
+
};
|
|
365
|
+
};
|
|
366
|
+
var getGroupRecursive = (classParts, classPartObject) => {
|
|
367
|
+
if (classParts.length === 0) return classPartObject.classGroupId;
|
|
368
|
+
const currentClassPart = classParts[0];
|
|
369
|
+
const nextClassPartObject = classPartObject.nextPart.get(currentClassPart);
|
|
370
|
+
const classGroupFromNextClassPart = nextClassPartObject ? getGroupRecursive(classParts.slice(1), nextClassPartObject) : void 0;
|
|
371
|
+
if (classGroupFromNextClassPart) return classGroupFromNextClassPart;
|
|
372
|
+
if (classPartObject.validators.length === 0) return;
|
|
373
|
+
const classRest = classParts.join(CLASS_PART_SEPARATOR);
|
|
374
|
+
return classPartObject.validators.find(({ validator }) => validator(classRest))?.classGroupId;
|
|
375
|
+
};
|
|
376
|
+
var arbitraryPropertyRegex = /^\[(.+)\]$/;
|
|
377
|
+
var getGroupIdForArbitraryProperty = (className) => {
|
|
378
|
+
if (arbitraryPropertyRegex.test(className)) {
|
|
379
|
+
const arbitraryPropertyClassName = arbitraryPropertyRegex.exec(className)[1];
|
|
380
|
+
const property = arbitraryPropertyClassName?.substring(0, arbitraryPropertyClassName.indexOf(":"));
|
|
381
|
+
if (property) return "arbitrary.." + property;
|
|
382
|
+
}
|
|
383
|
+
};
|
|
384
|
+
/**
|
|
385
|
+
* Exported for testing only
|
|
386
|
+
*/
|
|
387
|
+
var createClassMap = (config) => {
|
|
388
|
+
const { theme, prefix } = config;
|
|
389
|
+
const classMap = {
|
|
390
|
+
nextPart: /* @__PURE__ */ new Map(),
|
|
391
|
+
validators: []
|
|
392
|
+
};
|
|
393
|
+
getPrefixedClassGroupEntries(Object.entries(config.classGroups), prefix).forEach(([classGroupId, classGroup]) => {
|
|
394
|
+
processClassesRecursively(classGroup, classMap, classGroupId, theme);
|
|
395
|
+
});
|
|
396
|
+
return classMap;
|
|
397
|
+
};
|
|
398
|
+
var processClassesRecursively = (classGroup, classPartObject, classGroupId, theme) => {
|
|
399
|
+
classGroup.forEach((classDefinition) => {
|
|
400
|
+
if (typeof classDefinition === "string") {
|
|
401
|
+
const classPartObjectToEdit = classDefinition === "" ? classPartObject : getPart(classPartObject, classDefinition);
|
|
402
|
+
classPartObjectToEdit.classGroupId = classGroupId;
|
|
403
|
+
return;
|
|
404
|
+
}
|
|
405
|
+
if (typeof classDefinition === "function") {
|
|
406
|
+
if (isThemeGetter(classDefinition)) {
|
|
407
|
+
processClassesRecursively(classDefinition(theme), classPartObject, classGroupId, theme);
|
|
408
|
+
return;
|
|
409
|
+
}
|
|
410
|
+
classPartObject.validators.push({
|
|
411
|
+
validator: classDefinition,
|
|
412
|
+
classGroupId
|
|
413
|
+
});
|
|
414
|
+
return;
|
|
415
|
+
}
|
|
416
|
+
Object.entries(classDefinition).forEach(([key, classGroup]) => {
|
|
417
|
+
processClassesRecursively(classGroup, getPart(classPartObject, key), classGroupId, theme);
|
|
418
|
+
});
|
|
419
|
+
});
|
|
420
|
+
};
|
|
421
|
+
var getPart = (classPartObject, path) => {
|
|
422
|
+
let currentClassPartObject = classPartObject;
|
|
423
|
+
path.split(CLASS_PART_SEPARATOR).forEach((pathPart) => {
|
|
424
|
+
if (!currentClassPartObject.nextPart.has(pathPart)) currentClassPartObject.nextPart.set(pathPart, {
|
|
425
|
+
nextPart: /* @__PURE__ */ new Map(),
|
|
426
|
+
validators: []
|
|
427
|
+
});
|
|
428
|
+
currentClassPartObject = currentClassPartObject.nextPart.get(pathPart);
|
|
429
|
+
});
|
|
430
|
+
return currentClassPartObject;
|
|
431
|
+
};
|
|
432
|
+
var isThemeGetter = (func) => func.isThemeGetter;
|
|
433
|
+
var getPrefixedClassGroupEntries = (classGroupEntries, prefix) => {
|
|
434
|
+
if (!prefix) return classGroupEntries;
|
|
435
|
+
return classGroupEntries.map(([classGroupId, classGroup]) => {
|
|
436
|
+
return [classGroupId, classGroup.map((classDefinition) => {
|
|
437
|
+
if (typeof classDefinition === "string") return prefix + classDefinition;
|
|
438
|
+
if (typeof classDefinition === "object") return Object.fromEntries(Object.entries(classDefinition).map(([key, value]) => [prefix + key, value]));
|
|
439
|
+
return classDefinition;
|
|
440
|
+
})];
|
|
441
|
+
});
|
|
442
|
+
};
|
|
443
|
+
var createLruCache = (maxCacheSize) => {
|
|
444
|
+
if (maxCacheSize < 1) return {
|
|
445
|
+
get: () => void 0,
|
|
446
|
+
set: () => {}
|
|
447
|
+
};
|
|
448
|
+
let cacheSize = 0;
|
|
449
|
+
let cache = /* @__PURE__ */ new Map();
|
|
450
|
+
let previousCache = /* @__PURE__ */ new Map();
|
|
451
|
+
const update = (key, value) => {
|
|
452
|
+
cache.set(key, value);
|
|
453
|
+
cacheSize++;
|
|
454
|
+
if (cacheSize > maxCacheSize) {
|
|
455
|
+
cacheSize = 0;
|
|
456
|
+
previousCache = cache;
|
|
457
|
+
cache = /* @__PURE__ */ new Map();
|
|
458
|
+
}
|
|
459
|
+
};
|
|
460
|
+
return {
|
|
461
|
+
get(key) {
|
|
462
|
+
let value = cache.get(key);
|
|
463
|
+
if (value !== void 0) return value;
|
|
464
|
+
if ((value = previousCache.get(key)) !== void 0) {
|
|
465
|
+
update(key, value);
|
|
466
|
+
return value;
|
|
467
|
+
}
|
|
468
|
+
},
|
|
469
|
+
set(key, value) {
|
|
470
|
+
if (cache.has(key)) cache.set(key, value);
|
|
471
|
+
else update(key, value);
|
|
472
|
+
}
|
|
473
|
+
};
|
|
474
|
+
};
|
|
475
|
+
var IMPORTANT_MODIFIER = "!";
|
|
476
|
+
var createParseClassName = (config) => {
|
|
477
|
+
const { separator, experimentalParseClassName } = config;
|
|
478
|
+
const isSeparatorSingleCharacter = separator.length === 1;
|
|
479
|
+
const firstSeparatorCharacter = separator[0];
|
|
480
|
+
const separatorLength = separator.length;
|
|
481
|
+
const parseClassName = (className) => {
|
|
482
|
+
const modifiers = [];
|
|
483
|
+
let bracketDepth = 0;
|
|
484
|
+
let modifierStart = 0;
|
|
485
|
+
let postfixModifierPosition;
|
|
486
|
+
for (let index = 0; index < className.length; index++) {
|
|
487
|
+
let currentCharacter = className[index];
|
|
488
|
+
if (bracketDepth === 0) {
|
|
489
|
+
if (currentCharacter === firstSeparatorCharacter && (isSeparatorSingleCharacter || className.slice(index, index + separatorLength) === separator)) {
|
|
490
|
+
modifiers.push(className.slice(modifierStart, index));
|
|
491
|
+
modifierStart = index + separatorLength;
|
|
492
|
+
continue;
|
|
493
|
+
}
|
|
494
|
+
if (currentCharacter === "/") {
|
|
495
|
+
postfixModifierPosition = index;
|
|
496
|
+
continue;
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
if (currentCharacter === "[") bracketDepth++;
|
|
500
|
+
else if (currentCharacter === "]") bracketDepth--;
|
|
501
|
+
}
|
|
502
|
+
const baseClassNameWithImportantModifier = modifiers.length === 0 ? className : className.substring(modifierStart);
|
|
503
|
+
const hasImportantModifier = baseClassNameWithImportantModifier.startsWith(IMPORTANT_MODIFIER);
|
|
504
|
+
return {
|
|
505
|
+
modifiers,
|
|
506
|
+
hasImportantModifier,
|
|
507
|
+
baseClassName: hasImportantModifier ? baseClassNameWithImportantModifier.substring(1) : baseClassNameWithImportantModifier,
|
|
508
|
+
maybePostfixModifierPosition: postfixModifierPosition && postfixModifierPosition > modifierStart ? postfixModifierPosition - modifierStart : void 0
|
|
509
|
+
};
|
|
510
|
+
};
|
|
511
|
+
if (experimentalParseClassName) return (className) => experimentalParseClassName({
|
|
512
|
+
className,
|
|
513
|
+
parseClassName
|
|
514
|
+
});
|
|
515
|
+
return parseClassName;
|
|
516
|
+
};
|
|
517
|
+
/**
|
|
518
|
+
* Sorts modifiers according to following schema:
|
|
519
|
+
* - Predefined modifiers are sorted alphabetically
|
|
520
|
+
* - When an arbitrary variant appears, it must be preserved which modifiers are before and after it
|
|
521
|
+
*/
|
|
522
|
+
var sortModifiers = (modifiers) => {
|
|
523
|
+
if (modifiers.length <= 1) return modifiers;
|
|
524
|
+
const sortedModifiers = [];
|
|
525
|
+
let unsortedModifiers = [];
|
|
526
|
+
modifiers.forEach((modifier) => {
|
|
527
|
+
if (modifier[0] === "[") {
|
|
528
|
+
sortedModifiers.push(...unsortedModifiers.sort(), modifier);
|
|
529
|
+
unsortedModifiers = [];
|
|
530
|
+
} else unsortedModifiers.push(modifier);
|
|
531
|
+
});
|
|
532
|
+
sortedModifiers.push(...unsortedModifiers.sort());
|
|
533
|
+
return sortedModifiers;
|
|
534
|
+
};
|
|
535
|
+
var createConfigUtils = (config) => ({
|
|
536
|
+
cache: createLruCache(config.cacheSize),
|
|
537
|
+
parseClassName: createParseClassName(config),
|
|
538
|
+
...createClassGroupUtils(config)
|
|
539
|
+
});
|
|
540
|
+
var SPLIT_CLASSES_REGEX = /\s+/;
|
|
541
|
+
var mergeClassList = (classList, configUtils) => {
|
|
542
|
+
const { parseClassName, getClassGroupId, getConflictingClassGroupIds } = configUtils;
|
|
543
|
+
/**
|
|
544
|
+
* Set of classGroupIds in following format:
|
|
545
|
+
* `{importantModifier}{variantModifiers}{classGroupId}`
|
|
546
|
+
* @example 'float'
|
|
547
|
+
* @example 'hover:focus:bg-color'
|
|
548
|
+
* @example 'md:!pr'
|
|
549
|
+
*/
|
|
550
|
+
const classGroupsInConflict = [];
|
|
551
|
+
const classNames = classList.trim().split(SPLIT_CLASSES_REGEX);
|
|
552
|
+
let result = "";
|
|
553
|
+
for (let index = classNames.length - 1; index >= 0; index -= 1) {
|
|
554
|
+
const originalClassName = classNames[index];
|
|
555
|
+
const { modifiers, hasImportantModifier, baseClassName, maybePostfixModifierPosition } = parseClassName(originalClassName);
|
|
556
|
+
let hasPostfixModifier = Boolean(maybePostfixModifierPosition);
|
|
557
|
+
let classGroupId = getClassGroupId(hasPostfixModifier ? baseClassName.substring(0, maybePostfixModifierPosition) : baseClassName);
|
|
558
|
+
if (!classGroupId) {
|
|
559
|
+
if (!hasPostfixModifier) {
|
|
560
|
+
result = originalClassName + (result.length > 0 ? " " + result : result);
|
|
561
|
+
continue;
|
|
562
|
+
}
|
|
563
|
+
classGroupId = getClassGroupId(baseClassName);
|
|
564
|
+
if (!classGroupId) {
|
|
565
|
+
result = originalClassName + (result.length > 0 ? " " + result : result);
|
|
566
|
+
continue;
|
|
567
|
+
}
|
|
568
|
+
hasPostfixModifier = false;
|
|
569
|
+
}
|
|
570
|
+
const variantModifier = sortModifiers(modifiers).join(":");
|
|
571
|
+
const modifierId = hasImportantModifier ? variantModifier + IMPORTANT_MODIFIER : variantModifier;
|
|
572
|
+
const classId = modifierId + classGroupId;
|
|
573
|
+
if (classGroupsInConflict.includes(classId)) continue;
|
|
574
|
+
classGroupsInConflict.push(classId);
|
|
575
|
+
const conflictGroups = getConflictingClassGroupIds(classGroupId, hasPostfixModifier);
|
|
576
|
+
for (let i = 0; i < conflictGroups.length; ++i) {
|
|
577
|
+
const group = conflictGroups[i];
|
|
578
|
+
classGroupsInConflict.push(modifierId + group);
|
|
579
|
+
}
|
|
580
|
+
result = originalClassName + (result.length > 0 ? " " + result : result);
|
|
581
|
+
}
|
|
582
|
+
return result;
|
|
583
|
+
};
|
|
584
|
+
/**
|
|
585
|
+
* The code in this file is copied from https://github.com/lukeed/clsx and modified to suit the needs of tailwind-merge better.
|
|
586
|
+
*
|
|
587
|
+
* Specifically:
|
|
588
|
+
* - Runtime code from https://github.com/lukeed/clsx/blob/v1.2.1/src/index.js
|
|
589
|
+
* - TypeScript types from https://github.com/lukeed/clsx/blob/v1.2.1/clsx.d.ts
|
|
590
|
+
*
|
|
591
|
+
* Original code has MIT license: Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeed.com)
|
|
592
|
+
*/
|
|
593
|
+
function twJoin() {
|
|
594
|
+
let index = 0;
|
|
595
|
+
let argument;
|
|
596
|
+
let resolvedValue;
|
|
597
|
+
let string = "";
|
|
598
|
+
while (index < arguments.length) if (argument = arguments[index++]) {
|
|
599
|
+
if (resolvedValue = toValue(argument)) {
|
|
600
|
+
string && (string += " ");
|
|
601
|
+
string += resolvedValue;
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
return string;
|
|
605
|
+
}
|
|
606
|
+
var toValue = (mix) => {
|
|
607
|
+
if (typeof mix === "string") return mix;
|
|
608
|
+
let resolvedValue;
|
|
609
|
+
let string = "";
|
|
610
|
+
for (let k = 0; k < mix.length; k++) if (mix[k]) {
|
|
611
|
+
if (resolvedValue = toValue(mix[k])) {
|
|
612
|
+
string && (string += " ");
|
|
613
|
+
string += resolvedValue;
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
return string;
|
|
617
|
+
};
|
|
618
|
+
function createTailwindMerge(createConfigFirst, ...createConfigRest) {
|
|
619
|
+
let configUtils;
|
|
620
|
+
let cacheGet;
|
|
621
|
+
let cacheSet;
|
|
622
|
+
let functionToCall = initTailwindMerge;
|
|
623
|
+
function initTailwindMerge(classList) {
|
|
624
|
+
configUtils = createConfigUtils(createConfigRest.reduce((previousConfig, createConfigCurrent) => createConfigCurrent(previousConfig), createConfigFirst()));
|
|
625
|
+
cacheGet = configUtils.cache.get;
|
|
626
|
+
cacheSet = configUtils.cache.set;
|
|
627
|
+
functionToCall = tailwindMerge;
|
|
628
|
+
return tailwindMerge(classList);
|
|
629
|
+
}
|
|
630
|
+
function tailwindMerge(classList) {
|
|
631
|
+
const cachedResult = cacheGet(classList);
|
|
632
|
+
if (cachedResult) return cachedResult;
|
|
633
|
+
const result = mergeClassList(classList, configUtils);
|
|
634
|
+
cacheSet(classList, result);
|
|
635
|
+
return result;
|
|
636
|
+
}
|
|
637
|
+
return function callTailwindMerge() {
|
|
638
|
+
return functionToCall(twJoin.apply(null, arguments));
|
|
639
|
+
};
|
|
640
|
+
}
|
|
641
|
+
var fromTheme = (key) => {
|
|
642
|
+
const themeGetter = (theme) => theme[key] || [];
|
|
643
|
+
themeGetter.isThemeGetter = true;
|
|
644
|
+
return themeGetter;
|
|
645
|
+
};
|
|
646
|
+
var arbitraryValueRegex = /^\[(?:([a-z-]+):)?(.+)\]$/i;
|
|
647
|
+
var fractionRegex = /^\d+\/\d+$/;
|
|
648
|
+
var stringLengths = /*#__PURE__*/ new Set([
|
|
649
|
+
"px",
|
|
650
|
+
"full",
|
|
651
|
+
"screen"
|
|
652
|
+
]);
|
|
653
|
+
var tshirtUnitRegex = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/;
|
|
654
|
+
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$/;
|
|
655
|
+
var colorFunctionRegex = /^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/;
|
|
656
|
+
var shadowRegex = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/;
|
|
657
|
+
var imageRegex = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;
|
|
658
|
+
var isLength = (value) => isNumber(value) || stringLengths.has(value) || fractionRegex.test(value);
|
|
659
|
+
var isArbitraryLength = (value) => getIsArbitraryValue(value, "length", isLengthOnly);
|
|
660
|
+
var isNumber = (value) => Boolean(value) && !Number.isNaN(Number(value));
|
|
661
|
+
var isArbitraryNumber = (value) => getIsArbitraryValue(value, "number", isNumber);
|
|
662
|
+
var isInteger = (value) => Boolean(value) && Number.isInteger(Number(value));
|
|
663
|
+
var isPercent = (value) => value.endsWith("%") && isNumber(value.slice(0, -1));
|
|
664
|
+
var isArbitraryValue = (value) => arbitraryValueRegex.test(value);
|
|
665
|
+
var isTshirtSize = (value) => tshirtUnitRegex.test(value);
|
|
666
|
+
var sizeLabels = /*#__PURE__*/ new Set([
|
|
667
|
+
"length",
|
|
668
|
+
"size",
|
|
669
|
+
"percentage"
|
|
670
|
+
]);
|
|
671
|
+
var isArbitrarySize = (value) => getIsArbitraryValue(value, sizeLabels, isNever);
|
|
672
|
+
var isArbitraryPosition = (value) => getIsArbitraryValue(value, "position", isNever);
|
|
673
|
+
var imageLabels = /*#__PURE__*/ new Set(["image", "url"]);
|
|
674
|
+
var isArbitraryImage = (value) => getIsArbitraryValue(value, imageLabels, isImage);
|
|
675
|
+
var isArbitraryShadow = (value) => getIsArbitraryValue(value, "", isShadow);
|
|
676
|
+
var isAny = () => true;
|
|
677
|
+
var getIsArbitraryValue = (value, label, testValue) => {
|
|
678
|
+
const result = arbitraryValueRegex.exec(value);
|
|
679
|
+
if (result) {
|
|
680
|
+
if (result[1]) return typeof label === "string" ? result[1] === label : label.has(result[1]);
|
|
681
|
+
return testValue(result[2]);
|
|
682
|
+
}
|
|
683
|
+
return false;
|
|
684
|
+
};
|
|
685
|
+
var isLengthOnly = (value) => lengthUnitRegex.test(value) && !colorFunctionRegex.test(value);
|
|
686
|
+
var isNever = () => false;
|
|
687
|
+
var isShadow = (value) => shadowRegex.test(value);
|
|
688
|
+
var isImage = (value) => imageRegex.test(value);
|
|
689
|
+
var getDefaultConfig = () => {
|
|
690
|
+
const colors = fromTheme("colors");
|
|
691
|
+
const spacing = fromTheme("spacing");
|
|
692
|
+
const blur = fromTheme("blur");
|
|
693
|
+
const brightness = fromTheme("brightness");
|
|
694
|
+
const borderColor = fromTheme("borderColor");
|
|
695
|
+
const borderRadius = fromTheme("borderRadius");
|
|
696
|
+
const borderSpacing = fromTheme("borderSpacing");
|
|
697
|
+
const borderWidth = fromTheme("borderWidth");
|
|
698
|
+
const contrast = fromTheme("contrast");
|
|
699
|
+
const grayscale = fromTheme("grayscale");
|
|
700
|
+
const hueRotate = fromTheme("hueRotate");
|
|
701
|
+
const invert = fromTheme("invert");
|
|
702
|
+
const gap = fromTheme("gap");
|
|
703
|
+
const gradientColorStops = fromTheme("gradientColorStops");
|
|
704
|
+
const gradientColorStopPositions = fromTheme("gradientColorStopPositions");
|
|
705
|
+
const inset = fromTheme("inset");
|
|
706
|
+
const margin = fromTheme("margin");
|
|
707
|
+
const opacity = fromTheme("opacity");
|
|
708
|
+
const padding = fromTheme("padding");
|
|
709
|
+
const saturate = fromTheme("saturate");
|
|
710
|
+
const scale = fromTheme("scale");
|
|
711
|
+
const sepia = fromTheme("sepia");
|
|
712
|
+
const skew = fromTheme("skew");
|
|
713
|
+
const space = fromTheme("space");
|
|
714
|
+
const translate = fromTheme("translate");
|
|
715
|
+
const getOverscroll = () => [
|
|
716
|
+
"auto",
|
|
717
|
+
"contain",
|
|
718
|
+
"none"
|
|
719
|
+
];
|
|
720
|
+
const getOverflow = () => [
|
|
721
|
+
"auto",
|
|
722
|
+
"hidden",
|
|
723
|
+
"clip",
|
|
724
|
+
"visible",
|
|
725
|
+
"scroll"
|
|
726
|
+
];
|
|
727
|
+
const getSpacingWithAutoAndArbitrary = () => [
|
|
728
|
+
"auto",
|
|
729
|
+
isArbitraryValue,
|
|
730
|
+
spacing
|
|
731
|
+
];
|
|
732
|
+
const getSpacingWithArbitrary = () => [isArbitraryValue, spacing];
|
|
733
|
+
const getLengthWithEmptyAndArbitrary = () => [
|
|
734
|
+
"",
|
|
735
|
+
isLength,
|
|
736
|
+
isArbitraryLength
|
|
737
|
+
];
|
|
738
|
+
const getNumberWithAutoAndArbitrary = () => [
|
|
739
|
+
"auto",
|
|
740
|
+
isNumber,
|
|
741
|
+
isArbitraryValue
|
|
742
|
+
];
|
|
743
|
+
const getPositions = () => [
|
|
744
|
+
"bottom",
|
|
745
|
+
"center",
|
|
746
|
+
"left",
|
|
747
|
+
"left-bottom",
|
|
748
|
+
"left-top",
|
|
749
|
+
"right",
|
|
750
|
+
"right-bottom",
|
|
751
|
+
"right-top",
|
|
752
|
+
"top"
|
|
753
|
+
];
|
|
754
|
+
const getLineStyles = () => [
|
|
755
|
+
"solid",
|
|
756
|
+
"dashed",
|
|
757
|
+
"dotted",
|
|
758
|
+
"double",
|
|
759
|
+
"none"
|
|
760
|
+
];
|
|
761
|
+
const getBlendModes = () => [
|
|
762
|
+
"normal",
|
|
763
|
+
"multiply",
|
|
764
|
+
"screen",
|
|
765
|
+
"overlay",
|
|
766
|
+
"darken",
|
|
767
|
+
"lighten",
|
|
768
|
+
"color-dodge",
|
|
769
|
+
"color-burn",
|
|
770
|
+
"hard-light",
|
|
771
|
+
"soft-light",
|
|
772
|
+
"difference",
|
|
773
|
+
"exclusion",
|
|
774
|
+
"hue",
|
|
775
|
+
"saturation",
|
|
776
|
+
"color",
|
|
777
|
+
"luminosity"
|
|
778
|
+
];
|
|
779
|
+
const getAlign = () => [
|
|
780
|
+
"start",
|
|
781
|
+
"end",
|
|
782
|
+
"center",
|
|
783
|
+
"between",
|
|
784
|
+
"around",
|
|
785
|
+
"evenly",
|
|
786
|
+
"stretch"
|
|
787
|
+
];
|
|
788
|
+
const getZeroAndEmpty = () => [
|
|
789
|
+
"",
|
|
790
|
+
"0",
|
|
791
|
+
isArbitraryValue
|
|
792
|
+
];
|
|
793
|
+
const getBreaks = () => [
|
|
794
|
+
"auto",
|
|
795
|
+
"avoid",
|
|
796
|
+
"all",
|
|
797
|
+
"avoid-page",
|
|
798
|
+
"page",
|
|
799
|
+
"left",
|
|
800
|
+
"right",
|
|
801
|
+
"column"
|
|
802
|
+
];
|
|
803
|
+
const getNumberAndArbitrary = () => [isNumber, isArbitraryValue];
|
|
804
|
+
return {
|
|
805
|
+
cacheSize: 500,
|
|
806
|
+
separator: ":",
|
|
807
|
+
theme: {
|
|
808
|
+
colors: [isAny],
|
|
809
|
+
spacing: [isLength, isArbitraryLength],
|
|
810
|
+
blur: [
|
|
811
|
+
"none",
|
|
812
|
+
"",
|
|
813
|
+
isTshirtSize,
|
|
814
|
+
isArbitraryValue
|
|
815
|
+
],
|
|
816
|
+
brightness: getNumberAndArbitrary(),
|
|
817
|
+
borderColor: [colors],
|
|
818
|
+
borderRadius: [
|
|
819
|
+
"none",
|
|
820
|
+
"",
|
|
821
|
+
"full",
|
|
822
|
+
isTshirtSize,
|
|
823
|
+
isArbitraryValue
|
|
824
|
+
],
|
|
825
|
+
borderSpacing: getSpacingWithArbitrary(),
|
|
826
|
+
borderWidth: getLengthWithEmptyAndArbitrary(),
|
|
827
|
+
contrast: getNumberAndArbitrary(),
|
|
828
|
+
grayscale: getZeroAndEmpty(),
|
|
829
|
+
hueRotate: getNumberAndArbitrary(),
|
|
830
|
+
invert: getZeroAndEmpty(),
|
|
831
|
+
gap: getSpacingWithArbitrary(),
|
|
832
|
+
gradientColorStops: [colors],
|
|
833
|
+
gradientColorStopPositions: [isPercent, isArbitraryLength],
|
|
834
|
+
inset: getSpacingWithAutoAndArbitrary(),
|
|
835
|
+
margin: getSpacingWithAutoAndArbitrary(),
|
|
836
|
+
opacity: getNumberAndArbitrary(),
|
|
837
|
+
padding: getSpacingWithArbitrary(),
|
|
838
|
+
saturate: getNumberAndArbitrary(),
|
|
839
|
+
scale: getNumberAndArbitrary(),
|
|
840
|
+
sepia: getZeroAndEmpty(),
|
|
841
|
+
skew: getNumberAndArbitrary(),
|
|
842
|
+
space: getSpacingWithArbitrary(),
|
|
843
|
+
translate: getSpacingWithArbitrary()
|
|
844
|
+
},
|
|
845
|
+
classGroups: {
|
|
846
|
+
/**
|
|
847
|
+
* Aspect Ratio
|
|
848
|
+
* @see https://tailwindcss.com/docs/aspect-ratio
|
|
849
|
+
*/
|
|
850
|
+
aspect: [{ aspect: [
|
|
851
|
+
"auto",
|
|
852
|
+
"square",
|
|
853
|
+
"video",
|
|
854
|
+
isArbitraryValue
|
|
855
|
+
] }],
|
|
856
|
+
/**
|
|
857
|
+
* Container
|
|
858
|
+
* @see https://tailwindcss.com/docs/container
|
|
859
|
+
*/
|
|
860
|
+
container: ["container"],
|
|
861
|
+
/**
|
|
862
|
+
* Columns
|
|
863
|
+
* @see https://tailwindcss.com/docs/columns
|
|
864
|
+
*/
|
|
865
|
+
columns: [{ columns: [isTshirtSize] }],
|
|
866
|
+
/**
|
|
867
|
+
* Break After
|
|
868
|
+
* @see https://tailwindcss.com/docs/break-after
|
|
869
|
+
*/
|
|
870
|
+
"break-after": [{ "break-after": getBreaks() }],
|
|
871
|
+
/**
|
|
872
|
+
* Break Before
|
|
873
|
+
* @see https://tailwindcss.com/docs/break-before
|
|
874
|
+
*/
|
|
875
|
+
"break-before": [{ "break-before": getBreaks() }],
|
|
876
|
+
/**
|
|
877
|
+
* Break Inside
|
|
878
|
+
* @see https://tailwindcss.com/docs/break-inside
|
|
879
|
+
*/
|
|
880
|
+
"break-inside": [{ "break-inside": [
|
|
881
|
+
"auto",
|
|
882
|
+
"avoid",
|
|
883
|
+
"avoid-page",
|
|
884
|
+
"avoid-column"
|
|
885
|
+
] }],
|
|
886
|
+
/**
|
|
887
|
+
* Box Decoration Break
|
|
888
|
+
* @see https://tailwindcss.com/docs/box-decoration-break
|
|
889
|
+
*/
|
|
890
|
+
"box-decoration": [{ "box-decoration": ["slice", "clone"] }],
|
|
891
|
+
/**
|
|
892
|
+
* Box Sizing
|
|
893
|
+
* @see https://tailwindcss.com/docs/box-sizing
|
|
894
|
+
*/
|
|
895
|
+
box: [{ box: ["border", "content"] }],
|
|
896
|
+
/**
|
|
897
|
+
* Display
|
|
898
|
+
* @see https://tailwindcss.com/docs/display
|
|
899
|
+
*/
|
|
900
|
+
display: [
|
|
901
|
+
"block",
|
|
902
|
+
"inline-block",
|
|
903
|
+
"inline",
|
|
904
|
+
"flex",
|
|
905
|
+
"inline-flex",
|
|
906
|
+
"table",
|
|
907
|
+
"inline-table",
|
|
908
|
+
"table-caption",
|
|
909
|
+
"table-cell",
|
|
910
|
+
"table-column",
|
|
911
|
+
"table-column-group",
|
|
912
|
+
"table-footer-group",
|
|
913
|
+
"table-header-group",
|
|
914
|
+
"table-row-group",
|
|
915
|
+
"table-row",
|
|
916
|
+
"flow-root",
|
|
917
|
+
"grid",
|
|
918
|
+
"inline-grid",
|
|
919
|
+
"contents",
|
|
920
|
+
"list-item",
|
|
921
|
+
"hidden"
|
|
922
|
+
],
|
|
923
|
+
/**
|
|
924
|
+
* Floats
|
|
925
|
+
* @see https://tailwindcss.com/docs/float
|
|
926
|
+
*/
|
|
927
|
+
float: [{ float: [
|
|
928
|
+
"right",
|
|
929
|
+
"left",
|
|
930
|
+
"none",
|
|
931
|
+
"start",
|
|
932
|
+
"end"
|
|
933
|
+
] }],
|
|
934
|
+
/**
|
|
935
|
+
* Clear
|
|
936
|
+
* @see https://tailwindcss.com/docs/clear
|
|
937
|
+
*/
|
|
938
|
+
clear: [{ clear: [
|
|
939
|
+
"left",
|
|
940
|
+
"right",
|
|
941
|
+
"both",
|
|
942
|
+
"none",
|
|
943
|
+
"start",
|
|
944
|
+
"end"
|
|
945
|
+
] }],
|
|
946
|
+
/**
|
|
947
|
+
* Isolation
|
|
948
|
+
* @see https://tailwindcss.com/docs/isolation
|
|
949
|
+
*/
|
|
950
|
+
isolation: ["isolate", "isolation-auto"],
|
|
951
|
+
/**
|
|
952
|
+
* Object Fit
|
|
953
|
+
* @see https://tailwindcss.com/docs/object-fit
|
|
954
|
+
*/
|
|
955
|
+
"object-fit": [{ object: [
|
|
956
|
+
"contain",
|
|
957
|
+
"cover",
|
|
958
|
+
"fill",
|
|
959
|
+
"none",
|
|
960
|
+
"scale-down"
|
|
961
|
+
] }],
|
|
962
|
+
/**
|
|
963
|
+
* Object Position
|
|
964
|
+
* @see https://tailwindcss.com/docs/object-position
|
|
965
|
+
*/
|
|
966
|
+
"object-position": [{ object: [...getPositions(), isArbitraryValue] }],
|
|
967
|
+
/**
|
|
968
|
+
* Overflow
|
|
969
|
+
* @see https://tailwindcss.com/docs/overflow
|
|
970
|
+
*/
|
|
971
|
+
overflow: [{ overflow: getOverflow() }],
|
|
972
|
+
/**
|
|
973
|
+
* Overflow X
|
|
974
|
+
* @see https://tailwindcss.com/docs/overflow
|
|
975
|
+
*/
|
|
976
|
+
"overflow-x": [{ "overflow-x": getOverflow() }],
|
|
977
|
+
/**
|
|
978
|
+
* Overflow Y
|
|
979
|
+
* @see https://tailwindcss.com/docs/overflow
|
|
980
|
+
*/
|
|
981
|
+
"overflow-y": [{ "overflow-y": getOverflow() }],
|
|
982
|
+
/**
|
|
983
|
+
* Overscroll Behavior
|
|
984
|
+
* @see https://tailwindcss.com/docs/overscroll-behavior
|
|
985
|
+
*/
|
|
986
|
+
overscroll: [{ overscroll: getOverscroll() }],
|
|
987
|
+
/**
|
|
988
|
+
* Overscroll Behavior X
|
|
989
|
+
* @see https://tailwindcss.com/docs/overscroll-behavior
|
|
990
|
+
*/
|
|
991
|
+
"overscroll-x": [{ "overscroll-x": getOverscroll() }],
|
|
992
|
+
/**
|
|
993
|
+
* Overscroll Behavior Y
|
|
994
|
+
* @see https://tailwindcss.com/docs/overscroll-behavior
|
|
995
|
+
*/
|
|
996
|
+
"overscroll-y": [{ "overscroll-y": getOverscroll() }],
|
|
997
|
+
/**
|
|
998
|
+
* Position
|
|
999
|
+
* @see https://tailwindcss.com/docs/position
|
|
1000
|
+
*/
|
|
1001
|
+
position: [
|
|
1002
|
+
"static",
|
|
1003
|
+
"fixed",
|
|
1004
|
+
"absolute",
|
|
1005
|
+
"relative",
|
|
1006
|
+
"sticky"
|
|
1007
|
+
],
|
|
1008
|
+
/**
|
|
1009
|
+
* Top / Right / Bottom / Left
|
|
1010
|
+
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
1011
|
+
*/
|
|
1012
|
+
inset: [{ inset: [inset] }],
|
|
1013
|
+
/**
|
|
1014
|
+
* Right / Left
|
|
1015
|
+
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
1016
|
+
*/
|
|
1017
|
+
"inset-x": [{ "inset-x": [inset] }],
|
|
1018
|
+
/**
|
|
1019
|
+
* Top / Bottom
|
|
1020
|
+
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
1021
|
+
*/
|
|
1022
|
+
"inset-y": [{ "inset-y": [inset] }],
|
|
1023
|
+
/**
|
|
1024
|
+
* Start
|
|
1025
|
+
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
1026
|
+
*/
|
|
1027
|
+
start: [{ start: [inset] }],
|
|
1028
|
+
/**
|
|
1029
|
+
* End
|
|
1030
|
+
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
1031
|
+
*/
|
|
1032
|
+
end: [{ end: [inset] }],
|
|
1033
|
+
/**
|
|
1034
|
+
* Top
|
|
1035
|
+
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
1036
|
+
*/
|
|
1037
|
+
top: [{ top: [inset] }],
|
|
1038
|
+
/**
|
|
1039
|
+
* Right
|
|
1040
|
+
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
1041
|
+
*/
|
|
1042
|
+
right: [{ right: [inset] }],
|
|
1043
|
+
/**
|
|
1044
|
+
* Bottom
|
|
1045
|
+
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
1046
|
+
*/
|
|
1047
|
+
bottom: [{ bottom: [inset] }],
|
|
1048
|
+
/**
|
|
1049
|
+
* Left
|
|
1050
|
+
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
1051
|
+
*/
|
|
1052
|
+
left: [{ left: [inset] }],
|
|
1053
|
+
/**
|
|
1054
|
+
* Visibility
|
|
1055
|
+
* @see https://tailwindcss.com/docs/visibility
|
|
1056
|
+
*/
|
|
1057
|
+
visibility: [
|
|
1058
|
+
"visible",
|
|
1059
|
+
"invisible",
|
|
1060
|
+
"collapse"
|
|
1061
|
+
],
|
|
1062
|
+
/**
|
|
1063
|
+
* Z-Index
|
|
1064
|
+
* @see https://tailwindcss.com/docs/z-index
|
|
1065
|
+
*/
|
|
1066
|
+
z: [{ z: [
|
|
1067
|
+
"auto",
|
|
1068
|
+
isInteger,
|
|
1069
|
+
isArbitraryValue
|
|
1070
|
+
] }],
|
|
1071
|
+
/**
|
|
1072
|
+
* Flex Basis
|
|
1073
|
+
* @see https://tailwindcss.com/docs/flex-basis
|
|
1074
|
+
*/
|
|
1075
|
+
basis: [{ basis: getSpacingWithAutoAndArbitrary() }],
|
|
1076
|
+
/**
|
|
1077
|
+
* Flex Direction
|
|
1078
|
+
* @see https://tailwindcss.com/docs/flex-direction
|
|
1079
|
+
*/
|
|
1080
|
+
"flex-direction": [{ flex: [
|
|
1081
|
+
"row",
|
|
1082
|
+
"row-reverse",
|
|
1083
|
+
"col",
|
|
1084
|
+
"col-reverse"
|
|
1085
|
+
] }],
|
|
1086
|
+
/**
|
|
1087
|
+
* Flex Wrap
|
|
1088
|
+
* @see https://tailwindcss.com/docs/flex-wrap
|
|
1089
|
+
*/
|
|
1090
|
+
"flex-wrap": [{ flex: [
|
|
1091
|
+
"wrap",
|
|
1092
|
+
"wrap-reverse",
|
|
1093
|
+
"nowrap"
|
|
1094
|
+
] }],
|
|
1095
|
+
/**
|
|
1096
|
+
* Flex
|
|
1097
|
+
* @see https://tailwindcss.com/docs/flex
|
|
1098
|
+
*/
|
|
1099
|
+
flex: [{ flex: [
|
|
1100
|
+
"1",
|
|
1101
|
+
"auto",
|
|
1102
|
+
"initial",
|
|
1103
|
+
"none",
|
|
1104
|
+
isArbitraryValue
|
|
1105
|
+
] }],
|
|
1106
|
+
/**
|
|
1107
|
+
* Flex Grow
|
|
1108
|
+
* @see https://tailwindcss.com/docs/flex-grow
|
|
1109
|
+
*/
|
|
1110
|
+
grow: [{ grow: getZeroAndEmpty() }],
|
|
1111
|
+
/**
|
|
1112
|
+
* Flex Shrink
|
|
1113
|
+
* @see https://tailwindcss.com/docs/flex-shrink
|
|
1114
|
+
*/
|
|
1115
|
+
shrink: [{ shrink: getZeroAndEmpty() }],
|
|
1116
|
+
/**
|
|
1117
|
+
* Order
|
|
1118
|
+
* @see https://tailwindcss.com/docs/order
|
|
1119
|
+
*/
|
|
1120
|
+
order: [{ order: [
|
|
1121
|
+
"first",
|
|
1122
|
+
"last",
|
|
1123
|
+
"none",
|
|
1124
|
+
isInteger,
|
|
1125
|
+
isArbitraryValue
|
|
1126
|
+
] }],
|
|
1127
|
+
/**
|
|
1128
|
+
* Grid Template Columns
|
|
1129
|
+
* @see https://tailwindcss.com/docs/grid-template-columns
|
|
1130
|
+
*/
|
|
1131
|
+
"grid-cols": [{ "grid-cols": [isAny] }],
|
|
1132
|
+
/**
|
|
1133
|
+
* Grid Column Start / End
|
|
1134
|
+
* @see https://tailwindcss.com/docs/grid-column
|
|
1135
|
+
*/
|
|
1136
|
+
"col-start-end": [{ col: [
|
|
1137
|
+
"auto",
|
|
1138
|
+
{ span: [
|
|
1139
|
+
"full",
|
|
1140
|
+
isInteger,
|
|
1141
|
+
isArbitraryValue
|
|
1142
|
+
] },
|
|
1143
|
+
isArbitraryValue
|
|
1144
|
+
] }],
|
|
1145
|
+
/**
|
|
1146
|
+
* Grid Column Start
|
|
1147
|
+
* @see https://tailwindcss.com/docs/grid-column
|
|
1148
|
+
*/
|
|
1149
|
+
"col-start": [{ "col-start": getNumberWithAutoAndArbitrary() }],
|
|
1150
|
+
/**
|
|
1151
|
+
* Grid Column End
|
|
1152
|
+
* @see https://tailwindcss.com/docs/grid-column
|
|
1153
|
+
*/
|
|
1154
|
+
"col-end": [{ "col-end": getNumberWithAutoAndArbitrary() }],
|
|
1155
|
+
/**
|
|
1156
|
+
* Grid Template Rows
|
|
1157
|
+
* @see https://tailwindcss.com/docs/grid-template-rows
|
|
1158
|
+
*/
|
|
1159
|
+
"grid-rows": [{ "grid-rows": [isAny] }],
|
|
1160
|
+
/**
|
|
1161
|
+
* Grid Row Start / End
|
|
1162
|
+
* @see https://tailwindcss.com/docs/grid-row
|
|
1163
|
+
*/
|
|
1164
|
+
"row-start-end": [{ row: [
|
|
1165
|
+
"auto",
|
|
1166
|
+
{ span: [isInteger, isArbitraryValue] },
|
|
1167
|
+
isArbitraryValue
|
|
1168
|
+
] }],
|
|
1169
|
+
/**
|
|
1170
|
+
* Grid Row Start
|
|
1171
|
+
* @see https://tailwindcss.com/docs/grid-row
|
|
1172
|
+
*/
|
|
1173
|
+
"row-start": [{ "row-start": getNumberWithAutoAndArbitrary() }],
|
|
1174
|
+
/**
|
|
1175
|
+
* Grid Row End
|
|
1176
|
+
* @see https://tailwindcss.com/docs/grid-row
|
|
1177
|
+
*/
|
|
1178
|
+
"row-end": [{ "row-end": getNumberWithAutoAndArbitrary() }],
|
|
1179
|
+
/**
|
|
1180
|
+
* Grid Auto Flow
|
|
1181
|
+
* @see https://tailwindcss.com/docs/grid-auto-flow
|
|
1182
|
+
*/
|
|
1183
|
+
"grid-flow": [{ "grid-flow": [
|
|
1184
|
+
"row",
|
|
1185
|
+
"col",
|
|
1186
|
+
"dense",
|
|
1187
|
+
"row-dense",
|
|
1188
|
+
"col-dense"
|
|
1189
|
+
] }],
|
|
1190
|
+
/**
|
|
1191
|
+
* Grid Auto Columns
|
|
1192
|
+
* @see https://tailwindcss.com/docs/grid-auto-columns
|
|
1193
|
+
*/
|
|
1194
|
+
"auto-cols": [{ "auto-cols": [
|
|
1195
|
+
"auto",
|
|
1196
|
+
"min",
|
|
1197
|
+
"max",
|
|
1198
|
+
"fr",
|
|
1199
|
+
isArbitraryValue
|
|
1200
|
+
] }],
|
|
1201
|
+
/**
|
|
1202
|
+
* Grid Auto Rows
|
|
1203
|
+
* @see https://tailwindcss.com/docs/grid-auto-rows
|
|
1204
|
+
*/
|
|
1205
|
+
"auto-rows": [{ "auto-rows": [
|
|
1206
|
+
"auto",
|
|
1207
|
+
"min",
|
|
1208
|
+
"max",
|
|
1209
|
+
"fr",
|
|
1210
|
+
isArbitraryValue
|
|
1211
|
+
] }],
|
|
1212
|
+
/**
|
|
1213
|
+
* Gap
|
|
1214
|
+
* @see https://tailwindcss.com/docs/gap
|
|
1215
|
+
*/
|
|
1216
|
+
gap: [{ gap: [gap] }],
|
|
1217
|
+
/**
|
|
1218
|
+
* Gap X
|
|
1219
|
+
* @see https://tailwindcss.com/docs/gap
|
|
1220
|
+
*/
|
|
1221
|
+
"gap-x": [{ "gap-x": [gap] }],
|
|
1222
|
+
/**
|
|
1223
|
+
* Gap Y
|
|
1224
|
+
* @see https://tailwindcss.com/docs/gap
|
|
1225
|
+
*/
|
|
1226
|
+
"gap-y": [{ "gap-y": [gap] }],
|
|
1227
|
+
/**
|
|
1228
|
+
* Justify Content
|
|
1229
|
+
* @see https://tailwindcss.com/docs/justify-content
|
|
1230
|
+
*/
|
|
1231
|
+
"justify-content": [{ justify: ["normal", ...getAlign()] }],
|
|
1232
|
+
/**
|
|
1233
|
+
* Justify Items
|
|
1234
|
+
* @see https://tailwindcss.com/docs/justify-items
|
|
1235
|
+
*/
|
|
1236
|
+
"justify-items": [{ "justify-items": [
|
|
1237
|
+
"start",
|
|
1238
|
+
"end",
|
|
1239
|
+
"center",
|
|
1240
|
+
"stretch"
|
|
1241
|
+
] }],
|
|
1242
|
+
/**
|
|
1243
|
+
* Justify Self
|
|
1244
|
+
* @see https://tailwindcss.com/docs/justify-self
|
|
1245
|
+
*/
|
|
1246
|
+
"justify-self": [{ "justify-self": [
|
|
1247
|
+
"auto",
|
|
1248
|
+
"start",
|
|
1249
|
+
"end",
|
|
1250
|
+
"center",
|
|
1251
|
+
"stretch"
|
|
1252
|
+
] }],
|
|
1253
|
+
/**
|
|
1254
|
+
* Align Content
|
|
1255
|
+
* @see https://tailwindcss.com/docs/align-content
|
|
1256
|
+
*/
|
|
1257
|
+
"align-content": [{ content: [
|
|
1258
|
+
"normal",
|
|
1259
|
+
...getAlign(),
|
|
1260
|
+
"baseline"
|
|
1261
|
+
] }],
|
|
1262
|
+
/**
|
|
1263
|
+
* Align Items
|
|
1264
|
+
* @see https://tailwindcss.com/docs/align-items
|
|
1265
|
+
*/
|
|
1266
|
+
"align-items": [{ items: [
|
|
1267
|
+
"start",
|
|
1268
|
+
"end",
|
|
1269
|
+
"center",
|
|
1270
|
+
"baseline",
|
|
1271
|
+
"stretch"
|
|
1272
|
+
] }],
|
|
1273
|
+
/**
|
|
1274
|
+
* Align Self
|
|
1275
|
+
* @see https://tailwindcss.com/docs/align-self
|
|
1276
|
+
*/
|
|
1277
|
+
"align-self": [{ self: [
|
|
1278
|
+
"auto",
|
|
1279
|
+
"start",
|
|
1280
|
+
"end",
|
|
1281
|
+
"center",
|
|
1282
|
+
"stretch",
|
|
1283
|
+
"baseline"
|
|
1284
|
+
] }],
|
|
1285
|
+
/**
|
|
1286
|
+
* Place Content
|
|
1287
|
+
* @see https://tailwindcss.com/docs/place-content
|
|
1288
|
+
*/
|
|
1289
|
+
"place-content": [{ "place-content": [...getAlign(), "baseline"] }],
|
|
1290
|
+
/**
|
|
1291
|
+
* Place Items
|
|
1292
|
+
* @see https://tailwindcss.com/docs/place-items
|
|
1293
|
+
*/
|
|
1294
|
+
"place-items": [{ "place-items": [
|
|
1295
|
+
"start",
|
|
1296
|
+
"end",
|
|
1297
|
+
"center",
|
|
1298
|
+
"baseline",
|
|
1299
|
+
"stretch"
|
|
1300
|
+
] }],
|
|
1301
|
+
/**
|
|
1302
|
+
* Place Self
|
|
1303
|
+
* @see https://tailwindcss.com/docs/place-self
|
|
1304
|
+
*/
|
|
1305
|
+
"place-self": [{ "place-self": [
|
|
1306
|
+
"auto",
|
|
1307
|
+
"start",
|
|
1308
|
+
"end",
|
|
1309
|
+
"center",
|
|
1310
|
+
"stretch"
|
|
1311
|
+
] }],
|
|
1312
|
+
/**
|
|
1313
|
+
* Padding
|
|
1314
|
+
* @see https://tailwindcss.com/docs/padding
|
|
1315
|
+
*/
|
|
1316
|
+
p: [{ p: [padding] }],
|
|
1317
|
+
/**
|
|
1318
|
+
* Padding X
|
|
1319
|
+
* @see https://tailwindcss.com/docs/padding
|
|
1320
|
+
*/
|
|
1321
|
+
px: [{ px: [padding] }],
|
|
1322
|
+
/**
|
|
1323
|
+
* Padding Y
|
|
1324
|
+
* @see https://tailwindcss.com/docs/padding
|
|
1325
|
+
*/
|
|
1326
|
+
py: [{ py: [padding] }],
|
|
1327
|
+
/**
|
|
1328
|
+
* Padding Start
|
|
1329
|
+
* @see https://tailwindcss.com/docs/padding
|
|
1330
|
+
*/
|
|
1331
|
+
ps: [{ ps: [padding] }],
|
|
1332
|
+
/**
|
|
1333
|
+
* Padding End
|
|
1334
|
+
* @see https://tailwindcss.com/docs/padding
|
|
1335
|
+
*/
|
|
1336
|
+
pe: [{ pe: [padding] }],
|
|
1337
|
+
/**
|
|
1338
|
+
* Padding Top
|
|
1339
|
+
* @see https://tailwindcss.com/docs/padding
|
|
1340
|
+
*/
|
|
1341
|
+
pt: [{ pt: [padding] }],
|
|
1342
|
+
/**
|
|
1343
|
+
* Padding Right
|
|
1344
|
+
* @see https://tailwindcss.com/docs/padding
|
|
1345
|
+
*/
|
|
1346
|
+
pr: [{ pr: [padding] }],
|
|
1347
|
+
/**
|
|
1348
|
+
* Padding Bottom
|
|
1349
|
+
* @see https://tailwindcss.com/docs/padding
|
|
1350
|
+
*/
|
|
1351
|
+
pb: [{ pb: [padding] }],
|
|
1352
|
+
/**
|
|
1353
|
+
* Padding Left
|
|
1354
|
+
* @see https://tailwindcss.com/docs/padding
|
|
1355
|
+
*/
|
|
1356
|
+
pl: [{ pl: [padding] }],
|
|
1357
|
+
/**
|
|
1358
|
+
* Margin
|
|
1359
|
+
* @see https://tailwindcss.com/docs/margin
|
|
1360
|
+
*/
|
|
1361
|
+
m: [{ m: [margin] }],
|
|
1362
|
+
/**
|
|
1363
|
+
* Margin X
|
|
1364
|
+
* @see https://tailwindcss.com/docs/margin
|
|
1365
|
+
*/
|
|
1366
|
+
mx: [{ mx: [margin] }],
|
|
1367
|
+
/**
|
|
1368
|
+
* Margin Y
|
|
1369
|
+
* @see https://tailwindcss.com/docs/margin
|
|
1370
|
+
*/
|
|
1371
|
+
my: [{ my: [margin] }],
|
|
1372
|
+
/**
|
|
1373
|
+
* Margin Start
|
|
1374
|
+
* @see https://tailwindcss.com/docs/margin
|
|
1375
|
+
*/
|
|
1376
|
+
ms: [{ ms: [margin] }],
|
|
1377
|
+
/**
|
|
1378
|
+
* Margin End
|
|
1379
|
+
* @see https://tailwindcss.com/docs/margin
|
|
1380
|
+
*/
|
|
1381
|
+
me: [{ me: [margin] }],
|
|
1382
|
+
/**
|
|
1383
|
+
* Margin Top
|
|
1384
|
+
* @see https://tailwindcss.com/docs/margin
|
|
1385
|
+
*/
|
|
1386
|
+
mt: [{ mt: [margin] }],
|
|
1387
|
+
/**
|
|
1388
|
+
* Margin Right
|
|
1389
|
+
* @see https://tailwindcss.com/docs/margin
|
|
1390
|
+
*/
|
|
1391
|
+
mr: [{ mr: [margin] }],
|
|
1392
|
+
/**
|
|
1393
|
+
* Margin Bottom
|
|
1394
|
+
* @see https://tailwindcss.com/docs/margin
|
|
1395
|
+
*/
|
|
1396
|
+
mb: [{ mb: [margin] }],
|
|
1397
|
+
/**
|
|
1398
|
+
* Margin Left
|
|
1399
|
+
* @see https://tailwindcss.com/docs/margin
|
|
1400
|
+
*/
|
|
1401
|
+
ml: [{ ml: [margin] }],
|
|
1402
|
+
/**
|
|
1403
|
+
* Space Between X
|
|
1404
|
+
* @see https://tailwindcss.com/docs/space
|
|
1405
|
+
*/
|
|
1406
|
+
"space-x": [{ "space-x": [space] }],
|
|
1407
|
+
/**
|
|
1408
|
+
* Space Between X Reverse
|
|
1409
|
+
* @see https://tailwindcss.com/docs/space
|
|
1410
|
+
*/
|
|
1411
|
+
"space-x-reverse": ["space-x-reverse"],
|
|
1412
|
+
/**
|
|
1413
|
+
* Space Between Y
|
|
1414
|
+
* @see https://tailwindcss.com/docs/space
|
|
1415
|
+
*/
|
|
1416
|
+
"space-y": [{ "space-y": [space] }],
|
|
1417
|
+
/**
|
|
1418
|
+
* Space Between Y Reverse
|
|
1419
|
+
* @see https://tailwindcss.com/docs/space
|
|
1420
|
+
*/
|
|
1421
|
+
"space-y-reverse": ["space-y-reverse"],
|
|
1422
|
+
/**
|
|
1423
|
+
* Width
|
|
1424
|
+
* @see https://tailwindcss.com/docs/width
|
|
1425
|
+
*/
|
|
1426
|
+
w: [{ w: [
|
|
1427
|
+
"auto",
|
|
1428
|
+
"min",
|
|
1429
|
+
"max",
|
|
1430
|
+
"fit",
|
|
1431
|
+
"svw",
|
|
1432
|
+
"lvw",
|
|
1433
|
+
"dvw",
|
|
1434
|
+
isArbitraryValue,
|
|
1435
|
+
spacing
|
|
1436
|
+
] }],
|
|
1437
|
+
/**
|
|
1438
|
+
* Min-Width
|
|
1439
|
+
* @see https://tailwindcss.com/docs/min-width
|
|
1440
|
+
*/
|
|
1441
|
+
"min-w": [{ "min-w": [
|
|
1442
|
+
isArbitraryValue,
|
|
1443
|
+
spacing,
|
|
1444
|
+
"min",
|
|
1445
|
+
"max",
|
|
1446
|
+
"fit"
|
|
1447
|
+
] }],
|
|
1448
|
+
/**
|
|
1449
|
+
* Max-Width
|
|
1450
|
+
* @see https://tailwindcss.com/docs/max-width
|
|
1451
|
+
*/
|
|
1452
|
+
"max-w": [{ "max-w": [
|
|
1453
|
+
isArbitraryValue,
|
|
1454
|
+
spacing,
|
|
1455
|
+
"none",
|
|
1456
|
+
"full",
|
|
1457
|
+
"min",
|
|
1458
|
+
"max",
|
|
1459
|
+
"fit",
|
|
1460
|
+
"prose",
|
|
1461
|
+
{ screen: [isTshirtSize] },
|
|
1462
|
+
isTshirtSize
|
|
1463
|
+
] }],
|
|
1464
|
+
/**
|
|
1465
|
+
* Height
|
|
1466
|
+
* @see https://tailwindcss.com/docs/height
|
|
1467
|
+
*/
|
|
1468
|
+
h: [{ h: [
|
|
1469
|
+
isArbitraryValue,
|
|
1470
|
+
spacing,
|
|
1471
|
+
"auto",
|
|
1472
|
+
"min",
|
|
1473
|
+
"max",
|
|
1474
|
+
"fit",
|
|
1475
|
+
"svh",
|
|
1476
|
+
"lvh",
|
|
1477
|
+
"dvh"
|
|
1478
|
+
] }],
|
|
1479
|
+
/**
|
|
1480
|
+
* Min-Height
|
|
1481
|
+
* @see https://tailwindcss.com/docs/min-height
|
|
1482
|
+
*/
|
|
1483
|
+
"min-h": [{ "min-h": [
|
|
1484
|
+
isArbitraryValue,
|
|
1485
|
+
spacing,
|
|
1486
|
+
"min",
|
|
1487
|
+
"max",
|
|
1488
|
+
"fit",
|
|
1489
|
+
"svh",
|
|
1490
|
+
"lvh",
|
|
1491
|
+
"dvh"
|
|
1492
|
+
] }],
|
|
1493
|
+
/**
|
|
1494
|
+
* Max-Height
|
|
1495
|
+
* @see https://tailwindcss.com/docs/max-height
|
|
1496
|
+
*/
|
|
1497
|
+
"max-h": [{ "max-h": [
|
|
1498
|
+
isArbitraryValue,
|
|
1499
|
+
spacing,
|
|
1500
|
+
"min",
|
|
1501
|
+
"max",
|
|
1502
|
+
"fit",
|
|
1503
|
+
"svh",
|
|
1504
|
+
"lvh",
|
|
1505
|
+
"dvh"
|
|
1506
|
+
] }],
|
|
1507
|
+
/**
|
|
1508
|
+
* Size
|
|
1509
|
+
* @see https://tailwindcss.com/docs/size
|
|
1510
|
+
*/
|
|
1511
|
+
size: [{ size: [
|
|
1512
|
+
isArbitraryValue,
|
|
1513
|
+
spacing,
|
|
1514
|
+
"auto",
|
|
1515
|
+
"min",
|
|
1516
|
+
"max",
|
|
1517
|
+
"fit"
|
|
1518
|
+
] }],
|
|
1519
|
+
/**
|
|
1520
|
+
* Font Size
|
|
1521
|
+
* @see https://tailwindcss.com/docs/font-size
|
|
1522
|
+
*/
|
|
1523
|
+
"font-size": [{ text: [
|
|
1524
|
+
"base",
|
|
1525
|
+
isTshirtSize,
|
|
1526
|
+
isArbitraryLength
|
|
1527
|
+
] }],
|
|
1528
|
+
/**
|
|
1529
|
+
* Font Smoothing
|
|
1530
|
+
* @see https://tailwindcss.com/docs/font-smoothing
|
|
1531
|
+
*/
|
|
1532
|
+
"font-smoothing": ["antialiased", "subpixel-antialiased"],
|
|
1533
|
+
/**
|
|
1534
|
+
* Font Style
|
|
1535
|
+
* @see https://tailwindcss.com/docs/font-style
|
|
1536
|
+
*/
|
|
1537
|
+
"font-style": ["italic", "not-italic"],
|
|
1538
|
+
/**
|
|
1539
|
+
* Font Weight
|
|
1540
|
+
* @see https://tailwindcss.com/docs/font-weight
|
|
1541
|
+
*/
|
|
1542
|
+
"font-weight": [{ font: [
|
|
1543
|
+
"thin",
|
|
1544
|
+
"extralight",
|
|
1545
|
+
"light",
|
|
1546
|
+
"normal",
|
|
1547
|
+
"medium",
|
|
1548
|
+
"semibold",
|
|
1549
|
+
"bold",
|
|
1550
|
+
"extrabold",
|
|
1551
|
+
"black",
|
|
1552
|
+
isArbitraryNumber
|
|
1553
|
+
] }],
|
|
1554
|
+
/**
|
|
1555
|
+
* Font Family
|
|
1556
|
+
* @see https://tailwindcss.com/docs/font-family
|
|
1557
|
+
*/
|
|
1558
|
+
"font-family": [{ font: [isAny] }],
|
|
1559
|
+
/**
|
|
1560
|
+
* Font Variant Numeric
|
|
1561
|
+
* @see https://tailwindcss.com/docs/font-variant-numeric
|
|
1562
|
+
*/
|
|
1563
|
+
"fvn-normal": ["normal-nums"],
|
|
1564
|
+
/**
|
|
1565
|
+
* Font Variant Numeric
|
|
1566
|
+
* @see https://tailwindcss.com/docs/font-variant-numeric
|
|
1567
|
+
*/
|
|
1568
|
+
"fvn-ordinal": ["ordinal"],
|
|
1569
|
+
/**
|
|
1570
|
+
* Font Variant Numeric
|
|
1571
|
+
* @see https://tailwindcss.com/docs/font-variant-numeric
|
|
1572
|
+
*/
|
|
1573
|
+
"fvn-slashed-zero": ["slashed-zero"],
|
|
1574
|
+
/**
|
|
1575
|
+
* Font Variant Numeric
|
|
1576
|
+
* @see https://tailwindcss.com/docs/font-variant-numeric
|
|
1577
|
+
*/
|
|
1578
|
+
"fvn-figure": ["lining-nums", "oldstyle-nums"],
|
|
1579
|
+
/**
|
|
1580
|
+
* Font Variant Numeric
|
|
1581
|
+
* @see https://tailwindcss.com/docs/font-variant-numeric
|
|
1582
|
+
*/
|
|
1583
|
+
"fvn-spacing": ["proportional-nums", "tabular-nums"],
|
|
1584
|
+
/**
|
|
1585
|
+
* Font Variant Numeric
|
|
1586
|
+
* @see https://tailwindcss.com/docs/font-variant-numeric
|
|
1587
|
+
*/
|
|
1588
|
+
"fvn-fraction": ["diagonal-fractions", "stacked-fractions"],
|
|
1589
|
+
/**
|
|
1590
|
+
* Letter Spacing
|
|
1591
|
+
* @see https://tailwindcss.com/docs/letter-spacing
|
|
1592
|
+
*/
|
|
1593
|
+
tracking: [{ tracking: [
|
|
1594
|
+
"tighter",
|
|
1595
|
+
"tight",
|
|
1596
|
+
"normal",
|
|
1597
|
+
"wide",
|
|
1598
|
+
"wider",
|
|
1599
|
+
"widest",
|
|
1600
|
+
isArbitraryValue
|
|
1601
|
+
] }],
|
|
1602
|
+
/**
|
|
1603
|
+
* Line Clamp
|
|
1604
|
+
* @see https://tailwindcss.com/docs/line-clamp
|
|
1605
|
+
*/
|
|
1606
|
+
"line-clamp": [{ "line-clamp": [
|
|
1607
|
+
"none",
|
|
1608
|
+
isNumber,
|
|
1609
|
+
isArbitraryNumber
|
|
1610
|
+
] }],
|
|
1611
|
+
/**
|
|
1612
|
+
* Line Height
|
|
1613
|
+
* @see https://tailwindcss.com/docs/line-height
|
|
1614
|
+
*/
|
|
1615
|
+
leading: [{ leading: [
|
|
1616
|
+
"none",
|
|
1617
|
+
"tight",
|
|
1618
|
+
"snug",
|
|
1619
|
+
"normal",
|
|
1620
|
+
"relaxed",
|
|
1621
|
+
"loose",
|
|
1622
|
+
isLength,
|
|
1623
|
+
isArbitraryValue
|
|
1624
|
+
] }],
|
|
1625
|
+
/**
|
|
1626
|
+
* List Style Image
|
|
1627
|
+
* @see https://tailwindcss.com/docs/list-style-image
|
|
1628
|
+
*/
|
|
1629
|
+
"list-image": [{ "list-image": ["none", isArbitraryValue] }],
|
|
1630
|
+
/**
|
|
1631
|
+
* List Style Type
|
|
1632
|
+
* @see https://tailwindcss.com/docs/list-style-type
|
|
1633
|
+
*/
|
|
1634
|
+
"list-style-type": [{ list: [
|
|
1635
|
+
"none",
|
|
1636
|
+
"disc",
|
|
1637
|
+
"decimal",
|
|
1638
|
+
isArbitraryValue
|
|
1639
|
+
] }],
|
|
1640
|
+
/**
|
|
1641
|
+
* List Style Position
|
|
1642
|
+
* @see https://tailwindcss.com/docs/list-style-position
|
|
1643
|
+
*/
|
|
1644
|
+
"list-style-position": [{ list: ["inside", "outside"] }],
|
|
1645
|
+
/**
|
|
1646
|
+
* Placeholder Color
|
|
1647
|
+
* @deprecated since Tailwind CSS v3.0.0
|
|
1648
|
+
* @see https://tailwindcss.com/docs/placeholder-color
|
|
1649
|
+
*/
|
|
1650
|
+
"placeholder-color": [{ placeholder: [colors] }],
|
|
1651
|
+
/**
|
|
1652
|
+
* Placeholder Opacity
|
|
1653
|
+
* @see https://tailwindcss.com/docs/placeholder-opacity
|
|
1654
|
+
*/
|
|
1655
|
+
"placeholder-opacity": [{ "placeholder-opacity": [opacity] }],
|
|
1656
|
+
/**
|
|
1657
|
+
* Text Alignment
|
|
1658
|
+
* @see https://tailwindcss.com/docs/text-align
|
|
1659
|
+
*/
|
|
1660
|
+
"text-alignment": [{ text: [
|
|
1661
|
+
"left",
|
|
1662
|
+
"center",
|
|
1663
|
+
"right",
|
|
1664
|
+
"justify",
|
|
1665
|
+
"start",
|
|
1666
|
+
"end"
|
|
1667
|
+
] }],
|
|
1668
|
+
/**
|
|
1669
|
+
* Text Color
|
|
1670
|
+
* @see https://tailwindcss.com/docs/text-color
|
|
1671
|
+
*/
|
|
1672
|
+
"text-color": [{ text: [colors] }],
|
|
1673
|
+
/**
|
|
1674
|
+
* Text Opacity
|
|
1675
|
+
* @see https://tailwindcss.com/docs/text-opacity
|
|
1676
|
+
*/
|
|
1677
|
+
"text-opacity": [{ "text-opacity": [opacity] }],
|
|
1678
|
+
/**
|
|
1679
|
+
* Text Decoration
|
|
1680
|
+
* @see https://tailwindcss.com/docs/text-decoration
|
|
1681
|
+
*/
|
|
1682
|
+
"text-decoration": [
|
|
1683
|
+
"underline",
|
|
1684
|
+
"overline",
|
|
1685
|
+
"line-through",
|
|
1686
|
+
"no-underline"
|
|
1687
|
+
],
|
|
1688
|
+
/**
|
|
1689
|
+
* Text Decoration Style
|
|
1690
|
+
* @see https://tailwindcss.com/docs/text-decoration-style
|
|
1691
|
+
*/
|
|
1692
|
+
"text-decoration-style": [{ decoration: [...getLineStyles(), "wavy"] }],
|
|
1693
|
+
/**
|
|
1694
|
+
* Text Decoration Thickness
|
|
1695
|
+
* @see https://tailwindcss.com/docs/text-decoration-thickness
|
|
1696
|
+
*/
|
|
1697
|
+
"text-decoration-thickness": [{ decoration: [
|
|
1698
|
+
"auto",
|
|
1699
|
+
"from-font",
|
|
1700
|
+
isLength,
|
|
1701
|
+
isArbitraryLength
|
|
1702
|
+
] }],
|
|
1703
|
+
/**
|
|
1704
|
+
* Text Underline Offset
|
|
1705
|
+
* @see https://tailwindcss.com/docs/text-underline-offset
|
|
1706
|
+
*/
|
|
1707
|
+
"underline-offset": [{ "underline-offset": [
|
|
1708
|
+
"auto",
|
|
1709
|
+
isLength,
|
|
1710
|
+
isArbitraryValue
|
|
1711
|
+
] }],
|
|
1712
|
+
/**
|
|
1713
|
+
* Text Decoration Color
|
|
1714
|
+
* @see https://tailwindcss.com/docs/text-decoration-color
|
|
1715
|
+
*/
|
|
1716
|
+
"text-decoration-color": [{ decoration: [colors] }],
|
|
1717
|
+
/**
|
|
1718
|
+
* Text Transform
|
|
1719
|
+
* @see https://tailwindcss.com/docs/text-transform
|
|
1720
|
+
*/
|
|
1721
|
+
"text-transform": [
|
|
1722
|
+
"uppercase",
|
|
1723
|
+
"lowercase",
|
|
1724
|
+
"capitalize",
|
|
1725
|
+
"normal-case"
|
|
1726
|
+
],
|
|
1727
|
+
/**
|
|
1728
|
+
* Text Overflow
|
|
1729
|
+
* @see https://tailwindcss.com/docs/text-overflow
|
|
1730
|
+
*/
|
|
1731
|
+
"text-overflow": [
|
|
1732
|
+
"truncate",
|
|
1733
|
+
"text-ellipsis",
|
|
1734
|
+
"text-clip"
|
|
1735
|
+
],
|
|
1736
|
+
/**
|
|
1737
|
+
* Text Wrap
|
|
1738
|
+
* @see https://tailwindcss.com/docs/text-wrap
|
|
1739
|
+
*/
|
|
1740
|
+
"text-wrap": [{ text: [
|
|
1741
|
+
"wrap",
|
|
1742
|
+
"nowrap",
|
|
1743
|
+
"balance",
|
|
1744
|
+
"pretty"
|
|
1745
|
+
] }],
|
|
1746
|
+
/**
|
|
1747
|
+
* Text Indent
|
|
1748
|
+
* @see https://tailwindcss.com/docs/text-indent
|
|
1749
|
+
*/
|
|
1750
|
+
indent: [{ indent: getSpacingWithArbitrary() }],
|
|
1751
|
+
/**
|
|
1752
|
+
* Vertical Alignment
|
|
1753
|
+
* @see https://tailwindcss.com/docs/vertical-align
|
|
1754
|
+
*/
|
|
1755
|
+
"vertical-align": [{ align: [
|
|
1756
|
+
"baseline",
|
|
1757
|
+
"top",
|
|
1758
|
+
"middle",
|
|
1759
|
+
"bottom",
|
|
1760
|
+
"text-top",
|
|
1761
|
+
"text-bottom",
|
|
1762
|
+
"sub",
|
|
1763
|
+
"super",
|
|
1764
|
+
isArbitraryValue
|
|
1765
|
+
] }],
|
|
1766
|
+
/**
|
|
1767
|
+
* Whitespace
|
|
1768
|
+
* @see https://tailwindcss.com/docs/whitespace
|
|
1769
|
+
*/
|
|
1770
|
+
whitespace: [{ whitespace: [
|
|
1771
|
+
"normal",
|
|
1772
|
+
"nowrap",
|
|
1773
|
+
"pre",
|
|
1774
|
+
"pre-line",
|
|
1775
|
+
"pre-wrap",
|
|
1776
|
+
"break-spaces"
|
|
1777
|
+
] }],
|
|
1778
|
+
/**
|
|
1779
|
+
* Word Break
|
|
1780
|
+
* @see https://tailwindcss.com/docs/word-break
|
|
1781
|
+
*/
|
|
1782
|
+
break: [{ break: [
|
|
1783
|
+
"normal",
|
|
1784
|
+
"words",
|
|
1785
|
+
"all",
|
|
1786
|
+
"keep"
|
|
1787
|
+
] }],
|
|
1788
|
+
/**
|
|
1789
|
+
* Hyphens
|
|
1790
|
+
* @see https://tailwindcss.com/docs/hyphens
|
|
1791
|
+
*/
|
|
1792
|
+
hyphens: [{ hyphens: [
|
|
1793
|
+
"none",
|
|
1794
|
+
"manual",
|
|
1795
|
+
"auto"
|
|
1796
|
+
] }],
|
|
1797
|
+
/**
|
|
1798
|
+
* Content
|
|
1799
|
+
* @see https://tailwindcss.com/docs/content
|
|
1800
|
+
*/
|
|
1801
|
+
content: [{ content: ["none", isArbitraryValue] }],
|
|
1802
|
+
/**
|
|
1803
|
+
* Background Attachment
|
|
1804
|
+
* @see https://tailwindcss.com/docs/background-attachment
|
|
1805
|
+
*/
|
|
1806
|
+
"bg-attachment": [{ bg: [
|
|
1807
|
+
"fixed",
|
|
1808
|
+
"local",
|
|
1809
|
+
"scroll"
|
|
1810
|
+
] }],
|
|
1811
|
+
/**
|
|
1812
|
+
* Background Clip
|
|
1813
|
+
* @see https://tailwindcss.com/docs/background-clip
|
|
1814
|
+
*/
|
|
1815
|
+
"bg-clip": [{ "bg-clip": [
|
|
1816
|
+
"border",
|
|
1817
|
+
"padding",
|
|
1818
|
+
"content",
|
|
1819
|
+
"text"
|
|
1820
|
+
] }],
|
|
1821
|
+
/**
|
|
1822
|
+
* Background Opacity
|
|
1823
|
+
* @deprecated since Tailwind CSS v3.0.0
|
|
1824
|
+
* @see https://tailwindcss.com/docs/background-opacity
|
|
1825
|
+
*/
|
|
1826
|
+
"bg-opacity": [{ "bg-opacity": [opacity] }],
|
|
1827
|
+
/**
|
|
1828
|
+
* Background Origin
|
|
1829
|
+
* @see https://tailwindcss.com/docs/background-origin
|
|
1830
|
+
*/
|
|
1831
|
+
"bg-origin": [{ "bg-origin": [
|
|
1832
|
+
"border",
|
|
1833
|
+
"padding",
|
|
1834
|
+
"content"
|
|
1835
|
+
] }],
|
|
1836
|
+
/**
|
|
1837
|
+
* Background Position
|
|
1838
|
+
* @see https://tailwindcss.com/docs/background-position
|
|
1839
|
+
*/
|
|
1840
|
+
"bg-position": [{ bg: [...getPositions(), isArbitraryPosition] }],
|
|
1841
|
+
/**
|
|
1842
|
+
* Background Repeat
|
|
1843
|
+
* @see https://tailwindcss.com/docs/background-repeat
|
|
1844
|
+
*/
|
|
1845
|
+
"bg-repeat": [{ bg: ["no-repeat", { repeat: [
|
|
1846
|
+
"",
|
|
1847
|
+
"x",
|
|
1848
|
+
"y",
|
|
1849
|
+
"round",
|
|
1850
|
+
"space"
|
|
1851
|
+
] }] }],
|
|
1852
|
+
/**
|
|
1853
|
+
* Background Size
|
|
1854
|
+
* @see https://tailwindcss.com/docs/background-size
|
|
1855
|
+
*/
|
|
1856
|
+
"bg-size": [{ bg: [
|
|
1857
|
+
"auto",
|
|
1858
|
+
"cover",
|
|
1859
|
+
"contain",
|
|
1860
|
+
isArbitrarySize
|
|
1861
|
+
] }],
|
|
1862
|
+
/**
|
|
1863
|
+
* Background Image
|
|
1864
|
+
* @see https://tailwindcss.com/docs/background-image
|
|
1865
|
+
*/
|
|
1866
|
+
"bg-image": [{ bg: [
|
|
1867
|
+
"none",
|
|
1868
|
+
{ "gradient-to": [
|
|
1869
|
+
"t",
|
|
1870
|
+
"tr",
|
|
1871
|
+
"r",
|
|
1872
|
+
"br",
|
|
1873
|
+
"b",
|
|
1874
|
+
"bl",
|
|
1875
|
+
"l",
|
|
1876
|
+
"tl"
|
|
1877
|
+
] },
|
|
1878
|
+
isArbitraryImage
|
|
1879
|
+
] }],
|
|
1880
|
+
/**
|
|
1881
|
+
* Background Color
|
|
1882
|
+
* @see https://tailwindcss.com/docs/background-color
|
|
1883
|
+
*/
|
|
1884
|
+
"bg-color": [{ bg: [colors] }],
|
|
1885
|
+
/**
|
|
1886
|
+
* Gradient Color Stops From Position
|
|
1887
|
+
* @see https://tailwindcss.com/docs/gradient-color-stops
|
|
1888
|
+
*/
|
|
1889
|
+
"gradient-from-pos": [{ from: [gradientColorStopPositions] }],
|
|
1890
|
+
/**
|
|
1891
|
+
* Gradient Color Stops Via Position
|
|
1892
|
+
* @see https://tailwindcss.com/docs/gradient-color-stops
|
|
1893
|
+
*/
|
|
1894
|
+
"gradient-via-pos": [{ via: [gradientColorStopPositions] }],
|
|
1895
|
+
/**
|
|
1896
|
+
* Gradient Color Stops To Position
|
|
1897
|
+
* @see https://tailwindcss.com/docs/gradient-color-stops
|
|
1898
|
+
*/
|
|
1899
|
+
"gradient-to-pos": [{ to: [gradientColorStopPositions] }],
|
|
1900
|
+
/**
|
|
1901
|
+
* Gradient Color Stops From
|
|
1902
|
+
* @see https://tailwindcss.com/docs/gradient-color-stops
|
|
1903
|
+
*/
|
|
1904
|
+
"gradient-from": [{ from: [gradientColorStops] }],
|
|
1905
|
+
/**
|
|
1906
|
+
* Gradient Color Stops Via
|
|
1907
|
+
* @see https://tailwindcss.com/docs/gradient-color-stops
|
|
1908
|
+
*/
|
|
1909
|
+
"gradient-via": [{ via: [gradientColorStops] }],
|
|
1910
|
+
/**
|
|
1911
|
+
* Gradient Color Stops To
|
|
1912
|
+
* @see https://tailwindcss.com/docs/gradient-color-stops
|
|
1913
|
+
*/
|
|
1914
|
+
"gradient-to": [{ to: [gradientColorStops] }],
|
|
1915
|
+
/**
|
|
1916
|
+
* Border Radius
|
|
1917
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
1918
|
+
*/
|
|
1919
|
+
rounded: [{ rounded: [borderRadius] }],
|
|
1920
|
+
/**
|
|
1921
|
+
* Border Radius Start
|
|
1922
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
1923
|
+
*/
|
|
1924
|
+
"rounded-s": [{ "rounded-s": [borderRadius] }],
|
|
1925
|
+
/**
|
|
1926
|
+
* Border Radius End
|
|
1927
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
1928
|
+
*/
|
|
1929
|
+
"rounded-e": [{ "rounded-e": [borderRadius] }],
|
|
1930
|
+
/**
|
|
1931
|
+
* Border Radius Top
|
|
1932
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
1933
|
+
*/
|
|
1934
|
+
"rounded-t": [{ "rounded-t": [borderRadius] }],
|
|
1935
|
+
/**
|
|
1936
|
+
* Border Radius Right
|
|
1937
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
1938
|
+
*/
|
|
1939
|
+
"rounded-r": [{ "rounded-r": [borderRadius] }],
|
|
1940
|
+
/**
|
|
1941
|
+
* Border Radius Bottom
|
|
1942
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
1943
|
+
*/
|
|
1944
|
+
"rounded-b": [{ "rounded-b": [borderRadius] }],
|
|
1945
|
+
/**
|
|
1946
|
+
* Border Radius Left
|
|
1947
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
1948
|
+
*/
|
|
1949
|
+
"rounded-l": [{ "rounded-l": [borderRadius] }],
|
|
1950
|
+
/**
|
|
1951
|
+
* Border Radius Start Start
|
|
1952
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
1953
|
+
*/
|
|
1954
|
+
"rounded-ss": [{ "rounded-ss": [borderRadius] }],
|
|
1955
|
+
/**
|
|
1956
|
+
* Border Radius Start End
|
|
1957
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
1958
|
+
*/
|
|
1959
|
+
"rounded-se": [{ "rounded-se": [borderRadius] }],
|
|
1960
|
+
/**
|
|
1961
|
+
* Border Radius End End
|
|
1962
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
1963
|
+
*/
|
|
1964
|
+
"rounded-ee": [{ "rounded-ee": [borderRadius] }],
|
|
1965
|
+
/**
|
|
1966
|
+
* Border Radius End Start
|
|
1967
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
1968
|
+
*/
|
|
1969
|
+
"rounded-es": [{ "rounded-es": [borderRadius] }],
|
|
1970
|
+
/**
|
|
1971
|
+
* Border Radius Top Left
|
|
1972
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
1973
|
+
*/
|
|
1974
|
+
"rounded-tl": [{ "rounded-tl": [borderRadius] }],
|
|
1975
|
+
/**
|
|
1976
|
+
* Border Radius Top Right
|
|
1977
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
1978
|
+
*/
|
|
1979
|
+
"rounded-tr": [{ "rounded-tr": [borderRadius] }],
|
|
1980
|
+
/**
|
|
1981
|
+
* Border Radius Bottom Right
|
|
1982
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
1983
|
+
*/
|
|
1984
|
+
"rounded-br": [{ "rounded-br": [borderRadius] }],
|
|
1985
|
+
/**
|
|
1986
|
+
* Border Radius Bottom Left
|
|
1987
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
1988
|
+
*/
|
|
1989
|
+
"rounded-bl": [{ "rounded-bl": [borderRadius] }],
|
|
1990
|
+
/**
|
|
1991
|
+
* Border Width
|
|
1992
|
+
* @see https://tailwindcss.com/docs/border-width
|
|
1993
|
+
*/
|
|
1994
|
+
"border-w": [{ border: [borderWidth] }],
|
|
1995
|
+
/**
|
|
1996
|
+
* Border Width X
|
|
1997
|
+
* @see https://tailwindcss.com/docs/border-width
|
|
1998
|
+
*/
|
|
1999
|
+
"border-w-x": [{ "border-x": [borderWidth] }],
|
|
2000
|
+
/**
|
|
2001
|
+
* Border Width Y
|
|
2002
|
+
* @see https://tailwindcss.com/docs/border-width
|
|
2003
|
+
*/
|
|
2004
|
+
"border-w-y": [{ "border-y": [borderWidth] }],
|
|
2005
|
+
/**
|
|
2006
|
+
* Border Width Start
|
|
2007
|
+
* @see https://tailwindcss.com/docs/border-width
|
|
2008
|
+
*/
|
|
2009
|
+
"border-w-s": [{ "border-s": [borderWidth] }],
|
|
2010
|
+
/**
|
|
2011
|
+
* Border Width End
|
|
2012
|
+
* @see https://tailwindcss.com/docs/border-width
|
|
2013
|
+
*/
|
|
2014
|
+
"border-w-e": [{ "border-e": [borderWidth] }],
|
|
2015
|
+
/**
|
|
2016
|
+
* Border Width Top
|
|
2017
|
+
* @see https://tailwindcss.com/docs/border-width
|
|
2018
|
+
*/
|
|
2019
|
+
"border-w-t": [{ "border-t": [borderWidth] }],
|
|
2020
|
+
/**
|
|
2021
|
+
* Border Width Right
|
|
2022
|
+
* @see https://tailwindcss.com/docs/border-width
|
|
2023
|
+
*/
|
|
2024
|
+
"border-w-r": [{ "border-r": [borderWidth] }],
|
|
2025
|
+
/**
|
|
2026
|
+
* Border Width Bottom
|
|
2027
|
+
* @see https://tailwindcss.com/docs/border-width
|
|
2028
|
+
*/
|
|
2029
|
+
"border-w-b": [{ "border-b": [borderWidth] }],
|
|
2030
|
+
/**
|
|
2031
|
+
* Border Width Left
|
|
2032
|
+
* @see https://tailwindcss.com/docs/border-width
|
|
2033
|
+
*/
|
|
2034
|
+
"border-w-l": [{ "border-l": [borderWidth] }],
|
|
2035
|
+
/**
|
|
2036
|
+
* Border Opacity
|
|
2037
|
+
* @see https://tailwindcss.com/docs/border-opacity
|
|
2038
|
+
*/
|
|
2039
|
+
"border-opacity": [{ "border-opacity": [opacity] }],
|
|
2040
|
+
/**
|
|
2041
|
+
* Border Style
|
|
2042
|
+
* @see https://tailwindcss.com/docs/border-style
|
|
2043
|
+
*/
|
|
2044
|
+
"border-style": [{ border: [...getLineStyles(), "hidden"] }],
|
|
2045
|
+
/**
|
|
2046
|
+
* Divide Width X
|
|
2047
|
+
* @see https://tailwindcss.com/docs/divide-width
|
|
2048
|
+
*/
|
|
2049
|
+
"divide-x": [{ "divide-x": [borderWidth] }],
|
|
2050
|
+
/**
|
|
2051
|
+
* Divide Width X Reverse
|
|
2052
|
+
* @see https://tailwindcss.com/docs/divide-width
|
|
2053
|
+
*/
|
|
2054
|
+
"divide-x-reverse": ["divide-x-reverse"],
|
|
2055
|
+
/**
|
|
2056
|
+
* Divide Width Y
|
|
2057
|
+
* @see https://tailwindcss.com/docs/divide-width
|
|
2058
|
+
*/
|
|
2059
|
+
"divide-y": [{ "divide-y": [borderWidth] }],
|
|
2060
|
+
/**
|
|
2061
|
+
* Divide Width Y Reverse
|
|
2062
|
+
* @see https://tailwindcss.com/docs/divide-width
|
|
2063
|
+
*/
|
|
2064
|
+
"divide-y-reverse": ["divide-y-reverse"],
|
|
2065
|
+
/**
|
|
2066
|
+
* Divide Opacity
|
|
2067
|
+
* @see https://tailwindcss.com/docs/divide-opacity
|
|
2068
|
+
*/
|
|
2069
|
+
"divide-opacity": [{ "divide-opacity": [opacity] }],
|
|
2070
|
+
/**
|
|
2071
|
+
* Divide Style
|
|
2072
|
+
* @see https://tailwindcss.com/docs/divide-style
|
|
2073
|
+
*/
|
|
2074
|
+
"divide-style": [{ divide: getLineStyles() }],
|
|
2075
|
+
/**
|
|
2076
|
+
* Border Color
|
|
2077
|
+
* @see https://tailwindcss.com/docs/border-color
|
|
2078
|
+
*/
|
|
2079
|
+
"border-color": [{ border: [borderColor] }],
|
|
2080
|
+
/**
|
|
2081
|
+
* Border Color X
|
|
2082
|
+
* @see https://tailwindcss.com/docs/border-color
|
|
2083
|
+
*/
|
|
2084
|
+
"border-color-x": [{ "border-x": [borderColor] }],
|
|
2085
|
+
/**
|
|
2086
|
+
* Border Color Y
|
|
2087
|
+
* @see https://tailwindcss.com/docs/border-color
|
|
2088
|
+
*/
|
|
2089
|
+
"border-color-y": [{ "border-y": [borderColor] }],
|
|
2090
|
+
/**
|
|
2091
|
+
* Border Color S
|
|
2092
|
+
* @see https://tailwindcss.com/docs/border-color
|
|
2093
|
+
*/
|
|
2094
|
+
"border-color-s": [{ "border-s": [borderColor] }],
|
|
2095
|
+
/**
|
|
2096
|
+
* Border Color E
|
|
2097
|
+
* @see https://tailwindcss.com/docs/border-color
|
|
2098
|
+
*/
|
|
2099
|
+
"border-color-e": [{ "border-e": [borderColor] }],
|
|
2100
|
+
/**
|
|
2101
|
+
* Border Color Top
|
|
2102
|
+
* @see https://tailwindcss.com/docs/border-color
|
|
2103
|
+
*/
|
|
2104
|
+
"border-color-t": [{ "border-t": [borderColor] }],
|
|
2105
|
+
/**
|
|
2106
|
+
* Border Color Right
|
|
2107
|
+
* @see https://tailwindcss.com/docs/border-color
|
|
2108
|
+
*/
|
|
2109
|
+
"border-color-r": [{ "border-r": [borderColor] }],
|
|
2110
|
+
/**
|
|
2111
|
+
* Border Color Bottom
|
|
2112
|
+
* @see https://tailwindcss.com/docs/border-color
|
|
2113
|
+
*/
|
|
2114
|
+
"border-color-b": [{ "border-b": [borderColor] }],
|
|
2115
|
+
/**
|
|
2116
|
+
* Border Color Left
|
|
2117
|
+
* @see https://tailwindcss.com/docs/border-color
|
|
2118
|
+
*/
|
|
2119
|
+
"border-color-l": [{ "border-l": [borderColor] }],
|
|
2120
|
+
/**
|
|
2121
|
+
* Divide Color
|
|
2122
|
+
* @see https://tailwindcss.com/docs/divide-color
|
|
2123
|
+
*/
|
|
2124
|
+
"divide-color": [{ divide: [borderColor] }],
|
|
2125
|
+
/**
|
|
2126
|
+
* Outline Style
|
|
2127
|
+
* @see https://tailwindcss.com/docs/outline-style
|
|
2128
|
+
*/
|
|
2129
|
+
"outline-style": [{ outline: ["", ...getLineStyles()] }],
|
|
2130
|
+
/**
|
|
2131
|
+
* Outline Offset
|
|
2132
|
+
* @see https://tailwindcss.com/docs/outline-offset
|
|
2133
|
+
*/
|
|
2134
|
+
"outline-offset": [{ "outline-offset": [isLength, isArbitraryValue] }],
|
|
2135
|
+
/**
|
|
2136
|
+
* Outline Width
|
|
2137
|
+
* @see https://tailwindcss.com/docs/outline-width
|
|
2138
|
+
*/
|
|
2139
|
+
"outline-w": [{ outline: [isLength, isArbitraryLength] }],
|
|
2140
|
+
/**
|
|
2141
|
+
* Outline Color
|
|
2142
|
+
* @see https://tailwindcss.com/docs/outline-color
|
|
2143
|
+
*/
|
|
2144
|
+
"outline-color": [{ outline: [colors] }],
|
|
2145
|
+
/**
|
|
2146
|
+
* Ring Width
|
|
2147
|
+
* @see https://tailwindcss.com/docs/ring-width
|
|
2148
|
+
*/
|
|
2149
|
+
"ring-w": [{ ring: getLengthWithEmptyAndArbitrary() }],
|
|
2150
|
+
/**
|
|
2151
|
+
* Ring Width Inset
|
|
2152
|
+
* @see https://tailwindcss.com/docs/ring-width
|
|
2153
|
+
*/
|
|
2154
|
+
"ring-w-inset": ["ring-inset"],
|
|
2155
|
+
/**
|
|
2156
|
+
* Ring Color
|
|
2157
|
+
* @see https://tailwindcss.com/docs/ring-color
|
|
2158
|
+
*/
|
|
2159
|
+
"ring-color": [{ ring: [colors] }],
|
|
2160
|
+
/**
|
|
2161
|
+
* Ring Opacity
|
|
2162
|
+
* @see https://tailwindcss.com/docs/ring-opacity
|
|
2163
|
+
*/
|
|
2164
|
+
"ring-opacity": [{ "ring-opacity": [opacity] }],
|
|
2165
|
+
/**
|
|
2166
|
+
* Ring Offset Width
|
|
2167
|
+
* @see https://tailwindcss.com/docs/ring-offset-width
|
|
2168
|
+
*/
|
|
2169
|
+
"ring-offset-w": [{ "ring-offset": [isLength, isArbitraryLength] }],
|
|
2170
|
+
/**
|
|
2171
|
+
* Ring Offset Color
|
|
2172
|
+
* @see https://tailwindcss.com/docs/ring-offset-color
|
|
2173
|
+
*/
|
|
2174
|
+
"ring-offset-color": [{ "ring-offset": [colors] }],
|
|
2175
|
+
/**
|
|
2176
|
+
* Box Shadow
|
|
2177
|
+
* @see https://tailwindcss.com/docs/box-shadow
|
|
2178
|
+
*/
|
|
2179
|
+
shadow: [{ shadow: [
|
|
2180
|
+
"",
|
|
2181
|
+
"inner",
|
|
2182
|
+
"none",
|
|
2183
|
+
isTshirtSize,
|
|
2184
|
+
isArbitraryShadow
|
|
2185
|
+
] }],
|
|
2186
|
+
/**
|
|
2187
|
+
* Box Shadow Color
|
|
2188
|
+
* @see https://tailwindcss.com/docs/box-shadow-color
|
|
2189
|
+
*/
|
|
2190
|
+
"shadow-color": [{ shadow: [isAny] }],
|
|
2191
|
+
/**
|
|
2192
|
+
* Opacity
|
|
2193
|
+
* @see https://tailwindcss.com/docs/opacity
|
|
2194
|
+
*/
|
|
2195
|
+
opacity: [{ opacity: [opacity] }],
|
|
2196
|
+
/**
|
|
2197
|
+
* Mix Blend Mode
|
|
2198
|
+
* @see https://tailwindcss.com/docs/mix-blend-mode
|
|
2199
|
+
*/
|
|
2200
|
+
"mix-blend": [{ "mix-blend": [
|
|
2201
|
+
...getBlendModes(),
|
|
2202
|
+
"plus-lighter",
|
|
2203
|
+
"plus-darker"
|
|
2204
|
+
] }],
|
|
2205
|
+
/**
|
|
2206
|
+
* Background Blend Mode
|
|
2207
|
+
* @see https://tailwindcss.com/docs/background-blend-mode
|
|
2208
|
+
*/
|
|
2209
|
+
"bg-blend": [{ "bg-blend": getBlendModes() }],
|
|
2210
|
+
/**
|
|
2211
|
+
* Filter
|
|
2212
|
+
* @deprecated since Tailwind CSS v3.0.0
|
|
2213
|
+
* @see https://tailwindcss.com/docs/filter
|
|
2214
|
+
*/
|
|
2215
|
+
filter: [{ filter: ["", "none"] }],
|
|
2216
|
+
/**
|
|
2217
|
+
* Blur
|
|
2218
|
+
* @see https://tailwindcss.com/docs/blur
|
|
2219
|
+
*/
|
|
2220
|
+
blur: [{ blur: [blur] }],
|
|
2221
|
+
/**
|
|
2222
|
+
* Brightness
|
|
2223
|
+
* @see https://tailwindcss.com/docs/brightness
|
|
2224
|
+
*/
|
|
2225
|
+
brightness: [{ brightness: [brightness] }],
|
|
2226
|
+
/**
|
|
2227
|
+
* Contrast
|
|
2228
|
+
* @see https://tailwindcss.com/docs/contrast
|
|
2229
|
+
*/
|
|
2230
|
+
contrast: [{ contrast: [contrast] }],
|
|
2231
|
+
/**
|
|
2232
|
+
* Drop Shadow
|
|
2233
|
+
* @see https://tailwindcss.com/docs/drop-shadow
|
|
2234
|
+
*/
|
|
2235
|
+
"drop-shadow": [{ "drop-shadow": [
|
|
2236
|
+
"",
|
|
2237
|
+
"none",
|
|
2238
|
+
isTshirtSize,
|
|
2239
|
+
isArbitraryValue
|
|
2240
|
+
] }],
|
|
2241
|
+
/**
|
|
2242
|
+
* Grayscale
|
|
2243
|
+
* @see https://tailwindcss.com/docs/grayscale
|
|
2244
|
+
*/
|
|
2245
|
+
grayscale: [{ grayscale: [grayscale] }],
|
|
2246
|
+
/**
|
|
2247
|
+
* Hue Rotate
|
|
2248
|
+
* @see https://tailwindcss.com/docs/hue-rotate
|
|
2249
|
+
*/
|
|
2250
|
+
"hue-rotate": [{ "hue-rotate": [hueRotate] }],
|
|
2251
|
+
/**
|
|
2252
|
+
* Invert
|
|
2253
|
+
* @see https://tailwindcss.com/docs/invert
|
|
2254
|
+
*/
|
|
2255
|
+
invert: [{ invert: [invert] }],
|
|
2256
|
+
/**
|
|
2257
|
+
* Saturate
|
|
2258
|
+
* @see https://tailwindcss.com/docs/saturate
|
|
2259
|
+
*/
|
|
2260
|
+
saturate: [{ saturate: [saturate] }],
|
|
2261
|
+
/**
|
|
2262
|
+
* Sepia
|
|
2263
|
+
* @see https://tailwindcss.com/docs/sepia
|
|
2264
|
+
*/
|
|
2265
|
+
sepia: [{ sepia: [sepia] }],
|
|
2266
|
+
/**
|
|
2267
|
+
* Backdrop Filter
|
|
2268
|
+
* @deprecated since Tailwind CSS v3.0.0
|
|
2269
|
+
* @see https://tailwindcss.com/docs/backdrop-filter
|
|
2270
|
+
*/
|
|
2271
|
+
"backdrop-filter": [{ "backdrop-filter": ["", "none"] }],
|
|
2272
|
+
/**
|
|
2273
|
+
* Backdrop Blur
|
|
2274
|
+
* @see https://tailwindcss.com/docs/backdrop-blur
|
|
2275
|
+
*/
|
|
2276
|
+
"backdrop-blur": [{ "backdrop-blur": [blur] }],
|
|
2277
|
+
/**
|
|
2278
|
+
* Backdrop Brightness
|
|
2279
|
+
* @see https://tailwindcss.com/docs/backdrop-brightness
|
|
2280
|
+
*/
|
|
2281
|
+
"backdrop-brightness": [{ "backdrop-brightness": [brightness] }],
|
|
2282
|
+
/**
|
|
2283
|
+
* Backdrop Contrast
|
|
2284
|
+
* @see https://tailwindcss.com/docs/backdrop-contrast
|
|
2285
|
+
*/
|
|
2286
|
+
"backdrop-contrast": [{ "backdrop-contrast": [contrast] }],
|
|
2287
|
+
/**
|
|
2288
|
+
* Backdrop Grayscale
|
|
2289
|
+
* @see https://tailwindcss.com/docs/backdrop-grayscale
|
|
2290
|
+
*/
|
|
2291
|
+
"backdrop-grayscale": [{ "backdrop-grayscale": [grayscale] }],
|
|
2292
|
+
/**
|
|
2293
|
+
* Backdrop Hue Rotate
|
|
2294
|
+
* @see https://tailwindcss.com/docs/backdrop-hue-rotate
|
|
2295
|
+
*/
|
|
2296
|
+
"backdrop-hue-rotate": [{ "backdrop-hue-rotate": [hueRotate] }],
|
|
2297
|
+
/**
|
|
2298
|
+
* Backdrop Invert
|
|
2299
|
+
* @see https://tailwindcss.com/docs/backdrop-invert
|
|
2300
|
+
*/
|
|
2301
|
+
"backdrop-invert": [{ "backdrop-invert": [invert] }],
|
|
2302
|
+
/**
|
|
2303
|
+
* Backdrop Opacity
|
|
2304
|
+
* @see https://tailwindcss.com/docs/backdrop-opacity
|
|
2305
|
+
*/
|
|
2306
|
+
"backdrop-opacity": [{ "backdrop-opacity": [opacity] }],
|
|
2307
|
+
/**
|
|
2308
|
+
* Backdrop Saturate
|
|
2309
|
+
* @see https://tailwindcss.com/docs/backdrop-saturate
|
|
2310
|
+
*/
|
|
2311
|
+
"backdrop-saturate": [{ "backdrop-saturate": [saturate] }],
|
|
2312
|
+
/**
|
|
2313
|
+
* Backdrop Sepia
|
|
2314
|
+
* @see https://tailwindcss.com/docs/backdrop-sepia
|
|
2315
|
+
*/
|
|
2316
|
+
"backdrop-sepia": [{ "backdrop-sepia": [sepia] }],
|
|
2317
|
+
/**
|
|
2318
|
+
* Border Collapse
|
|
2319
|
+
* @see https://tailwindcss.com/docs/border-collapse
|
|
2320
|
+
*/
|
|
2321
|
+
"border-collapse": [{ border: ["collapse", "separate"] }],
|
|
2322
|
+
/**
|
|
2323
|
+
* Border Spacing
|
|
2324
|
+
* @see https://tailwindcss.com/docs/border-spacing
|
|
2325
|
+
*/
|
|
2326
|
+
"border-spacing": [{ "border-spacing": [borderSpacing] }],
|
|
2327
|
+
/**
|
|
2328
|
+
* Border Spacing X
|
|
2329
|
+
* @see https://tailwindcss.com/docs/border-spacing
|
|
2330
|
+
*/
|
|
2331
|
+
"border-spacing-x": [{ "border-spacing-x": [borderSpacing] }],
|
|
2332
|
+
/**
|
|
2333
|
+
* Border Spacing Y
|
|
2334
|
+
* @see https://tailwindcss.com/docs/border-spacing
|
|
2335
|
+
*/
|
|
2336
|
+
"border-spacing-y": [{ "border-spacing-y": [borderSpacing] }],
|
|
2337
|
+
/**
|
|
2338
|
+
* Table Layout
|
|
2339
|
+
* @see https://tailwindcss.com/docs/table-layout
|
|
2340
|
+
*/
|
|
2341
|
+
"table-layout": [{ table: ["auto", "fixed"] }],
|
|
2342
|
+
/**
|
|
2343
|
+
* Caption Side
|
|
2344
|
+
* @see https://tailwindcss.com/docs/caption-side
|
|
2345
|
+
*/
|
|
2346
|
+
caption: [{ caption: ["top", "bottom"] }],
|
|
2347
|
+
/**
|
|
2348
|
+
* Tranisition Property
|
|
2349
|
+
* @see https://tailwindcss.com/docs/transition-property
|
|
2350
|
+
*/
|
|
2351
|
+
transition: [{ transition: [
|
|
2352
|
+
"none",
|
|
2353
|
+
"all",
|
|
2354
|
+
"",
|
|
2355
|
+
"colors",
|
|
2356
|
+
"opacity",
|
|
2357
|
+
"shadow",
|
|
2358
|
+
"transform",
|
|
2359
|
+
isArbitraryValue
|
|
2360
|
+
] }],
|
|
2361
|
+
/**
|
|
2362
|
+
* Transition Duration
|
|
2363
|
+
* @see https://tailwindcss.com/docs/transition-duration
|
|
2364
|
+
*/
|
|
2365
|
+
duration: [{ duration: getNumberAndArbitrary() }],
|
|
2366
|
+
/**
|
|
2367
|
+
* Transition Timing Function
|
|
2368
|
+
* @see https://tailwindcss.com/docs/transition-timing-function
|
|
2369
|
+
*/
|
|
2370
|
+
ease: [{ ease: [
|
|
2371
|
+
"linear",
|
|
2372
|
+
"in",
|
|
2373
|
+
"out",
|
|
2374
|
+
"in-out",
|
|
2375
|
+
isArbitraryValue
|
|
2376
|
+
] }],
|
|
2377
|
+
/**
|
|
2378
|
+
* Transition Delay
|
|
2379
|
+
* @see https://tailwindcss.com/docs/transition-delay
|
|
2380
|
+
*/
|
|
2381
|
+
delay: [{ delay: getNumberAndArbitrary() }],
|
|
2382
|
+
/**
|
|
2383
|
+
* Animation
|
|
2384
|
+
* @see https://tailwindcss.com/docs/animation
|
|
2385
|
+
*/
|
|
2386
|
+
animate: [{ animate: [
|
|
2387
|
+
"none",
|
|
2388
|
+
"spin",
|
|
2389
|
+
"ping",
|
|
2390
|
+
"pulse",
|
|
2391
|
+
"bounce",
|
|
2392
|
+
isArbitraryValue
|
|
2393
|
+
] }],
|
|
2394
|
+
/**
|
|
2395
|
+
* Transform
|
|
2396
|
+
* @see https://tailwindcss.com/docs/transform
|
|
2397
|
+
*/
|
|
2398
|
+
transform: [{ transform: [
|
|
2399
|
+
"",
|
|
2400
|
+
"gpu",
|
|
2401
|
+
"none"
|
|
2402
|
+
] }],
|
|
2403
|
+
/**
|
|
2404
|
+
* Scale
|
|
2405
|
+
* @see https://tailwindcss.com/docs/scale
|
|
2406
|
+
*/
|
|
2407
|
+
scale: [{ scale: [scale] }],
|
|
2408
|
+
/**
|
|
2409
|
+
* Scale X
|
|
2410
|
+
* @see https://tailwindcss.com/docs/scale
|
|
2411
|
+
*/
|
|
2412
|
+
"scale-x": [{ "scale-x": [scale] }],
|
|
2413
|
+
/**
|
|
2414
|
+
* Scale Y
|
|
2415
|
+
* @see https://tailwindcss.com/docs/scale
|
|
2416
|
+
*/
|
|
2417
|
+
"scale-y": [{ "scale-y": [scale] }],
|
|
2418
|
+
/**
|
|
2419
|
+
* Rotate
|
|
2420
|
+
* @see https://tailwindcss.com/docs/rotate
|
|
2421
|
+
*/
|
|
2422
|
+
rotate: [{ rotate: [isInteger, isArbitraryValue] }],
|
|
2423
|
+
/**
|
|
2424
|
+
* Translate X
|
|
2425
|
+
* @see https://tailwindcss.com/docs/translate
|
|
2426
|
+
*/
|
|
2427
|
+
"translate-x": [{ "translate-x": [translate] }],
|
|
2428
|
+
/**
|
|
2429
|
+
* Translate Y
|
|
2430
|
+
* @see https://tailwindcss.com/docs/translate
|
|
2431
|
+
*/
|
|
2432
|
+
"translate-y": [{ "translate-y": [translate] }],
|
|
2433
|
+
/**
|
|
2434
|
+
* Skew X
|
|
2435
|
+
* @see https://tailwindcss.com/docs/skew
|
|
2436
|
+
*/
|
|
2437
|
+
"skew-x": [{ "skew-x": [skew] }],
|
|
2438
|
+
/**
|
|
2439
|
+
* Skew Y
|
|
2440
|
+
* @see https://tailwindcss.com/docs/skew
|
|
2441
|
+
*/
|
|
2442
|
+
"skew-y": [{ "skew-y": [skew] }],
|
|
2443
|
+
/**
|
|
2444
|
+
* Transform Origin
|
|
2445
|
+
* @see https://tailwindcss.com/docs/transform-origin
|
|
2446
|
+
*/
|
|
2447
|
+
"transform-origin": [{ origin: [
|
|
2448
|
+
"center",
|
|
2449
|
+
"top",
|
|
2450
|
+
"top-right",
|
|
2451
|
+
"right",
|
|
2452
|
+
"bottom-right",
|
|
2453
|
+
"bottom",
|
|
2454
|
+
"bottom-left",
|
|
2455
|
+
"left",
|
|
2456
|
+
"top-left",
|
|
2457
|
+
isArbitraryValue
|
|
2458
|
+
] }],
|
|
2459
|
+
/**
|
|
2460
|
+
* Accent Color
|
|
2461
|
+
* @see https://tailwindcss.com/docs/accent-color
|
|
2462
|
+
*/
|
|
2463
|
+
accent: [{ accent: ["auto", colors] }],
|
|
2464
|
+
/**
|
|
2465
|
+
* Appearance
|
|
2466
|
+
* @see https://tailwindcss.com/docs/appearance
|
|
2467
|
+
*/
|
|
2468
|
+
appearance: [{ appearance: ["none", "auto"] }],
|
|
2469
|
+
/**
|
|
2470
|
+
* Cursor
|
|
2471
|
+
* @see https://tailwindcss.com/docs/cursor
|
|
2472
|
+
*/
|
|
2473
|
+
cursor: [{ cursor: [
|
|
2474
|
+
"auto",
|
|
2475
|
+
"default",
|
|
2476
|
+
"pointer",
|
|
2477
|
+
"wait",
|
|
2478
|
+
"text",
|
|
2479
|
+
"move",
|
|
2480
|
+
"help",
|
|
2481
|
+
"not-allowed",
|
|
2482
|
+
"none",
|
|
2483
|
+
"context-menu",
|
|
2484
|
+
"progress",
|
|
2485
|
+
"cell",
|
|
2486
|
+
"crosshair",
|
|
2487
|
+
"vertical-text",
|
|
2488
|
+
"alias",
|
|
2489
|
+
"copy",
|
|
2490
|
+
"no-drop",
|
|
2491
|
+
"grab",
|
|
2492
|
+
"grabbing",
|
|
2493
|
+
"all-scroll",
|
|
2494
|
+
"col-resize",
|
|
2495
|
+
"row-resize",
|
|
2496
|
+
"n-resize",
|
|
2497
|
+
"e-resize",
|
|
2498
|
+
"s-resize",
|
|
2499
|
+
"w-resize",
|
|
2500
|
+
"ne-resize",
|
|
2501
|
+
"nw-resize",
|
|
2502
|
+
"se-resize",
|
|
2503
|
+
"sw-resize",
|
|
2504
|
+
"ew-resize",
|
|
2505
|
+
"ns-resize",
|
|
2506
|
+
"nesw-resize",
|
|
2507
|
+
"nwse-resize",
|
|
2508
|
+
"zoom-in",
|
|
2509
|
+
"zoom-out",
|
|
2510
|
+
isArbitraryValue
|
|
2511
|
+
] }],
|
|
2512
|
+
/**
|
|
2513
|
+
* Caret Color
|
|
2514
|
+
* @see https://tailwindcss.com/docs/just-in-time-mode#caret-color-utilities
|
|
2515
|
+
*/
|
|
2516
|
+
"caret-color": [{ caret: [colors] }],
|
|
2517
|
+
/**
|
|
2518
|
+
* Pointer Events
|
|
2519
|
+
* @see https://tailwindcss.com/docs/pointer-events
|
|
2520
|
+
*/
|
|
2521
|
+
"pointer-events": [{ "pointer-events": ["none", "auto"] }],
|
|
2522
|
+
/**
|
|
2523
|
+
* Resize
|
|
2524
|
+
* @see https://tailwindcss.com/docs/resize
|
|
2525
|
+
*/
|
|
2526
|
+
resize: [{ resize: [
|
|
2527
|
+
"none",
|
|
2528
|
+
"y",
|
|
2529
|
+
"x",
|
|
2530
|
+
""
|
|
2531
|
+
] }],
|
|
2532
|
+
/**
|
|
2533
|
+
* Scroll Behavior
|
|
2534
|
+
* @see https://tailwindcss.com/docs/scroll-behavior
|
|
2535
|
+
*/
|
|
2536
|
+
"scroll-behavior": [{ scroll: ["auto", "smooth"] }],
|
|
2537
|
+
/**
|
|
2538
|
+
* Scroll Margin
|
|
2539
|
+
* @see https://tailwindcss.com/docs/scroll-margin
|
|
2540
|
+
*/
|
|
2541
|
+
"scroll-m": [{ "scroll-m": getSpacingWithArbitrary() }],
|
|
2542
|
+
/**
|
|
2543
|
+
* Scroll Margin X
|
|
2544
|
+
* @see https://tailwindcss.com/docs/scroll-margin
|
|
2545
|
+
*/
|
|
2546
|
+
"scroll-mx": [{ "scroll-mx": getSpacingWithArbitrary() }],
|
|
2547
|
+
/**
|
|
2548
|
+
* Scroll Margin Y
|
|
2549
|
+
* @see https://tailwindcss.com/docs/scroll-margin
|
|
2550
|
+
*/
|
|
2551
|
+
"scroll-my": [{ "scroll-my": getSpacingWithArbitrary() }],
|
|
2552
|
+
/**
|
|
2553
|
+
* Scroll Margin Start
|
|
2554
|
+
* @see https://tailwindcss.com/docs/scroll-margin
|
|
2555
|
+
*/
|
|
2556
|
+
"scroll-ms": [{ "scroll-ms": getSpacingWithArbitrary() }],
|
|
2557
|
+
/**
|
|
2558
|
+
* Scroll Margin End
|
|
2559
|
+
* @see https://tailwindcss.com/docs/scroll-margin
|
|
2560
|
+
*/
|
|
2561
|
+
"scroll-me": [{ "scroll-me": getSpacingWithArbitrary() }],
|
|
2562
|
+
/**
|
|
2563
|
+
* Scroll Margin Top
|
|
2564
|
+
* @see https://tailwindcss.com/docs/scroll-margin
|
|
2565
|
+
*/
|
|
2566
|
+
"scroll-mt": [{ "scroll-mt": getSpacingWithArbitrary() }],
|
|
2567
|
+
/**
|
|
2568
|
+
* Scroll Margin Right
|
|
2569
|
+
* @see https://tailwindcss.com/docs/scroll-margin
|
|
2570
|
+
*/
|
|
2571
|
+
"scroll-mr": [{ "scroll-mr": getSpacingWithArbitrary() }],
|
|
2572
|
+
/**
|
|
2573
|
+
* Scroll Margin Bottom
|
|
2574
|
+
* @see https://tailwindcss.com/docs/scroll-margin
|
|
2575
|
+
*/
|
|
2576
|
+
"scroll-mb": [{ "scroll-mb": getSpacingWithArbitrary() }],
|
|
2577
|
+
/**
|
|
2578
|
+
* Scroll Margin Left
|
|
2579
|
+
* @see https://tailwindcss.com/docs/scroll-margin
|
|
2580
|
+
*/
|
|
2581
|
+
"scroll-ml": [{ "scroll-ml": getSpacingWithArbitrary() }],
|
|
2582
|
+
/**
|
|
2583
|
+
* Scroll Padding
|
|
2584
|
+
* @see https://tailwindcss.com/docs/scroll-padding
|
|
2585
|
+
*/
|
|
2586
|
+
"scroll-p": [{ "scroll-p": getSpacingWithArbitrary() }],
|
|
2587
|
+
/**
|
|
2588
|
+
* Scroll Padding X
|
|
2589
|
+
* @see https://tailwindcss.com/docs/scroll-padding
|
|
2590
|
+
*/
|
|
2591
|
+
"scroll-px": [{ "scroll-px": getSpacingWithArbitrary() }],
|
|
2592
|
+
/**
|
|
2593
|
+
* Scroll Padding Y
|
|
2594
|
+
* @see https://tailwindcss.com/docs/scroll-padding
|
|
2595
|
+
*/
|
|
2596
|
+
"scroll-py": [{ "scroll-py": getSpacingWithArbitrary() }],
|
|
2597
|
+
/**
|
|
2598
|
+
* Scroll Padding Start
|
|
2599
|
+
* @see https://tailwindcss.com/docs/scroll-padding
|
|
2600
|
+
*/
|
|
2601
|
+
"scroll-ps": [{ "scroll-ps": getSpacingWithArbitrary() }],
|
|
2602
|
+
/**
|
|
2603
|
+
* Scroll Padding End
|
|
2604
|
+
* @see https://tailwindcss.com/docs/scroll-padding
|
|
2605
|
+
*/
|
|
2606
|
+
"scroll-pe": [{ "scroll-pe": getSpacingWithArbitrary() }],
|
|
2607
|
+
/**
|
|
2608
|
+
* Scroll Padding Top
|
|
2609
|
+
* @see https://tailwindcss.com/docs/scroll-padding
|
|
2610
|
+
*/
|
|
2611
|
+
"scroll-pt": [{ "scroll-pt": getSpacingWithArbitrary() }],
|
|
2612
|
+
/**
|
|
2613
|
+
* Scroll Padding Right
|
|
2614
|
+
* @see https://tailwindcss.com/docs/scroll-padding
|
|
2615
|
+
*/
|
|
2616
|
+
"scroll-pr": [{ "scroll-pr": getSpacingWithArbitrary() }],
|
|
2617
|
+
/**
|
|
2618
|
+
* Scroll Padding Bottom
|
|
2619
|
+
* @see https://tailwindcss.com/docs/scroll-padding
|
|
2620
|
+
*/
|
|
2621
|
+
"scroll-pb": [{ "scroll-pb": getSpacingWithArbitrary() }],
|
|
2622
|
+
/**
|
|
2623
|
+
* Scroll Padding Left
|
|
2624
|
+
* @see https://tailwindcss.com/docs/scroll-padding
|
|
2625
|
+
*/
|
|
2626
|
+
"scroll-pl": [{ "scroll-pl": getSpacingWithArbitrary() }],
|
|
2627
|
+
/**
|
|
2628
|
+
* Scroll Snap Align
|
|
2629
|
+
* @see https://tailwindcss.com/docs/scroll-snap-align
|
|
2630
|
+
*/
|
|
2631
|
+
"snap-align": [{ snap: [
|
|
2632
|
+
"start",
|
|
2633
|
+
"end",
|
|
2634
|
+
"center",
|
|
2635
|
+
"align-none"
|
|
2636
|
+
] }],
|
|
2637
|
+
/**
|
|
2638
|
+
* Scroll Snap Stop
|
|
2639
|
+
* @see https://tailwindcss.com/docs/scroll-snap-stop
|
|
2640
|
+
*/
|
|
2641
|
+
"snap-stop": [{ snap: ["normal", "always"] }],
|
|
2642
|
+
/**
|
|
2643
|
+
* Scroll Snap Type
|
|
2644
|
+
* @see https://tailwindcss.com/docs/scroll-snap-type
|
|
2645
|
+
*/
|
|
2646
|
+
"snap-type": [{ snap: [
|
|
2647
|
+
"none",
|
|
2648
|
+
"x",
|
|
2649
|
+
"y",
|
|
2650
|
+
"both"
|
|
2651
|
+
] }],
|
|
2652
|
+
/**
|
|
2653
|
+
* Scroll Snap Type Strictness
|
|
2654
|
+
* @see https://tailwindcss.com/docs/scroll-snap-type
|
|
2655
|
+
*/
|
|
2656
|
+
"snap-strictness": [{ snap: ["mandatory", "proximity"] }],
|
|
2657
|
+
/**
|
|
2658
|
+
* Touch Action
|
|
2659
|
+
* @see https://tailwindcss.com/docs/touch-action
|
|
2660
|
+
*/
|
|
2661
|
+
touch: [{ touch: [
|
|
2662
|
+
"auto",
|
|
2663
|
+
"none",
|
|
2664
|
+
"manipulation"
|
|
2665
|
+
] }],
|
|
2666
|
+
/**
|
|
2667
|
+
* Touch Action X
|
|
2668
|
+
* @see https://tailwindcss.com/docs/touch-action
|
|
2669
|
+
*/
|
|
2670
|
+
"touch-x": [{ "touch-pan": [
|
|
2671
|
+
"x",
|
|
2672
|
+
"left",
|
|
2673
|
+
"right"
|
|
2674
|
+
] }],
|
|
2675
|
+
/**
|
|
2676
|
+
* Touch Action Y
|
|
2677
|
+
* @see https://tailwindcss.com/docs/touch-action
|
|
2678
|
+
*/
|
|
2679
|
+
"touch-y": [{ "touch-pan": [
|
|
2680
|
+
"y",
|
|
2681
|
+
"up",
|
|
2682
|
+
"down"
|
|
2683
|
+
] }],
|
|
2684
|
+
/**
|
|
2685
|
+
* Touch Action Pinch Zoom
|
|
2686
|
+
* @see https://tailwindcss.com/docs/touch-action
|
|
2687
|
+
*/
|
|
2688
|
+
"touch-pz": ["touch-pinch-zoom"],
|
|
2689
|
+
/**
|
|
2690
|
+
* User Select
|
|
2691
|
+
* @see https://tailwindcss.com/docs/user-select
|
|
2692
|
+
*/
|
|
2693
|
+
select: [{ select: [
|
|
2694
|
+
"none",
|
|
2695
|
+
"text",
|
|
2696
|
+
"all",
|
|
2697
|
+
"auto"
|
|
2698
|
+
] }],
|
|
2699
|
+
/**
|
|
2700
|
+
* Will Change
|
|
2701
|
+
* @see https://tailwindcss.com/docs/will-change
|
|
2702
|
+
*/
|
|
2703
|
+
"will-change": [{ "will-change": [
|
|
2704
|
+
"auto",
|
|
2705
|
+
"scroll",
|
|
2706
|
+
"contents",
|
|
2707
|
+
"transform",
|
|
2708
|
+
isArbitraryValue
|
|
2709
|
+
] }],
|
|
2710
|
+
/**
|
|
2711
|
+
* Fill
|
|
2712
|
+
* @see https://tailwindcss.com/docs/fill
|
|
2713
|
+
*/
|
|
2714
|
+
fill: [{ fill: [colors, "none"] }],
|
|
2715
|
+
/**
|
|
2716
|
+
* Stroke Width
|
|
2717
|
+
* @see https://tailwindcss.com/docs/stroke-width
|
|
2718
|
+
*/
|
|
2719
|
+
"stroke-w": [{ stroke: [
|
|
2720
|
+
isLength,
|
|
2721
|
+
isArbitraryLength,
|
|
2722
|
+
isArbitraryNumber
|
|
2723
|
+
] }],
|
|
2724
|
+
/**
|
|
2725
|
+
* Stroke
|
|
2726
|
+
* @see https://tailwindcss.com/docs/stroke
|
|
2727
|
+
*/
|
|
2728
|
+
stroke: [{ stroke: [colors, "none"] }],
|
|
2729
|
+
/**
|
|
2730
|
+
* Screen Readers
|
|
2731
|
+
* @see https://tailwindcss.com/docs/screen-readers
|
|
2732
|
+
*/
|
|
2733
|
+
sr: ["sr-only", "not-sr-only"],
|
|
2734
|
+
/**
|
|
2735
|
+
* Forced Color Adjust
|
|
2736
|
+
* @see https://tailwindcss.com/docs/forced-color-adjust
|
|
2737
|
+
*/
|
|
2738
|
+
"forced-color-adjust": [{ "forced-color-adjust": ["auto", "none"] }]
|
|
2739
|
+
},
|
|
2740
|
+
conflictingClassGroups: {
|
|
2741
|
+
overflow: ["overflow-x", "overflow-y"],
|
|
2742
|
+
overscroll: ["overscroll-x", "overscroll-y"],
|
|
2743
|
+
inset: [
|
|
2744
|
+
"inset-x",
|
|
2745
|
+
"inset-y",
|
|
2746
|
+
"start",
|
|
2747
|
+
"end",
|
|
2748
|
+
"top",
|
|
2749
|
+
"right",
|
|
2750
|
+
"bottom",
|
|
2751
|
+
"left"
|
|
2752
|
+
],
|
|
2753
|
+
"inset-x": ["right", "left"],
|
|
2754
|
+
"inset-y": ["top", "bottom"],
|
|
2755
|
+
flex: [
|
|
2756
|
+
"basis",
|
|
2757
|
+
"grow",
|
|
2758
|
+
"shrink"
|
|
2759
|
+
],
|
|
2760
|
+
gap: ["gap-x", "gap-y"],
|
|
2761
|
+
p: [
|
|
2762
|
+
"px",
|
|
2763
|
+
"py",
|
|
2764
|
+
"ps",
|
|
2765
|
+
"pe",
|
|
2766
|
+
"pt",
|
|
2767
|
+
"pr",
|
|
2768
|
+
"pb",
|
|
2769
|
+
"pl"
|
|
2770
|
+
],
|
|
2771
|
+
px: ["pr", "pl"],
|
|
2772
|
+
py: ["pt", "pb"],
|
|
2773
|
+
m: [
|
|
2774
|
+
"mx",
|
|
2775
|
+
"my",
|
|
2776
|
+
"ms",
|
|
2777
|
+
"me",
|
|
2778
|
+
"mt",
|
|
2779
|
+
"mr",
|
|
2780
|
+
"mb",
|
|
2781
|
+
"ml"
|
|
2782
|
+
],
|
|
2783
|
+
mx: ["mr", "ml"],
|
|
2784
|
+
my: ["mt", "mb"],
|
|
2785
|
+
size: ["w", "h"],
|
|
2786
|
+
"font-size": ["leading"],
|
|
2787
|
+
"fvn-normal": [
|
|
2788
|
+
"fvn-ordinal",
|
|
2789
|
+
"fvn-slashed-zero",
|
|
2790
|
+
"fvn-figure",
|
|
2791
|
+
"fvn-spacing",
|
|
2792
|
+
"fvn-fraction"
|
|
2793
|
+
],
|
|
2794
|
+
"fvn-ordinal": ["fvn-normal"],
|
|
2795
|
+
"fvn-slashed-zero": ["fvn-normal"],
|
|
2796
|
+
"fvn-figure": ["fvn-normal"],
|
|
2797
|
+
"fvn-spacing": ["fvn-normal"],
|
|
2798
|
+
"fvn-fraction": ["fvn-normal"],
|
|
2799
|
+
"line-clamp": ["display", "overflow"],
|
|
2800
|
+
rounded: [
|
|
2801
|
+
"rounded-s",
|
|
2802
|
+
"rounded-e",
|
|
2803
|
+
"rounded-t",
|
|
2804
|
+
"rounded-r",
|
|
2805
|
+
"rounded-b",
|
|
2806
|
+
"rounded-l",
|
|
2807
|
+
"rounded-ss",
|
|
2808
|
+
"rounded-se",
|
|
2809
|
+
"rounded-ee",
|
|
2810
|
+
"rounded-es",
|
|
2811
|
+
"rounded-tl",
|
|
2812
|
+
"rounded-tr",
|
|
2813
|
+
"rounded-br",
|
|
2814
|
+
"rounded-bl"
|
|
2815
|
+
],
|
|
2816
|
+
"rounded-s": ["rounded-ss", "rounded-es"],
|
|
2817
|
+
"rounded-e": ["rounded-se", "rounded-ee"],
|
|
2818
|
+
"rounded-t": ["rounded-tl", "rounded-tr"],
|
|
2819
|
+
"rounded-r": ["rounded-tr", "rounded-br"],
|
|
2820
|
+
"rounded-b": ["rounded-br", "rounded-bl"],
|
|
2821
|
+
"rounded-l": ["rounded-tl", "rounded-bl"],
|
|
2822
|
+
"border-spacing": ["border-spacing-x", "border-spacing-y"],
|
|
2823
|
+
"border-w": [
|
|
2824
|
+
"border-w-s",
|
|
2825
|
+
"border-w-e",
|
|
2826
|
+
"border-w-t",
|
|
2827
|
+
"border-w-r",
|
|
2828
|
+
"border-w-b",
|
|
2829
|
+
"border-w-l"
|
|
2830
|
+
],
|
|
2831
|
+
"border-w-x": ["border-w-r", "border-w-l"],
|
|
2832
|
+
"border-w-y": ["border-w-t", "border-w-b"],
|
|
2833
|
+
"border-color": [
|
|
2834
|
+
"border-color-s",
|
|
2835
|
+
"border-color-e",
|
|
2836
|
+
"border-color-t",
|
|
2837
|
+
"border-color-r",
|
|
2838
|
+
"border-color-b",
|
|
2839
|
+
"border-color-l"
|
|
2840
|
+
],
|
|
2841
|
+
"border-color-x": ["border-color-r", "border-color-l"],
|
|
2842
|
+
"border-color-y": ["border-color-t", "border-color-b"],
|
|
2843
|
+
"scroll-m": [
|
|
2844
|
+
"scroll-mx",
|
|
2845
|
+
"scroll-my",
|
|
2846
|
+
"scroll-ms",
|
|
2847
|
+
"scroll-me",
|
|
2848
|
+
"scroll-mt",
|
|
2849
|
+
"scroll-mr",
|
|
2850
|
+
"scroll-mb",
|
|
2851
|
+
"scroll-ml"
|
|
2852
|
+
],
|
|
2853
|
+
"scroll-mx": ["scroll-mr", "scroll-ml"],
|
|
2854
|
+
"scroll-my": ["scroll-mt", "scroll-mb"],
|
|
2855
|
+
"scroll-p": [
|
|
2856
|
+
"scroll-px",
|
|
2857
|
+
"scroll-py",
|
|
2858
|
+
"scroll-ps",
|
|
2859
|
+
"scroll-pe",
|
|
2860
|
+
"scroll-pt",
|
|
2861
|
+
"scroll-pr",
|
|
2862
|
+
"scroll-pb",
|
|
2863
|
+
"scroll-pl"
|
|
2864
|
+
],
|
|
2865
|
+
"scroll-px": ["scroll-pr", "scroll-pl"],
|
|
2866
|
+
"scroll-py": ["scroll-pt", "scroll-pb"],
|
|
2867
|
+
touch: [
|
|
2868
|
+
"touch-x",
|
|
2869
|
+
"touch-y",
|
|
2870
|
+
"touch-pz"
|
|
2871
|
+
],
|
|
2872
|
+
"touch-x": ["touch"],
|
|
2873
|
+
"touch-y": ["touch"],
|
|
2874
|
+
"touch-pz": ["touch"]
|
|
2875
|
+
},
|
|
2876
|
+
conflictingClassGroupModifiers: { "font-size": ["leading"] }
|
|
2877
|
+
};
|
|
2878
|
+
};
|
|
2879
|
+
var twMerge = /*#__PURE__*/ createTailwindMerge(getDefaultConfig);
|
|
2880
|
+
//#endregion
|
|
2881
|
+
//#region ../ui/src/lib/utils.ts
|
|
2882
|
+
/**
|
|
2883
|
+
* Internal utilities for UI components.
|
|
2884
|
+
*
|
|
2885
|
+
* This module is for INTERNAL use only and should NOT be exposed to external consumers.
|
|
2886
|
+
* External utilities should be placed in `utils/` instead.
|
|
2887
|
+
*
|
|
2888
|
+
* @internal
|
|
2889
|
+
*/
|
|
2890
|
+
/**
|
|
2891
|
+
* Merges Tailwind CSS class names with conflict resolution.
|
|
2892
|
+
* Combines clsx for conditional classes and tailwind-merge for deduplication.
|
|
2893
|
+
*
|
|
2894
|
+
* @example
|
|
2895
|
+
* cn('px-2 py-1', 'px-4') // => 'py-1 px-4'
|
|
2896
|
+
* cn('text-red-500', isActive && 'text-blue-500')
|
|
2897
|
+
*/
|
|
2898
|
+
function cn(...inputs) {
|
|
2899
|
+
return twMerge(clsx(inputs));
|
|
2900
|
+
}
|
|
2901
|
+
//#endregion
|
|
2902
|
+
//#region ../ui/src/components/primitives/button.tsx
|
|
2903
|
+
var buttonVariants = cva(cn("inline-flex items-center justify-center gap-2 whitespace-nowrap", "rounded-md font-normal transition-all", "disabled:pointer-events-none disabled:opacity-40", "shrink-0 outline-none aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_.lucide:not(.lucide-custom)]:text-current [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", "data-[busy=true]:cursor-progress data-[busy=true]:opacity-40", "shadow-xs"), {
|
|
2904
|
+
variants: {
|
|
2905
|
+
variant: {
|
|
2906
|
+
default: "bg-neutral-900 text-white hover:bg-neutral-800 focus-visible:bg-neutral-800 dark:bg-neutral-100 dark:text-neutral-900 dark:hover:bg-neutral-200 dark:focus-visible:bg-neutral-200",
|
|
2907
|
+
destructive: "bg-destructive text-white hover:bg-destructive-hover focus-visible:bg-destructive-hover",
|
|
2908
|
+
outline: "border border-border bg-transparent text-foreground shadow-none hover:bg-accent focus-visible:border-primary focus-visible:bg-accent",
|
|
2909
|
+
secondary: "rounded-lg bg-secondary text-secondary-foreground shadow-none hover:bg-secondary-hover focus-visible:bg-secondary-hover",
|
|
2910
|
+
/** Dialog primary action style: same color hierarchy as default, with a flatter v2 shell. */
|
|
2911
|
+
emphasis: "rounded-lg bg-neutral-900 text-white shadow-none hover:bg-neutral-800 focus-visible:bg-neutral-800 dark:bg-neutral-100 dark:text-neutral-900 dark:hover:bg-neutral-200 dark:focus-visible:bg-neutral-200",
|
|
2912
|
+
ghost: "text-neutral-900 shadow-none hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground dark:text-neutral-100",
|
|
2913
|
+
link: "text-neutral-900 underline-offset-4 hover:text-neutral-700 hover:underline focus-visible:text-neutral-700 focus-visible:underline dark:text-neutral-100 dark:hover:text-neutral-300 dark:focus-visible:text-neutral-300"
|
|
2914
|
+
},
|
|
2915
|
+
size: {
|
|
2916
|
+
default: "min-h-7.5 gap-1.5 px-2.5 text-[13px]",
|
|
2917
|
+
sm: "min-h-7 gap-1.5 px-2.5 text-xs",
|
|
2918
|
+
lg: "min-h-9 px-4 text-sm",
|
|
2919
|
+
icon: "size-9",
|
|
2920
|
+
"icon-sm": "size-7",
|
|
2921
|
+
"icon-lg": "size-10",
|
|
2922
|
+
/** Navbar / toolbar icon button: 30px box, 18px icon (8px radius from base). */
|
|
2923
|
+
"icon-navbar": "size-[30px] [&_svg]:!size-[18px]"
|
|
2924
|
+
}
|
|
2925
|
+
},
|
|
2926
|
+
defaultVariants: {
|
|
2927
|
+
variant: "default",
|
|
2928
|
+
size: "default"
|
|
2929
|
+
}
|
|
2930
|
+
});
|
|
2931
|
+
function Button({ className, variant, size, asChild = false, loading = false, loadingIcon, loadingIconClassName, disabled, children, ...props }) {
|
|
2932
|
+
const Comp = asChild ? Slot : "button";
|
|
2933
|
+
const getSpinnerSize = () => {
|
|
2934
|
+
if (size === "icon-sm") return 13;
|
|
2935
|
+
if (size === "sm") return 14;
|
|
2936
|
+
if (size === "icon-navbar") return 18;
|
|
2937
|
+
if (size === "lg" || size === "icon-lg") return 18;
|
|
2938
|
+
return 16;
|
|
2939
|
+
};
|
|
2940
|
+
const defaultLoadingIcon = /* @__PURE__ */ jsx(Loader, {
|
|
2941
|
+
className: cn("animate-spin", loadingIconClassName),
|
|
2942
|
+
size: getSpinnerSize()
|
|
2943
|
+
});
|
|
2944
|
+
const spinnerElement = loadingIcon ?? defaultLoadingIcon;
|
|
2945
|
+
return /* @__PURE__ */ jsx(Comp, {
|
|
2946
|
+
"data-slot": "button",
|
|
2947
|
+
"data-variant": variant ?? "default",
|
|
2948
|
+
className: cn(buttonVariants({
|
|
2949
|
+
variant,
|
|
2950
|
+
size,
|
|
2951
|
+
className
|
|
2952
|
+
})),
|
|
2953
|
+
disabled: disabled || loading,
|
|
2954
|
+
"aria-busy": loading || void 0,
|
|
2955
|
+
"data-busy": loading || void 0,
|
|
2956
|
+
...props,
|
|
2957
|
+
children: asChild ? children : /* @__PURE__ */ jsxs(Fragment, { children: [loading && spinnerElement, children] })
|
|
2958
|
+
});
|
|
2959
|
+
}
|
|
2960
|
+
//#endregion
|
|
2961
|
+
//#region ../ui/src/components/composites/empty-state/index.tsx
|
|
2962
|
+
var EMPTY_ILLUSTRATION_RATIO = 41 / 64;
|
|
2963
|
+
/**
|
|
2964
|
+
* Unified empty illustrations — soft line drawings with a ground shadow. All
|
|
2965
|
+
* colors derive from `currentColor` opacity layers so they adapt to themes.
|
|
2966
|
+
* `inbox` is the generic "nothing here"; `book` reads as knowledge/learning.
|
|
2967
|
+
*/
|
|
2968
|
+
function EmptyIllustration({ variant = "inbox", width, className }) {
|
|
2969
|
+
return /* @__PURE__ */ jsx("svg", {
|
|
2970
|
+
width,
|
|
2971
|
+
height: Math.round(width * EMPTY_ILLUSTRATION_RATIO),
|
|
2972
|
+
viewBox: "0 0 64 41",
|
|
2973
|
+
className,
|
|
2974
|
+
"aria-hidden": "true",
|
|
2975
|
+
children: variant === "book" ? /* @__PURE__ */ jsxs("g", {
|
|
2976
|
+
transform: "translate(0 1)",
|
|
2977
|
+
fill: "none",
|
|
2978
|
+
fillRule: "evenodd",
|
|
2979
|
+
children: [
|
|
2980
|
+
/* @__PURE__ */ jsx("ellipse", {
|
|
2981
|
+
fill: "currentColor",
|
|
2982
|
+
fillOpacity: .08,
|
|
2983
|
+
cx: "32",
|
|
2984
|
+
cy: "33",
|
|
2985
|
+
rx: "28",
|
|
2986
|
+
ry: "6.5"
|
|
2987
|
+
}),
|
|
2988
|
+
/* @__PURE__ */ jsxs("g", {
|
|
2989
|
+
stroke: "currentColor",
|
|
2990
|
+
strokeOpacity: .4,
|
|
2991
|
+
strokeLinejoin: "round",
|
|
2992
|
+
children: [
|
|
2993
|
+
/* @__PURE__ */ jsx("path", {
|
|
2994
|
+
fill: "currentColor",
|
|
2995
|
+
fillOpacity: .05,
|
|
2996
|
+
d: "M32 10.5 11 6.5v18.2L32 30.5Z"
|
|
2997
|
+
}),
|
|
2998
|
+
/* @__PURE__ */ jsx("path", {
|
|
2999
|
+
fill: "currentColor",
|
|
3000
|
+
fillOpacity: .05,
|
|
3001
|
+
d: "M32 10.5 53 6.5v18.2L32 30.5Z"
|
|
3002
|
+
}),
|
|
3003
|
+
/* @__PURE__ */ jsx("path", { d: "M32 10.5v20" })
|
|
3004
|
+
]
|
|
3005
|
+
}),
|
|
3006
|
+
/* @__PURE__ */ jsx("path", {
|
|
3007
|
+
fill: "currentColor",
|
|
3008
|
+
fillOpacity: .35,
|
|
3009
|
+
d: "m55.5 0 1.3 2.8 2.8 1.3-2.8 1.3-1.3 2.8-1.3-2.8-2.8-1.3 2.8-1.3Z"
|
|
3010
|
+
})
|
|
3011
|
+
]
|
|
3012
|
+
}) : /* @__PURE__ */ jsxs("g", {
|
|
3013
|
+
transform: "translate(0 1)",
|
|
3014
|
+
fill: "none",
|
|
3015
|
+
fillRule: "evenodd",
|
|
3016
|
+
children: [/* @__PURE__ */ jsx("ellipse", {
|
|
3017
|
+
fill: "currentColor",
|
|
3018
|
+
fillOpacity: .08,
|
|
3019
|
+
cx: "32",
|
|
3020
|
+
cy: "33",
|
|
3021
|
+
rx: "32",
|
|
3022
|
+
ry: "7"
|
|
3023
|
+
}), /* @__PURE__ */ jsxs("g", {
|
|
3024
|
+
fillRule: "nonzero",
|
|
3025
|
+
stroke: "currentColor",
|
|
3026
|
+
strokeOpacity: .4,
|
|
3027
|
+
children: [/* @__PURE__ */ jsx("path", { d: "M55 12.76 44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z" }), /* @__PURE__ */ jsx("path", {
|
|
3028
|
+
fill: "currentColor",
|
|
3029
|
+
fillOpacity: .05,
|
|
3030
|
+
d: "M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z"
|
|
3031
|
+
})]
|
|
3032
|
+
})]
|
|
3033
|
+
})
|
|
3034
|
+
});
|
|
3035
|
+
}
|
|
3036
|
+
function EmptyState({ illustration = "inbox", icon: IconOverride, title, description, actionLabel, onAction, secondaryLabel, onSecondary, compact = false, className }) {
|
|
3037
|
+
const Icon = IconOverride;
|
|
3038
|
+
const buttonSize = compact ? "sm" : "default";
|
|
3039
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
3040
|
+
className: cn("flex flex-col items-center justify-center text-center", compact ? "px-4 py-8" : "flex-1 px-6 py-12", className),
|
|
3041
|
+
children: [
|
|
3042
|
+
Icon ? /* @__PURE__ */ jsx(Icon, {
|
|
3043
|
+
size: compact ? 28 : 40,
|
|
3044
|
+
strokeWidth: 1.5,
|
|
3045
|
+
className: cn("text-muted-foreground", compact ? "mb-3" : "mb-4")
|
|
3046
|
+
}) : /* @__PURE__ */ jsx(EmptyIllustration, {
|
|
3047
|
+
variant: illustration,
|
|
3048
|
+
width: compact ? 48 : 64,
|
|
3049
|
+
className: cn("text-muted-foreground", compact ? "mb-3" : "mb-4")
|
|
3050
|
+
}),
|
|
3051
|
+
title && /* @__PURE__ */ jsx("h3", {
|
|
3052
|
+
className: cn("font-normal text-muted-foreground", compact ? "text-xs" : "text-sm", description ? "mb-1.5" : actionLabel || secondaryLabel ? compact ? "mb-3" : "mb-5" : ""),
|
|
3053
|
+
children: title
|
|
3054
|
+
}),
|
|
3055
|
+
description && /* @__PURE__ */ jsx("p", {
|
|
3056
|
+
className: cn("text-muted-foreground", compact ? "mb-3 max-w-xs text-xs" : "mb-5 max-w-md text-xs leading-relaxed"),
|
|
3057
|
+
children: description
|
|
3058
|
+
}),
|
|
3059
|
+
(actionLabel || secondaryLabel) && /* @__PURE__ */ jsxs("div", {
|
|
3060
|
+
className: "flex items-center gap-2",
|
|
3061
|
+
children: [actionLabel && onAction && /* @__PURE__ */ jsx(Button, {
|
|
3062
|
+
variant: "outline",
|
|
3063
|
+
size: buttonSize,
|
|
3064
|
+
onClick: onAction,
|
|
3065
|
+
children: actionLabel
|
|
3066
|
+
}), secondaryLabel && onSecondary && /* @__PURE__ */ jsx(Button, {
|
|
3067
|
+
variant: "ghost",
|
|
3068
|
+
size: buttonSize,
|
|
3069
|
+
onClick: onSecondary,
|
|
3070
|
+
children: secondaryLabel
|
|
3071
|
+
})]
|
|
3072
|
+
})
|
|
3073
|
+
]
|
|
3074
|
+
});
|
|
3075
|
+
}
|
|
3076
|
+
//#endregion
|
|
3077
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.49.0/node_modules/es-toolkit/dist/function/debounce.mjs
|
|
3078
|
+
/**
|
|
3079
|
+
* Creates a debounced function that delays invoking the provided function until after `debounceMs` milliseconds
|
|
3080
|
+
* have elapsed since the last time the debounced function was invoked. The debounced function also has a `cancel`
|
|
3081
|
+
* method to cancel any pending execution.
|
|
3082
|
+
*
|
|
3083
|
+
* @template F - The type of function.
|
|
3084
|
+
* @param func - The function to debounce.
|
|
3085
|
+
* @param debounceMs - The number of milliseconds to delay.
|
|
3086
|
+
* @param options - The options object
|
|
3087
|
+
* @param options.signal - An optional AbortSignal to cancel the debounced function.
|
|
3088
|
+
* @param options.edges - An optional array specifying whether the function should be invoked on the leading edge, trailing edge, or both.
|
|
3089
|
+
* @returns A new debounced function with a `cancel` method.
|
|
3090
|
+
*
|
|
3091
|
+
* @example
|
|
3092
|
+
* const debouncedFunction = debounce(() => {
|
|
3093
|
+
* console.log('Function executed');
|
|
3094
|
+
* }, 1000);
|
|
3095
|
+
*
|
|
3096
|
+
* // Will log 'Function executed' after 1 second if not called again in that time
|
|
3097
|
+
* debouncedFunction();
|
|
3098
|
+
*
|
|
3099
|
+
* // Will not log anything as the previous call is canceled
|
|
3100
|
+
* debouncedFunction.cancel();
|
|
3101
|
+
*
|
|
3102
|
+
* // With AbortSignal
|
|
3103
|
+
* const controller = new AbortController();
|
|
3104
|
+
* const signal = controller.signal;
|
|
3105
|
+
* const debouncedWithSignal = debounce(() => {
|
|
3106
|
+
* console.log('Function executed');
|
|
3107
|
+
* }, 1000, { signal });
|
|
3108
|
+
*
|
|
3109
|
+
* debouncedWithSignal();
|
|
3110
|
+
*
|
|
3111
|
+
* // Will cancel the debounced function call
|
|
3112
|
+
* controller.abort();
|
|
3113
|
+
*/
|
|
3114
|
+
function debounce$1(func, debounceMs, { signal, edges } = {}) {
|
|
3115
|
+
let pendingThis = void 0;
|
|
3116
|
+
let pendingArgs = null;
|
|
3117
|
+
const leading = edges != null && edges.includes("leading");
|
|
3118
|
+
const trailing = edges == null || edges.includes("trailing");
|
|
3119
|
+
const invoke = () => {
|
|
3120
|
+
if (pendingArgs !== null) {
|
|
3121
|
+
func.apply(pendingThis, pendingArgs);
|
|
3122
|
+
pendingThis = void 0;
|
|
3123
|
+
pendingArgs = null;
|
|
3124
|
+
}
|
|
3125
|
+
};
|
|
3126
|
+
const onTimerEnd = () => {
|
|
3127
|
+
if (trailing) invoke();
|
|
3128
|
+
cancel();
|
|
3129
|
+
};
|
|
3130
|
+
let timeoutId = null;
|
|
3131
|
+
const schedule = () => {
|
|
3132
|
+
if (timeoutId != null) clearTimeout(timeoutId);
|
|
3133
|
+
timeoutId = setTimeout(() => {
|
|
3134
|
+
timeoutId = null;
|
|
3135
|
+
onTimerEnd();
|
|
3136
|
+
}, debounceMs);
|
|
3137
|
+
};
|
|
3138
|
+
const cancelTimer = () => {
|
|
3139
|
+
if (timeoutId !== null) {
|
|
3140
|
+
clearTimeout(timeoutId);
|
|
3141
|
+
timeoutId = null;
|
|
3142
|
+
}
|
|
3143
|
+
};
|
|
3144
|
+
const cancel = () => {
|
|
3145
|
+
cancelTimer();
|
|
3146
|
+
pendingThis = void 0;
|
|
3147
|
+
pendingArgs = null;
|
|
3148
|
+
};
|
|
3149
|
+
const flush = () => {
|
|
3150
|
+
invoke();
|
|
3151
|
+
};
|
|
3152
|
+
const debounced = function(...args) {
|
|
3153
|
+
if (signal?.aborted) return;
|
|
3154
|
+
pendingThis = this;
|
|
3155
|
+
pendingArgs = args;
|
|
3156
|
+
const isFirstCall = timeoutId == null;
|
|
3157
|
+
schedule();
|
|
3158
|
+
if (leading && isFirstCall) invoke();
|
|
3159
|
+
};
|
|
3160
|
+
debounced.schedule = schedule;
|
|
3161
|
+
debounced.cancel = cancel;
|
|
3162
|
+
debounced.flush = flush;
|
|
3163
|
+
signal?.addEventListener("abort", cancel, { once: true });
|
|
3164
|
+
return debounced;
|
|
3165
|
+
}
|
|
3166
|
+
//#endregion
|
|
3167
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.49.0/node_modules/es-toolkit/dist/compat/function/debounce.mjs
|
|
3168
|
+
function debounce(func, debounceMs = 0, options = {}) {
|
|
3169
|
+
if (typeof options !== "object") options = {};
|
|
3170
|
+
const { leading = false, trailing = true, maxWait } = options;
|
|
3171
|
+
const edges = Array(2);
|
|
3172
|
+
if (leading) edges[0] = "leading";
|
|
3173
|
+
if (trailing) edges[1] = "trailing";
|
|
3174
|
+
let result = void 0;
|
|
3175
|
+
let pendingAt = null;
|
|
3176
|
+
const _debounced = debounce$1(function(...args) {
|
|
3177
|
+
result = func.apply(this, args);
|
|
3178
|
+
pendingAt = null;
|
|
3179
|
+
}, debounceMs, { edges });
|
|
3180
|
+
const debounced = function(...args) {
|
|
3181
|
+
if (maxWait != null) {
|
|
3182
|
+
if (pendingAt === null) pendingAt = Date.now();
|
|
3183
|
+
if (Date.now() - pendingAt >= maxWait) {
|
|
3184
|
+
result = func.apply(this, args);
|
|
3185
|
+
pendingAt = Date.now();
|
|
3186
|
+
_debounced.cancel();
|
|
3187
|
+
_debounced.schedule();
|
|
3188
|
+
return result;
|
|
3189
|
+
}
|
|
3190
|
+
}
|
|
3191
|
+
_debounced.apply(this, args);
|
|
3192
|
+
return result;
|
|
3193
|
+
};
|
|
3194
|
+
const flush = () => {
|
|
3195
|
+
_debounced.flush();
|
|
3196
|
+
return result;
|
|
3197
|
+
};
|
|
3198
|
+
debounced.cancel = _debounced.cancel;
|
|
3199
|
+
debounced.flush = flush;
|
|
3200
|
+
return debounced;
|
|
3201
|
+
}
|
|
3202
|
+
//#endregion
|
|
3203
|
+
//#region ../../node_modules/.pnpm/es-toolkit@1.49.0/node_modules/es-toolkit/dist/compat/function/throttle.mjs
|
|
3204
|
+
/**
|
|
3205
|
+
* Creates a throttled function that only invokes the provided function at most once
|
|
3206
|
+
* per every `throttleMs` milliseconds. Subsequent calls to the throttled function
|
|
3207
|
+
* within the wait time will not trigger the execution of the original function.
|
|
3208
|
+
*
|
|
3209
|
+
* @template F - The type of function.
|
|
3210
|
+
* @param func - The function to throttle.
|
|
3211
|
+
* @param throttleMs - The number of milliseconds to throttle executions to.
|
|
3212
|
+
* @param options - The options object
|
|
3213
|
+
* @param options.signal - An optional AbortSignal to cancel the throttled function.
|
|
3214
|
+
* @param options.leading - If `true`, the function will be invoked on the leading edge of the timeout.
|
|
3215
|
+
* @param options.trailing - If `true`, the function will be invoked on the trailing edge of the timeout.
|
|
3216
|
+
* @returns A new throttled function that accepts the same parameters as the original function.
|
|
3217
|
+
*
|
|
3218
|
+
* @example
|
|
3219
|
+
* const throttledFunction = throttle(() => {
|
|
3220
|
+
* console.log('Function executed');
|
|
3221
|
+
* }, 1000);
|
|
3222
|
+
*
|
|
3223
|
+
* // Will log 'Function executed' immediately
|
|
3224
|
+
* throttledFunction();
|
|
3225
|
+
*
|
|
3226
|
+
* // Will not log anything as it is within the throttle time
|
|
3227
|
+
* throttledFunction();
|
|
3228
|
+
*
|
|
3229
|
+
* // After 1 second
|
|
3230
|
+
* setTimeout(() => {
|
|
3231
|
+
* throttledFunction(); // Will log 'Function executed'
|
|
3232
|
+
* }, 1000);
|
|
3233
|
+
*/
|
|
3234
|
+
function throttle(func, throttleMs = 0, options = {}) {
|
|
3235
|
+
const { leading = true, trailing = true } = options;
|
|
3236
|
+
return debounce(func, throttleMs, {
|
|
3237
|
+
leading,
|
|
3238
|
+
maxWait: throttleMs,
|
|
3239
|
+
trailing
|
|
3240
|
+
});
|
|
3241
|
+
}
|
|
3242
|
+
//#endregion
|
|
3243
|
+
//#region ../ui/src/components/composites/scrollbar/index.tsx
|
|
3244
|
+
var Scrollbar = ({ ref, autoHideScrollbar = true, children, className, onScroll: externalOnScroll, style, showOnHover = false, ...htmlProps }) => {
|
|
3245
|
+
const [isScrolling, setIsScrolling] = React$1.useState(false);
|
|
3246
|
+
const timeoutRef = React$1.useRef(null);
|
|
3247
|
+
const clearScrollingTimeout = React$1.useCallback(() => {
|
|
3248
|
+
if (timeoutRef.current) {
|
|
3249
|
+
clearTimeout(timeoutRef.current);
|
|
3250
|
+
timeoutRef.current = null;
|
|
3251
|
+
}
|
|
3252
|
+
}, []);
|
|
3253
|
+
const handleScroll = React$1.useCallback(() => {
|
|
3254
|
+
if (!autoHideScrollbar) return;
|
|
3255
|
+
setIsScrolling(true);
|
|
3256
|
+
clearScrollingTimeout();
|
|
3257
|
+
timeoutRef.current = setTimeout(() => {
|
|
3258
|
+
setIsScrolling(false);
|
|
3259
|
+
timeoutRef.current = null;
|
|
3260
|
+
}, 1500);
|
|
3261
|
+
}, [autoHideScrollbar, clearScrollingTimeout]);
|
|
3262
|
+
const throttledInternalScrollHandler = React$1.useMemo(() => throttle(handleScroll, 100, {
|
|
3263
|
+
leading: true,
|
|
3264
|
+
trailing: true
|
|
3265
|
+
}), [handleScroll]);
|
|
3266
|
+
const combinedOnScroll = React$1.useCallback(() => {
|
|
3267
|
+
throttledInternalScrollHandler();
|
|
3268
|
+
externalOnScroll?.();
|
|
3269
|
+
}, [externalOnScroll, throttledInternalScrollHandler]);
|
|
3270
|
+
React$1.useEffect(() => {
|
|
3271
|
+
return () => {
|
|
3272
|
+
clearScrollingTimeout();
|
|
3273
|
+
throttledInternalScrollHandler.cancel();
|
|
3274
|
+
};
|
|
3275
|
+
}, [clearScrollingTimeout, throttledInternalScrollHandler]);
|
|
3276
|
+
const isScrollbarVisible = !autoHideScrollbar || isScrolling;
|
|
3277
|
+
const useHoverVisibility = showOnHover && autoHideScrollbar;
|
|
3278
|
+
return /* @__PURE__ */ jsx("div", {
|
|
3279
|
+
...htmlProps,
|
|
3280
|
+
ref,
|
|
3281
|
+
className: cn("[scrollbar-gutter:stable] overflow-y-auto", useHoverVisibility && "[scrollbar-color:transparent_transparent] hover:[scrollbar-color:var(--scrollbar-thumb-hover)_transparent] data-[scrolling=true]:[scrollbar-color:var(--scrollbar-thumb)_transparent]", !useHoverVisibility && "[&::-webkit-scrollbar-thumb]:transition-[background] [&::-webkit-scrollbar-thumb]:duration-[2000ms] [&::-webkit-scrollbar-thumb:hover]:bg-[var(--scrollbar-thumb-hover)]", !useHoverVisibility && (isScrollbarVisible ? "[&::-webkit-scrollbar-thumb]:bg-[var(--scrollbar-thumb)]" : "[&::-webkit-scrollbar-thumb]:bg-transparent"), className),
|
|
3282
|
+
"data-scrolling": isScrolling ? "true" : "false",
|
|
3283
|
+
onScroll: combinedOnScroll,
|
|
3284
|
+
style: {
|
|
3285
|
+
...style,
|
|
3286
|
+
...!useHoverVisibility && { scrollbarColor: isScrollbarVisible ? "var(--scrollbar-thumb) transparent" : "transparent transparent" }
|
|
3287
|
+
},
|
|
3288
|
+
children
|
|
3289
|
+
});
|
|
3290
|
+
};
|
|
3291
|
+
Scrollbar.displayName = "Scrollbar";
|
|
3292
|
+
//#endregion
|
|
3293
|
+
//#region src/FilePreviewToolbar.tsx
|
|
3294
|
+
var FilePreviewToolbarPortalContext = createContext(void 0);
|
|
3295
|
+
function FilePreviewToolbarPortalProvider({ children }) {
|
|
3296
|
+
const [target, setTarget] = useState(null);
|
|
3297
|
+
const value = useMemo(() => ({
|
|
3298
|
+
setTarget,
|
|
3299
|
+
target
|
|
3300
|
+
}), [target]);
|
|
3301
|
+
return /* @__PURE__ */ jsx(FilePreviewToolbarPortalContext, {
|
|
3302
|
+
value,
|
|
3303
|
+
children
|
|
3304
|
+
});
|
|
3305
|
+
}
|
|
3306
|
+
function FilePreviewToolbarPortalHost() {
|
|
3307
|
+
const context = use(FilePreviewToolbarPortalContext);
|
|
3308
|
+
return /* @__PURE__ */ jsx("div", {
|
|
3309
|
+
ref: context?.setTarget,
|
|
3310
|
+
"data-testid": "file-preview-toolbar-host",
|
|
3311
|
+
className: "ml-3 flex max-w-[70%] min-w-0 items-center justify-end overflow-x-auto"
|
|
3312
|
+
});
|
|
3313
|
+
}
|
|
3314
|
+
function FilePreviewToolbar({ "aria-label": ariaLabel, children }) {
|
|
3315
|
+
const context = use(FilePreviewToolbarPortalContext);
|
|
3316
|
+
if (context && !context.target) return null;
|
|
3317
|
+
const toolbar = context ? /* @__PURE__ */ jsx("div", {
|
|
3318
|
+
role: "toolbar",
|
|
3319
|
+
"aria-label": ariaLabel,
|
|
3320
|
+
className: "flex min-w-max shrink-0 items-center justify-end gap-1",
|
|
3321
|
+
children
|
|
3322
|
+
}) : /* @__PURE__ */ jsx("div", {
|
|
3323
|
+
role: "toolbar",
|
|
3324
|
+
"aria-label": ariaLabel,
|
|
3325
|
+
className: "relative flex h-11 min-h-11 shrink-0 items-center overflow-x-auto px-3 after:pointer-events-none after:absolute after:right-3 after:bottom-0 after:left-3 after:border-b after:border-border after:content-['']",
|
|
3326
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
3327
|
+
className: "mx-auto flex min-w-max shrink-0 items-center justify-center gap-1",
|
|
3328
|
+
children
|
|
3329
|
+
})
|
|
3330
|
+
});
|
|
3331
|
+
return context?.target ? createPortal(toolbar, context.target) : toolbar;
|
|
3332
|
+
}
|
|
3333
|
+
//#endregion
|
|
3334
|
+
//#region src/previewContext.ts
|
|
3335
|
+
var PreviewHostContext = createContext({});
|
|
3336
|
+
function usePreviewHost() {
|
|
3337
|
+
return use(PreviewHostContext);
|
|
3338
|
+
}
|
|
3339
|
+
function usePreviewLogger(context) {
|
|
3340
|
+
const { onDiagnostic } = usePreviewHost();
|
|
3341
|
+
return useMemo(() => ({
|
|
3342
|
+
error: (message, detail, code) => onDiagnostic?.({
|
|
3343
|
+
code,
|
|
3344
|
+
level: "error",
|
|
3345
|
+
context,
|
|
3346
|
+
message,
|
|
3347
|
+
detail
|
|
3348
|
+
}),
|
|
3349
|
+
warn: (message, detail) => onDiagnostic?.({
|
|
3350
|
+
level: "warn",
|
|
3351
|
+
context,
|
|
3352
|
+
message,
|
|
3353
|
+
detail
|
|
3354
|
+
})
|
|
3355
|
+
}), [context, onDiagnostic]);
|
|
3356
|
+
}
|
|
3357
|
+
//#endregion
|
|
3358
|
+
//#region src/FilePreviewLayout.tsx
|
|
3359
|
+
function FilePreviewFrame({ children }) {
|
|
3360
|
+
return /* @__PURE__ */ jsx("div", {
|
|
3361
|
+
"data-ui": "file-preview.view",
|
|
3362
|
+
className: "flex h-full min-h-0 w-full flex-col overflow-hidden bg-transparent text-foreground",
|
|
3363
|
+
children
|
|
3364
|
+
});
|
|
3365
|
+
}
|
|
3366
|
+
function FilePreviewContent({ children, composerInset = true, scrollsInternally = false }) {
|
|
3367
|
+
const { options } = usePreviewHost();
|
|
3368
|
+
const reserveInset = composerInset && !(scrollsInternally && options?.bottomInset === "content");
|
|
3369
|
+
return /* @__PURE__ */ jsx(Scrollbar, {
|
|
3370
|
+
"data-testid": "file-preview-content",
|
|
3371
|
+
className: cn("min-h-0 flex-1 [scrollbar-gutter:auto]", reserveInset && "pb-[var(--file-preview-bottom-inset,0px)]"),
|
|
3372
|
+
children
|
|
3373
|
+
});
|
|
3374
|
+
}
|
|
3375
|
+
function FilePreviewShell({ children, header }) {
|
|
3376
|
+
if (header === void 0) return children;
|
|
3377
|
+
return /* @__PURE__ */ jsx(FilePreviewToolbarPortalProvider, { children: /* @__PURE__ */ jsxs(FilePreviewFrame, { children: [/* @__PURE__ */ jsxs("div", {
|
|
3378
|
+
"data-testid": "file-preview-header",
|
|
3379
|
+
className: "relative flex h-11 min-h-11 shrink-0 items-center px-3 after:pointer-events-none after:absolute after:right-3 after:bottom-0 after:left-3 after:border-b after:border-border after:content-['']",
|
|
3380
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
3381
|
+
className: "flex min-w-0 flex-1 items-center gap-2",
|
|
3382
|
+
children: header
|
|
3383
|
+
}), /* @__PURE__ */ jsx(FilePreviewToolbarPortalHost, {})]
|
|
3384
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
3385
|
+
className: "min-h-0 flex-1 overflow-hidden",
|
|
3386
|
+
children
|
|
3387
|
+
})] }) });
|
|
3388
|
+
}
|
|
3389
|
+
var FilePreviewLayout = {
|
|
3390
|
+
Frame: FilePreviewFrame,
|
|
3391
|
+
Content: FilePreviewContent,
|
|
3392
|
+
Shell: FilePreviewShell
|
|
3393
|
+
};
|
|
3394
|
+
//#endregion
|
|
3395
|
+
//#region ../../node_modules/.pnpm/react-i18next@14.1.3_i18next@23.16.8_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/react-i18next/dist/es/utils.js
|
|
3396
|
+
function warn() {
|
|
3397
|
+
if (console && console.warn) {
|
|
3398
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
|
|
3399
|
+
if (isString(args[0])) args[0] = `react-i18next:: ${args[0]}`;
|
|
3400
|
+
console.warn(...args);
|
|
3401
|
+
}
|
|
3402
|
+
}
|
|
3403
|
+
var alreadyWarned = {};
|
|
3404
|
+
function warnOnce() {
|
|
3405
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) args[_key2] = arguments[_key2];
|
|
3406
|
+
if (isString(args[0]) && alreadyWarned[args[0]]) return;
|
|
3407
|
+
if (isString(args[0])) alreadyWarned[args[0]] = /* @__PURE__ */ new Date();
|
|
3408
|
+
warn(...args);
|
|
3409
|
+
}
|
|
3410
|
+
var loadedClb = (i18n, cb) => () => {
|
|
3411
|
+
if (i18n.isInitialized) cb();
|
|
3412
|
+
else {
|
|
3413
|
+
const initialized = () => {
|
|
3414
|
+
setTimeout(() => {
|
|
3415
|
+
i18n.off("initialized", initialized);
|
|
3416
|
+
}, 0);
|
|
3417
|
+
cb();
|
|
3418
|
+
};
|
|
3419
|
+
i18n.on("initialized", initialized);
|
|
3420
|
+
}
|
|
3421
|
+
};
|
|
3422
|
+
var loadNamespaces = (i18n, ns, cb) => {
|
|
3423
|
+
i18n.loadNamespaces(ns, loadedClb(i18n, cb));
|
|
3424
|
+
};
|
|
3425
|
+
var loadLanguages = (i18n, lng, ns, cb) => {
|
|
3426
|
+
if (isString(ns)) ns = [ns];
|
|
3427
|
+
ns.forEach((n) => {
|
|
3428
|
+
if (i18n.options.ns.indexOf(n) < 0) i18n.options.ns.push(n);
|
|
3429
|
+
});
|
|
3430
|
+
i18n.loadLanguages(lng, loadedClb(i18n, cb));
|
|
3431
|
+
};
|
|
3432
|
+
var oldI18nextHasLoadedNamespace = function(ns, i18n) {
|
|
3433
|
+
let options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
3434
|
+
const lng = i18n.languages[0];
|
|
3435
|
+
const fallbackLng = i18n.options ? i18n.options.fallbackLng : false;
|
|
3436
|
+
const lastLng = i18n.languages[i18n.languages.length - 1];
|
|
3437
|
+
if (lng.toLowerCase() === "cimode") return true;
|
|
3438
|
+
const loadNotPending = (l, n) => {
|
|
3439
|
+
const loadState = i18n.services.backendConnector.state[`${l}|${n}`];
|
|
3440
|
+
return loadState === -1 || loadState === 2;
|
|
3441
|
+
};
|
|
3442
|
+
if (options.bindI18n && options.bindI18n.indexOf("languageChanging") > -1 && i18n.services.backendConnector.backend && i18n.isLanguageChangingTo && !loadNotPending(i18n.isLanguageChangingTo, ns)) return false;
|
|
3443
|
+
if (i18n.hasResourceBundle(lng, ns)) return true;
|
|
3444
|
+
if (!i18n.services.backendConnector.backend || i18n.options.resources && !i18n.options.partialBundledLanguages) return true;
|
|
3445
|
+
if (loadNotPending(lng, ns) && (!fallbackLng || loadNotPending(lastLng, ns))) return true;
|
|
3446
|
+
return false;
|
|
3447
|
+
};
|
|
3448
|
+
var hasLoadedNamespace = function(ns, i18n) {
|
|
3449
|
+
let options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
3450
|
+
if (!i18n.languages || !i18n.languages.length) {
|
|
3451
|
+
warnOnce("i18n.languages were undefined or empty", i18n.languages);
|
|
3452
|
+
return true;
|
|
3453
|
+
}
|
|
3454
|
+
if (!(i18n.options.ignoreJSONStructure !== void 0)) return oldI18nextHasLoadedNamespace(ns, i18n, options);
|
|
3455
|
+
return i18n.hasLoadedNamespace(ns, {
|
|
3456
|
+
lng: options.lng,
|
|
3457
|
+
precheck: (i18nInstance, loadNotPending) => {
|
|
3458
|
+
if (options.bindI18n && options.bindI18n.indexOf("languageChanging") > -1 && i18nInstance.services.backendConnector.backend && i18nInstance.isLanguageChangingTo && !loadNotPending(i18nInstance.isLanguageChangingTo, ns)) return false;
|
|
3459
|
+
}
|
|
3460
|
+
});
|
|
3461
|
+
};
|
|
3462
|
+
var isString = (obj) => typeof obj === "string";
|
|
3463
|
+
var isObject = (obj) => typeof obj === "object" && obj !== null;
|
|
3464
|
+
//#endregion
|
|
3465
|
+
//#region ../../node_modules/.pnpm/react-i18next@14.1.3_i18next@23.16.8_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/react-i18next/dist/es/unescape.js
|
|
3466
|
+
var matchHtmlEntity = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g;
|
|
3467
|
+
var htmlEntities = {
|
|
3468
|
+
"&": "&",
|
|
3469
|
+
"&": "&",
|
|
3470
|
+
"<": "<",
|
|
3471
|
+
"<": "<",
|
|
3472
|
+
">": ">",
|
|
3473
|
+
">": ">",
|
|
3474
|
+
"'": "'",
|
|
3475
|
+
"'": "'",
|
|
3476
|
+
""": "\"",
|
|
3477
|
+
""": "\"",
|
|
3478
|
+
" ": " ",
|
|
3479
|
+
" ": " ",
|
|
3480
|
+
"©": "©",
|
|
3481
|
+
"©": "©",
|
|
3482
|
+
"®": "®",
|
|
3483
|
+
"®": "®",
|
|
3484
|
+
"…": "…",
|
|
3485
|
+
"…": "…",
|
|
3486
|
+
"/": "/",
|
|
3487
|
+
"/": "/"
|
|
3488
|
+
};
|
|
3489
|
+
var unescapeHtmlEntity = (m) => htmlEntities[m];
|
|
3490
|
+
var unescape = (text) => text.replace(matchHtmlEntity, unescapeHtmlEntity);
|
|
3491
|
+
//#endregion
|
|
3492
|
+
//#region ../../node_modules/.pnpm/react-i18next@14.1.3_i18next@23.16.8_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/react-i18next/dist/es/defaults.js
|
|
3493
|
+
var defaultOptions = {
|
|
3494
|
+
bindI18n: "languageChanged",
|
|
3495
|
+
bindI18nStore: "",
|
|
3496
|
+
transEmptyNodeValue: "",
|
|
3497
|
+
transSupportBasicHtmlNodes: true,
|
|
3498
|
+
transWrapTextNodes: "",
|
|
3499
|
+
transKeepBasicHtmlNodesFor: [
|
|
3500
|
+
"br",
|
|
3501
|
+
"strong",
|
|
3502
|
+
"i",
|
|
3503
|
+
"p"
|
|
3504
|
+
],
|
|
3505
|
+
useSuspense: true,
|
|
3506
|
+
unescape
|
|
3507
|
+
};
|
|
3508
|
+
var getDefaults = () => defaultOptions;
|
|
3509
|
+
//#endregion
|
|
3510
|
+
//#region ../../node_modules/.pnpm/react-i18next@14.1.3_i18next@23.16.8_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/react-i18next/dist/es/i18nInstance.js
|
|
3511
|
+
var i18nInstance;
|
|
3512
|
+
var getI18n = () => i18nInstance;
|
|
3513
|
+
//#endregion
|
|
3514
|
+
//#region ../../node_modules/.pnpm/react-i18next@14.1.3_i18next@23.16.8_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/react-i18next/dist/es/context.js
|
|
3515
|
+
var I18nContext = createContext();
|
|
3516
|
+
var ReportNamespaces = class {
|
|
3517
|
+
constructor() {
|
|
3518
|
+
this.usedNamespaces = {};
|
|
3519
|
+
}
|
|
3520
|
+
addUsedNamespaces(namespaces) {
|
|
3521
|
+
namespaces.forEach((ns) => {
|
|
3522
|
+
if (!this.usedNamespaces[ns]) this.usedNamespaces[ns] = true;
|
|
3523
|
+
});
|
|
3524
|
+
}
|
|
3525
|
+
getUsedNamespaces = () => Object.keys(this.usedNamespaces);
|
|
3526
|
+
};
|
|
3527
|
+
//#endregion
|
|
3528
|
+
//#region ../../node_modules/.pnpm/react-i18next@14.1.3_i18next@23.16.8_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/react-i18next/dist/es/useTranslation.js
|
|
3529
|
+
var usePrevious = (value, ignore) => {
|
|
3530
|
+
const ref = useRef();
|
|
3531
|
+
useEffect(() => {
|
|
3532
|
+
ref.current = ignore ? ref.current : value;
|
|
3533
|
+
}, [value, ignore]);
|
|
3534
|
+
return ref.current;
|
|
3535
|
+
};
|
|
3536
|
+
var alwaysNewT = (i18n, language, namespace, keyPrefix) => i18n.getFixedT(language, namespace, keyPrefix);
|
|
3537
|
+
var useMemoizedT = (i18n, language, namespace, keyPrefix) => useCallback(alwaysNewT(i18n, language, namespace, keyPrefix), [
|
|
3538
|
+
i18n,
|
|
3539
|
+
language,
|
|
3540
|
+
namespace,
|
|
3541
|
+
keyPrefix
|
|
3542
|
+
]);
|
|
3543
|
+
var useTranslation = function(ns) {
|
|
3544
|
+
let props = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
3545
|
+
const { i18n: i18nFromProps } = props;
|
|
3546
|
+
const { i18n: i18nFromContext, defaultNS: defaultNSFromContext } = useContext(I18nContext) || {};
|
|
3547
|
+
const i18n = i18nFromProps || i18nFromContext || getI18n();
|
|
3548
|
+
if (i18n && !i18n.reportNamespaces) i18n.reportNamespaces = new ReportNamespaces();
|
|
3549
|
+
if (!i18n) {
|
|
3550
|
+
warnOnce("You will need to pass in an i18next instance by using initReactI18next");
|
|
3551
|
+
const notReadyT = (k, optsOrDefaultValue) => {
|
|
3552
|
+
if (isString(optsOrDefaultValue)) return optsOrDefaultValue;
|
|
3553
|
+
if (isObject(optsOrDefaultValue) && isString(optsOrDefaultValue.defaultValue)) return optsOrDefaultValue.defaultValue;
|
|
3554
|
+
return Array.isArray(k) ? k[k.length - 1] : k;
|
|
3555
|
+
};
|
|
3556
|
+
const retNotReady = [
|
|
3557
|
+
notReadyT,
|
|
3558
|
+
{},
|
|
3559
|
+
false
|
|
3560
|
+
];
|
|
3561
|
+
retNotReady.t = notReadyT;
|
|
3562
|
+
retNotReady.i18n = {};
|
|
3563
|
+
retNotReady.ready = false;
|
|
3564
|
+
return retNotReady;
|
|
3565
|
+
}
|
|
3566
|
+
if (i18n.options.react && i18n.options.react.wait !== void 0) warnOnce("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");
|
|
3567
|
+
const i18nOptions = {
|
|
3568
|
+
...getDefaults(),
|
|
3569
|
+
...i18n.options.react,
|
|
3570
|
+
...props
|
|
3571
|
+
};
|
|
3572
|
+
const { useSuspense, keyPrefix } = i18nOptions;
|
|
3573
|
+
let namespaces = ns || defaultNSFromContext || i18n.options && i18n.options.defaultNS;
|
|
3574
|
+
namespaces = isString(namespaces) ? [namespaces] : namespaces || ["translation"];
|
|
3575
|
+
if (i18n.reportNamespaces.addUsedNamespaces) i18n.reportNamespaces.addUsedNamespaces(namespaces);
|
|
3576
|
+
const ready = (i18n.isInitialized || i18n.initializedStoreOnce) && namespaces.every((n) => hasLoadedNamespace(n, i18n, i18nOptions));
|
|
3577
|
+
const memoGetT = useMemoizedT(i18n, props.lng || null, i18nOptions.nsMode === "fallback" ? namespaces : namespaces[0], keyPrefix);
|
|
3578
|
+
const getT = () => memoGetT;
|
|
3579
|
+
const getNewT = () => alwaysNewT(i18n, props.lng || null, i18nOptions.nsMode === "fallback" ? namespaces : namespaces[0], keyPrefix);
|
|
3580
|
+
const [t, setT] = useState(getT);
|
|
3581
|
+
let joinedNS = namespaces.join();
|
|
3582
|
+
if (props.lng) joinedNS = `${props.lng}${joinedNS}`;
|
|
3583
|
+
const previousJoinedNS = usePrevious(joinedNS);
|
|
3584
|
+
const isMounted = useRef(true);
|
|
3585
|
+
useEffect(() => {
|
|
3586
|
+
const { bindI18n, bindI18nStore } = i18nOptions;
|
|
3587
|
+
isMounted.current = true;
|
|
3588
|
+
if (!ready && !useSuspense) {
|
|
3589
|
+
if (props.lng) loadLanguages(i18n, props.lng, namespaces, () => {
|
|
3590
|
+
if (isMounted.current) setT(getNewT);
|
|
3591
|
+
});
|
|
3592
|
+
else loadNamespaces(i18n, namespaces, () => {
|
|
3593
|
+
if (isMounted.current) setT(getNewT);
|
|
3594
|
+
});
|
|
3595
|
+
}
|
|
3596
|
+
if (ready && previousJoinedNS && previousJoinedNS !== joinedNS && isMounted.current) setT(getNewT);
|
|
3597
|
+
const boundReset = () => {
|
|
3598
|
+
if (isMounted.current) setT(getNewT);
|
|
3599
|
+
};
|
|
3600
|
+
if (bindI18n && i18n) i18n.on(bindI18n, boundReset);
|
|
3601
|
+
if (bindI18nStore && i18n) i18n.store.on(bindI18nStore, boundReset);
|
|
3602
|
+
return () => {
|
|
3603
|
+
isMounted.current = false;
|
|
3604
|
+
if (bindI18n && i18n) bindI18n.split(" ").forEach((e) => i18n.off(e, boundReset));
|
|
3605
|
+
if (bindI18nStore && i18n) bindI18nStore.split(" ").forEach((e) => i18n.store.off(e, boundReset));
|
|
3606
|
+
};
|
|
3607
|
+
}, [i18n, joinedNS]);
|
|
3608
|
+
useEffect(() => {
|
|
3609
|
+
if (isMounted.current && ready) setT(getT);
|
|
3610
|
+
}, [
|
|
3611
|
+
i18n,
|
|
3612
|
+
keyPrefix,
|
|
3613
|
+
ready
|
|
3614
|
+
]);
|
|
3615
|
+
const ret = [
|
|
3616
|
+
t,
|
|
3617
|
+
i18n,
|
|
3618
|
+
ready
|
|
3619
|
+
];
|
|
3620
|
+
ret.t = t;
|
|
3621
|
+
ret.i18n = i18n;
|
|
3622
|
+
ret.ready = ready;
|
|
3623
|
+
if (ready) return ret;
|
|
3624
|
+
if (!ready && !useSuspense) return ret;
|
|
3625
|
+
throw new Promise((resolve) => {
|
|
3626
|
+
if (props.lng) loadLanguages(i18n, props.lng, namespaces, () => resolve());
|
|
3627
|
+
else loadNamespaces(i18n, namespaces, () => resolve());
|
|
3628
|
+
});
|
|
3629
|
+
};
|
|
3630
|
+
//#endregion
|
|
3631
|
+
export { cva as _, usePreviewHost as a, useComposedRefs as b, FilePreviewToolbarPortalHost as c, EmptyState as d, Button as f, createLucideIcon as g, FileWarning as h, PreviewHostContext as i, FilePreviewToolbarPortalProvider as l, LoaderCircle as m, I18nContext as n, usePreviewLogger as o, cn as p, FilePreviewLayout as r, FilePreviewToolbar as s, useTranslation as t, Scrollbar as u, createSlot as v, createSlottable as y };
|