@mgcrea/react-native-tailwind 0.15.2 → 0.15.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/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
  ![demo](./.github/assets/demo.gif)
@@ -294,15 +294,30 @@ function createInitialState(options, filename, colorSchemeImportSource, colorSch
294
294
  }
295
295
 
296
296
  // src/utils/mergeStyles.ts
297
- var ARRAY_MERGE_PROPERTIES = /* @__PURE__ */ new Set(["transform"]);
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
+ }
298
313
  function mergeStyles(target, source) {
299
314
  for (const key in source) {
300
315
  if (Object.prototype.hasOwnProperty.call(source, key)) {
301
316
  const sourceValue = source[key];
302
- if (ARRAY_MERGE_PROPERTIES.has(key) && Array.isArray(sourceValue)) {
317
+ if (key === "transform" && Array.isArray(sourceValue)) {
303
318
  const targetValue = target[key];
304
319
  if (Array.isArray(targetValue)) {
305
- target[key] = [...targetValue, ...sourceValue];
320
+ target.transform = mergeTransforms(targetValue, sourceValue);
306
321
  } else {
307
322
  target[key] = sourceValue;
308
323
  }
@@ -647,10 +662,9 @@ var TAILWIND_COLORS = {
647
662
  }
648
663
  };
649
664
 
650
- // src/parser/colors.ts
665
+ // src/utils/colorUtils.ts
651
666
  var COLORS = {
652
667
  ...flattenColors(TAILWIND_COLORS),
653
- // Add basic colors
654
668
  white: "#FFFFFF",
655
669
  black: "#000000",
656
670
  transparent: "transparent"
@@ -675,16 +689,37 @@ function parseArbitraryColor(value) {
675
689
  }
676
690
  return `#${hex}`;
677
691
  }
678
- if (value.startsWith("[") && value.endsWith("]")) {
679
- if (process.env.NODE_ENV !== "production") {
680
- console.warn(
681
- `[react-native-tailwind] Unsupported arbitrary color value: ${value}. Only hex colors are supported (e.g., [#ff0000], [#f00], or [#ff0000aa]).`
682
- );
692
+ return null;
693
+ }
694
+ function parseColorValue(colorKey, customColors) {
695
+ const getColor = (key) => {
696
+ return customColors?.[key] ?? COLORS[key];
697
+ };
698
+ const opacityMatch = colorKey.match(/^(.+)\/(\d+)$/);
699
+ if (opacityMatch) {
700
+ const baseColorKey = opacityMatch[1];
701
+ const opacity = Number.parseInt(opacityMatch[2], 10);
702
+ if (opacity < 0 || opacity > 100) {
703
+ return null;
704
+ }
705
+ const arbitraryColor2 = parseArbitraryColor(baseColorKey);
706
+ if (arbitraryColor2 !== null) {
707
+ return applyOpacity(arbitraryColor2, opacity);
708
+ }
709
+ const color = getColor(baseColorKey);
710
+ if (color) {
711
+ return applyOpacity(color, opacity);
683
712
  }
684
713
  return null;
685
714
  }
686
- return null;
715
+ const arbitraryColor = parseArbitraryColor(colorKey);
716
+ if (arbitraryColor !== null) {
717
+ return arbitraryColor;
718
+ }
719
+ return getColor(colorKey) ?? null;
687
720
  }
721
+
722
+ // src/parser/colors.ts
688
723
  function parseColor(cls, customColors) {
689
724
  const getColor = (key) => {
690
725
  return customColors?.[key] ?? COLORS[key];
@@ -716,6 +751,14 @@ function parseColor(cls, customColors) {
716
751
  if (arbitraryColor !== null) {
717
752
  return arbitraryColor;
718
753
  }
754
+ if (colorKey.startsWith("[") && colorKey.endsWith("]")) {
755
+ if (process.env.NODE_ENV !== "production") {
756
+ console.warn(
757
+ `[react-native-tailwind] Unsupported arbitrary color value: ${colorKey}. Only hex colors are supported (e.g., [#ff0000], [#f00], or [#ff0000aa]).`
758
+ );
759
+ }
760
+ return null;
761
+ }
719
762
  return getColor(colorKey) ?? null;
720
763
  };
721
764
  if (cls.startsWith("bg-")) {
@@ -1181,60 +1224,96 @@ function parseLayout(cls, customSpacing) {
1181
1224
  return { zIndex: zValue };
1182
1225
  }
1183
1226
  }
1184
- if (cls.startsWith("top-")) {
1185
- const topKey = cls.substring(4);
1227
+ const topMatch = cls.match(/^(-?)top-(.+)$/);
1228
+ if (topMatch) {
1229
+ const [, negPrefix, topKey] = topMatch;
1230
+ const isNegative = negPrefix === "-";
1186
1231
  if (topKey === "auto") {
1187
1232
  return {};
1188
1233
  }
1189
1234
  const arbitraryTop = parseArbitraryInset(topKey);
1190
1235
  if (arbitraryTop !== null) {
1236
+ if (typeof arbitraryTop === "number") {
1237
+ return { top: isNegative ? -arbitraryTop : arbitraryTop };
1238
+ }
1239
+ if (isNegative && arbitraryTop.endsWith("%")) {
1240
+ const numValue = parseFloat(arbitraryTop);
1241
+ return { top: `${-numValue}%` };
1242
+ }
1191
1243
  return { top: arbitraryTop };
1192
1244
  }
1193
1245
  const topValue = insetMap[topKey];
1194
1246
  if (topValue !== void 0) {
1195
- return { top: topValue };
1247
+ return { top: isNegative ? -topValue : topValue };
1196
1248
  }
1197
1249
  }
1198
- if (cls.startsWith("right-")) {
1199
- const rightKey = cls.substring(6);
1250
+ const rightMatch = cls.match(/^(-?)right-(.+)$/);
1251
+ if (rightMatch) {
1252
+ const [, negPrefix, rightKey] = rightMatch;
1253
+ const isNegative = negPrefix === "-";
1200
1254
  if (rightKey === "auto") {
1201
1255
  return {};
1202
1256
  }
1203
1257
  const arbitraryRight = parseArbitraryInset(rightKey);
1204
1258
  if (arbitraryRight !== null) {
1259
+ if (typeof arbitraryRight === "number") {
1260
+ return { right: isNegative ? -arbitraryRight : arbitraryRight };
1261
+ }
1262
+ if (isNegative && arbitraryRight.endsWith("%")) {
1263
+ const numValue = parseFloat(arbitraryRight);
1264
+ return { right: `${-numValue}%` };
1265
+ }
1205
1266
  return { right: arbitraryRight };
1206
1267
  }
1207
1268
  const rightValue = insetMap[rightKey];
1208
1269
  if (rightValue !== void 0) {
1209
- return { right: rightValue };
1270
+ return { right: isNegative ? -rightValue : rightValue };
1210
1271
  }
1211
1272
  }
1212
- if (cls.startsWith("bottom-")) {
1213
- const bottomKey = cls.substring(7);
1273
+ const bottomMatch = cls.match(/^(-?)bottom-(.+)$/);
1274
+ if (bottomMatch) {
1275
+ const [, negPrefix, bottomKey] = bottomMatch;
1276
+ const isNegative = negPrefix === "-";
1214
1277
  if (bottomKey === "auto") {
1215
1278
  return {};
1216
1279
  }
1217
1280
  const arbitraryBottom = parseArbitraryInset(bottomKey);
1218
1281
  if (arbitraryBottom !== null) {
1282
+ if (typeof arbitraryBottom === "number") {
1283
+ return { bottom: isNegative ? -arbitraryBottom : arbitraryBottom };
1284
+ }
1285
+ if (isNegative && arbitraryBottom.endsWith("%")) {
1286
+ const numValue = parseFloat(arbitraryBottom);
1287
+ return { bottom: `${-numValue}%` };
1288
+ }
1219
1289
  return { bottom: arbitraryBottom };
1220
1290
  }
1221
1291
  const bottomValue = insetMap[bottomKey];
1222
1292
  if (bottomValue !== void 0) {
1223
- return { bottom: bottomValue };
1293
+ return { bottom: isNegative ? -bottomValue : bottomValue };
1224
1294
  }
1225
1295
  }
1226
- if (cls.startsWith("left-")) {
1227
- const leftKey = cls.substring(5);
1296
+ const leftMatch = cls.match(/^(-?)left-(.+)$/);
1297
+ if (leftMatch) {
1298
+ const [, negPrefix, leftKey] = leftMatch;
1299
+ const isNegative = negPrefix === "-";
1228
1300
  if (leftKey === "auto") {
1229
1301
  return {};
1230
1302
  }
1231
1303
  const arbitraryLeft = parseArbitraryInset(leftKey);
1232
1304
  if (arbitraryLeft !== null) {
1305
+ if (typeof arbitraryLeft === "number") {
1306
+ return { left: isNegative ? -arbitraryLeft : arbitraryLeft };
1307
+ }
1308
+ if (isNegative && arbitraryLeft.endsWith("%")) {
1309
+ const numValue = parseFloat(arbitraryLeft);
1310
+ return { left: `${-numValue}%` };
1311
+ }
1233
1312
  return { left: arbitraryLeft };
1234
1313
  }
1235
1314
  const leftValue = insetMap[leftKey];
1236
1315
  if (leftValue !== void 0) {
1237
- return { left: leftValue };
1316
+ return { left: isNegative ? -leftValue : leftValue };
1238
1317
  }
1239
1318
  }
1240
1319
  const startMatch = cls.match(/^(-?)start-(.+)$/);
@@ -1409,10 +1488,17 @@ var SHADOW_SCALE = {
1409
1488
  elevation: 0
1410
1489
  }
1411
1490
  };
1412
- function parseShadow(cls) {
1491
+ function parseShadow(cls, customColors) {
1413
1492
  if (cls in SHADOW_SCALE) {
1414
1493
  return SHADOW_SCALE[cls];
1415
1494
  }
1495
+ if (cls.startsWith("shadow-")) {
1496
+ const colorPart = cls.substring(7);
1497
+ const shadowColor = parseColorValue(colorPart, customColors);
1498
+ if (shadowColor) {
1499
+ return { shadowColor };
1500
+ }
1501
+ }
1416
1502
  return null;
1417
1503
  }
1418
1504
 
@@ -2367,7 +2453,7 @@ function parseClass(cls, customTheme) {
2367
2453
  (cls2) => parseLayout(cls2, customTheme?.spacing),
2368
2454
  (cls2) => parseTypography(cls2, customTheme?.fontFamily, customTheme?.fontSize),
2369
2455
  (cls2) => parseSizing(cls2, customTheme?.spacing),
2370
- parseShadow,
2456
+ (cls2) => parseShadow(cls2, customTheme?.colors),
2371
2457
  parseAspectRatio,
2372
2458
  (cls2) => parseTransform(cls2, customTheme?.spacing)
2373
2459
  ];
@@ -2,7 +2,8 @@
2
2
  * Color utilities (background, text, border colors)
3
3
  */
4
4
  import type { StyleObject } from "../types";
5
- export declare const COLORS: Record<string, string>;
5
+ import { COLORS } from "../utils/colorUtils";
6
+ export { COLORS };
6
7
  /**
7
8
  * Parse color classes (background, text, border)
8
9
  * Supports opacity modifier: bg-blue-500/50, text-black/80, border-red-500/30
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.COLORS=void 0;exports.parseColor=parseColor;var _defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));var _tailwind=require("../config/tailwind");var _flattenColors=require("../utils/flattenColors");var COLORS=exports.COLORS=Object.assign({},(0,_flattenColors.flattenColors)(_tailwind.TAILWIND_COLORS),{white:"#FFFFFF",black:"#000000",transparent:"transparent"});function applyOpacity(hex,opacity){if(hex==="transparent"){return"transparent";}var cleanHex=hex.replace(/^#/,"");var fullHex=cleanHex.length===3?cleanHex.split("").map(function(char){return char+char;}).join(""):cleanHex;var alpha=Math.round(opacity/100*255);var alphaHex=alpha.toString(16).padStart(2,"0").toUpperCase();return`#${fullHex.toUpperCase()}${alphaHex}`;}function parseArbitraryColor(value){var hexMatch=value.match(/^\[#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})\]$/);if(hexMatch){var hex=hexMatch[1];if(hex.length===3){var expanded=hex.split("").map(function(char){return char+char;}).join("");return`#${expanded}`;}return`#${hex}`;}if(value.startsWith("[")&&value.endsWith("]")){if(process.env.NODE_ENV!=="production"){console.warn(`[react-native-tailwind] Unsupported arbitrary color value: ${value}. Only hex colors are supported (e.g., [#ff0000], [#f00], or [#ff0000aa]).`);}return null;}return null;}function parseColor(cls,customColors){var getColor=function getColor(key){var _customColors$key;return(_customColors$key=customColors==null?void 0:customColors[key])!=null?_customColors$key:COLORS[key];};var parseColorWithOpacity=function parseColorWithOpacity(colorKey){var _getColor;var opacityMatch=colorKey.match(/^(.+)\/(\d+)$/);if(opacityMatch){var baseColorKey=opacityMatch[1];var opacity=Number.parseInt(opacityMatch[2],10);if(opacity<0||opacity>100){if(process.env.NODE_ENV!=="production"){console.warn(`[react-native-tailwind] Invalid opacity value: ${opacity}. Opacity must be between 0 and 100.`);}return null;}var _arbitraryColor=parseArbitraryColor(baseColorKey);if(_arbitraryColor!==null){return applyOpacity(_arbitraryColor,opacity);}var color=getColor(baseColorKey);if(color){return applyOpacity(color,opacity);}return null;}var arbitraryColor=parseArbitraryColor(colorKey);if(arbitraryColor!==null){return arbitraryColor;}return(_getColor=getColor(colorKey))!=null?_getColor:null;};if(cls.startsWith("bg-")){var colorKey=cls.substring(3);if(colorKey.startsWith("[")&&!colorKey.startsWith("[#")){return null;}var color=parseColorWithOpacity(colorKey);if(color){return{backgroundColor:color};}}if(cls.startsWith("text-")){var _colorKey=cls.substring(5);if(_colorKey.startsWith("[")&&!_colorKey.startsWith("[#")){return null;}var _color=parseColorWithOpacity(_colorKey);if(_color){return{color:_color};}}if(cls.startsWith("border-")&&!cls.match(/^border-[0-9]/)){var _colorKey2=cls.substring(7);if(_colorKey2.startsWith("[")&&!_colorKey2.startsWith("[#")){return null;}var _color2=parseColorWithOpacity(_colorKey2);if(_color2){return{borderColor:_color2};}}var dirBorderMatch=cls.match(/^border-([trblxy])-(.+)$/);if(dirBorderMatch){var dir=dirBorderMatch[1];var _colorKey3=dirBorderMatch[2];if(_colorKey3.startsWith("[")&&!_colorKey3.startsWith("[#")){return null;}var _color3=parseColorWithOpacity(_colorKey3);if(_color3){if(dir==="x"){return{borderLeftColor:_color3,borderRightColor:_color3};}if(dir==="y"){return{borderTopColor:_color3,borderBottomColor:_color3};}var propMap={t:"borderTopColor",r:"borderRightColor",b:"borderBottomColor",l:"borderLeftColor"};return(0,_defineProperty2.default)({},propMap[dir],_color3);}}return null;}
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"COLORS",{enumerable:true,get:function get(){return _colorUtils.COLORS;}});exports.parseColor=parseColor;var _defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));var _colorUtils=require("../utils/colorUtils");function parseColor(cls,customColors){var getColor=function getColor(key){var _customColors$key;return(_customColors$key=customColors==null?void 0:customColors[key])!=null?_customColors$key:_colorUtils.COLORS[key];};var parseColorWithOpacity=function parseColorWithOpacity(colorKey){var _getColor;var opacityMatch=colorKey.match(/^(.+)\/(\d+)$/);if(opacityMatch){var baseColorKey=opacityMatch[1];var opacity=Number.parseInt(opacityMatch[2],10);if(opacity<0||opacity>100){if(process.env.NODE_ENV!=="production"){console.warn(`[react-native-tailwind] Invalid opacity value: ${opacity}. Opacity must be between 0 and 100.`);}return null;}var _arbitraryColor=(0,_colorUtils.parseArbitraryColor)(baseColorKey);if(_arbitraryColor!==null){return(0,_colorUtils.applyOpacity)(_arbitraryColor,opacity);}var color=getColor(baseColorKey);if(color){return(0,_colorUtils.applyOpacity)(color,opacity);}return null;}var arbitraryColor=(0,_colorUtils.parseArbitraryColor)(colorKey);if(arbitraryColor!==null){return arbitraryColor;}if(colorKey.startsWith("[")&&colorKey.endsWith("]")){if(process.env.NODE_ENV!=="production"){console.warn(`[react-native-tailwind] Unsupported arbitrary color value: ${colorKey}. Only hex colors are supported (e.g., [#ff0000], [#f00], or [#ff0000aa]).`);}return null;}return(_getColor=getColor(colorKey))!=null?_getColor:null;};if(cls.startsWith("bg-")){var colorKey=cls.substring(3);if(colorKey.startsWith("[")&&!colorKey.startsWith("[#")){return null;}var color=parseColorWithOpacity(colorKey);if(color){return{backgroundColor:color};}}if(cls.startsWith("text-")){var _colorKey=cls.substring(5);if(_colorKey.startsWith("[")&&!_colorKey.startsWith("[#")){return null;}var _color=parseColorWithOpacity(_colorKey);if(_color){return{color:_color};}}if(cls.startsWith("border-")&&!cls.match(/^border-[0-9]/)){var _colorKey2=cls.substring(7);if(_colorKey2.startsWith("[")&&!_colorKey2.startsWith("[#")){return null;}var _color2=parseColorWithOpacity(_colorKey2);if(_color2){return{borderColor:_color2};}}var dirBorderMatch=cls.match(/^border-([trblxy])-(.+)$/);if(dirBorderMatch){var dir=dirBorderMatch[1];var _colorKey3=dirBorderMatch[2];if(_colorKey3.startsWith("[")&&!_colorKey3.startsWith("[#")){return null;}var _color3=parseColorWithOpacity(_colorKey3);if(_color3){if(dir==="x"){return{borderLeftColor:_color3,borderRightColor:_color3};}if(dir==="y"){return{borderTopColor:_color3,borderBottomColor:_color3};}var propMap={t:"borderTopColor",r:"borderRightColor",b:"borderBottomColor",l:"borderLeftColor"};return(0,_defineProperty2.default)({},propMap[dir],_color3);}}return null;}
@@ -1 +1 @@
1
- var _vitest=require("vitest");var _colors=require("./colors");function applyOpacity(hex,opacity){if(hex==="transparent")return"transparent";var cleanHex=hex.replace(/^#/,"");var fullHex=cleanHex.length===3?cleanHex.split("").map(function(char){return char+char;}).join(""):cleanHex;var alpha=Math.round(opacity/100*255);var alphaHex=alpha.toString(16).padStart(2,"0").toUpperCase();return`#${fullHex.toUpperCase()}${alphaHex}`;}(0,_vitest.describe)("COLORS",function(){(0,_vitest.it)("should export complete color palette",function(){(0,_vitest.expect)(_colors.COLORS).toMatchSnapshot();});});(0,_vitest.describe)("parseColor - background colors",function(){(0,_vitest.it)("should parse background colors with preset values",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-blue-500")).toEqual({backgroundColor:_colors.COLORS["blue-500"]});(0,_vitest.expect)((0,_colors.parseColor)("bg-red-500")).toEqual({backgroundColor:_colors.COLORS["red-500"]});(0,_vitest.expect)((0,_colors.parseColor)("bg-green-500")).toEqual({backgroundColor:_colors.COLORS["green-500"]});(0,_vitest.expect)((0,_colors.parseColor)("bg-gray-300")).toEqual({backgroundColor:_colors.COLORS["gray-300"]});});(0,_vitest.it)("should parse background colors with basic values",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-white")).toEqual({backgroundColor:"#FFFFFF"});(0,_vitest.expect)((0,_colors.parseColor)("bg-black")).toEqual({backgroundColor:"#000000"});(0,_vitest.expect)((0,_colors.parseColor)("bg-transparent")).toEqual({backgroundColor:"transparent"});});(0,_vitest.it)("should parse background colors with arbitrary 6-digit hex values",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-[#ff0000]")).toEqual({backgroundColor:"#ff0000"});(0,_vitest.expect)((0,_colors.parseColor)("bg-[#3B82F6]")).toEqual({backgroundColor:"#3B82F6"});(0,_vitest.expect)((0,_colors.parseColor)("bg-[#000000]")).toEqual({backgroundColor:"#000000"});(0,_vitest.expect)((0,_colors.parseColor)("bg-[#FFFFFF]")).toEqual({backgroundColor:"#FFFFFF"});});(0,_vitest.it)("should parse background colors with arbitrary 3-digit hex values",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-[#f00]")).toEqual({backgroundColor:"#ff0000"});(0,_vitest.expect)((0,_colors.parseColor)("bg-[#abc]")).toEqual({backgroundColor:"#aabbcc"});(0,_vitest.expect)((0,_colors.parseColor)("bg-[#123]")).toEqual({backgroundColor:"#112233"});(0,_vitest.expect)((0,_colors.parseColor)("bg-[#FFF]")).toEqual({backgroundColor:"#FFFFFF"});});(0,_vitest.it)("should parse background colors with arbitrary 8-digit hex values (with alpha)",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-[#ff0000aa]")).toEqual({backgroundColor:"#ff0000aa"});(0,_vitest.expect)((0,_colors.parseColor)("bg-[#3B82F680]")).toEqual({backgroundColor:"#3B82F680"});(0,_vitest.expect)((0,_colors.parseColor)("bg-[#00000000]")).toEqual({backgroundColor:"#00000000"});(0,_vitest.expect)((0,_colors.parseColor)("bg-[#FFFFFFFF]")).toEqual({backgroundColor:"#FFFFFFFF"});});(0,_vitest.it)("should handle case-insensitive hex values",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-[#FF0000]")).toEqual({backgroundColor:"#FF0000"});(0,_vitest.expect)((0,_colors.parseColor)("bg-[#ff0000]")).toEqual({backgroundColor:"#ff0000"});(0,_vitest.expect)((0,_colors.parseColor)("bg-[#Ff0000]")).toEqual({backgroundColor:"#Ff0000"});});(0,_vitest.it)("should prefer arbitrary values over preset colors",function(){var customColors={"[#ff0000]":"#00ff00"};(0,_vitest.expect)((0,_colors.parseColor)("bg-[#ff0000]",customColors)).toEqual({backgroundColor:"#ff0000"});});});(0,_vitest.describe)("parseColor - text colors",function(){(0,_vitest.it)("should parse text colors with preset values",function(){(0,_vitest.expect)((0,_colors.parseColor)("text-blue-500")).toEqual({color:_colors.COLORS["blue-500"]});(0,_vitest.expect)((0,_colors.parseColor)("text-red-500")).toEqual({color:_colors.COLORS["red-500"]});(0,_vitest.expect)((0,_colors.parseColor)("text-green-500")).toEqual({color:_colors.COLORS["green-500"]});(0,_vitest.expect)((0,_colors.parseColor)("text-gray-700")).toEqual({color:_colors.COLORS["gray-700"]});});(0,_vitest.it)("should parse text colors with basic values",function(){(0,_vitest.expect)((0,_colors.parseColor)("text-white")).toEqual({color:"#FFFFFF"});(0,_vitest.expect)((0,_colors.parseColor)("text-black")).toEqual({color:"#000000"});});(0,_vitest.it)("should parse text colors with arbitrary 6-digit hex values",function(){(0,_vitest.expect)((0,_colors.parseColor)("text-[#ff0000]")).toEqual({color:"#ff0000"});(0,_vitest.expect)((0,_colors.parseColor)("text-[#3B82F6]")).toEqual({color:"#3B82F6"});(0,_vitest.expect)((0,_colors.parseColor)("text-[#333333]")).toEqual({color:"#333333"});});(0,_vitest.it)("should parse text colors with arbitrary 3-digit hex values",function(){(0,_vitest.expect)((0,_colors.parseColor)("text-[#f00]")).toEqual({color:"#ff0000"});(0,_vitest.expect)((0,_colors.parseColor)("text-[#abc]")).toEqual({color:"#aabbcc"});(0,_vitest.expect)((0,_colors.parseColor)("text-[#000]")).toEqual({color:"#000000"});});(0,_vitest.it)("should parse text colors with arbitrary 8-digit hex values (with alpha)",function(){(0,_vitest.expect)((0,_colors.parseColor)("text-[#ff0000aa]")).toEqual({color:"#ff0000aa"});(0,_vitest.expect)((0,_colors.parseColor)("text-[#00000080]")).toEqual({color:"#00000080"});});});(0,_vitest.describe)("parseColor - border colors",function(){(0,_vitest.it)("should parse border colors with preset values",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-blue-500")).toEqual({borderColor:_colors.COLORS["blue-500"]});(0,_vitest.expect)((0,_colors.parseColor)("border-red-500")).toEqual({borderColor:_colors.COLORS["red-500"]});(0,_vitest.expect)((0,_colors.parseColor)("border-green-500")).toEqual({borderColor:_colors.COLORS["green-500"]});(0,_vitest.expect)((0,_colors.parseColor)("border-gray-200")).toEqual({borderColor:_colors.COLORS["gray-200"]});});(0,_vitest.it)("should parse border colors with basic values",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-white")).toEqual({borderColor:"#FFFFFF"});(0,_vitest.expect)((0,_colors.parseColor)("border-black")).toEqual({borderColor:"#000000"});(0,_vitest.expect)((0,_colors.parseColor)("border-transparent")).toEqual({borderColor:"transparent"});});(0,_vitest.it)("should parse border colors with arbitrary 6-digit hex values",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-[#ff0000]")).toEqual({borderColor:"#ff0000"});(0,_vitest.expect)((0,_colors.parseColor)("border-[#3B82F6]")).toEqual({borderColor:"#3B82F6"});(0,_vitest.expect)((0,_colors.parseColor)("border-[#cccccc]")).toEqual({borderColor:"#cccccc"});});(0,_vitest.it)("should parse border colors with arbitrary 3-digit hex values",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-[#f00]")).toEqual({borderColor:"#ff0000"});(0,_vitest.expect)((0,_colors.parseColor)("border-[#abc]")).toEqual({borderColor:"#aabbcc"});(0,_vitest.expect)((0,_colors.parseColor)("border-[#999]")).toEqual({borderColor:"#999999"});});(0,_vitest.it)("should parse border colors with arbitrary 8-digit hex values (with alpha)",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-[#ff0000aa]")).toEqual({borderColor:"#ff0000aa"});(0,_vitest.expect)((0,_colors.parseColor)("border-[#0000FF50]")).toEqual({borderColor:"#0000FF50"});});(0,_vitest.it)("should not match border width classes",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-0")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("border-2")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("border-4")).toBeNull();});});(0,_vitest.describe)("parseColor - custom colors",function(){var customColors={"brand-primary":"#FF6B6B","brand-secondary":"#4ECDC4",accent:"#FFE66D"};(0,_vitest.it)("should support custom background colors",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-brand-primary",customColors)).toEqual({backgroundColor:"#FF6B6B"});(0,_vitest.expect)((0,_colors.parseColor)("bg-brand-secondary",customColors)).toEqual({backgroundColor:"#4ECDC4"});(0,_vitest.expect)((0,_colors.parseColor)("bg-accent",customColors)).toEqual({backgroundColor:"#FFE66D"});});(0,_vitest.it)("should support custom text colors",function(){(0,_vitest.expect)((0,_colors.parseColor)("text-brand-primary",customColors)).toEqual({color:"#FF6B6B"});(0,_vitest.expect)((0,_colors.parseColor)("text-brand-secondary",customColors)).toEqual({color:"#4ECDC4"});});(0,_vitest.it)("should support custom border colors",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-brand-primary",customColors)).toEqual({borderColor:"#FF6B6B"});(0,_vitest.expect)((0,_colors.parseColor)("border-accent",customColors)).toEqual({borderColor:"#FFE66D"});});(0,_vitest.it)("should allow custom colors to override preset colors",function(){var overrideColors={"blue-500":"#FF0000"};(0,_vitest.expect)((0,_colors.parseColor)("bg-blue-500",overrideColors)).toEqual({backgroundColor:"#FF0000"});});(0,_vitest.it)("should support custom colors with DEFAULT key from tailwind.config",function(){var customColorsWithDefault={primary:"#1bacb5","primary-50":"#eefdfd","primary-100":"#d4f9f9","primary-500":"#1bacb5","primary-900":"#1e4f5b"};(0,_vitest.expect)((0,_colors.parseColor)("bg-primary",customColorsWithDefault)).toEqual({backgroundColor:"#1bacb5"});(0,_vitest.expect)((0,_colors.parseColor)("bg-primary-50",customColorsWithDefault)).toEqual({backgroundColor:"#eefdfd"});(0,_vitest.expect)((0,_colors.parseColor)("text-primary",customColorsWithDefault)).toEqual({color:"#1bacb5"});(0,_vitest.expect)((0,_colors.parseColor)("border-primary",customColorsWithDefault)).toEqual({borderColor:"#1bacb5"});});(0,_vitest.it)("should fallback to preset colors when custom color not found",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-red-500",customColors)).toEqual({backgroundColor:_colors.COLORS["red-500"]});});});(0,_vitest.describe)("parseColor - edge cases",function(){(0,_vitest.it)("should return null for invalid classes",function(){(0,_vitest.expect)((0,_colors.parseColor)("invalid")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("bg")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("text")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("border")).toBeNull();});(0,_vitest.it)("should return null for invalid color values",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-invalid")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("text-notacolor")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("border-xyz")).toBeNull();});(0,_vitest.it)("should return null for invalid arbitrary hex values",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-[#ff]")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("bg-[#ffff]")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("bg-[#fffff]")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("bg-[#fffffff]")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("bg-[#fffffffff]")).toBeNull();});(0,_vitest.it)("should return null for malformed arbitrary values",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-[#ff0000")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("bg-#ff0000]")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("bg-[]")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("bg-[ff0000]")).toBeNull();});(0,_vitest.it)("should return null for non-hex arbitrary values",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-[#gggggg]")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("bg-[#zzzzzz]")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("bg-[rgb(255,0,0)]")).toBeNull();});(0,_vitest.it)("should return null for non-color arbitrary values (to let other parsers handle them)",function(){(0,_vitest.expect)((0,_colors.parseColor)("text-[13px]")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("text-[18px]")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("text-[24]")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("bg-[100%]")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("bg-[50px]")).toBeNull();});(0,_vitest.it)("should not match partial class names",function(){(0,_vitest.expect)((0,_colors.parseColor)("background-blue-500")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("textcolor-red-500")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("border-color-blue-500")).toBeNull();});(0,_vitest.it)("should handle all color scale variants",function(){var scales=["50","100","200","300","400","500","600","700","800","900"];scales.forEach(function(scale){(0,_vitest.expect)((0,_colors.parseColor)(`bg-blue-${scale}`)).toBeTruthy();(0,_vitest.expect)((0,_colors.parseColor)(`text-red-${scale}`)).toBeTruthy();(0,_vitest.expect)((0,_colors.parseColor)(`border-green-${scale}`)).toBeTruthy();});});});(0,_vitest.describe)("parseColor - comprehensive coverage",function(){(0,_vitest.it)("should parse all color types with same preset color",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-blue-500")).toEqual({backgroundColor:_colors.COLORS["blue-500"]});(0,_vitest.expect)((0,_colors.parseColor)("text-blue-500")).toEqual({color:_colors.COLORS["blue-500"]});(0,_vitest.expect)((0,_colors.parseColor)("border-blue-500")).toEqual({borderColor:_colors.COLORS["blue-500"]});});(0,_vitest.it)("should parse all color types with same arbitrary hex",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-[#ff0000]")).toEqual({backgroundColor:"#ff0000"});(0,_vitest.expect)((0,_colors.parseColor)("text-[#ff0000]")).toEqual({color:"#ff0000"});(0,_vitest.expect)((0,_colors.parseColor)("border-[#ff0000]")).toEqual({borderColor:"#ff0000"});});(0,_vitest.it)("should handle all color families",function(){var families=["gray","red","blue","green","yellow","purple","pink","orange","indigo"];families.forEach(function(family){(0,_vitest.expect)((0,_colors.parseColor)(`bg-${family}-500`)).toBeTruthy();(0,_vitest.expect)((0,_colors.parseColor)(`text-${family}-500`)).toBeTruthy();(0,_vitest.expect)((0,_colors.parseColor)(`border-${family}-500`)).toBeTruthy();});});(0,_vitest.it)("should handle arbitrary values with mixed case",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-[#AbCdEf]")).toEqual({backgroundColor:"#AbCdEf"});(0,_vitest.expect)((0,_colors.parseColor)("text-[#aBcDeF]")).toEqual({color:"#aBcDeF"});(0,_vitest.expect)((0,_colors.parseColor)("border-[#ABCDEF]")).toEqual({borderColor:"#ABCDEF"});});(0,_vitest.it)("should expand 3-digit hex consistently across all color types",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-[#abc]")).toEqual({backgroundColor:"#aabbcc"});(0,_vitest.expect)((0,_colors.parseColor)("text-[#abc]")).toEqual({color:"#aabbcc"});(0,_vitest.expect)((0,_colors.parseColor)("border-[#abc]")).toEqual({borderColor:"#aabbcc"});});(0,_vitest.it)("should handle alpha channel consistently across all color types",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-[#ff0000aa]")).toEqual({backgroundColor:"#ff0000aa"});(0,_vitest.expect)((0,_colors.parseColor)("text-[#ff0000aa]")).toEqual({color:"#ff0000aa"});(0,_vitest.expect)((0,_colors.parseColor)("border-[#ff0000aa]")).toEqual({borderColor:"#ff0000aa"});});});(0,_vitest.describe)("parseColor - opacity modifiers",function(){(0,_vitest.it)("should parse background colors with opacity modifiers",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-black/50")).toEqual({backgroundColor:applyOpacity(_colors.COLORS.black,50)});(0,_vitest.expect)((0,_colors.parseColor)("bg-white/50")).toEqual({backgroundColor:applyOpacity(_colors.COLORS.white,50)});(0,_vitest.expect)((0,_colors.parseColor)("bg-blue-500/80")).toEqual({backgroundColor:applyOpacity(_colors.COLORS["blue-500"],80)});(0,_vitest.expect)((0,_colors.parseColor)("bg-red-500/30")).toEqual({backgroundColor:applyOpacity(_colors.COLORS["red-500"],30)});});(0,_vitest.it)("should parse text colors with opacity modifiers",function(){(0,_vitest.expect)((0,_colors.parseColor)("text-black/80")).toEqual({color:applyOpacity(_colors.COLORS.black,80)});(0,_vitest.expect)((0,_colors.parseColor)("text-white/90")).toEqual({color:applyOpacity(_colors.COLORS.white,90)});(0,_vitest.expect)((0,_colors.parseColor)("text-gray-900/70")).toEqual({color:applyOpacity(_colors.COLORS["gray-900"],70)});(0,_vitest.expect)((0,_colors.parseColor)("text-blue-500/50")).toEqual({color:applyOpacity(_colors.COLORS["blue-500"],50)});});(0,_vitest.it)("should parse border colors with opacity modifiers",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-black/25")).toEqual({borderColor:applyOpacity(_colors.COLORS.black,25)});(0,_vitest.expect)((0,_colors.parseColor)("border-red-500/60")).toEqual({borderColor:applyOpacity(_colors.COLORS["red-500"],60)});(0,_vitest.expect)((0,_colors.parseColor)("border-gray-200/40")).toEqual({borderColor:applyOpacity(_colors.COLORS["gray-200"],40)});});(0,_vitest.it)("should handle opacity modifier with arbitrary hex colors",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-[#ff0000]/50")).toEqual({backgroundColor:"#FF000080"});(0,_vitest.expect)((0,_colors.parseColor)("text-[#3B82F6]/80")).toEqual({color:"#3B82F6CC"});(0,_vitest.expect)((0,_colors.parseColor)("border-[#abc]/60")).toEqual({borderColor:"#AABBCC99"});});(0,_vitest.it)("should handle opacity modifier with custom colors",function(){var customColors={"brand-primary":"#FF6B6B"};(0,_vitest.expect)((0,_colors.parseColor)("bg-brand-primary/50",customColors)).toEqual({backgroundColor:"#FF6B6B80"});(0,_vitest.expect)((0,_colors.parseColor)("text-brand-primary/75",customColors)).toEqual({color:"#FF6B6BBF"});});(0,_vitest.it)("should handle opacity 0 (fully transparent)",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-black/0")).toEqual({backgroundColor:applyOpacity(_colors.COLORS.black,0)});(0,_vitest.expect)((0,_colors.parseColor)("text-red-500/0")).toEqual({color:applyOpacity(_colors.COLORS["red-500"],0)});});(0,_vitest.it)("should handle opacity 100 (fully opaque)",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-black/100")).toEqual({backgroundColor:applyOpacity(_colors.COLORS.black,100)});(0,_vitest.expect)((0,_colors.parseColor)("text-blue-500/100")).toEqual({color:applyOpacity(_colors.COLORS["blue-500"],100)});});(0,_vitest.it)("should handle transparent color with opacity modifier",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-transparent/50")).toEqual({backgroundColor:"transparent"});});(0,_vitest.it)("should convert opacity percentage to correct hex values",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-black/0")).toEqual({backgroundColor:"#00000000"});(0,_vitest.expect)((0,_colors.parseColor)("bg-black/10")).toEqual({backgroundColor:"#0000001A"});(0,_vitest.expect)((0,_colors.parseColor)("bg-black/25")).toEqual({backgroundColor:"#00000040"});(0,_vitest.expect)((0,_colors.parseColor)("bg-black/50")).toEqual({backgroundColor:"#00000080"});(0,_vitest.expect)((0,_colors.parseColor)("bg-black/75")).toEqual({backgroundColor:"#000000BF"});(0,_vitest.expect)((0,_colors.parseColor)("bg-black/100")).toEqual({backgroundColor:"#000000FF"});});(0,_vitest.it)("should return null for invalid opacity values",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-black/101")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("bg-black/-1")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("bg-black/150")).toBeNull();});(0,_vitest.it)("should return null for malformed opacity syntax",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-black/")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("bg-black/abc")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("bg-black/50/")).toBeNull();});(0,_vitest.it)("should handle opacity with 3-digit hex expansion",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-[#f00]/50")).toEqual({backgroundColor:"#FF000080"});(0,_vitest.expect)((0,_colors.parseColor)("text-[#abc]/75")).toEqual({color:"#AABBCCBF"});});(0,_vitest.it)("should work with all color families",function(){var families=["gray","red","blue","green","yellow","purple","pink","orange","indigo"];families.forEach(function(family){(0,_vitest.expect)((0,_colors.parseColor)(`bg-${family}-500/50`)).toBeTruthy();(0,_vitest.expect)((0,_colors.parseColor)(`text-${family}-500/50`)).toBeTruthy();(0,_vitest.expect)((0,_colors.parseColor)(`border-${family}-500/50`)).toBeTruthy();});});});(0,_vitest.describe)("parseColor - directional border colors",function(){(0,_vitest.it)("should parse directional border colors with preset values",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-t-red-500")).toEqual({borderTopColor:_colors.COLORS["red-500"]});(0,_vitest.expect)((0,_colors.parseColor)("border-r-blue-500")).toEqual({borderRightColor:_colors.COLORS["blue-500"]});(0,_vitest.expect)((0,_colors.parseColor)("border-b-green-500")).toEqual({borderBottomColor:_colors.COLORS["green-500"]});(0,_vitest.expect)((0,_colors.parseColor)("border-l-yellow-500")).toEqual({borderLeftColor:_colors.COLORS["yellow-500"]});});(0,_vitest.it)("should parse directional border colors with basic values",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-t-white")).toEqual({borderTopColor:"#FFFFFF"});(0,_vitest.expect)((0,_colors.parseColor)("border-r-black")).toEqual({borderRightColor:"#000000"});(0,_vitest.expect)((0,_colors.parseColor)("border-b-transparent")).toEqual({borderBottomColor:"transparent"});(0,_vitest.expect)((0,_colors.parseColor)("border-l-white")).toEqual({borderLeftColor:"#FFFFFF"});});(0,_vitest.it)("should parse directional border colors with arbitrary 6-digit hex values",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-t-[#ff0000]")).toEqual({borderTopColor:"#ff0000"});(0,_vitest.expect)((0,_colors.parseColor)("border-r-[#3B82F6]")).toEqual({borderRightColor:"#3B82F6"});(0,_vitest.expect)((0,_colors.parseColor)("border-b-[#00ff00]")).toEqual({borderBottomColor:"#00ff00"});(0,_vitest.expect)((0,_colors.parseColor)("border-l-[#cccccc]")).toEqual({borderLeftColor:"#cccccc"});});(0,_vitest.it)("should parse directional border colors with arbitrary 3-digit hex values",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-t-[#f00]")).toEqual({borderTopColor:"#ff0000"});(0,_vitest.expect)((0,_colors.parseColor)("border-r-[#abc]")).toEqual({borderRightColor:"#aabbcc"});(0,_vitest.expect)((0,_colors.parseColor)("border-b-[#123]")).toEqual({borderBottomColor:"#112233"});(0,_vitest.expect)((0,_colors.parseColor)("border-l-[#999]")).toEqual({borderLeftColor:"#999999"});});(0,_vitest.it)("should parse directional border colors with arbitrary 8-digit hex values (with alpha)",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-t-[#ff0000aa]")).toEqual({borderTopColor:"#ff0000aa"});(0,_vitest.expect)((0,_colors.parseColor)("border-r-[#0000FF50]")).toEqual({borderRightColor:"#0000FF50"});(0,_vitest.expect)((0,_colors.parseColor)("border-b-[#00FF0080]")).toEqual({borderBottomColor:"#00FF0080"});(0,_vitest.expect)((0,_colors.parseColor)("border-l-[#FFFFFF00]")).toEqual({borderLeftColor:"#FFFFFF00"});});(0,_vitest.it)("should parse directional border colors with opacity modifiers",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-t-red-500/50")).toEqual({borderTopColor:applyOpacity(_colors.COLORS["red-500"],50)});(0,_vitest.expect)((0,_colors.parseColor)("border-r-blue-500/80")).toEqual({borderRightColor:applyOpacity(_colors.COLORS["blue-500"],80)});(0,_vitest.expect)((0,_colors.parseColor)("border-b-green-500/30")).toEqual({borderBottomColor:applyOpacity(_colors.COLORS["green-500"],30)});(0,_vitest.expect)((0,_colors.parseColor)("border-l-black/25")).toEqual({borderLeftColor:applyOpacity(_colors.COLORS.black,25)});});(0,_vitest.it)("should parse directional border colors with arbitrary hex and opacity",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-t-[#ff0000]/50")).toEqual({borderTopColor:"#FF000080"});(0,_vitest.expect)((0,_colors.parseColor)("border-r-[#3B82F6]/80")).toEqual({borderRightColor:"#3B82F6CC"});(0,_vitest.expect)((0,_colors.parseColor)("border-b-[#abc]/60")).toEqual({borderBottomColor:"#AABBCC99"});(0,_vitest.expect)((0,_colors.parseColor)("border-l-[#000]/100")).toEqual({borderLeftColor:"#000000FF"});});(0,_vitest.it)("should parse directional border colors with custom colors",function(){var customColors={"brand-primary":"#FF6B6B","brand-secondary":"#4ECDC4",accent:"#FFE66D"};(0,_vitest.expect)((0,_colors.parseColor)("border-t-brand-primary",customColors)).toEqual({borderTopColor:"#FF6B6B"});(0,_vitest.expect)((0,_colors.parseColor)("border-r-brand-secondary",customColors)).toEqual({borderRightColor:"#4ECDC4"});(0,_vitest.expect)((0,_colors.parseColor)("border-b-accent",customColors)).toEqual({borderBottomColor:"#FFE66D"});(0,_vitest.expect)((0,_colors.parseColor)("border-l-brand-primary",customColors)).toEqual({borderLeftColor:"#FF6B6B"});});(0,_vitest.it)("should parse directional border colors with custom colors and opacity",function(){var customColors={"brand-primary":"#FF6B6B"};(0,_vitest.expect)((0,_colors.parseColor)("border-t-brand-primary/50",customColors)).toEqual({borderTopColor:"#FF6B6B80"});(0,_vitest.expect)((0,_colors.parseColor)("border-l-brand-primary/75",customColors)).toEqual({borderLeftColor:"#FF6B6BBF"});});(0,_vitest.it)("should not match border width classes",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-t-2")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("border-r-4")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("border-b-8")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("border-l-0")).toBeNull();});(0,_vitest.it)("should not match border width arbitrary values",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-t-[3px]")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("border-r-[8px]")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("border-b-[5]")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("border-l-[10px]")).toBeNull();});(0,_vitest.it)("should return null for invalid directional border color values",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-t-invalid")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("border-r-notacolor")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("border-b-xyz")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("border-l-wrongcolor")).toBeNull();});(0,_vitest.it)("should handle all directions with same color",function(){var color=_colors.COLORS["blue-500"];(0,_vitest.expect)((0,_colors.parseColor)("border-t-blue-500")).toEqual({borderTopColor:color});(0,_vitest.expect)((0,_colors.parseColor)("border-r-blue-500")).toEqual({borderRightColor:color});(0,_vitest.expect)((0,_colors.parseColor)("border-b-blue-500")).toEqual({borderBottomColor:color});(0,_vitest.expect)((0,_colors.parseColor)("border-l-blue-500")).toEqual({borderLeftColor:color});});(0,_vitest.it)("should handle all color families for directional borders",function(){var families=["gray","red","blue","green","yellow","purple","pink","orange","indigo"];families.forEach(function(family){(0,_vitest.expect)((0,_colors.parseColor)(`border-t-${family}-500`)).toBeTruthy();(0,_vitest.expect)((0,_colors.parseColor)(`border-r-${family}-500`)).toBeTruthy();(0,_vitest.expect)((0,_colors.parseColor)(`border-b-${family}-500`)).toBeTruthy();(0,_vitest.expect)((0,_colors.parseColor)(`border-l-${family}-500`)).toBeTruthy();});});(0,_vitest.it)("should handle directional borders with all opacity levels",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-t-black/0")).toEqual({borderTopColor:"#00000000"});(0,_vitest.expect)((0,_colors.parseColor)("border-t-black/25")).toEqual({borderTopColor:"#00000040"});(0,_vitest.expect)((0,_colors.parseColor)("border-t-black/50")).toEqual({borderTopColor:"#00000080"});(0,_vitest.expect)((0,_colors.parseColor)("border-t-black/75")).toEqual({borderTopColor:"#000000BF"});(0,_vitest.expect)((0,_colors.parseColor)("border-t-black/100")).toEqual({borderTopColor:"#000000FF"});});});(0,_vitest.describe)("parseColor - border-x and border-y colors",function(){(0,_vitest.it)("should parse border-x colors (horizontal: left + right)",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-x-red-500")).toEqual({borderLeftColor:_colors.COLORS["red-500"],borderRightColor:_colors.COLORS["red-500"]});(0,_vitest.expect)((0,_colors.parseColor)("border-x-blue-500")).toEqual({borderLeftColor:_colors.COLORS["blue-500"],borderRightColor:_colors.COLORS["blue-500"]});});(0,_vitest.it)("should parse border-y colors (vertical: top + bottom)",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-y-green-500")).toEqual({borderTopColor:_colors.COLORS["green-500"],borderBottomColor:_colors.COLORS["green-500"]});(0,_vitest.expect)((0,_colors.parseColor)("border-y-yellow-500")).toEqual({borderTopColor:_colors.COLORS["yellow-500"],borderBottomColor:_colors.COLORS["yellow-500"]});});(0,_vitest.it)("should parse border-x with basic colors",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-x-white")).toEqual({borderLeftColor:"#FFFFFF",borderRightColor:"#FFFFFF"});(0,_vitest.expect)((0,_colors.parseColor)("border-x-black")).toEqual({borderLeftColor:"#000000",borderRightColor:"#000000"});});(0,_vitest.it)("should parse border-y with basic colors",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-y-white")).toEqual({borderTopColor:"#FFFFFF",borderBottomColor:"#FFFFFF"});(0,_vitest.expect)((0,_colors.parseColor)("border-y-transparent")).toEqual({borderTopColor:"transparent",borderBottomColor:"transparent"});});(0,_vitest.it)("should parse border-x with opacity",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-x-red-500/50")).toEqual({borderLeftColor:applyOpacity(_colors.COLORS["red-500"],50),borderRightColor:applyOpacity(_colors.COLORS["red-500"],50)});});(0,_vitest.it)("should parse border-y with opacity",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-y-blue-500/80")).toEqual({borderTopColor:applyOpacity(_colors.COLORS["blue-500"],80),borderBottomColor:applyOpacity(_colors.COLORS["blue-500"],80)});});(0,_vitest.it)("should parse border-x with arbitrary hex colors",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-x-[#ff0000]")).toEqual({borderLeftColor:"#ff0000",borderRightColor:"#ff0000"});(0,_vitest.expect)((0,_colors.parseColor)("border-x-[#abc]")).toEqual({borderLeftColor:"#aabbcc",borderRightColor:"#aabbcc"});});(0,_vitest.it)("should parse border-y with arbitrary hex colors",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-y-[#00ff00]")).toEqual({borderTopColor:"#00ff00",borderBottomColor:"#00ff00"});(0,_vitest.expect)((0,_colors.parseColor)("border-y-[#123]")).toEqual({borderTopColor:"#112233",borderBottomColor:"#112233"});});(0,_vitest.it)("should parse border-x with custom colors",function(){var customColors={"brand-primary":"#FF6B6B"};(0,_vitest.expect)((0,_colors.parseColor)("border-x-brand-primary",customColors)).toEqual({borderLeftColor:"#FF6B6B",borderRightColor:"#FF6B6B"});});(0,_vitest.it)("should parse border-y with custom colors",function(){var customColors={accent:"#FFE66D"};(0,_vitest.expect)((0,_colors.parseColor)("border-y-accent",customColors)).toEqual({borderTopColor:"#FFE66D",borderBottomColor:"#FFE66D"});});(0,_vitest.it)("should not match border-x/border-y width classes",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-x-2")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("border-y-4")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("border-x-0")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("border-y-8")).toBeNull();});(0,_vitest.it)("should not match border-x/border-y arbitrary width values",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-x-[3px]")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("border-y-[5px]")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("border-x-[10]")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("border-y-[8px]")).toBeNull();});});
1
+ var _vitest=require("vitest");var _colors=require("./colors");var _colorUtils=require("../utils/colorUtils");(0,_vitest.describe)("COLORS",function(){(0,_vitest.it)("should export complete color palette",function(){(0,_vitest.expect)(_colors.COLORS).toMatchSnapshot();});});(0,_vitest.describe)("parseColor - background colors",function(){(0,_vitest.it)("should parse background colors with preset values",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-blue-500")).toEqual({backgroundColor:_colors.COLORS["blue-500"]});(0,_vitest.expect)((0,_colors.parseColor)("bg-red-500")).toEqual({backgroundColor:_colors.COLORS["red-500"]});(0,_vitest.expect)((0,_colors.parseColor)("bg-green-500")).toEqual({backgroundColor:_colors.COLORS["green-500"]});(0,_vitest.expect)((0,_colors.parseColor)("bg-gray-300")).toEqual({backgroundColor:_colors.COLORS["gray-300"]});});(0,_vitest.it)("should parse background colors with basic values",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-white")).toEqual({backgroundColor:"#FFFFFF"});(0,_vitest.expect)((0,_colors.parseColor)("bg-black")).toEqual({backgroundColor:"#000000"});(0,_vitest.expect)((0,_colors.parseColor)("bg-transparent")).toEqual({backgroundColor:"transparent"});});(0,_vitest.it)("should parse background colors with arbitrary 6-digit hex values",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-[#ff0000]")).toEqual({backgroundColor:"#ff0000"});(0,_vitest.expect)((0,_colors.parseColor)("bg-[#3B82F6]")).toEqual({backgroundColor:"#3B82F6"});(0,_vitest.expect)((0,_colors.parseColor)("bg-[#000000]")).toEqual({backgroundColor:"#000000"});(0,_vitest.expect)((0,_colors.parseColor)("bg-[#FFFFFF]")).toEqual({backgroundColor:"#FFFFFF"});});(0,_vitest.it)("should parse background colors with arbitrary 3-digit hex values",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-[#f00]")).toEqual({backgroundColor:"#ff0000"});(0,_vitest.expect)((0,_colors.parseColor)("bg-[#abc]")).toEqual({backgroundColor:"#aabbcc"});(0,_vitest.expect)((0,_colors.parseColor)("bg-[#123]")).toEqual({backgroundColor:"#112233"});(0,_vitest.expect)((0,_colors.parseColor)("bg-[#FFF]")).toEqual({backgroundColor:"#FFFFFF"});});(0,_vitest.it)("should parse background colors with arbitrary 8-digit hex values (with alpha)",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-[#ff0000aa]")).toEqual({backgroundColor:"#ff0000aa"});(0,_vitest.expect)((0,_colors.parseColor)("bg-[#3B82F680]")).toEqual({backgroundColor:"#3B82F680"});(0,_vitest.expect)((0,_colors.parseColor)("bg-[#00000000]")).toEqual({backgroundColor:"#00000000"});(0,_vitest.expect)((0,_colors.parseColor)("bg-[#FFFFFFFF]")).toEqual({backgroundColor:"#FFFFFFFF"});});(0,_vitest.it)("should handle case-insensitive hex values",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-[#FF0000]")).toEqual({backgroundColor:"#FF0000"});(0,_vitest.expect)((0,_colors.parseColor)("bg-[#ff0000]")).toEqual({backgroundColor:"#ff0000"});(0,_vitest.expect)((0,_colors.parseColor)("bg-[#Ff0000]")).toEqual({backgroundColor:"#Ff0000"});});(0,_vitest.it)("should prefer arbitrary values over preset colors",function(){var customColors={"[#ff0000]":"#00ff00"};(0,_vitest.expect)((0,_colors.parseColor)("bg-[#ff0000]",customColors)).toEqual({backgroundColor:"#ff0000"});});});(0,_vitest.describe)("parseColor - text colors",function(){(0,_vitest.it)("should parse text colors with preset values",function(){(0,_vitest.expect)((0,_colors.parseColor)("text-blue-500")).toEqual({color:_colors.COLORS["blue-500"]});(0,_vitest.expect)((0,_colors.parseColor)("text-red-500")).toEqual({color:_colors.COLORS["red-500"]});(0,_vitest.expect)((0,_colors.parseColor)("text-green-500")).toEqual({color:_colors.COLORS["green-500"]});(0,_vitest.expect)((0,_colors.parseColor)("text-gray-700")).toEqual({color:_colors.COLORS["gray-700"]});});(0,_vitest.it)("should parse text colors with basic values",function(){(0,_vitest.expect)((0,_colors.parseColor)("text-white")).toEqual({color:"#FFFFFF"});(0,_vitest.expect)((0,_colors.parseColor)("text-black")).toEqual({color:"#000000"});});(0,_vitest.it)("should parse text colors with arbitrary 6-digit hex values",function(){(0,_vitest.expect)((0,_colors.parseColor)("text-[#ff0000]")).toEqual({color:"#ff0000"});(0,_vitest.expect)((0,_colors.parseColor)("text-[#3B82F6]")).toEqual({color:"#3B82F6"});(0,_vitest.expect)((0,_colors.parseColor)("text-[#333333]")).toEqual({color:"#333333"});});(0,_vitest.it)("should parse text colors with arbitrary 3-digit hex values",function(){(0,_vitest.expect)((0,_colors.parseColor)("text-[#f00]")).toEqual({color:"#ff0000"});(0,_vitest.expect)((0,_colors.parseColor)("text-[#abc]")).toEqual({color:"#aabbcc"});(0,_vitest.expect)((0,_colors.parseColor)("text-[#000]")).toEqual({color:"#000000"});});(0,_vitest.it)("should parse text colors with arbitrary 8-digit hex values (with alpha)",function(){(0,_vitest.expect)((0,_colors.parseColor)("text-[#ff0000aa]")).toEqual({color:"#ff0000aa"});(0,_vitest.expect)((0,_colors.parseColor)("text-[#00000080]")).toEqual({color:"#00000080"});});});(0,_vitest.describe)("parseColor - border colors",function(){(0,_vitest.it)("should parse border colors with preset values",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-blue-500")).toEqual({borderColor:_colors.COLORS["blue-500"]});(0,_vitest.expect)((0,_colors.parseColor)("border-red-500")).toEqual({borderColor:_colors.COLORS["red-500"]});(0,_vitest.expect)((0,_colors.parseColor)("border-green-500")).toEqual({borderColor:_colors.COLORS["green-500"]});(0,_vitest.expect)((0,_colors.parseColor)("border-gray-200")).toEqual({borderColor:_colors.COLORS["gray-200"]});});(0,_vitest.it)("should parse border colors with basic values",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-white")).toEqual({borderColor:"#FFFFFF"});(0,_vitest.expect)((0,_colors.parseColor)("border-black")).toEqual({borderColor:"#000000"});(0,_vitest.expect)((0,_colors.parseColor)("border-transparent")).toEqual({borderColor:"transparent"});});(0,_vitest.it)("should parse border colors with arbitrary 6-digit hex values",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-[#ff0000]")).toEqual({borderColor:"#ff0000"});(0,_vitest.expect)((0,_colors.parseColor)("border-[#3B82F6]")).toEqual({borderColor:"#3B82F6"});(0,_vitest.expect)((0,_colors.parseColor)("border-[#cccccc]")).toEqual({borderColor:"#cccccc"});});(0,_vitest.it)("should parse border colors with arbitrary 3-digit hex values",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-[#f00]")).toEqual({borderColor:"#ff0000"});(0,_vitest.expect)((0,_colors.parseColor)("border-[#abc]")).toEqual({borderColor:"#aabbcc"});(0,_vitest.expect)((0,_colors.parseColor)("border-[#999]")).toEqual({borderColor:"#999999"});});(0,_vitest.it)("should parse border colors with arbitrary 8-digit hex values (with alpha)",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-[#ff0000aa]")).toEqual({borderColor:"#ff0000aa"});(0,_vitest.expect)((0,_colors.parseColor)("border-[#0000FF50]")).toEqual({borderColor:"#0000FF50"});});(0,_vitest.it)("should not match border width classes",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-0")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("border-2")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("border-4")).toBeNull();});});(0,_vitest.describe)("parseColor - custom colors",function(){var customColors={"brand-primary":"#FF6B6B","brand-secondary":"#4ECDC4",accent:"#FFE66D"};(0,_vitest.it)("should support custom background colors",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-brand-primary",customColors)).toEqual({backgroundColor:"#FF6B6B"});(0,_vitest.expect)((0,_colors.parseColor)("bg-brand-secondary",customColors)).toEqual({backgroundColor:"#4ECDC4"});(0,_vitest.expect)((0,_colors.parseColor)("bg-accent",customColors)).toEqual({backgroundColor:"#FFE66D"});});(0,_vitest.it)("should support custom text colors",function(){(0,_vitest.expect)((0,_colors.parseColor)("text-brand-primary",customColors)).toEqual({color:"#FF6B6B"});(0,_vitest.expect)((0,_colors.parseColor)("text-brand-secondary",customColors)).toEqual({color:"#4ECDC4"});});(0,_vitest.it)("should support custom border colors",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-brand-primary",customColors)).toEqual({borderColor:"#FF6B6B"});(0,_vitest.expect)((0,_colors.parseColor)("border-accent",customColors)).toEqual({borderColor:"#FFE66D"});});(0,_vitest.it)("should allow custom colors to override preset colors",function(){var overrideColors={"blue-500":"#FF0000"};(0,_vitest.expect)((0,_colors.parseColor)("bg-blue-500",overrideColors)).toEqual({backgroundColor:"#FF0000"});});(0,_vitest.it)("should support custom colors with DEFAULT key from tailwind.config",function(){var customColorsWithDefault={primary:"#1bacb5","primary-50":"#eefdfd","primary-100":"#d4f9f9","primary-500":"#1bacb5","primary-900":"#1e4f5b"};(0,_vitest.expect)((0,_colors.parseColor)("bg-primary",customColorsWithDefault)).toEqual({backgroundColor:"#1bacb5"});(0,_vitest.expect)((0,_colors.parseColor)("bg-primary-50",customColorsWithDefault)).toEqual({backgroundColor:"#eefdfd"});(0,_vitest.expect)((0,_colors.parseColor)("text-primary",customColorsWithDefault)).toEqual({color:"#1bacb5"});(0,_vitest.expect)((0,_colors.parseColor)("border-primary",customColorsWithDefault)).toEqual({borderColor:"#1bacb5"});});(0,_vitest.it)("should fallback to preset colors when custom color not found",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-red-500",customColors)).toEqual({backgroundColor:_colors.COLORS["red-500"]});});});(0,_vitest.describe)("parseColor - edge cases",function(){(0,_vitest.it)("should return null for invalid classes",function(){(0,_vitest.expect)((0,_colors.parseColor)("invalid")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("bg")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("text")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("border")).toBeNull();});(0,_vitest.it)("should return null for invalid color values",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-invalid")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("text-notacolor")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("border-xyz")).toBeNull();});(0,_vitest.it)("should return null for invalid arbitrary hex values",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-[#ff]")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("bg-[#ffff]")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("bg-[#fffff]")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("bg-[#fffffff]")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("bg-[#fffffffff]")).toBeNull();});(0,_vitest.it)("should return null for malformed arbitrary values",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-[#ff0000")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("bg-#ff0000]")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("bg-[]")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("bg-[ff0000]")).toBeNull();});(0,_vitest.it)("should return null for non-hex arbitrary values",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-[#gggggg]")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("bg-[#zzzzzz]")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("bg-[rgb(255,0,0)]")).toBeNull();});(0,_vitest.it)("should return null for non-color arbitrary values (to let other parsers handle them)",function(){(0,_vitest.expect)((0,_colors.parseColor)("text-[13px]")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("text-[18px]")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("text-[24]")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("bg-[100%]")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("bg-[50px]")).toBeNull();});(0,_vitest.it)("should not match partial class names",function(){(0,_vitest.expect)((0,_colors.parseColor)("background-blue-500")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("textcolor-red-500")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("border-color-blue-500")).toBeNull();});(0,_vitest.it)("should handle all color scale variants",function(){var scales=["50","100","200","300","400","500","600","700","800","900"];scales.forEach(function(scale){(0,_vitest.expect)((0,_colors.parseColor)(`bg-blue-${scale}`)).toBeTruthy();(0,_vitest.expect)((0,_colors.parseColor)(`text-red-${scale}`)).toBeTruthy();(0,_vitest.expect)((0,_colors.parseColor)(`border-green-${scale}`)).toBeTruthy();});});});(0,_vitest.describe)("parseColor - comprehensive coverage",function(){(0,_vitest.it)("should parse all color types with same preset color",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-blue-500")).toEqual({backgroundColor:_colors.COLORS["blue-500"]});(0,_vitest.expect)((0,_colors.parseColor)("text-blue-500")).toEqual({color:_colors.COLORS["blue-500"]});(0,_vitest.expect)((0,_colors.parseColor)("border-blue-500")).toEqual({borderColor:_colors.COLORS["blue-500"]});});(0,_vitest.it)("should parse all color types with same arbitrary hex",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-[#ff0000]")).toEqual({backgroundColor:"#ff0000"});(0,_vitest.expect)((0,_colors.parseColor)("text-[#ff0000]")).toEqual({color:"#ff0000"});(0,_vitest.expect)((0,_colors.parseColor)("border-[#ff0000]")).toEqual({borderColor:"#ff0000"});});(0,_vitest.it)("should handle all color families",function(){var families=["gray","red","blue","green","yellow","purple","pink","orange","indigo"];families.forEach(function(family){(0,_vitest.expect)((0,_colors.parseColor)(`bg-${family}-500`)).toBeTruthy();(0,_vitest.expect)((0,_colors.parseColor)(`text-${family}-500`)).toBeTruthy();(0,_vitest.expect)((0,_colors.parseColor)(`border-${family}-500`)).toBeTruthy();});});(0,_vitest.it)("should handle arbitrary values with mixed case",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-[#AbCdEf]")).toEqual({backgroundColor:"#AbCdEf"});(0,_vitest.expect)((0,_colors.parseColor)("text-[#aBcDeF]")).toEqual({color:"#aBcDeF"});(0,_vitest.expect)((0,_colors.parseColor)("border-[#ABCDEF]")).toEqual({borderColor:"#ABCDEF"});});(0,_vitest.it)("should expand 3-digit hex consistently across all color types",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-[#abc]")).toEqual({backgroundColor:"#aabbcc"});(0,_vitest.expect)((0,_colors.parseColor)("text-[#abc]")).toEqual({color:"#aabbcc"});(0,_vitest.expect)((0,_colors.parseColor)("border-[#abc]")).toEqual({borderColor:"#aabbcc"});});(0,_vitest.it)("should handle alpha channel consistently across all color types",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-[#ff0000aa]")).toEqual({backgroundColor:"#ff0000aa"});(0,_vitest.expect)((0,_colors.parseColor)("text-[#ff0000aa]")).toEqual({color:"#ff0000aa"});(0,_vitest.expect)((0,_colors.parseColor)("border-[#ff0000aa]")).toEqual({borderColor:"#ff0000aa"});});});(0,_vitest.describe)("parseColor - opacity modifiers",function(){(0,_vitest.it)("should parse background colors with opacity modifiers",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-black/50")).toEqual({backgroundColor:(0,_colorUtils.applyOpacity)(_colors.COLORS.black,50)});(0,_vitest.expect)((0,_colors.parseColor)("bg-white/50")).toEqual({backgroundColor:(0,_colorUtils.applyOpacity)(_colors.COLORS.white,50)});(0,_vitest.expect)((0,_colors.parseColor)("bg-blue-500/80")).toEqual({backgroundColor:(0,_colorUtils.applyOpacity)(_colors.COLORS["blue-500"],80)});(0,_vitest.expect)((0,_colors.parseColor)("bg-red-500/30")).toEqual({backgroundColor:(0,_colorUtils.applyOpacity)(_colors.COLORS["red-500"],30)});});(0,_vitest.it)("should parse text colors with opacity modifiers",function(){(0,_vitest.expect)((0,_colors.parseColor)("text-black/80")).toEqual({color:(0,_colorUtils.applyOpacity)(_colors.COLORS.black,80)});(0,_vitest.expect)((0,_colors.parseColor)("text-white/90")).toEqual({color:(0,_colorUtils.applyOpacity)(_colors.COLORS.white,90)});(0,_vitest.expect)((0,_colors.parseColor)("text-gray-900/70")).toEqual({color:(0,_colorUtils.applyOpacity)(_colors.COLORS["gray-900"],70)});(0,_vitest.expect)((0,_colors.parseColor)("text-blue-500/50")).toEqual({color:(0,_colorUtils.applyOpacity)(_colors.COLORS["blue-500"],50)});});(0,_vitest.it)("should parse border colors with opacity modifiers",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-black/25")).toEqual({borderColor:(0,_colorUtils.applyOpacity)(_colors.COLORS.black,25)});(0,_vitest.expect)((0,_colors.parseColor)("border-red-500/60")).toEqual({borderColor:(0,_colorUtils.applyOpacity)(_colors.COLORS["red-500"],60)});(0,_vitest.expect)((0,_colors.parseColor)("border-gray-200/40")).toEqual({borderColor:(0,_colorUtils.applyOpacity)(_colors.COLORS["gray-200"],40)});});(0,_vitest.it)("should handle opacity modifier with arbitrary hex colors",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-[#ff0000]/50")).toEqual({backgroundColor:"#FF000080"});(0,_vitest.expect)((0,_colors.parseColor)("text-[#3B82F6]/80")).toEqual({color:"#3B82F6CC"});(0,_vitest.expect)((0,_colors.parseColor)("border-[#abc]/60")).toEqual({borderColor:"#AABBCC99"});});(0,_vitest.it)("should handle opacity modifier with custom colors",function(){var customColors={"brand-primary":"#FF6B6B"};(0,_vitest.expect)((0,_colors.parseColor)("bg-brand-primary/50",customColors)).toEqual({backgroundColor:"#FF6B6B80"});(0,_vitest.expect)((0,_colors.parseColor)("text-brand-primary/75",customColors)).toEqual({color:"#FF6B6BBF"});});(0,_vitest.it)("should handle opacity 0 (fully transparent)",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-black/0")).toEqual({backgroundColor:(0,_colorUtils.applyOpacity)(_colors.COLORS.black,0)});(0,_vitest.expect)((0,_colors.parseColor)("text-red-500/0")).toEqual({color:(0,_colorUtils.applyOpacity)(_colors.COLORS["red-500"],0)});});(0,_vitest.it)("should handle opacity 100 (fully opaque)",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-black/100")).toEqual({backgroundColor:(0,_colorUtils.applyOpacity)(_colors.COLORS.black,100)});(0,_vitest.expect)((0,_colors.parseColor)("text-blue-500/100")).toEqual({color:(0,_colorUtils.applyOpacity)(_colors.COLORS["blue-500"],100)});});(0,_vitest.it)("should handle transparent color with opacity modifier",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-transparent/50")).toEqual({backgroundColor:"transparent"});});(0,_vitest.it)("should convert opacity percentage to correct hex values",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-black/0")).toEqual({backgroundColor:"#00000000"});(0,_vitest.expect)((0,_colors.parseColor)("bg-black/10")).toEqual({backgroundColor:"#0000001A"});(0,_vitest.expect)((0,_colors.parseColor)("bg-black/25")).toEqual({backgroundColor:"#00000040"});(0,_vitest.expect)((0,_colors.parseColor)("bg-black/50")).toEqual({backgroundColor:"#00000080"});(0,_vitest.expect)((0,_colors.parseColor)("bg-black/75")).toEqual({backgroundColor:"#000000BF"});(0,_vitest.expect)((0,_colors.parseColor)("bg-black/100")).toEqual({backgroundColor:"#000000FF"});});(0,_vitest.it)("should return null for invalid opacity values",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-black/101")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("bg-black/-1")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("bg-black/150")).toBeNull();});(0,_vitest.it)("should return null for malformed opacity syntax",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-black/")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("bg-black/abc")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("bg-black/50/")).toBeNull();});(0,_vitest.it)("should handle opacity with 3-digit hex expansion",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-[#f00]/50")).toEqual({backgroundColor:"#FF000080"});(0,_vitest.expect)((0,_colors.parseColor)("text-[#abc]/75")).toEqual({color:"#AABBCCBF"});});(0,_vitest.it)("should work with all color families",function(){var families=["gray","red","blue","green","yellow","purple","pink","orange","indigo"];families.forEach(function(family){(0,_vitest.expect)((0,_colors.parseColor)(`bg-${family}-500/50`)).toBeTruthy();(0,_vitest.expect)((0,_colors.parseColor)(`text-${family}-500/50`)).toBeTruthy();(0,_vitest.expect)((0,_colors.parseColor)(`border-${family}-500/50`)).toBeTruthy();});});});(0,_vitest.describe)("parseColor - directional border colors",function(){(0,_vitest.it)("should parse directional border colors with preset values",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-t-red-500")).toEqual({borderTopColor:_colors.COLORS["red-500"]});(0,_vitest.expect)((0,_colors.parseColor)("border-r-blue-500")).toEqual({borderRightColor:_colors.COLORS["blue-500"]});(0,_vitest.expect)((0,_colors.parseColor)("border-b-green-500")).toEqual({borderBottomColor:_colors.COLORS["green-500"]});(0,_vitest.expect)((0,_colors.parseColor)("border-l-yellow-500")).toEqual({borderLeftColor:_colors.COLORS["yellow-500"]});});(0,_vitest.it)("should parse directional border colors with basic values",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-t-white")).toEqual({borderTopColor:"#FFFFFF"});(0,_vitest.expect)((0,_colors.parseColor)("border-r-black")).toEqual({borderRightColor:"#000000"});(0,_vitest.expect)((0,_colors.parseColor)("border-b-transparent")).toEqual({borderBottomColor:"transparent"});(0,_vitest.expect)((0,_colors.parseColor)("border-l-white")).toEqual({borderLeftColor:"#FFFFFF"});});(0,_vitest.it)("should parse directional border colors with arbitrary 6-digit hex values",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-t-[#ff0000]")).toEqual({borderTopColor:"#ff0000"});(0,_vitest.expect)((0,_colors.parseColor)("border-r-[#3B82F6]")).toEqual({borderRightColor:"#3B82F6"});(0,_vitest.expect)((0,_colors.parseColor)("border-b-[#00ff00]")).toEqual({borderBottomColor:"#00ff00"});(0,_vitest.expect)((0,_colors.parseColor)("border-l-[#cccccc]")).toEqual({borderLeftColor:"#cccccc"});});(0,_vitest.it)("should parse directional border colors with arbitrary 3-digit hex values",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-t-[#f00]")).toEqual({borderTopColor:"#ff0000"});(0,_vitest.expect)((0,_colors.parseColor)("border-r-[#abc]")).toEqual({borderRightColor:"#aabbcc"});(0,_vitest.expect)((0,_colors.parseColor)("border-b-[#123]")).toEqual({borderBottomColor:"#112233"});(0,_vitest.expect)((0,_colors.parseColor)("border-l-[#999]")).toEqual({borderLeftColor:"#999999"});});(0,_vitest.it)("should parse directional border colors with arbitrary 8-digit hex values (with alpha)",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-t-[#ff0000aa]")).toEqual({borderTopColor:"#ff0000aa"});(0,_vitest.expect)((0,_colors.parseColor)("border-r-[#0000FF50]")).toEqual({borderRightColor:"#0000FF50"});(0,_vitest.expect)((0,_colors.parseColor)("border-b-[#00FF0080]")).toEqual({borderBottomColor:"#00FF0080"});(0,_vitest.expect)((0,_colors.parseColor)("border-l-[#FFFFFF00]")).toEqual({borderLeftColor:"#FFFFFF00"});});(0,_vitest.it)("should parse directional border colors with opacity modifiers",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-t-red-500/50")).toEqual({borderTopColor:(0,_colorUtils.applyOpacity)(_colors.COLORS["red-500"],50)});(0,_vitest.expect)((0,_colors.parseColor)("border-r-blue-500/80")).toEqual({borderRightColor:(0,_colorUtils.applyOpacity)(_colors.COLORS["blue-500"],80)});(0,_vitest.expect)((0,_colors.parseColor)("border-b-green-500/30")).toEqual({borderBottomColor:(0,_colorUtils.applyOpacity)(_colors.COLORS["green-500"],30)});(0,_vitest.expect)((0,_colors.parseColor)("border-l-black/25")).toEqual({borderLeftColor:(0,_colorUtils.applyOpacity)(_colors.COLORS.black,25)});});(0,_vitest.it)("should parse directional border colors with arbitrary hex and opacity",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-t-[#ff0000]/50")).toEqual({borderTopColor:"#FF000080"});(0,_vitest.expect)((0,_colors.parseColor)("border-r-[#3B82F6]/80")).toEqual({borderRightColor:"#3B82F6CC"});(0,_vitest.expect)((0,_colors.parseColor)("border-b-[#abc]/60")).toEqual({borderBottomColor:"#AABBCC99"});(0,_vitest.expect)((0,_colors.parseColor)("border-l-[#000]/100")).toEqual({borderLeftColor:"#000000FF"});});(0,_vitest.it)("should parse directional border colors with custom colors",function(){var customColors={"brand-primary":"#FF6B6B","brand-secondary":"#4ECDC4",accent:"#FFE66D"};(0,_vitest.expect)((0,_colors.parseColor)("border-t-brand-primary",customColors)).toEqual({borderTopColor:"#FF6B6B"});(0,_vitest.expect)((0,_colors.parseColor)("border-r-brand-secondary",customColors)).toEqual({borderRightColor:"#4ECDC4"});(0,_vitest.expect)((0,_colors.parseColor)("border-b-accent",customColors)).toEqual({borderBottomColor:"#FFE66D"});(0,_vitest.expect)((0,_colors.parseColor)("border-l-brand-primary",customColors)).toEqual({borderLeftColor:"#FF6B6B"});});(0,_vitest.it)("should parse directional border colors with custom colors and opacity",function(){var customColors={"brand-primary":"#FF6B6B"};(0,_vitest.expect)((0,_colors.parseColor)("border-t-brand-primary/50",customColors)).toEqual({borderTopColor:"#FF6B6B80"});(0,_vitest.expect)((0,_colors.parseColor)("border-l-brand-primary/75",customColors)).toEqual({borderLeftColor:"#FF6B6BBF"});});(0,_vitest.it)("should not match border width classes",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-t-2")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("border-r-4")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("border-b-8")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("border-l-0")).toBeNull();});(0,_vitest.it)("should not match border width arbitrary values",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-t-[3px]")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("border-r-[8px]")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("border-b-[5]")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("border-l-[10px]")).toBeNull();});(0,_vitest.it)("should return null for invalid directional border color values",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-t-invalid")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("border-r-notacolor")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("border-b-xyz")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("border-l-wrongcolor")).toBeNull();});(0,_vitest.it)("should handle all directions with same color",function(){var color=_colors.COLORS["blue-500"];(0,_vitest.expect)((0,_colors.parseColor)("border-t-blue-500")).toEqual({borderTopColor:color});(0,_vitest.expect)((0,_colors.parseColor)("border-r-blue-500")).toEqual({borderRightColor:color});(0,_vitest.expect)((0,_colors.parseColor)("border-b-blue-500")).toEqual({borderBottomColor:color});(0,_vitest.expect)((0,_colors.parseColor)("border-l-blue-500")).toEqual({borderLeftColor:color});});(0,_vitest.it)("should handle all color families for directional borders",function(){var families=["gray","red","blue","green","yellow","purple","pink","orange","indigo"];families.forEach(function(family){(0,_vitest.expect)((0,_colors.parseColor)(`border-t-${family}-500`)).toBeTruthy();(0,_vitest.expect)((0,_colors.parseColor)(`border-r-${family}-500`)).toBeTruthy();(0,_vitest.expect)((0,_colors.parseColor)(`border-b-${family}-500`)).toBeTruthy();(0,_vitest.expect)((0,_colors.parseColor)(`border-l-${family}-500`)).toBeTruthy();});});(0,_vitest.it)("should handle directional borders with all opacity levels",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-t-black/0")).toEqual({borderTopColor:"#00000000"});(0,_vitest.expect)((0,_colors.parseColor)("border-t-black/25")).toEqual({borderTopColor:"#00000040"});(0,_vitest.expect)((0,_colors.parseColor)("border-t-black/50")).toEqual({borderTopColor:"#00000080"});(0,_vitest.expect)((0,_colors.parseColor)("border-t-black/75")).toEqual({borderTopColor:"#000000BF"});(0,_vitest.expect)((0,_colors.parseColor)("border-t-black/100")).toEqual({borderTopColor:"#000000FF"});});});(0,_vitest.describe)("parseColor - border-x and border-y colors",function(){(0,_vitest.it)("should parse border-x colors (horizontal: left + right)",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-x-red-500")).toEqual({borderLeftColor:_colors.COLORS["red-500"],borderRightColor:_colors.COLORS["red-500"]});(0,_vitest.expect)((0,_colors.parseColor)("border-x-blue-500")).toEqual({borderLeftColor:_colors.COLORS["blue-500"],borderRightColor:_colors.COLORS["blue-500"]});});(0,_vitest.it)("should parse border-y colors (vertical: top + bottom)",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-y-green-500")).toEqual({borderTopColor:_colors.COLORS["green-500"],borderBottomColor:_colors.COLORS["green-500"]});(0,_vitest.expect)((0,_colors.parseColor)("border-y-yellow-500")).toEqual({borderTopColor:_colors.COLORS["yellow-500"],borderBottomColor:_colors.COLORS["yellow-500"]});});(0,_vitest.it)("should parse border-x with basic colors",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-x-white")).toEqual({borderLeftColor:"#FFFFFF",borderRightColor:"#FFFFFF"});(0,_vitest.expect)((0,_colors.parseColor)("border-x-black")).toEqual({borderLeftColor:"#000000",borderRightColor:"#000000"});});(0,_vitest.it)("should parse border-y with basic colors",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-y-white")).toEqual({borderTopColor:"#FFFFFF",borderBottomColor:"#FFFFFF"});(0,_vitest.expect)((0,_colors.parseColor)("border-y-transparent")).toEqual({borderTopColor:"transparent",borderBottomColor:"transparent"});});(0,_vitest.it)("should parse border-x with opacity",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-x-red-500/50")).toEqual({borderLeftColor:(0,_colorUtils.applyOpacity)(_colors.COLORS["red-500"],50),borderRightColor:(0,_colorUtils.applyOpacity)(_colors.COLORS["red-500"],50)});});(0,_vitest.it)("should parse border-y with opacity",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-y-blue-500/80")).toEqual({borderTopColor:(0,_colorUtils.applyOpacity)(_colors.COLORS["blue-500"],80),borderBottomColor:(0,_colorUtils.applyOpacity)(_colors.COLORS["blue-500"],80)});});(0,_vitest.it)("should parse border-x with arbitrary hex colors",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-x-[#ff0000]")).toEqual({borderLeftColor:"#ff0000",borderRightColor:"#ff0000"});(0,_vitest.expect)((0,_colors.parseColor)("border-x-[#abc]")).toEqual({borderLeftColor:"#aabbcc",borderRightColor:"#aabbcc"});});(0,_vitest.it)("should parse border-y with arbitrary hex colors",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-y-[#00ff00]")).toEqual({borderTopColor:"#00ff00",borderBottomColor:"#00ff00"});(0,_vitest.expect)((0,_colors.parseColor)("border-y-[#123]")).toEqual({borderTopColor:"#112233",borderBottomColor:"#112233"});});(0,_vitest.it)("should parse border-x with custom colors",function(){var customColors={"brand-primary":"#FF6B6B"};(0,_vitest.expect)((0,_colors.parseColor)("border-x-brand-primary",customColors)).toEqual({borderLeftColor:"#FF6B6B",borderRightColor:"#FF6B6B"});});(0,_vitest.it)("should parse border-y with custom colors",function(){var customColors={accent:"#FFE66D"};(0,_vitest.expect)((0,_colors.parseColor)("border-y-accent",customColors)).toEqual({borderTopColor:"#FFE66D",borderBottomColor:"#FFE66D"});});(0,_vitest.it)("should not match border-x/border-y width classes",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-x-2")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("border-y-4")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("border-x-0")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("border-y-8")).toBeNull();});(0,_vitest.it)("should not match border-x/border-y arbitrary width values",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-x-[3px]")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("border-y-[5px]")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("border-x-[10]")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("border-y-[8px]")).toBeNull();});});
@@ -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 _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{};}
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);},function(cls){return(0,_shadows.parseShadow)(cls,customTheme==null?void 0:customTheme.colors);},_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{};}
@@ -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;}