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
package/dist/base.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import keyframes from './constructors/keyframes';
|
|
|
5
5
|
import withTheme from './hoc/withTheme';
|
|
6
6
|
import useTheme from './hooks/useTheme';
|
|
7
7
|
import ServerStyleSheet from './models/ServerStyleSheet';
|
|
8
|
-
import
|
|
8
|
+
import { IStyleSheetContext, IStyleSheetManager, IStylisContext, StyleSheetConsumer, StyleSheetContext, StyleSheetManager } from './models/StyleSheetManager';
|
|
9
9
|
import ThemeProvider, { ThemeConsumer, ThemeContext } from './models/ThemeProvider';
|
|
10
10
|
import isStyledComponent from './utils/isStyledComponent';
|
|
11
11
|
declare global {
|
|
@@ -15,4 +15,4 @@ declare global {
|
|
|
15
15
|
}
|
|
16
16
|
export * from './secretInternals';
|
|
17
17
|
export { AttrsArg as Attrs, DefaultTheme, ShouldForwardProp } from './types';
|
|
18
|
-
export { createGlobalStyle, css, isStyledComponent, keyframes, ServerStyleSheet, StyleSheetConsumer, StyleSheetContext, StyleSheetManager, ThemeConsumer, ThemeContext, ThemeProvider, useTheme, SC_VERSION as version, withTheme, };
|
|
18
|
+
export { createGlobalStyle, css, isStyledComponent, IStyleSheetManager, IStyleSheetContext, IStylisContext, keyframes, ServerStyleSheet, StyleSheetConsumer, StyleSheetContext, StyleSheetManager, ThemeConsumer, ThemeContext, ThemeProvider, useTheme, SC_VERSION as version, withTheme, };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import styled from './constructors/styled';
|
|
2
2
|
export * from './base';
|
|
3
3
|
export { CSSProp, DefaultTheme, ExecutionContext, ExecutionProps, IStyledComponent, IStyledComponentFactory, IStyledStatics, PolymorphicComponent, PolymorphicComponentProps, Runtime, StyledObject, StyledOptions, WebTarget, } from './types';
|
|
4
|
-
export { styled as default };
|
|
4
|
+
export { styled, styled as default };
|
|
@@ -1,21 +1,46 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import StyleSheet from '../sheet';
|
|
3
3
|
import { Stringifier } from '../types';
|
|
4
|
-
declare type
|
|
5
|
-
|
|
4
|
+
export declare type IStyleSheetContext = StyleSheet | void;
|
|
5
|
+
export declare const StyleSheetContext: React.Context<IStyleSheetContext>;
|
|
6
|
+
export declare const StyleSheetConsumer: React.Consumer<IStyleSheetContext>;
|
|
7
|
+
export declare type IStylisContext = Stringifier | void;
|
|
8
|
+
export declare const StylisContext: React.Context<IStylisContext>;
|
|
9
|
+
export declare const StylisConsumer: React.Consumer<IStylisContext>;
|
|
10
|
+
export declare const mainSheet: StyleSheet;
|
|
11
|
+
export declare const mainStylis: Stringifier;
|
|
12
|
+
export declare function useStyleSheet(): StyleSheet;
|
|
13
|
+
export declare function useStylis(): Stringifier;
|
|
14
|
+
export declare type IStyleSheetManager = React.PropsWithChildren<{
|
|
15
|
+
/**
|
|
16
|
+
* If desired, you can pass this prop to disable "speedy" insertion mode, which
|
|
17
|
+
* uses the browser [CSSOM APIs](https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleSheet).
|
|
18
|
+
* When disabled, rules are inserted as simple text into style blocks.
|
|
19
|
+
*/
|
|
6
20
|
disableCSSOMInjection?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* If you are working exclusively with modern browsers, vendor prefixes can often be omitted
|
|
23
|
+
* to reduce the weight of CSS on the page.
|
|
24
|
+
*/
|
|
7
25
|
disableVendorPrefixes?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Provide an optional selector to be prepended to all generated style rules.
|
|
28
|
+
*/
|
|
29
|
+
namespace?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Create and provide your own `StyleSheet` if necessary for advanced SSR scenarios.
|
|
32
|
+
*/
|
|
8
33
|
sheet?: StyleSheet;
|
|
34
|
+
/**
|
|
35
|
+
* An array of plugins to be run by stylis (style processor) during compilation.
|
|
36
|
+
* Check out [what's available on npm*](https://www.npmjs.com/search?q=keywords%3Astylis).
|
|
37
|
+
*
|
|
38
|
+
* \* The plugin(s) must be compatible with stylis v4 or above.
|
|
39
|
+
*/
|
|
9
40
|
stylisPlugins?: stylis.Middleware[];
|
|
41
|
+
/**
|
|
42
|
+
* Provide an alternate DOM node to host generated styles; useful for iframes.
|
|
43
|
+
*/
|
|
10
44
|
target?: HTMLElement;
|
|
11
|
-
}
|
|
12
|
-
export declare
|
|
13
|
-
export declare const StyleSheetConsumer: React.Consumer<void | StyleSheet>;
|
|
14
|
-
export declare const StylisContext: React.Context<void | Stringifier>;
|
|
15
|
-
export declare const StylisConsumer: React.Consumer<void | Stringifier>;
|
|
16
|
-
export declare const mainSheet: StyleSheet;
|
|
17
|
-
export declare const mainStylis: Stringifier;
|
|
18
|
-
export declare function useStyleSheet(): StyleSheet;
|
|
19
|
-
export declare function useStylis(): Stringifier;
|
|
20
|
-
export default function StyleSheetManager(props: Props): JSX.Element;
|
|
21
|
-
export {};
|
|
45
|
+
}>;
|
|
46
|
+
export declare function StyleSheetManager(props: IStyleSheetManager): JSX.Element;
|
|
@@ -27,7 +27,7 @@ export interface DefaultTheme {
|
|
|
27
27
|
declare type ThemeFn = (outerTheme?: DefaultTheme) => DefaultTheme;
|
|
28
28
|
declare type ThemeArgument = DefaultTheme | ThemeFn;
|
|
29
29
|
declare type Props = {
|
|
30
|
-
children?: React.
|
|
30
|
+
children?: React.ReactNode;
|
|
31
31
|
theme: ThemeArgument;
|
|
32
32
|
};
|
|
33
33
|
export declare const ThemeContext: React.Context<DefaultTheme | undefined>;
|
package/dist/native/index.d.ts
CHANGED
|
@@ -34,4 +34,4 @@ declare const styled: (<Target extends NativeTarget>(tag: Target) => Styled<"nat
|
|
|
34
34
|
};
|
|
35
35
|
export { DefaultTheme, ExecutionContext, ExecutionProps, IStyledComponent, IStyledComponentFactory, IStyledStatics, NativeTarget, PolymorphicComponent, PolymorphicComponentProps, Runtime, StyledObject, StyledOptions, } from '../types';
|
|
36
36
|
export { css, isStyledComponent, ThemeProvider, ThemeConsumer, ThemeContext, withTheme, useTheme };
|
|
37
|
-
export default
|
|
37
|
+
export { styled, styled as default };
|
|
@@ -18,7 +18,7 @@ var SC_ATTR = (typeof process !== 'undefined' && (process.env.REACT_APP_SC_ATTR
|
|
|
18
18
|
'data-styled';
|
|
19
19
|
var SC_ATTR_ACTIVE = 'active';
|
|
20
20
|
var SC_ATTR_VERSION = 'data-styled-version';
|
|
21
|
-
var SC_VERSION = "6.0.0-beta.
|
|
21
|
+
var SC_VERSION = "6.0.0-beta.8";
|
|
22
22
|
var SPLITTER = '/*!sc*/\n';
|
|
23
23
|
var IS_BROWSER = typeof window !== 'undefined' && 'HTMLElement' in window;
|
|
24
24
|
var DISABLE_SPEEDY = Boolean(typeof SC_DISABLE_SPEEDY === 'boolean'
|
|
@@ -1026,7 +1026,11 @@ function createStylisInstance(_a) {
|
|
|
1026
1026
|
props[0] = props[0].replace(_selectorRegexp, selfReferenceReplacer);
|
|
1027
1027
|
}
|
|
1028
1028
|
};
|
|
1029
|
-
var stringifyRules = function (css, selector,
|
|
1029
|
+
var stringifyRules = function (css, selector,
|
|
1030
|
+
/**
|
|
1031
|
+
* This "prefix" referes to a _selector_ prefix.
|
|
1032
|
+
*/
|
|
1033
|
+
prefix, componentId) {
|
|
1030
1034
|
if (selector === void 0) { selector = ''; }
|
|
1031
1035
|
if (prefix === void 0) { prefix = ''; }
|
|
1032
1036
|
if (componentId === void 0) { componentId = '&'; }
|
|
@@ -1039,11 +1043,16 @@ function createStylisInstance(_a) {
|
|
|
1039
1043
|
_selectorRegexp = new RegExp("\\".concat(_selector, "\\b"), 'g');
|
|
1040
1044
|
_consecutiveSelfRefRegExp = new RegExp("(\\".concat(_selector, "\\b){2,}"));
|
|
1041
1045
|
var middlewares = plugins.slice();
|
|
1046
|
+
/**
|
|
1047
|
+
* Enables automatic vendor-prefixing for styles.
|
|
1048
|
+
*/
|
|
1042
1049
|
if (options.prefix || options.prefix === undefined) {
|
|
1043
1050
|
middlewares.unshift(stylis.prefixer);
|
|
1044
1051
|
}
|
|
1045
1052
|
middlewares.push(selfReferenceReplacementPlugin, stylis.stringify);
|
|
1046
|
-
return serialize(stylis.compile(
|
|
1053
|
+
return serialize(stylis.compile(options.namespace || prefix || selector
|
|
1054
|
+
? "".concat(options.namespace ? options.namespace + ' ' : '').concat(prefix, " ").concat(selector, " { ").concat(flatCSS, " }")
|
|
1055
|
+
: flatCSS), stylis.middleware(middlewares));
|
|
1047
1056
|
};
|
|
1048
1057
|
stringifyRules.hash = plugins.length
|
|
1049
1058
|
? plugins
|
|
@@ -1089,10 +1098,10 @@ function StyleSheetManager(props) {
|
|
|
1089
1098
|
}, [props.disableCSSOMInjection, props.sheet, props.target]);
|
|
1090
1099
|
var stylis = React.useMemo(function () {
|
|
1091
1100
|
return createStylisInstance({
|
|
1092
|
-
options: { prefix: !props.disableVendorPrefixes },
|
|
1101
|
+
options: { namespace: props.namespace, prefix: !props.disableVendorPrefixes },
|
|
1093
1102
|
plugins: plugins,
|
|
1094
1103
|
});
|
|
1095
|
-
}, [props.disableVendorPrefixes, plugins]);
|
|
1104
|
+
}, [props.disableVendorPrefixes, props.namespace, plugins]);
|
|
1096
1105
|
React.useEffect(function () {
|
|
1097
1106
|
if (!shallowequal__default["default"](plugins, props.stylisPlugins))
|
|
1098
1107
|
setPlugins(props.stylisPlugins);
|
|
@@ -1504,13 +1513,6 @@ function createStyledComponent(target, options, rules) {
|
|
|
1504
1513
|
WrappedStyledComponent.styledComponentId = styledComponentId;
|
|
1505
1514
|
// fold the underlying StyledComponent target up since we folded the styles
|
|
1506
1515
|
WrappedStyledComponent.target = isTargetStyledComp ? styledComponentTarget.target : target;
|
|
1507
|
-
WrappedStyledComponent.withComponent = function withComponent(tag) {
|
|
1508
|
-
var previousComponentId = options.componentId, optionsToCopy = tslib.__rest(options, ["componentId"]);
|
|
1509
|
-
var newComponentId = previousComponentId &&
|
|
1510
|
-
"".concat(previousComponentId, "-").concat(isTag(tag) ? tag : escape(getComponentName(tag)));
|
|
1511
|
-
var newOptions = tslib.__assign(tslib.__assign({}, optionsToCopy), { attrs: finalAttrs, componentId: newComponentId });
|
|
1512
|
-
return createStyledComponent(tag, newOptions, rules);
|
|
1513
|
-
};
|
|
1514
1516
|
Object.defineProperty(WrappedStyledComponent, 'defaultProps', {
|
|
1515
1517
|
get: function () {
|
|
1516
1518
|
return this._foldedDefaultProps;
|
|
@@ -1537,7 +1539,6 @@ function createStyledComponent(target, options, rules) {
|
|
|
1537
1539
|
shouldForwardProp: true,
|
|
1538
1540
|
styledComponentId: true,
|
|
1539
1541
|
target: true,
|
|
1540
|
-
withComponent: true,
|
|
1541
1542
|
});
|
|
1542
1543
|
}
|
|
1543
1544
|
return WrappedStyledComponent;
|
|
@@ -1837,6 +1838,7 @@ exports.css = css;
|
|
|
1837
1838
|
exports["default"] = styled;
|
|
1838
1839
|
exports.isStyledComponent = isStyledComponent;
|
|
1839
1840
|
exports.keyframes = keyframes;
|
|
1841
|
+
exports.styled = styled;
|
|
1840
1842
|
exports.useTheme = useTheme;
|
|
1841
1843
|
exports.version = SC_VERSION;
|
|
1842
1844
|
exports.withTheme = withTheme;
|