@salty-css/react 0.0.1-alpha.285 → 0.0.1-alpha.287
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-BPI0pGIH.cjs +1 -0
- package/{element-factory-Bs1HmAhv.js → element-factory-D5vMsSwp.js} +17 -17
- package/package.json +2 -2
- package/styled-client.cjs +1 -1
- package/styled-client.js +1 -1
- package/styled.cjs +1 -1
- package/styled.js +1 -1
- package/element-factory-CvLrXNeg.cjs +0 -1
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";const S=require("react"),C=require("./clsx-C11secjj.cjs"),N=require("@salty-css/core/util"),F=require("@salty-css/core/parsers"),R=["passProps"],v=(E,y="",t={},m)=>{const K=({extend:l=E,element:h=t.element,className:O="",children:$,passProps:f=t.passProps,_vks:c=new Set,...a},w)=>{const s={passProps:f};t.attr&&Object.assign(s,t.attr),m&&Object.assign(s,m),t.defaultProps&&Object.assign(a,t.defaultProps),a&&Object.assign(s,a);const o=new Set([...y.split(" "),...O.split(" ")]),d=typeof l=="function"||typeof l=="object",r=d&&"isStyled"in l,j=d?l:h||l;if(!j)throw new Error("No element provided");const u=s.style||{};s.style||(s.style=u),Object.entries(u).forEach(([e,i])=>{const n=F.parseVariableTokens(i);n&&(u[e]=n.transformed)}),t.propValueKeys&&t.propValueKeys.forEach(e=>{const i=`css-${e}`,n=a[i];if(n===void 0)return;const q=`--props-${N.dashCase(e)}`;u[q]=n,c&&c.add(i)}),t.variantKeys&&t.variantKeys.forEach(e=>{const[i,n]=e.split("=");a[i]!==void 0?(o.add(`${i}-${a[i]}`),c&&c.add(i)):n!==void 0&&o.add(`${i}-${n}`)}),c&&(!d||!r)?c.forEach(e=>{if(!f)return delete s[e];if(f!==!0&&!f.includes(e))return delete s[e]}):r&&Object.assign(s,{_vks:c}),r||R.forEach(e=>delete s[e]);const V=C.clsx(...o);return S.createElement(j,{element:d?h:void 0,className:V,ref:w,...s},$)},b=S.forwardRef(K);return Object.assign(b,{isStyled:!0,className:y,toString:()=>`.${t.hash}`}),b};exports.elementFactory=v;
|
@@ -2,42 +2,42 @@ import { forwardRef as V, createElement as C } from "react";
|
|
2
2
|
import { c as N } from "./clsx-OuTLNxxd.js";
|
3
3
|
import { dashCase as R } from "@salty-css/core/util";
|
4
4
|
import { parseVariableTokens as p } from "@salty-css/core/parsers";
|
5
|
-
const q = ["passProps"],
|
5
|
+
const q = ["passProps"], B = (S, m = "", t = {}, y) => {
|
6
6
|
const b = V(({
|
7
7
|
extend: c = S,
|
8
8
|
element: h = t.element,
|
9
9
|
className: E = "",
|
10
10
|
children: K,
|
11
11
|
passProps: l = t.passProps,
|
12
|
-
_vks:
|
12
|
+
_vks: n = /* @__PURE__ */ new Set(),
|
13
13
|
...a
|
14
14
|
}, O) => {
|
15
15
|
const s = { passProps: l };
|
16
16
|
t.attr && Object.assign(s, t.attr), y && Object.assign(s, y), t.defaultProps && Object.assign(a, t.defaultProps), a && Object.assign(s, a);
|
17
|
-
const
|
17
|
+
const r = /* @__PURE__ */ new Set([...m.split(" "), ...E.split(" ")]), o = typeof c == "function" || typeof c == "object", u = o && "isStyled" in c, j = o ? c : h || c;
|
18
18
|
if (!j) throw new Error("No element provided");
|
19
|
-
const
|
20
|
-
s.style || (s.style =
|
21
|
-
const
|
22
|
-
|
19
|
+
const d = s.style || {};
|
20
|
+
s.style || (s.style = d), Object.entries(d).forEach(([e, i]) => {
|
21
|
+
const f = p(i);
|
22
|
+
f && (d[e] = f.transformed);
|
23
23
|
}), t.propValueKeys && t.propValueKeys.forEach((e) => {
|
24
|
-
const i = `css-${e}`,
|
25
|
-
if (
|
24
|
+
const i = `css-${e}`, f = a[i];
|
25
|
+
if (f === void 0) return;
|
26
26
|
const w = `--props-${R(e)}`;
|
27
|
-
|
27
|
+
d[w] = f, n && n.add(i);
|
28
28
|
}), t.variantKeys && t.variantKeys.forEach((e) => {
|
29
|
-
const [i,
|
30
|
-
a[i] !== void 0 ? (
|
31
|
-
}),
|
29
|
+
const [i, f] = e.split("=");
|
30
|
+
a[i] !== void 0 ? (r.add(`${i}-${a[i]}`), n && n.add(i)) : f !== void 0 && r.add(`${i}-${f}`);
|
31
|
+
}), n && (!o || !u) ? n.forEach((e) => {
|
32
32
|
if (!l) return delete s[e];
|
33
33
|
if (l !== !0 && !l.includes(e))
|
34
34
|
return delete s[e];
|
35
|
-
}) :
|
36
|
-
const $ = N(...
|
35
|
+
}) : u && Object.assign(s, { _vks: n }), u || q.forEach((e) => delete s[e]);
|
36
|
+
const $ = N(...r);
|
37
37
|
return C(
|
38
38
|
j,
|
39
39
|
{
|
40
|
-
element:
|
40
|
+
element: o ? h : void 0,
|
41
41
|
className: $,
|
42
42
|
ref: O,
|
43
43
|
...s
|
@@ -52,5 +52,5 @@ const q = ["passProps"], D = (S, m = "", t = {}, y) => {
|
|
52
52
|
}), b;
|
53
53
|
};
|
54
54
|
export {
|
55
|
-
|
55
|
+
B as e
|
56
56
|
};
|
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.287",
|
4
4
|
"main": "./dist/index.js",
|
5
5
|
"module": "./dist/index.mjs",
|
6
6
|
"typings": "./dist/index.d.ts",
|
@@ -70,7 +70,7 @@
|
|
70
70
|
}
|
71
71
|
},
|
72
72
|
"dependencies": {
|
73
|
-
"@salty-css/core": "^0.0.1-alpha.
|
73
|
+
"@salty-css/core": "^0.0.1-alpha.287",
|
74
74
|
"clsx": ">=2.x",
|
75
75
|
"react": ">=19.x || >=18.3.x"
|
76
76
|
}
|
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-BPI0pGIH.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";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@salty-css/core/generators"),s=require("./element-factory-
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@salty-css/core/generators"),s=require("./element-factory-BPI0pGIH.cjs"),c=(t,r)=>{const e=new o.StyledGenerator(t,r),n=s.elementFactory(t,e.cssClassName,e.clientProps,{"data-unoptimized-client-component":!0});return Object.assign(n,{generator:e}),n};exports.styled=c;
|
package/styled.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { StyledGenerator as r } from "@salty-css/core/generators";
|
2
|
-
import { e as s } from "./element-factory-
|
2
|
+
import { e as s } from "./element-factory-D5vMsSwp.js";
|
3
3
|
const i = (t, o) => {
|
4
4
|
const e = new r(t, o), n = s(t, e.cssClassName, e.clientProps, {
|
5
5
|
"data-unoptimized-client-component": !0
|
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";const S=require("react"),C=require("./clsx-C11secjj.cjs"),N=require("@salty-css/core/util"),F=require("@salty-css/core/parsers"),R=["passProps"],T=(E,y="",t={},m)=>{const K=({extend:a=E,element:h=t.element,className:O="",children:$,passProps:l=t.passProps,_vks:c=new Set,...f},w)=>{const s={passProps:l};t.attr&&Object.assign(s,t.attr),m&&Object.assign(s,m),t.defaultProps&&Object.assign(f,t.defaultProps),f&&Object.assign(s,f);const r=new Set([...y.split(" "),...O.split(" ")]),d=typeof a=="function"||typeof a=="object",o=d&&"isStyled"in a,j=d?a:h||a;if(!j)throw new Error("No element provided");const u=s.style||{};s.style||(s.style=u),Object.entries(u).forEach(([e,n])=>{const i=F.parseVariableTokens(n);i&&(u[e]=i.transformed)}),t.propValueKeys&&t.propValueKeys.forEach(e=>{const n=`css-${e}`,i=f[n];if(i===void 0)return;const q=`--props-${N.dashCase(e)}`;u[q]=i,c&&c.add(n)}),t.variantKeys&&t.variantKeys.forEach(e=>{const[n,i]=e.split("=");f[n]!==void 0?(r.add(`${n}-${f[n]}`),c&&c.add(n)):i!==void 0&&r.add(`${n}-${i}`)}),c&&(!d||!o)?c.forEach(e=>{if(!l)return delete s[e];if(l!==!0&&!l.includes(e))return delete s[e]}):o&&Object.assign(s,{_vks:c}),o||R.forEach(e=>delete s[e]);const V=C.clsx(...r);return S.createElement(j,{element:d?h:void 0,className:V,ref:w,...s},$)},b=S.forwardRef(K);return Object.assign(b,{isStyled:!0,className:y,toString:()=>`.${t.hash}`}),b};exports.elementFactory=T;
|