Repository URL to install this package:
Version:
1.2.13 ▾
|
"use strict";
// @flow
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
/* Import singletons */
const flatten_1 = __importDefault(require("./utils/flatten"));
const stringifyRules_1 = __importDefault(require("./utils/stringifyRules"));
const isStyledComponent_1 = __importDefault(require("./utils/isStyledComponent"));
exports.isStyledComponent = isStyledComponent_1.default;
const consolidateStreamedStyles_1 = __importDefault(require("./utils/consolidateStreamedStyles"));
exports.consolidateStreamedStyles = consolidateStreamedStyles_1.default;
const generateAlphabeticName_1 = __importDefault(require("./utils/generateAlphabeticName"));
const css_1 = __importDefault(require("./constructors/css"));
exports.css = css_1.default;
const ServerStyleSheet_1 = __importDefault(require("./models/ServerStyleSheet"));
exports.ServerStyleSheet = ServerStyleSheet_1.default;
const StyleSheetManager_1 = __importDefault(require("./models/StyleSheetManager"));
exports.StyleSheetManager = StyleSheetManager_1.default;
/* Import singleton constructors */
const StyledComponent_1 = __importDefault(require("./models/StyledComponent"));
const ComponentStyle_1 = __importDefault(require("./models/ComponentStyle"));
const styled_1 = __importDefault(require("./constructors/styled"));
const keyframes_1 = __importDefault(require("./constructors/keyframes"));
const injectGlobal_1 = __importDefault(require("./constructors/injectGlobal"));
const constructWithOptions_1 = __importDefault(require("./constructors/constructWithOptions"));
/* Import factories @@fork */
const _compat_1 = require("./_compat");
/* Import components */
const ThemeProvider_1 = __importDefault(require("./models/ThemeProvider"));
exports.ThemeProvider = ThemeProvider_1.default;
/* Import Higher Order Components */
const withTheme_1 = __importDefault(require("./hoc/withTheme"));
exports.withTheme = withTheme_1.default;
/* Warning if you've imported this file on React Native */
if (process.env.NODE_ENV !== 'production' &&
typeof navigator !== 'undefined' &&
navigator.product === 'ReactNative') {
// eslint-disable-next-line no-console
console.warn("It looks like you've imported 'styled-components' on React Native.\n" +
"Perhaps you're looking to import 'styled-components/native'?\n" +
'Read more about this at https://www.styled-components.com/docs/basics#react-native');
}
/* Warning if there are several instances of styled-components */
if (process.env.NODE_ENV !== 'production' &&
process.env.NODE_ENV !== 'test' &&
typeof window !== 'undefined' &&
typeof navigator !== 'undefined' &&
typeof navigator.userAgent === 'string' &&
navigator.userAgent.indexOf('Node.js') === -1 &&
navigator.userAgent.indexOf('jsdom') === -1) {
window['__styled-components-init__'] =
window['__styled-components-init__'] || 0;
if (window['__styled-components-init__'] === 1) {
// eslint-disable-next-line no-console
console.warn("It looks like there are several instances of 'styled-components' initialized in this application. " +
'This may cause dynamic styles not rendering properly, errors happening during rehydration process ' +
'and makes your application bigger without a good reason.\n\n' +
'See https://s-c.sh/2BAXzed for more info.');
}
window['__styled-components-init__'] += 1;
}
/* Instantiate singletons */
const ComponentStyle = ComponentStyle_1.default(generateAlphabeticName_1.default, flatten_1.default, stringifyRules_1.default);
const constructWithOptions = constructWithOptions_1.default(css_1.default);
const StyledComponent = StyledComponent_1.default(ComponentStyle, constructWithOptions);
/* Instantiate exported singletons */
const keyframes = keyframes_1.default(generateAlphabeticName_1.default, stringifyRules_1.default, css_1.default);
exports.keyframes = keyframes;
const injectGlobal = injectGlobal_1.default(stringifyRules_1.default, css_1.default);
exports.injectGlobal = injectGlobal;
const _styledFn = styled_1.default(StyledComponent, constructWithOptions);
const withComponent = _compat_1.createWithComponent(_styledFn);
exports.withComponent = withComponent;
_styledFn.withComponent = withComponent;
const styled = _styledFn;
exports.styled = styled;
/* Export everything */
__export(require("./secretInternals"));
exports.default = styled;
//# sourceMappingURL=index.js.map