styled-components 6.0.0-beta.2 → 6.0.0-beta.4
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 +1 -1
- package/dist/constructors/constructWithOptions.d.ts +21 -26
- package/dist/constructors/createGlobalStyle.d.ts +2 -2
- package/dist/constructors/css.d.ts +4 -4
- package/dist/constructors/keyframes.d.ts +1 -1
- package/dist/constructors/styled.d.ts +176 -180
- package/dist/hoc/withTheme.d.ts +2 -2
- package/dist/models/GlobalStyle.d.ts +1 -1
- package/dist/models/InlineStyle.d.ts +1 -1
- package/dist/models/StyledComponent.d.ts +1 -1
- package/dist/models/StyledNativeComponent.d.ts +2 -2
- package/dist/native/index.d.ts +25 -29
- package/dist/styled-components.browser.cjs.js +52 -64
- package/dist/styled-components.browser.cjs.js.map +1 -1
- package/dist/styled-components.browser.esm.js +52 -64
- package/dist/styled-components.browser.esm.js.map +1 -1
- package/dist/styled-components.cjs.js +52 -64
- package/dist/styled-components.cjs.js.map +1 -1
- package/dist/styled-components.esm.js +52 -64
- package/dist/styled-components.esm.js.map +1 -1
- package/dist/styled-components.js +52 -64
- 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/test/utils.d.ts +176 -180
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types.d.ts +56 -42
- package/dist/utils/determineTheme.d.ts +2 -2
- package/dist/utils/empties.d.ts +2 -2
- package/dist/utils/flatten.d.ts +3 -3
- package/dist/utils/interleave.d.ts +1 -1
- package/dist/utils/isStaticRules.d.ts +1 -1
- package/dist/utils/isStyledComponent.d.ts +1 -1
- package/dist/utils/joinStrings.d.ts +1 -1
- package/dist/utils/mixinDeep.d.ts +1 -2
- package/native/dist/base.d.ts +1 -1
- package/native/dist/constructors/constructWithOptions.d.ts +21 -26
- package/native/dist/constructors/createGlobalStyle.d.ts +2 -2
- package/native/dist/constructors/css.d.ts +4 -4
- package/native/dist/constructors/keyframes.d.ts +1 -1
- package/native/dist/constructors/styled.d.ts +176 -180
- package/native/dist/hoc/withTheme.d.ts +2 -2
- package/native/dist/models/GlobalStyle.d.ts +1 -1
- package/native/dist/models/InlineStyle.d.ts +1 -1
- package/native/dist/models/StyledComponent.d.ts +1 -1
- package/native/dist/models/StyledNativeComponent.d.ts +2 -2
- package/native/dist/native/index.d.ts +25 -29
- package/native/dist/styled-components.native.cjs.js +24 -37
- package/native/dist/styled-components.native.cjs.js.map +1 -1
- package/native/dist/styled-components.native.esm.js +24 -37
- package/native/dist/styled-components.native.esm.js.map +1 -1
- package/native/dist/test/utils.d.ts +176 -180
- package/native/dist/types.d.ts +56 -42
- package/native/dist/utils/determineTheme.d.ts +2 -2
- package/native/dist/utils/empties.d.ts +2 -2
- package/native/dist/utils/flatten.d.ts +3 -3
- package/native/dist/utils/interleave.d.ts +1 -1
- package/native/dist/utils/isStaticRules.d.ts +1 -1
- package/native/dist/utils/isStyledComponent.d.ts +1 -1
- package/native/dist/utils/joinStrings.d.ts +1 -1
- package/native/dist/utils/mixinDeep.d.ts +1 -2
- package/package.json +3 -3
- package/test-utils/index.ts +10 -6
- 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
|
@@ -3,4 +3,4 @@ export declare const resetStyleCache: () => void;
|
|
|
3
3
|
/**
|
|
4
4
|
* InlineStyle takes arbitrary CSS and generates a flat object
|
|
5
5
|
*/
|
|
6
|
-
export default function makeInlineStyleClass<Props
|
|
6
|
+
export default function makeInlineStyleClass<Props extends object>(styleSheet: StyleSheet): IInlineStyleConstructor<Props>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { IStyledComponentFactory, RuleSet, StyledOptions, WebTarget } from '../types';
|
|
2
|
-
declare function createStyledComponent<Target extends WebTarget, OuterProps
|
|
2
|
+
declare function createStyledComponent<Target extends WebTarget, OuterProps extends object, Statics extends object = object>(target: Target, options: StyledOptions<'web', OuterProps>, rules: RuleSet<OuterProps>): ReturnType<IStyledComponentFactory<'web', Target, OuterProps, Statics>>;
|
|
3
3
|
export default createStyledComponent;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
declare const _default: (InlineStyle: IInlineStyleConstructor<any>) => <Target extends NativeTarget, OuterProps extends
|
|
1
|
+
import type { ExecutionProps, IInlineStyleConstructor, IStyledComponent, IStyledComponentFactory, NativeTarget, RuleSet, StyledOptions } from '../types';
|
|
2
|
+
declare const _default: (InlineStyle: IInlineStyleConstructor<any>) => <Target extends NativeTarget, OuterProps extends ExecutionProps, Statics extends object = object>(target: Target, options: StyledOptions<"native", OuterProps>, rules: RuleSet<OuterProps>) => IStyledComponent<"native", Target, OuterProps & object> & Statics & object;
|
|
3
3
|
export default _default;
|
package/dist/native/index.d.ts
CHANGED
|
@@ -6,35 +6,31 @@ import useTheme from '../hooks/useTheme';
|
|
|
6
6
|
import ThemeProvider, { ThemeConsumer, ThemeContext } from '../models/ThemeProvider';
|
|
7
7
|
import { NativeTarget } from '../types';
|
|
8
8
|
import isStyledComponent from '../utils/isStyledComponent';
|
|
9
|
-
declare const styled: (<Target extends NativeTarget>(tag: Target) => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
TouchableHighlight: Styled<"native", typeof import("react-native").TouchableHighlight, import("react-native").TouchableHighlightProps, unknown, unknown>;
|
|
35
|
-
TouchableOpacity: Styled<"native", typeof import("react-native").TouchableOpacity, import("react-native").TouchableOpacityProps, unknown, unknown>;
|
|
36
|
-
View: Styled<"native", typeof import("react-native").View, import("react-native").ViewProps, unknown, unknown>;
|
|
37
|
-
VirtualizedList: Styled<"native", typeof import("react-native").VirtualizedList, import("react-native").VirtualizedListProps<unknown>, unknown, unknown>;
|
|
9
|
+
declare const styled: (<Target extends NativeTarget>(tag: Target) => Styled<"native", Target, Target extends import("../types").KnownTarget ? React.HTMLAttributes<Target> & React.ComponentPropsWithRef<Target> : object, object>) & {
|
|
10
|
+
ActivityIndicator: Styled<"native", typeof import("react-native").ActivityIndicator, React.HTMLAttributes<typeof import("react-native").ActivityIndicator> & import("react-native").ActivityIndicatorProps & React.RefAttributes<import("react-native").ActivityIndicator>, object>;
|
|
11
|
+
Button: Styled<"native", typeof import("react-native").Button, React.HTMLAttributes<typeof import("react-native").Button> & import("react-native").ButtonProps & React.RefAttributes<import("react-native").Button>, object>;
|
|
12
|
+
DatePickerIOS: Styled<"native", typeof import("react-native").DatePickerIOS, React.HTMLAttributes<typeof import("react-native").DatePickerIOS> & import("react-native").DatePickerIOSProps & React.RefAttributes<import("react-native").DatePickerIOS>, object>;
|
|
13
|
+
DrawerLayoutAndroid: Styled<"native", typeof import("react-native").DrawerLayoutAndroid, React.HTMLAttributes<typeof import("react-native").DrawerLayoutAndroid> & import("react-native").DrawerLayoutAndroidProps & React.RefAttributes<import("react-native").DrawerLayoutAndroid>, object>;
|
|
14
|
+
FlatList: Styled<"native", typeof import("react-native").FlatList, React.HTMLAttributes<typeof import("react-native").FlatList> & import("react-native").FlatListProps<unknown> & React.RefAttributes<import("react-native").FlatList<unknown>>, object>;
|
|
15
|
+
Image: Styled<"native", typeof import("react-native").Image, React.HTMLAttributes<typeof import("react-native").Image> & import("react-native").ImageProps & React.RefAttributes<import("react-native").Image>, object>;
|
|
16
|
+
ImageBackground: Styled<"native", typeof import("react-native").ImageBackground, React.HTMLAttributes<typeof import("react-native").ImageBackground> & import("react-native").ImageBackgroundProps & React.RefAttributes<import("react-native").ImageBackground>, object>;
|
|
17
|
+
KeyboardAvoidingView: Styled<"native", typeof import("react-native").KeyboardAvoidingView, React.HTMLAttributes<typeof import("react-native").KeyboardAvoidingView> & import("react-native").KeyboardAvoidingViewProps & React.RefAttributes<import("react-native").KeyboardAvoidingView>, object>;
|
|
18
|
+
Modal: Styled<"native", typeof import("react-native").Modal, React.HTMLAttributes<typeof import("react-native").Modal> & import("react-native").ModalBaseProps & import("react-native").ModalPropsIOS & import("react-native").ModalPropsAndroid & import("react-native").ViewProps & React.RefAttributes<import("react-native").Modal>, object>;
|
|
19
|
+
Pressable: Styled<"native", import("react").ForwardRefExoticComponent<import("react-native").PressableProps & import("react").RefAttributes<import("react-native").View>>, React.HTMLAttributes<import("react").ForwardRefExoticComponent<import("react-native").PressableProps & import("react").RefAttributes<import("react-native").View>>> & import("react-native").PressableProps & import("react").RefAttributes<import("react-native").View>, object>;
|
|
20
|
+
ProgressBarAndroid: Styled<"native", typeof import("react-native").ProgressBarAndroid, React.HTMLAttributes<typeof import("react-native").ProgressBarAndroid> & import("react-native").ProgressBarAndroidProps & React.RefAttributes<import("react-native").ProgressBarAndroid>, object>;
|
|
21
|
+
ProgressViewIOS: Styled<"native", typeof import("react-native").ProgressViewIOS, React.HTMLAttributes<typeof import("react-native").ProgressViewIOS> & import("react-native").ProgressViewIOSProps & React.RefAttributes<import("react-native").ProgressViewIOS>, object>;
|
|
22
|
+
RefreshControl: Styled<"native", typeof import("react-native").RefreshControl, React.HTMLAttributes<typeof import("react-native").RefreshControl> & import("react-native").RefreshControlProps & React.RefAttributes<import("react-native").RefreshControl>, object>;
|
|
23
|
+
SafeAreaView: Styled<"native", typeof import("react-native").SafeAreaView, React.HTMLAttributes<typeof import("react-native").SafeAreaView> & import("react-native").ViewProps & React.RefAttributes<import("react-native").SafeAreaView>, object>;
|
|
24
|
+
ScrollView: Styled<"native", typeof import("react-native").ScrollView, React.HTMLAttributes<typeof import("react-native").ScrollView> & import("react-native").ScrollViewProps & React.RefAttributes<import("react-native").ScrollView>, object>;
|
|
25
|
+
SectionList: Styled<"native", typeof import("react-native").SectionList, React.HTMLAttributes<typeof import("react-native").SectionList> & import("react-native").SectionListProps<unknown, unknown> & React.RefAttributes<import("react-native").SectionList<unknown, unknown>>, object>;
|
|
26
|
+
Slider: Styled<"native", typeof import("react-native").Slider, React.HTMLAttributes<typeof import("react-native").Slider> & import("react-native").SliderProps & React.RefAttributes<import("react-native").Slider>, object>;
|
|
27
|
+
Switch: Styled<"native", typeof import("react-native").Switch, React.HTMLAttributes<typeof import("react-native").Switch> & import("react-native").SwitchProps & React.RefAttributes<import("react-native").Switch>, object>;
|
|
28
|
+
Text: Styled<"native", typeof import("react-native").Text, React.HTMLAttributes<typeof import("react-native").Text> & import("react-native").TextProps & React.RefAttributes<import("react-native").Text>, object>;
|
|
29
|
+
TextInput: Styled<"native", typeof import("react-native").TextInput, React.HTMLAttributes<typeof import("react-native").TextInput> & import("react-native").TextInputProps & React.RefAttributes<import("react-native").TextInput>, object>;
|
|
30
|
+
TouchableHighlight: Styled<"native", typeof import("react-native").TouchableHighlight, React.HTMLAttributes<typeof import("react-native").TouchableHighlight> & import("react-native").TouchableHighlightProps & React.RefAttributes<import("react-native").TouchableHighlight>, object>;
|
|
31
|
+
TouchableOpacity: Styled<"native", typeof import("react-native").TouchableOpacity, React.HTMLAttributes<typeof import("react-native").TouchableOpacity> & import("react-native").TouchableOpacityProps & React.RefAttributes<import("react-native").TouchableOpacity>, object>;
|
|
32
|
+
View: Styled<"native", typeof import("react-native").View, React.HTMLAttributes<typeof import("react-native").View> & import("react-native").ViewProps & React.RefAttributes<import("react-native").View>, object>;
|
|
33
|
+
VirtualizedList: Styled<"native", typeof import("react-native").VirtualizedList, React.HTMLAttributes<typeof import("react-native").VirtualizedList> & import("react-native").VirtualizedListProps<unknown> & React.RefAttributes<import("react-native").VirtualizedList<unknown>>, object>;
|
|
38
34
|
};
|
|
39
35
|
export { IStyledComponent, IStyledComponentFactory, IStyledStatics, NativeTarget, StyledOptions, } from '../types';
|
|
40
36
|
export { css, isStyledComponent, ThemeProvider, ThemeConsumer, ThemeContext, withTheme, useTheme };
|
|
@@ -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.4";
|
|
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'
|
|
@@ -447,8 +447,12 @@ function isStyledComponent(target) {
|
|
|
447
447
|
/**
|
|
448
448
|
* Convenience function for joining strings to form className chains
|
|
449
449
|
*/
|
|
450
|
-
function joinStrings(
|
|
451
|
-
|
|
450
|
+
function joinStrings() {
|
|
451
|
+
var args = [];
|
|
452
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
453
|
+
args[_i] = arguments[_i];
|
|
454
|
+
}
|
|
455
|
+
return args.filter(Boolean).join(' ');
|
|
452
456
|
}
|
|
453
457
|
|
|
454
458
|
function isPlainObject(x) {
|
|
@@ -487,7 +491,6 @@ function mixinRecursively(target, source, forceMerge) {
|
|
|
487
491
|
* Source objects applied left to right. Mutates & returns target. Similar to lodash merge.
|
|
488
492
|
*/
|
|
489
493
|
function mixinDeep(target) {
|
|
490
|
-
if (target === void 0) { target = {}; }
|
|
491
494
|
var sources = [];
|
|
492
495
|
for (var _i = 1; _i < arguments.length; _i++) {
|
|
493
496
|
sources[_i - 1] = arguments[_i];
|
|
@@ -1140,8 +1143,8 @@ function addUnitIfNeeded(name, value) {
|
|
|
1140
1143
|
* inlined version of
|
|
1141
1144
|
* https://github.com/facebook/fbjs/blob/master/packages/fbjs/src/core/hyphenateStyleName.js
|
|
1142
1145
|
*/
|
|
1143
|
-
var uppercaseCheck = /
|
|
1144
|
-
var uppercasePattern = /
|
|
1146
|
+
var uppercaseCheck = /[A-Z]/;
|
|
1147
|
+
var uppercasePattern = /[A-Z]/g;
|
|
1145
1148
|
var msPattern = /^ms-/;
|
|
1146
1149
|
var prefixAndLowerCase = function (char) { return "-".concat(char.toLowerCase()); };
|
|
1147
1150
|
/**
|
|
@@ -1158,7 +1161,7 @@ var prefixAndLowerCase = function (char) { return "-".concat(char.toLowerCase())
|
|
|
1158
1161
|
* is converted to `-ms-`.
|
|
1159
1162
|
*/
|
|
1160
1163
|
function hyphenateStyleName(string) {
|
|
1161
|
-
return uppercaseCheck.test(string)
|
|
1164
|
+
return uppercaseCheck.test(string) && !string.startsWith('--')
|
|
1162
1165
|
? string.replace(uppercasePattern, prefixAndLowerCase).replace(msPattern, '-ms-')
|
|
1163
1166
|
: string;
|
|
1164
1167
|
}
|
|
@@ -1199,21 +1202,18 @@ function flatten(chunk, executionContext, styleSheet, stylisInstance) {
|
|
|
1199
1202
|
var ruleSet = [];
|
|
1200
1203
|
for (var i = 0, len = chunk.length, result = void 0; i < len; i += 1) {
|
|
1201
1204
|
result = flatten(chunk[i], executionContext, styleSheet, stylisInstance);
|
|
1202
|
-
if (result ===
|
|
1205
|
+
if (result.length === 0)
|
|
1203
1206
|
continue;
|
|
1204
|
-
|
|
1205
|
-
ruleSet.push.apply(ruleSet, result);
|
|
1206
|
-
else
|
|
1207
|
-
ruleSet.push(result);
|
|
1207
|
+
ruleSet.push.apply(ruleSet, result);
|
|
1208
1208
|
}
|
|
1209
1209
|
return ruleSet;
|
|
1210
1210
|
}
|
|
1211
1211
|
if (isFalsish(chunk)) {
|
|
1212
|
-
return
|
|
1212
|
+
return [];
|
|
1213
1213
|
}
|
|
1214
1214
|
/* Handle other components */
|
|
1215
1215
|
if (isStyledComponent(chunk)) {
|
|
1216
|
-
return ".".concat(chunk.styledComponentId);
|
|
1216
|
+
return [".".concat(chunk.styledComponentId)];
|
|
1217
1217
|
}
|
|
1218
1218
|
/* Either execute or defer the function */
|
|
1219
1219
|
if (isFunction(chunk)) {
|
|
@@ -1230,26 +1230,27 @@ function flatten(chunk, executionContext, styleSheet, stylisInstance) {
|
|
|
1230
1230
|
}
|
|
1231
1231
|
return flatten(result, executionContext, styleSheet, stylisInstance);
|
|
1232
1232
|
}
|
|
1233
|
-
else
|
|
1234
|
-
return chunk;
|
|
1233
|
+
else {
|
|
1234
|
+
return [chunk];
|
|
1235
|
+
}
|
|
1235
1236
|
}
|
|
1236
1237
|
if (chunk instanceof Keyframes) {
|
|
1237
1238
|
if (styleSheet) {
|
|
1238
1239
|
chunk.inject(styleSheet, stylisInstance);
|
|
1239
|
-
return chunk.getName(stylisInstance);
|
|
1240
|
+
return [chunk.getName(stylisInstance)];
|
|
1241
|
+
}
|
|
1242
|
+
else {
|
|
1243
|
+
return [chunk];
|
|
1240
1244
|
}
|
|
1241
|
-
else
|
|
1242
|
-
return chunk;
|
|
1243
1245
|
}
|
|
1244
1246
|
/* Handle objects */
|
|
1245
|
-
return isPlainObject(chunk) ? objToCssArray(chunk) : chunk.toString();
|
|
1247
|
+
return isPlainObject(chunk) ? objToCssArray(chunk) : [chunk.toString()];
|
|
1246
1248
|
}
|
|
1247
1249
|
|
|
1248
1250
|
function isStaticRules(rules) {
|
|
1249
1251
|
for (var i = 0; i < rules.length; i += 1) {
|
|
1250
1252
|
var rule = rules[i];
|
|
1251
|
-
if (isFunction(rule) &&
|
|
1252
|
-
!isStyledComponent(rule)) {
|
|
1253
|
+
if (isFunction(rule) && !isStyledComponent(rule)) {
|
|
1253
1254
|
// functions are allowed to be static if they're just being
|
|
1254
1255
|
// used to get the classname of a nested styled component
|
|
1255
1256
|
return false;
|
|
@@ -1383,35 +1384,10 @@ function generateId(displayName, parentComponentId) {
|
|
|
1383
1384
|
SC_VERSION + name + identifiers[name]));
|
|
1384
1385
|
return parentComponentId ? "".concat(parentComponentId, "-").concat(componentId) : componentId;
|
|
1385
1386
|
}
|
|
1386
|
-
function useResolvedAttrs(theme, props, attrs) {
|
|
1387
|
-
if (theme === void 0) { theme = EMPTY_OBJECT; }
|
|
1388
|
-
// NOTE: can't memoize this
|
|
1389
|
-
// returns [context, resolvedAttrs]
|
|
1390
|
-
// where resolvedAttrs is only the things injected by the attrs themselves
|
|
1391
|
-
var context = tslib.__assign(tslib.__assign({}, props), { theme: theme });
|
|
1392
|
-
attrs.forEach(function (attrDef) {
|
|
1393
|
-
// @ts-expect-error narrowing isn't working properly for some reason
|
|
1394
|
-
var resolvedAttrDef = typeof attrDef === 'function' ? attrDef(context) : attrDef;
|
|
1395
|
-
var key;
|
|
1396
|
-
/* eslint-disable guard-for-in */
|
|
1397
|
-
for (key in resolvedAttrDef) {
|
|
1398
|
-
// @ts-expect-error bad types
|
|
1399
|
-
context[key] =
|
|
1400
|
-
key === 'className'
|
|
1401
|
-
? joinStrings(context[key], resolvedAttrDef[key])
|
|
1402
|
-
: key === 'style'
|
|
1403
|
-
? tslib.__assign(tslib.__assign({}, context[key]), resolvedAttrDef[key]) : resolvedAttrDef[key];
|
|
1404
|
-
}
|
|
1405
|
-
/* eslint-enable guard-for-in */
|
|
1406
|
-
});
|
|
1407
|
-
return context;
|
|
1408
|
-
}
|
|
1409
1387
|
function useInjectedStyle(componentStyle, isStatic, resolvedAttrs, warnTooManyClasses) {
|
|
1410
1388
|
var styleSheet = useStyleSheet();
|
|
1411
1389
|
var stylis = useStylis();
|
|
1412
|
-
var className = isStatic
|
|
1413
|
-
? componentStyle.generateAndInjectStyles(EMPTY_OBJECT, styleSheet, stylis)
|
|
1414
|
-
: componentStyle.generateAndInjectStyles(resolvedAttrs, styleSheet, stylis);
|
|
1390
|
+
var className = componentStyle.generateAndInjectStyles(isStatic ? EMPTY_OBJECT : resolvedAttrs, styleSheet, stylis);
|
|
1415
1391
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
1416
1392
|
if (process.env.NODE_ENV !== 'production')
|
|
1417
1393
|
React.useDebugValue(className);
|
|
@@ -1428,22 +1404,36 @@ function useStyledComponentImpl(forwardedComponent, props, forwardedRef, isStati
|
|
|
1428
1404
|
// NOTE: the non-hooks version only subscribes to this when !componentStyle.isStatic,
|
|
1429
1405
|
// but that'd be against the rules-of-hooks. We could be naughty and do it anyway as it
|
|
1430
1406
|
// should be an immutable value, but behave for now.
|
|
1431
|
-
var theme = determineTheme(props, React.useContext(ThemeContext), defaultProps);
|
|
1432
|
-
var context =
|
|
1407
|
+
var theme = determineTheme(props, React.useContext(ThemeContext), defaultProps) || EMPTY_OBJECT;
|
|
1408
|
+
var context = componentAttrs.reduce(function (p, attrDef) {
|
|
1409
|
+
var resolvedAttrDef = typeof attrDef === 'function' ? attrDef(p) : attrDef;
|
|
1410
|
+
/* eslint-disable guard-for-in */
|
|
1411
|
+
for (var key in resolvedAttrDef) {
|
|
1412
|
+
// @ts-expect-error bad types
|
|
1413
|
+
p[key] =
|
|
1414
|
+
key === 'className'
|
|
1415
|
+
? joinStrings(p[key], resolvedAttrDef[key])
|
|
1416
|
+
: key === 'style'
|
|
1417
|
+
? tslib.__assign(tslib.__assign({}, p[key]), resolvedAttrDef[key]) : resolvedAttrDef[key];
|
|
1418
|
+
}
|
|
1419
|
+
/* eslint-enable guard-for-in */
|
|
1420
|
+
return p;
|
|
1421
|
+
}, tslib.__assign(tslib.__assign({}, props), { theme: theme }));
|
|
1433
1422
|
var generatedClassName = useInjectedStyle(componentStyle, isStatic, context, process.env.NODE_ENV !== 'production' ? forwardedComponent.warnTooManyClasses : undefined);
|
|
1434
1423
|
var refToForward = forwardedRef;
|
|
1435
|
-
var elementToBeCreated = context
|
|
1424
|
+
var elementToBeCreated = context.as || target;
|
|
1436
1425
|
var isTargetTag = isTag(elementToBeCreated);
|
|
1437
1426
|
var propsForElement = {};
|
|
1438
1427
|
// eslint-disable-next-line guard-for-in
|
|
1439
1428
|
for (var key in context) {
|
|
1440
|
-
|
|
1441
|
-
|
|
1429
|
+
// @ts-expect-error for..in iterates strings instead of keyof
|
|
1430
|
+
if (context[key] === undefined) ;
|
|
1431
|
+
else if (key[0] === '$' || key === 'as' || key === 'theme') ;
|
|
1442
1432
|
else if (key === 'forwardedAs') {
|
|
1443
|
-
propsForElement.as = context
|
|
1433
|
+
propsForElement.as = context.forwardedAs;
|
|
1444
1434
|
}
|
|
1445
|
-
else if (shouldForwardProp
|
|
1446
|
-
//
|
|
1435
|
+
else if (!shouldForwardProp || shouldForwardProp(key, elementToBeCreated)) {
|
|
1436
|
+
// @ts-expect-error for..in iterates strings instead of keyof
|
|
1447
1437
|
propsForElement[key] = context[key];
|
|
1448
1438
|
}
|
|
1449
1439
|
}
|
|
@@ -1453,7 +1443,7 @@ function useStyledComponentImpl(forwardedComponent, props, forwardedRef, isStati
|
|
|
1453
1443
|
domElements.indexOf(elementToBeCreated) === -1
|
|
1454
1444
|
? 'class'
|
|
1455
1445
|
: 'className'] = foldedComponentIds
|
|
1456
|
-
.concat(styledComponentId,
|
|
1446
|
+
.concat(styledComponentId, generatedClassName !== styledComponentId ? generatedClassName : '', context.className || '')
|
|
1457
1447
|
.filter(Boolean)
|
|
1458
1448
|
.join(' ');
|
|
1459
1449
|
propsForElement.ref = refToForward;
|
|
@@ -1469,7 +1459,9 @@ function createStyledComponent(target, options, rules) {
|
|
|
1469
1459
|
: options.componentId || componentId;
|
|
1470
1460
|
// fold the underlying StyledComponent attrs up (implicit extend)
|
|
1471
1461
|
var finalAttrs = isTargetStyledComp && styledComponentTarget.attrs
|
|
1472
|
-
? styledComponentTarget.attrs
|
|
1462
|
+
? styledComponentTarget.attrs
|
|
1463
|
+
.concat(attrs)
|
|
1464
|
+
.filter(Boolean)
|
|
1473
1465
|
: attrs;
|
|
1474
1466
|
var shouldForwardProp = options.shouldForwardProp;
|
|
1475
1467
|
if (isTargetStyledComp && styledComponentTarget.shouldForwardProp) {
|
|
@@ -1564,11 +1556,7 @@ function interleave(strings, interpolations) {
|
|
|
1564
1556
|
* expand an array of styles.
|
|
1565
1557
|
*/
|
|
1566
1558
|
var addTag = function (arg) {
|
|
1567
|
-
|
|
1568
|
-
// eslint-disable-next-line no-param-reassign
|
|
1569
|
-
arg.isCss = true;
|
|
1570
|
-
}
|
|
1571
|
-
return arg;
|
|
1559
|
+
return Object.assign(arg, { isCss: true });
|
|
1572
1560
|
};
|
|
1573
1561
|
function css(styles) {
|
|
1574
1562
|
var interpolations = [];
|
|
@@ -1585,7 +1573,7 @@ function css(styles) {
|
|
|
1585
1573
|
if (interpolations.length === 0 &&
|
|
1586
1574
|
styleStringArray.length === 1 &&
|
|
1587
1575
|
typeof styleStringArray[0] === 'string') {
|
|
1588
|
-
return styleStringArray;
|
|
1576
|
+
return flatten(styleStringArray);
|
|
1589
1577
|
}
|
|
1590
1578
|
return addTag(flatten(interleave(styleStringArray, interpolations)));
|
|
1591
1579
|
}
|