@animus-ui/system 0.1.20 → 0.1.21
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/dist/appearance/controller.d.ts +35 -0
- package/dist/appearance/controller.d.ts.map +1 -0
- package/dist/appearance/controller.js +69 -0
- package/dist/appearance/index.d.ts +2 -7
- package/dist/appearance/react.d.ts +10 -0
- package/dist/appearance/react.d.ts.map +1 -0
- package/dist/appearance/react.js +12 -0
- package/dist/appearance/svelte.d.ts +12 -0
- package/dist/appearance/svelte.d.ts.map +1 -0
- package/dist/appearance/svelte.js +14 -0
- package/dist/bootstrap/index.d.ts +24 -1
- package/dist/bootstrap/index.d.ts.map +1 -1
- package/dist/bootstrap/index.js +10 -2
- package/dist/class-resolver.d.ts +2 -6
- package/dist/class-resolver.js +1 -1
- package/dist/component-BLE0PgG8.d.ts +644 -0
- package/dist/component-BLE0PgG8.d.ts.map +1 -0
- package/dist/compose-CC_dzfx5.d.ts +15 -0
- package/dist/compose-CC_dzfx5.d.ts.map +1 -0
- package/dist/compose.d.ts +2 -12
- package/dist/composeWithContext.d.ts +9 -7
- package/dist/composeWithContext.d.ts.map +1 -1
- package/dist/createClassResolver-Do1nmvkf.d.ts +71 -0
- package/dist/createClassResolver-Do1nmvkf.d.ts.map +1 -0
- package/dist/{createClassResolver-DPLExqGy.js → createClassResolver-Dq6HCuqV.js} +23 -54
- package/dist/{createComposedFamily-C6CLAsMx.js → createComposedFamily-BAVEgGC5.js} +56 -10
- package/dist/createComposedFamily-yKBydh5x.d.ts +21 -0
- package/dist/createComposedFamily-yKBydh5x.d.ts.map +1 -0
- package/dist/groups/index.d.ts +702 -699
- package/dist/groups/index.d.ts.map +1 -1
- package/dist/index-BjJkQo64.d.ts +10 -0
- package/dist/index-BjJkQo64.d.ts.map +1 -0
- package/dist/index-NCIIKb9k.d.ts +670 -0
- package/dist/index-NCIIKb9k.d.ts.map +1 -0
- package/dist/index.d.ts +6 -26
- package/dist/index.js +140 -40
- package/dist/runtime-entry.d.ts +3 -5
- package/dist/runtime-entry.js +2 -2
- package/package.json +15 -3
- package/dist/Animus.d.ts +0 -81
- package/dist/Animus.d.ts.map +0 -1
- package/dist/AnimusExtended.d.ts +0 -82
- package/dist/AnimusExtended.d.ts.map +0 -1
- package/dist/SystemBuilder.d.ts +0 -305
- package/dist/SystemBuilder.d.ts.map +0 -1
- package/dist/appearance/index.d.ts.map +0 -1
- package/dist/asset.d.ts +0 -16
- package/dist/asset.d.ts.map +0 -1
- package/dist/bootstrap/createAppearanceBootstrap.d.ts +0 -14
- package/dist/bootstrap/createAppearanceBootstrap.d.ts.map +0 -1
- package/dist/class-resolver.d.ts.map +0 -1
- package/dist/compose.d.ts.map +0 -1
- package/dist/conditions.d.ts +0 -94
- package/dist/conditions.d.ts.map +0 -1
- package/dist/declarations.d.ts +0 -38
- package/dist/declarations.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/keyframes.d.ts +0 -24
- package/dist/keyframes.d.ts.map +0 -1
- package/dist/runtime/assert-root-slot.d.ts +0 -6
- package/dist/runtime/assert-root-slot.d.ts.map +0 -1
- package/dist/runtime/createClassResolver.d.ts +0 -11
- package/dist/runtime/createClassResolver.d.ts.map +0 -1
- package/dist/runtime/createComposedFamily.d.ts +0 -11
- package/dist/runtime/createComposedFamily.d.ts.map +0 -1
- package/dist/runtime/index.d.ts +0 -14
- package/dist/runtime/index.d.ts.map +0 -1
- package/dist/runtime/is-dev.d.ts +0 -6
- package/dist/runtime/is-dev.d.ts.map +0 -1
- package/dist/runtime/resolveClasses.d.ts +0 -83
- package/dist/runtime/resolveClasses.d.ts.map +0 -1
- package/dist/runtime/witness.d.ts +0 -10
- package/dist/runtime/witness.d.ts.map +0 -1
- package/dist/runtime-entry.d.ts.map +0 -1
- package/dist/scales/createScale.d.ts +0 -7
- package/dist/scales/createScale.d.ts.map +0 -1
- package/dist/selectors.d.ts +0 -27
- package/dist/selectors.d.ts.map +0 -1
- package/dist/theme/createTheme.d.ts +0 -170
- package/dist/theme/createTheme.d.ts.map +0 -1
- package/dist/theme/flattenScale.d.ts +0 -15
- package/dist/theme/flattenScale.d.ts.map +0 -1
- package/dist/theme/index.d.ts +0 -5
- package/dist/theme/index.d.ts.map +0 -1
- package/dist/theme/property-records.d.ts +0 -79
- package/dist/theme/property-records.d.ts.map +0 -1
- package/dist/theme/resolveReferences.d.ts +0 -27
- package/dist/theme/resolveReferences.d.ts.map +0 -1
- package/dist/theme/serializeTokens.d.ts +0 -5
- package/dist/theme/serializeTokens.d.ts.map +0 -1
- package/dist/theme/types.d.ts +0 -20
- package/dist/theme/types.d.ts.map +0 -1
- package/dist/theme/utils.d.ts +0 -11
- package/dist/theme/utils.d.ts.map +0 -1
- package/dist/transforms/border.d.ts +0 -3
- package/dist/transforms/border.d.ts.map +0 -1
- package/dist/transforms/createTransform.d.ts +0 -24
- package/dist/transforms/createTransform.d.ts.map +0 -1
- package/dist/transforms/grid.d.ts +0 -5
- package/dist/transforms/grid.d.ts.map +0 -1
- package/dist/transforms/index.d.ts +0 -5
- package/dist/transforms/index.d.ts.map +0 -1
- package/dist/transforms/size.d.ts +0 -5
- package/dist/transforms/size.d.ts.map +0 -1
- package/dist/types/component.d.ts +0 -100
- package/dist/types/component.d.ts.map +0 -1
- package/dist/types/config.d.ts +0 -149
- package/dist/types/config.d.ts.map +0 -1
- package/dist/types/properties.d.ts +0 -17
- package/dist/types/properties.d.ts.map +0 -1
- package/dist/types/props.d.ts +0 -19
- package/dist/types/props.d.ts.map +0 -1
- package/dist/types/scales.d.ts +0 -3
- package/dist/types/scales.d.ts.map +0 -1
- package/dist/types/shared.d.ts +0 -4
- package/dist/types/shared.d.ts.map +0 -1
- package/dist/types/theme.d.ts +0 -111
- package/dist/types/theme.d.ts.map +0 -1
- package/dist/types/utils.d.ts +0 -5
- package/dist/types/utils.d.ts.map +0 -1
- package/dist/utils/deepMerge.d.ts +0 -2
- package/dist/utils/deepMerge.d.ts.map +0 -1
package/dist/declarations.d.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import type { DeclarationProp, SystemProp } from './types/config';
|
|
2
|
-
/** One key's declarations: canonical member name → CSS value. */
|
|
3
|
-
export interface DeclarationRecord {
|
|
4
|
-
[member: string]: string | number;
|
|
5
|
-
}
|
|
6
|
-
/** Scale key → that key's complete record. */
|
|
7
|
-
export interface DeclarationScaleValues {
|
|
8
|
-
[key: string]: DeclarationRecord;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* What an author can hand a declaration scale before it is validated: plain
|
|
12
|
-
* JavaScript data whose shape the types may not have enforced.
|
|
13
|
-
*/
|
|
14
|
-
export type AuthoredDeclarationValue = string | number | boolean | null | undefined | AuthoredDeclarationRecord | readonly AuthoredDeclarationValue[];
|
|
15
|
-
export interface AuthoredDeclarationRecord {
|
|
16
|
-
readonly [key: string]: AuthoredDeclarationValue;
|
|
17
|
-
}
|
|
18
|
-
export declare function isDeclarationProp(entry: SystemProp | undefined): entry is DeclarationProp;
|
|
19
|
-
/**
|
|
20
|
-
* The camelCase spelling of a CSS property, so `font-size` and `fontSize`
|
|
21
|
-
* name one member; vendor prefixes follow React's spelling (`WebkitX`,
|
|
22
|
-
* `msX`). Custom properties are not members.
|
|
23
|
-
*/
|
|
24
|
-
export declare function canonicalMemberName(name: string): string | undefined;
|
|
25
|
-
/**
|
|
26
|
-
* A declaration prop with its members canonicalized. Matching its members
|
|
27
|
-
* against the effective scale happens where the system and theme meet.
|
|
28
|
-
*/
|
|
29
|
-
export declare function validateDeclarationProp(propName: string, entry: DeclarationProp): DeclarationProp;
|
|
30
|
-
/**
|
|
31
|
-
* Each record must be flat, with string or finite-number values, and every
|
|
32
|
-
* record of one scale must set the same members. Returns the records with
|
|
33
|
-
* canonical member names.
|
|
34
|
-
*/
|
|
35
|
-
export declare function validateDeclarationRecords(label: string, scale: string, values: AuthoredDeclarationValue): DeclarationScaleValues;
|
|
36
|
-
/** Every record names the members of the first; the diagnostic names the gap. */
|
|
37
|
-
export declare function assertUniformMembers(label: string, scale: string, values: DeclarationScaleValues): void;
|
|
38
|
-
//# sourceMappingURL=declarations.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"declarations.d.ts","sourceRoot":"","sources":["../src/declarations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAElE,iEAAiE;AACjE,MAAM,WAAW,iBAAiB;IAChC,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;CACnC;AAED,8CAA8C;AAC9C,MAAM,WAAW,sBAAsB;IACrC,CAAC,GAAG,EAAE,MAAM,GAAG,iBAAiB,CAAC;CAClC;AAED;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAChC,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,SAAS,GACT,yBAAyB,GACzB,SAAS,wBAAwB,EAAE,CAAC;AAExC,MAAM,WAAW,yBAAyB;IACxC,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,wBAAwB,CAAC;CAClD;AAqCD,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,UAAU,GAAG,SAAS,GAC5B,KAAK,IAAI,eAAe,CAE1B;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAkBpE;AAyBD;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,eAAe,GACrB,eAAe,CA2BjB;AA2CD;;;;GAIG;AACH,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,wBAAwB,GAC/B,sBAAsB,CAexB;AAED,iFAAiF;AACjF,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,MAAM,EA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K,EACL,UAAU,EACV,kBAAkB,EAClB,UAAU,EACV,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,WAAW,EACX,gBAAgB,EAChB,aAAa,GACd,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,aAAa,EACb,aAAa,EACb,cAAc,EACd,UAAU,GACX,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC3D,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,YAAY,EACV,aAAa,EACb,SAAS,EACT,wBAAwB,EACxB,gBAAgB,EAChB,aAAa,EACb,yBAAyB,EACzB,aAAa,EACb,aAAa,EACb,iBAAiB,EACjB,aAAa,EACb,eAAe,EACf,sBAAsB,EACtB,KAAK,EACL,aAAa,EACb,kBAAkB,EAClB,WAAW,GACZ,MAAM,eAAe,CAAC"}
|
package/dist/keyframes.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
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.
|
|
4
|
-
*/
|
|
5
|
-
export type KeyframeFrameMap = Record<string, Record<string, unknown>>;
|
|
6
|
-
export interface KeyframeRef<Name extends string> {
|
|
7
|
-
readonly __brand: 'KeyframeRef';
|
|
8
|
-
readonly __name: Name;
|
|
9
|
-
toString(): string;
|
|
10
|
-
valueOf(): string;
|
|
11
|
-
}
|
|
12
|
-
export type Keyframes<Map extends Record<string, KeyframeFrameMap>> = {
|
|
13
|
-
readonly __brand: 'Keyframes';
|
|
14
|
-
readonly __frames: {
|
|
15
|
-
readonly [K in keyof Map & string]: {
|
|
16
|
-
readonly name: string;
|
|
17
|
-
readonly frames: Map[K];
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
} & {
|
|
21
|
-
readonly [K in keyof Map & string]: KeyframeRef<K>;
|
|
22
|
-
};
|
|
23
|
-
export declare function keyframes<Map extends Record<string, KeyframeFrameMap>>(map: Map): Keyframes<Map>;
|
|
24
|
-
//# sourceMappingURL=keyframes.d.ts.map
|
package/dist/keyframes.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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,6 +0,0 @@
|
|
|
1
|
-
/**
|
|
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.
|
|
4
|
-
*/
|
|
5
|
-
export declare function assertRootSlot(slots: object, fnName: string): void;
|
|
6
|
-
//# sourceMappingURL=assert-root-slot.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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,11 +0,0 @@
|
|
|
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;
|
|
11
|
-
//# sourceMappingURL=createClassResolver.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The extraction emitter rewrites `compose()` calls to this form. It stays
|
|
3
|
-
* hook- and context-free so composed families work in server components.
|
|
4
|
-
*/
|
|
5
|
-
import { type ForwardRefExoticComponent } from 'react';
|
|
6
|
-
interface ComposedFamilyConfig {
|
|
7
|
-
name: string;
|
|
8
|
-
}
|
|
9
|
-
export declare function createComposedFamily(slots: Record<string, ForwardRefExoticComponent<any>>, config: ComposedFamilyConfig): Record<string, ForwardRefExoticComponent<any>>;
|
|
10
|
-
export {};
|
|
11
|
-
//# sourceMappingURL=createComposedFamily.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { forwardRef } from 'react';
|
|
2
|
-
import { type ClassResolverConfig, type DynamicPropConfig, type SystemPropMap } from './resolveClasses';
|
|
3
|
-
interface ComponentConfig extends ClassResolverConfig {
|
|
4
|
-
}
|
|
5
|
-
type ElementType = string | React.ComponentType<any>;
|
|
6
|
-
type Transform = NonNullable<DynamicPropConfig[string]['transform']>;
|
|
7
|
-
type AnimusComponent = ReturnType<typeof forwardRef> & {
|
|
8
|
-
extend: () => never;
|
|
9
|
-
variantDefaults: Readonly<Record<string, string>>;
|
|
10
|
-
customTransforms: Readonly<Record<string, Transform>>;
|
|
11
|
-
};
|
|
12
|
-
export declare function createComponent(element: ElementType, className: string, config: ComponentConfig, systemPropMap?: SystemPropMap, dynamicPropConfig?: DynamicPropConfig): AnimusComponent;
|
|
13
|
-
export {};
|
|
14
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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,SAAS,GAAG,WAAW,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC;AAErE,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;IAClD,gBAAgB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;CACvD,CAAC;AAwHF,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,CA4EjB"}
|
package/dist/runtime/is-dev.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
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,83 +0,0 @@
|
|
|
1
|
-
interface VariantConfig {
|
|
2
|
-
options: string[];
|
|
3
|
-
default?: string;
|
|
4
|
-
}
|
|
5
|
-
interface CompoundConfig {
|
|
6
|
-
conditions: Record<string, string | string[]>;
|
|
7
|
-
className: string;
|
|
8
|
-
}
|
|
9
|
-
export interface ClassResolverConfig {
|
|
10
|
-
variants?: Record<string, VariantConfig>;
|
|
11
|
-
compounds?: CompoundConfig[];
|
|
12
|
-
states?: string[];
|
|
13
|
-
systemPropNames?: string[];
|
|
14
|
-
customPropMap?: Record<string, Record<string, string>>;
|
|
15
|
-
customDynamicConfig?: DynamicPropConfig;
|
|
16
|
-
/** Callback props whose `customPropMap` keys are `typedValueKey`s. */
|
|
17
|
-
typedCustomProps?: readonly string[];
|
|
18
|
-
/** System props bound to a configured transform, whose `systemPropMap`
|
|
19
|
-
* keys are `typedValueKey`s. */
|
|
20
|
-
typedSystemProps?: readonly string[];
|
|
21
|
-
}
|
|
22
|
-
export type SystemPropMap = Record<string, Record<string, string>>;
|
|
23
|
-
interface ValueDynamicPropConfig {
|
|
24
|
-
varName: string;
|
|
25
|
-
slotClass: string;
|
|
26
|
-
property?: string;
|
|
27
|
-
properties?: readonly string[];
|
|
28
|
-
/** The bound transform's readable name, for diagnostics. */
|
|
29
|
-
transformName?: string;
|
|
30
|
-
/** The bound definition's key in the generated `transforms` registry. */
|
|
31
|
-
transformId?: string;
|
|
32
|
-
transform?: (value: string | number) => string | number;
|
|
33
|
-
scaleValues?: Record<string, string | number>;
|
|
34
|
-
negative?: boolean;
|
|
35
|
-
/** Values outside `scaleValues` are dropped, not applied raw. */
|
|
36
|
-
strict?: boolean;
|
|
37
|
-
/** The keywords a strict prop admits beside its tokens. */
|
|
38
|
-
keywords?: readonly string[];
|
|
39
|
-
/** The custom property the prop's slot also writes. */
|
|
40
|
-
currentVar?: string;
|
|
41
|
-
kind?: never;
|
|
42
|
-
}
|
|
43
|
-
interface DeclarationDynamicPropConfig {
|
|
44
|
-
kind: 'declarations';
|
|
45
|
-
slotClass: string;
|
|
46
|
-
/** Member property → its variable; a breakpoint appends `-{bp}`. */
|
|
47
|
-
memberVars: Record<string, string>;
|
|
48
|
-
/** Scale key → member property → resolved CSS value. */
|
|
49
|
-
declarationScaleValues: Record<string, Record<string, string>>;
|
|
50
|
-
}
|
|
51
|
-
type DeclarationConfig = DeclarationDynamicPropConfig & {
|
|
52
|
-
[K in Exclude<keyof ValueDynamicPropConfig, 'kind' | 'slotClass'>]?: never;
|
|
53
|
-
};
|
|
54
|
-
export type DynamicPropConfig = Record<string, ValueDynamicPropConfig | DeclarationConfig>;
|
|
55
|
-
/**
|
|
56
|
-
* A mixed property set resolves to unitless: a bare number on a length
|
|
57
|
-
* property is dropped by the parser, `px` on a unitless one shifts layout.
|
|
58
|
-
*/
|
|
59
|
-
export declare function applyUnitFallback(value: string | number, cssProperties: readonly string[]): string;
|
|
60
|
-
/**
|
|
61
|
-
* The key format is fixed by the Rust css generator; a divergence here misses
|
|
62
|
-
* every static class lookup.
|
|
63
|
-
*/
|
|
64
|
-
export declare function serializeValueKey(value: unknown): string;
|
|
65
|
-
/**
|
|
66
|
-
* The domain is results that failed `isValidTransformResult`; a valid string
|
|
67
|
-
* or finite number passed here is mislabeled.
|
|
68
|
-
*/
|
|
69
|
-
export declare function describeResultShape(result: unknown): string;
|
|
70
|
-
type DynamicEntryConfig = Pick<ValueDynamicPropConfig, 'varName' | 'property' | 'properties' | 'transform' | 'scaleValues' | 'negative' | 'strict' | 'keywords'>;
|
|
71
|
-
/**
|
|
72
|
-
* `null` means the value missed a strict scale, or a configured transform
|
|
73
|
-
* threw or returned neither a string nor a finite number.
|
|
74
|
-
*/
|
|
75
|
-
export declare function resolveValue(value: unknown, dc: DynamicEntryConfig): string | null;
|
|
76
|
-
export interface ClassResolution {
|
|
77
|
-
classes: string[];
|
|
78
|
-
dynamicStyle?: Record<string, string>;
|
|
79
|
-
activeStates: string[];
|
|
80
|
-
}
|
|
81
|
-
export declare function resolveClasses(baseClassName: string, props: Record<string, any>, config: ClassResolverConfig, systemPropMap?: SystemPropMap, dynamicPropConfig?: DynamicPropConfig): ClassResolution;
|
|
82
|
-
export {};
|
|
83
|
-
//# sourceMappingURL=resolveClasses.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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;IACxC,sEAAsE;IACtE,gBAAgB,CAAC,EAAE,SAAS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;
|
|
5
|
-
value: string;
|
|
6
|
-
outcome: WitnessOutcome;
|
|
7
|
-
}
|
|
8
|
-
export declare const WITNESS_CAP = 5000;
|
|
9
|
-
export declare function recordWitness(component: string, prop: string, value: unknown, outcome: WitnessOutcome): void;
|
|
10
|
-
//# sourceMappingURL=witness.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export declare const createScale: <T extends string | number>() => readonly T[] & {
|
|
2
|
-
length: 0;
|
|
3
|
-
};
|
|
4
|
-
export declare const numericScale: (number & {})[];
|
|
5
|
-
export declare const stringScale: (string & {})[];
|
|
6
|
-
export declare const numericOrStringScale: ((string & {}) | (number & {}))[];
|
|
7
|
-
//# sourceMappingURL=createScale.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createScale.d.ts","sourceRoot":"","sources":["../../src/scales/createScale.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,GAAI,CAAC,SAAS,MAAM,GAAG,MAAM,OAC7C,SAAS,CAAC,EAAE,GAAG;IAAE,MAAM,EAAE,CAAC,CAAA;CAAE,CAAC;AAErC,eAAO,MAAM,YAAY,EAAS,CAAC,MAAM,GAAG,EAAE,CAAC,EAAE,CAAC;AAElD,eAAO,MAAM,WAAW,EAAS,CAAC,MAAM,GAAG,EAAE,CAAC,EAAE,CAAC;AAEjD,eAAO,MAAM,oBAAoB,EAAS,CAAC,CAAC,MAAM,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC"}
|
package/dist/selectors.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `order` is cascade precedence inside a layer: a later entry overrides an
|
|
3
|
-
* earlier one at equal specificity.
|
|
4
|
-
*/
|
|
5
|
-
export interface SelectorAlias {
|
|
6
|
-
selector: string;
|
|
7
|
-
order: number;
|
|
8
|
-
}
|
|
9
|
-
export type SelectorAliasMap = Record<string, SelectorAlias>;
|
|
10
|
-
/**
|
|
11
|
-
* Module augmentation publishes custom aliases as typed `_` keys. Augmenting
|
|
12
|
-
* either `Selectors` or `Conditions` makes the whole `_` namespace validating.
|
|
13
|
-
*/
|
|
14
|
-
export interface Selectors {
|
|
15
|
-
}
|
|
16
|
-
export declare const BUILT_IN_SELECTORS: SelectorAliasMap;
|
|
17
|
-
/**
|
|
18
|
-
* Order allocation continues past the highest existing order (floor 490, so
|
|
19
|
-
* the first custom alias is 500); restarting per call would collide.
|
|
20
|
-
*/
|
|
21
|
-
export declare function mergeSelectors(base: SelectorAliasMap, custom: Record<string, string>): SelectorAliasMap;
|
|
22
|
-
export declare function getSortedAliasKeys(map: SelectorAliasMap): string[];
|
|
23
|
-
export declare function serializeSelectorMap(map: SelectorAliasMap): {
|
|
24
|
-
selectors: Record<string, string>;
|
|
25
|
-
order: string[];
|
|
26
|
-
};
|
|
27
|
-
//# sourceMappingURL=selectors.d.ts.map
|
package/dist/selectors.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
import { type DeclarationScaleValues } from '../declarations';
|
|
2
|
-
import { ColorModeOptions, ContextualVarRegistration, CSSColorValue, ModeAliasDefinition, SerializedTheme, ThemeCssFragment, ThemeManifest, ThemeStructuralKey, TokenDefinition } from '../types/theme';
|
|
3
|
-
import { LiteralPaths } from './flattenScale';
|
|
4
|
-
import { type PropertyStore } from './property-records';
|
|
5
|
-
/** Identity mapping that caches the type, preventing TS2589 depth growth. */
|
|
6
|
-
export type Flatten<T> = {
|
|
7
|
-
[K in keyof T]: T[K];
|
|
8
|
-
};
|
|
9
|
-
type MergeRecord<Base, Incoming> = Omit<Base, keyof Incoming> & Incoming;
|
|
10
|
-
/**
|
|
11
|
-
* Var NAMES across all scales. Derives from the already-inferred `Vars`, so it
|
|
12
|
-
* never feeds back into inference or perturbs literal-key narrowing.
|
|
13
|
-
*/
|
|
14
|
-
type ContextualVarNames<Vars> = {
|
|
15
|
-
[K in keyof Vars]: Vars[K] extends readonly (infer N extends string)[] ? N : never;
|
|
16
|
-
}[keyof Vars];
|
|
17
|
-
type ThemeScaleKeys<T> = Exclude<keyof T & string, ThemeStructuralKey>;
|
|
18
|
-
/** Theme data plus boundary members, non-enumerable at runtime. */
|
|
19
|
-
type BuiltTheme<T, Emitted extends string> = {
|
|
20
|
-
[K in keyof T]: T[K];
|
|
21
|
-
} & {
|
|
22
|
-
/** Tuple wrapper prevents never-distribution. Non-enumerable at runtime. */
|
|
23
|
-
readonly __emitted: [Emitted];
|
|
24
|
-
manifest: ThemeManifest;
|
|
25
|
-
serialize(): SerializedTheme;
|
|
26
|
-
/** Dot-path token → `var()` ref, or the raw value if not emitted. */
|
|
27
|
-
varRef(tokenPath: string): string | undefined;
|
|
28
|
-
};
|
|
29
|
-
/**
|
|
30
|
-
* Manifest fields carried through the explicit manifest read — the manifest is
|
|
31
|
-
* non-enumerable. Read-only: `build()` regenerates every fragment.
|
|
32
|
-
*/
|
|
33
|
-
interface CarriedManifestV2 {
|
|
34
|
-
tokenDefinitions?: Record<string, TokenDefinition>;
|
|
35
|
-
emittedScales?: string[];
|
|
36
|
-
modeAliasDefinitions?: ModeAliasDefinition;
|
|
37
|
-
registrations?: Record<string, ContextualVarRegistration>;
|
|
38
|
-
emitterVersion?: number;
|
|
39
|
-
contractHash?: string;
|
|
40
|
-
cssFragments?: ThemeCssFragment[];
|
|
41
|
-
}
|
|
42
|
-
interface BuilderState {
|
|
43
|
-
theme: Record<string, unknown>;
|
|
44
|
-
emittedScales: Set<string>;
|
|
45
|
-
/** One record per declared custom property, contextual variables included. */
|
|
46
|
-
properties: PropertyStore;
|
|
47
|
-
carriedManifestV2?: CarriedManifestV2;
|
|
48
|
-
/**
|
|
49
|
-
* A source manifest without the v2 discriminant: the authored graph is
|
|
50
|
-
* unknowable, so `build()` suppresses all v2 fields instead of fabricating.
|
|
51
|
-
*/
|
|
52
|
-
hasLegacyManifestSource: boolean;
|
|
53
|
-
/**
|
|
54
|
-
* Flattened leaf path → 1-based index of the `extend()` call that first
|
|
55
|
-
* defined it; sibling conflicts name both sources by that index.
|
|
56
|
-
*/
|
|
57
|
-
extendProvenance: Map<string, number>;
|
|
58
|
-
extendCount: number;
|
|
59
|
-
/**
|
|
60
|
-
* Mode names carried in by `extend()`. Exempt from the coverage gate — a
|
|
61
|
-
* kit's own alias asymmetry must round-trip unchanged.
|
|
62
|
-
*/
|
|
63
|
-
inheritedModes: Set<string>;
|
|
64
|
-
/**
|
|
65
|
-
* Alias dot-paths from extended sources: a consumer-declared mode must cover
|
|
66
|
-
* them or name a base.
|
|
67
|
-
*/
|
|
68
|
-
inheritedModeAliases: Set<string>;
|
|
69
|
-
/**
|
|
70
|
-
* Token path dropped by `addScale({ replace: true })` → the replaced scale.
|
|
71
|
-
* A reference to one that is never re-added fails `build()`.
|
|
72
|
-
*/
|
|
73
|
-
droppedTokenPaths: Map<string, string>;
|
|
74
|
-
/**
|
|
75
|
-
* Declaration scales by name, kept out of `theme` so the scalar flatten
|
|
76
|
-
* never sees their records. Records are replaced whole, never merged.
|
|
77
|
-
*/
|
|
78
|
-
declarationScales: Record<string, DeclarationScaleValues>;
|
|
79
|
-
/** `scale.key` → the 1-based `extend()` call that first defined it. */
|
|
80
|
-
declarationProvenance: Map<string, number>;
|
|
81
|
-
}
|
|
82
|
-
type DeclarationScalesOfTheme<T> = T extends {
|
|
83
|
-
__declarationScales: infer Scales;
|
|
84
|
-
} ? Scales : {};
|
|
85
|
-
/** Per-scale key union; `Over` records win, as runtime composition does. */
|
|
86
|
-
type MergeDeclarationScales<Base, Over> = Flatten<{
|
|
87
|
-
[Scale in keyof Base | keyof Over]: Scale extends keyof Over ? Scale extends keyof Base ? Flatten<MergeRecord<Base[Scale], Over[Scale]>> : Over[Scale] : Scale extends keyof Base ? Base[Scale] : never;
|
|
88
|
-
}>;
|
|
89
|
-
/** A theme without declaration scales keeps its type unchanged. */
|
|
90
|
-
type WithDeclarationScales<Merged, Scales> = [keyof Scales] extends [never] ? Merged : Flatten<Omit<Merged, '__declarationScales'> & Record<'__declarationScales', Scales>>;
|
|
91
|
-
type ThemeSourceOf<Source> = Source extends {
|
|
92
|
-
system: {
|
|
93
|
-
toConfig(...args: never[]): unknown;
|
|
94
|
-
};
|
|
95
|
-
theme?: infer ThemeHalf;
|
|
96
|
-
tokens?: infer TokensHalf;
|
|
97
|
-
} ? ThemeHalf extends Record<string, unknown> ? ThemeHalf : TokensHalf extends Record<string, unknown> ? TokensHalf : Record<never, never> : Source;
|
|
98
|
-
type ThemeBoundaryKey = '__emitted' | 'manifest' | 'serialize' | 'varRef';
|
|
99
|
-
type ThemeDataOf<Source> = {
|
|
100
|
-
[Key in keyof Source as Key extends ThemeBoundaryKey ? never : Extract<Source[Key], (...args: never[]) => unknown> extends never ? Key : never]: Source[Key];
|
|
101
|
-
};
|
|
102
|
-
type MergeThemeData<Base, Source> = Flatten<MergeRecord<Base, ThemeDataOf<Source>>>;
|
|
103
|
-
type EmittedThemeScalesOf<Source> = Source extends {
|
|
104
|
-
readonly __emitted: [infer Emitted extends string];
|
|
105
|
-
} ? Emitted : never;
|
|
106
|
-
type ExtendedThemeSourceOf<Source> = Source extends {
|
|
107
|
-
system: {
|
|
108
|
-
toConfig(...args: never[]): unknown;
|
|
109
|
-
};
|
|
110
|
-
theme?: infer ThemeHalf;
|
|
111
|
-
tokens?: infer TokensHalf;
|
|
112
|
-
} ? ThemeHalf extends Record<string, unknown> ? ThemeHalf : TokensHalf extends Record<string, unknown> ? TokensHalf : Record<never, never> : Source;
|
|
113
|
-
declare const THEME_STAGE_BRAND: unique symbol;
|
|
114
|
-
/**
|
|
115
|
-
* Phantom builder stage: `extend()` is callable only while `'inherit'`, and
|
|
116
|
-
* every augmentation method advances to `'extend'`. `from()` is not gated.
|
|
117
|
-
*/
|
|
118
|
-
export type ThemeBuilderStage = 'inherit' | 'extend';
|
|
119
|
-
export declare class ThemeBuilder<T extends Record<string, unknown> = Record<string, unknown>, Emitted extends string = never, Stage extends ThemeBuilderStage = 'inherit'> {
|
|
120
|
-
readonly [THEME_STAGE_BRAND]?: Stage;
|
|
121
|
-
/** @internal */ _state: BuilderState;
|
|
122
|
-
constructor(state: BuilderState);
|
|
123
|
-
addBreakpoints<BP extends Record<string, number>>(breakpoints: BP): ThemeBuilder<{ [K in keyof (Omit<T, "breakpoints"> & Record<"breakpoints", { [K in keyof BP]: BP[K]; }>)]: (Omit<T, "breakpoints"> & Record<"breakpoints", { [K in keyof BP]: BP[K]; }>)[K]; }, Emitted, "extend">;
|
|
124
|
-
/**
|
|
125
|
-
* Source-WINS precedence over prior builder state, callable at any stage.
|
|
126
|
-
* @deprecated Use `extend(source)` — the source seeds the base, local wins.
|
|
127
|
-
*/
|
|
128
|
-
from<Source extends object>(builtTheme: Source): ThemeBuilder<WithDeclarationScales<Flatten<MergeRecord<T, ThemeDataOf<ThemeSourceOf<Source>>>>, Flatten<{ [Scale in keyof DeclarationScalesOfTheme<T> | keyof DeclarationScalesOfTheme<ThemeSourceOf<Source>>]: Scale extends keyof DeclarationScalesOfTheme<ThemeSourceOf<Source>> ? Scale extends keyof DeclarationScalesOfTheme<T> ? Flatten<MergeRecord<DeclarationScalesOfTheme<T>[Scale], DeclarationScalesOfTheme<ThemeSourceOf<Source>>[Scale]>> : DeclarationScalesOfTheme<ThemeSourceOf<Source>>[Scale] : Scale extends keyof DeclarationScalesOfTheme<T> ? DeclarationScalesOfTheme<T>[Scale] : never; }>>, Emitted | EmittedThemeScalesOf<ThemeSourceOf<Source>>, Stage>;
|
|
129
|
-
/**
|
|
130
|
-
* Inherits a built theme or library bundle as the BASE; local calls after
|
|
131
|
-
* `extend()` win, and leaves that two sources define divergently throw.
|
|
132
|
-
*/
|
|
133
|
-
extend<Source extends object>(this: ThemeBuilder<T, Emitted, 'inherit'>, source: Source): ThemeBuilder<WithDeclarationScales<MergeThemeData<T, ExtendedThemeSourceOf<Source>>, MergeDeclarationScales<DeclarationScalesOfTheme<ExtendedThemeSourceOf<Source>>, DeclarationScalesOfTheme<T>>>, Emitted | EmittedThemeScalesOf<ExtendedThemeSourceOf<Source>>, 'inherit'>;
|
|
134
|
-
addColors<Colors extends Record<string, CSSColorValue | Record<string, CSSColorValue>>, NextColors extends LiteralPaths<Colors, '.'> = LiteralPaths<Colors, '.'>>(colors: Colors): ThemeBuilder<Flatten<Omit<T, "colors"> & Record<"colors", Flatten<MergeRecord<T extends {
|
|
135
|
-
colors: infer Existing;
|
|
136
|
-
} ? Existing : {}, NextColors>>>>, "colors" | Emitted, "extend">;
|
|
137
|
-
addColorModes<Config extends Record<string, Record<string, unknown>>, AliasKeys extends LiteralPaths<Config[keyof Config], '.', '_'> = LiteralPaths<Config[keyof Config], '.', '_'>>(initialMode: string, modeConfig: Config, options?: ColorModeOptions<Config>): ThemeBuilder<{ [K in keyof (Omit<T, "colors"> & Record<"colors", (T extends {
|
|
138
|
-
colors: infer C;
|
|
139
|
-
} ? C : unknown) & AliasKeys>)]: (Omit<T, "colors"> & Record<"colors", (T extends {
|
|
140
|
-
colors: infer C;
|
|
141
|
-
} ? C : unknown) & AliasKeys>)[K]; }, Emitted, "extend">;
|
|
142
|
-
addScale<Key extends string, Values extends Record<string | number, string | number | Record<string, string | number>>, Emit extends boolean = false, Replace extends boolean = false, NewScale extends LiteralPaths<Values, '.'> = LiteralPaths<Values, '.'>>(config: {
|
|
143
|
-
name: Key & (Key extends ThemeStructuralKey ? never : unknown);
|
|
144
|
-
values: Values;
|
|
145
|
-
emit?: Emit;
|
|
146
|
-
replace?: Replace;
|
|
147
|
-
}): ThemeBuilder<Flatten<Omit<T, Key> & Record<Key, Replace extends true ? NewScale : Flatten<MergeRecord<Key extends keyof T ? T[Key] : {}, NewScale>>>>, Emit extends true ? Emitted | Key : Emitted, "extend">;
|
|
148
|
-
/**
|
|
149
|
-
* Registers a finite declaration scale: each key maps to a flat record of
|
|
150
|
-
* CSS declarations, and every record sets the same members. Bind it with a
|
|
151
|
-
* `{ kind: 'declarations', scale, members }` system or component prop. Keys merge by
|
|
152
|
-
* record; `replace` makes the scale exactly these keys.
|
|
153
|
-
*/
|
|
154
|
-
addDeclarationScale<Key extends string, Values extends Record<string | number, Record<string, string | number>>, Replace extends boolean = false>(config: {
|
|
155
|
-
name: Key & (Key extends ThemeStructuralKey ? never : unknown);
|
|
156
|
-
values: Values;
|
|
157
|
-
replace?: Replace;
|
|
158
|
-
}): ThemeBuilder<Flatten<Omit<T, "__declarationScales"> & Record<"__declarationScales", Flatten<Omit<DeclarationScalesOfTheme<T>, Key> & Record<Key, Replace extends true ? { [K in keyof Values]: Values[K]; } : Flatten<MergeRecord<Key extends keyof DeclarationScalesOfTheme<T> ? DeclarationScalesOfTheme<T>[Key] : {}, Values>>>>>>, Emitted, "extend">;
|
|
159
|
-
declareContextualVars<const Vars extends Partial<{
|
|
160
|
-
[K in ThemeScaleKeys<T>]: readonly string[];
|
|
161
|
-
}>>(vars: Vars & Record<Exclude<keyof Vars, ThemeScaleKeys<T>>, never>, registrations?: Partial<Record<ContextualVarNames<Vars>, ContextualVarRegistration>>): ThemeBuilder<{ [K in keyof T]: K extends keyof Vars ? Vars[K] extends readonly string[] ? T[K] & Record<Vars[K][number], `var(--${string})`> : T[K] : T[K]; }, Emitted, "extend">;
|
|
162
|
-
extendScale<Key extends Exclude<keyof T, ThemeStructuralKey>, Fn extends (tokens: T[Key]) => Record<string | number, unknown>>(key: Key, updateFn: Fn): ThemeBuilder<Flatten<Omit<T, Key> & Record<Key, Flatten<MergeRecord<T[Key], ReturnType<Fn>>>>>, Emitted, "extend">;
|
|
163
|
-
build(): BuiltTheme<T, Emitted>;
|
|
164
|
-
}
|
|
165
|
-
type EmptyTheme = {
|
|
166
|
-
breakpoints: Record<string, number>;
|
|
167
|
-
};
|
|
168
|
-
export declare function createTheme(): ThemeBuilder<EmptyTheme, never, "inherit">;
|
|
169
|
-
export {};
|
|
170
|
-
//# sourceMappingURL=createTheme.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createTheme.d.ts","sourceRoot":"","sources":["../../src/theme/createTheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,sBAAsB,EAE5B,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAEL,gBAAgB,EAChB,yBAAyB,EACzB,aAAa,EACb,mBAAmB,EACnB,eAAe,EAEf,gBAAgB,EAChB,aAAa,EACb,kBAAkB,EAClB,eAAe,EAEhB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAcL,KAAK,aAAa,EACnB,MAAM,oBAAoB,CAAC;AAsS5B,6EAA6E;AAC7E,MAAM,MAAM,OAAO,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAE,CAAC;AAElD,KAAK,WAAW,CAAC,IAAI,EAAE,QAAQ,IAAI,IAAI,CAAC,IAAI,EAAE,MAAM,QAAQ,CAAC,GAAG,QAAQ,CAAC;AAEzE;;;GAGG;AACH,KAAK,kBAAkB,CAAC,IAAI,IAAI;KAC7B,CAAC,IAAI,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,SAAS,SAAS,CAAC,MAAM,CAAC,SAAS,MAAM,CAAC,EAAE,GAClE,CAAC,GACD,KAAK;CACV,CAAC,MAAM,IAAI,CAAC,CAAC;AAEd,KAAK,cAAc,CAAC,CAAC,IAAI,OAAO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+0,0 @@
|
|
|
1
|
-
/** Every path through T reachable from K, joined by `D`. */
|
|
2
|
-
export type FindPath<T, K extends keyof T, D extends string = '.'> = K extends string | number ? T[K] extends Record<string | number, any> ? T[K] extends ArrayLike<any> ? K | `${K}${D}${FindPath<T[K], Exclude<keyof T[K], keyof any[]>, D>}` : K | `${K}${D}${FindPath<T[K], keyof T[K], D>}` : K : never;
|
|
3
|
-
export type Path<T, D extends string = '.'> = FindPath<T, keyof T, D> | keyof T;
|
|
4
|
-
export type PathValue<T, P extends Path<T, D>, D extends string = '.'> = P extends `${infer K}${D}${infer Rest}` ? K extends keyof T ? Rest extends Path<T[K], D> ? PathValue<T[K], Rest, D> : never : never : P extends keyof T ? T[P] : never;
|
|
5
|
-
/** Only the paths whose value is a string or number, as a union. */
|
|
6
|
-
export type PathToLiteral<T, K extends Path<T, D>, D extends string = '.', Base extends string = ''> = PathValue<T, K, D> extends string | number ? K extends string | number ? K extends `${infer BasePath}${D}${Base}` ? BasePath : K : never : never;
|
|
7
|
-
/**
|
|
8
|
-
* Flat map of the primitive-valued paths only: `{ a: { b: 1 } }` becomes
|
|
9
|
-
* `{ 'a-b': 1 }` when `D` is `-`.
|
|
10
|
-
*/
|
|
11
|
-
export type LiteralPaths<T extends Record<string | number, any>, D extends string = '.', Base extends string = ''> = {
|
|
12
|
-
[K in Path<T, D> as PathToLiteral<T, K, D, Base>]: PathValue<T, PathToLiteral<T, K, D>, D>;
|
|
13
|
-
};
|
|
14
|
-
export declare function flattenScale<T extends Record<string | number, unknown>, P extends string>(object: T, path?: P): LiteralPaths<T, '-', '_'>;
|
|
15
|
-
//# sourceMappingURL=flattenScale.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"flattenScale.d.ts","sourceRoot":"","sources":["../../src/theme/flattenScale.ts"],"names":[],"mappings":"AAEA,4DAA4D;AAC5D,MAAM,MAAM,QAAQ,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,EAAE,CA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Aa,CACvB,CAAC,EACD,CAAC,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,EACpB,CAAC,SAAS,MAAM,GAAG,GAAG,EACtB,IAAI,SAAS,MAAM,GAAG,EAAE,IAExB,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,GACtC,CAAC,SAAS,MAAM,GAAG,MAAM,GACvB,CAAC,SAAS,GAAG,MAAM,QAAQ,GAAG,CAAC,GAAG,IAAI,EAAE,GACtC,QAAQ,GACR,CAAC,GACH,KAAK,GACP,KAAK,CAAC;AAEZ;;;GAGG;AACH,MAAM,MAAM,YAAY,CACtB,CAAC,SAAS,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,GAAG,CAAC,EACtC,CAAC,SAAS,MAAM,GAAG,GAAG,EACtB,IAAI,SAAS,MAAM,GAAG,EAAE,IACtB;KACD,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,GAAG,SAAS,CAC1D,CAAC,EACD,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EACtB,CAAC,CACF;CACF,CAAC;AAEF,wBAAgB,YAAY,CAC1B,CAAC,SAAS,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,OAAO,CAAC,EAC1C,CAAC,SAAS,MAAM,EAChB,MAAM,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAkBhD"}
|
package/dist/theme/index.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { createTheme, type Flatten, ThemeBuilder, type ThemeBuilderStage, } from './createTheme';
|
|
2
|
-
export type { FindPath, LiteralPaths, Path, PathToLiteral, PathValue, } from './flattenScale';
|
|
3
|
-
export type { KeyAsVariable, SanitizeKey } from './serializeTokens';
|
|
4
|
-
export type { Assign, AssignValueIfUnmergable, ColorModeConfig, Mergable, Merge, MergeTheme, PrivateThemeKeys, } from './types';
|
|
5
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,KAAK,OAAO,EACZ,YAAY,EACZ,KAAK,iBAAiB,GACvB,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,QAAQ,EACR,YAAY,EACZ,IAAI,EACJ,aAAa,EACb,SAAS,GACV,MAAM,gBAAgB,CAAC;AACxB,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACpE,YAAY,EACV,MAAM,EACN,uBAAuB,EACvB,eAAe,EACf,QAAQ,EACR,KAAK,EACL,UAAU,EACV,gBAAgB,GACjB,MAAM,SAAS,CAAC"}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import type { ContextualVarRegistration, ThemeManifest } from '../types/theme';
|
|
2
|
-
/** Where a record was first declared. Kept for diagnostics; not serialized,
|
|
3
|
-
* so an unchanged extension serializes exactly like its source. */
|
|
4
|
-
export type PropertySource = {
|
|
5
|
-
method: 'declareContextualVars';
|
|
6
|
-
} | {
|
|
7
|
-
method: 'extend';
|
|
8
|
-
call: number;
|
|
9
|
-
} | {
|
|
10
|
-
method: 'from';
|
|
11
|
-
};
|
|
12
|
-
/** One declared custom property: the record every declaration API writes. */
|
|
13
|
-
export interface PropertyRecord {
|
|
14
|
-
/** The authored name, without `--`. */
|
|
15
|
-
name: string;
|
|
16
|
-
/** Normalized: the home's default applies when nothing says otherwise. */
|
|
17
|
-
inherits: boolean;
|
|
18
|
-
syntax?: string;
|
|
19
|
-
initialValue?: string;
|
|
20
|
-
home: 'theme';
|
|
21
|
-
source: PropertySource;
|
|
22
|
-
/** Present on records the contextual-variable method made. */
|
|
23
|
-
legacy?: {
|
|
24
|
-
/** The authored registration, projected verbatim into the manifest. */
|
|
25
|
-
registration?: ContextualVarRegistration;
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
/** What makes two registrations of one property the same `@property` rule. */
|
|
29
|
-
export interface RegistrationSignature {
|
|
30
|
-
/** The final custom-property name. */
|
|
31
|
-
name: string;
|
|
32
|
-
/** Kept as written, so alternative order is preserved. */
|
|
33
|
-
syntax: string | undefined;
|
|
34
|
-
inherits: boolean;
|
|
35
|
-
initialValue: string | undefined;
|
|
36
|
-
}
|
|
37
|
-
export interface PropertyStore {
|
|
38
|
-
/**
|
|
39
|
-
* By authored name. A record moves to the end when it first gains a
|
|
40
|
-
* registration, so registered records keep registration order, which is
|
|
41
|
-
* the order their `@property` rules are emitted in.
|
|
42
|
-
*/
|
|
43
|
-
records: Map<string, PropertyRecord>;
|
|
44
|
-
/**
|
|
45
|
-
* Names declared on each scale, in declaration order with repeats: the
|
|
46
|
-
* names-by-scale input extraction already reads. Each record's scales are
|
|
47
|
-
* read from here.
|
|
48
|
-
*/
|
|
49
|
-
scaleNames: Map<string, string[]>;
|
|
50
|
-
}
|
|
51
|
-
export declare function createPropertyStore(): PropertyStore;
|
|
52
|
-
export declare function copyPropertyStore(store: PropertyStore): PropertyStore;
|
|
53
|
-
/** Appends `names` to `scale`, repeats included. */
|
|
54
|
-
export declare function declareScaleNames(store: PropertyStore, scale: string, names: readonly string[], source: PropertySource): void;
|
|
55
|
-
/** Replaces `scale`'s names in place, dropping records left with neither a
|
|
56
|
-
* scale nor a registration. */
|
|
57
|
-
export declare function replaceScaleNames(store: PropertyStore, scale: string, names: readonly string[], source: PropertySource): void;
|
|
58
|
-
export declare function legacyRegistration(store: PropertyStore, name: string): ContextualVarRegistration | undefined;
|
|
59
|
-
/** Sets a contextual variable's registration; a later one replaces it. */
|
|
60
|
-
export declare function setLegacyRegistration(store: PropertyStore, name: string, registration: ContextualVarRegistration, source: PropertySource): void;
|
|
61
|
-
/** The one place registration is decided. */
|
|
62
|
-
export declare function isRegistered(record: PropertyRecord): boolean;
|
|
63
|
-
export declare function registrationSignature(record: Pick<PropertyRecord, 'name' | 'syntax' | 'inherits' | 'initialValue'>): RegistrationSignature;
|
|
64
|
-
export declare function sameRegistration(a: RegistrationSignature, b: RegistrationSignature): boolean;
|
|
65
|
-
/** The signature an incoming contextual-variable registration would have. */
|
|
66
|
-
export declare function legacySignature(name: string, registration: ContextualVarRegistration): RegistrationSignature;
|
|
67
|
-
/** The names-by-scale input; `undefined` when nothing is declared. */
|
|
68
|
-
export declare function namesByScale(store: PropertyStore): Record<string, string[]> | undefined;
|
|
69
|
-
/** The manifest's `registrations`: authored objects, in registration order. */
|
|
70
|
-
export declare function legacyRegistrations(store: PropertyStore): NonNullable<ThemeManifest['registrations']>;
|
|
71
|
-
/**
|
|
72
|
-
* `@property` rules for registered, declared properties, emitted as
|
|
73
|
-
* `--${name}`: the name the Rust resolver maps a bare contextual variable
|
|
74
|
-
* to. `''` when there are none.
|
|
75
|
-
*/
|
|
76
|
-
export declare function registrationCss(store: PropertyStore): string;
|
|
77
|
-
/** The records extraction receives, sorted by name; `undefined` when none. */
|
|
78
|
-
export declare function serializePropertyRecords(store: PropertyStore): string | undefined;
|
|
79
|
-
//# sourceMappingURL=property-records.d.ts.map
|