@mgcrea/react-native-tailwind 0.15.5 → 0.15.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/babel/index.cjs +2 -0
- package/dist/parser/sizing.js +1 -1
- package/dist/parser/sizing.test.js +1 -1
- package/dist/parser/spacing.js +1 -1
- package/dist/parser/spacing.test.js +1 -1
- package/dist/runtime.cjs +1 -1
- package/dist/runtime.cjs.map +2 -2
- package/dist/runtime.js +1 -1
- package/dist/runtime.js.map +2 -2
- package/package.json +1 -1
- package/src/parser/sizing.test.ts +10 -0
- package/src/parser/sizing.ts +1 -0
- package/src/parser/spacing.test.ts +24 -0
- package/src/parser/spacing.ts +1 -0
package/dist/babel/index.cjs
CHANGED
|
@@ -1579,6 +1579,7 @@ var RUNTIME_DIMENSIONS_MARKER = "{{RUNTIME:dimensions.";
|
|
|
1579
1579
|
|
|
1580
1580
|
// src/parser/sizing.ts
|
|
1581
1581
|
var SIZE_SCALE = {
|
|
1582
|
+
px: 1,
|
|
1582
1583
|
0: 0,
|
|
1583
1584
|
0.5: 2,
|
|
1584
1585
|
1: 4,
|
|
@@ -1778,6 +1779,7 @@ function parseSizing(cls, customSpacing) {
|
|
|
1778
1779
|
|
|
1779
1780
|
// src/parser/spacing.ts
|
|
1780
1781
|
var SPACING_SCALE = {
|
|
1782
|
+
px: 1,
|
|
1781
1783
|
0: 0,
|
|
1782
1784
|
0.5: 2,
|
|
1783
1785
|
1: 4,
|
package/dist/parser/sizing.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:true});exports.SIZE_SCALE=exports.SIZE_PERCENTAGES=void 0;exports.parseSizing=parseSizing;var _markers=require("../config/markers");var SIZE_SCALE=exports.SIZE_SCALE={0:0,0.5:2,1:4,1.5:6,2:8,2.5:10,3:12,3.5:14,4:16,5:20,6:24,7:28,8:32,9:36,10:40,11:44,12:48,14:56,16:64,20:80,24:96,28:112,32:128,36:144,40:160,44:176,48:192,52:208,56:224,60:240,64:256,72:288,80:320,96:384};var SIZE_PERCENTAGES=exports.SIZE_PERCENTAGES={full:"100%","1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%"};function parseArbitrarySize(value){var pxMatch=value.match(/^\[(\d+)(?:px)?\]$/);if(pxMatch){return parseInt(pxMatch[1],10);}var percentMatch=value.match(/^\[(\d+(?:\.\d+)?)%\]$/);if(percentMatch){return`${percentMatch[1]}%`;}if(value.startsWith("[")&&value.endsWith("]")){if(process.env.NODE_ENV!=="production"){console.warn(`[react-native-tailwind] Unsupported arbitrary size unit: ${value}. Only px and % are supported.`);}return null;}return null;}function parseSizing(cls,customSpacing){var sizeMap=customSpacing?Object.assign({},SIZE_SCALE,customSpacing):SIZE_SCALE;if(cls.startsWith("size-")){var sizeKey=cls.substring(5);var arbitrarySize=parseArbitrarySize(sizeKey);if(arbitrarySize!==null){return{width:arbitrarySize,height:arbitrarySize};}var percentage=SIZE_PERCENTAGES[sizeKey];if(percentage){return{width:percentage,height:percentage};}var numericSize=sizeMap[sizeKey];if(numericSize!==undefined){return{width:numericSize,height:numericSize};}if(sizeKey==="auto"){return{width:"auto",height:"auto"};}}if(cls.startsWith("w-")){var _sizeKey=cls.substring(2);if(_sizeKey==="screen"){return{width:`${_markers.RUNTIME_DIMENSIONS_MARKER}width}}`};}var _arbitrarySize=parseArbitrarySize(_sizeKey);if(_arbitrarySize!==null){return{width:_arbitrarySize};}var _percentage=SIZE_PERCENTAGES[_sizeKey];if(_percentage){return{width:_percentage};}var _numericSize=sizeMap[_sizeKey];if(_numericSize!==undefined){return{width:_numericSize};}if(_sizeKey==="auto"){return{width:"auto"};}}if(cls.startsWith("h-")){var _sizeKey2=cls.substring(2);if(_sizeKey2==="screen"){return{height:`${_markers.RUNTIME_DIMENSIONS_MARKER}height}}`};}var _arbitrarySize2=parseArbitrarySize(_sizeKey2);if(_arbitrarySize2!==null){return{height:_arbitrarySize2};}var _percentage2=SIZE_PERCENTAGES[_sizeKey2];if(_percentage2){return{height:_percentage2};}var _numericSize2=sizeMap[_sizeKey2];if(_numericSize2!==undefined){return{height:_numericSize2};}if(_sizeKey2==="auto"){return{height:"auto"};}}if(cls.startsWith("min-w-")){var _sizeKey3=cls.substring(6);var _arbitrarySize3=parseArbitrarySize(_sizeKey3);if(_arbitrarySize3!==null){return{minWidth:_arbitrarySize3};}var _percentage3=SIZE_PERCENTAGES[_sizeKey3];if(_percentage3){return{minWidth:_percentage3};}var _numericSize3=sizeMap[_sizeKey3];if(_numericSize3!==undefined){return{minWidth:_numericSize3};}}if(cls.startsWith("min-h-")){var _sizeKey4=cls.substring(6);var _arbitrarySize4=parseArbitrarySize(_sizeKey4);if(_arbitrarySize4!==null){return{minHeight:_arbitrarySize4};}var _percentage4=SIZE_PERCENTAGES[_sizeKey4];if(_percentage4){return{minHeight:_percentage4};}var _numericSize4=sizeMap[_sizeKey4];if(_numericSize4!==undefined){return{minHeight:_numericSize4};}}if(cls.startsWith("max-w-")){var _sizeKey5=cls.substring(6);var _arbitrarySize5=parseArbitrarySize(_sizeKey5);if(_arbitrarySize5!==null){return{maxWidth:_arbitrarySize5};}var _percentage5=SIZE_PERCENTAGES[_sizeKey5];if(_percentage5){return{maxWidth:_percentage5};}var _numericSize5=sizeMap[_sizeKey5];if(_numericSize5!==undefined){return{maxWidth:_numericSize5};}}if(cls.startsWith("max-h-")){var _sizeKey6=cls.substring(6);var _arbitrarySize6=parseArbitrarySize(_sizeKey6);if(_arbitrarySize6!==null){return{maxHeight:_arbitrarySize6};}var _percentage6=SIZE_PERCENTAGES[_sizeKey6];if(_percentage6){return{maxHeight:_percentage6};}var _numericSize6=sizeMap[_sizeKey6];if(_numericSize6!==undefined){return{maxHeight:_numericSize6};}}return null;}
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:true});exports.SIZE_SCALE=exports.SIZE_PERCENTAGES=void 0;exports.parseSizing=parseSizing;var _markers=require("../config/markers");var SIZE_SCALE=exports.SIZE_SCALE={px:1,0:0,0.5:2,1:4,1.5:6,2:8,2.5:10,3:12,3.5:14,4:16,5:20,6:24,7:28,8:32,9:36,10:40,11:44,12:48,14:56,16:64,20:80,24:96,28:112,32:128,36:144,40:160,44:176,48:192,52:208,56:224,60:240,64:256,72:288,80:320,96:384};var SIZE_PERCENTAGES=exports.SIZE_PERCENTAGES={full:"100%","1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%"};function parseArbitrarySize(value){var pxMatch=value.match(/^\[(\d+)(?:px)?\]$/);if(pxMatch){return parseInt(pxMatch[1],10);}var percentMatch=value.match(/^\[(\d+(?:\.\d+)?)%\]$/);if(percentMatch){return`${percentMatch[1]}%`;}if(value.startsWith("[")&&value.endsWith("]")){if(process.env.NODE_ENV!=="production"){console.warn(`[react-native-tailwind] Unsupported arbitrary size unit: ${value}. Only px and % are supported.`);}return null;}return null;}function parseSizing(cls,customSpacing){var sizeMap=customSpacing?Object.assign({},SIZE_SCALE,customSpacing):SIZE_SCALE;if(cls.startsWith("size-")){var sizeKey=cls.substring(5);var arbitrarySize=parseArbitrarySize(sizeKey);if(arbitrarySize!==null){return{width:arbitrarySize,height:arbitrarySize};}var percentage=SIZE_PERCENTAGES[sizeKey];if(percentage){return{width:percentage,height:percentage};}var numericSize=sizeMap[sizeKey];if(numericSize!==undefined){return{width:numericSize,height:numericSize};}if(sizeKey==="auto"){return{width:"auto",height:"auto"};}}if(cls.startsWith("w-")){var _sizeKey=cls.substring(2);if(_sizeKey==="screen"){return{width:`${_markers.RUNTIME_DIMENSIONS_MARKER}width}}`};}var _arbitrarySize=parseArbitrarySize(_sizeKey);if(_arbitrarySize!==null){return{width:_arbitrarySize};}var _percentage=SIZE_PERCENTAGES[_sizeKey];if(_percentage){return{width:_percentage};}var _numericSize=sizeMap[_sizeKey];if(_numericSize!==undefined){return{width:_numericSize};}if(_sizeKey==="auto"){return{width:"auto"};}}if(cls.startsWith("h-")){var _sizeKey2=cls.substring(2);if(_sizeKey2==="screen"){return{height:`${_markers.RUNTIME_DIMENSIONS_MARKER}height}}`};}var _arbitrarySize2=parseArbitrarySize(_sizeKey2);if(_arbitrarySize2!==null){return{height:_arbitrarySize2};}var _percentage2=SIZE_PERCENTAGES[_sizeKey2];if(_percentage2){return{height:_percentage2};}var _numericSize2=sizeMap[_sizeKey2];if(_numericSize2!==undefined){return{height:_numericSize2};}if(_sizeKey2==="auto"){return{height:"auto"};}}if(cls.startsWith("min-w-")){var _sizeKey3=cls.substring(6);var _arbitrarySize3=parseArbitrarySize(_sizeKey3);if(_arbitrarySize3!==null){return{minWidth:_arbitrarySize3};}var _percentage3=SIZE_PERCENTAGES[_sizeKey3];if(_percentage3){return{minWidth:_percentage3};}var _numericSize3=sizeMap[_sizeKey3];if(_numericSize3!==undefined){return{minWidth:_numericSize3};}}if(cls.startsWith("min-h-")){var _sizeKey4=cls.substring(6);var _arbitrarySize4=parseArbitrarySize(_sizeKey4);if(_arbitrarySize4!==null){return{minHeight:_arbitrarySize4};}var _percentage4=SIZE_PERCENTAGES[_sizeKey4];if(_percentage4){return{minHeight:_percentage4};}var _numericSize4=sizeMap[_sizeKey4];if(_numericSize4!==undefined){return{minHeight:_numericSize4};}}if(cls.startsWith("max-w-")){var _sizeKey5=cls.substring(6);var _arbitrarySize5=parseArbitrarySize(_sizeKey5);if(_arbitrarySize5!==null){return{maxWidth:_arbitrarySize5};}var _percentage5=SIZE_PERCENTAGES[_sizeKey5];if(_percentage5){return{maxWidth:_percentage5};}var _numericSize5=sizeMap[_sizeKey5];if(_numericSize5!==undefined){return{maxWidth:_numericSize5};}}if(cls.startsWith("max-h-")){var _sizeKey6=cls.substring(6);var _arbitrarySize6=parseArbitrarySize(_sizeKey6);if(_arbitrarySize6!==null){return{maxHeight:_arbitrarySize6};}var _percentage6=SIZE_PERCENTAGES[_sizeKey6];if(_percentage6){return{maxHeight:_percentage6};}var _numericSize6=sizeMap[_sizeKey6];if(_numericSize6!==undefined){return{maxHeight:_numericSize6};}}return null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var _vitest=require("vitest");var _sizing=require("./sizing");(0,_vitest.describe)("SIZE_SCALE",function(){(0,_vitest.it)("should export complete size scale",function(){(0,_vitest.expect)(_sizing.SIZE_SCALE).toMatchSnapshot();});});(0,_vitest.describe)("SIZE_PERCENTAGES",function(){(0,_vitest.it)("should export complete percentage sizes",function(){(0,_vitest.expect)(_sizing.SIZE_PERCENTAGES).toMatchSnapshot();});});(0,_vitest.describe)("parseSizing - width",function(){(0,_vitest.it)("should parse width with numeric values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-0")).toEqual({width:0});(0,_vitest.expect)((0,_sizing.parseSizing)("w-4")).toEqual({width:16});(0,_vitest.expect)((0,_sizing.parseSizing)("w-8")).toEqual({width:32});(0,_vitest.expect)((0,_sizing.parseSizing)("w-96")).toEqual({width:384});});(0,_vitest.it)("should parse width with fractional values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-0.5")).toEqual({width:2});(0,_vitest.expect)((0,_sizing.parseSizing)("w-1.5")).toEqual({width:6});(0,_vitest.expect)((0,_sizing.parseSizing)("w-2.5")).toEqual({width:10});});(0,_vitest.it)("should parse width with percentage values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-full")).toEqual({width:"100%"});(0,_vitest.expect)((0,_sizing.parseSizing)("w-1/2")).toEqual({width:"50%"});(0,_vitest.expect)((0,_sizing.parseSizing)("w-1/3")).toEqual({width:"33.333333%"});(0,_vitest.expect)((0,_sizing.parseSizing)("w-2/3")).toEqual({width:"66.666667%"});(0,_vitest.expect)((0,_sizing.parseSizing)("w-1/4")).toEqual({width:"25%"});(0,_vitest.expect)((0,_sizing.parseSizing)("w-3/4")).toEqual({width:"75%"});});(0,_vitest.it)("should parse width with special values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-auto")).toEqual({width:"auto"});});(0,_vitest.it)("should parse width with arbitrary pixel values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-[123px]")).toEqual({width:123});(0,_vitest.expect)((0,_sizing.parseSizing)("w-[123]")).toEqual({width:123});(0,_vitest.expect)((0,_sizing.parseSizing)("w-[350px]")).toEqual({width:350});});(0,_vitest.it)("should parse width with arbitrary percentage values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-[50%]")).toEqual({width:"50%"});(0,_vitest.expect)((0,_sizing.parseSizing)("w-[33.333%]")).toEqual({width:"33.333%"});(0,_vitest.expect)((0,_sizing.parseSizing)("w-[85%]")).toEqual({width:"85%"});});});(0,_vitest.describe)("parseSizing - height",function(){(0,_vitest.it)("should parse height with numeric values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("h-0")).toEqual({height:0});(0,_vitest.expect)((0,_sizing.parseSizing)("h-4")).toEqual({height:16});(0,_vitest.expect)((0,_sizing.parseSizing)("h-8")).toEqual({height:32});(0,_vitest.expect)((0,_sizing.parseSizing)("h-96")).toEqual({height:384});});(0,_vitest.it)("should parse height with fractional values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("h-0.5")).toEqual({height:2});(0,_vitest.expect)((0,_sizing.parseSizing)("h-1.5")).toEqual({height:6});(0,_vitest.expect)((0,_sizing.parseSizing)("h-2.5")).toEqual({height:10});});(0,_vitest.it)("should parse height with percentage values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("h-full")).toEqual({height:"100%"});(0,_vitest.expect)((0,_sizing.parseSizing)("h-1/2")).toEqual({height:"50%"});(0,_vitest.expect)((0,_sizing.parseSizing)("h-1/3")).toEqual({height:"33.333333%"});(0,_vitest.expect)((0,_sizing.parseSizing)("h-2/3")).toEqual({height:"66.666667%"});});(0,_vitest.it)("should parse height with special values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("h-auto")).toEqual({height:"auto"});});(0,_vitest.it)("should parse height with arbitrary values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("h-[200px]")).toEqual({height:200});(0,_vitest.expect)((0,_sizing.parseSizing)("h-[75%]")).toEqual({height:"75%"});});});(0,_vitest.describe)("parseSizing - min width",function(){(0,_vitest.it)("should parse min-width with numeric values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("min-w-0")).toEqual({minWidth:0});(0,_vitest.expect)((0,_sizing.parseSizing)("min-w-4")).toEqual({minWidth:16});(0,_vitest.expect)((0,_sizing.parseSizing)("min-w-8")).toEqual({minWidth:32});});(0,_vitest.it)("should parse min-width with percentage values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("min-w-full")).toEqual({minWidth:"100%"});(0,_vitest.expect)((0,_sizing.parseSizing)("min-w-1/2")).toEqual({minWidth:"50%"});});(0,_vitest.it)("should parse min-width with arbitrary values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("min-w-[200px]")).toEqual({minWidth:200});(0,_vitest.expect)((0,_sizing.parseSizing)("min-w-[50%]")).toEqual({minWidth:"50%"});});});(0,_vitest.describe)("parseSizing - min height",function(){(0,_vitest.it)("should parse min-height with numeric values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("min-h-0")).toEqual({minHeight:0});(0,_vitest.expect)((0,_sizing.parseSizing)("min-h-4")).toEqual({minHeight:16});(0,_vitest.expect)((0,_sizing.parseSizing)("min-h-8")).toEqual({minHeight:32});});(0,_vitest.it)("should parse min-height with percentage values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("min-h-full")).toEqual({minHeight:"100%"});(0,_vitest.expect)((0,_sizing.parseSizing)("min-h-1/2")).toEqual({minHeight:"50%"});});(0,_vitest.it)("should parse min-height with arbitrary values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("min-h-[150px]")).toEqual({minHeight:150});(0,_vitest.expect)((0,_sizing.parseSizing)("min-h-[40%]")).toEqual({minHeight:"40%"});});});(0,_vitest.describe)("parseSizing - max width",function(){(0,_vitest.it)("should parse max-width with numeric values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("max-w-0")).toEqual({maxWidth:0});(0,_vitest.expect)((0,_sizing.parseSizing)("max-w-4")).toEqual({maxWidth:16});(0,_vitest.expect)((0,_sizing.parseSizing)("max-w-8")).toEqual({maxWidth:32});});(0,_vitest.it)("should parse max-width with percentage values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("max-w-full")).toEqual({maxWidth:"100%"});(0,_vitest.expect)((0,_sizing.parseSizing)("max-w-1/2")).toEqual({maxWidth:"50%"});});(0,_vitest.it)("should parse max-width with arbitrary values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("max-w-[500px]")).toEqual({maxWidth:500});(0,_vitest.expect)((0,_sizing.parseSizing)("max-w-[80%]")).toEqual({maxWidth:"80%"});});});(0,_vitest.describe)("parseSizing - max height",function(){(0,_vitest.it)("should parse max-height with numeric values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("max-h-0")).toEqual({maxHeight:0});(0,_vitest.expect)((0,_sizing.parseSizing)("max-h-4")).toEqual({maxHeight:16});(0,_vitest.expect)((0,_sizing.parseSizing)("max-h-8")).toEqual({maxHeight:32});});(0,_vitest.it)("should parse max-height with percentage values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("max-h-full")).toEqual({maxHeight:"100%"});(0,_vitest.expect)((0,_sizing.parseSizing)("max-h-1/2")).toEqual({maxHeight:"50%"});});(0,_vitest.it)("should parse max-height with arbitrary values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("max-h-[300px]")).toEqual({maxHeight:300});(0,_vitest.expect)((0,_sizing.parseSizing)("max-h-[90%]")).toEqual({maxHeight:"90%"});});});(0,_vitest.describe)("parseSizing - edge cases",function(){(0,_vitest.it)("should return null for invalid classes",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("invalid")).toBeNull();(0,_vitest.expect)((0,_sizing.parseSizing)("w")).toBeNull();(0,_vitest.expect)((0,_sizing.parseSizing)("h")).toBeNull();(0,_vitest.expect)((0,_sizing.parseSizing)("width-4")).toBeNull();(0,_vitest.expect)((0,_sizing.parseSizing)("height-4")).toBeNull();});(0,_vitest.it)("should return null for invalid size values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-invalid")).toBeNull();(0,_vitest.expect)((0,_sizing.parseSizing)("h-999")).toBeNull();(0,_vitest.expect)((0,_sizing.parseSizing)("min-w-abc")).toBeNull();});(0,_vitest.it)("should return null for arbitrary values with unsupported units",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-[16rem]")).toBeNull();(0,_vitest.expect)((0,_sizing.parseSizing)("h-[2em]")).toBeNull();(0,_vitest.expect)((0,_sizing.parseSizing)("max-w-[50vh]")).toBeNull();(0,_vitest.expect)((0,_sizing.parseSizing)("min-h-[100vw]")).toBeNull();});(0,_vitest.it)("should return null for malformed arbitrary values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-[16")).toBeNull();(0,_vitest.expect)((0,_sizing.parseSizing)("h-16]")).toBeNull();(0,_vitest.expect)((0,_sizing.parseSizing)("min-w-[]")).toBeNull();});(0,_vitest.it)("should handle edge case size values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-0")).toEqual({width:0});(0,_vitest.expect)((0,_sizing.parseSizing)("h-0")).toEqual({height:0});(0,_vitest.expect)((0,_sizing.parseSizing)("min-w-0")).toEqual({minWidth:0});(0,_vitest.expect)((0,_sizing.parseSizing)("max-h-0")).toEqual({maxHeight:0});});(0,_vitest.it)("should not match partial class names",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("tw-4")).toBeNull();(0,_vitest.expect)((0,_sizing.parseSizing)("width-4")).toBeNull();(0,_vitest.expect)((0,_sizing.parseSizing)("height-4")).toBeNull();});});(0,_vitest.describe)("parseSizing - comprehensive coverage",function(){(0,_vitest.it)("should parse all width variants with same value",function(){var value=16;(0,_vitest.expect)((0,_sizing.parseSizing)("w-4")).toEqual({width:value});(0,_vitest.expect)((0,_sizing.parseSizing)("min-w-4")).toEqual({minWidth:value});(0,_vitest.expect)((0,_sizing.parseSizing)("max-w-4")).toEqual({maxWidth:value});});(0,_vitest.it)("should parse all height variants with same value",function(){var value=16;(0,_vitest.expect)((0,_sizing.parseSizing)("h-4")).toEqual({height:value});(0,_vitest.expect)((0,_sizing.parseSizing)("min-h-4")).toEqual({minHeight:value});(0,_vitest.expect)((0,_sizing.parseSizing)("max-h-4")).toEqual({maxHeight:value});});(0,_vitest.it)("should handle large size values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-96")).toEqual({width:384});(0,_vitest.expect)((0,_sizing.parseSizing)("h-96")).toEqual({height:384});(0,_vitest.expect)((0,_sizing.parseSizing)("max-w-96")).toEqual({maxWidth:384});});(0,_vitest.it)("should handle arbitrary values across all width variants",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-[123px]")).toEqual({width:123});(0,_vitest.expect)((0,_sizing.parseSizing)("min-w-[123px]")).toEqual({minWidth:123});(0,_vitest.expect)((0,_sizing.parseSizing)("max-w-[123px]")).toEqual({maxWidth:123});});(0,_vitest.it)("should handle arbitrary values across all height variants",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("h-[200px]")).toEqual({height:200});(0,_vitest.expect)((0,_sizing.parseSizing)("min-h-[200px]")).toEqual({minHeight:200});(0,_vitest.expect)((0,_sizing.parseSizing)("max-h-[200px]")).toEqual({maxHeight:200});});(0,_vitest.it)("should handle arbitrary percentage values across all variants",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-[75%]")).toEqual({width:"75%"});(0,_vitest.expect)((0,_sizing.parseSizing)("h-[60%]")).toEqual({height:"60%"});(0,_vitest.expect)((0,_sizing.parseSizing)("min-w-[25%]")).toEqual({minWidth:"25%"});(0,_vitest.expect)((0,_sizing.parseSizing)("max-h-[90%]")).toEqual({maxHeight:"90%"});});(0,_vitest.it)("should handle all fractional percentage variants",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-1/5")).toEqual({width:"20%"});(0,_vitest.expect)((0,_sizing.parseSizing)("w-2/5")).toEqual({width:"40%"});(0,_vitest.expect)((0,_sizing.parseSizing)("w-3/5")).toEqual({width:"60%"});(0,_vitest.expect)((0,_sizing.parseSizing)("w-4/5")).toEqual({width:"80%"});(0,_vitest.expect)((0,_sizing.parseSizing)("w-1/6")).toEqual({width:"16.666667%"});(0,_vitest.expect)((0,_sizing.parseSizing)("w-5/6")).toEqual({width:"83.333333%"});});(0,_vitest.it)("should handle special values consistently",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-auto")).toEqual({width:"auto"});(0,_vitest.expect)((0,_sizing.parseSizing)("h-auto")).toEqual({height:"auto"});(0,_vitest.expect)((0,_sizing.parseSizing)("w-full")).toEqual({width:"100%"});(0,_vitest.expect)((0,_sizing.parseSizing)("h-full")).toEqual({height:"100%"});});});(0,_vitest.describe)("parseSizing - custom spacing",function(){var customSpacing={xs:4,sm:8,md:16,lg:32,xl:64,"4":20};(0,_vitest.it)("should support custom spacing values for width",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-xs",customSpacing)).toEqual({width:4});(0,_vitest.expect)((0,_sizing.parseSizing)("w-sm",customSpacing)).toEqual({width:8});(0,_vitest.expect)((0,_sizing.parseSizing)("w-lg",customSpacing)).toEqual({width:32});(0,_vitest.expect)((0,_sizing.parseSizing)("w-xl",customSpacing)).toEqual({width:64});});(0,_vitest.it)("should support custom spacing values for height",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("h-xs",customSpacing)).toEqual({height:4});(0,_vitest.expect)((0,_sizing.parseSizing)("h-md",customSpacing)).toEqual({height:16});(0,_vitest.expect)((0,_sizing.parseSizing)("h-xl",customSpacing)).toEqual({height:64});});(0,_vitest.it)("should support custom spacing values for min/max dimensions",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("min-w-sm",customSpacing)).toEqual({minWidth:8});(0,_vitest.expect)((0,_sizing.parseSizing)("min-h-lg",customSpacing)).toEqual({minHeight:32});(0,_vitest.expect)((0,_sizing.parseSizing)("max-w-xl",customSpacing)).toEqual({maxWidth:64});(0,_vitest.expect)((0,_sizing.parseSizing)("max-h-md",customSpacing)).toEqual({maxHeight:16});});(0,_vitest.it)("should allow custom spacing to override preset values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-4",customSpacing)).toEqual({width:20});(0,_vitest.expect)((0,_sizing.parseSizing)("h-4",customSpacing)).toEqual({height:20});});(0,_vitest.it)("should prefer arbitrary values over custom spacing",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-[24px]",customSpacing)).toEqual({width:24});(0,_vitest.expect)((0,_sizing.parseSizing)("h-[50]",customSpacing)).toEqual({height:50});});(0,_vitest.it)("should fall back to preset scale for unknown custom keys",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-8",customSpacing)).toEqual({width:32});(0,_vitest.expect)((0,_sizing.parseSizing)("h-12",customSpacing)).toEqual({height:48});});(0,_vitest.it)("should preserve percentage values with custom spacing",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-full",customSpacing)).toEqual({width:"100%"});(0,_vitest.expect)((0,_sizing.parseSizing)("h-1/2",customSpacing)).toEqual({height:"50%"});});(0,_vitest.it)("should work without custom spacing (backward compatible)",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-4")).toEqual({width:16});(0,_vitest.expect)((0,_sizing.parseSizing)("h-8")).toEqual({height:32});});});(0,_vitest.describe)("parseSizing - size (width + height)",function(){(0,_vitest.it)("should parse size with numeric values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("size-0")).toEqual({width:0,height:0});(0,_vitest.expect)((0,_sizing.parseSizing)("size-4")).toEqual({width:16,height:16});(0,_vitest.expect)((0,_sizing.parseSizing)("size-8")).toEqual({width:32,height:32});(0,_vitest.expect)((0,_sizing.parseSizing)("size-96")).toEqual({width:384,height:384});});(0,_vitest.it)("should parse size with fractional values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("size-0.5")).toEqual({width:2,height:2});(0,_vitest.expect)((0,_sizing.parseSizing)("size-1.5")).toEqual({width:6,height:6});(0,_vitest.expect)((0,_sizing.parseSizing)("size-2.5")).toEqual({width:10,height:10});});(0,_vitest.it)("should parse size with percentage values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("size-full")).toEqual({width:"100%",height:"100%"});(0,_vitest.expect)((0,_sizing.parseSizing)("size-1/2")).toEqual({width:"50%",height:"50%"});(0,_vitest.expect)((0,_sizing.parseSizing)("size-1/3")).toEqual({width:"33.333333%",height:"33.333333%"});(0,_vitest.expect)((0,_sizing.parseSizing)("size-2/3")).toEqual({width:"66.666667%",height:"66.666667%"});(0,_vitest.expect)((0,_sizing.parseSizing)("size-1/4")).toEqual({width:"25%",height:"25%"});(0,_vitest.expect)((0,_sizing.parseSizing)("size-3/4")).toEqual({width:"75%",height:"75%"});});(0,_vitest.it)("should parse size with special values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("size-auto")).toEqual({width:"auto",height:"auto"});});(0,_vitest.it)("should parse size with arbitrary pixel values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("size-[123px]")).toEqual({width:123,height:123});(0,_vitest.expect)((0,_sizing.parseSizing)("size-[200]")).toEqual({width:200,height:200});(0,_vitest.expect)((0,_sizing.parseSizing)("size-[50px]")).toEqual({width:50,height:50});});(0,_vitest.it)("should parse size with arbitrary percentage values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("size-[50%]")).toEqual({width:"50%",height:"50%"});(0,_vitest.expect)((0,_sizing.parseSizing)("size-[33.333%]")).toEqual({width:"33.333%",height:"33.333%"});(0,_vitest.expect)((0,_sizing.parseSizing)("size-[85%]")).toEqual({width:"85%",height:"85%"});});(0,_vitest.it)("should support custom spacing values for size",function(){var customSpacing={sm:8,md:16,lg:32,xl:64};(0,_vitest.expect)((0,_sizing.parseSizing)("size-sm",customSpacing)).toEqual({width:8,height:8});(0,_vitest.expect)((0,_sizing.parseSizing)("size-md",customSpacing)).toEqual({width:16,height:16});(0,_vitest.expect)((0,_sizing.parseSizing)("size-lg",customSpacing)).toEqual({width:32,height:32});(0,_vitest.expect)((0,_sizing.parseSizing)("size-xl",customSpacing)).toEqual({width:64,height:64});});(0,_vitest.it)("should allow custom spacing to override preset values",function(){var customSpacing={"4":20};(0,_vitest.expect)((0,_sizing.parseSizing)("size-4",customSpacing)).toEqual({width:20,height:20});});(0,_vitest.it)("should prefer arbitrary values over custom spacing",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("size-[24px]",{"4":20})).toEqual({width:24,height:24});(0,_vitest.expect)((0,_sizing.parseSizing)("size-[50]",{sm:8})).toEqual({width:50,height:50});});(0,_vitest.it)("should handle all fractional percentage variants",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("size-1/5")).toEqual({width:"20%",height:"20%"});(0,_vitest.expect)((0,_sizing.parseSizing)("size-2/5")).toEqual({width:"40%",height:"40%"});(0,_vitest.expect)((0,_sizing.parseSizing)("size-3/5")).toEqual({width:"60%",height:"60%"});(0,_vitest.expect)((0,_sizing.parseSizing)("size-4/5")).toEqual({width:"80%",height:"80%"});(0,_vitest.expect)((0,_sizing.parseSizing)("size-1/6")).toEqual({width:"16.666667%",height:"16.666667%"});(0,_vitest.expect)((0,_sizing.parseSizing)("size-5/6")).toEqual({width:"83.333333%",height:"83.333333%"});});(0,_vitest.it)("should handle edge case size values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("size-0")).toEqual({width:0,height:0});});(0,_vitest.it)("should return null for invalid size values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("size-invalid")).toBeNull();(0,_vitest.expect)((0,_sizing.parseSizing)("size-999")).toBeNull();});(0,_vitest.it)("should return null for arbitrary values with unsupported units",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("size-[16rem]")).toBeNull();(0,_vitest.expect)((0,_sizing.parseSizing)("size-[2em]")).toBeNull();(0,_vitest.expect)((0,_sizing.parseSizing)("size-[50vh]")).toBeNull();});});
|
|
1
|
+
var _vitest=require("vitest");var _sizing=require("./sizing");(0,_vitest.describe)("SIZE_SCALE",function(){(0,_vitest.it)("should export complete size scale",function(){(0,_vitest.expect)(_sizing.SIZE_SCALE).toMatchSnapshot();});});(0,_vitest.describe)("SIZE_PERCENTAGES",function(){(0,_vitest.it)("should export complete percentage sizes",function(){(0,_vitest.expect)(_sizing.SIZE_PERCENTAGES).toMatchSnapshot();});});(0,_vitest.describe)("parseSizing - width",function(){(0,_vitest.it)("should parse width with numeric values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-0")).toEqual({width:0});(0,_vitest.expect)((0,_sizing.parseSizing)("w-4")).toEqual({width:16});(0,_vitest.expect)((0,_sizing.parseSizing)("w-8")).toEqual({width:32});(0,_vitest.expect)((0,_sizing.parseSizing)("w-96")).toEqual({width:384});});(0,_vitest.it)("should parse width with fractional values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-0.5")).toEqual({width:2});(0,_vitest.expect)((0,_sizing.parseSizing)("w-1.5")).toEqual({width:6});(0,_vitest.expect)((0,_sizing.parseSizing)("w-2.5")).toEqual({width:10});});(0,_vitest.it)("should parse width with percentage values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-full")).toEqual({width:"100%"});(0,_vitest.expect)((0,_sizing.parseSizing)("w-1/2")).toEqual({width:"50%"});(0,_vitest.expect)((0,_sizing.parseSizing)("w-1/3")).toEqual({width:"33.333333%"});(0,_vitest.expect)((0,_sizing.parseSizing)("w-2/3")).toEqual({width:"66.666667%"});(0,_vitest.expect)((0,_sizing.parseSizing)("w-1/4")).toEqual({width:"25%"});(0,_vitest.expect)((0,_sizing.parseSizing)("w-3/4")).toEqual({width:"75%"});});(0,_vitest.it)("should parse width with special values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-auto")).toEqual({width:"auto"});});(0,_vitest.it)("should parse width with arbitrary pixel values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-[123px]")).toEqual({width:123});(0,_vitest.expect)((0,_sizing.parseSizing)("w-[123]")).toEqual({width:123});(0,_vitest.expect)((0,_sizing.parseSizing)("w-[350px]")).toEqual({width:350});});(0,_vitest.it)("should parse width with arbitrary percentage values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-[50%]")).toEqual({width:"50%"});(0,_vitest.expect)((0,_sizing.parseSizing)("w-[33.333%]")).toEqual({width:"33.333%"});(0,_vitest.expect)((0,_sizing.parseSizing)("w-[85%]")).toEqual({width:"85%"});});});(0,_vitest.describe)("parseSizing - height",function(){(0,_vitest.it)("should parse height with numeric values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("h-0")).toEqual({height:0});(0,_vitest.expect)((0,_sizing.parseSizing)("h-4")).toEqual({height:16});(0,_vitest.expect)((0,_sizing.parseSizing)("h-8")).toEqual({height:32});(0,_vitest.expect)((0,_sizing.parseSizing)("h-96")).toEqual({height:384});});(0,_vitest.it)("should parse height with fractional values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("h-0.5")).toEqual({height:2});(0,_vitest.expect)((0,_sizing.parseSizing)("h-1.5")).toEqual({height:6});(0,_vitest.expect)((0,_sizing.parseSizing)("h-2.5")).toEqual({height:10});});(0,_vitest.it)("should parse height with percentage values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("h-full")).toEqual({height:"100%"});(0,_vitest.expect)((0,_sizing.parseSizing)("h-1/2")).toEqual({height:"50%"});(0,_vitest.expect)((0,_sizing.parseSizing)("h-1/3")).toEqual({height:"33.333333%"});(0,_vitest.expect)((0,_sizing.parseSizing)("h-2/3")).toEqual({height:"66.666667%"});});(0,_vitest.it)("should parse height with special values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("h-auto")).toEqual({height:"auto"});});(0,_vitest.it)("should parse height with arbitrary values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("h-[200px]")).toEqual({height:200});(0,_vitest.expect)((0,_sizing.parseSizing)("h-[75%]")).toEqual({height:"75%"});});});(0,_vitest.describe)("parseSizing - min width",function(){(0,_vitest.it)("should parse min-width with numeric values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("min-w-0")).toEqual({minWidth:0});(0,_vitest.expect)((0,_sizing.parseSizing)("min-w-4")).toEqual({minWidth:16});(0,_vitest.expect)((0,_sizing.parseSizing)("min-w-8")).toEqual({minWidth:32});});(0,_vitest.it)("should parse min-width with percentage values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("min-w-full")).toEqual({minWidth:"100%"});(0,_vitest.expect)((0,_sizing.parseSizing)("min-w-1/2")).toEqual({minWidth:"50%"});});(0,_vitest.it)("should parse min-width with arbitrary values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("min-w-[200px]")).toEqual({minWidth:200});(0,_vitest.expect)((0,_sizing.parseSizing)("min-w-[50%]")).toEqual({minWidth:"50%"});});});(0,_vitest.describe)("parseSizing - min height",function(){(0,_vitest.it)("should parse min-height with numeric values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("min-h-0")).toEqual({minHeight:0});(0,_vitest.expect)((0,_sizing.parseSizing)("min-h-4")).toEqual({minHeight:16});(0,_vitest.expect)((0,_sizing.parseSizing)("min-h-8")).toEqual({minHeight:32});});(0,_vitest.it)("should parse min-height with percentage values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("min-h-full")).toEqual({minHeight:"100%"});(0,_vitest.expect)((0,_sizing.parseSizing)("min-h-1/2")).toEqual({minHeight:"50%"});});(0,_vitest.it)("should parse min-height with arbitrary values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("min-h-[150px]")).toEqual({minHeight:150});(0,_vitest.expect)((0,_sizing.parseSizing)("min-h-[40%]")).toEqual({minHeight:"40%"});});});(0,_vitest.describe)("parseSizing - max width",function(){(0,_vitest.it)("should parse max-width with numeric values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("max-w-0")).toEqual({maxWidth:0});(0,_vitest.expect)((0,_sizing.parseSizing)("max-w-4")).toEqual({maxWidth:16});(0,_vitest.expect)((0,_sizing.parseSizing)("max-w-8")).toEqual({maxWidth:32});});(0,_vitest.it)("should parse max-width with percentage values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("max-w-full")).toEqual({maxWidth:"100%"});(0,_vitest.expect)((0,_sizing.parseSizing)("max-w-1/2")).toEqual({maxWidth:"50%"});});(0,_vitest.it)("should parse max-width with arbitrary values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("max-w-[500px]")).toEqual({maxWidth:500});(0,_vitest.expect)((0,_sizing.parseSizing)("max-w-[80%]")).toEqual({maxWidth:"80%"});});});(0,_vitest.describe)("parseSizing - max height",function(){(0,_vitest.it)("should parse max-height with numeric values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("max-h-0")).toEqual({maxHeight:0});(0,_vitest.expect)((0,_sizing.parseSizing)("max-h-4")).toEqual({maxHeight:16});(0,_vitest.expect)((0,_sizing.parseSizing)("max-h-8")).toEqual({maxHeight:32});});(0,_vitest.it)("should parse max-height with percentage values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("max-h-full")).toEqual({maxHeight:"100%"});(0,_vitest.expect)((0,_sizing.parseSizing)("max-h-1/2")).toEqual({maxHeight:"50%"});});(0,_vitest.it)("should parse max-height with arbitrary values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("max-h-[300px]")).toEqual({maxHeight:300});(0,_vitest.expect)((0,_sizing.parseSizing)("max-h-[90%]")).toEqual({maxHeight:"90%"});});});(0,_vitest.describe)("parseSizing - edge cases",function(){(0,_vitest.it)("should return null for invalid classes",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("invalid")).toBeNull();(0,_vitest.expect)((0,_sizing.parseSizing)("w")).toBeNull();(0,_vitest.expect)((0,_sizing.parseSizing)("h")).toBeNull();(0,_vitest.expect)((0,_sizing.parseSizing)("width-4")).toBeNull();(0,_vitest.expect)((0,_sizing.parseSizing)("height-4")).toBeNull();});(0,_vitest.it)("should return null for invalid size values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-invalid")).toBeNull();(0,_vitest.expect)((0,_sizing.parseSizing)("h-999")).toBeNull();(0,_vitest.expect)((0,_sizing.parseSizing)("min-w-abc")).toBeNull();});(0,_vitest.it)("should return null for arbitrary values with unsupported units",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-[16rem]")).toBeNull();(0,_vitest.expect)((0,_sizing.parseSizing)("h-[2em]")).toBeNull();(0,_vitest.expect)((0,_sizing.parseSizing)("max-w-[50vh]")).toBeNull();(0,_vitest.expect)((0,_sizing.parseSizing)("min-h-[100vw]")).toBeNull();});(0,_vitest.it)("should return null for malformed arbitrary values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-[16")).toBeNull();(0,_vitest.expect)((0,_sizing.parseSizing)("h-16]")).toBeNull();(0,_vitest.expect)((0,_sizing.parseSizing)("min-w-[]")).toBeNull();});(0,_vitest.it)("should handle edge case size values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-0")).toEqual({width:0});(0,_vitest.expect)((0,_sizing.parseSizing)("h-0")).toEqual({height:0});(0,_vitest.expect)((0,_sizing.parseSizing)("min-w-0")).toEqual({minWidth:0});(0,_vitest.expect)((0,_sizing.parseSizing)("max-h-0")).toEqual({maxHeight:0});});(0,_vitest.it)("should not match partial class names",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("tw-4")).toBeNull();(0,_vitest.expect)((0,_sizing.parseSizing)("width-4")).toBeNull();(0,_vitest.expect)((0,_sizing.parseSizing)("height-4")).toBeNull();});});(0,_vitest.describe)("parseSizing - comprehensive coverage",function(){(0,_vitest.it)("should parse all width variants with same value",function(){var value=16;(0,_vitest.expect)((0,_sizing.parseSizing)("w-4")).toEqual({width:value});(0,_vitest.expect)((0,_sizing.parseSizing)("min-w-4")).toEqual({minWidth:value});(0,_vitest.expect)((0,_sizing.parseSizing)("max-w-4")).toEqual({maxWidth:value});});(0,_vitest.it)("should parse all height variants with same value",function(){var value=16;(0,_vitest.expect)((0,_sizing.parseSizing)("h-4")).toEqual({height:value});(0,_vitest.expect)((0,_sizing.parseSizing)("min-h-4")).toEqual({minHeight:value});(0,_vitest.expect)((0,_sizing.parseSizing)("max-h-4")).toEqual({maxHeight:value});});(0,_vitest.it)("should handle large size values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-96")).toEqual({width:384});(0,_vitest.expect)((0,_sizing.parseSizing)("h-96")).toEqual({height:384});(0,_vitest.expect)((0,_sizing.parseSizing)("max-w-96")).toEqual({maxWidth:384});});(0,_vitest.it)("should handle arbitrary values across all width variants",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-[123px]")).toEqual({width:123});(0,_vitest.expect)((0,_sizing.parseSizing)("min-w-[123px]")).toEqual({minWidth:123});(0,_vitest.expect)((0,_sizing.parseSizing)("max-w-[123px]")).toEqual({maxWidth:123});});(0,_vitest.it)("should handle arbitrary values across all height variants",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("h-[200px]")).toEqual({height:200});(0,_vitest.expect)((0,_sizing.parseSizing)("min-h-[200px]")).toEqual({minHeight:200});(0,_vitest.expect)((0,_sizing.parseSizing)("max-h-[200px]")).toEqual({maxHeight:200});});(0,_vitest.it)("should handle arbitrary percentage values across all variants",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-[75%]")).toEqual({width:"75%"});(0,_vitest.expect)((0,_sizing.parseSizing)("h-[60%]")).toEqual({height:"60%"});(0,_vitest.expect)((0,_sizing.parseSizing)("min-w-[25%]")).toEqual({minWidth:"25%"});(0,_vitest.expect)((0,_sizing.parseSizing)("max-h-[90%]")).toEqual({maxHeight:"90%"});});(0,_vitest.it)("should handle all fractional percentage variants",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-1/5")).toEqual({width:"20%"});(0,_vitest.expect)((0,_sizing.parseSizing)("w-2/5")).toEqual({width:"40%"});(0,_vitest.expect)((0,_sizing.parseSizing)("w-3/5")).toEqual({width:"60%"});(0,_vitest.expect)((0,_sizing.parseSizing)("w-4/5")).toEqual({width:"80%"});(0,_vitest.expect)((0,_sizing.parseSizing)("w-1/6")).toEqual({width:"16.666667%"});(0,_vitest.expect)((0,_sizing.parseSizing)("w-5/6")).toEqual({width:"83.333333%"});});(0,_vitest.it)("should handle special values consistently",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-auto")).toEqual({width:"auto"});(0,_vitest.expect)((0,_sizing.parseSizing)("h-auto")).toEqual({height:"auto"});(0,_vitest.expect)((0,_sizing.parseSizing)("w-full")).toEqual({width:"100%"});(0,_vitest.expect)((0,_sizing.parseSizing)("h-full")).toEqual({height:"100%"});});(0,_vitest.it)("should parse px (1 pixel) across all sizing utilities",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-px")).toEqual({width:1});(0,_vitest.expect)((0,_sizing.parseSizing)("h-px")).toEqual({height:1});(0,_vitest.expect)((0,_sizing.parseSizing)("size-px")).toEqual({width:1,height:1});(0,_vitest.expect)((0,_sizing.parseSizing)("min-w-px")).toEqual({minWidth:1});(0,_vitest.expect)((0,_sizing.parseSizing)("min-h-px")).toEqual({minHeight:1});(0,_vitest.expect)((0,_sizing.parseSizing)("max-w-px")).toEqual({maxWidth:1});(0,_vitest.expect)((0,_sizing.parseSizing)("max-h-px")).toEqual({maxHeight:1});});});(0,_vitest.describe)("parseSizing - custom spacing",function(){var customSpacing={xs:4,sm:8,md:16,lg:32,xl:64,"4":20};(0,_vitest.it)("should support custom spacing values for width",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-xs",customSpacing)).toEqual({width:4});(0,_vitest.expect)((0,_sizing.parseSizing)("w-sm",customSpacing)).toEqual({width:8});(0,_vitest.expect)((0,_sizing.parseSizing)("w-lg",customSpacing)).toEqual({width:32});(0,_vitest.expect)((0,_sizing.parseSizing)("w-xl",customSpacing)).toEqual({width:64});});(0,_vitest.it)("should support custom spacing values for height",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("h-xs",customSpacing)).toEqual({height:4});(0,_vitest.expect)((0,_sizing.parseSizing)("h-md",customSpacing)).toEqual({height:16});(0,_vitest.expect)((0,_sizing.parseSizing)("h-xl",customSpacing)).toEqual({height:64});});(0,_vitest.it)("should support custom spacing values for min/max dimensions",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("min-w-sm",customSpacing)).toEqual({minWidth:8});(0,_vitest.expect)((0,_sizing.parseSizing)("min-h-lg",customSpacing)).toEqual({minHeight:32});(0,_vitest.expect)((0,_sizing.parseSizing)("max-w-xl",customSpacing)).toEqual({maxWidth:64});(0,_vitest.expect)((0,_sizing.parseSizing)("max-h-md",customSpacing)).toEqual({maxHeight:16});});(0,_vitest.it)("should allow custom spacing to override preset values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-4",customSpacing)).toEqual({width:20});(0,_vitest.expect)((0,_sizing.parseSizing)("h-4",customSpacing)).toEqual({height:20});});(0,_vitest.it)("should prefer arbitrary values over custom spacing",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-[24px]",customSpacing)).toEqual({width:24});(0,_vitest.expect)((0,_sizing.parseSizing)("h-[50]",customSpacing)).toEqual({height:50});});(0,_vitest.it)("should fall back to preset scale for unknown custom keys",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-8",customSpacing)).toEqual({width:32});(0,_vitest.expect)((0,_sizing.parseSizing)("h-12",customSpacing)).toEqual({height:48});});(0,_vitest.it)("should preserve percentage values with custom spacing",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-full",customSpacing)).toEqual({width:"100%"});(0,_vitest.expect)((0,_sizing.parseSizing)("h-1/2",customSpacing)).toEqual({height:"50%"});});(0,_vitest.it)("should work without custom spacing (backward compatible)",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("w-4")).toEqual({width:16});(0,_vitest.expect)((0,_sizing.parseSizing)("h-8")).toEqual({height:32});});});(0,_vitest.describe)("parseSizing - size (width + height)",function(){(0,_vitest.it)("should parse size with numeric values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("size-0")).toEqual({width:0,height:0});(0,_vitest.expect)((0,_sizing.parseSizing)("size-4")).toEqual({width:16,height:16});(0,_vitest.expect)((0,_sizing.parseSizing)("size-8")).toEqual({width:32,height:32});(0,_vitest.expect)((0,_sizing.parseSizing)("size-96")).toEqual({width:384,height:384});});(0,_vitest.it)("should parse size with fractional values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("size-0.5")).toEqual({width:2,height:2});(0,_vitest.expect)((0,_sizing.parseSizing)("size-1.5")).toEqual({width:6,height:6});(0,_vitest.expect)((0,_sizing.parseSizing)("size-2.5")).toEqual({width:10,height:10});});(0,_vitest.it)("should parse size with percentage values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("size-full")).toEqual({width:"100%",height:"100%"});(0,_vitest.expect)((0,_sizing.parseSizing)("size-1/2")).toEqual({width:"50%",height:"50%"});(0,_vitest.expect)((0,_sizing.parseSizing)("size-1/3")).toEqual({width:"33.333333%",height:"33.333333%"});(0,_vitest.expect)((0,_sizing.parseSizing)("size-2/3")).toEqual({width:"66.666667%",height:"66.666667%"});(0,_vitest.expect)((0,_sizing.parseSizing)("size-1/4")).toEqual({width:"25%",height:"25%"});(0,_vitest.expect)((0,_sizing.parseSizing)("size-3/4")).toEqual({width:"75%",height:"75%"});});(0,_vitest.it)("should parse size with special values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("size-auto")).toEqual({width:"auto",height:"auto"});});(0,_vitest.it)("should parse size with arbitrary pixel values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("size-[123px]")).toEqual({width:123,height:123});(0,_vitest.expect)((0,_sizing.parseSizing)("size-[200]")).toEqual({width:200,height:200});(0,_vitest.expect)((0,_sizing.parseSizing)("size-[50px]")).toEqual({width:50,height:50});});(0,_vitest.it)("should parse size with arbitrary percentage values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("size-[50%]")).toEqual({width:"50%",height:"50%"});(0,_vitest.expect)((0,_sizing.parseSizing)("size-[33.333%]")).toEqual({width:"33.333%",height:"33.333%"});(0,_vitest.expect)((0,_sizing.parseSizing)("size-[85%]")).toEqual({width:"85%",height:"85%"});});(0,_vitest.it)("should support custom spacing values for size",function(){var customSpacing={sm:8,md:16,lg:32,xl:64};(0,_vitest.expect)((0,_sizing.parseSizing)("size-sm",customSpacing)).toEqual({width:8,height:8});(0,_vitest.expect)((0,_sizing.parseSizing)("size-md",customSpacing)).toEqual({width:16,height:16});(0,_vitest.expect)((0,_sizing.parseSizing)("size-lg",customSpacing)).toEqual({width:32,height:32});(0,_vitest.expect)((0,_sizing.parseSizing)("size-xl",customSpacing)).toEqual({width:64,height:64});});(0,_vitest.it)("should allow custom spacing to override preset values",function(){var customSpacing={"4":20};(0,_vitest.expect)((0,_sizing.parseSizing)("size-4",customSpacing)).toEqual({width:20,height:20});});(0,_vitest.it)("should prefer arbitrary values over custom spacing",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("size-[24px]",{"4":20})).toEqual({width:24,height:24});(0,_vitest.expect)((0,_sizing.parseSizing)("size-[50]",{sm:8})).toEqual({width:50,height:50});});(0,_vitest.it)("should handle all fractional percentage variants",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("size-1/5")).toEqual({width:"20%",height:"20%"});(0,_vitest.expect)((0,_sizing.parseSizing)("size-2/5")).toEqual({width:"40%",height:"40%"});(0,_vitest.expect)((0,_sizing.parseSizing)("size-3/5")).toEqual({width:"60%",height:"60%"});(0,_vitest.expect)((0,_sizing.parseSizing)("size-4/5")).toEqual({width:"80%",height:"80%"});(0,_vitest.expect)((0,_sizing.parseSizing)("size-1/6")).toEqual({width:"16.666667%",height:"16.666667%"});(0,_vitest.expect)((0,_sizing.parseSizing)("size-5/6")).toEqual({width:"83.333333%",height:"83.333333%"});});(0,_vitest.it)("should handle edge case size values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("size-0")).toEqual({width:0,height:0});});(0,_vitest.it)("should return null for invalid size values",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("size-invalid")).toBeNull();(0,_vitest.expect)((0,_sizing.parseSizing)("size-999")).toBeNull();});(0,_vitest.it)("should return null for arbitrary values with unsupported units",function(){(0,_vitest.expect)((0,_sizing.parseSizing)("size-[16rem]")).toBeNull();(0,_vitest.expect)((0,_sizing.parseSizing)("size-[2em]")).toBeNull();(0,_vitest.expect)((0,_sizing.parseSizing)("size-[50vh]")).toBeNull();});});
|
package/dist/parser/spacing.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.SPACING_SCALE=void 0;exports.parseSpacing=parseSpacing;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var SPACING_SCALE=exports.SPACING_SCALE={0:0,0.5:2,1:4,1.5:6,2:8,2.5:10,3:12,3.5:14,4:16,5:20,6:24,7:28,8:32,9:36,10:40,11:44,12:48,14:56,16:64,20:80,24:96,28:112,32:128,36:144,40:160,44:176,48:192,52:208,56:224,60:240,64:256,72:288,80:320,96:384};function parseArbitrarySpacing(value){var pxMatch=value.match(/^\[(-?\d+(?:\.\d+)?)(?:px)?\]$/);if(pxMatch){return parseFloat(pxMatch[1]);}if(value.startsWith("[")&&value.endsWith("]")){if(process.env.NODE_ENV!=="production"){console.warn(`[react-native-tailwind] Unsupported arbitrary spacing value: ${value}. Only px values are supported (e.g., [16px], [16], [4.5px], [4.5]).`);}return null;}return null;}function parseSpacing(cls,customSpacing){var spacingMap=customSpacing?Object.assign({},SPACING_SCALE,customSpacing):SPACING_SCALE;var autoMarginMatch=cls.match(/^m([xytrblse]?)-auto$/);if(autoMarginMatch){var dir=autoMarginMatch[1];return getMarginStyle(dir,"auto");}var marginMatch=cls.match(/^(-?)m([xytrblse]?)-(.+)$/);if(marginMatch){var _marginMatch=(0,_slicedToArray2.default)(marginMatch,4),negativePrefix=_marginMatch[1],_dir=_marginMatch[2],valueStr=_marginMatch[3];var isNegative=negativePrefix==="-";var arbitraryValue=parseArbitrarySpacing(valueStr);if(arbitraryValue!==null){var finalValue=isNegative?-arbitraryValue:arbitraryValue;return getMarginStyle(_dir,finalValue);}var scaleValue=spacingMap[valueStr];if(scaleValue!==undefined){var _finalValue=isNegative?-scaleValue:scaleValue;return getMarginStyle(_dir,_finalValue);}}var paddingMatch=cls.match(/^p([xytrblse]?)-(.+)$/);if(paddingMatch){var _paddingMatch=(0,_slicedToArray2.default)(paddingMatch,3),_dir2=_paddingMatch[1],_valueStr=_paddingMatch[2];var _arbitraryValue=parseArbitrarySpacing(_valueStr);if(_arbitraryValue!==null){return getPaddingStyle(_dir2,_arbitraryValue);}var _scaleValue=spacingMap[_valueStr];if(_scaleValue!==undefined){return getPaddingStyle(_dir2,_scaleValue);}}var gapMatch=cls.match(/^gap-(.+)$/);if(gapMatch){var _valueStr2=gapMatch[1];var _arbitraryValue2=parseArbitrarySpacing(_valueStr2);if(_arbitraryValue2!==null){return{gap:_arbitraryValue2};}var _scaleValue2=spacingMap[_valueStr2];if(_scaleValue2!==undefined){return{gap:_scaleValue2};}}return null;}function getMarginStyle(dir,value){switch(dir){case"":return{margin:value};case"x":return{marginHorizontal:value};case"y":return{marginVertical:value};case"t":return{marginTop:value};case"r":return{marginRight:value};case"b":return{marginBottom:value};case"l":return{marginLeft:value};case"s":return{marginStart:value};case"e":return{marginEnd:value};default:return{};}}function getPaddingStyle(dir,value){switch(dir){case"":return{padding:value};case"x":return{paddingHorizontal:value};case"y":return{paddingVertical:value};case"t":return{paddingTop:value};case"r":return{paddingRight:value};case"b":return{paddingBottom:value};case"l":return{paddingLeft:value};case"s":return{paddingStart:value};case"e":return{paddingEnd:value};default:return{};}}
|
|
1
|
+
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={px:1,0:0,0.5:2,1:4,1.5:6,2:8,2.5:10,3:12,3.5:14,4:16,5:20,6:24,7:28,8:32,9:36,10:40,11:44,12:48,14:56,16:64,20:80,24:96,28:112,32:128,36:144,40:160,44:176,48:192,52:208,56:224,60:240,64:256,72:288,80:320,96:384};function parseArbitrarySpacing(value){var pxMatch=value.match(/^\[(-?\d+(?:\.\d+)?)(?:px)?\]$/);if(pxMatch){return parseFloat(pxMatch[1]);}if(value.startsWith("[")&&value.endsWith("]")){if(process.env.NODE_ENV!=="production"){console.warn(`[react-native-tailwind] Unsupported arbitrary spacing value: ${value}. Only px values are supported (e.g., [16px], [16], [4.5px], [4.5]).`);}return null;}return null;}function parseSpacing(cls,customSpacing){var spacingMap=customSpacing?Object.assign({},SPACING_SCALE,customSpacing):SPACING_SCALE;var autoMarginMatch=cls.match(/^m([xytrblse]?)-auto$/);if(autoMarginMatch){var dir=autoMarginMatch[1];return getMarginStyle(dir,"auto");}var marginMatch=cls.match(/^(-?)m([xytrblse]?)-(.+)$/);if(marginMatch){var _marginMatch=(0,_slicedToArray2.default)(marginMatch,4),negativePrefix=_marginMatch[1],_dir=_marginMatch[2],valueStr=_marginMatch[3];var isNegative=negativePrefix==="-";var arbitraryValue=parseArbitrarySpacing(valueStr);if(arbitraryValue!==null){var finalValue=isNegative?-arbitraryValue:arbitraryValue;return getMarginStyle(_dir,finalValue);}var scaleValue=spacingMap[valueStr];if(scaleValue!==undefined){var _finalValue=isNegative?-scaleValue:scaleValue;return getMarginStyle(_dir,_finalValue);}}var paddingMatch=cls.match(/^p([xytrblse]?)-(.+)$/);if(paddingMatch){var _paddingMatch=(0,_slicedToArray2.default)(paddingMatch,3),_dir2=_paddingMatch[1],_valueStr=_paddingMatch[2];var _arbitraryValue=parseArbitrarySpacing(_valueStr);if(_arbitraryValue!==null){return getPaddingStyle(_dir2,_arbitraryValue);}var _scaleValue=spacingMap[_valueStr];if(_scaleValue!==undefined){return getPaddingStyle(_dir2,_scaleValue);}}var gapMatch=cls.match(/^gap-(.+)$/);if(gapMatch){var _valueStr2=gapMatch[1];var _arbitraryValue2=parseArbitrarySpacing(_valueStr2);if(_arbitraryValue2!==null){return{gap:_arbitraryValue2};}var _scaleValue2=spacingMap[_valueStr2];if(_scaleValue2!==undefined){return{gap:_scaleValue2};}}return null;}function getMarginStyle(dir,value){switch(dir){case"":return{margin:value};case"x":return{marginHorizontal:value};case"y":return{marginVertical:value};case"t":return{marginTop:value};case"r":return{marginRight:value};case"b":return{marginBottom:value};case"l":return{marginLeft:value};case"s":return{marginStart:value};case"e":return{marginEnd:value};default:return{};}}function getPaddingStyle(dir,value){switch(dir){case"":return{padding:value};case"x":return{paddingHorizontal:value};case"y":return{paddingVertical:value};case"t":return{paddingTop:value};case"r":return{paddingRight:value};case"b":return{paddingBottom:value};case"l":return{paddingLeft:value};case"s":return{paddingStart:value};case"e":return{paddingEnd:value};default:return{};}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var _vitest=require("vitest");var _spacing=require("./spacing");(0,_vitest.describe)("SPACING_SCALE",function(){(0,_vitest.it)("should export complete spacing scale",function(){(0,_vitest.expect)(_spacing.SPACING_SCALE).toMatchSnapshot();});});(0,_vitest.describe)("parseSpacing - margin",function(){(0,_vitest.it)("should parse margin all sides",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-0")).toEqual({margin:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-4")).toEqual({margin:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-8")).toEqual({margin:32});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-96")).toEqual({margin:384});});(0,_vitest.it)("should parse margin with fractional values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-0.5")).toEqual({margin:2});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-1.5")).toEqual({margin:6});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-2.5")).toEqual({margin:10});});(0,_vitest.it)("should parse margin horizontal",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("mx-0")).toEqual({marginHorizontal:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("mx-4")).toEqual({marginHorizontal:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("mx-8")).toEqual({marginHorizontal:32});});(0,_vitest.it)("should parse margin vertical",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("my-0")).toEqual({marginVertical:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("my-4")).toEqual({marginVertical:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("my-8")).toEqual({marginVertical:32});});(0,_vitest.it)("should parse margin directional",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("mt-4")).toEqual({marginTop:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("mr-4")).toEqual({marginRight:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("mb-4")).toEqual({marginBottom:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("ml-4")).toEqual({marginLeft:16});});(0,_vitest.it)("should parse margin with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[16px]")).toEqual({margin:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[16]")).toEqual({margin:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[100px]")).toEqual({margin:100});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[100]")).toEqual({margin:100});});(0,_vitest.it)("should parse margin directional with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("mt-[24px]")).toEqual({marginTop:24});(0,_vitest.expect)((0,_spacing.parseSpacing)("mr-[32]")).toEqual({marginRight:32});(0,_vitest.expect)((0,_spacing.parseSpacing)("mb-[16px]")).toEqual({marginBottom:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("ml-[48]")).toEqual({marginLeft:48});});(0,_vitest.it)("should parse margin horizontal/vertical with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("mx-[20px]")).toEqual({marginHorizontal:20});(0,_vitest.expect)((0,_spacing.parseSpacing)("my-[30]")).toEqual({marginVertical:30});});});(0,_vitest.describe)("parseSpacing - negative margin",function(){(0,_vitest.it)("should parse negative margin all sides",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-0")).toEqual({margin:-0});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-4")).toEqual({margin:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-8")).toEqual({margin:-32});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-96")).toEqual({margin:-384});});(0,_vitest.it)("should parse negative margin with fractional values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-0.5")).toEqual({margin:-2});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-1.5")).toEqual({margin:-6});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-2.5")).toEqual({margin:-10});});(0,_vitest.it)("should parse negative margin horizontal",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-mx-4")).toEqual({marginHorizontal:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-mx-8")).toEqual({marginHorizontal:-32});});(0,_vitest.it)("should parse negative margin vertical",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-my-4")).toEqual({marginVertical:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-my-8")).toEqual({marginVertical:-32});});(0,_vitest.it)("should parse negative margin directional",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-mt-4")).toEqual({marginTop:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-mr-4")).toEqual({marginRight:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-mb-4")).toEqual({marginBottom:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-ml-4")).toEqual({marginLeft:-16});});(0,_vitest.it)("should parse negative margin with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-[16px]")).toEqual({margin:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-[16]")).toEqual({margin:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-[100px]")).toEqual({margin:-100});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-[100]")).toEqual({margin:-100});});(0,_vitest.it)("should parse negative margin directional with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-mt-[24px]")).toEqual({marginTop:-24});(0,_vitest.expect)((0,_spacing.parseSpacing)("-mr-[32]")).toEqual({marginRight:-32});(0,_vitest.expect)((0,_spacing.parseSpacing)("-mb-[16px]")).toEqual({marginBottom:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-ml-[48]")).toEqual({marginLeft:-48});});(0,_vitest.it)("should parse negative margin horizontal/vertical with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-mx-[20px]")).toEqual({marginHorizontal:-20});(0,_vitest.expect)((0,_spacing.parseSpacing)("-my-[30]")).toEqual({marginVertical:-30});});(0,_vitest.it)("should not parse negative padding (invalid)",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-p-4")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("-px-4")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("-pt-4")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("-p-[16px]")).toBeNull();});(0,_vitest.it)("should not parse negative gap (invalid)",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-gap-4")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("-gap-[16px]")).toBeNull();});});(0,_vitest.describe)("parseSpacing - padding",function(){(0,_vitest.it)("should parse padding all sides",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("p-0")).toEqual({padding:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-4")).toEqual({padding:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-8")).toEqual({padding:32});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-96")).toEqual({padding:384});});(0,_vitest.it)("should parse padding with fractional values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("p-0.5")).toEqual({padding:2});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-1.5")).toEqual({padding:6});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-2.5")).toEqual({padding:10});});(0,_vitest.it)("should parse padding horizontal",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("px-0")).toEqual({paddingHorizontal:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("px-4")).toEqual({paddingHorizontal:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("px-8")).toEqual({paddingHorizontal:32});});(0,_vitest.it)("should parse padding vertical",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("py-0")).toEqual({paddingVertical:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("py-4")).toEqual({paddingVertical:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("py-8")).toEqual({paddingVertical:32});});(0,_vitest.it)("should parse padding directional",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("pt-4")).toEqual({paddingTop:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("pr-4")).toEqual({paddingRight:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("pb-4")).toEqual({paddingBottom:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("pl-4")).toEqual({paddingLeft:16});});(0,_vitest.it)("should parse padding with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("p-[16px]")).toEqual({padding:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-[16]")).toEqual({padding:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-[100px]")).toEqual({padding:100});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-[100]")).toEqual({padding:100});});(0,_vitest.it)("should parse padding directional with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("pt-[24px]")).toEqual({paddingTop:24});(0,_vitest.expect)((0,_spacing.parseSpacing)("pr-[32]")).toEqual({paddingRight:32});(0,_vitest.expect)((0,_spacing.parseSpacing)("pb-[16px]")).toEqual({paddingBottom:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("pl-[48]")).toEqual({paddingLeft:48});});(0,_vitest.it)("should parse padding horizontal/vertical with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("px-[20px]")).toEqual({paddingHorizontal:20});(0,_vitest.expect)((0,_spacing.parseSpacing)("py-[30]")).toEqual({paddingVertical:30});});});(0,_vitest.describe)("parseSpacing - gap",function(){(0,_vitest.it)("should parse gap",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-0")).toEqual({gap:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-4")).toEqual({gap:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-8")).toEqual({gap:32});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-96")).toEqual({gap:384});});(0,_vitest.it)("should parse gap with fractional values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-0.5")).toEqual({gap:2});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-1.5")).toEqual({gap:6});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-2.5")).toEqual({gap:10});});(0,_vitest.it)("should parse gap with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[16px]")).toEqual({gap:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[16]")).toEqual({gap:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[100px]")).toEqual({gap:100});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[100]")).toEqual({gap:100});});});(0,_vitest.describe)("parseSpacing - edge cases",function(){(0,_vitest.it)("should return null for invalid classes",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("invalid")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("m")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("p")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("margin-4")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("padding-4")).toBeNull();});(0,_vitest.it)("should return null for invalid spacing values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-invalid")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("p-999")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-abc")).toBeNull();});(0,_vitest.it)("should return null for arbitrary values with unsupported units",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[16rem]")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("p-[2em]")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[50%]")).toBeNull();});(0,_vitest.it)("should return null for malformed arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[16")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("p-16]")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[]")).toBeNull();});(0,_vitest.it)("should handle edge case spacing values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-0")).toEqual({margin:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-0")).toEqual({padding:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-0")).toEqual({gap:0});});(0,_vitest.it)("should not match partial class names",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("sm-4")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("margin-4")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("padding-4")).toBeNull();});});(0,_vitest.describe)("parseSpacing - decimal arbitrary values",function(){(0,_vitest.it)("should parse margin with decimal arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[4.5px]")).toEqual({margin:4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[4.5]")).toEqual({margin:4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[16.75px]")).toEqual({margin:16.75});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[16.75]")).toEqual({margin:16.75});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[100.25px]")).toEqual({margin:100.25});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[0.5]")).toEqual({margin:0.5});});(0,_vitest.it)("should parse padding with decimal arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("p-[4.5px]")).toEqual({padding:4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-[4.5]")).toEqual({padding:4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("pl-[4.5px]")).toEqual({paddingLeft:4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("pl-[4.5]")).toEqual({paddingLeft:4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("pr-[16.75px]")).toEqual({paddingRight:16.75});(0,_vitest.expect)((0,_spacing.parseSpacing)("pt-[10.5]")).toEqual({paddingTop:10.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("pb-[20.25px]")).toEqual({paddingBottom:20.25});});(0,_vitest.it)("should parse padding horizontal/vertical with decimal arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("px-[4.5px]")).toEqual({paddingHorizontal:4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("py-[10.75]")).toEqual({paddingVertical:10.75});});(0,_vitest.it)("should parse gap with decimal arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[4.5px]")).toEqual({gap:4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[4.5]")).toEqual({gap:4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[16.75px]")).toEqual({gap:16.75});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[0.5]")).toEqual({gap:0.5});});(0,_vitest.it)("should parse negative margin with decimal arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-[4.5px]")).toEqual({margin:-4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-[4.5]")).toEqual({margin:-4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-[10.5px]")).toEqual({margin:-10.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("-mt-[16.75px]")).toEqual({marginTop:-16.75});(0,_vitest.expect)((0,_spacing.parseSpacing)("-ml-[8.25]")).toEqual({marginLeft:-8.25});(0,_vitest.expect)((0,_spacing.parseSpacing)("-mx-[12.5px]")).toEqual({marginHorizontal:-12.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("-my-[20.75]")).toEqual({marginVertical:-20.75});});(0,_vitest.it)("should parse margin directional with decimal arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("mt-[4.5px]")).toEqual({marginTop:4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("mr-[8.25]")).toEqual({marginRight:8.25});(0,_vitest.expect)((0,_spacing.parseSpacing)("mb-[16.75px]")).toEqual({marginBottom:16.75});(0,_vitest.expect)((0,_spacing.parseSpacing)("ml-[12.5]")).toEqual({marginLeft:12.5});});(0,_vitest.it)("should parse margin horizontal/vertical with decimal arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("mx-[4.5px]")).toEqual({marginHorizontal:4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("my-[10.75]")).toEqual({marginVertical:10.75});});(0,_vitest.it)("should handle edge case decimal values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[0.1px]")).toEqual({margin:0.1});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-[0.001]")).toEqual({padding:0.001});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[999.999px]")).toEqual({gap:999.999});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-[0.5]")).toEqual({margin:-0.5});});});(0,_vitest.describe)("parseSpacing - comprehensive coverage",function(){(0,_vitest.it)("should parse all margin directions with same value",function(){var value=16;(0,_vitest.expect)((0,_spacing.parseSpacing)("m-4")).toEqual({margin:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("mx-4")).toEqual({marginHorizontal:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("my-4")).toEqual({marginVertical:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("mt-4")).toEqual({marginTop:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("mr-4")).toEqual({marginRight:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("mb-4")).toEqual({marginBottom:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("ml-4")).toEqual({marginLeft:value});});(0,_vitest.it)("should parse all padding directions with same value",function(){var value=16;(0,_vitest.expect)((0,_spacing.parseSpacing)("p-4")).toEqual({padding:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("px-4")).toEqual({paddingHorizontal:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("py-4")).toEqual({paddingVertical:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("pt-4")).toEqual({paddingTop:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("pr-4")).toEqual({paddingRight:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("pb-4")).toEqual({paddingBottom:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("pl-4")).toEqual({paddingLeft:value});});(0,_vitest.it)("should handle large spacing values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-96")).toEqual({margin:384});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-96")).toEqual({padding:384});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-96")).toEqual({gap:384});});(0,_vitest.it)("should handle arbitrary values across all margin directions",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[50px]")).toEqual({margin:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("mx-[50px]")).toEqual({marginHorizontal:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("my-[50px]")).toEqual({marginVertical:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("mt-[50px]")).toEqual({marginTop:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("mr-[50px]")).toEqual({marginRight:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("mb-[50px]")).toEqual({marginBottom:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("ml-[50px]")).toEqual({marginLeft:50});});(0,_vitest.it)("should handle arbitrary values across all padding directions",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("p-[50px]")).toEqual({padding:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("px-[50px]")).toEqual({paddingHorizontal:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("py-[50px]")).toEqual({paddingVertical:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("pt-[50px]")).toEqual({paddingTop:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("pr-[50px]")).toEqual({paddingRight:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("pb-[50px]")).toEqual({paddingBottom:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("pl-[50px]")).toEqual({paddingLeft:50});});});(0,_vitest.describe)("parseSpacing - logical margin (RTL-aware)",function(){(0,_vitest.it)("should parse margin start",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("ms-0")).toEqual({marginStart:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("ms-4")).toEqual({marginStart:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("ms-8")).toEqual({marginStart:32});});(0,_vitest.it)("should parse margin end",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("me-0")).toEqual({marginEnd:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("me-4")).toEqual({marginEnd:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("me-8")).toEqual({marginEnd:32});});(0,_vitest.it)("should parse margin start/end with fractional values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("ms-0.5")).toEqual({marginStart:2});(0,_vitest.expect)((0,_spacing.parseSpacing)("me-1.5")).toEqual({marginEnd:6});(0,_vitest.expect)((0,_spacing.parseSpacing)("ms-2.5")).toEqual({marginStart:10});});(0,_vitest.it)("should parse margin start/end with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("ms-[16px]")).toEqual({marginStart:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("ms-[16]")).toEqual({marginStart:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("me-[24px]")).toEqual({marginEnd:24});(0,_vitest.expect)((0,_spacing.parseSpacing)("me-[24]")).toEqual({marginEnd:24});});(0,_vitest.it)("should parse negative margin start/end",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-ms-4")).toEqual({marginStart:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-me-4")).toEqual({marginEnd:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-ms-8")).toEqual({marginStart:-32});(0,_vitest.expect)((0,_spacing.parseSpacing)("-me-8")).toEqual({marginEnd:-32});});(0,_vitest.it)("should parse negative margin start/end with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-ms-[16px]")).toEqual({marginStart:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-me-[24]")).toEqual({marginEnd:-24});});});(0,_vitest.describe)("parseSpacing - logical padding (RTL-aware)",function(){(0,_vitest.it)("should parse padding start",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("ps-0")).toEqual({paddingStart:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("ps-4")).toEqual({paddingStart:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("ps-8")).toEqual({paddingStart:32});});(0,_vitest.it)("should parse padding end",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("pe-0")).toEqual({paddingEnd:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("pe-4")).toEqual({paddingEnd:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("pe-8")).toEqual({paddingEnd:32});});(0,_vitest.it)("should parse padding start/end with fractional values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("ps-0.5")).toEqual({paddingStart:2});(0,_vitest.expect)((0,_spacing.parseSpacing)("pe-1.5")).toEqual({paddingEnd:6});(0,_vitest.expect)((0,_spacing.parseSpacing)("ps-2.5")).toEqual({paddingStart:10});});(0,_vitest.it)("should parse padding start/end with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("ps-[16px]")).toEqual({paddingStart:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("ps-[16]")).toEqual({paddingStart:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("pe-[24px]")).toEqual({paddingEnd:24});(0,_vitest.expect)((0,_spacing.parseSpacing)("pe-[24]")).toEqual({paddingEnd:24});});});(0,_vitest.describe)("parseSpacing - auto margin",function(){(0,_vitest.it)("should parse m-auto",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-auto")).toEqual({margin:"auto"});});(0,_vitest.it)("should parse mx-auto",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("mx-auto")).toEqual({marginHorizontal:"auto"});});(0,_vitest.it)("should parse my-auto",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("my-auto")).toEqual({marginVertical:"auto"});});(0,_vitest.it)("should parse directional auto margins",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("mt-auto")).toEqual({marginTop:"auto"});(0,_vitest.expect)((0,_spacing.parseSpacing)("mr-auto")).toEqual({marginRight:"auto"});(0,_vitest.expect)((0,_spacing.parseSpacing)("mb-auto")).toEqual({marginBottom:"auto"});(0,_vitest.expect)((0,_spacing.parseSpacing)("ml-auto")).toEqual({marginLeft:"auto"});});(0,_vitest.it)("should parse logical auto margins (RTL-aware)",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("ms-auto")).toEqual({marginStart:"auto"});(0,_vitest.expect)((0,_spacing.parseSpacing)("me-auto")).toEqual({marginEnd:"auto"});});(0,_vitest.it)("should not parse padding auto (not valid in Tailwind)",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("p-auto")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("px-auto")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("py-auto")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("pt-auto")).toBeNull();});(0,_vitest.it)("should not parse gap auto (not valid in Tailwind)",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-auto")).toBeNull();});});(0,_vitest.describe)("parseSpacing - custom spacing",function(){var customSpacing={xs:4,sm:8,md:16,lg:32,xl:64,"4":20};(0,_vitest.it)("should support custom spacing values for margin",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-xs",customSpacing)).toEqual({margin:4});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-sm",customSpacing)).toEqual({margin:8});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-lg",customSpacing)).toEqual({margin:32});(0,_vitest.expect)((0,_spacing.parseSpacing)("mx-xl",customSpacing)).toEqual({marginHorizontal:64});(0,_vitest.expect)((0,_spacing.parseSpacing)("mt-md",customSpacing)).toEqual({marginTop:16});});(0,_vitest.it)("should support custom spacing values for padding",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("p-xs",customSpacing)).toEqual({padding:4});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-sm",customSpacing)).toEqual({padding:8});(0,_vitest.expect)((0,_spacing.parseSpacing)("px-lg",customSpacing)).toEqual({paddingHorizontal:32});(0,_vitest.expect)((0,_spacing.parseSpacing)("pt-xl",customSpacing)).toEqual({paddingTop:64});});(0,_vitest.it)("should support custom spacing values for gap",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-xs",customSpacing)).toEqual({gap:4});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-md",customSpacing)).toEqual({gap:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-xl",customSpacing)).toEqual({gap:64});});(0,_vitest.it)("should allow custom spacing to override preset values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-4",customSpacing)).toEqual({margin:20});});(0,_vitest.it)("should prefer arbitrary values over custom spacing",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[24px]",customSpacing)).toEqual({margin:24});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-[50]",customSpacing)).toEqual({padding:50});});(0,_vitest.it)("should support negative margins with custom spacing",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-xs",customSpacing)).toEqual({margin:-4});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-lg",customSpacing)).toEqual({margin:-32});(0,_vitest.expect)((0,_spacing.parseSpacing)("-mx-xl",customSpacing)).toEqual({marginHorizontal:-64});});(0,_vitest.it)("should fall back to preset scale for unknown custom keys",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-8",customSpacing)).toEqual({margin:32});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-12",customSpacing)).toEqual({padding:48});});(0,_vitest.it)("should work without custom spacing (backward compatible)",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-4")).toEqual({margin:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-8")).toEqual({padding:32});});});
|
|
1
|
+
var _vitest=require("vitest");var _spacing=require("./spacing");(0,_vitest.describe)("SPACING_SCALE",function(){(0,_vitest.it)("should export complete spacing scale",function(){(0,_vitest.expect)(_spacing.SPACING_SCALE).toMatchSnapshot();});});(0,_vitest.describe)("parseSpacing - margin",function(){(0,_vitest.it)("should parse margin all sides",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-0")).toEqual({margin:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-4")).toEqual({margin:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-8")).toEqual({margin:32});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-96")).toEqual({margin:384});});(0,_vitest.it)("should parse margin with fractional values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-0.5")).toEqual({margin:2});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-1.5")).toEqual({margin:6});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-2.5")).toEqual({margin:10});});(0,_vitest.it)("should parse margin horizontal",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("mx-0")).toEqual({marginHorizontal:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("mx-4")).toEqual({marginHorizontal:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("mx-8")).toEqual({marginHorizontal:32});});(0,_vitest.it)("should parse margin vertical",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("my-0")).toEqual({marginVertical:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("my-4")).toEqual({marginVertical:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("my-8")).toEqual({marginVertical:32});});(0,_vitest.it)("should parse margin directional",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("mt-4")).toEqual({marginTop:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("mr-4")).toEqual({marginRight:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("mb-4")).toEqual({marginBottom:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("ml-4")).toEqual({marginLeft:16});});(0,_vitest.it)("should parse margin with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[16px]")).toEqual({margin:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[16]")).toEqual({margin:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[100px]")).toEqual({margin:100});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[100]")).toEqual({margin:100});});(0,_vitest.it)("should parse margin directional with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("mt-[24px]")).toEqual({marginTop:24});(0,_vitest.expect)((0,_spacing.parseSpacing)("mr-[32]")).toEqual({marginRight:32});(0,_vitest.expect)((0,_spacing.parseSpacing)("mb-[16px]")).toEqual({marginBottom:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("ml-[48]")).toEqual({marginLeft:48});});(0,_vitest.it)("should parse margin horizontal/vertical with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("mx-[20px]")).toEqual({marginHorizontal:20});(0,_vitest.expect)((0,_spacing.parseSpacing)("my-[30]")).toEqual({marginVertical:30});});});(0,_vitest.describe)("parseSpacing - negative margin",function(){(0,_vitest.it)("should parse negative margin all sides",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-0")).toEqual({margin:-0});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-4")).toEqual({margin:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-8")).toEqual({margin:-32});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-96")).toEqual({margin:-384});});(0,_vitest.it)("should parse negative margin with fractional values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-0.5")).toEqual({margin:-2});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-1.5")).toEqual({margin:-6});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-2.5")).toEqual({margin:-10});});(0,_vitest.it)("should parse negative margin horizontal",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-mx-4")).toEqual({marginHorizontal:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-mx-8")).toEqual({marginHorizontal:-32});});(0,_vitest.it)("should parse negative margin vertical",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-my-4")).toEqual({marginVertical:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-my-8")).toEqual({marginVertical:-32});});(0,_vitest.it)("should parse negative margin directional",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-mt-4")).toEqual({marginTop:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-mr-4")).toEqual({marginRight:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-mb-4")).toEqual({marginBottom:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-ml-4")).toEqual({marginLeft:-16});});(0,_vitest.it)("should parse negative margin with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-[16px]")).toEqual({margin:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-[16]")).toEqual({margin:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-[100px]")).toEqual({margin:-100});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-[100]")).toEqual({margin:-100});});(0,_vitest.it)("should parse negative margin directional with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-mt-[24px]")).toEqual({marginTop:-24});(0,_vitest.expect)((0,_spacing.parseSpacing)("-mr-[32]")).toEqual({marginRight:-32});(0,_vitest.expect)((0,_spacing.parseSpacing)("-mb-[16px]")).toEqual({marginBottom:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-ml-[48]")).toEqual({marginLeft:-48});});(0,_vitest.it)("should parse negative margin horizontal/vertical with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-mx-[20px]")).toEqual({marginHorizontal:-20});(0,_vitest.expect)((0,_spacing.parseSpacing)("-my-[30]")).toEqual({marginVertical:-30});});(0,_vitest.it)("should not parse negative padding (invalid)",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-p-4")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("-px-4")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("-pt-4")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("-p-[16px]")).toBeNull();});(0,_vitest.it)("should not parse negative gap (invalid)",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-gap-4")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("-gap-[16px]")).toBeNull();});});(0,_vitest.describe)("parseSpacing - padding",function(){(0,_vitest.it)("should parse padding all sides",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("p-0")).toEqual({padding:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-4")).toEqual({padding:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-8")).toEqual({padding:32});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-96")).toEqual({padding:384});});(0,_vitest.it)("should parse padding with fractional values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("p-0.5")).toEqual({padding:2});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-1.5")).toEqual({padding:6});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-2.5")).toEqual({padding:10});});(0,_vitest.it)("should parse padding horizontal",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("px-0")).toEqual({paddingHorizontal:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("px-4")).toEqual({paddingHorizontal:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("px-8")).toEqual({paddingHorizontal:32});});(0,_vitest.it)("should parse padding vertical",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("py-0")).toEqual({paddingVertical:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("py-4")).toEqual({paddingVertical:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("py-8")).toEqual({paddingVertical:32});});(0,_vitest.it)("should parse padding directional",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("pt-4")).toEqual({paddingTop:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("pr-4")).toEqual({paddingRight:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("pb-4")).toEqual({paddingBottom:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("pl-4")).toEqual({paddingLeft:16});});(0,_vitest.it)("should parse padding with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("p-[16px]")).toEqual({padding:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-[16]")).toEqual({padding:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-[100px]")).toEqual({padding:100});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-[100]")).toEqual({padding:100});});(0,_vitest.it)("should parse padding directional with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("pt-[24px]")).toEqual({paddingTop:24});(0,_vitest.expect)((0,_spacing.parseSpacing)("pr-[32]")).toEqual({paddingRight:32});(0,_vitest.expect)((0,_spacing.parseSpacing)("pb-[16px]")).toEqual({paddingBottom:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("pl-[48]")).toEqual({paddingLeft:48});});(0,_vitest.it)("should parse padding horizontal/vertical with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("px-[20px]")).toEqual({paddingHorizontal:20});(0,_vitest.expect)((0,_spacing.parseSpacing)("py-[30]")).toEqual({paddingVertical:30});});});(0,_vitest.describe)("parseSpacing - gap",function(){(0,_vitest.it)("should parse gap",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-0")).toEqual({gap:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-4")).toEqual({gap:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-8")).toEqual({gap:32});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-96")).toEqual({gap:384});});(0,_vitest.it)("should parse gap with fractional values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-0.5")).toEqual({gap:2});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-1.5")).toEqual({gap:6});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-2.5")).toEqual({gap:10});});(0,_vitest.it)("should parse gap with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[16px]")).toEqual({gap:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[16]")).toEqual({gap:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[100px]")).toEqual({gap:100});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[100]")).toEqual({gap:100});});});(0,_vitest.describe)("parseSpacing - edge cases",function(){(0,_vitest.it)("should return null for invalid classes",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("invalid")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("m")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("p")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("margin-4")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("padding-4")).toBeNull();});(0,_vitest.it)("should return null for invalid spacing values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-invalid")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("p-999")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-abc")).toBeNull();});(0,_vitest.it)("should return null for arbitrary values with unsupported units",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[16rem]")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("p-[2em]")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[50%]")).toBeNull();});(0,_vitest.it)("should return null for malformed arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[16")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("p-16]")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[]")).toBeNull();});(0,_vitest.it)("should handle edge case spacing values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-0")).toEqual({margin:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-0")).toEqual({padding:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-0")).toEqual({gap:0});});(0,_vitest.it)("should parse px (1 pixel) across all spacing utilities",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-px")).toEqual({margin:1});(0,_vitest.expect)((0,_spacing.parseSpacing)("mx-px")).toEqual({marginHorizontal:1});(0,_vitest.expect)((0,_spacing.parseSpacing)("my-px")).toEqual({marginVertical:1});(0,_vitest.expect)((0,_spacing.parseSpacing)("mt-px")).toEqual({marginTop:1});(0,_vitest.expect)((0,_spacing.parseSpacing)("mr-px")).toEqual({marginRight:1});(0,_vitest.expect)((0,_spacing.parseSpacing)("mb-px")).toEqual({marginBottom:1});(0,_vitest.expect)((0,_spacing.parseSpacing)("ml-px")).toEqual({marginLeft:1});(0,_vitest.expect)((0,_spacing.parseSpacing)("ms-px")).toEqual({marginStart:1});(0,_vitest.expect)((0,_spacing.parseSpacing)("me-px")).toEqual({marginEnd:1});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-px")).toEqual({padding:1});(0,_vitest.expect)((0,_spacing.parseSpacing)("px-px")).toEqual({paddingHorizontal:1});(0,_vitest.expect)((0,_spacing.parseSpacing)("py-px")).toEqual({paddingVertical:1});(0,_vitest.expect)((0,_spacing.parseSpacing)("pt-px")).toEqual({paddingTop:1});(0,_vitest.expect)((0,_spacing.parseSpacing)("pr-px")).toEqual({paddingRight:1});(0,_vitest.expect)((0,_spacing.parseSpacing)("pb-px")).toEqual({paddingBottom:1});(0,_vitest.expect)((0,_spacing.parseSpacing)("pl-px")).toEqual({paddingLeft:1});(0,_vitest.expect)((0,_spacing.parseSpacing)("ps-px")).toEqual({paddingStart:1});(0,_vitest.expect)((0,_spacing.parseSpacing)("pe-px")).toEqual({paddingEnd:1});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-px")).toEqual({gap:1});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-px")).toEqual({margin:-1});(0,_vitest.expect)((0,_spacing.parseSpacing)("-mt-px")).toEqual({marginTop:-1});});(0,_vitest.it)("should not match partial class names",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("sm-4")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("margin-4")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("padding-4")).toBeNull();});});(0,_vitest.describe)("parseSpacing - decimal arbitrary values",function(){(0,_vitest.it)("should parse margin with decimal arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[4.5px]")).toEqual({margin:4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[4.5]")).toEqual({margin:4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[16.75px]")).toEqual({margin:16.75});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[16.75]")).toEqual({margin:16.75});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[100.25px]")).toEqual({margin:100.25});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[0.5]")).toEqual({margin:0.5});});(0,_vitest.it)("should parse padding with decimal arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("p-[4.5px]")).toEqual({padding:4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-[4.5]")).toEqual({padding:4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("pl-[4.5px]")).toEqual({paddingLeft:4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("pl-[4.5]")).toEqual({paddingLeft:4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("pr-[16.75px]")).toEqual({paddingRight:16.75});(0,_vitest.expect)((0,_spacing.parseSpacing)("pt-[10.5]")).toEqual({paddingTop:10.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("pb-[20.25px]")).toEqual({paddingBottom:20.25});});(0,_vitest.it)("should parse padding horizontal/vertical with decimal arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("px-[4.5px]")).toEqual({paddingHorizontal:4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("py-[10.75]")).toEqual({paddingVertical:10.75});});(0,_vitest.it)("should parse gap with decimal arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[4.5px]")).toEqual({gap:4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[4.5]")).toEqual({gap:4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[16.75px]")).toEqual({gap:16.75});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[0.5]")).toEqual({gap:0.5});});(0,_vitest.it)("should parse negative margin with decimal arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-[4.5px]")).toEqual({margin:-4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-[4.5]")).toEqual({margin:-4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-[10.5px]")).toEqual({margin:-10.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("-mt-[16.75px]")).toEqual({marginTop:-16.75});(0,_vitest.expect)((0,_spacing.parseSpacing)("-ml-[8.25]")).toEqual({marginLeft:-8.25});(0,_vitest.expect)((0,_spacing.parseSpacing)("-mx-[12.5px]")).toEqual({marginHorizontal:-12.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("-my-[20.75]")).toEqual({marginVertical:-20.75});});(0,_vitest.it)("should parse margin directional with decimal arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("mt-[4.5px]")).toEqual({marginTop:4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("mr-[8.25]")).toEqual({marginRight:8.25});(0,_vitest.expect)((0,_spacing.parseSpacing)("mb-[16.75px]")).toEqual({marginBottom:16.75});(0,_vitest.expect)((0,_spacing.parseSpacing)("ml-[12.5]")).toEqual({marginLeft:12.5});});(0,_vitest.it)("should parse margin horizontal/vertical with decimal arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("mx-[4.5px]")).toEqual({marginHorizontal:4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("my-[10.75]")).toEqual({marginVertical:10.75});});(0,_vitest.it)("should handle edge case decimal values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[0.1px]")).toEqual({margin:0.1});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-[0.001]")).toEqual({padding:0.001});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[999.999px]")).toEqual({gap:999.999});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-[0.5]")).toEqual({margin:-0.5});});});(0,_vitest.describe)("parseSpacing - comprehensive coverage",function(){(0,_vitest.it)("should parse all margin directions with same value",function(){var value=16;(0,_vitest.expect)((0,_spacing.parseSpacing)("m-4")).toEqual({margin:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("mx-4")).toEqual({marginHorizontal:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("my-4")).toEqual({marginVertical:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("mt-4")).toEqual({marginTop:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("mr-4")).toEqual({marginRight:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("mb-4")).toEqual({marginBottom:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("ml-4")).toEqual({marginLeft:value});});(0,_vitest.it)("should parse all padding directions with same value",function(){var value=16;(0,_vitest.expect)((0,_spacing.parseSpacing)("p-4")).toEqual({padding:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("px-4")).toEqual({paddingHorizontal:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("py-4")).toEqual({paddingVertical:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("pt-4")).toEqual({paddingTop:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("pr-4")).toEqual({paddingRight:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("pb-4")).toEqual({paddingBottom:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("pl-4")).toEqual({paddingLeft:value});});(0,_vitest.it)("should handle large spacing values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-96")).toEqual({margin:384});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-96")).toEqual({padding:384});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-96")).toEqual({gap:384});});(0,_vitest.it)("should handle arbitrary values across all margin directions",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[50px]")).toEqual({margin:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("mx-[50px]")).toEqual({marginHorizontal:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("my-[50px]")).toEqual({marginVertical:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("mt-[50px]")).toEqual({marginTop:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("mr-[50px]")).toEqual({marginRight:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("mb-[50px]")).toEqual({marginBottom:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("ml-[50px]")).toEqual({marginLeft:50});});(0,_vitest.it)("should handle arbitrary values across all padding directions",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("p-[50px]")).toEqual({padding:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("px-[50px]")).toEqual({paddingHorizontal:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("py-[50px]")).toEqual({paddingVertical:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("pt-[50px]")).toEqual({paddingTop:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("pr-[50px]")).toEqual({paddingRight:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("pb-[50px]")).toEqual({paddingBottom:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("pl-[50px]")).toEqual({paddingLeft:50});});});(0,_vitest.describe)("parseSpacing - logical margin (RTL-aware)",function(){(0,_vitest.it)("should parse margin start",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("ms-0")).toEqual({marginStart:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("ms-4")).toEqual({marginStart:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("ms-8")).toEqual({marginStart:32});});(0,_vitest.it)("should parse margin end",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("me-0")).toEqual({marginEnd:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("me-4")).toEqual({marginEnd:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("me-8")).toEqual({marginEnd:32});});(0,_vitest.it)("should parse margin start/end with fractional values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("ms-0.5")).toEqual({marginStart:2});(0,_vitest.expect)((0,_spacing.parseSpacing)("me-1.5")).toEqual({marginEnd:6});(0,_vitest.expect)((0,_spacing.parseSpacing)("ms-2.5")).toEqual({marginStart:10});});(0,_vitest.it)("should parse margin start/end with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("ms-[16px]")).toEqual({marginStart:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("ms-[16]")).toEqual({marginStart:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("me-[24px]")).toEqual({marginEnd:24});(0,_vitest.expect)((0,_spacing.parseSpacing)("me-[24]")).toEqual({marginEnd:24});});(0,_vitest.it)("should parse negative margin start/end",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-ms-4")).toEqual({marginStart:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-me-4")).toEqual({marginEnd:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-ms-8")).toEqual({marginStart:-32});(0,_vitest.expect)((0,_spacing.parseSpacing)("-me-8")).toEqual({marginEnd:-32});});(0,_vitest.it)("should parse negative margin start/end with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-ms-[16px]")).toEqual({marginStart:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-me-[24]")).toEqual({marginEnd:-24});});});(0,_vitest.describe)("parseSpacing - logical padding (RTL-aware)",function(){(0,_vitest.it)("should parse padding start",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("ps-0")).toEqual({paddingStart:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("ps-4")).toEqual({paddingStart:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("ps-8")).toEqual({paddingStart:32});});(0,_vitest.it)("should parse padding end",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("pe-0")).toEqual({paddingEnd:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("pe-4")).toEqual({paddingEnd:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("pe-8")).toEqual({paddingEnd:32});});(0,_vitest.it)("should parse padding start/end with fractional values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("ps-0.5")).toEqual({paddingStart:2});(0,_vitest.expect)((0,_spacing.parseSpacing)("pe-1.5")).toEqual({paddingEnd:6});(0,_vitest.expect)((0,_spacing.parseSpacing)("ps-2.5")).toEqual({paddingStart:10});});(0,_vitest.it)("should parse padding start/end with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("ps-[16px]")).toEqual({paddingStart:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("ps-[16]")).toEqual({paddingStart:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("pe-[24px]")).toEqual({paddingEnd:24});(0,_vitest.expect)((0,_spacing.parseSpacing)("pe-[24]")).toEqual({paddingEnd:24});});});(0,_vitest.describe)("parseSpacing - auto margin",function(){(0,_vitest.it)("should parse m-auto",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-auto")).toEqual({margin:"auto"});});(0,_vitest.it)("should parse mx-auto",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("mx-auto")).toEqual({marginHorizontal:"auto"});});(0,_vitest.it)("should parse my-auto",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("my-auto")).toEqual({marginVertical:"auto"});});(0,_vitest.it)("should parse directional auto margins",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("mt-auto")).toEqual({marginTop:"auto"});(0,_vitest.expect)((0,_spacing.parseSpacing)("mr-auto")).toEqual({marginRight:"auto"});(0,_vitest.expect)((0,_spacing.parseSpacing)("mb-auto")).toEqual({marginBottom:"auto"});(0,_vitest.expect)((0,_spacing.parseSpacing)("ml-auto")).toEqual({marginLeft:"auto"});});(0,_vitest.it)("should parse logical auto margins (RTL-aware)",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("ms-auto")).toEqual({marginStart:"auto"});(0,_vitest.expect)((0,_spacing.parseSpacing)("me-auto")).toEqual({marginEnd:"auto"});});(0,_vitest.it)("should not parse padding auto (not valid in Tailwind)",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("p-auto")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("px-auto")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("py-auto")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("pt-auto")).toBeNull();});(0,_vitest.it)("should not parse gap auto (not valid in Tailwind)",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-auto")).toBeNull();});});(0,_vitest.describe)("parseSpacing - custom spacing",function(){var customSpacing={xs:4,sm:8,md:16,lg:32,xl:64,"4":20};(0,_vitest.it)("should support custom spacing values for margin",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-xs",customSpacing)).toEqual({margin:4});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-sm",customSpacing)).toEqual({margin:8});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-lg",customSpacing)).toEqual({margin:32});(0,_vitest.expect)((0,_spacing.parseSpacing)("mx-xl",customSpacing)).toEqual({marginHorizontal:64});(0,_vitest.expect)((0,_spacing.parseSpacing)("mt-md",customSpacing)).toEqual({marginTop:16});});(0,_vitest.it)("should support custom spacing values for padding",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("p-xs",customSpacing)).toEqual({padding:4});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-sm",customSpacing)).toEqual({padding:8});(0,_vitest.expect)((0,_spacing.parseSpacing)("px-lg",customSpacing)).toEqual({paddingHorizontal:32});(0,_vitest.expect)((0,_spacing.parseSpacing)("pt-xl",customSpacing)).toEqual({paddingTop:64});});(0,_vitest.it)("should support custom spacing values for gap",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-xs",customSpacing)).toEqual({gap:4});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-md",customSpacing)).toEqual({gap:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-xl",customSpacing)).toEqual({gap:64});});(0,_vitest.it)("should allow custom spacing to override preset values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-4",customSpacing)).toEqual({margin:20});});(0,_vitest.it)("should prefer arbitrary values over custom spacing",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[24px]",customSpacing)).toEqual({margin:24});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-[50]",customSpacing)).toEqual({padding:50});});(0,_vitest.it)("should support negative margins with custom spacing",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-xs",customSpacing)).toEqual({margin:-4});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-lg",customSpacing)).toEqual({margin:-32});(0,_vitest.expect)((0,_spacing.parseSpacing)("-mx-xl",customSpacing)).toEqual({marginHorizontal:-64});});(0,_vitest.it)("should fall back to preset scale for unknown custom keys",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-8",customSpacing)).toEqual({margin:32});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-12",customSpacing)).toEqual({padding:48});});(0,_vitest.it)("should work without custom spacing (backward compatible)",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-4")).toEqual({margin:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-8")).toEqual({padding:32});});});
|
package/dist/runtime.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var j=Object.defineProperty,_t=Object.defineProperties,It=Object.getOwnPropertyDescriptor,vt=Object.getOwnPropertyDescriptors,Vt=Object.getOwnPropertyNames,st=Object.getOwnPropertySymbols;var ft=Object.prototype.hasOwnProperty,jt=Object.prototype.propertyIsEnumerable;var at=(t,e,i)=>e in t?j(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,x=(t,e)=>{for(var i in e||(e={}))ft.call(e,i)&&at(t,i,e[i]);if(st)for(var i of st(e))jt.call(e,i)&&at(t,i,e[i]);return t},lt=(t,e)=>_t(t,vt(e));var Pt=(t,e)=>{for(var i in e)j(t,i,{get:e[i],enumerable:!0})},Dt=(t,e,i,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Vt(e))!ft.call(t,o)&&o!==i&&j(t,o,{get:()=>e[o],enumerable:!(r=It(e,o))||r.enumerable});return t};var Lt=t=>Dt(j({},"__esModule",{value:!0}),t);var _e={};Pt(_e,{clearCache:()=>Ne,getCacheStats:()=>Te,getCustomColors:()=>Ee,getCustomTheme:()=>Ce,setConfig:()=>We,tw:()=>Ae,twStyle:()=>$e});module.exports=Lt(_e);function ct(t){return Object.keys(t)[0]}function kt(t,e){let i=[...t];for(let r of e){let o=ct(r),n=i.findIndex(s=>ct(s)===o);n!==-1?i[n]=r:i.push(r)}return i}function ut(t,e){for(let i in e)if(Object.prototype.hasOwnProperty.call(e,i)){let r=e[i];if(i==="transform"&&Array.isArray(r)){let o=t[i];Array.isArray(o)?t.transform=kt(o,r):t[i]=r}else t[i]=r}return t}var dt={"aspect-auto":void 0,"aspect-square":1,"aspect-video":1.7777777777777777};function zt(t){let e=t.match(/^\[(\d+)\/(\d+)\]$/);if(e){let i=Number.parseInt(e[1],10),r=Number.parseInt(e[2],10);return r===0?(process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Invalid aspect ratio: ${t}. Denominator cannot be zero.`),null):i/r}return null}function k(t){if(!t.startsWith("aspect-"))return null;if(t in dt){let r=dt[t];return r===void 0?{aspectRatio:void 0}:{aspectRatio:r}}let e=t.substring(7),i=zt(e);return i!==null?{aspectRatio:i}:null}var pt={red:{50:"#fef2f2",100:"#ffe2e2",200:"#ffc9c9",300:"#ffa2a2",400:"#ff6467",500:"#fb2c36",600:"#e7000b",700:"#c10007",800:"#9f0712",900:"#82181a",950:"#460809"},orange:{50:"#fff7ed",100:"#ffedd4",200:"#ffd6a7",300:"#ffb86a",400:"#ff8904",500:"#ff6900",600:"#f54900",700:"#ca3500",800:"#9f2d00",900:"#7e2a0c",950:"#441306"},amber:{50:"#fffbeb",100:"#fef3c6",200:"#fee685",300:"#ffd230",400:"#ffb900",500:"#fe9a00",600:"#e17100",700:"#bb4d00",800:"#973c00",900:"#7b3306",950:"#461901"},yellow:{50:"#fefce8",100:"#fef9c2",200:"#fff085",300:"#ffdf20",400:"#fdc700",500:"#f0b100",600:"#d08700",700:"#a65f00",800:"#894b00",900:"#733e0a",950:"#432004"},lime:{50:"#f7fee7",100:"#ecfcca",200:"#d8f999",300:"#bbf451",400:"#9ae600",500:"#7ccf00",600:"#5ea500",700:"#497d00",800:"#3c6300",900:"#35530e",950:"#192e03"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#b9f8cf",300:"#7bf1a8",400:"#05df72",500:"#00c950",600:"#00a63e",700:"#008236",800:"#016630",900:"#0d542b",950:"#032e15"},emerald:{50:"#ecfdf5",100:"#d0fae5",200:"#a4f4cf",300:"#5ee9b5",400:"#00d492",500:"#00bc7d",600:"#009966",700:"#007a55",800:"#006045",900:"#004f3b",950:"#002c22"},teal:{50:"#f0fdfa",100:"#cbfbf1",200:"#96f7e4",300:"#46ecd5",400:"#00d5be",500:"#00bba7",600:"#009689",700:"#00786f",800:"#005f5a",900:"#0b4f4a",950:"#022f2e"},cyan:{50:"#ecfeff",100:"#cefafe",200:"#a2f4fd",300:"#53eafd",400:"#00d3f2",500:"#00b8db",600:"#0092b8",700:"#007595",800:"#005f78",900:"#104e64",950:"#053345"},sky:{50:"#f0f9ff",100:"#dff2fe",200:"#b8e6fe",300:"#74d4ff",400:"#00bcff",500:"#00a6f4",600:"#0084d1",700:"#0069a8",800:"#00598a",900:"#024a70",950:"#052f4a"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bedbff",300:"#8ec5ff",400:"#51a2ff",500:"#2b7fff",600:"#155dfc",700:"#1447e6",800:"#193cb8",900:"#1c398e",950:"#162456"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c6d2ff",300:"#a3b3ff",400:"#7c86ff",500:"#615fff",600:"#4f39f6",700:"#432dd7",800:"#372aac",900:"#312c85",950:"#1e1a4d"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6ff",300:"#c4b4ff",400:"#a684ff",500:"#8e51ff",600:"#7f22fe",700:"#7008e7",800:"#5d0ec0",900:"#4d179a",950:"#2f0d68"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d4ff",300:"#dab2ff",400:"#c27aff",500:"#ad46ff",600:"#9810fa",700:"#8200db",800:"#6e11b0",900:"#59168b",950:"#3c0366"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f6cfff",300:"#f4a8ff",400:"#ed6aff",500:"#e12afb",600:"#c800de",700:"#a800b7",800:"#8a0194",900:"#721378",950:"#4b004f"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fccee8",300:"#fda5d5",400:"#fb64b6",500:"#f6339a",600:"#e60076",700:"#c6005c",800:"#a3004c",900:"#861043",950:"#510424"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#ffccd3",300:"#ffa1ad",400:"#ff637e",500:"#ff2056",600:"#ec003f",700:"#c70036",800:"#a50036",900:"#8b0836",950:"#4d0218"},slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cad5e2",400:"#90a1b9",500:"#62748e",600:"#45556c",700:"#314158",800:"#1d293d",900:"#0f172b",950:"#020618"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5dc",400:"#99a1af",500:"#6a7282",600:"#4a5565",700:"#364153",800:"#1e2939",900:"#101828",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#9f9fa9",500:"#71717b",600:"#52525c",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a1a1a1",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a6a09b",500:"#79716b",600:"#57534d",700:"#44403b",800:"#292524",900:"#1c1917",950:"#0c0a09"}};function A(t,e=""){let i={};for(let[r,o]of Object.entries(t)){let n=r==="DEFAULT"&&e?e:e?`${e}-${r}`:r;typeof o=="string"?i[n]=o:typeof o=="object"&&o!==null&&Object.assign(i,A(o,n))}return i}var P=lt(x({},A(pt)),{white:"#FFFFFF",black:"#000000",transparent:"transparent"});function $(t,e){if(t==="transparent")return"transparent";let i=t.replace(/^#/,""),r=i.length===3?i.split("").map(s=>s+s).join(""):i,n=Math.round(e/100*255).toString(16).padStart(2,"0").toUpperCase();return`#${r.toUpperCase()}${n}`}function _(t){let e=t.match(/^\[#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})\]$/);if(e){let i=e[1];return i.length===3?`#${i.split("").map(o=>o+o).join("")}`:`#${i}`}return null}function gt(t,e){var n;let i=s=>{var a;return(a=e==null?void 0:e[s])!=null?a:P[s]},r=t.match(/^(.+)\/(\d+)$/);if(r){let s=r[1],a=Number.parseInt(r[2],10);if(a<0||a>100)return null;let f=_(s);if(f!==null)return $(f,a);let p=i(s);return p?$(p,a):null}let o=_(t);return o!==null?o:(n=i(t))!=null?n:null}function C(t,e){let i=n=>{var s;return(s=e==null?void 0:e[n])!=null?s:P[n]},r=n=>{var f;let s=n.match(/^(.+)\/(\d+)$/);if(s){let p=s[1],d=Number.parseInt(s[2],10);if(d<0||d>100)return process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Invalid opacity value: ${d}. Opacity must be between 0 and 100.`),null;let b=_(p);if(b!==null)return $(b,d);let g=i(p);return g?$(g,d):null}let a=_(n);return a!==null?a:n.startsWith("[")&&n.endsWith("]")?(process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Unsupported arbitrary color value: ${n}. Only hex colors are supported (e.g., [#ff0000], [#f00], or [#ff0000aa]).`),null):(f=i(n))!=null?f:null};if(t.startsWith("bg-")){let n=t.substring(3);if(n.startsWith("[")&&!n.startsWith("[#"))return null;let s=r(n);if(s)return{backgroundColor:s}}if(t.startsWith("text-")){let n=t.substring(5);if(n.startsWith("[")&&!n.startsWith("[#"))return null;let s=r(n);if(s)return{color:s}}if(t.startsWith("border-")&&!t.match(/^border-[0-9]/)){let n=t.substring(7);if(n.startsWith("[")&&!n.startsWith("[#"))return null;let s=r(n);if(s)return{borderColor:s}}if(t.startsWith("outline-")&&!t.match(/^outline-[0-9]/)&&!t.startsWith("outline-offset-")){let n=t.substring(8);if(["solid","dashed","dotted","none"].includes(n)||n.startsWith("[")&&!n.startsWith("[#"))return null;let s=r(n);if(s)return{outlineColor:s}}let o=t.match(/^border-([trblxy])-(.+)$/);if(o){let n=o[1],s=o[2];if(s.startsWith("[")&&!s.startsWith("[#"))return null;let a=r(s);if(a)return n==="x"?{borderLeftColor:a,borderRightColor:a}:n==="y"?{borderTopColor:a,borderBottomColor:a}:{[{t:"borderTopColor",r:"borderRightColor",b:"borderBottomColor",l:"borderLeftColor"}[n]]:a}}return null}var v={"":1,0:0,2:2,4:4,8:8},I={none:0,sm:2,"":4,md:6,lg:8,xl:12,"2xl":16,"3xl":24,full:9999},yt={t:"borderTopWidth",r:"borderRightWidth",b:"borderBottomWidth",l:"borderLeftWidth",s:"borderStartWidth",e:"borderEndWidth"},ht={tl:"borderTopLeftRadius",tr:"borderTopRightRadius",bl:"borderBottomLeftRadius",br:"borderBottomRightRadius"},bt={ss:"borderTopStartRadius",se:"borderTopEndRadius",es:"borderBottomStartRadius",ee:"borderBottomEndRadius"},Ft={t:["borderTopLeftRadius","borderTopRightRadius"],r:["borderTopRightRadius","borderBottomRightRadius"],b:["borderBottomLeftRadius","borderBottomRightRadius"],l:["borderTopLeftRadius","borderBottomLeftRadius"],s:["borderTopStartRadius","borderBottomStartRadius"],e:["borderTopEndRadius","borderBottomEndRadius"]};function mt(t){let e=t.match(/^\[(\d+)(?:px)?\]$/);return e?parseInt(e[1],10):(t.startsWith("[")&&t.endsWith("]")&&process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Unsupported arbitrary border width value: ${t}. Only px values are supported (e.g., [8px] or [8]).`),null)}function D(t){let e=t.match(/^\[(\d+)(?:px)?\]$/);return e?parseInt(e[1],10):(t.startsWith("[")&&t.endsWith("]")&&process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Unsupported arbitrary border radius value: ${t}. Only px values are supported (e.g., [12px] or [12]).`),null)}function z(t,e){return t==="border-solid"?{borderStyle:"solid"}:t==="border-dotted"?{borderStyle:"dotted"}:t==="border-dashed"?{borderStyle:"dashed"}:t.startsWith("border-")?Kt(t,e):t==="border"?{borderWidth:1}:t.startsWith("rounded")?Bt(t):null}function Kt(t,e){let i=t.match(/^border-([trblse])(?:-(.+))?$/);if(i){let n=i[1],s=i[2]||"";if(s&&n!=="s"&&n!=="e"&&C(t,e)!==null)return null;if(s.startsWith("[")){let f=mt(s);return f!==null?{[yt[n]]:f}:null}let a=v[s];return a!==void 0?{[yt[n]]:a}:null}let r=t.match(/^border-(\d+)$/);if(r){let n=v[r[1]];if(n!==void 0)return{borderWidth:n}}let o=t.match(/^border-(\[.+\])$/);if(o){let n=mt(o[1]);if(n!==null)return{borderWidth:n}}return null}function Bt(t){let e=t.substring(7);if(e==="")return{borderRadius:I[""]};if(!e.startsWith("-"))return null;let i=e.substring(1);if(i==="")return null;let r=i.match(/^(tl|tr|bl|br)(?:-(.+))?$/);if(r){let a=r[1],f=r[2]||"";if(f.startsWith("[")){let d=D(f);return d!==null?{[ht[a]]:d}:null}let p=I[f];return p!==void 0?{[ht[a]]:p}:null}let o=i.match(/^(ss|se|es|ee)(?:-(.+))?$/);if(o){let a=o[1],f=o[2]||"";if(f.startsWith("[")){let d=D(f);return d!==null?{[bt[a]]:d}:null}let p=I[f];return p!==void 0?{[bt[a]]:p}:null}let n=i.match(/^([trblse])(?:-(.+))?$/);if(n){let a=n[1],f=n[2]||"",p;if(f.startsWith("[")){let d=D(f);if(d!==null)p=d;else return null}else p=I[f];if(p!==void 0){let d={};return Ft[a].forEach(b=>d[b]=p),d}return null}if(i.startsWith("[")){let a=D(i);return a!==null?{borderRadius:a}:null}let s=I[i];return s!==void 0?{borderRadius:s}:null}function R(t){let e=t.match(/^\[(-?\d+)(?:px)?\]$/);if(e)return parseInt(e[1],10);let i=t.match(/^\[(-?\d+(?:\.\d+)?)%\]$/);return i?`${i[1]}%`:(t.startsWith("[")&&t.endsWith("]")&&process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Unsupported arbitrary inset unit: ${t}. Only px and % are supported.`),null)}function Ht(t){let e=t.match(/^\[(-?\d+)\]$/);return e?parseInt(e[1],10):(t.startsWith("[")&&t.endsWith("]")&&process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Invalid arbitrary z-index: ${t}. Only integers are supported.`),null)}function xt(t){let e=t.match(/^\[(\d+(?:\.\d+)?|\.\d+)\]$/);return e?parseFloat(e[1]):(t.startsWith("[")&&t.endsWith("]")&&process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Invalid arbitrary grow/shrink value: ${t}. Only non-negative numbers are supported (e.g., [1.5], [2], [0.5], [.5]).`),null)}var Ut={flex:{display:"flex"},hidden:{display:"none"}},Gt={"flex-row":{flexDirection:"row"},"flex-row-reverse":{flexDirection:"row-reverse"},"flex-col":{flexDirection:"column"},"flex-col-reverse":{flexDirection:"column-reverse"}},Xt={"flex-wrap":{flexWrap:"wrap"},"flex-wrap-reverse":{flexWrap:"wrap-reverse"},"flex-nowrap":{flexWrap:"nowrap"}},Yt={"flex-1":{flex:1},"flex-auto":{flex:1},"flex-none":{flex:0}},Zt={grow:{flexGrow:1},"grow-0":{flexGrow:0},shrink:{flexShrink:1},"shrink-0":{flexShrink:0},"flex-grow":{flexGrow:1},"flex-grow-0":{flexGrow:0},"flex-shrink":{flexShrink:1},"flex-shrink-0":{flexShrink:0}},qt={"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"}},Jt={"items-start":{alignItems:"flex-start"},"items-end":{alignItems:"flex-end"},"items-center":{alignItems:"center"},"items-baseline":{alignItems:"baseline"},"items-stretch":{alignItems:"stretch"}},Qt={"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"}},te={"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"}},ee={absolute:{position:"absolute"},relative:{position:"relative"}},re={"overflow-hidden":{overflow:"hidden"},"overflow-visible":{overflow:"visible"},"overflow-scroll":{overflow:"scroll"}},ne={"opacity-0":{opacity:0},"opacity-5":{opacity:.05},"opacity-10":{opacity:.1},"opacity-15":{opacity:.15},"opacity-20":{opacity:.2},"opacity-25":{opacity:.25},"opacity-30":{opacity:.3},"opacity-35":{opacity:.35},"opacity-40":{opacity:.4},"opacity-45":{opacity:.45},"opacity-50":{opacity:.5},"opacity-55":{opacity:.55},"opacity-60":{opacity:.6},"opacity-65":{opacity:.65},"opacity-70":{opacity:.7},"opacity-75":{opacity:.75},"opacity-80":{opacity:.8},"opacity-85":{opacity:.85},"opacity-90":{opacity:.9},"opacity-95":{opacity:.95},"opacity-100":{opacity:1}},ie={0:0,10:10,20:20,30:30,40:40,50:50,auto:0},St={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 F(t,e){var p,d,b,g,h,w,tt,et,rt,nt,it,ot;let i=e?x(x({},St),e):St;if(t.startsWith("z-")){let y=t.substring(2),c=Ht(y);if(c!==null)return{zIndex:c};let l=ie[y];if(l!==void 0)return{zIndex:l}}let r=t.match(/^(-?)top-(.+)$/);if(r){let[,y,c]=r,l=y==="-";if(c==="auto")return{};let u=R(c);if(u!==null)return typeof u=="number"?{top:l?-u:u}:l&&u.endsWith("%")?{top:`${-parseFloat(u)}%`}:{top:u};let m=i[c];if(m!==void 0)return{top:l?-m:m}}let o=t.match(/^(-?)right-(.+)$/);if(o){let[,y,c]=o,l=y==="-";if(c==="auto")return{};let u=R(c);if(u!==null)return typeof u=="number"?{right:l?-u:u}:l&&u.endsWith("%")?{right:`${-parseFloat(u)}%`}:{right:u};let m=i[c];if(m!==void 0)return{right:l?-m:m}}let n=t.match(/^(-?)bottom-(.+)$/);if(n){let[,y,c]=n,l=y==="-";if(c==="auto")return{};let u=R(c);if(u!==null)return typeof u=="number"?{bottom:l?-u:u}:l&&u.endsWith("%")?{bottom:`${-parseFloat(u)}%`}:{bottom:u};let m=i[c];if(m!==void 0)return{bottom:l?-m:m}}let s=t.match(/^(-?)left-(.+)$/);if(s){let[,y,c]=s,l=y==="-";if(c==="auto")return{};let u=R(c);if(u!==null)return typeof u=="number"?{left:l?-u:u}:l&&u.endsWith("%")?{left:`${-parseFloat(u)}%`}:{left:u};let m=i[c];if(m!==void 0)return{left:l?-m:m}}let a=t.match(/^(-?)start-(.+)$/);if(a){let[,y,c]=a,l=y==="-";if(c==="auto")return{};let u=R(c);if(u!==null)return typeof u=="number"?{start:l?-u:u}:l&&u.endsWith("%")?{start:`${-parseFloat(u)}%`}:{start:u};let m=i[c];if(m!==void 0)return{start:l?-m:m}}let f=t.match(/^(-?)end-(.+)$/);if(f){let[,y,c]=f,l=y==="-";if(c==="auto")return{};let u=R(c);if(u!==null)return typeof u=="number"?{end:l?-u:u}:l&&u.endsWith("%")?{end:`${-parseFloat(u)}%`}:{end:u};let m=i[c];if(m!==void 0)return{end:l?-m:m}}if(t.startsWith("inset-x-")){let y=t.substring(8),c=R(y);if(c!==null)return{left:c,right:c};let l=i[y];if(l!==void 0)return{left:l,right:l}}if(t.startsWith("inset-y-")){let y=t.substring(8),c=R(y);if(c!==null)return{top:c,bottom:c};let l=i[y];if(l!==void 0)return{top:l,bottom:l}}if(t.startsWith("inset-s-")){let y=t.substring(8),c=R(y);if(c!==null)return{start:c};let l=i[y];if(l!==void 0)return{start:l}}if(t.startsWith("inset-e-")){let y=t.substring(8),c=R(y);if(c!==null)return{end:c};let l=i[y];if(l!==void 0)return{end:l}}if(t.startsWith("inset-")){let y=t.substring(6),c=R(y);if(c!==null)return{top:c,right:c,bottom:c,left:c};let l=i[y];if(l!==void 0)return{top:l,right:l,bottom:l,left:l}}if(t.startsWith("grow-")||t.startsWith("flex-grow-")){let y=t.startsWith("flex-grow-")?"flex-grow-":"grow-",c=t.substring(y.length),l=xt(c);if(l!==null)return{flexGrow:l}}if(t.startsWith("shrink-")||t.startsWith("flex-shrink-")){let y=t.startsWith("flex-shrink-")?"flex-shrink-":"shrink-",c=t.substring(y.length),l=xt(c);if(l!==null)return{flexShrink:l}}return(ot=(it=(nt=(rt=(et=(tt=(w=(h=(g=(b=(d=(p=Ut[t])!=null?p:Gt[t])!=null?d:Xt[t])!=null?b:Yt[t])!=null?g:Zt[t])!=null?h:qt[t])!=null?w:Jt[t])!=null?tt:Qt[t])!=null?et:te[t])!=null?rt:ee[t])!=null?nt:re[t])!=null?it:ne[t])!=null?ot:null}function Rt(t){let e=t.match(/^\[(\d+)(?:px)?\]$/);return e?parseInt(e[1],10):(t.startsWith("[")&&t.endsWith("]")&&process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Unsupported arbitrary outline value: ${t}. Only px values are supported (e.g., [8px] or [8]).`),null)}function K(t){if(t==="outline")return{outlineWidth:1,outlineStyle:"solid"};if(t==="outline-none")return{outlineWidth:0};if(t==="outline-solid")return{outlineStyle:"solid"};if(t==="outline-dotted")return{outlineStyle:"dotted"};if(t==="outline-dashed")return{outlineStyle:"dashed"};if(t.startsWith("outline-offset-")){let r=t.substring(15);if(r.startsWith("[")){let n=Rt(r);return n!==null?{outlineOffset:n}:null}let o=v[r];return o!==void 0?{outlineOffset:o}:null}let e=t.match(/^outline-(\d+)$/);if(e){let r=v[e[1]];if(r!==void 0)return{outlineWidth:r}}let i=t.match(/^outline-(\[.+\])$/);if(i){let r=Rt(i[1]);return r!==null?{outlineWidth:r}:null}return null}var wt={"shadow-sm":{shadowColor:"#000000",shadowOffset:{width:0,height:1},shadowOpacity:.05,shadowRadius:1,elevation:1},shadow:{shadowColor:"#000000",shadowOffset:{width:0,height:1},shadowOpacity:.1,shadowRadius:2,elevation:2},"shadow-md":{shadowColor:"#000000",shadowOffset:{width:0,height:3},shadowOpacity:.15,shadowRadius:4,elevation:4},"shadow-lg":{shadowColor:"#000000",shadowOffset:{width:0,height:6},shadowOpacity:.2,shadowRadius:8,elevation:8},"shadow-xl":{shadowColor:"#000000",shadowOffset:{width:0,height:10},shadowOpacity:.25,shadowRadius:12,elevation:12},"shadow-2xl":{shadowColor:"#000000",shadowOffset:{width:0,height:20},shadowOpacity:.3,shadowRadius:24,elevation:16},"shadow-none":{shadowColor:"transparent",shadowOffset:{width:0,height:0},shadowOpacity:0,shadowRadius:0,elevation:0}};function B(t,e){if(t in wt)return wt[t];if(t.startsWith("shadow-")){let i=t.substring(7),r=gt(i,e);if(r)return{shadowColor:r}}return null}var H="{{RUNTIME:dimensions.";var Ot={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},O={full:"100%","1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%"};function M(t){let e=t.match(/^\[(\d+)(?:px)?\]$/);if(e)return parseInt(e[1],10);let i=t.match(/^\[(\d+(?:\.\d+)?)%\]$/);return i?`${i[1]}%`:(t.startsWith("[")&&t.endsWith("]")&&process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Unsupported arbitrary size unit: ${t}. Only px and % are supported.`),null)}function U(t,e){let i=e?x(x({},Ot),e):Ot;if(t.startsWith("size-")){let r=t.substring(5),o=M(r);if(o!==null)return{width:o,height:o};let n=O[r];if(n)return{width:n,height:n};let s=i[r];if(s!==void 0)return{width:s,height:s};if(r==="auto")return{width:"auto",height:"auto"}}if(t.startsWith("w-")){let r=t.substring(2);if(r==="screen")return{width:`${H}width}}`};let o=M(r);if(o!==null)return{width:o};let n=O[r];if(n)return{width:n};let s=i[r];if(s!==void 0)return{width:s};if(r==="auto")return{width:"auto"}}if(t.startsWith("h-")){let r=t.substring(2);if(r==="screen")return{height:`${H}height}}`};let o=M(r);if(o!==null)return{height:o};let n=O[r];if(n)return{height:n};let s=i[r];if(s!==void 0)return{height:s};if(r==="auto")return{height:"auto"}}if(t.startsWith("min-w-")){let r=t.substring(6),o=M(r);if(o!==null)return{minWidth:o};let n=O[r];if(n)return{minWidth:n};let s=i[r];if(s!==void 0)return{minWidth:s}}if(t.startsWith("min-h-")){let r=t.substring(6),o=M(r);if(o!==null)return{minHeight:o};let n=O[r];if(n)return{minHeight:n};let s=i[r];if(s!==void 0)return{minHeight:s}}if(t.startsWith("max-w-")){let r=t.substring(6),o=M(r);if(o!==null)return{maxWidth:o};let n=O[r];if(n)return{maxWidth:n};let s=i[r];if(s!==void 0)return{maxWidth:s}}if(t.startsWith("max-h-")){let r=t.substring(6),o=M(r);if(o!==null)return{maxHeight:o};let n=O[r];if(n)return{maxHeight:n};let s=i[r];if(s!==void 0)return{maxHeight:s}}return null}var V={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 G(t){let e=t.match(/^\[(-?\d+(?:\.\d+)?)(?:px)?\]$/);return e?parseFloat(e[1]):(t.startsWith("[")&&t.endsWith("]")&&process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Unsupported arbitrary spacing value: ${t}. Only px values are supported (e.g., [16px], [16], [4.5px], [4.5]).`),null)}function Y(t,e){let i=e?x(x({},V),e):V,r=t.match(/^m([xytrblse]?)-auto$/);if(r){let a=r[1];return X(a,"auto")}let o=t.match(/^(-?)m([xytrblse]?)-(.+)$/);if(o){let[,a,f,p]=o,d=a==="-",b=G(p);if(b!==null){let h=d?-b:b;return X(f,h)}let g=i[p];if(g!==void 0){let h=d?-g:g;return X(f,h)}}let n=t.match(/^p([xytrblse]?)-(.+)$/);if(n){let[,a,f]=n,p=G(f);if(p!==null)return Mt(a,p);let d=i[f];if(d!==void 0)return Mt(a,d)}let s=t.match(/^gap-(.+)$/);if(s){let a=s[1],f=G(a);if(f!==null)return{gap:f};let p=i[a];if(p!==void 0)return{gap:p}}return null}function X(t,e){switch(t){case"":return{margin:e};case"x":return{marginHorizontal:e};case"y":return{marginVertical:e};case"t":return{marginTop:e};case"r":return{marginRight:e};case"b":return{marginBottom:e};case"l":return{marginLeft:e};case"s":return{marginStart:e};case"e":return{marginEnd:e};default:return{}}}function Mt(t,e){switch(t){case"":return{padding:e};case"x":return{paddingHorizontal:e};case"y":return{paddingVertical:e};case"t":return{paddingTop:e};case"r":return{paddingRight:e};case"b":return{paddingBottom:e};case"l":return{paddingLeft:e};case"s":return{paddingStart:e};case"e":return{paddingEnd:e};default:return{}}}var Z={0:0,50:.5,75:.75,90:.9,95:.95,100:1,105:1.05,110:1.1,125:1.25,150:1.5,200:2},L={0:0,1:1,2:2,3:3,6:6,12:12,45:45,90:90,180:180},Wt={0:0,1:1,2:2,3:3,6:6,12:12},oe={0:0,100:100,200:200,300:300,400:400,500:500,600:600,700:700,800:800,900:900,1e3:1e3};function q(t){let e=t.match(/^\[(-?\d+(?:\.\d+)?)\]$/);return e?parseFloat(e[1]):(t.startsWith("[")&&t.endsWith("]")&&process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Invalid arbitrary scale value: ${t}. Only numbers are supported (e.g., [1.5], [0.75]).`),null)}function E(t){let e=t.match(/^\[(-?\d+(?:\.\d+)?)deg\]$/);return e?`${e[1]}deg`:(t.startsWith("[")&&t.endsWith("]")&&process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Invalid arbitrary rotation value: ${t}. Only deg unit is supported (e.g., [45deg], [-15deg]).`),null)}function Ct(t){let e=t.match(/^\[(-?\d+)(?:px)?\]$/);if(e)return parseInt(e[1],10);let i=t.match(/^\[(-?\d+(?:\.\d+)?)%\]$/);return i?`${i[1]}%`:(t.startsWith("[")&&t.endsWith("]")&&process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Unsupported arbitrary translation unit: ${t}. Only px and % are supported.`),null)}function se(t){let e=t.match(/^\[(-?\d+)\]$/);return e?parseInt(e[1],10):(t.startsWith("[")&&t.endsWith("]")&&process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Invalid arbitrary perspective value: ${t}. Only integers are supported (e.g., [1500]).`),null)}function J(t,e){let i=e?x(x({},V),e):V;if(t.startsWith("origin-"))return process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] transform-origin is not supported in React Native. Class "${t}" will be ignored.`),null;if(t.startsWith("scale-")){let r=t.substring(6),o=q(r);if(o!==null)return{transform:[{scale:o}]};let n=Z[r];if(n!==void 0)return{transform:[{scale:n}]}}if(t.startsWith("scale-x-")){let r=t.substring(8),o=q(r);if(o!==null)return{transform:[{scaleX:o}]};let n=Z[r];if(n!==void 0)return{transform:[{scaleX:n}]}}if(t.startsWith("scale-y-")){let r=t.substring(8),o=q(r);if(o!==null)return{transform:[{scaleY:o}]};let n=Z[r];if(n!==void 0)return{transform:[{scaleY:n}]}}if(t.startsWith("rotate-")||t.startsWith("-rotate-")){let r=t.startsWith("-"),o=r?t.substring(8):t.substring(7),n=E(o);if(n!==null)return{transform:[{rotate:r?`-${n}`:n}]};let s=L[o];if(s!==void 0)return{transform:[{rotate:`${r?-s:s}deg`}]}}if(t.startsWith("rotate-x-")||t.startsWith("-rotate-x-")){let r=t.startsWith("-"),o=r?t.substring(10):t.substring(9),n=E(o);if(n!==null)return{transform:[{rotateX:r?`-${n}`:n}]};let s=L[o];if(s!==void 0)return{transform:[{rotateX:`${r?-s:s}deg`}]}}if(t.startsWith("rotate-y-")||t.startsWith("-rotate-y-")){let r=t.startsWith("-"),o=r?t.substring(10):t.substring(9),n=E(o);if(n!==null)return{transform:[{rotateY:r?`-${n}`:n}]};let s=L[o];if(s!==void 0)return{transform:[{rotateY:`${r?-s:s}deg`}]}}if(t.startsWith("rotate-z-")||t.startsWith("-rotate-z-")){let r=t.startsWith("-"),o=r?t.substring(10):t.substring(9),n=E(o);if(n!==null)return{transform:[{rotateZ:r?`-${n}`:n}]};let s=L[o];if(s!==void 0)return{transform:[{rotateZ:`${r?-s:s}deg`}]}}if(t.startsWith("translate-x-")||t.startsWith("-translate-x-")){let r=t.startsWith("-"),o=r?t.substring(13):t.substring(12),n=Ct(o);if(n!==null)return{transform:[{translateX:typeof n=="number"?r?-n:n:r?`-${n}`:n}]};let s=i[o];if(s!==void 0)return{transform:[{translateX:r?-s:s}]}}if(t.startsWith("translate-y-")||t.startsWith("-translate-y-")){let r=t.startsWith("-"),o=r?t.substring(13):t.substring(12),n=Ct(o);if(n!==null)return{transform:[{translateY:typeof n=="number"?r?-n:n:r?`-${n}`:n}]};let s=i[o];if(s!==void 0)return{transform:[{translateY:r?-s:s}]}}if(t.startsWith("skew-x-")||t.startsWith("-skew-x-")){let r=t.startsWith("-"),o=r?t.substring(8):t.substring(7),n=E(o);if(n!==null)return{transform:[{skewX:r?`-${n}`:n}]};let s=Wt[o];if(s!==void 0)return{transform:[{skewX:`${r?-s:s}deg`}]}}if(t.startsWith("skew-y-")||t.startsWith("-skew-y-")){let r=t.startsWith("-"),o=r?t.substring(8):t.substring(7),n=E(o);if(n!==null)return{transform:[{skewY:r?`-${n}`:n}]};let s=Wt[o];if(s!==void 0)return{transform:[{skewY:`${r?-s:s}deg`}]}}if(t.startsWith("perspective-")){let r=t.substring(12),o=se(r);if(o!==null)return{transform:[{perspective:o}]};let n=oe[r];if(n!==void 0)return{transform:[{perspective:n}]}}return null}var ae={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 Et={"font-sans":{fontFamily:"System"},"font-serif":{fontFamily:"serif"},"font-mono":{fontFamily:"Courier"}},fe={"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"}},le={italic:{fontStyle:"italic"},"not-italic":{fontStyle:"normal"}},ce={"text-left":{textAlign:"left"},"text-center":{textAlign:"center"},"text-right":{textAlign:"right"},"text-justify":{textAlign:"justify"}},ue={underline:{textDecorationLine:"underline"},"line-through":{textDecorationLine:"line-through"},"no-underline":{textDecorationLine:"none"}},de={uppercase:{textTransform:"uppercase"},lowercase:{textTransform:"lowercase"},capitalize:{textTransform:"capitalize"},"normal-case":{textTransform:"none"}},pe={3:12,4:16,5:20,6:24,7:28,8:32,9:36,10:40},ge={"leading-none":{lineHeight:16},"leading-tight":{lineHeight:20},"leading-snug":{lineHeight:22},"leading-normal":{lineHeight:24},"leading-relaxed":{lineHeight:28},"leading-loose":{lineHeight:32}},ye={"tracking-tighter":{letterSpacing:-.8},"tracking-tight":{letterSpacing:-.4},"tracking-normal":{letterSpacing:0},"tracking-wide":{letterSpacing:.4},"tracking-wider":{letterSpacing:.8},"tracking-widest":{letterSpacing:1.6}};function he(t){let e=t.match(/^\[(-?\d+(?:\.\d+)?|-?\.\d+)(?:px)?\]$/);return e?parseFloat(e[1]):(t.startsWith("[")&&t.endsWith("]")&&process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Unsupported arbitrary font size value: ${t}. Only px values are supported (e.g., [18px], [13.5px], [.5]).`),null)}function be(t){let e=t.match(/^\[(-?\d+(?:\.\d+)?|-?\.\d+)(?:px)?\]$/);return e?parseFloat(e[1]):(t.startsWith("[")&&t.endsWith("]")&&process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Unsupported arbitrary line height value: ${t}. Only px values are supported (e.g., [24px], [21.5px], [.5]).`),null)}function me(t){let e=t.match(/^\[(-?\d+(?:\.\d+)?|-?\.\d+)(?:px)?\]$/);return e?parseFloat(e[1]):(t.startsWith("[")&&t.endsWith("]")&&process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Unsupported arbitrary letter spacing value: ${t}. Only px values are supported (e.g., [0.5px], [0.3], [.5], [-0.4]).`),null)}function Q(t,e,i){var o,n,s,a,f,p,d,b;let r=e?x(x({},Et),Object.fromEntries(Object.entries(e).map(([g,h])=>[`font-${g}`,{fontFamily:h}]))):Et;if(t.startsWith("text-")){let g=t.substring(5),h=he(g);if(h!==null)return{fontSize:h};if((i==null?void 0:i[g])!==void 0)return{fontSize:i[g]};let w=ae[g];if(w!==void 0)return{fontSize:w}}if(t.startsWith("leading-")){let g=t.substring(8),h=be(g);if(h!==null)return{lineHeight:h};let w=pe[g];if(w!==void 0)return{lineHeight:w}}if(t.startsWith("tracking-")){let g=t.substring(9),h=me(g);if(h!==null)return{letterSpacing:h}}return(b=(d=(p=(f=(a=(s=(n=(o=r[t])!=null?o:fe[t])!=null?n:le[t])!=null?s:ce[t])!=null?a:ue[t])!=null?f:de[t])!=null?p:ge[t])!=null?d:ye[t])!=null?b:null}var xe=["active","hover","focus","disabled","placeholder"],Se=["ios","android","web"],Re=["dark","light"],we=["scheme"],Oe=["rtl","ltr"],ur=[...xe,...Se,...Re,...we,...Oe];function N(t,e){let i=t.split(/\s+/).filter(Boolean),r={};for(let o of i){let n=Me(o,e);ut(r,n)}return r}function Me(t,e){let i=[r=>Y(r,e==null?void 0:e.spacing),r=>z(r,e==null?void 0:e.colors),K,r=>C(r,e==null?void 0:e.colors),r=>F(r,e==null?void 0:e.spacing),r=>Q(r,e==null?void 0:e.fontFamily,e==null?void 0:e.fontSize),r=>U(r,e==null?void 0:e.spacing),r=>B(r,e==null?void 0:e.colors),k,r=>J(r,e==null?void 0:e.spacing)];for(let r of i){let o=r(t);if(o!==null)return o}return process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Unknown class: "${t}"`),{}}var Nt=["active","focus","disabled"];function Tt(t){return Nt.some(e=>t.includes(`${e}:`))}function At(t){let e=t.split(/\s+/).filter(Boolean),i=[],r=new Map;for(let o of e){let n=!1;for(let s of Nt){let a=`${s}:`;if(o.startsWith(a)){let f=o.slice(a.length);r.has(s)||r.set(s,[]);let p=r.get(s);p&&p.push(f),n=!0;break}}n||i.push(o)}return{base:i,modifiers:r}}var S={colors:{},fontFamily:{},fontSize:{},spacing:{}},W=new Map;function We(t){var e,i,r,o,n,s,a,f,p;if((i=(e=t.theme)==null?void 0:e.extend)!=null&&i.colors?S.colors=A((r=t.theme)==null?void 0:r.extend.colors):S.colors={},(n=(o=t.theme)==null?void 0:o.extend)!=null&&n.fontFamily){let d={};for(let[b,g]of Object.entries(t.theme.extend.fontFamily))Array.isArray(g)?d[b]=g[0]:d[b]=g;S.fontFamily=d}else S.fontFamily={};if((a=(s=t.theme)==null?void 0:s.extend)!=null&&a.fontSize){let d={};for(let[b,g]of Object.entries(t.theme.extend.fontSize))if(typeof g=="number")d[b]=g;else if(typeof g=="string"){let h=parseFloat(g.replace(/px$/,""));isNaN(h)||(d[b]=h)}S.fontSize=d}else S.fontSize={};if((p=(f=t.theme)==null?void 0:f.extend)!=null&&p.spacing){let d={};for(let[b,g]of Object.entries(t.theme.extend.spacing))if(typeof g=="number")d[b]=g;else if(typeof g=="string"){let h;g.endsWith("rem")?h=parseFloat(g.replace(/rem$/,""))*16:h=parseFloat(g.replace(/px$/,"")),isNaN(h)||(d[b]=h)}S.spacing=d}else S.spacing={};W.clear()}function Ce(){return S}function Ee(){var t;return Object.keys((t=S.colors)!=null?t:{}).length>0?S.colors:void 0}function Ne(){W.clear()}function Te(){return{size:W.size,keys:Array.from(W.keys())}}function $t(t){let e=W.get(t);if(e)return e;if(!Tt(t)){let f={style:N(t,S)};return W.set(t,f),f}let{base:i,modifiers:r}=At(t),o=i.join(" "),s={style:o?N(o,S):{}};if(r.has("active")){let a=r.get("active");if(a&&a.length>0){let f=a.join(" ");s.activeStyle=N(f,S)}}if(r.has("focus")){let a=r.get("focus");if(a&&a.length>0){let f=a.join(" ");s.focusStyle=N(f,S)}}if(r.has("disabled")){let a=r.get("disabled");if(a&&a.length>0){let f=a.join(" ");s.disabledStyle=N(f,S)}}return W.set(t,s),s}function Ae(t,...e){let r=t.reduce((o,n,s)=>{let a=e[s],f=a!=null&&a!==!1?String(a):"";return o+n+f},"").trim().replace(/\s+/g," ");return r?$t(r):{style:{}}}function $e(t){let e=t.trim().replace(/\s+/g," ");if(e)return $t(e)}
|
|
1
|
+
"use strict";var j=Object.defineProperty,_t=Object.defineProperties,It=Object.getOwnPropertyDescriptor,vt=Object.getOwnPropertyDescriptors,Vt=Object.getOwnPropertyNames,st=Object.getOwnPropertySymbols;var ft=Object.prototype.hasOwnProperty,jt=Object.prototype.propertyIsEnumerable;var at=(t,e,i)=>e in t?j(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,x=(t,e)=>{for(var i in e||(e={}))ft.call(e,i)&&at(t,i,e[i]);if(st)for(var i of st(e))jt.call(e,i)&&at(t,i,e[i]);return t},lt=(t,e)=>_t(t,vt(e));var Pt=(t,e)=>{for(var i in e)j(t,i,{get:e[i],enumerable:!0})},Dt=(t,e,i,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Vt(e))!ft.call(t,o)&&o!==i&&j(t,o,{get:()=>e[o],enumerable:!(r=It(e,o))||r.enumerable});return t};var Lt=t=>Dt(j({},"__esModule",{value:!0}),t);var _e={};Pt(_e,{clearCache:()=>Ne,getCacheStats:()=>Te,getCustomColors:()=>Ee,getCustomTheme:()=>Ce,setConfig:()=>We,tw:()=>Ae,twStyle:()=>$e});module.exports=Lt(_e);function ct(t){return Object.keys(t)[0]}function kt(t,e){let i=[...t];for(let r of e){let o=ct(r),n=i.findIndex(s=>ct(s)===o);n!==-1?i[n]=r:i.push(r)}return i}function ut(t,e){for(let i in e)if(Object.prototype.hasOwnProperty.call(e,i)){let r=e[i];if(i==="transform"&&Array.isArray(r)){let o=t[i];Array.isArray(o)?t.transform=kt(o,r):t[i]=r}else t[i]=r}return t}var dt={"aspect-auto":void 0,"aspect-square":1,"aspect-video":1.7777777777777777};function zt(t){let e=t.match(/^\[(\d+)\/(\d+)\]$/);if(e){let i=Number.parseInt(e[1],10),r=Number.parseInt(e[2],10);return r===0?(process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Invalid aspect ratio: ${t}. Denominator cannot be zero.`),null):i/r}return null}function k(t){if(!t.startsWith("aspect-"))return null;if(t in dt){let r=dt[t];return r===void 0?{aspectRatio:void 0}:{aspectRatio:r}}let e=t.substring(7),i=zt(e);return i!==null?{aspectRatio:i}:null}var pt={red:{50:"#fef2f2",100:"#ffe2e2",200:"#ffc9c9",300:"#ffa2a2",400:"#ff6467",500:"#fb2c36",600:"#e7000b",700:"#c10007",800:"#9f0712",900:"#82181a",950:"#460809"},orange:{50:"#fff7ed",100:"#ffedd4",200:"#ffd6a7",300:"#ffb86a",400:"#ff8904",500:"#ff6900",600:"#f54900",700:"#ca3500",800:"#9f2d00",900:"#7e2a0c",950:"#441306"},amber:{50:"#fffbeb",100:"#fef3c6",200:"#fee685",300:"#ffd230",400:"#ffb900",500:"#fe9a00",600:"#e17100",700:"#bb4d00",800:"#973c00",900:"#7b3306",950:"#461901"},yellow:{50:"#fefce8",100:"#fef9c2",200:"#fff085",300:"#ffdf20",400:"#fdc700",500:"#f0b100",600:"#d08700",700:"#a65f00",800:"#894b00",900:"#733e0a",950:"#432004"},lime:{50:"#f7fee7",100:"#ecfcca",200:"#d8f999",300:"#bbf451",400:"#9ae600",500:"#7ccf00",600:"#5ea500",700:"#497d00",800:"#3c6300",900:"#35530e",950:"#192e03"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#b9f8cf",300:"#7bf1a8",400:"#05df72",500:"#00c950",600:"#00a63e",700:"#008236",800:"#016630",900:"#0d542b",950:"#032e15"},emerald:{50:"#ecfdf5",100:"#d0fae5",200:"#a4f4cf",300:"#5ee9b5",400:"#00d492",500:"#00bc7d",600:"#009966",700:"#007a55",800:"#006045",900:"#004f3b",950:"#002c22"},teal:{50:"#f0fdfa",100:"#cbfbf1",200:"#96f7e4",300:"#46ecd5",400:"#00d5be",500:"#00bba7",600:"#009689",700:"#00786f",800:"#005f5a",900:"#0b4f4a",950:"#022f2e"},cyan:{50:"#ecfeff",100:"#cefafe",200:"#a2f4fd",300:"#53eafd",400:"#00d3f2",500:"#00b8db",600:"#0092b8",700:"#007595",800:"#005f78",900:"#104e64",950:"#053345"},sky:{50:"#f0f9ff",100:"#dff2fe",200:"#b8e6fe",300:"#74d4ff",400:"#00bcff",500:"#00a6f4",600:"#0084d1",700:"#0069a8",800:"#00598a",900:"#024a70",950:"#052f4a"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bedbff",300:"#8ec5ff",400:"#51a2ff",500:"#2b7fff",600:"#155dfc",700:"#1447e6",800:"#193cb8",900:"#1c398e",950:"#162456"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c6d2ff",300:"#a3b3ff",400:"#7c86ff",500:"#615fff",600:"#4f39f6",700:"#432dd7",800:"#372aac",900:"#312c85",950:"#1e1a4d"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6ff",300:"#c4b4ff",400:"#a684ff",500:"#8e51ff",600:"#7f22fe",700:"#7008e7",800:"#5d0ec0",900:"#4d179a",950:"#2f0d68"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d4ff",300:"#dab2ff",400:"#c27aff",500:"#ad46ff",600:"#9810fa",700:"#8200db",800:"#6e11b0",900:"#59168b",950:"#3c0366"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f6cfff",300:"#f4a8ff",400:"#ed6aff",500:"#e12afb",600:"#c800de",700:"#a800b7",800:"#8a0194",900:"#721378",950:"#4b004f"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fccee8",300:"#fda5d5",400:"#fb64b6",500:"#f6339a",600:"#e60076",700:"#c6005c",800:"#a3004c",900:"#861043",950:"#510424"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#ffccd3",300:"#ffa1ad",400:"#ff637e",500:"#ff2056",600:"#ec003f",700:"#c70036",800:"#a50036",900:"#8b0836",950:"#4d0218"},slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cad5e2",400:"#90a1b9",500:"#62748e",600:"#45556c",700:"#314158",800:"#1d293d",900:"#0f172b",950:"#020618"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5dc",400:"#99a1af",500:"#6a7282",600:"#4a5565",700:"#364153",800:"#1e2939",900:"#101828",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#9f9fa9",500:"#71717b",600:"#52525c",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a1a1a1",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a6a09b",500:"#79716b",600:"#57534d",700:"#44403b",800:"#292524",900:"#1c1917",950:"#0c0a09"}};function A(t,e=""){let i={};for(let[r,o]of Object.entries(t)){let n=r==="DEFAULT"&&e?e:e?`${e}-${r}`:r;typeof o=="string"?i[n]=o:typeof o=="object"&&o!==null&&Object.assign(i,A(o,n))}return i}var P=lt(x({},A(pt)),{white:"#FFFFFF",black:"#000000",transparent:"transparent"});function $(t,e){if(t==="transparent")return"transparent";let i=t.replace(/^#/,""),r=i.length===3?i.split("").map(s=>s+s).join(""):i,n=Math.round(e/100*255).toString(16).padStart(2,"0").toUpperCase();return`#${r.toUpperCase()}${n}`}function _(t){let e=t.match(/^\[#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})\]$/);if(e){let i=e[1];return i.length===3?`#${i.split("").map(o=>o+o).join("")}`:`#${i}`}return null}function gt(t,e){var n;let i=s=>{var a;return(a=e==null?void 0:e[s])!=null?a:P[s]},r=t.match(/^(.+)\/(\d+)$/);if(r){let s=r[1],a=Number.parseInt(r[2],10);if(a<0||a>100)return null;let f=_(s);if(f!==null)return $(f,a);let p=i(s);return p?$(p,a):null}let o=_(t);return o!==null?o:(n=i(t))!=null?n:null}function C(t,e){let i=n=>{var s;return(s=e==null?void 0:e[n])!=null?s:P[n]},r=n=>{var f;let s=n.match(/^(.+)\/(\d+)$/);if(s){let p=s[1],d=Number.parseInt(s[2],10);if(d<0||d>100)return process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Invalid opacity value: ${d}. Opacity must be between 0 and 100.`),null;let b=_(p);if(b!==null)return $(b,d);let g=i(p);return g?$(g,d):null}let a=_(n);return a!==null?a:n.startsWith("[")&&n.endsWith("]")?(process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Unsupported arbitrary color value: ${n}. Only hex colors are supported (e.g., [#ff0000], [#f00], or [#ff0000aa]).`),null):(f=i(n))!=null?f:null};if(t.startsWith("bg-")){let n=t.substring(3);if(n.startsWith("[")&&!n.startsWith("[#"))return null;let s=r(n);if(s)return{backgroundColor:s}}if(t.startsWith("text-")){let n=t.substring(5);if(n.startsWith("[")&&!n.startsWith("[#"))return null;let s=r(n);if(s)return{color:s}}if(t.startsWith("border-")&&!t.match(/^border-[0-9]/)){let n=t.substring(7);if(n.startsWith("[")&&!n.startsWith("[#"))return null;let s=r(n);if(s)return{borderColor:s}}if(t.startsWith("outline-")&&!t.match(/^outline-[0-9]/)&&!t.startsWith("outline-offset-")){let n=t.substring(8);if(["solid","dashed","dotted","none"].includes(n)||n.startsWith("[")&&!n.startsWith("[#"))return null;let s=r(n);if(s)return{outlineColor:s}}let o=t.match(/^border-([trblxy])-(.+)$/);if(o){let n=o[1],s=o[2];if(s.startsWith("[")&&!s.startsWith("[#"))return null;let a=r(s);if(a)return n==="x"?{borderLeftColor:a,borderRightColor:a}:n==="y"?{borderTopColor:a,borderBottomColor:a}:{[{t:"borderTopColor",r:"borderRightColor",b:"borderBottomColor",l:"borderLeftColor"}[n]]:a}}return null}var v={"":1,0:0,2:2,4:4,8:8},I={none:0,sm:2,"":4,md:6,lg:8,xl:12,"2xl":16,"3xl":24,full:9999},yt={t:"borderTopWidth",r:"borderRightWidth",b:"borderBottomWidth",l:"borderLeftWidth",s:"borderStartWidth",e:"borderEndWidth"},ht={tl:"borderTopLeftRadius",tr:"borderTopRightRadius",bl:"borderBottomLeftRadius",br:"borderBottomRightRadius"},bt={ss:"borderTopStartRadius",se:"borderTopEndRadius",es:"borderBottomStartRadius",ee:"borderBottomEndRadius"},Ft={t:["borderTopLeftRadius","borderTopRightRadius"],r:["borderTopRightRadius","borderBottomRightRadius"],b:["borderBottomLeftRadius","borderBottomRightRadius"],l:["borderTopLeftRadius","borderBottomLeftRadius"],s:["borderTopStartRadius","borderBottomStartRadius"],e:["borderTopEndRadius","borderBottomEndRadius"]};function mt(t){let e=t.match(/^\[(\d+)(?:px)?\]$/);return e?parseInt(e[1],10):(t.startsWith("[")&&t.endsWith("]")&&process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Unsupported arbitrary border width value: ${t}. Only px values are supported (e.g., [8px] or [8]).`),null)}function D(t){let e=t.match(/^\[(\d+)(?:px)?\]$/);return e?parseInt(e[1],10):(t.startsWith("[")&&t.endsWith("]")&&process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Unsupported arbitrary border radius value: ${t}. Only px values are supported (e.g., [12px] or [12]).`),null)}function z(t,e){return t==="border-solid"?{borderStyle:"solid"}:t==="border-dotted"?{borderStyle:"dotted"}:t==="border-dashed"?{borderStyle:"dashed"}:t.startsWith("border-")?Kt(t,e):t==="border"?{borderWidth:1}:t.startsWith("rounded")?Bt(t):null}function Kt(t,e){let i=t.match(/^border-([trblse])(?:-(.+))?$/);if(i){let n=i[1],s=i[2]||"";if(s&&n!=="s"&&n!=="e"&&C(t,e)!==null)return null;if(s.startsWith("[")){let f=mt(s);return f!==null?{[yt[n]]:f}:null}let a=v[s];return a!==void 0?{[yt[n]]:a}:null}let r=t.match(/^border-(\d+)$/);if(r){let n=v[r[1]];if(n!==void 0)return{borderWidth:n}}let o=t.match(/^border-(\[.+\])$/);if(o){let n=mt(o[1]);if(n!==null)return{borderWidth:n}}return null}function Bt(t){let e=t.substring(7);if(e==="")return{borderRadius:I[""]};if(!e.startsWith("-"))return null;let i=e.substring(1);if(i==="")return null;let r=i.match(/^(tl|tr|bl|br)(?:-(.+))?$/);if(r){let a=r[1],f=r[2]||"";if(f.startsWith("[")){let d=D(f);return d!==null?{[ht[a]]:d}:null}let p=I[f];return p!==void 0?{[ht[a]]:p}:null}let o=i.match(/^(ss|se|es|ee)(?:-(.+))?$/);if(o){let a=o[1],f=o[2]||"";if(f.startsWith("[")){let d=D(f);return d!==null?{[bt[a]]:d}:null}let p=I[f];return p!==void 0?{[bt[a]]:p}:null}let n=i.match(/^([trblse])(?:-(.+))?$/);if(n){let a=n[1],f=n[2]||"",p;if(f.startsWith("[")){let d=D(f);if(d!==null)p=d;else return null}else p=I[f];if(p!==void 0){let d={};return Ft[a].forEach(b=>d[b]=p),d}return null}if(i.startsWith("[")){let a=D(i);return a!==null?{borderRadius:a}:null}let s=I[i];return s!==void 0?{borderRadius:s}:null}function R(t){let e=t.match(/^\[(-?\d+)(?:px)?\]$/);if(e)return parseInt(e[1],10);let i=t.match(/^\[(-?\d+(?:\.\d+)?)%\]$/);return i?`${i[1]}%`:(t.startsWith("[")&&t.endsWith("]")&&process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Unsupported arbitrary inset unit: ${t}. Only px and % are supported.`),null)}function Ht(t){let e=t.match(/^\[(-?\d+)\]$/);return e?parseInt(e[1],10):(t.startsWith("[")&&t.endsWith("]")&&process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Invalid arbitrary z-index: ${t}. Only integers are supported.`),null)}function xt(t){let e=t.match(/^\[(\d+(?:\.\d+)?|\.\d+)\]$/);return e?parseFloat(e[1]):(t.startsWith("[")&&t.endsWith("]")&&process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Invalid arbitrary grow/shrink value: ${t}. Only non-negative numbers are supported (e.g., [1.5], [2], [0.5], [.5]).`),null)}var Ut={flex:{display:"flex"},hidden:{display:"none"}},Gt={"flex-row":{flexDirection:"row"},"flex-row-reverse":{flexDirection:"row-reverse"},"flex-col":{flexDirection:"column"},"flex-col-reverse":{flexDirection:"column-reverse"}},Xt={"flex-wrap":{flexWrap:"wrap"},"flex-wrap-reverse":{flexWrap:"wrap-reverse"},"flex-nowrap":{flexWrap:"nowrap"}},Yt={"flex-1":{flex:1},"flex-auto":{flex:1},"flex-none":{flex:0}},Zt={grow:{flexGrow:1},"grow-0":{flexGrow:0},shrink:{flexShrink:1},"shrink-0":{flexShrink:0},"flex-grow":{flexGrow:1},"flex-grow-0":{flexGrow:0},"flex-shrink":{flexShrink:1},"flex-shrink-0":{flexShrink:0}},qt={"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"}},Jt={"items-start":{alignItems:"flex-start"},"items-end":{alignItems:"flex-end"},"items-center":{alignItems:"center"},"items-baseline":{alignItems:"baseline"},"items-stretch":{alignItems:"stretch"}},Qt={"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"}},te={"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"}},ee={absolute:{position:"absolute"},relative:{position:"relative"}},re={"overflow-hidden":{overflow:"hidden"},"overflow-visible":{overflow:"visible"},"overflow-scroll":{overflow:"scroll"}},ne={"opacity-0":{opacity:0},"opacity-5":{opacity:.05},"opacity-10":{opacity:.1},"opacity-15":{opacity:.15},"opacity-20":{opacity:.2},"opacity-25":{opacity:.25},"opacity-30":{opacity:.3},"opacity-35":{opacity:.35},"opacity-40":{opacity:.4},"opacity-45":{opacity:.45},"opacity-50":{opacity:.5},"opacity-55":{opacity:.55},"opacity-60":{opacity:.6},"opacity-65":{opacity:.65},"opacity-70":{opacity:.7},"opacity-75":{opacity:.75},"opacity-80":{opacity:.8},"opacity-85":{opacity:.85},"opacity-90":{opacity:.9},"opacity-95":{opacity:.95},"opacity-100":{opacity:1}},ie={0:0,10:10,20:20,30:30,40:40,50:50,auto:0},St={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 F(t,e){var p,d,b,g,h,w,tt,et,rt,nt,it,ot;let i=e?x(x({},St),e):St;if(t.startsWith("z-")){let y=t.substring(2),c=Ht(y);if(c!==null)return{zIndex:c};let l=ie[y];if(l!==void 0)return{zIndex:l}}let r=t.match(/^(-?)top-(.+)$/);if(r){let[,y,c]=r,l=y==="-";if(c==="auto")return{};let u=R(c);if(u!==null)return typeof u=="number"?{top:l?-u:u}:l&&u.endsWith("%")?{top:`${-parseFloat(u)}%`}:{top:u};let m=i[c];if(m!==void 0)return{top:l?-m:m}}let o=t.match(/^(-?)right-(.+)$/);if(o){let[,y,c]=o,l=y==="-";if(c==="auto")return{};let u=R(c);if(u!==null)return typeof u=="number"?{right:l?-u:u}:l&&u.endsWith("%")?{right:`${-parseFloat(u)}%`}:{right:u};let m=i[c];if(m!==void 0)return{right:l?-m:m}}let n=t.match(/^(-?)bottom-(.+)$/);if(n){let[,y,c]=n,l=y==="-";if(c==="auto")return{};let u=R(c);if(u!==null)return typeof u=="number"?{bottom:l?-u:u}:l&&u.endsWith("%")?{bottom:`${-parseFloat(u)}%`}:{bottom:u};let m=i[c];if(m!==void 0)return{bottom:l?-m:m}}let s=t.match(/^(-?)left-(.+)$/);if(s){let[,y,c]=s,l=y==="-";if(c==="auto")return{};let u=R(c);if(u!==null)return typeof u=="number"?{left:l?-u:u}:l&&u.endsWith("%")?{left:`${-parseFloat(u)}%`}:{left:u};let m=i[c];if(m!==void 0)return{left:l?-m:m}}let a=t.match(/^(-?)start-(.+)$/);if(a){let[,y,c]=a,l=y==="-";if(c==="auto")return{};let u=R(c);if(u!==null)return typeof u=="number"?{start:l?-u:u}:l&&u.endsWith("%")?{start:`${-parseFloat(u)}%`}:{start:u};let m=i[c];if(m!==void 0)return{start:l?-m:m}}let f=t.match(/^(-?)end-(.+)$/);if(f){let[,y,c]=f,l=y==="-";if(c==="auto")return{};let u=R(c);if(u!==null)return typeof u=="number"?{end:l?-u:u}:l&&u.endsWith("%")?{end:`${-parseFloat(u)}%`}:{end:u};let m=i[c];if(m!==void 0)return{end:l?-m:m}}if(t.startsWith("inset-x-")){let y=t.substring(8),c=R(y);if(c!==null)return{left:c,right:c};let l=i[y];if(l!==void 0)return{left:l,right:l}}if(t.startsWith("inset-y-")){let y=t.substring(8),c=R(y);if(c!==null)return{top:c,bottom:c};let l=i[y];if(l!==void 0)return{top:l,bottom:l}}if(t.startsWith("inset-s-")){let y=t.substring(8),c=R(y);if(c!==null)return{start:c};let l=i[y];if(l!==void 0)return{start:l}}if(t.startsWith("inset-e-")){let y=t.substring(8),c=R(y);if(c!==null)return{end:c};let l=i[y];if(l!==void 0)return{end:l}}if(t.startsWith("inset-")){let y=t.substring(6),c=R(y);if(c!==null)return{top:c,right:c,bottom:c,left:c};let l=i[y];if(l!==void 0)return{top:l,right:l,bottom:l,left:l}}if(t.startsWith("grow-")||t.startsWith("flex-grow-")){let y=t.startsWith("flex-grow-")?"flex-grow-":"grow-",c=t.substring(y.length),l=xt(c);if(l!==null)return{flexGrow:l}}if(t.startsWith("shrink-")||t.startsWith("flex-shrink-")){let y=t.startsWith("flex-shrink-")?"flex-shrink-":"shrink-",c=t.substring(y.length),l=xt(c);if(l!==null)return{flexShrink:l}}return(ot=(it=(nt=(rt=(et=(tt=(w=(h=(g=(b=(d=(p=Ut[t])!=null?p:Gt[t])!=null?d:Xt[t])!=null?b:Yt[t])!=null?g:Zt[t])!=null?h:qt[t])!=null?w:Jt[t])!=null?tt:Qt[t])!=null?et:te[t])!=null?rt:ee[t])!=null?nt:re[t])!=null?it:ne[t])!=null?ot:null}function Rt(t){let e=t.match(/^\[(\d+)(?:px)?\]$/);return e?parseInt(e[1],10):(t.startsWith("[")&&t.endsWith("]")&&process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Unsupported arbitrary outline value: ${t}. Only px values are supported (e.g., [8px] or [8]).`),null)}function K(t){if(t==="outline")return{outlineWidth:1,outlineStyle:"solid"};if(t==="outline-none")return{outlineWidth:0};if(t==="outline-solid")return{outlineStyle:"solid"};if(t==="outline-dotted")return{outlineStyle:"dotted"};if(t==="outline-dashed")return{outlineStyle:"dashed"};if(t.startsWith("outline-offset-")){let r=t.substring(15);if(r.startsWith("[")){let n=Rt(r);return n!==null?{outlineOffset:n}:null}let o=v[r];return o!==void 0?{outlineOffset:o}:null}let e=t.match(/^outline-(\d+)$/);if(e){let r=v[e[1]];if(r!==void 0)return{outlineWidth:r}}let i=t.match(/^outline-(\[.+\])$/);if(i){let r=Rt(i[1]);return r!==null?{outlineWidth:r}:null}return null}var wt={"shadow-sm":{shadowColor:"#000000",shadowOffset:{width:0,height:1},shadowOpacity:.05,shadowRadius:1,elevation:1},shadow:{shadowColor:"#000000",shadowOffset:{width:0,height:1},shadowOpacity:.1,shadowRadius:2,elevation:2},"shadow-md":{shadowColor:"#000000",shadowOffset:{width:0,height:3},shadowOpacity:.15,shadowRadius:4,elevation:4},"shadow-lg":{shadowColor:"#000000",shadowOffset:{width:0,height:6},shadowOpacity:.2,shadowRadius:8,elevation:8},"shadow-xl":{shadowColor:"#000000",shadowOffset:{width:0,height:10},shadowOpacity:.25,shadowRadius:12,elevation:12},"shadow-2xl":{shadowColor:"#000000",shadowOffset:{width:0,height:20},shadowOpacity:.3,shadowRadius:24,elevation:16},"shadow-none":{shadowColor:"transparent",shadowOffset:{width:0,height:0},shadowOpacity:0,shadowRadius:0,elevation:0}};function B(t,e){if(t in wt)return wt[t];if(t.startsWith("shadow-")){let i=t.substring(7),r=gt(i,e);if(r)return{shadowColor:r}}return null}var H="{{RUNTIME:dimensions.";var Ot={px:1,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},O={full:"100%","1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%"};function M(t){let e=t.match(/^\[(\d+)(?:px)?\]$/);if(e)return parseInt(e[1],10);let i=t.match(/^\[(\d+(?:\.\d+)?)%\]$/);return i?`${i[1]}%`:(t.startsWith("[")&&t.endsWith("]")&&process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Unsupported arbitrary size unit: ${t}. Only px and % are supported.`),null)}function U(t,e){let i=e?x(x({},Ot),e):Ot;if(t.startsWith("size-")){let r=t.substring(5),o=M(r);if(o!==null)return{width:o,height:o};let n=O[r];if(n)return{width:n,height:n};let s=i[r];if(s!==void 0)return{width:s,height:s};if(r==="auto")return{width:"auto",height:"auto"}}if(t.startsWith("w-")){let r=t.substring(2);if(r==="screen")return{width:`${H}width}}`};let o=M(r);if(o!==null)return{width:o};let n=O[r];if(n)return{width:n};let s=i[r];if(s!==void 0)return{width:s};if(r==="auto")return{width:"auto"}}if(t.startsWith("h-")){let r=t.substring(2);if(r==="screen")return{height:`${H}height}}`};let o=M(r);if(o!==null)return{height:o};let n=O[r];if(n)return{height:n};let s=i[r];if(s!==void 0)return{height:s};if(r==="auto")return{height:"auto"}}if(t.startsWith("min-w-")){let r=t.substring(6),o=M(r);if(o!==null)return{minWidth:o};let n=O[r];if(n)return{minWidth:n};let s=i[r];if(s!==void 0)return{minWidth:s}}if(t.startsWith("min-h-")){let r=t.substring(6),o=M(r);if(o!==null)return{minHeight:o};let n=O[r];if(n)return{minHeight:n};let s=i[r];if(s!==void 0)return{minHeight:s}}if(t.startsWith("max-w-")){let r=t.substring(6),o=M(r);if(o!==null)return{maxWidth:o};let n=O[r];if(n)return{maxWidth:n};let s=i[r];if(s!==void 0)return{maxWidth:s}}if(t.startsWith("max-h-")){let r=t.substring(6),o=M(r);if(o!==null)return{maxHeight:o};let n=O[r];if(n)return{maxHeight:n};let s=i[r];if(s!==void 0)return{maxHeight:s}}return null}var V={px:1,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 G(t){let e=t.match(/^\[(-?\d+(?:\.\d+)?)(?:px)?\]$/);return e?parseFloat(e[1]):(t.startsWith("[")&&t.endsWith("]")&&process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Unsupported arbitrary spacing value: ${t}. Only px values are supported (e.g., [16px], [16], [4.5px], [4.5]).`),null)}function Y(t,e){let i=e?x(x({},V),e):V,r=t.match(/^m([xytrblse]?)-auto$/);if(r){let a=r[1];return X(a,"auto")}let o=t.match(/^(-?)m([xytrblse]?)-(.+)$/);if(o){let[,a,f,p]=o,d=a==="-",b=G(p);if(b!==null){let h=d?-b:b;return X(f,h)}let g=i[p];if(g!==void 0){let h=d?-g:g;return X(f,h)}}let n=t.match(/^p([xytrblse]?)-(.+)$/);if(n){let[,a,f]=n,p=G(f);if(p!==null)return Mt(a,p);let d=i[f];if(d!==void 0)return Mt(a,d)}let s=t.match(/^gap-(.+)$/);if(s){let a=s[1],f=G(a);if(f!==null)return{gap:f};let p=i[a];if(p!==void 0)return{gap:p}}return null}function X(t,e){switch(t){case"":return{margin:e};case"x":return{marginHorizontal:e};case"y":return{marginVertical:e};case"t":return{marginTop:e};case"r":return{marginRight:e};case"b":return{marginBottom:e};case"l":return{marginLeft:e};case"s":return{marginStart:e};case"e":return{marginEnd:e};default:return{}}}function Mt(t,e){switch(t){case"":return{padding:e};case"x":return{paddingHorizontal:e};case"y":return{paddingVertical:e};case"t":return{paddingTop:e};case"r":return{paddingRight:e};case"b":return{paddingBottom:e};case"l":return{paddingLeft:e};case"s":return{paddingStart:e};case"e":return{paddingEnd:e};default:return{}}}var Z={0:0,50:.5,75:.75,90:.9,95:.95,100:1,105:1.05,110:1.1,125:1.25,150:1.5,200:2},L={0:0,1:1,2:2,3:3,6:6,12:12,45:45,90:90,180:180},Wt={0:0,1:1,2:2,3:3,6:6,12:12},oe={0:0,100:100,200:200,300:300,400:400,500:500,600:600,700:700,800:800,900:900,1e3:1e3};function q(t){let e=t.match(/^\[(-?\d+(?:\.\d+)?)\]$/);return e?parseFloat(e[1]):(t.startsWith("[")&&t.endsWith("]")&&process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Invalid arbitrary scale value: ${t}. Only numbers are supported (e.g., [1.5], [0.75]).`),null)}function E(t){let e=t.match(/^\[(-?\d+(?:\.\d+)?)deg\]$/);return e?`${e[1]}deg`:(t.startsWith("[")&&t.endsWith("]")&&process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Invalid arbitrary rotation value: ${t}. Only deg unit is supported (e.g., [45deg], [-15deg]).`),null)}function Ct(t){let e=t.match(/^\[(-?\d+)(?:px)?\]$/);if(e)return parseInt(e[1],10);let i=t.match(/^\[(-?\d+(?:\.\d+)?)%\]$/);return i?`${i[1]}%`:(t.startsWith("[")&&t.endsWith("]")&&process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Unsupported arbitrary translation unit: ${t}. Only px and % are supported.`),null)}function se(t){let e=t.match(/^\[(-?\d+)\]$/);return e?parseInt(e[1],10):(t.startsWith("[")&&t.endsWith("]")&&process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Invalid arbitrary perspective value: ${t}. Only integers are supported (e.g., [1500]).`),null)}function J(t,e){let i=e?x(x({},V),e):V;if(t.startsWith("origin-"))return process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] transform-origin is not supported in React Native. Class "${t}" will be ignored.`),null;if(t.startsWith("scale-")){let r=t.substring(6),o=q(r);if(o!==null)return{transform:[{scale:o}]};let n=Z[r];if(n!==void 0)return{transform:[{scale:n}]}}if(t.startsWith("scale-x-")){let r=t.substring(8),o=q(r);if(o!==null)return{transform:[{scaleX:o}]};let n=Z[r];if(n!==void 0)return{transform:[{scaleX:n}]}}if(t.startsWith("scale-y-")){let r=t.substring(8),o=q(r);if(o!==null)return{transform:[{scaleY:o}]};let n=Z[r];if(n!==void 0)return{transform:[{scaleY:n}]}}if(t.startsWith("rotate-")||t.startsWith("-rotate-")){let r=t.startsWith("-"),o=r?t.substring(8):t.substring(7),n=E(o);if(n!==null)return{transform:[{rotate:r?`-${n}`:n}]};let s=L[o];if(s!==void 0)return{transform:[{rotate:`${r?-s:s}deg`}]}}if(t.startsWith("rotate-x-")||t.startsWith("-rotate-x-")){let r=t.startsWith("-"),o=r?t.substring(10):t.substring(9),n=E(o);if(n!==null)return{transform:[{rotateX:r?`-${n}`:n}]};let s=L[o];if(s!==void 0)return{transform:[{rotateX:`${r?-s:s}deg`}]}}if(t.startsWith("rotate-y-")||t.startsWith("-rotate-y-")){let r=t.startsWith("-"),o=r?t.substring(10):t.substring(9),n=E(o);if(n!==null)return{transform:[{rotateY:r?`-${n}`:n}]};let s=L[o];if(s!==void 0)return{transform:[{rotateY:`${r?-s:s}deg`}]}}if(t.startsWith("rotate-z-")||t.startsWith("-rotate-z-")){let r=t.startsWith("-"),o=r?t.substring(10):t.substring(9),n=E(o);if(n!==null)return{transform:[{rotateZ:r?`-${n}`:n}]};let s=L[o];if(s!==void 0)return{transform:[{rotateZ:`${r?-s:s}deg`}]}}if(t.startsWith("translate-x-")||t.startsWith("-translate-x-")){let r=t.startsWith("-"),o=r?t.substring(13):t.substring(12),n=Ct(o);if(n!==null)return{transform:[{translateX:typeof n=="number"?r?-n:n:r?`-${n}`:n}]};let s=i[o];if(s!==void 0)return{transform:[{translateX:r?-s:s}]}}if(t.startsWith("translate-y-")||t.startsWith("-translate-y-")){let r=t.startsWith("-"),o=r?t.substring(13):t.substring(12),n=Ct(o);if(n!==null)return{transform:[{translateY:typeof n=="number"?r?-n:n:r?`-${n}`:n}]};let s=i[o];if(s!==void 0)return{transform:[{translateY:r?-s:s}]}}if(t.startsWith("skew-x-")||t.startsWith("-skew-x-")){let r=t.startsWith("-"),o=r?t.substring(8):t.substring(7),n=E(o);if(n!==null)return{transform:[{skewX:r?`-${n}`:n}]};let s=Wt[o];if(s!==void 0)return{transform:[{skewX:`${r?-s:s}deg`}]}}if(t.startsWith("skew-y-")||t.startsWith("-skew-y-")){let r=t.startsWith("-"),o=r?t.substring(8):t.substring(7),n=E(o);if(n!==null)return{transform:[{skewY:r?`-${n}`:n}]};let s=Wt[o];if(s!==void 0)return{transform:[{skewY:`${r?-s:s}deg`}]}}if(t.startsWith("perspective-")){let r=t.substring(12),o=se(r);if(o!==null)return{transform:[{perspective:o}]};let n=oe[r];if(n!==void 0)return{transform:[{perspective:n}]}}return null}var ae={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 Et={"font-sans":{fontFamily:"System"},"font-serif":{fontFamily:"serif"},"font-mono":{fontFamily:"Courier"}},fe={"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"}},le={italic:{fontStyle:"italic"},"not-italic":{fontStyle:"normal"}},ce={"text-left":{textAlign:"left"},"text-center":{textAlign:"center"},"text-right":{textAlign:"right"},"text-justify":{textAlign:"justify"}},ue={underline:{textDecorationLine:"underline"},"line-through":{textDecorationLine:"line-through"},"no-underline":{textDecorationLine:"none"}},de={uppercase:{textTransform:"uppercase"},lowercase:{textTransform:"lowercase"},capitalize:{textTransform:"capitalize"},"normal-case":{textTransform:"none"}},pe={3:12,4:16,5:20,6:24,7:28,8:32,9:36,10:40},ge={"leading-none":{lineHeight:16},"leading-tight":{lineHeight:20},"leading-snug":{lineHeight:22},"leading-normal":{lineHeight:24},"leading-relaxed":{lineHeight:28},"leading-loose":{lineHeight:32}},ye={"tracking-tighter":{letterSpacing:-.8},"tracking-tight":{letterSpacing:-.4},"tracking-normal":{letterSpacing:0},"tracking-wide":{letterSpacing:.4},"tracking-wider":{letterSpacing:.8},"tracking-widest":{letterSpacing:1.6}};function he(t){let e=t.match(/^\[(-?\d+(?:\.\d+)?|-?\.\d+)(?:px)?\]$/);return e?parseFloat(e[1]):(t.startsWith("[")&&t.endsWith("]")&&process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Unsupported arbitrary font size value: ${t}. Only px values are supported (e.g., [18px], [13.5px], [.5]).`),null)}function be(t){let e=t.match(/^\[(-?\d+(?:\.\d+)?|-?\.\d+)(?:px)?\]$/);return e?parseFloat(e[1]):(t.startsWith("[")&&t.endsWith("]")&&process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Unsupported arbitrary line height value: ${t}. Only px values are supported (e.g., [24px], [21.5px], [.5]).`),null)}function me(t){let e=t.match(/^\[(-?\d+(?:\.\d+)?|-?\.\d+)(?:px)?\]$/);return e?parseFloat(e[1]):(t.startsWith("[")&&t.endsWith("]")&&process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Unsupported arbitrary letter spacing value: ${t}. Only px values are supported (e.g., [0.5px], [0.3], [.5], [-0.4]).`),null)}function Q(t,e,i){var o,n,s,a,f,p,d,b;let r=e?x(x({},Et),Object.fromEntries(Object.entries(e).map(([g,h])=>[`font-${g}`,{fontFamily:h}]))):Et;if(t.startsWith("text-")){let g=t.substring(5),h=he(g);if(h!==null)return{fontSize:h};if((i==null?void 0:i[g])!==void 0)return{fontSize:i[g]};let w=ae[g];if(w!==void 0)return{fontSize:w}}if(t.startsWith("leading-")){let g=t.substring(8),h=be(g);if(h!==null)return{lineHeight:h};let w=pe[g];if(w!==void 0)return{lineHeight:w}}if(t.startsWith("tracking-")){let g=t.substring(9),h=me(g);if(h!==null)return{letterSpacing:h}}return(b=(d=(p=(f=(a=(s=(n=(o=r[t])!=null?o:fe[t])!=null?n:le[t])!=null?s:ce[t])!=null?a:ue[t])!=null?f:de[t])!=null?p:ge[t])!=null?d:ye[t])!=null?b:null}var xe=["active","hover","focus","disabled","placeholder"],Se=["ios","android","web"],Re=["dark","light"],we=["scheme"],Oe=["rtl","ltr"],ur=[...xe,...Se,...Re,...we,...Oe];function N(t,e){let i=t.split(/\s+/).filter(Boolean),r={};for(let o of i){let n=Me(o,e);ut(r,n)}return r}function Me(t,e){let i=[r=>Y(r,e==null?void 0:e.spacing),r=>z(r,e==null?void 0:e.colors),K,r=>C(r,e==null?void 0:e.colors),r=>F(r,e==null?void 0:e.spacing),r=>Q(r,e==null?void 0:e.fontFamily,e==null?void 0:e.fontSize),r=>U(r,e==null?void 0:e.spacing),r=>B(r,e==null?void 0:e.colors),k,r=>J(r,e==null?void 0:e.spacing)];for(let r of i){let o=r(t);if(o!==null)return o}return process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Unknown class: "${t}"`),{}}var Nt=["active","focus","disabled"];function Tt(t){return Nt.some(e=>t.includes(`${e}:`))}function At(t){let e=t.split(/\s+/).filter(Boolean),i=[],r=new Map;for(let o of e){let n=!1;for(let s of Nt){let a=`${s}:`;if(o.startsWith(a)){let f=o.slice(a.length);r.has(s)||r.set(s,[]);let p=r.get(s);p&&p.push(f),n=!0;break}}n||i.push(o)}return{base:i,modifiers:r}}var S={colors:{},fontFamily:{},fontSize:{},spacing:{}},W=new Map;function We(t){var e,i,r,o,n,s,a,f,p;if((i=(e=t.theme)==null?void 0:e.extend)!=null&&i.colors?S.colors=A((r=t.theme)==null?void 0:r.extend.colors):S.colors={},(n=(o=t.theme)==null?void 0:o.extend)!=null&&n.fontFamily){let d={};for(let[b,g]of Object.entries(t.theme.extend.fontFamily))Array.isArray(g)?d[b]=g[0]:d[b]=g;S.fontFamily=d}else S.fontFamily={};if((a=(s=t.theme)==null?void 0:s.extend)!=null&&a.fontSize){let d={};for(let[b,g]of Object.entries(t.theme.extend.fontSize))if(typeof g=="number")d[b]=g;else if(typeof g=="string"){let h=parseFloat(g.replace(/px$/,""));isNaN(h)||(d[b]=h)}S.fontSize=d}else S.fontSize={};if((p=(f=t.theme)==null?void 0:f.extend)!=null&&p.spacing){let d={};for(let[b,g]of Object.entries(t.theme.extend.spacing))if(typeof g=="number")d[b]=g;else if(typeof g=="string"){let h;g.endsWith("rem")?h=parseFloat(g.replace(/rem$/,""))*16:h=parseFloat(g.replace(/px$/,"")),isNaN(h)||(d[b]=h)}S.spacing=d}else S.spacing={};W.clear()}function Ce(){return S}function Ee(){var t;return Object.keys((t=S.colors)!=null?t:{}).length>0?S.colors:void 0}function Ne(){W.clear()}function Te(){return{size:W.size,keys:Array.from(W.keys())}}function $t(t){let e=W.get(t);if(e)return e;if(!Tt(t)){let f={style:N(t,S)};return W.set(t,f),f}let{base:i,modifiers:r}=At(t),o=i.join(" "),s={style:o?N(o,S):{}};if(r.has("active")){let a=r.get("active");if(a&&a.length>0){let f=a.join(" ");s.activeStyle=N(f,S)}}if(r.has("focus")){let a=r.get("focus");if(a&&a.length>0){let f=a.join(" ");s.focusStyle=N(f,S)}}if(r.has("disabled")){let a=r.get("disabled");if(a&&a.length>0){let f=a.join(" ");s.disabledStyle=N(f,S)}}return W.set(t,s),s}function Ae(t,...e){let r=t.reduce((o,n,s)=>{let a=e[s],f=a!=null&&a!==!1?String(a):"";return o+n+f},"").trim().replace(/\s+/g," ");return r?$t(r):{style:{}}}function $e(t){let e=t.trim().replace(/\s+/g," ");if(e)return $t(e)}
|
|
2
2
|
//# sourceMappingURL=runtime.cjs.map
|