@mgcrea/react-native-tailwind 0.3.0 → 0.5.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 (71) hide show
  1. package/README.md +459 -39
  2. package/dist/babel/index.cjs +810 -279
  3. package/dist/babel/index.d.ts +2 -1
  4. package/dist/babel/index.ts +328 -22
  5. package/dist/components/Pressable.d.ts +32 -0
  6. package/dist/components/Pressable.js +1 -0
  7. package/dist/components/TextInput.d.ts +56 -0
  8. package/dist/components/TextInput.js +1 -0
  9. package/dist/index.d.ts +9 -2
  10. package/dist/index.js +1 -1
  11. package/dist/parser/aspectRatio.d.ts +16 -0
  12. package/dist/parser/aspectRatio.js +1 -0
  13. package/dist/parser/aspectRatio.test.d.ts +1 -0
  14. package/dist/parser/aspectRatio.test.js +1 -0
  15. package/dist/parser/borders.js +1 -1
  16. package/dist/parser/borders.test.d.ts +1 -0
  17. package/dist/parser/borders.test.js +1 -0
  18. package/dist/parser/colors.d.ts +1 -0
  19. package/dist/parser/colors.js +1 -1
  20. package/dist/parser/colors.test.d.ts +1 -0
  21. package/dist/parser/colors.test.js +1 -0
  22. package/dist/parser/index.d.ts +4 -0
  23. package/dist/parser/index.js +1 -1
  24. package/dist/parser/layout.d.ts +2 -0
  25. package/dist/parser/layout.js +1 -1
  26. package/dist/parser/layout.test.d.ts +1 -0
  27. package/dist/parser/layout.test.js +1 -0
  28. package/dist/parser/modifiers.d.ts +47 -0
  29. package/dist/parser/modifiers.js +1 -0
  30. package/dist/parser/modifiers.test.d.ts +1 -0
  31. package/dist/parser/modifiers.test.js +1 -0
  32. package/dist/parser/shadows.d.ts +26 -0
  33. package/dist/parser/shadows.js +1 -0
  34. package/dist/parser/shadows.test.d.ts +1 -0
  35. package/dist/parser/shadows.test.js +1 -0
  36. package/dist/parser/sizing.test.d.ts +1 -0
  37. package/dist/parser/sizing.test.js +1 -0
  38. package/dist/parser/spacing.d.ts +1 -1
  39. package/dist/parser/spacing.js +1 -1
  40. package/dist/parser/spacing.test.d.ts +1 -0
  41. package/dist/parser/spacing.test.js +1 -0
  42. package/dist/parser/typography.d.ts +2 -1
  43. package/dist/parser/typography.js +1 -1
  44. package/dist/parser/typography.test.d.ts +1 -0
  45. package/dist/parser/typography.test.js +1 -0
  46. package/dist/types.d.ts +5 -2
  47. package/package.json +7 -6
  48. package/src/babel/index.ts +328 -22
  49. package/src/components/Pressable.tsx +46 -0
  50. package/src/components/TextInput.tsx +90 -0
  51. package/src/index.ts +20 -2
  52. package/src/parser/aspectRatio.test.ts +191 -0
  53. package/src/parser/aspectRatio.ts +73 -0
  54. package/src/parser/borders.test.ts +329 -0
  55. package/src/parser/borders.ts +187 -108
  56. package/src/parser/colors.test.ts +335 -0
  57. package/src/parser/colors.ts +117 -6
  58. package/src/parser/index.ts +13 -2
  59. package/src/parser/layout.test.ts +459 -0
  60. package/src/parser/layout.ts +128 -0
  61. package/src/parser/modifiers.test.ts +375 -0
  62. package/src/parser/modifiers.ts +104 -0
  63. package/src/parser/shadows.test.ts +201 -0
  64. package/src/parser/shadows.ts +133 -0
  65. package/src/parser/sizing.test.ts +256 -0
  66. package/src/parser/spacing.test.ts +226 -0
  67. package/src/parser/spacing.ts +93 -138
  68. package/src/parser/typography.test.ts +221 -0
  69. package/src/parser/typography.ts +143 -112
  70. package/src/types.ts +2 -2
  71. package/dist/react-native.d.js +0 -1
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.BORDER_WIDTH_SCALE=exports.BORDER_RADIUS_SCALE=void 0;exports.parseBorder=parseBorder;var _defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));var BORDER_WIDTH_SCALE=exports.BORDER_WIDTH_SCALE={"":1,"0":0,"2":2,"4":4,"8":8};var BORDER_RADIUS_SCALE=exports.BORDER_RADIUS_SCALE={none:0,sm:2,"":4,md:6,lg:8,xl:12,"2xl":16,"3xl":24,full:9999};function parseBorder(cls){if(cls.startsWith("border-")){return parseBorderWidth(cls);}if(cls==="border"){return{borderWidth:1};}if(cls.startsWith("rounded")){return parseBorderRadius(cls);}if(cls==="border-solid")return{borderStyle:"solid"};if(cls==="border-dotted")return{borderStyle:"dotted"};if(cls==="border-dashed")return{borderStyle:"dashed"};return null;}function parseBorderWidth(cls){var allArbMatch=cls.match(/^border-\[(\d+)(?:px)?\]$/);if(allArbMatch){return{borderWidth:parseInt(allArbMatch[1],10)};}var dirArbMatch=cls.match(/^border-([trbl])-\[(\d+)(?:px)?\]$/);if(dirArbMatch){var dir=dirArbMatch[1];var value=parseInt(dirArbMatch[2],10);var propMap={t:"borderTopWidth",r:"borderRightWidth",b:"borderBottomWidth",l:"borderLeftWidth"};return(0,_defineProperty2.default)({},propMap[dir],value);}var dirMatch=cls.match(/^border-([trbl])-?(\d*)$/);if(dirMatch){var _dir=dirMatch[1];var scaleKey=dirMatch[2]||"";var _value=BORDER_WIDTH_SCALE[scaleKey];if(typeof _value==="number"){var _propMap={t:"borderTopWidth",r:"borderRightWidth",b:"borderBottomWidth",l:"borderLeftWidth"};return(0,_defineProperty2.default)({},_propMap[_dir],_value);}}var allMatch=cls.match(/^border-(\d+)$/);if(allMatch){var _value2=BORDER_WIDTH_SCALE[allMatch[1]];if(_value2!==undefined){return{borderWidth:_value2};}}return null;}function parseBorderRadius(cls){var allArbMatch=cls.match(/^rounded-\[(\d+)(?:px)?\]$/);if(allArbMatch){return{borderRadius:parseInt(allArbMatch[1],10)};}var cornerArbMatch=cls.match(/^rounded-(tl|tr|bl|br)-\[(\d+)(?:px)?\]$/);if(cornerArbMatch){var corner=cornerArbMatch[1];var value=parseInt(cornerArbMatch[2],10);var propMap={tl:"borderTopLeftRadius",tr:"borderTopRightRadius",bl:"borderBottomLeftRadius",br:"borderBottomRightRadius"};return(0,_defineProperty2.default)({},propMap[corner],value);}var sideArbMatch=cls.match(/^rounded-([trbl])-\[(\d+)(?:px)?\]$/);if(sideArbMatch){var side=sideArbMatch[1];var _value3=parseInt(sideArbMatch[2],10);var _propMap2={t:["borderTopLeftRadius","borderTopRightRadius"],r:["borderTopRightRadius","borderBottomRightRadius"],b:["borderBottomLeftRadius","borderBottomRightRadius"],l:["borderTopLeftRadius","borderBottomLeftRadius"]};var result={};_propMap2[side].forEach(function(prop){return result[prop]=_value3;});return result;}var allMatch=cls.match(/^rounded(-\w+)?$/);if(allMatch){var scaleKey=allMatch[1]?allMatch[1].substring(1):"";var _value4=BORDER_RADIUS_SCALE[scaleKey];if(_value4!==undefined){return{borderRadius:_value4};}}var sideMatch=cls.match(/^rounded-([trbl])(?:-(\w+))?$/);if(sideMatch){var _side=sideMatch[1];var _scaleKey=sideMatch[2]||"";var _value5=BORDER_RADIUS_SCALE[_scaleKey];if(_value5!==undefined){var _propMap3={t:["borderTopLeftRadius","borderTopRightRadius"],r:["borderTopRightRadius","borderBottomRightRadius"],b:["borderBottomLeftRadius","borderBottomRightRadius"],l:["borderTopLeftRadius","borderBottomLeftRadius"]};var _result={};_propMap3[_side].forEach(function(prop){return _result[prop]=_value5;});return _result;}}var cornerMatch=cls.match(/^rounded-(tl|tr|bl|br)(?:-(\w+))?$/);if(cornerMatch){var _corner=cornerMatch[1];var _scaleKey2=cornerMatch[2]||"";var _value6=BORDER_RADIUS_SCALE[_scaleKey2];if(_value6!==undefined){var _propMap4={tl:"borderTopLeftRadius",tr:"borderTopRightRadius",bl:"borderBottomLeftRadius",br:"borderBottomRightRadius"};return(0,_defineProperty2.default)({},_propMap4[_corner],_value6);}}return null;}
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.BORDER_WIDTH_SCALE=exports.BORDER_RADIUS_SCALE=void 0;exports.parseBorder=parseBorder;var _defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));var BORDER_WIDTH_SCALE=exports.BORDER_WIDTH_SCALE={"":1,"0":0,"2":2,"4":4,"8":8};var BORDER_RADIUS_SCALE=exports.BORDER_RADIUS_SCALE={none:0,sm:2,"":4,md:6,lg:8,xl:12,"2xl":16,"3xl":24,full:9999};var BORDER_WIDTH_PROP_MAP={t:"borderTopWidth",r:"borderRightWidth",b:"borderBottomWidth",l:"borderLeftWidth"};var BORDER_RADIUS_CORNER_MAP={tl:"borderTopLeftRadius",tr:"borderTopRightRadius",bl:"borderBottomLeftRadius",br:"borderBottomRightRadius"};var BORDER_RADIUS_SIDE_MAP={t:["borderTopLeftRadius","borderTopRightRadius"],r:["borderTopRightRadius","borderBottomRightRadius"],b:["borderBottomLeftRadius","borderBottomRightRadius"],l:["borderTopLeftRadius","borderBottomLeftRadius"]};function parseArbitraryBorderWidth(value){var pxMatch=value.match(/^\[(\d+)(?:px)?\]$/);if(pxMatch){return parseInt(pxMatch[1],10);}if(value.startsWith("[")&&value.endsWith("]")){if(process.env.NODE_ENV!=="production"){console.warn(`[react-native-tailwind] Unsupported arbitrary border width value: ${value}. Only px values are supported (e.g., [8px] or [8]).`);}return null;}return null;}function parseArbitraryBorderRadius(value){var pxMatch=value.match(/^\[(\d+)(?:px)?\]$/);if(pxMatch){return parseInt(pxMatch[1],10);}if(value.startsWith("[")&&value.endsWith("]")){if(process.env.NODE_ENV!=="production"){console.warn(`[react-native-tailwind] Unsupported arbitrary border radius value: ${value}. Only px values are supported (e.g., [12px] or [12]).`);}return null;}return null;}function parseBorder(cls){if(cls==="border-solid")return{borderStyle:"solid"};if(cls==="border-dotted")return{borderStyle:"dotted"};if(cls==="border-dashed")return{borderStyle:"dashed"};if(cls.startsWith("border-")){return parseBorderWidth(cls);}if(cls==="border"){return{borderWidth:1};}if(cls.startsWith("rounded")){return parseBorderRadius(cls);}return null;}function parseBorderWidth(cls){var dirMatch=cls.match(/^border-([trbl])(?:-(.+))?$/);if(dirMatch){var dir=dirMatch[1];var valueStr=dirMatch[2]||"";if(valueStr.startsWith("[")){var arbitraryValue=parseArbitraryBorderWidth(valueStr);if(arbitraryValue!==null){return(0,_defineProperty2.default)({},BORDER_WIDTH_PROP_MAP[dir],arbitraryValue);}return null;}var scaleValue=BORDER_WIDTH_SCALE[valueStr];if(scaleValue!==undefined){return(0,_defineProperty2.default)({},BORDER_WIDTH_PROP_MAP[dir],scaleValue);}return null;}var allMatch=cls.match(/^border-(\d+)$/);if(allMatch){var value=BORDER_WIDTH_SCALE[allMatch[1]];if(value!==undefined){return{borderWidth:value};}}var allArbMatch=cls.match(/^border-(\[.+\])$/);if(allArbMatch){var _arbitraryValue=parseArbitraryBorderWidth(allArbMatch[1]);if(_arbitraryValue!==null){return{borderWidth:_arbitraryValue};}}return null;}function parseBorderRadius(cls){var withoutPrefix=cls.substring(7);if(withoutPrefix===""){return{borderRadius:BORDER_RADIUS_SCALE[""]};}if(!withoutPrefix.startsWith("-")){return null;}var rest=withoutPrefix.substring(1);if(rest===""){return null;}var cornerMatch=rest.match(/^(tl|tr|bl|br)(?:-(.+))?$/);if(cornerMatch){var corner=cornerMatch[1];var valueStr=cornerMatch[2]||"";if(valueStr.startsWith("[")){var arbitraryValue=parseArbitraryBorderRadius(valueStr);if(arbitraryValue!==null){return(0,_defineProperty2.default)({},BORDER_RADIUS_CORNER_MAP[corner],arbitraryValue);}return null;}var _scaleValue=BORDER_RADIUS_SCALE[valueStr];if(_scaleValue!==undefined){return(0,_defineProperty2.default)({},BORDER_RADIUS_CORNER_MAP[corner],_scaleValue);}return null;}var sideMatch=rest.match(/^([trbl])(?:-(.+))?$/);if(sideMatch){var side=sideMatch[1];var _valueStr=sideMatch[2]||"";var value;if(_valueStr.startsWith("[")){var _arbitraryValue2=parseArbitraryBorderRadius(_valueStr);if(_arbitraryValue2!==null){value=_arbitraryValue2;}else{return null;}}else{value=BORDER_RADIUS_SCALE[_valueStr];}if(value!==undefined){var result={};BORDER_RADIUS_SIDE_MAP[side].forEach(function(prop){return result[prop]=value;});return result;}return null;}if(rest.startsWith("[")){var _arbitraryValue3=parseArbitraryBorderRadius(rest);if(_arbitraryValue3!==null){return{borderRadius:_arbitraryValue3};}return null;}var scaleValue=BORDER_RADIUS_SCALE[rest];if(scaleValue!==undefined){return{borderRadius:scaleValue};}return null;}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ var _vitest=require("vitest");var _borders=require("./borders");(0,_vitest.describe)("BORDER_WIDTH_SCALE",function(){(0,_vitest.it)("should export complete border width scale",function(){(0,_vitest.expect)(_borders.BORDER_WIDTH_SCALE).toMatchSnapshot();});});(0,_vitest.describe)("BORDER_RADIUS_SCALE",function(){(0,_vitest.it)("should export complete border radius scale",function(){(0,_vitest.expect)(_borders.BORDER_RADIUS_SCALE).toMatchSnapshot();});});(0,_vitest.describe)("parseBorder - border width all sides",function(){(0,_vitest.it)("should parse border shorthand",function(){(0,_vitest.expect)((0,_borders.parseBorder)("border")).toEqual({borderWidth:1});});(0,_vitest.it)("should parse border with preset values",function(){(0,_vitest.expect)((0,_borders.parseBorder)("border-0")).toEqual({borderWidth:0});(0,_vitest.expect)((0,_borders.parseBorder)("border-2")).toEqual({borderWidth:2});(0,_vitest.expect)((0,_borders.parseBorder)("border-4")).toEqual({borderWidth:4});(0,_vitest.expect)((0,_borders.parseBorder)("border-8")).toEqual({borderWidth:8});});(0,_vitest.it)("should parse border with arbitrary pixel values",function(){(0,_vitest.expect)((0,_borders.parseBorder)("border-[1px]")).toEqual({borderWidth:1});(0,_vitest.expect)((0,_borders.parseBorder)("border-[1]")).toEqual({borderWidth:1});(0,_vitest.expect)((0,_borders.parseBorder)("border-[3px]")).toEqual({borderWidth:3});(0,_vitest.expect)((0,_borders.parseBorder)("border-[10px]")).toEqual({borderWidth:10});});});(0,_vitest.describe)("parseBorder - border width directional",function(){(0,_vitest.it)("should parse border top",function(){(0,_vitest.expect)((0,_borders.parseBorder)("border-t")).toEqual({borderTopWidth:1});(0,_vitest.expect)((0,_borders.parseBorder)("border-t-0")).toEqual({borderTopWidth:0});(0,_vitest.expect)((0,_borders.parseBorder)("border-t-2")).toEqual({borderTopWidth:2});(0,_vitest.expect)((0,_borders.parseBorder)("border-t-4")).toEqual({borderTopWidth:4});(0,_vitest.expect)((0,_borders.parseBorder)("border-t-8")).toEqual({borderTopWidth:8});});(0,_vitest.it)("should parse border right",function(){(0,_vitest.expect)((0,_borders.parseBorder)("border-r")).toEqual({borderRightWidth:1});(0,_vitest.expect)((0,_borders.parseBorder)("border-r-0")).toEqual({borderRightWidth:0});(0,_vitest.expect)((0,_borders.parseBorder)("border-r-2")).toEqual({borderRightWidth:2});(0,_vitest.expect)((0,_borders.parseBorder)("border-r-4")).toEqual({borderRightWidth:4});});(0,_vitest.it)("should parse border bottom",function(){(0,_vitest.expect)((0,_borders.parseBorder)("border-b")).toEqual({borderBottomWidth:1});(0,_vitest.expect)((0,_borders.parseBorder)("border-b-0")).toEqual({borderBottomWidth:0});(0,_vitest.expect)((0,_borders.parseBorder)("border-b-2")).toEqual({borderBottomWidth:2});(0,_vitest.expect)((0,_borders.parseBorder)("border-b-4")).toEqual({borderBottomWidth:4});});(0,_vitest.it)("should parse border left",function(){(0,_vitest.expect)((0,_borders.parseBorder)("border-l")).toEqual({borderLeftWidth:1});(0,_vitest.expect)((0,_borders.parseBorder)("border-l-0")).toEqual({borderLeftWidth:0});(0,_vitest.expect)((0,_borders.parseBorder)("border-l-2")).toEqual({borderLeftWidth:2});(0,_vitest.expect)((0,_borders.parseBorder)("border-l-4")).toEqual({borderLeftWidth:4});});(0,_vitest.it)("should parse directional borders with arbitrary values",function(){(0,_vitest.expect)((0,_borders.parseBorder)("border-t-[3px]")).toEqual({borderTopWidth:3});(0,_vitest.expect)((0,_borders.parseBorder)("border-r-[5px]")).toEqual({borderRightWidth:5});(0,_vitest.expect)((0,_borders.parseBorder)("border-b-[7px]")).toEqual({borderBottomWidth:7});(0,_vitest.expect)((0,_borders.parseBorder)("border-l-[9px]")).toEqual({borderLeftWidth:9});});});(0,_vitest.describe)("parseBorder - border style",function(){(0,_vitest.it)("should parse border styles",function(){(0,_vitest.expect)((0,_borders.parseBorder)("border-solid")).toEqual({borderStyle:"solid"});(0,_vitest.expect)((0,_borders.parseBorder)("border-dotted")).toEqual({borderStyle:"dotted"});(0,_vitest.expect)((0,_borders.parseBorder)("border-dashed")).toEqual({borderStyle:"dashed"});});});(0,_vitest.describe)("parseBorder - border radius all corners",function(){(0,_vitest.it)("should parse rounded shorthand",function(){(0,_vitest.expect)((0,_borders.parseBorder)("rounded")).toEqual({borderRadius:4});});(0,_vitest.it)("should parse rounded with preset values",function(){(0,_vitest.expect)((0,_borders.parseBorder)("rounded-none")).toEqual({borderRadius:0});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-sm")).toEqual({borderRadius:2});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-md")).toEqual({borderRadius:6});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-lg")).toEqual({borderRadius:8});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-xl")).toEqual({borderRadius:12});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-2xl")).toEqual({borderRadius:16});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-3xl")).toEqual({borderRadius:24});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-full")).toEqual({borderRadius:9999});});(0,_vitest.it)("should parse rounded with arbitrary pixel values",function(){(0,_vitest.expect)((0,_borders.parseBorder)("rounded-[5px]")).toEqual({borderRadius:5});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-[10px]")).toEqual({borderRadius:10});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-[15]")).toEqual({borderRadius:15});});});(0,_vitest.describe)("parseBorder - border radius sides",function(){(0,_vitest.it)("should parse rounded top",function(){(0,_vitest.expect)((0,_borders.parseBorder)("rounded-t")).toEqual({borderTopLeftRadius:4,borderTopRightRadius:4});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-t-lg")).toEqual({borderTopLeftRadius:8,borderTopRightRadius:8});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-t-[12px]")).toEqual({borderTopLeftRadius:12,borderTopRightRadius:12});});(0,_vitest.it)("should parse rounded right",function(){(0,_vitest.expect)((0,_borders.parseBorder)("rounded-r")).toEqual({borderTopRightRadius:4,borderBottomRightRadius:4});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-r-lg")).toEqual({borderTopRightRadius:8,borderBottomRightRadius:8});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-r-[12px]")).toEqual({borderTopRightRadius:12,borderBottomRightRadius:12});});(0,_vitest.it)("should parse rounded bottom",function(){(0,_vitest.expect)((0,_borders.parseBorder)("rounded-b")).toEqual({borderBottomLeftRadius:4,borderBottomRightRadius:4});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-b-lg")).toEqual({borderBottomLeftRadius:8,borderBottomRightRadius:8});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-b-[12px]")).toEqual({borderBottomLeftRadius:12,borderBottomRightRadius:12});});(0,_vitest.it)("should parse rounded left",function(){(0,_vitest.expect)((0,_borders.parseBorder)("rounded-l")).toEqual({borderTopLeftRadius:4,borderBottomLeftRadius:4});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-l-lg")).toEqual({borderTopLeftRadius:8,borderBottomLeftRadius:8});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-l-[12px]")).toEqual({borderTopLeftRadius:12,borderBottomLeftRadius:12});});});(0,_vitest.describe)("parseBorder - border radius specific corners",function(){(0,_vitest.it)("should parse rounded top-left",function(){(0,_vitest.expect)((0,_borders.parseBorder)("rounded-tl")).toEqual({borderTopLeftRadius:4});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-tl-lg")).toEqual({borderTopLeftRadius:8});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-tl-[12px]")).toEqual({borderTopLeftRadius:12});});(0,_vitest.it)("should parse rounded top-right",function(){(0,_vitest.expect)((0,_borders.parseBorder)("rounded-tr")).toEqual({borderTopRightRadius:4});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-tr-lg")).toEqual({borderTopRightRadius:8});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-tr-[12px]")).toEqual({borderTopRightRadius:12});});(0,_vitest.it)("should parse rounded bottom-left",function(){(0,_vitest.expect)((0,_borders.parseBorder)("rounded-bl")).toEqual({borderBottomLeftRadius:4});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-bl-lg")).toEqual({borderBottomLeftRadius:8});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-bl-[12px]")).toEqual({borderBottomLeftRadius:12});});(0,_vitest.it)("should parse rounded bottom-right",function(){(0,_vitest.expect)((0,_borders.parseBorder)("rounded-br")).toEqual({borderBottomRightRadius:4});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-br-lg")).toEqual({borderBottomRightRadius:8});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-br-[12px]")).toEqual({borderBottomRightRadius:12});});});(0,_vitest.describe)("parseBorder - edge cases",function(){(0,_vitest.it)("should return null for invalid classes",function(){(0,_vitest.expect)((0,_borders.parseBorder)("invalid")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("border-")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("rounded-")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("borders-4")).toBeNull();});(0,_vitest.it)("should return null for invalid border width values",function(){(0,_vitest.expect)((0,_borders.parseBorder)("border-invalid")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("border-3")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("border-16")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("border-t-3")).toBeNull();});(0,_vitest.it)("should return null for invalid border radius values",function(){(0,_vitest.expect)((0,_borders.parseBorder)("rounded-invalid")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("rounded-4xl")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("rounded-t-invalid")).toBeNull();});(0,_vitest.it)("should return null for arbitrary values with unsupported units",function(){(0,_vitest.expect)((0,_borders.parseBorder)("border-[2rem]")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("border-[1em]")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("rounded-[2rem]")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("rounded-[1em]")).toBeNull();});(0,_vitest.it)("should return null for malformed arbitrary values",function(){(0,_vitest.expect)((0,_borders.parseBorder)("border-[8")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("border-8]")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("border-[]")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("rounded-[12")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("rounded-12]")).toBeNull();});(0,_vitest.it)("should handle edge case values",function(){(0,_vitest.expect)((0,_borders.parseBorder)("border-0")).toEqual({borderWidth:0});(0,_vitest.expect)((0,_borders.parseBorder)("border-t-0")).toEqual({borderTopWidth:0});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-none")).toEqual({borderRadius:0});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-full")).toEqual({borderRadius:9999});});(0,_vitest.it)("should not match partial class names",function(){(0,_vitest.expect)((0,_borders.parseBorder)("myborder-4")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("border-solid-extra")).toBeNull();(0,_vitest.expect)((0,_borders.parseBorder)("myrounded-lg")).toBeNull();});});(0,_vitest.describe)("parseBorder - comprehensive coverage",function(){(0,_vitest.it)("should handle all border width directions with same value",function(){(0,_vitest.expect)((0,_borders.parseBorder)("border-2")).toEqual({borderWidth:2});(0,_vitest.expect)((0,_borders.parseBorder)("border-t-2")).toEqual({borderTopWidth:2});(0,_vitest.expect)((0,_borders.parseBorder)("border-r-2")).toEqual({borderRightWidth:2});(0,_vitest.expect)((0,_borders.parseBorder)("border-b-2")).toEqual({borderBottomWidth:2});(0,_vitest.expect)((0,_borders.parseBorder)("border-l-2")).toEqual({borderLeftWidth:2});});(0,_vitest.it)("should handle all border radius types with same value",function(){(0,_vitest.expect)((0,_borders.parseBorder)("rounded-lg")).toEqual({borderRadius:8});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-t-lg")).toEqual({borderTopLeftRadius:8,borderTopRightRadius:8});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-r-lg")).toEqual({borderTopRightRadius:8,borderBottomRightRadius:8});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-b-lg")).toEqual({borderBottomLeftRadius:8,borderBottomRightRadius:8});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-l-lg")).toEqual({borderTopLeftRadius:8,borderBottomLeftRadius:8});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-tl-lg")).toEqual({borderTopLeftRadius:8});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-tr-lg")).toEqual({borderTopRightRadius:8});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-bl-lg")).toEqual({borderBottomLeftRadius:8});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-br-lg")).toEqual({borderBottomRightRadius:8});});(0,_vitest.it)("should handle arbitrary values across all border width types",function(){(0,_vitest.expect)((0,_borders.parseBorder)("border-[5px]")).toEqual({borderWidth:5});(0,_vitest.expect)((0,_borders.parseBorder)("border-t-[5px]")).toEqual({borderTopWidth:5});(0,_vitest.expect)((0,_borders.parseBorder)("border-r-[5px]")).toEqual({borderRightWidth:5});(0,_vitest.expect)((0,_borders.parseBorder)("border-b-[5px]")).toEqual({borderBottomWidth:5});(0,_vitest.expect)((0,_borders.parseBorder)("border-l-[5px]")).toEqual({borderLeftWidth:5});});(0,_vitest.it)("should handle arbitrary values across all border radius types",function(){(0,_vitest.expect)((0,_borders.parseBorder)("rounded-[10px]")).toEqual({borderRadius:10});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-t-[10px]")).toEqual({borderTopLeftRadius:10,borderTopRightRadius:10});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-tl-[10px]")).toEqual({borderTopLeftRadius:10});});(0,_vitest.it)("should handle all border styles",function(){(0,_vitest.expect)((0,_borders.parseBorder)("border-solid")).toEqual({borderStyle:"solid"});(0,_vitest.expect)((0,_borders.parseBorder)("border-dotted")).toEqual({borderStyle:"dotted"});(0,_vitest.expect)((0,_borders.parseBorder)("border-dashed")).toEqual({borderStyle:"dashed"});});(0,_vitest.it)("should handle shorthand classes correctly",function(){(0,_vitest.expect)((0,_borders.parseBorder)("border")).toEqual({borderWidth:1});(0,_vitest.expect)((0,_borders.parseBorder)("rounded")).toEqual({borderRadius:4});(0,_vitest.expect)((0,_borders.parseBorder)("border-t")).toEqual({borderTopWidth:1});(0,_vitest.expect)((0,_borders.parseBorder)("rounded-t")).toEqual({borderTopLeftRadius:4,borderTopRightRadius:4});});});
@@ -5,5 +5,6 @@ import type { StyleObject } from "../types";
5
5
  export declare const COLORS: Record<string, string>;
6
6
  /**
7
7
  * Parse color classes (background, text, border)
8
+ * Supports opacity modifier: bg-blue-500/50, text-black/80, border-red-500/30
8
9
  */
9
10
  export declare function parseColor(cls: string, customColors?: Record<string, string>): StyleObject | null;
@@ -1 +1 @@
1
- Object.defineProperty(exports,"__esModule",{value:true});exports.COLORS=void 0;exports.parseColor=parseColor;var COLORS=exports.COLORS={"gray-50":"#F9FAFB","gray-100":"#F3F4F6","gray-200":"#E5E7EB","gray-300":"#D1D5DB","gray-400":"#9CA3AF","gray-500":"#6B7280","gray-600":"#4B5563","gray-700":"#374151","gray-800":"#1F2937","gray-900":"#111827","red-50":"#FEF2F2","red-100":"#FEE2E2","red-200":"#FECACA","red-300":"#FCA5A5","red-400":"#F87171","red-500":"#EF4444","red-600":"#DC2626","red-700":"#B91C1C","red-800":"#991B1B","red-900":"#7F1D1D","blue-50":"#EFF6FF","blue-100":"#DBEAFE","blue-200":"#BFDBFE","blue-300":"#93C5FD","blue-400":"#60A5FA","blue-500":"#3B82F6","blue-600":"#2563EB","blue-700":"#1D4ED8","blue-800":"#1E40AF","blue-900":"#1E3A8A","green-50":"#F0FDF4","green-100":"#DCFCE7","green-200":"#BBF7D0","green-300":"#86EFAC","green-400":"#4ADE80","green-500":"#22C55E","green-600":"#16A34A","green-700":"#15803D","green-800":"#166534","green-900":"#14532D","yellow-50":"#FEFCE8","yellow-100":"#FEF9C3","yellow-200":"#FEF08A","yellow-300":"#FDE047","yellow-400":"#FACC15","yellow-500":"#EAB308","yellow-600":"#CA8A04","yellow-700":"#A16207","yellow-800":"#854D0E","yellow-900":"#713F12","purple-50":"#FAF5FF","purple-100":"#F3E8FF","purple-200":"#E9D5FF","purple-300":"#D8B4FE","purple-400":"#C084FC","purple-500":"#A855F7","purple-600":"#9333EA","purple-700":"#7E22CE","purple-800":"#6B21A8","purple-900":"#581C87","pink-50":"#FDF2F8","pink-100":"#FCE7F3","pink-200":"#FBCFE8","pink-300":"#F9A8D4","pink-400":"#F472B6","pink-500":"#EC4899","pink-600":"#DB2777","pink-700":"#BE185D","pink-800":"#9D174D","pink-900":"#831843","orange-50":"#FFF7ED","orange-100":"#FFEDD5","orange-200":"#FED7AA","orange-300":"#FDBA74","orange-400":"#FB923C","orange-500":"#F97316","orange-600":"#EA580C","orange-700":"#C2410C","orange-800":"#9A3412","orange-900":"#7C2D12","indigo-50":"#EEF2FF","indigo-100":"#E0E7FF","indigo-200":"#C7D2FE","indigo-300":"#A5B4FC","indigo-400":"#818CF8","indigo-500":"#6366F1","indigo-600":"#4F46E5","indigo-700":"#4338CA","indigo-800":"#3730A3","indigo-900":"#312E81",white:"#FFFFFF",black:"#000000",transparent:"transparent"};function parseColor(cls,customColors){var getColor=function getColor(key){var _customColors$key;return(_customColors$key=customColors==null?void 0:customColors[key])!=null?_customColors$key:COLORS[key];};if(cls.startsWith("bg-")){var colorKey=cls.substring(3);var color=getColor(colorKey);if(color){return{backgroundColor:color};}}if(cls.startsWith("text-")){var _colorKey=cls.substring(5);var _color=getColor(_colorKey);if(_color){return{color:_color};}}if(cls.startsWith("border-")&&!cls.match(/^border-[0-9]/)){var _colorKey2=cls.substring(7);var _color2=getColor(_colorKey2);if(_color2){return{borderColor:_color2};}}return null;}
1
+ Object.defineProperty(exports,"__esModule",{value:true});exports.COLORS=void 0;exports.parseColor=parseColor;var COLORS=exports.COLORS={"gray-50":"#F9FAFB","gray-100":"#F3F4F6","gray-200":"#E5E7EB","gray-300":"#D1D5DB","gray-400":"#9CA3AF","gray-500":"#6B7280","gray-600":"#4B5563","gray-700":"#374151","gray-800":"#1F2937","gray-900":"#111827","red-50":"#FEF2F2","red-100":"#FEE2E2","red-200":"#FECACA","red-300":"#FCA5A5","red-400":"#F87171","red-500":"#EF4444","red-600":"#DC2626","red-700":"#B91C1C","red-800":"#991B1B","red-900":"#7F1D1D","blue-50":"#EFF6FF","blue-100":"#DBEAFE","blue-200":"#BFDBFE","blue-300":"#93C5FD","blue-400":"#60A5FA","blue-500":"#3B82F6","blue-600":"#2563EB","blue-700":"#1D4ED8","blue-800":"#1E40AF","blue-900":"#1E3A8A","green-50":"#F0FDF4","green-100":"#DCFCE7","green-200":"#BBF7D0","green-300":"#86EFAC","green-400":"#4ADE80","green-500":"#22C55E","green-600":"#16A34A","green-700":"#15803D","green-800":"#166534","green-900":"#14532D","yellow-50":"#FEFCE8","yellow-100":"#FEF9C3","yellow-200":"#FEF08A","yellow-300":"#FDE047","yellow-400":"#FACC15","yellow-500":"#EAB308","yellow-600":"#CA8A04","yellow-700":"#A16207","yellow-800":"#854D0E","yellow-900":"#713F12","purple-50":"#FAF5FF","purple-100":"#F3E8FF","purple-200":"#E9D5FF","purple-300":"#D8B4FE","purple-400":"#C084FC","purple-500":"#A855F7","purple-600":"#9333EA","purple-700":"#7E22CE","purple-800":"#6B21A8","purple-900":"#581C87","pink-50":"#FDF2F8","pink-100":"#FCE7F3","pink-200":"#FBCFE8","pink-300":"#F9A8D4","pink-400":"#F472B6","pink-500":"#EC4899","pink-600":"#DB2777","pink-700":"#BE185D","pink-800":"#9D174D","pink-900":"#831843","orange-50":"#FFF7ED","orange-100":"#FFEDD5","orange-200":"#FED7AA","orange-300":"#FDBA74","orange-400":"#FB923C","orange-500":"#F97316","orange-600":"#EA580C","orange-700":"#C2410C","orange-800":"#9A3412","orange-900":"#7C2D12","indigo-50":"#EEF2FF","indigo-100":"#E0E7FF","indigo-200":"#C7D2FE","indigo-300":"#A5B4FC","indigo-400":"#818CF8","indigo-500":"#6366F1","indigo-600":"#4F46E5","indigo-700":"#4338CA","indigo-800":"#3730A3","indigo-900":"#312E81",white:"#FFFFFF",black:"#000000",transparent:"transparent"};function applyOpacity(hex,opacity){if(hex==="transparent"){return"transparent";}var cleanHex=hex.replace(/^#/,"");var fullHex=cleanHex.length===3?cleanHex.split("").map(function(char){return char+char;}).join(""):cleanHex;var alpha=Math.round(opacity/100*255);var alphaHex=alpha.toString(16).padStart(2,"0").toUpperCase();return`#${fullHex.toUpperCase()}${alphaHex}`;}function parseArbitraryColor(value){var hexMatch=value.match(/^\[#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})\]$/);if(hexMatch){var hex=hexMatch[1];if(hex.length===3){var expanded=hex.split("").map(function(char){return char+char;}).join("");return`#${expanded}`;}return`#${hex}`;}if(value.startsWith("[")&&value.endsWith("]")){if(process.env.NODE_ENV!=="production"){console.warn(`[react-native-tailwind] Unsupported arbitrary color value: ${value}. Only hex colors are supported (e.g., [#ff0000], [#f00], or [#ff0000aa]).`);}return null;}return null;}function parseColor(cls,customColors){var getColor=function getColor(key){var _customColors$key;return(_customColors$key=customColors==null?void 0:customColors[key])!=null?_customColors$key:COLORS[key];};var parseColorWithOpacity=function parseColorWithOpacity(colorKey){var _getColor;var opacityMatch=colorKey.match(/^(.+)\/(\d+)$/);if(opacityMatch){var baseColorKey=opacityMatch[1];var opacity=Number.parseInt(opacityMatch[2],10);if(opacity<0||opacity>100){if(process.env.NODE_ENV!=="production"){console.warn(`[react-native-tailwind] Invalid opacity value: ${opacity}. Opacity must be between 0 and 100.`);}return null;}var _arbitraryColor=parseArbitraryColor(baseColorKey);if(_arbitraryColor!==null){return applyOpacity(_arbitraryColor,opacity);}var color=getColor(baseColorKey);if(color){return applyOpacity(color,opacity);}return null;}var arbitraryColor=parseArbitraryColor(colorKey);if(arbitraryColor!==null){return arbitraryColor;}return(_getColor=getColor(colorKey))!=null?_getColor:null;};if(cls.startsWith("bg-")){var colorKey=cls.substring(3);var color=parseColorWithOpacity(colorKey);if(color){return{backgroundColor:color};}}if(cls.startsWith("text-")){var _colorKey=cls.substring(5);var _color=parseColorWithOpacity(_colorKey);if(_color){return{color:_color};}}if(cls.startsWith("border-")&&!cls.match(/^border-[0-9]/)){var _colorKey2=cls.substring(7);var _color2=parseColorWithOpacity(_colorKey2);if(_color2){return{borderColor:_color2};}}return null;}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ var _vitest=require("vitest");var _colors=require("./colors");(0,_vitest.describe)("COLORS",function(){(0,_vitest.it)("should export complete color palette",function(){(0,_vitest.expect)(_colors.COLORS).toMatchSnapshot();});});(0,_vitest.describe)("parseColor - background colors",function(){(0,_vitest.it)("should parse background colors with preset values",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-blue-500")).toEqual({backgroundColor:"#3B82F6"});(0,_vitest.expect)((0,_colors.parseColor)("bg-red-500")).toEqual({backgroundColor:"#EF4444"});(0,_vitest.expect)((0,_colors.parseColor)("bg-green-500")).toEqual({backgroundColor:"#22C55E"});(0,_vitest.expect)((0,_colors.parseColor)("bg-gray-300")).toEqual({backgroundColor:"#D1D5DB"});});(0,_vitest.it)("should parse background colors with basic values",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-white")).toEqual({backgroundColor:"#FFFFFF"});(0,_vitest.expect)((0,_colors.parseColor)("bg-black")).toEqual({backgroundColor:"#000000"});(0,_vitest.expect)((0,_colors.parseColor)("bg-transparent")).toEqual({backgroundColor:"transparent"});});(0,_vitest.it)("should parse background colors with arbitrary 6-digit hex values",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-[#ff0000]")).toEqual({backgroundColor:"#ff0000"});(0,_vitest.expect)((0,_colors.parseColor)("bg-[#3B82F6]")).toEqual({backgroundColor:"#3B82F6"});(0,_vitest.expect)((0,_colors.parseColor)("bg-[#000000]")).toEqual({backgroundColor:"#000000"});(0,_vitest.expect)((0,_colors.parseColor)("bg-[#FFFFFF]")).toEqual({backgroundColor:"#FFFFFF"});});(0,_vitest.it)("should parse background colors with arbitrary 3-digit hex values",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-[#f00]")).toEqual({backgroundColor:"#ff0000"});(0,_vitest.expect)((0,_colors.parseColor)("bg-[#abc]")).toEqual({backgroundColor:"#aabbcc"});(0,_vitest.expect)((0,_colors.parseColor)("bg-[#123]")).toEqual({backgroundColor:"#112233"});(0,_vitest.expect)((0,_colors.parseColor)("bg-[#FFF]")).toEqual({backgroundColor:"#FFFFFF"});});(0,_vitest.it)("should parse background colors with arbitrary 8-digit hex values (with alpha)",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-[#ff0000aa]")).toEqual({backgroundColor:"#ff0000aa"});(0,_vitest.expect)((0,_colors.parseColor)("bg-[#3B82F680]")).toEqual({backgroundColor:"#3B82F680"});(0,_vitest.expect)((0,_colors.parseColor)("bg-[#00000000]")).toEqual({backgroundColor:"#00000000"});(0,_vitest.expect)((0,_colors.parseColor)("bg-[#FFFFFFFF]")).toEqual({backgroundColor:"#FFFFFFFF"});});(0,_vitest.it)("should handle case-insensitive hex values",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-[#FF0000]")).toEqual({backgroundColor:"#FF0000"});(0,_vitest.expect)((0,_colors.parseColor)("bg-[#ff0000]")).toEqual({backgroundColor:"#ff0000"});(0,_vitest.expect)((0,_colors.parseColor)("bg-[#Ff0000]")).toEqual({backgroundColor:"#Ff0000"});});(0,_vitest.it)("should prefer arbitrary values over preset colors",function(){var customColors={"[#ff0000]":"#00ff00"};(0,_vitest.expect)((0,_colors.parseColor)("bg-[#ff0000]",customColors)).toEqual({backgroundColor:"#ff0000"});});});(0,_vitest.describe)("parseColor - text colors",function(){(0,_vitest.it)("should parse text colors with preset values",function(){(0,_vitest.expect)((0,_colors.parseColor)("text-blue-500")).toEqual({color:"#3B82F6"});(0,_vitest.expect)((0,_colors.parseColor)("text-red-500")).toEqual({color:"#EF4444"});(0,_vitest.expect)((0,_colors.parseColor)("text-green-500")).toEqual({color:"#22C55E"});(0,_vitest.expect)((0,_colors.parseColor)("text-gray-700")).toEqual({color:"#374151"});});(0,_vitest.it)("should parse text colors with basic values",function(){(0,_vitest.expect)((0,_colors.parseColor)("text-white")).toEqual({color:"#FFFFFF"});(0,_vitest.expect)((0,_colors.parseColor)("text-black")).toEqual({color:"#000000"});});(0,_vitest.it)("should parse text colors with arbitrary 6-digit hex values",function(){(0,_vitest.expect)((0,_colors.parseColor)("text-[#ff0000]")).toEqual({color:"#ff0000"});(0,_vitest.expect)((0,_colors.parseColor)("text-[#3B82F6]")).toEqual({color:"#3B82F6"});(0,_vitest.expect)((0,_colors.parseColor)("text-[#333333]")).toEqual({color:"#333333"});});(0,_vitest.it)("should parse text colors with arbitrary 3-digit hex values",function(){(0,_vitest.expect)((0,_colors.parseColor)("text-[#f00]")).toEqual({color:"#ff0000"});(0,_vitest.expect)((0,_colors.parseColor)("text-[#abc]")).toEqual({color:"#aabbcc"});(0,_vitest.expect)((0,_colors.parseColor)("text-[#000]")).toEqual({color:"#000000"});});(0,_vitest.it)("should parse text colors with arbitrary 8-digit hex values (with alpha)",function(){(0,_vitest.expect)((0,_colors.parseColor)("text-[#ff0000aa]")).toEqual({color:"#ff0000aa"});(0,_vitest.expect)((0,_colors.parseColor)("text-[#00000080]")).toEqual({color:"#00000080"});});});(0,_vitest.describe)("parseColor - border colors",function(){(0,_vitest.it)("should parse border colors with preset values",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-blue-500")).toEqual({borderColor:"#3B82F6"});(0,_vitest.expect)((0,_colors.parseColor)("border-red-500")).toEqual({borderColor:"#EF4444"});(0,_vitest.expect)((0,_colors.parseColor)("border-green-500")).toEqual({borderColor:"#22C55E"});(0,_vitest.expect)((0,_colors.parseColor)("border-gray-200")).toEqual({borderColor:"#E5E7EB"});});(0,_vitest.it)("should parse border colors with basic values",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-white")).toEqual({borderColor:"#FFFFFF"});(0,_vitest.expect)((0,_colors.parseColor)("border-black")).toEqual({borderColor:"#000000"});(0,_vitest.expect)((0,_colors.parseColor)("border-transparent")).toEqual({borderColor:"transparent"});});(0,_vitest.it)("should parse border colors with arbitrary 6-digit hex values",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-[#ff0000]")).toEqual({borderColor:"#ff0000"});(0,_vitest.expect)((0,_colors.parseColor)("border-[#3B82F6]")).toEqual({borderColor:"#3B82F6"});(0,_vitest.expect)((0,_colors.parseColor)("border-[#cccccc]")).toEqual({borderColor:"#cccccc"});});(0,_vitest.it)("should parse border colors with arbitrary 3-digit hex values",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-[#f00]")).toEqual({borderColor:"#ff0000"});(0,_vitest.expect)((0,_colors.parseColor)("border-[#abc]")).toEqual({borderColor:"#aabbcc"});(0,_vitest.expect)((0,_colors.parseColor)("border-[#999]")).toEqual({borderColor:"#999999"});});(0,_vitest.it)("should parse border colors with arbitrary 8-digit hex values (with alpha)",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-[#ff0000aa]")).toEqual({borderColor:"#ff0000aa"});(0,_vitest.expect)((0,_colors.parseColor)("border-[#0000FF50]")).toEqual({borderColor:"#0000FF50"});});(0,_vitest.it)("should not match border width classes",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-0")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("border-2")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("border-4")).toBeNull();});});(0,_vitest.describe)("parseColor - custom colors",function(){var customColors={"brand-primary":"#FF6B6B","brand-secondary":"#4ECDC4",accent:"#FFE66D"};(0,_vitest.it)("should support custom background colors",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-brand-primary",customColors)).toEqual({backgroundColor:"#FF6B6B"});(0,_vitest.expect)((0,_colors.parseColor)("bg-brand-secondary",customColors)).toEqual({backgroundColor:"#4ECDC4"});(0,_vitest.expect)((0,_colors.parseColor)("bg-accent",customColors)).toEqual({backgroundColor:"#FFE66D"});});(0,_vitest.it)("should support custom text colors",function(){(0,_vitest.expect)((0,_colors.parseColor)("text-brand-primary",customColors)).toEqual({color:"#FF6B6B"});(0,_vitest.expect)((0,_colors.parseColor)("text-brand-secondary",customColors)).toEqual({color:"#4ECDC4"});});(0,_vitest.it)("should support custom border colors",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-brand-primary",customColors)).toEqual({borderColor:"#FF6B6B"});(0,_vitest.expect)((0,_colors.parseColor)("border-accent",customColors)).toEqual({borderColor:"#FFE66D"});});(0,_vitest.it)("should allow custom colors to override preset colors",function(){var overrideColors={"blue-500":"#FF0000"};(0,_vitest.expect)((0,_colors.parseColor)("bg-blue-500",overrideColors)).toEqual({backgroundColor:"#FF0000"});});(0,_vitest.it)("should fallback to preset colors when custom color not found",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-red-500",customColors)).toEqual({backgroundColor:"#EF4444"});});});(0,_vitest.describe)("parseColor - edge cases",function(){(0,_vitest.it)("should return null for invalid classes",function(){(0,_vitest.expect)((0,_colors.parseColor)("invalid")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("bg")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("text")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("border")).toBeNull();});(0,_vitest.it)("should return null for invalid color values",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-invalid")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("text-notacolor")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("border-xyz")).toBeNull();});(0,_vitest.it)("should return null for invalid arbitrary hex values",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-[#ff]")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("bg-[#ffff]")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("bg-[#fffff]")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("bg-[#fffffff]")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("bg-[#fffffffff]")).toBeNull();});(0,_vitest.it)("should return null for malformed arbitrary values",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-[#ff0000")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("bg-#ff0000]")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("bg-[]")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("bg-[ff0000]")).toBeNull();});(0,_vitest.it)("should return null for non-hex arbitrary values",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-[#gggggg]")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("bg-[#zzzzzz]")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("bg-[rgb(255,0,0)]")).toBeNull();});(0,_vitest.it)("should not match partial class names",function(){(0,_vitest.expect)((0,_colors.parseColor)("background-blue-500")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("textcolor-red-500")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("border-color-blue-500")).toBeNull();});(0,_vitest.it)("should handle all color scale variants",function(){var scales=["50","100","200","300","400","500","600","700","800","900"];scales.forEach(function(scale){(0,_vitest.expect)((0,_colors.parseColor)(`bg-blue-${scale}`)).toBeTruthy();(0,_vitest.expect)((0,_colors.parseColor)(`text-red-${scale}`)).toBeTruthy();(0,_vitest.expect)((0,_colors.parseColor)(`border-green-${scale}`)).toBeTruthy();});});});(0,_vitest.describe)("parseColor - comprehensive coverage",function(){(0,_vitest.it)("should parse all color types with same preset color",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-blue-500")).toEqual({backgroundColor:"#3B82F6"});(0,_vitest.expect)((0,_colors.parseColor)("text-blue-500")).toEqual({color:"#3B82F6"});(0,_vitest.expect)((0,_colors.parseColor)("border-blue-500")).toEqual({borderColor:"#3B82F6"});});(0,_vitest.it)("should parse all color types with same arbitrary hex",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-[#ff0000]")).toEqual({backgroundColor:"#ff0000"});(0,_vitest.expect)((0,_colors.parseColor)("text-[#ff0000]")).toEqual({color:"#ff0000"});(0,_vitest.expect)((0,_colors.parseColor)("border-[#ff0000]")).toEqual({borderColor:"#ff0000"});});(0,_vitest.it)("should handle all color families",function(){var families=["gray","red","blue","green","yellow","purple","pink","orange","indigo"];families.forEach(function(family){(0,_vitest.expect)((0,_colors.parseColor)(`bg-${family}-500`)).toBeTruthy();(0,_vitest.expect)((0,_colors.parseColor)(`text-${family}-500`)).toBeTruthy();(0,_vitest.expect)((0,_colors.parseColor)(`border-${family}-500`)).toBeTruthy();});});(0,_vitest.it)("should handle arbitrary values with mixed case",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-[#AbCdEf]")).toEqual({backgroundColor:"#AbCdEf"});(0,_vitest.expect)((0,_colors.parseColor)("text-[#aBcDeF]")).toEqual({color:"#aBcDeF"});(0,_vitest.expect)((0,_colors.parseColor)("border-[#ABCDEF]")).toEqual({borderColor:"#ABCDEF"});});(0,_vitest.it)("should expand 3-digit hex consistently across all color types",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-[#abc]")).toEqual({backgroundColor:"#aabbcc"});(0,_vitest.expect)((0,_colors.parseColor)("text-[#abc]")).toEqual({color:"#aabbcc"});(0,_vitest.expect)((0,_colors.parseColor)("border-[#abc]")).toEqual({borderColor:"#aabbcc"});});(0,_vitest.it)("should handle alpha channel consistently across all color types",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-[#ff0000aa]")).toEqual({backgroundColor:"#ff0000aa"});(0,_vitest.expect)((0,_colors.parseColor)("text-[#ff0000aa]")).toEqual({color:"#ff0000aa"});(0,_vitest.expect)((0,_colors.parseColor)("border-[#ff0000aa]")).toEqual({borderColor:"#ff0000aa"});});});(0,_vitest.describe)("parseColor - opacity modifiers",function(){(0,_vitest.it)("should parse background colors with opacity modifiers",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-black/50")).toEqual({backgroundColor:"#00000080"});(0,_vitest.expect)((0,_colors.parseColor)("bg-white/50")).toEqual({backgroundColor:"#FFFFFF80"});(0,_vitest.expect)((0,_colors.parseColor)("bg-blue-500/80")).toEqual({backgroundColor:"#3B82F6CC"});(0,_vitest.expect)((0,_colors.parseColor)("bg-red-500/30")).toEqual({backgroundColor:"#EF44444D"});});(0,_vitest.it)("should parse text colors with opacity modifiers",function(){(0,_vitest.expect)((0,_colors.parseColor)("text-black/80")).toEqual({color:"#000000CC"});(0,_vitest.expect)((0,_colors.parseColor)("text-white/90")).toEqual({color:"#FFFFFFE6"});(0,_vitest.expect)((0,_colors.parseColor)("text-gray-900/70")).toEqual({color:"#111827B3"});(0,_vitest.expect)((0,_colors.parseColor)("text-blue-500/50")).toEqual({color:"#3B82F680"});});(0,_vitest.it)("should parse border colors with opacity modifiers",function(){(0,_vitest.expect)((0,_colors.parseColor)("border-black/25")).toEqual({borderColor:"#00000040"});(0,_vitest.expect)((0,_colors.parseColor)("border-red-500/60")).toEqual({borderColor:"#EF444499"});(0,_vitest.expect)((0,_colors.parseColor)("border-gray-200/40")).toEqual({borderColor:"#E5E7EB66"});});(0,_vitest.it)("should handle opacity modifier with arbitrary hex colors",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-[#ff0000]/50")).toEqual({backgroundColor:"#FF000080"});(0,_vitest.expect)((0,_colors.parseColor)("text-[#3B82F6]/80")).toEqual({color:"#3B82F6CC"});(0,_vitest.expect)((0,_colors.parseColor)("border-[#abc]/60")).toEqual({borderColor:"#AABBCC99"});});(0,_vitest.it)("should handle opacity modifier with custom colors",function(){var customColors={"brand-primary":"#FF6B6B"};(0,_vitest.expect)((0,_colors.parseColor)("bg-brand-primary/50",customColors)).toEqual({backgroundColor:"#FF6B6B80"});(0,_vitest.expect)((0,_colors.parseColor)("text-brand-primary/75",customColors)).toEqual({color:"#FF6B6BBF"});});(0,_vitest.it)("should handle opacity 0 (fully transparent)",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-black/0")).toEqual({backgroundColor:"#00000000"});(0,_vitest.expect)((0,_colors.parseColor)("text-red-500/0")).toEqual({color:"#EF444400"});});(0,_vitest.it)("should handle opacity 100 (fully opaque)",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-black/100")).toEqual({backgroundColor:"#000000FF"});(0,_vitest.expect)((0,_colors.parseColor)("text-blue-500/100")).toEqual({color:"#3B82F6FF"});});(0,_vitest.it)("should handle transparent color with opacity modifier",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-transparent/50")).toEqual({backgroundColor:"transparent"});});(0,_vitest.it)("should convert opacity percentage to correct hex values",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-black/0")).toEqual({backgroundColor:"#00000000"});(0,_vitest.expect)((0,_colors.parseColor)("bg-black/10")).toEqual({backgroundColor:"#0000001A"});(0,_vitest.expect)((0,_colors.parseColor)("bg-black/25")).toEqual({backgroundColor:"#00000040"});(0,_vitest.expect)((0,_colors.parseColor)("bg-black/50")).toEqual({backgroundColor:"#00000080"});(0,_vitest.expect)((0,_colors.parseColor)("bg-black/75")).toEqual({backgroundColor:"#000000BF"});(0,_vitest.expect)((0,_colors.parseColor)("bg-black/100")).toEqual({backgroundColor:"#000000FF"});});(0,_vitest.it)("should return null for invalid opacity values",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-black/101")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("bg-black/-1")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("bg-black/150")).toBeNull();});(0,_vitest.it)("should return null for malformed opacity syntax",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-black/")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("bg-black/abc")).toBeNull();(0,_vitest.expect)((0,_colors.parseColor)("bg-black/50/")).toBeNull();});(0,_vitest.it)("should handle opacity with 3-digit hex expansion",function(){(0,_vitest.expect)((0,_colors.parseColor)("bg-[#f00]/50")).toEqual({backgroundColor:"#FF000080"});(0,_vitest.expect)((0,_colors.parseColor)("text-[#abc]/75")).toEqual({color:"#AABBCCBF"});});(0,_vitest.it)("should work with all color families",function(){var families=["gray","red","blue","green","yellow","purple","pink","orange","indigo"];families.forEach(function(family){(0,_vitest.expect)((0,_colors.parseColor)(`bg-${family}-500/50`)).toBeTruthy();(0,_vitest.expect)((0,_colors.parseColor)(`text-${family}-500/50`)).toBeTruthy();(0,_vitest.expect)((0,_colors.parseColor)(`border-${family}-500/50`)).toBeTruthy();});});});
@@ -17,9 +17,13 @@ export declare function parseClassName(className: string, customColors?: Record<
17
17
  * @returns React Native style object
18
18
  */
19
19
  export declare function parseClass(cls: string, customColors?: Record<string, string>): StyleObject;
20
+ export { parseAspectRatio } from "./aspectRatio";
20
21
  export { parseBorder } from "./borders";
21
22
  export { parseColor } from "./colors";
22
23
  export { parseLayout } from "./layout";
24
+ export { parseShadow } from "./shadows";
23
25
  export { parseSizing } from "./sizing";
24
26
  export { parseSpacing } from "./spacing";
25
27
  export { parseTypography } from "./typography";
28
+ export { hasModifier, parseModifier, splitModifierClasses } from "./modifiers";
29
+ export type { ModifierType, ParsedModifier } from "./modifiers";
@@ -1 +1 @@
1
- Object.defineProperty(exports,"__esModule",{value:true});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,"parseSizing",{enumerable:true,get:function get(){return _sizing.parseSizing;}});Object.defineProperty(exports,"parseSpacing",{enumerable:true,get:function get(){return _spacing.parseSpacing;}});Object.defineProperty(exports,"parseTypography",{enumerable:true,get:function get(){return _typography.parseTypography;}});var _borders=require("./borders");var _colors=require("./colors");var _layout=require("./layout");var _sizing=require("./sizing");var _spacing=require("./spacing");var _typography=require("./typography");function parseClassName(className,customColors){var classes=className.split(/\s+/).filter(Boolean);var style={};for(var cls of classes){var parsedStyle=parseClass(cls,customColors);Object.assign(style,parsedStyle);}return style;}function parseClass(cls,customColors){var parsers=[_spacing.parseSpacing,function(cls){return(0,_colors.parseColor)(cls,customColors);},_layout.parseLayout,_typography.parseTypography,_borders.parseBorder,_sizing.parseSizing];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,"hasModifier",{enumerable:true,get:function get(){return _modifiers.hasModifier;}});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,"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,"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 _typography=require("./typography");var _modifiers=require("./modifiers");function parseClassName(className,customColors){var classes=className.split(/\s+/).filter(Boolean);var style={};for(var cls of classes){var parsedStyle=parseClass(cls,customColors);Object.assign(style,parsedStyle);}return style;}function parseClass(cls,customColors){var parsers=[_spacing.parseSpacing,_borders.parseBorder,function(cls){return(0,_colors.parseColor)(cls,customColors);},_layout.parseLayout,_typography.parseTypography,_sizing.parseSizing,_shadows.parseShadow,_aspectRatio.parseAspectRatio];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{};}
@@ -2,6 +2,8 @@
2
2
  * Layout utilities (flexbox, positioning, display)
3
3
  */
4
4
  import type { StyleObject } from "../types";
5
+ export declare const Z_INDEX_SCALE: Record<string, number>;
6
+ export declare const INSET_SCALE: Record<string, number>;
5
7
  /**
6
8
  * Parse layout classes
7
9
  */
@@ -1 +1 @@
1
- Object.defineProperty(exports,"__esModule",{value:true});exports.parseLayout=parseLayout;var DISPLAY_MAP={flex:{display:"flex"},hidden:{display:"none"}};var FLEX_DIRECTION_MAP={"flex-row":{flexDirection:"row"},"flex-row-reverse":{flexDirection:"row-reverse"},"flex-col":{flexDirection:"column"},"flex-col-reverse":{flexDirection:"column-reverse"}};var FLEX_WRAP_MAP={"flex-wrap":{flexWrap:"wrap"},"flex-wrap-reverse":{flexWrap:"wrap-reverse"},"flex-nowrap":{flexWrap:"nowrap"}};var FLEX_MAP={"flex-1":{flex:1},"flex-auto":{flex:1},"flex-none":{flex:0}};var GROW_SHRINK_MAP={grow:{flexGrow:1},"grow-0":{flexGrow:0},shrink:{flexShrink:1},"shrink-0":{flexShrink:0}};var JUSTIFY_CONTENT_MAP={"justify-start":{justifyContent:"flex-start"},"justify-end":{justifyContent:"flex-end"},"justify-center":{justifyContent:"center"},"justify-between":{justifyContent:"space-between"},"justify-around":{justifyContent:"space-around"},"justify-evenly":{justifyContent:"space-evenly"}};var ALIGN_ITEMS_MAP={"items-start":{alignItems:"flex-start"},"items-end":{alignItems:"flex-end"},"items-center":{alignItems:"center"},"items-baseline":{alignItems:"baseline"},"items-stretch":{alignItems:"stretch"}};var ALIGN_SELF_MAP={"self-auto":{alignSelf:"auto"},"self-start":{alignSelf:"flex-start"},"self-end":{alignSelf:"flex-end"},"self-center":{alignSelf:"center"},"self-stretch":{alignSelf:"stretch"},"self-baseline":{alignSelf:"baseline"}};var ALIGN_CONTENT_MAP={"content-start":{alignContent:"flex-start"},"content-end":{alignContent:"flex-end"},"content-center":{alignContent:"center"},"content-between":{alignContent:"space-between"},"content-around":{alignContent:"space-around"},"content-stretch":{alignContent:"stretch"}};var POSITION_MAP={absolute:{position:"absolute"},relative:{position:"relative"}};var OVERFLOW_MAP={"overflow-hidden":{overflow:"hidden"},"overflow-visible":{overflow:"visible"},"overflow-scroll":{overflow:"scroll"}};function parseLayout(cls){var _ref,_ref2,_ref3,_ref4,_ref5,_ref6,_ref7,_ref8,_ref9,_ref0,_DISPLAY_MAP$cls;return(_ref=(_ref2=(_ref3=(_ref4=(_ref5=(_ref6=(_ref7=(_ref8=(_ref9=(_ref0=(_DISPLAY_MAP$cls=DISPLAY_MAP[cls])!=null?_DISPLAY_MAP$cls:FLEX_DIRECTION_MAP[cls])!=null?_ref0:FLEX_WRAP_MAP[cls])!=null?_ref9:FLEX_MAP[cls])!=null?_ref8:GROW_SHRINK_MAP[cls])!=null?_ref7:JUSTIFY_CONTENT_MAP[cls])!=null?_ref6:ALIGN_ITEMS_MAP[cls])!=null?_ref5:ALIGN_SELF_MAP[cls])!=null?_ref4:ALIGN_CONTENT_MAP[cls])!=null?_ref3:POSITION_MAP[cls])!=null?_ref2:OVERFLOW_MAP[cls])!=null?_ref:null;}
1
+ Object.defineProperty(exports,"__esModule",{value:true});exports.Z_INDEX_SCALE=exports.INSET_SCALE=void 0;exports.parseLayout=parseLayout;var DISPLAY_MAP={flex:{display:"flex"},hidden:{display:"none"}};var FLEX_DIRECTION_MAP={"flex-row":{flexDirection:"row"},"flex-row-reverse":{flexDirection:"row-reverse"},"flex-col":{flexDirection:"column"},"flex-col-reverse":{flexDirection:"column-reverse"}};var FLEX_WRAP_MAP={"flex-wrap":{flexWrap:"wrap"},"flex-wrap-reverse":{flexWrap:"wrap-reverse"},"flex-nowrap":{flexWrap:"nowrap"}};var FLEX_MAP={"flex-1":{flex:1},"flex-auto":{flex:1},"flex-none":{flex:0}};var GROW_SHRINK_MAP={grow:{flexGrow:1},"grow-0":{flexGrow:0},shrink:{flexShrink:1},"shrink-0":{flexShrink:0}};var JUSTIFY_CONTENT_MAP={"justify-start":{justifyContent:"flex-start"},"justify-end":{justifyContent:"flex-end"},"justify-center":{justifyContent:"center"},"justify-between":{justifyContent:"space-between"},"justify-around":{justifyContent:"space-around"},"justify-evenly":{justifyContent:"space-evenly"}};var ALIGN_ITEMS_MAP={"items-start":{alignItems:"flex-start"},"items-end":{alignItems:"flex-end"},"items-center":{alignItems:"center"},"items-baseline":{alignItems:"baseline"},"items-stretch":{alignItems:"stretch"}};var ALIGN_SELF_MAP={"self-auto":{alignSelf:"auto"},"self-start":{alignSelf:"flex-start"},"self-end":{alignSelf:"flex-end"},"self-center":{alignSelf:"center"},"self-stretch":{alignSelf:"stretch"},"self-baseline":{alignSelf:"baseline"}};var ALIGN_CONTENT_MAP={"content-start":{alignContent:"flex-start"},"content-end":{alignContent:"flex-end"},"content-center":{alignContent:"center"},"content-between":{alignContent:"space-between"},"content-around":{alignContent:"space-around"},"content-stretch":{alignContent:"stretch"}};var POSITION_MAP={absolute:{position:"absolute"},relative:{position:"relative"}};var OVERFLOW_MAP={"overflow-hidden":{overflow:"hidden"},"overflow-visible":{overflow:"visible"},"overflow-scroll":{overflow:"scroll"}};var 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,_DISPLAY_MAP$cls;if(cls.startsWith("z-")){var zKey=cls.substring(2);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 topValue=INSET_SCALE[topKey];if(topValue!==undefined){return{top:topValue};}}if(cls.startsWith("right-")){var rightKey=cls.substring(6);if(rightKey==="auto"){return{};}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 bottomValue=INSET_SCALE[bottomKey];if(bottomValue!==undefined){return{bottom:bottomValue};}}if(cls.startsWith("left-")){var leftKey=cls.substring(5);if(leftKey==="auto"){return{};}var leftValue=INSET_SCALE[leftKey];if(leftValue!==undefined){return{left:leftValue};}}if(cls.startsWith("inset-")){var insetKey=cls.substring(6);var insetValue=INSET_SCALE[insetKey];if(insetValue!==undefined){return{top:insetValue,right:insetValue,bottom:insetValue,left:insetValue};}}if(cls.startsWith("inset-x-")){var _insetKey=cls.substring(8);var _insetValue=INSET_SCALE[_insetKey];if(_insetValue!==undefined){return{left:_insetValue,right:_insetValue};}}if(cls.startsWith("inset-y-")){var _insetKey2=cls.substring(8);var _insetValue2=INSET_SCALE[_insetKey2];if(_insetValue2!==undefined){return{top:_insetValue2,bottom:_insetValue2};}}return(_ref=(_ref2=(_ref3=(_ref4=(_ref5=(_ref6=(_ref7=(_ref8=(_ref9=(_ref0=(_DISPLAY_MAP$cls=DISPLAY_MAP[cls])!=null?_DISPLAY_MAP$cls:FLEX_DIRECTION_MAP[cls])!=null?_ref0:FLEX_WRAP_MAP[cls])!=null?_ref9:FLEX_MAP[cls])!=null?_ref8:GROW_SHRINK_MAP[cls])!=null?_ref7:JUSTIFY_CONTENT_MAP[cls])!=null?_ref6:ALIGN_ITEMS_MAP[cls])!=null?_ref5:ALIGN_SELF_MAP[cls])!=null?_ref4:ALIGN_CONTENT_MAP[cls])!=null?_ref3:POSITION_MAP[cls])!=null?_ref2:OVERFLOW_MAP[cls])!=null?_ref:null;}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +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");});});
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Modifier parsing utilities for state-based class names (active:, hover:, focus:)
3
+ */
4
+ export type ModifierType = "active" | "hover" | "focus" | "disabled";
5
+ export type ParsedModifier = {
6
+ modifier: ModifierType;
7
+ baseClass: string;
8
+ };
9
+ /**
10
+ * Parse a class name to detect and extract modifiers
11
+ *
12
+ * @param cls - Class name to parse (e.g., "active:bg-blue-500")
13
+ * @returns ParsedModifier if modifier found, null otherwise
14
+ *
15
+ * @example
16
+ * parseModifier("active:bg-blue-500") // { modifier: "active", baseClass: "bg-blue-500" }
17
+ * parseModifier("bg-blue-500") // null
18
+ * parseModifier("hover:focus:bg-blue-500") // null (nested modifiers not supported)
19
+ */
20
+ export declare function parseModifier(cls: string): ParsedModifier | null;
21
+ /**
22
+ * Check if a class name contains a modifier
23
+ *
24
+ * @param cls - Class name to check
25
+ * @returns true if class has a supported modifier prefix
26
+ */
27
+ export declare function hasModifier(cls: string): boolean;
28
+ /**
29
+ * Split a space-separated className string into base and modifier classes
30
+ *
31
+ * @param className - Space-separated class names
32
+ * @returns Object with baseClasses and modifierClasses arrays
33
+ *
34
+ * @example
35
+ * splitModifierClasses("bg-blue-500 active:bg-blue-700 p-4 active:p-6")
36
+ * // {
37
+ * // baseClasses: ["bg-blue-500", "p-4"],
38
+ * // modifierClasses: [
39
+ * // { modifier: "active", baseClass: "bg-blue-700" },
40
+ * // { modifier: "active", baseClass: "p-6" }
41
+ * // ]
42
+ * // }
43
+ */
44
+ export declare function splitModifierClasses(className: string): {
45
+ baseClasses: string[];
46
+ modifierClasses: ParsedModifier[];
47
+ };
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,"__esModule",{value:true});exports.hasModifier=hasModifier;exports.parseModifier=parseModifier;exports.splitModifierClasses=splitModifierClasses;var SUPPORTED_MODIFIERS=["active","hover","focus","disabled"];function parseModifier(cls){var colonIndex=cls.indexOf(":");if(colonIndex===-1){return null;}var potentialModifier=cls.slice(0,colonIndex);var baseClass=cls.slice(colonIndex+1);if(!SUPPORTED_MODIFIERS.includes(potentialModifier)){return null;}if(baseClass.includes(":")){return null;}if(!baseClass){return null;}return{modifier:potentialModifier,baseClass:baseClass};}function hasModifier(cls){return parseModifier(cls)!==null;}function splitModifierClasses(className){var classes=className.trim().split(/\s+/).filter(Boolean);var baseClasses=[];var modifierClasses=[];for(var cls of classes){var parsed=parseModifier(cls);if(parsed){modifierClasses.push(parsed);}else{baseClasses.push(cls);}}return{baseClasses:baseClasses,modifierClasses:modifierClasses};}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ var _vitest=require("vitest");var _modifiers=require("./modifiers");(0,_vitest.describe)("parseModifier - basic functionality",function(){(0,_vitest.it)("should parse active modifier",function(){var result=(0,_modifiers.parseModifier)("active:bg-blue-500");(0,_vitest.expect)(result).toEqual({modifier:"active",baseClass:"bg-blue-500"});});(0,_vitest.it)("should parse hover modifier",function(){var result=(0,_modifiers.parseModifier)("hover:text-red-500");(0,_vitest.expect)(result).toEqual({modifier:"hover",baseClass:"text-red-500"});});(0,_vitest.it)("should parse focus modifier",function(){var result=(0,_modifiers.parseModifier)("focus:border-green-500");(0,_vitest.expect)(result).toEqual({modifier:"focus",baseClass:"border-green-500"});});(0,_vitest.it)("should parse disabled modifier",function(){var result=(0,_modifiers.parseModifier)("disabled:bg-gray-400");(0,_vitest.expect)(result).toEqual({modifier:"disabled",baseClass:"bg-gray-400"});});(0,_vitest.it)("should return null for class without modifier",function(){(0,_vitest.expect)((0,_modifiers.parseModifier)("bg-blue-500")).toBeNull();(0,_vitest.expect)((0,_modifiers.parseModifier)("text-red-500")).toBeNull();(0,_vitest.expect)((0,_modifiers.parseModifier)("p-4")).toBeNull();});});(0,_vitest.describe)("parseModifier - various base classes",function(){(0,_vitest.it)("should parse modifiers with spacing classes",function(){(0,_vitest.expect)((0,_modifiers.parseModifier)("active:m-4")).toEqual({modifier:"active",baseClass:"m-4"});(0,_vitest.expect)((0,_modifiers.parseModifier)("hover:p-8")).toEqual({modifier:"hover",baseClass:"p-8"});});(0,_vitest.it)("should parse modifiers with layout classes",function(){(0,_vitest.expect)((0,_modifiers.parseModifier)("active:flex")).toEqual({modifier:"active",baseClass:"flex"});(0,_vitest.expect)((0,_modifiers.parseModifier)("focus:absolute")).toEqual({modifier:"focus",baseClass:"absolute"});});(0,_vitest.it)("should parse modifiers with typography classes",function(){(0,_vitest.expect)((0,_modifiers.parseModifier)("hover:text-lg")).toEqual({modifier:"hover",baseClass:"text-lg"});(0,_vitest.expect)((0,_modifiers.parseModifier)("active:font-bold")).toEqual({modifier:"active",baseClass:"font-bold"});});(0,_vitest.it)("should parse modifiers with arbitrary values",function(){(0,_vitest.expect)((0,_modifiers.parseModifier)("active:bg-[#ff0000]")).toEqual({modifier:"active",baseClass:"bg-[#ff0000]"});(0,_vitest.expect)((0,_modifiers.parseModifier)("hover:w-[100px]")).toEqual({modifier:"hover",baseClass:"w-[100px]"});});(0,_vitest.it)("should parse modifiers with complex class names",function(){(0,_vitest.expect)((0,_modifiers.parseModifier)("active:inset-x-4")).toEqual({modifier:"active",baseClass:"inset-x-4"});(0,_vitest.expect)((0,_modifiers.parseModifier)("focus:border-blue-500")).toEqual({modifier:"focus",baseClass:"border-blue-500"});});});(0,_vitest.describe)("parseModifier - edge cases",function(){(0,_vitest.it)("should return null for unsupported modifiers",function(){(0,_vitest.expect)((0,_modifiers.parseModifier)("selected:bg-blue-500")).toBeNull();(0,_vitest.expect)((0,_modifiers.parseModifier)("pressed:bg-red-500")).toBeNull();(0,_vitest.expect)((0,_modifiers.parseModifier)("custom:bg-green-500")).toBeNull();(0,_vitest.expect)((0,_modifiers.parseModifier)("unknown:bg-gray-500")).toBeNull();});(0,_vitest.it)("should return null for nested modifiers",function(){(0,_vitest.expect)((0,_modifiers.parseModifier)("active:hover:bg-blue-500")).toBeNull();(0,_vitest.expect)((0,_modifiers.parseModifier)("hover:focus:text-red-500")).toBeNull();(0,_vitest.expect)((0,_modifiers.parseModifier)("focus:active:p-4")).toBeNull();});(0,_vitest.it)("should return null for empty base class",function(){(0,_vitest.expect)((0,_modifiers.parseModifier)("active:")).toBeNull();(0,_vitest.expect)((0,_modifiers.parseModifier)("hover:")).toBeNull();(0,_vitest.expect)((0,_modifiers.parseModifier)("focus:")).toBeNull();});(0,_vitest.it)("should return null for empty modifier",function(){(0,_vitest.expect)((0,_modifiers.parseModifier)(":bg-blue-500")).toBeNull();(0,_vitest.expect)((0,_modifiers.parseModifier)(":")).toBeNull();});(0,_vitest.it)("should return null for class with only colon",function(){(0,_vitest.expect)((0,_modifiers.parseModifier)(":")).toBeNull();});(0,_vitest.it)("should return null for class with multiple colons but no modifier",function(){(0,_vitest.expect)((0,_modifiers.parseModifier)("bg:blue:500")).toBeNull();});(0,_vitest.it)("should handle base classes that look like they have colons",function(){(0,_vitest.expect)((0,_modifiers.parseModifier)("active:some:thing")).toBeNull();});(0,_vitest.it)("should return null for empty string",function(){(0,_vitest.expect)((0,_modifiers.parseModifier)("")).toBeNull();});});(0,_vitest.describe)("parseModifier - case sensitivity",function(){(0,_vitest.it)("should be case-sensitive for modifiers",function(){(0,_vitest.expect)((0,_modifiers.parseModifier)("Active:bg-blue-500")).toBeNull();(0,_vitest.expect)((0,_modifiers.parseModifier)("ACTIVE:bg-blue-500")).toBeNull();(0,_vitest.expect)((0,_modifiers.parseModifier)("Hover:text-red-500")).toBeNull();(0,_vitest.expect)((0,_modifiers.parseModifier)("FOCUS:border-green-500")).toBeNull();});(0,_vitest.it)("should preserve case in base class",function(){var result=(0,_modifiers.parseModifier)("active:bg-Blue-500");(0,_vitest.expect)(result).toEqual({modifier:"active",baseClass:"bg-Blue-500"});});});(0,_vitest.describe)("hasModifier",function(){(0,_vitest.it)("should return true for classes with modifiers",function(){(0,_vitest.expect)((0,_modifiers.hasModifier)("active:bg-blue-500")).toBe(true);(0,_vitest.expect)((0,_modifiers.hasModifier)("hover:text-red-500")).toBe(true);(0,_vitest.expect)((0,_modifiers.hasModifier)("focus:border-green-500")).toBe(true);(0,_vitest.expect)((0,_modifiers.hasModifier)("disabled:bg-gray-400")).toBe(true);});(0,_vitest.it)("should return false for classes without modifiers",function(){(0,_vitest.expect)((0,_modifiers.hasModifier)("bg-blue-500")).toBe(false);(0,_vitest.expect)((0,_modifiers.hasModifier)("text-red-500")).toBe(false);(0,_vitest.expect)((0,_modifiers.hasModifier)("p-4")).toBe(false);});(0,_vitest.it)("should return false for unsupported modifiers",function(){(0,_vitest.expect)((0,_modifiers.hasModifier)("selected:bg-gray-500")).toBe(false);(0,_vitest.expect)((0,_modifiers.hasModifier)("pressed:bg-blue-500")).toBe(false);});(0,_vitest.it)("should return false for nested modifiers",function(){(0,_vitest.expect)((0,_modifiers.hasModifier)("active:hover:bg-blue-500")).toBe(false);});(0,_vitest.it)("should return false for empty base class",function(){(0,_vitest.expect)((0,_modifiers.hasModifier)("active:")).toBe(false);});(0,_vitest.it)("should return false for empty string",function(){(0,_vitest.expect)((0,_modifiers.hasModifier)("")).toBe(false);});});(0,_vitest.describe)("splitModifierClasses - basic functionality",function(){(0,_vitest.it)("should split classes with and without modifiers",function(){var result=(0,_modifiers.splitModifierClasses)("bg-blue-500 active:bg-blue-700");(0,_vitest.expect)(result).toEqual({baseClasses:["bg-blue-500"],modifierClasses:[{modifier:"active",baseClass:"bg-blue-700"}]});});(0,_vitest.it)("should handle multiple base classes",function(){var result=(0,_modifiers.splitModifierClasses)("bg-blue-500 p-4 m-2 text-white");(0,_vitest.expect)(result).toEqual({baseClasses:["bg-blue-500","p-4","m-2","text-white"],modifierClasses:[]});});(0,_vitest.it)("should handle multiple modifier classes",function(){var result=(0,_modifiers.splitModifierClasses)("active:bg-blue-700 hover:bg-blue-800 focus:bg-blue-900");(0,_vitest.expect)(result).toEqual({baseClasses:[],modifierClasses:[{modifier:"active",baseClass:"bg-blue-700"},{modifier:"hover",baseClass:"bg-blue-800"},{modifier:"focus",baseClass:"bg-blue-900"}]});});(0,_vitest.it)("should handle mixed base and modifier classes",function(){var result=(0,_modifiers.splitModifierClasses)("bg-blue-500 active:bg-blue-700 p-4 active:p-6");(0,_vitest.expect)(result).toEqual({baseClasses:["bg-blue-500","p-4"],modifierClasses:[{modifier:"active",baseClass:"bg-blue-700"},{modifier:"active",baseClass:"p-6"}]});});});(0,_vitest.describe)("splitModifierClasses - whitespace handling",function(){(0,_vitest.it)("should handle leading whitespace",function(){var result=(0,_modifiers.splitModifierClasses)(" bg-blue-500 active:bg-blue-700");(0,_vitest.expect)(result).toEqual({baseClasses:["bg-blue-500"],modifierClasses:[{modifier:"active",baseClass:"bg-blue-700"}]});});(0,_vitest.it)("should handle trailing whitespace",function(){var result=(0,_modifiers.splitModifierClasses)("bg-blue-500 active:bg-blue-700 ");(0,_vitest.expect)(result).toEqual({baseClasses:["bg-blue-500"],modifierClasses:[{modifier:"active",baseClass:"bg-blue-700"}]});});(0,_vitest.it)("should handle multiple spaces between classes",function(){var result=(0,_modifiers.splitModifierClasses)("bg-blue-500 active:bg-blue-700");(0,_vitest.expect)(result).toEqual({baseClasses:["bg-blue-500"],modifierClasses:[{modifier:"active",baseClass:"bg-blue-700"}]});});(0,_vitest.it)("should handle tabs and newlines",function(){var result=(0,_modifiers.splitModifierClasses)("bg-blue-500\tactive:bg-blue-700\np-4");(0,_vitest.expect)(result).toEqual({baseClasses:["bg-blue-500","p-4"],modifierClasses:[{modifier:"active",baseClass:"bg-blue-700"}]});});(0,_vitest.it)("should handle empty string",function(){var result=(0,_modifiers.splitModifierClasses)("");(0,_vitest.expect)(result).toEqual({baseClasses:[],modifierClasses:[]});});(0,_vitest.it)("should handle whitespace-only string",function(){var result=(0,_modifiers.splitModifierClasses)(" ");(0,_vitest.expect)(result).toEqual({baseClasses:[],modifierClasses:[]});});});(0,_vitest.describe)("splitModifierClasses - complex scenarios",function(){(0,_vitest.it)("should handle duplicate modifiers for same property",function(){var result=(0,_modifiers.splitModifierClasses)("active:bg-blue-700 active:bg-red-700");(0,_vitest.expect)(result).toEqual({baseClasses:[],modifierClasses:[{modifier:"active",baseClass:"bg-blue-700"},{modifier:"active",baseClass:"bg-red-700"}]});});(0,_vitest.it)("should handle all four modifier types",function(){var result=(0,_modifiers.splitModifierClasses)("bg-gray-500 active:bg-blue-700 hover:bg-green-700 focus:bg-red-700 disabled:bg-gray-400");(0,_vitest.expect)(result).toEqual({baseClasses:["bg-gray-500"],modifierClasses:[{modifier:"active",baseClass:"bg-blue-700"},{modifier:"hover",baseClass:"bg-green-700"},{modifier:"focus",baseClass:"bg-red-700"},{modifier:"disabled",baseClass:"bg-gray-400"}]});});(0,_vitest.it)("should ignore unsupported modifiers in the base classes",function(){var result=(0,_modifiers.splitModifierClasses)("bg-blue-500 pressed:bg-gray-500 active:bg-blue-700");(0,_vitest.expect)(result).toEqual({baseClasses:["bg-blue-500","pressed:bg-gray-500"],modifierClasses:[{modifier:"active",baseClass:"bg-blue-700"}]});});(0,_vitest.it)("should handle modifiers with arbitrary values",function(){var result=(0,_modifiers.splitModifierClasses)("bg-blue-500 active:bg-[#ff0000] hover:w-[200px]");(0,_vitest.expect)(result).toEqual({baseClasses:["bg-blue-500"],modifierClasses:[{modifier:"active",baseClass:"bg-[#ff0000]"},{modifier:"hover",baseClass:"w-[200px]"}]});});(0,_vitest.it)("should handle real-world className example",function(){var result=(0,_modifiers.splitModifierClasses)("flex items-center justify-center bg-blue-500 p-4 active:bg-blue-700 active:scale-95 hover:bg-blue-600");(0,_vitest.expect)(result).toEqual({baseClasses:["flex","items-center","justify-center","bg-blue-500","p-4"],modifierClasses:[{modifier:"active",baseClass:"bg-blue-700"},{modifier:"active",baseClass:"scale-95"},{modifier:"hover",baseClass:"bg-blue-600"}]});});});(0,_vitest.describe)("splitModifierClasses - nested modifiers",function(){(0,_vitest.it)("should ignore nested modifiers",function(){var result=(0,_modifiers.splitModifierClasses)("bg-blue-500 active:hover:bg-red-500");(0,_vitest.expect)(result).toEqual({baseClasses:["bg-blue-500","active:hover:bg-red-500"],modifierClasses:[]});});});(0,_vitest.describe)("type safety",function(){(0,_vitest.it)("should properly type modifier types",function(){var result=(0,_modifiers.parseModifier)("active:bg-blue-500");if(result){var modifier=result.modifier;(0,_vitest.expect)(["active","hover","focus","disabled"]).toContain(modifier);}});(0,_vitest.it)("should properly type ParsedModifier",function(){var result=(0,_modifiers.parseModifier)("hover:text-red-500");if(result){var parsed=result;(0,_vitest.expect)(parsed).toHaveProperty("modifier");(0,_vitest.expect)(parsed).toHaveProperty("baseClass");(0,_vitest.expect)(typeof parsed.modifier).toBe("string");(0,_vitest.expect)(typeof parsed.baseClass).toBe("string");}});});
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Shadow and elevation utilities for React Native
3
+ * iOS uses shadow* properties, Android uses elevation
4
+ */
5
+ import type { StyleObject } from "../types";
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
9
+ */
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;
20
+ /**
21
+ * Parse shadow classes
22
+ * @param cls - Class name to parse
23
+ * @returns Style object or null if not a shadow class
24
+ */
25
+ export declare function parseShadow(cls: string): StyleObject | null;
26
+ export { buildShadowScale, SHADOW_SCALE };
@@ -0,0 +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;}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +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();});});
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +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%"});});});
@@ -5,6 +5,6 @@ import type { StyleObject } from "../types";
5
5
  export declare const SPACING_SCALE: Record<string, number>;
6
6
  /**
7
7
  * Parse spacing classes (margin, padding, gap)
8
- * Examples: m-4, mx-2, mt-8, p-4, px-2, pt-8, gap-4
8
+ * Examples: m-4, mx-2, mt-8, p-4, px-2, pt-8, gap-4, m-[16px]
9
9
  */
10
10
  export declare function parseSpacing(cls: string): StyleObject | null;
@@ -1 +1 @@
1
- Object.defineProperty(exports,"__esModule",{value:true});exports.SPACING_SCALE=void 0;exports.parseSpacing=parseSpacing;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 parseSpacing(cls){if(cls.startsWith("m-")||cls.startsWith("m")){return parseMargin(cls);}if(cls.startsWith("p-")||cls.startsWith("p")){return parsePadding(cls);}if(cls.startsWith("gap-")){return parseGap(cls);}return null;}function parseMargin(cls){var allMatch=cls.match(/^m-(\d+(?:\.\d+)?)$/);if(allMatch){var value=SPACING_SCALE[allMatch[1]];if(value!==undefined){return{margin:value};}}var xMatch=cls.match(/^mx-(\d+(?:\.\d+)?)$/);if(xMatch){var _value=SPACING_SCALE[xMatch[1]];if(_value!==undefined){return{marginHorizontal:_value};}}var yMatch=cls.match(/^my-(\d+(?:\.\d+)?)$/);if(yMatch){var _value2=SPACING_SCALE[yMatch[1]];if(_value2!==undefined){return{marginVertical:_value2};}}var tMatch=cls.match(/^mt-(\d+(?:\.\d+)?)$/);if(tMatch){var _value3=SPACING_SCALE[tMatch[1]];if(_value3!==undefined){return{marginTop:_value3};}}var rMatch=cls.match(/^mr-(\d+(?:\.\d+)?)$/);if(rMatch){var _value4=SPACING_SCALE[rMatch[1]];if(_value4!==undefined){return{marginRight:_value4};}}var bMatch=cls.match(/^mb-(\d+(?:\.\d+)?)$/);if(bMatch){var _value5=SPACING_SCALE[bMatch[1]];if(_value5!==undefined){return{marginBottom:_value5};}}var lMatch=cls.match(/^ml-(\d+(?:\.\d+)?)$/);if(lMatch){var _value6=SPACING_SCALE[lMatch[1]];if(_value6!==undefined){return{marginLeft:_value6};}}return null;}function parsePadding(cls){var allMatch=cls.match(/^p-(\d+(?:\.\d+)?)$/);if(allMatch){var value=SPACING_SCALE[allMatch[1]];if(value!==undefined){return{padding:value};}}var xMatch=cls.match(/^px-(\d+(?:\.\d+)?)$/);if(xMatch){var _value7=SPACING_SCALE[xMatch[1]];if(_value7!==undefined){return{paddingHorizontal:_value7};}}var yMatch=cls.match(/^py-(\d+(?:\.\d+)?)$/);if(yMatch){var _value8=SPACING_SCALE[yMatch[1]];if(_value8!==undefined){return{paddingVertical:_value8};}}var tMatch=cls.match(/^pt-(\d+(?:\.\d+)?)$/);if(tMatch){var _value9=SPACING_SCALE[tMatch[1]];if(_value9!==undefined){return{paddingTop:_value9};}}var rMatch=cls.match(/^pr-(\d+(?:\.\d+)?)$/);if(rMatch){var _value0=SPACING_SCALE[rMatch[1]];if(_value0!==undefined){return{paddingRight:_value0};}}var bMatch=cls.match(/^pb-(\d+(?:\.\d+)?)$/);if(bMatch){var _value1=SPACING_SCALE[bMatch[1]];if(_value1!==undefined){return{paddingBottom:_value1};}}var lMatch=cls.match(/^pl-(\d+(?:\.\d+)?)$/);if(lMatch){var _value10=SPACING_SCALE[lMatch[1]];if(_value10!==undefined){return{paddingLeft:_value10};}}return null;}function parseGap(cls){var match=cls.match(/^gap-(\d+(?:\.\d+)?)$/);if(match){var value=SPACING_SCALE[match[1]];if(value!==undefined){return{gap:value};}}return null;}
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+)(?:px)?\]$/);if(pxMatch){return parseInt(pxMatch[1],10);}if(value.startsWith("[")&&value.endsWith("]")){if(process.env.NODE_ENV!=="production"){console.warn(`[react-native-tailwind] Unsupported arbitrary spacing value: ${value}. Only px values are supported (e.g., [16px] or [16]).`);}return null;}return null;}function parseSpacing(cls){var marginMatch=cls.match(/^m([xytrbls]?)-(.+)$/);if(marginMatch){var _marginMatch=(0,_slicedToArray2.default)(marginMatch,3),dir=_marginMatch[1],valueStr=_marginMatch[2];var arbitraryValue=parseArbitrarySpacing(valueStr);if(arbitraryValue!==null){return getMarginStyle(dir,arbitraryValue);}var scaleValue=SPACING_SCALE[valueStr];if(scaleValue!==undefined){return getMarginStyle(dir,scaleValue);}}var paddingMatch=cls.match(/^p([xytrbls]?)-(.+)$/);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};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};default:return{};}}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +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 - 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 - 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});});});
@@ -1,8 +1,9 @@
1
1
  /**
2
- * Typography utilities (font size, weight, line height, text align)
2
+ * Typography utilities (font size, weight, line height, text align, letter spacing)
3
3
  */
4
4
  import type { StyleObject } from "../types";
5
5
  export declare const FONT_SIZES: Record<string, number>;
6
+ export declare const LETTER_SPACING_SCALE: Record<string, number>;
6
7
  /**
7
8
  * Parse typography classes
8
9
  */
@@ -1 +1 @@
1
- Object.defineProperty(exports,"__esModule",{value:true});exports.FONT_SIZES=void 0;exports.parseTypography=parseTypography;var FONT_SIZES=exports.FONT_SIZES={xs:12,sm:14,base:16,lg:18,xl:20,"2xl":24,"3xl":30,"4xl":36,"5xl":48,"6xl":60,"7xl":72,"8xl":96,"9xl":128};function parseTypography(cls){if(cls.startsWith("text-")){var sizeKey=cls.substring(5);var fontSize=FONT_SIZES[sizeKey];if(fontSize!==undefined){return{fontSize:fontSize};}}if(cls==="font-thin"){return{fontWeight:"100"};}if(cls==="font-extralight"){return{fontWeight:"200"};}if(cls==="font-light"){return{fontWeight:"300"};}if(cls==="font-normal"){return{fontWeight:"400"};}if(cls==="font-medium"){return{fontWeight:"500"};}if(cls==="font-semibold"){return{fontWeight:"600"};}if(cls==="font-bold"){return{fontWeight:"700"};}if(cls==="font-extrabold"){return{fontWeight:"800"};}if(cls==="font-black"){return{fontWeight:"900"};}if(cls==="italic"){return{fontStyle:"italic"};}if(cls==="not-italic"){return{fontStyle:"normal"};}if(cls==="text-left"){return{textAlign:"left"};}if(cls==="text-center"){return{textAlign:"center"};}if(cls==="text-right"){return{textAlign:"right"};}if(cls==="text-justify"){return{textAlign:"justify"};}if(cls==="underline"){return{textDecorationLine:"underline"};}if(cls==="line-through"){return{textDecorationLine:"line-through"};}if(cls==="no-underline"){return{textDecorationLine:"none"};}if(cls==="uppercase"){return{textTransform:"uppercase"};}if(cls==="lowercase"){return{textTransform:"lowercase"};}if(cls==="capitalize"){return{textTransform:"capitalize"};}if(cls==="normal-case"){return{textTransform:"none"};}if(cls==="leading-none"){return{lineHeight:16};}if(cls==="leading-tight"){return{lineHeight:20};}if(cls==="leading-snug"){return{lineHeight:22};}if(cls==="leading-normal"){return{lineHeight:24};}if(cls==="leading-relaxed"){return{lineHeight:28};}if(cls==="leading-loose"){return{lineHeight:32};}return null;}
1
+ Object.defineProperty(exports,"__esModule",{value:true});exports.LETTER_SPACING_SCALE=exports.FONT_SIZES=void 0;exports.parseTypography=parseTypography;var FONT_SIZES=exports.FONT_SIZES={xs:12,sm:14,base:16,lg:18,xl:20,"2xl":24,"3xl":30,"4xl":36,"5xl":48,"6xl":60,"7xl":72,"8xl":96,"9xl":128};var LETTER_SPACING_SCALE=exports.LETTER_SPACING_SCALE={tighter:-0.8,tight:-0.4,normal:0,wide:0.4,wider:0.8,widest:1.6};var FONT_WEIGHT_MAP={"font-thin":{fontWeight:"100"},"font-extralight":{fontWeight:"200"},"font-light":{fontWeight:"300"},"font-normal":{fontWeight:"400"},"font-medium":{fontWeight:"500"},"font-semibold":{fontWeight:"600"},"font-bold":{fontWeight:"700"},"font-extrabold":{fontWeight:"800"},"font-black":{fontWeight:"900"}};var FONT_STYLE_MAP={italic:{fontStyle:"italic"},"not-italic":{fontStyle:"normal"}};var TEXT_ALIGN_MAP={"text-left":{textAlign:"left"},"text-center":{textAlign:"center"},"text-right":{textAlign:"right"},"text-justify":{textAlign:"justify"}};var TEXT_DECORATION_MAP={underline:{textDecorationLine:"underline"},"line-through":{textDecorationLine:"line-through"},"no-underline":{textDecorationLine:"none"}};var TEXT_TRANSFORM_MAP={uppercase:{textTransform:"uppercase"},lowercase:{textTransform:"lowercase"},capitalize:{textTransform:"capitalize"},"normal-case":{textTransform:"none"}};var LINE_HEIGHT_MAP={"leading-none":{lineHeight:16},"leading-tight":{lineHeight:20},"leading-snug":{lineHeight:22},"leading-normal":{lineHeight:24},"leading-relaxed":{lineHeight:28},"leading-loose":{lineHeight:32}};var TRACKING_MAP={"tracking-tighter":{letterSpacing:-0.8},"tracking-tight":{letterSpacing:-0.4},"tracking-normal":{letterSpacing:0},"tracking-wide":{letterSpacing:0.4},"tracking-wider":{letterSpacing:0.8},"tracking-widest":{letterSpacing:1.6}};function parseArbitraryFontSize(value){var pxMatch=value.match(/^\[(\d+)(?:px)?\]$/);if(pxMatch){return parseInt(pxMatch[1],10);}if(value.startsWith("[")&&value.endsWith("]")){if(process.env.NODE_ENV!=="production"){console.warn(`[react-native-tailwind] Unsupported arbitrary font size value: ${value}. Only px values are supported (e.g., [18px] or [18]).`);}return null;}return null;}function parseArbitraryLineHeight(value){var pxMatch=value.match(/^\[(\d+)(?:px)?\]$/);if(pxMatch){return parseInt(pxMatch[1],10);}if(value.startsWith("[")&&value.endsWith("]")){if(process.env.NODE_ENV!=="production"){console.warn(`[react-native-tailwind] Unsupported arbitrary line height value: ${value}. Only px values are supported (e.g., [24px] or [24]).`);}return null;}return null;}function parseTypography(cls){var _ref,_ref2,_ref3,_ref4,_ref5,_ref6,_FONT_WEIGHT_MAP$cls;if(cls.startsWith("text-")){var sizeKey=cls.substring(5);var arbitraryValue=parseArbitraryFontSize(sizeKey);if(arbitraryValue!==null){return{fontSize:arbitraryValue};}var fontSize=FONT_SIZES[sizeKey];if(fontSize!==undefined){return{fontSize:fontSize};}}if(cls.startsWith("leading-")){var heightKey=cls.substring(8);var _arbitraryValue=parseArbitraryLineHeight(heightKey);if(_arbitraryValue!==null){return{lineHeight:_arbitraryValue};}}return(_ref=(_ref2=(_ref3=(_ref4=(_ref5=(_ref6=(_FONT_WEIGHT_MAP$cls=FONT_WEIGHT_MAP[cls])!=null?_FONT_WEIGHT_MAP$cls:FONT_STYLE_MAP[cls])!=null?_ref6:TEXT_ALIGN_MAP[cls])!=null?_ref5:TEXT_DECORATION_MAP[cls])!=null?_ref4:TEXT_TRANSFORM_MAP[cls])!=null?_ref3:LINE_HEIGHT_MAP[cls])!=null?_ref2:TRACKING_MAP[cls])!=null?_ref:null;}
@@ -0,0 +1 @@
1
+ export {};