@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.
- package/.saltyrc.schema.json +11 -3
- package/README.md +415 -47
- package/bin/index.cjs +3 -1
- package/bin/index.js +2 -2
- package/bin/main.cjs +448 -11
- package/bin/main.js +411 -209
- package/cache/resolve-dynamic-config-cache.cjs +24 -0
- package/cache/resolve-dynamic-config-cache.d.ts +1 -0
- package/cache/resolve-dynamic-config-cache.js +24 -0
- package/class-name-generator-B2Pb2obX.cjs +74 -0
- package/class-name-generator-YeSQe_Ik.js +75 -0
- package/compiler/as-class.cjs +753 -0
- package/compiler/as-class.d.ts +52 -0
- package/compiler/as-class.js +735 -0
- package/compiler/get-files.cjs +25 -0
- package/compiler/get-files.js +25 -0
- package/compiler/get-function-range.cjs +22 -0
- package/compiler/get-function-range.d.ts +1 -0
- package/compiler/get-function-range.js +22 -0
- package/compiler/helpers.cjs +25 -0
- package/compiler/helpers.d.ts +5 -0
- package/compiler/helpers.js +24 -0
- package/config/define-config.d.ts +1 -1
- package/config/index.cjs +16 -1
- package/config/index.d.ts +2 -1
- package/config/index.js +14 -2
- package/css/index.cjs +12 -1
- package/css/index.d.ts +4 -1
- package/css/index.js +10 -2
- package/css/keyframes.cjs +49 -0
- package/css/keyframes.d.ts +22 -0
- package/css/keyframes.js +49 -0
- package/css/media.cjs +93 -0
- package/css/media.d.ts +87 -0
- package/css/media.js +93 -0
- package/css/merge.cjs +15 -0
- package/css/merge.d.ts +7 -0
- package/css/merge.js +15 -0
- package/css/token.cjs +4 -0
- package/css/token.d.ts +1 -0
- package/css/token.js +4 -0
- package/dash-case-DIwKaYgE.cjs +9 -0
- package/dash-case-DblXvymC.js +10 -0
- package/define-templates-CVhhgPnd.js +60 -0
- package/define-templates-Deq1aCbN.cjs +59 -0
- package/factories/define-global-styles.d.ts +7 -0
- package/factories/define-media-query.d.ts +8 -0
- package/factories/define-templates.d.ts +27 -0
- package/factories/define-variables.d.ts +12 -0
- package/factories/index.cjs +37 -0
- package/factories/index.d.ts +4 -0
- package/factories/index.js +37 -0
- package/generators/class-name-generator.d.ts +7 -0
- package/generators/index.cjs +57 -0
- package/generators/index.d.ts +2 -0
- package/generators/index.js +58 -0
- package/generators/styled-generator.d.ts +20 -0
- package/generators/styles-generator.d.ts +22 -0
- package/helpers/color.d.ts +18 -0
- package/helpers/index.cjs +53 -0
- package/helpers/index.d.ts +2 -0
- package/helpers/index.js +53 -0
- package/helpers/viewport-clamp.d.ts +9 -0
- package/index-ByR0nfaf.cjs +4 -0
- package/index-DKz1QXqs.js +4 -0
- package/instances/classname-instance.cjs +31 -0
- package/instances/classname-instance.d.ts +10 -0
- package/instances/classname-instance.js +31 -0
- package/package.json +71 -8
- package/parse-styles-BTIoYnBr.js +232 -0
- package/parse-styles-CA3TP5n1.cjs +231 -0
- package/parsers/index.cjs +58 -0
- package/parsers/index.d.ts +5 -0
- package/parsers/index.js +59 -0
- package/parsers/parse-modifiers.d.ts +3 -0
- package/parsers/parse-styles.d.ts +13 -0
- package/parsers/parse-templates.d.ts +4 -0
- package/parsers/parse-tokens.d.ts +3 -0
- package/parsers/parser-types.d.ts +8 -0
- package/parsers/property-name-check.d.ts +1 -0
- package/parsers/unit-check.d.ts +7 -0
- package/pascal-case-By_l58S-.cjs +7 -0
- package/pascal-case-F3Usi5Wf.js +8 -0
- package/{react-styled-file-CGVf5n1B.js → react-styled-file-B99mwk0w.js} +2 -2
- package/react-styled-file-U02jek-B.cjs +11 -0
- package/react-vanilla-file-Bj6XC8GS.cjs +18 -0
- package/{react-vanilla-file-CCXbsjIb.js → react-vanilla-file-D9px70iK.js} +2 -2
- package/runtime/index.cjs +11 -0
- package/runtime/index.d.ts +7 -0
- package/runtime/index.js +11 -0
- package/salty.config-DjosWdPw.js +4 -0
- package/salty.config-cqavVm2t.cjs +4 -0
- package/server/index.cjs +4 -0
- package/server/index.d.ts +1 -0
- package/server/index.js +4 -0
- package/server/should-restart.d.ts +1 -0
- package/should-restart-CQsyHls3.cjs +17 -0
- package/should-restart-CXIO0jxY.js +18 -0
- package/templates/salty-reset.d.ts +2 -0
- package/to-hash-C05Y906F.cjs +24 -0
- package/to-hash-DAN2LcHK.js +25 -0
- package/types/cli-types.d.ts +10 -0
- package/types/config-types.d.ts +85 -0
- package/types/index.d.ts +44 -23
- package/util/dot-case.d.ts +1 -0
- package/util/index.cjs +14 -1
- package/util/index.js +11 -8
- package/viewport-clamp-CEmzmcSj.cjs +10 -0
- package/viewport-clamp-K553uXu3.js +11 -0
- package/compiler/index.cjs +0 -1
- package/compiler/index.d.ts +0 -16
- package/compiler/index.js +0 -18
- package/config/config-types.d.ts +0 -65
- package/dash-case-DKzpenwY.cjs +0 -1
- package/dash-case-DMQMcCO6.js +0 -19
- package/generator/index.cjs +0 -1
- package/generator/index.d.ts +0 -1
- package/generator/index.js +0 -65
- package/generator/parse-modifiers.d.ts +0 -3
- package/generator/parse-styles.d.ts +0 -2
- package/generator/parse-templates.d.ts +0 -2
- package/generator/parse-tokens.d.ts +0 -2
- package/generator/parser-types.d.ts +0 -4
- package/generator/style-generator.d.ts +0 -33
- package/index-84Wroia-.cjs +0 -1
- package/index-BGaLvshf.js +0 -232
- package/index-BKoD9apd.cjs +0 -11
- package/index-D_732b92.js +0 -4
- package/parse-templates-DUUSaubj.js +0 -96
- package/parse-templates-DVK3iZIl.cjs +0 -8
- package/pascal-case-BQpR5PdN.js +0 -6
- package/pascal-case-iWoaJWwT.cjs +0 -1
- package/react-styled-file-Dkubsz-U.cjs +0 -8
- package/react-vanilla-file-CG_WJLam.cjs +0 -15
- package/salty.config-BhBY_oOk.js +0 -10
- 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;
|
package/pascal-case-BQpR5PdN.js
DELETED
package/pascal-case-iWoaJWwT.cjs
DELETED
|
@@ -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;
|
package/salty.config-BhBY_oOk.js
DELETED
|
@@ -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;
|