styled-components 6.0.0-beta.6 → 6.0.0-beta.8
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/models/ThemeProvider.d.ts +1 -1
- package/dist/native/index.d.ts +1 -1
- package/dist/styled-components.browser.cjs.js +15 -13
- 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 +15 -13
- 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 +15 -109
- 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/models/ThemeProvider.d.ts +1 -1
- package/native/dist/native/index.d.ts +1 -1
- package/native/dist/styled-components.native.cjs.js +13 -8
- 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
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
'data-styled';
|
|
13
13
|
var SC_ATTR_ACTIVE = 'active';
|
|
14
14
|
var SC_ATTR_VERSION = 'data-styled-version';
|
|
15
|
-
var SC_VERSION = "6.0.0-beta.
|
|
15
|
+
var SC_VERSION = "6.0.0-beta.8";
|
|
16
16
|
var SPLITTER = '/*!sc*/\n';
|
|
17
17
|
var IS_BROWSER = typeof window !== 'undefined' && 'HTMLElement' in window;
|
|
18
18
|
var DISABLE_SPEEDY = Boolean(typeof SC_DISABLE_SPEEDY === 'boolean'
|
|
@@ -59,18 +59,6 @@
|
|
|
59
59
|
return __assign.apply(this, arguments);
|
|
60
60
|
};
|
|
61
61
|
|
|
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
62
|
function __spreadArray(to, from, pack) {
|
|
75
63
|
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
76
64
|
if (ar || !(i in from)) {
|
|
@@ -670,7 +658,11 @@
|
|
|
670
658
|
props[0] = props[0].replace(_selectorRegexp, selfReferenceReplacer);
|
|
671
659
|
}
|
|
672
660
|
};
|
|
673
|
-
var stringifyRules = function (css, selector,
|
|
661
|
+
var stringifyRules = function (css, selector,
|
|
662
|
+
/**
|
|
663
|
+
* This "prefix" referes to a _selector_ prefix.
|
|
664
|
+
*/
|
|
665
|
+
prefix, componentId) {
|
|
674
666
|
if (selector === void 0) { selector = ''; }
|
|
675
667
|
if (prefix === void 0) { prefix = ''; }
|
|
676
668
|
if (componentId === void 0) { componentId = '&'; }
|
|
@@ -683,11 +675,16 @@
|
|
|
683
675
|
_selectorRegexp = new RegExp("\\".concat(_selector, "\\b"), 'g');
|
|
684
676
|
_consecutiveSelfRefRegExp = new RegExp("(\\".concat(_selector, "\\b){2,}"));
|
|
685
677
|
var middlewares = plugins.slice();
|
|
678
|
+
/**
|
|
679
|
+
* Enables automatic vendor-prefixing for styles.
|
|
680
|
+
*/
|
|
686
681
|
if (options.prefix || options.prefix === undefined) {
|
|
687
682
|
middlewares.unshift(pe);
|
|
688
683
|
}
|
|
689
684
|
middlewares.push(selfReferenceReplacementPlugin, oe);
|
|
690
|
-
return serialize(ne(
|
|
685
|
+
return serialize(ne(options.namespace || prefix || selector
|
|
686
|
+
? "".concat(options.namespace ? options.namespace + ' ' : '').concat(prefix, " ").concat(selector, " { ").concat(flatCSS, " }")
|
|
687
|
+
: flatCSS), le(middlewares));
|
|
691
688
|
};
|
|
692
689
|
stringifyRules.hash = plugins.length
|
|
693
690
|
? plugins
|
|
@@ -732,10 +729,10 @@
|
|
|
732
729
|
}, [props.disableCSSOMInjection, props.sheet, props.target]);
|
|
733
730
|
var stylis = React.useMemo(function () {
|
|
734
731
|
return createStylisInstance({
|
|
735
|
-
options: { prefix: !props.disableVendorPrefixes },
|
|
732
|
+
options: { namespace: props.namespace, prefix: !props.disableVendorPrefixes },
|
|
736
733
|
plugins: plugins,
|
|
737
734
|
});
|
|
738
|
-
}, [props.disableVendorPrefixes, plugins]);
|
|
735
|
+
}, [props.disableVendorPrefixes, props.namespace, plugins]);
|
|
739
736
|
React.useEffect(function () {
|
|
740
737
|
if (!shallowequal(plugins, props.stylisPlugins))
|
|
741
738
|
setPlugins(props.stylisPlugins);
|
|
@@ -769,77 +766,6 @@
|
|
|
769
766
|
return Keyframes;
|
|
770
767
|
}());
|
|
771
768
|
|
|
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
769
|
var unitlessKeys = {
|
|
844
770
|
animationIterationCount: 1,
|
|
845
771
|
borderImageOutset: 1,
|
|
@@ -889,25 +815,13 @@
|
|
|
889
815
|
strokeWidth: 1
|
|
890
816
|
};
|
|
891
817
|
|
|
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
818
|
// Taken from https://github.com/facebook/react/blob/b87aabdfe1b7461e7331abb3601d9e6bb27544bc/packages/react-dom/src/shared/dangerousStyleValue.js
|
|
905
819
|
function addUnitIfNeeded(name, value) {
|
|
906
820
|
// https://github.com/amilajack/eslint-plugin-flowtype-errors/issues/133
|
|
907
821
|
if (value == null || typeof value === 'boolean' || value === '') {
|
|
908
822
|
return '';
|
|
909
823
|
}
|
|
910
|
-
if (typeof value === 'number' && value !== 0 && !(name in
|
|
824
|
+
if (typeof value === 'number' && value !== 0 && !(name in unitlessKeys)) {
|
|
911
825
|
return "".concat(value, "px"); // Presumes implicit 'px' suffix for unitless numbers
|
|
912
826
|
}
|
|
913
827
|
return String(value).trim();
|
|
@@ -1970,13 +1884,6 @@
|
|
|
1970
1884
|
WrappedStyledComponent.styledComponentId = styledComponentId;
|
|
1971
1885
|
// fold the underlying StyledComponent target up since we folded the styles
|
|
1972
1886
|
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
1887
|
Object.defineProperty(WrappedStyledComponent, 'defaultProps', {
|
|
1981
1888
|
get: function () {
|
|
1982
1889
|
return this._foldedDefaultProps;
|
|
@@ -2003,7 +1910,6 @@
|
|
|
2003
1910
|
shouldForwardProp: true,
|
|
2004
1911
|
styledComponentId: true,
|
|
2005
1912
|
target: true,
|
|
2006
|
-
withComponent: true,
|
|
2007
1913
|
});
|
|
2008
1914
|
}
|
|
2009
1915
|
return WrappedStyledComponent;
|