@animus-ui/system 0.1.9 → 0.1.12
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/README.md +124 -51
- package/dist/Animus.d.ts +3 -2
- package/dist/Animus.d.ts.map +1 -1
- package/dist/AnimusExtended.d.ts +3 -2
- package/dist/AnimusExtended.d.ts.map +1 -1
- package/dist/SystemBuilder.d.ts +184 -155
- package/dist/SystemBuilder.d.ts.map +1 -1
- package/dist/appearance/index.d.ts +0 -68
- package/dist/appearance/index.d.ts.map +1 -1
- package/dist/appearance/index.js +0 -91
- package/dist/assert-root-slot-C3Lp9MNJ.js +10 -0
- package/dist/asset.d.ts +4 -13
- package/dist/asset.d.ts.map +1 -1
- package/dist/bootstrap/createAppearanceBootstrap.d.ts +0 -57
- package/dist/bootstrap/createAppearanceBootstrap.d.ts.map +1 -1
- package/dist/bootstrap/index.d.ts.map +1 -1
- package/dist/bootstrap/index.js +4 -58
- package/dist/class-resolver.d.ts +6 -0
- package/dist/class-resolver.d.ts.map +1 -0
- package/dist/class-resolver.js +2 -0
- package/dist/compose.d.ts +2 -16
- package/dist/compose.d.ts.map +1 -1
- package/dist/compose.js +3 -17
- package/dist/composeWithContext.d.ts +4 -15
- package/dist/composeWithContext.d.ts.map +1 -1
- package/dist/composeWithContext.js +5 -16
- package/dist/conditions.d.ts +24 -141
- package/dist/conditions.d.ts.map +1 -1
- package/dist/createClassResolver-EpwTL9Sa.js +228 -0
- package/dist/createComposedFamily-C4NovMcd.js +115 -0
- package/dist/groups/index.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +318 -408
- package/dist/keyframes.d.ts +2 -23
- package/dist/keyframes.d.ts.map +1 -1
- package/dist/runtime/assert-root-slot.d.ts +2 -13
- package/dist/runtime/assert-root-slot.d.ts.map +1 -1
- package/dist/runtime/createClassResolver.d.ts +10 -9
- package/dist/runtime/createClassResolver.d.ts.map +1 -1
- package/dist/runtime/createComposedFamily.d.ts +2 -7
- package/dist/runtime/createComposedFamily.d.ts.map +1 -1
- package/dist/runtime/index.d.ts +0 -16
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/is-dev.d.ts +2 -42
- package/dist/runtime/is-dev.d.ts.map +1 -1
- package/dist/runtime/resolveClasses.d.ts +8 -33
- package/dist/runtime/resolveClasses.d.ts.map +1 -1
- package/dist/runtime/witness.d.ts +0 -8
- package/dist/runtime/witness.d.ts.map +1 -1
- package/dist/runtime-entry.d.ts +2 -7
- package/dist/runtime-entry.d.ts.map +1 -1
- package/dist/runtime-entry.js +2 -1
- package/dist/selectors.d.ts +6 -45
- package/dist/selectors.d.ts.map +1 -1
- package/dist/{size-DHdmBc64.js → size-C6jqxiQy.js} +7 -34
- package/dist/theme/createTheme.d.ts +26 -95
- package/dist/theme/createTheme.d.ts.map +1 -1
- package/dist/theme/flattenScale.d.ts +4 -10
- package/dist/theme/flattenScale.d.ts.map +1 -1
- package/dist/theme/resolveReferences.d.ts +7 -35
- package/dist/theme/resolveReferences.d.ts.map +1 -1
- package/dist/theme/serializeTokens.d.ts +0 -3
- package/dist/theme/serializeTokens.d.ts.map +1 -1
- package/dist/theme/types.d.ts +4 -26
- package/dist/theme/types.d.ts.map +1 -1
- package/dist/theme/utils.d.ts +1 -18
- package/dist/theme/utils.d.ts.map +1 -1
- package/dist/transforms/border.d.ts +1 -4
- package/dist/transforms/border.d.ts.map +1 -1
- package/dist/transforms/createTransform.d.ts +6 -31
- package/dist/transforms/createTransform.d.ts.map +1 -1
- package/dist/transforms/grid.d.ts +2 -12
- package/dist/transforms/grid.d.ts.map +1 -1
- package/dist/transforms/size.d.ts +2 -8
- package/dist/transforms/size.d.ts.map +1 -1
- package/dist/types/component.d.ts +9 -105
- package/dist/types/component.d.ts.map +1 -1
- package/dist/types/config.d.ts +12 -141
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/theme.d.ts +8 -165
- package/dist/types/theme.d.ts.map +1 -1
- package/dist/utils/deepMerge.d.ts.map +1 -1
- package/package.json +17 -4
- package/dist/assert-root-slot-B83scqPh.js +0 -21
- package/dist/createComposedFamily-3ZugjBpU.js +0 -472
package/dist/keyframes.d.ts
CHANGED
|
@@ -1,27 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* The returned collection is:
|
|
6
|
-
* - Branded (`__brand: 'Keyframes'`) for plugin discovery via named-export scan.
|
|
7
|
-
* - Carries raw frame data on `__frames` as `{ [key]: { name, frames } }`,
|
|
8
|
-
* where `name` is the resolved keyframes identifier emitted into CSS.
|
|
9
|
-
* - Exposes one `KeyframeRef<Name>` per named key — each ref coerces to its
|
|
10
|
-
* resolved name via `toString()`/`valueOf()` for runtime-fallback paths.
|
|
11
|
-
*
|
|
12
|
-
* Naming: each keyframe's name is generated at authoring time via a
|
|
13
|
-
* deterministic FNV-1a content hash over its frame body (`animus-kf-<hash>`).
|
|
14
|
-
* Identical frame bodies dedupe into a single `@keyframes` emission naturally.
|
|
15
|
-
* The Rust extractor substitutes `motion.ember`-style member-expression
|
|
16
|
-
* references in component styles to the static name at emit time.
|
|
17
|
-
*
|
|
18
|
-
* Frame body vocabulary (narrower than component styles — factory is not
|
|
19
|
-
* system-bound, so prop-config resolution is not available):
|
|
20
|
-
* - CSS property names (camelCase → kebab-case at emission)
|
|
21
|
-
* - Raw CSS values
|
|
22
|
-
* - `{scale.key}` token references (resolved via theme_resolver at emission)
|
|
23
|
-
* - Bare scale keys (e.g. `textShadow: 'glow-text'`) are NOT resolved —
|
|
24
|
-
* consumers must use `{scale.key}` form for theme-resolved values.
|
|
2
|
+
* Frame values take raw CSS or `{scale.key}` token references; a bare scale
|
|
3
|
+
* key is not resolved. The extractor substitutes refs with the hashed name.
|
|
25
4
|
*/
|
|
26
5
|
export type KeyframeFrameMap = Record<string, Record<string, unknown>>;
|
|
27
6
|
export interface KeyframeRef<Name extends string> {
|
package/dist/keyframes.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyframes.d.ts","sourceRoot":"","sources":["../src/keyframes.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"keyframes.d.ts","sourceRoot":"","sources":["../src/keyframes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAEvE,MAAM,WAAW,WAAW,CAAC,IAAI,SAAS,MAAM;IAC9C,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC;IAChC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC;IACtB,QAAQ,IAAI,MAAM,CAAC;IACnB,OAAO,IAAI,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,SAAS,CAAC,GAAG,SAAS,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,IAAI;IACpE,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE;QACjB,QAAQ,EAAE,CAAC,IAAI,MAAM,GAAG,GAAG,MAAM,GAAG;YAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;YACtB,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;SACzB;KACF,CAAC;CACH,GAAG;IACF,QAAQ,EAAE,CAAC,IAAI,MAAM,GAAG,GAAG,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC;CACnD,CAAC;AA8CF,wBAAgB,SAAS,CAAC,GAAG,SAAS,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,EACpE,GAAG,EAAE,GAAG,GACP,SAAS,CAAC,GAAG,CAAC,CAiBhB"}
|
|
@@ -1,17 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* the transform emitter writes in their place (`createComposedFamily`,
|
|
5
|
-
* `createComposedFamilyWithContext`).
|
|
6
|
-
*
|
|
7
|
-
* A family without a Root slot has no cascade source: the composed variant
|
|
8
|
-
* rules emitted for its children inherit nothing, and the context transport
|
|
9
|
-
* renders them against the empty default — the silent-drop failure mode this
|
|
10
|
-
* runtime guards against. Source form and extracted form must agree on the
|
|
11
|
-
* contract, so the check and its message live here once.
|
|
12
|
-
*
|
|
13
|
-
* React-free by design: the extracted forms import it from the same module the
|
|
14
|
-
* source forms do, with no cycle through the component runtime.
|
|
2
|
+
* Without a Root slot a family has no cascade source: composed child rules
|
|
3
|
+
* inherit nothing and the context transport renders the empty default.
|
|
15
4
|
*/
|
|
16
5
|
export declare function assertRootSlot(slots: object, fnName: string): void;
|
|
17
6
|
//# sourceMappingURL=assert-root-slot.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assert-root-slot.d.ts","sourceRoot":"","sources":["../../src/runtime/assert-root-slot.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"assert-root-slot.d.ts","sourceRoot":"","sources":["../../src/runtime/assert-root-slot.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAQlE"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { type ClassResolverConfig, type DynamicPropConfig, type SystemPropMap } from './resolveClasses.js';
|
|
2
|
+
export interface ClassResolverAttributes {
|
|
3
|
+
class: string;
|
|
4
|
+
style?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface ClassResolver {
|
|
7
|
+
(props?: Record<string, unknown>): string;
|
|
8
|
+
attrs(props?: Record<string, unknown>): ClassResolverAttributes;
|
|
9
|
+
}
|
|
10
|
+
export declare function createClassResolver(className: string, config: ClassResolverConfig, systemPropMap?: SystemPropMap, dynamicPropConfig?: DynamicPropConfig): ClassResolver;
|
|
10
11
|
//# sourceMappingURL=createClassResolver.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createClassResolver.d.ts","sourceRoot":"","sources":["../../src/runtime/createClassResolver.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"createClassResolver.d.ts","sourceRoot":"","sources":["../../src/runtime/createClassResolver.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EAEtB,KAAK,aAAa,EACnB,MAAM,qBAAqB,CAAC;AAE7B,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,aAAa;IAC5B,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC;IAC1C,KAAK,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,uBAAuB,CAAC;CACjE;AAQD,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,mBAAmB,EAC3B,aAAa,CAAC,EAAE,aAAa,EAC7B,iBAAiB,CAAC,EAAE,iBAAiB,GACpC,aAAa,CAgCf"}
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* The transform emitter replaces `compose({ Root, Body }, { shared, name })`
|
|
5
|
-
* with `createComposedFamily({ Root, Body }, { name })`.
|
|
6
|
-
*
|
|
7
|
-
* RSC-safe: uses only forwardRef and createElement — no createContext,
|
|
8
|
-
* no useContext, no hooks.
|
|
2
|
+
* The extraction emitter rewrites `compose()` calls to this form. It stays
|
|
3
|
+
* hook- and context-free so composed families work in server components.
|
|
9
4
|
*/
|
|
10
5
|
import { type ForwardRefExoticComponent } from 'react';
|
|
11
6
|
interface ComposedFamilyConfig {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createComposedFamily.d.ts","sourceRoot":"","sources":["../../src/runtime/createComposedFamily.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"createComposedFamily.d.ts","sourceRoot":"","sources":["../../src/runtime/createComposedFamily.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEL,KAAK,yBAAyB,EAG/B,MAAM,OAAO,CAAC;AAIf,UAAU,oBAAoB;IAC5B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,yBAAyB,CAAC,GAAG,CAAC,CAAC,EACrD,MAAM,EAAE,oBAAoB,GAC3B,MAAM,CAAC,MAAM,EAAE,yBAAyB,CAAC,GAAG,CAAC,CAAC,CAkBhD"}
|
package/dist/runtime/index.d.ts
CHANGED
|
@@ -5,24 +5,8 @@ interface ComponentConfig extends ClassResolverConfig {
|
|
|
5
5
|
type ElementType = string | React.ComponentType<any>;
|
|
6
6
|
type AnimusComponent = ReturnType<typeof forwardRef> & {
|
|
7
7
|
extend: () => never;
|
|
8
|
-
/** Effective-default contract: variant axis → default option. */
|
|
9
8
|
variantDefaults: Readonly<Record<string, string>>;
|
|
10
9
|
};
|
|
11
|
-
/**
|
|
12
|
-
* Create a lightweight component that applies extracted CSS class names.
|
|
13
|
-
* Replaces Emotion's styled() for extracted components.
|
|
14
|
-
*
|
|
15
|
-
* The element parameter accepts either an HTML tag string (e.g. 'button') or
|
|
16
|
-
* a React component reference (e.g. NextLink). When a component reference is
|
|
17
|
-
* used, prop forwarding skips the HTML-attribute validity check — all
|
|
18
|
-
* non-filtered props are forwarded to the component.
|
|
19
|
-
*
|
|
20
|
-
* The optional systemPropMap parameter provides the shared prop→value→className
|
|
21
|
-
* lookup table, served as a virtual module by the Vite plugin.
|
|
22
|
-
*
|
|
23
|
-
* The optional dynamicPropConfig parameter provides CSS variable fallback
|
|
24
|
-
* metadata for props with detected dynamic usage.
|
|
25
|
-
*/
|
|
26
10
|
export declare function createComponent(element: ElementType, className: string, config: ComponentConfig, systemPropMap?: SystemPropMap, dynamicPropConfig?: DynamicPropConfig): AnimusComponent;
|
|
27
11
|
export {};
|
|
28
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,UAAU,EAEX,MAAM,OAAO,CAAC;AAEf,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EAEtB,KAAK,aAAa,EACnB,MAAM,kBAAkB,CAAC;AAE1B,UAAU,eAAgB,SAAQ,mBAAmB;CAAG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,UAAU,EAEX,MAAM,OAAO,CAAC;AAEf,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EAEtB,KAAK,aAAa,EACnB,MAAM,kBAAkB,CAAC;AAE1B,UAAU,eAAgB,SAAQ,mBAAmB;CAAG;AAExD,KAAK,WAAW,GAAG,MAAM,GAAG,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;AAErD,KAAK,eAAe,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,GAAG;IACrD,MAAM,EAAE,MAAM,KAAK,CAAC;IACpB,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACnD,CAAC;AA6GF,wBAAgB,eAAe,CAC7B,OAAO,EAAE,WAAW,EACpB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,eAAe,EACvB,aAAa,CAAC,EAAE,aAAa,EAC7B,iBAAiB,CAAC,EAAE,iBAAiB,GACpC,eAAe,CAoEjB"}
|
package/dist/runtime/is-dev.d.ts
CHANGED
|
@@ -1,46 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The
|
|
3
|
-
*
|
|
4
|
-
* at once, and they force this exact shape:
|
|
5
|
-
*
|
|
6
|
-
* - **Bundles built through an Animus plugin.** `__ANIMUS_DEV__` is a
|
|
7
|
-
* build-time define supplied by the Vite plugin's `config` hook and by the
|
|
8
|
-
* Next plugin's DefinePlugin entry, each keyed on its bundler's own
|
|
9
|
-
* dev/build signal. It is tested FIRST, and as the CONDITIONAL OF THE
|
|
10
|
-
* INITIALIZER ITSELF — not as an early return inside the IIFE below. That
|
|
11
|
-
* distinction is the whole point: define-replacement turns the test into
|
|
12
|
-
* `typeof false === 'boolean'`, and only in this position does the
|
|
13
|
-
* production minifier propagate the resulting constant into every `IS_DEV`
|
|
14
|
-
* reference, so the gated branches and their diagnostic strings leave the
|
|
15
|
-
* bundle entirely. Hidden inside the IIFE, the same guard collapses to a
|
|
16
|
-
* variable the minifier keeps, and every diagnostic string ships. Never
|
|
17
|
-
* "tidy" this ternary into the fallback.
|
|
18
|
-
* - **Browser bundles without the define.** `process.env.NODE_ENV` is a define
|
|
19
|
-
* token that Vite and Next rewrite to a string literal; `typeof process` is
|
|
20
|
-
* not rewritten by anything, so guarding the token with it strands every dev
|
|
21
|
-
* branch in a browser (no `process` global → the conjunction is false in dev
|
|
22
|
-
* too). The token must therefore be read bare.
|
|
23
|
-
* - **Next under Turbopack.** The Next plugin supplies the define from its
|
|
24
|
-
* `webpack()` hook, and a Turbopack-active run never calls that hook (the
|
|
25
|
-
* Turbopack path wires rules and aliases instead), so those builds carry no
|
|
26
|
-
* token and land on the `process.env.NODE_ENV` fallback below — correct
|
|
27
|
-
* answer, no elimination.
|
|
28
|
-
* - **QuickJS (the Rust system-loader).** It evaluates the system dist with no
|
|
29
|
-
* define pass and no `process`, so the `typeof` test is simply false and the
|
|
30
|
-
* bare read then throws ReferenceError at module scope — caught here, and
|
|
31
|
-
* not-dev is the correct answer for a loader that only reads config.
|
|
32
|
-
* `import.meta` is unavailable there (a script-context eval makes it a syntax
|
|
33
|
-
* error), so it is never used.
|
|
34
|
-
* - **Node (SSR, tests).** Reads the real `process.env.NODE_ENV`.
|
|
35
|
-
*
|
|
36
|
-
* Evaluated once, at module load: in every host the answer is fixed for the
|
|
37
|
-
* lifetime of the bundle.
|
|
38
|
-
*
|
|
39
|
-
* The define is the sanctioned foldable path, and the only one. The try/catch
|
|
40
|
-
* fallback is deliberately NOT foldable — a host that supplies no token keeps
|
|
41
|
-
* its (gated-off, never-executed) diagnostic strings, which is the accepted
|
|
42
|
-
* price of a diagnostic that actually fires in a browser dev build. Restore
|
|
43
|
-
* elimination by supplying the define from a bundler plugin.
|
|
2
|
+
* The define token is tested as the initializer's own conditional, never from
|
|
3
|
+
* inside the fallback: only there can a minifier drop the dev-gated code.
|
|
44
4
|
*/
|
|
45
5
|
export declare const IS_DEV: boolean;
|
|
46
6
|
//# sourceMappingURL=is-dev.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-dev.d.ts","sourceRoot":"","sources":["../../src/runtime/is-dev.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"is-dev.d.ts","sourceRoot":"","sources":["../../src/runtime/is-dev.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,eAAO,MAAM,MAAM,SAiBT,CAAC"}
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared className resolution logic used by both createComponent (React)
|
|
3
|
-
* and createClassResolver (framework-agnostic).
|
|
4
|
-
*
|
|
5
|
-
* Factored to ensure behavioral parity between .asElement() and .asClass() outputs.
|
|
6
|
-
*/
|
|
7
1
|
interface VariantConfig {
|
|
8
2
|
options: string[];
|
|
9
3
|
default?: string;
|
|
@@ -24,45 +18,30 @@ export type SystemPropMap = Record<string, Record<string, string>>;
|
|
|
24
18
|
export type DynamicPropConfig = Record<string, {
|
|
25
19
|
varName: string;
|
|
26
20
|
slotClass: string;
|
|
27
|
-
/** CSS property the slot class declares — the unit-fallback decision. */
|
|
28
21
|
property?: string;
|
|
29
|
-
/** Member properties when the prop expands to several declarations. */
|
|
30
22
|
properties?: readonly string[];
|
|
31
23
|
transformName?: string;
|
|
32
24
|
transform?: (value: string | number) => string | number;
|
|
33
25
|
scaleValues?: Record<string, string>;
|
|
34
26
|
}>;
|
|
35
27
|
/**
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
* A mixed property set resolves to unitless: an unsuffixed number on a length
|
|
40
|
-
* property is dropped by the CSS parser, whereas `px` on a unitless property
|
|
41
|
-
* renders and silently changes layout — prefer the drop.
|
|
42
|
-
*
|
|
43
|
-
* An empty property list keeps the unconditional `px` — configs emitted before
|
|
44
|
-
* `property` was carried name no property at all.
|
|
28
|
+
* A mixed property set resolves to unitless: a bare number on a length
|
|
29
|
+
* property is dropped by the parser, `px` on a unitless one shifts layout.
|
|
45
30
|
*/
|
|
46
31
|
export declare function applyUnitFallback(value: string | number, cssProperties: readonly string[]): string;
|
|
47
32
|
/**
|
|
48
|
-
*
|
|
49
|
-
*
|
|
33
|
+
* The key format is fixed by the Rust css generator; a divergence here misses
|
|
34
|
+
* every static class lookup.
|
|
50
35
|
*/
|
|
51
36
|
export declare function serializeValueKey(value: unknown): string;
|
|
52
37
|
/**
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
* fold them into `object`; non-finite numbers get their own name because
|
|
56
|
-
* finite ones are valid. Precondition: callers pass only results that failed
|
|
57
|
-
* `isValidTransformResult` — valid strings/finite numbers are out of domain
|
|
58
|
-
* and would be mislabeled.
|
|
38
|
+
* The domain is results that failed `isValidTransformResult`; a valid string
|
|
39
|
+
* or finite number passed here is mislabeled.
|
|
59
40
|
*/
|
|
60
41
|
export declare function describeResultShape(result: unknown): string;
|
|
61
42
|
/**
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
* result (anything but a string or finite number); no-transform paths never
|
|
65
|
-
* return `null`.
|
|
43
|
+
* `null` means a configured transform returned neither a string nor a finite
|
|
44
|
+
* number; paths without a transform never return `null`.
|
|
66
45
|
*/
|
|
67
46
|
export declare function resolveValue(value: unknown, dc: Pick<DynamicPropConfig[string], 'varName' | 'property' | 'properties' | 'transform' | 'scaleValues'>): string | null;
|
|
68
47
|
export interface ClassResolution {
|
|
@@ -70,10 +49,6 @@ export interface ClassResolution {
|
|
|
70
49
|
dynamicStyle?: Record<string, string>;
|
|
71
50
|
activeStates: string[];
|
|
72
51
|
}
|
|
73
|
-
/**
|
|
74
|
-
* Resolve className parts from props, using extracted configuration.
|
|
75
|
-
* This is the shared logic between createComponent and createClassResolver.
|
|
76
|
-
*/
|
|
77
52
|
export declare function resolveClasses(baseClassName: string, props: Record<string, any>, config: ClassResolverConfig, systemPropMap?: SystemPropMap, dynamicPropConfig?: DynamicPropConfig): ClassResolution;
|
|
78
53
|
export {};
|
|
79
54
|
//# sourceMappingURL=resolveClasses.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveClasses.d.ts","sourceRoot":"","sources":["../../src/runtime/resolveClasses.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"resolveClasses.d.ts","sourceRoot":"","sources":["../../src/runtime/resolveClasses.ts"],"names":[],"mappings":"AAAA,UAAU,aAAa;IACrB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,UAAU,cAAc;IACtB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;IAC9C,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IACzC,SAAS,CAAC,EAAE,cAAc,EAAE,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACvD,mBAAmB,CAAC,EAAE,iBAAiB,CAAC;CACzC;AAED,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAEnE,MAAM,MAAM,iBAAiB,GAAG,MAAM,CACpC,MAAM,EACN;IACE,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,KAAK,MAAM,GAAG,MAAM,CAAC;IACxD,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACtC,CACF,CAAC;AAOF;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,MAAM,GAAG,MAAM,EACtB,aAAa,EAAE,SAAS,MAAM,EAAE,GAC/B,MAAM,CAQR;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAWxD;AASD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAK3D;AAwCD;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,OAAO,EACd,EAAE,EAAE,IAAI,CACN,iBAAiB,CAAC,MAAM,CAAC,EACzB,SAAS,GAAG,UAAU,GAAG,YAAY,GAAG,WAAW,GAAG,aAAa,CACpE,GACA,MAAM,GAAG,IAAI,CAGf;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AA8ID,wBAAgB,cAAc,CAC5B,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC1B,MAAM,EAAE,mBAAmB,EAC3B,aAAa,CAAC,EAAE,aAAa,EAC7B,iBAAiB,CAAC,EAAE,iBAAiB,GACpC,eAAe,CAoDjB"}
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Dev-mode reachability witness: records every class-resolution outcome into a
|
|
3
|
-
* bounded in-page ring buffer at globalThis.__ANIMUS_WITNESS__. Development
|
|
4
|
-
* only — a production build records nothing and never creates the handle
|
|
5
|
-
* (IS_DEV is false). See is-dev.ts for the define/fold story and which hosts
|
|
6
|
-
* eliminate this code rather than merely gate it off. The handle name is the
|
|
7
|
-
* greppable exclusion token.
|
|
8
|
-
*/
|
|
9
1
|
export type WitnessOutcome = 'static' | 'dynamic' | 'drop';
|
|
10
2
|
export interface WitnessRecord {
|
|
11
3
|
component: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"witness.d.ts","sourceRoot":"","sources":["../../src/runtime/witness.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"witness.d.ts","sourceRoot":"","sources":["../../src/runtime/witness.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAC;AAE3D,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,cAAc,CAAC;CACzB;AAED,eAAO,MAAM,WAAW,OAAO,CAAC;AAEhC,wBAAgB,aAAa,CAC3B,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,cAAc,GACtB,IAAI,CAUN"}
|
package/dist/runtime-entry.d.ts
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Hook-free runtime entry — safe for React Server Components.
|
|
3
|
-
*
|
|
4
|
-
* Extracted components import from this subpath instead of the barrel
|
|
5
|
-
* so they don't pull in compose() (which uses createContext/useContext).
|
|
6
|
-
*/
|
|
1
|
+
/** Hook-free entry: extracted components import it from server components. */
|
|
7
2
|
export { createComponent } from './runtime';
|
|
8
|
-
export { createClassResolver } from './runtime/createClassResolver';
|
|
3
|
+
export { type ClassResolver, type ClassResolverAttributes, createClassResolver, } from './runtime/createClassResolver';
|
|
9
4
|
export { createComposedFamily } from './runtime/createComposedFamily';
|
|
10
5
|
//# sourceMappingURL=runtime-entry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-entry.d.ts","sourceRoot":"","sources":["../src/runtime-entry.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"runtime-entry.d.ts","sourceRoot":"","sources":["../src/runtime-entry.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,uBAAuB,EAC5B,mBAAmB,GACpB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC"}
|
package/dist/runtime-entry.js
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as createClassResolver } from "./createClassResolver-EpwTL9Sa.js";
|
|
2
|
+
import { n as createComponent, t as createComposedFamily } from "./createComposedFamily-C4NovMcd.js";
|
|
2
3
|
export { createClassResolver, createComponent, createComposedFamily };
|
package/dist/selectors.d.ts
CHANGED
|
@@ -1,64 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* Sort order determines cascade precedence within a layer:
|
|
5
|
-
* later entries override earlier ones when specificity is equal.
|
|
6
|
-
* The ordering follows CSS conventions (LVHA) and interaction semantics
|
|
7
|
-
* (disabled beats interaction states, pseudo-elements after states).
|
|
2
|
+
* `order` is cascade precedence inside a layer: a later entry overrides an
|
|
3
|
+
* earlier one at equal specificity.
|
|
8
4
|
*/
|
|
9
5
|
export interface SelectorAlias {
|
|
10
|
-
/** CSS selector string (comma-separated for compound selectors) */
|
|
11
6
|
selector: string;
|
|
12
|
-
/** Sort index for cascade ordering within a layer */
|
|
13
7
|
order: number;
|
|
14
8
|
}
|
|
15
9
|
export type SelectorAliasMap = Record<string, SelectorAlias>;
|
|
16
10
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* this interface publishes user registrations (`.addSelectors({ … })`) so they
|
|
20
|
-
* become typed both as `ThemedCSSProps` block keys AND as component callsite
|
|
21
|
-
* props (`SelectorAliasProps`) — making the `selector-alias-callsite`
|
|
22
|
-
* custom-alias promise actually true. A consumer publishes with:
|
|
23
|
-
*
|
|
24
|
-
* ```ts
|
|
25
|
-
* declare module '@animus-ui/system' {
|
|
26
|
-
* interface Selectors extends Record<SelectorsOf<typeof ds>, true> {}
|
|
27
|
-
* }
|
|
28
|
-
* ```
|
|
29
|
-
*
|
|
30
|
-
* Empty by default. JOINT NAMESPACE: publishing EITHER `Selectors` or
|
|
31
|
-
* `Conditions` flips the WHOLE `_` block-key namespace to validating —
|
|
32
|
-
* augmenting one without the other rejects the other's registered aliases.
|
|
33
|
-
* When both are empty, `_` block keys stay fully permissive; built-in
|
|
34
|
-
* selector aliases are the only `_` keys typed at CALLSITE-prop position.
|
|
11
|
+
* Module augmentation publishes custom aliases as typed `_` keys. Augmenting
|
|
12
|
+
* either `Selectors` or `Conditions` makes the whole `_` namespace validating.
|
|
35
13
|
*/
|
|
36
14
|
export interface Selectors {
|
|
37
15
|
}
|
|
38
|
-
/**
|
|
39
|
-
* Built-in selector aliases.
|
|
40
|
-
*
|
|
41
|
-
* Compound selectors (e.g. `_disabled`) target multiple CSS selectors
|
|
42
|
-
* via comma-separation to cover native, ARIA, and data attribute conventions.
|
|
43
|
-
*/
|
|
44
16
|
export declare const BUILT_IN_SELECTORS: SelectorAliasMap;
|
|
45
17
|
/**
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
* New aliases allocate orders CONTINUING from the highest existing order
|
|
49
|
-
* (floored at 490, so the first user alias lands at 500) rather than
|
|
50
|
-
* restarting at 500 each call (mirrors `mergeConditions`) — aliases from
|
|
51
|
-
* successive `.addSelectors()`/`extend()` merges must not collide on
|
|
52
|
-
* order 500.
|
|
18
|
+
* Order allocation continues past the highest existing order (floor 490, so
|
|
19
|
+
* the first custom alias is 500); restarting per call would collide.
|
|
53
20
|
*/
|
|
54
21
|
export declare function mergeSelectors(base: SelectorAliasMap, custom: Record<string, string>): SelectorAliasMap;
|
|
55
|
-
/** Get the sorted alias keys for deterministic cascade ordering. */
|
|
56
22
|
export declare function getSortedAliasKeys(map: SelectorAliasMap): string[];
|
|
57
|
-
/**
|
|
58
|
-
* Serialize the selector map for the extraction pipeline.
|
|
59
|
-
* Emits a flat `Record<string, string>` (alias → selector) plus
|
|
60
|
-
* the ordered key list for cascade determinism.
|
|
61
|
-
*/
|
|
62
23
|
export declare function serializeSelectorMap(map: SelectorAliasMap): {
|
|
63
24
|
selectors: Record<string, string>;
|
|
64
25
|
order: string[];
|
package/dist/selectors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../src/selectors.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../src/selectors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AAE7D;;;GAGG;AAEH,MAAM,WAAW,SAAS;CAAG;AAE7B,eAAO,MAAM,kBAAkB,EAAE,gBAoDhC,CAAC;AAEF;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,gBAAgB,EACtB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC7B,gBAAgB,CAelB;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,gBAAgB,GAAG,MAAM,EAAE,CAElE;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,gBAAgB,GAAG;IAC3D,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB,CAOA"}
|
|
@@ -9,16 +9,8 @@ function createTransform(name, fn) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* `transformSource`. A name match with the captured source missing on either
|
|
15
|
-
* side is a loud conflict (older-instance safety), as is a named/bare mix.
|
|
16
|
-
* Bare-function pairs compare by their own `toString()` (their body IS their
|
|
17
|
-
* source; only `createTransform` wrappers hide it). Known accepted residual:
|
|
18
|
-
* two functions with byte-identical source can close over different values
|
|
19
|
-
* and would coalesce — the loud-conflict alternative (identity-only) was
|
|
20
|
-
* measured to false-conflict every transform-bearing prop under duplicate
|
|
21
|
-
* module instances (inc-01 spike) and to forbid re-registering kit props.
|
|
12
|
+
* Two transforms with byte-identical source compare equal even when they
|
|
13
|
+
* close over different values.
|
|
22
14
|
*/
|
|
23
15
|
function areTransformsEqual(a, b) {
|
|
24
16
|
if (a === b) return true;
|
|
@@ -39,17 +31,11 @@ const stringScale = [];
|
|
|
39
31
|
const numericOrStringScale = [];
|
|
40
32
|
//#endregion
|
|
41
33
|
//#region src/transforms/border.ts
|
|
42
|
-
/**
|
|
43
|
-
* Self-contained transform: all logic inlined in the callback.
|
|
44
|
-
* No external references — satisfies the extraction constraint.
|
|
45
|
-
*/
|
|
34
|
+
/** All logic stays inline: the extractor cannot follow external references. */
|
|
46
35
|
const borderShorthand = createTransform("borderShorthand", (val) => typeof val === "number" ? `${val}px solid currentColor` : val);
|
|
47
36
|
//#endregion
|
|
48
37
|
//#region src/transforms/grid.ts
|
|
49
|
-
/**
|
|
50
|
-
* Self-contained transform: all logic inlined in the callback.
|
|
51
|
-
* No external references — satisfies the extraction constraint.
|
|
52
|
-
*/
|
|
38
|
+
/** All logic stays inline: the extractor cannot follow external references. */
|
|
53
39
|
const gridItem = createTransform("gridItem", (item) => {
|
|
54
40
|
const map = {
|
|
55
41
|
max: "max-content",
|
|
@@ -58,14 +44,7 @@ const gridItem = createTransform("gridItem", (item) => {
|
|
|
58
44
|
const strItem = String(item);
|
|
59
45
|
return `minmax(0, ${/^[0-9]*$/.test(strItem) ? `${strItem}fr` : map[strItem] ?? strItem})`;
|
|
60
46
|
});
|
|
61
|
-
/**
|
|
62
|
-
* Convert a grid item value to a CSS template string.
|
|
63
|
-
* Exported for non-extraction use — NOT referenced from createTransform callbacks.
|
|
64
|
-
*/
|
|
65
|
-
/**
|
|
66
|
-
* Self-contained transform: all logic inlined in the callback.
|
|
67
|
-
* Duplicates grid-item-to-template logic to avoid cross-transform reference.
|
|
68
|
-
*/
|
|
47
|
+
/** Template logic is duplicated rather than shared: no external references. */
|
|
69
48
|
const gridItemRatio = createTransform("gridItemRatio", (val) => {
|
|
70
49
|
const toTemplate = (item) => {
|
|
71
50
|
return `minmax(0, ${/^[0-9]*$/.test(item) ? `${item}fr` : {
|
|
@@ -93,19 +72,13 @@ const gridItemRatio = createTransform("gridItemRatio", (val) => {
|
|
|
93
72
|
});
|
|
94
73
|
//#endregion
|
|
95
74
|
//#region src/transforms/size.ts
|
|
96
|
-
/**
|
|
97
|
-
* Convert a numeric coordinate to a CSS value.
|
|
98
|
-
* Exported for non-extraction use — NOT referenced from the createTransform callback.
|
|
99
|
-
*/
|
|
75
|
+
/** The transform below cannot reference this: it inlines its own copy. */
|
|
100
76
|
const percentageOrAbsolute = (coordinate) => {
|
|
101
77
|
if (coordinate === 0) return coordinate;
|
|
102
78
|
if (coordinate <= 1 && coordinate >= -1) return `${coordinate * 100}%`;
|
|
103
79
|
return `${coordinate}px`;
|
|
104
80
|
};
|
|
105
|
-
/**
|
|
106
|
-
* Self-contained transform: all logic inlined in the callback.
|
|
107
|
-
* No external references — satisfies the extraction constraint.
|
|
108
|
-
*/
|
|
81
|
+
/** All logic stays inline: the extractor cannot follow external references. */
|
|
109
82
|
const size = createTransform("size", (value) => {
|
|
110
83
|
const toSize = (n) => {
|
|
111
84
|
if (n === 0) return n;
|