UNPKG

@baolq/styled-components

Version:

Visual primitives for the component age. Use the best bits of ES6 and CSS to style your apps without stress

82 lines (79 loc) 2.53 kB
import constructWithOptions from '../constructors/constructWithOptions.ts'; export { default as css } from '../constructors/css.ts'; export { default as withTheme } from '../hoc/withTheme.tsx'; export { default as useTheme } from '../hooks/useTheme.ts'; import _InlineStyle from '../models/InlineStyle.ts'; import _StyledNativeComponent from '../models/StyledNativeComponent.ts'; export { ThemeConsumer, ThemeContext, default as ThemeProvider } from '../models/ThemeProvider.tsx'; export { default as isStyledComponent } from '../utils/isStyledComponent.ts'; // eslint-disable-next-line @typescript-eslint/no-var-requires var reactNative = require('react-native'); var InlineStyle = _InlineStyle(reactNative.StyleSheet); var StyledNativeComponent = _StyledNativeComponent(InlineStyle); var styled = function (tag) { return constructWithOptions(StyledNativeComponent, tag); }; /* React native lazy-requires each of these modules for some reason, so let's * assume it's for a good reason and not eagerly load them all */ var aliases = [ 'ActivityIndicator', 'ActivityIndicatorIOS', 'ART', 'Button', 'DatePickerIOS', 'DrawerLayoutAndroid', 'FlatList', 'Image', 'ImageBackground', 'ImageEditor', 'ImageStore', 'KeyboardAvoidingView', 'ListView', 'MapView', 'Modal', 'NavigatorIOS', 'Picker', 'PickerIOS', 'Pressable', 'ProgressBarAndroid', 'ProgressViewIOS', 'RecyclerViewBackedScrollView', 'RefreshControl', 'SafeAreaView', 'ScrollView', 'SectionList', 'SegmentedControlIOS', 'Slider', 'SliderIOS', 'SnapshotViewIOS', 'StatusBar', 'SwipeableListView', 'Switch', 'SwitchAndroid', 'SwitchIOS', 'TabBarIOS', 'Text', 'TextInput', 'ToastAndroid', 'ToolbarAndroid', 'Touchable', 'TouchableHighlight', 'TouchableNativeFeedback', 'TouchableOpacity', 'TouchableWithoutFeedback', 'View', 'ViewPagerAndroid', 'VirtualizedList', 'WebView', ]; /* Define a getter for each alias which simply gets the reactNative component * and passes it to styled */ aliases.forEach(function (alias) { return Object.defineProperty(styled, alias, { enumerable: true, configurable: false, get: function () { return styled(reactNative[alias]); }, }); }); export { styled as default }; //# sourceMappingURL=styled-components.native.esm.js.map