@animus-ui/core 0.1.1-beta.9 → 0.1.1-c5e4903f.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 +104 -0
- package/dist/Animus.d.ts +18 -5
- package/dist/AnimusConfig.d.ts +1 -1
- package/dist/AnimusExtended.d.ts +48 -0
- package/dist/compatTheme.d.ts +22 -14
- package/dist/config.d.ts +273 -145
- package/dist/index.d.ts +135 -70
- package/dist/index.js +2245 -0
- package/dist/legacy/config.d.ts +13 -12
- package/dist/legacy/core.d.ts +3 -3
- package/dist/legacy/createParser.d.ts +0 -7
- package/dist/legacy/responsive.d.ts +2 -2
- package/dist/properties/styledOptions.d.ts +3 -4
- package/dist/scales/createScale.d.ts +3 -0
- package/dist/styles/createParser.d.ts +1 -8
- package/dist/styles/createPropertyStyle.d.ts +2 -1
- package/dist/styles/responsive.d.ts +1 -1
- package/dist/types/config.d.ts +17 -11
- package/dist/types/properties.d.ts +11 -14
- package/dist/types/props.d.ts +3 -12
- package/dist/types/scales.d.ts +2 -2
- package/dist/types/shared.d.ts +1 -1
- package/dist/types/utils.d.ts +4 -4
- package/package.json +8 -8
- package/rollup.config.js +2 -2
- package/tsconfig.json +4 -2
- package/dist/index.cjs.js +0 -1
- package/dist/index.esm.js +0 -1
package/dist/legacy/config.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { Theme } from '@emotion/react';
|
|
2
|
+
import { CSSPropMap, CSSProps } from '../types/config';
|
|
2
3
|
import { DefaultCSSPropertyValue, PropertyTypes } from '../types/properties';
|
|
4
|
+
import { AbstractProps, ResponsiveProp, ThemeProps } from '../types/props';
|
|
3
5
|
import { CSSObject } from '../types/shared';
|
|
4
|
-
import { AbstractProps, CSSPropMap, CSSProps, ResponsiveProp, ThemeProps } from '../types/props';
|
|
5
6
|
import { AllUnionKeys, Key, KeyFromUnion } from '../types/utils';
|
|
6
|
-
export
|
|
7
|
-
export
|
|
7
|
+
export type MapScale = Record<string | number, string | number>;
|
|
8
|
+
export type ArrayScale = readonly (string | number | CSSObject)[] & {
|
|
8
9
|
length: 0;
|
|
9
10
|
};
|
|
10
11
|
export interface BaseProperty {
|
|
@@ -25,12 +26,12 @@ export interface AbstractParser {
|
|
|
25
26
|
propNames: string[];
|
|
26
27
|
config: Record<string, AbstractPropTransformer>;
|
|
27
28
|
}
|
|
28
|
-
export
|
|
29
|
-
export
|
|
29
|
+
export 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 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>;
|
|
30
31
|
/**
|
|
31
32
|
* Value or something
|
|
32
33
|
*/
|
|
33
|
-
export
|
|
34
|
+
export type Scale<Config extends Prop> = ResponsiveProp<ScaleValue<Config> | ((theme: Theme) => ScaleValue<Config>)>;
|
|
34
35
|
export interface TransformFn<P extends string, Config extends Prop> {
|
|
35
36
|
(value: Scale<Config> | Scale<Config>, prop: P, props: ThemeProps<{
|
|
36
37
|
[K in P]?: Scale<Config>;
|
|
@@ -40,7 +41,7 @@ export interface PropTransformer<P extends string, C extends Prop> extends Abstr
|
|
|
40
41
|
prop: P;
|
|
41
42
|
styleFn: TransformFn<P, C>;
|
|
42
43
|
}
|
|
43
|
-
export
|
|
44
|
+
export type TransformerMap<Config extends Record<string, Prop>> = {
|
|
44
45
|
[P in Key<keyof Config>]: PropTransformer<Key<P>, Config[P]>;
|
|
45
46
|
};
|
|
46
47
|
export interface Parser<Config extends Record<string, AbstractPropTransformer>> {
|
|
@@ -48,7 +49,7 @@ export interface Parser<Config extends Record<string, AbstractPropTransformer>>
|
|
|
48
49
|
propNames: (keyof Config)[];
|
|
49
50
|
config: Config;
|
|
50
51
|
}
|
|
51
|
-
export
|
|
52
|
+
export type Compose<Args extends AbstractParser[]> = {
|
|
52
53
|
[K in AllUnionKeys<Args[number]['config']>]: KeyFromUnion<Args[number]['config'], K>;
|
|
53
54
|
};
|
|
54
55
|
export interface Variant<P extends AbstractParser> {
|
|
@@ -65,16 +66,16 @@ export interface States<P extends AbstractParser> {
|
|
|
65
66
|
export interface CSS<P extends AbstractParser> {
|
|
66
67
|
<Props extends AbstractProps>(config: CSSProps<Props, SystemProps<P>>): (props: ThemeProps) => CSSObject;
|
|
67
68
|
}
|
|
68
|
-
export
|
|
69
|
+
export type ParserProps<Config extends Record<string, AbstractPropTransformer>> = ThemeProps<{
|
|
69
70
|
[P in keyof Config]?: Parameters<Config[P]['styleFn']>[2][Config[P]['prop']];
|
|
70
71
|
}>;
|
|
71
|
-
export
|
|
72
|
+
export type SystemProps<P extends AbstractParser> = {
|
|
72
73
|
[K in keyof Omit<Parameters<P>[0], 'theme'>]: Omit<Parameters<P>[0], 'theme'>[K];
|
|
73
74
|
};
|
|
74
|
-
export
|
|
75
|
+
export type VariantProps<T extends string, V> = {
|
|
75
76
|
[Key in T]?: V;
|
|
76
77
|
};
|
|
77
|
-
export
|
|
78
|
+
export type Arg<T extends (...args: any) => any> = Parameters<T>[0];
|
|
78
79
|
export interface PropConfig {
|
|
79
80
|
props: {
|
|
80
81
|
[i: string]: Prop;
|
package/dist/legacy/core.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { createCss } from './createCss';
|
|
2
|
-
import { createVariant } from './createVariant';
|
|
3
|
-
import { create } from './create';
|
|
4
1
|
import { compose } from './compose';
|
|
2
|
+
import { create } from './create';
|
|
3
|
+
import { createCss } from './createCss';
|
|
5
4
|
import { createStates } from './createStates';
|
|
5
|
+
import { createVariant } from './createVariant';
|
|
6
6
|
export declare const animusProps: {
|
|
7
7
|
compose: typeof compose;
|
|
8
8
|
create: typeof create;
|
|
@@ -1,9 +1,2 @@
|
|
|
1
1
|
import { AbstractPropTransformer, Parser } from './config';
|
|
2
|
-
export declare const defaultBreakpoints: {
|
|
3
|
-
xs: number;
|
|
4
|
-
sm: number;
|
|
5
|
-
md: number;
|
|
6
|
-
lg: number;
|
|
7
|
-
xl: number;
|
|
8
|
-
};
|
|
9
2
|
export declare function createParser<Config extends Record<string, AbstractPropTransformer>>(config: Config): Parser<Config>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { AbstractPropTransformer } from './config';
|
|
2
|
-
import { CSSObject } from '../types/shared';
|
|
3
1
|
import { MediaQueryCache, MediaQueryMap, ThemeProps } from '../types/props';
|
|
2
|
+
import { CSSObject } from '../types/shared';
|
|
4
3
|
import { Breakpoints } from '../types/theme';
|
|
4
|
+
import { AbstractPropTransformer } from './config';
|
|
5
5
|
export declare const createMediaQueries: (breakpoints?: Breakpoints | undefined) => MediaQueryCache | null;
|
|
6
6
|
export declare const isMediaArray: (val: unknown) => val is (string | number)[];
|
|
7
7
|
export declare const isMediaMap: (val: object) => val is MediaQueryMap<string | number>;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
/**
|
|
3
2
|
* Emotion will not attempt to forward all system props - so this pre filters all possible exceptions to search agains
|
|
4
3
|
* props like `color` and `width`.
|
|
5
4
|
*/
|
|
6
|
-
export
|
|
5
|
+
export type ForwardableProps<El extends keyof JSX.IntrinsicElements, Reserved> = Exclude<El extends keyof JSX.IntrinsicElements ? keyof JSX.IntrinsicElements[El] : keyof Element, Reserved>;
|
|
7
6
|
/**
|
|
8
7
|
* @description
|
|
9
8
|
* This object can be passed to the second argument of `styled('div', styledOptions)` or be called as a function to filter additional prop names
|
|
@@ -15,7 +14,7 @@ export declare const createStyledOptions: <T extends Record<string, any>>(props:
|
|
|
15
14
|
forward?: readonly Forward[] | undefined;
|
|
16
15
|
filter?: readonly Filter[] | undefined;
|
|
17
16
|
} | undefined) => {
|
|
18
|
-
shouldForwardProp: (prop: PropertyKey) => prop is Forward | Exclude<El extends keyof JSX.IntrinsicElements ? keyof JSX.IntrinsicElements[El] : keyof Element,
|
|
17
|
+
shouldForwardProp: (prop: PropertyKey) => prop is Forward | Exclude<El extends keyof JSX.IntrinsicElements ? keyof JSX.IntrinsicElements[El] : keyof Element, Filter | keyof T | "variant" | "mode">;
|
|
19
18
|
}) & {
|
|
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>;
|
|
19
|
+
shouldForwardProp: (prop: PropertyKey) => prop is Exclude<"ref", keyof T | "variant" | "mode"> | Exclude<"key", keyof T | "variant" | "mode"> | Exclude<"slot", keyof T | "variant" | "mode"> | Exclude<"style", keyof T | "variant" | "mode"> | Exclude<"title", keyof T | "variant" | "mode"> | Exclude<"className", keyof T | "variant" | "mode"> | Exclude<"id", keyof T | "variant" | "mode"> | Exclude<"prefix", keyof T | "variant" | "mode"> | Exclude<"role", keyof T | "variant" | "mode"> | Exclude<"children", keyof T | "variant" | "mode"> | Exclude<"color", keyof T | "variant" | "mode"> | Exclude<"lang", keyof T | "variant" | "mode"> | Exclude<"tabIndex", keyof T | "variant" | "mode"> | Exclude<"aria-activedescendant", keyof T | "variant" | "mode"> | Exclude<"aria-atomic", keyof T | "variant" | "mode"> | Exclude<"aria-autocomplete", keyof T | "variant" | "mode"> | Exclude<"aria-busy", keyof T | "variant" | "mode"> | Exclude<"aria-checked", keyof T | "variant" | "mode"> | Exclude<"aria-colcount", keyof T | "variant" | "mode"> | Exclude<"aria-colindex", keyof T | "variant" | "mode"> | Exclude<"aria-colspan", keyof T | "variant" | "mode"> | Exclude<"aria-controls", keyof T | "variant" | "mode"> | Exclude<"aria-current", keyof T | "variant" | "mode"> | Exclude<"aria-describedby", keyof T | "variant" | "mode"> | Exclude<"aria-details", keyof T | "variant" | "mode"> | Exclude<"aria-disabled", keyof T | "variant" | "mode"> | Exclude<"aria-dropeffect", keyof T | "variant" | "mode"> | Exclude<"aria-errormessage", keyof T | "variant" | "mode"> | Exclude<"aria-expanded", keyof T | "variant" | "mode"> | Exclude<"aria-flowto", keyof T | "variant" | "mode"> | Exclude<"aria-grabbed", keyof T | "variant" | "mode"> | Exclude<"aria-haspopup", keyof T | "variant" | "mode"> | Exclude<"aria-hidden", keyof T | "variant" | "mode"> | Exclude<"aria-invalid", keyof T | "variant" | "mode"> | Exclude<"aria-keyshortcuts", keyof T | "variant" | "mode"> | Exclude<"aria-label", keyof T | "variant" | "mode"> | Exclude<"aria-labelledby", keyof T | "variant" | "mode"> | Exclude<"aria-level", keyof T | "variant" | "mode"> | Exclude<"aria-live", keyof T | "variant" | "mode"> | Exclude<"aria-modal", keyof T | "variant" | "mode"> | Exclude<"aria-multiline", keyof T | "variant" | "mode"> | Exclude<"aria-multiselectable", keyof T | "variant" | "mode"> | Exclude<"aria-orientation", keyof T | "variant" | "mode"> | Exclude<"aria-owns", keyof T | "variant" | "mode"> | Exclude<"aria-placeholder", keyof T | "variant" | "mode"> | Exclude<"aria-posinset", keyof T | "variant" | "mode"> | Exclude<"aria-pressed", keyof T | "variant" | "mode"> | Exclude<"aria-readonly", keyof T | "variant" | "mode"> | Exclude<"aria-relevant", keyof T | "variant" | "mode"> | Exclude<"aria-required", keyof T | "variant" | "mode"> | Exclude<"aria-roledescription", keyof T | "variant" | "mode"> | Exclude<"aria-rowcount", keyof T | "variant" | "mode"> | Exclude<"aria-rowindex", keyof T | "variant" | "mode"> | Exclude<"aria-rowspan", keyof T | "variant" | "mode"> | Exclude<"aria-selected", keyof T | "variant" | "mode"> | Exclude<"aria-setsize", keyof T | "variant" | "mode"> | Exclude<"aria-sort", keyof T | "variant" | "mode"> | Exclude<"aria-valuemax", keyof T | "variant" | "mode"> | Exclude<"aria-valuemin", keyof T | "variant" | "mode"> | Exclude<"aria-valuenow", keyof T | "variant" | "mode"> | Exclude<"aria-valuetext", keyof T | "variant" | "mode"> | Exclude<"dangerouslySetInnerHTML", keyof T | "variant" | "mode"> | Exclude<"onCopy", keyof T | "variant" | "mode"> | Exclude<"onCopyCapture", keyof T | "variant" | "mode"> | Exclude<"onCut", keyof T | "variant" | "mode"> | Exclude<"onCutCapture", keyof T | "variant" | "mode"> | Exclude<"onPaste", keyof T | "variant" | "mode"> | Exclude<"onPasteCapture", keyof T | "variant" | "mode"> | Exclude<"onCompositionEnd", keyof T | "variant" | "mode"> | Exclude<"onCompositionEndCapture", keyof T | "variant" | "mode"> | Exclude<"onCompositionStart", keyof T | "variant" | "mode"> | Exclude<"onCompositionStartCapture", keyof T | "variant" | "mode"> | Exclude<"onCompositionUpdate", keyof T | "variant" | "mode"> | Exclude<"onCompositionUpdateCapture", keyof T | "variant" | "mode"> | Exclude<"onFocus", keyof T | "variant" | "mode"> | Exclude<"onFocusCapture", keyof T | "variant" | "mode"> | Exclude<"onBlur", keyof T | "variant" | "mode"> | Exclude<"onBlurCapture", keyof T | "variant" | "mode"> | Exclude<"onChange", keyof T | "variant" | "mode"> | Exclude<"onChangeCapture", keyof T | "variant" | "mode"> | Exclude<"onBeforeInput", keyof T | "variant" | "mode"> | Exclude<"onBeforeInputCapture", keyof T | "variant" | "mode"> | Exclude<"onInput", keyof T | "variant" | "mode"> | Exclude<"onInputCapture", keyof T | "variant" | "mode"> | Exclude<"onReset", keyof T | "variant" | "mode"> | Exclude<"onResetCapture", keyof T | "variant" | "mode"> | Exclude<"onSubmit", keyof T | "variant" | "mode"> | Exclude<"onSubmitCapture", keyof T | "variant" | "mode"> | Exclude<"onInvalid", keyof T | "variant" | "mode"> | Exclude<"onInvalidCapture", keyof T | "variant" | "mode"> | Exclude<"onLoad", keyof T | "variant" | "mode"> | Exclude<"onLoadCapture", keyof T | "variant" | "mode"> | Exclude<"onError", keyof T | "variant" | "mode"> | Exclude<"onErrorCapture", keyof T | "variant" | "mode"> | Exclude<"onKeyDown", keyof T | "variant" | "mode"> | Exclude<"onKeyDownCapture", keyof T | "variant" | "mode"> | Exclude<"onKeyPress", keyof T | "variant" | "mode"> | Exclude<"onKeyPressCapture", keyof T | "variant" | "mode"> | Exclude<"onKeyUp", keyof T | "variant" | "mode"> | Exclude<"onKeyUpCapture", keyof T | "variant" | "mode"> | Exclude<"onAbort", keyof T | "variant" | "mode"> | Exclude<"onAbortCapture", keyof T | "variant" | "mode"> | Exclude<"onCanPlay", keyof T | "variant" | "mode"> | Exclude<"onCanPlayCapture", keyof T | "variant" | "mode"> | Exclude<"onCanPlayThrough", keyof T | "variant" | "mode"> | Exclude<"onCanPlayThroughCapture", keyof T | "variant" | "mode"> | Exclude<"onDurationChange", keyof T | "variant" | "mode"> | Exclude<"onDurationChangeCapture", keyof T | "variant" | "mode"> | Exclude<"onEmptied", keyof T | "variant" | "mode"> | Exclude<"onEmptiedCapture", keyof T | "variant" | "mode"> | Exclude<"onEncrypted", keyof T | "variant" | "mode"> | Exclude<"onEncryptedCapture", keyof T | "variant" | "mode"> | Exclude<"onEnded", keyof T | "variant" | "mode"> | Exclude<"onEndedCapture", keyof T | "variant" | "mode"> | Exclude<"onLoadedData", keyof T | "variant" | "mode"> | Exclude<"onLoadedDataCapture", keyof T | "variant" | "mode"> | Exclude<"onLoadedMetadata", keyof T | "variant" | "mode"> | Exclude<"onLoadedMetadataCapture", keyof T | "variant" | "mode"> | Exclude<"onLoadStart", keyof T | "variant" | "mode"> | Exclude<"onLoadStartCapture", keyof T | "variant" | "mode"> | Exclude<"onPause", keyof T | "variant" | "mode"> | Exclude<"onPauseCapture", keyof T | "variant" | "mode"> | Exclude<"onPlay", keyof T | "variant" | "mode"> | Exclude<"onPlayCapture", keyof T | "variant" | "mode"> | Exclude<"onPlaying", keyof T | "variant" | "mode"> | Exclude<"onPlayingCapture", keyof T | "variant" | "mode"> | Exclude<"onProgress", keyof T | "variant" | "mode"> | Exclude<"onProgressCapture", keyof T | "variant" | "mode"> | Exclude<"onRateChange", keyof T | "variant" | "mode"> | Exclude<"onRateChangeCapture", keyof T | "variant" | "mode"> | Exclude<"onResize", keyof T | "variant" | "mode"> | Exclude<"onResizeCapture", keyof T | "variant" | "mode"> | Exclude<"onSeeked", keyof T | "variant" | "mode"> | Exclude<"onSeekedCapture", keyof T | "variant" | "mode"> | Exclude<"onSeeking", keyof T | "variant" | "mode"> | Exclude<"onSeekingCapture", keyof T | "variant" | "mode"> | Exclude<"onStalled", keyof T | "variant" | "mode"> | Exclude<"onStalledCapture", keyof T | "variant" | "mode"> | Exclude<"onSuspend", keyof T | "variant" | "mode"> | Exclude<"onSuspendCapture", keyof T | "variant" | "mode"> | Exclude<"onTimeUpdate", keyof T | "variant" | "mode"> | Exclude<"onTimeUpdateCapture", keyof T | "variant" | "mode"> | Exclude<"onVolumeChange", keyof T | "variant" | "mode"> | Exclude<"onVolumeChangeCapture", keyof T | "variant" | "mode"> | Exclude<"onWaiting", keyof T | "variant" | "mode"> | Exclude<"onWaitingCapture", keyof T | "variant" | "mode"> | Exclude<"onAuxClick", keyof T | "variant" | "mode"> | Exclude<"onAuxClickCapture", keyof T | "variant" | "mode"> | Exclude<"onClick", keyof T | "variant" | "mode"> | Exclude<"onClickCapture", keyof T | "variant" | "mode"> | Exclude<"onContextMenu", keyof T | "variant" | "mode"> | Exclude<"onContextMenuCapture", keyof T | "variant" | "mode"> | Exclude<"onDoubleClick", keyof T | "variant" | "mode"> | Exclude<"onDoubleClickCapture", keyof T | "variant" | "mode"> | Exclude<"onDrag", keyof T | "variant" | "mode"> | Exclude<"onDragCapture", keyof T | "variant" | "mode"> | Exclude<"onDragEnd", keyof T | "variant" | "mode"> | Exclude<"onDragEndCapture", keyof T | "variant" | "mode"> | Exclude<"onDragEnter", keyof T | "variant" | "mode"> | Exclude<"onDragEnterCapture", keyof T | "variant" | "mode"> | Exclude<"onDragExit", keyof T | "variant" | "mode"> | Exclude<"onDragExitCapture", keyof T | "variant" | "mode"> | Exclude<"onDragLeave", keyof T | "variant" | "mode"> | Exclude<"onDragLeaveCapture", keyof T | "variant" | "mode"> | Exclude<"onDragOver", keyof T | "variant" | "mode"> | Exclude<"onDragOverCapture", keyof T | "variant" | "mode"> | Exclude<"onDragStart", keyof T | "variant" | "mode"> | Exclude<"onDragStartCapture", keyof T | "variant" | "mode"> | Exclude<"onDrop", keyof T | "variant" | "mode"> | Exclude<"onDropCapture", keyof T | "variant" | "mode"> | Exclude<"onMouseDown", keyof T | "variant" | "mode"> | Exclude<"onMouseDownCapture", keyof T | "variant" | "mode"> | Exclude<"onMouseEnter", keyof T | "variant" | "mode"> | Exclude<"onMouseLeave", keyof T | "variant" | "mode"> | Exclude<"onMouseMove", keyof T | "variant" | "mode"> | Exclude<"onMouseMoveCapture", keyof T | "variant" | "mode"> | Exclude<"onMouseOut", keyof T | "variant" | "mode"> | Exclude<"onMouseOutCapture", keyof T | "variant" | "mode"> | Exclude<"onMouseOver", keyof T | "variant" | "mode"> | Exclude<"onMouseOverCapture", keyof T | "variant" | "mode"> | Exclude<"onMouseUp", keyof T | "variant" | "mode"> | Exclude<"onMouseUpCapture", keyof T | "variant" | "mode"> | Exclude<"onSelect", keyof T | "variant" | "mode"> | Exclude<"onSelectCapture", keyof T | "variant" | "mode"> | Exclude<"onTouchCancel", keyof T | "variant" | "mode"> | Exclude<"onTouchCancelCapture", keyof T | "variant" | "mode"> | Exclude<"onTouchEnd", keyof T | "variant" | "mode"> | Exclude<"onTouchEndCapture", keyof T | "variant" | "mode"> | Exclude<"onTouchMove", keyof T | "variant" | "mode"> | Exclude<"onTouchMoveCapture", keyof T | "variant" | "mode"> | Exclude<"onTouchStart", keyof T | "variant" | "mode"> | Exclude<"onTouchStartCapture", keyof T | "variant" | "mode"> | Exclude<"onPointerDown", keyof T | "variant" | "mode"> | Exclude<"onPointerDownCapture", keyof T | "variant" | "mode"> | Exclude<"onPointerMove", keyof T | "variant" | "mode"> | Exclude<"onPointerMoveCapture", keyof T | "variant" | "mode"> | Exclude<"onPointerUp", keyof T | "variant" | "mode"> | Exclude<"onPointerUpCapture", keyof T | "variant" | "mode"> | Exclude<"onPointerCancel", keyof T | "variant" | "mode"> | Exclude<"onPointerCancelCapture", keyof T | "variant" | "mode"> | Exclude<"onPointerEnter", keyof T | "variant" | "mode"> | Exclude<"onPointerEnterCapture", keyof T | "variant" | "mode"> | Exclude<"onPointerLeave", keyof T | "variant" | "mode"> | Exclude<"onPointerLeaveCapture", keyof T | "variant" | "mode"> | Exclude<"onPointerOver", keyof T | "variant" | "mode"> | Exclude<"onPointerOverCapture", keyof T | "variant" | "mode"> | Exclude<"onPointerOut", keyof T | "variant" | "mode"> | Exclude<"onPointerOutCapture", keyof T | "variant" | "mode"> | Exclude<"onGotPointerCapture", keyof T | "variant" | "mode"> | Exclude<"onGotPointerCaptureCapture", keyof T | "variant" | "mode"> | Exclude<"onLostPointerCapture", keyof T | "variant" | "mode"> | Exclude<"onLostPointerCaptureCapture", keyof T | "variant" | "mode"> | Exclude<"onScroll", keyof T | "variant" | "mode"> | Exclude<"onScrollCapture", keyof T | "variant" | "mode"> | Exclude<"onWheel", keyof T | "variant" | "mode"> | Exclude<"onWheelCapture", keyof T | "variant" | "mode"> | Exclude<"onAnimationStart", keyof T | "variant" | "mode"> | Exclude<"onAnimationStartCapture", keyof T | "variant" | "mode"> | Exclude<"onAnimationEnd", keyof T | "variant" | "mode"> | Exclude<"onAnimationEndCapture", keyof T | "variant" | "mode"> | Exclude<"onAnimationIteration", keyof T | "variant" | "mode"> | Exclude<"onAnimationIterationCapture", keyof T | "variant" | "mode"> | Exclude<"onTransitionEnd", keyof T | "variant" | "mode"> | Exclude<"onTransitionEndCapture", keyof T | "variant" | "mode"> | Exclude<"defaultChecked", keyof T | "variant" | "mode"> | Exclude<"defaultValue", keyof T | "variant" | "mode"> | Exclude<"suppressContentEditableWarning", keyof T | "variant" | "mode"> | Exclude<"suppressHydrationWarning", keyof T | "variant" | "mode"> | Exclude<"accessKey", keyof T | "variant" | "mode"> | Exclude<"contentEditable", keyof T | "variant" | "mode"> | Exclude<"contextMenu", keyof T | "variant" | "mode"> | Exclude<"dir", keyof T | "variant" | "mode"> | Exclude<"draggable", keyof T | "variant" | "mode"> | Exclude<"hidden", keyof T | "variant" | "mode"> | Exclude<"nonce", keyof T | "variant" | "mode"> | Exclude<"placeholder", keyof T | "variant" | "mode"> | Exclude<"spellCheck", keyof T | "variant" | "mode"> | Exclude<"translate", keyof T | "variant" | "mode"> | Exclude<"radioGroup", keyof T | "variant" | "mode"> | Exclude<"about", keyof T | "variant" | "mode"> | Exclude<"datatype", keyof T | "variant" | "mode"> | Exclude<"inlist", keyof T | "variant" | "mode"> | Exclude<"property", keyof T | "variant" | "mode"> | Exclude<"resource", keyof T | "variant" | "mode"> | Exclude<"typeof", keyof T | "variant" | "mode"> | Exclude<"vocab", keyof T | "variant" | "mode"> | Exclude<"autoCapitalize", keyof T | "variant" | "mode"> | Exclude<"autoCorrect", keyof T | "variant" | "mode"> | Exclude<"autoSave", keyof T | "variant" | "mode"> | Exclude<"itemProp", keyof T | "variant" | "mode"> | Exclude<"itemScope", keyof T | "variant" | "mode"> | Exclude<"itemType", keyof T | "variant" | "mode"> | Exclude<"itemID", keyof T | "variant" | "mode"> | Exclude<"itemRef", keyof T | "variant" | "mode"> | Exclude<"results", keyof T | "variant" | "mode"> | Exclude<"security", keyof T | "variant" | "mode"> | Exclude<"unselectable", keyof T | "variant" | "mode"> | Exclude<"inputMode", keyof T | "variant" | "mode"> | Exclude<"is", keyof T | "variant" | "mode">;
|
|
21
20
|
};
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
export declare const createScale: <T extends string | number>() => readonly T[] & {
|
|
2
2
|
length: 0;
|
|
3
3
|
};
|
|
4
|
+
export declare const numericScale: (number & {})[];
|
|
5
|
+
export declare const stringScale: (string & {})[];
|
|
6
|
+
export declare const numericOrStringScale: ((number & {}) | (string & {}))[];
|
|
@@ -1,9 +1,2 @@
|
|
|
1
1
|
import { Parser, Prop } from '../types/config';
|
|
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, Prop>>(config: Config): Parser<Config>;
|
|
2
|
+
export declare function createParser<Config extends Record<string, Prop>>(config: Config, omitProps?: string[]): Parser<Config>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { Prop } from '../types/config';
|
|
2
|
-
import { AbstractProps
|
|
2
|
+
import { AbstractProps } from '../types/props';
|
|
3
|
+
import { CSSObject } from '../types/shared';
|
|
3
4
|
export declare const createPropertyStyle: <Config extends Prop, Value>(value: Value, props: AbstractProps, config: Config) => CSSObject;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Prop } from '../types/config';
|
|
2
2
|
import { MediaQueryCache, MediaQueryMap, ThemeProps } from '../types/props';
|
|
3
|
-
import { Breakpoints } from '../types/theme';
|
|
4
3
|
import { CSSObject } from '../types/shared';
|
|
4
|
+
import { Breakpoints } from '../types/theme';
|
|
5
5
|
export declare const createMediaQueries: (breakpoints?: Breakpoints | undefined) => MediaQueryCache | null;
|
|
6
6
|
export declare const isMediaArray: (val: unknown) => val is (string | number)[];
|
|
7
7
|
export declare const isMediaMap: (val: object) => val is MediaQueryMap<string | number>;
|
package/dist/types/config.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Theme } from '@emotion/react';
|
|
2
|
-
import {
|
|
2
|
+
import { CompatTheme } from '../compatTheme';
|
|
3
3
|
import { DefaultCSSPropertyValue, PropertyTypes } from './properties';
|
|
4
|
-
import {
|
|
5
|
-
import { Arg } from '..';
|
|
4
|
+
import { AbstractProps, ResponsiveProp, ThemeProps } from './props';
|
|
6
5
|
import { ArrayScale, MapScale } from './scales';
|
|
7
|
-
import {
|
|
6
|
+
import { CSSObject } from './shared';
|
|
7
|
+
import { Arg } from './utils';
|
|
8
8
|
export interface BaseProperty {
|
|
9
9
|
property: keyof PropertyTypes;
|
|
10
10
|
properties?: readonly (keyof PropertyTypes)[];
|
|
@@ -19,12 +19,12 @@ export interface AbstractParser {
|
|
|
19
19
|
propNames: string[];
|
|
20
20
|
config: Record<string, Prop>;
|
|
21
21
|
}
|
|
22
|
-
|
|
23
|
-
export
|
|
24
|
-
|
|
25
|
-
export
|
|
26
|
-
export
|
|
27
|
-
export
|
|
22
|
+
type IsEmpty<T> = [] extends T ? true : false | {} extends T ? true : false;
|
|
23
|
+
export type PropertyValues<Property extends Prop, IncludeGlobals = false> = Exclude<PropertyTypes<IncludeGlobals extends true ? DefaultCSSPropertyValue : never>[Property['property']], IncludeGlobals extends true ? never : object | any[]>;
|
|
24
|
+
type CompatValue<Key extends keyof CompatTheme> = CompatTheme[Key] extends MapScale ? keyof CompatTheme[Key] : CompatTheme[Key] extends ArrayScale ? CompatTheme[Key][number] : never;
|
|
25
|
+
export 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>;
|
|
26
|
+
export type Scale<Config extends Prop> = ResponsiveProp<ScaleValue<Config> | ((theme: Theme) => ScaleValue<Config>)>;
|
|
27
|
+
export type ParserProps<Config extends Record<string, Prop>> = ThemeProps<{
|
|
28
28
|
[P in keyof Config]?: Scale<Config[P]>;
|
|
29
29
|
}>;
|
|
30
30
|
export interface Parser<Config extends Record<string, Prop>> {
|
|
@@ -32,7 +32,7 @@ export interface Parser<Config extends Record<string, Prop>> {
|
|
|
32
32
|
propNames: Extract<keyof Config, string>[];
|
|
33
33
|
config: Config;
|
|
34
34
|
}
|
|
35
|
-
export
|
|
35
|
+
export type SystemProps<P extends AbstractParser, SafeProps = Omit<Arg<P>, 'theme'>> = {
|
|
36
36
|
[K in keyof SafeProps]: SafeProps[K];
|
|
37
37
|
};
|
|
38
38
|
export interface VariantConfig {
|
|
@@ -41,4 +41,10 @@ export interface VariantConfig {
|
|
|
41
41
|
base?: CSSProps<AbstractProps, SystemProps<AbstractParser>>;
|
|
42
42
|
variants: CSSPropMap<AbstractProps, SystemProps<AbstractParser>>;
|
|
43
43
|
}
|
|
44
|
+
export type CSSPropMap<Props, System> = {
|
|
45
|
+
[K in keyof Props]?: CSSProps<Props[K], System>;
|
|
46
|
+
};
|
|
47
|
+
export type CSSProps<Props, System> = {
|
|
48
|
+
[K in keyof Props]?: K extends keyof System ? System[K] : K extends keyof PropertyTypes ? PropertyTypes[K] : Omit<PropertyTypes, keyof System> & Omit<System, 'theme'>;
|
|
49
|
+
};
|
|
44
50
|
export {};
|
|
@@ -1,26 +1,23 @@
|
|
|
1
|
-
import { Globals, StandardProperties, VendorProperties } from 'csstype';
|
|
1
|
+
import { Globals, StandardProperties, SvgProperties, VendorProperties } from 'csstype';
|
|
2
2
|
import { CSSObject, NarrowPrimitive } from './shared';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
type AnimusCSSProperties<Overrides = DefaultCSSPropertyValue> = StandardProperties<Overrides> & VendorProperties<Overrides> & Omit<SvgProperties<Overrides>, keyof StandardProperties>;
|
|
4
|
+
type ColorProperties = 'color' | `${string}Color` | 'fill' | 'stroke';
|
|
5
|
+
type ColorGlobals = {
|
|
6
|
+
[K in Extract<keyof AnimusCSSProperties, ColorProperties>]?: Globals | 'currentColor' | 'transparent' | NarrowPrimitive<string>;
|
|
6
7
|
};
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
[K in Extract<keyof
|
|
8
|
+
type SizeProperties = 'left' | 'right' | 'top' | 'bottom' | 'inset' | 'width' | 'height' | `${string}${'Width' | 'Height'}`;
|
|
9
|
+
type SizeValues = `${number}${'px' | 'rem' | 'vh' | 'vw' | 'vmax' | 'vmin' | '%'}` | `calc(${any})`;
|
|
10
|
+
type SizeGlobals = {
|
|
11
|
+
[K in Extract<keyof AnimusCSSProperties, SizeProperties>]?: AnimusCSSProperties[K] | SizeValues | NarrowPrimitive<number>;
|
|
11
12
|
};
|
|
12
13
|
/** This is a placeholder type for CSS properties that may not have any specific global values (outlineOffset).
|
|
13
14
|
* (string & {}) will allow strings but not generalize the union type to just a string if other string literals exist in the union.
|
|
14
15
|
*
|
|
15
16
|
* This ensures that autosuggestions will still work for literal types but still allow any string for certain properties.
|
|
16
17
|
*/
|
|
17
|
-
export
|
|
18
|
-
export interface PropertyTypes<Overrides = DefaultCSSPropertyValue> extends Omit<
|
|
18
|
+
export type DefaultCSSPropertyValue = (string & {}) | 0;
|
|
19
|
+
export interface PropertyTypes<Overrides = DefaultCSSPropertyValue> extends Omit<AnimusCSSProperties<Overrides>, keyof ColorGlobals | keyof SizeGlobals>, ColorGlobals, SizeGlobals {
|
|
19
20
|
none?: never;
|
|
20
21
|
variables?: CSSObject;
|
|
21
22
|
}
|
|
22
|
-
export interface VendorPropertyTypes<Overrides = DefaultCSSPropertyValue> extends VendorProperties<Overrides> {
|
|
23
|
-
}
|
|
24
|
-
export interface CSSPropertyTypes<Overrides = DefaultCSSPropertyValue> extends PropertyTypes<Overrides>, VendorPropertyTypes<Overrides> {
|
|
25
|
-
}
|
|
26
23
|
export {};
|
package/dist/types/props.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { Theme } from '@emotion/react';
|
|
2
|
-
|
|
3
|
-
import { CSSPropertyTypes } from './properties';
|
|
4
|
-
export declare type AbstractProps = ThemeProps<Record<string, unknown>>;
|
|
2
|
+
export type AbstractProps = ThemeProps<Record<string, unknown>>;
|
|
5
3
|
interface MediaQueryByKey<T = string> {
|
|
6
4
|
xs: T;
|
|
7
5
|
sm: T;
|
|
@@ -13,7 +11,7 @@ export interface MediaQueryCache {
|
|
|
13
11
|
map: MediaQueryByKey;
|
|
14
12
|
array: string[];
|
|
15
13
|
}
|
|
16
|
-
export
|
|
14
|
+
export type ThemeProps<Props = {}> = Props & {
|
|
17
15
|
theme?: Theme;
|
|
18
16
|
};
|
|
19
17
|
export interface MediaQueryArray<T> {
|
|
@@ -32,12 +30,5 @@ export interface MediaQueryMap<T> {
|
|
|
32
30
|
lg?: T;
|
|
33
31
|
xl?: T;
|
|
34
32
|
}
|
|
35
|
-
export
|
|
36
|
-
export declare type CSSPropMap<Props, System> = {
|
|
37
|
-
[K in keyof Props]?: CSSProps<Props[K], System>;
|
|
38
|
-
};
|
|
39
|
-
export declare type CSSProps<Props, System> = {
|
|
40
|
-
[K in keyof Props]?: K extends keyof System ? System[K] : K extends keyof CSSPropertyTypes ? CSSPropertyTypes[K] : Omit<CSSPropertyTypes, keyof System> & Omit<System, 'theme'>;
|
|
41
|
-
};
|
|
42
|
-
export declare type ScaleValue<P extends AbstractParser, Prop extends keyof P['config']> = Scale<P['config'][Prop]>;
|
|
33
|
+
export type ResponsiveProp<T> = T | MediaQueryMap<T> | MediaQueryArray<T>;
|
|
43
34
|
export {};
|
package/dist/types/scales.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export type MapScale = Record<string | number, string | number>;
|
|
2
|
+
export type ArrayScale = readonly (string | number)[];
|
package/dist/types/shared.d.ts
CHANGED
package/dist/types/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
1
|
+
export type Arg<T extends (...args: any) => any> = Parameters<T>[0];
|
|
2
|
+
export type AllUnionKeys<T> = T extends any ? keyof T : never;
|
|
3
|
+
export type KeyFromUnion<T, K> = T extends any ? K extends keyof T ? T[K] : never : never;
|
|
4
|
+
export 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
3
|
"description": "Constraint based CSS in JS Foundations",
|
|
4
|
-
"version": "0.1.1-
|
|
4
|
+
"version": "0.1.1-c5e4903f.0+c5e4903",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"emotion",
|
|
7
7
|
"css",
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
],
|
|
11
11
|
"author": "codecaaron <airrobb@gmail.com>",
|
|
12
12
|
"license": "MIT",
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"types": "dist/index.d.ts",
|
|
13
|
+
"module": "./dist/index.js",
|
|
14
|
+
"main": "./dist/index.js",
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
16
|
"publishConfig": {
|
|
17
17
|
"access": "public"
|
|
18
18
|
},
|
|
@@ -27,14 +27,14 @@
|
|
|
27
27
|
"compile": "tsc --noEmit"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"@emotion/is-prop-valid": "^1.1.1",
|
|
31
|
-
"@emotion/react": ">=11.0.0",
|
|
32
|
-
"@emotion/styled": ">=11.0.0",
|
|
33
30
|
"lodash": "*",
|
|
34
31
|
"typescript": ">=4.3.5"
|
|
35
32
|
},
|
|
36
33
|
"dependencies": {
|
|
34
|
+
"@emotion/is-prop-valid": "^1.1.1",
|
|
35
|
+
"@emotion/react": "^11.0.0",
|
|
36
|
+
"@emotion/styled": "^11.0.0",
|
|
37
37
|
"csstype": "^3.0.7"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "c5e4903f345d7bbcdf5ee4da813147adcbd780a1"
|
|
40
40
|
}
|
package/rollup.config.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
const config = require('../../rollup.config');
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
module.exports = config();
|
package/tsconfig.json
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"extends": "../../tsconfig.json",
|
|
3
3
|
"compilerOptions": {
|
|
4
|
+
"declaration": true,
|
|
5
|
+
"rootDir": "./src",
|
|
4
6
|
"outDir": "./dist"
|
|
5
7
|
},
|
|
6
|
-
"include": ["
|
|
7
|
-
"exclude": ["
|
|
8
|
+
"include": ["src/**/*.ts", "src/**/*.tsx"],
|
|
9
|
+
"exclude": ["**/*.test.ts", "**/*.test.tsx"]
|
|
8
10
|
}
|
package/dist/index.cjs.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r=require("lodash");function e(r){return r&&"object"==typeof r&&"default"in r?r:{default:r}}var t=e(require("@emotion/styled"));const o=()=>[],s=r=>0===r?r:r<=1&&r>=-1?100*r+"%":`${r}px`,i=/(-?\d*\.?\d+)(%|\w*)/,p=e=>{if(r.isNumber(e))return s(e);if(e.includes("calc"))return e;const[t,o,p]=i.exec(e)||[];if(void 0===t)return e;const n=parseFloat(o);return p?`${n}${p}`:s(n)},n={max:"max-content",min:"min-content"},a=new RegExp(/^[0-9]*$/),d=e=>{var t;return`minmax(0, ${t=e,a.test(t)?`${e}fr`:r.get(n,e,e)})`},c=(r,e)=>{const t=d(r);return e>1?`repeat(${e}, ${t})`:t},l=r=>{const e=r.split(":");let t=["",0],o="";for(let r=0;r<e.length+1;r+=1){const s=o.length>0?" ":"",i=e[r];t?.[0]!==i?(t[0].length&&(o+=s+c(...t)),i&&(t=[i,1])):t[1]+=1}return o},u=e=>r.isNumber(e)?c("1",e):l(e),g=(r,e)=>"number"==typeof r?e(r):r,y=r=>g(r,(r=>`${r}px`)),m=r=>g(r,(r=>`${r}px solid currentColor`)),b={spacing:[0,4,8,12,16,24,32,40,48,64,96],fontSize:[64,44,34,26,22,20,18,16,14],lineHeight:{body:1.5,heading:1},fontWeight:[400,600,700],fontFamily:{body:"Verdana, sans-serif",heading:"Verdana, Lato, sans-serif",monospace:"monospace"},radii:[2,4,6,8],borders:[1,2,3],colors:{},modes:{},mode:void 0},f=(e,t,o)=>{if(r.isArray(t))return e;if(r.isObject(t))return r.get(t,e);if(r.isString(t)){const s=r.get(o,t,r.get(b,t));if(!s)return;return r.isArray(s)?e:r.get(s,e)}},h=(e,t,o)=>{const s={},{transform:i=r.identity,property:p,properties:n=[p],scale:a,variable:d}=o,c=void 0===a||r.isArray(a);if(r.isUndefined(e))return s;let l,u,g=!1;switch(typeof e){case"number":case"string":u=f(e,a,t?.theme),g=void 0!==u||c,l=u??e;break;case"function":t.theme&&(l=e(t.theme));break;default:return s}if(n.forEach((e=>{let o=l;switch(g&&!r.isUndefined(o)&&(o=i(o,e,t)),typeof o){case"number":case"string":return s[e]=o;case"object":return Object.assign(s,o)}})),d){let e=l;g&&!r.isUndefined(e)&&(e=i(e,p,t)),e&&"object"!=typeof e&&(s[d]=e)}return s},R=["border","borderTop","borderBottom","borderLeft","borderRight","borderWidth","borderStyle","borderColor","background","flex","margin","padding","transition","gap","grid","gridArea","gridColumn","gridRow","gridTemplate","overflow","transition"],x=-1,w=1,S=1,j=(r,e)=>r<e?x:e<r?w:S,v=r=>Object.keys(r).sort(((e,t)=>{const{[e]:o,[t]:s}=r,{property:i,properties:p=[]}=o,{property:n,properties:a=[]}=s,d=R.includes(i),c=R.includes(n);if(d&&c){const r=p.length,e=a.length;if(i!==n)return j(R.indexOf(i),R.indexOf(n));if(i===n){if(0===r)return x;if(0===e)return w}return j(e,r)}return d?x:c?w:S})),C=["_","xs","sm","md","lg","xl"],O=r=>`@media screen and (min-width: ${r}px)`,T={xs:480,sm:768,md:1024,lg:1200,xl:1440},k=(e,t,o,s,i)=>{const p=r.get(o,t);switch(typeof p){case"string":case"number":case"function":return Object.assign(e,h(p,o,s));case"object":if(!i.mediaQueries)return;if(n=p,Array.isArray(n))return r.merge(e,((r,e,t,o)=>{const s={},[i,...p]=r;return i&&Object.assign(s,h(i,e,t)),p.forEach(((r,i)=>{const p=o[i];p&&void 0!==r&&Object.assign(s,{[p]:h(r,e,t)})})),s})(p,o,s,i.mediaQueries.array));if(p&&(e=>r.intersection(Object.keys(e),C).length>0)(p))return r.merge(e,((r,e,t,o)=>{const s={},{_:i,...p}=r;return i&&Object.assign(s,h(i,e,t)),Object.keys(o).forEach((r=>{const i=p[r];void 0!==i&&Object.assign(s,{[o[r]]:h(i,e,t)})})),s})(p,o,s,i.mediaQueries.map))}var n};function E(e){const t=v(e),o={mediaQueries:null};return Object.assign(((s,i=!1)=>{const p={},{theme:n}=s;return null===o.mediaQueries&&(o.mediaQueries=(e=>{if(void 0===e)return null;const{xs:t,sm:o,md:s,lg:i,xl:p}=e??{};return{map:r.mapValues(e,O),array:[t,o,s,i,p].map(O)}})(n?.breakpoints??T)),i?Object.keys(s).forEach((t=>{const i=e[t];i?k(p,t,s,i,o):"theme"!==t&&Object.assign(p,{[t]:r.get(s,t)})})):t.forEach((r=>{const t=e[r];k(p,r,s,t,o)})),null!==o.mediaQueries?((e,t)=>{const o=r.omit(e,t);return t.forEach((r=>{e[r]&&(o[r]=e[r])})),o})(p,o.mediaQueries.array):p}),{propNames:t,config:e})}const A=(r,e)=>{const t=Object.keys(r),o=Object.keys(e);return r=>{const e=[];return t.forEach((t=>{r[t]&&e.push(`${t}-${r[t]}`)})),o.forEach((t=>{r[t]&&e.push(t)})),e}},W=(r,e)=>{const t={},o={};return Object.entries(r).forEach((([r,s])=>{(e.includes(r)?o:t)[r]=s})),[t,o]},B=(e,t,o,s)=>{const{base:i}=t,{parser:p,getMediaSelectors:n,getActiveOverrides:a}=s,{theme:d}=o,c=Object.values(r.pick(t,a(o))),l=n(o),[u,g]=W(p({...i,theme:d},!0),l);for(const r in u)e[r]=u[r];c.forEach((t=>{((e={},t,o,s,i,p)=>{const[n,a]=W(s({...e,theme:i},!0),p);for(const r in n)t[r]=n[r];p.forEach((e=>{const t=a[e];if(!t||r.isEmpty(t))return;o[e]||(o[e]={});const s=o[e];for(const r in t)s[r]=t[r]}))})(t,e,g,p,d,l)})),l.forEach((t=>{const o=g[t];r.isEmpty(o)||(e[t]=o)}))},L=(e,t={},o={},s={})=>{const i=((e={},t={},o={},s)=>{const i={};return Object.entries(e).forEach((([e,t])=>{!s.includes(e)&&r.isObject(t)?r.set(i,[e,"base"],t):r.set(i,["primary","base",e],t)})),Object.entries(t).forEach((([e,{variants:t}])=>{Object.entries(t).forEach((([t,o])=>{const p=`${e}-${t}`;Object.entries(o).forEach((([e,t])=>{!s.includes(e)&&r.isObject(t)?r.set(i,[e,p],t):r.set(i,["primary",p,e],t)}))}))})),Object.entries(o).forEach((([e,t])=>{Object.entries(t).forEach((([t,o])=>{!s.includes(t)&&r.isObject(o)?r.set(i,[t,e],o):r.set(i,["primary",e,t],o)}))})),i})(t,o,s,e.propNames),p={parser:e,getMediaSelectors:({theme:r})=>{const e=r?.breakpoints??T;return["xs","sm","md","lg","xl"].map((r=>e[r]))},getActiveOverrides:A(o,s)};return r=>{const{vars:t}=r,o={...t};return Object.entries(i).forEach((([e,t={}])=>{"primary"===e?B(o,t,r,p):(o[e]={},B(o[e],t,r,p))})),B(o,{base:e(r)},r,p),o}};class G{propRegistry={};groupRegistry={};parser={};baseStyles={};statesConfig={};variants={};activeGroups={};custom={};constructor(r,e,t,o,s,i,p,n){this.propRegistry=r,this.groupRegistry=e,this.parser=t,this.baseStyles=o,this.variants=s,this.statesConfig=i,this.activeGroups=p,this.custom=n}asComponent(r){const e=L(E({...this.parser.config,...this.custom}),this.baseStyles,this.variants,this.statesConfig);return t.default(r)(e)}build(){return L(E({...this.parser.config,...this.custom}),this.baseStyles,this.variants,this.statesConfig)}}class Q extends G{constructor(r,e,t,o,s,i,p){super(r,e,t,o,s,i,p,{})}props(r){return new G(this.propRegistry,this.groupRegistry,this.parser,this.baseStyles,this.variants,this.statesConfig,this.activeGroups,r)}}class $ extends Q{constructor(r,e,t,o,s,i){super(r,e,t,o,s,i,{})}groups(r){return new Q(this.propRegistry,this.groupRegistry,this.parser,this.baseStyles,this.variants,this.statesConfig,r)}}class F extends ${constructor(r,e,t,o,s){super(r,e,t,o,s,{})}states(r){return new $(this.propRegistry,this.groupRegistry,this.parser,this.baseStyles,this.variants,r)}variant(e){const t=e.prop||"variant";return new F(this.propRegistry,this.groupRegistry,this.parser,this.baseStyles,r.merge(this.variants,{[t]:e}))}}class I extends F{constructor(r,e,t,o){super(r,e,t,o,{})}variant(e){const t=e.prop||"variant";return new F(this.propRegistry,this.groupRegistry,this.parser,this.baseStyles,r.merge(this.variants,{[t]:e}))}}class z extends I{constructor(r,e){super(r,e,E(r),{})}styles(r){return new I(this.propRegistry,this.groupRegistry,this.parser,r)}}class H{#r={};#e={};constructor(r,e){this.#r=r||{},this.#e=e||{}}addGroup(r,e){const t={[r]:Object.keys(e)};return new H({...this.#r,...e},{...this.#e,...t})}build(){const r=this.#r,e=this.#e;return new z(r,e)}}const N=()=>new H,U={border:{property:"border",scale:"borders",transform:m},borderX:{property:"border",properties:["borderLeft","borderRight"],scale:"borders",transform:m},borderY:{property:"border",properties:["borderTop","borderBottom"],scale:"borders",transform:m},borderTop:{property:"borderTop",scale:"borders",transform:m},borderRight:{property:"borderRight",scale:"borders",transform:m},borderBottom:{property:"borderBottom",scale:"borders",transform:m},borderLeft:{property:"borderLeft",scale:"borders",transform:m},borderWidth:{property:"borderWidth"},borderWidthX:{property:"borderWidth",properties:["borderLeftWidth","borderRightWidth"]},borderWidthY:{property:"borderWidth",properties:["borderTopWidth","borderBottomWidth"]},borderWidthLeft:{property:"borderLeftWidth"},borderWidthRight:{property:"borderRightWidth"},borderWidthTop:{property:"borderTopWidth"},borderWidthBottom:{property:"borderBottomWidth"},borderRadius:{property:"borderRadius",scale:"radii",transform:y},borderRadiusLeft:{property:"borderRadius",properties:["borderTopLeftRadius","borderBottomLeftRadius"],scale:"radii",transform:y},borderRadiusTop:{property:"borderRadius",properties:["borderTopLeftRadius","borderTopRightRadius"],scale:"radii",transform:y},borderRadiusBottom:{property:"borderRadius",properties:["borderBottomLeftRadius","borderBottomRightRadius"],scale:"radii",transform:y},borderRadiusRight:{property:"borderRadius",properties:["borderTopRightRadius","borderBottomRightRadius"],scale:"radii",transform:y},borderRadiusTopLeft:{property:"borderTopLeftRadius",scale:"radii",transform:y},borderRadiusTopRight:{property:"borderTopRightRadius",scale:"radii",transform:y},borderRadiusBottomRight:{property:"borderBottomRightRadius",scale:"radii",transform:y},borderRadiusBottomLeft:{property:"borderBottomLeftRadius",scale:"radii",transform:y},borderStyle:{property:"borderStyle"},borderStyleX:{property:"borderStyle",properties:["borderLeftStyle","borderRightStyle"]},borderStyleY:{property:"borderStyle",properties:["borderTopStyle","borderBottomStyle"]},borderStyleLeft:{property:"borderLeftStyle"},borderStyleRight:{property:"borderRightStyle"},borderStyleTop:{property:"borderTopStyle"},borderStyleBottom:{property:"borderBottomStyle"}},V={gap:{property:"gap",scale:"spacing"},rowGap:{property:"rowGap",scale:"spacing"},columnGap:{property:"columnGap",scale:"spacing"}},X={justifySelf:{property:"justifySelf"},alignSelf:{property:"alignSelf"},gridArea:{property:"gridArea"},area:{property:"gridArea"}},Y={justifyContent:{property:"justifyContent"},justifyItems:{property:"justifyItems"},alignItems:{property:"alignItems"},alignContent:{property:"alignContent"},...X},_={flexBasis:{property:"flexBasis"},flexShrink:{property:"flexShrink"},flexGrow:{property:"flexGrow"},order:{property:"order"}},P={flexDirection:{property:"flexDirection"},flexWrap:{property:"flexWrap"},flex:{property:"flex"},...Y,..._,...V},D={gridColumn:{property:"gridColumn"},gridRow:{property:"gridRow"},gridColumnStart:{property:"gridColumnStart"},gridRowStart:{property:"gridRowStart"},gridColumnEnd:{property:"gridColumnEnd"},gridRowEnd:{property:"gridRowEnd"}},M={gridAutoColumns:{property:"gridAutoColumns"},gridAutoRows:{property:"gridAutoRows"},gridTemplateColumns:{property:"gridTemplateColumns"},gridTemplateRows:{property:"gridTemplateRows"},gridTemplateAreas:{property:"gridTemplateAreas"},gridAutoFlow:{property:"gridAutoFlow"},flow:{property:"gridAutoFlow",scale:[]},cols:{property:"gridTemplateColumns",transform:u,scale:[]},rows:{property:"gridTemplateRows",transform:u,scale:[]},autoRows:{property:"gridAutoRows",transform:d},autoCols:{property:"gridAutoColumns",transform:d},alignAll:{property:"justifyContent",properties:["justifyContent","alignItems"]},...Y,...D,...V},q={position:{property:"position"},inset:{property:"inset",properties:["top","right","bottom","left"],transform:p},top:{property:"top",transform:p},right:{property:"right",transform:p},bottom:{property:"bottom",transform:p},left:{property:"left",transform:p},zIndex:{property:"zIndex"},opacity:{property:"opacity"}},J={display:{property:"display"},overflow:{property:"overflow"},overflowX:{property:"overflowX"},overflowY:{property:"overflowY"},size:{property:"width",properties:["width","height"],transform:p},width:{property:"width",transform:p},minWidth:{property:"minWidth",transform:p},maxWidth:{property:"maxWidth",transform:p},height:{property:"height",transform:p},minHeight:{property:"minHeight",transform:p},maxHeight:{property:"maxHeight",transform:p},verticalAlign:{property:"verticalAlign"},...X,...D,..._},K={m:{property:"margin",scale:"spacing"},mx:{property:"margin",properties:["marginLeft","marginRight"],scale:"spacing"},my:{property:"margin",properties:["marginTop","marginBottom"],scale:"spacing"},mt:{property:"marginTop",scale:"spacing"},mb:{property:"marginBottom",scale:"spacing"},mr:{property:"marginRight",scale:"spacing"},ml:{property:"marginLeft",scale:"spacing"},p:{property:"padding",scale:"spacing"},px:{property:"padding",properties:["paddingLeft","paddingRight"],scale:"spacing"},py:{property:"padding",properties:["paddingTop","paddingBottom"],scale:"spacing"},pt:{property:"paddingTop",scale:"spacing"},pb:{property:"paddingBottom",scale:"spacing"},pr:{property:"paddingRight",scale:"spacing"},pl:{property:"paddingLeft",scale:"spacing"}},Z=N().addGroup("flex",P).addGroup("grid",M).addGroup("mode",{mode:{property:"none",scale:"mode"}}).addGroup("vars",{vars:{property:"variables"}}).addGroup("space",K).addGroup("color",{color:{property:"color",scale:"colors"},textColor:{property:"color",scale:"colors"},bg:{property:"backgroundColor",scale:"colors"},borderColor:{property:"borderColor",scale:"colors"},borderColorX:{property:"borderColor",properties:["borderLeftColor","borderRightColor"],scale:"colors"},borderColorY:{property:"borderColor",properties:["borderTopColor","borderBottomColor"],scale:"colors"},borderColorLeft:{property:"borderLeftColor",scale:"colors"},borderColorRight:{property:"borderRightColor",scale:"colors"},borderColorTop:{property:"borderTopColor",scale:"colors"},borderColorBottom:{property:"borderBottomColor",scale:"colors"}}).addGroup("layout",J).addGroup("borders",U).addGroup("shadows",{boxShadow:{property:"boxShadow"},textShadow:{property:"textShadow"}}).addGroup("background",{background:{property:"background"},backgroundImage:{property:"backgroundImage"},backgroundSize:{property:"backgroundSize"},backgroundRepeat:{property:"backgroundRepeat"},backgroundPosition:{property:"backgroundPosition"}}).addGroup("typography",{fontFamily:{property:"fontFamily",scale:"fontFamily"},fontWeight:{property:"fontWeight",scale:"fontWeight"},lineHeight:{property:"lineHeight",scale:"lineHeight",lineHeight:"lineHeight"},fontSize:{property:"fontSize",scale:"fontSize"},letterSpacing:{property:"letterSpacing"},textAlign:{property:"textAlign"},fontStyle:{property:"fontStyle"},textDecoration:{property:"textDecoration"},textTransform:{property:"textTransform"},whiteSpace:{property:"whiteSpace"}}).addGroup("positioning",q);Z.build();const rr=(e,t)=>r.pick(e,r.keys(e).filter((r=>!t.includes(r)))),er=["_","xs","sm","md","lg","xl"],tr=r=>`@media screen and (min-width: ${r}px)`,or={xs:480,sm:768,md:1024,lg:1200,xl:1440},sr=(e,t,o,s,i)=>{const p=r.get(o,t);switch(typeof p){case"string":case"number":case"function":return Object.assign(e,s.styleFn(p,t,o));case"object":if(!i.mediaQueries)return;if(n=p,Array.isArray(n))return r.merge(e,((r,e,t,o)=>{const s={},{styleFn:i,prop:p}=t,[n,...a]=r;return n&&Object.assign(s,i(n,p,e)),a.forEach(((r,t)=>{const n=o[t];n&&void 0!==r&&Object.assign(s,{[n]:i(r,p,e)})})),s})(p,o,s,i.mediaQueries.array));if(p&&(e=>r.intersection(Object.keys(e),er).length>0)(p))return r.merge(e,((r,e,t,o)=>{const s={},{styleFn:i,prop:p}=t,{_:n,...a}=r;return n&&Object.assign(s,i(n,p,e)),Object.keys(o).forEach((r=>{const t=a[r];void 0!==t&&Object.assign(s,{[o[r]]:i(t,p,e)})})),s})(p,o,s,i.mediaQueries.map))}var n};function ir(e){const t=v(e),o={mediaQueries:null};return Object.assign(((s,i=!1)=>{const p={},{theme:n}=s;return null===o.mediaQueries&&(o.mediaQueries=(e=>{if(void 0===e)return null;const{xs:t,sm:o,md:s,lg:i,xl:p}=e??{};return{map:r.mapValues(e,tr),array:[t,o,s,i,p].map(tr)}})(n?.breakpoints??or)),i?Object.keys(s).forEach((t=>{const i=e[t];i?sr(p,t,s,i,o):"theme"!==t&&Object.assign(p,{[t]:r.get(s,t)})})):t.forEach((r=>{const t=e[r];sr(p,r,s,t,o)})),null!==o.mediaQueries?((e,t)=>{const o=r.omit(e,t);return t.forEach((r=>{e[r]&&(o[r]=e[r])})),o})(p,o.mediaQueries.array):p}),{propNames:t,config:e})}function pr(e,t){const{transform:o=r.identity,property:s,properties:i=[s],scale:p,variable:n}=t,a=void 0===p||r.isArray(p);return{...t,prop:e,styleFn:(e,t,d)=>{const c={};if(r.isUndefined(e))return c;let l,u,g=!1;switch(typeof e){case"number":case"string":u=f(e,p,d.theme),g=void 0!==u||a,l=u??e;break;case"function":d.theme&&(l=e(d.theme));break;default:return c}if(i.forEach((e=>{let t=l;switch(g&&!r.isUndefined(t)&&(t=o(t,e,d)),typeof t){case"number":case"string":return c[e]=t;case"object":return Object.assign(c,t)}})),n){let e=l;g&&!r.isUndefined(e)&&(e=o(e,s,d)),e&&"object"!=typeof e&&(c[n]=e)}return c}}}function nr(r){const e={};for(const t in r)"string"==typeof t&&(e[t]=pr(t,r[t]));return ir(e)}function ar(e){const t=nr(e),o=t.propNames;return e=>{let s;const i=Object.keys(e).filter((t=>!o.includes(t)&&r.isObject(e[t]))),p=rr(e,["theme",...i,...o]);return({theme:r})=>{if(s)return s;const n=t({...e,theme:r});return i.forEach((s=>{const i=e[s]??{};n[s]={...rr(i,o),...t({...i,theme:r})}})),s={...p,...n},s}}}const dr={compose:function(...r){return ir(r.reduce(((r,e)=>({...r,...e.config})),{}))},create:nr,createCss:ar,createVariant:function(e){const t=ar(e);return({prop:e="variant",defaultVariant:o,base:s={},variants:i})=>{const p=t(s),n={};return Object.keys(i).forEach((r=>{const e=r,o=i[e];n[e]=t(o)})),t=>{const{[e]:s=o}=t,i={};return s?r.merge(i,p(t),n?.[s]?.(t)):i}}},createStates:function(e){const t=ar(e);return e=>{const o=Object.keys(e),s={};return o.forEach((r=>{const o=r,i=e[o];s[o]=t(i)})),e=>{const t={};return o.forEach((o=>{r.merge(t,e[o]&&s[o](e))})),t}}}},cr=Z.build();exports.AnimusConfig=H,exports.animus=cr,exports.animusProps=dr,exports.borderShorthand=m,exports.compatTheme=b,exports.config=Z,exports.createAnimus=N,exports.createScale=o,exports.gridItem=d,exports.gridItemRatio=u,exports.numberToPx=y,exports.numberToTemplate=g,exports.parseGridRatio=l,exports.percentageOrAbsolute=s,exports.repeatGridItem=c,exports.size=p;
|
package/dist/index.esm.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{isNumber as r,get as e,isArray as t,isObject as o,isString as s,isUndefined as i,identity as p,mapValues as a,omit as n,intersection as d,merge as c,pick as l,isEmpty as u,set as g,keys as y}from"lodash";import m from"@emotion/styled";const f=()=>[],b=r=>0===r?r:r<=1&&r>=-1?100*r+"%":`${r}px`,h=/(-?\d*\.?\d+)(%|\w*)/,R=e=>{if(r(e))return b(e);if(e.includes("calc"))return e;const[t,o,s]=h.exec(e)||[];if(void 0===t)return e;const i=parseFloat(o);return s?`${i}${s}`:b(i)},x={max:"max-content",min:"min-content"},w=new RegExp(/^[0-9]*$/),S=r=>{var t;return`minmax(0, ${t=r,w.test(t)?`${r}fr`:e(x,r,r)})`},v=(r,e)=>{const t=S(r);return e>1?`repeat(${e}, ${t})`:t},j=r=>{const e=r.split(":");let t=["",0],o="";for(let r=0;r<e.length+1;r+=1){const s=o.length>0?" ":"",i=e[r];t?.[0]!==i?(t[0].length&&(o+=s+v(...t)),i&&(t=[i,1])):t[1]+=1}return o},C=e=>r(e)?v("1",e):j(e),O=(r,e)=>"number"==typeof r?e(r):r,T=r=>O(r,(r=>`${r}px`)),k=r=>O(r,(r=>`${r}px solid currentColor`)),E={spacing:[0,4,8,12,16,24,32,40,48,64,96],fontSize:[64,44,34,26,22,20,18,16,14],lineHeight:{body:1.5,heading:1},fontWeight:[400,600,700],fontFamily:{body:"Verdana, sans-serif",heading:"Verdana, Lato, sans-serif",monospace:"monospace"},radii:[2,4,6,8],borders:[1,2,3],colors:{},modes:{},mode:void 0},W=(r,i,p)=>{if(t(i))return r;if(o(i))return e(i,r);if(s(i)){const o=e(p,i,e(E,i));if(!o)return;return t(o)?r:e(o,r)}},B=(r,e,o)=>{const s={},{transform:a=p,property:n,properties:d=[n],scale:c,variable:l}=o,u=void 0===c||t(c);if(i(r))return s;let g,y,m=!1;switch(typeof r){case"number":case"string":y=W(r,c,e?.theme),m=void 0!==y||u,g=y??r;break;case"function":e.theme&&(g=r(e.theme));break;default:return s}if(d.forEach((r=>{let t=g;switch(m&&!i(t)&&(t=a(t,r,e)),typeof t){case"number":case"string":return s[r]=t;case"object":return Object.assign(s,t)}})),l){let r=g;m&&!i(r)&&(r=a(r,n,e)),r&&"object"!=typeof r&&(s[l]=r)}return s},L=["border","borderTop","borderBottom","borderLeft","borderRight","borderWidth","borderStyle","borderColor","background","flex","margin","padding","transition","gap","grid","gridArea","gridColumn","gridRow","gridTemplate","overflow","transition"],A=-1,G=1,Q=1,$=(r,e)=>r<e?A:e<r?G:Q,F=r=>Object.keys(r).sort(((e,t)=>{const{[e]:o,[t]:s}=r,{property:i,properties:p=[]}=o,{property:a,properties:n=[]}=s,d=L.includes(i),c=L.includes(a);if(d&&c){const r=p.length,e=n.length;if(i!==a)return $(L.indexOf(i),L.indexOf(a));if(i===a){if(0===r)return A;if(0===e)return G}return $(e,r)}return d?A:c?G:Q})),H=["_","xs","sm","md","lg","xl"],z=r=>`@media screen and (min-width: ${r}px)`,I={xs:480,sm:768,md:1024,lg:1200,xl:1440},X=(r,t,o,s,i)=>{const p=e(o,t);switch(typeof p){case"string":case"number":case"function":return Object.assign(r,B(p,o,s));case"object":if(!i.mediaQueries)return;if(a=p,Array.isArray(a))return c(r,((r,e,t,o)=>{const s={},[i,...p]=r;return i&&Object.assign(s,B(i,e,t)),p.forEach(((r,i)=>{const p=o[i];p&&void 0!==r&&Object.assign(s,{[p]:B(r,e,t)})})),s})(p,o,s,i.mediaQueries.array));if(p&&(r=>d(Object.keys(r),H).length>0)(p))return c(r,((r,e,t,o)=>{const s={},{_:i,...p}=r;return i&&Object.assign(s,B(i,e,t)),Object.keys(o).forEach((r=>{const i=p[r];void 0!==i&&Object.assign(s,{[o[r]]:B(i,e,t)})})),s})(p,o,s,i.mediaQueries.map))}var a};function Y(r){const t=F(r),o={mediaQueries:null};return Object.assign(((s,i=!1)=>{const p={},{theme:d}=s;return null===o.mediaQueries&&(o.mediaQueries=(r=>{if(void 0===r)return null;const{xs:e,sm:t,md:o,lg:s,xl:i}=r??{};return{map:a(r,z),array:[e,t,o,s,i].map(z)}})(d?.breakpoints??I)),i?Object.keys(s).forEach((t=>{const i=r[t];i?X(p,t,s,i,o):"theme"!==t&&Object.assign(p,{[t]:e(s,t)})})):t.forEach((e=>{const t=r[e];X(p,e,s,t,o)})),null!==o.mediaQueries?((r,e)=>{const t=n(r,e);return e.forEach((e=>{r[e]&&(t[e]=r[e])})),t})(p,o.mediaQueries.array):p}),{propNames:t,config:r})}const D=(r,e)=>{const t=Object.keys(r),o=Object.keys(e);return r=>{const e=[];return t.forEach((t=>{r[t]&&e.push(`${t}-${r[t]}`)})),o.forEach((t=>{r[t]&&e.push(t)})),e}},N=(r,e)=>{const t={},o={};return Object.entries(r).forEach((([r,s])=>{(e.includes(r)?o:t)[r]=s})),[t,o]},V=(r,e,t,o)=>{const{base:s}=e,{parser:i,getMediaSelectors:p,getActiveOverrides:a}=o,{theme:n}=t,d=Object.values(l(e,a(t))),c=p(t),[g,y]=N(i({...s,theme:n},!0),c);for(const e in g)r[e]=g[e];d.forEach((e=>{((r={},e,t,o,s,i)=>{const[p,a]=N(o({...r,theme:s},!0),i);for(const r in p)e[r]=p[r];i.forEach((r=>{const e=a[r];if(!e||u(e))return;t[r]||(t[r]={});const o=t[r];for(const r in e)o[r]=e[r]}))})(e,r,y,i,n,c)})),c.forEach((e=>{const t=y[e];u(t)||(r[e]=t)}))},_=(r,e={},t={},s={})=>{const i=((r={},e={},t={},s)=>{const i={};return Object.entries(r).forEach((([r,e])=>{!s.includes(r)&&o(e)?g(i,[r,"base"],e):g(i,["primary","base",r],e)})),Object.entries(e).forEach((([r,{variants:e}])=>{Object.entries(e).forEach((([e,t])=>{const p=`${r}-${e}`;Object.entries(t).forEach((([r,e])=>{!s.includes(r)&&o(e)?g(i,[r,p],e):g(i,["primary",p,r],e)}))}))})),Object.entries(t).forEach((([r,e])=>{Object.entries(e).forEach((([e,t])=>{!s.includes(e)&&o(t)?g(i,[e,r],t):g(i,["primary",r,e],t)}))})),i})(e,t,s,r.propNames),p={parser:r,getMediaSelectors:({theme:r})=>{const e=r?.breakpoints??I;return["xs","sm","md","lg","xl"].map((r=>e[r]))},getActiveOverrides:D(t,s)};return e=>{const{vars:t}=e,o={...t};return Object.entries(i).forEach((([r,t={}])=>{"primary"===r?V(o,t,e,p):(o[r]={},V(o[r],t,e,p))})),V(o,{base:r(e)},e,p),o}};class M{propRegistry={};groupRegistry={};parser={};baseStyles={};statesConfig={};variants={};activeGroups={};custom={};constructor(r,e,t,o,s,i,p,a){this.propRegistry=r,this.groupRegistry=e,this.parser=t,this.baseStyles=o,this.variants=s,this.statesConfig=i,this.activeGroups=p,this.custom=a}asComponent(r){const e=_(Y({...this.parser.config,...this.custom}),this.baseStyles,this.variants,this.statesConfig);return m(r)(e)}build(){return _(Y({...this.parser.config,...this.custom}),this.baseStyles,this.variants,this.statesConfig)}}class P extends M{constructor(r,e,t,o,s,i,p){super(r,e,t,o,s,i,p,{})}props(r){return new M(this.propRegistry,this.groupRegistry,this.parser,this.baseStyles,this.variants,this.statesConfig,this.activeGroups,r)}}class q extends P{constructor(r,e,t,o,s,i){super(r,e,t,o,s,i,{})}groups(r){return new P(this.propRegistry,this.groupRegistry,this.parser,this.baseStyles,this.variants,this.statesConfig,r)}}class J extends q{constructor(r,e,t,o,s){super(r,e,t,o,s,{})}states(r){return new q(this.propRegistry,this.groupRegistry,this.parser,this.baseStyles,this.variants,r)}variant(r){const e=r.prop||"variant";return new J(this.propRegistry,this.groupRegistry,this.parser,this.baseStyles,c(this.variants,{[e]:r}))}}class K extends J{constructor(r,e,t,o){super(r,e,t,o,{})}variant(r){const e=r.prop||"variant";return new J(this.propRegistry,this.groupRegistry,this.parser,this.baseStyles,c(this.variants,{[e]:r}))}}class U extends K{constructor(r,e){super(r,e,Y(r),{})}styles(r){return new K(this.propRegistry,this.groupRegistry,this.parser,r)}}class Z{#r={};#e={};constructor(r,e){this.#r=r||{},this.#e=e||{}}addGroup(r,e){const t={[r]:Object.keys(e)};return new Z({...this.#r,...e},{...this.#e,...t})}build(){const r=this.#r,e=this.#e;return new U(r,e)}}const rr=()=>new Z,er={border:{property:"border",scale:"borders",transform:k},borderX:{property:"border",properties:["borderLeft","borderRight"],scale:"borders",transform:k},borderY:{property:"border",properties:["borderTop","borderBottom"],scale:"borders",transform:k},borderTop:{property:"borderTop",scale:"borders",transform:k},borderRight:{property:"borderRight",scale:"borders",transform:k},borderBottom:{property:"borderBottom",scale:"borders",transform:k},borderLeft:{property:"borderLeft",scale:"borders",transform:k},borderWidth:{property:"borderWidth"},borderWidthX:{property:"borderWidth",properties:["borderLeftWidth","borderRightWidth"]},borderWidthY:{property:"borderWidth",properties:["borderTopWidth","borderBottomWidth"]},borderWidthLeft:{property:"borderLeftWidth"},borderWidthRight:{property:"borderRightWidth"},borderWidthTop:{property:"borderTopWidth"},borderWidthBottom:{property:"borderBottomWidth"},borderRadius:{property:"borderRadius",scale:"radii",transform:T},borderRadiusLeft:{property:"borderRadius",properties:["borderTopLeftRadius","borderBottomLeftRadius"],scale:"radii",transform:T},borderRadiusTop:{property:"borderRadius",properties:["borderTopLeftRadius","borderTopRightRadius"],scale:"radii",transform:T},borderRadiusBottom:{property:"borderRadius",properties:["borderBottomLeftRadius","borderBottomRightRadius"],scale:"radii",transform:T},borderRadiusRight:{property:"borderRadius",properties:["borderTopRightRadius","borderBottomRightRadius"],scale:"radii",transform:T},borderRadiusTopLeft:{property:"borderTopLeftRadius",scale:"radii",transform:T},borderRadiusTopRight:{property:"borderTopRightRadius",scale:"radii",transform:T},borderRadiusBottomRight:{property:"borderBottomRightRadius",scale:"radii",transform:T},borderRadiusBottomLeft:{property:"borderBottomLeftRadius",scale:"radii",transform:T},borderStyle:{property:"borderStyle"},borderStyleX:{property:"borderStyle",properties:["borderLeftStyle","borderRightStyle"]},borderStyleY:{property:"borderStyle",properties:["borderTopStyle","borderBottomStyle"]},borderStyleLeft:{property:"borderLeftStyle"},borderStyleRight:{property:"borderRightStyle"},borderStyleTop:{property:"borderTopStyle"},borderStyleBottom:{property:"borderBottomStyle"}},tr={gap:{property:"gap",scale:"spacing"},rowGap:{property:"rowGap",scale:"spacing"},columnGap:{property:"columnGap",scale:"spacing"}},or={justifySelf:{property:"justifySelf"},alignSelf:{property:"alignSelf"},gridArea:{property:"gridArea"},area:{property:"gridArea"}},sr={justifyContent:{property:"justifyContent"},justifyItems:{property:"justifyItems"},alignItems:{property:"alignItems"},alignContent:{property:"alignContent"},...or},ir={flexBasis:{property:"flexBasis"},flexShrink:{property:"flexShrink"},flexGrow:{property:"flexGrow"},order:{property:"order"}},pr={flexDirection:{property:"flexDirection"},flexWrap:{property:"flexWrap"},flex:{property:"flex"},...sr,...ir,...tr},ar={gridColumn:{property:"gridColumn"},gridRow:{property:"gridRow"},gridColumnStart:{property:"gridColumnStart"},gridRowStart:{property:"gridRowStart"},gridColumnEnd:{property:"gridColumnEnd"},gridRowEnd:{property:"gridRowEnd"}},nr={gridAutoColumns:{property:"gridAutoColumns"},gridAutoRows:{property:"gridAutoRows"},gridTemplateColumns:{property:"gridTemplateColumns"},gridTemplateRows:{property:"gridTemplateRows"},gridTemplateAreas:{property:"gridTemplateAreas"},gridAutoFlow:{property:"gridAutoFlow"},flow:{property:"gridAutoFlow",scale:[]},cols:{property:"gridTemplateColumns",transform:C,scale:[]},rows:{property:"gridTemplateRows",transform:C,scale:[]},autoRows:{property:"gridAutoRows",transform:S},autoCols:{property:"gridAutoColumns",transform:S},alignAll:{property:"justifyContent",properties:["justifyContent","alignItems"]},...sr,...ar,...tr},dr={position:{property:"position"},inset:{property:"inset",properties:["top","right","bottom","left"],transform:R},top:{property:"top",transform:R},right:{property:"right",transform:R},bottom:{property:"bottom",transform:R},left:{property:"left",transform:R},zIndex:{property:"zIndex"},opacity:{property:"opacity"}},cr={display:{property:"display"},overflow:{property:"overflow"},overflowX:{property:"overflowX"},overflowY:{property:"overflowY"},size:{property:"width",properties:["width","height"],transform:R},width:{property:"width",transform:R},minWidth:{property:"minWidth",transform:R},maxWidth:{property:"maxWidth",transform:R},height:{property:"height",transform:R},minHeight:{property:"minHeight",transform:R},maxHeight:{property:"maxHeight",transform:R},verticalAlign:{property:"verticalAlign"},...or,...ar,...ir},lr={m:{property:"margin",scale:"spacing"},mx:{property:"margin",properties:["marginLeft","marginRight"],scale:"spacing"},my:{property:"margin",properties:["marginTop","marginBottom"],scale:"spacing"},mt:{property:"marginTop",scale:"spacing"},mb:{property:"marginBottom",scale:"spacing"},mr:{property:"marginRight",scale:"spacing"},ml:{property:"marginLeft",scale:"spacing"},p:{property:"padding",scale:"spacing"},px:{property:"padding",properties:["paddingLeft","paddingRight"],scale:"spacing"},py:{property:"padding",properties:["paddingTop","paddingBottom"],scale:"spacing"},pt:{property:"paddingTop",scale:"spacing"},pb:{property:"paddingBottom",scale:"spacing"},pr:{property:"paddingRight",scale:"spacing"},pl:{property:"paddingLeft",scale:"spacing"}},ur=rr().addGroup("flex",pr).addGroup("grid",nr).addGroup("mode",{mode:{property:"none",scale:"mode"}}).addGroup("vars",{vars:{property:"variables"}}).addGroup("space",lr).addGroup("color",{color:{property:"color",scale:"colors"},textColor:{property:"color",scale:"colors"},bg:{property:"backgroundColor",scale:"colors"},borderColor:{property:"borderColor",scale:"colors"},borderColorX:{property:"borderColor",properties:["borderLeftColor","borderRightColor"],scale:"colors"},borderColorY:{property:"borderColor",properties:["borderTopColor","borderBottomColor"],scale:"colors"},borderColorLeft:{property:"borderLeftColor",scale:"colors"},borderColorRight:{property:"borderRightColor",scale:"colors"},borderColorTop:{property:"borderTopColor",scale:"colors"},borderColorBottom:{property:"borderBottomColor",scale:"colors"}}).addGroup("layout",cr).addGroup("borders",er).addGroup("shadows",{boxShadow:{property:"boxShadow"},textShadow:{property:"textShadow"}}).addGroup("background",{background:{property:"background"},backgroundImage:{property:"backgroundImage"},backgroundSize:{property:"backgroundSize"},backgroundRepeat:{property:"backgroundRepeat"},backgroundPosition:{property:"backgroundPosition"}}).addGroup("typography",{fontFamily:{property:"fontFamily",scale:"fontFamily"},fontWeight:{property:"fontWeight",scale:"fontWeight"},lineHeight:{property:"lineHeight",scale:"lineHeight",lineHeight:"lineHeight"},fontSize:{property:"fontSize",scale:"fontSize"},letterSpacing:{property:"letterSpacing"},textAlign:{property:"textAlign"},fontStyle:{property:"fontStyle"},textDecoration:{property:"textDecoration"},textTransform:{property:"textTransform"},whiteSpace:{property:"whiteSpace"}}).addGroup("positioning",dr);ur.build();const gr=(r,e)=>l(r,y(r).filter((r=>!e.includes(r)))),yr=["_","xs","sm","md","lg","xl"],mr=r=>`@media screen and (min-width: ${r}px)`,fr={xs:480,sm:768,md:1024,lg:1200,xl:1440},br=(r,t,o,s,i)=>{const p=e(o,t);switch(typeof p){case"string":case"number":case"function":return Object.assign(r,s.styleFn(p,t,o));case"object":if(!i.mediaQueries)return;if(a=p,Array.isArray(a))return c(r,((r,e,t,o)=>{const s={},{styleFn:i,prop:p}=t,[a,...n]=r;return a&&Object.assign(s,i(a,p,e)),n.forEach(((r,t)=>{const a=o[t];a&&void 0!==r&&Object.assign(s,{[a]:i(r,p,e)})})),s})(p,o,s,i.mediaQueries.array));if(p&&(r=>d(Object.keys(r),yr).length>0)(p))return c(r,((r,e,t,o)=>{const s={},{styleFn:i,prop:p}=t,{_:a,...n}=r;return a&&Object.assign(s,i(a,p,e)),Object.keys(o).forEach((r=>{const t=n[r];void 0!==t&&Object.assign(s,{[o[r]]:i(t,p,e)})})),s})(p,o,s,i.mediaQueries.map))}var a};function hr(r){const t=F(r),o={mediaQueries:null};return Object.assign(((s,i=!1)=>{const p={},{theme:d}=s;return null===o.mediaQueries&&(o.mediaQueries=(r=>{if(void 0===r)return null;const{xs:e,sm:t,md:o,lg:s,xl:i}=r??{};return{map:a(r,mr),array:[e,t,o,s,i].map(mr)}})(d?.breakpoints??fr)),i?Object.keys(s).forEach((t=>{const i=r[t];i?br(p,t,s,i,o):"theme"!==t&&Object.assign(p,{[t]:e(s,t)})})):t.forEach((e=>{const t=r[e];br(p,e,s,t,o)})),null!==o.mediaQueries?((r,e)=>{const t=n(r,e);return e.forEach((e=>{r[e]&&(t[e]=r[e])})),t})(p,o.mediaQueries.array):p}),{propNames:t,config:r})}function Rr(r,e){const{transform:o=p,property:s,properties:a=[s],scale:n,variable:d}=e,c=void 0===n||t(n);return{...e,prop:r,styleFn:(r,e,t)=>{const p={};if(i(r))return p;let l,u,g=!1;switch(typeof r){case"number":case"string":u=W(r,n,t.theme),g=void 0!==u||c,l=u??r;break;case"function":t.theme&&(l=r(t.theme));break;default:return p}if(a.forEach((r=>{let e=l;switch(g&&!i(e)&&(e=o(e,r,t)),typeof e){case"number":case"string":return p[r]=e;case"object":return Object.assign(p,e)}})),d){let r=l;g&&!i(r)&&(r=o(r,s,t)),r&&"object"!=typeof r&&(p[d]=r)}return p}}}function xr(r){const e={};for(const t in r)"string"==typeof t&&(e[t]=Rr(t,r[t]));return hr(e)}function wr(r){const e=xr(r),t=e.propNames;return r=>{let s;const i=Object.keys(r).filter((e=>!t.includes(e)&&o(r[e]))),p=gr(r,["theme",...i,...t]);return({theme:o})=>{if(s)return s;const a=e({...r,theme:o});return i.forEach((s=>{const i=r[s]??{};a[s]={...gr(i,t),...e({...i,theme:o})}})),s={...p,...a},s}}}const Sr={compose:function(...r){return hr(r.reduce(((r,e)=>({...r,...e.config})),{}))},create:xr,createCss:wr,createVariant:function(r){const e=wr(r);return({prop:r="variant",defaultVariant:t,base:o={},variants:s})=>{const i=e(o),p={};return Object.keys(s).forEach((r=>{const t=r,o=s[t];p[t]=e(o)})),e=>{const{[r]:o=t}=e,s={};return o?c(s,i(e),p?.[o]?.(e)):s}}},createStates:function(r){const e=wr(r);return r=>{const t=Object.keys(r),o={};return t.forEach((t=>{const s=t,i=r[s];o[s]=e(i)})),r=>{const e={};return t.forEach((t=>{c(e,r[t]&&o[t](r))})),e}}}},vr=ur.build();export{Z as AnimusConfig,vr as animus,Sr as animusProps,k as borderShorthand,E as compatTheme,ur as config,rr as createAnimus,f as createScale,S as gridItem,C as gridItemRatio,T as numberToPx,O as numberToTemplate,j as parseGridRatio,b as percentageOrAbsolute,v as repeatGridItem,R as size};
|