@mgcrea/react-native-tailwind 0.12.0 → 0.13.0

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.
Files changed (97) hide show
  1. package/README.md +29 -2014
  2. package/dist/babel/config-loader.d.ts +3 -0
  3. package/dist/babel/config-loader.test.ts +2 -2
  4. package/dist/babel/config-loader.ts +37 -2
  5. package/dist/babel/index.cjs +2855 -2434
  6. package/dist/babel/plugin/componentScope.d.ts +26 -0
  7. package/dist/babel/plugin/componentScope.ts +87 -0
  8. package/dist/babel/plugin/state.d.ts +119 -0
  9. package/dist/babel/plugin/state.ts +177 -0
  10. package/dist/babel/plugin/visitors/className.d.ts +11 -0
  11. package/{src/babel/plugin.test.ts → dist/babel/plugin/visitors/className.test.ts} +74 -674
  12. package/dist/babel/plugin/visitors/className.ts +624 -0
  13. package/dist/babel/plugin/visitors/className.windowDimensions.test.ts +406 -0
  14. package/dist/babel/plugin/visitors/imports.d.ts +11 -0
  15. package/dist/babel/plugin/visitors/imports.test.ts +88 -0
  16. package/dist/babel/plugin/visitors/imports.ts +101 -0
  17. package/dist/babel/plugin/visitors/program.d.ts +15 -0
  18. package/dist/babel/plugin/visitors/program.test.ts +325 -0
  19. package/dist/babel/plugin/visitors/program.ts +99 -0
  20. package/dist/babel/plugin/visitors/tw.d.ts +16 -0
  21. package/dist/babel/plugin/visitors/tw.test.ts +620 -0
  22. package/dist/babel/plugin/visitors/tw.ts +148 -0
  23. package/dist/babel/plugin.d.ts +3 -96
  24. package/dist/babel/plugin.test.ts +470 -0
  25. package/dist/babel/plugin.ts +28 -953
  26. package/dist/babel/utils/colorSchemeModifierProcessing.ts +11 -0
  27. package/dist/babel/utils/componentSupport.test.ts +20 -7
  28. package/dist/babel/utils/componentSupport.ts +2 -0
  29. package/dist/babel/utils/modifierProcessing.ts +21 -0
  30. package/dist/babel/utils/platformModifierProcessing.ts +11 -0
  31. package/dist/babel/utils/styleInjection.d.ts +15 -0
  32. package/dist/babel/utils/styleInjection.ts +172 -17
  33. package/dist/babel/utils/twProcessing.ts +11 -0
  34. package/dist/babel/utils/windowDimensionsProcessing.d.ts +56 -0
  35. package/dist/babel/utils/windowDimensionsProcessing.ts +121 -0
  36. package/dist/components/TouchableOpacity.d.ts +35 -0
  37. package/dist/components/TouchableOpacity.js +1 -0
  38. package/dist/components/index.d.ts +3 -0
  39. package/dist/components/index.js +1 -0
  40. package/dist/config/markers.d.ts +5 -0
  41. package/dist/config/markers.js +1 -0
  42. package/dist/index.d.ts +2 -5
  43. package/dist/index.js +1 -1
  44. package/dist/parser/borders.d.ts +3 -1
  45. package/dist/parser/borders.js +1 -1
  46. package/dist/parser/borders.test.js +1 -1
  47. package/dist/parser/colors.js +1 -1
  48. package/dist/parser/colors.test.js +1 -1
  49. package/dist/parser/index.d.ts +1 -0
  50. package/dist/parser/index.js +1 -1
  51. package/dist/parser/layout.js +1 -1
  52. package/dist/parser/layout.test.js +1 -1
  53. package/dist/parser/sizing.js +1 -1
  54. package/dist/parser/typography.d.ts +2 -1
  55. package/dist/parser/typography.js +1 -1
  56. package/dist/parser/typography.test.js +1 -1
  57. package/dist/runtime.cjs +1 -1
  58. package/dist/runtime.cjs.map +4 -4
  59. package/dist/runtime.js +1 -1
  60. package/dist/runtime.js.map +4 -4
  61. package/package.json +1 -1
  62. package/src/babel/config-loader.test.ts +2 -2
  63. package/src/babel/config-loader.ts +37 -2
  64. package/src/babel/plugin/componentScope.ts +87 -0
  65. package/src/babel/plugin/state.ts +177 -0
  66. package/src/babel/plugin/visitors/className.test.ts +1312 -0
  67. package/src/babel/plugin/visitors/className.ts +624 -0
  68. package/src/babel/plugin/visitors/className.windowDimensions.test.ts +406 -0
  69. package/src/babel/plugin/visitors/imports.test.ts +88 -0
  70. package/src/babel/plugin/visitors/imports.ts +101 -0
  71. package/src/babel/plugin/visitors/program.test.ts +325 -0
  72. package/src/babel/plugin/visitors/program.ts +99 -0
  73. package/src/babel/plugin/visitors/tw.test.ts +620 -0
  74. package/src/babel/plugin/visitors/tw.ts +148 -0
  75. package/src/babel/plugin.ts +28 -953
  76. package/src/babel/utils/colorSchemeModifierProcessing.ts +11 -0
  77. package/src/babel/utils/componentSupport.test.ts +20 -7
  78. package/src/babel/utils/componentSupport.ts +2 -0
  79. package/src/babel/utils/modifierProcessing.ts +21 -0
  80. package/src/babel/utils/platformModifierProcessing.ts +11 -0
  81. package/src/babel/utils/styleInjection.ts +172 -17
  82. package/src/babel/utils/twProcessing.ts +11 -0
  83. package/src/babel/utils/windowDimensionsProcessing.ts +121 -0
  84. package/src/components/TouchableOpacity.tsx +71 -0
  85. package/src/components/index.ts +3 -0
  86. package/src/config/markers.ts +5 -0
  87. package/src/index.ts +4 -5
  88. package/src/parser/borders.test.ts +58 -0
  89. package/src/parser/borders.ts +18 -3
  90. package/src/parser/colors.test.ts +249 -0
  91. package/src/parser/colors.ts +38 -0
  92. package/src/parser/index.ts +4 -3
  93. package/src/parser/layout.test.ts +61 -0
  94. package/src/parser/layout.ts +55 -1
  95. package/src/parser/sizing.ts +11 -0
  96. package/src/parser/typography.test.ts +102 -0
  97. package/src/parser/typography.ts +61 -15
package/dist/index.d.ts CHANGED
@@ -8,6 +8,7 @@ export { flattenColors } from "./utils/flattenColors";
8
8
  export { generateStyleKey } from "./utils/styleKey";
9
9
  export type { StyleObject } from "./types/core";
10
10
  export type { NativeStyle, TwStyle } from "./types/runtime";
11
+ export { TAILWIND_COLORS } from "./config/tailwind";
11
12
  export { parseAspectRatio, parseBorder, parseColor, parseLayout, parsePlaceholderClass, parsePlaceholderClasses, parseShadow, parseSizing, parseSpacing, parseTypography, } from "./parser";
12
13
  export { ASPECT_RATIO_PRESETS } from "./parser/aspectRatio";
13
14
  export { COLORS } from "./parser/colors";
@@ -16,8 +17,4 @@ export { SHADOW_SCALE } from "./parser/shadows";
16
17
  export { SIZE_PERCENTAGES, SIZE_SCALE } from "./parser/sizing";
17
18
  export { SPACING_SCALE } from "./parser/spacing";
18
19
  export { FONT_SIZES, LETTER_SPACING_SCALE } from "./parser/typography";
19
- export { Pressable } from "./components/Pressable";
20
- export type { PressableProps } from "./components/Pressable";
21
- export { TextInput } from "./components/TextInput";
22
- export type { TextInputProps } from "./components/TextInput";
23
- export { TAILWIND_COLORS } from "./config/tailwind";
20
+ export * from "./components";
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"ASPECT_RATIO_PRESETS",{enumerable:true,get:function get(){return _aspectRatio.ASPECT_RATIO_PRESETS;}});Object.defineProperty(exports,"COLORS",{enumerable:true,get:function get(){return _colors.COLORS;}});Object.defineProperty(exports,"FONT_SIZES",{enumerable:true,get:function get(){return _typography.FONT_SIZES;}});Object.defineProperty(exports,"INSET_SCALE",{enumerable:true,get:function get(){return _layout.INSET_SCALE;}});Object.defineProperty(exports,"LETTER_SPACING_SCALE",{enumerable:true,get:function get(){return _typography.LETTER_SPACING_SCALE;}});Object.defineProperty(exports,"Pressable",{enumerable:true,get:function get(){return _Pressable.Pressable;}});Object.defineProperty(exports,"SHADOW_SCALE",{enumerable:true,get:function get(){return _shadows.SHADOW_SCALE;}});Object.defineProperty(exports,"SIZE_PERCENTAGES",{enumerable:true,get:function get(){return _sizing.SIZE_PERCENTAGES;}});Object.defineProperty(exports,"SIZE_SCALE",{enumerable:true,get:function get(){return _sizing.SIZE_SCALE;}});Object.defineProperty(exports,"SPACING_SCALE",{enumerable:true,get:function get(){return _spacing.SPACING_SCALE;}});Object.defineProperty(exports,"TAILWIND_COLORS",{enumerable:true,get:function get(){return _tailwind.TAILWIND_COLORS;}});Object.defineProperty(exports,"TextInput",{enumerable:true,get:function get(){return _TextInput.TextInput;}});Object.defineProperty(exports,"Z_INDEX_SCALE",{enumerable:true,get:function get(){return _layout.Z_INDEX_SCALE;}});Object.defineProperty(exports,"flattenColors",{enumerable:true,get:function get(){return _flattenColors.flattenColors;}});Object.defineProperty(exports,"generateStyleKey",{enumerable:true,get:function get(){return _styleKey.generateStyleKey;}});Object.defineProperty(exports,"parseAspectRatio",{enumerable:true,get:function get(){return _parser.parseAspectRatio;}});Object.defineProperty(exports,"parseBorder",{enumerable:true,get:function get(){return _parser.parseBorder;}});Object.defineProperty(exports,"parseClass",{enumerable:true,get:function get(){return _parser.parseClass;}});Object.defineProperty(exports,"parseClassName",{enumerable:true,get:function get(){return _parser.parseClassName;}});Object.defineProperty(exports,"parseColor",{enumerable:true,get:function get(){return _parser.parseColor;}});Object.defineProperty(exports,"parseLayout",{enumerable:true,get:function get(){return _parser.parseLayout;}});Object.defineProperty(exports,"parsePlaceholderClass",{enumerable:true,get:function get(){return _parser.parsePlaceholderClass;}});Object.defineProperty(exports,"parsePlaceholderClasses",{enumerable:true,get:function get(){return _parser.parsePlaceholderClasses;}});Object.defineProperty(exports,"parseShadow",{enumerable:true,get:function get(){return _parser.parseShadow;}});Object.defineProperty(exports,"parseSizing",{enumerable:true,get:function get(){return _parser.parseSizing;}});Object.defineProperty(exports,"parseSpacing",{enumerable:true,get:function get(){return _parser.parseSpacing;}});Object.defineProperty(exports,"parseTypography",{enumerable:true,get:function get(){return _parser.parseTypography;}});Object.defineProperty(exports,"tw",{enumerable:true,get:function get(){return _tw.tw;}});Object.defineProperty(exports,"twStyle",{enumerable:true,get:function get(){return _tw.twStyle;}});var _tw=require("./stubs/tw");var _parser=require("./parser");var _flattenColors=require("./utils/flattenColors");var _styleKey=require("./utils/styleKey");var _aspectRatio=require("./parser/aspectRatio");var _colors=require("./parser/colors");var _layout=require("./parser/layout");var _shadows=require("./parser/shadows");var _sizing=require("./parser/sizing");var _spacing=require("./parser/spacing");var _typography=require("./parser/typography");var _Pressable=require("./components/Pressable");var _TextInput=require("./components/TextInput");var _tailwind=require("./config/tailwind");
1
+ Object.defineProperty(exports,"__esModule",{value:true});var _exportNames={tw:true,twStyle:true,parseClass:true,parseClassName:true,parseAspectRatio:true,parseBorder:true,parseColor:true,parseLayout:true,parsePlaceholderClass:true,parsePlaceholderClasses:true,parseShadow:true,parseSizing:true,parseSpacing:true,parseTypography:true,flattenColors:true,generateStyleKey:true,TAILWIND_COLORS:true,ASPECT_RATIO_PRESETS:true,COLORS:true,INSET_SCALE:true,Z_INDEX_SCALE:true,SHADOW_SCALE:true,SIZE_PERCENTAGES:true,SIZE_SCALE:true,SPACING_SCALE:true,FONT_SIZES:true,LETTER_SPACING_SCALE:true};Object.defineProperty(exports,"ASPECT_RATIO_PRESETS",{enumerable:true,get:function get(){return _aspectRatio.ASPECT_RATIO_PRESETS;}});Object.defineProperty(exports,"COLORS",{enumerable:true,get:function get(){return _colors.COLORS;}});Object.defineProperty(exports,"FONT_SIZES",{enumerable:true,get:function get(){return _typography.FONT_SIZES;}});Object.defineProperty(exports,"INSET_SCALE",{enumerable:true,get:function get(){return _layout.INSET_SCALE;}});Object.defineProperty(exports,"LETTER_SPACING_SCALE",{enumerable:true,get:function get(){return _typography.LETTER_SPACING_SCALE;}});Object.defineProperty(exports,"SHADOW_SCALE",{enumerable:true,get:function get(){return _shadows.SHADOW_SCALE;}});Object.defineProperty(exports,"SIZE_PERCENTAGES",{enumerable:true,get:function get(){return _sizing.SIZE_PERCENTAGES;}});Object.defineProperty(exports,"SIZE_SCALE",{enumerable:true,get:function get(){return _sizing.SIZE_SCALE;}});Object.defineProperty(exports,"SPACING_SCALE",{enumerable:true,get:function get(){return _spacing.SPACING_SCALE;}});Object.defineProperty(exports,"TAILWIND_COLORS",{enumerable:true,get:function get(){return _tailwind.TAILWIND_COLORS;}});Object.defineProperty(exports,"Z_INDEX_SCALE",{enumerable:true,get:function get(){return _layout.Z_INDEX_SCALE;}});Object.defineProperty(exports,"flattenColors",{enumerable:true,get:function get(){return _flattenColors.flattenColors;}});Object.defineProperty(exports,"generateStyleKey",{enumerable:true,get:function get(){return _styleKey.generateStyleKey;}});Object.defineProperty(exports,"parseAspectRatio",{enumerable:true,get:function get(){return _parser.parseAspectRatio;}});Object.defineProperty(exports,"parseBorder",{enumerable:true,get:function get(){return _parser.parseBorder;}});Object.defineProperty(exports,"parseClass",{enumerable:true,get:function get(){return _parser.parseClass;}});Object.defineProperty(exports,"parseClassName",{enumerable:true,get:function get(){return _parser.parseClassName;}});Object.defineProperty(exports,"parseColor",{enumerable:true,get:function get(){return _parser.parseColor;}});Object.defineProperty(exports,"parseLayout",{enumerable:true,get:function get(){return _parser.parseLayout;}});Object.defineProperty(exports,"parsePlaceholderClass",{enumerable:true,get:function get(){return _parser.parsePlaceholderClass;}});Object.defineProperty(exports,"parsePlaceholderClasses",{enumerable:true,get:function get(){return _parser.parsePlaceholderClasses;}});Object.defineProperty(exports,"parseShadow",{enumerable:true,get:function get(){return _parser.parseShadow;}});Object.defineProperty(exports,"parseSizing",{enumerable:true,get:function get(){return _parser.parseSizing;}});Object.defineProperty(exports,"parseSpacing",{enumerable:true,get:function get(){return _parser.parseSpacing;}});Object.defineProperty(exports,"parseTypography",{enumerable:true,get:function get(){return _parser.parseTypography;}});Object.defineProperty(exports,"tw",{enumerable:true,get:function get(){return _tw.tw;}});Object.defineProperty(exports,"twStyle",{enumerable:true,get:function get(){return _tw.twStyle;}});var _tw=require("./stubs/tw");var _parser=require("./parser");var _flattenColors=require("./utils/flattenColors");var _styleKey=require("./utils/styleKey");var _tailwind=require("./config/tailwind");var _aspectRatio=require("./parser/aspectRatio");var _colors=require("./parser/colors");var _layout=require("./parser/layout");var _shadows=require("./parser/shadows");var _sizing=require("./parser/sizing");var _spacing=require("./parser/spacing");var _typography=require("./parser/typography");var _components=require("./components");Object.keys(_components).forEach(function(key){if(key==="default"||key==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,key))return;if(key in exports&&exports[key]===_components[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return _components[key];}});});
@@ -6,5 +6,7 @@ export declare const BORDER_WIDTH_SCALE: Record<string, number>;
6
6
  export declare const BORDER_RADIUS_SCALE: Record<string, number>;
7
7
  /**
8
8
  * Parse border classes
9
+ * @param cls - The class name to parse
10
+ * @param customColors - Optional custom colors from tailwind.config (used to detect color patterns)
9
11
  */
10
- export declare function parseBorder(cls: string): StyleObject | null;
12
+ export declare function parseBorder(cls: string, customColors?: Record<string, string>): StyleObject | null;
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.BORDER_WIDTH_SCALE=exports.BORDER_RADIUS_SCALE=void 0;exports.parseBorder=parseBorder;var _defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));var BORDER_WIDTH_SCALE=exports.BORDER_WIDTH_SCALE={"":1,"0":0,"2":2,"4":4,"8":8};var BORDER_RADIUS_SCALE=exports.BORDER_RADIUS_SCALE={none:0,sm:2,"":4,md:6,lg:8,xl:12,"2xl":16,"3xl":24,full:9999};var BORDER_WIDTH_PROP_MAP={t:"borderTopWidth",r:"borderRightWidth",b:"borderBottomWidth",l:"borderLeftWidth"};var BORDER_RADIUS_CORNER_MAP={tl:"borderTopLeftRadius",tr:"borderTopRightRadius",bl:"borderBottomLeftRadius",br:"borderBottomRightRadius"};var BORDER_RADIUS_SIDE_MAP={t:["borderTopLeftRadius","borderTopRightRadius"],r:["borderTopRightRadius","borderBottomRightRadius"],b:["borderBottomLeftRadius","borderBottomRightRadius"],l:["borderTopLeftRadius","borderBottomLeftRadius"]};function parseArbitraryBorderWidth(value){var pxMatch=value.match(/^\[(\d+)(?:px)?\]$/);if(pxMatch){return parseInt(pxMatch[1],10);}if(value.startsWith("[")&&value.endsWith("]")){if(process.env.NODE_ENV!=="production"){console.warn(`[react-native-tailwind] Unsupported arbitrary border width value: ${value}. Only px values are supported (e.g., [8px] or [8]).`);}return null;}return null;}function parseArbitraryBorderRadius(value){var pxMatch=value.match(/^\[(\d+)(?:px)?\]$/);if(pxMatch){return parseInt(pxMatch[1],10);}if(value.startsWith("[")&&value.endsWith("]")){if(process.env.NODE_ENV!=="production"){console.warn(`[react-native-tailwind] Unsupported arbitrary border radius value: ${value}. Only px values are supported (e.g., [12px] or [12]).`);}return null;}return null;}function parseBorder(cls){if(cls==="border-solid")return{borderStyle:"solid"};if(cls==="border-dotted")return{borderStyle:"dotted"};if(cls==="border-dashed")return{borderStyle:"dashed"};if(cls.startsWith("border-")){return parseBorderWidth(cls);}if(cls==="border"){return{borderWidth:1};}if(cls.startsWith("rounded")){return parseBorderRadius(cls);}return null;}function parseBorderWidth(cls){var dirMatch=cls.match(/^border-([trbl])(?:-(.+))?$/);if(dirMatch){var dir=dirMatch[1];var valueStr=dirMatch[2]||"";if(valueStr.startsWith("[")){var arbitraryValue=parseArbitraryBorderWidth(valueStr);if(arbitraryValue!==null){return(0,_defineProperty2.default)({},BORDER_WIDTH_PROP_MAP[dir],arbitraryValue);}return null;}var scaleValue=BORDER_WIDTH_SCALE[valueStr];if(scaleValue!==undefined){return(0,_defineProperty2.default)({},BORDER_WIDTH_PROP_MAP[dir],scaleValue);}return null;}var allMatch=cls.match(/^border-(\d+)$/);if(allMatch){var value=BORDER_WIDTH_SCALE[allMatch[1]];if(value!==undefined){return{borderWidth:value};}}var allArbMatch=cls.match(/^border-(\[.+\])$/);if(allArbMatch){var _arbitraryValue=parseArbitraryBorderWidth(allArbMatch[1]);if(_arbitraryValue!==null){return{borderWidth:_arbitraryValue};}}return null;}function parseBorderRadius(cls){var withoutPrefix=cls.substring(7);if(withoutPrefix===""){return{borderRadius:BORDER_RADIUS_SCALE[""]};}if(!withoutPrefix.startsWith("-")){return null;}var rest=withoutPrefix.substring(1);if(rest===""){return null;}var cornerMatch=rest.match(/^(tl|tr|bl|br)(?:-(.+))?$/);if(cornerMatch){var corner=cornerMatch[1];var valueStr=cornerMatch[2]||"";if(valueStr.startsWith("[")){var arbitraryValue=parseArbitraryBorderRadius(valueStr);if(arbitraryValue!==null){return(0,_defineProperty2.default)({},BORDER_RADIUS_CORNER_MAP[corner],arbitraryValue);}return null;}var _scaleValue=BORDER_RADIUS_SCALE[valueStr];if(_scaleValue!==undefined){return(0,_defineProperty2.default)({},BORDER_RADIUS_CORNER_MAP[corner],_scaleValue);}return null;}var sideMatch=rest.match(/^([trbl])(?:-(.+))?$/);if(sideMatch){var side=sideMatch[1];var _valueStr=sideMatch[2]||"";var value;if(_valueStr.startsWith("[")){var _arbitraryValue2=parseArbitraryBorderRadius(_valueStr);if(_arbitraryValue2!==null){value=_arbitraryValue2;}else{return null;}}else{value=BORDER_RADIUS_SCALE[_valueStr];}if(value!==undefined){var result={};BORDER_RADIUS_SIDE_MAP[side].forEach(function(prop){return result[prop]=value;});return result;}return null;}if(rest.startsWith("[")){var _arbitraryValue3=parseArbitraryBorderRadius(rest);if(_arbitraryValue3!==null){return{borderRadius:_arbitraryValue3};}return null;}var scaleValue=BORDER_RADIUS_SCALE[rest];if(scaleValue!==undefined){return{borderRadius:scaleValue};}return null;}
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.BORDER_WIDTH_SCALE=exports.BORDER_RADIUS_SCALE=void 0;exports.parseBorder=parseBorder;var _defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));var _colors=require("./colors");var BORDER_WIDTH_SCALE=exports.BORDER_WIDTH_SCALE={"":1,"0":0,"2":2,"4":4,"8":8};var BORDER_RADIUS_SCALE=exports.BORDER_RADIUS_SCALE={none:0,sm:2,"":4,md:6,lg:8,xl:12,"2xl":16,"3xl":24,full:9999};var BORDER_WIDTH_PROP_MAP={t:"borderTopWidth",r:"borderRightWidth",b:"borderBottomWidth",l:"borderLeftWidth"};var BORDER_RADIUS_CORNER_MAP={tl:"borderTopLeftRadius",tr:"borderTopRightRadius",bl:"borderBottomLeftRadius",br:"borderBottomRightRadius"};var BORDER_RADIUS_SIDE_MAP={t:["borderTopLeftRadius","borderTopRightRadius"],r:["borderTopRightRadius","borderBottomRightRadius"],b:["borderBottomLeftRadius","borderBottomRightRadius"],l:["borderTopLeftRadius","borderBottomLeftRadius"]};function parseArbitraryBorderWidth(value){var pxMatch=value.match(/^\[(\d+)(?:px)?\]$/);if(pxMatch){return parseInt(pxMatch[1],10);}if(value.startsWith("[")&&value.endsWith("]")){if(process.env.NODE_ENV!=="production"){console.warn(`[react-native-tailwind] Unsupported arbitrary border width value: ${value}. Only px values are supported (e.g., [8px] or [8]).`);}return null;}return null;}function parseArbitraryBorderRadius(value){var pxMatch=value.match(/^\[(\d+)(?:px)?\]$/);if(pxMatch){return parseInt(pxMatch[1],10);}if(value.startsWith("[")&&value.endsWith("]")){if(process.env.NODE_ENV!=="production"){console.warn(`[react-native-tailwind] Unsupported arbitrary border radius value: ${value}. Only px values are supported (e.g., [12px] or [12]).`);}return null;}return null;}function parseBorder(cls,customColors){if(cls==="border-solid")return{borderStyle:"solid"};if(cls==="border-dotted")return{borderStyle:"dotted"};if(cls==="border-dashed")return{borderStyle:"dashed"};if(cls.startsWith("border-")){return parseBorderWidth(cls,customColors);}if(cls==="border"){return{borderWidth:1};}if(cls.startsWith("rounded")){return parseBorderRadius(cls);}return null;}function parseBorderWidth(cls,customColors){var dirMatch=cls.match(/^border-([trbl])(?:-(.+))?$/);if(dirMatch){var dir=dirMatch[1];var valueStr=dirMatch[2]||"";if(valueStr){var colorResult=(0,_colors.parseColor)(cls,customColors);if(colorResult!==null){return null;}}if(valueStr.startsWith("[")){var arbitraryValue=parseArbitraryBorderWidth(valueStr);if(arbitraryValue!==null){return(0,_defineProperty2.default)({},BORDER_WIDTH_PROP_MAP[dir],arbitraryValue);}return null;}var scaleValue=BORDER_WIDTH_SCALE[valueStr];if(scaleValue!==undefined){return(0,_defineProperty2.default)({},BORDER_WIDTH_PROP_MAP[dir],scaleValue);}return null;}var allMatch=cls.match(/^border-(\d+)$/);if(allMatch){var value=BORDER_WIDTH_SCALE[allMatch[1]];if(value!==undefined){return{borderWidth:value};}}var allArbMatch=cls.match(/^border-(\[.+\])$/);if(allArbMatch){var _arbitraryValue=parseArbitraryBorderWidth(allArbMatch[1]);if(_arbitraryValue!==null){return{borderWidth:_arbitraryValue};}}return null;}function parseBorderRadius(cls){var withoutPrefix=cls.substring(7);if(withoutPrefix===""){return{borderRadius:BORDER_RADIUS_SCALE[""]};}if(!withoutPrefix.startsWith("-")){return null;}var rest=withoutPrefix.substring(1);if(rest===""){return null;}var cornerMatch=rest.match(/^(tl|tr|bl|br)(?:-(.+))?$/);if(cornerMatch){var corner=cornerMatch[1];var valueStr=cornerMatch[2]||"";if(valueStr.startsWith("[")){var arbitraryValue=parseArbitraryBorderRadius(valueStr);if(arbitraryValue!==null){return(0,_defineProperty2.default)({},BORDER_RADIUS_CORNER_MAP[corner],arbitraryValue);}return null;}var _scaleValue=BORDER_RADIUS_SCALE[valueStr];if(_scaleValue!==undefined){return(0,_defineProperty2.default)({},BORDER_RADIUS_CORNER_MAP[corner],_scaleValue);}return null;}var sideMatch=rest.match(/^([trbl])(?:-(.+))?$/);if(sideMatch){var side=sideMatch[1];var _valueStr=sideMatch[2]||"";var value;if(_valueStr.startsWith("[")){var _arbitraryValue2=parseArbitraryBorderRadius(_valueStr);if(_arbitraryValue2!==null){value=_arbitraryValue2;}else{return null;}}else{value=BORDER_RADIUS_SCALE[_valueStr];}if(value!==undefined){var result={};BORDER_RADIUS_SIDE_MAP[side].forEach(function(prop){return result[prop]=value;});return result;}return null;}if(rest.startsWith("[")){var _arbitraryValue3=parseArbitraryBorderRadius(rest);if(_arbitraryValue3!==null){return{borderRadius:_arbitraryValue3};}return null;}var scaleValue=BORDER_RADIUS_SCALE[rest];if(scaleValue!==undefined){return{borderRadius:scaleValue};}return null;}
@@ -1 +1 @@
1
- var _vitest=require("vitest");var _borders=require("./borders");(0,_vitest.describe)("BORDER_WIDTH_SCALE",function(){(0,_vitest.it)("should export complete border width scale",function(){(0,_vitest.expect)(_borders.BORDER_WIDTH_SCALE).toMatchSnapshot();});});(0,_vitest.describe)("BORDER_RADIUS_SCALE",function(){(0,_vitest.it)("should export complete border radius scale",function(){(0,_vitest.expect)(_borders.BORDER_RADIUS_SCALE).toMatchSnapshot();});});(0,_vitest.describe)("parseBorder - border width all sides",function(){(0,_vitest.it)("should parse border shorthand",function(){(0,_vitest.expect)((0,_borders.parseBorder)("border")).toEqual({borderWidth:1});});(0,_vitest.it)("should parse border with preset values",function(){(0,_vitest.expect)((0,_borders.parseBorder)("border-0")).toEqual({borderWidth:0});(0,_vitest.expect)((0,_borders.parseBorder)("border-2")).toEqual({borderWidth:2});(0,_vitest.expect)((0,_borders.parseBorder)("border-4")).toEqual({borderWidth:4});(0,_vitest.expect)((0,_borders.parseBorder)("border-8")).toEqual({borderWidth:8});});(0,_vitest.it)("should parse border with arbitrary pixel values",function(){(0,_vitest.expect)((0,_borders.parseBorder)("border-[1px]")).toEqual({borderWidth:1});(0,_vitest.expect)((0,_borders.parseBorder)("border-[1]")).toEqual({borderWidth:1});(0,_vitest.expect)((0,_borders.parseBorder)("border-[3px]")).toEqual({borderWidth:3});(0,_vitest.expect)((0,_borders.parseBorder)("border-[10px]")).toEqual({borderWidth:10});});});(0,_vitest.describe)("parseBorder - border width directional",function(){(0,_vitest.it)("should parse border top",function(){(0,_vitest.expect)((0,_borders.parseBorder)("border-t")).toEqual({borderTopWidth:1});(0,_vitest.expect)((0,_borders.parseBorder)("border-t-0")).toEqual({borderTopWidth:0});(0,_vitest.expect)((0,_borders.parseBorder)("border-t-2")).toEqual({borderTopWidth:2});(0,_vitest.expect)((0,_borders.parseBorder)("border-t-4")).toEqual({borderTopWidth:4});(0,_vitest.expect)((0,_borders.parseBorder)("border-t-8")).toEqual({borderTopWidth:8});});(0,_vitest.it)("should parse border right",function(){(0,_vitest.expect)((0,_borders.parseBorder)("border-r")).toEqual({borderRightWidth:1});(0,_vitest.expect)((0,_borders.parseBorder)("border-r-0")).toEqual({borderRightWidth:0});(0,_vitest.expect)((0,_borders.parseBorder)("border-r-2")).toEqual({borderRightWidth:2});(0,_vitest.expect)((0,_borders.parseBorder)("border-r-4")).toEqual({borderRightWidth:4});});(0,_vitest.it)("should parse border bottom",function(){(0,_vitest.expect)((0,_borders.parseBorder)("border-b")).toEqual({borderBottomWidth:1});(0,_vitest.expect)((0,_borders.parseBorder)("border-b-0")).toEqual({borderBottomWidth:0});(0,_vitest.expect)((0,_borders.parseBorder)("border-b-2")).toEqual({borderBottomWidth:2});(0,_vitest.expect)((0,_borders.parseBorder)("border-b-4")).toEqual({borderBottomWidth:4});});(0,_vitest.it)("should parse border left",function(){(0,_vitest.expect)((0,_borders.parseBorder)("border-l")).toEqual({borderLeftWidth:1});(0,_vitest.expect)((0,_borders.parseBorder)("border-l-0")).toEqual({borderLeftWidth:0});(0,_vitest.expect)((0,_borders.parseBorder)("border-l-2")).toEqual({borderLeftWidth:2});(0,_vitest.expect)((0,_borders.parseBorder)("border-l-4")).toEqual({borderLeftWidth:4});});(0,_vitest.it)("should parse directional borders with arbitrary values",function(){(0,_vitest.expect)((0,_borders.parseBorder)("border-t-[3px]")).toEqual({borderTopWidth:3});(0,_vitest.expect)((0,_borders.parseBorder)("border-r-[5px]")).toEqual({borderRightWidth:5});(0,_vitest.expect)((0,_borders.parseBorder)("border-b-[7px]")).toEqual({borderBottomWidth:7});(0,_vitest.expect)((0,_borders.parseBorder)("border-l-[9px]")).toEqual({borderLeftWidth:9});});});(0,_vitest.describe)("parseBorder - border style",function(){(0,_vitest.it)("should parse border styles",function(){(0,_vitest.expect)((0,_borders.parseBorder)("border-solid")).toEqual({borderStyle:"solid"});(0,_vitest.expect)((0,_borders.parseBorder)("border-dotted")).toEqual({borderStyle:"dotted"});(0,_vitest.expect)((0,_borders.parseBorder)("border-dashed")).toEqual({borderStyle:"dashed"});});});(0,_vitest.describe)("parseBorder - border radius all corners",function(){(0,_vitest.it)("should parse rounded shorthand",function(){(0,_vitest.expect)((0,_borders.parseBorder)("rounded")).toEqual({borderRadius:4});});(0,_vitest.it)("should parse rounded with preset values",function(){(0,_vitest.expect)((0,_borders.parseBorder)("rounded-none")).toEqual({borderRadius:0});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-sm")).toEqual({borderRadius:2});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-md")).toEqual({borderRadius:6});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-lg")).toEqual({borderRadius:8});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-xl")).toEqual({borderRadius:12});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-2xl")).toEqual({borderRadius:16});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-3xl")).toEqual({borderRadius:24});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-full")).toEqual({borderRadius:9999});});(0,_vitest.it)("should parse rounded with arbitrary pixel values",function(){(0,_vitest.expect)((0,_borders.parseBorder)("rounded-[5px]")).toEqual({borderRadius:5});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-[10px]")).toEqual({borderRadius:10});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-[15]")).toEqual({borderRadius:15});});});(0,_vitest.describe)("parseBorder - border radius sides",function(){(0,_vitest.it)("should parse rounded top",function(){(0,_vitest.expect)((0,_borders.parseBorder)("rounded-t")).toEqual({borderTopLeftRadius:4,borderTopRightRadius:4});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-t-lg")).toEqual({borderTopLeftRadius:8,borderTopRightRadius:8});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-t-[12px]")).toEqual({borderTopLeftRadius:12,borderTopRightRadius:12});});(0,_vitest.it)("should parse rounded right",function(){(0,_vitest.expect)((0,_borders.parseBorder)("rounded-r")).toEqual({borderTopRightRadius:4,borderBottomRightRadius:4});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-r-lg")).toEqual({borderTopRightRadius:8,borderBottomRightRadius:8});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-r-[12px]")).toEqual({borderTopRightRadius:12,borderBottomRightRadius:12});});(0,_vitest.it)("should parse rounded bottom",function(){(0,_vitest.expect)((0,_borders.parseBorder)("rounded-b")).toEqual({borderBottomLeftRadius:4,borderBottomRightRadius:4});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-b-lg")).toEqual({borderBottomLeftRadius:8,borderBottomRightRadius:8});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-b-[12px]")).toEqual({borderBottomLeftRadius:12,borderBottomRightRadius:12});});(0,_vitest.it)("should parse rounded left",function(){(0,_vitest.expect)((0,_borders.parseBorder)("rounded-l")).toEqual({borderTopLeftRadius:4,borderBottomLeftRadius:4});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-l-lg")).toEqual({borderTopLeftRadius:8,borderBottomLeftRadius:8});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-l-[12px]")).toEqual({borderTopLeftRadius:12,borderBottomLeftRadius:12});});});(0,_vitest.describe)("parseBorder - border radius specific corners",function(){(0,_vitest.it)("should parse rounded top-left",function(){(0,_vitest.expect)((0,_borders.parseBorder)("rounded-tl")).toEqual({borderTopLeftRadius:4});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-tl-lg")).toEqual({borderTopLeftRadius:8});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-tl-[12px]")).toEqual({borderTopLeftRadius:12});});(0,_vitest.it)("should parse rounded top-right",function(){(0,_vitest.expect)((0,_borders.parseBorder)("rounded-tr")).toEqual({borderTopRightRadius:4});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-tr-lg")).toEqual({borderTopRightRadius:8});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-tr-[12px]")).toEqual({borderTopRightRadius:12});});(0,_vitest.it)("should parse rounded bottom-left",function(){(0,_vitest.expect)((0,_borders.parseBorder)("rounded-bl")).toEqual({borderBottomLeftRadius:4});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-bl-lg")).toEqual({borderBottomLeftRadius:8});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-bl-[12px]")).toEqual({borderBottomLeftRadius:12});});(0,_vitest.it)("should parse rounded bottom-right",function(){(0,_vitest.expect)((0,_borders.parseBorder)("rounded-br")).toEqual({borderBottomRightRadius:4});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-br-lg")).toEqual({borderBottomRightRadius:8});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-br-[12px]")).toEqual({borderBottomRightRadius:12});});});(0,_vitest.describe)("parseBorder - edge cases",function(){(0,_vitest.it)("should return null for invalid classes",function(){(0,_vitest.expect)((0,_borders.parseBorder)("invalid")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("border-")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("rounded-")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("borders-4")).toBeNull();});(0,_vitest.it)("should return null for invalid border width values",function(){(0,_vitest.expect)((0,_borders.parseBorder)("border-invalid")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("border-3")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("border-16")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("border-t-3")).toBeNull();});(0,_vitest.it)("should return null for invalid border radius values",function(){(0,_vitest.expect)((0,_borders.parseBorder)("rounded-invalid")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("rounded-4xl")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("rounded-t-invalid")).toBeNull();});(0,_vitest.it)("should return null for arbitrary values with unsupported units",function(){(0,_vitest.expect)((0,_borders.parseBorder)("border-[2rem]")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("border-[1em]")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("rounded-[2rem]")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("rounded-[1em]")).toBeNull();});(0,_vitest.it)("should return null for malformed arbitrary values",function(){(0,_vitest.expect)((0,_borders.parseBorder)("border-[8")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("border-8]")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("border-[]")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("rounded-[12")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("rounded-12]")).toBeNull();});(0,_vitest.it)("should handle edge case values",function(){(0,_vitest.expect)((0,_borders.parseBorder)("border-0")).toEqual({borderWidth:0});(0,_vitest.expect)((0,_borders.parseBorder)("border-t-0")).toEqual({borderTopWidth:0});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-none")).toEqual({borderRadius:0});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-full")).toEqual({borderRadius:9999});});(0,_vitest.it)("should not match partial class names",function(){(0,_vitest.expect)((0,_borders.parseBorder)("myborder-4")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("border-solid-extra")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("myrounded-lg")).toBeNull();});});(0,_vitest.describe)("parseBorder - comprehensive coverage",function(){(0,_vitest.it)("should handle all border width directions with same value",function(){(0,_vitest.expect)((0,_borders.parseBorder)("border-2")).toEqual({borderWidth:2});(0,_vitest.expect)((0,_borders.parseBorder)("border-t-2")).toEqual({borderTopWidth:2});(0,_vitest.expect)((0,_borders.parseBorder)("border-r-2")).toEqual({borderRightWidth:2});(0,_vitest.expect)((0,_borders.parseBorder)("border-b-2")).toEqual({borderBottomWidth:2});(0,_vitest.expect)((0,_borders.parseBorder)("border-l-2")).toEqual({borderLeftWidth:2});});(0,_vitest.it)("should handle all border radius types with same value",function(){(0,_vitest.expect)((0,_borders.parseBorder)("rounded-lg")).toEqual({borderRadius:8});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-t-lg")).toEqual({borderTopLeftRadius:8,borderTopRightRadius:8});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-r-lg")).toEqual({borderTopRightRadius:8,borderBottomRightRadius:8});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-b-lg")).toEqual({borderBottomLeftRadius:8,borderBottomRightRadius:8});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-l-lg")).toEqual({borderTopLeftRadius:8,borderBottomLeftRadius:8});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-tl-lg")).toEqual({borderTopLeftRadius:8});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-tr-lg")).toEqual({borderTopRightRadius:8});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-bl-lg")).toEqual({borderBottomLeftRadius:8});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-br-lg")).toEqual({borderBottomRightRadius:8});});(0,_vitest.it)("should handle arbitrary values across all border width types",function(){(0,_vitest.expect)((0,_borders.parseBorder)("border-[5px]")).toEqual({borderWidth:5});(0,_vitest.expect)((0,_borders.parseBorder)("border-t-[5px]")).toEqual({borderTopWidth:5});(0,_vitest.expect)((0,_borders.parseBorder)("border-r-[5px]")).toEqual({borderRightWidth:5});(0,_vitest.expect)((0,_borders.parseBorder)("border-b-[5px]")).toEqual({borderBottomWidth:5});(0,_vitest.expect)((0,_borders.parseBorder)("border-l-[5px]")).toEqual({borderLeftWidth:5});});(0,_vitest.it)("should handle arbitrary values across all border radius types",function(){(0,_vitest.expect)((0,_borders.parseBorder)("rounded-[10px]")).toEqual({borderRadius:10});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-t-[10px]")).toEqual({borderTopLeftRadius:10,borderTopRightRadius:10});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-tl-[10px]")).toEqual({borderTopLeftRadius:10});});(0,_vitest.it)("should handle all border styles",function(){(0,_vitest.expect)((0,_borders.parseBorder)("border-solid")).toEqual({borderStyle:"solid"});(0,_vitest.expect)((0,_borders.parseBorder)("border-dotted")).toEqual({borderStyle:"dotted"});(0,_vitest.expect)((0,_borders.parseBorder)("border-dashed")).toEqual({borderStyle:"dashed"});});(0,_vitest.it)("should handle shorthand classes correctly",function(){(0,_vitest.expect)((0,_borders.parseBorder)("border")).toEqual({borderWidth:1});(0,_vitest.expect)((0,_borders.parseBorder)("rounded")).toEqual({borderRadius:4});(0,_vitest.expect)((0,_borders.parseBorder)("border-t")).toEqual({borderTopWidth:1});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-t")).toEqual({borderTopLeftRadius:4,borderTopRightRadius:4});});});
1
+ var _vitest=require("vitest");var _borders=require("./borders");(0,_vitest.describe)("BORDER_WIDTH_SCALE",function(){(0,_vitest.it)("should export complete border width scale",function(){(0,_vitest.expect)(_borders.BORDER_WIDTH_SCALE).toMatchSnapshot();});});(0,_vitest.describe)("BORDER_RADIUS_SCALE",function(){(0,_vitest.it)("should export complete border radius scale",function(){(0,_vitest.expect)(_borders.BORDER_RADIUS_SCALE).toMatchSnapshot();});});(0,_vitest.describe)("parseBorder - border width all sides",function(){(0,_vitest.it)("should parse border shorthand",function(){(0,_vitest.expect)((0,_borders.parseBorder)("border")).toEqual({borderWidth:1});});(0,_vitest.it)("should parse border with preset values",function(){(0,_vitest.expect)((0,_borders.parseBorder)("border-0")).toEqual({borderWidth:0});(0,_vitest.expect)((0,_borders.parseBorder)("border-2")).toEqual({borderWidth:2});(0,_vitest.expect)((0,_borders.parseBorder)("border-4")).toEqual({borderWidth:4});(0,_vitest.expect)((0,_borders.parseBorder)("border-8")).toEqual({borderWidth:8});});(0,_vitest.it)("should parse border with arbitrary pixel values",function(){(0,_vitest.expect)((0,_borders.parseBorder)("border-[1px]")).toEqual({borderWidth:1});(0,_vitest.expect)((0,_borders.parseBorder)("border-[1]")).toEqual({borderWidth:1});(0,_vitest.expect)((0,_borders.parseBorder)("border-[3px]")).toEqual({borderWidth:3});(0,_vitest.expect)((0,_borders.parseBorder)("border-[10px]")).toEqual({borderWidth:10});});});(0,_vitest.describe)("parseBorder - border width directional",function(){(0,_vitest.it)("should parse border top",function(){(0,_vitest.expect)((0,_borders.parseBorder)("border-t")).toEqual({borderTopWidth:1});(0,_vitest.expect)((0,_borders.parseBorder)("border-t-0")).toEqual({borderTopWidth:0});(0,_vitest.expect)((0,_borders.parseBorder)("border-t-2")).toEqual({borderTopWidth:2});(0,_vitest.expect)((0,_borders.parseBorder)("border-t-4")).toEqual({borderTopWidth:4});(0,_vitest.expect)((0,_borders.parseBorder)("border-t-8")).toEqual({borderTopWidth:8});});(0,_vitest.it)("should parse border right",function(){(0,_vitest.expect)((0,_borders.parseBorder)("border-r")).toEqual({borderRightWidth:1});(0,_vitest.expect)((0,_borders.parseBorder)("border-r-0")).toEqual({borderRightWidth:0});(0,_vitest.expect)((0,_borders.parseBorder)("border-r-2")).toEqual({borderRightWidth:2});(0,_vitest.expect)((0,_borders.parseBorder)("border-r-4")).toEqual({borderRightWidth:4});});(0,_vitest.it)("should parse border bottom",function(){(0,_vitest.expect)((0,_borders.parseBorder)("border-b")).toEqual({borderBottomWidth:1});(0,_vitest.expect)((0,_borders.parseBorder)("border-b-0")).toEqual({borderBottomWidth:0});(0,_vitest.expect)((0,_borders.parseBorder)("border-b-2")).toEqual({borderBottomWidth:2});(0,_vitest.expect)((0,_borders.parseBorder)("border-b-4")).toEqual({borderBottomWidth:4});});(0,_vitest.it)("should parse border left",function(){(0,_vitest.expect)((0,_borders.parseBorder)("border-l")).toEqual({borderLeftWidth:1});(0,_vitest.expect)((0,_borders.parseBorder)("border-l-0")).toEqual({borderLeftWidth:0});(0,_vitest.expect)((0,_borders.parseBorder)("border-l-2")).toEqual({borderLeftWidth:2});(0,_vitest.expect)((0,_borders.parseBorder)("border-l-4")).toEqual({borderLeftWidth:4});});(0,_vitest.it)("should parse directional borders with arbitrary values",function(){(0,_vitest.expect)((0,_borders.parseBorder)("border-t-[3px]")).toEqual({borderTopWidth:3});(0,_vitest.expect)((0,_borders.parseBorder)("border-r-[5px]")).toEqual({borderRightWidth:5});(0,_vitest.expect)((0,_borders.parseBorder)("border-b-[7px]")).toEqual({borderBottomWidth:7});(0,_vitest.expect)((0,_borders.parseBorder)("border-l-[9px]")).toEqual({borderLeftWidth:9});});});(0,_vitest.describe)("parseBorder - border style",function(){(0,_vitest.it)("should parse border styles",function(){(0,_vitest.expect)((0,_borders.parseBorder)("border-solid")).toEqual({borderStyle:"solid"});(0,_vitest.expect)((0,_borders.parseBorder)("border-dotted")).toEqual({borderStyle:"dotted"});(0,_vitest.expect)((0,_borders.parseBorder)("border-dashed")).toEqual({borderStyle:"dashed"});});});(0,_vitest.describe)("parseBorder - border radius all corners",function(){(0,_vitest.it)("should parse rounded shorthand",function(){(0,_vitest.expect)((0,_borders.parseBorder)("rounded")).toEqual({borderRadius:4});});(0,_vitest.it)("should parse rounded with preset values",function(){(0,_vitest.expect)((0,_borders.parseBorder)("rounded-none")).toEqual({borderRadius:0});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-sm")).toEqual({borderRadius:2});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-md")).toEqual({borderRadius:6});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-lg")).toEqual({borderRadius:8});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-xl")).toEqual({borderRadius:12});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-2xl")).toEqual({borderRadius:16});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-3xl")).toEqual({borderRadius:24});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-full")).toEqual({borderRadius:9999});});(0,_vitest.it)("should parse rounded with arbitrary pixel values",function(){(0,_vitest.expect)((0,_borders.parseBorder)("rounded-[5px]")).toEqual({borderRadius:5});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-[10px]")).toEqual({borderRadius:10});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-[15]")).toEqual({borderRadius:15});});});(0,_vitest.describe)("parseBorder - border radius sides",function(){(0,_vitest.it)("should parse rounded top",function(){(0,_vitest.expect)((0,_borders.parseBorder)("rounded-t")).toEqual({borderTopLeftRadius:4,borderTopRightRadius:4});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-t-lg")).toEqual({borderTopLeftRadius:8,borderTopRightRadius:8});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-t-[12px]")).toEqual({borderTopLeftRadius:12,borderTopRightRadius:12});});(0,_vitest.it)("should parse rounded right",function(){(0,_vitest.expect)((0,_borders.parseBorder)("rounded-r")).toEqual({borderTopRightRadius:4,borderBottomRightRadius:4});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-r-lg")).toEqual({borderTopRightRadius:8,borderBottomRightRadius:8});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-r-[12px]")).toEqual({borderTopRightRadius:12,borderBottomRightRadius:12});});(0,_vitest.it)("should parse rounded bottom",function(){(0,_vitest.expect)((0,_borders.parseBorder)("rounded-b")).toEqual({borderBottomLeftRadius:4,borderBottomRightRadius:4});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-b-lg")).toEqual({borderBottomLeftRadius:8,borderBottomRightRadius:8});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-b-[12px]")).toEqual({borderBottomLeftRadius:12,borderBottomRightRadius:12});});(0,_vitest.it)("should parse rounded left",function(){(0,_vitest.expect)((0,_borders.parseBorder)("rounded-l")).toEqual({borderTopLeftRadius:4,borderBottomLeftRadius:4});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-l-lg")).toEqual({borderTopLeftRadius:8,borderBottomLeftRadius:8});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-l-[12px]")).toEqual({borderTopLeftRadius:12,borderBottomLeftRadius:12});});});(0,_vitest.describe)("parseBorder - border radius specific corners",function(){(0,_vitest.it)("should parse rounded top-left",function(){(0,_vitest.expect)((0,_borders.parseBorder)("rounded-tl")).toEqual({borderTopLeftRadius:4});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-tl-lg")).toEqual({borderTopLeftRadius:8});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-tl-[12px]")).toEqual({borderTopLeftRadius:12});});(0,_vitest.it)("should parse rounded top-right",function(){(0,_vitest.expect)((0,_borders.parseBorder)("rounded-tr")).toEqual({borderTopRightRadius:4});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-tr-lg")).toEqual({borderTopRightRadius:8});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-tr-[12px]")).toEqual({borderTopRightRadius:12});});(0,_vitest.it)("should parse rounded bottom-left",function(){(0,_vitest.expect)((0,_borders.parseBorder)("rounded-bl")).toEqual({borderBottomLeftRadius:4});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-bl-lg")).toEqual({borderBottomLeftRadius:8});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-bl-[12px]")).toEqual({borderBottomLeftRadius:12});});(0,_vitest.it)("should parse rounded bottom-right",function(){(0,_vitest.expect)((0,_borders.parseBorder)("rounded-br")).toEqual({borderBottomRightRadius:4});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-br-lg")).toEqual({borderBottomRightRadius:8});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-br-[12px]")).toEqual({borderBottomRightRadius:12});});});(0,_vitest.describe)("parseBorder - edge cases",function(){(0,_vitest.it)("should return null for invalid classes",function(){(0,_vitest.expect)((0,_borders.parseBorder)("invalid")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("border-")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("rounded-")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("borders-4")).toBeNull();});(0,_vitest.it)("should return null for invalid border width values",function(){(0,_vitest.expect)((0,_borders.parseBorder)("border-invalid")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("border-3")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("border-16")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("border-t-3")).toBeNull();});(0,_vitest.it)("should return null for invalid border radius values",function(){(0,_vitest.expect)((0,_borders.parseBorder)("rounded-invalid")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("rounded-4xl")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("rounded-t-invalid")).toBeNull();});(0,_vitest.it)("should return null for arbitrary values with unsupported units",function(){(0,_vitest.expect)((0,_borders.parseBorder)("border-[2rem]")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("border-[1em]")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("rounded-[2rem]")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("rounded-[1em]")).toBeNull();});(0,_vitest.it)("should return null for malformed arbitrary values",function(){(0,_vitest.expect)((0,_borders.parseBorder)("border-[8")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("border-8]")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("border-[]")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("rounded-[12")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("rounded-12]")).toBeNull();});(0,_vitest.it)("should handle edge case values",function(){(0,_vitest.expect)((0,_borders.parseBorder)("border-0")).toEqual({borderWidth:0});(0,_vitest.expect)((0,_borders.parseBorder)("border-t-0")).toEqual({borderTopWidth:0});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-none")).toEqual({borderRadius:0});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-full")).toEqual({borderRadius:9999});});(0,_vitest.it)("should not match partial class names",function(){(0,_vitest.expect)((0,_borders.parseBorder)("myborder-4")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("border-solid-extra")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("myrounded-lg")).toBeNull();});});(0,_vitest.describe)("parseBorder - comprehensive coverage",function(){(0,_vitest.it)("should handle all border width directions with same value",function(){(0,_vitest.expect)((0,_borders.parseBorder)("border-2")).toEqual({borderWidth:2});(0,_vitest.expect)((0,_borders.parseBorder)("border-t-2")).toEqual({borderTopWidth:2});(0,_vitest.expect)((0,_borders.parseBorder)("border-r-2")).toEqual({borderRightWidth:2});(0,_vitest.expect)((0,_borders.parseBorder)("border-b-2")).toEqual({borderBottomWidth:2});(0,_vitest.expect)((0,_borders.parseBorder)("border-l-2")).toEqual({borderLeftWidth:2});});(0,_vitest.it)("should handle all border radius types with same value",function(){(0,_vitest.expect)((0,_borders.parseBorder)("rounded-lg")).toEqual({borderRadius:8});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-t-lg")).toEqual({borderTopLeftRadius:8,borderTopRightRadius:8});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-r-lg")).toEqual({borderTopRightRadius:8,borderBottomRightRadius:8});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-b-lg")).toEqual({borderBottomLeftRadius:8,borderBottomRightRadius:8});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-l-lg")).toEqual({borderTopLeftRadius:8,borderBottomLeftRadius:8});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-tl-lg")).toEqual({borderTopLeftRadius:8});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-tr-lg")).toEqual({borderTopRightRadius:8});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-bl-lg")).toEqual({borderBottomLeftRadius:8});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-br-lg")).toEqual({borderBottomRightRadius:8});});(0,_vitest.it)("should handle arbitrary values across all border width types",function(){(0,_vitest.expect)((0,_borders.parseBorder)("border-[5px]")).toEqual({borderWidth:5});(0,_vitest.expect)((0,_borders.parseBorder)("border-t-[5px]")).toEqual({borderTopWidth:5});(0,_vitest.expect)((0,_borders.parseBorder)("border-r-[5px]")).toEqual({borderRightWidth:5});(0,_vitest.expect)((0,_borders.parseBorder)("border-b-[5px]")).toEqual({borderBottomWidth:5});(0,_vitest.expect)((0,_borders.parseBorder)("border-l-[5px]")).toEqual({borderLeftWidth:5});});(0,_vitest.it)("should handle arbitrary values across all border radius types",function(){(0,_vitest.expect)((0,_borders.parseBorder)("rounded-[10px]")).toEqual({borderRadius:10});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-t-[10px]")).toEqual({borderTopLeftRadius:10,borderTopRightRadius:10});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-tl-[10px]")).toEqual({borderTopLeftRadius:10});});(0,_vitest.it)("should handle all border styles",function(){(0,_vitest.expect)((0,_borders.parseBorder)("border-solid")).toEqual({borderStyle:"solid"});(0,_vitest.expect)((0,_borders.parseBorder)("border-dotted")).toEqual({borderStyle:"dotted"});(0,_vitest.expect)((0,_borders.parseBorder)("border-dashed")).toEqual({borderStyle:"dashed"});});(0,_vitest.it)("should handle shorthand classes correctly",function(){(0,_vitest.expect)((0,_borders.parseBorder)("border")).toEqual({borderWidth:1});(0,_vitest.expect)((0,_borders.parseBorder)("rounded")).toEqual({borderRadius:4});(0,_vitest.expect)((0,_borders.parseBorder)("border-t")).toEqual({borderTopWidth:1});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-t")).toEqual({borderTopLeftRadius:4,borderTopRightRadius:4});});});(0,_vitest.describe)("parseBorder - color pattern detection",function(){(0,_vitest.it)("should return null for directional border colors with preset values",function(){(0,_vitest.expect)((0,_borders.parseBorder)("border-t-red-500")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("border-r-blue-500")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("border-b-green-500")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("border-l-yellow-500")).toBeNull();});(0,_vitest.it)("should return null for directional border colors with basic values",function(){(0,_vitest.expect)((0,_borders.parseBorder)("border-t-white")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("border-r-black")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("border-b-transparent")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("border-l-white")).toBeNull();});(0,_vitest.it)("should return null for directional border colors with arbitrary hex values",function(){(0,_vitest.expect)((0,_borders.parseBorder)("border-t-[#ff0000]")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("border-r-[#3B82F6]")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("border-b-[#abc]")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("border-l-[#00FF00AA]")).toBeNull();});(0,_vitest.it)("should return null for directional border colors with opacity",function(){(0,_vitest.expect)((0,_borders.parseBorder)("border-t-red-500/50")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("border-r-blue-500/80")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("border-b-[#ff0000]/60")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("border-l-black/25")).toBeNull();});(0,_vitest.it)("should return null for directional border colors with custom colors",function(){(0,_vitest.expect)((0,_borders.parseBorder)("border-t-brand-primary")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("border-r-accent")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("border-b-brand-secondary")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("border-l-custom")).toBeNull();});(0,_vitest.it)("should still handle directional border widths correctly",function(){(0,_vitest.expect)((0,_borders.parseBorder)("border-t-2")).toEqual({borderTopWidth:2});(0,_vitest.expect)((0,_borders.parseBorder)("border-r-4")).toEqual({borderRightWidth:4});(0,_vitest.expect)((0,_borders.parseBorder)("border-b-8")).toEqual({borderBottomWidth:8});(0,_vitest.expect)((0,_borders.parseBorder)("border-l-0")).toEqual({borderLeftWidth:0});});(0,_vitest.it)("should still handle directional border width arbitrary values",function(){(0,_vitest.expect)((0,_borders.parseBorder)("border-t-[3px]")).toEqual({borderTopWidth:3});(0,_vitest.expect)((0,_borders.parseBorder)("border-r-[5px]")).toEqual({borderRightWidth:5});(0,_vitest.expect)((0,_borders.parseBorder)("border-b-[10]")).toEqual({borderBottomWidth:10});(0,_vitest.expect)((0,_borders.parseBorder)("border-l-[8px]")).toEqual({borderLeftWidth:8});});});
@@ -1 +1 @@
1
- Object.defineProperty(exports,"__esModule",{value:true});exports.COLORS=void 0;exports.parseColor=parseColor;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};}}return null;}
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 +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();});});});
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();});});
@@ -9,6 +9,7 @@ import type { StyleObject } from "../types";
9
9
  export type CustomTheme = {
10
10
  colors?: Record<string, string>;
11
11
  fontFamily?: Record<string, string>;
12
+ fontSize?: Record<string, number>;
12
13
  };
13
14
  /**
14
15
  * Parse a className string and return a React Native style object
@@ -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,"isPlatformModifier",{enumerable:true,get:function get(){return _modifiers.isPlatformModifier;}});Object.defineProperty(exports,"isSchemeModifier",{enumerable:true,get:function get(){return _modifiers.isSchemeModifier;}});Object.defineProperty(exports,"isStateModifier",{enumerable:true,get:function get(){return _modifiers.isStateModifier;}});Object.defineProperty(exports,"parseAspectRatio",{enumerable:true,get:function get(){return _aspectRatio.parseAspectRatio;}});Object.defineProperty(exports,"parseBorder",{enumerable:true,get:function get(){return _borders.parseBorder;}});exports.parseClass=parseClass;exports.parseClassName=parseClassName;Object.defineProperty(exports,"parseColor",{enumerable:true,get:function get(){return _colors.parseColor;}});Object.defineProperty(exports,"parseLayout",{enumerable:true,get:function get(){return _layout.parseLayout;}});Object.defineProperty(exports,"parseModifier",{enumerable:true,get:function get(){return _modifiers.parseModifier;}});Object.defineProperty(exports,"parsePlaceholderClass",{enumerable:true,get:function get(){return _placeholder.parsePlaceholderClass;}});Object.defineProperty(exports,"parsePlaceholderClasses",{enumerable:true,get:function get(){return _placeholder.parsePlaceholderClasses;}});Object.defineProperty(exports,"parseShadow",{enumerable:true,get:function get(){return _shadows.parseShadow;}});Object.defineProperty(exports,"parseSizing",{enumerable:true,get:function get(){return _sizing.parseSizing;}});Object.defineProperty(exports,"parseSpacing",{enumerable:true,get:function get(){return _spacing.parseSpacing;}});Object.defineProperty(exports,"parseTransform",{enumerable:true,get:function get(){return _transforms.parseTransform;}});Object.defineProperty(exports,"parseTypography",{enumerable:true,get:function get(){return _typography.parseTypography;}});Object.defineProperty(exports,"splitModifierClasses",{enumerable:true,get:function get(){return _modifiers.splitModifierClasses;}});var _aspectRatio=require("./aspectRatio");var _borders=require("./borders");var _colors=require("./colors");var _layout=require("./layout");var _shadows=require("./shadows");var _sizing=require("./sizing");var _spacing=require("./spacing");var _transforms=require("./transforms");var _typography=require("./typography");var _placeholder=require("./placeholder");var _modifiers=require("./modifiers");function parseClassName(className,customTheme){var classes=className.split(/\s+/).filter(Boolean);var style={};for(var cls of classes){var parsedStyle=parseClass(cls,customTheme);Object.assign(style,parsedStyle);}return style;}function parseClass(cls,customTheme){var parsers=[_spacing.parseSpacing,_borders.parseBorder,function(cls){return(0,_colors.parseColor)(cls,customTheme==null?void 0:customTheme.colors);},_layout.parseLayout,function(cls){return(0,_typography.parseTypography)(cls,customTheme==null?void 0:customTheme.fontFamily);},_sizing.parseSizing,_shadows.parseShadow,_aspectRatio.parseAspectRatio,_transforms.parseTransform];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,"isPlatformModifier",{enumerable:true,get:function get(){return _modifiers.isPlatformModifier;}});Object.defineProperty(exports,"isSchemeModifier",{enumerable:true,get:function get(){return _modifiers.isSchemeModifier;}});Object.defineProperty(exports,"isStateModifier",{enumerable:true,get:function get(){return _modifiers.isStateModifier;}});Object.defineProperty(exports,"parseAspectRatio",{enumerable:true,get:function get(){return _aspectRatio.parseAspectRatio;}});Object.defineProperty(exports,"parseBorder",{enumerable:true,get:function get(){return _borders.parseBorder;}});exports.parseClass=parseClass;exports.parseClassName=parseClassName;Object.defineProperty(exports,"parseColor",{enumerable:true,get:function get(){return _colors.parseColor;}});Object.defineProperty(exports,"parseLayout",{enumerable:true,get:function get(){return _layout.parseLayout;}});Object.defineProperty(exports,"parseModifier",{enumerable:true,get:function get(){return _modifiers.parseModifier;}});Object.defineProperty(exports,"parsePlaceholderClass",{enumerable:true,get:function get(){return _placeholder.parsePlaceholderClass;}});Object.defineProperty(exports,"parsePlaceholderClasses",{enumerable:true,get:function get(){return _placeholder.parsePlaceholderClasses;}});Object.defineProperty(exports,"parseShadow",{enumerable:true,get:function get(){return _shadows.parseShadow;}});Object.defineProperty(exports,"parseSizing",{enumerable:true,get:function get(){return _sizing.parseSizing;}});Object.defineProperty(exports,"parseSpacing",{enumerable:true,get:function get(){return _spacing.parseSpacing;}});Object.defineProperty(exports,"parseTransform",{enumerable:true,get:function get(){return _transforms.parseTransform;}});Object.defineProperty(exports,"parseTypography",{enumerable:true,get:function get(){return _typography.parseTypography;}});Object.defineProperty(exports,"splitModifierClasses",{enumerable:true,get:function get(){return _modifiers.splitModifierClasses;}});var _aspectRatio=require("./aspectRatio");var _borders=require("./borders");var _colors=require("./colors");var _layout=require("./layout");var _shadows=require("./shadows");var _sizing=require("./sizing");var _spacing=require("./spacing");var _transforms=require("./transforms");var _typography=require("./typography");var _placeholder=require("./placeholder");var _modifiers=require("./modifiers");function parseClassName(className,customTheme){var classes=className.split(/\s+/).filter(Boolean);var style={};for(var cls of classes){var parsedStyle=parseClass(cls,customTheme);Object.assign(style,parsedStyle);}return style;}function parseClass(cls,customTheme){var parsers=[_spacing.parseSpacing,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);},_layout.parseLayout,function(cls){return(0,_typography.parseTypography)(cls,customTheme==null?void 0:customTheme.fontFamily,customTheme==null?void 0:customTheme.fontSize);},_sizing.parseSizing,_shadows.parseShadow,_aspectRatio.parseAspectRatio,_transforms.parseTransform];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
- Object.defineProperty(exports,"__esModule",{value:true});exports.Z_INDEX_SCALE=exports.INSET_SCALE=void 0;exports.parseLayout=parseLayout;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;}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}};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){var _ref,_ref2,_ref3,_ref4,_ref5,_ref6,_ref7,_ref8,_ref9,_ref0,_ref1,_DISPLAY_MAP$cls;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=INSET_SCALE[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=INSET_SCALE[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=INSET_SCALE[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=INSET_SCALE[leftKey];if(leftValue!==undefined){return{left:leftValue};}}if(cls.startsWith("inset-x-")){var insetKey=cls.substring(8);var arbitraryInset=parseArbitraryInset(insetKey);if(arbitraryInset!==null){return{left:arbitraryInset,right:arbitraryInset};}var insetValue=INSET_SCALE[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=INSET_SCALE[_insetKey];if(_insetValue!==undefined){return{top:_insetValue,bottom:_insetValue};}}if(cls.startsWith("inset-")){var _insetKey2=cls.substring(6);var _arbitraryInset2=parseArbitraryInset(_insetKey2);if(_arbitraryInset2!==null){return{top:_arbitraryInset2,right:_arbitraryInset2,bottom:_arbitraryInset2,left:_arbitraryInset2};}var _insetValue2=INSET_SCALE[_insetKey2];if(_insetValue2!==undefined){return{top:_insetValue2,right:_insetValue2,bottom:_insetValue2,left:_insetValue2};}}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
+ Object.defineProperty(exports,"__esModule",{value:true});exports.Z_INDEX_SCALE=exports.INSET_SCALE=void 0;exports.parseLayout=parseLayout;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){var _ref,_ref2,_ref3,_ref4,_ref5,_ref6,_ref7,_ref8,_ref9,_ref0,_ref1,_DISPLAY_MAP$cls;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=INSET_SCALE[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=INSET_SCALE[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=INSET_SCALE[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=INSET_SCALE[leftKey];if(leftValue!==undefined){return{left:leftValue};}}if(cls.startsWith("inset-x-")){var insetKey=cls.substring(8);var arbitraryInset=parseArbitraryInset(insetKey);if(arbitraryInset!==null){return{left:arbitraryInset,right:arbitraryInset};}var insetValue=INSET_SCALE[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=INSET_SCALE[_insetKey];if(_insetValue!==undefined){return{top:_insetValue,bottom:_insetValue};}}if(cls.startsWith("inset-")){var _insetKey2=cls.substring(6);var _arbitraryInset2=parseArbitraryInset(_insetKey2);if(_arbitraryInset2!==null){return{top:_arbitraryInset2,right:_arbitraryInset2,bottom:_arbitraryInset2,left:_arbitraryInset2};}var _insetValue2=INSET_SCALE[_insetKey2];if(_insetValue2!==undefined){return{top:_insetValue2,right:_insetValue2,bottom:_insetValue2,left:_insetValue2};}}if(cls.startsWith("grow-")||cls.startsWith("flex-grow-")){var prefix=cls.startsWith("flex-grow-")?"flex-grow-":"grow-";var growKey=cls.substring(prefix.length);var arbitraryGrow=parseArbitraryGrowShrink(growKey);if(arbitraryGrow!==null){return{flexGrow:arbitraryGrow};}}if(cls.startsWith("shrink-")||cls.startsWith("flex-shrink-")){var _prefix=cls.startsWith("flex-shrink-")?"flex-shrink-":"shrink-";var shrinkKey=cls.substring(_prefix.length);var arbitraryShrink=parseArbitraryGrowShrink(shrinkKey);if(arbitraryShrink!==null){return{flexShrink:arbitraryShrink};}}return(_ref=(_ref2=(_ref3=(_ref4=(_ref5=(_ref6=(_ref7=(_ref8=(_ref9=(_ref0=(_ref1=(_DISPLAY_MAP$cls=DISPLAY_MAP[cls])!=null?_DISPLAY_MAP$cls:FLEX_DIRECTION_MAP[cls])!=null?_ref1:FLEX_WRAP_MAP[cls])!=null?_ref0:FLEX_MAP[cls])!=null?_ref9:GROW_SHRINK_MAP[cls])!=null?_ref8:JUSTIFY_CONTENT_MAP[cls])!=null?_ref7:ALIGN_ITEMS_MAP[cls])!=null?_ref6:ALIGN_SELF_MAP[cls])!=null?_ref5:ALIGN_CONTENT_MAP[cls])!=null?_ref4:POSITION_MAP[cls])!=null?_ref3:OVERFLOW_MAP[cls])!=null?_ref2:OPACITY_MAP[cls])!=null?_ref:null;}
@@ -1 +1 @@
1
- var _vitest=require("vitest");var _layout=require("./layout");(0,_vitest.describe)("parseLayout - display utilities",function(){(0,_vitest.it)("should parse display flex",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex")).toEqual({display:"flex"});});(0,_vitest.it)("should parse display hidden",function(){(0,_vitest.expect)((0,_layout.parseLayout)("hidden")).toEqual({display:"none"});});});(0,_vitest.describe)("parseLayout - flex direction utilities",function(){(0,_vitest.it)("should parse flex row",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-row")).toEqual({flexDirection:"row"});});(0,_vitest.it)("should parse flex row reverse",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-row-reverse")).toEqual({flexDirection:"row-reverse"});});(0,_vitest.it)("should parse flex column",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-col")).toEqual({flexDirection:"column"});});(0,_vitest.it)("should parse flex column reverse",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-col-reverse")).toEqual({flexDirection:"column-reverse"});});});(0,_vitest.describe)("parseLayout - flex wrap utilities",function(){(0,_vitest.it)("should parse flex wrap",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-wrap")).toEqual({flexWrap:"wrap"});});(0,_vitest.it)("should parse flex wrap reverse",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-wrap-reverse")).toEqual({flexWrap:"wrap-reverse"});});(0,_vitest.it)("should parse flex nowrap",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-nowrap")).toEqual({flexWrap:"nowrap"});});});(0,_vitest.describe)("parseLayout - flex utilities",function(){(0,_vitest.it)("should parse flex-1",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-1")).toEqual({flex:1});});(0,_vitest.it)("should parse flex-auto",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-auto")).toEqual({flex:1});});(0,_vitest.it)("should parse flex-none",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-none")).toEqual({flex:0});});});(0,_vitest.describe)("parseLayout - flex grow/shrink utilities",function(){(0,_vitest.it)("should parse grow",function(){(0,_vitest.expect)((0,_layout.parseLayout)("grow")).toEqual({flexGrow:1});});(0,_vitest.it)("should parse grow-0",function(){(0,_vitest.expect)((0,_layout.parseLayout)("grow-0")).toEqual({flexGrow:0});});(0,_vitest.it)("should parse shrink",function(){(0,_vitest.expect)((0,_layout.parseLayout)("shrink")).toEqual({flexShrink:1});});(0,_vitest.it)("should parse shrink-0",function(){(0,_vitest.expect)((0,_layout.parseLayout)("shrink-0")).toEqual({flexShrink:0});});});(0,_vitest.describe)("parseLayout - justify content utilities",function(){(0,_vitest.it)("should parse justify-start",function(){(0,_vitest.expect)((0,_layout.parseLayout)("justify-start")).toEqual({justifyContent:"flex-start"});});(0,_vitest.it)("should parse justify-end",function(){(0,_vitest.expect)((0,_layout.parseLayout)("justify-end")).toEqual({justifyContent:"flex-end"});});(0,_vitest.it)("should parse justify-center",function(){(0,_vitest.expect)((0,_layout.parseLayout)("justify-center")).toEqual({justifyContent:"center"});});(0,_vitest.it)("should parse justify-between",function(){(0,_vitest.expect)((0,_layout.parseLayout)("justify-between")).toEqual({justifyContent:"space-between"});});(0,_vitest.it)("should parse justify-around",function(){(0,_vitest.expect)((0,_layout.parseLayout)("justify-around")).toEqual({justifyContent:"space-around"});});(0,_vitest.it)("should parse justify-evenly",function(){(0,_vitest.expect)((0,_layout.parseLayout)("justify-evenly")).toEqual({justifyContent:"space-evenly"});});});(0,_vitest.describe)("parseLayout - align items utilities",function(){(0,_vitest.it)("should parse items-start",function(){(0,_vitest.expect)((0,_layout.parseLayout)("items-start")).toEqual({alignItems:"flex-start"});});(0,_vitest.it)("should parse items-end",function(){(0,_vitest.expect)((0,_layout.parseLayout)("items-end")).toEqual({alignItems:"flex-end"});});(0,_vitest.it)("should parse items-center",function(){(0,_vitest.expect)((0,_layout.parseLayout)("items-center")).toEqual({alignItems:"center"});});(0,_vitest.it)("should parse items-baseline",function(){(0,_vitest.expect)((0,_layout.parseLayout)("items-baseline")).toEqual({alignItems:"baseline"});});(0,_vitest.it)("should parse items-stretch",function(){(0,_vitest.expect)((0,_layout.parseLayout)("items-stretch")).toEqual({alignItems:"stretch"});});});(0,_vitest.describe)("parseLayout - align self utilities",function(){(0,_vitest.it)("should parse self-auto",function(){(0,_vitest.expect)((0,_layout.parseLayout)("self-auto")).toEqual({alignSelf:"auto"});});(0,_vitest.it)("should parse self-start",function(){(0,_vitest.expect)((0,_layout.parseLayout)("self-start")).toEqual({alignSelf:"flex-start"});});(0,_vitest.it)("should parse self-end",function(){(0,_vitest.expect)((0,_layout.parseLayout)("self-end")).toEqual({alignSelf:"flex-end"});});(0,_vitest.it)("should parse self-center",function(){(0,_vitest.expect)((0,_layout.parseLayout)("self-center")).toEqual({alignSelf:"center"});});(0,_vitest.it)("should parse self-stretch",function(){(0,_vitest.expect)((0,_layout.parseLayout)("self-stretch")).toEqual({alignSelf:"stretch"});});(0,_vitest.it)("should parse self-baseline",function(){(0,_vitest.expect)((0,_layout.parseLayout)("self-baseline")).toEqual({alignSelf:"baseline"});});});(0,_vitest.describe)("parseLayout - align content utilities",function(){(0,_vitest.it)("should parse content-start",function(){(0,_vitest.expect)((0,_layout.parseLayout)("content-start")).toEqual({alignContent:"flex-start"});});(0,_vitest.it)("should parse content-end",function(){(0,_vitest.expect)((0,_layout.parseLayout)("content-end")).toEqual({alignContent:"flex-end"});});(0,_vitest.it)("should parse content-center",function(){(0,_vitest.expect)((0,_layout.parseLayout)("content-center")).toEqual({alignContent:"center"});});(0,_vitest.it)("should parse content-between",function(){(0,_vitest.expect)((0,_layout.parseLayout)("content-between")).toEqual({alignContent:"space-between"});});(0,_vitest.it)("should parse content-around",function(){(0,_vitest.expect)((0,_layout.parseLayout)("content-around")).toEqual({alignContent:"space-around"});});(0,_vitest.it)("should parse content-stretch",function(){(0,_vitest.expect)((0,_layout.parseLayout)("content-stretch")).toEqual({alignContent:"stretch"});});});(0,_vitest.describe)("parseLayout - position utilities",function(){(0,_vitest.it)("should parse absolute",function(){(0,_vitest.expect)((0,_layout.parseLayout)("absolute")).toEqual({position:"absolute"});});(0,_vitest.it)("should parse relative",function(){(0,_vitest.expect)((0,_layout.parseLayout)("relative")).toEqual({position:"relative"});});});(0,_vitest.describe)("parseLayout - overflow utilities",function(){(0,_vitest.it)("should parse overflow-hidden",function(){(0,_vitest.expect)((0,_layout.parseLayout)("overflow-hidden")).toEqual({overflow:"hidden"});});(0,_vitest.it)("should parse overflow-visible",function(){(0,_vitest.expect)((0,_layout.parseLayout)("overflow-visible")).toEqual({overflow:"visible"});});(0,_vitest.it)("should parse overflow-scroll",function(){(0,_vitest.expect)((0,_layout.parseLayout)("overflow-scroll")).toEqual({overflow:"scroll"});});});(0,_vitest.describe)("parseLayout - opacity utilities",function(){(0,_vitest.it)("should parse opacity-0 (fully transparent)",function(){(0,_vitest.expect)((0,_layout.parseLayout)("opacity-0")).toEqual({opacity:0});});(0,_vitest.it)("should parse opacity-50 (half transparent)",function(){(0,_vitest.expect)((0,_layout.parseLayout)("opacity-50")).toEqual({opacity:0.5});});(0,_vitest.it)("should parse opacity-100 (fully opaque)",function(){(0,_vitest.expect)((0,_layout.parseLayout)("opacity-100")).toEqual({opacity:1});});(0,_vitest.it)("should parse all opacity values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("opacity-5")).toEqual({opacity:0.05});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-10")).toEqual({opacity:0.1});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-15")).toEqual({opacity:0.15});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-20")).toEqual({opacity:0.2});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-25")).toEqual({opacity:0.25});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-30")).toEqual({opacity:0.3});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-35")).toEqual({opacity:0.35});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-40")).toEqual({opacity:0.4});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-45")).toEqual({opacity:0.45});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-55")).toEqual({opacity:0.55});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-60")).toEqual({opacity:0.6});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-65")).toEqual({opacity:0.65});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-70")).toEqual({opacity:0.7});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-75")).toEqual({opacity:0.75});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-80")).toEqual({opacity:0.8});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-85")).toEqual({opacity:0.85});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-90")).toEqual({opacity:0.9});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-95")).toEqual({opacity:0.95});});});(0,_vitest.describe)("parseLayout - edge cases",function(){(0,_vitest.it)("should return null for invalid classes",function(){(0,_vitest.expect)((0,_layout.parseLayout)("invalid")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("flex-invalid")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("justify")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("items")).toBeNull();});(0,_vitest.it)("should return null for empty string",function(){(0,_vitest.expect)((0,_layout.parseLayout)("")).toBeNull();});(0,_vitest.it)("should return null for partial class names",function(){(0,_vitest.expect)((0,_layout.parseLayout)("fle")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("flexbox")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("justify-start-center")).toBeNull();});(0,_vitest.it)("should return null for CSS classes not in React Native",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inline")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("block")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("inline-block")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("grid")).toBeNull();});});(0,_vitest.describe)("parseLayout - comprehensive coverage",function(){(0,_vitest.it)("should handle all flex direction variants",function(){var directions=["flex-row","flex-row-reverse","flex-col","flex-col-reverse"];directions.forEach(function(dir){(0,_vitest.expect)((0,_layout.parseLayout)(dir)).toBeTruthy();});});(0,_vitest.it)("should handle all flex wrap variants",function(){var wraps=["flex-wrap","flex-wrap-reverse","flex-nowrap"];wraps.forEach(function(wrap){(0,_vitest.expect)((0,_layout.parseLayout)(wrap)).toBeTruthy();});});(0,_vitest.it)("should handle all justify content variants",function(){var justifies=["justify-start","justify-end","justify-center","justify-between","justify-around","justify-evenly"];justifies.forEach(function(justify){(0,_vitest.expect)((0,_layout.parseLayout)(justify)).toBeTruthy();});});(0,_vitest.it)("should handle all align items variants",function(){var aligns=["items-start","items-end","items-center","items-baseline","items-stretch"];aligns.forEach(function(align){(0,_vitest.expect)((0,_layout.parseLayout)(align)).toBeTruthy();});});(0,_vitest.it)("should handle all align self variants",function(){var selfs=["self-auto","self-start","self-end","self-center","self-stretch","self-baseline"];selfs.forEach(function(self){(0,_vitest.expect)((0,_layout.parseLayout)(self)).toBeTruthy();});});(0,_vitest.it)("should handle all align content variants",function(){var contents=["content-start","content-end","content-center","content-between","content-around","content-stretch"];contents.forEach(function(content){(0,_vitest.expect)((0,_layout.parseLayout)(content)).toBeTruthy();});});(0,_vitest.it)("should handle all position variants",function(){var positions=["absolute","relative"];positions.forEach(function(position){(0,_vitest.expect)((0,_layout.parseLayout)(position)).toBeTruthy();});});(0,_vitest.it)("should handle all overflow variants",function(){var overflows=["overflow-hidden","overflow-visible","overflow-scroll"];overflows.forEach(function(overflow){(0,_vitest.expect)((0,_layout.parseLayout)(overflow)).toBeTruthy();});});});(0,_vitest.describe)("parseLayout - case sensitivity",function(){(0,_vitest.it)("should be case-sensitive",function(){(0,_vitest.expect)((0,_layout.parseLayout)("FLEX")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("Flex")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("ABSOLUTE")).toBeNull();});});(0,_vitest.describe)("parseLayout - z-index utilities",function(){(0,_vitest.it)("should parse z-index values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("z-0")).toEqual({zIndex:0});(0,_vitest.expect)((0,_layout.parseLayout)("z-10")).toEqual({zIndex:10});(0,_vitest.expect)((0,_layout.parseLayout)("z-20")).toEqual({zIndex:20});(0,_vitest.expect)((0,_layout.parseLayout)("z-30")).toEqual({zIndex:30});(0,_vitest.expect)((0,_layout.parseLayout)("z-40")).toEqual({zIndex:40});(0,_vitest.expect)((0,_layout.parseLayout)("z-50")).toEqual({zIndex:50});});(0,_vitest.it)("should parse z-auto as 0",function(){(0,_vitest.expect)((0,_layout.parseLayout)("z-auto")).toEqual({zIndex:0});});(0,_vitest.it)("should parse arbitrary z-index values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("z-[999]")).toEqual({zIndex:999});(0,_vitest.expect)((0,_layout.parseLayout)("z-[100]")).toEqual({zIndex:100});(0,_vitest.expect)((0,_layout.parseLayout)("z-[1]")).toEqual({zIndex:1});});(0,_vitest.it)("should parse negative arbitrary z-index values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("z-[-1]")).toEqual({zIndex:-1});(0,_vitest.expect)((0,_layout.parseLayout)("z-[-10]")).toEqual({zIndex:-10});(0,_vitest.expect)((0,_layout.parseLayout)("z-[-999]")).toEqual({zIndex:-999});});(0,_vitest.it)("should return null for invalid z-index values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("z-100")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("z-5")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("z-invalid")).toBeNull();});});(0,_vitest.describe)("parseLayout - positioning utilities",function(){(0,_vitest.it)("should parse top values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-0")).toEqual({top:0});(0,_vitest.expect)((0,_layout.parseLayout)("top-4")).toEqual({top:16});(0,_vitest.expect)((0,_layout.parseLayout)("top-8")).toEqual({top:32});(0,_vitest.expect)((0,_layout.parseLayout)("top-16")).toEqual({top:64});});(0,_vitest.it)("should parse right values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("right-0")).toEqual({right:0});(0,_vitest.expect)((0,_layout.parseLayout)("right-4")).toEqual({right:16});(0,_vitest.expect)((0,_layout.parseLayout)("right-8")).toEqual({right:32});(0,_vitest.expect)((0,_layout.parseLayout)("right-16")).toEqual({right:64});});(0,_vitest.it)("should parse bottom values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("bottom-0")).toEqual({bottom:0});(0,_vitest.expect)((0,_layout.parseLayout)("bottom-4")).toEqual({bottom:16});(0,_vitest.expect)((0,_layout.parseLayout)("bottom-8")).toEqual({bottom:32});(0,_vitest.expect)((0,_layout.parseLayout)("bottom-16")).toEqual({bottom:64});});(0,_vitest.it)("should parse left values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("left-0")).toEqual({left:0});(0,_vitest.expect)((0,_layout.parseLayout)("left-4")).toEqual({left:16});(0,_vitest.expect)((0,_layout.parseLayout)("left-8")).toEqual({left:32});(0,_vitest.expect)((0,_layout.parseLayout)("left-16")).toEqual({left:64});});(0,_vitest.it)("should parse fractional positioning values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-0.5")).toEqual({top:2});(0,_vitest.expect)((0,_layout.parseLayout)("right-1.5")).toEqual({right:6});(0,_vitest.expect)((0,_layout.parseLayout)("bottom-2.5")).toEqual({bottom:10});(0,_vitest.expect)((0,_layout.parseLayout)("left-3.5")).toEqual({left:14});});(0,_vitest.it)("should parse auto positioning values as empty object",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-auto")).toEqual({});(0,_vitest.expect)((0,_layout.parseLayout)("right-auto")).toEqual({});(0,_vitest.expect)((0,_layout.parseLayout)("bottom-auto")).toEqual({});(0,_vitest.expect)((0,_layout.parseLayout)("left-auto")).toEqual({});});(0,_vitest.it)("should parse arbitrary top values with pixels",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-[50px]")).toEqual({top:50});(0,_vitest.expect)((0,_layout.parseLayout)("top-[100px]")).toEqual({top:100});(0,_vitest.expect)((0,_layout.parseLayout)("top-[0px]")).toEqual({top:0});});(0,_vitest.it)("should parse arbitrary top values without unit (defaults to px)",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-[50]")).toEqual({top:50});(0,_vitest.expect)((0,_layout.parseLayout)("top-[100]")).toEqual({top:100});});(0,_vitest.it)("should parse arbitrary top values with percentages",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-[25%]")).toEqual({top:"25%"});(0,_vitest.expect)((0,_layout.parseLayout)("top-[50%]")).toEqual({top:"50%"});(0,_vitest.expect)((0,_layout.parseLayout)("top-[10.5%]")).toEqual({top:"10.5%"});});(0,_vitest.it)("should parse negative arbitrary top values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-[-10px]")).toEqual({top:-10});(0,_vitest.expect)((0,_layout.parseLayout)("top-[-50]")).toEqual({top:-50});(0,_vitest.expect)((0,_layout.parseLayout)("top-[-25%]")).toEqual({top:"-25%"});});(0,_vitest.it)("should parse arbitrary right values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("right-[30px]")).toEqual({right:30});(0,_vitest.expect)((0,_layout.parseLayout)("right-[20]")).toEqual({right:20});(0,_vitest.expect)((0,_layout.parseLayout)("right-[15%]")).toEqual({right:"15%"});(0,_vitest.expect)((0,_layout.parseLayout)("right-[-10px]")).toEqual({right:-10});});(0,_vitest.it)("should parse arbitrary bottom values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("bottom-[40px]")).toEqual({bottom:40});(0,_vitest.expect)((0,_layout.parseLayout)("bottom-[25]")).toEqual({bottom:25});(0,_vitest.expect)((0,_layout.parseLayout)("bottom-[33.333%]")).toEqual({bottom:"33.333%"});(0,_vitest.expect)((0,_layout.parseLayout)("bottom-[-15px]")).toEqual({bottom:-15});});(0,_vitest.it)("should parse arbitrary left values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("left-[60px]")).toEqual({left:60});(0,_vitest.expect)((0,_layout.parseLayout)("left-[45]")).toEqual({left:45});(0,_vitest.expect)((0,_layout.parseLayout)("left-[12.5%]")).toEqual({left:"12.5%"});(0,_vitest.expect)((0,_layout.parseLayout)("left-[-20px]")).toEqual({left:-20});});});(0,_vitest.describe)("parseLayout - inset utilities",function(){(0,_vitest.it)("should parse inset (all sides) values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-0")).toEqual({top:0,right:0,bottom:0,left:0});(0,_vitest.expect)((0,_layout.parseLayout)("inset-4")).toEqual({top:16,right:16,bottom:16,left:16});(0,_vitest.expect)((0,_layout.parseLayout)("inset-8")).toEqual({top:32,right:32,bottom:32,left:32});});(0,_vitest.it)("should parse inset-x (horizontal) values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-x-0")).toEqual({left:0,right:0});(0,_vitest.expect)((0,_layout.parseLayout)("inset-x-4")).toEqual({left:16,right:16});(0,_vitest.expect)((0,_layout.parseLayout)("inset-x-8")).toEqual({left:32,right:32});});(0,_vitest.it)("should parse inset-y (vertical) values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-y-0")).toEqual({top:0,bottom:0});(0,_vitest.expect)((0,_layout.parseLayout)("inset-y-4")).toEqual({top:16,bottom:16});(0,_vitest.expect)((0,_layout.parseLayout)("inset-y-8")).toEqual({top:32,bottom:32});});(0,_vitest.it)("should parse fractional inset values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-0.5")).toEqual({top:2,right:2,bottom:2,left:2});(0,_vitest.expect)((0,_layout.parseLayout)("inset-x-1.5")).toEqual({left:6,right:6});(0,_vitest.expect)((0,_layout.parseLayout)("inset-y-2.5")).toEqual({top:10,bottom:10});});(0,_vitest.it)("should return null for invalid inset values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-100")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("inset-x-100")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("inset-y-100")).toBeNull();});(0,_vitest.it)("should parse arbitrary inset (all sides) values with pixels",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-[10px]")).toEqual({top:10,right:10,bottom:10,left:10});(0,_vitest.expect)((0,_layout.parseLayout)("inset-[25px]")).toEqual({top:25,right:25,bottom:25,left:25});(0,_vitest.expect)((0,_layout.parseLayout)("inset-[0px]")).toEqual({top:0,right:0,bottom:0,left:0});});(0,_vitest.it)("should parse arbitrary inset values without unit (defaults to px)",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-[15]")).toEqual({top:15,right:15,bottom:15,left:15});(0,_vitest.expect)((0,_layout.parseLayout)("inset-[30]")).toEqual({top:30,right:30,bottom:30,left:30});});(0,_vitest.it)("should parse arbitrary inset values with percentages",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-[10%]")).toEqual({top:"10%",right:"10%",bottom:"10%",left:"10%"});(0,_vitest.expect)((0,_layout.parseLayout)("inset-[25%]")).toEqual({top:"25%",right:"25%",bottom:"25%",left:"25%"});(0,_vitest.expect)((0,_layout.parseLayout)("inset-[5.5%]")).toEqual({top:"5.5%",right:"5.5%",bottom:"5.5%",left:"5.5%"});});(0,_vitest.it)("should parse arbitrary inset-x (horizontal) values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-x-[20px]")).toEqual({left:20,right:20});(0,_vitest.expect)((0,_layout.parseLayout)("inset-x-[15]")).toEqual({left:15,right:15});(0,_vitest.expect)((0,_layout.parseLayout)("inset-x-[10%]")).toEqual({left:"10%",right:"10%"});});(0,_vitest.it)("should parse arbitrary inset-y (vertical) values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-y-[30px]")).toEqual({top:30,bottom:30});(0,_vitest.expect)((0,_layout.parseLayout)("inset-y-[25]")).toEqual({top:25,bottom:25});(0,_vitest.expect)((0,_layout.parseLayout)("inset-y-[15%]")).toEqual({top:"15%",bottom:"15%"});});(0,_vitest.it)("should parse negative arbitrary inset values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-[-5px]")).toEqual({top:-5,right:-5,bottom:-5,left:-5});(0,_vitest.expect)((0,_layout.parseLayout)("inset-x-[-10px]")).toEqual({left:-10,right:-10});(0,_vitest.expect)((0,_layout.parseLayout)("inset-y-[-15px]")).toEqual({top:-15,bottom:-15});(0,_vitest.expect)((0,_layout.parseLayout)("inset-[-20%]")).toEqual({top:"-20%",right:"-20%",bottom:"-20%",left:"-20%"});});});(0,_vitest.describe)("parseLayout - specific property coverage",function(){(0,_vitest.it)("should return unique objects for each class",function(){var flex1=(0,_layout.parseLayout)("flex");var flex2=(0,_layout.parseLayout)("flex");(0,_vitest.expect)(flex1).toEqual(flex2);});(0,_vitest.it)("should handle flex value variations",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-1")).toEqual({flex:1});(0,_vitest.expect)((0,_layout.parseLayout)("flex-auto")).toEqual({flex:1});(0,_vitest.expect)((0,_layout.parseLayout)("flex-none")).toEqual({flex:0});});(0,_vitest.it)("should distinguish between similar class names",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex")).not.toEqual((0,_layout.parseLayout)("flex-1"));(0,_vitest.expect)((0,_layout.parseLayout)("grow")).not.toEqual((0,_layout.parseLayout)("grow-0"));(0,_vitest.expect)((0,_layout.parseLayout)("shrink")).not.toEqual((0,_layout.parseLayout)("shrink-0"));});(0,_vitest.it)("should handle positioning with absolute/relative",function(){(0,_vitest.expect)((0,_layout.parseLayout)("absolute")).toEqual({position:"absolute"});(0,_vitest.expect)((0,_layout.parseLayout)("top-0")).toEqual({top:0});(0,_vitest.expect)((0,_layout.parseLayout)("left-0")).toEqual({left:0});});(0,_vitest.it)("should handle all positioning directions",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-4")).toHaveProperty("top");(0,_vitest.expect)((0,_layout.parseLayout)("right-4")).toHaveProperty("right");(0,_vitest.expect)((0,_layout.parseLayout)("bottom-4")).toHaveProperty("bottom");(0,_vitest.expect)((0,_layout.parseLayout)("left-4")).toHaveProperty("left");});(0,_vitest.it)("should handle inset shorthand variations",function(){var insetAll=(0,_layout.parseLayout)("inset-4");(0,_vitest.expect)(insetAll).toHaveProperty("top",16);(0,_vitest.expect)(insetAll).toHaveProperty("right",16);(0,_vitest.expect)(insetAll).toHaveProperty("bottom",16);(0,_vitest.expect)(insetAll).toHaveProperty("left",16);var insetX=(0,_layout.parseLayout)("inset-x-4");(0,_vitest.expect)(insetX).toHaveProperty("left",16);(0,_vitest.expect)(insetX).toHaveProperty("right",16);(0,_vitest.expect)(insetX).not.toHaveProperty("top");(0,_vitest.expect)(insetX).not.toHaveProperty("bottom");var insetY=(0,_layout.parseLayout)("inset-y-4");(0,_vitest.expect)(insetY).toHaveProperty("top",16);(0,_vitest.expect)(insetY).toHaveProperty("bottom",16);(0,_vitest.expect)(insetY).not.toHaveProperty("left");(0,_vitest.expect)(insetY).not.toHaveProperty("right");});});
1
+ var _vitest=require("vitest");var _layout=require("./layout");(0,_vitest.describe)("parseLayout - display utilities",function(){(0,_vitest.it)("should parse display flex",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex")).toEqual({display:"flex"});});(0,_vitest.it)("should parse display hidden",function(){(0,_vitest.expect)((0,_layout.parseLayout)("hidden")).toEqual({display:"none"});});});(0,_vitest.describe)("parseLayout - flex direction utilities",function(){(0,_vitest.it)("should parse flex row",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-row")).toEqual({flexDirection:"row"});});(0,_vitest.it)("should parse flex row reverse",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-row-reverse")).toEqual({flexDirection:"row-reverse"});});(0,_vitest.it)("should parse flex column",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-col")).toEqual({flexDirection:"column"});});(0,_vitest.it)("should parse flex column reverse",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-col-reverse")).toEqual({flexDirection:"column-reverse"});});});(0,_vitest.describe)("parseLayout - flex wrap utilities",function(){(0,_vitest.it)("should parse flex wrap",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-wrap")).toEqual({flexWrap:"wrap"});});(0,_vitest.it)("should parse flex wrap reverse",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-wrap-reverse")).toEqual({flexWrap:"wrap-reverse"});});(0,_vitest.it)("should parse flex nowrap",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-nowrap")).toEqual({flexWrap:"nowrap"});});});(0,_vitest.describe)("parseLayout - flex utilities",function(){(0,_vitest.it)("should parse flex-1",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-1")).toEqual({flex:1});});(0,_vitest.it)("should parse flex-auto",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-auto")).toEqual({flex:1});});(0,_vitest.it)("should parse flex-none",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-none")).toEqual({flex:0});});});(0,_vitest.describe)("parseLayout - flex grow/shrink utilities",function(){(0,_vitest.it)("should parse grow",function(){(0,_vitest.expect)((0,_layout.parseLayout)("grow")).toEqual({flexGrow:1});});(0,_vitest.it)("should parse grow-0",function(){(0,_vitest.expect)((0,_layout.parseLayout)("grow-0")).toEqual({flexGrow:0});});(0,_vitest.it)("should parse shrink",function(){(0,_vitest.expect)((0,_layout.parseLayout)("shrink")).toEqual({flexShrink:1});});(0,_vitest.it)("should parse shrink-0",function(){(0,_vitest.expect)((0,_layout.parseLayout)("shrink-0")).toEqual({flexShrink:0});});(0,_vitest.it)("should parse grow with arbitrary values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("grow-[1.5]")).toEqual({flexGrow:1.5});(0,_vitest.expect)((0,_layout.parseLayout)("grow-[2]")).toEqual({flexGrow:2});(0,_vitest.expect)((0,_layout.parseLayout)("grow-[0.5]")).toEqual({flexGrow:0.5});(0,_vitest.expect)((0,_layout.parseLayout)("grow-[3]")).toEqual({flexGrow:3});(0,_vitest.expect)((0,_layout.parseLayout)("grow-[0]")).toEqual({flexGrow:0});});(0,_vitest.it)("should parse shrink with arbitrary values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("shrink-[0.5]")).toEqual({flexShrink:0.5});(0,_vitest.expect)((0,_layout.parseLayout)("shrink-[2]")).toEqual({flexShrink:2});(0,_vitest.expect)((0,_layout.parseLayout)("shrink-[1.5]")).toEqual({flexShrink:1.5});(0,_vitest.expect)((0,_layout.parseLayout)("shrink-[3]")).toEqual({flexShrink:3});(0,_vitest.expect)((0,_layout.parseLayout)("shrink-[0]")).toEqual({flexShrink:0});});(0,_vitest.it)("should parse CSS-style flex-grow aliases",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-grow")).toEqual({flexGrow:1});(0,_vitest.expect)((0,_layout.parseLayout)("flex-grow-0")).toEqual({flexGrow:0});});(0,_vitest.it)("should parse CSS-style flex-shrink aliases",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-shrink")).toEqual({flexShrink:1});(0,_vitest.expect)((0,_layout.parseLayout)("flex-shrink-0")).toEqual({flexShrink:0});});(0,_vitest.it)("should parse CSS-style flex-grow with arbitrary values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-grow-[1.5]")).toEqual({flexGrow:1.5});(0,_vitest.expect)((0,_layout.parseLayout)("flex-grow-[2]")).toEqual({flexGrow:2});(0,_vitest.expect)((0,_layout.parseLayout)("flex-grow-[0.5]")).toEqual({flexGrow:0.5});});(0,_vitest.it)("should parse CSS-style flex-shrink with arbitrary values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-shrink-[0.5]")).toEqual({flexShrink:0.5});(0,_vitest.expect)((0,_layout.parseLayout)("flex-shrink-[2]")).toEqual({flexShrink:2});(0,_vitest.expect)((0,_layout.parseLayout)("flex-shrink-[1.5]")).toEqual({flexShrink:1.5});});(0,_vitest.it)("should handle edge case values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("grow-[0.1]")).toEqual({flexGrow:0.1});(0,_vitest.expect)((0,_layout.parseLayout)("grow-[10]")).toEqual({flexGrow:10});(0,_vitest.expect)((0,_layout.parseLayout)("shrink-[0.01]")).toEqual({flexShrink:0.01});(0,_vitest.expect)((0,_layout.parseLayout)("shrink-[100]")).toEqual({flexShrink:100});});(0,_vitest.it)("should parse Tailwind shorthand decimals (no leading zero)",function(){(0,_vitest.expect)((0,_layout.parseLayout)("grow-[.5]")).toEqual({flexGrow:0.5});(0,_vitest.expect)((0,_layout.parseLayout)("grow-[.75]")).toEqual({flexGrow:0.75});(0,_vitest.expect)((0,_layout.parseLayout)("shrink-[.5]")).toEqual({flexShrink:0.5});(0,_vitest.expect)((0,_layout.parseLayout)("shrink-[.25]")).toEqual({flexShrink:0.25});(0,_vitest.expect)((0,_layout.parseLayout)("flex-grow-[.5]")).toEqual({flexGrow:0.5});(0,_vitest.expect)((0,_layout.parseLayout)("flex-shrink-[.5]")).toEqual({flexShrink:0.5});});(0,_vitest.it)("should reject negative values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("grow-[-1]")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("shrink-[-1]")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("flex-grow-[-2]")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("flex-shrink-[-0.5]")).toBeNull();});});(0,_vitest.describe)("parseLayout - justify content utilities",function(){(0,_vitest.it)("should parse justify-start",function(){(0,_vitest.expect)((0,_layout.parseLayout)("justify-start")).toEqual({justifyContent:"flex-start"});});(0,_vitest.it)("should parse justify-end",function(){(0,_vitest.expect)((0,_layout.parseLayout)("justify-end")).toEqual({justifyContent:"flex-end"});});(0,_vitest.it)("should parse justify-center",function(){(0,_vitest.expect)((0,_layout.parseLayout)("justify-center")).toEqual({justifyContent:"center"});});(0,_vitest.it)("should parse justify-between",function(){(0,_vitest.expect)((0,_layout.parseLayout)("justify-between")).toEqual({justifyContent:"space-between"});});(0,_vitest.it)("should parse justify-around",function(){(0,_vitest.expect)((0,_layout.parseLayout)("justify-around")).toEqual({justifyContent:"space-around"});});(0,_vitest.it)("should parse justify-evenly",function(){(0,_vitest.expect)((0,_layout.parseLayout)("justify-evenly")).toEqual({justifyContent:"space-evenly"});});});(0,_vitest.describe)("parseLayout - align items utilities",function(){(0,_vitest.it)("should parse items-start",function(){(0,_vitest.expect)((0,_layout.parseLayout)("items-start")).toEqual({alignItems:"flex-start"});});(0,_vitest.it)("should parse items-end",function(){(0,_vitest.expect)((0,_layout.parseLayout)("items-end")).toEqual({alignItems:"flex-end"});});(0,_vitest.it)("should parse items-center",function(){(0,_vitest.expect)((0,_layout.parseLayout)("items-center")).toEqual({alignItems:"center"});});(0,_vitest.it)("should parse items-baseline",function(){(0,_vitest.expect)((0,_layout.parseLayout)("items-baseline")).toEqual({alignItems:"baseline"});});(0,_vitest.it)("should parse items-stretch",function(){(0,_vitest.expect)((0,_layout.parseLayout)("items-stretch")).toEqual({alignItems:"stretch"});});});(0,_vitest.describe)("parseLayout - align self utilities",function(){(0,_vitest.it)("should parse self-auto",function(){(0,_vitest.expect)((0,_layout.parseLayout)("self-auto")).toEqual({alignSelf:"auto"});});(0,_vitest.it)("should parse self-start",function(){(0,_vitest.expect)((0,_layout.parseLayout)("self-start")).toEqual({alignSelf:"flex-start"});});(0,_vitest.it)("should parse self-end",function(){(0,_vitest.expect)((0,_layout.parseLayout)("self-end")).toEqual({alignSelf:"flex-end"});});(0,_vitest.it)("should parse self-center",function(){(0,_vitest.expect)((0,_layout.parseLayout)("self-center")).toEqual({alignSelf:"center"});});(0,_vitest.it)("should parse self-stretch",function(){(0,_vitest.expect)((0,_layout.parseLayout)("self-stretch")).toEqual({alignSelf:"stretch"});});(0,_vitest.it)("should parse self-baseline",function(){(0,_vitest.expect)((0,_layout.parseLayout)("self-baseline")).toEqual({alignSelf:"baseline"});});});(0,_vitest.describe)("parseLayout - align content utilities",function(){(0,_vitest.it)("should parse content-start",function(){(0,_vitest.expect)((0,_layout.parseLayout)("content-start")).toEqual({alignContent:"flex-start"});});(0,_vitest.it)("should parse content-end",function(){(0,_vitest.expect)((0,_layout.parseLayout)("content-end")).toEqual({alignContent:"flex-end"});});(0,_vitest.it)("should parse content-center",function(){(0,_vitest.expect)((0,_layout.parseLayout)("content-center")).toEqual({alignContent:"center"});});(0,_vitest.it)("should parse content-between",function(){(0,_vitest.expect)((0,_layout.parseLayout)("content-between")).toEqual({alignContent:"space-between"});});(0,_vitest.it)("should parse content-around",function(){(0,_vitest.expect)((0,_layout.parseLayout)("content-around")).toEqual({alignContent:"space-around"});});(0,_vitest.it)("should parse content-stretch",function(){(0,_vitest.expect)((0,_layout.parseLayout)("content-stretch")).toEqual({alignContent:"stretch"});});});(0,_vitest.describe)("parseLayout - position utilities",function(){(0,_vitest.it)("should parse absolute",function(){(0,_vitest.expect)((0,_layout.parseLayout)("absolute")).toEqual({position:"absolute"});});(0,_vitest.it)("should parse relative",function(){(0,_vitest.expect)((0,_layout.parseLayout)("relative")).toEqual({position:"relative"});});});(0,_vitest.describe)("parseLayout - overflow utilities",function(){(0,_vitest.it)("should parse overflow-hidden",function(){(0,_vitest.expect)((0,_layout.parseLayout)("overflow-hidden")).toEqual({overflow:"hidden"});});(0,_vitest.it)("should parse overflow-visible",function(){(0,_vitest.expect)((0,_layout.parseLayout)("overflow-visible")).toEqual({overflow:"visible"});});(0,_vitest.it)("should parse overflow-scroll",function(){(0,_vitest.expect)((0,_layout.parseLayout)("overflow-scroll")).toEqual({overflow:"scroll"});});});(0,_vitest.describe)("parseLayout - opacity utilities",function(){(0,_vitest.it)("should parse opacity-0 (fully transparent)",function(){(0,_vitest.expect)((0,_layout.parseLayout)("opacity-0")).toEqual({opacity:0});});(0,_vitest.it)("should parse opacity-50 (half transparent)",function(){(0,_vitest.expect)((0,_layout.parseLayout)("opacity-50")).toEqual({opacity:0.5});});(0,_vitest.it)("should parse opacity-100 (fully opaque)",function(){(0,_vitest.expect)((0,_layout.parseLayout)("opacity-100")).toEqual({opacity:1});});(0,_vitest.it)("should parse all opacity values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("opacity-5")).toEqual({opacity:0.05});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-10")).toEqual({opacity:0.1});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-15")).toEqual({opacity:0.15});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-20")).toEqual({opacity:0.2});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-25")).toEqual({opacity:0.25});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-30")).toEqual({opacity:0.3});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-35")).toEqual({opacity:0.35});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-40")).toEqual({opacity:0.4});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-45")).toEqual({opacity:0.45});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-55")).toEqual({opacity:0.55});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-60")).toEqual({opacity:0.6});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-65")).toEqual({opacity:0.65});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-70")).toEqual({opacity:0.7});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-75")).toEqual({opacity:0.75});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-80")).toEqual({opacity:0.8});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-85")).toEqual({opacity:0.85});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-90")).toEqual({opacity:0.9});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-95")).toEqual({opacity:0.95});});});(0,_vitest.describe)("parseLayout - edge cases",function(){(0,_vitest.it)("should return null for invalid classes",function(){(0,_vitest.expect)((0,_layout.parseLayout)("invalid")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("flex-invalid")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("justify")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("items")).toBeNull();});(0,_vitest.it)("should return null for empty string",function(){(0,_vitest.expect)((0,_layout.parseLayout)("")).toBeNull();});(0,_vitest.it)("should return null for partial class names",function(){(0,_vitest.expect)((0,_layout.parseLayout)("fle")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("flexbox")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("justify-start-center")).toBeNull();});(0,_vitest.it)("should return null for CSS classes not in React Native",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inline")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("block")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("inline-block")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("grid")).toBeNull();});});(0,_vitest.describe)("parseLayout - comprehensive coverage",function(){(0,_vitest.it)("should handle all flex direction variants",function(){var directions=["flex-row","flex-row-reverse","flex-col","flex-col-reverse"];directions.forEach(function(dir){(0,_vitest.expect)((0,_layout.parseLayout)(dir)).toBeTruthy();});});(0,_vitest.it)("should handle all flex wrap variants",function(){var wraps=["flex-wrap","flex-wrap-reverse","flex-nowrap"];wraps.forEach(function(wrap){(0,_vitest.expect)((0,_layout.parseLayout)(wrap)).toBeTruthy();});});(0,_vitest.it)("should handle all justify content variants",function(){var justifies=["justify-start","justify-end","justify-center","justify-between","justify-around","justify-evenly"];justifies.forEach(function(justify){(0,_vitest.expect)((0,_layout.parseLayout)(justify)).toBeTruthy();});});(0,_vitest.it)("should handle all align items variants",function(){var aligns=["items-start","items-end","items-center","items-baseline","items-stretch"];aligns.forEach(function(align){(0,_vitest.expect)((0,_layout.parseLayout)(align)).toBeTruthy();});});(0,_vitest.it)("should handle all align self variants",function(){var selfs=["self-auto","self-start","self-end","self-center","self-stretch","self-baseline"];selfs.forEach(function(self){(0,_vitest.expect)((0,_layout.parseLayout)(self)).toBeTruthy();});});(0,_vitest.it)("should handle all align content variants",function(){var contents=["content-start","content-end","content-center","content-between","content-around","content-stretch"];contents.forEach(function(content){(0,_vitest.expect)((0,_layout.parseLayout)(content)).toBeTruthy();});});(0,_vitest.it)("should handle all position variants",function(){var positions=["absolute","relative"];positions.forEach(function(position){(0,_vitest.expect)((0,_layout.parseLayout)(position)).toBeTruthy();});});(0,_vitest.it)("should handle all overflow variants",function(){var overflows=["overflow-hidden","overflow-visible","overflow-scroll"];overflows.forEach(function(overflow){(0,_vitest.expect)((0,_layout.parseLayout)(overflow)).toBeTruthy();});});});(0,_vitest.describe)("parseLayout - case sensitivity",function(){(0,_vitest.it)("should be case-sensitive",function(){(0,_vitest.expect)((0,_layout.parseLayout)("FLEX")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("Flex")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("ABSOLUTE")).toBeNull();});});(0,_vitest.describe)("parseLayout - z-index utilities",function(){(0,_vitest.it)("should parse z-index values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("z-0")).toEqual({zIndex:0});(0,_vitest.expect)((0,_layout.parseLayout)("z-10")).toEqual({zIndex:10});(0,_vitest.expect)((0,_layout.parseLayout)("z-20")).toEqual({zIndex:20});(0,_vitest.expect)((0,_layout.parseLayout)("z-30")).toEqual({zIndex:30});(0,_vitest.expect)((0,_layout.parseLayout)("z-40")).toEqual({zIndex:40});(0,_vitest.expect)((0,_layout.parseLayout)("z-50")).toEqual({zIndex:50});});(0,_vitest.it)("should parse z-auto as 0",function(){(0,_vitest.expect)((0,_layout.parseLayout)("z-auto")).toEqual({zIndex:0});});(0,_vitest.it)("should parse arbitrary z-index values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("z-[999]")).toEqual({zIndex:999});(0,_vitest.expect)((0,_layout.parseLayout)("z-[100]")).toEqual({zIndex:100});(0,_vitest.expect)((0,_layout.parseLayout)("z-[1]")).toEqual({zIndex:1});});(0,_vitest.it)("should parse negative arbitrary z-index values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("z-[-1]")).toEqual({zIndex:-1});(0,_vitest.expect)((0,_layout.parseLayout)("z-[-10]")).toEqual({zIndex:-10});(0,_vitest.expect)((0,_layout.parseLayout)("z-[-999]")).toEqual({zIndex:-999});});(0,_vitest.it)("should return null for invalid z-index values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("z-100")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("z-5")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("z-invalid")).toBeNull();});});(0,_vitest.describe)("parseLayout - positioning utilities",function(){(0,_vitest.it)("should parse top values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-0")).toEqual({top:0});(0,_vitest.expect)((0,_layout.parseLayout)("top-4")).toEqual({top:16});(0,_vitest.expect)((0,_layout.parseLayout)("top-8")).toEqual({top:32});(0,_vitest.expect)((0,_layout.parseLayout)("top-16")).toEqual({top:64});});(0,_vitest.it)("should parse right values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("right-0")).toEqual({right:0});(0,_vitest.expect)((0,_layout.parseLayout)("right-4")).toEqual({right:16});(0,_vitest.expect)((0,_layout.parseLayout)("right-8")).toEqual({right:32});(0,_vitest.expect)((0,_layout.parseLayout)("right-16")).toEqual({right:64});});(0,_vitest.it)("should parse bottom values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("bottom-0")).toEqual({bottom:0});(0,_vitest.expect)((0,_layout.parseLayout)("bottom-4")).toEqual({bottom:16});(0,_vitest.expect)((0,_layout.parseLayout)("bottom-8")).toEqual({bottom:32});(0,_vitest.expect)((0,_layout.parseLayout)("bottom-16")).toEqual({bottom:64});});(0,_vitest.it)("should parse left values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("left-0")).toEqual({left:0});(0,_vitest.expect)((0,_layout.parseLayout)("left-4")).toEqual({left:16});(0,_vitest.expect)((0,_layout.parseLayout)("left-8")).toEqual({left:32});(0,_vitest.expect)((0,_layout.parseLayout)("left-16")).toEqual({left:64});});(0,_vitest.it)("should parse fractional positioning values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-0.5")).toEqual({top:2});(0,_vitest.expect)((0,_layout.parseLayout)("right-1.5")).toEqual({right:6});(0,_vitest.expect)((0,_layout.parseLayout)("bottom-2.5")).toEqual({bottom:10});(0,_vitest.expect)((0,_layout.parseLayout)("left-3.5")).toEqual({left:14});});(0,_vitest.it)("should parse auto positioning values as empty object",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-auto")).toEqual({});(0,_vitest.expect)((0,_layout.parseLayout)("right-auto")).toEqual({});(0,_vitest.expect)((0,_layout.parseLayout)("bottom-auto")).toEqual({});(0,_vitest.expect)((0,_layout.parseLayout)("left-auto")).toEqual({});});(0,_vitest.it)("should parse arbitrary top values with pixels",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-[50px]")).toEqual({top:50});(0,_vitest.expect)((0,_layout.parseLayout)("top-[100px]")).toEqual({top:100});(0,_vitest.expect)((0,_layout.parseLayout)("top-[0px]")).toEqual({top:0});});(0,_vitest.it)("should parse arbitrary top values without unit (defaults to px)",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-[50]")).toEqual({top:50});(0,_vitest.expect)((0,_layout.parseLayout)("top-[100]")).toEqual({top:100});});(0,_vitest.it)("should parse arbitrary top values with percentages",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-[25%]")).toEqual({top:"25%"});(0,_vitest.expect)((0,_layout.parseLayout)("top-[50%]")).toEqual({top:"50%"});(0,_vitest.expect)((0,_layout.parseLayout)("top-[10.5%]")).toEqual({top:"10.5%"});});(0,_vitest.it)("should parse negative arbitrary top values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-[-10px]")).toEqual({top:-10});(0,_vitest.expect)((0,_layout.parseLayout)("top-[-50]")).toEqual({top:-50});(0,_vitest.expect)((0,_layout.parseLayout)("top-[-25%]")).toEqual({top:"-25%"});});(0,_vitest.it)("should parse arbitrary right values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("right-[30px]")).toEqual({right:30});(0,_vitest.expect)((0,_layout.parseLayout)("right-[20]")).toEqual({right:20});(0,_vitest.expect)((0,_layout.parseLayout)("right-[15%]")).toEqual({right:"15%"});(0,_vitest.expect)((0,_layout.parseLayout)("right-[-10px]")).toEqual({right:-10});});(0,_vitest.it)("should parse arbitrary bottom values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("bottom-[40px]")).toEqual({bottom:40});(0,_vitest.expect)((0,_layout.parseLayout)("bottom-[25]")).toEqual({bottom:25});(0,_vitest.expect)((0,_layout.parseLayout)("bottom-[33.333%]")).toEqual({bottom:"33.333%"});(0,_vitest.expect)((0,_layout.parseLayout)("bottom-[-15px]")).toEqual({bottom:-15});});(0,_vitest.it)("should parse arbitrary left values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("left-[60px]")).toEqual({left:60});(0,_vitest.expect)((0,_layout.parseLayout)("left-[45]")).toEqual({left:45});(0,_vitest.expect)((0,_layout.parseLayout)("left-[12.5%]")).toEqual({left:"12.5%"});(0,_vitest.expect)((0,_layout.parseLayout)("left-[-20px]")).toEqual({left:-20});});});(0,_vitest.describe)("parseLayout - inset utilities",function(){(0,_vitest.it)("should parse inset (all sides) values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-0")).toEqual({top:0,right:0,bottom:0,left:0});(0,_vitest.expect)((0,_layout.parseLayout)("inset-4")).toEqual({top:16,right:16,bottom:16,left:16});(0,_vitest.expect)((0,_layout.parseLayout)("inset-8")).toEqual({top:32,right:32,bottom:32,left:32});});(0,_vitest.it)("should parse inset-x (horizontal) values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-x-0")).toEqual({left:0,right:0});(0,_vitest.expect)((0,_layout.parseLayout)("inset-x-4")).toEqual({left:16,right:16});(0,_vitest.expect)((0,_layout.parseLayout)("inset-x-8")).toEqual({left:32,right:32});});(0,_vitest.it)("should parse inset-y (vertical) values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-y-0")).toEqual({top:0,bottom:0});(0,_vitest.expect)((0,_layout.parseLayout)("inset-y-4")).toEqual({top:16,bottom:16});(0,_vitest.expect)((0,_layout.parseLayout)("inset-y-8")).toEqual({top:32,bottom:32});});(0,_vitest.it)("should parse fractional inset values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-0.5")).toEqual({top:2,right:2,bottom:2,left:2});(0,_vitest.expect)((0,_layout.parseLayout)("inset-x-1.5")).toEqual({left:6,right:6});(0,_vitest.expect)((0,_layout.parseLayout)("inset-y-2.5")).toEqual({top:10,bottom:10});});(0,_vitest.it)("should return null for invalid inset values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-100")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("inset-x-100")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("inset-y-100")).toBeNull();});(0,_vitest.it)("should parse arbitrary inset (all sides) values with pixels",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-[10px]")).toEqual({top:10,right:10,bottom:10,left:10});(0,_vitest.expect)((0,_layout.parseLayout)("inset-[25px]")).toEqual({top:25,right:25,bottom:25,left:25});(0,_vitest.expect)((0,_layout.parseLayout)("inset-[0px]")).toEqual({top:0,right:0,bottom:0,left:0});});(0,_vitest.it)("should parse arbitrary inset values without unit (defaults to px)",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-[15]")).toEqual({top:15,right:15,bottom:15,left:15});(0,_vitest.expect)((0,_layout.parseLayout)("inset-[30]")).toEqual({top:30,right:30,bottom:30,left:30});});(0,_vitest.it)("should parse arbitrary inset values with percentages",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-[10%]")).toEqual({top:"10%",right:"10%",bottom:"10%",left:"10%"});(0,_vitest.expect)((0,_layout.parseLayout)("inset-[25%]")).toEqual({top:"25%",right:"25%",bottom:"25%",left:"25%"});(0,_vitest.expect)((0,_layout.parseLayout)("inset-[5.5%]")).toEqual({top:"5.5%",right:"5.5%",bottom:"5.5%",left:"5.5%"});});(0,_vitest.it)("should parse arbitrary inset-x (horizontal) values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-x-[20px]")).toEqual({left:20,right:20});(0,_vitest.expect)((0,_layout.parseLayout)("inset-x-[15]")).toEqual({left:15,right:15});(0,_vitest.expect)((0,_layout.parseLayout)("inset-x-[10%]")).toEqual({left:"10%",right:"10%"});});(0,_vitest.it)("should parse arbitrary inset-y (vertical) values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-y-[30px]")).toEqual({top:30,bottom:30});(0,_vitest.expect)((0,_layout.parseLayout)("inset-y-[25]")).toEqual({top:25,bottom:25});(0,_vitest.expect)((0,_layout.parseLayout)("inset-y-[15%]")).toEqual({top:"15%",bottom:"15%"});});(0,_vitest.it)("should parse negative arbitrary inset values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-[-5px]")).toEqual({top:-5,right:-5,bottom:-5,left:-5});(0,_vitest.expect)((0,_layout.parseLayout)("inset-x-[-10px]")).toEqual({left:-10,right:-10});(0,_vitest.expect)((0,_layout.parseLayout)("inset-y-[-15px]")).toEqual({top:-15,bottom:-15});(0,_vitest.expect)((0,_layout.parseLayout)("inset-[-20%]")).toEqual({top:"-20%",right:"-20%",bottom:"-20%",left:"-20%"});});});(0,_vitest.describe)("parseLayout - specific property coverage",function(){(0,_vitest.it)("should return unique objects for each class",function(){var flex1=(0,_layout.parseLayout)("flex");var flex2=(0,_layout.parseLayout)("flex");(0,_vitest.expect)(flex1).toEqual(flex2);});(0,_vitest.it)("should handle flex value variations",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-1")).toEqual({flex:1});(0,_vitest.expect)((0,_layout.parseLayout)("flex-auto")).toEqual({flex:1});(0,_vitest.expect)((0,_layout.parseLayout)("flex-none")).toEqual({flex:0});});(0,_vitest.it)("should distinguish between similar class names",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex")).not.toEqual((0,_layout.parseLayout)("flex-1"));(0,_vitest.expect)((0,_layout.parseLayout)("grow")).not.toEqual((0,_layout.parseLayout)("grow-0"));(0,_vitest.expect)((0,_layout.parseLayout)("shrink")).not.toEqual((0,_layout.parseLayout)("shrink-0"));});(0,_vitest.it)("should handle positioning with absolute/relative",function(){(0,_vitest.expect)((0,_layout.parseLayout)("absolute")).toEqual({position:"absolute"});(0,_vitest.expect)((0,_layout.parseLayout)("top-0")).toEqual({top:0});(0,_vitest.expect)((0,_layout.parseLayout)("left-0")).toEqual({left:0});});(0,_vitest.it)("should handle all positioning directions",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-4")).toHaveProperty("top");(0,_vitest.expect)((0,_layout.parseLayout)("right-4")).toHaveProperty("right");(0,_vitest.expect)((0,_layout.parseLayout)("bottom-4")).toHaveProperty("bottom");(0,_vitest.expect)((0,_layout.parseLayout)("left-4")).toHaveProperty("left");});(0,_vitest.it)("should handle inset shorthand variations",function(){var insetAll=(0,_layout.parseLayout)("inset-4");(0,_vitest.expect)(insetAll).toHaveProperty("top",16);(0,_vitest.expect)(insetAll).toHaveProperty("right",16);(0,_vitest.expect)(insetAll).toHaveProperty("bottom",16);(0,_vitest.expect)(insetAll).toHaveProperty("left",16);var insetX=(0,_layout.parseLayout)("inset-x-4");(0,_vitest.expect)(insetX).toHaveProperty("left",16);(0,_vitest.expect)(insetX).toHaveProperty("right",16);(0,_vitest.expect)(insetX).not.toHaveProperty("top");(0,_vitest.expect)(insetX).not.toHaveProperty("bottom");var insetY=(0,_layout.parseLayout)("inset-y-4");(0,_vitest.expect)(insetY).toHaveProperty("top",16);(0,_vitest.expect)(insetY).toHaveProperty("bottom",16);(0,_vitest.expect)(insetY).not.toHaveProperty("left");(0,_vitest.expect)(insetY).not.toHaveProperty("right");});});
@@ -1 +1 @@
1
- Object.defineProperty(exports,"__esModule",{value:true});exports.SIZE_SCALE=exports.SIZE_PERCENTAGES=void 0;exports.parseSizing=parseSizing;var SIZE_SCALE=exports.SIZE_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,7:28,8:32,9:36,10:40,11:44,12:48,14:56,16:64,20:80,24:96,28:112,32:128,36:144,40:160,44:176,48:192,52:208,56:224,60:240,64:256,72:288,80:320,96:384};var SIZE_PERCENTAGES=exports.SIZE_PERCENTAGES={full:"100%","1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%"};function parseArbitrarySize(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 size unit: ${value}. Only px and % are supported.`);}return null;}return null;}function parseSizing(cls){if(cls.startsWith("w-")){var sizeKey=cls.substring(2);var arbitrarySize=parseArbitrarySize(sizeKey);if(arbitrarySize!==null){return{width:arbitrarySize};}var percentage=SIZE_PERCENTAGES[sizeKey];if(percentage){return{width:percentage};}var numericSize=SIZE_SCALE[sizeKey];if(numericSize!==undefined){return{width:numericSize};}if(sizeKey==="auto"){return{width:"auto"};}}if(cls.startsWith("h-")){var _sizeKey=cls.substring(2);var _arbitrarySize=parseArbitrarySize(_sizeKey);if(_arbitrarySize!==null){return{height:_arbitrarySize};}var _percentage=SIZE_PERCENTAGES[_sizeKey];if(_percentage){return{height:_percentage};}var _numericSize=SIZE_SCALE[_sizeKey];if(_numericSize!==undefined){return{height:_numericSize};}if(_sizeKey==="auto"){return{height:"auto"};}}if(cls.startsWith("min-w-")){var _sizeKey2=cls.substring(6);var _arbitrarySize2=parseArbitrarySize(_sizeKey2);if(_arbitrarySize2!==null){return{minWidth:_arbitrarySize2};}var _percentage2=SIZE_PERCENTAGES[_sizeKey2];if(_percentage2){return{minWidth:_percentage2};}var _numericSize2=SIZE_SCALE[_sizeKey2];if(_numericSize2!==undefined){return{minWidth:_numericSize2};}}if(cls.startsWith("min-h-")){var _sizeKey3=cls.substring(6);var _arbitrarySize3=parseArbitrarySize(_sizeKey3);if(_arbitrarySize3!==null){return{minHeight:_arbitrarySize3};}var _percentage3=SIZE_PERCENTAGES[_sizeKey3];if(_percentage3){return{minHeight:_percentage3};}var _numericSize3=SIZE_SCALE[_sizeKey3];if(_numericSize3!==undefined){return{minHeight:_numericSize3};}}if(cls.startsWith("max-w-")){var _sizeKey4=cls.substring(6);var _arbitrarySize4=parseArbitrarySize(_sizeKey4);if(_arbitrarySize4!==null){return{maxWidth:_arbitrarySize4};}var _percentage4=SIZE_PERCENTAGES[_sizeKey4];if(_percentage4){return{maxWidth:_percentage4};}var _numericSize4=SIZE_SCALE[_sizeKey4];if(_numericSize4!==undefined){return{maxWidth:_numericSize4};}}if(cls.startsWith("max-h-")){var _sizeKey5=cls.substring(6);var _arbitrarySize5=parseArbitrarySize(_sizeKey5);if(_arbitrarySize5!==null){return{maxHeight:_arbitrarySize5};}var _percentage5=SIZE_PERCENTAGES[_sizeKey5];if(_percentage5){return{maxHeight:_percentage5};}var _numericSize5=SIZE_SCALE[_sizeKey5];if(_numericSize5!==undefined){return{maxHeight:_numericSize5};}}return null;}
1
+ Object.defineProperty(exports,"__esModule",{value:true});exports.SIZE_SCALE=exports.SIZE_PERCENTAGES=void 0;exports.parseSizing=parseSizing;var _markers=require("../config/markers");var SIZE_SCALE=exports.SIZE_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,7:28,8:32,9:36,10:40,11:44,12:48,14:56,16:64,20:80,24:96,28:112,32:128,36:144,40:160,44:176,48:192,52:208,56:224,60:240,64:256,72:288,80:320,96:384};var SIZE_PERCENTAGES=exports.SIZE_PERCENTAGES={full:"100%","1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%"};function parseArbitrarySize(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 size unit: ${value}. Only px and % are supported.`);}return null;}return null;}function parseSizing(cls){if(cls.startsWith("w-")){var sizeKey=cls.substring(2);if(sizeKey==="screen"){return{width:`${_markers.RUNTIME_DIMENSIONS_MARKER}width}}`};}var arbitrarySize=parseArbitrarySize(sizeKey);if(arbitrarySize!==null){return{width:arbitrarySize};}var percentage=SIZE_PERCENTAGES[sizeKey];if(percentage){return{width:percentage};}var numericSize=SIZE_SCALE[sizeKey];if(numericSize!==undefined){return{width:numericSize};}if(sizeKey==="auto"){return{width:"auto"};}}if(cls.startsWith("h-")){var _sizeKey=cls.substring(2);if(_sizeKey==="screen"){return{height:`${_markers.RUNTIME_DIMENSIONS_MARKER}height}}`};}var _arbitrarySize=parseArbitrarySize(_sizeKey);if(_arbitrarySize!==null){return{height:_arbitrarySize};}var _percentage=SIZE_PERCENTAGES[_sizeKey];if(_percentage){return{height:_percentage};}var _numericSize=SIZE_SCALE[_sizeKey];if(_numericSize!==undefined){return{height:_numericSize};}if(_sizeKey==="auto"){return{height:"auto"};}}if(cls.startsWith("min-w-")){var _sizeKey2=cls.substring(6);var _arbitrarySize2=parseArbitrarySize(_sizeKey2);if(_arbitrarySize2!==null){return{minWidth:_arbitrarySize2};}var _percentage2=SIZE_PERCENTAGES[_sizeKey2];if(_percentage2){return{minWidth:_percentage2};}var _numericSize2=SIZE_SCALE[_sizeKey2];if(_numericSize2!==undefined){return{minWidth:_numericSize2};}}if(cls.startsWith("min-h-")){var _sizeKey3=cls.substring(6);var _arbitrarySize3=parseArbitrarySize(_sizeKey3);if(_arbitrarySize3!==null){return{minHeight:_arbitrarySize3};}var _percentage3=SIZE_PERCENTAGES[_sizeKey3];if(_percentage3){return{minHeight:_percentage3};}var _numericSize3=SIZE_SCALE[_sizeKey3];if(_numericSize3!==undefined){return{minHeight:_numericSize3};}}if(cls.startsWith("max-w-")){var _sizeKey4=cls.substring(6);var _arbitrarySize4=parseArbitrarySize(_sizeKey4);if(_arbitrarySize4!==null){return{maxWidth:_arbitrarySize4};}var _percentage4=SIZE_PERCENTAGES[_sizeKey4];if(_percentage4){return{maxWidth:_percentage4};}var _numericSize4=SIZE_SCALE[_sizeKey4];if(_numericSize4!==undefined){return{maxWidth:_numericSize4};}}if(cls.startsWith("max-h-")){var _sizeKey5=cls.substring(6);var _arbitrarySize5=parseArbitrarySize(_sizeKey5);if(_arbitrarySize5!==null){return{maxHeight:_arbitrarySize5};}var _percentage5=SIZE_PERCENTAGES[_sizeKey5];if(_percentage5){return{maxHeight:_percentage5};}var _numericSize5=SIZE_SCALE[_sizeKey5];if(_numericSize5!==undefined){return{maxHeight:_numericSize5};}}return null;}
@@ -9,5 +9,6 @@ export declare const LINE_HEIGHT_SCALE: Record<string, number>;
9
9
  * Parse typography classes
10
10
  * @param cls - Class name to parse
11
11
  * @param customFontFamily - Optional custom fontFamily from tailwind.config
12
+ * @param customFontSize - Optional custom fontSize from tailwind.config
12
13
  */
13
- export declare function parseTypography(cls: string, customFontFamily?: Record<string, string>): StyleObject | null;
14
+ export declare function parseTypography(cls: string, customFontFamily?: Record<string, string>, customFontSize?: Record<string, number>): StyleObject | null;