styled-components 6.2.0 → 6.2.1-prerelease.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 (98) 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 +165 -100
  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/hoc/withTheme.spec.d.ts +1 -0
  17. package/native/dist/dist/index.d.ts +2 -2
  18. package/native/dist/dist/models/ComponentStyle.d.ts +4 -1
  19. package/native/dist/dist/sheet/Tag.d.ts +4 -4
  20. package/native/dist/dist/test/utils.d.ts +33 -14
  21. package/native/dist/dist/types.d.ts +11 -3
  22. package/native/dist/dist/utils/domElements.d.ts +2 -2
  23. package/native/dist/dist/utils/isRSC.d.ts +11 -0
  24. package/native/dist/hoc/withTheme.spec.d.ts +1 -0
  25. package/native/dist/index.d.ts +2 -2
  26. package/native/dist/models/ComponentStyle.d.ts +4 -1
  27. package/native/dist/sheet/Tag.d.ts +4 -4
  28. package/native/dist/styled-components.native.cjs.js +1 -1
  29. package/native/dist/styled-components.native.cjs.js.map +1 -1
  30. package/native/dist/styled-components.native.esm.js +1 -1
  31. package/native/dist/styled-components.native.esm.js.map +1 -1
  32. package/native/dist/test/utils.d.ts +32 -13
  33. package/native/dist/types.d.ts +11 -3
  34. package/native/dist/utils/domElements.d.ts +2 -2
  35. package/native/dist/utils/isRSC.d.ts +11 -0
  36. package/package.json +6 -6
  37. package/dist/base.d.ts +0 -12
  38. package/dist/constants.d.ts +0 -8
  39. package/dist/constructors/constructWithOptions.d.ts +0 -17
  40. package/dist/constructors/createGlobalStyle.d.ts +0 -3
  41. package/dist/constructors/css.d.ts +0 -4
  42. package/dist/constructors/keyframes.d.ts +0 -3
  43. package/dist/constructors/styled.d.ts +0 -17
  44. package/dist/hoc/withTheme.d.ts +0 -4
  45. package/dist/index-standalone.d.ts +0 -2
  46. package/dist/index.d.ts +0 -4
  47. package/dist/models/ComponentStyle.d.ts +0 -15
  48. package/dist/models/GlobalStyle.d.ts +0 -11
  49. package/dist/models/InlineStyle.d.ts +0 -7
  50. package/dist/models/Keyframes.d.ts +0 -10
  51. package/dist/models/ServerStyleSheet.d.ts +0 -15
  52. package/dist/models/StyleSheetManager.d.ts +0 -65
  53. package/dist/models/StyledComponent.d.ts +0 -3
  54. package/dist/models/StyledNativeComponent.d.ts +0 -3
  55. package/dist/models/ThemeProvider.d.ts +0 -47
  56. package/dist/native/index.d.ts +0 -19
  57. package/dist/secretInternals.d.ts +0 -5
  58. package/dist/sheet/GroupIDAllocator.d.ts +0 -4
  59. package/dist/sheet/GroupedTag.d.ts +0 -11
  60. package/dist/sheet/Rehydration.d.ts +0 -3
  61. package/dist/sheet/Sheet.d.ts +0 -40
  62. package/dist/sheet/Tag.d.ts +0 -55
  63. package/dist/sheet/dom.d.ts +0 -5
  64. package/dist/sheet/index.d.ts +0 -1
  65. package/dist/sheet/types.d.ts +0 -36
  66. package/dist/test/globals.d.ts +0 -2
  67. package/dist/test/utils.d.ts +0 -144
  68. package/dist/test/veryLargeUnionType.d.ts +0 -1
  69. package/dist/types.d.ts +0 -204
  70. package/dist/utils/addUnitIfNeeded.d.ts +0 -1
  71. package/dist/utils/checkDynamicCreation.d.ts +0 -1
  72. package/dist/utils/createWarnTooManyClasses.d.ts +0 -3
  73. package/dist/utils/determineTheme.d.ts +0 -4
  74. package/dist/utils/domElements.d.ts +0 -4
  75. package/dist/utils/empties.d.ts +0 -3
  76. package/dist/utils/error.d.ts +0 -5
  77. package/dist/utils/errors.d.ts +0 -21
  78. package/dist/utils/escape.d.ts +0 -5
  79. package/dist/utils/flatten.d.ts +0 -4
  80. package/dist/utils/generateAlphabeticName.d.ts +0 -1
  81. package/dist/utils/generateComponentId.d.ts +0 -1
  82. package/dist/utils/generateDisplayName.d.ts +0 -2
  83. package/dist/utils/getComponentName.d.ts +0 -2
  84. package/dist/utils/hash.d.ts +0 -3
  85. package/dist/utils/hoist.d.ts +0 -51
  86. package/dist/utils/hyphenateStyleName.d.ts +0 -14
  87. package/dist/utils/interleave.d.ts +0 -2
  88. package/dist/utils/isFunction.d.ts +0 -1
  89. package/dist/utils/isPlainObject.d.ts +0 -1
  90. package/dist/utils/isStatelessFunction.d.ts +0 -1
  91. package/dist/utils/isStaticRules.d.ts +0 -2
  92. package/dist/utils/isStyledComponent.d.ts +0 -2
  93. package/dist/utils/isTag.d.ts +0 -2
  94. package/dist/utils/joinStrings.d.ts +0 -5
  95. package/dist/utils/mixinDeep.d.ts +0 -6
  96. package/dist/utils/nonce.d.ts +0 -1
  97. package/dist/utils/setToString.d.ts +0 -17
  98. package/dist/utils/stylis.d.ts +0 -10
@@ -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;