@mgcrea/react-native-tailwind 0.7.0 → 0.8.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 +2 -1
- package/dist/babel/index.cjs +333 -195
- package/dist/babel/index.d.ts +4 -40
- package/dist/babel/index.test.ts +214 -1
- package/dist/babel/index.ts +4 -1169
- package/dist/babel/plugin.d.ts +42 -0
- package/{src/babel/index.test.ts → dist/babel/plugin.test.ts} +216 -2
- package/dist/babel/plugin.ts +491 -0
- package/dist/babel/utils/attributeMatchers.d.ts +23 -0
- package/dist/babel/utils/attributeMatchers.ts +71 -0
- package/dist/babel/utils/componentSupport.d.ts +18 -0
- package/dist/babel/utils/componentSupport.ts +68 -0
- package/dist/babel/utils/dynamicProcessing.d.ts +32 -0
- package/dist/babel/utils/dynamicProcessing.ts +223 -0
- package/dist/babel/utils/modifierProcessing.d.ts +26 -0
- package/dist/babel/utils/modifierProcessing.ts +118 -0
- package/dist/babel/utils/styleInjection.d.ts +15 -0
- package/dist/babel/utils/styleInjection.ts +80 -0
- package/dist/babel/utils/styleTransforms.d.ts +39 -0
- package/dist/babel/utils/styleTransforms.test.ts +349 -0
- package/dist/babel/utils/styleTransforms.ts +258 -0
- package/dist/babel/utils/twProcessing.d.ts +28 -0
- package/dist/babel/utils/twProcessing.ts +124 -0
- package/dist/components/TextInput.d.ts +171 -14
- package/dist/config/tailwind.d.ts +302 -0
- package/dist/config/tailwind.js +1 -0
- package/dist/index.d.ts +5 -4
- package/dist/index.js +1 -1
- package/dist/parser/colors.js +1 -1
- package/dist/parser/index.d.ts +1 -0
- package/dist/parser/index.js +1 -1
- package/dist/parser/modifiers.d.ts +2 -2
- package/dist/parser/modifiers.js +1 -1
- package/dist/parser/placeholder.d.ts +36 -0
- package/dist/parser/placeholder.js +1 -0
- package/dist/parser/placeholder.test.js +1 -0
- package/dist/parser/typography.d.ts +1 -0
- package/dist/parser/typography.js +1 -1
- package/dist/parser/typography.test.js +1 -1
- package/dist/runtime.cjs +1 -1
- package/dist/runtime.cjs.map +4 -4
- package/dist/runtime.d.ts +1 -14
- package/dist/runtime.js +1 -1
- package/dist/runtime.js.map +4 -4
- package/dist/stubs/tw.d.ts +1 -14
- package/dist/types/core.d.ts +40 -0
- package/dist/types/core.js +0 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.js +1 -0
- package/dist/types/runtime.d.ts +15 -0
- package/dist/types/runtime.js +1 -0
- package/dist/types/util.d.ts +3 -0
- package/dist/types/util.js +0 -0
- package/package.json +1 -1
- package/src/babel/index.ts +4 -1169
- package/src/babel/plugin.test.ts +482 -0
- package/src/babel/plugin.ts +491 -0
- package/src/babel/utils/attributeMatchers.ts +71 -0
- package/src/babel/utils/componentSupport.ts +68 -0
- package/src/babel/utils/dynamicProcessing.ts +223 -0
- package/src/babel/utils/modifierProcessing.ts +118 -0
- package/src/babel/utils/styleInjection.ts +80 -0
- package/src/babel/utils/styleTransforms.test.ts +349 -0
- package/src/babel/utils/styleTransforms.ts +258 -0
- package/src/babel/utils/twProcessing.ts +124 -0
- package/src/components/TextInput.tsx +17 -14
- package/src/config/{palettes.ts → tailwind.ts} +2 -2
- package/src/index.ts +6 -3
- package/src/parser/colors.ts +2 -2
- package/src/parser/index.ts +1 -0
- package/src/parser/modifiers.ts +10 -4
- package/src/parser/placeholder.test.ts +105 -0
- package/src/parser/placeholder.ts +78 -0
- package/src/parser/typography.test.ts +11 -0
- package/src/parser/typography.ts +20 -2
- package/src/runtime.ts +1 -16
- package/src/stubs/tw.ts +1 -16
- package/src/{types.ts → types/core.ts} +0 -4
- package/src/types/index.ts +2 -0
- package/src/types/runtime.ts +17 -0
- package/src/types/util.ts +1 -0
package/dist/stubs/tw.d.ts
CHANGED
|
@@ -6,20 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* For runtime parsing, use: import { tw } from '@mgcrea/react-native-tailwind/runtime'
|
|
8
8
|
*/
|
|
9
|
-
import type {
|
|
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
|
-
};
|
|
9
|
+
import type { NativeStyle, TwStyle } from "../types/runtime.js";
|
|
23
10
|
/**
|
|
24
11
|
* Compile-time Tailwind CSS template tag (transformed by Babel plugin)
|
|
25
12
|
*
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core type definitions
|
|
3
|
+
*/
|
|
4
|
+
export type TransformStyle = {
|
|
5
|
+
scale?: number;
|
|
6
|
+
} | {
|
|
7
|
+
scaleX?: number;
|
|
8
|
+
} | {
|
|
9
|
+
scaleY?: number;
|
|
10
|
+
} | {
|
|
11
|
+
rotate?: string;
|
|
12
|
+
} | {
|
|
13
|
+
rotateX?: string;
|
|
14
|
+
} | {
|
|
15
|
+
rotateY?: string;
|
|
16
|
+
} | {
|
|
17
|
+
rotateZ?: string;
|
|
18
|
+
} | {
|
|
19
|
+
translateX?: number | string;
|
|
20
|
+
} | {
|
|
21
|
+
translateY?: number | string;
|
|
22
|
+
} | {
|
|
23
|
+
skewX?: string;
|
|
24
|
+
} | {
|
|
25
|
+
skewY?: string;
|
|
26
|
+
} | {
|
|
27
|
+
perspective?: number;
|
|
28
|
+
};
|
|
29
|
+
export type ShadowOffsetStyle = {
|
|
30
|
+
width: number;
|
|
31
|
+
height: number;
|
|
32
|
+
};
|
|
33
|
+
export type StyleObject = {
|
|
34
|
+
[key: string]: string | number | ShadowOffsetStyle | TransformStyle[] | undefined;
|
|
35
|
+
shadowOffset?: ShadowOffsetStyle;
|
|
36
|
+
transform?: TransformStyle[];
|
|
37
|
+
};
|
|
38
|
+
export type SpacingValue = number;
|
|
39
|
+
export type ColorValue = string;
|
|
40
|
+
export type Parser = (className: string) => StyleObject | null;
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:true});var _core=require("./core");Object.keys(_core).forEach(function(key){if(key==="default"||key==="__esModule")return;if(key in exports&&exports[key]===_core[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return _core[key];}});});var _util=require("./util");Object.keys(_util).forEach(function(key){if(key==="default"||key==="__esModule")return;if(key in exports&&exports[key]===_util[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return _util[key];}});});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ImageStyle, TextStyle, ViewStyle } from "react-native";
|
|
2
|
+
/**
|
|
3
|
+
* Union type for all React Native style types
|
|
4
|
+
*/
|
|
5
|
+
export type NativeStyle = ViewStyle | TextStyle | ImageStyle;
|
|
6
|
+
/**
|
|
7
|
+
* Return type for tw/twStyle functions with separate style properties for modifiers
|
|
8
|
+
*/
|
|
9
|
+
export type TwStyle<T extends NativeStyle = NativeStyle> = {
|
|
10
|
+
style: T;
|
|
11
|
+
activeStyle?: T;
|
|
12
|
+
focusStyle?: T;
|
|
13
|
+
disabledStyle?: T;
|
|
14
|
+
placeholderStyle?: TextStyle;
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:true});
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mgcrea/react-native-tailwind",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.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",
|