styled-components 6.0.0-beta.6 → 6.0.0-beta.7
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/dist/base.d.ts +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/models/StyleSheetManager.d.ts +38 -13
- package/dist/native/index.d.ts +1 -1
- package/dist/styled-components-macro.cjs.js +2 -7
- package/dist/styled-components-macro.cjs.js.map +1 -1
- package/dist/styled-components.browser.cjs.js +36 -40
- package/dist/styled-components.browser.cjs.js.map +1 -1
- package/dist/styled-components.browser.esm.js +17 -16
- package/dist/styled-components.browser.esm.js.map +1 -1
- package/dist/styled-components.cjs.js +35 -39
- package/dist/styled-components.cjs.js.map +1 -1
- package/dist/styled-components.esm.js +17 -16
- package/dist/styled-components.esm.js.map +1 -1
- package/dist/styled-components.js +32 -130
- package/dist/styled-components.js.map +1 -1
- package/dist/styled-components.min.js +1 -1
- package/dist/styled-components.min.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types.d.ts +0 -2
- package/dist/utils/stylis.d.ts +3 -3
- package/native/dist/base.d.ts +2 -2
- package/native/dist/index.d.ts +1 -1
- package/native/dist/models/StyleSheetManager.d.ts +38 -13
- package/native/dist/native/index.d.ts +1 -1
- package/native/dist/styled-components.native.cjs.js +24 -25
- package/native/dist/styled-components.native.cjs.js.map +1 -1
- package/native/dist/styled-components.native.esm.js +13 -9
- package/native/dist/styled-components.native.esm.js.map +1 -1
- package/native/dist/types.d.ts +0 -2
- package/native/dist/utils/stylis.d.ts +3 -3
- package/package.json +31 -32
- package/native/dist/base.d.ts.map +0 -1
- package/native/dist/constants.d.ts.map +0 -1
- package/native/dist/constructors/constructWithOptions.d.ts.map +0 -1
- package/native/dist/constructors/createGlobalStyle.d.ts.map +0 -1
- package/native/dist/constructors/css.d.ts.map +0 -1
- package/native/dist/constructors/keyframes.d.ts.map +0 -1
- package/native/dist/constructors/styled.d.ts.map +0 -1
- package/native/dist/dist/base.d.ts +0 -18
- package/native/dist/dist/base.d.ts.map +0 -1
- package/native/dist/dist/constants.d.ts +0 -9
- package/native/dist/dist/constants.d.ts.map +0 -1
- package/native/dist/dist/constructors/constructWithOptions.d.ts +0 -20
- package/native/dist/dist/constructors/constructWithOptions.d.ts.map +0 -1
- package/native/dist/dist/constructors/createGlobalStyle.d.ts +0 -4
- package/native/dist/dist/constructors/createGlobalStyle.d.ts.map +0 -1
- package/native/dist/dist/constructors/css.d.ts +0 -5
- package/native/dist/dist/constructors/css.d.ts.map +0 -1
- package/native/dist/dist/constructors/keyframes.d.ts +0 -4
- package/native/dist/dist/constructors/keyframes.d.ts.map +0 -1
- package/native/dist/dist/constructors/styled.d.ts +0 -186
- package/native/dist/dist/constructors/styled.d.ts.map +0 -1
- package/native/dist/dist/hoc/withTheme.d.ts +0 -4
- package/native/dist/dist/hoc/withTheme.d.ts.map +0 -1
- package/native/dist/dist/hoc/withTheme.spec.d.ts +0 -2
- package/native/dist/dist/hoc/withTheme.spec.d.ts.map +0 -1
- package/native/dist/dist/hooks/useTheme.d.ts +0 -4
- package/native/dist/dist/hooks/useTheme.d.ts.map +0 -1
- package/native/dist/dist/index-standalone.d.ts +0 -3
- package/native/dist/dist/index-standalone.d.ts.map +0 -1
- package/native/dist/dist/index.d.ts +0 -4
- package/native/dist/dist/index.d.ts.map +0 -1
- package/native/dist/dist/macro/index.d.ts +0 -3
- package/native/dist/dist/macro/index.d.ts.map +0 -1
- package/native/dist/dist/macro/test/babel.config.d.ts +0 -1
- package/native/dist/dist/macro/test/babel.config.d.ts.map +0 -1
- package/native/dist/dist/models/ComponentStyle.d.ts +0 -16
- package/native/dist/dist/models/ComponentStyle.d.ts.map +0 -1
- package/native/dist/dist/models/GlobalStyle.d.ts +0 -12
- package/native/dist/dist/models/GlobalStyle.d.ts.map +0 -1
- package/native/dist/dist/models/InlineStyle.d.ts +0 -7
- package/native/dist/dist/models/InlineStyle.d.ts.map +0 -1
- package/native/dist/dist/models/Keyframes.d.ts +0 -12
- package/native/dist/dist/models/Keyframes.d.ts.map +0 -1
- package/native/dist/dist/models/ServerStyleSheet.d.ts +0 -16
- package/native/dist/dist/models/ServerStyleSheet.d.ts.map +0 -1
- package/native/dist/dist/models/StyleSheetManager.d.ts +0 -22
- package/native/dist/dist/models/StyleSheetManager.d.ts.map +0 -1
- package/native/dist/dist/models/StyledComponent.d.ts +0 -4
- package/native/dist/dist/models/StyledComponent.d.ts.map +0 -1
- package/native/dist/dist/models/StyledNativeComponent.d.ts +0 -4
- package/native/dist/dist/models/StyledNativeComponent.d.ts.map +0 -1
- package/native/dist/dist/models/ThemeProvider.d.ts +0 -18
- package/native/dist/dist/models/ThemeProvider.d.ts.map +0 -1
- package/native/dist/dist/native/index.d.ts +0 -65
- package/native/dist/dist/native/index.d.ts.map +0 -1
- package/native/dist/dist/primitives/index.d.ts +0 -23
- package/native/dist/dist/primitives/index.d.ts.map +0 -1
- package/native/dist/dist/secretInternals.d.ts +0 -6
- package/native/dist/dist/secretInternals.d.ts.map +0 -1
- package/native/dist/dist/sheet/GroupIDAllocator.d.ts +0 -5
- package/native/dist/dist/sheet/GroupIDAllocator.d.ts.map +0 -1
- package/native/dist/dist/sheet/GroupedTag.d.ts +0 -12
- package/native/dist/dist/sheet/GroupedTag.d.ts.map +0 -1
- package/native/dist/dist/sheet/Rehydration.d.ts +0 -4
- package/native/dist/dist/sheet/Rehydration.d.ts.map +0 -1
- package/native/dist/dist/sheet/Sheet.d.ts +0 -41
- package/native/dist/dist/sheet/Sheet.d.ts.map +0 -1
- package/native/dist/dist/sheet/Tag.d.ts +0 -55
- package/native/dist/dist/sheet/Tag.d.ts.map +0 -1
- package/native/dist/dist/sheet/dom.d.ts +0 -5
- package/native/dist/dist/sheet/dom.d.ts.map +0 -1
- package/native/dist/dist/sheet/index.d.ts +0 -2
- package/native/dist/dist/sheet/index.d.ts.map +0 -1
- package/native/dist/dist/sheet/types.d.ts +0 -35
- package/native/dist/dist/sheet/types.d.ts.map +0 -1
- package/native/dist/dist/test/globals.d.ts +0 -3
- package/native/dist/dist/test/globals.d.ts.map +0 -1
- package/native/dist/dist/test/utils.d.ts +0 -192
- package/native/dist/dist/test/utils.d.ts.map +0 -1
- package/native/dist/dist/types.d.ts +0 -121
- package/native/dist/dist/types.d.ts.map +0 -1
- package/native/dist/dist/utils/addUnitIfNeeded.d.ts +0 -2
- package/native/dist/dist/utils/addUnitIfNeeded.d.ts.map +0 -1
- package/native/dist/dist/utils/checkDynamicCreation.d.ts +0 -2
- package/native/dist/dist/utils/checkDynamicCreation.d.ts.map +0 -1
- package/native/dist/dist/utils/createWarnTooManyClasses.d.ts +0 -4
- package/native/dist/dist/utils/createWarnTooManyClasses.d.ts.map +0 -1
- package/native/dist/dist/utils/determineTheme.d.ts +0 -3
- package/native/dist/dist/utils/determineTheme.d.ts.map +0 -1
- package/native/dist/dist/utils/domElements.d.ts +0 -3
- package/native/dist/dist/utils/domElements.d.ts.map +0 -1
- package/native/dist/dist/utils/empties.d.ts +0 -4
- package/native/dist/dist/utils/empties.d.ts.map +0 -1
- package/native/dist/dist/utils/error.d.ts +0 -6
- package/native/dist/dist/utils/error.d.ts.map +0 -1
- package/native/dist/dist/utils/errors.d.ts +0 -21
- package/native/dist/dist/utils/errors.d.ts.map +0 -1
- package/native/dist/dist/utils/escape.d.ts +0 -6
- package/native/dist/dist/utils/escape.d.ts.map +0 -1
- package/native/dist/dist/utils/flatten.d.ts +0 -5
- package/native/dist/dist/utils/flatten.d.ts.map +0 -1
- package/native/dist/dist/utils/generateAlphabeticName.d.ts +0 -2
- package/native/dist/dist/utils/generateAlphabeticName.d.ts.map +0 -1
- package/native/dist/dist/utils/generateComponentId.d.ts +0 -2
- package/native/dist/dist/utils/generateComponentId.d.ts.map +0 -1
- package/native/dist/dist/utils/generateDisplayName.d.ts +0 -3
- package/native/dist/dist/utils/generateDisplayName.d.ts.map +0 -1
- package/native/dist/dist/utils/getComponentName.d.ts +0 -3
- package/native/dist/dist/utils/getComponentName.d.ts.map +0 -1
- package/native/dist/dist/utils/hash.d.ts +0 -4
- package/native/dist/dist/utils/hash.d.ts.map +0 -1
- package/native/dist/dist/utils/hoist.d.ts +0 -52
- package/native/dist/dist/utils/hoist.d.ts.map +0 -1
- package/native/dist/dist/utils/hyphenateStyleName.d.ts +0 -15
- package/native/dist/dist/utils/hyphenateStyleName.d.ts.map +0 -1
- package/native/dist/dist/utils/interleave.d.ts +0 -3
- package/native/dist/dist/utils/interleave.d.ts.map +0 -1
- package/native/dist/dist/utils/isFunction.d.ts +0 -2
- package/native/dist/dist/utils/isFunction.d.ts.map +0 -1
- package/native/dist/dist/utils/isPlainObject.d.ts +0 -2
- package/native/dist/dist/utils/isPlainObject.d.ts.map +0 -1
- package/native/dist/dist/utils/isStatelessFunction.d.ts +0 -2
- package/native/dist/dist/utils/isStatelessFunction.d.ts.map +0 -1
- package/native/dist/dist/utils/isStaticRules.d.ts +0 -3
- package/native/dist/dist/utils/isStaticRules.d.ts.map +0 -1
- package/native/dist/dist/utils/isStyledComponent.d.ts +0 -3
- package/native/dist/dist/utils/isStyledComponent.d.ts.map +0 -1
- package/native/dist/dist/utils/isTag.d.ts +0 -3
- package/native/dist/dist/utils/isTag.d.ts.map +0 -1
- package/native/dist/dist/utils/joinStrings.d.ts +0 -5
- package/native/dist/dist/utils/joinStrings.d.ts.map +0 -1
- package/native/dist/dist/utils/mixinDeep.d.ts +0 -8
- package/native/dist/dist/utils/mixinDeep.d.ts.map +0 -1
- package/native/dist/dist/utils/nonce.d.ts +0 -2
- package/native/dist/dist/utils/nonce.d.ts.map +0 -1
- package/native/dist/dist/utils/stylis.d.ts +0 -10
- package/native/dist/dist/utils/stylis.d.ts.map +0 -1
- package/native/dist/hoc/withTheme.d.ts.map +0 -1
- package/native/dist/hoc/withTheme.spec.d.ts.map +0 -1
- package/native/dist/hooks/useTheme.d.ts.map +0 -1
- package/native/dist/index-standalone.d.ts.map +0 -1
- package/native/dist/index.d.ts.map +0 -1
- package/native/dist/macro/index.d.ts.map +0 -1
- package/native/dist/macro/test/babel.config.d.ts +0 -1
- package/native/dist/macro/test/babel.config.d.ts.map +0 -1
- package/native/dist/models/ComponentStyle.d.ts.map +0 -1
- package/native/dist/models/GlobalStyle.d.ts.map +0 -1
- package/native/dist/models/InlineStyle.d.ts.map +0 -1
- package/native/dist/models/Keyframes.d.ts.map +0 -1
- package/native/dist/models/ServerStyleSheet.d.ts.map +0 -1
- package/native/dist/models/StyleSheetManager.d.ts.map +0 -1
- package/native/dist/models/StyledComponent.d.ts.map +0 -1
- package/native/dist/models/StyledNativeComponent.d.ts.map +0 -1
- package/native/dist/models/ThemeProvider.d.ts.map +0 -1
- package/native/dist/native/index.d.ts.map +0 -1
- package/native/dist/primitives/index.d.ts +0 -23
- package/native/dist/primitives/index.d.ts.map +0 -1
- package/native/dist/secretInternals.d.ts.map +0 -1
- package/native/dist/sheet/GroupIDAllocator.d.ts.map +0 -1
- package/native/dist/sheet/GroupedTag.d.ts.map +0 -1
- package/native/dist/sheet/Rehydration.d.ts.map +0 -1
- package/native/dist/sheet/Sheet.d.ts.map +0 -1
- package/native/dist/sheet/Tag.d.ts.map +0 -1
- package/native/dist/sheet/dom.d.ts.map +0 -1
- package/native/dist/sheet/index.d.ts.map +0 -1
- package/native/dist/sheet/types.d.ts.map +0 -1
- package/native/dist/test/globals.d.ts.map +0 -1
- package/native/dist/test/utils.d.ts.map +0 -1
- package/native/dist/types.d.ts.map +0 -1
- package/native/dist/utils/addUnitIfNeeded.d.ts.map +0 -1
- package/native/dist/utils/checkDynamicCreation.d.ts.map +0 -1
- package/native/dist/utils/createWarnTooManyClasses.d.ts.map +0 -1
- package/native/dist/utils/determineTheme.d.ts.map +0 -1
- package/native/dist/utils/domElements.d.ts.map +0 -1
- package/native/dist/utils/empties.d.ts.map +0 -1
- package/native/dist/utils/error.d.ts.map +0 -1
- package/native/dist/utils/errors.d.ts.map +0 -1
- package/native/dist/utils/escape.d.ts.map +0 -1
- package/native/dist/utils/flatten.d.ts.map +0 -1
- package/native/dist/utils/generateAlphabeticName.d.ts.map +0 -1
- package/native/dist/utils/generateComponentId.d.ts.map +0 -1
- package/native/dist/utils/generateDisplayName.d.ts.map +0 -1
- package/native/dist/utils/getComponentName.d.ts.map +0 -1
- package/native/dist/utils/hash.d.ts.map +0 -1
- package/native/dist/utils/hoist.d.ts.map +0 -1
- package/native/dist/utils/hyphenateStyleName.d.ts.map +0 -1
- package/native/dist/utils/interleave.d.ts.map +0 -1
- package/native/dist/utils/isFunction.d.ts.map +0 -1
- package/native/dist/utils/isPlainObject.d.ts.map +0 -1
- package/native/dist/utils/isStatelessFunction.d.ts.map +0 -1
- package/native/dist/utils/isStaticRules.d.ts.map +0 -1
- package/native/dist/utils/isStyledComponent.d.ts.map +0 -1
- package/native/dist/utils/isTag.d.ts.map +0 -1
- package/native/dist/utils/joinStrings.d.ts.map +0 -1
- package/native/dist/utils/mixinDeep.d.ts.map +0 -1
- package/native/dist/utils/nonce.d.ts.map +0 -1
- package/native/dist/utils/stylis.d.ts.map +0 -1
|
@@ -4,15 +4,11 @@
|
|
|
4
4
|
(global = global || self, global.styled = factory(global.React));
|
|
5
5
|
})(this, (function (React) { 'use strict';
|
|
6
6
|
|
|
7
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
|
-
|
|
9
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
10
|
-
|
|
11
7
|
var SC_ATTR = (typeof process !== 'undefined' && (process.env.REACT_APP_SC_ATTR || process.env.SC_ATTR)) ||
|
|
12
8
|
'data-styled';
|
|
13
9
|
var SC_ATTR_ACTIVE = 'active';
|
|
14
10
|
var SC_ATTR_VERSION = 'data-styled-version';
|
|
15
|
-
var SC_VERSION = "6.0.0-beta.
|
|
11
|
+
var SC_VERSION = "6.0.0-beta.7";
|
|
16
12
|
var SPLITTER = '/*!sc*/\n';
|
|
17
13
|
var IS_BROWSER = typeof window !== 'undefined' && 'HTMLElement' in window;
|
|
18
14
|
var DISABLE_SPEEDY = Boolean(typeof SC_DISABLE_SPEEDY === 'boolean'
|
|
@@ -59,18 +55,6 @@
|
|
|
59
55
|
return __assign.apply(this, arguments);
|
|
60
56
|
};
|
|
61
57
|
|
|
62
|
-
function __rest(s, e) {
|
|
63
|
-
var t = {};
|
|
64
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
65
|
-
t[p] = s[p];
|
|
66
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
67
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
68
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
69
|
-
t[p[i]] = s[p[i]];
|
|
70
|
-
}
|
|
71
|
-
return t;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
58
|
function __spreadArray(to, from, pack) {
|
|
75
59
|
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
76
60
|
if (ar || !(i in from)) {
|
|
@@ -670,7 +654,11 @@
|
|
|
670
654
|
props[0] = props[0].replace(_selectorRegexp, selfReferenceReplacer);
|
|
671
655
|
}
|
|
672
656
|
};
|
|
673
|
-
var stringifyRules = function (css, selector,
|
|
657
|
+
var stringifyRules = function (css, selector,
|
|
658
|
+
/**
|
|
659
|
+
* This "prefix" referes to a _selector_ prefix.
|
|
660
|
+
*/
|
|
661
|
+
prefix, componentId) {
|
|
674
662
|
if (selector === void 0) { selector = ''; }
|
|
675
663
|
if (prefix === void 0) { prefix = ''; }
|
|
676
664
|
if (componentId === void 0) { componentId = '&'; }
|
|
@@ -683,11 +671,16 @@
|
|
|
683
671
|
_selectorRegexp = new RegExp("\\".concat(_selector, "\\b"), 'g');
|
|
684
672
|
_consecutiveSelfRefRegExp = new RegExp("(\\".concat(_selector, "\\b){2,}"));
|
|
685
673
|
var middlewares = plugins.slice();
|
|
674
|
+
/**
|
|
675
|
+
* Enables automatic vendor-prefixing for styles.
|
|
676
|
+
*/
|
|
686
677
|
if (options.prefix || options.prefix === undefined) {
|
|
687
678
|
middlewares.unshift(pe);
|
|
688
679
|
}
|
|
689
680
|
middlewares.push(selfReferenceReplacementPlugin, oe);
|
|
690
|
-
return serialize(ne(
|
|
681
|
+
return serialize(ne(options.namespace || prefix || selector
|
|
682
|
+
? "".concat(options.namespace ? options.namespace + ' ' : '').concat(prefix, " ").concat(selector, " { ").concat(flatCSS, " }")
|
|
683
|
+
: flatCSS), le(middlewares));
|
|
691
684
|
};
|
|
692
685
|
stringifyRules.hash = plugins.length
|
|
693
686
|
? plugins
|
|
@@ -702,9 +695,9 @@
|
|
|
702
695
|
return stringifyRules;
|
|
703
696
|
}
|
|
704
697
|
|
|
705
|
-
var StyleSheetContext =
|
|
698
|
+
var StyleSheetContext = React.createContext(undefined);
|
|
706
699
|
var StyleSheetConsumer = StyleSheetContext.Consumer;
|
|
707
|
-
var StylisContext =
|
|
700
|
+
var StylisContext = React.createContext(undefined);
|
|
708
701
|
var mainSheet = new StyleSheet();
|
|
709
702
|
var mainStylis = createStylisInstance();
|
|
710
703
|
function useStyleSheet() {
|
|
@@ -732,16 +725,16 @@
|
|
|
732
725
|
}, [props.disableCSSOMInjection, props.sheet, props.target]);
|
|
733
726
|
var stylis = React.useMemo(function () {
|
|
734
727
|
return createStylisInstance({
|
|
735
|
-
options: { prefix: !props.disableVendorPrefixes },
|
|
728
|
+
options: { namespace: props.namespace, prefix: !props.disableVendorPrefixes },
|
|
736
729
|
plugins: plugins,
|
|
737
730
|
});
|
|
738
|
-
}, [props.disableVendorPrefixes, plugins]);
|
|
731
|
+
}, [props.disableVendorPrefixes, props.namespace, plugins]);
|
|
739
732
|
React.useEffect(function () {
|
|
740
733
|
if (!shallowequal(plugins, props.stylisPlugins))
|
|
741
734
|
setPlugins(props.stylisPlugins);
|
|
742
735
|
}, [props.stylisPlugins]);
|
|
743
|
-
return (
|
|
744
|
-
|
|
736
|
+
return (React.createElement(StyleSheetContext.Provider, { value: styleSheet },
|
|
737
|
+
React.createElement(StylisContext.Provider, { value: stylis }, React.Children.only(props.children)
|
|
745
738
|
)));
|
|
746
739
|
}
|
|
747
740
|
|
|
@@ -769,77 +762,6 @@
|
|
|
769
762
|
return Keyframes;
|
|
770
763
|
}());
|
|
771
764
|
|
|
772
|
-
function unwrapExports (x) {
|
|
773
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
774
|
-
}
|
|
775
|
-
|
|
776
|
-
function createCommonjsModule(fn, module) {
|
|
777
|
-
return module = { exports: {} }, fn(module, module.exports), module.exports;
|
|
778
|
-
}
|
|
779
|
-
|
|
780
|
-
var unitless_cjs_prod = createCommonjsModule(function (module, exports) {
|
|
781
|
-
|
|
782
|
-
Object.defineProperty(exports, "__esModule", {
|
|
783
|
-
value: !0
|
|
784
|
-
});
|
|
785
|
-
|
|
786
|
-
var unitlessKeys = {
|
|
787
|
-
animationIterationCount: 1,
|
|
788
|
-
borderImageOutset: 1,
|
|
789
|
-
borderImageSlice: 1,
|
|
790
|
-
borderImageWidth: 1,
|
|
791
|
-
boxFlex: 1,
|
|
792
|
-
boxFlexGroup: 1,
|
|
793
|
-
boxOrdinalGroup: 1,
|
|
794
|
-
columnCount: 1,
|
|
795
|
-
columns: 1,
|
|
796
|
-
flex: 1,
|
|
797
|
-
flexGrow: 1,
|
|
798
|
-
flexPositive: 1,
|
|
799
|
-
flexShrink: 1,
|
|
800
|
-
flexNegative: 1,
|
|
801
|
-
flexOrder: 1,
|
|
802
|
-
gridRow: 1,
|
|
803
|
-
gridRowEnd: 1,
|
|
804
|
-
gridRowSpan: 1,
|
|
805
|
-
gridRowStart: 1,
|
|
806
|
-
gridColumn: 1,
|
|
807
|
-
gridColumnEnd: 1,
|
|
808
|
-
gridColumnSpan: 1,
|
|
809
|
-
gridColumnStart: 1,
|
|
810
|
-
msGridRow: 1,
|
|
811
|
-
msGridRowSpan: 1,
|
|
812
|
-
msGridColumn: 1,
|
|
813
|
-
msGridColumnSpan: 1,
|
|
814
|
-
fontWeight: 1,
|
|
815
|
-
lineHeight: 1,
|
|
816
|
-
opacity: 1,
|
|
817
|
-
order: 1,
|
|
818
|
-
orphans: 1,
|
|
819
|
-
tabSize: 1,
|
|
820
|
-
widows: 1,
|
|
821
|
-
zIndex: 1,
|
|
822
|
-
zoom: 1,
|
|
823
|
-
WebkitLineClamp: 1,
|
|
824
|
-
fillOpacity: 1,
|
|
825
|
-
floodOpacity: 1,
|
|
826
|
-
stopOpacity: 1,
|
|
827
|
-
strokeDasharray: 1,
|
|
828
|
-
strokeDashoffset: 1,
|
|
829
|
-
strokeMiterlimit: 1,
|
|
830
|
-
strokeOpacity: 1,
|
|
831
|
-
strokeWidth: 1
|
|
832
|
-
};
|
|
833
|
-
|
|
834
|
-
exports.default = unitlessKeys;
|
|
835
|
-
});
|
|
836
|
-
|
|
837
|
-
unwrapExports(unitless_cjs_prod);
|
|
838
|
-
|
|
839
|
-
var unitless_cjs_dev = createCommonjsModule(function (module, exports) {
|
|
840
|
-
|
|
841
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
842
|
-
|
|
843
765
|
var unitlessKeys = {
|
|
844
766
|
animationIterationCount: 1,
|
|
845
767
|
borderImageOutset: 1,
|
|
@@ -889,25 +811,13 @@
|
|
|
889
811
|
strokeWidth: 1
|
|
890
812
|
};
|
|
891
813
|
|
|
892
|
-
exports.default = unitlessKeys;
|
|
893
|
-
});
|
|
894
|
-
|
|
895
|
-
unwrapExports(unitless_cjs_dev);
|
|
896
|
-
|
|
897
|
-
var unitless_cjs = createCommonjsModule(function (module) {
|
|
898
|
-
|
|
899
|
-
{
|
|
900
|
-
module.exports = unitless_cjs_dev;
|
|
901
|
-
}
|
|
902
|
-
});
|
|
903
|
-
|
|
904
814
|
// Taken from https://github.com/facebook/react/blob/b87aabdfe1b7461e7331abb3601d9e6bb27544bc/packages/react-dom/src/shared/dangerousStyleValue.js
|
|
905
815
|
function addUnitIfNeeded(name, value) {
|
|
906
816
|
// https://github.com/amilajack/eslint-plugin-flowtype-errors/issues/133
|
|
907
817
|
if (value == null || typeof value === 'boolean' || value === '') {
|
|
908
818
|
return '';
|
|
909
819
|
}
|
|
910
|
-
if (typeof value === 'number' && value !== 0 && !(name in
|
|
820
|
+
if (typeof value === 'number' && value !== 0 && !(name in unitlessKeys)) {
|
|
911
821
|
return "".concat(value, "px"); // Presumes implicit 'px' suffix for unitless numbers
|
|
912
822
|
}
|
|
913
823
|
return String(value).trim();
|
|
@@ -1083,7 +993,7 @@
|
|
|
1083
993
|
return GlobalStyle;
|
|
1084
994
|
}());
|
|
1085
995
|
|
|
1086
|
-
var ThemeContext =
|
|
996
|
+
var ThemeContext = React.createContext(undefined);
|
|
1087
997
|
var ThemeConsumer = ThemeContext.Consumer;
|
|
1088
998
|
function mergeTheme(theme, outerTheme) {
|
|
1089
999
|
if (!theme) {
|
|
@@ -1111,7 +1021,7 @@
|
|
|
1111
1021
|
if (!props.children) {
|
|
1112
1022
|
return null;
|
|
1113
1023
|
}
|
|
1114
|
-
return
|
|
1024
|
+
return React.createElement(ThemeContext.Provider, { value: themeContext }, props.children);
|
|
1115
1025
|
}
|
|
1116
1026
|
|
|
1117
1027
|
var invalidHookCallRe = /invalid hook call/i;
|
|
@@ -1243,10 +1153,10 @@
|
|
|
1243
1153
|
var GlobalStyleComponent = function (props) {
|
|
1244
1154
|
var styleSheet = useStyleSheet();
|
|
1245
1155
|
var stylis = useStylis();
|
|
1246
|
-
var theme =
|
|
1247
|
-
var instanceRef =
|
|
1156
|
+
var theme = React.useContext(ThemeContext);
|
|
1157
|
+
var instanceRef = React.useRef(styleSheet.allocateGSInstance(styledComponentId));
|
|
1248
1158
|
var instance = instanceRef.current;
|
|
1249
|
-
if (
|
|
1159
|
+
if (React.Children.count(props.children)) {
|
|
1250
1160
|
// eslint-disable-next-line no-console
|
|
1251
1161
|
console.warn("The global style component ".concat(styledComponentId, " was given child JSX. createGlobalStyle does not render children."));
|
|
1252
1162
|
}
|
|
@@ -1260,7 +1170,7 @@
|
|
|
1260
1170
|
{
|
|
1261
1171
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
1262
1172
|
// @ts-expect-error still using React 17 types for the time being
|
|
1263
|
-
(
|
|
1173
|
+
(React.useInsertionEffect || React.useLayoutEffect)(function () {
|
|
1264
1174
|
if (!styleSheet.server) {
|
|
1265
1175
|
renderStyles(instance, props, styleSheet, theme, stylis);
|
|
1266
1176
|
return function () { return globalStyle.removeStyles(instance, styleSheet); };
|
|
@@ -1278,7 +1188,7 @@
|
|
|
1278
1188
|
globalStyle.renderStyles(instance, context, styleSheet, stylis);
|
|
1279
1189
|
}
|
|
1280
1190
|
}
|
|
1281
|
-
return
|
|
1191
|
+
return React.memo(GlobalStyleComponent);
|
|
1282
1192
|
}
|
|
1283
1193
|
|
|
1284
1194
|
function keyframes(strings) {
|
|
@@ -1403,14 +1313,14 @@
|
|
|
1403
1313
|
}
|
|
1404
1314
|
|
|
1405
1315
|
function withTheme(Component) {
|
|
1406
|
-
var WithTheme =
|
|
1407
|
-
var theme =
|
|
1316
|
+
var WithTheme = React.forwardRef(function (props, ref) {
|
|
1317
|
+
var theme = React.useContext(ThemeContext);
|
|
1408
1318
|
var themeProp = determineTheme(props, theme, Component.defaultProps);
|
|
1409
1319
|
if (themeProp === undefined) {
|
|
1410
1320
|
// eslint-disable-next-line no-console
|
|
1411
1321
|
console.warn("[withTheme] You are not using a ThemeProvider nor passing a theme prop or a theme in defaultProps in component class \"".concat(getComponentName(Component), "\""));
|
|
1412
1322
|
}
|
|
1413
|
-
return
|
|
1323
|
+
return React.createElement(Component, __assign({}, props, { theme: themeProp, ref: ref }));
|
|
1414
1324
|
});
|
|
1415
1325
|
WithTheme.displayName = "WithTheme(".concat(getComponentName(Component), ")");
|
|
1416
1326
|
return hoistNonReactStatics(WithTheme, Component);
|
|
@@ -1455,7 +1365,7 @@
|
|
|
1455
1365
|
props.nonce = nonce;
|
|
1456
1366
|
}
|
|
1457
1367
|
// v4 returned an array for this fn, so we'll do the same for v5 for backward compat
|
|
1458
|
-
return [
|
|
1368
|
+
return [React.createElement("style", __assign({}, props, { key: "sc-0-0" }))];
|
|
1459
1369
|
};
|
|
1460
1370
|
this.seal = function () {
|
|
1461
1371
|
_this.sealed = true;
|
|
@@ -1467,7 +1377,7 @@
|
|
|
1467
1377
|
if (this.sealed) {
|
|
1468
1378
|
throw throwStyledComponentsError(2);
|
|
1469
1379
|
}
|
|
1470
|
-
return
|
|
1380
|
+
return React.createElement(StyleSheetManager, { sheet: this.instance }, children);
|
|
1471
1381
|
};
|
|
1472
1382
|
// eslint-disable-next-line consistent-return
|
|
1473
1383
|
// @ts-expect-error alternate return types are not possible due to code transformation
|
|
@@ -1957,7 +1867,7 @@
|
|
|
1957
1867
|
* forwardRef creates a new interim component, which we'll take advantage of
|
|
1958
1868
|
* instead of extending ParentComponent to create _another_ interim class
|
|
1959
1869
|
*/
|
|
1960
|
-
var WrappedStyledComponent =
|
|
1870
|
+
var WrappedStyledComponent = React.forwardRef(forwardRef);
|
|
1961
1871
|
WrappedStyledComponent.attrs = finalAttrs;
|
|
1962
1872
|
WrappedStyledComponent.componentStyle = componentStyle;
|
|
1963
1873
|
WrappedStyledComponent.displayName = displayName;
|
|
@@ -1970,13 +1880,6 @@
|
|
|
1970
1880
|
WrappedStyledComponent.styledComponentId = styledComponentId;
|
|
1971
1881
|
// fold the underlying StyledComponent target up since we folded the styles
|
|
1972
1882
|
WrappedStyledComponent.target = isTargetStyledComp ? styledComponentTarget.target : target;
|
|
1973
|
-
WrappedStyledComponent.withComponent = function withComponent(tag) {
|
|
1974
|
-
var previousComponentId = options.componentId, optionsToCopy = __rest(options, ["componentId"]);
|
|
1975
|
-
var newComponentId = previousComponentId &&
|
|
1976
|
-
"".concat(previousComponentId, "-").concat(isTag(tag) ? tag : escape(getComponentName(tag)));
|
|
1977
|
-
var newOptions = __assign(__assign({}, optionsToCopy), { attrs: finalAttrs, componentId: newComponentId });
|
|
1978
|
-
return createStyledComponent(tag, newOptions, rules);
|
|
1979
|
-
};
|
|
1980
1883
|
Object.defineProperty(WrappedStyledComponent, 'defaultProps', {
|
|
1981
1884
|
get: function () {
|
|
1982
1885
|
return this._foldedDefaultProps;
|
|
@@ -2003,7 +1906,6 @@
|
|
|
2003
1906
|
shouldForwardProp: true,
|
|
2004
1907
|
styledComponentId: true,
|
|
2005
1908
|
target: true,
|
|
2006
|
-
withComponent: true,
|
|
2007
1909
|
});
|
|
2008
1910
|
}
|
|
2009
1911
|
return WrappedStyledComponent;
|