@mgcrea/react-native-tailwind 0.5.0 → 0.5.2

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.
@@ -1 +1 @@
1
- var _vitest=require("vitest");var _layout=require("./layout");(0,_vitest.describe)("parseLayout - display utilities",function(){(0,_vitest.it)("should parse display flex",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex")).toEqual({display:"flex"});});(0,_vitest.it)("should parse display hidden",function(){(0,_vitest.expect)((0,_layout.parseLayout)("hidden")).toEqual({display:"none"});});});(0,_vitest.describe)("parseLayout - flex direction utilities",function(){(0,_vitest.it)("should parse flex row",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-row")).toEqual({flexDirection:"row"});});(0,_vitest.it)("should parse flex row reverse",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-row-reverse")).toEqual({flexDirection:"row-reverse"});});(0,_vitest.it)("should parse flex column",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-col")).toEqual({flexDirection:"column"});});(0,_vitest.it)("should parse flex column reverse",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-col-reverse")).toEqual({flexDirection:"column-reverse"});});});(0,_vitest.describe)("parseLayout - flex wrap utilities",function(){(0,_vitest.it)("should parse flex wrap",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-wrap")).toEqual({flexWrap:"wrap"});});(0,_vitest.it)("should parse flex wrap reverse",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-wrap-reverse")).toEqual({flexWrap:"wrap-reverse"});});(0,_vitest.it)("should parse flex nowrap",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-nowrap")).toEqual({flexWrap:"nowrap"});});});(0,_vitest.describe)("parseLayout - flex utilities",function(){(0,_vitest.it)("should parse flex-1",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-1")).toEqual({flex:1});});(0,_vitest.it)("should parse flex-auto",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-auto")).toEqual({flex:1});});(0,_vitest.it)("should parse flex-none",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-none")).toEqual({flex:0});});});(0,_vitest.describe)("parseLayout - flex grow/shrink utilities",function(){(0,_vitest.it)("should parse grow",function(){(0,_vitest.expect)((0,_layout.parseLayout)("grow")).toEqual({flexGrow:1});});(0,_vitest.it)("should parse grow-0",function(){(0,_vitest.expect)((0,_layout.parseLayout)("grow-0")).toEqual({flexGrow:0});});(0,_vitest.it)("should parse shrink",function(){(0,_vitest.expect)((0,_layout.parseLayout)("shrink")).toEqual({flexShrink:1});});(0,_vitest.it)("should parse shrink-0",function(){(0,_vitest.expect)((0,_layout.parseLayout)("shrink-0")).toEqual({flexShrink:0});});});(0,_vitest.describe)("parseLayout - justify content utilities",function(){(0,_vitest.it)("should parse justify-start",function(){(0,_vitest.expect)((0,_layout.parseLayout)("justify-start")).toEqual({justifyContent:"flex-start"});});(0,_vitest.it)("should parse justify-end",function(){(0,_vitest.expect)((0,_layout.parseLayout)("justify-end")).toEqual({justifyContent:"flex-end"});});(0,_vitest.it)("should parse justify-center",function(){(0,_vitest.expect)((0,_layout.parseLayout)("justify-center")).toEqual({justifyContent:"center"});});(0,_vitest.it)("should parse justify-between",function(){(0,_vitest.expect)((0,_layout.parseLayout)("justify-between")).toEqual({justifyContent:"space-between"});});(0,_vitest.it)("should parse justify-around",function(){(0,_vitest.expect)((0,_layout.parseLayout)("justify-around")).toEqual({justifyContent:"space-around"});});(0,_vitest.it)("should parse justify-evenly",function(){(0,_vitest.expect)((0,_layout.parseLayout)("justify-evenly")).toEqual({justifyContent:"space-evenly"});});});(0,_vitest.describe)("parseLayout - align items utilities",function(){(0,_vitest.it)("should parse items-start",function(){(0,_vitest.expect)((0,_layout.parseLayout)("items-start")).toEqual({alignItems:"flex-start"});});(0,_vitest.it)("should parse items-end",function(){(0,_vitest.expect)((0,_layout.parseLayout)("items-end")).toEqual({alignItems:"flex-end"});});(0,_vitest.it)("should parse items-center",function(){(0,_vitest.expect)((0,_layout.parseLayout)("items-center")).toEqual({alignItems:"center"});});(0,_vitest.it)("should parse items-baseline",function(){(0,_vitest.expect)((0,_layout.parseLayout)("items-baseline")).toEqual({alignItems:"baseline"});});(0,_vitest.it)("should parse items-stretch",function(){(0,_vitest.expect)((0,_layout.parseLayout)("items-stretch")).toEqual({alignItems:"stretch"});});});(0,_vitest.describe)("parseLayout - align self utilities",function(){(0,_vitest.it)("should parse self-auto",function(){(0,_vitest.expect)((0,_layout.parseLayout)("self-auto")).toEqual({alignSelf:"auto"});});(0,_vitest.it)("should parse self-start",function(){(0,_vitest.expect)((0,_layout.parseLayout)("self-start")).toEqual({alignSelf:"flex-start"});});(0,_vitest.it)("should parse self-end",function(){(0,_vitest.expect)((0,_layout.parseLayout)("self-end")).toEqual({alignSelf:"flex-end"});});(0,_vitest.it)("should parse self-center",function(){(0,_vitest.expect)((0,_layout.parseLayout)("self-center")).toEqual({alignSelf:"center"});});(0,_vitest.it)("should parse self-stretch",function(){(0,_vitest.expect)((0,_layout.parseLayout)("self-stretch")).toEqual({alignSelf:"stretch"});});(0,_vitest.it)("should parse self-baseline",function(){(0,_vitest.expect)((0,_layout.parseLayout)("self-baseline")).toEqual({alignSelf:"baseline"});});});(0,_vitest.describe)("parseLayout - align content utilities",function(){(0,_vitest.it)("should parse content-start",function(){(0,_vitest.expect)((0,_layout.parseLayout)("content-start")).toEqual({alignContent:"flex-start"});});(0,_vitest.it)("should parse content-end",function(){(0,_vitest.expect)((0,_layout.parseLayout)("content-end")).toEqual({alignContent:"flex-end"});});(0,_vitest.it)("should parse content-center",function(){(0,_vitest.expect)((0,_layout.parseLayout)("content-center")).toEqual({alignContent:"center"});});(0,_vitest.it)("should parse content-between",function(){(0,_vitest.expect)((0,_layout.parseLayout)("content-between")).toEqual({alignContent:"space-between"});});(0,_vitest.it)("should parse content-around",function(){(0,_vitest.expect)((0,_layout.parseLayout)("content-around")).toEqual({alignContent:"space-around"});});(0,_vitest.it)("should parse content-stretch",function(){(0,_vitest.expect)((0,_layout.parseLayout)("content-stretch")).toEqual({alignContent:"stretch"});});});(0,_vitest.describe)("parseLayout - position utilities",function(){(0,_vitest.it)("should parse absolute",function(){(0,_vitest.expect)((0,_layout.parseLayout)("absolute")).toEqual({position:"absolute"});});(0,_vitest.it)("should parse relative",function(){(0,_vitest.expect)((0,_layout.parseLayout)("relative")).toEqual({position:"relative"});});});(0,_vitest.describe)("parseLayout - overflow utilities",function(){(0,_vitest.it)("should parse overflow-hidden",function(){(0,_vitest.expect)((0,_layout.parseLayout)("overflow-hidden")).toEqual({overflow:"hidden"});});(0,_vitest.it)("should parse overflow-visible",function(){(0,_vitest.expect)((0,_layout.parseLayout)("overflow-visible")).toEqual({overflow:"visible"});});(0,_vitest.it)("should parse overflow-scroll",function(){(0,_vitest.expect)((0,_layout.parseLayout)("overflow-scroll")).toEqual({overflow:"scroll"});});});(0,_vitest.describe)("parseLayout - 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 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.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.describe)("parseLayout - specific property coverage",function(){(0,_vitest.it)("should return unique objects for each class",function(){var flex1=(0,_layout.parseLayout)("flex");var flex2=(0,_layout.parseLayout)("flex");(0,_vitest.expect)(flex1).toEqual(flex2);});(0,_vitest.it)("should handle flex value variations",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-1")).toEqual({flex:1});(0,_vitest.expect)((0,_layout.parseLayout)("flex-auto")).toEqual({flex:1});(0,_vitest.expect)((0,_layout.parseLayout)("flex-none")).toEqual({flex:0});});(0,_vitest.it)("should distinguish between similar class names",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex")).not.toEqual((0,_layout.parseLayout)("flex-1"));(0,_vitest.expect)((0,_layout.parseLayout)("grow")).not.toEqual((0,_layout.parseLayout)("grow-0"));(0,_vitest.expect)((0,_layout.parseLayout)("shrink")).not.toEqual((0,_layout.parseLayout)("shrink-0"));});(0,_vitest.it)("should handle positioning with absolute/relative",function(){(0,_vitest.expect)((0,_layout.parseLayout)("absolute")).toEqual({position:"absolute"});(0,_vitest.expect)((0,_layout.parseLayout)("top-0")).toEqual({top:0});(0,_vitest.expect)((0,_layout.parseLayout)("left-0")).toEqual({left:0});});(0,_vitest.it)("should handle all positioning directions",function(){(0,_vitest.expect)((0,_layout.parseLayout)("top-4")).toHaveProperty("top");(0,_vitest.expect)((0,_layout.parseLayout)("right-4")).toHaveProperty("right");(0,_vitest.expect)((0,_layout.parseLayout)("bottom-4")).toHaveProperty("bottom");(0,_vitest.expect)((0,_layout.parseLayout)("left-4")).toHaveProperty("left");});(0,_vitest.it)("should handle inset shorthand variations",function(){var insetAll=(0,_layout.parseLayout)("inset-4");(0,_vitest.expect)(insetAll).toHaveProperty("top",16);(0,_vitest.expect)(insetAll).toHaveProperty("right",16);(0,_vitest.expect)(insetAll).toHaveProperty("bottom",16);(0,_vitest.expect)(insetAll).toHaveProperty("left",16);var insetX=(0,_layout.parseLayout)("inset-x-4");(0,_vitest.expect)(insetX).toHaveProperty("left",16);(0,_vitest.expect)(insetX).toHaveProperty("right",16);(0,_vitest.expect)(insetX).not.toHaveProperty("top");(0,_vitest.expect)(insetX).not.toHaveProperty("bottom");var insetY=(0,_layout.parseLayout)("inset-y-4");(0,_vitest.expect)(insetY).toHaveProperty("top",16);(0,_vitest.expect)(insetY).toHaveProperty("bottom",16);(0,_vitest.expect)(insetY).not.toHaveProperty("left");(0,_vitest.expect)(insetY).not.toHaveProperty("right");});});
1
+ var _vitest=require("vitest");var _layout=require("./layout");(0,_vitest.describe)("parseLayout - display utilities",function(){(0,_vitest.it)("should parse display flex",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex")).toEqual({display:"flex"});});(0,_vitest.it)("should parse display hidden",function(){(0,_vitest.expect)((0,_layout.parseLayout)("hidden")).toEqual({display:"none"});});});(0,_vitest.describe)("parseLayout - flex direction utilities",function(){(0,_vitest.it)("should parse flex row",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-row")).toEqual({flexDirection:"row"});});(0,_vitest.it)("should parse flex row reverse",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-row-reverse")).toEqual({flexDirection:"row-reverse"});});(0,_vitest.it)("should parse flex column",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-col")).toEqual({flexDirection:"column"});});(0,_vitest.it)("should parse flex column reverse",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-col-reverse")).toEqual({flexDirection:"column-reverse"});});});(0,_vitest.describe)("parseLayout - flex wrap utilities",function(){(0,_vitest.it)("should parse flex wrap",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-wrap")).toEqual({flexWrap:"wrap"});});(0,_vitest.it)("should parse flex wrap reverse",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-wrap-reverse")).toEqual({flexWrap:"wrap-reverse"});});(0,_vitest.it)("should parse flex nowrap",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-nowrap")).toEqual({flexWrap:"nowrap"});});});(0,_vitest.describe)("parseLayout - flex utilities",function(){(0,_vitest.it)("should parse flex-1",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-1")).toEqual({flex:1});});(0,_vitest.it)("should parse flex-auto",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-auto")).toEqual({flex:1});});(0,_vitest.it)("should parse flex-none",function(){(0,_vitest.expect)((0,_layout.parseLayout)("flex-none")).toEqual({flex:0});});});(0,_vitest.describe)("parseLayout - flex grow/shrink utilities",function(){(0,_vitest.it)("should parse grow",function(){(0,_vitest.expect)((0,_layout.parseLayout)("grow")).toEqual({flexGrow:1});});(0,_vitest.it)("should parse grow-0",function(){(0,_vitest.expect)((0,_layout.parseLayout)("grow-0")).toEqual({flexGrow:0});});(0,_vitest.it)("should parse shrink",function(){(0,_vitest.expect)((0,_layout.parseLayout)("shrink")).toEqual({flexShrink:1});});(0,_vitest.it)("should parse shrink-0",function(){(0,_vitest.expect)((0,_layout.parseLayout)("shrink-0")).toEqual({flexShrink:0});});});(0,_vitest.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 - 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");});});
@@ -4,23 +4,19 @@
4
4
  */
5
5
  import type { StyleObject } from "../types";
6
6
  /**
7
- * Helper function to build the shadow scale using Platform.select()
8
- * This allows tests to rebuild the scale after changing the platform mock
7
+ * Shadow scale definitions combining iOS and Android properties
8
+ * Based on Tailwind CSS shadow scale, adapted for React Native
9
+ *
10
+ * Note: We include BOTH iOS shadow properties AND Android elevation in each style.
11
+ * React Native will automatically use the appropriate properties for each platform:
12
+ * - iOS uses shadowColor, shadowOffset, shadowOpacity, shadowRadius
13
+ * - Android uses elevation
9
14
  */
10
- declare function buildShadowScale(): Record<string, StyleObject>;
11
- /**
12
- * Computed shadow scale using Platform.select()
13
- * This is evaluated at module load time for production use
14
- */
15
- declare let SHADOW_SCALE: Record<string, StyleObject>;
16
- /**
17
- * Rebuild the shadow scale (useful for testing with platform mocks)
18
- */
19
- export declare function rebuildShadowScale(): void;
15
+ declare const SHADOW_SCALE: Record<string, StyleObject>;
20
16
  /**
21
17
  * Parse shadow classes
22
18
  * @param cls - Class name to parse
23
19
  * @returns Style object or null if not a shadow class
24
20
  */
25
21
  export declare function parseShadow(cls: string): StyleObject | null;
26
- export { buildShadowScale, SHADOW_SCALE };
22
+ export { SHADOW_SCALE };
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.SHADOW_SCALE=void 0;exports.buildShadowScale=buildShadowScale;exports.parseShadow=parseShadow;exports.rebuildShadowScale=rebuildShadowScale;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _reactNative=require("react-native");var SHADOW_DEFINITIONS={"shadow-sm":{ios:{shadowColor:"#000000",shadowOffset:{width:0,height:1},shadowOpacity:0.05,shadowRadius:1},android:{elevation:1}},shadow:{ios:{shadowColor:"#000000",shadowOffset:{width:0,height:1},shadowOpacity:0.1,shadowRadius:2},android:{elevation:2}},"shadow-md":{ios:{shadowColor:"#000000",shadowOffset:{width:0,height:3},shadowOpacity:0.15,shadowRadius:4},android:{elevation:4}},"shadow-lg":{ios:{shadowColor:"#000000",shadowOffset:{width:0,height:6},shadowOpacity:0.2,shadowRadius:8},android:{elevation:8}},"shadow-xl":{ios:{shadowColor:"#000000",shadowOffset:{width:0,height:10},shadowOpacity:0.25,shadowRadius:12},android:{elevation:12}},"shadow-2xl":{ios:{shadowColor:"#000000",shadowOffset:{width:0,height:20},shadowOpacity:0.3,shadowRadius:24},android:{elevation:16}},"shadow-none":{ios:{shadowColor:"transparent",shadowOffset:{width:0,height:0},shadowOpacity:0,shadowRadius:0},android:{elevation:0}}};function buildShadowScale(){var scale={};for(var _ref of Object.entries(SHADOW_DEFINITIONS)){var _ref2=(0,_slicedToArray2.default)(_ref,2);var key=_ref2[0];var value=_ref2[1];scale[key]=_reactNative.Platform.select(value);}return scale;}var SHADOW_SCALE=exports.SHADOW_SCALE=buildShadowScale();function rebuildShadowScale(){exports.SHADOW_SCALE=SHADOW_SCALE=buildShadowScale();}function parseShadow(cls){if(cls in SHADOW_SCALE){return SHADOW_SCALE[cls];}return null;}
1
+ Object.defineProperty(exports,"__esModule",{value:true});exports.SHADOW_SCALE=void 0;exports.parseShadow=parseShadow;var SHADOW_SCALE=exports.SHADOW_SCALE={"shadow-sm":{shadowColor:"#000000",shadowOffset:{width:0,height:1},shadowOpacity:0.05,shadowRadius:1,elevation:1},shadow:{shadowColor:"#000000",shadowOffset:{width:0,height:1},shadowOpacity:0.1,shadowRadius:2,elevation:2},"shadow-md":{shadowColor:"#000000",shadowOffset:{width:0,height:3},shadowOpacity:0.15,shadowRadius:4,elevation:4},"shadow-lg":{shadowColor:"#000000",shadowOffset:{width:0,height:6},shadowOpacity:0.2,shadowRadius:8,elevation:8},"shadow-xl":{shadowColor:"#000000",shadowOffset:{width:0,height:10},shadowOpacity:0.25,shadowRadius:12,elevation:12},"shadow-2xl":{shadowColor:"#000000",shadowOffset:{width:0,height:20},shadowOpacity:0.3,shadowRadius:24,elevation:16},"shadow-none":{shadowColor:"transparent",shadowOffset:{width:0,height:0},shadowOpacity:0,shadowRadius:0,elevation:0}};function parseShadow(cls){if(cls in SHADOW_SCALE){return SHADOW_SCALE[cls];}return null;}
@@ -1 +1 @@
1
- var _reactNative=require("test/mocks/react-native");var _vitest=require("vitest");var _shadows=require("./shadows");(0,_vitest.beforeEach)(function(){(0,_reactNative.setPlatform)("ios");(0,_shadows.rebuildShadowScale)();});(0,_vitest.describe)("SHADOW_SCALE",function(){(0,_vitest.it)("should export complete shadow scale",function(){(0,_vitest.expect)(_shadows.SHADOW_SCALE).toMatchSnapshot();});(0,_vitest.it)("should have all shadow variants",function(){(0,_vitest.expect)(_shadows.SHADOW_SCALE).toHaveProperty("shadow-sm");(0,_vitest.expect)(_shadows.SHADOW_SCALE).toHaveProperty("shadow");(0,_vitest.expect)(_shadows.SHADOW_SCALE).toHaveProperty("shadow-md");(0,_vitest.expect)(_shadows.SHADOW_SCALE).toHaveProperty("shadow-lg");(0,_vitest.expect)(_shadows.SHADOW_SCALE).toHaveProperty("shadow-xl");(0,_vitest.expect)(_shadows.SHADOW_SCALE).toHaveProperty("shadow-2xl");(0,_vitest.expect)(_shadows.SHADOW_SCALE).toHaveProperty("shadow-none");});});(0,_vitest.describe)("parseShadow - basic shadows",function(){(0,_vitest.it)("should parse shadow-sm",function(){var result=(0,_shadows.parseShadow)("shadow-sm");(0,_vitest.expect)(result).toBeTruthy();(0,_vitest.expect)(result).toHaveProperty("shadowColor");(0,_vitest.expect)(result).toHaveProperty("shadowOffset");(0,_vitest.expect)(result).toHaveProperty("shadowOpacity");(0,_vitest.expect)(result).toHaveProperty("shadowRadius");});(0,_vitest.it)("should parse default shadow",function(){var result=(0,_shadows.parseShadow)("shadow");(0,_vitest.expect)(result).toBeTruthy();});(0,_vitest.it)("should parse shadow-md",function(){var result=(0,_shadows.parseShadow)("shadow-md");(0,_vitest.expect)(result).toBeTruthy();});(0,_vitest.it)("should parse shadow-lg",function(){var result=(0,_shadows.parseShadow)("shadow-lg");(0,_vitest.expect)(result).toBeTruthy();});(0,_vitest.it)("should parse shadow-xl",function(){var result=(0,_shadows.parseShadow)("shadow-xl");(0,_vitest.expect)(result).toBeTruthy();});(0,_vitest.it)("should parse shadow-2xl",function(){var result=(0,_shadows.parseShadow)("shadow-2xl");(0,_vitest.expect)(result).toBeTruthy();});(0,_vitest.it)("should parse shadow-none",function(){var result=(0,_shadows.parseShadow)("shadow-none");(0,_vitest.expect)(result).toBeTruthy();(0,_vitest.expect)(result).toMatchObject({shadowColor:"transparent",shadowOpacity:0,shadowRadius:0});});});(0,_vitest.describe)("parseShadow - shadow properties (iOS)",function(){(0,_vitest.beforeEach)(function(){(0,_reactNative.setPlatform)("ios");});(0,_vitest.it)("should have increasing shadow values for larger shadows",function(){var sm=(0,_shadows.parseShadow)("shadow-sm");var md=(0,_shadows.parseShadow)("shadow-md");var lg=(0,_shadows.parseShadow)("shadow-lg");var xl=(0,_shadows.parseShadow)("shadow-xl");var xxl=(0,_shadows.parseShadow)("shadow-2xl");(0,_vitest.expect)(md==null?void 0:md.shadowOpacity).toBeGreaterThan(sm==null?void 0:sm.shadowOpacity);(0,_vitest.expect)(lg==null?void 0:lg.shadowOpacity).toBeGreaterThan(md==null?void 0:md.shadowOpacity);(0,_vitest.expect)(md==null?void 0:md.shadowRadius).toBeGreaterThan(sm==null?void 0:sm.shadowRadius);(0,_vitest.expect)(lg==null?void 0:lg.shadowRadius).toBeGreaterThan(md==null?void 0:md.shadowRadius);(0,_vitest.expect)(xl==null?void 0:xl.shadowRadius).toBeGreaterThan(lg==null?void 0:lg.shadowRadius);(0,_vitest.expect)(xxl==null?void 0:xxl.shadowRadius).toBeGreaterThan(xl==null?void 0:xl.shadowRadius);});(0,_vitest.it)("should use consistent shadow color",function(){var shadows=["shadow-sm","shadow","shadow-md","shadow-lg","shadow-xl","shadow-2xl"];shadows.forEach(function(shadow){var result=(0,_shadows.parseShadow)(shadow);(0,_vitest.expect)(result==null?void 0:result.shadowColor).toBe("#000000");});});(0,_vitest.it)("should have proper shadowOffset structure",function(){var _result$shadowOffset,_result$shadowOffset2;var result=(0,_shadows.parseShadow)("shadow");(0,_vitest.expect)(result==null?void 0:result.shadowOffset).toHaveProperty("width");(0,_vitest.expect)(result==null?void 0:result.shadowOffset).toHaveProperty("height");(0,_vitest.expect)(typeof(result==null||(_result$shadowOffset=result.shadowOffset)==null?void 0:_result$shadowOffset.width)).toBe("number");(0,_vitest.expect)(typeof(result==null||(_result$shadowOffset2=result.shadowOffset)==null?void 0:_result$shadowOffset2.height)).toBe("number");});(0,_vitest.it)("should not have elevation property on iOS",function(){var result=(0,_shadows.parseShadow)("shadow");(0,_vitest.expect)(result).not.toHaveProperty("elevation");});});(0,_vitest.describe)("parseShadow - shadow properties (Android)",function(){(0,_vitest.beforeEach)(function(){(0,_reactNative.setPlatform)("android");(0,_shadows.rebuildShadowScale)();});(0,_vitest.it)("should have increasing elevation values for larger shadows",function(){var sm=(0,_shadows.parseShadow)("shadow-sm");var md=(0,_shadows.parseShadow)("shadow-md");var lg=(0,_shadows.parseShadow)("shadow-lg");var xl=(0,_shadows.parseShadow)("shadow-xl");var xxl=(0,_shadows.parseShadow)("shadow-2xl");(0,_vitest.expect)(md==null?void 0:md.elevation).toBeGreaterThan(sm==null?void 0:sm.elevation);(0,_vitest.expect)(lg==null?void 0:lg.elevation).toBeGreaterThan(md==null?void 0:md.elevation);(0,_vitest.expect)(xl==null?void 0:xl.elevation).toBeGreaterThan(lg==null?void 0:lg.elevation);(0,_vitest.expect)(xxl==null?void 0:xxl.elevation).toBeGreaterThan(xl==null?void 0:xl.elevation);});(0,_vitest.it)("should not have shadow properties on Android",function(){var result=(0,_shadows.parseShadow)("shadow");(0,_vitest.expect)(result).not.toHaveProperty("shadowColor");(0,_vitest.expect)(result).not.toHaveProperty("shadowOffset");(0,_vitest.expect)(result).not.toHaveProperty("shadowOpacity");(0,_vitest.expect)(result).not.toHaveProperty("shadowRadius");});});(0,_vitest.describe)("parseShadow - invalid classes",function(){(0,_vitest.it)("should return null for invalid shadow classes",function(){(0,_vitest.expect)((0,_shadows.parseShadow)("shadow-invalid")).toBeNull();(0,_vitest.expect)((0,_shadows.parseShadow)("shadows")).toBeNull();(0,_vitest.expect)((0,_shadows.parseShadow)("shadow-")).toBeNull();(0,_vitest.expect)((0,_shadows.parseShadow)("shadow-small")).toBeNull();(0,_vitest.expect)((0,_shadows.parseShadow)("shadow-3xl")).toBeNull();});(0,_vitest.it)("should return null for non-shadow classes",function(){(0,_vitest.expect)((0,_shadows.parseShadow)("bg-blue-500")).toBeNull();(0,_vitest.expect)((0,_shadows.parseShadow)("p-4")).toBeNull();(0,_vitest.expect)((0,_shadows.parseShadow)("text-white")).toBeNull();(0,_vitest.expect)((0,_shadows.parseShadow)("border-2")).toBeNull();});(0,_vitest.it)("should return null for empty or invalid input",function(){(0,_vitest.expect)((0,_shadows.parseShadow)("")).toBeNull();(0,_vitest.expect)((0,_shadows.parseShadow)("shadow123")).toBeNull();});});(0,_vitest.describe)("parseShadow - comprehensive coverage",function(){(0,_vitest.it)("should parse all shadow variants without errors",function(){var variants=["shadow-sm","shadow","shadow-md","shadow-lg","shadow-xl","shadow-2xl","shadow-none"];variants.forEach(function(variant){var result=(0,_shadows.parseShadow)(variant);(0,_vitest.expect)(result).toBeTruthy();(0,_vitest.expect)(typeof result).toBe("object");});});(0,_vitest.it)("should return consistent results for same input",function(){var result1=(0,_shadows.parseShadow)("shadow-md");var result2=(0,_shadows.parseShadow)("shadow-md");(0,_vitest.expect)(result1).toEqual(result2);});(0,_vitest.it)("should handle case-sensitive class names",function(){(0,_vitest.expect)((0,_shadows.parseShadow)("SHADOW")).toBeNull();(0,_vitest.expect)((0,_shadows.parseShadow)("Shadow-md")).toBeNull();(0,_vitest.expect)((0,_shadows.parseShadow)("shadow-MD")).toBeNull();});});
1
+ var _vitest=require("vitest");var _shadows=require("./shadows");(0,_vitest.describe)("SHADOW_SCALE",function(){(0,_vitest.it)("should export complete shadow scale",function(){(0,_vitest.expect)(_shadows.SHADOW_SCALE).toMatchSnapshot();});(0,_vitest.it)("should have all shadow variants",function(){(0,_vitest.expect)(_shadows.SHADOW_SCALE).toHaveProperty("shadow-sm");(0,_vitest.expect)(_shadows.SHADOW_SCALE).toHaveProperty("shadow");(0,_vitest.expect)(_shadows.SHADOW_SCALE).toHaveProperty("shadow-md");(0,_vitest.expect)(_shadows.SHADOW_SCALE).toHaveProperty("shadow-lg");(0,_vitest.expect)(_shadows.SHADOW_SCALE).toHaveProperty("shadow-xl");(0,_vitest.expect)(_shadows.SHADOW_SCALE).toHaveProperty("shadow-2xl");(0,_vitest.expect)(_shadows.SHADOW_SCALE).toHaveProperty("shadow-none");});});(0,_vitest.describe)("parseShadow - basic shadows",function(){(0,_vitest.it)("should parse shadow-sm",function(){var result=(0,_shadows.parseShadow)("shadow-sm");(0,_vitest.expect)(result).toBeTruthy();(0,_vitest.expect)(result).toHaveProperty("shadowColor");(0,_vitest.expect)(result).toHaveProperty("shadowOffset");(0,_vitest.expect)(result).toHaveProperty("shadowOpacity");(0,_vitest.expect)(result).toHaveProperty("shadowRadius");});(0,_vitest.it)("should parse default shadow",function(){var result=(0,_shadows.parseShadow)("shadow");(0,_vitest.expect)(result).toBeTruthy();});(0,_vitest.it)("should parse shadow-md",function(){var result=(0,_shadows.parseShadow)("shadow-md");(0,_vitest.expect)(result).toBeTruthy();});(0,_vitest.it)("should parse shadow-lg",function(){var result=(0,_shadows.parseShadow)("shadow-lg");(0,_vitest.expect)(result).toBeTruthy();});(0,_vitest.it)("should parse shadow-xl",function(){var result=(0,_shadows.parseShadow)("shadow-xl");(0,_vitest.expect)(result).toBeTruthy();});(0,_vitest.it)("should parse shadow-2xl",function(){var result=(0,_shadows.parseShadow)("shadow-2xl");(0,_vitest.expect)(result).toBeTruthy();});(0,_vitest.it)("should parse shadow-none",function(){var result=(0,_shadows.parseShadow)("shadow-none");(0,_vitest.expect)(result).toBeTruthy();(0,_vitest.expect)(result).toMatchObject({shadowColor:"transparent",shadowOpacity:0,shadowRadius:0});});});(0,_vitest.describe)("parseShadow - shadow properties (iOS)",function(){(0,_vitest.it)("should have increasing shadow values for larger shadows",function(){var sm=(0,_shadows.parseShadow)("shadow-sm");var md=(0,_shadows.parseShadow)("shadow-md");var lg=(0,_shadows.parseShadow)("shadow-lg");var xl=(0,_shadows.parseShadow)("shadow-xl");var xxl=(0,_shadows.parseShadow)("shadow-2xl");(0,_vitest.expect)(md==null?void 0:md.shadowOpacity).toBeGreaterThan(sm==null?void 0:sm.shadowOpacity);(0,_vitest.expect)(lg==null?void 0:lg.shadowOpacity).toBeGreaterThan(md==null?void 0:md.shadowOpacity);(0,_vitest.expect)(md==null?void 0:md.shadowRadius).toBeGreaterThan(sm==null?void 0:sm.shadowRadius);(0,_vitest.expect)(lg==null?void 0:lg.shadowRadius).toBeGreaterThan(md==null?void 0:md.shadowRadius);(0,_vitest.expect)(xl==null?void 0:xl.shadowRadius).toBeGreaterThan(lg==null?void 0:lg.shadowRadius);(0,_vitest.expect)(xxl==null?void 0:xxl.shadowRadius).toBeGreaterThan(xl==null?void 0:xl.shadowRadius);});(0,_vitest.it)("should use consistent shadow color",function(){var shadows=["shadow-sm","shadow","shadow-md","shadow-lg","shadow-xl","shadow-2xl"];shadows.forEach(function(shadow){var result=(0,_shadows.parseShadow)(shadow);(0,_vitest.expect)(result==null?void 0:result.shadowColor).toBe("#000000");});});(0,_vitest.it)("should have proper shadowOffset structure",function(){var result=(0,_shadows.parseShadow)("shadow");var shadowOffset=result==null?void 0:result.shadowOffset;(0,_vitest.expect)(shadowOffset).toHaveProperty("width");(0,_vitest.expect)(shadowOffset).toHaveProperty("height");if(typeof shadowOffset==="object"&&shadowOffset!==null){(0,_vitest.expect)(typeof shadowOffset.width).toBe("number");(0,_vitest.expect)(typeof shadowOffset.height).toBe("number");}});(0,_vitest.it)("should include both iOS shadow and Android elevation properties",function(){var result=(0,_shadows.parseShadow)("shadow");(0,_vitest.expect)(result).toHaveProperty("shadowColor");(0,_vitest.expect)(result).toHaveProperty("shadowOffset");(0,_vitest.expect)(result).toHaveProperty("shadowOpacity");(0,_vitest.expect)(result).toHaveProperty("shadowRadius");(0,_vitest.expect)(result).toHaveProperty("elevation");});});(0,_vitest.describe)("parseShadow - shadow properties (Android)",function(){(0,_vitest.it)("should have increasing elevation values for larger shadows",function(){var sm=(0,_shadows.parseShadow)("shadow-sm");var md=(0,_shadows.parseShadow)("shadow-md");var lg=(0,_shadows.parseShadow)("shadow-lg");var xl=(0,_shadows.parseShadow)("shadow-xl");var xxl=(0,_shadows.parseShadow)("shadow-2xl");(0,_vitest.expect)(md==null?void 0:md.elevation).toBeGreaterThan(sm==null?void 0:sm.elevation);(0,_vitest.expect)(lg==null?void 0:lg.elevation).toBeGreaterThan(md==null?void 0:md.elevation);(0,_vitest.expect)(xl==null?void 0:xl.elevation).toBeGreaterThan(lg==null?void 0:lg.elevation);(0,_vitest.expect)(xxl==null?void 0:xxl.elevation).toBeGreaterThan(xl==null?void 0:xl.elevation);});(0,_vitest.it)("should include elevation property for Android",function(){var result=(0,_shadows.parseShadow)("shadow");(0,_vitest.expect)(result).toHaveProperty("elevation");(0,_vitest.expect)(typeof(result==null?void 0:result.elevation)).toBe("number");});});(0,_vitest.describe)("parseShadow - invalid classes",function(){(0,_vitest.it)("should return null for invalid shadow classes",function(){(0,_vitest.expect)((0,_shadows.parseShadow)("shadow-invalid")).toBeNull();(0,_vitest.expect)((0,_shadows.parseShadow)("shadows")).toBeNull();(0,_vitest.expect)((0,_shadows.parseShadow)("shadow-")).toBeNull();(0,_vitest.expect)((0,_shadows.parseShadow)("shadow-small")).toBeNull();(0,_vitest.expect)((0,_shadows.parseShadow)("shadow-3xl")).toBeNull();});(0,_vitest.it)("should return null for non-shadow classes",function(){(0,_vitest.expect)((0,_shadows.parseShadow)("bg-blue-500")).toBeNull();(0,_vitest.expect)((0,_shadows.parseShadow)("p-4")).toBeNull();(0,_vitest.expect)((0,_shadows.parseShadow)("text-white")).toBeNull();(0,_vitest.expect)((0,_shadows.parseShadow)("border-2")).toBeNull();});(0,_vitest.it)("should return null for empty or invalid input",function(){(0,_vitest.expect)((0,_shadows.parseShadow)("")).toBeNull();(0,_vitest.expect)((0,_shadows.parseShadow)("shadow123")).toBeNull();});});(0,_vitest.describe)("parseShadow - comprehensive coverage",function(){(0,_vitest.it)("should parse all shadow variants without errors",function(){var variants=["shadow-sm","shadow","shadow-md","shadow-lg","shadow-xl","shadow-2xl","shadow-none"];variants.forEach(function(variant){var result=(0,_shadows.parseShadow)(variant);(0,_vitest.expect)(result).toBeTruthy();(0,_vitest.expect)(typeof result).toBe("object");});});(0,_vitest.it)("should return consistent results for same input",function(){var result1=(0,_shadows.parseShadow)("shadow-md");var result2=(0,_shadows.parseShadow)("shadow-md");(0,_vitest.expect)(result1).toEqual(result2);});(0,_vitest.it)("should handle case-sensitive class names",function(){(0,_vitest.expect)((0,_shadows.parseShadow)("SHADOW")).toBeNull();(0,_vitest.expect)((0,_shadows.parseShadow)("Shadow-md")).toBeNull();(0,_vitest.expect)((0,_shadows.parseShadow)("shadow-MD")).toBeNull();});});
@@ -69,7 +69,7 @@ declare module "react-native" {
69
69
  className?: string;
70
70
  }
71
71
 
72
- interface FlatListProps<_ItemT> {
72
+ interface FlatListProps<ItemT> extends VirtualizedListProps<ItemT> {
73
73
  /**
74
74
  * Tailwind-like class names for styling
75
75
  * @example
package/dist/types.d.ts CHANGED
@@ -3,12 +3,10 @@
3
3
  */
4
4
  import type { ImageStyle, TextStyle, ViewStyle } from "react-native";
5
5
  export type RNStyle = ViewStyle | TextStyle | ImageStyle;
6
- export type StyleObject = Record<Exclude<string, "shadowOffset">, string | number | undefined> & {
7
- shadowOffset?: {
8
- width: number;
9
- height: number;
10
- };
11
- };
6
+ export type StyleObject = Record<string, string | number | {
7
+ width: number;
8
+ height: number;
9
+ } | undefined>;
12
10
  export type SpacingValue = number;
13
11
  export type ColorValue = string;
14
12
  export type Parser = (className: string) => StyleObject | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mgcrea/react-native-tailwind",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "description": "Compile-time Tailwind CSS for React Native with zero runtime overhead",
5
5
  "author": "Olivier Louvignes <olivier@mgcrea.io> (https://github.com/mgcrea)",
6
6
  "homepage": "https://github.com/mgcrea/react-native-tailwind#readme",
@@ -319,6 +319,18 @@ describe("parseLayout - z-index utilities", () => {
319
319
  expect(parseLayout("z-auto")).toEqual({ zIndex: 0 });
320
320
  });
321
321
 
322
+ it("should parse arbitrary z-index values", () => {
323
+ expect(parseLayout("z-[999]")).toEqual({ zIndex: 999 });
324
+ expect(parseLayout("z-[100]")).toEqual({ zIndex: 100 });
325
+ expect(parseLayout("z-[1]")).toEqual({ zIndex: 1 });
326
+ });
327
+
328
+ it("should parse negative arbitrary z-index values", () => {
329
+ expect(parseLayout("z-[-1]")).toEqual({ zIndex: -1 });
330
+ expect(parseLayout("z-[-10]")).toEqual({ zIndex: -10 });
331
+ expect(parseLayout("z-[-999]")).toEqual({ zIndex: -999 });
332
+ });
333
+
322
334
  it("should return null for invalid z-index values", () => {
323
335
  expect(parseLayout("z-100")).toBeNull();
324
336
  expect(parseLayout("z-5")).toBeNull();
@@ -369,6 +381,50 @@ describe("parseLayout - positioning utilities", () => {
369
381
  expect(parseLayout("bottom-auto")).toEqual({});
370
382
  expect(parseLayout("left-auto")).toEqual({});
371
383
  });
384
+
385
+ it("should parse arbitrary top values with pixels", () => {
386
+ expect(parseLayout("top-[50px]")).toEqual({ top: 50 });
387
+ expect(parseLayout("top-[100px]")).toEqual({ top: 100 });
388
+ expect(parseLayout("top-[0px]")).toEqual({ top: 0 });
389
+ });
390
+
391
+ it("should parse arbitrary top values without unit (defaults to px)", () => {
392
+ expect(parseLayout("top-[50]")).toEqual({ top: 50 });
393
+ expect(parseLayout("top-[100]")).toEqual({ top: 100 });
394
+ });
395
+
396
+ it("should parse arbitrary top values with percentages", () => {
397
+ expect(parseLayout("top-[25%]")).toEqual({ top: "25%" });
398
+ expect(parseLayout("top-[50%]")).toEqual({ top: "50%" });
399
+ expect(parseLayout("top-[10.5%]")).toEqual({ top: "10.5%" });
400
+ });
401
+
402
+ it("should parse negative arbitrary top values", () => {
403
+ expect(parseLayout("top-[-10px]")).toEqual({ top: -10 });
404
+ expect(parseLayout("top-[-50]")).toEqual({ top: -50 });
405
+ expect(parseLayout("top-[-25%]")).toEqual({ top: "-25%" });
406
+ });
407
+
408
+ it("should parse arbitrary right values", () => {
409
+ expect(parseLayout("right-[30px]")).toEqual({ right: 30 });
410
+ expect(parseLayout("right-[20]")).toEqual({ right: 20 });
411
+ expect(parseLayout("right-[15%]")).toEqual({ right: "15%" });
412
+ expect(parseLayout("right-[-10px]")).toEqual({ right: -10 });
413
+ });
414
+
415
+ it("should parse arbitrary bottom values", () => {
416
+ expect(parseLayout("bottom-[40px]")).toEqual({ bottom: 40 });
417
+ expect(parseLayout("bottom-[25]")).toEqual({ bottom: 25 });
418
+ expect(parseLayout("bottom-[33.333%]")).toEqual({ bottom: "33.333%" });
419
+ expect(parseLayout("bottom-[-15px]")).toEqual({ bottom: -15 });
420
+ });
421
+
422
+ it("should parse arbitrary left values", () => {
423
+ expect(parseLayout("left-[60px]")).toEqual({ left: 60 });
424
+ expect(parseLayout("left-[45]")).toEqual({ left: 45 });
425
+ expect(parseLayout("left-[12.5%]")).toEqual({ left: "12.5%" });
426
+ expect(parseLayout("left-[-20px]")).toEqual({ left: -20 });
427
+ });
372
428
  });
373
429
 
374
430
  describe("parseLayout - inset utilities", () => {
@@ -401,6 +457,42 @@ describe("parseLayout - inset utilities", () => {
401
457
  expect(parseLayout("inset-x-100")).toBeNull();
402
458
  expect(parseLayout("inset-y-100")).toBeNull();
403
459
  });
460
+
461
+ it("should parse arbitrary inset (all sides) values with pixels", () => {
462
+ expect(parseLayout("inset-[10px]")).toEqual({ top: 10, right: 10, bottom: 10, left: 10 });
463
+ expect(parseLayout("inset-[25px]")).toEqual({ top: 25, right: 25, bottom: 25, left: 25 });
464
+ expect(parseLayout("inset-[0px]")).toEqual({ top: 0, right: 0, bottom: 0, left: 0 });
465
+ });
466
+
467
+ it("should parse arbitrary inset values without unit (defaults to px)", () => {
468
+ expect(parseLayout("inset-[15]")).toEqual({ top: 15, right: 15, bottom: 15, left: 15 });
469
+ expect(parseLayout("inset-[30]")).toEqual({ top: 30, right: 30, bottom: 30, left: 30 });
470
+ });
471
+
472
+ it("should parse arbitrary inset values with percentages", () => {
473
+ expect(parseLayout("inset-[10%]")).toEqual({ top: "10%", right: "10%", bottom: "10%", left: "10%" });
474
+ expect(parseLayout("inset-[25%]")).toEqual({ top: "25%", right: "25%", bottom: "25%", left: "25%" });
475
+ expect(parseLayout("inset-[5.5%]")).toEqual({ top: "5.5%", right: "5.5%", bottom: "5.5%", left: "5.5%" });
476
+ });
477
+
478
+ it("should parse arbitrary inset-x (horizontal) values", () => {
479
+ expect(parseLayout("inset-x-[20px]")).toEqual({ left: 20, right: 20 });
480
+ expect(parseLayout("inset-x-[15]")).toEqual({ left: 15, right: 15 });
481
+ expect(parseLayout("inset-x-[10%]")).toEqual({ left: "10%", right: "10%" });
482
+ });
483
+
484
+ it("should parse arbitrary inset-y (vertical) values", () => {
485
+ expect(parseLayout("inset-y-[30px]")).toEqual({ top: 30, bottom: 30 });
486
+ expect(parseLayout("inset-y-[25]")).toEqual({ top: 25, bottom: 25 });
487
+ expect(parseLayout("inset-y-[15%]")).toEqual({ top: "15%", bottom: "15%" });
488
+ });
489
+
490
+ it("should parse negative arbitrary inset values", () => {
491
+ expect(parseLayout("inset-[-5px]")).toEqual({ top: -5, right: -5, bottom: -5, left: -5 });
492
+ expect(parseLayout("inset-x-[-10px]")).toEqual({ left: -10, right: -10 });
493
+ expect(parseLayout("inset-y-[-15px]")).toEqual({ top: -15, bottom: -15 });
494
+ expect(parseLayout("inset-[-20%]")).toEqual({ top: "-20%", right: "-20%", bottom: "-20%", left: "-20%" });
495
+ });
404
496
  });
405
497
 
406
498
  describe("parseLayout - specific property coverage", () => {
@@ -4,6 +4,60 @@
4
4
 
5
5
  import type { StyleObject } from "../types";
6
6
 
7
+ /**
8
+ * Parse arbitrary inset value: [123px], [123], [50%], [-10px]
9
+ * Returns number for px values, string for % values, null for unsupported units
10
+ */
11
+ function parseArbitraryInset(value: string): number | string | null {
12
+ // Match: [123px], [123], [-123px], [-123] (pixels)
13
+ const pxMatch = value.match(/^\[(-?\d+)(?:px)?\]$/);
14
+ if (pxMatch) {
15
+ return parseInt(pxMatch[1], 10);
16
+ }
17
+
18
+ // Match: [50%], [-50%] (percentage)
19
+ const percentMatch = value.match(/^\[(-?\d+(?:\.\d+)?)%\]$/);
20
+ if (percentMatch) {
21
+ return `${percentMatch[1]}%`;
22
+ }
23
+
24
+ // Unsupported units (rem, em, vh, vw, etc.) - warn and reject
25
+ if (value.startsWith("[") && value.endsWith("]")) {
26
+ if (process.env.NODE_ENV !== "production") {
27
+ console.warn(
28
+ `[react-native-tailwind] Unsupported arbitrary inset unit: ${value}. Only px and % are supported.`,
29
+ );
30
+ }
31
+ return null;
32
+ }
33
+
34
+ return null;
35
+ }
36
+
37
+ /**
38
+ * Parse arbitrary z-index value: [123], [-10]
39
+ * Returns number for valid z-index, null otherwise
40
+ */
41
+ function parseArbitraryZIndex(value: string): number | null {
42
+ // Match: [123], [-123] (integers only)
43
+ const zMatch = value.match(/^\[(-?\d+)\]$/);
44
+ if (zMatch) {
45
+ return parseInt(zMatch[1], 10);
46
+ }
47
+
48
+ // Unsupported format - warn and reject
49
+ if (value.startsWith("[") && value.endsWith("]")) {
50
+ if (process.env.NODE_ENV !== "production") {
51
+ console.warn(
52
+ `[react-native-tailwind] Invalid arbitrary z-index: ${value}. Only integers are supported.`,
53
+ );
54
+ }
55
+ return null;
56
+ }
57
+
58
+ return null;
59
+ }
60
+
7
61
  // Display utilities
8
62
  const DISPLAY_MAP: Record<string, StyleObject> = {
9
63
  flex: { display: "flex" },
@@ -128,16 +182,23 @@ export const INSET_SCALE: Record<string, number> = {
128
182
  * Parse layout classes
129
183
  */
130
184
  export function parseLayout(cls: string): StyleObject | null {
131
- // Z-index: z-0, z-10, z-20, etc.
185
+ // Z-index: z-0, z-10, z-20, z-[999], etc.
132
186
  if (cls.startsWith("z-")) {
133
187
  const zKey = cls.substring(2);
188
+
189
+ // Arbitrary values: z-[123], z-[-10]
190
+ const arbitraryZ = parseArbitraryZIndex(zKey);
191
+ if (arbitraryZ !== null) {
192
+ return { zIndex: arbitraryZ };
193
+ }
194
+
134
195
  const zValue = Z_INDEX_SCALE[zKey];
135
196
  if (zValue !== undefined) {
136
197
  return { zIndex: zValue };
137
198
  }
138
199
  }
139
200
 
140
- // Top positioning: top-0, top-4, etc.
201
+ // Top positioning: top-0, top-4, top-[10px], top-[50%], etc.
141
202
  if (cls.startsWith("top-")) {
142
203
  const topKey = cls.substring(4);
143
204
 
@@ -146,13 +207,19 @@ export function parseLayout(cls: string): StyleObject | null {
146
207
  return {};
147
208
  }
148
209
 
210
+ // Arbitrary values: top-[123px], top-[50%], top-[-10px]
211
+ const arbitraryTop = parseArbitraryInset(topKey);
212
+ if (arbitraryTop !== null) {
213
+ return { top: arbitraryTop };
214
+ }
215
+
149
216
  const topValue = INSET_SCALE[topKey];
150
217
  if (topValue !== undefined) {
151
218
  return { top: topValue };
152
219
  }
153
220
  }
154
221
 
155
- // Right positioning: right-0, right-4, etc.
222
+ // Right positioning: right-0, right-4, right-[10px], right-[50%], etc.
156
223
  if (cls.startsWith("right-")) {
157
224
  const rightKey = cls.substring(6);
158
225
 
@@ -161,13 +228,19 @@ export function parseLayout(cls: string): StyleObject | null {
161
228
  return {};
162
229
  }
163
230
 
231
+ // Arbitrary values: right-[123px], right-[50%], right-[-10px]
232
+ const arbitraryRight = parseArbitraryInset(rightKey);
233
+ if (arbitraryRight !== null) {
234
+ return { right: arbitraryRight };
235
+ }
236
+
164
237
  const rightValue = INSET_SCALE[rightKey];
165
238
  if (rightValue !== undefined) {
166
239
  return { right: rightValue };
167
240
  }
168
241
  }
169
242
 
170
- // Bottom positioning: bottom-0, bottom-4, etc.
243
+ // Bottom positioning: bottom-0, bottom-4, bottom-[10px], bottom-[50%], etc.
171
244
  if (cls.startsWith("bottom-")) {
172
245
  const bottomKey = cls.substring(7);
173
246
 
@@ -176,13 +249,19 @@ export function parseLayout(cls: string): StyleObject | null {
176
249
  return {};
177
250
  }
178
251
 
252
+ // Arbitrary values: bottom-[123px], bottom-[50%], bottom-[-10px]
253
+ const arbitraryBottom = parseArbitraryInset(bottomKey);
254
+ if (arbitraryBottom !== null) {
255
+ return { bottom: arbitraryBottom };
256
+ }
257
+
179
258
  const bottomValue = INSET_SCALE[bottomKey];
180
259
  if (bottomValue !== undefined) {
181
260
  return { bottom: bottomValue };
182
261
  }
183
262
  }
184
263
 
185
- // Left positioning: left-0, left-4, etc.
264
+ // Left positioning: left-0, left-4, left-[10px], left-[50%], etc.
186
265
  if (cls.startsWith("left-")) {
187
266
  const leftKey = cls.substring(5);
188
267
 
@@ -191,39 +270,66 @@ export function parseLayout(cls: string): StyleObject | null {
191
270
  return {};
192
271
  }
193
272
 
273
+ // Arbitrary values: left-[123px], left-[50%], left-[-10px]
274
+ const arbitraryLeft = parseArbitraryInset(leftKey);
275
+ if (arbitraryLeft !== null) {
276
+ return { left: arbitraryLeft };
277
+ }
278
+
194
279
  const leftValue = INSET_SCALE[leftKey];
195
280
  if (leftValue !== undefined) {
196
281
  return { left: leftValue };
197
282
  }
198
283
  }
199
284
 
200
- // Inset (all sides): inset-0, inset-4, etc.
201
- if (cls.startsWith("inset-")) {
202
- const insetKey = cls.substring(6);
203
- const insetValue = INSET_SCALE[insetKey];
204
- if (insetValue !== undefined) {
205
- return { top: insetValue, right: insetValue, bottom: insetValue, left: insetValue };
206
- }
207
- }
208
-
209
- // Inset X (left and right): inset-x-0, inset-x-4, etc.
285
+ // Inset X (left and right): inset-x-0, inset-x-4, inset-x-[10px], etc.
210
286
  if (cls.startsWith("inset-x-")) {
211
287
  const insetKey = cls.substring(8);
288
+
289
+ // Arbitrary values: inset-x-[123px], inset-x-[50%]
290
+ const arbitraryInset = parseArbitraryInset(insetKey);
291
+ if (arbitraryInset !== null) {
292
+ return { left: arbitraryInset, right: arbitraryInset };
293
+ }
294
+
212
295
  const insetValue = INSET_SCALE[insetKey];
213
296
  if (insetValue !== undefined) {
214
297
  return { left: insetValue, right: insetValue };
215
298
  }
216
299
  }
217
300
 
218
- // Inset Y (top and bottom): inset-y-0, inset-y-4, etc.
301
+ // Inset Y (top and bottom): inset-y-0, inset-y-4, inset-y-[10px], etc.
219
302
  if (cls.startsWith("inset-y-")) {
220
303
  const insetKey = cls.substring(8);
304
+
305
+ // Arbitrary values: inset-y-[123px], inset-y-[50%]
306
+ const arbitraryInset = parseArbitraryInset(insetKey);
307
+ if (arbitraryInset !== null) {
308
+ return { top: arbitraryInset, bottom: arbitraryInset };
309
+ }
310
+
221
311
  const insetValue = INSET_SCALE[insetKey];
222
312
  if (insetValue !== undefined) {
223
313
  return { top: insetValue, bottom: insetValue };
224
314
  }
225
315
  }
226
316
 
317
+ // Inset (all sides): inset-0, inset-4, inset-[10px], etc.
318
+ if (cls.startsWith("inset-")) {
319
+ const insetKey = cls.substring(6);
320
+
321
+ // Arbitrary values: inset-[123px], inset-[50%]
322
+ const arbitraryInset = parseArbitraryInset(insetKey);
323
+ if (arbitraryInset !== null) {
324
+ return { top: arbitraryInset, right: arbitraryInset, bottom: arbitraryInset, left: arbitraryInset };
325
+ }
326
+
327
+ const insetValue = INSET_SCALE[insetKey];
328
+ if (insetValue !== undefined) {
329
+ return { top: insetValue, right: insetValue, bottom: insetValue, left: insetValue };
330
+ }
331
+ }
332
+
227
333
  // Try each lookup table in order
228
334
  return (
229
335
  DISPLAY_MAP[cls] ??