@salty-css/react 0.0.1-alpha.20 → 0.0.1-alpha.201
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/README.md +143 -26
- package/class-name.cjs +1 -0
- package/class-name.d.ts +6 -0
- package/class-name.js +18 -0
- package/config.cjs +1 -0
- package/config.d.ts +1 -0
- package/config.js +39 -0
- package/element-factory-C7JVLDq7.js +67 -0
- package/element-factory-D4kpeFoW.cjs +1 -0
- package/element-factory.d.ts +3 -3
- package/helpers.cjs +1 -0
- package/helpers.d.ts +1 -0
- package/helpers.js +1152 -0
- package/index.cjs +1 -0
- package/index.d.ts +1 -0
- package/index.js +10 -0
- package/keyframes.cjs +1 -1
- package/keyframes.d.ts +1 -22
- package/keyframes.js +23 -20
- package/media.cjs +1 -1
- package/media.d.ts +1 -71
- package/media.js +6 -3
- package/package.json +25 -4
- package/parse-styles-hwxJnxKJ.cjs +7 -0
- package/parse-styles-p4rBqcpk.js +118 -0
- package/parse-tokens-YUi047xd.js +8 -0
- package/parse-tokens-p68muVgG.cjs +1 -0
- package/styled-client.cjs +1 -1
- package/styled-client.d.ts +3 -3
- package/styled-client.js +3 -5
- package/styled.cjs +1 -1
- package/styled.d.ts +5 -5
- package/styled.js +36 -59
- package/styles-generator-Bae0y6su.js +35 -0
- package/styles-generator-DAkA4JnC.cjs +1 -0
- package/dash-case-B_odFlTl.cjs +0 -1
- package/dash-case-CGJ_UIZz.js +0 -6
- package/element-factory-WgNOpLmJ.cjs +0 -1
- package/element-factory-uEk4VrqP.js +0 -59
- package/parse-styles-SPT4zc_H.cjs +0 -7
- package/parse-styles-T74HIH4_.js +0 -85
@@ -1,59 +0,0 @@
|
|
1
|
-
import { forwardRef as E, createElement as V } from "react";
|
2
|
-
import { d as C } from "./dash-case-CGJ_UIZz.js";
|
3
|
-
function j(t) {
|
4
|
-
var n, s, e = "";
|
5
|
-
if (typeof t == "string" || typeof t == "number") e += t;
|
6
|
-
else if (typeof t == "object") if (Array.isArray(t)) {
|
7
|
-
var d = t.length;
|
8
|
-
for (n = 0; n < d; n++) t[n] && (s = j(t[n])) && (e && (e += " "), e += s);
|
9
|
-
} else for (s in t) t[s] && (e && (e += " "), e += s);
|
10
|
-
return e;
|
11
|
-
}
|
12
|
-
function O() {
|
13
|
-
for (var t, n, s = 0, e = "", d = arguments.length; s < d; s++) (t = arguments[s]) && (n = j(t)) && (e && (e += " "), e += n);
|
14
|
-
return e;
|
15
|
-
}
|
16
|
-
const N = ["passVariantProps"], q = (t, n, s, e) => {
|
17
|
-
const h = E(({
|
18
|
-
extend: r = t,
|
19
|
-
element: b = s.element,
|
20
|
-
className: K = "",
|
21
|
-
children: $,
|
22
|
-
passVariantProps: p,
|
23
|
-
_vks: f = /* @__PURE__ */ new Set(),
|
24
|
-
...c
|
25
|
-
}, g) => {
|
26
|
-
const i = { passVariantProps: p };
|
27
|
-
e && Object.assign(i, e), c && Object.assign(i, c);
|
28
|
-
const u = new Set(K.split(" ")), y = typeof r == "function" || typeof r == "object", m = y && "isStyled" in r, S = y ? r : b || r;
|
29
|
-
if (!S) throw new Error("No element provided");
|
30
|
-
s.propValueKeys && (i.style || (i.style = {}), s.propValueKeys.forEach((o) => {
|
31
|
-
const a = `css-${o}`, l = c[a];
|
32
|
-
if (l === void 0) return;
|
33
|
-
const w = `--props-${C(o)}`;
|
34
|
-
i.style[w] = l, f && f.add(a);
|
35
|
-
})), s.variantKeys && s.variantKeys.forEach((o) => {
|
36
|
-
const [a, l] = o.split("=");
|
37
|
-
c[a] !== void 0 ? (u.add(`${a}-${c[a]}`), f && f.add(a)) : l !== void 0 && u.add(`${a}-${l}`);
|
38
|
-
}), f && (!y || !m && !p) ? f.forEach((o) => delete i[o]) : m && Object.assign(i, { _vks: f }), m || N.forEach((o) => delete i[o]);
|
39
|
-
const v = O(n, ...u);
|
40
|
-
return V(
|
41
|
-
S,
|
42
|
-
{
|
43
|
-
element: y ? b : void 0,
|
44
|
-
className: v,
|
45
|
-
ref: g,
|
46
|
-
...i
|
47
|
-
},
|
48
|
-
$
|
49
|
-
);
|
50
|
-
});
|
51
|
-
return Object.assign(h, {
|
52
|
-
isStyled: !0,
|
53
|
-
className: n,
|
54
|
-
toString: () => `.${n}`
|
55
|
-
}), h;
|
56
|
-
};
|
57
|
-
export {
|
58
|
-
q as e
|
59
|
-
};
|
@@ -1,7 +0,0 @@
|
|
1
|
-
"use strict";const V=require("./dash-case-B_odFlTl.cjs"),E=r=>String.fromCharCode(r+(r>25?39:97)),P=(r,s)=>{let t="",n;for(n=Math.abs(r);n>52;n=n/52|0)t=E(n%52)+t;return t=E(n%52)+t,t.length<s?t=t.padStart(s,"a"):t.length>s&&(t=t.slice(-s)),t},T=(r,s)=>{let t=s.length;for(;t;)r=r*33^s.charCodeAt(--t);return r},W=(r,s=3)=>{const t=T(5381,JSON.stringify(r))>>>0;return P(t,s)},q=(r,s)=>{if(typeof r!="string")return{result:r};if(!s)return{result:r};const t=[];return Object.values(s).forEach(n=>{const{pattern:p,transform:$}=n;r=r.replace(p,d=>{const{value:i,css:l}=$(d);return l&&t.push(l),i})}),{result:r,additionalCss:t}},M=r=>typeof r!="string"?{result:r}:/\{[^{}]+\}/g.test(r)?{result:r.replace(/\{([^{}]+)\}/g,(...n)=>`var(--${V.dashCase(n[1].replaceAll(".","-"))})`)}:{result:r},a=(r,s,t,n)=>{if(!r)return"";const p=[],$=Object.entries(r).reduce((i,[l,e])=>{const o=l.trim();if(typeof e=="function"&&(e=e()),typeof e=="object"){if(!e)return i;if(o==="variants")return Object.entries(e).forEach(([f,c])=>{c&&Object.entries(c).forEach(([m,b])=>{if(!b)return;const S=`${s}.${f}-${m}`,j=a(b,S,t);p.push(j)})}),i;if(o==="defaultVariants")return i;if(o==="compoundVariants")return e.forEach(f=>{const{css:c,...m}=f,b=Object.entries(m).reduce((j,[H,N])=>`${j}.${H}-${N}`,s),S=a(c,b,t);p.push(S)}),i;if(o.startsWith("@")){const f=a(e,s,t),c=`${o} {
|
2
|
-
${f.replace(`
|
3
|
-
`,`
|
4
|
-
`)}
|
5
|
-
}`;return p.push(c),i}const u=l.includes("&")?o.replace("&",s):o.startsWith(":")?`${s}${o}`:`${s} ${o}`,h=a(e,u,t);return p.push(h),i}if(n!=null&&n.templates&&n.templates[o]){const h=e.split(".").reduce((c,m)=>c[m],n.templates[o]),f=a(h,"");return`${i}${f}`}const g=o.startsWith("-")?o:V.dashCase(o),y=(u,h=";")=>i=`${i}${u}${h}`,O=u=>y(`${g}:${u}`);if(typeof e=="number")return O(e);if(typeof e!="string")if("toString"in e)e=e.toString();else return i;const{modifiers:A}=n||{},k=function*(){yield M(e),yield q(e,A)}();for(const{result:u,additionalCss:h=[]}of k)e=u,h.forEach(f=>{const c=a(f,"");y(c,"")});return O(e)},"");if(!$)return p.join(`
|
6
|
-
`);if(!s)return $;let d="";return t!==void 0?d=`@layer l${t} { ${s} { ${$} } }`:d=`${s} { ${$} }`,[d,...p].join(`
|
7
|
-
`)};exports.parseStyles=a;exports.toHash=W;
|
package/parse-styles-T74HIH4_.js
DELETED
@@ -1,85 +0,0 @@
|
|
1
|
-
import { d as V } from "./dash-case-CGJ_UIZz.js";
|
2
|
-
const E = (r) => String.fromCharCode(r + (r > 25 ? 39 : 97)), T = (r, s) => {
|
3
|
-
let t = "", n;
|
4
|
-
for (n = Math.abs(r); n > 52; n = n / 52 | 0) t = E(n % 52) + t;
|
5
|
-
return t = E(n % 52) + t, t.length < s ? t = t.padStart(s, "a") : t.length > s && (t = t.slice(-s)), t;
|
6
|
-
}, W = (r, s) => {
|
7
|
-
let t = s.length;
|
8
|
-
for (; t; ) r = r * 33 ^ s.charCodeAt(--t);
|
9
|
-
return r;
|
10
|
-
}, x = (r, s = 3) => {
|
11
|
-
const t = W(5381, JSON.stringify(r)) >>> 0;
|
12
|
-
return T(t, s);
|
13
|
-
}, H = (r, s) => {
|
14
|
-
if (typeof r != "string") return { result: r };
|
15
|
-
if (!s) return { result: r };
|
16
|
-
const t = [];
|
17
|
-
return Object.values(s).forEach((n) => {
|
18
|
-
const { pattern: c, transform: a } = n;
|
19
|
-
r = r.replace(c, (d) => {
|
20
|
-
const { value: i, css: m } = a(d);
|
21
|
-
return m && t.push(m), i;
|
22
|
-
});
|
23
|
-
}), { result: r, additionalCss: t };
|
24
|
-
}, M = (r) => typeof r != "string" ? { result: r } : /\{[^{}]+\}/g.test(r) ? { result: r.replace(/\{([^{}]+)\}/g, (...n) => `var(--${V(n[1].replaceAll(".", "-"))})`) } : { result: r }, $ = (r, s, t, n) => {
|
25
|
-
if (!r) return "";
|
26
|
-
const c = [], a = Object.entries(r).reduce((i, [m, e]) => {
|
27
|
-
const o = m.trim();
|
28
|
-
if (typeof e == "function" && (e = e()), typeof e == "object") {
|
29
|
-
if (!e) return i;
|
30
|
-
if (o === "variants")
|
31
|
-
return Object.entries(e).forEach(([f, p]) => {
|
32
|
-
p && Object.entries(p).forEach(([l, b]) => {
|
33
|
-
if (!b) return;
|
34
|
-
const j = `${s}.${f}-${l}`, S = $(b, j, t);
|
35
|
-
c.push(S);
|
36
|
-
});
|
37
|
-
}), i;
|
38
|
-
if (o === "defaultVariants")
|
39
|
-
return i;
|
40
|
-
if (o === "compoundVariants")
|
41
|
-
return e.forEach((f) => {
|
42
|
-
const { css: p, ...l } = f, b = Object.entries(l).reduce((S, [N, P]) => `${S}.${N}-${P}`, s), j = $(p, b, t);
|
43
|
-
c.push(j);
|
44
|
-
}), i;
|
45
|
-
if (o.startsWith("@")) {
|
46
|
-
const f = $(e, s, t), p = `${o} {
|
47
|
-
${f.replace(`
|
48
|
-
`, `
|
49
|
-
`)}
|
50
|
-
}`;
|
51
|
-
return c.push(p), i;
|
52
|
-
}
|
53
|
-
const u = m.includes("&") ? o.replace("&", s) : o.startsWith(":") ? `${s}${o}` : `${s} ${o}`, h = $(e, u, t);
|
54
|
-
return c.push(h), i;
|
55
|
-
}
|
56
|
-
if (n != null && n.templates && n.templates[o]) {
|
57
|
-
const h = e.split(".").reduce((p, l) => p[l], n.templates[o]), f = $(h, "");
|
58
|
-
return `${i}${f}`;
|
59
|
-
}
|
60
|
-
const g = o.startsWith("-") ? o : V(o), y = (u, h = ";") => i = `${i}${u}${h}`, O = (u) => y(`${g}:${u}`);
|
61
|
-
if (typeof e == "number") return O(e);
|
62
|
-
if (typeof e != "string")
|
63
|
-
if ("toString" in e) e = e.toString();
|
64
|
-
else return i;
|
65
|
-
const { modifiers: A } = n || {}, k = function* () {
|
66
|
-
yield M(e), yield H(e, A);
|
67
|
-
}();
|
68
|
-
for (const { result: u, additionalCss: h = [] } of k)
|
69
|
-
e = u, h.forEach((f) => {
|
70
|
-
const p = $(f, "");
|
71
|
-
y(p, "");
|
72
|
-
});
|
73
|
-
return O(e);
|
74
|
-
}, "");
|
75
|
-
if (!a) return c.join(`
|
76
|
-
`);
|
77
|
-
if (!s) return a;
|
78
|
-
let d = "";
|
79
|
-
return t !== void 0 ? d = `@layer l${t} { ${s} { ${a} } }` : d = `${s} { ${a} }`, [d, ...c].join(`
|
80
|
-
`);
|
81
|
-
};
|
82
|
-
export {
|
83
|
-
$ as p,
|
84
|
-
x as t
|
85
|
-
};
|