styled-components 6.2.0 → 6.3.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.
Files changed (94) hide show
  1. package/README.md +2 -1
  2. package/dist/styled-components.browser.cjs.js +1 -1
  3. package/dist/styled-components.browser.cjs.js.map +1 -1
  4. package/dist/styled-components.browser.esm.js +1 -1
  5. package/dist/styled-components.browser.esm.js.map +1 -1
  6. package/dist/styled-components.cjs.js +1 -1
  7. package/dist/styled-components.cjs.js.map +1 -1
  8. package/dist/styled-components.esm.js +1 -1
  9. package/dist/styled-components.esm.js.map +1 -1
  10. package/dist/styled-components.js +169 -102
  11. package/dist/styled-components.js.map +1 -1
  12. package/dist/styled-components.min.js +1 -1
  13. package/dist/styled-components.min.js.map +1 -1
  14. package/native/dist/constants.d.ts +5 -0
  15. package/native/dist/dist/constants.d.ts +5 -0
  16. package/native/dist/dist/index.d.ts +2 -2
  17. package/native/dist/dist/models/ComponentStyle.d.ts +4 -1
  18. package/native/dist/dist/sheet/Tag.d.ts +4 -4
  19. package/native/dist/dist/test/utils.d.ts +32 -13
  20. package/native/dist/dist/types.d.ts +11 -3
  21. package/native/dist/dist/utils/domElements.d.ts +2 -2
  22. package/native/dist/index.d.ts +2 -2
  23. package/native/dist/models/ComponentStyle.d.ts +4 -1
  24. package/native/dist/sheet/Tag.d.ts +4 -4
  25. package/native/dist/styled-components.native.cjs.js +1 -1
  26. package/native/dist/styled-components.native.cjs.js.map +1 -1
  27. package/native/dist/styled-components.native.esm.js +1 -1
  28. package/native/dist/styled-components.native.esm.js.map +1 -1
  29. package/native/dist/test/utils.d.ts +32 -13
  30. package/native/dist/types.d.ts +11 -3
  31. package/native/dist/utils/domElements.d.ts +2 -2
  32. package/package.json +19 -20
  33. package/dist/base.d.ts +0 -12
  34. package/dist/constants.d.ts +0 -8
  35. package/dist/constructors/constructWithOptions.d.ts +0 -17
  36. package/dist/constructors/createGlobalStyle.d.ts +0 -3
  37. package/dist/constructors/css.d.ts +0 -4
  38. package/dist/constructors/keyframes.d.ts +0 -3
  39. package/dist/constructors/styled.d.ts +0 -17
  40. package/dist/hoc/withTheme.d.ts +0 -4
  41. package/dist/index-standalone.d.ts +0 -2
  42. package/dist/index.d.ts +0 -4
  43. package/dist/models/ComponentStyle.d.ts +0 -15
  44. package/dist/models/GlobalStyle.d.ts +0 -11
  45. package/dist/models/InlineStyle.d.ts +0 -7
  46. package/dist/models/Keyframes.d.ts +0 -10
  47. package/dist/models/ServerStyleSheet.d.ts +0 -15
  48. package/dist/models/StyleSheetManager.d.ts +0 -65
  49. package/dist/models/StyledComponent.d.ts +0 -3
  50. package/dist/models/StyledNativeComponent.d.ts +0 -3
  51. package/dist/models/ThemeProvider.d.ts +0 -47
  52. package/dist/native/index.d.ts +0 -19
  53. package/dist/secretInternals.d.ts +0 -5
  54. package/dist/sheet/GroupIDAllocator.d.ts +0 -4
  55. package/dist/sheet/GroupedTag.d.ts +0 -11
  56. package/dist/sheet/Rehydration.d.ts +0 -3
  57. package/dist/sheet/Sheet.d.ts +0 -40
  58. package/dist/sheet/Tag.d.ts +0 -55
  59. package/dist/sheet/dom.d.ts +0 -5
  60. package/dist/sheet/index.d.ts +0 -1
  61. package/dist/sheet/types.d.ts +0 -36
  62. package/dist/test/globals.d.ts +0 -2
  63. package/dist/test/utils.d.ts +0 -144
  64. package/dist/test/veryLargeUnionType.d.ts +0 -1
  65. package/dist/types.d.ts +0 -204
  66. package/dist/utils/addUnitIfNeeded.d.ts +0 -1
  67. package/dist/utils/checkDynamicCreation.d.ts +0 -1
  68. package/dist/utils/createWarnTooManyClasses.d.ts +0 -3
  69. package/dist/utils/determineTheme.d.ts +0 -4
  70. package/dist/utils/domElements.d.ts +0 -4
  71. package/dist/utils/empties.d.ts +0 -3
  72. package/dist/utils/error.d.ts +0 -5
  73. package/dist/utils/errors.d.ts +0 -21
  74. package/dist/utils/escape.d.ts +0 -5
  75. package/dist/utils/flatten.d.ts +0 -4
  76. package/dist/utils/generateAlphabeticName.d.ts +0 -1
  77. package/dist/utils/generateComponentId.d.ts +0 -1
  78. package/dist/utils/generateDisplayName.d.ts +0 -2
  79. package/dist/utils/getComponentName.d.ts +0 -2
  80. package/dist/utils/hash.d.ts +0 -3
  81. package/dist/utils/hoist.d.ts +0 -51
  82. package/dist/utils/hyphenateStyleName.d.ts +0 -14
  83. package/dist/utils/interleave.d.ts +0 -2
  84. package/dist/utils/isFunction.d.ts +0 -1
  85. package/dist/utils/isPlainObject.d.ts +0 -1
  86. package/dist/utils/isStatelessFunction.d.ts +0 -1
  87. package/dist/utils/isStaticRules.d.ts +0 -2
  88. package/dist/utils/isStyledComponent.d.ts +0 -2
  89. package/dist/utils/isTag.d.ts +0 -2
  90. package/dist/utils/joinStrings.d.ts +0 -5
  91. package/dist/utils/mixinDeep.d.ts +0 -6
  92. package/dist/utils/nonce.d.ts +0 -1
  93. package/dist/utils/setToString.d.ts +0 -17
  94. package/dist/utils/stylis.d.ts +0 -10
package/dist/types.d.ts DELETED
@@ -1,204 +0,0 @@
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<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
- 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> : {}> = 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 CSSPseudos = {
171
- [K in CSS.Pseudos]?: CSSObject;
172
- };
173
- export type CSSKeyframes = object & {
174
- [key: string]: CSSObject;
175
- };
176
- export type CSSObject<Props extends BaseObject = BaseObject> = StyledObject<Props>;
177
- export interface StyledObject<Props extends BaseObject = BaseObject> extends CSSProperties, CSSPseudos {
178
- [key: string]: StyledObject<Props> | string | number | StyleFunction<Props> | RuleSet<any> | undefined;
179
- }
180
- /**
181
- * The `css` prop is not declared by default in the types as it would cause `css` to be present
182
- * on the types of anything that uses styled-components indirectly, even if they do not use the
183
- * babel plugin.
184
- *
185
- * To enable support for the `css` prop in TypeScript, create a `styled-components.d.ts` file in
186
- * your project source with the following contents:
187
- *
188
- * ```ts
189
- * import type { CSSProp } from "styled-components";
190
- *
191
- * declare module "react" {
192
- * interface Attributes {
193
- * css?: CSSProp;
194
- * }
195
- * }
196
- * ```
197
- *
198
- * In order to get accurate typings for `props.theme` in `css` interpolations, see
199
- * {@link DefaultTheme}.
200
- */
201
- export type CSSProp = Interpolation<any>;
202
- export type NoInfer<T> = [T][T extends any ? 0 : never];
203
- export type Substitute<A extends BaseObject, B extends BaseObject> = FastOmit<A, keyof B> & B;
204
- export type InsertionTarget = HTMLElement | ShadowRoot;
@@ -1 +0,0 @@
1
- export default function addUnitIfNeeded(name: string, value: any): string;
@@ -1 +0,0 @@
1
- export declare const checkDynamicCreation: (displayName: string, componentId?: string | undefined) => void;
@@ -1,3 +0,0 @@
1
- export declare const LIMIT = 200;
2
- declare const _default: (displayName: string, componentId: string) => (className: string) => void;
3
- export default _default;
@@ -1,4 +0,0 @@
1
- import { DefaultTheme, ExecutionProps } from '../types';
2
- export default function determineTheme(props: ExecutionProps, providedTheme?: DefaultTheme | undefined, defaultProps?: {
3
- theme?: DefaultTheme | undefined;
4
- }): DefaultTheme | undefined;
@@ -1,4 +0,0 @@
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" | "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
- export default _default;
4
- export type SupportedHTMLElements = (typeof elements)[number];
@@ -1,3 +0,0 @@
1
- import { Dict } from '../types';
2
- export declare const EMPTY_ARRAY: Readonly<any[]>;
3
- export declare const EMPTY_OBJECT: Readonly<Dict<any>>;
@@ -1,5 +0,0 @@
1
- /**
2
- * Create an error file out of errors.md for development and a simple web link to the full errors
3
- * in production mode.
4
- */
5
- export default function throwStyledComponentsError(code: string | number, ...interpolations: any[]): Error;
@@ -1,21 +0,0 @@
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;
@@ -1,5 +0,0 @@
1
- /**
2
- * TODO: Explore using CSS.escape when it becomes more available
3
- * in evergreen browsers.
4
- */
5
- export default function escape(str: string): string;
@@ -1,4 +0,0 @@
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>;
@@ -1 +0,0 @@
1
- export default function generateAlphabeticName(code: number): string;
@@ -1 +0,0 @@
1
- export default function generateComponentId(str: string): string;
@@ -1,2 +0,0 @@
1
- import { StyledTarget } from '../types';
2
- export default function generateDisplayName(target: StyledTarget<any>): string;
@@ -1,2 +0,0 @@
1
- import { StyledTarget } from '../types';
2
- export default function getComponentName(target: StyledTarget<any>): string;
@@ -1,3 +0,0 @@
1
- export declare const SEED = 5381;
2
- export declare const phash: (h: number, x: string) => number;
3
- export declare const hash: (x: string) => number;
@@ -1,51 +0,0 @@
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 {};
@@ -1,14 +0,0 @@
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;
@@ -1,2 +0,0 @@
1
- import { Interpolation } from '../types';
2
- export default function interleave<Props extends object>(strings: readonly string[], interpolations: Interpolation<Props>[]): Interpolation<Props>[];
@@ -1 +0,0 @@
1
- export default function isFunction(test: any): test is Function;
@@ -1 +0,0 @@
1
- export default function isPlainObject(x: any): x is Record<any, any>;
@@ -1 +0,0 @@
1
- export default function isStatelessFunction(test: any): test is Function;
@@ -1,2 +0,0 @@
1
- import { RuleSet } from '../types';
2
- export default function isStaticRules<Props extends object>(rules: RuleSet<Props>): boolean;
@@ -1,2 +0,0 @@
1
- import { StyledComponentBrand } from '../types';
2
- export default function isStyledComponent(target: any): target is StyledComponentBrand;
@@ -1,2 +0,0 @@
1
- import { StyledTarget } from '../types';
2
- export default function isTag(target: StyledTarget<'web'>): target is string;
@@ -1,5 +0,0 @@
1
- /**
2
- * Convenience function for joining strings to form className chains
3
- */
4
- export declare function joinStrings(a?: string | undefined, b?: string | undefined): string;
5
- export declare function joinStringArray(arr: string[], sep?: string | undefined): string;
@@ -1,6 +0,0 @@
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;
@@ -1 +0,0 @@
1
- export default function getNonce(): string | null;
@@ -1,17 +0,0 @@
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;
@@ -1,10 +0,0 @@
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;