@tenphi/tasty 0.0.0-snapshot.b49e579 → 0.0.0-snapshot.b4e384c

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 (129) hide show
  1. package/README.md +436 -394
  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-D6fpuCdp.js → chunks/collector-Cb8ah2JF.js} +25 -119
  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-biRwSixM.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-DB4ZVUYy.js → chunks/zero-engine-DcwaCvFs.js} +65 -145
  34. package/dist/chunks/zero-engine-DcwaCvFs.js.map +1 -0
  35. package/dist/{collector-D8o4Wdq-.d.ts → collector-D2OT6I2G.d.ts} +23 -4
  36. package/dist/{config-De8L9NWM.d.ts → config-C4ftFxgI.d.ts} +273 -78
  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-DzGxoeyN.d.ts → index-DxQNRj50.d.ts} +369 -258
  41. package/dist/index.d.ts +5 -5
  42. package/dist/index.js +11 -867
  43. package/dist/{merge-styles-DLm4wdnb.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 +3 -2
  54. package/dist/ssr/astro-middleware-static.js +0 -11
  55. package/dist/ssr/astro-middleware-static.js.map +1 -1
  56. package/dist/ssr/astro-middleware.d.ts +3 -2
  57. package/dist/ssr/astro-middleware.js +0 -12
  58. package/dist/ssr/astro-middleware.js.map +1 -1
  59. package/dist/ssr/astro.d.ts +40 -6
  60. package/dist/ssr/astro.js +157 -93
  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 -25
  65. package/dist/ssr/index.js +5 -5
  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 -8
  71. package/dist/ssr/next.js +29 -43
  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/{index-KUYya3x7.d.ts → types-CYQIhUg1.d.ts} +745 -592
  78. package/dist/zero/babel.d.ts +73 -2
  79. package/dist/zero/babel.js +81 -144
  80. package/dist/zero/babel.js.map +1 -1
  81. package/dist/zero/index.d.ts +63 -8
  82. package/dist/zero/index.js +25 -2
  83. package/dist/zero/index.js.map +1 -0
  84. package/dist/zero/next.d.ts +4 -5
  85. package/dist/zero/next.js +3 -38
  86. package/dist/zero/next.js.map +1 -1
  87. package/docs/README.md +16 -8
  88. package/docs/adoption.md +69 -36
  89. package/docs/ai-agents.md +122 -86
  90. package/docs/comparison.md +77 -47
  91. package/docs/configuration.md +434 -110
  92. package/docs/debug.md +21 -8
  93. package/docs/design-system.md +152 -31
  94. package/docs/dsl.md +503 -222
  95. package/docs/getting-started.md +130 -50
  96. package/docs/injector.md +117 -68
  97. package/docs/methodology.md +81 -50
  98. package/docs/migration-v3.md +52 -52
  99. package/docs/pipeline.md +55 -31
  100. package/docs/plugins.md +59 -75
  101. package/docs/react-api.md +141 -55
  102. package/docs/runtime-benchmarks.md +388 -0
  103. package/docs/ssr.md +285 -101
  104. package/docs/styles.md +178 -35
  105. package/docs/tasty-static.md +286 -135
  106. package/package.json +125 -41
  107. package/dist/async-storage-DKK-wTD4.js +0 -44
  108. package/dist/async-storage-DKK-wTD4.js.map +0 -1
  109. package/dist/babel-R2qT7yLN.d.ts +0 -83
  110. package/dist/collector-D6fpuCdp.js.map +0 -1
  111. package/dist/config-Bxme0Moq.js +0 -12442
  112. package/dist/config-Bxme0Moq.js.map +0 -1
  113. package/dist/context-CA8YKeMn.js +0 -24
  114. package/dist/context-CA8YKeMn.js.map +0 -1
  115. package/dist/core-BR4waa0Q.js +0 -1552
  116. package/dist/core-BR4waa0Q.js.map +0 -1
  117. package/dist/css-writer-DB4ZVUYy.js.map +0 -1
  118. package/dist/format-global-rules-DklyaXv-.js +0 -22
  119. package/dist/format-global-rules-DklyaXv-.js.map +0 -1
  120. package/dist/format-rules-BXSRL8KZ.js +0 -145
  121. package/dist/format-rules-BXSRL8KZ.js.map +0 -1
  122. package/dist/hydrate-D_EWjD6z.js +0 -37
  123. package/dist/hydrate-D_EWjD6z.js.map +0 -1
  124. package/dist/index.js.map +0 -1
  125. package/dist/keyframes-DrUITLCz.js +0 -424
  126. package/dist/keyframes-DrUITLCz.js.map +0 -1
  127. package/dist/merge-styles-biRwSixM.js.map +0 -1
  128. package/dist/resolve-recipes-CBVdPz67.js +0 -144
  129. package/dist/resolve-recipes-CBVdPz67.js.map +0 -1
@@ -1,5 +1,14 @@
1
- import { Dt as SheetInfo, Et as RuleInfo, Ot as StyleInjectorConfig, P as StyleHandlerDefinition, St as PropertyDefinition, Tt as RootRegistry, b as Styles, bt as KeyframesResult, dt as FunctionDefinition, gt as InjectResult, h as ConfigTokens, ht as GlobalInjectResult, it as UnitHandler, kt as StyleRule, lt as FontFaceDescriptors, mt as GCOptions, n as StyleResult, nt as StyleDetails, ot as CacheMetrics, pt as GCConfig, st as CounterStyleDescriptors, ut as FontFaceInput, v as RecipeStyles, wt as RawCSSResult, xt as KeyframesSteps, yt as KeyframesInfo } from "./index-KUYya3x7.js";
2
-
1
+ import { C as SheetInfo, Et as StyleDetails, M as StyleResult, Ot as UnitHandler, S as RuleInfo, T as StyleRule, W as ConfigTokens, Y as Styles, _ as KeyframesSteps, a as FontFaceInput, b as RawCSSResult, c as GCConfig, d as InjectOptions, f as InjectResult, g as KeyframesResult, h as KeyframesInfo, i as FontFaceDescriptors, l as GCOptions, lt as StyleHandlerDefinition, n as CounterStyleDescriptors, o as FunctionDefinition, q as RecipeStyles, t as CacheMetrics, u as GlobalInjectResult, v as PropertyDefinition, w as StyleInjectorConfig, x as RootRegistry } from "./types-CYQIhUg1.js";
2
+ //#region src/config-resources.d.ts
3
+ declare function getGlobalFontFaces(): Record<string, FontFaceInput> | null;
4
+ declare function getGlobalCounterStyles(): Record<string, CounterStyleDescriptors> | null;
5
+ declare function getGlobalFunctions(): Record<string, FunctionDefinition> | null;
6
+ /**
7
+ * Get global keyframes configuration.
8
+ * Returns null if no keyframes configured (fast path for zero-overhead).
9
+ */
10
+ declare function getGlobalKeyframes(): Record<string, KeyframesSteps> | null;
11
+ //#endregion
3
12
  //#region src/prop-handlers.d.ts
4
13
  /**
5
14
  * Props middleware for tasty components.
@@ -105,6 +114,8 @@ declare class SheetManager {
105
114
  * Create a style element and append to document
106
115
  */
107
116
  private createStyleElement;
117
+ /** Append a rule to a text-mode sheet while preserving its index mirror. */
118
+ private appendTextRule;
108
119
  /**
109
120
  * Insert CSS rules as a single block
110
121
  */
@@ -151,19 +162,27 @@ declare class SheetManager {
151
162
  */
152
163
  private engineSupportsAtProperty;
153
164
  /**
154
- * Force cleanup of unused styles
155
- */
156
- forceCleanup(registry: RootRegistry): void;
157
- /**
158
- * Perform bulk cleanup of all unused styles (refCount = 0).
165
+ * Delete the given classes: their rules leave the sheets and every registry
166
+ * entry pointing at them is dropped.
167
+ *
168
+ * Deciding *what* is unused belongs to `StyleInjector.gc()`, which owns the
169
+ * DOM scan and the capacity policy. This only re-checks that each class is
170
+ * still safe to delete, and reports how many were.
171
+ *
172
+ * @returns Number of classes actually deleted.
159
173
  */
160
- private performBulkCleanup;
174
+ deleteClasses(registry: RootRegistry, classNames: Iterable<string>): number;
161
175
  /**
162
176
  * Get total number of rules across all sheets
163
177
  */
164
178
  getTotalRuleCount(registry: RootRegistry): number;
165
179
  /**
166
- * Get CSS text from all sheets (for SSR)
180
+ * The CSS of one managed sheet, or `null` when it holds none this can read —
181
+ * an empty style element, or a sheet the engine refuses to hand over.
182
+ */
183
+ private readSheetCSS;
184
+ /**
185
+ * Get the CSS text of every sheet in `registry`.
167
186
  */
168
187
  getCSSText(registry: RootRegistry): string;
169
188
  /**
@@ -229,6 +248,28 @@ declare class SheetManager {
229
248
  /**
230
249
  * Get the raw CSS content
231
250
  */
251
+ /**
252
+ * The CSS this injector owns in `root`, one entry per sheet, in the order the
253
+ * engine applies them.
254
+ *
255
+ * `getCSSText()` walks the managed sheets only, and raw CSS has its own —
256
+ * which sits before, after, or *between* them depending on how it got there:
257
+ * prepended to `adoptedStyleSheets`, or wherever in `<head>` the first raw
258
+ * injection happened to land, with every managed sheet opened afterwards
259
+ * following it. Reporting a fixed order would describe the opposite winner
260
+ * from the live page whenever two rules of equal specificity meet, so the raw
261
+ * sheet is spliced in at the position the DOM actually gives it.
262
+ */
263
+ getOwnedCSSInOrder(registry: RootRegistry, root: Document | ShadowRoot): string[];
264
+ /**
265
+ * Top-level rules in the raw sheet.
266
+ *
267
+ * Read from the sheet the engine parsed, not from the text: a raw block is
268
+ * one string but any number of rules, and one rule — `@keyframes`, `@media` —
269
+ * can contain any number of blocks, so counting braces answers neither
270
+ * question.
271
+ */
272
+ getRawRuleCount(root: Document | ShadowRoot): number;
232
273
  getRawCSSText(root: Document | ShadowRoot): string;
233
274
  }
234
275
  //#endregion
@@ -237,12 +278,51 @@ declare class StyleInjector {
237
278
  private sheetManager;
238
279
  private config;
239
280
  private globalRuleCounter;
240
- private pendingGCHandle;
281
+ /** Cancels the scheduled sweep, whichever timer scheduled it. */
282
+ private cancelPendingGC;
241
283
  private namePrefix;
242
284
  private classRegex;
243
285
  private rscClassRegex;
286
+ /**
287
+ * Bumped whenever class rules are deleted — by `gc()`, `cleanup()` or
288
+ * `destroy()` — so a cache of class names handed out earlier, such as a
289
+ * `tasty()` factory's, knows they may no longer have rules behind them.
290
+ */
291
+ evictions: number;
244
292
  /** @internal — exposed for debug utilities only */
245
293
  get _sheetManager(): SheetManager;
294
+ /** Register inferable custom properties used by a set of declarations. */
295
+ private inferProperties;
296
+ /**
297
+ * Whether sheet writes should be queued instead of applied immediately.
298
+ *
299
+ * Only ever true on the client: SSR collects CSS as text and the RSC path
300
+ * returns it as strings, so neither has a live sheet to batch writes against.
301
+ *
302
+ * In the default `true` mode a write is only queued inside an open batch
303
+ * window — a commit in which `<TastyBatchProvider>` rendered and will
304
+ * therefore flush in its insertion effect, before any layout effect can
305
+ * measure. Everything else falls through to a synchronous write, so enabling
306
+ * the flag cannot make a `useLayoutEffect` read an unstyled element.
307
+ * `'always'` drops the gate and accepts that trade for wider coverage.
308
+ */
309
+ private get batching();
310
+ /**
311
+ * Apply a sheet write now, or queue it when batching is on.
312
+ * Returns the queue handle when deferred, so the caller can cancel it if it
313
+ * disposes before the flush.
314
+ */
315
+ private writeSheet;
316
+ /**
317
+ * Insert a global (non-class) rule, honouring batching.
318
+ *
319
+ * `onApplied` records the caller's dedupe bookkeeping. When the write is
320
+ * queued it runs eagerly, so a repeat call before the flush bails out instead
321
+ * of queueing the same rule twice — the same reasoning as
322
+ * `insertPropertyRule`'s eager marking. When written synchronously it runs
323
+ * only on success, preserving the existing retry-on-failure behaviour.
324
+ */
325
+ private writeGlobalRule;
246
326
  constructor(config?: StyleInjectorConfig);
247
327
  /**
248
328
  * Generate a deterministic class name from a cache key using content hash.
@@ -265,13 +345,15 @@ declare class StyleInjector {
265
345
  className: string;
266
346
  isNewAllocation: boolean;
267
347
  };
348
+ /**
349
+ * Hand a class that is already injected — or queued for a batched write — to
350
+ * another caller: record the reference, write nothing.
351
+ */
352
+ private reuseInjected;
268
353
  /**
269
354
  * Inject styles from StyleResult objects
270
355
  */
271
- inject(rules: StyleResult[], options?: {
272
- root?: Document | ShadowRoot;
273
- cacheKey?: string;
274
- }): InjectResult;
356
+ inject(rules: StyleResult[], options?: InjectOptions): InjectResult;
275
357
  /**
276
358
  * Inject global styles (rules without a generated tasty class selector)
277
359
  * This ensures we don't reserve a tasty class name (t{number}) for global rules,
@@ -295,24 +377,47 @@ declare class StyleInjector {
295
377
  root?: Document | ShadowRoot;
296
378
  }): string;
297
379
  /**
298
- * Increment refCount for an already-injected cacheKey and return a dispose.
299
- * Used by useStyles on cache hits (hydration or runtime reuse) where
300
- * the pipeline was skipped but refCount tracking is still needed.
301
- * Returns null if the cacheKey is not found.
380
+ * Take a reference on local `@keyframes`, under the deterministic names the
381
+ * caller resolved.
382
+ *
383
+ * One reference per distinct set of steps, shared by every class that ends up
384
+ * animating it, so a repeat render takes nothing further. Ownership is
385
+ * assigned by `ownKeyframes()` once the rules exist to be inspected.
386
+ */
387
+ holdKeyframes(steps: Record<string, KeyframesSteps>, names: Map<string, string>, options?: {
388
+ root?: Document | ShadowRoot;
389
+ }): Map<string, string>;
390
+ /**
391
+ * Record that `className` animates these keyframes, so the reference is
392
+ * released when the last such class is collected.
393
+ *
394
+ * Only classes whose rules actually reference the animation should be here:
395
+ * a class that merely rendered alongside one would otherwise keep the
396
+ * keyframes alive for as long as it lives.
397
+ */
398
+ ownKeyframes(key: string, className: string, options?: {
399
+ root?: Document | ShadowRoot;
400
+ }): void;
401
+ /**
402
+ * Pin an already-injected cacheKey and return the handle that releases it.
403
+ * For callers that skipped the pipeline on a cache hit but still need the
404
+ * class held. Returns null if the cacheKey is not found.
302
405
  */
303
406
  trackRef(cacheKey: string, options?: {
304
407
  root?: Document | ShadowRoot;
305
408
  }): InjectResult | null;
306
409
  /**
307
- * Dispose of a className (decrements refCount only).
410
+ * Release one pin on a className. At zero pins the class is not deleted — it
411
+ * stays cached and collectible, and `gc()` decides when it actually goes.
308
412
  */
309
- private dispose;
413
+ private unpin;
310
414
  /**
311
- * Force bulk cleanup of unused styles
415
+ * Remove every style that is neither in the DOM nor referenced by an
416
+ * outstanding `inject()` handle, ignoring the GC capacity threshold.
312
417
  */
313
418
  cleanup(root?: Document | ShadowRoot): void;
314
419
  /**
315
- * Get CSS text from all sheets (for SSR)
420
+ * Get the CSS text of every sheet for `root`. Needs a DOM.
316
421
  */
317
422
  getCSSText(options?: {
318
423
  root?: Document | ShadowRoot;
@@ -417,33 +522,82 @@ declare class StyleInjector {
417
522
  keyframes(steps: KeyframesSteps, nameOrOptions?: string | {
418
523
  root?: Document | ShadowRoot;
419
524
  name?: string;
525
+ /**
526
+ * Give this name its own rule even if another name already carries
527
+ * the same steps. Without it two names with identical steps share
528
+ * one rule under whichever name arrived first — fine when the caller
529
+ * only wants the animation, wrong when the name has to be the one it
530
+ * asked for.
531
+ */
532
+ distinctByName?: boolean;
420
533
  }): KeyframesResult;
421
534
  /**
422
535
  * Dispose keyframes
423
536
  */
424
537
  private disposeKeyframes;
425
538
  /**
426
- * Record a render-time usage hit for one or more classNames.
427
- * Handles space-separated multi-chunk classNames.
428
- * When the global touch counter reaches `touchInterval`, schedules a GC
429
- * via `requestIdleCallback`.
430
- * No-op on the server.
539
+ * Count a render, and schedule a collection pass every `touchInterval` of
540
+ * them. Nothing else: what a class is worth keeping is decided by the sweep's
541
+ * own DOM scan, so rendering does not track usage at all.
542
+ *
543
+ * @deprecated The class name is ignored — pass anything, or stop calling it.
544
+ * Collection no longer records per-class usage, and scheduling does not need
545
+ * to know which class was rendered. A class handed back by `inject()` is
546
+ * marked wanted there, which is what reuse actually goes through.
431
547
  */
432
- touch(className: string, options?: {
548
+ touch(_className: string, options?: {
433
549
  root?: Document | ShadowRoot;
434
550
  }): void;
435
551
  /**
436
- * Schedule a GC via `requestIdleCallback` (or synchronously as fallback).
437
- * Runs GC on all active roots. Avoids double-scheduling via `pendingGCHandle`.
552
+ * Schedule a GC in idle time. Runs GC on all active roots, and avoids
553
+ * double-scheduling.
554
+ *
555
+ * Idle only. Without `requestIdleCallback` nothing is collected
556
+ * automatically: running the sweep inline here would put it inside the render
557
+ * that touched the class, and collection is never urgent enough for that.
438
558
  */
439
559
  private scheduleGC;
560
+ /**
561
+ * The one definition of "unused": this injector owns the class's rules, no
562
+ * element in `root` carries it, and nobody pinned it.
563
+ *
564
+ * `gc()` evicts from this set, `getMetrics()` counts it, and `tastyDebug`
565
+ * reports it — all through here, so the three can never disagree about what
566
+ * "unused" means. Entries carry their last `touch()` so callers can drop the
567
+ * oldest first; a class that was never touched sorts as oldest.
568
+ */
569
+ /**
570
+ * Everything the injector holds falls into one of five bands, and only the
571
+ * last of them is ever deleted:
572
+ *
573
+ * 1. rendered — some element carries the class right now
574
+ * 2. not ours — queued for a batched write, pre-allocated, or server-rendered
575
+ * 3. hot — nothing carries it, but that was noticed less than `grace` ago
576
+ * 4. cached — cold, but within `capacity` when ordered by when it went cold
577
+ * 5. the rest
578
+ *
579
+ * This returns bands 4 and 5 together, most recently cold first; `gc()` draws
580
+ * the capacity line through them. Band 3 is what makes collection safe
581
+ * without a commit signal: a render can resolve a class and commit it a
582
+ * little later, and during that gap nothing on the page carries it.
583
+ */
584
+ private collectUnused;
585
+ /**
586
+ * Class names this injector holds CSS for that nothing renders and nobody
587
+ * pinned — exactly what `gc({ force: true })` would delete. Unordered.
588
+ */
589
+ getUnusedClasses(options?: {
590
+ root?: Document | ShadowRoot;
591
+ }): string[];
440
592
  /**
441
593
  * Synchronous garbage collection.
442
594
  *
443
- * 1. Quick upper-bound check: skip if unused count can't exceed capacity.
444
- * 2. Scans the DOM for live tasty classNames (safety guard).
445
- * 3. With `force: true`: deletes all unused entries inline.
446
- * Without `force`: collects unused, sorts oldest-first, evicts over capacity.
595
+ * 1. Quick upper-bound check: skip if the registry is smaller than capacity.
596
+ * 2. Scans the DOM for live tasty classNames — the DOM, not a ref count, is
597
+ * what says a class rendered by a component is still in use.
598
+ * 3. With `force: true`: deletes every unused class.
599
+ * Without `force`: keeps the `capacity` most recently touched and deletes
600
+ * the rest, oldest first.
447
601
  *
448
602
  * @returns Number of styles evicted.
449
603
  */
@@ -470,6 +624,21 @@ type ParseFunction = (groups: StyleDetails[]) => string;
470
624
  type FunctionsConfig = Record<string, FunctionDefinition | ParseFunction>;
471
625
  //#endregion
472
626
  //#region src/utils/color-space.d.ts
627
+ /**
628
+ * Color handling that survives into the emitted CSS.
629
+ *
630
+ * Tasty does not rewrite a color into a particular color space: opacity is
631
+ * applied with `color-mix()`, which the browser resolves against whatever a
632
+ * value turns out to be, so a color is emitted exactly as authored. What is left
633
+ * here is how an alpha gets applied.
634
+ */
635
+ /**
636
+ * The color space a `#name` token's value used to be rewritten into.
637
+ *
638
+ * @deprecated Kept for the `colorSpace` config option, which no longer has any
639
+ * effect. Colors are emitted as authored and opacity is always applied in
640
+ * `oklab` through `color-mix()`.
641
+ */
473
642
  type ColorSpace = 'rgb' | 'hsl' | 'oklch';
474
643
  //#endregion
475
644
  //#region src/utils/typography.d.ts
@@ -539,7 +708,7 @@ interface TastyPlugin {
539
708
  * definitions. See {@link FunctionsConfig}.
540
709
  */
541
710
  functions?: FunctionsConfig;
542
- /** Custom units that transform numeric values (e.g., `2x` → `calc(2 * var(--gap))`) */
711
+ /** Custom units that scale numeric values (e.g., `x: '8px'` makes `2x` → `16px`) */
543
712
  units?: Record<string, string | UnitHandler>;
544
713
  /** Custom state aliases (e.g., `'@mobile': '@media(w < 768px)'`) */
545
714
  states?: Record<string, string>;
@@ -587,7 +756,7 @@ interface TastyPlugin {
587
756
  * Design tokens injected as CSS custom properties on `:root`.
588
757
  * Values are parsed through the Tasty DSL. Supports state maps.
589
758
  * - `$name` → `--name` CSS custom property
590
- * - `#name` → `--name-color` and `--name-color-{colorSpace}`
759
+ * - `#name` → `--name-color`
591
760
  */
592
761
  tokens?: ConfigTokens;
593
762
  /** Predefined tokens replaced during style parsing (`$name` or `#name`) */
@@ -675,8 +844,12 @@ interface TastyConfig {
675
844
  parserCacheSize?: number;
676
845
  /**
677
846
  * Custom units for the style parser (merged with built-in units).
678
- * Units transform numeric values like `2x` → `calc(2 * var(--gap))`.
679
- * @example { em: 'em', vw: 'vw', custom: (n) => `${n * 10}px` }
847
+ * A unit scales its value by the number in front of it: the built-in
848
+ * `x: '8px'` makes `2x` → `16px`, and `u: 'var(--u)'` would make `2u` →
849
+ * `calc(2 * var(--u))`. A function receives the number and returns the CSS.
850
+ * Native CSS units (`px`, `em`, `vw`, …) need no entry: one with the same
851
+ * name replaces them.
852
+ * @example { u: 'var(--u)', col: (n) => `${n * 80}px` }
680
853
  */
681
854
  units?: Record<string, string | UnitHandler>;
682
855
  /**
@@ -703,14 +876,18 @@ interface TastyConfig {
703
876
  */
704
877
  functions?: FunctionsConfig;
705
878
  /**
706
- * Color space used for decomposed color token companion variables.
707
- * Controls the CSS function and suffix for alpha composition.
879
+ * @deprecated No longer has any effect; will be removed in the next major.
880
+ * Setting it warns in development.
708
881
  *
709
- * - `'rgb'` — suffix `-rgb`, e.g. `rgb(var(--name-color-rgb) / .5)`
710
- * - `'hsl'` — suffix `-hsl`, e.g. `hsl(var(--name-color-hsl) / .5)`
711
- * - `'oklch'` — suffix `-oklch`, e.g. `oklch(var(--name-color-oklch) / .5)`
882
+ * A `#name` token's value used to be rewritten into this color space so an
883
+ * opacity suffix had numeric channels to write an alpha into. Opacity now uses
884
+ * `color-mix(in oklab, var(--name-color) 50%, transparent)`, which the
885
+ * browser resolves against any color, so a color is emitted exactly as
886
+ * authored and there is nothing left for the setting to decide.
712
887
  *
713
- * @default 'oklch'
888
+ * To address a token's channels yourself, write relative color syntax against
889
+ * the token: `oklch(from var(--brand-color) calc(l * 1.2) c h)`. It works on
890
+ * every `<color>`, including the ones no conversion could evaluate.
714
891
  */
715
892
  colorSpace?: ColorSpace;
716
893
  /**
@@ -721,6 +898,47 @@ interface TastyConfig {
721
898
  * @default true
722
899
  */
723
900
  autoPropertyTypes?: boolean;
901
+ /**
902
+ * Defer stylesheet writes and apply them in one batch instead of performing
903
+ * one `insertRule()` per component during render.
904
+ *
905
+ * Each `insertRule()` on a live sheet invalidates style for that sheet's
906
+ * scope. When components inject during React's render phase while other
907
+ * components read layout in the same pass, the two interleave and the browser
908
+ * is forced to recalculate style between every injection. Batching collapses
909
+ * that into one invalidation per flush.
910
+ *
911
+ * - `false` (default) — inject synchronously, one write per component.
912
+ * - `true` — batch, but only inside a *batch window*: a commit in which
913
+ * `<TastyBatchProvider>` rendered and will therefore flush in its
914
+ * `useInsertionEffect`, before any `useLayoutEffect` runs. Any injection
915
+ * outside a window — a deep update the provider did not re-render for, an
916
+ * injection from a layout effect, an event handler, an async callback — is
917
+ * written straight through. Enabling this can never make a layout effect
918
+ * measure an unstyled element. Requires `<TastyBatchProvider>`; without it
919
+ * nothing is batched (and dev mode says so once).
920
+ * - `'always'` — batch every injection, flushing on a microtask when no
921
+ * window is open. Wins on more commits, but a `useLayoutEffect` that
922
+ * measures a freshly mounted element can read its unstyled box, because
923
+ * microtasks run after the layout phase. Paint is unaffected: microtasks
924
+ * always drain before the browser paints.
925
+ *
926
+ * No effect during SSR or RSC: styles are collected as text there, the
927
+ * runtime injector never runs, and the provider is inert without a
928
+ * `document`. No effect on zero-runtime `tastyStatic` styles either — those
929
+ * are extracted at build time and never reach the injector.
930
+ *
931
+ * @default false
932
+ * @example
933
+ * ```tsx
934
+ * configure({ batchInjection: true });
935
+ *
936
+ * <TastyBatchProvider>
937
+ * <App />
938
+ * </TastyBatchProvider>
939
+ * ```
940
+ */
941
+ batchInjection?: boolean | 'always';
724
942
  /**
725
943
  * Garbage collection configuration for unused styles.
726
944
  * GC is triggered by touch count: every `touchInterval` touches, the
@@ -788,7 +1006,7 @@ interface TastyConfig {
788
1006
  * Keys use tasty token syntax ($name for properties, #name for colors).
789
1007
  *
790
1008
  * Tasty ships with `DEFAULT_PROPERTIES` (e.g. `$gap`, `$radius`, `#white`,
791
- * `#black`, `#clear`, `#border`, etc.) that are always included.
1009
+ * `#black`, `#border`, etc.) that are always included.
792
1010
  * Properties you specify here are merged on top, so you can override any
793
1011
  * default by using the same key.
794
1012
  *
@@ -811,7 +1029,7 @@ interface TastyConfig {
811
1029
  * const Spinner = tasty({
812
1030
  * styles: {
813
1031
  * transform: 'rotate($rotation)',
814
- * transition: '$$rotation 0.3s', // outputs: --rotation 0.3s
1032
+ * transition: '$$rotation $transition', // outputs: --rotation var(--transition)
815
1033
  * },
816
1034
  * });
817
1035
  * ```
@@ -954,7 +1172,7 @@ interface TastyConfig {
954
1172
  * for responsive/theme-aware tokens.
955
1173
  *
956
1174
  * - `$name` keys become `--name` CSS custom properties
957
- * - `#name` keys become `--name-color` and `--name-color-{colorSpace}` properties
1175
+ * - `#name` keys become `--name-color` properties
958
1176
  *
959
1177
  * Tokens are injected once when the first style is rendered.
960
1178
  *
@@ -978,6 +1196,10 @@ interface TastyConfig {
978
1196
  * Values are substituted inline before CSS generation, unlike `tokens` which
979
1197
  * inject CSS custom properties on `:root`.
980
1198
  *
1199
+ * Includes `'#clear': 'transparent'` by default. Aliases resolving to
1200
+ * `transparent` ignore opacity suffixes, including custom-property opacity.
1201
+ * Explicit replaceTokens entries can override the defaults.
1202
+ *
981
1203
  * For color tokens (#name), boolean `true` is converted to `transparent`.
982
1204
  *
983
1205
  * @example
@@ -993,7 +1215,7 @@ interface TastyConfig {
993
1215
  * // Now use in styles - tokens are replaced at parse time:
994
1216
  * const Card = tasty({
995
1217
  * styles: {
996
- * padding: '$spacing', // → calc(2 * var(--gap))
1218
+ * padding: '$spacing', // → 16px
997
1219
  * fill: '#accent', // → var(--purple-color)
998
1220
  * },
999
1221
  * });
@@ -1080,38 +1302,11 @@ declare global {
1080
1302
  * Detect if we're running in a test environment
1081
1303
  */
1082
1304
  declare function isTestEnvironment(): boolean;
1083
- /**
1084
- * Check if styles have been generated (configuration is locked)
1085
- */
1086
- declare function hasStylesGenerated(): boolean;
1087
1305
  /**
1088
1306
  * Check if any global keyframes are configured.
1089
- * Uses a pre-computed flag to avoid Object.keys() allocation on every call.
1307
+ * Storage only ever holds a non-empty record, so no Object.keys() is needed.
1090
1308
  */
1091
1309
  declare function hasGlobalKeyframes(): boolean;
1092
- /**
1093
- * Get global keyframes configuration.
1094
- * Returns null if no keyframes configured (fast path for zero-overhead).
1095
- */
1096
- declare function getGlobalKeyframes(): Record<string, KeyframesSteps> | null;
1097
- /**
1098
- * Get global font-face configuration.
1099
- * Returns null if no font faces configured.
1100
- * Reads from globalThis first for cross-module SSR support.
1101
- */
1102
- declare function getGlobalFontFaces(): Record<string, FontFaceInput> | null;
1103
- /**
1104
- * Get global counter-style configuration.
1105
- * Returns null if no counter styles configured.
1106
- * Reads from globalThis first for cross-module SSR support.
1107
- */
1108
- declare function getGlobalCounterStyles(): Record<string, CounterStyleDescriptors> | null;
1109
- /**
1110
- * Get global @function configuration.
1111
- * Returns null if no functions configured.
1112
- * Reads from globalThis first for cross-module SSR support.
1113
- */
1114
- declare function getGlobalFunctions(): Record<string, FunctionDefinition> | null;
1115
1310
  /**
1116
1311
  * Check if any global recipes are configured.
1117
1312
  * Fast path: returns false if no recipes were ever set.
@@ -1168,5 +1363,5 @@ declare function getNamePrefix(): string;
1168
1363
  */
1169
1364
  declare function resetConfig(): void;
1170
1365
  //#endregion
1171
- export { ParseFunction as C, PropHandlerDefinition as D, PropHandler as E, PropHandlerProps as O, FunctionsConfig as S, SheetManager as T, TastyPluginFactory as _, getGlobalFontFaces as a, generateTypographyTokens as b, getGlobalRecipes as c, hasGlobalRecipes as d, hasStylesGenerated as f, TastyPlugin as g, resetConfig as h, getGlobalCounterStyles as i, getNamePrefix as l, isTestEnvironment as m, configure as n, getGlobalFunctions as o, isConfigLocked as p, getConfig as r, getGlobalKeyframes as s, TastyConfig as t, hasGlobalKeyframes as u, TypographyPreset as v, StyleInjector as w, ColorSpace as x, TypographyTokenValue as y };
1172
- //# sourceMappingURL=config-De8L9NWM.d.ts.map
1366
+ export { PropHandlerProps as C, getGlobalKeyframes as D, getGlobalFunctions as E, PropHandlerDefinition as S, getGlobalFontFaces as T, FunctionsConfig as _, getNamePrefix as a, SheetManager as b, isConfigLocked as c, TastyPlugin as d, TastyPluginFactory as f, ColorSpace as g, generateTypographyTokens as h, getGlobalRecipes as i, isTestEnvironment as l, TypographyTokenValue as m, configure as n, hasGlobalKeyframes as o, TypographyPreset as p, getConfig as r, hasGlobalRecipes as s, TastyConfig as t, resetConfig as u, ParseFunction as v, getGlobalCounterStyles as w, PropHandler as x, StyleInjector as y };
1367
+ //# sourceMappingURL=config-C4ftFxgI.d.ts.map
@@ -1,5 +1,5 @@
1
- import { C as ParseFunction, D as PropHandlerDefinition, E as PropHandler, O as PropHandlerProps, S as FunctionsConfig, T as SheetManager, _ as TastyPluginFactory, a as getGlobalFontFaces, b as generateTypographyTokens, c as getGlobalRecipes, d as hasGlobalRecipes, f as hasStylesGenerated, g as TastyPlugin, h as resetConfig, i as getGlobalCounterStyles, l as getNamePrefix, m as isTestEnvironment, n as configure, o as getGlobalFunctions, p as isConfigLocked, r as getConfig, s as getGlobalKeyframes, t as TastyConfig, u as hasGlobalKeyframes, v as TypographyPreset, w as StyleInjector, x as ColorSpace, y as TypographyTokenValue } from "../config-De8L9NWM.js";
2
- import { $ as StyleParser, A as ParsedColor, At as StyleUsage, B as StyleValueStateMap, C as SuffixForSelector, Ct as PropertyOptions, D as CSSMap, Dt as SheetInfo, E as AnyStyleHandler, Et as RuleInfo, F as StyleHandlerProps, G as parseColor, H as getGlobalParser, I as StyleHandlerResult, J as getNamedColorHex, K as parseStyle, L as StyleMap, M as ResolvedStyleValue, N as StyleHandler, O as CUSTOM_UNITS, Ot as StyleInjectorConfig, P as StyleHandlerDefinition, Q as strToRgb, R as StylePropValue, S as StylesWithoutSelectors, St as PropertyDefinition, T as TastyPresetNames, Tt as RootRegistry, U as getGlobalPredefinedTokens, V as filterMods, W as normalizeColorTokenValue, X as hexToRgb, Y as getRgbValuesFromRgbaString, Z as hslToRgbValues, _ as NotSelector, _t as InjectionMode, a as ParseStateKeyOptions, at as CSSProperties, b as Styles, bt as KeyframesResult, c as ParsedAdvancedState, ct as DisposeFunction, d as getGlobalPredefinedStates, dt as FunctionDefinition, et as ParserOptions, f as setGlobalPredefinedStates, ft as FunctionParameter, g as NoType, gt as InjectResult, h as ConfigTokens, i as renderStyles, it as UnitHandler, j as RawStyleHandler, k as DIRECTIONS, kt as StyleRule, l as StateParserContext, lt as FontFaceDescriptors, m as ConfigTokenValue, mt as GCOptions, n as StyleResult, nt as StyleDetails, o as parseStateKey, ot as CacheMetrics, p as ConditionNode, pt as GCConfig, q as stringifyStyles, r as isSelector, rt as StyleDetailsPart, s as AtRuleContext, st as CounterStyleDescriptors, t as RenderResult, tt as ProcessedStyle, u as createStateParserContext, ut as FontFaceInput, v as RecipeStyles, vt as KeyframesCacheEntry, w as TastyNamedColors, wt as RawCSSResult, x as StylesInterface, xt as KeyframesSteps, y as Selector, yt as KeyframesInfo, z as StyleValue } from "../index-KUYya3x7.js";
3
- import { $ as okhstFunction, $t as TagName, A as keyframes, B as ChunkInfo, Bt as BlockOuterStyleProps, C as getCSSTextForNode, D as injectRawCSS, E as injectGlobal, F as ComputeStylesOptions, G as DIMENSION_CHUNK_STYLES, Gt as ExtraBaseStyleProps, H as APPEARANCE_CHUNK_STYLES, Ht as ColorStyleProps, I as ComputeStylesResult, J as LAYOUT_CHUNK_STYLES, Jt as ModValue, K as DISPLAY_CHUNK_STYLES, Kt as FlowStyleProps, L as computeStyles, M as touch, N as ChunkSheetRegistry, O as injector, P as chunkSheetRegistry, Q as createColorFunc, Qt as ShortGridStyles, R as defineHandler, Rt as BaseStyleProps, S as getCSSText, T as inject, U as CHUNK_NAMES, Ut as ContainerStyleProps, V as categorizeStyleKeys, Vt as BlockStyleProps, W as ChunkName, Wt as DimensionStyleProps, X as STYLE_TO_CHUNK, Xt as OuterStyleProps, Y as POSITION_CHUNK_STYLES, Yt as Mods, Z as resolveFunctionColor, Zt as PositionStyleProps, _ as createInjector, _n as POSITION_STYLES, a as DebugOptions, an as TokenValue, b as func, bn as DEFAULT_ZERO_NAME_PREFIX, c as tastyDebug, cn as BLOCK_INNER_STYLES, d as dotize, dn as COLOR_STYLES, en as TastyBaseStylePropNames, et as okhstPlugin, f as _modAttrs, fn as CONTAINER_STYLES, g as counterStyle, gn as OUTER_STYLES, h as cleanup, hn as INNER_STYLES, i as DebugChunkInfo, in as TextStyleProps, j as property, k as isPropertyDefined, l as processTokens, ln as BLOCK_OUTER_STYLES, m as filterBaseProps, mn as FLOW_STYLES, n as CacheStatus, nn as TastyExtensionConfig, nt as okhslPlugin, o as InspectResult, on as Tokens, p as color, pn as DIMENSION_STYLES, q as FONT_CHUNK_STYLES, qt as InnerStyleProps, r as ChunkBreakdown, rn as TastyThemeNames, s as Summary, sn as BASE_STYLES, t as CSSOptions, tn as TastyCustomProps, tt as okhslFunction, u as resolveRecipes, un as BLOCK_STYLES, v as destroy, vn as TEXT_STYLES, w as getRawCSSText, x as gc, y as fontFace, yn as DEFAULT_NAME_PREFIX, z as styleHandlers, zt as BlockInnerStyleProps } from "../index-DzGxoeyN.js";
4
- import { t as mergeStyles } from "../merge-styles-DLm4wdnb.js";
5
- export { APPEARANCE_CHUNK_STYLES, type AnyStyleHandler, type AtRuleContext, BASE_STYLES, BLOCK_INNER_STYLES, BLOCK_OUTER_STYLES, BLOCK_STYLES, type BaseStyleProps, type BlockInnerStyleProps, type BlockOuterStyleProps, type BlockStyleProps, CHUNK_NAMES, COLOR_STYLES, CONTAINER_STYLES, type CSSMap, CSSOptions, type CSSProperties, CUSTOM_UNITS, type CacheMetrics, CacheStatus, ChunkBreakdown, type ChunkInfo, type ChunkName, ChunkSheetRegistry, type ColorSpace, type ColorStyleProps, type ComputeStylesOptions, type ComputeStylesResult, type ConditionNode, type ConfigTokenValue, type ConfigTokens, type ContainerStyleProps, type CounterStyleDescriptors, DEFAULT_NAME_PREFIX, DEFAULT_ZERO_NAME_PREFIX, DIMENSION_CHUNK_STYLES, DIMENSION_STYLES, DIRECTIONS, DISPLAY_CHUNK_STYLES, DebugChunkInfo, DebugOptions, type DimensionStyleProps, type DisposeFunction, type ExtraBaseStyleProps, FLOW_STYLES, FONT_CHUNK_STYLES, type FlowStyleProps, type FontFaceDescriptors, type FontFaceInput, type FunctionDefinition, type FunctionParameter, type FunctionsConfig, type GCConfig, type GCOptions, INNER_STYLES, type InjectResult, type InjectionMode, type InnerStyleProps, InspectResult, type KeyframesCacheEntry, type KeyframesInfo, type KeyframesResult, type KeyframesSteps, LAYOUT_CHUNK_STYLES, type ModValue, type Mods, type NoType, type NotSelector, OUTER_STYLES, type OuterStyleProps, POSITION_CHUNK_STYLES, POSITION_STYLES, type ParseFunction, type ParseStateKeyOptions, type ParsedAdvancedState, type ParsedColor, type ParserOptions, type PositionStyleProps, type ProcessedStyle, type PropHandler, type PropHandlerDefinition, type PropHandlerProps, type PropertyDefinition, type PropertyOptions, type RawCSSResult, type RawStyleHandler, type RecipeStyles, type RenderResult, type ResolvedStyleValue, type RootRegistry, type RuleInfo, STYLE_TO_CHUNK, type Selector, type SheetInfo, SheetManager, type ShortGridStyles, type StateParserContext, type StyleDetails, type StyleDetailsPart, type StyleHandler, type StyleHandlerDefinition, type StyleHandlerProps, type StyleHandlerResult, StyleInjector, type StyleInjectorConfig, type StyleMap, StyleParser, type StylePropValue, type StyleResult, type StyleRule, type StyleUsage, type StyleValue, type StyleValueStateMap, type Styles, type StylesInterface, type StylesWithoutSelectors, type SuffixForSelector, Summary, TEXT_STYLES, type TagName, type TastyBaseStylePropNames, type TastyConfig, type TastyCustomProps, type TastyExtensionConfig, type TastyNamedColors, type TastyPlugin, type TastyPluginFactory, type TastyPresetNames, type TastyThemeNames, type TextStyleProps, type TokenValue, type Tokens, TypographyPreset, TypographyTokenValue, type UnitHandler, categorizeStyleKeys, chunkSheetRegistry, cleanup, color, computeStyles, configure, counterStyle, createColorFunc, createInjector, createStateParserContext, defineHandler, destroy, dotize, filterBaseProps, filterMods, fontFace, func, gc, generateTypographyTokens, getCSSText, getCSSTextForNode, getConfig, getGlobalCounterStyles, getGlobalFontFaces, getGlobalFunctions, getGlobalKeyframes, getGlobalParser, getGlobalPredefinedStates, getGlobalPredefinedTokens, getGlobalRecipes, getNamePrefix, getNamedColorHex, getRawCSSText, getRgbValuesFromRgbaString, hasGlobalKeyframes, hasGlobalRecipes, hasStylesGenerated, hexToRgb, hslToRgbValues, inject, injectGlobal, injectRawCSS, injector, isConfigLocked, isPropertyDefined, isSelector, isTestEnvironment, keyframes, mergeStyles, _modAttrs as modAttrs, normalizeColorTokenValue, okhslFunction, okhslPlugin, okhstFunction, okhstPlugin, parseColor, parseStateKey, parseStyle, processTokens, property, renderStyles, resetConfig, resolveFunctionColor, resolveRecipes, setGlobalPredefinedStates, strToRgb, stringifyStyles, styleHandlers, tastyDebug, touch };
1
+ import { $ as TastyNamedColors, A as resetStyleBatch, B as getGlobalPredefinedStates, C as SheetInfo, Ct as StyleParser, D as QueuedWrite, Dt as StyleDetailsPart, E as StyleUsage, Et as StyleDetails, F as parseStateKey, G as NoType, H as ConditionNode, I as AtRuleContext, J as Selector, K as NotSelector, L as ParsedAdvancedState, M as StyleResult, N as renderStyles, O as flushStyles, Ot as UnitHandler, P as ParseStateKeyOptions, Q as SuffixForSelector, R as StateParserContext, S as RuleInfo, St as stringifyStyles, T as StyleRule, Tt as ProcessedStyle, U as ConfigTokenValue, V as setGlobalPredefinedStates, W as ConfigTokens, X as StylesInterface, Y as Styles, Z as StylesWithoutSelectors, _ as KeyframesSteps, _t as getGlobalParser, a as FontFaceInput, at as ParsedColor, b as RawCSSResult, bt as parseColor, c as GCConfig, ct as StyleHandler, d as InjectOptions, dt as StyleHandlerResult, et as TastyPresetNames, f as InjectResult, ft as StyleMap, g as KeyframesResult, gt as filterMods, h as KeyframesInfo, ht as StyleValueStateMap, i as FontFaceDescriptors, it as DIRECTIONS, j as RenderResult, k as hasPendingStyleWrites, kt as CSSProperties, l as GCOptions, lt as StyleHandlerDefinition, m as KeyframesCacheEntry, mt as StyleValue, n as CounterStyleDescriptors, nt as CSSMap, o as FunctionDefinition, ot as RawStyleHandler, p as InjectionMode, pt as StylePropValue, q as RecipeStyles, r as DisposeFunction, rt as CUSTOM_UNITS, s as FunctionParameter, st as ResolvedStyleValue, t as CacheMetrics, tt as AnyStyleHandler, ut as StyleHandlerProps, v as PropertyDefinition, vt as getGlobalPredefinedTokens, w as StyleInjectorConfig, wt as ParserOptions, x as RootRegistry, xt as parseStyle, y as PropertyOptions, yt as normalizeColorTokenValue, z as createStateParserContext } from "../types-CYQIhUg1.js";
2
+ import { $ as createColorFunc, $t as ModValue, A as keyframes, An as hexToRgb, B as styleHandlers, C as getRawCSSText, Cn as TEXT_STYLES, D as injectRawCSS, Dn as isSelector, E as injectGlobal, En as hasStylesGenerated, F as chunkSheetRegistry, G as ChunkName, Gt as BlockOuterStyleProps, H as categorizeStyleKeys, I as ComputeStylesOptions, J as FONT_CHUNK_STYLES, Jt as ContainerStyleProps, K as DIMENSION_CHUNK_STYLES, Kt as BlockStyleProps, L as ComputeStylesResult, M as property, Mn as strToRgb, N as touch, O as injector, On as getNamedColorHex, P as ChunkSheetRegistry, Q as resolveFunctionColor, Qt as InnerStyleProps, R as computeStyles, S as getCSSTextForNode, Sn as POSITION_STYLES, T as inject, Tn as DEFAULT_ZERO_NAME_PREFIX, U as APPEARANCE_CHUNK_STYLES, Ut as BaseStyleProps, V as ChunkInfo, W as CHUNK_NAMES, Wt as BlockInnerStyleProps, X as POSITION_CHUNK_STYLES, Xt as ExtraBaseStyleProps, Y as LAYOUT_CHUNK_STYLES, Yt as DimensionStyleProps, Z as STYLE_TO_CHUNK, Zt as FlowStyleProps, _ as destroy, _n as CONTAINER_STYLES, a as DebugOptions, an as TastyBaseStylePropNames, b as gc, bn as INNER_STYLES, c as tastyDebug, cn as TastyThemeNames, d as modAttrs, dn as Tokens, en as Mods, et as okhstFunction, f as color, fn as BASE_STYLES, g as createInjector, gn as COLOR_STYLES, h as counterStyle, hn as BLOCK_STYLES, i as DebugChunkInfo, in as TagName, j as ownKeyframes, jn as hslToRgbValues, k as isPropertyDefined, kn as getRgbValuesFromRgbaString, l as processTokens, ln as TextStyleProps, m as cleanup, mn as BLOCK_OUTER_STYLES, n as CacheStatus, nn as PositionStyleProps, nt as okhslFunction, o as InspectResult, on as TastyCustomProps, p as filterBaseProps, pn as BLOCK_INNER_STYLES, q as DISPLAY_CHUNK_STYLES, qt as ColorStyleProps, r as ChunkBreakdown, rn as ShortGridStyles, rt as okhslPlugin, s as Summary, sn as TastyExtensionConfig, t as CSSOptions, tn as OuterStyleProps, tt as okhstPlugin, u as resolveRecipes, un as TokenValue, v as fontFace, vn as DIMENSION_STYLES, w as holdKeyframes, wn as DEFAULT_NAME_PREFIX, x as getCSSText, xn as OUTER_STYLES, y as func, yn as FLOW_STYLES, z as defineHandler } from "../index-DxQNRj50.js";
3
+ import { C as PropHandlerProps, D as getGlobalKeyframes, E as getGlobalFunctions, S as PropHandlerDefinition, T as getGlobalFontFaces, _ as FunctionsConfig, a as getNamePrefix, b as SheetManager, c as isConfigLocked, d as TastyPlugin, f as TastyPluginFactory, g as ColorSpace, h as generateTypographyTokens, i as getGlobalRecipes, l as isTestEnvironment, m as TypographyTokenValue, n as configure, o as hasGlobalKeyframes, p as TypographyPreset, r as getConfig, s as hasGlobalRecipes, t as TastyConfig, u as resetConfig, v as ParseFunction, w as getGlobalCounterStyles, x as PropHandler, y as StyleInjector } from "../config-C4ftFxgI.js";
4
+ import { t as mergeStyles } from "../merge-styles-D39qBtox.js";
5
+ export { APPEARANCE_CHUNK_STYLES, type AnyStyleHandler, type AtRuleContext, BASE_STYLES, BLOCK_INNER_STYLES, BLOCK_OUTER_STYLES, BLOCK_STYLES, type BaseStyleProps, type BlockInnerStyleProps, type BlockOuterStyleProps, type BlockStyleProps, CHUNK_NAMES, COLOR_STYLES, CONTAINER_STYLES, type CSSMap, CSSOptions, type CSSProperties, CUSTOM_UNITS, type CacheMetrics, CacheStatus, ChunkBreakdown, type ChunkInfo, type ChunkName, ChunkSheetRegistry, type ColorSpace, type ColorStyleProps, type ComputeStylesOptions, type ComputeStylesResult, type ConditionNode, type ConfigTokenValue, type ConfigTokens, type ContainerStyleProps, type CounterStyleDescriptors, DEFAULT_NAME_PREFIX, DEFAULT_ZERO_NAME_PREFIX, DIMENSION_CHUNK_STYLES, DIMENSION_STYLES, DIRECTIONS, DISPLAY_CHUNK_STYLES, DebugChunkInfo, DebugOptions, type DimensionStyleProps, type DisposeFunction, type ExtraBaseStyleProps, FLOW_STYLES, FONT_CHUNK_STYLES, type FlowStyleProps, type FontFaceDescriptors, type FontFaceInput, type FunctionDefinition, type FunctionParameter, type FunctionsConfig, type GCConfig, type GCOptions, INNER_STYLES, type InjectOptions, type InjectResult, type InjectionMode, type InnerStyleProps, InspectResult, type KeyframesCacheEntry, type KeyframesInfo, type KeyframesResult, type KeyframesSteps, LAYOUT_CHUNK_STYLES, type ModValue, type Mods, type NoType, type NotSelector, OUTER_STYLES, type OuterStyleProps, POSITION_CHUNK_STYLES, POSITION_STYLES, type ParseFunction, type ParseStateKeyOptions, type ParsedAdvancedState, type ParsedColor, type ParserOptions, type PositionStyleProps, type ProcessedStyle, type PropHandler, type PropHandlerDefinition, type PropHandlerProps, type PropertyDefinition, type PropertyOptions, type QueuedWrite, type RawCSSResult, type RawStyleHandler, type RecipeStyles, type RenderResult, type ResolvedStyleValue, type RootRegistry, type RuleInfo, STYLE_TO_CHUNK, type Selector, type SheetInfo, SheetManager, type ShortGridStyles, type StateParserContext, type StyleDetails, type StyleDetailsPart, type StyleHandler, type StyleHandlerDefinition, type StyleHandlerProps, type StyleHandlerResult, StyleInjector, type StyleInjectorConfig, type StyleMap, StyleParser, type StylePropValue, type StyleResult, type StyleRule, type StyleUsage, type StyleValue, type StyleValueStateMap, type Styles, type StylesInterface, type StylesWithoutSelectors, type SuffixForSelector, Summary, TEXT_STYLES, type TagName, type TastyBaseStylePropNames, type TastyConfig, type TastyCustomProps, type TastyExtensionConfig, type TastyNamedColors, type TastyPlugin, type TastyPluginFactory, type TastyPresetNames, type TastyThemeNames, type TextStyleProps, type TokenValue, type Tokens, TypographyPreset, TypographyTokenValue, type UnitHandler, categorizeStyleKeys, chunkSheetRegistry, cleanup, color, computeStyles, configure, counterStyle, createColorFunc, createInjector, createStateParserContext, defineHandler, destroy, filterBaseProps, filterMods, flushStyles, fontFace, func, gc, generateTypographyTokens, getCSSText, getCSSTextForNode, getConfig, getGlobalCounterStyles, getGlobalFontFaces, getGlobalFunctions, getGlobalKeyframes, getGlobalParser, getGlobalPredefinedStates, getGlobalPredefinedTokens, getGlobalRecipes, getNamePrefix, getNamedColorHex, getRawCSSText, getRgbValuesFromRgbaString, hasGlobalKeyframes, hasGlobalRecipes, hasPendingStyleWrites, hasStylesGenerated, hexToRgb, holdKeyframes, hslToRgbValues, inject, injectGlobal, injectRawCSS, injector, isConfigLocked, isPropertyDefined, isSelector, isTestEnvironment, keyframes, mergeStyles, modAttrs, normalizeColorTokenValue, okhslFunction, okhslPlugin, okhstFunction, okhstPlugin, ownKeyframes, parseColor, parseStateKey, parseStyle, processTokens, property, renderStyles, resetConfig, resetStyleBatch, resolveFunctionColor, resolveRecipes, setGlobalPredefinedStates, strToRgb, stringifyStyles, styleHandlers, tastyDebug, touch };
@@ -1,6 +1,9 @@
1
- import { $ as SheetManager, A as FLOW_STYLES, B as createStateParserContext, Bt as stringifyStyles, C as BASE_STYLES, Ct as LAYOUT_CHUNK_STYLES, D as COLOR_STYLES, E as BLOCK_STYLES, Ft as getGlobalParser, G as StyleInjector, Gt as createColorFunc, Ht as okhstPlugin, I as isSelector, It as getGlobalPredefinedTokens, L as renderStyles, Lt as normalizeColorTokenValue, M as OUTER_STYLES, Mt as CUSTOM_UNITS, N as POSITION_STYLES, Nt as DIRECTIONS, O as CONTAINER_STYLES, P as TEXT_STYLES, Pt as filterMods, R as parseStateKey, Rt as parseColor, St as FONT_CHUNK_STYLES, T as BLOCK_OUTER_STYLES, Tt as STYLE_TO_CHUNK, U as getGlobalPredefinedStates, Ut as okhslFunction, Vt as okhstFunction, W as setGlobalPredefinedStates, Wt as okhslPlugin, a as getGlobalCounterStyles, an as hslToRgbValues, at as DEFAULT_NAME_PREFIX, b as resetConfig, bt as DIMENSION_CHUNK_STYLES, en as resolveFunctionColor, f as getNamePrefix, g as isConfigLocked, h as hasStylesGenerated, in as hexToRgb, j as INNER_STYLES, k as DIMENSION_STYLES, l as getGlobalKeyframes, m as hasGlobalRecipes, n as getConfig, nn as getNamedColorHex, nt as styleHandlers, o as getGlobalFontFaces, on as strToRgb, ot as DEFAULT_ZERO_NAME_PREFIX, p as hasGlobalKeyframes, qt as StyleParser, rn as getRgbValuesFromRgbaString, s as getGlobalFunctions, t as configure, tt as defineHandler, u as getGlobalRecipes, v as isTestEnvironment, vt as APPEARANCE_CHUNK_STYLES, w as BLOCK_INNER_STYLES, wt as POSITION_CHUNK_STYLES, x as generateTypographyTokens, xt as DISPLAY_CHUNK_STYLES, yt as CHUNK_NAMES, zt as parseStyle } from "../config-Bxme0Moq.js";
2
- import { l as categorizeStyleKeys } from "../keyframes-DrUITLCz.js";
3
- import { A as property, C as getRawCSSText, D as injector, E as injectRawCSS, M as ChunkSheetRegistry, N as chunkSheetRegistry, O as isPropertyDefined, S as getCSSTextForNode, T as injectGlobal, _ as destroy, a as color, b as gc, g as createInjector, h as counterStyle, i as _modAttrs, j as touch, k as keyframes, m as cleanup, n as processTokens, o as filterBaseProps, r as dotize, s as computeStyles, t as tastyDebug, v as fontFace, w as inject, x as getCSSText, y as func } from "../core-BR4waa0Q.js";
4
- import { t as mergeStyles } from "../merge-styles-biRwSixM.js";
5
- import { t as resolveRecipes } from "../resolve-recipes-CBVdPz67.js";
6
- export { APPEARANCE_CHUNK_STYLES, BASE_STYLES, BLOCK_INNER_STYLES, BLOCK_OUTER_STYLES, BLOCK_STYLES, CHUNK_NAMES, COLOR_STYLES, CONTAINER_STYLES, CUSTOM_UNITS, ChunkSheetRegistry, DEFAULT_NAME_PREFIX, DEFAULT_ZERO_NAME_PREFIX, DIMENSION_CHUNK_STYLES, DIMENSION_STYLES, DIRECTIONS, DISPLAY_CHUNK_STYLES, FLOW_STYLES, FONT_CHUNK_STYLES, INNER_STYLES, LAYOUT_CHUNK_STYLES, OUTER_STYLES, POSITION_CHUNK_STYLES, POSITION_STYLES, STYLE_TO_CHUNK, SheetManager, StyleInjector, StyleParser, TEXT_STYLES, categorizeStyleKeys, chunkSheetRegistry, cleanup, color, computeStyles, configure, counterStyle, createColorFunc, createInjector, createStateParserContext, defineHandler, destroy, dotize, filterBaseProps, filterMods, fontFace, func, gc, generateTypographyTokens, getCSSText, getCSSTextForNode, getConfig, getGlobalCounterStyles, getGlobalFontFaces, getGlobalFunctions, getGlobalKeyframes, getGlobalParser, getGlobalPredefinedStates, getGlobalPredefinedTokens, getGlobalRecipes, getNamePrefix, getNamedColorHex, getRawCSSText, getRgbValuesFromRgbaString, hasGlobalKeyframes, hasGlobalRecipes, hasStylesGenerated, hexToRgb, hslToRgbValues, inject, injectGlobal, injectRawCSS, injector, isConfigLocked, isPropertyDefined, isSelector, isTestEnvironment, keyframes, mergeStyles, _modAttrs as modAttrs, normalizeColorTokenValue, okhslFunction, okhslPlugin, okhstFunction, okhstPlugin, parseColor, parseStateKey, parseStyle, processTokens, property, renderStyles, resetConfig, resolveFunctionColor, resolveRecipes, setGlobalPredefinedStates, strToRgb, stringifyStyles, styleHandlers, tastyDebug, touch };
1
+ import { A as getRgbValuesFromRgbaString, C as createColorFunc, M as hslToRgbValues, P as strToRgb, S as okhslPlugin, b as okhstPlugin, c as getGlobalParser, d as normalizeColorTokenValue, f as parseColor, i as DIRECTIONS, j as hexToRgb, k as getNamedColorHex, l as getGlobalPredefinedTokens, n as resolveFunctionColor, o as filterMods, p as parseStyle, r as CUSTOM_UNITS, t as color, v as stringifyStyles, w as StyleParser, x as okhslFunction, y as okhstFunction } from "../chunks/dsl-CsFl9LGn.js";
2
+ import { n as isSelector, t as mergeStyles } from "../chunks/shared-utils-y-HjvPN4.js";
3
+ import { E as DEFAULT_ZERO_NAME_PREFIX, T as DEFAULT_NAME_PREFIX } from "../chunks/css-definitions-B4aWBkH3.js";
4
+ import { A as styleHandlers, B as STYLE_TO_CHUNK, E as defineHandler, F as DIMENSION_CHUNK_STYLES, G as setGlobalPredefinedStates, I as DISPLAY_CHUNK_STYLES, K as hasStylesGenerated, L as FONT_CHUNK_STYLES, N as APPEARANCE_CHUNK_STYLES, P as CHUNK_NAMES, R as LAYOUT_CHUNK_STYLES, S as parseStateKey, U as createStateParserContext, W as getGlobalPredefinedStates, _ as POSITION_STYLES, b as renderStyles, c as BLOCK_INNER_STYLES, d as COLOR_STYLES, f as CONTAINER_STYLES, g as OUTER_STYLES, h as INNER_STYLES, l as BLOCK_OUTER_STYLES, m as FLOW_STYLES, p as DIMENSION_STYLES, r as categorizeStyleKeys, s as BASE_STYLES, u as BLOCK_STYLES, v as TEXT_STYLES, z as POSITION_CHUNK_STYLES } from "../chunks/style-engine-DnkV_4Jg.js";
5
+ import { i as generateTypographyTokens } from "../chunks/config-engine-CMYFZYQh.js";
6
+ import { c as getGlobalFontFaces, l as getGlobalFunctions, s as getGlobalCounterStyles, u as getGlobalKeyframes } from "../chunks/runtime-state-lZjMbvwV.js";
7
+ import { A as injector, C as getCSSText, D as inject, E as holdKeyframes, F as touch, G as isConfigLocked, H as getNamePrefix, I as ChunkSheetRegistry, J as StyleInjector, K as isTestEnvironment, L as chunkSheetRegistry, M as keyframes, N as ownKeyframes, O as injectGlobal, P as property, Q as hasPendingStyleWrites, R as configure, S as gc, T as getRawCSSText, U as hasGlobalKeyframes, V as getGlobalRecipes, W as hasGlobalRecipes, Y as SheetManager, Z as flushStyles, _ as counterStyle, a as filterBaseProps, b as fontFace, et as resetStyleBatch, g as cleanup, i as modAttrs, j as isPropertyDefined, k as injectRawCSS, o as computeStyles, q as resetConfig, r as processTokens, s as resolveRecipes, v as createInjector, w as getCSSTextForNode, x as func, y as destroy, z as getConfig } from "../chunks/runtime-engine-NGCofNXy.js";
8
+ import { t as tastyDebug } from "../chunks/debug-D2Pu7Xhy.js";
9
+ export { APPEARANCE_CHUNK_STYLES, BASE_STYLES, BLOCK_INNER_STYLES, BLOCK_OUTER_STYLES, BLOCK_STYLES, CHUNK_NAMES, COLOR_STYLES, CONTAINER_STYLES, CUSTOM_UNITS, ChunkSheetRegistry, DEFAULT_NAME_PREFIX, DEFAULT_ZERO_NAME_PREFIX, DIMENSION_CHUNK_STYLES, DIMENSION_STYLES, DIRECTIONS, DISPLAY_CHUNK_STYLES, FLOW_STYLES, FONT_CHUNK_STYLES, INNER_STYLES, LAYOUT_CHUNK_STYLES, OUTER_STYLES, POSITION_CHUNK_STYLES, POSITION_STYLES, STYLE_TO_CHUNK, SheetManager, StyleInjector, StyleParser, TEXT_STYLES, categorizeStyleKeys, chunkSheetRegistry, cleanup, color, computeStyles, configure, counterStyle, createColorFunc, createInjector, createStateParserContext, defineHandler, destroy, filterBaseProps, filterMods, flushStyles, fontFace, func, gc, generateTypographyTokens, getCSSText, getCSSTextForNode, getConfig, getGlobalCounterStyles, getGlobalFontFaces, getGlobalFunctions, getGlobalKeyframes, getGlobalParser, getGlobalPredefinedStates, getGlobalPredefinedTokens, getGlobalRecipes, getNamePrefix, getNamedColorHex, getRawCSSText, getRgbValuesFromRgbaString, hasGlobalKeyframes, hasGlobalRecipes, hasPendingStyleWrites, hasStylesGenerated, hexToRgb, holdKeyframes, hslToRgbValues, inject, injectGlobal, injectRawCSS, injector, isConfigLocked, isPropertyDefined, isSelector, isTestEnvironment, keyframes, mergeStyles, modAttrs, normalizeColorTokenValue, okhslFunction, okhslPlugin, okhstFunction, okhstPlugin, ownKeyframes, parseColor, parseStateKey, parseStyle, processTokens, property, renderStyles, resetConfig, resetStyleBatch, resolveFunctionColor, resolveRecipes, setGlobalPredefinedStates, strToRgb, stringifyStyles, styleHandlers, tastyDebug, touch };
@@ -0,0 +1,22 @@
1
+ //#region src/ssr/hydrate.d.ts
2
+ /**
3
+ * Client-side cache hydration for SSR/RSC.
4
+ *
5
+ * Registers class names rendered on the server with the client injector. If
6
+ * the runtime is not initialized yet, registration is deferred until its first
7
+ * use. With hash-based naming, only the class name list needs to cross the
8
+ * wire — no cache keys or counters.
9
+ */
10
+ /**
11
+ * Hydrate the client-side style registry from the server's class name list.
12
+ *
13
+ * Call this before ReactDOM.hydrateRoot() or ensure it runs before
14
+ * any tasty() component renders on the client.
15
+ *
16
+ * When called without arguments, reads the class list from `window.__TASTY__`
17
+ * (populated by inline scripts emitted during SSR/RSC streaming).
18
+ */
19
+ declare function hydrateTastyClasses(classes?: string[]): void;
20
+ //#endregion
21
+ export { hydrateTastyClasses as t };
22
+ //# sourceMappingURL=hydrate-CRyjjAyl.d.ts.map