styled-components 6.3.0 → 6.3.2
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 +12 -0
- package/dist/constants.d.ts +13 -0
- package/dist/constructors/constructWithOptions.d.ts +17 -0
- package/dist/constructors/createGlobalStyle.d.ts +3 -0
- package/dist/constructors/css.d.ts +4 -0
- package/dist/constructors/keyframes.d.ts +3 -0
- package/dist/constructors/styled.d.ts +17 -0
- package/dist/hoc/withTheme.d.ts +4 -0
- package/dist/index-standalone.d.ts +2 -0
- package/dist/index.d.ts +4 -0
- package/dist/models/ComponentStyle.d.ts +18 -0
- package/dist/models/GlobalStyle.d.ts +11 -0
- package/dist/models/InlineStyle.d.ts +7 -0
- package/dist/models/Keyframes.d.ts +10 -0
- package/dist/models/ServerStyleSheet.d.ts +15 -0
- package/dist/models/StyleSheetManager.d.ts +65 -0
- package/dist/models/StyledComponent.d.ts +3 -0
- package/dist/models/StyledNativeComponent.d.ts +3 -0
- package/dist/models/ThemeProvider.d.ts +47 -0
- package/dist/native/index.d.ts +19 -0
- package/dist/secretInternals.d.ts +5 -0
- package/dist/sheet/GroupIDAllocator.d.ts +4 -0
- package/dist/sheet/GroupedTag.d.ts +11 -0
- package/dist/sheet/Rehydration.d.ts +3 -0
- package/dist/sheet/Sheet.d.ts +40 -0
- package/dist/sheet/Tag.d.ts +55 -0
- package/dist/sheet/dom.d.ts +5 -0
- package/dist/sheet/index.d.ts +1 -0
- package/dist/sheet/types.d.ts +36 -0
- 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 +1 -1
- 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/types.d.ts +212 -0
- package/dist/utils/addUnitIfNeeded.d.ts +1 -0
- package/dist/utils/checkDynamicCreation.d.ts +1 -0
- package/dist/utils/createWarnTooManyClasses.d.ts +3 -0
- package/dist/utils/determineTheme.d.ts +4 -0
- package/dist/utils/domElements.d.ts +4 -0
- package/dist/utils/empties.d.ts +3 -0
- package/dist/utils/error.d.ts +5 -0
- package/dist/utils/errors.d.ts +21 -0
- package/dist/utils/escape.d.ts +5 -0
- package/dist/utils/flatten.d.ts +4 -0
- package/dist/utils/generateAlphabeticName.d.ts +1 -0
- package/dist/utils/generateComponentId.d.ts +1 -0
- package/dist/utils/generateDisplayName.d.ts +2 -0
- package/dist/utils/getComponentName.d.ts +2 -0
- package/dist/utils/hash.d.ts +3 -0
- package/dist/utils/hoist.d.ts +51 -0
- package/dist/utils/hyphenateStyleName.d.ts +14 -0
- package/dist/utils/interleave.d.ts +2 -0
- package/dist/utils/isFunction.d.ts +1 -0
- package/dist/utils/isPlainObject.d.ts +1 -0
- package/dist/utils/isStatelessFunction.d.ts +1 -0
- package/dist/utils/isStaticRules.d.ts +2 -0
- package/dist/utils/isStyledComponent.d.ts +2 -0
- package/dist/utils/isTag.d.ts +2 -0
- package/dist/utils/joinStrings.d.ts +5 -0
- package/dist/utils/mixinDeep.d.ts +6 -0
- package/dist/utils/nonce.d.ts +1 -0
- package/dist/utils/setToString.d.ts +17 -0
- package/dist/utils/stylis.d.ts +10 -0
- package/native/dist/dist/utils/domElements.d.ts +1 -1
- package/native/dist/styled-components.native.cjs.js +1 -1
- package/native/dist/styled-components.native.esm.js +1 -1
- package/package.json +3 -2
- package/native/dist/dist/test/globals.d.ts +0 -2
- package/native/dist/dist/test/utils.d.ts +0 -163
- package/native/dist/dist/test/veryLargeUnionType.d.ts +0 -1
- package/native/dist/test/globals.d.ts +0 -2
- package/native/dist/test/utils.d.ts +0 -163
- package/native/dist/test/veryLargeUnionType.d.ts +0 -1
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import type * as CSS from 'csstype';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import ComponentStyle from './models/ComponentStyle';
|
|
4
|
+
import { DefaultTheme } from './models/ThemeProvider';
|
|
5
|
+
import createWarnTooManyClasses from './utils/createWarnTooManyClasses';
|
|
6
|
+
import type { SupportedHTMLElements } from './utils/domElements';
|
|
7
|
+
export { CSS, DefaultTheme, SupportedHTMLElements };
|
|
8
|
+
export interface ExoticComponentWithDisplayName<P extends BaseObject = {}> extends React.ExoticComponent<P> {
|
|
9
|
+
defaultProps?: Partial<P> | undefined;
|
|
10
|
+
displayName?: string | undefined;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Use this type to disambiguate between a styled-component instance
|
|
14
|
+
* and a StyleFunction or any other type of function.
|
|
15
|
+
*/
|
|
16
|
+
export type StyledComponentBrand = {
|
|
17
|
+
readonly _sc: symbol;
|
|
18
|
+
};
|
|
19
|
+
export type BaseObject = {};
|
|
20
|
+
export type OmitNever<T> = {
|
|
21
|
+
[K in keyof T as T[K] extends never ? never : K]: T[K];
|
|
22
|
+
};
|
|
23
|
+
export type FastOmit<T extends BaseObject, U extends string | number | symbol> = {
|
|
24
|
+
[K in keyof T as K extends U ? never : K]: T[K];
|
|
25
|
+
};
|
|
26
|
+
export type Runtime = 'web' | 'native';
|
|
27
|
+
export type AnyComponent<P extends BaseObject = any> = ExoticComponentWithDisplayName<P> | React.ComponentType<P>;
|
|
28
|
+
export type KnownTarget = SupportedHTMLElements | AnyComponent;
|
|
29
|
+
export type WebTarget = string | KnownTarget;
|
|
30
|
+
export type NativeTarget = AnyComponent;
|
|
31
|
+
export type StyledTarget<R extends Runtime> = R extends 'web' ? WebTarget : NativeTarget;
|
|
32
|
+
export interface StyledOptions<R extends Runtime, Props extends BaseObject> {
|
|
33
|
+
attrs?: Attrs<Props>[] | undefined;
|
|
34
|
+
componentId?: (R extends 'web' ? string : never) | undefined;
|
|
35
|
+
displayName?: string | undefined;
|
|
36
|
+
parentComponentId?: (R extends 'web' ? string : never) | undefined;
|
|
37
|
+
shouldForwardProp?: ShouldForwardProp<R> | undefined;
|
|
38
|
+
}
|
|
39
|
+
export type Dict<T = any> = {
|
|
40
|
+
[key: string]: T;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* This type is intended for when data attributes are composed via
|
|
44
|
+
* the `.attrs` API:
|
|
45
|
+
*
|
|
46
|
+
* ```tsx
|
|
47
|
+
* styled.div.attrs<DataAttributes>({ 'data-testid': 'foo' })``
|
|
48
|
+
* ```
|
|
49
|
+
*
|
|
50
|
+
* Would love to figure out how to support this natively without having to
|
|
51
|
+
* manually compose the type, but haven't figured out a way to do so yet that
|
|
52
|
+
* doesn't cause specificity loss (see `test/types.tsx` if you attempt to embed
|
|
53
|
+
* `DataAttributes` directly in the `Attrs<>` type.)
|
|
54
|
+
*/
|
|
55
|
+
export type DataAttributes = {
|
|
56
|
+
[key: `data-${string}`]: any;
|
|
57
|
+
};
|
|
58
|
+
export type ExecutionProps = {
|
|
59
|
+
/**
|
|
60
|
+
* Dynamically adjust the rendered component or HTML tag, e.g.
|
|
61
|
+
* ```
|
|
62
|
+
* const StyledButton = styled.button``
|
|
63
|
+
*
|
|
64
|
+
* <StyledButton as="a" href="/foo">
|
|
65
|
+
* I'm an anchor now
|
|
66
|
+
* </StyledButton>
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
as?: KnownTarget | undefined;
|
|
70
|
+
forwardedAs?: KnownTarget | undefined;
|
|
71
|
+
theme?: DefaultTheme | undefined;
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* ExecutionProps but with `theme` required.
|
|
75
|
+
*/
|
|
76
|
+
export interface ExecutionContext extends ExecutionProps {
|
|
77
|
+
theme: DefaultTheme;
|
|
78
|
+
}
|
|
79
|
+
export interface StyleFunction<Props extends BaseObject> {
|
|
80
|
+
(executionContext: ExecutionContext & Props): Interpolation<Props>;
|
|
81
|
+
}
|
|
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<OverrideStyle<Props>>) | ((props: ExecutionContext & Props) => ExecutionProps & Partial<OverrideStyle<Props>>);
|
|
84
|
+
export type RuleSet<Props extends BaseObject = BaseObject> = Interpolation<Props>[];
|
|
85
|
+
export type Styles<Props extends BaseObject> = TemplateStringsArray | StyledObject<Props> | StyleFunction<Props>;
|
|
86
|
+
export type NameGenerator = (hash: number) => string;
|
|
87
|
+
export interface StyleSheet {
|
|
88
|
+
create: Function;
|
|
89
|
+
}
|
|
90
|
+
export interface Keyframes {
|
|
91
|
+
id: string;
|
|
92
|
+
name: string;
|
|
93
|
+
rules: string;
|
|
94
|
+
}
|
|
95
|
+
export interface Flattener<Props extends BaseObject> {
|
|
96
|
+
(chunks: Interpolation<Props>[], executionContext: object | null | undefined, styleSheet: StyleSheet | null | undefined): Interpolation<Props>[];
|
|
97
|
+
}
|
|
98
|
+
export interface Stringifier {
|
|
99
|
+
(css: string, selector?: string | undefined, prefix?: string | undefined, componentId?: string | undefined): string[];
|
|
100
|
+
hash: string;
|
|
101
|
+
}
|
|
102
|
+
export interface ShouldForwardProp<R extends Runtime> {
|
|
103
|
+
(prop: string, elementToBeCreated: StyledTarget<R>): boolean;
|
|
104
|
+
}
|
|
105
|
+
export interface CommonStatics<R extends Runtime, Props extends BaseObject> {
|
|
106
|
+
attrs: Attrs<Props>[];
|
|
107
|
+
target: StyledTarget<R>;
|
|
108
|
+
shouldForwardProp?: ShouldForwardProp<R> | undefined;
|
|
109
|
+
}
|
|
110
|
+
export interface IStyledStatics<R extends Runtime, OuterProps extends BaseObject> extends CommonStatics<R, OuterProps> {
|
|
111
|
+
componentStyle: R extends 'web' ? ComponentStyle : never;
|
|
112
|
+
foldedComponentIds: R extends 'web' ? string : never;
|
|
113
|
+
inlineStyle: R extends 'native' ? InstanceType<IInlineStyleConstructor<OuterProps>> : never;
|
|
114
|
+
target: StyledTarget<R>;
|
|
115
|
+
styledComponentId: R extends 'web' ? string : never;
|
|
116
|
+
warnTooManyClasses?: (R extends 'web' ? ReturnType<typeof createWarnTooManyClasses> : never) | undefined;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Used by PolymorphicComponent to define prop override cascading order.
|
|
120
|
+
*/
|
|
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> : {}> = OverrideStyle<NoInfer<FastOmit<Substitute<BaseProps, Substitute<ForwardedAsTargetProps, AsTargetProps>>, keyof ExecutionProps>> & FastOmit<ExecutionProps, 'as' | 'forwardedAs'> & {
|
|
122
|
+
as?: AsTarget;
|
|
123
|
+
forwardedAs?: ForwardedAsTarget;
|
|
124
|
+
}>;
|
|
125
|
+
/**
|
|
126
|
+
* This type forms the signature for a forwardRef-enabled component
|
|
127
|
+
* that accepts the "as" prop to dynamically change the underlying
|
|
128
|
+
* rendered JSX. The interface will automatically attempt to extract
|
|
129
|
+
* props from the given rendering target to get proper typing for
|
|
130
|
+
* any specialized props in the target component.
|
|
131
|
+
*/
|
|
132
|
+
export interface PolymorphicComponent<R extends Runtime, BaseProps extends BaseObject> extends React.ForwardRefExoticComponent<BaseProps> {
|
|
133
|
+
<AsTarget extends StyledTarget<R> | void = void, ForwardedAsTarget extends StyledTarget<R> | void = void>(props: PolymorphicComponentProps<R, BaseProps, AsTarget, ForwardedAsTarget>): React.JSX.Element;
|
|
134
|
+
}
|
|
135
|
+
export interface IStyledComponentBase<R extends Runtime, Props extends BaseObject = BaseObject> extends PolymorphicComponent<R, Props>, IStyledStatics<R, Props>, StyledComponentBrand {
|
|
136
|
+
defaultProps?: (ExecutionProps & Partial<Props>) | undefined;
|
|
137
|
+
toString: () => string;
|
|
138
|
+
}
|
|
139
|
+
export type IStyledComponent<R extends Runtime, Props extends BaseObject = BaseObject> = IStyledComponentBase<R, Props> &
|
|
140
|
+
/**
|
|
141
|
+
* TypeScript doesn't allow using a styled component as a key inside object
|
|
142
|
+
* styles because "A computed property name must be of type 'string', 'number',
|
|
143
|
+
* 'symbol', or 'any'.". The toString() method only exists in the web runtime.
|
|
144
|
+
* This hack intersects the `IStyledComponent` type with the built-in `string`
|
|
145
|
+
* type to keep TSC happy.
|
|
146
|
+
*
|
|
147
|
+
* @example
|
|
148
|
+
* const H1 = styled.h1({
|
|
149
|
+
* fontSize: '2rem'
|
|
150
|
+
* });
|
|
151
|
+
*
|
|
152
|
+
* const Header = styled.header({
|
|
153
|
+
* [H1]: {
|
|
154
|
+
* marginBottom: '1rem'
|
|
155
|
+
* }
|
|
156
|
+
* })
|
|
157
|
+
*/
|
|
158
|
+
(R extends 'web' ? string : {});
|
|
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
|
+
}
|
|
162
|
+
export interface IInlineStyleConstructor<Props extends BaseObject> {
|
|
163
|
+
new (rules: RuleSet<Props>): IInlineStyle<Props>;
|
|
164
|
+
}
|
|
165
|
+
export interface IInlineStyle<Props extends BaseObject> {
|
|
166
|
+
rules: RuleSet<Props>;
|
|
167
|
+
generateStyleObject(executionContext: ExecutionContext & Props): object;
|
|
168
|
+
}
|
|
169
|
+
export type CSSProperties = CSS.Properties<number | (string & {})>;
|
|
170
|
+
export type CSSPropertiesWithVars = CSSProperties & {
|
|
171
|
+
[key: `--${string}`]: string | number | undefined;
|
|
172
|
+
};
|
|
173
|
+
type OverrideStyle<P> = P extends {
|
|
174
|
+
style?: any;
|
|
175
|
+
} ? Omit<P, 'style'> & {
|
|
176
|
+
style?: CSSPropertiesWithVars;
|
|
177
|
+
} : P;
|
|
178
|
+
export type CSSPseudos = {
|
|
179
|
+
[K in CSS.Pseudos]?: CSSObject;
|
|
180
|
+
};
|
|
181
|
+
export type CSSKeyframes = object & {
|
|
182
|
+
[key: string]: CSSObject;
|
|
183
|
+
};
|
|
184
|
+
export type CSSObject<Props extends BaseObject = BaseObject> = StyledObject<Props>;
|
|
185
|
+
export interface StyledObject<Props extends BaseObject = BaseObject> extends CSSProperties, CSSPseudos {
|
|
186
|
+
[key: string]: StyledObject<Props> | string | number | StyleFunction<Props> | RuleSet<any> | undefined;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* The `css` prop is not declared by default in the types as it would cause `css` to be present
|
|
190
|
+
* on the types of anything that uses styled-components indirectly, even if they do not use the
|
|
191
|
+
* babel plugin.
|
|
192
|
+
*
|
|
193
|
+
* To enable support for the `css` prop in TypeScript, create a `styled-components.d.ts` file in
|
|
194
|
+
* your project source with the following contents:
|
|
195
|
+
*
|
|
196
|
+
* ```ts
|
|
197
|
+
* import type { CSSProp } from "styled-components";
|
|
198
|
+
*
|
|
199
|
+
* declare module "react" {
|
|
200
|
+
* interface Attributes {
|
|
201
|
+
* css?: CSSProp;
|
|
202
|
+
* }
|
|
203
|
+
* }
|
|
204
|
+
* ```
|
|
205
|
+
*
|
|
206
|
+
* In order to get accurate typings for `props.theme` in `css` interpolations, see
|
|
207
|
+
* {@link DefaultTheme}.
|
|
208
|
+
*/
|
|
209
|
+
export type CSSProp = Interpolation<any>;
|
|
210
|
+
export type NoInfer<T> = [T][T extends any ? 0 : never];
|
|
211
|
+
export type Substitute<A extends BaseObject, B extends BaseObject> = FastOmit<A, keyof B> & B;
|
|
212
|
+
export type InsertionTarget = HTMLElement | ShadowRoot;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function addUnitIfNeeded(name: string, value: any): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const checkDynamicCreation: (displayName: string, componentId?: string | undefined) => void;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
declare const elements: readonly ["a", "abbr", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "blockquote", "body", "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", "label", "legend", "li", "main", "map", "mark", "menu", "meter", "nav", "object", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "search", "section", "select", "slot", "small", "span", "strong", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "u", "ul", "var", "video", "wbr", "circle", "clipPath", "defs", "ellipse", "feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence", "filter", "foreignObject", "g", "image", "line", "linearGradient", "marker", "mask", "path", "pattern", "polygon", "polyline", "radialGradient", "rect", "stop", "svg", "switch", "symbol", "text", "textPath", "tspan", "use"];
|
|
2
|
+
declare const _default: Set<"symbol" | "object" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "bdi" | "bdo" | "blockquote" | "body" | "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" | "label" | "legend" | "li" | "main" | "map" | "mark" | "menu" | "meter" | "nav" | "ol" | "optgroup" | "option" | "output" | "p" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "search" | "section" | "select" | "slot" | "small" | "span" | "strong" | "sub" | "summary" | "sup" | "table" | "tbody" | "td" | "template" | "textarea" | "tfoot" | "th" | "thead" | "time" | "tr" | "u" | "ul" | "var" | "video" | "wbr" | "circle" | "clipPath" | "defs" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "svg" | "switch" | "text" | "textPath" | "tspan" | "use">;
|
|
3
|
+
export default _default;
|
|
4
|
+
export type SupportedHTMLElements = (typeof elements)[number];
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
'1': string;
|
|
3
|
+
'2': string;
|
|
4
|
+
'3': string;
|
|
5
|
+
'4': string;
|
|
6
|
+
'5': string;
|
|
7
|
+
'6': string;
|
|
8
|
+
'7': string;
|
|
9
|
+
'8': string;
|
|
10
|
+
'9': string;
|
|
11
|
+
'10': string;
|
|
12
|
+
'11': string;
|
|
13
|
+
'12': string;
|
|
14
|
+
'13': string;
|
|
15
|
+
'14': string;
|
|
16
|
+
'15': string;
|
|
17
|
+
'16': string;
|
|
18
|
+
'17': string;
|
|
19
|
+
'18': string;
|
|
20
|
+
};
|
|
21
|
+
export default _default;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import StyleSheet from '../sheet';
|
|
2
|
+
import { Dict, ExecutionContext, Interpolation, RuleSet, Stringifier } from '../types';
|
|
3
|
+
export declare const objToCssArray: (obj: Dict<any>) => string[];
|
|
4
|
+
export default function flatten<Props extends object>(chunk: Interpolation<object>, executionContext?: (ExecutionContext & Props) | undefined, styleSheet?: StyleSheet | undefined, stylisInstance?: Stringifier | undefined): RuleSet<Props>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function generateAlphabeticName(code: number): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function generateComponentId(str: string): string;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AnyComponent } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Adapted from hoist-non-react-statics to avoid the react-is dependency.
|
|
5
|
+
*/
|
|
6
|
+
declare const REACT_STATICS: {
|
|
7
|
+
childContextTypes: boolean;
|
|
8
|
+
contextType: boolean;
|
|
9
|
+
contextTypes: boolean;
|
|
10
|
+
defaultProps: boolean;
|
|
11
|
+
displayName: boolean;
|
|
12
|
+
getDefaultProps: boolean;
|
|
13
|
+
getDerivedStateFromError: boolean;
|
|
14
|
+
getDerivedStateFromProps: boolean;
|
|
15
|
+
mixins: boolean;
|
|
16
|
+
propTypes: boolean;
|
|
17
|
+
type: boolean;
|
|
18
|
+
};
|
|
19
|
+
declare const KNOWN_STATICS: {
|
|
20
|
+
name: boolean;
|
|
21
|
+
length: boolean;
|
|
22
|
+
prototype: boolean;
|
|
23
|
+
caller: boolean;
|
|
24
|
+
callee: boolean;
|
|
25
|
+
arguments: boolean;
|
|
26
|
+
arity: boolean;
|
|
27
|
+
};
|
|
28
|
+
declare const FORWARD_REF_STATICS: {
|
|
29
|
+
$$typeof: boolean;
|
|
30
|
+
render: boolean;
|
|
31
|
+
defaultProps: boolean;
|
|
32
|
+
displayName: boolean;
|
|
33
|
+
propTypes: boolean;
|
|
34
|
+
};
|
|
35
|
+
declare const MEMO_STATICS: {
|
|
36
|
+
$$typeof: boolean;
|
|
37
|
+
compare: boolean;
|
|
38
|
+
defaultProps: boolean;
|
|
39
|
+
displayName: boolean;
|
|
40
|
+
propTypes: boolean;
|
|
41
|
+
type: boolean;
|
|
42
|
+
};
|
|
43
|
+
type OmniComponent = AnyComponent;
|
|
44
|
+
type ExcludeList = {
|
|
45
|
+
[key: string]: true;
|
|
46
|
+
};
|
|
47
|
+
export type NonReactStatics<S extends OmniComponent, C extends ExcludeList = {}> = {
|
|
48
|
+
[key in Exclude<keyof S, S extends React.MemoExoticComponent<any> ? keyof typeof MEMO_STATICS | keyof C : S extends React.ForwardRefExoticComponent<any> ? keyof typeof FORWARD_REF_STATICS | keyof C : keyof typeof REACT_STATICS | keyof typeof KNOWN_STATICS | keyof C>]: S[key];
|
|
49
|
+
};
|
|
50
|
+
export default function hoistNonReactStatics<T extends OmniComponent, S extends OmniComponent, C extends ExcludeList = {}>(targetComponent: T, sourceComponent: S, excludelist?: C | undefined): T & NonReactStatics<S, C>;
|
|
51
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hyphenates a camelcased CSS property name, for example:
|
|
3
|
+
*
|
|
4
|
+
* > hyphenateStyleName('backgroundColor')
|
|
5
|
+
* < "background-color"
|
|
6
|
+
* > hyphenateStyleName('MozTransition')
|
|
7
|
+
* < "-moz-transition"
|
|
8
|
+
* > hyphenateStyleName('msTransition')
|
|
9
|
+
* < "-ms-transition"
|
|
10
|
+
*
|
|
11
|
+
* As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix
|
|
12
|
+
* is converted to `-ms-`.
|
|
13
|
+
*/
|
|
14
|
+
export default function hyphenateStyleName(string: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function isFunction(test: any): test is Function;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function isPlainObject(x: any): x is Record<any, any>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function isStatelessFunction(test: any): test is Function;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Arrays & POJOs merged recursively, other objects and value types are overridden
|
|
3
|
+
* If target is not a POJO or an Array, it will get source properties injected via shallow merge
|
|
4
|
+
* Source objects applied left to right. Mutates & returns target. Similar to lodash merge.
|
|
5
|
+
*/
|
|
6
|
+
export default function mixinDeep(target: any, ...sources: any[]): any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function getNonce(): string | null;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* If the Object prototype is frozen, the "toString" property is non-writable. This means that any objects which inherit this property
|
|
3
|
+
* cannot have the property changed using a "=" assignment operator. If using strict mode, attempting that will cause an error. If not using
|
|
4
|
+
* strict mode, attempting that will be silently ignored.
|
|
5
|
+
*
|
|
6
|
+
* If the Object prototype is frozen, inherited non-writable properties can still be shadowed using one of two mechanisms:
|
|
7
|
+
*
|
|
8
|
+
* 1. ES6 class methods: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes#methods
|
|
9
|
+
* 2. Using the `Object.defineProperty()` static method:
|
|
10
|
+
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty
|
|
11
|
+
*
|
|
12
|
+
* However, this project uses Babel to transpile ES6 classes, and transforms ES6 class methods to use the assignment operator instead:
|
|
13
|
+
* https://babeljs.io/docs/babel-plugin-transform-class-properties#options
|
|
14
|
+
*
|
|
15
|
+
* Therefore, the most compatible way to shadow the prototype's "toString" property is to define a new "toString" property on this object.
|
|
16
|
+
*/
|
|
17
|
+
export declare function setToString(object: object, toStringFn: () => string): void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as stylis from 'stylis';
|
|
2
|
+
import { Stringifier } from '../types';
|
|
3
|
+
export type ICreateStylisInstance = {
|
|
4
|
+
options?: {
|
|
5
|
+
namespace?: string | undefined;
|
|
6
|
+
prefix?: boolean | undefined;
|
|
7
|
+
} | undefined;
|
|
8
|
+
plugins?: stylis.Middleware[] | undefined;
|
|
9
|
+
};
|
|
10
|
+
export default function createStylisInstance({ options, plugins, }?: ICreateStylisInstance): Stringifier;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
declare const elements: readonly ["a", "abbr", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "blockquote", "body", "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", "label", "legend", "li", "main", "map", "mark", "menu", "meter", "nav", "object", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "search", "section", "select", "slot", "small", "span", "strong", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "u", "ul", "var", "video", "wbr", "circle", "clipPath", "defs", "ellipse", "feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence", "filter", "foreignObject", "g", "image", "line", "linearGradient", "marker", "mask", "path", "pattern", "polygon", "polyline", "radialGradient", "rect", "stop", "svg", "switch", "symbol", "text", "textPath", "tspan", "use"];
|
|
2
|
-
declare const _default: Set<"symbol" | "object" | "
|
|
2
|
+
declare const _default: Set<"symbol" | "object" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "bdi" | "bdo" | "blockquote" | "body" | "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" | "label" | "legend" | "li" | "main" | "map" | "mark" | "menu" | "meter" | "nav" | "ol" | "optgroup" | "option" | "output" | "p" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "search" | "section" | "select" | "slot" | "small" | "span" | "strong" | "sub" | "summary" | "sup" | "table" | "tbody" | "td" | "template" | "textarea" | "tfoot" | "th" | "thead" | "time" | "tr" | "u" | "ul" | "var" | "video" | "wbr" | "circle" | "clipPath" | "defs" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "svg" | "switch" | "text" | "textPath" | "tspan" | "use">;
|
|
3
3
|
export default _default;
|
|
4
4
|
export type SupportedHTMLElements = (typeof elements)[number];
|
|
@@ -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"),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),f=Object.freeze([]),d=Object.freeze({}),h="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([h[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.3.0",b="/*!sc*/\n",E="undefined"!=typeof window&&"undefined"!=typeof document,P=void 0===u.default.createContext,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),C=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}(),N=1<<30,T=new Map,O=new Map,x=1,D=function(e){if(T.has(e))return T.get(e);for(;O.has(x);)x++;var t=x++;if("production"!==process.env.NODE_ENV&&((0|t)<0||t>N))throw v(16,"".concat(t));return T.set(e,t),O.set(t,e),t},j=function(e,t){x=t+1,T.set(e,t),O.set(t,e)},R="style[".concat(g,"][").concat(_,'="').concat(w,'"]'),I=new RegExp("^".concat(g,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),z=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)},B=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(I);if(c){var u=0|parseInt(c[1],10),l=c[2];0!==u&&(j(l,u),z(e,l,c[3]),e.getTag().insertRules(u,o)),o.length=0}else o.push(a)}}},L=function(e){for(var t=document.querySelectorAll(R),n=0,r=t.length;n<r;n++){var o=t[n];o&&o.getAttribute(g)!==S&&(B(e,o),o.parentNode&&o.parentNode.removeChild(o))}},M=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=M(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=M(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}(),$=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}(),F=E,q={isServer:!E,useCSSOMInjection:!A},Y=function(){function e(e,t,r){void 0===e&&(e=d),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&&F&&(F=!1,L(this)),m(this,function(){return function(e){for(var t=e.getTag(),n=t.length,r="",o=function(n){var o=function(e){return O.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 D(e)},e.prototype.rehydrate=function(){!this.server&&E&&L(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 $(n):t?new V(n):new k(n)}(this.options),new C(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(D(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(D(e),n)},e.prototype.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},e.prototype.clearRules=function(e){this.getTag().clearGroup(D(e)),this.clearNames(e)},e.prototype.clearTag=function(){this.tag=void 0},e}(),G=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},W=/&/g,H=/^\s*\/\/.*$/gm;function U(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=U(e.children,t)),e})}var K=new Y,Z=function(){var e,t,n,r=d.options,o=void 0===r?d:r,i=d.plugins,s=void 0===i?f:i,a=function(n,r,o){return o.startsWith(t)&&o.endsWith(t)&&o.replaceAll(t,"").length>0?".".concat(e):n},c=s.slice();c.push(function(e){e.type===l.RULESET&&e.value.includes("&")&&(e.props[0]=e.props[0].replace(W,t).replace(n,a))}),o.prefix&&c.push(l.prefixer),c.push(l.stringify);var u=function(r,i,s,a){void 0===i&&(i=""),void 0===s&&(s=""),void 0===a&&(a="&"),e=a,t=i,n=new RegExp("\\".concat(t,"\\b"),"g");var u=r.replace(H,""),p=l.compile(s||i?"".concat(s," ").concat(i," { ").concat(u," }"):u);o.namespace&&(p=U(p,o.namespace));var f=[];return l.serialize(p,l.middleware(c.concat(l.rulesheet(function(e){return f.push(e)})))),f};return u.hash=s.length?s.reduce(function(e,t){return t.name||v(15),G(e,t.name)},5381).toString():"",u}(),J=(P||u.default.createContext({shouldForwardProp:void 0,styleSheet:K,stylis:Z}),P||u.default.createContext(void 0),function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=Z);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=Z),this.name+e.hash},e}());function Q(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||e in p.default||e.startsWith("--")?String(t).trim():"".concat(t,"px")}function X(e){return"production"!==process.env.NODE_ENV&&"string"==typeof e&&e||e.displayName||e.name||"Component"}var ee=function(e){return e>="A"&&e<="Z"};function te(e){for(var t="",n=0;n<e.length;n++){var r=e[n];if(1===n&&"-"===r&&"-"===e[0])return e;ee(r)?t+="-"+r.toLowerCase():t+=r}return t.startsWith("ms-")?"-"+t:t}function ne(e){return"function"==typeof e}function re(e){return null!==e&&"object"==typeof e&&e.constructor.name===Object.name&&!("props"in e&&e.$$typeof)}function oe(e){return"object"==typeof e&&"styledComponentId"in e}var ie=function(e){return null==e||!1===e||""===e},se=function(e){var t=[];for(var r in e){var o=e[r];e.hasOwnProperty(r)&&!ie(o)&&(Array.isArray(o)&&o.isCss||ne(o)?t.push("".concat(te(r),":"),o,";"):re(o)?t.push.apply(t,n.__spreadArray(n.__spreadArray(["".concat(r," {")],se(o),!1),["}"],!1)):t.push("".concat(te(r),": ").concat(Q(r,o),";")))}return t};function ae(e,t,n,r){if(ie(e))return[];if(oe(e))return[".".concat(e.styledComponentId)];if(ne(e)){if(!ne(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 J||re(o)||null===o||console.error("".concat(X(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.")),ae(o,t,n,r)}var i;return e instanceof J?n?(e.inject(n,r),[e.getName(r)]):[e]:re(e)?se(e):Array.isArray(e)?Array.prototype.concat.apply(f,e.map(function(e){return ae(e,t,n,r)})):[e.toString()]}function ce(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 ue=function(e){return Object.assign(e,{isCss:!0})};function le(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(ne(e)||re(e))return ue(ae(ce(f,n.__spreadArray([e],t,!0))));var o=e;return 0===t.length&&1===o.length&&"string"==typeof o[0]?ae(o):ue(ae(ce(o,t)))}function pe(e,t,r){if(void 0===r&&(r=d),!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,le.apply(void 0,n.__spreadArray([o],i,!1)))};return o.attrs=function(o){return pe(e,t,n.__assign(n.__assign({},r),{attrs:Array.prototype.concat(r.attrs,o).filter(Boolean)}))},o.withConfig=function(o){return pe(e,t,n.__assign(n.__assign({},r),o))},o}var fe,de=P?{Provider:function(e){return e.children},Consumer:function(e){return(0,e.children)(void 0)}}:u.default.createContext(void 0),he=de.Consumer;function ye(e,t,n){return void 0===n&&(n=d),e.theme!==n.theme&&e.theme||t||n.theme}var ve="function"==typeof Symbol&&Symbol.for,me=ve?Symbol.for("react.memo"):60115,ge=ve?Symbol.for("react.forward_ref"):60112,Se={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},_e={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},we={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},be=((fe={})[ge]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},fe[me]=we,fe);function Ee(e){return("type"in(t=e)&&t.type.$$typeof)===me?we:"$$typeof"in e?be[e.$$typeof]:Se;var t}var Pe=Object.defineProperty,Ae=Object.getOwnPropertyNames,Ce=Object.getOwnPropertySymbols,Ne=Object.getOwnPropertyDescriptor,Te=Object.getPrototypeOf,Oe=Object.prototype;function xe(e,t,n){if("string"!=typeof t){if(Oe){var r=Te(t);r&&r!==Oe&&xe(e,r,n)}var o=Ae(t);Ce&&(o=o.concat(Ce(t)));for(var i=Ee(e),s=Ee(t),a=0;a<o.length;++a){var c=o[a];if(!(c in _e||n&&n[c]||s&&c in s||i&&c in i)){var u=Ne(t,c);try{Pe(e,c,u)}catch(e){}}}}return e}var De=/(a)(d)/gi,je=function(e){return String.fromCharCode(e+(e>25?39:97))};function Re(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 Ie=["fit-content","min-content","max-content"],ze={};function Be(e,t,n){if(void 0===n&&(n=!1),!n&&!re(e)&&!Array.isArray(e))return t;if(Array.isArray(t))for(var r=0;r<t.length;r++)e[r]=Be(e[r],t[r]);else if(re(t))for(var r in t)e[r]=Be(e[r],t[r]);return e}var Le,Me,Ve=require("react-native"),ke=(Le=Ve.StyleSheet,Me=function(){function e(e){this.rules=e}return e.prototype.generateStyleObject=function(e){var n=Re(ae(this.rules,e)),r=function(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=je(t%52)+n;return(je(t%52)+n).replace(De,"$1-$2")}(G(5381,n)>>>0);if(!ze[r]){var o=t.parse(n),i=[];o.each(function(e){if("decl"===e.type){if(Ie.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=Le.create({generated:s});ze[r]=a.generated}return ze[r]},e}(),function(e,t,o){var i=oe(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(X(e),")")}(e):a,l=t.attrs,p=void 0===l?f:l,h=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?u.default.useContext(de):void 0,f=function(e,t,r){void 0===e&&(e=d);var o=n.__assign(n.__assign({},t),{theme:e}),i={};return r.forEach(function(e){var t,n=ne(e)?e(o):e;for(t in n)o[t]=i[t]=n[t]}),[o,i]}(ye(t,p,a)||d,t,i),h=f[1],y=s.generateStyleObject(f[0]),v=o,m=h.as||t.as||l,g=h!==t?n.__assign(n.__assign({},t),h):t,S={};for(var _ in g)"$"!==_[0]&&"as"!==_&&("forwardedAs"===_?S.as=g[_]:c&&!c(_,m)||(S[_]=g[_]));return S.style=u.default.useMemo?u.default.useMemo(function(){return ne(t.style)?function(e){return[y].concat(t.style(e))}:t.style?[y].concat(t.style):y},[t.style,y]):ne(t.style)?function(e){return[y].concat(t.style(e))}:t.style?[y].concat(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=h,S.inlineStyle=new Me(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++)Be(e,o[r],!0);return e}({},s.defaultProps,e):e}}),xe(S,e,{attrs:!0,inlineStyle:!0,displayName:!0,shouldForwardProp:!0,target:!0}),S}),$e=function(e){return pe(ke,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($e,e,{enumerable:!0,configurable:!1,get:function(){if(e in Ve&&Ve[e])return $e(Ve[e]);throw new Error("".concat(e," is not available in the currently-installed version of react-native"))}})}),exports.ThemeConsumer=he,exports.ThemeContext=de,exports.ThemeProvider=function(e){if(P||!u.default.useContext||!u.default.useMemo)return e.children;var t=u.default.useContext(de),r=u.default.useMemo(function(){return function(e,t){if(!e)throw v(14);if(ne(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(de.Provider,{value:r},e.children):null},exports.css=le,exports.default=$e,exports.isStyledComponent=oe,exports.styled=$e,exports.toStyleSheet=function(e){var n=Re(ae(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 Ve.StyleSheet.create({style:i}).style},exports.useTheme=function(){var e=!P&&u.default.useContext?u.default.useContext(de):void 0;if(!e)throw v(18);return e},exports.withTheme=function(e){var t=u.default.forwardRef(function(t,r){var o=ye(t,u.default.useContext?u.default.useContext(de):void 0,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(X(e),'"')),u.default.createElement(e,n.__assign(n.__assign({},t),{theme:o,ref:r}))});return t.displayName="WithTheme(".concat(X(e),")"),xe(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"),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),f=Object.freeze([]),d=Object.freeze({}),h="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([h[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.3.2",b="/*!sc*/\n",E="undefined"!=typeof window&&"undefined"!=typeof document,P=void 0===u.default.createContext,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),C=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}(),N=1<<30,T=new Map,O=new Map,x=1,D=function(e){if(T.has(e))return T.get(e);for(;O.has(x);)x++;var t=x++;if("production"!==process.env.NODE_ENV&&((0|t)<0||t>N))throw v(16,"".concat(t));return T.set(e,t),O.set(t,e),t},j=function(e,t){x=t+1,T.set(e,t),O.set(t,e)},R="style[".concat(g,"][").concat(_,'="').concat(w,'"]'),I=new RegExp("^".concat(g,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),z=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)},B=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(I);if(c){var u=0|parseInt(c[1],10),l=c[2];0!==u&&(j(l,u),z(e,l,c[3]),e.getTag().insertRules(u,o)),o.length=0}else o.push(a)}}},L=function(e){for(var t=document.querySelectorAll(R),n=0,r=t.length;n<r;n++){var o=t[n];o&&o.getAttribute(g)!==S&&(B(e,o),o.parentNode&&o.parentNode.removeChild(o))}},M=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=M(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=M(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}(),$=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}(),F=E,q={isServer:!E,useCSSOMInjection:!A},Y=function(){function e(e,t,r){void 0===e&&(e=d),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&&F&&(F=!1,L(this)),m(this,function(){return function(e){for(var t=e.getTag(),n=t.length,r="",o=function(n){var o=function(e){return O.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 D(e)},e.prototype.rehydrate=function(){!this.server&&E&&L(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 $(n):t?new V(n):new k(n)}(this.options),new C(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(D(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(D(e),n)},e.prototype.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},e.prototype.clearRules=function(e){this.getTag().clearGroup(D(e)),this.clearNames(e)},e.prototype.clearTag=function(){this.tag=void 0},e}(),G=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},W=/&/g,H=/^\s*\/\/.*$/gm;function U(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=U(e.children,t)),e})}var K=new Y,Z=function(){var e,t,n,r=d.options,o=void 0===r?d:r,i=d.plugins,s=void 0===i?f:i,a=function(n,r,o){return o.startsWith(t)&&o.endsWith(t)&&o.replaceAll(t,"").length>0?".".concat(e):n},c=s.slice();c.push(function(e){e.type===l.RULESET&&e.value.includes("&")&&(e.props[0]=e.props[0].replace(W,t).replace(n,a))}),o.prefix&&c.push(l.prefixer),c.push(l.stringify);var u=function(r,i,s,a){void 0===i&&(i=""),void 0===s&&(s=""),void 0===a&&(a="&"),e=a,t=i,n=new RegExp("\\".concat(t,"\\b"),"g");var u=r.replace(H,""),p=l.compile(s||i?"".concat(s," ").concat(i," { ").concat(u," }"):u);o.namespace&&(p=U(p,o.namespace));var f=[];return l.serialize(p,l.middleware(c.concat(l.rulesheet(function(e){return f.push(e)})))),f};return u.hash=s.length?s.reduce(function(e,t){return t.name||v(15),G(e,t.name)},5381).toString():"",u}(),J=(P||u.default.createContext({shouldForwardProp:void 0,styleSheet:K,stylis:Z}),P||u.default.createContext(void 0),function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=Z);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=Z),this.name+e.hash},e}());function Q(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||e in p.default||e.startsWith("--")?String(t).trim():"".concat(t,"px")}function X(e){return"production"!==process.env.NODE_ENV&&"string"==typeof e&&e||e.displayName||e.name||"Component"}var ee=function(e){return e>="A"&&e<="Z"};function te(e){for(var t="",n=0;n<e.length;n++){var r=e[n];if(1===n&&"-"===r&&"-"===e[0])return e;ee(r)?t+="-"+r.toLowerCase():t+=r}return t.startsWith("ms-")?"-"+t:t}function ne(e){return"function"==typeof e}function re(e){return null!==e&&"object"==typeof e&&e.constructor.name===Object.name&&!("props"in e&&e.$$typeof)}function oe(e){return"object"==typeof e&&"styledComponentId"in e}var ie=function(e){return null==e||!1===e||""===e},se=function(e){var t=[];for(var r in e){var o=e[r];e.hasOwnProperty(r)&&!ie(o)&&(Array.isArray(o)&&o.isCss||ne(o)?t.push("".concat(te(r),":"),o,";"):re(o)?t.push.apply(t,n.__spreadArray(n.__spreadArray(["".concat(r," {")],se(o),!1),["}"],!1)):t.push("".concat(te(r),": ").concat(Q(r,o),";")))}return t};function ae(e,t,n,r){if(ie(e))return[];if(oe(e))return[".".concat(e.styledComponentId)];if(ne(e)){if(!ne(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 J||re(o)||null===o||console.error("".concat(X(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.")),ae(o,t,n,r)}var i;return e instanceof J?n?(e.inject(n,r),[e.getName(r)]):[e]:re(e)?se(e):Array.isArray(e)?Array.prototype.concat.apply(f,e.map(function(e){return ae(e,t,n,r)})):[e.toString()]}function ce(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 ue=function(e){return Object.assign(e,{isCss:!0})};function le(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(ne(e)||re(e))return ue(ae(ce(f,n.__spreadArray([e],t,!0))));var o=e;return 0===t.length&&1===o.length&&"string"==typeof o[0]?ae(o):ue(ae(ce(o,t)))}function pe(e,t,r){if(void 0===r&&(r=d),!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,le.apply(void 0,n.__spreadArray([o],i,!1)))};return o.attrs=function(o){return pe(e,t,n.__assign(n.__assign({},r),{attrs:Array.prototype.concat(r.attrs,o).filter(Boolean)}))},o.withConfig=function(o){return pe(e,t,n.__assign(n.__assign({},r),o))},o}var fe,de=P?{Provider:function(e){return e.children},Consumer:function(e){return(0,e.children)(void 0)}}:u.default.createContext(void 0),he=de.Consumer;function ye(e,t,n){return void 0===n&&(n=d),e.theme!==n.theme&&e.theme||t||n.theme}var ve="function"==typeof Symbol&&Symbol.for,me=ve?Symbol.for("react.memo"):60115,ge=ve?Symbol.for("react.forward_ref"):60112,Se={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},_e={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},we={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},be=((fe={})[ge]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},fe[me]=we,fe);function Ee(e){return("type"in(t=e)&&t.type.$$typeof)===me?we:"$$typeof"in e?be[e.$$typeof]:Se;var t}var Pe=Object.defineProperty,Ae=Object.getOwnPropertyNames,Ce=Object.getOwnPropertySymbols,Ne=Object.getOwnPropertyDescriptor,Te=Object.getPrototypeOf,Oe=Object.prototype;function xe(e,t,n){if("string"!=typeof t){if(Oe){var r=Te(t);r&&r!==Oe&&xe(e,r,n)}var o=Ae(t);Ce&&(o=o.concat(Ce(t)));for(var i=Ee(e),s=Ee(t),a=0;a<o.length;++a){var c=o[a];if(!(c in _e||n&&n[c]||s&&c in s||i&&c in i)){var u=Ne(t,c);try{Pe(e,c,u)}catch(e){}}}}return e}var De=/(a)(d)/gi,je=function(e){return String.fromCharCode(e+(e>25?39:97))};function Re(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 Ie=["fit-content","min-content","max-content"],ze={};function Be(e,t,n){if(void 0===n&&(n=!1),!n&&!re(e)&&!Array.isArray(e))return t;if(Array.isArray(t))for(var r=0;r<t.length;r++)e[r]=Be(e[r],t[r]);else if(re(t))for(var r in t)e[r]=Be(e[r],t[r]);return e}var Le,Me,Ve=require("react-native"),ke=(Le=Ve.StyleSheet,Me=function(){function e(e){this.rules=e}return e.prototype.generateStyleObject=function(e){var n=Re(ae(this.rules,e)),r=function(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=je(t%52)+n;return(je(t%52)+n).replace(De,"$1-$2")}(G(5381,n)>>>0);if(!ze[r]){var o=t.parse(n),i=[];o.each(function(e){if("decl"===e.type){if(Ie.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=Le.create({generated:s});ze[r]=a.generated}return ze[r]},e}(),function(e,t,o){var i=oe(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(X(e),")")}(e):a,l=t.attrs,p=void 0===l?f:l,h=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?u.default.useContext(de):void 0,f=function(e,t,r){void 0===e&&(e=d);var o=n.__assign(n.__assign({},t),{theme:e}),i={};return r.forEach(function(e){var t,n=ne(e)?e(o):e;for(t in n)o[t]=i[t]=n[t]}),[o,i]}(ye(t,p,a)||d,t,i),h=f[1],y=s.generateStyleObject(f[0]),v=o,m=h.as||t.as||l,g=h!==t?n.__assign(n.__assign({},t),h):t,S={};for(var _ in g)"$"!==_[0]&&"as"!==_&&("forwardedAs"===_?S.as=g[_]:c&&!c(_,m)||(S[_]=g[_]));return S.style=u.default.useMemo?u.default.useMemo(function(){return ne(t.style)?function(e){return[y].concat(t.style(e))}:t.style?[y].concat(t.style):y},[t.style,y]):ne(t.style)?function(e){return[y].concat(t.style(e))}:t.style?[y].concat(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=h,S.inlineStyle=new Me(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++)Be(e,o[r],!0);return e}({},s.defaultProps,e):e}}),xe(S,e,{attrs:!0,inlineStyle:!0,displayName:!0,shouldForwardProp:!0,target:!0}),S}),$e=function(e){return pe(ke,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($e,e,{enumerable:!0,configurable:!1,get:function(){if(e in Ve&&Ve[e])return $e(Ve[e]);throw new Error("".concat(e," is not available in the currently-installed version of react-native"))}})}),exports.ThemeConsumer=he,exports.ThemeContext=de,exports.ThemeProvider=function(e){if(P||!u.default.useContext||!u.default.useMemo)return e.children;var t=u.default.useContext(de),r=u.default.useMemo(function(){return function(e,t){if(!e)throw v(14);if(ne(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(de.Provider,{value:r},e.children):null},exports.css=le,exports.default=$e,exports.isStyledComponent=oe,exports.styled=$e,exports.toStyleSheet=function(e){var n=Re(ae(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 Ve.StyleSheet.create({style:i}).style},exports.useTheme=function(){var e=!P&&u.default.useContext?u.default.useContext(de):void 0;if(!e)throw v(18);return e},exports.withTheme=function(e){var t=u.default.forwardRef(function(t,r){var o=ye(t,u.default.useContext?u.default.useContext(de):void 0,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(X(e),'"')),u.default.createElement(e,n.__assign(n.__assign({},t),{theme:o,ref:r}))});return t.displayName="WithTheme(".concat(X(e),")"),xe(t,e)};
|
|
2
2
|
//# sourceMappingURL=styled-components.native.cjs.js.map
|