@compiled/react 0.10.0 → 0.10.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 (107) hide show
  1. package/dist/browser/class-names/index.d.ts +21 -15
  2. package/dist/browser/class-names/index.js +1 -27
  3. package/dist/browser/class-names/index.js.map +1 -1
  4. package/dist/browser/css/index.d.ts +22 -19
  5. package/dist/browser/css/index.js +3 -3
  6. package/dist/browser/css/index.js.map +1 -1
  7. package/dist/browser/jsx/jsx-local-namespace.d.ts +32 -6
  8. package/dist/browser/keyframes/__fixtures__/index.js +1 -0
  9. package/dist/browser/keyframes/__fixtures__/index.js.map +1 -1
  10. package/dist/browser/keyframes/index.d.ts +20 -24
  11. package/dist/browser/keyframes/index.js.map +1 -1
  12. package/dist/browser/runtime/cache.d.ts +12 -0
  13. package/dist/browser/runtime/cache.js +15 -0
  14. package/dist/browser/runtime/cache.js.flow +18 -0
  15. package/dist/browser/runtime/cache.js.map +1 -0
  16. package/dist/browser/runtime/dev-warnings.js +10 -6
  17. package/dist/browser/runtime/dev-warnings.js.map +1 -1
  18. package/dist/browser/runtime/is-node.js +1 -3
  19. package/dist/browser/runtime/is-node.js.map +1 -1
  20. package/dist/browser/runtime/sheet.js +5 -1
  21. package/dist/browser/runtime/sheet.js.map +1 -1
  22. package/dist/browser/runtime/style-cache.js +4 -0
  23. package/dist/browser/runtime/style-cache.js.map +1 -1
  24. package/dist/browser/styled/index.d.ts +35 -7
  25. package/dist/browser/styled/index.js +35 -7
  26. package/dist/browser/styled/index.js.map +1 -1
  27. package/dist/cjs/class-names/index.d.ts +21 -15
  28. package/dist/cjs/class-names/index.js +2 -28
  29. package/dist/cjs/class-names/index.js.map +1 -1
  30. package/dist/cjs/css/index.d.ts +22 -19
  31. package/dist/cjs/css/index.js +4 -4
  32. package/dist/cjs/css/index.js.map +1 -1
  33. package/dist/cjs/jsx/jsx-local-namespace.d.ts +32 -6
  34. package/dist/cjs/keyframes/__fixtures__/index.js +2 -1
  35. package/dist/cjs/keyframes/__fixtures__/index.js.map +1 -1
  36. package/dist/cjs/keyframes/index.d.ts +20 -24
  37. package/dist/cjs/keyframes/index.js +1 -1
  38. package/dist/cjs/keyframes/index.js.map +1 -1
  39. package/dist/cjs/runtime/cache.d.ts +12 -0
  40. package/dist/cjs/runtime/cache.js +19 -0
  41. package/dist/cjs/runtime/cache.js.flow +18 -0
  42. package/dist/cjs/runtime/cache.js.map +1 -0
  43. package/dist/cjs/runtime/dev-warnings.js +10 -6
  44. package/dist/cjs/runtime/dev-warnings.js.map +1 -1
  45. package/dist/cjs/runtime/is-node.js +1 -3
  46. package/dist/cjs/runtime/is-node.js.map +1 -1
  47. package/dist/cjs/runtime/sheet.js +6 -2
  48. package/dist/cjs/runtime/sheet.js.map +1 -1
  49. package/dist/cjs/runtime/style-cache.js +10 -6
  50. package/dist/cjs/runtime/style-cache.js.map +1 -1
  51. package/dist/cjs/runtime/style.js +4 -4
  52. package/dist/cjs/runtime/style.js.map +1 -1
  53. package/dist/cjs/styled/index.d.ts +35 -7
  54. package/dist/cjs/styled/index.js +36 -8
  55. package/dist/cjs/styled/index.js.map +1 -1
  56. package/dist/esm/class-names/index.d.ts +21 -15
  57. package/dist/esm/class-names/index.js +1 -27
  58. package/dist/esm/class-names/index.js.map +1 -1
  59. package/dist/esm/css/index.d.ts +22 -19
  60. package/dist/esm/css/index.js +3 -3
  61. package/dist/esm/css/index.js.map +1 -1
  62. package/dist/esm/jsx/jsx-local-namespace.d.ts +32 -6
  63. package/dist/esm/keyframes/__fixtures__/index.js +1 -0
  64. package/dist/esm/keyframes/__fixtures__/index.js.map +1 -1
  65. package/dist/esm/keyframes/index.d.ts +20 -24
  66. package/dist/esm/keyframes/index.js.map +1 -1
  67. package/dist/esm/runtime/cache.d.ts +12 -0
  68. package/dist/esm/runtime/cache.js +15 -0
  69. package/dist/esm/runtime/cache.js.flow +18 -0
  70. package/dist/esm/runtime/cache.js.map +1 -0
  71. package/dist/esm/runtime/dev-warnings.js +10 -6
  72. package/dist/esm/runtime/dev-warnings.js.map +1 -1
  73. package/dist/esm/runtime/is-node.js +1 -3
  74. package/dist/esm/runtime/is-node.js.map +1 -1
  75. package/dist/esm/runtime/sheet.js +5 -1
  76. package/dist/esm/runtime/sheet.js.map +1 -1
  77. package/dist/esm/runtime/style-cache.js +4 -0
  78. package/dist/esm/runtime/style-cache.js.map +1 -1
  79. package/dist/esm/styled/index.d.ts +35 -7
  80. package/dist/esm/styled/index.js +35 -7
  81. package/dist/esm/styled/index.js.map +1 -1
  82. package/package.json +8 -5
  83. package/src/__tests__/browser.test.tsx +1 -6
  84. package/src/__tests__/display-names.test.tsx +1 -0
  85. package/src/__tests__/jest-matcher.test.tsx +2 -0
  86. package/src/__tests__/ssr.test.tsx +3 -1
  87. package/src/class-names/__tests__/index.test.tsx +1 -0
  88. package/src/class-names/index.tsx +23 -13
  89. package/src/css/__tests__/index.test.tsx +8 -0
  90. package/src/css/index.tsx +32 -24
  91. package/src/jsx/__tests__/jsx-pragma.test.tsx +1 -0
  92. package/src/jsx/jsx-local-namespace.tsx +32 -6
  93. package/src/keyframes/__fixtures__/index.tsx +1 -0
  94. package/src/keyframes/__tests__/index.test.tsx +18 -5
  95. package/src/keyframes/index.tsx +24 -28
  96. package/src/runtime/__perf__/cs.test.tsx +137 -92
  97. package/src/runtime/__perf__/utils/cs.tsx +15 -15
  98. package/src/runtime/__tests__/style-ssr.test.tsx +4 -0
  99. package/src/runtime/__tests__/style.test.tsx +0 -4
  100. package/src/runtime/cache.js.flow +18 -0
  101. package/src/runtime/cache.tsx +14 -0
  102. package/src/runtime/is-node.tsx +1 -2
  103. package/src/runtime/sheet.tsx +7 -1
  104. package/src/runtime/style-cache.tsx +5 -0
  105. package/src/styled/__tests__/index.test.tsx +1 -0
  106. package/src/styled/index.tsx +35 -7
  107. package/CHANGELOG.md +0 -128
@@ -1,38 +1,44 @@
1
- import type { ReactNode } from 'react';
1
+ import type { ReactNode, CSSProperties } from 'react';
2
2
  import type { BasicTemplateInterpolations, CssFunction } from '../types';
3
3
  export declare type Interpolations = (BasicTemplateInterpolations | CssFunction | CssFunction[])[];
4
4
  export interface ClassNamesProps {
5
5
  children: (opts: {
6
6
  css: (css: CssFunction | CssFunction[], ...interpolations: Interpolations) => string;
7
- style: {
8
- [key: string]: string;
9
- };
7
+ style: CSSProperties;
10
8
  }) => ReactNode;
11
9
  }
12
10
  /**
13
- * Use a component where styles are not necessarily tied to an element.
11
+ * ## Class names
14
12
  *
13
+ * Use a component where styles are not necessarily used on a JSX element.
14
+ * For further details [read the documentation](https://compiledcssinjs.com/docs/api-class-names).
15
+ *
16
+ * ### Style with objects
17
+ *
18
+ * @example
15
19
  * ```
16
- * // Object CSS
17
20
  * <ClassNames>
18
21
  * {({ css, style }) => children({ className: css({ fontSize: 12 }) })}
19
22
  * </ClassNames>
23
+ * ```
20
24
  *
21
- * // Template literal CSS
25
+ * ### Style with template literals
26
+ *
27
+ * @example
28
+ * ```
22
29
  * <ClassNames>
23
30
  * {({ css, style }) => children({ className: css`font-size: 12px;` })}
24
31
  * </ClassNames>
32
+ * ```
33
+ *
34
+ * ### Compose styles with arrays
25
35
  *
26
- * // Array CSS
36
+ * @example
37
+ * ```
27
38
  * <ClassNames>
28
39
  * {({ css, style }) =>
29
- * children({ className: css([{ fontSize: 12 }, `font-size: 12px`]) })}
40
+ * children({ className: css([{ fontSize: 12 }, css`font-size: 12px`]) })}
30
41
  * </ClassNames>
31
42
  * ```
32
- *
33
- * For more help, read the docs:
34
- * https://compiledcssinjs.com/docs/api-class-names
35
- *
36
- * @param props
37
43
  */
38
- export declare function ClassNames(_: ClassNamesProps): JSX.Element;
44
+ export declare function ClassNames({ children }: ClassNamesProps): JSX.Element;
@@ -2,34 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ClassNames = void 0;
4
4
  var error_1 = require("../utils/error");
5
- /**
6
- * Use a component where styles are not necessarily tied to an element.
7
- *
8
- * ```
9
- * // Object CSS
10
- * <ClassNames>
11
- * {({ css, style }) => children({ className: css({ fontSize: 12 }) })}
12
- * </ClassNames>
13
- *
14
- * // Template literal CSS
15
- * <ClassNames>
16
- * {({ css, style }) => children({ className: css`font-size: 12px;` })}
17
- * </ClassNames>
18
- *
19
- * // Array CSS
20
- * <ClassNames>
21
- * {({ css, style }) =>
22
- * children({ className: css([{ fontSize: 12 }, `font-size: 12px`]) })}
23
- * </ClassNames>
24
- * ```
25
- *
26
- * For more help, read the docs:
27
- * https://compiledcssinjs.com/docs/api-class-names
28
- *
29
- * @param props
30
- */
31
- function ClassNames(_) {
32
- throw error_1.createSetupError();
5
+ function ClassNames(_props) {
6
+ throw (0, error_1.createSetupError)();
33
7
  }
34
8
  exports.ClassNames = ClassNames;
35
9
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/class-names/index.tsx"],"names":[],"mappings":";;;AAGA,wCAAkD;AAWlD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,SAAgB,UAAU,CAAC,CAAkB;IAC3C,MAAM,wBAAgB,EAAE,CAAC;AAC3B,CAAC;AAFD,gCAEC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/class-names/index.tsx"],"names":[],"mappings":";;;AAGA,wCAAkD;AA+ClD,SAAgB,UAAU,CAAC,MAAuB;IAChD,MAAM,IAAA,wBAAgB,GAAE,CAAC;AAC3B,CAAC;AAFD,gCAEC"}
@@ -1,28 +1,31 @@
1
- import type { BasicTemplateInterpolations, CSSProps, FunctionInterpolation } from '../types';
1
+ import type { AnyKeyCssProps, BasicTemplateInterpolations, CSSProps, FunctionInterpolation } from '../types';
2
2
  /**
3
- * Create styles that can be re-used between components with a template literal.
3
+ * ## CSS
4
4
  *
5
- * ```
6
- * css`color: red;`;
7
- * ```
8
- *
9
- * For more help, read the docs:
10
- * https://compiledcssinjs.com/docs/api-css
5
+ * Define styles that are statically typed and useable with other Compiled APIs.
6
+ * For further details [read the documentation](https://compiledcssinjs.com/docs/api-css).
11
7
  *
12
- * @param css
13
- * @param values
14
- */
15
- export default function css<T = void>(_css: TemplateStringsArray, ..._values: (BasicTemplateInterpolations | FunctionInterpolation<T>)[]): CSSProps;
16
- /**
17
- * Create styles that can be re-used between components with an object
8
+ * ### Style with objects
18
9
  *
10
+ * @example
19
11
  * ```
20
- * css({ color: 'red' });
12
+ * const redText = css({
13
+ * color: 'red',
14
+ * });
15
+ *
16
+ * <div css={redText} />
21
17
  * ```
22
18
  *
23
- * For more help, read the docs:
24
- * https://compiledcssinjs.com/docs/api-css
19
+ * ### Style with template literals
20
+ *
21
+ * @example
22
+ * ```
23
+ * const redText = css`
24
+ * color: red;
25
+ * `;
25
26
  *
26
- * @param css
27
+ * <div css={redText} />
28
+ * ```
27
29
  */
28
- export default function css(_css: CSSProps): CSSProps;
30
+ export default function css<T = void>(styles: TemplateStringsArray, ...interpolations: (BasicTemplateInterpolations | FunctionInterpolation<T>)[]): CSSProps;
31
+ export default function css(styles: AnyKeyCssProps<void> | CSSProps): CSSProps;
@@ -2,12 +2,12 @@
2
2
  /* eslint-disable import/export */
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  var error_1 = require("../utils/error");
5
- function css(_css) {
6
- var _values = [];
5
+ function css(_styles) {
6
+ var _interpolations = [];
7
7
  for (var _i = 1; _i < arguments.length; _i++) {
8
- _values[_i - 1] = arguments[_i];
8
+ _interpolations[_i - 1] = arguments[_i];
9
9
  }
10
- throw error_1.createSetupError();
10
+ throw (0, error_1.createSetupError)();
11
11
  }
12
12
  exports.default = css;
13
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/css/index.tsx"],"names":[],"mappings":";AAAA,kCAAkC;;AAGlC,wCAAkD;AAkClD,SAAwB,GAAG,CACzB,IAAqC;IACrC,iBAAsE;SAAtE,UAAsE,EAAtE,qBAAsE,EAAtE,IAAsE;QAAtE,gCAAsE;;IAEtE,MAAM,wBAAgB,EAAE,CAAC;AAC3B,CAAC;AALD,sBAKC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/css/index.tsx"],"names":[],"mappings":";AAAA,kCAAkC;;AAQlC,wCAAkD;AAqClD,SAAwB,GAAG,CACzB,OAAwC;IACxC,yBAA8E;SAA9E,UAA8E,EAA9E,qBAA8E,EAA9E,IAA8E;QAA9E,wCAA8E;;IAE9E,MAAM,IAAA,wBAAgB,GAAE,CAAC;AAC3B,CAAC;AALD,sBAKC"}
@@ -2,16 +2,42 @@
2
2
  import type { CssFunction } from '../types';
3
3
  declare type WithConditionalCSSProp<TProps> = 'className' extends keyof TProps ? string extends TProps['className' & keyof TProps] ? {
4
4
  /**
5
- * Tie styles to an element.
5
+ * ## CSS prop
6
6
  *
7
+ * Style a JSX element.
8
+ * For further details [read the API documentation](https://compiledcssinjs.com/docs/api-css-prop).
9
+ *
10
+ * ### Style with objects
11
+ *
12
+ * @example
13
+ * ```
14
+ * import { css } from '@compiled/react';
15
+ *
16
+ * <div css={css({ fontSize: 12 })} />
17
+ * ```
18
+ *
19
+ * ### Style with template literals
20
+ *
21
+ * @example
22
+ * ```
23
+ * import { css } from '@compiled/react';
24
+ *
25
+ * <div css={css`color: red;`} />
7
26
  * ```
8
- * css={{ fontSize: 12 }} // Object CSS
9
- * css={`font-size: 12px;`} // Template literal CSS
10
- * css={[{ fontSize: 12 }, `font-size: 12px;`]} // Array CSS
27
+ *
28
+ * ### Compose styles with arrays
29
+ *
30
+ * @example
11
31
  * ```
32
+ * import { css } from '@compiled/react';
12
33
  *
13
- * For more help, read the docs:
14
- * https://compiledcssinjs.com/docs/api-css-prop
34
+ * <div
35
+ * css={[
36
+ * css({ fontSize: 12 }),
37
+ * css`color: red;`,
38
+ * ]}
39
+ * />
40
+ * ```
15
41
  */
16
42
  css?: CssFunction | CssFunction[];
17
43
  } : {} : {};
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.namedFadeOut = exports.fadeOut = void 0;
4
+ // eslint-disable-next-line import/no-extraneous-dependencies
4
5
  var react_1 = require("@compiled/react");
5
- exports.fadeOut = react_1.keyframes({
6
+ exports.fadeOut = (0, react_1.keyframes)({
6
7
  from: {
7
8
  opacity: 1,
8
9
  },
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/keyframes/__fixtures__/index.tsx"],"names":[],"mappings":";;;AAAA,yCAA4C;AAE/B,QAAA,OAAO,GAAG,iBAAS,CAAC;IAC/B,IAAI,EAAE;QACJ,OAAO,EAAE,CAAC;KACX;IACD,EAAE,EAAE;QACF,OAAO,EAAE,CAAC;KACX;CACF,CAAC,CAAC;AAEU,QAAA,YAAY,GAAG,eAAO,CAAC;AAEpC,kBAAe,eAAO,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/keyframes/__fixtures__/index.tsx"],"names":[],"mappings":";;;AAAA,6DAA6D;AAC7D,yCAA4C;AAE/B,QAAA,OAAO,GAAG,IAAA,iBAAS,EAAC;IAC/B,IAAI,EAAE;QACJ,OAAO,EAAE,CAAC;KACX;IACD,EAAE,EAAE;QACF,OAAO,EAAE,CAAC;KACX;CACF,CAAC,CAAC;AAEU,QAAA,YAAY,GAAG,eAAO,CAAC;AAEpC,kBAAe,eAAO,CAAC"}
@@ -1,24 +1,14 @@
1
1
  import type { BasicTemplateInterpolations, CSSProps } from '../types';
2
2
  export declare type KeyframeSteps = string | Record<string, CSSProps>;
3
3
  /**
4
- * Create keyframes using a tagged template expression:
4
+ * ## Keyframes
5
5
  *
6
- * ```
7
- * const fadeOut = keyframes`
8
- * from { opacity: 1; }
9
- * to { opacity: 0; }
10
- * `;
11
- * ```
12
- *
13
- * @param _strings The input string values
14
- * @param _interpolations The arguments used in the expression
15
- */
16
- export declare function keyframes(_strings: TemplateStringsArray, ..._interpolations: BasicTemplateInterpolations[]): string;
17
- /**
18
- * Create keyframes using:
6
+ * Define keyframes to be used in a [CSS animation](https://developer.mozilla.org/en-US/docs/Web/CSS/animation).
7
+ * For further details [read the API documentation](https://compiledcssinjs.com/docs/api-keyframes).
19
8
  *
20
- * 1. An object expression
9
+ * ### Style with objects
21
10
  *
11
+ * @example
22
12
  * ```
23
13
  * const fadeOut = keyframes({
24
14
  * from: {
@@ -28,20 +18,26 @@ export declare function keyframes(_strings: TemplateStringsArray, ..._interpolat
28
18
  * opacity: 0,
29
19
  * },
30
20
  * });
21
+ *
22
+ * <div css={{ animation: `${fadeOut} 2s` }} />
31
23
  * ```
32
24
  *
33
- * 2. A string
25
+ * ### Style with template literals
34
26
  *
27
+ * @example
35
28
  * ```
36
- * const fadeOut = keyframes('from { opacity: 1; } to { opacity: 0; }');
37
- * ```
29
+ * const fadeOut = keyframes`
30
+ * from {
31
+ * opacity: 1;
32
+ * }
38
33
  *
39
- * 3. A template literal
34
+ * to {
35
+ * opacity: 0;
36
+ * }
37
+ * `;
40
38
  *
39
+ * <div css={{ animation: `${fadeOut} 2s` }} />
41
40
  * ```
42
- * const fadeOut = keyframes(`from { opacity: 1; } to { opacity: 0; }`);
43
- * ```
44
- *
45
- * @param _steps The waypoints along the animation sequence
46
41
  */
47
- export declare function keyframes(_steps: KeyframeSteps): string;
42
+ export declare function keyframes(steps: KeyframeSteps): string;
43
+ export declare function keyframes(strings: TemplateStringsArray, ...interpolations: BasicTemplateInterpolations[]): string;
@@ -7,7 +7,7 @@ function keyframes(_stringsOrSteps) {
7
7
  for (var _i = 1; _i < arguments.length; _i++) {
8
8
  _interpolations[_i - 1] = arguments[_i];
9
9
  }
10
- throw error_1.createSetupError();
10
+ throw (0, error_1.createSetupError)();
11
11
  }
12
12
  exports.keyframes = keyframes;
13
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/keyframes/index.tsx"],"names":[],"mappings":";;;AACA,wCAAkD;AAsDlD,SAAgB,SAAS,CACvB,eAAqD;IACrD,yBAAiD;SAAjD,UAAiD,EAAjD,qBAAiD,EAAjD,IAAiD;QAAjD,wCAAiD;;IAEjD,MAAM,wBAAgB,EAAE,CAAC;AAC3B,CAAC;AALD,8BAKC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/keyframes/index.tsx"],"names":[],"mappings":";;;AACA,wCAAkD;AAkDlD,SAAgB,SAAS,CACvB,eAAqD;IACrD,yBAAiD;SAAjD,UAAiD,EAAjD,qBAAiD,EAAjD,IAAiD;QAAjD,wCAAiD;;IAEjD,MAAM,IAAA,wBAAgB,GAAE,CAAC;AAC3B,CAAC;AALD,8BAKC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Returns `true` when caching should be disabled, else `false`.
3
+ *
4
+ * Any code within this check will be removed in the output bundles:
5
+ *
6
+ * ```js
7
+ * if (isCacheDisabled()) {
8
+ * // This code will be removed from the output bundles
9
+ * }
10
+ * ```
11
+ */
12
+ export declare const isCacheDisabled: () => boolean;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isCacheDisabled = void 0;
4
+ /**
5
+ * Returns `true` when caching should be disabled, else `false`.
6
+ *
7
+ * Any code within this check will be removed in the output bundles:
8
+ *
9
+ * ```js
10
+ * if (isCacheDisabled()) {
11
+ * // This code will be removed from the output bundles
12
+ * }
13
+ * ```
14
+ */
15
+ var isCacheDisabled = function () {
16
+ return process.env.NODE_ENV === 'test' && process.env.CACHE === 'false';
17
+ };
18
+ exports.isCacheDisabled = isCacheDisabled;
19
+ //# sourceMappingURL=cache.js.map
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Flowtype definitions for cache
3
+ * Generated by Flowgen from a Typescript Definition
4
+ * Flowgen v1.15.0
5
+ * @flow
6
+ */
7
+ /**
8
+ * Returns `true` when caching should be disabled, else `false`.
9
+ *
10
+ * Any code within this check will be removed in the output bundles:
11
+ *
12
+ * ```js
13
+ * if (isCacheDisabled()) {
14
+ * // This code will be removed from the output bundles
15
+ * }
16
+ * ```
17
+ */
18
+ declare export var isCacheDisabled: () => boolean;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache.js","sourceRoot":"","sources":["../../../src/runtime/cache.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;GAUG;AACI,IAAM,eAAe,GAAG;IAC7B,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,OAAO,CAAC;AAC1E,CAAC,CAAC;AAFW,QAAA,eAAe,mBAE1B"}
@@ -1,8 +1,12 @@
1
1
  "use strict";
2
- var __spreadArray = (this && this.__spreadArray) || function (to, from) {
3
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
4
- to[j] = from[i];
5
- return to;
2
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
3
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
4
+ if (ar || !(i in from)) {
5
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
6
+ ar[i] = from[i];
7
+ }
8
+ }
9
+ return to.concat(ar || Array.prototype.slice.call(from));
6
10
  };
7
11
  Object.defineProperty(exports, "__esModule", { value: true });
8
12
  exports.analyzeCssInDev = void 0;
@@ -13,7 +17,7 @@ var warn = function (str) {
13
17
  for (var _i = 1; _i < arguments.length; _i++) {
14
18
  args[_i - 1] = arguments[_i];
15
19
  }
16
- return console.error.apply(console, __spreadArray(["\n \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2557\n\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\n\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2588\u2588\u2588\u2588\u2554\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551 \u2588\u2588\u2551\n\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551\u255A\u2588\u2588\u2554\u255D\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u255D \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2554\u2550\u2550\u255D \u2588\u2588\u2551 \u2588\u2588\u2551\n\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u255A\u2550\u255D \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\n \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u255D\n\n @compiled/react/runtime - DEV WARNING\n\n " + str + "\n"], args));
20
+ return console.error.apply(console, __spreadArray(["\n \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2557\n\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\n\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2588\u2588\u2588\u2588\u2554\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551 \u2588\u2588\u2551\n\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551\u255A\u2588\u2588\u2554\u255D\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u255D \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2554\u2550\u2550\u255D \u2588\u2588\u2551 \u2588\u2588\u2551\n\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u255A\u2550\u255D \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\n \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u255D\n\n @compiled/react/runtime - DEV WARNING\n\n ".concat(str, "\n")], args, false));
17
21
  };
18
22
  var analyzeCssInDev = function (sheet) {
19
23
  if (hasWarned[sheet]) {
@@ -21,7 +25,7 @@ var analyzeCssInDev = function (sheet) {
21
25
  }
22
26
  var shouldWarnAboutSelectors = selectorsToWarn.map(function (selector) { return sheet.includes(selector); }).filter(Boolean).length > 0;
23
27
  if (shouldWarnAboutSelectors) {
24
- warn("Selectors \"" + selectorsToWarn.join(', ') + "\" are dangerous to use when server side rendering.\n Alternatively try and use \":nth-of-type\", or placing data attributes and targetting those instead.\n Read https://compiledcssinjs.com/docs/server-side-rendering for more advice.");
28
+ warn("Selectors \"".concat(selectorsToWarn.join(', '), "\" are dangerous to use when server side rendering.\n Alternatively try and use \":nth-of-type\", or placing data attributes and targetting those instead.\n Read https://compiledcssinjs.com/docs/server-side-rendering for more advice."));
25
29
  }
26
30
  hasWarned[sheet] = true;
27
31
  };
@@ -1 +1 @@
1
- {"version":3,"file":"dev-warnings.js","sourceRoot":"","sources":["../../../src/runtime/dev-warnings.tsx"],"names":[],"mappings":";;;;;;;;AAAA,IAAM,eAAe,GAAG,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC;AACvD,IAAM,SAAS,GAAyB,EAAE,CAAC;AAE3C,IAAM,IAAI,GAAG,UAAC,GAAW;IAAE,cAAc;SAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;QAAd,6BAAc;;IACvC,OAAA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,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;IAEzF,IAAI,wBAAwB,EAAE;QAC5B,IAAI,CACF,sBAAc,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,gPAEiC,CAC1E,CAAC;KACH;IAED,SAAS,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;AAC1B,CAAC,CAAC;AAjBW,QAAA,eAAe,mBAiB1B"}
@@ -14,9 +14,7 @@ exports.isNodeEnvironment = void 0;
14
14
  * ```
15
15
  */
16
16
  var isNodeEnvironment = function () {
17
- var _a;
18
- // https://nodejs.org/api/process.html#process_process_release
19
- return typeof process !== 'undefined' && ((_a = process === null || process === void 0 ? void 0 : process.release) === null || _a === void 0 ? void 0 : _a.name) === 'node';
17
+ return typeof window === 'undefined';
20
18
  };
21
19
  exports.isNodeEnvironment = isNodeEnvironment;
22
20
  //# sourceMappingURL=is-node.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-node.js","sourceRoot":"","sources":["../../../src/runtime/is-node.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;GAWG;AACI,IAAM,iBAAiB,GAAG;;IAC/B,8DAA8D;IAC9D,OAAO,OAAO,OAAO,KAAK,WAAW,IAAI,CAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,0CAAE,IAAI,MAAK,MAAM,CAAC;AAC7E,CAAC,CAAC;AAHW,QAAA,iBAAiB,qBAG5B"}
1
+ {"version":3,"file":"is-node.js","sourceRoot":"","sources":["../../../src/runtime/is-node.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;GAWG;AACI,IAAM,iBAAiB,GAAG;IAC/B,OAAO,OAAO,MAAM,KAAK,WAAW,CAAC;AACvC,CAAC,CAAC;AAFW,QAAA,iBAAiB,qBAE5B"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getStyleBucketName = exports.styleBucketOrdering = void 0;
4
+ var cache_1 = require("./cache");
4
5
  /**
5
6
  * Ordered style buckets using their short psuedo name.
6
7
  * If changes are needed make sure that it aligns with the definition in `sort-at-rule-pseudos.tsx`.
@@ -73,8 +74,11 @@ function lazyAddStyleBucketToHead(bucketName, opts) {
73
74
  var tag = document.createElement('style');
74
75
  opts.nonce && tag.setAttribute('nonce', opts.nonce);
75
76
  tag.appendChild(document.createTextNode(''));
76
- styleBucketsInHead[bucketName] = tag;
77
77
  document.head.insertBefore(tag, nextBucketFromCache);
78
+ if (false) {
79
+ return tag;
80
+ }
81
+ styleBucketsInHead[bucketName] = tag;
78
82
  }
79
83
  return styleBucketsInHead[bucketName];
80
84
  }
@@ -122,7 +126,7 @@ exports.getStyleBucketName = getStyleBucketName;
122
126
  * @param opts StyleSheetOpts
123
127
  */
124
128
  function insertRule(css, opts) {
125
- var bucketName = exports.getStyleBucketName(css);
129
+ var bucketName = (0, exports.getStyleBucketName)(css);
126
130
  var style = lazyAddStyleBucketToHead(bucketName, opts);
127
131
  if (process.env.NODE_ENV === 'production') {
128
132
  var sheet = style.sheet;
@@ -1 +1 @@
1
- {"version":3,"file":"sheet.js","sourceRoot":"","sources":["../../../src/runtime/sheet.tsx"],"names":[],"mappings":";;;AAEA;;;GAGG;AACU,QAAA,mBAAmB,GAAa;IAC3C,YAAY;IACZ,EAAE;IACF,OAAO;IACP,GAAG;IACH,UAAU;IACV,GAAG;IACH,eAAe;IACf,GAAG;IACH,QAAQ;IACR,GAAG;IACH,gBAAgB;IAChB,GAAG;IACH,QAAQ;IACR,GAAG;IACH,SAAS;IACT,GAAG;IACH,WAAW;IACX,GAAG;CACJ,CAAC;AAEF;;GAEG;AACH,IAAM,kBAAkB,GAA8C,EAAE,CAAC;AAEzE;;;;;;GAMG;AACH,IAAM,UAAU,GAAuC;IACrD,OAAO;IACP,CAAC,EAAE,GAAG;IACN,UAAU;IACV,IAAI,EAAE,GAAG;IACT,eAAe;IACf,WAAW,EAAE,GAAG;IAChB,QAAQ;IACR,EAAE,EAAE,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22,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
22
22
  exports.useCache = void 0;
23
23
  var React = __importStar(require("react"));
24
24
  var react_1 = require("react");
25
+ var cache_1 = require("./cache");
25
26
  var is_node_1 = require("./is-node");
26
27
  /**
27
28
  * Cache to hold already used styles.
28
29
  * React Context on the server - singleton object on the client.
29
30
  */
30
- var Cache = is_node_1.isNodeEnvironment() ? react_1.createContext(null) : {};
31
- if (!is_node_1.isNodeEnvironment()) {
31
+ var Cache = (0, is_node_1.isNodeEnvironment)() ? (0, react_1.createContext)(null) : {};
32
+ if (!(0, is_node_1.isNodeEnvironment)()) {
32
33
  /**
33
34
  * Iterates through all found style elements generated when server side rendering.
34
35
  *
@@ -44,11 +45,14 @@ if (!is_node_1.isNodeEnvironment()) {
44
45
  * Hook using the cache created on the server or client.
45
46
  */
46
47
  var useCache = function () {
47
- if (is_node_1.isNodeEnvironment()) {
48
+ if (false) {
49
+ return {};
50
+ }
51
+ if ((0, is_node_1.isNodeEnvironment)()) {
48
52
  // On the server we use React Context to we don't leak the cache between SSR calls.
49
53
  // During runtime this hook isn't conditionally called - it is at build time that the flow gets decided.
50
54
  // eslint-disable-next-line react-hooks/rules-of-hooks
51
- return react_1.useContext(Cache) || {};
55
+ return (0, react_1.useContext)(Cache) || {};
52
56
  }
53
57
  // On the client we use the object singleton.
54
58
  return Cache;
@@ -61,10 +65,10 @@ exports.useCache = useCache;
61
65
  * On the browser this turns into a fragment with no React Context.
62
66
  */
63
67
  var StyleCacheProvider = function (props) {
64
- if (is_node_1.isNodeEnvironment()) {
68
+ if ((0, is_node_1.isNodeEnvironment)()) {
65
69
  // This code path isn't conditionally called at build time - safe to ignore.
66
70
  // eslint-disable-next-line react-hooks/rules-of-hooks
67
- var inserted = exports.useCache();
71
+ var inserted = (0, exports.useCache)();
68
72
  return React.createElement(Cache.Provider, { value: inserted }, props.children);
69
73
  }
70
74
  return props.children;
@@ -1 +1 @@
1
- {"version":3,"file":"style-cache.js","sourceRoot":"","s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AAC;AAEF,kBAAe,kBAAkB,CAAC"}
@@ -28,12 +28,12 @@ var is_node_1 = require("./is-node");
28
28
  var sheet_1 = __importStar(require("./sheet"));
29
29
  var style_cache_1 = require("./style-cache");
30
30
  function Style(props) {
31
- var inserted = style_cache_1.useCache();
31
+ var inserted = (0, style_cache_1.useCache)();
32
32
  if (process.env.NODE_ENV === 'development') {
33
33
  props.children.forEach(dev_warnings_1.analyzeCssInDev);
34
34
  }
35
35
  if (props.children.length) {
36
- if (is_node_1.isNodeEnvironment()) {
36
+ if ((0, is_node_1.isNodeEnvironment)()) {
37
37
  var bucketedSheets_1 = {};
38
38
  var hasSheets = false;
39
39
  for (var i = 0; i < props.children.length; i++) {
@@ -45,7 +45,7 @@ function Style(props) {
45
45
  inserted[sheet] = true;
46
46
  hasSheets = true;
47
47
  }
48
- var bucketName = sheet_1.getStyleBucketName(sheet);
48
+ var bucketName = (0, sheet_1.getStyleBucketName)(sheet);
49
49
  bucketedSheets_1[bucketName] = (bucketedSheets_1[bucketName] || '') + sheet;
50
50
  }
51
51
  if (!hasSheets) {
@@ -62,7 +62,7 @@ function Style(props) {
62
62
  continue;
63
63
  }
64
64
  inserted[sheet] = true;
65
- sheet_1.default(sheet, props);
65
+ (0, sheet_1.default)(sheet, props);
66
66
  }
67
67
  }
68
68
  }
@@ -1 +1 @@
1
- {"version":3,"file":"style.js","sourceRoot":"","sources":["../../../src/runtime/style.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAE1B,+CAAiD;AACjD,qCAA8C;AAC9C,+CAA8E;AAC9E,6CAAyC;AAWzC,SAAwB,KAAK,CAAC,KAAiB;IAC7C,IAAM,QAAQ,GAAG,sBAAQ,EAAE,CAAC;IAE5B,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,EAAE;QAC1C,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,8BAAe,CAAC,CAAC;KACzC;IAED,IAAI,KAAK,CA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