@tenphi/tasty 2.0.3 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (323) 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.js → collector-DrgDE7QB.js} +5 -10
  4. package/dist/collector-DrgDE7QB.js.map +1 -0
  5. package/dist/{ssr/collector.d.ts → collector-LuU1vZ68.d.ts} +3 -3
  6. package/dist/config-_aQ_PZ-P.js +10131 -0
  7. package/dist/config-_aQ_PZ-P.js.map +1 -0
  8. package/dist/config-vuCRkBWX.d.ts +884 -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 +6 -27
  13. package/dist/core-BqO8pplb.js +1592 -0
  14. package/dist/core-BqO8pplb.js.map +1 -0
  15. package/dist/{zero/extractor.js → css-writer-D--REwtp.js} +74 -11
  16. package/dist/css-writer-D--REwtp.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-xwteB7a1.js +143 -0
  20. package/dist/format-rules-xwteB7a1.js.map +1 -0
  21. package/dist/{ssr/hydrate.js → hydrate-BvPT4ndL.js} +3 -3
  22. package/dist/hydrate-BvPT4ndL.js.map +1 -0
  23. package/dist/index-ZRxZWzlj.d.ts +1602 -0
  24. package/dist/{styles/types.d.ts → index-dUtwpOux.d.ts} +707 -5
  25. package/dist/index.d.ts +5 -51
  26. package/dist/index.js +732 -36
  27. package/dist/index.js.map +1 -0
  28. package/dist/keyframes-ClPFWy33.js +587 -0
  29. package/dist/keyframes-ClPFWy33.js.map +1 -0
  30. package/dist/{utils/merge-styles.js → merge-styles-BUQsEpbv.js} +3 -4
  31. package/dist/merge-styles-BUQsEpbv.js.map +1 -0
  32. package/dist/{utils/merge-styles.d.ts → merge-styles-CtDJMhpJ.d.ts} +3 -3
  33. package/dist/{utils/resolve-recipes.js → resolve-recipes-C0-AMzCz.js} +4 -6
  34. package/dist/resolve-recipes-C0-AMzCz.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/docs/injector.md +2 -2
  51. package/package.json +10 -9
  52. package/dist/_virtual/_rolldown/runtime.js +0 -7
  53. package/dist/chunks/cacheKey.d.ts +0 -1
  54. package/dist/chunks/cacheKey.js +0 -77
  55. package/dist/chunks/cacheKey.js.map +0 -1
  56. package/dist/chunks/definitions.d.ts +0 -37
  57. package/dist/chunks/definitions.js +0 -258
  58. package/dist/chunks/definitions.js.map +0 -1
  59. package/dist/chunks/index.d.ts +0 -1
  60. package/dist/chunks/renderChunk.d.ts +0 -1
  61. package/dist/chunks/renderChunk.js +0 -59
  62. package/dist/chunks/renderChunk.js.map +0 -1
  63. package/dist/compute-styles.d.ts +0 -31
  64. package/dist/compute-styles.js +0 -322
  65. package/dist/compute-styles.js.map +0 -1
  66. package/dist/config.d.ts +0 -407
  67. package/dist/config.js +0 -591
  68. package/dist/config.js.map +0 -1
  69. package/dist/counter-style/index.js +0 -51
  70. package/dist/counter-style/index.js.map +0 -1
  71. package/dist/debug.d.ts +0 -89
  72. package/dist/debug.js +0 -453
  73. package/dist/debug.js.map +0 -1
  74. package/dist/font-face/index.js +0 -63
  75. package/dist/font-face/index.js.map +0 -1
  76. package/dist/hooks/index.d.ts +0 -7
  77. package/dist/hooks/useCounterStyle.d.ts +0 -36
  78. package/dist/hooks/useCounterStyle.js +0 -65
  79. package/dist/hooks/useCounterStyle.js.map +0 -1
  80. package/dist/hooks/useFontFace.d.ts +0 -45
  81. package/dist/hooks/useFontFace.js +0 -66
  82. package/dist/hooks/useFontFace.js.map +0 -1
  83. package/dist/hooks/useGlobalStyles.d.ts +0 -46
  84. package/dist/hooks/useGlobalStyles.js +0 -88
  85. package/dist/hooks/useGlobalStyles.js.map +0 -1
  86. package/dist/hooks/useKeyframes.d.ts +0 -58
  87. package/dist/hooks/useKeyframes.js +0 -55
  88. package/dist/hooks/useKeyframes.js.map +0 -1
  89. package/dist/hooks/useProperty.d.ts +0 -81
  90. package/dist/hooks/useProperty.js +0 -96
  91. package/dist/hooks/useProperty.js.map +0 -1
  92. package/dist/hooks/useRawCSS.d.ts +0 -22
  93. package/dist/hooks/useRawCSS.js +0 -103
  94. package/dist/hooks/useRawCSS.js.map +0 -1
  95. package/dist/hooks/useStyles.d.ts +0 -40
  96. package/dist/hooks/useStyles.js +0 -31
  97. package/dist/hooks/useStyles.js.map +0 -1
  98. package/dist/injector/index.d.ts +0 -182
  99. package/dist/injector/index.js +0 -185
  100. package/dist/injector/index.js.map +0 -1
  101. package/dist/injector/injector.d.ts +0 -198
  102. package/dist/injector/injector.js +0 -651
  103. package/dist/injector/injector.js.map +0 -1
  104. package/dist/injector/sheet-manager.d.ts +0 -132
  105. package/dist/injector/sheet-manager.js +0 -699
  106. package/dist/injector/sheet-manager.js.map +0 -1
  107. package/dist/injector/types.d.ts +0 -235
  108. package/dist/keyframes/index.js +0 -206
  109. package/dist/keyframes/index.js.map +0 -1
  110. package/dist/parser/classify.js +0 -319
  111. package/dist/parser/classify.js.map +0 -1
  112. package/dist/parser/const.js +0 -60
  113. package/dist/parser/const.js.map +0 -1
  114. package/dist/parser/lru.js +0 -109
  115. package/dist/parser/lru.js.map +0 -1
  116. package/dist/parser/parser.d.ts +0 -25
  117. package/dist/parser/parser.js +0 -115
  118. package/dist/parser/parser.js.map +0 -1
  119. package/dist/parser/tokenizer.js +0 -69
  120. package/dist/parser/tokenizer.js.map +0 -1
  121. package/dist/parser/types.d.ts +0 -51
  122. package/dist/parser/types.js +0 -46
  123. package/dist/parser/types.js.map +0 -1
  124. package/dist/pipeline/conditions.d.ts +0 -134
  125. package/dist/pipeline/conditions.js +0 -406
  126. package/dist/pipeline/conditions.js.map +0 -1
  127. package/dist/pipeline/exclusive.js +0 -389
  128. package/dist/pipeline/exclusive.js.map +0 -1
  129. package/dist/pipeline/index.d.ts +0 -55
  130. package/dist/pipeline/index.js +0 -749
  131. package/dist/pipeline/index.js.map +0 -1
  132. package/dist/pipeline/materialize-contradictions.js +0 -125
  133. package/dist/pipeline/materialize-contradictions.js.map +0 -1
  134. package/dist/pipeline/materialize.js +0 -1038
  135. package/dist/pipeline/materialize.js.map +0 -1
  136. package/dist/pipeline/parseStateKey.d.ts +0 -15
  137. package/dist/pipeline/parseStateKey.js +0 -446
  138. package/dist/pipeline/parseStateKey.js.map +0 -1
  139. package/dist/pipeline/simplify.js +0 -725
  140. package/dist/pipeline/simplify.js.map +0 -1
  141. package/dist/pipeline/warnings.js +0 -18
  142. package/dist/pipeline/warnings.js.map +0 -1
  143. package/dist/plugins/index.d.ts +0 -2
  144. package/dist/plugins/okhsl-plugin.d.ts +0 -35
  145. package/dist/plugins/okhsl-plugin.js +0 -97
  146. package/dist/plugins/okhsl-plugin.js.map +0 -1
  147. package/dist/plugins/types.d.ts +0 -87
  148. package/dist/properties/index.js +0 -222
  149. package/dist/properties/index.js.map +0 -1
  150. package/dist/properties/property-type-resolver.d.ts +0 -24
  151. package/dist/properties/property-type-resolver.js +0 -90
  152. package/dist/properties/property-type-resolver.js.map +0 -1
  153. package/dist/rsc-cache.js +0 -79
  154. package/dist/rsc-cache.js.map +0 -1
  155. package/dist/ssr/async-storage.d.ts +0 -17
  156. package/dist/ssr/async-storage.js.map +0 -1
  157. package/dist/ssr/collect-auto-properties.js +0 -58
  158. package/dist/ssr/collect-auto-properties.js.map +0 -1
  159. package/dist/ssr/collector.js.map +0 -1
  160. package/dist/ssr/context.js.map +0 -1
  161. package/dist/ssr/format-global-rules.js.map +0 -1
  162. package/dist/ssr/format-keyframes.js +0 -69
  163. package/dist/ssr/format-keyframes.js.map +0 -1
  164. package/dist/ssr/format-property.js +0 -49
  165. package/dist/ssr/format-property.js.map +0 -1
  166. package/dist/ssr/format-rules.js +0 -73
  167. package/dist/ssr/format-rules.js.map +0 -1
  168. package/dist/ssr/hydrate.d.ts +0 -29
  169. package/dist/ssr/hydrate.js.map +0 -1
  170. package/dist/ssr/ssr-collector-ref.js +0 -29
  171. package/dist/ssr/ssr-collector-ref.js.map +0 -1
  172. package/dist/states/index.d.ts +0 -49
  173. package/dist/states/index.js +0 -170
  174. package/dist/states/index.js.map +0 -1
  175. package/dist/static/tastyStatic.d.ts +0 -46
  176. package/dist/static/tastyStatic.js +0 -30
  177. package/dist/static/tastyStatic.js.map +0 -1
  178. package/dist/static/types.d.ts +0 -49
  179. package/dist/static/types.js +0 -24
  180. package/dist/static/types.js.map +0 -1
  181. package/dist/styles/border.d.ts +0 -25
  182. package/dist/styles/border.js +0 -120
  183. package/dist/styles/border.js.map +0 -1
  184. package/dist/styles/color.d.ts +0 -14
  185. package/dist/styles/color.js +0 -26
  186. package/dist/styles/color.js.map +0 -1
  187. package/dist/styles/const.js +0 -17
  188. package/dist/styles/const.js.map +0 -1
  189. package/dist/styles/createStyle.js +0 -79
  190. package/dist/styles/createStyle.js.map +0 -1
  191. package/dist/styles/dimension.js +0 -109
  192. package/dist/styles/dimension.js.map +0 -1
  193. package/dist/styles/directional.js +0 -133
  194. package/dist/styles/directional.js.map +0 -1
  195. package/dist/styles/display.d.ts +0 -30
  196. package/dist/styles/display.js +0 -73
  197. package/dist/styles/display.js.map +0 -1
  198. package/dist/styles/fade.d.ts +0 -15
  199. package/dist/styles/fade.js +0 -62
  200. package/dist/styles/fade.js.map +0 -1
  201. package/dist/styles/fill.d.ts +0 -42
  202. package/dist/styles/fill.js +0 -51
  203. package/dist/styles/fill.js.map +0 -1
  204. package/dist/styles/flow.d.ts +0 -16
  205. package/dist/styles/flow.js +0 -12
  206. package/dist/styles/flow.js.map +0 -1
  207. package/dist/styles/gap.d.ts +0 -31
  208. package/dist/styles/gap.js +0 -38
  209. package/dist/styles/gap.js.map +0 -1
  210. package/dist/styles/height.d.ts +0 -17
  211. package/dist/styles/height.js +0 -19
  212. package/dist/styles/height.js.map +0 -1
  213. package/dist/styles/index.d.ts +0 -1
  214. package/dist/styles/index.js +0 -8
  215. package/dist/styles/index.js.map +0 -1
  216. package/dist/styles/inset.d.ts +0 -24
  217. package/dist/styles/inset.js +0 -34
  218. package/dist/styles/inset.js.map +0 -1
  219. package/dist/styles/list.d.ts +0 -16
  220. package/dist/styles/list.js +0 -100
  221. package/dist/styles/list.js.map +0 -1
  222. package/dist/styles/margin.d.ts +0 -24
  223. package/dist/styles/margin.js +0 -32
  224. package/dist/styles/margin.js.map +0 -1
  225. package/dist/styles/outline.d.ts +0 -29
  226. package/dist/styles/outline.js +0 -55
  227. package/dist/styles/outline.js.map +0 -1
  228. package/dist/styles/padding.d.ts +0 -24
  229. package/dist/styles/padding.js +0 -32
  230. package/dist/styles/padding.js.map +0 -1
  231. package/dist/styles/placement.d.ts +0 -37
  232. package/dist/styles/placement.js +0 -74
  233. package/dist/styles/placement.js.map +0 -1
  234. package/dist/styles/predefined.d.ts +0 -71
  235. package/dist/styles/predefined.js +0 -237
  236. package/dist/styles/predefined.js.map +0 -1
  237. package/dist/styles/preset.d.ts +0 -52
  238. package/dist/styles/preset.js +0 -127
  239. package/dist/styles/preset.js.map +0 -1
  240. package/dist/styles/radius.d.ts +0 -12
  241. package/dist/styles/radius.js +0 -83
  242. package/dist/styles/radius.js.map +0 -1
  243. package/dist/styles/scrollMargin.d.ts +0 -24
  244. package/dist/styles/scrollMargin.js +0 -32
  245. package/dist/styles/scrollMargin.js.map +0 -1
  246. package/dist/styles/scrollbar.d.ts +0 -25
  247. package/dist/styles/scrollbar.js +0 -51
  248. package/dist/styles/scrollbar.js.map +0 -1
  249. package/dist/styles/shadow.d.ts +0 -14
  250. package/dist/styles/shadow.js +0 -25
  251. package/dist/styles/shadow.js.map +0 -1
  252. package/dist/styles/shared.js +0 -17
  253. package/dist/styles/shared.js.map +0 -1
  254. package/dist/styles/transition.d.ts +0 -14
  255. package/dist/styles/transition.js +0 -159
  256. package/dist/styles/transition.js.map +0 -1
  257. package/dist/styles/width.d.ts +0 -17
  258. package/dist/styles/width.js +0 -19
  259. package/dist/styles/width.js.map +0 -1
  260. package/dist/tasty.d.ts +0 -134
  261. package/dist/tasty.js +0 -248
  262. package/dist/tasty.js.map +0 -1
  263. package/dist/types.d.ts +0 -184
  264. package/dist/utils/cache-wrapper.js +0 -21
  265. package/dist/utils/cache-wrapper.js.map +0 -1
  266. package/dist/utils/case-converter.js +0 -8
  267. package/dist/utils/case-converter.js.map +0 -1
  268. package/dist/utils/color-math.d.ts +0 -46
  269. package/dist/utils/color-math.js +0 -749
  270. package/dist/utils/color-math.js.map +0 -1
  271. package/dist/utils/color-space.d.ts +0 -5
  272. package/dist/utils/color-space.js +0 -228
  273. package/dist/utils/color-space.js.map +0 -1
  274. package/dist/utils/colors.d.ts +0 -5
  275. package/dist/utils/colors.js +0 -10
  276. package/dist/utils/colors.js.map +0 -1
  277. package/dist/utils/css-types.d.ts +0 -7
  278. package/dist/utils/deps-equal.js +0 -15
  279. package/dist/utils/deps-equal.js.map +0 -1
  280. package/dist/utils/dotize.d.ts +0 -26
  281. package/dist/utils/dotize.js +0 -122
  282. package/dist/utils/dotize.js.map +0 -1
  283. package/dist/utils/filter-base-props.d.ts +0 -15
  284. package/dist/utils/filter-base-props.js +0 -45
  285. package/dist/utils/filter-base-props.js.map +0 -1
  286. package/dist/utils/get-display-name.d.ts +0 -7
  287. package/dist/utils/get-display-name.js +0 -10
  288. package/dist/utils/get-display-name.js.map +0 -1
  289. package/dist/utils/has-keys.js +0 -13
  290. package/dist/utils/has-keys.js.map +0 -1
  291. package/dist/utils/hash.js +0 -14
  292. package/dist/utils/hash.js.map +0 -1
  293. package/dist/utils/is-dev-env.js +0 -19
  294. package/dist/utils/is-dev-env.js.map +0 -1
  295. package/dist/utils/is-valid-element-type.js +0 -15
  296. package/dist/utils/is-valid-element-type.js.map +0 -1
  297. package/dist/utils/merge-styles.js.map +0 -1
  298. package/dist/utils/mod-attrs.d.ts +0 -6
  299. package/dist/utils/mod-attrs.js +0 -20
  300. package/dist/utils/mod-attrs.js.map +0 -1
  301. package/dist/utils/process-tokens.d.ts +0 -17
  302. package/dist/utils/process-tokens.js +0 -83
  303. package/dist/utils/process-tokens.js.map +0 -1
  304. package/dist/utils/resolve-recipes.d.ts +0 -17
  305. package/dist/utils/resolve-recipes.js.map +0 -1
  306. package/dist/utils/selector-transform.js +0 -32
  307. package/dist/utils/selector-transform.js.map +0 -1
  308. package/dist/utils/string.js +0 -8
  309. package/dist/utils/string.js.map +0 -1
  310. package/dist/utils/styles.d.ts +0 -99
  311. package/dist/utils/styles.js +0 -220
  312. package/dist/utils/styles.js.map +0 -1
  313. package/dist/utils/typography.d.ts +0 -58
  314. package/dist/utils/typography.js +0 -51
  315. package/dist/utils/typography.js.map +0 -1
  316. package/dist/utils/warnings.d.ts +0 -16
  317. package/dist/utils/warnings.js +0 -16
  318. package/dist/utils/warnings.js.map +0 -1
  319. package/dist/zero/css-writer.d.ts +0 -45
  320. package/dist/zero/css-writer.js +0 -73
  321. package/dist/zero/css-writer.js.map +0 -1
  322. package/dist/zero/extractor.d.ts +0 -24
  323. package/dist/zero/extractor.js.map +0 -1
@@ -1,5 +1,4 @@
1
- import { isDevEnv } from "./is-dev-env.js";
2
- import { isSelector } from "../pipeline/index.js";
1
+ import { b as isSelector, st as isDevEnv } from "./config-_aQ_PZ-P.js";
3
2
  //#region src/utils/merge-styles.ts
4
3
  const devMode = isDevEnv();
5
4
  const INHERIT_VALUE = "@inherit";
@@ -140,6 +139,6 @@ function mergeStyles(...objects) {
140
139
  return styles;
141
140
  }
142
141
  //#endregion
143
- export { mergeStyles };
142
+ export { mergeStyles as t };
144
143
 
145
- //# sourceMappingURL=merge-styles.js.map
144
+ //# sourceMappingURL=merge-styles-BUQsEpbv.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"merge-styles-BUQsEpbv.js","names":[],"sources":["../src/utils/merge-styles.ts"],"sourcesContent":["import { isSelector } from '../pipeline';\nimport type { Styles, StylesWithoutSelectors } from '../styles/types';\n\nimport { isDevEnv } from './is-dev-env';\n\nconst devMode = isDevEnv();\n\nconst INHERIT_VALUE = '@inherit';\n\n/**\n * Check if a value is a state map (object, not array).\n */\nfunction isStateMap(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\n/**\n * Normalize a parent value to a state map.\n * - Already a state map → return as-is\n * - Non-null, non-false primitive → wrap as `{ '': value }`\n * - null / undefined / false → return null (no parent to merge with)\n */\nfunction normalizeToStateMap(value: unknown): Record<string, unknown> | null {\n if (isStateMap(value)) return value as Record<string, unknown>;\n if (value != null && value !== false) return { '': value };\n return null;\n}\n\n/**\n * Resolve a child state map against a parent value.\n *\n * Mode is determined by whether the child contains a `''` (default) key:\n * - No `''` → extend mode: parent entries preserved, child adds/overrides/repositions\n * - Has `''` → replace mode: child defines everything, `@inherit` cherry-picks from parent\n *\n * In both modes:\n * - `@inherit` value → resolve from parent state map\n * - `null` value → remove this state from the result\n * - `false` value → tombstone, persists through all layers, blocks recipe\n */\nfunction resolveStateMap(\n parentValue: unknown,\n childMap: Record<string, unknown>,\n): Record<string, unknown> {\n const isExtend = !('' in childMap);\n const parentMap = normalizeToStateMap(parentValue);\n\n if (!parentMap) {\n // No parent to merge with — strip nulls and @inherit, return child entries\n const result: Record<string, unknown> = {};\n for (const key of Object.keys(childMap)) {\n const val = childMap[key];\n if (val === null || val === INHERIT_VALUE) continue;\n result[key] = val;\n }\n return result;\n }\n\n if (isExtend) {\n return resolveExtendMode(parentMap, childMap);\n }\n\n return resolveReplaceMode(parentMap, childMap);\n}\n\n/**\n * Extend mode: parent entries are preserved, child entries add/override/reposition.\n */\nfunction resolveExtendMode(\n parentMap: Record<string, unknown>,\n childMap: Record<string, unknown>,\n): Record<string, unknown> {\n const inheritKeys = new Set<string>();\n const removeKeys = new Set<string>();\n const overrideKeys = new Map<string, unknown>();\n\n for (const key of Object.keys(childMap)) {\n const val = childMap[key];\n if (val === INHERIT_VALUE) {\n if (key in parentMap) {\n inheritKeys.add(key);\n } else if (devMode) {\n console.warn(\n `[Tasty] @inherit used for state '${key}' that does not exist in the parent style map. Entry skipped.`,\n );\n }\n } else if (val === null) {\n removeKeys.add(key);\n } else if (key in parentMap) {\n overrideKeys.set(key, val);\n }\n }\n\n // 1. Parent entries in order (skip removed, skip repositioned, apply overrides)\n const result: Record<string, unknown> = {};\n for (const key of Object.keys(parentMap)) {\n if (removeKeys.has(key)) continue;\n if (inheritKeys.has(key)) continue;\n if (overrideKeys.has(key)) {\n result[key] = overrideKeys.get(key);\n } else {\n result[key] = parentMap[key];\n }\n }\n\n // 2. Append new + repositioned entries in child declaration order\n for (const key of Object.keys(childMap)) {\n if (inheritKeys.has(key)) {\n result[key] = parentMap[key];\n } else if (\n !removeKeys.has(key) &&\n !overrideKeys.has(key) &&\n // Skip @inherit for keys that weren't in the parent (already warned above)\n childMap[key] !== INHERIT_VALUE\n ) {\n result[key] = childMap[key];\n }\n }\n\n return result;\n}\n\n/**\n * Replace mode: child entries define the result, `@inherit` pulls from parent.\n */\nfunction resolveReplaceMode(\n parentMap: Record<string, unknown>,\n childMap: Record<string, unknown>,\n): Record<string, unknown> {\n const result: Record<string, unknown> = {};\n\n for (const key of Object.keys(childMap)) {\n const val = childMap[key];\n if (val === INHERIT_VALUE) {\n if (key in parentMap) {\n result[key] = parentMap[key];\n } else if (devMode) {\n console.warn(\n `[Tasty] @inherit used for state '${key}' that does not exist in the parent style map. Entry skipped.`,\n );\n }\n } else if (val !== null) {\n result[key] = val;\n }\n }\n\n return result;\n}\n\n/**\n * Merge sub-element properties with state map / null / undefined support.\n */\nfunction mergeSubElementStyles(\n parentSub: StylesWithoutSelectors | undefined,\n childSub: StylesWithoutSelectors,\n): StylesWithoutSelectors {\n const parent = parentSub as Record<string, unknown> | undefined;\n const child = childSub as Record<string, unknown>;\n const merged: Record<string, unknown> = { ...parent, ...child };\n\n for (const key of Object.keys(child)) {\n const val = child[key];\n\n if (val === undefined) {\n if (parent && key in parent) {\n merged[key] = parent[key];\n }\n } else if (val === null) {\n delete merged[key];\n } else if (isStateMap(val)) {\n merged[key] = resolveStateMap(\n parent ? parent[key] : undefined,\n val as Record<string, unknown>,\n );\n }\n }\n\n return merged as StylesWithoutSelectors;\n}\n\nexport function mergeStyles(...objects: (Styles | undefined | null)[]): Styles {\n let styles: Styles = objects[0] ? { ...objects[0] } : {};\n let pos = 1;\n\n while (pos in objects) {\n const selectorKeys = Object.keys(styles).filter(\n (key) => isSelector(key) && styles[key],\n );\n const newStyles = objects[pos];\n\n if (newStyles) {\n const resultStyles = { ...styles, ...newStyles };\n\n // Collect all selector keys from both parent and child\n const newSelectorKeys = Object.keys(newStyles).filter(isSelector);\n const allSelectorKeys = new Set([...selectorKeys, ...newSelectorKeys]);\n\n for (const key of allSelectorKeys) {\n const newValue = newStyles?.[key];\n\n if (newValue === false || newValue === null) {\n delete resultStyles[key];\n } else if (newValue === undefined) {\n resultStyles[key] = styles[key];\n } else if (newValue) {\n resultStyles[key] = mergeSubElementStyles(\n styles[key] as StylesWithoutSelectors,\n newValue as StylesWithoutSelectors,\n );\n }\n }\n\n // Handle non-selector properties: state maps, null, undefined\n for (const key of Object.keys(newStyles)) {\n if (isSelector(key)) continue;\n\n const newValue = newStyles[key];\n\n if (newValue === undefined) {\n if (key in styles) {\n resultStyles[key] = styles[key];\n } else {\n delete resultStyles[key];\n }\n } else if (newValue === null) {\n delete resultStyles[key];\n } else if (isStateMap(newValue)) {\n (resultStyles as Record<string, unknown>)[key] = resolveStateMap(\n styles[key],\n newValue as Record<string, unknown>,\n );\n }\n }\n\n styles = resultStyles;\n }\n\n pos++;\n }\n\n return styles;\n}\n"],"mappings":";;AAKA,MAAM,UAAU,UAAU;AAE1B,MAAM,gBAAgB;;;;AAKtB,SAAS,WAAW,OAAkD;AACpE,QAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,MAAM;;;;;;;;AAS7E,SAAS,oBAAoB,OAAgD;AAC3E,KAAI,WAAW,MAAM,CAAE,QAAO;AAC9B,KAAI,SAAS,QAAQ,UAAU,MAAO,QAAO,EAAE,IAAI,OAAO;AAC1D,QAAO;;;;;;;;;;;;;;AAeT,SAAS,gBACP,aACA,UACyB;CACzB,MAAM,WAAW,EAAE,MAAM;CACzB,MAAM,YAAY,oBAAoB,YAAY;AAElD,KAAI,CAAC,WAAW;EAEd,MAAM,SAAkC,EAAE;AAC1C,OAAK,MAAM,OAAO,OAAO,KAAK,SAAS,EAAE;GACvC,MAAM,MAAM,SAAS;AACrB,OAAI,QAAQ,QAAQ,QAAQ,cAAe;AAC3C,UAAO,OAAO;;AAEhB,SAAO;;AAGT,KAAI,SACF,QAAO,kBAAkB,WAAW,SAAS;AAG/C,QAAO,mBAAmB,WAAW,SAAS;;;;;AAMhD,SAAS,kBACP,WACA,UACyB;CACzB,MAAM,8BAAc,IAAI,KAAa;CACrC,MAAM,6BAAa,IAAI,KAAa;CACpC,MAAM,+BAAe,IAAI,KAAsB;AAE/C,MAAK,MAAM,OAAO,OAAO,KAAK,SAAS,EAAE;EACvC,MAAM,MAAM,SAAS;AACrB,MAAI,QAAQ;OACN,OAAO,UACT,aAAY,IAAI,IAAI;YACX,QACT,SAAQ,KACN,oCAAoC,IAAI,+DACzC;aAEM,QAAQ,KACjB,YAAW,IAAI,IAAI;WACV,OAAO,UAChB,cAAa,IAAI,KAAK,IAAI;;CAK9B,MAAM,SAAkC,EAAE;AAC1C,MAAK,MAAM,OAAO,OAAO,KAAK,UAAU,EAAE;AACxC,MAAI,WAAW,IAAI,IAAI,CAAE;AACzB,MAAI,YAAY,IAAI,IAAI,CAAE;AAC1B,MAAI,aAAa,IAAI,IAAI,CACvB,QAAO,OAAO,aAAa,IAAI,IAAI;MAEnC,QAAO,OAAO,UAAU;;AAK5B,MAAK,MAAM,OAAO,OAAO,KAAK,SAAS,CACrC,KAAI,YAAY,IAAI,IAAI,CACtB,QAAO,OAAO,UAAU;UAExB,CAAC,WAAW,IAAI,IAAI,IACpB,CAAC,aAAa,IAAI,IAAI,IAEtB,SAAS,SAAS,cAElB,QAAO,OAAO,SAAS;AAI3B,QAAO;;;;;AAMT,SAAS,mBACP,WACA,UACyB;CACzB,MAAM,SAAkC,EAAE;AAE1C,MAAK,MAAM,OAAO,OAAO,KAAK,SAAS,EAAE;EACvC,MAAM,MAAM,SAAS;AACrB,MAAI,QAAQ;OACN,OAAO,UACT,QAAO,OAAO,UAAU;YACf,QACT,SAAQ,KACN,oCAAoC,IAAI,+DACzC;aAEM,QAAQ,KACjB,QAAO,OAAO;;AAIlB,QAAO;;;;;AAMT,SAAS,sBACP,WACA,UACwB;CACxB,MAAM,SAAS;CACf,MAAM,QAAQ;CACd,MAAM,SAAkC;EAAE,GAAG;EAAQ,GAAG;EAAO;AAE/D,MAAK,MAAM,OAAO,OAAO,KAAK,MAAM,EAAE;EACpC,MAAM,MAAM,MAAM;AAElB,MAAI,QAAQ,KAAA;OACN,UAAU,OAAO,OACnB,QAAO,OAAO,OAAO;aAEd,QAAQ,KACjB,QAAO,OAAO;WACL,WAAW,IAAI,CACxB,QAAO,OAAO,gBACZ,SAAS,OAAO,OAAO,KAAA,GACvB,IACD;;AAIL,QAAO;;AAGT,SAAgB,YAAY,GAAG,SAAgD;CAC7E,IAAI,SAAiB,QAAQ,KAAK,EAAE,GAAG,QAAQ,IAAI,GAAG,EAAE;CACxD,IAAI,MAAM;AAEV,QAAO,OAAO,SAAS;EACrB,MAAM,eAAe,OAAO,KAAK,OAAO,CAAC,QACtC,QAAQ,WAAW,IAAI,IAAI,OAAO,KACpC;EACD,MAAM,YAAY,QAAQ;AAE1B,MAAI,WAAW;GACb,MAAM,eAAe;IAAE,GAAG;IAAQ,GAAG;IAAW;GAGhD,MAAM,kBAAkB,OAAO,KAAK,UAAU,CAAC,OAAO,WAAW;GACjE,MAAM,kBAAkB,IAAI,IAAI,CAAC,GAAG,cAAc,GAAG,gBAAgB,CAAC;AAEtE,QAAK,MAAM,OAAO,iBAAiB;IACjC,MAAM,WAAW,YAAY;AAE7B,QAAI,aAAa,SAAS,aAAa,KACrC,QAAO,aAAa;aACX,aAAa,KAAA,EACtB,cAAa,OAAO,OAAO;aAClB,SACT,cAAa,OAAO,sBAClB,OAAO,MACP,SACD;;AAKL,QAAK,MAAM,OAAO,OAAO,KAAK,UAAU,EAAE;AACxC,QAAI,WAAW,IAAI,CAAE;IAErB,MAAM,WAAW,UAAU;AAE3B,QAAI,aAAa,KAAA,EACf,KAAI,OAAO,OACT,cAAa,OAAO,OAAO;QAE3B,QAAO,aAAa;aAEb,aAAa,KACtB,QAAO,aAAa;aACX,WAAW,SAAS,CAC5B,cAAyC,OAAO,gBAC/C,OAAO,MACP,SACD;;AAIL,YAAS;;AAGX;;AAGF,QAAO"}
@@ -1,7 +1,7 @@
1
- import { Styles } from "../styles/types.js";
1
+ import { b as Styles } from "./index-dUtwpOux.js";
2
2
 
3
3
  //#region src/utils/merge-styles.d.ts
4
4
  declare function mergeStyles(...objects: (Styles | undefined | null)[]): Styles;
5
5
  //#endregion
6
- export { mergeStyles };
7
- //# sourceMappingURL=merge-styles.d.ts.map
6
+ export { mergeStyles as t };
7
+ //# sourceMappingURL=merge-styles-CtDJMhpJ.d.ts.map
@@ -1,7 +1,5 @@
1
- import { isDevEnv } from "./is-dev-env.js";
2
- import { isSelector } from "../pipeline/index.js";
3
- import { getGlobalRecipes } from "../config.js";
4
- import { mergeStyles } from "./merge-styles.js";
1
+ import { b as isSelector, l as getGlobalRecipes, st as isDevEnv } from "./config-_aQ_PZ-P.js";
2
+ import { t as mergeStyles } from "./merge-styles-BUQsEpbv.js";
5
3
  //#region src/utils/resolve-recipes.ts
6
4
  /**
7
5
  * Recipe resolution utility.
@@ -141,6 +139,6 @@ function resolveRecipes(styles) {
141
139
  return changed ? result : styles;
142
140
  }
143
141
  //#endregion
144
- export { resolveRecipes };
142
+ export { resolveRecipes as t };
145
143
 
146
- //# sourceMappingURL=resolve-recipes.js.map
144
+ //# sourceMappingURL=resolve-recipes-C0-AMzCz.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-recipes-C0-AMzCz.js","names":[],"sources":["../src/utils/resolve-recipes.ts"],"sourcesContent":["/**\n * Recipe resolution utility.\n *\n * Resolves `recipe` style properties by looking up predefined recipe styles\n * from global configuration and merging them with the component's own styles.\n *\n * Resolution order per level (top-level and each sub-element independently):\n * base_recipe_1 base_recipe_2 → component styles → post_recipe_1 post_recipe_2\n *\n * The `/` separator splits base recipes (before component styles)\n * from post recipes (after component styles). All merges use mergeStyles\n * semantics: primitives and state maps with '' key fully replace;\n * state maps without '' key extend the existing value.\n *\n * Returns the same object reference if no recipes are present (zero overhead).\n */\n\nimport { getGlobalRecipes } from '../config';\nimport { isSelector } from '../pipeline';\nimport type { RecipeStyles, Styles } from '../styles/types';\n\nimport { isDevEnv } from './is-dev-env';\nimport { mergeStyles } from './merge-styles';\n\nconst devMode = isDevEnv();\n\ninterface ParsedRecipeGroups {\n base: string[] | null;\n post: string[] | null;\n}\n\n/**\n * Parse a recipe string into base and post recipe name groups.\n *\n * Syntax: `'base1 base2 / post1 post2'`\n * - Names are space-separated within each group\n * - `/` separates base (before component) from post (after component) groups\n * - `/` is optional; if absent, all names are base\n * - `none` as the sole base value means \"no base recipes\"\n *\n * Returns `{ base: null, post: null }` if the string is empty or invalid.\n */\nfunction parseRecipeNames(value: unknown): ParsedRecipeGroups {\n const empty: ParsedRecipeGroups = { base: null, post: null };\n\n if (typeof value !== 'string') return empty;\n const trimmed = value.trim();\n if (trimmed === '') return empty;\n\n const slashIndex = trimmed.indexOf('/');\n\n if (slashIndex === -1) {\n if (trimmed === 'none') return empty;\n const names = splitNames(trimmed);\n return { base: names, post: null };\n }\n\n const basePart = trimmed.slice(0, slashIndex);\n const postPart = trimmed.slice(slashIndex + 1);\n\n return {\n base: basePart.trim() === 'none' ? null : splitNames(basePart),\n post: splitNames(postPart),\n };\n}\n\nfunction splitNames(s: string): string[] | null {\n const names = s.split(/\\s+/).filter(Boolean);\n return names.length > 0 ? names : null;\n}\n\n/**\n * Collect merged styles for a list of recipe names.\n * Each recipe is flat-spread on top of the previous.\n */\nfunction collectRecipeStyles(\n names: string[],\n recipes: Record<string, RecipeStyles>,\n): Record<string, unknown> {\n let merged: Record<string, unknown> = {};\n\n for (const name of names) {\n const recipeStyles = recipes[name];\n\n if (!recipeStyles) {\n if (devMode) {\n console.warn(\n `[Tasty] Recipe \"${name}\" not found. ` +\n `Make sure it is defined in configure({ recipes: { ... } }).`,\n );\n }\n continue;\n }\n\n merged = { ...merged, ...(recipeStyles as Record<string, unknown>) };\n }\n\n return merged;\n}\n\n/**\n * Resolve recipe references in a flat styles object (no sub-elements).\n * Returns null if no `recipe` key is present.\n *\n * Resolution: base recipes → component styles → post recipes (all via mergeStyles)\n */\nfunction resolveRecipesForLevel(\n styles: Record<string, unknown>,\n recipes: Record<string, RecipeStyles>,\n): Record<string, unknown> | null {\n if (!('recipe' in styles)) return null;\n\n const { base, post } = parseRecipeNames(styles.recipe);\n\n // Separate selector keys (sub-elements) from flat style properties.\n // mergeStyles handles selectors with its own semantics (e.g. false = delete),\n // but at this level we only want recipe merging on flat properties.\n\n const { recipe: _recipe, ...allRest } = styles;\n const flatStyles: Record<string, unknown> = {};\n const selectorStyles: Record<string, unknown> = {};\n\n for (const key of Object.keys(allRest)) {\n if (isSelector(key)) {\n selectorStyles[key] = allRest[key];\n } else {\n flatStyles[key] = allRest[key];\n }\n }\n\n if (!base && !post) {\n return allRest;\n }\n\n // 1. Merge base recipes, then component styles on top (via mergeStyles)\n let result: Record<string, unknown>;\n\n if (base) {\n const baseStyles = collectRecipeStyles(base, recipes);\n result = mergeStyles(baseStyles as Styles, flatStyles as Styles) as Record<\n string,\n unknown\n >;\n } else {\n result = { ...flatStyles };\n }\n\n // 2. Apply post recipes via mergeStyles (state map extend semantics)\n if (post) {\n const postStyles = collectRecipeStyles(post, recipes);\n result = mergeStyles(result as Styles, postStyles as Styles) as Record<\n string,\n unknown\n >;\n }\n\n // Re-attach selector keys unchanged\n for (const key of Object.keys(selectorStyles)) {\n result[key] = selectorStyles[key];\n }\n\n return result;\n}\n\n/**\n * Resolve all `recipe` style properties in a styles object.\n *\n * Handles both top-level and sub-element recipe references.\n * Returns the same object reference if no recipes are present anywhere\n * (zero overhead for the common case).\n *\n * @param styles - The styles object potentially containing `recipe` keys\n * @returns Resolved styles with recipe values merged in, or the original object if unchanged\n */\nexport function resolveRecipes(styles: Styles): Styles {\n const recipes = getGlobalRecipes();\n\n // Fast path: no recipes configured globally\n if (!recipes) return styles;\n\n let changed = false;\n\n // Resolve top-level recipe\n const topResolved = resolveRecipesForLevel(\n styles as Record<string, unknown>,\n recipes,\n );\n\n let result: Record<string, unknown>;\n\n if (topResolved) {\n changed = true;\n result = topResolved;\n } else {\n // Keep reference; a shallow copy is deferred until a sub-element actually changes\n result = styles as Record<string, unknown>;\n }\n\n // Resolve sub-element recipes\n const keys = Object.keys(result);\n\n for (const key of keys) {\n if (!isSelector(key)) continue;\n\n const subStyles = result[key];\n\n if (\n !subStyles ||\n typeof subStyles !== 'object' ||\n Array.isArray(subStyles)\n ) {\n continue;\n }\n\n const subRecord = subStyles as Record<string, unknown>;\n\n if (!('recipe' in subRecord)) continue;\n\n const subResolved = resolveRecipesForLevel(subRecord, recipes);\n\n if (subResolved) {\n if (!changed) {\n // First change in sub-elements -- need to shallow-copy the top level\n changed = true;\n result = { ...(styles as Record<string, unknown>) };\n }\n result[key] = subResolved;\n }\n }\n\n return changed ? (result as Styles) : styles;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAwBA,MAAM,UAAU,UAAU;;;;;;;;;;;;AAkB1B,SAAS,iBAAiB,OAAoC;CAC5D,MAAM,QAA4B;EAAE,MAAM;EAAM,MAAM;EAAM;AAE5D,KAAI,OAAO,UAAU,SAAU,QAAO;CACtC,MAAM,UAAU,MAAM,MAAM;AAC5B,KAAI,YAAY,GAAI,QAAO;CAE3B,MAAM,aAAa,QAAQ,QAAQ,IAAI;AAEvC,KAAI,eAAe,IAAI;AACrB,MAAI,YAAY,OAAQ,QAAO;AAE/B,SAAO;GAAE,MADK,WAAW,QAAQ;GACX,MAAM;GAAM;;CAGpC,MAAM,WAAW,QAAQ,MAAM,GAAG,WAAW;CAC7C,MAAM,WAAW,QAAQ,MAAM,aAAa,EAAE;AAE9C,QAAO;EACL,MAAM,SAAS,MAAM,KAAK,SAAS,OAAO,WAAW,SAAS;EAC9D,MAAM,WAAW,SAAS;EAC3B;;AAGH,SAAS,WAAW,GAA4B;CAC9C,MAAM,QAAQ,EAAE,MAAM,MAAM,CAAC,OAAO,QAAQ;AAC5C,QAAO,MAAM,SAAS,IAAI,QAAQ;;;;;;AAOpC,SAAS,oBACP,OACA,SACyB;CACzB,IAAI,SAAkC,EAAE;AAExC,MAAK,MAAM,QAAQ,OAAO;EACxB,MAAM,eAAe,QAAQ;AAE7B,MAAI,CAAC,cAAc;AACjB,OAAI,QACF,SAAQ,KACN,mBAAmB,KAAK,0EAEzB;AAEH;;AAGF,WAAS;GAAE,GAAG;GAAQ,GAAI;GAA0C;;AAGtE,QAAO;;;;;;;;AAST,SAAS,uBACP,QACA,SACgC;AAChC,KAAI,EAAE,YAAY,QAAS,QAAO;CAElC,MAAM,EAAE,MAAM,SAAS,iBAAiB,OAAO,OAAO;CAMtD,MAAM,EAAE,QAAQ,SAAS,GAAG,YAAY;CACxC,MAAM,aAAsC,EAAE;CAC9C,MAAM,iBAA0C,EAAE;AAElD,MAAK,MAAM,OAAO,OAAO,KAAK,QAAQ,CACpC,KAAI,WAAW,IAAI,CACjB,gBAAe,OAAO,QAAQ;KAE9B,YAAW,OAAO,QAAQ;AAI9B,KAAI,CAAC,QAAQ,CAAC,KACZ,QAAO;CAIT,IAAI;AAEJ,KAAI,KAEF,UAAS,YADU,oBAAoB,MAAM,QAAQ,EACV,WAAqB;KAKhE,UAAS,EAAE,GAAG,YAAY;AAI5B,KAAI,MAAM;EACR,MAAM,aAAa,oBAAoB,MAAM,QAAQ;AACrD,WAAS,YAAY,QAAkB,WAAqB;;AAO9D,MAAK,MAAM,OAAO,OAAO,KAAK,eAAe,CAC3C,QAAO,OAAO,eAAe;AAG/B,QAAO;;;;;;;;;;;;AAaT,SAAgB,eAAe,QAAwB;CACrD,MAAM,UAAU,kBAAkB;AAGlC,KAAI,CAAC,QAAS,QAAO;CAErB,IAAI,UAAU;CAGd,MAAM,cAAc,uBAClB,QACA,QACD;CAED,IAAI;AAEJ,KAAI,aAAa;AACf,YAAU;AACV,WAAS;OAGT,UAAS;CAIX,MAAM,OAAO,OAAO,KAAK,OAAO;AAEhC,MAAK,MAAM,OAAO,MAAM;AACtB,MAAI,CAAC,WAAW,IAAI,CAAE;EAEtB,MAAM,YAAY,OAAO;AAEzB,MACE,CAAC,aACD,OAAO,cAAc,YACrB,MAAM,QAAQ,UAAU,CAExB;EAGF,MAAM,YAAY;AAElB,MAAI,EAAE,YAAY,WAAY;EAE9B,MAAM,cAAc,uBAAuB,WAAW,QAAQ;AAE9D,MAAI,aAAa;AACf,OAAI,CAAC,SAAS;AAEZ,cAAU;AACV,aAAS,EAAE,GAAI,QAAoC;;AAErD,UAAO,OAAO;;;AAIlB,QAAO,UAAW,SAAoB"}
@@ -1,4 +1,4 @@
1
- import { hydrateTastyClasses } from "./hydrate.js";
1
+ import { n as hydrateTastyClasses } from "../hydrate-BvPT4ndL.js";
2
2
  //#region src/ssr/astro-client.ts
3
3
  /**
4
4
  * Client-side cache hydration for Astro islands.
package/dist/ssr/astro.js CHANGED
@@ -1,7 +1,7 @@
1
- import { getConfig } from "../config.js";
2
- import { registerSSRCollectorGetterGlobal } from "./ssr-collector-ref.js";
3
- import { ServerStyleCollector } from "./collector.js";
4
- import { getSSRCollector, runWithCollector } from "./async-storage.js";
1
+ import { n as getConfig } from "../config-_aQ_PZ-P.js";
2
+ import { a as registerSSRCollectorGetterGlobal } from "../format-rules-xwteB7a1.js";
3
+ import { t as ServerStyleCollector } from "../collector-DrgDE7QB.js";
4
+ import { n as runWithCollector, t as getSSRCollector } from "../async-storage-B7_o6FKt.js";
5
5
  //#region src/ssr/astro.ts
6
6
  /**
7
7
  * Astro integration for Tasty SSR.
@@ -1,4 +1,44 @@
1
- import { ServerStyleCollector } from "./collector.js";
2
- import { getSSRCollector, runWithCollector } from "./async-storage.js";
3
- import { hydrateTastyCache, hydrateTastyClasses } from "./hydrate.js";
4
- export { ServerStyleCollector, getSSRCollector, hydrateTastyCache, hydrateTastyClasses, runWithCollector };
1
+ import { t as ServerStyleCollector } from "../collector-LuU1vZ68.js";
2
+
3
+ //#region src/ssr/async-storage.d.ts
4
+ /**
5
+ * Run a function with a ServerStyleCollector bound to the current
6
+ * async context. All useStyles() calls within `fn` (and any async
7
+ * continuations) will find this collector via getSSRCollector().
8
+ */
9
+ declare function runWithCollector<T>(collector: ServerStyleCollector, fn: () => T): T;
10
+ /**
11
+ * Retrieve the ServerStyleCollector bound to the current async context.
12
+ * Returns null when called outside of runWithCollector() or on the client.
13
+ */
14
+ declare function getSSRCollector(): ServerStyleCollector | null;
15
+ //#endregion
16
+ //#region src/ssr/hydrate.d.ts
17
+ /**
18
+ * Client-side cache hydration for SSR/RSC.
19
+ *
20
+ * Pre-populates the client injector's rules map with class names
21
+ * rendered on the server. With hash-based naming, the client derives
22
+ * the same class name from the same cache key, so only the class name
23
+ * list needs to cross the wire — no cache keys or counters.
24
+ */
25
+ /**
26
+ * Pre-populate the client-side style registry from the server's class name list.
27
+ *
28
+ * Call this before ReactDOM.hydrateRoot() or ensure it runs before
29
+ * any tasty() component renders on the client.
30
+ *
31
+ * When called without arguments, reads the class list from `window.__TASTY__`
32
+ * (populated by inline scripts emitted during SSR/RSC streaming).
33
+ */
34
+ declare function hydrateTastyClasses(classes?: string[]): void;
35
+ /**
36
+ * @deprecated Use `hydrateTastyClasses()` instead. This alias exists
37
+ * for backwards compatibility and will be removed in a future major version.
38
+ */
39
+ declare function hydrateTastyCache(state?: {
40
+ entries?: Record<string, string>;
41
+ }): void;
42
+ //#endregion
43
+ export { ServerStyleCollector, getSSRCollector, hydrateTastyCache, hydrateTastyClasses, runWithCollector };
44
+ //# sourceMappingURL=index.d.ts.map
package/dist/ssr/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import { registerSSRCollectorGetterGlobal } from "./ssr-collector-ref.js";
2
- import { ServerStyleCollector } from "./collector.js";
3
- import { getSSRCollector, runWithCollector } from "./async-storage.js";
4
- import { hydrateTastyCache, hydrateTastyClasses } from "./hydrate.js";
1
+ import { a as registerSSRCollectorGetterGlobal } from "../format-rules-xwteB7a1.js";
2
+ import { t as ServerStyleCollector } from "../collector-DrgDE7QB.js";
3
+ import { n as runWithCollector, t as getSSRCollector } from "../async-storage-B7_o6FKt.js";
4
+ import { n as hydrateTastyClasses, t as hydrateTastyCache } from "../hydrate-BvPT4ndL.js";
5
5
  //#region src/ssr/index.ts
6
6
  registerSSRCollectorGetterGlobal(getSSRCollector);
7
7
  //#endregion
@@ -1,4 +1,4 @@
1
- import { ServerStyleCollector } from "./collector.js";
1
+ import { t as ServerStyleCollector } from "../collector-LuU1vZ68.js";
2
2
  import * as _$react from "react";
3
3
  import { ReactNode } from "react";
4
4
 
package/dist/ssr/next.js CHANGED
@@ -1,9 +1,9 @@
1
1
  "use client";
2
- import { getConfig } from "../config.js";
3
- import { registerSSRCollectorGetter } from "./ssr-collector-ref.js";
4
- import { TastySSRContext } from "./context.js";
5
- import { ServerStyleCollector } from "./collector.js";
6
- import { hydrateTastyClasses } from "./hydrate.js";
2
+ import { n as getConfig } from "../config-_aQ_PZ-P.js";
3
+ import { i as registerSSRCollectorGetter } from "../format-rules-xwteB7a1.js";
4
+ import { t as getTastySSRContext } from "../context-CkSg-kDT.js";
5
+ import { t as ServerStyleCollector } from "../collector-DrgDE7QB.js";
6
+ import { n as hydrateTastyClasses } from "../hydrate-BvPT4ndL.js";
7
7
  import { Fragment, createElement, useState } from "react";
8
8
  import { useServerInsertedHTML } from "next/navigation";
9
9
  //#region src/ssr/next.ts
@@ -67,7 +67,7 @@ function TastyRegistry({ children, transferCache = true }) {
67
67
  dangerouslySetInnerHTML: { __html: `(window.__TASTY__=window.__TASTY__||[]).push(${classNames.map((n) => `"${n}"`).join(",")})` }
68
68
  }));
69
69
  });
70
- return createElement(TastySSRContext.Provider, { value: collector }, children);
70
+ return createElement(getTastySSRContext().Provider, { value: collector }, children);
71
71
  }
72
72
  //#endregion
73
73
  export { TastyRegistry };
@@ -1 +1 @@
1
- {"version":3,"file":"next.js","names":[],"sources":["../../src/ssr/next.ts"],"sourcesContent":["/**\n * Next.js integration for Tasty SSR.\n *\n * Provides TastyRegistry for App Router (streaming via useServerInsertedHTML)\n * and createTastySSRDocument for Pages Router (non-streaming).\n *\n * Import from '@tenphi/tasty/ssr/next'.\n */\n\n'use client';\n\n/// <reference path=\"./next-navigation.d.ts\" />\n\nimport { createElement, Fragment, useState, type ReactNode } from 'react';\nimport { useServerInsertedHTML } from 'next/navigation';\n\nimport { getConfig } from '../config';\nimport { ServerStyleCollector } from './collector';\nimport { TastySSRContext } from './context';\nimport { hydrateTastyClasses } from './hydrate';\nimport { registerSSRCollectorGetter } from './ssr-collector-ref';\n\n// Auto-hydrate on module load (client only).\n// Reads the class name list from `window.__TASTY__` populated by streaming scripts.\nif (typeof window !== 'undefined') {\n hydrateTastyClasses();\n}\n\nexport interface TastyRegistryProps {\n children: ReactNode;\n /**\n * Whether to embed the class-list script for client hydration.\n * Set to false to skip class transfer (e.g. for CSP restrictions).\n * Without it, client components may re-inject CSS that already exists\n * in server-rendered `<style>` tags. Default: true.\n */\n transferCache?: boolean;\n}\n\n/**\n * Next.js App Router registry for Tasty SSR.\n *\n * Wraps the component tree with a ServerStyleCollector and flushes\n * collected CSS into the HTML stream via useServerInsertedHTML.\n *\n * @example\n * ```tsx\n * // app/tasty-registry.tsx\n * 'use client';\n * import { TastyRegistry } from '@tenphi/tasty/ssr/next';\n * export default function TastyStyleRegistry({ children }) {\n * return <TastyRegistry>{children}</TastyRegistry>;\n * }\n *\n * // app/layout.tsx\n * import TastyStyleRegistry from './tasty-registry';\n * export default function RootLayout({ children }) {\n * return <html><body>\n * <TastyStyleRegistry>{children}</TastyStyleRegistry>\n * </body></html>;\n * }\n * ```\n */\nexport function TastyRegistry({\n children,\n transferCache = true,\n}: TastyRegistryProps) {\n const isClient = typeof window !== 'undefined';\n\n const [collector] = useState(() => {\n if (isClient) return null;\n\n const instance = new ServerStyleCollector();\n\n registerSSRCollectorGetter(() => instance);\n\n return instance;\n });\n const nonce = getConfig().nonce;\n\n useServerInsertedHTML(() => {\n if (!collector) return null;\n\n const css = collector.flushCSS();\n const classNames = collector.getRenderedClassNames();\n\n if (!css) return null;\n\n const styleEl = createElement('style', {\n key: 'tasty-ssr-styles',\n 'data-tasty-ssr': '',\n nonce,\n dangerouslySetInnerHTML: { __html: css },\n });\n\n if (!transferCache || classNames.length === 0) return styleEl;\n\n const classListJSON = classNames.map((n) => `\"${n}\"`).join(',');\n\n const scriptEl = createElement('script', {\n key: 'tasty-ssr-cache',\n nonce,\n dangerouslySetInnerHTML: {\n __html: `(window.__TASTY__=window.__TASTY__||[]).push(${classListJSON})`,\n },\n });\n\n return createElement(Fragment, null, styleEl, scriptEl);\n });\n\n return createElement(\n TastySSRContext.Provider,\n { value: collector },\n children,\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAwBA,IAAI,OAAO,WAAW,YACpB,sBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;AAsCvB,SAAgB,cAAc,EAC5B,UACA,gBAAgB,QACK;CACrB,MAAM,WAAW,OAAO,WAAW;CAEnC,MAAM,CAAC,aAAa,eAAe;AACjC,MAAI,SAAU,QAAO;EAErB,MAAM,WAAW,IAAI,sBAAsB;AAE3C,mCAAiC,SAAS;AAE1C,SAAO;GACP;CACF,MAAM,QAAQ,WAAW,CAAC;AAE1B,6BAA4B;AAC1B,MAAI,CAAC,UAAW,QAAO;EAEvB,MAAM,MAAM,UAAU,UAAU;EAChC,MAAM,aAAa,UAAU,uBAAuB;AAEpD,MAAI,CAAC,IAAK,QAAO;EAEjB,MAAM,UAAU,cAAc,SAAS;GACrC,KAAK;GACL,kBAAkB;GAClB;GACA,yBAAyB,EAAE,QAAQ,KAAK;GACzC,CAAC;AAEF,MAAI,CAAC,iBAAiB,WAAW,WAAW,EAAG,QAAO;AAYtD,SAAO,cAAc,UAAU,MAAM,SARpB,cAAc,UAAU;GACvC,KAAK;GACL;GACA,yBAAyB,EACvB,QAAQ,gDANU,WAAW,KAAK,MAAM,IAAI,EAAE,GAAG,CAAC,KAAK,IAAI,CAMW,IACvE;GACF,CAAC,CAEqD;GACvD;AAEF,QAAO,cACL,gBAAgB,UAChB,EAAE,OAAO,WAAW,EACpB,SACD"}
1
+ {"version":3,"file":"next.js","names":[],"sources":["../../src/ssr/next.ts"],"sourcesContent":["/**\n * Next.js integration for Tasty SSR.\n *\n * Provides TastyRegistry for App Router (streaming via useServerInsertedHTML)\n * and createTastySSRDocument for Pages Router (non-streaming).\n *\n * Import from '@tenphi/tasty/ssr/next'.\n */\n\n'use client';\n\n/// <reference path=\"./next-navigation.d.ts\" />\n\nimport { createElement, Fragment, useState, type ReactNode } from 'react';\nimport { useServerInsertedHTML } from 'next/navigation';\n\nimport { getConfig } from '../config';\nimport { ServerStyleCollector } from './collector';\nimport { getTastySSRContext } from './context';\nimport { hydrateTastyClasses } from './hydrate';\nimport { registerSSRCollectorGetter } from './ssr-collector-ref';\n\n// Auto-hydrate on module load (client only).\n// Reads the class name list from `window.__TASTY__` populated by streaming scripts.\nif (typeof window !== 'undefined') {\n hydrateTastyClasses();\n}\n\nexport interface TastyRegistryProps {\n children: ReactNode;\n /**\n * Whether to embed the class-list script for client hydration.\n * Set to false to skip class transfer (e.g. for CSP restrictions).\n * Without it, client components may re-inject CSS that already exists\n * in server-rendered `<style>` tags. Default: true.\n */\n transferCache?: boolean;\n}\n\n/**\n * Next.js App Router registry for Tasty SSR.\n *\n * Wraps the component tree with a ServerStyleCollector and flushes\n * collected CSS into the HTML stream via useServerInsertedHTML.\n *\n * @example\n * ```tsx\n * // app/tasty-registry.tsx\n * 'use client';\n * import { TastyRegistry } from '@tenphi/tasty/ssr/next';\n * export default function TastyStyleRegistry({ children }) {\n * return <TastyRegistry>{children}</TastyRegistry>;\n * }\n *\n * // app/layout.tsx\n * import TastyStyleRegistry from './tasty-registry';\n * export default function RootLayout({ children }) {\n * return <html><body>\n * <TastyStyleRegistry>{children}</TastyStyleRegistry>\n * </body></html>;\n * }\n * ```\n */\nexport function TastyRegistry({\n children,\n transferCache = true,\n}: TastyRegistryProps) {\n const isClient = typeof window !== 'undefined';\n\n const [collector] = useState(() => {\n if (isClient) return null;\n\n const instance = new ServerStyleCollector();\n\n registerSSRCollectorGetter(() => instance);\n\n return instance;\n });\n const nonce = getConfig().nonce;\n\n useServerInsertedHTML(() => {\n if (!collector) return null;\n\n const css = collector.flushCSS();\n const classNames = collector.getRenderedClassNames();\n\n if (!css) return null;\n\n const styleEl = createElement('style', {\n key: 'tasty-ssr-styles',\n 'data-tasty-ssr': '',\n nonce,\n dangerouslySetInnerHTML: { __html: css },\n });\n\n if (!transferCache || classNames.length === 0) return styleEl;\n\n const classListJSON = classNames.map((n) => `\"${n}\"`).join(',');\n\n const scriptEl = createElement('script', {\n key: 'tasty-ssr-cache',\n nonce,\n dangerouslySetInnerHTML: {\n __html: `(window.__TASTY__=window.__TASTY__||[]).push(${classListJSON})`,\n },\n });\n\n return createElement(Fragment, null, styleEl, scriptEl);\n });\n\n return createElement(\n getTastySSRContext().Provider,\n { value: collector },\n children,\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAwBA,IAAI,OAAO,WAAW,YACpB,sBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;AAsCvB,SAAgB,cAAc,EAC5B,UACA,gBAAgB,QACK;CACrB,MAAM,WAAW,OAAO,WAAW;CAEnC,MAAM,CAAC,aAAa,eAAe;AACjC,MAAI,SAAU,QAAO;EAErB,MAAM,WAAW,IAAI,sBAAsB;AAE3C,mCAAiC,SAAS;AAE1C,SAAO;GACP;CACF,MAAM,QAAQ,WAAW,CAAC;AAE1B,6BAA4B;AAC1B,MAAI,CAAC,UAAW,QAAO;EAEvB,MAAM,MAAM,UAAU,UAAU;EAChC,MAAM,aAAa,UAAU,uBAAuB;AAEpD,MAAI,CAAC,IAAK,QAAO;EAEjB,MAAM,UAAU,cAAc,SAAS;GACrC,KAAK;GACL,kBAAkB;GAClB;GACA,yBAAyB,EAAE,QAAQ,KAAK;GACzC,CAAC;AAEF,MAAI,CAAC,iBAAiB,WAAW,WAAW,EAAG,QAAO;AAYtD,SAAO,cAAc,UAAU,MAAM,SARpB,cAAc,UAAU;GACvC,KAAK;GACL;GACA,yBAAyB,EACvB,QAAQ,gDANU,WAAW,KAAK,MAAM,IAAI,EAAE,GAAG,CAAC,KAAK,IAAI,CAMW,IACvE;GACF,CAAC,CAEqD;GACvD;AAEF,QAAO,cACL,oBAAoB,CAAC,UACrB,EAAE,OAAO,WAAW,EACpB,SACD"}
@@ -1,5 +1,91 @@
1
- import { Styles } from "../styles/types.js";
2
- import { mergeStyles } from "../utils/merge-styles.js";
3
- import { StaticStyle, createStaticStyle, isStaticStyle } from "./types.js";
4
- import { tastyStatic } from "./tastyStatic.js";
5
- export { type StaticStyle, type Styles, createStaticStyle, isStaticStyle, mergeStyles, tastyStatic };
1
+ import { b as Styles } from "../index-dUtwpOux.js";
2
+ import { t as mergeStyles } from "../merge-styles-CtDJMhpJ.js";
3
+
4
+ //#region src/static/types.d.ts
5
+ /**
6
+ * Static style definition returned by tastyStatic().
7
+ *
8
+ * Supports both explicit className access and implicit string coercion via toString().
9
+ *
10
+ * @example
11
+ * ```typescript
12
+ * const button = tastyStatic({ fill: '#blue' });
13
+ *
14
+ * // Both work in JSX:
15
+ * <div className={button} /> // Uses toString()
16
+ * <div className={button.className} /> // Explicit
17
+ *
18
+ * // Extension:
19
+ * const primary = tastyStatic(button, { fill: '#purple' });
20
+ * ```
21
+ */
22
+ interface StaticStyle {
23
+ /**
24
+ * Generated className(s) for use in JSX.
25
+ * May contain multiple space-separated class names due to chunking.
26
+ */
27
+ className: string;
28
+ /**
29
+ * The original (or merged) styles object.
30
+ * Available for extension via tastyStatic(base, overrides).
31
+ */
32
+ styles: Styles;
33
+ /**
34
+ * Returns className for implicit string coercion.
35
+ * Enables `<div className={button} />` syntax.
36
+ */
37
+ toString(): string;
38
+ }
39
+ /**
40
+ * Create a StaticStyle object.
41
+ * Used internally by the Babel plugin to generate output.
42
+ */
43
+ declare function createStaticStyle(className: string, styles: Styles): StaticStyle;
44
+ /**
45
+ * Type guard to check if a value is a StaticStyle object.
46
+ */
47
+ declare function isStaticStyle(value: unknown): value is StaticStyle;
48
+ //#endregion
49
+ //#region src/static/tastyStatic.d.ts
50
+ /**
51
+ * Generate styles and return a StaticStyle object.
52
+ * The object has `className`, `styles`, and `toString()`.
53
+ *
54
+ * @example
55
+ * ```typescript
56
+ * const button = tastyStatic({
57
+ * fill: '#blue',
58
+ * padding: '2x',
59
+ * });
60
+ * // After build: { className: 'ts3f2a1b', styles: {...}, toString() }
61
+ *
62
+ * <div className={button} /> // Works via toString()
63
+ * ```
64
+ */
65
+ declare function tastyStatic(styles: Styles): StaticStyle;
66
+ /**
67
+ * Extend an existing StaticStyle with additional styles.
68
+ * Uses mergeStyles() internally for proper nested selector handling.
69
+ *
70
+ * @example
71
+ * ```typescript
72
+ * const button = tastyStatic({ fill: '#blue' });
73
+ * const primary = tastyStatic(button, { fill: '#purple' });
74
+ * // After build: { className: 'ts8c4d2e', styles: {...merged...}, toString() }
75
+ * ```
76
+ */
77
+ declare function tastyStatic(base: StaticStyle, styles: Styles): StaticStyle;
78
+ /**
79
+ * Generate styles for a specific CSS selector.
80
+ * The call is completely removed after build transformation.
81
+ *
82
+ * @example
83
+ * ```typescript
84
+ * tastyStatic('.heading', { preset: 'h1', color: '#primary' });
85
+ * // After build: (removed)
86
+ * ```
87
+ */
88
+ declare function tastyStatic(selector: string, styles: Styles): void;
89
+ //#endregion
90
+ export { type StaticStyle, type Styles, createStaticStyle, isStaticStyle, mergeStyles, tastyStatic };
91
+ //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,50 @@
1
- import { mergeStyles } from "../utils/merge-styles.js";
2
- import { createStaticStyle, isStaticStyle } from "./types.js";
3
- import { tastyStatic } from "./tastyStatic.js";
1
+ import { t as mergeStyles } from "../merge-styles-BUQsEpbv.js";
2
+ //#region src/static/types.ts
3
+ /**
4
+ * Create a StaticStyle object.
5
+ * Used internally by the Babel plugin to generate output.
6
+ */
7
+ function createStaticStyle(className, styles) {
8
+ return {
9
+ className,
10
+ styles,
11
+ toString() {
12
+ return this.className;
13
+ }
14
+ };
15
+ }
16
+ /**
17
+ * Type guard to check if a value is a StaticStyle object.
18
+ */
19
+ function isStaticStyle(value) {
20
+ return typeof value === "object" && value !== null && "className" in value && "styles" in value && "toString" in value && typeof value.className === "string" && typeof value.styles === "object";
21
+ }
22
+ //#endregion
23
+ //#region src/static/tastyStatic.ts
24
+ /**
25
+ * Build-time only function for zero-runtime static site generation.
26
+ *
27
+ * This function is transformed by the Babel plugin:
28
+ * - `tastyStatic(styles)` → StaticStyle object with className
29
+ * - `tastyStatic(base, styles)` → StaticStyle object with merged styles
30
+ * - `tastyStatic(selector, styles)` → removed entirely
31
+ *
32
+ * At runtime (during development/build), this function returns a placeholder.
33
+ * In production, all calls are replaced/removed by the build plugin.
34
+ */
35
+ function tastyStatic(stylesOrBaseOrSelector, styles) {
36
+ if (typeof stylesOrBaseOrSelector === "string") {
37
+ console.warn(`[tasty] tastyStatic('${stylesOrBaseOrSelector}', styles) was called at runtime. This indicates the Babel plugin is not configured. Add @tenphi/tasty/babel-plugin to your Babel config.`);
38
+ return;
39
+ }
40
+ if (isStaticStyle(stylesOrBaseOrSelector)) {
41
+ console.warn("[tasty] tastyStatic(base, styles) was called at runtime. This indicates the Babel plugin is not configured. Add @tenphi/tasty/babel-plugin to your Babel config.");
42
+ return createStaticStyle("__TASTY_STATIC_NOT_TRANSFORMED__", mergeStyles(stylesOrBaseOrSelector.styles, styles || {}));
43
+ }
44
+ console.warn("[tasty] tastyStatic(styles) was called at runtime. This indicates the Babel plugin is not configured. Add @tenphi/tasty/babel-plugin to your Babel config.");
45
+ return createStaticStyle("__TASTY_STATIC_NOT_TRANSFORMED__", stylesOrBaseOrSelector);
46
+ }
47
+ //#endregion
4
48
  export { createStaticStyle, isStaticStyle, mergeStyles, tastyStatic };
49
+
50
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/static/types.ts","../../src/static/tastyStatic.ts"],"sourcesContent":["import type { Styles } from '../styles/types';\n\n/**\n * Static style definition returned by tastyStatic().\n *\n * Supports both explicit className access and implicit string coercion via toString().\n *\n * @example\n * ```typescript\n * const button = tastyStatic({ fill: '#blue' });\n *\n * // Both work in JSX:\n * <div className={button} /> // Uses toString()\n * <div className={button.className} /> // Explicit\n *\n * // Extension:\n * const primary = tastyStatic(button, { fill: '#purple' });\n * ```\n */\nexport interface StaticStyle {\n /**\n * Generated className(s) for use in JSX.\n * May contain multiple space-separated class names due to chunking.\n */\n className: string;\n\n /**\n * The original (or merged) styles object.\n * Available for extension via tastyStatic(base, overrides).\n */\n styles: Styles;\n\n /**\n * Returns className for implicit string coercion.\n * Enables `<div className={button} />` syntax.\n */\n toString(): string;\n}\n\n/**\n * Create a StaticStyle object.\n * Used internally by the Babel plugin to generate output.\n */\nexport function createStaticStyle(\n className: string,\n styles: Styles,\n): StaticStyle {\n return {\n className,\n styles,\n toString() {\n return this.className;\n },\n };\n}\n\n/**\n * Type guard to check if a value is a StaticStyle object.\n */\nexport function isStaticStyle(value: unknown): value is StaticStyle {\n return (\n typeof value === 'object' &&\n value !== null &&\n 'className' in value &&\n 'styles' in value &&\n 'toString' in value &&\n typeof (value as StaticStyle).className === 'string' &&\n typeof (value as StaticStyle).styles === 'object'\n );\n}\n","import type { Styles } from '../styles/types';\nimport { mergeStyles } from '../utils/merge-styles';\n\nimport type { StaticStyle } from './types';\nimport { createStaticStyle, isStaticStyle } from './types';\n\n/**\n * Generate styles and return a StaticStyle object.\n * The object has `className`, `styles`, and `toString()`.\n *\n * @example\n * ```typescript\n * const button = tastyStatic({\n * fill: '#blue',\n * padding: '2x',\n * });\n * // After build: { className: 'ts3f2a1b', styles: {...}, toString() }\n *\n * <div className={button} /> // Works via toString()\n * ```\n */\nexport function tastyStatic(styles: Styles): StaticStyle;\n\n/**\n * Extend an existing StaticStyle with additional styles.\n * Uses mergeStyles() internally for proper nested selector handling.\n *\n * @example\n * ```typescript\n * const button = tastyStatic({ fill: '#blue' });\n * const primary = tastyStatic(button, { fill: '#purple' });\n * // After build: { className: 'ts8c4d2e', styles: {...merged...}, toString() }\n * ```\n */\nexport function tastyStatic(base: StaticStyle, styles: Styles): StaticStyle;\n\n/**\n * Generate styles for a specific CSS selector.\n * The call is completely removed after build transformation.\n *\n * @example\n * ```typescript\n * tastyStatic('.heading', { preset: 'h1', color: '#primary' });\n * // After build: (removed)\n * ```\n */\nexport function tastyStatic(selector: string, styles: Styles): void;\n\n/**\n * Build-time only function for zero-runtime static site generation.\n *\n * This function is transformed by the Babel plugin:\n * - `tastyStatic(styles)` → StaticStyle object with className\n * - `tastyStatic(base, styles)` → StaticStyle object with merged styles\n * - `tastyStatic(selector, styles)` → removed entirely\n *\n * At runtime (during development/build), this function returns a placeholder.\n * In production, all calls are replaced/removed by the build plugin.\n */\nexport function tastyStatic(\n stylesOrBaseOrSelector: Styles | StaticStyle | string,\n styles?: Styles,\n): StaticStyle | void {\n // This code only executes if the Babel plugin hasn't processed the file yet.\n // In a properly configured build, this function is never called at runtime.\n\n if (typeof stylesOrBaseOrSelector === 'string') {\n // Selector mode: tastyStatic(selector, styles)\n // The plugin will remove this call entirely\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\n `[tasty] tastyStatic('${stylesOrBaseOrSelector}', styles) was called at runtime. ` +\n 'This indicates the Babel plugin is not configured. ' +\n 'Add @tenphi/tasty/babel-plugin to your Babel config.',\n );\n }\n return; // void\n }\n\n if (isStaticStyle(stylesOrBaseOrSelector)) {\n // Extension mode: tastyStatic(base, styles)\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\n '[tasty] tastyStatic(base, styles) was called at runtime. ' +\n 'This indicates the Babel plugin is not configured. ' +\n 'Add @tenphi/tasty/babel-plugin to your Babel config.',\n );\n }\n // Merge styles for dev mode preview (won't have real classNames)\n const mergedStyles = mergeStyles(\n stylesOrBaseOrSelector.styles,\n styles || {},\n );\n return createStaticStyle('__TASTY_STATIC_NOT_TRANSFORMED__', mergedStyles);\n }\n\n // Styles mode: tastyStatic(styles)\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\n '[tasty] tastyStatic(styles) was called at runtime. ' +\n 'This indicates the Babel plugin is not configured. ' +\n 'Add @tenphi/tasty/babel-plugin to your Babel config.',\n );\n }\n\n // Return placeholder - styles won't be applied without the plugin\n return createStaticStyle(\n '__TASTY_STATIC_NOT_TRANSFORMED__',\n stylesOrBaseOrSelector,\n );\n}\n"],"mappings":";;;;;;AA2CA,SAAgB,kBACd,WACA,QACa;AACb,QAAO;EACL;EACA;EACA,WAAW;AACT,UAAO,KAAK;;EAEf;;;;;AAMH,SAAgB,cAAc,OAAsC;AAClE,QACE,OAAO,UAAU,YACjB,UAAU,QACV,eAAe,SACf,YAAY,SACZ,cAAc,SACd,OAAQ,MAAsB,cAAc,YAC5C,OAAQ,MAAsB,WAAW;;;;;;;;;;;;;;;ACR7C,SAAgB,YACd,wBACA,QACoB;AAIpB,KAAI,OAAO,2BAA2B,UAAU;AAI5C,UAAQ,KACN,wBAAwB,uBAAuB,2IAGhD;AAEH;;AAGF,KAAI,cAAc,uBAAuB,EAAE;AAGvC,UAAQ,KACN,mKAGD;AAOH,SAAO,kBAAkB,oCAJJ,YACnB,uBAAuB,QACvB,UAAU,EAAE,CACb,CACyE;;AAK1E,SAAQ,KACN,6JAGD;AAIH,QAAO,kBACL,oCACA,uBACD"}
@@ -1,4 +1,4 @@
1
- import { TastyConfig } from "../config.js";
1
+ import { t as TastyConfig } from "../config-vuCRkBWX.js";
2
2
  import * as _$_babel_core0 from "@babel/core";
3
3
  import { PluginPass } from "@babel/core";
4
4
 
@@ -1,14 +1,18 @@
1
- import { __require } from "../_virtual/_rolldown/runtime.js";
2
- import { configure, getGlobalConfigTokens, getGlobalStyles, resetConfig } from "../config.js";
3
- import { mergeStyles } from "../utils/merge-styles.js";
4
- import { resolveRecipes } from "../utils/resolve-recipes.js";
5
- import { extractCounterStyleFromStyles, extractFontFaceFromStyles, extractKeyframesFromStyles, extractPropertiesFromStyles, extractStylesForSelector, extractStylesWithChunks } from "./extractor.js";
6
- import { CSSWriter } from "./css-writer.js";
1
+ import { _ as resetConfig, i as getGlobalConfigTokens, t as configure, u as getGlobalStyles } from "../config-_aQ_PZ-P.js";
2
+ import { t as mergeStyles } from "../merge-styles-BUQsEpbv.js";
3
+ import { t as resolveRecipes } from "../resolve-recipes-C0-AMzCz.js";
4
+ import { a as extractPropertiesFromStyles, i as extractKeyframesFromStyles, n as extractCounterStyleFromStyles, o as extractStylesForSelector, r as extractFontFaceFromStyles, s as extractStylesWithChunks, t as CSSWriter } from "../css-writer-D--REwtp.js";
7
5
  import * as fs from "fs";
8
6
  import * as path from "path";
9
7
  import { declare } from "@babel/helper-plugin-utils";
10
8
  import * as t from "@babel/types";
11
9
  import { createJiti } from "jiti";
10
+ //#region \0rolldown/runtime.js
11
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { get: (a, b) => (typeof require !== "undefined" ? require : a)[b] }) : x)(function(x) {
12
+ if (typeof require !== "undefined") return require.apply(this, arguments);
13
+ throw Error("Calling `require` for \"" + x + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
14
+ });
15
+ //#endregion
12
16
  //#region src/zero/babel.ts
13
17
  /**
14
18
  * Babel plugin for zero-runtime tasty static site generation.