@salty-css/core 0.0.1-alpha.296 → 0.0.1-alpha.298

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.
@@ -4,7 +4,7 @@ import { t as K, d as U } from "./dash-case-DBThphLm.js";
4
4
  import { join as i, parse as tt } from "path";
5
5
  import { existsSync as ft, mkdirSync as H, statSync as Ot, readdirSync as Mt, readFileSync as _, writeFileSync as P } from "fs";
6
6
  import { readFile as Ft } from "fs/promises";
7
- import { p as bt, a as Rt } from "./parse-styles-CPuIGA08.js";
7
+ import { p as bt, a as Rt } from "./parse-styles-y_-drahL.js";
8
8
  import { parseTemplates as Jt, getTemplateTypes as zt } from "./parsers/index.js";
9
9
  import { createLogger as Wt, transports as Gt, format as rt } from "winston";
10
10
  import { mergeObjects as I, mergeFactories as Ht } from "./css/merge.js";
@@ -1,4 +1,4 @@
1
- "use strict";const Oe=require("esbuild"),Ee=require("child_process"),_=require("./dash-case-BJEkFEGQ.cjs"),i=require("path"),c=require("fs"),je=require("fs/promises"),ce=require("./parse-styles-CIRNw7l_.cjs"),we=require("./parsers/index.cjs"),B=require("winston"),q=require("./css/merge.cjs"),Ve=require("./define-templates-Cunsb_Tr.cjs"),re=require("typescript"),Z=require("./helpers-CC5pFyba.cjs");var le=typeof document<"u"?document.currentScript:null;function Re(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const n=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,n.get?n:{enumerable:!0,get:()=>e[s]})}}return t.default=e,Object.freeze(t)}const be=Re(Oe),Fe=e=>{if(!e||e==="/")throw new Error("Could not find package.json file");const t=i.join(e,"package.json");return c.existsSync(t)?t:Fe(i.join(e,".."))},Me=async e=>{const t=Fe(e);return await je.readFile(t,"utf-8").then(JSON.parse).catch(()=>{})},Je=async e=>{const t=await Me(e);if(t)return t.type};let W;const $e=async e=>{if(W)return W;const t=await Je(e);return t==="module"?W="esm":(t==="commonjs"||(typeof document>"u"?require("url").pathToFileURL(__filename).href:le&&le.tagName.toUpperCase()==="SCRIPT"&&le.src||new URL("index-D0QitXLT.cjs",document.baseURI).href).endsWith(".cjs"))&&(W="cjs"),W||"esm"},U=B.createLogger({level:"debug",format:B.format.combine(B.format.colorize(),B.format.cli()),transports:[new B.transports.Console({})]}),qe=e=>{U.error(e)};function Ce(e){return e?typeof e!="string"?Ce(String(e)):e.replace(/[^\d\w]/g,"."):""}const ze={"*, *::before, *::after":{boxSizing:"border-box"},"*":{margin:0},html:{lineHeight:1.15,textSizeAdjust:"100%",WebkitFontSmoothing:"antialiased"},"img, picture, video, canvas, svg":{display:"block",maxWidth:"100%"},"p, h1, h2, h3, h4, h5, h6":{overflowWrap:"break-word"},p:{textWrap:"pretty"},"h1, h2, h3, h4, h5, h6":{textWrap:"balance"},a:{color:"currentColor"},button:{lineHeight:"1em",color:"currentColor"},"input, optgroup, select, textarea":{fontFamily:"inherit",fontSize:"100%",lineHeight:"1.15em"}},He=(e,t)=>new Promise((s,n)=>{const r=setTimeout(()=>{n(new Error("Timeout"))},100),l=re.createSourceFile("temp.ts",e,re.ScriptTarget.Latest,!0);function o(m){if(re.isVariableDeclaration(m)&&m.name.getText()===t){const w=m.getStart(),F=m.getEnd();clearTimeout(r),s([w,F])}m.forEachChild(o)}o(l)}),E={externalModules:[],rcFile:void 0,destDir:void 0},Pe=e=>{if(E.externalModules.length>0)return E.externalModules;const s=c.readFileSync(e,"utf8").match(/externalModules:\s?\[(.*)\]/);if(!s)return[];const n=s[1].split(",").map(r=>r.replace(/['"`]/g,"").trim());return E.externalModules=n,n},z=async e=>{if(E.destDir)return E.destDir;const t=await ue(e),s=i.join(e,(t==null?void 0:t.saltygenDir)||"saltygen");return E.destDir=s,s},fe=["salty","css","styles","styled"],Ne=(e=[])=>new RegExp(`\\.(${[...fe,...e].join("|")})\\.`),ee=(e,t=[])=>Ne(t).test(e),xe=async e=>{if(E.rcFile)return E.rcFile;if(e==="/")throw new Error("Could not find .saltyrc.json file");const t=i.join(e,".saltyrc.json"),s=await je.readFile(t,"utf-8").then(JSON.parse).catch(()=>{});return s?(E.rcFile=s,s):xe(i.join(e,".."))},ue=async e=>{var n,r;const t=await xe(e),s=(n=t.projects)==null?void 0:n.find(l=>e.endsWith(l.dir||""));return s||((r=t.projects)==null?void 0:r.find(l=>l.dir===t.defaultProject))},We=async e=>{const t=await ue(e),s=await z(e),n=i.join(e,(t==null?void 0:t.configDir)||"","salty.config.ts"),r=i.join(s,"salty.config.js"),l=await $e(e),o=Pe(n);await be.build({entryPoints:[n],minify:!0,treeShaking:!0,bundle:!0,outfile:r,format:l,external:o});const m=Date.now(),{config:w}=await import(`${r}?t=${m}`);return{config:w,path:r}},ke=async(e,t)=>{var ye,ge;const s=await z(e),n={mediaQueries:[],globalStyles:[],variables:[],templates:[]};await Promise.all([...t].map(async h=>{const{contents:C,outputFilePath:L}=await A(e,h,s);Object.entries(C).forEach(([v,P])=>{P.isMedia?n.mediaQueries.push([v,P]):P.isGlobalDefine?n.globalStyles.push(P):P.isDefineVariables?n.variables.push(P):P.isDefineTemplates&&n.templates.push(P._setPath(`${v};;${L}`))})}));const{config:r,path:l}=await We(e),o={...r},{mediaQueries:m}=n;o.mediaQueries=Object.fromEntries(m.map(([h,C])=>[`@${h}`,C]));const w=m.map(([h])=>`'@${h}'`).join(" | "),F=new Set,a=async(h,C=[])=>{if(!h)return[];const L=Object.entries(h).map(async([P,J])=>{const Q=async D=>{if(!D)return;if(D instanceof Promise)return await Q(await D);if(typeof D=="function")return await Q(await D());if(typeof D=="object")return await a(D,[...C,P]);const oe=Ce(P),ie=_.dashCase(P),ae=[...C,oe].join(".");F.add(`"${ae}"`);const Y=[...C.map(_.dashCase),ie].join("-"),he=ce.parseVariableTokens(D);return he?`--${Y}: ${he.transformed};`:`--${Y}: ${D};`};return await Q(J)});return(await Promise.all(L)).flat()},p=async h=>{if(!h)return[];const C=Object.entries(h).map(async([v,P])=>{const J=await a(P);return v==="base"?J.join(""):o.mediaQueries[v]?`${o.mediaQueries[v]} { ${J.join("")} }`:`${v} { ${J.join("")} }`});return(await Promise.all(C)).flat()},d=async h=>{if(!h)return[];const C=Object.entries(h).map(async([v,P])=>{const J=Object.entries(P).map(async([D,oe])=>{const ie=await a(oe,[v]),ae=`.${v}-${D}, [data-${v}="${D}"]`,Y=ie.join("");return`${ae} { ${Y} }`});return(await Promise.all(J)).flat()});return(await Promise.all(C)).flat()},y=h=>({...h,responsive:void 0,conditional:void 0}),g=h=>n.variables.map(C=>h==="static"?y(C._current):C._current[h]),b=q.mergeObjects(y(r.variables),g("static")),k=await a(b),N=q.mergeObjects((ye=r.variables)==null?void 0:ye.responsive,g("responsive")),T=await p(N),V=q.mergeObjects((ge=r.variables)==null?void 0:ge.conditional,g("conditional")),H=await d(V),de=i.join(s,"css/_variables.css"),R=`:root { ${k.join("")} ${T.join("")} } ${H.join("")}`;c.writeFileSync(de,R),o.staticVariables=b;const te=i.join(s,"css/_global.css"),f=q.mergeObjects(r.global,n.globalStyles),S=await ce.parseAndJoinStyles(f,"");c.writeFileSync(te,`@layer global { ${S} }`);const $=i.join(s,"css/_reset.css"),j=r.reset==="none"?{}:typeof r.reset=="object"?r.reset:ze,x=await ce.parseAndJoinStyles(j,"");c.writeFileSync($,`@layer reset { ${x} }`);const O=i.join(s,"css/_templates.css"),M=q.mergeObjects(r.templates,n.templates),I=await we.parseTemplates(M),G=we.getTemplateTypes(M);c.writeFileSync(O,`@layer templates { ${I} }`),o.templates=M;const X=r.templates?[Ve.defineTemplates(r.templates)._setPath(`config;;${l}`)]:[],se=q.mergeFactories(n.templates,X);o.templatePaths=Object.fromEntries(Object.entries(se).map(([h,C])=>[h,C._path]));const K=i.join(s,"types/css-tokens.d.ts"),ve=`
1
+ "use strict";const Oe=require("esbuild"),Ee=require("child_process"),_=require("./dash-case-BJEkFEGQ.cjs"),i=require("path"),c=require("fs"),je=require("fs/promises"),ce=require("./parse-styles-B1E0JeC7.cjs"),we=require("./parsers/index.cjs"),B=require("winston"),q=require("./css/merge.cjs"),Ve=require("./define-templates-Cunsb_Tr.cjs"),re=require("typescript"),Z=require("./helpers-CC5pFyba.cjs");var le=typeof document<"u"?document.currentScript:null;function Re(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const n=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,n.get?n:{enumerable:!0,get:()=>e[s]})}}return t.default=e,Object.freeze(t)}const be=Re(Oe),Fe=e=>{if(!e||e==="/")throw new Error("Could not find package.json file");const t=i.join(e,"package.json");return c.existsSync(t)?t:Fe(i.join(e,".."))},Me=async e=>{const t=Fe(e);return await je.readFile(t,"utf-8").then(JSON.parse).catch(()=>{})},Je=async e=>{const t=await Me(e);if(t)return t.type};let W;const $e=async e=>{if(W)return W;const t=await Je(e);return t==="module"?W="esm":(t==="commonjs"||(typeof document>"u"?require("url").pathToFileURL(__filename).href:le&&le.tagName.toUpperCase()==="SCRIPT"&&le.src||new URL("index-DojP6pQJ.cjs",document.baseURI).href).endsWith(".cjs"))&&(W="cjs"),W||"esm"},U=B.createLogger({level:"debug",format:B.format.combine(B.format.colorize(),B.format.cli()),transports:[new B.transports.Console({})]}),qe=e=>{U.error(e)};function Ce(e){return e?typeof e!="string"?Ce(String(e)):e.replace(/[^\d\w]/g,"."):""}const ze={"*, *::before, *::after":{boxSizing:"border-box"},"*":{margin:0},html:{lineHeight:1.15,textSizeAdjust:"100%",WebkitFontSmoothing:"antialiased"},"img, picture, video, canvas, svg":{display:"block",maxWidth:"100%"},"p, h1, h2, h3, h4, h5, h6":{overflowWrap:"break-word"},p:{textWrap:"pretty"},"h1, h2, h3, h4, h5, h6":{textWrap:"balance"},a:{color:"currentColor"},button:{lineHeight:"1em",color:"currentColor"},"input, optgroup, select, textarea":{fontFamily:"inherit",fontSize:"100%",lineHeight:"1.15em"}},He=(e,t)=>new Promise((s,n)=>{const r=setTimeout(()=>{n(new Error("Timeout"))},100),l=re.createSourceFile("temp.ts",e,re.ScriptTarget.Latest,!0);function o(m){if(re.isVariableDeclaration(m)&&m.name.getText()===t){const w=m.getStart(),F=m.getEnd();clearTimeout(r),s([w,F])}m.forEachChild(o)}o(l)}),E={externalModules:[],rcFile:void 0,destDir:void 0},Pe=e=>{if(E.externalModules.length>0)return E.externalModules;const s=c.readFileSync(e,"utf8").match(/externalModules:\s?\[(.*)\]/);if(!s)return[];const n=s[1].split(",").map(r=>r.replace(/['"`]/g,"").trim());return E.externalModules=n,n},z=async e=>{if(E.destDir)return E.destDir;const t=await ue(e),s=i.join(e,(t==null?void 0:t.saltygenDir)||"saltygen");return E.destDir=s,s},fe=["salty","css","styles","styled"],Ne=(e=[])=>new RegExp(`\\.(${[...fe,...e].join("|")})\\.`),ee=(e,t=[])=>Ne(t).test(e),xe=async e=>{if(E.rcFile)return E.rcFile;if(e==="/")throw new Error("Could not find .saltyrc.json file");const t=i.join(e,".saltyrc.json"),s=await je.readFile(t,"utf-8").then(JSON.parse).catch(()=>{});return s?(E.rcFile=s,s):xe(i.join(e,".."))},ue=async e=>{var n,r;const t=await xe(e),s=(n=t.projects)==null?void 0:n.find(l=>e.endsWith(l.dir||""));return s||((r=t.projects)==null?void 0:r.find(l=>l.dir===t.defaultProject))},We=async e=>{const t=await ue(e),s=await z(e),n=i.join(e,(t==null?void 0:t.configDir)||"","salty.config.ts"),r=i.join(s,"salty.config.js"),l=await $e(e),o=Pe(n);await be.build({entryPoints:[n],minify:!0,treeShaking:!0,bundle:!0,outfile:r,format:l,external:o});const m=Date.now(),{config:w}=await import(`${r}?t=${m}`);return{config:w,path:r}},ke=async(e,t)=>{var ye,ge;const s=await z(e),n={mediaQueries:[],globalStyles:[],variables:[],templates:[]};await Promise.all([...t].map(async h=>{const{contents:C,outputFilePath:L}=await A(e,h,s);Object.entries(C).forEach(([v,P])=>{P.isMedia?n.mediaQueries.push([v,P]):P.isGlobalDefine?n.globalStyles.push(P):P.isDefineVariables?n.variables.push(P):P.isDefineTemplates&&n.templates.push(P._setPath(`${v};;${L}`))})}));const{config:r,path:l}=await We(e),o={...r},{mediaQueries:m}=n;o.mediaQueries=Object.fromEntries(m.map(([h,C])=>[`@${h}`,C]));const w=m.map(([h])=>`'@${h}'`).join(" | "),F=new Set,a=async(h,C=[])=>{if(!h)return[];const L=Object.entries(h).map(async([P,J])=>{const Q=async D=>{if(!D)return;if(D instanceof Promise)return await Q(await D);if(typeof D=="function")return await Q(await D());if(typeof D=="object")return await a(D,[...C,P]);const oe=Ce(P),ie=_.dashCase(P),ae=[...C,oe].join(".");F.add(`"${ae}"`);const Y=[...C.map(_.dashCase),ie].join("-"),he=ce.parseVariableTokens(D);return he?`--${Y}: ${he.transformed};`:`--${Y}: ${D};`};return await Q(J)});return(await Promise.all(L)).flat()},p=async h=>{if(!h)return[];const C=Object.entries(h).map(async([v,P])=>{const J=await a(P);return v==="base"?J.join(""):o.mediaQueries[v]?`${o.mediaQueries[v]} { ${J.join("")} }`:`${v} { ${J.join("")} }`});return(await Promise.all(C)).flat()},d=async h=>{if(!h)return[];const C=Object.entries(h).map(async([v,P])=>{const J=Object.entries(P).map(async([D,oe])=>{const ie=await a(oe,[v]),ae=`.${v}-${D}, [data-${v}="${D}"]`,Y=ie.join("");return`${ae} { ${Y} }`});return(await Promise.all(J)).flat()});return(await Promise.all(C)).flat()},y=h=>({...h,responsive:void 0,conditional:void 0}),g=h=>n.variables.map(C=>h==="static"?y(C._current):C._current[h]),b=q.mergeObjects(y(r.variables),g("static")),k=await a(b),N=q.mergeObjects((ye=r.variables)==null?void 0:ye.responsive,g("responsive")),T=await p(N),V=q.mergeObjects((ge=r.variables)==null?void 0:ge.conditional,g("conditional")),H=await d(V),de=i.join(s,"css/_variables.css"),R=`:root { ${k.join("")} ${T.join("")} } ${H.join("")}`;c.writeFileSync(de,R),o.staticVariables=b;const te=i.join(s,"css/_global.css"),f=q.mergeObjects(r.global,n.globalStyles),S=await ce.parseAndJoinStyles(f,"");c.writeFileSync(te,`@layer global { ${S} }`);const $=i.join(s,"css/_reset.css"),j=r.reset==="none"?{}:typeof r.reset=="object"?r.reset:ze,x=await ce.parseAndJoinStyles(j,"");c.writeFileSync($,`@layer reset { ${x} }`);const O=i.join(s,"css/_templates.css"),M=q.mergeObjects(r.templates,n.templates),I=await we.parseTemplates(M),G=we.getTemplateTypes(M);c.writeFileSync(O,`@layer templates { ${I} }`),o.templates=M;const X=r.templates?[Ve.defineTemplates(r.templates)._setPath(`config;;${l}`)]:[],se=q.mergeFactories(n.templates,X);o.templatePaths=Object.fromEntries(Object.entries(se).map(([h,C])=>[h,C._path]));const K=i.join(s,"types/css-tokens.d.ts"),ve=`
2
2
  // Variable types
3
3
  type VariableTokens = ${[...F].join("|")};
4
4
  type PropertyValueToken = \`{\${VariableTokens}}\`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salty-css/core",
3
- "version": "0.0.1-alpha.296",
3
+ "version": "0.0.1-alpha.298",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "typings": "./dist/index.d.ts",
@@ -0,0 +1,5 @@
1
+ "use strict";const x=require("./dash-case-BJEkFEGQ.cjs"),I=require("./viewport-clamp-mq_DFtRR.cjs"),U=o=>s=>{if(typeof s!="string"||!o)return;let t=s;const m=[];return Object.values(o).forEach(e=>{const{pattern:d,transform:f}=e;t=t.replace(d,E=>{const{value:S,css:P}=f(E);return P&&m.push(P),S})}),{transformed:t,additionalCss:m}},A=o=>s=>typeof s!="string"||!/\{[^{}]+\}/g.test(s)?void 0:{transformed:s.replace(/\{([^{}]+)\}/g,(...e)=>{const d=x.dashCase(e[1].replaceAll(".","-"));return o&&!o.includes(d)&&console.warn(`Token ${d} might not exist`),d.startsWith("-")?`-${d}`:`var(--${d})`})},M=A(),N=["top","right","bottom","left","min-width",/.*width.*/,/^[^line]*height.*/,/padding.*/,/margin.*/,/border.*/,/inset.*/,/.*radius.*/,/.*spacing.*/,/.*gap.*/,/.*indent.*/,/.*offset.*/,/.*size.*/,/.*thickness.*/,/.*font-size.*/],k=(o,s,t)=>{if(N.some(e=>typeof e=="string"?e===o:e.test(o))){const e=(t==null?void 0:t.defaultUnit)||"px";if(e.startsWith("viewport-clamp:"))try{const f=e.split(":")[1];return I.defineViewportClamp({screenSize:parseInt(f)})(Number(s))}catch(f){throw console.error(f),new Error(`Invalid viewport-clamp value: ${e}`)}return`${s}${e}`}return`${s}`},J=["Webkit","Moz","ms","O"],Q=o=>o.startsWith("-")?o:J.some(s=>o.startsWith(s))?`-${x.dashCase(o)}`:x.dashCase(o),y=async(o,s="",t,m=!1)=>{if(!o)throw new Error("No styles provided to parseStyles function!");const e=new Set,d=Object.entries(o),f=async([h,r])=>{var V;const n=h.trim().replace(/^\?+/g,""),v=Q(n),$=(a,l=";")=>`${v}:${a}${l}`,j={scope:s,config:t};if(typeof r=="function")return f([h,r(j)]);if(r instanceof Promise)return f([h,await r]);if(t!=null&&t.templates&&t.templatePaths[n])try{const[a,l]=t.templatePaths[n].split(";;"),i=await import(l),c=l.includes("salty.config"),p=c?i[a].templates:i[a],w=c?p[n]:p.params[n];if(p&&typeof w=="function"){const b=await w(r),[u]=await y(b,"");return u}}catch(a){console.error(`Error loading template "${n}" from path "${t.templatePaths[n]}"`,a);return}if(t!=null&&t.templates&&t.templates[n]){if(m)return;const l=r.split(".").reduce((i,c)=>i[c],t.templates[n]);if(l){const[i]=await y(l,"");return i}console.warn(`Template "${n}" with path of "${r}" was not found in config!`);return}if(typeof r=="object"){if(!r)return;if(r.isColor)return $(r.toString());if(n==="defaultVariants")return;if(n==="variants"){const i=Object.entries(r);for(const[c,p]of i){if(!p)continue;const w=Object.entries(p);for(const[b,u]of w){if(!u)continue;const C=`${s}.${c}-${b}`;(await y(u,C,t)).forEach(q=>e.add(q))}}return}if(n==="compoundVariants"){for(const i of r){const{css:c,...p}=i,w=Object.entries(p).reduce((u,[C,O])=>`${u}.${C}-${O}`,s);(await y(c,w,t)).forEach(u=>e.add(u))}return}if(n==="anyOfVariants"){for(const i of r){const{css:c,...p}=i,w=Object.entries(p).map(([C,O])=>`.${C}-${O}`),b=`${s}:where(${w.join(", ")})`;console.log(`Union variant scope: ${b}`),(await y(c,b,t)).forEach(C=>e.add(C))}return}if(n.startsWith("@")){const i=((V=t==null?void 0:t.mediaQueries)==null?void 0:V[n])||n,c=await W(r,s,t),p=`${i} { ${c} }`;e.add(p);return}const a=h.includes("&")?n.replaceAll("&",s):n.startsWith(":")?`${s}${n}`:`${s} ${n}`;(await y(r,a,t)).forEach(i=>e.add(i));return}if(typeof r=="number"){const a=k(v,r,t);return $(a)}if(typeof r!="string")if("toString"in r)r=r.toString();else throw new Error(`Invalid value type for property ${v}`);return $(r)},E=d.map(f),{modifiers:S}=t||{},P=[A(),U(S)],T=(await Promise.all(E).then(h=>Promise.all(h.map(r=>P.reduce(async(n,v)=>{const $=await n;if(!$)return $;const j=await v($);if(!j)return $;const{transformed:V,additionalCss:a}=j;let l="";if(a)for(const i of a)l+=await W(i,"");return`${l}${V}`},Promise.resolve(r)))))).filter(h=>h!==void 0).join(`
2
+ `);if(!T.trim())return Array.from(e);const z=s?`${s} {
3
+ ${T}
4
+ }`:T;return e.has(z)?Array.from(e):[z,...e]},W=async(o,s,t,m=!1)=>(await y(o,s,t,m)).join(`
5
+ `);exports.parseAndJoinStyles=W;exports.parseStyles=y;exports.parseValueModifiers=U;exports.parseValueTokens=A;exports.parseVariableTokens=M;
@@ -0,0 +1,161 @@
1
+ import { d as S } from "./dash-case-DBThphLm.js";
2
+ import { d as I } from "./viewport-clamp-CaYwREKc.js";
3
+ const N = (o) => (s) => {
4
+ if (typeof s != "string" || !o) return;
5
+ let t = s;
6
+ const u = [];
7
+ return Object.values(o).forEach((e) => {
8
+ const { pattern: l, transform: f } = e;
9
+ t = t.replace(l, (C) => {
10
+ const { value: V, css: P } = f(C);
11
+ return P && u.push(P), V;
12
+ });
13
+ }), { transformed: t, additionalCss: u };
14
+ }, A = (o) => (s) => typeof s != "string" || !/\{[^{}]+\}/g.test(s) ? void 0 : { transformed: s.replace(/\{([^{}]+)\}/g, (...e) => {
15
+ const l = S(e[1].replaceAll(".", "-"));
16
+ return o && !o.includes(l) && console.warn(`Token ${l} might not exist`), l.startsWith("-") ? `-${l}` : `var(--${l})`;
17
+ }) }, D = A(), M = [
18
+ "top",
19
+ "right",
20
+ "bottom",
21
+ "left",
22
+ "min-width",
23
+ /.*width.*/,
24
+ /^[^line]*height.*/,
25
+ // Exclude line-height
26
+ /padding.*/,
27
+ /margin.*/,
28
+ /border.*/,
29
+ /inset.*/,
30
+ /.*radius.*/,
31
+ /.*spacing.*/,
32
+ /.*gap.*/,
33
+ /.*indent.*/,
34
+ /.*offset.*/,
35
+ /.*size.*/,
36
+ /.*thickness.*/,
37
+ /.*font-size.*/
38
+ ], Q = (o, s, t) => {
39
+ if (M.some((e) => typeof e == "string" ? e === o : e.test(o))) {
40
+ const e = (t == null ? void 0 : t.defaultUnit) || "px";
41
+ if (e.startsWith("viewport-clamp:"))
42
+ try {
43
+ const f = e.split(":")[1];
44
+ return I({
45
+ screenSize: parseInt(f)
46
+ })(Number(s));
47
+ } catch (f) {
48
+ throw console.error(f), new Error(`Invalid viewport-clamp value: ${e}`);
49
+ }
50
+ return `${s}${e}`;
51
+ }
52
+ return `${s}`;
53
+ }, _ = ["Webkit", "Moz", "ms", "O"], q = (o) => o.startsWith("-") ? o : _.some((s) => o.startsWith(s)) ? `-${S(o)}` : S(o), v = async (o, s = "", t, u = !1) => {
54
+ if (!o) throw new Error("No styles provided to parseStyles function!");
55
+ const e = /* @__PURE__ */ new Set(), l = Object.entries(o), f = async ([h, r]) => {
56
+ var x;
57
+ const n = h.trim().replace(/^\?+/g, ""), E = q(n), $ = (a, d = ";") => `${E}:${a}${d}`, j = { scope: s, config: t };
58
+ if (typeof r == "function") return f([h, r(j)]);
59
+ if (r instanceof Promise) return f([h, await r]);
60
+ if (t != null && t.templates && t.templatePaths[n])
61
+ try {
62
+ const [a, d] = t.templatePaths[n].split(";;"), i = await import(
63
+ /* webpackIgnore: true */
64
+ /* @vite-ignore */
65
+ d
66
+ ), c = d.includes("salty.config"), p = c ? i[a].templates : i[a], w = c ? p[n] : p.params[n];
67
+ if (p && typeof w == "function") {
68
+ const y = await w(r), [m] = await v(y, "");
69
+ return m;
70
+ }
71
+ } catch (a) {
72
+ console.error(`Error loading template "${n}" from path "${t.templatePaths[n]}"`, a);
73
+ return;
74
+ }
75
+ if (t != null && t.templates && t.templates[n]) {
76
+ if (u) return;
77
+ const d = r.split(".").reduce((i, c) => i[c], t.templates[n]);
78
+ if (d) {
79
+ const [i] = await v(d, "");
80
+ return i;
81
+ }
82
+ console.warn(`Template "${n}" with path of "${r}" was not found in config!`);
83
+ return;
84
+ }
85
+ if (typeof r == "object") {
86
+ if (!r) return;
87
+ if (r.isColor) return $(r.toString());
88
+ if (n === "defaultVariants") return;
89
+ if (n === "variants") {
90
+ const i = Object.entries(r);
91
+ for (const [c, p] of i) {
92
+ if (!p) continue;
93
+ const w = Object.entries(p);
94
+ for (const [y, m] of w) {
95
+ if (!m) continue;
96
+ const b = `${s}.${c}-${y}`;
97
+ (await v(m, b, t)).forEach((U) => e.add(U));
98
+ }
99
+ }
100
+ return;
101
+ }
102
+ if (n === "compoundVariants") {
103
+ for (const i of r) {
104
+ const { css: c, ...p } = i, w = Object.entries(p).reduce((m, [b, O]) => `${m}.${b}-${O}`, s);
105
+ (await v(c, w, t)).forEach((m) => e.add(m));
106
+ }
107
+ return;
108
+ }
109
+ if (n === "anyOfVariants") {
110
+ for (const i of r) {
111
+ const { css: c, ...p } = i, w = Object.entries(p).map(([b, O]) => `.${b}-${O}`), y = `${s}:where(${w.join(", ")})`;
112
+ console.log(`Union variant scope: ${y}`), (await v(c, y, t)).forEach((b) => e.add(b));
113
+ }
114
+ return;
115
+ }
116
+ if (n.startsWith("@")) {
117
+ const i = ((x = t == null ? void 0 : t.mediaQueries) == null ? void 0 : x[n]) || n, c = await z(r, s, t), p = `${i} { ${c} }`;
118
+ e.add(p);
119
+ return;
120
+ }
121
+ const a = h.includes("&") ? n.replaceAll("&", s) : n.startsWith(":") ? `${s}${n}` : `${s} ${n}`;
122
+ (await v(r, a, t)).forEach((i) => e.add(i));
123
+ return;
124
+ }
125
+ if (typeof r == "number") {
126
+ const a = Q(E, r, t);
127
+ return $(a);
128
+ }
129
+ if (typeof r != "string")
130
+ if ("toString" in r) r = r.toString();
131
+ else throw new Error(`Invalid value type for property ${E}`);
132
+ return $(r);
133
+ }, C = l.map(f), { modifiers: V } = t || {}, P = [A(), N(V)], W = (await Promise.all(C).then((h) => Promise.all(
134
+ h.map((r) => P.reduce(async (n, E) => {
135
+ const $ = await n;
136
+ if (!$) return $;
137
+ const j = await E($);
138
+ if (!j) return $;
139
+ const { transformed: x, additionalCss: a } = j;
140
+ let d = "";
141
+ if (a)
142
+ for (const i of a)
143
+ d += await z(i, "");
144
+ return `${d}${x}`;
145
+ }, Promise.resolve(r)))
146
+ ))).filter((h) => h !== void 0).join(`
147
+ `);
148
+ if (!W.trim()) return Array.from(e);
149
+ const T = s ? `${s} {
150
+ ${W}
151
+ }` : W;
152
+ return e.has(T) ? Array.from(e) : [T, ...e];
153
+ }, z = async (o, s, t, u = !1) => (await v(o, s, t, u)).join(`
154
+ `);
155
+ export {
156
+ D as a,
157
+ N as b,
158
+ v as c,
159
+ A as d,
160
+ z as p
161
+ };
package/parsers/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../parse-styles-CIRNw7l_.cjs"),c=require("../dash-case-BJEkFEGQ.cjs"),p=async(e,s=[])=>{if(!e)return"";const t=[],r={};for(const[n,o]of Object.entries(e))if(typeof o!="function")if(o&&typeof o=="object"){const i=n.trim(),u=await p(o,[...s,i]);t.push(u)}else r[n]=o;if(Object.keys(r).length){const n=s.map(c.dashCase).join("-"),o="t_"+c.toHash(n,4),i=await a.parseAndJoinStyles(r,`.${n}, .${o}`);t.push(i)}return t.join(`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../parse-styles-B1E0JeC7.cjs"),c=require("../dash-case-BJEkFEGQ.cjs"),p=async(e,s=[])=>{if(!e)return"";const t=[],r={};for(const[n,o]of Object.entries(e))if(typeof o!="function")if(o&&typeof o=="object"){const i=n.trim(),u=await p(o,[...s,i]);t.push(u)}else r[n]=o;if(Object.keys(r).length){const n=s.map(c.dashCase).join("-"),o="t_"+c.toHash(n,4),i=await a.parseAndJoinStyles(r,`.${n}, .${o}`);t.push(i)}return t.join(`
2
2
  `)},y=e=>Object.keys(e),f=e=>e?Object.entries(e).reduce((s,[t,r])=>(typeof r=="function"?s[t]="any":typeof r=="object"&&(s[t]=l(r).map(n=>`"${n}"`).join(" | ")),s),{}):{},l=(e,s="",t=new Set)=>e?(Object.entries(e).forEach(([r,n])=>{const o=s?`${s}.${r}`:r;return typeof n=="object"?l(n,o,t):t.add(s)}),[...t]):[];exports.parseAndJoinStyles=a.parseAndJoinStyles;exports.parseStyles=a.parseStyles;exports.parseValueModifiers=a.parseValueModifiers;exports.parseValueTokens=a.parseValueTokens;exports.parseVariableTokens=a.parseVariableTokens;exports.getTemplateKeys=y;exports.getTemplateTokens=l;exports.getTemplateTypes=f;exports.parseTemplates=p;
package/parsers/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { p as f } from "../parse-styles-CPuIGA08.js";
2
- import { c as T, b as O, d as $, a as g } from "../parse-styles-CPuIGA08.js";
1
+ import { p as f } from "../parse-styles-y_-drahL.js";
2
+ import { c as T, b as O, d as $, a as g } from "../parse-styles-y_-drahL.js";
3
3
  import { d as p, t as u } from "../dash-case-DBThphLm.js";
4
4
  const l = async (e, s = []) => {
5
5
  if (!e) return "";
package/server/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../should-restart-DT8O0pOt.cjs");exports.checkShouldRestart=e.checkShouldRestart;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../should-restart-B-ov9sPO.cjs");exports.checkShouldRestart=e.checkShouldRestart;
package/server/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { c as o } from "../should-restart-CNF2idbd.js";
1
+ import { c as o } from "../should-restart-Dvo5_WYL.js";
2
2
  export {
3
3
  o as checkShouldRestart
4
4
  };
@@ -1 +1 @@
1
- "use strict";const s=require("fs/promises"),r=require("./index-D0QitXLT.cjs"),i=async t=>{if(!t||t.includes("node_modules")||t.includes("saltygen"))return!1;if(t.includes("salty.config"))return!0;if(!r.isSaltyFile(t))return!1;const e=await s.readFile(t,"utf-8");return!!(/.+define[A-Z]\w+/.test(e)||/.+keyframes\(.+/.test(e))};exports.checkShouldRestart=i;
1
+ "use strict";const s=require("fs/promises"),r=require("./index-DojP6pQJ.cjs"),i=async t=>{if(!t||t.includes("node_modules")||t.includes("saltygen"))return!1;if(t.includes("salty.config"))return!0;if(!r.isSaltyFile(t))return!1;const e=await s.readFile(t,"utf-8");return!!(/.+define[A-Z]\w+/.test(e)||/.+keyframes\(.+/.test(e))};exports.checkShouldRestart=i;
@@ -1,5 +1,5 @@
1
1
  import { readFile as r } from "fs/promises";
2
- import { i as e } from "./index-Bzka2M7f.js";
2
+ import { i as e } from "./index-Bsj-9mQh.js";
3
3
  const f = async (t) => {
4
4
  if (!t || t.includes("node_modules") || t.includes("saltygen")) return !1;
5
5
  if (t.includes("salty.config")) return !0;
package/types/index.d.ts CHANGED
@@ -30,7 +30,7 @@ type InvalidVariantKeys = '' | 'css';
30
30
  type VariantOptions = {
31
31
  [key in InvalidVariantKeys]?: never;
32
32
  };
33
- export type CompoundVariant = {
33
+ export type MultiVariant = {
34
34
  [key: PropertyKey]: string | boolean | undefined;
35
35
  } | {
36
36
  css: CSSinJS;
@@ -44,7 +44,8 @@ type Variants = {
44
44
  defaultVariants?: {
45
45
  [key: PropertyKey]: any;
46
46
  };
47
- compoundVariants?: CompoundVariant[];
47
+ compoundVariants?: MultiVariant[];
48
+ anyOfVariants?: MultiVariant[];
48
49
  };
49
50
  type BooleanVariantValue = 'true' | 'false' | boolean;
50
51
  type VariantPropValue<T> = T extends 'true' ? BooleanVariantValue : T extends 'false' ? BooleanVariantValue : T extends boolean ? BooleanVariantValue : T | '';
@@ -55,10 +56,12 @@ type AllKeys<T> = T extends any ? keyof T : never;
55
56
  export type Merge<T> = {
56
57
  [k in AllKeys<T>]?: PickType<T, k>;
57
58
  };
58
- export type VariantProps<STYLES extends StyledParams, B = STYLES['variants'] extends undefined ? object : STYLES['variants'], C = STYLES['compoundVariants'] extends CompoundVariant[] ? Merge<STYLES['compoundVariants'][number]> : object> = Merge<{
59
+ export type VariantProps<STYLES extends StyledParams, B = STYLES['variants'] extends undefined ? object : STYLES['variants'], C = STYLES['compoundVariants'] extends MultiVariant[] ? Merge<STYLES['compoundVariants'][number]> : object, U = STYLES['anyOfVariants'] extends MultiVariant[] ? Merge<STYLES['anyOfVariants'][number]> : object> = Merge<{
59
60
  [K in keyof B]?: K extends 'css' ? never : VariantPropValue<keyof B[K]>;
60
61
  } | {
61
62
  [K in keyof C]?: K extends 'css' ? never : VariantPropValue<C[K]>;
63
+ } | {
64
+ [K in keyof U]?: K extends 'css' ? never : VariantPropValue<U[K]>;
62
65
  }>;
63
66
  type CssValuePropKey = `props-${string}`;
64
67
  export type ValueProps = {
@@ -1,5 +0,0 @@
1
- "use strict";const x=require("./dash-case-BJEkFEGQ.cjs"),M=require("./viewport-clamp-mq_DFtRR.cjs"),q=o=>s=>{if(typeof s!="string"||!o)return;let t=s;const u=[];return Object.values(o).forEach(e=>{const{pattern:p,transform:f}=e;t=t.replace(p,C=>{const{value:V,css:v}=f(C);return v&&u.push(v),V})}),{transformed:t,additionalCss:u}},A=o=>s=>typeof s!="string"||!/\{[^{}]+\}/g.test(s)?void 0:{transformed:s.replace(/\{([^{}]+)\}/g,(...e)=>{const p=x.dashCase(e[1].replaceAll(".","-"));return o&&!o.includes(p)&&console.warn(`Token ${p} might not exist`),p.startsWith("-")?`-${p}`:`var(--${p})`})},N=A(),U=["top","right","bottom","left","min-width",/.*width.*/,/^[^line]*height.*/,/padding.*/,/margin.*/,/border.*/,/inset.*/,/.*radius.*/,/.*spacing.*/,/.*gap.*/,/.*indent.*/,/.*offset.*/,/.*size.*/,/.*thickness.*/,/.*font-size.*/],k=(o,s,t)=>{if(U.some(e=>typeof e=="string"?e===o:e.test(o))){const e=(t==null?void 0:t.defaultUnit)||"px";if(e.startsWith("viewport-clamp:"))try{const f=e.split(":")[1];return M.defineViewportClamp({screenSize:parseInt(f)})(Number(s))}catch(f){throw console.error(f),new Error(`Invalid viewport-clamp value: ${e}`)}return`${s}${e}`}return`${s}`},J=["Webkit","Moz","ms","O"],Q=o=>o.startsWith("-")?o:J.some(s=>o.startsWith(s))?`-${x.dashCase(o)}`:x.dashCase(o),$=async(o,s="",t,u=!1)=>{if(!o)throw new Error("No styles provided to parseStyles function!");const e=new Set,p=Object.entries(o),f=async([m,r])=>{var P;const n=m.trim().replace(/^\?+/g,""),b=Q(n),h=(a,c=";")=>`${b}:${a}${c}`,E={scope:s,config:t};if(typeof r=="function")return f([m,r(E)]);if(r instanceof Promise)return f([m,await r]);if(t!=null&&t.templates&&t.templatePaths[n])try{const[a,c]=t.templatePaths[n].split(";;"),i=await import(c),l=c.includes("salty.config"),d=l?i[a].templates:i[a],y=l?d[n]:d.params[n];if(d&&typeof y=="function"){const S=await y(r),[w]=await $(S,"");return w}}catch(a){console.error(`Error loading template "${n}" from path "${t.templatePaths[n]}"`,a);return}if(t!=null&&t.templates&&t.templates[n]){if(u)return;const c=r.split(".").reduce((i,l)=>i[l],t.templates[n]);if(c){const[i]=await $(c,"");return i}console.warn(`Template "${n}" with path of "${r}" was not found in config!`);return}if(typeof r=="object"){if(!r)return;if(r.isColor)return h(r.toString());if(n==="defaultVariants")return;if(n==="variants"){const i=Object.entries(r);for(const[l,d]of i){if(!d)continue;const y=Object.entries(d);for(const[S,w]of y){if(!w)continue;const T=`${s}.${l}-${S}`;(await $(w,T,t)).forEach(I=>e.add(I))}}return}if(n==="compoundVariants"){for(const i of r){const{css:l,...d}=i,y=Object.entries(d).reduce((w,[T,z])=>`${w}.${T}-${z}`,s);(await $(l,y,t)).forEach(w=>e.add(w))}return}if(n.startsWith("@")){const i=((P=t==null?void 0:t.mediaQueries)==null?void 0:P[n])||n,l=await W(r,s,t),d=`${i} { ${l} }`;e.add(d);return}const a=m.includes("&")?n.replaceAll("&",s):n.startsWith(":")?`${s}${n}`:`${s} ${n}`;(await $(r,a,t)).forEach(i=>e.add(i));return}if(typeof r=="number"){const a=k(b,r,t);return h(a)}if(typeof r!="string")if("toString"in r)r=r.toString();else throw new Error(`Invalid value type for property ${b}`);return h(r)},C=p.map(f),{modifiers:V}=t||{},v=[A(),q(V)],j=(await Promise.all(C).then(m=>Promise.all(m.map(r=>v.reduce(async(n,b)=>{const h=await n;if(!h)return h;const E=await b(h);if(!E)return h;const{transformed:P,additionalCss:a}=E;let c="";if(a)for(const i of a)c+=await W(i,"");return`${c}${P}`},Promise.resolve(r)))))).filter(m=>m!==void 0).join(`
2
- `);if(!j.trim())return Array.from(e);const O=s?`${s} {
3
- ${j}
4
- }`:j;return e.has(O)?Array.from(e):[O,...e]},W=async(o,s,t,u=!1)=>(await $(o,s,t,u)).join(`
5
- `);exports.parseAndJoinStyles=W;exports.parseStyles=$;exports.parseValueModifiers=q;exports.parseValueTokens=A;exports.parseVariableTokens=N;
@@ -1,154 +0,0 @@
1
- import { d as O } from "./dash-case-DBThphLm.js";
2
- import { d as N } from "./viewport-clamp-CaYwREKc.js";
3
- const U = (o) => (s) => {
4
- if (typeof s != "string" || !o) return;
5
- let t = s;
6
- const m = [];
7
- return Object.values(o).forEach((e) => {
8
- const { pattern: p, transform: f } = e;
9
- t = t.replace(p, (E) => {
10
- const { value: x, css: v } = f(E);
11
- return v && m.push(v), x;
12
- });
13
- }), { transformed: t, additionalCss: m };
14
- }, A = (o) => (s) => typeof s != "string" || !/\{[^{}]+\}/g.test(s) ? void 0 : { transformed: s.replace(/\{([^{}]+)\}/g, (...e) => {
15
- const p = O(e[1].replaceAll(".", "-"));
16
- return o && !o.includes(p) && console.warn(`Token ${p} might not exist`), p.startsWith("-") ? `-${p}` : `var(--${p})`;
17
- }) }, D = A(), M = [
18
- "top",
19
- "right",
20
- "bottom",
21
- "left",
22
- "min-width",
23
- /.*width.*/,
24
- /^[^line]*height.*/,
25
- // Exclude line-height
26
- /padding.*/,
27
- /margin.*/,
28
- /border.*/,
29
- /inset.*/,
30
- /.*radius.*/,
31
- /.*spacing.*/,
32
- /.*gap.*/,
33
- /.*indent.*/,
34
- /.*offset.*/,
35
- /.*size.*/,
36
- /.*thickness.*/,
37
- /.*font-size.*/
38
- ], Q = (o, s, t) => {
39
- if (M.some((e) => typeof e == "string" ? e === o : e.test(o))) {
40
- const e = (t == null ? void 0 : t.defaultUnit) || "px";
41
- if (e.startsWith("viewport-clamp:"))
42
- try {
43
- const f = e.split(":")[1];
44
- return N({
45
- screenSize: parseInt(f)
46
- })(Number(s));
47
- } catch (f) {
48
- throw console.error(f), new Error(`Invalid viewport-clamp value: ${e}`);
49
- }
50
- return `${s}${e}`;
51
- }
52
- return `${s}`;
53
- }, _ = ["Webkit", "Moz", "ms", "O"], q = (o) => o.startsWith("-") ? o : _.some((s) => o.startsWith(s)) ? `-${O(o)}` : O(o), y = async (o, s = "", t, m = !1) => {
54
- if (!o) throw new Error("No styles provided to parseStyles function!");
55
- const e = /* @__PURE__ */ new Set(), p = Object.entries(o), f = async ([u, r]) => {
56
- var P;
57
- const n = u.trim().replace(/^\?+/g, ""), b = q(n), h = (a, c = ";") => `${b}:${a}${c}`, C = { scope: s, config: t };
58
- if (typeof r == "function") return f([u, r(C)]);
59
- if (r instanceof Promise) return f([u, await r]);
60
- if (t != null && t.templates && t.templatePaths[n])
61
- try {
62
- const [a, c] = t.templatePaths[n].split(";;"), i = await import(
63
- /* webpackIgnore: true */
64
- /* @vite-ignore */
65
- c
66
- ), d = c.includes("salty.config"), l = d ? i[a].templates : i[a], $ = d ? l[n] : l.params[n];
67
- if (l && typeof $ == "function") {
68
- const j = await $(r), [w] = await y(j, "");
69
- return w;
70
- }
71
- } catch (a) {
72
- console.error(`Error loading template "${n}" from path "${t.templatePaths[n]}"`, a);
73
- return;
74
- }
75
- if (t != null && t.templates && t.templates[n]) {
76
- if (m) return;
77
- const c = r.split(".").reduce((i, d) => i[d], t.templates[n]);
78
- if (c) {
79
- const [i] = await y(c, "");
80
- return i;
81
- }
82
- console.warn(`Template "${n}" with path of "${r}" was not found in config!`);
83
- return;
84
- }
85
- if (typeof r == "object") {
86
- if (!r) return;
87
- if (r.isColor) return h(r.toString());
88
- if (n === "defaultVariants") return;
89
- if (n === "variants") {
90
- const i = Object.entries(r);
91
- for (const [d, l] of i) {
92
- if (!l) continue;
93
- const $ = Object.entries(l);
94
- for (const [j, w] of $) {
95
- if (!w) continue;
96
- const W = `${s}.${d}-${j}`;
97
- (await y(w, W, t)).forEach((I) => e.add(I));
98
- }
99
- }
100
- return;
101
- }
102
- if (n === "compoundVariants") {
103
- for (const i of r) {
104
- const { css: d, ...l } = i, $ = Object.entries(l).reduce((w, [W, V]) => `${w}.${W}-${V}`, s);
105
- (await y(d, $, t)).forEach((w) => e.add(w));
106
- }
107
- return;
108
- }
109
- if (n.startsWith("@")) {
110
- const i = ((P = t == null ? void 0 : t.mediaQueries) == null ? void 0 : P[n]) || n, d = await z(r, s, t), l = `${i} { ${d} }`;
111
- e.add(l);
112
- return;
113
- }
114
- const a = u.includes("&") ? n.replaceAll("&", s) : n.startsWith(":") ? `${s}${n}` : `${s} ${n}`;
115
- (await y(r, a, t)).forEach((i) => e.add(i));
116
- return;
117
- }
118
- if (typeof r == "number") {
119
- const a = Q(b, r, t);
120
- return h(a);
121
- }
122
- if (typeof r != "string")
123
- if ("toString" in r) r = r.toString();
124
- else throw new Error(`Invalid value type for property ${b}`);
125
- return h(r);
126
- }, E = p.map(f), { modifiers: x } = t || {}, v = [A(), U(x)], S = (await Promise.all(E).then((u) => Promise.all(
127
- u.map((r) => v.reduce(async (n, b) => {
128
- const h = await n;
129
- if (!h) return h;
130
- const C = await b(h);
131
- if (!C) return h;
132
- const { transformed: P, additionalCss: a } = C;
133
- let c = "";
134
- if (a)
135
- for (const i of a)
136
- c += await z(i, "");
137
- return `${c}${P}`;
138
- }, Promise.resolve(r)))
139
- ))).filter((u) => u !== void 0).join(`
140
- `);
141
- if (!S.trim()) return Array.from(e);
142
- const T = s ? `${s} {
143
- ${S}
144
- }` : S;
145
- return e.has(T) ? Array.from(e) : [T, ...e];
146
- }, z = async (o, s, t, m = !1) => (await y(o, s, t, m)).join(`
147
- `);
148
- export {
149
- D as a,
150
- U as b,
151
- y as c,
152
- A as d,
153
- z as p
154
- };