@salty-css/react 0.0.1-alpha.115 → 0.0.1-alpha.116

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 +1 @@
1
- "use strict";const K=require("react"),$=require("./parse-tokens-CRGUYhKC.cjs");function w(n){var s,e,t="";if(typeof n=="string"||typeof n=="number")t+=n;else if(typeof n=="object")if(Array.isArray(n)){var l=n.length;for(s=0;s<l;s++)n[s]&&(e=w(n[s]))&&(t&&(t+=" "),t+=e)}else for(e in n)n[e]&&(t&&(t+=" "),t+=e);return t}function q(){for(var n,s,e=0,t="",l=arguments.length;e<l;e++)(n=arguments[e])&&(s=w(n))&&(t&&(t+=" "),t+=s);return t}const A=["passVariantProps"],F=(n,s,e,t)=>{const l=({extend:o=n,element:S=e.element,className:O="",children:g,passVariantProps:d,_vks:c=new Set,...u},C)=>{const f={passVariantProps:d};e.attr&&Object.assign(f,e.attr),t&&Object.assign(f,t),u&&Object.assign(f,u);const b=new Set(O.split(" ")),y=typeof o=="function"||typeof o=="object",h=y&&"isStyled"in o,E=y?o:S||o;if(!E)throw new Error("No element provided");const m=f.style||{};f.style||(f.style=m),Object.entries(m).forEach(([i,r])=>{const{result:a}=$.parseValueTokens(r);m[i]=a}),e.propValueKeys&&e.propValueKeys.forEach(i=>{const r=`css-${i}`,a=u[r];if(a===void 0)return;const N=`--props-${$.dashCase(i)}`;m[N]=a,c&&c.add(r)}),e.variantKeys&&e.variantKeys.forEach(i=>{const[r,a]=i.split("=");u[r]!==void 0?(b.add(`${r}-${u[r]}`),c&&c.add(r)):a!==void 0&&b.add(`${r}-${a}`)}),c&&(!y||!h)?c.forEach(i=>{if(!d)return delete f[i];if(d!==!0&&!d.includes(i))return delete f[i]}):h&&Object.assign(f,{_vks:c}),h||A.forEach(i=>delete f[i]);const V=q(s,...b);return K.createElement(E,{element:y?S:void 0,className:V,ref:C,...f},g)},j=K.forwardRef(l);return Object.assign(j,{isStyled:!0,className:s,toString:()=>`.${s}`}),j};exports.elementFactory=F;
1
+ "use strict";const K=require("react"),$=require("./parse-tokens-p68muVgG.cjs");function w(n){var s,e,t="";if(typeof n=="string"||typeof n=="number")t+=n;else if(typeof n=="object")if(Array.isArray(n)){var l=n.length;for(s=0;s<l;s++)n[s]&&(e=w(n[s]))&&(t&&(t+=" "),t+=e)}else for(e in n)n[e]&&(t&&(t+=" "),t+=e);return t}function q(){for(var n,s,e=0,t="",l=arguments.length;e<l;e++)(n=arguments[e])&&(s=w(n))&&(t&&(t+=" "),t+=s);return t}const A=["passVariantProps"],F=(n,s,e,t)=>{const l=({extend:o=n,element:S=e.element,className:O="",children:g,passVariantProps:d,_vks:c=new Set,...u},C)=>{const f={passVariantProps:d};e.attr&&Object.assign(f,e.attr),t&&Object.assign(f,t),u&&Object.assign(f,u);const b=new Set(O.split(" ")),y=typeof o=="function"||typeof o=="object",h=y&&"isStyled"in o,E=y?o:S||o;if(!E)throw new Error("No element provided");const m=f.style||{};f.style||(f.style=m),Object.entries(m).forEach(([i,r])=>{const{result:a}=$.parseValueTokens(r);m[i]=a}),e.propValueKeys&&e.propValueKeys.forEach(i=>{const r=`css-${i}`,a=u[r];if(a===void 0)return;const N=`--props-${$.dashCase(i)}`;m[N]=a,c&&c.add(r)}),e.variantKeys&&e.variantKeys.forEach(i=>{const[r,a]=i.split("=");u[r]!==void 0?(b.add(`${r}-${u[r]}`),c&&c.add(r)):a!==void 0&&b.add(`${r}-${a}`)}),c&&(!y||!h)?c.forEach(i=>{if(!d)return delete f[i];if(d!==!0&&!d.includes(i))return delete f[i]}):h&&Object.assign(f,{_vks:c}),h||A.forEach(i=>delete f[i]);const V=q(s,...b);return K.createElement(E,{element:y?S:void 0,className:V,ref:C,...f},g)},j=K.forwardRef(l);return Object.assign(j,{isStyled:!0,className:s,toString:()=>`.${s}`}),j};exports.elementFactory=F;
@@ -1,5 +1,5 @@
1
1
  import { forwardRef as C, createElement as V } from "react";
2
- import { p as N, d as A } from "./parse-tokens-DAW55Na6.js";
2
+ import { p as N, d as A } from "./parse-tokens-YUi047xd.js";
3
3
  function K(n) {
4
4
  var s, e, t = "";
5
5
  if (typeof n == "string" || typeof n == "number") t += n;
package/keyframes.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./parse-styles-DjwCLt3X.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-C52S0WXA.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-CVYekczt.js";
1
+ import { t as j, p as m } from "./parse-styles-b5rqGu2w.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.115",
3
+ "version": "0.0.1-alpha.116",
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.115",
49
+ "@salty-css/core": "^0.0.1-alpha.116",
50
50
  "clsx": ">=2.x",
51
51
  "react": ">=19.x || >=18.3.x"
52
52
  }
@@ -1,4 +1,4 @@
1
- "use strict";const E=require("./parse-tokens-CRGUYhKC.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=3)=>{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} {
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=3)=>{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
2
  ${p.replace(`
3
3
  `,`
4
4
  `)}
@@ -1,4 +1,4 @@
1
- import { d as W, p as g } from "./parse-tokens-DAW55Na6.js";
1
+ import { d as W, p as g } from "./parse-tokens-YUi047xd.js";
2
2
  const E = (e) => String.fromCharCode(e + (e > 25 ? 39 : 97)), H = (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;
@@ -1,5 +1,5 @@
1
1
  function n(e) {
2
- return e ? typeof e != "string" ? n(String(e)) : e.replace(/\s/g, "-").replace(/[A-Z](?:(?=[^A-Z])|[A-Z]*(?=[A-Z][^A-Z]|$))/g, (r, t) => (t > 0 ? "-" : "") + r.toLowerCase()) : "";
2
+ return e ? typeof e != "string" ? n(String(e)) : e.replace(/[\s.]/g, "-").replace(/[A-Z](?:(?=[^A-Z])|[A-Z]*(?=[A-Z][^A-Z]|$))/g, (r, t) => (t > 0 ? "-" : "") + r.toLowerCase()) : "";
3
3
  }
4
4
  const o = (e) => typeof e != "string" ? { result: e } : /\{[^{}]+\}/g.test(e) ? { result: e.replace(/\{([^{}]+)\}/g, (...s) => `var(--${n(s[1].replaceAll(".", "-"))})`) } : { result: e };
5
5
  export {
@@ -0,0 +1 @@
1
+ "use strict";function r(e){return e?typeof e!="string"?r(String(e)):e.replace(/[\s.]/g,"-").replace(/[A-Z](?:(?=[^A-Z])|[A-Z]*(?=[A-Z][^A-Z]|$))/g,(t,s)=>(s>0?"-":"")+t.toLowerCase()):""}const a=e=>typeof e!="string"?{result:e}:/\{[^{}]+\}/g.test(e)?{result:e.replace(/\{([^{}]+)\}/g,(...n)=>`var(--${r(n[1].replaceAll(".","-"))})`)}:{result:e};exports.dashCase=r;exports.parseValueTokens=a;
package/styled-client.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./element-factory-oJLHawcF.cjs"),n=(e,t,r)=>l.elementFactory(e,t,r);exports.styledClient=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./element-factory-BOcdTbTj.cjs"),n=(e,t,r)=>l.elementFactory(e,t,r);exports.styledClient=n;
package/styled-client.js CHANGED
@@ -1,4 +1,4 @@
1
- import { e as o } from "./element-factory-CsNOsWc4.js";
1
+ import { e as o } from "./element-factory-CKdPyEh1.js";
2
2
  const l = (e, t, r) => o(e, t, r);
3
3
  export {
4
4
  l as styledClient
package/styled.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var y=Object.defineProperty;var g=(s,t,e)=>t in s?y(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e;var o=(s,t,e)=>g(s,typeof t!="symbol"?t+"":t,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./parse-styles-DjwCLt3X.cjs"),f=require("./element-factory-oJLHawcF.cjs"),N=s=>Object.keys(s);class _{constructor(t,e){o(this,"_isProd");o(this,"_callerName");o(this,"_context");this.tagName=t,this.params=e}get hash(){return u.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:e}=this.params;return e&&t.push(e),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?N(this._context.config.templates):[]}get css(){var r;const{base:t={},variants:e={},compoundVariants:a=[]}=this.params,i={...t,variants:e,compoundVariants:a};return u.parseStyles(i,`.${this.cssClassName}`,this.priority,(r=this._context)==null?void 0:r.config)}get props(){const{element:t,variants:e={},compoundVariants:a=[],defaultVariants:i={}}=this.params,r=new Set([]),p=n=>{const c=i[n];c!==void 0?r.add(`${n}=${String(c)}`):r.add(n)};Object.keys(e).forEach(p),a.map(n=>Object.keys(n).forEach(p));const h=new Set([]),l=/\{props\.([\w\d]+)\}/gi.exec(JSON.stringify(this.params.base));return l&&l.forEach((n,c,d)=>{const m=d.at(1);m&&h.add(m)}),{element:t,variantKeys:[...r],propValueKeys:[...h],attr:{"data-component-name":this._isProd?void 0:this._callerName}}}_withBuildContext(t){this._context=t;const{name:e,config:a,prod:i}=t;return this._isProd=i,this._callerName=e,this}}const b=(s,t)=>{const e=new _(s,t),a=f.elementFactory(s,e.cssClassName,e.props,{"data-unoptimized-client-component":!0});return Object.assign(a,{generator:e}),a};exports.styled=b;
1
+ "use strict";var y=Object.defineProperty;var g=(s,t,e)=>t in s?y(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e;var o=(s,t,e)=>g(s,typeof t!="symbol"?t+"":t,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./parse-styles-C52S0WXA.cjs"),f=require("./element-factory-BOcdTbTj.cjs"),N=s=>Object.keys(s);class _{constructor(t,e){o(this,"_isProd");o(this,"_callerName");o(this,"_context");this.tagName=t,this.params=e}get hash(){return u.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:e}=this.params;return e&&t.push(e),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?N(this._context.config.templates):[]}get css(){var r;const{base:t={},variants:e={},compoundVariants:a=[]}=this.params,i={...t,variants:e,compoundVariants:a};return u.parseStyles(i,`.${this.cssClassName}`,this.priority,(r=this._context)==null?void 0:r.config)}get props(){const{element:t,variants:e={},compoundVariants:a=[],defaultVariants:i={}}=this.params,r=new Set([]),p=n=>{const c=i[n];c!==void 0?r.add(`${n}=${String(c)}`):r.add(n)};Object.keys(e).forEach(p),a.map(n=>Object.keys(n).forEach(p));const h=new Set([]),l=/\{props\.([\w\d]+)\}/gi.exec(JSON.stringify(this.params.base));return l&&l.forEach((n,c,d)=>{const m=d.at(1);m&&h.add(m)}),{element:t,variantKeys:[...r],propValueKeys:[...h],attr:{"data-component-name":this._isProd?void 0:this._callerName}}}_withBuildContext(t){this._context=t;const{name:e,config:a,prod:i}=t;return this._isProd=i,this._callerName=e,this}}const b=(s,t)=>{const e=new _(s,t),a=f.elementFactory(s,e.cssClassName,e.props,{"data-unoptimized-client-component":!0});return Object.assign(a,{generator:e}),a};exports.styled=b;
package/styled.js CHANGED
@@ -1,8 +1,8 @@
1
1
  var u = Object.defineProperty;
2
2
  var y = (e, t, s) => t in e ? u(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
3
3
  var o = (e, t, s) => y(e, typeof t != "symbol" ? t + "" : t, s);
4
- import { t as f, p as g } from "./parse-styles-CVYekczt.js";
5
- import { e as N } from "./element-factory-CsNOsWc4.js";
4
+ import { t as f, p as g } from "./parse-styles-b5rqGu2w.js";
5
+ import { e as N } from "./element-factory-CKdPyEh1.js";
6
6
  const _ = (e) => Object.keys(e);
7
7
  class b {
8
8
  constructor(t, s) {
@@ -1 +0,0 @@
1
- "use strict";function r(e){return e?typeof e!="string"?r(String(e)):e.replace(/\s/g,"-").replace(/[A-Z](?:(?=[^A-Z])|[A-Z]*(?=[A-Z][^A-Z]|$))/g,(t,s)=>(s>0?"-":"")+t.toLowerCase()):""}const a=e=>typeof e!="string"?{result:e}:/\{[^{}]+\}/g.test(e)?{result:e.replace(/\{([^{}]+)\}/g,(...n)=>`var(--${r(n[1].replaceAll(".","-"))})`)}:{result:e};exports.dashCase=r;exports.parseValueTokens=a;