@animus-ui/core 0.1.1-e0310963.100 → 0.1.1-e4cdacd2.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/CHANGELOG.md +96 -0
- package/README.md +1 -86
- package/dist/Animus.d.ts +63 -0
- package/dist/AnimusConfig.d.ts +8 -0
- package/dist/{utils/__fixtures__ → __fixtures__}/testConfig.d.ts +0 -0
- package/dist/compatTheme.d.ts +27 -0
- package/dist/config.d.ts +2193 -0
- package/dist/createAnimus.d.ts +1 -1
- package/dist/index.d.ts +417 -997
- package/dist/index.js +1229 -0
- package/dist/legacy/compose.d.ts +2 -0
- package/dist/legacy/config.d.ts +86 -0
- package/dist/legacy/core.d.ts +12 -0
- package/dist/legacy/create.d.ts +2 -0
- package/dist/{internal → legacy}/createCss.d.ts +1 -1
- package/dist/legacy/createParser.d.ts +2 -0
- package/dist/{internal → legacy}/createStates.d.ts +1 -1
- package/dist/{styles → legacy}/createTransform.d.ts +1 -1
- package/dist/{internal → legacy}/createVariant.d.ts +1 -1
- package/dist/{utils → legacy}/responsive.d.ts +3 -2
- package/dist/properties/getStylePropNames.d.ts +1 -0
- package/dist/{utils/propNames.d.ts → properties/orderPropNames.d.ts} +1 -1
- package/dist/properties/styledOptions.d.ts +21 -0
- package/dist/scales/lookupScaleValue.d.ts +3 -0
- package/dist/styles/createParser.d.ts +2 -9
- package/dist/styles/createPropertyStyle.d.ts +4 -0
- package/dist/styles/createStylist.d.ts +1 -1
- package/dist/styles/responsive.d.ts +14 -0
- package/dist/transforms/border.d.ts +1 -0
- package/dist/transforms/index.d.ts +2 -0
- package/dist/transforms/utils.d.ts +2 -0
- package/dist/types/config.d.ts +31 -62
- package/dist/types/properties.d.ts +4 -3
- package/dist/types/props.d.ts +0 -13
- package/dist/types/scales.d.ts +2 -0
- package/dist/types/shared.d.ts +4 -0
- package/dist/types/theme.d.ts +0 -16
- package/dist/types/utils.d.ts +1 -0
- package/package.json +8 -6
- package/dist/animusBuilder.d.ts +0 -81
- package/dist/configBuilder.d.ts +0 -11
- package/dist/deprecated/core.d.ts +0 -10
- package/dist/index.cjs.js +0 -1
- package/dist/index.esm.js +0 -1
- package/dist/internal/compose.d.ts +0 -2
- package/dist/internal/create.d.ts +0 -2
- package/dist/props/baseConfig.d.ts +0 -588
- package/dist/props/baseScales.d.ts +0 -51
- package/dist/scales/createScaleLookup.d.ts +0 -5
- package/dist/utils/getStaticProperties.d.ts +0 -1
- package/dist/utils/styledOptions.d.ts +0 -21
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { Theme } from '@emotion/react';
|
|
2
|
+
import { DefaultCSSPropertyValue, PropertyTypes } from '../types/properties';
|
|
3
|
+
import { CSSObject } from '../types/shared';
|
|
4
|
+
import { AbstractProps, ResponsiveProp, ThemeProps } from '../types/props';
|
|
5
|
+
import { CSSPropMap, CSSProps } from '../types/config';
|
|
6
|
+
import { AllUnionKeys, Key, KeyFromUnion } from '../types/utils';
|
|
7
|
+
export declare type MapScale = Record<string | number, string | number>;
|
|
8
|
+
export declare type ArrayScale = readonly (string | number | CSSObject)[] & {
|
|
9
|
+
length: 0;
|
|
10
|
+
};
|
|
11
|
+
export interface BaseProperty {
|
|
12
|
+
property: keyof PropertyTypes;
|
|
13
|
+
properties?: readonly (keyof PropertyTypes)[];
|
|
14
|
+
}
|
|
15
|
+
export interface Prop extends BaseProperty {
|
|
16
|
+
scale?: keyof Theme | MapScale | ArrayScale;
|
|
17
|
+
variable?: string;
|
|
18
|
+
transform?: (val: string | number, prop?: string, props?: AbstractProps) => string | number | CSSObject;
|
|
19
|
+
}
|
|
20
|
+
export interface AbstractPropTransformer extends Prop {
|
|
21
|
+
prop: string;
|
|
22
|
+
styleFn: (value: unknown, prop: string, props: AbstractProps) => CSSObject;
|
|
23
|
+
}
|
|
24
|
+
export interface AbstractParser {
|
|
25
|
+
(props: AbstractProps, orderProps?: boolean): CSSObject;
|
|
26
|
+
propNames: string[];
|
|
27
|
+
config: Record<string, AbstractPropTransformer>;
|
|
28
|
+
}
|
|
29
|
+
export declare type PropertyValues<Property extends keyof PropertyTypes, All extends boolean = false> = Exclude<PropertyTypes<All extends true ? DefaultCSSPropertyValue : never>[Property], All extends true ? never : object | any[]>;
|
|
30
|
+
export declare type ScaleValue<Config extends Prop> = Config['scale'] extends keyof Theme ? keyof Theme[Config['scale']] | PropertyValues<Config['property']> : Config['scale'] extends MapScale ? keyof Config['scale'] | PropertyValues<Config['property']> : Config['scale'] extends ArrayScale ? Config['scale'][number] | PropertyValues<Config['property']> : PropertyValues<Config['property'], true>;
|
|
31
|
+
/**
|
|
32
|
+
* Value or something
|
|
33
|
+
*/
|
|
34
|
+
export declare type Scale<Config extends Prop> = ResponsiveProp<ScaleValue<Config> | ((theme: Theme) => ScaleValue<Config>)>;
|
|
35
|
+
export interface TransformFn<P extends string, Config extends Prop> {
|
|
36
|
+
(value: Scale<Config> | Scale<Config>, prop: P, props: ThemeProps<{
|
|
37
|
+
[K in P]?: Scale<Config>;
|
|
38
|
+
}>): CSSObject;
|
|
39
|
+
}
|
|
40
|
+
export interface PropTransformer<P extends string, C extends Prop> extends AbstractPropTransformer, Prop {
|
|
41
|
+
prop: P;
|
|
42
|
+
styleFn: TransformFn<P, C>;
|
|
43
|
+
}
|
|
44
|
+
export declare type TransformerMap<Config extends Record<string, Prop>> = {
|
|
45
|
+
[P in Key<keyof Config>]: PropTransformer<Key<P>, Config[P]>;
|
|
46
|
+
};
|
|
47
|
+
export interface Parser<Config extends Record<string, AbstractPropTransformer>> {
|
|
48
|
+
(props: ParserProps<Config>, orderProps?: boolean): CSSObject;
|
|
49
|
+
propNames: (keyof Config)[];
|
|
50
|
+
config: Config;
|
|
51
|
+
}
|
|
52
|
+
export declare type Compose<Args extends AbstractParser[]> = {
|
|
53
|
+
[K in AllUnionKeys<Args[number]['config']>]: KeyFromUnion<Args[number]['config'], K>;
|
|
54
|
+
};
|
|
55
|
+
export interface Variant<P extends AbstractParser> {
|
|
56
|
+
<Keys extends keyof Props, Base extends AbstractProps, Props extends Record<Keys, AbstractProps>, PropKey extends Readonly<string> = 'variant'>(options: {
|
|
57
|
+
prop?: PropKey;
|
|
58
|
+
defaultVariant?: keyof Props;
|
|
59
|
+
base?: CSSProps<Base, SystemProps<P>>;
|
|
60
|
+
variants: CSSPropMap<Props, SystemProps<P>>;
|
|
61
|
+
}): (props: VariantProps<PropKey, Keys | false> & ThemeProps) => CSSObject;
|
|
62
|
+
}
|
|
63
|
+
export interface States<P extends AbstractParser> {
|
|
64
|
+
<Props extends Record<string, AbstractProps>>(states: CSSPropMap<Props, SystemProps<P>>): (props: Partial<Record<keyof Props, boolean>> & ThemeProps) => CSSObject;
|
|
65
|
+
}
|
|
66
|
+
export interface CSS<P extends AbstractParser> {
|
|
67
|
+
<Props extends AbstractProps>(config: CSSProps<Props, SystemProps<P>>): (props: ThemeProps) => CSSObject;
|
|
68
|
+
}
|
|
69
|
+
export declare type ParserProps<Config extends Record<string, AbstractPropTransformer>> = ThemeProps<{
|
|
70
|
+
[P in keyof Config]?: Parameters<Config[P]['styleFn']>[2][Config[P]['prop']];
|
|
71
|
+
}>;
|
|
72
|
+
export declare type SystemProps<P extends AbstractParser> = {
|
|
73
|
+
[K in keyof Omit<Parameters<P>[0], 'theme'>]: Omit<Parameters<P>[0], 'theme'>[K];
|
|
74
|
+
};
|
|
75
|
+
export declare type VariantProps<T extends string, V> = {
|
|
76
|
+
[Key in T]?: V;
|
|
77
|
+
};
|
|
78
|
+
export declare type Arg<T extends (...args: any) => any> = Parameters<T>[0];
|
|
79
|
+
export interface PropConfig {
|
|
80
|
+
props: {
|
|
81
|
+
[i: string]: Prop;
|
|
82
|
+
};
|
|
83
|
+
groups: {
|
|
84
|
+
[i: string]: (string | symbol | number)[];
|
|
85
|
+
};
|
|
86
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createCss } from './createCss';
|
|
2
|
+
import { createVariant } from './createVariant';
|
|
3
|
+
import { create } from './create';
|
|
4
|
+
import { compose } from './compose';
|
|
5
|
+
import { createStates } from './createStates';
|
|
6
|
+
export declare const animusProps: {
|
|
7
|
+
compose: typeof compose;
|
|
8
|
+
create: typeof create;
|
|
9
|
+
createCss: typeof createCss;
|
|
10
|
+
createVariant: typeof createVariant;
|
|
11
|
+
createStates: typeof createStates;
|
|
12
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { CSS, Parser, Prop, TransformerMap } from '
|
|
1
|
+
import { CSS, Parser, Prop, TransformerMap } from './config';
|
|
2
2
|
export declare function createCss<Config extends Record<string, Prop>, P extends Parser<TransformerMap<Config>>>(config: Config): CSS<P>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Parser, Prop, States, TransformerMap } from '
|
|
1
|
+
import { Parser, Prop, States, TransformerMap } from './config';
|
|
2
2
|
export declare function createStates<Config extends Record<string, Prop>, P extends Parser<TransformerMap<Config>>>(config: Config): States<P>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Prop, PropTransformer } from '
|
|
1
|
+
import { Prop, PropTransformer } from './config';
|
|
2
2
|
export declare function createTransform<P extends string, Config extends Prop>(prop: P, config: Config): PropTransformer<P, Config>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Parser, Prop, TransformerMap, Variant } from '
|
|
1
|
+
import { Parser, Prop, TransformerMap, Variant } from './config';
|
|
2
2
|
export declare function createVariant<Config extends Record<string, Prop>, P extends Parser<TransformerMap<Config>>>(config: Config): Variant<P>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { AbstractPropTransformer } from '
|
|
2
|
-
import {
|
|
1
|
+
import { AbstractPropTransformer } from './config';
|
|
2
|
+
import { CSSObject } from '../types/shared';
|
|
3
|
+
import { MediaQueryCache, MediaQueryMap, ThemeProps } from '../types/props';
|
|
3
4
|
import { Breakpoints } from '../types/theme';
|
|
4
5
|
export declare const createMediaQueries: (breakpoints?: Breakpoints | undefined) => MediaQueryCache | null;
|
|
5
6
|
export declare const isMediaArray: (val: unknown) => val is (string | number)[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getStylePropNames: (props: Record<string, any>, filteredKeys: string[]) => Pick<Record<string, any>, string>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/**
|
|
3
|
+
* Emotion will not attempt to forward all system props - so this pre filters all possible exceptions to search agains
|
|
4
|
+
* props like `color` and `width`.
|
|
5
|
+
*/
|
|
6
|
+
export declare type ForwardableProps<El extends keyof JSX.IntrinsicElements, Reserved> = Exclude<El extends keyof JSX.IntrinsicElements ? keyof JSX.IntrinsicElements[El] : keyof Element, Reserved>;
|
|
7
|
+
/**
|
|
8
|
+
* @description
|
|
9
|
+
* This object can be passed to the second argument of `styled('div', styledOptions)` or be called as a function to filter additional prop names
|
|
10
|
+
* If you are extending a component that already has filtered props - you do not need to provide additional guards if you are not passing additional props
|
|
11
|
+
* @example
|
|
12
|
+
*/
|
|
13
|
+
export declare const createStyledOptions: <T extends Record<string, any>>(props: T) => (<El extends keyof JSX.IntrinsicElements = "div", Forward extends string = never, Filter extends string = never>(opts?: {
|
|
14
|
+
element?: El | undefined;
|
|
15
|
+
forward?: readonly Forward[] | undefined;
|
|
16
|
+
filter?: readonly Filter[] | undefined;
|
|
17
|
+
} | undefined) => {
|
|
18
|
+
shouldForwardProp: (prop: PropertyKey) => prop is Forward | Exclude<El extends keyof JSX.IntrinsicElements ? keyof JSX.IntrinsicElements[El] : keyof Element, "variant" | Filter | keyof T | "mode">;
|
|
19
|
+
}) & {
|
|
20
|
+
shouldForwardProp: (prop: PropertyKey) => prop is Exclude<"ref", "variant" | keyof T | "mode"> | Exclude<"key", "variant" | keyof T | "mode"> | Exclude<"color", "variant" | keyof T | "mode"> | Exclude<"translate", "variant" | keyof T | "mode"> | Exclude<"property", "variant" | keyof T | "mode"> | Exclude<"hidden", "variant" | keyof T | "mode"> | Exclude<"style", "variant" | keyof T | "mode"> | Exclude<"slot", "variant" | keyof T | "mode"> | Exclude<"title", "variant" | keyof T | "mode"> | Exclude<"className", "variant" | keyof T | "mode"> | Exclude<"id", "variant" | keyof T | "mode"> | Exclude<"prefix", "variant" | keyof T | "mode"> | Exclude<"children", "variant" | keyof T | "mode"> | Exclude<"lang", "variant" | keyof T | "mode"> | Exclude<"role", "variant" | keyof T | "mode"> | Exclude<"tabIndex", "variant" | keyof T | "mode"> | Exclude<"aria-activedescendant", "variant" | keyof T | "mode"> | Exclude<"aria-atomic", "variant" | keyof T | "mode"> | Exclude<"aria-autocomplete", "variant" | keyof T | "mode"> | Exclude<"aria-busy", "variant" | keyof T | "mode"> | Exclude<"aria-checked", "variant" | keyof T | "mode"> | Exclude<"aria-colcount", "variant" | keyof T | "mode"> | Exclude<"aria-colindex", "variant" | keyof T | "mode"> | Exclude<"aria-colspan", "variant" | keyof T | "mode"> | Exclude<"aria-controls", "variant" | keyof T | "mode"> | Exclude<"aria-current", "variant" | keyof T | "mode"> | Exclude<"aria-describedby", "variant" | keyof T | "mode"> | Exclude<"aria-details", "variant" | keyof T | "mode"> | Exclude<"aria-disabled", "variant" | keyof T | "mode"> | Exclude<"aria-dropeffect", "variant" | keyof T | "mode"> | Exclude<"aria-errormessage", "variant" | keyof T | "mode"> | Exclude<"aria-expanded", "variant" | keyof T | "mode"> | Exclude<"aria-flowto", "variant" | keyof T | "mode"> | Exclude<"aria-grabbed", "variant" | keyof T | "mode"> | Exclude<"aria-haspopup", "variant" | keyof T | "mode"> | Exclude<"aria-hidden", "variant" | keyof T | "mode"> | Exclude<"aria-invalid", "variant" | keyof T | "mode"> | Exclude<"aria-keyshortcuts", "variant" | keyof T | "mode"> | Exclude<"aria-label", "variant" | keyof T | "mode"> | Exclude<"aria-labelledby", "variant" | keyof T | "mode"> | Exclude<"aria-level", "variant" | keyof T | "mode"> | Exclude<"aria-live", "variant" | keyof T | "mode"> | Exclude<"aria-modal", "variant" | keyof T | "mode"> | Exclude<"aria-multiline", "variant" | keyof T | "mode"> | Exclude<"aria-multiselectable", "variant" | keyof T | "mode"> | Exclude<"aria-orientation", "variant" | keyof T | "mode"> | Exclude<"aria-owns", "variant" | keyof T | "mode"> | Exclude<"aria-placeholder", "variant" | keyof T | "mode"> | Exclude<"aria-posinset", "variant" | keyof T | "mode"> | Exclude<"aria-pressed", "variant" | keyof T | "mode"> | Exclude<"aria-readonly", "variant" | keyof T | "mode"> | Exclude<"aria-relevant", "variant" | keyof T | "mode"> | Exclude<"aria-required", "variant" | keyof T | "mode"> | Exclude<"aria-roledescription", "variant" | keyof T | "mode"> | Exclude<"aria-rowcount", "variant" | keyof T | "mode"> | Exclude<"aria-rowindex", "variant" | keyof T | "mode"> | Exclude<"aria-rowspan", "variant" | keyof T | "mode"> | Exclude<"aria-selected", "variant" | keyof T | "mode"> | Exclude<"aria-setsize", "variant" | keyof T | "mode"> | Exclude<"aria-sort", "variant" | keyof T | "mode"> | Exclude<"aria-valuemax", "variant" | keyof T | "mode"> | Exclude<"aria-valuemin", "variant" | keyof T | "mode"> | Exclude<"aria-valuenow", "variant" | keyof T | "mode"> | Exclude<"aria-valuetext", "variant" | keyof T | "mode"> | Exclude<"dangerouslySetInnerHTML", "variant" | keyof T | "mode"> | Exclude<"onCopy", "variant" | keyof T | "mode"> | Exclude<"onCopyCapture", "variant" | keyof T | "mode"> | Exclude<"onCut", "variant" | keyof T | "mode"> | Exclude<"onCutCapture", "variant" | keyof T | "mode"> | Exclude<"onPaste", "variant" | keyof T | "mode"> | Exclude<"onPasteCapture", "variant" | keyof T | "mode"> | Exclude<"onCompositionEnd", "variant" | keyof T | "mode"> | Exclude<"onCompositionEndCapture", "variant" | keyof T | "mode"> | Exclude<"onCompositionStart", "variant" | keyof T | "mode"> | Exclude<"onCompositionStartCapture", "variant" | keyof T | "mode"> | Exclude<"onCompositionUpdate", "variant" | keyof T | "mode"> | Exclude<"onCompositionUpdateCapture", "variant" | keyof T | "mode"> | Exclude<"onFocus", "variant" | keyof T | "mode"> | Exclude<"onFocusCapture", "variant" | keyof T | "mode"> | Exclude<"onBlur", "variant" | keyof T | "mode"> | Exclude<"onBlurCapture", "variant" | keyof T | "mode"> | Exclude<"onChange", "variant" | keyof T | "mode"> | Exclude<"onChangeCapture", "variant" | keyof T | "mode"> | Exclude<"onBeforeInput", "variant" | keyof T | "mode"> | Exclude<"onBeforeInputCapture", "variant" | keyof T | "mode"> | Exclude<"onInput", "variant" | keyof T | "mode"> | Exclude<"onInputCapture", "variant" | keyof T | "mode"> | Exclude<"onReset", "variant" | keyof T | "mode"> | Exclude<"onResetCapture", "variant" | keyof T | "mode"> | Exclude<"onSubmit", "variant" | keyof T | "mode"> | Exclude<"onSubmitCapture", "variant" | keyof T | "mode"> | Exclude<"onInvalid", "variant" | keyof T | "mode"> | Exclude<"onInvalidCapture", "variant" | keyof T | "mode"> | Exclude<"onLoad", "variant" | keyof T | "mode"> | Exclude<"onLoadCapture", "variant" | keyof T | "mode"> | Exclude<"onError", "variant" | keyof T | "mode"> | Exclude<"onErrorCapture", "variant" | keyof T | "mode"> | Exclude<"onKeyDown", "variant" | keyof T | "mode"> | Exclude<"onKeyDownCapture", "variant" | keyof T | "mode"> | Exclude<"onKeyPress", "variant" | keyof T | "mode"> | Exclude<"onKeyPressCapture", "variant" | keyof T | "mode"> | Exclude<"onKeyUp", "variant" | keyof T | "mode"> | Exclude<"onKeyUpCapture", "variant" | keyof T | "mode"> | Exclude<"onAbort", "variant" | keyof T | "mode"> | Exclude<"onAbortCapture", "variant" | keyof T | "mode"> | Exclude<"onCanPlay", "variant" | keyof T | "mode"> | Exclude<"onCanPlayCapture", "variant" | keyof T | "mode"> | Exclude<"onCanPlayThrough", "variant" | keyof T | "mode"> | Exclude<"onCanPlayThroughCapture", "variant" | keyof T | "mode"> | Exclude<"onDurationChange", "variant" | keyof T | "mode"> | Exclude<"onDurationChangeCapture", "variant" | keyof T | "mode"> | Exclude<"onEmptied", "variant" | keyof T | "mode"> | Exclude<"onEmptiedCapture", "variant" | keyof T | "mode"> | Exclude<"onEncrypted", "variant" | keyof T | "mode"> | Exclude<"onEncryptedCapture", "variant" | keyof T | "mode"> | Exclude<"onEnded", "variant" | keyof T | "mode"> | Exclude<"onEndedCapture", "variant" | keyof T | "mode"> | Exclude<"onLoadedData", "variant" | keyof T | "mode"> | Exclude<"onLoadedDataCapture", "variant" | keyof T | "mode"> | Exclude<"onLoadedMetadata", "variant" | keyof T | "mode"> | Exclude<"onLoadedMetadataCapture", "variant" | keyof T | "mode"> | Exclude<"onLoadStart", "variant" | keyof T | "mode"> | Exclude<"onLoadStartCapture", "variant" | keyof T | "mode"> | Exclude<"onPause", "variant" | keyof T | "mode"> | Exclude<"onPauseCapture", "variant" | keyof T | "mode"> | Exclude<"onPlay", "variant" | keyof T | "mode"> | Exclude<"onPlayCapture", "variant" | keyof T | "mode"> | Exclude<"onPlaying", "variant" | keyof T | "mode"> | Exclude<"onPlayingCapture", "variant" | keyof T | "mode"> | Exclude<"onProgress", "variant" | keyof T | "mode"> | Exclude<"onProgressCapture", "variant" | keyof T | "mode"> | Exclude<"onRateChange", "variant" | keyof T | "mode"> | Exclude<"onRateChangeCapture", "variant" | keyof T | "mode"> | Exclude<"onSeeked", "variant" | keyof T | "mode"> | Exclude<"onSeekedCapture", "variant" | keyof T | "mode"> | Exclude<"onSeeking", "variant" | keyof T | "mode"> | Exclude<"onSeekingCapture", "variant" | keyof T | "mode"> | Exclude<"onStalled", "variant" | keyof T | "mode"> | Exclude<"onStalledCapture", "variant" | keyof T | "mode"> | Exclude<"onSuspend", "variant" | keyof T | "mode"> | Exclude<"onSuspendCapture", "variant" | keyof T | "mode"> | Exclude<"onTimeUpdate", "variant" | keyof T | "mode"> | Exclude<"onTimeUpdateCapture", "variant" | keyof T | "mode"> | Exclude<"onVolumeChange", "variant" | keyof T | "mode"> | Exclude<"onVolumeChangeCapture", "variant" | keyof T | "mode"> | Exclude<"onWaiting", "variant" | keyof T | "mode"> | Exclude<"onWaitingCapture", "variant" | keyof T | "mode"> | Exclude<"onAuxClick", "variant" | keyof T | "mode"> | Exclude<"onAuxClickCapture", "variant" | keyof T | "mode"> | Exclude<"onClick", "variant" | keyof T | "mode"> | Exclude<"onClickCapture", "variant" | keyof T | "mode"> | Exclude<"onContextMenu", "variant" | keyof T | "mode"> | Exclude<"onContextMenuCapture", "variant" | keyof T | "mode"> | Exclude<"onDoubleClick", "variant" | keyof T | "mode"> | Exclude<"onDoubleClickCapture", "variant" | keyof T | "mode"> | Exclude<"onDrag", "variant" | keyof T | "mode"> | Exclude<"onDragCapture", "variant" | keyof T | "mode"> | Exclude<"onDragEnd", "variant" | keyof T | "mode"> | Exclude<"onDragEndCapture", "variant" | keyof T | "mode"> | Exclude<"onDragEnter", "variant" | keyof T | "mode"> | Exclude<"onDragEnterCapture", "variant" | keyof T | "mode"> | Exclude<"onDragExit", "variant" | keyof T | "mode"> | Exclude<"onDragExitCapture", "variant" | keyof T | "mode"> | Exclude<"onDragLeave", "variant" | keyof T | "mode"> | Exclude<"onDragLeaveCapture", "variant" | keyof T | "mode"> | Exclude<"onDragOver", "variant" | keyof T | "mode"> | Exclude<"onDragOverCapture", "variant" | keyof T | "mode"> | Exclude<"onDragStart", "variant" | keyof T | "mode"> | Exclude<"onDragStartCapture", "variant" | keyof T | "mode"> | Exclude<"onDrop", "variant" | keyof T | "mode"> | Exclude<"onDropCapture", "variant" | keyof T | "mode"> | Exclude<"onMouseDown", "variant" | keyof T | "mode"> | Exclude<"onMouseDownCapture", "variant" | keyof T | "mode"> | Exclude<"onMouseEnter", "variant" | keyof T | "mode"> | Exclude<"onMouseLeave", "variant" | keyof T | "mode"> | Exclude<"onMouseMove", "variant" | keyof T | "mode"> | Exclude<"onMouseMoveCapture", "variant" | keyof T | "mode"> | Exclude<"onMouseOut", "variant" | keyof T | "mode"> | Exclude<"onMouseOutCapture", "variant" | keyof T | "mode"> | Exclude<"onMouseOver", "variant" | keyof T | "mode"> | Exclude<"onMouseOverCapture", "variant" | keyof T | "mode"> | Exclude<"onMouseUp", "variant" | keyof T | "mode"> | Exclude<"onMouseUpCapture", "variant" | keyof T | "mode"> | Exclude<"onSelect", "variant" | keyof T | "mode"> | Exclude<"onSelectCapture", "variant" | keyof T | "mode"> | Exclude<"onTouchCancel", "variant" | keyof T | "mode"> | Exclude<"onTouchCancelCapture", "variant" | keyof T | "mode"> | Exclude<"onTouchEnd", "variant" | keyof T | "mode"> | Exclude<"onTouchEndCapture", "variant" | keyof T | "mode"> | Exclude<"onTouchMove", "variant" | keyof T | "mode"> | Exclude<"onTouchMoveCapture", "variant" | keyof T | "mode"> | Exclude<"onTouchStart", "variant" | keyof T | "mode"> | Exclude<"onTouchStartCapture", "variant" | keyof T | "mode"> | Exclude<"onPointerDown", "variant" | keyof T | "mode"> | Exclude<"onPointerDownCapture", "variant" | keyof T | "mode"> | Exclude<"onPointerMove", "variant" | keyof T | "mode"> | Exclude<"onPointerMoveCapture", "variant" | keyof T | "mode"> | Exclude<"onPointerUp", "variant" | keyof T | "mode"> | Exclude<"onPointerUpCapture", "variant" | keyof T | "mode"> | Exclude<"onPointerCancel", "variant" | keyof T | "mode"> | Exclude<"onPointerCancelCapture", "variant" | keyof T | "mode"> | Exclude<"onPointerEnter", "variant" | keyof T | "mode"> | Exclude<"onPointerEnterCapture", "variant" | keyof T | "mode"> | Exclude<"onPointerLeave", "variant" | keyof T | "mode"> | Exclude<"onPointerLeaveCapture", "variant" | keyof T | "mode"> | Exclude<"onPointerOver", "variant" | keyof T | "mode"> | Exclude<"onPointerOverCapture", "variant" | keyof T | "mode"> | Exclude<"onPointerOut", "variant" | keyof T | "mode"> | Exclude<"onPointerOutCapture", "variant" | keyof T | "mode"> | Exclude<"onGotPointerCapture", "variant" | keyof T | "mode"> | Exclude<"onGotPointerCaptureCapture", "variant" | keyof T | "mode"> | Exclude<"onLostPointerCapture", "variant" | keyof T | "mode"> | Exclude<"onLostPointerCaptureCapture", "variant" | keyof T | "mode"> | Exclude<"onScroll", "variant" | keyof T | "mode"> | Exclude<"onScrollCapture", "variant" | keyof T | "mode"> | Exclude<"onWheel", "variant" | keyof T | "mode"> | Exclude<"onWheelCapture", "variant" | keyof T | "mode"> | Exclude<"onAnimationStart", "variant" | keyof T | "mode"> | Exclude<"onAnimationStartCapture", "variant" | keyof T | "mode"> | Exclude<"onAnimationEnd", "variant" | keyof T | "mode"> | Exclude<"onAnimationEndCapture", "variant" | keyof T | "mode"> | Exclude<"onAnimationIteration", "variant" | keyof T | "mode"> | Exclude<"onAnimationIterationCapture", "variant" | keyof T | "mode"> | Exclude<"onTransitionEnd", "variant" | keyof T | "mode"> | Exclude<"onTransitionEndCapture", "variant" | keyof T | "mode"> | Exclude<"defaultChecked", "variant" | keyof T | "mode"> | Exclude<"defaultValue", "variant" | keyof T | "mode"> | Exclude<"suppressContentEditableWarning", "variant" | keyof T | "mode"> | Exclude<"suppressHydrationWarning", "variant" | keyof T | "mode"> | Exclude<"accessKey", "variant" | keyof T | "mode"> | Exclude<"contentEditable", "variant" | keyof T | "mode"> | Exclude<"contextMenu", "variant" | keyof T | "mode"> | Exclude<"dir", "variant" | keyof T | "mode"> | Exclude<"draggable", "variant" | keyof T | "mode"> | Exclude<"placeholder", "variant" | keyof T | "mode"> | Exclude<"spellCheck", "variant" | keyof T | "mode"> | Exclude<"radioGroup", "variant" | keyof T | "mode"> | Exclude<"about", "variant" | keyof T | "mode"> | Exclude<"datatype", "variant" | keyof T | "mode"> | Exclude<"inlist", "variant" | keyof T | "mode"> | Exclude<"resource", "variant" | keyof T | "mode"> | Exclude<"typeof", "variant" | keyof T | "mode"> | Exclude<"vocab", "variant" | keyof T | "mode"> | Exclude<"autoCapitalize", "variant" | keyof T | "mode"> | Exclude<"autoCorrect", "variant" | keyof T | "mode"> | Exclude<"autoSave", "variant" | keyof T | "mode"> | Exclude<"itemProp", "variant" | keyof T | "mode"> | Exclude<"itemScope", "variant" | keyof T | "mode"> | Exclude<"itemType", "variant" | keyof T | "mode"> | Exclude<"itemID", "variant" | keyof T | "mode"> | Exclude<"itemRef", "variant" | keyof T | "mode"> | Exclude<"results", "variant" | keyof T | "mode"> | Exclude<"security", "variant" | keyof T | "mode"> | Exclude<"unselectable", "variant" | keyof T | "mode"> | Exclude<"inputMode", "variant" | keyof T | "mode"> | Exclude<"is", "variant" | keyof T | "mode">;
|
|
21
|
+
};
|
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare
|
|
3
|
-
xs: number;
|
|
4
|
-
sm: number;
|
|
5
|
-
md: number;
|
|
6
|
-
lg: number;
|
|
7
|
-
xl: number;
|
|
8
|
-
};
|
|
9
|
-
export declare function createParser<Config extends Record<string, AbstractPropTransformer>>(config: Config): Parser<Config>;
|
|
1
|
+
import { Parser, Prop } from '../types/config';
|
|
2
|
+
export declare function createParser<Config extends Record<string, Prop>>(config: Config): Parser<Config>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Prop } from '../types/config';
|
|
2
|
+
import { CSSObject } from '../types/shared';
|
|
3
|
+
import { AbstractProps } from '../types/props';
|
|
4
|
+
export declare const createPropertyStyle: <Config extends Prop, Value>(value: Value, props: AbstractProps, config: Config) => CSSObject;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { AbstractParser } from '../types/config';
|
|
2
|
-
export declare const createStylist: (parser: AbstractParser, base?: Record<string, any>, variants?: Record<string, any>, states?: Record<string, any
|
|
2
|
+
export declare const createStylist: (parser: AbstractParser, base?: Record<string, any>, variants?: Record<string, any>, states?: Record<string, any>) => (props: any) => any;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Prop } from '../types/config';
|
|
2
|
+
import { MediaQueryCache, MediaQueryMap, ThemeProps } from '../types/props';
|
|
3
|
+
import { Breakpoints } from '../types/theme';
|
|
4
|
+
import { CSSObject } from '../types/shared';
|
|
5
|
+
export declare const createMediaQueries: (breakpoints?: Breakpoints | undefined) => MediaQueryCache | null;
|
|
6
|
+
export declare const isMediaArray: (val: unknown) => val is (string | number)[];
|
|
7
|
+
export declare const isMediaMap: (val: object) => val is MediaQueryMap<string | number>;
|
|
8
|
+
interface ResponsiveParser<Bp extends MediaQueryMap<string | number> | (string | number)[]> {
|
|
9
|
+
<C extends Prop>(value: Bp, props: ThemeProps, config: C, breakpoints: Bp): CSSObject;
|
|
10
|
+
}
|
|
11
|
+
export declare const objectParser: ResponsiveParser<MediaQueryMap<string | number>>;
|
|
12
|
+
export declare const arrayParser: ResponsiveParser<(string | number)[]>;
|
|
13
|
+
export declare const orderBreakpoints: (styles: CSSObject, breakpoints: string[]) => CSSObject;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const borderShorthand: (val: string | number) => string;
|
package/dist/types/config.d.ts
CHANGED
|
@@ -1,81 +1,50 @@
|
|
|
1
1
|
import { Theme } from '@emotion/react';
|
|
2
|
-
import {
|
|
3
|
-
import { DefaultCSSPropertyValue, PropertyTypes } from './properties';
|
|
4
|
-
import { AbstractProps,
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
length: 0;
|
|
9
|
-
};
|
|
2
|
+
import { CSSObject } from './shared';
|
|
3
|
+
import { DefaultCSSPropertyValue, PropertyTypes, CSSPropertyTypes } from './properties';
|
|
4
|
+
import { AbstractProps, ResponsiveProp, ThemeProps } from './props';
|
|
5
|
+
import { Arg } from './utils';
|
|
6
|
+
import { ArrayScale, MapScale } from './scales';
|
|
7
|
+
import { CompatTheme } from '../compatTheme';
|
|
10
8
|
export interface BaseProperty {
|
|
11
9
|
property: keyof PropertyTypes;
|
|
12
10
|
properties?: readonly (keyof PropertyTypes)[];
|
|
13
11
|
}
|
|
14
12
|
export interface Prop extends BaseProperty {
|
|
15
|
-
scale?: keyof Theme | keyof
|
|
13
|
+
scale?: keyof Theme | keyof CompatTheme | MapScale | ArrayScale;
|
|
14
|
+
variable?: string;
|
|
16
15
|
transform?: (val: string | number, prop?: string, props?: AbstractProps) => string | number | CSSObject;
|
|
17
16
|
}
|
|
18
|
-
export interface AbstractPropTransformer extends Prop {
|
|
19
|
-
prop: string;
|
|
20
|
-
styleFn: (value: unknown, prop: string, props: AbstractProps) => CSSObject;
|
|
21
|
-
}
|
|
22
17
|
export interface AbstractParser {
|
|
23
18
|
(props: AbstractProps, orderProps?: boolean): CSSObject;
|
|
24
19
|
propNames: string[];
|
|
25
|
-
config: Record<string,
|
|
20
|
+
config: Record<string, Prop>;
|
|
26
21
|
}
|
|
27
|
-
|
|
28
|
-
export declare type
|
|
22
|
+
declare type IsEmpty<T> = [] extends T ? true : false | {} extends T ? true : false;
|
|
23
|
+
export declare type PropertyValues<Property extends Prop, IncludeGlobals = false> = Exclude<PropertyTypes<IncludeGlobals extends true ? DefaultCSSPropertyValue : never>[Property['property']], IncludeGlobals extends true ? never : object | any[]>;
|
|
24
|
+
declare type CompatValue<Key extends keyof CompatTheme> = CompatTheme[Key] extends MapScale ? keyof CompatTheme[Key] : CompatTheme[Key] extends ArrayScale ? CompatTheme[Key][number] : never;
|
|
25
|
+
export declare type ScaleValue<Config extends Prop> = Config['scale'] extends keyof Theme ? keyof Theme[Config['scale']] | PropertyValues<Config, IsEmpty<Theme[Config['scale']]>> : Config['scale'] extends MapScale ? keyof Config['scale'] | PropertyValues<Config, IsEmpty<Config['scale']>> : Config['scale'] extends ArrayScale ? Config['scale'][number] | PropertyValues<Config, IsEmpty<Config['scale']>> : Config['scale'] extends keyof CompatTheme ? CompatValue<Config['scale']> | PropertyValues<Config, IsEmpty<CompatTheme[Config['scale']]>> : PropertyValues<Config, true>;
|
|
29
26
|
export declare type Scale<Config extends Prop> = ResponsiveProp<ScaleValue<Config> | ((theme: Theme) => ScaleValue<Config>)>;
|
|
30
|
-
export
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
export interface PropTransformer<P extends string, C extends Prop> extends AbstractPropTransformer, Prop {
|
|
36
|
-
prop: P;
|
|
37
|
-
styleFn: TransformFn<P, C>;
|
|
38
|
-
}
|
|
39
|
-
export declare type TransformerMap<Config extends Record<string, Prop>> = {
|
|
40
|
-
[P in Key<keyof Config>]: PropTransformer<Key<P>, Config[P]>;
|
|
41
|
-
};
|
|
42
|
-
export interface Parser<Config extends Record<string, AbstractPropTransformer>> {
|
|
27
|
+
export declare type ParserProps<Config extends Record<string, Prop>> = ThemeProps<{
|
|
28
|
+
[P in keyof Config]?: Scale<Config[P]>;
|
|
29
|
+
}>;
|
|
30
|
+
export interface Parser<Config extends Record<string, Prop>> {
|
|
43
31
|
(props: ParserProps<Config>, orderProps?: boolean): CSSObject;
|
|
44
|
-
propNames:
|
|
32
|
+
propNames: Extract<keyof Config, string>[];
|
|
45
33
|
config: Config;
|
|
46
34
|
}
|
|
47
|
-
export declare type
|
|
48
|
-
[K in
|
|
35
|
+
export declare type SystemProps<P extends AbstractParser, SafeProps = Omit<Arg<P>, 'theme'>> = {
|
|
36
|
+
[K in keyof SafeProps]: SafeProps[K];
|
|
49
37
|
};
|
|
50
|
-
export interface
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
export interface States<P extends AbstractParser> {
|
|
59
|
-
<Props extends Record<string, AbstractProps>>(states: CSSPropMap<Props, SystemProps<P>>): (props: Partial<Record<keyof Props, boolean>> & ThemeProps) => CSSObject;
|
|
60
|
-
}
|
|
61
|
-
export interface CSS<P extends AbstractParser> {
|
|
62
|
-
<Props extends AbstractProps>(config: CSSProps<Props, SystemProps<P>>): (props: ThemeProps) => CSSObject;
|
|
63
|
-
}
|
|
64
|
-
export declare type ParserProps<Config extends Record<string, AbstractPropTransformer>> = ThemeProps<{
|
|
65
|
-
[P in keyof Config]?: Parameters<Config[P]['styleFn']>[2][Config[P]['prop']];
|
|
66
|
-
}>;
|
|
67
|
-
export declare type SystemProps<P extends AbstractParser> = {
|
|
68
|
-
[K in keyof Omit<Parameters<P>[0], 'theme'>]: Omit<Parameters<P>[0], 'theme'>[K];
|
|
38
|
+
export interface VariantConfig {
|
|
39
|
+
prop?: any;
|
|
40
|
+
defaultVariant?: any;
|
|
41
|
+
base?: CSSProps<AbstractProps, SystemProps<AbstractParser>>;
|
|
42
|
+
variants: CSSPropMap<AbstractProps, SystemProps<AbstractParser>>;
|
|
43
|
+
}
|
|
44
|
+
export declare type CSSPropMap<Props, System> = {
|
|
45
|
+
[K in keyof Props]?: CSSProps<Props[K], System>;
|
|
69
46
|
};
|
|
70
|
-
export declare type
|
|
71
|
-
[
|
|
47
|
+
export declare type CSSProps<Props, System> = {
|
|
48
|
+
[K in keyof Props]?: K extends keyof System ? System[K] : K extends keyof CSSPropertyTypes ? CSSPropertyTypes[K] : Omit<CSSPropertyTypes, keyof System> & Omit<System, 'theme'>;
|
|
72
49
|
};
|
|
73
|
-
export
|
|
74
|
-
export interface PropConfig {
|
|
75
|
-
props: {
|
|
76
|
-
[i: string]: Prop;
|
|
77
|
-
};
|
|
78
|
-
groups: {
|
|
79
|
-
[i: string]: (string | symbol | number)[];
|
|
80
|
-
};
|
|
81
|
-
}
|
|
50
|
+
export {};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { Globals, StandardProperties, VendorProperties } from 'csstype';
|
|
2
|
-
import { CSSObject } from '
|
|
2
|
+
import { CSSObject, NarrowPrimitive } from './shared';
|
|
3
3
|
declare type ColorProperties = 'color' | `${string}Color`;
|
|
4
4
|
declare type ColorGlobals = {
|
|
5
|
-
[K in Extract<keyof StandardProperties, ColorProperties>]?: Globals | 'currentColor' | 'transparent' |
|
|
5
|
+
[K in Extract<keyof StandardProperties, ColorProperties>]?: Globals | 'currentColor' | 'transparent' | NarrowPrimitive<string>;
|
|
6
6
|
};
|
|
7
7
|
declare type SizeProperties = 'left' | 'right' | 'top' | 'bottom' | 'inset' | 'width' | 'height' | `${string}${'Width' | 'Height'}`;
|
|
8
|
+
declare type SizeValues = `${number}${'px' | 'rem' | 'vh' | 'vw' | 'vmax' | 'vmin' | '%'}` | `calc(${any})`;
|
|
8
9
|
declare type SizeGlobals = {
|
|
9
|
-
[K in Extract<keyof StandardProperties, SizeProperties>]?: StandardProperties[K] |
|
|
10
|
+
[K in Extract<keyof StandardProperties, SizeProperties>]?: StandardProperties[K] | SizeValues | NarrowPrimitive<number>;
|
|
10
11
|
};
|
|
11
12
|
/** This is a placeholder type for CSS properties that may not have any specific global values (outlineOffset).
|
|
12
13
|
* (string & {}) will allow strings but not generalize the union type to just a string if other string literals exist in the union.
|
package/dist/types/props.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { Theme } from '@emotion/react';
|
|
2
|
-
import { AbstractParser, Scale } from './config';
|
|
3
|
-
import { CSSPropertyTypes } from './properties';
|
|
4
2
|
export declare type AbstractProps = ThemeProps<Record<string, unknown>>;
|
|
5
3
|
interface MediaQueryByKey<T = string> {
|
|
6
4
|
xs: T;
|
|
@@ -33,15 +31,4 @@ export interface MediaQueryMap<T> {
|
|
|
33
31
|
xl?: T;
|
|
34
32
|
}
|
|
35
33
|
export declare type ResponsiveProp<T> = T | MediaQueryMap<T> | MediaQueryArray<T>;
|
|
36
|
-
export interface CSSObject {
|
|
37
|
-
[key: string]: string | number | CSSObject | undefined;
|
|
38
|
-
}
|
|
39
|
-
export declare type CSSPropMap<Props, System> = {
|
|
40
|
-
[K in keyof Props]?: CSSProps<Props[K], System>;
|
|
41
|
-
};
|
|
42
|
-
export declare type CSSProps<Props, System> = {
|
|
43
|
-
[K in keyof Props]?: K extends keyof System ? System[K] : K extends keyof CSSPropertyTypes ? CSSPropertyTypes[K] : Omit<CSSPropertyTypes, keyof System> & Omit<System, 'theme'>;
|
|
44
|
-
};
|
|
45
|
-
export declare type StyleProps<T extends (args: AbstractProps) => CSSObject> = Parameters<T>[0];
|
|
46
|
-
export declare type ScaleValue<P extends AbstractParser, Prop extends keyof P['config']> = Scale<P['config'][Prop]>;
|
|
47
34
|
export {};
|
package/dist/types/theme.d.ts
CHANGED
|
@@ -11,22 +11,6 @@ export interface BaseTheme {
|
|
|
11
11
|
export interface AbstractTheme extends BaseTheme {
|
|
12
12
|
readonly [key: string]: any;
|
|
13
13
|
}
|
|
14
|
-
export interface InteropTheme extends BaseTheme {
|
|
15
|
-
colors: {};
|
|
16
|
-
radii: {};
|
|
17
|
-
borders: {};
|
|
18
|
-
fontSize: {};
|
|
19
|
-
letterSpacing: {};
|
|
20
|
-
fontFamily: {};
|
|
21
|
-
fontWeight: {};
|
|
22
|
-
spacing: {};
|
|
23
|
-
lineHeight: {};
|
|
24
|
-
modes: {
|
|
25
|
-
dark: {};
|
|
26
|
-
light: {};
|
|
27
|
-
};
|
|
28
|
-
mode: 'dark' | 'light';
|
|
29
|
-
}
|
|
30
14
|
declare module '@emotion/react' {
|
|
31
15
|
interface Theme extends BaseTheme {
|
|
32
16
|
}
|
package/dist/types/utils.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export declare type Arg<T extends (...args: any) => any> = Parameters<T>[0];
|
|
1
2
|
export declare type AllUnionKeys<T> = T extends any ? keyof T : never;
|
|
2
3
|
export declare type KeyFromUnion<T, K> = T extends any ? K extends keyof T ? T[K] : never : never;
|
|
3
4
|
export declare type Key<T> = T extends string ? T : never;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@animus-ui/core",
|
|
3
|
-
"description": "Constraint based CSS in JS
|
|
4
|
-
"version": "0.1.1-
|
|
3
|
+
"description": "Constraint based CSS in JS Foundations",
|
|
4
|
+
"version": "0.1.1-e4cdacd2.0+e4cdacd",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"emotion",
|
|
7
7
|
"css",
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
],
|
|
11
11
|
"author": "codecaaron <airrobb@gmail.com>",
|
|
12
12
|
"license": "MIT",
|
|
13
|
-
"
|
|
14
|
-
"
|
|
13
|
+
"module": "./dist/index.js",
|
|
14
|
+
"main": "./dist/index.js",
|
|
15
15
|
"types": "dist/index.d.ts",
|
|
16
16
|
"publishConfig": {
|
|
17
17
|
"access": "public"
|
|
@@ -23,9 +23,11 @@
|
|
|
23
23
|
"scripts": {
|
|
24
24
|
"build:clean": "rm -rf ./dist",
|
|
25
25
|
"build": "yarn build:clean && rollup -c",
|
|
26
|
-
"lernaBuildTask": "yarn build"
|
|
26
|
+
"lernaBuildTask": "yarn build",
|
|
27
|
+
"compile": "tsc --noEmit"
|
|
27
28
|
},
|
|
28
29
|
"peerDependencies": {
|
|
30
|
+
"@emotion/is-prop-valid": "^1.1.1",
|
|
29
31
|
"@emotion/react": ">=11.0.0",
|
|
30
32
|
"@emotion/styled": ">=11.0.0",
|
|
31
33
|
"lodash": "*",
|
|
@@ -34,5 +36,5 @@
|
|
|
34
36
|
"dependencies": {
|
|
35
37
|
"csstype": "^3.0.7"
|
|
36
38
|
},
|
|
37
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "e4cdacd229ba2d35ac932de490ad4fab18fa7f11"
|
|
38
40
|
}
|
package/dist/animusBuilder.d.ts
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { Parser, Prop, SystemProps, TransformerMap } from './types/config';
|
|
3
|
-
import { AbstractProps, CSSPropMap, CSSProps, CSSObject, ThemeProps } from './types/props';
|
|
4
|
-
import { Arg, PropConfig } from './types/config';
|
|
5
|
-
export declare class AnimusWithAll<C extends PropConfig, P extends Parser<TransformerMap<C['props']>>, Base extends CSSProps<AbstractProps, SystemProps<P>>, Variants extends Record<string, {
|
|
6
|
-
prop?: any;
|
|
7
|
-
defaultVariant?: any;
|
|
8
|
-
base?: CSSProps<AbstractProps, SystemProps<P>>;
|
|
9
|
-
variants: CSSPropMap<AbstractProps, SystemProps<P>>;
|
|
10
|
-
}>, States extends CSSPropMap<AbstractProps, SystemProps<P>>, G extends (keyof C['groups'])[] | never[], CustomProps extends PropConfig['props']> {
|
|
11
|
-
props: C;
|
|
12
|
-
parser: P;
|
|
13
|
-
groups: G;
|
|
14
|
-
base: Base;
|
|
15
|
-
statesConfig: States;
|
|
16
|
-
variants: Variants;
|
|
17
|
-
custom: CustomProps;
|
|
18
|
-
constructor(props: C, parser: P, base: Base, variants: Variants, states: States, groups: G, custom: CustomProps);
|
|
19
|
-
asComponent<T extends keyof JSX.IntrinsicElements>(component: T): import("@emotion/styled").StyledComponent<{
|
|
20
|
-
theme?: import("@emotion/react").Theme | undefined;
|
|
21
|
-
as?: import("react").ElementType<any> | undefined;
|
|
22
|
-
} & { [K_4 in keyof ThemeProps<{ [K in keyof Arg<P> as K extends C["groups"][G[number]][number] ? K : never]?: Arg<P>[K] | undefined; } & { [K_1 in keyof Variants]?: keyof Variants[K_1]["variants"] | undefined; } & { [K_2 in keyof States]?: boolean | undefined; } & { [K_3 in keyof import("./types/config").ParserProps<TransformerMap<CustomProps>>]: import("./types/config").ParserProps<TransformerMap<CustomProps>>[K_3]; }>]: ThemeProps<{ [K in keyof Arg<P> as K extends C["groups"][G[number]][number] ? K : never]?: Arg<P>[K] | undefined; } & { [K_1 in keyof Variants]?: keyof Variants[K_1]["variants"] | undefined; } & { [K_2 in keyof States]?: boolean | undefined; } & { [K_3 in keyof import("./types/config").ParserProps<TransformerMap<CustomProps>>]: import("./types/config").ParserProps<TransformerMap<CustomProps>>[K_3]; }>[K_4]; }, JSX.IntrinsicElements[T], {}>;
|
|
23
|
-
build(): (props: { [K in keyof ThemeProps<{ [K_1 in keyof Arg<P> as K_1 extends C["groups"][G[number]][number] ? K_1 : never]?: Arg<P>[K_1] | undefined; } & { [K_2 in keyof Variants]?: keyof Variants[K_2]["variants"] | undefined; } & { [K_3 in keyof States]?: boolean | undefined; } & { [K_4 in keyof import("./types/config").ParserProps<TransformerMap<CustomProps>>]: import("./types/config").ParserProps<TransformerMap<CustomProps>>[K_4]; }>]: ThemeProps<{ [K_1 in keyof Arg<P> as K_1 extends C["groups"][G[number]][number] ? K_1 : never]?: Arg<P>[K_1] | undefined; } & { [K_2 in keyof Variants]?: keyof Variants[K_2]["variants"] | undefined; } & { [K_3 in keyof States]?: boolean | undefined; } & { [K_4 in keyof import("./types/config").ParserProps<TransformerMap<CustomProps>>]: import("./types/config").ParserProps<TransformerMap<CustomProps>>[K_4]; }>[K]; }) => CSSObject;
|
|
24
|
-
}
|
|
25
|
-
declare class AnimusWithSystem<C extends PropConfig, P extends Parser<TransformerMap<C['props']>>, Base extends CSSProps<AbstractProps, SystemProps<P>>, Variants extends Record<string, {
|
|
26
|
-
prop?: any;
|
|
27
|
-
defaultVariant?: any;
|
|
28
|
-
base?: CSSProps<AbstractProps, SystemProps<P>>;
|
|
29
|
-
variants: CSSPropMap<AbstractProps, SystemProps<P>>;
|
|
30
|
-
}>, States extends CSSPropMap<AbstractProps, SystemProps<P>>, G extends (keyof C['groups'])[] | never[]> extends AnimusWithAll<C, P, Base, Variants, States, G, {}> {
|
|
31
|
-
constructor(props: C, parser: P, base: Base, variants: Variants, states: States, groups: G);
|
|
32
|
-
customProps<CustomProps extends Record<string, Prop>>(config: CustomProps): AnimusWithAll<C, P, Base, Variants, States, G, CustomProps>;
|
|
33
|
-
}
|
|
34
|
-
declare class AnimusWithStates<C extends PropConfig, P extends Parser<TransformerMap<C['props']>>, Base extends CSSProps<AbstractProps, SystemProps<P>>, Variants extends Record<string, {
|
|
35
|
-
prop?: any;
|
|
36
|
-
defaultVariant?: any;
|
|
37
|
-
base?: CSSProps<AbstractProps, SystemProps<P>>;
|
|
38
|
-
variants: CSSPropMap<AbstractProps, SystemProps<P>>;
|
|
39
|
-
}>, States extends CSSPropMap<AbstractProps, SystemProps<P>>> extends AnimusWithSystem<C, P, Base, Variants, States, []> {
|
|
40
|
-
constructor(props: C, parser: P, base: Base, variants: Variants, states: States);
|
|
41
|
-
systemProps<PickedGroups extends keyof C['groups']>(config: Record<PickedGroups, true>): AnimusWithSystem<C, P, Base, Variants, States, PickedGroups[]>;
|
|
42
|
-
}
|
|
43
|
-
declare class AnimusWithVariants<C extends PropConfig, P extends Parser<TransformerMap<C['props']>>, Base extends CSSProps<AbstractProps, SystemProps<P>>, Variants extends Record<string, {
|
|
44
|
-
prop?: any;
|
|
45
|
-
defaultVariant?: any;
|
|
46
|
-
base?: CSSProps<AbstractProps, SystemProps<P>>;
|
|
47
|
-
variants: CSSPropMap<AbstractProps, SystemProps<P>>;
|
|
48
|
-
}>> extends AnimusWithStates<C, P, Base, Variants, {}> {
|
|
49
|
-
constructor(props: C, parser: P, base: Base, variants: Variants);
|
|
50
|
-
states<Props extends AbstractProps>(config: CSSPropMap<Props, SystemProps<P>>): AnimusWithStates<C, P, Base, Variants, CSSPropMap<Props, SystemProps<P>>>;
|
|
51
|
-
variant<Keys extends keyof Props, Base extends AbstractProps, Props extends Record<Keys, AbstractProps>, PropKey extends Readonly<string> = 'variant'>(options: {
|
|
52
|
-
prop?: PropKey;
|
|
53
|
-
defaultVariant?: keyof Props;
|
|
54
|
-
base?: CSSProps<Base, SystemProps<P>>;
|
|
55
|
-
variants: CSSPropMap<Props, SystemProps<P>>;
|
|
56
|
-
}): AnimusWithVariants<C, P, Base, Variants & Record<PropKey, {
|
|
57
|
-
prop?: PropKey | undefined;
|
|
58
|
-
defaultVariant?: keyof Props | undefined;
|
|
59
|
-
base?: CSSProps<Base, SystemProps<P>> | undefined;
|
|
60
|
-
variants: CSSPropMap<Props, SystemProps<P>>;
|
|
61
|
-
}>>;
|
|
62
|
-
}
|
|
63
|
-
declare class AnimusWithBase<C extends PropConfig, P extends Parser<TransformerMap<C['props']>>, Base extends CSSProps<AbstractProps, SystemProps<P>>> extends AnimusWithVariants<C, P, Base, {}> {
|
|
64
|
-
constructor(props: C, parser: P, base: Base);
|
|
65
|
-
variant<Keys extends keyof Props, Base extends AbstractProps, Props extends Record<Keys, AbstractProps>, PropKey extends Readonly<string> = 'variant'>(options: {
|
|
66
|
-
prop?: PropKey;
|
|
67
|
-
defaultVariant?: keyof Props;
|
|
68
|
-
base?: CSSProps<Base, SystemProps<P>>;
|
|
69
|
-
variants: CSSPropMap<Props, SystemProps<P>>;
|
|
70
|
-
}): AnimusWithVariants<C, P, Base, Record<PropKey, {
|
|
71
|
-
prop?: PropKey | undefined;
|
|
72
|
-
defaultVariant?: keyof Props | undefined;
|
|
73
|
-
base?: CSSProps<Base, SystemProps<P>> | undefined;
|
|
74
|
-
variants: CSSPropMap<Props, SystemProps<P>>;
|
|
75
|
-
}>>;
|
|
76
|
-
}
|
|
77
|
-
export declare class Animus<C extends PropConfig, P extends Parser<TransformerMap<C['props']>>> extends AnimusWithBase<C, P, {}> {
|
|
78
|
-
constructor(config: C);
|
|
79
|
-
styles<Props extends AbstractProps>(config: CSSProps<Props, SystemProps<P>>): AnimusWithBase<C, P, CSSProps<Props, SystemProps<P>>>;
|
|
80
|
-
}
|
|
81
|
-
export {};
|