@animus-ui/system 0.1.0-next.9 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +148 -0
- package/dist/Animus.d.ts +36 -30
- package/dist/Animus.d.ts.map +1 -1
- package/dist/AnimusExtended.d.ts +32 -27
- package/dist/AnimusExtended.d.ts.map +1 -1
- package/dist/SystemBuilder.d.ts +38 -17
- package/dist/SystemBuilder.d.ts.map +1 -1
- package/dist/compose.d.ts +24 -0
- package/dist/compose.d.ts.map +1 -0
- package/dist/compose.js +36 -0
- package/dist/composeWithContext.d.ts +30 -0
- package/dist/composeWithContext.d.ts.map +1 -0
- package/dist/composeWithContext.js +79 -0
- package/dist/createComposedFamily-BsyI6rBc.js +230 -0
- package/dist/groups/index.d.ts +455 -359
- package/dist/groups/index.d.ts.map +1 -1
- package/dist/groups/index.js +139 -55
- package/dist/index.d.ts +11 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +666 -395
- package/dist/keyframes.d.ts +45 -0
- package/dist/keyframes.d.ts.map +1 -0
- package/dist/runtime/createClassResolver.d.ts +10 -0
- package/dist/runtime/createClassResolver.d.ts.map +1 -0
- package/dist/runtime/createComposedFamily.d.ts +16 -0
- package/dist/runtime/createComposedFamily.d.ts.map +1 -0
- package/dist/runtime/index.d.ts +2 -18
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/resolveClasses.d.ts +59 -0
- package/dist/runtime/resolveClasses.d.ts.map +1 -0
- package/dist/runtime-entry.d.ts +10 -0
- package/dist/runtime-entry.d.ts.map +1 -0
- package/dist/runtime-entry.js +2 -0
- package/dist/selectors.d.ts +40 -0
- package/dist/selectors.d.ts.map +1 -0
- package/dist/size-CusLCguT.js +97 -0
- package/dist/theme/createTheme.d.ts +54 -54
- package/dist/theme/createTheme.d.ts.map +1 -1
- package/dist/theme/index.d.ts +0 -2
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/serializeTokens.d.ts +0 -14
- package/dist/theme/serializeTokens.d.ts.map +1 -1
- package/dist/theme/utils.d.ts +20 -4
- package/dist/theme/utils.d.ts.map +1 -1
- package/dist/transforms/border.d.ts +4 -0
- package/dist/transforms/border.d.ts.map +1 -1
- package/dist/transforms/createTransform.d.ts +3 -1
- package/dist/transforms/createTransform.d.ts.map +1 -1
- package/dist/transforms/grid.d.ts +12 -2
- package/dist/transforms/grid.d.ts.map +1 -1
- package/dist/transforms/index.d.ts +0 -1
- package/dist/transforms/index.d.ts.map +1 -1
- package/dist/transforms/size.d.ts +8 -0
- package/dist/transforms/size.d.ts.map +1 -1
- package/dist/types/component.d.ts +141 -23
- package/dist/types/component.d.ts.map +1 -1
- package/dist/types/config.d.ts +50 -5
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/properties.d.ts +1 -2
- package/dist/types/properties.d.ts.map +1 -1
- package/dist/types/props.d.ts +13 -25
- package/dist/types/props.d.ts.map +1 -1
- package/dist/types/theme.d.ts +73 -11
- package/dist/types/theme.d.ts.map +1 -1
- package/dist/utils/deepMerge.d.ts +5 -0
- package/dist/utils/deepMerge.d.ts.map +1 -0
- package/package.json +47 -15
- package/dist/PropertyBuilder.d.ts +0 -11
- package/dist/PropertyBuilder.d.ts.map +0 -1
- package/dist/size-Dge_rsuz.js +0 -70
- package/dist/transforms/utils.d.ts +0 -3
- package/dist/transforms/utils.d.ts.map +0 -1
|
@@ -1,5 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Self-contained transform: all logic inlined in the callback.
|
|
3
|
+
* No external references — satisfies the extraction constraint.
|
|
4
|
+
*/
|
|
1
5
|
export declare const gridItem: import("./createTransform").NamedTransform;
|
|
2
|
-
|
|
3
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Convert a grid item value to a CSS template string.
|
|
8
|
+
* Exported for non-extraction use — NOT referenced from createTransform callbacks.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Self-contained transform: all logic inlined in the callback.
|
|
12
|
+
* Duplicates grid-item-to-template logic to avoid cross-transform reference.
|
|
13
|
+
*/
|
|
4
14
|
export declare const gridItemRatio: import("./createTransform").NamedTransform;
|
|
5
15
|
//# sourceMappingURL=grid.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grid.d.ts","sourceRoot":"","sources":["../../src/transforms/grid.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"grid.d.ts","sourceRoot":"","sources":["../../src/transforms/grid.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,eAAO,MAAM,QAAQ,4CAUnB,CAAC;AAEH;;;GAGG;AAEH;;;GAGG;AACH,eAAO,MAAM,aAAa,4CAoCxB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/transforms/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC;AAClC,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/transforms/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC;AAClC,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC"}
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convert a numeric coordinate to a CSS value.
|
|
3
|
+
* Exported for non-extraction use — NOT referenced from the createTransform callback.
|
|
4
|
+
*/
|
|
1
5
|
export declare const percentageOrAbsolute: (coordinate: number) => string | 0;
|
|
6
|
+
/**
|
|
7
|
+
* Self-contained transform: all logic inlined in the callback.
|
|
8
|
+
* No external references — satisfies the extraction constraint.
|
|
9
|
+
*/
|
|
2
10
|
export declare const size: import("./createTransform").NamedTransform;
|
|
3
11
|
//# sourceMappingURL=size.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"size.d.ts","sourceRoot":"","sources":["../../src/transforms/size.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,oBAAoB,
|
|
1
|
+
{"version":3,"file":"size.d.ts","sourceRoot":"","sources":["../../src/transforms/size.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,eAAO,MAAM,oBAAoB,eAAgB,MAAM,eAQtD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,IAAI,4CA0Bf,CAAC"}
|
|
@@ -1,61 +1,179 @@
|
|
|
1
1
|
import type { ComponentPropsWithRef, ComponentType, ForwardRefExoticComponent, ReactNode } from 'react';
|
|
2
2
|
import type { AnimusExtended } from '../AnimusExtended';
|
|
3
|
-
import type { AbstractParser, CSSPropMap, CSSProps, Prop,
|
|
3
|
+
import type { AbstractParser, CSSPropMap, CSSProps, Prop, SelectorAliasProps, SystemProps, ThemedScale, VariantConfig } from './config';
|
|
4
4
|
import type { AbstractProps } from './props';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
declare const ConsumerProps: unique symbol;
|
|
6
|
+
declare const VariantConfigBrand: unique symbol;
|
|
7
|
+
/**
|
|
8
|
+
* Minimal structural constraint for compose() slots.
|
|
9
|
+
* Extends ForwardRefExoticComponent<any> for createElement compat,
|
|
10
|
+
* plus the phantom brands. Using `any` as P avoids expanding the
|
|
11
|
+
* full 8-generic AnimusComponent intersection, preventing TS2590
|
|
12
|
+
* "union type too complex" when the property registry is large.
|
|
13
|
+
*/
|
|
14
|
+
export type AnyBrandedComponent = ForwardRefExoticComponent<any> & {
|
|
15
|
+
readonly [ConsumerProps]: unknown;
|
|
16
|
+
readonly [VariantConfigBrand]: unknown;
|
|
17
|
+
extend: () => unknown;
|
|
18
|
+
};
|
|
19
|
+
type ExtendFn<PR extends Record<string, Prop>, GR extends Record<string, (keyof PR)[]>, BS, V, S, AG, CP> = {
|
|
20
|
+
extend: () => AnimusExtended<PR, GR, BS & CSSProps<AbstractProps, SystemProps<AbstractParser>>, V & Record<string, VariantConfig>, S & CSSPropMap<AbstractProps, SystemProps<AbstractParser>>, AG & Record<string, true>, CP & Record<string, Prop>>;
|
|
8
21
|
};
|
|
9
22
|
/**
|
|
10
23
|
* Compute the group prop names from active groups.
|
|
11
24
|
* GR maps group names to prop name arrays, AG records which groups are active.
|
|
12
25
|
* The result is the union of prop names from all active groups.
|
|
13
26
|
*/
|
|
14
|
-
type ActiveGroupPropNames<PR extends Record<string, Prop>, GR extends Record<string, (keyof PR)[]>, AG> = GR[Extract<keyof AG
|
|
27
|
+
type ActiveGroupPropNames<PR extends Record<string, Prop>, GR extends Record<string, (keyof PR)[]>, AG> = GR[Extract<keyof StripIndex<AG>, keyof GR>][number] | Extract<keyof StripIndex<AG>, keyof PR>;
|
|
15
28
|
/**
|
|
16
29
|
* Compute the group system props — each active group prop accepts its scale-resolved type.
|
|
17
|
-
*
|
|
30
|
+
* Uses the augmented Theme interface via ThemedScale (no generic T needed).
|
|
18
31
|
*/
|
|
19
|
-
type GroupProps<
|
|
20
|
-
[K in ActiveGroupPropNames<PR, GR, AG> as K extends string ? K : never]?:
|
|
32
|
+
type GroupProps<PR extends Record<string, Prop>, GR extends Record<string, (keyof PR)[]>, AG> = {
|
|
33
|
+
[K in ActiveGroupPropNames<PR, GR, AG> as K extends string ? K : never]?: ThemedScale<PR[K & keyof PR]>;
|
|
21
34
|
};
|
|
22
35
|
/**
|
|
23
36
|
* Compute custom prop types from .props() config.
|
|
24
|
-
* Each key K in CP maps to
|
|
37
|
+
* Each key K in CP maps to ThemedScale<CP[K]>.
|
|
38
|
+
* StripIndex removes index signatures from ExtendFn constraint intersections.
|
|
25
39
|
*/
|
|
26
|
-
type CustomPropValues<CP extends Record<string, Prop
|
|
27
|
-
[K in keyof CP]?:
|
|
40
|
+
type CustomPropValues<CP extends Record<string, Prop>> = {
|
|
41
|
+
[K in keyof StripIndex<CP>]?: ThemedScale<StripIndex<CP>[K & keyof StripIndex<CP>]>;
|
|
42
|
+
};
|
|
43
|
+
/** Strip string/number index signatures, keeping only literal keys. */
|
|
44
|
+
type StripIndex<T> = {
|
|
45
|
+
[K in keyof T as string extends K ? never : number extends K ? never : K]: T[K];
|
|
28
46
|
};
|
|
29
47
|
/**
|
|
30
48
|
* Compute variant props — each variant key accepts one of its variant values.
|
|
31
|
-
*
|
|
32
|
-
* produce {} instead of { [x: string]?: string } which would reject children.
|
|
49
|
+
* StripIndex removes index signatures from ExtendFn constraint intersections.
|
|
33
50
|
*/
|
|
34
|
-
type VariantProps<V> =
|
|
35
|
-
[K in keyof V]?: V[K] extends VariantConfig ? keyof V[K]['variants'] : string;
|
|
51
|
+
type VariantProps<V> = {
|
|
52
|
+
[K in keyof StripIndex<V>]?: StripIndex<V>[K] extends VariantConfig ? keyof StripIndex<V>[K]['variants'] : string;
|
|
36
53
|
};
|
|
37
54
|
/**
|
|
38
55
|
* Compute state props — each state key is a boolean toggle.
|
|
39
|
-
*
|
|
56
|
+
* StripIndex removes index signatures from ExtendFn constraint intersections.
|
|
40
57
|
*/
|
|
41
|
-
type StateProps<S> =
|
|
42
|
-
[K in keyof S]?: boolean;
|
|
58
|
+
type StateProps<S> = {
|
|
59
|
+
[K in keyof StripIndex<S>]?: boolean;
|
|
43
60
|
};
|
|
44
|
-
/**
|
|
45
|
-
|
|
61
|
+
/**
|
|
62
|
+
* Union of all prop keys that Animus manages. These override HTML attributes
|
|
63
|
+
* of the same name — the type-level equivalent of shouldForwardProp / isPropValid.
|
|
64
|
+
* The runtime (filterProps in createComponent) already strips these before
|
|
65
|
+
* forwarding to the DOM element; this ensures the types match.
|
|
66
|
+
*
|
|
67
|
+
* Computed from each source individually (not keyof an intersection) to
|
|
68
|
+
* avoid TS2590 "union type too complex" during declaration emit.
|
|
69
|
+
*/
|
|
70
|
+
type AnimusManagedKeys<PR extends Record<string, Prop>, GR extends Record<string, (keyof PR)[]>, V, S, AG, CP extends Record<string, Prop>> = ActiveGroupPropNames<PR, GR, AG> | keyof VariantProps<V> | keyof StateProps<S> | keyof StripIndex<CP> | 'as' | 'asChild' | 'className' | 'children';
|
|
71
|
+
/**
|
|
72
|
+
* The consumer-facing props for an AnimusComponent, computed once at
|
|
73
|
+
* definition time. Used both as ForwardRefExoticComponent's P parameter
|
|
74
|
+
* and carried on the ConsumerProps brand for zero-inference access.
|
|
75
|
+
*/
|
|
76
|
+
/**
|
|
77
|
+
* Resolved group props — computed once, reused for both direct group
|
|
78
|
+
* props and selector alias value types. Ensures TypeScript's structural
|
|
79
|
+
* cache hits on the same mapped type instead of re-deriving.
|
|
80
|
+
*/
|
|
81
|
+
type ResolvedGroupProps<PR extends Record<string, Prop>, GR extends Record<string, (keyof PR)[]>, AG> = GroupProps<PR, GR, AG>;
|
|
82
|
+
type AnimusConsumerProps<El extends keyof JSX.IntrinsicElements, PR extends Record<string, Prop>, GR extends Record<string, (keyof PR)[]>, V, S, AG, CP extends Record<string, Prop>> = Omit<ComponentPropsWithRef<El>, AnimusManagedKeys<PR, GR, V, S, AG, CP>> & ResolvedGroupProps<PR, GR, AG> & VariantProps<V> & StateProps<S> & CustomPropValues<CP> & SelectorAliasProps<ResolvedGroupProps<PR, GR, AG>> & {
|
|
46
83
|
as?: keyof JSX.IntrinsicElements | ComponentType<{
|
|
47
84
|
className?: string;
|
|
48
85
|
}>;
|
|
86
|
+
asChild?: boolean;
|
|
49
87
|
className?: string;
|
|
50
88
|
children?: ReactNode;
|
|
51
|
-
}
|
|
89
|
+
};
|
|
90
|
+
/** Component type for .asElement() — HTML element tag with full Animus props. */
|
|
91
|
+
export type AnimusComponent<El extends keyof JSX.IntrinsicElements, PR extends Record<string, Prop>, GR extends Record<string, (keyof PR)[]>, BS, V, S, AG, CP extends Record<string, Prop>> = ForwardRefExoticComponent<AnimusConsumerProps<El, PR, GR, V, S, AG, CP>> & ExtendFn<PR, GR, BS, V, S, AG, CP> & {
|
|
92
|
+
readonly [ConsumerProps]: AnimusConsumerProps<El, PR, GR, V, S, AG, CP>;
|
|
93
|
+
readonly [VariantConfigBrand]: V;
|
|
94
|
+
};
|
|
52
95
|
/** Component type for .asComponent() — wraps an existing React component. */
|
|
53
|
-
export type AnimusWrappedComponent<
|
|
96
|
+
export type AnimusWrappedComponent<PR extends Record<string, Prop>, GR extends Record<string, (keyof PR)[]>, BS, V, S, AG, CP> = ForwardRefExoticComponent<Record<string, any> & GroupProps<PR, GR, {}> & VariantProps<V> & StateProps<S> & SelectorAliasProps<GroupProps<PR, GR, {}>> & {
|
|
54
97
|
as?: keyof JSX.IntrinsicElements | ComponentType<{
|
|
55
98
|
className?: string;
|
|
56
99
|
}>;
|
|
100
|
+
asChild?: boolean;
|
|
57
101
|
className?: string;
|
|
58
102
|
children?: ReactNode;
|
|
59
|
-
}> & ExtendFn<
|
|
103
|
+
}> & ExtendFn<PR, GR, BS, V, S, AG, CP>;
|
|
104
|
+
/**
|
|
105
|
+
* Strip string index signatures from a type, keeping only
|
|
106
|
+
* explicitly-declared keys. Needed because ExtendFn widens V
|
|
107
|
+
* with `& Record<string, VariantConfig>`.
|
|
108
|
+
*/
|
|
109
|
+
type StripStringIndex<T> = {
|
|
110
|
+
[K in keyof T as string extends K ? never : K]: T[K];
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* Extract the raw variant config (V generic) from an AnimusComponent.
|
|
114
|
+
* Prefers the VariantConfigBrand (direct indexed access, no conditional
|
|
115
|
+
* inference). Falls back to extend() inference for non-branded components.
|
|
116
|
+
*/
|
|
117
|
+
export type ExtractVariantsConfig<C> = C extends {
|
|
118
|
+
readonly [VariantConfigBrand]: infer V;
|
|
119
|
+
} ? StripStringIndex<V> : C extends {
|
|
120
|
+
extend: () => {
|
|
121
|
+
variants: infer V;
|
|
122
|
+
};
|
|
123
|
+
} ? StripStringIndex<V> : {};
|
|
124
|
+
/**
|
|
125
|
+
* Extract consumer-facing variant props from an AnimusComponent.
|
|
126
|
+
* Returns { size?: 'sm' | 'lg', variant?: 'fill' | 'ghost', ... }
|
|
127
|
+
*/
|
|
128
|
+
export type VariantPropsOf<C> = VariantProps<ExtractVariantsConfig<C>>;
|
|
129
|
+
/**
|
|
130
|
+
* Extract the Root slot component from a Slots record.
|
|
131
|
+
* Convention: the key must be literally 'Root' (exact match).
|
|
132
|
+
*/
|
|
133
|
+
type RootSlot<Slots extends Record<string, unknown>> = 'Root' extends keyof Slots ? Slots['Root'] : never;
|
|
134
|
+
/**
|
|
135
|
+
* Variant keys that exist on the Root slot.
|
|
136
|
+
* Only Root variant keys are valid as shared keys — Root is the
|
|
137
|
+
* source of truth and must accept the prop for CSS cascade to work.
|
|
138
|
+
*/
|
|
139
|
+
type RootVariantKeys<Slots extends Record<string, unknown>> = keyof VariantPropsOf<RootSlot<Slots>> & string;
|
|
140
|
+
/**
|
|
141
|
+
* Configuration object for shared variant propagation.
|
|
142
|
+
* Keys are variant names from Root. Value is `true` to share.
|
|
143
|
+
* Non-Root slots that have matching variant keys receive the
|
|
144
|
+
* value via CSS cascade. Slots without the key are unaffected.
|
|
145
|
+
*
|
|
146
|
+
* @example
|
|
147
|
+
* compose(slots, { shared: { density: true, intent: true } })
|
|
148
|
+
*/
|
|
149
|
+
export type SharedConfig<Slots extends Record<string, unknown>> = {
|
|
150
|
+
[K in RootVariantKeys<Slots>]?: true;
|
|
151
|
+
};
|
|
152
|
+
/**
|
|
153
|
+
* Seal a component's props for compose output.
|
|
154
|
+
* Prefers the ConsumerProps brand (direct indexed access — zero conditional
|
|
155
|
+
* inference) over PropsOf (which must structurally match and infer through
|
|
156
|
+
* ForwardRefExoticComponent). This eliminates the depth explosion that
|
|
157
|
+
* occurs in Next.js environments where the TS plugin adds overhead.
|
|
158
|
+
*/
|
|
159
|
+
type SealedProps<C> = C extends {
|
|
160
|
+
readonly [ConsumerProps]: infer P;
|
|
161
|
+
} ? Omit<P, 'extend'> & {
|
|
162
|
+
className?: string;
|
|
163
|
+
children?: ReactNode;
|
|
164
|
+
} : C extends ForwardRefExoticComponent<infer P> ? Omit<P, 'extend'> & {
|
|
165
|
+
className?: string;
|
|
166
|
+
children?: ReactNode;
|
|
167
|
+
} : never;
|
|
168
|
+
/**
|
|
169
|
+
* The output of compose() — a record of slot names mapped to sealed
|
|
170
|
+
* React components. Slot keys must be PascalCase (Root, Control, Label).
|
|
171
|
+
* Props are pre-resolved per-slot via SealedProps to avoid depth
|
|
172
|
+
* explosion when this type appears inside Next.js generated
|
|
173
|
+
* `typeof import()` contexts.
|
|
174
|
+
*/
|
|
175
|
+
export type ComposedFamily<Slots extends Record<string, unknown>> = {
|
|
176
|
+
[K in keyof Slots]: ForwardRefExoticComponent<SealedProps<Slots[K]>>;
|
|
177
|
+
};
|
|
60
178
|
export {};
|
|
61
179
|
//# sourceMappingURL=component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../src/types/component.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,aAAa,EACb,yBAAyB,EACzB,SAAS,EACV,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EACV,cAAc,EACd,UAAU,EACV,QAAQ,EACR,IAAI,EACJ,
|
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../src/types/component.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,aAAa,EACb,yBAAyB,EACzB,SAAS,EACV,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EACV,cAAc,EACd,UAAU,EACV,QAAQ,EACR,IAAI,EACJ,kBAAkB,EAClB,WAAW,EACX,WAAW,EACX,aAAa,EACd,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAU7C,OAAO,CAAC,MAAM,aAAa,EAAE,OAAO,MAAM,CAAC;AAC3C,OAAO,C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CAAC,MAAM,EAAE,OAAO,CAAC,IAAI;KACjE,CAAC,IAAI,MAAM,KAAK,GAAG,yBAAyB,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;CACrE,CAAC"}
|
package/dist/types/config.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { KeyframeRef } from '../keyframes';
|
|
1
2
|
import { PropertyTypes } from './properties';
|
|
2
3
|
import { AbstractProps, ResponsiveProp, ThemeProps } from './props';
|
|
3
4
|
import { ArrayScale, MapScale } from './scales';
|
|
@@ -11,6 +12,13 @@ export interface BaseProperty {
|
|
|
11
12
|
export interface Prop extends BaseProperty {
|
|
12
13
|
scale?: string | MapScale | ArrayScale;
|
|
13
14
|
variable?: string;
|
|
15
|
+
negative?: boolean;
|
|
16
|
+
/** When false, scale-bound props accept arbitrary strings alongside scale keys via (string & {}). Default: true (strict). */
|
|
17
|
+
strict?: boolean;
|
|
18
|
+
currentVar?: string;
|
|
19
|
+
transform?: (val: string | number, prop?: string, props?: AbstractProps) => string | number | CSSObject;
|
|
20
|
+
}
|
|
21
|
+
export interface CustomPropConfig extends Prop {
|
|
14
22
|
transform?: (val: string | number, prop?: string, props?: AbstractProps) => string | number | CSSObject;
|
|
15
23
|
}
|
|
16
24
|
export interface AbstractParser {
|
|
@@ -19,6 +27,18 @@ export interface AbstractParser {
|
|
|
19
27
|
config: Record<string, Prop>;
|
|
20
28
|
}
|
|
21
29
|
type IsEmpty<T> = [] extends T ? true : false | {} extends T ? true : false;
|
|
30
|
+
/**
|
|
31
|
+
* When `strict: false`, always include globals ((string & {}) | 0) for typeahead
|
|
32
|
+
* with escape hatch, regardless of whether the scale has values.
|
|
33
|
+
* When strict is omitted or true, fall back to IsEmpty (current behavior).
|
|
34
|
+
*/
|
|
35
|
+
type StrictOrEmpty<Config extends Prop, ScaleT> = Config['strict'] extends false ? true : IsEmpty<ScaleT>;
|
|
36
|
+
/**
|
|
37
|
+
* Negate numeric literal types.
|
|
38
|
+
* `NegateKeys<4 | 8 | 16>` → `-4 | -8 | -16`
|
|
39
|
+
* Excludes 0 (negative zero is meaningless).
|
|
40
|
+
*/
|
|
41
|
+
type NegateKeys<T> = T extends number ? T extends 0 ? never : `-${T}` extends `${infer N extends number}` ? N : never : never;
|
|
22
42
|
export type PropertyValues<Property extends Prop, IncludeGlobals = false> = Exclude<PropertyTypes<IncludeGlobals extends true ? (string & {}) | 0 : never>[Property['property']], IncludeGlobals extends true ? never : object | any[]>;
|
|
23
43
|
/**
|
|
24
44
|
* Resolve scale values from T directly. No CompatTheme fallback.
|
|
@@ -29,7 +49,8 @@ export type PropertyValues<Property extends Prop, IncludeGlobals = false> = Excl
|
|
|
29
49
|
* 3. If scale is an inline ArrayScale → scale[number]
|
|
30
50
|
* 4. Otherwise → raw CSS property values
|
|
31
51
|
*/
|
|
32
|
-
|
|
52
|
+
type NegativeOf<Config extends Prop, Keys> = Config['negative'] extends true ? NegateKeys<Extract<Keys, number>> : never;
|
|
53
|
+
export type ScaleValue<Config extends Prop, T extends BaseTheme> = Config['scale'] extends keyof TokenScales<T> ? keyof TokenScales<T>[Config['scale']] | NegativeOf<Config, keyof TokenScales<T>[Config['scale']]> | PropertyValues<Config, StrictOrEmpty<Config, TokenScales<T>[Config['scale']]>> : Config['scale'] extends MapScale ? keyof Config['scale'] | NegativeOf<Config, keyof Config['scale']> | PropertyValues<Config, StrictOrEmpty<Config, Config['scale']>> : Config['scale'] extends ArrayScale ? Config['scale'][number] | PropertyValues<Config, StrictOrEmpty<Config, Config['scale']>> : PropertyValues<Config, true>;
|
|
33
54
|
export type Scale<Config extends Prop, T extends BaseTheme> = ResponsiveProp<ScaleValue<Config, T>>;
|
|
34
55
|
export type ParserProps<Config extends Record<string, Prop>, T extends BaseTheme> = ThemeProps<{
|
|
35
56
|
[P in keyof Config]?: Scale<Config[P], T>;
|
|
@@ -47,7 +68,9 @@ export type SystemProps<P extends AbstractParser, SafeProps = Omit<Arg<P>, 'them
|
|
|
47
68
|
* instead of a generic T. This enables type-safe CSS object constraints
|
|
48
69
|
* without threading T through the entire class hierarchy.
|
|
49
70
|
*/
|
|
50
|
-
|
|
71
|
+
/** Colors-only: accept `{colors.key/number}` opacity syntax in component styles. */
|
|
72
|
+
type ColorOpacityRef<Config extends Prop> = Config['scale'] extends 'colors' ? 'colors' extends keyof TokenScales<Theme> ? `{colors.${keyof TokenScales<Theme>[Config['scale'] & keyof TokenScales<Theme>] & string}/${number}}` : never : never;
|
|
73
|
+
export type ThemedScaleValue<Config extends Prop> = Config['scale'] extends keyof TokenScales<Theme> ? keyof TokenScales<Theme>[Config['scale']] | NegativeOf<Config, keyof TokenScales<Theme>[Config['scale']]> | PropertyValues<Config, StrictOrEmpty<Config, TokenScales<Theme>[Config['scale']]>> | ColorOpacityRef<Config> : Config['scale'] extends MapScale ? keyof Config['scale'] | NegativeOf<Config, keyof Config['scale']> | PropertyValues<Config, StrictOrEmpty<Config, Config['scale']>> : Config['scale'] extends ArrayScale ? Config['scale'][number] | PropertyValues<Config, StrictOrEmpty<Config, Config['scale']>> : PropertyValues<Config, true>;
|
|
51
74
|
export type ThemedScale<Config extends Prop> = ResponsiveProp<ThemedScaleValue<Config>>;
|
|
52
75
|
/**
|
|
53
76
|
* Theme-aware CSS props — uses the augmentable Theme interface
|
|
@@ -55,9 +78,14 @@ export type ThemedScale<Config extends Prop> = ResponsiveProp<ThemedScaleValue<C
|
|
|
55
78
|
*
|
|
56
79
|
* When Theme is augmented, props with scales get constrained to scale keys.
|
|
57
80
|
* When Theme is NOT augmented (empty), falls back to standard CSS values.
|
|
81
|
+
*
|
|
82
|
+
* `animationName` is widened to accept `KeyframeRef<string>` in addition to
|
|
83
|
+
* its standard string type, so `animationName: motion.ember` (a branded
|
|
84
|
+
* reference returned by the top-level `keyframes()` factory) type-checks
|
|
85
|
+
* directly alongside the legacy string form.
|
|
58
86
|
*/
|
|
59
87
|
export type ThemedCSSProps<Props, Config extends Record<string, Prop>> = {
|
|
60
|
-
[K in keyof Props]?: K extends keyof Config ? ThemedScale<Config[K]> : K extends keyof PropertyTypes ? PropertyTypes[K] : Omit<PropertyTypes, keyof Config> & {
|
|
88
|
+
[K in keyof Props]?: K extends keyof Config ? ThemedScale<Config[K]> : K extends keyof PropertyTypes ? K extends 'animationName' ? KeyframeRef<string> | PropertyTypes[K] : PropertyTypes[K] : Omit<PropertyTypes, keyof Config> & {
|
|
61
89
|
[P in keyof Config]?: ThemedScale<Config[P]>;
|
|
62
90
|
};
|
|
63
91
|
};
|
|
@@ -65,16 +93,33 @@ export type ThemedCSSPropMap<Props, Config extends Record<string, Prop>> = {
|
|
|
65
93
|
[K in keyof Props]?: ThemedCSSProps<Props[K], Config>;
|
|
66
94
|
};
|
|
67
95
|
export interface VariantConfig {
|
|
68
|
-
prop?:
|
|
69
|
-
defaultVariant?:
|
|
96
|
+
prop?: string;
|
|
97
|
+
defaultVariant?: string;
|
|
70
98
|
base?: CSSProps<AbstractProps, SystemProps<AbstractParser>>;
|
|
71
99
|
variants: CSSPropMap<AbstractProps, SystemProps<AbstractParser>>;
|
|
72
100
|
}
|
|
101
|
+
export interface CompoundEntry {
|
|
102
|
+
condition: Record<string, string>;
|
|
103
|
+
styles: CSSProps<AbstractProps, SystemProps<AbstractParser>>;
|
|
104
|
+
}
|
|
73
105
|
export type CSSPropMap<Props, System> = {
|
|
74
106
|
[K in keyof Props]?: CSSProps<Props[K], System>;
|
|
75
107
|
};
|
|
76
108
|
export type CSSProps<Props, System> = {
|
|
77
109
|
[K in keyof Props]?: K extends keyof System ? System[K] : K extends keyof PropertyTypes ? PropertyTypes[K] : Omit<PropertyTypes, keyof System> & Omit<System, 'theme'>;
|
|
78
110
|
};
|
|
111
|
+
/**
|
|
112
|
+
* Built-in selector alias keys.
|
|
113
|
+
* Each maps to one or more CSS selectors (e.g. `_hover` → `&:hover`).
|
|
114
|
+
*/
|
|
115
|
+
export type BuiltInSelectorAlias = '_link' | '_visited' | '_hover' | '_focus' | '_focusVisible' | '_focusWithin' | '_active' | '_target' | '_disabled' | '_checked' | '_invalid' | '_required' | '_readOnly' | '_expanded' | '_selected' | '_pressed' | '_before' | '_after' | '_placeholder' | '_selection' | '_first' | '_last' | '_even' | '_odd' | '_empty';
|
|
116
|
+
/**
|
|
117
|
+
* Selector alias props for component callsite.
|
|
118
|
+
* Each alias key accepts the same prop interface as the component's
|
|
119
|
+
* system groups, wrapped in Partial<>.
|
|
120
|
+
*/
|
|
121
|
+
export type SelectorAliasProps<GroupPropValues> = {
|
|
122
|
+
[K in BuiltInSelectorAlias]?: Partial<GroupPropValues>;
|
|
123
|
+
};
|
|
79
124
|
export {};
|
|
80
125
|
//# sourceMappingURL=config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACxD,OAAO,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC;AAE9B,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,aAAa,CAAC;IAC9B,UAAU,CAAC,EAAE,SAAS,CAAC,MAAM,aAAa,CAAC,EAAE,CAAC;CAC/C;AAED,MAAM,WAAW,IAAK,SAAQ,YAAY;IACxC,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,UAAU,CAAC;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,CACV,GAAG,EAAE,MAAM,GAAG,MAAM,EACpB,IAAI,CA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H,MAAM,MAAM,kBAAkB,CAAC,eAAe,IAAI;KAC/C,CAAC,IAAI,oBAAoB,CAAC,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC;CACvD,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Globals, StandardProperties, SvgProperties, VendorProperties } from 'csstype';
|
|
2
|
-
import { CSSObject } from './shared';
|
|
3
2
|
type AnimusCSSProperties<Overrides = (string & {}) | 0> = StandardProperties<Overrides> & VendorProperties<Overrides> & Omit<SvgProperties<Overrides>, keyof StandardProperties>;
|
|
4
3
|
type ColorProperties = 'color' | `${string}Color` | 'fill' | 'stroke';
|
|
5
4
|
type ColorGlobals = {
|
|
@@ -12,7 +11,7 @@ type SizeGlobals = {
|
|
|
12
11
|
};
|
|
13
12
|
export interface PropertyTypes<Overrides = (string & {}) | 0> extends Omit<AnimusCSSProperties<Overrides>, keyof ColorGlobals | keyof SizeGlobals>, ColorGlobals, SizeGlobals {
|
|
14
13
|
none?: never;
|
|
15
|
-
|
|
14
|
+
[key: `--${string}`]: (string & {}) | number | undefined;
|
|
16
15
|
}
|
|
17
16
|
export {};
|
|
18
17
|
//# sourceMappingURL=properties.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"properties.d.ts","sourceRoot":"","sources":["../../src/types/properties.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,kBAAkB,EAClB,aAAa,EACb,gBAAgB,EACjB,MAAM,SAAS,CAAC;AAEjB,
|
|
1
|
+
{"version":3,"file":"properties.d.ts","sourceRoot":"","sources":["../../src/types/properties.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,kBAAkB,EAClB,aAAa,EACb,gBAAgB,EACjB,MAAM,SAAS,CAAC;AAEjB,KAAK,mBAAmB,CAAC,SAAS,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,GAAG,CAAC,IACpD,kBAAkB,CAAC,SAAS,CAAC,GAC3B,gBAAgB,CAAC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|
@@ -1,35 +1,23 @@
|
|
|
1
|
-
import { BaseTheme } from './theme';
|
|
1
|
+
import { BaseTheme, Theme } from './theme';
|
|
2
2
|
export type AbstractProps = ThemeProps<Record<string, unknown>, BaseTheme>;
|
|
3
|
-
interface MediaQueryByKey<T = string> {
|
|
4
|
-
xs: T;
|
|
5
|
-
sm: T;
|
|
6
|
-
md: T;
|
|
7
|
-
lg: T;
|
|
8
|
-
xl: T;
|
|
9
|
-
}
|
|
10
3
|
export interface MediaQueryCache {
|
|
11
|
-
map:
|
|
4
|
+
map: Record<string, string>;
|
|
12
5
|
array: string[];
|
|
13
6
|
}
|
|
14
7
|
export type ThemeProps<Props = {}, T extends BaseTheme = BaseTheme> = Props & {
|
|
15
8
|
theme?: T;
|
|
16
9
|
};
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
4?: T;
|
|
23
|
-
5?: T;
|
|
24
|
-
}
|
|
25
|
-
export interface MediaQueryMap<T> {
|
|
10
|
+
type ThemeBreakpoints = Theme extends {
|
|
11
|
+
breakpoints: infer B;
|
|
12
|
+
} ? B : Record<string, number>;
|
|
13
|
+
type BreakpointKeys = keyof ThemeBreakpoints;
|
|
14
|
+
export type MediaQueryMap<T> = {
|
|
26
15
|
_?: T;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
export type ResponsiveProp<T> = T | MediaQueryMap<T> | MediaQueryArray<T>;
|
|
16
|
+
} & (string extends BreakpointKeys ? {
|
|
17
|
+
[key: string]: T | undefined;
|
|
18
|
+
} : {
|
|
19
|
+
[K in BreakpointKeys]?: T;
|
|
20
|
+
});
|
|
21
|
+
export type ResponsiveProp<T> = T | MediaQueryMap<T>;
|
|
34
22
|
export {};
|
|
35
23
|
//# sourceMappingURL=props.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/types/props.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/types/props.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAE3C,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS,CAAC,CAAC;AAE3E,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5B,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,MAAM,MAAM,UAAU,CAAC,KAAK,GAAG,EAAE,EAAE,CAAC,SAAS,SAAS,GAAG,SAAS,IAAI,KAAK,GAAG;IAC5E,KAAK,CAAC,EAAE,CAAC,CAAC;CACX,CAAC;AAEF,KAAK,gBAAgB,GAAG,KAAK,SAAS;IAAE,WAAW,EAAE,MAAM,CAAC,CAAA;CAAE,GAC1D,CAAC,GACD,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC3B,KAAK,cAAc,GAAG,MAAM,gBAAgB,CAAC;AAE7C,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI;IAAE,CAAC,CAAC,EAAE,CAAC,CAAA;CAAE,GAAG,CAAC,MAAM,SAAS,cAAc,GACrE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS,CAAA;CAAE,GAChC;KAAG,CAAC,IAAI,cAAc,CAAC,CAAC,EAAE,CAAC;CAAE,CAAC,CAAC;AAEnC,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC"}
|
package/dist/types/theme.d.ts
CHANGED
|
@@ -1,22 +1,16 @@
|
|
|
1
|
+
import type { LiteralPaths } from '../theme/flattenScale';
|
|
1
2
|
export type { CSSObject } from './shared';
|
|
2
|
-
export interface Breakpoints<T = number> {
|
|
3
|
-
xs: T;
|
|
4
|
-
sm: T;
|
|
5
|
-
md: T;
|
|
6
|
-
lg: T;
|
|
7
|
-
xl: T;
|
|
8
|
-
}
|
|
9
3
|
export interface BaseTheme {
|
|
10
|
-
breakpoints: Breakpoints;
|
|
11
4
|
}
|
|
12
5
|
export interface AbstractTheme extends BaseTheme {
|
|
6
|
+
breakpoints: Record<string, number>;
|
|
13
7
|
readonly [key: string]: any;
|
|
14
8
|
}
|
|
15
9
|
/**
|
|
16
|
-
* Filter
|
|
17
|
-
*
|
|
10
|
+
* Filter non-scale keys from T so only user-defined scales appear.
|
|
11
|
+
* breakpoints, modes, mode are structural — not token scales.
|
|
18
12
|
*/
|
|
19
|
-
export type TokenScales<T> = Omit<T, '
|
|
13
|
+
export type TokenScales<T> = Omit<T, 'breakpoints' | 'modes' | 'mode'>;
|
|
20
14
|
/**
|
|
21
15
|
* Augmentable Theme interface. Consumers extend this via module augmentation
|
|
22
16
|
* to get type-safe scale lookups in .styles(), .variant(), and .states():
|
|
@@ -30,7 +24,75 @@ export type TokenScales<T> = Omit<T, '_variables' | '_tokens' | 'mode' | '_getCo
|
|
|
30
24
|
* When augmented, CSS object values like `fontSize` become constrained to
|
|
31
25
|
* the theme's scale keys (e.g. `11 | 12 | 13 | 14 | 16 | ...`).
|
|
32
26
|
* When NOT augmented, values fall back to standard CSS property types.
|
|
27
|
+
*
|
|
28
|
+
* BaseTheme uses an open index signature so that module augmentation can
|
|
29
|
+
* provide a concrete breakpoints type (e.g. `{ sm: number; lg: number }`)
|
|
30
|
+
* without conflicting with a fixed Breakpoints interface.
|
|
33
31
|
*/
|
|
34
32
|
export interface Theme extends BaseTheme {
|
|
35
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* CSS <color> value type constraint for addColors().
|
|
36
|
+
* Template literal arms provide autocomplete for common formats.
|
|
37
|
+
* (string & {}) escape hatch allows future CSS color functions without blocking.
|
|
38
|
+
*/
|
|
39
|
+
export type CSSColorValue = `#${string}` | `rgb(${string})` | `rgba(${string})` | `hsl(${string})` | `hsla(${string})` | `oklch(${string})` | `oklab(${string})` | `lch(${string})` | `lab(${string})` | `color-mix(${string})` | `color(${string})` | 'transparent' | 'currentColor' | (string & {});
|
|
40
|
+
/**
|
|
41
|
+
* Extract scale names from a built theme that were emitted with CSS variables.
|
|
42
|
+
* Primary path: reads the __emitted phantom tuple from BuiltTheme.
|
|
43
|
+
* Fallback: 'colors' hardcoded as always-emitted (for augmented Theme interfaces without phantom).
|
|
44
|
+
*/
|
|
45
|
+
export type EmittedScales<T> = T extends {
|
|
46
|
+
__emitted: [infer E extends string];
|
|
47
|
+
} ? E & keyof TokenScales<T> : 'colors' extends keyof TokenScales<T> ? 'colors' : never;
|
|
48
|
+
/**
|
|
49
|
+
* All valid token ref paths for emitted scales in a theme.
|
|
50
|
+
* Uses LiteralPaths to enumerate `scale.key` paths from emitted scale entries.
|
|
51
|
+
*
|
|
52
|
+
* ```ts
|
|
53
|
+
* type Refs = EmittedTokenPaths<typeof tokens>;
|
|
54
|
+
* // → 'colors.primary' | 'colors.bg' | 'sizes.navHeight' | ...
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
export type EmittedTokenPaths<T> = keyof LiteralPaths<Pick<TokenScales<T>, EmittedScales<T>>, '.'>;
|
|
58
|
+
/**
|
|
59
|
+
* Token ref pattern type for referencing emitted scales.
|
|
60
|
+
* Constrains the scale name portion of `{scale.key}` to only emitted scales.
|
|
61
|
+
*/
|
|
62
|
+
export type ScaleTokenRef<E extends string> = `${string}{${E}.${string}}${string}`;
|
|
63
|
+
/**
|
|
64
|
+
* Token ref union for color-scale values, computed from the augmented Theme.
|
|
65
|
+
* Accepts `{colors.key}` and `{colors.key/alpha}` patterns.
|
|
66
|
+
*
|
|
67
|
+
* ```ts
|
|
68
|
+
* const ref: ColorTokenRef = '{colors.primary/50}'; // ✓
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
export type ColorTokenRef = Theme extends {
|
|
72
|
+
colors: infer C;
|
|
73
|
+
} ? C extends Record<string, unknown> ? `{colors.${Extract<keyof C, string>}}` | `{colors.${Extract<keyof C, string>}/${number}}` : never : never;
|
|
74
|
+
/** Pipeline-ready JSON strings returned by `.serialize()` on a built theme. */
|
|
75
|
+
export interface SerializedTheme {
|
|
76
|
+
/** Flattened token map as JSON: { "space.8": "0.5rem", "breakpoints.sm": "768" } */
|
|
77
|
+
scalesJson: string;
|
|
78
|
+
/** Token path → CSS variable name as JSON: { "colors.primary": "--colors-primary" } */
|
|
79
|
+
variableMapJson: string;
|
|
80
|
+
/** Pre-built CSS string with :root and [data-color-mode] blocks */
|
|
81
|
+
variableCss: string;
|
|
82
|
+
/** Contextual vars registry as JSON: { "colors": ["background-current"] } */
|
|
83
|
+
contextualVarsJson: string;
|
|
84
|
+
}
|
|
85
|
+
/** Structured manifest emitted by ThemeBuilder.build() for plugin consumption. */
|
|
86
|
+
export interface ThemeManifest {
|
|
87
|
+
/** Flat token key → raw value (e.g. 'space.8' → '0.5rem', 'colors.ember' → '#FF2800') */
|
|
88
|
+
tokenMap: Record<string, string>;
|
|
89
|
+
/** Flat token key → CSS variable name without var() wrapper (e.g. 'colors.ember' → '--color-ember') */
|
|
90
|
+
variableMap: Record<string, string>;
|
|
91
|
+
/** Mode name → flat key → resolved raw value (e.g. { dark: { 'colors.primary': '#FF2800' } }) */
|
|
92
|
+
modes: Record<string, Record<string, string>>;
|
|
93
|
+
/** Pre-built CSS string with :root and [data-color-mode] blocks */
|
|
94
|
+
variableCss: string;
|
|
95
|
+
/** Contextual vars registry: scale_name → [var_name] for --current-{name} side-effects */
|
|
96
|
+
contextualVars?: Record<string, string[]>;
|
|
97
|
+
}
|
|
36
98
|
//# sourceMappingURL=theme.d.ts.map
|