@salty-css/react 0.0.1-alpha.273 → 0.0.1-alpha.274
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.d.ts +0 -1
- package/dynamic-styles.js +15 -16
- 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 e=require("react/jsx-runtime"),o=require("@salty-css/core/parsers"),m=require("@salty-css/core/util"),S=require("./clsx-C11secjj.cjs"),
|
2
|
-
`),
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("@salty-css/core/parsers"),m=require("@salty-css/core/util"),S=require("./clsx-C11secjj.cjs"),i=s=>m.toHash(s),c=async(s,t)=>(await o.parseStyles(s,t)).join(`
|
2
|
+
`),d=async({as:s,scope:t,styles:a,...n})=>{if(s){const r=i(a),u=await c(a,t||r),y={...n,className:S.clsx(r,n.className)};return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:u}),e.jsx(s,{...y})]})}const l=await c(a,t);return e.jsx("style",{children:l})};exports.DynamicStyles=d;exports.useDynamicStyles=c;exports.useDynamicStylesClassName=i;
|
package/dynamic-styles.d.ts
CHANGED
@@ -3,7 +3,6 @@ import { HTMLAttributes } from 'react';
|
|
3
3
|
/**
|
4
4
|
* Create a hash of the dynamic styles that then can be used as scope.
|
5
5
|
*/
|
6
|
-
export declare const useDynamicStylesHash: (styles: BaseStyles) => string;
|
7
6
|
export declare const useDynamicStylesClassName: (styles: BaseStyles) => string;
|
8
7
|
/**
|
9
8
|
* Add any dynamic styles to your app with a custom scope.
|
package/dynamic-styles.js
CHANGED
@@ -1,22 +1,21 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { parseStyles as
|
3
|
-
import { toHash as
|
4
|
-
import { c as
|
5
|
-
const
|
6
|
-
`),
|
7
|
-
const e = await d(t, a);
|
1
|
+
import { jsxs as l, Fragment as y, jsx as t } from "react/jsx-runtime";
|
2
|
+
import { parseStyles as p } from "@salty-css/core/parsers";
|
3
|
+
import { toHash as u } from "@salty-css/core/util";
|
4
|
+
import { c as d } from "./clsx-OuTLNxxd.js";
|
5
|
+
const f = (s) => u(s), e = async (s, a) => (await p(s, a)).join(`
|
6
|
+
`), j = async ({ as: s, scope: a, styles: r, ...c }) => {
|
8
7
|
if (s) {
|
9
|
-
const n =
|
10
|
-
return /* @__PURE__ */
|
11
|
-
/* @__PURE__ */
|
12
|
-
/* @__PURE__ */
|
8
|
+
const n = f(r), i = await e(r, a || n), m = { ...c, className: d(n, c.className) };
|
9
|
+
return /* @__PURE__ */ l(y, { children: [
|
10
|
+
/* @__PURE__ */ t("style", { children: i }),
|
11
|
+
/* @__PURE__ */ t(s, { ...m })
|
13
12
|
] });
|
14
13
|
}
|
15
|
-
|
14
|
+
const o = await e(r, a);
|
15
|
+
return /* @__PURE__ */ t("style", { children: o });
|
16
16
|
};
|
17
17
|
export {
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
p as useDynamicStylesHash
|
18
|
+
j as DynamicStyles,
|
19
|
+
e as useDynamicStyles,
|
20
|
+
f as useDynamicStylesClassName
|
22
21
|
};
|
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.274",
|
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.274",
|
74
74
|
"clsx": ">=2.x",
|
75
75
|
"react": ">=19.x || >=18.3.x"
|
76
76
|
}
|