@compiled/react 0.11.1 → 0.11.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/class-names/index.d.ts +2 -2
- package/dist/browser/class-names/index.js.flow +1 -2
- package/dist/browser/css/index.js.flow +1 -1
- package/dist/browser/index.js.flow +1 -1
- package/dist/browser/jsx/jsx-local-namespace.d.ts +9 -9
- package/dist/browser/keyframes/index.d.ts +1 -1
- package/dist/browser/keyframes/index.js.flow +1 -1
- package/dist/browser/runtime/ax.js +2 -2
- 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/css-custom-property.js.flow +1 -1
- package/dist/browser/runtime/dev-warnings.js.flow +1 -1
- package/dist/browser/runtime/index.js.flow +1 -1
- package/dist/browser/runtime/is-server-environment.js.flow +1 -1
- package/dist/browser/runtime/sheet.js.flow +1 -1
- package/dist/browser/runtime/style-cache.js.flow +1 -1
- package/dist/browser/runtime/style.js.flow +1 -2
- package/dist/browser/runtime/types.d.ts +3 -3
- package/dist/browser/runtime/types.js.flow +1 -1
- package/dist/browser/runtime.js.flow +1 -1
- package/dist/browser/styled/index.d.ts +5 -5
- package/dist/browser/styled/index.js.flow +3 -5
- package/dist/browser/styled/index.js.map +1 -1
- package/dist/browser/types.d.ts +5 -5
- package/dist/browser/types.js.flow +1 -2
- package/dist/browser/utils/error.js.flow +1 -1
- package/dist/cjs/class-names/index.d.ts +2 -2
- package/dist/cjs/class-names/index.js.flow +1 -2
- package/dist/cjs/css/index.js.flow +1 -1
- package/dist/cjs/index.js.flow +1 -1
- package/dist/cjs/jsx/jsx-local-namespace.d.ts +9 -9
- package/dist/cjs/keyframes/index.d.ts +1 -1
- package/dist/cjs/keyframes/index.js.flow +1 -1
- package/dist/cjs/runtime/ax.js +2 -2
- 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/css-custom-property.js.flow +1 -1
- package/dist/cjs/runtime/dev-warnings.js.flow +1 -1
- package/dist/cjs/runtime/index.js.flow +1 -1
- package/dist/cjs/runtime/is-server-environment.js.flow +1 -1
- package/dist/cjs/runtime/sheet.js.flow +1 -1
- package/dist/cjs/runtime/style-cache.js.flow +1 -1
- package/dist/cjs/runtime/style.js.flow +1 -2
- package/dist/cjs/runtime/types.d.ts +3 -3
- package/dist/cjs/runtime/types.js.flow +1 -1
- package/dist/cjs/runtime.js.flow +1 -1
- package/dist/cjs/styled/index.d.ts +5 -5
- package/dist/cjs/styled/index.js.flow +3 -5
- package/dist/cjs/styled/index.js.map +1 -1
- package/dist/cjs/types.d.ts +5 -5
- package/dist/cjs/types.js.flow +1 -2
- package/dist/cjs/utils/error.js.flow +1 -1
- package/dist/esm/class-names/index.d.ts +2 -2
- package/dist/esm/class-names/index.js.flow +1 -2
- package/dist/esm/css/index.js.flow +1 -1
- package/dist/esm/index.js.flow +1 -1
- package/dist/esm/jsx/jsx-local-namespace.d.ts +9 -9
- package/dist/esm/keyframes/index.d.ts +1 -1
- package/dist/esm/keyframes/index.js.flow +1 -1
- package/dist/esm/runtime/ax.js +2 -2
- 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/css-custom-property.js.flow +1 -1
- package/dist/esm/runtime/dev-warnings.js.flow +1 -1
- package/dist/esm/runtime/index.js.flow +1 -1
- package/dist/esm/runtime/is-server-environment.js.flow +1 -1
- package/dist/esm/runtime/sheet.js.flow +1 -1
- package/dist/esm/runtime/style-cache.js.flow +1 -1
- package/dist/esm/runtime/style.js.flow +1 -2
- package/dist/esm/runtime/types.d.ts +3 -3
- package/dist/esm/runtime/types.js.flow +1 -1
- package/dist/esm/runtime.js.flow +1 -1
- package/dist/esm/styled/index.d.ts +5 -5
- package/dist/esm/styled/index.js.flow +3 -5
- package/dist/esm/styled/index.js.map +1 -1
- package/dist/esm/types.d.ts +5 -5
- package/dist/esm/types.js.flow +1 -2
- package/dist/esm/utils/error.js.flow +1 -1
- package/package.json +3 -3
- package/src/class-names/index.js.flow +1 -2
- package/src/css/index.js.flow +1 -1
- package/src/index.js.flow +1 -1
- package/src/keyframes/index.js.flow +1 -1
- package/src/runtime/__tests__/ax.test.ts +20 -2
- package/src/runtime/ax.js.flow +1 -1
- package/src/runtime/ax.ts +2 -2
- package/src/runtime/cache.js.flow +1 -1
- package/src/runtime/css-custom-property.js.flow +1 -1
- package/src/runtime/dev-warnings.js.flow +1 -1
- package/src/runtime/index.js.flow +1 -1
- package/src/runtime/is-server-environment.js.flow +1 -1
- package/src/runtime/sheet.js.flow +1 -1
- package/src/runtime/style-cache.js.flow +1 -1
- package/src/runtime/style.js.flow +1 -2
- package/src/runtime/types.js.flow +1 -1
- package/src/runtime.js.flow +1 -1
- package/src/styled/index.js.flow +3 -5
- package/src/styled/index.ts +2 -4
- package/src/types.js.flow +1 -2
- package/src/utils/error.js.flow +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ReactNode, CSSProperties } from 'react';
|
|
2
2
|
import type { CssType, CssFunction } from '../types';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
3
|
+
export type ObjectInterpolation<TProps> = CssType<TProps> | CssType<TProps>[];
|
|
4
|
+
export type TemplateStringsInterpolation<TProps> = CssFunction<TProps> | CssFunction<TProps>[];
|
|
5
5
|
interface CssSignature<TProps> {
|
|
6
6
|
(...interpolations: ObjectInterpolation<TProps>[]): string;
|
|
7
7
|
(template: TemplateStringsArray, ...interpolations: TemplateStringsInterpolation<TProps>[]): string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Flowtype definitions for index
|
|
3
3
|
* Generated by Flowgen from a Typescript Definition
|
|
4
|
-
* Flowgen v1.
|
|
4
|
+
* Flowgen v1.20.1
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
7
|
import type { Node } from 'react';
|
|
@@ -51,4 +51,3 @@ export interface ClassNamesProps<TProps> {
|
|
|
51
51
|
* ```
|
|
52
52
|
*/
|
|
53
53
|
declare export function ClassNames<TProps>(x: ClassNamesProps<TProps>): React$Node;
|
|
54
|
-
declare export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { CssFunction } from '../types';
|
|
3
|
-
|
|
3
|
+
type WithConditionalCSSProp<TProps> = 'className' extends keyof TProps ? string extends TProps['className' & keyof TProps] ? {
|
|
4
4
|
/**
|
|
5
5
|
* ## CSS prop
|
|
6
6
|
*
|
|
@@ -41,14 +41,14 @@ declare type WithConditionalCSSProp<TProps> = 'className' extends keyof TProps ?
|
|
|
41
41
|
*/
|
|
42
42
|
css?: CssFunction<void> | CssFunction<void>[];
|
|
43
43
|
} : {} : {};
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
44
|
+
type ReactJSXElement = JSX.Element;
|
|
45
|
+
type ReactJSXElementClass = JSX.ElementClass;
|
|
46
|
+
type ReactJSXElementAttributesProperty = JSX.ElementAttributesProperty;
|
|
47
|
+
type ReactJSXElementChildrenAttribute = JSX.ElementChildrenAttribute;
|
|
48
|
+
type ReactJSXLibraryManagedAttributes<C, P> = JSX.LibraryManagedAttributes<C, P>;
|
|
49
|
+
type ReactJSXIntrinsicAttributes = JSX.IntrinsicAttributes;
|
|
50
|
+
type ReactJSXIntrinsicClassAttributes<T> = JSX.IntrinsicClassAttributes<T>;
|
|
51
|
+
type ReactJSXIntrinsicElements = JSX.IntrinsicElements;
|
|
52
52
|
export declare namespace CompiledJSX {
|
|
53
53
|
type Element = ReactJSXElement;
|
|
54
54
|
type ElementClass = ReactJSXElementClass;
|
|
@@ -26,8 +26,8 @@ var ATOMIC_GROUP_LENGTH = 5;
|
|
|
26
26
|
* @param classes
|
|
27
27
|
*/
|
|
28
28
|
export default function ax(classNames) {
|
|
29
|
-
if (classNames.length <= 1) {
|
|
30
|
-
// short circuit if
|
|
29
|
+
if (classNames.length <= 1 && (!classNames[0] || classNames[0].indexOf(' ') === -1)) {
|
|
30
|
+
// short circuit if there's no custom class names.
|
|
31
31
|
return classNames[0] || undefined;
|
|
32
32
|
}
|
|
33
33
|
var atomicGroups = {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ax.js","sourceRoot":"","sources":["../../../src/runtime/ax.ts"],"names":[],"mappings":"AAAA,IAAM,kBAAkB,GAAG,EAAE,CAAC;AAE9B;;;GAGG;AACH,IAAM,mBAAmB,GAAG,CAAC,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,OAAO,UAAU,EAAE,CAAC,UAA0C;IACnE,IAAI,UAAU,CAAC,MAAM,IAAI,CAAC,EAAE;
|
|
1
|
+
{"version":3,"file":"ax.js","sourceRoot":"","sources":["../../../src/runtime/ax.ts"],"names":[],"mappings":"AAAA,IAAM,kBAAkB,GAAG,EAAE,CAAC;AAE9B;;;GAGG;AACH,IAAM,mBAAmB,GAAG,CAAC,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,OAAO,UAAU,EAAE,CAAC,UAA0C;IACnE,IAAI,UAAU,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;QACnF,kDAAkD;QAClD,OAAO,UAAU,CAAC,CAAC,CAAC,IAAI,SAAS,CAAC;KACnC;IAED,IAAM,YAAY,GAA2B,EAAE,CAAC;IAEhD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QAC1C,IAAM,GAAG,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;QAC1B,IAAI,CAAC,GAAG,EAAE;YACR,SAAS;SACV;QAED,IAAM,MAAM,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAE9B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACtC,IAAM,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;YACzB,IAAM,eAAe,GAAG,MAAM,CAAC,KAAK,CAClC,CAAC,EACD,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,kBAAkB,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,SAAS,CAC9E,CAAC;YACF,YAAY,CAAC,eAAe,CAAC,GAAG,MAAM,CAAC;SACxC;KACF;IAED,IAAI,GAAG,GAAG,EAAE,CAAC;IAEb,KAAK,IAAM,GAAG,IAAI,YAAY,EAAE;QAC9B,IAAM,KAAK,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;QAChC,GAAG,IAAI,KAAK,GAAG,GAAG,CAAC;KACpB;IAED,OAAO,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Flowtype definitions for style
|
|
3
3
|
* Generated by Flowgen from a Typescript Definition
|
|
4
|
-
* Flowgen v1.
|
|
4
|
+
* Flowgen v1.20.1
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
7
|
import type { StyleSheetOpts } from './types';
|
|
@@ -14,4 +14,3 @@ declare type StyleProps = {
|
|
|
14
14
|
...
|
|
15
15
|
} & StyleSheetOpts;
|
|
16
16
|
declare export default function Style(props: StyleProps): React$Node | null;
|
|
17
|
-
declare export {};
|
|
@@ -10,8 +10,8 @@ export interface StyleSheetOpts {
|
|
|
10
10
|
/**
|
|
11
11
|
* Buckets under which we will group our stylesheets
|
|
12
12
|
*/
|
|
13
|
-
export
|
|
14
|
-
export
|
|
15
|
-
export
|
|
13
|
+
export type Bucket = '' | 'l' | 'v' | 'w' | 'f' | 'i' | 'h' | 'a' | 'm';
|
|
14
|
+
export type UseCacheHook = () => Record<string, true>;
|
|
15
|
+
export type ProviderComponent = (props: {
|
|
16
16
|
children: JSX.Element[] | JSX.Element;
|
|
17
17
|
}) => JSX.Element;
|
|
@@ -6,17 +6,17 @@ import type { CssType, CssFunction } from '../types';
|
|
|
6
6
|
export interface StyledProps {
|
|
7
7
|
as?: keyof JSX.IntrinsicElements;
|
|
8
8
|
}
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export interface StyledComponent<ComponentProps
|
|
9
|
+
export type ObjectInterpolation<TProps> = CssType<TProps> | CssType<TProps>[];
|
|
10
|
+
export type TemplateStringsInterpolation<TProps> = CssFunction<TProps> | CssFunction<TProps>[];
|
|
11
|
+
export interface StyledComponent<ComponentProps> {
|
|
12
12
|
<TProps = {}>(...css: ObjectInterpolation<TProps>[]): React.ComponentType<TProps & ComponentProps & StyledProps>;
|
|
13
13
|
<TProps = {}>(template: TemplateStringsArray, ...interpolations: TemplateStringsInterpolation<TProps>[]): React.ComponentType<TProps & ComponentProps & StyledProps>;
|
|
14
14
|
}
|
|
15
|
-
export
|
|
15
|
+
export type StyledComponentMap = {
|
|
16
16
|
[Tag in keyof JSX.IntrinsicElements]: StyledComponent<JSX.IntrinsicElements[Tag]>;
|
|
17
17
|
};
|
|
18
18
|
export interface CreateStyledComponent extends StyledComponentMap {
|
|
19
|
-
<TInheritedProps
|
|
19
|
+
<TInheritedProps>(Component: ComponentType<TInheritedProps>): StyledComponent<TInheritedProps>;
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
22
|
* ## Styled component
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Flowtype definitions for index
|
|
3
3
|
* Generated by Flowgen from a Typescript Definition
|
|
4
|
-
* Flowgen v1.
|
|
4
|
+
* Flowgen v1.20.1
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
7
|
import type { ComponentType } from 'react';
|
|
@@ -14,7 +14,7 @@ export type StyledProps = {
|
|
|
14
14
|
};
|
|
15
15
|
export type ObjectInterpolation<TProps> = CssType<TProps> | CssType<TProps>[];
|
|
16
16
|
export type TemplateStringsInterpolation<TProps> = CssFunction<TProps> | CssFunction<TProps>[];
|
|
17
|
-
export interface StyledComponent<ComponentProps
|
|
17
|
+
export interface StyledComponent<ComponentProps> {
|
|
18
18
|
<TProps>(
|
|
19
19
|
...css: ObjectInterpolation<TProps>[]
|
|
20
20
|
): React$ComponentType<{ ...TProps, ...ComponentProps, ...StyledProps }>;
|
|
@@ -25,9 +25,7 @@ export interface StyledComponent<ComponentProps: mixed> {
|
|
|
25
25
|
}
|
|
26
26
|
export type StyledComponentMap = $ObjMapi<$JSXIntrinsics, <Tag>(Tag) => StyledComponent<mixed>>;
|
|
27
27
|
export type CreateStyledComponent = {
|
|
28
|
-
<TInheritedProps:
|
|
29
|
-
Component: ComponentType<TInheritedProps>
|
|
30
|
-
): StyledComponent<TInheritedProps>,
|
|
28
|
+
<TInheritedProps>(Component: ComponentType<TInheritedProps>): StyledComponent<TInheritedProps>,
|
|
31
29
|
...
|
|
32
30
|
} & StyledComponentMap;
|
|
33
31
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/styled/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/styled/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAoClD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,MAAM,CAAC,IAAM,MAAM,GAA0B,IAAI,KAAK,CACpD,EAAE,EACF;IACE,GAAG;QACD,OAAO;YACL,8CAA8C;YAC9C,yDAAyD;YACzD,MAAM,gBAAgB,EAAE,CAAC;QAC3B,CAAC,CAAC;IACJ,CAAC;CACF,CACK,CAAC"}
|
package/dist/browser/types.d.ts
CHANGED
|
@@ -2,19 +2,19 @@ import type * as CSS from 'csstype';
|
|
|
2
2
|
/**
|
|
3
3
|
* Typing for the interpolations.
|
|
4
4
|
*/
|
|
5
|
-
export
|
|
5
|
+
export type BasicTemplateInterpolations = string | number;
|
|
6
6
|
export interface FunctionInterpolation<TProps> {
|
|
7
7
|
(props: TProps): CssFunction<TProps>;
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
10
|
* Possible types for a CSS value
|
|
11
11
|
*/
|
|
12
|
-
export
|
|
12
|
+
export type CssType<TProps> = CSSProps<TProps> | CssObject<TProps> | FunctionInterpolation<TProps> | string;
|
|
13
13
|
/**
|
|
14
14
|
* These are all the CSS props that will exist.
|
|
15
15
|
*/
|
|
16
|
-
export
|
|
17
|
-
export
|
|
16
|
+
export type CSSProps<TProps> = CSS.Properties<CssFunction<TProps>>;
|
|
17
|
+
export type CssObject<TProps> = {
|
|
18
18
|
[key: string]: CssFunction<TProps>;
|
|
19
19
|
};
|
|
20
|
-
export
|
|
20
|
+
export type CssFunction<TProps = unknown> = CssType<TProps> | BasicTemplateInterpolations | boolean | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Flowtype definitions for types
|
|
3
3
|
* Generated by Flowgen from a Typescript Definition
|
|
4
|
-
* Flowgen v1.
|
|
4
|
+
* Flowgen v1.20.1
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
7
|
import * as CSS from 'csstype';
|
|
@@ -23,7 +23,6 @@ export type CSSProps<TProps> = CSS.Properties<CssFunction<TProps>>;
|
|
|
23
23
|
export type CssObject<TProps> = {
|
|
24
24
|
...CSSProps<TProps>,
|
|
25
25
|
[key: string]: CssFunction<TProps>,
|
|
26
|
-
...
|
|
27
26
|
};
|
|
28
27
|
export type CssFunction<TProps = mixed> =
|
|
29
28
|
| CssType<TProps>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ReactNode, CSSProperties } from 'react';
|
|
2
2
|
import type { CssType, CssFunction } from '../types';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
3
|
+
export type ObjectInterpolation<TProps> = CssType<TProps> | CssType<TProps>[];
|
|
4
|
+
export type TemplateStringsInterpolation<TProps> = CssFunction<TProps> | CssFunction<TProps>[];
|
|
5
5
|
interface CssSignature<TProps> {
|
|
6
6
|
(...interpolations: ObjectInterpolation<TProps>[]): string;
|
|
7
7
|
(template: TemplateStringsArray, ...interpolations: TemplateStringsInterpolation<TProps>[]): string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Flowtype definitions for index
|
|
3
3
|
* Generated by Flowgen from a Typescript Definition
|
|
4
|
-
* Flowgen v1.
|
|
4
|
+
* Flowgen v1.20.1
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
7
|
import type { Node } from 'react';
|
|
@@ -51,4 +51,3 @@ export interface ClassNamesProps<TProps> {
|
|
|
51
51
|
* ```
|
|
52
52
|
*/
|
|
53
53
|
declare export function ClassNames<TProps>(x: ClassNamesProps<TProps>): React$Node;
|
|
54
|
-
declare export {};
|
package/dist/cjs/index.js.flow
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { CssFunction } from '../types';
|
|
3
|
-
|
|
3
|
+
type WithConditionalCSSProp<TProps> = 'className' extends keyof TProps ? string extends TProps['className' & keyof TProps] ? {
|
|
4
4
|
/**
|
|
5
5
|
* ## CSS prop
|
|
6
6
|
*
|
|
@@ -41,14 +41,14 @@ declare type WithConditionalCSSProp<TProps> = 'className' extends keyof TProps ?
|
|
|
41
41
|
*/
|
|
42
42
|
css?: CssFunction<void> | CssFunction<void>[];
|
|
43
43
|
} : {} : {};
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
44
|
+
type ReactJSXElement = JSX.Element;
|
|
45
|
+
type ReactJSXElementClass = JSX.ElementClass;
|
|
46
|
+
type ReactJSXElementAttributesProperty = JSX.ElementAttributesProperty;
|
|
47
|
+
type ReactJSXElementChildrenAttribute = JSX.ElementChildrenAttribute;
|
|
48
|
+
type ReactJSXLibraryManagedAttributes<C, P> = JSX.LibraryManagedAttributes<C, P>;
|
|
49
|
+
type ReactJSXIntrinsicAttributes = JSX.IntrinsicAttributes;
|
|
50
|
+
type ReactJSXIntrinsicClassAttributes<T> = JSX.IntrinsicClassAttributes<T>;
|
|
51
|
+
type ReactJSXIntrinsicElements = JSX.IntrinsicElements;
|
|
52
52
|
export declare namespace CompiledJSX {
|
|
53
53
|
type Element = ReactJSXElement;
|
|
54
54
|
type ElementClass = ReactJSXElementClass;
|
package/dist/cjs/runtime/ax.js
CHANGED
|
@@ -28,8 +28,8 @@ var ATOMIC_GROUP_LENGTH = 5;
|
|
|
28
28
|
* @param classes
|
|
29
29
|
*/
|
|
30
30
|
function ax(classNames) {
|
|
31
|
-
if (classNames.length <= 1) {
|
|
32
|
-
// short circuit if
|
|
31
|
+
if (classNames.length <= 1 && (!classNames[0] || classNames[0].indexOf(' ') === -1)) {
|
|
32
|
+
// short circuit if there's no custom class names.
|
|
33
33
|
return classNames[0] || undefined;
|
|
34
34
|
}
|
|
35
35
|
var atomicGroups = {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ax.js","sourceRoot":"","sources":["../../../src/runtime/ax.ts"],"names":[],"mappings":";;AAAA,IAAM,kBAAkB,GAAG,EAAE,CAAC;AAE9B;;;GAGG;AACH,IAAM,mBAAmB,GAAG,CAAC,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,SAAwB,EAAE,CAAC,UAA0C;IACnE,IAAI,UAAU,CAAC,MAAM,IAAI,CAAC,EAAE;
|
|
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,IAAI,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;QACnF,kDAAkD;QAClD,OAAO,UAAU,CAAC,CAAC,CAAC,IAAI,SAAS,CAAC;KACnC;IAED,IAAM,YAAY,GAA2B,EAAE,CAAC;IAEhD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QAC1C,IAAM,GAAG,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;QAC1B,IAAI,CAAC,GAAG,EAAE;YACR,SAAS;SACV;QAED,IAAM,MAAM,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAE9B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACtC,IAAM,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;YACzB,IAAM,eAAe,GAAG,MAAM,CAAC,KAAK,CAClC,CAAC,EACD,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,kBAAkB,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,SAAS,CAC9E,CAAC;YACF,YAAY,CAAC,eAAe,CAAC,GAAG,MAAM,CAAC;SACxC;KACF;IAED,IAAI,GAAG,GAAG,EAAE,CAAC;IAEb,KAAK,IAAM,GAAG,IAAI,YAAY,EAAE;QAC9B,IAAM,KAAK,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;QAChC,GAAG,IAAI,KAAK,GAAG,GAAG,CAAC;KACpB;IAED,OAAO,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAC1B,CAAC;AAlCD,qBAkCC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Flowtype definitions for style
|
|
3
3
|
* Generated by Flowgen from a Typescript Definition
|
|
4
|
-
* Flowgen v1.
|
|
4
|
+
* Flowgen v1.20.1
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
7
|
import type { StyleSheetOpts } from './types';
|
|
@@ -14,4 +14,3 @@ declare type StyleProps = {
|
|
|
14
14
|
...
|
|
15
15
|
} & StyleSheetOpts;
|
|
16
16
|
declare export default function Style(props: StyleProps): React$Node | null;
|
|
17
|
-
declare export {};
|
|
@@ -10,8 +10,8 @@ export interface StyleSheetOpts {
|
|
|
10
10
|
/**
|
|
11
11
|
* Buckets under which we will group our stylesheets
|
|
12
12
|
*/
|
|
13
|
-
export
|
|
14
|
-
export
|
|
15
|
-
export
|
|
13
|
+
export type Bucket = '' | 'l' | 'v' | 'w' | 'f' | 'i' | 'h' | 'a' | 'm';
|
|
14
|
+
export type UseCacheHook = () => Record<string, true>;
|
|
15
|
+
export type ProviderComponent = (props: {
|
|
16
16
|
children: JSX.Element[] | JSX.Element;
|
|
17
17
|
}) => JSX.Element;
|
package/dist/cjs/runtime.js.flow
CHANGED
|
@@ -6,17 +6,17 @@ import type { CssType, CssFunction } from '../types';
|
|
|
6
6
|
export interface StyledProps {
|
|
7
7
|
as?: keyof JSX.IntrinsicElements;
|
|
8
8
|
}
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export interface StyledComponent<ComponentProps
|
|
9
|
+
export type ObjectInterpolation<TProps> = CssType<TProps> | CssType<TProps>[];
|
|
10
|
+
export type TemplateStringsInterpolation<TProps> = CssFunction<TProps> | CssFunction<TProps>[];
|
|
11
|
+
export interface StyledComponent<ComponentProps> {
|
|
12
12
|
<TProps = {}>(...css: ObjectInterpolation<TProps>[]): React.ComponentType<TProps & ComponentProps & StyledProps>;
|
|
13
13
|
<TProps = {}>(template: TemplateStringsArray, ...interpolations: TemplateStringsInterpolation<TProps>[]): React.ComponentType<TProps & ComponentProps & StyledProps>;
|
|
14
14
|
}
|
|
15
|
-
export
|
|
15
|
+
export type StyledComponentMap = {
|
|
16
16
|
[Tag in keyof JSX.IntrinsicElements]: StyledComponent<JSX.IntrinsicElements[Tag]>;
|
|
17
17
|
};
|
|
18
18
|
export interface CreateStyledComponent extends StyledComponentMap {
|
|
19
|
-
<TInheritedProps
|
|
19
|
+
<TInheritedProps>(Component: ComponentType<TInheritedProps>): StyledComponent<TInheritedProps>;
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
22
|
* ## Styled component
|