@compiled/react 0.10.2 → 0.11.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.
- package/dist/browser/class-names/index.d.ts +11 -5
- package/dist/browser/class-names/index.js.flow +29 -20
- package/dist/browser/class-names/index.js.map +1 -1
- package/dist/browser/css/index.d.ts +3 -3
- package/dist/browser/css/index.js.flow +24 -23
- package/dist/browser/css/index.js.map +1 -1
- package/dist/browser/index.d.ts +2 -3
- package/dist/browser/index.js.flow +4 -7
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/jsx/jsx-dev-runtime.js.map +1 -1
- package/dist/browser/jsx/jsx-local-namespace.d.ts +2 -2
- package/dist/browser/jsx/jsx-local-namespace.js.map +1 -1
- package/dist/browser/jsx/jsx-runtime.js.map +1 -1
- package/dist/browser/keyframes/__fixtures__/index.js.map +1 -1
- package/dist/browser/keyframes/index.d.ts +1 -1
- package/dist/browser/keyframes/index.js.flow +25 -31
- package/dist/browser/keyframes/index.js.map +1 -1
- package/dist/browser/runtime/ax.js.flow +1 -1
- package/dist/browser/runtime/ax.js.map +1 -1
- package/dist/browser/runtime/cache.js.flow +1 -1
- package/dist/browser/runtime/cache.js.map +1 -1
- package/dist/browser/runtime/css-custom-property.js.flow +1 -1
- package/dist/browser/runtime/css-custom-property.js.map +1 -1
- package/dist/browser/runtime/dev-warnings.js.flow +1 -1
- package/dist/browser/runtime/dev-warnings.js.map +1 -1
- package/dist/browser/runtime/index.js.flow +1 -1
- package/dist/browser/runtime/index.js.map +1 -1
- package/dist/browser/runtime/{is-node.d.ts → is-server-environment.d.ts} +2 -2
- package/dist/browser/runtime/is-server-environment.js +31 -0
- package/dist/{cjs/runtime/is-node.js.flow → browser/runtime/is-server-environment.js.flow} +4 -4
- package/dist/browser/runtime/is-server-environment.js.map +1 -0
- package/dist/browser/runtime/sheet.js.flow +1 -1
- package/dist/browser/runtime/sheet.js.map +1 -1
- package/dist/browser/runtime/style-cache.js +1 -1
- package/dist/browser/runtime/style-cache.js.flow +1 -1
- package/dist/browser/runtime/style-cache.js.map +1 -1
- package/dist/browser/runtime/style.js +1 -1
- package/dist/browser/runtime/style.js.flow +1 -1
- package/dist/browser/runtime/style.js.map +1 -1
- package/dist/browser/runtime/types.js.flow +2 -2
- package/dist/browser/runtime/types.js.map +1 -1
- package/dist/browser/runtime.js.flow +1 -1
- package/dist/browser/runtime.js.map +1 -1
- package/dist/browser/styled/index.d.ts +10 -23
- package/dist/browser/styled/index.js.flow +45 -46
- package/dist/browser/styled/index.js.map +1 -1
- package/dist/browser/types.d.ts +9 -5
- package/dist/browser/types.js.flow +13 -10
- package/dist/browser/types.js.map +1 -1
- package/dist/browser/utils/error.js.flow +1 -1
- package/dist/browser/utils/error.js.map +1 -1
- package/dist/cjs/class-names/index.d.ts +11 -5
- package/dist/cjs/class-names/index.js.flow +29 -20
- package/dist/cjs/class-names/index.js.map +1 -1
- package/dist/cjs/css/index.d.ts +3 -3
- package/dist/cjs/css/index.js.flow +24 -23
- package/dist/cjs/css/index.js.map +1 -1
- package/dist/cjs/index.d.ts +2 -3
- package/dist/cjs/index.js.flow +4 -7
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/jsx/jsx-dev-runtime.js +5 -1
- package/dist/cjs/jsx/jsx-dev-runtime.js.map +1 -1
- package/dist/cjs/jsx/jsx-local-namespace.d.ts +2 -2
- package/dist/cjs/jsx/jsx-local-namespace.js.map +1 -1
- package/dist/cjs/jsx/jsx-runtime.js +5 -1
- package/dist/cjs/jsx/jsx-runtime.js.map +1 -1
- package/dist/cjs/keyframes/__fixtures__/index.js.map +1 -1
- package/dist/cjs/keyframes/index.d.ts +1 -1
- package/dist/cjs/keyframes/index.js.flow +25 -31
- package/dist/cjs/keyframes/index.js.map +1 -1
- package/dist/cjs/runtime/ax.js.flow +1 -1
- package/dist/cjs/runtime/ax.js.map +1 -1
- package/dist/cjs/runtime/cache.js.flow +1 -1
- package/dist/cjs/runtime/cache.js.map +1 -1
- package/dist/cjs/runtime/css-custom-property.js.flow +1 -1
- package/dist/cjs/runtime/css-custom-property.js.map +1 -1
- package/dist/cjs/runtime/dev-warnings.js.flow +1 -1
- package/dist/cjs/runtime/dev-warnings.js.map +1 -1
- package/dist/cjs/runtime/index.js.flow +1 -1
- package/dist/cjs/runtime/index.js.map +1 -1
- package/dist/{esm/runtime/is-node.d.ts → cjs/runtime/is-server-environment.d.ts} +2 -2
- package/dist/cjs/runtime/is-server-environment.js +35 -0
- package/dist/{esm/runtime/is-node.js.flow → cjs/runtime/is-server-environment.js.flow} +4 -4
- package/dist/cjs/runtime/is-server-environment.js.map +1 -0
- package/dist/cjs/runtime/sheet.js.flow +1 -1
- package/dist/cjs/runtime/sheet.js.map +1 -1
- package/dist/cjs/runtime/style-cache.js +10 -6
- package/dist/cjs/runtime/style-cache.js.flow +1 -1
- package/dist/cjs/runtime/style-cache.js.map +1 -1
- package/dist/cjs/runtime/style.js +7 -3
- package/dist/cjs/runtime/style.js.flow +1 -1
- package/dist/cjs/runtime/style.js.map +1 -1
- package/dist/cjs/runtime/types.js.flow +2 -2
- package/dist/cjs/runtime/types.js.map +1 -1
- package/dist/cjs/runtime.js.flow +1 -1
- package/dist/cjs/runtime.js.map +1 -1
- package/dist/cjs/styled/index.d.ts +10 -23
- package/dist/cjs/styled/index.js.flow +45 -46
- package/dist/cjs/styled/index.js.map +1 -1
- package/dist/cjs/types.d.ts +9 -5
- package/dist/cjs/types.js.flow +13 -10
- package/dist/cjs/types.js.map +1 -1
- package/dist/cjs/utils/error.js.flow +1 -1
- package/dist/cjs/utils/error.js.map +1 -1
- package/dist/esm/class-names/index.d.ts +11 -5
- package/dist/esm/class-names/index.js.flow +29 -20
- package/dist/esm/class-names/index.js.map +1 -1
- package/dist/esm/css/index.d.ts +3 -3
- package/dist/esm/css/index.js.flow +24 -23
- package/dist/esm/css/index.js.map +1 -1
- package/dist/esm/index.d.ts +2 -3
- package/dist/esm/index.js.flow +4 -7
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/jsx/jsx-dev-runtime.js.map +1 -1
- package/dist/esm/jsx/jsx-local-namespace.d.ts +2 -2
- package/dist/esm/jsx/jsx-local-namespace.js.map +1 -1
- package/dist/esm/jsx/jsx-runtime.js.map +1 -1
- package/dist/esm/keyframes/__fixtures__/index.js.map +1 -1
- package/dist/esm/keyframes/index.d.ts +1 -1
- package/dist/esm/keyframes/index.js.flow +25 -31
- package/dist/esm/keyframes/index.js.map +1 -1
- package/dist/esm/runtime/ax.js.flow +1 -1
- package/dist/esm/runtime/ax.js.map +1 -1
- package/dist/esm/runtime/cache.js.flow +1 -1
- package/dist/esm/runtime/cache.js.map +1 -1
- package/dist/esm/runtime/css-custom-property.js.flow +1 -1
- package/dist/esm/runtime/css-custom-property.js.map +1 -1
- package/dist/esm/runtime/dev-warnings.js.flow +1 -1
- package/dist/esm/runtime/dev-warnings.js.map +1 -1
- package/dist/esm/runtime/index.js.flow +1 -1
- package/dist/esm/runtime/index.js.map +1 -1
- package/dist/{cjs/runtime/is-node.d.ts → esm/runtime/is-server-environment.d.ts} +2 -2
- package/dist/esm/runtime/is-server-environment.js +31 -0
- package/dist/{browser/runtime/is-node.js.flow → esm/runtime/is-server-environment.js.flow} +4 -4
- package/dist/esm/runtime/is-server-environment.js.map +1 -0
- package/dist/esm/runtime/sheet.js.flow +1 -1
- package/dist/esm/runtime/sheet.js.map +1 -1
- package/dist/esm/runtime/style-cache.js +5 -5
- package/dist/esm/runtime/style-cache.js.flow +1 -1
- package/dist/esm/runtime/style-cache.js.map +1 -1
- package/dist/esm/runtime/style.js +2 -2
- package/dist/esm/runtime/style.js.flow +1 -1
- package/dist/esm/runtime/style.js.map +1 -1
- package/dist/esm/runtime/types.js.flow +2 -2
- package/dist/esm/runtime/types.js.map +1 -1
- package/dist/esm/runtime.js.flow +1 -1
- package/dist/esm/runtime.js.map +1 -1
- package/dist/esm/styled/index.d.ts +10 -23
- package/dist/esm/styled/index.js.flow +45 -46
- package/dist/esm/styled/index.js.map +1 -1
- package/dist/esm/types.d.ts +9 -5
- package/dist/esm/types.js.flow +13 -10
- package/dist/esm/types.js.map +1 -1
- package/dist/esm/utils/error.js.flow +1 -1
- package/dist/esm/utils/error.js.map +1 -1
- package/package.json +14 -12
- package/src/__tests__/browser.test.tsx +4 -0
- package/src/__tests__/{display-names.test.tsx → display-names.test.ts} +0 -0
- package/src/__tests__/server-side-hydrate.test.tsx +2 -2
- package/src/class-names/__tests__/types.test.js.flow +10 -3
- package/src/class-names/index.js.flow +29 -20
- package/src/class-names/{index.tsx → index.ts} +15 -9
- package/src/css/__tests__/types.test.js.flow +25 -0
- package/src/css/index.js.flow +24 -23
- package/src/css/{index.tsx → index.ts} +9 -14
- package/src/index.js.flow +4 -7
- package/src/{index.tsx → index.ts} +3 -4
- package/src/jsx/{jsx-dev-runtime.tsx → jsx-dev-runtime.ts} +0 -0
- package/src/jsx/{jsx-local-namespace.tsx → jsx-local-namespace.ts} +2 -2
- package/src/jsx/{jsx-runtime.tsx → jsx-runtime.ts} +0 -0
- package/src/keyframes/__fixtures__/{index.tsx → index.ts} +0 -0
- package/src/keyframes/__tests__/index.test.tsx +4 -0
- package/src/keyframes/index.js.flow +25 -31
- package/src/keyframes/{index.tsx → index.ts} +1 -1
- package/src/runtime/__perf__/cs.test.tsx +137 -92
- package/src/runtime/__perf__/utils/cs.tsx +15 -15
- package/src/runtime/__perf__/utils/{sheet.tsx → sheet.ts} +0 -0
- package/src/runtime/__tests__/{ax.test.tsx → ax.test.ts} +0 -0
- package/src/runtime/__tests__/{css-custom-property.test.tsx → css-custom-property.test.ts} +0 -0
- package/src/runtime/__tests__/style.test.tsx +4 -0
- package/src/runtime/ax.js.flow +1 -1
- package/src/runtime/{ax.tsx → ax.ts} +0 -0
- package/src/runtime/cache.js.flow +1 -1
- package/src/runtime/{cache.tsx → cache.ts} +0 -0
- package/src/runtime/css-custom-property.js.flow +1 -1
- package/src/runtime/{css-custom-property.tsx → css-custom-property.ts} +0 -0
- package/src/runtime/dev-warnings.js.flow +1 -1
- package/src/runtime/{dev-warnings.tsx → dev-warnings.ts} +0 -0
- package/src/runtime/index.js.flow +1 -1
- package/src/runtime/{index.tsx → index.ts} +0 -0
- package/src/runtime/{is-node.js.flow → is-server-environment.js.flow} +4 -4
- package/src/runtime/is-server-environment.ts +29 -0
- package/src/runtime/sheet.js.flow +1 -1
- package/src/runtime/{sheet.tsx → sheet.ts} +0 -0
- package/src/runtime/style-cache.js.flow +1 -1
- package/src/runtime/style-cache.tsx +5 -5
- package/src/runtime/style.js.flow +1 -1
- package/src/runtime/style.tsx +2 -2
- package/src/runtime/types.js.flow +2 -2
- package/src/runtime/{types.tsx → types.ts} +0 -0
- package/src/runtime.js.flow +1 -1
- package/src/{runtime.tsx → runtime.ts} +0 -0
- package/src/styled/__tests__/index.test.tsx +1 -1
- package/src/styled/__tests__/types.test.js.flow +65 -11
- package/src/styled/index.js.flow +45 -46
- package/src/styled/index.ts +94 -0
- package/src/types.js.flow +13 -10
- package/src/types.ts +35 -0
- package/src/utils/error.js.flow +1 -1
- package/src/utils/{error.tsx → error.ts} +0 -0
- package/dist/browser/runtime/is-node.js +0 -16
- package/dist/browser/runtime/is-node.js.map +0 -1
- package/dist/cjs/runtime/is-node.js +0 -20
- package/dist/cjs/runtime/is-node.js.map +0 -1
- package/dist/esm/runtime/is-node.js +0 -16
- package/dist/esm/runtime/is-node.js.map +0 -1
- package/src/runtime/is-node.tsx +0 -15
- package/src/styled/index.tsx +0 -112
- package/src/types.tsx +0 -27
|
@@ -1,33 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Flowtype definitions for index
|
|
3
3
|
* Generated by Flowgen from a Typescript Definition
|
|
4
|
-
* Flowgen v1.
|
|
4
|
+
* Flowgen v1.17.0
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
7
|
import type { BasicTemplateInterpolations, CSSProps } from '../types';
|
|
8
|
-
export type KeyframeSteps = string | { [key: string]: CSSProps
|
|
8
|
+
export type KeyframeSteps = string | { [key: string]: CSSProps<void> };
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* ## Keyframes
|
|
11
11
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* from { opacity: 1; }
|
|
15
|
-
* to { opacity: 0; }
|
|
16
|
-
* `;
|
|
17
|
-
* ```
|
|
18
|
-
* @param _strings The input string values
|
|
19
|
-
* @param _interpolations The arguments used in the expression
|
|
20
|
-
*/
|
|
21
|
-
declare export function keyframes(
|
|
22
|
-
_strings: $ReadOnlyArray<string>,
|
|
23
|
-
..._interpolations: BasicTemplateInterpolations[]
|
|
24
|
-
): string;
|
|
25
|
-
/**
|
|
26
|
-
* Create keyframes using:
|
|
12
|
+
* Define keyframes to be used in a [CSS animation](https://developer.mozilla.org/en-US/docs/Web/CSS/animation).
|
|
13
|
+
* For further details [read the API documentation](https://compiledcssinjs.com/docs/api-keyframes).
|
|
27
14
|
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* ```
|
|
15
|
+
* ### Style with objects
|
|
16
|
+
* @example ```
|
|
31
17
|
* const fadeOut = keyframes({
|
|
32
18
|
* from: {
|
|
33
19
|
* opacity: 1,
|
|
@@ -36,19 +22,27 @@ declare export function keyframes(
|
|
|
36
22
|
* opacity: 0,
|
|
37
23
|
* },
|
|
38
24
|
* });
|
|
39
|
-
* ```
|
|
40
|
-
*
|
|
41
|
-
* 2. A string
|
|
42
25
|
*
|
|
43
|
-
*
|
|
44
|
-
* const fadeOut = keyframes('from { opacity: 1; } to { opacity: 0; }');
|
|
26
|
+
* <div css={{ animation: `${fadeOut} 2s` }} />
|
|
45
27
|
* ```
|
|
46
28
|
*
|
|
47
|
-
*
|
|
29
|
+
* ### Style with template literals
|
|
30
|
+
* @example ```
|
|
31
|
+
* const fadeOut = keyframes`
|
|
32
|
+
* from {
|
|
33
|
+
* opacity: 1;
|
|
34
|
+
* }
|
|
48
35
|
*
|
|
36
|
+
* to {
|
|
37
|
+
* opacity: 0;
|
|
38
|
+
* }
|
|
39
|
+
* `;
|
|
40
|
+
*
|
|
41
|
+
* <div css={{ animation: `${fadeOut} 2s` }} />
|
|
49
42
|
* ```
|
|
50
|
-
* const fadeOut = keyframes(`from { opacity: 1; } to { opacity: 0; }`);
|
|
51
|
-
* ```
|
|
52
|
-
* @param _steps The waypoints along the animation sequence
|
|
53
43
|
*/
|
|
54
|
-
declare export function keyframes(
|
|
44
|
+
declare export function keyframes(steps: KeyframeSteps): string;
|
|
45
|
+
declare export function keyframes(
|
|
46
|
+
strings: $ReadOnlyArray<string>,
|
|
47
|
+
...interpolations: BasicTemplateInterpolations[]
|
|
48
|
+
): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/keyframes/index.
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/keyframes/index.ts"],"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ax.js","sourceRoot":"","sources":["../../../src/runtime/ax.
|
|
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,SAAwB,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;AAlCD,qBAkCC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache.js","sourceRoot":"","sources":["../../../src/runtime/cache.
|
|
1
|
+
{"version":3,"file":"cache.js","sourceRoot":"","sources":["../../../src/runtime/cache.ts"],"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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"css-custom-property.js","sourceRoot":"","sources":["../../../src/runtime/css-custom-property.
|
|
1
|
+
{"version":3,"file":"css-custom-property.js","sourceRoot":"","sources":["../../../src/runtime/css-custom-property.ts"],"names":[],"mappings":";;AAAA;;;;;;;;GAQG;AACH,SAAwB,sBAAsB,CAC5C,KAAyC,EACzC,MAAkC,EAClC,MAAkC;IAElC,IAAI,KAAK,IAAI,SAAS,EAAE;QACtB,IAAI,MAAM,EAAE;YACV,IAAI,MAAM,EAAE;gBACV,OAAO,MAAM,GAAG,KAAK,GAAG,MAAM,CAAC;aAChC;YAED,OAAO,KAAK,GAAG,MAAM,CAAC;SACvB;QAED,OAAO,KAAK,CAAC;KACd;IAED,qFAAqF;IACrF,4EAA4E;IAC5E,kEAAkE;IAClE,OAAO,WAAW,CAAC;AACrB,CAAC;AArBD,yCAqBC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev-warnings.js","sourceRoot":"","sources":["../../../src/runtime/dev-warnings.
|
|
1
|
+
{"version":3,"file":"dev-warnings.js","sourceRoot":"","sources":["../../../src/runtime/dev-warnings.ts"],"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,OAAO,CAAC,KAAK,OAAb,OAAO,iBACL,06DAUA,GAAG,OACN,GACM,IAAI;AAbT,CAcC,CAAC;AAEG,IAAM,eAAe,GAAG,UAAC,KAAa;IAC3C,IAAI,SAAS,CAAC,KAAK,CAAC,EAAE;QACpB,OAAO;KACR;IAED,IAAM,wBAAwB,GAC5B,eAAe,CAAC,GAAG,CAAC,UAAC,QAAQ,IAAK,OAAA,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAxB,CAAwB,CAAC,CAAC,MAAM,CAAC,OAAO,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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/runtime/index.
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/runtime/index.ts"],"names":[],"mappings":";;;;;;AAAA,iCAAwC;AAA/B,4GAAA,OAAO,OAAM;AACtB,6CAA8C;AAArC,kHAAA,OAAO,OAAM;AACtB,2BAAqC;AAA5B,yGAAA,OAAO,OAAM;AACtB,6DAAsD;AAA7C,0HAAA,OAAO,OAAM"}
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* When using this it will remove any node code from the browser bundle - for example:
|
|
6
6
|
*
|
|
7
7
|
* ```js
|
|
8
|
-
* if (
|
|
8
|
+
* if (isServerEnvironment()) {
|
|
9
9
|
* // This code will be removed from the browser bundle
|
|
10
10
|
* }
|
|
11
11
|
* ```
|
|
12
12
|
*/
|
|
13
|
-
export declare const
|
|
13
|
+
export declare const isServerEnvironment: () => boolean;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isServerEnvironment = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* @see https://github.com/jsdom/jsdom/releases/tag/12.0.0
|
|
6
|
+
* @see https://github.com/jsdom/jsdom/issues/1537
|
|
7
|
+
*/
|
|
8
|
+
var isJsDomEnvironment = function () {
|
|
9
|
+
return window.name === 'nodejs' ||
|
|
10
|
+
navigator.userAgent.includes('Node.js') ||
|
|
11
|
+
navigator.userAgent.includes('jsdom');
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Returns `true` when inside a node environment,
|
|
15
|
+
* else `false`.
|
|
16
|
+
*
|
|
17
|
+
* When using this it will remove any node code from the browser bundle - for example:
|
|
18
|
+
*
|
|
19
|
+
* ```js
|
|
20
|
+
* if (isServerEnvironment()) {
|
|
21
|
+
* // This code will be removed from the browser bundle
|
|
22
|
+
* }
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
var isServerEnvironment = function () {
|
|
26
|
+
if (typeof process !== 'undefined' && process.versions != null && process.versions.node != null) {
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
if (isJsDomEnvironment()) {
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
return false;
|
|
33
|
+
};
|
|
34
|
+
exports.isServerEnvironment = isServerEnvironment;
|
|
35
|
+
//# sourceMappingURL=is-server-environment.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Flowtype definitions for is-
|
|
2
|
+
* Flowtype definitions for is-server-environment
|
|
3
3
|
* Generated by Flowgen from a Typescript Definition
|
|
4
|
-
* Flowgen v1.
|
|
4
|
+
* Flowgen v1.17.0
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
7
|
/**
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
* When using this it will remove any node code from the browser bundle - for example:
|
|
12
12
|
*
|
|
13
13
|
* ```js
|
|
14
|
-
* if (
|
|
14
|
+
* if (isServerEnvironment()) {
|
|
15
15
|
* // This code will be removed from the browser bundle
|
|
16
16
|
* }
|
|
17
17
|
* ```
|
|
18
18
|
*/
|
|
19
|
-
declare export var
|
|
19
|
+
declare export var isServerEnvironment: () => boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-server-environment.js","sourceRoot":"","sources":["../../../src/runtime/is-server-environment.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,IAAM,kBAAkB,GAAG;IACzB,OAAA,MAAM,CAAC,IAAI,KAAK,QAAQ;QACxB,SAAS,CAAC,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC;QACvC,SAAS,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC;AAFrC,CAEqC,CAAC;AACxC;;;;;;;;;;;GAWG;AACI,IAAM,mBAAmB,GAAG;IACjC,IAAI,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,CAAC,QAAQ,IAAI,IAAI,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,IAAI,IAAI,EAAE;QAC/F,OAAO,IAAI,CAAC;KACb;IACD,IAAI,kBAAkB,EAAE,EAAE;QACxB,OAAO,IAAI,CAAC;KACb;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AARW,QAAA,mBAAmB,uBAQ9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sheet.js","sourceRoot":"","sources":["../../../src/runtime/sheet.
|
|
1
|
+
{"version":3,"file":"sheet.js","sourceRoot":"","sources":["../../../src/runtime/sheet.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -23,13 +27,13 @@ exports.useCache = void 0;
|
|
|
23
27
|
var React = __importStar(require("react"));
|
|
24
28
|
var react_1 = require("react");
|
|
25
29
|
var cache_1 = require("./cache");
|
|
26
|
-
var
|
|
30
|
+
var is_server_environment_1 = require("./is-server-environment");
|
|
27
31
|
/**
|
|
28
32
|
* Cache to hold already used styles.
|
|
29
33
|
* React Context on the server - singleton object on the client.
|
|
30
34
|
*/
|
|
31
|
-
var Cache = (0,
|
|
32
|
-
if (!(0,
|
|
35
|
+
var Cache = (0, is_server_environment_1.isServerEnvironment)() ? (0, react_1.createContext)(null) : {};
|
|
36
|
+
if (!(0, is_server_environment_1.isServerEnvironment)()) {
|
|
33
37
|
/**
|
|
34
38
|
* Iterates through all found style elements generated when server side rendering.
|
|
35
39
|
*
|
|
@@ -48,7 +52,7 @@ var useCache = function () {
|
|
|
48
52
|
if (false) {
|
|
49
53
|
return {};
|
|
50
54
|
}
|
|
51
|
-
if ((0,
|
|
55
|
+
if ((0, is_server_environment_1.isServerEnvironment)()) {
|
|
52
56
|
// On the server we use React Context to we don't leak the cache between SSR calls.
|
|
53
57
|
// During runtime this hook isn't conditionally called - it is at build time that the flow gets decided.
|
|
54
58
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
@@ -65,7 +69,7 @@ exports.useCache = useCache;
|
|
|
65
69
|
* On the browser this turns into a fragment with no React Context.
|
|
66
70
|
*/
|
|
67
71
|
var StyleCacheProvider = function (props) {
|
|
68
|
-
if ((0,
|
|
72
|
+
if ((0, is_server_environment_1.isServerEnvironment)()) {
|
|
69
73
|
// This code path isn't conditionally called at build time - safe to ignore.
|
|
70
74
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
71
75
|
var inserted = (0, exports.useCache)();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style-cache.js","sourceRoot":"","sources":["../../../src/runtime/style-cache.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"style-cache.js","sourceRoot":"","sources":["../../../src/runtime/style-cache.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA+B;AAC/B,+BAAkD;AAElD,iCAA0C;AAC1C,iEAA8D;AAG9D;;;GAGG;AACH,IAAM,KAAK,GAAQ,IAAA,2CAAmB,GAAE,CAAC,CAAC,CAAC,IAAA,qBAAa,EAA8B,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAEjG,IAAI,CAAC,IAAA,2CAAmB,GAAE,EAAE;IAC1B;;;;OAIG;IACH,IAAM,SAAS,GAAG,QAAQ,CAAC,gBAAgB,CAAmB,mBAAmB,CAAC,CAAC;IACnF,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACzC,iGAAiG;QACjG,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;KACzC;CACF;AAED;;GAEG;AACI,IAAM,QAAQ,GAAiB;IACpC,WAAuB;QACrB,OAAO,EAAE,CAAC;KACX;IAED,IAAI,IAAA,2CAAmB,GAAE,EAAE;QACzB,mFAAmF;QACnF,wGAAwG;QACxG,sDAAsD;QACtD,OAAO,IAAA,kBAAU,EAAC,KAAK,CAAC,IAAI,EAAE,CAAC;KAChC;IAED,6CAA6C;IAC7C,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAdW,QAAA,QAAQ,YAcnB;AAEF;;;;;GAKG;AACH,IAAM,kBAAkB,GAAsB,UAAC,KAAK;IAClD,IAAI,IAAA,2CAAmB,GAAE,EAAE;QACzB,4EAA4E;QAC5E,sDAAsD;QACtD,IAAM,QAAQ,GAAG,IAAA,gBAAQ,GAAE,CAAC;QAC5B,OAAO,oBAAC,KAAK,CAAC,QAAQ,IAAC,KAAK,EAAE,QAAQ,IAAG,KAAK,CAAC,QAAQ,CAAkB,CAAC;KAC3E;IAED,OAAO,KAAK,CAAC,QAAuB,CAAC;AACvC,CAAC,CAAC;AAEF,kBAAe,kBAAkB,CAAC"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -24,7 +28,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
24
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
29
|
var react_1 = __importDefault(require("react"));
|
|
26
30
|
var dev_warnings_1 = require("./dev-warnings");
|
|
27
|
-
var
|
|
31
|
+
var is_server_environment_1 = require("./is-server-environment");
|
|
28
32
|
var sheet_1 = __importStar(require("./sheet"));
|
|
29
33
|
var style_cache_1 = require("./style-cache");
|
|
30
34
|
function Style(props) {
|
|
@@ -33,7 +37,7 @@ function Style(props) {
|
|
|
33
37
|
props.children.forEach(dev_warnings_1.analyzeCssInDev);
|
|
34
38
|
}
|
|
35
39
|
if (props.children.length) {
|
|
36
|
-
if ((0,
|
|
40
|
+
if ((0, is_server_environment_1.isServerEnvironment)()) {
|
|
37
41
|
var bucketedSheets_1 = {};
|
|
38
42
|
var hasSheets = false;
|
|
39
43
|
for (var i = 0; i < props.children.length; i++) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.js","sourceRoot":"","sources":["../../../src/runtime/style.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"style.js","sourceRoot":"","sources":["../../../src/runtime/style.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAE1B,+CAAiD;AACjD,iEAA8D;AAC9D,+CAA8E;AAC9E,6CAAyC;AAWzC,SAAwB,KAAK,CAAC,KAAiB;IAC7C,IAAM,QAAQ,GAAG,IAAA,sBAAQ,GAAE,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,CAAC,QAAQ,CAAC,MAAM,EAAE;QACzB,IAAI,IAAA,2CAAmB,GAAE,EAAE;YACzB,IAAM,gBAAc,GAAoC,EAAE,CAAC;YAC3D,IAAI,SAAS,GAAG,KAAK,CAAC;YAEtB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBAC9C,IAAM,KAAK,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;gBAChC,IAAI,QAAQ,CAAC,KAAK,CAAC,EAAE;oBACnB,SAAS;iBACV;qBAAM;oBACL,QAAQ,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;oBACvB,SAAS,GAAG,IAAI,CAAC;iBAClB;gBAED,IAAM,UAAU,GAAG,IAAA,0BAAkB,EAAC,KAAK,CAAC,CAAC;gBAC7C,gBAAc,CAAC,UAAU,CAAC,GAAG,CAAC,gBAAc,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,GAAG,KAAK,CAAC;aACzE;YAED,IAAI,CAAC,SAAS,EAAE;gBACd,OAAO,IAAI,CAAC;aACb;YAED,OAAO,CACL,6DAEE,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,uBAAuB,EAAE;oBACvB,MAAM,EAAE,2BAAmB,CAAC,GAAG,CAAC,UAAC,MAAM,IAAK,OAAA,gBAAc,CAAC,MAAM,CAAC,EAAtB,CAAsB,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;iBAC7E,GACD,CACH,CAAC;SACH;aAAM;YACL,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBAC9C,IAAM,KAAK,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;gBAChC,IAAI,QAAQ,CAAC,KAAK,CAAC,EAAE;oBACnB,SAAS;iBACV;gBAED,QAAQ,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;gBACvB,IAAA,eAAU,EAAC,KAAK,EAAE,KAAK,CAAC,CAAC;aAC1B;SACF;KACF;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AApDD,wBAoDC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Flowtype definitions for types
|
|
3
3
|
* Generated by Flowgen from a Typescript Definition
|
|
4
|
-
* Flowgen v1.
|
|
4
|
+
* Flowgen v1.17.0
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
7
|
export interface StyleSheetOpts {
|
|
@@ -16,7 +16,7 @@ export interface StyleSheetOpts {
|
|
|
16
16
|
* Buckets under which we will group our stylesheets
|
|
17
17
|
*/
|
|
18
18
|
export type Bucket = '' | 'l' | 'v' | 'w' | 'f' | 'i' | 'h' | 'a' | 'm';
|
|
19
|
-
export type UseCacheHook = () => { [key: string]: true
|
|
19
|
+
export type UseCacheHook = () => { [key: string]: true };
|
|
20
20
|
export type ProviderComponent = (props: {
|
|
21
21
|
children: React$Node[] | React$Node,
|
|
22
22
|
...
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/runtime/types.
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/runtime/types.ts"],"names":[],"mappings":""}
|
package/dist/cjs/runtime.js.flow
CHANGED
package/dist/cjs/runtime.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/runtime.
|
|
1
|
+
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/runtime.ts"],"names":[],"mappings":";;;AAAA,yCAAiD;AAAxC,2FAAA,EAAE,OAAA;AAAE,2FAAA,EAAE,OAAA;AAAE,2FAAA,EAAE,OAAA;AAAE,2FAAA,EAAE,OAAA"}
|
|
@@ -1,35 +1,22 @@
|
|
|
1
1
|
import type { ComponentType } from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
/**
|
|
4
|
-
* Typing for the CSS object.
|
|
5
|
-
*/
|
|
6
|
-
export declare type CssObject<TProps> = CssFunction<FunctionInterpolation<TProps>>;
|
|
2
|
+
import type { CssType, CssFunction } from '../types';
|
|
7
3
|
/**
|
|
8
4
|
* Extra props added to the output Styled Component.
|
|
9
5
|
*/
|
|
10
6
|
export interface StyledProps {
|
|
11
7
|
as?: keyof JSX.IntrinsicElements;
|
|
12
8
|
}
|
|
13
|
-
export declare type
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
*/
|
|
19
|
-
export interface StyledFunctionFromTag<TTag extends keyof JSX.IntrinsicElements> {
|
|
20
|
-
<TProps extends unknown>(css: CssObject<TProps> | CssObject<TProps>[], ...interpolations: Interpolations<TProps>): React.ComponentType<TProps & JSX.IntrinsicElements[TTag] & StyledProps>;
|
|
21
|
-
}
|
|
22
|
-
export interface StyledFunctionFromComponent<TInheritedProps extends unknown> {
|
|
23
|
-
<TProps extends unknown>(css: CssObject<TProps> | TemplateStringsArray, ...interpolations: Interpolations<TProps>): React.ComponentType<TProps & StyledProps & TInheritedProps>;
|
|
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> {
|
|
12
|
+
<TProps = {}>(...css: ObjectInterpolation<TProps>[]): React.ComponentType<TProps & ComponentProps & StyledProps>;
|
|
13
|
+
<TProps = {}>(template: TemplateStringsArray, ...interpolations: TemplateStringsInterpolation<TProps>[]): React.ComponentType<TProps & ComponentProps & StyledProps>;
|
|
24
14
|
}
|
|
25
15
|
export declare type StyledComponentMap = {
|
|
26
|
-
[Tag in keyof JSX.IntrinsicElements]:
|
|
16
|
+
[Tag in keyof JSX.IntrinsicElements]: StyledComponent<JSX.IntrinsicElements[Tag]>;
|
|
27
17
|
};
|
|
28
|
-
export interface
|
|
29
|
-
|
|
30
|
-
* Typing to enable consumers to compose components, e.g: `styled(Component)`
|
|
31
|
-
*/
|
|
32
|
-
<TInheritedProps extends unknown>(Component: ComponentType<TInheritedProps>): StyledFunctionFromComponent<TInheritedProps>;
|
|
18
|
+
export interface CreateStyledComponent extends StyledComponentMap {
|
|
19
|
+
<TInheritedProps extends unknown>(Component: ComponentType<TInheritedProps>): StyledComponent<TInheritedProps>;
|
|
33
20
|
}
|
|
34
21
|
/**
|
|
35
22
|
* ## Styled component
|
|
@@ -72,4 +59,4 @@ export interface StyledComponentInstantiator extends StyledComponentMap {
|
|
|
72
59
|
* );
|
|
73
60
|
* ```
|
|
74
61
|
*/
|
|
75
|
-
export declare const styled:
|
|
62
|
+
export declare const styled: CreateStyledComponent;
|
|
@@ -1,69 +1,68 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Flowtype definitions for index
|
|
3
3
|
* Generated by Flowgen from a Typescript Definition
|
|
4
|
-
* Flowgen v1.
|
|
4
|
+
* Flowgen v1.17.0
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
7
|
import type { ComponentType } from 'react';
|
|
8
|
-
import type {
|
|
9
|
-
/**
|
|
10
|
-
* Typing for the CSS object.
|
|
11
|
-
*/
|
|
12
|
-
export type CssObject<TProps> = CssFunction<FunctionInterpolation<TProps>>;
|
|
8
|
+
import type { CssType, CssFunction } from '../types';
|
|
13
9
|
/**
|
|
14
10
|
* Extra props added to the output Styled Component.
|
|
15
11
|
*/
|
|
16
12
|
export type StyledProps = {
|
|
17
13
|
as?: $Keys<$JSXIntrinsics>,
|
|
18
14
|
};
|
|
19
|
-
export type
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
)
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
*/
|
|
30
|
-
export interface StyledFunctionFromTag<TTag: $Keys<$JSXIntrinsics>> {
|
|
31
|
-
<TProps: mixed>(
|
|
32
|
-
css: CssObject<TProps> | $ReadOnlyArray<CssObject<TProps>>,
|
|
33
|
-
...interpolations: Interpolations<TProps>
|
|
34
|
-
): React$ComponentType<{
|
|
35
|
-
...TProps,
|
|
36
|
-
...$Exact<$ElementType<$JSXIntrinsics, TTag>>,
|
|
37
|
-
...StyledProps,
|
|
38
|
-
}>;
|
|
39
|
-
}
|
|
40
|
-
export interface StyledFunctionFromComponent<TInheritedProps: mixed> {
|
|
41
|
-
<TProps: mixed>(
|
|
42
|
-
css: CssObject<TProps> | $ReadOnlyArray<string>,
|
|
43
|
-
...interpolations: Interpolations<TProps>
|
|
44
|
-
): React$ComponentType<{ ...TProps, ...StyledProps, ...TInheritedProps }>;
|
|
15
|
+
export type ObjectInterpolation<TProps> = CssType<TProps> | CssType<TProps>[];
|
|
16
|
+
export type TemplateStringsInterpolation<TProps> = CssFunction<TProps> | CssFunction<TProps>[];
|
|
17
|
+
export interface StyledComponent<ComponentProps: mixed> {
|
|
18
|
+
<TProps>(
|
|
19
|
+
...css: ObjectInterpolation<TProps>[]
|
|
20
|
+
): React$ComponentType<{ ...TProps, ...ComponentProps, ...StyledProps }>;
|
|
21
|
+
<TProps>(
|
|
22
|
+
template: $ReadOnlyArray<string>,
|
|
23
|
+
...interpolations: TemplateStringsInterpolation<TProps>[]
|
|
24
|
+
): React$ComponentType<{ ...TProps, ...ComponentProps, ...StyledProps }>;
|
|
45
25
|
}
|
|
46
|
-
export type StyledComponentMap = $ObjMapi<$JSXIntrinsics, <Tag>(Tag) =>
|
|
47
|
-
export type
|
|
48
|
-
/**
|
|
49
|
-
* Typing to enable consumers to compose components, e.g: `styled(Component)`
|
|
50
|
-
*/
|
|
26
|
+
export type StyledComponentMap = $ObjMapi<$JSXIntrinsics, <Tag>(Tag) => StyledComponent<mixed>>;
|
|
27
|
+
export type CreateStyledComponent = {
|
|
51
28
|
<TInheritedProps: mixed>(
|
|
52
29
|
Component: ComponentType<TInheritedProps>
|
|
53
|
-
):
|
|
30
|
+
): StyledComponent<TInheritedProps>,
|
|
54
31
|
...
|
|
55
32
|
} & StyledComponentMap;
|
|
56
33
|
/**
|
|
57
|
-
*
|
|
34
|
+
* ## Styled component
|
|
58
35
|
*
|
|
36
|
+
* Create a component that styles a JSX element which comes with built-in behavior such as `ref` and `as` prop support.
|
|
37
|
+
* For further details [read the documentation](https://compiledcssinjs.com/docs/api-styled).
|
|
38
|
+
*
|
|
39
|
+
* ### Style with objects
|
|
40
|
+
* @example ```
|
|
41
|
+
* styled.div({
|
|
42
|
+
* fontSize: 12,
|
|
43
|
+
* });
|
|
59
44
|
* ```
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
* styled.div
|
|
45
|
+
*
|
|
46
|
+
* ### Style with template literals
|
|
47
|
+
* @example ```
|
|
48
|
+
* styled.div`
|
|
49
|
+
* font-size: 12px
|
|
50
|
+
* `;
|
|
64
51
|
* ```
|
|
65
52
|
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
53
|
+
* ### Compose styles with arrays
|
|
54
|
+
* @example ```
|
|
55
|
+
* import type { css } from '@compiled/react';
|
|
56
|
+
*
|
|
57
|
+
* styled.div([
|
|
58
|
+
* { fontSize: 12 },
|
|
59
|
+
* css`font-size: 12px;`
|
|
60
|
+
* ]);
|
|
61
|
+
*
|
|
62
|
+
* styled.div(
|
|
63
|
+
* { fontSize: 12 },
|
|
64
|
+
* css`font-size: 12px`
|
|
65
|
+
* );
|
|
66
|
+
* ```
|
|
68
67
|
*/
|
|
69
|
-
declare export var styled:
|
|
68
|
+
declare export var styled: CreateStyledComponent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/styled/index.
|
|
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"}
|
package/dist/cjs/types.d.ts
CHANGED
|
@@ -4,13 +4,17 @@ import type * as CSS from 'csstype';
|
|
|
4
4
|
*/
|
|
5
5
|
export declare type BasicTemplateInterpolations = string | number;
|
|
6
6
|
export interface FunctionInterpolation<TProps> {
|
|
7
|
-
(props: TProps):
|
|
7
|
+
(props: TProps): CssFunction<TProps>;
|
|
8
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* Possible types for a CSS value
|
|
11
|
+
*/
|
|
12
|
+
export declare type CssType<TProps> = CSSProps<TProps> | CssObject<TProps> | FunctionInterpolation<TProps> | string;
|
|
9
13
|
/**
|
|
10
14
|
* These are all the CSS props that will exist.
|
|
11
15
|
*/
|
|
12
|
-
export declare type CSSProps = CSS.Properties<
|
|
13
|
-
export declare type
|
|
14
|
-
[key: string]:
|
|
16
|
+
export declare type CSSProps<TProps> = CSS.Properties<CssFunction<TProps>>;
|
|
17
|
+
export declare type CssObject<TProps> = {
|
|
18
|
+
[key: string]: CssFunction<TProps>;
|
|
15
19
|
};
|
|
16
|
-
export declare type CssFunction<
|
|
20
|
+
export declare type CssFunction<TProps = unknown> = CssType<TProps> | BasicTemplateInterpolations | boolean | undefined;
|