@mgcrea/react-native-tailwind 0.14.0 → 0.15.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 (39) hide show
  1. package/README.md +12 -8
  2. package/dist/babel/config-loader.d.ts +10 -0
  3. package/dist/babel/config-loader.test.ts +75 -21
  4. package/dist/babel/config-loader.ts +100 -2
  5. package/dist/babel/index.cjs +101 -33
  6. package/dist/parser/index.d.ts +1 -0
  7. package/dist/parser/index.js +1 -1
  8. package/dist/parser/layout.d.ts +3 -1
  9. package/dist/parser/layout.js +1 -1
  10. package/dist/parser/layout.test.js +1 -1
  11. package/dist/parser/sizing.d.ts +3 -1
  12. package/dist/parser/sizing.js +1 -1
  13. package/dist/parser/sizing.test.js +1 -1
  14. package/dist/parser/spacing.d.ts +3 -1
  15. package/dist/parser/spacing.js +1 -1
  16. package/dist/parser/spacing.test.js +1 -1
  17. package/dist/parser/transforms.d.ts +3 -1
  18. package/dist/parser/transforms.js +1 -1
  19. package/dist/parser/transforms.test.js +1 -1
  20. package/dist/runtime.cjs +1 -1
  21. package/dist/runtime.cjs.map +3 -3
  22. package/dist/runtime.d.ts +2 -0
  23. package/dist/runtime.js +1 -1
  24. package/dist/runtime.js.map +3 -3
  25. package/dist/runtime.test.js +1 -1
  26. package/package.json +1 -1
  27. package/src/babel/config-loader.test.ts +75 -21
  28. package/src/babel/config-loader.ts +100 -2
  29. package/src/parser/index.ts +6 -5
  30. package/src/parser/layout.test.ts +94 -0
  31. package/src/parser/layout.ts +17 -12
  32. package/src/parser/sizing.test.ts +56 -0
  33. package/src/parser/sizing.ts +20 -15
  34. package/src/parser/spacing.test.ts +57 -0
  35. package/src/parser/spacing.ts +15 -10
  36. package/src/parser/transforms.test.ts +57 -0
  37. package/src/parser/transforms.ts +7 -3
  38. package/src/runtime.test.ts +149 -0
  39. package/src/runtime.ts +53 -1
@@ -1 +1 @@
1
- Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"expandSchemeModifier",{enumerable:true,get:function get(){return _modifiers.expandSchemeModifier;}});Object.defineProperty(exports,"hasModifier",{enumerable:true,get:function get(){return _modifiers.hasModifier;}});Object.defineProperty(exports,"isColorClass",{enumerable:true,get:function get(){return _modifiers.isColorClass;}});Object.defineProperty(exports,"isColorSchemeModifier",{enumerable:true,get:function get(){return _modifiers.isColorSchemeModifier;}});Object.defineProperty(exports,"isDirectionalModifier",{enumerable:true,get:function get(){return _modifiers.isDirectionalModifier;}});Object.defineProperty(exports,"isPlatformModifier",{enumerable:true,get:function get(){return _modifiers.isPlatformModifier;}});Object.defineProperty(exports,"isSchemeModifier",{enumerable:true,get:function get(){return _modifiers.isSchemeModifier;}});Object.defineProperty(exports,"isStateModifier",{enumerable:true,get:function get(){return _modifiers.isStateModifier;}});Object.defineProperty(exports,"parseAspectRatio",{enumerable:true,get:function get(){return _aspectRatio.parseAspectRatio;}});Object.defineProperty(exports,"parseBorder",{enumerable:true,get:function get(){return _borders.parseBorder;}});exports.parseClass=parseClass;exports.parseClassName=parseClassName;Object.defineProperty(exports,"parseColor",{enumerable:true,get:function get(){return _colors.parseColor;}});Object.defineProperty(exports,"parseLayout",{enumerable:true,get:function get(){return _layout.parseLayout;}});Object.defineProperty(exports,"parseModifier",{enumerable:true,get:function get(){return _modifiers.parseModifier;}});Object.defineProperty(exports,"parsePlaceholderClass",{enumerable:true,get:function get(){return _placeholder.parsePlaceholderClass;}});Object.defineProperty(exports,"parsePlaceholderClasses",{enumerable:true,get:function get(){return _placeholder.parsePlaceholderClasses;}});Object.defineProperty(exports,"parseShadow",{enumerable:true,get:function get(){return _shadows.parseShadow;}});Object.defineProperty(exports,"parseSizing",{enumerable:true,get:function get(){return _sizing.parseSizing;}});Object.defineProperty(exports,"parseSpacing",{enumerable:true,get:function get(){return _spacing.parseSpacing;}});Object.defineProperty(exports,"parseTransform",{enumerable:true,get:function get(){return _transforms.parseTransform;}});Object.defineProperty(exports,"parseTypography",{enumerable:true,get:function get(){return _typography.parseTypography;}});Object.defineProperty(exports,"splitModifierClasses",{enumerable:true,get:function get(){return _modifiers.splitModifierClasses;}});var _aspectRatio=require("./aspectRatio");var _borders=require("./borders");var _colors=require("./colors");var _layout=require("./layout");var _shadows=require("./shadows");var _sizing=require("./sizing");var _spacing=require("./spacing");var _transforms=require("./transforms");var _typography=require("./typography");var _placeholder=require("./placeholder");var _modifiers=require("./modifiers");function parseClassName(className,customTheme){var classes=className.split(/\s+/).filter(Boolean);var style={};for(var cls of classes){var parsedStyle=parseClass(cls,customTheme);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
+ Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"expandSchemeModifier",{enumerable:true,get:function get(){return _modifiers.expandSchemeModifier;}});Object.defineProperty(exports,"hasModifier",{enumerable:true,get:function get(){return _modifiers.hasModifier;}});Object.defineProperty(exports,"isColorClass",{enumerable:true,get:function get(){return _modifiers.isColorClass;}});Object.defineProperty(exports,"isColorSchemeModifier",{enumerable:true,get:function get(){return _modifiers.isColorSchemeModifier;}});Object.defineProperty(exports,"isDirectionalModifier",{enumerable:true,get:function get(){return _modifiers.isDirectionalModifier;}});Object.defineProperty(exports,"isPlatformModifier",{enumerable:true,get:function get(){return _modifiers.isPlatformModifier;}});Object.defineProperty(exports,"isSchemeModifier",{enumerable:true,get:function get(){return _modifiers.isSchemeModifier;}});Object.defineProperty(exports,"isStateModifier",{enumerable:true,get:function get(){return _modifiers.isStateModifier;}});Object.defineProperty(exports,"parseAspectRatio",{enumerable:true,get:function get(){return _aspectRatio.parseAspectRatio;}});Object.defineProperty(exports,"parseBorder",{enumerable:true,get:function get(){return _borders.parseBorder;}});exports.parseClass=parseClass;exports.parseClassName=parseClassName;Object.defineProperty(exports,"parseColor",{enumerable:true,get:function get(){return _colors.parseColor;}});Object.defineProperty(exports,"parseLayout",{enumerable:true,get:function get(){return _layout.parseLayout;}});Object.defineProperty(exports,"parseModifier",{enumerable:true,get:function get(){return _modifiers.parseModifier;}});Object.defineProperty(exports,"parsePlaceholderClass",{enumerable:true,get:function get(){return _placeholder.parsePlaceholderClass;}});Object.defineProperty(exports,"parsePlaceholderClasses",{enumerable:true,get:function get(){return _placeholder.parsePlaceholderClasses;}});Object.defineProperty(exports,"parseShadow",{enumerable:true,get:function get(){return _shadows.parseShadow;}});Object.defineProperty(exports,"parseSizing",{enumerable:true,get:function get(){return _sizing.parseSizing;}});Object.defineProperty(exports,"parseSpacing",{enumerable:true,get:function get(){return _spacing.parseSpacing;}});Object.defineProperty(exports,"parseTransform",{enumerable:true,get:function get(){return _transforms.parseTransform;}});Object.defineProperty(exports,"parseTypography",{enumerable:true,get:function get(){return _typography.parseTypography;}});Object.defineProperty(exports,"splitModifierClasses",{enumerable:true,get:function get(){return _modifiers.splitModifierClasses;}});var _aspectRatio=require("./aspectRatio");var _borders=require("./borders");var _colors=require("./colors");var _layout=require("./layout");var _shadows=require("./shadows");var _sizing=require("./sizing");var _spacing=require("./spacing");var _transforms=require("./transforms");var _typography=require("./typography");var _placeholder=require("./placeholder");var _modifiers=require("./modifiers");function parseClassName(className,customTheme){var classes=className.split(/\s+/).filter(Boolean);var style={};for(var cls of classes){var parsedStyle=parseClass(cls,customTheme);Object.assign(style,parsedStyle);}return style;}function parseClass(cls,customTheme){var parsers=[function(cls){return(0,_spacing.parseSpacing)(cls,customTheme==null?void 0:customTheme.spacing);},function(cls){return(0,_borders.parseBorder)(cls,customTheme==null?void 0:customTheme.colors);},function(cls){return(0,_colors.parseColor)(cls,customTheme==null?void 0:customTheme.colors);},function(cls){return(0,_layout.parseLayout)(cls,customTheme==null?void 0:customTheme.spacing);},function(cls){return(0,_typography.parseTypography)(cls,customTheme==null?void 0:customTheme.fontFamily,customTheme==null?void 0:customTheme.fontSize);},function(cls){return(0,_sizing.parseSizing)(cls,customTheme==null?void 0:customTheme.spacing);},_shadows.parseShadow,_aspectRatio.parseAspectRatio,function(cls){return(0,_transforms.parseTransform)(cls,customTheme==null?void 0:customTheme.spacing);}];for(var parser of parsers){var result=parser(cls);if(result!==null){return result;}}if(process.env.NODE_ENV!=="production"){console.warn(`[react-native-tailwind] Unknown class: "${cls}"`);}return{};}
@@ -6,5 +6,7 @@ export declare const Z_INDEX_SCALE: Record<string, number>;
6
6
  export declare const INSET_SCALE: Record<string, number>;
7
7
  /**
8
8
  * Parse layout classes
9
+ * @param cls - The class name to parse
10
+ * @param customSpacing - Optional custom spacing values from tailwind.config (for inset utilities)
9
11
  */
10
- export declare function parseLayout(cls: string): StyleObject | null;
12
+ export declare function parseLayout(cls: string, customSpacing?: Record<string, number>): StyleObject | null;
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.Z_INDEX_SCALE=exports.INSET_SCALE=void 0;exports.parseLayout=parseLayout;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));function parseArbitraryInset(value){var pxMatch=value.match(/^\[(-?\d+)(?:px)?\]$/);if(pxMatch){return parseInt(pxMatch[1],10);}var percentMatch=value.match(/^\[(-?\d+(?:\.\d+)?)%\]$/);if(percentMatch){return`${percentMatch[1]}%`;}if(value.startsWith("[")&&value.endsWith("]")){if(process.env.NODE_ENV!=="production"){console.warn(`[react-native-tailwind] Unsupported arbitrary inset unit: ${value}. Only px and % are supported.`);}return null;}return null;}function parseArbitraryZIndex(value){var zMatch=value.match(/^\[(-?\d+)\]$/);if(zMatch){return parseInt(zMatch[1],10);}if(value.startsWith("[")&&value.endsWith("]")){if(process.env.NODE_ENV!=="production"){console.warn(`[react-native-tailwind] Invalid arbitrary z-index: ${value}. Only integers are supported.`);}return null;}return null;}function parseArbitraryGrowShrink(value){var match=value.match(/^\[(\d+(?:\.\d+)?|\.\d+)\]$/);if(match){return parseFloat(match[1]);}if(value.startsWith("[")&&value.endsWith("]")){if(process.env.NODE_ENV!=="production"){console.warn(`[react-native-tailwind] Invalid arbitrary grow/shrink value: ${value}. Only non-negative numbers are supported (e.g., [1.5], [2], [0.5], [.5]).`);}return null;}return null;}var DISPLAY_MAP={flex:{display:"flex"},hidden:{display:"none"}};var FLEX_DIRECTION_MAP={"flex-row":{flexDirection:"row"},"flex-row-reverse":{flexDirection:"row-reverse"},"flex-col":{flexDirection:"column"},"flex-col-reverse":{flexDirection:"column-reverse"}};var FLEX_WRAP_MAP={"flex-wrap":{flexWrap:"wrap"},"flex-wrap-reverse":{flexWrap:"wrap-reverse"},"flex-nowrap":{flexWrap:"nowrap"}};var FLEX_MAP={"flex-1":{flex:1},"flex-auto":{flex:1},"flex-none":{flex:0}};var GROW_SHRINK_MAP={grow:{flexGrow:1},"grow-0":{flexGrow:0},shrink:{flexShrink:1},"shrink-0":{flexShrink:0},"flex-grow":{flexGrow:1},"flex-grow-0":{flexGrow:0},"flex-shrink":{flexShrink:1},"flex-shrink-0":{flexShrink:0}};var JUSTIFY_CONTENT_MAP={"justify-start":{justifyContent:"flex-start"},"justify-end":{justifyContent:"flex-end"},"justify-center":{justifyContent:"center"},"justify-between":{justifyContent:"space-between"},"justify-around":{justifyContent:"space-around"},"justify-evenly":{justifyContent:"space-evenly"}};var ALIGN_ITEMS_MAP={"items-start":{alignItems:"flex-start"},"items-end":{alignItems:"flex-end"},"items-center":{alignItems:"center"},"items-baseline":{alignItems:"baseline"},"items-stretch":{alignItems:"stretch"}};var ALIGN_SELF_MAP={"self-auto":{alignSelf:"auto"},"self-start":{alignSelf:"flex-start"},"self-end":{alignSelf:"flex-end"},"self-center":{alignSelf:"center"},"self-stretch":{alignSelf:"stretch"},"self-baseline":{alignSelf:"baseline"}};var ALIGN_CONTENT_MAP={"content-start":{alignContent:"flex-start"},"content-end":{alignContent:"flex-end"},"content-center":{alignContent:"center"},"content-between":{alignContent:"space-between"},"content-around":{alignContent:"space-around"},"content-stretch":{alignContent:"stretch"}};var POSITION_MAP={absolute:{position:"absolute"},relative:{position:"relative"}};var OVERFLOW_MAP={"overflow-hidden":{overflow:"hidden"},"overflow-visible":{overflow:"visible"},"overflow-scroll":{overflow:"scroll"}};var OPACITY_MAP={"opacity-0":{opacity:0},"opacity-5":{opacity:0.05},"opacity-10":{opacity:0.1},"opacity-15":{opacity:0.15},"opacity-20":{opacity:0.2},"opacity-25":{opacity:0.25},"opacity-30":{opacity:0.3},"opacity-35":{opacity:0.35},"opacity-40":{opacity:0.4},"opacity-45":{opacity:0.45},"opacity-50":{opacity:0.5},"opacity-55":{opacity:0.55},"opacity-60":{opacity:0.6},"opacity-65":{opacity:0.65},"opacity-70":{opacity:0.7},"opacity-75":{opacity:0.75},"opacity-80":{opacity:0.8},"opacity-85":{opacity:0.85},"opacity-90":{opacity:0.9},"opacity-95":{opacity:0.95},"opacity-100":{opacity:1}};var Z_INDEX_SCALE=exports.Z_INDEX_SCALE={0:0,10:10,20:20,30:30,40:40,50:50,auto:0};var INSET_SCALE=exports.INSET_SCALE={0:0,0.5:2,1:4,1.5:6,2:8,2.5:10,3:12,3.5:14,4:16,5:20,6:24,8:32,10:40,12:48,16:64,20:80,24:96};function parseLayout(cls){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};}}var startMatch=cls.match(/^(-?)start-(.+)$/);if(startMatch){var _startMatch=(0,_slicedToArray2.default)(startMatch,3),negPrefix=_startMatch[1],startKey=_startMatch[2];var isNegative=negPrefix==="-";if(startKey==="auto"){return{};}var arbitraryStart=parseArbitraryInset(startKey);if(arbitraryStart!==null){if(typeof arbitraryStart==="number"){return{start:isNegative?-arbitraryStart:arbitraryStart};}if(isNegative&&arbitraryStart.endsWith("%")){var numValue=parseFloat(arbitraryStart);return{start:`${-numValue}%`};}return{start:arbitraryStart};}var startValue=INSET_SCALE[startKey];if(startValue!==undefined){return{start:isNegative?-startValue:startValue};}}var endMatch=cls.match(/^(-?)end-(.+)$/);if(endMatch){var _endMatch=(0,_slicedToArray2.default)(endMatch,3),_negPrefix=_endMatch[1],endKey=_endMatch[2];var _isNegative=_negPrefix==="-";if(endKey==="auto"){return{};}var arbitraryEnd=parseArbitraryInset(endKey);if(arbitraryEnd!==null){if(typeof arbitraryEnd==="number"){return{end:_isNegative?-arbitraryEnd:arbitraryEnd};}if(_isNegative&&arbitraryEnd.endsWith("%")){var _numValue=parseFloat(arbitraryEnd);return{end:`${-_numValue}%`};}return{end:arbitraryEnd};}var endValue=INSET_SCALE[endKey];if(endValue!==undefined){return{end:_isNegative?-endValue:endValue};}}if(cls.startsWith("inset-x-")){var insetKey=cls.substring(8);var arbitraryInset=parseArbitraryInset(insetKey);if(arbitraryInset!==null){return{left:arbitraryInset,right:arbitraryInset};}var insetValue=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-s-")){var _insetKey2=cls.substring(8);var _arbitraryInset2=parseArbitraryInset(_insetKey2);if(_arbitraryInset2!==null){return{start:_arbitraryInset2};}var _insetValue2=INSET_SCALE[_insetKey2];if(_insetValue2!==undefined){return{start:_insetValue2};}}if(cls.startsWith("inset-e-")){var _insetKey3=cls.substring(8);var _arbitraryInset3=parseArbitraryInset(_insetKey3);if(_arbitraryInset3!==null){return{end:_arbitraryInset3};}var _insetValue3=INSET_SCALE[_insetKey3];if(_insetValue3!==undefined){return{end:_insetValue3};}}if(cls.startsWith("inset-")){var _insetKey4=cls.substring(6);var _arbitraryInset4=parseArbitraryInset(_insetKey4);if(_arbitraryInset4!==null){return{top:_arbitraryInset4,right:_arbitraryInset4,bottom:_arbitraryInset4,left:_arbitraryInset4};}var _insetValue4=INSET_SCALE[_insetKey4];if(_insetValue4!==undefined){return{top:_insetValue4,right:_insetValue4,bottom:_insetValue4,left:_insetValue4};}}if(cls.startsWith("grow-")||cls.startsWith("flex-grow-")){var prefix=cls.startsWith("flex-grow-")?"flex-grow-":"grow-";var growKey=cls.substring(prefix.length);var arbitraryGrow=parseArbitraryGrowShrink(growKey);if(arbitraryGrow!==null){return{flexGrow:arbitraryGrow};}}if(cls.startsWith("shrink-")||cls.startsWith("flex-shrink-")){var _prefix=cls.startsWith("flex-shrink-")?"flex-shrink-":"shrink-";var shrinkKey=cls.substring(_prefix.length);var arbitraryShrink=parseArbitraryGrowShrink(shrinkKey);if(arbitraryShrink!==null){return{flexShrink:arbitraryShrink};}}return(_ref=(_ref2=(_ref3=(_ref4=(_ref5=(_ref6=(_ref7=(_ref8=(_ref9=(_ref0=(_ref1=(_DISPLAY_MAP$cls=DISPLAY_MAP[cls])!=null?_DISPLAY_MAP$cls:FLEX_DIRECTION_MAP[cls])!=null?_ref1:FLEX_WRAP_MAP[cls])!=null?_ref0:FLEX_MAP[cls])!=null?_ref9:GROW_SHRINK_MAP[cls])!=null?_ref8:JUSTIFY_CONTENT_MAP[cls])!=null?_ref7:ALIGN_ITEMS_MAP[cls])!=null?_ref6:ALIGN_SELF_MAP[cls])!=null?_ref5:ALIGN_CONTENT_MAP[cls])!=null?_ref4:POSITION_MAP[cls])!=null?_ref3:OVERFLOW_MAP[cls])!=null?_ref2:OPACITY_MAP[cls])!=null?_ref:null;}
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.Z_INDEX_SCALE=exports.INSET_SCALE=void 0;exports.parseLayout=parseLayout;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));function parseArbitraryInset(value){var pxMatch=value.match(/^\[(-?\d+)(?:px)?\]$/);if(pxMatch){return parseInt(pxMatch[1],10);}var percentMatch=value.match(/^\[(-?\d+(?:\.\d+)?)%\]$/);if(percentMatch){return`${percentMatch[1]}%`;}if(value.startsWith("[")&&value.endsWith("]")){if(process.env.NODE_ENV!=="production"){console.warn(`[react-native-tailwind] Unsupported arbitrary inset unit: ${value}. Only px and % are supported.`);}return null;}return null;}function parseArbitraryZIndex(value){var zMatch=value.match(/^\[(-?\d+)\]$/);if(zMatch){return parseInt(zMatch[1],10);}if(value.startsWith("[")&&value.endsWith("]")){if(process.env.NODE_ENV!=="production"){console.warn(`[react-native-tailwind] Invalid arbitrary z-index: ${value}. Only integers are supported.`);}return null;}return null;}function parseArbitraryGrowShrink(value){var match=value.match(/^\[(\d+(?:\.\d+)?|\.\d+)\]$/);if(match){return parseFloat(match[1]);}if(value.startsWith("[")&&value.endsWith("]")){if(process.env.NODE_ENV!=="production"){console.warn(`[react-native-tailwind] Invalid arbitrary grow/shrink value: ${value}. Only non-negative numbers are supported (e.g., [1.5], [2], [0.5], [.5]).`);}return null;}return null;}var DISPLAY_MAP={flex:{display:"flex"},hidden:{display:"none"}};var FLEX_DIRECTION_MAP={"flex-row":{flexDirection:"row"},"flex-row-reverse":{flexDirection:"row-reverse"},"flex-col":{flexDirection:"column"},"flex-col-reverse":{flexDirection:"column-reverse"}};var FLEX_WRAP_MAP={"flex-wrap":{flexWrap:"wrap"},"flex-wrap-reverse":{flexWrap:"wrap-reverse"},"flex-nowrap":{flexWrap:"nowrap"}};var FLEX_MAP={"flex-1":{flex:1},"flex-auto":{flex:1},"flex-none":{flex:0}};var GROW_SHRINK_MAP={grow:{flexGrow:1},"grow-0":{flexGrow:0},shrink:{flexShrink:1},"shrink-0":{flexShrink:0},"flex-grow":{flexGrow:1},"flex-grow-0":{flexGrow:0},"flex-shrink":{flexShrink:1},"flex-shrink-0":{flexShrink:0}};var JUSTIFY_CONTENT_MAP={"justify-start":{justifyContent:"flex-start"},"justify-end":{justifyContent:"flex-end"},"justify-center":{justifyContent:"center"},"justify-between":{justifyContent:"space-between"},"justify-around":{justifyContent:"space-around"},"justify-evenly":{justifyContent:"space-evenly"}};var ALIGN_ITEMS_MAP={"items-start":{alignItems:"flex-start"},"items-end":{alignItems:"flex-end"},"items-center":{alignItems:"center"},"items-baseline":{alignItems:"baseline"},"items-stretch":{alignItems:"stretch"}};var ALIGN_SELF_MAP={"self-auto":{alignSelf:"auto"},"self-start":{alignSelf:"flex-start"},"self-end":{alignSelf:"flex-end"},"self-center":{alignSelf:"center"},"self-stretch":{alignSelf:"stretch"},"self-baseline":{alignSelf:"baseline"}};var ALIGN_CONTENT_MAP={"content-start":{alignContent:"flex-start"},"content-end":{alignContent:"flex-end"},"content-center":{alignContent:"center"},"content-between":{alignContent:"space-between"},"content-around":{alignContent:"space-around"},"content-stretch":{alignContent:"stretch"}};var POSITION_MAP={absolute:{position:"absolute"},relative:{position:"relative"}};var OVERFLOW_MAP={"overflow-hidden":{overflow:"hidden"},"overflow-visible":{overflow:"visible"},"overflow-scroll":{overflow:"scroll"}};var OPACITY_MAP={"opacity-0":{opacity:0},"opacity-5":{opacity:0.05},"opacity-10":{opacity:0.1},"opacity-15":{opacity:0.15},"opacity-20":{opacity:0.2},"opacity-25":{opacity:0.25},"opacity-30":{opacity:0.3},"opacity-35":{opacity:0.35},"opacity-40":{opacity:0.4},"opacity-45":{opacity:0.45},"opacity-50":{opacity:0.5},"opacity-55":{opacity:0.55},"opacity-60":{opacity:0.6},"opacity-65":{opacity:0.65},"opacity-70":{opacity:0.7},"opacity-75":{opacity:0.75},"opacity-80":{opacity:0.8},"opacity-85":{opacity:0.85},"opacity-90":{opacity:0.9},"opacity-95":{opacity:0.95},"opacity-100":{opacity:1}};var Z_INDEX_SCALE=exports.Z_INDEX_SCALE={0:0,10:10,20:20,30:30,40:40,50:50,auto:0};var INSET_SCALE=exports.INSET_SCALE={0:0,0.5:2,1:4,1.5:6,2:8,2.5:10,3:12,3.5:14,4:16,5:20,6:24,8:32,10:40,12:48,16:64,20:80,24:96};function parseLayout(cls,customSpacing){var _ref,_ref2,_ref3,_ref4,_ref5,_ref6,_ref7,_ref8,_ref9,_ref0,_ref1,_DISPLAY_MAP$cls;var insetMap=customSpacing?Object.assign({},INSET_SCALE,customSpacing):INSET_SCALE;if(cls.startsWith("z-")){var zKey=cls.substring(2);var arbitraryZ=parseArbitraryZIndex(zKey);if(arbitraryZ!==null){return{zIndex:arbitraryZ};}var zValue=Z_INDEX_SCALE[zKey];if(zValue!==undefined){return{zIndex:zValue};}}if(cls.startsWith("top-")){var topKey=cls.substring(4);if(topKey==="auto"){return{};}var arbitraryTop=parseArbitraryInset(topKey);if(arbitraryTop!==null){return{top:arbitraryTop};}var topValue=insetMap[topKey];if(topValue!==undefined){return{top:topValue};}}if(cls.startsWith("right-")){var rightKey=cls.substring(6);if(rightKey==="auto"){return{};}var arbitraryRight=parseArbitraryInset(rightKey);if(arbitraryRight!==null){return{right:arbitraryRight};}var rightValue=insetMap[rightKey];if(rightValue!==undefined){return{right:rightValue};}}if(cls.startsWith("bottom-")){var bottomKey=cls.substring(7);if(bottomKey==="auto"){return{};}var arbitraryBottom=parseArbitraryInset(bottomKey);if(arbitraryBottom!==null){return{bottom:arbitraryBottom};}var bottomValue=insetMap[bottomKey];if(bottomValue!==undefined){return{bottom:bottomValue};}}if(cls.startsWith("left-")){var leftKey=cls.substring(5);if(leftKey==="auto"){return{};}var arbitraryLeft=parseArbitraryInset(leftKey);if(arbitraryLeft!==null){return{left:arbitraryLeft};}var leftValue=insetMap[leftKey];if(leftValue!==undefined){return{left:leftValue};}}var startMatch=cls.match(/^(-?)start-(.+)$/);if(startMatch){var _startMatch=(0,_slicedToArray2.default)(startMatch,3),negPrefix=_startMatch[1],startKey=_startMatch[2];var isNegative=negPrefix==="-";if(startKey==="auto"){return{};}var arbitraryStart=parseArbitraryInset(startKey);if(arbitraryStart!==null){if(typeof arbitraryStart==="number"){return{start:isNegative?-arbitraryStart:arbitraryStart};}if(isNegative&&arbitraryStart.endsWith("%")){var numValue=parseFloat(arbitraryStart);return{start:`${-numValue}%`};}return{start:arbitraryStart};}var startValue=insetMap[startKey];if(startValue!==undefined){return{start:isNegative?-startValue:startValue};}}var endMatch=cls.match(/^(-?)end-(.+)$/);if(endMatch){var _endMatch=(0,_slicedToArray2.default)(endMatch,3),_negPrefix=_endMatch[1],endKey=_endMatch[2];var _isNegative=_negPrefix==="-";if(endKey==="auto"){return{};}var arbitraryEnd=parseArbitraryInset(endKey);if(arbitraryEnd!==null){if(typeof arbitraryEnd==="number"){return{end:_isNegative?-arbitraryEnd:arbitraryEnd};}if(_isNegative&&arbitraryEnd.endsWith("%")){var _numValue=parseFloat(arbitraryEnd);return{end:`${-_numValue}%`};}return{end:arbitraryEnd};}var endValue=insetMap[endKey];if(endValue!==undefined){return{end:_isNegative?-endValue:endValue};}}if(cls.startsWith("inset-x-")){var insetKey=cls.substring(8);var arbitraryInset=parseArbitraryInset(insetKey);if(arbitraryInset!==null){return{left:arbitraryInset,right:arbitraryInset};}var insetValue=insetMap[insetKey];if(insetValue!==undefined){return{left:insetValue,right:insetValue};}}if(cls.startsWith("inset-y-")){var _insetKey=cls.substring(8);var _arbitraryInset=parseArbitraryInset(_insetKey);if(_arbitraryInset!==null){return{top:_arbitraryInset,bottom:_arbitraryInset};}var _insetValue=insetMap[_insetKey];if(_insetValue!==undefined){return{top:_insetValue,bottom:_insetValue};}}if(cls.startsWith("inset-s-")){var _insetKey2=cls.substring(8);var _arbitraryInset2=parseArbitraryInset(_insetKey2);if(_arbitraryInset2!==null){return{start:_arbitraryInset2};}var _insetValue2=insetMap[_insetKey2];if(_insetValue2!==undefined){return{start:_insetValue2};}}if(cls.startsWith("inset-e-")){var _insetKey3=cls.substring(8);var _arbitraryInset3=parseArbitraryInset(_insetKey3);if(_arbitraryInset3!==null){return{end:_arbitraryInset3};}var _insetValue3=insetMap[_insetKey3];if(_insetValue3!==undefined){return{end:_insetValue3};}}if(cls.startsWith("inset-")){var _insetKey4=cls.substring(6);var _arbitraryInset4=parseArbitraryInset(_insetKey4);if(_arbitraryInset4!==null){return{top:_arbitraryInset4,right:_arbitraryInset4,bottom:_arbitraryInset4,left:_arbitraryInset4};}var _insetValue4=insetMap[_insetKey4];if(_insetValue4!==undefined){return{top:_insetValue4,right:_insetValue4,bottom:_insetValue4,left:_insetValue4};}}if(cls.startsWith("grow-")||cls.startsWith("flex-grow-")){var prefix=cls.startsWith("flex-grow-")?"flex-grow-":"grow-";var growKey=cls.substring(prefix.length);var arbitraryGrow=parseArbitraryGrowShrink(growKey);if(arbitraryGrow!==null){return{flexGrow:arbitraryGrow};}}if(cls.startsWith("shrink-")||cls.startsWith("flex-shrink-")){var _prefix=cls.startsWith("flex-shrink-")?"flex-shrink-":"shrink-";var shrinkKey=cls.substring(_prefix.length);var arbitraryShrink=parseArbitraryGrowShrink(shrinkKey);if(arbitraryShrink!==null){return{flexShrink:arbitraryShrink};}}return(_ref=(_ref2=(_ref3=(_ref4=(_ref5=(_ref6=(_ref7=(_ref8=(_ref9=(_ref0=(_ref1=(_DISPLAY_MAP$cls=DISPLAY_MAP[cls])!=null?_DISPLAY_MAP$cls:FLEX_DIRECTION_MAP[cls])!=null?_ref1:FLEX_WRAP_MAP[cls])!=null?_ref0:FLEX_MAP[cls])!=null?_ref9:GROW_SHRINK_MAP[cls])!=null?_ref8:JUSTIFY_CONTENT_MAP[cls])!=null?_ref7:ALIGN_ITEMS_MAP[cls])!=null?_ref6:ALIGN_SELF_MAP[cls])!=null?_ref5:ALIGN_CONTENT_MAP[cls])!=null?_ref4:POSITION_MAP[cls])!=null?_ref3:OVERFLOW_MAP[cls])!=null?_ref2:OPACITY_MAP[cls])!=null?_ref:null;}
@@ -1 +1 @@
1
- var _vitest=require("vitest");var _layout=require("./layout");(0,_vitest.describe)("parseLayout - display utilities",function(){(0,_vitest.it)("should parse display flex",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex")).toEqual({display:"flex"});});(0,_vitest.it)("should parse display hidden",function(){(0,_vitest.expect)((0,_layout.parseLayout)("hidden")).toEqual({display:"none"});});});(0,_vitest.describe)("parseLayout - flex direction utilities",function(){(0,_vitest.it)("should parse flex row",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-row")).toEqual({flexDirection:"row"});});(0,_vitest.it)("should parse flex row reverse",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-row-reverse")).toEqual({flexDirection:"row-reverse"});});(0,_vitest.it)("should parse flex column",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-col")).toEqual({flexDirection:"column"});});(0,_vitest.it)("should parse flex column reverse",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-col-reverse")).toEqual({flexDirection:"column-reverse"});});});(0,_vitest.describe)("parseLayout - flex wrap utilities",function(){(0,_vitest.it)("should parse flex wrap",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-wrap")).toEqual({flexWrap:"wrap"});});(0,_vitest.it)("should parse flex wrap reverse",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-wrap-reverse")).toEqual({flexWrap:"wrap-reverse"});});(0,_vitest.it)("should parse flex nowrap",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-nowrap")).toEqual({flexWrap:"nowrap"});});});(0,_vitest.describe)("parseLayout - flex utilities",function(){(0,_vitest.it)("should parse flex-1",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-1")).toEqual({flex:1});});(0,_vitest.it)("should parse flex-auto",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-auto")).toEqual({flex:1});});(0,_vitest.it)("should parse flex-none",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-none")).toEqual({flex:0});});});(0,_vitest.describe)("parseLayout - flex grow/shrink utilities",function(){(0,_vitest.it)("should parse grow",function(){(0,_vitest.expect)((0,_layout.parseLayout)("grow")).toEqual({flexGrow:1});});(0,_vitest.it)("should parse grow-0",function(){(0,_vitest.expect)((0,_layout.parseLayout)("grow-0")).toEqual({flexGrow:0});});(0,_vitest.it)("should parse shrink",function(){(0,_vitest.expect)((0,_layout.parseLayout)("shrink")).toEqual({flexShrink:1});});(0,_vitest.it)("should parse shrink-0",function(){(0,_vitest.expect)((0,_layout.parseLayout)("shrink-0")).toEqual({flexShrink:0});});(0,_vitest.it)("should parse grow with arbitrary values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("grow-[1.5]")).toEqual({flexGrow:1.5});(0,_vitest.expect)((0,_layout.parseLayout)("grow-[2]")).toEqual({flexGrow:2});(0,_vitest.expect)((0,_layout.parseLayout)("grow-[0.5]")).toEqual({flexGrow:0.5});(0,_vitest.expect)((0,_layout.parseLayout)("grow-[3]")).toEqual({flexGrow:3});(0,_vitest.expect)((0,_layout.parseLayout)("grow-[0]")).toEqual({flexGrow:0});});(0,_vitest.it)("should parse shrink with arbitrary values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("shrink-[0.5]")).toEqual({flexShrink:0.5});(0,_vitest.expect)((0,_layout.parseLayout)("shrink-[2]")).toEqual({flexShrink:2});(0,_vitest.expect)((0,_layout.parseLayout)("shrink-[1.5]")).toEqual({flexShrink:1.5});(0,_vitest.expect)((0,_layout.parseLayout)("shrink-[3]")).toEqual({flexShrink:3});(0,_vitest.expect)((0,_layout.parseLayout)("shrink-[0]")).toEqual({flexShrink:0});});(0,_vitest.it)("should parse CSS-style flex-grow aliases",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-grow")).toEqual({flexGrow:1});(0,_vitest.expect)((0,_layout.parseLayout)("flex-grow-0")).toEqual({flexGrow:0});});(0,_vitest.it)("should parse CSS-style flex-shrink aliases",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-shrink")).toEqual({flexShrink:1});(0,_vitest.expect)((0,_layout.parseLayout)("flex-shrink-0")).toEqual({flexShrink:0});});(0,_vitest.it)("should parse CSS-style flex-grow with arbitrary values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-grow-[1.5]")).toEqual({flexGrow:1.5});(0,_vitest.expect)((0,_layout.parseLayout)("flex-grow-[2]")).toEqual({flexGrow:2});(0,_vitest.expect)((0,_layout.parseLayout)("flex-grow-[0.5]")).toEqual({flexGrow:0.5});});(0,_vitest.it)("should parse CSS-style flex-shrink with arbitrary values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-shrink-[0.5]")).toEqual({flexShrink:0.5});(0,_vitest.expect)((0,_layout.parseLayout)("flex-shrink-[2]")).toEqual({flexShrink:2});(0,_vitest.expect)((0,_layout.parseLayout)("flex-shrink-[1.5]")).toEqual({flexShrink:1.5});});(0,_vitest.it)("should handle edge case values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("grow-[0.1]")).toEqual({flexGrow:0.1});(0,_vitest.expect)((0,_layout.parseLayout)("grow-[10]")).toEqual({flexGrow:10});(0,_vitest.expect)((0,_layout.parseLayout)("shrink-[0.01]")).toEqual({flexShrink:0.01});(0,_vitest.expect)((0,_layout.parseLayout)("shrink-[100]")).toEqual({flexShrink:100});});(0,_vitest.it)("should parse Tailwind shorthand decimals (no leading zero)",function(){(0,_vitest.expect)((0,_layout.parseLayout)("grow-[.5]")).toEqual({flexGrow:0.5});(0,_vitest.expect)((0,_layout.parseLayout)("grow-[.75]")).toEqual({flexGrow:0.75});(0,_vitest.expect)((0,_layout.parseLayout)("shrink-[.5]")).toEqual({flexShrink:0.5});(0,_vitest.expect)((0,_layout.parseLayout)("shrink-[.25]")).toEqual({flexShrink:0.25});(0,_vitest.expect)((0,_layout.parseLayout)("flex-grow-[.5]")).toEqual({flexGrow:0.5});(0,_vitest.expect)((0,_layout.parseLayout)("flex-shrink-[.5]")).toEqual({flexShrink:0.5});});(0,_vitest.it)("should reject negative values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("grow-[-1]")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("shrink-[-1]")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("flex-grow-[-2]")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("flex-shrink-[-0.5]")).toBeNull();});});(0,_vitest.describe)("parseLayout - justify content utilities",function(){(0,_vitest.it)("should parse justify-start",function(){(0,_vitest.expect)((0,_layout.parseLayout)("justify-start")).toEqual({justifyContent:"flex-start"});});(0,_vitest.it)("should parse justify-end",function(){(0,_vitest.expect)((0,_layout.parseLayout)("justify-end")).toEqual({justifyContent:"flex-end"});});(0,_vitest.it)("should parse justify-center",function(){(0,_vitest.expect)((0,_layout.parseLayout)("justify-center")).toEqual({justifyContent:"center"});});(0,_vitest.it)("should parse justify-between",function(){(0,_vitest.expect)((0,_layout.parseLayout)("justify-between")).toEqual({justifyContent:"space-between"});});(0,_vitest.it)("should parse justify-around",function(){(0,_vitest.expect)((0,_layout.parseLayout)("justify-around")).toEqual({justifyContent:"space-around"});});(0,_vitest.it)("should parse justify-evenly",function(){(0,_vitest.expect)((0,_layout.parseLayout)("justify-evenly")).toEqual({justifyContent:"space-evenly"});});});(0,_vitest.describe)("parseLayout - align items utilities",function(){(0,_vitest.it)("should parse items-start",function(){(0,_vitest.expect)((0,_layout.parseLayout)("items-start")).toEqual({alignItems:"flex-start"});});(0,_vitest.it)("should parse items-end",function(){(0,_vitest.expect)((0,_layout.parseLayout)("items-end")).toEqual({alignItems:"flex-end"});});(0,_vitest.it)("should parse items-center",function(){(0,_vitest.expect)((0,_layout.parseLayout)("items-center")).toEqual({alignItems:"center"});});(0,_vitest.it)("should parse items-baseline",function(){(0,_vitest.expect)((0,_layout.parseLayout)("items-baseline")).toEqual({alignItems:"baseline"});});(0,_vitest.it)("should parse items-stretch",function(){(0,_vitest.expect)((0,_layout.parseLayout)("items-stretch")).toEqual({alignItems:"stretch"});});});(0,_vitest.describe)("parseLayout - align self utilities",function(){(0,_vitest.it)("should parse self-auto",function(){(0,_vitest.expect)((0,_layout.parseLayout)("self-auto")).toEqual({alignSelf:"auto"});});(0,_vitest.it)("should parse self-start",function(){(0,_vitest.expect)((0,_layout.parseLayout)("self-start")).toEqual({alignSelf:"flex-start"});});(0,_vitest.it)("should parse self-end",function(){(0,_vitest.expect)((0,_layout.parseLayout)("self-end")).toEqual({alignSelf:"flex-end"});});(0,_vitest.it)("should parse self-center",function(){(0,_vitest.expect)((0,_layout.parseLayout)("self-center")).toEqual({alignSelf:"center"});});(0,_vitest.it)("should parse self-stretch",function(){(0,_vitest.expect)((0,_layout.parseLayout)("self-stretch")).toEqual({alignSelf:"stretch"});});(0,_vitest.it)("should parse self-baseline",function(){(0,_vitest.expect)((0,_layout.parseLayout)("self-baseline")).toEqual({alignSelf:"baseline"});});});(0,_vitest.describe)("parseLayout - align content utilities",function(){(0,_vitest.it)("should parse content-start",function(){(0,_vitest.expect)((0,_layout.parseLayout)("content-start")).toEqual({alignContent:"flex-start"});});(0,_vitest.it)("should parse content-end",function(){(0,_vitest.expect)((0,_layout.parseLayout)("content-end")).toEqual({alignContent:"flex-end"});});(0,_vitest.it)("should parse content-center",function(){(0,_vitest.expect)((0,_layout.parseLayout)("content-center")).toEqual({alignContent:"center"});});(0,_vitest.it)("should parse content-between",function(){(0,_vitest.expect)((0,_layout.parseLayout)("content-between")).toEqual({alignContent:"space-between"});});(0,_vitest.it)("should parse content-around",function(){(0,_vitest.expect)((0,_layout.parseLayout)("content-around")).toEqual({alignContent:"space-around"});});(0,_vitest.it)("should parse content-stretch",function(){(0,_vitest.expect)((0,_layout.parseLayout)("content-stretch")).toEqual({alignContent:"stretch"});});});(0,_vitest.describe)("parseLayout - position utilities",function(){(0,_vitest.it)("should parse absolute",function(){(0,_vitest.expect)((0,_layout.parseLayout)("absolute")).toEqual({position:"absolute"});});(0,_vitest.it)("should parse relative",function(){(0,_vitest.expect)((0,_layout.parseLayout)("relative")).toEqual({position:"relative"});});});(0,_vitest.describe)("parseLayout - overflow utilities",function(){(0,_vitest.it)("should parse overflow-hidden",function(){(0,_vitest.expect)((0,_layout.parseLayout)("overflow-hidden")).toEqual({overflow:"hidden"});});(0,_vitest.it)("should parse overflow-visible",function(){(0,_vitest.expect)((0,_layout.parseLayout)("overflow-visible")).toEqual({overflow:"visible"});});(0,_vitest.it)("should parse overflow-scroll",function(){(0,_vitest.expect)((0,_layout.parseLayout)("overflow-scroll")).toEqual({overflow:"scroll"});});});(0,_vitest.describe)("parseLayout - opacity utilities",function(){(0,_vitest.it)("should parse opacity-0 (fully transparent)",function(){(0,_vitest.expect)((0,_layout.parseLayout)("opacity-0")).toEqual({opacity:0});});(0,_vitest.it)("should parse opacity-50 (half transparent)",function(){(0,_vitest.expect)((0,_layout.parseLayout)("opacity-50")).toEqual({opacity:0.5});});(0,_vitest.it)("should parse opacity-100 (fully opaque)",function(){(0,_vitest.expect)((0,_layout.parseLayout)("opacity-100")).toEqual({opacity:1});});(0,_vitest.it)("should parse all opacity values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("opacity-5")).toEqual({opacity:0.05});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-10")).toEqual({opacity:0.1});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-15")).toEqual({opacity:0.15});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-20")).toEqual({opacity:0.2});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-25")).toEqual({opacity:0.25});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-30")).toEqual({opacity:0.3});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-35")).toEqual({opacity:0.35});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-40")).toEqual({opacity:0.4});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-45")).toEqual({opacity:0.45});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-55")).toEqual({opacity:0.55});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-60")).toEqual({opacity:0.6});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-65")).toEqual({opacity:0.65});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-70")).toEqual({opacity:0.7});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-75")).toEqual({opacity:0.75});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-80")).toEqual({opacity:0.8});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-85")).toEqual({opacity:0.85});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-90")).toEqual({opacity:0.9});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-95")).toEqual({opacity:0.95});});});(0,_vitest.describe)("parseLayout - edge cases",function(){(0,_vitest.it)("should return null for invalid classes",function(){(0,_vitest.expect)((0,_layout.parseLayout)("invalid")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("flex-invalid")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("justify")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("items")).toBeNull();});(0,_vitest.it)("should return null for empty string",function(){(0,_vitest.expect)((0,_layout.parseLayout)("")).toBeNull();});(0,_vitest.it)("should return null for partial class names",function(){(0,_vitest.expect)((0,_layout.parseLayout)("fle")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("flexbox")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("justify-start-center")).toBeNull();});(0,_vitest.it)("should return null for CSS classes not in React Native",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inline")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("block")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("inline-block")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("grid")).toBeNull();});});(0,_vitest.describe)("parseLayout - comprehensive coverage",function(){(0,_vitest.it)("should handle all flex direction variants",function(){var directions=["flex-row","flex-row-reverse","flex-col","flex-col-reverse"];directions.forEach(function(dir){(0,_vitest.expect)((0,_layout.parseLayout)(dir)).toBeTruthy();});});(0,_vitest.it)("should handle all flex wrap variants",function(){var wraps=["flex-wrap","flex-wrap-reverse","flex-nowrap"];wraps.forEach(function(wrap){(0,_vitest.expect)((0,_layout.parseLayout)(wrap)).toBeTruthy();});});(0,_vitest.it)("should handle all justify content variants",function(){var justifies=["justify-start","justify-end","justify-center","justify-between","justify-around","justify-evenly"];justifies.forEach(function(justify){(0,_vitest.expect)((0,_layout.parseLayout)(justify)).toBeTruthy();});});(0,_vitest.it)("should handle all align items variants",function(){var aligns=["items-start","items-end","items-center","items-baseline","items-stretch"];aligns.forEach(function(align){(0,_vitest.expect)((0,_layout.parseLayout)(align)).toBeTruthy();});});(0,_vitest.it)("should handle all align self variants",function(){var selfs=["self-auto","self-start","self-end","self-center","self-stretch","self-baseline"];selfs.forEach(function(self){(0,_vitest.expect)((0,_layout.parseLayout)(self)).toBeTruthy();});});(0,_vitest.it)("should handle all align content variants",function(){var contents=["content-start","content-end","content-center","content-between","content-around","content-stretch"];contents.forEach(function(content){(0,_vitest.expect)((0,_layout.parseLayout)(content)).toBeTruthy();});});(0,_vitest.it)("should handle all position variants",function(){var positions=["absolute","relative"];positions.forEach(function(position){(0,_vitest.expect)((0,_layout.parseLayout)(position)).toBeTruthy();});});(0,_vitest.it)("should handle all overflow variants",function(){var overflows=["overflow-hidden","overflow-visible","overflow-scroll"];overflows.forEach(function(overflow){(0,_vitest.expect)((0,_layout.parseLayout)(overflow)).toBeTruthy();});});});(0,_vitest.describe)("parseLayout - case sensitivity",function(){(0,_vitest.it)("should be case-sensitive",function(){(0,_vitest.expect)((0,_layout.parseLayout)("FLEX")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("Flex")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("ABSOLUTE")).toBeNull();});});(0,_vitest.describe)("parseLayout - z-index utilities",function(){(0,_vitest.it)("should parse z-index values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("z-0")).toEqual({zIndex:0});(0,_vitest.expect)((0,_layout.parseLayout)("z-10")).toEqual({zIndex:10});(0,_vitest.expect)((0,_layout.parseLayout)("z-20")).toEqual({zIndex:20});(0,_vitest.expect)((0,_layout.parseLayout)("z-30")).toEqual({zIndex:30});(0,_vitest.expect)((0,_layout.parseLayout)("z-40")).toEqual({zIndex:40});(0,_vitest.expect)((0,_layout.parseLayout)("z-50")).toEqual({zIndex:50});});(0,_vitest.it)("should parse z-auto as 0",function(){(0,_vitest.expect)((0,_layout.parseLayout)("z-auto")).toEqual({zIndex:0});});(0,_vitest.it)("should parse arbitrary z-index values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("z-[999]")).toEqual({zIndex:999});(0,_vitest.expect)((0,_layout.parseLayout)("z-[100]")).toEqual({zIndex:100});(0,_vitest.expect)((0,_layout.parseLayout)("z-[1]")).toEqual({zIndex:1});});(0,_vitest.it)("should parse negative arbitrary z-index values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("z-[-1]")).toEqual({zIndex:-1});(0,_vitest.expect)((0,_layout.parseLayout)("z-[-10]")).toEqual({zIndex:-10});(0,_vitest.expect)((0,_layout.parseLayout)("z-[-999]")).toEqual({zIndex:-999});});(0,_vitest.it)("should return null for invalid z-index values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("z-100")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("z-5")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("z-invalid")).toBeNull();});});(0,_vitest.describe)("parseLayout - positioning utilities",function(){(0,_vitest.it)("should parse top values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-0")).toEqual({top:0});(0,_vitest.expect)((0,_layout.parseLayout)("top-4")).toEqual({top:16});(0,_vitest.expect)((0,_layout.parseLayout)("top-8")).toEqual({top:32});(0,_vitest.expect)((0,_layout.parseLayout)("top-16")).toEqual({top:64});});(0,_vitest.it)("should parse right values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("right-0")).toEqual({right:0});(0,_vitest.expect)((0,_layout.parseLayout)("right-4")).toEqual({right:16});(0,_vitest.expect)((0,_layout.parseLayout)("right-8")).toEqual({right:32});(0,_vitest.expect)((0,_layout.parseLayout)("right-16")).toEqual({right:64});});(0,_vitest.it)("should parse bottom values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("bottom-0")).toEqual({bottom:0});(0,_vitest.expect)((0,_layout.parseLayout)("bottom-4")).toEqual({bottom:16});(0,_vitest.expect)((0,_layout.parseLayout)("bottom-8")).toEqual({bottom:32});(0,_vitest.expect)((0,_layout.parseLayout)("bottom-16")).toEqual({bottom:64});});(0,_vitest.it)("should parse left values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("left-0")).toEqual({left:0});(0,_vitest.expect)((0,_layout.parseLayout)("left-4")).toEqual({left:16});(0,_vitest.expect)((0,_layout.parseLayout)("left-8")).toEqual({left:32});(0,_vitest.expect)((0,_layout.parseLayout)("left-16")).toEqual({left:64});});(0,_vitest.it)("should parse fractional positioning values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-0.5")).toEqual({top:2});(0,_vitest.expect)((0,_layout.parseLayout)("right-1.5")).toEqual({right:6});(0,_vitest.expect)((0,_layout.parseLayout)("bottom-2.5")).toEqual({bottom:10});(0,_vitest.expect)((0,_layout.parseLayout)("left-3.5")).toEqual({left:14});});(0,_vitest.it)("should parse auto positioning values as empty object",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-auto")).toEqual({});(0,_vitest.expect)((0,_layout.parseLayout)("right-auto")).toEqual({});(0,_vitest.expect)((0,_layout.parseLayout)("bottom-auto")).toEqual({});(0,_vitest.expect)((0,_layout.parseLayout)("left-auto")).toEqual({});});(0,_vitest.it)("should parse arbitrary top values with pixels",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-[50px]")).toEqual({top:50});(0,_vitest.expect)((0,_layout.parseLayout)("top-[100px]")).toEqual({top:100});(0,_vitest.expect)((0,_layout.parseLayout)("top-[0px]")).toEqual({top:0});});(0,_vitest.it)("should parse arbitrary top values without unit (defaults to px)",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-[50]")).toEqual({top:50});(0,_vitest.expect)((0,_layout.parseLayout)("top-[100]")).toEqual({top:100});});(0,_vitest.it)("should parse arbitrary top values with percentages",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-[25%]")).toEqual({top:"25%"});(0,_vitest.expect)((0,_layout.parseLayout)("top-[50%]")).toEqual({top:"50%"});(0,_vitest.expect)((0,_layout.parseLayout)("top-[10.5%]")).toEqual({top:"10.5%"});});(0,_vitest.it)("should parse negative arbitrary top values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-[-10px]")).toEqual({top:-10});(0,_vitest.expect)((0,_layout.parseLayout)("top-[-50]")).toEqual({top:-50});(0,_vitest.expect)((0,_layout.parseLayout)("top-[-25%]")).toEqual({top:"-25%"});});(0,_vitest.it)("should parse arbitrary right values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("right-[30px]")).toEqual({right:30});(0,_vitest.expect)((0,_layout.parseLayout)("right-[20]")).toEqual({right:20});(0,_vitest.expect)((0,_layout.parseLayout)("right-[15%]")).toEqual({right:"15%"});(0,_vitest.expect)((0,_layout.parseLayout)("right-[-10px]")).toEqual({right:-10});});(0,_vitest.it)("should parse arbitrary bottom values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("bottom-[40px]")).toEqual({bottom:40});(0,_vitest.expect)((0,_layout.parseLayout)("bottom-[25]")).toEqual({bottom:25});(0,_vitest.expect)((0,_layout.parseLayout)("bottom-[33.333%]")).toEqual({bottom:"33.333%"});(0,_vitest.expect)((0,_layout.parseLayout)("bottom-[-15px]")).toEqual({bottom:-15});});(0,_vitest.it)("should parse arbitrary left values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("left-[60px]")).toEqual({left:60});(0,_vitest.expect)((0,_layout.parseLayout)("left-[45]")).toEqual({left:45});(0,_vitest.expect)((0,_layout.parseLayout)("left-[12.5%]")).toEqual({left:"12.5%"});(0,_vitest.expect)((0,_layout.parseLayout)("left-[-20px]")).toEqual({left:-20});});});(0,_vitest.describe)("parseLayout - inset utilities",function(){(0,_vitest.it)("should parse inset (all sides) values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-0")).toEqual({top:0,right:0,bottom:0,left:0});(0,_vitest.expect)((0,_layout.parseLayout)("inset-4")).toEqual({top:16,right:16,bottom:16,left:16});(0,_vitest.expect)((0,_layout.parseLayout)("inset-8")).toEqual({top:32,right:32,bottom:32,left:32});});(0,_vitest.it)("should parse inset-x (horizontal) values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-x-0")).toEqual({left:0,right:0});(0,_vitest.expect)((0,_layout.parseLayout)("inset-x-4")).toEqual({left:16,right:16});(0,_vitest.expect)((0,_layout.parseLayout)("inset-x-8")).toEqual({left:32,right:32});});(0,_vitest.it)("should parse inset-y (vertical) values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-y-0")).toEqual({top:0,bottom:0});(0,_vitest.expect)((0,_layout.parseLayout)("inset-y-4")).toEqual({top:16,bottom:16});(0,_vitest.expect)((0,_layout.parseLayout)("inset-y-8")).toEqual({top:32,bottom:32});});(0,_vitest.it)("should parse fractional inset values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-0.5")).toEqual({top:2,right:2,bottom:2,left:2});(0,_vitest.expect)((0,_layout.parseLayout)("inset-x-1.5")).toEqual({left:6,right:6});(0,_vitest.expect)((0,_layout.parseLayout)("inset-y-2.5")).toEqual({top:10,bottom:10});});(0,_vitest.it)("should return null for invalid inset values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-100")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("inset-x-100")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("inset-y-100")).toBeNull();});(0,_vitest.it)("should parse arbitrary inset (all sides) values with pixels",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-[10px]")).toEqual({top:10,right:10,bottom:10,left:10});(0,_vitest.expect)((0,_layout.parseLayout)("inset-[25px]")).toEqual({top:25,right:25,bottom:25,left:25});(0,_vitest.expect)((0,_layout.parseLayout)("inset-[0px]")).toEqual({top:0,right:0,bottom:0,left:0});});(0,_vitest.it)("should parse arbitrary inset values without unit (defaults to px)",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-[15]")).toEqual({top:15,right:15,bottom:15,left:15});(0,_vitest.expect)((0,_layout.parseLayout)("inset-[30]")).toEqual({top:30,right:30,bottom:30,left:30});});(0,_vitest.it)("should parse arbitrary inset values with percentages",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-[10%]")).toEqual({top:"10%",right:"10%",bottom:"10%",left:"10%"});(0,_vitest.expect)((0,_layout.parseLayout)("inset-[25%]")).toEqual({top:"25%",right:"25%",bottom:"25%",left:"25%"});(0,_vitest.expect)((0,_layout.parseLayout)("inset-[5.5%]")).toEqual({top:"5.5%",right:"5.5%",bottom:"5.5%",left:"5.5%"});});(0,_vitest.it)("should parse arbitrary inset-x (horizontal) values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-x-[20px]")).toEqual({left:20,right:20});(0,_vitest.expect)((0,_layout.parseLayout)("inset-x-[15]")).toEqual({left:15,right:15});(0,_vitest.expect)((0,_layout.parseLayout)("inset-x-[10%]")).toEqual({left:"10%",right:"10%"});});(0,_vitest.it)("should parse arbitrary inset-y (vertical) values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-y-[30px]")).toEqual({top:30,bottom:30});(0,_vitest.expect)((0,_layout.parseLayout)("inset-y-[25]")).toEqual({top:25,bottom:25});(0,_vitest.expect)((0,_layout.parseLayout)("inset-y-[15%]")).toEqual({top:"15%",bottom:"15%"});});(0,_vitest.it)("should parse negative arbitrary inset values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-[-5px]")).toEqual({top:-5,right:-5,bottom:-5,left:-5});(0,_vitest.expect)((0,_layout.parseLayout)("inset-x-[-10px]")).toEqual({left:-10,right:-10});(0,_vitest.expect)((0,_layout.parseLayout)("inset-y-[-15px]")).toEqual({top:-15,bottom:-15});(0,_vitest.expect)((0,_layout.parseLayout)("inset-[-20%]")).toEqual({top:"-20%",right:"-20%",bottom:"-20%",left:"-20%"});});});(0,_vitest.describe)("parseLayout - specific property coverage",function(){(0,_vitest.it)("should return unique objects for each class",function(){var flex1=(0,_layout.parseLayout)("flex");var flex2=(0,_layout.parseLayout)("flex");(0,_vitest.expect)(flex1).toEqual(flex2);});(0,_vitest.it)("should handle flex value variations",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-1")).toEqual({flex:1});(0,_vitest.expect)((0,_layout.parseLayout)("flex-auto")).toEqual({flex:1});(0,_vitest.expect)((0,_layout.parseLayout)("flex-none")).toEqual({flex:0});});(0,_vitest.it)("should distinguish between similar class names",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex")).not.toEqual((0,_layout.parseLayout)("flex-1"));(0,_vitest.expect)((0,_layout.parseLayout)("grow")).not.toEqual((0,_layout.parseLayout)("grow-0"));(0,_vitest.expect)((0,_layout.parseLayout)("shrink")).not.toEqual((0,_layout.parseLayout)("shrink-0"));});(0,_vitest.it)("should handle positioning with absolute/relative",function(){(0,_vitest.expect)((0,_layout.parseLayout)("absolute")).toEqual({position:"absolute"});(0,_vitest.expect)((0,_layout.parseLayout)("top-0")).toEqual({top:0});(0,_vitest.expect)((0,_layout.parseLayout)("left-0")).toEqual({left:0});});(0,_vitest.it)("should handle all positioning directions",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-4")).toHaveProperty("top");(0,_vitest.expect)((0,_layout.parseLayout)("right-4")).toHaveProperty("right");(0,_vitest.expect)((0,_layout.parseLayout)("bottom-4")).toHaveProperty("bottom");(0,_vitest.expect)((0,_layout.parseLayout)("left-4")).toHaveProperty("left");});(0,_vitest.it)("should handle inset shorthand variations",function(){var insetAll=(0,_layout.parseLayout)("inset-4");(0,_vitest.expect)(insetAll).toHaveProperty("top",16);(0,_vitest.expect)(insetAll).toHaveProperty("right",16);(0,_vitest.expect)(insetAll).toHaveProperty("bottom",16);(0,_vitest.expect)(insetAll).toHaveProperty("left",16);var insetX=(0,_layout.parseLayout)("inset-x-4");(0,_vitest.expect)(insetX).toHaveProperty("left",16);(0,_vitest.expect)(insetX).toHaveProperty("right",16);(0,_vitest.expect)(insetX).not.toHaveProperty("top");(0,_vitest.expect)(insetX).not.toHaveProperty("bottom");var insetY=(0,_layout.parseLayout)("inset-y-4");(0,_vitest.expect)(insetY).toHaveProperty("top",16);(0,_vitest.expect)(insetY).toHaveProperty("bottom",16);(0,_vitest.expect)(insetY).not.toHaveProperty("left");(0,_vitest.expect)(insetY).not.toHaveProperty("right");});});(0,_vitest.describe)("parseLayout - logical positioning (RTL-aware)",function(){(0,_vitest.it)("should parse start positioning with preset values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("start-0")).toEqual({start:0});(0,_vitest.expect)((0,_layout.parseLayout)("start-4")).toEqual({start:16});(0,_vitest.expect)((0,_layout.parseLayout)("start-8")).toEqual({start:32});(0,_vitest.expect)((0,_layout.parseLayout)("start-0.5")).toEqual({start:2});(0,_vitest.expect)((0,_layout.parseLayout)("start-2.5")).toEqual({start:10});});(0,_vitest.it)("should parse end positioning with preset values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("end-0")).toEqual({end:0});(0,_vitest.expect)((0,_layout.parseLayout)("end-4")).toEqual({end:16});(0,_vitest.expect)((0,_layout.parseLayout)("end-8")).toEqual({end:32});(0,_vitest.expect)((0,_layout.parseLayout)("end-0.5")).toEqual({end:2});(0,_vitest.expect)((0,_layout.parseLayout)("end-2.5")).toEqual({end:10});});(0,_vitest.it)("should parse start/end with arbitrary pixel values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("start-[10px]")).toEqual({start:10});(0,_vitest.expect)((0,_layout.parseLayout)("start-[50]")).toEqual({start:50});(0,_vitest.expect)((0,_layout.parseLayout)("end-[10px]")).toEqual({end:10});(0,_vitest.expect)((0,_layout.parseLayout)("end-[50]")).toEqual({end:50});});(0,_vitest.it)("should parse start/end with arbitrary percentage values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("start-[10%]")).toEqual({start:"10%"});(0,_vitest.expect)((0,_layout.parseLayout)("start-[50%]")).toEqual({start:"50%"});(0,_vitest.expect)((0,_layout.parseLayout)("end-[10%]")).toEqual({end:"10%"});(0,_vitest.expect)((0,_layout.parseLayout)("end-[50%]")).toEqual({end:"50%"});});(0,_vitest.it)("should parse negative start/end with preset values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("-start-4")).toEqual({start:-16});(0,_vitest.expect)((0,_layout.parseLayout)("-start-8")).toEqual({start:-32});(0,_vitest.expect)((0,_layout.parseLayout)("-end-4")).toEqual({end:-16});(0,_vitest.expect)((0,_layout.parseLayout)("-end-8")).toEqual({end:-32});});(0,_vitest.it)("should parse negative start/end with arbitrary values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("-start-[10px]")).toEqual({start:-10});(0,_vitest.expect)((0,_layout.parseLayout)("-start-[50]")).toEqual({start:-50});(0,_vitest.expect)((0,_layout.parseLayout)("-end-[10px]")).toEqual({end:-10});(0,_vitest.expect)((0,_layout.parseLayout)("-end-[50]")).toEqual({end:-50});(0,_vitest.expect)((0,_layout.parseLayout)("-start-[10%]")).toEqual({start:"-10%"});(0,_vitest.expect)((0,_layout.parseLayout)("-end-[25%]")).toEqual({end:"-25%"});});(0,_vitest.it)("should handle auto value for start/end",function(){(0,_vitest.expect)((0,_layout.parseLayout)("start-auto")).toEqual({});(0,_vitest.expect)((0,_layout.parseLayout)("end-auto")).toEqual({});});});(0,_vitest.describe)("parseLayout - logical inset (RTL-aware)",function(){(0,_vitest.it)("should parse inset-s (start) with preset values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-s-0")).toEqual({start:0});(0,_vitest.expect)((0,_layout.parseLayout)("inset-s-4")).toEqual({start:16});(0,_vitest.expect)((0,_layout.parseLayout)("inset-s-8")).toEqual({start:32});});(0,_vitest.it)("should parse inset-e (end) with preset values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-e-0")).toEqual({end:0});(0,_vitest.expect)((0,_layout.parseLayout)("inset-e-4")).toEqual({end:16});(0,_vitest.expect)((0,_layout.parseLayout)("inset-e-8")).toEqual({end:32});});(0,_vitest.it)("should parse inset-s/inset-e with arbitrary values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-s-[10px]")).toEqual({start:10});(0,_vitest.expect)((0,_layout.parseLayout)("inset-s-[20%]")).toEqual({start:"20%"});(0,_vitest.expect)((0,_layout.parseLayout)("inset-e-[10px]")).toEqual({end:10});(0,_vitest.expect)((0,_layout.parseLayout)("inset-e-[20%]")).toEqual({end:"20%"});});});
1
+ var _vitest=require("vitest");var _layout=require("./layout");(0,_vitest.describe)("parseLayout - display utilities",function(){(0,_vitest.it)("should parse display flex",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex")).toEqual({display:"flex"});});(0,_vitest.it)("should parse display hidden",function(){(0,_vitest.expect)((0,_layout.parseLayout)("hidden")).toEqual({display:"none"});});});(0,_vitest.describe)("parseLayout - flex direction utilities",function(){(0,_vitest.it)("should parse flex row",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-row")).toEqual({flexDirection:"row"});});(0,_vitest.it)("should parse flex row reverse",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-row-reverse")).toEqual({flexDirection:"row-reverse"});});(0,_vitest.it)("should parse flex column",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-col")).toEqual({flexDirection:"column"});});(0,_vitest.it)("should parse flex column reverse",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-col-reverse")).toEqual({flexDirection:"column-reverse"});});});(0,_vitest.describe)("parseLayout - flex wrap utilities",function(){(0,_vitest.it)("should parse flex wrap",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-wrap")).toEqual({flexWrap:"wrap"});});(0,_vitest.it)("should parse flex wrap reverse",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-wrap-reverse")).toEqual({flexWrap:"wrap-reverse"});});(0,_vitest.it)("should parse flex nowrap",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-nowrap")).toEqual({flexWrap:"nowrap"});});});(0,_vitest.describe)("parseLayout - flex utilities",function(){(0,_vitest.it)("should parse flex-1",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-1")).toEqual({flex:1});});(0,_vitest.it)("should parse flex-auto",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-auto")).toEqual({flex:1});});(0,_vitest.it)("should parse flex-none",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-none")).toEqual({flex:0});});});(0,_vitest.describe)("parseLayout - flex grow/shrink utilities",function(){(0,_vitest.it)("should parse grow",function(){(0,_vitest.expect)((0,_layout.parseLayout)("grow")).toEqual({flexGrow:1});});(0,_vitest.it)("should parse grow-0",function(){(0,_vitest.expect)((0,_layout.parseLayout)("grow-0")).toEqual({flexGrow:0});});(0,_vitest.it)("should parse shrink",function(){(0,_vitest.expect)((0,_layout.parseLayout)("shrink")).toEqual({flexShrink:1});});(0,_vitest.it)("should parse shrink-0",function(){(0,_vitest.expect)((0,_layout.parseLayout)("shrink-0")).toEqual({flexShrink:0});});(0,_vitest.it)("should parse grow with arbitrary values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("grow-[1.5]")).toEqual({flexGrow:1.5});(0,_vitest.expect)((0,_layout.parseLayout)("grow-[2]")).toEqual({flexGrow:2});(0,_vitest.expect)((0,_layout.parseLayout)("grow-[0.5]")).toEqual({flexGrow:0.5});(0,_vitest.expect)((0,_layout.parseLayout)("grow-[3]")).toEqual({flexGrow:3});(0,_vitest.expect)((0,_layout.parseLayout)("grow-[0]")).toEqual({flexGrow:0});});(0,_vitest.it)("should parse shrink with arbitrary values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("shrink-[0.5]")).toEqual({flexShrink:0.5});(0,_vitest.expect)((0,_layout.parseLayout)("shrink-[2]")).toEqual({flexShrink:2});(0,_vitest.expect)((0,_layout.parseLayout)("shrink-[1.5]")).toEqual({flexShrink:1.5});(0,_vitest.expect)((0,_layout.parseLayout)("shrink-[3]")).toEqual({flexShrink:3});(0,_vitest.expect)((0,_layout.parseLayout)("shrink-[0]")).toEqual({flexShrink:0});});(0,_vitest.it)("should parse CSS-style flex-grow aliases",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-grow")).toEqual({flexGrow:1});(0,_vitest.expect)((0,_layout.parseLayout)("flex-grow-0")).toEqual({flexGrow:0});});(0,_vitest.it)("should parse CSS-style flex-shrink aliases",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-shrink")).toEqual({flexShrink:1});(0,_vitest.expect)((0,_layout.parseLayout)("flex-shrink-0")).toEqual({flexShrink:0});});(0,_vitest.it)("should parse CSS-style flex-grow with arbitrary values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-grow-[1.5]")).toEqual({flexGrow:1.5});(0,_vitest.expect)((0,_layout.parseLayout)("flex-grow-[2]")).toEqual({flexGrow:2});(0,_vitest.expect)((0,_layout.parseLayout)("flex-grow-[0.5]")).toEqual({flexGrow:0.5});});(0,_vitest.it)("should parse CSS-style flex-shrink with arbitrary values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-shrink-[0.5]")).toEqual({flexShrink:0.5});(0,_vitest.expect)((0,_layout.parseLayout)("flex-shrink-[2]")).toEqual({flexShrink:2});(0,_vitest.expect)((0,_layout.parseLayout)("flex-shrink-[1.5]")).toEqual({flexShrink:1.5});});(0,_vitest.it)("should handle edge case values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("grow-[0.1]")).toEqual({flexGrow:0.1});(0,_vitest.expect)((0,_layout.parseLayout)("grow-[10]")).toEqual({flexGrow:10});(0,_vitest.expect)((0,_layout.parseLayout)("shrink-[0.01]")).toEqual({flexShrink:0.01});(0,_vitest.expect)((0,_layout.parseLayout)("shrink-[100]")).toEqual({flexShrink:100});});(0,_vitest.it)("should parse Tailwind shorthand decimals (no leading zero)",function(){(0,_vitest.expect)((0,_layout.parseLayout)("grow-[.5]")).toEqual({flexGrow:0.5});(0,_vitest.expect)((0,_layout.parseLayout)("grow-[.75]")).toEqual({flexGrow:0.75});(0,_vitest.expect)((0,_layout.parseLayout)("shrink-[.5]")).toEqual({flexShrink:0.5});(0,_vitest.expect)((0,_layout.parseLayout)("shrink-[.25]")).toEqual({flexShrink:0.25});(0,_vitest.expect)((0,_layout.parseLayout)("flex-grow-[.5]")).toEqual({flexGrow:0.5});(0,_vitest.expect)((0,_layout.parseLayout)("flex-shrink-[.5]")).toEqual({flexShrink:0.5});});(0,_vitest.it)("should reject negative values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("grow-[-1]")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("shrink-[-1]")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("flex-grow-[-2]")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("flex-shrink-[-0.5]")).toBeNull();});});(0,_vitest.describe)("parseLayout - justify content utilities",function(){(0,_vitest.it)("should parse justify-start",function(){(0,_vitest.expect)((0,_layout.parseLayout)("justify-start")).toEqual({justifyContent:"flex-start"});});(0,_vitest.it)("should parse justify-end",function(){(0,_vitest.expect)((0,_layout.parseLayout)("justify-end")).toEqual({justifyContent:"flex-end"});});(0,_vitest.it)("should parse justify-center",function(){(0,_vitest.expect)((0,_layout.parseLayout)("justify-center")).toEqual({justifyContent:"center"});});(0,_vitest.it)("should parse justify-between",function(){(0,_vitest.expect)((0,_layout.parseLayout)("justify-between")).toEqual({justifyContent:"space-between"});});(0,_vitest.it)("should parse justify-around",function(){(0,_vitest.expect)((0,_layout.parseLayout)("justify-around")).toEqual({justifyContent:"space-around"});});(0,_vitest.it)("should parse justify-evenly",function(){(0,_vitest.expect)((0,_layout.parseLayout)("justify-evenly")).toEqual({justifyContent:"space-evenly"});});});(0,_vitest.describe)("parseLayout - align items utilities",function(){(0,_vitest.it)("should parse items-start",function(){(0,_vitest.expect)((0,_layout.parseLayout)("items-start")).toEqual({alignItems:"flex-start"});});(0,_vitest.it)("should parse items-end",function(){(0,_vitest.expect)((0,_layout.parseLayout)("items-end")).toEqual({alignItems:"flex-end"});});(0,_vitest.it)("should parse items-center",function(){(0,_vitest.expect)((0,_layout.parseLayout)("items-center")).toEqual({alignItems:"center"});});(0,_vitest.it)("should parse items-baseline",function(){(0,_vitest.expect)((0,_layout.parseLayout)("items-baseline")).toEqual({alignItems:"baseline"});});(0,_vitest.it)("should parse items-stretch",function(){(0,_vitest.expect)((0,_layout.parseLayout)("items-stretch")).toEqual({alignItems:"stretch"});});});(0,_vitest.describe)("parseLayout - align self utilities",function(){(0,_vitest.it)("should parse self-auto",function(){(0,_vitest.expect)((0,_layout.parseLayout)("self-auto")).toEqual({alignSelf:"auto"});});(0,_vitest.it)("should parse self-start",function(){(0,_vitest.expect)((0,_layout.parseLayout)("self-start")).toEqual({alignSelf:"flex-start"});});(0,_vitest.it)("should parse self-end",function(){(0,_vitest.expect)((0,_layout.parseLayout)("self-end")).toEqual({alignSelf:"flex-end"});});(0,_vitest.it)("should parse self-center",function(){(0,_vitest.expect)((0,_layout.parseLayout)("self-center")).toEqual({alignSelf:"center"});});(0,_vitest.it)("should parse self-stretch",function(){(0,_vitest.expect)((0,_layout.parseLayout)("self-stretch")).toEqual({alignSelf:"stretch"});});(0,_vitest.it)("should parse self-baseline",function(){(0,_vitest.expect)((0,_layout.parseLayout)("self-baseline")).toEqual({alignSelf:"baseline"});});});(0,_vitest.describe)("parseLayout - align content utilities",function(){(0,_vitest.it)("should parse content-start",function(){(0,_vitest.expect)((0,_layout.parseLayout)("content-start")).toEqual({alignContent:"flex-start"});});(0,_vitest.it)("should parse content-end",function(){(0,_vitest.expect)((0,_layout.parseLayout)("content-end")).toEqual({alignContent:"flex-end"});});(0,_vitest.it)("should parse content-center",function(){(0,_vitest.expect)((0,_layout.parseLayout)("content-center")).toEqual({alignContent:"center"});});(0,_vitest.it)("should parse content-between",function(){(0,_vitest.expect)((0,_layout.parseLayout)("content-between")).toEqual({alignContent:"space-between"});});(0,_vitest.it)("should parse content-around",function(){(0,_vitest.expect)((0,_layout.parseLayout)("content-around")).toEqual({alignContent:"space-around"});});(0,_vitest.it)("should parse content-stretch",function(){(0,_vitest.expect)((0,_layout.parseLayout)("content-stretch")).toEqual({alignContent:"stretch"});});});(0,_vitest.describe)("parseLayout - position utilities",function(){(0,_vitest.it)("should parse absolute",function(){(0,_vitest.expect)((0,_layout.parseLayout)("absolute")).toEqual({position:"absolute"});});(0,_vitest.it)("should parse relative",function(){(0,_vitest.expect)((0,_layout.parseLayout)("relative")).toEqual({position:"relative"});});});(0,_vitest.describe)("parseLayout - overflow utilities",function(){(0,_vitest.it)("should parse overflow-hidden",function(){(0,_vitest.expect)((0,_layout.parseLayout)("overflow-hidden")).toEqual({overflow:"hidden"});});(0,_vitest.it)("should parse overflow-visible",function(){(0,_vitest.expect)((0,_layout.parseLayout)("overflow-visible")).toEqual({overflow:"visible"});});(0,_vitest.it)("should parse overflow-scroll",function(){(0,_vitest.expect)((0,_layout.parseLayout)("overflow-scroll")).toEqual({overflow:"scroll"});});});(0,_vitest.describe)("parseLayout - opacity utilities",function(){(0,_vitest.it)("should parse opacity-0 (fully transparent)",function(){(0,_vitest.expect)((0,_layout.parseLayout)("opacity-0")).toEqual({opacity:0});});(0,_vitest.it)("should parse opacity-50 (half transparent)",function(){(0,_vitest.expect)((0,_layout.parseLayout)("opacity-50")).toEqual({opacity:0.5});});(0,_vitest.it)("should parse opacity-100 (fully opaque)",function(){(0,_vitest.expect)((0,_layout.parseLayout)("opacity-100")).toEqual({opacity:1});});(0,_vitest.it)("should parse all opacity values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("opacity-5")).toEqual({opacity:0.05});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-10")).toEqual({opacity:0.1});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-15")).toEqual({opacity:0.15});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-20")).toEqual({opacity:0.2});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-25")).toEqual({opacity:0.25});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-30")).toEqual({opacity:0.3});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-35")).toEqual({opacity:0.35});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-40")).toEqual({opacity:0.4});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-45")).toEqual({opacity:0.45});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-55")).toEqual({opacity:0.55});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-60")).toEqual({opacity:0.6});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-65")).toEqual({opacity:0.65});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-70")).toEqual({opacity:0.7});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-75")).toEqual({opacity:0.75});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-80")).toEqual({opacity:0.8});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-85")).toEqual({opacity:0.85});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-90")).toEqual({opacity:0.9});(0,_vitest.expect)((0,_layout.parseLayout)("opacity-95")).toEqual({opacity:0.95});});});(0,_vitest.describe)("parseLayout - edge cases",function(){(0,_vitest.it)("should return null for invalid classes",function(){(0,_vitest.expect)((0,_layout.parseLayout)("invalid")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("flex-invalid")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("justify")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("items")).toBeNull();});(0,_vitest.it)("should return null for empty string",function(){(0,_vitest.expect)((0,_layout.parseLayout)("")).toBeNull();});(0,_vitest.it)("should return null for partial class names",function(){(0,_vitest.expect)((0,_layout.parseLayout)("fle")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("flexbox")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("justify-start-center")).toBeNull();});(0,_vitest.it)("should return null for CSS classes not in React Native",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inline")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("block")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("inline-block")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("grid")).toBeNull();});});(0,_vitest.describe)("parseLayout - comprehensive coverage",function(){(0,_vitest.it)("should handle all flex direction variants",function(){var directions=["flex-row","flex-row-reverse","flex-col","flex-col-reverse"];directions.forEach(function(dir){(0,_vitest.expect)((0,_layout.parseLayout)(dir)).toBeTruthy();});});(0,_vitest.it)("should handle all flex wrap variants",function(){var wraps=["flex-wrap","flex-wrap-reverse","flex-nowrap"];wraps.forEach(function(wrap){(0,_vitest.expect)((0,_layout.parseLayout)(wrap)).toBeTruthy();});});(0,_vitest.it)("should handle all justify content variants",function(){var justifies=["justify-start","justify-end","justify-center","justify-between","justify-around","justify-evenly"];justifies.forEach(function(justify){(0,_vitest.expect)((0,_layout.parseLayout)(justify)).toBeTruthy();});});(0,_vitest.it)("should handle all align items variants",function(){var aligns=["items-start","items-end","items-center","items-baseline","items-stretch"];aligns.forEach(function(align){(0,_vitest.expect)((0,_layout.parseLayout)(align)).toBeTruthy();});});(0,_vitest.it)("should handle all align self variants",function(){var selfs=["self-auto","self-start","self-end","self-center","self-stretch","self-baseline"];selfs.forEach(function(self){(0,_vitest.expect)((0,_layout.parseLayout)(self)).toBeTruthy();});});(0,_vitest.it)("should handle all align content variants",function(){var contents=["content-start","content-end","content-center","content-between","content-around","content-stretch"];contents.forEach(function(content){(0,_vitest.expect)((0,_layout.parseLayout)(content)).toBeTruthy();});});(0,_vitest.it)("should handle all position variants",function(){var positions=["absolute","relative"];positions.forEach(function(position){(0,_vitest.expect)((0,_layout.parseLayout)(position)).toBeTruthy();});});(0,_vitest.it)("should handle all overflow variants",function(){var overflows=["overflow-hidden","overflow-visible","overflow-scroll"];overflows.forEach(function(overflow){(0,_vitest.expect)((0,_layout.parseLayout)(overflow)).toBeTruthy();});});});(0,_vitest.describe)("parseLayout - case sensitivity",function(){(0,_vitest.it)("should be case-sensitive",function(){(0,_vitest.expect)((0,_layout.parseLayout)("FLEX")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("Flex")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("ABSOLUTE")).toBeNull();});});(0,_vitest.describe)("parseLayout - z-index utilities",function(){(0,_vitest.it)("should parse z-index values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("z-0")).toEqual({zIndex:0});(0,_vitest.expect)((0,_layout.parseLayout)("z-10")).toEqual({zIndex:10});(0,_vitest.expect)((0,_layout.parseLayout)("z-20")).toEqual({zIndex:20});(0,_vitest.expect)((0,_layout.parseLayout)("z-30")).toEqual({zIndex:30});(0,_vitest.expect)((0,_layout.parseLayout)("z-40")).toEqual({zIndex:40});(0,_vitest.expect)((0,_layout.parseLayout)("z-50")).toEqual({zIndex:50});});(0,_vitest.it)("should parse z-auto as 0",function(){(0,_vitest.expect)((0,_layout.parseLayout)("z-auto")).toEqual({zIndex:0});});(0,_vitest.it)("should parse arbitrary z-index values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("z-[999]")).toEqual({zIndex:999});(0,_vitest.expect)((0,_layout.parseLayout)("z-[100]")).toEqual({zIndex:100});(0,_vitest.expect)((0,_layout.parseLayout)("z-[1]")).toEqual({zIndex:1});});(0,_vitest.it)("should parse negative arbitrary z-index values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("z-[-1]")).toEqual({zIndex:-1});(0,_vitest.expect)((0,_layout.parseLayout)("z-[-10]")).toEqual({zIndex:-10});(0,_vitest.expect)((0,_layout.parseLayout)("z-[-999]")).toEqual({zIndex:-999});});(0,_vitest.it)("should return null for invalid z-index values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("z-100")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("z-5")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("z-invalid")).toBeNull();});});(0,_vitest.describe)("parseLayout - positioning utilities",function(){(0,_vitest.it)("should parse top values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-0")).toEqual({top:0});(0,_vitest.expect)((0,_layout.parseLayout)("top-4")).toEqual({top:16});(0,_vitest.expect)((0,_layout.parseLayout)("top-8")).toEqual({top:32});(0,_vitest.expect)((0,_layout.parseLayout)("top-16")).toEqual({top:64});});(0,_vitest.it)("should parse right values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("right-0")).toEqual({right:0});(0,_vitest.expect)((0,_layout.parseLayout)("right-4")).toEqual({right:16});(0,_vitest.expect)((0,_layout.parseLayout)("right-8")).toEqual({right:32});(0,_vitest.expect)((0,_layout.parseLayout)("right-16")).toEqual({right:64});});(0,_vitest.it)("should parse bottom values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("bottom-0")).toEqual({bottom:0});(0,_vitest.expect)((0,_layout.parseLayout)("bottom-4")).toEqual({bottom:16});(0,_vitest.expect)((0,_layout.parseLayout)("bottom-8")).toEqual({bottom:32});(0,_vitest.expect)((0,_layout.parseLayout)("bottom-16")).toEqual({bottom:64});});(0,_vitest.it)("should parse left values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("left-0")).toEqual({left:0});(0,_vitest.expect)((0,_layout.parseLayout)("left-4")).toEqual({left:16});(0,_vitest.expect)((0,_layout.parseLayout)("left-8")).toEqual({left:32});(0,_vitest.expect)((0,_layout.parseLayout)("left-16")).toEqual({left:64});});(0,_vitest.it)("should parse fractional positioning values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-0.5")).toEqual({top:2});(0,_vitest.expect)((0,_layout.parseLayout)("right-1.5")).toEqual({right:6});(0,_vitest.expect)((0,_layout.parseLayout)("bottom-2.5")).toEqual({bottom:10});(0,_vitest.expect)((0,_layout.parseLayout)("left-3.5")).toEqual({left:14});});(0,_vitest.it)("should parse auto positioning values as empty object",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-auto")).toEqual({});(0,_vitest.expect)((0,_layout.parseLayout)("right-auto")).toEqual({});(0,_vitest.expect)((0,_layout.parseLayout)("bottom-auto")).toEqual({});(0,_vitest.expect)((0,_layout.parseLayout)("left-auto")).toEqual({});});(0,_vitest.it)("should parse arbitrary top values with pixels",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-[50px]")).toEqual({top:50});(0,_vitest.expect)((0,_layout.parseLayout)("top-[100px]")).toEqual({top:100});(0,_vitest.expect)((0,_layout.parseLayout)("top-[0px]")).toEqual({top:0});});(0,_vitest.it)("should parse arbitrary top values without unit (defaults to px)",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-[50]")).toEqual({top:50});(0,_vitest.expect)((0,_layout.parseLayout)("top-[100]")).toEqual({top:100});});(0,_vitest.it)("should parse arbitrary top values with percentages",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-[25%]")).toEqual({top:"25%"});(0,_vitest.expect)((0,_layout.parseLayout)("top-[50%]")).toEqual({top:"50%"});(0,_vitest.expect)((0,_layout.parseLayout)("top-[10.5%]")).toEqual({top:"10.5%"});});(0,_vitest.it)("should parse negative arbitrary top values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-[-10px]")).toEqual({top:-10});(0,_vitest.expect)((0,_layout.parseLayout)("top-[-50]")).toEqual({top:-50});(0,_vitest.expect)((0,_layout.parseLayout)("top-[-25%]")).toEqual({top:"-25%"});});(0,_vitest.it)("should parse arbitrary right values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("right-[30px]")).toEqual({right:30});(0,_vitest.expect)((0,_layout.parseLayout)("right-[20]")).toEqual({right:20});(0,_vitest.expect)((0,_layout.parseLayout)("right-[15%]")).toEqual({right:"15%"});(0,_vitest.expect)((0,_layout.parseLayout)("right-[-10px]")).toEqual({right:-10});});(0,_vitest.it)("should parse arbitrary bottom values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("bottom-[40px]")).toEqual({bottom:40});(0,_vitest.expect)((0,_layout.parseLayout)("bottom-[25]")).toEqual({bottom:25});(0,_vitest.expect)((0,_layout.parseLayout)("bottom-[33.333%]")).toEqual({bottom:"33.333%"});(0,_vitest.expect)((0,_layout.parseLayout)("bottom-[-15px]")).toEqual({bottom:-15});});(0,_vitest.it)("should parse arbitrary left values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("left-[60px]")).toEqual({left:60});(0,_vitest.expect)((0,_layout.parseLayout)("left-[45]")).toEqual({left:45});(0,_vitest.expect)((0,_layout.parseLayout)("left-[12.5%]")).toEqual({left:"12.5%"});(0,_vitest.expect)((0,_layout.parseLayout)("left-[-20px]")).toEqual({left:-20});});});(0,_vitest.describe)("parseLayout - inset utilities",function(){(0,_vitest.it)("should parse inset (all sides) values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-0")).toEqual({top:0,right:0,bottom:0,left:0});(0,_vitest.expect)((0,_layout.parseLayout)("inset-4")).toEqual({top:16,right:16,bottom:16,left:16});(0,_vitest.expect)((0,_layout.parseLayout)("inset-8")).toEqual({top:32,right:32,bottom:32,left:32});});(0,_vitest.it)("should parse inset-x (horizontal) values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-x-0")).toEqual({left:0,right:0});(0,_vitest.expect)((0,_layout.parseLayout)("inset-x-4")).toEqual({left:16,right:16});(0,_vitest.expect)((0,_layout.parseLayout)("inset-x-8")).toEqual({left:32,right:32});});(0,_vitest.it)("should parse inset-y (vertical) values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-y-0")).toEqual({top:0,bottom:0});(0,_vitest.expect)((0,_layout.parseLayout)("inset-y-4")).toEqual({top:16,bottom:16});(0,_vitest.expect)((0,_layout.parseLayout)("inset-y-8")).toEqual({top:32,bottom:32});});(0,_vitest.it)("should parse fractional inset values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-0.5")).toEqual({top:2,right:2,bottom:2,left:2});(0,_vitest.expect)((0,_layout.parseLayout)("inset-x-1.5")).toEqual({left:6,right:6});(0,_vitest.expect)((0,_layout.parseLayout)("inset-y-2.5")).toEqual({top:10,bottom:10});});(0,_vitest.it)("should return null for invalid inset values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-100")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("inset-x-100")).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("inset-y-100")).toBeNull();});(0,_vitest.it)("should parse arbitrary inset (all sides) values with pixels",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-[10px]")).toEqual({top:10,right:10,bottom:10,left:10});(0,_vitest.expect)((0,_layout.parseLayout)("inset-[25px]")).toEqual({top:25,right:25,bottom:25,left:25});(0,_vitest.expect)((0,_layout.parseLayout)("inset-[0px]")).toEqual({top:0,right:0,bottom:0,left:0});});(0,_vitest.it)("should parse arbitrary inset values without unit (defaults to px)",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-[15]")).toEqual({top:15,right:15,bottom:15,left:15});(0,_vitest.expect)((0,_layout.parseLayout)("inset-[30]")).toEqual({top:30,right:30,bottom:30,left:30});});(0,_vitest.it)("should parse arbitrary inset values with percentages",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-[10%]")).toEqual({top:"10%",right:"10%",bottom:"10%",left:"10%"});(0,_vitest.expect)((0,_layout.parseLayout)("inset-[25%]")).toEqual({top:"25%",right:"25%",bottom:"25%",left:"25%"});(0,_vitest.expect)((0,_layout.parseLayout)("inset-[5.5%]")).toEqual({top:"5.5%",right:"5.5%",bottom:"5.5%",left:"5.5%"});});(0,_vitest.it)("should parse arbitrary inset-x (horizontal) values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-x-[20px]")).toEqual({left:20,right:20});(0,_vitest.expect)((0,_layout.parseLayout)("inset-x-[15]")).toEqual({left:15,right:15});(0,_vitest.expect)((0,_layout.parseLayout)("inset-x-[10%]")).toEqual({left:"10%",right:"10%"});});(0,_vitest.it)("should parse arbitrary inset-y (vertical) values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-y-[30px]")).toEqual({top:30,bottom:30});(0,_vitest.expect)((0,_layout.parseLayout)("inset-y-[25]")).toEqual({top:25,bottom:25});(0,_vitest.expect)((0,_layout.parseLayout)("inset-y-[15%]")).toEqual({top:"15%",bottom:"15%"});});(0,_vitest.it)("should parse negative arbitrary inset values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-[-5px]")).toEqual({top:-5,right:-5,bottom:-5,left:-5});(0,_vitest.expect)((0,_layout.parseLayout)("inset-x-[-10px]")).toEqual({left:-10,right:-10});(0,_vitest.expect)((0,_layout.parseLayout)("inset-y-[-15px]")).toEqual({top:-15,bottom:-15});(0,_vitest.expect)((0,_layout.parseLayout)("inset-[-20%]")).toEqual({top:"-20%",right:"-20%",bottom:"-20%",left:"-20%"});});});(0,_vitest.describe)("parseLayout - specific property coverage",function(){(0,_vitest.it)("should return unique objects for each class",function(){var flex1=(0,_layout.parseLayout)("flex");var flex2=(0,_layout.parseLayout)("flex");(0,_vitest.expect)(flex1).toEqual(flex2);});(0,_vitest.it)("should handle flex value variations",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-1")).toEqual({flex:1});(0,_vitest.expect)((0,_layout.parseLayout)("flex-auto")).toEqual({flex:1});(0,_vitest.expect)((0,_layout.parseLayout)("flex-none")).toEqual({flex:0});});(0,_vitest.it)("should distinguish between similar class names",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex")).not.toEqual((0,_layout.parseLayout)("flex-1"));(0,_vitest.expect)((0,_layout.parseLayout)("grow")).not.toEqual((0,_layout.parseLayout)("grow-0"));(0,_vitest.expect)((0,_layout.parseLayout)("shrink")).not.toEqual((0,_layout.parseLayout)("shrink-0"));});(0,_vitest.it)("should handle positioning with absolute/relative",function(){(0,_vitest.expect)((0,_layout.parseLayout)("absolute")).toEqual({position:"absolute"});(0,_vitest.expect)((0,_layout.parseLayout)("top-0")).toEqual({top:0});(0,_vitest.expect)((0,_layout.parseLayout)("left-0")).toEqual({left:0});});(0,_vitest.it)("should handle all positioning directions",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-4")).toHaveProperty("top");(0,_vitest.expect)((0,_layout.parseLayout)("right-4")).toHaveProperty("right");(0,_vitest.expect)((0,_layout.parseLayout)("bottom-4")).toHaveProperty("bottom");(0,_vitest.expect)((0,_layout.parseLayout)("left-4")).toHaveProperty("left");});(0,_vitest.it)("should handle inset shorthand variations",function(){var insetAll=(0,_layout.parseLayout)("inset-4");(0,_vitest.expect)(insetAll).toHaveProperty("top",16);(0,_vitest.expect)(insetAll).toHaveProperty("right",16);(0,_vitest.expect)(insetAll).toHaveProperty("bottom",16);(0,_vitest.expect)(insetAll).toHaveProperty("left",16);var insetX=(0,_layout.parseLayout)("inset-x-4");(0,_vitest.expect)(insetX).toHaveProperty("left",16);(0,_vitest.expect)(insetX).toHaveProperty("right",16);(0,_vitest.expect)(insetX).not.toHaveProperty("top");(0,_vitest.expect)(insetX).not.toHaveProperty("bottom");var insetY=(0,_layout.parseLayout)("inset-y-4");(0,_vitest.expect)(insetY).toHaveProperty("top",16);(0,_vitest.expect)(insetY).toHaveProperty("bottom",16);(0,_vitest.expect)(insetY).not.toHaveProperty("left");(0,_vitest.expect)(insetY).not.toHaveProperty("right");});});(0,_vitest.describe)("parseLayout - logical positioning (RTL-aware)",function(){(0,_vitest.it)("should parse start positioning with preset values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("start-0")).toEqual({start:0});(0,_vitest.expect)((0,_layout.parseLayout)("start-4")).toEqual({start:16});(0,_vitest.expect)((0,_layout.parseLayout)("start-8")).toEqual({start:32});(0,_vitest.expect)((0,_layout.parseLayout)("start-0.5")).toEqual({start:2});(0,_vitest.expect)((0,_layout.parseLayout)("start-2.5")).toEqual({start:10});});(0,_vitest.it)("should parse end positioning with preset values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("end-0")).toEqual({end:0});(0,_vitest.expect)((0,_layout.parseLayout)("end-4")).toEqual({end:16});(0,_vitest.expect)((0,_layout.parseLayout)("end-8")).toEqual({end:32});(0,_vitest.expect)((0,_layout.parseLayout)("end-0.5")).toEqual({end:2});(0,_vitest.expect)((0,_layout.parseLayout)("end-2.5")).toEqual({end:10});});(0,_vitest.it)("should parse start/end with arbitrary pixel values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("start-[10px]")).toEqual({start:10});(0,_vitest.expect)((0,_layout.parseLayout)("start-[50]")).toEqual({start:50});(0,_vitest.expect)((0,_layout.parseLayout)("end-[10px]")).toEqual({end:10});(0,_vitest.expect)((0,_layout.parseLayout)("end-[50]")).toEqual({end:50});});(0,_vitest.it)("should parse start/end with arbitrary percentage values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("start-[10%]")).toEqual({start:"10%"});(0,_vitest.expect)((0,_layout.parseLayout)("start-[50%]")).toEqual({start:"50%"});(0,_vitest.expect)((0,_layout.parseLayout)("end-[10%]")).toEqual({end:"10%"});(0,_vitest.expect)((0,_layout.parseLayout)("end-[50%]")).toEqual({end:"50%"});});(0,_vitest.it)("should parse negative start/end with preset values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("-start-4")).toEqual({start:-16});(0,_vitest.expect)((0,_layout.parseLayout)("-start-8")).toEqual({start:-32});(0,_vitest.expect)((0,_layout.parseLayout)("-end-4")).toEqual({end:-16});(0,_vitest.expect)((0,_layout.parseLayout)("-end-8")).toEqual({end:-32});});(0,_vitest.it)("should parse negative start/end with arbitrary values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("-start-[10px]")).toEqual({start:-10});(0,_vitest.expect)((0,_layout.parseLayout)("-start-[50]")).toEqual({start:-50});(0,_vitest.expect)((0,_layout.parseLayout)("-end-[10px]")).toEqual({end:-10});(0,_vitest.expect)((0,_layout.parseLayout)("-end-[50]")).toEqual({end:-50});(0,_vitest.expect)((0,_layout.parseLayout)("-start-[10%]")).toEqual({start:"-10%"});(0,_vitest.expect)((0,_layout.parseLayout)("-end-[25%]")).toEqual({end:"-25%"});});(0,_vitest.it)("should handle auto value for start/end",function(){(0,_vitest.expect)((0,_layout.parseLayout)("start-auto")).toEqual({});(0,_vitest.expect)((0,_layout.parseLayout)("end-auto")).toEqual({});});});(0,_vitest.describe)("parseLayout - logical inset (RTL-aware)",function(){(0,_vitest.it)("should parse inset-s (start) with preset values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-s-0")).toEqual({start:0});(0,_vitest.expect)((0,_layout.parseLayout)("inset-s-4")).toEqual({start:16});(0,_vitest.expect)((0,_layout.parseLayout)("inset-s-8")).toEqual({start:32});});(0,_vitest.it)("should parse inset-e (end) with preset values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-e-0")).toEqual({end:0});(0,_vitest.expect)((0,_layout.parseLayout)("inset-e-4")).toEqual({end:16});(0,_vitest.expect)((0,_layout.parseLayout)("inset-e-8")).toEqual({end:32});});(0,_vitest.it)("should parse inset-s/inset-e with arbitrary values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-s-[10px]")).toEqual({start:10});(0,_vitest.expect)((0,_layout.parseLayout)("inset-s-[20%]")).toEqual({start:"20%"});(0,_vitest.expect)((0,_layout.parseLayout)("inset-e-[10px]")).toEqual({end:10});(0,_vitest.expect)((0,_layout.parseLayout)("inset-e-[20%]")).toEqual({end:"20%"});});});(0,_vitest.describe)("parseLayout - custom spacing",function(){var customSpacing={xs:4,sm:8,md:16,lg:32,xl:64,"4":20};(0,_vitest.it)("should support custom spacing values for top/right/bottom/left",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-xs",customSpacing)).toEqual({top:4});(0,_vitest.expect)((0,_layout.parseLayout)("top-sm",customSpacing)).toEqual({top:8});(0,_vitest.expect)((0,_layout.parseLayout)("top-md",customSpacing)).toEqual({top:16});(0,_vitest.expect)((0,_layout.parseLayout)("top-lg",customSpacing)).toEqual({top:32});(0,_vitest.expect)((0,_layout.parseLayout)("top-xl",customSpacing)).toEqual({top:64});(0,_vitest.expect)((0,_layout.parseLayout)("right-xs",customSpacing)).toEqual({right:4});(0,_vitest.expect)((0,_layout.parseLayout)("bottom-sm",customSpacing)).toEqual({bottom:8});(0,_vitest.expect)((0,_layout.parseLayout)("left-md",customSpacing)).toEqual({left:16});});(0,_vitest.it)("should override default spacing values",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-4")).toEqual({top:16});(0,_vitest.expect)((0,_layout.parseLayout)("top-4",customSpacing)).toEqual({top:20});});(0,_vitest.it)("should merge custom spacing with defaults",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-0",customSpacing)).toEqual({top:0});(0,_vitest.expect)((0,_layout.parseLayout)("top-8",customSpacing)).toEqual({top:32});(0,_vitest.expect)((0,_layout.parseLayout)("top-xs",customSpacing)).toEqual({top:4});});(0,_vitest.it)("should support custom spacing for start/end (RTL-aware)",function(){(0,_vitest.expect)((0,_layout.parseLayout)("start-xs",customSpacing)).toEqual({start:4});(0,_vitest.expect)((0,_layout.parseLayout)("end-lg",customSpacing)).toEqual({end:32});});(0,_vitest.it)("should support custom spacing for inset utilities",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-xs",customSpacing)).toEqual({top:4,right:4,bottom:4,left:4});(0,_vitest.expect)((0,_layout.parseLayout)("inset-x-sm",customSpacing)).toEqual({left:8,right:8});(0,_vitest.expect)((0,_layout.parseLayout)("inset-y-md",customSpacing)).toEqual({top:16,bottom:16});});(0,_vitest.it)("should support custom spacing for inset-s/inset-e",function(){(0,_vitest.expect)((0,_layout.parseLayout)("inset-s-lg",customSpacing)).toEqual({start:32});(0,_vitest.expect)((0,_layout.parseLayout)("inset-e-xl",customSpacing)).toEqual({end:64});});(0,_vitest.it)("should support negative values with custom spacing for start/end",function(){(0,_vitest.expect)((0,_layout.parseLayout)("-start-sm",customSpacing)).toEqual({start:-8});(0,_vitest.expect)((0,_layout.parseLayout)("-end-md",customSpacing)).toEqual({end:-16});});(0,_vitest.it)("should still support arbitrary values with custom spacing",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-[100px]",customSpacing)).toEqual({top:100});(0,_vitest.expect)((0,_layout.parseLayout)("inset-[50%]",customSpacing)).toEqual({top:"50%",right:"50%",bottom:"50%",left:"50%"});});(0,_vitest.it)("should handle non-layout classes as null",function(){(0,_vitest.expect)((0,_layout.parseLayout)("text-xl",customSpacing)).toBeNull();(0,_vitest.expect)((0,_layout.parseLayout)("bg-blue-500",customSpacing)).toBeNull();});});
@@ -6,5 +6,7 @@ export declare const SIZE_SCALE: Record<string, number>;
6
6
  export declare const SIZE_PERCENTAGES: Record<string, string>;
7
7
  /**
8
8
  * Parse sizing classes
9
+ * @param cls - The class name to parse
10
+ * @param customSpacing - Optional custom spacing values from tailwind.config (shared with spacing utilities)
9
11
  */
10
- export declare function parseSizing(cls: string): StyleObject | null;
12
+ export declare function parseSizing(cls: string, customSpacing?: Record<string, number>): StyleObject | null;
@@ -1 +1 @@
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;}
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,customSpacing){var sizeMap=customSpacing?Object.assign({},SIZE_SCALE,customSpacing):SIZE_SCALE;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=sizeMap[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=sizeMap[_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=sizeMap[_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=sizeMap[_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=sizeMap[_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=sizeMap[_sizeKey5];if(_numericSize5!==undefined){return{maxHeight:_numericSize5};}}return null;}
@@ -1 +1 @@
1
- var _vitest=require("vitest");var _sizing=require("./sizing");(0,_vitest.describe)("SIZE_SCALE",function(){(0,_vitest.it)("should export complete size scale",function(){(0,_vitest.expect)(_sizing.SIZE_SCALE).toMatchSnapshot();});});(0,_vitest.describe)("SIZE_PERCENTAGES",function(){(0,_vitest.it)("should export complete percentage sizes",function(){(0,_vitest.expect)(_sizing.SIZE_PERCENTAGES).toMatchSnapshot();});});(0,_vitest.describe)("parseSizing - width",function(){(0,_vitest.it)("should parse width with numeric values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-0")).toEqual({width:0});(0,_vitest.expect)((0,_sizing.parseSizing)("w-4")).toEqual({width:16});(0,_vitest.expect)((0,_sizing.parseSizing)("w-8")).toEqual({width:32});(0,_vitest.expect)((0,_sizing.parseSizing)("w-96")).toEqual({width:384});});(0,_vitest.it)("should parse width with fractional values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-0.5")).toEqual({width:2});(0,_vitest.expect)((0,_sizing.parseSizing)("w-1.5")).toEqual({width:6});(0,_vitest.expect)((0,_sizing.parseSizing)("w-2.5")).toEqual({width:10});});(0,_vitest.it)("should parse width with percentage values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-full")).toEqual({width:"100%"});(0,_vitest.expect)((0,_sizing.parseSizing)("w-1/2")).toEqual({width:"50%"});(0,_vitest.expect)((0,_sizing.parseSizing)("w-1/3")).toEqual({width:"33.333333%"});(0,_vitest.expect)((0,_sizing.parseSizing)("w-2/3")).toEqual({width:"66.666667%"});(0,_vitest.expect)((0,_sizing.parseSizing)("w-1/4")).toEqual({width:"25%"});(0,_vitest.expect)((0,_sizing.parseSizing)("w-3/4")).toEqual({width:"75%"});});(0,_vitest.it)("should parse width with special values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-auto")).toEqual({width:"auto"});});(0,_vitest.it)("should parse width with arbitrary pixel values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-[123px]")).toEqual({width:123});(0,_vitest.expect)((0,_sizing.parseSizing)("w-[123]")).toEqual({width:123});(0,_vitest.expect)((0,_sizing.parseSizing)("w-[350px]")).toEqual({width:350});});(0,_vitest.it)("should parse width with arbitrary percentage values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-[50%]")).toEqual({width:"50%"});(0,_vitest.expect)((0,_sizing.parseSizing)("w-[33.333%]")).toEqual({width:"33.333%"});(0,_vitest.expect)((0,_sizing.parseSizing)("w-[85%]")).toEqual({width:"85%"});});});(0,_vitest.describe)("parseSizing - height",function(){(0,_vitest.it)("should parse height with numeric values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("h-0")).toEqual({height:0});(0,_vitest.expect)((0,_sizing.parseSizing)("h-4")).toEqual({height:16});(0,_vitest.expect)((0,_sizing.parseSizing)("h-8")).toEqual({height:32});(0,_vitest.expect)((0,_sizing.parseSizing)("h-96")).toEqual({height:384});});(0,_vitest.it)("should parse height with fractional values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("h-0.5")).toEqual({height:2});(0,_vitest.expect)((0,_sizing.parseSizing)("h-1.5")).toEqual({height:6});(0,_vitest.expect)((0,_sizing.parseSizing)("h-2.5")).toEqual({height:10});});(0,_vitest.it)("should parse height with percentage values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("h-full")).toEqual({height:"100%"});(0,_vitest.expect)((0,_sizing.parseSizing)("h-1/2")).toEqual({height:"50%"});(0,_vitest.expect)((0,_sizing.parseSizing)("h-1/3")).toEqual({height:"33.333333%"});(0,_vitest.expect)((0,_sizing.parseSizing)("h-2/3")).toEqual({height:"66.666667%"});});(0,_vitest.it)("should parse height with special values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("h-auto")).toEqual({height:"auto"});});(0,_vitest.it)("should parse height with arbitrary values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("h-[200px]")).toEqual({height:200});(0,_vitest.expect)((0,_sizing.parseSizing)("h-[75%]")).toEqual({height:"75%"});});});(0,_vitest.describe)("parseSizing - min width",function(){(0,_vitest.it)("should parse min-width with numeric values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("min-w-0")).toEqual({minWidth:0});(0,_vitest.expect)((0,_sizing.parseSizing)("min-w-4")).toEqual({minWidth:16});(0,_vitest.expect)((0,_sizing.parseSizing)("min-w-8")).toEqual({minWidth:32});});(0,_vitest.it)("should parse min-width with percentage values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("min-w-full")).toEqual({minWidth:"100%"});(0,_vitest.expect)((0,_sizing.parseSizing)("min-w-1/2")).toEqual({minWidth:"50%"});});(0,_vitest.it)("should parse min-width with arbitrary values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("min-w-[200px]")).toEqual({minWidth:200});(0,_vitest.expect)((0,_sizing.parseSizing)("min-w-[50%]")).toEqual({minWidth:"50%"});});});(0,_vitest.describe)("parseSizing - min height",function(){(0,_vitest.it)("should parse min-height with numeric values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("min-h-0")).toEqual({minHeight:0});(0,_vitest.expect)((0,_sizing.parseSizing)("min-h-4")).toEqual({minHeight:16});(0,_vitest.expect)((0,_sizing.parseSizing)("min-h-8")).toEqual({minHeight:32});});(0,_vitest.it)("should parse min-height with percentage values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("min-h-full")).toEqual({minHeight:"100%"});(0,_vitest.expect)((0,_sizing.parseSizing)("min-h-1/2")).toEqual({minHeight:"50%"});});(0,_vitest.it)("should parse min-height with arbitrary values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("min-h-[150px]")).toEqual({minHeight:150});(0,_vitest.expect)((0,_sizing.parseSizing)("min-h-[40%]")).toEqual({minHeight:"40%"});});});(0,_vitest.describe)("parseSizing - max width",function(){(0,_vitest.it)("should parse max-width with numeric values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("max-w-0")).toEqual({maxWidth:0});(0,_vitest.expect)((0,_sizing.parseSizing)("max-w-4")).toEqual({maxWidth:16});(0,_vitest.expect)((0,_sizing.parseSizing)("max-w-8")).toEqual({maxWidth:32});});(0,_vitest.it)("should parse max-width with percentage values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("max-w-full")).toEqual({maxWidth:"100%"});(0,_vitest.expect)((0,_sizing.parseSizing)("max-w-1/2")).toEqual({maxWidth:"50%"});});(0,_vitest.it)("should parse max-width with arbitrary values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("max-w-[500px]")).toEqual({maxWidth:500});(0,_vitest.expect)((0,_sizing.parseSizing)("max-w-[80%]")).toEqual({maxWidth:"80%"});});});(0,_vitest.describe)("parseSizing - max height",function(){(0,_vitest.it)("should parse max-height with numeric values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("max-h-0")).toEqual({maxHeight:0});(0,_vitest.expect)((0,_sizing.parseSizing)("max-h-4")).toEqual({maxHeight:16});(0,_vitest.expect)((0,_sizing.parseSizing)("max-h-8")).toEqual({maxHeight:32});});(0,_vitest.it)("should parse max-height with percentage values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("max-h-full")).toEqual({maxHeight:"100%"});(0,_vitest.expect)((0,_sizing.parseSizing)("max-h-1/2")).toEqual({maxHeight:"50%"});});(0,_vitest.it)("should parse max-height with arbitrary values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("max-h-[300px]")).toEqual({maxHeight:300});(0,_vitest.expect)((0,_sizing.parseSizing)("max-h-[90%]")).toEqual({maxHeight:"90%"});});});(0,_vitest.describe)("parseSizing - edge cases",function(){(0,_vitest.it)("should return null for invalid classes",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("invalid")).toBeNull();(0,_vitest.expect)((0,_sizing.parseSizing)("w")).toBeNull();(0,_vitest.expect)((0,_sizing.parseSizing)("h")).toBeNull();(0,_vitest.expect)((0,_sizing.parseSizing)("width-4")).toBeNull();(0,_vitest.expect)((0,_sizing.parseSizing)("height-4")).toBeNull();});(0,_vitest.it)("should return null for invalid size values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-invalid")).toBeNull();(0,_vitest.expect)((0,_sizing.parseSizing)("h-999")).toBeNull();(0,_vitest.expect)((0,_sizing.parseSizing)("min-w-abc")).toBeNull();});(0,_vitest.it)("should return null for arbitrary values with unsupported units",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-[16rem]")).toBeNull();(0,_vitest.expect)((0,_sizing.parseSizing)("h-[2em]")).toBeNull();(0,_vitest.expect)((0,_sizing.parseSizing)("max-w-[50vh]")).toBeNull();(0,_vitest.expect)((0,_sizing.parseSizing)("min-h-[100vw]")).toBeNull();});(0,_vitest.it)("should return null for malformed arbitrary values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-[16")).toBeNull();(0,_vitest.expect)((0,_sizing.parseSizing)("h-16]")).toBeNull();(0,_vitest.expect)((0,_sizing.parseSizing)("min-w-[]")).toBeNull();});(0,_vitest.it)("should handle edge case size values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-0")).toEqual({width:0});(0,_vitest.expect)((0,_sizing.parseSizing)("h-0")).toEqual({height:0});(0,_vitest.expect)((0,_sizing.parseSizing)("min-w-0")).toEqual({minWidth:0});(0,_vitest.expect)((0,_sizing.parseSizing)("max-h-0")).toEqual({maxHeight:0});});(0,_vitest.it)("should not match partial class names",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("tw-4")).toBeNull();(0,_vitest.expect)((0,_sizing.parseSizing)("width-4")).toBeNull();(0,_vitest.expect)((0,_sizing.parseSizing)("height-4")).toBeNull();});});(0,_vitest.describe)("parseSizing - comprehensive coverage",function(){(0,_vitest.it)("should parse all width variants with same value",function(){var value=16;(0,_vitest.expect)((0,_sizing.parseSizing)("w-4")).toEqual({width:value});(0,_vitest.expect)((0,_sizing.parseSizing)("min-w-4")).toEqual({minWidth:value});(0,_vitest.expect)((0,_sizing.parseSizing)("max-w-4")).toEqual({maxWidth:value});});(0,_vitest.it)("should parse all height variants with same value",function(){var value=16;(0,_vitest.expect)((0,_sizing.parseSizing)("h-4")).toEqual({height:value});(0,_vitest.expect)((0,_sizing.parseSizing)("min-h-4")).toEqual({minHeight:value});(0,_vitest.expect)((0,_sizing.parseSizing)("max-h-4")).toEqual({maxHeight:value});});(0,_vitest.it)("should handle large size values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-96")).toEqual({width:384});(0,_vitest.expect)((0,_sizing.parseSizing)("h-96")).toEqual({height:384});(0,_vitest.expect)((0,_sizing.parseSizing)("max-w-96")).toEqual({maxWidth:384});});(0,_vitest.it)("should handle arbitrary values across all width variants",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-[123px]")).toEqual({width:123});(0,_vitest.expect)((0,_sizing.parseSizing)("min-w-[123px]")).toEqual({minWidth:123});(0,_vitest.expect)((0,_sizing.parseSizing)("max-w-[123px]")).toEqual({maxWidth:123});});(0,_vitest.it)("should handle arbitrary values across all height variants",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("h-[200px]")).toEqual({height:200});(0,_vitest.expect)((0,_sizing.parseSizing)("min-h-[200px]")).toEqual({minHeight:200});(0,_vitest.expect)((0,_sizing.parseSizing)("max-h-[200px]")).toEqual({maxHeight:200});});(0,_vitest.it)("should handle arbitrary percentage values across all variants",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-[75%]")).toEqual({width:"75%"});(0,_vitest.expect)((0,_sizing.parseSizing)("h-[60%]")).toEqual({height:"60%"});(0,_vitest.expect)((0,_sizing.parseSizing)("min-w-[25%]")).toEqual({minWidth:"25%"});(0,_vitest.expect)((0,_sizing.parseSizing)("max-h-[90%]")).toEqual({maxHeight:"90%"});});(0,_vitest.it)("should handle all fractional percentage variants",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-1/5")).toEqual({width:"20%"});(0,_vitest.expect)((0,_sizing.parseSizing)("w-2/5")).toEqual({width:"40%"});(0,_vitest.expect)((0,_sizing.parseSizing)("w-3/5")).toEqual({width:"60%"});(0,_vitest.expect)((0,_sizing.parseSizing)("w-4/5")).toEqual({width:"80%"});(0,_vitest.expect)((0,_sizing.parseSizing)("w-1/6")).toEqual({width:"16.666667%"});(0,_vitest.expect)((0,_sizing.parseSizing)("w-5/6")).toEqual({width:"83.333333%"});});(0,_vitest.it)("should handle special values consistently",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-auto")).toEqual({width:"auto"});(0,_vitest.expect)((0,_sizing.parseSizing)("h-auto")).toEqual({height:"auto"});(0,_vitest.expect)((0,_sizing.parseSizing)("w-full")).toEqual({width:"100%"});(0,_vitest.expect)((0,_sizing.parseSizing)("h-full")).toEqual({height:"100%"});});});
1
+ var _vitest=require("vitest");var _sizing=require("./sizing");(0,_vitest.describe)("SIZE_SCALE",function(){(0,_vitest.it)("should export complete size scale",function(){(0,_vitest.expect)(_sizing.SIZE_SCALE).toMatchSnapshot();});});(0,_vitest.describe)("SIZE_PERCENTAGES",function(){(0,_vitest.it)("should export complete percentage sizes",function(){(0,_vitest.expect)(_sizing.SIZE_PERCENTAGES).toMatchSnapshot();});});(0,_vitest.describe)("parseSizing - width",function(){(0,_vitest.it)("should parse width with numeric values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-0")).toEqual({width:0});(0,_vitest.expect)((0,_sizing.parseSizing)("w-4")).toEqual({width:16});(0,_vitest.expect)((0,_sizing.parseSizing)("w-8")).toEqual({width:32});(0,_vitest.expect)((0,_sizing.parseSizing)("w-96")).toEqual({width:384});});(0,_vitest.it)("should parse width with fractional values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-0.5")).toEqual({width:2});(0,_vitest.expect)((0,_sizing.parseSizing)("w-1.5")).toEqual({width:6});(0,_vitest.expect)((0,_sizing.parseSizing)("w-2.5")).toEqual({width:10});});(0,_vitest.it)("should parse width with percentage values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-full")).toEqual({width:"100%"});(0,_vitest.expect)((0,_sizing.parseSizing)("w-1/2")).toEqual({width:"50%"});(0,_vitest.expect)((0,_sizing.parseSizing)("w-1/3")).toEqual({width:"33.333333%"});(0,_vitest.expect)((0,_sizing.parseSizing)("w-2/3")).toEqual({width:"66.666667%"});(0,_vitest.expect)((0,_sizing.parseSizing)("w-1/4")).toEqual({width:"25%"});(0,_vitest.expect)((0,_sizing.parseSizing)("w-3/4")).toEqual({width:"75%"});});(0,_vitest.it)("should parse width with special values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-auto")).toEqual({width:"auto"});});(0,_vitest.it)("should parse width with arbitrary pixel values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-[123px]")).toEqual({width:123});(0,_vitest.expect)((0,_sizing.parseSizing)("w-[123]")).toEqual({width:123});(0,_vitest.expect)((0,_sizing.parseSizing)("w-[350px]")).toEqual({width:350});});(0,_vitest.it)("should parse width with arbitrary percentage values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-[50%]")).toEqual({width:"50%"});(0,_vitest.expect)((0,_sizing.parseSizing)("w-[33.333%]")).toEqual({width:"33.333%"});(0,_vitest.expect)((0,_sizing.parseSizing)("w-[85%]")).toEqual({width:"85%"});});});(0,_vitest.describe)("parseSizing - height",function(){(0,_vitest.it)("should parse height with numeric values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("h-0")).toEqual({height:0});(0,_vitest.expect)((0,_sizing.parseSizing)("h-4")).toEqual({height:16});(0,_vitest.expect)((0,_sizing.parseSizing)("h-8")).toEqual({height:32});(0,_vitest.expect)((0,_sizing.parseSizing)("h-96")).toEqual({height:384});});(0,_vitest.it)("should parse height with fractional values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("h-0.5")).toEqual({height:2});(0,_vitest.expect)((0,_sizing.parseSizing)("h-1.5")).toEqual({height:6});(0,_vitest.expect)((0,_sizing.parseSizing)("h-2.5")).toEqual({height:10});});(0,_vitest.it)("should parse height with percentage values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("h-full")).toEqual({height:"100%"});(0,_vitest.expect)((0,_sizing.parseSizing)("h-1/2")).toEqual({height:"50%"});(0,_vitest.expect)((0,_sizing.parseSizing)("h-1/3")).toEqual({height:"33.333333%"});(0,_vitest.expect)((0,_sizing.parseSizing)("h-2/3")).toEqual({height:"66.666667%"});});(0,_vitest.it)("should parse height with special values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("h-auto")).toEqual({height:"auto"});});(0,_vitest.it)("should parse height with arbitrary values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("h-[200px]")).toEqual({height:200});(0,_vitest.expect)((0,_sizing.parseSizing)("h-[75%]")).toEqual({height:"75%"});});});(0,_vitest.describe)("parseSizing - min width",function(){(0,_vitest.it)("should parse min-width with numeric values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("min-w-0")).toEqual({minWidth:0});(0,_vitest.expect)((0,_sizing.parseSizing)("min-w-4")).toEqual({minWidth:16});(0,_vitest.expect)((0,_sizing.parseSizing)("min-w-8")).toEqual({minWidth:32});});(0,_vitest.it)("should parse min-width with percentage values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("min-w-full")).toEqual({minWidth:"100%"});(0,_vitest.expect)((0,_sizing.parseSizing)("min-w-1/2")).toEqual({minWidth:"50%"});});(0,_vitest.it)("should parse min-width with arbitrary values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("min-w-[200px]")).toEqual({minWidth:200});(0,_vitest.expect)((0,_sizing.parseSizing)("min-w-[50%]")).toEqual({minWidth:"50%"});});});(0,_vitest.describe)("parseSizing - min height",function(){(0,_vitest.it)("should parse min-height with numeric values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("min-h-0")).toEqual({minHeight:0});(0,_vitest.expect)((0,_sizing.parseSizing)("min-h-4")).toEqual({minHeight:16});(0,_vitest.expect)((0,_sizing.parseSizing)("min-h-8")).toEqual({minHeight:32});});(0,_vitest.it)("should parse min-height with percentage values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("min-h-full")).toEqual({minHeight:"100%"});(0,_vitest.expect)((0,_sizing.parseSizing)("min-h-1/2")).toEqual({minHeight:"50%"});});(0,_vitest.it)("should parse min-height with arbitrary values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("min-h-[150px]")).toEqual({minHeight:150});(0,_vitest.expect)((0,_sizing.parseSizing)("min-h-[40%]")).toEqual({minHeight:"40%"});});});(0,_vitest.describe)("parseSizing - max width",function(){(0,_vitest.it)("should parse max-width with numeric values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("max-w-0")).toEqual({maxWidth:0});(0,_vitest.expect)((0,_sizing.parseSizing)("max-w-4")).toEqual({maxWidth:16});(0,_vitest.expect)((0,_sizing.parseSizing)("max-w-8")).toEqual({maxWidth:32});});(0,_vitest.it)("should parse max-width with percentage values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("max-w-full")).toEqual({maxWidth:"100%"});(0,_vitest.expect)((0,_sizing.parseSizing)("max-w-1/2")).toEqual({maxWidth:"50%"});});(0,_vitest.it)("should parse max-width with arbitrary values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("max-w-[500px]")).toEqual({maxWidth:500});(0,_vitest.expect)((0,_sizing.parseSizing)("max-w-[80%]")).toEqual({maxWidth:"80%"});});});(0,_vitest.describe)("parseSizing - max height",function(){(0,_vitest.it)("should parse max-height with numeric values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("max-h-0")).toEqual({maxHeight:0});(0,_vitest.expect)((0,_sizing.parseSizing)("max-h-4")).toEqual({maxHeight:16});(0,_vitest.expect)((0,_sizing.parseSizing)("max-h-8")).toEqual({maxHeight:32});});(0,_vitest.it)("should parse max-height with percentage values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("max-h-full")).toEqual({maxHeight:"100%"});(0,_vitest.expect)((0,_sizing.parseSizing)("max-h-1/2")).toEqual({maxHeight:"50%"});});(0,_vitest.it)("should parse max-height with arbitrary values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("max-h-[300px]")).toEqual({maxHeight:300});(0,_vitest.expect)((0,_sizing.parseSizing)("max-h-[90%]")).toEqual({maxHeight:"90%"});});});(0,_vitest.describe)("parseSizing - edge cases",function(){(0,_vitest.it)("should return null for invalid classes",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("invalid")).toBeNull();(0,_vitest.expect)((0,_sizing.parseSizing)("w")).toBeNull();(0,_vitest.expect)((0,_sizing.parseSizing)("h")).toBeNull();(0,_vitest.expect)((0,_sizing.parseSizing)("width-4")).toBeNull();(0,_vitest.expect)((0,_sizing.parseSizing)("height-4")).toBeNull();});(0,_vitest.it)("should return null for invalid size values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-invalid")).toBeNull();(0,_vitest.expect)((0,_sizing.parseSizing)("h-999")).toBeNull();(0,_vitest.expect)((0,_sizing.parseSizing)("min-w-abc")).toBeNull();});(0,_vitest.it)("should return null for arbitrary values with unsupported units",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-[16rem]")).toBeNull();(0,_vitest.expect)((0,_sizing.parseSizing)("h-[2em]")).toBeNull();(0,_vitest.expect)((0,_sizing.parseSizing)("max-w-[50vh]")).toBeNull();(0,_vitest.expect)((0,_sizing.parseSizing)("min-h-[100vw]")).toBeNull();});(0,_vitest.it)("should return null for malformed arbitrary values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-[16")).toBeNull();(0,_vitest.expect)((0,_sizing.parseSizing)("h-16]")).toBeNull();(0,_vitest.expect)((0,_sizing.parseSizing)("min-w-[]")).toBeNull();});(0,_vitest.it)("should handle edge case size values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-0")).toEqual({width:0});(0,_vitest.expect)((0,_sizing.parseSizing)("h-0")).toEqual({height:0});(0,_vitest.expect)((0,_sizing.parseSizing)("min-w-0")).toEqual({minWidth:0});(0,_vitest.expect)((0,_sizing.parseSizing)("max-h-0")).toEqual({maxHeight:0});});(0,_vitest.it)("should not match partial class names",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("tw-4")).toBeNull();(0,_vitest.expect)((0,_sizing.parseSizing)("width-4")).toBeNull();(0,_vitest.expect)((0,_sizing.parseSizing)("height-4")).toBeNull();});});(0,_vitest.describe)("parseSizing - comprehensive coverage",function(){(0,_vitest.it)("should parse all width variants with same value",function(){var value=16;(0,_vitest.expect)((0,_sizing.parseSizing)("w-4")).toEqual({width:value});(0,_vitest.expect)((0,_sizing.parseSizing)("min-w-4")).toEqual({minWidth:value});(0,_vitest.expect)((0,_sizing.parseSizing)("max-w-4")).toEqual({maxWidth:value});});(0,_vitest.it)("should parse all height variants with same value",function(){var value=16;(0,_vitest.expect)((0,_sizing.parseSizing)("h-4")).toEqual({height:value});(0,_vitest.expect)((0,_sizing.parseSizing)("min-h-4")).toEqual({minHeight:value});(0,_vitest.expect)((0,_sizing.parseSizing)("max-h-4")).toEqual({maxHeight:value});});(0,_vitest.it)("should handle large size values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-96")).toEqual({width:384});(0,_vitest.expect)((0,_sizing.parseSizing)("h-96")).toEqual({height:384});(0,_vitest.expect)((0,_sizing.parseSizing)("max-w-96")).toEqual({maxWidth:384});});(0,_vitest.it)("should handle arbitrary values across all width variants",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-[123px]")).toEqual({width:123});(0,_vitest.expect)((0,_sizing.parseSizing)("min-w-[123px]")).toEqual({minWidth:123});(0,_vitest.expect)((0,_sizing.parseSizing)("max-w-[123px]")).toEqual({maxWidth:123});});(0,_vitest.it)("should handle arbitrary values across all height variants",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("h-[200px]")).toEqual({height:200});(0,_vitest.expect)((0,_sizing.parseSizing)("min-h-[200px]")).toEqual({minHeight:200});(0,_vitest.expect)((0,_sizing.parseSizing)("max-h-[200px]")).toEqual({maxHeight:200});});(0,_vitest.it)("should handle arbitrary percentage values across all variants",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-[75%]")).toEqual({width:"75%"});(0,_vitest.expect)((0,_sizing.parseSizing)("h-[60%]")).toEqual({height:"60%"});(0,_vitest.expect)((0,_sizing.parseSizing)("min-w-[25%]")).toEqual({minWidth:"25%"});(0,_vitest.expect)((0,_sizing.parseSizing)("max-h-[90%]")).toEqual({maxHeight:"90%"});});(0,_vitest.it)("should handle all fractional percentage variants",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-1/5")).toEqual({width:"20%"});(0,_vitest.expect)((0,_sizing.parseSizing)("w-2/5")).toEqual({width:"40%"});(0,_vitest.expect)((0,_sizing.parseSizing)("w-3/5")).toEqual({width:"60%"});(0,_vitest.expect)((0,_sizing.parseSizing)("w-4/5")).toEqual({width:"80%"});(0,_vitest.expect)((0,_sizing.parseSizing)("w-1/6")).toEqual({width:"16.666667%"});(0,_vitest.expect)((0,_sizing.parseSizing)("w-5/6")).toEqual({width:"83.333333%"});});(0,_vitest.it)("should handle special values consistently",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-auto")).toEqual({width:"auto"});(0,_vitest.expect)((0,_sizing.parseSizing)("h-auto")).toEqual({height:"auto"});(0,_vitest.expect)((0,_sizing.parseSizing)("w-full")).toEqual({width:"100%"});(0,_vitest.expect)((0,_sizing.parseSizing)("h-full")).toEqual({height:"100%"});});});(0,_vitest.describe)("parseSizing - custom spacing",function(){var customSpacing={xs:4,sm:8,md:16,lg:32,xl:64,"4":20};(0,_vitest.it)("should support custom spacing values for width",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-xs",customSpacing)).toEqual({width:4});(0,_vitest.expect)((0,_sizing.parseSizing)("w-sm",customSpacing)).toEqual({width:8});(0,_vitest.expect)((0,_sizing.parseSizing)("w-lg",customSpacing)).toEqual({width:32});(0,_vitest.expect)((0,_sizing.parseSizing)("w-xl",customSpacing)).toEqual({width:64});});(0,_vitest.it)("should support custom spacing values for height",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("h-xs",customSpacing)).toEqual({height:4});(0,_vitest.expect)((0,_sizing.parseSizing)("h-md",customSpacing)).toEqual({height:16});(0,_vitest.expect)((0,_sizing.parseSizing)("h-xl",customSpacing)).toEqual({height:64});});(0,_vitest.it)("should support custom spacing values for min/max dimensions",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("min-w-sm",customSpacing)).toEqual({minWidth:8});(0,_vitest.expect)((0,_sizing.parseSizing)("min-h-lg",customSpacing)).toEqual({minHeight:32});(0,_vitest.expect)((0,_sizing.parseSizing)("max-w-xl",customSpacing)).toEqual({maxWidth:64});(0,_vitest.expect)((0,_sizing.parseSizing)("max-h-md",customSpacing)).toEqual({maxHeight:16});});(0,_vitest.it)("should allow custom spacing to override preset values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-4",customSpacing)).toEqual({width:20});(0,_vitest.expect)((0,_sizing.parseSizing)("h-4",customSpacing)).toEqual({height:20});});(0,_vitest.it)("should prefer arbitrary values over custom spacing",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-[24px]",customSpacing)).toEqual({width:24});(0,_vitest.expect)((0,_sizing.parseSizing)("h-[50]",customSpacing)).toEqual({height:50});});(0,_vitest.it)("should fall back to preset scale for unknown custom keys",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-8",customSpacing)).toEqual({width:32});(0,_vitest.expect)((0,_sizing.parseSizing)("h-12",customSpacing)).toEqual({height:48});});(0,_vitest.it)("should preserve percentage values with custom spacing",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-full",customSpacing)).toEqual({width:"100%"});(0,_vitest.expect)((0,_sizing.parseSizing)("h-1/2",customSpacing)).toEqual({height:"50%"});});(0,_vitest.it)("should work without custom spacing (backward compatible)",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-4")).toEqual({width:16});(0,_vitest.expect)((0,_sizing.parseSizing)("h-8")).toEqual({height:32});});});
@@ -6,5 +6,7 @@ export declare const SPACING_SCALE: Record<string, number>;
6
6
  /**
7
7
  * Parse spacing classes (margin, padding, gap)
8
8
  * Examples: m-4, mx-2, mt-8, p-4, px-2, pt-8, gap-4, m-[16px], pl-[4.5px], -m-4, -mt-[10px], ms-4, pe-2
9
+ * @param cls - The class name to parse
10
+ * @param customSpacing - Optional custom spacing values from tailwind.config
9
11
  */
10
- export declare function parseSpacing(cls: string): StyleObject | null;
12
+ export declare function parseSpacing(cls: string, customSpacing?: Record<string, number>): StyleObject | null;
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.SPACING_SCALE=void 0;exports.parseSpacing=parseSpacing;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var SPACING_SCALE=exports.SPACING_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};function parseArbitrarySpacing(value){var pxMatch=value.match(/^\[(-?\d+(?:\.\d+)?)(?:px)?\]$/);if(pxMatch){return parseFloat(pxMatch[1]);}if(value.startsWith("[")&&value.endsWith("]")){if(process.env.NODE_ENV!=="production"){console.warn(`[react-native-tailwind] Unsupported arbitrary spacing value: ${value}. Only px values are supported (e.g., [16px], [16], [4.5px], [4.5]).`);}return null;}return null;}function parseSpacing(cls){var marginMatch=cls.match(/^(-?)m([xytrblse]?)-(.+)$/);if(marginMatch){var _marginMatch=(0,_slicedToArray2.default)(marginMatch,4),negativePrefix=_marginMatch[1],dir=_marginMatch[2],valueStr=_marginMatch[3];var isNegative=negativePrefix==="-";var arbitraryValue=parseArbitrarySpacing(valueStr);if(arbitraryValue!==null){var finalValue=isNegative?-arbitraryValue:arbitraryValue;return getMarginStyle(dir,finalValue);}var scaleValue=SPACING_SCALE[valueStr];if(scaleValue!==undefined){var _finalValue=isNegative?-scaleValue:scaleValue;return getMarginStyle(dir,_finalValue);}}var paddingMatch=cls.match(/^p([xytrblse]?)-(.+)$/);if(paddingMatch){var _paddingMatch=(0,_slicedToArray2.default)(paddingMatch,3),_dir=_paddingMatch[1],_valueStr=_paddingMatch[2];var _arbitraryValue=parseArbitrarySpacing(_valueStr);if(_arbitraryValue!==null){return getPaddingStyle(_dir,_arbitraryValue);}var _scaleValue=SPACING_SCALE[_valueStr];if(_scaleValue!==undefined){return getPaddingStyle(_dir,_scaleValue);}}var gapMatch=cls.match(/^gap-(.+)$/);if(gapMatch){var _valueStr2=gapMatch[1];var _arbitraryValue2=parseArbitrarySpacing(_valueStr2);if(_arbitraryValue2!==null){return{gap:_arbitraryValue2};}var _scaleValue2=SPACING_SCALE[_valueStr2];if(_scaleValue2!==undefined){return{gap:_scaleValue2};}}return null;}function getMarginStyle(dir,value){switch(dir){case"":return{margin:value};case"x":return{marginHorizontal:value};case"y":return{marginVertical:value};case"t":return{marginTop:value};case"r":return{marginRight:value};case"b":return{marginBottom:value};case"l":return{marginLeft:value};case"s":return{marginStart:value};case"e":return{marginEnd:value};default:return{};}}function getPaddingStyle(dir,value){switch(dir){case"":return{padding:value};case"x":return{paddingHorizontal:value};case"y":return{paddingVertical:value};case"t":return{paddingTop:value};case"r":return{paddingRight:value};case"b":return{paddingBottom:value};case"l":return{paddingLeft:value};case"s":return{paddingStart:value};case"e":return{paddingEnd:value};default:return{};}}
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.SPACING_SCALE=void 0;exports.parseSpacing=parseSpacing;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var SPACING_SCALE=exports.SPACING_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};function parseArbitrarySpacing(value){var pxMatch=value.match(/^\[(-?\d+(?:\.\d+)?)(?:px)?\]$/);if(pxMatch){return parseFloat(pxMatch[1]);}if(value.startsWith("[")&&value.endsWith("]")){if(process.env.NODE_ENV!=="production"){console.warn(`[react-native-tailwind] Unsupported arbitrary spacing value: ${value}. Only px values are supported (e.g., [16px], [16], [4.5px], [4.5]).`);}return null;}return null;}function parseSpacing(cls,customSpacing){var spacingMap=customSpacing?Object.assign({},SPACING_SCALE,customSpacing):SPACING_SCALE;var marginMatch=cls.match(/^(-?)m([xytrblse]?)-(.+)$/);if(marginMatch){var _marginMatch=(0,_slicedToArray2.default)(marginMatch,4),negativePrefix=_marginMatch[1],dir=_marginMatch[2],valueStr=_marginMatch[3];var isNegative=negativePrefix==="-";var arbitraryValue=parseArbitrarySpacing(valueStr);if(arbitraryValue!==null){var finalValue=isNegative?-arbitraryValue:arbitraryValue;return getMarginStyle(dir,finalValue);}var scaleValue=spacingMap[valueStr];if(scaleValue!==undefined){var _finalValue=isNegative?-scaleValue:scaleValue;return getMarginStyle(dir,_finalValue);}}var paddingMatch=cls.match(/^p([xytrblse]?)-(.+)$/);if(paddingMatch){var _paddingMatch=(0,_slicedToArray2.default)(paddingMatch,3),_dir=_paddingMatch[1],_valueStr=_paddingMatch[2];var _arbitraryValue=parseArbitrarySpacing(_valueStr);if(_arbitraryValue!==null){return getPaddingStyle(_dir,_arbitraryValue);}var _scaleValue=spacingMap[_valueStr];if(_scaleValue!==undefined){return getPaddingStyle(_dir,_scaleValue);}}var gapMatch=cls.match(/^gap-(.+)$/);if(gapMatch){var _valueStr2=gapMatch[1];var _arbitraryValue2=parseArbitrarySpacing(_valueStr2);if(_arbitraryValue2!==null){return{gap:_arbitraryValue2};}var _scaleValue2=spacingMap[_valueStr2];if(_scaleValue2!==undefined){return{gap:_scaleValue2};}}return null;}function getMarginStyle(dir,value){switch(dir){case"":return{margin:value};case"x":return{marginHorizontal:value};case"y":return{marginVertical:value};case"t":return{marginTop:value};case"r":return{marginRight:value};case"b":return{marginBottom:value};case"l":return{marginLeft:value};case"s":return{marginStart:value};case"e":return{marginEnd:value};default:return{};}}function getPaddingStyle(dir,value){switch(dir){case"":return{padding:value};case"x":return{paddingHorizontal:value};case"y":return{paddingVertical:value};case"t":return{paddingTop:value};case"r":return{paddingRight:value};case"b":return{paddingBottom:value};case"l":return{paddingLeft:value};case"s":return{paddingStart:value};case"e":return{paddingEnd:value};default:return{};}}
@@ -1 +1 @@
1
- var _vitest=require("vitest");var _spacing=require("./spacing");(0,_vitest.describe)("SPACING_SCALE",function(){(0,_vitest.it)("should export complete spacing scale",function(){(0,_vitest.expect)(_spacing.SPACING_SCALE).toMatchSnapshot();});});(0,_vitest.describe)("parseSpacing - margin",function(){(0,_vitest.it)("should parse margin all sides",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-0")).toEqual({margin:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-4")).toEqual({margin:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-8")).toEqual({margin:32});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-96")).toEqual({margin:384});});(0,_vitest.it)("should parse margin with fractional values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-0.5")).toEqual({margin:2});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-1.5")).toEqual({margin:6});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-2.5")).toEqual({margin:10});});(0,_vitest.it)("should parse margin horizontal",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("mx-0")).toEqual({marginHorizontal:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("mx-4")).toEqual({marginHorizontal:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("mx-8")).toEqual({marginHorizontal:32});});(0,_vitest.it)("should parse margin vertical",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("my-0")).toEqual({marginVertical:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("my-4")).toEqual({marginVertical:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("my-8")).toEqual({marginVertical:32});});(0,_vitest.it)("should parse margin directional",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("mt-4")).toEqual({marginTop:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("mr-4")).toEqual({marginRight:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("mb-4")).toEqual({marginBottom:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("ml-4")).toEqual({marginLeft:16});});(0,_vitest.it)("should parse margin with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[16px]")).toEqual({margin:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[16]")).toEqual({margin:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[100px]")).toEqual({margin:100});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[100]")).toEqual({margin:100});});(0,_vitest.it)("should parse margin directional with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("mt-[24px]")).toEqual({marginTop:24});(0,_vitest.expect)((0,_spacing.parseSpacing)("mr-[32]")).toEqual({marginRight:32});(0,_vitest.expect)((0,_spacing.parseSpacing)("mb-[16px]")).toEqual({marginBottom:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("ml-[48]")).toEqual({marginLeft:48});});(0,_vitest.it)("should parse margin horizontal/vertical with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("mx-[20px]")).toEqual({marginHorizontal:20});(0,_vitest.expect)((0,_spacing.parseSpacing)("my-[30]")).toEqual({marginVertical:30});});});(0,_vitest.describe)("parseSpacing - negative margin",function(){(0,_vitest.it)("should parse negative margin all sides",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-0")).toEqual({margin:-0});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-4")).toEqual({margin:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-8")).toEqual({margin:-32});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-96")).toEqual({margin:-384});});(0,_vitest.it)("should parse negative margin with fractional values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-0.5")).toEqual({margin:-2});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-1.5")).toEqual({margin:-6});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-2.5")).toEqual({margin:-10});});(0,_vitest.it)("should parse negative margin horizontal",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-mx-4")).toEqual({marginHorizontal:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-mx-8")).toEqual({marginHorizontal:-32});});(0,_vitest.it)("should parse negative margin vertical",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-my-4")).toEqual({marginVertical:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-my-8")).toEqual({marginVertical:-32});});(0,_vitest.it)("should parse negative margin directional",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-mt-4")).toEqual({marginTop:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-mr-4")).toEqual({marginRight:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-mb-4")).toEqual({marginBottom:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-ml-4")).toEqual({marginLeft:-16});});(0,_vitest.it)("should parse negative margin with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-[16px]")).toEqual({margin:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-[16]")).toEqual({margin:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-[100px]")).toEqual({margin:-100});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-[100]")).toEqual({margin:-100});});(0,_vitest.it)("should parse negative margin directional with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-mt-[24px]")).toEqual({marginTop:-24});(0,_vitest.expect)((0,_spacing.parseSpacing)("-mr-[32]")).toEqual({marginRight:-32});(0,_vitest.expect)((0,_spacing.parseSpacing)("-mb-[16px]")).toEqual({marginBottom:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-ml-[48]")).toEqual({marginLeft:-48});});(0,_vitest.it)("should parse negative margin horizontal/vertical with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-mx-[20px]")).toEqual({marginHorizontal:-20});(0,_vitest.expect)((0,_spacing.parseSpacing)("-my-[30]")).toEqual({marginVertical:-30});});(0,_vitest.it)("should not parse negative padding (invalid)",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-p-4")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("-px-4")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("-pt-4")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("-p-[16px]")).toBeNull();});(0,_vitest.it)("should not parse negative gap (invalid)",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-gap-4")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("-gap-[16px]")).toBeNull();});});(0,_vitest.describe)("parseSpacing - padding",function(){(0,_vitest.it)("should parse padding all sides",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("p-0")).toEqual({padding:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-4")).toEqual({padding:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-8")).toEqual({padding:32});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-96")).toEqual({padding:384});});(0,_vitest.it)("should parse padding with fractional values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("p-0.5")).toEqual({padding:2});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-1.5")).toEqual({padding:6});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-2.5")).toEqual({padding:10});});(0,_vitest.it)("should parse padding horizontal",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("px-0")).toEqual({paddingHorizontal:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("px-4")).toEqual({paddingHorizontal:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("px-8")).toEqual({paddingHorizontal:32});});(0,_vitest.it)("should parse padding vertical",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("py-0")).toEqual({paddingVertical:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("py-4")).toEqual({paddingVertical:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("py-8")).toEqual({paddingVertical:32});});(0,_vitest.it)("should parse padding directional",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("pt-4")).toEqual({paddingTop:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("pr-4")).toEqual({paddingRight:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("pb-4")).toEqual({paddingBottom:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("pl-4")).toEqual({paddingLeft:16});});(0,_vitest.it)("should parse padding with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("p-[16px]")).toEqual({padding:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-[16]")).toEqual({padding:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-[100px]")).toEqual({padding:100});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-[100]")).toEqual({padding:100});});(0,_vitest.it)("should parse padding directional with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("pt-[24px]")).toEqual({paddingTop:24});(0,_vitest.expect)((0,_spacing.parseSpacing)("pr-[32]")).toEqual({paddingRight:32});(0,_vitest.expect)((0,_spacing.parseSpacing)("pb-[16px]")).toEqual({paddingBottom:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("pl-[48]")).toEqual({paddingLeft:48});});(0,_vitest.it)("should parse padding horizontal/vertical with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("px-[20px]")).toEqual({paddingHorizontal:20});(0,_vitest.expect)((0,_spacing.parseSpacing)("py-[30]")).toEqual({paddingVertical:30});});});(0,_vitest.describe)("parseSpacing - gap",function(){(0,_vitest.it)("should parse gap",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-0")).toEqual({gap:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-4")).toEqual({gap:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-8")).toEqual({gap:32});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-96")).toEqual({gap:384});});(0,_vitest.it)("should parse gap with fractional values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-0.5")).toEqual({gap:2});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-1.5")).toEqual({gap:6});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-2.5")).toEqual({gap:10});});(0,_vitest.it)("should parse gap with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[16px]")).toEqual({gap:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[16]")).toEqual({gap:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[100px]")).toEqual({gap:100});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[100]")).toEqual({gap:100});});});(0,_vitest.describe)("parseSpacing - edge cases",function(){(0,_vitest.it)("should return null for invalid classes",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("invalid")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("m")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("p")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("margin-4")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("padding-4")).toBeNull();});(0,_vitest.it)("should return null for invalid spacing values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-invalid")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("p-999")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-abc")).toBeNull();});(0,_vitest.it)("should return null for arbitrary values with unsupported units",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[16rem]")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("p-[2em]")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[50%]")).toBeNull();});(0,_vitest.it)("should return null for malformed arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[16")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("p-16]")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[]")).toBeNull();});(0,_vitest.it)("should handle edge case spacing values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-0")).toEqual({margin:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-0")).toEqual({padding:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-0")).toEqual({gap:0});});(0,_vitest.it)("should not match partial class names",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("sm-4")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("margin-4")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("padding-4")).toBeNull();});});(0,_vitest.describe)("parseSpacing - decimal arbitrary values",function(){(0,_vitest.it)("should parse margin with decimal arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[4.5px]")).toEqual({margin:4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[4.5]")).toEqual({margin:4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[16.75px]")).toEqual({margin:16.75});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[16.75]")).toEqual({margin:16.75});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[100.25px]")).toEqual({margin:100.25});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[0.5]")).toEqual({margin:0.5});});(0,_vitest.it)("should parse padding with decimal arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("p-[4.5px]")).toEqual({padding:4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-[4.5]")).toEqual({padding:4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("pl-[4.5px]")).toEqual({paddingLeft:4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("pl-[4.5]")).toEqual({paddingLeft:4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("pr-[16.75px]")).toEqual({paddingRight:16.75});(0,_vitest.expect)((0,_spacing.parseSpacing)("pt-[10.5]")).toEqual({paddingTop:10.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("pb-[20.25px]")).toEqual({paddingBottom:20.25});});(0,_vitest.it)("should parse padding horizontal/vertical with decimal arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("px-[4.5px]")).toEqual({paddingHorizontal:4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("py-[10.75]")).toEqual({paddingVertical:10.75});});(0,_vitest.it)("should parse gap with decimal arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[4.5px]")).toEqual({gap:4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[4.5]")).toEqual({gap:4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[16.75px]")).toEqual({gap:16.75});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[0.5]")).toEqual({gap:0.5});});(0,_vitest.it)("should parse negative margin with decimal arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-[4.5px]")).toEqual({margin:-4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-[4.5]")).toEqual({margin:-4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-[10.5px]")).toEqual({margin:-10.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("-mt-[16.75px]")).toEqual({marginTop:-16.75});(0,_vitest.expect)((0,_spacing.parseSpacing)("-ml-[8.25]")).toEqual({marginLeft:-8.25});(0,_vitest.expect)((0,_spacing.parseSpacing)("-mx-[12.5px]")).toEqual({marginHorizontal:-12.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("-my-[20.75]")).toEqual({marginVertical:-20.75});});(0,_vitest.it)("should parse margin directional with decimal arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("mt-[4.5px]")).toEqual({marginTop:4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("mr-[8.25]")).toEqual({marginRight:8.25});(0,_vitest.expect)((0,_spacing.parseSpacing)("mb-[16.75px]")).toEqual({marginBottom:16.75});(0,_vitest.expect)((0,_spacing.parseSpacing)("ml-[12.5]")).toEqual({marginLeft:12.5});});(0,_vitest.it)("should parse margin horizontal/vertical with decimal arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("mx-[4.5px]")).toEqual({marginHorizontal:4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("my-[10.75]")).toEqual({marginVertical:10.75});});(0,_vitest.it)("should handle edge case decimal values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[0.1px]")).toEqual({margin:0.1});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-[0.001]")).toEqual({padding:0.001});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[999.999px]")).toEqual({gap:999.999});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-[0.5]")).toEqual({margin:-0.5});});});(0,_vitest.describe)("parseSpacing - comprehensive coverage",function(){(0,_vitest.it)("should parse all margin directions with same value",function(){var value=16;(0,_vitest.expect)((0,_spacing.parseSpacing)("m-4")).toEqual({margin:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("mx-4")).toEqual({marginHorizontal:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("my-4")).toEqual({marginVertical:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("mt-4")).toEqual({marginTop:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("mr-4")).toEqual({marginRight:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("mb-4")).toEqual({marginBottom:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("ml-4")).toEqual({marginLeft:value});});(0,_vitest.it)("should parse all padding directions with same value",function(){var value=16;(0,_vitest.expect)((0,_spacing.parseSpacing)("p-4")).toEqual({padding:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("px-4")).toEqual({paddingHorizontal:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("py-4")).toEqual({paddingVertical:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("pt-4")).toEqual({paddingTop:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("pr-4")).toEqual({paddingRight:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("pb-4")).toEqual({paddingBottom:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("pl-4")).toEqual({paddingLeft:value});});(0,_vitest.it)("should handle large spacing values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-96")).toEqual({margin:384});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-96")).toEqual({padding:384});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-96")).toEqual({gap:384});});(0,_vitest.it)("should handle arbitrary values across all margin directions",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[50px]")).toEqual({margin:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("mx-[50px]")).toEqual({marginHorizontal:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("my-[50px]")).toEqual({marginVertical:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("mt-[50px]")).toEqual({marginTop:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("mr-[50px]")).toEqual({marginRight:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("mb-[50px]")).toEqual({marginBottom:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("ml-[50px]")).toEqual({marginLeft:50});});(0,_vitest.it)("should handle arbitrary values across all padding directions",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("p-[50px]")).toEqual({padding:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("px-[50px]")).toEqual({paddingHorizontal:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("py-[50px]")).toEqual({paddingVertical:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("pt-[50px]")).toEqual({paddingTop:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("pr-[50px]")).toEqual({paddingRight:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("pb-[50px]")).toEqual({paddingBottom:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("pl-[50px]")).toEqual({paddingLeft:50});});});(0,_vitest.describe)("parseSpacing - logical margin (RTL-aware)",function(){(0,_vitest.it)("should parse margin start",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("ms-0")).toEqual({marginStart:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("ms-4")).toEqual({marginStart:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("ms-8")).toEqual({marginStart:32});});(0,_vitest.it)("should parse margin end",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("me-0")).toEqual({marginEnd:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("me-4")).toEqual({marginEnd:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("me-8")).toEqual({marginEnd:32});});(0,_vitest.it)("should parse margin start/end with fractional values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("ms-0.5")).toEqual({marginStart:2});(0,_vitest.expect)((0,_spacing.parseSpacing)("me-1.5")).toEqual({marginEnd:6});(0,_vitest.expect)((0,_spacing.parseSpacing)("ms-2.5")).toEqual({marginStart:10});});(0,_vitest.it)("should parse margin start/end with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("ms-[16px]")).toEqual({marginStart:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("ms-[16]")).toEqual({marginStart:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("me-[24px]")).toEqual({marginEnd:24});(0,_vitest.expect)((0,_spacing.parseSpacing)("me-[24]")).toEqual({marginEnd:24});});(0,_vitest.it)("should parse negative margin start/end",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-ms-4")).toEqual({marginStart:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-me-4")).toEqual({marginEnd:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-ms-8")).toEqual({marginStart:-32});(0,_vitest.expect)((0,_spacing.parseSpacing)("-me-8")).toEqual({marginEnd:-32});});(0,_vitest.it)("should parse negative margin start/end with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-ms-[16px]")).toEqual({marginStart:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-me-[24]")).toEqual({marginEnd:-24});});});(0,_vitest.describe)("parseSpacing - logical padding (RTL-aware)",function(){(0,_vitest.it)("should parse padding start",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("ps-0")).toEqual({paddingStart:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("ps-4")).toEqual({paddingStart:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("ps-8")).toEqual({paddingStart:32});});(0,_vitest.it)("should parse padding end",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("pe-0")).toEqual({paddingEnd:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("pe-4")).toEqual({paddingEnd:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("pe-8")).toEqual({paddingEnd:32});});(0,_vitest.it)("should parse padding start/end with fractional values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("ps-0.5")).toEqual({paddingStart:2});(0,_vitest.expect)((0,_spacing.parseSpacing)("pe-1.5")).toEqual({paddingEnd:6});(0,_vitest.expect)((0,_spacing.parseSpacing)("ps-2.5")).toEqual({paddingStart:10});});(0,_vitest.it)("should parse padding start/end with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("ps-[16px]")).toEqual({paddingStart:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("ps-[16]")).toEqual({paddingStart:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("pe-[24px]")).toEqual({paddingEnd:24});(0,_vitest.expect)((0,_spacing.parseSpacing)("pe-[24]")).toEqual({paddingEnd:24});});});
1
+ var _vitest=require("vitest");var _spacing=require("./spacing");(0,_vitest.describe)("SPACING_SCALE",function(){(0,_vitest.it)("should export complete spacing scale",function(){(0,_vitest.expect)(_spacing.SPACING_SCALE).toMatchSnapshot();});});(0,_vitest.describe)("parseSpacing - margin",function(){(0,_vitest.it)("should parse margin all sides",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-0")).toEqual({margin:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-4")).toEqual({margin:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-8")).toEqual({margin:32});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-96")).toEqual({margin:384});});(0,_vitest.it)("should parse margin with fractional values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-0.5")).toEqual({margin:2});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-1.5")).toEqual({margin:6});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-2.5")).toEqual({margin:10});});(0,_vitest.it)("should parse margin horizontal",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("mx-0")).toEqual({marginHorizontal:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("mx-4")).toEqual({marginHorizontal:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("mx-8")).toEqual({marginHorizontal:32});});(0,_vitest.it)("should parse margin vertical",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("my-0")).toEqual({marginVertical:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("my-4")).toEqual({marginVertical:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("my-8")).toEqual({marginVertical:32});});(0,_vitest.it)("should parse margin directional",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("mt-4")).toEqual({marginTop:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("mr-4")).toEqual({marginRight:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("mb-4")).toEqual({marginBottom:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("ml-4")).toEqual({marginLeft:16});});(0,_vitest.it)("should parse margin with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[16px]")).toEqual({margin:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[16]")).toEqual({margin:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[100px]")).toEqual({margin:100});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[100]")).toEqual({margin:100});});(0,_vitest.it)("should parse margin directional with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("mt-[24px]")).toEqual({marginTop:24});(0,_vitest.expect)((0,_spacing.parseSpacing)("mr-[32]")).toEqual({marginRight:32});(0,_vitest.expect)((0,_spacing.parseSpacing)("mb-[16px]")).toEqual({marginBottom:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("ml-[48]")).toEqual({marginLeft:48});});(0,_vitest.it)("should parse margin horizontal/vertical with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("mx-[20px]")).toEqual({marginHorizontal:20});(0,_vitest.expect)((0,_spacing.parseSpacing)("my-[30]")).toEqual({marginVertical:30});});});(0,_vitest.describe)("parseSpacing - negative margin",function(){(0,_vitest.it)("should parse negative margin all sides",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-0")).toEqual({margin:-0});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-4")).toEqual({margin:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-8")).toEqual({margin:-32});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-96")).toEqual({margin:-384});});(0,_vitest.it)("should parse negative margin with fractional values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-0.5")).toEqual({margin:-2});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-1.5")).toEqual({margin:-6});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-2.5")).toEqual({margin:-10});});(0,_vitest.it)("should parse negative margin horizontal",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-mx-4")).toEqual({marginHorizontal:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-mx-8")).toEqual({marginHorizontal:-32});});(0,_vitest.it)("should parse negative margin vertical",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-my-4")).toEqual({marginVertical:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-my-8")).toEqual({marginVertical:-32});});(0,_vitest.it)("should parse negative margin directional",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-mt-4")).toEqual({marginTop:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-mr-4")).toEqual({marginRight:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-mb-4")).toEqual({marginBottom:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-ml-4")).toEqual({marginLeft:-16});});(0,_vitest.it)("should parse negative margin with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-[16px]")).toEqual({margin:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-[16]")).toEqual({margin:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-[100px]")).toEqual({margin:-100});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-[100]")).toEqual({margin:-100});});(0,_vitest.it)("should parse negative margin directional with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-mt-[24px]")).toEqual({marginTop:-24});(0,_vitest.expect)((0,_spacing.parseSpacing)("-mr-[32]")).toEqual({marginRight:-32});(0,_vitest.expect)((0,_spacing.parseSpacing)("-mb-[16px]")).toEqual({marginBottom:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-ml-[48]")).toEqual({marginLeft:-48});});(0,_vitest.it)("should parse negative margin horizontal/vertical with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-mx-[20px]")).toEqual({marginHorizontal:-20});(0,_vitest.expect)((0,_spacing.parseSpacing)("-my-[30]")).toEqual({marginVertical:-30});});(0,_vitest.it)("should not parse negative padding (invalid)",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-p-4")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("-px-4")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("-pt-4")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("-p-[16px]")).toBeNull();});(0,_vitest.it)("should not parse negative gap (invalid)",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-gap-4")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("-gap-[16px]")).toBeNull();});});(0,_vitest.describe)("parseSpacing - padding",function(){(0,_vitest.it)("should parse padding all sides",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("p-0")).toEqual({padding:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-4")).toEqual({padding:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-8")).toEqual({padding:32});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-96")).toEqual({padding:384});});(0,_vitest.it)("should parse padding with fractional values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("p-0.5")).toEqual({padding:2});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-1.5")).toEqual({padding:6});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-2.5")).toEqual({padding:10});});(0,_vitest.it)("should parse padding horizontal",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("px-0")).toEqual({paddingHorizontal:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("px-4")).toEqual({paddingHorizontal:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("px-8")).toEqual({paddingHorizontal:32});});(0,_vitest.it)("should parse padding vertical",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("py-0")).toEqual({paddingVertical:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("py-4")).toEqual({paddingVertical:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("py-8")).toEqual({paddingVertical:32});});(0,_vitest.it)("should parse padding directional",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("pt-4")).toEqual({paddingTop:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("pr-4")).toEqual({paddingRight:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("pb-4")).toEqual({paddingBottom:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("pl-4")).toEqual({paddingLeft:16});});(0,_vitest.it)("should parse padding with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("p-[16px]")).toEqual({padding:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-[16]")).toEqual({padding:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-[100px]")).toEqual({padding:100});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-[100]")).toEqual({padding:100});});(0,_vitest.it)("should parse padding directional with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("pt-[24px]")).toEqual({paddingTop:24});(0,_vitest.expect)((0,_spacing.parseSpacing)("pr-[32]")).toEqual({paddingRight:32});(0,_vitest.expect)((0,_spacing.parseSpacing)("pb-[16px]")).toEqual({paddingBottom:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("pl-[48]")).toEqual({paddingLeft:48});});(0,_vitest.it)("should parse padding horizontal/vertical with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("px-[20px]")).toEqual({paddingHorizontal:20});(0,_vitest.expect)((0,_spacing.parseSpacing)("py-[30]")).toEqual({paddingVertical:30});});});(0,_vitest.describe)("parseSpacing - gap",function(){(0,_vitest.it)("should parse gap",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-0")).toEqual({gap:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-4")).toEqual({gap:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-8")).toEqual({gap:32});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-96")).toEqual({gap:384});});(0,_vitest.it)("should parse gap with fractional values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-0.5")).toEqual({gap:2});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-1.5")).toEqual({gap:6});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-2.5")).toEqual({gap:10});});(0,_vitest.it)("should parse gap with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[16px]")).toEqual({gap:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[16]")).toEqual({gap:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[100px]")).toEqual({gap:100});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[100]")).toEqual({gap:100});});});(0,_vitest.describe)("parseSpacing - edge cases",function(){(0,_vitest.it)("should return null for invalid classes",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("invalid")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("m")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("p")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("margin-4")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("padding-4")).toBeNull();});(0,_vitest.it)("should return null for invalid spacing values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-invalid")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("p-999")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-abc")).toBeNull();});(0,_vitest.it)("should return null for arbitrary values with unsupported units",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[16rem]")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("p-[2em]")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[50%]")).toBeNull();});(0,_vitest.it)("should return null for malformed arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[16")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("p-16]")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[]")).toBeNull();});(0,_vitest.it)("should handle edge case spacing values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-0")).toEqual({margin:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-0")).toEqual({padding:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-0")).toEqual({gap:0});});(0,_vitest.it)("should not match partial class names",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("sm-4")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("margin-4")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("padding-4")).toBeNull();});});(0,_vitest.describe)("parseSpacing - decimal arbitrary values",function(){(0,_vitest.it)("should parse margin with decimal arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[4.5px]")).toEqual({margin:4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[4.5]")).toEqual({margin:4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[16.75px]")).toEqual({margin:16.75});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[16.75]")).toEqual({margin:16.75});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[100.25px]")).toEqual({margin:100.25});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[0.5]")).toEqual({margin:0.5});});(0,_vitest.it)("should parse padding with decimal arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("p-[4.5px]")).toEqual({padding:4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-[4.5]")).toEqual({padding:4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("pl-[4.5px]")).toEqual({paddingLeft:4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("pl-[4.5]")).toEqual({paddingLeft:4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("pr-[16.75px]")).toEqual({paddingRight:16.75});(0,_vitest.expect)((0,_spacing.parseSpacing)("pt-[10.5]")).toEqual({paddingTop:10.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("pb-[20.25px]")).toEqual({paddingBottom:20.25});});(0,_vitest.it)("should parse padding horizontal/vertical with decimal arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("px-[4.5px]")).toEqual({paddingHorizontal:4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("py-[10.75]")).toEqual({paddingVertical:10.75});});(0,_vitest.it)("should parse gap with decimal arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[4.5px]")).toEqual({gap:4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[4.5]")).toEqual({gap:4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[16.75px]")).toEqual({gap:16.75});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[0.5]")).toEqual({gap:0.5});});(0,_vitest.it)("should parse negative margin with decimal arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-[4.5px]")).toEqual({margin:-4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-[4.5]")).toEqual({margin:-4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-[10.5px]")).toEqual({margin:-10.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("-mt-[16.75px]")).toEqual({marginTop:-16.75});(0,_vitest.expect)((0,_spacing.parseSpacing)("-ml-[8.25]")).toEqual({marginLeft:-8.25});(0,_vitest.expect)((0,_spacing.parseSpacing)("-mx-[12.5px]")).toEqual({marginHorizontal:-12.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("-my-[20.75]")).toEqual({marginVertical:-20.75});});(0,_vitest.it)("should parse margin directional with decimal arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("mt-[4.5px]")).toEqual({marginTop:4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("mr-[8.25]")).toEqual({marginRight:8.25});(0,_vitest.expect)((0,_spacing.parseSpacing)("mb-[16.75px]")).toEqual({marginBottom:16.75});(0,_vitest.expect)((0,_spacing.parseSpacing)("ml-[12.5]")).toEqual({marginLeft:12.5});});(0,_vitest.it)("should parse margin horizontal/vertical with decimal arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("mx-[4.5px]")).toEqual({marginHorizontal:4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("my-[10.75]")).toEqual({marginVertical:10.75});});(0,_vitest.it)("should handle edge case decimal values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[0.1px]")).toEqual({margin:0.1});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-[0.001]")).toEqual({padding:0.001});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[999.999px]")).toEqual({gap:999.999});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-[0.5]")).toEqual({margin:-0.5});});});(0,_vitest.describe)("parseSpacing - comprehensive coverage",function(){(0,_vitest.it)("should parse all margin directions with same value",function(){var value=16;(0,_vitest.expect)((0,_spacing.parseSpacing)("m-4")).toEqual({margin:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("mx-4")).toEqual({marginHorizontal:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("my-4")).toEqual({marginVertical:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("mt-4")).toEqual({marginTop:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("mr-4")).toEqual({marginRight:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("mb-4")).toEqual({marginBottom:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("ml-4")).toEqual({marginLeft:value});});(0,_vitest.it)("should parse all padding directions with same value",function(){var value=16;(0,_vitest.expect)((0,_spacing.parseSpacing)("p-4")).toEqual({padding:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("px-4")).toEqual({paddingHorizontal:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("py-4")).toEqual({paddingVertical:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("pt-4")).toEqual({paddingTop:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("pr-4")).toEqual({paddingRight:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("pb-4")).toEqual({paddingBottom:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("pl-4")).toEqual({paddingLeft:value});});(0,_vitest.it)("should handle large spacing values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-96")).toEqual({margin:384});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-96")).toEqual({padding:384});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-96")).toEqual({gap:384});});(0,_vitest.it)("should handle arbitrary values across all margin directions",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[50px]")).toEqual({margin:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("mx-[50px]")).toEqual({marginHorizontal:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("my-[50px]")).toEqual({marginVertical:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("mt-[50px]")).toEqual({marginTop:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("mr-[50px]")).toEqual({marginRight:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("mb-[50px]")).toEqual({marginBottom:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("ml-[50px]")).toEqual({marginLeft:50});});(0,_vitest.it)("should handle arbitrary values across all padding directions",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("p-[50px]")).toEqual({padding:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("px-[50px]")).toEqual({paddingHorizontal:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("py-[50px]")).toEqual({paddingVertical:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("pt-[50px]")).toEqual({paddingTop:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("pr-[50px]")).toEqual({paddingRight:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("pb-[50px]")).toEqual({paddingBottom:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("pl-[50px]")).toEqual({paddingLeft:50});});});(0,_vitest.describe)("parseSpacing - logical margin (RTL-aware)",function(){(0,_vitest.it)("should parse margin start",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("ms-0")).toEqual({marginStart:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("ms-4")).toEqual({marginStart:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("ms-8")).toEqual({marginStart:32});});(0,_vitest.it)("should parse margin end",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("me-0")).toEqual({marginEnd:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("me-4")).toEqual({marginEnd:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("me-8")).toEqual({marginEnd:32});});(0,_vitest.it)("should parse margin start/end with fractional values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("ms-0.5")).toEqual({marginStart:2});(0,_vitest.expect)((0,_spacing.parseSpacing)("me-1.5")).toEqual({marginEnd:6});(0,_vitest.expect)((0,_spacing.parseSpacing)("ms-2.5")).toEqual({marginStart:10});});(0,_vitest.it)("should parse margin start/end with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("ms-[16px]")).toEqual({marginStart:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("ms-[16]")).toEqual({marginStart:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("me-[24px]")).toEqual({marginEnd:24});(0,_vitest.expect)((0,_spacing.parseSpacing)("me-[24]")).toEqual({marginEnd:24});});(0,_vitest.it)("should parse negative margin start/end",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-ms-4")).toEqual({marginStart:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-me-4")).toEqual({marginEnd:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-ms-8")).toEqual({marginStart:-32});(0,_vitest.expect)((0,_spacing.parseSpacing)("-me-8")).toEqual({marginEnd:-32});});(0,_vitest.it)("should parse negative margin start/end with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-ms-[16px]")).toEqual({marginStart:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-me-[24]")).toEqual({marginEnd:-24});});});(0,_vitest.describe)("parseSpacing - logical padding (RTL-aware)",function(){(0,_vitest.it)("should parse padding start",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("ps-0")).toEqual({paddingStart:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("ps-4")).toEqual({paddingStart:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("ps-8")).toEqual({paddingStart:32});});(0,_vitest.it)("should parse padding end",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("pe-0")).toEqual({paddingEnd:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("pe-4")).toEqual({paddingEnd:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("pe-8")).toEqual({paddingEnd:32});});(0,_vitest.it)("should parse padding start/end with fractional values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("ps-0.5")).toEqual({paddingStart:2});(0,_vitest.expect)((0,_spacing.parseSpacing)("pe-1.5")).toEqual({paddingEnd:6});(0,_vitest.expect)((0,_spacing.parseSpacing)("ps-2.5")).toEqual({paddingStart:10});});(0,_vitest.it)("should parse padding start/end with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("ps-[16px]")).toEqual({paddingStart:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("ps-[16]")).toEqual({paddingStart:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("pe-[24px]")).toEqual({paddingEnd:24});(0,_vitest.expect)((0,_spacing.parseSpacing)("pe-[24]")).toEqual({paddingEnd:24});});});(0,_vitest.describe)("parseSpacing - custom spacing",function(){var customSpacing={xs:4,sm:8,md:16,lg:32,xl:64,"4":20};(0,_vitest.it)("should support custom spacing values for margin",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-xs",customSpacing)).toEqual({margin:4});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-sm",customSpacing)).toEqual({margin:8});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-lg",customSpacing)).toEqual({margin:32});(0,_vitest.expect)((0,_spacing.parseSpacing)("mx-xl",customSpacing)).toEqual({marginHorizontal:64});(0,_vitest.expect)((0,_spacing.parseSpacing)("mt-md",customSpacing)).toEqual({marginTop:16});});(0,_vitest.it)("should support custom spacing values for padding",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("p-xs",customSpacing)).toEqual({padding:4});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-sm",customSpacing)).toEqual({padding:8});(0,_vitest.expect)((0,_spacing.parseSpacing)("px-lg",customSpacing)).toEqual({paddingHorizontal:32});(0,_vitest.expect)((0,_spacing.parseSpacing)("pt-xl",customSpacing)).toEqual({paddingTop:64});});(0,_vitest.it)("should support custom spacing values for gap",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-xs",customSpacing)).toEqual({gap:4});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-md",customSpacing)).toEqual({gap:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-xl",customSpacing)).toEqual({gap:64});});(0,_vitest.it)("should allow custom spacing to override preset values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-4",customSpacing)).toEqual({margin:20});});(0,_vitest.it)("should prefer arbitrary values over custom spacing",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[24px]",customSpacing)).toEqual({margin:24});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-[50]",customSpacing)).toEqual({padding:50});});(0,_vitest.it)("should support negative margins with custom spacing",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-xs",customSpacing)).toEqual({margin:-4});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-lg",customSpacing)).toEqual({margin:-32});(0,_vitest.expect)((0,_spacing.parseSpacing)("-mx-xl",customSpacing)).toEqual({marginHorizontal:-64});});(0,_vitest.it)("should fall back to preset scale for unknown custom keys",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-8",customSpacing)).toEqual({margin:32});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-12",customSpacing)).toEqual({padding:48});});(0,_vitest.it)("should work without custom spacing (backward compatible)",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-4")).toEqual({margin:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-8")).toEqual({padding:32});});});
@@ -9,5 +9,7 @@ export declare const PERSPECTIVE_SCALE: Record<string, number>;
9
9
  /**
10
10
  * Parse transform classes
11
11
  * Each transform class returns a transform array with a single transform object
12
+ * @param cls - The class name to parse
13
+ * @param customSpacing - Optional custom spacing values from tailwind.config (for translate utilities)
12
14
  */
13
- export declare function parseTransform(cls: string): StyleObject | null;
15
+ export declare function parseTransform(cls: string, customSpacing?: Record<string, number>): StyleObject | null;