Repository URL to install this package:
|
Version:
1.2.11 ▾
|
"use strict";
// @flow
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
/* eslint-disable import/no-unresolved */
const react_native_1 = __importDefault(require("react-native"));
const InlineStyle_1 = __importDefault(require("../models/InlineStyle"));
const StyledNativeComponent_1 = __importDefault(require("../models/StyledNativeComponent"));
const constructWithOptions_1 = __importDefault(require("../constructors/constructWithOptions"));
const css_1 = __importDefault(require("../constructors/css"));
exports.css = css_1.default;
const ThemeProvider_1 = __importDefault(require("../models/ThemeProvider"));
exports.ThemeProvider = ThemeProvider_1.default;
const withTheme_1 = __importDefault(require("../hoc/withTheme"));
exports.withTheme = withTheme_1.default;
const isStyledComponent_1 = __importDefault(require("../utils/isStyledComponent"));
exports.isStyledComponent = isStyledComponent_1.default;
const constructWithOptions = constructWithOptions_1.default(css_1.default);
const InlineStyle = InlineStyle_1.default(react_native_1.default.StyleSheet);
const StyledNativeComponent = StyledNativeComponent_1.default(constructWithOptions, InlineStyle);
const styled = (tag) => 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 */
const aliases = `ActivityIndicator ActivityIndicatorIOS ART Button DatePickerIOS DrawerLayoutAndroid
Image ImageBackground ImageEditor ImageStore KeyboardAvoidingView ListView MapView Modal NavigatorIOS
Picker PickerIOS ProgressBarAndroid ProgressViewIOS ScrollView SegmentedControlIOS Slider
SliderIOS SnapshotViewIOS Switch RecyclerViewBackedScrollView RefreshControl SafeAreaView StatusBar
SwipeableListView SwitchAndroid SwitchIOS TabBarIOS Text TextInput ToastAndroid ToolbarAndroid
Touchable TouchableHighlight TouchableNativeFeedback TouchableOpacity TouchableWithoutFeedback
View ViewPagerAndroid WebView FlatList SectionList VirtualizedList`;
/* Define a getter for each alias which simply gets the reactNative component
* and passes it to styled */
aliases.split(/\s+/m).forEach(alias => Object.defineProperty(styled, alias, {
enumerable: true,
configurable: false,
get() {
return styled(react_native_1.default[alias]);
},
}));
exports.default = styled;
//# sourceMappingURL=index.js.map