@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.
@@ -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"),r=s=>m.toHash(s),i=s=>`.${r(s)}`,l=async(s,t)=>(await o.parseStyles(s,t)).join(`
2
- `),h=async({as:s,scope:t,styles:a,...n})=>{const c=await l(a,t);if(s){const y=i(a),u={...n,className:S.clsx(y,n.className)};return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:c}),e.jsx(s,{...u})]})}return e.jsx("style",{children:c})};exports.DynamicStyles=h;exports.useDynamicStyles=l;exports.useDynamicStylesClassName=i;exports.useDynamicStylesHash=r;
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;
@@ -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 m, Fragment as i, jsx as r } from "react/jsx-runtime";
2
- import { parseStyles as l } from "@salty-css/core/parsers";
3
- import { toHash as y } from "@salty-css/core/util";
4
- import { c as h } from "./clsx-OuTLNxxd.js";
5
- const p = (s) => y(s), u = (s) => `.${p(s)}`, d = async (s, a) => (await l(s, a)).join(`
6
- `), N = async ({ as: s, scope: a, styles: t, ...c }) => {
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 = u(t), o = { ...c, className: h(n, c.className) };
10
- return /* @__PURE__ */ m(i, { children: [
11
- /* @__PURE__ */ r("style", { children: e }),
12
- /* @__PURE__ */ r(s, { ...o })
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
- return /* @__PURE__ */ r("style", { children: e });
14
+ const o = await e(r, a);
15
+ return /* @__PURE__ */ t("style", { children: o });
16
16
  };
17
17
  export {
18
- N as DynamicStyles,
19
- d as useDynamicStyles,
20
- u as useDynamicStylesClassName,
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.273",
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.273",
73
+ "@salty-css/core": "^0.0.1-alpha.274",
74
74
  "clsx": ">=2.x",
75
75
  "react": ">=19.x || >=18.3.x"
76
76
  }