styled-components 6.0.0-beta.11 → 6.0.0-beta.12

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.
@@ -3,18 +3,18 @@ import { Attrs, AttrsArg, ExecutionProps, Interpolation, IStyledComponent, IStyl
3
3
  /**
4
4
  * for types a and b, if b shares a field with a, mark a's field as optional
5
5
  */
6
- declare type OptionalIntersection<A, B> = {
6
+ type OptionalIntersection<A, B> = {
7
7
  [K in Extract<keyof A, keyof B>]?: A[K];
8
8
  };
9
- declare type AttrsResult<T extends Attrs> = T extends (...args: any) => infer P ? P : T;
10
- declare type ExtractAttrsTarget<R extends Runtime, P extends ExecutionProps, DefaultTarget extends StyledTarget<R>> = P['as'] extends KnownTarget ? P['as'] : DefaultTarget;
9
+ type AttrsResult<T extends Attrs> = T extends (...args: any) => infer P ? P : T;
10
+ type ExtractAttrsTarget<R extends Runtime, P extends ExecutionProps, DefaultTarget extends StyledTarget<R>> = P['as'] extends KnownTarget ? P['as'] : DefaultTarget;
11
11
  /**
12
12
  * If attrs type is a function (no type provided, inferring from usage), extract the return value
13
13
  * and merge it with the existing type to hole-punch any required fields that are satisfied as
14
14
  * a result of running attrs. Otherwise if we have a definite type then union the base props
15
15
  * with the passed attr type to capture any intended overrides.
16
16
  */
17
- declare type PropsSatisfiedByAttrs<T extends Attrs, Props extends object, Result extends ExecutionProps = AttrsResult<T>> = Omit<Props, keyof Result> & OptionalIntersection<Props, Result> & Partial<Omit<Result, keyof Props | 'as'>>;
17
+ type PropsSatisfiedByAttrs<T extends Attrs, Props extends object, Result extends ExecutionProps = AttrsResult<T>> = Omit<Props, keyof Result> & OptionalIntersection<Props, Result> & Partial<Omit<Result, keyof Props | 'as'>>;
18
18
  export interface Styled<R extends Runtime, Target extends StyledTarget<R>, OuterProps extends object = object, OuterStatics extends object = object, RuntimeInjectedProps extends ExecutionProps = object> {
19
19
  <Props extends object = object, Statics extends object = object>(initialStyles: Styles<OuterProps & RuntimeInjectedProps & Props>, ...interpolations: Interpolation<OuterProps & RuntimeInjectedProps & Props>[]): // @ts-expect-error KnownTarget is a subset of StyledTarget<R>
20
20
  IStyledComponent<R, ExtractAttrsTarget<R, RuntimeInjectedProps, Target>, OuterProps & Props> & OuterStatics & Statics;
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
2
  import { AnyComponent, ExecutionProps } from '../types';
3
- export default function withTheme<T extends AnyComponent>(Component: T): React.ForwardRefExoticComponent<React.PropsWithoutRef<JSX.LibraryManagedAttributes<T, ExecutionProps>> & React.RefAttributes<T>> & { [key in Exclude<keyof T, T extends React.MemoExoticComponent<any> ? "propTypes" | "defaultProps" | "displayName" | "$$typeof" | "type" | "compare" : T extends React.ForwardRefExoticComponent<any> ? "propTypes" | "defaultProps" | "displayName" | "$$typeof" | "render" : "length" | "propTypes" | "contextType" | "contextTypes" | "childContextTypes" | "defaultProps" | "displayName" | "getDerivedStateFromProps" | "getDerivedStateFromError" | "type" | "getDefaultProps" | "mixins" | "name" | "prototype" | "caller" | "callee" | "arguments" | "arity">]: T[key]; };
3
+ export default function withTheme<T extends AnyComponent>(Component: T): React.ForwardRefExoticComponent<React.PropsWithoutRef<JSX.LibraryManagedAttributes<T, ExecutionProps>> & React.RefAttributes<T>> & { [key in Exclude<keyof T, T extends React.MemoExoticComponent<any> ? "propTypes" | "type" | "defaultProps" | "displayName" | "$$typeof" | "compare" : T extends React.ForwardRefExoticComponent<any> ? "propTypes" | "defaultProps" | "displayName" | "$$typeof" | "render" : "length" | "propTypes" | "type" | "contextType" | "contextTypes" | "childContextTypes" | "defaultProps" | "displayName" | "getDerivedStateFromProps" | "getDerivedStateFromError" | "getDefaultProps" | "mixins" | "name" | "prototype" | "caller" | "callee" | "arguments" | "arity">]: T[key]; };
@@ -1,13 +1,13 @@
1
1
  import React from 'react';
2
2
  import StyleSheet from '../sheet';
3
3
  import { ShouldForwardProp, Stringifier } from '../types';
4
- export declare type IStyleSheetContext = {
4
+ export type IStyleSheetContext = {
5
5
  shouldForwardProp?: ShouldForwardProp<'web'>;
6
6
  styleSheet?: StyleSheet;
7
7
  };
8
8
  export declare const StyleSheetContext: React.Context<IStyleSheetContext>;
9
9
  export declare const StyleSheetConsumer: React.Consumer<IStyleSheetContext>;
10
- export declare type IStylisContext = Stringifier | void;
10
+ export type IStylisContext = Stringifier | void;
11
11
  export declare const StylisContext: React.Context<IStylisContext>;
12
12
  export declare const StylisConsumer: React.Consumer<IStylisContext>;
13
13
  export declare const mainSheet: StyleSheet;
@@ -15,7 +15,7 @@ export declare const mainStylis: Stringifier;
15
15
  export declare function useShouldForwardProp(): ShouldForwardProp<"web"> | undefined;
16
16
  export declare function useStyleSheet(): StyleSheet;
17
17
  export declare function useStylis(): Stringifier;
18
- export declare type IStyleSheetManager = React.PropsWithChildren<{
18
+ export type IStyleSheetManager = React.PropsWithChildren<{
19
19
  /**
20
20
  * If desired, you can pass this prop to disable "speedy" insertion mode, which
21
21
  * uses the browser [CSSOM APIs](https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleSheet).
@@ -24,9 +24,9 @@ import React from 'react';
24
24
  export interface DefaultTheme {
25
25
  [key: string]: any;
26
26
  }
27
- declare type ThemeFn = (outerTheme?: DefaultTheme) => DefaultTheme;
28
- declare type ThemeArgument = DefaultTheme | ThemeFn;
29
- declare type Props = {
27
+ type ThemeFn = (outerTheme?: DefaultTheme) => DefaultTheme;
28
+ type ThemeArgument = DefaultTheme | ThemeFn;
29
+ type Props = {
30
30
  children?: React.ReactNode;
31
31
  theme: ThemeArgument;
32
32
  };
@@ -1,13 +1,13 @@
1
1
  import { GroupedTag, Sheet, SheetOptions } from './types';
2
- declare type SheetConstructorArgs = {
2
+ type SheetConstructorArgs = {
3
3
  isServer?: boolean;
4
4
  useCSSOMInjection?: boolean;
5
5
  target?: HTMLElement;
6
6
  };
7
- declare type GlobalStylesAllocationMap = {
7
+ type GlobalStylesAllocationMap = {
8
8
  [key: string]: number;
9
9
  };
10
- declare type NamesAllocationMap = Map<string, Set<string>>;
10
+ type NamesAllocationMap = Map<string, Set<string>>;
11
11
  /** Contains the main stylesheet logic for stringification and caching */
12
12
  export default class StyleSheet implements Sheet {
13
13
  gs: GlobalStylesAllocationMap;
@@ -14,7 +14,7 @@ export interface GroupedTag {
14
14
  length: number;
15
15
  tag: Tag;
16
16
  }
17
- export declare type SheetOptions = {
17
+ export type SheetOptions = {
18
18
  isServer: boolean;
19
19
  target?: HTMLElement;
20
20
  useCSSOMInjection: boolean;
@@ -18,7 +18,7 @@ var SC_ATTR = (typeof process !== 'undefined' && typeof process.env !== 'undefin
18
18
  'data-styled';
19
19
  var SC_ATTR_ACTIVE = 'active';
20
20
  var SC_ATTR_VERSION = 'data-styled-version';
21
- var SC_VERSION = "6.0.0-beta.11";
21
+ var SC_VERSION = "6.0.0-beta.12";
22
22
  var SPLITTER = '/*!sc*/\n';
23
23
  var IS_BROWSER = typeof window !== 'undefined' && 'HTMLElement' in window;
24
24
  var DISABLE_SPEEDY = Boolean(typeof SC_DISABLE_SPEEDY === 'boolean'
@@ -8,7 +8,7 @@ var SC_ATTR = (typeof process !== 'undefined' && typeof process.env !== 'undefin
8
8
  'data-styled';
9
9
  var SC_ATTR_ACTIVE = 'active';
10
10
  var SC_ATTR_VERSION = 'data-styled-version';
11
- var SC_VERSION = "6.0.0-beta.11";
11
+ var SC_VERSION = "6.0.0-beta.12";
12
12
  var SPLITTER = '/*!sc*/\n';
13
13
  var IS_BROWSER = typeof window !== 'undefined' && 'HTMLElement' in window;
14
14
  var DISABLE_SPEEDY = Boolean(typeof SC_DISABLE_SPEEDY === 'boolean'
@@ -18,7 +18,7 @@ var SC_ATTR = (typeof process !== 'undefined' && typeof process.env !== 'undefin
18
18
  'data-styled';
19
19
  var SC_ATTR_ACTIVE = 'active';
20
20
  var SC_ATTR_VERSION = 'data-styled-version';
21
- var SC_VERSION = "6.0.0-beta.11";
21
+ var SC_VERSION = "6.0.0-beta.12";
22
22
  var SPLITTER = '/*!sc*/\n';
23
23
  var IS_BROWSER = typeof undefined !== 'undefined' ;
24
24
  var DISABLE_SPEEDY = Boolean(typeof SC_DISABLE_SPEEDY === 'boolean'
@@ -8,7 +8,7 @@ var SC_ATTR = (typeof process !== 'undefined' && typeof process.env !== 'undefin
8
8
  'data-styled';
9
9
  var SC_ATTR_ACTIVE = 'active';
10
10
  var SC_ATTR_VERSION = 'data-styled-version';
11
- var SC_VERSION = "6.0.0-beta.11";
11
+ var SC_VERSION = "6.0.0-beta.12";
12
12
  var SPLITTER = '/*!sc*/\n';
13
13
  var IS_BROWSER = typeof undefined !== 'undefined' ;
14
14
  var DISABLE_SPEEDY = Boolean(typeof SC_DISABLE_SPEEDY === 'boolean'
@@ -8,7 +8,7 @@
8
8
  'data-styled';
9
9
  var SC_ATTR_ACTIVE = 'active';
10
10
  var SC_ATTR_VERSION = 'data-styled-version';
11
- var SC_VERSION = "6.0.0-beta.11";
11
+ var SC_VERSION = "6.0.0-beta.12";
12
12
  var SPLITTER = '/*!sc*/\n';
13
13
  var IS_BROWSER = typeof window !== 'undefined' && 'HTMLElement' in window;
14
14
  var DISABLE_SPEEDY = Boolean(typeof SC_DISABLE_SPEEDY === 'boolean'
@@ -1438,10 +1438,6 @@
1438
1438
 
1439
1439
  var secondary = /*#__PURE__*/Object.freeze({
1440
1440
  __proto__: null,
1441
- createGlobalStyle: createGlobalStyle,
1442
- css: css,
1443
- isStyledComponent: isStyledComponent,
1444
- keyframes: keyframes,
1445
1441
  ServerStyleSheet: ServerStyleSheet,
1446
1442
  StyleSheetConsumer: StyleSheetConsumer,
1447
1443
  StyleSheetContext: StyleSheetContext,
@@ -1449,10 +1445,14 @@
1449
1445
  ThemeConsumer: ThemeConsumer,
1450
1446
  ThemeContext: ThemeContext,
1451
1447
  ThemeProvider: ThemeProvider,
1448
+ __PRIVATE__: __PRIVATE__,
1449
+ createGlobalStyle: createGlobalStyle,
1450
+ css: css,
1451
+ isStyledComponent: isStyledComponent,
1452
+ keyframes: keyframes,
1452
1453
  useTheme: useTheme,
1453
1454
  version: SC_VERSION,
1454
- withTheme: withTheme,
1455
- __PRIVATE__: __PRIVATE__
1455
+ withTheme: withTheme
1456
1456
  });
1457
1457
 
1458
1458
  var LIMIT = 200;