@compiled/react 0.15.0 → 0.16.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 (90) hide show
  1. package/package.json +2 -1
  2. package/src/css/__tests__/types.test.ts +11 -0
  3. package/dist/browser/class-names/index.js.flow +0 -53
  4. package/dist/browser/css/index.js.flow +0 -36
  5. package/dist/browser/css-map/index.js.flow +0 -125
  6. package/dist/browser/css-map/pseudos.js.flow +0 -57
  7. package/dist/browser/index.js.flow +0 -13
  8. package/dist/browser/keyframes/index.js.flow +0 -48
  9. package/dist/browser/runtime/ac.js.flow +0 -56
  10. package/dist/browser/runtime/ax.js.flow +0 -27
  11. package/dist/browser/runtime/cache.js.flow +0 -18
  12. package/dist/browser/runtime/css-custom-property.js.flow +0 -19
  13. package/dist/browser/runtime/dev-warnings.js.flow +0 -7
  14. package/dist/browser/runtime/index.js.flow +0 -11
  15. package/dist/browser/runtime/is-server-environment.js.flow +0 -19
  16. package/dist/browser/runtime/sheet.js.flow +0 -36
  17. package/dist/browser/runtime/style-cache.js.flow +0 -19
  18. package/dist/browser/runtime/style.js.flow +0 -16
  19. package/dist/browser/runtime/types.js.flow +0 -23
  20. package/dist/browser/runtime.js.flow +0 -7
  21. package/dist/browser/styled/index.js.flow +0 -66
  22. package/dist/browser/types.js.flow +0 -31
  23. package/dist/browser/utils/error.js.flow +0 -7
  24. package/dist/cjs/class-names/index.js.flow +0 -53
  25. package/dist/cjs/css/index.js.flow +0 -36
  26. package/dist/cjs/css-map/index.js.flow +0 -125
  27. package/dist/cjs/css-map/pseudos.js.flow +0 -57
  28. package/dist/cjs/index.js.flow +0 -13
  29. package/dist/cjs/keyframes/index.js.flow +0 -48
  30. package/dist/cjs/runtime/ac.js.flow +0 -56
  31. package/dist/cjs/runtime/ax.js.flow +0 -27
  32. package/dist/cjs/runtime/cache.js.flow +0 -18
  33. package/dist/cjs/runtime/css-custom-property.js.flow +0 -19
  34. package/dist/cjs/runtime/dev-warnings.js.flow +0 -7
  35. package/dist/cjs/runtime/index.js.flow +0 -11
  36. package/dist/cjs/runtime/is-server-environment.js.flow +0 -19
  37. package/dist/cjs/runtime/sheet.js.flow +0 -36
  38. package/dist/cjs/runtime/style-cache.js.flow +0 -19
  39. package/dist/cjs/runtime/style.js.flow +0 -16
  40. package/dist/cjs/runtime/types.js.flow +0 -23
  41. package/dist/cjs/runtime.js.flow +0 -7
  42. package/dist/cjs/styled/index.js.flow +0 -66
  43. package/dist/cjs/types.js.flow +0 -31
  44. package/dist/cjs/utils/error.js.flow +0 -7
  45. package/dist/esm/class-names/index.js.flow +0 -53
  46. package/dist/esm/css/index.js.flow +0 -36
  47. package/dist/esm/css-map/index.js.flow +0 -125
  48. package/dist/esm/css-map/pseudos.js.flow +0 -57
  49. package/dist/esm/index.js.flow +0 -13
  50. package/dist/esm/keyframes/index.js.flow +0 -48
  51. package/dist/esm/runtime/ac.js.flow +0 -56
  52. package/dist/esm/runtime/ax.js.flow +0 -27
  53. package/dist/esm/runtime/cache.js.flow +0 -18
  54. package/dist/esm/runtime/css-custom-property.js.flow +0 -19
  55. package/dist/esm/runtime/dev-warnings.js.flow +0 -7
  56. package/dist/esm/runtime/index.js.flow +0 -11
  57. package/dist/esm/runtime/is-server-environment.js.flow +0 -19
  58. package/dist/esm/runtime/sheet.js.flow +0 -36
  59. package/dist/esm/runtime/style-cache.js.flow +0 -19
  60. package/dist/esm/runtime/style.js.flow +0 -16
  61. package/dist/esm/runtime/types.js.flow +0 -23
  62. package/dist/esm/runtime.js.flow +0 -7
  63. package/dist/esm/styled/index.js.flow +0 -66
  64. package/dist/esm/types.js.flow +0 -31
  65. package/dist/esm/utils/error.js.flow +0 -7
  66. package/src/class-names/__tests__/types.test.js.flow +0 -35
  67. package/src/class-names/index.js.flow +0 -53
  68. package/src/css/__tests__/types.test.js.flow +0 -42
  69. package/src/css/index.js.flow +0 -36
  70. package/src/css-map/index.js.flow +0 -125
  71. package/src/css-map/pseudos.js.flow +0 -57
  72. package/src/index.js.flow +0 -13
  73. package/src/keyframes/__tests__/types.test.js.flow +0 -31
  74. package/src/keyframes/index.js.flow +0 -48
  75. package/src/runtime/ac.js.flow +0 -56
  76. package/src/runtime/ax.js.flow +0 -27
  77. package/src/runtime/cache.js.flow +0 -18
  78. package/src/runtime/css-custom-property.js.flow +0 -19
  79. package/src/runtime/dev-warnings.js.flow +0 -7
  80. package/src/runtime/index.js.flow +0 -11
  81. package/src/runtime/is-server-environment.js.flow +0 -19
  82. package/src/runtime/sheet.js.flow +0 -36
  83. package/src/runtime/style-cache.js.flow +0 -19
  84. package/src/runtime/style.js.flow +0 -16
  85. package/src/runtime/types.js.flow +0 -23
  86. package/src/runtime.js.flow +0 -7
  87. package/src/styled/__tests__/types.test.js.flow +0 -84
  88. package/src/styled/index.js.flow +0 -66
  89. package/src/types.js.flow +0 -31
  90. package/src/utils/error.js.flow +0 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compiled/react",
3
- "version": "0.15.0",
3
+ "version": "0.16.0",
4
4
  "description": "A familiar and performant compile time CSS-in-JS library for React.",
5
5
  "keywords": [
6
6
  "compiled",
@@ -79,6 +79,7 @@
79
79
  "@testing-library/react": "^12.1.5",
80
80
  "@types/jsdom": "^16.2.15",
81
81
  "@types/react-dom": "^17.0.20",
82
+ "expect-type": "^0.17.3",
82
83
  "jsdom": "^19.0.0",
83
84
  "react": "^17.0.2",
84
85
  "react-dom": "^17.0.2"
@@ -0,0 +1,11 @@
1
+ /** @jsxImportSource @compiled/react */
2
+ import { css } from '@compiled/react';
3
+ import { expectTypeOf } from 'expect-type';
4
+
5
+ describe('css func tests', () => {
6
+ it('should type violate when given invalid types', () => {
7
+ const style = css({ color: 'red' });
8
+
9
+ expectTypeOf(style).not.toMatchTypeOf<string>();
10
+ });
11
+ });
@@ -1,53 +0,0 @@
1
- /**
2
- * Flowtype definitions for index
3
- * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.21.0
5
- * @flow
6
- */
7
- import type { Node } from 'react';
8
- import type { CssType, CssFunction } from '../types';
9
- export type ObjectInterpolation<TProps> = CssType<TProps> | CssType<TProps>[];
10
- export type TemplateStringsInterpolation<TProps> = CssFunction<TProps> | CssFunction<TProps>[];
11
- declare interface CssSignature<TProps> {
12
- (...interpolations: ObjectInterpolation<TProps>[]): string;
13
- (
14
- template: $ReadOnlyArray<string>,
15
- ...interpolations: TemplateStringsInterpolation<TProps>[]
16
- ): string;
17
- }
18
- export interface ClassNamesProps<TProps> {
19
- children: (opts: {
20
- css: CssSignature<TProps>,
21
- style: $Shape<CSSStyleDeclaration>,
22
- ...
23
- }) => Node;
24
- }
25
- /**
26
- * ## Class names
27
- *
28
- * Use a component where styles are not necessarily used on a JSX element.
29
- * For further details [read the documentation](https://compiledcssinjs.com/docs/api-class-names).
30
- *
31
- * ### Style with objects
32
- * @example ```
33
- * <ClassNames>
34
- * {({ css, style }) => children({ className: css({ fontSize: 12 }) })}
35
- * </ClassNames>
36
- * ```
37
- *
38
- * ### Style with template literals
39
- * @example ```
40
- * <ClassNames>
41
- * {({ css, style }) => children({ className: css`font-size: 12px;` })}
42
- * </ClassNames>
43
- * ```
44
- *
45
- * ### Compose styles with arrays
46
- * @example ```
47
- * <ClassNames>
48
- * {({ css, style }) =>
49
- * children({ className: css([{ fontSize: 12 }, css`font-size: 12px`]) })}
50
- * </ClassNames>
51
- * ```
52
- */
53
- declare export function ClassNames<TProps>(x: ClassNamesProps<TProps>): React$Node;
@@ -1,36 +0,0 @@
1
- /**
2
- * Flowtype definitions for index
3
- * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.21.0
5
- * @flow
6
- */
7
- import type { CSSProps, CssObject, CssFunction } from '../types';
8
- /**
9
- * ## CSS
10
- *
11
- * Define styles that are statically typed and useable with other Compiled APIs.
12
- * For further details [read the documentation](https://compiledcssinjs.com/docs/api-css).
13
- *
14
- * ### Style with objects
15
- * @example ```
16
- * const redText = css({
17
- * color: 'red',
18
- * });
19
- *
20
- * <div css={redText} />
21
- * ```
22
- *
23
- * ### Style with template literals
24
- * @example ```
25
- * const redText = css`
26
- * color: red;
27
- * `;
28
- *
29
- * <div css={redText} />
30
- * ```
31
- */
32
- declare export default function css<TProps>(
33
- styles: $ReadOnlyArray<string>,
34
- ...interpolations: CssFunction<TProps>[]
35
- ): CSSProps<TProps>;
36
- declare export default function css<T>(styles: CssObject<T> | CssObject<T>[]): CSSProps<T>;
@@ -1,125 +0,0 @@
1
- /**
2
- * Flowtype definitions for index
3
- * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.21.0
5
- * @flow
6
- */
7
- import type { Properties, AtRules } from 'csstype';
8
- import type { Pseudos } from './pseudos';
9
- /**
10
- * These are all the CSS props that will exist.
11
- * Only 'string' and 'number' are valid CSS values.
12
- * @example ```
13
- * const style: CssProps = {
14
- * color: 'red',
15
- * margin: 10,
16
- * };
17
- * ```
18
- */
19
- declare type CssProps = $ReadOnly<Properties<string | number>>;
20
- declare type AllPseudos = $ObjMapi<
21
- { [k: Pseudos]: any },
22
- <key>(key) => { ...CssProps, ...AllPseudos }
23
- >;
24
- declare type AtRuleSecondHalf = string;
25
- declare type WhitelistedAtRule = $ObjMapi<
26
- { [k: AtRules]: any },
27
- <atRuleFirstHalf>(atRuleFirstHalf) => $ObjMapi<
28
- { [k: AtRuleSecondHalf]: any },
29
- <atRuleSecondHalf>(atRuleSecondHalf) => {
30
- ...CssProps,
31
- ...AllPseudos,
32
- ...WhitelistedAtRule,
33
- }
34
- >
35
- >;
36
- declare type WhitelistedSelector = { ...AllPseudos, ...WhitelistedAtRule };
37
- declare type ExtendedSelector = {
38
- ...{
39
- [key: string]: CssProps | ExtendedSelector,
40
- },
41
- ...{
42
- /**
43
- * Using `selectors` is not valid here - you cannot nest a `selectors` object
44
- * inside another `selectors` object.
45
- */
46
- selectors?: empty,
47
- ...
48
- },
49
- };
50
- declare type ExtendedSelectors = {
51
- /**
52
- * Provides a way to use selectors that have not been explicitly whitelisted
53
- * in cssMap.
54
- *
55
- * This does not provide any type-checking for the selectors (thus allowing
56
- * more expressive selectors), though this is more flexible and allows
57
- * nesting selectors in other selectors.
58
- *
59
- * A selector defined both outside of the `selectors` object and
60
- * inside the `selectors` object is a runtime error.
61
- *
62
- * Note that you cannot nest a `selectors` object inside another
63
- * `selectors` object.
64
- *
65
- * Only use if absolutely necessary.
66
- * @example ```
67
- * const myMap = cssMap({
68
- * danger: {
69
- * color: 'red',
70
- * '@media': {
71
- * '(min-width: 100px)': {
72
- * font-size: '1.5em',
73
- * },
74
- * },
75
- * '&:hover': {
76
- * color: 'pink',
77
- * },
78
- * selectors: {
79
- * '&:not(:active)': {
80
- * backgroundColor: 'yellow',
81
- * }
82
- * },
83
- * },
84
- * success: {
85
- * color: 'green',
86
- * '@media': {
87
- * '(min-width: 100px)': {
88
- * font-size: '1.3em',
89
- * },
90
- * },
91
- * '&:hover': {
92
- * color: '#8f8',
93
- * },
94
- * selectors: {
95
- * '&:not(:active)': {
96
- * backgroundColor: 'white',
97
- * }
98
- * },
99
- * },
100
- * });
101
- * ```
102
- */
103
- selectors?: ExtendedSelector,
104
- ...
105
- };
106
- declare type Variants<VariantName: string> = {
107
- [key: VariantName]: { ...CssProps, ...WhitelistedSelector, ...ExtendedSelectors },
108
- };
109
- declare type ReturnType<VariantName: string> = { [key: VariantName]: CssProps };
110
- /**
111
- * ## cssMap
112
- *
113
- * Creates a collection of named CSS rules that are statically typed and useable with other Compiled APIs.
114
- * For further details [read the documentation](https://compiledcssinjs.com/docs/api-cssmap).
115
- * @example ```
116
- * const borderStyleMap = cssMap({
117
- * none: { borderStyle: 'none' },
118
- * solid: { borderStyle: 'solid' },
119
- * });
120
- * const Component = ({ borderStyle }) => <div css={css(borderStyleMap[borderStyle])} />
121
- *
122
- * <Component borderStyle="solid" />
123
- * ```
124
- */
125
- declare export default function cssMap<T: string>(_styles: Variants<T>): $ReadOnly<ReturnType<T>>;
@@ -1,57 +0,0 @@
1
- /**
2
- * Flowtype definitions for pseudos
3
- * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.21.0
5
- * @flow
6
- */
7
- export type Pseudos =
8
- | '&::after'
9
- | '&::backdrop'
10
- | '&::before'
11
- | '&::cue'
12
- | '&::cue-region'
13
- | '&::first-letter'
14
- | '&::first-line'
15
- | '&::grammar-error'
16
- | '&::marker'
17
- | '&::placeholder'
18
- | '&::selection'
19
- | '&::spelling-error'
20
- | '&::target-text'
21
- | '&::view-transition'
22
- | '&:active'
23
- | '&:autofill'
24
- | '&:blank'
25
- | '&:checked'
26
- | '&:default'
27
- | '&:defined'
28
- | '&:disabled'
29
- | '&:empty'
30
- | '&:enabled'
31
- | '&:first'
32
- | '&:focus'
33
- | '&:focus-visible'
34
- | '&:focus-within'
35
- | '&:fullscreen'
36
- | '&:hover'
37
- | '&:in-range'
38
- | '&:indeterminate'
39
- | '&:invalid'
40
- | '&:left'
41
- | '&:link'
42
- | '&:local-link'
43
- | '&:optional'
44
- | '&:out-of-range'
45
- | '&:paused'
46
- | '&:picture-in-picture'
47
- | '&:placeholder-shown'
48
- | '&:playing'
49
- | '&:read-only'
50
- | '&:read-write'
51
- | '&:required'
52
- | '&:right'
53
- | '&:target'
54
- | '&:user-invalid'
55
- | '&:user-valid'
56
- | '&:valid'
57
- | '&:visited';
@@ -1,13 +0,0 @@
1
- /**
2
- * Flowtype definitions for index
3
- * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.21.0
5
- * @flow
6
- */
7
- import type { CssFunction, CSSProps, CssType } from './types';
8
- export type { CSSProps, CssFunction, CssType };
9
- declare export { keyframes } from './keyframes';
10
- declare export { styled } from './styled';
11
- declare export { ClassNames } from './class-names';
12
- declare export { default as css } from './css';
13
- declare export { default as cssMap } from './css-map';
@@ -1,48 +0,0 @@
1
- /**
2
- * Flowtype definitions for index
3
- * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.21.0
5
- * @flow
6
- */
7
- import type { BasicTemplateInterpolations, CSSProps } from '../types';
8
- export type KeyframeSteps = string | { [key: string]: CSSProps<void> };
9
- /**
10
- * ## Keyframes
11
- *
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).
14
- *
15
- * ### Style with objects
16
- * @example ```
17
- * const fadeOut = keyframes({
18
- * from: {
19
- * opacity: 1,
20
- * },
21
- * to: {
22
- * opacity: 0,
23
- * },
24
- * });
25
- *
26
- * <div css={{ animation: `${fadeOut} 2s` }} />
27
- * ```
28
- *
29
- * ### Style with template literals
30
- * @example ```
31
- * const fadeOut = keyframes`
32
- * from {
33
- * opacity: 1;
34
- * }
35
- *
36
- * to {
37
- * opacity: 0;
38
- * }
39
- * `;
40
- *
41
- * <div css={{ animation: `${fadeOut} 2s` }} />
42
- * ```
43
- */
44
- declare export function keyframes(steps: KeyframeSteps): string;
45
- declare export function keyframes(
46
- strings: $ReadOnlyArray<string>,
47
- ...interpolations: BasicTemplateInterpolations[]
48
- ): string;
@@ -1,56 +0,0 @@
1
- /**
2
- * Flowtype definitions for ac
3
- * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.21.0
5
- * @flow
6
- */
7
- /**
8
- * Memoize the result of ac so if it is called with the same args, it returns immediately.
9
- * Also, to prevent useless React rerenders
10
- */
11
- declare var cache: Map<any, any>;
12
- /**
13
- * `ac` returns an instance of AtomicGroups. The instance holds the knowledge of Atomic Group so we can chain `ac`.
14
- * e.g. <div className={ax([ax(['_aaaa_b']), '_aaaa_c'])} />
15
- */
16
- declare class AtomicGroups {
17
- values: Map<string, string>;
18
- constructor(values: Map<string, string>): this;
19
- toString(): string;
20
- }
21
- /**
22
- * Joins classes together and ensures atomic declarations of a single group exist.
23
- * Atomic declarations take the form of `_{group}{value}` (always prefixed with an underscore),
24
- * where both `group` and `value` are hashes **four characters long**.
25
- * Class names can be of any length,
26
- * this function can take both atomic declarations and class names.
27
- *
28
- * Input:
29
- *
30
- * ```
31
- * ax(['_aaaabbbb', '_aaaacccc'])
32
- * ```
33
- *
34
- * Output:
35
- *
36
- * ```
37
- * '_aaaacccc'
38
- * ```
39
- * @param classes
40
- */
41
- declare export function ac(
42
- classNames: (AtomicGroups | string | void | false)[]
43
- ): AtomicGroups | void;
44
- declare export function memoizedAc(
45
- classNames: (AtomicGroups | string | void | false)[]
46
- ): AtomicGroups | void;
47
- declare var _default: typeof ac;
48
- declare export default typeof _default;
49
- /**
50
- * Provide an opportunity to clear the cache to prevent memory leak.
51
- */
52
- declare export function clearCache(): void;
53
- /**
54
- * Expose cache
55
- */
56
- declare export function getCache(): typeof cache;
@@ -1,27 +0,0 @@
1
- /**
2
- * Flowtype definitions for ax
3
- * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.21.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;
@@ -1,18 +0,0 @@
1
- /**
2
- * Flowtype definitions for cache
3
- * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.21.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;
@@ -1,19 +0,0 @@
1
- /**
2
- * Flowtype definitions for css-custom-property
3
- * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.21.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,7 +0,0 @@
1
- /**
2
- * Flowtype definitions for dev-warnings
3
- * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.21.0
5
- * @flow
6
- */
7
- declare export var analyzeCssInDev: (sheet: string) => void;
@@ -1,11 +0,0 @@
1
- /**
2
- * Flowtype definitions for index
3
- * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.21.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 ac, clearCache as clearAcCache } from './ac';
11
- declare export { default as ix } from './css-custom-property';
@@ -1,19 +0,0 @@
1
- /**
2
- * Flowtype definitions for is-server-environment
3
- * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.21.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 (isServerEnvironment()) {
15
- * // This code will be removed from the browser bundle
16
- * }
17
- * ```
18
- */
19
- declare export var isServerEnvironment: () => boolean;
@@ -1,36 +0,0 @@
1
- /**
2
- * Flowtype definitions for sheet
3
- * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.21.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,19 +0,0 @@
1
- /**
2
- * Flowtype definitions for style-cache
3
- * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.21.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,16 +0,0 @@
1
- /**
2
- * Flowtype definitions for style
3
- * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.21.0
5
- * @flow
6
- */
7
- import type { StyleSheetOpts } from './types';
8
- declare type StyleProps = {
9
- /**
10
- * CSS Rules.
11
- * Ensure each rule is a separate element in the array.
12
- */
13
- children: string[],
14
- ...
15
- } & StyleSheetOpts;
16
- declare export default function Style(props: StyleProps): React$Node | null;
@@ -1,23 +0,0 @@
1
- /**
2
- * Flowtype definitions for types
3
- * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.21.0
5
- * @flow
6
- */
7
- export interface StyleSheetOpts {
8
- /**
9
- * Used to set a nonce on the style element.
10
- * This is needed when using a strict CSP and should be a random hash generated every server load.
11
- * Check out https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/style-src for more information.
12
- */
13
- nonce?: string;
14
- }
15
- /**
16
- * Buckets under which we will group our stylesheets
17
- */
18
- export type Bucket = '' | 'l' | 'v' | 'w' | 'f' | 'i' | 'h' | 'a' | 'm';
19
- export type UseCacheHook = () => { [key: string]: true };
20
- export type ProviderComponent = (props: {
21
- children: React$Node[] | React$Node,
22
- ...
23
- }) => React$Node;
@@ -1,7 +0,0 @@
1
- /**
2
- * Flowtype definitions for runtime
3
- * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.21.0
5
- * @flow
6
- */
7
- declare export { CC, CS, ax, ac, clearAcCache, ix } from './runtime/index';