@compiled/react 0.11.1 → 0.11.3

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 (103) hide show
  1. package/dist/browser/class-names/index.d.ts +2 -2
  2. package/dist/browser/class-names/index.js.flow +1 -2
  3. package/dist/browser/css/index.js.flow +1 -1
  4. package/dist/browser/index.js.flow +1 -1
  5. package/dist/browser/jsx/jsx-local-namespace.d.ts +9 -9
  6. package/dist/browser/keyframes/index.d.ts +1 -1
  7. package/dist/browser/keyframes/index.js.flow +1 -1
  8. package/dist/browser/runtime/ax.js +2 -2
  9. package/dist/browser/runtime/ax.js.flow +1 -1
  10. package/dist/browser/runtime/ax.js.map +1 -1
  11. package/dist/browser/runtime/cache.js.flow +1 -1
  12. package/dist/browser/runtime/css-custom-property.js.flow +1 -1
  13. package/dist/browser/runtime/dev-warnings.js.flow +1 -1
  14. package/dist/browser/runtime/index.js.flow +1 -1
  15. package/dist/browser/runtime/is-server-environment.js.flow +1 -1
  16. package/dist/browser/runtime/sheet.js.flow +1 -1
  17. package/dist/browser/runtime/style-cache.js.flow +1 -1
  18. package/dist/browser/runtime/style.js.flow +1 -2
  19. package/dist/browser/runtime/types.d.ts +3 -3
  20. package/dist/browser/runtime/types.js.flow +1 -1
  21. package/dist/browser/runtime.js.flow +1 -1
  22. package/dist/browser/styled/index.d.ts +5 -5
  23. package/dist/browser/styled/index.js.flow +3 -5
  24. package/dist/browser/styled/index.js.map +1 -1
  25. package/dist/browser/types.d.ts +5 -5
  26. package/dist/browser/types.js.flow +1 -2
  27. package/dist/browser/utils/error.js.flow +1 -1
  28. package/dist/cjs/class-names/index.d.ts +2 -2
  29. package/dist/cjs/class-names/index.js.flow +1 -2
  30. package/dist/cjs/css/index.js.flow +1 -1
  31. package/dist/cjs/index.js.flow +1 -1
  32. package/dist/cjs/jsx/jsx-local-namespace.d.ts +9 -9
  33. package/dist/cjs/keyframes/index.d.ts +1 -1
  34. package/dist/cjs/keyframes/index.js.flow +1 -1
  35. package/dist/cjs/runtime/ax.js +2 -2
  36. package/dist/cjs/runtime/ax.js.flow +1 -1
  37. package/dist/cjs/runtime/ax.js.map +1 -1
  38. package/dist/cjs/runtime/cache.js.flow +1 -1
  39. package/dist/cjs/runtime/css-custom-property.js.flow +1 -1
  40. package/dist/cjs/runtime/dev-warnings.js.flow +1 -1
  41. package/dist/cjs/runtime/index.js.flow +1 -1
  42. package/dist/cjs/runtime/is-server-environment.js.flow +1 -1
  43. package/dist/cjs/runtime/sheet.js.flow +1 -1
  44. package/dist/cjs/runtime/style-cache.js.flow +1 -1
  45. package/dist/cjs/runtime/style.js.flow +1 -2
  46. package/dist/cjs/runtime/types.d.ts +3 -3
  47. package/dist/cjs/runtime/types.js.flow +1 -1
  48. package/dist/cjs/runtime.js.flow +1 -1
  49. package/dist/cjs/styled/index.d.ts +5 -5
  50. package/dist/cjs/styled/index.js.flow +3 -5
  51. package/dist/cjs/styled/index.js.map +1 -1
  52. package/dist/cjs/types.d.ts +5 -5
  53. package/dist/cjs/types.js.flow +1 -2
  54. package/dist/cjs/utils/error.js.flow +1 -1
  55. package/dist/esm/class-names/index.d.ts +2 -2
  56. package/dist/esm/class-names/index.js.flow +1 -2
  57. package/dist/esm/css/index.js.flow +1 -1
  58. package/dist/esm/index.js.flow +1 -1
  59. package/dist/esm/jsx/jsx-local-namespace.d.ts +9 -9
  60. package/dist/esm/keyframes/index.d.ts +1 -1
  61. package/dist/esm/keyframes/index.js.flow +1 -1
  62. package/dist/esm/runtime/ax.js +2 -2
  63. package/dist/esm/runtime/ax.js.flow +1 -1
  64. package/dist/esm/runtime/ax.js.map +1 -1
  65. package/dist/esm/runtime/cache.js.flow +1 -1
  66. package/dist/esm/runtime/css-custom-property.js.flow +1 -1
  67. package/dist/esm/runtime/dev-warnings.js.flow +1 -1
  68. package/dist/esm/runtime/index.js.flow +1 -1
  69. package/dist/esm/runtime/is-server-environment.js.flow +1 -1
  70. package/dist/esm/runtime/sheet.js.flow +1 -1
  71. package/dist/esm/runtime/style-cache.js.flow +1 -1
  72. package/dist/esm/runtime/style.js.flow +1 -2
  73. package/dist/esm/runtime/types.d.ts +3 -3
  74. package/dist/esm/runtime/types.js.flow +1 -1
  75. package/dist/esm/runtime.js.flow +1 -1
  76. package/dist/esm/styled/index.d.ts +5 -5
  77. package/dist/esm/styled/index.js.flow +3 -5
  78. package/dist/esm/styled/index.js.map +1 -1
  79. package/dist/esm/types.d.ts +5 -5
  80. package/dist/esm/types.js.flow +1 -2
  81. package/dist/esm/utils/error.js.flow +1 -1
  82. package/package.json +3 -3
  83. package/src/class-names/index.js.flow +1 -2
  84. package/src/css/index.js.flow +1 -1
  85. package/src/index.js.flow +1 -1
  86. package/src/keyframes/index.js.flow +1 -1
  87. package/src/runtime/__tests__/ax.test.ts +20 -2
  88. package/src/runtime/ax.js.flow +1 -1
  89. package/src/runtime/ax.ts +2 -2
  90. package/src/runtime/cache.js.flow +1 -1
  91. package/src/runtime/css-custom-property.js.flow +1 -1
  92. package/src/runtime/dev-warnings.js.flow +1 -1
  93. package/src/runtime/index.js.flow +1 -1
  94. package/src/runtime/is-server-environment.js.flow +1 -1
  95. package/src/runtime/sheet.js.flow +1 -1
  96. package/src/runtime/style-cache.js.flow +1 -1
  97. package/src/runtime/style.js.flow +1 -2
  98. package/src/runtime/types.js.flow +1 -1
  99. package/src/runtime.js.flow +1 -1
  100. package/src/styled/index.js.flow +3 -5
  101. package/src/styled/index.ts +2 -4
  102. package/src/types.js.flow +1 -2
  103. package/src/utils/error.js.flow +1 -1
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Flowtype definitions for index
3
3
  * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.17.0
4
+ * Flowgen v1.20.1
5
5
  * @flow
6
6
  */
7
7
  import type { ComponentType } from 'react';
@@ -14,7 +14,7 @@ export type StyledProps = {
14
14
  };
15
15
  export type ObjectInterpolation<TProps> = CssType<TProps> | CssType<TProps>[];
16
16
  export type TemplateStringsInterpolation<TProps> = CssFunction<TProps> | CssFunction<TProps>[];
17
- export interface StyledComponent<ComponentProps: mixed> {
17
+ export interface StyledComponent<ComponentProps> {
18
18
  <TProps>(
19
19
  ...css: ObjectInterpolation<TProps>[]
20
20
  ): React$ComponentType<{ ...TProps, ...ComponentProps, ...StyledProps }>;
@@ -25,9 +25,7 @@ export interface StyledComponent<ComponentProps: mixed> {
25
25
  }
26
26
  export type StyledComponentMap = $ObjMapi<$JSXIntrinsics, <Tag>(Tag) => StyledComponent<mixed>>;
27
27
  export type CreateStyledComponent = {
28
- <TInheritedProps: mixed>(
29
- Component: ComponentType<TInheritedProps>
30
- ): StyledComponent<TInheritedProps>,
28
+ <TInheritedProps>(Component: ComponentType<TInheritedProps>): StyledComponent<TInheritedProps>,
31
29
  ...
32
30
  } & StyledComponentMap;
33
31
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/styled/index.ts"],"names":[],"mappings":";;;AAGA,wCAAkD;AAsClD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACU,QAAA,MAAM,GAA0B,IAAI,KAAK,CACpD,EAAE,EACF;IACE,GAAG;QACD,OAAO;YACL,8CAA8C;YAC9C,yDAAyD;YACzD,MAAM,IAAA,wBAAgB,GAAE,CAAC;QAC3B,CAAC,CAAC;IACJ,CAAC;CACF,CACK,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/styled/index.ts"],"names":[],"mappings":";;;AAGA,wCAAkD;AAoClD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACU,QAAA,MAAM,GAA0B,IAAI,KAAK,CACpD,EAAE,EACF;IACE,GAAG;QACD,OAAO;YACL,8CAA8C;YAC9C,yDAAyD;YACzD,MAAM,IAAA,wBAAgB,GAAE,CAAC;QAC3B,CAAC,CAAC;IACJ,CAAC;CACF,CACK,CAAC"}
@@ -2,19 +2,19 @@ import type * as CSS from 'csstype';
2
2
  /**
3
3
  * Typing for the interpolations.
4
4
  */
5
- export declare type BasicTemplateInterpolations = string | number;
5
+ export type BasicTemplateInterpolations = string | number;
6
6
  export interface FunctionInterpolation<TProps> {
7
7
  (props: TProps): CssFunction<TProps>;
8
8
  }
9
9
  /**
10
10
  * Possible types for a CSS value
11
11
  */
12
- export declare type CssType<TProps> = CSSProps<TProps> | CssObject<TProps> | FunctionInterpolation<TProps> | string;
12
+ export type CssType<TProps> = CSSProps<TProps> | CssObject<TProps> | FunctionInterpolation<TProps> | string;
13
13
  /**
14
14
  * These are all the CSS props that will exist.
15
15
  */
16
- export declare type CSSProps<TProps> = CSS.Properties<CssFunction<TProps>>;
17
- export declare type CssObject<TProps> = {
16
+ export type CSSProps<TProps> = CSS.Properties<CssFunction<TProps>>;
17
+ export type CssObject<TProps> = {
18
18
  [key: string]: CssFunction<TProps>;
19
19
  };
20
- export declare type CssFunction<TProps = unknown> = CssType<TProps> | BasicTemplateInterpolations | boolean | undefined;
20
+ export type CssFunction<TProps = unknown> = CssType<TProps> | BasicTemplateInterpolations | boolean | undefined;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Flowtype definitions for types
3
3
  * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.17.0
4
+ * Flowgen v1.20.1
5
5
  * @flow
6
6
  */
7
7
  import * as CSS from 'csstype';
@@ -23,7 +23,6 @@ export type CSSProps<TProps> = CSS.Properties<CssFunction<TProps>>;
23
23
  export type CssObject<TProps> = {
24
24
  ...CSSProps<TProps>,
25
25
  [key: string]: CssFunction<TProps>,
26
- ...
27
26
  };
28
27
  export type CssFunction<TProps = mixed> =
29
28
  | CssType<TProps>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Flowtype definitions for error
3
3
  * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.17.0
4
+ * Flowgen v1.20.1
5
5
  * @flow
6
6
  */
7
7
  declare export var createSetupError: () => Error;
@@ -1,7 +1,7 @@
1
1
  import type { ReactNode, CSSProperties } from 'react';
2
2
  import type { CssType, CssFunction } from '../types';
3
- export declare type ObjectInterpolation<TProps> = CssType<TProps> | CssType<TProps>[];
4
- export declare type TemplateStringsInterpolation<TProps> = CssFunction<TProps> | CssFunction<TProps>[];
3
+ export type ObjectInterpolation<TProps> = CssType<TProps> | CssType<TProps>[];
4
+ export type TemplateStringsInterpolation<TProps> = CssFunction<TProps> | CssFunction<TProps>[];
5
5
  interface CssSignature<TProps> {
6
6
  (...interpolations: ObjectInterpolation<TProps>[]): string;
7
7
  (template: TemplateStringsArray, ...interpolations: TemplateStringsInterpolation<TProps>[]): string;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Flowtype definitions for index
3
3
  * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.17.0
4
+ * Flowgen v1.20.1
5
5
  * @flow
6
6
  */
7
7
  import type { Node } from 'react';
@@ -51,4 +51,3 @@ export interface ClassNamesProps<TProps> {
51
51
  * ```
52
52
  */
53
53
  declare export function ClassNames<TProps>(x: ClassNamesProps<TProps>): React$Node;
54
- declare export {};
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Flowtype definitions for index
3
3
  * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.17.0
4
+ * Flowgen v1.20.1
5
5
  * @flow
6
6
  */
7
7
  import type { CSSProps, CssObject, CssFunction } from '../types';
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Flowtype definitions for index
3
3
  * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.17.0
4
+ * Flowgen v1.20.1
5
5
  * @flow
6
6
  */
7
7
  import type { CssFunction, CSSProps, CssType } from './types';
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import type { CssFunction } from '../types';
3
- declare type WithConditionalCSSProp<TProps> = 'className' extends keyof TProps ? string extends TProps['className' & keyof TProps] ? {
3
+ type WithConditionalCSSProp<TProps> = 'className' extends keyof TProps ? string extends TProps['className' & keyof TProps] ? {
4
4
  /**
5
5
  * ## CSS prop
6
6
  *
@@ -41,14 +41,14 @@ declare type WithConditionalCSSProp<TProps> = 'className' extends keyof TProps ?
41
41
  */
42
42
  css?: CssFunction<void> | CssFunction<void>[];
43
43
  } : {} : {};
44
- declare type ReactJSXElement = JSX.Element;
45
- declare type ReactJSXElementClass = JSX.ElementClass;
46
- declare type ReactJSXElementAttributesProperty = JSX.ElementAttributesProperty;
47
- declare type ReactJSXElementChildrenAttribute = JSX.ElementChildrenAttribute;
48
- declare type ReactJSXLibraryManagedAttributes<C, P> = JSX.LibraryManagedAttributes<C, P>;
49
- declare type ReactJSXIntrinsicAttributes = JSX.IntrinsicAttributes;
50
- declare type ReactJSXIntrinsicClassAttributes<T> = JSX.IntrinsicClassAttributes<T>;
51
- declare type ReactJSXIntrinsicElements = JSX.IntrinsicElements;
44
+ type ReactJSXElement = JSX.Element;
45
+ type ReactJSXElementClass = JSX.ElementClass;
46
+ type ReactJSXElementAttributesProperty = JSX.ElementAttributesProperty;
47
+ type ReactJSXElementChildrenAttribute = JSX.ElementChildrenAttribute;
48
+ type ReactJSXLibraryManagedAttributes<C, P> = JSX.LibraryManagedAttributes<C, P>;
49
+ type ReactJSXIntrinsicAttributes = JSX.IntrinsicAttributes;
50
+ type ReactJSXIntrinsicClassAttributes<T> = JSX.IntrinsicClassAttributes<T>;
51
+ type ReactJSXIntrinsicElements = JSX.IntrinsicElements;
52
52
  export declare namespace CompiledJSX {
53
53
  type Element = ReactJSXElement;
54
54
  type ElementClass = ReactJSXElementClass;
@@ -1,5 +1,5 @@
1
1
  import type { BasicTemplateInterpolations, CSSProps } from '../types';
2
- export declare type KeyframeSteps = string | Record<string, CSSProps<void>>;
2
+ export type KeyframeSteps = string | Record<string, CSSProps<void>>;
3
3
  /**
4
4
  * ## Keyframes
5
5
  *
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Flowtype definitions for index
3
3
  * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.17.0
4
+ * Flowgen v1.20.1
5
5
  * @flow
6
6
  */
7
7
  import type { BasicTemplateInterpolations, CSSProps } from '../types';
@@ -26,8 +26,8 @@ var ATOMIC_GROUP_LENGTH = 5;
26
26
  * @param classes
27
27
  */
28
28
  export default function ax(classNames) {
29
- if (classNames.length <= 1) {
30
- // short circuit if theres no custom class names.
29
+ if (classNames.length <= 1 && (!classNames[0] || classNames[0].indexOf(' ') === -1)) {
30
+ // short circuit if there's no custom class names.
31
31
  return classNames[0] || undefined;
32
32
  }
33
33
  var atomicGroups = {};
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Flowtype definitions for ax
3
3
  * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.17.0
4
+ * Flowgen v1.20.1
5
5
  * @flow
6
6
  */
7
7
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"ax.js","sourceRoot":"","sources":["../../../src/runtime/ax.ts"],"names":[],"mappings":"AAAA,IAAM,kBAAkB,GAAG,EAAE,CAAC;AAE9B;;;GAGG;AACH,IAAM,mBAAmB,GAAG,CAAC,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,OAAO,UAAU,EAAE,CAAC,UAA0C;IACnE,IAAI,UAAU,CAAC,MAAM,IAAI,CAAC,EAAE;QAC1B,iDAAiD;QACjD,OAAO,UAAU,CAAC,CAAC,CAAC,IAAI,SAAS,CAAC;KACnC;IAED,IAAM,YAAY,GAA2B,EAAE,CAAC;IAEhD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QAC1C,IAAM,GAAG,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;QAC1B,IAAI,CAAC,GAAG,EAAE;YACR,SAAS;SACV;QAED,IAAM,MAAM,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAE9B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACtC,IAAM,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;YACzB,IAAM,eAAe,GAAG,MAAM,CAAC,KAAK,CAClC,CAAC,EACD,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,kBAAkB,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,SAAS,CAC9E,CAAC;YACF,YAAY,CAAC,eAAe,CAAC,GAAG,MAAM,CAAC;SACxC;KACF;IAED,IAAI,GAAG,GAAG,EAAE,CAAC;IAEb,KAAK,IAAM,GAAG,IAAI,YAAY,EAAE;QAC9B,IAAM,KAAK,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;QAChC,GAAG,IAAI,KAAK,GAAG,GAAG,CAAC;KACpB;IAED,OAAO,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAC1B,CAAC"}
1
+ {"version":3,"file":"ax.js","sourceRoot":"","sources":["../../../src/runtime/ax.ts"],"names":[],"mappings":"AAAA,IAAM,kBAAkB,GAAG,EAAE,CAAC;AAE9B;;;GAGG;AACH,IAAM,mBAAmB,GAAG,CAAC,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,OAAO,UAAU,EAAE,CAAC,UAA0C;IACnE,IAAI,UAAU,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;QACnF,kDAAkD;QAClD,OAAO,UAAU,CAAC,CAAC,CAAC,IAAI,SAAS,CAAC;KACnC;IAED,IAAM,YAAY,GAA2B,EAAE,CAAC;IAEhD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QAC1C,IAAM,GAAG,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;QAC1B,IAAI,CAAC,GAAG,EAAE;YACR,SAAS;SACV;QAED,IAAM,MAAM,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAE9B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACtC,IAAM,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;YACzB,IAAM,eAAe,GAAG,MAAM,CAAC,KAAK,CAClC,CAAC,EACD,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,kBAAkB,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,SAAS,CAC9E,CAAC;YACF,YAAY,CAAC,eAAe,CAAC,GAAG,MAAM,CAAC;SACxC;KACF;IAED,IAAI,GAAG,GAAG,EAAE,CAAC;IAEb,KAAK,IAAM,GAAG,IAAI,YAAY,EAAE;QAC9B,IAAM,KAAK,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;QAChC,GAAG,IAAI,KAAK,GAAG,GAAG,CAAC;KACpB;IAED,OAAO,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAC1B,CAAC"}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Flowtype definitions for cache
3
3
  * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.17.0
4
+ * Flowgen v1.20.1
5
5
  * @flow
6
6
  */
7
7
  /**
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Flowtype definitions for css-custom-property
3
3
  * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.17.0
4
+ * Flowgen v1.20.1
5
5
  * @flow
6
6
  */
7
7
  /**
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Flowtype definitions for dev-warnings
3
3
  * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.17.0
4
+ * Flowgen v1.20.1
5
5
  * @flow
6
6
  */
7
7
  declare export var analyzeCssInDev: (sheet: string) => void;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Flowtype definitions for index
3
3
  * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.17.0
4
+ * Flowgen v1.20.1
5
5
  * @flow
6
6
  */
7
7
  declare export { default as CS } from './style';
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Flowtype definitions for is-server-environment
3
3
  * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.17.0
4
+ * Flowgen v1.20.1
5
5
  * @flow
6
6
  */
7
7
  /**
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Flowtype definitions for sheet
3
3
  * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.17.0
4
+ * Flowgen v1.20.1
5
5
  * @flow
6
6
  */
7
7
  import type { Bucket, StyleSheetOpts } from './types';
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Flowtype definitions for style-cache
3
3
  * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.17.0
4
+ * Flowgen v1.20.1
5
5
  * @flow
6
6
  */
7
7
  import type { ProviderComponent, UseCacheHook } from './types';
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Flowtype definitions for style
3
3
  * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.17.0
4
+ * Flowgen v1.20.1
5
5
  * @flow
6
6
  */
7
7
  import type { StyleSheetOpts } from './types';
@@ -14,4 +14,3 @@ declare type StyleProps = {
14
14
  ...
15
15
  } & StyleSheetOpts;
16
16
  declare export default function Style(props: StyleProps): React$Node | null;
17
- declare export {};
@@ -10,8 +10,8 @@ export interface StyleSheetOpts {
10
10
  /**
11
11
  * Buckets under which we will group our stylesheets
12
12
  */
13
- export declare type Bucket = '' | 'l' | 'v' | 'w' | 'f' | 'i' | 'h' | 'a' | 'm';
14
- export declare type UseCacheHook = () => Record<string, true>;
15
- export declare type ProviderComponent = (props: {
13
+ export type Bucket = '' | 'l' | 'v' | 'w' | 'f' | 'i' | 'h' | 'a' | 'm';
14
+ export type UseCacheHook = () => Record<string, true>;
15
+ export type ProviderComponent = (props: {
16
16
  children: JSX.Element[] | JSX.Element;
17
17
  }) => JSX.Element;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Flowtype definitions for types
3
3
  * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.17.0
4
+ * Flowgen v1.20.1
5
5
  * @flow
6
6
  */
7
7
  export interface StyleSheetOpts {
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Flowtype definitions for runtime
3
3
  * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.17.0
4
+ * Flowgen v1.20.1
5
5
  * @flow
6
6
  */
7
7
  declare export { CC, CS, ax, ix } from './runtime/index';
@@ -6,17 +6,17 @@ import type { CssType, CssFunction } from '../types';
6
6
  export interface StyledProps {
7
7
  as?: keyof JSX.IntrinsicElements;
8
8
  }
9
- export declare type ObjectInterpolation<TProps> = CssType<TProps> | CssType<TProps>[];
10
- export declare type TemplateStringsInterpolation<TProps> = CssFunction<TProps> | CssFunction<TProps>[];
11
- export interface StyledComponent<ComponentProps extends unknown> {
9
+ export type ObjectInterpolation<TProps> = CssType<TProps> | CssType<TProps>[];
10
+ export type TemplateStringsInterpolation<TProps> = CssFunction<TProps> | CssFunction<TProps>[];
11
+ export interface StyledComponent<ComponentProps> {
12
12
  <TProps = {}>(...css: ObjectInterpolation<TProps>[]): React.ComponentType<TProps & ComponentProps & StyledProps>;
13
13
  <TProps = {}>(template: TemplateStringsArray, ...interpolations: TemplateStringsInterpolation<TProps>[]): React.ComponentType<TProps & ComponentProps & StyledProps>;
14
14
  }
15
- export declare type StyledComponentMap = {
15
+ export type StyledComponentMap = {
16
16
  [Tag in keyof JSX.IntrinsicElements]: StyledComponent<JSX.IntrinsicElements[Tag]>;
17
17
  };
18
18
  export interface CreateStyledComponent extends StyledComponentMap {
19
- <TInheritedProps extends unknown>(Component: ComponentType<TInheritedProps>): StyledComponent<TInheritedProps>;
19
+ <TInheritedProps>(Component: ComponentType<TInheritedProps>): StyledComponent<TInheritedProps>;
20
20
  }
21
21
  /**
22
22
  * ## Styled component
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Flowtype definitions for index
3
3
  * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.17.0
4
+ * Flowgen v1.20.1
5
5
  * @flow
6
6
  */
7
7
  import type { ComponentType } from 'react';
@@ -14,7 +14,7 @@ export type StyledProps = {
14
14
  };
15
15
  export type ObjectInterpolation<TProps> = CssType<TProps> | CssType<TProps>[];
16
16
  export type TemplateStringsInterpolation<TProps> = CssFunction<TProps> | CssFunction<TProps>[];
17
- export interface StyledComponent<ComponentProps: mixed> {
17
+ export interface StyledComponent<ComponentProps> {
18
18
  <TProps>(
19
19
  ...css: ObjectInterpolation<TProps>[]
20
20
  ): React$ComponentType<{ ...TProps, ...ComponentProps, ...StyledProps }>;
@@ -25,9 +25,7 @@ export interface StyledComponent<ComponentProps: mixed> {
25
25
  }
26
26
  export type StyledComponentMap = $ObjMapi<$JSXIntrinsics, <Tag>(Tag) => StyledComponent<mixed>>;
27
27
  export type CreateStyledComponent = {
28
- <TInheritedProps: mixed>(
29
- Component: ComponentType<TInheritedProps>
30
- ): StyledComponent<TInheritedProps>,
28
+ <TInheritedProps>(Component: ComponentType<TInheritedProps>): StyledComponent<TInheritedProps>,
31
29
  ...
32
30
  } & StyledComponentMap;
33
31
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/styled/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAsClD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,MAAM,CAAC,IAAM,MAAM,GAA0B,IAAI,KAAK,CACpD,EAAE,EACF;IACE,GAAG;QACD,OAAO;YACL,8CAA8C;YAC9C,yDAAyD;YACzD,MAAM,gBAAgB,EAAE,CAAC;QAC3B,CAAC,CAAC;IACJ,CAAC;CACF,CACK,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/styled/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAoClD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,MAAM,CAAC,IAAM,MAAM,GAA0B,IAAI,KAAK,CACpD,EAAE,EACF;IACE,GAAG;QACD,OAAO;YACL,8CAA8C;YAC9C,yDAAyD;YACzD,MAAM,gBAAgB,EAAE,CAAC;QAC3B,CAAC,CAAC;IACJ,CAAC;CACF,CACK,CAAC"}
@@ -2,19 +2,19 @@ import type * as CSS from 'csstype';
2
2
  /**
3
3
  * Typing for the interpolations.
4
4
  */
5
- export declare type BasicTemplateInterpolations = string | number;
5
+ export type BasicTemplateInterpolations = string | number;
6
6
  export interface FunctionInterpolation<TProps> {
7
7
  (props: TProps): CssFunction<TProps>;
8
8
  }
9
9
  /**
10
10
  * Possible types for a CSS value
11
11
  */
12
- export declare type CssType<TProps> = CSSProps<TProps> | CssObject<TProps> | FunctionInterpolation<TProps> | string;
12
+ export type CssType<TProps> = CSSProps<TProps> | CssObject<TProps> | FunctionInterpolation<TProps> | string;
13
13
  /**
14
14
  * These are all the CSS props that will exist.
15
15
  */
16
- export declare type CSSProps<TProps> = CSS.Properties<CssFunction<TProps>>;
17
- export declare type CssObject<TProps> = {
16
+ export type CSSProps<TProps> = CSS.Properties<CssFunction<TProps>>;
17
+ export type CssObject<TProps> = {
18
18
  [key: string]: CssFunction<TProps>;
19
19
  };
20
- export declare type CssFunction<TProps = unknown> = CssType<TProps> | BasicTemplateInterpolations | boolean | undefined;
20
+ export type CssFunction<TProps = unknown> = CssType<TProps> | BasicTemplateInterpolations | boolean | undefined;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Flowtype definitions for types
3
3
  * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.17.0
4
+ * Flowgen v1.20.1
5
5
  * @flow
6
6
  */
7
7
  import * as CSS from 'csstype';
@@ -23,7 +23,6 @@ export type CSSProps<TProps> = CSS.Properties<CssFunction<TProps>>;
23
23
  export type CssObject<TProps> = {
24
24
  ...CSSProps<TProps>,
25
25
  [key: string]: CssFunction<TProps>,
26
- ...
27
26
  };
28
27
  export type CssFunction<TProps = mixed> =
29
28
  | CssType<TProps>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Flowtype definitions for error
3
3
  * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.17.0
4
+ * Flowgen v1.20.1
5
5
  * @flow
6
6
  */
7
7
  declare export var createSetupError: () => Error;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compiled/react",
3
- "version": "0.11.1",
3
+ "version": "0.11.3",
4
4
  "description": "A familiar and performant compile time CSS-in-JS library for React.",
5
5
  "keywords": [
6
6
  "compiled",
@@ -72,13 +72,13 @@
72
72
  "jsx-dev-runtime"
73
73
  ],
74
74
  "dependencies": {
75
- "csstype": "^3.1.0"
75
+ "csstype": "^3.1.1"
76
76
  },
77
77
  "devDependencies": {
78
78
  "@compiled/benchmark": "^1.0.1",
79
79
  "@testing-library/react": "^12.1.5",
80
80
  "@types/jsdom": "^16.2.15",
81
- "@types/react-dom": "^17.0.17",
81
+ "@types/react-dom": "^17.0.18",
82
82
  "jsdom": "^19.0.0",
83
83
  "react": "^17.0.2",
84
84
  "react-dom": "^17.0.2"
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Flowtype definitions for index
3
3
  * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.17.0
4
+ * Flowgen v1.20.1
5
5
  * @flow
6
6
  */
7
7
  import type { Node } from 'react';
@@ -51,4 +51,3 @@ export interface ClassNamesProps<TProps> {
51
51
  * ```
52
52
  */
53
53
  declare export function ClassNames<TProps>(x: ClassNamesProps<TProps>): React$Node;
54
- declare export {};
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Flowtype definitions for index
3
3
  * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.17.0
4
+ * Flowgen v1.20.1
5
5
  * @flow
6
6
  */
7
7
  import type { CSSProps, CssObject, CssFunction } from '../types';
package/src/index.js.flow CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Flowtype definitions for index
3
3
  * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.17.0
4
+ * Flowgen v1.20.1
5
5
  * @flow
6
6
  */
7
7
  import type { CssFunction, CSSProps, CssType } from './types';
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Flowtype definitions for index
3
3
  * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.17.0
4
+ * Flowgen v1.20.1
5
5
  * @flow
6
6
  */
7
7
  import type { BasicTemplateInterpolations, CSSProps } from '../types';
@@ -25,10 +25,22 @@ describe('ax', () => {
25
25
  expect(result).toEqual('_aaaacccc');
26
26
  });
27
27
 
28
+ it('should ensure the last atomic declaration of many single groups wins', () => {
29
+ const result = ax(['_aaaabbbb', '_aaaacccc', '_aaaadddd', '_aaaaeeee']);
30
+
31
+ expect(result).toEqual('_aaaaeeee');
32
+ });
33
+
28
34
  it('should ensure the last atomic declaration of a multi group wins', () => {
29
- const result = ax(['_aaaabbbb _aaaacccc', 'foo']);
35
+ const result = ax(['_aaaabbbb _aaaacccc']);
36
+
37
+ expect(result).toEqual('_aaaacccc');
38
+ });
39
+
40
+ it('should ensure the last atomic declaration of many multi groups wins', () => {
41
+ const result = ax(['_aaaabbbb _aaaacccc _aaaadddd _aaaaeeee']);
30
42
 
31
- expect(result).toEqual('_aaaacccc foo');
43
+ expect(result).toEqual('_aaaaeeee');
32
44
  });
33
45
 
34
46
  it('should not remove any atomic declarations if there are no duplicate groups', () => {
@@ -49,4 +61,10 @@ describe('ax', () => {
49
61
 
50
62
  expect(result).toEqual('hello_there hello_world');
51
63
  });
64
+
65
+ it('should ignore non atomic declarations when atomic declarations exist', () => {
66
+ const result = ax(['hello_there', 'hello_world', '_aaaabbbb']);
67
+
68
+ expect(result).toEqual('hello_there hello_world _aaaabbbb');
69
+ });
52
70
  });
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Flowtype definitions for ax
3
3
  * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.17.0
4
+ * Flowgen v1.20.1
5
5
  * @flow
6
6
  */
7
7
  /**
package/src/runtime/ax.ts CHANGED
@@ -28,8 +28,8 @@ const ATOMIC_GROUP_LENGTH = 5;
28
28
  * @param classes
29
29
  */
30
30
  export default function ax(classNames: (string | undefined | false)[]): string | undefined {
31
- if (classNames.length <= 1) {
32
- // short circuit if theres no custom class names.
31
+ if (classNames.length <= 1 && (!classNames[0] || classNames[0].indexOf(' ') === -1)) {
32
+ // short circuit if there's no custom class names.
33
33
  return classNames[0] || undefined;
34
34
  }
35
35
 
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Flowtype definitions for cache
3
3
  * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.17.0
4
+ * Flowgen v1.20.1
5
5
  * @flow
6
6
  */
7
7
  /**
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Flowtype definitions for css-custom-property
3
3
  * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.17.0
4
+ * Flowgen v1.20.1
5
5
  * @flow
6
6
  */
7
7
  /**
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Flowtype definitions for dev-warnings
3
3
  * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.17.0
4
+ * Flowgen v1.20.1
5
5
  * @flow
6
6
  */
7
7
  declare export var analyzeCssInDev: (sheet: string) => void;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Flowtype definitions for index
3
3
  * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.17.0
4
+ * Flowgen v1.20.1
5
5
  * @flow
6
6
  */
7
7
  declare export { default as CS } from './style';
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Flowtype definitions for is-server-environment
3
3
  * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.17.0
4
+ * Flowgen v1.20.1
5
5
  * @flow
6
6
  */
7
7
  /**
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Flowtype definitions for sheet
3
3
  * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.17.0
4
+ * Flowgen v1.20.1
5
5
  * @flow
6
6
  */
7
7
  import type { Bucket, StyleSheetOpts } from './types';