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