@salty-css/react 0.0.1-alpha.57 → 0.0.1-alpha.58

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/keyframes.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./parse-styles-SPT4zc_H.cjs"),j=({animationName:m,params:l,appendInitialStyles:f,...t})=>{const r=m||u.toHash(t),o=(n={})=>{const{duration:e="500ms",easing:s="ease-in-out",delay:a="0s",iterationCount:i="1",direction:d="normal",fillMode:g="forwards",playState:p="running"}={...l,...n},c=`${r} ${e} ${s} ${a} ${i} ${d} ${g} ${p}`;if(!f)return c;const $=t.from||t["0%"];if(!$)return c;const b=u.parseStyles($,"");return`${c};${b}`},y=Object.entries(t).reduce((n,[e,s])=>{if(!s)return n;const a=u.parseStyles(s,""),i=typeof e=="number"?`${e}%`:e;return`${n}${i}{${a}}`},""),S=`@keyframes ${r} {${y}}`;return Object.assign(o,{toString:o,isKeyframes:!0,animationName:r,css:S,keyframes:t}),o};exports.keyframes=j;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./parse-styles-DbNZJMT5.cjs"),j=({animationName:m,params:l,appendInitialStyles:f,...t})=>{const r=m||u.toHash(t),o=(n={})=>{const{duration:e="500ms",easing:s="ease-in-out",delay:a="0s",iterationCount:i="1",direction:d="normal",fillMode:g="forwards",playState:p="running"}={...l,...n},c=`${r} ${e} ${s} ${a} ${i} ${d} ${g} ${p}`;if(!f)return c;const $=t.from||t["0%"];if(!$)return c;const b=u.parseStyles($,"");return`${c};${b}`},y=Object.entries(t).reduce((n,[e,s])=>{if(!s)return n;const a=u.parseStyles(s,""),i=typeof e=="number"?`${e}%`:e;return`${n}${i}{${a}}`},""),S=`@keyframes ${r} {${y}}`;return Object.assign(o,{toString:o,isKeyframes:!0,animationName:r,css:S,keyframes:t}),o};exports.keyframes=j;
package/keyframes.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as j, p as m } from "./parse-styles-T74HIH4_.js";
1
+ import { t as j, p as m } from "./parse-styles-DLe1Dr-N.js";
2
2
  const N = ({ animationName: u, params: f, appendInitialStyles: l, ...t }) => {
3
3
  const e = u || j(t), o = (s = {}) => {
4
4
  const {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salty-css/react",
3
- "version": "0.0.1-alpha.57",
3
+ "version": "0.0.1-alpha.58",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "typings": "./dist/index.d.ts",
@@ -41,7 +41,7 @@
41
41
  }
42
42
  },
43
43
  "dependencies": {
44
- "@salty-css/core": "^0.0.1-alpha.57",
44
+ "@salty-css/core": "^0.0.1-alpha.58",
45
45
  "clsx": ">=2.x",
46
46
  "react": ">=19.x || >=18.3.x"
47
47
  }
@@ -1,16 +1,16 @@
1
- import { d as V } from "./dash-case-CGJ_UIZz.js";
2
- const E = (r) => String.fromCharCode(r + (r > 25 ? 39 : 97)), T = (r, s) => {
1
+ import { d as E } from "./dash-case-CGJ_UIZz.js";
2
+ const g = (r) => String.fromCharCode(r + (r > 25 ? 39 : 97)), N = (r, s) => {
3
3
  let t = "", n;
4
- for (n = Math.abs(r); n > 52; n = n / 52 | 0) t = E(n % 52) + t;
5
- return t = E(n % 52) + t, t.length < s ? t = t.padStart(s, "a") : t.length > s && (t = t.slice(-s)), t;
6
- }, W = (r, s) => {
4
+ for (n = Math.abs(r); n > 52; n = n / 52 | 0) t = g(n % 52) + t;
5
+ return t = g(n % 52) + t, t.length < s ? t = t.padStart(s, "a") : t.length > s && (t = t.slice(-s)), t;
6
+ }, P = (r, s) => {
7
7
  let t = s.length;
8
8
  for (; t; ) r = r * 33 ^ s.charCodeAt(--t);
9
9
  return r;
10
10
  }, x = (r, s = 3) => {
11
- const t = W(5381, JSON.stringify(r)) >>> 0;
12
- return T(t, s);
13
- }, H = (r, s) => {
11
+ const t = P(5381, JSON.stringify(r)) >>> 0;
12
+ return N(t, s);
13
+ }, W = (r, s) => {
14
14
  if (typeof r != "string") return { result: r };
15
15
  if (!s) return { result: r };
16
16
  const t = [];
@@ -21,54 +21,58 @@ const E = (r) => String.fromCharCode(r + (r > 25 ? 39 : 97)), T = (r, s) => {
21
21
  return m && t.push(m), i;
22
22
  });
23
23
  }), { result: r, additionalCss: t };
24
- }, M = (r) => typeof r != "string" ? { result: r } : /\{[^{}]+\}/g.test(r) ? { result: r.replace(/\{([^{}]+)\}/g, (...n) => `var(--${V(n[1].replaceAll(".", "-"))})`) } : { result: r }, $ = (r, s, t, n) => {
24
+ }, H = (r) => typeof r != "string" ? { result: r } : /\{[^{}]+\}/g.test(r) ? { result: r.replace(/\{([^{}]+)\}/g, (...n) => `var(--${E(n[1].replaceAll(".", "-"))})`) } : { result: r }, $ = (r, s, t, n) => {
25
25
  if (!r) return "";
26
26
  const c = [], a = Object.entries(r).reduce((i, [m, e]) => {
27
27
  const o = m.trim();
28
28
  if (typeof e == "function" && (e = e()), typeof e == "object") {
29
29
  if (!e) return i;
30
30
  if (o === "variants")
31
- return Object.entries(e).forEach(([f, p]) => {
32
- p && Object.entries(p).forEach(([l, b]) => {
33
- if (!b) return;
34
- const j = `${s}.${f}-${l}`, S = $(b, j, t);
31
+ return Object.entries(e).forEach(([p, f]) => {
32
+ f && Object.entries(f).forEach(([b, l]) => {
33
+ if (!l) return;
34
+ const j = `${s}.${p}-${b}`, S = $(l, j, t);
35
35
  c.push(S);
36
36
  });
37
37
  }), i;
38
38
  if (o === "defaultVariants")
39
39
  return i;
40
40
  if (o === "compoundVariants")
41
- return e.forEach((f) => {
42
- const { css: p, ...l } = f, b = Object.entries(l).reduce((S, [N, P]) => `${S}.${N}-${P}`, s), j = $(p, b, t);
41
+ return e.forEach((p) => {
42
+ const { css: f, ...b } = p, l = Object.entries(b).reduce((S, [T, k]) => `${S}.${T}-${k}`, s), j = $(f, l, t);
43
43
  c.push(j);
44
44
  }), i;
45
45
  if (o.startsWith("@")) {
46
- const f = $(e, s, t), p = `${o} {
47
- ${f.replace(`
46
+ const p = $(e, s, t), f = `${o} {
47
+ ${p.replace(`
48
48
  `, `
49
49
  `)}
50
50
  }`;
51
- return c.push(p), i;
51
+ return c.push(f), i;
52
52
  }
53
53
  const u = m.includes("&") ? o.replace("&", s) : o.startsWith(":") ? `${s}${o}` : `${s} ${o}`, h = $(e, u, t);
54
54
  return c.push(h), i;
55
55
  }
56
56
  if (n != null && n.templates && n.templates[o]) {
57
- const h = e.split(".").reduce((p, l) => p[l], n.templates[o]), f = $(h, "");
58
- return `${i}${f}`;
57
+ const h = e.split(".").reduce((p, f) => p[f], n.templates[o]);
58
+ if (h) {
59
+ const p = $(h, "");
60
+ return `${i}${p}`;
61
+ }
62
+ return console.warn(`Template "${o}" with path of "${e}" was not found in config!`), i;
59
63
  }
60
- const g = o.startsWith("-") ? o : V(o), y = (u, h = ";") => i = `${i}${u}${h}`, O = (u) => y(`${g}:${u}`);
64
+ const V = o.startsWith("-") ? o : E(o), y = (u, h = ";") => i = `${i}${u}${h}`, O = (u) => y(`${V}:${u}`);
61
65
  if (typeof e == "number") return O(e);
62
66
  if (typeof e != "string")
63
67
  if ("toString" in e) e = e.toString();
64
68
  else return i;
65
- const { modifiers: A } = n || {}, k = function* () {
66
- yield M(e), yield H(e, A);
69
+ const { modifiers: w } = n || {}, A = function* () {
70
+ yield H(e), yield W(e, w);
67
71
  }();
68
- for (const { result: u, additionalCss: h = [] } of k)
69
- e = u, h.forEach((f) => {
70
- const p = $(f, "");
71
- y(p, "");
72
+ for (const { result: u, additionalCss: h = [] } of A)
73
+ e = u, h.forEach((p) => {
74
+ const f = $(p, "");
75
+ y(f, "");
72
76
  });
73
77
  return O(e);
74
78
  }, "");
@@ -0,0 +1,7 @@
1
+ "use strict";const E=require("./dash-case-B_odFlTl.cjs"),g=r=>String.fromCharCode(r+(r>25?39:97)),H=(r,s)=>{let t="",n;for(n=Math.abs(r);n>52;n=n/52|0)t=g(n%52)+t;return t=g(n%52)+t,t.length<s?t=t.padStart(s,"a"):t.length>s&&(t=t.slice(-s)),t},N=(r,s)=>{let t=s.length;for(;t;)r=r*33^s.charCodeAt(--t);return r},P=(r,s=3)=>{const t=N(5381,JSON.stringify(r))>>>0;return H(t,s)},W=(r,s)=>{if(typeof r!="string")return{result:r};if(!s)return{result:r};const t=[];return Object.values(s).forEach(n=>{const{pattern:c,transform:$}=n;r=r.replace(c,d=>{const{value:i,css:l}=$(d);return l&&t.push(l),i})}),{result:r,additionalCss:t}},q=r=>typeof r!="string"?{result:r}:/\{[^{}]+\}/g.test(r)?{result:r.replace(/\{([^{}]+)\}/g,(...n)=>`var(--${E.dashCase(n[1].replaceAll(".","-"))})`)}:{result:r},a=(r,s,t,n)=>{if(!r)return"";const c=[],$=Object.entries(r).reduce((i,[l,e])=>{const o=l.trim();if(typeof e=="function"&&(e=e()),typeof e=="object"){if(!e)return i;if(o==="variants")return Object.entries(e).forEach(([p,f])=>{f&&Object.entries(f).forEach(([b,m])=>{if(!m)return;const S=`${s}.${p}-${b}`,j=a(m,S,t);c.push(j)})}),i;if(o==="defaultVariants")return i;if(o==="compoundVariants")return e.forEach(p=>{const{css:f,...b}=p,m=Object.entries(b).reduce((j,[T,k])=>`${j}.${T}-${k}`,s),S=a(f,m,t);c.push(S)}),i;if(o.startsWith("@")){const p=a(e,s,t),f=`${o} {
2
+ ${p.replace(`
3
+ `,`
4
+ `)}
5
+ }`;return c.push(f),i}const u=l.includes("&")?o.replace("&",s):o.startsWith(":")?`${s}${o}`:`${s} ${o}`,h=a(e,u,t);return c.push(h),i}if(n!=null&&n.templates&&n.templates[o]){const h=e.split(".").reduce((p,f)=>p[f],n.templates[o]);if(h){const p=a(h,"");return`${i}${p}`}return console.warn(`Template "${o}" with path of "${e}" was not found in config!`),i}const V=o.startsWith("-")?o:E.dashCase(o),y=(u,h=";")=>i=`${i}${u}${h}`,O=u=>y(`${V}:${u}`);if(typeof e=="number")return O(e);if(typeof e!="string")if("toString"in e)e=e.toString();else return i;const{modifiers:w}=n||{},A=function*(){yield q(e),yield W(e,w)}();for(const{result:u,additionalCss:h=[]}of A)e=u,h.forEach(p=>{const f=a(p,"");y(f,"")});return O(e)},"");if(!$)return c.join(`
6
+ `);if(!s)return $;let d="";return t!==void 0?d=`@layer l${t} { ${s} { ${$} } }`:d=`${s} { ${$} }`,[d,...c].join(`
7
+ `)};exports.parseStyles=a;exports.toHash=P;
package/styled.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var l=Object.defineProperty;var m=(e,t,s)=>t in e?l(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var c=(e,t,s)=>m(e,typeof t!="symbol"?t+"":t,s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("./parse-styles-SPT4zc_H.cjs"),u=require("./element-factory-WgNOpLmJ.cjs"),y=e=>Object.keys(e);class g{constructor(t,s){c(this,"_callerName");c(this,"_context");this.tagName=t,this.params=s}get hash(){return h.toHash(this.params.base||this.params)}get priority(){var t;return typeof this.tagName=="function"||typeof this.tagName=="object"?(((t=this.tagName.generator)==null?void 0:t.priority)||0)+1:0}get classNames(){const t=[this.hash],{className:s}=this.params;return s&&t.push(s),t.join(" ")}get cssClassName(){return this.hash}get cssDisplayNameVar(){return`--${this.hash}-display-name: ${this._callerName};`}get templateKeys(){var t;return(t=this._context)!=null&&t.config.templates?y(this._context.config.templates):[]}get css(){var r;const{base:t={},variants:s={},compoundVariants:a=[]}=this.params,n={...t,variants:s,compoundVariants:a};return h.parseStyles(n,`.${this.cssClassName}`,this.priority,(r=this._context)==null?void 0:r.config)}get props(){const{element:t}=this.params,s=this.params.variants?Object.keys(this.params.variants).map(r=>{var i;const o=(i=this.params.defaultVariants)==null?void 0:i[r];return o!==void 0?`${r}=${String(o)}`:r}):void 0,a=new Set([]),n=/\{props\.([\w\d]+)\}/gi.exec(JSON.stringify(this.params.base));return n&&n.forEach((r,o,i)=>{const p=i.at(1);p&&a.add(p)}),{element:t,variantKeys:s,propValueKeys:[...a]}}_withBuildContext(t){this._context=t;const{name:s,config:a}=t;return this._callerName=s,this}}const f=(e,t)=>{const s=new g(e,t),a=u.elementFactory(e,s.cssClassName,s.props,{"data-unoptimized-client-component":!0});return Object.assign(a,{generator:s}),a};exports.styled=f;
1
+ "use strict";var l=Object.defineProperty;var m=(e,t,s)=>t in e?l(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var c=(e,t,s)=>m(e,typeof t!="symbol"?t+"":t,s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("./parse-styles-DbNZJMT5.cjs"),u=require("./element-factory-WgNOpLmJ.cjs"),y=e=>Object.keys(e);class g{constructor(t,s){c(this,"_callerName");c(this,"_context");this.tagName=t,this.params=s}get hash(){return h.toHash(this.params.base||this.params)}get priority(){var t;return typeof this.tagName=="function"||typeof this.tagName=="object"?(((t=this.tagName.generator)==null?void 0:t.priority)||0)+1:0}get classNames(){const t=[this.hash],{className:s}=this.params;return s&&t.push(s),t.join(" ")}get cssClassName(){return this.hash}get cssDisplayNameVar(){return`--${this.hash}-display-name: ${this._callerName};`}get templateKeys(){var t;return(t=this._context)!=null&&t.config.templates?y(this._context.config.templates):[]}get css(){var r;const{base:t={},variants:s={},compoundVariants:a=[]}=this.params,n={...t,variants:s,compoundVariants:a};return h.parseStyles(n,`.${this.cssClassName}`,this.priority,(r=this._context)==null?void 0:r.config)}get props(){const{element:t}=this.params,s=this.params.variants?Object.keys(this.params.variants).map(r=>{var i;const o=(i=this.params.defaultVariants)==null?void 0:i[r];return o!==void 0?`${r}=${String(o)}`:r}):void 0,a=new Set([]),n=/\{props\.([\w\d]+)\}/gi.exec(JSON.stringify(this.params.base));return n&&n.forEach((r,o,i)=>{const p=i.at(1);p&&a.add(p)}),{element:t,variantKeys:s,propValueKeys:[...a]}}_withBuildContext(t){this._context=t;const{name:s,config:a}=t;return this._callerName=s,this}}const f=(e,t)=>{const s=new g(e,t),a=u.elementFactory(e,s.cssClassName,s.props,{"data-unoptimized-client-component":!0});return Object.assign(a,{generator:s}),a};exports.styled=f;
package/styled.js CHANGED
@@ -1,7 +1,7 @@
1
1
  var m = Object.defineProperty;
2
2
  var h = (e, t, s) => t in e ? m(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
3
3
  var c = (e, t, s) => h(e, typeof t != "symbol" ? t + "" : t, s);
4
- import { t as l, p as u } from "./parse-styles-T74HIH4_.js";
4
+ import { t as l, p as u } from "./parse-styles-DLe1Dr-N.js";
5
5
  import { e as g } from "./element-factory-uEk4VrqP.js";
6
6
  const y = (e) => Object.keys(e);
7
7
  class f {
@@ -1,7 +0,0 @@
1
- "use strict";const V=require("./dash-case-B_odFlTl.cjs"),E=r=>String.fromCharCode(r+(r>25?39:97)),P=(r,s)=>{let t="",n;for(n=Math.abs(r);n>52;n=n/52|0)t=E(n%52)+t;return t=E(n%52)+t,t.length<s?t=t.padStart(s,"a"):t.length>s&&(t=t.slice(-s)),t},T=(r,s)=>{let t=s.length;for(;t;)r=r*33^s.charCodeAt(--t);return r},W=(r,s=3)=>{const t=T(5381,JSON.stringify(r))>>>0;return P(t,s)},q=(r,s)=>{if(typeof r!="string")return{result:r};if(!s)return{result:r};const t=[];return Object.values(s).forEach(n=>{const{pattern:p,transform:$}=n;r=r.replace(p,d=>{const{value:i,css:l}=$(d);return l&&t.push(l),i})}),{result:r,additionalCss:t}},M=r=>typeof r!="string"?{result:r}:/\{[^{}]+\}/g.test(r)?{result:r.replace(/\{([^{}]+)\}/g,(...n)=>`var(--${V.dashCase(n[1].replaceAll(".","-"))})`)}:{result:r},a=(r,s,t,n)=>{if(!r)return"";const p=[],$=Object.entries(r).reduce((i,[l,e])=>{const o=l.trim();if(typeof e=="function"&&(e=e()),typeof e=="object"){if(!e)return i;if(o==="variants")return Object.entries(e).forEach(([f,c])=>{c&&Object.entries(c).forEach(([m,b])=>{if(!b)return;const S=`${s}.${f}-${m}`,j=a(b,S,t);p.push(j)})}),i;if(o==="defaultVariants")return i;if(o==="compoundVariants")return e.forEach(f=>{const{css:c,...m}=f,b=Object.entries(m).reduce((j,[H,N])=>`${j}.${H}-${N}`,s),S=a(c,b,t);p.push(S)}),i;if(o.startsWith("@")){const f=a(e,s,t),c=`${o} {
2
- ${f.replace(`
3
- `,`
4
- `)}
5
- }`;return p.push(c),i}const u=l.includes("&")?o.replace("&",s):o.startsWith(":")?`${s}${o}`:`${s} ${o}`,h=a(e,u,t);return p.push(h),i}if(n!=null&&n.templates&&n.templates[o]){const h=e.split(".").reduce((c,m)=>c[m],n.templates[o]),f=a(h,"");return`${i}${f}`}const g=o.startsWith("-")?o:V.dashCase(o),y=(u,h=";")=>i=`${i}${u}${h}`,O=u=>y(`${g}:${u}`);if(typeof e=="number")return O(e);if(typeof e!="string")if("toString"in e)e=e.toString();else return i;const{modifiers:A}=n||{},k=function*(){yield M(e),yield q(e,A)}();for(const{result:u,additionalCss:h=[]}of k)e=u,h.forEach(f=>{const c=a(f,"");y(c,"")});return O(e)},"");if(!$)return p.join(`
6
- `);if(!s)return $;let d="";return t!==void 0?d=`@layer l${t} { ${s} { ${$} } }`:d=`${s} { ${$} }`,[d,...p].join(`
7
- `)};exports.parseStyles=a;exports.toHash=W;