@animus-ui/system 0.1.20 → 0.1.22

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.
Files changed (123) hide show
  1. package/dist/appearance/controller.d.ts +35 -0
  2. package/dist/appearance/controller.d.ts.map +1 -0
  3. package/dist/appearance/controller.js +69 -0
  4. package/dist/appearance/index.d.ts +2 -7
  5. package/dist/appearance/react.d.ts +10 -0
  6. package/dist/appearance/react.d.ts.map +1 -0
  7. package/dist/appearance/react.js +12 -0
  8. package/dist/appearance/svelte.d.ts +12 -0
  9. package/dist/appearance/svelte.d.ts.map +1 -0
  10. package/dist/appearance/svelte.js +14 -0
  11. package/dist/bootstrap/index.d.ts +24 -1
  12. package/dist/bootstrap/index.d.ts.map +1 -1
  13. package/dist/bootstrap/index.js +10 -2
  14. package/dist/class-resolver.d.ts +2 -6
  15. package/dist/class-resolver.js +1 -1
  16. package/dist/component-stJhG_A-.d.ts +659 -0
  17. package/dist/component-stJhG_A-.d.ts.map +1 -0
  18. package/dist/compose-BQi7TDtL.d.ts +15 -0
  19. package/dist/compose-BQi7TDtL.d.ts.map +1 -0
  20. package/dist/compose.d.ts +2 -12
  21. package/dist/composeWithContext.d.ts +9 -7
  22. package/dist/composeWithContext.d.ts.map +1 -1
  23. package/dist/createClassResolver-Do1nmvkf.d.ts +71 -0
  24. package/dist/createClassResolver-Do1nmvkf.d.ts.map +1 -0
  25. package/dist/{createClassResolver-DPLExqGy.js → createClassResolver-DtHjTYa7.js} +106 -79
  26. package/dist/createComposedFamily-BbA_d0QH.js +195 -0
  27. package/dist/createComposedFamily-BkrvSsfl.d.ts +40 -0
  28. package/dist/createComposedFamily-BkrvSsfl.d.ts.map +1 -0
  29. package/dist/groups/index.d.ts +702 -699
  30. package/dist/groups/index.d.ts.map +1 -1
  31. package/dist/index-BjJkQo64.d.ts +10 -0
  32. package/dist/index-BjJkQo64.d.ts.map +1 -0
  33. package/dist/index-C1AAiaiJ.d.ts +663 -0
  34. package/dist/index-C1AAiaiJ.d.ts.map +1 -0
  35. package/dist/index.d.ts +6 -26
  36. package/dist/index.js +141 -41
  37. package/dist/runtime-entry.d.ts +3 -5
  38. package/dist/runtime-entry.js +3 -3
  39. package/package.json +15 -3
  40. package/dist/Animus.d.ts +0 -81
  41. package/dist/Animus.d.ts.map +0 -1
  42. package/dist/AnimusExtended.d.ts +0 -82
  43. package/dist/AnimusExtended.d.ts.map +0 -1
  44. package/dist/SystemBuilder.d.ts +0 -305
  45. package/dist/SystemBuilder.d.ts.map +0 -1
  46. package/dist/appearance/index.d.ts.map +0 -1
  47. package/dist/asset.d.ts +0 -16
  48. package/dist/asset.d.ts.map +0 -1
  49. package/dist/bootstrap/createAppearanceBootstrap.d.ts +0 -14
  50. package/dist/bootstrap/createAppearanceBootstrap.d.ts.map +0 -1
  51. package/dist/class-resolver.d.ts.map +0 -1
  52. package/dist/compose.d.ts.map +0 -1
  53. package/dist/conditions.d.ts +0 -94
  54. package/dist/conditions.d.ts.map +0 -1
  55. package/dist/createComposedFamily-C6CLAsMx.js +0 -128
  56. package/dist/declarations.d.ts +0 -38
  57. package/dist/declarations.d.ts.map +0 -1
  58. package/dist/index.d.ts.map +0 -1
  59. package/dist/keyframes.d.ts +0 -24
  60. package/dist/keyframes.d.ts.map +0 -1
  61. package/dist/runtime/assert-root-slot.d.ts +0 -6
  62. package/dist/runtime/assert-root-slot.d.ts.map +0 -1
  63. package/dist/runtime/createClassResolver.d.ts +0 -11
  64. package/dist/runtime/createClassResolver.d.ts.map +0 -1
  65. package/dist/runtime/createComposedFamily.d.ts +0 -11
  66. package/dist/runtime/createComposedFamily.d.ts.map +0 -1
  67. package/dist/runtime/index.d.ts +0 -14
  68. package/dist/runtime/index.d.ts.map +0 -1
  69. package/dist/runtime/is-dev.d.ts +0 -6
  70. package/dist/runtime/is-dev.d.ts.map +0 -1
  71. package/dist/runtime/resolveClasses.d.ts +0 -83
  72. package/dist/runtime/resolveClasses.d.ts.map +0 -1
  73. package/dist/runtime/witness.d.ts +0 -10
  74. package/dist/runtime/witness.d.ts.map +0 -1
  75. package/dist/runtime-entry.d.ts.map +0 -1
  76. package/dist/scales/createScale.d.ts +0 -7
  77. package/dist/scales/createScale.d.ts.map +0 -1
  78. package/dist/selectors.d.ts +0 -27
  79. package/dist/selectors.d.ts.map +0 -1
  80. package/dist/theme/createTheme.d.ts +0 -170
  81. package/dist/theme/createTheme.d.ts.map +0 -1
  82. package/dist/theme/flattenScale.d.ts +0 -15
  83. package/dist/theme/flattenScale.d.ts.map +0 -1
  84. package/dist/theme/index.d.ts +0 -5
  85. package/dist/theme/index.d.ts.map +0 -1
  86. package/dist/theme/property-records.d.ts +0 -79
  87. package/dist/theme/property-records.d.ts.map +0 -1
  88. package/dist/theme/resolveReferences.d.ts +0 -27
  89. package/dist/theme/resolveReferences.d.ts.map +0 -1
  90. package/dist/theme/serializeTokens.d.ts +0 -5
  91. package/dist/theme/serializeTokens.d.ts.map +0 -1
  92. package/dist/theme/types.d.ts +0 -20
  93. package/dist/theme/types.d.ts.map +0 -1
  94. package/dist/theme/utils.d.ts +0 -11
  95. package/dist/theme/utils.d.ts.map +0 -1
  96. package/dist/transforms/border.d.ts +0 -3
  97. package/dist/transforms/border.d.ts.map +0 -1
  98. package/dist/transforms/createTransform.d.ts +0 -24
  99. package/dist/transforms/createTransform.d.ts.map +0 -1
  100. package/dist/transforms/grid.d.ts +0 -5
  101. package/dist/transforms/grid.d.ts.map +0 -1
  102. package/dist/transforms/index.d.ts +0 -5
  103. package/dist/transforms/index.d.ts.map +0 -1
  104. package/dist/transforms/size.d.ts +0 -5
  105. package/dist/transforms/size.d.ts.map +0 -1
  106. package/dist/types/component.d.ts +0 -100
  107. package/dist/types/component.d.ts.map +0 -1
  108. package/dist/types/config.d.ts +0 -149
  109. package/dist/types/config.d.ts.map +0 -1
  110. package/dist/types/properties.d.ts +0 -17
  111. package/dist/types/properties.d.ts.map +0 -1
  112. package/dist/types/props.d.ts +0 -19
  113. package/dist/types/props.d.ts.map +0 -1
  114. package/dist/types/scales.d.ts +0 -3
  115. package/dist/types/scales.d.ts.map +0 -1
  116. package/dist/types/shared.d.ts +0 -4
  117. package/dist/types/shared.d.ts.map +0 -1
  118. package/dist/types/theme.d.ts +0 -111
  119. package/dist/types/theme.d.ts.map +0 -1
  120. package/dist/types/utils.d.ts +0 -5
  121. package/dist/types/utils.d.ts.map +0 -1
  122. package/dist/utils/deepMerge.d.ts +0 -2
  123. package/dist/utils/deepMerge.d.ts.map +0 -1
@@ -0,0 +1,663 @@
1
+ import { i as ClassResolverConfig, t as ClassResolver } from "./createClassResolver-Do1nmvkf.js";
2
+ import { $ as SerializedTheme, A as SystemProps, At as ReservedByConditionRegistry, Ct as ConditionAliasMap, Dt as NarrowedAliases, F as VariantConfig, G as CSSColorValue, H as AbstractTheme, J as ContextualVarRegistration, K as ColorModeOptions, M as ThemedCSSProps, R as AbstractProps, Z as ModeAliasDefinition, _ as CSSProps, _t as KeyframeFrameMap, a as BuilderClassProps, at as TokenDefinition, bt as AtRuleValue, d as StylingNames, f as SystemPicks, g as CSSPropMap, h as BuiltInSelectorAlias, ht as SelectorAliasMap, it as ThemeStructuralKey, j as ThemedCSSPropMap, jt as ReservedBySelectorRegistry, k as SystemProp, kt as RegistryBrand, l as AnimusExtended, lt as LiteralPaths, m as BuiltInConditionAlias, n as AnimusComponent, nt as ThemeCssFragment, p as AbstractParser, r as AnimusWrappedComponent, rt as ThemeManifest, st as CSSObject, v as CompoundEntry, x as DeclarationProp, y as CustomPropConfig, yt as Keyframes } from "./component-stJhG_A-.js";
3
+ import "./compose-BQi7TDtL.js";
4
+ import "./createComposedFamily-BkrvSsfl.js";
5
+ import { ComponentType, JSX } from "react";
6
+ //#region src/Animus.d.ts
7
+ declare class AnimusWithAll<PropRegistry extends Record<string, SystemProp>, GroupRegistry extends Record<string, (keyof PropRegistry)[]>, BaseStyles extends CSSProps<AbstractProps, SystemProps<AbstractParser>>, Variants extends Record<string, VariantConfig>, States extends CSSPropMap<AbstractProps, SystemProps<AbstractParser>>, ActiveGroups extends Record<string, true>, CustomProps extends Record<string, SystemProp>> {
8
+ propRegistry: PropRegistry;
9
+ groupRegistry: GroupRegistry;
10
+ baseStyles: BaseStyles;
11
+ statesConfig: States;
12
+ variants: Variants;
13
+ activeGroups: ActiveGroups;
14
+ custom: CustomProps;
15
+ compounds: CompoundEntry[];
16
+ constructor(props: PropRegistry, groups: GroupRegistry, base: BaseStyles, variants: Variants, states: States, activeGroups: ActiveGroups, custom: CustomProps, compounds?: CompoundEntry[]);
17
+ protected extend(): AnimusExtended<PropRegistry, GroupRegistry, BaseStyles, Variants, States, ActiveGroups, CustomProps>;
18
+ asElement<El extends keyof JSX.IntrinsicElements>(component: El): AnimusComponent<El, PropRegistry, GroupRegistry, BaseStyles, Variants, States, ActiveGroups, CustomProps>;
19
+ asComponent<C extends ComponentType<any>>(AsComponent: C): AnimusWrappedComponent<C, PropRegistry, GroupRegistry, BaseStyles, Variants, States, ActiveGroups, CustomProps>;
20
+ asClass<This extends {
21
+ _buildComponentConfig(): ClassResolverConfig;
22
+ }>(this: This): ClassResolver<BuilderClassProps<This>>;
23
+ _buildComponentConfig(): ClassResolverConfig;
24
+ }
25
+ declare class AnimusWithSystem<PropRegistry extends Record<string, SystemProp>, GroupRegistry extends Record<string, (keyof PropRegistry)[]>, BaseStyles extends CSSProps<AbstractProps, SystemProps<AbstractParser>>, Variants extends Record<string, VariantConfig>, States extends CSSPropMap<AbstractProps, SystemProps<AbstractParser>>, ActiveGroups extends Record<string, true>> extends AnimusWithAll<PropRegistry, GroupRegistry, BaseStyles, Variants, States, ActiveGroups, {}> {
26
+ constructor(props: PropRegistry, groups: GroupRegistry, base: BaseStyles, variants: Variants, states: States, activeGroups: ActiveGroups, compounds?: CompoundEntry[]);
27
+ props<NewCustomProps extends Record<string, CustomPropConfig | DeclarationProp>>(config: NewCustomProps): AnimusWithAll<PropRegistry, GroupRegistry, BaseStyles, Variants, States, ActiveGroups, NewCustomProps>;
28
+ }
29
+ declare class AnimusWithStates<PropRegistry extends Record<string, SystemProp>, GroupRegistry extends Record<string, (keyof PropRegistry)[]>, BaseStyles extends CSSProps<AbstractProps, SystemProps<AbstractParser>>, Variants extends Record<string, VariantConfig>, States extends CSSPropMap<AbstractProps, SystemProps<AbstractParser>>> extends AnimusWithSystem<PropRegistry, GroupRegistry, BaseStyles, Variants, States, {}> {
30
+ constructor(props: PropRegistry, groups: GroupRegistry, base: BaseStyles, variants: Variants, states: States, compounds?: CompoundEntry[]);
31
+ system<PickedKeys extends keyof GroupRegistry | Extract<keyof PropRegistry, string>>(config: SystemPicks<GroupRegistry, PickedKeys, StylingNames<Variants, States>>): AnimusWithSystem<PropRegistry, GroupRegistry, BaseStyles, Variants, States, Record<PickedKeys, true>>;
32
+ }
33
+ declare class AnimusWithCompounds<PropRegistry extends Record<string, SystemProp>, GroupRegistry extends Record<string, (keyof PropRegistry)[]>, BaseStyles extends CSSProps<AbstractProps, SystemProps<AbstractParser>>, Variants extends Record<string, VariantConfig>> extends AnimusWithStates<PropRegistry, GroupRegistry, BaseStyles, Variants, {}> {
34
+ constructor(props: PropRegistry, groups: GroupRegistry, base: BaseStyles, variants: Variants, compounds?: CompoundEntry[]);
35
+ compound<Props extends AbstractProps>(condition: { [K in keyof Variants]?: keyof Variants[K]['variants'] | ReadonlyArray<keyof Variants[K]['variants']>; }, styles: ThemedCSSProps<Props, PropRegistry>): AnimusWithCompounds<PropRegistry, GroupRegistry, BaseStyles, Variants>;
36
+ states<Props extends AbstractProps>(config: ThemedCSSPropMap<Props, PropRegistry>): AnimusWithStates<PropRegistry, GroupRegistry, BaseStyles, Variants, ThemedCSSPropMap<Props, PropRegistry>>;
37
+ }
38
+ declare class AnimusWithVariants<PropRegistry extends Record<string, SystemProp>, GroupRegistry extends Record<string, (keyof PropRegistry)[]>, BaseStyles extends CSSProps<AbstractProps, SystemProps<AbstractParser>>, Variants extends Record<string, VariantConfig>> extends AnimusWithCompounds<PropRegistry, GroupRegistry, BaseStyles, Variants> {
39
+ constructor(props: PropRegistry, groups: GroupRegistry, base: BaseStyles, variants: Variants, compounds?: CompoundEntry[]);
40
+ compound<Props extends AbstractProps>(condition: { [K in keyof Variants]?: keyof Variants[K]['variants'] | ReadonlyArray<keyof Variants[K]['variants']>; }, styles: ThemedCSSProps<Props, PropRegistry>): AnimusWithCompounds<PropRegistry, GroupRegistry, BaseStyles, Variants>;
41
+ variant<Keys extends keyof Props, Base extends AbstractProps, Props extends Record<Keys, AbstractProps>, PropKey extends Readonly<string> = 'variant'>(options: {
42
+ prop?: PropKey;
43
+ defaultVariant?: Extract<keyof Props, string>;
44
+ base?: ThemedCSSProps<Base, PropRegistry>;
45
+ variants: ThemedCSSPropMap<Props, PropRegistry>;
46
+ }): AnimusWithVariants<PropRegistry, GroupRegistry, BaseStyles, Variants & Record<PropKey, {
47
+ prop?: PropKey;
48
+ defaultVariant?: Extract<keyof Props, string>;
49
+ base?: ThemedCSSProps<Base, PropRegistry>;
50
+ variants: ThemedCSSPropMap<Props, PropRegistry>;
51
+ }>>;
52
+ }
53
+ declare class AnimusWithBase<PropRegistry extends Record<string, SystemProp>, GroupRegistry extends Record<string, (keyof PropRegistry)[]>, BaseStyles extends CSSProps<AbstractProps, SystemProps<AbstractParser>>> extends AnimusWithVariants<PropRegistry, GroupRegistry, BaseStyles, {}> {
54
+ constructor(props: PropRegistry, groups: GroupRegistry, base: BaseStyles);
55
+ variant<Keys extends keyof Props, Base extends AbstractProps, Props extends Record<Keys, AbstractProps>, PropKey extends Readonly<string> = 'variant'>(options: {
56
+ prop?: PropKey;
57
+ defaultVariant?: Extract<keyof Props, string>;
58
+ base?: ThemedCSSProps<Base, PropRegistry>;
59
+ variants: ThemedCSSPropMap<Props, PropRegistry>;
60
+ }): AnimusWithVariants<PropRegistry, GroupRegistry, BaseStyles, Record<PropKey, {
61
+ prop?: PropKey;
62
+ defaultVariant?: Extract<keyof Props, string>;
63
+ base?: ThemedCSSProps<Base, PropRegistry>;
64
+ variants: ThemedCSSPropMap<Props, PropRegistry>;
65
+ }>>;
66
+ }
67
+ declare class Animus<PropRegistry extends Record<string, SystemProp>, GroupRegistry extends Record<string, (keyof PropRegistry)[]>> extends AnimusWithBase<PropRegistry, GroupRegistry, {}> {
68
+ constructor(props: PropRegistry, groups: GroupRegistry);
69
+ styles<Props extends AbstractProps>(config: ThemedCSSProps<Props, PropRegistry>): AnimusWithBase<PropRegistry, GroupRegistry, ThemedCSSProps<Props, PropRegistry>>;
70
+ }
71
+ //#endregion
72
+ //#region src/asset.d.ts
73
+ declare const ASSET_REF_BRAND: unique symbol;
74
+ /**
75
+ * A plain string so it crosses the sandbox's JSON boundary untouched; the host
76
+ * plugin substitutes the placeholder with the bundler-resolved URL.
77
+ */
78
+ type AssetRef = string & {
79
+ readonly [ASSET_REF_BRAND]: true;
80
+ };
81
+ declare const ASSET_PLACEHOLDER_PREFIX = "animus-asset:";
82
+ /**
83
+ * Brands the specifier only — aliases, exports maps and hashing belong to the
84
+ * host bundler. A literal URL string stays a valid alternative.
85
+ */
86
+ declare function asset(specifier: string): AssetRef;
87
+ //#endregion
88
+ //#region src/transforms/createTransform.d.ts
89
+ /** A transform returns a string or a finite number. */
90
+ type TransformFn = (value: string | number, property?: string, props?: AbstractProps) => string | number;
91
+ type NamedTransform = TransformFn & {
92
+ transformName: string;
93
+ /**
94
+ * A wrapper's own `toString()` is identical for every transform, so
95
+ * equality compares this captured source instead.
96
+ */
97
+ transformSource?: string;
98
+ };
99
+ declare function createTransform(name: string, fn: TransformFn): NamedTransform;
100
+ /**
101
+ * Two transforms with byte-identical source compare equal even when they
102
+ * close over different values.
103
+ */
104
+ declare function areTransformsEqual(a: TransformFn | undefined, b: TransformFn | undefined): boolean;
105
+ //#endregion
106
+ //#region src/SystemBuilder.d.ts
107
+ type GlobalStyleMap = Record<string, Record<string, any>>;
108
+ interface FontFaceSrc {
109
+ /**
110
+ * A literal string is emitted byte-exact; an `AssetRef` emits its
111
+ * placeholder string, which the host plugin substitutes after extraction.
112
+ */
113
+ url: string | AssetRef;
114
+ /** Format hint (`woff2`, `woff`, …), rendered as `format('…')`. */
115
+ format?: string;
116
+ }
117
+ /**
118
+ * `family` may use a font-scale token reference (`{fonts.body}`); the other
119
+ * descriptors take CSS literals only.
120
+ */
121
+ interface FontFace {
122
+ family: string;
123
+ src: FontFaceSrc[];
124
+ weight?: string;
125
+ style?: string;
126
+ display?: string;
127
+ unicodeRange?: string;
128
+ stretch?: string;
129
+ }
130
+ interface GlobalStyleBlock {
131
+ __brand: 'GlobalStyleBlock';
132
+ styles: GlobalStyleMap;
133
+ /** Rendered ahead of the block's selector rules. */
134
+ fontFaces?: FontFace[];
135
+ /**
136
+ * Emitted outside every cascade layer, after `@layer anm-global`, so its
137
+ * rules can win over unlayered vendor CSS; otherwise in `anm-global`.
138
+ */
139
+ unlayered?: true;
140
+ }
141
+ type GlobalStylesFactory<PropReg extends Record<string, SystemProp> = Record<string, SystemProp>> = <Map extends Record<string, AbstractProps>>(styles: { readonly [K in keyof Map]: ThemedCSSProps<Map[K], PropReg>; }, options?: {
142
+ fontFaces?: readonly FontFace[];
143
+ unlayered?: boolean;
144
+ }) => GlobalStyleBlock;
145
+ type CreateKeyframesFactory<PropReg extends Record<string, SystemProp> = Record<string, SystemProp>> = <Frames extends Record<string, Record<string, AbstractProps>>>(frames: { readonly [N in keyof Frames]: { readonly [S in keyof Frames[N]]: ThemedCSSProps<Frames[N][S], PropReg>; }; }) => Keyframes<{ readonly [N in keyof Frames]: KeyframeFrameMap; }>;
146
+ type IncludableSystem = {
147
+ toConfig(): SerializedConfig;
148
+ /**
149
+ * Optional only so systems built by an older @animus-ui/system stay
150
+ * structurally acceptable; `extend()` throws when it is absent.
151
+ */
152
+ getRegistrySnapshot?(): RegistrySnapshot;
153
+ };
154
+ /**
155
+ * Frozen at `build()`: `toConfig()` serializes and `extend()` merges from
156
+ * it, so post-build mutation of the public registries reaches neither.
157
+ */
158
+ interface RegistrySnapshot {
159
+ props: Record<string, SystemProp>;
160
+ groups: Record<string, readonly string[]>;
161
+ selectors: SelectorAliasMap;
162
+ conditions: ConditionAliasMap;
163
+ }
164
+ /**
165
+ * The shape `registerKeyframes` accepts. The brand is structural: a
166
+ * hand-rolled object carrying it is admitted; provenance is not checked.
167
+ */
168
+ interface RegisterableKeyframes {
169
+ readonly __brand: 'Keyframes';
170
+ readonly __frames: object;
171
+ }
172
+ interface RegisterableGlobalStyles {
173
+ readonly __brand: 'GlobalStyleBlock';
174
+ readonly styles: object;
175
+ }
176
+ type KeyframesFrameData = Record<string, {
177
+ readonly name: string;
178
+ readonly frames: KeyframeFrameMap;
179
+ }>;
180
+ interface VocabularyKeyframesEntry {
181
+ readonly name: string;
182
+ readonly frames: KeyframesFrameData;
183
+ }
184
+ interface VocabularyGlobalStyleEntry {
185
+ readonly name: string;
186
+ readonly styles: GlobalStyleMap;
187
+ readonly fontFaces?: readonly FontFace[];
188
+ readonly unlayered?: true;
189
+ }
190
+ interface VocabularyCollisionEntry {
191
+ /** Stable machine code — the record, not the console, is the witness
192
+ * channel (the loader's evaluation host shims `console` to a no-op). */
193
+ readonly code: 'animus.vocabulary.collision';
194
+ readonly name: string;
195
+ readonly winner: string;
196
+ readonly loser: string;
197
+ }
198
+ /**
199
+ * Names a sealed source's registered vocabulary that `from()` / `includes:`
200
+ * did not deliver — those verbs merge no registries; `.extend()` does.
201
+ */
202
+ interface VocabularyLegacyVerbEntry {
203
+ readonly code: 'animus.vocabulary.legacy-verb';
204
+ readonly verb: 'from' | 'includes';
205
+ /** Positional label (`includes source #1`) — a source has no knowable
206
+ * export name at this seam. */
207
+ readonly source: string;
208
+ readonly names: readonly string[];
209
+ }
210
+ /**
211
+ * The registration record a sealed system carries, in declaration order.
212
+ * The loader reads registered collections exclusively from here.
213
+ */
214
+ interface VocabularyRecord {
215
+ readonly version: 1;
216
+ readonly keyframes: readonly VocabularyKeyframesEntry[];
217
+ readonly globalStyles: readonly VocabularyGlobalStyleEntry[];
218
+ readonly collisions: readonly VocabularyCollisionEntry[];
219
+ readonly legacyVerbs: readonly VocabularyLegacyVerbEntry[];
220
+ }
221
+ /** ONE name-space across both kinds: a global-style block and a keyframes
222
+ * collection cannot share a registered name. */
223
+ type VocabularyEntryState = {
224
+ kind: 'keyframes';
225
+ name: string;
226
+ frames: KeyframesFrameData;
227
+ origin: string;
228
+ } | {
229
+ kind: 'globalStyles';
230
+ name: string;
231
+ styles: GlobalStyleMap;
232
+ fontFaces?: readonly FontFace[];
233
+ unlayered?: true;
234
+ origin: string;
235
+ };
236
+ declare const VOCABULARY_COLLISION_BRAND: unique symbol;
237
+ /**
238
+ * Impossible-to-satisfy marker so a colliding registration site reports the
239
+ * offending vocabulary name instead of a bare structural mismatch.
240
+ */
241
+ interface VocabularyNameCollision<Name extends string> {
242
+ readonly [VOCABULARY_COLLISION_BRAND]: `Vocabulary name "${Name}" is already registered on this system`;
243
+ }
244
+ declare const VOCABULARY_INDEX_SIGNATURE: unique symbol;
245
+ /**
246
+ * Rejects index-signature maps: they bypass the collision mapping
247
+ * (`Extract<string, Vocab>` is `never`) and widen the axis to `string`.
248
+ */
249
+ interface VocabularyIndexSignatureRejected {
250
+ readonly [VOCABULARY_INDEX_SIGNATURE]: 'vocabulary registration requires literal keys — an index-signature map cannot prove its names';
251
+ }
252
+ type LiteralKeyMap<M> = string extends keyof M ? VocabularyIndexSignatureRejected : unknown;
253
+ declare const VOCABULARY_BRAND: unique symbol;
254
+ /**
255
+ * What `seal()` returns. The registered names ride as phantom type state so
256
+ * `.extend()` can make a collision a compile error in a consumer's chain.
257
+ * They ride in a one-element tuple: inferring from a bare optional `never`
258
+ * yields `string`, which made an empty system's vocabulary every name.
259
+ */
260
+ type SealedSystemInstance<PropReg extends Record<string, SystemProp>, GroupReg extends Record<string, (keyof PropReg)[]>, Conds extends string = never, Sels extends string = never, Vocab extends string = never> = SystemInstance<PropReg, GroupReg, Conds, Sels, Vocab> & {
261
+ getVocabularyRecord(): VocabularyRecord;
262
+ readonly [VOCABULARY_BRAND]?: [Vocab];
263
+ };
264
+ type VocabularyOf<S> = S extends {
265
+ readonly [VOCABULARY_BRAND]?: [infer V];
266
+ } ? Extract<V, string> : never;
267
+ /**
268
+ * The `build()` return. Registration is linear — chain the returned bundle;
269
+ * one `seal()` per bundle, and later registering or re-sealing throws.
270
+ */
271
+ interface SystemBundle<PropReg extends Record<string, SystemProp>, GroupReg extends Record<string, (keyof PropReg)[]>, Conds extends string = never, Sels extends string = never, Vocab extends string = never> {
272
+ system: SystemInstance<PropReg, GroupReg, Conds, Sels, never>;
273
+ createGlobalStyles: GlobalStylesFactory<PropReg>;
274
+ createKeyframes: CreateKeyframesFactory<PropReg>;
275
+ /**
276
+ * The registration key must equal the collection's module-scope export
277
+ * name — references resolve by export name. Registration is linear.
278
+ */
279
+ registerKeyframes<M extends Record<string, RegisterableKeyframes>>(map: M & LiteralKeyMap<M> & { [K in Extract<keyof M, Vocab>]: VocabularyNameCollision<K & string>; }): SystemBundle<PropReg, GroupReg, Conds, Sels, Vocab | (keyof M & string)>;
280
+ /**
281
+ * Keys equal the block's module-scope export name. Blocks and keyframes
282
+ * collections share ONE vocabulary name-space. Blocks marked `unlayered`
283
+ * emit after `@layer anm-global`, outside every layer, in registration
284
+ * order.
285
+ */
286
+ registerGlobalStyles<M extends Record<string, RegisterableGlobalStyles>>(map: M & LiteralKeyMap<M> & { [K in Extract<keyof M, Vocab>]: VocabularyNameCollision<K & string>; }): SystemBundle<PropReg, GroupReg, Conds, Sels, Vocab | (keyof M & string)>;
287
+ seal(): SealedSystemInstance<PropReg, GroupReg, Conds, Sels, Vocab>;
288
+ }
289
+ /**
290
+ * One export for both builders: `createSystem().extend()` takes the system
291
+ * half, `createTheme().extend()` the theme half (`tokens` is accepted too).
292
+ */
293
+ interface LibraryBundle<Vocab extends string = never> {
294
+ system: IncludableSystem;
295
+ theme?: unknown;
296
+ tokens?: unknown;
297
+ /** Phantom vocabulary axis — never present at runtime. */
298
+ readonly __vocabulary?: Vocab;
299
+ }
300
+ declare const EXTEND_SOURCE_BRAND: unique symbol;
301
+ /**
302
+ * Present only on systems Animus built. A private member is dropped from an
303
+ * object spread's type, so a hand-assembled object cannot carry it.
304
+ */
305
+ declare class SourceOrigin {
306
+ private readonly __animusSourceOrigin;
307
+ }
308
+ /**
309
+ * What typed `extend()` reads from its source: the registry axes as one
310
+ * record, plus the methods the runtime merge calls. Comparing a whole
311
+ * `SystemInstance` instead expands every component type it can author, so
312
+ * extending a kit cost millions of instantiations; this record keeps the cost
313
+ * near the kit's own. The private origin keeps a forged record, whose
314
+ * snapshot carries none of the registries it claims, out.
315
+ */
316
+ interface ExtendSource<PropReg extends Record<string, SystemProp>, GroupReg extends Record<string, (keyof PropReg)[]>, Conds extends string = never, Sels extends string = never, Vocab extends string = never> extends SourceOrigin, RegistryBrand<Conds, Sels> {
317
+ readonly [EXTEND_SOURCE_BRAND]: {
318
+ readonly props: PropReg;
319
+ readonly groups: GroupReg;
320
+ readonly conditions: Conds;
321
+ readonly selectors: Sels;
322
+ readonly vocabulary: Vocab;
323
+ };
324
+ toConfig(): SerializedConfig;
325
+ getRegistrySnapshot?(): RegistrySnapshot;
326
+ getVocabularyRecord?(): VocabularyRecord;
327
+ readonly [VOCABULARY_BRAND]?: [Vocab];
328
+ }
329
+ interface CreateSystemConfig {
330
+ /**
331
+ * @deprecated Use `createSystem().extend(source)`, which merges the
332
+ * source's registries. `includes` adds discovery membership only.
333
+ */
334
+ includes?: readonly IncludableSystem[];
335
+ }
336
+ declare const STAGE_BRAND: unique symbol;
337
+ /**
338
+ * Phantom type-state: `extend()` / `from()` are callable only in
339
+ * `'inherit'`, and every `add*` call advances the builder to `'extend'`.
340
+ */
341
+ type SystemBuilderStage = 'inherit' | 'extend';
342
+ declare class SystemBuilder<PropReg extends Record<string, SystemProp> = {}, GroupReg extends Record<string, (keyof PropReg)[]> = {}, Conds extends string = never, Sels extends string = never, Stage extends SystemBuilderStage = 'inherit', Vocab extends string = never> {
343
+ #private;
344
+ readonly [STAGE_BRAND]?: Stage;
345
+ constructor(propRegistry?: PropReg, groupRegistry?: GroupReg, selectorRegistry?: SelectorAliasMap, includesRegistry?: readonly IncludableSystem[], conditionRegistry?: ConditionAliasMap, extendProvenance?: ReadonlyMap<string, number>, extendCount?: number, vocabularyRegistry?: readonly VocabularyEntryState[], vocabularyCollisions?: readonly VocabularyCollisionEntry[], legacyVerbWitnesses?: readonly VocabularyLegacyVerbEntry[]);
346
+ /**
347
+ * @deprecated Use `extend(source)`, which merges the source's registries.
348
+ * `from()` admits types and discovery membership only — no merge.
349
+ */
350
+ from<SrcProps extends Record<string, SystemProp>, SrcGroups extends Record<string, (keyof SrcProps)[]>, SrcConds extends string = never, SrcSels extends string = never>(this: SystemBuilder<PropReg, GroupReg, Conds, Sels, 'inherit', Vocab>, source: SystemInstance<SrcProps, SrcGroups, SrcConds, SrcSels, string> | {
351
+ system: SystemInstance<SrcProps, SrcGroups, SrcConds, SrcSels, string>;
352
+ theme?: unknown;
353
+ tokens?: unknown;
354
+ }): SystemBuilder<PropReg & SrcProps, GroupReg & SrcGroups, Conds | SrcConds, Sels | SrcSels, 'inherit', Vocab>;
355
+ /**
356
+ * @deprecated Use `extend(source)`. A `LibraryBundle` annotation has
357
+ * already erased the system half's generics — no type surface to admit.
358
+ */
359
+ from(this: SystemBuilder<PropReg, GroupReg, Conds, Sels, 'inherit', Vocab>, source: LibraryBundle<string>): SystemBuilder<PropReg, GroupReg, Conds, Sels, 'inherit', Vocab>;
360
+ /**
361
+ * Merges the source's prop, group, selector, and condition registries;
362
+ * identical entries coalesce, divergent ones throw naming both origins.
363
+ */
364
+ extend<SrcProps extends Record<string, SystemProp>, SrcGroups extends Record<string, (keyof SrcProps)[]>, SrcConds extends string = never, SrcSels extends string = never, SrcVocab extends string = never>(this: SystemBuilder<PropReg, GroupReg, Conds, Sels, 'inherit', Vocab>, source: ExtendSource<SrcProps, SrcGroups, SrcConds, SrcSels, SrcVocab> | {
365
+ system: ExtendSource<SrcProps, SrcGroups, SrcConds, SrcSels, SrcVocab>;
366
+ theme?: unknown;
367
+ tokens?: unknown;
368
+ }): SystemBuilder<PropReg & SrcProps, GroupReg & SrcGroups, Conds | SrcConds, Sels | SrcSels, 'inherit', Vocab | (string extends SrcVocab ? never : SrcVocab)>;
369
+ /**
370
+ * A `LibraryBundle` annotation has erased the system half's generics: the
371
+ * runtime merge is identical, but no source types are admitted.
372
+ */
373
+ extend<SrcVocab extends string = never>(this: SystemBuilder<PropReg, GroupReg, Conds, Sels, 'inherit', Vocab>, source: LibraryBundle<SrcVocab>): SystemBuilder<PropReg, GroupReg, Conds, Sels, 'inherit', Vocab | SrcVocab>;
374
+ /**
375
+ * Registers `_` aliases → `&`-relative selectors. The cross-registry clash
376
+ * is checked in VALUE position: `Exclude` on a `_${string}` key is a no-op.
377
+ */
378
+ addSelectors<S extends Record<`_${string}`, string>>(selectors: S & { [K in keyof S]: K extends BuiltInConditionAlias | NarrowedAliases<Conds> ? ReservedByConditionRegistry<K & string> : S[K]; }): SystemBuilder<PropReg, GroupReg, Conds, Sels | NarrowedAliases<Extract<keyof S, string>>, 'extend', Vocab>;
379
+ /**
380
+ * Registers `_` aliases → at-rule strings; user aliases override built-ins
381
+ * of the same name. A selector-owned key maps to the branded rejection.
382
+ */
383
+ addConditions<C extends Record<`_${string}`, AtRuleValue>>(conditions: C & { [K in keyof C]: K extends BuiltInSelectorAlias | NarrowedAliases<Sels> ? ReservedBySelectorRegistry<K & string> : C[K]; }): SystemBuilder<PropReg, GroupReg, Conds | NarrowedAliases<Extract<keyof C, string>>, Sels, 'extend', Vocab>;
384
+ addGroup<Name extends string, Conf extends Record<string, SystemProp>>(name: Name extends keyof PropReg ? never : Name, authored: Conf): SystemBuilder<PropReg & Conf, GroupReg & Record<Name, (keyof Conf)[]>, Conds, Sels, 'extend', Vocab>;
385
+ addProps<Conf extends Record<string, SystemProp> & Partial<Record<Extract<keyof GroupReg, string>, never>>>(authored: Conf): SystemBuilder<PropReg & Conf, GroupReg, Conds, Sels, 'extend', Vocab>;
386
+ build(): SystemBundle<PropReg, GroupReg, Conds, Sels, Vocab>;
387
+ }
388
+ type SystemInstance<PropReg extends Record<string, SystemProp>, GroupReg extends Record<string, (keyof PropReg)[]>, Conds extends string = never, Sels extends string = never, Vocab extends string = string> = Animus<PropReg, GroupReg> & {
389
+ toConfig(): SerializedConfig;
390
+ /**
391
+ * Frozen registry state captured at `build()` — what `extend()` merges
392
+ * from. Optional only for systems built by an older @animus-ui/system.
393
+ */
394
+ getRegistrySnapshot?(): RegistrySnapshot;
395
+ } & RegistryBrand<Conds, Sels> & ExtendSource<PropReg, GroupReg, Conds, Sels, Vocab>;
396
+ interface SerializedConfig {
397
+ propConfig: string;
398
+ groupRegistry: string;
399
+ /** Bound callables by definition id. */
400
+ transforms: Record<string, NamedTransform>;
401
+ /**
402
+ * `{ definitionId: sourceText }` — the only channel by which transforms
403
+ * shipped inside a package reach the build-time evaluator.
404
+ */
405
+ transformSources: string;
406
+ selectorAliases: string;
407
+ /** Condition alias map JSON: `alias → { value, order, kind }`. */
408
+ conditionAliases: string;
409
+ }
410
+ declare function createSystem(config?: CreateSystemConfig): SystemBuilder;
411
+ //#endregion
412
+ //#region src/scales/createScale.d.ts
413
+ declare const createScale: <T extends string | number>() => readonly T[] & {
414
+ length: 0;
415
+ };
416
+ declare const numericScale: (number & {})[];
417
+ declare const stringScale: (string & {})[];
418
+ declare const numericOrStringScale: ((string & {}) | (number & {}))[];
419
+ //#endregion
420
+ //#region src/declarations.d.ts
421
+ /** One key's declarations: canonical member name → CSS value. */
422
+ interface DeclarationRecord {
423
+ [member: string]: string | number;
424
+ }
425
+ /** Scale key → that key's complete record. */
426
+ interface DeclarationScaleValues {
427
+ [key: string]: DeclarationRecord;
428
+ }
429
+ //#endregion
430
+ //#region src/theme/property-records.d.ts
431
+ /** Where a record was first declared. Kept for diagnostics; not serialized,
432
+ * so an unchanged extension serializes exactly like its source. */
433
+ type PropertySource = {
434
+ method: 'declareContextualVars';
435
+ } | {
436
+ method: 'extend';
437
+ call: number;
438
+ } | {
439
+ method: 'from';
440
+ };
441
+ /** One declared custom property: the record every declaration API writes. */
442
+ interface PropertyRecord {
443
+ /** The authored name, without `--`. */
444
+ name: string;
445
+ /** Normalized: the home's default applies when nothing says otherwise. */
446
+ inherits: boolean;
447
+ syntax?: string;
448
+ initialValue?: string;
449
+ home: 'theme';
450
+ source: PropertySource;
451
+ /** Present on records the contextual-variable method made. */
452
+ legacy?: {
453
+ /** The authored registration, projected verbatim into the manifest. */
454
+ registration?: ContextualVarRegistration;
455
+ };
456
+ }
457
+ interface PropertyStore {
458
+ /**
459
+ * By authored name. A record moves to the end when it first gains a
460
+ * registration, so registered records keep registration order, which is
461
+ * the order their `@property` rules are emitted in.
462
+ */
463
+ records: Map<string, PropertyRecord>;
464
+ /**
465
+ * Names declared on each scale, in declaration order with repeats: the
466
+ * names-by-scale input extraction already reads. Each record's scales are
467
+ * read from here.
468
+ */
469
+ scaleNames: Map<string, string[]>;
470
+ }
471
+ //#endregion
472
+ //#region src/theme/createTheme.d.ts
473
+ /** Identity mapping that caches the type, preventing TS2589 depth growth. */
474
+ type Flatten<T> = { [K in keyof T]: T[K]; };
475
+ type MergeRecord<Base, Incoming> = Omit<Base, keyof Incoming> & Incoming;
476
+ /**
477
+ * Var NAMES across all scales. Derives from the already-inferred `Vars`, so it
478
+ * never feeds back into inference or perturbs literal-key narrowing.
479
+ */
480
+ type ContextualVarNames<Vars> = { [K in keyof Vars]: Vars[K] extends readonly (infer N extends string)[] ? N : never; }[keyof Vars];
481
+ type ThemeScaleKeys<T> = Exclude<keyof T & string, ThemeStructuralKey>;
482
+ /** Theme data plus boundary members, non-enumerable at runtime. */
483
+ type BuiltTheme<T, Emitted extends string> = { [K in keyof T]: T[K]; } & {
484
+ /** Tuple wrapper prevents never-distribution. Non-enumerable at runtime. */
485
+ readonly __emitted: [Emitted];
486
+ manifest: ThemeManifest;
487
+ serialize(): SerializedTheme;
488
+ /** Dot-path token → `var()` ref, or the raw value if not emitted. */
489
+ varRef(tokenPath: string): string | undefined;
490
+ };
491
+ /**
492
+ * Manifest fields carried through the explicit manifest read — the manifest is
493
+ * non-enumerable. Read-only: `build()` regenerates every fragment.
494
+ */
495
+ interface CarriedManifestV2 {
496
+ tokenDefinitions?: Record<string, TokenDefinition>;
497
+ emittedScales?: string[];
498
+ modeAliasDefinitions?: ModeAliasDefinition;
499
+ registrations?: Record<string, ContextualVarRegistration>;
500
+ emitterVersion?: number;
501
+ contractHash?: string;
502
+ cssFragments?: ThemeCssFragment[];
503
+ }
504
+ interface BuilderState {
505
+ theme: Record<string, unknown>;
506
+ emittedScales: Set<string>;
507
+ /** One record per declared custom property, contextual variables included. */
508
+ properties: PropertyStore;
509
+ carriedManifestV2?: CarriedManifestV2;
510
+ /**
511
+ * A source manifest without the v2 discriminant: the authored graph is
512
+ * unknowable, so `build()` suppresses all v2 fields instead of fabricating.
513
+ */
514
+ hasLegacyManifestSource: boolean;
515
+ /**
516
+ * Flattened leaf path → 1-based index of the `extend()` call that first
517
+ * defined it; sibling conflicts name both sources by that index.
518
+ */
519
+ extendProvenance: Map<string, number>;
520
+ extendCount: number;
521
+ /**
522
+ * Mode names carried in by `extend()`. Exempt from the coverage gate — a
523
+ * kit's own alias asymmetry must round-trip unchanged.
524
+ */
525
+ inheritedModes: Set<string>;
526
+ /**
527
+ * Alias dot-paths from extended sources: a consumer-declared mode must cover
528
+ * them or name a base.
529
+ */
530
+ inheritedModeAliases: Set<string>;
531
+ /**
532
+ * Token path dropped by `addScale({ replace: true })` → the replaced scale.
533
+ * A reference to one that is never re-added fails `build()`.
534
+ */
535
+ droppedTokenPaths: Map<string, string>;
536
+ /**
537
+ * Declaration scales by name, kept out of `theme` so the scalar flatten
538
+ * never sees their records. Records are replaced whole, never merged.
539
+ */
540
+ declarationScales: Record<string, DeclarationScaleValues>;
541
+ /** `scale.key` → the 1-based `extend()` call that first defined it. */
542
+ declarationProvenance: Map<string, number>;
543
+ }
544
+ type DeclarationScalesOfTheme<T> = T extends {
545
+ __declarationScales: infer Scales;
546
+ } ? Scales : {};
547
+ /** Per-scale key union; `Over` records win, as runtime composition does. */
548
+ type MergeDeclarationScales<Base, Over> = Flatten<{ [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; }>;
549
+ /** A theme without declaration scales keeps its type unchanged. */
550
+ type WithDeclarationScales<Merged, Scales> = [keyof Scales] extends [never] ? Merged : Flatten<Omit<Merged, '__declarationScales'> & Record<'__declarationScales', Scales>>;
551
+ type ThemeSourceOf<Source> = Source extends {
552
+ system: {
553
+ toConfig(...args: never[]): unknown;
554
+ };
555
+ theme?: infer ThemeHalf;
556
+ tokens?: infer TokensHalf;
557
+ } ? ThemeHalf extends Record<string, unknown> ? ThemeHalf : TokensHalf extends Record<string, unknown> ? TokensHalf : Record<never, never> : Source;
558
+ type ThemeBoundaryKey = '__emitted' | 'manifest' | 'serialize' | 'varRef';
559
+ type ThemeDataOf<Source> = { [Key in keyof Source as Key extends ThemeBoundaryKey ? never : Extract<Source[Key], (...args: never[]) => unknown> extends never ? Key : never]: Source[Key]; };
560
+ type MergeThemeData<Base, Source> = Flatten<MergeRecord<Base, ThemeDataOf<Source>>>;
561
+ type EmittedThemeScalesOf<Source> = Source extends {
562
+ readonly __emitted: [infer Emitted extends string];
563
+ } ? Emitted : never;
564
+ type ExtendedThemeSourceOf<Source> = Source extends {
565
+ system: {
566
+ toConfig(...args: never[]): unknown;
567
+ };
568
+ theme?: infer ThemeHalf;
569
+ tokens?: infer TokensHalf;
570
+ } ? ThemeHalf extends Record<string, unknown> ? ThemeHalf : TokensHalf extends Record<string, unknown> ? TokensHalf : Record<never, never> : Source;
571
+ declare const THEME_STAGE_BRAND: unique symbol;
572
+ /**
573
+ * Phantom builder stage: `extend()` is callable only while `'inherit'`, and
574
+ * every augmentation method advances to `'extend'`. `from()` is not gated.
575
+ */
576
+ type ThemeBuilderStage = 'inherit' | 'extend';
577
+ declare class ThemeBuilder<T extends Record<string, unknown> = Record<string, unknown>, Emitted extends string = never, Stage extends ThemeBuilderStage = 'inherit'> {
578
+ readonly [THEME_STAGE_BRAND]?: Stage;
579
+ /** @internal */ _state: BuilderState;
580
+ constructor(state: BuilderState);
581
+ 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">;
582
+ /**
583
+ * Source-WINS precedence over prior builder state, callable at any stage.
584
+ * @deprecated Use `extend(source)` — the source seeds the base, local wins.
585
+ */
586
+ 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>;
587
+ /**
588
+ * Inherits a built theme or library bundle as the BASE; local calls after
589
+ * `extend()` win, and leaves that two sources define divergently throw.
590
+ */
591
+ 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'>;
592
+ 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 {
593
+ colors: infer Existing;
594
+ } ? Existing : {}, NextColors>>>>, "colors" | Emitted, "extend">;
595
+ 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 {
596
+ colors: infer C;
597
+ } ? C : unknown) & AliasKeys>)]: (Omit<T, "colors"> & Record<"colors", (T extends {
598
+ colors: infer C;
599
+ } ? C : unknown) & AliasKeys>)[K]; }, Emitted, "extend">;
600
+ 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: {
601
+ name: Key & (Key extends ThemeStructuralKey ? never : unknown);
602
+ values: Values;
603
+ emit?: Emit;
604
+ replace?: Replace;
605
+ }): 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">;
606
+ /**
607
+ * Registers a finite declaration scale: each key maps to a flat record of
608
+ * CSS declarations, and every record sets the same members. Bind it with a
609
+ * `{ kind: 'declarations', scale, members }` system or component prop. Keys merge by
610
+ * record; `replace` makes the scale exactly these keys.
611
+ */
612
+ addDeclarationScale<Key extends string, Values extends Record<string | number, Record<string, string | number>>, Replace extends boolean = false>(config: {
613
+ name: Key & (Key extends ThemeStructuralKey ? never : unknown);
614
+ values: Values;
615
+ replace?: Replace;
616
+ }): 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">;
617
+ declareContextualVars<const Vars extends Partial<{ [K in ThemeScaleKeys<T>]: readonly string[]; }>>(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">;
618
+ 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">;
619
+ build(): BuiltTheme<T, Emitted>;
620
+ }
621
+ type EmptyTheme = {
622
+ breakpoints: Record<string, number>;
623
+ };
624
+ declare function createTheme(): ThemeBuilder<EmptyTheme, never, "inherit">;
625
+ //#endregion
626
+ //#region src/theme/serializeTokens.d.ts
627
+ type KeyAsVariable<T extends Record<string, any>, Prefix extends string> = { [V in keyof T]: `var(--${Prefix}-${SanitizeKey<Extract<V, string>>})`; };
628
+ type SanitizeKey<T extends string> = T extends `${'$'}${infer Y}` ? Y : T;
629
+ //#endregion
630
+ //#region src/theme/types.d.ts
631
+ type MergeTheme<Base extends AbstractTheme, Next, Unmergable = Record<'breakpoints', Base['breakpoints']>> = Unmergable & Merge<Base, Next>;
632
+ type Merge<A, B> = { [K in keyof (A & B)]: K extends keyof B ? K extends keyof A ? AssignValueIfUnmergable<A[K], B[K]> : B[K] : K extends keyof A ? A[K] : never; };
633
+ type Mergable<T> = Exclude<T, ((...args: any) => any) | string | boolean | symbol | number | any[]>;
634
+ type AssignValueIfUnmergable<A, B> = Mergable<A> extends never ? B : Mergable<B> extends never ? B : Assign<A, B>;
635
+ type Assign<A, B> = { [K in keyof A | keyof B]: K extends keyof B ? B[K] : K extends keyof A ? A[K] : never; };
636
+ type PrivateThemeKeys = {
637
+ _variables: Record<string, CSSObject>;
638
+ _tokens: Record<string | number, any>;
639
+ };
640
+ /**
641
+ * Nesting flattens to dash-joined keys: `{ button: { bg: { hover } } }`
642
+ * becomes `button-bg-hover`.
643
+ */
644
+ type ColorModeConfig<Colors> = Record<string, Colors | Record<string, Colors> | Record<string, Colors | Record<string, Colors>>>;
645
+ //#endregion
646
+ //#region src/transforms/border.d.ts
647
+ /** All logic stays inline: the extractor cannot follow external references. */
648
+ declare const borderShorthand: NamedTransform;
649
+ //#endregion
650
+ //#region src/transforms/grid.d.ts
651
+ /** All logic stays inline: the extractor cannot follow external references. */
652
+ declare const gridItem: NamedTransform;
653
+ /** Template logic is duplicated rather than shared: no external references. */
654
+ declare const gridItemRatio: NamedTransform;
655
+ //#endregion
656
+ //#region src/transforms/size.d.ts
657
+ /** The transform below cannot reference this: it inlines its own copy. */
658
+ declare const percentageOrAbsolute: (coordinate: number) => string | 0;
659
+ /** All logic stays inline: the extractor cannot follow external references. */
660
+ declare const size: NamedTransform;
661
+ //#endregion
662
+ export { AssetRef as $, LibraryBundle as A, VocabularyCollisionEntry as B, CreateKeyframesFactory as C, GlobalStyleMap as D, GlobalStyleBlock as E, SerializedConfig as F, VocabularyOf as G, VocabularyKeyframesEntry as H, SystemBuilder as I, NamedTransform as J, VocabularyRecord as K, SystemBuilderStage as L, RegisterableKeyframes as M, RegistrySnapshot as N, GlobalStylesFactory as O, SealedSystemInstance as P, ASSET_PLACEHOLDER_PREFIX as Q, SystemBundle as R, stringScale as S, FontFaceSrc as T, VocabularyLegacyVerbEntry as U, VocabularyGlobalStyleEntry as V, VocabularyNameCollision as W, areTransformsEqual as X, TransformFn as Y, createTransform as Z, ThemeBuilderStage as _, borderShorthand as a, numericOrStringScale as b, ColorModeConfig as c, MergeTheme as d, asset as et, PrivateThemeKeys as f, ThemeBuilder as g, Flatten as h, gridItemRatio as i, RegisterableGlobalStyles as j, KeyframesFrameData as k, Mergable as l, SanitizeKey as m, size as n, AnimusWithAll as nt, Assign as o, KeyAsVariable as p, createSystem as q, gridItem as r, AssignValueIfUnmergable as s, percentageOrAbsolute as t, Animus as tt, Merge as u, createTheme as v, FontFace as w, numericScale as x, createScale as y, SystemInstance as z };
663
+ //# sourceMappingURL=index-C1AAiaiJ.d.ts.map