@animus-ui/core 0.0.1-4da3a7b2.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/LICENSE +21 -0
- package/README.md +86 -0
- package/babel.config.js +5 -0
- package/dist/animusBuilder.d.ts +82 -0
- package/dist/configBuilder.d.ts +11 -0
- package/dist/createAnimus.d.ts +2 -0
- package/dist/deprecated/core.d.ts +10 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.d.ts +1597 -0
- package/dist/index.esm.js +1 -0
- package/dist/internal/compose.d.ts +2 -0
- package/dist/internal/create.d.ts +2 -0
- package/dist/internal/createCss.d.ts +2 -0
- package/dist/internal/createStates.d.ts +2 -0
- package/dist/internal/createVariant.d.ts +2 -0
- package/dist/props/baseConfig.d.ts +586 -0
- package/dist/props/baseScales.d.ts +51 -0
- package/dist/scales/createScale.d.ts +3 -0
- package/dist/scales/createScaleLookup.d.ts +5 -0
- package/dist/styles/createParser.d.ts +2 -0
- package/dist/styles/createStylist.d.ts +2 -0
- package/dist/styles/createTransform.d.ts +2 -0
- package/dist/transforms/grid.d.ts +4 -0
- package/dist/transforms/index.d.ts +2 -0
- package/dist/transforms/size.d.ts +2 -0
- package/dist/types/config.d.ts +81 -0
- package/dist/types/properties.d.ts +25 -0
- package/dist/types/props.d.ts +47 -0
- package/dist/types/theme.d.ts +33 -0
- package/dist/types/utils.d.ts +3 -0
- package/dist/utils/__fixtures__/testConfig.d.ts +153 -0
- package/dist/utils/getStaticProperties.d.ts +1 -0
- package/dist/utils/propNames.d.ts +6 -0
- package/dist/utils/responsive.d.ts +13 -0
- package/dist/utils/styledOptions.d.ts +21 -0
- package/package.json +38 -0
- package/rollup.config.js +3 -0
- package/tsconfig.json +8 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Prop } from '../types/config';
|
|
2
|
+
import { ThemeProps } from '../types/props';
|
|
3
|
+
declare type GetScaleValue = (val: string | number, props: ThemeProps) => string | number | undefined;
|
|
4
|
+
export declare const createScaleLookup: (scale: Prop['scale']) => GetScaleValue;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { Theme } from '@emotion/react';
|
|
2
|
+
import { InteropTheme } from './theme';
|
|
3
|
+
import { DefaultCSSPropertyValue, PropertyTypes } from './properties';
|
|
4
|
+
import { AbstractProps, CSSObject, CSSPropMap, CSSProps, ResponsiveProp, ThemeProps } from './props';
|
|
5
|
+
import { AllUnionKeys, Key, KeyFromUnion } from './utils';
|
|
6
|
+
export declare type MapScale = Record<string | number, string | number>;
|
|
7
|
+
export declare type ArrayScale = readonly (string | number | CSSObject)[] & {
|
|
8
|
+
length: 0;
|
|
9
|
+
};
|
|
10
|
+
export interface BaseProperty {
|
|
11
|
+
property: keyof PropertyTypes;
|
|
12
|
+
properties?: readonly (keyof PropertyTypes)[];
|
|
13
|
+
}
|
|
14
|
+
export interface Prop extends BaseProperty {
|
|
15
|
+
scale?: keyof Theme | keyof InteropTheme | MapScale | ArrayScale;
|
|
16
|
+
transform?: (val: string | number, prop?: string, props?: AbstractProps) => string | number | CSSObject;
|
|
17
|
+
}
|
|
18
|
+
export interface AbstractPropTransformer extends Prop {
|
|
19
|
+
prop: string;
|
|
20
|
+
styleFn: (value: unknown, prop: string, props: AbstractProps) => CSSObject;
|
|
21
|
+
}
|
|
22
|
+
export interface AbstractParser {
|
|
23
|
+
(props: AbstractProps, orderProps?: boolean): CSSObject;
|
|
24
|
+
propNames: string[];
|
|
25
|
+
config: Record<string, AbstractPropTransformer>;
|
|
26
|
+
}
|
|
27
|
+
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[]>;
|
|
28
|
+
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>;
|
|
29
|
+
export declare type Scale<Config extends Prop> = ResponsiveProp<ScaleValue<Config> | ((theme: Theme) => ScaleValue<Config>)>;
|
|
30
|
+
export interface TransformFn<P extends string, Config extends Prop> {
|
|
31
|
+
(value: Scale<Config> | Scale<Config>, prop: P, props: ThemeProps<{
|
|
32
|
+
[K in P]?: Scale<Config>;
|
|
33
|
+
}>): CSSObject;
|
|
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>> {
|
|
43
|
+
(props: ParserProps<Config>, orderProps?: boolean): CSSObject;
|
|
44
|
+
propNames: (keyof Config)[];
|
|
45
|
+
config: Config;
|
|
46
|
+
}
|
|
47
|
+
export declare type Compose<Args extends AbstractParser[]> = {
|
|
48
|
+
[K in AllUnionKeys<Args[number]['config']>]: KeyFromUnion<Args[number]['config'], K>;
|
|
49
|
+
};
|
|
50
|
+
export interface Variant<P extends AbstractParser> {
|
|
51
|
+
<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
|
+
}): (props: VariantProps<PropKey, Keys | false> & ThemeProps) => CSSObject;
|
|
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];
|
|
69
|
+
};
|
|
70
|
+
export declare type VariantProps<T extends string, V> = {
|
|
71
|
+
[Key in T]?: V;
|
|
72
|
+
};
|
|
73
|
+
export declare type Arg<T extends (...args: any) => any> = Parameters<T>[0];
|
|
74
|
+
export interface PropConfig {
|
|
75
|
+
props: {
|
|
76
|
+
[i: string]: Prop;
|
|
77
|
+
};
|
|
78
|
+
groups: {
|
|
79
|
+
[i: string]: (string | symbol | number)[];
|
|
80
|
+
};
|
|
81
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Globals, StandardProperties, VendorProperties } from 'csstype';
|
|
2
|
+
import { CSSObject } from '..';
|
|
3
|
+
declare type ColorProperties = 'color' | `${string}Color`;
|
|
4
|
+
declare type ColorGlobals = {
|
|
5
|
+
[K in Extract<keyof StandardProperties, ColorProperties>]?: Globals | 'currentColor' | 'transparent' | (string & {});
|
|
6
|
+
};
|
|
7
|
+
declare type SizeProperties = 'left' | 'right' | 'top' | 'bottom' | 'inset' | 'width' | 'height' | `${string}${'Width' | 'Height'}`;
|
|
8
|
+
declare type SizeGlobals = {
|
|
9
|
+
[K in Extract<keyof StandardProperties, SizeProperties>]?: StandardProperties[K] | (number & {});
|
|
10
|
+
};
|
|
11
|
+
/** This is a placeholder type for CSS properties that may not have any specific global values (outlineOffset).
|
|
12
|
+
* (string & {}) will allow strings but not generalize the union type to just a string if other string literals exist in the union.
|
|
13
|
+
*
|
|
14
|
+
* This ensures that autosuggestions will still work for literal types but still allow any string for certain properties.
|
|
15
|
+
*/
|
|
16
|
+
export declare type DefaultCSSPropertyValue = (string & {}) | 0;
|
|
17
|
+
export interface PropertyTypes<Overrides = DefaultCSSPropertyValue> extends Omit<StandardProperties<Overrides>, keyof ColorGlobals | keyof SizeGlobals>, ColorGlobals, SizeGlobals {
|
|
18
|
+
none?: never;
|
|
19
|
+
variables?: CSSObject;
|
|
20
|
+
}
|
|
21
|
+
export interface VendorPropertyTypes<Overrides = DefaultCSSPropertyValue> extends VendorProperties<Overrides> {
|
|
22
|
+
}
|
|
23
|
+
export interface CSSPropertyTypes<Overrides = DefaultCSSPropertyValue> extends PropertyTypes<Overrides>, VendorPropertyTypes<Overrides> {
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Theme } from '@emotion/react';
|
|
2
|
+
import { AbstractParser, Scale } from './config';
|
|
3
|
+
import { CSSPropertyTypes } from './properties';
|
|
4
|
+
export declare type AbstractProps = ThemeProps<Record<string, unknown>>;
|
|
5
|
+
interface MediaQueryByKey<T = string> {
|
|
6
|
+
xs: T;
|
|
7
|
+
sm: T;
|
|
8
|
+
md: T;
|
|
9
|
+
lg: T;
|
|
10
|
+
xl: T;
|
|
11
|
+
}
|
|
12
|
+
export interface MediaQueryCache {
|
|
13
|
+
map: MediaQueryByKey;
|
|
14
|
+
array: string[];
|
|
15
|
+
}
|
|
16
|
+
export declare type ThemeProps<Props = {}> = Props & {
|
|
17
|
+
theme?: Theme;
|
|
18
|
+
};
|
|
19
|
+
export interface MediaQueryArray<T> {
|
|
20
|
+
0?: T;
|
|
21
|
+
1?: T;
|
|
22
|
+
2?: T;
|
|
23
|
+
3?: T;
|
|
24
|
+
4?: T;
|
|
25
|
+
5?: T;
|
|
26
|
+
}
|
|
27
|
+
export interface MediaQueryMap<T> {
|
|
28
|
+
_?: T;
|
|
29
|
+
xs?: T;
|
|
30
|
+
sm?: T;
|
|
31
|
+
md?: T;
|
|
32
|
+
lg?: T;
|
|
33
|
+
xl?: T;
|
|
34
|
+
}
|
|
35
|
+
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
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export interface Breakpoints<T = number> {
|
|
2
|
+
xs: T;
|
|
3
|
+
sm: T;
|
|
4
|
+
md: T;
|
|
5
|
+
lg: T;
|
|
6
|
+
xl: T;
|
|
7
|
+
}
|
|
8
|
+
export interface BaseTheme {
|
|
9
|
+
breakpoints: Breakpoints;
|
|
10
|
+
}
|
|
11
|
+
export interface AbstractTheme extends BaseTheme {
|
|
12
|
+
readonly [key: string]: any;
|
|
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
|
+
declare module '@emotion/react' {
|
|
31
|
+
interface Theme extends BaseTheme {
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
export declare const testConfig: {
|
|
2
|
+
readonly textColor: {
|
|
3
|
+
readonly property: "color";
|
|
4
|
+
};
|
|
5
|
+
readonly bg: {
|
|
6
|
+
readonly property: "backgroundColor";
|
|
7
|
+
};
|
|
8
|
+
readonly borderColor: {
|
|
9
|
+
readonly property: "borderColor";
|
|
10
|
+
};
|
|
11
|
+
readonly borderColorX: {
|
|
12
|
+
readonly property: "borderColor";
|
|
13
|
+
readonly properties: readonly ["borderLeftColor", "borderRightColor"];
|
|
14
|
+
readonly scale: "colors";
|
|
15
|
+
};
|
|
16
|
+
readonly borderColorY: {
|
|
17
|
+
readonly property: "borderColor";
|
|
18
|
+
readonly properties: readonly ["borderTopColor", "borderBottomColor"];
|
|
19
|
+
readonly scale: "colors";
|
|
20
|
+
};
|
|
21
|
+
readonly borderColorLeft: {
|
|
22
|
+
readonly property: "borderLeftColor";
|
|
23
|
+
};
|
|
24
|
+
readonly borderColorRight: {
|
|
25
|
+
readonly property: "borderRightColor";
|
|
26
|
+
};
|
|
27
|
+
readonly borderColorTop: {
|
|
28
|
+
readonly property: "borderTopColor";
|
|
29
|
+
};
|
|
30
|
+
readonly borderColorBottom: {
|
|
31
|
+
readonly property: "borderBottomColor";
|
|
32
|
+
};
|
|
33
|
+
readonly border: {
|
|
34
|
+
readonly property: "border";
|
|
35
|
+
};
|
|
36
|
+
readonly borderX: {
|
|
37
|
+
readonly property: "border";
|
|
38
|
+
readonly properties: readonly ["borderLeft", "borderRight"];
|
|
39
|
+
};
|
|
40
|
+
readonly borderY: {
|
|
41
|
+
readonly property: "border";
|
|
42
|
+
readonly properties: readonly ["borderTop", "borderBottom"];
|
|
43
|
+
};
|
|
44
|
+
readonly borderTop: {
|
|
45
|
+
readonly property: "borderTop";
|
|
46
|
+
};
|
|
47
|
+
readonly borderRight: {
|
|
48
|
+
readonly property: "borderRight";
|
|
49
|
+
};
|
|
50
|
+
readonly borderBottom: {
|
|
51
|
+
readonly property: "borderBottom";
|
|
52
|
+
};
|
|
53
|
+
readonly borderLeft: {
|
|
54
|
+
readonly property: "borderLeft";
|
|
55
|
+
};
|
|
56
|
+
readonly borderWidth: {
|
|
57
|
+
readonly property: "borderWidth";
|
|
58
|
+
};
|
|
59
|
+
readonly borderWidthX: {
|
|
60
|
+
readonly property: "borderWidth";
|
|
61
|
+
readonly properties: readonly ["borderLeftWidth", "borderRightWidth"];
|
|
62
|
+
};
|
|
63
|
+
readonly borderWidthY: {
|
|
64
|
+
readonly property: "borderWidth";
|
|
65
|
+
readonly properties: readonly ["borderTopWidth", "borderBottomWidth"];
|
|
66
|
+
};
|
|
67
|
+
readonly borderRadius: {
|
|
68
|
+
readonly property: "borderRadius";
|
|
69
|
+
};
|
|
70
|
+
readonly borderRadiusLeft: {
|
|
71
|
+
readonly property: "borderRadius";
|
|
72
|
+
readonly properties: readonly ["borderTopLeftRadius", "borderBottomLeftRadius"];
|
|
73
|
+
};
|
|
74
|
+
readonly borderRadiusTop: {
|
|
75
|
+
readonly property: "borderRadius";
|
|
76
|
+
readonly properties: readonly ["borderTopLeftRadius", "borderTopRightRadius"];
|
|
77
|
+
};
|
|
78
|
+
readonly borderRadiusBottom: {
|
|
79
|
+
readonly property: "borderRadius";
|
|
80
|
+
readonly properties: readonly ["borderBottomLeftRadius", "borderBottomRightRadius"];
|
|
81
|
+
};
|
|
82
|
+
readonly borderRadiusRight: {
|
|
83
|
+
readonly property: "borderRadius";
|
|
84
|
+
readonly properties: readonly ["borderTopRightRadius", "borderBottomRightRadius"];
|
|
85
|
+
};
|
|
86
|
+
readonly borderStyle: {
|
|
87
|
+
readonly property: "borderStyle";
|
|
88
|
+
};
|
|
89
|
+
readonly borderStyleX: {
|
|
90
|
+
readonly property: "borderStyle";
|
|
91
|
+
readonly properties: readonly ["borderLeftStyle", "borderRightStyle"];
|
|
92
|
+
};
|
|
93
|
+
readonly borderStyleY: {
|
|
94
|
+
readonly property: "borderStyle";
|
|
95
|
+
readonly properties: readonly ["borderTopStyle", "borderBottomStyle"];
|
|
96
|
+
};
|
|
97
|
+
readonly flex: {
|
|
98
|
+
readonly property: "flex";
|
|
99
|
+
};
|
|
100
|
+
readonly flexBasis: {
|
|
101
|
+
readonly property: "flexBasis";
|
|
102
|
+
};
|
|
103
|
+
readonly p: {
|
|
104
|
+
readonly property: "padding";
|
|
105
|
+
};
|
|
106
|
+
readonly px: {
|
|
107
|
+
readonly property: "padding";
|
|
108
|
+
readonly properties: readonly ["paddingLeft", "paddingRight"];
|
|
109
|
+
readonly scale: "spacing";
|
|
110
|
+
};
|
|
111
|
+
readonly py: {
|
|
112
|
+
readonly property: "padding";
|
|
113
|
+
readonly properties: readonly ["paddingTop", "paddingBottom"];
|
|
114
|
+
readonly scale: "spacing";
|
|
115
|
+
};
|
|
116
|
+
readonly pt: {
|
|
117
|
+
readonly property: "paddingTop";
|
|
118
|
+
};
|
|
119
|
+
readonly pb: {
|
|
120
|
+
readonly property: "paddingBottom";
|
|
121
|
+
};
|
|
122
|
+
readonly pr: {
|
|
123
|
+
readonly property: "paddingRight";
|
|
124
|
+
};
|
|
125
|
+
readonly pl: {
|
|
126
|
+
readonly property: "paddingLeft";
|
|
127
|
+
};
|
|
128
|
+
readonly m: {
|
|
129
|
+
readonly property: "margin";
|
|
130
|
+
};
|
|
131
|
+
readonly mx: {
|
|
132
|
+
readonly property: "margin";
|
|
133
|
+
readonly properties: readonly ["marginLeft", "marginRight"];
|
|
134
|
+
readonly scale: "spacing";
|
|
135
|
+
};
|
|
136
|
+
readonly my: {
|
|
137
|
+
readonly property: "margin";
|
|
138
|
+
readonly properties: readonly ["marginTop", "marginBottom"];
|
|
139
|
+
readonly scale: "spacing";
|
|
140
|
+
};
|
|
141
|
+
readonly mt: {
|
|
142
|
+
readonly property: "marginTop";
|
|
143
|
+
};
|
|
144
|
+
readonly mb: {
|
|
145
|
+
readonly property: "marginBottom";
|
|
146
|
+
};
|
|
147
|
+
readonly mr: {
|
|
148
|
+
readonly property: "marginRight";
|
|
149
|
+
};
|
|
150
|
+
readonly ml: {
|
|
151
|
+
readonly property: "marginLeft";
|
|
152
|
+
};
|
|
153
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getStaticCss: (props: Record<string, any>, filteredKeys: string[]) => Pick<Record<string, any>, string>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AbstractPropTransformer } from '../types/config';
|
|
2
|
+
import { MediaQueryCache, CSSObject, MediaQueryMap, ThemeProps } from '../types/props';
|
|
3
|
+
import { Breakpoints } from '../types/theme';
|
|
4
|
+
export declare const createMediaQueries: (breakpoints?: Breakpoints | undefined) => MediaQueryCache | null;
|
|
5
|
+
export declare const isMediaArray: (val: unknown) => val is (string | number)[];
|
|
6
|
+
export declare const isMediaMap: (val: object) => val is MediaQueryMap<string | number>;
|
|
7
|
+
interface ResponsiveParser<Bp extends MediaQueryMap<string | number> | (string | number)[]> {
|
|
8
|
+
<C extends AbstractPropTransformer>(value: Bp, props: ThemeProps, config: C, breakpoints: Bp): CSSObject;
|
|
9
|
+
}
|
|
10
|
+
export declare const objectParser: ResponsiveParser<MediaQueryMap<string | number>>;
|
|
11
|
+
export declare const arrayParser: ResponsiveParser<(string | number)[]>;
|
|
12
|
+
export declare const orderBreakpoints: (styles: CSSObject, breakpoints: string[]) => CSSObject;
|
|
13
|
+
export {};
|
|
@@ -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, "mode" | "variant" | Filter | keyof T>;
|
|
19
|
+
}) & {
|
|
20
|
+
shouldForwardProp: (prop: PropertyKey) => prop is Exclude<"ref", "mode" | "variant" | keyof T> | Exclude<"key", "mode" | "variant" | keyof T> | Exclude<"color", "mode" | "variant" | keyof T> | Exclude<"translate", "mode" | "variant" | keyof T> | Exclude<"property", "mode" | "variant" | keyof T> | Exclude<"hidden", "mode" | "variant" | keyof T> | Exclude<"style", "mode" | "variant" | keyof T> | Exclude<"slot", "mode" | "variant" | keyof T> | Exclude<"title", "mode" | "variant" | keyof T> | Exclude<"className", "mode" | "variant" | keyof T> | Exclude<"id", "mode" | "variant" | keyof T> | Exclude<"prefix", "mode" | "variant" | keyof T> | Exclude<"children", "mode" | "variant" | keyof T> | Exclude<"lang", "mode" | "variant" | keyof T> | Exclude<"role", "mode" | "variant" | keyof T> | Exclude<"tabIndex", "mode" | "variant" | keyof T> | Exclude<"aria-activedescendant", "mode" | "variant" | keyof T> | Exclude<"aria-atomic", "mode" | "variant" | keyof T> | Exclude<"aria-autocomplete", "mode" | "variant" | keyof T> | Exclude<"aria-busy", "mode" | "variant" | keyof T> | Exclude<"aria-checked", "mode" | "variant" | keyof T> | Exclude<"aria-colcount", "mode" | "variant" | keyof T> | Exclude<"aria-colindex", "mode" | "variant" | keyof T> | Exclude<"aria-colspan", "mode" | "variant" | keyof T> | Exclude<"aria-controls", "mode" | "variant" | keyof T> | Exclude<"aria-current", "mode" | "variant" | keyof T> | Exclude<"aria-describedby", "mode" | "variant" | keyof T> | Exclude<"aria-details", "mode" | "variant" | keyof T> | Exclude<"aria-disabled", "mode" | "variant" | keyof T> | Exclude<"aria-dropeffect", "mode" | "variant" | keyof T> | Exclude<"aria-errormessage", "mode" | "variant" | keyof T> | Exclude<"aria-expanded", "mode" | "variant" | keyof T> | Exclude<"aria-flowto", "mode" | "variant" | keyof T> | Exclude<"aria-grabbed", "mode" | "variant" | keyof T> | Exclude<"aria-haspopup", "mode" | "variant" | keyof T> | Exclude<"aria-hidden", "mode" | "variant" | keyof T> | Exclude<"aria-invalid", "mode" | "variant" | keyof T> | Exclude<"aria-keyshortcuts", "mode" | "variant" | keyof T> | Exclude<"aria-label", "mode" | "variant" | keyof T> | Exclude<"aria-labelledby", "mode" | "variant" | keyof T> | Exclude<"aria-level", "mode" | "variant" | keyof T> | Exclude<"aria-live", "mode" | "variant" | keyof T> | Exclude<"aria-modal", "mode" | "variant" | keyof T> | Exclude<"aria-multiline", "mode" | "variant" | keyof T> | Exclude<"aria-multiselectable", "mode" | "variant" | keyof T> | Exclude<"aria-orientation", "mode" | "variant" | keyof T> | Exclude<"aria-owns", "mode" | "variant" | keyof T> | Exclude<"aria-placeholder", "mode" | "variant" | keyof T> | Exclude<"aria-posinset", "mode" | "variant" | keyof T> | Exclude<"aria-pressed", "mode" | "variant" | keyof T> | Exclude<"aria-readonly", "mode" | "variant" | keyof T> | Exclude<"aria-relevant", "mode" | "variant" | keyof T> | Exclude<"aria-required", "mode" | "variant" | keyof T> | Exclude<"aria-roledescription", "mode" | "variant" | keyof T> | Exclude<"aria-rowcount", "mode" | "variant" | keyof T> | Exclude<"aria-rowindex", "mode" | "variant" | keyof T> | Exclude<"aria-rowspan", "mode" | "variant" | keyof T> | Exclude<"aria-selected", "mode" | "variant" | keyof T> | Exclude<"aria-setsize", "mode" | "variant" | keyof T> | Exclude<"aria-sort", "mode" | "variant" | keyof T> | Exclude<"aria-valuemax", "mode" | "variant" | keyof T> | Exclude<"aria-valuemin", "mode" | "variant" | keyof T> | Exclude<"aria-valuenow", "mode" | "variant" | keyof T> | Exclude<"aria-valuetext", "mode" | "variant" | keyof T> | Exclude<"dangerouslySetInnerHTML", "mode" | "variant" | keyof T> | Exclude<"onCopy", "mode" | "variant" | keyof T> | Exclude<"onCopyCapture", "mode" | "variant" | keyof T> | Exclude<"onCut", "mode" | "variant" | keyof T> | Exclude<"onCutCapture", "mode" | "variant" | keyof T> | Exclude<"onPaste", "mode" | "variant" | keyof T> | Exclude<"onPasteCapture", "mode" | "variant" | keyof T> | Exclude<"onCompositionEnd", "mode" | "variant" | keyof T> | Exclude<"onCompositionEndCapture", "mode" | "variant" | keyof T> | Exclude<"onCompositionStart", "mode" | "variant" | keyof T> | Exclude<"onCompositionStartCapture", "mode" | "variant" | keyof T> | Exclude<"onCompositionUpdate", "mode" | "variant" | keyof T> | Exclude<"onCompositionUpdateCapture", "mode" | "variant" | keyof T> | Exclude<"onFocus", "mode" | "variant" | keyof T> | Exclude<"onFocusCapture", "mode" | "variant" | keyof T> | Exclude<"onBlur", "mode" | "variant" | keyof T> | Exclude<"onBlurCapture", "mode" | "variant" | keyof T> | Exclude<"onChange", "mode" | "variant" | keyof T> | Exclude<"onChangeCapture", "mode" | "variant" | keyof T> | Exclude<"onBeforeInput", "mode" | "variant" | keyof T> | Exclude<"onBeforeInputCapture", "mode" | "variant" | keyof T> | Exclude<"onInput", "mode" | "variant" | keyof T> | Exclude<"onInputCapture", "mode" | "variant" | keyof T> | Exclude<"onReset", "mode" | "variant" | keyof T> | Exclude<"onResetCapture", "mode" | "variant" | keyof T> | Exclude<"onSubmit", "mode" | "variant" | keyof T> | Exclude<"onSubmitCapture", "mode" | "variant" | keyof T> | Exclude<"onInvalid", "mode" | "variant" | keyof T> | Exclude<"onInvalidCapture", "mode" | "variant" | keyof T> | Exclude<"onLoad", "mode" | "variant" | keyof T> | Exclude<"onLoadCapture", "mode" | "variant" | keyof T> | Exclude<"onError", "mode" | "variant" | keyof T> | Exclude<"onErrorCapture", "mode" | "variant" | keyof T> | Exclude<"onKeyDown", "mode" | "variant" | keyof T> | Exclude<"onKeyDownCapture", "mode" | "variant" | keyof T> | Exclude<"onKeyPress", "mode" | "variant" | keyof T> | Exclude<"onKeyPressCapture", "mode" | "variant" | keyof T> | Exclude<"onKeyUp", "mode" | "variant" | keyof T> | Exclude<"onKeyUpCapture", "mode" | "variant" | keyof T> | Exclude<"onAbort", "mode" | "variant" | keyof T> | Exclude<"onAbortCapture", "mode" | "variant" | keyof T> | Exclude<"onCanPlay", "mode" | "variant" | keyof T> | Exclude<"onCanPlayCapture", "mode" | "variant" | keyof T> | Exclude<"onCanPlayThrough", "mode" | "variant" | keyof T> | Exclude<"onCanPlayThroughCapture", "mode" | "variant" | keyof T> | Exclude<"onDurationChange", "mode" | "variant" | keyof T> | Exclude<"onDurationChangeCapture", "mode" | "variant" | keyof T> | Exclude<"onEmptied", "mode" | "variant" | keyof T> | Exclude<"onEmptiedCapture", "mode" | "variant" | keyof T> | Exclude<"onEncrypted", "mode" | "variant" | keyof T> | Exclude<"onEncryptedCapture", "mode" | "variant" | keyof T> | Exclude<"onEnded", "mode" | "variant" | keyof T> | Exclude<"onEndedCapture", "mode" | "variant" | keyof T> | Exclude<"onLoadedData", "mode" | "variant" | keyof T> | Exclude<"onLoadedDataCapture", "mode" | "variant" | keyof T> | Exclude<"onLoadedMetadata", "mode" | "variant" | keyof T> | Exclude<"onLoadedMetadataCapture", "mode" | "variant" | keyof T> | Exclude<"onLoadStart", "mode" | "variant" | keyof T> | Exclude<"onLoadStartCapture", "mode" | "variant" | keyof T> | Exclude<"onPause", "mode" | "variant" | keyof T> | Exclude<"onPauseCapture", "mode" | "variant" | keyof T> | Exclude<"onPlay", "mode" | "variant" | keyof T> | Exclude<"onPlayCapture", "mode" | "variant" | keyof T> | Exclude<"onPlaying", "mode" | "variant" | keyof T> | Exclude<"onPlayingCapture", "mode" | "variant" | keyof T> | Exclude<"onProgress", "mode" | "variant" | keyof T> | Exclude<"onProgressCapture", "mode" | "variant" | keyof T> | Exclude<"onRateChange", "mode" | "variant" | keyof T> | Exclude<"onRateChangeCapture", "mode" | "variant" | keyof T> | Exclude<"onSeeked", "mode" | "variant" | keyof T> | Exclude<"onSeekedCapture", "mode" | "variant" | keyof T> | Exclude<"onSeeking", "mode" | "variant" | keyof T> | Exclude<"onSeekingCapture", "mode" | "variant" | keyof T> | Exclude<"onStalled", "mode" | "variant" | keyof T> | Exclude<"onStalledCapture", "mode" | "variant" | keyof T> | Exclude<"onSuspend", "mode" | "variant" | keyof T> | Exclude<"onSuspendCapture", "mode" | "variant" | keyof T> | Exclude<"onTimeUpdate", "mode" | "variant" | keyof T> | Exclude<"onTimeUpdateCapture", "mode" | "variant" | keyof T> | Exclude<"onVolumeChange", "mode" | "variant" | keyof T> | Exclude<"onVolumeChangeCapture", "mode" | "variant" | keyof T> | Exclude<"onWaiting", "mode" | "variant" | keyof T> | Exclude<"onWaitingCapture", "mode" | "variant" | keyof T> | Exclude<"onAuxClick", "mode" | "variant" | keyof T> | Exclude<"onAuxClickCapture", "mode" | "variant" | keyof T> | Exclude<"onClick", "mode" | "variant" | keyof T> | Exclude<"onClickCapture", "mode" | "variant" | keyof T> | Exclude<"onContextMenu", "mode" | "variant" | keyof T> | Exclude<"onContextMenuCapture", "mode" | "variant" | keyof T> | Exclude<"onDoubleClick", "mode" | "variant" | keyof T> | Exclude<"onDoubleClickCapture", "mode" | "variant" | keyof T> | Exclude<"onDrag", "mode" | "variant" | keyof T> | Exclude<"onDragCapture", "mode" | "variant" | keyof T> | Exclude<"onDragEnd", "mode" | "variant" | keyof T> | Exclude<"onDragEndCapture", "mode" | "variant" | keyof T> | Exclude<"onDragEnter", "mode" | "variant" | keyof T> | Exclude<"onDragEnterCapture", "mode" | "variant" | keyof T> | Exclude<"onDragExit", "mode" | "variant" | keyof T> | Exclude<"onDragExitCapture", "mode" | "variant" | keyof T> | Exclude<"onDragLeave", "mode" | "variant" | keyof T> | Exclude<"onDragLeaveCapture", "mode" | "variant" | keyof T> | Exclude<"onDragOver", "mode" | "variant" | keyof T> | Exclude<"onDragOverCapture", "mode" | "variant" | keyof T> | Exclude<"onDragStart", "mode" | "variant" | keyof T> | Exclude<"onDragStartCapture", "mode" | "variant" | keyof T> | Exclude<"onDrop", "mode" | "variant" | keyof T> | Exclude<"onDropCapture", "mode" | "variant" | keyof T> | Exclude<"onMouseDown", "mode" | "variant" | keyof T> | Exclude<"onMouseDownCapture", "mode" | "variant" | keyof T> | Exclude<"onMouseEnter", "mode" | "variant" | keyof T> | Exclude<"onMouseLeave", "mode" | "variant" | keyof T> | Exclude<"onMouseMove", "mode" | "variant" | keyof T> | Exclude<"onMouseMoveCapture", "mode" | "variant" | keyof T> | Exclude<"onMouseOut", "mode" | "variant" | keyof T> | Exclude<"onMouseOutCapture", "mode" | "variant" | keyof T> | Exclude<"onMouseOver", "mode" | "variant" | keyof T> | Exclude<"onMouseOverCapture", "mode" | "variant" | keyof T> | Exclude<"onMouseUp", "mode" | "variant" | keyof T> | Exclude<"onMouseUpCapture", "mode" | "variant" | keyof T> | Exclude<"onSelect", "mode" | "variant" | keyof T> | Exclude<"onSelectCapture", "mode" | "variant" | keyof T> | Exclude<"onTouchCancel", "mode" | "variant" | keyof T> | Exclude<"onTouchCancelCapture", "mode" | "variant" | keyof T> | Exclude<"onTouchEnd", "mode" | "variant" | keyof T> | Exclude<"onTouchEndCapture", "mode" | "variant" | keyof T> | Exclude<"onTouchMove", "mode" | "variant" | keyof T> | Exclude<"onTouchMoveCapture", "mode" | "variant" | keyof T> | Exclude<"onTouchStart", "mode" | "variant" | keyof T> | Exclude<"onTouchStartCapture", "mode" | "variant" | keyof T> | Exclude<"onPointerDown", "mode" | "variant" | keyof T> | Exclude<"onPointerDownCapture", "mode" | "variant" | keyof T> | Exclude<"onPointerMove", "mode" | "variant" | keyof T> | Exclude<"onPointerMoveCapture", "mode" | "variant" | keyof T> | Exclude<"onPointerUp", "mode" | "variant" | keyof T> | Exclude<"onPointerUpCapture", "mode" | "variant" | keyof T> | Exclude<"onPointerCancel", "mode" | "variant" | keyof T> | Exclude<"onPointerCancelCapture", "mode" | "variant" | keyof T> | Exclude<"onPointerEnter", "mode" | "variant" | keyof T> | Exclude<"onPointerEnterCapture", "mode" | "variant" | keyof T> | Exclude<"onPointerLeave", "mode" | "variant" | keyof T> | Exclude<"onPointerLeaveCapture", "mode" | "variant" | keyof T> | Exclude<"onPointerOver", "mode" | "variant" | keyof T> | Exclude<"onPointerOverCapture", "mode" | "variant" | keyof T> | Exclude<"onPointerOut", "mode" | "variant" | keyof T> | Exclude<"onPointerOutCapture", "mode" | "variant" | keyof T> | Exclude<"onGotPointerCapture", "mode" | "variant" | keyof T> | Exclude<"onGotPointerCaptureCapture", "mode" | "variant" | keyof T> | Exclude<"onLostPointerCapture", "mode" | "variant" | keyof T> | Exclude<"onLostPointerCaptureCapture", "mode" | "variant" | keyof T> | Exclude<"onScroll", "mode" | "variant" | keyof T> | Exclude<"onScrollCapture", "mode" | "variant" | keyof T> | Exclude<"onWheel", "mode" | "variant" | keyof T> | Exclude<"onWheelCapture", "mode" | "variant" | keyof T> | Exclude<"onAnimationStart", "mode" | "variant" | keyof T> | Exclude<"onAnimationStartCapture", "mode" | "variant" | keyof T> | Exclude<"onAnimationEnd", "mode" | "variant" | keyof T> | Exclude<"onAnimationEndCapture", "mode" | "variant" | keyof T> | Exclude<"onAnimationIteration", "mode" | "variant" | keyof T> | Exclude<"onAnimationIterationCapture", "mode" | "variant" | keyof T> | Exclude<"onTransitionEnd", "mode" | "variant" | keyof T> | Exclude<"onTransitionEndCapture", "mode" | "variant" | keyof T> | Exclude<"defaultChecked", "mode" | "variant" | keyof T> | Exclude<"defaultValue", "mode" | "variant" | keyof T> | Exclude<"suppressContentEditableWarning", "mode" | "variant" | keyof T> | Exclude<"suppressHydrationWarning", "mode" | "variant" | keyof T> | Exclude<"accessKey", "mode" | "variant" | keyof T> | Exclude<"contentEditable", "mode" | "variant" | keyof T> | Exclude<"contextMenu", "mode" | "variant" | keyof T> | Exclude<"dir", "mode" | "variant" | keyof T> | Exclude<"draggable", "mode" | "variant" | keyof T> | Exclude<"placeholder", "mode" | "variant" | keyof T> | Exclude<"spellCheck", "mode" | "variant" | keyof T> | Exclude<"radioGroup", "mode" | "variant" | keyof T> | Exclude<"about", "mode" | "variant" | keyof T> | Exclude<"datatype", "mode" | "variant" | keyof T> | Exclude<"inlist", "mode" | "variant" | keyof T> | Exclude<"resource", "mode" | "variant" | keyof T> | Exclude<"typeof", "mode" | "variant" | keyof T> | Exclude<"vocab", "mode" | "variant" | keyof T> | Exclude<"autoCapitalize", "mode" | "variant" | keyof T> | Exclude<"autoCorrect", "mode" | "variant" | keyof T> | Exclude<"autoSave", "mode" | "variant" | keyof T> | Exclude<"itemProp", "mode" | "variant" | keyof T> | Exclude<"itemScope", "mode" | "variant" | keyof T> | Exclude<"itemType", "mode" | "variant" | keyof T> | Exclude<"itemID", "mode" | "variant" | keyof T> | Exclude<"itemRef", "mode" | "variant" | keyof T> | Exclude<"results", "mode" | "variant" | keyof T> | Exclude<"security", "mode" | "variant" | keyof T> | Exclude<"unselectable", "mode" | "variant" | keyof T> | Exclude<"inputMode", "mode" | "variant" | keyof T> | Exclude<"is", "mode" | "variant" | keyof T>;
|
|
21
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@animus-ui/core",
|
|
3
|
+
"description": "Constraint based CSS in JS for building scalable design systems",
|
|
4
|
+
"version": "0.0.1-4da3a7b2.0+4da3a7b",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"emotion",
|
|
7
|
+
"css",
|
|
8
|
+
"styles",
|
|
9
|
+
"css-in-js"
|
|
10
|
+
],
|
|
11
|
+
"author": "codecaaron <airrobb@gmail.com>",
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"main": "dist/index.cjs.js",
|
|
14
|
+
"module": "dist/index.esm.js",
|
|
15
|
+
"types": "dist/index.d.ts",
|
|
16
|
+
"publishConfig": {
|
|
17
|
+
"access": "public"
|
|
18
|
+
},
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://github.com/Codecademy/client-modules.git"
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"build:clean": "rm -rf ./dist",
|
|
25
|
+
"build": "yarn build:clean && rollup -c",
|
|
26
|
+
"lernaBuildTask": "yarn build"
|
|
27
|
+
},
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"@emotion/react": ">=11.0.0",
|
|
30
|
+
"@emotion/styled": ">=11.0.0",
|
|
31
|
+
"lodash": "*",
|
|
32
|
+
"typescript": ">=4.3.5"
|
|
33
|
+
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"csstype": "^3.0.7"
|
|
36
|
+
},
|
|
37
|
+
"gitHead": "4da3a7b25056040db3a407145e38f1e8eed868b4"
|
|
38
|
+
}
|
package/rollup.config.js
ADDED