@salty-css/core 0.0.1-alpha.98 → 0.0.1

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 (136) hide show
  1. package/.saltyrc.schema.json +11 -3
  2. package/README.md +415 -47
  3. package/bin/index.cjs +3 -1
  4. package/bin/index.js +2 -2
  5. package/bin/main.cjs +448 -11
  6. package/bin/main.js +411 -209
  7. package/cache/resolve-dynamic-config-cache.cjs +24 -0
  8. package/cache/resolve-dynamic-config-cache.d.ts +1 -0
  9. package/cache/resolve-dynamic-config-cache.js +24 -0
  10. package/class-name-generator-B2Pb2obX.cjs +74 -0
  11. package/class-name-generator-YeSQe_Ik.js +75 -0
  12. package/compiler/as-class.cjs +753 -0
  13. package/compiler/as-class.d.ts +52 -0
  14. package/compiler/as-class.js +735 -0
  15. package/compiler/get-files.cjs +25 -0
  16. package/compiler/get-files.js +25 -0
  17. package/compiler/get-function-range.cjs +22 -0
  18. package/compiler/get-function-range.d.ts +1 -0
  19. package/compiler/get-function-range.js +22 -0
  20. package/compiler/helpers.cjs +25 -0
  21. package/compiler/helpers.d.ts +5 -0
  22. package/compiler/helpers.js +24 -0
  23. package/config/define-config.d.ts +1 -1
  24. package/config/index.cjs +16 -1
  25. package/config/index.d.ts +2 -1
  26. package/config/index.js +14 -2
  27. package/css/index.cjs +12 -1
  28. package/css/index.d.ts +4 -1
  29. package/css/index.js +10 -2
  30. package/css/keyframes.cjs +49 -0
  31. package/css/keyframes.d.ts +22 -0
  32. package/css/keyframes.js +49 -0
  33. package/css/media.cjs +93 -0
  34. package/css/media.d.ts +87 -0
  35. package/css/media.js +93 -0
  36. package/css/merge.cjs +15 -0
  37. package/css/merge.d.ts +7 -0
  38. package/css/merge.js +15 -0
  39. package/css/token.cjs +4 -0
  40. package/css/token.d.ts +1 -0
  41. package/css/token.js +4 -0
  42. package/dash-case-DIwKaYgE.cjs +9 -0
  43. package/dash-case-DblXvymC.js +10 -0
  44. package/define-templates-CVhhgPnd.js +60 -0
  45. package/define-templates-Deq1aCbN.cjs +59 -0
  46. package/factories/define-global-styles.d.ts +7 -0
  47. package/factories/define-media-query.d.ts +8 -0
  48. package/factories/define-templates.d.ts +27 -0
  49. package/factories/define-variables.d.ts +12 -0
  50. package/factories/index.cjs +37 -0
  51. package/factories/index.d.ts +4 -0
  52. package/factories/index.js +37 -0
  53. package/generators/class-name-generator.d.ts +7 -0
  54. package/generators/index.cjs +57 -0
  55. package/generators/index.d.ts +2 -0
  56. package/generators/index.js +58 -0
  57. package/generators/styled-generator.d.ts +20 -0
  58. package/generators/styles-generator.d.ts +22 -0
  59. package/helpers/color.d.ts +18 -0
  60. package/helpers/index.cjs +53 -0
  61. package/helpers/index.d.ts +2 -0
  62. package/helpers/index.js +53 -0
  63. package/helpers/viewport-clamp.d.ts +9 -0
  64. package/index-ByR0nfaf.cjs +4 -0
  65. package/index-DKz1QXqs.js +4 -0
  66. package/instances/classname-instance.cjs +31 -0
  67. package/instances/classname-instance.d.ts +10 -0
  68. package/instances/classname-instance.js +31 -0
  69. package/package.json +71 -8
  70. package/parse-styles-BTIoYnBr.js +232 -0
  71. package/parse-styles-CA3TP5n1.cjs +231 -0
  72. package/parsers/index.cjs +58 -0
  73. package/parsers/index.d.ts +5 -0
  74. package/parsers/index.js +59 -0
  75. package/parsers/parse-modifiers.d.ts +3 -0
  76. package/parsers/parse-styles.d.ts +13 -0
  77. package/parsers/parse-templates.d.ts +4 -0
  78. package/parsers/parse-tokens.d.ts +3 -0
  79. package/parsers/parser-types.d.ts +8 -0
  80. package/parsers/property-name-check.d.ts +1 -0
  81. package/parsers/unit-check.d.ts +7 -0
  82. package/pascal-case-By_l58S-.cjs +7 -0
  83. package/pascal-case-F3Usi5Wf.js +8 -0
  84. package/{react-styled-file-CGVf5n1B.js → react-styled-file-B99mwk0w.js} +2 -2
  85. package/react-styled-file-U02jek-B.cjs +11 -0
  86. package/react-vanilla-file-Bj6XC8GS.cjs +18 -0
  87. package/{react-vanilla-file-CCXbsjIb.js → react-vanilla-file-D9px70iK.js} +2 -2
  88. package/runtime/index.cjs +11 -0
  89. package/runtime/index.d.ts +7 -0
  90. package/runtime/index.js +11 -0
  91. package/salty.config-DjosWdPw.js +4 -0
  92. package/salty.config-cqavVm2t.cjs +4 -0
  93. package/server/index.cjs +4 -0
  94. package/server/index.d.ts +1 -0
  95. package/server/index.js +4 -0
  96. package/server/should-restart.d.ts +1 -0
  97. package/should-restart-CQsyHls3.cjs +17 -0
  98. package/should-restart-CXIO0jxY.js +18 -0
  99. package/templates/salty-reset.d.ts +2 -0
  100. package/to-hash-C05Y906F.cjs +24 -0
  101. package/to-hash-DAN2LcHK.js +25 -0
  102. package/types/cli-types.d.ts +10 -0
  103. package/types/config-types.d.ts +85 -0
  104. package/types/index.d.ts +44 -23
  105. package/util/dot-case.d.ts +1 -0
  106. package/util/index.cjs +14 -1
  107. package/util/index.js +11 -8
  108. package/viewport-clamp-CEmzmcSj.cjs +10 -0
  109. package/viewport-clamp-K553uXu3.js +11 -0
  110. package/compiler/index.cjs +0 -1
  111. package/compiler/index.d.ts +0 -16
  112. package/compiler/index.js +0 -18
  113. package/config/config-types.d.ts +0 -65
  114. package/dash-case-DKzpenwY.cjs +0 -1
  115. package/dash-case-DMQMcCO6.js +0 -19
  116. package/generator/index.cjs +0 -1
  117. package/generator/index.d.ts +0 -1
  118. package/generator/index.js +0 -65
  119. package/generator/parse-modifiers.d.ts +0 -3
  120. package/generator/parse-styles.d.ts +0 -2
  121. package/generator/parse-templates.d.ts +0 -2
  122. package/generator/parse-tokens.d.ts +0 -2
  123. package/generator/parser-types.d.ts +0 -4
  124. package/generator/style-generator.d.ts +0 -33
  125. package/index-84Wroia-.cjs +0 -1
  126. package/index-BGaLvshf.js +0 -232
  127. package/index-BKoD9apd.cjs +0 -11
  128. package/index-D_732b92.js +0 -4
  129. package/parse-templates-DUUSaubj.js +0 -96
  130. package/parse-templates-DVK3iZIl.cjs +0 -8
  131. package/pascal-case-BQpR5PdN.js +0 -6
  132. package/pascal-case-iWoaJWwT.cjs +0 -1
  133. package/react-styled-file-Dkubsz-U.cjs +0 -8
  134. package/react-vanilla-file-CG_WJLam.cjs +0 -15
  135. package/salty.config-BhBY_oOk.js +0 -10
  136. package/salty.config-Dk6ZcCxI.cjs +0 -7
@@ -1,96 +0,0 @@
1
- import { d as O } from "./dash-case-DMQMcCO6.js";
2
- const W = (s, r) => {
3
- if (typeof s != "string") return { result: s };
4
- if (!r) return { result: s };
5
- const o = [];
6
- return Object.values(r).forEach((i) => {
7
- const { pattern: p, transform: c } = i;
8
- s = s.replace(p, (a) => {
9
- const { value: e, css: m } = c(a);
10
- return m && o.push(m), e;
11
- });
12
- }), { result: s, additionalCss: o };
13
- }, N = (s) => typeof s != "string" ? { result: s } : /\{[^{}]+\}/g.test(s) ? { result: s.replace(/\{([^{}]+)\}/g, (...i) => `var(--${O(i[1].replaceAll(".", "-"))})`) } : { result: s }, d = (s, r, o, i) => {
14
- if (!s) return "";
15
- const p = [], c = Object.entries(s).reduce((e, [m, t]) => {
16
- const n = m.trim();
17
- if (typeof t == "function" && (t = t()), typeof t == "object") {
18
- if (!t) return e;
19
- if (n === "variants")
20
- return Object.entries(t).forEach(([f, u]) => {
21
- u && Object.entries(u).forEach(([b, l]) => {
22
- if (!l) return;
23
- const j = `${r}.${f}-${b}`, y = d(l, j, o);
24
- p.push(y);
25
- });
26
- }), e;
27
- if (n === "defaultVariants")
28
- return e;
29
- if (n === "compoundVariants")
30
- return t.forEach((f) => {
31
- const { css: u, ...b } = f, l = Object.entries(b).reduce((y, [V, w]) => `${y}.${V}-${w}`, r), j = d(u, l, o);
32
- p.push(j);
33
- }), e;
34
- if (n.startsWith("@")) {
35
- const f = d(t, r, o), u = `${n} {
36
- ${f.replace(`
37
- `, `
38
- `)}
39
- }`;
40
- return p.push(u), e;
41
- }
42
- const $ = m.includes("&") ? n.replace("&", r) : n.startsWith(":") ? `${r}${n}` : `${r} ${n}`, h = d(t, $, o);
43
- return p.push(h), e;
44
- }
45
- if (i != null && i.templates && i.templates[n]) {
46
- const h = t.split(".").reduce((f, u) => f[u], i.templates[n]);
47
- if (h) {
48
- const f = d(h, "");
49
- return `${e}${f}`;
50
- }
51
- return console.warn(`Template "${n}" with path of "${t}" was not found in config!`), e;
52
- }
53
- const S = n.startsWith("-") ? n : O(n), g = ($, h = ";") => e = `${e}${$}${h}`, E = ($) => g(`${S}:${$}`);
54
- if (typeof t == "number") return E(t);
55
- if (typeof t != "string")
56
- if ("toString" in t) t = t.toString();
57
- else return e;
58
- const { modifiers: T } = i || {}, k = function* () {
59
- yield N(t), yield W(t, T);
60
- }();
61
- for (const { result: $, additionalCss: h = [] } of k)
62
- t = $, h.forEach((f) => {
63
- const u = d(f, "");
64
- g(u, "");
65
- });
66
- return E(t);
67
- }, "");
68
- if (!c) return p.join(`
69
- `);
70
- if (!r) return c;
71
- let a = "";
72
- return o !== void 0 ? a = `@layer l${o} { ${r} { ${c} } }` : a = `${r} { ${c} }`, [a, ...p].join(`
73
- `);
74
- }, P = (s, r = []) => {
75
- if (!s) return "";
76
- const o = [], i = {};
77
- if (Object.entries(s).forEach(([p, c]) => {
78
- if (typeof c == "object") {
79
- if (!c) return;
80
- const a = p.trim(), e = P(c, [...r, a]);
81
- o.push(e);
82
- } else
83
- i[p] = c;
84
- }), Object.keys(i).length) {
85
- const p = r.map(O).join("-"), c = d(i, `.${p}`);
86
- o.push(c);
87
- }
88
- return o.join(`
89
- `);
90
- }, x = (s) => Object.keys(s);
91
- export {
92
- P as a,
93
- N as b,
94
- x as g,
95
- d as p
96
- };
@@ -1,8 +0,0 @@
1
- "use strict";const T=require("./dash-case-DKzpenwY.cjs"),K=(e,s)=>{if(typeof e!="string")return{result:e};if(!s)return{result:e};const o=[];return Object.values(s).forEach(i=>{const{pattern:p,transform:c}=i;e=e.replace(p,d=>{const{value:r,css:l}=c(d);return l&&o.push(l),r})}),{result:e,additionalCss:o}},g=e=>typeof e!="string"?{result:e}:/\{[^{}]+\}/g.test(e)?{result:e.replace(/\{([^{}]+)\}/g,(...i)=>`var(--${T.dashCase(i[1].replaceAll(".","-"))})`)}:{result:e},a=(e,s,o,i)=>{if(!e)return"";const p=[],c=Object.entries(e).reduce((r,[l,t])=>{const n=l.trim();if(typeof t=="function"&&(t=t()),typeof t=="object"){if(!t)return r;if(n==="variants")return Object.entries(t).forEach(([f,u])=>{u&&Object.entries(u).forEach(([j,m])=>{if(!m)return;const y=`${s}.${f}-${j}`,b=a(m,y,o);p.push(b)})}),r;if(n==="defaultVariants")return r;if(n==="compoundVariants")return t.forEach(f=>{const{css:u,...j}=f,m=Object.entries(j).reduce((b,[W,q])=>`${b}.${W}-${q}`,s),y=a(u,m,o);p.push(y)}),r;if(n.startsWith("@")){const f=a(t,s,o),u=`${n} {
2
- ${f.replace(`
3
- `,`
4
- `)}
5
- }`;return p.push(u),r}const $=l.includes("&")?n.replace("&",s):n.startsWith(":")?`${s}${n}`:`${s} ${n}`,h=a(t,$,o);return p.push(h),r}if(i!=null&&i.templates&&i.templates[n]){const h=t.split(".").reduce((f,u)=>f[u],i.templates[n]);if(h){const f=a(h,"");return`${r}${f}`}return console.warn(`Template "${n}" with path of "${t}" was not found in config!`),r}const E=n.startsWith("-")?n:T.dashCase(n),O=($,h=";")=>r=`${r}${$}${h}`,S=$=>O(`${E}:${$}`);if(typeof t=="number")return S(t);if(typeof t!="string")if("toString"in t)t=t.toString();else return r;const{modifiers:V}=i||{},w=function*(){yield g(t),yield K(t,V)}();for(const{result:$,additionalCss:h=[]}of w)t=$,h.forEach(f=>{const u=a(f,"");O(u,"")});return S(t)},"");if(!c)return p.join(`
6
- `);if(!s)return c;let d="";return o!==void 0?d=`@layer l${o} { ${s} { ${c} } }`:d=`${s} { ${c} }`,[d,...p].join(`
7
- `)},k=(e,s=[])=>{if(!e)return"";const o=[],i={};if(Object.entries(e).forEach(([p,c])=>{if(typeof c=="object"){if(!c)return;const d=p.trim(),r=k(c,[...s,d]);o.push(r)}else i[p]=c}),Object.keys(i).length){const p=s.map(T.dashCase).join("-"),c=a(i,`.${p}`);o.push(c)}return o.join(`
8
- `)},N=e=>Object.keys(e);exports.getTemplateKeys=N;exports.parseStyles=a;exports.parseTemplates=k;exports.parseValueTokens=g;
@@ -1,6 +0,0 @@
1
- function p(e) {
2
- return e ? typeof e != "string" ? p(String(e)) : e.replace(/\s/g, "-").replace(/[-_]([a-z0-9])/g, (a) => a[1].toUpperCase()).replace(/^[a-z]/, (a) => a.toUpperCase()) : "";
3
- }
4
- export {
5
- p
6
- };
@@ -1 +0,0 @@
1
- "use strict";function r(e){return e?typeof e!="string"?r(String(e)):e.replace(/\s/g,"-").replace(/[-_]([a-z0-9])/g,a=>a[1].toUpperCase()).replace(/^[a-z]/,a=>a.toUpperCase()):""}exports.pascalCase=r;
@@ -1,8 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=`import { styled } from "@salty-css/react/styled";
2
-
3
- export const <%- name %> = styled('<%- tag %>', {
4
- <% if(className) { %>className: '<%- className %>',<% } %>
5
- base: {
6
- // Add your styles here
7
- }
8
- })`;exports.default=e;
@@ -1,15 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=`import { <%- styledComponentName %> } from "./<%- fileName %>.css";
2
-
3
- interface <%- componentName %>Props {
4
- text?: string;
5
- }
6
-
7
- export const <%- componentName %> = ({ text = 'Lorem ipsum' }: <%- componentName %>Props) => {
8
- return (
9
- <<%- styledComponentName %>>
10
- {text}
11
- </<%- styledComponentName %>>
12
- );
13
- };
14
-
15
- export default <%- componentName %>;`;exports.default=e;
@@ -1,10 +0,0 @@
1
- const n = `import { defineConfig } from '@salty-css/core/config';
2
-
3
- export const config = defineConfig({
4
- // Add your custom config here
5
- externalModules: ['react', 'react-dom']
6
- });
7
- `;
8
- export {
9
- n as default
10
- };
@@ -1,7 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=`import { defineConfig } from '@salty-css/core/config';
2
-
3
- export const config = defineConfig({
4
- // Add your custom config here
5
- externalModules: ['react', 'react-dom']
6
- });
7
- `;exports.default=e;