@mgcrea/react-native-tailwind 0.15.1 → 0.15.3
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 +5 -0
- package/dist/babel/index.cjs +85 -13
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/parser/index.js +1 -1
- package/dist/parser/layout.js +1 -1
- package/dist/parser/layout.test.js +1 -1
- package/dist/parser/transforms.test.js +1 -1
- package/dist/runtime.cjs +1 -1
- package/dist/runtime.cjs.map +4 -4
- package/dist/runtime.js +1 -1
- package/dist/runtime.js.map +4 -4
- package/dist/utils/mergeStyles.d.ts +34 -0
- package/dist/utils/mergeStyles.js +1 -0
- package/dist/utils/mergeStyles.test.js +1 -0
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/parser/index.ts +2 -1
- package/src/parser/layout.test.ts +38 -3
- package/src/parser/layout.ts +60 -20
- package/src/parser/transforms.test.ts +105 -0
- package/src/utils/mergeStyles.test.ts +125 -0
- package/src/utils/mergeStyles.ts +103 -0
package/README.md
CHANGED
|
@@ -53,6 +53,11 @@ Compile-time Tailwind CSS for React Native with zero runtime overhead. Transform
|
|
|
53
53
|
|
|
54
54
|
📊 **[How It Compares](https://mgcrea.github.io/react-native-tailwind/getting-started/how-it-compares/)** - See how this library stacks up against other React Native styling solutions.
|
|
55
55
|
|
|
56
|
+
### Related projects
|
|
57
|
+
|
|
58
|
+
- For iOS native components, check out [@mgcrea/react-native-swiftui](https://github.com/mgcrea/react-native-swiftui).
|
|
59
|
+
- For Android native components, check out [@mgcrea/react-native-jetpack-compose](https://github.com/mgcrea/react-native-jetpack-compose).
|
|
60
|
+
|
|
56
61
|
## Demo
|
|
57
62
|
|
|
58
63
|

|
package/dist/babel/index.cjs
CHANGED
|
@@ -293,6 +293,42 @@ function createInitialState(options, filename, colorSchemeImportSource, colorSch
|
|
|
293
293
|
};
|
|
294
294
|
}
|
|
295
295
|
|
|
296
|
+
// src/utils/mergeStyles.ts
|
|
297
|
+
function getTransformType(transform) {
|
|
298
|
+
return Object.keys(transform)[0];
|
|
299
|
+
}
|
|
300
|
+
function mergeTransforms(target, source) {
|
|
301
|
+
const result = [...target];
|
|
302
|
+
for (const sourceTransform of source) {
|
|
303
|
+
const sourceType = getTransformType(sourceTransform);
|
|
304
|
+
const existingIndex = result.findIndex((t) => getTransformType(t) === sourceType);
|
|
305
|
+
if (existingIndex !== -1) {
|
|
306
|
+
result[existingIndex] = sourceTransform;
|
|
307
|
+
} else {
|
|
308
|
+
result.push(sourceTransform);
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
return result;
|
|
312
|
+
}
|
|
313
|
+
function mergeStyles(target, source) {
|
|
314
|
+
for (const key in source) {
|
|
315
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
316
|
+
const sourceValue = source[key];
|
|
317
|
+
if (key === "transform" && Array.isArray(sourceValue)) {
|
|
318
|
+
const targetValue = target[key];
|
|
319
|
+
if (Array.isArray(targetValue)) {
|
|
320
|
+
target.transform = mergeTransforms(targetValue, sourceValue);
|
|
321
|
+
} else {
|
|
322
|
+
target[key] = sourceValue;
|
|
323
|
+
}
|
|
324
|
+
} else {
|
|
325
|
+
target[key] = sourceValue;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
return target;
|
|
330
|
+
}
|
|
331
|
+
|
|
296
332
|
// src/parser/aspectRatio.ts
|
|
297
333
|
var ASPECT_RATIO_PRESETS = {
|
|
298
334
|
"aspect-auto": void 0,
|
|
@@ -1160,60 +1196,96 @@ function parseLayout(cls, customSpacing) {
|
|
|
1160
1196
|
return { zIndex: zValue };
|
|
1161
1197
|
}
|
|
1162
1198
|
}
|
|
1163
|
-
|
|
1164
|
-
|
|
1199
|
+
const topMatch = cls.match(/^(-?)top-(.+)$/);
|
|
1200
|
+
if (topMatch) {
|
|
1201
|
+
const [, negPrefix, topKey] = topMatch;
|
|
1202
|
+
const isNegative = negPrefix === "-";
|
|
1165
1203
|
if (topKey === "auto") {
|
|
1166
1204
|
return {};
|
|
1167
1205
|
}
|
|
1168
1206
|
const arbitraryTop = parseArbitraryInset(topKey);
|
|
1169
1207
|
if (arbitraryTop !== null) {
|
|
1208
|
+
if (typeof arbitraryTop === "number") {
|
|
1209
|
+
return { top: isNegative ? -arbitraryTop : arbitraryTop };
|
|
1210
|
+
}
|
|
1211
|
+
if (isNegative && arbitraryTop.endsWith("%")) {
|
|
1212
|
+
const numValue = parseFloat(arbitraryTop);
|
|
1213
|
+
return { top: `${-numValue}%` };
|
|
1214
|
+
}
|
|
1170
1215
|
return { top: arbitraryTop };
|
|
1171
1216
|
}
|
|
1172
1217
|
const topValue = insetMap[topKey];
|
|
1173
1218
|
if (topValue !== void 0) {
|
|
1174
|
-
return { top: topValue };
|
|
1219
|
+
return { top: isNegative ? -topValue : topValue };
|
|
1175
1220
|
}
|
|
1176
1221
|
}
|
|
1177
|
-
|
|
1178
|
-
|
|
1222
|
+
const rightMatch = cls.match(/^(-?)right-(.+)$/);
|
|
1223
|
+
if (rightMatch) {
|
|
1224
|
+
const [, negPrefix, rightKey] = rightMatch;
|
|
1225
|
+
const isNegative = negPrefix === "-";
|
|
1179
1226
|
if (rightKey === "auto") {
|
|
1180
1227
|
return {};
|
|
1181
1228
|
}
|
|
1182
1229
|
const arbitraryRight = parseArbitraryInset(rightKey);
|
|
1183
1230
|
if (arbitraryRight !== null) {
|
|
1231
|
+
if (typeof arbitraryRight === "number") {
|
|
1232
|
+
return { right: isNegative ? -arbitraryRight : arbitraryRight };
|
|
1233
|
+
}
|
|
1234
|
+
if (isNegative && arbitraryRight.endsWith("%")) {
|
|
1235
|
+
const numValue = parseFloat(arbitraryRight);
|
|
1236
|
+
return { right: `${-numValue}%` };
|
|
1237
|
+
}
|
|
1184
1238
|
return { right: arbitraryRight };
|
|
1185
1239
|
}
|
|
1186
1240
|
const rightValue = insetMap[rightKey];
|
|
1187
1241
|
if (rightValue !== void 0) {
|
|
1188
|
-
return { right: rightValue };
|
|
1242
|
+
return { right: isNegative ? -rightValue : rightValue };
|
|
1189
1243
|
}
|
|
1190
1244
|
}
|
|
1191
|
-
|
|
1192
|
-
|
|
1245
|
+
const bottomMatch = cls.match(/^(-?)bottom-(.+)$/);
|
|
1246
|
+
if (bottomMatch) {
|
|
1247
|
+
const [, negPrefix, bottomKey] = bottomMatch;
|
|
1248
|
+
const isNegative = negPrefix === "-";
|
|
1193
1249
|
if (bottomKey === "auto") {
|
|
1194
1250
|
return {};
|
|
1195
1251
|
}
|
|
1196
1252
|
const arbitraryBottom = parseArbitraryInset(bottomKey);
|
|
1197
1253
|
if (arbitraryBottom !== null) {
|
|
1254
|
+
if (typeof arbitraryBottom === "number") {
|
|
1255
|
+
return { bottom: isNegative ? -arbitraryBottom : arbitraryBottom };
|
|
1256
|
+
}
|
|
1257
|
+
if (isNegative && arbitraryBottom.endsWith("%")) {
|
|
1258
|
+
const numValue = parseFloat(arbitraryBottom);
|
|
1259
|
+
return { bottom: `${-numValue}%` };
|
|
1260
|
+
}
|
|
1198
1261
|
return { bottom: arbitraryBottom };
|
|
1199
1262
|
}
|
|
1200
1263
|
const bottomValue = insetMap[bottomKey];
|
|
1201
1264
|
if (bottomValue !== void 0) {
|
|
1202
|
-
return { bottom: bottomValue };
|
|
1265
|
+
return { bottom: isNegative ? -bottomValue : bottomValue };
|
|
1203
1266
|
}
|
|
1204
1267
|
}
|
|
1205
|
-
|
|
1206
|
-
|
|
1268
|
+
const leftMatch = cls.match(/^(-?)left-(.+)$/);
|
|
1269
|
+
if (leftMatch) {
|
|
1270
|
+
const [, negPrefix, leftKey] = leftMatch;
|
|
1271
|
+
const isNegative = negPrefix === "-";
|
|
1207
1272
|
if (leftKey === "auto") {
|
|
1208
1273
|
return {};
|
|
1209
1274
|
}
|
|
1210
1275
|
const arbitraryLeft = parseArbitraryInset(leftKey);
|
|
1211
1276
|
if (arbitraryLeft !== null) {
|
|
1277
|
+
if (typeof arbitraryLeft === "number") {
|
|
1278
|
+
return { left: isNegative ? -arbitraryLeft : arbitraryLeft };
|
|
1279
|
+
}
|
|
1280
|
+
if (isNegative && arbitraryLeft.endsWith("%")) {
|
|
1281
|
+
const numValue = parseFloat(arbitraryLeft);
|
|
1282
|
+
return { left: `${-numValue}%` };
|
|
1283
|
+
}
|
|
1212
1284
|
return { left: arbitraryLeft };
|
|
1213
1285
|
}
|
|
1214
1286
|
const leftValue = insetMap[leftKey];
|
|
1215
1287
|
if (leftValue !== void 0) {
|
|
1216
|
-
return { left: leftValue };
|
|
1288
|
+
return { left: isNegative ? -leftValue : leftValue };
|
|
1217
1289
|
}
|
|
1218
1290
|
}
|
|
1219
1291
|
const startMatch = cls.match(/^(-?)start-(.+)$/);
|
|
@@ -2334,7 +2406,7 @@ function parseClassName(className, customTheme) {
|
|
|
2334
2406
|
const style = {};
|
|
2335
2407
|
for (const cls of classes) {
|
|
2336
2408
|
const parsedStyle = parseClass(cls, customTheme);
|
|
2337
|
-
|
|
2409
|
+
mergeStyles(style, parsedStyle);
|
|
2338
2410
|
}
|
|
2339
2411
|
return style;
|
|
2340
2412
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
export { tw, twStyle } from "./stubs/tw";
|
|
6
6
|
export { parseClass, parseClassName } from "./parser";
|
|
7
7
|
export { flattenColors } from "./utils/flattenColors";
|
|
8
|
+
export { mergeStyles } from "./utils/mergeStyles";
|
|
8
9
|
export { generateStyleKey } from "./utils/styleKey";
|
|
9
10
|
export type { StyleObject } from "./types/core";
|
|
10
11
|
export type { NativeStyle, TwStyle } from "./types/runtime";
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:true});var _exportNames={tw:true,twStyle:true,parseClass:true,parseClassName:true,parseAspectRatio:true,parseBorder:true,parseColor:true,parseLayout:true,parsePlaceholderClass:true,parsePlaceholderClasses:true,parseShadow:true,parseSizing:true,parseSpacing:true,parseTypography:true,flattenColors:true,generateStyleKey:true,TAILWIND_COLORS:true,ASPECT_RATIO_PRESETS:true,COLORS:true,INSET_SCALE:true,Z_INDEX_SCALE:true,SHADOW_SCALE:true,SIZE_PERCENTAGES:true,SIZE_SCALE:true,SPACING_SCALE:true,FONT_SIZES:true,LETTER_SPACING_SCALE:true};Object.defineProperty(exports,"ASPECT_RATIO_PRESETS",{enumerable:true,get:function get(){return _aspectRatio.ASPECT_RATIO_PRESETS;}});Object.defineProperty(exports,"COLORS",{enumerable:true,get:function get(){return _colors.COLORS;}});Object.defineProperty(exports,"FONT_SIZES",{enumerable:true,get:function get(){return _typography.FONT_SIZES;}});Object.defineProperty(exports,"INSET_SCALE",{enumerable:true,get:function get(){return _layout.INSET_SCALE;}});Object.defineProperty(exports,"LETTER_SPACING_SCALE",{enumerable:true,get:function get(){return _typography.LETTER_SPACING_SCALE;}});Object.defineProperty(exports,"SHADOW_SCALE",{enumerable:true,get:function get(){return _shadows.SHADOW_SCALE;}});Object.defineProperty(exports,"SIZE_PERCENTAGES",{enumerable:true,get:function get(){return _sizing.SIZE_PERCENTAGES;}});Object.defineProperty(exports,"SIZE_SCALE",{enumerable:true,get:function get(){return _sizing.SIZE_SCALE;}});Object.defineProperty(exports,"SPACING_SCALE",{enumerable:true,get:function get(){return _spacing.SPACING_SCALE;}});Object.defineProperty(exports,"TAILWIND_COLORS",{enumerable:true,get:function get(){return _tailwind.TAILWIND_COLORS;}});Object.defineProperty(exports,"Z_INDEX_SCALE",{enumerable:true,get:function get(){return _layout.Z_INDEX_SCALE;}});Object.defineProperty(exports,"flattenColors",{enumerable:true,get:function get(){return _flattenColors.flattenColors;}});Object.defineProperty(exports,"generateStyleKey",{enumerable:true,get:function get(){return _styleKey.generateStyleKey;}});Object.defineProperty(exports,"parseAspectRatio",{enumerable:true,get:function get(){return _parser.parseAspectRatio;}});Object.defineProperty(exports,"parseBorder",{enumerable:true,get:function get(){return _parser.parseBorder;}});Object.defineProperty(exports,"parseClass",{enumerable:true,get:function get(){return _parser.parseClass;}});Object.defineProperty(exports,"parseClassName",{enumerable:true,get:function get(){return _parser.parseClassName;}});Object.defineProperty(exports,"parseColor",{enumerable:true,get:function get(){return _parser.parseColor;}});Object.defineProperty(exports,"parseLayout",{enumerable:true,get:function get(){return _parser.parseLayout;}});Object.defineProperty(exports,"parsePlaceholderClass",{enumerable:true,get:function get(){return _parser.parsePlaceholderClass;}});Object.defineProperty(exports,"parsePlaceholderClasses",{enumerable:true,get:function get(){return _parser.parsePlaceholderClasses;}});Object.defineProperty(exports,"parseShadow",{enumerable:true,get:function get(){return _parser.parseShadow;}});Object.defineProperty(exports,"parseSizing",{enumerable:true,get:function get(){return _parser.parseSizing;}});Object.defineProperty(exports,"parseSpacing",{enumerable:true,get:function get(){return _parser.parseSpacing;}});Object.defineProperty(exports,"parseTypography",{enumerable:true,get:function get(){return _parser.parseTypography;}});Object.defineProperty(exports,"tw",{enumerable:true,get:function get(){return _tw.tw;}});Object.defineProperty(exports,"twStyle",{enumerable:true,get:function get(){return _tw.twStyle;}});var _tw=require("./stubs/tw");var _parser=require("./parser");var _flattenColors=require("./utils/flattenColors");var _styleKey=require("./utils/styleKey");var _tailwind=require("./config/tailwind");var _aspectRatio=require("./parser/aspectRatio");var _colors=require("./parser/colors");var _layout=require("./parser/layout");var _shadows=require("./parser/shadows");var _sizing=require("./parser/sizing");var _spacing=require("./parser/spacing");var _typography=require("./parser/typography");var _components=require("./components");Object.keys(_components).forEach(function(key){if(key==="default"||key==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,key))return;if(key in exports&&exports[key]===_components[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return _components[key];}});});
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:true});var _exportNames={tw:true,twStyle:true,parseClass:true,parseClassName:true,parseAspectRatio:true,parseBorder:true,parseColor:true,parseLayout:true,parsePlaceholderClass:true,parsePlaceholderClasses:true,parseShadow:true,parseSizing:true,parseSpacing:true,parseTypography:true,flattenColors:true,mergeStyles:true,generateStyleKey:true,TAILWIND_COLORS:true,ASPECT_RATIO_PRESETS:true,COLORS:true,INSET_SCALE:true,Z_INDEX_SCALE:true,SHADOW_SCALE:true,SIZE_PERCENTAGES:true,SIZE_SCALE:true,SPACING_SCALE:true,FONT_SIZES:true,LETTER_SPACING_SCALE:true};Object.defineProperty(exports,"ASPECT_RATIO_PRESETS",{enumerable:true,get:function get(){return _aspectRatio.ASPECT_RATIO_PRESETS;}});Object.defineProperty(exports,"COLORS",{enumerable:true,get:function get(){return _colors.COLORS;}});Object.defineProperty(exports,"FONT_SIZES",{enumerable:true,get:function get(){return _typography.FONT_SIZES;}});Object.defineProperty(exports,"INSET_SCALE",{enumerable:true,get:function get(){return _layout.INSET_SCALE;}});Object.defineProperty(exports,"LETTER_SPACING_SCALE",{enumerable:true,get:function get(){return _typography.LETTER_SPACING_SCALE;}});Object.defineProperty(exports,"SHADOW_SCALE",{enumerable:true,get:function get(){return _shadows.SHADOW_SCALE;}});Object.defineProperty(exports,"SIZE_PERCENTAGES",{enumerable:true,get:function get(){return _sizing.SIZE_PERCENTAGES;}});Object.defineProperty(exports,"SIZE_SCALE",{enumerable:true,get:function get(){return _sizing.SIZE_SCALE;}});Object.defineProperty(exports,"SPACING_SCALE",{enumerable:true,get:function get(){return _spacing.SPACING_SCALE;}});Object.defineProperty(exports,"TAILWIND_COLORS",{enumerable:true,get:function get(){return _tailwind.TAILWIND_COLORS;}});Object.defineProperty(exports,"Z_INDEX_SCALE",{enumerable:true,get:function get(){return _layout.Z_INDEX_SCALE;}});Object.defineProperty(exports,"flattenColors",{enumerable:true,get:function get(){return _flattenColors.flattenColors;}});Object.defineProperty(exports,"generateStyleKey",{enumerable:true,get:function get(){return _styleKey.generateStyleKey;}});Object.defineProperty(exports,"mergeStyles",{enumerable:true,get:function get(){return _mergeStyles.mergeStyles;}});Object.defineProperty(exports,"parseAspectRatio",{enumerable:true,get:function get(){return _parser.parseAspectRatio;}});Object.defineProperty(exports,"parseBorder",{enumerable:true,get:function get(){return _parser.parseBorder;}});Object.defineProperty(exports,"parseClass",{enumerable:true,get:function get(){return _parser.parseClass;}});Object.defineProperty(exports,"parseClassName",{enumerable:true,get:function get(){return _parser.parseClassName;}});Object.defineProperty(exports,"parseColor",{enumerable:true,get:function get(){return _parser.parseColor;}});Object.defineProperty(exports,"parseLayout",{enumerable:true,get:function get(){return _parser.parseLayout;}});Object.defineProperty(exports,"parsePlaceholderClass",{enumerable:true,get:function get(){return _parser.parsePlaceholderClass;}});Object.defineProperty(exports,"parsePlaceholderClasses",{enumerable:true,get:function get(){return _parser.parsePlaceholderClasses;}});Object.defineProperty(exports,"parseShadow",{enumerable:true,get:function get(){return _parser.parseShadow;}});Object.defineProperty(exports,"parseSizing",{enumerable:true,get:function get(){return _parser.parseSizing;}});Object.defineProperty(exports,"parseSpacing",{enumerable:true,get:function get(){return _parser.parseSpacing;}});Object.defineProperty(exports,"parseTypography",{enumerable:true,get:function get(){return _parser.parseTypography;}});Object.defineProperty(exports,"tw",{enumerable:true,get:function get(){return _tw.tw;}});Object.defineProperty(exports,"twStyle",{enumerable:true,get:function get(){return _tw.twStyle;}});var _tw=require("./stubs/tw");var _parser=require("./parser");var _flattenColors=require("./utils/flattenColors");var _mergeStyles=require("./utils/mergeStyles");var _styleKey=require("./utils/styleKey");var _tailwind=require("./config/tailwind");var _aspectRatio=require("./parser/aspectRatio");var _colors=require("./parser/colors");var _layout=require("./parser/layout");var _shadows=require("./parser/shadows");var _sizing=require("./parser/sizing");var _spacing=require("./parser/spacing");var _typography=require("./parser/typography");var _components=require("./components");Object.keys(_components).forEach(function(key){if(key==="default"||key==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,key))return;if(key in exports&&exports[key]===_components[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return _components[key];}});});
|
package/dist/parser/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"expandSchemeModifier",{enumerable:true,get:function get(){return _modifiers.expandSchemeModifier;}});Object.defineProperty(exports,"hasModifier",{enumerable:true,get:function get(){return _modifiers.hasModifier;}});Object.defineProperty(exports,"isColorClass",{enumerable:true,get:function get(){return _modifiers.isColorClass;}});Object.defineProperty(exports,"isColorSchemeModifier",{enumerable:true,get:function get(){return _modifiers.isColorSchemeModifier;}});Object.defineProperty(exports,"isDirectionalModifier",{enumerable:true,get:function get(){return _modifiers.isDirectionalModifier;}});Object.defineProperty(exports,"isPlatformModifier",{enumerable:true,get:function get(){return _modifiers.isPlatformModifier;}});Object.defineProperty(exports,"isSchemeModifier",{enumerable:true,get:function get(){return _modifiers.isSchemeModifier;}});Object.defineProperty(exports,"isStateModifier",{enumerable:true,get:function get(){return _modifiers.isStateModifier;}});Object.defineProperty(exports,"parseAspectRatio",{enumerable:true,get:function get(){return _aspectRatio.parseAspectRatio;}});Object.defineProperty(exports,"parseBorder",{enumerable:true,get:function get(){return _borders.parseBorder;}});exports.parseClass=parseClass;exports.parseClassName=parseClassName;Object.defineProperty(exports,"parseColor",{enumerable:true,get:function get(){return _colors.parseColor;}});Object.defineProperty(exports,"parseLayout",{enumerable:true,get:function get(){return _layout.parseLayout;}});Object.defineProperty(exports,"parseModifier",{enumerable:true,get:function get(){return _modifiers.parseModifier;}});Object.defineProperty(exports,"parsePlaceholderClass",{enumerable:true,get:function get(){return _placeholder.parsePlaceholderClass;}});Object.defineProperty(exports,"parsePlaceholderClasses",{enumerable:true,get:function get(){return _placeholder.parsePlaceholderClasses;}});Object.defineProperty(exports,"parseShadow",{enumerable:true,get:function get(){return _shadows.parseShadow;}});Object.defineProperty(exports,"parseSizing",{enumerable:true,get:function get(){return _sizing.parseSizing;}});Object.defineProperty(exports,"parseSpacing",{enumerable:true,get:function get(){return _spacing.parseSpacing;}});Object.defineProperty(exports,"parseTransform",{enumerable:true,get:function get(){return _transforms.parseTransform;}});Object.defineProperty(exports,"parseTypography",{enumerable:true,get:function get(){return _typography.parseTypography;}});Object.defineProperty(exports,"splitModifierClasses",{enumerable:true,get:function get(){return _modifiers.splitModifierClasses;}});var _aspectRatio=require("./aspectRatio");var _borders=require("./borders");var _colors=require("./colors");var _layout=require("./layout");var _shadows=require("./shadows");var _sizing=require("./sizing");var _spacing=require("./spacing");var _transforms=require("./transforms");var _typography=require("./typography");var _placeholder=require("./placeholder");var _modifiers=require("./modifiers");function parseClassName(className,customTheme){var classes=className.split(/\s+/).filter(Boolean);var style={};for(var cls of classes){var parsedStyle=parseClass(cls,customTheme);
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"expandSchemeModifier",{enumerable:true,get:function get(){return _modifiers.expandSchemeModifier;}});Object.defineProperty(exports,"hasModifier",{enumerable:true,get:function get(){return _modifiers.hasModifier;}});Object.defineProperty(exports,"isColorClass",{enumerable:true,get:function get(){return _modifiers.isColorClass;}});Object.defineProperty(exports,"isColorSchemeModifier",{enumerable:true,get:function get(){return _modifiers.isColorSchemeModifier;}});Object.defineProperty(exports,"isDirectionalModifier",{enumerable:true,get:function get(){return _modifiers.isDirectionalModifier;}});Object.defineProperty(exports,"isPlatformModifier",{enumerable:true,get:function get(){return _modifiers.isPlatformModifier;}});Object.defineProperty(exports,"isSchemeModifier",{enumerable:true,get:function get(){return _modifiers.isSchemeModifier;}});Object.defineProperty(exports,"isStateModifier",{enumerable:true,get:function get(){return _modifiers.isStateModifier;}});Object.defineProperty(exports,"parseAspectRatio",{enumerable:true,get:function get(){return _aspectRatio.parseAspectRatio;}});Object.defineProperty(exports,"parseBorder",{enumerable:true,get:function get(){return _borders.parseBorder;}});exports.parseClass=parseClass;exports.parseClassName=parseClassName;Object.defineProperty(exports,"parseColor",{enumerable:true,get:function get(){return _colors.parseColor;}});Object.defineProperty(exports,"parseLayout",{enumerable:true,get:function get(){return _layout.parseLayout;}});Object.defineProperty(exports,"parseModifier",{enumerable:true,get:function get(){return _modifiers.parseModifier;}});Object.defineProperty(exports,"parsePlaceholderClass",{enumerable:true,get:function get(){return _placeholder.parsePlaceholderClass;}});Object.defineProperty(exports,"parsePlaceholderClasses",{enumerable:true,get:function get(){return _placeholder.parsePlaceholderClasses;}});Object.defineProperty(exports,"parseShadow",{enumerable:true,get:function get(){return _shadows.parseShadow;}});Object.defineProperty(exports,"parseSizing",{enumerable:true,get:function get(){return _sizing.parseSizing;}});Object.defineProperty(exports,"parseSpacing",{enumerable:true,get:function get(){return _spacing.parseSpacing;}});Object.defineProperty(exports,"parseTransform",{enumerable:true,get:function get(){return _transforms.parseTransform;}});Object.defineProperty(exports,"parseTypography",{enumerable:true,get:function get(){return _typography.parseTypography;}});Object.defineProperty(exports,"splitModifierClasses",{enumerable:true,get:function get(){return _modifiers.splitModifierClasses;}});var _mergeStyles=require("../utils/mergeStyles");var _aspectRatio=require("./aspectRatio");var _borders=require("./borders");var _colors=require("./colors");var _layout=require("./layout");var _shadows=require("./shadows");var _sizing=require("./sizing");var _spacing=require("./spacing");var _transforms=require("./transforms");var _typography=require("./typography");var _placeholder=require("./placeholder");var _modifiers=require("./modifiers");function parseClassName(className,customTheme){var classes=className.split(/\s+/).filter(Boolean);var style={};for(var cls of classes){var parsedStyle=parseClass(cls,customTheme);(0,_mergeStyles.mergeStyles)(style,parsedStyle);}return style;}function parseClass(cls,customTheme){var parsers=[function(cls){return(0,_spacing.parseSpacing)(cls,customTheme==null?void 0:customTheme.spacing);},function(cls){return(0,_borders.parseBorder)(cls,customTheme==null?void 0:customTheme.colors);},function(cls){return(0,_colors.parseColor)(cls,customTheme==null?void 0:customTheme.colors);},function(cls){return(0,_layout.parseLayout)(cls,customTheme==null?void 0:customTheme.spacing);},function(cls){return(0,_typography.parseTypography)(cls,customTheme==null?void 0:customTheme.fontFamily,customTheme==null?void 0:customTheme.fontSize);},function(cls){return(0,_sizing.parseSizing)(cls,customTheme==null?void 0:customTheme.spacing);},_shadows.parseShadow,_aspectRatio.parseAspectRatio,function(cls){return(0,_transforms.parseTransform)(cls,customTheme==null?void 0:customTheme.spacing);}];for(var parser of parsers){var result=parser(cls);if(result!==null){return result;}}if(process.env.NODE_ENV!=="production"){console.warn(`[react-native-tailwind] Unknown class: "${cls}"`);}return{};}
|
package/dist/parser/layout.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.Z_INDEX_SCALE=exports.INSET_SCALE=void 0;exports.parseLayout=parseLayout;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));function parseArbitraryInset(value){var pxMatch=value.match(/^\[(-?\d+)(?:px)?\]$/);if(pxMatch){return parseInt(pxMatch[1],10);}var percentMatch=value.match(/^\[(-?\d+(?:\.\d+)?)%\]$/);if(percentMatch){return`${percentMatch[1]}%`;}if(value.startsWith("[")&&value.endsWith("]")){if(process.env.NODE_ENV!=="production"){console.warn(`[react-native-tailwind] Unsupported arbitrary inset unit: ${value}. Only px and % are supported.`);}return null;}return null;}function parseArbitraryZIndex(value){var zMatch=value.match(/^\[(-?\d+)\]$/);if(zMatch){return parseInt(zMatch[1],10);}if(value.startsWith("[")&&value.endsWith("]")){if(process.env.NODE_ENV!=="production"){console.warn(`[react-native-tailwind] Invalid arbitrary z-index: ${value}. Only integers are supported.`);}return null;}return null;}function parseArbitraryGrowShrink(value){var match=value.match(/^\[(\d+(?:\.\d+)?|\.\d+)\]$/);if(match){return parseFloat(match[1]);}if(value.startsWith("[")&&value.endsWith("]")){if(process.env.NODE_ENV!=="production"){console.warn(`[react-native-tailwind] Invalid arbitrary grow/shrink value: ${value}. Only non-negative numbers are supported (e.g., [1.5], [2], [0.5], [.5]).`);}return null;}return null;}var DISPLAY_MAP={flex:{display:"flex"},hidden:{display:"none"}};var FLEX_DIRECTION_MAP={"flex-row":{flexDirection:"row"},"flex-row-reverse":{flexDirection:"row-reverse"},"flex-col":{flexDirection:"column"},"flex-col-reverse":{flexDirection:"column-reverse"}};var FLEX_WRAP_MAP={"flex-wrap":{flexWrap:"wrap"},"flex-wrap-reverse":{flexWrap:"wrap-reverse"},"flex-nowrap":{flexWrap:"nowrap"}};var FLEX_MAP={"flex-1":{flex:1},"flex-auto":{flex:1},"flex-none":{flex:0}};var GROW_SHRINK_MAP={grow:{flexGrow:1},"grow-0":{flexGrow:0},shrink:{flexShrink:1},"shrink-0":{flexShrink:0},"flex-grow":{flexGrow:1},"flex-grow-0":{flexGrow:0},"flex-shrink":{flexShrink:1},"flex-shrink-0":{flexShrink:0}};var JUSTIFY_CONTENT_MAP={"justify-start":{justifyContent:"flex-start"},"justify-end":{justifyContent:"flex-end"},"justify-center":{justifyContent:"center"},"justify-between":{justifyContent:"space-between"},"justify-around":{justifyContent:"space-around"},"justify-evenly":{justifyContent:"space-evenly"}};var ALIGN_ITEMS_MAP={"items-start":{alignItems:"flex-start"},"items-end":{alignItems:"flex-end"},"items-center":{alignItems:"center"},"items-baseline":{alignItems:"baseline"},"items-stretch":{alignItems:"stretch"}};var ALIGN_SELF_MAP={"self-auto":{alignSelf:"auto"},"self-start":{alignSelf:"flex-start"},"self-end":{alignSelf:"flex-end"},"self-center":{alignSelf:"center"},"self-stretch":{alignSelf:"stretch"},"self-baseline":{alignSelf:"baseline"}};var ALIGN_CONTENT_MAP={"content-start":{alignContent:"flex-start"},"content-end":{alignContent:"flex-end"},"content-center":{alignContent:"center"},"content-between":{alignContent:"space-between"},"content-around":{alignContent:"space-around"},"content-stretch":{alignContent:"stretch"}};var POSITION_MAP={absolute:{position:"absolute"},relative:{position:"relative"}};var OVERFLOW_MAP={"overflow-hidden":{overflow:"hidden"},"overflow-visible":{overflow:"visible"},"overflow-scroll":{overflow:"scroll"}};var OPACITY_MAP={"opacity-0":{opacity:0},"opacity-5":{opacity:0.05},"opacity-10":{opacity:0.1},"opacity-15":{opacity:0.15},"opacity-20":{opacity:0.2},"opacity-25":{opacity:0.25},"opacity-30":{opacity:0.3},"opacity-35":{opacity:0.35},"opacity-40":{opacity:0.4},"opacity-45":{opacity:0.45},"opacity-50":{opacity:0.5},"opacity-55":{opacity:0.55},"opacity-60":{opacity:0.6},"opacity-65":{opacity:0.65},"opacity-70":{opacity:0.7},"opacity-75":{opacity:0.75},"opacity-80":{opacity:0.8},"opacity-85":{opacity:0.85},"opacity-90":{opacity:0.9},"opacity-95":{opacity:0.95},"opacity-100":{opacity:1}};var Z_INDEX_SCALE=exports.Z_INDEX_SCALE={0:0,10:10,20:20,30:30,40:40,50:50,auto:0};var INSET_SCALE=exports.INSET_SCALE={0:0,0.5:2,1:4,1.5:6,2:8,2.5:10,3:12,3.5:14,4:16,5:20,6:24,8:32,10:40,12:48,16:64,20:80,24:96};function parseLayout(cls,customSpacing){var _ref,_ref2,_ref3,_ref4,_ref5,_ref6,_ref7,_ref8,_ref9,_ref0,_ref1,_DISPLAY_MAP$cls;var insetMap=customSpacing?Object.assign({},INSET_SCALE,customSpacing):INSET_SCALE;if(cls.startsWith("z-")){var zKey=cls.substring(2);var arbitraryZ=parseArbitraryZIndex(zKey);if(arbitraryZ!==null){return{zIndex:arbitraryZ};}var zValue=Z_INDEX_SCALE[zKey];if(zValue!==undefined){return{zIndex:zValue};}}if(cls.startsWith("top-")){var topKey=cls.substring(4);if(topKey==="auto"){return{};}var arbitraryTop=parseArbitraryInset(topKey);if(arbitraryTop!==null){return{top:arbitraryTop};}var topValue=insetMap[topKey];if(topValue!==undefined){return{top:topValue};}}if(cls.startsWith("right-")){var rightKey=cls.substring(6);if(rightKey==="auto"){return{};}var arbitraryRight=parseArbitraryInset(rightKey);if(arbitraryRight!==null){return{right:arbitraryRight};}var rightValue=insetMap[rightKey];if(rightValue!==undefined){return{right:rightValue};}}if(cls.startsWith("bottom-")){var bottomKey=cls.substring(7);if(bottomKey==="auto"){return{};}var arbitraryBottom=parseArbitraryInset(bottomKey);if(arbitraryBottom!==null){return{bottom:arbitraryBottom};}var bottomValue=insetMap[bottomKey];if(bottomValue!==undefined){return{bottom:bottomValue};}}if(cls.startsWith("left-")){var leftKey=cls.substring(5);if(leftKey==="auto"){return{};}var arbitraryLeft=parseArbitraryInset(leftKey);if(arbitraryLeft!==null){return{left:arbitraryLeft};}var leftValue=insetMap[leftKey];if(leftValue!==undefined){return{left:leftValue};}}var startMatch=cls.match(/^(-?)start-(.+)$/);if(startMatch){var _startMatch=(0,_slicedToArray2.default)(startMatch,3),negPrefix=_startMatch[1],startKey=_startMatch[2];var isNegative=negPrefix==="-";if(startKey==="auto"){return{};}var arbitraryStart=parseArbitraryInset(startKey);if(arbitraryStart!==null){if(typeof arbitraryStart==="number"){return{start:isNegative?-arbitraryStart:arbitraryStart};}if(isNegative&&arbitraryStart.endsWith("%")){var numValue=parseFloat(arbitraryStart);return{start:`${-numValue}%`};}return{start:arbitraryStart};}var startValue=insetMap[startKey];if(startValue!==undefined){return{start:isNegative?-startValue:startValue};}}var endMatch=cls.match(/^(-?)end-(.+)$/);if(endMatch){var _endMatch=(0,_slicedToArray2.default)(endMatch,3),_negPrefix=_endMatch[1],endKey=_endMatch[2];var _isNegative=_negPrefix==="-";if(endKey==="auto"){return{};}var arbitraryEnd=parseArbitraryInset(endKey);if(arbitraryEnd!==null){if(typeof arbitraryEnd==="number"){return{end:_isNegative?-arbitraryEnd:arbitraryEnd};}if(_isNegative&&arbitraryEnd.endsWith("%")){var _numValue=parseFloat(arbitraryEnd);return{end:`${-_numValue}%`};}return{end:arbitraryEnd};}var endValue=insetMap[endKey];if(endValue!==undefined){return{end:_isNegative?-endValue:endValue};}}if(cls.startsWith("inset-x-")){var insetKey=cls.substring(8);var arbitraryInset=parseArbitraryInset(insetKey);if(arbitraryInset!==null){return{left:arbitraryInset,right:arbitraryInset};}var insetValue=insetMap[insetKey];if(insetValue!==undefined){return{left:insetValue,right:insetValue};}}if(cls.startsWith("inset-y-")){var _insetKey=cls.substring(8);var _arbitraryInset=parseArbitraryInset(_insetKey);if(_arbitraryInset!==null){return{top:_arbitraryInset,bottom:_arbitraryInset};}var _insetValue=insetMap[_insetKey];if(_insetValue!==undefined){return{top:_insetValue,bottom:_insetValue};}}if(cls.startsWith("inset-s-")){var _insetKey2=cls.substring(8);var _arbitraryInset2=parseArbitraryInset(_insetKey2);if(_arbitraryInset2!==null){return{start:_arbitraryInset2};}var _insetValue2=insetMap[_insetKey2];if(_insetValue2!==undefined){return{start:_insetValue2};}}if(cls.startsWith("inset-e-")){var _insetKey3=cls.substring(8);var _arbitraryInset3=parseArbitraryInset(_insetKey3);if(_arbitraryInset3!==null){return{end:_arbitraryInset3};}var _insetValue3=insetMap[_insetKey3];if(_insetValue3!==undefined){return{end:_insetValue3};}}if(cls.startsWith("inset-")){var _insetKey4=cls.substring(6);var _arbitraryInset4=parseArbitraryInset(_insetKey4);if(_arbitraryInset4!==null){return{top:_arbitraryInset4,right:_arbitraryInset4,bottom:_arbitraryInset4,left:_arbitraryInset4};}var _insetValue4=insetMap[_insetKey4];if(_insetValue4!==undefined){return{top:_insetValue4,right:_insetValue4,bottom:_insetValue4,left:_insetValue4};}}if(cls.startsWith("grow-")||cls.startsWith("flex-grow-")){var prefix=cls.startsWith("flex-grow-")?"flex-grow-":"grow-";var growKey=cls.substring(prefix.length);var arbitraryGrow=parseArbitraryGrowShrink(growKey);if(arbitraryGrow!==null){return{flexGrow:arbitraryGrow};}}if(cls.startsWith("shrink-")||cls.startsWith("flex-shrink-")){var _prefix=cls.startsWith("flex-shrink-")?"flex-shrink-":"shrink-";var shrinkKey=cls.substring(_prefix.length);var arbitraryShrink=parseArbitraryGrowShrink(shrinkKey);if(arbitraryShrink!==null){return{flexShrink:arbitraryShrink};}}return(_ref=(_ref2=(_ref3=(_ref4=(_ref5=(_ref6=(_ref7=(_ref8=(_ref9=(_ref0=(_ref1=(_DISPLAY_MAP$cls=DISPLAY_MAP[cls])!=null?_DISPLAY_MAP$cls:FLEX_DIRECTION_MAP[cls])!=null?_ref1:FLEX_WRAP_MAP[cls])!=null?_ref0:FLEX_MAP[cls])!=null?_ref9:GROW_SHRINK_MAP[cls])!=null?_ref8:JUSTIFY_CONTENT_MAP[cls])!=null?_ref7:ALIGN_ITEMS_MAP[cls])!=null?_ref6:ALIGN_SELF_MAP[cls])!=null?_ref5:ALIGN_CONTENT_MAP[cls])!=null?_ref4:POSITION_MAP[cls])!=null?_ref3:OVERFLOW_MAP[cls])!=null?_ref2:OPACITY_MAP[cls])!=null?_ref:null;}
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.Z_INDEX_SCALE=exports.INSET_SCALE=void 0;exports.parseLayout=parseLayout;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));function parseArbitraryInset(value){var pxMatch=value.match(/^\[(-?\d+)(?:px)?\]$/);if(pxMatch){return parseInt(pxMatch[1],10);}var percentMatch=value.match(/^\[(-?\d+(?:\.\d+)?)%\]$/);if(percentMatch){return`${percentMatch[1]}%`;}if(value.startsWith("[")&&value.endsWith("]")){if(process.env.NODE_ENV!=="production"){console.warn(`[react-native-tailwind] Unsupported arbitrary inset unit: ${value}. Only px and % are supported.`);}return null;}return null;}function parseArbitraryZIndex(value){var zMatch=value.match(/^\[(-?\d+)\]$/);if(zMatch){return parseInt(zMatch[1],10);}if(value.startsWith("[")&&value.endsWith("]")){if(process.env.NODE_ENV!=="production"){console.warn(`[react-native-tailwind] Invalid arbitrary z-index: ${value}. Only integers are supported.`);}return null;}return null;}function parseArbitraryGrowShrink(value){var match=value.match(/^\[(\d+(?:\.\d+)?|\.\d+)\]$/);if(match){return parseFloat(match[1]);}if(value.startsWith("[")&&value.endsWith("]")){if(process.env.NODE_ENV!=="production"){console.warn(`[react-native-tailwind] Invalid arbitrary grow/shrink value: ${value}. Only non-negative numbers are supported (e.g., [1.5], [2], [0.5], [.5]).`);}return null;}return null;}var DISPLAY_MAP={flex:{display:"flex"},hidden:{display:"none"}};var FLEX_DIRECTION_MAP={"flex-row":{flexDirection:"row"},"flex-row-reverse":{flexDirection:"row-reverse"},"flex-col":{flexDirection:"column"},"flex-col-reverse":{flexDirection:"column-reverse"}};var FLEX_WRAP_MAP={"flex-wrap":{flexWrap:"wrap"},"flex-wrap-reverse":{flexWrap:"wrap-reverse"},"flex-nowrap":{flexWrap:"nowrap"}};var FLEX_MAP={"flex-1":{flex:1},"flex-auto":{flex:1},"flex-none":{flex:0}};var GROW_SHRINK_MAP={grow:{flexGrow:1},"grow-0":{flexGrow:0},shrink:{flexShrink:1},"shrink-0":{flexShrink:0},"flex-grow":{flexGrow:1},"flex-grow-0":{flexGrow:0},"flex-shrink":{flexShrink:1},"flex-shrink-0":{flexShrink:0}};var JUSTIFY_CONTENT_MAP={"justify-start":{justifyContent:"flex-start"},"justify-end":{justifyContent:"flex-end"},"justify-center":{justifyContent:"center"},"justify-between":{justifyContent:"space-between"},"justify-around":{justifyContent:"space-around"},"justify-evenly":{justifyContent:"space-evenly"}};var ALIGN_ITEMS_MAP={"items-start":{alignItems:"flex-start"},"items-end":{alignItems:"flex-end"},"items-center":{alignItems:"center"},"items-baseline":{alignItems:"baseline"},"items-stretch":{alignItems:"stretch"}};var ALIGN_SELF_MAP={"self-auto":{alignSelf:"auto"},"self-start":{alignSelf:"flex-start"},"self-end":{alignSelf:"flex-end"},"self-center":{alignSelf:"center"},"self-stretch":{alignSelf:"stretch"},"self-baseline":{alignSelf:"baseline"}};var ALIGN_CONTENT_MAP={"content-start":{alignContent:"flex-start"},"content-end":{alignContent:"flex-end"},"content-center":{alignContent:"center"},"content-between":{alignContent:"space-between"},"content-around":{alignContent:"space-around"},"content-stretch":{alignContent:"stretch"}};var POSITION_MAP={absolute:{position:"absolute"},relative:{position:"relative"}};var OVERFLOW_MAP={"overflow-hidden":{overflow:"hidden"},"overflow-visible":{overflow:"visible"},"overflow-scroll":{overflow:"scroll"}};var OPACITY_MAP={"opacity-0":{opacity:0},"opacity-5":{opacity:0.05},"opacity-10":{opacity:0.1},"opacity-15":{opacity:0.15},"opacity-20":{opacity:0.2},"opacity-25":{opacity:0.25},"opacity-30":{opacity:0.3},"opacity-35":{opacity:0.35},"opacity-40":{opacity:0.4},"opacity-45":{opacity:0.45},"opacity-50":{opacity:0.5},"opacity-55":{opacity:0.55},"opacity-60":{opacity:0.6},"opacity-65":{opacity:0.65},"opacity-70":{opacity:0.7},"opacity-75":{opacity:0.75},"opacity-80":{opacity:0.8},"opacity-85":{opacity:0.85},"opacity-90":{opacity:0.9},"opacity-95":{opacity:0.95},"opacity-100":{opacity:1}};var Z_INDEX_SCALE=exports.Z_INDEX_SCALE={0:0,10:10,20:20,30:30,40:40,50:50,auto:0};var INSET_SCALE=exports.INSET_SCALE={0:0,0.5:2,1:4,1.5:6,2:8,2.5:10,3:12,3.5:14,4:16,5:20,6:24,8:32,10:40,12:48,16:64,20:80,24:96};function parseLayout(cls,customSpacing){var _ref,_ref2,_ref3,_ref4,_ref5,_ref6,_ref7,_ref8,_ref9,_ref0,_ref1,_DISPLAY_MAP$cls;var insetMap=customSpacing?Object.assign({},INSET_SCALE,customSpacing):INSET_SCALE;if(cls.startsWith("z-")){var zKey=cls.substring(2);var arbitraryZ=parseArbitraryZIndex(zKey);if(arbitraryZ!==null){return{zIndex:arbitraryZ};}var zValue=Z_INDEX_SCALE[zKey];if(zValue!==undefined){return{zIndex:zValue};}}var topMatch=cls.match(/^(-?)top-(.+)$/);if(topMatch){var _topMatch=(0,_slicedToArray2.default)(topMatch,3),negPrefix=_topMatch[1],topKey=_topMatch[2];var isNegative=negPrefix==="-";if(topKey==="auto"){return{};}var arbitraryTop=parseArbitraryInset(topKey);if(arbitraryTop!==null){if(typeof arbitraryTop==="number"){return{top:isNegative?-arbitraryTop:arbitraryTop};}if(isNegative&&arbitraryTop.endsWith("%")){var numValue=parseFloat(arbitraryTop);return{top:`${-numValue}%`};}return{top:arbitraryTop};}var topValue=insetMap[topKey];if(topValue!==undefined){return{top:isNegative?-topValue:topValue};}}var rightMatch=cls.match(/^(-?)right-(.+)$/);if(rightMatch){var _rightMatch=(0,_slicedToArray2.default)(rightMatch,3),_negPrefix=_rightMatch[1],rightKey=_rightMatch[2];var _isNegative=_negPrefix==="-";if(rightKey==="auto"){return{};}var arbitraryRight=parseArbitraryInset(rightKey);if(arbitraryRight!==null){if(typeof arbitraryRight==="number"){return{right:_isNegative?-arbitraryRight:arbitraryRight};}if(_isNegative&&arbitraryRight.endsWith("%")){var _numValue=parseFloat(arbitraryRight);return{right:`${-_numValue}%`};}return{right:arbitraryRight};}var rightValue=insetMap[rightKey];if(rightValue!==undefined){return{right:_isNegative?-rightValue:rightValue};}}var bottomMatch=cls.match(/^(-?)bottom-(.+)$/);if(bottomMatch){var _bottomMatch=(0,_slicedToArray2.default)(bottomMatch,3),_negPrefix2=_bottomMatch[1],bottomKey=_bottomMatch[2];var _isNegative2=_negPrefix2==="-";if(bottomKey==="auto"){return{};}var arbitraryBottom=parseArbitraryInset(bottomKey);if(arbitraryBottom!==null){if(typeof arbitraryBottom==="number"){return{bottom:_isNegative2?-arbitraryBottom:arbitraryBottom};}if(_isNegative2&&arbitraryBottom.endsWith("%")){var _numValue2=parseFloat(arbitraryBottom);return{bottom:`${-_numValue2}%`};}return{bottom:arbitraryBottom};}var bottomValue=insetMap[bottomKey];if(bottomValue!==undefined){return{bottom:_isNegative2?-bottomValue:bottomValue};}}var leftMatch=cls.match(/^(-?)left-(.+)$/);if(leftMatch){var _leftMatch=(0,_slicedToArray2.default)(leftMatch,3),_negPrefix3=_leftMatch[1],leftKey=_leftMatch[2];var _isNegative3=_negPrefix3==="-";if(leftKey==="auto"){return{};}var arbitraryLeft=parseArbitraryInset(leftKey);if(arbitraryLeft!==null){if(typeof arbitraryLeft==="number"){return{left:_isNegative3?-arbitraryLeft:arbitraryLeft};}if(_isNegative3&&arbitraryLeft.endsWith("%")){var _numValue3=parseFloat(arbitraryLeft);return{left:`${-_numValue3}%`};}return{left:arbitraryLeft};}var leftValue=insetMap[leftKey];if(leftValue!==undefined){return{left:_isNegative3?-leftValue:leftValue};}}var startMatch=cls.match(/^(-?)start-(.+)$/);if(startMatch){var _startMatch=(0,_slicedToArray2.default)(startMatch,3),_negPrefix4=_startMatch[1],startKey=_startMatch[2];var _isNegative4=_negPrefix4==="-";if(startKey==="auto"){return{};}var arbitraryStart=parseArbitraryInset(startKey);if(arbitraryStart!==null){if(typeof arbitraryStart==="number"){return{start:_isNegative4?-arbitraryStart:arbitraryStart};}if(_isNegative4&&arbitraryStart.endsWith("%")){var _numValue4=parseFloat(arbitraryStart);return{start:`${-_numValue4}%`};}return{start:arbitraryStart};}var startValue=insetMap[startKey];if(startValue!==undefined){return{start:_isNegative4?-startValue:startValue};}}var endMatch=cls.match(/^(-?)end-(.+)$/);if(endMatch){var _endMatch=(0,_slicedToArray2.default)(endMatch,3),_negPrefix5=_endMatch[1],endKey=_endMatch[2];var _isNegative5=_negPrefix5==="-";if(endKey==="auto"){return{};}var arbitraryEnd=parseArbitraryInset(endKey);if(arbitraryEnd!==null){if(typeof arbitraryEnd==="number"){return{end:_isNegative5?-arbitraryEnd:arbitraryEnd};}if(_isNegative5&&arbitraryEnd.endsWith("%")){var _numValue5=parseFloat(arbitraryEnd);return{end:`${-_numValue5}%`};}return{end:arbitraryEnd};}var endValue=insetMap[endKey];if(endValue!==undefined){return{end:_isNegative5?-endValue:endValue};}}if(cls.startsWith("inset-x-")){var insetKey=cls.substring(8);var arbitraryInset=parseArbitraryInset(insetKey);if(arbitraryInset!==null){return{left:arbitraryInset,right:arbitraryInset};}var insetValue=insetMap[insetKey];if(insetValue!==undefined){return{left:insetValue,right:insetValue};}}if(cls.startsWith("inset-y-")){var _insetKey=cls.substring(8);var _arbitraryInset=parseArbitraryInset(_insetKey);if(_arbitraryInset!==null){return{top:_arbitraryInset,bottom:_arbitraryInset};}var _insetValue=insetMap[_insetKey];if(_insetValue!==undefined){return{top:_insetValue,bottom:_insetValue};}}if(cls.startsWith("inset-s-")){var _insetKey2=cls.substring(8);var _arbitraryInset2=parseArbitraryInset(_insetKey2);if(_arbitraryInset2!==null){return{start:_arbitraryInset2};}var _insetValue2=insetMap[_insetKey2];if(_insetValue2!==undefined){return{start:_insetValue2};}}if(cls.startsWith("inset-e-")){var _insetKey3=cls.substring(8);var _arbitraryInset3=parseArbitraryInset(_insetKey3);if(_arbitraryInset3!==null){return{end:_arbitraryInset3};}var _insetValue3=insetMap[_insetKey3];if(_insetValue3!==undefined){return{end:_insetValue3};}}if(cls.startsWith("inset-")){var _insetKey4=cls.substring(6);var _arbitraryInset4=parseArbitraryInset(_insetKey4);if(_arbitraryInset4!==null){return{top:_arbitraryInset4,right:_arbitraryInset4,bottom:_arbitraryInset4,left:_arbitraryInset4};}var _insetValue4=insetMap[_insetKey4];if(_insetValue4!==undefined){return{top:_insetValue4,right:_insetValue4,bottom:_insetValue4,left:_insetValue4};}}if(cls.startsWith("grow-")||cls.startsWith("flex-grow-")){var prefix=cls.startsWith("flex-grow-")?"flex-grow-":"grow-";var growKey=cls.substring(prefix.length);var arbitraryGrow=parseArbitraryGrowShrink(growKey);if(arbitraryGrow!==null){return{flexGrow:arbitraryGrow};}}if(cls.startsWith("shrink-")||cls.startsWith("flex-shrink-")){var _prefix=cls.startsWith("flex-shrink-")?"flex-shrink-":"shrink-";var shrinkKey=cls.substring(_prefix.length);var arbitraryShrink=parseArbitraryGrowShrink(shrinkKey);if(arbitraryShrink!==null){return{flexShrink:arbitraryShrink};}}return(_ref=(_ref2=(_ref3=(_ref4=(_ref5=(_ref6=(_ref7=(_ref8=(_ref9=(_ref0=(_ref1=(_DISPLAY_MAP$cls=DISPLAY_MAP[cls])!=null?_DISPLAY_MAP$cls:FLEX_DIRECTION_MAP[cls])!=null?_ref1:FLEX_WRAP_MAP[cls])!=null?_ref0:FLEX_MAP[cls])!=null?_ref9:GROW_SHRINK_MAP[cls])!=null?_ref8:JUSTIFY_CONTENT_MAP[cls])!=null?_ref7:ALIGN_ITEMS_MAP[cls])!=null?_ref6:ALIGN_SELF_MAP[cls])!=null?_ref5:ALIGN_CONTENT_MAP[cls])!=null?_ref4:POSITION_MAP[cls])!=null?_ref3:OVERFLOW_MAP[cls])!=null?_ref2:OPACITY_MAP[cls])!=null?_ref:null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var _vitest=require("vitest");var _layout=require("./layout");(0,_vitest.describe)("parseLayout - display utilities",function(){(0,_vitest.it)("should parse display flex",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex")).toEqual({display:"flex"});});(0,_vitest.it)("should parse display hidden",function(){(0,_vitest.expect)((0,_layout.parseLayout)("hidden")).toEqual({display:"none"});});});(0,_vitest.describe)("parseLayout - flex direction utilities",function(){(0,_vitest.it)("should parse flex row",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-row")).toEqual({flexDirection:"row"});});(0,_vitest.it)("should parse flex row reverse",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-row-reverse")).toEqual({flexDirection:"row-reverse"});});(0,_vitest.it)("should parse flex column",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-col")).toEqual({flexDirection:"column"});});(0,_vitest.it)("should parse flex column reverse",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-col-reverse")).toEqual({flexDirection:"column-reverse"});});});(0,_vitest.describe)("parseLayout - flex wrap utilities",function(){(0,_vitest.it)("should parse flex wrap",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-wrap")).toEqual({flexWrap:"wrap"});});(0,_vitest.it)("should parse flex wrap reverse",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-wrap-reverse")).toEqual({flexWrap:"wrap-reverse"});});(0,_vitest.it)("should parse flex nowrap",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-nowrap")).toEqual({flexWrap:"nowrap"});});});(0,_vitest.describe)("parseLayout - flex utilities",function(){(0,_vitest.it)("should parse flex-1",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-1")).toEqual({flex:1});});(0,_vitest.it)("should parse flex-auto",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-auto")).toEqual({flex:1});});(0,_vitest.it)("should parse flex-none",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-none")).toEqual({flex:0});});});(0,_vitest.describe)("parseLayout - flex grow/shrink utilities",function(){(0,_vitest.it)("should parse grow",function(){(0,_vitest.expect)((0,_layout.parseLayout)("grow")).toEqual({flexGrow:1});});(0,_vitest.it)("should parse grow-0",function(){(0,_vitest.expect)((0,_layout.parseLayout)("grow-0")).toEqual({flexGrow:0});});(0,_vitest.it)("should parse shrink",function(){(0,_vitest.expect)((0,_layout.parseLayout)("shrink")).toEqual({flexShrink:1});});(0,_vitest.it)("should parse shrink-0",function(){(0,_vitest.expect)((0,_layout.parseLayout)("shrink-0")).toEqual({flexShrink:0});});(0,_vitest.it)("should parse grow with arbitrary values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("grow-[1.5]")).toEqual({flexGrow:1.5});(0,_vitest.expect)((0,_layout.parseLayout)("grow-[2]")).toEqual({flexGrow:2});(0,_vitest.expect)((0,_layout.parseLayout)("grow-[0.5]")).toEqual({flexGrow:0.5});(0,_vitest.expect)((0,_layout.parseLayout)("grow-[3]")).toEqual({flexGrow:3});(0,_vitest.expect)((0,_layout.parseLayout)("grow-[0]")).toEqual({flexGrow:0});});(0,_vitest.it)("should parse shrink with arbitrary values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("shrink-[0.5]")).toEqual({flexShrink:0.5});(0,_vitest.expect)((0,_layout.parseLayout)("shrink-[2]")).toEqual({flexShrink:2});(0,_vitest.expect)((0,_layout.parseLayout)("shrink-[1.5]")).toEqual({flexShrink:1.5});(0,_vitest.expect)((0,_layout.parseLayout)("shrink-[3]")).toEqual({flexShrink:3});(0,_vitest.expect)((0,_layout.parseLayout)("shrink-[0]")).toEqual({flexShrink:0});});(0,_vitest.it)("should parse CSS-style flex-grow aliases",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-grow")).toEqual({flexGrow:1});(0,_vitest.expect)((0,_layout.parseLayout)("flex-grow-0")).toEqual({flexGrow:0});});(0,_vitest.it)("should parse CSS-style flex-shrink aliases",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-shrink")).toEqual({flexShrink:1});(0,_vitest.expect)((0,_layout.parseLayout)("flex-shrink-0")).toEqual({flexShrink:0});});(0,_vitest.it)("should parse CSS-style flex-grow with arbitrary values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-grow-[1.5]")).toEqual({flexGrow:1.5});(0,_vitest.expect)((0,_layout.parseLayout)("flex-grow-[2]")).toEqual({flexGrow:2});(0,_vitest.expect)((0,_layout.parseLayout)("flex-grow-[0.5]")).toEqual({flexGrow:0.5});});(0,_vitest.it)("should parse CSS-style flex-shrink with arbitrary values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-shrink-[0.5]")).toEqual({flexShrink:0.5});(0,_vitest.expect)((0,_layout.parseLayout)("flex-shrink-[2]")).toEqual({flexShrink:2});(0,_vitest.expect)((0,_layout.parseLayout)("flex-shrink-[1.5]")).toEqual({flexShrink:1.5});});(0,_vitest.it)("should handle edge case values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("grow-[0.1]")).toEqual({flexGrow:0.1});(0,_vitest.expect)((0,_layout.parseLayout)("grow-[10]")).toEqual({flexGrow:10});(0,_vitest.expect)((0,_layout.parseLayout)("shrink-[0.01]")).toEqual({flexShrink:0.01});(0,_vitest.expect)((0,_layout.parseLayout)("shrink-[100]")).toEqual({flexShrink:100});});(0,_vitest.it)("should parse Tailwind shorthand decimals (no leading zero)",function(){(0,_vitest.expect)((0,_layout.parseLayout)("grow-[.5]")).toEqual({flexGrow:0.5});(0,_vitest.expect)((0,_layout.parseLayout)("grow-[.75]")).toEqual({flexGrow:0.75});(0,_vitest.expect)((0,_layout.parseLayout)("shrink-[.5]")).toEqual({flexShrink:0.5});(0,_vitest.expect)((0,_layout.parseLayout)("shrink-[.25]")).toEqual({flexShrink:0.25});(0,_vitest.expect)((0,_layout.parseLayout)("flex-grow-[.5]")).toEqual({flexGrow:0.5});(0,_vitest.expect)((0,_layout.parseLayout)("flex-shrink-[.5]")).toEqual({flexShrink:0.5});});(0,_vitest.it)("should reject negative values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("grow-[-1]")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("shrink-[-1]")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("flex-grow-[-2]")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("flex-shrink-[-0.5]")).toBeNull();});});(0,_vitest.describe)("parseLayout - justify content utilities",function(){(0,_vitest.it)("should parse justify-start",function(){(0,_vitest.expect)((0,_layout.parseLayout)("justify-start")).toEqual({justifyContent:"flex-start"});});(0,_vitest.it)("should parse justify-end",function(){(0,_vitest.expect)((0,_layout.parseLayout)("justify-end")).toEqual({justifyContent:"flex-end"});});(0,_vitest.it)("should parse justify-center",function(){(0,_vitest.expect)((0,_layout.parseLayout)("justify-center")).toEqual({justifyContent:"center"});});(0,_vitest.it)("should parse justify-between",function(){(0,_vitest.expect)((0,_layout.parseLayout)("justify-between")).toEqual({justifyContent:"space-between"});});(0,_vitest.it)("should parse justify-around",function(){(0,_vitest.expect)((0,_layout.parseLayout)("justify-around")).toEqual({justifyContent:"space-around"});});(0,_vitest.it)("should parse justify-evenly",function(){(0,_vitest.expect)((0,_layout.parseLayout)("justify-evenly")).toEqual({justifyContent:"space-evenly"});});});(0,_vitest.describe)("parseLayout - align items utilities",function(){(0,_vitest.it)("should parse items-start",function(){(0,_vitest.expect)((0,_layout.parseLayout)("items-start")).toEqual({alignItems:"flex-start"});});(0,_vitest.it)("should parse items-end",function(){(0,_vitest.expect)((0,_layout.parseLayout)("items-end")).toEqual({alignItems:"flex-end"});});(0,_vitest.it)("should parse items-center",function(){(0,_vitest.expect)((0,_layout.parseLayout)("items-center")).toEqual({alignItems:"center"});});(0,_vitest.it)("should parse items-baseline",function(){(0,_vitest.expect)((0,_layout.parseLayout)("items-baseline")).toEqual({alignItems:"baseline"});});(0,_vitest.it)("should parse items-stretch",function(){(0,_vitest.expect)((0,_layout.parseLayout)("items-stretch")).toEqual({alignItems:"stretch"});});});(0,_vitest.describe)("parseLayout - align self utilities",function(){(0,_vitest.it)("should parse self-auto",function(){(0,_vitest.expect)((0,_layout.parseLayout)("self-auto")).toEqual({alignSelf:"auto"});});(0,_vitest.it)("should parse self-start",function(){(0,_vitest.expect)((0,_layout.parseLayout)("self-start")).toEqual({alignSelf:"flex-start"});});(0,_vitest.it)("should parse self-end",function(){(0,_vitest.expect)((0,_layout.parseLayout)("self-end")).toEqual({alignSelf:"flex-end"});});(0,_vitest.it)("should parse self-center",function(){(0,_vitest.expect)((0,_layout.parseLayout)("self-center")).toEqual({alignSelf:"center"});});(0,_vitest.it)("should parse self-stretch",function(){(0,_vitest.expect)((0,_layout.parseLayout)("self-stretch")).toEqual({alignSelf:"stretch"});});(0,_vitest.it)("should parse self-baseline",function(){(0,_vitest.expect)((0,_layout.parseLayout)("self-baseline")).toEqual({alignSelf:"baseline"});});});(0,_vitest.describe)("parseLayout - align content utilities",function(){(0,_vitest.it)("should parse content-start",function(){(0,_vitest.expect)((0,_layout.parseLayout)("content-start")).toEqual({alignContent:"flex-start"});});(0,_vitest.it)("should parse content-end",function(){(0,_vitest.expect)((0,_layout.parseLayout)("content-end")).toEqual({alignContent:"flex-end"});});(0,_vitest.it)("should parse content-center",function(){(0,_vitest.expect)((0,_layout.parseLayout)("content-center")).toEqual({alignContent:"center"});});(0,_vitest.it)("should parse content-between",function(){(0,_vitest.expect)((0,_layout.parseLayout)("content-between")).toEqual({alignContent:"space-between"});});(0,_vitest.it)("should parse content-around",function(){(0,_vitest.expect)((0,_layout.parseLayout)("content-around")).toEqual({alignContent:"space-around"});});(0,_vitest.it)("should parse content-stretch",function(){(0,_vitest.expect)((0,_layout.parseLayout)("content-stretch")).toEqual({alignContent:"stretch"});});});(0,_vitest.describe)("parseLayout - position utilities",function(){(0,_vitest.it)("should parse absolute",function(){(0,_vitest.expect)((0,_layout.parseLayout)("absolute")).toEqual({position:"absolute"});});(0,_vitest.it)("should parse relative",function(){(0,_vitest.expect)((0,_layout.parseLayout)("relative")).toEqual({position:"relative"});});});(0,_vitest.describe)("parseLayout - overflow utilities",function(){(0,_vitest.it)("should parse overflow-hidden",function(){(0,_vitest.expect)((0,_layout.parseLayout)("overflow-hidden")).toEqual({overflow:"hidden"});});(0,_vitest.it)("should parse overflow-visible",function(){(0,_vitest.expect)((0,_layout.parseLayout)("overflow-visible")).toEqual({overflow:"visible"});});(0,_vitest.it)("should parse overflow-scroll",function(){(0,_vitest.expect)((0,_layout.parseLayout)("overflow-scroll")).toEqual({overflow:"scroll"});});});(0,_vitest.describe)("parseLayout - opacity utilities",function(){(0,_vitest.it)("should parse opacity-0 (fully transparent)",function(){(0,_vitest.expect)((0,_layout.parseLayout)("opacity-0")).toEqual({opacity:0});});(0,_vitest.it)("should parse opacity-50 (half transparent)",function(){(0,_vitest.expect)((0,_layout.parseLayout)("opacity-50")).toEqual({opacity:0.5});});(0,_vitest.it)("should parse opacity-100 (fully opaque)",function(){(0,_vitest.expect)((0,_layout.parseLayout)("opacity-100")).toEqual({opacity:1});});(0,_vitest.it)("should parse all opacity values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("opacity-5")).toEqual({opacity:0.05});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-10")).toEqual({opacity:0.1});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-15")).toEqual({opacity:0.15});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-20")).toEqual({opacity:0.2});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-25")).toEqual({opacity:0.25});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-30")).toEqual({opacity:0.3});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-35")).toEqual({opacity:0.35});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-40")).toEqual({opacity:0.4});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-45")).toEqual({opacity:0.45});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-55")).toEqual({opacity:0.55});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-60")).toEqual({opacity:0.6});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-65")).toEqual({opacity:0.65});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-70")).toEqual({opacity:0.7});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-75")).toEqual({opacity:0.75});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-80")).toEqual({opacity:0.8});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-85")).toEqual({opacity:0.85});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-90")).toEqual({opacity:0.9});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-95")).toEqual({opacity:0.95});});});(0,_vitest.describe)("parseLayout - edge cases",function(){(0,_vitest.it)("should return null for invalid classes",function(){(0,_vitest.expect)((0,_layout.parseLayout)("invalid")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("flex-invalid")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("justify")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("items")).toBeNull();});(0,_vitest.it)("should return null for empty string",function(){(0,_vitest.expect)((0,_layout.parseLayout)("")).toBeNull();});(0,_vitest.it)("should return null for partial class names",function(){(0,_vitest.expect)((0,_layout.parseLayout)("fle")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("flexbox")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("justify-start-center")).toBeNull();});(0,_vitest.it)("should return null for CSS classes not in React Native",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inline")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("block")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("inline-block")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("grid")).toBeNull();});});(0,_vitest.describe)("parseLayout - comprehensive coverage",function(){(0,_vitest.it)("should handle all flex direction variants",function(){var directions=["flex-row","flex-row-reverse","flex-col","flex-col-reverse"];directions.forEach(function(dir){(0,_vitest.expect)((0,_layout.parseLayout)(dir)).toBeTruthy();});});(0,_vitest.it)("should handle all flex wrap variants",function(){var wraps=["flex-wrap","flex-wrap-reverse","flex-nowrap"];wraps.forEach(function(wrap){(0,_vitest.expect)((0,_layout.parseLayout)(wrap)).toBeTruthy();});});(0,_vitest.it)("should handle all justify content variants",function(){var justifies=["justify-start","justify-end","justify-center","justify-between","justify-around","justify-evenly"];justifies.forEach(function(justify){(0,_vitest.expect)((0,_layout.parseLayout)(justify)).toBeTruthy();});});(0,_vitest.it)("should handle all align items variants",function(){var aligns=["items-start","items-end","items-center","items-baseline","items-stretch"];aligns.forEach(function(align){(0,_vitest.expect)((0,_layout.parseLayout)(align)).toBeTruthy();});});(0,_vitest.it)("should handle all align self variants",function(){var selfs=["self-auto","self-start","self-end","self-center","self-stretch","self-baseline"];selfs.forEach(function(self){(0,_vitest.expect)((0,_layout.parseLayout)(self)).toBeTruthy();});});(0,_vitest.it)("should handle all align content variants",function(){var contents=["content-start","content-end","content-center","content-between","content-around","content-stretch"];contents.forEach(function(content){(0,_vitest.expect)((0,_layout.parseLayout)(content)).toBeTruthy();});});(0,_vitest.it)("should handle all position variants",function(){var positions=["absolute","relative"];positions.forEach(function(position){(0,_vitest.expect)((0,_layout.parseLayout)(position)).toBeTruthy();});});(0,_vitest.it)("should handle all overflow variants",function(){var overflows=["overflow-hidden","overflow-visible","overflow-scroll"];overflows.forEach(function(overflow){(0,_vitest.expect)((0,_layout.parseLayout)(overflow)).toBeTruthy();});});});(0,_vitest.describe)("parseLayout - case sensitivity",function(){(0,_vitest.it)("should be case-sensitive",function(){(0,_vitest.expect)((0,_layout.parseLayout)("FLEX")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("Flex")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("ABSOLUTE")).toBeNull();});});(0,_vitest.describe)("parseLayout - z-index utilities",function(){(0,_vitest.it)("should parse z-index values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("z-0")).toEqual({zIndex:0});(0,_vitest.expect)((0,_layout.parseLayout)("z-10")).toEqual({zIndex:10});(0,_vitest.expect)((0,_layout.parseLayout)("z-20")).toEqual({zIndex:20});(0,_vitest.expect)((0,_layout.parseLayout)("z-30")).toEqual({zIndex:30});(0,_vitest.expect)((0,_layout.parseLayout)("z-40")).toEqual({zIndex:40});(0,_vitest.expect)((0,_layout.parseLayout)("z-50")).toEqual({zIndex:50});});(0,_vitest.it)("should parse z-auto as 0",function(){(0,_vitest.expect)((0,_layout.parseLayout)("z-auto")).toEqual({zIndex:0});});(0,_vitest.it)("should parse arbitrary z-index values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("z-[999]")).toEqual({zIndex:999});(0,_vitest.expect)((0,_layout.parseLayout)("z-[100]")).toEqual({zIndex:100});(0,_vitest.expect)((0,_layout.parseLayout)("z-[1]")).toEqual({zIndex:1});});(0,_vitest.it)("should parse negative arbitrary z-index values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("z-[-1]")).toEqual({zIndex:-1});(0,_vitest.expect)((0,_layout.parseLayout)("z-[-10]")).toEqual({zIndex:-10});(0,_vitest.expect)((0,_layout.parseLayout)("z-[-999]")).toEqual({zIndex:-999});});(0,_vitest.it)("should return null for invalid z-index values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("z-100")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("z-5")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("z-invalid")).toBeNull();});});(0,_vitest.describe)("parseLayout - positioning utilities",function(){(0,_vitest.it)("should parse top values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-0")).toEqual({top:0});(0,_vitest.expect)((0,_layout.parseLayout)("top-4")).toEqual({top:16});(0,_vitest.expect)((0,_layout.parseLayout)("top-8")).toEqual({top:32});(0,_vitest.expect)((0,_layout.parseLayout)("top-16")).toEqual({top:64});});(0,_vitest.it)("should parse right values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("right-0")).toEqual({right:0});(0,_vitest.expect)((0,_layout.parseLayout)("right-4")).toEqual({right:16});(0,_vitest.expect)((0,_layout.parseLayout)("right-8")).toEqual({right:32});(0,_vitest.expect)((0,_layout.parseLayout)("right-16")).toEqual({right:64});});(0,_vitest.it)("should parse bottom values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("bottom-0")).toEqual({bottom:0});(0,_vitest.expect)((0,_layout.parseLayout)("bottom-4")).toEqual({bottom:16});(0,_vitest.expect)((0,_layout.parseLayout)("bottom-8")).toEqual({bottom:32});(0,_vitest.expect)((0,_layout.parseLayout)("bottom-16")).toEqual({bottom:64});});(0,_vitest.it)("should parse left values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("left-0")).toEqual({left:0});(0,_vitest.expect)((0,_layout.parseLayout)("left-4")).toEqual({left:16});(0,_vitest.expect)((0,_layout.parseLayout)("left-8")).toEqual({left:32});(0,_vitest.expect)((0,_layout.parseLayout)("left-16")).toEqual({left:64});});(0,_vitest.it)("should parse fractional positioning values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-0.5")).toEqual({top:2});(0,_vitest.expect)((0,_layout.parseLayout)("right-1.5")).toEqual({right:6});(0,_vitest.expect)((0,_layout.parseLayout)("bottom-2.5")).toEqual({bottom:10});(0,_vitest.expect)((0,_layout.parseLayout)("left-3.5")).toEqual({left:14});});(0,_vitest.it)("should parse auto positioning values as empty object",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-auto")).toEqual({});(0,_vitest.expect)((0,_layout.parseLayout)("right-auto")).toEqual({});(0,_vitest.expect)((0,_layout.parseLayout)("bottom-auto")).toEqual({});(0,_vitest.expect)((0,_layout.parseLayout)("left-auto")).toEqual({});});(0,_vitest.it)("should parse arbitrary top values with pixels",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-[50px]")).toEqual({top:50});(0,_vitest.expect)((0,_layout.parseLayout)("top-[100px]")).toEqual({top:100});(0,_vitest.expect)((0,_layout.parseLayout)("top-[0px]")).toEqual({top:0});});(0,_vitest.it)("should parse arbitrary top values without unit (defaults to px)",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-[50]")).toEqual({top:50});(0,_vitest.expect)((0,_layout.parseLayout)("top-[100]")).toEqual({top:100});});(0,_vitest.it)("should parse arbitrary top values with percentages",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-[25%]")).toEqual({top:"25%"});(0,_vitest.expect)((0,_layout.parseLayout)("top-[50%]")).toEqual({top:"50%"});(0,_vitest.expect)((0,_layout.parseLayout)("top-[10.5%]")).toEqual({top:"10.5%"});});(0,_vitest.it)("should parse negative arbitrary top values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-[-10px]")).toEqual({top:-10});(0,_vitest.expect)((0,_layout.parseLayout)("top-[-50]")).toEqual({top:-50});(0,_vitest.expect)((0,_layout.parseLayout)("top-[-25%]")).toEqual({top:"-25%"});});(0,_vitest.it)("should parse arbitrary right values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("right-[30px]")).toEqual({right:30});(0,_vitest.expect)((0,_layout.parseLayout)("right-[20]")).toEqual({right:20});(0,_vitest.expect)((0,_layout.parseLayout)("right-[15%]")).toEqual({right:"15%"});(0,_vitest.expect)((0,_layout.parseLayout)("right-[-10px]")).toEqual({right:-10});});(0,_vitest.it)("should parse arbitrary bottom values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("bottom-[40px]")).toEqual({bottom:40});(0,_vitest.expect)((0,_layout.parseLayout)("bottom-[25]")).toEqual({bottom:25});(0,_vitest.expect)((0,_layout.parseLayout)("bottom-[33.333%]")).toEqual({bottom:"33.333%"});(0,_vitest.expect)((0,_layout.parseLayout)("bottom-[-15px]")).toEqual({bottom:-15});});(0,_vitest.it)("should parse arbitrary left values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("left-[60px]")).toEqual({left:60});(0,_vitest.expect)((0,_layout.parseLayout)("left-[45]")).toEqual({left:45});(0,_vitest.expect)((0,_layout.parseLayout)("left-[12.5%]")).toEqual({left:"12.5%"});(0,_vitest.expect)((0,_layout.parseLayout)("left-[-20px]")).toEqual({left:-20});});});(0,_vitest.describe)("parseLayout - inset utilities",function(){(0,_vitest.it)("should parse inset (all sides) values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-0")).toEqual({top:0,right:0,bottom:0,left:0});(0,_vitest.expect)((0,_layout.parseLayout)("inset-4")).toEqual({top:16,right:16,bottom:16,left:16});(0,_vitest.expect)((0,_layout.parseLayout)("inset-8")).toEqual({top:32,right:32,bottom:32,left:32});});(0,_vitest.it)("should parse inset-x (horizontal) values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-x-0")).toEqual({left:0,right:0});(0,_vitest.expect)((0,_layout.parseLayout)("inset-x-4")).toEqual({left:16,right:16});(0,_vitest.expect)((0,_layout.parseLayout)("inset-x-8")).toEqual({left:32,right:32});});(0,_vitest.it)("should parse inset-y (vertical) values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-y-0")).toEqual({top:0,bottom:0});(0,_vitest.expect)((0,_layout.parseLayout)("inset-y-4")).toEqual({top:16,bottom:16});(0,_vitest.expect)((0,_layout.parseLayout)("inset-y-8")).toEqual({top:32,bottom:32});});(0,_vitest.it)("should parse fractional inset values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-0.5")).toEqual({top:2,right:2,bottom:2,left:2});(0,_vitest.expect)((0,_layout.parseLayout)("inset-x-1.5")).toEqual({left:6,right:6});(0,_vitest.expect)((0,_layout.parseLayout)("inset-y-2.5")).toEqual({top:10,bottom:10});});(0,_vitest.it)("should return null for invalid inset values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-100")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("inset-x-100")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("inset-y-100")).toBeNull();});(0,_vitest.it)("should parse arbitrary inset (all sides) values with pixels",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-[10px]")).toEqual({top:10,right:10,bottom:10,left:10});(0,_vitest.expect)((0,_layout.parseLayout)("inset-[25px]")).toEqual({top:25,right:25,bottom:25,left:25});(0,_vitest.expect)((0,_layout.parseLayout)("inset-[0px]")).toEqual({top:0,right:0,bottom:0,left:0});});(0,_vitest.it)("should parse arbitrary inset values without unit (defaults to px)",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-[15]")).toEqual({top:15,right:15,bottom:15,left:15});(0,_vitest.expect)((0,_layout.parseLayout)("inset-[30]")).toEqual({top:30,right:30,bottom:30,left:30});});(0,_vitest.it)("should parse arbitrary inset values with percentages",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-[10%]")).toEqual({top:"10%",right:"10%",bottom:"10%",left:"10%"});(0,_vitest.expect)((0,_layout.parseLayout)("inset-[25%]")).toEqual({top:"25%",right:"25%",bottom:"25%",left:"25%"});(0,_vitest.expect)((0,_layout.parseLayout)("inset-[5.5%]")).toEqual({top:"5.5%",right:"5.5%",bottom:"5.5%",left:"5.5%"});});(0,_vitest.it)("should parse arbitrary inset-x (horizontal) values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-x-[20px]")).toEqual({left:20,right:20});(0,_vitest.expect)((0,_layout.parseLayout)("inset-x-[15]")).toEqual({left:15,right:15});(0,_vitest.expect)((0,_layout.parseLayout)("inset-x-[10%]")).toEqual({left:"10%",right:"10%"});});(0,_vitest.it)("should parse arbitrary inset-y (vertical) values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-y-[30px]")).toEqual({top:30,bottom:30});(0,_vitest.expect)((0,_layout.parseLayout)("inset-y-[25]")).toEqual({top:25,bottom:25});(0,_vitest.expect)((0,_layout.parseLayout)("inset-y-[15%]")).toEqual({top:"15%",bottom:"15%"});});(0,_vitest.it)("should parse negative arbitrary inset values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-[-5px]")).toEqual({top:-5,right:-5,bottom:-5,left:-5});(0,_vitest.expect)((0,_layout.parseLayout)("inset-x-[-10px]")).toEqual({left:-10,right:-10});(0,_vitest.expect)((0,_layout.parseLayout)("inset-y-[-15px]")).toEqual({top:-15,bottom:-15});(0,_vitest.expect)((0,_layout.parseLayout)("inset-[-20%]")).toEqual({top:"-20%",right:"-20%",bottom:"-20%",left:"-20%"});});});(0,_vitest.describe)("parseLayout - specific property coverage",function(){(0,_vitest.it)("should return unique objects for each class",function(){var flex1=(0,_layout.parseLayout)("flex");var flex2=(0,_layout.parseLayout)("flex");(0,_vitest.expect)(flex1).toEqual(flex2);});(0,_vitest.it)("should handle flex value variations",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-1")).toEqual({flex:1});(0,_vitest.expect)((0,_layout.parseLayout)("flex-auto")).toEqual({flex:1});(0,_vitest.expect)((0,_layout.parseLayout)("flex-none")).toEqual({flex:0});});(0,_vitest.it)("should distinguish between similar class names",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex")).not.toEqual((0,_layout.parseLayout)("flex-1"));(0,_vitest.expect)((0,_layout.parseLayout)("grow")).not.toEqual((0,_layout.parseLayout)("grow-0"));(0,_vitest.expect)((0,_layout.parseLayout)("shrink")).not.toEqual((0,_layout.parseLayout)("shrink-0"));});(0,_vitest.it)("should handle positioning with absolute/relative",function(){(0,_vitest.expect)((0,_layout.parseLayout)("absolute")).toEqual({position:"absolute"});(0,_vitest.expect)((0,_layout.parseLayout)("top-0")).toEqual({top:0});(0,_vitest.expect)((0,_layout.parseLayout)("left-0")).toEqual({left:0});});(0,_vitest.it)("should handle all positioning directions",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-4")).toHaveProperty("top");(0,_vitest.expect)((0,_layout.parseLayout)("right-4")).toHaveProperty("right");(0,_vitest.expect)((0,_layout.parseLayout)("bottom-4")).toHaveProperty("bottom");(0,_vitest.expect)((0,_layout.parseLayout)("left-4")).toHaveProperty("left");});(0,_vitest.it)("should handle inset shorthand variations",function(){var insetAll=(0,_layout.parseLayout)("inset-4");(0,_vitest.expect)(insetAll).toHaveProperty("top",16);(0,_vitest.expect)(insetAll).toHaveProperty("right",16);(0,_vitest.expect)(insetAll).toHaveProperty("bottom",16);(0,_vitest.expect)(insetAll).toHaveProperty("left",16);var insetX=(0,_layout.parseLayout)("inset-x-4");(0,_vitest.expect)(insetX).toHaveProperty("left",16);(0,_vitest.expect)(insetX).toHaveProperty("right",16);(0,_vitest.expect)(insetX).not.toHaveProperty("top");(0,_vitest.expect)(insetX).not.toHaveProperty("bottom");var insetY=(0,_layout.parseLayout)("inset-y-4");(0,_vitest.expect)(insetY).toHaveProperty("top",16);(0,_vitest.expect)(insetY).toHaveProperty("bottom",16);(0,_vitest.expect)(insetY).not.toHaveProperty("left");(0,_vitest.expect)(insetY).not.toHaveProperty("right");});});(0,_vitest.describe)("parseLayout - logical positioning (RTL-aware)",function(){(0,_vitest.it)("should parse start positioning with preset values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("start-0")).toEqual({start:0});(0,_vitest.expect)((0,_layout.parseLayout)("start-4")).toEqual({start:16});(0,_vitest.expect)((0,_layout.parseLayout)("start-8")).toEqual({start:32});(0,_vitest.expect)((0,_layout.parseLayout)("start-0.5")).toEqual({start:2});(0,_vitest.expect)((0,_layout.parseLayout)("start-2.5")).toEqual({start:10});});(0,_vitest.it)("should parse end positioning with preset values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("end-0")).toEqual({end:0});(0,_vitest.expect)((0,_layout.parseLayout)("end-4")).toEqual({end:16});(0,_vitest.expect)((0,_layout.parseLayout)("end-8")).toEqual({end:32});(0,_vitest.expect)((0,_layout.parseLayout)("end-0.5")).toEqual({end:2});(0,_vitest.expect)((0,_layout.parseLayout)("end-2.5")).toEqual({end:10});});(0,_vitest.it)("should parse start/end with arbitrary pixel values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("start-[10px]")).toEqual({start:10});(0,_vitest.expect)((0,_layout.parseLayout)("start-[50]")).toEqual({start:50});(0,_vitest.expect)((0,_layout.parseLayout)("end-[10px]")).toEqual({end:10});(0,_vitest.expect)((0,_layout.parseLayout)("end-[50]")).toEqual({end:50});});(0,_vitest.it)("should parse start/end with arbitrary percentage values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("start-[10%]")).toEqual({start:"10%"});(0,_vitest.expect)((0,_layout.parseLayout)("start-[50%]")).toEqual({start:"50%"});(0,_vitest.expect)((0,_layout.parseLayout)("end-[10%]")).toEqual({end:"10%"});(0,_vitest.expect)((0,_layout.parseLayout)("end-[50%]")).toEqual({end:"50%"});});(0,_vitest.it)("should parse negative start/end with preset values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("-start-4")).toEqual({start:-16});(0,_vitest.expect)((0,_layout.parseLayout)("-start-8")).toEqual({start:-32});(0,_vitest.expect)((0,_layout.parseLayout)("-end-4")).toEqual({end:-16});(0,_vitest.expect)((0,_layout.parseLayout)("-end-8")).toEqual({end:-32});});(0,_vitest.it)("should parse negative start/end with arbitrary values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("-start-[10px]")).toEqual({start:-10});(0,_vitest.expect)((0,_layout.parseLayout)("-start-[50]")).toEqual({start:-50});(0,_vitest.expect)((0,_layout.parseLayout)("-end-[10px]")).toEqual({end:-10});(0,_vitest.expect)((0,_layout.parseLayout)("-end-[50]")).toEqual({end:-50});(0,_vitest.expect)((0,_layout.parseLayout)("-start-[10%]")).toEqual({start:"-10%"});(0,_vitest.expect)((0,_layout.parseLayout)("-end-[25%]")).toEqual({end:"-25%"});});(0,_vitest.it)("should handle auto value for start/end",function(){(0,_vitest.expect)((0,_layout.parseLayout)("start-auto")).toEqual({});(0,_vitest.expect)((0,_layout.parseLayout)("end-auto")).toEqual({});});});(0,_vitest.describe)("parseLayout - logical inset (RTL-aware)",function(){(0,_vitest.it)("should parse inset-s (start) with preset values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-s-0")).toEqual({start:0});(0,_vitest.expect)((0,_layout.parseLayout)("inset-s-4")).toEqual({start:16});(0,_vitest.expect)((0,_layout.parseLayout)("inset-s-8")).toEqual({start:32});});(0,_vitest.it)("should parse inset-e (end) with preset values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-e-0")).toEqual({end:0});(0,_vitest.expect)((0,_layout.parseLayout)("inset-e-4")).toEqual({end:16});(0,_vitest.expect)((0,_layout.parseLayout)("inset-e-8")).toEqual({end:32});});(0,_vitest.it)("should parse inset-s/inset-e with arbitrary values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-s-[10px]")).toEqual({start:10});(0,_vitest.expect)((0,_layout.parseLayout)("inset-s-[20%]")).toEqual({start:"20%"});(0,_vitest.expect)((0,_layout.parseLayout)("inset-e-[10px]")).toEqual({end:10});(0,_vitest.expect)((0,_layout.parseLayout)("inset-e-[20%]")).toEqual({end:"20%"});});});(0,_vitest.describe)("parseLayout - custom spacing",function(){var customSpacing={xs:4,sm:8,md:16,lg:32,xl:64,"4":20};(0,_vitest.it)("should support custom spacing values for top/right/bottom/left",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-xs",customSpacing)).toEqual({top:4});(0,_vitest.expect)((0,_layout.parseLayout)("top-sm",customSpacing)).toEqual({top:8});(0,_vitest.expect)((0,_layout.parseLayout)("top-md",customSpacing)).toEqual({top:16});(0,_vitest.expect)((0,_layout.parseLayout)("top-lg",customSpacing)).toEqual({top:32});(0,_vitest.expect)((0,_layout.parseLayout)("top-xl",customSpacing)).toEqual({top:64});(0,_vitest.expect)((0,_layout.parseLayout)("right-xs",customSpacing)).toEqual({right:4});(0,_vitest.expect)((0,_layout.parseLayout)("bottom-sm",customSpacing)).toEqual({bottom:8});(0,_vitest.expect)((0,_layout.parseLayout)("left-md",customSpacing)).toEqual({left:16});});(0,_vitest.it)("should override default spacing values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-4")).toEqual({top:16});(0,_vitest.expect)((0,_layout.parseLayout)("top-4",customSpacing)).toEqual({top:20});});(0,_vitest.it)("should merge custom spacing with defaults",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-0",customSpacing)).toEqual({top:0});(0,_vitest.expect)((0,_layout.parseLayout)("top-8",customSpacing)).toEqual({top:32});(0,_vitest.expect)((0,_layout.parseLayout)("top-xs",customSpacing)).toEqual({top:4});});(0,_vitest.it)("should support custom spacing for start/end (RTL-aware)",function(){(0,_vitest.expect)((0,_layout.parseLayout)("start-xs",customSpacing)).toEqual({start:4});(0,_vitest.expect)((0,_layout.parseLayout)("end-lg",customSpacing)).toEqual({end:32});});(0,_vitest.it)("should support custom spacing for inset utilities",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-xs",customSpacing)).toEqual({top:4,right:4,bottom:4,left:4});(0,_vitest.expect)((0,_layout.parseLayout)("inset-x-sm",customSpacing)).toEqual({left:8,right:8});(0,_vitest.expect)((0,_layout.parseLayout)("inset-y-md",customSpacing)).toEqual({top:16,bottom:16});});(0,_vitest.it)("should support custom spacing for inset-s/inset-e",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-s-lg",customSpacing)).toEqual({start:32});(0,_vitest.expect)((0,_layout.parseLayout)("inset-e-xl",customSpacing)).toEqual({end:64});});(0,_vitest.it)("should support negative values with custom spacing for start/end",function(){(0,_vitest.expect)((0,_layout.parseLayout)("-start-sm",customSpacing)).toEqual({start:-8});(0,_vitest.expect)((0,_layout.parseLayout)("-end-md",customSpacing)).toEqual({end:-16});});(0,_vitest.it)("should still support arbitrary values with custom spacing",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-[100px]",customSpacing)).toEqual({top:100});(0,_vitest.expect)((0,_layout.parseLayout)("inset-[50%]",customSpacing)).toEqual({top:"50%",right:"50%",bottom:"50%",left:"50%"});});(0,_vitest.it)("should handle non-layout classes as null",function(){(0,_vitest.expect)((0,_layout.parseLayout)("text-xl",customSpacing)).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("bg-blue-500",customSpacing)).toBeNull();});});
|
|
1
|
+
var _vitest=require("vitest");var _layout=require("./layout");(0,_vitest.describe)("parseLayout - display utilities",function(){(0,_vitest.it)("should parse display flex",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex")).toEqual({display:"flex"});});(0,_vitest.it)("should parse display hidden",function(){(0,_vitest.expect)((0,_layout.parseLayout)("hidden")).toEqual({display:"none"});});});(0,_vitest.describe)("parseLayout - flex direction utilities",function(){(0,_vitest.it)("should parse flex row",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-row")).toEqual({flexDirection:"row"});});(0,_vitest.it)("should parse flex row reverse",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-row-reverse")).toEqual({flexDirection:"row-reverse"});});(0,_vitest.it)("should parse flex column",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-col")).toEqual({flexDirection:"column"});});(0,_vitest.it)("should parse flex column reverse",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-col-reverse")).toEqual({flexDirection:"column-reverse"});});});(0,_vitest.describe)("parseLayout - flex wrap utilities",function(){(0,_vitest.it)("should parse flex wrap",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-wrap")).toEqual({flexWrap:"wrap"});});(0,_vitest.it)("should parse flex wrap reverse",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-wrap-reverse")).toEqual({flexWrap:"wrap-reverse"});});(0,_vitest.it)("should parse flex nowrap",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-nowrap")).toEqual({flexWrap:"nowrap"});});});(0,_vitest.describe)("parseLayout - flex utilities",function(){(0,_vitest.it)("should parse flex-1",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-1")).toEqual({flex:1});});(0,_vitest.it)("should parse flex-auto",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-auto")).toEqual({flex:1});});(0,_vitest.it)("should parse flex-none",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-none")).toEqual({flex:0});});});(0,_vitest.describe)("parseLayout - flex grow/shrink utilities",function(){(0,_vitest.it)("should parse grow",function(){(0,_vitest.expect)((0,_layout.parseLayout)("grow")).toEqual({flexGrow:1});});(0,_vitest.it)("should parse grow-0",function(){(0,_vitest.expect)((0,_layout.parseLayout)("grow-0")).toEqual({flexGrow:0});});(0,_vitest.it)("should parse shrink",function(){(0,_vitest.expect)((0,_layout.parseLayout)("shrink")).toEqual({flexShrink:1});});(0,_vitest.it)("should parse shrink-0",function(){(0,_vitest.expect)((0,_layout.parseLayout)("shrink-0")).toEqual({flexShrink:0});});(0,_vitest.it)("should parse grow with arbitrary values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("grow-[1.5]")).toEqual({flexGrow:1.5});(0,_vitest.expect)((0,_layout.parseLayout)("grow-[2]")).toEqual({flexGrow:2});(0,_vitest.expect)((0,_layout.parseLayout)("grow-[0.5]")).toEqual({flexGrow:0.5});(0,_vitest.expect)((0,_layout.parseLayout)("grow-[3]")).toEqual({flexGrow:3});(0,_vitest.expect)((0,_layout.parseLayout)("grow-[0]")).toEqual({flexGrow:0});});(0,_vitest.it)("should parse shrink with arbitrary values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("shrink-[0.5]")).toEqual({flexShrink:0.5});(0,_vitest.expect)((0,_layout.parseLayout)("shrink-[2]")).toEqual({flexShrink:2});(0,_vitest.expect)((0,_layout.parseLayout)("shrink-[1.5]")).toEqual({flexShrink:1.5});(0,_vitest.expect)((0,_layout.parseLayout)("shrink-[3]")).toEqual({flexShrink:3});(0,_vitest.expect)((0,_layout.parseLayout)("shrink-[0]")).toEqual({flexShrink:0});});(0,_vitest.it)("should parse CSS-style flex-grow aliases",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-grow")).toEqual({flexGrow:1});(0,_vitest.expect)((0,_layout.parseLayout)("flex-grow-0")).toEqual({flexGrow:0});});(0,_vitest.it)("should parse CSS-style flex-shrink aliases",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-shrink")).toEqual({flexShrink:1});(0,_vitest.expect)((0,_layout.parseLayout)("flex-shrink-0")).toEqual({flexShrink:0});});(0,_vitest.it)("should parse CSS-style flex-grow with arbitrary values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-grow-[1.5]")).toEqual({flexGrow:1.5});(0,_vitest.expect)((0,_layout.parseLayout)("flex-grow-[2]")).toEqual({flexGrow:2});(0,_vitest.expect)((0,_layout.parseLayout)("flex-grow-[0.5]")).toEqual({flexGrow:0.5});});(0,_vitest.it)("should parse CSS-style flex-shrink with arbitrary values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-shrink-[0.5]")).toEqual({flexShrink:0.5});(0,_vitest.expect)((0,_layout.parseLayout)("flex-shrink-[2]")).toEqual({flexShrink:2});(0,_vitest.expect)((0,_layout.parseLayout)("flex-shrink-[1.5]")).toEqual({flexShrink:1.5});});(0,_vitest.it)("should handle edge case values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("grow-[0.1]")).toEqual({flexGrow:0.1});(0,_vitest.expect)((0,_layout.parseLayout)("grow-[10]")).toEqual({flexGrow:10});(0,_vitest.expect)((0,_layout.parseLayout)("shrink-[0.01]")).toEqual({flexShrink:0.01});(0,_vitest.expect)((0,_layout.parseLayout)("shrink-[100]")).toEqual({flexShrink:100});});(0,_vitest.it)("should parse Tailwind shorthand decimals (no leading zero)",function(){(0,_vitest.expect)((0,_layout.parseLayout)("grow-[.5]")).toEqual({flexGrow:0.5});(0,_vitest.expect)((0,_layout.parseLayout)("grow-[.75]")).toEqual({flexGrow:0.75});(0,_vitest.expect)((0,_layout.parseLayout)("shrink-[.5]")).toEqual({flexShrink:0.5});(0,_vitest.expect)((0,_layout.parseLayout)("shrink-[.25]")).toEqual({flexShrink:0.25});(0,_vitest.expect)((0,_layout.parseLayout)("flex-grow-[.5]")).toEqual({flexGrow:0.5});(0,_vitest.expect)((0,_layout.parseLayout)("flex-shrink-[.5]")).toEqual({flexShrink:0.5});});(0,_vitest.it)("should reject negative values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("grow-[-1]")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("shrink-[-1]")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("flex-grow-[-2]")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("flex-shrink-[-0.5]")).toBeNull();});});(0,_vitest.describe)("parseLayout - justify content utilities",function(){(0,_vitest.it)("should parse justify-start",function(){(0,_vitest.expect)((0,_layout.parseLayout)("justify-start")).toEqual({justifyContent:"flex-start"});});(0,_vitest.it)("should parse justify-end",function(){(0,_vitest.expect)((0,_layout.parseLayout)("justify-end")).toEqual({justifyContent:"flex-end"});});(0,_vitest.it)("should parse justify-center",function(){(0,_vitest.expect)((0,_layout.parseLayout)("justify-center")).toEqual({justifyContent:"center"});});(0,_vitest.it)("should parse justify-between",function(){(0,_vitest.expect)((0,_layout.parseLayout)("justify-between")).toEqual({justifyContent:"space-between"});});(0,_vitest.it)("should parse justify-around",function(){(0,_vitest.expect)((0,_layout.parseLayout)("justify-around")).toEqual({justifyContent:"space-around"});});(0,_vitest.it)("should parse justify-evenly",function(){(0,_vitest.expect)((0,_layout.parseLayout)("justify-evenly")).toEqual({justifyContent:"space-evenly"});});});(0,_vitest.describe)("parseLayout - align items utilities",function(){(0,_vitest.it)("should parse items-start",function(){(0,_vitest.expect)((0,_layout.parseLayout)("items-start")).toEqual({alignItems:"flex-start"});});(0,_vitest.it)("should parse items-end",function(){(0,_vitest.expect)((0,_layout.parseLayout)("items-end")).toEqual({alignItems:"flex-end"});});(0,_vitest.it)("should parse items-center",function(){(0,_vitest.expect)((0,_layout.parseLayout)("items-center")).toEqual({alignItems:"center"});});(0,_vitest.it)("should parse items-baseline",function(){(0,_vitest.expect)((0,_layout.parseLayout)("items-baseline")).toEqual({alignItems:"baseline"});});(0,_vitest.it)("should parse items-stretch",function(){(0,_vitest.expect)((0,_layout.parseLayout)("items-stretch")).toEqual({alignItems:"stretch"});});});(0,_vitest.describe)("parseLayout - align self utilities",function(){(0,_vitest.it)("should parse self-auto",function(){(0,_vitest.expect)((0,_layout.parseLayout)("self-auto")).toEqual({alignSelf:"auto"});});(0,_vitest.it)("should parse self-start",function(){(0,_vitest.expect)((0,_layout.parseLayout)("self-start")).toEqual({alignSelf:"flex-start"});});(0,_vitest.it)("should parse self-end",function(){(0,_vitest.expect)((0,_layout.parseLayout)("self-end")).toEqual({alignSelf:"flex-end"});});(0,_vitest.it)("should parse self-center",function(){(0,_vitest.expect)((0,_layout.parseLayout)("self-center")).toEqual({alignSelf:"center"});});(0,_vitest.it)("should parse self-stretch",function(){(0,_vitest.expect)((0,_layout.parseLayout)("self-stretch")).toEqual({alignSelf:"stretch"});});(0,_vitest.it)("should parse self-baseline",function(){(0,_vitest.expect)((0,_layout.parseLayout)("self-baseline")).toEqual({alignSelf:"baseline"});});});(0,_vitest.describe)("parseLayout - align content utilities",function(){(0,_vitest.it)("should parse content-start",function(){(0,_vitest.expect)((0,_layout.parseLayout)("content-start")).toEqual({alignContent:"flex-start"});});(0,_vitest.it)("should parse content-end",function(){(0,_vitest.expect)((0,_layout.parseLayout)("content-end")).toEqual({alignContent:"flex-end"});});(0,_vitest.it)("should parse content-center",function(){(0,_vitest.expect)((0,_layout.parseLayout)("content-center")).toEqual({alignContent:"center"});});(0,_vitest.it)("should parse content-between",function(){(0,_vitest.expect)((0,_layout.parseLayout)("content-between")).toEqual({alignContent:"space-between"});});(0,_vitest.it)("should parse content-around",function(){(0,_vitest.expect)((0,_layout.parseLayout)("content-around")).toEqual({alignContent:"space-around"});});(0,_vitest.it)("should parse content-stretch",function(){(0,_vitest.expect)((0,_layout.parseLayout)("content-stretch")).toEqual({alignContent:"stretch"});});});(0,_vitest.describe)("parseLayout - position utilities",function(){(0,_vitest.it)("should parse absolute",function(){(0,_vitest.expect)((0,_layout.parseLayout)("absolute")).toEqual({position:"absolute"});});(0,_vitest.it)("should parse relative",function(){(0,_vitest.expect)((0,_layout.parseLayout)("relative")).toEqual({position:"relative"});});});(0,_vitest.describe)("parseLayout - overflow utilities",function(){(0,_vitest.it)("should parse overflow-hidden",function(){(0,_vitest.expect)((0,_layout.parseLayout)("overflow-hidden")).toEqual({overflow:"hidden"});});(0,_vitest.it)("should parse overflow-visible",function(){(0,_vitest.expect)((0,_layout.parseLayout)("overflow-visible")).toEqual({overflow:"visible"});});(0,_vitest.it)("should parse overflow-scroll",function(){(0,_vitest.expect)((0,_layout.parseLayout)("overflow-scroll")).toEqual({overflow:"scroll"});});});(0,_vitest.describe)("parseLayout - opacity utilities",function(){(0,_vitest.it)("should parse opacity-0 (fully transparent)",function(){(0,_vitest.expect)((0,_layout.parseLayout)("opacity-0")).toEqual({opacity:0});});(0,_vitest.it)("should parse opacity-50 (half transparent)",function(){(0,_vitest.expect)((0,_layout.parseLayout)("opacity-50")).toEqual({opacity:0.5});});(0,_vitest.it)("should parse opacity-100 (fully opaque)",function(){(0,_vitest.expect)((0,_layout.parseLayout)("opacity-100")).toEqual({opacity:1});});(0,_vitest.it)("should parse all opacity values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("opacity-5")).toEqual({opacity:0.05});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-10")).toEqual({opacity:0.1});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-15")).toEqual({opacity:0.15});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-20")).toEqual({opacity:0.2});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-25")).toEqual({opacity:0.25});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-30")).toEqual({opacity:0.3});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-35")).toEqual({opacity:0.35});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-40")).toEqual({opacity:0.4});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-45")).toEqual({opacity:0.45});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-55")).toEqual({opacity:0.55});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-60")).toEqual({opacity:0.6});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-65")).toEqual({opacity:0.65});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-70")).toEqual({opacity:0.7});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-75")).toEqual({opacity:0.75});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-80")).toEqual({opacity:0.8});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-85")).toEqual({opacity:0.85});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-90")).toEqual({opacity:0.9});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-95")).toEqual({opacity:0.95});});});(0,_vitest.describe)("parseLayout - edge cases",function(){(0,_vitest.it)("should return null for invalid classes",function(){(0,_vitest.expect)((0,_layout.parseLayout)("invalid")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("flex-invalid")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("justify")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("items")).toBeNull();});(0,_vitest.it)("should return null for empty string",function(){(0,_vitest.expect)((0,_layout.parseLayout)("")).toBeNull();});(0,_vitest.it)("should return null for partial class names",function(){(0,_vitest.expect)((0,_layout.parseLayout)("fle")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("flexbox")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("justify-start-center")).toBeNull();});(0,_vitest.it)("should return null for CSS classes not in React Native",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inline")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("block")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("inline-block")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("grid")).toBeNull();});});(0,_vitest.describe)("parseLayout - comprehensive coverage",function(){(0,_vitest.it)("should handle all flex direction variants",function(){var directions=["flex-row","flex-row-reverse","flex-col","flex-col-reverse"];directions.forEach(function(dir){(0,_vitest.expect)((0,_layout.parseLayout)(dir)).toBeTruthy();});});(0,_vitest.it)("should handle all flex wrap variants",function(){var wraps=["flex-wrap","flex-wrap-reverse","flex-nowrap"];wraps.forEach(function(wrap){(0,_vitest.expect)((0,_layout.parseLayout)(wrap)).toBeTruthy();});});(0,_vitest.it)("should handle all justify content variants",function(){var justifies=["justify-start","justify-end","justify-center","justify-between","justify-around","justify-evenly"];justifies.forEach(function(justify){(0,_vitest.expect)((0,_layout.parseLayout)(justify)).toBeTruthy();});});(0,_vitest.it)("should handle all align items variants",function(){var aligns=["items-start","items-end","items-center","items-baseline","items-stretch"];aligns.forEach(function(align){(0,_vitest.expect)((0,_layout.parseLayout)(align)).toBeTruthy();});});(0,_vitest.it)("should handle all align self variants",function(){var selfs=["self-auto","self-start","self-end","self-center","self-stretch","self-baseline"];selfs.forEach(function(self){(0,_vitest.expect)((0,_layout.parseLayout)(self)).toBeTruthy();});});(0,_vitest.it)("should handle all align content variants",function(){var contents=["content-start","content-end","content-center","content-between","content-around","content-stretch"];contents.forEach(function(content){(0,_vitest.expect)((0,_layout.parseLayout)(content)).toBeTruthy();});});(0,_vitest.it)("should handle all position variants",function(){var positions=["absolute","relative"];positions.forEach(function(position){(0,_vitest.expect)((0,_layout.parseLayout)(position)).toBeTruthy();});});(0,_vitest.it)("should handle all overflow variants",function(){var overflows=["overflow-hidden","overflow-visible","overflow-scroll"];overflows.forEach(function(overflow){(0,_vitest.expect)((0,_layout.parseLayout)(overflow)).toBeTruthy();});});});(0,_vitest.describe)("parseLayout - case sensitivity",function(){(0,_vitest.it)("should be case-sensitive",function(){(0,_vitest.expect)((0,_layout.parseLayout)("FLEX")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("Flex")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("ABSOLUTE")).toBeNull();});});(0,_vitest.describe)("parseLayout - z-index utilities",function(){(0,_vitest.it)("should parse z-index values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("z-0")).toEqual({zIndex:0});(0,_vitest.expect)((0,_layout.parseLayout)("z-10")).toEqual({zIndex:10});(0,_vitest.expect)((0,_layout.parseLayout)("z-20")).toEqual({zIndex:20});(0,_vitest.expect)((0,_layout.parseLayout)("z-30")).toEqual({zIndex:30});(0,_vitest.expect)((0,_layout.parseLayout)("z-40")).toEqual({zIndex:40});(0,_vitest.expect)((0,_layout.parseLayout)("z-50")).toEqual({zIndex:50});});(0,_vitest.it)("should parse z-auto as 0",function(){(0,_vitest.expect)((0,_layout.parseLayout)("z-auto")).toEqual({zIndex:0});});(0,_vitest.it)("should parse arbitrary z-index values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("z-[999]")).toEqual({zIndex:999});(0,_vitest.expect)((0,_layout.parseLayout)("z-[100]")).toEqual({zIndex:100});(0,_vitest.expect)((0,_layout.parseLayout)("z-[1]")).toEqual({zIndex:1});});(0,_vitest.it)("should parse negative arbitrary z-index values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("z-[-1]")).toEqual({zIndex:-1});(0,_vitest.expect)((0,_layout.parseLayout)("z-[-10]")).toEqual({zIndex:-10});(0,_vitest.expect)((0,_layout.parseLayout)("z-[-999]")).toEqual({zIndex:-999});});(0,_vitest.it)("should return null for invalid z-index values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("z-100")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("z-5")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("z-invalid")).toBeNull();});});(0,_vitest.describe)("parseLayout - positioning utilities",function(){(0,_vitest.it)("should parse top values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-0")).toEqual({top:0});(0,_vitest.expect)((0,_layout.parseLayout)("top-4")).toEqual({top:16});(0,_vitest.expect)((0,_layout.parseLayout)("top-8")).toEqual({top:32});(0,_vitest.expect)((0,_layout.parseLayout)("top-16")).toEqual({top:64});});(0,_vitest.it)("should parse right values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("right-0")).toEqual({right:0});(0,_vitest.expect)((0,_layout.parseLayout)("right-4")).toEqual({right:16});(0,_vitest.expect)((0,_layout.parseLayout)("right-8")).toEqual({right:32});(0,_vitest.expect)((0,_layout.parseLayout)("right-16")).toEqual({right:64});});(0,_vitest.it)("should parse bottom values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("bottom-0")).toEqual({bottom:0});(0,_vitest.expect)((0,_layout.parseLayout)("bottom-4")).toEqual({bottom:16});(0,_vitest.expect)((0,_layout.parseLayout)("bottom-8")).toEqual({bottom:32});(0,_vitest.expect)((0,_layout.parseLayout)("bottom-16")).toEqual({bottom:64});});(0,_vitest.it)("should parse left values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("left-0")).toEqual({left:0});(0,_vitest.expect)((0,_layout.parseLayout)("left-4")).toEqual({left:16});(0,_vitest.expect)((0,_layout.parseLayout)("left-8")).toEqual({left:32});(0,_vitest.expect)((0,_layout.parseLayout)("left-16")).toEqual({left:64});});(0,_vitest.it)("should parse fractional positioning values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-0.5")).toEqual({top:2});(0,_vitest.expect)((0,_layout.parseLayout)("right-1.5")).toEqual({right:6});(0,_vitest.expect)((0,_layout.parseLayout)("bottom-2.5")).toEqual({bottom:10});(0,_vitest.expect)((0,_layout.parseLayout)("left-3.5")).toEqual({left:14});});(0,_vitest.it)("should parse auto positioning values as empty object",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-auto")).toEqual({});(0,_vitest.expect)((0,_layout.parseLayout)("right-auto")).toEqual({});(0,_vitest.expect)((0,_layout.parseLayout)("bottom-auto")).toEqual({});(0,_vitest.expect)((0,_layout.parseLayout)("left-auto")).toEqual({});});(0,_vitest.it)("should parse arbitrary top values with pixels",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-[50px]")).toEqual({top:50});(0,_vitest.expect)((0,_layout.parseLayout)("top-[100px]")).toEqual({top:100});(0,_vitest.expect)((0,_layout.parseLayout)("top-[0px]")).toEqual({top:0});});(0,_vitest.it)("should parse arbitrary top values without unit (defaults to px)",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-[50]")).toEqual({top:50});(0,_vitest.expect)((0,_layout.parseLayout)("top-[100]")).toEqual({top:100});});(0,_vitest.it)("should parse arbitrary top values with percentages",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-[25%]")).toEqual({top:"25%"});(0,_vitest.expect)((0,_layout.parseLayout)("top-[50%]")).toEqual({top:"50%"});(0,_vitest.expect)((0,_layout.parseLayout)("top-[10.5%]")).toEqual({top:"10.5%"});});(0,_vitest.it)("should parse negative arbitrary top values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-[-10px]")).toEqual({top:-10});(0,_vitest.expect)((0,_layout.parseLayout)("top-[-50]")).toEqual({top:-50});(0,_vitest.expect)((0,_layout.parseLayout)("top-[-25%]")).toEqual({top:"-25%"});});(0,_vitest.it)("should parse arbitrary right values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("right-[30px]")).toEqual({right:30});(0,_vitest.expect)((0,_layout.parseLayout)("right-[20]")).toEqual({right:20});(0,_vitest.expect)((0,_layout.parseLayout)("right-[15%]")).toEqual({right:"15%"});(0,_vitest.expect)((0,_layout.parseLayout)("right-[-10px]")).toEqual({right:-10});});(0,_vitest.it)("should parse arbitrary bottom values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("bottom-[40px]")).toEqual({bottom:40});(0,_vitest.expect)((0,_layout.parseLayout)("bottom-[25]")).toEqual({bottom:25});(0,_vitest.expect)((0,_layout.parseLayout)("bottom-[33.333%]")).toEqual({bottom:"33.333%"});(0,_vitest.expect)((0,_layout.parseLayout)("bottom-[-15px]")).toEqual({bottom:-15});});(0,_vitest.it)("should parse arbitrary left values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("left-[60px]")).toEqual({left:60});(0,_vitest.expect)((0,_layout.parseLayout)("left-[45]")).toEqual({left:45});(0,_vitest.expect)((0,_layout.parseLayout)("left-[12.5%]")).toEqual({left:"12.5%"});(0,_vitest.expect)((0,_layout.parseLayout)("left-[-20px]")).toEqual({left:-20});});(0,_vitest.it)("should parse negative positioning prefixes",function(){(0,_vitest.expect)((0,_layout.parseLayout)("-top-1")).toEqual({top:-4});(0,_vitest.expect)((0,_layout.parseLayout)("-top-4")).toEqual({top:-16});(0,_vitest.expect)((0,_layout.parseLayout)("-right-1")).toEqual({right:-4});(0,_vitest.expect)((0,_layout.parseLayout)("-right-2")).toEqual({right:-8});(0,_vitest.expect)((0,_layout.parseLayout)("-bottom-4")).toEqual({bottom:-16});(0,_vitest.expect)((0,_layout.parseLayout)("-bottom-8")).toEqual({bottom:-32});(0,_vitest.expect)((0,_layout.parseLayout)("-left-2")).toEqual({left:-8});(0,_vitest.expect)((0,_layout.parseLayout)("-left-4")).toEqual({left:-16});});(0,_vitest.it)("should parse negative positioning with fractional values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("-top-0.5")).toEqual({top:-2});(0,_vitest.expect)((0,_layout.parseLayout)("-right-1.5")).toEqual({right:-6});(0,_vitest.expect)((0,_layout.parseLayout)("-bottom-2.5")).toEqual({bottom:-10});(0,_vitest.expect)((0,_layout.parseLayout)("-left-3.5")).toEqual({left:-14});});(0,_vitest.it)("should parse negative positioning with arbitrary values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("-top-[10px]")).toEqual({top:-10});(0,_vitest.expect)((0,_layout.parseLayout)("-right-[20px]")).toEqual({right:-20});(0,_vitest.expect)((0,_layout.parseLayout)("-bottom-[30]")).toEqual({bottom:-30});(0,_vitest.expect)((0,_layout.parseLayout)("-left-[40px]")).toEqual({left:-40});});(0,_vitest.it)("should parse negative positioning with arbitrary percentages",function(){(0,_vitest.expect)((0,_layout.parseLayout)("-top-[10%]")).toEqual({top:"-10%"});(0,_vitest.expect)((0,_layout.parseLayout)("-right-[25%]")).toEqual({right:"-25%"});(0,_vitest.expect)((0,_layout.parseLayout)("-bottom-[50%]")).toEqual({bottom:"-50%"});(0,_vitest.expect)((0,_layout.parseLayout)("-left-[100%]")).toEqual({left:"-100%"});});});(0,_vitest.describe)("parseLayout - inset utilities",function(){(0,_vitest.it)("should parse inset (all sides) values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-0")).toEqual({top:0,right:0,bottom:0,left:0});(0,_vitest.expect)((0,_layout.parseLayout)("inset-4")).toEqual({top:16,right:16,bottom:16,left:16});(0,_vitest.expect)((0,_layout.parseLayout)("inset-8")).toEqual({top:32,right:32,bottom:32,left:32});});(0,_vitest.it)("should parse inset-x (horizontal) values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-x-0")).toEqual({left:0,right:0});(0,_vitest.expect)((0,_layout.parseLayout)("inset-x-4")).toEqual({left:16,right:16});(0,_vitest.expect)((0,_layout.parseLayout)("inset-x-8")).toEqual({left:32,right:32});});(0,_vitest.it)("should parse inset-y (vertical) values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-y-0")).toEqual({top:0,bottom:0});(0,_vitest.expect)((0,_layout.parseLayout)("inset-y-4")).toEqual({top:16,bottom:16});(0,_vitest.expect)((0,_layout.parseLayout)("inset-y-8")).toEqual({top:32,bottom:32});});(0,_vitest.it)("should parse fractional inset values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-0.5")).toEqual({top:2,right:2,bottom:2,left:2});(0,_vitest.expect)((0,_layout.parseLayout)("inset-x-1.5")).toEqual({left:6,right:6});(0,_vitest.expect)((0,_layout.parseLayout)("inset-y-2.5")).toEqual({top:10,bottom:10});});(0,_vitest.it)("should return null for invalid inset values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-100")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("inset-x-100")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("inset-y-100")).toBeNull();});(0,_vitest.it)("should parse arbitrary inset (all sides) values with pixels",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-[10px]")).toEqual({top:10,right:10,bottom:10,left:10});(0,_vitest.expect)((0,_layout.parseLayout)("inset-[25px]")).toEqual({top:25,right:25,bottom:25,left:25});(0,_vitest.expect)((0,_layout.parseLayout)("inset-[0px]")).toEqual({top:0,right:0,bottom:0,left:0});});(0,_vitest.it)("should parse arbitrary inset values without unit (defaults to px)",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-[15]")).toEqual({top:15,right:15,bottom:15,left:15});(0,_vitest.expect)((0,_layout.parseLayout)("inset-[30]")).toEqual({top:30,right:30,bottom:30,left:30});});(0,_vitest.it)("should parse arbitrary inset values with percentages",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-[10%]")).toEqual({top:"10%",right:"10%",bottom:"10%",left:"10%"});(0,_vitest.expect)((0,_layout.parseLayout)("inset-[25%]")).toEqual({top:"25%",right:"25%",bottom:"25%",left:"25%"});(0,_vitest.expect)((0,_layout.parseLayout)("inset-[5.5%]")).toEqual({top:"5.5%",right:"5.5%",bottom:"5.5%",left:"5.5%"});});(0,_vitest.it)("should parse arbitrary inset-x (horizontal) values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-x-[20px]")).toEqual({left:20,right:20});(0,_vitest.expect)((0,_layout.parseLayout)("inset-x-[15]")).toEqual({left:15,right:15});(0,_vitest.expect)((0,_layout.parseLayout)("inset-x-[10%]")).toEqual({left:"10%",right:"10%"});});(0,_vitest.it)("should parse arbitrary inset-y (vertical) values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-y-[30px]")).toEqual({top:30,bottom:30});(0,_vitest.expect)((0,_layout.parseLayout)("inset-y-[25]")).toEqual({top:25,bottom:25});(0,_vitest.expect)((0,_layout.parseLayout)("inset-y-[15%]")).toEqual({top:"15%",bottom:"15%"});});(0,_vitest.it)("should parse negative arbitrary inset values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-[-5px]")).toEqual({top:-5,right:-5,bottom:-5,left:-5});(0,_vitest.expect)((0,_layout.parseLayout)("inset-x-[-10px]")).toEqual({left:-10,right:-10});(0,_vitest.expect)((0,_layout.parseLayout)("inset-y-[-15px]")).toEqual({top:-15,bottom:-15});(0,_vitest.expect)((0,_layout.parseLayout)("inset-[-20%]")).toEqual({top:"-20%",right:"-20%",bottom:"-20%",left:"-20%"});});});(0,_vitest.describe)("parseLayout - specific property coverage",function(){(0,_vitest.it)("should return unique objects for each class",function(){var flex1=(0,_layout.parseLayout)("flex");var flex2=(0,_layout.parseLayout)("flex");(0,_vitest.expect)(flex1).toEqual(flex2);});(0,_vitest.it)("should handle flex value variations",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-1")).toEqual({flex:1});(0,_vitest.expect)((0,_layout.parseLayout)("flex-auto")).toEqual({flex:1});(0,_vitest.expect)((0,_layout.parseLayout)("flex-none")).toEqual({flex:0});});(0,_vitest.it)("should distinguish between similar class names",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex")).not.toEqual((0,_layout.parseLayout)("flex-1"));(0,_vitest.expect)((0,_layout.parseLayout)("grow")).not.toEqual((0,_layout.parseLayout)("grow-0"));(0,_vitest.expect)((0,_layout.parseLayout)("shrink")).not.toEqual((0,_layout.parseLayout)("shrink-0"));});(0,_vitest.it)("should handle positioning with absolute/relative",function(){(0,_vitest.expect)((0,_layout.parseLayout)("absolute")).toEqual({position:"absolute"});(0,_vitest.expect)((0,_layout.parseLayout)("top-0")).toEqual({top:0});(0,_vitest.expect)((0,_layout.parseLayout)("left-0")).toEqual({left:0});});(0,_vitest.it)("should handle all positioning directions",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-4")).toHaveProperty("top");(0,_vitest.expect)((0,_layout.parseLayout)("right-4")).toHaveProperty("right");(0,_vitest.expect)((0,_layout.parseLayout)("bottom-4")).toHaveProperty("bottom");(0,_vitest.expect)((0,_layout.parseLayout)("left-4")).toHaveProperty("left");});(0,_vitest.it)("should handle inset shorthand variations",function(){var insetAll=(0,_layout.parseLayout)("inset-4");(0,_vitest.expect)(insetAll).toHaveProperty("top",16);(0,_vitest.expect)(insetAll).toHaveProperty("right",16);(0,_vitest.expect)(insetAll).toHaveProperty("bottom",16);(0,_vitest.expect)(insetAll).toHaveProperty("left",16);var insetX=(0,_layout.parseLayout)("inset-x-4");(0,_vitest.expect)(insetX).toHaveProperty("left",16);(0,_vitest.expect)(insetX).toHaveProperty("right",16);(0,_vitest.expect)(insetX).not.toHaveProperty("top");(0,_vitest.expect)(insetX).not.toHaveProperty("bottom");var insetY=(0,_layout.parseLayout)("inset-y-4");(0,_vitest.expect)(insetY).toHaveProperty("top",16);(0,_vitest.expect)(insetY).toHaveProperty("bottom",16);(0,_vitest.expect)(insetY).not.toHaveProperty("left");(0,_vitest.expect)(insetY).not.toHaveProperty("right");});});(0,_vitest.describe)("parseLayout - logical positioning (RTL-aware)",function(){(0,_vitest.it)("should parse start positioning with preset values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("start-0")).toEqual({start:0});(0,_vitest.expect)((0,_layout.parseLayout)("start-4")).toEqual({start:16});(0,_vitest.expect)((0,_layout.parseLayout)("start-8")).toEqual({start:32});(0,_vitest.expect)((0,_layout.parseLayout)("start-0.5")).toEqual({start:2});(0,_vitest.expect)((0,_layout.parseLayout)("start-2.5")).toEqual({start:10});});(0,_vitest.it)("should parse end positioning with preset values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("end-0")).toEqual({end:0});(0,_vitest.expect)((0,_layout.parseLayout)("end-4")).toEqual({end:16});(0,_vitest.expect)((0,_layout.parseLayout)("end-8")).toEqual({end:32});(0,_vitest.expect)((0,_layout.parseLayout)("end-0.5")).toEqual({end:2});(0,_vitest.expect)((0,_layout.parseLayout)("end-2.5")).toEqual({end:10});});(0,_vitest.it)("should parse start/end with arbitrary pixel values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("start-[10px]")).toEqual({start:10});(0,_vitest.expect)((0,_layout.parseLayout)("start-[50]")).toEqual({start:50});(0,_vitest.expect)((0,_layout.parseLayout)("end-[10px]")).toEqual({end:10});(0,_vitest.expect)((0,_layout.parseLayout)("end-[50]")).toEqual({end:50});});(0,_vitest.it)("should parse start/end with arbitrary percentage values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("start-[10%]")).toEqual({start:"10%"});(0,_vitest.expect)((0,_layout.parseLayout)("start-[50%]")).toEqual({start:"50%"});(0,_vitest.expect)((0,_layout.parseLayout)("end-[10%]")).toEqual({end:"10%"});(0,_vitest.expect)((0,_layout.parseLayout)("end-[50%]")).toEqual({end:"50%"});});(0,_vitest.it)("should parse negative start/end with preset values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("-start-4")).toEqual({start:-16});(0,_vitest.expect)((0,_layout.parseLayout)("-start-8")).toEqual({start:-32});(0,_vitest.expect)((0,_layout.parseLayout)("-end-4")).toEqual({end:-16});(0,_vitest.expect)((0,_layout.parseLayout)("-end-8")).toEqual({end:-32});});(0,_vitest.it)("should parse negative start/end with arbitrary values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("-start-[10px]")).toEqual({start:-10});(0,_vitest.expect)((0,_layout.parseLayout)("-start-[50]")).toEqual({start:-50});(0,_vitest.expect)((0,_layout.parseLayout)("-end-[10px]")).toEqual({end:-10});(0,_vitest.expect)((0,_layout.parseLayout)("-end-[50]")).toEqual({end:-50});(0,_vitest.expect)((0,_layout.parseLayout)("-start-[10%]")).toEqual({start:"-10%"});(0,_vitest.expect)((0,_layout.parseLayout)("-end-[25%]")).toEqual({end:"-25%"});});(0,_vitest.it)("should handle auto value for start/end",function(){(0,_vitest.expect)((0,_layout.parseLayout)("start-auto")).toEqual({});(0,_vitest.expect)((0,_layout.parseLayout)("end-auto")).toEqual({});});});(0,_vitest.describe)("parseLayout - logical inset (RTL-aware)",function(){(0,_vitest.it)("should parse inset-s (start) with preset values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-s-0")).toEqual({start:0});(0,_vitest.expect)((0,_layout.parseLayout)("inset-s-4")).toEqual({start:16});(0,_vitest.expect)((0,_layout.parseLayout)("inset-s-8")).toEqual({start:32});});(0,_vitest.it)("should parse inset-e (end) with preset values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-e-0")).toEqual({end:0});(0,_vitest.expect)((0,_layout.parseLayout)("inset-e-4")).toEqual({end:16});(0,_vitest.expect)((0,_layout.parseLayout)("inset-e-8")).toEqual({end:32});});(0,_vitest.it)("should parse inset-s/inset-e with arbitrary values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-s-[10px]")).toEqual({start:10});(0,_vitest.expect)((0,_layout.parseLayout)("inset-s-[20%]")).toEqual({start:"20%"});(0,_vitest.expect)((0,_layout.parseLayout)("inset-e-[10px]")).toEqual({end:10});(0,_vitest.expect)((0,_layout.parseLayout)("inset-e-[20%]")).toEqual({end:"20%"});});});(0,_vitest.describe)("parseLayout - custom spacing",function(){var customSpacing={xs:4,sm:8,md:16,lg:32,xl:64,"4":20};(0,_vitest.it)("should support custom spacing values for top/right/bottom/left",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-xs",customSpacing)).toEqual({top:4});(0,_vitest.expect)((0,_layout.parseLayout)("top-sm",customSpacing)).toEqual({top:8});(0,_vitest.expect)((0,_layout.parseLayout)("top-md",customSpacing)).toEqual({top:16});(0,_vitest.expect)((0,_layout.parseLayout)("top-lg",customSpacing)).toEqual({top:32});(0,_vitest.expect)((0,_layout.parseLayout)("top-xl",customSpacing)).toEqual({top:64});(0,_vitest.expect)((0,_layout.parseLayout)("right-xs",customSpacing)).toEqual({right:4});(0,_vitest.expect)((0,_layout.parseLayout)("bottom-sm",customSpacing)).toEqual({bottom:8});(0,_vitest.expect)((0,_layout.parseLayout)("left-md",customSpacing)).toEqual({left:16});});(0,_vitest.it)("should override default spacing values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-4")).toEqual({top:16});(0,_vitest.expect)((0,_layout.parseLayout)("top-4",customSpacing)).toEqual({top:20});});(0,_vitest.it)("should merge custom spacing with defaults",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-0",customSpacing)).toEqual({top:0});(0,_vitest.expect)((0,_layout.parseLayout)("top-8",customSpacing)).toEqual({top:32});(0,_vitest.expect)((0,_layout.parseLayout)("top-xs",customSpacing)).toEqual({top:4});});(0,_vitest.it)("should support custom spacing for start/end (RTL-aware)",function(){(0,_vitest.expect)((0,_layout.parseLayout)("start-xs",customSpacing)).toEqual({start:4});(0,_vitest.expect)((0,_layout.parseLayout)("end-lg",customSpacing)).toEqual({end:32});});(0,_vitest.it)("should support custom spacing for inset utilities",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-xs",customSpacing)).toEqual({top:4,right:4,bottom:4,left:4});(0,_vitest.expect)((0,_layout.parseLayout)("inset-x-sm",customSpacing)).toEqual({left:8,right:8});(0,_vitest.expect)((0,_layout.parseLayout)("inset-y-md",customSpacing)).toEqual({top:16,bottom:16});});(0,_vitest.it)("should support custom spacing for inset-s/inset-e",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-s-lg",customSpacing)).toEqual({start:32});(0,_vitest.expect)((0,_layout.parseLayout)("inset-e-xl",customSpacing)).toEqual({end:64});});(0,_vitest.it)("should support negative values with custom spacing for positioning",function(){(0,_vitest.expect)((0,_layout.parseLayout)("-top-sm",customSpacing)).toEqual({top:-8});(0,_vitest.expect)((0,_layout.parseLayout)("-right-md",customSpacing)).toEqual({right:-16});(0,_vitest.expect)((0,_layout.parseLayout)("-bottom-lg",customSpacing)).toEqual({bottom:-32});(0,_vitest.expect)((0,_layout.parseLayout)("-left-xl",customSpacing)).toEqual({left:-64});(0,_vitest.expect)((0,_layout.parseLayout)("-start-sm",customSpacing)).toEqual({start:-8});(0,_vitest.expect)((0,_layout.parseLayout)("-end-md",customSpacing)).toEqual({end:-16});});(0,_vitest.it)("should still support arbitrary values with custom spacing",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-[100px]",customSpacing)).toEqual({top:100});(0,_vitest.expect)((0,_layout.parseLayout)("inset-[50%]",customSpacing)).toEqual({top:"50%",right:"50%",bottom:"50%",left:"50%"});});(0,_vitest.it)("should handle non-layout classes as null",function(){(0,_vitest.expect)((0,_layout.parseLayout)("text-xl",customSpacing)).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("bg-blue-500",customSpacing)).toBeNull();});});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var _vitest=require("vitest");var _transforms=require("./transforms");(0,_vitest.describe)("SCALE_MAP",function(){(0,_vitest.it)("should export complete scale map",function(){(0,_vitest.expect)(_transforms.SCALE_MAP).toMatchSnapshot();});});(0,_vitest.describe)("ROTATE_MAP",function(){(0,_vitest.it)("should export complete rotate map",function(){(0,_vitest.expect)(_transforms.ROTATE_MAP).toMatchSnapshot();});});(0,_vitest.describe)("SKEW_MAP",function(){(0,_vitest.it)("should export complete skew map",function(){(0,_vitest.expect)(_transforms.SKEW_MAP).toMatchSnapshot();});});(0,_vitest.describe)("PERSPECTIVE_SCALE",function(){(0,_vitest.it)("should export complete perspective scale",function(){(0,_vitest.expect)(_transforms.PERSPECTIVE_SCALE).toMatchSnapshot();});});(0,_vitest.describe)("parseTransform - scale utilities",function(){(0,_vitest.it)("should parse scale values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("scale-0")).toEqual({transform:[{scale:0}]});(0,_vitest.expect)((0,_transforms.parseTransform)("scale-50")).toEqual({transform:[{scale:0.5}]});(0,_vitest.expect)((0,_transforms.parseTransform)("scale-75")).toEqual({transform:[{scale:0.75}]});(0,_vitest.expect)((0,_transforms.parseTransform)("scale-90")).toEqual({transform:[{scale:0.9}]});(0,_vitest.expect)((0,_transforms.parseTransform)("scale-95")).toEqual({transform:[{scale:0.95}]});(0,_vitest.expect)((0,_transforms.parseTransform)("scale-100")).toEqual({transform:[{scale:1}]});(0,_vitest.expect)((0,_transforms.parseTransform)("scale-105")).toEqual({transform:[{scale:1.05}]});(0,_vitest.expect)((0,_transforms.parseTransform)("scale-110")).toEqual({transform:[{scale:1.1}]});(0,_vitest.expect)((0,_transforms.parseTransform)("scale-125")).toEqual({transform:[{scale:1.25}]});(0,_vitest.expect)((0,_transforms.parseTransform)("scale-150")).toEqual({transform:[{scale:1.5}]});(0,_vitest.expect)((0,_transforms.parseTransform)("scale-200")).toEqual({transform:[{scale:2}]});});(0,_vitest.it)("should parse scaleX values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("scale-x-0")).toEqual({transform:[{scaleX:0}]});(0,_vitest.expect)((0,_transforms.parseTransform)("scale-x-50")).toEqual({transform:[{scaleX:0.5}]});(0,_vitest.expect)((0,_transforms.parseTransform)("scale-x-100")).toEqual({transform:[{scaleX:1}]});(0,_vitest.expect)((0,_transforms.parseTransform)("scale-x-150")).toEqual({transform:[{scaleX:1.5}]});});(0,_vitest.it)("should parse scaleY values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("scale-y-0")).toEqual({transform:[{scaleY:0}]});(0,_vitest.expect)((0,_transforms.parseTransform)("scale-y-75")).toEqual({transform:[{scaleY:0.75}]});(0,_vitest.expect)((0,_transforms.parseTransform)("scale-y-100")).toEqual({transform:[{scaleY:1}]});(0,_vitest.expect)((0,_transforms.parseTransform)("scale-y-125")).toEqual({transform:[{scaleY:1.25}]});});(0,_vitest.it)("should parse arbitrary scale values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("scale-[1.23]")).toEqual({transform:[{scale:1.23}]});(0,_vitest.expect)((0,_transforms.parseTransform)("scale-[0.5]")).toEqual({transform:[{scale:0.5}]});(0,_vitest.expect)((0,_transforms.parseTransform)("scale-[2.5]")).toEqual({transform:[{scale:2.5}]});(0,_vitest.expect)((0,_transforms.parseTransform)("scale-x-[1.5]")).toEqual({transform:[{scaleX:1.5}]});(0,_vitest.expect)((0,_transforms.parseTransform)("scale-y-[0.8]")).toEqual({transform:[{scaleY:0.8}]});});(0,_vitest.it)("should parse negative arbitrary scale values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("scale-[-1]")).toEqual({transform:[{scale:-1}]});(0,_vitest.expect)((0,_transforms.parseTransform)("scale-x-[-0.5]")).toEqual({transform:[{scaleX:-0.5}]});});(0,_vitest.it)("should return null for invalid scale values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("scale-999")).toBeNull();(0,_vitest.expect)((0,_transforms.parseTransform)("scale-invalid")).toBeNull();});});(0,_vitest.describe)("parseTransform - rotate utilities",function(){(0,_vitest.it)("should parse rotate values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("rotate-0")).toEqual({transform:[{rotate:"0deg"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("rotate-1")).toEqual({transform:[{rotate:"1deg"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("rotate-45")).toEqual({transform:[{rotate:"45deg"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("rotate-90")).toEqual({transform:[{rotate:"90deg"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("rotate-180")).toEqual({transform:[{rotate:"180deg"}]});});(0,_vitest.it)("should parse negative rotate values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("-rotate-45")).toEqual({transform:[{rotate:"-45deg"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("-rotate-90")).toEqual({transform:[{rotate:"-90deg"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("-rotate-180")).toEqual({transform:[{rotate:"-180deg"}]});});(0,_vitest.it)("should parse arbitrary rotate values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("rotate-[37deg]")).toEqual({transform:[{rotate:"37deg"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("rotate-[15.5deg]")).toEqual({transform:[{rotate:"15.5deg"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("-rotate-[15deg]")).toEqual({transform:[{rotate:"-15deg"}]});});(0,_vitest.it)("should parse rotateX values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("rotate-x-45")).toEqual({transform:[{rotateX:"45deg"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("rotate-x-90")).toEqual({transform:[{rotateX:"90deg"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("-rotate-x-45")).toEqual({transform:[{rotateX:"-45deg"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("rotate-x-[30deg]")).toEqual({transform:[{rotateX:"30deg"}]});});(0,_vitest.it)("should parse rotateY values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("rotate-y-45")).toEqual({transform:[{rotateY:"45deg"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("rotate-y-180")).toEqual({transform:[{rotateY:"180deg"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("-rotate-y-90")).toEqual({transform:[{rotateY:"-90deg"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("rotate-y-[60deg]")).toEqual({transform:[{rotateY:"60deg"}]});});(0,_vitest.it)("should parse rotateZ values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("rotate-z-45")).toEqual({transform:[{rotateZ:"45deg"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("rotate-z-90")).toEqual({transform:[{rotateZ:"90deg"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("-rotate-z-12")).toEqual({transform:[{rotateZ:"-12deg"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("rotate-z-[75deg]")).toEqual({transform:[{rotateZ:"75deg"}]});});(0,_vitest.it)("should return null for invalid rotate values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("rotate-999")).toBeNull();(0,_vitest.expect)((0,_transforms.parseTransform)("rotate-invalid")).toBeNull();});});(0,_vitest.describe)("parseTransform - translate utilities",function(){(0,_vitest.it)("should parse translateX values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("translate-x-0")).toEqual({transform:[{translateX:0}]});(0,_vitest.expect)((0,_transforms.parseTransform)("translate-x-4")).toEqual({transform:[{translateX:16}]});(0,_vitest.expect)((0,_transforms.parseTransform)("translate-x-8")).toEqual({transform:[{translateX:32}]});(0,_vitest.expect)((0,_transforms.parseTransform)("translate-x-16")).toEqual({transform:[{translateX:64}]});});(0,_vitest.it)("should parse negative translateX values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("-translate-x-4")).toEqual({transform:[{translateX:-16}]});(0,_vitest.expect)((0,_transforms.parseTransform)("-translate-x-8")).toEqual({transform:[{translateX:-32}]});});(0,_vitest.it)("should parse translateY values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("translate-y-0")).toEqual({transform:[{translateY:0}]});(0,_vitest.expect)((0,_transforms.parseTransform)("translate-y-4")).toEqual({transform:[{translateY:16}]});(0,_vitest.expect)((0,_transforms.parseTransform)("translate-y-12")).toEqual({transform:[{translateY:48}]});});(0,_vitest.it)("should parse negative translateY values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("-translate-y-4")).toEqual({transform:[{translateY:-16}]});(0,_vitest.expect)((0,_transforms.parseTransform)("-translate-y-10")).toEqual({transform:[{translateY:-40}]});});(0,_vitest.it)("should parse arbitrary translateX pixel values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("translate-x-[123px]")).toEqual({transform:[{translateX:123}]});(0,_vitest.expect)((0,_transforms.parseTransform)("translate-x-[50]")).toEqual({transform:[{translateX:50}]});(0,_vitest.expect)((0,_transforms.parseTransform)("-translate-x-[100px]")).toEqual({transform:[{translateX:-100}]});});(0,_vitest.it)("should parse arbitrary translateX percentage values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("translate-x-[50%]")).toEqual({transform:[{translateX:"50%"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("translate-x-[33.333%]")).toEqual({transform:[{translateX:"33.333%"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("-translate-x-[25%]")).toEqual({transform:[{translateX:"-25%"}]});});(0,_vitest.it)("should parse arbitrary translateY pixel values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("translate-y-[200px]")).toEqual({transform:[{translateY:200}]});(0,_vitest.expect)((0,_transforms.parseTransform)("-translate-y-[75px]")).toEqual({transform:[{translateY:-75}]});});(0,_vitest.it)("should parse arbitrary translateY percentage values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("translate-y-[100%]")).toEqual({transform:[{translateY:"100%"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("-translate-y-[50%]")).toEqual({transform:[{translateY:"-50%"}]});});(0,_vitest.it)("should return null for invalid translate values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("translate-x-999")).toBeNull();(0,_vitest.expect)((0,_transforms.parseTransform)("translate-y-invalid")).toBeNull();});});(0,_vitest.describe)("parseTransform - skew utilities",function(){(0,_vitest.it)("should parse skewX values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("skew-x-0")).toEqual({transform:[{skewX:"0deg"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("skew-x-1")).toEqual({transform:[{skewX:"1deg"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("skew-x-3")).toEqual({transform:[{skewX:"3deg"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("skew-x-6")).toEqual({transform:[{skewX:"6deg"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("skew-x-12")).toEqual({transform:[{skewX:"12deg"}]});});(0,_vitest.it)("should parse negative skewX values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("-skew-x-3")).toEqual({transform:[{skewX:"-3deg"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("-skew-x-12")).toEqual({transform:[{skewX:"-12deg"}]});});(0,_vitest.it)("should parse skewY values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("skew-y-0")).toEqual({transform:[{skewY:"0deg"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("skew-y-2")).toEqual({transform:[{skewY:"2deg"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("skew-y-6")).toEqual({transform:[{skewY:"6deg"}]});});(0,_vitest.it)("should parse negative skewY values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("-skew-y-2")).toEqual({transform:[{skewY:"-2deg"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("-skew-y-6")).toEqual({transform:[{skewY:"-6deg"}]});});(0,_vitest.it)("should parse arbitrary skew values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("skew-x-[15deg]")).toEqual({transform:[{skewX:"15deg"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("skew-y-[20deg]")).toEqual({transform:[{skewY:"20deg"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("-skew-x-[8deg]")).toEqual({transform:[{skewX:"-8deg"}]});});(0,_vitest.it)("should return null for invalid skew values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("skew-x-999")).toBeNull();(0,_vitest.expect)((0,_transforms.parseTransform)("skew-y-invalid")).toBeNull();});});(0,_vitest.describe)("parseTransform - perspective utility",function(){(0,_vitest.it)("should parse perspective values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("perspective-0")).toEqual({transform:[{perspective:0}]});(0,_vitest.expect)((0,_transforms.parseTransform)("perspective-100")).toEqual({transform:[{perspective:100}]});(0,_vitest.expect)((0,_transforms.parseTransform)("perspective-500")).toEqual({transform:[{perspective:500}]});(0,_vitest.expect)((0,_transforms.parseTransform)("perspective-1000")).toEqual({transform:[{perspective:1000}]});});(0,_vitest.it)("should parse arbitrary perspective values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("perspective-[1500]")).toEqual({transform:[{perspective:1500}]});(0,_vitest.expect)((0,_transforms.parseTransform)("perspective-[2000]")).toEqual({transform:[{perspective:2000}]});(0,_vitest.expect)((0,_transforms.parseTransform)("perspective-[250]")).toEqual({transform:[{perspective:250}]});});(0,_vitest.it)("should return null for invalid perspective values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("perspective-99")).toBeNull();(0,_vitest.expect)((0,_transforms.parseTransform)("perspective-invalid")).toBeNull();});});(0,_vitest.describe)("parseTransform - transform origin warning",function(){(0,_vitest.it)("should return null and warn for origin classes",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("origin-center")).toBeNull();(0,_vitest.expect)((0,_transforms.parseTransform)("origin-top")).toBeNull();(0,_vitest.expect)((0,_transforms.parseTransform)("origin-left")).toBeNull();});});(0,_vitest.describe)("parseTransform - edge cases",function(){(0,_vitest.it)("should return null for invalid classes",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("invalid")).toBeNull();(0,_vitest.expect)((0,_transforms.parseTransform)("transform")).toBeNull();(0,_vitest.expect)((0,_transforms.parseTransform)("transforms")).toBeNull();});(0,_vitest.it)("should return null for empty string",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("")).toBeNull();});(0,_vitest.it)("should return null for partial class names",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("scal")).toBeNull();(0,_vitest.expect)((0,_transforms.parseTransform)("rotat")).toBeNull();(0,_vitest.expect)((0,_transforms.parseTransform)("translat")).toBeNull();});(0,_vitest.it)("should handle all transform types returning arrays",function(){var scaleResult=(0,_transforms.parseTransform)("scale-110");(0,_vitest.expect)(scaleResult).toHaveProperty("transform");(0,_vitest.expect)(Array.isArray(scaleResult==null?void 0:scaleResult.transform)).toBe(true);var rotateResult=(0,_transforms.parseTransform)("rotate-45");(0,_vitest.expect)(rotateResult).toHaveProperty("transform");(0,_vitest.expect)(Array.isArray(rotateResult==null?void 0:rotateResult.transform)).toBe(true);var translateResult=(0,_transforms.parseTransform)("translate-x-4");(0,_vitest.expect)(translateResult).toHaveProperty("transform");(0,_vitest.expect)(Array.isArray(translateResult==null?void 0:translateResult.transform)).toBe(true);});});(0,_vitest.describe)("parseTransform - comprehensive coverage",function(){(0,_vitest.it)("should handle all scale variants",function(){var scaleClasses=["scale-0","scale-50","scale-100","scale-150"];scaleClasses.forEach(function(cls){(0,_vitest.expect)((0,_transforms.parseTransform)(cls)).toBeTruthy();});});(0,_vitest.it)("should handle all rotate variants",function(){var rotateClasses=["rotate-0","rotate-45","rotate-90","rotate-180"];rotateClasses.forEach(function(cls){(0,_vitest.expect)((0,_transforms.parseTransform)(cls)).toBeTruthy();});});(0,_vitest.it)("should handle all translate variants",function(){var translateClasses=["translate-x-0","translate-x-4","translate-y-8","-translate-x-2"];translateClasses.forEach(function(cls){(0,_vitest.expect)((0,_transforms.parseTransform)(cls)).toBeTruthy();});});(0,_vitest.it)("should handle all skew variants",function(){var skewClasses=["skew-x-3","skew-y-6","-skew-x-12"];skewClasses.forEach(function(cls){(0,_vitest.expect)((0,_transforms.parseTransform)(cls)).toBeTruthy();});});(0,_vitest.it)("should handle all perspective variants",function(){var perspectiveClasses=["perspective-100","perspective-500","perspective-1000"];perspectiveClasses.forEach(function(cls){(0,_vitest.expect)((0,_transforms.parseTransform)(cls)).toBeTruthy();});});});(0,_vitest.describe)("parseTransform - case sensitivity",function(){(0,_vitest.it)("should be case-sensitive",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("SCALE-110")).toBeNull();(0,_vitest.expect)((0,_transforms.parseTransform)("Scale-110")).toBeNull();(0,_vitest.expect)((0,_transforms.parseTransform)("ROTATE-45")).toBeNull();});});(0,_vitest.describe)("parseTransform - custom spacing",function(){var customSpacing={xs:4,sm:8,md:16,lg:32,xl:64,"4":20};(0,_vitest.it)("should support custom spacing values for translateX",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("translate-x-xs",customSpacing)).toEqual({transform:[{translateX:4}]});(0,_vitest.expect)((0,_transforms.parseTransform)("translate-x-sm",customSpacing)).toEqual({transform:[{translateX:8}]});(0,_vitest.expect)((0,_transforms.parseTransform)("translate-x-lg",customSpacing)).toEqual({transform:[{translateX:32}]});(0,_vitest.expect)((0,_transforms.parseTransform)("translate-x-xl",customSpacing)).toEqual({transform:[{translateX:64}]});});(0,_vitest.it)("should support custom spacing values for translateY",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("translate-y-xs",customSpacing)).toEqual({transform:[{translateY:4}]});(0,_vitest.expect)((0,_transforms.parseTransform)("translate-y-md",customSpacing)).toEqual({transform:[{translateY:16}]});(0,_vitest.expect)((0,_transforms.parseTransform)("translate-y-xl",customSpacing)).toEqual({transform:[{translateY:64}]});});(0,_vitest.it)("should support negative custom spacing for translate",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("-translate-x-sm",customSpacing)).toEqual({transform:[{translateX:-8}]});(0,_vitest.expect)((0,_transforms.parseTransform)("-translate-y-lg",customSpacing)).toEqual({transform:[{translateY:-32}]});});(0,_vitest.it)("should allow custom spacing to override preset values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("translate-x-4",customSpacing)).toEqual({transform:[{translateX:20}]});(0,_vitest.expect)((0,_transforms.parseTransform)("translate-y-4",customSpacing)).toEqual({transform:[{translateY:20}]});});(0,_vitest.it)("should prefer arbitrary values over custom spacing",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("translate-x-[24px]",customSpacing)).toEqual({transform:[{translateX:24}]});(0,_vitest.expect)((0,_transforms.parseTransform)("translate-y-[50]",customSpacing)).toEqual({transform:[{translateY:50}]});});(0,_vitest.it)("should fall back to preset scale for unknown custom keys",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("translate-x-8",customSpacing)).toEqual({transform:[{translateX:32}]});(0,_vitest.expect)((0,_transforms.parseTransform)("translate-y-12",customSpacing)).toEqual({transform:[{translateY:48}]});});(0,_vitest.it)("should work without custom spacing (backward compatible)",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("translate-x-4")).toEqual({transform:[{translateX:16}]});(0,_vitest.expect)((0,_transforms.parseTransform)("translate-y-8")).toEqual({transform:[{translateY:32}]});});(0,_vitest.it)("should not affect non-translate transforms",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("scale-110",customSpacing)).toEqual({transform:[{scale:1.1}]});(0,_vitest.expect)((0,_transforms.parseTransform)("rotate-45",customSpacing)).toEqual({transform:[{rotate:"45deg"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("skew-x-6",customSpacing)).toEqual({transform:[{skewX:"6deg"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("perspective-500",customSpacing)).toEqual({transform:[{perspective:500}]});});});
|
|
1
|
+
var _vitest=require("vitest");var _index=require("./index");var _transforms=require("./transforms");(0,_vitest.describe)("SCALE_MAP",function(){(0,_vitest.it)("should export complete scale map",function(){(0,_vitest.expect)(_transforms.SCALE_MAP).toMatchSnapshot();});});(0,_vitest.describe)("ROTATE_MAP",function(){(0,_vitest.it)("should export complete rotate map",function(){(0,_vitest.expect)(_transforms.ROTATE_MAP).toMatchSnapshot();});});(0,_vitest.describe)("SKEW_MAP",function(){(0,_vitest.it)("should export complete skew map",function(){(0,_vitest.expect)(_transforms.SKEW_MAP).toMatchSnapshot();});});(0,_vitest.describe)("PERSPECTIVE_SCALE",function(){(0,_vitest.it)("should export complete perspective scale",function(){(0,_vitest.expect)(_transforms.PERSPECTIVE_SCALE).toMatchSnapshot();});});(0,_vitest.describe)("parseTransform - scale utilities",function(){(0,_vitest.it)("should parse scale values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("scale-0")).toEqual({transform:[{scale:0}]});(0,_vitest.expect)((0,_transforms.parseTransform)("scale-50")).toEqual({transform:[{scale:0.5}]});(0,_vitest.expect)((0,_transforms.parseTransform)("scale-75")).toEqual({transform:[{scale:0.75}]});(0,_vitest.expect)((0,_transforms.parseTransform)("scale-90")).toEqual({transform:[{scale:0.9}]});(0,_vitest.expect)((0,_transforms.parseTransform)("scale-95")).toEqual({transform:[{scale:0.95}]});(0,_vitest.expect)((0,_transforms.parseTransform)("scale-100")).toEqual({transform:[{scale:1}]});(0,_vitest.expect)((0,_transforms.parseTransform)("scale-105")).toEqual({transform:[{scale:1.05}]});(0,_vitest.expect)((0,_transforms.parseTransform)("scale-110")).toEqual({transform:[{scale:1.1}]});(0,_vitest.expect)((0,_transforms.parseTransform)("scale-125")).toEqual({transform:[{scale:1.25}]});(0,_vitest.expect)((0,_transforms.parseTransform)("scale-150")).toEqual({transform:[{scale:1.5}]});(0,_vitest.expect)((0,_transforms.parseTransform)("scale-200")).toEqual({transform:[{scale:2}]});});(0,_vitest.it)("should parse scaleX values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("scale-x-0")).toEqual({transform:[{scaleX:0}]});(0,_vitest.expect)((0,_transforms.parseTransform)("scale-x-50")).toEqual({transform:[{scaleX:0.5}]});(0,_vitest.expect)((0,_transforms.parseTransform)("scale-x-100")).toEqual({transform:[{scaleX:1}]});(0,_vitest.expect)((0,_transforms.parseTransform)("scale-x-150")).toEqual({transform:[{scaleX:1.5}]});});(0,_vitest.it)("should parse scaleY values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("scale-y-0")).toEqual({transform:[{scaleY:0}]});(0,_vitest.expect)((0,_transforms.parseTransform)("scale-y-75")).toEqual({transform:[{scaleY:0.75}]});(0,_vitest.expect)((0,_transforms.parseTransform)("scale-y-100")).toEqual({transform:[{scaleY:1}]});(0,_vitest.expect)((0,_transforms.parseTransform)("scale-y-125")).toEqual({transform:[{scaleY:1.25}]});});(0,_vitest.it)("should parse arbitrary scale values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("scale-[1.23]")).toEqual({transform:[{scale:1.23}]});(0,_vitest.expect)((0,_transforms.parseTransform)("scale-[0.5]")).toEqual({transform:[{scale:0.5}]});(0,_vitest.expect)((0,_transforms.parseTransform)("scale-[2.5]")).toEqual({transform:[{scale:2.5}]});(0,_vitest.expect)((0,_transforms.parseTransform)("scale-x-[1.5]")).toEqual({transform:[{scaleX:1.5}]});(0,_vitest.expect)((0,_transforms.parseTransform)("scale-y-[0.8]")).toEqual({transform:[{scaleY:0.8}]});});(0,_vitest.it)("should parse negative arbitrary scale values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("scale-[-1]")).toEqual({transform:[{scale:-1}]});(0,_vitest.expect)((0,_transforms.parseTransform)("scale-x-[-0.5]")).toEqual({transform:[{scaleX:-0.5}]});});(0,_vitest.it)("should return null for invalid scale values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("scale-999")).toBeNull();(0,_vitest.expect)((0,_transforms.parseTransform)("scale-invalid")).toBeNull();});});(0,_vitest.describe)("parseTransform - rotate utilities",function(){(0,_vitest.it)("should parse rotate values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("rotate-0")).toEqual({transform:[{rotate:"0deg"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("rotate-1")).toEqual({transform:[{rotate:"1deg"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("rotate-45")).toEqual({transform:[{rotate:"45deg"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("rotate-90")).toEqual({transform:[{rotate:"90deg"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("rotate-180")).toEqual({transform:[{rotate:"180deg"}]});});(0,_vitest.it)("should parse negative rotate values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("-rotate-45")).toEqual({transform:[{rotate:"-45deg"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("-rotate-90")).toEqual({transform:[{rotate:"-90deg"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("-rotate-180")).toEqual({transform:[{rotate:"-180deg"}]});});(0,_vitest.it)("should parse arbitrary rotate values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("rotate-[37deg]")).toEqual({transform:[{rotate:"37deg"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("rotate-[15.5deg]")).toEqual({transform:[{rotate:"15.5deg"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("-rotate-[15deg]")).toEqual({transform:[{rotate:"-15deg"}]});});(0,_vitest.it)("should parse rotateX values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("rotate-x-45")).toEqual({transform:[{rotateX:"45deg"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("rotate-x-90")).toEqual({transform:[{rotateX:"90deg"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("-rotate-x-45")).toEqual({transform:[{rotateX:"-45deg"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("rotate-x-[30deg]")).toEqual({transform:[{rotateX:"30deg"}]});});(0,_vitest.it)("should parse rotateY values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("rotate-y-45")).toEqual({transform:[{rotateY:"45deg"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("rotate-y-180")).toEqual({transform:[{rotateY:"180deg"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("-rotate-y-90")).toEqual({transform:[{rotateY:"-90deg"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("rotate-y-[60deg]")).toEqual({transform:[{rotateY:"60deg"}]});});(0,_vitest.it)("should parse rotateZ values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("rotate-z-45")).toEqual({transform:[{rotateZ:"45deg"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("rotate-z-90")).toEqual({transform:[{rotateZ:"90deg"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("-rotate-z-12")).toEqual({transform:[{rotateZ:"-12deg"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("rotate-z-[75deg]")).toEqual({transform:[{rotateZ:"75deg"}]});});(0,_vitest.it)("should return null for invalid rotate values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("rotate-999")).toBeNull();(0,_vitest.expect)((0,_transforms.parseTransform)("rotate-invalid")).toBeNull();});});(0,_vitest.describe)("parseTransform - translate utilities",function(){(0,_vitest.it)("should parse translateX values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("translate-x-0")).toEqual({transform:[{translateX:0}]});(0,_vitest.expect)((0,_transforms.parseTransform)("translate-x-4")).toEqual({transform:[{translateX:16}]});(0,_vitest.expect)((0,_transforms.parseTransform)("translate-x-8")).toEqual({transform:[{translateX:32}]});(0,_vitest.expect)((0,_transforms.parseTransform)("translate-x-16")).toEqual({transform:[{translateX:64}]});});(0,_vitest.it)("should parse negative translateX values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("-translate-x-4")).toEqual({transform:[{translateX:-16}]});(0,_vitest.expect)((0,_transforms.parseTransform)("-translate-x-8")).toEqual({transform:[{translateX:-32}]});});(0,_vitest.it)("should parse translateY values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("translate-y-0")).toEqual({transform:[{translateY:0}]});(0,_vitest.expect)((0,_transforms.parseTransform)("translate-y-4")).toEqual({transform:[{translateY:16}]});(0,_vitest.expect)((0,_transforms.parseTransform)("translate-y-12")).toEqual({transform:[{translateY:48}]});});(0,_vitest.it)("should parse negative translateY values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("-translate-y-4")).toEqual({transform:[{translateY:-16}]});(0,_vitest.expect)((0,_transforms.parseTransform)("-translate-y-10")).toEqual({transform:[{translateY:-40}]});});(0,_vitest.it)("should parse arbitrary translateX pixel values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("translate-x-[123px]")).toEqual({transform:[{translateX:123}]});(0,_vitest.expect)((0,_transforms.parseTransform)("translate-x-[50]")).toEqual({transform:[{translateX:50}]});(0,_vitest.expect)((0,_transforms.parseTransform)("-translate-x-[100px]")).toEqual({transform:[{translateX:-100}]});});(0,_vitest.it)("should parse arbitrary translateX percentage values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("translate-x-[50%]")).toEqual({transform:[{translateX:"50%"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("translate-x-[33.333%]")).toEqual({transform:[{translateX:"33.333%"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("-translate-x-[25%]")).toEqual({transform:[{translateX:"-25%"}]});});(0,_vitest.it)("should parse arbitrary translateY pixel values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("translate-y-[200px]")).toEqual({transform:[{translateY:200}]});(0,_vitest.expect)((0,_transforms.parseTransform)("-translate-y-[75px]")).toEqual({transform:[{translateY:-75}]});});(0,_vitest.it)("should parse arbitrary translateY percentage values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("translate-y-[100%]")).toEqual({transform:[{translateY:"100%"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("-translate-y-[50%]")).toEqual({transform:[{translateY:"-50%"}]});});(0,_vitest.it)("should return null for invalid translate values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("translate-x-999")).toBeNull();(0,_vitest.expect)((0,_transforms.parseTransform)("translate-y-invalid")).toBeNull();});});(0,_vitest.describe)("parseTransform - skew utilities",function(){(0,_vitest.it)("should parse skewX values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("skew-x-0")).toEqual({transform:[{skewX:"0deg"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("skew-x-1")).toEqual({transform:[{skewX:"1deg"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("skew-x-3")).toEqual({transform:[{skewX:"3deg"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("skew-x-6")).toEqual({transform:[{skewX:"6deg"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("skew-x-12")).toEqual({transform:[{skewX:"12deg"}]});});(0,_vitest.it)("should parse negative skewX values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("-skew-x-3")).toEqual({transform:[{skewX:"-3deg"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("-skew-x-12")).toEqual({transform:[{skewX:"-12deg"}]});});(0,_vitest.it)("should parse skewY values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("skew-y-0")).toEqual({transform:[{skewY:"0deg"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("skew-y-2")).toEqual({transform:[{skewY:"2deg"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("skew-y-6")).toEqual({transform:[{skewY:"6deg"}]});});(0,_vitest.it)("should parse negative skewY values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("-skew-y-2")).toEqual({transform:[{skewY:"-2deg"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("-skew-y-6")).toEqual({transform:[{skewY:"-6deg"}]});});(0,_vitest.it)("should parse arbitrary skew values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("skew-x-[15deg]")).toEqual({transform:[{skewX:"15deg"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("skew-y-[20deg]")).toEqual({transform:[{skewY:"20deg"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("-skew-x-[8deg]")).toEqual({transform:[{skewX:"-8deg"}]});});(0,_vitest.it)("should return null for invalid skew values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("skew-x-999")).toBeNull();(0,_vitest.expect)((0,_transforms.parseTransform)("skew-y-invalid")).toBeNull();});});(0,_vitest.describe)("parseTransform - perspective utility",function(){(0,_vitest.it)("should parse perspective values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("perspective-0")).toEqual({transform:[{perspective:0}]});(0,_vitest.expect)((0,_transforms.parseTransform)("perspective-100")).toEqual({transform:[{perspective:100}]});(0,_vitest.expect)((0,_transforms.parseTransform)("perspective-500")).toEqual({transform:[{perspective:500}]});(0,_vitest.expect)((0,_transforms.parseTransform)("perspective-1000")).toEqual({transform:[{perspective:1000}]});});(0,_vitest.it)("should parse arbitrary perspective values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("perspective-[1500]")).toEqual({transform:[{perspective:1500}]});(0,_vitest.expect)((0,_transforms.parseTransform)("perspective-[2000]")).toEqual({transform:[{perspective:2000}]});(0,_vitest.expect)((0,_transforms.parseTransform)("perspective-[250]")).toEqual({transform:[{perspective:250}]});});(0,_vitest.it)("should return null for invalid perspective values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("perspective-99")).toBeNull();(0,_vitest.expect)((0,_transforms.parseTransform)("perspective-invalid")).toBeNull();});});(0,_vitest.describe)("parseTransform - transform origin warning",function(){(0,_vitest.it)("should return null and warn for origin classes",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("origin-center")).toBeNull();(0,_vitest.expect)((0,_transforms.parseTransform)("origin-top")).toBeNull();(0,_vitest.expect)((0,_transforms.parseTransform)("origin-left")).toBeNull();});});(0,_vitest.describe)("parseTransform - edge cases",function(){(0,_vitest.it)("should return null for invalid classes",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("invalid")).toBeNull();(0,_vitest.expect)((0,_transforms.parseTransform)("transform")).toBeNull();(0,_vitest.expect)((0,_transforms.parseTransform)("transforms")).toBeNull();});(0,_vitest.it)("should return null for empty string",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("")).toBeNull();});(0,_vitest.it)("should return null for partial class names",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("scal")).toBeNull();(0,_vitest.expect)((0,_transforms.parseTransform)("rotat")).toBeNull();(0,_vitest.expect)((0,_transforms.parseTransform)("translat")).toBeNull();});(0,_vitest.it)("should handle all transform types returning arrays",function(){var scaleResult=(0,_transforms.parseTransform)("scale-110");(0,_vitest.expect)(scaleResult).toHaveProperty("transform");(0,_vitest.expect)(Array.isArray(scaleResult==null?void 0:scaleResult.transform)).toBe(true);var rotateResult=(0,_transforms.parseTransform)("rotate-45");(0,_vitest.expect)(rotateResult).toHaveProperty("transform");(0,_vitest.expect)(Array.isArray(rotateResult==null?void 0:rotateResult.transform)).toBe(true);var translateResult=(0,_transforms.parseTransform)("translate-x-4");(0,_vitest.expect)(translateResult).toHaveProperty("transform");(0,_vitest.expect)(Array.isArray(translateResult==null?void 0:translateResult.transform)).toBe(true);});});(0,_vitest.describe)("parseTransform - comprehensive coverage",function(){(0,_vitest.it)("should handle all scale variants",function(){var scaleClasses=["scale-0","scale-50","scale-100","scale-150"];scaleClasses.forEach(function(cls){(0,_vitest.expect)((0,_transforms.parseTransform)(cls)).toBeTruthy();});});(0,_vitest.it)("should handle all rotate variants",function(){var rotateClasses=["rotate-0","rotate-45","rotate-90","rotate-180"];rotateClasses.forEach(function(cls){(0,_vitest.expect)((0,_transforms.parseTransform)(cls)).toBeTruthy();});});(0,_vitest.it)("should handle all translate variants",function(){var translateClasses=["translate-x-0","translate-x-4","translate-y-8","-translate-x-2"];translateClasses.forEach(function(cls){(0,_vitest.expect)((0,_transforms.parseTransform)(cls)).toBeTruthy();});});(0,_vitest.it)("should handle all skew variants",function(){var skewClasses=["skew-x-3","skew-y-6","-skew-x-12"];skewClasses.forEach(function(cls){(0,_vitest.expect)((0,_transforms.parseTransform)(cls)).toBeTruthy();});});(0,_vitest.it)("should handle all perspective variants",function(){var perspectiveClasses=["perspective-100","perspective-500","perspective-1000"];perspectiveClasses.forEach(function(cls){(0,_vitest.expect)((0,_transforms.parseTransform)(cls)).toBeTruthy();});});});(0,_vitest.describe)("parseTransform - case sensitivity",function(){(0,_vitest.it)("should be case-sensitive",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("SCALE-110")).toBeNull();(0,_vitest.expect)((0,_transforms.parseTransform)("Scale-110")).toBeNull();(0,_vitest.expect)((0,_transforms.parseTransform)("ROTATE-45")).toBeNull();});});(0,_vitest.describe)("parseTransform - custom spacing",function(){var customSpacing={xs:4,sm:8,md:16,lg:32,xl:64,"4":20};(0,_vitest.it)("should support custom spacing values for translateX",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("translate-x-xs",customSpacing)).toEqual({transform:[{translateX:4}]});(0,_vitest.expect)((0,_transforms.parseTransform)("translate-x-sm",customSpacing)).toEqual({transform:[{translateX:8}]});(0,_vitest.expect)((0,_transforms.parseTransform)("translate-x-lg",customSpacing)).toEqual({transform:[{translateX:32}]});(0,_vitest.expect)((0,_transforms.parseTransform)("translate-x-xl",customSpacing)).toEqual({transform:[{translateX:64}]});});(0,_vitest.it)("should support custom spacing values for translateY",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("translate-y-xs",customSpacing)).toEqual({transform:[{translateY:4}]});(0,_vitest.expect)((0,_transforms.parseTransform)("translate-y-md",customSpacing)).toEqual({transform:[{translateY:16}]});(0,_vitest.expect)((0,_transforms.parseTransform)("translate-y-xl",customSpacing)).toEqual({transform:[{translateY:64}]});});(0,_vitest.it)("should support negative custom spacing for translate",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("-translate-x-sm",customSpacing)).toEqual({transform:[{translateX:-8}]});(0,_vitest.expect)((0,_transforms.parseTransform)("-translate-y-lg",customSpacing)).toEqual({transform:[{translateY:-32}]});});(0,_vitest.it)("should allow custom spacing to override preset values",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("translate-x-4",customSpacing)).toEqual({transform:[{translateX:20}]});(0,_vitest.expect)((0,_transforms.parseTransform)("translate-y-4",customSpacing)).toEqual({transform:[{translateY:20}]});});(0,_vitest.it)("should prefer arbitrary values over custom spacing",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("translate-x-[24px]",customSpacing)).toEqual({transform:[{translateX:24}]});(0,_vitest.expect)((0,_transforms.parseTransform)("translate-y-[50]",customSpacing)).toEqual({transform:[{translateY:50}]});});(0,_vitest.it)("should fall back to preset scale for unknown custom keys",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("translate-x-8",customSpacing)).toEqual({transform:[{translateX:32}]});(0,_vitest.expect)((0,_transforms.parseTransform)("translate-y-12",customSpacing)).toEqual({transform:[{translateY:48}]});});(0,_vitest.it)("should work without custom spacing (backward compatible)",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("translate-x-4")).toEqual({transform:[{translateX:16}]});(0,_vitest.expect)((0,_transforms.parseTransform)("translate-y-8")).toEqual({transform:[{translateY:32}]});});(0,_vitest.it)("should not affect non-translate transforms",function(){(0,_vitest.expect)((0,_transforms.parseTransform)("scale-110",customSpacing)).toEqual({transform:[{scale:1.1}]});(0,_vitest.expect)((0,_transforms.parseTransform)("rotate-45",customSpacing)).toEqual({transform:[{rotate:"45deg"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("skew-x-6",customSpacing)).toEqual({transform:[{skewX:"6deg"}]});(0,_vitest.expect)((0,_transforms.parseTransform)("perspective-500",customSpacing)).toEqual({transform:[{perspective:500}]});});});(0,_vitest.describe)("parseClassName - multiple transforms",function(){(0,_vitest.it)("should combine rotate and scale transforms",function(){var result=(0,_index.parseClassName)("rotate-45 scale-110");(0,_vitest.expect)(result).toEqual({transform:[{rotate:"45deg"},{scale:1.1}]});});(0,_vitest.it)("should combine scale and rotate with arbitrary values",function(){var result=(0,_index.parseClassName)("rotate-45 scale-[0.2]");(0,_vitest.expect)(result).toEqual({transform:[{rotate:"45deg"},{scale:0.2}]});});(0,_vitest.it)("should combine multiple different transforms",function(){var result=(0,_index.parseClassName)("rotate-45 scale-110 translate-x-4");(0,_vitest.expect)(result).toEqual({transform:[{rotate:"45deg"},{scale:1.1},{translateX:16}]});});(0,_vitest.it)("should preserve order of transforms",function(){var result1=(0,_index.parseClassName)("rotate-45 scale-110");var result2=(0,_index.parseClassName)("scale-110 rotate-45");(0,_vitest.expect)(result1.transform).toEqual([{rotate:"45deg"},{scale:1.1}]);(0,_vitest.expect)(result2.transform).toEqual([{scale:1.1},{rotate:"45deg"}]);});(0,_vitest.it)("should combine transforms with other properties",function(){var result=(0,_index.parseClassName)("m-4 rotate-45 scale-110 p-2");(0,_vitest.expect)(result).toEqual({margin:16,padding:8,transform:[{rotate:"45deg"},{scale:1.1}]});});(0,_vitest.it)("should handle all transform types together",function(){var result=(0,_index.parseClassName)("perspective-500 rotate-45 scale-110 translate-x-4 skew-x-6");(0,_vitest.expect)(result).toEqual({transform:[{perspective:500},{rotate:"45deg"},{scale:1.1},{translateX:16},{skewX:"6deg"}]});});(0,_vitest.it)("should handle negative transforms",function(){var result=(0,_index.parseClassName)("-rotate-45 -translate-x-4");(0,_vitest.expect)(result).toEqual({transform:[{rotate:"-45deg"},{translateX:-16}]});});(0,_vitest.it)("should handle scale-x and scale-y together",function(){var result=(0,_index.parseClassName)("scale-x-50 scale-y-150");(0,_vitest.expect)(result).toEqual({transform:[{scaleX:0.5},{scaleY:1.5}]});});(0,_vitest.it)("should handle single transform (backward compatibility)",function(){var result=(0,_index.parseClassName)("rotate-45");(0,_vitest.expect)(result).toEqual({transform:[{rotate:"45deg"}]});});(0,_vitest.it)("should handle arbitrary values combined",function(){var result=(0,_index.parseClassName)("rotate-[37deg] scale-[0.2] translate-x-[50px]");(0,_vitest.expect)(result).toEqual({transform:[{rotate:"37deg"},{scale:0.2},{translateX:50}]});});(0,_vitest.it)("should use last value for duplicate rotate (Tailwind parity)",function(){var result=(0,_index.parseClassName)("rotate-45 rotate-90");(0,_vitest.expect)(result).toEqual({transform:[{rotate:"90deg"}]});});(0,_vitest.it)("should use last value for duplicate scale (Tailwind parity)",function(){var result=(0,_index.parseClassName)("scale-50 scale-110");(0,_vitest.expect)(result).toEqual({transform:[{scale:1.1}]});});(0,_vitest.it)("should preserve different types while replacing duplicates",function(){var result=(0,_index.parseClassName)("rotate-45 scale-110 rotate-90");(0,_vitest.expect)(result).toEqual({transform:[{rotate:"90deg"},{scale:1.1}]});});});
|