@mgcrea/react-native-tailwind 0.6.1 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +404 -0
- package/dist/babel/config-loader.ts +1 -23
- package/dist/babel/index.cjs +227 -60
- package/dist/babel/index.d.ts +27 -2
- package/dist/babel/index.test.ts +268 -0
- package/dist/babel/index.ts +352 -44
- package/dist/index.d.ts +3 -0
- package/dist/index.js +1 -1
- package/dist/parser/__snapshots__/colors.test.js.snap +242 -90
- package/dist/parser/__snapshots__/transforms.test.js.snap +58 -0
- package/dist/parser/colors.js +1 -1
- package/dist/runtime.cjs +2 -0
- package/dist/runtime.cjs.map +7 -0
- package/dist/runtime.d.ts +139 -0
- package/dist/runtime.js +2 -0
- package/dist/runtime.js.map +7 -0
- package/dist/runtime.test.js +1 -0
- package/dist/stubs/tw.d.ts +60 -0
- package/dist/stubs/tw.js +1 -0
- package/dist/utils/flattenColors.d.ts +16 -0
- package/dist/utils/flattenColors.js +1 -0
- package/dist/utils/flattenColors.test.js +1 -0
- package/dist/utils/modifiers.d.ts +29 -0
- package/dist/utils/modifiers.js +1 -0
- package/dist/utils/modifiers.test.js +1 -0
- package/dist/utils/styleKey.test.js +1 -0
- package/package.json +15 -3
- package/src/babel/config-loader.ts +1 -23
- package/src/babel/index.test.ts +268 -0
- package/src/babel/index.ts +352 -44
- package/src/index.ts +5 -0
- package/src/parser/colors.ts +8 -22
- package/src/runtime.test.ts +325 -0
- package/src/runtime.ts +280 -0
- package/src/stubs/tw.ts +80 -0
- package/src/utils/flattenColors.test.ts +361 -0
- package/src/utils/flattenColors.ts +32 -0
- package/src/utils/modifiers.test.ts +286 -0
- package/src/utils/modifiers.ts +63 -0
- package/src/utils/styleKey.test.ts +168 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/parser/aspectRatio.ts", "../src/parser/borders.ts", "../src/config/palettes.ts", "../src/utils/flattenColors.ts", "../src/parser/colors.ts", "../src/parser/layout.ts", "../src/parser/shadows.ts", "../src/parser/sizing.ts", "../src/parser/spacing.ts", "../src/parser/transforms.ts", "../src/parser/typography.ts", "../src/parser/index.ts", "../src/utils/modifiers.ts", "../src/runtime.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Aspect ratio utilities for React Native\n * Uses aspectRatio style property (React Native 0.71+)\n */\n\nimport type { StyleObject } from \"../types\";\n\n/**\n * Preset aspect ratios\n */\nconst ASPECT_RATIO_PRESETS: Record<string, number | undefined> = {\n \"aspect-auto\": undefined, // Remove aspect ratio\n \"aspect-square\": 1, // 1:1\n \"aspect-video\": 16 / 9, // 16:9\n};\n\n/**\n * Parse arbitrary aspect ratio value: aspect-[4/3]\n * @param value - Arbitrary value string (e.g., \"[4/3]\", \"[16/9]\")\n * @returns Aspect ratio number or null\n */\nfunction parseArbitraryAspectRatio(value: string): number | null {\n const match = value.match(/^\\[(\\d+)\\/(\\d+)\\]$/);\n if (match) {\n const numerator = Number.parseInt(match[1], 10);\n const denominator = Number.parseInt(match[2], 10);\n\n if (denominator === 0) {\n if (process.env.NODE_ENV !== \"production\") {\n console.warn(`[react-native-tailwind] Invalid aspect ratio: ${value}. Denominator cannot be zero.`);\n }\n return null;\n }\n\n return numerator / denominator;\n }\n\n return null;\n}\n\n/**\n * Parse aspect ratio classes\n * @param cls - Class name to parse\n * @returns Style object or null if not an aspect ratio class\n */\nexport function parseAspectRatio(cls: string): StyleObject | null {\n if (!cls.startsWith(\"aspect-\")) {\n return null;\n }\n\n // Check for preset values\n if (cls in ASPECT_RATIO_PRESETS) {\n const aspectRatio = ASPECT_RATIO_PRESETS[cls];\n // aspect-auto removes the aspect ratio constraint by returning empty object\n // (this effectively unsets the aspectRatio property)\n if (aspectRatio === undefined) {\n return {};\n }\n return { aspectRatio };\n }\n\n // Check for arbitrary values: aspect-[4/3]\n const arbitraryValue = cls.substring(7); // Remove \"aspect-\"\n const aspectRatio = parseArbitraryAspectRatio(arbitraryValue);\n if (aspectRatio !== null) {\n return { aspectRatio };\n }\n\n return null;\n}\n\n// Export presets for testing/advanced usage\nexport { ASPECT_RATIO_PRESETS };\n", "/**\n * Border utilities (border width, radius, style)\n */\n\nimport type { StyleObject } from \"../types\";\n\n// Border width scale\nexport const BORDER_WIDTH_SCALE: Record<string, number> = {\n \"\": 1,\n \"0\": 0,\n \"2\": 2,\n \"4\": 4,\n \"8\": 8,\n};\n\n// Border radius scale\nexport const BORDER_RADIUS_SCALE: Record<string, number> = {\n none: 0,\n sm: 2,\n \"\": 4,\n md: 6,\n lg: 8,\n xl: 12,\n \"2xl\": 16,\n \"3xl\": 24,\n full: 9999,\n};\n\n/**\n * Property mapping for border width directions\n */\nconst BORDER_WIDTH_PROP_MAP: Record<string, string> = {\n t: \"borderTopWidth\",\n r: \"borderRightWidth\",\n b: \"borderBottomWidth\",\n l: \"borderLeftWidth\",\n};\n\n/**\n * Property mapping for border radius corners\n */\nconst BORDER_RADIUS_CORNER_MAP: Record<string, string> = {\n tl: \"borderTopLeftRadius\",\n tr: \"borderTopRightRadius\",\n bl: \"borderBottomLeftRadius\",\n br: \"borderBottomRightRadius\",\n};\n\n/**\n * Property mapping for border radius sides (returns array of properties)\n */\nconst BORDER_RADIUS_SIDE_MAP: Record<string, string[]> = {\n t: [\"borderTopLeftRadius\", \"borderTopRightRadius\"],\n r: [\"borderTopRightRadius\", \"borderBottomRightRadius\"],\n b: [\"borderBottomLeftRadius\", \"borderBottomRightRadius\"],\n l: [\"borderTopLeftRadius\", \"borderBottomLeftRadius\"],\n};\n\n/**\n * Parse arbitrary border width value: [8px], [4]\n * Returns number for px values, null for unsupported formats\n */\nfunction parseArbitraryBorderWidth(value: string): number | null {\n // Match: [8px] or [8] (pixels only)\n const pxMatch = value.match(/^\\[(\\d+)(?:px)?\\]$/);\n if (pxMatch) {\n return parseInt(pxMatch[1], 10);\n }\n\n // Warn about unsupported formats\n if (value.startsWith(\"[\") && value.endsWith(\"]\")) {\n if (process.env.NODE_ENV !== \"production\") {\n console.warn(\n `[react-native-tailwind] Unsupported arbitrary border width value: ${value}. Only px values are supported (e.g., [8px] or [8]).`,\n );\n }\n return null;\n }\n\n return null;\n}\n\n/**\n * Parse arbitrary border radius value: [12px], [8]\n * Returns number for px values, null for unsupported formats\n */\nfunction parseArbitraryBorderRadius(value: string): number | null {\n // Match: [12px] or [12] (pixels only)\n const pxMatch = value.match(/^\\[(\\d+)(?:px)?\\]$/);\n if (pxMatch) {\n return parseInt(pxMatch[1], 10);\n }\n\n // Warn about unsupported formats\n if (value.startsWith(\"[\") && value.endsWith(\"]\")) {\n if (process.env.NODE_ENV !== \"production\") {\n console.warn(\n `[react-native-tailwind] Unsupported arbitrary border radius value: ${value}. Only px values are supported (e.g., [12px] or [12]).`,\n );\n }\n return null;\n }\n\n return null;\n}\n\n/**\n * Parse border classes\n */\nexport function parseBorder(cls: string): StyleObject | null {\n // Border style (must come before parseBorderWidth)\n if (cls === \"border-solid\") return { borderStyle: \"solid\" };\n if (cls === \"border-dotted\") return { borderStyle: \"dotted\" };\n if (cls === \"border-dashed\") return { borderStyle: \"dashed\" };\n\n // Border width (border-0, border-t, border-[8px], etc.)\n if (cls.startsWith(\"border-\")) {\n return parseBorderWidth(cls);\n }\n\n if (cls === \"border\") {\n return { borderWidth: 1 };\n }\n\n // Border radius (rounded, rounded-t, rounded-[12px], etc.)\n if (cls.startsWith(\"rounded\")) {\n return parseBorderRadius(cls);\n }\n\n return null;\n}\n\n/**\n * Parse border width classes\n */\nfunction parseBorderWidth(cls: string): StyleObject | null {\n // Directional borders: border-t, border-t-2, border-t-[8px]\n const dirMatch = cls.match(/^border-([trbl])(?:-(.+))?$/);\n if (dirMatch) {\n const dir = dirMatch[1];\n const valueStr = dirMatch[2] || \"\"; // empty string for border-t\n\n // Try arbitrary value first (if it starts with [)\n if (valueStr.startsWith(\"[\")) {\n const arbitraryValue = parseArbitraryBorderWidth(valueStr);\n if (arbitraryValue !== null) {\n return { [BORDER_WIDTH_PROP_MAP[dir]]: arbitraryValue };\n }\n return null;\n }\n\n // Try preset scale\n const scaleValue = BORDER_WIDTH_SCALE[valueStr];\n if (scaleValue !== undefined) {\n return { [BORDER_WIDTH_PROP_MAP[dir]]: scaleValue };\n }\n\n return null;\n }\n\n // All borders with preset values: border-0, border-2, border-4, border-8\n const allMatch = cls.match(/^border-(\\d+)$/);\n if (allMatch) {\n const value = BORDER_WIDTH_SCALE[allMatch[1]];\n if (value !== undefined) {\n return { borderWidth: value };\n }\n }\n\n // All borders with arbitrary values: border-[8px]\n const allArbMatch = cls.match(/^border-(\\[.+\\])$/);\n if (allArbMatch) {\n const arbitraryValue = parseArbitraryBorderWidth(allArbMatch[1]);\n if (arbitraryValue !== null) {\n return { borderWidth: arbitraryValue };\n }\n }\n\n return null;\n}\n\n/**\n * Parse border radius classes\n */\nfunction parseBorderRadius(cls: string): StyleObject | null {\n // Remove \"rounded\" prefix for easier parsing\n const withoutPrefix = cls.substring(7); // \"rounded\".length = 7\n\n // Handle \"rounded\" by itself\n if (withoutPrefix === \"\") {\n return { borderRadius: BORDER_RADIUS_SCALE[\"\"] };\n }\n\n // Must start with \"-\" after \"rounded\"\n if (!withoutPrefix.startsWith(\"-\")) {\n return null;\n }\n\n const rest = withoutPrefix.substring(1); // Remove leading \"-\"\n\n // Handle \"rounded-\" (just dash, no content)\n if (rest === \"\") {\n return null;\n }\n\n // Specific corners: rounded-tl, rounded-tl-lg, rounded-tl-[8px]\n const cornerMatch = rest.match(/^(tl|tr|bl|br)(?:-(.+))?$/);\n if (cornerMatch) {\n const corner = cornerMatch[1];\n const valueStr = cornerMatch[2] || \"\"; // empty string for rounded-tl\n\n // Try arbitrary value first\n if (valueStr.startsWith(\"[\")) {\n const arbitraryValue = parseArbitraryBorderRadius(valueStr);\n if (arbitraryValue !== null) {\n return { [BORDER_RADIUS_CORNER_MAP[corner]]: arbitraryValue };\n }\n return null;\n }\n\n // Try preset scale\n const scaleValue = BORDER_RADIUS_SCALE[valueStr];\n if (scaleValue !== undefined) {\n return { [BORDER_RADIUS_CORNER_MAP[corner]]: scaleValue };\n }\n\n return null;\n }\n\n // Sides: rounded-t, rounded-t-lg, rounded-t-[8px]\n const sideMatch = rest.match(/^([trbl])(?:-(.+))?$/);\n if (sideMatch) {\n const side = sideMatch[1];\n const valueStr = sideMatch[2] || \"\"; // empty string for rounded-t\n\n let value: number | undefined;\n\n // Try arbitrary value first\n if (valueStr.startsWith(\"[\")) {\n const arbitraryValue = parseArbitraryBorderRadius(valueStr);\n if (arbitraryValue !== null) {\n value = arbitraryValue;\n } else {\n return null;\n }\n } else {\n // Try preset scale\n value = BORDER_RADIUS_SCALE[valueStr];\n }\n\n if (value !== undefined) {\n const result: StyleObject = {};\n BORDER_RADIUS_SIDE_MAP[side].forEach((prop) => (result[prop] = value));\n return result;\n }\n\n return null;\n }\n\n // All corners with preset values: rounded-lg, rounded-xl, etc.\n // Or arbitrary values: rounded-[12px]\n if (rest.startsWith(\"[\")) {\n const arbitraryValue = parseArbitraryBorderRadius(rest);\n if (arbitraryValue !== null) {\n return { borderRadius: arbitraryValue };\n }\n return null;\n }\n\n // Preset scale\n const scaleValue = BORDER_RADIUS_SCALE[rest];\n if (scaleValue !== undefined) {\n return { borderRadius: scaleValue };\n }\n\n return null;\n}\n", "export type TailwindPalette = {\n \"50\": string;\n \"100\": string;\n \"200\": string;\n \"300\": string;\n \"400\": string;\n \"500\": string;\n \"600\": string;\n \"700\": string;\n \"800\": string;\n \"900\": string;\n \"950\": string;\n};\n\nexport const TAILWIND_PALETTES = {\n red: {\n \"50\": \"#fef2f2\",\n \"100\": \"#ffe2e2\",\n \"200\": \"#ffc9c9\",\n \"300\": \"#ffa2a2\",\n \"400\": \"#ff6467\",\n \"500\": \"#fb2c36\",\n \"600\": \"#e7000b\",\n \"700\": \"#c10007\",\n \"800\": \"#9f0712\",\n \"900\": \"#82181a\",\n \"950\": \"#460809\",\n },\n orange: {\n \"50\": \"#fff7ed\",\n \"100\": \"#ffedd4\",\n \"200\": \"#ffd6a7\",\n \"300\": \"#ffb86a\",\n \"400\": \"#ff8904\",\n \"500\": \"#ff6900\",\n \"600\": \"#f54900\",\n \"700\": \"#ca3500\",\n \"800\": \"#9f2d00\",\n \"900\": \"#7e2a0c\",\n \"950\": \"#441306\",\n },\n amber: {\n \"50\": \"#fffbeb\",\n \"100\": \"#fef3c6\",\n \"200\": \"#fee685\",\n \"300\": \"#ffd230\",\n \"400\": \"#ffb900\",\n \"500\": \"#fe9a00\",\n \"600\": \"#e17100\",\n \"700\": \"#bb4d00\",\n \"800\": \"#973c00\",\n \"900\": \"#7b3306\",\n \"950\": \"#461901\",\n },\n yellow: {\n \"50\": \"#fefce8\",\n \"100\": \"#fef9c2\",\n \"200\": \"#fff085\",\n \"300\": \"#ffdf20\",\n \"400\": \"#fdc700\",\n \"500\": \"#f0b100\",\n \"600\": \"#d08700\",\n \"700\": \"#a65f00\",\n \"800\": \"#894b00\",\n \"900\": \"#733e0a\",\n \"950\": \"#432004\",\n },\n lime: {\n \"50\": \"#f7fee7\",\n \"100\": \"#ecfcca\",\n \"200\": \"#d8f999\",\n \"300\": \"#bbf451\",\n \"400\": \"#9ae600\",\n \"500\": \"#7ccf00\",\n \"600\": \"#5ea500\",\n \"700\": \"#497d00\",\n \"800\": \"#3c6300\",\n \"900\": \"#35530e\",\n \"950\": \"#192e03\",\n },\n green: {\n \"50\": \"#f0fdf4\",\n \"100\": \"#dcfce7\",\n \"200\": \"#b9f8cf\",\n \"300\": \"#7bf1a8\",\n \"400\": \"#05df72\",\n \"500\": \"#00c950\",\n \"600\": \"#00a63e\",\n \"700\": \"#008236\",\n \"800\": \"#016630\",\n \"900\": \"#0d542b\",\n \"950\": \"#032e15\",\n },\n emerald: {\n \"50\": \"#ecfdf5\",\n \"100\": \"#d0fae5\",\n \"200\": \"#a4f4cf\",\n \"300\": \"#5ee9b5\",\n \"400\": \"#00d492\",\n \"500\": \"#00bc7d\",\n \"600\": \"#009966\",\n \"700\": \"#007a55\",\n \"800\": \"#006045\",\n \"900\": \"#004f3b\",\n \"950\": \"#002c22\",\n },\n teal: {\n \"50\": \"#f0fdfa\",\n \"100\": \"#cbfbf1\",\n \"200\": \"#96f7e4\",\n \"300\": \"#46ecd5\",\n \"400\": \"#00d5be\",\n \"500\": \"#00bba7\",\n \"600\": \"#009689\",\n \"700\": \"#00786f\",\n \"800\": \"#005f5a\",\n \"900\": \"#0b4f4a\",\n \"950\": \"#022f2e\",\n },\n cyan: {\n \"50\": \"#ecfeff\",\n \"100\": \"#cefafe\",\n \"200\": \"#a2f4fd\",\n \"300\": \"#53eafd\",\n \"400\": \"#00d3f2\",\n \"500\": \"#00b8db\",\n \"600\": \"#0092b8\",\n \"700\": \"#007595\",\n \"800\": \"#005f78\",\n \"900\": \"#104e64\",\n \"950\": \"#053345\",\n },\n sky: {\n \"50\": \"#f0f9ff\",\n \"100\": \"#dff2fe\",\n \"200\": \"#b8e6fe\",\n \"300\": \"#74d4ff\",\n \"400\": \"#00bcff\",\n \"500\": \"#00a6f4\",\n \"600\": \"#0084d1\",\n \"700\": \"#0069a8\",\n \"800\": \"#00598a\",\n \"900\": \"#024a70\",\n \"950\": \"#052f4a\",\n },\n blue: {\n \"50\": \"#eff6ff\",\n \"100\": \"#dbeafe\",\n \"200\": \"#bedbff\",\n \"300\": \"#8ec5ff\",\n \"400\": \"#51a2ff\",\n \"500\": \"#2b7fff\",\n \"600\": \"#155dfc\",\n \"700\": \"#1447e6\",\n \"800\": \"#193cb8\",\n \"900\": \"#1c398e\",\n \"950\": \"#162456\",\n },\n indigo: {\n \"50\": \"#eef2ff\",\n \"100\": \"#e0e7ff\",\n \"200\": \"#c6d2ff\",\n \"300\": \"#a3b3ff\",\n \"400\": \"#7c86ff\",\n \"500\": \"#615fff\",\n \"600\": \"#4f39f6\",\n \"700\": \"#432dd7\",\n \"800\": \"#372aac\",\n \"900\": \"#312c85\",\n \"950\": \"#1e1a4d\",\n },\n violet: {\n \"50\": \"#f5f3ff\",\n \"100\": \"#ede9fe\",\n \"200\": \"#ddd6ff\",\n \"300\": \"#c4b4ff\",\n \"400\": \"#a684ff\",\n \"500\": \"#8e51ff\",\n \"600\": \"#7f22fe\",\n \"700\": \"#7008e7\",\n \"800\": \"#5d0ec0\",\n \"900\": \"#4d179a\",\n \"950\": \"#2f0d68\",\n },\n purple: {\n \"50\": \"#faf5ff\",\n \"100\": \"#f3e8ff\",\n \"200\": \"#e9d4ff\",\n \"300\": \"#dab2ff\",\n \"400\": \"#c27aff\",\n \"500\": \"#ad46ff\",\n \"600\": \"#9810fa\",\n \"700\": \"#8200db\",\n \"800\": \"#6e11b0\",\n \"900\": \"#59168b\",\n \"950\": \"#3c0366\",\n },\n fuchsia: {\n \"50\": \"#fdf4ff\",\n \"100\": \"#fae8ff\",\n \"200\": \"#f6cfff\",\n \"300\": \"#f4a8ff\",\n \"400\": \"#ed6aff\",\n \"500\": \"#e12afb\",\n \"600\": \"#c800de\",\n \"700\": \"#a800b7\",\n \"800\": \"#8a0194\",\n \"900\": \"#721378\",\n \"950\": \"#4b004f\",\n },\n pink: {\n \"50\": \"#fdf2f8\",\n \"100\": \"#fce7f3\",\n \"200\": \"#fccee8\",\n \"300\": \"#fda5d5\",\n \"400\": \"#fb64b6\",\n \"500\": \"#f6339a\",\n \"600\": \"#e60076\",\n \"700\": \"#c6005c\",\n \"800\": \"#a3004c\",\n \"900\": \"#861043\",\n \"950\": \"#510424\",\n },\n rose: {\n \"50\": \"#fff1f2\",\n \"100\": \"#ffe4e6\",\n \"200\": \"#ffccd3\",\n \"300\": \"#ffa1ad\",\n \"400\": \"#ff637e\",\n \"500\": \"#ff2056\",\n \"600\": \"#ec003f\",\n \"700\": \"#c70036\",\n \"800\": \"#a50036\",\n \"900\": \"#8b0836\",\n \"950\": \"#4d0218\",\n },\n slate: {\n \"50\": \"#f8fafc\",\n \"100\": \"#f1f5f9\",\n \"200\": \"#e2e8f0\",\n \"300\": \"#cad5e2\",\n \"400\": \"#90a1b9\",\n \"500\": \"#62748e\",\n \"600\": \"#45556c\",\n \"700\": \"#314158\",\n \"800\": \"#1d293d\",\n \"900\": \"#0f172b\",\n \"950\": \"#020618\",\n },\n gray: {\n \"50\": \"#f9fafb\",\n \"100\": \"#f3f4f6\",\n \"200\": \"#e5e7eb\",\n \"300\": \"#d1d5dc\",\n \"400\": \"#99a1af\",\n \"500\": \"#6a7282\",\n \"600\": \"#4a5565\",\n \"700\": \"#364153\",\n \"800\": \"#1e2939\",\n \"900\": \"#101828\",\n \"950\": \"#030712\",\n },\n zinc: {\n \"50\": \"#fafafa\",\n \"100\": \"#f4f4f5\",\n \"200\": \"#e4e4e7\",\n \"300\": \"#d4d4d8\",\n \"400\": \"#9f9fa9\",\n \"500\": \"#71717b\",\n \"600\": \"#52525c\",\n \"700\": \"#3f3f46\",\n \"800\": \"#27272a\",\n \"900\": \"#18181b\",\n \"950\": \"#09090b\",\n },\n neutral: {\n \"50\": \"#fafafa\",\n \"100\": \"#f5f5f5\",\n \"200\": \"#e5e5e5\",\n \"300\": \"#d4d4d4\",\n \"400\": \"#a1a1a1\",\n \"500\": \"#737373\",\n \"600\": \"#525252\",\n \"700\": \"#404040\",\n \"800\": \"#262626\",\n \"900\": \"#171717\",\n \"950\": \"#0a0a0a\",\n },\n stone: {\n \"50\": \"#fafaf9\",\n \"100\": \"#f5f5f4\",\n \"200\": \"#e7e5e4\",\n \"300\": \"#d6d3d1\",\n \"400\": \"#a6a09b\",\n \"500\": \"#79716b\",\n \"600\": \"#57534d\",\n \"700\": \"#44403b\",\n \"800\": \"#292524\",\n \"900\": \"#1c1917\",\n \"950\": \"#0c0a09\",\n },\n} satisfies Record<string, TailwindPalette>;\n\nexport type TailwindColor = keyof typeof TAILWIND_PALETTES;\n", "/**\n * Type representing a nested color structure that can be arbitrarily deep\n */\ntype NestedColors = {\n [key: string]: string | NestedColors;\n};\n\n/**\n * Flatten nested color objects into flat key-value map\n * Example: { brand: { light: '#fff', dark: '#000' } } => { 'brand-light': '#fff', 'brand-dark': '#000' }\n *\n * @param colors - Nested color object where values can be strings or objects\n * @param prefix - Optional prefix for nested keys (used for recursion)\n * @returns Flattened color map with dash-separated keys\n */\nexport function flattenColors(colors: NestedColors, prefix = \"\"): Record<string, string> {\n const result: Record<string, string> = {};\n\n for (const [key, value] of Object.entries(colors)) {\n const newKey = prefix ? `${prefix}-${key}` : key;\n\n if (typeof value === \"string\") {\n result[newKey] = value;\n } else if (typeof value === \"object\" && value !== null) {\n // Recursively flatten nested objects\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n Object.assign(result, flattenColors(value as NestedColors, newKey));\n }\n }\n\n return result;\n}\n", "/**\n * Color utilities (background, text, border colors)\n */\n\nimport { TAILWIND_PALETTES } from \"../config/palettes\";\nimport type { StyleObject } from \"../types\";\nimport { flattenColors } from \"../utils/flattenColors\";\n\n// Tailwind color palette (flattened from config)\nexport const COLORS: Record<string, string> = {\n ...flattenColors(TAILWIND_PALETTES),\n // Add basic colors\n white: \"#FFFFFF\",\n black: \"#000000\",\n transparent: \"transparent\",\n};\n\n/**\n * Apply opacity to hex color by appending alpha channel\n * @param hex - Hex color string (e.g., \"#ff0000\", \"#f00\", or \"transparent\")\n * @param opacity - Opacity value 0-100 (e.g., 50 for 50%)\n * @returns 8-digit hex with alpha (e.g., \"#FF000080\") or rgba for special colors\n */\nfunction applyOpacity(hex: string, opacity: number): string {\n // Handle transparent specially\n if (hex === \"transparent\") {\n return \"transparent\";\n }\n\n // Remove # if present\n const cleanHex = hex.replace(/^#/, \"\");\n\n // Expand 3-digit hex to 6-digit: #abc -> #aabbcc\n const fullHex =\n cleanHex.length === 3\n ? cleanHex\n .split(\"\")\n .map((char) => char + char)\n .join(\"\")\n : cleanHex;\n\n // Convert opacity percentage (0-100) to hex (00-FF)\n const alpha = Math.round((opacity / 100) * 255);\n const alphaHex = alpha.toString(16).padStart(2, \"0\").toUpperCase();\n\n // Return 8-digit hex: #RRGGBBAA\n return `#${fullHex.toUpperCase()}${alphaHex}`;\n}\n\n/**\n * Parse arbitrary color value: [#ff0000], [#f00], [#FF0000AA]\n * Supports 3-digit, 6-digit, and 8-digit (with alpha) hex colors\n * Returns hex string if valid, null otherwise\n */\nfunction parseArbitraryColor(value: string): string | null {\n // Match: [#rgb], [#rrggbb], or [#rrggbbaa]\n const hexMatch = value.match(/^\\[#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})\\]$/);\n if (hexMatch) {\n const hex = hexMatch[1];\n // Expand 3-digit hex to 6-digit: #abc -> #aabbcc\n if (hex.length === 3) {\n const expanded = hex\n .split(\"\")\n .map((char) => char + char)\n .join(\"\");\n return `#${expanded}`;\n }\n return `#${hex}`;\n }\n\n // Warn about unsupported formats\n if (value.startsWith(\"[\") && value.endsWith(\"]\")) {\n if (process.env.NODE_ENV !== \"production\") {\n console.warn(\n `[react-native-tailwind] Unsupported arbitrary color value: ${value}. Only hex colors are supported (e.g., [#ff0000], [#f00], or [#ff0000aa]).`,\n );\n }\n return null;\n }\n\n return null;\n}\n\n/**\n * Parse color classes (background, text, border)\n * Supports opacity modifier: bg-blue-500/50, text-black/80, border-red-500/30\n */\nexport function parseColor(cls: string, customColors?: Record<string, string>): StyleObject | null {\n // Helper to get color with custom override (custom colors take precedence)\n const getColor = (key: string): string | undefined => {\n return customColors?.[key] ?? COLORS[key];\n };\n\n // Helper to parse color with optional opacity modifier\n const parseColorWithOpacity = (colorKey: string): string | null => {\n // Check for opacity modifier: blue-500/50\n const opacityMatch = colorKey.match(/^(.+)\\/(\\d+)$/);\n if (opacityMatch) {\n const baseColorKey = opacityMatch[1];\n const opacity = Number.parseInt(opacityMatch[2], 10);\n\n // Validate opacity range (0-100)\n if (opacity < 0 || opacity > 100) {\n if (process.env.NODE_ENV !== \"production\") {\n console.warn(\n `[react-native-tailwind] Invalid opacity value: ${opacity}. Opacity must be between 0 and 100.`,\n );\n }\n return null;\n }\n\n // Try arbitrary color first: bg-[#ff0000]/50\n const arbitraryColor = parseArbitraryColor(baseColorKey);\n if (arbitraryColor !== null) {\n return applyOpacity(arbitraryColor, opacity);\n }\n\n // Try preset/custom colors: bg-blue-500/50\n const color = getColor(baseColorKey);\n if (color) {\n return applyOpacity(color, opacity);\n }\n\n return null;\n }\n\n // No opacity modifier - try normal color parsing\n // Try arbitrary value first\n const arbitraryColor = parseArbitraryColor(colorKey);\n if (arbitraryColor !== null) {\n return arbitraryColor;\n }\n\n // Try preset/custom colors\n return getColor(colorKey) ?? null;\n };\n\n // Background color: bg-blue-500, bg-blue-500/50, bg-[#ff0000]/80\n // Only parse arbitrary values that look like colors (start with #)\n if (cls.startsWith(\"bg-\")) {\n const colorKey = cls.substring(3);\n // Skip arbitrary values that don't look like colors (e.g., bg-[100%] is sizing)\n if (colorKey.startsWith(\"[\") && !colorKey.startsWith(\"[#\")) {\n return null;\n }\n const color = parseColorWithOpacity(colorKey);\n if (color) {\n return { backgroundColor: color };\n }\n }\n\n // Text color: text-blue-500, text-blue-500/50, text-[#ff0000]/80\n // Only parse arbitrary values that look like colors (start with #)\n if (cls.startsWith(\"text-\")) {\n const colorKey = cls.substring(5);\n // Skip arbitrary values that don't look like colors (e.g., text-[13px] is font size)\n if (colorKey.startsWith(\"[\") && !colorKey.startsWith(\"[#\")) {\n return null;\n }\n const color = parseColorWithOpacity(colorKey);\n if (color) {\n return { color: color };\n }\n }\n\n // Border color: border-blue-500, border-blue-500/50, border-[#ff0000]/80\n if (cls.startsWith(\"border-\") && !cls.match(/^border-[0-9]/)) {\n const colorKey = cls.substring(7);\n // Skip arbitrary values that don't look like colors (e.g., border-[3px] is width)\n if (colorKey.startsWith(\"[\") && !colorKey.startsWith(\"[#\")) {\n return null;\n }\n const color = parseColorWithOpacity(colorKey);\n if (color) {\n return { borderColor: color };\n }\n }\n\n return null;\n}\n", "/**\n * Layout utilities (flexbox, positioning, display)\n */\n\nimport type { StyleObject } from \"../types\";\n\n/**\n * Parse arbitrary inset value: [123px], [123], [50%], [-10px]\n * Returns number for px values, string for % values, null for unsupported units\n */\nfunction parseArbitraryInset(value: string): number | string | null {\n // Match: [123px], [123], [-123px], [-123] (pixels)\n const pxMatch = value.match(/^\\[(-?\\d+)(?:px)?\\]$/);\n if (pxMatch) {\n return parseInt(pxMatch[1], 10);\n }\n\n // Match: [50%], [-50%] (percentage)\n const percentMatch = value.match(/^\\[(-?\\d+(?:\\.\\d+)?)%\\]$/);\n if (percentMatch) {\n return `${percentMatch[1]}%`;\n }\n\n // Unsupported units (rem, em, vh, vw, etc.) - warn and reject\n if (value.startsWith(\"[\") && value.endsWith(\"]\")) {\n if (process.env.NODE_ENV !== \"production\") {\n console.warn(\n `[react-native-tailwind] Unsupported arbitrary inset unit: ${value}. Only px and % are supported.`,\n );\n }\n return null;\n }\n\n return null;\n}\n\n/**\n * Parse arbitrary z-index value: [123], [-10]\n * Returns number for valid z-index, null otherwise\n */\nfunction parseArbitraryZIndex(value: string): number | null {\n // Match: [123], [-123] (integers only)\n const zMatch = value.match(/^\\[(-?\\d+)\\]$/);\n if (zMatch) {\n return parseInt(zMatch[1], 10);\n }\n\n // Unsupported format - warn and reject\n if (value.startsWith(\"[\") && value.endsWith(\"]\")) {\n if (process.env.NODE_ENV !== \"production\") {\n console.warn(\n `[react-native-tailwind] Invalid arbitrary z-index: ${value}. Only integers are supported.`,\n );\n }\n return null;\n }\n\n return null;\n}\n\n// Display utilities\nconst DISPLAY_MAP: Record<string, StyleObject> = {\n flex: { display: \"flex\" },\n hidden: { display: \"none\" },\n};\n\n// Flex direction utilities\nconst FLEX_DIRECTION_MAP: Record<string, StyleObject> = {\n \"flex-row\": { flexDirection: \"row\" },\n \"flex-row-reverse\": { flexDirection: \"row-reverse\" },\n \"flex-col\": { flexDirection: \"column\" },\n \"flex-col-reverse\": { flexDirection: \"column-reverse\" },\n};\n\n// Flex wrap utilities\nconst FLEX_WRAP_MAP: Record<string, StyleObject> = {\n \"flex-wrap\": { flexWrap: \"wrap\" },\n \"flex-wrap-reverse\": { flexWrap: \"wrap-reverse\" },\n \"flex-nowrap\": { flexWrap: \"nowrap\" },\n};\n\n// Flex utilities\nconst FLEX_MAP: Record<string, StyleObject> = {\n \"flex-1\": { flex: 1 },\n \"flex-auto\": { flex: 1 },\n \"flex-none\": { flex: 0 },\n};\n\n// Flex grow/shrink utilities\nconst GROW_SHRINK_MAP: Record<string, StyleObject> = {\n grow: { flexGrow: 1 },\n \"grow-0\": { flexGrow: 0 },\n shrink: { flexShrink: 1 },\n \"shrink-0\": { flexShrink: 0 },\n};\n\n// Justify content utilities\nconst JUSTIFY_CONTENT_MAP: Record<string, StyleObject> = {\n \"justify-start\": { justifyContent: \"flex-start\" },\n \"justify-end\": { justifyContent: \"flex-end\" },\n \"justify-center\": { justifyContent: \"center\" },\n \"justify-between\": { justifyContent: \"space-between\" },\n \"justify-around\": { justifyContent: \"space-around\" },\n \"justify-evenly\": { justifyContent: \"space-evenly\" },\n};\n\n// Align items utilities\nconst ALIGN_ITEMS_MAP: Record<string, StyleObject> = {\n \"items-start\": { alignItems: \"flex-start\" },\n \"items-end\": { alignItems: \"flex-end\" },\n \"items-center\": { alignItems: \"center\" },\n \"items-baseline\": { alignItems: \"baseline\" },\n \"items-stretch\": { alignItems: \"stretch\" },\n};\n\n// Align self utilities\nconst ALIGN_SELF_MAP: Record<string, StyleObject> = {\n \"self-auto\": { alignSelf: \"auto\" },\n \"self-start\": { alignSelf: \"flex-start\" },\n \"self-end\": { alignSelf: \"flex-end\" },\n \"self-center\": { alignSelf: \"center\" },\n \"self-stretch\": { alignSelf: \"stretch\" },\n \"self-baseline\": { alignSelf: \"baseline\" },\n};\n\n// Align content utilities\nconst ALIGN_CONTENT_MAP: Record<string, StyleObject> = {\n \"content-start\": { alignContent: \"flex-start\" },\n \"content-end\": { alignContent: \"flex-end\" },\n \"content-center\": { alignContent: \"center\" },\n \"content-between\": { alignContent: \"space-between\" },\n \"content-around\": { alignContent: \"space-around\" },\n \"content-stretch\": { alignContent: \"stretch\" },\n};\n\n// Position utilities\nconst POSITION_MAP: Record<string, StyleObject> = {\n absolute: { position: \"absolute\" },\n relative: { position: \"relative\" },\n};\n\n// Overflow utilities\nconst OVERFLOW_MAP: Record<string, StyleObject> = {\n \"overflow-hidden\": { overflow: \"hidden\" },\n \"overflow-visible\": { overflow: \"visible\" },\n \"overflow-scroll\": { overflow: \"scroll\" },\n};\n\n// Opacity utilities\nconst OPACITY_MAP: Record<string, StyleObject> = {\n \"opacity-0\": { opacity: 0 },\n \"opacity-5\": { opacity: 0.05 },\n \"opacity-10\": { opacity: 0.1 },\n \"opacity-15\": { opacity: 0.15 },\n \"opacity-20\": { opacity: 0.2 },\n \"opacity-25\": { opacity: 0.25 },\n \"opacity-30\": { opacity: 0.3 },\n \"opacity-35\": { opacity: 0.35 },\n \"opacity-40\": { opacity: 0.4 },\n \"opacity-45\": { opacity: 0.45 },\n \"opacity-50\": { opacity: 0.5 },\n \"opacity-55\": { opacity: 0.55 },\n \"opacity-60\": { opacity: 0.6 },\n \"opacity-65\": { opacity: 0.65 },\n \"opacity-70\": { opacity: 0.7 },\n \"opacity-75\": { opacity: 0.75 },\n \"opacity-80\": { opacity: 0.8 },\n \"opacity-85\": { opacity: 0.85 },\n \"opacity-90\": { opacity: 0.9 },\n \"opacity-95\": { opacity: 0.95 },\n \"opacity-100\": { opacity: 1 },\n};\n\n// Z-index scale\nexport const Z_INDEX_SCALE: Record<string, number> = {\n 0: 0,\n 10: 10,\n 20: 20,\n 30: 30,\n 40: 40,\n 50: 50,\n auto: 0, // React Native doesn't have 'auto', default to 0\n};\n\n// Inset scale (for top/right/bottom/left positioning in pixels)\nexport const INSET_SCALE: Record<string, number> = {\n 0: 0,\n 0.5: 2,\n 1: 4,\n 1.5: 6,\n 2: 8,\n 2.5: 10,\n 3: 12,\n 3.5: 14,\n 4: 16,\n 5: 20,\n 6: 24,\n 8: 32,\n 10: 40,\n 12: 48,\n 16: 64,\n 20: 80,\n 24: 96,\n};\n\n/**\n * Parse layout classes\n */\nexport function parseLayout(cls: string): StyleObject | null {\n // Z-index: z-0, z-10, z-20, z-[999], etc.\n if (cls.startsWith(\"z-\")) {\n const zKey = cls.substring(2);\n\n // Arbitrary values: z-[123], z-[-10]\n const arbitraryZ = parseArbitraryZIndex(zKey);\n if (arbitraryZ !== null) {\n return { zIndex: arbitraryZ };\n }\n\n const zValue = Z_INDEX_SCALE[zKey];\n if (zValue !== undefined) {\n return { zIndex: zValue };\n }\n }\n\n // Top positioning: top-0, top-4, top-[10px], top-[50%], etc.\n if (cls.startsWith(\"top-\")) {\n const topKey = cls.substring(4);\n\n // Auto value - return empty object (no-op, removes the property)\n if (topKey === \"auto\") {\n return {};\n }\n\n // Arbitrary values: top-[123px], top-[50%], top-[-10px]\n const arbitraryTop = parseArbitraryInset(topKey);\n if (arbitraryTop !== null) {\n return { top: arbitraryTop };\n }\n\n const topValue = INSET_SCALE[topKey];\n if (topValue !== undefined) {\n return { top: topValue };\n }\n }\n\n // Right positioning: right-0, right-4, right-[10px], right-[50%], etc.\n if (cls.startsWith(\"right-\")) {\n const rightKey = cls.substring(6);\n\n // Auto value - return empty object (no-op, removes the property)\n if (rightKey === \"auto\") {\n return {};\n }\n\n // Arbitrary values: right-[123px], right-[50%], right-[-10px]\n const arbitraryRight = parseArbitraryInset(rightKey);\n if (arbitraryRight !== null) {\n return { right: arbitraryRight };\n }\n\n const rightValue = INSET_SCALE[rightKey];\n if (rightValue !== undefined) {\n return { right: rightValue };\n }\n }\n\n // Bottom positioning: bottom-0, bottom-4, bottom-[10px], bottom-[50%], etc.\n if (cls.startsWith(\"bottom-\")) {\n const bottomKey = cls.substring(7);\n\n // Auto value - return empty object (no-op, removes the property)\n if (bottomKey === \"auto\") {\n return {};\n }\n\n // Arbitrary values: bottom-[123px], bottom-[50%], bottom-[-10px]\n const arbitraryBottom = parseArbitraryInset(bottomKey);\n if (arbitraryBottom !== null) {\n return { bottom: arbitraryBottom };\n }\n\n const bottomValue = INSET_SCALE[bottomKey];\n if (bottomValue !== undefined) {\n return { bottom: bottomValue };\n }\n }\n\n // Left positioning: left-0, left-4, left-[10px], left-[50%], etc.\n if (cls.startsWith(\"left-\")) {\n const leftKey = cls.substring(5);\n\n // Auto value - return empty object (no-op, removes the property)\n if (leftKey === \"auto\") {\n return {};\n }\n\n // Arbitrary values: left-[123px], left-[50%], left-[-10px]\n const arbitraryLeft = parseArbitraryInset(leftKey);\n if (arbitraryLeft !== null) {\n return { left: arbitraryLeft };\n }\n\n const leftValue = INSET_SCALE[leftKey];\n if (leftValue !== undefined) {\n return { left: leftValue };\n }\n }\n\n // Inset X (left and right): inset-x-0, inset-x-4, inset-x-[10px], etc.\n if (cls.startsWith(\"inset-x-\")) {\n const insetKey = cls.substring(8);\n\n // Arbitrary values: inset-x-[123px], inset-x-[50%]\n const arbitraryInset = parseArbitraryInset(insetKey);\n if (arbitraryInset !== null) {\n return { left: arbitraryInset, right: arbitraryInset };\n }\n\n const insetValue = INSET_SCALE[insetKey];\n if (insetValue !== undefined) {\n return { left: insetValue, right: insetValue };\n }\n }\n\n // Inset Y (top and bottom): inset-y-0, inset-y-4, inset-y-[10px], etc.\n if (cls.startsWith(\"inset-y-\")) {\n const insetKey = cls.substring(8);\n\n // Arbitrary values: inset-y-[123px], inset-y-[50%]\n const arbitraryInset = parseArbitraryInset(insetKey);\n if (arbitraryInset !== null) {\n return { top: arbitraryInset, bottom: arbitraryInset };\n }\n\n const insetValue = INSET_SCALE[insetKey];\n if (insetValue !== undefined) {\n return { top: insetValue, bottom: insetValue };\n }\n }\n\n // Inset (all sides): inset-0, inset-4, inset-[10px], etc.\n if (cls.startsWith(\"inset-\")) {\n const insetKey = cls.substring(6);\n\n // Arbitrary values: inset-[123px], inset-[50%]\n const arbitraryInset = parseArbitraryInset(insetKey);\n if (arbitraryInset !== null) {\n return { top: arbitraryInset, right: arbitraryInset, bottom: arbitraryInset, left: arbitraryInset };\n }\n\n const insetValue = INSET_SCALE[insetKey];\n if (insetValue !== undefined) {\n return { top: insetValue, right: insetValue, bottom: insetValue, left: insetValue };\n }\n }\n\n // Try each lookup table in order\n return (\n DISPLAY_MAP[cls] ??\n FLEX_DIRECTION_MAP[cls] ??\n FLEX_WRAP_MAP[cls] ??\n FLEX_MAP[cls] ??\n GROW_SHRINK_MAP[cls] ??\n JUSTIFY_CONTENT_MAP[cls] ??\n ALIGN_ITEMS_MAP[cls] ??\n ALIGN_SELF_MAP[cls] ??\n ALIGN_CONTENT_MAP[cls] ??\n POSITION_MAP[cls] ??\n OVERFLOW_MAP[cls] ??\n OPACITY_MAP[cls] ??\n null\n );\n}\n", "/**\n * Shadow and elevation utilities for React Native\n * iOS uses shadow* properties, Android uses elevation\n */\n\nimport type { StyleObject } from \"../types\";\n\n/**\n * Shadow scale definitions combining iOS and Android properties\n * Based on Tailwind CSS shadow scale, adapted for React Native\n *\n * Note: We include BOTH iOS shadow properties AND Android elevation in each style.\n * React Native will automatically use the appropriate properties for each platform:\n * - iOS uses shadowColor, shadowOffset, shadowOpacity, shadowRadius\n * - Android uses elevation\n */\nconst SHADOW_SCALE: Record<string, StyleObject> = {\n \"shadow-sm\": {\n shadowColor: \"#000000\",\n shadowOffset: { width: 0, height: 1 },\n shadowOpacity: 0.05,\n shadowRadius: 1,\n elevation: 1,\n },\n shadow: {\n shadowColor: \"#000000\",\n shadowOffset: { width: 0, height: 1 },\n shadowOpacity: 0.1,\n shadowRadius: 2,\n elevation: 2,\n },\n \"shadow-md\": {\n shadowColor: \"#000000\",\n shadowOffset: { width: 0, height: 3 },\n shadowOpacity: 0.15,\n shadowRadius: 4,\n elevation: 4,\n },\n \"shadow-lg\": {\n shadowColor: \"#000000\",\n shadowOffset: { width: 0, height: 6 },\n shadowOpacity: 0.2,\n shadowRadius: 8,\n elevation: 8,\n },\n \"shadow-xl\": {\n shadowColor: \"#000000\",\n shadowOffset: { width: 0, height: 10 },\n shadowOpacity: 0.25,\n shadowRadius: 12,\n elevation: 12,\n },\n \"shadow-2xl\": {\n shadowColor: \"#000000\",\n shadowOffset: { width: 0, height: 20 },\n shadowOpacity: 0.3,\n shadowRadius: 24,\n elevation: 16,\n },\n \"shadow-none\": {\n shadowColor: \"transparent\",\n shadowOffset: { width: 0, height: 0 },\n shadowOpacity: 0,\n shadowRadius: 0,\n elevation: 0,\n },\n};\n\n/**\n * Parse shadow classes\n * @param cls - Class name to parse\n * @returns Style object or null if not a shadow class\n */\nexport function parseShadow(cls: string): StyleObject | null {\n // Check if it's a shadow class\n if (cls in SHADOW_SCALE) {\n return SHADOW_SCALE[cls];\n }\n\n return null;\n}\n\n// Export shadow scale for testing/advanced usage\nexport { SHADOW_SCALE };\n", "/**\n * Sizing utilities (width, height, min/max)\n */\n\nimport type { StyleObject } from \"../types\";\n\n// Size scale (in pixels/percentages)\nexport const SIZE_SCALE: Record<string, number> = {\n 0: 0,\n 0.5: 2,\n 1: 4,\n 1.5: 6,\n 2: 8,\n 2.5: 10,\n 3: 12,\n 3.5: 14,\n 4: 16,\n 5: 20,\n 6: 24,\n 7: 28,\n 8: 32,\n 9: 36,\n 10: 40,\n 11: 44,\n 12: 48,\n 14: 56,\n 16: 64,\n 20: 80,\n 24: 96,\n 28: 112,\n 32: 128,\n 36: 144,\n 40: 160,\n 44: 176,\n 48: 192,\n 52: 208,\n 56: 224,\n 60: 240,\n 64: 256,\n 72: 288,\n 80: 320,\n 96: 384,\n};\n\nexport const SIZE_PERCENTAGES: Record<string, string> = {\n full: \"100%\",\n \"1/2\": \"50%\",\n \"1/3\": \"33.333333%\",\n \"2/3\": \"66.666667%\",\n \"1/4\": \"25%\",\n \"2/4\": \"50%\",\n \"3/4\": \"75%\",\n \"1/5\": \"20%\",\n \"2/5\": \"40%\",\n \"3/5\": \"60%\",\n \"4/5\": \"80%\",\n \"1/6\": \"16.666667%\",\n \"2/6\": \"33.333333%\",\n \"3/6\": \"50%\",\n \"4/6\": \"66.666667%\",\n \"5/6\": \"83.333333%\",\n};\n\n/**\n * Parse arbitrary size value: [123px], [50%], [10rem]\n * Returns number for px values, string for % values, null for unsupported units\n */\nfunction parseArbitrarySize(value: string): number | string | null {\n // Match: [123px] or [123] (pixels)\n const pxMatch = value.match(/^\\[(\\d+)(?:px)?\\]$/);\n if (pxMatch) {\n return parseInt(pxMatch[1], 10);\n }\n\n // Match: [50%] (percentage)\n const percentMatch = value.match(/^\\[(\\d+(?:\\.\\d+)?)%\\]$/);\n if (percentMatch) {\n return `${percentMatch[1]}%`;\n }\n\n // Unsupported units (rem, em, vh, vw, etc.) - warn and reject\n if (value.startsWith(\"[\") && value.endsWith(\"]\")) {\n if (process.env.NODE_ENV !== \"production\") {\n console.warn(\n `[react-native-tailwind] Unsupported arbitrary size unit: ${value}. Only px and % are supported.`,\n );\n }\n return null;\n }\n\n return null;\n}\n\n/**\n * Parse sizing classes\n */\nexport function parseSizing(cls: string): StyleObject | null {\n // Width\n if (cls.startsWith(\"w-\")) {\n const sizeKey = cls.substring(2);\n\n // Arbitrary values: w-[123px], w-[50%]\n const arbitrarySize = parseArbitrarySize(sizeKey);\n if (arbitrarySize !== null) {\n return { width: arbitrarySize };\n }\n\n // Percentage widths: w-full, w-1/2, etc.\n const percentage = SIZE_PERCENTAGES[sizeKey];\n if (percentage) {\n return { width: percentage };\n }\n\n // Numeric widths: w-4, w-8, etc.\n const numericSize = SIZE_SCALE[sizeKey];\n if (numericSize !== undefined) {\n return { width: numericSize };\n }\n\n // Special values\n if (sizeKey === \"auto\") {\n return { width: \"auto\" };\n }\n }\n\n // Height\n if (cls.startsWith(\"h-\")) {\n const sizeKey = cls.substring(2);\n\n // Arbitrary values: h-[123px], h-[50%]\n const arbitrarySize = parseArbitrarySize(sizeKey);\n if (arbitrarySize !== null) {\n return { height: arbitrarySize };\n }\n\n // Percentage heights: h-full, h-1/2, etc.\n const percentage = SIZE_PERCENTAGES[sizeKey];\n if (percentage) {\n return { height: percentage };\n }\n\n // Numeric heights: h-4, h-8, etc.\n const numericSize = SIZE_SCALE[sizeKey];\n if (numericSize !== undefined) {\n return { height: numericSize };\n }\n\n // Special values\n if (sizeKey === \"auto\") {\n return { height: \"auto\" };\n }\n }\n\n // Min width\n if (cls.startsWith(\"min-w-\")) {\n const sizeKey = cls.substring(6);\n\n // Arbitrary values: min-w-[123px], min-w-[50%]\n const arbitrarySize = parseArbitrarySize(sizeKey);\n if (arbitrarySize !== null) {\n return { minWidth: arbitrarySize };\n }\n\n const percentage = SIZE_PERCENTAGES[sizeKey];\n if (percentage) {\n return { minWidth: percentage };\n }\n\n const numericSize = SIZE_SCALE[sizeKey];\n if (numericSize !== undefined) {\n return { minWidth: numericSize };\n }\n }\n\n // Min height\n if (cls.startsWith(\"min-h-\")) {\n const sizeKey = cls.substring(6);\n\n // Arbitrary values: min-h-[123px], min-h-[50%]\n const arbitrarySize = parseArbitrarySize(sizeKey);\n if (arbitrarySize !== null) {\n return { minHeight: arbitrarySize };\n }\n\n const percentage = SIZE_PERCENTAGES[sizeKey];\n if (percentage) {\n return { minHeight: percentage };\n }\n\n const numericSize = SIZE_SCALE[sizeKey];\n if (numericSize !== undefined) {\n return { minHeight: numericSize };\n }\n }\n\n // Max width\n if (cls.startsWith(\"max-w-\")) {\n const sizeKey = cls.substring(6);\n\n // Arbitrary values: max-w-[123px], max-w-[50%]\n const arbitrarySize = parseArbitrarySize(sizeKey);\n if (arbitrarySize !== null) {\n return { maxWidth: arbitrarySize };\n }\n\n const percentage = SIZE_PERCENTAGES[sizeKey];\n if (percentage) {\n return { maxWidth: percentage };\n }\n\n const numericSize = SIZE_SCALE[sizeKey];\n if (numericSize !== undefined) {\n return { maxWidth: numericSize };\n }\n }\n\n // Max height\n if (cls.startsWith(\"max-h-\")) {\n const sizeKey = cls.substring(6);\n\n // Arbitrary values: max-h-[123px], max-h-[50%]\n const arbitrarySize = parseArbitrarySize(sizeKey);\n if (arbitrarySize !== null) {\n return { maxHeight: arbitrarySize };\n }\n\n const percentage = SIZE_PERCENTAGES[sizeKey];\n if (percentage) {\n return { maxHeight: percentage };\n }\n\n const numericSize = SIZE_SCALE[sizeKey];\n if (numericSize !== undefined) {\n return { maxHeight: numericSize };\n }\n }\n\n return null;\n}\n", "/**\n * Spacing utilities (margin, padding, gap)\n */\n\nimport type { StyleObject } from \"../types\";\n\n// Tailwind spacing scale (in pixels, converted to React Native units)\nexport const SPACING_SCALE: Record<string, number> = {\n 0: 0,\n 0.5: 2,\n 1: 4,\n 1.5: 6,\n 2: 8,\n 2.5: 10,\n 3: 12,\n 3.5: 14,\n 4: 16,\n 5: 20,\n 6: 24,\n 7: 28,\n 8: 32,\n 9: 36,\n 10: 40,\n 11: 44,\n 12: 48,\n 14: 56,\n 16: 64,\n 20: 80,\n 24: 96,\n 28: 112,\n 32: 128,\n 36: 144,\n 40: 160,\n 44: 176,\n 48: 192,\n 52: 208,\n 56: 224,\n 60: 240,\n 64: 256,\n 72: 288,\n 80: 320,\n 96: 384,\n};\n\n/**\n * Parse arbitrary spacing value: [16px], [20]\n * Returns number for px values, null for unsupported formats\n */\nfunction parseArbitrarySpacing(value: string): number | null {\n // Match: [16px] or [16] (pixels only)\n const pxMatch = value.match(/^\\[(\\d+)(?:px)?\\]$/);\n if (pxMatch) {\n return parseInt(pxMatch[1], 10);\n }\n\n // Warn about unsupported formats\n if (value.startsWith(\"[\") && value.endsWith(\"]\")) {\n if (process.env.NODE_ENV !== \"production\") {\n console.warn(\n `[react-native-tailwind] Unsupported arbitrary spacing value: ${value}. Only px values are supported (e.g., [16px] or [16]).`,\n );\n }\n return null;\n }\n\n return null;\n}\n\n/**\n * Parse spacing classes (margin, padding, gap)\n * Examples: m-4, mx-2, mt-8, p-4, px-2, pt-8, gap-4, m-[16px]\n */\nexport function parseSpacing(cls: string): StyleObject | null {\n // Margin: m-4, mx-2, mt-8, m-[16px], etc.\n const marginMatch = cls.match(/^m([xytrbls]?)-(.+)$/);\n if (marginMatch) {\n const [, dir, valueStr] = marginMatch;\n\n // Try arbitrary value first\n const arbitraryValue = parseArbitrarySpacing(valueStr);\n if (arbitraryValue !== null) {\n return getMarginStyle(dir, arbitraryValue);\n }\n\n // Try preset scale\n const scaleValue = SPACING_SCALE[valueStr];\n if (scaleValue !== undefined) {\n return getMarginStyle(dir, scaleValue);\n }\n }\n\n // Padding: p-4, px-2, pt-8, p-[16px], etc.\n const paddingMatch = cls.match(/^p([xytrbls]?)-(.+)$/);\n if (paddingMatch) {\n const [, dir, valueStr] = paddingMatch;\n\n // Try arbitrary value first\n const arbitraryValue = parseArbitrarySpacing(valueStr);\n if (arbitraryValue !== null) {\n return getPaddingStyle(dir, arbitraryValue);\n }\n\n // Try preset scale\n const scaleValue = SPACING_SCALE[valueStr];\n if (scaleValue !== undefined) {\n return getPaddingStyle(dir, scaleValue);\n }\n }\n\n // Gap: gap-4, gap-[16px]\n const gapMatch = cls.match(/^gap-(.+)$/);\n if (gapMatch) {\n const valueStr = gapMatch[1];\n\n // Try arbitrary value first\n const arbitraryValue = parseArbitrarySpacing(valueStr);\n if (arbitraryValue !== null) {\n return { gap: arbitraryValue };\n }\n\n // Try preset scale\n const scaleValue = SPACING_SCALE[valueStr];\n if (scaleValue !== undefined) {\n return { gap: scaleValue };\n }\n }\n\n return null;\n}\n\n/**\n * Get margin style object based on direction\n */\nfunction getMarginStyle(dir: string, value: number): StyleObject {\n switch (dir) {\n case \"\":\n return { margin: value };\n case \"x\":\n return { marginHorizontal: value };\n case \"y\":\n return { marginVertical: value };\n case \"t\":\n return { marginTop: value };\n case \"r\":\n return { marginRight: value };\n case \"b\":\n return { marginBottom: value };\n case \"l\":\n return { marginLeft: value };\n default:\n return {};\n }\n}\n\n/**\n * Get padding style object based on direction\n */\nfunction getPaddingStyle(dir: string, value: number): StyleObject {\n switch (dir) {\n case \"\":\n return { padding: value };\n case \"x\":\n return { paddingHorizontal: value };\n case \"y\":\n return { paddingVertical: value };\n case \"t\":\n return { paddingTop: value };\n case \"r\":\n return { paddingRight: value };\n case \"b\":\n return { paddingBottom: value };\n case \"l\":\n return { paddingLeft: value };\n default:\n return {};\n }\n}\n", "/**\n * Transform utilities (scale, rotate, translate, skew, perspective)\n */\n\nimport type { StyleObject } from \"../types\";\nimport { SPACING_SCALE } from \"./spacing\";\n\n// Scale values (percentage to decimal)\nexport const SCALE_MAP: Record<string, number> = {\n 0: 0,\n 50: 0.5,\n 75: 0.75,\n 90: 0.9,\n 95: 0.95,\n 100: 1,\n 105: 1.05,\n 110: 1.1,\n 125: 1.25,\n 150: 1.5,\n 200: 2,\n};\n\n// Rotation degrees\nexport const ROTATE_MAP: Record<string, number> = {\n 0: 0,\n 1: 1,\n 2: 2,\n 3: 3,\n 6: 6,\n 12: 12,\n 45: 45,\n 90: 90,\n 180: 180,\n};\n\n// Skew degrees\nexport const SKEW_MAP: Record<string, number> = {\n 0: 0,\n 1: 1,\n 2: 2,\n 3: 3,\n 6: 6,\n 12: 12,\n};\n\n// Perspective values\nexport const PERSPECTIVE_SCALE: Record<string, number> = {\n 0: 0,\n 100: 100,\n 200: 200,\n 300: 300,\n 400: 400,\n 500: 500,\n 600: 600,\n 700: 700,\n 800: 800,\n 900: 900,\n 1000: 1000,\n};\n\n/**\n * Parse arbitrary scale value: [1.23], [0.5]\n * Returns number for valid scale, null otherwise\n */\nfunction parseArbitraryScale(value: string): number | null {\n const scaleMatch = value.match(/^\\[(-?\\d+(?:\\.\\d+)?)\\]$/);\n if (scaleMatch) {\n return parseFloat(scaleMatch[1]);\n }\n\n // Unsupported format\n if (value.startsWith(\"[\") && value.endsWith(\"]\")) {\n if (process.env.NODE_ENV !== \"production\") {\n console.warn(\n `[react-native-tailwind] Invalid arbitrary scale value: ${value}. Only numbers are supported (e.g., [1.5], [0.75]).`,\n );\n }\n return null;\n }\n\n return null;\n}\n\n/**\n * Parse arbitrary rotation value: [37deg], [-15deg]\n * Returns string for valid rotation, null otherwise\n */\nfunction parseArbitraryRotation(value: string): string | null {\n const rotateMatch = value.match(/^\\[(-?\\d+(?:\\.\\d+)?)deg\\]$/);\n if (rotateMatch) {\n return `${rotateMatch[1]}deg`;\n }\n\n // Unsupported format\n if (value.startsWith(\"[\") && value.endsWith(\"]\")) {\n if (process.env.NODE_ENV !== \"production\") {\n console.warn(\n `[react-native-tailwind] Invalid arbitrary rotation value: ${value}. Only deg unit is supported (e.g., [45deg], [-15deg]).`,\n );\n }\n return null;\n }\n\n return null;\n}\n\n/**\n * Parse arbitrary translation value: [123px], [123], [50%], [-10px]\n * Returns number for px values, string for % values, null for unsupported units\n */\nfunction parseArbitraryTranslation(value: string): number | string | null {\n // Match: [123px], [123], [-123px], [-123] (pixels)\n const pxMatch = value.match(/^\\[(-?\\d+)(?:px)?\\]$/);\n if (pxMatch) {\n return parseInt(pxMatch[1], 10);\n }\n\n // Match: [50%], [-50%] (percentage)\n const percentMatch = value.match(/^\\[(-?\\d+(?:\\.\\d+)?)%\\]$/);\n if (percentMatch) {\n return `${percentMatch[1]}%`;\n }\n\n // Unsupported units\n if (value.startsWith(\"[\") && value.endsWith(\"]\")) {\n if (process.env.NODE_ENV !== \"production\") {\n console.warn(\n `[react-native-tailwind] Unsupported arbitrary translation unit: ${value}. Only px and % are supported.`,\n );\n }\n return null;\n }\n\n return null;\n}\n\n/**\n * Parse arbitrary perspective value: [1500], [2000]\n * Returns number for valid perspective, null otherwise\n */\nfunction parseArbitraryPerspective(value: string): number | null {\n const perspectiveMatch = value.match(/^\\[(-?\\d+)\\]$/);\n if (perspectiveMatch) {\n return parseInt(perspectiveMatch[1], 10);\n }\n\n // Unsupported format\n if (value.startsWith(\"[\") && value.endsWith(\"]\")) {\n if (process.env.NODE_ENV !== \"production\") {\n console.warn(\n `[react-native-tailwind] Invalid arbitrary perspective value: ${value}. Only integers are supported (e.g., [1500]).`,\n );\n }\n return null;\n }\n\n return null;\n}\n\n/**\n * Parse transform classes\n * Each transform class returns a transform array with a single transform object\n */\nexport function parseTransform(cls: string): StyleObject | null {\n // Transform origin warning (not supported in React Native)\n if (cls.startsWith(\"origin-\")) {\n if (process.env.NODE_ENV !== \"production\") {\n console.warn(\n `[react-native-tailwind] transform-origin is not supported in React Native. Class \"${cls}\" will be ignored.`,\n );\n }\n return null;\n }\n\n // Scale: scale-{value}\n if (cls.startsWith(\"scale-\")) {\n const scaleKey = cls.substring(6);\n\n // Arbitrary values: scale-[1.23]\n const arbitraryScale = parseArbitraryScale(scaleKey);\n if (arbitraryScale !== null) {\n return { transform: [{ scale: arbitraryScale }] };\n }\n\n const scaleValue = SCALE_MAP[scaleKey];\n if (scaleValue !== undefined) {\n return { transform: [{ scale: scaleValue }] };\n }\n }\n\n // Scale X: scale-x-{value}\n if (cls.startsWith(\"scale-x-\")) {\n const scaleKey = cls.substring(8);\n\n // Arbitrary values: scale-x-[1.5]\n const arbitraryScale = parseArbitraryScale(scaleKey);\n if (arbitraryScale !== null) {\n return { transform: [{ scaleX: arbitraryScale }] };\n }\n\n const scaleValue = SCALE_MAP[scaleKey];\n if (scaleValue !== undefined) {\n return { transform: [{ scaleX: scaleValue }] };\n }\n }\n\n // Scale Y: scale-y-{value}\n if (cls.startsWith(\"scale-y-\")) {\n const scaleKey = cls.substring(8);\n\n // Arbitrary values: scale-y-[2.5]\n const arbitraryScale = parseArbitraryScale(scaleKey);\n if (arbitraryScale !== null) {\n return { transform: [{ scaleY: arbitraryScale }] };\n }\n\n const scaleValue = SCALE_MAP[scaleKey];\n if (scaleValue !== undefined) {\n return { transform: [{ scaleY: scaleValue }] };\n }\n }\n\n // Rotate: rotate-{degrees}, -rotate-{degrees}\n if (cls.startsWith(\"rotate-\") || cls.startsWith(\"-rotate-\")) {\n const isNegative = cls.startsWith(\"-\");\n const rotateKey = isNegative ? cls.substring(8) : cls.substring(7);\n\n // Arbitrary values: rotate-[37deg], -rotate-[15deg]\n const arbitraryRotate = parseArbitraryRotation(rotateKey);\n if (arbitraryRotate !== null) {\n const degrees = isNegative ? `-${arbitraryRotate}` : arbitraryRotate;\n return { transform: [{ rotate: degrees }] };\n }\n\n const rotateValue = ROTATE_MAP[rotateKey];\n if (rotateValue !== undefined) {\n const degrees = isNegative ? -rotateValue : rotateValue;\n return { transform: [{ rotate: `${degrees}deg` }] };\n }\n }\n\n // Rotate X: rotate-x-{degrees}, -rotate-x-{degrees}\n if (cls.startsWith(\"rotate-x-\") || cls.startsWith(\"-rotate-x-\")) {\n const isNegative = cls.startsWith(\"-\");\n const rotateKey = isNegative ? cls.substring(10) : cls.substring(9);\n\n // Arbitrary values\n const arbitraryRotate = parseArbitraryRotation(rotateKey);\n if (arbitraryRotate !== null) {\n const degrees = isNegative ? `-${arbitraryRotate}` : arbitraryRotate;\n return { transform: [{ rotateX: degrees }] };\n }\n\n const rotateValue = ROTATE_MAP[rotateKey];\n if (rotateValue !== undefined) {\n const degrees = isNegative ? -rotateValue : rotateValue;\n return { transform: [{ rotateX: `${degrees}deg` }] };\n }\n }\n\n // Rotate Y: rotate-y-{degrees}, -rotate-y-{degrees}\n if (cls.startsWith(\"rotate-y-\") || cls.startsWith(\"-rotate-y-\")) {\n const isNegative = cls.startsWith(\"-\");\n const rotateKey = isNegative ? cls.substring(10) : cls.substring(9);\n\n // Arbitrary values\n const arbitraryRotate = parseArbitraryRotation(rotateKey);\n if (arbitraryRotate !== null) {\n const degrees = isNegative ? `-${arbitraryRotate}` : arbitraryRotate;\n return { transform: [{ rotateY: degrees }] };\n }\n\n const rotateValue = ROTATE_MAP[rotateKey];\n if (rotateValue !== undefined) {\n const degrees = isNegative ? -rotateValue : rotateValue;\n return { transform: [{ rotateY: `${degrees}deg` }] };\n }\n }\n\n // Rotate Z: rotate-z-{degrees}, -rotate-z-{degrees}\n if (cls.startsWith(\"rotate-z-\") || cls.startsWith(\"-rotate-z-\")) {\n const isNegative = cls.startsWith(\"-\");\n const rotateKey = isNegative ? cls.substring(10) : cls.substring(9);\n\n // Arbitrary values\n const arbitraryRotate = parseArbitraryRotation(rotateKey);\n if (arbitraryRotate !== null) {\n const degrees = isNegative ? `-${arbitraryRotate}` : arbitraryRotate;\n return { transform: [{ rotateZ: degrees }] };\n }\n\n const rotateValue = ROTATE_MAP[rotateKey];\n if (rotateValue !== undefined) {\n const degrees = isNegative ? -rotateValue : rotateValue;\n return { transform: [{ rotateZ: `${degrees}deg` }] };\n }\n }\n\n // Translate X: translate-x-{spacing}, -translate-x-{spacing}\n if (cls.startsWith(\"translate-x-\") || cls.startsWith(\"-translate-x-\")) {\n const isNegative = cls.startsWith(\"-\");\n const translateKey = isNegative ? cls.substring(13) : cls.substring(12);\n\n // Arbitrary values: translate-x-[123px], -translate-x-[10px]\n const arbitraryTranslate = parseArbitraryTranslation(translateKey);\n if (arbitraryTranslate !== null) {\n const value =\n typeof arbitraryTranslate === \"number\"\n ? isNegative\n ? -arbitraryTranslate\n : arbitraryTranslate\n : isNegative\n ? `-${arbitraryTranslate}`\n : arbitraryTranslate;\n return { transform: [{ translateX: value }] };\n }\n\n const translateValue = SPACING_SCALE[translateKey];\n if (translateValue !== undefined) {\n const value = isNegative ? -translateValue : translateValue;\n return { transform: [{ translateX: value }] };\n }\n }\n\n // Translate Y: translate-y-{spacing}, -translate-y-{spacing}\n if (cls.startsWith(\"translate-y-\") || cls.startsWith(\"-translate-y-\")) {\n const isNegative = cls.startsWith(\"-\");\n const translateKey = isNegative ? cls.substring(13) : cls.substring(12);\n\n // Arbitrary values: translate-y-[123px], -translate-y-[10px]\n const arbitraryTranslate = parseArbitraryTranslation(translateKey);\n if (arbitraryTranslate !== null) {\n const value =\n typeof arbitraryTranslate === \"number\"\n ? isNegative\n ? -arbitraryTranslate\n : arbitraryTranslate\n : isNegative\n ? `-${arbitraryTranslate}`\n : arbitraryTranslate;\n return { transform: [{ translateY: value }] };\n }\n\n const translateValue = SPACING_SCALE[translateKey];\n if (translateValue !== undefined) {\n const value = isNegative ? -translateValue : translateValue;\n return { transform: [{ translateY: value }] };\n }\n }\n\n // Skew X: skew-x-{degrees}, -skew-x-{degrees}\n if (cls.startsWith(\"skew-x-\") || cls.startsWith(\"-skew-x-\")) {\n const isNegative = cls.startsWith(\"-\");\n const skewKey = isNegative ? cls.substring(8) : cls.substring(7);\n\n // Arbitrary values\n const arbitrarySkew = parseArbitraryRotation(skewKey);\n if (arbitrarySkew !== null) {\n const degrees = isNegative ? `-${arbitrarySkew}` : arbitrarySkew;\n return { transform: [{ skewX: degrees }] };\n }\n\n const skewValue = SKEW_MAP[skewKey];\n if (skewValue !== undefined) {\n const degrees = isNegative ? -skewValue : skewValue;\n return { transform: [{ skewX: `${degrees}deg` }] };\n }\n }\n\n // Skew Y: skew-y-{degrees}, -skew-y-{degrees}\n if (cls.startsWith(\"skew-y-\") || cls.startsWith(\"-skew-y-\")) {\n const isNegative = cls.startsWith(\"-\");\n const skewKey = isNegative ? cls.substring(8) : cls.substring(7);\n\n // Arbitrary values\n const arbitrarySkew = parseArbitraryRotation(skewKey);\n if (arbitrarySkew !== null) {\n const degrees = isNegative ? `-${arbitrarySkew}` : arbitrarySkew;\n return { transform: [{ skewY: degrees }] };\n }\n\n const skewValue = SKEW_MAP[skewKey];\n if (skewValue !== undefined) {\n const degrees = isNegative ? -skewValue : skewValue;\n return { transform: [{ skewY: `${degrees}deg` }] };\n }\n }\n\n // Perspective: perspective-{value}\n if (cls.startsWith(\"perspective-\")) {\n const perspectiveKey = cls.substring(12);\n\n // Arbitrary values: perspective-[1500]\n const arbitraryPerspective = parseArbitraryPerspective(perspectiveKey);\n if (arbitraryPerspective !== null) {\n return { transform: [{ perspective: arbitraryPerspective }] };\n }\n\n const perspectiveValue = PERSPECTIVE_SCALE[perspectiveKey];\n if (perspectiveValue !== undefined) {\n return { transform: [{ perspective: perspectiveValue }] };\n }\n }\n\n return null;\n}\n", "/**\n * Typography utilities (font size, weight, line height, text align, letter spacing)\n */\n\nimport type { StyleObject } from \"../types\";\n\n// Font sizes\nexport const FONT_SIZES: Record<string, number> = {\n xs: 12,\n sm: 14,\n base: 16,\n lg: 18,\n xl: 20,\n \"2xl\": 24,\n \"3xl\": 30,\n \"4xl\": 36,\n \"5xl\": 48,\n \"6xl\": 60,\n \"7xl\": 72,\n \"8xl\": 96,\n \"9xl\": 128,\n};\n\n// Letter spacing scale\nexport const LETTER_SPACING_SCALE: Record<string, number> = {\n tighter: -0.8,\n tight: -0.4,\n normal: 0,\n wide: 0.4,\n wider: 0.8,\n widest: 1.6,\n};\n\n// Font family utilities\nconst FONT_FAMILY_MAP: Record<string, StyleObject> = {\n \"font-sans\": { fontFamily: \"System\" },\n \"font-serif\": { fontFamily: \"serif\" },\n \"font-mono\": { fontFamily: \"Courier\" },\n};\n\n// Font weight utilities\nconst FONT_WEIGHT_MAP: Record<string, StyleObject> = {\n \"font-thin\": { fontWeight: \"100\" },\n \"font-extralight\": { fontWeight: \"200\" },\n \"font-light\": { fontWeight: \"300\" },\n \"font-normal\": { fontWeight: \"400\" },\n \"font-medium\": { fontWeight: \"500\" },\n \"font-semibold\": { fontWeight: \"600\" },\n \"font-bold\": { fontWeight: \"700\" },\n \"font-extrabold\": { fontWeight: \"800\" },\n \"font-black\": { fontWeight: \"900\" },\n};\n\n// Font style utilities\nconst FONT_STYLE_MAP: Record<string, StyleObject> = {\n italic: { fontStyle: \"italic\" },\n \"not-italic\": { fontStyle: \"normal\" },\n};\n\n// Text alignment utilities\nconst TEXT_ALIGN_MAP: Record<string, StyleObject> = {\n \"text-left\": { textAlign: \"left\" },\n \"text-center\": { textAlign: \"center\" },\n \"text-right\": { textAlign: \"right\" },\n \"text-justify\": { textAlign: \"justify\" },\n};\n\n// Text decoration utilities\nconst TEXT_DECORATION_MAP: Record<string, StyleObject> = {\n underline: { textDecorationLine: \"underline\" },\n \"line-through\": { textDecorationLine: \"line-through\" },\n \"no-underline\": { textDecorationLine: \"none\" },\n};\n\n// Text transform utilities\nconst TEXT_TRANSFORM_MAP: Record<string, StyleObject> = {\n uppercase: { textTransform: \"uppercase\" },\n lowercase: { textTransform: \"lowercase\" },\n capitalize: { textTransform: \"capitalize\" },\n \"normal-case\": { textTransform: \"none\" },\n};\n\n// Line height utilities\nconst LINE_HEIGHT_MAP: Record<string, StyleObject> = {\n \"leading-none\": { lineHeight: 16 },\n \"leading-tight\": { lineHeight: 20 },\n \"leading-snug\": { lineHeight: 22 },\n \"leading-normal\": { lineHeight: 24 },\n \"leading-relaxed\": { lineHeight: 28 },\n \"leading-loose\": { lineHeight: 32 },\n};\n\n// Letter spacing utilities\nconst TRACKING_MAP: Record<string, StyleObject> = {\n \"tracking-tighter\": { letterSpacing: -0.8 },\n \"tracking-tight\": { letterSpacing: -0.4 },\n \"tracking-normal\": { letterSpacing: 0 },\n \"tracking-wide\": { letterSpacing: 0.4 },\n \"tracking-wider\": { letterSpacing: 0.8 },\n \"tracking-widest\": { letterSpacing: 1.6 },\n};\n\n/**\n * Parse arbitrary font size value: [18px], [20]\n * Returns number for px values, null for unsupported formats\n */\nfunction parseArbitraryFontSize(value: string): number | null {\n // Match: [18px] or [18] (pixels only)\n const pxMatch = value.match(/^\\[(\\d+)(?:px)?\\]$/);\n if (pxMatch) {\n return parseInt(pxMatch[1], 10);\n }\n\n // Warn about unsupported formats\n if (value.startsWith(\"[\") && value.endsWith(\"]\")) {\n if (process.env.NODE_ENV !== \"production\") {\n console.warn(\n `[react-native-tailwind] Unsupported arbitrary font size value: ${value}. Only px values are supported (e.g., [18px] or [18]).`,\n );\n }\n return null;\n }\n\n return null;\n}\n\n/**\n * Parse arbitrary line height value: [24px], [28]\n * Returns number for px values, null for unsupported formats\n */\nfunction parseArbitraryLineHeight(value: string): number | null {\n // Match: [24px] or [24] (pixels only)\n const pxMatch = value.match(/^\\[(\\d+)(?:px)?\\]$/);\n if (pxMatch) {\n return parseInt(pxMatch[1], 10);\n }\n\n // Warn about unsupported formats\n if (value.startsWith(\"[\") && value.endsWith(\"]\")) {\n if (process.env.NODE_ENV !== \"production\") {\n console.warn(\n `[react-native-tailwind] Unsupported arbitrary line height value: ${value}. Only px values are supported (e.g., [24px] or [24]).`,\n );\n }\n return null;\n }\n\n return null;\n}\n\n/**\n * Parse typography classes\n */\nexport function parseTypography(cls: string): StyleObject | null {\n // Font size: text-base, text-lg, text-[18px], etc.\n if (cls.startsWith(\"text-\")) {\n const sizeKey = cls.substring(5);\n\n // Try arbitrary value first\n const arbitraryValue = parseArbitraryFontSize(sizeKey);\n if (arbitraryValue !== null) {\n return { fontSize: arbitraryValue };\n }\n\n // Try preset scale\n const fontSize = FONT_SIZES[sizeKey];\n if (fontSize !== undefined) {\n return { fontSize };\n }\n }\n\n // Line height: leading-normal, leading-[24px], etc.\n if (cls.startsWith(\"leading-\")) {\n const heightKey = cls.substring(8);\n\n // Try arbitrary value first\n const arbitraryValue = parseArbitraryLineHeight(heightKey);\n if (arbitraryValue !== null) {\n return { lineHeight: arbitraryValue };\n }\n }\n\n // Try each lookup table in order\n return (\n FONT_FAMILY_MAP[cls] ??\n FONT_WEIGHT_MAP[cls] ??\n FONT_STYLE_MAP[cls] ??\n TEXT_ALIGN_MAP[cls] ??\n TEXT_DECORATION_MAP[cls] ??\n TEXT_TRANSFORM_MAP[cls] ??\n LINE_HEIGHT_MAP[cls] ??\n TRACKING_MAP[cls] ??\n null\n );\n}\n", "/**\n * Tailwind class parser for React Native\n * Converts Tailwind-like class names to React Native style objects\n */\n\nimport type { StyleObject } from \"../types\";\nimport { parseAspectRatio } from \"./aspectRatio\";\nimport { parseBorder } from \"./borders\";\nimport { parseColor } from \"./colors\";\nimport { parseLayout } from \"./layout\";\nimport { parseShadow } from \"./shadows\";\nimport { parseSizing } from \"./sizing\";\nimport { parseSpacing } from \"./spacing\";\nimport { parseTransform } from \"./transforms\";\nimport { parseTypography } from \"./typography\";\n\n/**\n * Parse a className string and return a React Native style object\n * @param className - Space-separated class names\n * @param customColors - Optional custom colors from tailwind.config\n * @returns React Native style object\n */\nexport function parseClassName(className: string, customColors?: Record<string, string>): StyleObject {\n const classes = className.split(/\\s+/).filter(Boolean);\n const style: StyleObject = {};\n\n for (const cls of classes) {\n const parsedStyle = parseClass(cls, customColors);\n Object.assign(style, parsedStyle);\n }\n\n return style;\n}\n\n/**\n * Parse a single class name\n * @param cls - Single class name\n * @param customColors - Optional custom colors from tailwind.config\n * @returns React Native style object\n */\nexport function parseClass(cls: string, customColors?: Record<string, string>): StyleObject {\n // Try each parser in order\n // Note: parseBorder must come before parseColor to avoid border-[3px] being parsed as a color\n // parseColor gets custom colors, others don't need it\n const parsers: ((cls: string) => StyleObject | null)[] = [\n parseSpacing,\n parseBorder,\n (cls: string) => parseColor(cls, customColors),\n parseLayout,\n parseTypography,\n parseSizing,\n parseShadow,\n parseAspectRatio,\n parseTransform,\n ];\n\n for (const parser of parsers) {\n const result = parser(cls);\n if (result !== null) {\n return result;\n }\n }\n\n // Warn about unknown class in development\n if (process.env.NODE_ENV !== \"production\") {\n console.warn(`[react-native-tailwind] Unknown class: \"${cls}\"`);\n }\n\n return {};\n}\n\n// Re-export parsers for testing/advanced usage\nexport { parseAspectRatio } from \"./aspectRatio\";\nexport { parseBorder } from \"./borders\";\nexport { parseColor } from \"./colors\";\nexport { parseLayout } from \"./layout\";\nexport { parseShadow } from \"./shadows\";\nexport { parseSizing } from \"./sizing\";\nexport { parseSpacing } from \"./spacing\";\nexport { parseTransform } from \"./transforms\";\nexport { parseTypography } from \"./typography\";\n\n// Re-export modifier utilities\nexport { hasModifier, parseModifier, splitModifierClasses } from \"./modifiers\";\nexport type { ModifierType, ParsedModifier } from \"./modifiers\";\n", "/**\n * Shared utilities for parsing state modifiers (active:, focus:, disabled:)\n * Used by both runtime parser and Babel plugin\n */\n\n// Supported state modifiers for Pressable/TextInput components\nexport const SUPPORTED_MODIFIERS = [\"active\", \"focus\", \"disabled\"] as const;\nexport type SupportedModifier = (typeof SUPPORTED_MODIFIERS)[number];\n\n/**\n * Detect if a className contains any state modifiers (active:, focus:, disabled:)\n */\nexport function hasModifiers(className: string): boolean {\n return SUPPORTED_MODIFIERS.some((modifier) => className.includes(`${modifier}:`));\n}\n\n/**\n * Split className into base classes and modifier-specific classes\n * Returns: { base: string[], modifiers: Map<modifier, string[]> }\n *\n * @example\n * splitModifierClasses('bg-blue-500 active:bg-blue-700 disabled:bg-gray-300')\n * // Returns:\n * // {\n * // base: ['bg-blue-500'],\n * // modifiers: Map {\n * // 'active' => ['bg-blue-700'],\n * // 'disabled' => ['bg-gray-300']\n * // }\n * // }\n */\nexport function splitModifierClasses(className: string): {\n base: string[];\n modifiers: Map<SupportedModifier, string[]>;\n} {\n const classes = className.split(/\\s+/).filter(Boolean);\n const base: string[] = [];\n const modifiers = new Map<SupportedModifier, string[]>();\n\n for (const cls of classes) {\n let matched = false;\n for (const modifier of SUPPORTED_MODIFIERS) {\n const prefix = `${modifier}:`;\n if (cls.startsWith(prefix)) {\n const cleanClass = cls.slice(prefix.length);\n if (!modifiers.has(modifier)) {\n modifiers.set(modifier, []);\n }\n const modifierClasses = modifiers.get(modifier);\n if (modifierClasses) {\n modifierClasses.push(cleanClass);\n }\n matched = true;\n break;\n }\n }\n if (!matched) {\n base.push(cls);\n }\n }\n\n return { base, modifiers };\n}\n", "import type { ImageStyle, TextStyle, ViewStyle } from \"react-native\";\nimport { parseClassName } from \"./parser/index.js\";\nimport { flattenColors } from \"./utils/flattenColors.js\";\nimport { hasModifiers, splitModifierClasses } from \"./utils/modifiers.js\";\n\n/**\n * Union type for all React Native style types\n */\nexport type NativeStyle = ViewStyle | TextStyle | ImageStyle;\n\n/**\n * Return type for tw/twStyle functions with separate style properties for modifiers\n */\nexport type TwStyle<T extends NativeStyle = NativeStyle> = {\n style: T;\n activeStyle?: T;\n focusStyle?: T;\n disabledStyle?: T;\n};\n\n/**\n * Runtime configuration type matching Tailwind config structure\n */\nexport type RuntimeConfig = {\n theme?: {\n extend?: {\n colors?: Record<string, string | Record<string, string>>;\n // Future extensions can be added here:\n // spacing?: Record<string, number | string>;\n // fontFamily?: Record<string, string[]>;\n };\n };\n};\n\n// Global custom colors configuration\nlet globalCustomColors: Record<string, string> | undefined;\n\n// Simple memoization cache\nconst styleCache = new Map<string, TwStyle>();\n\n/**\n * Configure runtime Tailwind settings\n * Matches the structure of tailwind.config.mjs for consistency\n *\n * @param config - Runtime configuration object\n *\n * @example\n * ```typescript\n * import { setConfig } from '@mgcrea/react-native-tailwind/runtime';\n *\n * setConfig({\n * theme: {\n * extend: {\n * colors: {\n * primary: '#007AFF',\n * secondary: '#5856D6',\n * brand: {\n * light: '#FF6B6B',\n * dark: '#CC0000'\n * }\n * }\n * }\n * }\n * });\n * ```\n */\nexport function setConfig(config: RuntimeConfig): void {\n // Extract and flatten custom colors\n if (config.theme?.extend?.colors) {\n globalCustomColors = flattenColors(config.theme.extend.colors);\n } else {\n globalCustomColors = undefined;\n }\n\n // Clear cache when config changes\n styleCache.clear();\n}\n\n/**\n * Get currently configured custom colors\n */\nexport function getCustomColors(): Record<string, string> | undefined {\n return globalCustomColors;\n}\n\n/**\n * Clear the memoization cache\n * Useful for testing or when you want to force re-parsing\n */\nexport function clearCache(): void {\n styleCache.clear();\n}\n\n/**\n * Get cache statistics (for debugging/monitoring)\n */\nexport function getCacheStats(): { size: number; keys: string[] } {\n return {\n size: styleCache.size,\n keys: Array.from(styleCache.keys()),\n };\n}\n\n/**\n * Parse className string and return a TwStyle object with separate modifier properties\n * Internal helper that handles caching and StyleSheet.create wrapping\n */\nfunction parseAndCache(className: string): TwStyle {\n // Check cache first\n const cached = styleCache.get(className);\n if (cached) {\n return cached;\n }\n\n // Check if className contains modifiers\n if (!hasModifiers(className)) {\n // No modifiers - simple case\n const styleObject = parseClassName(className, globalCustomColors);\n\n const result: TwStyle = {\n // @ts-expect-error - StyleObject transform types are broader than React Native's strict types\n style: styleObject,\n };\n\n // Cache the result\n styleCache.set(className, result);\n\n return result;\n }\n\n // Has modifiers - split and parse separately\n const { base, modifiers } = splitModifierClasses(className);\n\n // Parse base styles\n const baseClassName = base.join(\" \");\n const baseStyle = baseClassName ? parseClassName(baseClassName, globalCustomColors) : {};\n\n // Build result object\n const result: TwStyle = {\n // @ts-expect-error - StyleObject transform types are broader than React Native's strict types\n style: baseStyle,\n };\n\n // Parse and add modifier styles\n if (modifiers.has(\"active\")) {\n const activeClasses = modifiers.get(\"active\");\n if (activeClasses && activeClasses.length > 0) {\n const activeClassName = activeClasses.join(\" \");\n // @ts-expect-error - StyleObject transform types are broader than React Native's strict types\n result.activeStyle = parseClassName(activeClassName, globalCustomColors);\n }\n }\n\n if (modifiers.has(\"focus\")) {\n const focusClasses = modifiers.get(\"focus\");\n if (focusClasses && focusClasses.length > 0) {\n const focusClassName = focusClasses.join(\" \");\n // @ts-expect-error - StyleObject transform types are broader than React Native's strict types\n result.focusStyle = parseClassName(focusClassName, globalCustomColors);\n }\n }\n\n if (modifiers.has(\"disabled\")) {\n const disabledClasses = modifiers.get(\"disabled\");\n if (disabledClasses && disabledClasses.length > 0) {\n const disabledClassName = disabledClasses.join(\" \");\n // @ts-expect-error - StyleObject transform types are broader than React Native's strict types\n result.disabledStyle = parseClassName(disabledClassName, globalCustomColors);\n }\n }\n\n // Cache the result\n styleCache.set(className, result);\n\n return result;\n}\n\n/**\n * Runtime Tailwind CSS template tag for React Native\n *\n * Parses Tailwind class names at runtime and returns a TwStyle object with separate\n * properties for base styles and modifier styles (active, focus, disabled).\n * Results are memoized for performance.\n *\n * @param strings - Template string parts\n * @param values - Interpolated values\n * @returns TwStyle object with style, activeStyle, focusStyle, and disabledStyle properties\n *\n * @example\n * ```tsx\n * import { tw } from '@mgcrea/react-native-tailwind/runtime';\n *\n * // Simple usage - access .style property\n * <View style={tw`m-4 p-2 bg-blue-500`.style} />\n *\n * // With interpolations\n * <View style={tw`flex-1 ${isActive && 'bg-blue-500'} p-4`.style} />\n *\n * // With state modifiers - access activeStyle/focusStyle for animations\n * const styles = tw`bg-blue-500 active:bg-blue-700 focus:bg-blue-800`;\n * <Pressable style={(state) => [\n * styles.style,\n * state.pressed && styles.activeStyle,\n * state.focused && styles.focusStyle\n * ]}>\n * <Text>Press me</Text>\n * </Pressable>\n *\n * // Use with reanimated for animations with raw values\n * const styles = tw`bg-blue-500 active:bg-blue-700`;\n * const animatedStyles = useAnimatedStyle(() => ({\n * ...styles.style,\n * backgroundColor: interpolateColor(\n * progress.value,\n * [0, 1],\n * [styles.style.backgroundColor, styles.activeStyle?.backgroundColor]\n * )\n * }));\n * ```\n */\nexport function tw<T extends NativeStyle = NativeStyle>(\n strings: TemplateStringsArray,\n ...values: unknown[]\n): TwStyle<T> {\n // Combine template strings and values into a single className string\n const className = strings.reduce((acc, str, i) => {\n const value = values[i];\n // Handle falsy values (false, null, undefined) - don't add them\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\n const valueStr = value ? String(value) : \"\";\n return acc + str + valueStr;\n }, \"\");\n\n // Trim and normalize whitespace\n const normalizedClassName = className.trim().replace(/\\s+/g, \" \");\n\n // Handle empty className\n if (!normalizedClassName) {\n return { style: {} as T };\n }\n\n return parseAndCache(normalizedClassName) as TwStyle<T>;\n}\n\n/**\n * String version of tw for cases where template literals aren't needed\n *\n * Parses Tailwind class names at runtime and returns a TwStyle object with separate\n * properties for base styles and modifier styles (active, focus, disabled).\n *\n * @param className - Space-separated Tailwind class names\n * @returns TwStyle object with style, activeStyle, focusStyle, and disabledStyle properties\n *\n * @example\n * ```tsx\n * import { twStyle } from '@mgcrea/react-native-tailwind/runtime';\n *\n * // Simple usage - access .style property\n * <View style={twStyle('m-4 p-2 bg-blue-500').style} />\n *\n * // With state modifiers\n * const styles = twStyle('bg-blue-500 active:bg-blue-700 focus:bg-blue-800');\n * <Pressable style={(state) => [\n * styles.style,\n * state.pressed && styles.activeStyle,\n * state.focused && styles.focusStyle\n * ]}>\n * <Text>Press me</Text>\n * </Pressable>\n * ```\n */\nexport function twStyle<T extends NativeStyle = NativeStyle>(className: string): TwStyle<T> | undefined {\n const normalizedClassName = className.trim().replace(/\\s+/g, \" \");\n\n if (!normalizedClassName) {\n return undefined;\n }\n\n return parseAndCache(normalizedClassName) as TwStyle<T>;\n}\n"],
|
|
5
|
+
"mappings": "ubAUA,IAAMA,EAA2D,CAC/D,cAAe,OACf,gBAAiB,EACjB,eAAgB,kBAClB,EAOA,SAASC,GAA0BC,EAA8B,CAC/D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AAM,UACN,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,SACT,EACA,KAAM,CACJ,GAAM,UACN,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,SACT,EACA,KAAM,CACJ,GAAM,UACN,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,SACT,EACA,IAAK,CACH,GAAM,UACN,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,SACT,EACA,KAAM,CACJ,GAAM,UACN,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,SACT,EACA,OAAQ,CACN,GAAM,UACN,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,SACT,EACA,OAAQ,CACN,GAAM,UACN,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,SACT,EACA,OAAQ,CACN,GAAM,UACN,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,SACT,EACA,QAAS,CACP,GAAM,UACN,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,SACT,EACA,KAAM,CACJ,GAAM,UACN,I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AU,IAAI,OAAO,EAAG,CAC1B,IAAMK,EAAeL,EAAU,IAAI,OAAO,EAC1C,GAAIK,GAAgBA,EAAa,OAAS,EAAG,CAC3C,IAAMC,EAAiBD,EAAa,KAAK,GAAG,EAE5CR,EAAO,WAAaC,EAAeQ,EAAgBvB,CAAkB,CACvE,CACF,CAEA,GAAIiB,EAAU,IAAI,UAAU,EAAG,CAC7B,IAAMO,EAAkBP,EAAU,IAAI,UAAU,EAChD,GAAIO,GAAmBA,EAAgB,OAAS,EAAG,CACjD,IAAMC,EAAoBD,EAAgB,KAAK,GAAG,EAElDV,EAAO,cAAgBC,EAAeU,EAAmBzB,CAAkB,CAC7E,CACF,CAGA,OAAAC,EAAW,IAAIU,EAAWG,CAAM,EAEzBA,CACT,CA6CO,SAASY,GACdC,KACGC,EACS,CAWZ,IAAMC,EATYF,EAAQ,OAAO,CAACG,EAAKC,EAAKC,IAAM,CAChD,IAAMC,EAAQL,EAAOI,CAAC,EAGhBE,EAAWD,EAAQ,OAAOA,CAAK,EAAI,GACzC,OAAOH,EAAMC,EAAMG,CACrB,EAAG,EAAE,EAGiC,KAAK,EAAE,QAAQ,OAAQ,GAAG,EAGhE,OAAKL,EAIEnB,GAAcmB,CAAmB,EAH/B,CAAE,MAAO,CAAC,CAAO,CAI5B,CA6BO,SAASM,GAA6CxB,EAA2C,CACtG,IAAMkB,EAAsBlB,EAAU,KAAK,EAAE,QAAQ,OAAQ,GAAG,EAEhE,GAAKkB,EAIL,OAAOnB,GAAcmB,CAAmB,CAC1C",
|
|
6
|
+
"names": ["ASPECT_RATIO_PRESETS", "parseArbitraryAspectRatio", "value", "match", "numerator", "denominator", "parseAspectRatio", "cls", "aspectRatio", "arbitraryValue", "BORDER_WIDTH_SCALE", "BORDER_RADIUS_SCALE", "BORDER_WIDTH_PROP_MAP", "BORDER_RADIUS_CORNER_MAP", "BORDER_RADIUS_SIDE_MAP", "parseArbitraryBorderWidth", "value", "pxMatch", "parseArbitraryBorderRadius", "parseBorder", "cls", "parseBorderWidth", "parseBorderRadius", "dirMatch", "dir", "valueStr", "arbitraryValue", "scaleValue", "allMatch", "allArbMatch", "withoutPrefix", "rest", "cornerMatch", "corner", "sideMatch", "side", "result", "prop", "TAILWIND_PALETTES", "flattenColors", "colors", "prefix", "result", "key", "value", "newKey", "COLORS", "__spreadProps", "__spreadValues", "flattenColors", "TAILWIND_PALETTES", "applyOpacity", "hex", "opacity", "cleanHex", "fullHex", "char", "alphaHex", "parseArbitraryColor", "value", "hexMatch", "parseColor", "cls", "customColors", "getColor", "key", "_a", "parseColorWithOpacity", "colorKey", "opacityMatch", "baseColorKey", "arbitraryColor", "color", "parseArbitraryInset", "value", "pxMatch", "percentMatch", "parseArbitraryZIndex", "zMatch", "DISPLAY_MAP", "FLEX_DIRECTION_MAP", "FLEX_WRAP_MAP", "FLEX_MAP", "GROW_SHRINK_MAP", "JUSTIFY_CONTENT_MAP", "ALIGN_ITEMS_MAP", "ALIGN_SELF_MAP", "ALIGN_CONTENT_MAP", "POSITION_MAP", "OVERFLOW_MAP", "OPACITY_MAP", "Z_INDEX_SCALE", "INSET_SCALE", "parseLayout", "cls", "_a", "_b", "_c", "_d", "_e", "_f", "_g", "_h", "_i", "_j", "_k", "_l", "zKey", "arbitraryZ", "zValue", "topKey", "arbitraryTop", "topValue", "rightKey", "arbitraryRight", "rightValue", "bottomKey", "arbitraryBottom", "bottomValue", "leftKey", "arbitraryLeft", "leftValue", "insetKey", "arbitraryInset", "insetValue", "SHADOW_SCALE", "parseShadow", "cls", "SIZE_SCALE", "SIZE_PERCENTAGES", "parseArbitrarySize", "value", "pxMatch", "percentMatch", "parseSizing", "cls", "sizeKey", "arbitrarySize", "percentage", "numericSize", "SPACING_SCALE", "parseArbitrarySpacing", "value", "pxMatch", "parseSpacing", "cls", "marginMatch", "dir", "valueStr", "arbitraryValue", "getMarginStyle", "scaleValue", "paddingMatch", "getPaddingStyle", "gapMatch", "SCALE_MAP", "ROTATE_MAP", "SKEW_MAP", "PERSPECTIVE_SCALE", "parseArbitraryScale", "value", "scaleMatch", "parseArbitraryRotation", "rotateMatch", "parseArbitraryTranslation", "pxMatch", "percentMatch", "parseArbitraryPerspective", "perspectiveMatch", "parseTransform", "cls", "scaleKey", "arbitraryScale", "scaleValue", "isNegative", "rotateKey", "arbitraryRotate", "rotateValue", "translateKey", "arbitraryTranslate", "translateValue", "SPACING_SCALE", "skewKey", "arbitrarySkew", "skewValue", "perspectiveKey", "arbitraryPerspective", "perspectiveValue", "FONT_SIZES", "FONT_FAMILY_MAP", "FONT_WEIGHT_MAP", "FONT_STYLE_MAP", "TEXT_ALIGN_MAP", "TEXT_DECORATION_MAP", "TEXT_TRANSFORM_MAP", "LINE_HEIGHT_MAP", "TRACKING_MAP", "parseArbitraryFontSize", "value", "pxMatch", "parseArbitraryLineHeight", "parseTypography", "cls", "_a", "_b", "_c", "_d", "_e", "_f", "_g", "_h", "sizeKey", "arbitraryValue", "fontSize", "FONT_SIZES", "heightKey", "parseClassName", "className", "customColors", "classes", "style", "cls", "parsedStyle", "parseClass", "parsers", "parseSpacing", "parseBorder", "parseColor", "parseLayout", "parseTypography", "parseSizing", "parseShadow", "parseAspectRatio", "parseTransform", "parser", "result", "SUPPORTED_MODIFIERS", "hasModifiers", "className", "modifier", "splitModifierClasses", "classes", "base", "modifiers", "cls", "matched", "prefix", "cleanClass", "modifierClasses", "globalCustomColors", "styleCache", "setConfig", "config", "_a", "_b", "flattenColors", "getCustomColors", "clearCache", "getCacheStats", "parseAndCache", "className", "cached", "hasModifiers", "result", "parseClassName", "base", "modifiers", "splitModifierClasses", "baseClassName", "activeClasses", "activeClassName", "focusClasses", "focusClassName", "disabledClasses", "disabledClassName", "tw", "strings", "values", "normalizedClassName", "acc", "str", "i", "value", "valueStr", "twStyle"]
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var _vitest=require("vitest");var _runtime=require("./runtime");(0,_vitest.describe)("runtime",function(){(0,_vitest.beforeEach)(function(){(0,_runtime.clearCache)();(0,_runtime.setConfig)({});});(0,_vitest.describe)("tw template tag",function(){(0,_vitest.it)("should parse static classes",function(){var result=(0,_runtime.tw)`m-4 p-2 bg-blue-500`;(0,_vitest.expect)(result==null?void 0:result.style).toEqual({margin:16,padding:8,backgroundColor:"#2b7fff"});(0,_vitest.expect)(result==null?void 0:result.activeStyle).toBeUndefined();(0,_vitest.expect)(result==null?void 0:result.disabledStyle).toBeUndefined();});(0,_vitest.it)("should handle interpolated values",function(){var isActive=true;var result=(0,_runtime.tw)`m-4 ${isActive&&"bg-blue-500"}`;(0,_vitest.expect)(result==null?void 0:result.style).toEqual({margin:16,backgroundColor:"#2b7fff"});});(0,_vitest.it)("should handle conditional classes",function(){var isLarge=true;var result=(0,_runtime.tw)`p-4 ${isLarge?"text-xl":"text-sm"}`;(0,_vitest.expect)(result==null?void 0:result.style).toEqual({padding:16,fontSize:20});});(0,_vitest.it)("should handle falsy values",function(){var result=(0,_runtime.tw)`m-4 ${false} ${null} ${undefined} p-2`;(0,_vitest.expect)(result==null?void 0:result.style).toEqual({margin:16,padding:8});});(0,_vitest.it)("should return empty style object for empty className",function(){var result=(0,_runtime.tw)``;(0,_vitest.expect)(result).toEqual({style:{}});});(0,_vitest.it)("should normalize whitespace",function(){var result=(0,_runtime.tw)`m-4 p-2 bg-blue-500`;(0,_vitest.expect)(result==null?void 0:result.style).toEqual({margin:16,padding:8,backgroundColor:"#2b7fff"});});});(0,_vitest.describe)("twStyle function",function(){(0,_vitest.it)("should parse className string",function(){var result=(0,_runtime.twStyle)("m-4 p-2 bg-blue-500");(0,_vitest.expect)(result==null?void 0:result.style).toEqual({margin:16,padding:8,backgroundColor:"#2b7fff"});(0,_vitest.expect)(result==null?void 0:result.activeStyle).toBeUndefined();});(0,_vitest.it)("should return undefined for empty string",function(){var result=(0,_runtime.twStyle)("");(0,_vitest.expect)(result).toBeUndefined();});(0,_vitest.it)("should normalize whitespace",function(){var result=(0,_runtime.twStyle)("m-4 p-2 bg-blue-500");(0,_vitest.expect)(result==null?void 0:result.style).toEqual({margin:16,padding:8,backgroundColor:"#2b7fff"});});});(0,_vitest.describe)("setConfig",function(){(0,_vitest.it)("should set custom colors",function(){(0,_runtime.setConfig)({theme:{extend:{colors:{primary:"#007AFF",secondary:"#5856D6"}}}});var colors=(0,_runtime.getCustomColors)();(0,_vitest.expect)(colors).toEqual({primary:"#007AFF",secondary:"#5856D6"});});(0,_vitest.it)("should flatten nested colors",function(){(0,_runtime.setConfig)({theme:{extend:{colors:{brand:{light:"#FF6B6B",dark:"#CC0000"}}}}});var colors=(0,_runtime.getCustomColors)();(0,_vitest.expect)(colors).toEqual({"brand-light":"#FF6B6B","brand-dark":"#CC0000"});});(0,_vitest.it)("should handle mixed flat and nested colors",function(){(0,_runtime.setConfig)({theme:{extend:{colors:{primary:"#007AFF",brand:{light:"#FF6B6B",dark:"#CC0000"}}}}});var colors=(0,_runtime.getCustomColors)();(0,_vitest.expect)(colors).toEqual({primary:"#007AFF","brand-light":"#FF6B6B","brand-dark":"#CC0000"});});(0,_vitest.it)("should clear cache when config changes",function(){var style=(0,_runtime.tw)`bg-blue-500`;(0,_vitest.expect)(style).toBeDefined();(0,_vitest.expect)((0,_runtime.getCacheStats)().size).toBe(1);(0,_runtime.setConfig)({theme:{extend:{colors:{primary:"#007AFF"}}}});(0,_vitest.expect)((0,_runtime.getCacheStats)().size).toBe(0);});(0,_vitest.it)("should use custom colors in parsing",function(){(0,_runtime.setConfig)({theme:{extend:{colors:{primary:"#007AFF"}}}});var result=(0,_runtime.tw)`bg-primary`;(0,_vitest.expect)(result==null?void 0:result.style).toEqual({backgroundColor:"#007AFF"});});});(0,_vitest.describe)("cache",function(){(0,_vitest.it)("should cache parsed styles",function(){var result1=(0,_runtime.tw)`m-4 p-2`;var result2=(0,_runtime.tw)`m-4 p-2`;(0,_vitest.expect)(result1).toBe(result2);});(0,_vitest.it)("should track cache stats",function(){var style1=(0,_runtime.tw)`m-4`;var style2=(0,_runtime.tw)`p-2`;var style3=(0,_runtime.tw)`bg-blue-500`;(0,_vitest.expect)(style1).toBeDefined();(0,_vitest.expect)(style2).toBeDefined();(0,_vitest.expect)(style3).toBeDefined();var stats=(0,_runtime.getCacheStats)();(0,_vitest.expect)(stats.size).toBe(3);(0,_vitest.expect)(stats.keys).toContain("m-4");(0,_vitest.expect)(stats.keys).toContain("p-2");(0,_vitest.expect)(stats.keys).toContain("bg-blue-500");});(0,_vitest.it)("should clear cache",function(){var style1=(0,_runtime.tw)`m-4`;var style2=(0,_runtime.tw)`p-2`;(0,_vitest.expect)(style1).toBeDefined();(0,_vitest.expect)(style2).toBeDefined();(0,_vitest.expect)((0,_runtime.getCacheStats)().size).toBe(2);(0,_runtime.clearCache)();(0,_vitest.expect)((0,_runtime.getCacheStats)().size).toBe(0);});});(0,_vitest.describe)("state modifiers",function(){(0,_vitest.it)("should return activeStyle when active: modifier is used",function(){var result=(0,_runtime.tw)`bg-blue-500 active:bg-blue-700`;(0,_vitest.expect)(result==null?void 0:result.style).toEqual({backgroundColor:"#2b7fff"});(0,_vitest.expect)(result==null?void 0:result.activeStyle).toEqual({backgroundColor:"#1447e6"});(0,_vitest.expect)(result==null?void 0:result.disabledStyle).toBeUndefined();});(0,_vitest.it)("should return disabledStyle when disabled: modifier is used",function(){var result=(0,_runtime.tw)`bg-blue-500 disabled:bg-gray-300`;(0,_vitest.expect)(result==null?void 0:result.style).toEqual({backgroundColor:"#2b7fff"});(0,_vitest.expect)(result==null?void 0:result.disabledStyle).toEqual({backgroundColor:"#d1d5dc"});(0,_vitest.expect)(result==null?void 0:result.activeStyle).toBeUndefined();});(0,_vitest.it)("should return both activeStyle and disabledStyle when both modifiers are used",function(){var result=(0,_runtime.tw)`bg-blue-500 active:bg-blue-700 disabled:bg-gray-300`;(0,_vitest.expect)(result==null?void 0:result.style).toEqual({backgroundColor:"#2b7fff"});(0,_vitest.expect)(result==null?void 0:result.activeStyle).toEqual({backgroundColor:"#1447e6"});(0,_vitest.expect)(result==null?void 0:result.disabledStyle).toEqual({backgroundColor:"#d1d5dc"});});(0,_vitest.it)("should merge base and active styles with multiple properties",function(){var result=(0,_runtime.tw)`p-4 m-2 bg-blue-500 active:bg-blue-700 active:p-6`;(0,_vitest.expect)(result==null?void 0:result.style).toEqual({padding:16,margin:8,backgroundColor:"#2b7fff"});(0,_vitest.expect)(result==null?void 0:result.activeStyle).toEqual({backgroundColor:"#1447e6",padding:24});});(0,_vitest.it)("should handle only modifier classes (no base)",function(){var result=(0,_runtime.tw)`active:bg-blue-700`;(0,_vitest.expect)(result==null?void 0:result.style).toEqual({});(0,_vitest.expect)(result==null?void 0:result.activeStyle).toEqual({backgroundColor:"#1447e6"});});(0,_vitest.it)("should work with twStyle function",function(){var result=(0,_runtime.twStyle)("bg-blue-500 active:bg-blue-700");(0,_vitest.expect)(result==null?void 0:result.style).toEqual({backgroundColor:"#2b7fff"});(0,_vitest.expect)(result==null?void 0:result.activeStyle).toEqual({backgroundColor:"#1447e6"});});(0,_vitest.it)("should provide raw hex values for animations",function(){var _result$activeStyle;var result=(0,_runtime.tw)`bg-blue-500 active:bg-blue-700`;(0,_vitest.expect)(result==null?void 0:result.style.backgroundColor).toBe("#2b7fff");(0,_vitest.expect)(result==null||(_result$activeStyle=result.activeStyle)==null?void 0:_result$activeStyle.backgroundColor).toBe("#1447e6");});(0,_vitest.it)("should return focusStyle when focus: modifier is used",function(){var result=(0,_runtime.tw)`bg-blue-500 focus:bg-blue-800`;(0,_vitest.expect)(result==null?void 0:result.style).toEqual({backgroundColor:"#2b7fff"});(0,_vitest.expect)(result==null?void 0:result.focusStyle).toEqual({backgroundColor:"#193cb8"});(0,_vitest.expect)(result==null?void 0:result.activeStyle).toBeUndefined();(0,_vitest.expect)(result==null?void 0:result.disabledStyle).toBeUndefined();});(0,_vitest.it)("should return all three modifier styles when all are used",function(){var result=(0,_runtime.tw)`bg-blue-500 active:bg-blue-700 focus:bg-blue-800 disabled:bg-gray-300`;(0,_vitest.expect)(result==null?void 0:result.style).toEqual({backgroundColor:"#2b7fff"});(0,_vitest.expect)(result==null?void 0:result.activeStyle).toEqual({backgroundColor:"#1447e6"});(0,_vitest.expect)(result==null?void 0:result.focusStyle).toEqual({backgroundColor:"#193cb8"});(0,_vitest.expect)(result==null?void 0:result.disabledStyle).toEqual({backgroundColor:"#d1d5dc"});});});});
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compile-time stub for tw/twStyle functions
|
|
3
|
+
*
|
|
4
|
+
* These functions are transformed by the Babel plugin at compile-time.
|
|
5
|
+
* If you see these errors at runtime, it means the Babel plugin is not configured correctly.
|
|
6
|
+
*
|
|
7
|
+
* For runtime parsing, use: import { tw } from '@mgcrea/react-native-tailwind/runtime'
|
|
8
|
+
*/
|
|
9
|
+
import type { ImageStyle, TextStyle, ViewStyle } from "react-native";
|
|
10
|
+
/**
|
|
11
|
+
* Union type for all React Native style types
|
|
12
|
+
*/
|
|
13
|
+
export type NativeStyle = ViewStyle | TextStyle | ImageStyle;
|
|
14
|
+
/**
|
|
15
|
+
* Return type for tw/twStyle functions with separate style properties for modifiers
|
|
16
|
+
*/
|
|
17
|
+
export type TwStyle<T extends NativeStyle = NativeStyle> = {
|
|
18
|
+
style: T;
|
|
19
|
+
activeStyle?: T;
|
|
20
|
+
focusStyle?: T;
|
|
21
|
+
disabledStyle?: T;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Compile-time Tailwind CSS template tag (transformed by Babel plugin)
|
|
25
|
+
*
|
|
26
|
+
* This function is replaced at compile-time by the Babel plugin.
|
|
27
|
+
* The import is removed and calls are transformed to inline style objects.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```tsx
|
|
31
|
+
* import { tw } from '@mgcrea/react-native-tailwind';
|
|
32
|
+
*
|
|
33
|
+
* const styles = tw`bg-blue-500 active:bg-blue-700`;
|
|
34
|
+
* // Transformed to:
|
|
35
|
+
* // const styles = {
|
|
36
|
+
* // style: styles._bg_blue_500,
|
|
37
|
+
* // activeStyle: styles._active_bg_blue_700
|
|
38
|
+
* // };
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export declare function tw<T extends NativeStyle = NativeStyle>(_strings: TemplateStringsArray, ..._values: unknown[]): TwStyle<T>;
|
|
42
|
+
/**
|
|
43
|
+
* Compile-time Tailwind CSS string function (transformed by Babel plugin)
|
|
44
|
+
*
|
|
45
|
+
* This function is replaced at compile-time by the Babel plugin.
|
|
46
|
+
* The import is removed and calls are transformed to inline style objects.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```tsx
|
|
50
|
+
* import { twStyle } from '@mgcrea/react-native-tailwind';
|
|
51
|
+
*
|
|
52
|
+
* const styles = twStyle('bg-blue-500 active:bg-blue-700');
|
|
53
|
+
* // Transformed to:
|
|
54
|
+
* // const styles = {
|
|
55
|
+
* // style: styles._bg_blue_500,
|
|
56
|
+
* // activeStyle: styles._active_bg_blue_700
|
|
57
|
+
* // };
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
export declare function twStyle<T extends NativeStyle = NativeStyle>(_className: string): TwStyle<T> | undefined;
|
package/dist/stubs/tw.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:true});exports.tw=tw;exports.twStyle=twStyle;function tw(_strings){throw new Error("tw() must be transformed by the Babel plugin. "+"Ensure @mgcrea/react-native-tailwind/babel is configured in your babel.config.js. "+"For runtime parsing, use: import { tw } from '@mgcrea/react-native-tailwind/runtime'");}function twStyle(_className){throw new Error("twStyle() must be transformed by the Babel plugin. "+"Ensure @mgcrea/react-native-tailwind/babel is configured in your babel.config.js. "+"For runtime parsing, use: import { twStyle } from '@mgcrea/react-native-tailwind/runtime'");}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type representing a nested color structure that can be arbitrarily deep
|
|
3
|
+
*/
|
|
4
|
+
type NestedColors = {
|
|
5
|
+
[key: string]: string | NestedColors;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Flatten nested color objects into flat key-value map
|
|
9
|
+
* Example: { brand: { light: '#fff', dark: '#000' } } => { 'brand-light': '#fff', 'brand-dark': '#000' }
|
|
10
|
+
*
|
|
11
|
+
* @param colors - Nested color object where values can be strings or objects
|
|
12
|
+
* @param prefix - Optional prefix for nested keys (used for recursion)
|
|
13
|
+
* @returns Flattened color map with dash-separated keys
|
|
14
|
+
*/
|
|
15
|
+
export declare function flattenColors(colors: NestedColors, prefix?: string): Record<string, string>;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.flattenColors=flattenColors;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));function flattenColors(colors){var prefix=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"";var result={};for(var _ref of Object.entries(colors)){var _ref2=(0,_slicedToArray2.default)(_ref,2);var _key=_ref2[0];var value=_ref2[1];var newKey=prefix?`${prefix}-${_key}`:_key;if(typeof value==="string"){result[newKey]=value;}else if(typeof value==="object"&&value!==null){Object.assign(result,flattenColors(value,newKey));}}return result;}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var _vitest=require("vitest");var _flattenColors=require("./flattenColors");(0,_vitest.describe)("flattenColors",function(){(0,_vitest.it)("should handle flat color objects",function(){var colors={red:"#ff0000",blue:"#0000ff",green:"#00ff00"};(0,_vitest.expect)((0,_flattenColors.flattenColors)(colors)).toEqual({red:"#ff0000",blue:"#0000ff",green:"#00ff00"});});(0,_vitest.it)("should flatten single-level nested objects",function(){var colors={brand:{primary:"#ff6b6b",secondary:"#4ecdc4"}};(0,_vitest.expect)((0,_flattenColors.flattenColors)(colors)).toEqual({"brand-primary":"#ff6b6b","brand-secondary":"#4ecdc4"});});(0,_vitest.it)("should flatten multi-level nested objects",function(){var colors={brand:{light:{primary:"#ffcccc",secondary:"#ccffff"},dark:{primary:"#990000",secondary:"#006666"}}};(0,_vitest.expect)((0,_flattenColors.flattenColors)(colors)).toEqual({"brand-light-primary":"#ffcccc","brand-light-secondary":"#ccffff","brand-dark-primary":"#990000","brand-dark-secondary":"#006666"});});(0,_vitest.it)("should handle mixed flat and nested objects",function(){var colors={white:"#ffffff",black:"#000000",brand:{primary:"#ff6b6b",secondary:"#4ecdc4"},accent:"#ffe66d"};(0,_vitest.expect)((0,_flattenColors.flattenColors)(colors)).toEqual({white:"#ffffff",black:"#000000","brand-primary":"#ff6b6b","brand-secondary":"#4ecdc4",accent:"#ffe66d"});});(0,_vitest.it)("should handle Tailwind-style color scale objects",function(){var colors={gray:{"50":"#f9fafb","100":"#f3f4f6","200":"#e5e7eb","500":"#6b7280","900":"#111827"}};(0,_vitest.expect)((0,_flattenColors.flattenColors)(colors)).toEqual({"gray-50":"#f9fafb","gray-100":"#f3f4f6","gray-200":"#e5e7eb","gray-500":"#6b7280","gray-900":"#111827"});});(0,_vitest.it)("should handle empty object",function(){(0,_vitest.expect)((0,_flattenColors.flattenColors)({})).toEqual({});});(0,_vitest.it)("should handle single color",function(){var colors={primary:"#ff0000"};(0,_vitest.expect)((0,_flattenColors.flattenColors)(colors)).toEqual({primary:"#ff0000"});});(0,_vitest.it)("should handle deeply nested objects (3+ levels)",function(){var colors={theme:{light:{brand:{primary:"#ff6b6b",secondary:"#4ecdc4"}},dark:{brand:{primary:"#990000",secondary:"#006666"}}}};(0,_vitest.expect)((0,_flattenColors.flattenColors)(colors)).toEqual({"theme-light-brand-primary":"#ff6b6b","theme-light-brand-secondary":"#4ecdc4","theme-dark-brand-primary":"#990000","theme-dark-brand-secondary":"#006666"});});(0,_vitest.it)("should handle numeric keys",function(){var colors={blue:{"100":"#dbeafe","500":"#3b82f6","900":"#1e3a8a"}};(0,_vitest.expect)((0,_flattenColors.flattenColors)(colors)).toEqual({"blue-100":"#dbeafe","blue-500":"#3b82f6","blue-900":"#1e3a8a"});});(0,_vitest.it)("should handle keys with hyphens",function(){var colors={"brand-primary":"#ff0000","brand-secondary":{light:"#00ff00",dark:"#006600"}};(0,_vitest.expect)((0,_flattenColors.flattenColors)(colors)).toEqual({"brand-primary":"#ff0000","brand-secondary-light":"#00ff00","brand-secondary-dark":"#006600"});});(0,_vitest.it)("should handle uppercase and lowercase hex values",function(){var colors={red:"#FF0000",blue:"#0000ff",green:"#00Ff00"};(0,_vitest.expect)((0,_flattenColors.flattenColors)(colors)).toEqual({red:"#FF0000",blue:"#0000ff",green:"#00Ff00"});});(0,_vitest.it)("should handle 3-digit hex values",function(){var colors={red:"#f00",blue:"#00f",green:"#0f0"};(0,_vitest.expect)((0,_flattenColors.flattenColors)(colors)).toEqual({red:"#f00",blue:"#00f",green:"#0f0"});});(0,_vitest.it)("should handle 8-digit hex values (with alpha)",function(){var colors={"red-50":"#ff000080","blue-50":"#0000ff80"};(0,_vitest.expect)((0,_flattenColors.flattenColors)(colors)).toEqual({"red-50":"#ff000080","blue-50":"#0000ff80"});});(0,_vitest.it)("should handle complex real-world Tailwind config",function(){var colors={transparent:"transparent",current:"currentColor",white:"#ffffff",black:"#000000",gray:{"50":"#f9fafb","100":"#f3f4f6","500":"#6b7280","900":"#111827"},brand:{primary:"#ff6b6b",secondary:"#4ecdc4",accent:{light:"#ffe66d",dark:"#ffb900"}}};(0,_vitest.expect)((0,_flattenColors.flattenColors)(colors)).toEqual({transparent:"transparent",current:"currentColor",white:"#ffffff",black:"#000000","gray-50":"#f9fafb","gray-100":"#f3f4f6","gray-500":"#6b7280","gray-900":"#111827","brand-primary":"#ff6b6b","brand-secondary":"#4ecdc4","brand-accent-light":"#ffe66d","brand-accent-dark":"#ffb900"});});(0,_vitest.it)("should not mutate input object",function(){var colors={brand:{primary:"#ff6b6b",secondary:"#4ecdc4"}};var original=JSON.parse(JSON.stringify(colors));(0,_flattenColors.flattenColors)(colors);(0,_vitest.expect)(colors).toEqual(original);});(0,_vitest.it)("should handle undefined values gracefully",function(){var colors={red:"#ff0000",blue:undefined,green:"#00ff00"};(0,_vitest.expect)((0,_flattenColors.flattenColors)(colors)).toEqual({red:"#ff0000",green:"#00ff00"});});(0,_vitest.it)("should handle special color keywords",function(){var colors={transparent:"transparent",current:"currentColor",inherit:"inherit"};(0,_vitest.expect)((0,_flattenColors.flattenColors)(colors)).toEqual({transparent:"transparent",current:"currentColor",inherit:"inherit"});});(0,_vitest.it)("should handle RGB/RGBA color values",function(){var colors={primary:"rgb(255, 0, 0)",secondary:"rgba(0, 255, 0, 0.5)"};(0,_vitest.expect)((0,_flattenColors.flattenColors)(colors)).toEqual({primary:"rgb(255, 0, 0)",secondary:"rgba(0, 255, 0, 0.5)"});});(0,_vitest.it)("should handle very deeply nested structures (stress test)",function(){var colors={level1:{level2:{level3:{level4:{level5:"#ff0000"}}}}};(0,_vitest.expect)((0,_flattenColors.flattenColors)(colors)).toEqual({"level1-level2-level3-level4-level5":"#ff0000"});});(0,_vitest.it)("should handle camelCase keys",function(){var colors={brandPrimary:"#ff0000",accentColor:{lightShade:"#ffcccc",darkShade:"#cc0000"}};(0,_vitest.expect)((0,_flattenColors.flattenColors)(colors)).toEqual({brandPrimary:"#ff0000","accentColor-lightShade":"#ffcccc","accentColor-darkShade":"#cc0000"});});(0,_vitest.it)("should produce consistent output",function(){var colors={brand:{primary:"#ff6b6b",secondary:"#4ecdc4"}};var result1=(0,_flattenColors.flattenColors)(colors);var result2=(0,_flattenColors.flattenColors)(colors);var result3=(0,_flattenColors.flattenColors)(colors);(0,_vitest.expect)(result1).toEqual(result2);(0,_vitest.expect)(result2).toEqual(result3);});(0,_vitest.it)("should maintain key order (insertion order)",function(){var colors={z:"#000001",a:"#000002",m:"#000003"};var flattened=(0,_flattenColors.flattenColors)(colors);var keys=Object.keys(flattened);(0,_vitest.expect)(keys).toEqual(["z","a","m"]);});});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared utilities for parsing state modifiers (active:, focus:, disabled:)
|
|
3
|
+
* Used by both runtime parser and Babel plugin
|
|
4
|
+
*/
|
|
5
|
+
export declare const SUPPORTED_MODIFIERS: readonly ["active", "focus", "disabled"];
|
|
6
|
+
export type SupportedModifier = (typeof SUPPORTED_MODIFIERS)[number];
|
|
7
|
+
/**
|
|
8
|
+
* Detect if a className contains any state modifiers (active:, focus:, disabled:)
|
|
9
|
+
*/
|
|
10
|
+
export declare function hasModifiers(className: string): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Split className into base classes and modifier-specific classes
|
|
13
|
+
* Returns: { base: string[], modifiers: Map<modifier, string[]> }
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* splitModifierClasses('bg-blue-500 active:bg-blue-700 disabled:bg-gray-300')
|
|
17
|
+
* // Returns:
|
|
18
|
+
* // {
|
|
19
|
+
* // base: ['bg-blue-500'],
|
|
20
|
+
* // modifiers: Map {
|
|
21
|
+
* // 'active' => ['bg-blue-700'],
|
|
22
|
+
* // 'disabled' => ['bg-gray-300']
|
|
23
|
+
* // }
|
|
24
|
+
* // }
|
|
25
|
+
*/
|
|
26
|
+
export declare function splitModifierClasses(className: string): {
|
|
27
|
+
base: string[];
|
|
28
|
+
modifiers: Map<SupportedModifier, string[]>;
|
|
29
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:true});exports.SUPPORTED_MODIFIERS=void 0;exports.hasModifiers=hasModifiers;exports.splitModifierClasses=splitModifierClasses;var SUPPORTED_MODIFIERS=exports.SUPPORTED_MODIFIERS=["active","focus","disabled"];function hasModifiers(className){return SUPPORTED_MODIFIERS.some(function(modifier){return className.includes(`${modifier}:`);});}function splitModifierClasses(className){var classes=className.split(/\s+/).filter(Boolean);var base=[];var modifiers=new Map();for(var cls of classes){var matched=false;for(var modifier of SUPPORTED_MODIFIERS){var prefix=`${modifier}:`;if(cls.startsWith(prefix)){var cleanClass=cls.slice(prefix.length);if(!modifiers.has(modifier)){modifiers.set(modifier,[]);}var modifierClasses=modifiers.get(modifier);if(modifierClasses){modifierClasses.push(cleanClass);}matched=true;break;}}if(!matched){base.push(cls);}}return{base:base,modifiers:modifiers};}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var _vitest=require("vitest");var _modifiers=require("./modifiers");(0,_vitest.describe)("SUPPORTED_MODIFIERS",function(){(0,_vitest.it)("should export list of supported modifiers",function(){(0,_vitest.expect)(_modifiers.SUPPORTED_MODIFIERS).toEqual(["active","focus","disabled"]);});(0,_vitest.it)("should be readonly",function(){(0,_vitest.expect)(Array.isArray(_modifiers.SUPPORTED_MODIFIERS)).toBe(true);});});(0,_vitest.describe)("hasModifiers",function(){(0,_vitest.it)("should return true for active modifier",function(){(0,_vitest.expect)((0,_modifiers.hasModifiers)("active:bg-blue-500")).toBe(true);(0,_vitest.expect)((0,_modifiers.hasModifiers)("m-4 active:bg-blue-500")).toBe(true);(0,_vitest.expect)((0,_modifiers.hasModifiers)("active:bg-blue-500 active:text-white")).toBe(true);});(0,_vitest.it)("should return true for focus modifier",function(){(0,_vitest.expect)((0,_modifiers.hasModifiers)("focus:border-blue-500")).toBe(true);(0,_vitest.expect)((0,_modifiers.hasModifiers)("p-2 focus:border-blue-500")).toBe(true);(0,_vitest.expect)((0,_modifiers.hasModifiers)("focus:bg-blue-500 focus:text-white")).toBe(true);});(0,_vitest.it)("should return true for disabled modifier",function(){(0,_vitest.expect)((0,_modifiers.hasModifiers)("disabled:opacity-50")).toBe(true);(0,_vitest.expect)((0,_modifiers.hasModifiers)("bg-blue-500 disabled:opacity-50")).toBe(true);(0,_vitest.expect)((0,_modifiers.hasModifiers)("disabled:bg-gray-300 disabled:text-gray-500")).toBe(true);});(0,_vitest.it)("should return true for multiple different modifiers",function(){(0,_vitest.expect)((0,_modifiers.hasModifiers)("active:bg-blue-700 focus:border-blue-500")).toBe(true);(0,_vitest.expect)((0,_modifiers.hasModifiers)("bg-blue-500 active:bg-blue-700 disabled:opacity-50")).toBe(true);(0,_vitest.expect)((0,_modifiers.hasModifiers)("focus:border-blue-500 disabled:bg-gray-300")).toBe(true);});(0,_vitest.it)("should return false for no modifiers",function(){(0,_vitest.expect)((0,_modifiers.hasModifiers)("bg-blue-500")).toBe(false);(0,_vitest.expect)((0,_modifiers.hasModifiers)("m-4 p-2 text-white")).toBe(false);(0,_vitest.expect)((0,_modifiers.hasModifiers)("flex items-center justify-center")).toBe(false);});(0,_vitest.it)("should return false for empty string",function(){(0,_vitest.expect)((0,_modifiers.hasModifiers)("")).toBe(false);});(0,_vitest.it)("should return false for partial matches",function(){(0,_vitest.expect)((0,_modifiers.hasModifiers)("active")).toBe(false);(0,_vitest.expect)((0,_modifiers.hasModifiers)("focus")).toBe(false);(0,_vitest.expect)((0,_modifiers.hasModifiers)("disabled")).toBe(false);(0,_vitest.expect)((0,_modifiers.hasModifiers)("active-bg-blue-500")).toBe(false);(0,_vitest.expect)((0,_modifiers.hasModifiers)("focusborder-blue-500")).toBe(false);});(0,_vitest.it)("should detect modifiers anywhere in the string",function(){(0,_vitest.expect)((0,_modifiers.hasModifiers)("bg-blue-500 active:bg-blue-700 text-white")).toBe(true);(0,_vitest.expect)((0,_modifiers.hasModifiers)("flex items-center focus:border-blue-500 p-4")).toBe(true);});(0,_vitest.it)("should handle whitespace variations",function(){(0,_vitest.expect)((0,_modifiers.hasModifiers)(" active:bg-blue-500 ")).toBe(true);(0,_vitest.expect)((0,_modifiers.hasModifiers)("\tactive:bg-blue-500\n")).toBe(true);(0,_vitest.expect)((0,_modifiers.hasModifiers)("m-4 active:bg-blue-500 p-2")).toBe(true);});(0,_vitest.it)("should be case-sensitive",function(){(0,_vitest.expect)((0,_modifiers.hasModifiers)("Active:bg-blue-500")).toBe(false);(0,_vitest.expect)((0,_modifiers.hasModifiers)("ACTIVE:bg-blue-500")).toBe(false);(0,_vitest.expect)((0,_modifiers.hasModifiers)("Focus:border-blue-500")).toBe(false);});});(0,_vitest.describe)("splitModifierClasses",function(){(0,_vitest.it)("should split base classes without modifiers",function(){var result=(0,_modifiers.splitModifierClasses)("m-4 p-2 bg-blue-500");(0,_vitest.expect)(result.base).toEqual(["m-4","p-2","bg-blue-500"]);(0,_vitest.expect)(result.modifiers.size).toBe(0);});(0,_vitest.it)("should split active modifier classes",function(){var result=(0,_modifiers.splitModifierClasses)("bg-blue-500 active:bg-blue-700");(0,_vitest.expect)(result.base).toEqual(["bg-blue-500"]);(0,_vitest.expect)(result.modifiers.get("active")).toEqual(["bg-blue-700"]);});(0,_vitest.it)("should split focus modifier classes",function(){var result=(0,_modifiers.splitModifierClasses)("border-gray-300 focus:border-blue-500");(0,_vitest.expect)(result.base).toEqual(["border-gray-300"]);(0,_vitest.expect)(result.modifiers.get("focus")).toEqual(["border-blue-500"]);});(0,_vitest.it)("should split disabled modifier classes",function(){var result=(0,_modifiers.splitModifierClasses)("bg-blue-500 disabled:bg-gray-300");(0,_vitest.expect)(result.base).toEqual(["bg-blue-500"]);(0,_vitest.expect)(result.modifiers.get("disabled")).toEqual(["bg-gray-300"]);});(0,_vitest.it)("should split multiple classes with same modifier",function(){var result=(0,_modifiers.splitModifierClasses)("bg-blue-500 active:bg-blue-700 active:text-white active:border-blue-900");(0,_vitest.expect)(result.base).toEqual(["bg-blue-500"]);(0,_vitest.expect)(result.modifiers.get("active")).toEqual(["bg-blue-700","text-white","border-blue-900"]);});(0,_vitest.it)("should split multiple different modifiers",function(){var result=(0,_modifiers.splitModifierClasses)("bg-blue-500 active:bg-blue-700 focus:border-blue-500 disabled:opacity-50");(0,_vitest.expect)(result.base).toEqual(["bg-blue-500"]);(0,_vitest.expect)(result.modifiers.get("active")).toEqual(["bg-blue-700"]);(0,_vitest.expect)(result.modifiers.get("focus")).toEqual(["border-blue-500"]);(0,_vitest.expect)(result.modifiers.get("disabled")).toEqual(["opacity-50"]);});(0,_vitest.it)("should handle complex combination of base and modifier classes",function(){var result=(0,_modifiers.splitModifierClasses)("m-4 p-2 bg-blue-500 text-white rounded-lg active:bg-blue-700 active:text-gray-100 focus:border-blue-500 disabled:opacity-50 disabled:bg-gray-300");(0,_vitest.expect)(result.base).toEqual(["m-4","p-2","bg-blue-500","text-white","rounded-lg"]);(0,_vitest.expect)(result.modifiers.get("active")).toEqual(["bg-blue-700","text-gray-100"]);(0,_vitest.expect)(result.modifiers.get("focus")).toEqual(["border-blue-500"]);(0,_vitest.expect)(result.modifiers.get("disabled")).toEqual(["opacity-50","bg-gray-300"]);});(0,_vitest.it)("should handle empty string",function(){var result=(0,_modifiers.splitModifierClasses)("");(0,_vitest.expect)(result.base).toEqual([]);(0,_vitest.expect)(result.modifiers.size).toBe(0);});(0,_vitest.it)("should handle whitespace-only string",function(){var result=(0,_modifiers.splitModifierClasses)(" ");(0,_vitest.expect)(result.base).toEqual([]);(0,_vitest.expect)(result.modifiers.size).toBe(0);});(0,_vitest.it)("should handle only modifier classes",function(){var result=(0,_modifiers.splitModifierClasses)("active:bg-blue-700 focus:border-blue-500");(0,_vitest.expect)(result.base).toEqual([]);(0,_vitest.expect)(result.modifiers.get("active")).toEqual(["bg-blue-700"]);(0,_vitest.expect)(result.modifiers.get("focus")).toEqual(["border-blue-500"]);});(0,_vitest.it)("should filter out empty strings from split",function(){var result=(0,_modifiers.splitModifierClasses)("m-4 p-2 bg-blue-500");(0,_vitest.expect)(result.base).toEqual(["m-4","p-2","bg-blue-500"]);(0,_vitest.expect)(result.modifiers.size).toBe(0);});(0,_vitest.it)("should handle leading and trailing whitespace",function(){var result=(0,_modifiers.splitModifierClasses)(" m-4 active:bg-blue-700 ");(0,_vitest.expect)(result.base).toEqual(["m-4"]);(0,_vitest.expect)(result.modifiers.get("active")).toEqual(["bg-blue-700"]);});(0,_vitest.it)("should handle arbitrary values with modifiers",function(){var result=(0,_modifiers.splitModifierClasses)("bg-[#ff0000] active:bg-[#00ff00] text-[14px]");(0,_vitest.expect)(result.base).toEqual(["bg-[#ff0000]","text-[14px]"]);(0,_vitest.expect)(result.modifiers.get("active")).toEqual(["bg-[#00ff00]"]);});(0,_vitest.it)("should handle opacity modifiers with state modifiers",function(){var result=(0,_modifiers.splitModifierClasses)("bg-black/50 active:bg-black/80 text-white/90");(0,_vitest.expect)(result.base).toEqual(["bg-black/50","text-white/90"]);(0,_vitest.expect)(result.modifiers.get("active")).toEqual(["bg-black/80"]);});(0,_vitest.it)("should preserve order of base classes",function(){var result=(0,_modifiers.splitModifierClasses)("z-10 m-4 a-1 p-2");(0,_vitest.expect)(result.base).toEqual(["z-10","m-4","a-1","p-2"]);});(0,_vitest.it)("should preserve order of modifier classes",function(){var result=(0,_modifiers.splitModifierClasses)("active:z-10 active:m-4 active:a-1 active:p-2");(0,_vitest.expect)(result.modifiers.get("active")).toEqual(["z-10","m-4","a-1","p-2"]);});(0,_vitest.it)("should not match modifiers without colon",function(){var result=(0,_modifiers.splitModifierClasses)("active bg-blue-500 focus border-blue-500");(0,_vitest.expect)(result.base).toEqual(["active","bg-blue-500","focus","border-blue-500"]);(0,_vitest.expect)(result.modifiers.size).toBe(0);});(0,_vitest.it)("should not match partial modifier names",function(){var result=(0,_modifiers.splitModifierClasses)("reactive:bg-blue-500 prefocus:border-blue-500");(0,_vitest.expect)(result.base).toEqual(["reactive:bg-blue-500","prefocus:border-blue-500"]);(0,_vitest.expect)(result.modifiers.size).toBe(0);});(0,_vitest.it)("should handle modifiers at different positions",function(){var result=(0,_modifiers.splitModifierClasses)("active:bg-blue-700 m-4 focus:border-blue-500 p-2 disabled:opacity-50");(0,_vitest.expect)(result.base).toEqual(["m-4","p-2"]);(0,_vitest.expect)(result.modifiers.get("active")).toEqual(["bg-blue-700"]);(0,_vitest.expect)(result.modifiers.get("focus")).toEqual(["border-blue-500"]);(0,_vitest.expect)(result.modifiers.get("disabled")).toEqual(["opacity-50"]);});(0,_vitest.it)("should return empty Map when no modifiers present",function(){var result=(0,_modifiers.splitModifierClasses)("m-4 p-2 bg-blue-500");(0,_vitest.expect)(result.modifiers).toBeInstanceOf(Map);(0,_vitest.expect)(result.modifiers.size).toBe(0);(0,_vitest.expect)(result.modifiers.get("active")).toBeUndefined();(0,_vitest.expect)(result.modifiers.get("focus")).toBeUndefined();(0,_vitest.expect)(result.modifiers.get("disabled")).toBeUndefined();});(0,_vitest.it)("should return Map with only present modifiers",function(){var result=(0,_modifiers.splitModifierClasses)("bg-blue-500 active:bg-blue-700");(0,_vitest.expect)(result.modifiers.has("active")).toBe(true);(0,_vitest.expect)(result.modifiers.has("focus")).toBe(false);(0,_vitest.expect)(result.modifiers.has("disabled")).toBe(false);});(0,_vitest.it)("should handle real-world button example",function(){var result=(0,_modifiers.splitModifierClasses)("px-4 py-2 bg-blue-500 text-white rounded-lg active:bg-blue-700 disabled:bg-gray-300 disabled:text-gray-500");(0,_vitest.expect)(result.base).toEqual(["px-4","py-2","bg-blue-500","text-white","rounded-lg"]);(0,_vitest.expect)(result.modifiers.get("active")).toEqual(["bg-blue-700"]);(0,_vitest.expect)(result.modifiers.get("disabled")).toEqual(["bg-gray-300","text-gray-500"]);(0,_vitest.expect)(result.modifiers.get("focus")).toBeUndefined();});(0,_vitest.it)("should handle real-world input example",function(){var result=(0,_modifiers.splitModifierClasses)("border border-gray-300 rounded p-2 focus:border-blue-500 focus:outline-none disabled:bg-gray-100 disabled:text-gray-400");(0,_vitest.expect)(result.base).toEqual(["border","border-gray-300","rounded","p-2"]);(0,_vitest.expect)(result.modifiers.get("focus")).toEqual(["border-blue-500","outline-none"]);(0,_vitest.expect)(result.modifiers.get("disabled")).toEqual(["bg-gray-100","text-gray-400"]);(0,_vitest.expect)(result.modifiers.get("active")).toBeUndefined();});(0,_vitest.it)("should be consistent across multiple calls",function(){var className="m-4 active:bg-blue-700 focus:border-blue-500";var result1=(0,_modifiers.splitModifierClasses)(className);var result2=(0,_modifiers.splitModifierClasses)(className);(0,_vitest.expect)(result1.base).toEqual(result2.base);(0,_vitest.expect)(result1.modifiers.get("active")).toEqual(result2.modifiers.get("active"));(0,_vitest.expect)(result1.modifiers.get("focus")).toEqual(result2.modifiers.get("focus"));});(0,_vitest.it)("should handle negative values with modifiers",function(){var result=(0,_modifiers.splitModifierClasses)("-m-4 active:-m-8 -translate-x-2");(0,_vitest.expect)(result.base).toEqual(["-m-4","-translate-x-2"]);(0,_vitest.expect)(result.modifiers.get("active")).toEqual(["-m-8"]);});(0,_vitest.it)("should handle transform classes with modifiers",function(){var result=(0,_modifiers.splitModifierClasses)("scale-100 active:scale-110 rotate-0 active:rotate-45");(0,_vitest.expect)(result.base).toEqual(["scale-100","rotate-0"]);(0,_vitest.expect)(result.modifiers.get("active")).toEqual(["scale-110","rotate-45"]);});});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var _vitest=require("vitest");var _styleKey=require("./styleKey");(0,_vitest.describe)("generateStyleKey",function(){(0,_vitest.it)("should generate key with leading underscore",function(){(0,_vitest.expect)((0,_styleKey.generateStyleKey)("m-4")).toBe("_m_4");(0,_vitest.expect)((0,_styleKey.generateStyleKey)("p-2")).toBe("_p_2");(0,_vitest.expect)((0,_styleKey.generateStyleKey)("bg-blue-500")).toBe("_bg_blue_500");});(0,_vitest.it)("should sort classes alphabetically for consistency",function(){(0,_vitest.expect)((0,_styleKey.generateStyleKey)("m-4 p-2")).toBe((0,_styleKey.generateStyleKey)("p-2 m-4"));(0,_vitest.expect)((0,_styleKey.generateStyleKey)("bg-blue-500 text-white")).toBe((0,_styleKey.generateStyleKey)("text-white bg-blue-500"));(0,_vitest.expect)((0,_styleKey.generateStyleKey)("flex items-center justify-center")).toBe((0,_styleKey.generateStyleKey)("justify-center flex items-center"));});(0,_vitest.it)("should handle single class",function(){(0,_vitest.expect)((0,_styleKey.generateStyleKey)("flex")).toBe("_flex");(0,_vitest.expect)((0,_styleKey.generateStyleKey)("hidden")).toBe("_hidden");(0,_vitest.expect)((0,_styleKey.generateStyleKey)("absolute")).toBe("_absolute");});(0,_vitest.it)("should handle multiple classes",function(){(0,_vitest.expect)((0,_styleKey.generateStyleKey)("m-4 p-2 bg-blue-500")).toBe("_bg_blue_500_m_4_p_2");(0,_vitest.expect)((0,_styleKey.generateStyleKey)("flex items-center justify-center")).toBe("_flex_items_center_justify_center");});(0,_vitest.it)("should replace special characters with underscores",function(){(0,_vitest.expect)((0,_styleKey.generateStyleKey)("bg-[#ff0000]")).toBe("_bg_ff0000_");(0,_vitest.expect)((0,_styleKey.generateStyleKey)("text-[14px]")).toBe("_text_14px_");(0,_vitest.expect)((0,_styleKey.generateStyleKey)("m-[16px]")).toBe("_m_16px_");});(0,_vitest.it)("should collapse multiple underscores",function(){(0,_vitest.expect)((0,_styleKey.generateStyleKey)("bg-[#ff0000]")).toBe("_bg_ff0000_");(0,_vitest.expect)((0,_styleKey.generateStyleKey)("w-[100%]")).toBe("_w_100_");});(0,_vitest.it)("should handle classes with hyphens",function(){(0,_vitest.expect)((0,_styleKey.generateStyleKey)("bg-blue-500")).toBe("_bg_blue_500");(0,_vitest.expect)((0,_styleKey.generateStyleKey)("text-gray-700")).toBe("_text_gray_700");(0,_vitest.expect)((0,_styleKey.generateStyleKey)("border-red-300")).toBe("_border_red_300");});(0,_vitest.it)("should handle classes with numbers",function(){(0,_vitest.expect)((0,_styleKey.generateStyleKey)("m-4")).toBe("_m_4");(0,_vitest.expect)((0,_styleKey.generateStyleKey)("p-8")).toBe("_p_8");(0,_vitest.expect)((0,_styleKey.generateStyleKey)("gap-96")).toBe("_gap_96");(0,_vitest.expect)((0,_styleKey.generateStyleKey)("text-2xl")).toBe("_text_2xl");});(0,_vitest.it)("should handle classes with decimals",function(){(0,_vitest.expect)((0,_styleKey.generateStyleKey)("m-0.5")).toBe("_m_0_5");(0,_vitest.expect)((0,_styleKey.generateStyleKey)("p-1.5")).toBe("_p_1_5");(0,_vitest.expect)((0,_styleKey.generateStyleKey)("gap-2.5")).toBe("_gap_2_5");});(0,_vitest.it)("should handle empty string",function(){(0,_vitest.expect)((0,_styleKey.generateStyleKey)("")).toBe("_");});(0,_vitest.it)("should handle whitespace-only string",function(){(0,_vitest.expect)((0,_styleKey.generateStyleKey)(" ")).toBe("_");(0,_vitest.expect)((0,_styleKey.generateStyleKey)("\t\n")).toBe("_");});(0,_vitest.it)("should handle multiple consecutive spaces",function(){(0,_vitest.expect)((0,_styleKey.generateStyleKey)("m-4 p-2 bg-blue-500")).toBe("_bg_blue_500_m_4_p_2");(0,_vitest.expect)((0,_styleKey.generateStyleKey)("flex items-center")).toBe("_flex_items_center");});(0,_vitest.it)("should handle leading and trailing spaces",function(){(0,_vitest.expect)((0,_styleKey.generateStyleKey)(" m-4 p-2 ")).toBe("_m_4_p_2");(0,_vitest.expect)((0,_styleKey.generateStyleKey)("\tflex items-center\n")).toBe("_flex_items_center");});(0,_vitest.it)("should handle opacity modifiers",function(){(0,_vitest.expect)((0,_styleKey.generateStyleKey)("bg-black/50")).toBe("_bg_black_50");(0,_vitest.expect)((0,_styleKey.generateStyleKey)("text-white/80")).toBe("_text_white_80");(0,_vitest.expect)((0,_styleKey.generateStyleKey)("border-blue-500/30")).toBe("_border_blue_500_30");});(0,_vitest.it)("should handle state modifiers",function(){(0,_vitest.expect)((0,_styleKey.generateStyleKey)("active:bg-blue-700")).toBe("_active_bg_blue_700");(0,_vitest.expect)((0,_styleKey.generateStyleKey)("focus:border-blue-500")).toBe("_focus_border_blue_500");(0,_vitest.expect)((0,_styleKey.generateStyleKey)("disabled:opacity-50")).toBe("_disabled_opacity_50");});(0,_vitest.it)("should handle complex combinations",function(){(0,_vitest.expect)((0,_styleKey.generateStyleKey)("m-4 p-2 bg-blue-500 text-white rounded-lg")).toBe("_bg_blue_500_m_4_p_2_rounded_lg_text_white");(0,_vitest.expect)((0,_styleKey.generateStyleKey)("flex items-center justify-between p-4 bg-gray-100 border-b-2")).toBe("_bg_gray_100_border_b_2_flex_items_center_justify_between_p_4");});(0,_vitest.it)("should handle arbitrary values in complex scenarios",function(){(0,_vitest.expect)((0,_styleKey.generateStyleKey)("m-[16px] p-[8px] bg-[#ff0000]")).toBe("_bg_ff0000_m_16px_p_8px_");(0,_vitest.expect)((0,_styleKey.generateStyleKey)("w-[100%] h-[50px] text-[14px]")).toBe("_h_50px_text_14px_w_100_");});(0,_vitest.it)("should produce consistent keys regardless of class order",function(){var combinations=["m-4 p-2 bg-blue-500","p-2 m-4 bg-blue-500","bg-blue-500 m-4 p-2","bg-blue-500 p-2 m-4","m-4 bg-blue-500 p-2","p-2 bg-blue-500 m-4"];var keys=combinations.map(_styleKey.generateStyleKey);var firstKey=keys[0];keys.forEach(function(key){(0,_vitest.expect)(key).toBe(firstKey);});});(0,_vitest.it)("should handle duplicate classes",function(){(0,_vitest.expect)((0,_styleKey.generateStyleKey)("m-4 m-4")).toBe("_m_4_m_4");(0,_vitest.expect)((0,_styleKey.generateStyleKey)("flex flex flex")).toBe("_flex_flex_flex");});(0,_vitest.it)("should handle transform classes",function(){(0,_vitest.expect)((0,_styleKey.generateStyleKey)("scale-110")).toBe("_scale_110");(0,_vitest.expect)((0,_styleKey.generateStyleKey)("rotate-45")).toBe("_rotate_45");(0,_vitest.expect)((0,_styleKey.generateStyleKey)("translate-x-4")).toBe("_translate_x_4");(0,_vitest.expect)((0,_styleKey.generateStyleKey)("-rotate-90")).toBe("__rotate_90");});(0,_vitest.it)("should handle negative values",function(){(0,_vitest.expect)((0,_styleKey.generateStyleKey)("-m-4")).toBe("__m_4");(0,_vitest.expect)((0,_styleKey.generateStyleKey)("-translate-x-8")).toBe("__translate_x_8");(0,_vitest.expect)((0,_styleKey.generateStyleKey)("-rotate-180")).toBe("__rotate_180");});(0,_vitest.it)("should be deterministic",function(){var className="m-4 p-2 bg-blue-500 text-white rounded-lg flex items-center";var key1=(0,_styleKey.generateStyleKey)(className);var key2=(0,_styleKey.generateStyleKey)(className);var key3=(0,_styleKey.generateStyleKey)(className);(0,_vitest.expect)(key1).toBe(key2);(0,_vitest.expect)(key2).toBe(key3);});(0,_vitest.it)("should create valid JavaScript identifiers",function(){var keys=[(0,_styleKey.generateStyleKey)("m-4"),(0,_styleKey.generateStyleKey)("bg-blue-500"),(0,_styleKey.generateStyleKey)("text-[14px]"),(0,_styleKey.generateStyleKey)("flex items-center"),(0,_styleKey.generateStyleKey)("active:bg-red-500")];keys.forEach(function(key){(0,_vitest.expect)(key).toMatch(/^_/);(0,_vitest.expect)(key).toMatch(/^[_a-zA-Z0-9]+$/);});});});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mgcrea/react-native-tailwind",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Compile-time Tailwind CSS for React Native with zero runtime overhead",
|
|
5
5
|
"author": "Olivier Louvignes <olivier@mgcrea.io> (https://github.com/mgcrea)",
|
|
6
6
|
"homepage": "https://github.com/mgcrea/react-native-tailwind#readme",
|
|
@@ -19,6 +19,11 @@
|
|
|
19
19
|
"import": "./dist/babel/index.cjs",
|
|
20
20
|
"require": "./dist/babel/index.cjs"
|
|
21
21
|
},
|
|
22
|
+
"./runtime": {
|
|
23
|
+
"types": "./dist/runtime.d.ts",
|
|
24
|
+
"import": "./dist/runtime.js",
|
|
25
|
+
"require": "./dist/runtime.cjs"
|
|
26
|
+
},
|
|
22
27
|
"./react-native": {
|
|
23
28
|
"types": "./dist/react-native.d.ts"
|
|
24
29
|
}
|
|
@@ -31,16 +36,17 @@
|
|
|
31
36
|
],
|
|
32
37
|
"scripts": {
|
|
33
38
|
"dev": "cd example; npm run dev",
|
|
34
|
-
"build": "npm run build:babel && npm run build:babel-plugin && npm run build:types",
|
|
39
|
+
"build": "npm run build:babel && npm run build:babel-plugin && npm run build:runtime && npm run build:types",
|
|
35
40
|
"build:babel": "babel src --out-dir dist --extensions \".ts,.tsx,.js,.jsx\" --copy-files --ignore 'src/babel/**' --ignore '**/*.d.ts'",
|
|
36
41
|
"build:babel-plugin": "node --experimental-strip-types scripts/bundle-babel-plugin.ts",
|
|
42
|
+
"build:runtime": "node --experimental-strip-types scripts/bundle-runtime.ts",
|
|
37
43
|
"build:types": "tsc --project tsconfig.build.json --emitDeclarationOnly && node --experimental-strip-types scripts/post-build-types.ts",
|
|
38
44
|
"install:ios": "cd example; npm run install:ios",
|
|
39
45
|
"open:ios": "cd example; npm run open:ios",
|
|
40
46
|
"lint": "eslint src/",
|
|
41
47
|
"prettify": "prettier --write src/",
|
|
42
48
|
"check": "tsc --noEmit",
|
|
43
|
-
"spec": "vitest",
|
|
49
|
+
"spec": "vitest --run",
|
|
44
50
|
"test": "npm run lint && npm run check && npm run spec",
|
|
45
51
|
"prepare": "npm run build"
|
|
46
52
|
},
|
|
@@ -52,6 +58,7 @@
|
|
|
52
58
|
"@babel/cli": "^7.28.3",
|
|
53
59
|
"@babel/core": "^7.28.5",
|
|
54
60
|
"@babel/plugin-transform-modules-commonjs": "^7.27.1",
|
|
61
|
+
"@babel/preset-react": "^7.28.5",
|
|
55
62
|
"@babel/preset-typescript": "^7.28.5",
|
|
56
63
|
"@babel/runtime": "^7.28.4",
|
|
57
64
|
"@babel/types": "^7.28.5",
|
|
@@ -80,5 +87,10 @@
|
|
|
80
87
|
"packageManager": "pnpm@10.22.0",
|
|
81
88
|
"publishConfig": {
|
|
82
89
|
"access": "public"
|
|
90
|
+
},
|
|
91
|
+
"pnpm": {
|
|
92
|
+
"onlyBuiltDependencies": [
|
|
93
|
+
"esbuild"
|
|
94
|
+
]
|
|
83
95
|
}
|
|
84
96
|
}
|