@salty-css/core 0.2.0 → 0.2.2-refactor-vite-8.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (304) hide show
  1. package/dist/astro-component-Ov1RH0CO.js +4 -0
  2. package/dist/astro-component-r0qEcF1p.cjs +14 -0
  3. package/{bin → dist/bin}/bin-util.d.ts +1 -0
  4. package/dist/bin/bin-util.d.ts.map +1 -0
  5. package/{bin → dist/bin}/commands/build.d.ts +1 -0
  6. package/dist/bin/commands/build.d.ts.map +1 -0
  7. package/{bin → dist/bin}/commands/generate.d.ts +1 -0
  8. package/dist/bin/commands/generate.d.ts.map +1 -0
  9. package/{bin → dist/bin}/commands/init.d.ts +1 -0
  10. package/dist/bin/commands/init.d.ts.map +1 -0
  11. package/{bin → dist/bin}/commands/update.d.ts +1 -0
  12. package/dist/bin/commands/update.d.ts.map +1 -0
  13. package/{bin → dist/bin}/commands/version.d.ts +1 -0
  14. package/dist/bin/commands/version.d.ts.map +1 -0
  15. package/{bin → dist/bin}/confirm-install.d.ts +1 -0
  16. package/dist/bin/confirm-install.d.ts.map +1 -0
  17. package/{bin → dist/bin}/context.d.ts +1 -0
  18. package/dist/bin/context.d.ts.map +1 -0
  19. package/{bin → dist/bin}/detection/css-file.d.ts +1 -0
  20. package/dist/bin/detection/css-file.d.ts.map +1 -0
  21. package/{bin → dist/bin}/frameworks/astro.d.ts +1 -0
  22. package/dist/bin/frameworks/astro.d.ts.map +1 -0
  23. package/{bin → dist/bin}/frameworks/index.d.ts +1 -0
  24. package/dist/bin/frameworks/index.d.ts.map +1 -0
  25. package/{bin → dist/bin}/frameworks/react.d.ts +1 -0
  26. package/dist/bin/frameworks/react.d.ts.map +1 -0
  27. package/{bin → dist/bin}/frameworks/types.d.ts +1 -0
  28. package/dist/bin/frameworks/types.d.ts.map +1 -0
  29. package/dist/bin/index.cjs +2 -0
  30. package/dist/bin/index.d.ts +3 -0
  31. package/dist/bin/index.d.ts.map +1 -0
  32. package/dist/bin/index.js +5 -0
  33. package/{bin → dist/bin}/integrations/astro.d.ts +1 -0
  34. package/dist/bin/integrations/astro.d.ts.map +1 -0
  35. package/{bin → dist/bin}/integrations/eslint.d.ts +1 -0
  36. package/dist/bin/integrations/eslint.d.ts.map +1 -0
  37. package/{bin → dist/bin}/integrations/index.d.ts +1 -0
  38. package/dist/bin/integrations/index.d.ts.map +1 -0
  39. package/{bin → dist/bin}/integrations/next.d.ts +1 -0
  40. package/dist/bin/integrations/next.d.ts.map +1 -0
  41. package/{bin → dist/bin}/integrations/types.d.ts +1 -0
  42. package/dist/bin/integrations/types.d.ts.map +1 -0
  43. package/{bin → dist/bin}/integrations/vite.d.ts +1 -0
  44. package/dist/bin/integrations/vite.d.ts.map +1 -0
  45. package/{bin → dist/bin}/logger.d.ts +1 -0
  46. package/dist/bin/logger.d.ts.map +1 -0
  47. package/dist/bin/main.cjs +1 -0
  48. package/{bin → dist/bin}/main.d.ts +1 -0
  49. package/dist/bin/main.d.ts.map +1 -0
  50. package/dist/bin/main.js +2 -0
  51. package/{bin → dist/bin}/package-json.d.ts +1 -0
  52. package/dist/bin/package-json.d.ts.map +1 -0
  53. package/{bin → dist/bin}/path-defaults.d.ts +1 -0
  54. package/dist/bin/path-defaults.d.ts.map +1 -0
  55. package/{bin → dist/bin}/prettier.d.ts +1 -0
  56. package/dist/bin/prettier.d.ts.map +1 -0
  57. package/{bin → dist/bin}/saltyrc.d.ts +1 -0
  58. package/dist/bin/saltyrc.d.ts.map +1 -0
  59. package/dist/bin/templates.d.ts +15 -0
  60. package/dist/bin/templates.d.ts.map +1 -0
  61. package/dist/chunk-CMqjfN_6.cjs +1 -0
  62. package/dist/compiler/get-files.cjs +1 -0
  63. package/{compiler → dist/compiler}/get-files.d.ts +1 -0
  64. package/dist/compiler/get-files.d.ts.map +1 -0
  65. package/dist/compiler/get-files.js +15 -0
  66. package/dist/compiler/get-function-range.cjs +1 -0
  67. package/{compiler → dist/compiler}/get-function-range.d.ts +1 -0
  68. package/dist/compiler/get-function-range.d.ts.map +1 -0
  69. package/dist/compiler/get-function-range.js +17 -0
  70. package/dist/compiler/helpers.cjs +1 -0
  71. package/{compiler → dist/compiler}/helpers.d.ts +1 -0
  72. package/dist/compiler/helpers.d.ts.map +1 -0
  73. package/dist/compiler/helpers.js +24 -0
  74. package/{compiler → dist/compiler}/resolve-import.d.ts +1 -0
  75. package/dist/compiler/resolve-import.d.ts.map +1 -0
  76. package/dist/compiler/salty-compiler.cjs +1 -0
  77. package/{compiler → dist/compiler}/salty-compiler.d.ts +1 -0
  78. package/dist/compiler/salty-compiler.d.ts.map +1 -0
  79. package/dist/compiler/salty-compiler.js +2 -0
  80. package/{config → dist/config}/define-config.d.ts +1 -0
  81. package/dist/config/define-config.d.ts.map +1 -0
  82. package/dist/config/index.cjs +1 -0
  83. package/{config → dist/config}/index.d.ts +1 -0
  84. package/dist/config/index.d.ts.map +1 -0
  85. package/dist/config/index.js +5 -0
  86. package/dist/css/index.cjs +1 -0
  87. package/{css → dist/css}/index.d.ts +1 -0
  88. package/dist/css/index.d.ts.map +1 -0
  89. package/dist/css/index.js +5 -0
  90. package/dist/css/keyframes.cjs +1 -0
  91. package/{css → dist/css}/keyframes.d.ts +1 -0
  92. package/dist/css/keyframes.d.ts.map +1 -0
  93. package/dist/css/keyframes.js +30 -0
  94. package/dist/css/media.cjs +1 -0
  95. package/{css → dist/css}/media.d.ts +1 -0
  96. package/dist/css/media.d.ts.map +1 -0
  97. package/dist/css/media.js +84 -0
  98. package/dist/css/merge.cjs +1 -0
  99. package/{css → dist/css}/merge.d.ts +1 -0
  100. package/dist/css/merge.d.ts.map +1 -0
  101. package/dist/css/merge.js +20 -0
  102. package/dist/css/token.cjs +1 -0
  103. package/{css → dist/css}/token.d.ts +1 -0
  104. package/dist/css/token.d.ts.map +1 -0
  105. package/dist/css/token.js +4 -0
  106. package/{factories → dist/factories}/define-font.d.ts +1 -0
  107. package/dist/factories/define-font.d.ts.map +1 -0
  108. package/{factories → dist/factories}/define-global-styles.d.ts +1 -0
  109. package/dist/factories/define-global-styles.d.ts.map +1 -0
  110. package/{factories → dist/factories}/define-import.d.ts +1 -0
  111. package/dist/factories/define-import.d.ts.map +1 -0
  112. package/{factories → dist/factories}/define-media-query.d.ts +1 -0
  113. package/dist/factories/define-media-query.d.ts.map +1 -0
  114. package/{factories → dist/factories}/define-templates.d.ts +1 -0
  115. package/dist/factories/define-templates.d.ts.map +1 -0
  116. package/{factories → dist/factories}/define-variables.d.ts +1 -0
  117. package/dist/factories/define-variables.d.ts.map +1 -0
  118. package/dist/factories/index.cjs +1 -0
  119. package/{factories → dist/factories}/index.d.ts +1 -0
  120. package/dist/factories/index.d.ts.map +1 -0
  121. package/dist/factories/index.js +149 -0
  122. package/{generators → dist/generators}/class-name-generator.d.ts +1 -0
  123. package/dist/generators/class-name-generator.d.ts.map +1 -0
  124. package/dist/generators/index.cjs +1 -0
  125. package/{generators → dist/generators}/index.d.ts +1 -0
  126. package/dist/generators/index.d.ts.map +1 -0
  127. package/dist/generators/index.js +2 -0
  128. package/{generators → dist/generators}/styled-generator.d.ts +1 -0
  129. package/dist/generators/styled-generator.d.ts.map +1 -0
  130. package/{generators → dist/generators}/styles-generator.d.ts +1 -0
  131. package/dist/generators/styles-generator.d.ts.map +1 -0
  132. package/dist/generators-CrK45F8i.js +112 -0
  133. package/dist/generators-eEKEtyAm.cjs +1 -0
  134. package/{helpers → dist/helpers}/color.d.ts +1 -0
  135. package/dist/helpers/color.d.ts.map +1 -0
  136. package/dist/helpers/index.cjs +1 -0
  137. package/{helpers → dist/helpers}/index.d.ts +1 -0
  138. package/dist/helpers/index.d.ts.map +1 -0
  139. package/dist/helpers/index.js +33 -0
  140. package/{helpers → dist/helpers}/viewport-clamp.d.ts +1 -0
  141. package/dist/helpers/viewport-clamp.d.ts.map +1 -0
  142. package/dist/instances/classname-instance.cjs +1 -0
  143. package/{instances → dist/instances}/classname-instance.d.ts +1 -0
  144. package/dist/instances/classname-instance.d.ts.map +1 -0
  145. package/dist/instances/classname-instance.js +18 -0
  146. package/dist/main-DGpSu6zK.js +545 -0
  147. package/dist/main-LnoqOq21.cjs +11 -0
  148. package/dist/maybe.d.ts +2 -0
  149. package/dist/maybe.d.ts.map +1 -0
  150. package/dist/parse-styles-2rwbF9j_.cjs +3 -0
  151. package/dist/parse-styles-Bz0otiZ-.js +336 -0
  152. package/dist/parsers/index.cjs +3 -0
  153. package/{parsers → dist/parsers}/index.d.ts +1 -0
  154. package/dist/parsers/index.d.ts.map +1 -0
  155. package/dist/parsers/index.js +79 -0
  156. package/{parsers → dist/parsers}/parse-modifiers.d.ts +1 -0
  157. package/dist/parsers/parse-modifiers.d.ts.map +1 -0
  158. package/{parsers → dist/parsers}/parse-styles.d.ts +1 -0
  159. package/dist/parsers/parse-styles.d.ts.map +1 -0
  160. package/{parsers → dist/parsers}/parse-templates.d.ts +1 -0
  161. package/dist/parsers/parse-templates.d.ts.map +1 -0
  162. package/{parsers → dist/parsers}/parse-tokens.d.ts +1 -0
  163. package/dist/parsers/parse-tokens.d.ts.map +1 -0
  164. package/{parsers → dist/parsers}/parser-regexes.d.ts +1 -0
  165. package/dist/parsers/parser-regexes.d.ts.map +1 -0
  166. package/{parsers → dist/parsers}/parser-types.d.ts +1 -0
  167. package/dist/parsers/parser-types.d.ts.map +1 -0
  168. package/{parsers → dist/parsers}/property-name-check.d.ts +1 -0
  169. package/dist/parsers/property-name-check.d.ts.map +1 -0
  170. package/{parsers → dist/parsers}/resolve-template-variants.d.ts +1 -0
  171. package/dist/parsers/resolve-template-variants.d.ts.map +1 -0
  172. package/{parsers → dist/parsers}/strict.d.ts +1 -0
  173. package/dist/parsers/strict.d.ts.map +1 -0
  174. package/{parsers → dist/parsers}/unit-check.d.ts +1 -0
  175. package/dist/parsers/unit-check.d.ts.map +1 -0
  176. package/dist/runtime/index.cjs +2 -0
  177. package/{runtime → dist/runtime}/index.d.ts +1 -0
  178. package/dist/runtime/index.d.ts.map +1 -0
  179. package/dist/runtime/index.js +20 -0
  180. package/dist/salty-compiler-Bvd0OKHz.cjs +33 -0
  181. package/dist/salty-compiler-CvQ-rsex.js +484 -0
  182. package/dist/salty.config-B0ZiRpHR.cjs +7 -0
  183. package/dist/salty.config-DWF4i7K0.js +4 -0
  184. package/dist/server/index.cjs +1 -0
  185. package/dist/server/index.d.ts +2 -0
  186. package/dist/server/index.d.ts.map +1 -0
  187. package/dist/server/index.js +12 -0
  188. package/{server → dist/server}/should-restart.d.ts +1 -0
  189. package/dist/server/should-restart.d.ts.map +1 -0
  190. package/{styled-file-Cda3EeR6.js → dist/styled-file-BCbAEzBB.cjs} +2 -5
  191. package/dist/styled-file-C_4eLAdV.js +4 -0
  192. package/dist/styled-file-DQHLzmuL.js +4 -0
  193. package/{styled-file-DLcgYmGN.js → dist/styled-file-DorArlCk.cjs} +2 -5
  194. package/{templates → dist/templates}/salty-reset.d.ts +1 -0
  195. package/dist/templates/salty-reset.d.ts.map +1 -0
  196. package/dist/templates-BGHLaAOm.cjs +1 -0
  197. package/dist/templates-DWWLjEiU.js +4 -0
  198. package/{types → dist/types}/cli-types.d.ts +1 -0
  199. package/dist/types/cli-types.d.ts.map +1 -0
  200. package/{types → dist/types}/config-types.d.ts +1 -0
  201. package/dist/types/config-types.d.ts.map +1 -0
  202. package/{types → dist/types}/font-types.d.ts +1 -0
  203. package/dist/types/font-types.d.ts.map +1 -0
  204. package/dist/types/index.cjs +0 -0
  205. package/{types → dist/types}/index.d.ts +1 -0
  206. package/dist/types/index.d.ts.map +1 -0
  207. package/dist/types/index.js +0 -0
  208. package/{types → dist/types}/util-types.d.ts +1 -0
  209. package/dist/types/util-types.d.ts.map +1 -0
  210. package/{util → dist/util}/camel-case.d.ts +1 -0
  211. package/dist/util/camel-case.d.ts.map +1 -0
  212. package/{util → dist/util}/dash-case.d.ts +1 -0
  213. package/dist/util/dash-case.d.ts.map +1 -0
  214. package/{util → dist/util}/dot-case.d.ts +1 -0
  215. package/dist/util/dot-case.d.ts.map +1 -0
  216. package/{util → dist/util}/glob-match.d.ts +1 -0
  217. package/dist/util/glob-match.d.ts.map +1 -0
  218. package/dist/util/index.cjs +1 -0
  219. package/{util → dist/util}/index.d.ts +1 -0
  220. package/dist/util/index.d.ts.map +1 -0
  221. package/dist/util/index.js +72 -0
  222. package/{util → dist/util}/module-type.d.ts +1 -0
  223. package/dist/util/module-type.d.ts.map +1 -0
  224. package/{util → dist/util}/pascal-case.d.ts +1 -0
  225. package/dist/util/pascal-case.d.ts.map +1 -0
  226. package/{util → dist/util}/to-hash.d.ts +1 -0
  227. package/dist/util/to-hash.d.ts.map +1 -0
  228. package/dist/vanilla-file-BEqMIe-6.js +4 -0
  229. package/{vanilla-file-1kOqbCIM.js → dist/vanilla-file-Z3VsOa_U.cjs} +2 -5
  230. package/dist/viewport-clamp-CHOyzt37.cjs +1 -0
  231. package/dist/viewport-clamp-CRtzRvJ3.js +7 -0
  232. package/package.json +67 -64
  233. package/README.md +0 -535
  234. package/astro-component-5hrNTCJ5.js +0 -4
  235. package/astro-component-Dj3enX6K.cjs +0 -4
  236. package/bin/index.cjs +0 -4
  237. package/bin/index.d.ts +0 -2
  238. package/bin/index.js +0 -3
  239. package/bin/main.cjs +0 -783
  240. package/bin/main.js +0 -782
  241. package/bin/templates.d.ts +0 -14
  242. package/class-name-generator-BcbeZdcV.cjs +0 -88
  243. package/class-name-generator-DJ27JHW_.js +0 -89
  244. package/compiler/get-files.cjs +0 -25
  245. package/compiler/get-files.js +0 -25
  246. package/compiler/get-function-range.cjs +0 -22
  247. package/compiler/get-function-range.js +0 -22
  248. package/compiler/helpers.cjs +0 -34
  249. package/compiler/helpers.js +0 -33
  250. package/compiler/salty-compiler.cjs +0 -846
  251. package/compiler/salty-compiler.js +0 -828
  252. package/config/index.cjs +0 -20
  253. package/config/index.js +0 -20
  254. package/css/index.cjs +0 -12
  255. package/css/index.js +0 -12
  256. package/css/keyframes.cjs +0 -49
  257. package/css/keyframes.js +0 -49
  258. package/css/media.cjs +0 -93
  259. package/css/media.js +0 -93
  260. package/css/merge.cjs +0 -20
  261. package/css/merge.js +0 -20
  262. package/css/token.cjs +0 -4
  263. package/css/token.js +0 -4
  264. package/define-templates-CVhhgPnd.js +0 -60
  265. package/define-templates-Deq1aCbN.cjs +0 -59
  266. package/factories/index.cjs +0 -177
  267. package/factories/index.js +0 -177
  268. package/generators/index.cjs +0 -58
  269. package/generators/index.js +0 -59
  270. package/glob-match-C28iYp1A.js +0 -74
  271. package/glob-match-CT1uFlp-.cjs +0 -73
  272. package/helpers/index.cjs +0 -53
  273. package/helpers/index.js +0 -53
  274. package/index-ByR0nfaf.cjs +0 -4
  275. package/index-DKz1QXqs.js +0 -4
  276. package/instances/classname-instance.cjs +0 -31
  277. package/instances/classname-instance.js +0 -31
  278. package/parse-styles-BlUpavVg.js +0 -521
  279. package/parse-styles-DWT4tDyS.cjs +0 -520
  280. package/parsers/index.cjs +0 -147
  281. package/parsers/index.js +0 -148
  282. package/pascal-case-By_l58S-.cjs +0 -7
  283. package/pascal-case-F3Usi5Wf.js +0 -8
  284. package/runtime/index.cjs +0 -24
  285. package/runtime/index.js +0 -24
  286. package/salty.config-DogY_sSQ.cjs +0 -4
  287. package/salty.config-GV37Q-D2.js +0 -4
  288. package/server/index.cjs +0 -4
  289. package/server/index.d.ts +0 -1
  290. package/server/index.js +0 -4
  291. package/should-restart-CQsyHls3.cjs +0 -17
  292. package/should-restart-CXIO0jxY.js +0 -18
  293. package/styled-file-BzmB9_Ez.cjs +0 -12
  294. package/styled-file-CPd_rTW2.cjs +0 -11
  295. package/to-hash-DSoCPs8D.js +0 -33
  296. package/to-hash-DT2ImSPA.cjs +0 -32
  297. package/types/index.cjs +0 -1
  298. package/types/index.js +0 -1
  299. package/util/index.cjs +0 -18
  300. package/util/index.js +0 -18
  301. package/vanilla-file-r0fp2q_m.cjs +0 -18
  302. package/viewport-clamp-CEmzmcSj.cjs +0 -10
  303. package/viewport-clamp-K553uXu3.js +0 -11
  304. /package/{.saltyrc.schema.json → dist/.saltyrc.schema.json} +0 -0
package/parsers/index.js DELETED
@@ -1,148 +0,0 @@
1
- import { i as isRichTemplateNode, p as parseAndJoinStyles } from "../parse-styles-BlUpavVg.js";
2
- import { a, d, e, c, r } from "../parse-styles-BlUpavVg.js";
3
- import { d as dashCase, t as toHash } from "../to-hash-DSoCPs8D.js";
4
- const RICH_META_KEYS = /* @__PURE__ */ new Set(["base", "variants", "defaultVariants", "compoundVariants", "anyOfVariants"]);
5
- const isChildEntry = (key, value) => {
6
- if (RICH_META_KEYS.has(key)) return false;
7
- return !!value && typeof value === "object" && !Array.isArray(value);
8
- };
9
- const parseTemplates = async (obj, path = []) => {
10
- if (!obj) return "";
11
- const classes = [];
12
- if (isRichTemplateNode(obj)) {
13
- const rich = obj;
14
- const baseClassName = path.map((p) => dashCase(String(p))).join("-");
15
- if (rich.base) {
16
- const hashClass = "t_" + toHash(baseClassName, 4);
17
- const result = await parseAndJoinStyles(rich.base, `.${baseClassName}, .${hashClass}`);
18
- classes.push(result);
19
- }
20
- if (rich.variants) {
21
- for (const [axis, valueMap] of Object.entries(rich.variants)) {
22
- if (!valueMap || typeof valueMap !== "object") continue;
23
- for (const [value, styles] of Object.entries(valueMap)) {
24
- if (!styles || typeof styles !== "object") continue;
25
- const variantClassName = `${baseClassName}-${dashCase(axis)}-${dashCase(value)}`;
26
- const variantHashClass = "tv_" + toHash(variantClassName, 4);
27
- const result = await parseAndJoinStyles(styles, `.${variantClassName}, .${variantHashClass}`);
28
- classes.push(result);
29
- }
30
- }
31
- }
32
- for (const [key, value] of Object.entries(rich)) {
33
- if (!isChildEntry(key, value)) continue;
34
- const result = await parseTemplates(value, [...path, key.trim()]);
35
- classes.push(result);
36
- }
37
- return classes.join("\n");
38
- }
39
- const levelStyles = {};
40
- for (const [key, value] of Object.entries(obj)) {
41
- if (typeof value === "function") ;
42
- else if (value && typeof value === "object") {
43
- const _key = key.trim();
44
- const result = await parseTemplates(value, [...path, _key]);
45
- classes.push(result);
46
- } else {
47
- levelStyles[key] = value;
48
- }
49
- }
50
- if (Object.keys(levelStyles).length) {
51
- const className = path.map((p) => dashCase(String(p))).join("-");
52
- const hashClass = "t_" + toHash(className, 4);
53
- const result = await parseAndJoinStyles(levelStyles, `.${className}, .${hashClass}`);
54
- classes.push(result);
55
- }
56
- return classes.join("\n");
57
- };
58
- const getTemplateKeys = (templates) => {
59
- return Object.keys(templates);
60
- };
61
- const getTemplateTypes = (templates) => {
62
- if (!templates) return {};
63
- return Object.entries(templates).reduce((acc, [key, value]) => {
64
- if (typeof value === "function") {
65
- acc[key] = "any";
66
- } else if (typeof value === "object")
67
- acc[key] = getTemplateTokens(value).map((val) => `"${val}"`).join(" | ");
68
- return acc;
69
- }, {});
70
- };
71
- const getTemplateTokens = (templates, parent = "", templateTokens = /* @__PURE__ */ new Set()) => {
72
- if (!templates) return [];
73
- if (isRichTemplateNode(templates)) {
74
- if (parent) templateTokens.add(parent);
75
- Object.entries(templates).forEach(([key, value]) => {
76
- if (!isChildEntry(key, value)) return;
77
- const keyValue = parent ? `${parent}.${key}` : key;
78
- getTemplateTokens(value, keyValue, templateTokens);
79
- });
80
- return [...templateTokens];
81
- }
82
- Object.entries(templates).forEach(([key, value]) => {
83
- const keyValue = parent ? `${parent}.${key}` : key;
84
- if (value && typeof value === "object") return getTemplateTokens(value, keyValue, templateTokens);
85
- return templateTokens.add(parent);
86
- });
87
- return [...templateTokens];
88
- };
89
- const getTemplateVariantMaps = (templates) => {
90
- const result = {};
91
- if (!templates) return result;
92
- for (const [topKey, topNode] of Object.entries(templates)) {
93
- if (!topNode || typeof topNode !== "object" || typeof topNode === "function") continue;
94
- walk(topNode, [], result[topKey] || (result[topKey] = {}), {});
95
- }
96
- return result;
97
- };
98
- const mergeAxes = (inherited, node) => {
99
- const next = {};
100
- for (const [axis, vals] of Object.entries(inherited)) {
101
- next[axis] = { ...vals };
102
- }
103
- if (isRichTemplateNode(node) && node.variants) {
104
- for (const [axis, valueMap] of Object.entries(node.variants)) {
105
- next[axis] = next[axis] || {};
106
- for (const value of Object.keys(valueMap)) next[axis][value] = true;
107
- }
108
- }
109
- return next;
110
- };
111
- const walk = (node, path, out, inheritedAxes) => {
112
- if (!node || typeof node !== "object" || Array.isArray(node)) return;
113
- const axes = mergeAxes(inheritedAxes, node);
114
- const dot = path.join(".");
115
- if (path.length && (isRichTemplateNode(node) || Object.keys(axes).length)) {
116
- const axisMap = {};
117
- for (const [axis, valSet] of Object.entries(axes)) {
118
- const values = Object.keys(valSet);
119
- const isBooleanOnly = values.length === 1 && values[0] === "true";
120
- axisMap[axis] = isBooleanOnly ? "boolean" : values.map((v) => `"${v}"`).join(" | ");
121
- }
122
- if (Object.keys(axisMap).length) out[dot] = axisMap;
123
- }
124
- if (isRichTemplateNode(node)) {
125
- for (const [key, value] of Object.entries(node)) {
126
- if (!isChildEntry(key, value)) continue;
127
- walk(value, [...path, key.trim()], out, axes);
128
- }
129
- return;
130
- }
131
- for (const [key, value] of Object.entries(node)) {
132
- if (!value || typeof value !== "object" || Array.isArray(value)) continue;
133
- walk(value, [...path, key.trim()], out, axes);
134
- }
135
- };
136
- export {
137
- getTemplateKeys,
138
- getTemplateTokens,
139
- getTemplateTypes,
140
- getTemplateVariantMaps,
141
- parseAndJoinStyles,
142
- a as parseStyles,
143
- parseTemplates,
144
- d as parseValueModifiers,
145
- e as parseValueTokens,
146
- c as parseVariableTokens,
147
- r as reportParserIssue
148
- };
@@ -1,7 +0,0 @@
1
- "use strict";
2
- function pascalCase(str) {
3
- if (!str) return "";
4
- if (typeof str !== "string") return pascalCase(String(str));
5
- return str.replace(/\s/g, "-").replace(/[-_]([a-z0-9])/g, (g) => g[1].toUpperCase()).replace(/^[a-z]/, (g) => g.toUpperCase());
6
- }
7
- exports.pascalCase = pascalCase;
@@ -1,8 +0,0 @@
1
- function pascalCase(str) {
2
- if (!str) return "";
3
- if (typeof str !== "string") return pascalCase(String(str));
4
- return str.replace(/\s/g, "-").replace(/[-_]([a-z0-9])/g, (g) => g[1].toUpperCase()).replace(/^[a-z]/, (g) => g.toUpperCase());
5
- }
6
- export {
7
- pascalCase as p
8
- };
package/runtime/index.cjs DELETED
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const parseStyles = require("../parse-styles-DWT4tDyS.cjs");
4
- const toHash = require("../to-hash-DT2ImSPA.cjs");
5
- const defineRuntime = (config) => {
6
- const className = (styles) => toHash.toHash(styles);
7
- const css = async (styles, scope) => {
8
- const parsed = await parseStyles.parseStyles(styles, scope, config);
9
- return parsed.join("\n");
10
- };
11
- const resolve = async (styles, scope) => {
12
- const _className = className(styles);
13
- const _css = await css(styles, scope || `.${_className}`);
14
- return { className: _className, css: _css };
15
- };
16
- return {
17
- className,
18
- css,
19
- resolve,
20
- /** @deprecated Use `css` instead. Kept as an alias for backward compatibility with the standalone `getDynamicStylesCss` helper. */
21
- getDynamicStylesCss: css
22
- };
23
- };
24
- exports.defineRuntime = defineRuntime;
package/runtime/index.js DELETED
@@ -1,24 +0,0 @@
1
- import { a as parseStyles } from "../parse-styles-BlUpavVg.js";
2
- import { t as toHash } from "../to-hash-DSoCPs8D.js";
3
- const defineRuntime = (config) => {
4
- const className = (styles) => toHash(styles);
5
- const css = async (styles, scope) => {
6
- const parsed = await parseStyles(styles, scope, config);
7
- return parsed.join("\n");
8
- };
9
- const resolve = async (styles, scope) => {
10
- const _className = className(styles);
11
- const _css = await css(styles, scope || `.${_className}`);
12
- return { className: _className, css: _css };
13
- };
14
- return {
15
- className,
16
- css,
17
- resolve,
18
- /** @deprecated Use `css` instead. Kept as an alias for backward compatibility with the standalone `getDynamicStylesCss` helper. */
19
- getDynamicStylesCss: css
20
- };
21
- };
22
- export {
23
- defineRuntime
24
- };
@@ -1,4 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const salty_config = "import { defineConfig } from '@salty-css/core/config';\n\nexport const config = defineConfig({\n strict: true,\n externalModules: ['react', 'react-dom']\n});\n";
4
- exports.default = salty_config;
@@ -1,4 +0,0 @@
1
- const salty_config = "import { defineConfig } from '@salty-css/core/config';\n\nexport const config = defineConfig({\n strict: true,\n externalModules: ['react', 'react-dom']\n});\n";
2
- export {
3
- salty_config as default
4
- };
package/server/index.cjs DELETED
@@ -1,4 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const shouldRestart = require("../should-restart-CQsyHls3.cjs");
4
- exports.checkShouldRestart = shouldRestart.checkShouldRestart;
package/server/index.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from './should-restart';
package/server/index.js DELETED
@@ -1,4 +0,0 @@
1
- import { c } from "../should-restart-CXIO0jxY.js";
2
- export {
3
- c as checkShouldRestart
4
- };
@@ -1,17 +0,0 @@
1
- "use strict";
2
- const promises = require("fs/promises");
3
- const compiler_helpers = require("./compiler/helpers.cjs");
4
- const checkShouldRestart = async (filename) => {
5
- if (!filename) return false;
6
- if (filename.includes("node_modules")) return false;
7
- if (filename.includes("saltygen")) return false;
8
- const isConfig = filename.includes("salty.config");
9
- if (isConfig) return true;
10
- const isSalty = compiler_helpers.isSaltyFile(filename);
11
- if (!isSalty) return false;
12
- const contents = await promises.readFile(filename, "utf-8");
13
- if (/.+define[A-Z]\w+/.test(contents)) return true;
14
- if (/.+keyframes\(.+/.test(contents)) return true;
15
- return false;
16
- };
17
- exports.checkShouldRestart = checkShouldRestart;
@@ -1,18 +0,0 @@
1
- import { readFile } from "fs/promises";
2
- import { isSaltyFile } from "./compiler/helpers.js";
3
- const checkShouldRestart = async (filename) => {
4
- if (!filename) return false;
5
- if (filename.includes("node_modules")) return false;
6
- if (filename.includes("saltygen")) return false;
7
- const isConfig = filename.includes("salty.config");
8
- if (isConfig) return true;
9
- const isSalty = isSaltyFile(filename);
10
- if (!isSalty) return false;
11
- const contents = await readFile(filename, "utf-8");
12
- if (/.+define[A-Z]\w+/.test(contents)) return true;
13
- if (/.+keyframes\(.+/.test(contents)) return true;
14
- return false;
15
- };
16
- export {
17
- checkShouldRestart as c
18
- };
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const styledFile = `import { styled } from "@salty-css/astro/styled";
4
-
5
- export const <%- name %> = styled('<%- tag %>', {
6
- <% if(className) { %>className: '<%- className %>',<% } %>
7
- base: {
8
- // Add your styles here
9
- }
10
- })
11
- `;
12
- exports.default = styledFile;
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const styledFile = `import { styled } from "@salty-css/react/styled";
4
-
5
- export const <%- name %> = styled('<%- tag %>', {
6
- <% if(className) { %>className: '<%- className %>',<% } %>
7
- base: {
8
- // Add your styles here
9
- }
10
- })`;
11
- exports.default = styledFile;
@@ -1,33 +0,0 @@
1
- function dashCase(str) {
2
- if (!str) return "";
3
- if (typeof str !== "string") return dashCase(String(str));
4
- return str.replace(/[\s.]/g, "-").replace(/[A-Z](?:(?=[^A-Z])|[A-Z]*(?=[A-Z][^A-Z]|$))/g, (s, i) => {
5
- return (i > 0 ? "-" : "") + s.toLowerCase();
6
- });
7
- }
8
- const toAlphabeticChar = (code) => String.fromCharCode(code + (code > 25 ? 39 : 97));
9
- const toAlphabeticName = (code, length) => {
10
- let name = "";
11
- let x;
12
- for (x = Math.abs(code); x > 52; x = x / 52 | 0) name = toAlphabeticChar(x % 52) + name;
13
- name = toAlphabeticChar(x % 52) + name;
14
- if (name.length < length) {
15
- name = name.padStart(length, "a");
16
- } else if (name.length > length) {
17
- name = name.slice(-length);
18
- }
19
- return name;
20
- };
21
- const toPhash = (h, x) => {
22
- let i = x.length;
23
- while (i) h = h * 33 ^ x.charCodeAt(--i);
24
- return h;
25
- };
26
- const toHash = (value, length = 5) => {
27
- const numericHash = toPhash(5381, JSON.stringify(value)) >>> 0;
28
- return toAlphabeticName(numericHash, length);
29
- };
30
- export {
31
- dashCase as d,
32
- toHash as t
33
- };
@@ -1,32 +0,0 @@
1
- "use strict";
2
- function dashCase(str) {
3
- if (!str) return "";
4
- if (typeof str !== "string") return dashCase(String(str));
5
- return str.replace(/[\s.]/g, "-").replace(/[A-Z](?:(?=[^A-Z])|[A-Z]*(?=[A-Z][^A-Z]|$))/g, (s, i) => {
6
- return (i > 0 ? "-" : "") + s.toLowerCase();
7
- });
8
- }
9
- const toAlphabeticChar = (code) => String.fromCharCode(code + (code > 25 ? 39 : 97));
10
- const toAlphabeticName = (code, length) => {
11
- let name = "";
12
- let x;
13
- for (x = Math.abs(code); x > 52; x = x / 52 | 0) name = toAlphabeticChar(x % 52) + name;
14
- name = toAlphabeticChar(x % 52) + name;
15
- if (name.length < length) {
16
- name = name.padStart(length, "a");
17
- } else if (name.length > length) {
18
- name = name.slice(-length);
19
- }
20
- return name;
21
- };
22
- const toPhash = (h, x) => {
23
- let i = x.length;
24
- while (i) h = h * 33 ^ x.charCodeAt(--i);
25
- return h;
26
- };
27
- const toHash = (value, length = 5) => {
28
- const numericHash = toPhash(5381, JSON.stringify(value)) >>> 0;
29
- return toAlphabeticName(numericHash, length);
30
- };
31
- exports.dashCase = dashCase;
32
- exports.toHash = toHash;
package/types/index.cjs DELETED
@@ -1 +0,0 @@
1
- "use strict";
package/types/index.js DELETED
@@ -1 +0,0 @@
1
-
package/util/index.cjs DELETED
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const toHash = require("../to-hash-DT2ImSPA.cjs");
4
- const globMatch = require("../glob-match-CT1uFlp-.cjs");
5
- const pascalCase = require("../pascal-case-By_l58S-.cjs");
6
- function camelCase(str) {
7
- if (!str) return "";
8
- if (typeof str !== "string") return camelCase(String(str));
9
- return str.replace(/\s/g, "-").replace(/-([a-z])/g, (g) => g[1].toUpperCase());
10
- }
11
- exports.dashCase = toHash.dashCase;
12
- exports.toHash = toHash.toHash;
13
- exports.isPathAllowed = globMatch.isPathAllowed;
14
- exports.matchesAnyGlob = globMatch.matchesAnyGlob;
15
- exports.matchesGlob = globMatch.matchesGlob;
16
- exports.normalizePath = globMatch.normalizePath;
17
- exports.pascalCase = pascalCase.pascalCase;
18
- exports.camelCase = camelCase;
package/util/index.js DELETED
@@ -1,18 +0,0 @@
1
- import { d, t } from "../to-hash-DSoCPs8D.js";
2
- import { i, m, a, n } from "../glob-match-C28iYp1A.js";
3
- import { p } from "../pascal-case-F3Usi5Wf.js";
4
- function camelCase(str) {
5
- if (!str) return "";
6
- if (typeof str !== "string") return camelCase(String(str));
7
- return str.replace(/\s/g, "-").replace(/-([a-z])/g, (g) => g[1].toUpperCase());
8
- }
9
- export {
10
- camelCase,
11
- d as dashCase,
12
- i as isPathAllowed,
13
- m as matchesAnyGlob,
14
- a as matchesGlob,
15
- n as normalizePath,
16
- p as pascalCase,
17
- t as toHash
18
- };
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const vanillaFile = `import { <%- styledComponentName %> } from "./<%- fileName %>.css";
4
-
5
- interface <%- componentName %>Props {
6
- text?: string;
7
- }
8
-
9
- export const <%- componentName %> = ({ text = 'Lorem ipsum' }: <%- componentName %>Props) => {
10
- return (
11
- <<%- styledComponentName %>>
12
- {text}
13
- </<%- styledComponentName %>>
14
- );
15
- };
16
-
17
- export default <%- componentName %>;`;
18
- exports.default = vanillaFile;
@@ -1,10 +0,0 @@
1
- "use strict";
2
- const defineViewportClamp = (config) => (value, min, max) => {
3
- const { screenSize, axis = "horizontal", minMultiplier = 0.5, maxMultiplier = 1.5, minMaxUnit = "px" } = config;
4
- const relativeValue = Math.round(value / screenSize * 1e4) / 100;
5
- const relativeUnit = axis === "vertical" ? "vh" : "vw";
6
- const minValue = min || Math.round(minMultiplier * value);
7
- const maxValue = max || Math.round(maxMultiplier * value);
8
- return `clamp(${minValue}${minMaxUnit}, ${relativeValue}${relativeUnit}, ${maxValue}${minMaxUnit})`;
9
- };
10
- exports.defineViewportClamp = defineViewportClamp;
@@ -1,11 +0,0 @@
1
- const defineViewportClamp = (config) => (value, min, max) => {
2
- const { screenSize, axis = "horizontal", minMultiplier = 0.5, maxMultiplier = 1.5, minMaxUnit = "px" } = config;
3
- const relativeValue = Math.round(value / screenSize * 1e4) / 100;
4
- const relativeUnit = axis === "vertical" ? "vh" : "vw";
5
- const minValue = min || Math.round(minMultiplier * value);
6
- const maxValue = max || Math.round(maxMultiplier * value);
7
- return `clamp(${minValue}${minMaxUnit}, ${relativeValue}${relativeUnit}, ${maxValue}${minMaxUnit})`;
8
- };
9
- export {
10
- defineViewportClamp as d
11
- };