react-native-css 0.0.0-nightly.d11bf3f → 0.0.0-nightly.d6f42ab
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commonjs/compiler/atRules.js +30 -16
- package/dist/commonjs/compiler/atRules.js.map +1 -1
- package/dist/commonjs/compiler/compiler.js +29 -19
- package/dist/commonjs/compiler/compiler.js.map +1 -1
- package/dist/commonjs/compiler/declarations.js +10 -10
- package/dist/commonjs/compiler/declarations.js.map +1 -1
- package/dist/commonjs/compiler/keyframes.js +1 -1
- package/dist/commonjs/compiler/keyframes.js.map +1 -1
- package/dist/commonjs/compiler/lightningcss-loader.js +40 -0
- package/dist/commonjs/compiler/lightningcss-loader.js.map +1 -0
- package/dist/commonjs/compiler/selector-builder.js +3 -2
- package/dist/commonjs/compiler/selector-builder.js.map +1 -1
- package/dist/commonjs/compiler/stylesheet.js +5 -7
- package/dist/commonjs/compiler/stylesheet.js.map +1 -1
- package/dist/commonjs/components/ActivityIndicator.js +6 -6
- package/dist/commonjs/components/ActivityIndicator.js.map +1 -1
- package/dist/commonjs/components/Button.js +6 -6
- package/dist/commonjs/components/Button.js.map +1 -1
- package/dist/commonjs/components/FlatList.js +10 -9
- package/dist/commonjs/components/FlatList.js.map +1 -1
- package/dist/commonjs/components/Image.js +6 -6
- package/dist/commonjs/components/Image.js.map +1 -1
- package/dist/commonjs/components/ImageBackground.js +22 -0
- package/dist/commonjs/components/ImageBackground.js.map +1 -0
- package/dist/commonjs/components/KeyboardAvoidingView.js +19 -0
- package/dist/commonjs/components/KeyboardAvoidingView.js.map +1 -0
- package/dist/commonjs/components/Pressable.js +17 -0
- package/dist/commonjs/components/Pressable.js.map +1 -0
- package/dist/commonjs/components/ScrollView.js +18 -0
- package/dist/commonjs/components/ScrollView.js.map +1 -0
- package/dist/commonjs/components/Switch.js +6 -6
- package/dist/commonjs/components/Switch.js.map +1 -1
- package/dist/commonjs/components/Text.js +6 -6
- package/dist/commonjs/components/Text.js.map +1 -1
- package/dist/commonjs/components/TextInput.js +12 -7
- package/dist/commonjs/components/TextInput.js.map +1 -1
- package/dist/commonjs/components/TouchableHighlight.js +17 -0
- package/dist/commonjs/components/TouchableHighlight.js.map +1 -0
- package/dist/commonjs/components/TouchableOpacity.js +17 -0
- package/dist/commonjs/components/TouchableOpacity.js.map +1 -0
- package/dist/commonjs/components/TouchableWithoutFeedback.js +17 -0
- package/dist/commonjs/components/TouchableWithoutFeedback.js.map +1 -0
- package/dist/commonjs/components/View.js +6 -6
- package/dist/commonjs/components/View.js.map +1 -1
- package/dist/commonjs/components/VirtualizedList.js +20 -0
- package/dist/commonjs/components/VirtualizedList.js.map +1 -0
- package/dist/commonjs/components/copyComponentProperties.js +19 -0
- package/dist/commonjs/components/copyComponentProperties.js.map +1 -0
- package/dist/commonjs/components/index.cjs +265 -0
- package/dist/commonjs/components/index.cjs.map +1 -0
- package/dist/commonjs/components/index.js +65 -1
- package/dist/commonjs/components/index.js.map +1 -1
- package/dist/commonjs/index.js +0 -11
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/jest/index.js +1 -1
- package/dist/commonjs/jest/index.js.map +1 -1
- package/dist/commonjs/metro/index.js +7 -117
- package/dist/commonjs/metro/index.js.map +1 -1
- package/dist/commonjs/metro/metro-transformer.js +8 -1
- package/dist/commonjs/metro/metro-transformer.js.map +1 -1
- package/dist/commonjs/{native/metro.js → metro/override.js} +1 -1
- package/dist/commonjs/{native/metro.js.map → metro/override.js.map} +1 -1
- package/dist/commonjs/metro/resolver.js +15 -22
- package/dist/commonjs/metro/resolver.js.map +1 -1
- package/dist/commonjs/native/api.js +5 -1
- package/dist/commonjs/native/api.js.map +1 -1
- package/dist/commonjs/native/index.js +8 -8
- package/dist/commonjs/native/index.js.map +1 -1
- package/dist/commonjs/{poison.pill.js → native/react-native-css-metro-override.js} +1 -1
- package/dist/commonjs/native/react-native-css-metro-override.js.map +1 -0
- package/dist/commonjs/native/styles/calculate-props.js +1 -1
- package/dist/commonjs/native/styles/resolve.js +0 -1
- package/dist/commonjs/native/styles/resolve.js.map +1 -1
- package/dist/commonjs/native/styles/shorthands/animation.js +6 -2
- package/dist/commonjs/native/styles/shorthands/animation.js.map +1 -1
- package/dist/commonjs/web/api.js +5 -2
- package/dist/commonjs/web/api.js.map +1 -1
- package/dist/module/compiler/atRules.js +30 -16
- package/dist/module/compiler/atRules.js.map +1 -1
- package/dist/module/compiler/compiler.js +25 -15
- package/dist/module/compiler/compiler.js.map +1 -1
- package/dist/module/compiler/declarations.js +10 -10
- package/dist/module/compiler/declarations.js.map +1 -1
- package/dist/module/compiler/keyframes.js +1 -1
- package/dist/module/compiler/keyframes.js.map +1 -1
- package/dist/module/compiler/lightningcss-loader.js +36 -0
- package/dist/module/compiler/lightningcss-loader.js.map +1 -0
- package/dist/module/compiler/selector-builder.js +3 -2
- package/dist/module/compiler/selector-builder.js.map +1 -1
- package/dist/module/compiler/stylesheet.js +5 -7
- package/dist/module/compiler/stylesheet.js.map +1 -1
- package/dist/module/components/ActivityIndicator.js +4 -3
- package/dist/module/components/ActivityIndicator.js.map +1 -1
- package/dist/module/components/Button.js +4 -3
- package/dist/module/components/Button.js.map +1 -1
- package/dist/module/components/FlatList.js +8 -6
- package/dist/module/components/FlatList.js.map +1 -1
- package/dist/module/components/Image.js +4 -3
- package/dist/module/components/Image.js.map +1 -1
- package/dist/module/components/ImageBackground.js +18 -0
- package/dist/module/components/ImageBackground.js.map +1 -0
- package/dist/module/components/KeyboardAvoidingView.js +15 -0
- package/dist/module/components/KeyboardAvoidingView.js.map +1 -0
- package/dist/module/components/Pressable.js +13 -0
- package/dist/module/components/Pressable.js.map +1 -0
- package/dist/module/components/ScrollView.js +14 -0
- package/dist/module/components/ScrollView.js.map +1 -0
- package/dist/module/components/Switch.js +4 -3
- package/dist/module/components/Switch.js.map +1 -1
- package/dist/module/components/Text.js +4 -3
- package/dist/module/components/Text.js.map +1 -1
- package/dist/module/components/TextInput.js +10 -4
- package/dist/module/components/TextInput.js.map +1 -1
- package/dist/module/components/TouchableHighlight.js +13 -0
- package/dist/module/components/TouchableHighlight.js.map +1 -0
- package/dist/module/components/TouchableOpacity.js +13 -0
- package/dist/module/components/TouchableOpacity.js.map +1 -0
- package/dist/module/components/TouchableWithoutFeedback.js +13 -0
- package/dist/module/components/TouchableWithoutFeedback.js.map +1 -0
- package/dist/module/components/View.js +4 -3
- package/dist/module/components/View.js.map +1 -1
- package/dist/module/components/VirtualizedList.js +16 -0
- package/dist/module/components/VirtualizedList.js.map +1 -0
- package/dist/module/components/copyComponentProperties.js +15 -0
- package/dist/module/components/copyComponentProperties.js.map +1 -0
- package/dist/module/components/index.cjs +265 -0
- package/dist/module/components/index.cjs.map +1 -0
- package/dist/module/components/index.js +8 -0
- package/dist/module/components/index.js.map +1 -1
- package/dist/module/index.js +0 -1
- package/dist/module/index.js.map +1 -1
- package/dist/module/jest/index.js +1 -1
- package/dist/module/jest/index.js.map +1 -1
- package/dist/module/metro/index.js +7 -116
- package/dist/module/metro/index.js.map +1 -1
- package/dist/module/metro/metro-transformer.js +8 -1
- package/dist/module/metro/metro-transformer.js.map +1 -1
- package/dist/module/metro/override.js +4 -0
- package/dist/module/{native/metro.js.map → metro/override.js.map} +1 -1
- package/dist/module/metro/resolver.js +15 -22
- package/dist/module/metro/resolver.js.map +1 -1
- package/dist/module/native/api.js +4 -1
- package/dist/module/native/api.js.map +1 -1
- package/dist/module/native/index.js +1 -1
- package/dist/module/native/index.js.map +1 -1
- package/dist/module/{poison.pill.js → native/react-native-css-metro-override.js} +1 -1
- package/dist/module/native/react-native-css-metro-override.js.map +1 -0
- package/dist/module/native/styles/calculate-props.js +1 -1
- package/dist/module/native/styles/resolve.js +0 -1
- package/dist/module/native/styles/resolve.js.map +1 -1
- package/dist/module/native/styles/shorthands/animation.js +4 -1
- package/dist/module/native/styles/shorthands/animation.js.map +1 -1
- package/dist/module/web/api.js +5 -2
- package/dist/module/web/api.js.map +1 -1
- package/dist/typescript/commonjs/.config/eslint.config.d.mts +3 -0
- package/dist/typescript/commonjs/.config/eslint.config.d.mts.map +1 -0
- package/dist/typescript/commonjs/eslint.config.d.mts +2 -0
- package/dist/typescript/commonjs/eslint.config.d.mts.map +1 -0
- package/dist/typescript/commonjs/example/app.config.d.ts.map +1 -1
- package/dist/typescript/commonjs/example/index.d.ts +2 -0
- package/dist/typescript/commonjs/example/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/example/metro.config.d.ts +3 -0
- package/dist/typescript/commonjs/example/metro.config.d.ts.map +1 -0
- package/dist/typescript/commonjs/example/postcss.config.d.mts +7 -0
- package/dist/typescript/commonjs/example/postcss.config.d.mts.map +1 -0
- package/dist/typescript/commonjs/example/src/App.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/compiler.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/declarations.d.ts +1 -1
- package/dist/typescript/commonjs/src/compiler/keyframes.d.ts +1 -1
- package/dist/typescript/commonjs/src/compiler/keyframes.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/lightningcss-loader.d.ts +30 -0
- package/dist/typescript/commonjs/src/compiler/lightningcss-loader.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/compiler/selector-builder.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/stylesheet.d.ts +2 -1
- package/dist/typescript/commonjs/src/compiler/stylesheet.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/ActivityIndicator.d.ts +2 -11
- package/dist/typescript/commonjs/src/components/ActivityIndicator.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/Button.d.ts +2 -11
- package/dist/typescript/commonjs/src/components/Button.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/FlatList.d.ts +4 -8
- package/dist/typescript/commonjs/src/components/FlatList.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/Image.d.ts +2 -6
- package/dist/typescript/commonjs/src/components/Image.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/ImageBackground.d.ts +4 -0
- package/dist/typescript/commonjs/src/components/ImageBackground.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/KeyboardAvoidingView.d.ts +4 -0
- package/dist/typescript/commonjs/src/components/KeyboardAvoidingView.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/Pressable.d.ts +4 -0
- package/dist/typescript/commonjs/src/components/Pressable.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/ScrollView.d.ts +4 -0
- package/dist/typescript/commonjs/src/components/ScrollView.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/Switch.d.ts +2 -6
- package/dist/typescript/commonjs/src/components/Switch.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/Text.d.ts +2 -6
- package/dist/typescript/commonjs/src/components/Text.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/TextInput.d.ts +2 -6
- package/dist/typescript/commonjs/src/components/TextInput.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/TouchableHighlight.d.ts +4 -0
- package/dist/typescript/commonjs/src/components/TouchableHighlight.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/TouchableOpacity.d.ts +4 -0
- package/dist/typescript/commonjs/src/components/TouchableOpacity.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/TouchableWithoutFeedback.d.ts +4 -0
- package/dist/typescript/commonjs/src/components/TouchableWithoutFeedback.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/View.d.ts +2 -6
- package/dist/typescript/commonjs/src/components/View.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/VirtualizedList.d.ts +6 -0
- package/dist/typescript/commonjs/src/components/VirtualizedList.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/copyComponentProperties.d.ts +5 -0
- package/dist/typescript/commonjs/src/components/copyComponentProperties.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/index.d.cts +2 -0
- package/dist/typescript/commonjs/src/components/index.d.cts.map +1 -0
- package/dist/typescript/commonjs/src/components/index.d.ts +8 -0
- package/dist/typescript/commonjs/src/components/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/index.d.ts +0 -1
- package/dist/typescript/commonjs/src/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/jest/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/metro/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/metro/metro-transformer.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/metro/override.d.ts +2 -0
- package/dist/typescript/commonjs/src/metro/override.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/metro/resolver.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/api.d.ts +1 -1
- package/dist/typescript/commonjs/src/native/api.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/index.d.ts +1 -1
- package/dist/typescript/commonjs/src/native/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/react-native-css-metro-override.d.ts +2 -0
- package/dist/typescript/commonjs/src/native/react-native-css-metro-override.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/native/styles/resolve.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/shorthands/animation.d.ts +1 -0
- package/dist/typescript/commonjs/src/native/styles/shorthands/animation.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/utilities/dot-notation.types.d.ts +1 -1
- package/dist/typescript/commonjs/src/utilities/dot-notation.types.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/web/api.d.ts +2 -2
- package/dist/typescript/commonjs/src/web/api.d.ts.map +1 -1
- package/dist/typescript/module/.config/eslint.config.d.mts +3 -0
- package/dist/typescript/module/.config/eslint.config.d.mts.map +1 -0
- package/dist/typescript/module/eslint.config.d.mts +2 -0
- package/dist/typescript/module/eslint.config.d.mts.map +1 -0
- package/dist/typescript/module/example/app.config.d.ts.map +1 -1
- package/dist/typescript/module/example/index.d.ts +2 -0
- package/dist/typescript/module/example/index.d.ts.map +1 -0
- package/dist/typescript/module/example/metro.config.d.ts +3 -0
- package/dist/typescript/module/example/metro.config.d.ts.map +1 -0
- package/dist/typescript/module/example/postcss.config.d.mts +7 -0
- package/dist/typescript/module/example/postcss.config.d.mts.map +1 -0
- package/dist/typescript/module/example/src/App.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/compiler.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/declarations.d.ts +1 -1
- package/dist/typescript/module/src/compiler/keyframes.d.ts +1 -1
- package/dist/typescript/module/src/compiler/keyframes.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/lightningcss-loader.d.ts +30 -0
- package/dist/typescript/module/src/compiler/lightningcss-loader.d.ts.map +1 -0
- package/dist/typescript/module/src/compiler/selector-builder.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/stylesheet.d.ts +2 -1
- package/dist/typescript/module/src/compiler/stylesheet.d.ts.map +1 -1
- package/dist/typescript/module/src/components/ActivityIndicator.d.ts +2 -11
- package/dist/typescript/module/src/components/ActivityIndicator.d.ts.map +1 -1
- package/dist/typescript/module/src/components/Button.d.ts +2 -11
- package/dist/typescript/module/src/components/Button.d.ts.map +1 -1
- package/dist/typescript/module/src/components/FlatList.d.ts +4 -8
- package/dist/typescript/module/src/components/FlatList.d.ts.map +1 -1
- package/dist/typescript/module/src/components/Image.d.ts +2 -6
- package/dist/typescript/module/src/components/Image.d.ts.map +1 -1
- package/dist/typescript/module/src/components/ImageBackground.d.ts +4 -0
- package/dist/typescript/module/src/components/ImageBackground.d.ts.map +1 -0
- package/dist/typescript/module/src/components/KeyboardAvoidingView.d.ts +4 -0
- package/dist/typescript/module/src/components/KeyboardAvoidingView.d.ts.map +1 -0
- package/dist/typescript/module/src/components/Pressable.d.ts +4 -0
- package/dist/typescript/module/src/components/Pressable.d.ts.map +1 -0
- package/dist/typescript/module/src/components/ScrollView.d.ts +4 -0
- package/dist/typescript/module/src/components/ScrollView.d.ts.map +1 -0
- package/dist/typescript/module/src/components/Switch.d.ts +2 -6
- package/dist/typescript/module/src/components/Switch.d.ts.map +1 -1
- package/dist/typescript/module/src/components/Text.d.ts +2 -6
- package/dist/typescript/module/src/components/Text.d.ts.map +1 -1
- package/dist/typescript/module/src/components/TextInput.d.ts +2 -6
- package/dist/typescript/module/src/components/TextInput.d.ts.map +1 -1
- package/dist/typescript/module/src/components/TouchableHighlight.d.ts +4 -0
- package/dist/typescript/module/src/components/TouchableHighlight.d.ts.map +1 -0
- package/dist/typescript/module/src/components/TouchableOpacity.d.ts +4 -0
- package/dist/typescript/module/src/components/TouchableOpacity.d.ts.map +1 -0
- package/dist/typescript/module/src/components/TouchableWithoutFeedback.d.ts +4 -0
- package/dist/typescript/module/src/components/TouchableWithoutFeedback.d.ts.map +1 -0
- package/dist/typescript/module/src/components/View.d.ts +2 -6
- package/dist/typescript/module/src/components/View.d.ts.map +1 -1
- package/dist/typescript/module/src/components/VirtualizedList.d.ts +6 -0
- package/dist/typescript/module/src/components/VirtualizedList.d.ts.map +1 -0
- package/dist/typescript/module/src/components/copyComponentProperties.d.ts +5 -0
- package/dist/typescript/module/src/components/copyComponentProperties.d.ts.map +1 -0
- package/dist/typescript/module/src/components/index.d.cts +2 -0
- package/dist/typescript/module/src/components/index.d.cts.map +1 -0
- package/dist/typescript/module/src/components/index.d.ts +8 -0
- package/dist/typescript/module/src/components/index.d.ts.map +1 -1
- package/dist/typescript/module/src/index.d.ts +0 -1
- package/dist/typescript/module/src/index.d.ts.map +1 -1
- package/dist/typescript/module/src/jest/index.d.ts.map +1 -1
- package/dist/typescript/module/src/metro/index.d.ts.map +1 -1
- package/dist/typescript/module/src/metro/metro-transformer.d.ts.map +1 -1
- package/dist/typescript/module/src/metro/override.d.ts +2 -0
- package/dist/typescript/module/src/metro/override.d.ts.map +1 -0
- package/dist/typescript/module/src/metro/resolver.d.ts.map +1 -1
- package/dist/typescript/module/src/native/api.d.ts +1 -1
- package/dist/typescript/module/src/native/api.d.ts.map +1 -1
- package/dist/typescript/module/src/native/index.d.ts +1 -1
- package/dist/typescript/module/src/native/index.d.ts.map +1 -1
- package/dist/typescript/module/src/native/react-native-css-metro-override.d.ts +2 -0
- package/dist/typescript/module/src/native/react-native-css-metro-override.d.ts.map +1 -0
- package/dist/typescript/module/src/native/styles/resolve.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/shorthands/animation.d.ts +1 -0
- package/dist/typescript/module/src/native/styles/shorthands/animation.d.ts.map +1 -1
- package/dist/typescript/module/src/utilities/dot-notation.types.d.ts +1 -1
- package/dist/typescript/module/src/utilities/dot-notation.types.d.ts.map +1 -1
- package/dist/typescript/module/src/web/api.d.ts +2 -2
- package/dist/typescript/module/src/web/api.d.ts.map +1 -1
- package/package.json +16 -18
- package/src/compiler/atRules.ts +30 -17
- package/src/compiler/compiler.ts +27 -16
- package/src/compiler/declarations.ts +10 -10
- package/src/compiler/keyframes.ts +2 -2
- package/src/compiler/lightningcss-loader.ts +40 -0
- package/src/compiler/selector-builder.ts +6 -2
- package/src/compiler/stylesheet.ts +5 -7
- package/src/components/ActivityIndicator.tsx +11 -8
- package/src/components/Button.tsx +11 -6
- package/src/components/FlatList.tsx +20 -10
- package/src/components/Image.tsx +11 -6
- package/src/components/ImageBackground.tsx +30 -0
- package/src/components/KeyboardAvoidingView.tsx +27 -0
- package/src/components/Pressable.tsx +22 -0
- package/src/components/ScrollView.tsx +23 -0
- package/src/components/Switch.tsx +9 -4
- package/src/components/Text.tsx +9 -4
- package/src/components/TextInput.tsx +17 -7
- package/src/components/TouchableHighlight.tsx +25 -0
- package/src/components/TouchableOpacity.tsx +25 -0
- package/src/components/TouchableWithoutFeedback.tsx +25 -0
- package/src/components/View.tsx +9 -4
- package/src/components/VirtualizedList.tsx +37 -0
- package/src/components/copyComponentProperties.ts +21 -0
- package/src/components/index.cts +263 -0
- package/src/components/index.ts +17 -0
- package/src/index.ts +0 -2
- package/src/jest/index.ts +2 -1
- package/src/metro/index.ts +7 -165
- package/src/metro/metro-transformer.ts +15 -1
- package/src/metro/override.ts +1 -0
- package/src/metro/resolver.ts +29 -28
- package/src/native/api.tsx +6 -2
- package/src/native/index.ts +1 -2
- package/src/native/styles/calculate-props.ts +1 -1
- package/src/native/styles/resolve.ts +0 -1
- package/src/native/styles/shorthands/animation.ts +10 -2
- package/src/utilities/dot-notation.types.ts +10 -3
- package/src/web/api.tsx +9 -4
- package/dist/commonjs/poison.pill.js.map +0 -1
- package/dist/commonjs/runtime/native/injection.js +0 -2
- package/dist/commonjs/runtime/native/injection.js.map +0 -1
- package/dist/module/native/metro.js +0 -5
- package/dist/module/poison.pill.js.map +0 -1
- package/dist/module/runtime/native/injection.js +0 -2
- package/dist/module/runtime/native/injection.js.map +0 -1
- package/dist/typescript/commonjs/src/native/metro.d.ts +0 -2
- package/dist/typescript/commonjs/src/native/metro.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/poison.pill.d.ts +0 -2
- package/dist/typescript/commonjs/src/poison.pill.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/runtime/native/injection.d.ts +0 -1
- package/dist/typescript/commonjs/src/runtime/native/injection.d.ts.map +0 -1
- package/dist/typescript/module/src/native/metro.d.ts +0 -2
- package/dist/typescript/module/src/native/metro.d.ts.map +0 -1
- package/dist/typescript/module/src/poison.pill.d.ts +0 -2
- package/dist/typescript/module/src/poison.pill.d.ts.map +0 -1
- package/dist/typescript/module/src/runtime/native/injection.d.ts +0 -1
- package/dist/typescript/module/src/runtime/native/injection.d.ts.map +0 -1
- package/src/components/index.tsx +0 -10
- package/src/native/metro.ts +0 -2
- package/src/runtime/native/injection.ts +0 -0
- /package/src/{poison.pill.ts → native/react-native-css-metro-override.ts} +0 -0
|
@@ -1984,11 +1984,11 @@ export function parseTextShadow(
|
|
|
1984
1984
|
parseColor(textShadow.color, builder),
|
|
1985
1985
|
);
|
|
1986
1986
|
builder.addDescriptor(
|
|
1987
|
-
"
|
|
1987
|
+
"&.textShadowOffset.width",
|
|
1988
1988
|
parseLength(textShadow.xOffset, builder),
|
|
1989
1989
|
);
|
|
1990
1990
|
builder.addDescriptor(
|
|
1991
|
-
"
|
|
1991
|
+
"&.textShadowOffset.height",
|
|
1992
1992
|
parseLength(textShadow.yOffset, builder),
|
|
1993
1993
|
);
|
|
1994
1994
|
builder.addDescriptor(
|
|
@@ -2374,27 +2374,27 @@ export function parseBoxShadow(
|
|
|
2374
2374
|
) {
|
|
2375
2375
|
for (const [index, shadow] of value.entries()) {
|
|
2376
2376
|
builder.addDescriptor(
|
|
2377
|
-
|
|
2377
|
+
`&.boxShadow.[${index}].color`,
|
|
2378
2378
|
parseColor(shadow.color, builder),
|
|
2379
2379
|
);
|
|
2380
2380
|
builder.addDescriptor(
|
|
2381
|
-
|
|
2381
|
+
`&.boxShadow.[${index}].offsetX`,
|
|
2382
2382
|
parseLength(shadow.xOffset, builder),
|
|
2383
2383
|
);
|
|
2384
2384
|
builder.addDescriptor(
|
|
2385
|
-
|
|
2385
|
+
`&.boxShadow.[${index}].offsetY`,
|
|
2386
2386
|
parseLength(shadow.yOffset, builder),
|
|
2387
2387
|
);
|
|
2388
2388
|
builder.addDescriptor(
|
|
2389
|
-
|
|
2389
|
+
`&.boxShadow.[${index}].blurRadius`,
|
|
2390
2390
|
parseLength(shadow.blur, builder),
|
|
2391
2391
|
);
|
|
2392
2392
|
builder.addDescriptor(
|
|
2393
|
-
|
|
2393
|
+
`&.boxShadow.[${index}].spreadDistance`,
|
|
2394
2394
|
parseLength(shadow.spread, builder),
|
|
2395
2395
|
);
|
|
2396
2396
|
builder.addDescriptor(
|
|
2397
|
-
|
|
2397
|
+
`&.boxShadow.[${index}].inset`,
|
|
2398
2398
|
shadow.inset ? true : undefined,
|
|
2399
2399
|
);
|
|
2400
2400
|
}
|
|
@@ -3088,7 +3088,7 @@ function parseObjectFit(
|
|
|
3088
3088
|
builder: StylesheetBuilder,
|
|
3089
3089
|
) {
|
|
3090
3090
|
builder.addMapping({
|
|
3091
|
-
"object-fit": "contentFit",
|
|
3091
|
+
"object-fit": ["contentFit"],
|
|
3092
3092
|
});
|
|
3093
3093
|
builder.addDescriptor(
|
|
3094
3094
|
"object-fit",
|
|
@@ -3101,7 +3101,7 @@ function parseObjectPosition(
|
|
|
3101
3101
|
builder: StylesheetBuilder,
|
|
3102
3102
|
) {
|
|
3103
3103
|
builder.addMapping({
|
|
3104
|
-
"object-position": "contentPosition",
|
|
3104
|
+
"object-position": ["contentPosition"],
|
|
3105
3105
|
});
|
|
3106
3106
|
builder.addDescriptor("object-position", [
|
|
3107
3107
|
{},
|
|
@@ -10,9 +10,9 @@ import type { StylesheetBuilder } from "./stylesheet";
|
|
|
10
10
|
|
|
11
11
|
export function parseIterationCount(
|
|
12
12
|
value: AnimationIterationCount[],
|
|
13
|
-
): number[] {
|
|
13
|
+
): (number | "infinite")[] {
|
|
14
14
|
return value.map((value) => {
|
|
15
|
-
return value.type === "infinite" ?
|
|
15
|
+
return value.type === "infinite" ? value.type : value.value;
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
18
|
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export function lightningcssLoader() {
|
|
2
|
+
let lightningcssPath: string | undefined;
|
|
3
|
+
|
|
4
|
+
// Try to resolve the path to lightningcss from the @expo/metro-config package
|
|
5
|
+
// lightningcss is a direct dependency of @expo/metro-config
|
|
6
|
+
try {
|
|
7
|
+
lightningcssPath = require.resolve("lightningcss", {
|
|
8
|
+
paths: [
|
|
9
|
+
require
|
|
10
|
+
.resolve("@expo/metro-config/package.json")
|
|
11
|
+
.replace("/package.json", ""),
|
|
12
|
+
],
|
|
13
|
+
});
|
|
14
|
+
} catch {
|
|
15
|
+
// Intentionally left empty
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// If @expo/metro-config is not being used (non-metro bundler?), try and resolve it directly
|
|
19
|
+
try {
|
|
20
|
+
lightningcssPath ??= require.resolve("lightningcss");
|
|
21
|
+
} catch {
|
|
22
|
+
// Intentionally left empty
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (!lightningcssPath) {
|
|
26
|
+
throw new Error(
|
|
27
|
+
"react-native-css was unable to determine the path to lightningcss",
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
32
|
+
const { transform: lightningcss, Features } = require(
|
|
33
|
+
lightningcssPath,
|
|
34
|
+
) as typeof import("lightningcss");
|
|
35
|
+
|
|
36
|
+
return {
|
|
37
|
+
lightningcss,
|
|
38
|
+
Features,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
@@ -557,9 +557,13 @@ function getMediaQuery(
|
|
|
557
557
|
return mediaQuery;
|
|
558
558
|
}
|
|
559
559
|
|
|
560
|
-
function isRootVariableSelector([first,
|
|
560
|
+
function isRootVariableSelector([first, ...rest]: Selector) {
|
|
561
|
+
rest = rest.filter((item) => item.type !== "nesting");
|
|
561
562
|
return (
|
|
562
|
-
first &&
|
|
563
|
+
first &&
|
|
564
|
+
rest.length === 0 &&
|
|
565
|
+
first.type === "pseudo-class" &&
|
|
566
|
+
first.kind === "root"
|
|
563
567
|
);
|
|
564
568
|
}
|
|
565
569
|
|
|
@@ -56,7 +56,7 @@ export class StylesheetBuilder {
|
|
|
56
56
|
private ruleTemplate: StyleRule = {
|
|
57
57
|
s: [],
|
|
58
58
|
},
|
|
59
|
-
// Any default mapping should be included in the @
|
|
59
|
+
// Any default mapping should be included in the @nativeMapping parsing
|
|
60
60
|
private mapping: StyleRuleMapping = {},
|
|
61
61
|
public descriptorProperty?: string,
|
|
62
62
|
private shared: {
|
|
@@ -263,8 +263,8 @@ export class StylesheetBuilder {
|
|
|
263
263
|
}
|
|
264
264
|
|
|
265
265
|
/** Used by nested declarations (for example @media inside a RuleSet) */
|
|
266
|
-
newNestedRule({ important = false } = {}) {
|
|
267
|
-
this.newRule(
|
|
266
|
+
newNestedRule({ important = false, mapping = this.mapping } = {}) {
|
|
267
|
+
this.newRule(mapping, { important });
|
|
268
268
|
}
|
|
269
269
|
|
|
270
270
|
/** Hack for light-dark, which requires adding a new rule without changing the current rule */
|
|
@@ -403,12 +403,10 @@ export class StylesheetBuilder {
|
|
|
403
403
|
} else {
|
|
404
404
|
forceTuple = true;
|
|
405
405
|
}
|
|
406
|
-
} else if (propPath) {
|
|
407
|
-
forceTuple = true;
|
|
408
|
-
} else {
|
|
409
|
-
propPath = property;
|
|
410
406
|
}
|
|
411
407
|
|
|
408
|
+
propPath ??= property;
|
|
409
|
+
|
|
412
410
|
if (forceTuple && !Array.isArray(propPath)) {
|
|
413
411
|
propPath = [propPath];
|
|
414
412
|
}
|
|
@@ -7,21 +7,24 @@ import {
|
|
|
7
7
|
useCssElement,
|
|
8
8
|
type StyledConfiguration,
|
|
9
9
|
type StyledProps,
|
|
10
|
-
} from "
|
|
10
|
+
} from "react-native-css";
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
import { copyComponentProperties } from "./copyComponentProperties";
|
|
13
|
+
|
|
14
|
+
const mapping: StyledConfiguration<typeof RNActivityIndicator> = {
|
|
13
15
|
className: {
|
|
14
16
|
target: "style",
|
|
15
17
|
nativeStyleMapping: {
|
|
16
18
|
color: "color",
|
|
17
19
|
},
|
|
18
20
|
},
|
|
19
|
-
}
|
|
21
|
+
};
|
|
20
22
|
|
|
21
|
-
export
|
|
22
|
-
|
|
23
|
-
) {
|
|
24
|
-
|
|
25
|
-
}
|
|
23
|
+
export const ActivityIndicator = copyComponentProperties(
|
|
24
|
+
RNActivityIndicator,
|
|
25
|
+
(props: StyledProps<ActivityIndicatorProps, typeof mapping>) => {
|
|
26
|
+
return useCssElement(RNActivityIndicator, props, mapping);
|
|
27
|
+
},
|
|
28
|
+
);
|
|
26
29
|
|
|
27
30
|
export default ActivityIndicator;
|
|
@@ -4,19 +4,24 @@ import {
|
|
|
4
4
|
useCssElement,
|
|
5
5
|
type StyledConfiguration,
|
|
6
6
|
type StyledProps,
|
|
7
|
-
} from "
|
|
7
|
+
} from "react-native-css";
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
import { copyComponentProperties } from "./copyComponentProperties";
|
|
10
|
+
|
|
11
|
+
const mapping: StyledConfiguration<typeof RNButton> = {
|
|
10
12
|
className: {
|
|
11
13
|
target: false,
|
|
12
14
|
nativeStyleMapping: {
|
|
13
15
|
color: "color",
|
|
14
16
|
},
|
|
15
17
|
},
|
|
16
|
-
}
|
|
18
|
+
};
|
|
17
19
|
|
|
18
|
-
export
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
export const Button = copyComponentProperties(
|
|
21
|
+
RNButton,
|
|
22
|
+
(props: StyledProps<ButtonProps, typeof mapping>) => {
|
|
23
|
+
return useCssElement(RNButton, props, mapping);
|
|
24
|
+
},
|
|
25
|
+
);
|
|
21
26
|
|
|
22
27
|
export default Button;
|
|
@@ -1,21 +1,31 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
1
2
|
import { FlatList as RNFlatList, type FlatListProps } from "react-native";
|
|
2
3
|
|
|
3
4
|
import {
|
|
4
5
|
useCssElement,
|
|
5
6
|
type StyledConfiguration,
|
|
6
7
|
type StyledProps,
|
|
7
|
-
} from "
|
|
8
|
+
} from "react-native-css";
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
columnWrapperStyle: "columnWrapperStyle",
|
|
11
|
-
listFooterComponentClassName: "ListFooterComponentStyle",
|
|
12
|
-
listHeaderComponentClassName: "ListHeaderComponentStyle",
|
|
13
|
-
} satisfies StyledConfiguration<typeof RNFlatList>;
|
|
10
|
+
import { copyComponentProperties } from "./copyComponentProperties";
|
|
14
11
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
const mapping: StyledConfiguration<typeof RNFlatList> = {
|
|
13
|
+
ListFooterComponentClassName: "ListFooterComponentStyle",
|
|
14
|
+
ListHeaderComponentClassName: "ListHeaderComponentStyle",
|
|
15
|
+
columnWrapperClassName: "columnWrapperStyle",
|
|
16
|
+
contentContainerClassName: "contentContainerStyle",
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const FlatList = copyComponentProperties(RNFlatList, function <
|
|
20
|
+
ItemT,
|
|
21
|
+
>(props: StyledProps<FlatListProps<ItemT>, typeof mapping>) {
|
|
18
22
|
return useCssElement(RNFlatList, props, mapping);
|
|
19
|
-
}
|
|
23
|
+
}) as unknown as typeof RNFlatList &
|
|
24
|
+
(<ItemT>(
|
|
25
|
+
props: StyledProps<
|
|
26
|
+
FlatListProps<ItemT>,
|
|
27
|
+
StyledConfiguration<typeof RNFlatList>
|
|
28
|
+
>,
|
|
29
|
+
) => ReactNode);
|
|
20
30
|
|
|
21
31
|
export default FlatList;
|
package/src/components/Image.tsx
CHANGED
|
@@ -4,14 +4,19 @@ import {
|
|
|
4
4
|
useCssElement,
|
|
5
5
|
type StyledConfiguration,
|
|
6
6
|
type StyledProps,
|
|
7
|
-
} from "
|
|
7
|
+
} from "react-native-css";
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
import { copyComponentProperties } from "./copyComponentProperties";
|
|
10
|
+
|
|
11
|
+
const mapping: StyledConfiguration<typeof RNImage> = {
|
|
10
12
|
className: "style",
|
|
11
|
-
}
|
|
13
|
+
};
|
|
12
14
|
|
|
13
|
-
export
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
export const Image = copyComponentProperties(
|
|
16
|
+
RNImage,
|
|
17
|
+
(props: StyledProps<ImageProps, typeof mapping>) => {
|
|
18
|
+
return useCssElement(RNImage, props, mapping);
|
|
19
|
+
},
|
|
20
|
+
);
|
|
16
21
|
|
|
17
22
|
export default Image;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ImageBackground as RNImageBackground,
|
|
3
|
+
type ImageBackgroundProps,
|
|
4
|
+
} from "react-native";
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
useCssElement,
|
|
8
|
+
type StyledConfiguration,
|
|
9
|
+
type StyledProps,
|
|
10
|
+
} from "react-native-css";
|
|
11
|
+
|
|
12
|
+
import { copyComponentProperties } from "./copyComponentProperties";
|
|
13
|
+
|
|
14
|
+
const mapping: StyledConfiguration<typeof RNImageBackground> = {
|
|
15
|
+
className: {
|
|
16
|
+
target: "style",
|
|
17
|
+
nativeStyleMapping: {
|
|
18
|
+
backgroundColor: true,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const ImageBackground = copyComponentProperties(
|
|
24
|
+
RNImageBackground,
|
|
25
|
+
(props: StyledProps<ImageBackgroundProps, typeof mapping>) => {
|
|
26
|
+
return useCssElement(RNImageBackground, props, mapping);
|
|
27
|
+
},
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
export default ImageBackground;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import {
|
|
2
|
+
KeyboardAvoidingView as RNKeyboardAvoidingView,
|
|
3
|
+
type KeyboardAvoidingViewProps,
|
|
4
|
+
} from "react-native";
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
useCssElement,
|
|
8
|
+
type StyledConfiguration,
|
|
9
|
+
type StyledProps,
|
|
10
|
+
} from "react-native-css";
|
|
11
|
+
|
|
12
|
+
import { copyComponentProperties } from "./copyComponentProperties";
|
|
13
|
+
|
|
14
|
+
const mapping: StyledConfiguration<typeof RNKeyboardAvoidingView> = {
|
|
15
|
+
className: {
|
|
16
|
+
target: "style",
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export const KeyboardAvoidingView = copyComponentProperties(
|
|
21
|
+
RNKeyboardAvoidingView,
|
|
22
|
+
(props: StyledProps<KeyboardAvoidingViewProps, typeof mapping>) => {
|
|
23
|
+
return useCssElement(RNKeyboardAvoidingView, props, mapping);
|
|
24
|
+
},
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
export default KeyboardAvoidingView;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Pressable as RNPressable, type PressableProps } from "react-native";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
useCssElement,
|
|
5
|
+
type StyledConfiguration,
|
|
6
|
+
type StyledProps,
|
|
7
|
+
} from "react-native-css";
|
|
8
|
+
|
|
9
|
+
import { copyComponentProperties } from "./copyComponentProperties";
|
|
10
|
+
|
|
11
|
+
const mapping: StyledConfiguration<typeof RNPressable> = {
|
|
12
|
+
className: "style",
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const Pressable = copyComponentProperties(
|
|
16
|
+
RNPressable,
|
|
17
|
+
(props: StyledProps<PressableProps, typeof mapping>) => {
|
|
18
|
+
return useCssElement(RNPressable, props, mapping);
|
|
19
|
+
},
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
export default Pressable;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ScrollView as RNScrollView, type ScrollViewProps } from "react-native";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
useCssElement,
|
|
5
|
+
type StyledConfiguration,
|
|
6
|
+
type StyledProps,
|
|
7
|
+
} from "react-native-css";
|
|
8
|
+
|
|
9
|
+
import { copyComponentProperties } from "./copyComponentProperties";
|
|
10
|
+
|
|
11
|
+
const mapping: StyledConfiguration<typeof RNScrollView> = {
|
|
12
|
+
className: "style",
|
|
13
|
+
contentContainerClassName: "contentContainerStyle",
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const ScrollView = copyComponentProperties(
|
|
17
|
+
RNScrollView,
|
|
18
|
+
(props: StyledProps<ScrollViewProps, typeof mapping>) => {
|
|
19
|
+
return useCssElement(RNScrollView, props, mapping);
|
|
20
|
+
},
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
export default ScrollView;
|
|
@@ -4,14 +4,19 @@ import {
|
|
|
4
4
|
useCssElement,
|
|
5
5
|
type StyledConfiguration,
|
|
6
6
|
type StyledProps,
|
|
7
|
-
} from "
|
|
7
|
+
} from "react-native-css";
|
|
8
|
+
|
|
9
|
+
import { copyComponentProperties } from "./copyComponentProperties";
|
|
8
10
|
|
|
9
11
|
const mapping = {
|
|
10
12
|
className: "style",
|
|
11
13
|
} satisfies StyledConfiguration<typeof RNSwitch>;
|
|
12
14
|
|
|
13
|
-
export
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
export const Switch = copyComponentProperties(
|
|
16
|
+
RNSwitch,
|
|
17
|
+
(props: StyledProps<SwitchProps, typeof mapping>) => {
|
|
18
|
+
return useCssElement(RNSwitch, props, mapping);
|
|
19
|
+
},
|
|
20
|
+
);
|
|
16
21
|
|
|
17
22
|
export default Switch;
|
package/src/components/Text.tsx
CHANGED
|
@@ -4,14 +4,19 @@ import {
|
|
|
4
4
|
useCssElement,
|
|
5
5
|
type StyledConfiguration,
|
|
6
6
|
type StyledProps,
|
|
7
|
-
} from "react-native-css
|
|
7
|
+
} from "react-native-css";
|
|
8
|
+
|
|
9
|
+
import { copyComponentProperties } from "./copyComponentProperties";
|
|
8
10
|
|
|
9
11
|
const mapping = {
|
|
10
12
|
className: "style",
|
|
11
13
|
} satisfies StyledConfiguration<typeof RNText>;
|
|
12
14
|
|
|
13
|
-
export
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
export const Text = copyComponentProperties(
|
|
16
|
+
RNText,
|
|
17
|
+
(props: StyledProps<TextProps, typeof mapping>) => {
|
|
18
|
+
return useCssElement(RNText, props, mapping);
|
|
19
|
+
},
|
|
20
|
+
);
|
|
16
21
|
|
|
17
22
|
export default Text;
|
|
@@ -4,14 +4,24 @@ import {
|
|
|
4
4
|
useCssElement,
|
|
5
5
|
type StyledConfiguration,
|
|
6
6
|
type StyledProps,
|
|
7
|
-
} from "
|
|
7
|
+
} from "react-native-css";
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
className: "style",
|
|
11
|
-
} satisfies StyledConfiguration<typeof RNTextInput>;
|
|
9
|
+
import { copyComponentProperties } from "./copyComponentProperties";
|
|
12
10
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
const mapping: StyledConfiguration<typeof RNTextInput> = {
|
|
12
|
+
className: {
|
|
13
|
+
target: "style",
|
|
14
|
+
nativeStyleMapping: {
|
|
15
|
+
textAlign: true,
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export const TextInput = copyComponentProperties(
|
|
21
|
+
RNTextInput,
|
|
22
|
+
(props: StyledProps<TextInputProps, typeof mapping>) => {
|
|
23
|
+
return useCssElement(RNTextInput, props, mapping);
|
|
24
|
+
},
|
|
25
|
+
);
|
|
16
26
|
|
|
17
27
|
export default TextInput;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import {
|
|
2
|
+
TouchableHighlight as RNTouchableHighlight,
|
|
3
|
+
type TouchableHighlightProps,
|
|
4
|
+
} from "react-native";
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
useCssElement,
|
|
8
|
+
type StyledConfiguration,
|
|
9
|
+
type StyledProps,
|
|
10
|
+
} from "react-native-css";
|
|
11
|
+
|
|
12
|
+
import { copyComponentProperties } from "./copyComponentProperties";
|
|
13
|
+
|
|
14
|
+
const mapping: StyledConfiguration<typeof RNTouchableHighlight> = {
|
|
15
|
+
className: "style",
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const TouchableHighlight = copyComponentProperties(
|
|
19
|
+
RNTouchableHighlight,
|
|
20
|
+
(props: StyledProps<TouchableHighlightProps, typeof mapping>) => {
|
|
21
|
+
return useCssElement(RNTouchableHighlight, props, mapping);
|
|
22
|
+
},
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
export default TouchableHighlight;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import {
|
|
2
|
+
TouchableOpacity as RNTouchableOpacity,
|
|
3
|
+
type TouchableOpacityProps,
|
|
4
|
+
} from "react-native";
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
useCssElement,
|
|
8
|
+
type StyledConfiguration,
|
|
9
|
+
type StyledProps,
|
|
10
|
+
} from "react-native-css";
|
|
11
|
+
|
|
12
|
+
import { copyComponentProperties } from "./copyComponentProperties";
|
|
13
|
+
|
|
14
|
+
const mapping: StyledConfiguration<typeof RNTouchableOpacity> = {
|
|
15
|
+
className: "style",
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const TouchableOpacity = copyComponentProperties(
|
|
19
|
+
RNTouchableOpacity,
|
|
20
|
+
(props: StyledProps<TouchableOpacityProps, typeof mapping>) => {
|
|
21
|
+
return useCssElement(RNTouchableOpacity, props, mapping);
|
|
22
|
+
},
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
export default TouchableOpacity;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import {
|
|
2
|
+
TouchableWithoutFeedback as RNTouchableWithoutFeedback,
|
|
3
|
+
type TouchableWithoutFeedbackProps,
|
|
4
|
+
} from "react-native";
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
useCssElement,
|
|
8
|
+
type StyledConfiguration,
|
|
9
|
+
type StyledProps,
|
|
10
|
+
} from "react-native-css";
|
|
11
|
+
|
|
12
|
+
import { copyComponentProperties } from "./copyComponentProperties";
|
|
13
|
+
|
|
14
|
+
const mapping: StyledConfiguration<typeof RNTouchableWithoutFeedback> = {
|
|
15
|
+
className: "style",
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const TouchableWithoutFeedback = copyComponentProperties(
|
|
19
|
+
RNTouchableWithoutFeedback,
|
|
20
|
+
(props: StyledProps<TouchableWithoutFeedbackProps, typeof mapping>) => {
|
|
21
|
+
return useCssElement(RNTouchableWithoutFeedback, props, mapping);
|
|
22
|
+
},
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
export default TouchableWithoutFeedback;
|
package/src/components/View.tsx
CHANGED
|
@@ -4,14 +4,19 @@ import {
|
|
|
4
4
|
useCssElement,
|
|
5
5
|
type StyledConfiguration,
|
|
6
6
|
type StyledProps,
|
|
7
|
-
} from "react-native-css
|
|
7
|
+
} from "react-native-css";
|
|
8
|
+
|
|
9
|
+
import { copyComponentProperties } from "./copyComponentProperties";
|
|
8
10
|
|
|
9
11
|
const mapping = {
|
|
10
12
|
className: "style",
|
|
11
13
|
} satisfies StyledConfiguration<typeof RNView>;
|
|
12
14
|
|
|
13
|
-
export
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
export const View = copyComponentProperties(
|
|
16
|
+
RNView,
|
|
17
|
+
(props: StyledProps<ViewProps, typeof mapping>) => {
|
|
18
|
+
return useCssElement(RNView, props, mapping);
|
|
19
|
+
},
|
|
20
|
+
);
|
|
16
21
|
|
|
17
22
|
export default View;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import {
|
|
3
|
+
VirtualizedList as RNVirtualizedList,
|
|
4
|
+
type VirtualizedListProps,
|
|
5
|
+
} from "react-native";
|
|
6
|
+
|
|
7
|
+
import {
|
|
8
|
+
useCssElement,
|
|
9
|
+
type StyledConfiguration,
|
|
10
|
+
type StyledProps,
|
|
11
|
+
} from "react-native-css";
|
|
12
|
+
|
|
13
|
+
import { copyComponentProperties } from "./copyComponentProperties";
|
|
14
|
+
|
|
15
|
+
const mapping: StyledConfiguration<typeof RNVirtualizedList> = {
|
|
16
|
+
className: "style",
|
|
17
|
+
ListFooterComponentClassName: "ListFooterComponentStyle",
|
|
18
|
+
ListHeaderComponentClassName: "ListHeaderComponentStyle",
|
|
19
|
+
contentContainerClassName: "contentContainerStyle",
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const VirtualizedList = copyComponentProperties(
|
|
23
|
+
RNVirtualizedList,
|
|
24
|
+
function <ItemT>(
|
|
25
|
+
props: StyledProps<VirtualizedListProps<ItemT>, typeof mapping>,
|
|
26
|
+
) {
|
|
27
|
+
return useCssElement(RNVirtualizedList, props, mapping);
|
|
28
|
+
},
|
|
29
|
+
) as unknown as typeof RNVirtualizedList &
|
|
30
|
+
(<ItemT>(
|
|
31
|
+
props: StyledProps<
|
|
32
|
+
VirtualizedListProps<ItemT>,
|
|
33
|
+
StyledConfiguration<typeof RNVirtualizedList>
|
|
34
|
+
>,
|
|
35
|
+
) => ReactNode);
|
|
36
|
+
|
|
37
|
+
export default VirtualizedList;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ComponentType } from "react";
|
|
2
|
+
|
|
3
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4
|
+
type AnyComponent = ComponentType<any>;
|
|
5
|
+
|
|
6
|
+
export function copyComponentProperties<T extends AnyComponent>(
|
|
7
|
+
BaseComponent: T,
|
|
8
|
+
Component: AnyComponent,
|
|
9
|
+
) {
|
|
10
|
+
for (const [key, value] of Object.entries(BaseComponent)) {
|
|
11
|
+
if (key === "$$typeof" || key === "render" || key === "contextType") {
|
|
12
|
+
continue;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
(Component as unknown as Record<string, unknown>)[key] = value;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
Component.displayName = BaseComponent.displayName;
|
|
19
|
+
|
|
20
|
+
return Component as unknown as T;
|
|
21
|
+
}
|