@compiled/react 0.7.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (265) hide show
  1. package/CHANGELOG.md +68 -1
  2. package/dist/browser/class-names/index.d.ts +2 -2
  3. package/dist/browser/class-names/index.js.flow +45 -0
  4. package/dist/browser/class-names/index.js.map +1 -1
  5. package/dist/browser/css/index.d.ts +16 -3
  6. package/dist/browser/css/index.js +1 -13
  7. package/dist/browser/css/index.js.flow +35 -0
  8. package/dist/browser/css/index.js.map +1 -1
  9. package/dist/browser/index.d.ts +15 -23
  10. package/dist/browser/index.js +4 -0
  11. package/dist/browser/index.js.flow +15 -0
  12. package/dist/browser/index.js.map +1 -1
  13. package/dist/browser/jsx/jsx-dev-runtime.d.ts +2 -0
  14. package/dist/browser/jsx/jsx-dev-runtime.js +4 -0
  15. package/dist/browser/jsx/jsx-dev-runtime.js.map +1 -0
  16. package/dist/browser/jsx/jsx-local-namespace.d.ts +40 -0
  17. package/dist/browser/jsx/jsx-local-namespace.js +2 -0
  18. package/dist/browser/jsx/jsx-local-namespace.js.map +1 -0
  19. package/dist/browser/jsx/jsx-runtime.d.ts +2 -0
  20. package/dist/browser/jsx/jsx-runtime.js +4 -0
  21. package/dist/browser/jsx/jsx-runtime.js.map +1 -0
  22. package/dist/browser/keyframes/index.js.flow +54 -0
  23. package/dist/browser/runtime/ax.js.flow +27 -0
  24. package/dist/browser/runtime/css-custom-property.d.ts +1 -1
  25. package/dist/browser/runtime/css-custom-property.js.flow +19 -0
  26. package/dist/browser/runtime/css-custom-property.js.map +1 -1
  27. package/dist/browser/runtime/dev-warnings.d.ts +0 -1
  28. package/dist/browser/runtime/dev-warnings.js +1 -1
  29. package/dist/browser/runtime/dev-warnings.js.flow +7 -0
  30. package/dist/browser/runtime/dev-warnings.js.map +1 -1
  31. package/dist/browser/runtime/index.js.flow +10 -0
  32. package/dist/browser/runtime/is-node.js.flow +19 -0
  33. package/dist/browser/runtime/sheet.d.ts +1 -1
  34. package/dist/browser/runtime/sheet.js.flow +36 -0
  35. package/dist/browser/runtime/style-cache.d.ts +1 -1
  36. package/dist/browser/runtime/style-cache.js.flow +19 -0
  37. package/dist/browser/runtime/style-cache.js.map +1 -1
  38. package/dist/browser/runtime/style.d.ts +1 -1
  39. package/dist/browser/runtime/style.js +2 -2
  40. package/dist/browser/runtime/style.js.flow +17 -0
  41. package/dist/browser/runtime/style.js.map +1 -1
  42. package/dist/browser/runtime/types.js.flow +23 -0
  43. package/dist/browser/runtime.js.flow +7 -0
  44. package/dist/browser/styled/index.d.ts +6 -9
  45. package/dist/browser/styled/index.js.flow +69 -0
  46. package/dist/browser/styled/index.js.map +1 -1
  47. package/dist/browser/types.d.ts +6 -3
  48. package/dist/browser/types.js.flow +29 -0
  49. package/dist/browser/utils/error.js.flow +7 -0
  50. package/dist/cjs/class-names/index.d.ts +2 -2
  51. package/dist/cjs/class-names/index.js.flow +45 -0
  52. package/dist/cjs/class-names/index.js.map +1 -1
  53. package/dist/cjs/css/index.d.ts +16 -3
  54. package/dist/cjs/css/index.js +1 -13
  55. package/dist/cjs/css/index.js.flow +35 -0
  56. package/dist/cjs/css/index.js.map +1 -1
  57. package/dist/cjs/index.d.ts +15 -23
  58. package/dist/cjs/index.js +5 -1
  59. package/dist/cjs/index.js.flow +15 -0
  60. package/dist/cjs/index.js.map +1 -1
  61. package/dist/cjs/jsx/jsx-dev-runtime.d.ts +2 -0
  62. package/dist/cjs/jsx/jsx-dev-runtime.js +16 -0
  63. package/dist/cjs/jsx/jsx-dev-runtime.js.map +1 -0
  64. package/dist/cjs/jsx/jsx-local-namespace.d.ts +40 -0
  65. package/dist/cjs/jsx/jsx-local-namespace.js +3 -0
  66. package/dist/cjs/jsx/jsx-local-namespace.js.map +1 -0
  67. package/dist/cjs/jsx/jsx-runtime.d.ts +2 -0
  68. package/dist/cjs/jsx/jsx-runtime.js +16 -0
  69. package/dist/cjs/jsx/jsx-runtime.js.map +1 -0
  70. package/dist/cjs/keyframes/index.js.flow +54 -0
  71. package/dist/cjs/runtime/ax.js.flow +27 -0
  72. package/dist/cjs/runtime/css-custom-property.d.ts +1 -1
  73. package/dist/cjs/runtime/css-custom-property.js.flow +19 -0
  74. package/dist/cjs/runtime/css-custom-property.js.map +1 -1
  75. package/dist/cjs/runtime/dev-warnings.d.ts +0 -1
  76. package/dist/cjs/runtime/dev-warnings.js +2 -3
  77. package/dist/cjs/runtime/dev-warnings.js.flow +7 -0
  78. package/dist/cjs/runtime/dev-warnings.js.map +1 -1
  79. package/dist/cjs/runtime/index.js.flow +10 -0
  80. package/dist/cjs/runtime/is-node.js.flow +19 -0
  81. package/dist/cjs/runtime/sheet.d.ts +1 -1
  82. package/dist/cjs/runtime/sheet.js.flow +36 -0
  83. package/dist/cjs/runtime/style-cache.d.ts +1 -1
  84. package/dist/cjs/runtime/style-cache.js.flow +19 -0
  85. package/dist/cjs/runtime/style-cache.js.map +1 -1
  86. package/dist/cjs/runtime/style.d.ts +1 -1
  87. package/dist/cjs/runtime/style.js +2 -2
  88. package/dist/cjs/runtime/style.js.flow +17 -0
  89. package/dist/cjs/runtime/style.js.map +1 -1
  90. package/dist/cjs/runtime/types.js.flow +23 -0
  91. package/dist/cjs/runtime.js.flow +7 -0
  92. package/dist/cjs/styled/index.d.ts +6 -9
  93. package/dist/cjs/styled/index.js.flow +69 -0
  94. package/dist/cjs/styled/index.js.map +1 -1
  95. package/dist/cjs/types.d.ts +6 -3
  96. package/dist/cjs/types.js.flow +29 -0
  97. package/dist/cjs/utils/error.js.flow +7 -0
  98. package/dist/esm/class-names/index.d.ts +2 -2
  99. package/dist/esm/class-names/index.js.flow +45 -0
  100. package/dist/esm/class-names/index.js.map +1 -1
  101. package/dist/esm/css/index.d.ts +16 -3
  102. package/dist/esm/css/index.js +1 -13
  103. package/dist/esm/css/index.js.flow +35 -0
  104. package/dist/esm/css/index.js.map +1 -1
  105. package/dist/esm/index.d.ts +15 -23
  106. package/dist/esm/index.js +4 -0
  107. package/dist/esm/index.js.flow +15 -0
  108. package/dist/esm/index.js.map +1 -1
  109. package/dist/esm/jsx/jsx-dev-runtime.d.ts +2 -0
  110. package/dist/esm/jsx/jsx-dev-runtime.js +4 -0
  111. package/dist/esm/jsx/jsx-dev-runtime.js.map +1 -0
  112. package/dist/esm/jsx/jsx-local-namespace.d.ts +40 -0
  113. package/dist/esm/jsx/jsx-local-namespace.js +2 -0
  114. package/dist/esm/jsx/jsx-local-namespace.js.map +1 -0
  115. package/dist/esm/jsx/jsx-runtime.d.ts +2 -0
  116. package/dist/esm/jsx/jsx-runtime.js +4 -0
  117. package/dist/esm/jsx/jsx-runtime.js.map +1 -0
  118. package/dist/esm/keyframes/index.js.flow +54 -0
  119. package/dist/esm/runtime/ax.js.flow +27 -0
  120. package/dist/esm/runtime/css-custom-property.d.ts +1 -1
  121. package/dist/esm/runtime/css-custom-property.js.flow +19 -0
  122. package/dist/esm/runtime/css-custom-property.js.map +1 -1
  123. package/dist/esm/runtime/dev-warnings.d.ts +0 -1
  124. package/dist/esm/runtime/dev-warnings.js +1 -1
  125. package/dist/esm/runtime/dev-warnings.js.flow +7 -0
  126. package/dist/esm/runtime/dev-warnings.js.map +1 -1
  127. package/dist/esm/runtime/index.js.flow +10 -0
  128. package/dist/esm/runtime/is-node.js.flow +19 -0
  129. package/dist/esm/runtime/sheet.d.ts +1 -1
  130. package/dist/esm/runtime/sheet.js.flow +36 -0
  131. package/dist/esm/runtime/style-cache.d.ts +1 -1
  132. package/dist/esm/runtime/style-cache.js.flow +19 -0
  133. package/dist/esm/runtime/style-cache.js.map +1 -1
  134. package/dist/esm/runtime/style.d.ts +1 -1
  135. package/dist/esm/runtime/style.js +2 -2
  136. package/dist/esm/runtime/style.js.flow +17 -0
  137. package/dist/esm/runtime/style.js.map +1 -1
  138. package/dist/esm/runtime/types.js.flow +23 -0
  139. package/dist/esm/runtime.js.flow +7 -0
  140. package/dist/esm/styled/index.d.ts +6 -9
  141. package/dist/esm/styled/index.js.flow +69 -0
  142. package/dist/esm/styled/index.js.map +1 -1
  143. package/dist/esm/types.d.ts +6 -3
  144. package/dist/esm/types.js.flow +29 -0
  145. package/dist/esm/utils/error.js.flow +7 -0
  146. package/jsx-dev-runtime/package.json +6 -0
  147. package/jsx-runtime/package.json +6 -0
  148. package/package.json +41 -15
  149. package/src/__tests__/browser.test.tsx +5 -5
  150. package/src/__tests__/jest-matcher.test.tsx +197 -0
  151. package/src/__tests__/server-side-hydrate.test.tsx +1 -0
  152. package/src/__tests__/ssr.test.tsx +2 -2
  153. package/src/class-names/__tests__/index.test.tsx +1 -1
  154. package/src/class-names/__tests__/types.test.js.flow +28 -0
  155. package/src/class-names/index.js.flow +45 -0
  156. package/src/class-names/index.tsx +3 -2
  157. package/src/css/__tests__/index.test.tsx +40 -0
  158. package/src/css/__tests__/types.test.js.flow +17 -0
  159. package/src/css/index.js.flow +35 -0
  160. package/src/css/index.tsx +27 -3
  161. package/src/index.js.flow +15 -0
  162. package/src/index.tsx +20 -26
  163. package/src/jsx/__tests__/index.test.tsx +1 -2
  164. package/src/jsx/__tests__/jsx-import-source-pragma.test.tsx +37 -0
  165. package/src/jsx/__tests__/jsx-pragma.test.tsx +39 -0
  166. package/src/jsx/jsx-dev-runtime.tsx +5 -0
  167. package/src/jsx/jsx-local-namespace.tsx +49 -0
  168. package/src/jsx/jsx-runtime.tsx +5 -0
  169. package/src/keyframes/__tests__/index.test.tsx +2 -1
  170. package/src/keyframes/__tests__/types.test.js.flow +31 -0
  171. package/src/keyframes/index.js.flow +54 -0
  172. package/src/runtime/__perf__/ax.test.ts +42 -0
  173. package/src/runtime/__perf__/cs.test.tsx +111 -0
  174. package/src/runtime/__perf__/sheet.test.ts +61 -0
  175. package/src/runtime/__perf__/utils/cs.tsx +60 -0
  176. package/src/runtime/__perf__/utils/sheet.tsx +151 -0
  177. package/src/runtime/__tests__/style-ssr.test.tsx +1 -0
  178. package/src/runtime/__tests__/style.test.tsx +92 -58
  179. package/src/runtime/ax.js.flow +27 -0
  180. package/src/runtime/css-custom-property.js.flow +19 -0
  181. package/src/runtime/css-custom-property.tsx +1 -1
  182. package/src/runtime/dev-warnings.js.flow +7 -0
  183. package/src/runtime/dev-warnings.tsx +1 -1
  184. package/src/runtime/index.js.flow +10 -0
  185. package/src/runtime/is-node.js.flow +19 -0
  186. package/src/runtime/sheet.js.flow +36 -0
  187. package/src/runtime/sheet.tsx +1 -1
  188. package/src/runtime/style-cache.js.flow +19 -0
  189. package/src/runtime/style-cache.tsx +2 -1
  190. package/src/runtime/style.js.flow +17 -0
  191. package/src/runtime/style.tsx +4 -3
  192. package/src/runtime/types.js.flow +23 -0
  193. package/src/runtime.js.flow +7 -0
  194. package/src/styled/__tests__/index.test.tsx +3 -3
  195. package/src/styled/__tests__/types.test.js.flow +30 -0
  196. package/src/styled/index.js.flow +69 -0
  197. package/src/styled/index.tsx +7 -10
  198. package/src/types.js.flow +29 -0
  199. package/src/types.tsx +7 -3
  200. package/src/utils/error.js.flow +7 -0
  201. package/dist/browser/codemods/codemods-helpers.d.ts +0 -60
  202. package/dist/browser/codemods/codemods-helpers.js +0 -201
  203. package/dist/browser/codemods/codemods-helpers.js.map +0 -1
  204. package/dist/browser/codemods/constants.d.ts +0 -3
  205. package/dist/browser/codemods/constants.js +0 -4
  206. package/dist/browser/codemods/constants.js.map +0 -1
  207. package/dist/browser/codemods/emotion-to-compiled/emotion-to-compiled.d.ts +0 -3
  208. package/dist/browser/codemods/emotion-to-compiled/emotion-to-compiled.js +0 -178
  209. package/dist/browser/codemods/emotion-to-compiled/emotion-to-compiled.js.map +0 -1
  210. package/dist/browser/codemods/emotion-to-compiled/index.d.ts +0 -1
  211. package/dist/browser/codemods/emotion-to-compiled/index.js +0 -2
  212. package/dist/browser/codemods/emotion-to-compiled/index.js.map +0 -1
  213. package/dist/browser/codemods/styled-components-to-compiled/index.d.ts +0 -1
  214. package/dist/browser/codemods/styled-components-to-compiled/index.js +0 -2
  215. package/dist/browser/codemods/styled-components-to-compiled/index.js.map +0 -1
  216. package/dist/browser/codemods/styled-components-to-compiled/styled-components-to-compiled.d.ts +0 -3
  217. package/dist/browser/codemods/styled-components-to-compiled/styled-components-to-compiled.js +0 -33
  218. package/dist/browser/codemods/styled-components-to-compiled/styled-components-to-compiled.js.map +0 -1
  219. package/dist/cjs/codemods/codemods-helpers.d.ts +0 -60
  220. package/dist/cjs/codemods/codemods-helpers.js +0 -217
  221. package/dist/cjs/codemods/codemods-helpers.js.map +0 -1
  222. package/dist/cjs/codemods/constants.d.ts +0 -3
  223. package/dist/cjs/codemods/constants.js +0 -7
  224. package/dist/cjs/codemods/constants.js.map +0 -1
  225. package/dist/cjs/codemods/emotion-to-compiled/emotion-to-compiled.d.ts +0 -3
  226. package/dist/cjs/codemods/emotion-to-compiled/emotion-to-compiled.js +0 -180
  227. package/dist/cjs/codemods/emotion-to-compiled/emotion-to-compiled.js.map +0 -1
  228. package/dist/cjs/codemods/emotion-to-compiled/index.d.ts +0 -1
  229. package/dist/cjs/codemods/emotion-to-compiled/index.js +0 -9
  230. package/dist/cjs/codemods/emotion-to-compiled/index.js.map +0 -1
  231. package/dist/cjs/codemods/styled-components-to-compiled/index.d.ts +0 -1
  232. package/dist/cjs/codemods/styled-components-to-compiled/index.js +0 -9
  233. package/dist/cjs/codemods/styled-components-to-compiled/index.js.map +0 -1
  234. package/dist/cjs/codemods/styled-components-to-compiled/styled-components-to-compiled.d.ts +0 -3
  235. package/dist/cjs/codemods/styled-components-to-compiled/styled-components-to-compiled.js +0 -35
  236. package/dist/cjs/codemods/styled-components-to-compiled/styled-components-to-compiled.js.map +0 -1
  237. package/dist/esm/codemods/codemods-helpers.d.ts +0 -60
  238. package/dist/esm/codemods/codemods-helpers.js +0 -201
  239. package/dist/esm/codemods/codemods-helpers.js.map +0 -1
  240. package/dist/esm/codemods/constants.d.ts +0 -3
  241. package/dist/esm/codemods/constants.js +0 -4
  242. package/dist/esm/codemods/constants.js.map +0 -1
  243. package/dist/esm/codemods/emotion-to-compiled/emotion-to-compiled.d.ts +0 -3
  244. package/dist/esm/codemods/emotion-to-compiled/emotion-to-compiled.js +0 -178
  245. package/dist/esm/codemods/emotion-to-compiled/emotion-to-compiled.js.map +0 -1
  246. package/dist/esm/codemods/emotion-to-compiled/index.d.ts +0 -1
  247. package/dist/esm/codemods/emotion-to-compiled/index.js +0 -2
  248. package/dist/esm/codemods/emotion-to-compiled/index.js.map +0 -1
  249. package/dist/esm/codemods/styled-components-to-compiled/index.d.ts +0 -1
  250. package/dist/esm/codemods/styled-components-to-compiled/index.js +0 -2
  251. package/dist/esm/codemods/styled-components-to-compiled/index.js.map +0 -1
  252. package/dist/esm/codemods/styled-components-to-compiled/styled-components-to-compiled.d.ts +0 -3
  253. package/dist/esm/codemods/styled-components-to-compiled/styled-components-to-compiled.js +0 -33
  254. package/dist/esm/codemods/styled-components-to-compiled/styled-components-to-compiled.js.map +0 -1
  255. package/src/codemods/README.md +0 -8
  256. package/src/codemods/codemods-helpers.tsx +0 -369
  257. package/src/codemods/constants.tsx +0 -3
  258. package/src/codemods/emotion-to-compiled/README.md +0 -71
  259. package/src/codemods/emotion-to-compiled/__tests__/emotion-to-compiled.test.tsx +0 -526
  260. package/src/codemods/emotion-to-compiled/emotion-to-compiled.tsx +0 -249
  261. package/src/codemods/emotion-to-compiled/index.tsx +0 -1
  262. package/src/codemods/styled-components-to-compiled/README.md +0 -37
  263. package/src/codemods/styled-components-to-compiled/__tests__/styled-components-to-compiled.test.tsx +0 -109
  264. package/src/codemods/styled-components-to-compiled/index.tsx +0 -1
  265. package/src/codemods/styled-components-to-compiled/styled-components-to-compiled.tsx +0 -45
package/CHANGELOG.md CHANGED
@@ -1,5 +1,71 @@
1
1
  # @compiled/react
2
2
 
3
+ ## 0.10.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 427cead: **Breaking change:** When using the `css` prop with [TypeScript](https://www.typescriptlang.org) you now need to declare a JSX pragma enabling types for that module. Previously when importing the `@compiled/react` package the global JSX namespace would be polluted as a side effect potentially causing collisions with other CSS-in-JS libraries. Now thanks to the use of [locally scoped JSX namespaces](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html#locally-scoped-jsx-namespaces) the global JSX namespace will no longer be polluted.
8
+
9
+ As an added bonus the `css` prop will only be available on JSX elements that have also defined a `className` prop with the potential for more type safe features later on.
10
+
11
+ Make sure to update all Compiled dependencies to latest when adopting this change.
12
+
13
+ **Automatic runtime**
14
+
15
+ ```diff
16
+ -import '@compiled/react';
17
+ +/** @jsxImportSource @compiled/react */
18
+
19
+ <div css={{ display: 'block' }} />;
20
+ ```
21
+
22
+ **Classic runtime**
23
+
24
+ ```diff
25
+ -import '@compiled/react';
26
+ +/** @jsx jsx */
27
+ +import { jsx } from '@compiled/react';
28
+
29
+ <div css={{ display: 'block' }} />;
30
+ ```
31
+
32
+ To aid consumers in adopting this change easily, a new ESLint rule `jsx-pragma` has been created which will automatically migrate you to use a JSX pragma if missing when running with `--fix`. The rule takes an option to configure the runtime (either classic or automatic) and defaults to automatic.
33
+
34
+ ```sh
35
+ npm i @compiled/eslint-plugin
36
+ ```
37
+
38
+ ```json
39
+ {
40
+ "rules": {
41
+ "@compiled/jsx-pragma": ["error", { "runtime": "classic" }]
42
+ }
43
+ }
44
+ ```
45
+
46
+ ### Patch Changes
47
+
48
+ - 79cfb08: Internal refactor changing how the TypeScript compiler picks up source files.
49
+
50
+ ## 0.9.1
51
+
52
+ ### Patch Changes
53
+
54
+ - 4309aaa: Patch inexact flow type on styled
55
+
56
+ ## 0.9.0
57
+
58
+ ### Minor Changes
59
+
60
+ - 2092839: Allow inline strings and inline css mixins in conditional expressions. Fix ordering of styles in template literals.
61
+
62
+ ## 0.8.0
63
+
64
+ ### Minor Changes
65
+
66
+ - 4210ff6: Add flow types support
67
+ - 53935b3: Add `ObjectExpression` support to `css`
68
+
3
69
  ## 0.7.0
4
70
 
5
71
  ### Minor Changes
@@ -41,7 +107,8 @@
41
107
  display: flex;
42
108
  font-size: 50px;
43
109
  color: blue;
44
- `}>
110
+ `}
111
+ >
45
112
  blue text
46
113
  </div>;
47
114
  ```
@@ -1,5 +1,5 @@
1
- import { ReactNode } from 'react';
2
- import { CssFunction, BasicTemplateInterpolations } from '../types';
1
+ import type { ReactNode } from 'react';
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: {
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Flowtype definitions for index
3
+ * Generated by Flowgen from a Typescript Definition
4
+ * Flowgen v1.15.0
5
+ * @flow
6
+ */
7
+ import type { Node } from 'react';
8
+ import type { BasicTemplateInterpolations, CssFunction } from '../types';
9
+ export type Interpolations = (BasicTemplateInterpolations | CssFunction<> | CssFunction<>[])[];
10
+ export interface ClassNamesProps {
11
+ children: (opts: {
12
+ css: (css: CssFunction<> | CssFunction<>[], ...interpolations: Interpolations) => string,
13
+ style: {
14
+ [key: string]: string,
15
+ ...
16
+ },
17
+ ...
18
+ }) => Node;
19
+ }
20
+ /**
21
+ * Use a component where styles are not necessarily tied to an element.
22
+ *
23
+ * ```
24
+ * // Object CSS
25
+ * <ClassNames>
26
+ * {({ css, style }) => children({ className: css({ fontSize: 12 }) })}
27
+ * </ClassNames>
28
+ *
29
+ * // Template literal CSS
30
+ * <ClassNames>
31
+ * {({ css, style }) => children({ className: css`font-size: 12px;` })}
32
+ * </ClassNames>
33
+ *
34
+ * // Array CSS
35
+ * <ClassNames>
36
+ * {({ css, style }) =>
37
+ * children({ className: css([{ fontSize: 12 }, `font-size: 12px`]) })}
38
+ * </ClassNames>
39
+ * ```
40
+ *
41
+ * For more help, read the docs:
42
+ * https://compiledcssinjs.com/docs/api-class-names
43
+ * @param props
44
+ */
45
+ declare export function ClassNames(_: ClassNamesProps): React$Node;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/class-names/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAYlD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,UAAU,UAAU,CAAC,CAAkB;IAC3C,MAAM,gBAAgB,EAAE,CAAC;AAC3B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/class-names/index.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAWlD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,UAAU,UAAU,CAAC,CAAkB;IAC3C,MAAM,gBAAgB,EAAE,CAAC;AAC3B,CAAC"}
@@ -1,6 +1,6 @@
1
- import type { CSSProps } from '../types';
1
+ import type { BasicTemplateInterpolations, CSSProps, FunctionInterpolation } from '../types';
2
2
  /**
3
- * Create styles that can be re-used between components.
3
+ * Create styles that can be re-used between components with a template literal.
4
4
  *
5
5
  * ```
6
6
  * css`color: red;`;
@@ -12,4 +12,17 @@ import type { CSSProps } from '../types';
12
12
  * @param css
13
13
  * @param values
14
14
  */
15
- export default function css(_css: TemplateStringsArray, ..._values: (string | number)[]): CSSProps;
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
18
+ *
19
+ * ```
20
+ * css({ color: 'red' });
21
+ * ```
22
+ *
23
+ * For more help, read the docs:
24
+ * https://compiledcssinjs.com/docs/api-css
25
+ *
26
+ * @param css
27
+ */
28
+ export default function css(_css: CSSProps): CSSProps;
@@ -1,17 +1,5 @@
1
+ /* eslint-disable import/export */
1
2
  import { createSetupError } from '../utils/error';
2
- /**
3
- * Create styles that can be re-used between components.
4
- *
5
- * ```
6
- * css`color: red;`;
7
- * ```
8
- *
9
- * For more help, read the docs:
10
- * https://compiledcssinjs.com/docs/api-css
11
- *
12
- * @param css
13
- * @param values
14
- */
15
3
  export default function css(_css) {
16
4
  var _values = [];
17
5
  for (var _i = 1; _i < arguments.length; _i++) {
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Flowtype definitions for index
3
+ * Generated by Flowgen from a Typescript Definition
4
+ * Flowgen v1.15.0
5
+ * @flow
6
+ */
7
+ import type { BasicTemplateInterpolations, CSSProps, FunctionInterpolation } from '../types';
8
+ /**
9
+ * Create styles that can be re-used between components with a template literal.
10
+ *
11
+ * ```
12
+ * css`color: red;`;
13
+ * ```
14
+ *
15
+ * For more help, read the docs:
16
+ * https://compiledcssinjs.com/docs/api-css
17
+ * @param css
18
+ * @param values
19
+ */
20
+ declare export default function css<T>(
21
+ _css: $ReadOnlyArray<string>,
22
+ ..._values: (BasicTemplateInterpolations | FunctionInterpolation<T>)[]
23
+ ): CSSProps;
24
+ /**
25
+ * Create styles that can be re-used between components with an object
26
+ *
27
+ * ```
28
+ * css({ color: 'red' });
29
+ * ```
30
+ *
31
+ * For more help, read the docs:
32
+ * https://compiledcssinjs.com/docs/api-css
33
+ * @param css
34
+ */
35
+ declare export default function css(_css: CSSProps): CSSProps;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/css/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGlD;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,OAAO,UAAU,GAAG,CAAC,IAA0B;IAAE,iBAA4B;SAA5B,UAA4B,EAA5B,qBAA4B,EAA5B,IAA4B;QAA5B,gCAA4B;;IAClF,MAAM,gBAAgB,EAAE,CAAC;AAC3B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/css/index.tsx"],"names":[],"mappings":"AAAA,kCAAkC;AAGlC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAkClD,MAAM,CAAC,OAAO,UAAU,GAAG,CACzB,IAAqC;IACrC,iBAAsE;SAAtE,UAAsE,EAAtE,qBAAsE,EAAtE,IAAsE;QAAtE,gCAAsE;;IAEtE,MAAM,gBAAgB,EAAE,CAAC;AAC3B,CAAC"}
@@ -1,30 +1,22 @@
1
+ import { createElement } from 'react';
2
+ import type { CompiledJSX } from './jsx/jsx-local-namespace';
3
+ import type { CssFunction, CSSProps } from './types';
1
4
  export { keyframes } from './keyframes';
2
5
  export { styled } from './styled';
3
6
  export { ClassNames } from './class-names';
4
7
  export { default as css } from './css';
5
- import { CssFunction } from './types';
6
- declare module 'react' {
7
- interface DOMAttributes<T> {
8
- css?: CssFunction | CssFunction[];
9
- }
10
- }
11
- declare global {
8
+ export declare const jsx: typeof createElement;
9
+ export type { CssFunction, CSSProps };
10
+ export type { CssObject } from './styled';
11
+ export declare namespace jsx {
12
12
  namespace JSX {
13
- interface IntrinsicAttributes {
14
- /**
15
- * Tie styles to an element.
16
- * It is available when the `@compiled/react` module is in scope.
17
- *
18
- * ```
19
- * css={{ fontSize: 12 }} // Object CSS
20
- * css={`font-size: 12px;`} // Template literal CSS
21
- * css={[{ fontSize: 12 }, `font-size: 12px;`]} // Array CSS
22
- * ```
23
- *
24
- * For more help, read the docs:
25
- * https://compiledcssinjs.com/docs/api-css-prop
26
- */
27
- css?: CssFunction | CssFunction[];
28
- }
13
+ type Element = CompiledJSX.Element;
14
+ type ElementClass = CompiledJSX.ElementClass;
15
+ type ElementAttributesProperty = CompiledJSX.ElementAttributesProperty;
16
+ type ElementChildrenAttribute = CompiledJSX.ElementChildrenAttribute;
17
+ type LibraryManagedAttributes<C, P> = CompiledJSX.LibraryManagedAttributes<C, P>;
18
+ type IntrinsicAttributes = CompiledJSX.IntrinsicAttributes;
19
+ type IntrinsicClassAttributes<T> = CompiledJSX.IntrinsicClassAttributes<T>;
20
+ type IntrinsicElements = CompiledJSX.IntrinsicElements;
29
21
  }
30
22
  }
@@ -1,5 +1,9 @@
1
+ import { createElement } from 'react';
1
2
  export { keyframes } from './keyframes';
2
3
  export { styled } from './styled';
3
4
  export { ClassNames } from './class-names';
4
5
  export { default as css } from './css';
6
+ // Pass through the (classic) jsx runtime.
7
+ // Compiled currently doesn't define its own and uses this purely to enable a local jsx namespace.
8
+ export var jsx = createElement;
5
9
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,15 @@
1
+ /**
2
+ * THIS IS A MANUALLY CURATED FLOW FILE.
3
+ *
4
+ * Flowtype definitions for runtime
5
+ * Generated by Flowgen from a Typescript Definition
6
+ * Flowgen v1.15.0
7
+ * @flow
8
+ */
9
+ import type { CSSProps, CssFunction } from './types';
10
+ declare export { keyframes } from './keyframes';
11
+ declare export { styled } from './styled';
12
+ declare export { ClassNames } from './class-names';
13
+ declare export { default as css } from './css';
14
+ export type { CssFunction, CSSProps };
15
+ export type { CssObject } from './styled';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,MAAM,OAAO,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAKtC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,MAAM,OAAO,CAAC;AAEvC,0CAA0C;AAC1C,kGAAkG;AAClG,MAAM,CAAC,IAAM,GAAG,GAAG,aAAa,CAAC"}
@@ -0,0 +1,2 @@
1
+ export type { CompiledJSX as JSX } from './jsx-local-namespace';
2
+ export * from 'react/jsx-dev-runtime';
@@ -0,0 +1,4 @@
1
+ // Pass through the (automatic) jsx dev runtime.
2
+ // Compiled currently doesn't define its own and uses this purely to enable a local jsx namespace.
3
+ export * from 'react/jsx-dev-runtime';
4
+ //# sourceMappingURL=jsx-dev-runtime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsx-dev-runtime.js","sourceRoot":"","sources":["../../../src/jsx/jsx-dev-runtime.tsx"],"names":[],"mappings":"AAEA,gDAAgD;AAChD,kGAAkG;AAClG,cAAc,uBAAuB,CAAC"}
@@ -0,0 +1,40 @@
1
+ /// <reference types="react" />
2
+ import type { CssFunction } from '../types';
3
+ declare type WithConditionalCSSProp<TProps> = 'className' extends keyof TProps ? string extends TProps['className' & keyof TProps] ? {
4
+ /**
5
+ * Tie styles to an element.
6
+ *
7
+ * ```
8
+ * css={{ fontSize: 12 }} // Object CSS
9
+ * css={`font-size: 12px;`} // Template literal CSS
10
+ * css={[{ fontSize: 12 }, `font-size: 12px;`]} // Array CSS
11
+ * ```
12
+ *
13
+ * For more help, read the docs:
14
+ * https://compiledcssinjs.com/docs/api-css-prop
15
+ */
16
+ css?: CssFunction | CssFunction[];
17
+ } : {} : {};
18
+ declare type ReactJSXElement = JSX.Element;
19
+ declare type ReactJSXElementClass = JSX.ElementClass;
20
+ declare type ReactJSXElementAttributesProperty = JSX.ElementAttributesProperty;
21
+ declare type ReactJSXElementChildrenAttribute = JSX.ElementChildrenAttribute;
22
+ declare type ReactJSXLibraryManagedAttributes<C, P> = JSX.LibraryManagedAttributes<C, P>;
23
+ declare type ReactJSXIntrinsicAttributes = JSX.IntrinsicAttributes;
24
+ declare type ReactJSXIntrinsicClassAttributes<T> = JSX.IntrinsicClassAttributes<T>;
25
+ declare type ReactJSXIntrinsicElements = JSX.IntrinsicElements;
26
+ export declare namespace CompiledJSX {
27
+ type Element = ReactJSXElement;
28
+ type ElementClass = ReactJSXElementClass;
29
+ type ElementAttributesProperty = ReactJSXElementAttributesProperty;
30
+ type ElementChildrenAttribute = ReactJSXElementChildrenAttribute;
31
+ type LibraryManagedAttributes<C, P> = WithConditionalCSSProp<P> & ReactJSXLibraryManagedAttributes<C, P>;
32
+ type IntrinsicAttributes = ReactJSXIntrinsicAttributes;
33
+ type IntrinsicClassAttributes<T> = ReactJSXIntrinsicClassAttributes<T>;
34
+ type IntrinsicElements = {
35
+ [K in keyof ReactJSXIntrinsicElements]: ReactJSXIntrinsicElements[K] & {
36
+ css?: CssFunction | CssFunction[];
37
+ };
38
+ };
39
+ }
40
+ export {};
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=jsx-local-namespace.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsx-local-namespace.js","sourceRoot":"","sources":["../../../src/jsx/jsx-local-namespace.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export type { CompiledJSX as JSX } from './jsx-local-namespace';
2
+ export * from 'react/jsx-runtime';
@@ -0,0 +1,4 @@
1
+ // Pass through the (automatic) jsx runtime.
2
+ // Compiled currently doesn't define its own and uses this purely to enable a local jsx namespace.
3
+ export * from 'react/jsx-runtime';
4
+ //# sourceMappingURL=jsx-runtime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsx-runtime.js","sourceRoot":"","sources":["../../../src/jsx/jsx-runtime.tsx"],"names":[],"mappings":"AAEA,4CAA4C;AAC5C,kGAAkG;AAClG,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Flowtype definitions for index
3
+ * Generated by Flowgen from a Typescript Definition
4
+ * Flowgen v1.15.0
5
+ * @flow
6
+ */
7
+ import type { BasicTemplateInterpolations, CSSProps } from '../types';
8
+ export type KeyframeSteps = string | { [key: string]: CSSProps, ... };
9
+ /**
10
+ * Create keyframes using a tagged template expression:
11
+ *
12
+ * ```
13
+ * const fadeOut = keyframes`
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:
27
+ *
28
+ * 1. An object expression
29
+ *
30
+ * ```
31
+ * const fadeOut = keyframes({
32
+ * from: {
33
+ * opacity: 1,
34
+ * },
35
+ * to: {
36
+ * opacity: 0,
37
+ * },
38
+ * });
39
+ * ```
40
+ *
41
+ * 2. A string
42
+ *
43
+ * ```
44
+ * const fadeOut = keyframes('from { opacity: 1; } to { opacity: 0; }');
45
+ * ```
46
+ *
47
+ * 3. A template literal
48
+ *
49
+ * ```
50
+ * const fadeOut = keyframes(`from { opacity: 1; } to { opacity: 0; }`);
51
+ * ```
52
+ * @param _steps The waypoints along the animation sequence
53
+ */
54
+ declare export function keyframes(_steps: KeyframeSteps): string;
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Flowtype definitions for ax
3
+ * Generated by Flowgen from a Typescript Definition
4
+ * Flowgen v1.15.0
5
+ * @flow
6
+ */
7
+ /**
8
+ * Joins classes together and ensures atomic declarations of a single group exist.
9
+ * Atomic declarations take the form of `_{group}{value}` (always prefixed with an underscore),
10
+ * where both `group` and `value` are hashes **four characters long**.
11
+ * Class names can be of any length,
12
+ * this function can take both atomic declarations and class names.
13
+ *
14
+ * Input:
15
+ *
16
+ * ```
17
+ * ax(['_aaaabbbb', '_aaaacccc'])
18
+ * ```
19
+ *
20
+ * Output:
21
+ *
22
+ * ```
23
+ * '_aaaacccc'
24
+ * ```
25
+ * @param classes
26
+ */
27
+ declare export default function ax(classNames: (string | void | false)[]): string | void;
@@ -7,4 +7,4 @@
7
7
  * @param suffix
8
8
  * @param prefix
9
9
  */
10
- export default function cssCustomPropertyValue(value: string | number | number | null, suffix?: string | undefined | null, prefix?: string | undefined | null): string | number;
10
+ export default function cssCustomPropertyValue(value: string | number | null | undefined, suffix?: string | undefined | null, prefix?: string | undefined | null): string | number;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Flowtype definitions for css-custom-property
3
+ * Generated by Flowgen from a Typescript Definition
4
+ * Flowgen v1.15.0
5
+ * @flow
6
+ */
7
+ /**
8
+ * Returns a CSS custom property value with an optional suffix & prefix.
9
+ * Prefix will only be added if there is a suffix.
10
+ * If the value is undefined a fallback value will be returned to prevent children inheriting parent values.
11
+ * @param value
12
+ * @param suffix
13
+ * @param prefix
14
+ */
15
+ declare export default function cssCustomPropertyValue(
16
+ value: string | number | null | void,
17
+ suffix?: string | void | null,
18
+ prefix?: string | void | null
19
+ ): string | number;
@@ -1 +1 @@
1
- {"version":3,"file":"css-custom-property.js","sourceRoot":"","sources":["../../../src/runtime/css-custom-property.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAC5C,KAAsC,EACtC,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"}
1
+ {"version":3,"file":"css-custom-property.js","sourceRoot":"","sources":["../../../src/runtime/css-custom-property.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,UAAU,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"}
@@ -1,2 +1 @@
1
- export declare const warn: (str: string, ...args: any[]) => void;
2
1
  export declare const analyzeCssInDev: (sheet: string) => void;
@@ -5,7 +5,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from) {
5
5
  };
6
6
  var selectorsToWarn = [':first-child', ':nth-child'];
7
7
  var hasWarned = {};
8
- export var warn = function (str) {
8
+ var warn = function (str) {
9
9
  var args = [];
10
10
  for (var _i = 1; _i < arguments.length; _i++) {
11
11
  args[_i - 1] = arguments[_i];
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Flowtype definitions for dev-warnings
3
+ * Generated by Flowgen from a Typescript Definition
4
+ * Flowgen v1.15.0
5
+ * @flow
6
+ */
7
+ declare export var analyzeCssInDev: (sheet: string) => void;
@@ -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,MAAM,CAAC,IAAM,IAAI,GAAG,UAAC,GAAW;IAAE,cAAc;SAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;QAAd,6BAAc;;IAC9C,OAAA,OAAO,CAAC,KAAK,OAAb,OAAO,iBACL,q6DAUA,GAAG,OACN,GACM,IAAI;AAbT,CAcC,CAAC;AAEJ,MAAM,CAAC,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,iBAAc,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,gPAEiC,CAC1E,CAAC;KACH;IAED,SAAS,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;AAC1B,CAAC,CAAC"}
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,OAAO,CAAC,KAAK,OAAb,OAAO,iBACL,q6DAUA,GAAG,OACN,GACM,IAAI;AAbT,CAcC,CAAC;AAEJ,MAAM,CAAC,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,iBAAc,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,gPAEiC,CAC1E,CAAC;KACH;IAED,SAAS,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;AAC1B,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Flowtype definitions for index
3
+ * Generated by Flowgen from a Typescript Definition
4
+ * Flowgen v1.15.0
5
+ * @flow
6
+ */
7
+ declare export { default as CS } from './style';
8
+ declare export { default as CC } from './style-cache';
9
+ declare export { default as ax } from './ax';
10
+ declare export { default as ix } from './css-custom-property';
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Flowtype definitions for is-node
3
+ * Generated by Flowgen from a Typescript Definition
4
+ * Flowgen v1.15.0
5
+ * @flow
6
+ */
7
+ /**
8
+ * Returns `true` when inside a node environment,
9
+ * else `false`.
10
+ *
11
+ * When using this it will remove any node code from the browser bundle - for example:
12
+ *
13
+ * ```js
14
+ * if (isNodeEnvironment()) {
15
+ * // This code will be removed from the browser bundle
16
+ * }
17
+ * ```
18
+ */
19
+ declare export var isNodeEnvironment: () => boolean;
@@ -1,4 +1,4 @@
1
- import { StyleSheetOpts, Bucket } from './types';
1
+ import type { Bucket, StyleSheetOpts } from './types';
2
2
  /**
3
3
  * Ordered style buckets using their short psuedo name.
4
4
  * If changes are needed make sure that it aligns with the definition in `sort-at-rule-pseudos.tsx`.
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Flowtype definitions for sheet
3
+ * Generated by Flowgen from a Typescript Definition
4
+ * Flowgen v1.15.0
5
+ * @flow
6
+ */
7
+ import type { Bucket, StyleSheetOpts } from './types';
8
+ /**
9
+ * Ordered style buckets using their short psuedo name.
10
+ * If changes are needed make sure that it aligns with the definition in `sort-at-rule-pseudos.tsx`.
11
+ */
12
+ declare export var styleBucketOrdering: Bucket[];
13
+ /**
14
+ * Gets the bucket depending on the sheet.
15
+ * This function makes assumptions as to the form of the input class name.
16
+ *
17
+ * Input:
18
+ *
19
+ * ```
20
+ * "._a1234567:hover{ color: red; }"
21
+ * ```
22
+ *
23
+ * Output:
24
+ *
25
+ * ```
26
+ * "h"
27
+ * ```
28
+ * @param sheet styles for which we are getting the bucket
29
+ */
30
+ declare export var getStyleBucketName: (sheet: string) => Bucket;
31
+ /**
32
+ * Used to move styles to the head of the application during runtime.
33
+ * @param css string
34
+ * @param opts StyleSheetOpts
35
+ */
36
+ declare export default function insertRule(css: string, opts: StyleSheetOpts): void;
@@ -1,4 +1,4 @@
1
- import { ProviderComponent, UseCacheHook } from './types';
1
+ import type { ProviderComponent, UseCacheHook } from './types';
2
2
  /**
3
3
  * Hook using the cache created on the server or client.
4
4
  */
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Flowtype definitions for style-cache
3
+ * Generated by Flowgen from a Typescript Definition
4
+ * Flowgen v1.15.0
5
+ * @flow
6
+ */
7
+ import type { ProviderComponent, UseCacheHook } from './types';
8
+ /**
9
+ * Hook using the cache created on the server or client.
10
+ */
11
+ declare export var useCache: UseCacheHook;
12
+ /**
13
+ * On the server this ensures the minimal amount of styles will be rendered
14
+ * safely using React Context.
15
+ *
16
+ * On the browser this turns into a fragment with no React Context.
17
+ */
18
+ declare var StyleCacheProvider: ProviderComponent;
19
+ declare export default typeof StyleCacheProvider;
@@ -1 +1 @@
1
- {"version":3,"file":"style-cache.js","sourceRoot":"","sources":["../../../src/runtime/style-cache.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAG9C;;;GAGG;AACH,IAAM,KAAK,GAAQ,MAAoB,CAAC,CAAC,aAAa,CAA8B,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAE/F,IAAI,MAAoB,EAAE;IACxB;;;;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;AACH,MAAM,CAAC,IAAM,QAAQ,GAAiB;IACpC,WAAyB;QACvB,mFAAmF;QACnF,wGAAwG;QACxG,sDAAsD;QACtD,OAAO,UAAU,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;KAChC;IAED,6CAA6C;IAC7C,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF;;;;;GAKG;AACH,IAAM,kBAAkB,GAAsB,UAAC,KAAK;IAClD,WAAyB;QACvB,4EAA4E;QAC5E,sDAAsD;QACtD,IAAM,QAAQ,GAAG,QAAQ,EAAE,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,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"style-cache.js","sourceRoot":"","sources":["../../../src/runtime/style-cache.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAElD,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAG9C;;;GAGG;AACH,IAAM,KAAK,GAAQ,MAAoB,CAAC,CAAC,aAAa,CAA8B,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAE/F,IAAI,MAAoB,EAAE;IACxB;;;;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;AACH,MAAM,CAAC,IAAM,QAAQ,GAAiB;IACpC,WAAyB;QACvB,mFAAmF;QACnF,wGAAwG;QACxG,sDAAsD;QACtD,OAAO,UAAU,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;KAChC;IAED,6CAA6C;IAC7C,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF;;;;;GAKG;AACH,IAAM,kBAAkB,GAAsB,UAAC,KAAK;IAClD,WAAyB;QACvB,4EAA4E;QAC5E,sDAAsD;QACtD,IAAM,QAAQ,GAAG,QAAQ,EAAE,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,eAAe,kBAAkB,CAAC"}