@animus-ui/core 0.1.1-beta.9 → 0.1.1-e4cdacd2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/dist/Animus.d.ts +2 -2
- package/dist/compatTheme.d.ts +7 -0
- package/dist/index.js +1229 -0
- package/dist/legacy/config.d.ts +2 -1
- package/dist/legacy/createParser.d.ts +0 -7
- package/dist/properties/styledOptions.d.ts +2 -2
- package/dist/styles/createParser.d.ts +0 -7
- package/dist/styles/createPropertyStyle.d.ts +2 -1
- package/dist/types/config.d.ts +9 -3
- package/dist/types/props.d.ts +0 -9
- package/package.json +4 -4
- package/dist/index.cjs.js +0 -1
- package/dist/index.esm.js +0 -1
package/dist/legacy/config.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Theme } from '@emotion/react';
|
|
2
2
|
import { DefaultCSSPropertyValue, PropertyTypes } from '../types/properties';
|
|
3
3
|
import { CSSObject } from '../types/shared';
|
|
4
|
-
import { AbstractProps,
|
|
4
|
+
import { AbstractProps, ResponsiveProp, ThemeProps } from '../types/props';
|
|
5
|
+
import { CSSPropMap, CSSProps } from '../types/config';
|
|
5
6
|
import { AllUnionKeys, Key, KeyFromUnion } from '../types/utils';
|
|
6
7
|
export declare type MapScale = Record<string | number, string | number>;
|
|
7
8
|
export declare type ArrayScale = readonly (string | number | CSSObject)[] & {
|
|
@@ -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>;
|
|
@@ -15,7 +15,7 @@ export declare const createStyledOptions: <T extends Record<string, any>>(props:
|
|
|
15
15
|
forward?: readonly Forward[] | undefined;
|
|
16
16
|
filter?: readonly Filter[] | undefined;
|
|
17
17
|
} | undefined) => {
|
|
18
|
-
shouldForwardProp: (prop: PropertyKey) => prop is Forward | Exclude<El extends keyof JSX.IntrinsicElements ? keyof JSX.IntrinsicElements[El] : keyof Element, "
|
|
18
|
+
shouldForwardProp: (prop: PropertyKey) => prop is Forward | Exclude<El extends keyof JSX.IntrinsicElements ? keyof JSX.IntrinsicElements[El] : keyof Element, "variant" | Filter | keyof T | "mode">;
|
|
19
19
|
}) & {
|
|
20
|
-
shouldForwardProp: (prop: PropertyKey) => prop is Exclude<"ref", "mode" | "variant" | keyof T> | Exclude<"key", "mode" | "variant" | keyof T> | Exclude<"color", "mode" | "variant" | keyof T> | Exclude<"translate", "mode" | "variant" | keyof T> | Exclude<"property", "mode" | "variant" | keyof T> | Exclude<"hidden", "mode" | "variant" | keyof T> | Exclude<"style", "mode" | "variant" | keyof T> | Exclude<"slot", "mode" | "variant" | keyof T> | Exclude<"title", "mode" | "variant" | keyof T> | Exclude<"className", "mode" | "variant" | keyof T> | Exclude<"id", "mode" | "variant" | keyof T> | Exclude<"prefix", "mode" | "variant" | keyof T> | Exclude<"children", "mode" | "variant" | keyof T> | Exclude<"lang", "mode" | "variant" | keyof T> | Exclude<"role", "mode" | "variant" | keyof T> | Exclude<"tabIndex", "mode" | "variant" | keyof T> | Exclude<"aria-activedescendant", "mode" | "variant" | keyof T> | Exclude<"aria-atomic", "mode" | "variant" | keyof T> | Exclude<"aria-autocomplete", "mode" | "variant" | keyof T> | Exclude<"aria-busy", "mode" | "variant" | keyof T> | Exclude<"aria-checked", "mode" | "variant" | keyof T> | Exclude<"aria-colcount", "mode" | "variant" | keyof T> | Exclude<"aria-colindex", "mode" | "variant" | keyof T> | Exclude<"aria-colspan", "mode" | "variant" | keyof T> | Exclude<"aria-controls", "mode" | "variant" | keyof T> | Exclude<"aria-current", "mode" | "variant" | keyof T> | Exclude<"aria-describedby", "mode" | "variant" | keyof T> | Exclude<"aria-details", "mode" | "variant" | keyof T> | Exclude<"aria-disabled", "mode" | "variant" | keyof T> | Exclude<"aria-dropeffect", "mode" | "variant" | keyof T> | Exclude<"aria-errormessage", "mode" | "variant" | keyof T> | Exclude<"aria-expanded", "mode" | "variant" | keyof T> | Exclude<"aria-flowto", "mode" | "variant" | keyof T> | Exclude<"aria-grabbed", "mode" | "variant" | keyof T> | Exclude<"aria-haspopup", "mode" | "variant" | keyof T> | Exclude<"aria-hidden", "mode" | "variant" | keyof T> | Exclude<"aria-invalid", "mode" | "variant" | keyof T> | Exclude<"aria-keyshortcuts", "mode" | "variant" | keyof T> | Exclude<"aria-label", "mode" | "variant" | keyof T> | Exclude<"aria-labelledby", "mode" | "variant" | keyof T> | Exclude<"aria-level", "mode" | "variant" | keyof T> | Exclude<"aria-live", "mode" | "variant" | keyof T> | Exclude<"aria-modal", "mode" | "variant" | keyof T> | Exclude<"aria-multiline", "mode" | "variant" | keyof T> | Exclude<"aria-multiselectable", "mode" | "variant" | keyof T> | Exclude<"aria-orientation", "mode" | "variant" | keyof T> | Exclude<"aria-owns", "mode" | "variant" | keyof T> | Exclude<"aria-placeholder", "mode" | "variant" | keyof T> | Exclude<"aria-posinset", "mode" | "variant" | keyof T> | Exclude<"aria-pressed", "mode" | "variant" | keyof T> | Exclude<"aria-readonly", "mode" | "variant" | keyof T> | Exclude<"aria-relevant", "mode" | "variant" | keyof T> | Exclude<"aria-required", "mode" | "variant" | keyof T> | Exclude<"aria-roledescription", "mode" | "variant" | keyof T> | Exclude<"aria-rowcount", "mode" | "variant" | keyof T> | Exclude<"aria-rowindex", "mode" | "variant" | keyof T> | Exclude<"aria-rowspan", "mode" | "variant" | keyof T> | Exclude<"aria-selected", "mode" | "variant" | keyof T> | Exclude<"aria-setsize", "mode" | "variant" | keyof T> | Exclude<"aria-sort", "mode" | "variant" | keyof T> | Exclude<"aria-valuemax", "mode" | "variant" | keyof T> | Exclude<"aria-valuemin", "mode" | "variant" | keyof T> | Exclude<"aria-valuenow", "mode" | "variant" | keyof T> | Exclude<"aria-valuetext", "mode" | "variant" | keyof T> | Exclude<"dangerouslySetInnerHTML", "mode" | "variant" | keyof T> | Exclude<"onCopy", "mode" | "variant" | keyof T> | Exclude<"onCopyCapture", "mode" | "variant" | keyof T> | Exclude<"onCut", "mode" | "variant" | keyof T> | Exclude<"onCutCapture", "mode" | "variant" | keyof T> | Exclude<"onPaste", "mode" | "variant" | keyof T> | Exclude<"onPasteCapture", "mode" | "variant" | keyof T> | Exclude<"onCompositionEnd", "mode" | "variant" | keyof T> | Exclude<"onCompositionEndCapture", "mode" | "variant" | keyof T> | Exclude<"onCompositionStart", "mode" | "variant" | keyof T> | Exclude<"onCompositionStartCapture", "mode" | "variant" | keyof T> | Exclude<"onCompositionUpdate", "mode" | "variant" | keyof T> | Exclude<"onCompositionUpdateCapture", "mode" | "variant" | keyof T> | Exclude<"onFocus", "mode" | "variant" | keyof T> | Exclude<"onFocusCapture", "mode" | "variant" | keyof T> | Exclude<"onBlur", "mode" | "variant" | keyof T> | Exclude<"onBlurCapture", "mode" | "variant" | keyof T> | Exclude<"onChange", "mode" | "variant" | keyof T> | Exclude<"onChangeCapture", "mode" | "variant" | keyof T> | Exclude<"onBeforeInput", "mode" | "variant" | keyof T> | Exclude<"onBeforeInputCapture", "mode" | "variant" | keyof T> | Exclude<"onInput", "mode" | "variant" | keyof T> | Exclude<"onInputCapture", "mode" | "variant" | keyof T> | Exclude<"onReset", "mode" | "variant" | keyof T> | Exclude<"onResetCapture", "mode" | "variant" | keyof T> | Exclude<"onSubmit", "mode" | "variant" | keyof T> | Exclude<"onSubmitCapture", "mode" | "variant" | keyof T> | Exclude<"onInvalid", "mode" | "variant" | keyof T> | Exclude<"onInvalidCapture", "mode" | "variant" | keyof T> | Exclude<"onLoad", "mode" | "variant" | keyof T> | Exclude<"onLoadCapture", "mode" | "variant" | keyof T> | Exclude<"onError", "mode" | "variant" | keyof T> | Exclude<"onErrorCapture", "mode" | "variant" | keyof T> | Exclude<"onKeyDown", "mode" | "variant" | keyof T> | Exclude<"onKeyDownCapture", "mode" | "variant" | keyof T> | Exclude<"onKeyPress", "mode" | "variant" | keyof T> | Exclude<"onKeyPressCapture", "mode" | "variant" | keyof T> | Exclude<"onKeyUp", "mode" | "variant" | keyof T> | Exclude<"onKeyUpCapture", "mode" | "variant" | keyof T> | Exclude<"onAbort", "mode" | "variant" | keyof T> | Exclude<"onAbortCapture", "mode" | "variant" | keyof T> | Exclude<"onCanPlay", "mode" | "variant" | keyof T> | Exclude<"onCanPlayCapture", "mode" | "variant" | keyof T> | Exclude<"onCanPlayThrough", "mode" | "variant" | keyof T> | Exclude<"onCanPlayThroughCapture", "mode" | "variant" | keyof T> | Exclude<"onDurationChange", "mode" | "variant" | keyof T> | Exclude<"onDurationChangeCapture", "mode" | "variant" | keyof T> | Exclude<"onEmptied", "mode" | "variant" | keyof T> | Exclude<"onEmptiedCapture", "mode" | "variant" | keyof T> | Exclude<"onEncrypted", "mode" | "variant" | keyof T> | Exclude<"onEncryptedCapture", "mode" | "variant" | keyof T> | Exclude<"onEnded", "mode" | "variant" | keyof T> | Exclude<"onEndedCapture", "mode" | "variant" | keyof T> | Exclude<"onLoadedData", "mode" | "variant" | keyof T> | Exclude<"onLoadedDataCapture", "mode" | "variant" | keyof T> | Exclude<"onLoadedMetadata", "mode" | "variant" | keyof T> | Exclude<"onLoadedMetadataCapture", "mode" | "variant" | keyof T> | Exclude<"onLoadStart", "mode" | "variant" | keyof T> | Exclude<"onLoadStartCapture", "mode" | "variant" | keyof T> | Exclude<"onPause", "mode" | "variant" | keyof T> | Exclude<"onPauseCapture", "mode" | "variant" | keyof T> | Exclude<"onPlay", "mode" | "variant" | keyof T> | Exclude<"onPlayCapture", "mode" | "variant" | keyof T> | Exclude<"onPlaying", "mode" | "variant" | keyof T> | Exclude<"onPlayingCapture", "mode" | "variant" | keyof T> | Exclude<"onProgress", "mode" | "variant" | keyof T> | Exclude<"onProgressCapture", "mode" | "variant" | keyof T> | Exclude<"onRateChange", "mode" | "variant" | keyof T> | Exclude<"onRateChangeCapture", "mode" | "variant" | keyof T> | Exclude<"onSeeked", "mode" | "variant" | keyof T> | Exclude<"onSeekedCapture", "mode" | "variant" | keyof T> | Exclude<"onSeeking", "mode" | "variant" | keyof T> | Exclude<"onSeekingCapture", "mode" | "variant" | keyof T> | Exclude<"onStalled", "mode" | "variant" | keyof T> | Exclude<"onStalledCapture", "mode" | "variant" | keyof T> | Exclude<"onSuspend", "mode" | "variant" | keyof T> | Exclude<"onSuspendCapture", "mode" | "variant" | keyof T> | Exclude<"onTimeUpdate", "mode" | "variant" | keyof T> | Exclude<"onTimeUpdateCapture", "mode" | "variant" | keyof T> | Exclude<"onVolumeChange", "mode" | "variant" | keyof T> | Exclude<"onVolumeChangeCapture", "mode" | "variant" | keyof T> | Exclude<"onWaiting", "mode" | "variant" | keyof T> | Exclude<"onWaitingCapture", "mode" | "variant" | keyof T> | Exclude<"onAuxClick", "mode" | "variant" | keyof T> | Exclude<"onAuxClickCapture", "mode" | "variant" | keyof T> | Exclude<"onClick", "mode" | "variant" | keyof T> | Exclude<"onClickCapture", "mode" | "variant" | keyof T> | Exclude<"onContextMenu", "mode" | "variant" | keyof T> | Exclude<"onContextMenuCapture", "mode" | "variant" | keyof T> | Exclude<"onDoubleClick", "mode" | "variant" | keyof T> | Exclude<"onDoubleClickCapture", "mode" | "variant" | keyof T> | Exclude<"onDrag", "mode" | "variant" | keyof T> | Exclude<"onDragCapture", "mode" | "variant" | keyof T> | Exclude<"onDragEnd", "mode" | "variant" | keyof T> | Exclude<"onDragEndCapture", "mode" | "variant" | keyof T> | Exclude<"onDragEnter", "mode" | "variant" | keyof T> | Exclude<"onDragEnterCapture", "mode" | "variant" | keyof T> | Exclude<"onDragExit", "mode" | "variant" | keyof T> | Exclude<"onDragExitCapture", "mode" | "variant" | keyof T> | Exclude<"onDragLeave", "mode" | "variant" | keyof T> | Exclude<"onDragLeaveCapture", "mode" | "variant" | keyof T> | Exclude<"onDragOver", "mode" | "variant" | keyof T> | Exclude<"onDragOverCapture", "mode" | "variant" | keyof T> | Exclude<"onDragStart", "mode" | "variant" | keyof T> | Exclude<"onDragStartCapture", "mode" | "variant" | keyof T> | Exclude<"onDrop", "mode" | "variant" | keyof T> | Exclude<"onDropCapture", "mode" | "variant" | keyof T> | Exclude<"onMouseDown", "mode" | "variant" | keyof T> | Exclude<"onMouseDownCapture", "mode" | "variant" | keyof T> | Exclude<"onMouseEnter", "mode" | "variant" | keyof T> | Exclude<"onMouseLeave", "mode" | "variant" | keyof T> | Exclude<"onMouseMove", "mode" | "variant" | keyof T> | Exclude<"onMouseMoveCapture", "mode" | "variant" | keyof T> | Exclude<"onMouseOut", "mode" | "variant" | keyof T> | Exclude<"onMouseOutCapture", "mode" | "variant" | keyof T> | Exclude<"onMouseOver", "mode" | "variant" | keyof T> | Exclude<"onMouseOverCapture", "mode" | "variant" | keyof T> | Exclude<"onMouseUp", "mode" | "variant" | keyof T> | Exclude<"onMouseUpCapture", "mode" | "variant" | keyof T> | Exclude<"onSelect", "mode" | "variant" | keyof T> | Exclude<"onSelectCapture", "mode" | "variant" | keyof T> | Exclude<"onTouchCancel", "mode" | "variant" | keyof T> | Exclude<"onTouchCancelCapture", "mode" | "variant" | keyof T> | Exclude<"onTouchEnd", "mode" | "variant" | keyof T> | Exclude<"onTouchEndCapture", "mode" | "variant" | keyof T> | Exclude<"onTouchMove", "mode" | "variant" | keyof T> | Exclude<"onTouchMoveCapture", "mode" | "variant" | keyof T> | Exclude<"onTouchStart", "mode" | "variant" | keyof T> | Exclude<"onTouchStartCapture", "mode" | "variant" | keyof T> | Exclude<"onPointerDown", "mode" | "variant" | keyof T> | Exclude<"onPointerDownCapture", "mode" | "variant" | keyof T> | Exclude<"onPointerMove", "mode" | "variant" | keyof T> | Exclude<"onPointerMoveCapture", "mode" | "variant" | keyof T> | Exclude<"onPointerUp", "mode" | "variant" | keyof T> | Exclude<"onPointerUpCapture", "mode" | "variant" | keyof T> | Exclude<"onPointerCancel", "mode" | "variant" | keyof T> | Exclude<"onPointerCancelCapture", "mode" | "variant" | keyof T> | Exclude<"onPointerEnter", "mode" | "variant" | keyof T> | Exclude<"onPointerEnterCapture", "mode" | "variant" | keyof T> | Exclude<"onPointerLeave", "mode" | "variant" | keyof T> | Exclude<"onPointerLeaveCapture", "mode" | "variant" | keyof T> | Exclude<"onPointerOver", "mode" | "variant" | keyof T> | Exclude<"onPointerOverCapture", "mode" | "variant" | keyof T> | Exclude<"onPointerOut", "mode" | "variant" | keyof T> | Exclude<"onPointerOutCapture", "mode" | "variant" | keyof T> | Exclude<"onGotPointerCapture", "mode" | "variant" | keyof T> | Exclude<"onGotPointerCaptureCapture", "mode" | "variant" | keyof T> | Exclude<"onLostPointerCapture", "mode" | "variant" | keyof T> | Exclude<"onLostPointerCaptureCapture", "mode" | "variant" | keyof T> | Exclude<"onScroll", "mode" | "variant" | keyof T> | Exclude<"onScrollCapture", "mode" | "variant" | keyof T> | Exclude<"onWheel", "mode" | "variant" | keyof T> | Exclude<"onWheelCapture", "mode" | "variant" | keyof T> | Exclude<"onAnimationStart", "mode" | "variant" | keyof T> | Exclude<"onAnimationStartCapture", "mode" | "variant" | keyof T> | Exclude<"onAnimationEnd", "mode" | "variant" | keyof T> | Exclude<"onAnimationEndCapture", "mode" | "variant" | keyof T> | Exclude<"onAnimationIteration", "mode" | "variant" | keyof T> | Exclude<"onAnimationIterationCapture", "mode" | "variant" | keyof T> | Exclude<"onTransitionEnd", "mode" | "variant" | keyof T> | Exclude<"onTransitionEndCapture", "mode" | "variant" | keyof T> | Exclude<"defaultChecked", "mode" | "variant" | keyof T> | Exclude<"defaultValue", "mode" | "variant" | keyof T> | Exclude<"suppressContentEditableWarning", "mode" | "variant" | keyof T> | Exclude<"suppressHydrationWarning", "mode" | "variant" | keyof T> | Exclude<"accessKey", "mode" | "variant" | keyof T> | Exclude<"contentEditable", "mode" | "variant" | keyof T> | Exclude<"contextMenu", "mode" | "variant" | keyof T> | Exclude<"dir", "mode" | "variant" | keyof T> | Exclude<"draggable", "mode" | "variant" | keyof T> | Exclude<"placeholder", "mode" | "variant" | keyof T> | Exclude<"spellCheck", "mode" | "variant" | keyof T> | Exclude<"radioGroup", "mode" | "variant" | keyof T> | Exclude<"about", "mode" | "variant" | keyof T> | Exclude<"datatype", "mode" | "variant" | keyof T> | Exclude<"inlist", "mode" | "variant" | keyof T> | Exclude<"resource", "mode" | "variant" | keyof T> | Exclude<"typeof", "mode" | "variant" | keyof T> | Exclude<"vocab", "mode" | "variant" | keyof T> | Exclude<"autoCapitalize", "mode" | "variant" | keyof T> | Exclude<"autoCorrect", "mode" | "variant" | keyof T> | Exclude<"autoSave", "mode" | "variant" | keyof T> | Exclude<"itemProp", "mode" | "variant" | keyof T> | Exclude<"itemScope", "mode" | "variant" | keyof T> | Exclude<"itemType", "mode" | "variant" | keyof T> | Exclude<"itemID", "mode" | "variant" | keyof T> | Exclude<"itemRef", "mode" | "variant" | keyof T> | Exclude<"results", "mode" | "variant" | keyof T> | Exclude<"security", "mode" | "variant" | keyof T> | Exclude<"unselectable", "mode" | "variant" | keyof T> | Exclude<"inputMode", "mode" | "variant" | keyof T> | Exclude<"is", "mode" | "variant" | keyof T>;
|
|
20
|
+
shouldForwardProp: (prop: PropertyKey) => prop is Exclude<"ref", "variant" | keyof T | "mode"> | Exclude<"key", "variant" | keyof T | "mode"> | Exclude<"color", "variant" | keyof T | "mode"> | Exclude<"translate", "variant" | keyof T | "mode"> | Exclude<"property", "variant" | keyof T | "mode"> | Exclude<"hidden", "variant" | keyof T | "mode"> | Exclude<"style", "variant" | keyof T | "mode"> | Exclude<"slot", "variant" | keyof T | "mode"> | Exclude<"title", "variant" | keyof T | "mode"> | Exclude<"className", "variant" | keyof T | "mode"> | Exclude<"id", "variant" | keyof T | "mode"> | Exclude<"prefix", "variant" | keyof T | "mode"> | Exclude<"children", "variant" | keyof T | "mode"> | Exclude<"lang", "variant" | keyof T | "mode"> | Exclude<"role", "variant" | keyof T | "mode"> | Exclude<"tabIndex", "variant" | keyof T | "mode"> | Exclude<"aria-activedescendant", "variant" | keyof T | "mode"> | Exclude<"aria-atomic", "variant" | keyof T | "mode"> | Exclude<"aria-autocomplete", "variant" | keyof T | "mode"> | Exclude<"aria-busy", "variant" | keyof T | "mode"> | Exclude<"aria-checked", "variant" | keyof T | "mode"> | Exclude<"aria-colcount", "variant" | keyof T | "mode"> | Exclude<"aria-colindex", "variant" | keyof T | "mode"> | Exclude<"aria-colspan", "variant" | keyof T | "mode"> | Exclude<"aria-controls", "variant" | keyof T | "mode"> | Exclude<"aria-current", "variant" | keyof T | "mode"> | Exclude<"aria-describedby", "variant" | keyof T | "mode"> | Exclude<"aria-details", "variant" | keyof T | "mode"> | Exclude<"aria-disabled", "variant" | keyof T | "mode"> | Exclude<"aria-dropeffect", "variant" | keyof T | "mode"> | Exclude<"aria-errormessage", "variant" | keyof T | "mode"> | Exclude<"aria-expanded", "variant" | keyof T | "mode"> | Exclude<"aria-flowto", "variant" | keyof T | "mode"> | Exclude<"aria-grabbed", "variant" | keyof T | "mode"> | Exclude<"aria-haspopup", "variant" | keyof T | "mode"> | Exclude<"aria-hidden", "variant" | keyof T | "mode"> | Exclude<"aria-invalid", "variant" | keyof T | "mode"> | Exclude<"aria-keyshortcuts", "variant" | keyof T | "mode"> | Exclude<"aria-label", "variant" | keyof T | "mode"> | Exclude<"aria-labelledby", "variant" | keyof T | "mode"> | Exclude<"aria-level", "variant" | keyof T | "mode"> | Exclude<"aria-live", "variant" | keyof T | "mode"> | Exclude<"aria-modal", "variant" | keyof T | "mode"> | Exclude<"aria-multiline", "variant" | keyof T | "mode"> | Exclude<"aria-multiselectable", "variant" | keyof T | "mode"> | Exclude<"aria-orientation", "variant" | keyof T | "mode"> | Exclude<"aria-owns", "variant" | keyof T | "mode"> | Exclude<"aria-placeholder", "variant" | keyof T | "mode"> | Exclude<"aria-posinset", "variant" | keyof T | "mode"> | Exclude<"aria-pressed", "variant" | keyof T | "mode"> | Exclude<"aria-readonly", "variant" | keyof T | "mode"> | Exclude<"aria-relevant", "variant" | keyof T | "mode"> | Exclude<"aria-required", "variant" | keyof T | "mode"> | Exclude<"aria-roledescription", "variant" | keyof T | "mode"> | Exclude<"aria-rowcount", "variant" | keyof T | "mode"> | Exclude<"aria-rowindex", "variant" | keyof T | "mode"> | Exclude<"aria-rowspan", "variant" | keyof T | "mode"> | Exclude<"aria-selected", "variant" | keyof T | "mode"> | Exclude<"aria-setsize", "variant" | keyof T | "mode"> | Exclude<"aria-sort", "variant" | keyof T | "mode"> | Exclude<"aria-valuemax", "variant" | keyof T | "mode"> | Exclude<"aria-valuemin", "variant" | keyof T | "mode"> | Exclude<"aria-valuenow", "variant" | keyof T | "mode"> | Exclude<"aria-valuetext", "variant" | keyof T | "mode"> | Exclude<"dangerouslySetInnerHTML", "variant" | keyof T | "mode"> | Exclude<"onCopy", "variant" | keyof T | "mode"> | Exclude<"onCopyCapture", "variant" | keyof T | "mode"> | Exclude<"onCut", "variant" | keyof T | "mode"> | Exclude<"onCutCapture", "variant" | keyof T | "mode"> | Exclude<"onPaste", "variant" | keyof T | "mode"> | Exclude<"onPasteCapture", "variant" | keyof T | "mode"> | Exclude<"onCompositionEnd", "variant" | keyof T | "mode"> | Exclude<"onCompositionEndCapture", "variant" | keyof T | "mode"> | Exclude<"onCompositionStart", "variant" | keyof T | "mode"> | Exclude<"onCompositionStartCapture", "variant" | keyof T | "mode"> | Exclude<"onCompositionUpdate", "variant" | keyof T | "mode"> | Exclude<"onCompositionUpdateCapture", "variant" | keyof T | "mode"> | Exclude<"onFocus", "variant" | keyof T | "mode"> | Exclude<"onFocusCapture", "variant" | keyof T | "mode"> | Exclude<"onBlur", "variant" | keyof T | "mode"> | Exclude<"onBlurCapture", "variant" | keyof T | "mode"> | Exclude<"onChange", "variant" | keyof T | "mode"> | Exclude<"onChangeCapture", "variant" | keyof T | "mode"> | Exclude<"onBeforeInput", "variant" | keyof T | "mode"> | Exclude<"onBeforeInputCapture", "variant" | keyof T | "mode"> | Exclude<"onInput", "variant" | keyof T | "mode"> | Exclude<"onInputCapture", "variant" | keyof T | "mode"> | Exclude<"onReset", "variant" | keyof T | "mode"> | Exclude<"onResetCapture", "variant" | keyof T | "mode"> | Exclude<"onSubmit", "variant" | keyof T | "mode"> | Exclude<"onSubmitCapture", "variant" | keyof T | "mode"> | Exclude<"onInvalid", "variant" | keyof T | "mode"> | Exclude<"onInvalidCapture", "variant" | keyof T | "mode"> | Exclude<"onLoad", "variant" | keyof T | "mode"> | Exclude<"onLoadCapture", "variant" | keyof T | "mode"> | Exclude<"onError", "variant" | keyof T | "mode"> | Exclude<"onErrorCapture", "variant" | keyof T | "mode"> | Exclude<"onKeyDown", "variant" | keyof T | "mode"> | Exclude<"onKeyDownCapture", "variant" | keyof T | "mode"> | Exclude<"onKeyPress", "variant" | keyof T | "mode"> | Exclude<"onKeyPressCapture", "variant" | keyof T | "mode"> | Exclude<"onKeyUp", "variant" | keyof T | "mode"> | Exclude<"onKeyUpCapture", "variant" | keyof T | "mode"> | Exclude<"onAbort", "variant" | keyof T | "mode"> | Exclude<"onAbortCapture", "variant" | keyof T | "mode"> | Exclude<"onCanPlay", "variant" | keyof T | "mode"> | Exclude<"onCanPlayCapture", "variant" | keyof T | "mode"> | Exclude<"onCanPlayThrough", "variant" | keyof T | "mode"> | Exclude<"onCanPlayThroughCapture", "variant" | keyof T | "mode"> | Exclude<"onDurationChange", "variant" | keyof T | "mode"> | Exclude<"onDurationChangeCapture", "variant" | keyof T | "mode"> | Exclude<"onEmptied", "variant" | keyof T | "mode"> | Exclude<"onEmptiedCapture", "variant" | keyof T | "mode"> | Exclude<"onEncrypted", "variant" | keyof T | "mode"> | Exclude<"onEncryptedCapture", "variant" | keyof T | "mode"> | Exclude<"onEnded", "variant" | keyof T | "mode"> | Exclude<"onEndedCapture", "variant" | keyof T | "mode"> | Exclude<"onLoadedData", "variant" | keyof T | "mode"> | Exclude<"onLoadedDataCapture", "variant" | keyof T | "mode"> | Exclude<"onLoadedMetadata", "variant" | keyof T | "mode"> | Exclude<"onLoadedMetadataCapture", "variant" | keyof T | "mode"> | Exclude<"onLoadStart", "variant" | keyof T | "mode"> | Exclude<"onLoadStartCapture", "variant" | keyof T | "mode"> | Exclude<"onPause", "variant" | keyof T | "mode"> | Exclude<"onPauseCapture", "variant" | keyof T | "mode"> | Exclude<"onPlay", "variant" | keyof T | "mode"> | Exclude<"onPlayCapture", "variant" | keyof T | "mode"> | Exclude<"onPlaying", "variant" | keyof T | "mode"> | Exclude<"onPlayingCapture", "variant" | keyof T | "mode"> | Exclude<"onProgress", "variant" | keyof T | "mode"> | Exclude<"onProgressCapture", "variant" | keyof T | "mode"> | Exclude<"onRateChange", "variant" | keyof T | "mode"> | Exclude<"onRateChangeCapture", "variant" | keyof T | "mode"> | Exclude<"onSeeked", "variant" | keyof T | "mode"> | Exclude<"onSeekedCapture", "variant" | keyof T | "mode"> | Exclude<"onSeeking", "variant" | keyof T | "mode"> | Exclude<"onSeekingCapture", "variant" | keyof T | "mode"> | Exclude<"onStalled", "variant" | keyof T | "mode"> | Exclude<"onStalledCapture", "variant" | keyof T | "mode"> | Exclude<"onSuspend", "variant" | keyof T | "mode"> | Exclude<"onSuspendCapture", "variant" | keyof T | "mode"> | Exclude<"onTimeUpdate", "variant" | keyof T | "mode"> | Exclude<"onTimeUpdateCapture", "variant" | keyof T | "mode"> | Exclude<"onVolumeChange", "variant" | keyof T | "mode"> | Exclude<"onVolumeChangeCapture", "variant" | keyof T | "mode"> | Exclude<"onWaiting", "variant" | keyof T | "mode"> | Exclude<"onWaitingCapture", "variant" | keyof T | "mode"> | Exclude<"onAuxClick", "variant" | keyof T | "mode"> | Exclude<"onAuxClickCapture", "variant" | keyof T | "mode"> | Exclude<"onClick", "variant" | keyof T | "mode"> | Exclude<"onClickCapture", "variant" | keyof T | "mode"> | Exclude<"onContextMenu", "variant" | keyof T | "mode"> | Exclude<"onContextMenuCapture", "variant" | keyof T | "mode"> | Exclude<"onDoubleClick", "variant" | keyof T | "mode"> | Exclude<"onDoubleClickCapture", "variant" | keyof T | "mode"> | Exclude<"onDrag", "variant" | keyof T | "mode"> | Exclude<"onDragCapture", "variant" | keyof T | "mode"> | Exclude<"onDragEnd", "variant" | keyof T | "mode"> | Exclude<"onDragEndCapture", "variant" | keyof T | "mode"> | Exclude<"onDragEnter", "variant" | keyof T | "mode"> | Exclude<"onDragEnterCapture", "variant" | keyof T | "mode"> | Exclude<"onDragExit", "variant" | keyof T | "mode"> | Exclude<"onDragExitCapture", "variant" | keyof T | "mode"> | Exclude<"onDragLeave", "variant" | keyof T | "mode"> | Exclude<"onDragLeaveCapture", "variant" | keyof T | "mode"> | Exclude<"onDragOver", "variant" | keyof T | "mode"> | Exclude<"onDragOverCapture", "variant" | keyof T | "mode"> | Exclude<"onDragStart", "variant" | keyof T | "mode"> | Exclude<"onDragStartCapture", "variant" | keyof T | "mode"> | Exclude<"onDrop", "variant" | keyof T | "mode"> | Exclude<"onDropCapture", "variant" | keyof T | "mode"> | Exclude<"onMouseDown", "variant" | keyof T | "mode"> | Exclude<"onMouseDownCapture", "variant" | keyof T | "mode"> | Exclude<"onMouseEnter", "variant" | keyof T | "mode"> | Exclude<"onMouseLeave", "variant" | keyof T | "mode"> | Exclude<"onMouseMove", "variant" | keyof T | "mode"> | Exclude<"onMouseMoveCapture", "variant" | keyof T | "mode"> | Exclude<"onMouseOut", "variant" | keyof T | "mode"> | Exclude<"onMouseOutCapture", "variant" | keyof T | "mode"> | Exclude<"onMouseOver", "variant" | keyof T | "mode"> | Exclude<"onMouseOverCapture", "variant" | keyof T | "mode"> | Exclude<"onMouseUp", "variant" | keyof T | "mode"> | Exclude<"onMouseUpCapture", "variant" | keyof T | "mode"> | Exclude<"onSelect", "variant" | keyof T | "mode"> | Exclude<"onSelectCapture", "variant" | keyof T | "mode"> | Exclude<"onTouchCancel", "variant" | keyof T | "mode"> | Exclude<"onTouchCancelCapture", "variant" | keyof T | "mode"> | Exclude<"onTouchEnd", "variant" | keyof T | "mode"> | Exclude<"onTouchEndCapture", "variant" | keyof T | "mode"> | Exclude<"onTouchMove", "variant" | keyof T | "mode"> | Exclude<"onTouchMoveCapture", "variant" | keyof T | "mode"> | Exclude<"onTouchStart", "variant" | keyof T | "mode"> | Exclude<"onTouchStartCapture", "variant" | keyof T | "mode"> | Exclude<"onPointerDown", "variant" | keyof T | "mode"> | Exclude<"onPointerDownCapture", "variant" | keyof T | "mode"> | Exclude<"onPointerMove", "variant" | keyof T | "mode"> | Exclude<"onPointerMoveCapture", "variant" | keyof T | "mode"> | Exclude<"onPointerUp", "variant" | keyof T | "mode"> | Exclude<"onPointerUpCapture", "variant" | keyof T | "mode"> | Exclude<"onPointerCancel", "variant" | keyof T | "mode"> | Exclude<"onPointerCancelCapture", "variant" | keyof T | "mode"> | Exclude<"onPointerEnter", "variant" | keyof T | "mode"> | Exclude<"onPointerEnterCapture", "variant" | keyof T | "mode"> | Exclude<"onPointerLeave", "variant" | keyof T | "mode"> | Exclude<"onPointerLeaveCapture", "variant" | keyof T | "mode"> | Exclude<"onPointerOver", "variant" | keyof T | "mode"> | Exclude<"onPointerOverCapture", "variant" | keyof T | "mode"> | Exclude<"onPointerOut", "variant" | keyof T | "mode"> | Exclude<"onPointerOutCapture", "variant" | keyof T | "mode"> | Exclude<"onGotPointerCapture", "variant" | keyof T | "mode"> | Exclude<"onGotPointerCaptureCapture", "variant" | keyof T | "mode"> | Exclude<"onLostPointerCapture", "variant" | keyof T | "mode"> | Exclude<"onLostPointerCaptureCapture", "variant" | keyof T | "mode"> | Exclude<"onScroll", "variant" | keyof T | "mode"> | Exclude<"onScrollCapture", "variant" | keyof T | "mode"> | Exclude<"onWheel", "variant" | keyof T | "mode"> | Exclude<"onWheelCapture", "variant" | keyof T | "mode"> | Exclude<"onAnimationStart", "variant" | keyof T | "mode"> | Exclude<"onAnimationStartCapture", "variant" | keyof T | "mode"> | Exclude<"onAnimationEnd", "variant" | keyof T | "mode"> | Exclude<"onAnimationEndCapture", "variant" | keyof T | "mode"> | Exclude<"onAnimationIteration", "variant" | keyof T | "mode"> | Exclude<"onAnimationIterationCapture", "variant" | keyof T | "mode"> | Exclude<"onTransitionEnd", "variant" | keyof T | "mode"> | Exclude<"onTransitionEndCapture", "variant" | keyof T | "mode"> | Exclude<"defaultChecked", "variant" | keyof T | "mode"> | Exclude<"defaultValue", "variant" | keyof T | "mode"> | Exclude<"suppressContentEditableWarning", "variant" | keyof T | "mode"> | Exclude<"suppressHydrationWarning", "variant" | keyof T | "mode"> | Exclude<"accessKey", "variant" | keyof T | "mode"> | Exclude<"contentEditable", "variant" | keyof T | "mode"> | Exclude<"contextMenu", "variant" | keyof T | "mode"> | Exclude<"dir", "variant" | keyof T | "mode"> | Exclude<"draggable", "variant" | keyof T | "mode"> | Exclude<"placeholder", "variant" | keyof T | "mode"> | Exclude<"spellCheck", "variant" | keyof T | "mode"> | Exclude<"radioGroup", "variant" | keyof T | "mode"> | Exclude<"about", "variant" | keyof T | "mode"> | Exclude<"datatype", "variant" | keyof T | "mode"> | Exclude<"inlist", "variant" | keyof T | "mode"> | Exclude<"resource", "variant" | keyof T | "mode"> | Exclude<"typeof", "variant" | keyof T | "mode"> | Exclude<"vocab", "variant" | keyof T | "mode"> | Exclude<"autoCapitalize", "variant" | keyof T | "mode"> | Exclude<"autoCorrect", "variant" | keyof T | "mode"> | Exclude<"autoSave", "variant" | keyof T | "mode"> | Exclude<"itemProp", "variant" | keyof T | "mode"> | Exclude<"itemScope", "variant" | keyof T | "mode"> | Exclude<"itemType", "variant" | keyof T | "mode"> | Exclude<"itemID", "variant" | keyof T | "mode"> | Exclude<"itemRef", "variant" | keyof T | "mode"> | Exclude<"results", "variant" | keyof T | "mode"> | Exclude<"security", "variant" | keyof T | "mode"> | Exclude<"unselectable", "variant" | keyof T | "mode"> | Exclude<"inputMode", "variant" | keyof T | "mode"> | Exclude<"is", "variant" | keyof T | "mode">;
|
|
21
21
|
};
|
|
@@ -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
2
|
export declare function createParser<Config extends Record<string, Prop>>(config: Config): Parser<Config>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { Prop } from '../types/config';
|
|
2
|
-
import {
|
|
2
|
+
import { CSSObject } from '../types/shared';
|
|
3
|
+
import { AbstractProps } from '../types/props';
|
|
3
4
|
export declare const createPropertyStyle: <Config extends Prop, Value>(value: Value, props: AbstractProps, config: Config) => CSSObject;
|
package/dist/types/config.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Theme } from '@emotion/react';
|
|
2
2
|
import { CSSObject } from './shared';
|
|
3
|
-
import { DefaultCSSPropertyValue, PropertyTypes } from './properties';
|
|
4
|
-
import {
|
|
5
|
-
import { Arg } from '
|
|
3
|
+
import { DefaultCSSPropertyValue, PropertyTypes, CSSPropertyTypes } from './properties';
|
|
4
|
+
import { AbstractProps, ResponsiveProp, ThemeProps } from './props';
|
|
5
|
+
import { Arg } from './utils';
|
|
6
6
|
import { ArrayScale, MapScale } from './scales';
|
|
7
7
|
import { CompatTheme } from '../compatTheme';
|
|
8
8
|
export interface BaseProperty {
|
|
@@ -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 declare type CSSPropMap<Props, System> = {
|
|
45
|
+
[K in keyof Props]?: CSSProps<Props[K], System>;
|
|
46
|
+
};
|
|
47
|
+
export declare type CSSProps<Props, System> = {
|
|
48
|
+
[K in keyof Props]?: K extends keyof System ? System[K] : K extends keyof CSSPropertyTypes ? CSSPropertyTypes[K] : Omit<CSSPropertyTypes, keyof System> & Omit<System, 'theme'>;
|
|
49
|
+
};
|
|
44
50
|
export {};
|
package/dist/types/props.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { Theme } from '@emotion/react';
|
|
2
|
-
import { AbstractParser, Scale } from '../legacy/config';
|
|
3
|
-
import { CSSPropertyTypes } from './properties';
|
|
4
2
|
export declare type AbstractProps = ThemeProps<Record<string, unknown>>;
|
|
5
3
|
interface MediaQueryByKey<T = string> {
|
|
6
4
|
xs: T;
|
|
@@ -33,11 +31,4 @@ export interface MediaQueryMap<T> {
|
|
|
33
31
|
xl?: T;
|
|
34
32
|
}
|
|
35
33
|
export declare type ResponsiveProp<T> = T | MediaQueryMap<T> | MediaQueryArray<T>;
|
|
36
|
-
export 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]>;
|
|
43
34
|
export {};
|
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-e4cdacd2.0+e4cdacd",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"emotion",
|
|
7
7
|
"css",
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
],
|
|
11
11
|
"author": "codecaaron <airrobb@gmail.com>",
|
|
12
12
|
"license": "MIT",
|
|
13
|
-
"
|
|
14
|
-
"
|
|
13
|
+
"module": "./dist/index.js",
|
|
14
|
+
"main": "./dist/index.js",
|
|
15
15
|
"types": "dist/index.d.ts",
|
|
16
16
|
"publishConfig": {
|
|
17
17
|
"access": "public"
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"csstype": "^3.0.7"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "e4cdacd229ba2d35ac932de490ad4fab18fa7f11"
|
|
40
40
|
}
|
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};
|