@niibase/uniwind 1.0.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/LICENSE +20 -0
- package/dist/common/components/index.js +314 -0
- package/dist/common/components/native/ActivityIndicator.js +21 -0
- package/dist/common/components/native/Button.js +18 -0
- package/dist/common/components/native/FlatList.js +30 -0
- package/dist/common/components/native/Image.js +21 -0
- package/dist/common/components/native/ImageBackground.js +23 -0
- package/dist/common/components/native/InputAccessoryView.js +21 -0
- package/dist/common/components/native/KeyboardAvoidingView.js +20 -0
- package/dist/common/components/native/Modal.js +21 -0
- package/dist/common/components/native/Pressable.js +29 -0
- package/dist/common/components/native/RefreshControl.js +27 -0
- package/dist/common/components/native/SafeAreaView.js +18 -0
- package/dist/common/components/native/ScrollView.js +23 -0
- package/dist/common/components/native/SectionList.js +27 -0
- package/dist/common/components/native/Switch.js +32 -0
- package/dist/common/components/native/Text.js +36 -0
- package/dist/common/components/native/TextInput.js +53 -0
- package/dist/common/components/native/TouchableHighlight.js +35 -0
- package/dist/common/components/native/TouchableNativeFeedback.js +32 -0
- package/dist/common/components/native/TouchableOpacity.js +32 -0
- package/dist/common/components/native/TouchableWithoutFeedback.js +32 -0
- package/dist/common/components/native/View.js +18 -0
- package/dist/common/components/native/VirtualizedList.js +27 -0
- package/dist/common/components/native/useStyle.js +29 -0
- package/dist/common/components/utils.js +18 -0
- package/dist/common/components/web/ActivityIndicator.js +20 -0
- package/dist/common/components/web/Button.js +18 -0
- package/dist/common/components/web/FlatList.js +22 -0
- package/dist/common/components/web/Image.js +20 -0
- package/dist/common/components/web/ImageBackground.js +21 -0
- package/dist/common/components/web/KeyboardAvoidingView.js +18 -0
- package/dist/common/components/web/Modal.js +17 -0
- package/dist/common/components/web/Pressable.js +17 -0
- package/dist/common/components/web/RefreshControl.js +17 -0
- package/dist/common/components/web/SafeAreaView.js +17 -0
- package/dist/common/components/web/ScrollView.js +18 -0
- package/dist/common/components/web/SectionList.js +20 -0
- package/dist/common/components/web/Switch.js +26 -0
- package/dist/common/components/web/Text.js +17 -0
- package/dist/common/components/web/TextInput.js +17 -0
- package/dist/common/components/web/TouchableHighlight.js +20 -0
- package/dist/common/components/web/TouchableNativeFeedback.js +13 -0
- package/dist/common/components/web/TouchableOpacity.js +17 -0
- package/dist/common/components/web/TouchableWithoutFeedback.js +17 -0
- package/dist/common/components/web/View.js +17 -0
- package/dist/common/components/web/VirtualizedList.js +20 -0
- package/dist/common/components/web/index.js +187 -0
- package/dist/common/components/web/metro-injected.js +1 -0
- package/dist/common/components/web/rnw.js +42 -0
- package/dist/common/core/config/config.common.js +80 -0
- package/dist/common/core/config/config.js +51 -0
- package/dist/common/core/config/config.native.js +67 -0
- package/dist/common/core/config/index.js +16 -0
- package/dist/common/core/index.js +16 -0
- package/dist/common/core/listener.js +51 -0
- package/dist/common/core/logger.js +18 -0
- package/dist/common/core/native/index.js +27 -0
- package/dist/common/core/native/native-utils.js +36 -0
- package/dist/common/core/native/parsers/boxShadow.js +10 -0
- package/dist/common/core/native/parsers/fontVariant.js +8 -0
- package/dist/common/core/native/parsers/gradient.js +31 -0
- package/dist/common/core/native/parsers/index.js +60 -0
- package/dist/common/core/native/parsers/textShadow.js +39 -0
- package/dist/common/core/native/parsers/transforms.js +44 -0
- package/dist/common/core/native/runtime.js +34 -0
- package/dist/common/core/native/store.js +181 -0
- package/dist/common/core/types.js +1 -0
- package/dist/common/core/web/cssListener.js +146 -0
- package/dist/common/core/web/formatColor.js +15 -0
- package/dist/common/core/web/getWebStyles.js +51 -0
- package/dist/common/core/web/index.js +49 -0
- package/dist/common/core/web/parseCSSValue.js +15 -0
- package/dist/common/css/index.js +26 -0
- package/dist/common/css/insets.js +64 -0
- package/dist/common/css/processFunctions.js +54 -0
- package/dist/common/css/themes.js +95 -0
- package/dist/common/css/variants.js +16 -0
- package/dist/common/hoc/index.js +16 -0
- package/dist/common/hoc/types.js +1 -0
- package/dist/common/hoc/withUniwind.js +95 -0
- package/dist/common/hoc/withUniwind.native.js +106 -0
- package/dist/common/hoc/withUniwindUtils.js +16 -0
- package/dist/common/hooks/index.js +49 -0
- package/dist/common/hooks/useCSSVariable/getVariableValue.js +19 -0
- package/dist/common/hooks/useCSSVariable/getVariableValue.native.js +9 -0
- package/dist/common/hooks/useCSSVariable/index.js +16 -0
- package/dist/common/hooks/useCSSVariable/useCSSVariable.js +58 -0
- package/dist/common/hooks/useResolveClassNames.js +22 -0
- package/dist/common/hooks/useResolveClassNames.native.js +29 -0
- package/dist/common/hooks/useUniwind.js +28 -0
- package/dist/common/hooks/useUniwindAccent.js +13 -0
- package/dist/common/hooks/useUniwindAccent.native.js +12 -0
- package/dist/common/index.js +38 -0
- package/dist/common/types.js +28 -0
- package/dist/common/utils/buildDtsFile.js +18 -0
- package/dist/common/utils/stringifyThemes.js +8 -0
- package/dist/common/vite/index.d.ts +9 -0
- package/dist/common/vite/index.js +16 -0
- package/dist/common/vite/vite.js +72 -0
- package/dist/metro/index.cjs +166 -0
- package/dist/metro/index.d.ts +15 -0
- package/dist/metro/index.mjs +158 -0
- package/dist/metro/metro-transformer.cjs +1565 -0
- package/dist/metro/metro-transformer.mjs +1558 -0
- package/dist/module/components/index.d.ts +0 -0
- package/dist/module/components/index.js +312 -0
- package/dist/module/components/native/ActivityIndicator.d.ts +3 -0
- package/dist/module/components/native/ActivityIndicator.js +18 -0
- package/dist/module/components/native/Button.d.ts +3 -0
- package/dist/module/components/native/Button.js +15 -0
- package/dist/module/components/native/FlatList.d.ts +3 -0
- package/dist/module/components/native/FlatList.js +27 -0
- package/dist/module/components/native/Image.d.ts +3 -0
- package/dist/module/components/native/Image.js +18 -0
- package/dist/module/components/native/ImageBackground.d.ts +3 -0
- package/dist/module/components/native/ImageBackground.js +20 -0
- package/dist/module/components/native/InputAccessoryView.d.ts +3 -0
- package/dist/module/components/native/InputAccessoryView.js +21 -0
- package/dist/module/components/native/KeyboardAvoidingView.d.ts +3 -0
- package/dist/module/components/native/KeyboardAvoidingView.js +17 -0
- package/dist/module/components/native/Modal.d.ts +3 -0
- package/dist/module/components/native/Modal.js +18 -0
- package/dist/module/components/native/Pressable.d.ts +3 -0
- package/dist/module/components/native/Pressable.js +29 -0
- package/dist/module/components/native/RefreshControl.d.ts +3 -0
- package/dist/module/components/native/RefreshControl.js +24 -0
- package/dist/module/components/native/SafeAreaView.d.ts +3 -0
- package/dist/module/components/native/SafeAreaView.js +15 -0
- package/dist/module/components/native/ScrollView.d.ts +3 -0
- package/dist/module/components/native/ScrollView.js +20 -0
- package/dist/module/components/native/SectionList.d.ts +3 -0
- package/dist/module/components/native/SectionList.js +24 -0
- package/dist/module/components/native/Switch.d.ts +3 -0
- package/dist/module/components/native/Switch.js +26 -0
- package/dist/module/components/native/Text.d.ts +3 -0
- package/dist/module/components/native/Text.js +33 -0
- package/dist/module/components/native/TextInput.d.ts +3 -0
- package/dist/module/components/native/TextInput.js +50 -0
- package/dist/module/components/native/TouchableHighlight.d.ts +3 -0
- package/dist/module/components/native/TouchableHighlight.js +32 -0
- package/dist/module/components/native/TouchableNativeFeedback.d.ts +3 -0
- package/dist/module/components/native/TouchableNativeFeedback.js +29 -0
- package/dist/module/components/native/TouchableOpacity.d.ts +3 -0
- package/dist/module/components/native/TouchableOpacity.js +29 -0
- package/dist/module/components/native/TouchableWithoutFeedback.d.ts +3 -0
- package/dist/module/components/native/TouchableWithoutFeedback.js +29 -0
- package/dist/module/components/native/View.d.ts +3 -0
- package/dist/module/components/native/View.js +15 -0
- package/dist/module/components/native/VirtualizedList.d.ts +3 -0
- package/dist/module/components/native/VirtualizedList.js +24 -0
- package/dist/module/components/native/useStyle.d.ts +2 -0
- package/dist/module/components/native/useStyle.js +22 -0
- package/dist/module/components/utils.d.ts +1 -0
- package/dist/module/components/utils.js +11 -0
- package/dist/module/components/web/ActivityIndicator.d.ts +3 -0
- package/dist/module/components/web/ActivityIndicator.js +17 -0
- package/dist/module/components/web/Button.d.ts +3 -0
- package/dist/module/components/web/Button.js +15 -0
- package/dist/module/components/web/FlatList.d.ts +3 -0
- package/dist/module/components/web/FlatList.js +19 -0
- package/dist/module/components/web/Image.d.ts +3 -0
- package/dist/module/components/web/Image.js +17 -0
- package/dist/module/components/web/ImageBackground.d.ts +3 -0
- package/dist/module/components/web/ImageBackground.js +18 -0
- package/dist/module/components/web/KeyboardAvoidingView.d.ts +3 -0
- package/dist/module/components/web/KeyboardAvoidingView.js +15 -0
- package/dist/module/components/web/Modal.d.ts +3 -0
- package/dist/module/components/web/Modal.js +14 -0
- package/dist/module/components/web/Pressable.d.ts +3 -0
- package/dist/module/components/web/Pressable.js +14 -0
- package/dist/module/components/web/RefreshControl.d.ts +3 -0
- package/dist/module/components/web/RefreshControl.js +14 -0
- package/dist/module/components/web/SafeAreaView.d.ts +3 -0
- package/dist/module/components/web/SafeAreaView.js +14 -0
- package/dist/module/components/web/ScrollView.d.ts +3 -0
- package/dist/module/components/web/ScrollView.js +15 -0
- package/dist/module/components/web/SectionList.d.ts +3 -0
- package/dist/module/components/web/SectionList.js +17 -0
- package/dist/module/components/web/Switch.d.ts +3 -0
- package/dist/module/components/web/Switch.js +20 -0
- package/dist/module/components/web/Text.d.ts +3 -0
- package/dist/module/components/web/Text.js +14 -0
- package/dist/module/components/web/TextInput.d.ts +3 -0
- package/dist/module/components/web/TextInput.js +14 -0
- package/dist/module/components/web/TouchableHighlight.d.ts +3 -0
- package/dist/module/components/web/TouchableHighlight.js +17 -0
- package/dist/module/components/web/TouchableNativeFeedback.d.ts +2 -0
- package/dist/module/components/web/TouchableNativeFeedback.js +2 -0
- package/dist/module/components/web/TouchableOpacity.d.ts +3 -0
- package/dist/module/components/web/TouchableOpacity.js +14 -0
- package/dist/module/components/web/TouchableWithoutFeedback.d.ts +3 -0
- package/dist/module/components/web/TouchableWithoutFeedback.js +14 -0
- package/dist/module/components/web/View.d.ts +3 -0
- package/dist/module/components/web/View.js +14 -0
- package/dist/module/components/web/VirtualizedList.d.ts +3 -0
- package/dist/module/components/web/VirtualizedList.js +17 -0
- package/dist/module/components/web/index.d.ts +22 -0
- package/dist/module/components/web/index.js +22 -0
- package/dist/module/components/web/metro-injected.d.ts +0 -0
- package/dist/module/components/web/metro-injected.js +0 -0
- package/dist/module/components/web/rnw.d.ts +2 -0
- package/dist/module/components/web/rnw.js +35 -0
- package/dist/module/core/config/config.common.d.ts +18 -0
- package/dist/module/core/config/config.common.js +74 -0
- package/dist/module/core/config/config.d.ts +11 -0
- package/dist/module/core/config/config.js +48 -0
- package/dist/module/core/config/config.native.d.ts +12 -0
- package/dist/module/core/config/config.native.js +61 -0
- package/dist/module/core/config/index.d.ts +1 -0
- package/dist/module/core/config/index.js +1 -0
- package/dist/module/core/index.d.ts +1 -0
- package/dist/module/core/index.js +1 -0
- package/dist/module/core/listener.d.ts +12 -0
- package/dist/module/core/listener.js +45 -0
- package/dist/module/core/logger.d.ts +5 -0
- package/dist/module/core/logger.js +11 -0
- package/dist/module/core/native/index.d.ts +2 -0
- package/dist/module/core/native/index.js +2 -0
- package/dist/module/core/native/native-utils.d.ts +4 -0
- package/dist/module/core/native/native-utils.js +27 -0
- package/dist/module/core/native/parsers/boxShadow.d.ts +1 -0
- package/dist/module/core/native/parsers/boxShadow.js +3 -0
- package/dist/module/core/native/parsers/fontVariant.d.ts +1 -0
- package/dist/module/core/native/parsers/fontVariant.js +1 -0
- package/dist/module/core/native/parsers/gradient.d.ts +8 -0
- package/dist/module/core/native/parsers/gradient.js +26 -0
- package/dist/module/core/native/parsers/index.d.ts +5 -0
- package/dist/module/core/native/parsers/index.js +5 -0
- package/dist/module/core/native/parsers/textShadow.d.ts +1 -0
- package/dist/module/core/native/parsers/textShadow.js +32 -0
- package/dist/module/core/native/parsers/transforms.d.ts +1 -0
- package/dist/module/core/native/parsers/transforms.js +48 -0
- package/dist/module/core/native/runtime.d.ts +2 -0
- package/dist/module/core/native/runtime.js +28 -0
- package/dist/module/core/native/store.d.ts +19 -0
- package/dist/module/core/native/store.js +172 -0
- package/dist/module/core/types.d.ts +73 -0
- package/dist/module/core/types.js +0 -0
- package/dist/module/core/web/cssListener.d.ts +19 -0
- package/dist/module/core/web/cssListener.js +137 -0
- package/dist/module/core/web/formatColor.d.ts +1 -0
- package/dist/module/core/web/formatColor.js +8 -0
- package/dist/module/core/web/getWebStyles.d.ts +2 -0
- package/dist/module/core/web/getWebStyles.js +49 -0
- package/dist/module/core/web/index.d.ts +4 -0
- package/dist/module/core/web/index.js +4 -0
- package/dist/module/core/web/parseCSSValue.d.ts +1 -0
- package/dist/module/core/web/parseCSSValue.js +8 -0
- package/dist/module/css/index.d.ts +1 -0
- package/dist/module/css/index.js +25 -0
- package/dist/module/css/insets.d.ts +1 -0
- package/dist/module/css/insets.js +63 -0
- package/dist/module/css/processFunctions.d.ts +2 -0
- package/dist/module/css/processFunctions.js +36 -0
- package/dist/module/css/themes.d.ts +1 -0
- package/dist/module/css/themes.js +97 -0
- package/dist/module/css/variants.d.ts +1 -0
- package/dist/module/css/variants.js +9 -0
- package/dist/module/hoc/index.d.ts +1 -0
- package/dist/module/hoc/index.js +1 -0
- package/dist/module/hoc/types.d.ts +27 -0
- package/dist/module/hoc/types.js +0 -0
- package/dist/module/hoc/withUniwind.d.ts +2 -0
- package/dist/module/hoc/withUniwind.js +76 -0
- package/dist/module/hoc/withUniwind.native.d.ts +2 -0
- package/dist/module/hoc/withUniwind.native.js +81 -0
- package/dist/module/hoc/withUniwindUtils.d.ts +5 -0
- package/dist/module/hoc/withUniwindUtils.js +5 -0
- package/dist/module/hooks/index.d.ts +4 -0
- package/dist/module/hooks/index.js +4 -0
- package/dist/module/hooks/useCSSVariable/getVariableValue.d.ts +1 -0
- package/dist/module/hooks/useCSSVariable/getVariableValue.js +12 -0
- package/dist/module/hooks/useCSSVariable/getVariableValue.native.d.ts +1 -0
- package/dist/module/hooks/useCSSVariable/getVariableValue.native.js +2 -0
- package/dist/module/hooks/useCSSVariable/index.d.ts +1 -0
- package/dist/module/hooks/useCSSVariable/index.js +1 -0
- package/dist/module/hooks/useCSSVariable/useCSSVariable.d.ts +13 -0
- package/dist/module/hooks/useCSSVariable/useCSSVariable.js +56 -0
- package/dist/module/hooks/useResolveClassNames.d.ts +2 -0
- package/dist/module/hooks/useResolveClassNames.js +18 -0
- package/dist/module/hooks/useResolveClassNames.native.d.ts +2 -0
- package/dist/module/hooks/useResolveClassNames.native.js +22 -0
- package/dist/module/hooks/useUniwind.d.ts +5 -0
- package/dist/module/hooks/useUniwind.js +21 -0
- package/dist/module/hooks/useUniwindAccent.d.ts +1 -0
- package/dist/module/hooks/useUniwindAccent.js +6 -0
- package/dist/module/hooks/useUniwindAccent.native.d.ts +2 -0
- package/dist/module/hooks/useUniwindAccent.native.js +5 -0
- package/dist/module/index.d.ts +5 -0
- package/dist/module/index.js +3 -0
- package/dist/module/types.d.ts +21 -0
- package/dist/module/types.js +22 -0
- package/dist/module/utils/buildDtsFile.d.ts +1 -0
- package/dist/module/utils/buildDtsFile.js +22 -0
- package/dist/module/utils/stringifyThemes.d.ts +1 -0
- package/dist/module/utils/stringifyThemes.js +1 -0
- package/dist/module/vite/index.d.ts +9 -0
- package/dist/module/vite/index.js +1 -0
- package/dist/module/vite/vite.d.ts +8 -0
- package/dist/module/vite/vite.js +73 -0
- package/dist/shared/uniwind.BZIuaszw.cjs +11 -0
- package/dist/shared/uniwind.BgZDHdUR.cjs +81 -0
- package/dist/shared/uniwind.Bt3kqZo6.mjs +290 -0
- package/dist/shared/uniwind.CyoRUwOj.mjs +9 -0
- package/dist/shared/uniwind.D3fvrgEG.mjs +68 -0
- package/dist/shared/uniwind.D_6s2EM-.cjs +301 -0
- package/dist/vite/index.cjs +80 -0
- package/dist/vite/index.d.ts +9 -0
- package/dist/vite/index.mjs +74 -0
- package/metro/package.json +3 -0
- package/package.json +106 -0
- package/readme.md +71 -0
- package/src/components/index.ts +313 -0
- package/src/components/native/ActivityIndicator.tsx +19 -0
- package/src/components/native/Button.tsx +16 -0
- package/src/components/native/FlatList.tsx +28 -0
- package/src/components/native/Image.tsx +19 -0
- package/src/components/native/ImageBackground.tsx +21 -0
- package/src/components/native/InputAccessoryView.tsx +23 -0
- package/src/components/native/KeyboardAvoidingView.tsx +18 -0
- package/src/components/native/Modal.tsx +19 -0
- package/src/components/native/Pressable.tsx +31 -0
- package/src/components/native/RefreshControl.tsx +25 -0
- package/src/components/native/SafeAreaView.tsx +16 -0
- package/src/components/native/ScrollView.tsx +21 -0
- package/src/components/native/SectionList.tsx +25 -0
- package/src/components/native/Switch.tsx +28 -0
- package/src/components/native/Text.tsx +39 -0
- package/src/components/native/TextInput.tsx +52 -0
- package/src/components/native/TouchableHighlight.tsx +34 -0
- package/src/components/native/TouchableNativeFeedback.tsx +31 -0
- package/src/components/native/TouchableOpacity.tsx +31 -0
- package/src/components/native/TouchableWithoutFeedback.tsx +31 -0
- package/src/components/native/View.tsx +16 -0
- package/src/components/native/VirtualizedList.tsx +25 -0
- package/src/components/native/useStyle.ts +33 -0
- package/src/components/utils.ts +16 -0
- package/src/components/web/ActivityIndicator.tsx +18 -0
- package/src/components/web/Button.tsx +16 -0
- package/src/components/web/FlatList.tsx +20 -0
- package/src/components/web/Image.tsx +18 -0
- package/src/components/web/ImageBackground.tsx +19 -0
- package/src/components/web/KeyboardAvoidingView.tsx +15 -0
- package/src/components/web/Modal.tsx +14 -0
- package/src/components/web/Pressable.tsx +14 -0
- package/src/components/web/RefreshControl.tsx +14 -0
- package/src/components/web/SafeAreaView.tsx +14 -0
- package/src/components/web/ScrollView.tsx +15 -0
- package/src/components/web/SectionList.tsx +17 -0
- package/src/components/web/Switch.tsx +21 -0
- package/src/components/web/Text.tsx +14 -0
- package/src/components/web/TextInput.tsx +14 -0
- package/src/components/web/TouchableHighlight.tsx +18 -0
- package/src/components/web/TouchableNativeFeedback.tsx +2 -0
- package/src/components/web/TouchableOpacity.tsx +14 -0
- package/src/components/web/TouchableWithoutFeedback.tsx +14 -0
- package/src/components/web/View.tsx +14 -0
- package/src/components/web/VirtualizedList.tsx +17 -0
- package/src/components/web/index.ts +22 -0
- package/src/components/web/metro-injected.ts +1 -0
- package/src/components/web/rnw.ts +52 -0
- package/src/core/config/config.common.ts +98 -0
- package/src/core/config/config.native.ts +79 -0
- package/src/core/config/config.ts +64 -0
- package/src/core/config/index.ts +1 -0
- package/src/core/index.ts +1 -0
- package/src/core/listener.ts +59 -0
- package/src/core/logger.ts +15 -0
- package/src/core/native/index.ts +2 -0
- package/src/core/native/native-utils.ts +41 -0
- package/src/core/native/parsers/boxShadow.ts +7 -0
- package/src/core/native/parsers/fontVariant.ts +3 -0
- package/src/core/native/parsers/gradient.ts +39 -0
- package/src/core/native/parsers/index.ts +5 -0
- package/src/core/native/parsers/textShadow.ts +37 -0
- package/src/core/native/parsers/transforms.ts +64 -0
- package/src/core/native/runtime.ts +32 -0
- package/src/core/native/store.ts +238 -0
- package/src/core/types.ts +92 -0
- package/src/core/web/cssListener.ts +185 -0
- package/src/core/web/formatColor.ts +13 -0
- package/src/core/web/getWebStyles.ts +76 -0
- package/src/core/web/index.ts +4 -0
- package/src/core/web/parseCSSValue.ts +10 -0
- package/src/css/index.ts +32 -0
- package/src/css/insets.ts +73 -0
- package/src/css/processFunctions.ts +39 -0
- package/src/css/themes.ts +130 -0
- package/src/css/variants.ts +11 -0
- package/src/hoc/index.ts +1 -0
- package/src/hoc/types.ts +45 -0
- package/src/hoc/withUniwind.native.tsx +118 -0
- package/src/hoc/withUniwind.tsx +115 -0
- package/src/hoc/withUniwindUtils.ts +10 -0
- package/src/hooks/index.ts +4 -0
- package/src/hooks/useCSSVariable/getVariableValue.native.ts +3 -0
- package/src/hooks/useCSSVariable/getVariableValue.ts +19 -0
- package/src/hooks/useCSSVariable/index.ts +1 -0
- package/src/hooks/useCSSVariable/useCSSVariable.ts +89 -0
- package/src/hooks/useResolveClassNames.native.ts +29 -0
- package/src/hooks/useResolveClassNames.ts +26 -0
- package/src/hooks/useUniwind.ts +26 -0
- package/src/hooks/useUniwindAccent.native.ts +8 -0
- package/src/hooks/useUniwindAccent.ts +10 -0
- package/src/index.ts +5 -0
- package/src/metro/addMetaToStylesTemplate.ts +152 -0
- package/src/metro/compileVirtual.ts +74 -0
- package/src/metro/index.d.ts +15 -0
- package/src/metro/index.ts +1 -0
- package/src/metro/injectThemes.ts +23 -0
- package/src/metro/logger.ts +44 -0
- package/src/metro/metro-css-patches.ts +57 -0
- package/src/metro/metro-transformer.ts +99 -0
- package/src/metro/polyfillWeb.ts +14 -0
- package/src/metro/processor/color.ts +76 -0
- package/src/metro/processor/css.ts +541 -0
- package/src/metro/processor/functions.ts +199 -0
- package/src/metro/processor/index.ts +1 -0
- package/src/metro/processor/mq.ts +82 -0
- package/src/metro/processor/processor.ts +249 -0
- package/src/metro/processor/rn.ts +277 -0
- package/src/metro/processor/units.ts +58 -0
- package/src/metro/processor/var.ts +18 -0
- package/src/metro/resolvers.ts +101 -0
- package/src/metro/types.ts +74 -0
- package/src/metro/utils/common.ts +103 -0
- package/src/metro/utils/index.ts +2 -0
- package/src/metro/utils/serialize.ts +116 -0
- package/src/metro/withUniwindConfig.ts +60 -0
- package/src/types.ts +24 -0
- package/src/utils/buildDtsFile.ts +27 -0
- package/src/utils/stringifyThemes.ts +1 -0
- package/src/vite/index.d.ts +9 -0
- package/src/vite/index.ts +1 -0
- package/src/vite/vite.ts +86 -0
- package/types.d.ts +109 -0
- package/uniwind.css +262 -0
- package/vite/package.json +3 -0
package/readme.md
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
[<img alt="uniwind" src="assets/banner.png">](https://uniwind.dev/)
|
|
2
|
+
|
|
3
|
+
<div align="center">
|
|
4
|
+
<p align="center">
|
|
5
|
+
<a href="https://uniwind.dev/" target="_blank">
|
|
6
|
+
<h1 align="center" style="color:red;">Uniwind</h1>
|
|
7
|
+
<span>The fastest Tailwind bindings for React Native</span>
|
|
8
|
+
</a>
|
|
9
|
+
</p>
|
|
10
|
+
</div>
|
|
11
|
+
<br />
|
|
12
|
+
|
|
13
|
+

|
|
14
|
+
[](https://www.npmjs.com/package/uniwind)
|
|
15
|
+
[](https://www.npmjs.com/package/uniwind)
|
|
16
|
+
[](https://opensource.org/licenses/MIT)
|
|
17
|
+
|
|
18
|
+
> **Note:** This is a fork of uniwind that makes pro subscription features available for free (except for Unistyles support). Install from `@niibase/uniwind` to get these features.
|
|
19
|
+
|
|
20
|
+
## Installation
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
# Install from the fork (recommended - includes pro features for free)
|
|
24
|
+
bun add @niibase/uniwind tailwindcss
|
|
25
|
+
|
|
26
|
+
# Or install from the original package
|
|
27
|
+
bun add uniwind tailwindcss
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Then follow [installation guides](https://docs.uniwind.dev/quickstart)
|
|
31
|
+
|
|
32
|
+
## Documentation
|
|
33
|
+
|
|
34
|
+
- [Start here](https://docs.uniwind.dev/)
|
|
35
|
+
- [Theming Basics](https://docs.uniwind.dev/theming/basics)
|
|
36
|
+
- [Supported classNames](https://docs.uniwind.dev/class-names)
|
|
37
|
+
- [Pro Version](https://docs.uniwind.dev/pro-version)
|
|
38
|
+
|
|
39
|
+
## Features
|
|
40
|
+
|
|
41
|
+
- ⚛️ Out‑of‑the‑box `className` bindings for every React Native component
|
|
42
|
+
- ⚡ Styles are computed at build time for maximum performance
|
|
43
|
+
- 🌙 Dark mode and 🎨 fully customizable themes
|
|
44
|
+
- 🧩 Pseudo‑classes support — `focus`, `active`, `disabled`, and more
|
|
45
|
+
- 📱 Responsive design with media queries
|
|
46
|
+
- 🧰 Use custom CSS properties directly in React Native
|
|
47
|
+
- 🔥 And [much more](https://docs.uniwind.dev/api/use-uniwind)
|
|
48
|
+
|
|
49
|
+
## Roadmap
|
|
50
|
+
|
|
51
|
+
- [ ] **Reanimated 4 support** - Full compatibility with React Native Reanimated v4
|
|
52
|
+
- [ ] **Babel support to extend beyond React Native components** - Enable className support for custom components and third-party libraries
|
|
53
|
+
- [ ] **Unistyles (future)** - Integration with Unistyles for enhanced styling capabilities
|
|
54
|
+
|
|
55
|
+
> **Note:** Once Babel support is completed, the likelihood of adding Unistyles support is high.
|
|
56
|
+
|
|
57
|
+
## Contributing
|
|
58
|
+
|
|
59
|
+
Contributions are welcome!
|
|
60
|
+
|
|
61
|
+
### How to contribute
|
|
62
|
+
|
|
63
|
+
- Bug Fixes: Check our [Issues](https://github.com/uni-stack/uniwind/issues) for any bugs that need fixing. Make sure to ask before working on an issue.
|
|
64
|
+
- New Features: If you have an idea for a new feature, please open discussion first to get feedback from the community.
|
|
65
|
+
- Refactor and Improvements: If you see areas of the code that could be improved or refactored, open discussion or reach out to the maintainers before making significant changes.
|
|
66
|
+
|
|
67
|
+
Pull Request that do not follow these guidelines may be closed or not reviewed.
|
|
68
|
+
|
|
69
|
+
## License
|
|
70
|
+
|
|
71
|
+
MIT
|
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
get ActivityIndicator() {
|
|
3
|
+
return require('./native/ActivityIndicator').ActivityIndicator
|
|
4
|
+
},
|
|
5
|
+
get Button() {
|
|
6
|
+
return require('./native/Button').Button
|
|
7
|
+
},
|
|
8
|
+
get FlatList() {
|
|
9
|
+
return require('./native/FlatList').FlatList
|
|
10
|
+
},
|
|
11
|
+
get Image() {
|
|
12
|
+
return require('./native/Image').Image
|
|
13
|
+
},
|
|
14
|
+
get ImageBackground() {
|
|
15
|
+
return require('./native/ImageBackground').ImageBackground
|
|
16
|
+
},
|
|
17
|
+
get InputAccessoryView() {
|
|
18
|
+
return require('./native/InputAccessoryView').InputAccessoryView
|
|
19
|
+
},
|
|
20
|
+
get KeyboardAvoidingView() {
|
|
21
|
+
return require('./native/KeyboardAvoidingView').KeyboardAvoidingView
|
|
22
|
+
},
|
|
23
|
+
get Modal() {
|
|
24
|
+
return require('./native/Modal').Modal
|
|
25
|
+
},
|
|
26
|
+
get Pressable() {
|
|
27
|
+
return require('./native/Pressable').Pressable
|
|
28
|
+
},
|
|
29
|
+
get RefreshControl() {
|
|
30
|
+
return require('./native/RefreshControl').RefreshControl
|
|
31
|
+
},
|
|
32
|
+
get SafeAreaView() {
|
|
33
|
+
return require('./native/SafeAreaView').SafeAreaView
|
|
34
|
+
},
|
|
35
|
+
get ScrollView() {
|
|
36
|
+
return require('./native/ScrollView').ScrollView
|
|
37
|
+
},
|
|
38
|
+
get SectionList() {
|
|
39
|
+
return require('./native/SectionList').SectionList
|
|
40
|
+
},
|
|
41
|
+
get Switch() {
|
|
42
|
+
return require('./native/Switch').Switch
|
|
43
|
+
},
|
|
44
|
+
get Text() {
|
|
45
|
+
return require('./native/Text').Text
|
|
46
|
+
},
|
|
47
|
+
get TextInput() {
|
|
48
|
+
return require('./native/TextInput').TextInput
|
|
49
|
+
},
|
|
50
|
+
get TouchableHighlight() {
|
|
51
|
+
return require('./native/TouchableHighlight').TouchableHighlight
|
|
52
|
+
},
|
|
53
|
+
get TouchableNativeFeedback() {
|
|
54
|
+
return require('./native/TouchableNativeFeedback').TouchableNativeFeedback
|
|
55
|
+
},
|
|
56
|
+
get TouchableOpacity() {
|
|
57
|
+
return require('./native/TouchableOpacity').TouchableOpacity
|
|
58
|
+
},
|
|
59
|
+
get TouchableWithoutFeedback() {
|
|
60
|
+
return require('./native/TouchableWithoutFeedback').TouchableWithoutFeedback
|
|
61
|
+
},
|
|
62
|
+
get View() {
|
|
63
|
+
return require('./native/View').View
|
|
64
|
+
},
|
|
65
|
+
get VirtualizedList() {
|
|
66
|
+
return require('./native/VirtualizedList').VirtualizedList
|
|
67
|
+
},
|
|
68
|
+
|
|
69
|
+
// Unsupported
|
|
70
|
+
get DrawerLayoutAndroid() {
|
|
71
|
+
return require('react-native').DrawerLayoutAndroid
|
|
72
|
+
},
|
|
73
|
+
get experimental_LayoutConformance() {
|
|
74
|
+
return require('react-native').experimental_LayoutConformance
|
|
75
|
+
},
|
|
76
|
+
get ProgressBarAndroid() {
|
|
77
|
+
return require('react-native').ProgressBarAndroid
|
|
78
|
+
},
|
|
79
|
+
get StatusBar() {
|
|
80
|
+
return require('react-native').StatusBar
|
|
81
|
+
},
|
|
82
|
+
get unstable_TextAncestorContext() {
|
|
83
|
+
return require('react-native').unstable_TextAncestorContext
|
|
84
|
+
},
|
|
85
|
+
get Touchable() {
|
|
86
|
+
return require('react-native').Touchable
|
|
87
|
+
},
|
|
88
|
+
get VirtualizedSectionList() {
|
|
89
|
+
return require('react-native').VirtualizedSectionList
|
|
90
|
+
},
|
|
91
|
+
get unstable_VirtualView() {
|
|
92
|
+
return require('react-native').unstable_VirtualView
|
|
93
|
+
},
|
|
94
|
+
get AccessibilityInfo() {
|
|
95
|
+
return require('react-native').AccessibilityInfo
|
|
96
|
+
},
|
|
97
|
+
get ActionSheetIOS() {
|
|
98
|
+
return require('react-native').ActionSheetIOS
|
|
99
|
+
},
|
|
100
|
+
get Alert() {
|
|
101
|
+
return require('react-native').Alert
|
|
102
|
+
},
|
|
103
|
+
get Animated() {
|
|
104
|
+
return require('react-native').Animated
|
|
105
|
+
},
|
|
106
|
+
get Appearance() {
|
|
107
|
+
return require('react-native').Appearance
|
|
108
|
+
},
|
|
109
|
+
get AppRegistry() {
|
|
110
|
+
return require('react-native').AppRegistry
|
|
111
|
+
},
|
|
112
|
+
get AppState() {
|
|
113
|
+
return require('react-native').AppState
|
|
114
|
+
},
|
|
115
|
+
get BackHandler() {
|
|
116
|
+
return require('react-native').BackHandler
|
|
117
|
+
},
|
|
118
|
+
get Clipboard() {
|
|
119
|
+
return require('react-native').Clipboard
|
|
120
|
+
},
|
|
121
|
+
get codegenNativeCommands() {
|
|
122
|
+
return require('react-native').codegenNativeCommands
|
|
123
|
+
},
|
|
124
|
+
get codegenNativeComponent() {
|
|
125
|
+
return require('react-native').codegenNativeComponent
|
|
126
|
+
},
|
|
127
|
+
get DeviceEventEmitter() {
|
|
128
|
+
return require('react-native').DeviceEventEmitter
|
|
129
|
+
},
|
|
130
|
+
get DeviceInfo() {
|
|
131
|
+
return require('react-native').DeviceInfo
|
|
132
|
+
},
|
|
133
|
+
get DevMenu() {
|
|
134
|
+
return require('react-native').DevMenu
|
|
135
|
+
},
|
|
136
|
+
get DevSettings() {
|
|
137
|
+
return require('react-native').DevSettings
|
|
138
|
+
},
|
|
139
|
+
get Dimensions() {
|
|
140
|
+
return require('react-native').Dimensions
|
|
141
|
+
},
|
|
142
|
+
get DynamicColorIOS() {
|
|
143
|
+
return require('react-native').DynamicColorIOS
|
|
144
|
+
},
|
|
145
|
+
get Easing() {
|
|
146
|
+
return require('react-native').Easing
|
|
147
|
+
},
|
|
148
|
+
get findNodeHandle() {
|
|
149
|
+
return require('react-native').findNodeHandle
|
|
150
|
+
},
|
|
151
|
+
get I18nManager() {
|
|
152
|
+
return require('react-native').I18nManager
|
|
153
|
+
},
|
|
154
|
+
get InteractionManager() {
|
|
155
|
+
return require('react-native').InteractionManager
|
|
156
|
+
},
|
|
157
|
+
get Keyboard() {
|
|
158
|
+
return require('react-native').Keyboard
|
|
159
|
+
},
|
|
160
|
+
get LayoutAnimation() {
|
|
161
|
+
return require('react-native').LayoutAnimation
|
|
162
|
+
},
|
|
163
|
+
get Linking() {
|
|
164
|
+
return require('react-native').Linking
|
|
165
|
+
},
|
|
166
|
+
get LogBox() {
|
|
167
|
+
return require('react-native').LogBox
|
|
168
|
+
},
|
|
169
|
+
get NativeAppEventEmitter() {
|
|
170
|
+
return require('react-native').NativeAppEventEmitter
|
|
171
|
+
},
|
|
172
|
+
get NativeDialogManagerAndroid() {
|
|
173
|
+
return require('react-native').NativeDialogManagerAndroid
|
|
174
|
+
},
|
|
175
|
+
get NativeEventEmitter() {
|
|
176
|
+
return require('react-native').NativeEventEmitter
|
|
177
|
+
},
|
|
178
|
+
get NativeModules() {
|
|
179
|
+
return require('react-native').NativeModules
|
|
180
|
+
},
|
|
181
|
+
get Networking() {
|
|
182
|
+
return require('react-native').Networking
|
|
183
|
+
},
|
|
184
|
+
get PanResponder() {
|
|
185
|
+
return require('react-native').PanResponder
|
|
186
|
+
},
|
|
187
|
+
get PermissionsAndroid() {
|
|
188
|
+
return require('react-native').PermissionsAndroid
|
|
189
|
+
},
|
|
190
|
+
get PixelRatio() {
|
|
191
|
+
return require('react-native').PixelRatio
|
|
192
|
+
},
|
|
193
|
+
get Platform() {
|
|
194
|
+
return require('react-native').Platform
|
|
195
|
+
},
|
|
196
|
+
get PlatformColor() {
|
|
197
|
+
return require('react-native').PlatformColor
|
|
198
|
+
},
|
|
199
|
+
get PushNotificationIOS() {
|
|
200
|
+
return require('react-native').PushNotificationIOS
|
|
201
|
+
},
|
|
202
|
+
get processColor() {
|
|
203
|
+
return require('react-native').processColor
|
|
204
|
+
},
|
|
205
|
+
get registerCallableModule() {
|
|
206
|
+
return require('react-native').registerCallableModule
|
|
207
|
+
},
|
|
208
|
+
get requireNativeComponent() {
|
|
209
|
+
return require('react-native').requireNativeComponent
|
|
210
|
+
},
|
|
211
|
+
get RootTagContext() {
|
|
212
|
+
return require('react-native').RootTagContext
|
|
213
|
+
},
|
|
214
|
+
get Settings() {
|
|
215
|
+
return require('react-native').Settings
|
|
216
|
+
},
|
|
217
|
+
get Share() {
|
|
218
|
+
return require('react-native').Share
|
|
219
|
+
},
|
|
220
|
+
get StyleSheet() {
|
|
221
|
+
return require('react-native').StyleSheet
|
|
222
|
+
},
|
|
223
|
+
get Systrace() {
|
|
224
|
+
return require('react-native').Systrace
|
|
225
|
+
},
|
|
226
|
+
get ToastAndroid() {
|
|
227
|
+
return require('react-native').ToastAndroid
|
|
228
|
+
},
|
|
229
|
+
get TurboModuleRegistry() {
|
|
230
|
+
return require('react-native').TurboModuleRegistry
|
|
231
|
+
},
|
|
232
|
+
get UIManager() {
|
|
233
|
+
return require('react-native').UIManager
|
|
234
|
+
},
|
|
235
|
+
get unstable_batchedUpdates() {
|
|
236
|
+
return require('react-native').unstable_batchedUpdates
|
|
237
|
+
},
|
|
238
|
+
get useAnimatedValue() {
|
|
239
|
+
return require('react-native').useAnimatedValue
|
|
240
|
+
},
|
|
241
|
+
get useColorScheme() {
|
|
242
|
+
return require('react-native').useColorScheme
|
|
243
|
+
},
|
|
244
|
+
get useWindowDimensions() {
|
|
245
|
+
return require('react-native').useWindowDimensions
|
|
246
|
+
},
|
|
247
|
+
get UTFSequence() {
|
|
248
|
+
return require('react-native').UTFSequence
|
|
249
|
+
},
|
|
250
|
+
get Vibration() {
|
|
251
|
+
return require('react-native').Vibration
|
|
252
|
+
},
|
|
253
|
+
get VirtualViewMode() {
|
|
254
|
+
return require('react-native').VirtualViewMode
|
|
255
|
+
},
|
|
256
|
+
get NativeComponentRegistry() {
|
|
257
|
+
return require('react-native').NativeComponentRegistry
|
|
258
|
+
},
|
|
259
|
+
get ReactNativeVersion() {
|
|
260
|
+
return require('react-native').ReactNativeVersion
|
|
261
|
+
},
|
|
262
|
+
get TVEventControl() {
|
|
263
|
+
return require('react-native').TVEventControl
|
|
264
|
+
},
|
|
265
|
+
get TVEventHandler() {
|
|
266
|
+
return require('react-native').TVEventHandler
|
|
267
|
+
},
|
|
268
|
+
get useTVEventHandler() {
|
|
269
|
+
return require('react-native').useTVEventHandler
|
|
270
|
+
},
|
|
271
|
+
get TVFocusGuideView() {
|
|
272
|
+
return require('react-native').TVFocusGuideView
|
|
273
|
+
},
|
|
274
|
+
get TVMenuControl() {
|
|
275
|
+
return require('react-native').TVMenuControl
|
|
276
|
+
},
|
|
277
|
+
get TVTextScrollView() {
|
|
278
|
+
return require('react-native').TVTextScrollView
|
|
279
|
+
},
|
|
280
|
+
get DynamicColorMacOS() {
|
|
281
|
+
return require('react-native').DynamicColorMacOS
|
|
282
|
+
},
|
|
283
|
+
get ColorWithSystemEffectMacOS() {
|
|
284
|
+
return require('react-native').ColorWithSystemEffectMacOS
|
|
285
|
+
},
|
|
286
|
+
get Flyout() {
|
|
287
|
+
return require('react-native').Flyout
|
|
288
|
+
},
|
|
289
|
+
get Glyph() {
|
|
290
|
+
return require('react-native').Glyph
|
|
291
|
+
},
|
|
292
|
+
get Popup() {
|
|
293
|
+
return require('react-native').Popup
|
|
294
|
+
},
|
|
295
|
+
get supportKeyboard() {
|
|
296
|
+
return require('react-native').supportKeyboard
|
|
297
|
+
},
|
|
298
|
+
get EventPhase() {
|
|
299
|
+
return require('react-native').EventPhase
|
|
300
|
+
},
|
|
301
|
+
get HandledEventPhase() {
|
|
302
|
+
return require('react-native').HandledEventPhase
|
|
303
|
+
},
|
|
304
|
+
get ViewWindows() {
|
|
305
|
+
return require('react-native').ViewWindows
|
|
306
|
+
},
|
|
307
|
+
get AppTheme() {
|
|
308
|
+
return require('react-native').AppTheme
|
|
309
|
+
},
|
|
310
|
+
get XamlHost() {
|
|
311
|
+
return require('react-native').XamlHost
|
|
312
|
+
},
|
|
313
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ActivityIndicator as RNActivityIndicator, ActivityIndicatorProps } from 'react-native'
|
|
2
|
+
import { useUniwindAccent } from '../../hooks'
|
|
3
|
+
import { copyComponentProperties } from '../utils'
|
|
4
|
+
import { useStyle } from './useStyle'
|
|
5
|
+
|
|
6
|
+
export const ActivityIndicator = copyComponentProperties(RNActivityIndicator, (props: ActivityIndicatorProps) => {
|
|
7
|
+
const style = useStyle(props.className)
|
|
8
|
+
const color = useUniwindAccent(props.colorClassName)
|
|
9
|
+
|
|
10
|
+
return (
|
|
11
|
+
<RNActivityIndicator
|
|
12
|
+
{...props}
|
|
13
|
+
style={[style, props.style]}
|
|
14
|
+
color={props.color ?? color}
|
|
15
|
+
/>
|
|
16
|
+
)
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
export default ActivityIndicator
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Button as RNButton, ButtonProps } from 'react-native'
|
|
2
|
+
import { useUniwindAccent } from '../../hooks'
|
|
3
|
+
import { copyComponentProperties } from '../utils'
|
|
4
|
+
|
|
5
|
+
export const Button = copyComponentProperties(RNButton, (props: ButtonProps) => {
|
|
6
|
+
const color = useUniwindAccent(props.colorClassName)
|
|
7
|
+
|
|
8
|
+
return (
|
|
9
|
+
<RNButton
|
|
10
|
+
{...props}
|
|
11
|
+
color={props.color ?? color}
|
|
12
|
+
/>
|
|
13
|
+
)
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
export default Button
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { FlatList as RNFlatList, FlatListProps } from 'react-native'
|
|
2
|
+
import { useUniwindAccent } from '../../hooks'
|
|
3
|
+
import { copyComponentProperties } from '../utils'
|
|
4
|
+
import { useStyle } from './useStyle'
|
|
5
|
+
|
|
6
|
+
export const FlatList = copyComponentProperties(RNFlatList, (props: FlatListProps<unknown>) => {
|
|
7
|
+
const style = useStyle(props.className)
|
|
8
|
+
const styleColumnWrapper = useStyle(props.columnWrapperClassName)
|
|
9
|
+
const styleContentContainer = useStyle(props.contentContainerClassName)
|
|
10
|
+
const styleListFooterComponent = useStyle(props.ListFooterComponentClassName)
|
|
11
|
+
const styleListHeaderComponent = useStyle(props.ListHeaderComponentClassName)
|
|
12
|
+
const endFillColor = useUniwindAccent(props.endFillColorClassName)
|
|
13
|
+
const hasSingleColumn = !('numColumns' in props) || props.numColumns === 1
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<RNFlatList
|
|
17
|
+
{...props}
|
|
18
|
+
style={[style, props.style]}
|
|
19
|
+
columnWrapperStyle={hasSingleColumn ? undefined : [styleColumnWrapper, props.columnWrapperStyle]}
|
|
20
|
+
contentContainerStyle={[styleContentContainer, props.contentContainerStyle]}
|
|
21
|
+
ListFooterComponentStyle={[styleListFooterComponent, props.ListFooterComponentStyle]}
|
|
22
|
+
ListHeaderComponentStyle={[styleListHeaderComponent, props.ListHeaderComponentStyle]}
|
|
23
|
+
endFillColor={props.endFillColor ?? endFillColor}
|
|
24
|
+
/>
|
|
25
|
+
)
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
export default FlatList
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Image as RNImage, ImageProps } from 'react-native'
|
|
2
|
+
import { useUniwindAccent } from '../../hooks'
|
|
3
|
+
import { copyComponentProperties } from '../utils'
|
|
4
|
+
import { useStyle } from './useStyle'
|
|
5
|
+
|
|
6
|
+
export const Image = copyComponentProperties(RNImage, (props: ImageProps) => {
|
|
7
|
+
const style = useStyle(props.className)
|
|
8
|
+
const tintColor = useUniwindAccent(props.tintColorClassName)
|
|
9
|
+
|
|
10
|
+
return (
|
|
11
|
+
<RNImage
|
|
12
|
+
{...props}
|
|
13
|
+
style={[style, props.style]}
|
|
14
|
+
tintColor={props.tintColor ?? tintColor}
|
|
15
|
+
/>
|
|
16
|
+
)
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
export default Image
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ImageBackground as RNImageBackground, ImageBackgroundProps } from 'react-native'
|
|
2
|
+
import { useUniwindAccent } from '../../hooks'
|
|
3
|
+
import { copyComponentProperties } from '../utils'
|
|
4
|
+
import { useStyle } from './useStyle'
|
|
5
|
+
|
|
6
|
+
export const ImageBackground = copyComponentProperties(RNImageBackground, (props: ImageBackgroundProps) => {
|
|
7
|
+
const style = useStyle(props.className)
|
|
8
|
+
const imageStyle = useStyle(props.imageClassName)
|
|
9
|
+
const tintColor = useUniwindAccent(props.tintColorClassName)
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<RNImageBackground
|
|
13
|
+
{...props}
|
|
14
|
+
style={[style, props.style]}
|
|
15
|
+
imageStyle={[imageStyle, props.imageStyle]}
|
|
16
|
+
tintColor={props.tintColor ?? tintColor}
|
|
17
|
+
/>
|
|
18
|
+
)
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
export default ImageBackground
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ForwardedRef } from 'react'
|
|
2
|
+
import { InputAccessoryView as RNInputAccessoryView, InputAccessoryViewProps } from 'react-native'
|
|
3
|
+
import { useUniwindAccent } from '../../hooks'
|
|
4
|
+
import { copyComponentProperties } from '../utils'
|
|
5
|
+
import { useStyle } from './useStyle'
|
|
6
|
+
|
|
7
|
+
export const InputAccessoryView = copyComponentProperties(
|
|
8
|
+
RNInputAccessoryView,
|
|
9
|
+
(props: InputAccessoryViewProps & { ref?: ForwardedRef<RNInputAccessoryView> }) => {
|
|
10
|
+
const style = useStyle(props.className)
|
|
11
|
+
const backgroundColor = useUniwindAccent(props.backgroundColorClassName)
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<RNInputAccessoryView
|
|
15
|
+
{...props}
|
|
16
|
+
backgroundColor={props.backgroundColor ?? backgroundColor}
|
|
17
|
+
style={[style, props.style]}
|
|
18
|
+
/>
|
|
19
|
+
)
|
|
20
|
+
},
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
export default InputAccessoryView
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { KeyboardAvoidingView as RNKeyboardAvoidingView, KeyboardAvoidingViewProps } from 'react-native'
|
|
2
|
+
import { copyComponentProperties } from '../utils'
|
|
3
|
+
import { useStyle } from './useStyle'
|
|
4
|
+
|
|
5
|
+
export const KeyboardAvoidingView = copyComponentProperties(RNKeyboardAvoidingView, (props: KeyboardAvoidingViewProps) => {
|
|
6
|
+
const style = useStyle(props.className)
|
|
7
|
+
const contentContainerStyle = useStyle(props.contentContainerClassName)
|
|
8
|
+
|
|
9
|
+
return (
|
|
10
|
+
<RNKeyboardAvoidingView
|
|
11
|
+
{...props}
|
|
12
|
+
style={[style, props.style]}
|
|
13
|
+
contentContainerStyle={[contentContainerStyle, props.contentContainerStyle]}
|
|
14
|
+
/>
|
|
15
|
+
)
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
export default KeyboardAvoidingView
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Modal as RNModal, ModalProps } from 'react-native'
|
|
2
|
+
import { useUniwindAccent } from '../../hooks'
|
|
3
|
+
import { copyComponentProperties } from '../utils'
|
|
4
|
+
import { useStyle } from './useStyle'
|
|
5
|
+
|
|
6
|
+
export const Modal = copyComponentProperties(RNModal, (props: ModalProps) => {
|
|
7
|
+
const style = useStyle(props.className)
|
|
8
|
+
const backdropColor = useUniwindAccent(props.backdropColorClassName)
|
|
9
|
+
|
|
10
|
+
return (
|
|
11
|
+
<RNModal
|
|
12
|
+
{...props}
|
|
13
|
+
style={[style, props.style]}
|
|
14
|
+
backdropColor={props.backdropColor ?? backdropColor}
|
|
15
|
+
/>
|
|
16
|
+
)
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
export default Modal
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Pressable as RNPressable, PressableProps } from 'react-native'
|
|
2
|
+
import { UniwindStore } from '../../core/native'
|
|
3
|
+
import { copyComponentProperties } from '../utils'
|
|
4
|
+
import { useStyle } from './useStyle'
|
|
5
|
+
|
|
6
|
+
export const Pressable = copyComponentProperties(RNPressable, (props: PressableProps) => {
|
|
7
|
+
const style = useStyle(props.className, {
|
|
8
|
+
isDisabled: Boolean(props.disabled),
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<RNPressable
|
|
13
|
+
{...props}
|
|
14
|
+
style={state => {
|
|
15
|
+
if (state.pressed) {
|
|
16
|
+
return [
|
|
17
|
+
UniwindStore.getStyles(
|
|
18
|
+
props.className,
|
|
19
|
+
{ isDisabled: Boolean(props.disabled), isPressed: true },
|
|
20
|
+
).styles,
|
|
21
|
+
typeof props.style === 'function' ? props.style(state) : props.style,
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return [style, typeof props.style === 'function' ? props.style(state) : props.style]
|
|
26
|
+
}}
|
|
27
|
+
/>
|
|
28
|
+
)
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
export default Pressable
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { RefreshControl as RNRefreshControl, RefreshControlProps } from 'react-native'
|
|
2
|
+
import { useUniwindAccent } from '../../hooks'
|
|
3
|
+
import { copyComponentProperties } from '../utils'
|
|
4
|
+
import { useStyle } from './useStyle'
|
|
5
|
+
|
|
6
|
+
export const RefreshControl = copyComponentProperties(RNRefreshControl, (props: RefreshControlProps) => {
|
|
7
|
+
const style = useStyle(props.className)
|
|
8
|
+
const color = useUniwindAccent(props.colorsClassName)
|
|
9
|
+
const tintColor = useUniwindAccent(props.tintColorClassName)
|
|
10
|
+
const titleColor = useUniwindAccent(props.titleColorClassName)
|
|
11
|
+
const progressBackgroundColor = useUniwindAccent(props.progressBackgroundColorClassName)
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<RNRefreshControl
|
|
15
|
+
{...props}
|
|
16
|
+
style={[style, props.style]}
|
|
17
|
+
colors={props.colors ?? (color !== undefined ? [color] : undefined)}
|
|
18
|
+
tintColor={props.tintColor ?? tintColor}
|
|
19
|
+
titleColor={props.titleColor ?? titleColor}
|
|
20
|
+
progressBackgroundColor={props.progressBackgroundColor ?? progressBackgroundColor}
|
|
21
|
+
/>
|
|
22
|
+
)
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
export default RefreshControl
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { SafeAreaView as RNSafeAreaView, ViewProps } from 'react-native'
|
|
2
|
+
import { copyComponentProperties } from '../utils'
|
|
3
|
+
import { useStyle } from './useStyle'
|
|
4
|
+
|
|
5
|
+
export const SafeAreaView = copyComponentProperties(RNSafeAreaView, (props: ViewProps) => {
|
|
6
|
+
const style = useStyle(props.className)
|
|
7
|
+
|
|
8
|
+
return (
|
|
9
|
+
<RNSafeAreaView
|
|
10
|
+
{...props}
|
|
11
|
+
style={[style, props.style]}
|
|
12
|
+
/>
|
|
13
|
+
)
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
export default SafeAreaView
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ScrollView as RNScrollView, ScrollViewProps } from 'react-native'
|
|
2
|
+
import { useUniwindAccent } from '../../hooks'
|
|
3
|
+
import { copyComponentProperties } from '../utils'
|
|
4
|
+
import { useStyle } from './useStyle'
|
|
5
|
+
|
|
6
|
+
export const ScrollView = copyComponentProperties(RNScrollView, (props: ScrollViewProps) => {
|
|
7
|
+
const style = useStyle(props.className)
|
|
8
|
+
const contentContainerStyle = useStyle(props.contentContainerClassName)
|
|
9
|
+
const endFillColor = useUniwindAccent(props.endFillColorClassName)
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<RNScrollView
|
|
13
|
+
{...props}
|
|
14
|
+
style={[style, props.style]}
|
|
15
|
+
contentContainerStyle={[contentContainerStyle, props.contentContainerStyle]}
|
|
16
|
+
endFillColor={props.endFillColor ?? endFillColor}
|
|
17
|
+
/>
|
|
18
|
+
)
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
export default ScrollView
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { SectionList as RNSectionList, SectionListProps } from 'react-native'
|
|
2
|
+
import { useUniwindAccent } from '../../hooks'
|
|
3
|
+
import { copyComponentProperties } from '../utils'
|
|
4
|
+
import { useStyle } from './useStyle'
|
|
5
|
+
|
|
6
|
+
export const SectionList = copyComponentProperties(RNSectionList, (props: SectionListProps<unknown, unknown>) => {
|
|
7
|
+
const style = useStyle(props.className)
|
|
8
|
+
const contentContainerStyle = useStyle(props.contentContainerClassName)
|
|
9
|
+
const listFooterComponentStyle = useStyle(props.ListFooterComponentClassName)
|
|
10
|
+
const listHeaderComponentStyle = useStyle(props.ListHeaderComponentClassName)
|
|
11
|
+
const endFillColor = useUniwindAccent(props.endFillColorClassName)
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<RNSectionList
|
|
15
|
+
{...props}
|
|
16
|
+
style={[style, props.style]}
|
|
17
|
+
contentContainerStyle={[contentContainerStyle, props.contentContainerStyle]}
|
|
18
|
+
ListFooterComponentStyle={[listFooterComponentStyle, props.ListFooterComponentStyle]}
|
|
19
|
+
ListHeaderComponentStyle={[listHeaderComponentStyle, props.ListHeaderComponentStyle]}
|
|
20
|
+
endFillColor={props.endFillColor ?? endFillColor}
|
|
21
|
+
/>
|
|
22
|
+
)
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
export default SectionList
|