@animus-ui/core 0.1.1-beta.8 → 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.
@@ -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 declare type MapScale = Record<string | number, string | number>;
7
- export declare type ArrayScale = readonly (string | number | CSSObject)[] & {
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 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[]>;
29
- 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 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 declare type Scale<Config extends Prop> = ResponsiveProp<ScaleValue<Config> | ((theme: Theme) => ScaleValue<Config>)>;
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 declare type TransformerMap<Config extends Record<string, Prop>> = {
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 declare type Compose<Args extends AbstractParser[]> = {
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 declare type ParserProps<Config extends Record<string, AbstractPropTransformer>> = ThemeProps<{
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 declare type SystemProps<P extends AbstractParser> = {
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 declare type VariantProps<T extends string, V> = {
75
+ export type VariantProps<T extends string, V> = {
75
76
  [Key in T]?: V;
76
77
  };
77
- export declare type Arg<T extends (...args: any) => any> = Parameters<T>[0];
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;
@@ -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>;
@@ -2,7 +2,7 @@
2
2
  * Emotion will not attempt to forward all system props - so this pre filters all possible exceptions to search agains
3
3
  * props like `color` and `width`.
4
4
  */
5
- export declare type ForwardableProps<El extends keyof JSX.IntrinsicElements, Reserved> = Exclude<El extends keyof JSX.IntrinsicElements ? keyof JSX.IntrinsicElements[El] : keyof Element, Reserved>;
5
+ export type ForwardableProps<El extends keyof JSX.IntrinsicElements, Reserved> = Exclude<El extends keyof JSX.IntrinsicElements ? keyof JSX.IntrinsicElements[El] : keyof Element, Reserved>;
6
6
  /**
7
7
  * @description
8
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
@@ -14,7 +14,7 @@ export declare const createStyledOptions: <T extends Record<string, any>>(props:
14
14
  forward?: readonly Forward[] | undefined;
15
15
  filter?: readonly Filter[] | undefined;
16
16
  } | undefined) => {
17
- shouldForwardProp: (prop: PropertyKey) => prop is Forward | Exclude<El extends keyof JSX.IntrinsicElements ? keyof JSX.IntrinsicElements[El] : keyof Element, "mode" | "variant" | Filter | keyof T>;
17
+ shouldForwardProp: (prop: PropertyKey) => prop is Forward | Exclude<El extends keyof JSX.IntrinsicElements ? keyof JSX.IntrinsicElements[El] : keyof Element, Filter | keyof T | "variant" | "mode">;
18
18
  }) & {
19
- 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">;
20
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 const defaultBreakpoints: {
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, CSSObject } from '..';
3
- export declare const createPropertyStyle: <Config extends Prop, Value extends unknown>(value: Value, props: AbstractProps, config: Config) => CSSObject;
2
+ import { AbstractProps } from '../types/props';
3
+ import { CSSObject } from '../types/shared';
4
+ export declare const createPropertyStyle: <Config extends Prop, Value>(value: Value, props: AbstractProps, config: Config) => CSSObject;
@@ -1,2 +1,2 @@
1
1
  import { AbstractParser } from '../types/config';
2
- export declare const createStylist: (parser: AbstractParser, base?: Record<string, any>, variants?: Record<string, any>, states?: Record<string, any>, defaults?: Record<string, any>) => (props: any) => any;
2
+ export declare const createStylist: (parser: AbstractParser, base?: Record<string, any>, variants?: Record<string, any>, states?: Record<string, any>) => (props: any) => any;
@@ -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>;
@@ -1,10 +1,10 @@
1
1
  import { Theme } from '@emotion/react';
2
- import { CSSObject } from './shared';
2
+ import { CompatTheme } from '../compatTheme';
3
3
  import { DefaultCSSPropertyValue, PropertyTypes } from './properties';
4
- import { CSSProps, CSSPropMap, AbstractProps, ResponsiveProp, ThemeProps } from './props';
5
- import { Arg } from '..';
4
+ import { AbstractProps, ResponsiveProp, ThemeProps } from './props';
6
5
  import { ArrayScale, MapScale } from './scales';
7
- import { CompatTheme } from '../compatTheme';
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
- declare type IsEmpty<T> = [] extends T ? true : false | {} extends T ? true : false;
23
- export declare type PropertyValues<Property extends Prop, IncludeGlobals = false> = Exclude<PropertyTypes<IncludeGlobals extends true ? DefaultCSSPropertyValue : never>[Property['property']], IncludeGlobals extends true ? never : object | any[]>;
24
- declare type CompatValue<Key extends keyof CompatTheme> = CompatTheme[Key] extends MapScale ? keyof CompatTheme[Key] : CompatTheme[Key] extends ArrayScale ? CompatTheme[Key][number] : never;
25
- export declare type ScaleValue<Config extends Prop> = Config['scale'] extends keyof Theme ? keyof Theme[Config['scale']] | PropertyValues<Config, IsEmpty<Theme[Config['scale']]>> : Config['scale'] extends MapScale ? keyof Config['scale'] | PropertyValues<Config, IsEmpty<Config['scale']>> : Config['scale'] extends ArrayScale ? Config['scale'][number] | PropertyValues<Config, IsEmpty<Config['scale']>> : Config['scale'] extends keyof CompatTheme ? CompatValue<Config['scale']> | PropertyValues<Config, IsEmpty<CompatTheme[Config['scale']]>> : PropertyValues<Config, true>;
26
- export declare type Scale<Config extends Prop> = ResponsiveProp<ScaleValue<Config> | ((theme: Theme) => ScaleValue<Config>)>;
27
- export declare type ParserProps<Config extends Record<string, Prop>> = ThemeProps<{
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 declare type SystemProps<P extends AbstractParser, SafeProps = Omit<Arg<P>, 'theme'>> = {
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
- declare type ColorProperties = 'color' | `${string}Color`;
4
- declare type ColorGlobals = {
5
- [K in Extract<keyof StandardProperties, ColorProperties>]?: Globals | 'currentColor' | 'transparent' | NarrowPrimitive<string>;
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
- declare type SizeProperties = 'left' | 'right' | 'top' | 'bottom' | 'inset' | 'width' | 'height' | `${string}${'Width' | 'Height'}`;
8
- declare type SizeValues = `${number}${'px' | 'rem' | 'vh' | 'vw' | 'vmax' | 'vmin' | '%'}` | `calc(${any})`;
9
- declare type SizeGlobals = {
10
- [K in Extract<keyof StandardProperties, SizeProperties>]?: StandardProperties[K] | SizeValues | NarrowPrimitive<number>;
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 declare type DefaultCSSPropertyValue = (string & {}) | 0;
18
- export interface PropertyTypes<Overrides = DefaultCSSPropertyValue> extends Omit<StandardProperties<Overrides>, keyof ColorGlobals | keyof SizeGlobals>, ColorGlobals, SizeGlobals {
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 {};
@@ -1,7 +1,5 @@
1
1
  import { Theme } from '@emotion/react';
2
- import { AbstractParser, Scale } from '../legacy/config';
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 declare type ThemeProps<Props = {}> = Props & {
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 declare type ResponsiveProp<T> = T | MediaQueryMap<T> | MediaQueryArray<T>;
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 {};
@@ -1,2 +1,2 @@
1
- export declare type MapScale = Record<string | number, string | number>;
2
- export declare type ArrayScale = readonly (string | number)[];
1
+ export type MapScale = Record<string | number, string | number>;
2
+ export type ArrayScale = readonly (string | number)[];
@@ -1,4 +1,4 @@
1
1
  export interface CSSObject {
2
2
  [key: string]: string | number | CSSObject | undefined;
3
3
  }
4
- export declare type NarrowPrimitive<T> = T & {};
4
+ export type NarrowPrimitive<T> = T & {};
@@ -1,4 +1,4 @@
1
- export declare type Arg<T extends (...args: any) => any> = Parameters<T>[0];
2
- export declare type AllUnionKeys<T> = T extends any ? keyof T : never;
3
- export declare type KeyFromUnion<T, K> = T extends any ? K extends keyof T ? T[K] : never : never;
4
- export declare type Key<T> = T extends string ? T : never;
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-beta.8",
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
- "main": "dist/index.cjs.js",
14
- "module": "dist/index.esm.js",
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
  },
@@ -23,16 +23,18 @@
23
23
  "scripts": {
24
24
  "build:clean": "rm -rf ./dist",
25
25
  "build": "yarn build:clean && rollup -c",
26
- "lernaBuildTask": "yarn build"
26
+ "lernaBuildTask": "yarn build",
27
+ "compile": "tsc --noEmit"
27
28
  },
28
29
  "peerDependencies": {
29
- "@emotion/react": ">=11.0.0",
30
- "@emotion/styled": ">=11.0.0",
31
30
  "lodash": "*",
32
31
  "typescript": ">=4.3.5"
33
32
  },
34
33
  "dependencies": {
34
+ "@emotion/is-prop-valid": "^1.1.1",
35
+ "@emotion/react": "^11.0.0",
36
+ "@emotion/styled": "^11.0.0",
35
37
  "csstype": "^3.0.7"
36
38
  },
37
- "gitHead": "8ecdcfba58bd23efdd50b732cb72f234fa8739d2"
39
+ "gitHead": "c5e4903f345d7bbcdf5ee4da813147adcbd780a1"
38
40
  }
package/rollup.config.js CHANGED
@@ -1,3 +1,3 @@
1
- import config from '../../rollup.config';
1
+ const config = require('../../rollup.config');
2
2
 
3
- export default config();
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": ["../../typings/*.d.ts", "./src/**/*.ts", "./src/**/*.tsx"],
7
- "exclude": ["./**/*.test.tsx", "./**/*.test.ts"]
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={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},i=(e,t,o)=>{if(r.isArray(t))return e;if(r.isObject(t))return r.get(t,e);if(r.isString(t)){const i=r.get(o,t,r.get(s,t));if(!i)return;return r.isArray(i)?e:r.get(i,e)}},p=(e,t,o)=>{const s={},{transform:p=r.identity,property:n,properties:a=[n],scale:d,variable:c}=o,l=void 0===d||r.isArray(d);if(r.isUndefined(e))return s;let u,g,y=!1;switch(typeof e){case"number":case"string":g=i(e,d,t?.theme),y=void 0!==g||l,u=g??e;break;case"function":t.theme&&(u=e(t.theme));break;default:return s}if(a.forEach((e=>{let o=u;switch(y&&!r.isUndefined(o)&&(o=p(o,e,t)),typeof o){case"number":case"string":return s[e]=o;case"object":return Object.assign(s,o)}})),c){let e=u;y&&!r.isUndefined(e)&&(e=p(e,n,t)),e&&"object"!=typeof e&&(s[c]=e)}return s},n=["border","borderTop","borderBottom","borderLeft","borderRight","borderWidth","borderStyle","borderColor","background","flex","margin","padding","transition","gap","grid","gridArea","gridColumn","gridRow","gridTemplate","overflow","transition"],a=-1,d=1,c=1,l=(r,e)=>r<e?a:e<r?d:c,u=r=>Object.keys(r).sort(((e,t)=>{const{[e]:o,[t]:s}=r,{property:i,properties:p=[]}=o,{property:u,properties:g=[]}=s,y=n.includes(i),m=n.includes(u);if(y&&m){const r=p.length,e=g.length;if(i!==u)return l(n.indexOf(i),n.indexOf(u));if(i===u){if(0===r)return a;if(0===e)return d}return l(e,r)}return y?a:m?d:c})),g=["_","xs","sm","md","lg","xl"],y=r=>`@media screen and (min-width: ${r}px)`,m={xs:480,sm:768,md:1024,lg:1200,xl:1440},b=(e,t,o,s,i)=>{const n=r.get(o,t);switch(typeof n){case"string":case"number":case"function":return Object.assign(e,p(n,o,s));case"object":if(!i.mediaQueries)return;if(a=n,Array.isArray(a))return r.merge(e,((r,e,t,o)=>{const s={},[i,...n]=r;return i&&Object.assign(s,p(i,e,t)),n.forEach(((r,i)=>{const n=o[i];n&&void 0!==r&&Object.assign(s,{[n]:p(r,e,t)})})),s})(n,o,s,i.mediaQueries.array));if(n&&(e=>r.intersection(Object.keys(e),g).length>0)(n))return r.merge(e,((r,e,t,o)=>{const s={},{_:i,...n}=r;return i&&Object.assign(s,p(i,e,t)),Object.keys(o).forEach((r=>{const i=n[r];void 0!==i&&Object.assign(s,{[o[r]]:p(i,e,t)})})),s})(n,o,s,i.mediaQueries.map))}var a};function f(e){const t=u(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,y),array:[t,o,s,i,p].map(y)}})(n?.breakpoints??m)),i?Object.keys(s).forEach((t=>{const i=e[t];i?b(p,t,s,i,o):"theme"!==t&&Object.assign(p,{[t]:r.get(s,t)})})):t.forEach((r=>{const t=e[r];b(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 h=(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}},R=(r,e)=>{const t={},o={};return Object.entries(r).forEach((([r,s])=>{(e.includes(r)?o:t)[r]=s})),[t,o]},x=(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]=R(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]=R(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)}))},w=(e,t={},o={},s={},i={})=>{const p=((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),n={parser:e,getMediaSelectors:({theme:r})=>{const e=r?.breakpoints??m;return["xs","sm","md","lg","xl"].map((r=>e[r]))},getActiveOverrides:h(o,s)};return r=>{const{vars:t}=r,o={...t};return Object.entries(p).forEach((([e,t={}])=>{"primary"===e?x(o,t,r,n):(o[e]={},x(o[e],t,r,n))})),x(o,{base:e(r)},r,n),o}};class S{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=w(f({...this.parser.config,...this.custom}),this.baseStyles,this.variants,this.statesConfig,{});return t.default(r)(e)}build(){return w(f({...this.parser.config,...this.custom}),this.baseStyles,this.variants,this.statesConfig,{})}}class j extends S{constructor(r,e,t,o,s,i,p){super(r,e,t,o,s,i,p,{})}props(r){return new S(this.propRegistry,this.groupRegistry,this.parser,this.baseStyles,this.variants,this.statesConfig,this.activeGroups,r)}}class v extends j{constructor(r,e,t,o,s,i){super(r,e,t,o,s,i,{})}groups(r){return new j(this.propRegistry,this.groupRegistry,this.parser,this.baseStyles,this.variants,this.statesConfig,r)}}class C extends v{constructor(r,e,t,o,s){super(r,e,t,o,s,{})}states(r){return new v(this.propRegistry,this.groupRegistry,this.parser,this.baseStyles,this.variants,r)}variant(e){const t=e.prop||"variant";return new C(this.propRegistry,this.groupRegistry,this.parser,this.baseStyles,r.merge(this.variants,{[t]:e}))}}class O extends C{constructor(r,e,t,o){super(r,e,t,o,{})}variant(e){const t=e.prop||"variant";return new C(this.propRegistry,this.groupRegistry,this.parser,this.baseStyles,r.merge(this.variants,{[t]:e}))}}class T extends O{constructor(r,e){super(r,e,f(r),{})}styles(r){return new O(this.propRegistry,this.groupRegistry,this.parser,r)}}class k{#r={};#e={};constructor(r,e){this.#r=r||{},this.#e=e||{}}addGroup(r,e){const t={[r]:Object.keys(e)};return new k({...this.#r,...e},{...this.#e,...t})}build(){const r=this.#r,e=this.#e;return new T(r,e)}}const E=()=>new k,A=r=>0===r?r:r<=1&&r>=-1?100*r+"%":`${r}px`,W=/(-?\d*\.?\d+)(%|\w*)/,B=e=>{if(r.isNumber(e))return A(e);if(e.includes("calc"))return e;const[t,o,s]=W.exec(e)||[];if(void 0===t)return e;const i=parseFloat(o);return s?`${i}${s}`:A(i)},L={max:"max-content",min:"min-content"},G=new RegExp(/^[0-9]*$/),Q=e=>{var t;return`minmax(0, ${t=e,G.test(t)?`${e}fr`:r.get(L,e,e)})`},$=(r,e)=>{const t=Q(r);return e>1?`repeat(${e}, ${t})`:t},F=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+$(...t)),i&&(t=[i,1])):t[1]+=1}return o},I=e=>r.isNumber(e)?$("1",e):F(e),z=(r,e)=>"number"==typeof r?e(r):r,H=r=>z(r,(r=>`${r}px`)),N=r=>z(r,(r=>`${r}px solid currentColor`)),U=(e,t)=>r.pick(e,r.keys(e).filter((r=>!t.includes(r)))),V=["_","xs","sm","md","lg","xl"],X=r=>`@media screen and (min-width: ${r}px)`,Y={xs:480,sm:768,md:1024,lg:1200,xl:1440},_=(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),V).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 P(e){const t=u(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,X),array:[t,o,s,i,p].map(X)}})(n?.breakpoints??Y)),i?Object.keys(s).forEach((t=>{const i=e[t];i?_(p,t,s,i,o):"theme"!==t&&Object.assign(p,{[t]:r.get(s,t)})})):t.forEach((r=>{const t=e[r];_(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 D(e,t){const{transform:o=r.identity,property:s,properties:p=[s],scale:n,variable:a}=t,d=void 0===n||r.isArray(n);return{...t,prop:e,styleFn:(e,t,c)=>{const l={};if(r.isUndefined(e))return l;let u,g,y=!1;switch(typeof e){case"number":case"string":g=i(e,n,c.theme),y=void 0!==g||d,u=g??e;break;case"function":c.theme&&(u=e(c.theme));break;default:return l}if(p.forEach((e=>{let t=u;switch(y&&!r.isUndefined(t)&&(t=o(t,e,c)),typeof t){case"number":case"string":return l[e]=t;case"object":return Object.assign(l,t)}})),a){let e=u;y&&!r.isUndefined(e)&&(e=o(e,s,c)),e&&"object"!=typeof e&&(l[a]=e)}return l}}}function M(r){const e={};for(const t in r)"string"==typeof t&&(e[t]=D(t,r[t]));return P(e)}function q(e){const t=M(e),o=t.propNames;return e=>{let s;const i=Object.keys(e).filter((t=>!o.includes(t)&&r.isObject(e[t]))),p=U(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]={...U(i,o),...t({...i,theme:r})}})),s={...p,...n},s}}}const J={compose:function(...r){return P(r.reduce(((r,e)=>({...r,...e.config})),{}))},create:M,createCss:q,createVariant:function(e){const t=q(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=q(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}}}},K={border:{property:"border",scale:"borders",transform:N},borderX:{property:"border",properties:["borderLeft","borderRight"],scale:"borders",transform:N},borderY:{property:"border",properties:["borderTop","borderBottom"],scale:"borders",transform:N},borderTop:{property:"borderTop",scale:"borders",transform:N},borderRight:{property:"borderRight",scale:"borders",transform:N},borderBottom:{property:"borderBottom",scale:"borders",transform:N},borderLeft:{property:"borderLeft",scale:"borders",transform:N},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:H},borderRadiusLeft:{property:"borderRadius",properties:["borderTopLeftRadius","borderBottomLeftRadius"],scale:"radii",transform:H},borderRadiusTop:{property:"borderRadius",properties:["borderTopLeftRadius","borderTopRightRadius"],scale:"radii",transform:H},borderRadiusBottom:{property:"borderRadius",properties:["borderBottomLeftRadius","borderBottomRightRadius"],scale:"radii",transform:H},borderRadiusRight:{property:"borderRadius",properties:["borderTopRightRadius","borderBottomRightRadius"],scale:"radii",transform:H},borderRadiusTopLeft:{property:"borderTopLeftRadius",scale:"radii",transform:H},borderRadiusTopRight:{property:"borderTopRightRadius",scale:"radii",transform:H},borderRadiusBottomRight:{property:"borderBottomRightRadius",scale:"radii",transform:H},borderRadiusBottomLeft:{property:"borderBottomLeftRadius",scale:"radii",transform:H},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"}},Z={gap:{property:"gap",scale:"spacing"},rowGap:{property:"rowGap",scale:"spacing"},columnGap:{property:"columnGap",scale:"spacing"}},rr={justifySelf:{property:"justifySelf"},alignSelf:{property:"alignSelf"},gridArea:{property:"gridArea"},area:{property:"gridArea"}},er={justifyContent:{property:"justifyContent"},justifyItems:{property:"justifyItems"},alignItems:{property:"alignItems"},alignContent:{property:"alignContent"},...rr},tr={flexBasis:{property:"flexBasis"},flexShrink:{property:"flexShrink"},flexGrow:{property:"flexGrow"},order:{property:"order"}},or={flexDirection:{property:"flexDirection"},flexWrap:{property:"flexWrap"},flex:{property:"flex"},...er,...tr,...Z},sr={gridColumn:{property:"gridColumn"},gridRow:{property:"gridRow"},gridColumnStart:{property:"gridColumnStart"},gridRowStart:{property:"gridRowStart"},gridColumnEnd:{property:"gridColumnEnd"},gridRowEnd:{property:"gridRowEnd"}},ir={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:I,scale:[]},rows:{property:"gridTemplateRows",transform:I,scale:[]},autoRows:{property:"gridAutoRows",transform:Q},autoCols:{property:"gridAutoColumns",transform:Q},alignAll:{property:"justifyContent",properties:["justifyContent","alignItems"]},...er,...sr,...Z},pr={position:{property:"position"},inset:{property:"inset",properties:["top","right","bottom","left"],transform:B},top:{property:"top",transform:B},right:{property:"right",transform:B},bottom:{property:"bottom",transform:B},left:{property:"left",transform:B},zIndex:{property:"zIndex"},opacity:{property:"opacity"}},nr={display:{property:"display"},overflow:{property:"overflow"},overflowX:{property:"overflowX"},overflowY:{property:"overflowY"},size:{property:"width",properties:["width","height"],transform:B},width:{property:"width",transform:B},minWidth:{property:"minWidth",transform:B},maxWidth:{property:"maxWidth",transform:B},height:{property:"height",transform:B},minHeight:{property:"minHeight",transform:B},maxHeight:{property:"maxHeight",transform:B},verticalAlign:{property:"verticalAlign"},...rr,...sr,...tr},ar={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"}},dr=E().addGroup("flex",or).addGroup("grid",ir).addGroup("mode",{mode:{property:"none",scale:"mode"}}).addGroup("vars",{vars:{property:"variables"}}).addGroup("space",ar).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",nr).addGroup("borders",K).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",pr);dr.build();const cr=dr.build();exports.AnimusConfig=k,exports.animus=cr,exports.animusProps=J,exports.borderShorthand=N,exports.compatTheme=s,exports.config=dr,exports.createAnimus=E,exports.createScale=o,exports.gridItem=Q,exports.gridItemRatio=I,exports.numberToPx=H,exports.numberToTemplate=z,exports.parseGridRatio=F,exports.percentageOrAbsolute=A,exports.repeatGridItem=$,exports.size=B;
package/dist/index.esm.js DELETED
@@ -1 +0,0 @@
1
- import{isArray as r,isObject as e,get as t,isString as o,isUndefined as s,identity as i,mapValues as p,omit as a,intersection as n,merge as d,pick as c,isEmpty as l,set as u,isNumber as g,keys as y}from"lodash";import m from"@emotion/styled";const f=()=>[],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},h=(s,i,p)=>{if(r(i))return s;if(e(i))return t(i,s);if(o(i)){const e=t(p,i,t(b,i));if(!e)return;return r(e)?s:t(e,s)}},R=(e,t,o)=>{const p={},{transform:a=i,property:n,properties:d=[n],scale:c,variable:l}=o,u=void 0===c||r(c);if(s(e))return p;let g,y,m=!1;switch(typeof e){case"number":case"string":y=h(e,c,t?.theme),m=void 0!==y||u,g=y??e;break;case"function":t.theme&&(g=e(t.theme));break;default:return p}if(d.forEach((r=>{let e=g;switch(m&&!s(e)&&(e=a(e,r,t)),typeof e){case"number":case"string":return p[r]=e;case"object":return Object.assign(p,e)}})),l){let r=g;m&&!s(r)&&(r=a(r,n,t)),r&&"object"!=typeof r&&(p[l]=r)}return p},x=["border","borderTop","borderBottom","borderLeft","borderRight","borderWidth","borderStyle","borderColor","background","flex","margin","padding","transition","gap","grid","gridArea","gridColumn","gridRow","gridTemplate","overflow","transition"],w=-1,S=1,v=1,j=(r,e)=>r<e?w:e<r?S:v,C=r=>Object.keys(r).sort(((e,t)=>{const{[e]:o,[t]:s}=r,{property:i,properties:p=[]}=o,{property:a,properties:n=[]}=s,d=x.includes(i),c=x.includes(a);if(d&&c){const r=p.length,e=n.length;if(i!==a)return j(x.indexOf(i),x.indexOf(a));if(i===a){if(0===r)return w;if(0===e)return S}return j(e,r)}return d?w:c?S:v})),O=["_","xs","sm","md","lg","xl"],T=r=>`@media screen and (min-width: ${r}px)`,k={xs:480,sm:768,md:1024,lg:1200,xl:1440},E=(r,e,o,s,i)=>{const p=t(o,e);switch(typeof p){case"string":case"number":case"function":return Object.assign(r,R(p,o,s));case"object":if(!i.mediaQueries)return;if(a=p,Array.isArray(a))return d(r,((r,e,t,o)=>{const s={},[i,...p]=r;return i&&Object.assign(s,R(i,e,t)),p.forEach(((r,i)=>{const p=o[i];p&&void 0!==r&&Object.assign(s,{[p]:R(r,e,t)})})),s})(p,o,s,i.mediaQueries.array));if(p&&(r=>n(Object.keys(r),O).length>0)(p))return d(r,((r,e,t,o)=>{const s={},{_:i,...p}=r;return i&&Object.assign(s,R(i,e,t)),Object.keys(o).forEach((r=>{const i=p[r];void 0!==i&&Object.assign(s,{[o[r]]:R(i,e,t)})})),s})(p,o,s,i.mediaQueries.map))}var a};function W(r){const e=C(r),o={mediaQueries:null};return Object.assign(((s,i=!1)=>{const n={},{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:p(r,T),array:[e,t,o,s,i].map(T)}})(d?.breakpoints??k)),i?Object.keys(s).forEach((e=>{const i=r[e];i?E(n,e,s,i,o):"theme"!==e&&Object.assign(n,{[e]:t(s,e)})})):e.forEach((e=>{const t=r[e];E(n,e,s,t,o)})),null!==o.mediaQueries?((r,e)=>{const t=a(r,e);return e.forEach((e=>{r[e]&&(t[e]=r[e])})),t})(n,o.mediaQueries.array):n}),{propNames:e,config:r})}const B=(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}},L=(r,e)=>{const t={},o={};return Object.entries(r).forEach((([r,s])=>{(e.includes(r)?o:t)[r]=s})),[t,o]},A=(r,e,t,o)=>{const{base:s}=e,{parser:i,getMediaSelectors:p,getActiveOverrides:a}=o,{theme:n}=t,d=Object.values(c(e,a(t))),u=p(t),[g,y]=L(i({...s,theme:n},!0),u);for(const e in g)r[e]=g[e];d.forEach((e=>{((r={},e,t,o,s,i)=>{const[p,a]=L(o({...r,theme:s},!0),i);for(const r in p)e[r]=p[r];i.forEach((r=>{const e=a[r];if(!e||l(e))return;t[r]||(t[r]={});const o=t[r];for(const r in e)o[r]=e[r]}))})(e,r,y,i,n,u)})),u.forEach((e=>{const t=y[e];l(t)||(r[e]=t)}))},G=(r,t={},o={},s={},i={})=>{const p=((r={},t={},o={},s)=>{const i={};return Object.entries(r).forEach((([r,t])=>{!s.includes(r)&&e(t)?u(i,[r,"base"],t):u(i,["primary","base",r],t)})),Object.entries(t).forEach((([r,{variants:t}])=>{Object.entries(t).forEach((([t,o])=>{const p=`${r}-${t}`;Object.entries(o).forEach((([r,t])=>{!s.includes(r)&&e(t)?u(i,[r,p],t):u(i,["primary",p,r],t)}))}))})),Object.entries(o).forEach((([r,t])=>{Object.entries(t).forEach((([t,o])=>{!s.includes(t)&&e(o)?u(i,[t,r],o):u(i,["primary",r,t],o)}))})),i})(t,o,s,r.propNames),a={parser:r,getMediaSelectors:({theme:r})=>{const e=r?.breakpoints??k;return["xs","sm","md","lg","xl"].map((r=>e[r]))},getActiveOverrides:B(o,s)};return e=>{const{vars:t}=e,o={...t};return Object.entries(p).forEach((([r,t={}])=>{"primary"===r?A(o,t,e,a):(o[r]={},A(o[r],t,e,a))})),A(o,{base:r(e)},e,a),o}};class Q{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=G(W({...this.parser.config,...this.custom}),this.baseStyles,this.variants,this.statesConfig,{});return m(r)(e)}build(){return G(W({...this.parser.config,...this.custom}),this.baseStyles,this.variants,this.statesConfig,{})}}class $ extends Q{constructor(r,e,t,o,s,i,p){super(r,e,t,o,s,i,p,{})}props(r){return new Q(this.propRegistry,this.groupRegistry,this.parser,this.baseStyles,this.variants,this.statesConfig,this.activeGroups,r)}}class F extends ${constructor(r,e,t,o,s,i){super(r,e,t,o,s,i,{})}groups(r){return new $(this.propRegistry,this.groupRegistry,this.parser,this.baseStyles,this.variants,this.statesConfig,r)}}class H extends F{constructor(r,e,t,o,s){super(r,e,t,o,s,{})}states(r){return new F(this.propRegistry,this.groupRegistry,this.parser,this.baseStyles,this.variants,r)}variant(r){const e=r.prop||"variant";return new H(this.propRegistry,this.groupRegistry,this.parser,this.baseStyles,d(this.variants,{[e]:r}))}}class z extends H{constructor(r,e,t,o){super(r,e,t,o,{})}variant(r){const e=r.prop||"variant";return new H(this.propRegistry,this.groupRegistry,this.parser,this.baseStyles,d(this.variants,{[e]:r}))}}class I extends z{constructor(r,e){super(r,e,W(r),{})}styles(r){return new z(this.propRegistry,this.groupRegistry,this.parser,r)}}class X{#r={};#e={};constructor(r,e){this.#r=r||{},this.#e=e||{}}addGroup(r,e){const t={[r]:Object.keys(e)};return new X({...this.#r,...e},{...this.#e,...t})}build(){const r=this.#r,e=this.#e;return new I(r,e)}}const Y=()=>new X,D=r=>0===r?r:r<=1&&r>=-1?100*r+"%":`${r}px`,N=/(-?\d*\.?\d+)(%|\w*)/,V=r=>{if(g(r))return D(r);if(r.includes("calc"))return r;const[e,t,o]=N.exec(r)||[];if(void 0===e)return r;const s=parseFloat(t);return o?`${s}${o}`:D(s)},_={max:"max-content",min:"min-content"},M=new RegExp(/^[0-9]*$/),P=r=>{var e;return`minmax(0, ${e=r,M.test(e)?`${r}fr`:t(_,r,r)})`},q=(r,e)=>{const t=P(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+q(...t)),i&&(t=[i,1])):t[1]+=1}return o},K=r=>g(r)?q("1",r):J(r),U=(r,e)=>"number"==typeof r?e(r):r,Z=r=>U(r,(r=>`${r}px`)),rr=r=>U(r,(r=>`${r}px solid currentColor`)),er=(r,e)=>c(r,y(r).filter((r=>!e.includes(r)))),tr=["_","xs","sm","md","lg","xl"],or=r=>`@media screen and (min-width: ${r}px)`,sr={xs:480,sm:768,md:1024,lg:1200,xl:1440},ir=(r,e,o,s,i)=>{const p=t(o,e);switch(typeof p){case"string":case"number":case"function":return Object.assign(r,s.styleFn(p,e,o));case"object":if(!i.mediaQueries)return;if(a=p,Array.isArray(a))return d(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=>n(Object.keys(r),tr).length>0)(p))return d(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 pr(r){const e=C(r),o={mediaQueries:null};return Object.assign(((s,i=!1)=>{const n={},{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:p(r,or),array:[e,t,o,s,i].map(or)}})(d?.breakpoints??sr)),i?Object.keys(s).forEach((e=>{const i=r[e];i?ir(n,e,s,i,o):"theme"!==e&&Object.assign(n,{[e]:t(s,e)})})):e.forEach((e=>{const t=r[e];ir(n,e,s,t,o)})),null!==o.mediaQueries?((r,e)=>{const t=a(r,e);return e.forEach((e=>{r[e]&&(t[e]=r[e])})),t})(n,o.mediaQueries.array):n}),{propNames:e,config:r})}function ar(e,t){const{transform:o=i,property:p,properties:a=[p],scale:n,variable:d}=t,c=void 0===n||r(n);return{...t,prop:e,styleFn:(r,e,t)=>{const i={};if(s(r))return i;let l,u,g=!1;switch(typeof r){case"number":case"string":u=h(r,n,t.theme),g=void 0!==u||c,l=u??r;break;case"function":t.theme&&(l=r(t.theme));break;default:return i}if(a.forEach((r=>{let e=l;switch(g&&!s(e)&&(e=o(e,r,t)),typeof e){case"number":case"string":return i[r]=e;case"object":return Object.assign(i,e)}})),d){let r=l;g&&!s(r)&&(r=o(r,p,t)),r&&"object"!=typeof r&&(i[d]=r)}return i}}}function nr(r){const e={};for(const t in r)"string"==typeof t&&(e[t]=ar(t,r[t]));return pr(e)}function dr(r){const t=nr(r),o=t.propNames;return r=>{let s;const i=Object.keys(r).filter((t=>!o.includes(t)&&e(r[t]))),p=er(r,["theme",...i,...o]);return({theme:e})=>{if(s)return s;const a=t({...r,theme:e});return i.forEach((s=>{const i=r[s]??{};a[s]={...er(i,o),...t({...i,theme:e})}})),s={...p,...a},s}}}const cr={compose:function(...r){return pr(r.reduce(((r,e)=>({...r,...e.config})),{}))},create:nr,createCss:dr,createVariant:function(r){const e=dr(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?d(s,i(e),p?.[o]?.(e)):s}}},createStates:function(r){const e=dr(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=>{d(e,r[t]&&o[t](r))})),e}}}},lr={border:{property:"border",scale:"borders",transform:rr},borderX:{property:"border",properties:["borderLeft","borderRight"],scale:"borders",transform:rr},borderY:{property:"border",properties:["borderTop","borderBottom"],scale:"borders",transform:rr},borderTop:{property:"borderTop",scale:"borders",transform:rr},borderRight:{property:"borderRight",scale:"borders",transform:rr},borderBottom:{property:"borderBottom",scale:"borders",transform:rr},borderLeft:{property:"borderLeft",scale:"borders",transform:rr},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:Z},borderRadiusLeft:{property:"borderRadius",properties:["borderTopLeftRadius","borderBottomLeftRadius"],scale:"radii",transform:Z},borderRadiusTop:{property:"borderRadius",properties:["borderTopLeftRadius","borderTopRightRadius"],scale:"radii",transform:Z},borderRadiusBottom:{property:"borderRadius",properties:["borderBottomLeftRadius","borderBottomRightRadius"],scale:"radii",transform:Z},borderRadiusRight:{property:"borderRadius",properties:["borderTopRightRadius","borderBottomRightRadius"],scale:"radii",transform:Z},borderRadiusTopLeft:{property:"borderTopLeftRadius",scale:"radii",transform:Z},borderRadiusTopRight:{property:"borderTopRightRadius",scale:"radii",transform:Z},borderRadiusBottomRight:{property:"borderBottomRightRadius",scale:"radii",transform:Z},borderRadiusBottomLeft:{property:"borderBottomLeftRadius",scale:"radii",transform:Z},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"}},ur={gap:{property:"gap",scale:"spacing"},rowGap:{property:"rowGap",scale:"spacing"},columnGap:{property:"columnGap",scale:"spacing"}},gr={justifySelf:{property:"justifySelf"},alignSelf:{property:"alignSelf"},gridArea:{property:"gridArea"},area:{property:"gridArea"}},yr={justifyContent:{property:"justifyContent"},justifyItems:{property:"justifyItems"},alignItems:{property:"alignItems"},alignContent:{property:"alignContent"},...gr},mr={flexBasis:{property:"flexBasis"},flexShrink:{property:"flexShrink"},flexGrow:{property:"flexGrow"},order:{property:"order"}},fr={flexDirection:{property:"flexDirection"},flexWrap:{property:"flexWrap"},flex:{property:"flex"},...yr,...mr,...ur},br={gridColumn:{property:"gridColumn"},gridRow:{property:"gridRow"},gridColumnStart:{property:"gridColumnStart"},gridRowStart:{property:"gridRowStart"},gridColumnEnd:{property:"gridColumnEnd"},gridRowEnd:{property:"gridRowEnd"}},hr={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:K,scale:[]},rows:{property:"gridTemplateRows",transform:K,scale:[]},autoRows:{property:"gridAutoRows",transform:P},autoCols:{property:"gridAutoColumns",transform:P},alignAll:{property:"justifyContent",properties:["justifyContent","alignItems"]},...yr,...br,...ur},Rr={position:{property:"position"},inset:{property:"inset",properties:["top","right","bottom","left"],transform:V},top:{property:"top",transform:V},right:{property:"right",transform:V},bottom:{property:"bottom",transform:V},left:{property:"left",transform:V},zIndex:{property:"zIndex"},opacity:{property:"opacity"}},xr={display:{property:"display"},overflow:{property:"overflow"},overflowX:{property:"overflowX"},overflowY:{property:"overflowY"},size:{property:"width",properties:["width","height"],transform:V},width:{property:"width",transform:V},minWidth:{property:"minWidth",transform:V},maxWidth:{property:"maxWidth",transform:V},height:{property:"height",transform:V},minHeight:{property:"minHeight",transform:V},maxHeight:{property:"maxHeight",transform:V},verticalAlign:{property:"verticalAlign"},...gr,...br,...mr},wr={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"}},Sr=Y().addGroup("flex",fr).addGroup("grid",hr).addGroup("mode",{mode:{property:"none",scale:"mode"}}).addGroup("vars",{vars:{property:"variables"}}).addGroup("space",wr).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",xr).addGroup("borders",lr).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",Rr);Sr.build();const vr=Sr.build();export{X as AnimusConfig,vr as animus,cr as animusProps,rr as borderShorthand,b as compatTheme,Sr as config,Y as createAnimus,f as createScale,P as gridItem,K as gridItemRatio,Z as numberToPx,U as numberToTemplate,J as parseGridRatio,D as percentageOrAbsolute,q as repeatGridItem,V as size};