styled-components 6.1.19 → 6.2.0
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/constructors/constructWithOptions.d.ts +0 -1
- package/dist/constructors/styled.d.ts +2 -135
- package/dist/hoc/withTheme.d.ts +1 -1
- package/dist/models/ServerStyleSheet.d.ts +2 -3
- package/dist/models/StyledComponent.d.ts +1 -1
- package/dist/models/StyledNativeComponent.d.ts +1 -1
- package/dist/native/index.d.ts +8 -26
- 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 +22 -15
- 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 +2 -3
- package/dist/types.d.ts +23 -23
- package/dist/utils/domElements.d.ts +1 -1
- package/dist/utils/empties.d.ts +1 -1
- package/native/dist/constructors/constructWithOptions.d.ts +0 -1
- package/native/dist/constructors/styled.d.ts +2 -135
- package/native/dist/dist/constructors/constructWithOptions.d.ts +0 -1
- package/native/dist/dist/constructors/styled.d.ts +2 -135
- package/native/dist/dist/hoc/withTheme.d.ts +1 -1
- package/native/dist/dist/models/ServerStyleSheet.d.ts +2 -3
- package/native/dist/dist/models/StyledComponent.d.ts +1 -1
- package/native/dist/dist/models/StyledNativeComponent.d.ts +1 -1
- package/native/dist/dist/native/index.d.ts +8 -26
- package/native/dist/dist/test/utils.d.ts +2 -3
- package/native/dist/dist/types.d.ts +23 -23
- package/native/dist/dist/utils/domElements.d.ts +1 -1
- package/native/dist/dist/utils/empties.d.ts +1 -1
- package/native/dist/hoc/withTheme.d.ts +1 -1
- package/native/dist/models/ServerStyleSheet.d.ts +2 -3
- package/native/dist/models/StyledComponent.d.ts +1 -1
- package/native/dist/models/StyledNativeComponent.d.ts +1 -1
- package/native/dist/native/index.d.ts +8 -26
- 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 +2 -3
- package/native/dist/types.d.ts +23 -23
- package/native/dist/utils/domElements.d.ts +1 -1
- package/native/dist/utils/empties.d.ts +1 -1
- package/package.json +55 -52
- package/test-utils/setupTestFramework.ts +7 -2
- package/dist/hoc/withTheme.spec.d.ts +0 -1
- package/native/dist/dist/hoc/withTheme.spec.d.ts +0 -1
- package/native/dist/hoc/withTheme.spec.d.ts +0 -1
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference path="../../src/global.d.ts" />
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import { Styled } from '../constructors/constructWithOptions';
|
|
4
3
|
import css from '../constructors/css';
|
|
@@ -6,32 +5,15 @@ import withTheme from '../hoc/withTheme';
|
|
|
6
5
|
import ThemeProvider, { ThemeConsumer, ThemeContext, useTheme } from '../models/ThemeProvider';
|
|
7
6
|
import { NativeTarget, RuleSet } from '../types';
|
|
8
7
|
import isStyledComponent from '../utils/isStyledComponent';
|
|
9
|
-
declare const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
ImageBackground: Styled<"native", typeof import("react-native").ImageBackground, import("react-native").ImageBackgroundProps, import("../types").BaseObject>;
|
|
17
|
-
KeyboardAvoidingView: Styled<"native", typeof import("react-native").KeyboardAvoidingView, import("react-native").KeyboardAvoidingViewProps, import("../types").BaseObject>;
|
|
18
|
-
Modal: Styled<"native", typeof import("react-native").Modal, import("react-native").ModalBaseProps & import("react-native").ModalPropsIOS & import("react-native").ModalPropsAndroid & import("react-native").ViewProps, import("../types").BaseObject>;
|
|
19
|
-
Pressable: Styled<"native", React.ForwardRefExoticComponent<import("react-native").PressableProps & React.RefAttributes<import("react-native").View>>, import("react-native").PressableProps & React.RefAttributes<import("react-native").View>, import("../types").BaseObject>;
|
|
20
|
-
ProgressBarAndroid: Styled<"native", typeof import("react-native").ProgressBarAndroid, import("react-native").ProgressBarAndroidProps, import("../types").BaseObject>;
|
|
21
|
-
ProgressViewIOS: Styled<"native", typeof import("react-native").ProgressViewIOS, import("react-native").ProgressViewIOSProps, import("../types").BaseObject>;
|
|
22
|
-
RefreshControl: Styled<"native", typeof import("react-native").RefreshControl, import("react-native").RefreshControlProps, import("../types").BaseObject>;
|
|
23
|
-
SafeAreaView: Styled<"native", typeof import("react-native").SafeAreaView, import("react-native").ViewProps, import("../types").BaseObject>;
|
|
24
|
-
ScrollView: Styled<"native", typeof import("react-native").ScrollView, import("react-native").ScrollViewProps, import("../types").BaseObject>;
|
|
25
|
-
SectionList: Styled<"native", typeof import("react-native").SectionList, import("react-native").SectionListProps<unknown, unknown>, import("../types").BaseObject>;
|
|
26
|
-
Slider: Styled<"native", typeof import("react-native").Slider, import("react-native").SliderProps, import("../types").BaseObject>;
|
|
27
|
-
Switch: Styled<"native", typeof import("react-native").Switch, import("react-native").SwitchProps, import("../types").BaseObject>;
|
|
28
|
-
Text: Styled<"native", typeof import("react-native").Text, import("react-native").TextProps, import("../types").BaseObject>;
|
|
29
|
-
TextInput: Styled<"native", typeof import("react-native").TextInput, import("react-native").TextInputProps, import("../types").BaseObject>;
|
|
30
|
-
TouchableHighlight: Styled<"native", typeof import("react-native").TouchableHighlight, import("react-native").TouchableHighlightProps, import("../types").BaseObject>;
|
|
31
|
-
TouchableOpacity: Styled<"native", typeof import("react-native").TouchableOpacity, import("react-native").TouchableOpacityProps, import("../types").BaseObject>;
|
|
32
|
-
View: Styled<"native", typeof import("react-native").View, import("react-native").ViewProps, import("../types").BaseObject>;
|
|
33
|
-
VirtualizedList: Styled<"native", typeof import("react-native").VirtualizedList, import("react-native").VirtualizedListProps<unknown>, import("../types").BaseObject>;
|
|
8
|
+
declare const reactNative: Awaited<typeof import("react-native")>;
|
|
9
|
+
declare const baseStyled: <Target extends NativeTarget>(tag: Target) => Styled<"native", Target, Target extends import("../types").KnownTarget ? React.ComponentPropsWithRef<Target> : import("../types").BaseObject, import("../types").BaseObject>;
|
|
10
|
+
declare const aliases: readonly ["ActivityIndicator", "Button", "DatePickerIOS", "DrawerLayoutAndroid", "FlatList", "Image", "ImageBackground", "KeyboardAvoidingView", "Modal", "Pressable", "ProgressBarAndroid", "ProgressViewIOS", "RefreshControl", "SafeAreaView", "ScrollView", "SectionList", "Slider", "Switch", "Text", "TextInput", "TouchableHighlight", "TouchableOpacity", "View", "VirtualizedList"];
|
|
11
|
+
type KnownComponents = (typeof aliases)[number];
|
|
12
|
+
/** Isolates RN-provided components since they don't expose a helper type for this. */
|
|
13
|
+
type RNComponents = {
|
|
14
|
+
[K in keyof typeof reactNative]: (typeof reactNative)[K] extends React.ComponentType<any> ? (typeof reactNative)[K] : never;
|
|
34
15
|
};
|
|
16
|
+
declare const styled: typeof baseStyled & { [E in KnownComponents]: Styled<"native", RNComponents[E], React.ComponentProps<RNComponents[E]>>; };
|
|
35
17
|
declare const toStyleSheet: (rules: RuleSet<object>) => import("css-to-react-native").Style;
|
|
36
18
|
export { CSSKeyframes, CSSObject, CSSProperties, CSSPseudos, DefaultTheme, ExecutionContext, ExecutionProps, IStyledComponent, IStyledComponentFactory, IStyledStatics, NativeTarget, PolymorphicComponent, PolymorphicComponentProps, Runtime, StyledObject, StyledOptions, } from '../types';
|
|
37
19
|
export { ThemeConsumer, ThemeContext, ThemeProvider, css, styled as default, isStyledComponent, styled, toStyleSheet, useTheme, withTheme, };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export declare const seedNextClassnames: (names: string[]) => string[];
|
|
3
2
|
export declare const resetStyled: (isServer?: boolean) => (<Target extends import("..").WebTarget, InjectedProps extends object = import("../types").BaseObject>(tag: Target) => import("../constructors/constructWithOptions").Styled<"web", Target, Target extends import("../types").KnownTarget ? import("react").ComponentPropsWithRef<Target> & InjectedProps : InjectedProps, import("../types").BaseObject>) & {
|
|
4
3
|
object: import("../constructors/constructWithOptions").Styled<"web", "object", import("react").DetailedHTMLProps<import("react").ObjectHTMLAttributes<HTMLObjectElement>, HTMLObjectElement>, import("../types").BaseObject>;
|
|
@@ -9,6 +8,7 @@ export declare const resetStyled: (isServer?: boolean) => (<Target extends impor
|
|
|
9
8
|
small: import("../constructors/constructWithOptions").Styled<"web", "small", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
|
|
10
9
|
sub: import("../constructors/constructWithOptions").Styled<"web", "sub", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
|
|
11
10
|
sup: import("../constructors/constructWithOptions").Styled<"web", "sup", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
|
|
11
|
+
input: import("../constructors/constructWithOptions").Styled<"web", "input", import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, import("../types").BaseObject>;
|
|
12
12
|
a: import("../constructors/constructWithOptions").Styled<"web", "a", import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, import("../types").BaseObject>;
|
|
13
13
|
abbr: import("../constructors/constructWithOptions").Styled<"web", "abbr", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
|
|
14
14
|
address: import("../constructors/constructWithOptions").Styled<"web", "address", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
|
|
@@ -60,7 +60,6 @@ export declare const resetStyled: (isServer?: boolean) => (<Target extends impor
|
|
|
60
60
|
i: import("../constructors/constructWithOptions").Styled<"web", "i", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
|
|
61
61
|
iframe: import("../constructors/constructWithOptions").Styled<"web", "iframe", import("react").DetailedHTMLProps<import("react").IframeHTMLAttributes<HTMLIFrameElement>, HTMLIFrameElement>, import("../types").BaseObject>;
|
|
62
62
|
img: import("../constructors/constructWithOptions").Styled<"web", "img", import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, import("../types").BaseObject>;
|
|
63
|
-
input: import("../constructors/constructWithOptions").Styled<"web", "input", import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, import("../types").BaseObject>;
|
|
64
63
|
ins: import("../constructors/constructWithOptions").Styled<"web", "ins", import("react").DetailedHTMLProps<import("react").InsHTMLAttributes<HTMLModElement>, HTMLModElement>, import("../types").BaseObject>;
|
|
65
64
|
kbd: import("../constructors/constructWithOptions").Styled<"web", "kbd", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
|
|
66
65
|
keygen: import("../constructors/constructWithOptions").Styled<"web", "keygen", import("react").DetailedHTMLProps<import("react").KeygenHTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
|
|
@@ -113,7 +112,6 @@ export declare const resetStyled: (isServer?: boolean) => (<Target extends impor
|
|
|
113
112
|
var: import("../constructors/constructWithOptions").Styled<"web", "var", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
|
|
114
113
|
video: import("../constructors/constructWithOptions").Styled<"web", "video", import("react").DetailedHTMLProps<import("react").VideoHTMLAttributes<HTMLVideoElement>, HTMLVideoElement>, import("../types").BaseObject>;
|
|
115
114
|
wbr: import("../constructors/constructWithOptions").Styled<"web", "wbr", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
|
|
116
|
-
svg: import("../constructors/constructWithOptions").Styled<"web", "svg", import("react").SVGProps<SVGSVGElement>, import("../types").BaseObject>;
|
|
117
115
|
circle: import("../constructors/constructWithOptions").Styled<"web", "circle", import("react").SVGProps<SVGCircleElement>, import("../types").BaseObject>;
|
|
118
116
|
clipPath: import("../constructors/constructWithOptions").Styled<"web", "clipPath", import("react").SVGProps<SVGClipPathElement>, import("../types").BaseObject>;
|
|
119
117
|
defs: import("../constructors/constructWithOptions").Styled<"web", "defs", import("react").SVGProps<SVGDefsElement>, import("../types").BaseObject>;
|
|
@@ -131,6 +129,7 @@ export declare const resetStyled: (isServer?: boolean) => (<Target extends impor
|
|
|
131
129
|
radialGradient: import("../constructors/constructWithOptions").Styled<"web", "radialGradient", import("react").SVGProps<SVGRadialGradientElement>, import("../types").BaseObject>;
|
|
132
130
|
rect: import("../constructors/constructWithOptions").Styled<"web", "rect", import("react").SVGProps<SVGRectElement>, import("../types").BaseObject>;
|
|
133
131
|
stop: import("../constructors/constructWithOptions").Styled<"web", "stop", import("react").SVGProps<SVGStopElement>, import("../types").BaseObject>;
|
|
132
|
+
svg: import("../constructors/constructWithOptions").Styled<"web", "svg", import("react").SVGProps<SVGSVGElement>, import("../types").BaseObject>;
|
|
134
133
|
text: import("../constructors/constructWithOptions").Styled<"web", "text", import("react").SVGTextElementAttributes<SVGTextElement>, import("../types").BaseObject>;
|
|
135
134
|
tspan: import("../constructors/constructWithOptions").Styled<"web", "tspan", import("react").SVGProps<SVGTSpanElement>, import("../types").BaseObject>;
|
|
136
135
|
use: import("../constructors/constructWithOptions").Styled<"web", "use", import("react").SVGProps<SVGUseElement>, import("../types").BaseObject>;
|
|
@@ -5,7 +5,7 @@ import { DefaultTheme } from './models/ThemeProvider';
|
|
|
5
5
|
import createWarnTooManyClasses from './utils/createWarnTooManyClasses';
|
|
6
6
|
import type { SupportedHTMLElements } from './utils/domElements';
|
|
7
7
|
export { CSS, DefaultTheme, SupportedHTMLElements };
|
|
8
|
-
export interface ExoticComponentWithDisplayName<P extends
|
|
8
|
+
export interface ExoticComponentWithDisplayName<P extends BaseObject = {}> extends React.ExoticComponent<P> {
|
|
9
9
|
defaultProps?: Partial<P> | undefined;
|
|
10
10
|
displayName?: string | undefined;
|
|
11
11
|
}
|
|
@@ -20,16 +20,16 @@ export type BaseObject = {};
|
|
|
20
20
|
export type OmitNever<T> = {
|
|
21
21
|
[K in keyof T as T[K] extends never ? never : K]: T[K];
|
|
22
22
|
};
|
|
23
|
-
export type FastOmit<T extends
|
|
23
|
+
export type FastOmit<T extends BaseObject, U extends string | number | symbol> = {
|
|
24
24
|
[K in keyof T as K extends U ? never : K]: T[K];
|
|
25
25
|
};
|
|
26
26
|
export type Runtime = 'web' | 'native';
|
|
27
|
-
export type AnyComponent<P extends
|
|
27
|
+
export type AnyComponent<P extends BaseObject = any> = ExoticComponentWithDisplayName<P> | React.ComponentType<P>;
|
|
28
28
|
export type KnownTarget = SupportedHTMLElements | AnyComponent;
|
|
29
29
|
export type WebTarget = string | KnownTarget;
|
|
30
30
|
export type NativeTarget = AnyComponent;
|
|
31
31
|
export type StyledTarget<R extends Runtime> = R extends 'web' ? WebTarget : NativeTarget;
|
|
32
|
-
export interface StyledOptions<R extends Runtime, Props extends
|
|
32
|
+
export interface StyledOptions<R extends Runtime, Props extends BaseObject> {
|
|
33
33
|
attrs?: Attrs<Props>[] | undefined;
|
|
34
34
|
componentId?: (R extends 'web' ? string : never) | undefined;
|
|
35
35
|
displayName?: string | undefined;
|
|
@@ -76,13 +76,13 @@ export type ExecutionProps = {
|
|
|
76
76
|
export interface ExecutionContext extends ExecutionProps {
|
|
77
77
|
theme: DefaultTheme;
|
|
78
78
|
}
|
|
79
|
-
export interface StyleFunction<Props extends
|
|
79
|
+
export interface StyleFunction<Props extends BaseObject> {
|
|
80
80
|
(executionContext: ExecutionContext & Props): Interpolation<Props>;
|
|
81
81
|
}
|
|
82
|
-
export type Interpolation<Props extends
|
|
83
|
-
export type Attrs<Props extends
|
|
84
|
-
export type RuleSet<Props extends
|
|
85
|
-
export type Styles<Props extends
|
|
82
|
+
export type Interpolation<Props extends BaseObject> = StyleFunction<Props> | StyledObject<Props> | TemplateStringsArray | string | number | false | undefined | null | Keyframes | StyledComponentBrand | RuleSet<Props> | Interpolation<Props>[];
|
|
83
|
+
export type Attrs<Props extends BaseObject = BaseObject> = (ExecutionProps & Partial<Props>) | ((props: ExecutionContext & Props) => ExecutionProps & Partial<Props>);
|
|
84
|
+
export type RuleSet<Props extends BaseObject = BaseObject> = Interpolation<Props>[];
|
|
85
|
+
export type Styles<Props extends BaseObject> = TemplateStringsArray | StyledObject<Props> | StyleFunction<Props>;
|
|
86
86
|
export type NameGenerator = (hash: number) => string;
|
|
87
87
|
export interface StyleSheet {
|
|
88
88
|
create: Function;
|
|
@@ -92,7 +92,7 @@ export interface Keyframes {
|
|
|
92
92
|
name: string;
|
|
93
93
|
rules: string;
|
|
94
94
|
}
|
|
95
|
-
export interface Flattener<Props extends
|
|
95
|
+
export interface Flattener<Props extends BaseObject> {
|
|
96
96
|
(chunks: Interpolation<Props>[], executionContext: object | null | undefined, styleSheet: StyleSheet | null | undefined): Interpolation<Props>[];
|
|
97
97
|
}
|
|
98
98
|
export interface Stringifier {
|
|
@@ -102,12 +102,12 @@ export interface Stringifier {
|
|
|
102
102
|
export interface ShouldForwardProp<R extends Runtime> {
|
|
103
103
|
(prop: string, elementToBeCreated: StyledTarget<R>): boolean;
|
|
104
104
|
}
|
|
105
|
-
export interface CommonStatics<R extends Runtime, Props extends
|
|
105
|
+
export interface CommonStatics<R extends Runtime, Props extends BaseObject> {
|
|
106
106
|
attrs: Attrs<Props>[];
|
|
107
107
|
target: StyledTarget<R>;
|
|
108
108
|
shouldForwardProp?: ShouldForwardProp<R> | undefined;
|
|
109
109
|
}
|
|
110
|
-
export interface IStyledStatics<R extends Runtime, OuterProps extends
|
|
110
|
+
export interface IStyledStatics<R extends Runtime, OuterProps extends BaseObject> extends CommonStatics<R, OuterProps> {
|
|
111
111
|
componentStyle: R extends 'web' ? ComponentStyle : never;
|
|
112
112
|
foldedComponentIds: R extends 'web' ? string : never;
|
|
113
113
|
inlineStyle: R extends 'native' ? InstanceType<IInlineStyleConstructor<OuterProps>> : never;
|
|
@@ -118,7 +118,7 @@ export interface IStyledStatics<R extends Runtime, OuterProps extends object> ex
|
|
|
118
118
|
/**
|
|
119
119
|
* Used by PolymorphicComponent to define prop override cascading order.
|
|
120
120
|
*/
|
|
121
|
-
export type PolymorphicComponentProps<R extends Runtime, BaseProps extends
|
|
121
|
+
export type PolymorphicComponentProps<R extends Runtime, BaseProps extends BaseObject, AsTarget extends StyledTarget<R> | void, ForwardedAsTarget extends StyledTarget<R> | void, AsTargetProps extends BaseObject = AsTarget extends KnownTarget ? React.ComponentPropsWithRef<AsTarget> : {}, ForwardedAsTargetProps extends BaseObject = ForwardedAsTarget extends KnownTarget ? React.ComponentPropsWithRef<ForwardedAsTarget> : {}> = NoInfer<FastOmit<Substitute<BaseProps, Substitute<ForwardedAsTargetProps, AsTargetProps>>, keyof ExecutionProps>> & FastOmit<ExecutionProps, 'as' | 'forwardedAs'> & {
|
|
122
122
|
as?: AsTarget;
|
|
123
123
|
forwardedAs?: ForwardedAsTarget;
|
|
124
124
|
};
|
|
@@ -129,14 +129,14 @@ export type PolymorphicComponentProps<R extends Runtime, BaseProps extends objec
|
|
|
129
129
|
* props from the given rendering target to get proper typing for
|
|
130
130
|
* any specialized props in the target component.
|
|
131
131
|
*/
|
|
132
|
-
export interface PolymorphicComponent<R extends Runtime, BaseProps extends
|
|
132
|
+
export interface PolymorphicComponent<R extends Runtime, BaseProps extends BaseObject> extends React.ForwardRefExoticComponent<BaseProps> {
|
|
133
133
|
<AsTarget extends StyledTarget<R> | void = void, ForwardedAsTarget extends StyledTarget<R> | void = void>(props: PolymorphicComponentProps<R, BaseProps, AsTarget, ForwardedAsTarget>): React.JSX.Element;
|
|
134
134
|
}
|
|
135
|
-
export interface IStyledComponentBase<R extends Runtime, Props extends
|
|
135
|
+
export interface IStyledComponentBase<R extends Runtime, Props extends BaseObject = BaseObject> extends PolymorphicComponent<R, Props>, IStyledStatics<R, Props>, StyledComponentBrand {
|
|
136
136
|
defaultProps?: (ExecutionProps & Partial<Props>) | undefined;
|
|
137
137
|
toString: () => string;
|
|
138
138
|
}
|
|
139
|
-
export type IStyledComponent<R extends Runtime, Props extends
|
|
139
|
+
export type IStyledComponent<R extends Runtime, Props extends BaseObject = BaseObject> = IStyledComponentBase<R, Props> &
|
|
140
140
|
/**
|
|
141
141
|
* TypeScript doesn't allow using a styled component as a key inside object
|
|
142
142
|
* styles because "A computed property name must be of type 'string', 'number',
|
|
@@ -156,13 +156,13 @@ export type IStyledComponent<R extends Runtime, Props extends object = BaseObjec
|
|
|
156
156
|
* })
|
|
157
157
|
*/
|
|
158
158
|
(R extends 'web' ? string : {});
|
|
159
|
-
export interface IStyledComponentFactory<R extends Runtime, Target extends StyledTarget<R>, OuterProps extends
|
|
160
|
-
<Props extends
|
|
159
|
+
export interface IStyledComponentFactory<R extends Runtime, Target extends StyledTarget<R>, OuterProps extends BaseObject, OuterStatics extends BaseObject = BaseObject> {
|
|
160
|
+
<Props extends BaseObject = BaseObject, Statics extends BaseObject = BaseObject>(target: Target, options: StyledOptions<R, OuterProps & Props>, rules: RuleSet<OuterProps & Props>): IStyledComponent<R, Substitute<OuterProps, Props>> & OuterStatics & Statics;
|
|
161
161
|
}
|
|
162
|
-
export interface IInlineStyleConstructor<Props extends
|
|
162
|
+
export interface IInlineStyleConstructor<Props extends BaseObject> {
|
|
163
163
|
new (rules: RuleSet<Props>): IInlineStyle<Props>;
|
|
164
164
|
}
|
|
165
|
-
export interface IInlineStyle<Props extends
|
|
165
|
+
export interface IInlineStyle<Props extends BaseObject> {
|
|
166
166
|
rules: RuleSet<Props>;
|
|
167
167
|
generateStyleObject(executionContext: ExecutionContext & Props): object;
|
|
168
168
|
}
|
|
@@ -173,8 +173,8 @@ export type CSSPseudos = {
|
|
|
173
173
|
export type CSSKeyframes = object & {
|
|
174
174
|
[key: string]: CSSObject;
|
|
175
175
|
};
|
|
176
|
-
export type CSSObject<Props extends
|
|
177
|
-
export interface StyledObject<Props extends
|
|
176
|
+
export type CSSObject<Props extends BaseObject = BaseObject> = StyledObject<Props>;
|
|
177
|
+
export interface StyledObject<Props extends BaseObject = BaseObject> extends CSSProperties, CSSPseudos {
|
|
178
178
|
[key: string]: StyledObject<Props> | string | number | StyleFunction<Props> | RuleSet<any> | undefined;
|
|
179
179
|
}
|
|
180
180
|
/**
|
|
@@ -200,5 +200,5 @@ export interface StyledObject<Props extends object = BaseObject> extends CSSProp
|
|
|
200
200
|
*/
|
|
201
201
|
export type CSSProp = Interpolation<any>;
|
|
202
202
|
export type NoInfer<T> = [T][T extends any ? 0 : never];
|
|
203
|
-
export type Substitute<A extends
|
|
203
|
+
export type Substitute<A extends BaseObject, B extends BaseObject> = FastOmit<A, keyof B> & B;
|
|
204
204
|
export type InsertionTarget = HTMLElement | ShadowRoot;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
declare const elements: readonly ["a", "abbr", "address", "area", "article", "aside", "audio", "b", "base", "bdi", "bdo", "big", "blockquote", "body", "br", "button", "canvas", "caption", "cite", "code", "col", "colgroup", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "header", "hgroup", "hr", "html", "i", "iframe", "img", "input", "ins", "kbd", "keygen", "label", "legend", "li", "link", "main", "map", "mark", "menu", "menuitem", "meta", "meter", "nav", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "script", "section", "select", "small", "source", "span", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "u", "ul", "use", "var", "video", "wbr", "circle", "clipPath", "defs", "ellipse", "foreignObject", "g", "image", "line", "linearGradient", "marker", "mask", "path", "pattern", "polygon", "polyline", "radialGradient", "rect", "stop", "svg", "text", "tspan"];
|
|
2
|
-
declare const _default: Set<"object" | "g" | "map" | "big" | "link" | "small" | "sub" | "sup" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "
|
|
2
|
+
declare const _default: Set<"object" | "g" | "map" | "big" | "link" | "small" | "sub" | "sup" | "input" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "ins" | "kbd" | "keygen" | "label" | "legend" | "li" | "main" | "mark" | "menu" | "menuitem" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "source" | "span" | "strong" | "style" | "summary" | "table" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "time" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "circle" | "clipPath" | "defs" | "ellipse" | "foreignObject" | "image" | "line" | "linearGradient" | "marker" | "mask" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "svg" | "text" | "tspan" | "use">;
|
|
3
3
|
export default _default;
|
|
4
4
|
export type SupportedHTMLElements = (typeof elements)[number];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { AnyComponent, ExecutionProps } from '../types';
|
|
3
3
|
import { NonReactStatics } from '../utils/hoist';
|
|
4
|
-
export default function withTheme<T extends AnyComponent>(Component: T): React.ForwardRefExoticComponent<React.PropsWithoutRef<React.
|
|
4
|
+
export default function withTheme<T extends AnyComponent>(Component: T): React.ForwardRefExoticComponent<React.PropsWithoutRef<React.ComponentPropsWithRef<T> & ExecutionProps> & React.RefAttributes<T>> & NonReactStatics<T>;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import React from 'react';
|
|
2
|
+
import { type PipeableStream } from 'react-dom/server';
|
|
3
3
|
import type * as streamInternal from 'stream';
|
|
4
|
-
import { Readable } from 'stream';
|
|
5
4
|
import StyleSheet from '../sheet';
|
|
6
5
|
export default class ServerStyleSheet {
|
|
7
6
|
instance: StyleSheet;
|
|
@@ -11,6 +10,6 @@ export default class ServerStyleSheet {
|
|
|
11
10
|
collectStyles(children: any): React.JSX.Element;
|
|
12
11
|
getStyleTags: () => string;
|
|
13
12
|
getStyleElement: () => React.JSX.Element[];
|
|
14
|
-
interleaveWithNodeStream(input:
|
|
13
|
+
interleaveWithNodeStream(input: NodeJS.ReadableStream | PipeableStream): streamInternal.Transform;
|
|
15
14
|
seal: () => void;
|
|
16
15
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { BaseObject, IStyledComponentFactory, RuleSet, StyledOptions, WebTarget } from '../types';
|
|
2
|
-
declare function createStyledComponent<Target extends WebTarget, OuterProps extends
|
|
2
|
+
declare function createStyledComponent<Target extends WebTarget, OuterProps extends BaseObject, Statics extends BaseObject = BaseObject>(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
1
|
import type { BaseObject, ExecutionProps, IInlineStyleConstructor, IStyledComponentFactory, NativeTarget, RuleSet, StyledOptions } from '../types';
|
|
2
|
-
declare const _default: (InlineStyle: IInlineStyleConstructor<any>) => <Target extends NativeTarget, OuterProps extends ExecutionProps, Statics extends object = BaseObject>(target: Target, options: StyledOptions<
|
|
2
|
+
declare const _default: (InlineStyle: IInlineStyleConstructor<any>) => <Target extends NativeTarget, OuterProps extends ExecutionProps, Statics extends object = BaseObject>(target: Target, options: StyledOptions<"native", OuterProps>, rules: RuleSet<OuterProps>) => ReturnType<IStyledComponentFactory<"native", Target, OuterProps, Statics>>;
|
|
3
3
|
export default _default;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference path="../../../src/global.d.ts" />
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import { Styled } from '../constructors/constructWithOptions';
|
|
4
3
|
import css from '../constructors/css';
|
|
@@ -6,32 +5,15 @@ import withTheme from '../hoc/withTheme';
|
|
|
6
5
|
import ThemeProvider, { ThemeConsumer, ThemeContext, useTheme } from '../models/ThemeProvider';
|
|
7
6
|
import { NativeTarget, RuleSet } from '../types';
|
|
8
7
|
import isStyledComponent from '../utils/isStyledComponent';
|
|
9
|
-
declare const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
ImageBackground: Styled<"native", typeof import("react-native").ImageBackground, import("react-native").ImageBackgroundProps, import("../types").BaseObject>;
|
|
17
|
-
KeyboardAvoidingView: Styled<"native", typeof import("react-native").KeyboardAvoidingView, import("react-native").KeyboardAvoidingViewProps, import("../types").BaseObject>;
|
|
18
|
-
Modal: Styled<"native", typeof import("react-native").Modal, import("react-native").ModalBaseProps & import("react-native").ModalPropsIOS & import("react-native").ModalPropsAndroid & import("react-native").ViewProps, import("../types").BaseObject>;
|
|
19
|
-
Pressable: Styled<"native", React.ForwardRefExoticComponent<import("react-native").PressableProps & React.RefAttributes<import("react-native").View>>, import("react-native").PressableProps & React.RefAttributes<import("react-native").View>, import("../types").BaseObject>;
|
|
20
|
-
ProgressBarAndroid: Styled<"native", typeof import("react-native").ProgressBarAndroid, import("react-native").ProgressBarAndroidProps, import("../types").BaseObject>;
|
|
21
|
-
ProgressViewIOS: Styled<"native", typeof import("react-native").ProgressViewIOS, import("react-native").ProgressViewIOSProps, import("../types").BaseObject>;
|
|
22
|
-
RefreshControl: Styled<"native", typeof import("react-native").RefreshControl, import("react-native").RefreshControlProps, import("../types").BaseObject>;
|
|
23
|
-
SafeAreaView: Styled<"native", typeof import("react-native").SafeAreaView, import("react-native").ViewProps, import("../types").BaseObject>;
|
|
24
|
-
ScrollView: Styled<"native", typeof import("react-native").ScrollView, import("react-native").ScrollViewProps, import("../types").BaseObject>;
|
|
25
|
-
SectionList: Styled<"native", typeof import("react-native").SectionList, import("react-native").SectionListProps<unknown, unknown>, import("../types").BaseObject>;
|
|
26
|
-
Slider: Styled<"native", typeof import("react-native").Slider, import("react-native").SliderProps, import("../types").BaseObject>;
|
|
27
|
-
Switch: Styled<"native", typeof import("react-native").Switch, import("react-native").SwitchProps, import("../types").BaseObject>;
|
|
28
|
-
Text: Styled<"native", typeof import("react-native").Text, import("react-native").TextProps, import("../types").BaseObject>;
|
|
29
|
-
TextInput: Styled<"native", typeof import("react-native").TextInput, import("react-native").TextInputProps, import("../types").BaseObject>;
|
|
30
|
-
TouchableHighlight: Styled<"native", typeof import("react-native").TouchableHighlight, import("react-native").TouchableHighlightProps, import("../types").BaseObject>;
|
|
31
|
-
TouchableOpacity: Styled<"native", typeof import("react-native").TouchableOpacity, import("react-native").TouchableOpacityProps, import("../types").BaseObject>;
|
|
32
|
-
View: Styled<"native", typeof import("react-native").View, import("react-native").ViewProps, import("../types").BaseObject>;
|
|
33
|
-
VirtualizedList: Styled<"native", typeof import("react-native").VirtualizedList, import("react-native").VirtualizedListProps<unknown>, import("../types").BaseObject>;
|
|
8
|
+
declare const reactNative: Awaited<typeof import("react-native")>;
|
|
9
|
+
declare const baseStyled: <Target extends NativeTarget>(tag: Target) => Styled<"native", Target, Target extends import("../types").KnownTarget ? React.ComponentPropsWithRef<Target> : import("../types").BaseObject, import("../types").BaseObject>;
|
|
10
|
+
declare const aliases: readonly ["ActivityIndicator", "Button", "DatePickerIOS", "DrawerLayoutAndroid", "FlatList", "Image", "ImageBackground", "KeyboardAvoidingView", "Modal", "Pressable", "ProgressBarAndroid", "ProgressViewIOS", "RefreshControl", "SafeAreaView", "ScrollView", "SectionList", "Slider", "Switch", "Text", "TextInput", "TouchableHighlight", "TouchableOpacity", "View", "VirtualizedList"];
|
|
11
|
+
type KnownComponents = (typeof aliases)[number];
|
|
12
|
+
/** Isolates RN-provided components since they don't expose a helper type for this. */
|
|
13
|
+
type RNComponents = {
|
|
14
|
+
[K in keyof typeof reactNative]: (typeof reactNative)[K] extends React.ComponentType<any> ? (typeof reactNative)[K] : never;
|
|
34
15
|
};
|
|
16
|
+
declare const styled: typeof baseStyled & { [E in KnownComponents]: Styled<"native", RNComponents[E], React.ComponentProps<RNComponents[E]>>; };
|
|
35
17
|
declare const toStyleSheet: (rules: RuleSet<object>) => import("css-to-react-native").Style;
|
|
36
18
|
export { CSSKeyframes, CSSObject, CSSProperties, CSSPseudos, DefaultTheme, ExecutionContext, ExecutionProps, IStyledComponent, IStyledComponentFactory, IStyledStatics, NativeTarget, PolymorphicComponent, PolymorphicComponentProps, Runtime, StyledObject, StyledOptions, } from '../types';
|
|
37
19
|
export { ThemeConsumer, ThemeContext, ThemeProvider, css, styled as default, isStyledComponent, styled, toStyleSheet, useTheme, withTheme, };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("css-to-react-native"),t=require("postcss"),n=require("tslib"),r=require("react");require("shallowequal");var o=require("stylis"),i=require("@emotion/unitless");function s(e){return e&&e.__esModule?e:{default:e}}function a(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}var c=/*#__PURE__*/s(e),u=/*#__PURE__*/s(r),l=/*#__PURE__*/a(o),p=/*#__PURE__*/s(i),h=Object.freeze([]),f=Object.freeze({}),d="production"!==process.env.NODE_ENV?{1:"Cannot create styled-component for component: %s.\n\n",2:"Can't collect styles once you've consumed a `ServerStyleSheet`'s styles! `ServerStyleSheet` is a one off instance for each server-side render cycle.\n\n- Are you trying to reuse it across renders?\n- Are you accidentally calling collectStyles twice?\n\n",3:"Streaming SSR is only supported in a Node.js environment; Please do not try to call this method in the browser.\n\n",4:"The `StyleSheetManager` expects a valid target or sheet prop!\n\n- Does this error occur on the client and is your target falsy?\n- Does this error occur on the server and is the sheet falsy?\n\n",5:"The clone method cannot be used on the client!\n\n- Are you running in a client-like environment on the server?\n- Are you trying to run SSR on the client?\n\n",6:"Trying to insert a new style tag, but the given Node is unmounted!\n\n- Are you using a custom target that isn't mounted?\n- Does your document not have a valid head element?\n- Have you accidentally removed a style tag manually?\n\n",7:'ThemeProvider: Please return an object from your "theme" prop function, e.g.\n\n```js\ntheme={() => ({})}\n```\n\n',8:'ThemeProvider: Please make your "theme" prop an object.\n\n',9:"Missing document `<head>`\n\n",10:"Cannot find a StyleSheet instance. Usually this happens if there are multiple copies of styled-components loaded at once. Check out this issue for how to troubleshoot and fix the common cases where this situation can happen: https://github.com/styled-components/styled-components/issues/1941#issuecomment-417862021\n\n",11:"_This error was replaced with a dev-time warning, it will be deleted for v4 final._ [createGlobalStyle] received children which will not be rendered. Please use the component without passing children elements.\n\n",12:"It seems you are interpolating a keyframe declaration (%s) into an untagged string. This was supported in styled-components v3, but is not longer supported in v4 as keyframes are now injected on-demand. Please wrap your string in the css\\`\\` helper which ensures the styles are injected correctly. See https://www.styled-components.com/docs/api#css\n\n",13:"%s is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.\n\n",14:'ThemeProvider: "theme" prop is required.\n\n',15:"A stylis plugin has been supplied that is not named. We need a name for each plugin to be able to prevent styling collisions between different stylis configurations within the same app. Before you pass your plugin to `<StyleSheetManager stylisPlugins={[]}>`, please make sure each plugin is uniquely-named, e.g.\n\n```js\nObject.defineProperty(importedPlugin, 'name', { value: 'some-unique-name' });\n```\n\n",16:"Reached the limit of how many styled components may be created at group %s.\nYou may only create up to 1,073,741,824 components. If you're creating components dynamically,\nas for instance in your render method then you may be running into this limitation.\n\n",17:"CSSStyleSheet could not be found on HTMLStyleElement.\nHas styled-components' style tag been unmounted or altered by another script?\n",18:"ThemeProvider: Please make sure your useTheme hook is within a `<ThemeProvider>`"}:{};function y(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=e[0],r=[],o=1,i=e.length;o<i;o+=1)r.push(e[o]);return r.forEach(function(e){n=n.replace(/%[a-z]/,e)}),n}function v(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return"production"===process.env.NODE_ENV?new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(e," for more information.").concat(t.length>0?" Args: ".concat(t.join(", ")):"")):new Error(y.apply(void 0,n.__spreadArray([d[e]],t,!1)).trim())}function m(e,t){Object.defineProperty(e,"toString",{value:t})}var g="undefined"!=typeof process&&void 0!==process.env&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",S="active",_="data-styled-version",w="6.1.19",b="/*!sc*/\n",E="undefined"!=typeof window&&"undefined"!=typeof document,A=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env&&void 0!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==process.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&process.env.REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env&&void 0!==process.env.SC_DISABLE_SPEEDY&&""!==process.env.SC_DISABLE_SPEEDY?"false"!==process.env.SC_DISABLE_SPEEDY&&process.env.SC_DISABLE_SPEEDY:"production"!==process.env.NODE_ENV),P=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}return e.prototype.indexOfGroup=function(e){for(var t=0,n=0;n<e;n++)t+=this.groupSizes[n];return t},e.prototype.insertRules=function(e,t){if(e>=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,o=r;e>=o;)if((o<<=1)<0)throw v(16,"".concat(e));this.groupSizes=new Uint32Array(o),this.groupSizes.set(n),this.length=o;for(var i=r;i<o;i++)this.groupSizes[i]=0}for(var s=this.indexOfGroup(e+1),a=(i=0,t.length);i<a;i++)this.tag.insertRule(s,t[i])&&(this.groupSizes[e]++,s++)},e.prototype.clearGroup=function(e){if(e<this.length){var t=this.groupSizes[e],n=this.indexOfGroup(e),r=n+t;this.groupSizes[e]=0;for(var o=n;o<r;o++)this.tag.deleteRule(n)}},e.prototype.getGroup=function(e){var t="";if(e>=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),o=r+n,i=r;i<o;i++)t+="".concat(this.tag.getRule(i)).concat(b);return t},e}(),C=1<<30,N=new Map,T=new Map,O=1,x=function(e){if(N.has(e))return N.get(e);for(;T.has(O);)O++;var t=O++;if("production"!==process.env.NODE_ENV&&((0|t)<0||t>C))throw v(16,"".concat(t));return N.set(e,t),T.set(t,e),t},D=function(e,t){O=t+1,N.set(e,t),T.set(t,e)},j="style[".concat(g,"][").concat(_,'="').concat(w,'"]'),R=new RegExp("^".concat(g,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),I=function(e,t,n){for(var r,o=n.split(","),i=0,s=o.length;i<s;i++)(r=o[i])&&e.registerName(t,r)},z=function(e,t){for(var n,r=(null!==(n=t.textContent)&&void 0!==n?n:"").split(b),o=[],i=0,s=r.length;i<s;i++){var a=r[i].trim();if(a){var c=a.match(R);if(c){var u=0|parseInt(c[1],10),l=c[2];0!==u&&(D(l,u),I(e,l,c[3]),e.getTag().insertRules(u,o)),o.length=0}else o.push(a)}}},B=function(e){for(var t=document.querySelectorAll(j),n=0,r=t.length;n<r;n++){var o=t[n];o&&o.getAttribute(g)!==S&&(z(e,o),o.parentNode&&o.parentNode.removeChild(o))}},L=function(e){var t=document.head,n=e||t,r=document.createElement("style"),o=function(e){var t=Array.from(e.querySelectorAll("style[".concat(g,"]")));return t[t.length-1]}(n),i=void 0!==o?o.nextSibling:null;r.setAttribute(g,S),r.setAttribute(_,w);var s="undefined"!=typeof __webpack_nonce__?__webpack_nonce__:null;return s&&r.setAttribute("nonce",s),n.insertBefore(r,i),r},V=function(){function e(e){this.element=L(e),this.element.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,r=t.length;n<r;n++){var o=t[n];if(o.ownerNode===e)return o}throw v(17)}(this.element),this.length=0}return e.prototype.insertRule=function(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch(e){return!1}},e.prototype.deleteRule=function(e){this.sheet.deleteRule(e),this.length--},e.prototype.getRule=function(e){var t=this.sheet.cssRules[e];return t&&t.cssText?t.cssText:""},e}(),k=function(){function e(e){this.element=L(e),this.nodes=this.element.childNodes,this.length=0}return e.prototype.insertRule=function(e,t){if(e<=this.length&&e>=0){var n=document.createTextNode(t);return this.element.insertBefore(n,this.nodes[e]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},e.prototype.getRule=function(e){return e<this.length?this.nodes[e].textContent:""},e}(),M=function(){function e(e){this.rules=[],this.length=0}return e.prototype.insertRule=function(e,t){return e<=this.length&&(this.rules.splice(e,0,t),this.length++,!0)},e.prototype.deleteRule=function(e){this.rules.splice(e,1),this.length--},e.prototype.getRule=function(e){return e<this.length?this.rules[e]:""},e}(),$=E,q={isServer:!E,useCSSOMInjection:!A},F=function(){function e(e,t,r){void 0===e&&(e=f),void 0===t&&(t={});var o=this;this.options=n.__assign(n.__assign({},q),e),this.gs=t,this.names=new Map(r),this.server=!!e.isServer,!this.server&&E&&$&&($=!1,B(this)),m(this,function(){return function(e){for(var t=e.getTag(),n=t.length,r="",o=function(n){var o=function(e){return T.get(e)}(n);if(void 0===o)return"continue";var i=e.names.get(o),s=t.getGroup(n);if(void 0===i||!i.size||0===s.length)return"continue";var a="".concat(g,".g").concat(n,'[id="').concat(o,'"]'),c="";void 0!==i&&i.forEach(function(e){e.length>0&&(c+="".concat(e,","))}),r+="".concat(s).concat(a,'{content:"').concat(c,'"}').concat(b)},i=0;i<n;i++)o(i);return r}(o)})}return e.registerId=function(e){return x(e)},e.prototype.rehydrate=function(){!this.server&&E&&B(this)},e.prototype.reconstructWithOptions=function(t,r){return void 0===r&&(r=!0),new e(n.__assign(n.__assign({},this.options),t),this.gs,r&&this.names||void 0)},e.prototype.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},e.prototype.getTag=function(){return this.tag||(this.tag=(e=function(e){var t=e.useCSSOMInjection,n=e.target;return e.isServer?new M(n):t?new V(n):new k(n)}(this.options),new P(e)));var e},e.prototype.hasNameForId=function(e,t){return this.names.has(e)&&this.names.get(e).has(t)},e.prototype.registerName=function(e,t){if(x(e),this.names.has(e))this.names.get(e).add(t);else{var n=new Set;n.add(t),this.names.set(e,n)}},e.prototype.insertRules=function(e,t,n){this.registerName(e,t),this.getTag().insertRules(x(e),n)},e.prototype.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},e.prototype.clearRules=function(e){this.getTag().clearGroup(x(e)),this.clearNames(e)},e.prototype.clearTag=function(){this.tag=void 0},e}(),Y=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},G=/&/g,W=/^\s*\/\/.*$/gm;function H(e,t){return e.map(function(e){return"rule"===e.type&&(e.value="".concat(t," ").concat(e.value),e.value=e.value.replaceAll(",",",".concat(t," ")),e.props=e.props.map(function(e){return"".concat(t," ").concat(e)})),Array.isArray(e.children)&&"@keyframes"!==e.type&&(e.children=H(e.children,t)),e})}var U=new F,K=function(e){var t,n,r,o=f.options,i=void 0===o?f:o,s=f.plugins,a=void 0===s?h:s,c=function(e,r,o){return o.startsWith(n)&&o.endsWith(n)&&o.replaceAll(n,"").length>0?".".concat(t):e},u=a.slice();u.push(function(e){e.type===l.RULESET&&e.value.includes("&")&&(e.props[0]=e.props[0].replace(G,n).replace(r,c))}),i.prefix&&u.push(l.prefixer),u.push(l.stringify);var p=function(e,o,s,a){void 0===o&&(o=""),void 0===s&&(s=""),void 0===a&&(a="&"),t=a,n=o,r=new RegExp("\\".concat(n,"\\b"),"g");var c=e.replace(W,""),p=l.compile(s||o?"".concat(s," ").concat(o," { ").concat(c," }"):c);i.namespace&&(p=H(p,i.namespace));var h=[];return l.serialize(p,l.middleware(u.concat(l.rulesheet(function(e){return h.push(e)})))),h};return p.hash=a.length?a.reduce(function(e,t){return t.name||v(15),Y(e,t.name)},5381).toString():"",p}(),Z=(u.default.createContext({shouldForwardProp:void 0,styleSheet:U,stylis:K}),u.default.createContext(void 0),function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=K);var r=n.name+t.hash;e.hasNameForId(n.id,r)||e.insertRules(n.id,r,t(n.rules,r,"@keyframes"))},this.name=e,this.id="sc-keyframes-".concat(e),this.rules=t,m(this,function(){throw v(12,String(n.name))})}return e.prototype.getName=function(e){return void 0===e&&(e=K),this.name+e.hash},e}());function J(e){return"production"!==process.env.NODE_ENV&&"string"==typeof e&&e||e.displayName||e.name||"Component"}var Q=function(e){return e>="A"&&e<="Z"};function X(e){for(var t="",n=0;n<e.length;n++){var r=e[n];if(1===n&&"-"===r&&"-"===e[0])return e;Q(r)?t+="-"+r.toLowerCase():t+=r}return t.startsWith("ms-")?"-"+t:t}function ee(e){return"function"==typeof e}function te(e){return null!==e&&"object"==typeof e&&e.constructor.name===Object.name&&!("props"in e&&e.$$typeof)}function ne(e){return"object"==typeof e&&"styledComponentId"in e}var re=function(e){return null==e||!1===e||""===e},oe=function(e){var t,r,o=[];for(var i in e){var s=e[i];e.hasOwnProperty(i)&&!re(s)&&(Array.isArray(s)&&s.isCss||ee(s)?o.push("".concat(X(i),":"),s,";"):te(s)?o.push.apply(o,n.__spreadArray(n.__spreadArray(["".concat(i," {")],oe(s),!1),["}"],!1)):o.push("".concat(X(i),": ").concat((t=i,null==(r=s)||"boolean"==typeof r||""===r?"":"number"!=typeof r||0===r||t in p.default||t.startsWith("--")?String(r).trim():"".concat(r,"px")),";")))}return o};function ie(e,t,n,r){if(re(e))return[];if(ne(e))return[".".concat(e.styledComponentId)];if(ee(e)){if(!ee(i=e)||i.prototype&&i.prototype.isReactComponent||!t)return[e];var o=e(t);return"production"===process.env.NODE_ENV||"object"!=typeof o||Array.isArray(o)||o instanceof Z||te(o)||null===o||console.error("".concat(J(e)," is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.")),ie(o,t,n,r)}var i;return e instanceof Z?n?(e.inject(n,r),[e.getName(r)]):[e]:te(e)?oe(e):Array.isArray(e)?Array.prototype.concat.apply(h,e.map(function(e){return ie(e,t,n,r)})):[e.toString()]}function se(e,t){for(var n=[e[0]],r=0,o=t.length;r<o;r+=1)n.push(t[r],e[r+1]);return n}var ae=function(e){return Object.assign(e,{isCss:!0})};function ce(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(ee(e)||te(e))return ae(ie(se(h,n.__spreadArray([e],t,!0))));var o=e;return 0===t.length&&1===o.length&&"string"==typeof o[0]?ie(o):ae(ie(se(o,t)))}function ue(e,t,r){if(void 0===r&&(r=f),!t)throw v(1,t);var o=function(o){for(var i=[],s=1;s<arguments.length;s++)i[s-1]=arguments[s];return e(t,r,ce.apply(void 0,n.__spreadArray([o],i,!1)))};return o.attrs=function(o){return ue(e,t,n.__assign(n.__assign({},r),{attrs:Array.prototype.concat(r.attrs,o).filter(Boolean)}))},o.withConfig=function(o){return ue(e,t,n.__assign(n.__assign({},r),o))},o}var le,pe=u.default.createContext(void 0),he=pe.Consumer;function fe(e,t,n){return void 0===n&&(n=f),e.theme!==n.theme&&e.theme||t||n.theme}var de="function"==typeof Symbol&&Symbol.for,ye=de?Symbol.for("react.memo"):60115,ve=de?Symbol.for("react.forward_ref"):60112,me={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},ge={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Se={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},_e=((le={})[ve]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},le[ye]=Se,le);function we(e){return("type"in(t=e)&&t.type.$$typeof)===ye?Se:"$$typeof"in e?_e[e.$$typeof]:me;var t}var be=Object.defineProperty,Ee=Object.getOwnPropertyNames,Ae=Object.getOwnPropertySymbols,Pe=Object.getOwnPropertyDescriptor,Ce=Object.getPrototypeOf,Ne=Object.prototype;function Te(e,t,n){if("string"!=typeof t){if(Ne){var r=Ce(t);r&&r!==Ne&&Te(e,r,n)}var o=Ee(t);Ae&&(o=o.concat(Ae(t)));for(var i=we(e),s=we(t),a=0;a<o.length;++a){var c=o[a];if(!(c in ge||n&&n[c]||s&&c in s||i&&c in i)){var u=Pe(t,c);try{be(e,c,u)}catch(e){}}}}return e}var Oe=/(a)(d)/gi,xe=function(e){return String.fromCharCode(e+(e>25?39:97))};function De(e,t){if(0===e.length)return"";for(var n=e[0],r=1;r<e.length;r++)n+=t?t+e[r]:e[r];return n}var je=["fit-content","min-content","max-content"],Re={};function Ie(e,t,n){if(void 0===n&&(n=!1),!n&&!te(e)&&!Array.isArray(e))return t;if(Array.isArray(t))for(var r=0;r<t.length;r++)e[r]=Ie(e[r],t[r]);else if(te(t))for(var r in t)e[r]=Ie(e[r],t[r]);return e}var ze,Be,Le=require("react-native"),Ve=(ze=Le.StyleSheet,Be=function(){function e(e){this.rules=e}return e.prototype.generateStyleObject=function(e){var n=De(ie(this.rules,e)),r=function(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=xe(t%52)+n;return(xe(t%52)+n).replace(Oe,"$1-$2")}(Y(5381,n)>>>0);if(!Re[r]){var o=t.parse(n),i=[];o.each(function(e){if("decl"===e.type){if(je.includes(e.value))return void("production"!==process.env.NODE_ENV&&console.warn('[styled-components/native] The value "'.concat(e.value,'" for property "').concat(e.prop,'" is not supported in React Native and will be ignored.')));i.push([e.prop,e.value])}else"production"!==process.env.NODE_ENV&&"comment"!==e.type&&console.warn("Node of type ".concat(e.type," not supported as an inline style"))});var s=c.default(i,["borderWidth","borderColor"]),a=ze.create({generated:s});Re[r]=a.generated}return Re[r]},e}(),function(e,t,o){var i=ne(e),s=e,a=t.displayName,c=void 0===a?function(e){return function(e){return"string"==typeof e&&("production"===process.env.NODE_ENV||e.charAt(0)===e.charAt(0).toLowerCase())}(e)?"styled.".concat(e):"Styled(".concat(J(e),")")}(e):a,l=t.attrs,p=void 0===l?h:l,d=i&&s.attrs?s.attrs.concat(p).filter(Boolean):p,y=t.shouldForwardProp;if(i&&s.shouldForwardProp){var v=s.shouldForwardProp;if(t.shouldForwardProp){var m=t.shouldForwardProp;y=function(e,t){return v(e,t)&&m(e,t)}}else y=v}var g=function(e,t){return function(e,t,o){var i=e.attrs,s=e.inlineStyle,a=e.defaultProps,c=e.shouldForwardProp,l=e.target,p=u.default.useContext(pe),h=function(e,t,r){void 0===e&&(e=f);var o=n.__assign(n.__assign({},t),{theme:e}),i={};return r.forEach(function(e){var t,n=ee(e)?e(o):e;for(t in n)o[t]=i[t]=n[t]}),[o,i]}(fe(t,p,a)||f,t,i),d=h[1],y=s.generateStyleObject(h[0]),v=o,m=d.as||t.as||l,g=d!==t?n.__assign(n.__assign({},t),d):t,S={};for(var _ in g)"$"!==_[0]&&"as"!==_&&("forwardedAs"===_?S.as=g[_]:c&&!c(_,m)||(S[_]=g[_]));return S.style=r.useMemo(function(){return ee(t.style)?function(e){return[y].concat(t.style(e))}:t.style?[y].concat(t.style):y},[t.style,y]),o&&(S.ref=v),r.createElement(m,S)}(S,e,t)};g.displayName=c;var S=u.default.forwardRef(g);return S.attrs=d,S.inlineStyle=new Be(i?s.inlineStyle.rules.concat(o):o),S.displayName=c,S.shouldForwardProp=y,S.styledComponentId=!0,S.target=i?s.target:e,Object.defineProperty(S,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(e){this._foldedDefaultProps=i?function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=0,o=t;r<o.length;r++)Ie(e,o[r],!0);return e}({},s.defaultProps,e):e}}),Te(S,e,{attrs:!0,inlineStyle:!0,displayName:!0,shouldForwardProp:!0,target:!0}),S}),ke=function(e){return ue(Ve,e)};["ActivityIndicator","Button","DatePickerIOS","DrawerLayoutAndroid","FlatList","Image","ImageBackground","KeyboardAvoidingView","Modal","Pressable","ProgressBarAndroid","ProgressViewIOS","RefreshControl","SafeAreaView","ScrollView","SectionList","Slider","Switch","Text","TextInput","TouchableHighlight","TouchableOpacity","View","VirtualizedList"].forEach(function(e){return Object.defineProperty(ke,e,{enumerable:!0,configurable:!1,get:function(){if(e in Le&&Le[e])return ke(Le[e]);throw new Error("".concat(e," is not available in the currently-installed version of react-native"))}})}),exports.ThemeConsumer=he,exports.ThemeContext=pe,exports.ThemeProvider=function(e){var t=u.default.useContext(pe),o=r.useMemo(function(){return function(e,t){if(!e)throw v(14);if(ee(e)){var r=e(t);if("production"!==process.env.NODE_ENV&&(null===r||Array.isArray(r)||"object"!=typeof r))throw v(7);return r}if(Array.isArray(e)||"object"!=typeof e)throw v(8);return t?n.__assign(n.__assign({},t),e):e}(e.theme,t)},[e.theme,t]);return e.children?u.default.createElement(pe.Provider,{value:o},e.children):null},exports.css=ce,exports.default=ke,exports.isStyledComponent=ne,exports.styled=ke,exports.toStyleSheet=function(e){var n=De(ie(e)),r=t.parse(n),o=[];r.each(function(e){"decl"===e.type?o.push([e.prop,e.value]):"production"!==process.env.NODE_ENV&&"comment"!==e.type&&console.warn("Node of type ".concat(e.type," not supported as an inline style"))});var i=c.default(o,["borderWidth","borderColor"]);return Le.StyleSheet.create({style:i}).style},exports.useTheme=function(){var e=r.useContext(pe);if(!e)throw v(18);return e},exports.withTheme=function(e){var t=u.default.forwardRef(function(t,r){var o=fe(t,u.default.useContext(pe),e.defaultProps);return"production"!==process.env.NODE_ENV&&void 0===o&&console.warn('[withTheme] You are not using a ThemeProvider nor passing a theme prop or a theme in defaultProps in component class "'.concat(J(e),'"')),u.default.createElement(e,n.__assign({},t,{theme:o,ref:r}))});return t.displayName="WithTheme(".concat(J(e),")"),Te(t,e)};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("css-to-react-native"),t=require("postcss"),n=require("tslib"),r=require("react");require("shallowequal");var o=require("stylis"),s=require("@emotion/unitless");function i(e){return e&&e.__esModule?e:{default:e}}function a(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}var c=/*#__PURE__*/i(e),u=/*#__PURE__*/i(r),l=/*#__PURE__*/a(o),p=/*#__PURE__*/i(s),h=Object.freeze([]),f=Object.freeze({}),d="production"!==process.env.NODE_ENV?{1:"Cannot create styled-component for component: %s.\n\n",2:"Can't collect styles once you've consumed a `ServerStyleSheet`'s styles! `ServerStyleSheet` is a one off instance for each server-side render cycle.\n\n- Are you trying to reuse it across renders?\n- Are you accidentally calling collectStyles twice?\n\n",3:"Streaming SSR is only supported in a Node.js environment; Please do not try to call this method in the browser.\n\n",4:"The `StyleSheetManager` expects a valid target or sheet prop!\n\n- Does this error occur on the client and is your target falsy?\n- Does this error occur on the server and is the sheet falsy?\n\n",5:"The clone method cannot be used on the client!\n\n- Are you running in a client-like environment on the server?\n- Are you trying to run SSR on the client?\n\n",6:"Trying to insert a new style tag, but the given Node is unmounted!\n\n- Are you using a custom target that isn't mounted?\n- Does your document not have a valid head element?\n- Have you accidentally removed a style tag manually?\n\n",7:'ThemeProvider: Please return an object from your "theme" prop function, e.g.\n\n```js\ntheme={() => ({})}\n```\n\n',8:'ThemeProvider: Please make your "theme" prop an object.\n\n',9:"Missing document `<head>`\n\n",10:"Cannot find a StyleSheet instance. Usually this happens if there are multiple copies of styled-components loaded at once. Check out this issue for how to troubleshoot and fix the common cases where this situation can happen: https://github.com/styled-components/styled-components/issues/1941#issuecomment-417862021\n\n",11:"_This error was replaced with a dev-time warning, it will be deleted for v4 final._ [createGlobalStyle] received children which will not be rendered. Please use the component without passing children elements.\n\n",12:"It seems you are interpolating a keyframe declaration (%s) into an untagged string. This was supported in styled-components v3, but is not longer supported in v4 as keyframes are now injected on-demand. Please wrap your string in the css\\`\\` helper which ensures the styles are injected correctly. See https://www.styled-components.com/docs/api#css\n\n",13:"%s is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.\n\n",14:'ThemeProvider: "theme" prop is required.\n\n',15:"A stylis plugin has been supplied that is not named. We need a name for each plugin to be able to prevent styling collisions between different stylis configurations within the same app. Before you pass your plugin to `<StyleSheetManager stylisPlugins={[]}>`, please make sure each plugin is uniquely-named, e.g.\n\n```js\nObject.defineProperty(importedPlugin, 'name', { value: 'some-unique-name' });\n```\n\n",16:"Reached the limit of how many styled components may be created at group %s.\nYou may only create up to 1,073,741,824 components. If you're creating components dynamically,\nas for instance in your render method then you may be running into this limitation.\n\n",17:"CSSStyleSheet could not be found on HTMLStyleElement.\nHas styled-components' style tag been unmounted or altered by another script?\n",18:"ThemeProvider: Please make sure your useTheme hook is within a `<ThemeProvider>`"}:{};function y(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=e[0],r=[],o=1,s=e.length;o<s;o+=1)r.push(e[o]);return r.forEach(function(e){n=n.replace(/%[a-z]/,e)}),n}function v(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return"production"===process.env.NODE_ENV?new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(e," for more information.").concat(t.length>0?" Args: ".concat(t.join(", ")):"")):new Error(y.apply(void 0,n.__spreadArray([d[e]],t,!1)).trim())}function m(e,t){Object.defineProperty(e,"toString",{value:t})}var g="undefined"!=typeof process&&void 0!==process.env&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",S="active",_="data-styled-version",w="6.2.0",b="/*!sc*/\n",E="undefined"!=typeof window&&"undefined"!=typeof document,A=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env&&void 0!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==process.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&process.env.REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env&&void 0!==process.env.SC_DISABLE_SPEEDY&&""!==process.env.SC_DISABLE_SPEEDY?"false"!==process.env.SC_DISABLE_SPEEDY&&process.env.SC_DISABLE_SPEEDY:"production"!==process.env.NODE_ENV),P=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}return e.prototype.indexOfGroup=function(e){for(var t=0,n=0;n<e;n++)t+=this.groupSizes[n];return t},e.prototype.insertRules=function(e,t){if(e>=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,o=r;e>=o;)if((o<<=1)<0)throw v(16,"".concat(e));this.groupSizes=new Uint32Array(o),this.groupSizes.set(n),this.length=o;for(var s=r;s<o;s++)this.groupSizes[s]=0}for(var i=this.indexOfGroup(e+1),a=(s=0,t.length);s<a;s++)this.tag.insertRule(i,t[s])&&(this.groupSizes[e]++,i++)},e.prototype.clearGroup=function(e){if(e<this.length){var t=this.groupSizes[e],n=this.indexOfGroup(e),r=n+t;this.groupSizes[e]=0;for(var o=n;o<r;o++)this.tag.deleteRule(n)}},e.prototype.getGroup=function(e){var t="";if(e>=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),o=r+n,s=r;s<o;s++)t+="".concat(this.tag.getRule(s)).concat(b);return t},e}(),C=1<<30,N=new Map,T=new Map,O=1,x=function(e){if(N.has(e))return N.get(e);for(;T.has(O);)O++;var t=O++;if("production"!==process.env.NODE_ENV&&((0|t)<0||t>C))throw v(16,"".concat(t));return N.set(e,t),T.set(t,e),t},D=function(e,t){O=t+1,N.set(e,t),T.set(t,e)},j="style[".concat(g,"][").concat(_,'="').concat(w,'"]'),R=new RegExp("^".concat(g,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),I=function(e,t,n){for(var r,o=n.split(","),s=0,i=o.length;s<i;s++)(r=o[s])&&e.registerName(t,r)},z=function(e,t){for(var n,r=(null!==(n=t.textContent)&&void 0!==n?n:"").split(b),o=[],s=0,i=r.length;s<i;s++){var a=r[s].trim();if(a){var c=a.match(R);if(c){var u=0|parseInt(c[1],10),l=c[2];0!==u&&(D(l,u),I(e,l,c[3]),e.getTag().insertRules(u,o)),o.length=0}else o.push(a)}}},B=function(e){for(var t=document.querySelectorAll(j),n=0,r=t.length;n<r;n++){var o=t[n];o&&o.getAttribute(g)!==S&&(z(e,o),o.parentNode&&o.parentNode.removeChild(o))}},L=function(e){var t=document.head,n=e||t,r=document.createElement("style"),o=function(e){var t=Array.from(e.querySelectorAll("style[".concat(g,"]")));return t[t.length-1]}(n),s=void 0!==o?o.nextSibling:null;r.setAttribute(g,S),r.setAttribute(_,w);var i="undefined"!=typeof __webpack_nonce__?__webpack_nonce__:null;return i&&r.setAttribute("nonce",i),n.insertBefore(r,s),r},V=function(){function e(e){this.element=L(e),this.element.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,r=t.length;n<r;n++){var o=t[n];if(o.ownerNode===e)return o}throw v(17)}(this.element),this.length=0}return e.prototype.insertRule=function(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch(e){return!1}},e.prototype.deleteRule=function(e){this.sheet.deleteRule(e),this.length--},e.prototype.getRule=function(e){var t=this.sheet.cssRules[e];return t&&t.cssText?t.cssText:""},e}(),k=function(){function e(e){this.element=L(e),this.nodes=this.element.childNodes,this.length=0}return e.prototype.insertRule=function(e,t){if(e<=this.length&&e>=0){var n=document.createTextNode(t);return this.element.insertBefore(n,this.nodes[e]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},e.prototype.getRule=function(e){return e<this.length?this.nodes[e].textContent:""},e}(),M=function(){function e(e){this.rules=[],this.length=0}return e.prototype.insertRule=function(e,t){return e<=this.length&&(this.rules.splice(e,0,t),this.length++,!0)},e.prototype.deleteRule=function(e){this.rules.splice(e,1),this.length--},e.prototype.getRule=function(e){return e<this.length?this.rules[e]:""},e}(),$=E,q={isServer:!E,useCSSOMInjection:!A},F=function(){function e(e,t,r){void 0===e&&(e=f),void 0===t&&(t={});var o=this;this.options=n.__assign(n.__assign({},q),e),this.gs=t,this.names=new Map(r),this.server=!!e.isServer,!this.server&&E&&$&&($=!1,B(this)),m(this,function(){return function(e){for(var t=e.getTag(),n=t.length,r="",o=function(n){var o=function(e){return T.get(e)}(n);if(void 0===o)return"continue";var s=e.names.get(o),i=t.getGroup(n);if(void 0===s||!s.size||0===i.length)return"continue";var a="".concat(g,".g").concat(n,'[id="').concat(o,'"]'),c="";void 0!==s&&s.forEach(function(e){e.length>0&&(c+="".concat(e,","))}),r+="".concat(i).concat(a,'{content:"').concat(c,'"}').concat(b)},s=0;s<n;s++)o(s);return r}(o)})}return e.registerId=function(e){return x(e)},e.prototype.rehydrate=function(){!this.server&&E&&B(this)},e.prototype.reconstructWithOptions=function(t,r){return void 0===r&&(r=!0),new e(n.__assign(n.__assign({},this.options),t),this.gs,r&&this.names||void 0)},e.prototype.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},e.prototype.getTag=function(){return this.tag||(this.tag=(e=function(e){var t=e.useCSSOMInjection,n=e.target;return e.isServer?new M(n):t?new V(n):new k(n)}(this.options),new P(e)));var e},e.prototype.hasNameForId=function(e,t){return this.names.has(e)&&this.names.get(e).has(t)},e.prototype.registerName=function(e,t){if(x(e),this.names.has(e))this.names.get(e).add(t);else{var n=new Set;n.add(t),this.names.set(e,n)}},e.prototype.insertRules=function(e,t,n){this.registerName(e,t),this.getTag().insertRules(x(e),n)},e.prototype.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},e.prototype.clearRules=function(e){this.getTag().clearGroup(x(e)),this.clearNames(e)},e.prototype.clearTag=function(){this.tag=void 0},e}(),Y=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},G=/&/g,W=/^\s*\/\/.*$/gm;function H(e,t){return e.map(function(e){return"rule"===e.type&&(e.value="".concat(t," ").concat(e.value),e.value=e.value.replaceAll(",",",".concat(t," ")),e.props=e.props.map(function(e){return"".concat(t," ").concat(e)})),Array.isArray(e.children)&&"@keyframes"!==e.type&&(e.children=H(e.children,t)),e})}var U=new F,K=function(e){var t,n,r,o=f.options,s=void 0===o?f:o,i=f.plugins,a=void 0===i?h:i,c=function(e,r,o){return o.startsWith(n)&&o.endsWith(n)&&o.replaceAll(n,"").length>0?".".concat(t):e},u=a.slice();u.push(function(e){e.type===l.RULESET&&e.value.includes("&")&&(e.props[0]=e.props[0].replace(G,n).replace(r,c))}),s.prefix&&u.push(l.prefixer),u.push(l.stringify);var p=function(e,o,i,a){void 0===o&&(o=""),void 0===i&&(i=""),void 0===a&&(a="&"),t=a,n=o,r=new RegExp("\\".concat(n,"\\b"),"g");var c=e.replace(W,""),p=l.compile(i||o?"".concat(i," ").concat(o," { ").concat(c," }"):c);s.namespace&&(p=H(p,s.namespace));var h=[];return l.serialize(p,l.middleware(u.concat(l.rulesheet(function(e){return h.push(e)})))),h};return p.hash=a.length?a.reduce(function(e,t){return t.name||v(15),Y(e,t.name)},5381).toString():"",p}(),Z=(u.default.createContext({shouldForwardProp:void 0,styleSheet:U,stylis:K}),u.default.createContext(void 0),function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=K);var r=n.name+t.hash;e.hasNameForId(n.id,r)||e.insertRules(n.id,r,t(n.rules,r,"@keyframes"))},this.name=e,this.id="sc-keyframes-".concat(e),this.rules=t,m(this,function(){throw v(12,String(n.name))})}return e.prototype.getName=function(e){return void 0===e&&(e=K),this.name+e.hash},e}());function J(e){return"production"!==process.env.NODE_ENV&&"string"==typeof e&&e||e.displayName||e.name||"Component"}var Q=function(e){return e>="A"&&e<="Z"};function X(e){for(var t="",n=0;n<e.length;n++){var r=e[n];if(1===n&&"-"===r&&"-"===e[0])return e;Q(r)?t+="-"+r.toLowerCase():t+=r}return t.startsWith("ms-")?"-"+t:t}function ee(e){return"function"==typeof e}function te(e){return null!==e&&"object"==typeof e&&e.constructor.name===Object.name&&!("props"in e&&e.$$typeof)}function ne(e){return"object"==typeof e&&"styledComponentId"in e}var re=function(e){return null==e||!1===e||""===e},oe=function(e){var t,r,o=[];for(var s in e){var i=e[s];e.hasOwnProperty(s)&&!re(i)&&(Array.isArray(i)&&i.isCss||ee(i)?o.push("".concat(X(s),":"),i,";"):te(i)?o.push.apply(o,n.__spreadArray(n.__spreadArray(["".concat(s," {")],oe(i),!1),["}"],!1)):o.push("".concat(X(s),": ").concat((t=s,null==(r=i)||"boolean"==typeof r||""===r?"":"number"!=typeof r||0===r||t in p.default||t.startsWith("--")?String(r).trim():"".concat(r,"px")),";")))}return o};function se(e,t,n,r){if(re(e))return[];if(ne(e))return[".".concat(e.styledComponentId)];if(ee(e)){if(!ee(s=e)||s.prototype&&s.prototype.isReactComponent||!t)return[e];var o=e(t);return"production"===process.env.NODE_ENV||"object"!=typeof o||Array.isArray(o)||o instanceof Z||te(o)||null===o||console.error("".concat(J(e)," is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.")),se(o,t,n,r)}var s;return e instanceof Z?n?(e.inject(n,r),[e.getName(r)]):[e]:te(e)?oe(e):Array.isArray(e)?Array.prototype.concat.apply(h,e.map(function(e){return se(e,t,n,r)})):[e.toString()]}function ie(e,t){for(var n=[e[0]],r=0,o=t.length;r<o;r+=1)n.push(t[r],e[r+1]);return n}var ae=function(e){return Object.assign(e,{isCss:!0})};function ce(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(ee(e)||te(e))return ae(se(ie(h,n.__spreadArray([e],t,!0))));var o=e;return 0===t.length&&1===o.length&&"string"==typeof o[0]?se(o):ae(se(ie(o,t)))}function ue(e,t,r){if(void 0===r&&(r=f),!t)throw v(1,t);var o=function(o){for(var s=[],i=1;i<arguments.length;i++)s[i-1]=arguments[i];return e(t,r,ce.apply(void 0,n.__spreadArray([o],s,!1)))};return o.attrs=function(o){return ue(e,t,n.__assign(n.__assign({},r),{attrs:Array.prototype.concat(r.attrs,o).filter(Boolean)}))},o.withConfig=function(o){return ue(e,t,n.__assign(n.__assign({},r),o))},o}var le,pe=u.default.createContext(void 0),he=pe.Consumer;function fe(e,t,n){return void 0===n&&(n=f),e.theme!==n.theme&&e.theme||t||n.theme}var de="function"==typeof Symbol&&Symbol.for,ye=de?Symbol.for("react.memo"):60115,ve=de?Symbol.for("react.forward_ref"):60112,me={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},ge={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Se={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},_e=((le={})[ve]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},le[ye]=Se,le);function we(e){return("type"in(t=e)&&t.type.$$typeof)===ye?Se:"$$typeof"in e?_e[e.$$typeof]:me;var t}var be=Object.defineProperty,Ee=Object.getOwnPropertyNames,Ae=Object.getOwnPropertySymbols,Pe=Object.getOwnPropertyDescriptor,Ce=Object.getPrototypeOf,Ne=Object.prototype;function Te(e,t,n){if("string"!=typeof t){if(Ne){var r=Ce(t);r&&r!==Ne&&Te(e,r,n)}var o=Ee(t);Ae&&(o=o.concat(Ae(t)));for(var s=we(e),i=we(t),a=0;a<o.length;++a){var c=o[a];if(!(c in ge||n&&n[c]||i&&c in i||s&&c in s)){var u=Pe(t,c);try{be(e,c,u)}catch(e){}}}}return e}var Oe=/(a)(d)/gi,xe=function(e){return String.fromCharCode(e+(e>25?39:97))};function De(e,t){if(0===e.length)return"";for(var n=e[0],r=1;r<e.length;r++)n+=t?t+e[r]:e[r];return n}var je=["fit-content","min-content","max-content"],Re={};function Ie(e,t,n){if(void 0===n&&(n=!1),!n&&!te(e)&&!Array.isArray(e))return t;if(Array.isArray(t))for(var r=0;r<t.length;r++)e[r]=Ie(e[r],t[r]);else if(te(t))for(var r in t)e[r]=Ie(e[r],t[r]);return e}var ze,Be,Le=require("react-native"),Ve=(ze=Le.StyleSheet,Be=function(){function e(e){this.rules=e}return e.prototype.generateStyleObject=function(e){var n=De(se(this.rules,e)),r=function(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=xe(t%52)+n;return(xe(t%52)+n).replace(Oe,"$1-$2")}(Y(5381,n)>>>0);if(!Re[r]){var o=t.parse(n),s=[];o.each(function(e){if("decl"===e.type){if(je.includes(e.value))return void("production"!==process.env.NODE_ENV&&console.warn('[styled-components/native] The value "'.concat(e.value,'" for property "').concat(e.prop,'" is not supported in React Native and will be ignored.')));s.push([e.prop,e.value])}else"production"!==process.env.NODE_ENV&&"comment"!==e.type&&console.warn("Node of type ".concat(e.type," not supported as an inline style"))});var i=c.default(s,["borderWidth","borderColor"]),a=ze.create({generated:i});Re[r]=a.generated}return Re[r]},e}(),function(e,t,o){var s=ne(e),i=e,a=t.displayName,c=void 0===a?function(e){return function(e){return"string"==typeof e&&("production"===process.env.NODE_ENV||e.charAt(0)===e.charAt(0).toLowerCase())}(e)?"styled.".concat(e):"Styled(".concat(J(e),")")}(e):a,l=t.attrs,p=void 0===l?h:l,d=s&&i.attrs?i.attrs.concat(p).filter(Boolean):p,y=t.shouldForwardProp;if(s&&i.shouldForwardProp){var v=i.shouldForwardProp;if(t.shouldForwardProp){var m=t.shouldForwardProp;y=function(e,t){return v(e,t)&&m(e,t)}}else y=v}var g=function(e,t){return function(e,t,o){var s=e.attrs,i=e.inlineStyle,a=e.defaultProps,c=e.shouldForwardProp,l=e.target,p=u.default.useContext(pe),h=function(e,t,r){void 0===e&&(e=f);var o=n.__assign(n.__assign({},t),{theme:e}),s={};return r.forEach(function(e){var t,n=ee(e)?e(o):e;for(t in n)o[t]=s[t]=n[t]}),[o,s]}(fe(t,p,a)||f,t,s),d=h[1],y=i.generateStyleObject(h[0]),v=o,m=d.as||t.as||l,g=d!==t?n.__assign(n.__assign({},t),d):t,S={};for(var _ in g)"$"!==_[0]&&"as"!==_&&("forwardedAs"===_?S.as=g[_]:c&&!c(_,m)||(S[_]=g[_]));return S.style=r.useMemo(function(){return ee(t.style)?function(e){return[y].concat(t.style(e))}:t.style?[y].concat(t.style):y},[t.style,y]),o&&(S.ref=v),r.createElement(m,S)}(S,e,t)};g.displayName=c;var S=u.default.forwardRef(g);return S.attrs=d,S.inlineStyle=new Be(s?i.inlineStyle.rules.concat(o):o),S.displayName=c,S.shouldForwardProp=y,S.styledComponentId=!0,S.target=s?i.target:e,Object.defineProperty(S,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(e){this._foldedDefaultProps=s?function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=0,o=t;r<o.length;r++)Ie(e,o[r],!0);return e}({},i.defaultProps,e):e}}),Te(S,e,{attrs:!0,inlineStyle:!0,displayName:!0,shouldForwardProp:!0,target:!0}),S}),ke=function(e){return ue(Ve,e)};["ActivityIndicator","Button","DatePickerIOS","DrawerLayoutAndroid","FlatList","Image","ImageBackground","KeyboardAvoidingView","Modal","Pressable","ProgressBarAndroid","ProgressViewIOS","RefreshControl","SafeAreaView","ScrollView","SectionList","Slider","Switch","Text","TextInput","TouchableHighlight","TouchableOpacity","View","VirtualizedList"].forEach(function(e){return Object.defineProperty(ke,e,{enumerable:!0,configurable:!1,get:function(){if(e in Le&&Le[e])return ke(Le[e]);throw new Error("".concat(e," is not available in the currently-installed version of react-native"))}})}),exports.ThemeConsumer=he,exports.ThemeContext=pe,exports.ThemeProvider=function(e){var t=u.default.useContext(pe),o=r.useMemo(function(){return function(e,t){if(!e)throw v(14);if(ee(e)){var r=e(t);if("production"!==process.env.NODE_ENV&&(null===r||Array.isArray(r)||"object"!=typeof r))throw v(7);return r}if(Array.isArray(e)||"object"!=typeof e)throw v(8);return t?n.__assign(n.__assign({},t),e):e}(e.theme,t)},[e.theme,t]);return e.children?u.default.createElement(pe.Provider,{value:o},e.children):null},exports.css=ce,exports.default=ke,exports.isStyledComponent=ne,exports.styled=ke,exports.toStyleSheet=function(e){var n=De(se(e)),r=t.parse(n),o=[];r.each(function(e){"decl"===e.type?o.push([e.prop,e.value]):"production"!==process.env.NODE_ENV&&"comment"!==e.type&&console.warn("Node of type ".concat(e.type," not supported as an inline style"))});var s=c.default(o,["borderWidth","borderColor"]);return Le.StyleSheet.create({style:s}).style},exports.useTheme=function(){var e=r.useContext(pe);if(!e)throw v(18);return e},exports.withTheme=function(e){var t=u.default.forwardRef(function(t,r){var o=fe(t,u.default.useContext(pe),e.defaultProps);return"production"!==process.env.NODE_ENV&&void 0===o&&console.warn('[withTheme] You are not using a ThemeProvider nor passing a theme prop or a theme in defaultProps in component class "'.concat(J(e),'"')),u.default.createElement(e,n.__assign(n.__assign({},t),{theme:o,ref:r}))});return t.displayName="WithTheme(".concat(J(e),")"),Te(t,e)};
|
|
2
2
|
//# sourceMappingURL=styled-components.native.cjs.js.map
|