@salty-css/react 0.0.1-alpha.265 → 0.0.1-alpha.267
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/dynamic-styles.cjs +2 -0
- package/dynamic-styles.d.ts +8 -0
- package/dynamic-styles.js +9 -0
- package/element-factory-Ccd9WJOa.js +68 -0
- package/element-factory-CgP5yEab.cjs +1 -0
- package/package.json +6 -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-DcAhlvyZ.cjs +0 -1
- package/element-factory-DwZ6jdLG.js +0 -68
@@ -0,0 +1,8 @@
|
|
1
|
+
import { BaseStyles } from '@salty-css/core/types';
|
2
|
+
/**
|
3
|
+
* Add any dynamic styles to your app with a custom scope.
|
4
|
+
*/
|
5
|
+
export declare const DynamicStyles: ({ scope, styles }: {
|
6
|
+
scope: string;
|
7
|
+
styles: BaseStyles;
|
8
|
+
}) => Promise<import("react").JSX.Element>;
|
@@ -0,0 +1,68 @@
|
|
1
|
+
import { forwardRef as C, createElement as N } from "react";
|
2
|
+
import { dashCase as p } from "@salty-css/core/util";
|
3
|
+
import { parseVariableTokens as g } from "@salty-css/core/parsers";
|
4
|
+
function K(i) {
|
5
|
+
var n, e, t = "";
|
6
|
+
if (typeof i == "string" || typeof i == "number") t += i;
|
7
|
+
else if (typeof i == "object") if (Array.isArray(i)) {
|
8
|
+
var d = i.length;
|
9
|
+
for (n = 0; n < d; n++) i[n] && (e = K(i[n])) && (t && (t += " "), t += e);
|
10
|
+
} else for (e in i) i[e] && (t && (t += " "), t += e);
|
11
|
+
return t;
|
12
|
+
}
|
13
|
+
function A() {
|
14
|
+
for (var i, n, e = 0, t = "", d = arguments.length; e < d; e++) (i = arguments[e]) && (n = K(i)) && (t && (t += " "), t += n);
|
15
|
+
return t;
|
16
|
+
}
|
17
|
+
const R = ["passProps"], z = (i, n = "", e = {}, t) => {
|
18
|
+
const j = C(({
|
19
|
+
extend: o = i,
|
20
|
+
element: S = e.element,
|
21
|
+
className: O = "",
|
22
|
+
children: $,
|
23
|
+
passProps: u = e.passProps,
|
24
|
+
_vks: l = /* @__PURE__ */ new Set(),
|
25
|
+
...r
|
26
|
+
}, w) => {
|
27
|
+
const f = { passProps: u };
|
28
|
+
e.attr && Object.assign(f, e.attr), t && Object.assign(f, t), e.defaultProps && Object.assign(r, e.defaultProps), r && Object.assign(f, r);
|
29
|
+
const b = /* @__PURE__ */ new Set([...n.split(" "), ...O.split(" ")]), y = typeof o == "function" || typeof o == "object", h = y && "isStyled" in o, E = y ? o : S || o;
|
30
|
+
if (!E) throw new Error("No element provided");
|
31
|
+
const m = f.style || {};
|
32
|
+
f.style || (f.style = m), Object.entries(m).forEach(([s, a]) => {
|
33
|
+
const c = g(a);
|
34
|
+
c && (m[s] = c.transformed);
|
35
|
+
}), e.propValueKeys && e.propValueKeys.forEach((s) => {
|
36
|
+
const a = `css-${s}`, c = r[a];
|
37
|
+
if (c === void 0) return;
|
38
|
+
const v = `--props-${p(s)}`;
|
39
|
+
m[v] = c, l && l.add(a);
|
40
|
+
}), e.variantKeys && e.variantKeys.forEach((s) => {
|
41
|
+
const [a, c] = s.split("=");
|
42
|
+
r[a] !== void 0 ? (b.add(`${a}-${r[a]}`), l && l.add(a)) : c !== void 0 && b.add(`${a}-${c}`);
|
43
|
+
}), l && (!y || !h) ? l.forEach((s) => {
|
44
|
+
if (!u) return delete f[s];
|
45
|
+
if (u !== !0 && !u.includes(s))
|
46
|
+
return delete f[s];
|
47
|
+
}) : h && Object.assign(f, { _vks: l }), h || R.forEach((s) => delete f[s]);
|
48
|
+
const V = A(...b);
|
49
|
+
return N(
|
50
|
+
E,
|
51
|
+
{
|
52
|
+
element: y ? S : void 0,
|
53
|
+
className: V,
|
54
|
+
ref: w,
|
55
|
+
...f
|
56
|
+
},
|
57
|
+
$
|
58
|
+
);
|
59
|
+
});
|
60
|
+
return Object.assign(j, {
|
61
|
+
isStyled: !0,
|
62
|
+
className: n,
|
63
|
+
toString: () => `.${e.hash}`
|
64
|
+
}), j;
|
65
|
+
};
|
66
|
+
export {
|
67
|
+
z as e
|
68
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";const K=require("react"),C=require("@salty-css/core/util"),N=require("@salty-css/core/parsers");function O(s){var n,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(n=0;n<o;n++)s[n]&&(e=O(s[n]))&&(t&&(t+=" "),t+=e)}else for(e in s)s[e]&&(t&&(t+=" "),t+=e);return t}function g(){for(var s,n,e=0,t="",o=arguments.length;e<o;e++)(s=arguments[e])&&(n=O(s))&&(t&&(t+=" "),t+=n);return t}const A=["passProps"],F=(s,n="",e={},t)=>{const o=({extend:u=s,element:S=e.element,className:$="",children:w,passProps:d=e.passProps,_vks:l=new Set,...r},V)=>{const f={passProps:d};e.attr&&Object.assign(f,e.attr),t&&Object.assign(f,t),e.defaultProps&&Object.assign(r,e.defaultProps),r&&Object.assign(f,r);const b=new Set([...n.split(" "),...$.split(" ")]),y=typeof u=="function"||typeof u=="object",h=y&&"isStyled"in u,E=y?u:S||u;if(!E)throw new Error("No element provided");const m=f.style||{};f.style||(f.style=m),Object.entries(m).forEach(([i,a])=>{const c=N.parseVariableTokens(a);c&&(m[i]=c.transformed)}),e.propValueKeys&&e.propValueKeys.forEach(i=>{const a=`css-${i}`,c=r[a];if(c===void 0)return;const v=`--props-${C.dashCase(i)}`;m[v]=c,l&&l.add(a)}),e.variantKeys&&e.variantKeys.forEach(i=>{const[a,c]=i.split("=");r[a]!==void 0?(b.add(`${a}-${r[a]}`),l&&l.add(a)):c!==void 0&&b.add(`${a}-${c}`)}),l&&(!y||!h)?l.forEach(i=>{if(!d)return delete f[i];if(d!==!0&&!d.includes(i))return delete f[i]}):h&&Object.assign(f,{_vks:l}),h||A.forEach(i=>delete f[i]);const q=g(...b);return K.createElement(E,{element:y?S:void 0,className:q,ref:V,...f},w)},j=K.forwardRef(o);return Object.assign(j,{isStyled:!0,className:n,toString:()=>`.${e.hash}`}),j};exports.elementFactory=F;
|
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.267",
|
4
4
|
"main": "./dist/index.js",
|
5
5
|
"module": "./dist/index.mjs",
|
6
6
|
"typings": "./dist/index.d.ts",
|
@@ -63,10 +63,14 @@
|
|
63
63
|
"./helpers": {
|
64
64
|
"import": "./helpers.js",
|
65
65
|
"require": "./helpers.cjs"
|
66
|
+
},
|
67
|
+
"./dynamic-styles": {
|
68
|
+
"import": "./dynamic-styles.js",
|
69
|
+
"require": "./dynamic-styles.cjs"
|
66
70
|
}
|
67
71
|
},
|
68
72
|
"dependencies": {
|
69
|
-
"@salty-css/core": "^0.0.1-alpha.
|
73
|
+
"@salty-css/core": "^0.0.1-alpha.267",
|
70
74
|
"clsx": ">=2.x",
|
71
75
|
"react": ">=19.x || >=18.3.x"
|
72
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-CgP5yEab.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-CgP5yEab.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-Ccd9WJOa.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 K=require("react"),C=require("@salty-css/core/util"),g=require("@salty-css/core/parsers");function O(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=O(s[i]))&&(t&&(t+=" "),t+=e)}else for(e in s)s[e]&&(t&&(t+=" "),t+=e);return t}function N(){for(var s,i,e=0,t="",o=arguments.length;e<o;e++)(s=arguments[e])&&(i=O(s))&&(t&&(t+=" "),t+=i);return t}const A=["passProps"],F=(s,i="",e={},t)=>{const o=({extend:u=s,element:S=e.element,className:$="",children:w,passProps:d=e.passProps,_vks:a=new Set,...l},V)=>{const f={passProps:d};e.attr&&Object.assign(f,e.attr),t&&Object.assign(f,t),e.defaultProps&&Object.assign(l,e.defaultProps),l&&Object.assign(f,l);const b=new Set([...i.split(" "),...$.split(" ")]),y=typeof u=="function"||typeof u=="object",h=y&&"isStyled"in u,E=y?u:S||u;if(!E)throw new Error("No element provided");const m=f.style||{};f.style||(f.style=m),Object.entries(m).forEach(([n,c])=>{const r=g.parseVariableTokens(c);r&&(m[n]=r.transformed)}),e.propValueKeys&&e.propValueKeys.forEach(n=>{const c=`css-${n}`,r=l[c];if(r===void 0)return;const v=`--props-${C.dashCase(n)}`;m[v]=r,a&&a.add(c)}),e.variantKeys&&e.variantKeys.forEach(n=>{const[c,r]=n.split("=");l[c]!==void 0?(b.add(`${c}-${l[c]}`),a&&a.add(c)):r!==void 0&&b.add(`${c}-${r}`)}),a&&(!y||!h)?a.forEach(n=>{if(!d)return delete f[n];if(d!==!0&&!d.includes(n))return delete f[n]}):h&&Object.assign(f,{_vks:a}),h||A.forEach(n=>delete f[n]);const q=N(...b);return K.createElement(E,{element:y?S:void 0,className:q,ref:V,...f},w)},j=K.forwardRef(o);return Object.assign(j,{isStyled:!0,className:i,toString:()=>`.${i}`}),j};exports.elementFactory=F;
|
@@ -1,68 +0,0 @@
|
|
1
|
-
import { forwardRef as v, createElement as C } from "react";
|
2
|
-
import { dashCase as g } from "@salty-css/core/util";
|
3
|
-
import { parseVariableTokens as N } from "@salty-css/core/parsers";
|
4
|
-
function K(i) {
|
5
|
-
var s, e, t = "";
|
6
|
-
if (typeof i == "string" || typeof i == "number") t += i;
|
7
|
-
else if (typeof i == "object") if (Array.isArray(i)) {
|
8
|
-
var d = i.length;
|
9
|
-
for (s = 0; s < d; s++) i[s] && (e = K(i[s])) && (t && (t += " "), t += e);
|
10
|
-
} else for (e in i) i[e] && (t && (t += " "), t += e);
|
11
|
-
return t;
|
12
|
-
}
|
13
|
-
function A() {
|
14
|
-
for (var i, s, e = 0, t = "", d = arguments.length; e < d; e++) (i = arguments[e]) && (s = K(i)) && (t && (t += " "), t += s);
|
15
|
-
return t;
|
16
|
-
}
|
17
|
-
const R = ["passProps"], z = (i, s = "", e = {}, t) => {
|
18
|
-
const j = v(({
|
19
|
-
extend: o = i,
|
20
|
-
element: S = e.element,
|
21
|
-
className: O = "",
|
22
|
-
children: $,
|
23
|
-
passProps: u = e.passProps,
|
24
|
-
_vks: c = /* @__PURE__ */ new Set(),
|
25
|
-
...l
|
26
|
-
}, w) => {
|
27
|
-
const f = { passProps: u };
|
28
|
-
e.attr && Object.assign(f, e.attr), t && Object.assign(f, t), e.defaultProps && Object.assign(l, e.defaultProps), l && Object.assign(f, l);
|
29
|
-
const b = /* @__PURE__ */ new Set([...s.split(" "), ...O.split(" ")]), y = typeof o == "function" || typeof o == "object", h = y && "isStyled" in o, E = y ? o : S || o;
|
30
|
-
if (!E) throw new Error("No element provided");
|
31
|
-
const m = f.style || {};
|
32
|
-
f.style || (f.style = m), Object.entries(m).forEach(([n, a]) => {
|
33
|
-
const r = N(a);
|
34
|
-
r && (m[n] = r.transformed);
|
35
|
-
}), e.propValueKeys && e.propValueKeys.forEach((n) => {
|
36
|
-
const a = `css-${n}`, r = l[a];
|
37
|
-
if (r === void 0) return;
|
38
|
-
const p = `--props-${g(n)}`;
|
39
|
-
m[p] = r, c && c.add(a);
|
40
|
-
}), e.variantKeys && e.variantKeys.forEach((n) => {
|
41
|
-
const [a, r] = n.split("=");
|
42
|
-
l[a] !== void 0 ? (b.add(`${a}-${l[a]}`), c && c.add(a)) : r !== void 0 && b.add(`${a}-${r}`);
|
43
|
-
}), c && (!y || !h) ? c.forEach((n) => {
|
44
|
-
if (!u) return delete f[n];
|
45
|
-
if (u !== !0 && !u.includes(n))
|
46
|
-
return delete f[n];
|
47
|
-
}) : h && Object.assign(f, { _vks: c }), h || R.forEach((n) => delete f[n]);
|
48
|
-
const V = A(...b);
|
49
|
-
return C(
|
50
|
-
E,
|
51
|
-
{
|
52
|
-
element: y ? S : void 0,
|
53
|
-
className: V,
|
54
|
-
ref: w,
|
55
|
-
...f
|
56
|
-
},
|
57
|
-
$
|
58
|
-
);
|
59
|
-
});
|
60
|
-
return Object.assign(j, {
|
61
|
-
isStyled: !0,
|
62
|
-
className: s,
|
63
|
-
toString: () => `.${s}`
|
64
|
-
}), j;
|
65
|
-
};
|
66
|
-
export {
|
67
|
-
z as e
|
68
|
-
};
|