@salty-css/react 0.0.1-alpha.279 → 0.0.1-alpha.280
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 -2
- package/dynamic-styles.js +19 -15
- package/package.json +2 -2
package/dynamic-styles.cjs
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
2
|
-
`),
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),g=require("@salty-css/core/parsers"),C=require("@salty-css/core/cache/resolve-dynamic-config-cache"),S=require("@salty-css/core/util"),f=require("./clsx-C11secjj.cjs"),j=require("react"),l=e=>S.toHash(e),r=async(e,t)=>{const s=await C.resolveDynamicConfigCache();return(await g.parseStyles(e,t,s)).join(`
|
2
|
+
`)},x=async({as:e,scope:t,styles:s,...c})=>{if(e){const a=o=>typeof e=="string"?j.createElement(e,o):e(o);if(!s)return n.jsx(a,{...c});const i=l(s),u=await r(s,t||`.${i}`),y={...c,className:f.clsx(i,c.className)};return n.jsxs(n.Fragment,{children:[n.jsx("style",{children:u}),n.jsx(a,{...y})]})}if(!s)return null;const m=await r(s,t);return n.jsx("style",{children:m})};exports.DynamicStyles=x;exports.getDynamicStylesClassName=l;exports.getDynamicStylesCss=r;
|
package/dynamic-styles.js
CHANGED
@@ -1,25 +1,29 @@
|
|
1
|
-
import { jsx as s, jsxs as
|
1
|
+
import { jsx as s, jsxs as p, Fragment as y } from "react/jsx-runtime";
|
2
2
|
import { parseStyles as u } from "@salty-css/core/parsers";
|
3
|
+
import { resolveDynamicConfigCache as g } from "@salty-css/core/cache/resolve-dynamic-config-cache";
|
3
4
|
import { toHash as d } from "@salty-css/core/util";
|
4
|
-
import { c as
|
5
|
-
import { createElement as
|
6
|
-
const
|
7
|
-
|
5
|
+
import { c as h } from "./clsx-OuTLNxxd.js";
|
6
|
+
import { createElement as C } from "react";
|
7
|
+
const w = (t) => d(t), i = async (t, r) => {
|
8
|
+
const n = await g();
|
9
|
+
return (await u(t, r, n)).join(`
|
10
|
+
`);
|
11
|
+
}, E = async ({ as: t, scope: r, styles: n, ...o }) => {
|
8
12
|
if (t) {
|
9
|
-
const c = (a) => typeof t == "string" ?
|
10
|
-
if (!n) return /* @__PURE__ */ s(c, { ...
|
11
|
-
const
|
12
|
-
return /* @__PURE__ */
|
13
|
+
const c = (a) => typeof t == "string" ? C(t, a) : t(a);
|
14
|
+
if (!n) return /* @__PURE__ */ s(c, { ...o });
|
15
|
+
const e = w(n), l = await i(n, r || `.${e}`), f = { ...o, className: h(e, o.className) };
|
16
|
+
return /* @__PURE__ */ p(y, { children: [
|
13
17
|
/* @__PURE__ */ s("style", { children: l }),
|
14
|
-
/* @__PURE__ */ s(c, { ...
|
18
|
+
/* @__PURE__ */ s(c, { ...f })
|
15
19
|
] });
|
16
20
|
}
|
17
21
|
if (!n) return null;
|
18
|
-
const
|
19
|
-
return /* @__PURE__ */ s("style", { children:
|
22
|
+
const m = await i(n, r);
|
23
|
+
return /* @__PURE__ */ s("style", { children: m });
|
20
24
|
};
|
21
25
|
export {
|
22
|
-
|
23
|
-
|
24
|
-
|
26
|
+
E as DynamicStyles,
|
27
|
+
w as getDynamicStylesClassName,
|
28
|
+
i as getDynamicStylesCss
|
25
29
|
};
|
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.280",
|
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.280",
|
74
74
|
"clsx": ">=2.x",
|
75
75
|
"react": ">=19.x || >=18.3.x"
|
76
76
|
}
|