@zuzjs/ui 1.0.3 → 1.0.4
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/dist/bin.cjs +7 -5
- package/dist/bin.js +6 -4
- package/dist/chunk-AOMKZOJG.js +6 -0
- package/dist/chunk-EGGWXLB2.cjs +7 -0
- package/dist/css/styles.css +1 -1
- package/dist/index.cjs +6 -6
- package/dist/index.d.cts +21 -21
- package/dist/index.d.ts +21 -21
- package/dist/index.js +5 -5
- package/package.json +1 -1
- package/dist/chunk-75PWQLBY.js +0 -6
- package/dist/chunk-M2YKHQNL.cjs +0 -7
package/dist/bin.cjs
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
'use strict';var
|
|
3
|
-
var
|
|
4
|
-
export const zuzMap: Record<string, string> = ${JSON.stringify(this.manifest,null,2)};`;u__default.default.writeFileSync(e,
|
|
5
|
-
|
|
6
|
-
`)
|
|
2
|
+
'use strict';var chunkEGGWXLB2_cjs=require('./chunk-EGGWXLB2.cjs'),commander=require('commander'),D=require('chokidar'),d=require('path'),i=require('picocolors'),u=require('fs'),tsMorph=require('ts-morph');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var D__default=/*#__PURE__*/_interopDefault(D);var d__default=/*#__PURE__*/_interopDefault(d);var i__default=/*#__PURE__*/_interopDefault(i);var u__default=/*#__PURE__*/_interopDefault(u);/* ZuzJS UI CLI */
|
|
3
|
+
var E=class{project;stylesToGenerate;manifest={};supportedExtensions=[".tsx",".jsx",".mdx",".md"];constructor(){this.project=new tsMorph.Project({compilerOptions:{allowJs:true,jsx:1}}),this.stylesToGenerate=new Set;}extractStyles(e,t=""){if(e.asKind(tsMorph.SyntaxKind.JsxExpression)){let s=e.getExpression();s&&this.extractStyles(s,t);return}if(e.asKind(tsMorph.SyntaxKind.StringLiteral)||e.asKind(tsMorph.SyntaxKind.NoSubstitutionTemplateLiteral)||e.asKind(tsMorph.SyntaxKind.NumericLiteral))this.stylesToGenerate.add(t+e.getLiteralValue().toString());else if(e.asKind(tsMorph.SyntaxKind.TemplateExpression)){let s=e.getHead().getLiteralText();e.getTemplateSpans().forEach(r=>{this.extractStyles(r.getExpression(),t+s);});}else e.asKind(tsMorph.SyntaxKind.ConditionalExpression)?(this.extractStyles(e.getWhenTrue(),t),this.extractStyles(e.getWhenFalse(),t)):e.asKind(tsMorph.SyntaxKind.ArrayLiteralExpression)?e.getElements().forEach(s=>this.extractStyles(s,t)):e.asKind(tsMorph.SyntaxKind.BinaryExpression)&&(this.extractStyles(e.getLeft(),t),this.extractStyles(e.getRight(),t));}processFile(e){this.stylesToGenerate.clear();let t=e.endsWith(".mdx")||e.endsWith(".md"),s;if(t){let n=u__default.default.readFileSync(e,"utf-8");s=this.project.createSourceFile(e,n,{overwrite:true,scriptKind:tsMorph.ScriptKind.TSX});}else s=this.project.addSourceFileAtPath(e),s.refreshFromFileSystemSync();[...s.getDescendantsOfKind(tsMorph.SyntaxKind.JsxOpeningElement),...s.getDescendantsOfKind(tsMorph.SyntaxKind.JsxSelfClosingElement)].forEach(n=>{let c=n.getAttribute("as")?.asKind(tsMorph.SyntaxKind.JsxAttribute)?.getInitializer();c&&this.extractStyles(c);}),s.getDescendantsOfKind(tsMorph.SyntaxKind.CallExpression).filter(n=>n.getExpression().getText()==="css").forEach(n=>{let l=n.getArguments();l.length>0&&this.extractStyles(l[0]);}),this.stylesToGenerate.forEach(n=>{chunkEGGWXLB2_cjs.i(n).filter(Boolean).forEach(c=>{let z=c.match(/^([&@][\w-]+)\((.*)\)$/);if(z){let[S,j,x]=z;chunkEGGWXLB2_cjs.i(x).filter(Boolean).forEach(J=>{let C=`${j}(${J})`,T=chunkEGGWXLB2_cjs.j.parseAndGenerate(C,e);T.length>0&&(this.manifest[C]=T.join(" "));});let b=chunkEGGWXLB2_cjs.j.parseAndGenerate(c,e);b.length>0&&(this.manifest[c]=b.join(" "));}else {let S=chunkEGGWXLB2_cjs.j.parseAndGenerate(c,e);S.length>0&&(this.manifest[c]=S.join(" "));}});}),t&&this.project.removeSourceFile(s);}isSupportedFile(e){return this.supportedExtensions.some(t=>e.endsWith(t))}getStyleCount(){return this.stylesToGenerate.size}getManifestPath=()=>{let e=process.cwd(),t=[d__default.default.join(e,"src/app/css"),d__default.default.join(e,"app/css"),d__default.default.join(e,"src/css"),d__default.default.join(e,"css")],s=t.find(r=>u__default.default.existsSync(r))||t[0];return u__default.default.existsSync(s)||u__default.default.mkdirSync(s,{recursive:true}),d__default.default.join(s,"zuzmap.ts")};saveManifest(e){let t=d__default.default.dirname(e);u__default.default.existsSync(t)||u__default.default.mkdirSync(t,{recursive:true});let s=chunkEGGWXLB2_cjs.j.getCache(),r={};for(let[n,l]of Object.entries(this.manifest))s.has(l)&&(r[n]=l);this.manifest=r;let g=`/* Zuz Generated Manifest - Do not edit */
|
|
4
|
+
export const zuzMap: Record<string, string> = ${JSON.stringify(this.manifest,null,2)};`;u__default.default.writeFileSync(e,g);}},h=new E;commander.program.opts();var y=process.cwd(),A=false,O=d__default.default.join(y,"src","app","css"),N=d__default.default.join(O,"zuz.scss"),R=d__default.default.join(O,"zuzmap.ts"),G=()=>{chunkEGGWXLB2_cjs.j.writeToDisk(N),h.saveManifest(R);},I=async()=>{try{let t=(await(await fetch("https://registry.npmjs.org/@zuzjs/ui/latest")).json()).version;if(t!==chunkEGGWXLB2_cjs.f.version){let s=` Update available! ${i__default.default.dim(chunkEGGWXLB2_cjs.f.version)} \u2192 ${i__default.default.green(t)} `,r=` Run: ${i__default.default.cyan(`npm i ${chunkEGGWXLB2_cjs.f.name}@latest`)} `,g=x=>x.replace(/\u001b\[[0-9;]*m/g,"").length,n=g(s),l=g(r),c=Math.max(n,l),z=i__default.default.yellow(`\u250C${"\u2500".repeat(c+2)}\u2510`),S=i__default.default.yellow(`\u2514${"\u2500".repeat(c+2)}\u2518`),j=(x,F)=>{let b=" ".repeat(c-F);return `${i__default.default.yellow("\u2502")} ${x}${b} ${i__default.default.yellow("\u2502")}`};console.log(`
|
|
5
|
+
${z}`),console.log(j(s,n)),console.log(j(r,l)),console.log(`${S}
|
|
6
|
+
`);}}catch{}};commander.program.command("init").description("Initialize Zuz snippets and configuration").action(()=>{let o=d__default.default.join(y,".vscode"),e=d__default.default.join(o,"zuz.code-snippets"),t=d__default.default.join(o,"settings.json"),s=Object.keys(chunkEGGWXLB2_cjs.a).join(","),r=Object.keys(chunkEGGWXLB2_cjs.b).join(","),g={"Zuz Property":{prefix:"zp",body:[`as="\${1|${s}|}:$0"`],description:"Zuz Property (adds colon)"},"Zuz Shortcut":{prefix:"zs",body:[`as="\${1|${r}|}$0"`],description:"Zuz Direct Shortcut"}},n={};if(u__default.default.existsSync(t))try{n=JSON.parse(u__default.default.readFileSync(t,"utf-8"));}catch{n={};}n["editor.suggest.snippetsPreventQuickSuggestions"]=false,n["editor.quickSuggestions"]={...typeof n["editor.quickSuggestions"]=="object"?n["editor.quickSuggestions"]:{},strings:true},u__default.default.existsSync(o)||u__default.default.mkdirSync(o,{recursive:true}),u__default.default.writeFileSync(e,JSON.stringify(g,null,2)),u__default.default.writeFileSync(t,JSON.stringify(n,null,2)),console.log(i__default.default.green("\u2714 Zuz VS Code configuration initialized!")),console.log(i__default.default.cyan(" - .vscode/zuz.code-snippets (Splitted zp/zs)")),console.log(i__default.default.cyan(" - .vscode/settings.json (QuickSuggestions enabled)"));});commander.program.command("watch").alias("w").description("Start ZuzJS watcher").action(()=>{I();let o=D__default.default.watch(".",{cwd:y,ignored:[/node_modules/,/dist/,/\.next/,/\.git/],persistent:true,usePolling:true,followSymlinks:false,ignoreInitial:false});o.on("add",e=>{h.isSupportedFile(e)&&h.processFile(d__default.default.resolve(y,e)),A&&console.log(i__default.default.gray(`\u25CB File added: ${e}`));}),o.on("change",e=>{if(h.isSupportedFile(e)){console.log(i__default.default.gray(`\u25CB File changed: ${e}`));let t=d__default.default.resolve(y,e);chunkEGGWXLB2_cjs.j.clearFileCache(t),h.processFile(t),G(),console.log(i__default.default.blue("\u26A1 Zuz CSS updated."));}}),o.on("ready",()=>{A=true,G(),console.log(i__default.default.green(`
|
|
7
|
+
\u2713 Initial Build Complete.`)),console.log(i__default.default.cyan(`\u25CB Watching: ${d.basename(y)}
|
|
8
|
+
`));}),o.on("error",e=>console.error(i__default.default.red(`Watcher Error: ${e}`)));});commander.program.parse(process.argv);
|
package/dist/bin.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {a,b,i
|
|
3
|
-
export const zuzMap: Record<string, string> = ${JSON.stringify(this.manifest,null,2)};`;u.writeFileSync(e,
|
|
4
|
-
|
|
5
|
-
`)
|
|
2
|
+
import {a,b,j,i as i$1,f}from'./chunk-AOMKZOJG.js';import {program}from'commander';import W from'chokidar';import d,{basename}from'path';import i from'picocolors';import u from'fs';import {Project,SyntaxKind,ScriptKind}from'ts-morph';var E=class{project;stylesToGenerate;manifest={};supportedExtensions=[".tsx",".jsx",".mdx",".md"];constructor(){this.project=new Project({compilerOptions:{allowJs:true,jsx:1}}),this.stylesToGenerate=new Set;}extractStyles(e,t=""){if(e.asKind(SyntaxKind.JsxExpression)){let s=e.getExpression();s&&this.extractStyles(s,t);return}if(e.asKind(SyntaxKind.StringLiteral)||e.asKind(SyntaxKind.NoSubstitutionTemplateLiteral)||e.asKind(SyntaxKind.NumericLiteral))this.stylesToGenerate.add(t+e.getLiteralValue().toString());else if(e.asKind(SyntaxKind.TemplateExpression)){let s=e.getHead().getLiteralText();e.getTemplateSpans().forEach(r=>{this.extractStyles(r.getExpression(),t+s);});}else e.asKind(SyntaxKind.ConditionalExpression)?(this.extractStyles(e.getWhenTrue(),t),this.extractStyles(e.getWhenFalse(),t)):e.asKind(SyntaxKind.ArrayLiteralExpression)?e.getElements().forEach(s=>this.extractStyles(s,t)):e.asKind(SyntaxKind.BinaryExpression)&&(this.extractStyles(e.getLeft(),t),this.extractStyles(e.getRight(),t));}processFile(e){this.stylesToGenerate.clear();let t=e.endsWith(".mdx")||e.endsWith(".md"),s;if(t){let n=u.readFileSync(e,"utf-8");s=this.project.createSourceFile(e,n,{overwrite:true,scriptKind:ScriptKind.TSX});}else s=this.project.addSourceFileAtPath(e),s.refreshFromFileSystemSync();[...s.getDescendantsOfKind(SyntaxKind.JsxOpeningElement),...s.getDescendantsOfKind(SyntaxKind.JsxSelfClosingElement)].forEach(n=>{let c=n.getAttribute("as")?.asKind(SyntaxKind.JsxAttribute)?.getInitializer();c&&this.extractStyles(c);}),s.getDescendantsOfKind(SyntaxKind.CallExpression).filter(n=>n.getExpression().getText()==="css").forEach(n=>{let l=n.getArguments();l.length>0&&this.extractStyles(l[0]);}),this.stylesToGenerate.forEach(n=>{i$1(n).filter(Boolean).forEach(c=>{let z=c.match(/^([&@][\w-]+)\((.*)\)$/);if(z){let[S,j$1,x]=z;i$1(x).filter(Boolean).forEach(J=>{let C=`${j$1}(${J})`,T=j.parseAndGenerate(C,e);T.length>0&&(this.manifest[C]=T.join(" "));});let b=j.parseAndGenerate(c,e);b.length>0&&(this.manifest[c]=b.join(" "));}else {let S=j.parseAndGenerate(c,e);S.length>0&&(this.manifest[c]=S.join(" "));}});}),t&&this.project.removeSourceFile(s);}isSupportedFile(e){return this.supportedExtensions.some(t=>e.endsWith(t))}getStyleCount(){return this.stylesToGenerate.size}getManifestPath=()=>{let e=process.cwd(),t=[d.join(e,"src/app/css"),d.join(e,"app/css"),d.join(e,"src/css"),d.join(e,"css")],s=t.find(r=>u.existsSync(r))||t[0];return u.existsSync(s)||u.mkdirSync(s,{recursive:true}),d.join(s,"zuzmap.ts")};saveManifest(e){let t=d.dirname(e);u.existsSync(t)||u.mkdirSync(t,{recursive:true});let s=j.getCache(),r={};for(let[n,l]of Object.entries(this.manifest))s.has(l)&&(r[n]=l);this.manifest=r;let g=`/* Zuz Generated Manifest - Do not edit */
|
|
3
|
+
export const zuzMap: Record<string, string> = ${JSON.stringify(this.manifest,null,2)};`;u.writeFileSync(e,g);}},h=new E;program.opts();var y=process.cwd(),A=false,O=d.join(y,"src","app","css"),R=d.join(O,"zuz.scss"),I=d.join(O,"zuzmap.ts"),G=()=>{j.writeToDisk(R),h.saveManifest(I);},P=async()=>{try{let t=(await(await fetch("https://registry.npmjs.org/@zuzjs/ui/latest")).json()).version;if(t!==f.version){let s=` Update available! ${i.dim(f.version)} \u2192 ${i.green(t)} `,r=` Run: ${i.cyan(`npm i ${f.name}@latest`)} `,g=x=>x.replace(/\u001b\[[0-9;]*m/g,"").length,n=g(s),l=g(r),c=Math.max(n,l),z=i.yellow(`\u250C${"\u2500".repeat(c+2)}\u2510`),S=i.yellow(`\u2514${"\u2500".repeat(c+2)}\u2518`),j=(x,F)=>{let b=" ".repeat(c-F);return `${i.yellow("\u2502")} ${x}${b} ${i.yellow("\u2502")}`};console.log(`
|
|
4
|
+
${z}`),console.log(j(s,n)),console.log(j(r,l)),console.log(`${S}
|
|
5
|
+
`);}}catch{}};program.command("init").description("Initialize Zuz snippets and configuration").action(()=>{let o=d.join(y,".vscode"),e=d.join(o,"zuz.code-snippets"),t=d.join(o,"settings.json"),s=Object.keys(a).join(","),r=Object.keys(b).join(","),g={"Zuz Property":{prefix:"zp",body:[`as="\${1|${s}|}:$0"`],description:"Zuz Property (adds colon)"},"Zuz Shortcut":{prefix:"zs",body:[`as="\${1|${r}|}$0"`],description:"Zuz Direct Shortcut"}},n={};if(u.existsSync(t))try{n=JSON.parse(u.readFileSync(t,"utf-8"));}catch{n={};}n["editor.suggest.snippetsPreventQuickSuggestions"]=false,n["editor.quickSuggestions"]={...typeof n["editor.quickSuggestions"]=="object"?n["editor.quickSuggestions"]:{},strings:true},u.existsSync(o)||u.mkdirSync(o,{recursive:true}),u.writeFileSync(e,JSON.stringify(g,null,2)),u.writeFileSync(t,JSON.stringify(n,null,2)),console.log(i.green("\u2714 Zuz VS Code configuration initialized!")),console.log(i.cyan(" - .vscode/zuz.code-snippets (Splitted zp/zs)")),console.log(i.cyan(" - .vscode/settings.json (QuickSuggestions enabled)"));});program.command("watch").alias("w").description("Start ZuzJS watcher").action(()=>{P();let o=W.watch(".",{cwd:y,ignored:[/node_modules/,/dist/,/\.next/,/\.git/],persistent:true,usePolling:true,followSymlinks:false,ignoreInitial:false});o.on("add",e=>{h.isSupportedFile(e)&&h.processFile(d.resolve(y,e)),A&&console.log(i.gray(`\u25CB File added: ${e}`));}),o.on("change",e=>{if(h.isSupportedFile(e)){console.log(i.gray(`\u25CB File changed: ${e}`));let t=d.resolve(y,e);j.clearFileCache(t),h.processFile(t),G(),console.log(i.blue("\u26A1 Zuz CSS updated."));}}),o.on("ready",()=>{A=true,G(),console.log(i.green(`
|
|
6
|
+
\u2713 Initial Build Complete.`)),console.log(i.cyan(`\u25CB Watching: ${basename(y)}
|
|
7
|
+
`));}),o.on("error",e=>console.error(i.red(`Watcher Error: ${e}`)));});program.parse(process.argv);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import z from'hashids';import u from'fs';import {dirname}from'path';import {isColor}from'@zuzjs/core';var g={alignContent:"align-content",alignItems:"align-items",alignSelf:"align-self",animation:"animation",animationDelay:"animation-delay",animationDirection:"animation-direction",animationDuration:"animation-duration",animationFillMode:"animation-fill-mode",animationIterationCount:"animation-iteration-count",animationName:"animation-name",animationPlayState:"animation-play-state",animationTimingFunction:"animation-timing-function",background:"background",bg:"background",backgroundColor:"background-color",backgroundImage:"background-image",bgi:"background-image",bgc:"background-color",backgroundOrigin:"background-origin",backgroundPosition:"background-position",backgroundRepeat:"background-repeat",backgroundSize:"background-size",backfaceVisibility:"backface-visibility",backgroundAttachment:"background-attachment",backgroundBlendMode:"background-blend-mode",backgroundClip:"background-clip","bg-clip":"background-clip",border:"border",borderBottom:"border-bottom",borderBottomColor:"border-bottom-color",borderBottomStyle:"border-bottom-style",borderBottomWidth:"border-bottom-width",borderCollapse:"border-collapse",borderColor:"border-color",borderImage:"border-image",borderImageOutset:"border-image-outset",borderImageRepeat:"border-image-repeat",borderImageSlice:"border-image-slice",borderImageSource:"border-image-source",borderImageWidth:"border-image-width",borderLeft:"border-left",borderLeftColor:"border-left-color",borderLeftStyle:"border-left-style",borderLeftWidth:"border-left-width",borderRight:"border-right",borderRightColor:"border-right-color",borderRightStyle:"border-right-style",borderRightWidth:"border-right-width",borderSpacing:"border-spacing",borderStyle:"border-style",borderTop:"border-top",borderTopColor:"border-top-color",borderTopStyle:"border-top-style",borderTopWidth:"border-top-width",borderWidth:"border-width",borderRadius:"border-radius",r:"border-radius",radius:"border-radius",borderTopLeftRadius:"border-top-left-radius",rtl:"border-top-left-radius",borderTopRightRadius:"border-top-right-radius",rtr:"border-top-right-radius",borderBottomLeftRadius:"border-bottom-left-radius",rbl:"border-bottom-left-radius",borderBottomRightRadius:"border-bottom-right-radius",rbr:"border-bottom-right-radius",bottom:"bottom",boxDecorationBreak:"box-decoration-break",boxShadow:"box-shadow",shadow:"box-shadow",boxSizing:"box-sizing",captionSide:"caption-side",caretColor:"caret-color","@charset":"@charset",clear:"clear",clip:"clip-path",clipPath:"clip-path",color:"color",c:"color",columnCount:"column-count",columnFill:"column-fill",columnGap:"column-gap",colGap:"column-gap",columnRule:"column-rule",columnRuleColor:"column-rule-color",columnRuleStyle:"column-rule-style",columnRuleWidth:"column-rule-width",columnSpan:"column-span",columnWidth:"column-width",columns:"columns",content:"content",counterIncrement:"counter-increment",counterReset:"counter-reset",cursor:"cursor",pointer:"pointer",direction:"direction",display:"display",emptyCells:"empty-cells",filter:"filter",flex:"flex",flexBasis:"flex-basis",flexDirection:"flex-direction",flexDir:"flex-direction",flexFlow:"flex-flow",flexGrow:"flex-grow",flexShrink:"flex-shrink",flexWrap:"flex-wrap",float:"float",font:"font",fontFamily:"font-family",fontKerning:"font-kerning",s:"font-size",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",bold:"bold",fontWeight:"font-weight",b:"font-weight",gap:"gap",grid:"grid",gridArea:"grid-area",gridAutoColumns:"grid-auto-columns",gridAutoFlow:"grid-auto-flow",gridAutoRows:"grid-auto-rows",gridColumn:"grid-column",gridColumnEnd:"grid-column-end",gridColumnGap:"grid-column-gap",gridColumnStart:"grid-column-start",gridGap:"grid-gap",gridRow:"grid-row",gridRowEnd:"grid-row-end",gridRowGap:"grid-row-gap",gridRowStart:"grid-row-start",gridTemplate:"grid-template",gridTemplateAreas:"grid-template-areas","grid-areas":"grid-template-areas",gridTemplateColumns:"grid-template-columns","grid-cols":"grid-template-columns",gridTemplateRows:"grid-template-rows","grid-rows":"grid-template-rows",hangingPunctuation:"hanging-punctuation",hyphens:"hyphens",isolation:"isolation",justifyContent:"justify-content",left:"left",letterSpacing:"letter-spacing",lineHeight:"line-height",lh:"line-height",listStyle:"list-style",listStyleImage:"list-style-image",listStylePosition:"list-style-position",listStyleType:"list-style-type",aspectRatio:"aspect-ratio",margin:"margin",m:"margin",marginBottom:"margin-bottom",mb:"margin-bottom",marginLeft:"margin-left",ml:"margin-left",marginRight:"margin-right",mr:"margin-right",marginTop:"margin-top",mt:"margin-top",height:"height",h:"height",minHeight:"min-height",minH:"min-height",maxHeight:"max-height",maxH:"max-height",width:"width",w:"width",minWidth:"min-width",minW:"min-width",maxWidth:"max-width",maxW:"max-width",mixBlendMode:"mix-blend-mode",objectFit:"object-fit",objectPosition:"object-position",opacity:"opacity",order:"order",outline:"outline",outlineColor:"outline-color",outlineOffset:"outline-offset",outlineStyle:"outline-style",outlineWidth:"outline-width",overflow:"overflow",overflowX:"overflow-x",overflowY:"overflow-y",padding:"padding",p:"padding",paddingBottom:"padding-bottom",pb:"padding-bottom",paddingLeft:"padding-left",pl:"padding-left",paddingRight:"padding-right",pr:"padding-right",paddingTop:"padding-top",pt:"padding-top",pageBreakAfter:"page-break-after",pageBreakBefore:"page-break-before",pageBreakInside:"page-break-inside",perspective:"perspective",perspectiveOrigin:"perspective-origin",pointerEvents:"pointer-events",position:"position",quotes:"quotes",resize:"resize",right:"right",scrollBehavior:"scroll-behavior",tabSize:"tab-size",tableLayout:"table-layout",align:"text-align",textAlign:"text-align",textAlignLast:"text-align-last",textDecoration:"text-decoration",td:"text-decoration",textDecorationColor:"text-decoration-color",textDecorationLine:"text-decoration-line",textDecorationStyle:"text-decoration-style",textIndent:"text-indent",textJustify:"text-justify",textOverflow:"text-overflow",textShadow:"text-shadow",textTransform:"text-transform",textStroke:"-webkit-text-stroke",top:"top",transform:"transform","transform(2D)":"transform(2D)",transformOrigin:"transform-origin",origin:"transform-origin",transformStyle:"transform-style",transition:"transition",transitionDelay:"transition-delay",transitionDuration:"transition-duration",transitionProperty:"transition-property",transitionTimingFunction:"transition-timing-function",unicodeBidi:"unicode-bidi",userSelect:"user-select",verticalAlign:"vertical-align",visibility:"visibility",whiteSpace:"white-space",wordBreak:"word-break",wordSpacing:"word-spacing",textWrap:"textWrap",wordWrap:"word-wrap",writingMode:"writing-mode",zIndex:"z-index",backdropFilter:"backdrop-filter",placeItems:"place-items",placeContent:"place-content",corner:"corner-shape",ph:"padding-left:__VALUE__;padding-right:__VALUE__;",pv:"padding-top:__VALUE__;padding-bottom:__VALUE__;",mh:"margin-left:__VALUE__;margin-right:__VALUE__;",mv:"margin-top:__VALUE__;margin-bottom:__VALUE__;",translate:"translate: __VALUE__;",translateX:"translate: __VALUE__ 0px 0px;",translateY:"translate: 0px __VALUE__ 0px;",translateZ:"translate: 0px 0px __VALUE__;",x:"translate: __VALUE__ 0px 0px;",y:"translate: 0px __VALUE__ 0px;",z:"translate: 0px 0px __VALUE__;",rotate:"rotate: __VALUE__;",rotateX:"rotate: 1 0 0 __VALUE__;",rotateY:"rotate: 0 1 0 __VALUE__;",rotateZ:"rotate: 0 0 1 __VALUE__;",rotate3d:"rotate: 1 1 1 __VALUE__;",scale:"scale: __VALUE__;",view:"perspective: __VALUE__;",anim:"transition: all __VALUE__ __CURVE__ __DELAY__;",blur:"filter: blur(__VALUE__);",saturate:"filter: saturate(__VALUE__);",brightness:"filter: brightness(__VALUE__);",ratio:"aspect-ratio: __VALUE__;",extend:"@extend __VALUE__;"},_={content:"content:'';",bold:"font-weight: bold;",grid:"display:grid;",flex:"display:flex;",wrap:"flex-wrap:wrap;",cols:"flex-direction:column;","cols-reverse":"flex-direction:column-reverse;","cols-rev":"flex-direction:column-reverse;",ass:"align-self:flex-start;",ais:"align-items:flex-start;",aib:"align-items:baseline;",aic:"align-items:center;","align-items-center":"align-items:center;",aie:"align-items:flex-end;",jcs:"justify-content:flex-start;",jcc:"justify-content:center;",jce:"justify-content:flex-end;",jcb:"justify-content:space-between;",jca:"justify-content:space-around;",pis:"place-items:start",pie:"place-items:end",pic:"place-items:center",pist:"place-items:stretch",pcs:"place-content:start",pcc:"place-content:center",pce:"place-content:end",pcst:"place-content:stretch",tal:"text-align: left;",tac:"text-align: center;",tar:"text-align: right;",tas:"text-align: justify;",fill:"top: 0px;left: 0px;right: 0px;bottom: 0px;",rel:"position:relative;",abs:"position:absolute;",fixed:"position:fixed;",sticky:"position:sticky;",abc:"top:50%;left:50%;--abc-x:-50%;--abc-y:-50%;translate:calc(var(--abc-x) + var(--fx-x, 0px)) calc(var(--abc-y) + var(--fx-y, 0px));",tdn:"text-decoration:none;",tdu:"text-decoration:underline;",nous:"user-select:none;",nope:"pointer-events:none;","3d":"transform-style: preserve-3d;",hide:"display: none;",block:"display: block;",inlineblock:"display: inline-block;","center-h":"left: 50%;--abc-x: -50%;translate: calc(var(--abc-x) + var(--fx-x, 0px)) var(--fx-y, 0px);","center-x":"left: 50%;--abc-x: -50%;translate: calc(var(--abc-x) + var(--fx-x, 0px)) var(--fx-y, 0px);","center-v":"top: 50%;--abc-y: -50%;translate: var(--fx-x, 0px) calc(var(--abc-y) + var(--fx-y, 0px));","center-y":"top: 50%;--abc-y: -50%;translate: var(--fx-x, 0px) calc(var(--abc-y) + var(--fx-y, 0px));","no-overflow":"overflow: hidden;","no-overflow-x":"overflow-x: hidden;","no-overflow-y":"overflow-y: hidden;","overflow-x":"overflow-x: auto;","overflow-y":"overflow-y: auto;","scroll-x":"overflow-x: auto;","scroll-y":"overflow-y: auto;","space-pre":"white-space: pre;","white-space-pre":"white-space: pre;","text-wrap":"width: 98%;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;","text-clip":"color: transparent;background-clip: text;-webkit-background-clip: text;","word-break":"word-break: break-word;",uppercase:"text-transform: uppercase;",lowercase:"text-transform: lowercase;",capitalize:"text-transform: capitalize;"},y=["color","bg","background","background-color","border","border-color","border-top-color","border-right-color","border-bottom-color","border-left-color","outline-color","text-decoration-color","text-shadow","box-shadow","fill","stroke","stop-color","caret-color","column-rule-color","text-emphasis-color","accent-color","border-block-color","border-inline-color","column-fill","marker","scrollbar-color","outline-offset-color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor","textDecorationColor","textShadow","boxShadow","fill","stroke","stopColor","caretColor","columnRuleColor","textEmphasisColor","accentColor","borderBlockColor","borderInlineColor","columnFill","marker","scrollbarColor","outlineOffsetColor"],w={ease:"ease",in:"ease-in",out:"ease-out",inout:"ease-in-out",linear:"linear",start:"step-start",end:"step-end",steps:"steps",cubic:"cubic-bezier",initial:"initial",inherit:"inherit"};var S=["translate","translateX","translateY","translateZ","scale","scaleX","scaleY","scaleZ","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY","perspective","matrix","matrix3d"],$=["blur","brightness","contrast","drop-shadow","grayscale","hue-rotate","invert","saturate","sepia"],L={w:"width",minW:"minWidth",maxW:"maxWidth",h:"height",minH:"minHeight",maxH:"maxHeight",x:"translateX",y:"translateY",z:"translateZ",r:"rotate",rx:"rotateX",ry:"rotateY",rz:"rotateZ",s:"scale",sx:"scaleX",sy:"scaleY",sz:"scaleZ"};var k={name:"@zuzjs/ui",version:"1.0.3",description:"ZuzJS UI Library",keywords:["react","zuz","zuz.js","zuz ui","zuzui"],homepage:"https://ui.zuz.com.pk",bugs:{url:"https://github.com/zuzpk/zuzjs-ui/issues"},repository:{type:"git",url:"git+https://github.com/zuzpk/zuzjs-ui.git"},license:"MIT",author:"Zuz.js Team <support@zuz.com.pk>",type:"module",main:"./dist/index.cjs",module:"./dist/index.js",types:"./dist/index.d.ts",bin:{zuzjs:"./dist/bin.cjs"},exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./styles":"./dist/css/styles.css"},files:["dist"],scripts:{"dev:js":"tsup --watch","dev:css":"sass --watch --no-source-map --silence-deprecation=legacy-js-api src/scss:dist/css --style compressed",dev:"npm-run-all -p dev:*",build:"tsup && npm run build:css","build:css":"sass src/scss:dist/css --style compressed --no-source-map",prepare:"husky",publish:"rm -rf dist && npm run build && node publish-pre.js && npm publish && node publish-post.js"},dependencies:{"@zuzjs/core":"workspace:*","@zuzjs/hooks":"workspace:*",chokidar:"^5.0.0",commander:"^14.0.2","date-fns":"^4.1.0",hashids:"^2.3.0","js-cookie":"^3.0.5",md5:"^2.3.0",moment:"^2.30.1",nanoid:"^5.1.6",picocolors:"^1.1.1","ts-morph":"^27.0.2"},peerDependencies:{react:"^19.2.3","react-dom":"^19.2.3"},devDependencies:{"@types/md5":"^2.3.6","@types/react":"^19.2.13","@types/react-dom":"^19.2.3",tsup:"^8.5.1","npm-run-all":"^4.1.5"}};var R=k.name,W=(p,e=[])=>{let t=["as",...e],o={...p};return Object.keys(o).map(i=>{i in g&&delete o[i];}),"skeleton"in t&&t.skeleton.enabled==true&&delete o.children,t.map(i=>i in o&&delete o[i]),o},M=p=>{let e=[],t="",o=0;for(let i=0;i<p.length;i++){let r=p[i];(r==="["||r==="(")&&o++,(r==="]"||r===")")&&o--,/\s/.test(r)&&o===0?(t.trim()&&e.push(t.trim()),t=""):t+=r;}return t.trim()&&e.push(t.trim()),e};var h=class{propMap=g;directMap=_;colorProps=new Set(y);animationCurves=w;delimeter=",";hashids;mediaQueries={ph:"(max-width: 599px)",sm:"(min-width: 600px) and (max-width: 767px)",md:"(min-width: 768px)",lg:"(min-width: 992px)",xl:"(min-width: 1200px)"};__SALT="zuzjs-ui";fileMap=new Map;cache=new Map;ruleTracker=new Map;dollorToVarRegexp=/\$([a-zA-Z0-9_-]+)/g;constructor(){this.hashids=new z(this.__SALT,5);}parseAndGenerate(e,t){let o=this.tokenize(e),i=[];this.fileMap.has(t)||this.fileMap.set(t,new Set);for(let r of o){let n=this.generateAtomicClass(r);i.push(n),this.fileMap.get(t).add(n);}return i}tokenize(e){let t=[],o=0,i=r=>{let n="",a=0;for(;o<e.length;){let s=e[o];if(s==="["&&a++,s==="]"&&a--,s==="("&&a===0){let l=n.trim(),c={...r};l.startsWith("&")?c.pseudo=l.replace("&",""):l.startsWith("@")?c.media=l.replace("@",""):c.selector=r.selector?`${r.selector} ${l}`:l,n="",o++,i(c);}else if(s===")"&&a===0){n.trim()&&this.pushToken(t,n.trim(),r),n="";return}else (s===" "||s===`
|
|
2
|
+
`)&&a===0?(n.trim()&&this.pushToken(t,n.trim(),r),n=""):n+=s;o++;}n.trim()&&this.pushToken(t,n.trim(),r);};return i({}),t}pushToken(e,t,o){let i=t.trim();if(i.includes(":")){let r=i.indexOf(":"),n=i.slice(0,r).trim(),a=i.slice(r+1).trim();e.push({prop:n.trim(),value:a.trim(),...o});}else this.directMap[i]?e.push({prop:i,value:void 0,isCustom:false,...o}):e.push({prop:t.trim(),isCustom:true,...o});}generateAtomicClass(e){let{prop:t,value:o,pseudo:i,media:r,selector:n,isCustom:a}=e;if(a)return t;let s="";if(!o&&this.directMap[t])s=this.directMap[t];else {let d=this.propMap[t]||t;s=d.includes("__")?this.resolveComplexTemplate(t,o||"",d):`${d}: ${this.processValue(t,o||"")};`;}let l=`${s}|${i||""}|${r||""}|${n||""}`;if(this.ruleTracker.has(l))return this.ruleTracker.get(l);let c=`z${l.charAt(0)}${this.generateHash(l)}`,m=`${`.${c}${i?`:${i}`:""}${n?` ${n}`:""}`} { ${s} }`;return r&&r.split(" ").forEach(d=>{d==="dark"?m=`[color-scheme="dark"] ${m}`:this.mediaQueries[d]&&(m=`@media ${this.mediaQueries[d]} { ${m} }`);}),this.cache.set(c,m),this.ruleTracker.set(l,c),c}resolveComplexTemplate(e,t,o){let i=t.split(this.delimeter),r=o;if(e==="anim"){let[n,a,s]=i;r=r.replace("__VALUE__",this.processValue("transitionDuration",n||"0s")).replace("__CURVE__",this.animationCurves[a]||"ease-in-out").replace("__DELAY__",this.processValue("transitionDelay",s||"0s"));}else if(e==="rotate3d"){let[n,a,s,l]=i;r=r.replace("__X__",n||"0").replace("__Y__",a||"0").replace("__Z__",s||"0").replace("__A__",l?isNaN(Number(l))?l:`${l}deg`:"0deg");}return r.replace(/__VALUE__/g,this.processValue(e,i[0]||""))}transformBrackets(e){return e.replace(/\[/g,"(").replace(/\]/g,")").replace(this.dollorToVarRegexp,"var(--$1)")}addUnitsSafely(e,t){return ["opacity","zIndex","flex","b","font-weight","fontWeight","lineHeight","scale"].includes(e)?t:/^-?\d*\.?\d+$/.test(t)?`${t}${e=="rotate"?"deg":"px"}`:t.replace(/(?<=^|[\s\+\-\*\/\(\,])(-?\d*\.?\d+)(?=$|[\s\+\-\*\/\)\,])/g,(i,r,n,a)=>a.substring(0,n).trim().endsWith("repeat(")?i:`${i}px`)}processValue(e,t){let o=false;t.endsWith("!")&&(o=true,t=t.slice(0,-1));let i="";if(t.trim()=="full")i="100%";else if(this.propMap[e]&&["xs","sm","md","lg","xl","xxl"].includes(t.trim())){let r=this.propMap[e],n={"border-radius":"radius","line-height":"lh","font-size":"text"};i=`var(--${r in n?n[r]:r}-${t.trim()})`;}else if(t.includes("[")||t.includes("]")){let r=this.transformBrackets(t),[n]=t.split("[");["rgba","rgb"].includes(n)?i=r:i=this.addUnitsSafely(e,r);}else t.includes(",")?i=t.split(",").map(r=>this.processValue(e,r.trim())).join(" "):/^-?\d*\.?\d+$/.test(t)?i=this.addUnitsSafely(e,t):isColor(t)?i=this.makeColor(t):t.startsWith("gradient")||t.startsWith("linear-gradient")||t.startsWith("radial-gradient")?i=this.parseGradient(t):i=t.replace(this.dollorToVarRegexp,"var(--$1)");return o?`${i} !important`:i}addUnitsToComplexValue(e,t){if(["opacity","zIndex","flex","b","fontWeight","lineHeight"].includes(e))return t;try{return String(t).replace(/(\d+)(?![%a-zA-Z!])/g,"$1px")}catch{return t}}makeColor(e){return e.charAt(0)=="#"&&(e=e.substring(1)),e.charAt(0)=="$"?`var(--${e.replace("$","")})`:/^#[0-9A-F]{6}[0-9a-f]{0,2}$/i.test(`#${e}`)||/^#([0-9A-F]{3}){1,2}$/i.test(`#${e}`)?`#${e}`:e.includes("rgb")||e.includes("rgba")?e.replace(/\[/g,"(").replace(/\]/g,")"):e.trim()}parseGradient(e){e.startsWith("gradient")&&(e=`linear-${e}`);let[t,o,i,r,...n]=e.split("-"),a=e,s=/^[+-]?\d+(\.\d+)?$/.test(r)?`${r}deg`:`to ${r}`,l=n.reduce((c,f)=>(c.push(this.makeColor(f)),c),[]).join(", ");switch(t){case "linear":a=`linear-gradient(${s}, ${l})`;break;case "radial":break;default:a=e;break}return a}generateHash(e,t=6){let o=5381;for(let r=0;r<e.length;r++)o=(o<<5)+o+e.charCodeAt(r);return (o>>>0&1048575).toString(36).padStart(t,"0")}getStyleSheet(){return Array.from(this.cache.values()).join(`
|
|
3
|
+
`)}getCache(){return this.cache}clearFileCache(e){this.fileMap.delete(e);}writeToDisk(e){let t=new Set;this.fileMap.forEach(r=>{r.forEach(n=>t.add(n));});let o=[];t.forEach(r=>{this.cache.has(r)&&o.push(this.cache.get(r));});let i=`/* Zuz Generated CSS */
|
|
4
|
+
|
|
5
|
+
${o.join(`
|
|
6
|
+
`)}`;u.existsSync(dirname(e))||u.mkdirSync(dirname(e)),u.writeFileSync(e,i);}},X=new h;export{g as a,_ as b,S as c,$ as d,L as e,k as f,R as g,W as h,M as i,X as j};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
'use strict';var C=require('hashids'),u=require('fs'),path=require('path'),core=require('@zuzjs/core');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var C__default=/*#__PURE__*/_interopDefault(C);var u__default=/*#__PURE__*/_interopDefault(u);/* ZuzJS UI CLI */
|
|
2
|
+
var g={alignContent:"align-content",alignItems:"align-items",alignSelf:"align-self",animation:"animation",animationDelay:"animation-delay",animationDirection:"animation-direction",animationDuration:"animation-duration",animationFillMode:"animation-fill-mode",animationIterationCount:"animation-iteration-count",animationName:"animation-name",animationPlayState:"animation-play-state",animationTimingFunction:"animation-timing-function",background:"background",bg:"background",backgroundColor:"background-color",backgroundImage:"background-image",bgi:"background-image",bgc:"background-color",backgroundOrigin:"background-origin",backgroundPosition:"background-position",backgroundRepeat:"background-repeat",backgroundSize:"background-size",backfaceVisibility:"backface-visibility",backgroundAttachment:"background-attachment",backgroundBlendMode:"background-blend-mode",backgroundClip:"background-clip","bg-clip":"background-clip",border:"border",borderBottom:"border-bottom",borderBottomColor:"border-bottom-color",borderBottomStyle:"border-bottom-style",borderBottomWidth:"border-bottom-width",borderCollapse:"border-collapse",borderColor:"border-color",borderImage:"border-image",borderImageOutset:"border-image-outset",borderImageRepeat:"border-image-repeat",borderImageSlice:"border-image-slice",borderImageSource:"border-image-source",borderImageWidth:"border-image-width",borderLeft:"border-left",borderLeftColor:"border-left-color",borderLeftStyle:"border-left-style",borderLeftWidth:"border-left-width",borderRight:"border-right",borderRightColor:"border-right-color",borderRightStyle:"border-right-style",borderRightWidth:"border-right-width",borderSpacing:"border-spacing",borderStyle:"border-style",borderTop:"border-top",borderTopColor:"border-top-color",borderTopStyle:"border-top-style",borderTopWidth:"border-top-width",borderWidth:"border-width",borderRadius:"border-radius",r:"border-radius",radius:"border-radius",borderTopLeftRadius:"border-top-left-radius",rtl:"border-top-left-radius",borderTopRightRadius:"border-top-right-radius",rtr:"border-top-right-radius",borderBottomLeftRadius:"border-bottom-left-radius",rbl:"border-bottom-left-radius",borderBottomRightRadius:"border-bottom-right-radius",rbr:"border-bottom-right-radius",bottom:"bottom",boxDecorationBreak:"box-decoration-break",boxShadow:"box-shadow",shadow:"box-shadow",boxSizing:"box-sizing",captionSide:"caption-side",caretColor:"caret-color","@charset":"@charset",clear:"clear",clip:"clip-path",clipPath:"clip-path",color:"color",c:"color",columnCount:"column-count",columnFill:"column-fill",columnGap:"column-gap",colGap:"column-gap",columnRule:"column-rule",columnRuleColor:"column-rule-color",columnRuleStyle:"column-rule-style",columnRuleWidth:"column-rule-width",columnSpan:"column-span",columnWidth:"column-width",columns:"columns",content:"content",counterIncrement:"counter-increment",counterReset:"counter-reset",cursor:"cursor",pointer:"pointer",direction:"direction",display:"display",emptyCells:"empty-cells",filter:"filter",flex:"flex",flexBasis:"flex-basis",flexDirection:"flex-direction",flexDir:"flex-direction",flexFlow:"flex-flow",flexGrow:"flex-grow",flexShrink:"flex-shrink",flexWrap:"flex-wrap",float:"float",font:"font",fontFamily:"font-family",fontKerning:"font-kerning",s:"font-size",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",bold:"bold",fontWeight:"font-weight",b:"font-weight",gap:"gap",grid:"grid",gridArea:"grid-area",gridAutoColumns:"grid-auto-columns",gridAutoFlow:"grid-auto-flow",gridAutoRows:"grid-auto-rows",gridColumn:"grid-column",gridColumnEnd:"grid-column-end",gridColumnGap:"grid-column-gap",gridColumnStart:"grid-column-start",gridGap:"grid-gap",gridRow:"grid-row",gridRowEnd:"grid-row-end",gridRowGap:"grid-row-gap",gridRowStart:"grid-row-start",gridTemplate:"grid-template",gridTemplateAreas:"grid-template-areas","grid-areas":"grid-template-areas",gridTemplateColumns:"grid-template-columns","grid-cols":"grid-template-columns",gridTemplateRows:"grid-template-rows","grid-rows":"grid-template-rows",hangingPunctuation:"hanging-punctuation",hyphens:"hyphens",isolation:"isolation",justifyContent:"justify-content",left:"left",letterSpacing:"letter-spacing",lineHeight:"line-height",lh:"line-height",listStyle:"list-style",listStyleImage:"list-style-image",listStylePosition:"list-style-position",listStyleType:"list-style-type",aspectRatio:"aspect-ratio",margin:"margin",m:"margin",marginBottom:"margin-bottom",mb:"margin-bottom",marginLeft:"margin-left",ml:"margin-left",marginRight:"margin-right",mr:"margin-right",marginTop:"margin-top",mt:"margin-top",height:"height",h:"height",minHeight:"min-height",minH:"min-height",maxHeight:"max-height",maxH:"max-height",width:"width",w:"width",minWidth:"min-width",minW:"min-width",maxWidth:"max-width",maxW:"max-width",mixBlendMode:"mix-blend-mode",objectFit:"object-fit",objectPosition:"object-position",opacity:"opacity",order:"order",outline:"outline",outlineColor:"outline-color",outlineOffset:"outline-offset",outlineStyle:"outline-style",outlineWidth:"outline-width",overflow:"overflow",overflowX:"overflow-x",overflowY:"overflow-y",padding:"padding",p:"padding",paddingBottom:"padding-bottom",pb:"padding-bottom",paddingLeft:"padding-left",pl:"padding-left",paddingRight:"padding-right",pr:"padding-right",paddingTop:"padding-top",pt:"padding-top",pageBreakAfter:"page-break-after",pageBreakBefore:"page-break-before",pageBreakInside:"page-break-inside",perspective:"perspective",perspectiveOrigin:"perspective-origin",pointerEvents:"pointer-events",position:"position",quotes:"quotes",resize:"resize",right:"right",scrollBehavior:"scroll-behavior",tabSize:"tab-size",tableLayout:"table-layout",align:"text-align",textAlign:"text-align",textAlignLast:"text-align-last",textDecoration:"text-decoration",td:"text-decoration",textDecorationColor:"text-decoration-color",textDecorationLine:"text-decoration-line",textDecorationStyle:"text-decoration-style",textIndent:"text-indent",textJustify:"text-justify",textOverflow:"text-overflow",textShadow:"text-shadow",textTransform:"text-transform",textStroke:"-webkit-text-stroke",top:"top",transform:"transform","transform(2D)":"transform(2D)",transformOrigin:"transform-origin",origin:"transform-origin",transformStyle:"transform-style",transition:"transition",transitionDelay:"transition-delay",transitionDuration:"transition-duration",transitionProperty:"transition-property",transitionTimingFunction:"transition-timing-function",unicodeBidi:"unicode-bidi",userSelect:"user-select",verticalAlign:"vertical-align",visibility:"visibility",whiteSpace:"white-space",wordBreak:"word-break",wordSpacing:"word-spacing",textWrap:"textWrap",wordWrap:"word-wrap",writingMode:"writing-mode",zIndex:"z-index",backdropFilter:"backdrop-filter",placeItems:"place-items",placeContent:"place-content",corner:"corner-shape",ph:"padding-left:__VALUE__;padding-right:__VALUE__;",pv:"padding-top:__VALUE__;padding-bottom:__VALUE__;",mh:"margin-left:__VALUE__;margin-right:__VALUE__;",mv:"margin-top:__VALUE__;margin-bottom:__VALUE__;",translate:"translate: __VALUE__;",translateX:"translate: __VALUE__ 0px 0px;",translateY:"translate: 0px __VALUE__ 0px;",translateZ:"translate: 0px 0px __VALUE__;",x:"translate: __VALUE__ 0px 0px;",y:"translate: 0px __VALUE__ 0px;",z:"translate: 0px 0px __VALUE__;",rotate:"rotate: __VALUE__;",rotateX:"rotate: 1 0 0 __VALUE__;",rotateY:"rotate: 0 1 0 __VALUE__;",rotateZ:"rotate: 0 0 1 __VALUE__;",rotate3d:"rotate: 1 1 1 __VALUE__;",scale:"scale: __VALUE__;",view:"perspective: __VALUE__;",anim:"transition: all __VALUE__ __CURVE__ __DELAY__;",blur:"filter: blur(__VALUE__);",saturate:"filter: saturate(__VALUE__);",brightness:"filter: brightness(__VALUE__);",ratio:"aspect-ratio: __VALUE__;",extend:"@extend __VALUE__;"},x={content:"content:'';",bold:"font-weight: bold;",grid:"display:grid;",flex:"display:flex;",wrap:"flex-wrap:wrap;",cols:"flex-direction:column;","cols-reverse":"flex-direction:column-reverse;","cols-rev":"flex-direction:column-reverse;",ass:"align-self:flex-start;",ais:"align-items:flex-start;",aib:"align-items:baseline;",aic:"align-items:center;","align-items-center":"align-items:center;",aie:"align-items:flex-end;",jcs:"justify-content:flex-start;",jcc:"justify-content:center;",jce:"justify-content:flex-end;",jcb:"justify-content:space-between;",jca:"justify-content:space-around;",pis:"place-items:start",pie:"place-items:end",pic:"place-items:center",pist:"place-items:stretch",pcs:"place-content:start",pcc:"place-content:center",pce:"place-content:end",pcst:"place-content:stretch",tal:"text-align: left;",tac:"text-align: center;",tar:"text-align: right;",tas:"text-align: justify;",fill:"top: 0px;left: 0px;right: 0px;bottom: 0px;",rel:"position:relative;",abs:"position:absolute;",fixed:"position:fixed;",sticky:"position:sticky;",abc:"top:50%;left:50%;--abc-x:-50%;--abc-y:-50%;translate:calc(var(--abc-x) + var(--fx-x, 0px)) calc(var(--abc-y) + var(--fx-y, 0px));",tdn:"text-decoration:none;",tdu:"text-decoration:underline;",nous:"user-select:none;",nope:"pointer-events:none;","3d":"transform-style: preserve-3d;",hide:"display: none;",block:"display: block;",inlineblock:"display: inline-block;","center-h":"left: 50%;--abc-x: -50%;translate: calc(var(--abc-x) + var(--fx-x, 0px)) var(--fx-y, 0px);","center-x":"left: 50%;--abc-x: -50%;translate: calc(var(--abc-x) + var(--fx-x, 0px)) var(--fx-y, 0px);","center-v":"top: 50%;--abc-y: -50%;translate: var(--fx-x, 0px) calc(var(--abc-y) + var(--fx-y, 0px));","center-y":"top: 50%;--abc-y: -50%;translate: var(--fx-x, 0px) calc(var(--abc-y) + var(--fx-y, 0px));","no-overflow":"overflow: hidden;","no-overflow-x":"overflow-x: hidden;","no-overflow-y":"overflow-y: hidden;","overflow-x":"overflow-x: auto;","overflow-y":"overflow-y: auto;","scroll-x":"overflow-x: auto;","scroll-y":"overflow-y: auto;","space-pre":"white-space: pre;","white-space-pre":"white-space: pre;","text-wrap":"width: 98%;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;","text-clip":"color: transparent;background-clip: text;-webkit-background-clip: text;","word-break":"word-break: break-word;",uppercase:"text-transform: uppercase;",lowercase:"text-transform: lowercase;",capitalize:"text-transform: capitalize;"},_=["color","bg","background","background-color","border","border-color","border-top-color","border-right-color","border-bottom-color","border-left-color","outline-color","text-decoration-color","text-shadow","box-shadow","fill","stroke","stop-color","caret-color","column-rule-color","text-emphasis-color","accent-color","border-block-color","border-inline-color","column-fill","marker","scrollbar-color","outline-offset-color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor","textDecorationColor","textShadow","boxShadow","fill","stroke","stopColor","caretColor","columnRuleColor","textEmphasisColor","accentColor","borderBlockColor","borderInlineColor","columnFill","marker","scrollbarColor","outlineOffsetColor"],y={ease:"ease",in:"ease-in",out:"ease-out",inout:"ease-in-out",linear:"linear",start:"step-start",end:"step-end",steps:"steps",cubic:"cubic-bezier",initial:"initial",inherit:"inherit"};var A=["translate","translateX","translateY","translateZ","scale","scaleX","scaleY","scaleZ","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY","perspective","matrix","matrix3d"],S=["blur","brightness","contrast","drop-shadow","grayscale","hue-rotate","invert","saturate","sepia"],$={w:"width",minW:"minWidth",maxW:"maxWidth",h:"height",minH:"minHeight",maxH:"maxHeight",x:"translateX",y:"translateY",z:"translateZ",r:"rotate",rx:"rotateX",ry:"rotateY",rz:"rotateZ",s:"scale",sx:"scaleX",sy:"scaleY",sz:"scaleZ"};var w={name:"@zuzjs/ui",version:"1.0.3",description:"ZuzJS UI Library",keywords:["react","zuz","zuz.js","zuz ui","zuzui"],homepage:"https://ui.zuz.com.pk",bugs:{url:"https://github.com/zuzpk/zuzjs-ui/issues"},repository:{type:"git",url:"git+https://github.com/zuzpk/zuzjs-ui.git"},license:"MIT",author:"Zuz.js Team <support@zuz.com.pk>",type:"module",main:"./dist/index.cjs",module:"./dist/index.js",types:"./dist/index.d.ts",bin:{zuzjs:"./dist/bin.cjs"},exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./styles":"./dist/css/styles.css"},files:["dist"],scripts:{"dev:js":"tsup --watch","dev:css":"sass --watch --no-source-map --silence-deprecation=legacy-js-api src/scss:dist/css --style compressed",dev:"npm-run-all -p dev:*",build:"tsup && npm run build:css","build:css":"sass src/scss:dist/css --style compressed --no-source-map",prepare:"husky",publish:"rm -rf dist && npm run build && node publish-pre.js && npm publish && node publish-post.js"},dependencies:{"@zuzjs/core":"workspace:*","@zuzjs/hooks":"workspace:*",chokidar:"^5.0.0",commander:"^14.0.2","date-fns":"^4.1.0",hashids:"^2.3.0","js-cookie":"^3.0.5",md5:"^2.3.0",moment:"^2.30.1",nanoid:"^5.1.6",picocolors:"^1.1.1","ts-morph":"^27.0.2"},peerDependencies:{react:"^19.2.3","react-dom":"^19.2.3"},devDependencies:{"@types/md5":"^2.3.6","@types/react":"^19.2.13","@types/react-dom":"^19.2.3",tsup:"^8.5.1","npm-run-all":"^4.1.5"}};var U=w.name,R=(p,e=[])=>{let t=["as",...e],o={...p};return Object.keys(o).map(i=>{i in g&&delete o[i];}),"skeleton"in t&&t.skeleton.enabled==true&&delete o.children,t.map(i=>i in o&&delete o[i]),o},W=p=>{let e=[],t="",o=0;for(let i=0;i<p.length;i++){let r=p[i];(r==="["||r==="(")&&o++,(r==="]"||r===")")&&o--,/\s/.test(r)&&o===0?(t.trim()&&e.push(t.trim()),t=""):t+=r;}return t.trim()&&e.push(t.trim()),e};var h=class{propMap=g;directMap=x;colorProps=new Set(_);animationCurves=y;delimeter=",";hashids;mediaQueries={ph:"(max-width: 599px)",sm:"(min-width: 600px) and (max-width: 767px)",md:"(min-width: 768px)",lg:"(min-width: 992px)",xl:"(min-width: 1200px)"};__SALT="zuzjs-ui";fileMap=new Map;cache=new Map;ruleTracker=new Map;dollorToVarRegexp=/\$([a-zA-Z0-9_-]+)/g;constructor(){this.hashids=new C__default.default(this.__SALT,5);}parseAndGenerate(e,t){let o=this.tokenize(e),i=[];this.fileMap.has(t)||this.fileMap.set(t,new Set);for(let r of o){let n=this.generateAtomicClass(r);i.push(n),this.fileMap.get(t).add(n);}return i}tokenize(e){let t=[],o=0,i=r=>{let n="",a=0;for(;o<e.length;){let s=e[o];if(s==="["&&a++,s==="]"&&a--,s==="("&&a===0){let l=n.trim(),c={...r};l.startsWith("&")?c.pseudo=l.replace("&",""):l.startsWith("@")?c.media=l.replace("@",""):c.selector=r.selector?`${r.selector} ${l}`:l,n="",o++,i(c);}else if(s===")"&&a===0){n.trim()&&this.pushToken(t,n.trim(),r),n="";return}else (s===" "||s===`
|
|
3
|
+
`)&&a===0?(n.trim()&&this.pushToken(t,n.trim(),r),n=""):n+=s;o++;}n.trim()&&this.pushToken(t,n.trim(),r);};return i({}),t}pushToken(e,t,o){let i=t.trim();if(i.includes(":")){let r=i.indexOf(":"),n=i.slice(0,r).trim(),a=i.slice(r+1).trim();e.push({prop:n.trim(),value:a.trim(),...o});}else this.directMap[i]?e.push({prop:i,value:void 0,isCustom:false,...o}):e.push({prop:t.trim(),isCustom:true,...o});}generateAtomicClass(e){let{prop:t,value:o,pseudo:i,media:r,selector:n,isCustom:a}=e;if(a)return t;let s="";if(!o&&this.directMap[t])s=this.directMap[t];else {let d=this.propMap[t]||t;s=d.includes("__")?this.resolveComplexTemplate(t,o||"",d):`${d}: ${this.processValue(t,o||"")};`;}let l=`${s}|${i||""}|${r||""}|${n||""}`;if(this.ruleTracker.has(l))return this.ruleTracker.get(l);let c=`z${l.charAt(0)}${this.generateHash(l)}`,m=`${`.${c}${i?`:${i}`:""}${n?` ${n}`:""}`} { ${s} }`;return r&&r.split(" ").forEach(d=>{d==="dark"?m=`[color-scheme="dark"] ${m}`:this.mediaQueries[d]&&(m=`@media ${this.mediaQueries[d]} { ${m} }`);}),this.cache.set(c,m),this.ruleTracker.set(l,c),c}resolveComplexTemplate(e,t,o){let i=t.split(this.delimeter),r=o;if(e==="anim"){let[n,a,s]=i;r=r.replace("__VALUE__",this.processValue("transitionDuration",n||"0s")).replace("__CURVE__",this.animationCurves[a]||"ease-in-out").replace("__DELAY__",this.processValue("transitionDelay",s||"0s"));}else if(e==="rotate3d"){let[n,a,s,l]=i;r=r.replace("__X__",n||"0").replace("__Y__",a||"0").replace("__Z__",s||"0").replace("__A__",l?isNaN(Number(l))?l:`${l}deg`:"0deg");}return r.replace(/__VALUE__/g,this.processValue(e,i[0]||""))}transformBrackets(e){return e.replace(/\[/g,"(").replace(/\]/g,")").replace(this.dollorToVarRegexp,"var(--$1)")}addUnitsSafely(e,t){return ["opacity","zIndex","flex","b","font-weight","fontWeight","lineHeight","scale"].includes(e)?t:/^-?\d*\.?\d+$/.test(t)?`${t}${e=="rotate"?"deg":"px"}`:t.replace(/(?<=^|[\s\+\-\*\/\(\,])(-?\d*\.?\d+)(?=$|[\s\+\-\*\/\)\,])/g,(i,r,n,a)=>a.substring(0,n).trim().endsWith("repeat(")?i:`${i}px`)}processValue(e,t){let o=false;t.endsWith("!")&&(o=true,t=t.slice(0,-1));let i="";if(t.trim()=="full")i="100%";else if(this.propMap[e]&&["xs","sm","md","lg","xl","xxl"].includes(t.trim())){let r=this.propMap[e],n={"border-radius":"radius","line-height":"lh","font-size":"text"};i=`var(--${r in n?n[r]:r}-${t.trim()})`;}else if(t.includes("[")||t.includes("]")){let r=this.transformBrackets(t),[n]=t.split("[");["rgba","rgb"].includes(n)?i=r:i=this.addUnitsSafely(e,r);}else t.includes(",")?i=t.split(",").map(r=>this.processValue(e,r.trim())).join(" "):/^-?\d*\.?\d+$/.test(t)?i=this.addUnitsSafely(e,t):core.isColor(t)?i=this.makeColor(t):t.startsWith("gradient")||t.startsWith("linear-gradient")||t.startsWith("radial-gradient")?i=this.parseGradient(t):i=t.replace(this.dollorToVarRegexp,"var(--$1)");return o?`${i} !important`:i}addUnitsToComplexValue(e,t){if(["opacity","zIndex","flex","b","fontWeight","lineHeight"].includes(e))return t;try{return String(t).replace(/(\d+)(?![%a-zA-Z!])/g,"$1px")}catch{return t}}makeColor(e){return e.charAt(0)=="#"&&(e=e.substring(1)),e.charAt(0)=="$"?`var(--${e.replace("$","")})`:/^#[0-9A-F]{6}[0-9a-f]{0,2}$/i.test(`#${e}`)||/^#([0-9A-F]{3}){1,2}$/i.test(`#${e}`)?`#${e}`:e.includes("rgb")||e.includes("rgba")?e.replace(/\[/g,"(").replace(/\]/g,")"):e.trim()}parseGradient(e){e.startsWith("gradient")&&(e=`linear-${e}`);let[t,o,i,r,...n]=e.split("-"),a=e,s=/^[+-]?\d+(\.\d+)?$/.test(r)?`${r}deg`:`to ${r}`,l=n.reduce((c,f)=>(c.push(this.makeColor(f)),c),[]).join(", ");switch(t){case "linear":a=`linear-gradient(${s}, ${l})`;break;case "radial":break;default:a=e;break}return a}generateHash(e,t=6){let o=5381;for(let r=0;r<e.length;r++)o=(o<<5)+o+e.charCodeAt(r);return (o>>>0&1048575).toString(36).padStart(t,"0")}getStyleSheet(){return Array.from(this.cache.values()).join(`
|
|
4
|
+
`)}getCache(){return this.cache}clearFileCache(e){this.fileMap.delete(e);}writeToDisk(e){let t=new Set;this.fileMap.forEach(r=>{r.forEach(n=>t.add(n));});let o=[];t.forEach(r=>{this.cache.has(r)&&o.push(this.cache.get(r));});let i=`/* Zuz Generated CSS */
|
|
5
|
+
|
|
6
|
+
${o.join(`
|
|
7
|
+
`)}`;u__default.default.existsSync(path.dirname(e))||u__default.default.mkdirSync(path.dirname(e)),u__default.default.writeFileSync(e,i);}},Y=new h;exports.a=g;exports.b=x;exports.c=A;exports.d=S;exports.e=$;exports.f=w;exports.g=U;exports.h=R;exports.i=W;exports.j=Y;
|