@tenphi/tasty 0.0.0-snapshot.2f41cf6 → 0.0.0-snapshot.2f4e31d

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 (130) hide show
  1. package/README.md +440 -372
  2. package/dist/babel-types-Dc5zghyE.d.ts +18 -0
  3. package/dist/chunks/async-storage-f9j9JRtq.js +37 -0
  4. package/dist/chunks/async-storage-f9j9JRtq.js.map +1 -0
  5. package/dist/chunks/build-config-D9Iq8QQm.js +60 -0
  6. package/dist/chunks/build-config-D9Iq8QQm.js.map +1 -0
  7. package/dist/{collector-BMEQCkCn.js → chunks/collector-Cb8ah2JF.js} +68 -101
  8. package/dist/chunks/collector-Cb8ah2JF.js.map +1 -0
  9. package/dist/chunks/config-engine-CMYFZYQh.js +272 -0
  10. package/dist/chunks/config-engine-CMYFZYQh.js.map +1 -0
  11. package/dist/chunks/config-file-DlZXJMj8.js +25 -0
  12. package/dist/chunks/config-file-DlZXJMj8.js.map +1 -0
  13. package/dist/chunks/css-definitions-B4aWBkH3.js +910 -0
  14. package/dist/chunks/css-definitions-B4aWBkH3.js.map +1 -0
  15. package/dist/chunks/css-resources-P7IBUUZs.js +142 -0
  16. package/dist/chunks/css-resources-P7IBUUZs.js.map +1 -0
  17. package/dist/chunks/debug-D2Pu7Xhy.js +502 -0
  18. package/dist/chunks/debug-D2Pu7Xhy.js.map +1 -0
  19. package/dist/chunks/dsl-CsFl9LGn.js +1458 -0
  20. package/dist/chunks/dsl-CsFl9LGn.js.map +1 -0
  21. package/dist/chunks/hydration-TRcz5vnk.js +41 -0
  22. package/dist/chunks/hydration-TRcz5vnk.js.map +1 -0
  23. package/dist/chunks/react-runtime-DHiopXCu.js +691 -0
  24. package/dist/chunks/react-runtime-DHiopXCu.js.map +1 -0
  25. package/dist/chunks/runtime-engine-NGCofNXy.js +2435 -0
  26. package/dist/chunks/runtime-engine-NGCofNXy.js.map +1 -0
  27. package/dist/chunks/runtime-state-lZjMbvwV.js +152 -0
  28. package/dist/chunks/runtime-state-lZjMbvwV.js.map +1 -0
  29. package/dist/{merge-styles-3il_ClCF.js → chunks/shared-utils-y-HjvPN4.js} +60 -55
  30. package/dist/chunks/shared-utils-y-HjvPN4.js.map +1 -0
  31. package/dist/chunks/style-engine-DnkV_4Jg.js +5602 -0
  32. package/dist/chunks/style-engine-DnkV_4Jg.js.map +1 -0
  33. package/dist/{css-writer-BSv8PrEX.js → chunks/zero-engine-DcwaCvFs.js} +95 -136
  34. package/dist/chunks/zero-engine-DcwaCvFs.js.map +1 -0
  35. package/dist/{collector-osfWTeRd.d.ts → collector-D2OT6I2G.d.ts} +64 -8
  36. package/dist/{config-BoZDUHW5.d.ts → config-C4ftFxgI.d.ts} +514 -92
  37. package/dist/core/index.d.ts +5 -5
  38. package/dist/core/index.js +9 -6
  39. package/dist/hydrate-CRyjjAyl.d.ts +22 -0
  40. package/dist/{index-D-OA_O6i.d.ts → index-DxQNRj50.d.ts} +718 -502
  41. package/dist/index.d.ts +5 -5
  42. package/dist/index.js +11 -732
  43. package/dist/{merge-styles-BMWcH6MF.d.ts → merge-styles-D39qBtox.d.ts} +2 -3
  44. package/dist/ssr/astro-client.d.ts +1 -1
  45. package/dist/ssr/astro-client.js +1 -14
  46. package/dist/ssr/astro-client.js.map +1 -1
  47. package/dist/ssr/astro-middleware-extract-static.d.ts +10 -0
  48. package/dist/ssr/astro-middleware-extract-static.js +9 -0
  49. package/dist/ssr/astro-middleware-extract-static.js.map +1 -0
  50. package/dist/ssr/astro-middleware-extract.d.ts +10 -0
  51. package/dist/ssr/astro-middleware-extract.js +9 -0
  52. package/dist/ssr/astro-middleware-extract.js.map +1 -0
  53. package/dist/ssr/astro-middleware-static.d.ts +17 -0
  54. package/dist/ssr/astro-middleware-static.js +7 -0
  55. package/dist/ssr/astro-middleware-static.js.map +1 -0
  56. package/dist/ssr/astro-middleware.d.ts +11 -8
  57. package/dist/ssr/astro-middleware.js +2 -14
  58. package/dist/ssr/astro-middleware.js.map +1 -1
  59. package/dist/ssr/astro.d.ts +40 -10
  60. package/dist/ssr/astro.js +163 -91
  61. package/dist/ssr/astro.js.map +1 -1
  62. package/dist/ssr/client.d.ts +2 -0
  63. package/dist/ssr/client.js +2 -0
  64. package/dist/ssr/index.d.ts +5 -32
  65. package/dist/ssr/index.js +6 -6
  66. package/dist/ssr/index.js.map +1 -1
  67. package/dist/ssr/next-config.d.ts +64 -0
  68. package/dist/ssr/next-config.js +123 -0
  69. package/dist/ssr/next-config.js.map +1 -0
  70. package/dist/ssr/next.d.ts +9 -9
  71. package/dist/ssr/next.js +29 -44
  72. package/dist/ssr/next.js.map +1 -1
  73. package/dist/static/index.d.ts +8 -9
  74. package/dist/static/index.js +4 -22
  75. package/dist/static/index.js.map +1 -1
  76. package/dist/static/inject.d.ts +1 -2
  77. package/dist/static/inject.js.map +1 -1
  78. package/dist/{index-tcHuMPFt.d.ts → types-CYQIhUg1.d.ts} +883 -600
  79. package/dist/zero/babel.d.ts +12 -20
  80. package/dist/zero/babel.js +97 -156
  81. package/dist/zero/babel.js.map +1 -1
  82. package/dist/zero/index.d.ts +76 -7
  83. package/dist/zero/index.js +25 -2
  84. package/dist/zero/index.js.map +1 -0
  85. package/dist/zero/next.d.ts +4 -5
  86. package/dist/zero/next.js +3 -38
  87. package/dist/zero/next.js.map +1 -1
  88. package/docs/README.md +20 -9
  89. package/docs/adoption.md +69 -36
  90. package/docs/ai-agents.md +259 -0
  91. package/docs/comparison.md +77 -47
  92. package/docs/configuration.md +617 -98
  93. package/docs/debug.md +28 -15
  94. package/docs/design-system.md +154 -33
  95. package/docs/dsl.md +715 -194
  96. package/docs/getting-started.md +130 -50
  97. package/docs/injector.md +160 -69
  98. package/docs/methodology.md +82 -51
  99. package/docs/migration-v3.md +285 -0
  100. package/docs/pipeline.md +102 -33
  101. package/docs/plugins.md +333 -0
  102. package/docs/react-api.md +215 -50
  103. package/docs/runtime-benchmarks.md +388 -0
  104. package/docs/ssr.md +310 -118
  105. package/docs/styles.md +225 -42
  106. package/docs/tasty-static.md +289 -136
  107. package/package.json +141 -45
  108. package/tasty.config.ts +6 -0
  109. package/dist/async-storage-B7_o6FKt.js +0 -44
  110. package/dist/async-storage-B7_o6FKt.js.map +0 -1
  111. package/dist/collector-BMEQCkCn.js.map +0 -1
  112. package/dist/config-eiremPHv.js +0 -10559
  113. package/dist/config-eiremPHv.js.map +0 -1
  114. package/dist/context-CkSg-kDT.js +0 -24
  115. package/dist/context-CkSg-kDT.js.map +0 -1
  116. package/dist/core-Dm9EkOA_.js +0 -1598
  117. package/dist/core-Dm9EkOA_.js.map +0 -1
  118. package/dist/css-writer-BSv8PrEX.js.map +0 -1
  119. package/dist/format-global-rules-Dbc_1tc3.js +0 -22
  120. package/dist/format-global-rules-Dbc_1tc3.js.map +0 -1
  121. package/dist/format-rules-DcFFQceU.js +0 -143
  122. package/dist/format-rules-DcFFQceU.js.map +0 -1
  123. package/dist/hydrate-B6SjFHhj.js +0 -45
  124. package/dist/hydrate-B6SjFHhj.js.map +0 -1
  125. package/dist/index.js.map +0 -1
  126. package/dist/keyframes-DJ8Geo4L.js +0 -595
  127. package/dist/keyframes-DJ8Geo4L.js.map +0 -1
  128. package/dist/merge-styles-3il_ClCF.js.map +0 -1
  129. package/dist/resolve-recipes-B3MSkfFQ.js +0 -144
  130. package/dist/resolve-recipes-B3MSkfFQ.js.map +0 -1
@@ -1,288 +1,8 @@
1
1
  import { Properties } from "csstype";
2
-
3
- //#region src/properties/property-type-resolver.d.ts
4
- /**
5
- * PropertyTypeResolver
6
- *
7
- * Automatically infers CSS @property types from custom property values.
8
- * Supports deferred resolution for var() reference chains of arbitrary depth.
9
- */
10
- declare class PropertyTypeResolver {
11
- /** propName → the prop it depends on */
12
- private pendingDeps;
13
- /** propName → list of props waiting on it */
14
- private reverseDeps;
15
- /**
16
- * Scan CSS declarations and auto-register @property for custom properties
17
- * whose types can be inferred from their values.
18
- */
19
- scanDeclarations(declarations: string, isPropertyDefined: (name: string) => boolean, registerProperty: (name: string, syntax: string, initialValue: string) => void): void;
20
- private addDependency;
21
- private resolve;
22
- private isComplexValue;
23
- }
24
- //#endregion
25
- //#region src/injector/types.d.ts
26
- declare global {
27
- interface Window {
28
- __TASTY__?: string[];
29
- }
30
- }
31
- interface InjectResult {
32
- className: string;
33
- dispose: () => void;
34
- }
35
- interface GlobalInjectResult {
36
- dispose: () => void;
37
- }
38
- type DisposeFunction = () => void;
39
- interface StyleInjectorConfig {
40
- nonce?: string;
41
- maxRulesPerSheet?: number;
42
- forceTextInjection?: boolean;
43
- /** Enable development mode features: performance metrics and debug information storage */
44
- devMode?: boolean;
45
- /**
46
- * Global predefined states for advanced state mapping.
47
- * These are state aliases that can be used in any component.
48
- * Example: { '@mobile': '@media(w < 920px)', '@dark': '@root(theme=dark)' }
49
- */
50
- states?: Record<string, string>;
51
- /**
52
- * Automatically infer and register CSS @property declarations
53
- * from custom property values. When false, only explicit @properties are used.
54
- * @default true
55
- */
56
- autoPropertyTypes?: boolean;
57
- /** Garbage collection configuration for unused styles */
58
- gc?: GCConfig;
59
- /**
60
- * Prefix prepended to every generated identifier.
61
- * Mirrors the `namePrefix` field on the public `TastyConfig` so that
62
- * standalone injector consumers can configure it directly.
63
- * @default 't'
64
- */
65
- namePrefix?: string;
66
- }
67
- /**
68
- * Per-className usage tracking for GC.
69
- */
70
- interface StyleUsage {
71
- lastTouchedAt: number;
72
- }
73
- /**
74
- * Configuration for the style garbage collector.
75
- *
76
- * GC is triggered by touch count rather than timers: every `touchInterval`
77
- * touches, an idle callback is scheduled to evict unused styles above
78
- * `capacity`, oldest first.
79
- */
80
- interface GCConfig {
81
- /**
82
- * Number of touch events between GC cycles.
83
- * @default 1000
84
- */
85
- touchInterval?: number;
86
- /**
87
- * Maximum number of unused styles to retain.
88
- * GC evicts the oldest unused styles when this limit is exceeded.
89
- * Actively referenced styles (refCount > 0) and DOM-live styles
90
- * do not count against this limit.
91
- * @default 1000
92
- */
93
- capacity?: number;
94
- }
95
- /**
96
- * Per-call options for gc().
97
- */
98
- interface GCOptions {
99
- root?: Document | ShadowRoot;
100
- /** Bypass capacity threshold and remove ALL unused styles. */
101
- force?: boolean;
102
- }
103
- interface RuleInfo {
104
- className: string;
105
- ruleIndex: number;
106
- sheetIndex: number;
107
- /** Dev-only: full CSS texts inserted for this class; omitted in production */
108
- cssText?: string[];
109
- /** Inclusive end index of the contiguous block of inserted rules for this className */
110
- endRuleIndex?: number;
111
- /** NEW: exact indices of all inserted rules for this className */
112
- indices?: number[];
113
- }
114
- type InjectionMode = 'style-element' | 'adopted';
115
- interface SheetInfo {
116
- /** HTMLStyleElement used in style-element mode; null in adopted mode. */
117
- sheet: HTMLStyleElement | null;
118
- /** Constructable CSSStyleSheet used in adopted mode (ShadowRoot targets) */
119
- constructableSheet?: CSSStyleSheet;
120
- ruleCount: number;
121
- holes: number[];
122
- }
123
- interface CleanupStats {
124
- timestamp: number;
125
- classesDeleted: number;
126
- cssSize: number;
127
- rulesDeleted: number;
128
- }
129
- interface CacheMetrics {
130
- hits: number;
131
- misses: number;
132
- bulkCleanups: number;
133
- totalInsertions: number;
134
- totalUnused: number;
135
- stylesCleanedUp: number;
136
- cleanupHistory: CleanupStats[];
137
- startTime: number;
138
- unusedHits?: number;
139
- }
140
- interface RootRegistry {
141
- sheets: SheetInfo[];
142
- refCounts: Map<string, number>;
143
- rules: Map<string, RuleInfo>;
144
- /** Cache key to className mapping to avoid dual storage of RuleInfo objects */
145
- cacheKeyToClassName: Map<string, string>;
146
- /** Deduplication set of fully materialized CSS rules inserted into sheets */
147
- ruleTextSet: Set<string>;
148
- /** Performance metrics (optional) */
149
- metrics?: CacheMetrics;
150
- /** Keyframes cache by content hash -> entry */
151
- keyframesCache: Map<string, KeyframesCacheEntry>;
152
- /** Keyframes name to content hash mapping for collision detection */
153
- keyframesNameToContent: Map<string, string>;
154
- /** Counter for generating keyframes names like k0, k1, k2... */
155
- keyframesCounter: number;
156
- /** Map of injected @property names to their normalized declarations for tracking */
157
- injectedProperties: Map<string, string>;
158
- /** Content hashes of injected @font-face rules for deduplication */
159
- injectedFontFaces: Set<string>;
160
- /** Names of injected @counter-style rules for deduplication */
161
- injectedCounterStyles: Set<string>;
162
- /** Global rules tracking for index adjustment */
163
- globalRules: Map<string, RuleInfo>;
164
- /** Resolver for auto-inferring @property types from declaration values */
165
- propertyTypeResolver: PropertyTypeResolver;
166
- /** Per-className usage tracking for GC */
167
- usageMap: Map<string, StyleUsage>;
168
- /** Touch counter for scheduling GC (per-root) */
169
- touchCount: number;
170
- /** How many entries from `window.__TASTY__` have been synced into this registry */
171
- serverClassSyncIndex: number;
172
- /** Whether `<style data-tasty-rsc>` tags have been scanned for class names */
173
- rscStylesScanned: boolean;
174
- /** Whether this root uses adoptedStyleSheets or <style> elements */
175
- injectionMode: InjectionMode;
176
- /**
177
- * Lazy feature-test for `@property` support, cached per registry.
178
- * - `undefined`: not yet probed.
179
- * - `true`: engine supports `@property`; rejections indicate user-authored
180
- * invalid rules and should warn.
181
- * - `false`: engine doesn't support `@property` (e.g., jsdom); rejections
182
- * are expected and warnings are suppressed.
183
- */
184
- atPropertySupported?: boolean;
185
- }
186
- type StyleRule = StyleResult;
187
- interface KeyframesInfo {
188
- name: string;
189
- sheetIndex: number;
190
- ruleIndex: number;
191
- /** Dev-only: full CSS text of the @keyframes rule; omitted in production */
192
- cssText?: string;
193
- }
194
- type KeyframeStep = string | Record<string, string | number>;
195
- type KeyframesSteps = Record<string, KeyframeStep>;
196
- interface KeyframesResult {
197
- toString(): string;
198
- dispose: () => void;
199
- }
200
- interface KeyframesCacheEntry {
201
- name: string;
202
- refCount: number;
203
- info: KeyframesInfo;
204
- }
205
- /**
206
- * Definition for a CSS @property at-rule.
207
- * Used to define custom property syntax, inheritance, and initial value.
208
- */
209
- interface PropertyDefinition {
210
- /** CSS syntax string (e.g., '<color>', '<angle>', '<number>') */
211
- syntax?: string;
212
- /** Whether the property inherits (default: true) */
213
- inherits?: boolean;
214
- /** Initial value for the property */
215
- initialValue?: string | number;
216
- }
217
- /**
218
- * Descriptors for a CSS @font-face at-rule.
219
- */
220
- interface FontFaceDescriptors {
221
- /** Required. URL(s) to the font file(s). */
222
- src: string;
223
- /** Font weight or range. Default: 'normal'. */
224
- fontWeight?: string | number;
225
- /** Font style. Default: 'normal'. */
226
- fontStyle?: 'normal' | 'italic' | 'oblique' | (string & {});
227
- /** Font stretch. Default: 'normal'. */
228
- fontStretch?: string;
229
- /** Loading behavior. Default: 'auto'. */
230
- fontDisplay?: 'auto' | 'block' | 'swap' | 'fallback' | 'optional';
231
- /** Unicode range to cover. */
232
- unicodeRange?: string;
233
- /** Ascent metric override. */
234
- ascentOverride?: string;
235
- /** Descent metric override. */
236
- descentOverride?: string;
237
- /** Line gap metric override. */
238
- lineGapOverride?: string;
239
- /** Size adjustment factor. */
240
- sizeAdjust?: string;
241
- /** OpenType feature settings. */
242
- fontFeatureSettings?: string;
243
- /** Font variation axis settings. */
244
- fontVariationSettings?: string;
245
- }
246
- /** Single descriptor or array of descriptors for multiple weights/styles. */
247
- type FontFaceInput = FontFaceDescriptors | FontFaceDescriptors[];
248
- /**
249
- * Descriptors for a CSS @counter-style at-rule.
250
- */
251
- interface CounterStyleDescriptors {
252
- /** Required. Numbering algorithm. */
253
- system: 'cyclic' | 'numeric' | 'alphabetic' | 'symbolic' | 'additive' | 'fixed' | (string & {});
254
- /** Symbols for non-additive systems. */
255
- symbols?: string;
256
- /** Symbol-value pairs for additive system. */
257
- additiveSymbols?: string;
258
- /** String prepended to the marker. Default: "". */
259
- prefix?: string;
260
- /** String appended to the marker. Default: ". ". */
261
- suffix?: string;
262
- /** Negative-value wrapping (e.g., '"(" ")"'). */
263
- negative?: string;
264
- /** Counter range (e.g., 'infinite infinite'). */
265
- range?: string;
266
- /** Minimum marker width and pad symbol (e.g., '3 "0"'). */
267
- pad?: string;
268
- /** Fallback counter style name. */
269
- fallback?: string;
270
- /** Speech synthesis hint. */
271
- speakAs?: string;
272
- }
273
- interface RawCSSResult {
274
- dispose: () => void;
275
- }
276
- //#endregion
277
2
  //#region src/utils/css-types.d.ts
278
3
  interface CSSProperties extends Properties<string | number> {}
279
4
  //#endregion
280
5
  //#region src/parser/types.d.ts
281
- declare enum Bucket {
282
- Color = 0,
283
- Value = 1,
284
- Mod = 2
285
- }
286
6
  /**
287
7
  * A part within a group, representing a slash-separated segment.
288
8
  * For example, in `'2px solid #red / 4px'`, there are two parts:
@@ -321,7 +41,7 @@ interface ProcessedStyle {
321
41
  }
322
42
  type UnitHandler = (scalar: number) => string;
323
43
  interface ParserOptions {
324
- funcs?: Record<string, (parsed: StyleDetails[]) => string>;
44
+ functions?: Record<string, (parsed: StyleDetails[]) => string>;
325
45
  units?: Record<string, string | UnitHandler>;
326
46
  cacheSize?: number;
327
47
  }
@@ -332,7 +52,7 @@ declare class StyleParser {
332
52
  private cache;
333
53
  constructor(opts?: ParserOptions);
334
54
  process(src: string): ProcessedStyle;
335
- setFuncs(funcs: Required<ParserOptions>['funcs']): void;
55
+ setFunctions(functions: Required<ParserOptions>['functions']): void;
336
56
  setUnits(units: Required<ParserOptions>['units']): void;
337
57
  updateOptions(patch: Partial<ParserOptions>): void;
338
58
  /**
@@ -347,50 +67,6 @@ declare class StyleParser {
347
67
  getUnits(): ParserOptions['units'];
348
68
  }
349
69
  //#endregion
350
- //#region src/utils/color-math.d.ts
351
- /**
352
- * Consolidated color conversion math.
353
- *
354
- * Single source of truth for all color space conversions used across the
355
- * library: sRGB gamma, HSL, OKLab, OKLCH, OKHSL, hex parsing, named
356
- * colors, and CSS string converters.
357
- *
358
- * This module has zero internal imports — it is a leaf dependency.
359
- *
360
- * Reference: https://bottosson.github.io/posts/oklab/
361
- */
362
- type Vec3 = [number, number, number];
363
- /**
364
- * HSL to RGB.
365
- * Algorithm from CSS Color 4 spec.
366
- *
367
- * @param h - Hue in degrees (0-360)
368
- * @param s - Saturation (0-1)
369
- * @param l - Lightness (0-1)
370
- * @returns RGB values in 0-255 range (may have fractional values)
371
- */
372
- declare function hslToRgbValues(h: number, s: number, l: number): Vec3;
373
- declare function getNamedColorHex(): Map<string, string>;
374
- /**
375
- * Convert hex color string to `rgb()` CSS string.
376
- * Supports 3, 4, 6, and 8 character hex values (with or without `#`).
377
- */
378
- declare function hexToRgb(hex: string): string | null;
379
- /**
380
- * Extract RGB values from an `rgb()`/`rgba()` string.
381
- * Supports comma-separated, space-separated, fractional, percentage,
382
- * and slash alpha notation.
383
- *
384
- * @returns Array of RGB values (0-255 range), converting percentages as needed.
385
- */
386
- declare function getRgbValuesFromRgbaString(str: string): number[];
387
- /**
388
- * Convert any recognized color string to an `rgb()` CSS string.
389
- * Handles hex, `okhsl()`, `hsl()`/`hsla()`, named CSS colors,
390
- * and `rgb()`/`rgba()` pass-through.
391
- */
392
- declare function strToRgb(color: string, _ignoreAlpha?: boolean): string | null | undefined;
393
- //#endregion
394
70
  //#region src/utils/styles.d.ts
395
71
  type StyleValue<T = string> = T | boolean | number | null | undefined;
396
72
  /**
@@ -409,12 +85,45 @@ type StyleValueStateMap<T = string> = Record<string, StyleValue<T> | '@inherit'>
409
85
  * Use this for component props that accept style values.
410
86
  */
411
87
  type StylePropValue<T = string> = StyleValue<T> | StyleValueStateMap<T>;
88
+ /**
89
+ * One dependency value as a style handler receives it: already resolved for a
90
+ * single state, but still the **raw authored DSL string** (`'2x'`, `'#purple.5'`).
91
+ * Handlers parse it themselves via {@link parseStyle} / {@link parseColor}.
92
+ */
93
+ type ResolvedStyleValue = StyleValue<string>;
94
+ /**
95
+ * The dependency map a handler receives — one resolved value per style name in
96
+ * its `__lookupStyles`.
97
+ */
98
+ type StyleHandlerProps<TDeps extends string = string> = Partial<Record<TDeps, ResolvedStyleValue>>;
99
+ /**
100
+ * One set of CSS declarations returned by a style handler.
101
+ *
102
+ * Keys are **kebab-case** CSS property names (`'background-color'`, not
103
+ * `backgroundColor`) or `--custom-property` names. Values are stringified, so
104
+ * numbers are accepted. `$` is reserved as a selector suffix.
105
+ */
412
106
  type CSSMap = {
107
+ /** Selector suffix (or suffixes) these declarations apply to, e.g. `'& > *'`. */
413
108
  $?: string | string[];
414
- } & Record<string, string | string[]>;
109
+ } & Record<string, string | number | (string | number)[] | undefined>;
415
110
  type StyleHandlerResult = CSSMap | CSSMap[] | null | void;
416
- type RawStyleHandler = (value: StyleValueStateMap) => StyleHandlerResult;
417
- type StyleHandler = RawStyleHandler & {
111
+ type RawStyleHandler<TProps extends object = StyleHandlerProps> = (props: TProps) => StyleHandlerResult;
112
+ type StyleHandler<TProps extends object = StyleHandlerProps> = RawStyleHandler<TProps> & {
113
+ __lookupStyles: string[];
114
+ };
115
+ /**
116
+ * The handler type used by the registry (`STYLE_HANDLER_MAP`), with parameter
117
+ * variance erased.
118
+ *
119
+ * Handlers declare narrow, hand-written dependency types — `({ fill }: { fill?:
120
+ * string }) => …` — which under `strictFunctionTypes` are not assignable to a
121
+ * wider parameter type. The registry stores handlers of many different dependency
122
+ * shapes together, so it needs the erased form. Prefer {@link StyleHandler} (or
123
+ * {@link defineHandler}) when writing a handler; this type is for code that
124
+ * inspects the registry.
125
+ */
126
+ type AnyStyleHandler = ((props: any) => StyleHandlerResult) & {
418
127
  __lookupStyles: string[];
419
128
  };
420
129
  /**
@@ -422,8 +131,11 @@ type StyleHandler = RawStyleHandler & {
422
131
  * - Function only: lookup styles inferred from key name
423
132
  * - Single property tuple: ['styleName', handler]
424
133
  * - Multi-property tuple: [['style1', 'style2'], handler]
134
+ *
135
+ * Use {@link defineHandler} to have the dependency names inferred into the
136
+ * handler's parameter type instead of annotating it by hand.
425
137
  */
426
- type StyleHandlerDefinition = RawStyleHandler | [string, RawStyleHandler] | [string[], RawStyleHandler];
138
+ type StyleHandlerDefinition<TDeps extends string = string> = RawStyleHandler<StyleHandlerProps<TDeps>> | [TDeps, RawStyleHandler<StyleHandlerProps<TDeps>>] | [readonly TDeps[], RawStyleHandler<StyleHandlerProps<TDeps>>];
427
139
  interface ParsedColor {
428
140
  color?: string;
429
141
  name?: string;
@@ -439,36 +151,15 @@ declare const CUSTOM_UNITS: {
439
151
  sf: (num: number) => string;
440
152
  };
441
153
  declare const DIRECTIONS: string[];
442
- declare function customFunc(name: string, fn: (groups: StyleDetails[]) => string): void;
443
154
  /**
444
155
  * Get the global StyleParser instance.
445
156
  * Used by configure() to apply parser configuration.
446
157
  */
447
158
  declare function getGlobalParser(): StyleParser;
448
159
  /**
449
- * Get the current custom functions registry.
450
- * Used by configure() to merge with new functions.
451
- */
452
- declare function getGlobalFuncs(): Record<string, (groups: StyleDetails[]) => string>;
453
- /**
454
- * Set global predefined tokens.
455
- * Called from configure() after processing token values.
456
- * Merges with existing tokens (new tokens override existing ones with same key).
457
- * Keys are normalized to lowercase (parser lowercases input before classification).
458
- * @internal
459
- */
460
- declare function setGlobalPredefinedTokens(tokens: Record<string, string>): void;
461
- /**
462
- * Get the current global predefined tokens.
463
- * Returns null if no tokens are configured.
464
- */
465
- declare function getGlobalPredefinedTokens(): Record<string, string> | null;
466
- /**
467
- * Reset global predefined tokens.
468
- * Used for testing.
469
- * @internal
160
+ * Get the current global predefined tokens, including built-in defaults.
470
161
  */
471
- declare function resetGlobalPredefinedTokens(): void;
162
+ declare function getGlobalPredefinedTokens(): Record<string, string>;
472
163
  /**
473
164
  *
474
165
  * @param {String} value
@@ -481,7 +172,7 @@ declare function parseStyle(value: StyleValue): ProcessedStyle;
481
172
  * Optimized to avoid heavy parseStyle calls for simple color patterns.
482
173
  */
483
174
  declare function parseColor(val: string, ignoreError?: boolean): ParsedColor;
484
- declare function filterMods(mods: string[], allowedMods: string[]): string[];
175
+ declare function filterMods(mods: string[], allowedMods: readonly string[]): string[];
485
176
  declare function stringifyStyles(styles: unknown): string;
486
177
  //#endregion
487
178
  //#region src/styles/types.d.ts
@@ -524,7 +215,11 @@ type Digit = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
524
215
  type OpaquePercentage = '' | `.${Digit}` | `.${Digit}${Digit}` | '.100';
525
216
  type ColorValue = `#${NamedColor}${OpaquePercentage}` | `rgb(${string})` | `hsl(${string})` | `okhsl(${string})` | `oklch(${string})` | (string & {});
526
217
  type NoType = false | null | undefined;
527
- interface StylesInterface extends Omit<CSSProperties, 'color' | 'fill' | 'font' | 'outline' | 'type' | 'gap' | 'padding' | 'margin' | 'width' | 'height' | 'border' | 'transition' | 'placeContent' | 'placeItems' | 'scrollMargin' | 'scrollMarginTop' | 'scrollMarginRight' | 'scrollMarginBottom' | 'scrollMarginLeft' | 'scrollMarginBlock' | 'scrollMarginInline'> {
218
+ interface StylesInterface extends Omit<CSSProperties, 'color' | 'fill' | 'font' | 'outline' | 'type' | 'gap' | 'padding' | 'margin' | 'width' | 'height' | 'blockSize' | 'inlineSize' | 'border' | 'transition' | 'placeContent' | 'placeItems' | 'scrollMargin' | 'scrollMarginTop' | 'scrollMarginRight' | 'scrollMarginBottom' | 'scrollMarginLeft' | 'scrollPadding' | 'scrollPaddingTop' | 'scrollPaddingRight' | 'scrollPaddingBottom' | 'scrollPaddingLeft' | 'overscrollBehaviorBlock' | 'overscrollBehaviorInline' | 'overscrollBehaviorX' | 'overscrollBehaviorY'> {
219
+ overscrollBehaviorBlock?: CSSProperties['overscrollBehaviorBlock'] | 'chain';
220
+ overscrollBehaviorInline?: CSSProperties['overscrollBehaviorInline'] | 'chain';
221
+ overscrollBehaviorX?: CSSProperties['overscrollBehaviorX'] | 'chain';
222
+ overscrollBehaviorY?: CSSProperties['overscrollBehaviorY'] | 'chain';
528
223
  /**
529
224
  * @deprecated Use `flow` style instead.
530
225
  */
@@ -540,7 +235,7 @@ interface StylesInterface extends Omit<CSSProperties, 'color' | 'fill' | 'font'
540
235
  /**
541
236
  * Set the background color of the element. Shortcut for `background-color` with enhanced support for Tasty color tokens and syntaxes.
542
237
  *
543
- * Supports double-color syntax: the second color is applied as a foreground overlay via a CSS custom property.
238
+ * To paint one color over another, use a compound color: `#surface+#dark.04` is `#dark` at 4% opacity over `#surface`, as one background color.
544
239
  *
545
240
  * Examples:
546
241
  * - `fill="#purple.10"` // purple background with 10% opacity
@@ -550,8 +245,11 @@ interface StylesInterface extends Omit<CSSProperties, 'color' | 'fill' | 'font'
550
245
  * - `fill="hsl(200 100% 50%)"` // HSL color
551
246
  * - `fill="okhsl(200 100% 50%)"` // perceptually uniform OKHSL color
552
247
  * - `fill="oklch(0.7 0.15 200)"` // OKLCH color
553
- * - `fill="#primary #secondary"` // double color (second as foreground overlay)
554
- * - `fill={true}` // default fill color
248
+ * - `fill="#surface+#dark.04"` // `#dark` at 4% opacity over `#surface`, as one color
249
+ * - `fill="#dark 4%, #surface"` // deprecated: two colors mixed with a comma, the same color as `#surface+#dark.04`
250
+ * - `fill="#surface #dark.04"` // deprecated: the second color as an overlay layer
251
+ *
252
+ * `fill={false}` sets no fill. `fill={true}` names no color and is ignored.
555
253
  */
556
254
  fill?: ColorValue | boolean;
557
255
  /**
@@ -605,9 +303,12 @@ interface StylesInterface extends Omit<CSSProperties, 'color' | 'fill' | 'font'
605
303
  /**
606
304
  * The fade style applies gradient-based fading masks to the edges of an element. Replaces complex CSS mask gradients with a simple, declarative API.
607
305
  *
608
- * Syntax: `[width] [directions] [#from-color] [#to-color]`
306
+ * Syntax: `[width] [direction...] [#from-color] [#to-color]`
609
307
  *
610
- * Multiple groups can be separated by commas to specify different colors per direction.
308
+ * Multiple groups can be separated by commas to specify different widths and
309
+ * colors per direction. A group that names edges takes a single width, applied
310
+ * to every edge it names; a group that names none covers all four edges and
311
+ * keeps plain CSS shorthand order.
611
312
  *
612
313
  * Color tokens (optional):
613
314
  * - First color: transparent start of gradient (default: `rgb(0 0 0 / 0)`)
@@ -616,14 +317,16 @@ interface StylesInterface extends Omit<CSSProperties, 'color' | 'fill' | 'font'
616
317
  * Examples:
617
318
  * - `fade="top"` // fade only top edge with default width
618
319
  * - `fade="2x left right"` // fade left and right edges with 2x width
320
+ * - `fade={true}` // all edges at the design-system default width
619
321
  * - `fade="1x top"` // fade only top edge with 1x width
620
- * - `fade="3x 1x top bottom"` // top: 3x width, bottom: 1x width
322
+ * - `fade="3x 1x"` // all edges: top/bottom 3x, left/right 1x
323
+ * - `fade="3x top, 1x bottom"` // top: 3x width, bottom: 1x width
621
324
  * - `fade="2x #transparent #dark"` // custom colors for gradient mask
622
325
  * - `fade="1x top #clear #solid"` // top edge with custom mask colors
623
326
  * - `fade="top #red #blue, bottom #green #yellow"` // different colors per direction
624
327
  * - `fade="2x top #a #b, 1x bottom #c #d"` // different widths and colors per direction
625
328
  */
626
- fade?: 'top' | 'right' | 'bottom' | 'left' | string;
329
+ fade?: 'top' | 'right' | 'bottom' | 'left' | string | boolean;
627
330
  /**
628
331
  * Scrollbar styling using standard CSS properties (`scrollbar-width`, `scrollbar-color`, `scrollbar-gutter`).
629
332
  *
@@ -660,23 +363,39 @@ interface StylesInterface extends Omit<CSSProperties, 'color' | 'fill' | 'font'
660
363
  /**
661
364
  * Shorthand for element padding. Supports custom units, directional modifiers, and design-system-driven defaults.
662
365
  *
366
+ * A group that names directions takes a single value, applied to every
367
+ * direction it names — use comma groups for per-side values.
368
+ *
663
369
  * Examples:
664
370
  * - `padding="2x 1x"` // top/bottom: 2x, left/right: 1x
665
371
  * - `padding="2x top"` // only top padding: 2x
666
372
  * - `padding="1x left right"` // left and right padding: 1x
373
+ * - `padding="2x top, 4x right"` // top: 2x, right: 4x, bottom/left: 0
667
374
  * - `padding={true}` // default padding on all sides
668
375
  */
669
376
  padding?: CSSProperties['padding'] | string | boolean;
377
+ /** Logical block-axis padding with `start`/`end` modifiers. */
378
+ blockPadding?: CSSProperties['paddingBlock'] | string | boolean;
379
+ /** Logical inline-axis padding with `start`/`end` modifiers. */
380
+ inlinePadding?: CSSProperties['paddingInline'] | string | boolean;
670
381
  /**
671
382
  * Shorthand for element margin. Supports custom units, directional modifiers, and design-system-driven defaults.
672
383
  *
384
+ * A group that names directions takes a single value, applied to every
385
+ * direction it names — use comma groups for per-side values.
386
+ *
673
387
  * Examples:
674
388
  * - `margin="2x 1x"` // top/bottom: 2x, left/right: 1x
675
389
  * - `margin="2x top"` // only top margin: 2x
676
390
  * - `margin="1x left right"` // left and right margin: 1x
391
+ * - `margin="2x top, 4x right"` // top: 2x, right: 4x, bottom/left: 0
677
392
  * - `margin={true}` // default margin on all sides
678
393
  */
679
394
  margin?: CSSProperties['margin'] | string | boolean;
395
+ /** Logical block-axis margin with `start`/`end` modifiers. */
396
+ blockMargin?: CSSProperties['marginBlock'] | string | boolean;
397
+ /** Logical inline-axis margin with `start`/`end` modifiers. */
398
+ inlineMargin?: CSSProperties['marginInline'] | string | boolean;
680
399
  /**
681
400
  * Concise shorthand for setting element width, including min-width and max-width. Supports custom units and advanced sizing keywords.
682
401
  *
@@ -708,6 +427,16 @@ interface StylesInterface extends Omit<CSSProperties, 'color' | 'fill' | 'font'
708
427
  * - `height={true}` // height: auto
709
428
  */
710
429
  height?: CSSProperties['height'] | string | boolean;
430
+ /**
431
+ * Logical block size with the same enhanced min/max/fixed syntax as `width`.
432
+ * Emits native `block-size`, `min-block-size`, and `max-block-size` declarations.
433
+ */
434
+ blockSize?: CSSProperties['blockSize'] | string | boolean;
435
+ /**
436
+ * Logical inline size with the same enhanced min/max/fixed syntax as `width`.
437
+ * Emits native `inline-size`, `min-inline-size`, and `max-inline-size` declarations.
438
+ */
439
+ inlineSize?: CSSProperties['inlineSize'] | string | boolean;
711
440
  /**
712
441
  * Shorthand for border width, style, and color. Supports directional modifiers and design-system defaults.
713
442
  *
@@ -722,8 +451,17 @@ interface StylesInterface extends Omit<CSSProperties, 'color' | 'fill' | 'font'
722
451
  * - `border="dotted #danger left right"` // left/right: 1bw dotted danger
723
452
  * - `border="1bw #red, 2bw #blue top"` // all sides red 1bw, top overridden to blue 2bw
724
453
  * - `border="1bw, dashed top bottom, #purple left right"` // base 1bw, dashed on top/bottom, purple on left/right
454
+ * - `border="1bw $my-style"` // custom property in the style slot
455
+ *
456
+ * A `$name` reference fills the first free slot — width, then style, then
457
+ * color. Colors are authored as `#name`; to point the color slot at a raw
458
+ * custom property directly, name it `$name-color`.
725
459
  */
726
460
  border?: CSSProperties['border'] | string | boolean;
461
+ /** Logical block-axis border with `start`/`end` modifiers. */
462
+ blockBorder?: CSSProperties['borderBlock'] | string | boolean;
463
+ /** Logical inline-axis border with `start`/`end` modifiers. */
464
+ inlineBorder?: CSSProperties['borderInline'] | string | boolean;
727
465
  /**
728
466
  * Powerful shorthand for CSS transitions using semantic names and design tokens. Supports grouped transitions for common UI effects.
729
467
  *
@@ -731,10 +469,10 @@ interface StylesInterface extends Omit<CSSProperties, 'color' | 'fill' | 'font'
731
469
  * Multiple transitions: separated by commas
732
470
  *
733
471
  * Examples:
734
- * - `transition="fill 0.2s, radius 0.3s"` // transitions background-color and border-radius
735
- * - `transition="fade 0.15s ease-in"` // transitions mask with easing
736
- * - `transition="theme 0.3s"` // transitions all theme-related properties
737
- * - `transition="preset 0.2s"` // transitions typography properties
472
+ * - `transition="fill, radius"` // transitions background-color and border-radius
473
+ * - `transition="fade $transition ease-in"` // transitions mask with explicit timing token
474
+ * - `transition="theme"` // transitions all theme-related properties
475
+ * - `transition="preset"` // transitions typography properties
738
476
  */
739
477
  transition?: CSSProperties['transition'] | string;
740
478
  /**
@@ -760,14 +498,17 @@ interface StylesInterface extends Omit<CSSProperties, 'color' | 'fill' | 'font'
760
498
  * Syntax: `[value] [modifiers]` | `[shape]` | `true`
761
499
  *
762
500
  * Shapes: `round` (fully rounded), `ellipse` (50%), `leaf`, `backleaf` (asymmetric), `inherit` (inherit from parent)
763
- * Directional modifiers: `top`, `right`, `bottom`, `left`
501
+ * Edge modifiers: `top`, `right`, `bottom`, `left` — the corner pair along that edge
502
+ * Corner modifiers: `top-left`, `top-right`, `bottom-right`, `bottom-left` — a single corner
764
503
  *
765
504
  * Examples:
766
- * - `radius="2r"` // border-radius: calc(var(--radius) * 2)
505
+ * - `radius="2r"` // border-radius: 12px
767
506
  * - `radius={true}` // default radius (1r)
768
507
  * - `radius="round"` // fully rounded (9999rem)
769
508
  * - `radius="leaf"` // asymmetric leaf shape
770
- * - `radius="1r top"` // round only top corners
509
+ * - `radius="1r top"` // round both top corners
510
+ * - `radius="top-right"` // round only the top-right corner (1r)
511
+ * - `radius="4px top-left"` // round only the top-left corner
771
512
  * - `radius="inherit"` // inherit border-radius from parent
772
513
  * - `radius="inherit right"` // inherit only right corners (uses longhand properties)
773
514
  */
@@ -837,6 +578,11 @@ interface StylesInterface extends Omit<CSSProperties, 'color' | 'fill' | 'font'
837
578
  * - `outline="2ow dashed #purple"` // 2ow dashed purple outline
838
579
  * - `outline="2ow #danger / 1x"` // 2ow solid danger outline, 1x offset
839
580
  * - `outline={true}` // default outline (1ow solid)
581
+ * - `outline="2ow $my-style"` // custom property in the style slot
582
+ *
583
+ * A `$name` reference fills the first free slot — width, then style, then
584
+ * color. Colors are authored as `#name`; to point the color slot at a raw
585
+ * custom property directly, name it `$name-color`.
840
586
  */
841
587
  outline?: string | boolean;
842
588
  /**
@@ -913,6 +659,7 @@ interface StylesInterface extends Omit<CSSProperties, 'color' | 'fill' | 'font'
913
659
  * Examples:
914
660
  * - `scrollMargin="2x"` // scroll-margin on all sides: 2x
915
661
  * - `scrollMargin="2x top"` // only top scroll-margin: 2x
662
+ * - `scrollMargin="2x top, 4x bottom"` // top: 2x, bottom: 4x
916
663
  * - `scrollMargin={true}` // default scroll-margin on all sides
917
664
  */
918
665
  scrollMargin?: CSSProperties['scrollMargin'] | string | boolean;
@@ -920,8 +667,23 @@ interface StylesInterface extends Omit<CSSProperties, 'color' | 'fill' | 'font'
920
667
  scrollMarginRight?: string | number | boolean;
921
668
  scrollMarginBottom?: string | number | boolean;
922
669
  scrollMarginLeft?: string | number | boolean;
923
- scrollMarginBlock?: string | number | boolean;
924
- scrollMarginInline?: string | number | boolean;
670
+ /** Logical block-axis scroll margin with `start`/`end` modifiers. */
671
+ blockScrollMargin?: CSSProperties['scrollMarginBlock'] | string | boolean;
672
+ /** Logical inline-axis scroll margin with `start`/`end` modifiers. */
673
+ inlineScrollMargin?: CSSProperties['scrollMarginInline'] | string | boolean;
674
+ /**
675
+ * Shorthand for physical scroll padding. Supports custom units and the same
676
+ * physical direction modifiers as `padding`.
677
+ */
678
+ scrollPadding?: CSSProperties['scrollPadding'] | string | boolean;
679
+ scrollPaddingTop?: string | number | boolean;
680
+ scrollPaddingRight?: string | number | boolean;
681
+ scrollPaddingBottom?: string | number | boolean;
682
+ scrollPaddingLeft?: string | number | boolean;
683
+ /** Logical block-axis scroll padding with `start`/`end` modifiers. */
684
+ blockScrollPadding?: CSSProperties['scrollPaddingBlock'] | string | boolean;
685
+ /** Logical inline-axis scroll padding with `start`/`end` modifiers. */
686
+ inlineScrollPadding?: CSSProperties['scrollPaddingInline'] | string | boolean;
925
687
  /**
926
688
  * Shorthand for `top`, `right`, `bottom`, and `left` offsets. Supports custom units, directional modifiers, and positioning.
927
689
  *
@@ -929,9 +691,24 @@ interface StylesInterface extends Omit<CSSProperties, 'color' | 'fill' | 'font'
929
691
  * - `inset="0"` // all sides: 0
930
692
  * - `inset="2x top"` // only top offset: 2x
931
693
  * - `inset="1x left right"` // left and right offsets: 1x
694
+ * - `inset="2x top, 4x right"` // top: 2x, right: 4x, bottom/left: auto
695
+ * - `inset="bottom dock"` // bottom-anchored, full width: auto 0 0 0
932
696
  * - `inset={true}` // all sides: 0
697
+ *
698
+ * A group that names directions takes a single value, applied to every
699
+ * direction it names — use comma groups for per-side values.
700
+ *
701
+ * The `dock` modifier pins the named edge and spans its full length, applying
702
+ * the value to the two perpendicular sides as well. `dock` is the one case
703
+ * where a directional group takes two values: the second applies to those
704
+ * spanned sides, so `inset="2x 4x bottom dock"` pins the bottom at `2x` and
705
+ * insets the sides by `4x`. Without `dock` a second value is ignored.
933
706
  */
934
- inset?: 'top' | 'right' | 'bottom' | 'left' | string | CSSProperties['inset'];
707
+ inset?: 'top' | 'right' | 'bottom' | 'left' | 'dock' | string | CSSProperties['inset'];
708
+ /** Logical block-axis inset with `start`/`end` modifiers. */
709
+ blockInset?: CSSProperties['insetBlock'] | string | boolean;
710
+ /** Logical inline-axis inset with `start`/`end` modifiers. */
711
+ inlineInset?: CSSProperties['insetInline'] | string | boolean;
935
712
  /**
936
713
  * Local keyframes definitions for this component.
937
714
  * Keys are animation names, values are keyframes step definitions.
@@ -951,28 +728,42 @@ interface StylesInterface extends Omit<CSSProperties, 'color' | 'fill' | 'font'
951
728
  * - `#name` for color properties → `--name-color` (auto-sets syntax: '<color>', defaults initialValue: 'transparent')
952
729
  *
953
730
  * Examples:
954
- * - `'@properties': { '$rotation': { syntax: '<angle>', inherits: false, initialValue: '45deg' } }`
955
- * - `'@properties': { '#theme': { initialValue: 'purple' } }` // syntax: '<color>' is auto-set
731
+ * - `'@property': { '$rotation': { syntax: '<angle>', inherits: false, initialValue: '45deg' } }`
732
+ * - `'@property': { '#theme': { initialValue: 'purple' } }` // syntax: '<color>' is auto-set
956
733
  */
957
- '@properties'?: Record<string, PropertyDefinition>;
734
+ '@property'?: Record<string, PropertyDefinition>;
958
735
  /**
959
736
  * Local @font-face definitions for this component.
960
737
  * Keys are font-family names, values are descriptors or arrays of descriptors
961
738
  * (for multiple weights/styles of the same family).
962
739
  *
963
740
  * Examples:
964
- * - `'@fontFace': { Icons: { src: 'url("/fonts/icons.woff2") format("woff2")', fontDisplay: 'block' } }`
965
- * - `'@fontFace': { 'Brand Sans': [{ src: '...', fontWeight: 400 }, { src: '...', fontWeight: 700 }] }`
741
+ * - `'@font-face': { Icons: { src: 'url("/fonts/icons.woff2") format("woff2")', fontDisplay: 'block' } }`
742
+ * - `'@font-face': { 'Brand Sans': [{ src: '...', fontWeight: 400 }, { src: '...', fontWeight: 700 }] }`
966
743
  */
967
- '@fontFace'?: Record<string, FontFaceInput>;
744
+ '@font-face'?: Record<string, FontFaceInput>;
968
745
  /**
969
746
  * Local @counter-style definitions for this component.
970
747
  * Keys are counter-style names, values are descriptor objects.
971
748
  *
972
749
  * Examples:
973
- * - `'@counterStyle': { thumbs: { system: 'cyclic', symbols: '"👍"', suffix: '" "' } }`
750
+ * - `'@counter-style': { thumbs: { system: 'cyclic', symbols: '"👍"', suffix: '" "' } }`
751
+ */
752
+ '@counter-style'?: Record<string, CounterStyleDescriptors>;
753
+ /**
754
+ * Local @function definitions (CSS custom functions) for this component.
755
+ * Keys are function names using `$$name` (the literal callable `--name`),
756
+ * matching the call site `$$name(...)`. Values are function definitions.
757
+ *
758
+ * Local variables are declared directly as `$name` keys on the descriptor;
759
+ * `result`, local-var values, and parameter defaults are parsed through the
760
+ * Tasty DSL (units, color tokens, auto-calc, fallbacks).
761
+ *
762
+ * Examples:
763
+ * - `'@function': { '$$negative': { args: ['$value'], result: '(-1 * $value)' } }`
764
+ * - `'@function': { '$$shadow': { args: { '$color': { syntax: '<color>', default: 'inherit' } }, returns: '<color>', '$offset': '2px', result: '$offset $offset ($color, black)' } }`
974
765
  */
975
- '@counterStyle'?: Record<string, CounterStyleDescriptors>;
766
+ '@function'?: Record<string, FunctionDefinition>;
976
767
  /**
977
768
  * Apply one or more predefined style recipes by name.
978
769
  * Recipes are defined globally via `configure({ recipes: { ... } })`.
@@ -993,8 +784,8 @@ type SuffixForSelector = '&' | '.' | 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'G' | '
993
784
  type Selector = `${SuffixForSelector}${string}`;
994
785
  type NotSelector = Exclude<string, Selector | keyof StylesInterface>;
995
786
  /** Special style keys that should not be wrapped in StyleValue/StyleValueStateMap */
996
- type SpecialStyleKeys = '@keyframes' | '@properties' | '@fontFace' | '@counterStyle' | 'recipe';
997
- type StylesWithoutSelectors = { [key in keyof StylesInterface as key extends SpecialStyleKeys ? never : key]?: StyleValue<StylesInterface[key]> | StyleValueStateMap<StylesInterface[key]> };
787
+ type SpecialStyleKeys = '@keyframes' | '@property' | '@font-face' | '@counter-style' | '@function' | 'recipe';
788
+ type StylesWithoutSelectors = { [key in keyof StylesInterface as key extends SpecialStyleKeys ? never : key]?: StyleValue<StylesInterface[key]> | StyleValueStateMap<StylesInterface[key]>; };
998
789
  /**
999
790
  * Index signature for recipe-specific arbitrary keys.
1000
791
  * Supports local predefined states (`@name`), vendor-prefixed CSS properties (`-webkit-*`),
@@ -1004,283 +795,775 @@ type StylesWithoutSelectors = { [key in keyof StylesInterface as key extends Spe
1004
795
  type RecipeIndexSignature = Record<string, StyleValue<string | number | boolean | undefined> | StyleValueStateMap<string | number | boolean | undefined>>;
1005
796
  /**
1006
797
  * Style type for recipe definitions.
1007
- * Like StylesWithoutSelectors but also allows `@keyframes`, `@properties`,
798
+ * Like StylesWithoutSelectors but also allows `@keyframes`, `@property`,
1008
799
  * local predefined states, and vendor-prefixed CSS properties.
1009
800
  * Excludes `recipe` to prevent recursive references.
1010
801
  */
1011
- type RecipeStyles = StylesWithoutSelectors & RecipeIndexSignature & {
1012
- '@keyframes'?: StylesInterface['@keyframes'];
1013
- '@properties'?: StylesInterface['@properties'];
1014
- '@fontFace'?: StylesInterface['@fontFace'];
1015
- '@counterStyle'?: StylesInterface['@counterStyle'];
1016
- };
1017
- /** Special properties that are not regular style values */
1018
- interface SpecialStyleProperties {
1019
- '@keyframes'?: StylesInterface['@keyframes'];
1020
- '@properties'?: StylesInterface['@properties'];
1021
- '@fontFace'?: StylesInterface['@fontFace'];
1022
- '@counterStyle'?: StylesInterface['@counterStyle'];
1023
- recipe?: StylesInterface['recipe'];
802
+ type RecipeStyles = StylesWithoutSelectors & RecipeIndexSignature & {
803
+ '@keyframes'?: StylesInterface['@keyframes'];
804
+ '@property'?: StylesInterface['@property'];
805
+ '@font-face'?: StylesInterface['@font-face'];
806
+ '@counter-style'?: StylesInterface['@counter-style'];
807
+ '@function'?: StylesInterface['@function'];
808
+ };
809
+ /** Special properties that are not regular style values */
810
+ interface SpecialStyleProperties {
811
+ '@keyframes'?: StylesInterface['@keyframes'];
812
+ '@property'?: StylesInterface['@property'];
813
+ '@font-face'?: StylesInterface['@font-face'];
814
+ '@counter-style'?: StylesInterface['@counter-style'];
815
+ '@function'?: StylesInterface['@function'];
816
+ recipe?: StylesInterface['recipe'];
817
+ }
818
+ /** Index signature for arbitrary style keys (sub-elements, CSS variables, etc.) */
819
+ interface StylesIndexSignature {
820
+ [key: string]: StyleValue<string | number | boolean | undefined> | StyleValueStateMap<string | number | boolean | undefined> | Styles | false | StylesInterface['@keyframes'] | StylesInterface['@property'] | StylesInterface['@font-face'] | StylesInterface['@counter-style'] | StylesInterface['@function'];
821
+ /**
822
+ * Selector combinator: `undefined` (descendant, default), `'>'` (child), `'+'` (adjacent), `'~'` (sibling).
823
+ * Can chain with capitalized names: `'> Body > Row >'`. Spaces required around combinators.
824
+ */
825
+ $?: string;
826
+ }
827
+ type Styles = StylesWithoutSelectors & SpecialStyleProperties & StylesIndexSignature;
828
+ /**
829
+ * Value type for design tokens passed to `configure({ tokens })`.
830
+ * Can be a direct value or a state map for responsive/theme-aware tokens.
831
+ */
832
+ type ConfigTokenValue = string | number | boolean | Record<string, string | number | boolean | undefined | null | '@inherit'>;
833
+ /**
834
+ * Design tokens injected as CSS custom properties on `:root`.
835
+ * Keys must start with `$` (value tokens) or `#` (color tokens).
836
+ *
837
+ * - `$name` keys become `--name` CSS custom properties
838
+ * - `#name` keys become `--name-color` properties
839
+ */
840
+ type ConfigTokens = Record<`$${string}` | `#${string}`, ConfigTokenValue>;
841
+ //#endregion
842
+ //#region src/pipeline/conditions.d.ts
843
+ /**
844
+ * ConditionNode Types and Helpers
845
+ *
846
+ * Core data structures for representing style conditions as an abstract syntax tree.
847
+ * Used throughout the pipeline for parsing, simplification, and CSS generation.
848
+ */
849
+ /**
850
+ * Base interface for all state conditions (leaf nodes)
851
+ */
852
+ interface BaseStateCondition {
853
+ kind: 'state';
854
+ negated: boolean;
855
+ raw: string;
856
+ uniqueId: string;
857
+ }
858
+ /**
859
+ * Modifier condition: [data-attr] or [data-attr="value"]
860
+ */
861
+ interface ModifierCondition extends BaseStateCondition {
862
+ type: 'modifier';
863
+ attribute: string;
864
+ value?: string;
865
+ operator?: '=' | '^=' | '$=' | '*=';
866
+ }
867
+ /**
868
+ * Pseudo-class condition: :hover, :focus-visible
869
+ */
870
+ interface PseudoCondition extends BaseStateCondition {
871
+ type: 'pseudo';
872
+ pseudo: string;
873
+ }
874
+ /**
875
+ * Numeric bound for dimension queries
876
+ */
877
+ interface NumericBound {
878
+ value: string;
879
+ valueNumeric: number | null;
880
+ inclusive: boolean;
881
+ }
882
+ /**
883
+ * Media query condition
884
+ */
885
+ interface MediaCondition extends BaseStateCondition {
886
+ type: 'media';
887
+ subtype: 'dimension' | 'feature' | 'type';
888
+ dimension?: 'width' | 'height' | 'inline-size' | 'block-size';
889
+ lowerBound?: NumericBound;
890
+ upperBound?: NumericBound;
891
+ feature?: string;
892
+ featureValue?: string;
893
+ mediaType?: 'print' | 'screen' | 'all' | 'speech';
894
+ }
895
+ /**
896
+ * Container query condition
897
+ */
898
+ interface ContainerCondition extends BaseStateCondition {
899
+ type: 'container';
900
+ subtype: 'dimension' | 'style' | 'raw';
901
+ containerName?: string;
902
+ dimension?: 'width' | 'height' | 'inline-size' | 'block-size';
903
+ lowerBound?: NumericBound;
904
+ upperBound?: NumericBound;
905
+ property?: string;
906
+ propertyValue?: string;
907
+ rawCondition?: string;
908
+ }
909
+ /**
910
+ * Root state condition: @root(theme=dark)
911
+ */
912
+ interface RootCondition extends BaseStateCondition {
913
+ type: 'root';
914
+ innerCondition: ConditionNode;
915
+ }
916
+ /**
917
+ * Parent state condition: @parent(hovered), @parent(theme=dark, >)
918
+ */
919
+ interface ParentCondition extends BaseStateCondition {
920
+ type: 'parent';
921
+ innerCondition: ConditionNode;
922
+ direct: boolean;
923
+ }
924
+ /**
925
+ * Own state condition: @own(hovered)
926
+ */
927
+ interface OwnCondition extends BaseStateCondition {
928
+ type: 'own';
929
+ innerCondition: ConditionNode;
930
+ }
931
+ /**
932
+ * Starting style condition: @starting
933
+ */
934
+ interface StartingCondition extends BaseStateCondition {
935
+ type: 'starting';
936
+ }
937
+ /**
938
+ * Supports query condition: @supports(display: grid), @supports($, :has(*))
939
+ */
940
+ interface SupportsCondition extends BaseStateCondition {
941
+ type: 'supports';
942
+ subtype: 'feature' | 'selector';
943
+ condition: string;
944
+ }
945
+ /**
946
+ * Union of all state condition types
947
+ */
948
+ type StateCondition = ModifierCondition | PseudoCondition | MediaCondition | ContainerCondition | RootCondition | ParentCondition | OwnCondition | StartingCondition | SupportsCondition;
949
+ /**
950
+ * Compound node: combines conditions with AND/OR
951
+ */
952
+ interface CompoundCondition {
953
+ kind: 'compound';
954
+ operator: 'AND' | 'OR';
955
+ children: ConditionNode[];
956
+ }
957
+ /**
958
+ * True condition (matches everything)
959
+ */
960
+ interface TrueCondition {
961
+ kind: 'true';
962
+ }
963
+ /**
964
+ * False condition (matches nothing - skip this rule)
965
+ */
966
+ interface FalseCondition {
967
+ kind: 'false';
968
+ }
969
+ /**
970
+ * Union of all condition node types
971
+ */
972
+ type ConditionNode = StateCondition | CompoundCondition | TrueCondition | FalseCondition;
973
+ //#endregion
974
+ //#region src/states/index.d.ts
975
+ /**
976
+ * Parsed advanced state information
977
+ */
978
+ interface ParsedAdvancedState {
979
+ type: 'media' | 'container' | 'root' | 'parent' | 'own' | 'starting' | 'predefined' | 'modifier';
980
+ condition: string;
981
+ containerName?: string;
982
+ raw: string;
983
+ mediaType?: string;
984
+ }
985
+ /**
986
+ * Context for state parsing operations
987
+ */
988
+ interface StateParserContext {
989
+ localPredefinedStates: Record<string, string>;
990
+ globalPredefinedStates: Record<string, string>;
991
+ isSubElement?: boolean;
992
+ }
993
+ /**
994
+ * At-rule context for CSS generation
995
+ */
996
+ interface AtRuleContext {
997
+ media?: string[];
998
+ container?: {
999
+ name?: string;
1000
+ condition: string;
1001
+ }[];
1002
+ startingStyle?: boolean;
1003
+ rootStates?: string[];
1004
+ negatedRootStates?: string[];
1005
+ }
1006
+ /**
1007
+ * Configure global predefined states
1008
+ */
1009
+ declare function setGlobalPredefinedStates(states: Record<string, string>): void;
1010
+ /**
1011
+ * Get global predefined states
1012
+ */
1013
+ declare function getGlobalPredefinedStates(): Record<string, string>;
1014
+ /**
1015
+ * Create a state parser context from styles
1016
+ */
1017
+ declare function createStateParserContext(styles?: Styles, isSubElement?: boolean): StateParserContext;
1018
+ //#endregion
1019
+ //#region src/pipeline/parseStateKey.d.ts
1020
+ interface ParseStateKeyOptions {
1021
+ context?: StateParserContext;
1022
+ isSubElement?: boolean;
1023
+ }
1024
+ /**
1025
+ * Parse a state key string into a ConditionNode
1026
+ */
1027
+ declare function parseStateKey(stateKey: string, options?: ParseStateKeyOptions): ConditionNode;
1028
+ //#endregion
1029
+ //#region src/pipeline/index.d.ts
1030
+ /**
1031
+ * Matches the old StyleResult interface for backward compatibility
1032
+ */
1033
+ interface StyleResult {
1034
+ selector: string;
1035
+ declarations: string;
1036
+ atRules?: string[];
1037
+ needsClassName?: boolean;
1038
+ rootPrefix?: string;
1039
+ /** When true, declarations are wrapped in @starting-style { ... } inside the selector rule */
1040
+ startingStyle?: boolean;
1041
+ }
1042
+ /**
1043
+ * Matches the old RenderResult interface for backward compatibility
1044
+ */
1045
+ interface RenderResult {
1046
+ rules: StyleResult[];
1047
+ className?: string;
1024
1048
  }
1025
- /** Index signature for arbitrary style keys (sub-elements, CSS variables, etc.) */
1026
- interface StylesIndexSignature {
1027
- [key: string]: StyleValue<string | number | boolean | undefined> | StyleValueStateMap<string | number | boolean | undefined> | Styles | false | StylesInterface['@keyframes'] | StylesInterface['@properties'] | StylesInterface['@fontFace'] | StylesInterface['@counterStyle'];
1049
+ /**
1050
+ * Options for renderStyles when using direct selector mode.
1051
+ */
1052
+ interface RenderStylesOptions {
1028
1053
  /**
1029
- * Selector combinator: `undefined` (descendant, default), `'>'` (child), `'+'` (adjacent), `'~'` (sibling).
1030
- * Can chain with capitalized names: `'> Body > Row >'`. Spaces required around combinators.
1054
+ * Whether to double the class selector for increased specificity.
1055
+ * When true, `.myClass` becomes `.myClass.myClass` for higher specificity.
1056
+ *
1057
+ * @default false - User-provided selectors are not doubled.
1058
+ *
1059
+ * Note: This only applies when a classNameOrSelector is provided.
1060
+ * When renderStyles returns RenderResult with needsClassName=true,
1061
+ * the injector handles doubling automatically.
1031
1062
  */
1032
- $?: string;
1063
+ doubleSelector?: boolean;
1033
1064
  }
1034
- type Styles = StylesWithoutSelectors & SpecialStyleProperties & StylesIndexSignature;
1035
1065
  /**
1036
- * Value type for design tokens passed to `configure({ tokens })`.
1037
- * Can be a direct value or a state map for responsive/theme-aware tokens.
1038
- */
1039
- type ConfigTokenValue = string | number | boolean | Record<string, string | number | boolean | undefined | null | '@inherit'>;
1040
- /**
1041
- * Design tokens injected as CSS custom properties on `:root`.
1042
- * Keys must start with `$` (value tokens) or `#` (color tokens).
1066
+ * Render styles to CSS rules.
1043
1067
  *
1044
- * - `$name` keys become `--name` CSS custom properties
1045
- * - `#name` keys become `--name-color` and `--name-color-{colorSpace}` properties
1068
+ * When called without classNameOrSelector, returns RenderResult with needsClassName=true.
1069
+ * When called with a selector/className string, returns StyleResult[] for direct injection.
1046
1070
  */
1047
- type ConfigTokens = Record<`$${string}` | `#${string}`, ConfigTokenValue>;
1071
+ declare function renderStyles(styles?: Styles, classNameOrSelector?: undefined, options?: undefined, pipelineCacheKey?: string): RenderResult;
1072
+ declare function renderStyles(styles: Styles | undefined, classNameOrSelector: string, options?: RenderStylesOptions): StyleResult[];
1048
1073
  //#endregion
1049
- //#region src/pipeline/conditions.d.ts
1074
+ //#region src/properties/property-type-resolver.d.ts
1050
1075
  /**
1051
- * ConditionNode Types and Helpers
1076
+ * PropertyTypeResolver
1052
1077
  *
1053
- * Core data structures for representing style conditions as an abstract syntax tree.
1054
- * Used throughout the pipeline for parsing, simplification, and CSS generation.
1055
- */
1056
- /**
1057
- * Base interface for all state conditions (leaf nodes)
1078
+ * Automatically infers CSS @property types from custom property values.
1079
+ * Supports deferred resolution for var() reference chains of arbitrary depth.
1058
1080
  */
1059
- interface BaseStateCondition {
1060
- kind: 'state';
1061
- negated: boolean;
1062
- raw: string;
1063
- uniqueId: string;
1081
+ declare class PropertyTypeResolver {
1082
+ /** propName → the prop it depends on */
1083
+ private pendingDeps;
1084
+ /** propName → list of props waiting on it */
1085
+ private reverseDeps;
1086
+ /**
1087
+ * Scan CSS declarations and auto-register @property for custom properties
1088
+ * whose types can be inferred from their values.
1089
+ */
1090
+ scanDeclarations(declarations: string, isPropertyDefined: (name: string) => boolean, registerProperty: (name: string, syntax: string, initialValue: string) => void): void;
1091
+ private addDependency;
1092
+ private resolve;
1093
+ private isComplexValue;
1064
1094
  }
1095
+ //#endregion
1096
+ //#region src/injector/batch.d.ts
1065
1097
  /**
1066
- * Modifier condition: [data-attr] or [data-attr="value"]
1098
+ * Deferred CSSOM writes ("batched injection").
1099
+ *
1100
+ * Every `insertRule()` on a live stylesheet invalidates style for the sheet's
1101
+ * scope, so Blink recalculates style the next time anything reads layout or
1102
+ * computed style. When components inject during React's render phase and other
1103
+ * components read layout in the same pass, the two interleave:
1104
+ *
1105
+ * inject -> read (forced recalc) -> inject -> read (forced recalc) -> ...
1106
+ *
1107
+ * Batching moves every sheet write out from between those reads. Writes are
1108
+ * queued in FIFO order and drained in one go, so the tree is invalidated once
1109
+ * per flush instead of once per component.
1110
+ *
1111
+ * ## Ordering
1112
+ *
1113
+ * A single queue holds *all* writes — component rules, global rules, keyframes,
1114
+ * `@property`, `@font-face`, `@counter-style`, `@function` and raw CSS. Draining
1115
+ * it in insertion order keeps the sheet byte-identical to unbatched output,
1116
+ * which matters because equal-specificity rules resolve by document order.
1117
+ *
1118
+ * ## Batch windows — why queuing is safe
1119
+ *
1120
+ * Deferring a write past React's layout phase would let a `useLayoutEffect`
1121
+ * measure an element whose rules are not in the sheet yet, reading the unstyled
1122
+ * box. `<TastyBatchProvider>` closes that hole by opening a *window* during its
1123
+ * render and closing it — flushing — in its `useInsertionEffect`, which React
1124
+ * runs in the mutation phase, before any layout effect:
1125
+ *
1126
+ * provider renders -> window OPEN
1127
+ * children render -> injections queued
1128
+ * provider insertionEffect -> FLUSH, window CLOSED
1129
+ * layout effects run -> rules are in the sheet
1130
+ *
1131
+ * So in the default (`batchInjection: true`) mode a write is only ever queued
1132
+ * inside a commit whose flush is already guaranteed by that same commit. Every
1133
+ * injection outside a window — a deep update the provider did not re-render
1134
+ * for, a `useLayoutEffect` that injects, an event handler, an async callback —
1135
+ * is written straight through, exactly as with batching off.
1136
+ *
1137
+ * `batchInjection: 'always'` opts out of the gate and queues unconditionally.
1138
+ * That wins on more commits, at the cost of the measurement hazard above.
1139
+ *
1140
+ * ## Flush points (earliest wins)
1141
+ *
1142
+ * 1. `<TastyBatchProvider>`'s `useInsertionEffect` — closes the window.
1143
+ * 2. A microtask — a backstop for a render that was aborted or suspended and
1144
+ * therefore never reached its insertion effect. An aborted render mounts
1145
+ * nothing, so nothing can measure what it queued. Microtasks also always
1146
+ * drain before paint, so styles are never visually missing.
1147
+ * 3. `flushStyles()` — explicit, and called internally by every injector read
1148
+ * API (`getCSSText`, `cleanup`, `gc`, `destroy`, ...).
1067
1149
  */
1068
- interface ModifierCondition extends BaseStateCondition {
1069
- type: 'modifier';
1070
- attribute: string;
1071
- value?: string;
1072
- operator?: '=' | '^=' | '$=' | '*=';
1150
+ interface QueuedWrite {
1151
+ /** Perform the deferred sheet write. */
1152
+ run: () => void;
1153
+ /** Set when the owner disposed before the write happened. */
1154
+ cancelled: boolean;
1155
+ /** Set once the write has been applied (or skipped as cancelled). */
1156
+ done: boolean;
1073
1157
  }
1158
+ /** Whether any write is still waiting to hit a stylesheet. */
1159
+ declare function hasPendingStyleWrites(): boolean;
1074
1160
  /**
1075
- * Pseudo-class condition: :hover, :focus-visible
1161
+ * Drain every pending sheet write, in insertion order.
1162
+ *
1163
+ * Safe to call when the queue is empty (the common case, so the guard comes
1164
+ * first) and safe to call re-entrantly: a nested `flushStyles()` is a no-op,
1165
+ * and work a draining write triggers is written in place by
1166
+ * `enqueueStyleWrite` rather than queued behind the rest of the batch.
1076
1167
  */
1077
- interface PseudoCondition extends BaseStateCondition {
1078
- type: 'pseudo';
1079
- pseudo: string;
1080
- }
1168
+ declare function flushStyles(): void;
1081
1169
  /**
1082
- * Numeric bound for dimension queries
1170
+ * Drop every pending write without applying it. Test helper — production code
1171
+ * should call `flushStyles()` instead.
1083
1172
  */
1084
- interface NumericBound {
1085
- value: string;
1086
- valueNumeric: number | null;
1087
- inclusive: boolean;
1173
+ declare function resetStyleBatch(): void;
1174
+ //#endregion
1175
+ //#region src/injector/types.d.ts
1176
+ declare global {
1177
+ interface Window {
1178
+ __TASTY__?: string[];
1179
+ }
1088
1180
  }
1089
- /**
1090
- * Media query condition
1091
- */
1092
- interface MediaCondition extends BaseStateCondition {
1093
- type: 'media';
1094
- subtype: 'dimension' | 'feature' | 'type';
1095
- dimension?: 'width' | 'height' | 'inline-size' | 'block-size';
1096
- lowerBound?: NumericBound;
1097
- upperBound?: NumericBound;
1098
- feature?: string;
1099
- featureValue?: string;
1100
- mediaType?: 'print' | 'screen' | 'all' | 'speech';
1181
+ interface InjectResult {
1182
+ className: string;
1183
+ dispose: () => void;
1101
1184
  }
1102
- /**
1103
- * Container query condition
1104
- */
1105
- interface ContainerCondition extends BaseStateCondition {
1106
- type: 'container';
1107
- subtype: 'dimension' | 'style' | 'raw';
1108
- containerName?: string;
1109
- dimension?: 'width' | 'height' | 'inline-size' | 'block-size';
1110
- lowerBound?: NumericBound;
1111
- upperBound?: NumericBound;
1112
- property?: string;
1113
- propertyValue?: string;
1114
- rawCondition?: string;
1185
+ interface GlobalInjectResult {
1186
+ dispose: () => void;
1187
+ }
1188
+ type DisposeFunction = () => void;
1189
+ interface StyleInjectorConfig {
1190
+ nonce?: string;
1191
+ maxRulesPerSheet?: number;
1192
+ forceTextInjection?: boolean;
1193
+ /** Enable development mode features: performance metrics and debug information storage */
1194
+ devMode?: boolean;
1195
+ /**
1196
+ * Global predefined states for advanced state mapping.
1197
+ * These are state aliases that can be used in any component.
1198
+ * Example: { '@mobile': '@media(w < 920px)', '@dark': '@root(theme=dark)' }
1199
+ */
1200
+ states?: Record<string, string>;
1201
+ /**
1202
+ * Automatically infer and register CSS @property declarations
1203
+ * from custom property values. When false, only explicit @property are used.
1204
+ * @default true
1205
+ */
1206
+ autoPropertyTypes?: boolean;
1207
+ /** Garbage collection configuration for unused styles */
1208
+ gc?: GCConfig;
1209
+ /**
1210
+ * Prefix prepended to every generated identifier.
1211
+ * Mirrors the `namePrefix` field on the public `TastyConfig` so that
1212
+ * standalone injector consumers can configure it directly.
1213
+ * @default 't'
1214
+ */
1215
+ namePrefix?: string;
1216
+ /**
1217
+ * Defer stylesheet writes and apply them in one batch instead of one
1218
+ * `insertRule()` per component. Mirrors `batchInjection` on the public
1219
+ * `TastyConfig`.
1220
+ * @default false
1221
+ */
1222
+ batchInjection?: boolean | 'always';
1115
1223
  }
1116
1224
  /**
1117
- * Root state condition: @root(theme=dark)
1225
+ * Per-className usage tracking for GC.
1118
1226
  */
1119
- interface RootCondition extends BaseStateCondition {
1120
- type: 'root';
1121
- innerCondition: ConditionNode;
1122
- }
1123
1227
  /**
1124
- * Parent state condition: @parent(hovered), @parent(theme=dark, >)
1228
+ * @deprecated Nothing reads this any more. Collection asks the DOM what is
1229
+ * rendered rather than tracking usage per class, so there is no usage record
1230
+ * to describe. Kept so existing imports keep type-checking.
1125
1231
  */
1126
- interface ParentCondition extends BaseStateCondition {
1127
- type: 'parent';
1128
- innerCondition: ConditionNode;
1129
- direct: boolean;
1232
+ interface StyleUsage {
1233
+ lastTouchedAt: number;
1130
1234
  }
1131
1235
  /**
1132
- * Own state condition: @own(hovered)
1236
+ * Configuration for the style garbage collector.
1237
+ *
1238
+ * GC is triggered by touch count rather than timers: every `touchInterval`
1239
+ * touches, an idle callback is scheduled to evict unused styles above
1240
+ * `capacity`, oldest first.
1133
1241
  */
1134
- interface OwnCondition extends BaseStateCondition {
1135
- type: 'own';
1136
- innerCondition: ConditionNode;
1242
+ interface GCConfig {
1243
+ /**
1244
+ * How long a class is left alone after collection first notices nothing is
1245
+ * carrying it, in milliseconds (default 10,000).
1246
+ *
1247
+ * Rendering is not commit-aware: a render can resolve a class and commit it a
1248
+ * little later, and in between nothing on the page carries it. Rather than
1249
+ * try to tell that apart from a class that is finished — which cannot be done
1250
+ * from outside React — collection simply does not touch anything that was in
1251
+ * use recently. A render would have to stay pending for the whole window to
1252
+ * lose its rules, and it gets them back on its next render.
1253
+ */
1254
+ grace?: number;
1255
+ /**
1256
+ * Number of touch events between automatic GC cycles.
1257
+ * @default 1000
1258
+ */
1259
+ touchInterval?: number;
1260
+ /**
1261
+ * Maximum number of unused styles to retain.
1262
+ * GC evicts the oldest unused styles when this limit is exceeded.
1263
+ * Pinned styles and DOM-live styles
1264
+ * do not count against this limit.
1265
+ * @default 1000
1266
+ */
1267
+ capacity?: number;
1137
1268
  }
1138
1269
  /**
1139
- * Starting style condition: @starting
1270
+ * Per-call options for inject().
1140
1271
  */
1141
- interface StartingCondition extends BaseStateCondition {
1142
- type: 'starting';
1272
+ interface InjectOptions {
1273
+ root?: Document | ShadowRoot;
1274
+ /** Reuse the class already injected for this key instead of writing again. */
1275
+ cacheKey?: string;
1276
+ /**
1277
+ * Pin the injected class (default `true`). A pinned class is never evicted by
1278
+ * `gc()`, and the returned `dispose()` releases the pin. Pass `false` when the
1279
+ * caller keeps no handle and the DOM is the only record that the class is in
1280
+ * use — the render path does this, because a hook-free render has no unmount
1281
+ * signal to dispose on.
1282
+ */
1283
+ pin?: boolean;
1143
1284
  }
1144
1285
  /**
1145
- * Supports query condition: @supports(display: grid), @supports($, :has(*))
1286
+ * Per-call options for gc().
1146
1287
  */
1147
- interface SupportsCondition extends BaseStateCondition {
1148
- type: 'supports';
1149
- subtype: 'feature' | 'selector';
1150
- condition: string;
1288
+ interface GCOptions {
1289
+ root?: Document | ShadowRoot;
1290
+ /** Bypass capacity threshold and remove ALL unused styles. */
1291
+ force?: boolean;
1292
+ }
1293
+ interface RuleInfo {
1294
+ className: string;
1295
+ ruleIndex: number;
1296
+ sheetIndex: number;
1297
+ /** Dev-only: full CSS texts inserted for this class; omitted in production */
1298
+ cssText?: string[];
1299
+ /** Inclusive end index of the contiguous block of inserted rules for this className */
1300
+ endRuleIndex?: number;
1301
+ /** NEW: exact indices of all inserted rules for this className */
1302
+ indices?: number[];
1303
+ }
1304
+ type InjectionMode = 'style-element' | 'adopted';
1305
+ interface SheetInfo {
1306
+ /** HTMLStyleElement used in style-element mode; null in adopted mode. */
1307
+ sheet: HTMLStyleElement | null;
1308
+ /** Constructable CSSStyleSheet used in adopted mode (ShadowRoot targets) */
1309
+ constructableSheet?: CSSStyleSheet;
1310
+ ruleCount: number;
1311
+ holes: number[];
1312
+ /**
1313
+ * True when this sheet is written through `textContent` instead of CSSOM.
1314
+ * Decided once at sheet creation so a sheet is never half CSSOM / half text.
1315
+ */
1316
+ textMode?: boolean;
1317
+ /**
1318
+ * Inserted rule texts in rule-index order. Maintained only in text mode —
1319
+ * it is what makes deletion possible there, since `textContent` cannot be
1320
+ * edited rule-by-rule and has to be rebuilt.
1321
+ */
1322
+ textRules?: string[];
1323
+ }
1324
+ interface CleanupStats {
1325
+ timestamp: number;
1326
+ classesDeleted: number;
1327
+ cssSize: number;
1328
+ rulesDeleted: number;
1329
+ }
1330
+ interface CacheMetrics {
1331
+ hits: number;
1332
+ misses: number;
1333
+ bulkCleanups: number;
1334
+ totalInsertions: number;
1335
+ totalUnused: number;
1336
+ stylesCleanedUp: number;
1337
+ cleanupHistory: CleanupStats[];
1338
+ startTime: number;
1339
+ unusedHits?: number;
1151
1340
  }
1152
- /**
1153
- * Union of all state condition types
1154
- */
1155
- type StateCondition = ModifierCondition | PseudoCondition | MediaCondition | ContainerCondition | RootCondition | ParentCondition | OwnCondition | StartingCondition | SupportsCondition;
1156
- /**
1157
- * Compound node: combines conditions with AND/OR
1158
- */
1159
- interface CompoundCondition {
1160
- kind: 'compound';
1161
- operator: 'AND' | 'OR';
1162
- children: ConditionNode[];
1341
+ interface RootRegistry {
1342
+ sheets: SheetInfo[];
1343
+ /** className -> outstanding `inject()` references; 0 means nobody holds a handle */
1344
+ pinCounts: Map<string, number>;
1345
+ rules: Map<string, RuleInfo>;
1346
+ /** Cache key to className mapping to avoid dual storage of RuleInfo objects */
1347
+ cacheKeyToClassName: Map<string, string>;
1348
+ /** Deduplication set of fully materialized CSS rules inserted into sheets */
1349
+ ruleTextSet: Set<string>;
1350
+ /** Performance metrics (optional) */
1351
+ metrics?: CacheMetrics;
1352
+ /** Keyframes cache by content hash -> entry */
1353
+ keyframesCache: Map<string, KeyframesCacheEntry>;
1354
+ /** Keyframes name to content hash mapping for collision detection */
1355
+ keyframesNameToContent: Map<string, string>;
1356
+ /** Counter for generating keyframes names like k0, k1, k2... */
1357
+ keyframesCounter: number;
1358
+ /** Map of injected @property names to their normalized declarations for tracking */
1359
+ injectedProperties: Map<string, string>;
1360
+ /** Content hashes of injected @font-face rules for deduplication */
1361
+ injectedFontFaces: Set<string>;
1362
+ /**
1363
+ * Injected @counter-style rules. Maps the name to whether it was injected
1364
+ * "strong" (`true`, the default — overrides) or "weak" (`false`, global
1365
+ * `configure()` definitions that never clobber an existing rule).
1366
+ */
1367
+ injectedCounterStyles: Map<string, boolean>;
1368
+ /**
1369
+ * Injected @function rules. Maps the CSS function name to whether it was
1370
+ * injected "strong" (`true`, the default — overrides) or "weak" (`false`,
1371
+ * global `configure()` definitions that never clobber an existing rule).
1372
+ */
1373
+ injectedFunctions: Map<string, boolean>;
1374
+ /** Global rules tracking for index adjustment */
1375
+ globalRules: Map<string, RuleInfo>;
1376
+ /** Resolver for auto-inferring @property types from declaration values */
1377
+ propertyTypeResolver: PropertyTypeResolver;
1378
+ /**
1379
+ * className -> when the class was first noticed to be carrying nothing:
1380
+ * injection, or the first sweep that looked and did not find it on an
1381
+ * element. Cleared the moment a sweep finds it rendered again.
1382
+ *
1383
+ * Deliberately "when it was noticed", not "when it stopped being rendered".
1384
+ * Nothing observes the moment an element leaves, so a class that unmounted
1385
+ * just before a sweep and one that unmounted just after the previous sweep
1386
+ * would otherwise be treated differently — and the first would lose its
1387
+ * grace window entirely. Starting the clock at the sighting gives every
1388
+ * class the same full window, whenever it actually went.
1389
+ *
1390
+ * Written only by the sweep's own DOM scan and at injection, so rendering
1391
+ * never pays for it.
1392
+ */
1393
+ unusedSince: Map<string, number>;
1394
+ /**
1395
+ * Local `@keyframes` a class animates, by the name they were authored under.
1396
+ *
1397
+ * One reference is held per distinct set of steps, however many renders ask
1398
+ * for it, and the classes that animate it own that reference between them.
1399
+ * The last of them to be deleted releases it, so keyframes cannot outlive
1400
+ * every rule that referred to them, and repeat renders cannot pile up
1401
+ * references nobody gives back.
1402
+ */
1403
+ localKeyframes: Map<string, {
1404
+ name: string;
1405
+ dispose: () => void;
1406
+ owners: Set<string>;
1407
+ }>;
1408
+ /** Renders since the last scheduled sweep (per-root) */
1409
+ touchCount: number;
1410
+ /** How many entries from `window.__TASTY__` have been synced into this registry */
1411
+ serverClassSyncIndex: number;
1412
+ /** Whether `<style data-tasty-rsc>` tags have been scanned for class names */
1413
+ rscStylesScanned: boolean;
1414
+ /** Whether this root uses adoptedStyleSheets or <style> elements */
1415
+ injectionMode: InjectionMode;
1416
+ /**
1417
+ * Lazy feature-test for `@property` support, cached per registry.
1418
+ * - `undefined`: not yet probed.
1419
+ * - `true`: engine supports `@property`; rejections indicate user-authored
1420
+ * invalid rules and should warn.
1421
+ * - `false`: engine doesn't support `@property` (e.g., jsdom); rejections
1422
+ * are expected and warnings are suppressed.
1423
+ */
1424
+ atPropertySupported?: boolean;
1163
1425
  }
1164
- /**
1165
- * True condition (matches everything)
1166
- */
1167
- interface TrueCondition {
1168
- kind: 'true';
1426
+ type StyleRule = StyleResult;
1427
+ interface KeyframesInfo {
1428
+ name: string;
1429
+ sheetIndex: number;
1430
+ ruleIndex: number;
1431
+ /** Dev-only: full CSS text of the @keyframes rule; omitted in production */
1432
+ cssText?: string;
1169
1433
  }
1170
- /**
1171
- * False condition (matches nothing - skip this rule)
1172
- */
1173
- interface FalseCondition {
1174
- kind: 'false';
1434
+ type KeyframeStep = string | Record<string, string | number>;
1435
+ type KeyframesSteps = Record<string, KeyframeStep>;
1436
+ interface KeyframesResult {
1437
+ toString(): string;
1438
+ dispose: () => void;
1175
1439
  }
1176
- /**
1177
- * Union of all condition node types
1178
- */
1179
- type ConditionNode = StateCondition | CompoundCondition | TrueCondition | FalseCondition;
1180
- //#endregion
1181
- //#region src/states/index.d.ts
1182
- /**
1183
- * Parsed advanced state information
1184
- */
1185
- interface ParsedAdvancedState {
1186
- type: 'media' | 'container' | 'root' | 'parent' | 'own' | 'starting' | 'predefined' | 'modifier';
1187
- condition: string;
1188
- containerName?: string;
1189
- raw: string;
1190
- mediaType?: string;
1440
+ interface KeyframesCacheEntry {
1441
+ name: string;
1442
+ refCount: number;
1443
+ info: KeyframesInfo;
1444
+ /**
1445
+ * Queued sheet write, when `batchInjection` deferred the insertion. Present
1446
+ * only between `keyframes()` and the flush; disposing in that window cancels
1447
+ * the write instead of deleting a rule that was never inserted.
1448
+ */
1449
+ pending?: QueuedWrite;
1191
1450
  }
1192
1451
  /**
1193
- * Context for state parsing operations
1452
+ * Definition for a CSS @property at-rule.
1453
+ * Used to define custom property syntax, inheritance, and initial value.
1194
1454
  */
1195
- interface StateParserContext {
1196
- localPredefinedStates: Record<string, string>;
1197
- globalPredefinedStates: Record<string, string>;
1198
- isSubElement?: boolean;
1455
+ interface PropertyDefinition {
1456
+ /** CSS syntax string (e.g., '<color>', '<angle>', '<number>') */
1457
+ syntax?: string;
1458
+ /** Whether the property inherits (default: true) */
1459
+ inherits?: boolean;
1460
+ /** Initial value for the property */
1461
+ initialValue?: string | number;
1199
1462
  }
1200
1463
  /**
1201
- * At-rule context for CSS generation
1464
+ * Options for registering a CSS `@property`.
1465
+ * Extends {@link PropertyDefinition} with an optional injection root.
1202
1466
  */
1203
- interface AtRuleContext {
1204
- media?: string[];
1205
- container?: {
1206
- name?: string;
1207
- condition: string;
1208
- }[];
1209
- startingStyle?: boolean;
1210
- rootStates?: string[];
1211
- negatedRootStates?: string[];
1467
+ interface PropertyOptions extends PropertyDefinition {
1468
+ /** Shadow root or document to inject into */
1469
+ root?: Document | ShadowRoot;
1212
1470
  }
1213
1471
  /**
1214
- * Configure global predefined states
1215
- */
1216
- declare function setGlobalPredefinedStates(states: Record<string, string>): void;
1217
- /**
1218
- * Get global predefined states
1472
+ * A single parameter for a CSS @function at-rule.
1473
+ *
1474
+ * - `true` — a bare parameter with no type or default.
1475
+ * - `string` — a CSS type shorthand (e.g. `'<length>'`, `'<color>'`).
1476
+ * - object — full form with optional `syntax` (type) and `default` value.
1219
1477
  */
1220
- declare function getGlobalPredefinedStates(): Record<string, string>;
1478
+ type FunctionParameter = true | string | {
1479
+ syntax?: string;
1480
+ default?: string | number;
1481
+ };
1221
1482
  /**
1222
- * Create a state parser context from styles
1483
+ * Definition for a CSS @function at-rule (custom function).
1484
+ *
1485
+ * The descriptor body reads like a mini styles object: any `$name` key declares
1486
+ * a local variable (`--name`) whose value is parsed through the Tasty DSL.
1487
+ * `result` is the only required field.
1488
+ *
1489
+ * @example
1490
+ * ```ts
1491
+ * // @function --negative(--value) { result: calc(-1 * var(--value)); }
1492
+ * { args: ['$value'], result: '(-1 * $value)' }
1493
+ * ```
1223
1494
  */
1224
- declare function createStateParserContext(styles?: Styles, isSubElement?: boolean): StateParserContext;
1225
- //#endregion
1226
- //#region src/pipeline/parseStateKey.d.ts
1227
- interface ParseStateKeyOptions {
1228
- context?: StateParserContext;
1229
- isSubElement?: boolean;
1495
+ interface FunctionDefinition {
1496
+ /**
1497
+ * Ordered parameters. Array form lists bare parameter names (`['$value']`);
1498
+ * object form maps each parameter name to its type/default.
1499
+ */
1500
+ args?: string[] | Record<string, FunctionParameter>;
1501
+ /** Optional return type, e.g. `'<color>'`. */
1502
+ returns?: string;
1503
+ /** The `result:` descriptor value (parsed through the Tasty DSL). Required. */
1504
+ result: string;
1505
+ /** Local variables: any `$name` key declares `--name` in the body. */
1506
+ [localVar: `$${string}`]: string | number | undefined;
1230
1507
  }
1231
1508
  /**
1232
- * Parse a state key string into a ConditionNode
1233
- */
1234
- declare function parseStateKey(stateKey: string, options?: ParseStateKeyOptions): ConditionNode;
1235
- //#endregion
1236
- //#region src/pipeline/index.d.ts
1237
- /**
1238
- * Matches the old StyleResult interface for backward compatibility
1509
+ * Descriptors for a CSS @font-face at-rule.
1239
1510
  */
1240
- interface StyleResult {
1241
- selector: string;
1242
- declarations: string;
1243
- atRules?: string[];
1244
- needsClassName?: boolean;
1245
- rootPrefix?: string;
1246
- /** When true, declarations are wrapped in @starting-style { ... } inside the selector rule */
1247
- startingStyle?: boolean;
1511
+ interface FontFaceDescriptors {
1512
+ /** Required. URL(s) to the font file(s). */
1513
+ src: string;
1514
+ /** Font weight or range. Default: 'normal'. */
1515
+ fontWeight?: string | number;
1516
+ /** Font style. Default: 'normal'. */
1517
+ fontStyle?: 'normal' | 'italic' | 'oblique' | (string & {});
1518
+ /** Font stretch. Default: 'normal'. */
1519
+ fontStretch?: string;
1520
+ /** Loading behavior. Default: 'auto'. */
1521
+ fontDisplay?: 'auto' | 'block' | 'swap' | 'fallback' | 'optional';
1522
+ /** Unicode range to cover. */
1523
+ unicodeRange?: string;
1524
+ /** Ascent metric override. */
1525
+ ascentOverride?: string;
1526
+ /** Descent metric override. */
1527
+ descentOverride?: string;
1528
+ /** Line gap metric override. */
1529
+ lineGapOverride?: string;
1530
+ /** Size adjustment factor. */
1531
+ sizeAdjust?: string;
1532
+ /** OpenType feature settings. */
1533
+ fontFeatureSettings?: string;
1534
+ /** Font variation axis settings. */
1535
+ fontVariationSettings?: string;
1248
1536
  }
1537
+ /** Single descriptor or array of descriptors for multiple weights/styles. */
1538
+ type FontFaceInput = FontFaceDescriptors | FontFaceDescriptors[];
1249
1539
  /**
1250
- * Matches the old RenderResult interface for backward compatibility
1540
+ * Descriptors for a CSS @counter-style at-rule.
1251
1541
  */
1252
- interface RenderResult {
1253
- rules: StyleResult[];
1254
- className?: string;
1542
+ interface CounterStyleDescriptors {
1543
+ /** Required. Numbering algorithm. */
1544
+ system: 'cyclic' | 'numeric' | 'alphabetic' | 'symbolic' | 'additive' | 'fixed' | (string & {});
1545
+ /** Symbols for non-additive systems. */
1546
+ symbols?: string;
1547
+ /** Symbol-value pairs for additive system. */
1548
+ additiveSymbols?: string;
1549
+ /** String prepended to the marker. Default: "". */
1550
+ prefix?: string;
1551
+ /** String appended to the marker. Default: ". ". */
1552
+ suffix?: string;
1553
+ /** Negative-value wrapping (e.g., '"(" ")"'). */
1554
+ negative?: string;
1555
+ /** Counter range (e.g., 'infinite infinite'). */
1556
+ range?: string;
1557
+ /** Minimum marker width and pad symbol (e.g., '3 "0"'). */
1558
+ pad?: string;
1559
+ /** Fallback counter style name. */
1560
+ fallback?: string;
1561
+ /** Speech synthesis hint. */
1562
+ speakAs?: string;
1255
1563
  }
1256
- /**
1257
- * Check if a key is a CSS selector
1258
- */
1259
- declare function isSelector(key: string): boolean;
1260
- /**
1261
- * Options for renderStyles when using direct selector mode.
1262
- */
1263
- interface RenderStylesOptions {
1264
- /**
1265
- * Whether to double the class selector for increased specificity.
1266
- * When true, `.myClass` becomes `.myClass.myClass` for higher specificity.
1267
- *
1268
- * @default false - User-provided selectors are not doubled.
1269
- *
1270
- * Note: This only applies when a classNameOrSelector is provided.
1271
- * When renderStyles returns RenderResult with needsClassName=true,
1272
- * the injector handles doubling automatically.
1273
- */
1274
- doubleSelector?: boolean;
1564
+ interface RawCSSResult {
1565
+ dispose: () => void;
1275
1566
  }
1276
- /**
1277
- * Render styles to CSS rules.
1278
- *
1279
- * When called without classNameOrSelector, returns RenderResult with needsClassName=true.
1280
- * When called with a selector/className string, returns StyleResult[] for direct injection.
1281
- */
1282
- declare function renderStyles(styles?: Styles, classNameOrSelector?: undefined, options?: undefined, pipelineCacheKey?: string): RenderResult;
1283
- declare function renderStyles(styles: Styles | undefined, classNameOrSelector: string, options?: RenderStylesOptions): StyleResult[];
1284
1567
  //#endregion
1285
- export { strToRgb as $, RawStyleHandler as A, getGlobalFuncs as B, SuffixForSelector as C, RawCSSResult as Ct, CUSTOM_UNITS as D, StyleInjectorConfig as Dt, CSSMap as E, SheetInfo as Et, StylePropValue as F, parseStyle as G, getGlobalPredefinedTokens as H, StyleValue as I, stringifyStyles as J, resetGlobalPredefinedTokens as K, StyleValueStateMap as L, StyleHandlerDefinition as M, StyleHandlerResult as N, DIRECTIONS as O, StyleRule as Ot, StyleMap as P, hslToRgbValues as Q, customFunc as R, StylesWithoutSelectors as S, PropertyDefinition as St, TastyPresetNames as T, RuleInfo as Tt, normalizeColorTokenValue as U, getGlobalParser as V, parseColor as W, getRgbValuesFromRgbaString as X, getNamedColorHex as Y, hexToRgb as Z, NotSelector as _, InjectionMode as _t, ParseStateKeyOptions as a, StyleDetailsPart as at, Styles as b, KeyframesResult as bt, ParsedAdvancedState as c, CacheMetrics as ct, getGlobalPredefinedStates as d, FontFaceDescriptors as dt, StyleParser as et, setGlobalPredefinedStates as f, FontFaceInput as ft, NoType as g, InjectResult as gt, ConfigTokens as h, GlobalInjectResult as ht, renderStyles as i, StyleDetails as it, StyleHandler as j, ParsedColor as k, StyleUsage as kt, StateParserContext as l, CounterStyleDescriptors as lt, ConfigTokenValue as m, GCOptions as mt, StyleResult as n, ParserOptions as nt, parseStateKey as o, UnitHandler as ot, ConditionNode as p, GCConfig as pt, setGlobalPredefinedTokens as q, isSelector as r, ProcessedStyle as rt, AtRuleContext as s, CSSProperties as st, RenderResult as t, Bucket as tt, createStateParserContext as u, DisposeFunction as ut, RecipeStyles as v, KeyframesCacheEntry as vt, TastyNamedColors as w, RootRegistry as wt, StylesInterface as x, KeyframesSteps as xt, Selector as y, KeyframesInfo as yt, filterMods as z };
1286
- //# sourceMappingURL=index-tcHuMPFt.d.ts.map
1568
+ export { TastyNamedColors as $, resetStyleBatch as A, getGlobalPredefinedStates as B, SheetInfo as C, StyleParser as Ct, QueuedWrite as D, StyleDetailsPart as Dt, StyleUsage as E, StyleDetails as Et, parseStateKey as F, NoType as G, ConditionNode as H, AtRuleContext as I, Selector as J, NotSelector as K, ParsedAdvancedState as L, StyleResult as M, renderStyles as N, flushStyles as O, UnitHandler as Ot, ParseStateKeyOptions as P, SuffixForSelector as Q, StateParserContext as R, RuleInfo as S, stringifyStyles as St, StyleRule as T, ProcessedStyle as Tt, ConfigTokenValue as U, setGlobalPredefinedStates as V, ConfigTokens as W, StylesInterface as X, Styles as Y, StylesWithoutSelectors as Z, KeyframesSteps as _, getGlobalParser as _t, FontFaceInput as a, ParsedColor as at, RawCSSResult as b, parseColor as bt, GCConfig as c, StyleHandler as ct, InjectOptions as d, StyleHandlerResult as dt, TastyPresetNames as et, InjectResult as f, StyleMap as ft, KeyframesResult as g, filterMods as gt, KeyframesInfo as h, StyleValueStateMap as ht, FontFaceDescriptors as i, DIRECTIONS as it, RenderResult as j, hasPendingStyleWrites as k, CSSProperties as kt, GCOptions as l, StyleHandlerDefinition as lt, KeyframesCacheEntry as m, StyleValue as mt, CounterStyleDescriptors as n, CSSMap as nt, FunctionDefinition as o, RawStyleHandler as ot, InjectionMode as p, StylePropValue as pt, RecipeStyles as q, DisposeFunction as r, CUSTOM_UNITS as rt, FunctionParameter as s, ResolvedStyleValue as st, CacheMetrics as t, AnyStyleHandler as tt, GlobalInjectResult as u, StyleHandlerProps as ut, PropertyDefinition as v, getGlobalPredefinedTokens as vt, StyleInjectorConfig as w, ParserOptions as wt, RootRegistry as x, parseStyle as xt, PropertyOptions as y, normalizeColorTokenValue as yt, createStateParserContext as z };
1569
+ //# sourceMappingURL=types-CYQIhUg1.d.ts.map