styled-components 6.0.7 → 6.0.9
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/styled-components-macro.cjs.js.map +1 -1
- package/dist/styled-components-macro.esm.js.map +1 -1
- package/dist/styled-components.browser.cjs.js +1 -1
- package/dist/styled-components.browser.cjs.js.map +1 -1
- package/dist/styled-components.browser.esm.js +1 -1
- package/dist/styled-components.browser.esm.js.map +1 -1
- package/dist/styled-components.cjs.js +1 -1
- package/dist/styled-components.cjs.js.map +1 -1
- package/dist/styled-components.esm.js +1 -1
- package/dist/styled-components.esm.js.map +1 -1
- package/dist/styled-components.js +25 -9
- 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/native/dist/base.d.ts +1 -1
- package/native/dist/constructors/constructWithOptions.d.ts +1 -1
- package/native/dist/constructors/styled.d.ts +18 -60
- package/native/dist/hoc/withTheme.d.ts +1 -1
- package/native/dist/index.d.ts +2 -2
- package/native/dist/native/index.d.ts +4 -4
- package/native/dist/styled-components.native.cjs.js +1 -1
- package/native/dist/styled-components.native.cjs.js.map +1 -1
- package/native/dist/styled-components.native.esm.js +1 -1
- package/native/dist/styled-components.native.esm.js.map +1 -1
- package/native/dist/test/utils.d.ts +18 -60
- package/native/dist/types.d.ts +27 -5
- package/native/dist/utils/domElements.d.ts +3 -1
- package/package.json +3 -2
- package/dist/base.d.ts +0 -12
- package/dist/constants.d.ts +0 -8
- package/dist/constructors/constructWithOptions.d.ts +0 -18
- package/dist/constructors/createGlobalStyle.d.ts +0 -3
- package/dist/constructors/css.d.ts +0 -4
- package/dist/constructors/keyframes.d.ts +0 -3
- package/dist/constructors/styled.d.ts +0 -180
- package/dist/hoc/withTheme.d.ts +0 -3
- package/dist/hoc/withTheme.spec.d.ts +0 -1
- package/dist/index-standalone.d.ts +0 -2
- package/dist/index.d.ts +0 -4
- package/dist/macro/index.d.ts +0 -2
- package/dist/models/ComponentStyle.d.ts +0 -15
- package/dist/models/GlobalStyle.d.ts +0 -11
- package/dist/models/InlineStyle.d.ts +0 -6
- package/dist/models/Keyframes.d.ts +0 -10
- package/dist/models/ServerStyleSheet.d.ts +0 -16
- package/dist/models/StyleSheetManager.d.ts +0 -65
- package/dist/models/StyledComponent.d.ts +0 -3
- package/dist/models/StyledNativeComponent.d.ts +0 -3
- package/dist/models/ThemeProvider.d.ts +0 -47
- package/dist/native/index.d.ts +0 -36
- package/dist/secretInternals.d.ts +0 -5
- package/dist/sheet/GroupIDAllocator.d.ts +0 -4
- package/dist/sheet/GroupedTag.d.ts +0 -11
- package/dist/sheet/Rehydration.d.ts +0 -3
- package/dist/sheet/Sheet.d.ts +0 -38
- package/dist/sheet/Tag.d.ts +0 -54
- package/dist/sheet/dom.d.ts +0 -4
- package/dist/sheet/index.d.ts +0 -1
- package/dist/sheet/types.d.ts +0 -34
- package/dist/test/globals.d.ts +0 -2
- package/dist/test/utils.d.ts +0 -186
- package/dist/test/veryLargeUnionType.d.ts +0 -1
- package/dist/types.d.ts +0 -161
- package/dist/utils/addUnitIfNeeded.d.ts +0 -1
- package/dist/utils/checkDynamicCreation.d.ts +0 -1
- package/dist/utils/createWarnTooManyClasses.d.ts +0 -3
- package/dist/utils/determineTheme.d.ts +0 -4
- package/dist/utils/domElements.d.ts +0 -2
- package/dist/utils/empties.d.ts +0 -3
- package/dist/utils/error.d.ts +0 -5
- package/dist/utils/errors.d.ts +0 -21
- package/dist/utils/escape.d.ts +0 -5
- package/dist/utils/flatten.d.ts +0 -4
- package/dist/utils/generateAlphabeticName.d.ts +0 -1
- package/dist/utils/generateComponentId.d.ts +0 -1
- package/dist/utils/generateDisplayName.d.ts +0 -2
- package/dist/utils/getComponentName.d.ts +0 -2
- package/dist/utils/hash.d.ts +0 -3
- package/dist/utils/hoist.d.ts +0 -51
- package/dist/utils/hyphenateStyleName.d.ts +0 -14
- package/dist/utils/interleave.d.ts +0 -2
- package/dist/utils/isFunction.d.ts +0 -1
- package/dist/utils/isPlainObject.d.ts +0 -1
- package/dist/utils/isStatelessFunction.d.ts +0 -1
- package/dist/utils/isStaticRules.d.ts +0 -2
- package/dist/utils/isStyledComponent.d.ts +0 -2
- package/dist/utils/isTag.d.ts +0 -2
- package/dist/utils/joinStrings.d.ts +0 -5
- package/dist/utils/mixinDeep.d.ts +0 -6
- package/dist/utils/nonce.d.ts +0 -1
- package/dist/utils/setToString.d.ts +0 -17
- package/dist/utils/stylis.d.ts +0 -10
|
@@ -4,11 +4,13 @@
|
|
|
4
4
|
(global = global || self, global.styled = factory(global.React));
|
|
5
5
|
})(this, (function (React) { 'use strict';
|
|
6
6
|
|
|
7
|
-
var SC_ATTR = (typeof process !== 'undefined' &&
|
|
7
|
+
var SC_ATTR = (typeof process !== 'undefined' &&
|
|
8
|
+
typeof process.env !== 'undefined' &&
|
|
9
|
+
(process.env.REACT_APP_SC_ATTR || process.env.SC_ATTR)) ||
|
|
8
10
|
'data-styled';
|
|
9
11
|
var SC_ATTR_ACTIVE = 'active';
|
|
10
12
|
var SC_ATTR_VERSION = 'data-styled-version';
|
|
11
|
-
var SC_VERSION = "6.0.
|
|
13
|
+
var SC_VERSION = "6.0.9";
|
|
12
14
|
var SPLITTER = '/*!sc*/\n';
|
|
13
15
|
var IS_BROWSER = typeof window !== 'undefined' && 'HTMLElement' in window;
|
|
14
16
|
var DISABLE_SPEEDY = Boolean(typeof SC_DISABLE_SPEEDY === 'boolean'
|
|
@@ -45,6 +47,8 @@
|
|
|
45
47
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
46
48
|
PERFORMANCE OF THIS SOFTWARE.
|
|
47
49
|
***************************************************************************** */
|
|
50
|
+
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
51
|
+
|
|
48
52
|
|
|
49
53
|
var __assign = function() {
|
|
50
54
|
__assign = Object.assign || function __assign(t) {
|
|
@@ -65,7 +69,12 @@
|
|
|
65
69
|
}
|
|
66
70
|
}
|
|
67
71
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
68
|
-
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
75
|
+
var e = new Error(message);
|
|
76
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
77
|
+
};
|
|
69
78
|
|
|
70
79
|
var EMPTY_ARRAY = Object.freeze([]);
|
|
71
80
|
var EMPTY_OBJECT = Object.freeze({});
|
|
@@ -765,7 +774,12 @@
|
|
|
765
774
|
if (!shallowequal(plugins, props.stylisPlugins))
|
|
766
775
|
setPlugins(props.stylisPlugins);
|
|
767
776
|
}, [props.stylisPlugins]);
|
|
768
|
-
|
|
777
|
+
var styleSheetContextValue = React.useMemo(function () { return ({
|
|
778
|
+
shouldForwardProp: props.shouldForwardProp,
|
|
779
|
+
styleSheet: resolvedStyleSheet,
|
|
780
|
+
stylis: stylis,
|
|
781
|
+
}); }, [props.shouldForwardProp, resolvedStyleSheet, stylis]);
|
|
782
|
+
return (React.createElement(StyleSheetContext.Provider, { value: styleSheetContextValue },
|
|
769
783
|
React.createElement(StylisContext.Provider, { value: stylis }, props.children)));
|
|
770
784
|
}
|
|
771
785
|
|
|
@@ -795,6 +809,7 @@
|
|
|
795
809
|
|
|
796
810
|
var unitlessKeys = {
|
|
797
811
|
animationIterationCount: 1,
|
|
812
|
+
aspectRatio: 1,
|
|
798
813
|
borderImageOutset: 1,
|
|
799
814
|
borderImageSlice: 1,
|
|
800
815
|
borderImageWidth: 1,
|
|
@@ -1535,7 +1550,7 @@
|
|
|
1535
1550
|
});
|
|
1536
1551
|
|
|
1537
1552
|
// Thanks to ReactDOMFactories for this handy list!
|
|
1538
|
-
var
|
|
1553
|
+
var elements = [
|
|
1539
1554
|
'a',
|
|
1540
1555
|
'abbr',
|
|
1541
1556
|
'address',
|
|
@@ -1581,7 +1596,6 @@
|
|
|
1581
1596
|
'h4',
|
|
1582
1597
|
'h5',
|
|
1583
1598
|
'h6',
|
|
1584
|
-
'head',
|
|
1585
1599
|
'header',
|
|
1586
1600
|
'hgroup',
|
|
1587
1601
|
'hr',
|
|
@@ -1641,7 +1655,6 @@
|
|
|
1641
1655
|
'th',
|
|
1642
1656
|
'thead',
|
|
1643
1657
|
'time',
|
|
1644
|
-
'title',
|
|
1645
1658
|
'tr',
|
|
1646
1659
|
'track',
|
|
1647
1660
|
'u',
|
|
@@ -1671,7 +1684,8 @@
|
|
|
1671
1684
|
'svg',
|
|
1672
1685
|
'text',
|
|
1673
1686
|
'tspan',
|
|
1674
|
-
]
|
|
1687
|
+
];
|
|
1688
|
+
var domElements = new Set(elements);
|
|
1675
1689
|
|
|
1676
1690
|
// Source: https://www.w3.org/TR/cssom-1/#serialize-an-identifier
|
|
1677
1691
|
// Control characters and non-letter first symbols are not supported
|
|
@@ -1781,7 +1795,8 @@
|
|
|
1781
1795
|
}
|
|
1782
1796
|
else if (partRule) {
|
|
1783
1797
|
var partString = joinStringArray(flatten(partRule, executionContext, styleSheet, stylis));
|
|
1784
|
-
|
|
1798
|
+
// The same value can switch positions in the array, so we include "i" in the hash.
|
|
1799
|
+
dynamicHash = phash(dynamicHash, partString + i);
|
|
1785
1800
|
css += partString;
|
|
1786
1801
|
}
|
|
1787
1802
|
}
|
|
@@ -2019,6 +2034,7 @@
|
|
|
2019
2034
|
var styled = baseStyled;
|
|
2020
2035
|
// Shorthands for all valid HTML Elements
|
|
2021
2036
|
domElements.forEach(function (domElement) {
|
|
2037
|
+
// @ts-expect-error some react typing bs
|
|
2022
2038
|
styled[domElement] = baseStyled(domElement);
|
|
2023
2039
|
});
|
|
2024
2040
|
|