@tenphi/tasty 0.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 (359) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +236 -0
  3. package/dist/_virtual/_rolldown/runtime.mjs +7 -0
  4. package/dist/chunks/cacheKey.d.ts +1 -0
  5. package/dist/chunks/cacheKey.js +70 -0
  6. package/dist/chunks/cacheKey.js.map +1 -0
  7. package/dist/chunks/cacheKey.mjs +70 -0
  8. package/dist/chunks/cacheKey.mjs.map +1 -0
  9. package/dist/chunks/definitions.d.ts +37 -0
  10. package/dist/chunks/definitions.js +260 -0
  11. package/dist/chunks/definitions.js.map +1 -0
  12. package/dist/chunks/definitions.mjs +260 -0
  13. package/dist/chunks/definitions.mjs.map +1 -0
  14. package/dist/chunks/index.d.ts +3 -0
  15. package/dist/chunks/renderChunk.d.ts +2 -0
  16. package/dist/chunks/renderChunk.js +61 -0
  17. package/dist/chunks/renderChunk.js.map +1 -0
  18. package/dist/chunks/renderChunk.mjs +61 -0
  19. package/dist/chunks/renderChunk.mjs.map +1 -0
  20. package/dist/config.d.ts +279 -0
  21. package/dist/config.js +400 -0
  22. package/dist/config.js.map +1 -0
  23. package/dist/config.mjs +231 -0
  24. package/dist/config.mjs.map +1 -0
  25. package/dist/css-writer.d.mts +45 -0
  26. package/dist/css-writer.mjs +74 -0
  27. package/dist/css-writer.mjs.map +1 -0
  28. package/dist/debug.d.ts +204 -0
  29. package/dist/debug.js +733 -0
  30. package/dist/debug.js.map +1 -0
  31. package/dist/extractor.d.mts +24 -0
  32. package/dist/extractor.mjs +150 -0
  33. package/dist/extractor.mjs.map +1 -0
  34. package/dist/hooks/index.d.ts +5 -0
  35. package/dist/hooks/useGlobalStyles.d.ts +27 -0
  36. package/dist/hooks/useGlobalStyles.js +56 -0
  37. package/dist/hooks/useGlobalStyles.js.map +1 -0
  38. package/dist/hooks/useKeyframes.d.ts +56 -0
  39. package/dist/hooks/useKeyframes.js +54 -0
  40. package/dist/hooks/useKeyframes.js.map +1 -0
  41. package/dist/hooks/useProperty.d.ts +79 -0
  42. package/dist/hooks/useProperty.js +91 -0
  43. package/dist/hooks/useProperty.js.map +1 -0
  44. package/dist/hooks/useRawCSS.d.ts +53 -0
  45. package/dist/hooks/useRawCSS.js +28 -0
  46. package/dist/hooks/useRawCSS.js.map +1 -0
  47. package/dist/hooks/useStyles.d.ts +40 -0
  48. package/dist/hooks/useStyles.js +169 -0
  49. package/dist/hooks/useStyles.js.map +1 -0
  50. package/dist/index.d.ts +38 -0
  51. package/dist/index.js +30 -0
  52. package/dist/injector/index.d.ts +157 -0
  53. package/dist/injector/index.js +154 -0
  54. package/dist/injector/index.js.map +1 -0
  55. package/dist/injector/injector.d.ts +139 -0
  56. package/dist/injector/injector.js +404 -0
  57. package/dist/injector/injector.js.map +1 -0
  58. package/dist/injector/injector.mjs +404 -0
  59. package/dist/injector/injector.mjs.map +1 -0
  60. package/dist/injector/sheet-manager.d.ts +127 -0
  61. package/dist/injector/sheet-manager.js +714 -0
  62. package/dist/injector/sheet-manager.js.map +1 -0
  63. package/dist/injector/sheet-manager.mjs +714 -0
  64. package/dist/injector/sheet-manager.mjs.map +1 -0
  65. package/dist/injector/types.d.mts +18 -0
  66. package/dist/injector/types.d.ts +135 -0
  67. package/dist/keyframes/index.js +206 -0
  68. package/dist/keyframes/index.js.map +1 -0
  69. package/dist/keyframes/index.mjs +156 -0
  70. package/dist/keyframes/index.mjs.map +1 -0
  71. package/dist/parser/classify.js +319 -0
  72. package/dist/parser/classify.js.map +1 -0
  73. package/dist/parser/classify.mjs +319 -0
  74. package/dist/parser/classify.mjs.map +1 -0
  75. package/dist/parser/const.js +33 -0
  76. package/dist/parser/const.js.map +1 -0
  77. package/dist/parser/const.mjs +33 -0
  78. package/dist/parser/const.mjs.map +1 -0
  79. package/dist/parser/lru.js +109 -0
  80. package/dist/parser/lru.js.map +1 -0
  81. package/dist/parser/lru.mjs +109 -0
  82. package/dist/parser/lru.mjs.map +1 -0
  83. package/dist/parser/parser.d.ts +25 -0
  84. package/dist/parser/parser.js +116 -0
  85. package/dist/parser/parser.js.map +1 -0
  86. package/dist/parser/parser.mjs +116 -0
  87. package/dist/parser/parser.mjs.map +1 -0
  88. package/dist/parser/tokenizer.js +69 -0
  89. package/dist/parser/tokenizer.js.map +1 -0
  90. package/dist/parser/tokenizer.mjs +69 -0
  91. package/dist/parser/tokenizer.mjs.map +1 -0
  92. package/dist/parser/types.d.mts +37 -0
  93. package/dist/parser/types.d.ts +46 -0
  94. package/dist/parser/types.js +46 -0
  95. package/dist/parser/types.js.map +1 -0
  96. package/dist/parser/types.mjs +46 -0
  97. package/dist/parser/types.mjs.map +1 -0
  98. package/dist/pipeline/conditions.js +377 -0
  99. package/dist/pipeline/conditions.js.map +1 -0
  100. package/dist/pipeline/conditions.mjs +377 -0
  101. package/dist/pipeline/conditions.mjs.map +1 -0
  102. package/dist/pipeline/exclusive.d.ts +1 -0
  103. package/dist/pipeline/exclusive.js +231 -0
  104. package/dist/pipeline/exclusive.js.map +1 -0
  105. package/dist/pipeline/exclusive.mjs +231 -0
  106. package/dist/pipeline/exclusive.mjs.map +1 -0
  107. package/dist/pipeline/index.d.ts +53 -0
  108. package/dist/pipeline/index.js +641 -0
  109. package/dist/pipeline/index.js.map +1 -0
  110. package/dist/pipeline/index.mjs +635 -0
  111. package/dist/pipeline/index.mjs.map +1 -0
  112. package/dist/pipeline/materialize.js +821 -0
  113. package/dist/pipeline/materialize.js.map +1 -0
  114. package/dist/pipeline/materialize.mjs +821 -0
  115. package/dist/pipeline/materialize.mjs.map +1 -0
  116. package/dist/pipeline/parseStateKey.d.ts +1 -0
  117. package/dist/pipeline/parseStateKey.js +418 -0
  118. package/dist/pipeline/parseStateKey.js.map +1 -0
  119. package/dist/pipeline/parseStateKey.mjs +418 -0
  120. package/dist/pipeline/parseStateKey.mjs.map +1 -0
  121. package/dist/pipeline/simplify.js +557 -0
  122. package/dist/pipeline/simplify.js.map +1 -0
  123. package/dist/pipeline/simplify.mjs +557 -0
  124. package/dist/pipeline/simplify.mjs.map +1 -0
  125. package/dist/plugins/index.d.ts +2 -0
  126. package/dist/plugins/okhsl-plugin.d.ts +35 -0
  127. package/dist/plugins/okhsl-plugin.js +371 -0
  128. package/dist/plugins/okhsl-plugin.js.map +1 -0
  129. package/dist/plugins/okhsl-plugin.mjs +345 -0
  130. package/dist/plugins/okhsl-plugin.mjs.map +1 -0
  131. package/dist/plugins/types.d.mts +49 -0
  132. package/dist/plugins/types.d.ts +69 -0
  133. package/dist/properties/index.js +158 -0
  134. package/dist/properties/index.js.map +1 -0
  135. package/dist/properties/index.mjs +141 -0
  136. package/dist/properties/index.mjs.map +1 -0
  137. package/dist/states/index.d.ts +45 -0
  138. package/dist/states/index.js +389 -0
  139. package/dist/states/index.js.map +1 -0
  140. package/dist/states/index.mjs +161 -0
  141. package/dist/states/index.mjs.map +1 -0
  142. package/dist/static/index.d.ts +5 -0
  143. package/dist/static/index.js +5 -0
  144. package/dist/static/tastyStatic.d.ts +46 -0
  145. package/dist/static/tastyStatic.js +31 -0
  146. package/dist/static/tastyStatic.js.map +1 -0
  147. package/dist/static/types.d.ts +49 -0
  148. package/dist/static/types.js +24 -0
  149. package/dist/static/types.js.map +1 -0
  150. package/dist/styles/align.d.ts +15 -0
  151. package/dist/styles/align.js +14 -0
  152. package/dist/styles/align.js.map +1 -0
  153. package/dist/styles/align.mjs +14 -0
  154. package/dist/styles/align.mjs.map +1 -0
  155. package/dist/styles/border.d.ts +25 -0
  156. package/dist/styles/border.js +114 -0
  157. package/dist/styles/border.js.map +1 -0
  158. package/dist/styles/border.mjs +114 -0
  159. package/dist/styles/border.mjs.map +1 -0
  160. package/dist/styles/color.d.ts +14 -0
  161. package/dist/styles/color.js +23 -0
  162. package/dist/styles/color.js.map +1 -0
  163. package/dist/styles/color.mjs +23 -0
  164. package/dist/styles/color.mjs.map +1 -0
  165. package/dist/styles/createStyle.js +77 -0
  166. package/dist/styles/createStyle.js.map +1 -0
  167. package/dist/styles/createStyle.mjs +77 -0
  168. package/dist/styles/createStyle.mjs.map +1 -0
  169. package/dist/styles/dimension.js +97 -0
  170. package/dist/styles/dimension.js.map +1 -0
  171. package/dist/styles/dimension.mjs +97 -0
  172. package/dist/styles/dimension.mjs.map +1 -0
  173. package/dist/styles/display.d.ts +37 -0
  174. package/dist/styles/display.js +67 -0
  175. package/dist/styles/display.js.map +1 -0
  176. package/dist/styles/display.mjs +67 -0
  177. package/dist/styles/display.mjs.map +1 -0
  178. package/dist/styles/fade.d.ts +15 -0
  179. package/dist/styles/fade.js +58 -0
  180. package/dist/styles/fade.js.map +1 -0
  181. package/dist/styles/fade.mjs +58 -0
  182. package/dist/styles/fade.mjs.map +1 -0
  183. package/dist/styles/fill.d.ts +44 -0
  184. package/dist/styles/fill.js +51 -0
  185. package/dist/styles/fill.js.map +1 -0
  186. package/dist/styles/fill.mjs +51 -0
  187. package/dist/styles/fill.mjs.map +1 -0
  188. package/dist/styles/flow.d.ts +16 -0
  189. package/dist/styles/flow.js +12 -0
  190. package/dist/styles/flow.js.map +1 -0
  191. package/dist/styles/flow.mjs +12 -0
  192. package/dist/styles/flow.mjs.map +1 -0
  193. package/dist/styles/gap.d.ts +31 -0
  194. package/dist/styles/gap.js +37 -0
  195. package/dist/styles/gap.js.map +1 -0
  196. package/dist/styles/gap.mjs +37 -0
  197. package/dist/styles/gap.mjs.map +1 -0
  198. package/dist/styles/height.d.ts +17 -0
  199. package/dist/styles/height.js +20 -0
  200. package/dist/styles/height.js.map +1 -0
  201. package/dist/styles/height.mjs +20 -0
  202. package/dist/styles/height.mjs.map +1 -0
  203. package/dist/styles/index.d.ts +2 -0
  204. package/dist/styles/index.js +9 -0
  205. package/dist/styles/index.js.map +1 -0
  206. package/dist/styles/index.mjs +9 -0
  207. package/dist/styles/index.mjs.map +1 -0
  208. package/dist/styles/inset.d.ts +50 -0
  209. package/dist/styles/inset.js +142 -0
  210. package/dist/styles/inset.js.map +1 -0
  211. package/dist/styles/inset.mjs +142 -0
  212. package/dist/styles/inset.mjs.map +1 -0
  213. package/dist/styles/justify.d.ts +15 -0
  214. package/dist/styles/justify.js +14 -0
  215. package/dist/styles/justify.js.map +1 -0
  216. package/dist/styles/justify.mjs +14 -0
  217. package/dist/styles/justify.mjs.map +1 -0
  218. package/dist/styles/list.d.ts +16 -0
  219. package/dist/styles/list.js +98 -0
  220. package/dist/styles/list.js.map +1 -0
  221. package/dist/styles/margin.d.ts +28 -0
  222. package/dist/styles/margin.js +96 -0
  223. package/dist/styles/margin.js.map +1 -0
  224. package/dist/styles/margin.mjs +96 -0
  225. package/dist/styles/margin.mjs.map +1 -0
  226. package/dist/styles/outline.d.ts +29 -0
  227. package/dist/styles/outline.js +65 -0
  228. package/dist/styles/outline.js.map +1 -0
  229. package/dist/styles/outline.mjs +65 -0
  230. package/dist/styles/outline.mjs.map +1 -0
  231. package/dist/styles/padding.d.ts +28 -0
  232. package/dist/styles/padding.js +96 -0
  233. package/dist/styles/padding.js.map +1 -0
  234. package/dist/styles/padding.mjs +96 -0
  235. package/dist/styles/padding.mjs.map +1 -0
  236. package/dist/styles/predefined.d.ts +74 -0
  237. package/dist/styles/predefined.js +241 -0
  238. package/dist/styles/predefined.js.map +1 -0
  239. package/dist/styles/predefined.mjs +232 -0
  240. package/dist/styles/predefined.mjs.map +1 -0
  241. package/dist/styles/preset.d.ts +47 -0
  242. package/dist/styles/preset.js +126 -0
  243. package/dist/styles/preset.js.map +1 -0
  244. package/dist/styles/preset.mjs +126 -0
  245. package/dist/styles/preset.mjs.map +1 -0
  246. package/dist/styles/radius.d.ts +14 -0
  247. package/dist/styles/radius.js +51 -0
  248. package/dist/styles/radius.js.map +1 -0
  249. package/dist/styles/radius.mjs +51 -0
  250. package/dist/styles/radius.mjs.map +1 -0
  251. package/dist/styles/scrollbar.d.ts +21 -0
  252. package/dist/styles/scrollbar.js +105 -0
  253. package/dist/styles/scrollbar.js.map +1 -0
  254. package/dist/styles/scrollbar.mjs +105 -0
  255. package/dist/styles/scrollbar.mjs.map +1 -0
  256. package/dist/styles/shadow.d.ts +14 -0
  257. package/dist/styles/shadow.js +24 -0
  258. package/dist/styles/shadow.js.map +1 -0
  259. package/dist/styles/shadow.mjs +24 -0
  260. package/dist/styles/shadow.mjs.map +1 -0
  261. package/dist/styles/styledScrollbar.d.ts +47 -0
  262. package/dist/styles/styledScrollbar.js +38 -0
  263. package/dist/styles/styledScrollbar.js.map +1 -0
  264. package/dist/styles/styledScrollbar.mjs +38 -0
  265. package/dist/styles/styledScrollbar.mjs.map +1 -0
  266. package/dist/styles/transition.d.ts +14 -0
  267. package/dist/styles/transition.js +138 -0
  268. package/dist/styles/transition.js.map +1 -0
  269. package/dist/styles/transition.mjs +138 -0
  270. package/dist/styles/transition.mjs.map +1 -0
  271. package/dist/styles/types.d.mts +492 -0
  272. package/dist/styles/types.d.ts +496 -0
  273. package/dist/styles/width.d.ts +17 -0
  274. package/dist/styles/width.js +20 -0
  275. package/dist/styles/width.js.map +1 -0
  276. package/dist/styles/width.mjs +20 -0
  277. package/dist/styles/width.mjs.map +1 -0
  278. package/dist/tasty.d.ts +983 -0
  279. package/dist/tasty.js +191 -0
  280. package/dist/tasty.js.map +1 -0
  281. package/dist/tokens/typography.d.ts +19 -0
  282. package/dist/tokens/typography.js +237 -0
  283. package/dist/tokens/typography.js.map +1 -0
  284. package/dist/types.d.ts +182 -0
  285. package/dist/utils/cache-wrapper.js +26 -0
  286. package/dist/utils/cache-wrapper.js.map +1 -0
  287. package/dist/utils/cache-wrapper.mjs +26 -0
  288. package/dist/utils/cache-wrapper.mjs.map +1 -0
  289. package/dist/utils/case-converter.js +8 -0
  290. package/dist/utils/case-converter.js.map +1 -0
  291. package/dist/utils/case-converter.mjs +8 -0
  292. package/dist/utils/case-converter.mjs.map +1 -0
  293. package/dist/utils/colors.d.ts +5 -0
  294. package/dist/utils/colors.js +9 -0
  295. package/dist/utils/colors.js.map +1 -0
  296. package/dist/utils/dotize.d.ts +26 -0
  297. package/dist/utils/dotize.js +122 -0
  298. package/dist/utils/dotize.js.map +1 -0
  299. package/dist/utils/filter-base-props.d.ts +15 -0
  300. package/dist/utils/filter-base-props.js +45 -0
  301. package/dist/utils/filter-base-props.js.map +1 -0
  302. package/dist/utils/get-display-name.d.ts +7 -0
  303. package/dist/utils/get-display-name.js +10 -0
  304. package/dist/utils/get-display-name.js.map +1 -0
  305. package/dist/utils/hsl-to-rgb.js +38 -0
  306. package/dist/utils/hsl-to-rgb.js.map +1 -0
  307. package/dist/utils/hsl-to-rgb.mjs +38 -0
  308. package/dist/utils/hsl-to-rgb.mjs.map +1 -0
  309. package/dist/utils/is-dev-env.js +19 -0
  310. package/dist/utils/is-dev-env.js.map +1 -0
  311. package/dist/utils/is-dev-env.mjs +19 -0
  312. package/dist/utils/is-dev-env.mjs.map +1 -0
  313. package/dist/utils/merge-styles.d.ts +7 -0
  314. package/dist/utils/merge-styles.js +146 -0
  315. package/dist/utils/merge-styles.js.map +1 -0
  316. package/dist/utils/merge-styles.mjs +146 -0
  317. package/dist/utils/merge-styles.mjs.map +1 -0
  318. package/dist/utils/mod-attrs.d.ts +8 -0
  319. package/dist/utils/mod-attrs.js +21 -0
  320. package/dist/utils/mod-attrs.js.map +1 -0
  321. package/dist/utils/okhsl-to-rgb.js +296 -0
  322. package/dist/utils/okhsl-to-rgb.js.map +1 -0
  323. package/dist/utils/okhsl-to-rgb.mjs +296 -0
  324. package/dist/utils/okhsl-to-rgb.mjs.map +1 -0
  325. package/dist/utils/process-tokens.d.ts +31 -0
  326. package/dist/utils/process-tokens.js +171 -0
  327. package/dist/utils/process-tokens.js.map +1 -0
  328. package/dist/utils/process-tokens.mjs +28 -0
  329. package/dist/utils/process-tokens.mjs.map +1 -0
  330. package/dist/utils/resolve-recipes.d.ts +17 -0
  331. package/dist/utils/resolve-recipes.js +143 -0
  332. package/dist/utils/resolve-recipes.js.map +1 -0
  333. package/dist/utils/resolve-recipes.mjs +143 -0
  334. package/dist/utils/resolve-recipes.mjs.map +1 -0
  335. package/dist/utils/string.js +8 -0
  336. package/dist/utils/string.js.map +1 -0
  337. package/dist/utils/string.mjs +8 -0
  338. package/dist/utils/string.mjs.map +1 -0
  339. package/dist/utils/styles.d.mts +18 -0
  340. package/dist/utils/styles.d.ts +183 -0
  341. package/dist/utils/styles.js +585 -0
  342. package/dist/utils/styles.js.map +1 -0
  343. package/dist/utils/styles.mjs +346 -0
  344. package/dist/utils/styles.mjs.map +1 -0
  345. package/dist/utils/typography.d.ts +36 -0
  346. package/dist/utils/typography.js +53 -0
  347. package/dist/utils/typography.js.map +1 -0
  348. package/dist/utils/warnings.d.ts +16 -0
  349. package/dist/utils/warnings.js +16 -0
  350. package/dist/utils/warnings.js.map +1 -0
  351. package/dist/zero/babel.d.mts +108 -0
  352. package/dist/zero/babel.mjs +282 -0
  353. package/dist/zero/babel.mjs.map +1 -0
  354. package/dist/zero/index.d.mts +3 -0
  355. package/dist/zero/index.mjs +4 -0
  356. package/dist/zero/next.d.mts +60 -0
  357. package/dist/zero/next.mjs +78 -0
  358. package/dist/zero/next.mjs.map +1 -0
  359. package/package.json +127 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hsl-to-rgb.mjs","names":[],"sources":["../../src/utils/hsl-to-rgb.ts"],"sourcesContent":["import { hslToRgbValues } from './process-tokens';\n\n/**\n * Convert HSL color string to RGB.\n * Supports:\n * - Modern: hsl(h s% l%), hsl(h s% l% / a)\n * - Legacy: hsl(h, s%, l%), hsla(h, s%, l%, a)\n */\nexport function hslToRgb(hslStr: string): string | null {\n const match = hslStr.match(/hsla?\\(([^)]+)\\)/i);\n if (!match) return null;\n\n const inner = match[1].trim();\n const [colorPart, slashAlpha] = inner.split('/');\n const parts = colorPart\n .trim()\n .split(/[,\\s]+/)\n .filter(Boolean);\n\n if (parts.length < 3) return null;\n\n // Alpha can come from slash notation (modern) or 4th part (legacy comma syntax)\n const alphaPart = slashAlpha?.trim() || (parts.length >= 4 ? parts[3] : null);\n\n // Parse hue\n let h = parseFloat(parts[0]);\n const hueStr = parts[0].toLowerCase();\n if (hueStr.endsWith('turn')) h = parseFloat(hueStr) * 360;\n else if (hueStr.endsWith('rad')) h = (parseFloat(hueStr) * 180) / Math.PI;\n h = ((h % 360) + 360) % 360;\n\n // Parse saturation and lightness\n const parsePercent = (val: string): number => {\n const num = parseFloat(val);\n return val.includes('%') ? num / 100 : num;\n };\n const s = Math.max(0, Math.min(1, parsePercent(parts[1])));\n const l = Math.max(0, Math.min(1, parsePercent(parts[2])));\n\n // Use shared HSL to RGB conversion\n const [r, g, b] = hslToRgbValues(h, s, l);\n\n if (alphaPart) {\n const alpha = parseFloat(alphaPart.trim());\n return `rgba(${Math.round(r)}, ${Math.round(g)}, ${Math.round(b)}, ${alpha})`;\n }\n\n return `rgb(${Math.round(r)} ${Math.round(g)} ${Math.round(b)})`;\n}\n"],"mappings":";;;;;;;;;AAQA,SAAgB,SAAS,QAA+B;CACtD,MAAM,QAAQ,OAAO,MAAM,oBAAoB;AAC/C,KAAI,CAAC,MAAO,QAAO;CAGnB,MAAM,CAAC,WAAW,cADJ,MAAM,GAAG,MAAM,CACS,MAAM,IAAI;CAChD,MAAM,QAAQ,UACX,MAAM,CACN,MAAM,SAAS,CACf,OAAO,QAAQ;AAElB,KAAI,MAAM,SAAS,EAAG,QAAO;CAG7B,MAAM,YAAY,YAAY,MAAM,KAAK,MAAM,UAAU,IAAI,MAAM,KAAK;CAGxE,IAAI,IAAI,WAAW,MAAM,GAAG;CAC5B,MAAM,SAAS,MAAM,GAAG,aAAa;AACrC,KAAI,OAAO,SAAS,OAAO,CAAE,KAAI,WAAW,OAAO,GAAG;UAC7C,OAAO,SAAS,MAAM,CAAE,KAAK,WAAW,OAAO,GAAG,MAAO,KAAK;AACvE,MAAM,IAAI,MAAO,OAAO;CAGxB,MAAM,gBAAgB,QAAwB;EAC5C,MAAM,MAAM,WAAW,IAAI;AAC3B,SAAO,IAAI,SAAS,IAAI,GAAG,MAAM,MAAM;;CAEzC,MAAM,IAAI,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,aAAa,MAAM,GAAG,CAAC,CAAC;CAC1D,MAAM,IAAI,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,aAAa,MAAM,GAAG,CAAC,CAAC;CAG1D,MAAM,CAAC,GAAG,GAAG,KAAK,eAAe,GAAG,GAAG,EAAE;AAEzC,KAAI,WAAW;EACb,MAAM,QAAQ,WAAW,UAAU,MAAM,CAAC;AAC1C,SAAO,QAAQ,KAAK,MAAM,EAAE,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC,IAAI,MAAM;;AAG7E,QAAO,OAAO,KAAK,MAAM,EAAE,CAAC,GAAG,KAAK,MAAM,EAAE,CAAC,GAAG,KAAK,MAAM,EAAE,CAAC"}
@@ -0,0 +1,19 @@
1
+ //#region src/utils/is-dev-env.ts
2
+ /**
3
+ * Check if we're in a development environment at runtime
4
+ * Uses bracket notation to avoid bundler compilation
5
+ * Also checks for TASTY_DEBUG localStorage setting
6
+ */
7
+ function isDevEnv() {
8
+ if (typeof window !== "undefined" && window.localStorage) try {
9
+ const forceTastyDebug = window.localStorage.getItem("TASTY_DEBUG");
10
+ if (forceTastyDebug !== null && forceTastyDebug.toLowerCase() === "true") return true;
11
+ } catch {}
12
+ if (typeof process === "undefined") return false;
13
+ const nodeEnv = "development";
14
+ return nodeEnv !== "test" && nodeEnv !== "production";
15
+ }
16
+
17
+ //#endregion
18
+ export { isDevEnv };
19
+ //# sourceMappingURL=is-dev-env.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-dev-env.js","names":[],"sources":["../../src/utils/is-dev-env.ts"],"sourcesContent":["/**\n * Check if we're in a development environment at runtime\n * Uses bracket notation to avoid bundler compilation\n * Also checks for TASTY_DEBUG localStorage setting\n */\nexport function isDevEnv(): boolean {\n // Check localStorage for DEBUG_TASTY setting (browser environment)\n if (typeof window !== 'undefined' && window.localStorage) {\n try {\n const forceTastyDebug = window.localStorage.getItem('TASTY_DEBUG');\n if (\n forceTastyDebug !== null &&\n forceTastyDebug.toLowerCase() === 'true'\n ) {\n return true;\n }\n } catch {\n // localStorage might not be available (private browsing, etc.)\n // Continue with other checks\n }\n }\n\n // Check NODE_ENV for Node.js environments\n if (typeof process === 'undefined') return false;\n\n // Use bracket notation to avoid bundler replacement\n const nodeEnv = process.env?.['NODE_ENV'];\n return nodeEnv !== 'test' && nodeEnv !== 'production';\n}\n"],"mappings":";;;;;;AAKA,SAAgB,WAAoB;AAElC,KAAI,OAAO,WAAW,eAAe,OAAO,aAC1C,KAAI;EACF,MAAM,kBAAkB,OAAO,aAAa,QAAQ,cAAc;AAClE,MACE,oBAAoB,QACpB,gBAAgB,aAAa,KAAK,OAElC,QAAO;SAEH;AAOV,KAAI,OAAO,YAAY,YAAa,QAAO;CAG3C,MAAM;AACN,QAAO,YAAY,UAAU,YAAY"}
@@ -0,0 +1,19 @@
1
+ //#region src/utils/is-dev-env.ts
2
+ /**
3
+ * Check if we're in a development environment at runtime
4
+ * Uses bracket notation to avoid bundler compilation
5
+ * Also checks for TASTY_DEBUG localStorage setting
6
+ */
7
+ function isDevEnv() {
8
+ if (typeof window !== "undefined" && window.localStorage) try {
9
+ const forceTastyDebug = window.localStorage.getItem("TASTY_DEBUG");
10
+ if (forceTastyDebug !== null && forceTastyDebug.toLowerCase() === "true") return true;
11
+ } catch {}
12
+ if (typeof process === "undefined") return false;
13
+ const nodeEnv = process.env?.["NODE_ENV"];
14
+ return nodeEnv !== "test" && nodeEnv !== "production";
15
+ }
16
+
17
+ //#endregion
18
+ export { isDevEnv };
19
+ //# sourceMappingURL=is-dev-env.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-dev-env.mjs","names":[],"sources":["../../src/utils/is-dev-env.ts"],"sourcesContent":["/**\n * Check if we're in a development environment at runtime\n * Uses bracket notation to avoid bundler compilation\n * Also checks for TASTY_DEBUG localStorage setting\n */\nexport function isDevEnv(): boolean {\n // Check localStorage for DEBUG_TASTY setting (browser environment)\n if (typeof window !== 'undefined' && window.localStorage) {\n try {\n const forceTastyDebug = window.localStorage.getItem('TASTY_DEBUG');\n if (\n forceTastyDebug !== null &&\n forceTastyDebug.toLowerCase() === 'true'\n ) {\n return true;\n }\n } catch {\n // localStorage might not be available (private browsing, etc.)\n // Continue with other checks\n }\n }\n\n // Check NODE_ENV for Node.js environments\n if (typeof process === 'undefined') return false;\n\n // Use bracket notation to avoid bundler replacement\n const nodeEnv = process.env?.['NODE_ENV'];\n return nodeEnv !== 'test' && nodeEnv !== 'production';\n}\n"],"mappings":";;;;;;AAKA,SAAgB,WAAoB;AAElC,KAAI,OAAO,WAAW,eAAe,OAAO,aAC1C,KAAI;EACF,MAAM,kBAAkB,OAAO,aAAa,QAAQ,cAAc;AAClE,MACE,oBAAoB,QACpB,gBAAgB,aAAa,KAAK,OAElC,QAAO;SAEH;AAOV,KAAI,OAAO,YAAY,YAAa,QAAO;CAG3C,MAAM,UAAU,QAAQ,MAAM;AAC9B,QAAO,YAAY,UAAU,YAAY"}
@@ -0,0 +1,7 @@
1
+ import { Styles } from "../styles/types.js";
2
+
3
+ //#region src/utils/merge-styles.d.ts
4
+ declare function mergeStyles(...objects: (Styles | undefined | null)[]): Styles;
5
+ //#endregion
6
+ export { mergeStyles };
7
+ //# sourceMappingURL=merge-styles.d.ts.map
@@ -0,0 +1,146 @@
1
+ import { isDevEnv } from "./is-dev-env.js";
2
+ import { isSelector } from "../pipeline/index.js";
3
+
4
+ //#region src/utils/merge-styles.ts
5
+ const devMode = isDevEnv();
6
+ const INHERIT_VALUE = "@inherit";
7
+ /**
8
+ * Check if a value is a state map (object, not array).
9
+ */
10
+ function isStateMap(value) {
11
+ return typeof value === "object" && value !== null && !Array.isArray(value);
12
+ }
13
+ /**
14
+ * Normalize a parent value to a state map.
15
+ * - Already a state map → return as-is
16
+ * - Non-null, non-false primitive → wrap as `{ '': value }`
17
+ * - null / undefined / false → return null (no parent to merge with)
18
+ */
19
+ function normalizeToStateMap(value) {
20
+ if (isStateMap(value)) return value;
21
+ if (value != null && value !== false) return { "": value };
22
+ return null;
23
+ }
24
+ /**
25
+ * Resolve a child state map against a parent value.
26
+ *
27
+ * Mode is determined by whether the child contains a `''` (default) key:
28
+ * - No `''` → extend mode: parent entries preserved, child adds/overrides/repositions
29
+ * - Has `''` → replace mode: child defines everything, `@inherit` cherry-picks from parent
30
+ *
31
+ * In both modes:
32
+ * - `@inherit` value → resolve from parent state map
33
+ * - `null` value → remove this state from the result
34
+ * - `false` value → tombstone, persists through all layers, blocks recipe
35
+ */
36
+ function resolveStateMap(parentValue, childMap) {
37
+ const isExtend = !("" in childMap);
38
+ const parentMap = normalizeToStateMap(parentValue);
39
+ if (!parentMap) {
40
+ const result = {};
41
+ for (const key of Object.keys(childMap)) {
42
+ const val = childMap[key];
43
+ if (val === null || val === INHERIT_VALUE) continue;
44
+ result[key] = val;
45
+ }
46
+ return result;
47
+ }
48
+ if (isExtend) return resolveExtendMode(parentMap, childMap);
49
+ return resolveReplaceMode(parentMap, childMap);
50
+ }
51
+ /**
52
+ * Extend mode: parent entries are preserved, child entries add/override/reposition.
53
+ */
54
+ function resolveExtendMode(parentMap, childMap) {
55
+ const inheritKeys = /* @__PURE__ */ new Set();
56
+ const removeKeys = /* @__PURE__ */ new Set();
57
+ const overrideKeys = /* @__PURE__ */ new Map();
58
+ for (const key of Object.keys(childMap)) {
59
+ const val = childMap[key];
60
+ if (val === INHERIT_VALUE) {
61
+ if (key in parentMap) inheritKeys.add(key);
62
+ else if (devMode) console.warn(`[Tasty] @inherit used for state '${key}' that does not exist in the parent style map. Entry skipped.`);
63
+ } else if (val === null) removeKeys.add(key);
64
+ else if (key in parentMap) overrideKeys.set(key, val);
65
+ }
66
+ const result = {};
67
+ for (const key of Object.keys(parentMap)) {
68
+ if (removeKeys.has(key)) continue;
69
+ if (inheritKeys.has(key)) continue;
70
+ if (overrideKeys.has(key)) result[key] = overrideKeys.get(key);
71
+ else result[key] = parentMap[key];
72
+ }
73
+ for (const key of Object.keys(childMap)) if (inheritKeys.has(key)) result[key] = parentMap[key];
74
+ else if (!removeKeys.has(key) && !overrideKeys.has(key) && childMap[key] !== INHERIT_VALUE) result[key] = childMap[key];
75
+ return result;
76
+ }
77
+ /**
78
+ * Replace mode: child entries define the result, `@inherit` pulls from parent.
79
+ */
80
+ function resolveReplaceMode(parentMap, childMap) {
81
+ const result = {};
82
+ for (const key of Object.keys(childMap)) {
83
+ const val = childMap[key];
84
+ if (val === INHERIT_VALUE) {
85
+ if (key in parentMap) result[key] = parentMap[key];
86
+ else if (devMode) console.warn(`[Tasty] @inherit used for state '${key}' that does not exist in the parent style map. Entry skipped.`);
87
+ } else if (val !== null) result[key] = val;
88
+ }
89
+ return result;
90
+ }
91
+ /**
92
+ * Merge sub-element properties with state map / null / undefined support.
93
+ */
94
+ function mergeSubElementStyles(parentSub, childSub) {
95
+ const parent = parentSub;
96
+ const child = childSub;
97
+ const merged = {
98
+ ...parent,
99
+ ...child
100
+ };
101
+ for (const key of Object.keys(child)) {
102
+ const val = child[key];
103
+ if (val === void 0) {
104
+ if (parent && key in parent) merged[key] = parent[key];
105
+ } else if (val === null) delete merged[key];
106
+ else if (isStateMap(val)) merged[key] = resolveStateMap(parent ? parent[key] : void 0, val);
107
+ }
108
+ return merged;
109
+ }
110
+ function mergeStyles(...objects) {
111
+ let styles = objects[0] ? { ...objects[0] } : {};
112
+ let pos = 1;
113
+ while (pos in objects) {
114
+ const selectorKeys = Object.keys(styles).filter((key) => isSelector(key) && styles[key]);
115
+ const newStyles = objects[pos];
116
+ if (newStyles) {
117
+ const resultStyles = {
118
+ ...styles,
119
+ ...newStyles
120
+ };
121
+ const newSelectorKeys = Object.keys(newStyles).filter(isSelector);
122
+ const allSelectorKeys = new Set([...selectorKeys, ...newSelectorKeys]);
123
+ for (const key of allSelectorKeys) {
124
+ const newValue = newStyles?.[key];
125
+ if (newValue === false || newValue === null) delete resultStyles[key];
126
+ else if (newValue === void 0) resultStyles[key] = styles[key];
127
+ else if (newValue) resultStyles[key] = mergeSubElementStyles(styles[key], newValue);
128
+ }
129
+ for (const key of Object.keys(newStyles)) {
130
+ if (isSelector(key)) continue;
131
+ const newValue = newStyles[key];
132
+ if (newValue === void 0) if (key in styles) resultStyles[key] = styles[key];
133
+ else delete resultStyles[key];
134
+ else if (newValue === null) delete resultStyles[key];
135
+ else if (isStateMap(newValue)) resultStyles[key] = resolveStateMap(styles[key], newValue);
136
+ }
137
+ styles = resultStyles;
138
+ }
139
+ pos++;
140
+ }
141
+ return styles;
142
+ }
143
+
144
+ //#endregion
145
+ export { mergeStyles };
146
+ //# sourceMappingURL=merge-styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"merge-styles.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":"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"}
@@ -0,0 +1,146 @@
1
+ import { isDevEnv } from "./is-dev-env.mjs";
2
+ import { isSelector } from "../pipeline/index.mjs";
3
+
4
+ //#region src/utils/merge-styles.ts
5
+ const devMode = isDevEnv();
6
+ const INHERIT_VALUE = "@inherit";
7
+ /**
8
+ * Check if a value is a state map (object, not array).
9
+ */
10
+ function isStateMap(value) {
11
+ return typeof value === "object" && value !== null && !Array.isArray(value);
12
+ }
13
+ /**
14
+ * Normalize a parent value to a state map.
15
+ * - Already a state map → return as-is
16
+ * - Non-null, non-false primitive → wrap as `{ '': value }`
17
+ * - null / undefined / false → return null (no parent to merge with)
18
+ */
19
+ function normalizeToStateMap(value) {
20
+ if (isStateMap(value)) return value;
21
+ if (value != null && value !== false) return { "": value };
22
+ return null;
23
+ }
24
+ /**
25
+ * Resolve a child state map against a parent value.
26
+ *
27
+ * Mode is determined by whether the child contains a `''` (default) key:
28
+ * - No `''` → extend mode: parent entries preserved, child adds/overrides/repositions
29
+ * - Has `''` → replace mode: child defines everything, `@inherit` cherry-picks from parent
30
+ *
31
+ * In both modes:
32
+ * - `@inherit` value → resolve from parent state map
33
+ * - `null` value → remove this state from the result
34
+ * - `false` value → tombstone, persists through all layers, blocks recipe
35
+ */
36
+ function resolveStateMap(parentValue, childMap) {
37
+ const isExtend = !("" in childMap);
38
+ const parentMap = normalizeToStateMap(parentValue);
39
+ if (!parentMap) {
40
+ const result = {};
41
+ for (const key of Object.keys(childMap)) {
42
+ const val = childMap[key];
43
+ if (val === null || val === INHERIT_VALUE) continue;
44
+ result[key] = val;
45
+ }
46
+ return result;
47
+ }
48
+ if (isExtend) return resolveExtendMode(parentMap, childMap);
49
+ return resolveReplaceMode(parentMap, childMap);
50
+ }
51
+ /**
52
+ * Extend mode: parent entries are preserved, child entries add/override/reposition.
53
+ */
54
+ function resolveExtendMode(parentMap, childMap) {
55
+ const inheritKeys = /* @__PURE__ */ new Set();
56
+ const removeKeys = /* @__PURE__ */ new Set();
57
+ const overrideKeys = /* @__PURE__ */ new Map();
58
+ for (const key of Object.keys(childMap)) {
59
+ const val = childMap[key];
60
+ if (val === INHERIT_VALUE) {
61
+ if (key in parentMap) inheritKeys.add(key);
62
+ else if (devMode) console.warn(`[Tasty] @inherit used for state '${key}' that does not exist in the parent style map. Entry skipped.`);
63
+ } else if (val === null) removeKeys.add(key);
64
+ else if (key in parentMap) overrideKeys.set(key, val);
65
+ }
66
+ const result = {};
67
+ for (const key of Object.keys(parentMap)) {
68
+ if (removeKeys.has(key)) continue;
69
+ if (inheritKeys.has(key)) continue;
70
+ if (overrideKeys.has(key)) result[key] = overrideKeys.get(key);
71
+ else result[key] = parentMap[key];
72
+ }
73
+ for (const key of Object.keys(childMap)) if (inheritKeys.has(key)) result[key] = parentMap[key];
74
+ else if (!removeKeys.has(key) && !overrideKeys.has(key) && childMap[key] !== INHERIT_VALUE) result[key] = childMap[key];
75
+ return result;
76
+ }
77
+ /**
78
+ * Replace mode: child entries define the result, `@inherit` pulls from parent.
79
+ */
80
+ function resolveReplaceMode(parentMap, childMap) {
81
+ const result = {};
82
+ for (const key of Object.keys(childMap)) {
83
+ const val = childMap[key];
84
+ if (val === INHERIT_VALUE) {
85
+ if (key in parentMap) result[key] = parentMap[key];
86
+ else if (devMode) console.warn(`[Tasty] @inherit used for state '${key}' that does not exist in the parent style map. Entry skipped.`);
87
+ } else if (val !== null) result[key] = val;
88
+ }
89
+ return result;
90
+ }
91
+ /**
92
+ * Merge sub-element properties with state map / null / undefined support.
93
+ */
94
+ function mergeSubElementStyles(parentSub, childSub) {
95
+ const parent = parentSub;
96
+ const child = childSub;
97
+ const merged = {
98
+ ...parent,
99
+ ...child
100
+ };
101
+ for (const key of Object.keys(child)) {
102
+ const val = child[key];
103
+ if (val === void 0) {
104
+ if (parent && key in parent) merged[key] = parent[key];
105
+ } else if (val === null) delete merged[key];
106
+ else if (isStateMap(val)) merged[key] = resolveStateMap(parent ? parent[key] : void 0, val);
107
+ }
108
+ return merged;
109
+ }
110
+ function mergeStyles(...objects) {
111
+ let styles = objects[0] ? { ...objects[0] } : {};
112
+ let pos = 1;
113
+ while (pos in objects) {
114
+ const selectorKeys = Object.keys(styles).filter((key) => isSelector(key) && styles[key]);
115
+ const newStyles = objects[pos];
116
+ if (newStyles) {
117
+ const resultStyles = {
118
+ ...styles,
119
+ ...newStyles
120
+ };
121
+ const newSelectorKeys = Object.keys(newStyles).filter(isSelector);
122
+ const allSelectorKeys = new Set([...selectorKeys, ...newSelectorKeys]);
123
+ for (const key of allSelectorKeys) {
124
+ const newValue = newStyles?.[key];
125
+ if (newValue === false || newValue === null) delete resultStyles[key];
126
+ else if (newValue === void 0) resultStyles[key] = styles[key];
127
+ else if (newValue) resultStyles[key] = mergeSubElementStyles(styles[key], newValue);
128
+ }
129
+ for (const key of Object.keys(newStyles)) {
130
+ if (isSelector(key)) continue;
131
+ const newValue = newStyles[key];
132
+ if (newValue === void 0) if (key in styles) resultStyles[key] = styles[key];
133
+ else delete resultStyles[key];
134
+ else if (newValue === null) delete resultStyles[key];
135
+ else if (isStateMap(newValue)) resultStyles[key] = resolveStateMap(styles[key], newValue);
136
+ }
137
+ styles = resultStyles;
138
+ }
139
+ pos++;
140
+ }
141
+ return styles;
142
+ }
143
+
144
+ //#endregion
145
+ export { mergeStyles };
146
+ //# sourceMappingURL=merge-styles.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"merge-styles.mjs","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":"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"}
@@ -0,0 +1,8 @@
1
+ import { ModValue } from "../types.js";
2
+ import "../index.js";
3
+
4
+ //#region src/utils/mod-attrs.d.ts
5
+ declare const _modAttrs: (firstArg: Record<string, ModValue> | undefined, secondArg?: unknown) => Record<string, string> | null;
6
+ //#endregion
7
+ export { _modAttrs };
8
+ //# sourceMappingURL=mod-attrs.d.ts.map
@@ -0,0 +1,21 @@
1
+ import { cacheWrapper } from "./cache-wrapper.js";
2
+ import { camelToKebab } from "./case-converter.js";
3
+
4
+ //#region src/utils/mod-attrs.ts
5
+ function modAttrs(map) {
6
+ return map ? Object.keys(map).reduce((attrs, key) => {
7
+ const value = map[key];
8
+ if (value == null || value === false) return attrs;
9
+ const attrName = `data-${camelToKebab(key)}`;
10
+ if (value === true) attrs[attrName] = "";
11
+ else if (typeof value === "string") attrs[attrName] = value;
12
+ else if (typeof value === "number") attrs[attrName] = String(value);
13
+ else console.warn(`CubeUIKit: Invalid mod value for "${key}". Expected boolean, string, or number, got ${typeof value}`);
14
+ return attrs;
15
+ }, {}) : null;
16
+ }
17
+ const _modAttrs = cacheWrapper(modAttrs);
18
+
19
+ //#endregion
20
+ export { _modAttrs };
21
+ //# sourceMappingURL=mod-attrs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mod-attrs.js","names":[],"sources":["../../src/utils/mod-attrs.ts"],"sourcesContent":["/**\n * Generate data DOM attributes from modifier map.\n */\nimport type { AllBaseProps } from '../types';\n\nimport { cacheWrapper } from './cache-wrapper';\nimport { camelToKebab } from './case-converter';\n\nfunction modAttrs(map: AllBaseProps['mods']): Record<string, string> | null {\n return map\n ? Object.keys(map).reduce((attrs, key) => {\n const value = map[key];\n\n // Skip null, undefined, false\n if (value == null || value === false) {\n return attrs;\n }\n\n const attrName = `data-${camelToKebab(key)}`;\n\n if (value === true) {\n // Boolean true: data-{name}=\"\"\n attrs[attrName] = '';\n } else if (typeof value === 'string') {\n // String value: data-{name}=\"value\"\n attrs[attrName] = value;\n } else if (typeof value === 'number') {\n // Number: convert to string\n attrs[attrName] = String(value);\n } else {\n // Reject other types (objects, arrays, functions)\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\n `CubeUIKit: Invalid mod value for \"${key}\". Expected boolean, string, or number, got ${typeof value}`,\n );\n }\n }\n\n return attrs;\n }, {})\n : null;\n}\n\nconst _modAttrs = cacheWrapper(modAttrs);\n\nexport { _modAttrs as modAttrs };\n"],"mappings":";;;;AAQA,SAAS,SAAS,KAA0D;AAC1E,QAAO,MACH,OAAO,KAAK,IAAI,CAAC,QAAQ,OAAO,QAAQ;EACtC,MAAM,QAAQ,IAAI;AAGlB,MAAI,SAAS,QAAQ,UAAU,MAC7B,QAAO;EAGT,MAAM,WAAW,QAAQ,aAAa,IAAI;AAE1C,MAAI,UAAU,KAEZ,OAAM,YAAY;WACT,OAAO,UAAU,SAE1B,OAAM,YAAY;WACT,OAAO,UAAU,SAE1B,OAAM,YAAY,OAAO,MAAM;MAI7B,SAAQ,KACN,qCAAqC,IAAI,8CAA8C,OAAO,QAC/F;AAIL,SAAO;IACN,EAAE,CAAC,GACN;;AAGN,MAAM,YAAY,aAAa,SAAS"}