@tenphi/tasty 0.0.0-snapshot.c8bdaeb → 0.0.0-snapshot.cae4fee

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 (303) hide show
  1. package/README.md +314 -159
  2. package/dist/async-storage-B7_o6FKt.js +44 -0
  3. package/dist/async-storage-B7_o6FKt.js.map +1 -0
  4. package/dist/collector-C-keQH9m.js +243 -0
  5. package/dist/collector-C-keQH9m.js.map +1 -0
  6. package/dist/collector-osfWTeRd.d.ts +108 -0
  7. package/dist/config-BBiyxMCe.js +10559 -0
  8. package/dist/config-BBiyxMCe.js.map +1 -0
  9. package/dist/config-BoZDUHW5.d.ts +945 -0
  10. package/dist/context-CkSg-kDT.js +24 -0
  11. package/dist/context-CkSg-kDT.js.map +1 -0
  12. package/dist/core/index.d.ts +5 -33
  13. package/dist/core/index.js +6 -26
  14. package/dist/core-BO4319td.js +1598 -0
  15. package/dist/core-BO4319td.js.map +1 -0
  16. package/dist/css-writer-BWvwQzz0.js +351 -0
  17. package/dist/css-writer-BWvwQzz0.js.map +1 -0
  18. package/dist/format-global-rules-Dbc_1tc3.js +22 -0
  19. package/dist/format-global-rules-Dbc_1tc3.js.map +1 -0
  20. package/dist/format-rules-BSjeH4Z7.js +143 -0
  21. package/dist/format-rules-BSjeH4Z7.js.map +1 -0
  22. package/dist/hydrate-CcvrP4qJ.js +45 -0
  23. package/dist/hydrate-CcvrP4qJ.js.map +1 -0
  24. package/dist/index-B_k47mc_.d.ts +1655 -0
  25. package/dist/index-tcHuMPFt.d.ts +1286 -0
  26. package/dist/index.d.ts +5 -48
  27. package/dist/index.js +731 -32
  28. package/dist/index.js.map +1 -0
  29. package/dist/keyframes-BUQhdOSJ.js +588 -0
  30. package/dist/keyframes-BUQhdOSJ.js.map +1 -0
  31. package/dist/{utils/merge-styles.d.ts → merge-styles-BMWcH6MF.d.ts} +3 -3
  32. package/dist/{utils/merge-styles.js → merge-styles-Cd2vBl9b.js} +4 -6
  33. package/dist/merge-styles-Cd2vBl9b.js.map +1 -0
  34. package/dist/{utils/resolve-recipes.js → resolve-recipes-C1nrvnYh.js} +5 -8
  35. package/dist/resolve-recipes-C1nrvnYh.js.map +1 -0
  36. package/dist/ssr/astro-client.d.ts +1 -0
  37. package/dist/ssr/astro-client.js +19 -0
  38. package/dist/ssr/astro-client.js.map +1 -0
  39. package/dist/ssr/astro-middleware.d.ts +15 -0
  40. package/dist/ssr/astro-middleware.js +19 -0
  41. package/dist/ssr/astro-middleware.js.map +1 -0
  42. package/dist/ssr/astro.d.ts +97 -0
  43. package/dist/ssr/astro.js +149 -0
  44. package/dist/ssr/astro.js.map +1 -0
  45. package/dist/ssr/index.d.ts +44 -0
  46. package/dist/ssr/index.js +10 -0
  47. package/dist/ssr/index.js.map +1 -0
  48. package/dist/ssr/next.d.ts +46 -0
  49. package/dist/ssr/next.js +75 -0
  50. package/dist/ssr/next.js.map +1 -0
  51. package/dist/static/index.d.ts +91 -5
  52. package/dist/static/index.js +49 -4
  53. package/dist/static/index.js.map +1 -0
  54. package/dist/static/inject.d.ts +5 -0
  55. package/dist/static/inject.js +17 -0
  56. package/dist/static/inject.js.map +1 -0
  57. package/dist/zero/babel.d.ts +57 -84
  58. package/dist/zero/babel.js +232 -40
  59. package/dist/zero/babel.js.map +1 -1
  60. package/dist/zero/index.d.ts +67 -3
  61. package/dist/zero/index.js +2 -4
  62. package/dist/zero/next.d.ts +56 -30
  63. package/dist/zero/next.js +105 -40
  64. package/dist/zero/next.js.map +1 -1
  65. package/docs/README.md +31 -0
  66. package/docs/adoption.md +298 -0
  67. package/docs/comparison.md +419 -0
  68. package/docs/configuration.md +438 -0
  69. package/docs/debug.md +320 -0
  70. package/docs/design-system.md +436 -0
  71. package/docs/dsl.md +690 -0
  72. package/docs/getting-started.md +217 -0
  73. package/docs/injector.md +544 -0
  74. package/docs/methodology.md +642 -0
  75. package/docs/pipeline.md +699 -0
  76. package/docs/react-api.md +581 -0
  77. package/docs/ssr.md +444 -0
  78. package/docs/styles.md +598 -0
  79. package/docs/tasty-static.md +547 -0
  80. package/package.json +70 -37
  81. package/tasty.config.ts +1 -0
  82. package/dist/_virtual/_rolldown/runtime.js +0 -8
  83. package/dist/chunks/cacheKey.js +0 -70
  84. package/dist/chunks/cacheKey.js.map +0 -1
  85. package/dist/chunks/definitions.d.ts +0 -37
  86. package/dist/chunks/definitions.js +0 -260
  87. package/dist/chunks/definitions.js.map +0 -1
  88. package/dist/chunks/renderChunk.js +0 -61
  89. package/dist/chunks/renderChunk.js.map +0 -1
  90. package/dist/config.d.ts +0 -280
  91. package/dist/config.js +0 -403
  92. package/dist/config.js.map +0 -1
  93. package/dist/debug.d.ts +0 -204
  94. package/dist/debug.js +0 -733
  95. package/dist/debug.js.map +0 -1
  96. package/dist/hooks/useGlobalStyles.d.ts +0 -27
  97. package/dist/hooks/useGlobalStyles.js +0 -56
  98. package/dist/hooks/useGlobalStyles.js.map +0 -1
  99. package/dist/hooks/useKeyframes.d.ts +0 -56
  100. package/dist/hooks/useKeyframes.js +0 -54
  101. package/dist/hooks/useKeyframes.js.map +0 -1
  102. package/dist/hooks/useProperty.d.ts +0 -79
  103. package/dist/hooks/useProperty.js +0 -91
  104. package/dist/hooks/useProperty.js.map +0 -1
  105. package/dist/hooks/useRawCSS.d.ts +0 -53
  106. package/dist/hooks/useRawCSS.js +0 -28
  107. package/dist/hooks/useRawCSS.js.map +0 -1
  108. package/dist/hooks/useStyles.d.ts +0 -40
  109. package/dist/hooks/useStyles.js +0 -169
  110. package/dist/hooks/useStyles.js.map +0 -1
  111. package/dist/injector/index.d.ts +0 -157
  112. package/dist/injector/index.js +0 -154
  113. package/dist/injector/index.js.map +0 -1
  114. package/dist/injector/injector.d.ts +0 -139
  115. package/dist/injector/injector.js +0 -404
  116. package/dist/injector/injector.js.map +0 -1
  117. package/dist/injector/sheet-manager.d.ts +0 -127
  118. package/dist/injector/sheet-manager.js +0 -714
  119. package/dist/injector/sheet-manager.js.map +0 -1
  120. package/dist/injector/types.d.ts +0 -135
  121. package/dist/keyframes/index.js +0 -206
  122. package/dist/keyframes/index.js.map +0 -1
  123. package/dist/parser/classify.js +0 -319
  124. package/dist/parser/classify.js.map +0 -1
  125. package/dist/parser/const.js +0 -33
  126. package/dist/parser/const.js.map +0 -1
  127. package/dist/parser/lru.js +0 -109
  128. package/dist/parser/lru.js.map +0 -1
  129. package/dist/parser/parser.d.ts +0 -25
  130. package/dist/parser/parser.js +0 -116
  131. package/dist/parser/parser.js.map +0 -1
  132. package/dist/parser/tokenizer.js +0 -69
  133. package/dist/parser/tokenizer.js.map +0 -1
  134. package/dist/parser/types.d.ts +0 -51
  135. package/dist/parser/types.js +0 -46
  136. package/dist/parser/types.js.map +0 -1
  137. package/dist/pipeline/conditions.d.ts +0 -134
  138. package/dist/pipeline/conditions.js +0 -406
  139. package/dist/pipeline/conditions.js.map +0 -1
  140. package/dist/pipeline/exclusive.js +0 -231
  141. package/dist/pipeline/exclusive.js.map +0 -1
  142. package/dist/pipeline/index.d.ts +0 -53
  143. package/dist/pipeline/index.js +0 -660
  144. package/dist/pipeline/index.js.map +0 -1
  145. package/dist/pipeline/materialize.js +0 -844
  146. package/dist/pipeline/materialize.js.map +0 -1
  147. package/dist/pipeline/parseStateKey.d.ts +0 -15
  148. package/dist/pipeline/parseStateKey.js +0 -438
  149. package/dist/pipeline/parseStateKey.js.map +0 -1
  150. package/dist/pipeline/simplify.js +0 -516
  151. package/dist/pipeline/simplify.js.map +0 -1
  152. package/dist/pipeline/warnings.js +0 -18
  153. package/dist/pipeline/warnings.js.map +0 -1
  154. package/dist/plugins/okhsl-plugin.d.ts +0 -35
  155. package/dist/plugins/okhsl-plugin.js +0 -371
  156. package/dist/plugins/okhsl-plugin.js.map +0 -1
  157. package/dist/plugins/types.d.ts +0 -69
  158. package/dist/properties/index.js +0 -158
  159. package/dist/properties/index.js.map +0 -1
  160. package/dist/states/index.d.ts +0 -49
  161. package/dist/states/index.js +0 -416
  162. package/dist/states/index.js.map +0 -1
  163. package/dist/static/tastyStatic.d.ts +0 -46
  164. package/dist/static/tastyStatic.js +0 -31
  165. package/dist/static/tastyStatic.js.map +0 -1
  166. package/dist/static/types.d.ts +0 -49
  167. package/dist/static/types.js +0 -24
  168. package/dist/static/types.js.map +0 -1
  169. package/dist/styles/align.d.ts +0 -15
  170. package/dist/styles/align.js +0 -14
  171. package/dist/styles/align.js.map +0 -1
  172. package/dist/styles/border.d.ts +0 -25
  173. package/dist/styles/border.js +0 -114
  174. package/dist/styles/border.js.map +0 -1
  175. package/dist/styles/color.d.ts +0 -14
  176. package/dist/styles/color.js +0 -23
  177. package/dist/styles/color.js.map +0 -1
  178. package/dist/styles/createStyle.js +0 -77
  179. package/dist/styles/createStyle.js.map +0 -1
  180. package/dist/styles/dimension.js +0 -97
  181. package/dist/styles/dimension.js.map +0 -1
  182. package/dist/styles/display.d.ts +0 -37
  183. package/dist/styles/display.js +0 -67
  184. package/dist/styles/display.js.map +0 -1
  185. package/dist/styles/fade.d.ts +0 -15
  186. package/dist/styles/fade.js +0 -58
  187. package/dist/styles/fade.js.map +0 -1
  188. package/dist/styles/fill.d.ts +0 -42
  189. package/dist/styles/fill.js +0 -51
  190. package/dist/styles/fill.js.map +0 -1
  191. package/dist/styles/flow.d.ts +0 -16
  192. package/dist/styles/flow.js +0 -12
  193. package/dist/styles/flow.js.map +0 -1
  194. package/dist/styles/gap.d.ts +0 -31
  195. package/dist/styles/gap.js +0 -37
  196. package/dist/styles/gap.js.map +0 -1
  197. package/dist/styles/height.d.ts +0 -17
  198. package/dist/styles/height.js +0 -20
  199. package/dist/styles/height.js.map +0 -1
  200. package/dist/styles/index.d.ts +0 -2
  201. package/dist/styles/index.js +0 -9
  202. package/dist/styles/index.js.map +0 -1
  203. package/dist/styles/inset.d.ts +0 -52
  204. package/dist/styles/inset.js +0 -150
  205. package/dist/styles/inset.js.map +0 -1
  206. package/dist/styles/justify.d.ts +0 -15
  207. package/dist/styles/justify.js +0 -14
  208. package/dist/styles/justify.js.map +0 -1
  209. package/dist/styles/list.d.ts +0 -16
  210. package/dist/styles/list.js +0 -98
  211. package/dist/styles/list.js.map +0 -1
  212. package/dist/styles/margin.d.ts +0 -24
  213. package/dist/styles/margin.js +0 -104
  214. package/dist/styles/margin.js.map +0 -1
  215. package/dist/styles/outline.d.ts +0 -29
  216. package/dist/styles/outline.js +0 -65
  217. package/dist/styles/outline.js.map +0 -1
  218. package/dist/styles/padding.d.ts +0 -24
  219. package/dist/styles/padding.js +0 -104
  220. package/dist/styles/padding.js.map +0 -1
  221. package/dist/styles/predefined.d.ts +0 -73
  222. package/dist/styles/predefined.js +0 -241
  223. package/dist/styles/predefined.js.map +0 -1
  224. package/dist/styles/preset.d.ts +0 -47
  225. package/dist/styles/preset.js +0 -126
  226. package/dist/styles/preset.js.map +0 -1
  227. package/dist/styles/radius.d.ts +0 -14
  228. package/dist/styles/radius.js +0 -51
  229. package/dist/styles/radius.js.map +0 -1
  230. package/dist/styles/scrollbar.d.ts +0 -21
  231. package/dist/styles/scrollbar.js +0 -112
  232. package/dist/styles/scrollbar.js.map +0 -1
  233. package/dist/styles/shadow.d.ts +0 -14
  234. package/dist/styles/shadow.js +0 -24
  235. package/dist/styles/shadow.js.map +0 -1
  236. package/dist/styles/styledScrollbar.d.ts +0 -47
  237. package/dist/styles/styledScrollbar.js +0 -38
  238. package/dist/styles/styledScrollbar.js.map +0 -1
  239. package/dist/styles/transition.d.ts +0 -14
  240. package/dist/styles/transition.js +0 -158
  241. package/dist/styles/transition.js.map +0 -1
  242. package/dist/styles/types.d.ts +0 -498
  243. package/dist/styles/width.d.ts +0 -17
  244. package/dist/styles/width.js +0 -20
  245. package/dist/styles/width.js.map +0 -1
  246. package/dist/tasty.d.ts +0 -982
  247. package/dist/tasty.js +0 -206
  248. package/dist/tasty.js.map +0 -1
  249. package/dist/tokens/typography.d.ts +0 -19
  250. package/dist/tokens/typography.js +0 -237
  251. package/dist/tokens/typography.js.map +0 -1
  252. package/dist/types.d.ts +0 -184
  253. package/dist/utils/cache-wrapper.js +0 -26
  254. package/dist/utils/cache-wrapper.js.map +0 -1
  255. package/dist/utils/case-converter.js +0 -8
  256. package/dist/utils/case-converter.js.map +0 -1
  257. package/dist/utils/colors.d.ts +0 -5
  258. package/dist/utils/colors.js +0 -9
  259. package/dist/utils/colors.js.map +0 -1
  260. package/dist/utils/css-types.d.ts +0 -7
  261. package/dist/utils/dotize.d.ts +0 -26
  262. package/dist/utils/dotize.js +0 -122
  263. package/dist/utils/dotize.js.map +0 -1
  264. package/dist/utils/filter-base-props.d.ts +0 -15
  265. package/dist/utils/filter-base-props.js +0 -45
  266. package/dist/utils/filter-base-props.js.map +0 -1
  267. package/dist/utils/get-display-name.d.ts +0 -7
  268. package/dist/utils/get-display-name.js +0 -10
  269. package/dist/utils/get-display-name.js.map +0 -1
  270. package/dist/utils/hsl-to-rgb.js +0 -38
  271. package/dist/utils/hsl-to-rgb.js.map +0 -1
  272. package/dist/utils/is-dev-env.js +0 -19
  273. package/dist/utils/is-dev-env.js.map +0 -1
  274. package/dist/utils/is-valid-element-type.js +0 -15
  275. package/dist/utils/is-valid-element-type.js.map +0 -1
  276. package/dist/utils/merge-styles.js.map +0 -1
  277. package/dist/utils/mod-attrs.d.ts +0 -8
  278. package/dist/utils/mod-attrs.js +0 -21
  279. package/dist/utils/mod-attrs.js.map +0 -1
  280. package/dist/utils/okhsl-to-rgb.js +0 -296
  281. package/dist/utils/okhsl-to-rgb.js.map +0 -1
  282. package/dist/utils/process-tokens.d.ts +0 -31
  283. package/dist/utils/process-tokens.js +0 -171
  284. package/dist/utils/process-tokens.js.map +0 -1
  285. package/dist/utils/resolve-recipes.d.ts +0 -17
  286. package/dist/utils/resolve-recipes.js.map +0 -1
  287. package/dist/utils/string.js +0 -8
  288. package/dist/utils/string.js.map +0 -1
  289. package/dist/utils/styles.d.ts +0 -178
  290. package/dist/utils/styles.js +0 -590
  291. package/dist/utils/styles.js.map +0 -1
  292. package/dist/utils/typography.d.ts +0 -36
  293. package/dist/utils/typography.js +0 -53
  294. package/dist/utils/typography.js.map +0 -1
  295. package/dist/utils/warnings.d.ts +0 -16
  296. package/dist/utils/warnings.js +0 -16
  297. package/dist/utils/warnings.js.map +0 -1
  298. package/dist/zero/css-writer.d.ts +0 -45
  299. package/dist/zero/css-writer.js +0 -74
  300. package/dist/zero/css-writer.js.map +0 -1
  301. package/dist/zero/extractor.d.ts +0 -24
  302. package/dist/zero/extractor.js +0 -150
  303. package/dist/zero/extractor.js.map +0 -1
@@ -0,0 +1,1286 @@
1
+ import { Properties } from "csstype";
2
+
3
+ //#region src/properties/property-type-resolver.d.ts
4
+ /**
5
+ * PropertyTypeResolver
6
+ *
7
+ * Automatically infers CSS @property types from custom property values.
8
+ * Supports deferred resolution for var() reference chains of arbitrary depth.
9
+ */
10
+ declare class PropertyTypeResolver {
11
+ /** propName → the prop it depends on */
12
+ private pendingDeps;
13
+ /** propName → list of props waiting on it */
14
+ private reverseDeps;
15
+ /**
16
+ * Scan CSS declarations and auto-register @property for custom properties
17
+ * whose types can be inferred from their values.
18
+ */
19
+ scanDeclarations(declarations: string, isPropertyDefined: (name: string) => boolean, registerProperty: (name: string, syntax: string, initialValue: string) => void): void;
20
+ private addDependency;
21
+ private resolve;
22
+ private isComplexValue;
23
+ }
24
+ //#endregion
25
+ //#region src/injector/types.d.ts
26
+ declare global {
27
+ interface Window {
28
+ __TASTY__?: string[];
29
+ }
30
+ }
31
+ interface InjectResult {
32
+ className: string;
33
+ dispose: () => void;
34
+ }
35
+ interface GlobalInjectResult {
36
+ dispose: () => void;
37
+ }
38
+ type DisposeFunction = () => void;
39
+ interface StyleInjectorConfig {
40
+ nonce?: string;
41
+ maxRulesPerSheet?: number;
42
+ forceTextInjection?: boolean;
43
+ /** Enable development mode features: performance metrics and debug information storage */
44
+ devMode?: boolean;
45
+ /**
46
+ * Global predefined states for advanced state mapping.
47
+ * These are state aliases that can be used in any component.
48
+ * Example: { '@mobile': '@media(w < 920px)', '@dark': '@root(theme=dark)' }
49
+ */
50
+ states?: Record<string, string>;
51
+ /**
52
+ * Automatically infer and register CSS @property declarations
53
+ * from custom property values. When false, only explicit @properties are used.
54
+ * @default true
55
+ */
56
+ autoPropertyTypes?: boolean;
57
+ /** Garbage collection configuration for unused styles */
58
+ gc?: GCConfig;
59
+ /**
60
+ * Prefix prepended to every generated identifier.
61
+ * Mirrors the `namePrefix` field on the public `TastyConfig` so that
62
+ * standalone injector consumers can configure it directly.
63
+ * @default 't'
64
+ */
65
+ namePrefix?: string;
66
+ }
67
+ /**
68
+ * Per-className usage tracking for GC.
69
+ */
70
+ interface StyleUsage {
71
+ lastTouchedAt: number;
72
+ }
73
+ /**
74
+ * Configuration for the style garbage collector.
75
+ *
76
+ * GC is triggered by touch count rather than timers: every `touchInterval`
77
+ * touches, an idle callback is scheduled to evict unused styles above
78
+ * `capacity`, oldest first.
79
+ */
80
+ interface GCConfig {
81
+ /**
82
+ * Number of touch events between GC cycles.
83
+ * @default 1000
84
+ */
85
+ touchInterval?: number;
86
+ /**
87
+ * Maximum number of unused styles to retain.
88
+ * GC evicts the oldest unused styles when this limit is exceeded.
89
+ * Actively referenced styles (refCount > 0) and DOM-live styles
90
+ * do not count against this limit.
91
+ * @default 1000
92
+ */
93
+ capacity?: number;
94
+ }
95
+ /**
96
+ * Per-call options for gc().
97
+ */
98
+ interface GCOptions {
99
+ root?: Document | ShadowRoot;
100
+ /** Bypass capacity threshold and remove ALL unused styles. */
101
+ force?: boolean;
102
+ }
103
+ interface RuleInfo {
104
+ className: string;
105
+ ruleIndex: number;
106
+ sheetIndex: number;
107
+ /** Dev-only: full CSS texts inserted for this class; omitted in production */
108
+ cssText?: string[];
109
+ /** Inclusive end index of the contiguous block of inserted rules for this className */
110
+ endRuleIndex?: number;
111
+ /** NEW: exact indices of all inserted rules for this className */
112
+ indices?: number[];
113
+ }
114
+ type InjectionMode = 'style-element' | 'adopted';
115
+ interface SheetInfo {
116
+ /** HTMLStyleElement used in style-element mode; null in adopted mode. */
117
+ sheet: HTMLStyleElement | null;
118
+ /** Constructable CSSStyleSheet used in adopted mode (ShadowRoot targets) */
119
+ constructableSheet?: CSSStyleSheet;
120
+ ruleCount: number;
121
+ holes: number[];
122
+ }
123
+ interface CleanupStats {
124
+ timestamp: number;
125
+ classesDeleted: number;
126
+ cssSize: number;
127
+ rulesDeleted: number;
128
+ }
129
+ interface CacheMetrics {
130
+ hits: number;
131
+ misses: number;
132
+ bulkCleanups: number;
133
+ totalInsertions: number;
134
+ totalUnused: number;
135
+ stylesCleanedUp: number;
136
+ cleanupHistory: CleanupStats[];
137
+ startTime: number;
138
+ unusedHits?: number;
139
+ }
140
+ interface RootRegistry {
141
+ sheets: SheetInfo[];
142
+ refCounts: Map<string, number>;
143
+ rules: Map<string, RuleInfo>;
144
+ /** Cache key to className mapping to avoid dual storage of RuleInfo objects */
145
+ cacheKeyToClassName: Map<string, string>;
146
+ /** Deduplication set of fully materialized CSS rules inserted into sheets */
147
+ ruleTextSet: Set<string>;
148
+ /** Performance metrics (optional) */
149
+ metrics?: CacheMetrics;
150
+ /** Keyframes cache by content hash -> entry */
151
+ keyframesCache: Map<string, KeyframesCacheEntry>;
152
+ /** Keyframes name to content hash mapping for collision detection */
153
+ keyframesNameToContent: Map<string, string>;
154
+ /** Counter for generating keyframes names like k0, k1, k2... */
155
+ keyframesCounter: number;
156
+ /** Map of injected @property names to their normalized declarations for tracking */
157
+ injectedProperties: Map<string, string>;
158
+ /** Content hashes of injected @font-face rules for deduplication */
159
+ injectedFontFaces: Set<string>;
160
+ /** Names of injected @counter-style rules for deduplication */
161
+ injectedCounterStyles: Set<string>;
162
+ /** Global rules tracking for index adjustment */
163
+ globalRules: Map<string, RuleInfo>;
164
+ /** Resolver for auto-inferring @property types from declaration values */
165
+ propertyTypeResolver: PropertyTypeResolver;
166
+ /** Per-className usage tracking for GC */
167
+ usageMap: Map<string, StyleUsage>;
168
+ /** Touch counter for scheduling GC (per-root) */
169
+ touchCount: number;
170
+ /** How many entries from `window.__TASTY__` have been synced into this registry */
171
+ serverClassSyncIndex: number;
172
+ /** Whether `<style data-tasty-rsc>` tags have been scanned for class names */
173
+ rscStylesScanned: boolean;
174
+ /** Whether this root uses adoptedStyleSheets or <style> elements */
175
+ injectionMode: InjectionMode;
176
+ /**
177
+ * Lazy feature-test for `@property` support, cached per registry.
178
+ * - `undefined`: not yet probed.
179
+ * - `true`: engine supports `@property`; rejections indicate user-authored
180
+ * invalid rules and should warn.
181
+ * - `false`: engine doesn't support `@property` (e.g., jsdom); rejections
182
+ * are expected and warnings are suppressed.
183
+ */
184
+ atPropertySupported?: boolean;
185
+ }
186
+ type StyleRule = StyleResult;
187
+ interface KeyframesInfo {
188
+ name: string;
189
+ sheetIndex: number;
190
+ ruleIndex: number;
191
+ /** Dev-only: full CSS text of the @keyframes rule; omitted in production */
192
+ cssText?: string;
193
+ }
194
+ type KeyframeStep = string | Record<string, string | number>;
195
+ type KeyframesSteps = Record<string, KeyframeStep>;
196
+ interface KeyframesResult {
197
+ toString(): string;
198
+ dispose: () => void;
199
+ }
200
+ interface KeyframesCacheEntry {
201
+ name: string;
202
+ refCount: number;
203
+ info: KeyframesInfo;
204
+ }
205
+ /**
206
+ * Definition for a CSS @property at-rule.
207
+ * Used to define custom property syntax, inheritance, and initial value.
208
+ */
209
+ interface PropertyDefinition {
210
+ /** CSS syntax string (e.g., '<color>', '<angle>', '<number>') */
211
+ syntax?: string;
212
+ /** Whether the property inherits (default: true) */
213
+ inherits?: boolean;
214
+ /** Initial value for the property */
215
+ initialValue?: string | number;
216
+ }
217
+ /**
218
+ * Descriptors for a CSS @font-face at-rule.
219
+ */
220
+ interface FontFaceDescriptors {
221
+ /** Required. URL(s) to the font file(s). */
222
+ src: string;
223
+ /** Font weight or range. Default: 'normal'. */
224
+ fontWeight?: string | number;
225
+ /** Font style. Default: 'normal'. */
226
+ fontStyle?: 'normal' | 'italic' | 'oblique' | (string & {});
227
+ /** Font stretch. Default: 'normal'. */
228
+ fontStretch?: string;
229
+ /** Loading behavior. Default: 'auto'. */
230
+ fontDisplay?: 'auto' | 'block' | 'swap' | 'fallback' | 'optional';
231
+ /** Unicode range to cover. */
232
+ unicodeRange?: string;
233
+ /** Ascent metric override. */
234
+ ascentOverride?: string;
235
+ /** Descent metric override. */
236
+ descentOverride?: string;
237
+ /** Line gap metric override. */
238
+ lineGapOverride?: string;
239
+ /** Size adjustment factor. */
240
+ sizeAdjust?: string;
241
+ /** OpenType feature settings. */
242
+ fontFeatureSettings?: string;
243
+ /** Font variation axis settings. */
244
+ fontVariationSettings?: string;
245
+ }
246
+ /** Single descriptor or array of descriptors for multiple weights/styles. */
247
+ type FontFaceInput = FontFaceDescriptors | FontFaceDescriptors[];
248
+ /**
249
+ * Descriptors for a CSS @counter-style at-rule.
250
+ */
251
+ interface CounterStyleDescriptors {
252
+ /** Required. Numbering algorithm. */
253
+ system: 'cyclic' | 'numeric' | 'alphabetic' | 'symbolic' | 'additive' | 'fixed' | (string & {});
254
+ /** Symbols for non-additive systems. */
255
+ symbols?: string;
256
+ /** Symbol-value pairs for additive system. */
257
+ additiveSymbols?: string;
258
+ /** String prepended to the marker. Default: "". */
259
+ prefix?: string;
260
+ /** String appended to the marker. Default: ". ". */
261
+ suffix?: string;
262
+ /** Negative-value wrapping (e.g., '"(" ")"'). */
263
+ negative?: string;
264
+ /** Counter range (e.g., 'infinite infinite'). */
265
+ range?: string;
266
+ /** Minimum marker width and pad symbol (e.g., '3 "0"'). */
267
+ pad?: string;
268
+ /** Fallback counter style name. */
269
+ fallback?: string;
270
+ /** Speech synthesis hint. */
271
+ speakAs?: string;
272
+ }
273
+ interface RawCSSResult {
274
+ dispose: () => void;
275
+ }
276
+ //#endregion
277
+ //#region src/utils/css-types.d.ts
278
+ interface CSSProperties extends Properties<string | number> {}
279
+ //#endregion
280
+ //#region src/parser/types.d.ts
281
+ declare enum Bucket {
282
+ Color = 0,
283
+ Value = 1,
284
+ Mod = 2
285
+ }
286
+ /**
287
+ * A part within a group, representing a slash-separated segment.
288
+ * For example, in `'2px solid #red / 4px'`, there are two parts:
289
+ * - Part 0: `2px solid #red`
290
+ * - Part 1: `4px`
291
+ */
292
+ interface StyleDetailsPart {
293
+ mods: string[];
294
+ values: string[];
295
+ colors: string[];
296
+ all: string[];
297
+ output: string;
298
+ }
299
+ /**
300
+ * A group of style details, representing a comma-separated segment.
301
+ * Contains aggregated values from all parts for backward compatibility,
302
+ * plus the structured `parts` array for handlers that need slash separation.
303
+ */
304
+ interface StyleDetails {
305
+ input: string;
306
+ output: string;
307
+ /** Aggregated mods from all parts (backward compatible) */
308
+ mods: string[];
309
+ /** Aggregated values from all parts (backward compatible) */
310
+ values: string[];
311
+ /** Aggregated colors from all parts (backward compatible) */
312
+ colors: string[];
313
+ /** Aggregated all tokens from all parts (backward compatible) */
314
+ all: string[];
315
+ /** Slash-separated parts within this group */
316
+ parts: StyleDetailsPart[];
317
+ }
318
+ interface ProcessedStyle {
319
+ output: string;
320
+ groups: StyleDetails[];
321
+ }
322
+ type UnitHandler = (scalar: number) => string;
323
+ interface ParserOptions {
324
+ funcs?: Record<string, (parsed: StyleDetails[]) => string>;
325
+ units?: Record<string, string | UnitHandler>;
326
+ cacheSize?: number;
327
+ }
328
+ //#endregion
329
+ //#region src/parser/parser.d.ts
330
+ declare class StyleParser {
331
+ private opts;
332
+ private cache;
333
+ constructor(opts?: ParserOptions);
334
+ process(src: string): ProcessedStyle;
335
+ setFuncs(funcs: Required<ParserOptions>['funcs']): void;
336
+ setUnits(units: Required<ParserOptions>['units']): void;
337
+ updateOptions(patch: Partial<ParserOptions>): void;
338
+ /**
339
+ * Clear the parser cache.
340
+ * Call this when external state that affects parsing results has changed
341
+ * (e.g., predefined tokens).
342
+ */
343
+ clearCache(): void;
344
+ /**
345
+ * Get the current units configuration.
346
+ */
347
+ getUnits(): ParserOptions['units'];
348
+ }
349
+ //#endregion
350
+ //#region src/utils/color-math.d.ts
351
+ /**
352
+ * Consolidated color conversion math.
353
+ *
354
+ * Single source of truth for all color space conversions used across the
355
+ * library: sRGB gamma, HSL, OKLab, OKLCH, OKHSL, hex parsing, named
356
+ * colors, and CSS string converters.
357
+ *
358
+ * This module has zero internal imports — it is a leaf dependency.
359
+ *
360
+ * Reference: https://bottosson.github.io/posts/oklab/
361
+ */
362
+ type Vec3 = [number, number, number];
363
+ /**
364
+ * HSL to RGB.
365
+ * Algorithm from CSS Color 4 spec.
366
+ *
367
+ * @param h - Hue in degrees (0-360)
368
+ * @param s - Saturation (0-1)
369
+ * @param l - Lightness (0-1)
370
+ * @returns RGB values in 0-255 range (may have fractional values)
371
+ */
372
+ declare function hslToRgbValues(h: number, s: number, l: number): Vec3;
373
+ declare function getNamedColorHex(): Map<string, string>;
374
+ /**
375
+ * Convert hex color string to `rgb()` CSS string.
376
+ * Supports 3, 4, 6, and 8 character hex values (with or without `#`).
377
+ */
378
+ declare function hexToRgb(hex: string): string | null;
379
+ /**
380
+ * Extract RGB values from an `rgb()`/`rgba()` string.
381
+ * Supports comma-separated, space-separated, fractional, percentage,
382
+ * and slash alpha notation.
383
+ *
384
+ * @returns Array of RGB values (0-255 range), converting percentages as needed.
385
+ */
386
+ declare function getRgbValuesFromRgbaString(str: string): number[];
387
+ /**
388
+ * Convert any recognized color string to an `rgb()` CSS string.
389
+ * Handles hex, `okhsl()`, `hsl()`/`hsla()`, named CSS colors,
390
+ * and `rgb()`/`rgba()` pass-through.
391
+ */
392
+ declare function strToRgb(color: string, _ignoreAlpha?: boolean): string | null | undefined;
393
+ //#endregion
394
+ //#region src/utils/styles.d.ts
395
+ type StyleValue<T = string> = T | boolean | number | null | undefined;
396
+ /**
397
+ * Normalize a color token value.
398
+ * - Boolean `true` is converted to `'transparent'`
399
+ * - Boolean `false` returns `null` (signals the token should be skipped)
400
+ * - Other values are returned as-is
401
+ *
402
+ * @param value - The raw token value
403
+ * @returns Normalized value or null if the token should be skipped
404
+ */
405
+ declare function normalizeColorTokenValue<T>(value: T | boolean): T | 'transparent' | null;
406
+ type StyleValueStateMap<T = string> = Record<string, StyleValue<T> | '@inherit'>;
407
+ /**
408
+ * Combined type for style values that can be either a direct value or a state map.
409
+ * Use this for component props that accept style values.
410
+ */
411
+ type StylePropValue<T = string> = StyleValue<T> | StyleValueStateMap<T>;
412
+ type CSSMap = {
413
+ $?: string | string[];
414
+ } & Record<string, string | string[]>;
415
+ type StyleHandlerResult = CSSMap | CSSMap[] | null | void;
416
+ type RawStyleHandler = (value: StyleValueStateMap) => StyleHandlerResult;
417
+ type StyleHandler = RawStyleHandler & {
418
+ __lookupStyles: string[];
419
+ };
420
+ /**
421
+ * Handler definition forms for configure() and plugins.
422
+ * - Function only: lookup styles inferred from key name
423
+ * - Single property tuple: ['styleName', handler]
424
+ * - Multi-property tuple: [['style1', 'style2'], handler]
425
+ */
426
+ type StyleHandlerDefinition = RawStyleHandler | [string, RawStyleHandler] | [string[], RawStyleHandler];
427
+ interface ParsedColor {
428
+ color?: string;
429
+ name?: string;
430
+ opacity?: number;
431
+ }
432
+ type StyleMap = Record<string, StyleValue | StyleValueStateMap>;
433
+ declare const CUSTOM_UNITS: {
434
+ r: string;
435
+ cr: string;
436
+ bw: string;
437
+ ow: string;
438
+ x: string;
439
+ sf: (num: number) => string;
440
+ };
441
+ declare const DIRECTIONS: string[];
442
+ declare function customFunc(name: string, fn: (groups: StyleDetails[]) => string): void;
443
+ /**
444
+ * Get the global StyleParser instance.
445
+ * Used by configure() to apply parser configuration.
446
+ */
447
+ declare function getGlobalParser(): StyleParser;
448
+ /**
449
+ * Get the current custom functions registry.
450
+ * Used by configure() to merge with new functions.
451
+ */
452
+ declare function getGlobalFuncs(): Record<string, (groups: StyleDetails[]) => string>;
453
+ /**
454
+ * Set global predefined tokens.
455
+ * Called from configure() after processing token values.
456
+ * Merges with existing tokens (new tokens override existing ones with same key).
457
+ * Keys are normalized to lowercase (parser lowercases input before classification).
458
+ * @internal
459
+ */
460
+ declare function setGlobalPredefinedTokens(tokens: Record<string, string>): void;
461
+ /**
462
+ * Get the current global predefined tokens.
463
+ * Returns null if no tokens are configured.
464
+ */
465
+ declare function getGlobalPredefinedTokens(): Record<string, string> | null;
466
+ /**
467
+ * Reset global predefined tokens.
468
+ * Used for testing.
469
+ * @internal
470
+ */
471
+ declare function resetGlobalPredefinedTokens(): void;
472
+ /**
473
+ *
474
+ * @param {String} value
475
+ * @param {Number} mode
476
+ * @returns {Object<String,String|Array>}
477
+ */
478
+ declare function parseStyle(value: StyleValue): ProcessedStyle;
479
+ /**
480
+ * Parse color. Find it value, name and opacity.
481
+ * Optimized to avoid heavy parseStyle calls for simple color patterns.
482
+ */
483
+ declare function parseColor(val: string, ignoreError?: boolean): ParsedColor;
484
+ declare function filterMods(mods: string[], allowedMods: string[]): string[];
485
+ declare function stringifyStyles(styles: unknown): string;
486
+ //#endregion
487
+ //#region src/styles/types.d.ts
488
+ /**
489
+ * Extensible interface for named color tokens.
490
+ * Augment this interface to register project-specific color names
491
+ * for autocomplete in `fill`, `color`, `svgFill`, and other color style props.
492
+ *
493
+ * @example
494
+ * ```typescript
495
+ * declare module '@tenphi/tasty' {
496
+ * interface TastyNamedColors {
497
+ * primary: true;
498
+ * danger: true;
499
+ * }
500
+ * }
501
+ * ```
502
+ */
503
+ interface TastyNamedColors {}
504
+ type NamedColorKey = Extract<keyof TastyNamedColors, string>;
505
+ type NamedColor = [NamedColorKey] extends [never] ? string : NamedColorKey;
506
+ /**
507
+ * Extensible interface for typography preset names.
508
+ * Augment this interface to register project-specific preset names for autocomplete.
509
+ *
510
+ * @example
511
+ * ```typescript
512
+ * declare module '@tenphi/tasty' {
513
+ * interface TastyPresetNames {
514
+ * h1: true;
515
+ * t3: true;
516
+ * }
517
+ * }
518
+ * ```
519
+ */
520
+ interface TastyPresetNames {}
521
+ type PresetNameKey = Extract<keyof TastyPresetNames, string>;
522
+ type PresetName = [PresetNameKey] extends [never] ? string : PresetNameKey;
523
+ type Digit = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
524
+ type OpaquePercentage = '' | `.${Digit}` | `.${Digit}${Digit}` | '.100';
525
+ type ColorValue = `#${NamedColor}${OpaquePercentage}` | `rgb(${string})` | `hsl(${string})` | `okhsl(${string})` | `oklch(${string})` | (string & {});
526
+ type NoType = false | null | undefined;
527
+ interface StylesInterface extends Omit<CSSProperties, 'color' | 'fill' | 'font' | 'outline' | 'type' | 'gap' | 'padding' | 'margin' | 'width' | 'height' | 'border' | 'transition' | 'placeContent' | 'placeItems' | 'scrollMargin' | 'scrollMarginTop' | 'scrollMarginRight' | 'scrollMarginBottom' | 'scrollMarginLeft' | 'scrollMarginBlock' | 'scrollMarginInline'> {
528
+ /**
529
+ * @deprecated Use `flow` style instead.
530
+ */
531
+ flexDirection: CSSProperties['flexDirection'];
532
+ /**
533
+ * @deprecated Use `placeContent`, `placeItems`, `gridColumns`, `gridRows`, and `gridTemplate` styles instead.
534
+ */
535
+ grid: CSSProperties['grid'];
536
+ /**
537
+ * @deprecated Use `flexShrink`, `flexGrow`, and `flexBasis` styles instead.
538
+ */
539
+ flex: CSSProperties['flex'];
540
+ /**
541
+ * Set the background color of the element. Shortcut for `background-color` with enhanced support for Tasty color tokens and syntaxes.
542
+ *
543
+ * Supports double-color syntax: the second color is applied as a foreground overlay via a CSS custom property.
544
+ *
545
+ * Examples:
546
+ * - `fill="#purple.10"` // purple background with 10% opacity
547
+ * - `fill="#danger"` // danger theme color
548
+ * - `fill="rgb(255 128 0)"` // custom RGB color
549
+ * - `fill="rgb(255 128 0 / 0.5)"` // RGB with opacity
550
+ * - `fill="hsl(200 100% 50%)"` // HSL color
551
+ * - `fill="okhsl(200 100% 50%)"` // perceptually uniform OKHSL color
552
+ * - `fill="oklch(0.7 0.15 200)"` // OKLCH color
553
+ * - `fill="#primary #secondary"` // double color (second as foreground overlay)
554
+ * - `fill={true}` // default fill color
555
+ */
556
+ fill?: ColorValue | boolean;
557
+ /**
558
+ * @deprecated Use `fill` instead.
559
+ */
560
+ backgroundColor?: CSSProperties['backgroundColor'];
561
+ /**
562
+ * Set the background image of the element. Shortcut for `background-image` with enhanced support for Tasty tokens.
563
+ *
564
+ * Examples:
565
+ * - `image="url(/path/to/image.png)"` // image from URL
566
+ * - `image="linear-gradient(to right, #purple, #danger)"` // gradient
567
+ */
568
+ image?: CSSProperties['backgroundImage'];
569
+ /**
570
+ * @deprecated Use `image` instead.
571
+ */
572
+ backgroundImage?: CSSProperties['backgroundImage'];
573
+ /**
574
+ * @deprecated Use separate background styles (`fill`, `image`, `backgroundSize`, etc.) instead.
575
+ * When set, overrides all other background-related styles.
576
+ */
577
+ background?: CSSProperties['background'];
578
+ /**
579
+ * Set the fill color of SVG elements. Outputs the native CSS `fill` property with enhanced support for Tasty color tokens and syntaxes.
580
+ *
581
+ * Examples:
582
+ * - `svgFill="#purple.10"` // purple fill with 10% opacity
583
+ * - `svgFill="#danger"` // danger theme color
584
+ * - `svgFill="rgb(255 128 0)"` // custom RGB color
585
+ * - `svgFill="hsl(200 100% 50%)"` // HSL color
586
+ * - `svgFill="okhsl(200 100% 50%)"` // OKHSL color
587
+ * - `svgFill="oklch(0.7 0.15 200)"` // OKLCH color
588
+ * - `svgFill="currentColor"` // inherit from parent color
589
+ */
590
+ svgFill?: ColorValue;
591
+ /**
592
+ * Set the text (current) color of the element. Shortcut for `color` with enhanced support for Tasty color tokens and syntaxes.
593
+ *
594
+ * Examples:
595
+ * - `color="#purple"` // purple text color
596
+ * - `color="#danger.6"` // danger color with 60% opacity
597
+ * - `color="rgb(255 128 0)"` // custom RGB color
598
+ * - `color="hsl(200 100% 50%)"` // HSL color
599
+ * - `color="okhsl(200 100% 50%)"` // OKHSL color
600
+ * - `color="oklch(0.7 0.15 200)"` // OKLCH color
601
+ * - `color="red"` // CSS color name
602
+ * - `color={true}` // currentColor
603
+ */
604
+ color?: ColorValue | boolean;
605
+ /**
606
+ * The fade style applies gradient-based fading masks to the edges of an element. Replaces complex CSS mask gradients with a simple, declarative API.
607
+ *
608
+ * Syntax: `[width] [directions] [#from-color] [#to-color]`
609
+ *
610
+ * Multiple groups can be separated by commas to specify different colors per direction.
611
+ *
612
+ * Color tokens (optional):
613
+ * - First color: transparent start of gradient (default: `rgb(0 0 0 / 0)`)
614
+ * - Second color: opaque end of gradient (default: `rgb(0 0 0 / 1)`)
615
+ *
616
+ * Examples:
617
+ * - `fade="top"` // fade only top edge with default width
618
+ * - `fade="2x left right"` // fade left and right edges with 2x width
619
+ * - `fade="1x top"` // fade only top edge with 1x width
620
+ * - `fade="3x 1x top bottom"` // top: 3x width, bottom: 1x width
621
+ * - `fade="2x #transparent #dark"` // custom colors for gradient mask
622
+ * - `fade="1x top #clear #solid"` // top edge with custom mask colors
623
+ * - `fade="top #red #blue, bottom #green #yellow"` // different colors per direction
624
+ * - `fade="2x top #a #b, 1x bottom #c #d"` // different widths and colors per direction
625
+ */
626
+ fade?: 'top' | 'right' | 'bottom' | 'left' | string;
627
+ /**
628
+ * Scrollbar styling using standard CSS properties (`scrollbar-width`, `scrollbar-color`, `scrollbar-gutter`).
629
+ *
630
+ * Syntax: `[width] [modifiers...] [thumb-color] [track-color]`
631
+ *
632
+ * Width values: `thin` (default), `auto`, `none`
633
+ * Modifiers: `stable`, `both-edges`, `always`
634
+ *
635
+ * Examples:
636
+ * - `scrollbar={true}` // thin scrollbar, default colors
637
+ * - `scrollbar="thin #purple.40 #dark.04"`
638
+ * - `scrollbar="auto #red #blue"`
639
+ * - `scrollbar="none"`
640
+ * - `scrollbar="always #primary.50 #white.02"`
641
+ * - `scrollbar="thin stable #red #blue"`
642
+ */
643
+ scrollbar?: string | boolean;
644
+ /**
645
+ * Set font weight for bold texts.
646
+ */
647
+ boldFontWeight?: number;
648
+ /**
649
+ * The gap style is a powerful, cross-layout shorthand for spacing between child elements. Works with flex, grid, and block layouts.
650
+ *
651
+ * For flex/grid: sets native `gap` property
652
+ * For block layouts: emulated using margin on children
653
+ *
654
+ * Examples:
655
+ * - `gap="2x"` // gap: 2x (or margin-bottom: 2x for block)
656
+ * - `gap="1x 2x"` // row gap: 1x, column gap: 2x
657
+ * - `gap={true}` // default gap (1x)
658
+ */
659
+ gap?: CSSProperties['gap'] | string | boolean;
660
+ /**
661
+ * Shorthand for element padding. Supports custom units, directional modifiers, and design-system-driven defaults.
662
+ *
663
+ * Examples:
664
+ * - `padding="2x 1x"` // top/bottom: 2x, left/right: 1x
665
+ * - `padding="2x top"` // only top padding: 2x
666
+ * - `padding="1x left right"` // left and right padding: 1x
667
+ * - `padding={true}` // default padding on all sides
668
+ */
669
+ padding?: CSSProperties['padding'] | string | boolean;
670
+ /**
671
+ * Shorthand for element margin. Supports custom units, directional modifiers, and design-system-driven defaults.
672
+ *
673
+ * Examples:
674
+ * - `margin="2x 1x"` // top/bottom: 2x, left/right: 1x
675
+ * - `margin="2x top"` // only top margin: 2x
676
+ * - `margin="1x left right"` // left and right margin: 1x
677
+ * - `margin={true}` // default margin on all sides
678
+ */
679
+ margin?: CSSProperties['margin'] | string | boolean;
680
+ /**
681
+ * Concise shorthand for setting element width, including min-width and max-width. Supports custom units and advanced sizing keywords.
682
+ *
683
+ * Syntax: `[value]` | `[min max]` | `[min value max]` | `[modifier value]`
684
+ *
685
+ * Modifiers: `min`, `max`
686
+ * Keywords: `stretch`, `max-content`, `min-content`, `fit-content`
687
+ *
688
+ * Examples:
689
+ * - `width="10x"` // width: 10x
690
+ * - `width="1x 10x"` // min-width: 1x; max-width: 10x
691
+ * - `width="min 2x"` // min-width: 2x
692
+ * - `width="stretch"` // width: stretch (fill-available)
693
+ * - `width={true}` // width: auto
694
+ */
695
+ width?: CSSProperties['width'] | string | boolean;
696
+ /**
697
+ * Concise shorthand for setting element height, including min-height and max-height. Supports custom units and advanced sizing keywords.
698
+ *
699
+ * Syntax: `[value]` | `[min max]` | `[min value max]` | `[modifier value]`
700
+ *
701
+ * Modifiers: `min`, `max`
702
+ * Keywords: `stretch`, `max-content`, `min-content`, `fit-content`
703
+ *
704
+ * Examples:
705
+ * - `height="100px"` // height: 100px
706
+ * - `height="1x 5x 10x"` // min-height: 1x; height: 5x; max-height: 10x
707
+ * - `height="min 2x"` // min-height: 2x
708
+ * - `height={true}` // height: auto
709
+ */
710
+ height?: CSSProperties['height'] | string | boolean;
711
+ /**
712
+ * Shorthand for border width, style, and color. Supports directional modifiers and design-system defaults.
713
+ *
714
+ * Syntax: `[width] [style] [color] [directions]` | `[directions]` | `true`
715
+ *
716
+ * Multiple groups can be separated by commas. Later groups override earlier groups for conflicting directions.
717
+ *
718
+ * Examples:
719
+ * - `border={true}` // default border on all sides (1bw solid)
720
+ * - `border="2bw dashed #purple"` // 2bw dashed purple border
721
+ * - `border="2bw top"` // only top border: 2bw solid
722
+ * - `border="dotted #danger left right"` // left/right: 1bw dotted danger
723
+ * - `border="1bw #red, 2bw #blue top"` // all sides red 1bw, top overridden to blue 2bw
724
+ * - `border="1bw, dashed top bottom, #purple left right"` // base 1bw, dashed on top/bottom, purple on left/right
725
+ */
726
+ border?: CSSProperties['border'] | string | boolean;
727
+ /**
728
+ * Powerful shorthand for CSS transitions using semantic names and design tokens. Supports grouped transitions for common UI effects.
729
+ *
730
+ * Semantic names: `fade`, `fill`, `border`, `radius`, `shadow`, `preset`, `gap`, `theme`
731
+ * Multiple transitions: separated by commas
732
+ *
733
+ * Examples:
734
+ * - `transition="fill 0.2s, radius 0.3s"` // transitions background-color and border-radius
735
+ * - `transition="fade 0.15s ease-in"` // transitions mask with easing
736
+ * - `transition="theme 0.3s"` // transitions all theme-related properties
737
+ * - `transition="preset 0.2s"` // transitions typography properties
738
+ */
739
+ transition?: CSSProperties['transition'] | string;
740
+ /**
741
+ * Whether the element is hidden using `display: none`. Boolean shortcut for conditional element visibility.
742
+ *
743
+ * Examples:
744
+ * - `hide={true}` // display: none
745
+ * - `hide={false}` // element remains visible
746
+ */
747
+ hide?: boolean;
748
+ /**
749
+ * The shadow style adds shadow effects around an element's frame. Supports multiple effects separated by commas with X/Y offsets, blur, spread radius, and color.
750
+ *
751
+ * Examples:
752
+ * - `shadow="1x .5x .5x #dark.50"` // custom shadow with Tasty units and colors
753
+ * - `shadow="0 1x 2x #dark.20"` // standard shadow syntax
754
+ * - `shadow={true}` // default shadow from design system
755
+ */
756
+ shadow?: string | boolean;
757
+ /**
758
+ * The radius style rounds the corners of an element's outer border edge. Supports custom units, advanced shapes, and directional modifiers.
759
+ *
760
+ * Syntax: `[value] [modifiers]` | `[shape]` | `true`
761
+ *
762
+ * Shapes: `round` (fully rounded), `ellipse` (50%), `leaf`, `backleaf` (asymmetric), `inherit` (inherit from parent)
763
+ * Directional modifiers: `top`, `right`, `bottom`, `left`
764
+ *
765
+ * Examples:
766
+ * - `radius="2r"` // border-radius: calc(var(--radius) * 2)
767
+ * - `radius={true}` // default radius (1r)
768
+ * - `radius="round"` // fully rounded (9999rem)
769
+ * - `radius="leaf"` // asymmetric leaf shape
770
+ * - `radius="1r top"` // round only top corners
771
+ * - `radius="inherit"` // inherit border-radius from parent
772
+ * - `radius="inherit right"` // inherit only right corners (uses longhand properties)
773
+ */
774
+ radius?: 'round' | 'ellipse' | 'leaf' | 'backleaf' | 'inherit' | string | true;
775
+ /**
776
+ * The flow style is a unified shorthand for controlling layout direction and wrapping in both flex and grid containers. Replaces `flexDirection` and `gridAutoFlow`.
777
+ *
778
+ * For flex: sets `flex-flow` (direction + wrapping)
779
+ * For grid: sets `grid-auto-flow` (direction + density)
780
+ * For block: determines gap direction (row/column)
781
+ *
782
+ * Syntax: `[direction] [wrap|dense]`
783
+ *
784
+ * Examples:
785
+ * - `flow="row wrap"` // flex-flow: row wrap
786
+ * - `flow="column dense"` // grid-auto-flow: column dense
787
+ * - `flow="row"` // primary axis direction
788
+ */
789
+ flow?: CSSProperties['flexFlow'] | CSSProperties['gridAutoFlow'] | string;
790
+ /**
791
+ * The gridAreas style specifies named grid areas, establishing cells in the grid and assigning them names.
792
+ *
793
+ * Examples:
794
+ * - `gridAreas='"header header" "sidebar content" "footer footer"'`
795
+ */
796
+ gridAreas?: CSSProperties['gridTemplateAreas'];
797
+ /**
798
+ * The gridColumns style defines line names and track sizing functions of grid columns.
799
+ *
800
+ * Examples:
801
+ * - `gridColumns="1fr 2fr 1fr"` // three columns with flex ratios
802
+ * - `gridColumns={3}` // three equal columns (shorthand)
803
+ * - `gridColumns="repeat(auto-fit, minmax(200px, 1fr))"` // responsive columns
804
+ */
805
+ gridColumns?: CSSProperties['gridTemplateColumns'] | number;
806
+ /**
807
+ * The gridRows style defines line names and track sizing functions of grid rows.
808
+ *
809
+ * Examples:
810
+ * - `gridRows="auto 1fr auto"` // header, content, footer layout
811
+ * - `gridRows={4}` // four equal rows (shorthand)
812
+ * - `gridRows="repeat(3, 100px)"` // three 100px rows
813
+ */
814
+ gridRows?: CSSProperties['gridTemplateRows'] | number;
815
+ /**
816
+ * The gridTemplate style is a shorthand property for defining grid columns, rows, and areas simultaneously.
817
+ *
818
+ * Examples:
819
+ * - `gridTemplate='"header header" auto "content sidebar" 1fr / 2fr 1fr'`
820
+ */
821
+ gridTemplate?: CSSProperties['gridTemplate'];
822
+ /**
823
+ * The font style specifies a prioritized list of font family names with design-system-driven defaults and fallbacks.
824
+ *
825
+ * Examples:
826
+ * - `font="monospace"` // monospace font stack
827
+ * - `font="Helvetica, Arial, sans-serif"` // custom font list
828
+ * - `font={true}` // default design system font
829
+ */
830
+ font?: CSSProperties['fontFamily'] | boolean;
831
+ /**
832
+ * The outline style sets the outline for the element.
833
+ *
834
+ * Syntax: `[width] [style] [color] / [offset]` | `true`
835
+ *
836
+ * Examples:
837
+ * - `outline="2ow dashed #purple"` // 2ow dashed purple outline
838
+ * - `outline="2ow #danger / 1x"` // 2ow solid danger outline, 1x offset
839
+ * - `outline={true}` // default outline (1ow solid)
840
+ */
841
+ outline?: string | boolean;
842
+ /**
843
+ * The outline offset style sets the offset of the outline.
844
+ *
845
+ * Examples:
846
+ * - `outlineOffset="4px"` // 4px offset
847
+ * - `outlineOffset="1x"` // 1x (8px) offset
848
+ */
849
+ outlineOffset?: string | number;
850
+ /**
851
+ * The preset style sets base text settings according to named presets. Affects `font-size`, `line-height`, `letter-spacing`, `font-weight`, and `text-transform`.
852
+ *
853
+ * Syntax: `name`, `name / modifier...`, or `modifier...` (shorthand, name defaults to `inherit`).
854
+ * Multiple modifiers are space-separated and combine freely (e.g. `strong italic tight`).
855
+ * Preset names are project-specific. Augment `TastyPresetNames` to register them for autocomplete.
856
+ *
857
+ * Examples:
858
+ * - `preset="h1"` // heading 1 typography
859
+ * - `preset="h2 / strong"` // bold heading 2
860
+ * - `preset="h2 / strong italic"` // bold + italic heading 2
861
+ * - `preset="t2 / strong tight"` // bold text 2 with tight line-height
862
+ * - `preset="bold"` // inherit with bold (shorthand)
863
+ * - `preset="bold italic"` // inherit with bold + italic (shorthand)
864
+ * - `preset="t3"` // text size 3
865
+ */
866
+ preset?: PresetName | (string & {});
867
+ /**
868
+ * Shorthand for `align-items` and `align-content`. Sets both properties for unified vertical alignment in flex/grid layouts.
869
+ *
870
+ * Examples:
871
+ * - `align="center"` // align-items: center; align-content: center
872
+ * - `align="flex-start"` // align both to start
873
+ * - `align="space-between"` // distribute space between items
874
+ */
875
+ align?: CSSProperties['alignItems'] | CSSProperties['alignContent'];
876
+ /**
877
+ * Shorthand for `justify-items` and `justify-content`. Sets both properties for unified horizontal alignment in flex/grid layouts.
878
+ *
879
+ * Examples:
880
+ * - `justify="center"` // justify-items: center; justify-content: center
881
+ * - `justify="space-between"` // distribute space between items
882
+ * - `justify="flex-end"` // align both to end
883
+ */
884
+ justify?: CSSProperties['justifyItems'] | CSSProperties['justifyContent'];
885
+ /**
886
+ * Shorthand for all placement properties. Sets all 4 longhands: align-items, justify-items, align-content, justify-content.
887
+ *
888
+ * Examples:
889
+ * - `place="center"` // all 4 longhands: center
890
+ * - `place="start end"` // align-*: start; justify-*: end
891
+ * - `place="stretch"` // all 4 longhands: stretch
892
+ */
893
+ place?: CSSProperties['placeItems'] | CSSProperties['placeContent'] | string;
894
+ /**
895
+ * Sets `place-content` property for aligning and distributing content in grid/flex containers.
896
+ *
897
+ * Examples:
898
+ * - `placeContent="center"` // center content in both axes
899
+ * - `placeContent="space-between"` // distribute content with space between
900
+ */
901
+ placeContent?: CSSProperties['placeContent'];
902
+ /**
903
+ * Sets `place-items` property for aligning items in grid/flex containers.
904
+ *
905
+ * Examples:
906
+ * - `placeItems="center"` // center items in both axes
907
+ * - `placeItems="start end"` // start on block axis, end on inline axis
908
+ */
909
+ placeItems?: CSSProperties['placeItems'];
910
+ /**
911
+ * Shorthand for scroll-margin on all sides. Supports custom units and directional modifiers.
912
+ *
913
+ * Examples:
914
+ * - `scrollMargin="2x"` // scroll-margin on all sides: 2x
915
+ * - `scrollMargin="2x top"` // only top scroll-margin: 2x
916
+ * - `scrollMargin={true}` // default scroll-margin on all sides
917
+ */
918
+ scrollMargin?: CSSProperties['scrollMargin'] | string | boolean;
919
+ scrollMarginTop?: string | number | boolean;
920
+ scrollMarginRight?: string | number | boolean;
921
+ scrollMarginBottom?: string | number | boolean;
922
+ scrollMarginLeft?: string | number | boolean;
923
+ scrollMarginBlock?: string | number | boolean;
924
+ scrollMarginInline?: string | number | boolean;
925
+ /**
926
+ * Shorthand for `top`, `right`, `bottom`, and `left` offsets. Supports custom units, directional modifiers, and positioning.
927
+ *
928
+ * Examples:
929
+ * - `inset="0"` // all sides: 0
930
+ * - `inset="2x top"` // only top offset: 2x
931
+ * - `inset="1x left right"` // left and right offsets: 1x
932
+ * - `inset={true}` // all sides: 0
933
+ */
934
+ inset?: 'top' | 'right' | 'bottom' | 'left' | string | CSSProperties['inset'];
935
+ /**
936
+ * Local keyframes definitions for this component.
937
+ * Keys are animation names, values are keyframes step definitions.
938
+ * Local keyframes override global keyframes with the same name.
939
+ *
940
+ * Examples:
941
+ * - `'@keyframes': { fadeIn: { from: { opacity: 0 }, to: { opacity: 1 } } }`
942
+ * - `'@keyframes': { pulse: { '0%, 100%': { transform: 'scale(1)' }, '50%': { transform: 'scale(1.05)' } } }`
943
+ */
944
+ '@keyframes'?: Record<string, KeyframesSteps>;
945
+ /**
946
+ * CSS @property definitions for custom properties using tasty token syntax.
947
+ * Properties are registered once and are permanent (never removed).
948
+ *
949
+ * Token formats:
950
+ * - `$name` for regular properties → `--name` (requires syntax to be specified)
951
+ * - `#name` for color properties → `--name-color` (auto-sets syntax: '<color>', defaults initialValue: 'transparent')
952
+ *
953
+ * Examples:
954
+ * - `'@properties': { '$rotation': { syntax: '<angle>', inherits: false, initialValue: '45deg' } }`
955
+ * - `'@properties': { '#theme': { initialValue: 'purple' } }` // syntax: '<color>' is auto-set
956
+ */
957
+ '@properties'?: Record<string, PropertyDefinition>;
958
+ /**
959
+ * Local @font-face definitions for this component.
960
+ * Keys are font-family names, values are descriptors or arrays of descriptors
961
+ * (for multiple weights/styles of the same family).
962
+ *
963
+ * Examples:
964
+ * - `'@fontFace': { Icons: { src: 'url("/fonts/icons.woff2") format("woff2")', fontDisplay: 'block' } }`
965
+ * - `'@fontFace': { 'Brand Sans': [{ src: '...', fontWeight: 400 }, { src: '...', fontWeight: 700 }] }`
966
+ */
967
+ '@fontFace'?: Record<string, FontFaceInput>;
968
+ /**
969
+ * Local @counter-style definitions for this component.
970
+ * Keys are counter-style names, values are descriptor objects.
971
+ *
972
+ * Examples:
973
+ * - `'@counterStyle': { thumbs: { system: 'cyclic', symbols: '"👍"', suffix: '" "' } }`
974
+ */
975
+ '@counterStyle'?: Record<string, CounterStyleDescriptors>;
976
+ /**
977
+ * Apply one or more predefined style recipes by name.
978
+ * Recipes are defined globally via `configure({ recipes: { ... } })`.
979
+ * Multiple recipes are space-separated. Use `/` to separate base recipes
980
+ * (applied before component styles) from post recipes (applied after, via mergeStyles).
981
+ * Use `none` to explicitly skip base recipes.
982
+ *
983
+ * Examples:
984
+ * - `recipe: 'card'` // Apply the 'card' recipe
985
+ * - `recipe: 'card elevated'` // Apply 'card' then 'elevated', then component styles
986
+ * - `recipe: 'reset input / input-autofill'` // Base recipes, then post recipe
987
+ * - `recipe: 'none / disabled'` // No base recipes, only post recipe
988
+ * - `recipe: ''` // Clear recipes from base styles when extending
989
+ */
990
+ recipe?: string;
991
+ }
992
+ type SuffixForSelector = '&' | '.' | 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'G' | 'H' | 'I' | 'J' | 'K' | 'L' | 'M' | 'N' | 'O' | 'P' | 'Q' | 'R' | 'S' | 'T' | 'U' | 'V' | 'W' | 'X' | 'Y' | 'Z';
993
+ type Selector = `${SuffixForSelector}${string}`;
994
+ type NotSelector = Exclude<string, Selector | keyof StylesInterface>;
995
+ /** Special style keys that should not be wrapped in StyleValue/StyleValueStateMap */
996
+ type SpecialStyleKeys = '@keyframes' | '@properties' | '@fontFace' | '@counterStyle' | 'recipe';
997
+ type StylesWithoutSelectors = { [key in keyof StylesInterface as key extends SpecialStyleKeys ? never : key]?: StyleValue<StylesInterface[key]> | StyleValueStateMap<StylesInterface[key]> };
998
+ /**
999
+ * Index signature for recipe-specific arbitrary keys.
1000
+ * Supports local predefined states (`@name`), vendor-prefixed CSS properties (`-webkit-*`),
1001
+ * CSS custom properties (`$name`), and color tokens (`#name`).
1002
+ * Unlike StylesIndexSignature, does NOT allow sub-element selectors (recipes are flat).
1003
+ */
1004
+ type RecipeIndexSignature = Record<string, StyleValue<string | number | boolean | undefined> | StyleValueStateMap<string | number | boolean | undefined>>;
1005
+ /**
1006
+ * Style type for recipe definitions.
1007
+ * Like StylesWithoutSelectors but also allows `@keyframes`, `@properties`,
1008
+ * local predefined states, and vendor-prefixed CSS properties.
1009
+ * Excludes `recipe` to prevent recursive references.
1010
+ */
1011
+ type RecipeStyles = StylesWithoutSelectors & RecipeIndexSignature & {
1012
+ '@keyframes'?: StylesInterface['@keyframes'];
1013
+ '@properties'?: StylesInterface['@properties'];
1014
+ '@fontFace'?: StylesInterface['@fontFace'];
1015
+ '@counterStyle'?: StylesInterface['@counterStyle'];
1016
+ };
1017
+ /** Special properties that are not regular style values */
1018
+ interface SpecialStyleProperties {
1019
+ '@keyframes'?: StylesInterface['@keyframes'];
1020
+ '@properties'?: StylesInterface['@properties'];
1021
+ '@fontFace'?: StylesInterface['@fontFace'];
1022
+ '@counterStyle'?: StylesInterface['@counterStyle'];
1023
+ recipe?: StylesInterface['recipe'];
1024
+ }
1025
+ /** Index signature for arbitrary style keys (sub-elements, CSS variables, etc.) */
1026
+ interface StylesIndexSignature {
1027
+ [key: string]: StyleValue<string | number | boolean | undefined> | StyleValueStateMap<string | number | boolean | undefined> | Styles | false | StylesInterface['@keyframes'] | StylesInterface['@properties'] | StylesInterface['@fontFace'] | StylesInterface['@counterStyle'];
1028
+ /**
1029
+ * Selector combinator: `undefined` (descendant, default), `'>'` (child), `'+'` (adjacent), `'~'` (sibling).
1030
+ * Can chain with capitalized names: `'> Body > Row >'`. Spaces required around combinators.
1031
+ */
1032
+ $?: string;
1033
+ }
1034
+ type Styles = StylesWithoutSelectors & SpecialStyleProperties & StylesIndexSignature;
1035
+ /**
1036
+ * Value type for design tokens passed to `configure({ tokens })`.
1037
+ * Can be a direct value or a state map for responsive/theme-aware tokens.
1038
+ */
1039
+ type ConfigTokenValue = string | number | boolean | Record<string, string | number | boolean | undefined | null | '@inherit'>;
1040
+ /**
1041
+ * Design tokens injected as CSS custom properties on `:root`.
1042
+ * Keys must start with `$` (value tokens) or `#` (color tokens).
1043
+ *
1044
+ * - `$name` keys become `--name` CSS custom properties
1045
+ * - `#name` keys become `--name-color` and `--name-color-{colorSpace}` properties
1046
+ */
1047
+ type ConfigTokens = Record<`$${string}` | `#${string}`, ConfigTokenValue>;
1048
+ //#endregion
1049
+ //#region src/pipeline/conditions.d.ts
1050
+ /**
1051
+ * ConditionNode Types and Helpers
1052
+ *
1053
+ * Core data structures for representing style conditions as an abstract syntax tree.
1054
+ * Used throughout the pipeline for parsing, simplification, and CSS generation.
1055
+ */
1056
+ /**
1057
+ * Base interface for all state conditions (leaf nodes)
1058
+ */
1059
+ interface BaseStateCondition {
1060
+ kind: 'state';
1061
+ negated: boolean;
1062
+ raw: string;
1063
+ uniqueId: string;
1064
+ }
1065
+ /**
1066
+ * Modifier condition: [data-attr] or [data-attr="value"]
1067
+ */
1068
+ interface ModifierCondition extends BaseStateCondition {
1069
+ type: 'modifier';
1070
+ attribute: string;
1071
+ value?: string;
1072
+ operator?: '=' | '^=' | '$=' | '*=';
1073
+ }
1074
+ /**
1075
+ * Pseudo-class condition: :hover, :focus-visible
1076
+ */
1077
+ interface PseudoCondition extends BaseStateCondition {
1078
+ type: 'pseudo';
1079
+ pseudo: string;
1080
+ }
1081
+ /**
1082
+ * Numeric bound for dimension queries
1083
+ */
1084
+ interface NumericBound {
1085
+ value: string;
1086
+ valueNumeric: number | null;
1087
+ inclusive: boolean;
1088
+ }
1089
+ /**
1090
+ * Media query condition
1091
+ */
1092
+ interface MediaCondition extends BaseStateCondition {
1093
+ type: 'media';
1094
+ subtype: 'dimension' | 'feature' | 'type';
1095
+ dimension?: 'width' | 'height' | 'inline-size' | 'block-size';
1096
+ lowerBound?: NumericBound;
1097
+ upperBound?: NumericBound;
1098
+ feature?: string;
1099
+ featureValue?: string;
1100
+ mediaType?: 'print' | 'screen' | 'all' | 'speech';
1101
+ }
1102
+ /**
1103
+ * Container query condition
1104
+ */
1105
+ interface ContainerCondition extends BaseStateCondition {
1106
+ type: 'container';
1107
+ subtype: 'dimension' | 'style' | 'raw';
1108
+ containerName?: string;
1109
+ dimension?: 'width' | 'height' | 'inline-size' | 'block-size';
1110
+ lowerBound?: NumericBound;
1111
+ upperBound?: NumericBound;
1112
+ property?: string;
1113
+ propertyValue?: string;
1114
+ rawCondition?: string;
1115
+ }
1116
+ /**
1117
+ * Root state condition: @root(theme=dark)
1118
+ */
1119
+ interface RootCondition extends BaseStateCondition {
1120
+ type: 'root';
1121
+ innerCondition: ConditionNode;
1122
+ }
1123
+ /**
1124
+ * Parent state condition: @parent(hovered), @parent(theme=dark, >)
1125
+ */
1126
+ interface ParentCondition extends BaseStateCondition {
1127
+ type: 'parent';
1128
+ innerCondition: ConditionNode;
1129
+ direct: boolean;
1130
+ }
1131
+ /**
1132
+ * Own state condition: @own(hovered)
1133
+ */
1134
+ interface OwnCondition extends BaseStateCondition {
1135
+ type: 'own';
1136
+ innerCondition: ConditionNode;
1137
+ }
1138
+ /**
1139
+ * Starting style condition: @starting
1140
+ */
1141
+ interface StartingCondition extends BaseStateCondition {
1142
+ type: 'starting';
1143
+ }
1144
+ /**
1145
+ * Supports query condition: @supports(display: grid), @supports($, :has(*))
1146
+ */
1147
+ interface SupportsCondition extends BaseStateCondition {
1148
+ type: 'supports';
1149
+ subtype: 'feature' | 'selector';
1150
+ condition: string;
1151
+ }
1152
+ /**
1153
+ * Union of all state condition types
1154
+ */
1155
+ type StateCondition = ModifierCondition | PseudoCondition | MediaCondition | ContainerCondition | RootCondition | ParentCondition | OwnCondition | StartingCondition | SupportsCondition;
1156
+ /**
1157
+ * Compound node: combines conditions with AND/OR
1158
+ */
1159
+ interface CompoundCondition {
1160
+ kind: 'compound';
1161
+ operator: 'AND' | 'OR';
1162
+ children: ConditionNode[];
1163
+ }
1164
+ /**
1165
+ * True condition (matches everything)
1166
+ */
1167
+ interface TrueCondition {
1168
+ kind: 'true';
1169
+ }
1170
+ /**
1171
+ * False condition (matches nothing - skip this rule)
1172
+ */
1173
+ interface FalseCondition {
1174
+ kind: 'false';
1175
+ }
1176
+ /**
1177
+ * Union of all condition node types
1178
+ */
1179
+ type ConditionNode = StateCondition | CompoundCondition | TrueCondition | FalseCondition;
1180
+ //#endregion
1181
+ //#region src/states/index.d.ts
1182
+ /**
1183
+ * Parsed advanced state information
1184
+ */
1185
+ interface ParsedAdvancedState {
1186
+ type: 'media' | 'container' | 'root' | 'parent' | 'own' | 'starting' | 'predefined' | 'modifier';
1187
+ condition: string;
1188
+ containerName?: string;
1189
+ raw: string;
1190
+ mediaType?: string;
1191
+ }
1192
+ /**
1193
+ * Context for state parsing operations
1194
+ */
1195
+ interface StateParserContext {
1196
+ localPredefinedStates: Record<string, string>;
1197
+ globalPredefinedStates: Record<string, string>;
1198
+ isSubElement?: boolean;
1199
+ }
1200
+ /**
1201
+ * At-rule context for CSS generation
1202
+ */
1203
+ interface AtRuleContext {
1204
+ media?: string[];
1205
+ container?: {
1206
+ name?: string;
1207
+ condition: string;
1208
+ }[];
1209
+ startingStyle?: boolean;
1210
+ rootStates?: string[];
1211
+ negatedRootStates?: string[];
1212
+ }
1213
+ /**
1214
+ * Configure global predefined states
1215
+ */
1216
+ declare function setGlobalPredefinedStates(states: Record<string, string>): void;
1217
+ /**
1218
+ * Get global predefined states
1219
+ */
1220
+ declare function getGlobalPredefinedStates(): Record<string, string>;
1221
+ /**
1222
+ * Create a state parser context from styles
1223
+ */
1224
+ declare function createStateParserContext(styles?: Styles, isSubElement?: boolean): StateParserContext;
1225
+ //#endregion
1226
+ //#region src/pipeline/parseStateKey.d.ts
1227
+ interface ParseStateKeyOptions {
1228
+ context?: StateParserContext;
1229
+ isSubElement?: boolean;
1230
+ }
1231
+ /**
1232
+ * Parse a state key string into a ConditionNode
1233
+ */
1234
+ declare function parseStateKey(stateKey: string, options?: ParseStateKeyOptions): ConditionNode;
1235
+ //#endregion
1236
+ //#region src/pipeline/index.d.ts
1237
+ /**
1238
+ * Matches the old StyleResult interface for backward compatibility
1239
+ */
1240
+ interface StyleResult {
1241
+ selector: string;
1242
+ declarations: string;
1243
+ atRules?: string[];
1244
+ needsClassName?: boolean;
1245
+ rootPrefix?: string;
1246
+ /** When true, declarations are wrapped in @starting-style { ... } inside the selector rule */
1247
+ startingStyle?: boolean;
1248
+ }
1249
+ /**
1250
+ * Matches the old RenderResult interface for backward compatibility
1251
+ */
1252
+ interface RenderResult {
1253
+ rules: StyleResult[];
1254
+ className?: string;
1255
+ }
1256
+ /**
1257
+ * Check if a key is a CSS selector
1258
+ */
1259
+ declare function isSelector(key: string): boolean;
1260
+ /**
1261
+ * Options for renderStyles when using direct selector mode.
1262
+ */
1263
+ interface RenderStylesOptions {
1264
+ /**
1265
+ * Whether to double the class selector for increased specificity.
1266
+ * When true, `.myClass` becomes `.myClass.myClass` for higher specificity.
1267
+ *
1268
+ * @default false - User-provided selectors are not doubled.
1269
+ *
1270
+ * Note: This only applies when a classNameOrSelector is provided.
1271
+ * When renderStyles returns RenderResult with needsClassName=true,
1272
+ * the injector handles doubling automatically.
1273
+ */
1274
+ doubleSelector?: boolean;
1275
+ }
1276
+ /**
1277
+ * Render styles to CSS rules.
1278
+ *
1279
+ * When called without classNameOrSelector, returns RenderResult with needsClassName=true.
1280
+ * When called with a selector/className string, returns StyleResult[] for direct injection.
1281
+ */
1282
+ declare function renderStyles(styles?: Styles, classNameOrSelector?: undefined, options?: undefined, pipelineCacheKey?: string): RenderResult;
1283
+ declare function renderStyles(styles: Styles | undefined, classNameOrSelector: string, options?: RenderStylesOptions): StyleResult[];
1284
+ //#endregion
1285
+ export { strToRgb as $, RawStyleHandler as A, getGlobalFuncs as B, SuffixForSelector as C, RawCSSResult as Ct, CUSTOM_UNITS as D, StyleInjectorConfig as Dt, CSSMap as E, SheetInfo as Et, StylePropValue as F, parseStyle as G, getGlobalPredefinedTokens as H, StyleValue as I, stringifyStyles as J, resetGlobalPredefinedTokens as K, StyleValueStateMap as L, StyleHandlerDefinition as M, StyleHandlerResult as N, DIRECTIONS as O, StyleRule as Ot, StyleMap as P, hslToRgbValues as Q, customFunc as R, StylesWithoutSelectors as S, PropertyDefinition as St, TastyPresetNames as T, RuleInfo as Tt, normalizeColorTokenValue as U, getGlobalParser as V, parseColor as W, getRgbValuesFromRgbaString as X, getNamedColorHex as Y, hexToRgb as Z, NotSelector as _, InjectionMode as _t, ParseStateKeyOptions as a, StyleDetailsPart as at, Styles as b, KeyframesResult as bt, ParsedAdvancedState as c, CacheMetrics as ct, getGlobalPredefinedStates as d, FontFaceDescriptors as dt, StyleParser as et, setGlobalPredefinedStates as f, FontFaceInput as ft, NoType as g, InjectResult as gt, ConfigTokens as h, GlobalInjectResult as ht, renderStyles as i, StyleDetails as it, StyleHandler as j, ParsedColor as k, StyleUsage as kt, StateParserContext as l, CounterStyleDescriptors as lt, ConfigTokenValue as m, GCOptions as mt, StyleResult as n, ParserOptions as nt, parseStateKey as o, UnitHandler as ot, ConditionNode as p, GCConfig as pt, setGlobalPredefinedTokens as q, isSelector as r, ProcessedStyle as rt, AtRuleContext as s, CSSProperties as st, RenderResult as t, Bucket as tt, createStateParserContext as u, DisposeFunction as ut, RecipeStyles as v, KeyframesCacheEntry as vt, TastyNamedColors as w, RootRegistry as wt, StylesInterface as x, KeyframesSteps as xt, Selector as y, KeyframesInfo as yt, filterMods as z };
1286
+ //# sourceMappingURL=index-tcHuMPFt.d.ts.map