@salty-css/react 0.0.1-alpha.130 → 0.0.1-alpha.132

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-CyIjlKB3.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-D6baBDwH.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-CjyvxVJD.js";
1
+ import { t as j, p as m } from "./parse-styles-il2AlFcl.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.130",
3
+ "version": "0.0.1-alpha.132",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "typings": "./dist/index.d.ts",
@@ -46,7 +46,7 @@
46
46
  }
47
47
  },
48
48
  "dependencies": {
49
- "@salty-css/core": "^0.0.1-alpha.130",
49
+ "@salty-css/core": "^0.0.1-alpha.132",
50
50
  "clsx": ">=2.x",
51
51
  "react": ">=19.x || >=18.3.x"
52
52
  }
@@ -0,0 +1,7 @@
1
+ "use strict";const E=require("./parse-tokens-p68muVgG.cjs"),V=e=>String.fromCharCode(e+(e>25?39:97)),T=(e,r)=>{let t="",n;for(n=Math.abs(e);n>52;n=n/52|0)t=V(n%52)+t;return t=V(n%52)+t,t.length<r?t=t.padStart(r,"a"):t.length>r&&(t=t.slice(-r)),t},W=(e,r)=>{let t=r.length;for(;t;)e=e*33^r.charCodeAt(--t);return e},k=(e,r=5)=>{const t=W(5381,JSON.stringify(e))>>>0;return T(t,r)},q=(e,r)=>{if(typeof e!="string")return{result:e};if(!r)return{result:e};const t=[];return Object.values(r).forEach(n=>{const{pattern:c,transform:a}=n;e=e.replace(c,d=>{const{value:i,css:m}=a(d);return m&&t.push(m),i})}),{result:e,additionalCss:t}},$=(e,r,t,n)=>{if(!e)return"";const c=[],a=Object.entries(e).reduce((i,[m,s])=>{const o=m.trim();if(typeof s=="function"&&(s=s()),typeof s=="object"){if(!s)return i;if(o==="variants")return Object.entries(s).forEach(([p,f])=>{f&&Object.entries(f).forEach(([l,b])=>{if(!b)return;const S=`${r}.${p}-${l}`,j=$(b,S,t,n);c.push(j)})}),i;if(o==="defaultVariants")return i;if(o==="compoundVariants")return s.forEach(p=>{const{css:f,...l}=p,b=Object.entries(l).reduce((j,[N,P])=>`${j}.${N}-${P}`,r),S=$(f,b,t,n);c.push(S)}),i;if(o.startsWith("@")){const p=$(s,r,t,n),f=`${o} {
2
+ ${p.replace(`
3
+ `,`
4
+ `)}
5
+ }`;return c.push(f),i}const u=m.includes("&")?o.replace("&",r):o.startsWith(":")?`${r}${o}`:`${r} ${o}`,h=$(s,u,t,n);return c.push(h),i}if(n!=null&&n.templates&&n.templates[o]){const h=s.split(".").reduce((p,f)=>p[f],n.templates[o]);if(h){const p=$(h,"");return`${i}${p}`}return console.warn(`Template "${o}" with path of "${s}" was not found in config!`),i}const w=o.startsWith("-")?o:E.dashCase(o),y=(u,h=";")=>i=`${i}${u}${h}`,O=u=>y(`${w}:${u}`);if(typeof s=="number")return O(s);if(typeof s!="string")if("toString"in s)s=s.toString();else return i;const{modifiers:A}=n||{},H=function*(){yield E.parseValueTokens(s),yield q(s,A)}();for(const{result:u,additionalCss:h=[]}of H)s=u,h.forEach(p=>{const f=$(p,"");y(f,"")});return O(s)},"");if(!a)return c.join(`
6
+ `);if(!r)return a;let d="";return t!==void 0?d=`@layer l${t} { ${r} { ${a} } }`:d=`${r} { ${a} }`,[d,...c].join(`
7
+ `)};exports.parseStyles=$;exports.toHash=k;
@@ -1,16 +1,16 @@
1
- import { d as W, p as g } from "./parse-tokens-YUi047xd.js";
2
- const E = (e) => String.fromCharCode(e + (e > 25 ? 39 : 97)), H = (e, r) => {
1
+ import { d as W, p as H } from "./parse-tokens-YUi047xd.js";
2
+ const E = (e) => String.fromCharCode(e + (e > 25 ? 39 : 97)), M = (e, r) => {
3
3
  let t = "", n;
4
4
  for (n = Math.abs(e); n > 52; n = n / 52 | 0) t = E(n % 52) + t;
5
5
  return t = E(n % 52) + t, t.length < r ? t = t.padStart(r, "a") : t.length > r && (t = t.slice(-r)), t;
6
- }, M = (e, r) => {
6
+ }, T = (e, r) => {
7
7
  let t = r.length;
8
8
  for (; t; ) e = e * 33 ^ r.charCodeAt(--t);
9
9
  return e;
10
- }, x = (e, r = 5) => {
11
- const t = M(5381, JSON.stringify(e)) >>> 0;
12
- return H(t, r);
13
- }, T = (e, r) => {
10
+ }, J = (e, r = 5) => {
11
+ const t = T(5381, JSON.stringify(e)) >>> 0;
12
+ return M(t, r);
13
+ }, k = (e, r) => {
14
14
  if (typeof e != "string") return { result: e };
15
15
  if (!r) return { result: e };
16
16
  const t = [];
@@ -31,7 +31,7 @@ const E = (e) => String.fromCharCode(e + (e > 25 ? 39 : 97)), H = (e, r) => {
31
31
  return Object.entries(s).forEach(([p, f]) => {
32
32
  f && Object.entries(f).forEach(([j, b]) => {
33
33
  if (!b) return;
34
- const l = `${r}.${p}-${j}`, S = a(b, l, t);
34
+ const l = `${r}.${p}-${j}`, S = a(b, l, t, n);
35
35
  c.push(S);
36
36
  });
37
37
  }), i;
@@ -39,18 +39,18 @@ const E = (e) => String.fromCharCode(e + (e > 25 ? 39 : 97)), H = (e, r) => {
39
39
  return i;
40
40
  if (o === "compoundVariants")
41
41
  return s.forEach((p) => {
42
- const { css: f, ...j } = p, b = Object.entries(j).reduce((S, [N, P]) => `${S}.${N}-${P}`, r), l = a(f, b, t);
42
+ const { css: f, ...j } = p, b = Object.entries(j).reduce((S, [N, P]) => `${S}.${N}-${P}`, r), l = a(f, b, t, n);
43
43
  c.push(l);
44
44
  }), i;
45
45
  if (o.startsWith("@")) {
46
- const p = a(s, r, t), f = `${o} {
46
+ const p = a(s, r, t, n), f = `${o} {
47
47
  ${p.replace(`
48
48
  `, `
49
49
  `)}
50
50
  }`;
51
51
  return c.push(f), i;
52
52
  }
53
- const u = m.includes("&") ? o.replace("&", r) : o.startsWith(":") ? `${r}${o}` : `${r} ${o}`, h = a(s, u, t);
53
+ const u = m.includes("&") ? o.replace("&", r) : o.startsWith(":") ? `${r}${o}` : `${r} ${o}`, h = a(s, u, t, n);
54
54
  return c.push(h), i;
55
55
  }
56
56
  if (n != null && n.templates && n.templates[o]) {
@@ -67,7 +67,7 @@ const E = (e) => String.fromCharCode(e + (e > 25 ? 39 : 97)), H = (e, r) => {
67
67
  if ("toString" in s) s = s.toString();
68
68
  else return i;
69
69
  const { modifiers: w } = n || {}, A = function* () {
70
- yield g(s), yield T(s, w);
70
+ yield H(s), yield k(s, w);
71
71
  }();
72
72
  for (const { result: u, additionalCss: h = [] } of A)
73
73
  s = u, h.forEach((p) => {
@@ -85,5 +85,5 @@ const E = (e) => String.fromCharCode(e + (e > 25 ? 39 : 97)), H = (e, r) => {
85
85
  };
86
86
  export {
87
87
  a as p,
88
- x as t
88
+ J as t
89
89
  };
package/styled.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var y=Object.defineProperty;var g=(e,t,s)=>t in e?y(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var c=(e,t,s)=>g(e,typeof t!="symbol"?t+"":t,s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./parse-styles-CyIjlKB3.cjs"),f=require("./parse-tokens-p68muVgG.cjs"),N=require("./element-factory-D4kpeFoW.cjs"),_=e=>Object.keys(e);class b{constructor(t,s){c(this,"_isProd");c(this,"_callerName");c(this,"_context");this.tagName=t,this.params=s}get hash(){return d.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 cssFileName(){return this._callerName?`c_${f.dashCase(this._callerName)}-${this.hash}-${this.priority}.css`:`${this.hash}-${this.priority}.css`}get templateKeys(){var t;return(t=this._context)!=null&&t.config.templates?_(this._context.config.templates):[]}get css(){var n;const{base:t={},variants:s={},compoundVariants:r=[]}=this.params,i={...t,variants:s,compoundVariants:r};return d.parseStyles(i,`.${this.cssClassName}`,this.priority,(n=this._context)==null?void 0:n.config)}get props(){const{element:t,variants:s={},compoundVariants:r=[],defaultVariants:i={},defaultProps:n={},passProps:u}=this.params,h=new Set([]),p=a=>{const o=i[a];o!==void 0?h.add(`${a}=${String(o)}`):h.add(a)};Object.keys(s).forEach(p),r.map(a=>Object.keys(a).forEach(p));const l=new Set([]);if(this.params.base){const a=JSON.stringify(this.params.base).match(/\{props\.([\w\d]+)\}/gi);a&&a.forEach(o=>{const m=o.replace(/\{props\.([\w\d]+)\}/gi,"$1");m&&l.add(m)})}return{element:t,variantKeys:[...h],propValueKeys:[...l],passProps:u,defaultProps:n,attr:{"data-component-name":this._isProd?void 0:this._callerName}}}_withBuildContext(t){this._context=t;const{name:s,config:r,prod:i}=t;return this._isProd=i,this._callerName=s,this}}const $=(e,t)=>{const s=new b(e,t),r=N.elementFactory(e,s.cssClassName,s.props,{"data-unoptimized-client-component":!0});return Object.assign(r,{generator:s}),r};exports.styled=$;
1
+ "use strict";var y=Object.defineProperty;var g=(e,t,s)=>t in e?y(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var c=(e,t,s)=>g(e,typeof t!="symbol"?t+"":t,s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./parse-styles-D6baBDwH.cjs"),f=require("./parse-tokens-p68muVgG.cjs"),N=require("./element-factory-D4kpeFoW.cjs"),_=e=>Object.keys(e);class b{constructor(t,s){c(this,"_isProd");c(this,"_callerName");c(this,"_context");this.tagName=t,this.params=s}get hash(){return d.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 cssFileName(){return this._callerName?`c_${f.dashCase(this._callerName)}-${this.hash}-${this.priority}.css`:`${this.hash}-${this.priority}.css`}get templateKeys(){var t;return(t=this._context)!=null&&t.config.templates?_(this._context.config.templates):[]}get css(){var n;const{base:t={},variants:s={},compoundVariants:r=[]}=this.params,i={...t,variants:s,compoundVariants:r};return d.parseStyles(i,`.${this.cssClassName}`,this.priority,(n=this._context)==null?void 0:n.config)}get props(){const{element:t,variants:s={},compoundVariants:r=[],defaultVariants:i={},defaultProps:n={},passProps:u}=this.params,h=new Set([]),p=a=>{const o=i[a];o!==void 0?h.add(`${a}=${String(o)}`):h.add(a)};Object.keys(s).forEach(p),r.map(a=>Object.keys(a).forEach(p));const l=new Set([]);if(this.params.base){const a=JSON.stringify(this.params.base).match(/\{props\.([\w\d]+)\}/gi);a&&a.forEach(o=>{const m=o.replace(/\{props\.([\w\d]+)\}/gi,"$1");m&&l.add(m)})}return{element:t,variantKeys:[...h],propValueKeys:[...l],passProps:u,defaultProps:n,attr:{"data-component-name":this._isProd?void 0:this._callerName}}}_withBuildContext(t){this._context=t;const{name:s,config:r,prod:i}=t;return this._isProd=i,this._callerName=s,this}}const $=(e,t)=>{const s=new b(e,t),r=N.elementFactory(e,s.cssClassName,s.props,{"data-unoptimized-client-component":!0});return Object.assign(r,{generator:s}),r};exports.styled=$;
package/styled.js CHANGED
@@ -1,7 +1,7 @@
1
1
  var u = Object.defineProperty;
2
2
  var f = (e, t, s) => t in e ? u(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
3
3
  var c = (e, t, s) => f(e, typeof t != "symbol" ? t + "" : t, s);
4
- import { t as y, p as g } from "./parse-styles-CjyvxVJD.js";
4
+ import { t as y, p as g } from "./parse-styles-il2AlFcl.js";
5
5
  import { d as N } from "./parse-tokens-YUi047xd.js";
6
6
  import { e as _ } from "./element-factory-C7JVLDq7.js";
7
7
  const $ = (e) => Object.keys(e);
@@ -1,7 +0,0 @@
1
- "use strict";const E=require("./parse-tokens-p68muVgG.cjs"),V=e=>String.fromCharCode(e+(e>25?39:97)),T=(e,r)=>{let t="",n;for(n=Math.abs(e);n>52;n=n/52|0)t=V(n%52)+t;return t=V(n%52)+t,t.length<r?t=t.padStart(r,"a"):t.length>r&&(t=t.slice(-r)),t},W=(e,r)=>{let t=r.length;for(;t;)e=e*33^r.charCodeAt(--t);return e},g=(e,r=5)=>{const t=W(5381,JSON.stringify(e))>>>0;return T(t,r)},k=(e,r)=>{if(typeof e!="string")return{result:e};if(!r)return{result:e};const t=[];return Object.values(r).forEach(n=>{const{pattern:c,transform:a}=n;e=e.replace(c,d=>{const{value:i,css:m}=a(d);return m&&t.push(m),i})}),{result:e,additionalCss:t}},$=(e,r,t,n)=>{if(!e)return"";const c=[],a=Object.entries(e).reduce((i,[m,s])=>{const o=m.trim();if(typeof s=="function"&&(s=s()),typeof s=="object"){if(!s)return i;if(o==="variants")return Object.entries(s).forEach(([p,f])=>{f&&Object.entries(f).forEach(([l,b])=>{if(!b)return;const S=`${r}.${p}-${l}`,j=$(b,S,t);c.push(j)})}),i;if(o==="defaultVariants")return i;if(o==="compoundVariants")return s.forEach(p=>{const{css:f,...l}=p,b=Object.entries(l).reduce((j,[N,P])=>`${j}.${N}-${P}`,r),S=$(f,b,t);c.push(S)}),i;if(o.startsWith("@")){const p=$(s,r,t),f=`${o} {
2
- ${p.replace(`
3
- `,`
4
- `)}
5
- }`;return c.push(f),i}const u=m.includes("&")?o.replace("&",r):o.startsWith(":")?`${r}${o}`:`${r} ${o}`,h=$(s,u,t);return c.push(h),i}if(n!=null&&n.templates&&n.templates[o]){const h=s.split(".").reduce((p,f)=>p[f],n.templates[o]);if(h){const p=$(h,"");return`${i}${p}`}return console.warn(`Template "${o}" with path of "${s}" was not found in config!`),i}const w=o.startsWith("-")?o:E.dashCase(o),y=(u,h=";")=>i=`${i}${u}${h}`,O=u=>y(`${w}:${u}`);if(typeof s=="number")return O(s);if(typeof s!="string")if("toString"in s)s=s.toString();else return i;const{modifiers:A}=n||{},H=function*(){yield E.parseValueTokens(s),yield k(s,A)}();for(const{result:u,additionalCss:h=[]}of H)s=u,h.forEach(p=>{const f=$(p,"");y(f,"")});return O(s)},"");if(!a)return c.join(`
6
- `);if(!r)return a;let d="";return t!==void 0?d=`@layer l${t} { ${r} { ${a} } }`:d=`${r} { ${a} }`,[d,...c].join(`
7
- `)};exports.parseStyles=$;exports.toHash=g;