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

31 lines (28 loc) 1.48 kB
import reactPrimitives from 'react-primitives'; 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'; var InlineStyle = _InlineStyle(reactPrimitives.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 = ['Image', 'Text', 'Touchable', 'View']; /* 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(reactPrimitives[alias]); }, }); }); export { styled as default }; //# sourceMappingURL=styled-components-primitives.esm.js.map