@salty-css/react 0.0.1-alpha.97 → 0.0.1-alpha.99
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/element-factory-D1ozgqO7.cjs +1 -0
- package/element-factory-Dupolv6C.js +67 -0
- package/keyframes.cjs +1 -1
- package/keyframes.js +1 -1
- package/package.json +2 -2
- package/parse-styles-CVYekczt.js +89 -0
- package/parse-styles-DjwCLt3X.cjs +7 -0
- package/parse-tokens-CRGUYhKC.cjs +1 -0
- package/parse-tokens-DAW55Na6.js +8 -0
- package/styled-client.cjs +1 -1
- package/styled-client.js +1 -1
- package/styled.cjs +1 -1
- package/styled.js +2 -2
- package/dash-case-B_odFlTl.cjs +0 -1
- package/dash-case-CGJ_UIZz.js +0 -6
- package/element-factory-JxDKzaxU.cjs +0 -1
- package/element-factory-U2CFtpB_.js +0 -59
- package/parse-styles-DLe1Dr-N.js +0 -89
- package/parse-styles-DbNZJMT5.cjs +0 -7
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";const K=require("react"),$=require("./parse-tokens-CRGUYhKC.cjs");function w(n){var s,e,t="";if(typeof n=="string"||typeof n=="number")t+=n;else if(typeof n=="object")if(Array.isArray(n)){var o=n.length;for(s=0;s<o;s++)n[s]&&(e=w(n[s]))&&(t&&(t+=" "),t+=e)}else for(e in n)n[e]&&(t&&(t+=" "),t+=e);return t}function N(){for(var n,s,e=0,t="",o=arguments.length;e<o;e++)(n=arguments[e])&&(s=w(n))&&(t&&(t+=" "),t+=s);return t}const q=["passVariantProps"],A=(n,s,e,t)=>{const o=({extend:l=n,element:S=e.element,className:O="",children:g,passVariantProps:d,_vks:f=new Set,...u},v)=>{const r={passVariantProps:d};e.attr&&Object.assign(r,e.attr),t&&Object.assign(r,t),u&&Object.assign(r,u);const b=new Set(O.split(" ")),y=typeof l=="function"||typeof l=="object",h=y&&"isStyled"in l,E=y?l:S||l;if(!E)throw new Error("No element provided");const m=r.style||{};r.style||(r.style=m),Object.entries(m).forEach(([i,c])=>{const{result:a}=$.parseValueTokens(c);m[i]=a}),e.propValueKeys&&e.propValueKeys.forEach(i=>{const c=`css-${i}`,a=u[c];if(a===void 0)return;const V=`--props-${$.dashCase(i)}`;m[V]=a,f&&f.add(c)}),e.variantKeys&&e.variantKeys.forEach(i=>{const[c,a]=i.split("=");u[c]!==void 0?(b.add(`${c}-${u[c]}`),f&&f.add(c)):a!==void 0&&b.add(`${c}-${a}`)}),f&&(!y||!h)?f.forEach(i=>{if(!d)return delete r[i];if(d!==!0&&!d.includes(i))return delete r[i]}):h&&Object.assign(r,{_vks:f}),h||q.forEach(i=>delete r[i]);const C=N(s,...b);return K.createElement(E,{element:y?S:void 0,className:C,ref:v,...r},g)},j=K.forwardRef(o);return Object.assign(j,{isStyled:!0,className:s,toString:()=>`.${s}`}),j};exports.elementFactory=A;
|
@@ -0,0 +1,67 @@
|
|
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
|
+
};
|
package/keyframes.cjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./parse-styles-
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./parse-styles-DjwCLt3X.cjs"),j=({animationName:m,params:l,appendInitialStyles:f,...t})=>{const r=m||u.toHash(t),o=(n={})=>{const{duration:e="500ms",easing:s="ease-in-out",delay:a="0s",iterationCount:i="1",direction:d="normal",fillMode:g="forwards",playState:p="running"}={...l,...n},c=`${r} ${e} ${s} ${a} ${i} ${d} ${g} ${p}`;if(!f)return c;const $=t.from||t["0%"];if(!$)return c;const b=u.parseStyles($,"");return`${c};${b}`},y=Object.entries(t).reduce((n,[e,s])=>{if(!s)return n;const a=u.parseStyles(s,""),i=typeof e=="number"?`${e}%`:e;return`${n}${i}{${a}}`},""),S=`@keyframes ${r} {${y}}`;return Object.assign(o,{toString:o,isKeyframes:!0,animationName:r,css:S,keyframes:t}),o};exports.keyframes=j;
|
package/keyframes.js
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@salty-css/react",
|
3
|
-
"version": "0.0.1-alpha.
|
3
|
+
"version": "0.0.1-alpha.99",
|
4
4
|
"main": "./dist/index.js",
|
5
5
|
"module": "./dist/index.mjs",
|
6
6
|
"typings": "./dist/index.d.ts",
|
@@ -46,7 +46,7 @@
|
|
46
46
|
}
|
47
47
|
},
|
48
48
|
"dependencies": {
|
49
|
-
"@salty-css/core": "^0.0.1-alpha.
|
49
|
+
"@salty-css/core": "^0.0.1-alpha.99",
|
50
50
|
"clsx": ">=2.x",
|
51
51
|
"react": ">=19.x || >=18.3.x"
|
52
52
|
}
|
@@ -0,0 +1,89 @@
|
|
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
|
+
};
|
@@ -0,0 +1,7 @@
|
|
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;
|
@@ -0,0 +1 @@
|
|
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;
|
@@ -0,0 +1,8 @@
|
|
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
|
+
};
|
package/styled-client.cjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./element-factory-
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./element-factory-D1ozgqO7.cjs"),n=(e,t,r)=>l.elementFactory(e,t,r);exports.styledClient=n;
|
package/styled-client.js
CHANGED
package/styled.cjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";var m=Object.defineProperty;var l=(e,t,s)=>t in e?m(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var o=(e,t,s)=>l(e,typeof t!="symbol"?t+"":t,s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("./parse-styles-
|
1
|
+
"use strict";var m=Object.defineProperty;var l=(e,t,s)=>t in e?m(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var o=(e,t,s)=>l(e,typeof t!="symbol"?t+"":t,s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("./parse-styles-DjwCLt3X.cjs"),u=require("./element-factory-D1ozgqO7.cjs"),y=e=>Object.keys(e);class g{constructor(t,s){o(this,"_isProd");o(this,"_callerName");o(this,"_context");this.tagName=t,this.params=s}get hash(){return h.toHash(this.params.base||this.params)}get priority(){var t;return typeof this.tagName=="function"||typeof this.tagName=="object"?(((t=this.tagName.generator)==null?void 0:t.priority)||0)+1:0}get classNames(){const t=[this.hash],{className:s}=this.params;return s&&t.push(s),t.join(" ")}get cssClassName(){return this.hash}get cssDisplayNameVar(){return`--${this.hash}-display-name: ${this._callerName};`}get templateKeys(){var t;return(t=this._context)!=null&&t.config.templates?y(this._context.config.templates):[]}get css(){var r;const{base:t={},variants:s={},compoundVariants:a=[]}=this.params,i={...t,variants:s,compoundVariants:a};return h.parseStyles(i,`.${this.cssClassName}`,this.priority,(r=this._context)==null?void 0:r.config)}get props(){const{element:t}=this.params,s=this.params.variants?Object.keys(this.params.variants).map(r=>{var n;const c=(n=this.params.defaultVariants)==null?void 0:n[r];return c!==void 0?`${r}=${String(c)}`:r}):void 0,a=new Set([]),i=/\{props\.([\w\d]+)\}/gi.exec(JSON.stringify(this.params.base));return i&&i.forEach((r,c,n)=>{const p=n.at(1);p&&a.add(p)}),{element:t,variantKeys:s,propValueKeys:[...a],attr:{"data-component-name":this._isProd?void 0:this._callerName}}}_withBuildContext(t){this._context=t;const{name:s,config:a,prod:i}=t;return this._isProd=i,this._callerName=s,this}}const d=(e,t)=>{const s=new g(e,t),a=u.elementFactory(e,s.cssClassName,s.props,{"data-unoptimized-client-component":!0});return Object.assign(a,{generator:s}),a};exports.styled=d;
|
package/styled.js
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
var m = Object.defineProperty;
|
2
2
|
var h = (e, t, s) => t in e ? m(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
|
3
3
|
var o = (e, t, s) => h(e, typeof t != "symbol" ? t + "" : t, s);
|
4
|
-
import { t as l, p as u } from "./parse-styles-
|
5
|
-
import { e as g } from "./element-factory-
|
4
|
+
import { t as l, p as u } from "./parse-styles-CVYekczt.js";
|
5
|
+
import { e as g } from "./element-factory-Dupolv6C.js";
|
6
6
|
const y = (e) => Object.keys(e);
|
7
7
|
class d {
|
8
8
|
constructor(t, s) {
|
package/dash-case-B_odFlTl.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-Z](?:(?=[^A-Z])|[A-Z]*(?=[A-Z][^A-Z]|$))/g,(n,t)=>(t>0?"-":"")+n.toLowerCase()):""}exports.dashCase=r;
|
package/dash-case-CGJ_UIZz.js
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";const K=require("react"),O=require("./dash-case-B_odFlTl.cjs");function $(s){var i,e,t="";if(typeof s=="string"||typeof s=="number")t+=s;else if(typeof s=="object")if(Array.isArray(s)){var o=s.length;for(i=0;i<o;i++)s[i]&&(e=$(s[i]))&&(t&&(t+=" "),t+=e)}else for(e in s)s[e]&&(t&&(t+=" "),t+=e);return t}function V(){for(var s,i,e=0,t="",o=arguments.length;e<o;e++)(s=arguments[e])&&(i=$(s))&&(t&&(t+=" "),t+=i);return t}const p=["passVariantProps"],N=(s,i,e,t)=>{const o=({extend:r=s,element:b=e.element,className:v="",children:w,passVariantProps:j,_vks:f=new Set,...l},E)=>{const n={passVariantProps:j};e.attr&&Object.assign(n,e.attr),t&&Object.assign(n,t),l&&Object.assign(n,l);const u=new Set(v.split(" ")),y=typeof r=="function"||typeof r=="object",m=y&&"isStyled"in r,S=y?r:b||r;if(!S)throw new Error("No element provided");e.propValueKeys&&(n.style||(n.style={}),e.propValueKeys.forEach(a=>{const c=`css-${a}`,d=l[c];if(d===void 0)return;const C=`--props-${O.dashCase(a)}`;n.style[C]=d,f&&f.add(c)})),e.variantKeys&&e.variantKeys.forEach(a=>{const[c,d]=a.split("=");l[c]!==void 0?(u.add(`${c}-${l[c]}`),f&&f.add(c)):d!==void 0&&u.add(`${c}-${d}`)}),f&&(!y||!m&&!j)?f.forEach(a=>delete n[a]):m&&Object.assign(n,{_vks:f}),m||p.forEach(a=>delete n[a]);const g=V(i,...u);return K.createElement(S,{element:y?b:void 0,className:g,ref:E,...n},w)},h=K.forwardRef(o);return Object.assign(h,{isStyled:!0,className:i,toString:()=>`.${i}`}),h};exports.elementFactory=N;
|
@@ -1,59 +0,0 @@
|
|
1
|
-
import { forwardRef as g, createElement as O } from "react";
|
2
|
-
import { d as V } from "./dash-case-CGJ_UIZz.js";
|
3
|
-
function K(s) {
|
4
|
-
var i, t, e = "";
|
5
|
-
if (typeof s == "string" || typeof s == "number") e += s;
|
6
|
-
else if (typeof s == "object") if (Array.isArray(s)) {
|
7
|
-
var d = s.length;
|
8
|
-
for (i = 0; i < d; i++) s[i] && (t = K(s[i])) && (e && (e += " "), e += t);
|
9
|
-
} else for (t in s) s[t] && (e && (e += " "), e += t);
|
10
|
-
return e;
|
11
|
-
}
|
12
|
-
function C() {
|
13
|
-
for (var s, i, t = 0, e = "", d = arguments.length; t < d; t++) (s = arguments[t]) && (i = K(s)) && (e && (e += " "), e += i);
|
14
|
-
return e;
|
15
|
-
}
|
16
|
-
const N = ["passVariantProps"], q = (s, i, t, e) => {
|
17
|
-
const b = g(({
|
18
|
-
extend: c = s,
|
19
|
-
element: h = t.element,
|
20
|
-
className: $ = "",
|
21
|
-
children: p,
|
22
|
-
passVariantProps: j,
|
23
|
-
_vks: o = /* @__PURE__ */ new Set(),
|
24
|
-
...l
|
25
|
-
}, v) => {
|
26
|
-
const n = { passVariantProps: j };
|
27
|
-
t.attr && Object.assign(n, t.attr), e && Object.assign(n, e), l && Object.assign(n, l);
|
28
|
-
const u = new Set($.split(" ")), y = typeof c == "function" || typeof c == "object", m = y && "isStyled" in c, S = y ? c : h || c;
|
29
|
-
if (!S) throw new Error("No element provided");
|
30
|
-
t.propValueKeys && (n.style || (n.style = {}), t.propValueKeys.forEach((a) => {
|
31
|
-
const f = `css-${a}`, r = l[f];
|
32
|
-
if (r === void 0) return;
|
33
|
-
const E = `--props-${V(a)}`;
|
34
|
-
n.style[E] = r, o && o.add(f);
|
35
|
-
})), t.variantKeys && t.variantKeys.forEach((a) => {
|
36
|
-
const [f, r] = a.split("=");
|
37
|
-
l[f] !== void 0 ? (u.add(`${f}-${l[f]}`), o && o.add(f)) : r !== void 0 && u.add(`${f}-${r}`);
|
38
|
-
}), o && (!y || !m && !j) ? o.forEach((a) => delete n[a]) : m && Object.assign(n, { _vks: o }), m || N.forEach((a) => delete n[a]);
|
39
|
-
const w = C(i, ...u);
|
40
|
-
return O(
|
41
|
-
S,
|
42
|
-
{
|
43
|
-
element: y ? h : void 0,
|
44
|
-
className: w,
|
45
|
-
ref: v,
|
46
|
-
...n
|
47
|
-
},
|
48
|
-
p
|
49
|
-
);
|
50
|
-
});
|
51
|
-
return Object.assign(b, {
|
52
|
-
isStyled: !0,
|
53
|
-
className: i,
|
54
|
-
toString: () => `.${i}`
|
55
|
-
}), b;
|
56
|
-
};
|
57
|
-
export {
|
58
|
-
q as e
|
59
|
-
};
|
package/parse-styles-DLe1Dr-N.js
DELETED
@@ -1,89 +0,0 @@
|
|
1
|
-
import { d as E } from "./dash-case-CGJ_UIZz.js";
|
2
|
-
const g = (r) => String.fromCharCode(r + (r > 25 ? 39 : 97)), N = (r, s) => {
|
3
|
-
let t = "", n;
|
4
|
-
for (n = Math.abs(r); n > 52; n = n / 52 | 0) t = g(n % 52) + t;
|
5
|
-
return t = g(n % 52) + t, t.length < s ? t = t.padStart(s, "a") : t.length > s && (t = t.slice(-s)), t;
|
6
|
-
}, P = (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 = P(5381, JSON.stringify(r)) >>> 0;
|
12
|
-
return N(t, s);
|
13
|
-
}, W = (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
|
-
}, H = (r) => typeof r != "string" ? { result: r } : /\{[^{}]+\}/g.test(r) ? { result: r.replace(/\{([^{}]+)\}/g, (...n) => `var(--${E(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(([p, f]) => {
|
32
|
-
f && Object.entries(f).forEach(([b, l]) => {
|
33
|
-
if (!l) return;
|
34
|
-
const j = `${s}.${p}-${b}`, S = $(l, j, t);
|
35
|
-
c.push(S);
|
36
|
-
});
|
37
|
-
}), i;
|
38
|
-
if (o === "defaultVariants")
|
39
|
-
return i;
|
40
|
-
if (o === "compoundVariants")
|
41
|
-
return e.forEach((p) => {
|
42
|
-
const { css: f, ...b } = p, l = Object.entries(b).reduce((S, [T, k]) => `${S}.${T}-${k}`, s), j = $(f, l, t);
|
43
|
-
c.push(j);
|
44
|
-
}), i;
|
45
|
-
if (o.startsWith("@")) {
|
46
|
-
const p = $(e, s, t), f = `${o} {
|
47
|
-
${p.replace(`
|
48
|
-
`, `
|
49
|
-
`)}
|
50
|
-
}`;
|
51
|
-
return c.push(f), 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, f) => p[f], n.templates[o]);
|
58
|
-
if (h) {
|
59
|
-
const p = $(h, "");
|
60
|
-
return `${i}${p}`;
|
61
|
-
}
|
62
|
-
return console.warn(`Template "${o}" with path of "${e}" was not found in config!`), i;
|
63
|
-
}
|
64
|
-
const V = o.startsWith("-") ? o : E(o), y = (u, h = ";") => i = `${i}${u}${h}`, O = (u) => y(`${V}:${u}`);
|
65
|
-
if (typeof e == "number") return O(e);
|
66
|
-
if (typeof e != "string")
|
67
|
-
if ("toString" in e) e = e.toString();
|
68
|
-
else return i;
|
69
|
-
const { modifiers: w } = n || {}, A = function* () {
|
70
|
-
yield H(e), yield W(e, w);
|
71
|
-
}();
|
72
|
-
for (const { result: u, additionalCss: h = [] } of A)
|
73
|
-
e = u, h.forEach((p) => {
|
74
|
-
const f = $(p, "");
|
75
|
-
y(f, "");
|
76
|
-
});
|
77
|
-
return O(e);
|
78
|
-
}, "");
|
79
|
-
if (!a) return c.join(`
|
80
|
-
`);
|
81
|
-
if (!s) return a;
|
82
|
-
let d = "";
|
83
|
-
return t !== void 0 ? d = `@layer l${t} { ${s} { ${a} } }` : d = `${s} { ${a} }`, [d, ...c].join(`
|
84
|
-
`);
|
85
|
-
};
|
86
|
-
export {
|
87
|
-
$ as p,
|
88
|
-
x as t
|
89
|
-
};
|
@@ -1,7 +0,0 @@
|
|
1
|
-
"use strict";const E=require("./dash-case-B_odFlTl.cjs"),g=r=>String.fromCharCode(r+(r>25?39:97)),H=(r,s)=>{let t="",n;for(n=Math.abs(r);n>52;n=n/52|0)t=g(n%52)+t;return t=g(n%52)+t,t.length<s?t=t.padStart(s,"a"):t.length>s&&(t=t.slice(-s)),t},N=(r,s)=>{let t=s.length;for(;t;)r=r*33^s.charCodeAt(--t);return r},P=(r,s=3)=>{const t=N(5381,JSON.stringify(r))>>>0;return H(t,s)},W=(r,s)=>{if(typeof r!="string")return{result:r};if(!s)return{result:r};const t=[];return Object.values(s).forEach(n=>{const{pattern:c,transform:$}=n;r=r.replace(c,d=>{const{value:i,css:l}=$(d);return l&&t.push(l),i})}),{result:r,additionalCss:t}},q=r=>typeof r!="string"?{result:r}:/\{[^{}]+\}/g.test(r)?{result:r.replace(/\{([^{}]+)\}/g,(...n)=>`var(--${E.dashCase(n[1].replaceAll(".","-"))})`)}:{result:r},a=(r,s,t,n)=>{if(!r)return"";const c=[],$=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(([p,f])=>{f&&Object.entries(f).forEach(([b,m])=>{if(!m)return;const S=`${s}.${p}-${b}`,j=a(m,S,t);c.push(j)})}),i;if(o==="defaultVariants")return i;if(o==="compoundVariants")return e.forEach(p=>{const{css:f,...b}=p,m=Object.entries(b).reduce((j,[T,k])=>`${j}.${T}-${k}`,s),S=a(f,m,t);c.push(S)}),i;if(o.startsWith("@")){const p=a(e,s,t),f=`${o} {
|
2
|
-
${p.replace(`
|
3
|
-
`,`
|
4
|
-
`)}
|
5
|
-
}`;return c.push(f),i}const u=l.includes("&")?o.replace("&",s):o.startsWith(":")?`${s}${o}`:`${s} ${o}`,h=a(e,u,t);return c.push(h),i}if(n!=null&&n.templates&&n.templates[o]){const h=e.split(".").reduce((p,f)=>p[f],n.templates[o]);if(h){const p=a(h,"");return`${i}${p}`}return console.warn(`Template "${o}" with path of "${e}" was not found in config!`),i}const V=o.startsWith("-")?o:E.dashCase(o),y=(u,h=";")=>i=`${i}${u}${h}`,O=u=>y(`${V}:${u}`);if(typeof e=="number")return O(e);if(typeof e!="string")if("toString"in e)e=e.toString();else return i;const{modifiers:w}=n||{},A=function*(){yield q(e),yield W(e,w)}();for(const{result:u,additionalCss:h=[]}of A)e=u,h.forEach(p=>{const f=a(p,"");y(f,"")});return O(e)},"");if(!$)return c.join(`
|
6
|
-
`);if(!s)return $;let d="";return t!==void 0?d=`@layer l${t} { ${s} { ${$} } }`:d=`${s} { ${$} }`,[d,...c].join(`
|
7
|
-
`)};exports.parseStyles=a;exports.toHash=P;
|