@tenphi/tasty 2.0.3 → 2.0.4

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 (322) hide show
  1. package/dist/{ssr/async-storage.js → async-storage-B7_o6FKt.js} +2 -2
  2. package/dist/async-storage-B7_o6FKt.js.map +1 -0
  3. package/dist/{ssr/collector.d.ts → collector-CkZ517g4.d.ts} +3 -3
  4. package/dist/{ssr/collector.js → collector-DXqvGOb1.js} +5 -10
  5. package/dist/collector-DXqvGOb1.js.map +1 -0
  6. package/dist/config-5jzS6k6B.js +10005 -0
  7. package/dist/config-5jzS6k6B.js.map +1 -0
  8. package/dist/config-DknGsfMo.d.ts +857 -0
  9. package/dist/{ssr/context.js → context-CkSg-kDT.js} +11 -3
  10. package/dist/context-CkSg-kDT.js.map +1 -0
  11. package/dist/core/index.d.ts +5 -34
  12. package/dist/core/index.js +5 -26
  13. package/dist/core-CtU6-9OC.js +1507 -0
  14. package/dist/core-CtU6-9OC.js.map +1 -0
  15. package/dist/{zero/extractor.js → css-writer-DHkX0JuE.js} +74 -11
  16. package/dist/css-writer-DHkX0JuE.js.map +1 -0
  17. package/dist/{ssr/format-global-rules.js → format-global-rules-Dbc_1tc3.js} +2 -2
  18. package/dist/format-global-rules-Dbc_1tc3.js.map +1 -0
  19. package/dist/format-rules-DH13ewDu.js +143 -0
  20. package/dist/format-rules-DH13ewDu.js.map +1 -0
  21. package/dist/{ssr/hydrate.js → hydrate-C1Gv-DoS.js} +3 -3
  22. package/dist/hydrate-C1Gv-DoS.js.map +1 -0
  23. package/dist/{styles/types.d.ts → index-PzENbpAq.d.ts} +701 -5
  24. package/dist/index-o7zV2yCr.d.ts +1561 -0
  25. package/dist/index.d.ts +5 -51
  26. package/dist/index.js +728 -35
  27. package/dist/index.js.map +1 -0
  28. package/dist/keyframes-b7X3UxDV.js +587 -0
  29. package/dist/keyframes-b7X3UxDV.js.map +1 -0
  30. package/dist/{utils/merge-styles.d.ts → merge-styles-C7KTy7MY.d.ts} +3 -3
  31. package/dist/{utils/merge-styles.js → merge-styles-Tgo3BbL2.js} +3 -4
  32. package/dist/merge-styles-Tgo3BbL2.js.map +1 -0
  33. package/dist/{utils/resolve-recipes.js → resolve-recipes-Ca2-5CxM.js} +4 -6
  34. package/dist/resolve-recipes-Ca2-5CxM.js.map +1 -0
  35. package/dist/ssr/astro-client.js +1 -1
  36. package/dist/ssr/astro.js +4 -4
  37. package/dist/ssr/index.d.ts +44 -4
  38. package/dist/ssr/index.js +4 -4
  39. package/dist/ssr/next.d.ts +1 -1
  40. package/dist/ssr/next.js +6 -6
  41. package/dist/ssr/next.js.map +1 -1
  42. package/dist/static/index.d.ts +91 -5
  43. package/dist/static/index.js +49 -3
  44. package/dist/static/index.js.map +1 -0
  45. package/dist/zero/babel.d.ts +1 -1
  46. package/dist/zero/babel.js +10 -6
  47. package/dist/zero/babel.js.map +1 -1
  48. package/dist/zero/index.d.ts +67 -3
  49. package/dist/zero/index.js +1 -2
  50. package/package.json +3 -3
  51. package/dist/_virtual/_rolldown/runtime.js +0 -7
  52. package/dist/chunks/cacheKey.d.ts +0 -1
  53. package/dist/chunks/cacheKey.js +0 -77
  54. package/dist/chunks/cacheKey.js.map +0 -1
  55. package/dist/chunks/definitions.d.ts +0 -37
  56. package/dist/chunks/definitions.js +0 -258
  57. package/dist/chunks/definitions.js.map +0 -1
  58. package/dist/chunks/index.d.ts +0 -1
  59. package/dist/chunks/renderChunk.d.ts +0 -1
  60. package/dist/chunks/renderChunk.js +0 -59
  61. package/dist/chunks/renderChunk.js.map +0 -1
  62. package/dist/compute-styles.d.ts +0 -31
  63. package/dist/compute-styles.js +0 -322
  64. package/dist/compute-styles.js.map +0 -1
  65. package/dist/config.d.ts +0 -407
  66. package/dist/config.js +0 -591
  67. package/dist/config.js.map +0 -1
  68. package/dist/counter-style/index.js +0 -51
  69. package/dist/counter-style/index.js.map +0 -1
  70. package/dist/debug.d.ts +0 -89
  71. package/dist/debug.js +0 -453
  72. package/dist/debug.js.map +0 -1
  73. package/dist/font-face/index.js +0 -63
  74. package/dist/font-face/index.js.map +0 -1
  75. package/dist/hooks/index.d.ts +0 -7
  76. package/dist/hooks/useCounterStyle.d.ts +0 -36
  77. package/dist/hooks/useCounterStyle.js +0 -65
  78. package/dist/hooks/useCounterStyle.js.map +0 -1
  79. package/dist/hooks/useFontFace.d.ts +0 -45
  80. package/dist/hooks/useFontFace.js +0 -66
  81. package/dist/hooks/useFontFace.js.map +0 -1
  82. package/dist/hooks/useGlobalStyles.d.ts +0 -46
  83. package/dist/hooks/useGlobalStyles.js +0 -88
  84. package/dist/hooks/useGlobalStyles.js.map +0 -1
  85. package/dist/hooks/useKeyframes.d.ts +0 -58
  86. package/dist/hooks/useKeyframes.js +0 -55
  87. package/dist/hooks/useKeyframes.js.map +0 -1
  88. package/dist/hooks/useProperty.d.ts +0 -81
  89. package/dist/hooks/useProperty.js +0 -96
  90. package/dist/hooks/useProperty.js.map +0 -1
  91. package/dist/hooks/useRawCSS.d.ts +0 -22
  92. package/dist/hooks/useRawCSS.js +0 -103
  93. package/dist/hooks/useRawCSS.js.map +0 -1
  94. package/dist/hooks/useStyles.d.ts +0 -40
  95. package/dist/hooks/useStyles.js +0 -31
  96. package/dist/hooks/useStyles.js.map +0 -1
  97. package/dist/injector/index.d.ts +0 -182
  98. package/dist/injector/index.js +0 -185
  99. package/dist/injector/index.js.map +0 -1
  100. package/dist/injector/injector.d.ts +0 -198
  101. package/dist/injector/injector.js +0 -651
  102. package/dist/injector/injector.js.map +0 -1
  103. package/dist/injector/sheet-manager.d.ts +0 -132
  104. package/dist/injector/sheet-manager.js +0 -699
  105. package/dist/injector/sheet-manager.js.map +0 -1
  106. package/dist/injector/types.d.ts +0 -235
  107. package/dist/keyframes/index.js +0 -206
  108. package/dist/keyframes/index.js.map +0 -1
  109. package/dist/parser/classify.js +0 -319
  110. package/dist/parser/classify.js.map +0 -1
  111. package/dist/parser/const.js +0 -60
  112. package/dist/parser/const.js.map +0 -1
  113. package/dist/parser/lru.js +0 -109
  114. package/dist/parser/lru.js.map +0 -1
  115. package/dist/parser/parser.d.ts +0 -25
  116. package/dist/parser/parser.js +0 -115
  117. package/dist/parser/parser.js.map +0 -1
  118. package/dist/parser/tokenizer.js +0 -69
  119. package/dist/parser/tokenizer.js.map +0 -1
  120. package/dist/parser/types.d.ts +0 -51
  121. package/dist/parser/types.js +0 -46
  122. package/dist/parser/types.js.map +0 -1
  123. package/dist/pipeline/conditions.d.ts +0 -134
  124. package/dist/pipeline/conditions.js +0 -406
  125. package/dist/pipeline/conditions.js.map +0 -1
  126. package/dist/pipeline/exclusive.js +0 -389
  127. package/dist/pipeline/exclusive.js.map +0 -1
  128. package/dist/pipeline/index.d.ts +0 -55
  129. package/dist/pipeline/index.js +0 -749
  130. package/dist/pipeline/index.js.map +0 -1
  131. package/dist/pipeline/materialize-contradictions.js +0 -125
  132. package/dist/pipeline/materialize-contradictions.js.map +0 -1
  133. package/dist/pipeline/materialize.js +0 -1038
  134. package/dist/pipeline/materialize.js.map +0 -1
  135. package/dist/pipeline/parseStateKey.d.ts +0 -15
  136. package/dist/pipeline/parseStateKey.js +0 -446
  137. package/dist/pipeline/parseStateKey.js.map +0 -1
  138. package/dist/pipeline/simplify.js +0 -725
  139. package/dist/pipeline/simplify.js.map +0 -1
  140. package/dist/pipeline/warnings.js +0 -18
  141. package/dist/pipeline/warnings.js.map +0 -1
  142. package/dist/plugins/index.d.ts +0 -2
  143. package/dist/plugins/okhsl-plugin.d.ts +0 -35
  144. package/dist/plugins/okhsl-plugin.js +0 -97
  145. package/dist/plugins/okhsl-plugin.js.map +0 -1
  146. package/dist/plugins/types.d.ts +0 -87
  147. package/dist/properties/index.js +0 -222
  148. package/dist/properties/index.js.map +0 -1
  149. package/dist/properties/property-type-resolver.d.ts +0 -24
  150. package/dist/properties/property-type-resolver.js +0 -90
  151. package/dist/properties/property-type-resolver.js.map +0 -1
  152. package/dist/rsc-cache.js +0 -79
  153. package/dist/rsc-cache.js.map +0 -1
  154. package/dist/ssr/async-storage.d.ts +0 -17
  155. package/dist/ssr/async-storage.js.map +0 -1
  156. package/dist/ssr/collect-auto-properties.js +0 -58
  157. package/dist/ssr/collect-auto-properties.js.map +0 -1
  158. package/dist/ssr/collector.js.map +0 -1
  159. package/dist/ssr/context.js.map +0 -1
  160. package/dist/ssr/format-global-rules.js.map +0 -1
  161. package/dist/ssr/format-keyframes.js +0 -69
  162. package/dist/ssr/format-keyframes.js.map +0 -1
  163. package/dist/ssr/format-property.js +0 -49
  164. package/dist/ssr/format-property.js.map +0 -1
  165. package/dist/ssr/format-rules.js +0 -73
  166. package/dist/ssr/format-rules.js.map +0 -1
  167. package/dist/ssr/hydrate.d.ts +0 -29
  168. package/dist/ssr/hydrate.js.map +0 -1
  169. package/dist/ssr/ssr-collector-ref.js +0 -29
  170. package/dist/ssr/ssr-collector-ref.js.map +0 -1
  171. package/dist/states/index.d.ts +0 -49
  172. package/dist/states/index.js +0 -170
  173. package/dist/states/index.js.map +0 -1
  174. package/dist/static/tastyStatic.d.ts +0 -46
  175. package/dist/static/tastyStatic.js +0 -30
  176. package/dist/static/tastyStatic.js.map +0 -1
  177. package/dist/static/types.d.ts +0 -49
  178. package/dist/static/types.js +0 -24
  179. package/dist/static/types.js.map +0 -1
  180. package/dist/styles/border.d.ts +0 -25
  181. package/dist/styles/border.js +0 -120
  182. package/dist/styles/border.js.map +0 -1
  183. package/dist/styles/color.d.ts +0 -14
  184. package/dist/styles/color.js +0 -26
  185. package/dist/styles/color.js.map +0 -1
  186. package/dist/styles/const.js +0 -17
  187. package/dist/styles/const.js.map +0 -1
  188. package/dist/styles/createStyle.js +0 -79
  189. package/dist/styles/createStyle.js.map +0 -1
  190. package/dist/styles/dimension.js +0 -109
  191. package/dist/styles/dimension.js.map +0 -1
  192. package/dist/styles/directional.js +0 -133
  193. package/dist/styles/directional.js.map +0 -1
  194. package/dist/styles/display.d.ts +0 -30
  195. package/dist/styles/display.js +0 -73
  196. package/dist/styles/display.js.map +0 -1
  197. package/dist/styles/fade.d.ts +0 -15
  198. package/dist/styles/fade.js +0 -62
  199. package/dist/styles/fade.js.map +0 -1
  200. package/dist/styles/fill.d.ts +0 -42
  201. package/dist/styles/fill.js +0 -51
  202. package/dist/styles/fill.js.map +0 -1
  203. package/dist/styles/flow.d.ts +0 -16
  204. package/dist/styles/flow.js +0 -12
  205. package/dist/styles/flow.js.map +0 -1
  206. package/dist/styles/gap.d.ts +0 -31
  207. package/dist/styles/gap.js +0 -38
  208. package/dist/styles/gap.js.map +0 -1
  209. package/dist/styles/height.d.ts +0 -17
  210. package/dist/styles/height.js +0 -19
  211. package/dist/styles/height.js.map +0 -1
  212. package/dist/styles/index.d.ts +0 -1
  213. package/dist/styles/index.js +0 -8
  214. package/dist/styles/index.js.map +0 -1
  215. package/dist/styles/inset.d.ts +0 -24
  216. package/dist/styles/inset.js +0 -34
  217. package/dist/styles/inset.js.map +0 -1
  218. package/dist/styles/list.d.ts +0 -16
  219. package/dist/styles/list.js +0 -100
  220. package/dist/styles/list.js.map +0 -1
  221. package/dist/styles/margin.d.ts +0 -24
  222. package/dist/styles/margin.js +0 -32
  223. package/dist/styles/margin.js.map +0 -1
  224. package/dist/styles/outline.d.ts +0 -29
  225. package/dist/styles/outline.js +0 -55
  226. package/dist/styles/outline.js.map +0 -1
  227. package/dist/styles/padding.d.ts +0 -24
  228. package/dist/styles/padding.js +0 -32
  229. package/dist/styles/padding.js.map +0 -1
  230. package/dist/styles/placement.d.ts +0 -37
  231. package/dist/styles/placement.js +0 -74
  232. package/dist/styles/placement.js.map +0 -1
  233. package/dist/styles/predefined.d.ts +0 -71
  234. package/dist/styles/predefined.js +0 -237
  235. package/dist/styles/predefined.js.map +0 -1
  236. package/dist/styles/preset.d.ts +0 -52
  237. package/dist/styles/preset.js +0 -127
  238. package/dist/styles/preset.js.map +0 -1
  239. package/dist/styles/radius.d.ts +0 -12
  240. package/dist/styles/radius.js +0 -83
  241. package/dist/styles/radius.js.map +0 -1
  242. package/dist/styles/scrollMargin.d.ts +0 -24
  243. package/dist/styles/scrollMargin.js +0 -32
  244. package/dist/styles/scrollMargin.js.map +0 -1
  245. package/dist/styles/scrollbar.d.ts +0 -25
  246. package/dist/styles/scrollbar.js +0 -51
  247. package/dist/styles/scrollbar.js.map +0 -1
  248. package/dist/styles/shadow.d.ts +0 -14
  249. package/dist/styles/shadow.js +0 -25
  250. package/dist/styles/shadow.js.map +0 -1
  251. package/dist/styles/shared.js +0 -17
  252. package/dist/styles/shared.js.map +0 -1
  253. package/dist/styles/transition.d.ts +0 -14
  254. package/dist/styles/transition.js +0 -159
  255. package/dist/styles/transition.js.map +0 -1
  256. package/dist/styles/width.d.ts +0 -17
  257. package/dist/styles/width.js +0 -19
  258. package/dist/styles/width.js.map +0 -1
  259. package/dist/tasty.d.ts +0 -134
  260. package/dist/tasty.js +0 -248
  261. package/dist/tasty.js.map +0 -1
  262. package/dist/types.d.ts +0 -184
  263. package/dist/utils/cache-wrapper.js +0 -21
  264. package/dist/utils/cache-wrapper.js.map +0 -1
  265. package/dist/utils/case-converter.js +0 -8
  266. package/dist/utils/case-converter.js.map +0 -1
  267. package/dist/utils/color-math.d.ts +0 -46
  268. package/dist/utils/color-math.js +0 -749
  269. package/dist/utils/color-math.js.map +0 -1
  270. package/dist/utils/color-space.d.ts +0 -5
  271. package/dist/utils/color-space.js +0 -228
  272. package/dist/utils/color-space.js.map +0 -1
  273. package/dist/utils/colors.d.ts +0 -5
  274. package/dist/utils/colors.js +0 -10
  275. package/dist/utils/colors.js.map +0 -1
  276. package/dist/utils/css-types.d.ts +0 -7
  277. package/dist/utils/deps-equal.js +0 -15
  278. package/dist/utils/deps-equal.js.map +0 -1
  279. package/dist/utils/dotize.d.ts +0 -26
  280. package/dist/utils/dotize.js +0 -122
  281. package/dist/utils/dotize.js.map +0 -1
  282. package/dist/utils/filter-base-props.d.ts +0 -15
  283. package/dist/utils/filter-base-props.js +0 -45
  284. package/dist/utils/filter-base-props.js.map +0 -1
  285. package/dist/utils/get-display-name.d.ts +0 -7
  286. package/dist/utils/get-display-name.js +0 -10
  287. package/dist/utils/get-display-name.js.map +0 -1
  288. package/dist/utils/has-keys.js +0 -13
  289. package/dist/utils/has-keys.js.map +0 -1
  290. package/dist/utils/hash.js +0 -14
  291. package/dist/utils/hash.js.map +0 -1
  292. package/dist/utils/is-dev-env.js +0 -19
  293. package/dist/utils/is-dev-env.js.map +0 -1
  294. package/dist/utils/is-valid-element-type.js +0 -15
  295. package/dist/utils/is-valid-element-type.js.map +0 -1
  296. package/dist/utils/merge-styles.js.map +0 -1
  297. package/dist/utils/mod-attrs.d.ts +0 -6
  298. package/dist/utils/mod-attrs.js +0 -20
  299. package/dist/utils/mod-attrs.js.map +0 -1
  300. package/dist/utils/process-tokens.d.ts +0 -17
  301. package/dist/utils/process-tokens.js +0 -83
  302. package/dist/utils/process-tokens.js.map +0 -1
  303. package/dist/utils/resolve-recipes.d.ts +0 -17
  304. package/dist/utils/resolve-recipes.js.map +0 -1
  305. package/dist/utils/selector-transform.js +0 -32
  306. package/dist/utils/selector-transform.js.map +0 -1
  307. package/dist/utils/string.js +0 -8
  308. package/dist/utils/string.js.map +0 -1
  309. package/dist/utils/styles.d.ts +0 -99
  310. package/dist/utils/styles.js +0 -220
  311. package/dist/utils/styles.js.map +0 -1
  312. package/dist/utils/typography.d.ts +0 -58
  313. package/dist/utils/typography.js +0 -51
  314. package/dist/utils/typography.js.map +0 -1
  315. package/dist/utils/warnings.d.ts +0 -16
  316. package/dist/utils/warnings.js +0 -16
  317. package/dist/utils/warnings.js.map +0 -1
  318. package/dist/zero/css-writer.d.ts +0 -45
  319. package/dist/zero/css-writer.js +0 -73
  320. package/dist/zero/css-writer.js.map +0 -1
  321. package/dist/zero/extractor.d.ts +0 -24
  322. package/dist/zero/extractor.js.map +0 -1
@@ -0,0 +1,857 @@
1
+ import { Ct as RootRegistry, Dt as StyleRule, Et as StyleInjectorConfig, M as StyleHandlerDefinition, St as RawCSSResult, Tt as SheetInfo, b as Styles, bt as KeyframesSteps, ct as CacheMetrics, dt as FontFaceDescriptors, ft as FontFaceInput, gt as InjectResult, h as ConfigTokens, ht as GlobalInjectResult, it as StyleDetails, lt as CounterStyleDescriptors, mt as GCOptions, n as StyleResult, ot as UnitHandler, pt as GCConfig, v as RecipeStyles, vt as KeyframesInfo, wt as RuleInfo, xt as PropertyDefinition, yt as KeyframesResult } from "./index-PzENbpAq.js";
2
+
3
+ //#region src/injector/sheet-manager.d.ts
4
+ declare class SheetManager {
5
+ private rootRegistries;
6
+ /** Strong set of active roots so background GC can iterate them all */
7
+ private activeRoots;
8
+ private config;
9
+ /** Dedicated style elements for raw CSS per root */
10
+ private rawStyleElements;
11
+ /** Tracking for raw CSS blocks per root */
12
+ private rawCSSBlocks;
13
+ /** Counter for generating unique raw CSS IDs */
14
+ private rawCSSCounter;
15
+ constructor(config: StyleInjectorConfig);
16
+ /**
17
+ * Get or create registry for a root (Document or ShadowRoot)
18
+ */
19
+ getRegistry(root: Document | ShadowRoot): RootRegistry;
20
+ /** Return all roots with active registries (for background GC sweep). */
21
+ getActiveRoots(): Iterable<Document | ShadowRoot>;
22
+ /** Check whether any roots have active registries. */
23
+ hasActiveRoots(): boolean;
24
+ /** Remove registries for ShadowRoots whose host has been detached from the DOM. */
25
+ pruneDisconnectedRoots(): void;
26
+ /**
27
+ * Create a new stylesheet for the registry
28
+ */
29
+ createSheet(registry: RootRegistry, root: Document | ShadowRoot): SheetInfo;
30
+ /**
31
+ * Create a style element and append to document
32
+ */
33
+ private createStyleElement;
34
+ /**
35
+ * Insert CSS rules as a single block
36
+ */
37
+ insertRule(registry: RootRegistry, flattenedRules: StyleRule[], className: string, root: Document | ShadowRoot): RuleInfo | null;
38
+ /**
39
+ * Insert global CSS rules
40
+ */
41
+ insertGlobalRule(registry: RootRegistry, flattenedRules: StyleRule[], globalKey: string, root: Document | ShadowRoot): RuleInfo | null;
42
+ /**
43
+ * Delete a global CSS rule by key
44
+ */
45
+ deleteGlobalRule(registry: RootRegistry, globalKey: string): void;
46
+ /**
47
+ * Adjust rule indices after deletion to account for shifting
48
+ */
49
+ private adjustIndicesAfterDeletion;
50
+ /**
51
+ * Delete a CSS rule from the sheet
52
+ */
53
+ deleteRule(registry: RootRegistry, ruleInfo: RuleInfo): void;
54
+ /**
55
+ * Find a sheet with available space or return null
56
+ */
57
+ private findAvailableSheet;
58
+ /**
59
+ * Find an available rule index in the sheet
60
+ */
61
+ findAvailableRuleIndex(sheet: SheetInfo): number;
62
+ /**
63
+ * Force cleanup of unused styles
64
+ */
65
+ forceCleanup(registry: RootRegistry): void;
66
+ /**
67
+ * Perform bulk cleanup of all unused styles (refCount = 0).
68
+ */
69
+ private performBulkCleanup;
70
+ /**
71
+ * Get total number of rules across all sheets
72
+ */
73
+ getTotalRuleCount(registry: RootRegistry): number;
74
+ /**
75
+ * Get CSS text from all sheets (for SSR)
76
+ */
77
+ getCssText(registry: RootRegistry): string;
78
+ /**
79
+ * Get cache performance metrics
80
+ */
81
+ getMetrics(registry: RootRegistry): CacheMetrics | null;
82
+ /**
83
+ * Reset cache performance metrics
84
+ */
85
+ resetMetrics(registry: RootRegistry): void;
86
+ /**
87
+ * Convert keyframes steps to CSS string.
88
+ * Public so the SSR collector can format keyframes without DOM access.
89
+ * Returns both the CSS text and a combined declarations string for property type scanning.
90
+ */
91
+ stepsToCSS(steps: KeyframesSteps): {
92
+ css: string;
93
+ declarations: string;
94
+ };
95
+ /**
96
+ * Insert keyframes rule.
97
+ * Returns the KeyframesInfo and the raw declarations string for property type scanning.
98
+ */
99
+ insertKeyframes(registry: RootRegistry, steps: KeyframesSteps, name: string, root: Document | ShadowRoot): {
100
+ info: KeyframesInfo;
101
+ declarations: string;
102
+ } | null;
103
+ /**
104
+ * Delete keyframes rule
105
+ */
106
+ deleteKeyframes(registry: RootRegistry, info: KeyframesInfo): void;
107
+ /**
108
+ * Clean up resources for a root
109
+ */
110
+ cleanup(root: Document | ShadowRoot): void;
111
+ /**
112
+ * Get or create a dedicated style element for raw CSS
113
+ * Raw CSS is kept separate from tasty-managed sheets to avoid index conflicts
114
+ */
115
+ private getOrCreateRawStyleElement;
116
+ /**
117
+ * Inject raw CSS text directly without parsing
118
+ * Returns a dispose function to remove the injected CSS
119
+ */
120
+ injectRawCSS(css: string, root: Document | ShadowRoot): RawCSSResult;
121
+ /**
122
+ * Remove a raw CSS block by ID
123
+ */
124
+ private disposeRawCSS;
125
+ /**
126
+ * Get the raw CSS content for SSR
127
+ */
128
+ getRawCSSText(root: Document | ShadowRoot): string;
129
+ }
130
+ //#endregion
131
+ //#region src/injector/injector.d.ts
132
+ declare class StyleInjector {
133
+ private sheetManager;
134
+ private config;
135
+ private globalRuleCounter;
136
+ private pendingGCHandle;
137
+ /** @internal — exposed for debug utilities only */
138
+ get _sheetManager(): SheetManager;
139
+ constructor(config?: StyleInjectorConfig);
140
+ /**
141
+ * Check if `className` was hydrated from server-rendered styles and,
142
+ * if so, wire the cacheKey mapping. Returns true on hit.
143
+ */
144
+ private tryHydratedHit;
145
+ /**
146
+ * Allocate a className for a cacheKey without injecting styles yet.
147
+ * This allows separating className allocation (render phase) from style injection (insertion phase).
148
+ */
149
+ allocateClassName(cacheKey: string, options?: {
150
+ root?: Document | ShadowRoot;
151
+ }): {
152
+ className: string;
153
+ isNewAllocation: boolean;
154
+ };
155
+ /**
156
+ * Inject styles from StyleResult objects
157
+ */
158
+ inject(rules: StyleResult[], options?: {
159
+ root?: Document | ShadowRoot;
160
+ cacheKey?: string;
161
+ }): InjectResult;
162
+ /**
163
+ * Inject global styles (rules without a generated tasty class selector)
164
+ * This ensures we don't reserve a tasty class name (t{number}) for global rules,
165
+ * which could otherwise collide with element-level styles and break lookups.
166
+ */
167
+ injectGlobal(rules: StyleResult[], options?: {
168
+ root?: Document | ShadowRoot;
169
+ }): GlobalInjectResult;
170
+ /**
171
+ * Inject raw CSS text directly without parsing
172
+ * This is a low-overhead alternative to createGlobalStyle for raw CSS
173
+ * The CSS is inserted into a separate style element to avoid conflicts with tasty's chunking
174
+ */
175
+ injectRawCSS(css: string, options?: {
176
+ root?: Document | ShadowRoot;
177
+ }): RawCSSResult;
178
+ /**
179
+ * Get raw CSS text for SSR
180
+ */
181
+ getRawCSSText(options?: {
182
+ root?: Document | ShadowRoot;
183
+ }): string;
184
+ /**
185
+ * Increment refCount for an already-injected cacheKey and return a dispose.
186
+ * Used by useStyles on cache hits (hydration or runtime reuse) where
187
+ * the pipeline was skipped but refCount tracking is still needed.
188
+ * Returns null if the cacheKey is not found.
189
+ */
190
+ trackRef(cacheKey: string, options?: {
191
+ root?: Document | ShadowRoot;
192
+ }): InjectResult | null;
193
+ /**
194
+ * Dispose of a className (decrements refCount only).
195
+ */
196
+ private dispose;
197
+ /**
198
+ * Force bulk cleanup of unused styles
199
+ */
200
+ cleanup(root?: Document | ShadowRoot): void;
201
+ /**
202
+ * Get CSS text from all sheets (for SSR)
203
+ */
204
+ getCssText(options?: {
205
+ root?: Document | ShadowRoot;
206
+ }): string;
207
+ /**
208
+ * Get CSS only for the provided tasty classNames (e.g., ["t0","t3"])
209
+ */
210
+ getCssTextForClasses(classNames: Iterable<string>, options?: {
211
+ root?: Document | ShadowRoot;
212
+ }): string;
213
+ /**
214
+ * Get cache performance metrics
215
+ */
216
+ getMetrics(options?: {
217
+ root?: Document | ShadowRoot;
218
+ }): CacheMetrics | null;
219
+ /**
220
+ * Reset cache performance metrics
221
+ */
222
+ resetMetrics(options?: {
223
+ root?: Document | ShadowRoot;
224
+ }): void;
225
+ /**
226
+ * Define a CSS @property custom property.
227
+ *
228
+ * Accepts tasty token syntax for the property name:
229
+ * - `$name` → defines `--name`
230
+ * - `#name` → defines `--name-color` (auto-sets syntax: '<color>', defaults initialValue: 'transparent')
231
+ * - `--name` → defines `--name` (legacy format)
232
+ *
233
+ * Example:
234
+ * @property --rotation { syntax: "<angle>"; inherits: false; initial-value: 45deg; }
235
+ *
236
+ * Note: No caching or dispose — this defines a global property.
237
+ *
238
+ * If the same property is registered with different options, a warning is emitted
239
+ * but the original definition is preserved (CSS @property cannot be redefined).
240
+ */
241
+ property(name: string, options?: PropertyDefinition & {
242
+ root?: Document | ShadowRoot;
243
+ }): void;
244
+ /**
245
+ * Check whether a given @property name was already injected by this injector.
246
+ *
247
+ * Accepts tasty token syntax:
248
+ * - `$name` → checks `--name`
249
+ * - `#name` → checks `--name-color`
250
+ * - `--name` → checks `--name` (legacy format)
251
+ */
252
+ isPropertyDefined(name: string, options?: {
253
+ root?: Document | ShadowRoot;
254
+ }): boolean;
255
+ /**
256
+ * Inject a CSS @font-face rule.
257
+ *
258
+ * Permanent and global — no dispose or ref-counting.
259
+ * Deduplicates by content hash (family + descriptors).
260
+ */
261
+ fontFace(family: string, descriptors: FontFaceDescriptors, options?: {
262
+ root?: Document | ShadowRoot;
263
+ }): void;
264
+ /**
265
+ * Inject a CSS @counter-style rule.
266
+ *
267
+ * Permanent and global — no dispose or ref-counting.
268
+ * Deduplicates by name (first definition wins).
269
+ */
270
+ counterStyle(name: string, descriptors: CounterStyleDescriptors, options?: {
271
+ root?: Document | ShadowRoot;
272
+ }): void;
273
+ /**
274
+ * Inject keyframes and return object with toString() and dispose()
275
+ *
276
+ * Keyframes are cached by content (steps). If the same content is injected
277
+ * multiple times with different provided names, the first injected name is reused.
278
+ *
279
+ * If the same name is provided with different content (collision), a unique
280
+ * name is generated to avoid overwriting the existing keyframes.
281
+ */
282
+ keyframes(steps: KeyframesSteps, nameOrOptions?: string | {
283
+ root?: Document | ShadowRoot;
284
+ name?: string;
285
+ }): KeyframesResult;
286
+ /**
287
+ * Dispose keyframes
288
+ */
289
+ private disposeKeyframes;
290
+ private static readonly TASTY_CLASS_RE;
291
+ /**
292
+ * Record a render-time usage hit for one or more classNames.
293
+ * Handles space-separated multi-chunk classNames.
294
+ * When the global touch counter reaches `touchInterval`, schedules a GC
295
+ * via `requestIdleCallback`.
296
+ * No-op on the server.
297
+ */
298
+ touch(className: string, options?: {
299
+ root?: Document | ShadowRoot;
300
+ }): void;
301
+ /**
302
+ * Schedule a GC via `requestIdleCallback` (or synchronously as fallback).
303
+ * Runs GC on all active roots. Avoids double-scheduling via `pendingGCHandle`.
304
+ */
305
+ private scheduleGC;
306
+ /**
307
+ * Synchronous garbage collection.
308
+ *
309
+ * 1. Quick upper-bound check: skip if unused count can't exceed capacity.
310
+ * 2. Scans the DOM for live tasty classNames (safety guard).
311
+ * 3. With `force: true`: deletes all unused entries inline.
312
+ * Without `force`: collects unused, sorts oldest-first, evicts over capacity.
313
+ *
314
+ * @returns Number of styles evicted.
315
+ */
316
+ gc(options?: GCOptions): number;
317
+ /**
318
+ * Destroy all resources for a root
319
+ */
320
+ destroy(root?: Document | ShadowRoot): void;
321
+ }
322
+ //#endregion
323
+ //#region src/utils/color-space.d.ts
324
+ type ColorSpace = 'rgb' | 'hsl' | 'oklch';
325
+ //#endregion
326
+ //#region src/utils/typography.d.ts
327
+ /**
328
+ * A typography token value: plain value or a state map for responsive/theme-aware presets.
329
+ *
330
+ * @example
331
+ * // Plain value
332
+ * fontWeight: '400'
333
+ * // State map
334
+ * fontWeight: { '': '400', '@dark': '300' }
335
+ */
336
+ type TypographyTokenValue = string | number | Record<string, string | number | undefined | null | '@inherit'>;
337
+ /**
338
+ * Typography preset configuration.
339
+ * Each preset defines font properties that get expanded into CSS custom properties.
340
+ * All fields accept plain values or state maps for responsive/theme-aware tokens.
341
+ *
342
+ * Use with `generateTypographyTokens()` to create typography tokens for your design system.
343
+ */
344
+ interface TypographyPreset {
345
+ fontSize: TypographyTokenValue;
346
+ lineHeight: TypographyTokenValue;
347
+ letterSpacing?: TypographyTokenValue;
348
+ fontWeight: TypographyTokenValue;
349
+ boldFontWeight?: TypographyTokenValue;
350
+ iconSize?: TypographyTokenValue;
351
+ textTransform?: TypographyTokenValue;
352
+ fontFamily?: TypographyTokenValue;
353
+ fontStyle?: TypographyTokenValue;
354
+ }
355
+ /**
356
+ * Generate typography tokens with $ prefix for CSS custom properties.
357
+ *
358
+ * Each preset generates the following CSS custom properties:
359
+ * - `${name}-font-size`
360
+ * - `${name}-line-height`
361
+ * - `${name}-letter-spacing`
362
+ * - `${name}-font-weight`
363
+ * - `${name}-bold-font-weight` (if defined)
364
+ * - `${name}-icon-size` (if defined)
365
+ * - `${name}-text-transform` (if defined)
366
+ * - `${name}-font-family` (if defined)
367
+ * - `${name}-font-style` (if defined)
368
+ *
369
+ * @param presets - Typography presets object
370
+ * @returns ConfigTokens object with $ prefixed keys
371
+ *
372
+ * @example
373
+ * const customTokens = generateTypographyTokens({
374
+ * myHeading: { fontSize: '24px', lineHeight: '32px', fontWeight: '700' },
375
+ * body: { fontSize: '16px', lineHeight: '24px', fontWeight: '400' },
376
+ * });
377
+ */
378
+ declare function generateTypographyTokens(presets: Record<string, TypographyPreset>): ConfigTokens;
379
+ //#endregion
380
+ //#region src/plugins/types.d.ts
381
+ /**
382
+ * A tasty plugin that extends the style system with custom functions, units, states, or handlers.
383
+ */
384
+ interface TastyPlugin {
385
+ /** Unique name for the plugin (used for debugging and conflict detection) */
386
+ name: string;
387
+ /** Custom functions that transform parsed style groups into CSS values */
388
+ funcs?: Record<string, (groups: StyleDetails[]) => string>;
389
+ /** Custom units that transform numeric values (e.g., `2x` → `calc(2 * var(--gap))`) */
390
+ units?: Record<string, string | UnitHandler>;
391
+ /** Custom state aliases (e.g., `'@mobile': '@media(w < 768px)'`) */
392
+ states?: Record<string, string>;
393
+ /**
394
+ * Custom style handlers that transform style properties into CSS declarations.
395
+ * Handlers replace built-in handlers for the same style name.
396
+ * @example
397
+ * ```ts
398
+ * handlers: {
399
+ * // Simple handler - lookup style inferred from key
400
+ * fill: ({ fill }) => fill ? { 'background-color': fill } : undefined,
401
+ * // Multi-property handler
402
+ * spacing: [['gap', 'padding'], ({ gap, padding }) => ({ ... })],
403
+ * }
404
+ * ```
405
+ */
406
+ handlers?: Record<string, StyleHandlerDefinition>;
407
+ /**
408
+ * Design tokens injected as CSS custom properties on `:root`.
409
+ * Values are parsed through the Tasty DSL. Supports state maps.
410
+ * - `$name` → `--name` CSS custom property
411
+ * - `#name` → `--name-color` and `--name-color-{colorSpace}`
412
+ */
413
+ tokens?: ConfigTokens;
414
+ /** Predefined tokens replaced during style parsing (`$name` or `#name`) */
415
+ replaceTokens?: Record<`$${string}` | `#${string}`, string | number>;
416
+ /**
417
+ * Predefined style recipes -- named style bundles that can be applied via `recipe` style property.
418
+ * Recipe values are flat tasty styles (no sub-element keys).
419
+ * @example
420
+ * ```ts
421
+ * recipes: {
422
+ * card: { padding: '4x', fill: '#surface', radius: '1r', border: true },
423
+ * elevated: { shadow: '2x 2x 4x #shadow' },
424
+ * }
425
+ * ```
426
+ */
427
+ recipes?: Record<string, RecipeStyles>;
428
+ /**
429
+ * Typography presets — shorthand for `generateTypographyTokens()`.
430
+ * Generated tokens are merged under explicit `tokens` (tokens win on conflict).
431
+ */
432
+ presets?: Record<string, TypographyPreset>;
433
+ /**
434
+ * Global Tasty styles keyed by CSS selector.
435
+ * Supports the full Tasty style syntax.
436
+ */
437
+ globalStyles?: Record<string, Styles>;
438
+ }
439
+ /**
440
+ * A factory function that creates a TastyPlugin.
441
+ * Can optionally accept configuration options.
442
+ *
443
+ * @example
444
+ * ```ts
445
+ * // Plugin without options
446
+ * const okhslPlugin: TastyPluginFactory = () => ({
447
+ * name: 'okhsl',
448
+ * funcs: { okhsl: okhslFunc },
449
+ * });
450
+ *
451
+ * // Plugin with options
452
+ * const debugPlugin: TastyPluginFactory<{ verbose: boolean }> = (options) => ({
453
+ * name: 'debug',
454
+ * funcs: { debug: createDebugFunc(options.verbose) },
455
+ * });
456
+ * ```
457
+ */
458
+ type TastyPluginFactory<TOptions = void> = TOptions extends void ? () => TastyPlugin : (options: TOptions) => TastyPlugin;
459
+ //#endregion
460
+ //#region src/config.d.ts
461
+ /**
462
+ * Configuration options for the Tasty style system
463
+ */
464
+ interface TastyConfig {
465
+ /** CSP nonce for style elements */
466
+ nonce?: string;
467
+ /** Maximum rules per stylesheet (default: 8192) */
468
+ maxRulesPerSheet?: number;
469
+ /** Force text injection mode, auto-detected in test environments (default: auto) */
470
+ forceTextInjection?: boolean;
471
+ /** Enable development mode features: performance metrics and debug info (default: auto) */
472
+ devMode?: boolean;
473
+ /**
474
+ * Global predefined states for advanced state mapping.
475
+ * These are state aliases that can be used in any component.
476
+ * Example: { '@mobile': '@media(w < 920px)', '@dark': '@root(theme=dark)' }
477
+ */
478
+ states?: Record<string, string>;
479
+ /**
480
+ * Parser LRU cache size (default: 1000).
481
+ * Larger values improve performance for apps with many unique style values.
482
+ */
483
+ parserCacheSize?: number;
484
+ /**
485
+ * Custom units for the style parser (merged with built-in units).
486
+ * Units transform numeric values like `2x` → `calc(2 * var(--gap))`.
487
+ * @example { em: 'em', vw: 'vw', custom: (n) => `${n * 10}px` }
488
+ */
489
+ units?: Record<string, string | UnitHandler>;
490
+ /**
491
+ * Custom functions for the style parser (merged with existing).
492
+ * Functions process parsed style groups and return CSS values.
493
+ * @example { myFunc: (groups) => groups.map(g => g.output).join(' ') }
494
+ */
495
+ funcs?: Record<string, (groups: StyleDetails[]) => string>;
496
+ /**
497
+ * Color space used for decomposed color token companion variables.
498
+ * Controls the CSS function and suffix for alpha composition.
499
+ *
500
+ * - `'rgb'` — suffix `-rgb`, e.g. `rgb(var(--name-color-rgb) / .5)`
501
+ * - `'hsl'` — suffix `-hsl`, e.g. `hsl(var(--name-color-hsl) / .5)`
502
+ * - `'oklch'` — suffix `-oklch`, e.g. `oklch(var(--name-color-oklch) / .5)`
503
+ *
504
+ * @default 'oklch'
505
+ */
506
+ colorSpace?: ColorSpace;
507
+ /**
508
+ * Automatically infer and register CSS @property declarations
509
+ * from custom property values found in styles, keyframes, and global config.
510
+ * Covers all types: \<color\>, \<number\>, \<length\>, \<angle\>, \<percentage\>, \<time\>.
511
+ * When false, only explicitly declared @properties are registered.
512
+ * @default true
513
+ */
514
+ autoPropertyTypes?: boolean;
515
+ /**
516
+ * Garbage collection configuration for unused styles.
517
+ * GC is triggered by touch count: every `touchInterval` touches, the
518
+ * oldest unused styles are evicted when their count exceeds `capacity`.
519
+ * @example
520
+ * ```ts
521
+ * configure({
522
+ * gc: { touchInterval: 1000, capacity: 1000 },
523
+ * });
524
+ * ```
525
+ */
526
+ gc?: GCConfig;
527
+ /**
528
+ * Plugins that extend tasty with custom functions, units, or states.
529
+ * Plugins are processed in order, with later plugins overriding earlier ones.
530
+ * @example
531
+ * ```ts
532
+ * import { okhslPlugin } from '@tenphi/tasty';
533
+ *
534
+ * configure({
535
+ * plugins: [okhslPlugin()],
536
+ * });
537
+ * ```
538
+ */
539
+ plugins?: TastyPlugin[];
540
+ /**
541
+ * Global keyframes definitions that can be referenced by animation names in styles.
542
+ * Keys are animation names, values are keyframes step definitions.
543
+ * Keyframes are only injected when actually used in styles.
544
+ * @example
545
+ * ```ts
546
+ * configure({
547
+ * keyframes: {
548
+ * fadeIn: { from: { opacity: 0 }, to: { opacity: 1 } },
549
+ * pulse: { '0%, 100%': { transform: 'scale(1)' }, '50%': { transform: 'scale(1.05)' } },
550
+ * },
551
+ * });
552
+ * ```
553
+ */
554
+ keyframes?: Record<string, KeyframesSteps>;
555
+ /**
556
+ * Global CSS @property definitions for custom properties.
557
+ * Keys use tasty token syntax ($name for properties, #name for colors).
558
+ *
559
+ * Tasty ships with `DEFAULT_PROPERTIES` (e.g. `$gap`, `$radius`, `#white`,
560
+ * `#black`, `#clear`, `#border`, etc.) that are always included.
561
+ * Properties you specify here are merged on top, so you can override any
562
+ * default by using the same key.
563
+ *
564
+ * For color tokens (#name), `syntax: '<color>'` is auto-set and
565
+ * `initialValue` defaults to `'transparent'` if not specified.
566
+ *
567
+ * @example
568
+ * ```ts
569
+ * configure({
570
+ * properties: {
571
+ * '$rotation': { syntax: '<angle>', initialValue: '0deg' },
572
+ * '$scale': { syntax: '<number>', inherits: false, initialValue: 1 },
573
+ * '#accent': { initialValue: 'purple' }, // syntax: '<color>' auto-set
574
+ * // Override a default property:
575
+ * '$gap': { syntax: '<length>', inherits: true, initialValue: '8px' },
576
+ * },
577
+ * });
578
+ *
579
+ * // Now use in styles - properties are registered when component renders:
580
+ * const Spinner = tasty({
581
+ * styles: {
582
+ * transform: 'rotate($rotation)',
583
+ * transition: '$$rotation 0.3s', // outputs: --rotation 0.3s
584
+ * },
585
+ * });
586
+ * ```
587
+ */
588
+ properties?: Record<string, PropertyDefinition>;
589
+ /**
590
+ * Global @font-face definitions.
591
+ * Keys are font-family names, values are descriptors or arrays of descriptors
592
+ * (for multiple weights/styles of the same family).
593
+ * Injected eagerly when styles are first generated.
594
+ * @example
595
+ * ```ts
596
+ * configure({
597
+ * fontFace: {
598
+ * 'Brand Sans': [
599
+ * { src: 'url("/fonts/brand-regular.woff2") format("woff2")', fontWeight: 400, fontDisplay: 'swap' },
600
+ * { src: 'url("/fonts/brand-bold.woff2") format("woff2")', fontWeight: 700, fontDisplay: 'swap' },
601
+ * ],
602
+ * Icons: { src: 'url("/fonts/icons.woff2") format("woff2")', fontDisplay: 'block' },
603
+ * },
604
+ * });
605
+ * ```
606
+ */
607
+ fontFace?: Record<string, FontFaceInput>;
608
+ /**
609
+ * Global @counter-style definitions.
610
+ * Keys are counter-style names, values are descriptor objects.
611
+ * Injected eagerly when styles are first generated.
612
+ * @example
613
+ * ```ts
614
+ * configure({
615
+ * counterStyle: {
616
+ * thumbs: { system: 'cyclic', symbols: '"👍"', suffix: '" "' },
617
+ * },
618
+ * });
619
+ * ```
620
+ */
621
+ counterStyle?: Record<string, CounterStyleDescriptors>;
622
+ /**
623
+ * Custom style handlers that transform style properties into CSS declarations.
624
+ * Handlers replace built-in handlers for the same style name.
625
+ * @example
626
+ * ```ts
627
+ * import { styleHandlers } from '@tenphi/tasty';
628
+ *
629
+ * configure({
630
+ * handlers: {
631
+ * // Override fill with custom behavior
632
+ * fill: ({ fill }) => {
633
+ * if (fill?.startsWith('gradient:')) {
634
+ * return { background: fill.slice(9) };
635
+ * }
636
+ * return styleHandlers.fill({ fill });
637
+ * },
638
+ * // Add new custom style
639
+ * elevation: ({ elevation }) => {
640
+ * const level = parseInt(elevation) || 1;
641
+ * return {
642
+ * 'box-shadow': `0 ${level * 2}px ${level * 4}px rgba(0,0,0,0.1)`,
643
+ * 'z-index': String(level * 100),
644
+ * };
645
+ * },
646
+ * },
647
+ * });
648
+ * ```
649
+ */
650
+ handlers?: Record<string, StyleHandlerDefinition>;
651
+ /**
652
+ * Design tokens injected as CSS custom properties on `:root`.
653
+ * Values are parsed through the Tasty DSL. Supports state maps
654
+ * for responsive/theme-aware tokens.
655
+ *
656
+ * - `$name` keys become `--name` CSS custom properties
657
+ * - `#name` keys become `--name-color` and `--name-color-{colorSpace}` properties
658
+ *
659
+ * Tokens are injected once when the first style is rendered.
660
+ *
661
+ * @example
662
+ * ```ts
663
+ * configure({
664
+ * tokens: {
665
+ * '$gap': '4px',
666
+ * '#primary': {
667
+ * '': '#purple',
668
+ * '@dark': '#light-purple',
669
+ * },
670
+ * },
671
+ * });
672
+ * ```
673
+ */
674
+ tokens?: ConfigTokens;
675
+ /**
676
+ * Predefined tokens that are replaced during style parsing (parse-time substitution).
677
+ * Use `$name` for custom properties and `#name` for color tokens.
678
+ * Values are substituted inline before CSS generation, unlike `tokens` which
679
+ * inject CSS custom properties on `:root`.
680
+ *
681
+ * For color tokens (#name), boolean `true` is converted to `transparent`.
682
+ *
683
+ * @example
684
+ * ```ts
685
+ * configure({
686
+ * replaceTokens: {
687
+ * $spacing: '2x',
688
+ * '#accent': '#purple',
689
+ * '#overlay': true, // → transparent
690
+ * },
691
+ * });
692
+ *
693
+ * // Now use in styles - tokens are replaced at parse time:
694
+ * const Card = tasty({
695
+ * styles: {
696
+ * padding: '$spacing', // → calc(2 * var(--gap))
697
+ * fill: '#accent', // → var(--purple-color)
698
+ * },
699
+ * });
700
+ * ```
701
+ */
702
+ replaceTokens?: Record<`$${string}`, string | number | boolean> & Record<`#${string}`, string | number | boolean>;
703
+ /**
704
+ * Predefined style recipes -- named style bundles that can be applied via `recipe` style property.
705
+ * Recipe values are flat tasty styles (no sub-element keys). They may contain base styles,
706
+ * tokens (`$name`/`#name` definitions), local states, `@keyframes`, and `@properties`.
707
+ *
708
+ * Components reference recipes via: `recipe: 'name1 name2'` in their styles.
709
+ * Use `/` to separate base recipes from post recipes: `recipe: 'base1 base2 / post1'`.
710
+ * Use `none` to skip base recipes: `recipe: 'none / post1'`.
711
+ * Resolution order: `base_recipes → component styles → post_recipes`.
712
+ *
713
+ * Recipes cannot reference other recipes.
714
+ *
715
+ * @example
716
+ * ```ts
717
+ * configure({
718
+ * recipes: {
719
+ * card: { padding: '4x', fill: '#surface', radius: '1r', border: true },
720
+ * elevated: { shadow: '2x 2x 4x #shadow' },
721
+ * },
722
+ * });
723
+ *
724
+ * // Usage in styles:
725
+ * const Card = tasty({
726
+ * styles: {
727
+ * recipe: 'card elevated',
728
+ * color: '#text', // Overrides recipe values
729
+ * },
730
+ * });
731
+ * ```
732
+ */
733
+ recipes?: Record<string, RecipeStyles>;
734
+ /**
735
+ * Typography presets — shorthand for `generateTypographyTokens()`.
736
+ * Accepts the same input and internally generates typography tokens
737
+ * that are merged into `tokens`. Explicit `tokens` override preset-generated ones.
738
+ *
739
+ * @example
740
+ * ```ts
741
+ * configure({
742
+ * presets: {
743
+ * h1: { fontSize: '32px', lineHeight: '1.2', fontWeight: '700' },
744
+ * t2: { fontSize: '16px', lineHeight: '1.5', fontWeight: '400' },
745
+ * },
746
+ * tokens: {
747
+ * // Overrides the preset-generated $t2-font-weight
748
+ * '$t2-font-weight': { '': '400', '@dark': '300' },
749
+ * },
750
+ * });
751
+ * ```
752
+ */
753
+ presets?: Record<string, TypographyPreset>;
754
+ /**
755
+ * Global Tasty styles keyed by CSS selector.
756
+ * Each entry applies the full Tasty style syntax (style properties,
757
+ * tokens, state maps, selector-based sub-styling) to the given selector.
758
+ * Injected alongside `:root` tokens when the first style is rendered.
759
+ *
760
+ * @example
761
+ * ```ts
762
+ * configure({
763
+ * globalStyles: {
764
+ * body: { fill: '#surface', color: '#text', preset: 't2', margin: 0 },
765
+ * html: { overflow: 'hidden' },
766
+ * },
767
+ * });
768
+ * ```
769
+ */
770
+ globalStyles?: Record<string, Styles>;
771
+ }
772
+ declare const GLOBAL_INJECTOR_KEY = "__TASTY_GLOBAL_INJECTOR__";
773
+ declare global {
774
+ interface Window {
775
+ [GLOBAL_INJECTOR_KEY]?: StyleInjector;
776
+ }
777
+ var __TASTY_GLOBAL_INJECTOR__: StyleInjector | undefined;
778
+ }
779
+ /**
780
+ * Detect if we're running in a test environment
781
+ */
782
+ declare function isTestEnvironment(): boolean;
783
+ /**
784
+ * Check if styles have been generated (configuration is locked)
785
+ */
786
+ declare function hasStylesGenerated(): boolean;
787
+ /**
788
+ * Check if any global keyframes are configured.
789
+ * Uses a pre-computed flag to avoid Object.keys() allocation on every call.
790
+ */
791
+ declare function hasGlobalKeyframes(): boolean;
792
+ /**
793
+ * Get global keyframes configuration.
794
+ * Returns null if no keyframes configured (fast path for zero-overhead).
795
+ */
796
+ declare function getGlobalKeyframes(): Record<string, KeyframesSteps> | null;
797
+ /**
798
+ * Get global font-face configuration.
799
+ * Returns null if no font faces configured.
800
+ * Reads from globalThis first for cross-module SSR support.
801
+ */
802
+ declare function getGlobalFontFace(): Record<string, FontFaceInput> | null;
803
+ /**
804
+ * Get global counter-style configuration.
805
+ * Returns null if no counter styles configured.
806
+ * Reads from globalThis first for cross-module SSR support.
807
+ */
808
+ declare function getGlobalCounterStyle(): Record<string, CounterStyleDescriptors> | null;
809
+ /**
810
+ * Check if any global recipes are configured.
811
+ * Fast path: returns false if no recipes were ever set.
812
+ */
813
+ declare function hasGlobalRecipes(): boolean;
814
+ /**
815
+ * Get global recipes configuration.
816
+ * Returns null if no recipes configured (fast path for zero-overhead).
817
+ */
818
+ declare function getGlobalRecipes(): Record<string, RecipeStyles> | null;
819
+ /**
820
+ * Check if configuration is locked (styles have been generated)
821
+ */
822
+ declare function isConfigLocked(): boolean;
823
+ /**
824
+ * Configure the Tasty style system.
825
+ *
826
+ * Must be called BEFORE any styles are generated (before first render that uses tasty).
827
+ * After styles are generated, configuration is locked and calls to configure() will
828
+ * emit a warning and be ignored.
829
+ *
830
+ * @example
831
+ * ```ts
832
+ * import { configure } from '@tenphi/tasty';
833
+ *
834
+ * // Configure before app renders
835
+ * configure({
836
+ * nonce: 'abc123',
837
+ * states: {
838
+ * '@mobile': '@media(w < 768px)',
839
+ * '@dark': '@root(theme=dark)',
840
+ * },
841
+ * });
842
+ * ```
843
+ */
844
+ declare function configure(config?: Partial<TastyConfig>): void;
845
+ /**
846
+ * Get the current configuration.
847
+ * If not configured, returns default configuration.
848
+ */
849
+ declare function getConfig(): TastyConfig;
850
+ /**
851
+ * Reset configuration (for testing only).
852
+ * Clears the global injector and allows reconfiguration.
853
+ */
854
+ declare function resetConfig(): void;
855
+ //#endregion
856
+ export { TypographyTokenValue as _, getGlobalFontFace as a, StyleInjector as b, hasGlobalKeyframes as c, isConfigLocked as d, isTestEnvironment as f, TypographyPreset as g, TastyPluginFactory as h, getGlobalCounterStyle as i, hasGlobalRecipes as l, TastyPlugin as m, configure as n, getGlobalKeyframes as o, resetConfig as p, getConfig as r, getGlobalRecipes as s, TastyConfig as t, hasStylesGenerated as u, generateTypographyTokens as v, SheetManager as x, ColorSpace as y };
857
+ //# sourceMappingURL=config-DknGsfMo.d.ts.map