@zuzjs/ui 1.0.20 → 1.0.21
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 +4 -4
- package/dist/bin.js +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.d.cts +22 -36
- package/dist/index.d.ts +22 -36
- package/dist/index.js +1 -1
- package/package.json +1 -1
- /package/dist/{chunk-IWMLQYPP.js → chunk-BLXOZG3O.js} +0 -0
- /package/dist/{chunk-WRPYWAQK.cjs → chunk-EDVIEQHU.cjs} +0 -0
package/dist/bin.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
'use strict';var
|
|
3
|
-
var k=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(l=>{this.extractStyles(l.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 a=n.getAttribute("as")?.asKind(tsMorph.SyntaxKind.JsxAttribute)?.getInitializer();a&&this.extractStyles(a);}),s.getDescendantsOfKind(tsMorph.SyntaxKind.CallExpression).filter(n=>n.getExpression().getText()==="css").forEach(n=>{let c=n.getArguments();c.length>0&&this.extractStyles(c[0]);}),this.stylesToGenerate.forEach(n=>{
|
|
4
|
-
export const zuzMap: Record<string, string> = ${JSON.stringify(this.manifest,null,2)};`;u__default.default.writeFileSync(e,g);}},y=new k;commander.program.opts();var S=process.cwd(),O=false,J=p__default.default.join(S,"src","app","css"),R=p__default.default.join(J,"zuz.scss"),W=p__default.default.join(J,"zuzmap.ts"),G=()=>{
|
|
2
|
+
'use strict';var chunkEDVIEQHU_cjs=require('./chunk-EDVIEQHU.cjs'),commander=require('commander'),Z=require('chokidar'),p=require('path'),i=require('picocolors'),u=require('fs'),tsMorph=require('ts-morph'),url=require('url');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var Z__default=/*#__PURE__*/_interopDefault(Z);var p__default=/*#__PURE__*/_interopDefault(p);var i__default=/*#__PURE__*/_interopDefault(i);var u__default=/*#__PURE__*/_interopDefault(u);/* ZuzJS UI CLI */
|
|
3
|
+
var k=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(l=>{this.extractStyles(l.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 a=n.getAttribute("as")?.asKind(tsMorph.SyntaxKind.JsxAttribute)?.getInitializer();a&&this.extractStyles(a);}),s.getDescendantsOfKind(tsMorph.SyntaxKind.CallExpression).filter(n=>n.getExpression().getText()==="css").forEach(n=>{let c=n.getArguments();c.length>0&&this.extractStyles(c[0]);}),this.stylesToGenerate.forEach(n=>{chunkEDVIEQHU_cjs.h(n).filter(Boolean).forEach(a=>{let x=a.match(/^([&@][\w-]+)\((.*)\)$/);if(x){let[h,z,F]=x;chunkEDVIEQHU_cjs.h(F).filter(Boolean).forEach(b=>{let v=`${z}(${b})`,w=chunkEDVIEQHU_cjs.i.parseAndGenerate(v,e);w.length>0&&(this.manifest[v]=w.join(" "));});let j=chunkEDVIEQHU_cjs.i.parseAndGenerate(a,e);j.length>0&&(this.manifest[a]=j.join(" "));}else {let h=chunkEDVIEQHU_cjs.i.parseAndGenerate(a,e);h.length>0&&(this.manifest[a]=h.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=[p__default.default.join(e,"src/app/css"),p__default.default.join(e,"app/css"),p__default.default.join(e,"src/css"),p__default.default.join(e,"css")],s=t.find(l=>u__default.default.existsSync(l))||t[0];return u__default.default.existsSync(s)||u__default.default.mkdirSync(s,{recursive:true}),p__default.default.join(s,"zuzmap.ts")};saveManifest(e){let t=p__default.default.dirname(e);u__default.default.existsSync(t)||u__default.default.mkdirSync(t,{recursive:true});let s=chunkEDVIEQHU_cjs.i.getCache(),l={};for(let[n,c]of Object.entries(this.manifest))s.has(c)&&(l[n]=c);this.manifest=l;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);}},y=new k;commander.program.opts();var S=process.cwd(),O=false,J=p__default.default.join(S,"src","app","css"),R=p__default.default.join(J,"zuz.scss"),W=p__default.default.join(J,"zuzmap.ts"),G=()=>{chunkEDVIEQHU_cjs.i.writeToDisk(R),y.saveManifest(W);},P=async()=>{try{let o=p__default.default.dirname(url.fileURLToPath(chunkEDVIEQHU_cjs.a)),e=p__default.default.resolve(o,"../package.json"),t=JSON.parse(u__default.default.readFileSync(e,"utf8")),g=(await(await fetch("https://registry.npmjs.org/@zuzjs/ui/latest")).json()).version.trim();if(g!==t.version.trim()){let n=` Update available! ${i__default.default.dim(t.version)} \u2192 ${i__default.default.green(g)} `,c=` Run: ${i__default.default.cyan(`npm i ${t.name}@latest`)} `,a=b=>b.replace(/\u001b\[[0-9;]*m/g,"").length,x=a(n),h=a(c),z=Math.max(x,h),F=i__default.default.yellow(`\u250C${"\u2500".repeat(z+2)}\u2510`),C=i__default.default.yellow(`\u2514${"\u2500".repeat(z+2)}\u2518`),j=(b,v)=>{let w=" ".repeat(z-v);return `${i__default.default.yellow("\u2502")} ${b}${w} ${i__default.default.yellow("\u2502")}`};console.log(`
|
|
5
5
|
${F}`),console.log(j(n,x)),console.log(j(c,h)),console.log(`${C}
|
|
6
|
-
`);}}catch{}};commander.program.command("init").description("Initialize Zuz snippets and configuration").action(()=>{let o=p__default.default.join(S,".vscode"),e=p__default.default.join(o,"zuz.code-snippets"),t=p__default.default.join(o,"settings.json"),s=Object.keys(
|
|
6
|
+
`);}}catch{}};commander.program.command("init").description("Initialize Zuz snippets and configuration").action(()=>{let o=p__default.default.join(S,".vscode"),e=p__default.default.join(o,"zuz.code-snippets"),t=p__default.default.join(o,"settings.json"),s=Object.keys(chunkEDVIEQHU_cjs.b).join(","),l=Object.keys(chunkEDVIEQHU_cjs.c).join(","),g={"Zuz Property":{prefix:"zp",body:[`as="\${1|${s}|}:$0"`],description:"Zuz Property (adds colon)"},"Zuz Shortcut":{prefix:"zs",body:[`as="\${1|${l}|}$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(()=>{P();let o=Z__default.default.watch(".",{cwd:S,ignored:[/node_modules/,/dist/,/\.next/,/\.git/],persistent:true,usePolling:true,followSymlinks:false,ignoreInitial:false});o.on("add",e=>{y.isSupportedFile(e)&&y.processFile(p__default.default.resolve(S,e)),O&&console.log(i__default.default.gray(`\u25CB File added: ${e}`));}),o.on("change",e=>{if(y.isSupportedFile(e)){console.log(i__default.default.gray(`\u25CB File changed: ${e}`));let t=p__default.default.resolve(S,e);chunkEDVIEQHU_cjs.i.clearFileCache(t),y.processFile(t),G(),console.log(i__default.default.blue("\u26A1 Zuz CSS updated."));}}),o.on("ready",()=>{O=true,G(),console.log(i__default.default.green(`
|
|
7
7
|
\u2713 Initial Build Complete.`)),console.log(i__default.default.cyan(`\u25CB Watching: ${p.basename(S)}
|
|
8
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,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {a,b,h,g}from'./chunk-
|
|
2
|
+
import {a,b,h,g}from'./chunk-BLXOZG3O.js';import {program}from'commander';import D from'chokidar';import p,{basename}from'path';import i from'picocolors';import u from'fs';import {Project,SyntaxKind,ScriptKind}from'ts-morph';import {fileURLToPath}from'url';var T=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(l=>{this.extractStyles(l.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 a=n.getAttribute("as")?.asKind(SyntaxKind.JsxAttribute)?.getInitializer();a&&this.extractStyles(a);}),s.getDescendantsOfKind(SyntaxKind.CallExpression).filter(n=>n.getExpression().getText()==="css").forEach(n=>{let c=n.getArguments();c.length>0&&this.extractStyles(c[0]);}),this.stylesToGenerate.forEach(n=>{g(n).filter(Boolean).forEach(a=>{let x=a.match(/^([&@][\w-]+)\((.*)\)$/);if(x){let[h$1,z,F]=x;g(F).filter(Boolean).forEach(b=>{let v=`${z}(${b})`,w=h.parseAndGenerate(v,e);w.length>0&&(this.manifest[v]=w.join(" "));});let j=h.parseAndGenerate(a,e);j.length>0&&(this.manifest[a]=j.join(" "));}else {let h$1=h.parseAndGenerate(a,e);h$1.length>0&&(this.manifest[a]=h$1.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=[p.join(e,"src/app/css"),p.join(e,"app/css"),p.join(e,"src/css"),p.join(e,"css")],s=t.find(l=>u.existsSync(l))||t[0];return u.existsSync(s)||u.mkdirSync(s,{recursive:true}),p.join(s,"zuzmap.ts")};saveManifest(e){let t=p.dirname(e);u.existsSync(t)||u.mkdirSync(t,{recursive:true});let s=h.getCache(),l={};for(let[n,c]of Object.entries(this.manifest))s.has(c)&&(l[n]=c);this.manifest=l;let g=`/* Zuz Generated Manifest - Do not edit */
|
|
3
3
|
export const zuzMap: Record<string, string> = ${JSON.stringify(this.manifest,null,2)};`;u.writeFileSync(e,g);}},y=new T;program.opts();var S=process.cwd(),A=false,G=p.join(S,"src","app","css"),W=p.join(G,"zuz.scss"),P=p.join(G,"zuzmap.ts"),O=()=>{h.writeToDisk(W),y.saveManifest(P);},I=async()=>{try{let o=p.dirname(fileURLToPath(import.meta.url)),e=p.resolve(o,"../package.json"),t=JSON.parse(u.readFileSync(e,"utf8")),g=(await(await fetch("https://registry.npmjs.org/@zuzjs/ui/latest")).json()).version.trim();if(g!==t.version.trim()){let n=` Update available! ${i.dim(t.version)} \u2192 ${i.green(g)} `,c=` Run: ${i.cyan(`npm i ${t.name}@latest`)} `,a=b=>b.replace(/\u001b\[[0-9;]*m/g,"").length,x=a(n),h=a(c),z=Math.max(x,h),F=i.yellow(`\u250C${"\u2500".repeat(z+2)}\u2510`),k=i.yellow(`\u2514${"\u2500".repeat(z+2)}\u2518`),j=(b,v)=>{let w=" ".repeat(z-v);return `${i.yellow("\u2502")} ${b}${w} ${i.yellow("\u2502")}`};console.log(`
|
|
4
4
|
${F}`),console.log(j(n,x)),console.log(j(c,h)),console.log(`${k}
|
|
5
5
|
`);}}catch{}};program.command("init").description("Initialize Zuz snippets and configuration").action(()=>{let o=p.join(S,".vscode"),e=p.join(o,"zuz.code-snippets"),t=p.join(o,"settings.json"),s=Object.keys(a).join(","),l=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|${l}|}$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(()=>{I();let o=D.watch(".",{cwd:S,ignored:[/node_modules/,/dist/,/\.next/,/\.git/],persistent:true,usePolling:true,followSymlinks:false,ignoreInitial:false});o.on("add",e=>{y.isSupportedFile(e)&&y.processFile(p.resolve(S,e)),A&&console.log(i.gray(`\u25CB File added: ${e}`));}),o.on("change",e=>{if(y.isSupportedFile(e)){console.log(i.gray(`\u25CB File changed: ${e}`));let t=p.resolve(S,e);h.clearFileCache(t),y.processFile(t),O(),console.log(i.blue("\u26A1 Zuz CSS updated."));}}),o.on("ready",()=>{A=true,O(),console.log(i.green(`
|
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
'use strict';var
|
|
2
|
-
var zo={Circle:"CIRCLE",Square:"SQUARE"},Bp={Default:"DEFAULT",Circle:"CIRCLE"},Lp={Light:"light",Dark:"dark",System:"system"},ye={Default:"DEFAULT",Switch:"SWITCH"},Bt={Auto:"auto",Top:"top",Bottom:"bottom",Left:"left",Right:"right"},ee=Bt,Ke=hooks.AnchorType,Mp=Ke,W={XSmall:"xs",Small:"sm",Medium:"md",Large:"lg",XLarge:"xl"},kp={Asc:"ASC",Desc:"DESC"},Op={String:"STRING",Number:"NUMBER",Boolean:"BOOLEAN",Array:"ARRAY",Object:"OBJECT",Date:"DATE",Time:"TIME",DateTime:"DATETIME",File:"FILE"},Dp={Dots:"DOTS"},be={IPV4:"IPV4",IPV6:"IPV6",Email:"EMAIL",Uri:"URI",Password:"PASSWORD",MatchField:"MATCHFIELD",Pattern:"*",GreaterThan:"GREATER_THAN"},le={Success:"success",Error:"error",Warning:"warning",Info:"info"},F={Spring:"SPRING",Liquid:"LIQUID",EaseInOut:"EASEINOUT",EaseOutBack:"EASEOUTBACK",Bounce:"BOUNCE"},G={FadeIn:"FADE_IN",ScaleIn:"SCALE_IN",SlideInTop:"SLIDE_FROM_TOP",SlideInRight:"SLIDE_FROM_RIGHT",SlideInBottom:"SLIDE_FROM_BOTTOM",SlideInLeft:"SLIDE_FROM_LEFT"},Hp={Success:"success",Error:"error",Idle:"idle",Dead:"dead"},me={Dialog:"DIALOG",Default:"DEFAULT",Error:"ERROR",Success:"SUCCESS",Warn:"WARN",Promise:"PROMISE"},He=me,Lt={Left:"LEFT",Right:"RIGHT",Center:"CENTER"},_o=Lt,Vp={Bar:"BAR",Ring:"RING"},mt={Default:"range",Text:"number"},Mt={Default:"DEFAULT",Card:"CARD"},ct={Gooey:"gooey"},se={Left:"LEFT",Right:"RIGHT",Top:"TOP",Bottom:"BOTTOM"};var Fo=Symbol.for("zuz.global.map"),Zo=o=>{globalThis[Fo]=o;},Ds=()=>globalThis[Fo]||{},kt=o=>{let n=Array.isArray(o)?o.join(" "):o;if(!n||typeof n!="string")return "";let e=Ds();return process.env.NODE_ENV==="development"&&Object.keys(e).length===0&&console.warn(`[${
|
|
1
|
+
'use strict';var chunkEDVIEQHU_cjs=require('./chunk-EDVIEQHU.cjs'),react=require('react'),hooks=require('@zuzjs/hooks'),reactDom=require('react-dom'),jsxRuntime=require('react/jsx-runtime'),core=require('@zuzjs/core'),react$1=require('@zuzjs/core/react'),dateFns=require('date-fns');/* ZuzJS UI CLI */
|
|
2
|
+
var zo={Circle:"CIRCLE",Square:"SQUARE"},Bp={Default:"DEFAULT",Circle:"CIRCLE"},Lp={Light:"light",Dark:"dark",System:"system"},ye={Default:"DEFAULT",Switch:"SWITCH"},Bt={Auto:"auto",Top:"top",Bottom:"bottom",Left:"left",Right:"right"},ee=Bt,Ke=hooks.AnchorType,Mp=Ke,W={XSmall:"xs",Small:"sm",Medium:"md",Large:"lg",XLarge:"xl"},kp={Asc:"ASC",Desc:"DESC"},Op={String:"STRING",Number:"NUMBER",Boolean:"BOOLEAN",Array:"ARRAY",Object:"OBJECT",Date:"DATE",Time:"TIME",DateTime:"DATETIME",File:"FILE"},Dp={Dots:"DOTS"},be={IPV4:"IPV4",IPV6:"IPV6",Email:"EMAIL",Uri:"URI",Password:"PASSWORD",MatchField:"MATCHFIELD",Pattern:"*",GreaterThan:"GREATER_THAN"},le={Success:"success",Error:"error",Warning:"warning",Info:"info"},F={Spring:"SPRING",Liquid:"LIQUID",EaseInOut:"EASEINOUT",EaseOutBack:"EASEOUTBACK",Bounce:"BOUNCE"},G={FadeIn:"FADE_IN",ScaleIn:"SCALE_IN",SlideInTop:"SLIDE_FROM_TOP",SlideInRight:"SLIDE_FROM_RIGHT",SlideInBottom:"SLIDE_FROM_BOTTOM",SlideInLeft:"SLIDE_FROM_LEFT"},Hp={Success:"success",Error:"error",Idle:"idle",Dead:"dead"},me={Dialog:"DIALOG",Default:"DEFAULT",Error:"ERROR",Success:"SUCCESS",Warn:"WARN",Promise:"PROMISE"},He=me,Lt={Left:"LEFT",Right:"RIGHT",Center:"CENTER"},_o=Lt,Vp={Bar:"BAR",Ring:"RING"},mt={Default:"range",Text:"number"},Mt={Default:"DEFAULT",Card:"CARD"},ct={Gooey:"gooey"},se={Left:"LEFT",Right:"RIGHT",Top:"TOP",Bottom:"BOTTOM"};var Fo=Symbol.for("zuz.global.map"),Zo=o=>{globalThis[Fo]=o;},Ds=()=>globalThis[Fo]||{},kt=o=>{let n=Array.isArray(o)?o.join(" "):o;if(!n||typeof n!="string")return "";let e=Ds();return process.env.NODE_ENV==="development"&&Object.keys(e).length===0&&console.warn(`[${chunkEDVIEQHU_cjs.f}] No utility map detected. Classes will not be hashed. `,"Ensure you call setZuzMap() or use <ThemeProvider zuzMap={...} />."),chunkEDVIEQHU_cjs.h(n).filter(Boolean).map(t=>{let s=t.match(/^([&@][\w-]+)\((.*)\)$/);if(s){let[u,l,m]=s;return chunkEDVIEQHU_cjs.h(m).map(i=>{let a=`${l}(${i})`;return e[a]||i}).join(" ")}return e[t]||t}).join(" ")},ru=o=>{let n=Array.isArray(o)?o.join(" "):o;return !n||typeof n!="string"?"":kt(n)},Ko=o=>{let n={};for(let e in o){let r=o[e];if(e.startsWith("--")){n[e]=r;continue}let t=chunkEDVIEQHU_cjs.e[e]?.toString()??e;if(t==="x"||t==="translateX"){let s=n.translate?.split(" ")??["0px","0px"];n.translate=`${chunkEDVIEQHU_cjs.i.addUnitsSafely(e,r)} ${s[1]??"0px"}`;}else if(t==="y"||t==="translateY"){let s=n.translate?.split(" ")??["0px","0px"];n.translate=`${s[0]??"0px"} ${chunkEDVIEQHU_cjs.i.addUnitsSafely(e,r)}`;}else chunkEDVIEQHU_cjs.d.includes(t)?n[t]=chunkEDVIEQHU_cjs.i.addUnitsSafely(e,r):n[t]=r;}return n},Ot=o=>{if(!o)return "linear";switch(o.toUpperCase()){case F.Bounce:return "var(--bounce)";case F.Liquid:return "var(--liquid)";case F.Spring:return "var(--spring)";case F.EaseInOut:return "ease-in-out";case F.EaseOutBack:return "ease-out-back";default:return "linear"}},We=(o,n=0)=>{let e={},r={},t=n||20;switch(o){case G.SlideInLeft:case G.SlideInRight:e={"--fx-x":o===G.SlideInLeft?`-${t}px`:`${t}px`,opacity:0},r={"--fx-x":"0px",opacity:1};break;case G.SlideInTop:case G.SlideInBottom:e={"--fx-y":o===G.SlideInTop?`-${t}px`:`${t}px`,opacity:0},r={"--fx-y":"0px",opacity:1};break;case G.ScaleIn:e={scale:0,opacity:0},r={scale:1,opacity:1};break;case G.FadeIn:e={opacity:0},r={opacity:1};break}return {from:e,to:r}},nu=(o,n,e)=>{let{from:r,to:t}=We(o);return n?{...r,...t}:e?r:t};var Vs=(o,n)=>{let e=react.useRef([]),r=react.useRef(false);return react.useEffect(()=>{o?.when||(r.current=false);},[o?.transition]),react.useEffect(()=>{let t=n?.current;if(!t||!o||!o.clearAtEnd)return;let s=u=>{e.current.includes(u.propertyName)&&o.clearAtEnd===true&&(t.style.transform="",t.style.filter="",e.current.forEach(l=>t.style.removeProperty(l)));};return t.addEventListener("transitionend",s),()=>t.removeEventListener("transitionend",s)},[o,n]),react.useEffect(()=>{if(typeof window>"u"||!n?.current)return;let t=n.current;(o?.scroll||o?.mouse)&&(t.style.willChange="transform",t.style.translate="var(--fx-x, 0px) var(--fx-y, 0px)",t.style.transition=`translate 0.1s ${o.curve?Ot(o.curve):"var(--spring)"}`);},[o,n]),react.useMemo(()=>{if(!o)return {style:{}};let{transition:t,from:s,to:u,exit:l,when:m,duration:i=.3,delay:a=0,curve:f,watch:p=[]}=o,d=m===false&&!r.current;m===true&&(r.current=true);let b={},{from:w,to:x}=t?We(t):{from:s||{},to:u||{}};b=m===void 0?{...w,...x}:m?{...x}:l||w;let h=Ot(f),S=[],g=Ko(b);e.current=Object.keys(g);let v={...g};return Object.keys(g).forEach(I=>{let T=I.startsWith("--")?"all":I;S.includes(T)||S.push(`${T} ${i}s ${h} ${a}s`);}),p.forEach(I=>{S.includes(I)||S.push(`${I} 0.1s ${h} 0s`);}),{style:{...v,transition:d?"none":S.join(", "),opacity:d?0:v.opacity,pointerEvents:d?"none":v.pointerEvents}}},[o,o?.when,o?.watch])},ae=Vs;var As=(o,n)=>{let{as:e,fx:r,transition:t,skeleton:s,className:u,propsToRemove:l,style:m,...i}=o||{},a=t?{transition:t,duration:.3}:r||{},{style:f}=ae(a,n),p=kt(e??"");return {style:{...m,...f},className:[u||"",p||"",s?.enabled?"--skeleton":""].join(" ").trim(),rest:{...chunkEDVIEQHU_cjs.g(i,l?[...l,"skeleton"]:["skeleton"])}}},R=As;var Fs=(o,n={})=>{let{offset:e=8,direction:r="bottom",container:t=null,triggerRef:s=null}=n,u=react.useRef(null),l=react.useCallback(()=>{let m=o.current;if(!m)return;let i=s?.current||m.parentElement;if(!i){console.warn("usePosition: No trigger element found. Positioning may not work.");return}let a=m.getBoundingClientRect(),f=i.getBoundingClientRect(),p,d;t?(p=t.getBoundingClientRect(),d="absolute"):(window.getComputedStyle(m).position==="fixed"?d="fixed":d="absolute",d==="fixed"?p={top:0,left:0,right:window.innerWidth,bottom:window.innerHeight,width:window.innerWidth,height:window.innerHeight}:p={top:0,left:0,right:window.innerWidth,bottom:window.innerHeight,width:window.innerWidth,height:window.innerHeight}),m.style.position!==d&&(m.style.position=d),u.current=d;let x=0,h=0;switch(r){case "top":x=f.top-a.height-e,h=f.left,x<p.top&&f.bottom+a.height+e<=p.bottom&&(x=f.bottom+e);break;case "bottom":x=f.bottom+e,h=f.left,x+a.height>p.bottom&&f.top-a.height-e>=p.top&&(x=f.top-a.height-e);break;case "left":x=f.top,h=f.left-a.width-e,h<p.left&&f.right+a.width+e<=p.right&&(h=f.right+e);break;case "right":x=f.top,h=f.right+e,h+a.width>p.right&&f.left-a.width-e>=p.left&&(h=f.left-a.width-e);break}if(x=Math.max(p.top,Math.min(x,p.bottom-a.height)),h=Math.max(p.left,Math.min(h,p.right-a.width)),u.current==="fixed")m.style.top=`${x}px`,m.style.left=`${h}px`;else {let S;m.offsetParent?S=m.offsetParent.getBoundingClientRect():S={top:0,left:0};let g=x-S.top+window.scrollY,v=h-S.left+window.scrollX;m.style.top=`${g}px`,m.style.left=`${v}px`;}},[o,s,e,r,t]);return react.useEffect(()=>{let m=o.current;if(!m)return;let i=s?.current||m.parentElement;if(!i){console.warn("usePosition: No trigger element found. Positioning may not work.");return}let a=new ResizeObserver(l);return a.observe(m),i&&a.observe(i),l(),window.addEventListener("resize",l),window.addEventListener("scroll",l,true),()=>{a.disconnect(),i&&a.disconnect(),window.removeEventListener("resize",l),window.removeEventListener("scroll",l,true);}},[o,r,e,t,s]),{postion:u.current,reposition:l}},Ue=Fs;var Go="(prefers-color-scheme: dark)",Ws=typeof window>"u",Xo=react.createContext(void 0),At=o=>{let n=react.useContext(Xo);if(!n){if(o===true)return;throw new Error("useColorScheme must be used within a ThemeProvider")}return n},X=At,Us=({children:o,storageKey:n="--ucs",forceTheme:e,zuzMap:r,...t})=>(r&&Zo(r),jsxRuntime.jsx(Gs,{storageKey:n,forceTheme:e,...t,children:o})),Gs=({children:o,storageKey:n,forceTheme:e,...r})=>{let[t,s]=react.useState(()=>e||qo(n,"system")),[u,l]=react.useState(()=>e||qo(n)),m=p=>(p||(p=window.matchMedia(Go)),p.matches?"dark":"light"),i=react.useCallback(p=>{let d=p=="system"?m():p,b=document.documentElement;b.setAttribute("color-scheme",d),b.style.colorScheme=d,l(d);},[m]),a=react.useCallback(p=>{s(p),localStorage.setItem(n,p),i(p);},[t]),f=react.useCallback(p=>{let d=m(p);l(d),t==="system"&&i("system");},[t]);return react.useEffect(()=>{t==null&&window.localStorage.getItem(n);},[t]),react.useEffect(()=>{window.matchMedia(Go).addEventListener("change",f);},[f]),react.useEffect(()=>{let p=d=>{d.key==n&&(d.newValue?a(d.newValue):a("system"));};return window.addEventListener("storage",p),()=>window.removeEventListener("storage",p)},[a]),react.useEffect(()=>{i(e||t||"system");},[t]),jsxRuntime.jsxs(Xo,{value:{colorScheme:t,resolvedScheme:u,setColorScheme:a,...r},children:[e?null:jsxRuntime.jsx("script",{suppressHydrationWarning:true,dangerouslySetInnerHTML:{__html:`const el = document.documentElement
|
|
3
3
|
const themes = ['light', 'dark']
|
|
4
4
|
let theme = localStorage.getItem(\`${n}\`) || "system";
|
|
5
5
|
if (theme === "system") {
|
|
@@ -11,4 +11,4 @@ var zo={Circle:"CIRCLE",Square:"SQUARE"},Bp={Default:"DEFAULT",Circle:"CIRCLE"},
|
|
|
11
11
|
${t==true?`<span class="--line-number">${v+1}</span>`:""}
|
|
12
12
|
<span class="--line-content">${I||" "}</span>
|
|
13
13
|
</div>`}).join("")},[e,d]);return jsxRuntime.jsx(c,{as:`--code-block ${a}`,style:f,...m,children:jsxRuntime.jsx("pre",{ref:o,children:jsxRuntime.jsx("code",{className:`--code --lang-${r}`,dangerouslySetInnerHTML:{__html:b}})})})},Bl=El;var pn=({onSelect:o,meta:n,selected:e})=>{let r=react.useRef(null),{index:t,icon:s,label:u}=n,[l,m]=react.useState({x:0,width:0}),i=hooks.useDelayed();return react.useLayoutEffect(()=>{if(i&&r.current){let{width:a,x:f}=r.current.getBoundingClientRect();m({x:f,width:a}),e&&o(t,a,f,n,true);}},[i,r.current]),react.useEffect(()=>{e&&o(t,l.width,l.x,n,false);},[e]),jsxRuntime.jsxs(z,{onClick:()=>o(t,l.width,l.x,n,false),ref:r,className:`--segment-item flex aic rel ${e?"--segment-active":""}`.trim(),children:[s?typeof s=="string"?jsxRuntime.jsx(Y,{name:s,as:"--segment-icon"}):jsxRuntime.jsx(c,{as:"--segment-icon flex aic jcc",children:s}):null,u&&String(u).trim()!=""&&jsxRuntime.jsx(c,{className:"--segment-label",children:u||`Item ${t}`})]})};pn.displayName="SelectTabItem";var un=pn;var dn=react.forwardRef((o,n)=>{let{fx:e,items:r,selected:t,variant:s,onSwitch:u,...l}=o,[m,i]=react.useState(t||0),a=react.useRef(false),f=react.useRef(m),{className:p,style:d,rest:b}=R(l),w=react.useRef(null),x=react.useRef(null),{variant:h}=X(true),S=(g,v,I,T,P)=>{if((P||m!=g&&m!=-2)&&(i(g),f.current=m,a.current&&u?.(T)),w.current){let N=x.current?.getBoundingClientRect();w.current.style.setProperty("--w",`${v}px`),w.current.style.setProperty("--x",`${N?I-N.left:I}px`);}};return react.useImperativeHandle(n,()=>({setSelected:g=>{typeof g=="number"&&g!=m&&i(g);}}),[m]),react.useEffect(()=>{a.current=true;},[]),jsxRuntime.jsxs(c,{ref:x,"data-selected":m,className:`${p} --segmented --${s||h||W.Medium} flex aic rel`,style:d,...b,children:[jsxRuntime.jsx(c,{ref:w,className:"--segment-tab abs"}),r.map((g,v)=>jsxRuntime.jsx(un,{onSelect:S,selected:m==v,meta:{...g,index:v}},`segment-${g.label}-${v}`))]})});dn.displayName="Zuz.SelectTabs";var ot=dn;var xn=react.forwardRef((o,n)=>{let{type:e,...r}=o,t=hooks.useDelayed(),{colorScheme:s,setColorScheme:u}=At(),l=react.useCallback(()=>{u(s=="dark"?"light":s=="light"?"system":"dark");},[s]),{className:m,style:i}=R(r),a=react.useMemo(()=>e=="system"?[{tag:"light",index:0,label:"",icon:O.colorSchemeLight},{tag:"system",index:1,label:"",icon:O.colorSchemeSystem},{tag:"dark",index:2,label:"",icon:O.colorSchemeDark}]:[{tag:"light",index:0,label:"",icon:O.colorSchemeLight},{tag:"dark",index:2,label:"",icon:O.colorSchemeDark}],[]),f=react.useMemo(()=>["light","system","dark"].indexOf(s),[s]);return !t||f==-1?null:e=="system"||e=="switch"?jsxRuntime.jsx(ot,{className:`--color-scheme --${e}`,onSwitch:({tag:p})=>{u(p);},selected:f,items:a,...r}):jsxRuntime.jsx(z,{onClick:l,style:i,as:`--color-scheme-switch --${r.variant||W.Small} ${m}`.trim(),children:s=="system"?O.colorSchemeSystem:s=="light"?O.colorSchemeLight:O.colorSchemeDark})});xn.displayName="Zuz.ColorScheme";var Wl=xn;var bn=react.forwardRef((o,n)=>{let[e,r]=react.useState("wait"),{title:t,message:s,acceptLabel:u,rejectLabel:l,position:m}=o,i=async a=>{r(a==1?"accepted":"rejected"),localStorage.setItem("--ccnt",String(a));};return react.useEffect(()=>{let a=localStorage.getItem("--ccnt");r(a?a=="1"?"accepted":"rejected":"pending");},[]),jsxRuntime.jsxs(c,{fx:{from:{x:-1e3},to:{x:0},when:e=="pending",curve:F.EaseInOut,duration:.5,delay:e=="accepted"?0:3},as:`--cookie-consent --${e} --${m||ee.Left} flex cols`,children:[jsxRuntime.jsx(H,{as:"--title",children:t||"This site uses cookies"}),jsxRuntime.jsx(H,{as:"--message",children:s||"We and selected third parties use cookies (or similar technologies) for technical purposes, to enhance and analyze site usage, to support our marketing efforts"}),jsxRuntime.jsxs(c,{as:"--footer flex aic",children:[jsxRuntime.jsx(z,{onClick:a=>i(1),as:"--accept",children:u||"Accept All"}),jsxRuntime.jsx(z,{onClick:a=>i(0),as:"--reject",children:l||"Cancel"})]})]})});bn.displayName="Zuz.CookiesConsent";var Xl=bn;var Sn=react.forwardRef((o,n)=>{let {type:e,value:r,min:t,max:s,step:u,onChange:l,roundValue:m,...i}=o,{className:a,style:f,rest:p}=R(i),d=react.useRef(u||.01).current,b=react.useRef(t||0).current,w=react.useRef(s||1).current,x=react.useRef(r||0).current,h=react.useRef(null),S=react.useRef(null),g=react.useRef(null);react.useRef(null);let I=react.useRef(null),T=react.useRef(null),P=($,K,D)=>($-K)/(D-K)*100,N=$=>{if(S.current){let K=parseFloat($.currentTarget.value),D=P(K,parseFloat($.currentTarget.min),parseFloat($.currentTarget.max));S.current.style.setProperty("--value",`${D}`),S.current.setAttribute("data-value",`${K}`),l&&l(m?+K.toFixed(2):K);}},[M,L]=react.useState(false),[V,E]=react.useState(0),[_,U]=react.useState(0),k=$=>{L(true),E($.clientX),U(S.current?parseFloat(S.current.getAttribute("data-value")):0),document.body.style.cursor="ew-resize";},C=$=>{if(M){let K=$.clientX-V,D=Math.max(b,Math.min(_+K*d,w));S.current&&(S.current.setAttribute("data-value",`${D}`),T.current.textContent=m?D.toFixed(2):D.toString(),l&&l(m?+D.toFixed(2):D));}},A=()=>{L(false),document.body.style.cursor="auto";};return react.useEffect(()=>{S.current&&S.current.style.setProperty("--value",h.current?`${P(parseFloat(h.current.value),parseFloat(h.current.min),parseFloat(h.current.max))}`:x.toString());},[]),react.useEffect(()=>(M?(document.addEventListener("mousemove",C),document.addEventListener("mouseup",A)):(document.removeEventListener("mousemove",C),document.removeEventListener("mouseup",A)),()=>{document.removeEventListener("mousemove",C),document.removeEventListener("mouseup",A);}),[M]),jsxRuntime.jsx(c,{ref:S,"data-value":x||0,className:`--slider --${e||mt.Default} flex rel ${a}`.trim(),style:{...f},children:mt.Text===e?jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx(H,{ref:T,onMouseDown:k,className:"--slider-text",children:x||0})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(c,{ref:I,className:"--slider-track abs fill"}),jsxRuntime.jsx(c,{ref:g,className:"--slider-knob abs"}),jsxRuntime.jsx(oe,{ref:h,onInput:N,className:"abs fill",tabIndex:0,type:e||mt.Default,defaultValue:x||0,step:d,max:w,min:b})]})})});Sn.displayName="Zuz.Slider";var go=Sn;var Tn=react.forwardRef((o,n)=>{let{src:e,shape:r,size:t,...s}=o,{style:u,className:l,rest:m}=R(s),{canvasRef:i,crop:a,setScale:f,handleMouseDown:p,handleMouseUp:d,handleMouseMove:b}=hooks.useImageCropper(e,t||200,r||hooks.CropShape.Circle);return react.useImperativeHandle(n,()=>({getCropped(){return a()},setScale(w){f(w);}})),jsxRuntime.jsxs(c,{as:`--cropper --${r||hooks.CropShape.Circle} ${l}`,style:u,...m,children:[jsxRuntime.jsx("canvas",{ref:i,width:t||200,height:t||200,onMouseDown:p,onMouseUp:d,onMouseLeave:d,onMouseMove:b}),jsxRuntime.jsx(c,{as:"--cropper-slider",children:jsxRuntime.jsx(go,{onChange:w=>f(w),min:0,max:1,step:.01,value:1})})]})});Tn.displayName="Zuz.Cropper";var tm=Tn;var rm=(e=>(e.Circle="circle",e.Square="square",e))(rm||{});var Rn=react.forwardRef((o,n)=>{let{items:e,maxItems:r}=o,t=react.useMemo(()=>{let l=typeof e=="string",m=l?[]:e;return l&&e.split(",").forEach(i=>{m.push({label:i});}),m},[e]),u=react.useMemo(()=>r&&r>0&&t.length>r-1,[t,r])?[...t.slice(0,2),{ID:".",label:"...",icon:"ellipsis",action:()=>{}},...t.slice(-r)]:t;return jsxRuntime.jsx(Me,{ref:n,className:"--crumb flex aic",direction:"rows",seperator:jsxRuntime.jsx(c,{as:"--crumb-chevron",children:O.chevronRightOutline}),items:u.map((l,m,i)=>l.ID=="."?jsxRuntime.jsx(c,{as:"flex aic gap:3",children:Array(3).fill(null).map(()=>jsxRuntime.jsx(c,{as:"w:4 h:4 bg:$text r:10"},`--crumb-placeholder-${m}`))}):jsxRuntime.jsxs(z,{onClick:()=>l.action?.(),className:"--crumb-item",disabled:!i[m+1],children:[l.icon&&jsxRuntime.jsx(Y,{as:"--crumb-icon",name:l.icon}),jsxRuntime.jsx(H,{as:"--crumb-label",children:l.label})]},`${l.label.replace(/\s+/g,"-").toLowerCase()}-${m}`))})});Rn.displayName="Zuz.Crumb";var sm=Rn;var En=react.forwardRef((o,n)=>{let{icon:e,defaultValue:r,value:t,size:s,variant:u,numeric:l,type:m,onConfirm:i,...a}=o,[f,p]=react.useState(false),[d,b]=react.useState(r||null),{style:w,className:x,rest:h}=R(a),S=react.useRef(null),g=react.useRef(null),{reposition:v}=Ue(g,{direction:ee.Bottom,offset:2}),I=P=>{l&&(P.currentTarget.value=P.currentTarget.value.replace(/[^0-9.]/g,"").replace(/(\..*?)\..*/g,"$1"));};react.useEffect(()=>{let P=N=>{let M=N.target,L=S.current?.contains(M),V=g.current?.contains(M);!L&&!V&&p(false);};return f&&document.addEventListener("mousedown",P),()=>{document.removeEventListener("mousedown",P);}},[f]),react.useEffect(()=>{let P=N=>{N.key==="Escape"&&f&&(p(false),S.current?.focus());};return document.addEventListener("keydown",P),()=>document.removeEventListener("keydown",P)},[f]);let T=()=>{p(true);};return react.useEffect(()=>{f&&v();},[f,v]),jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsxs(c,{as:`--date-picker ${u?`--${u}`:""} rel flex aic ${x}`,"data-value":d?d.toISOString():"",children:[e?typeof e=="string"?jsxRuntime.jsx(Y,{as:"mr:10 c:#666",name:e}):e:jsxRuntime.jsx(J,{as:"--date-picker-icon flex aic jcc",children:O.calendar}),jsxRuntime.jsx("input",{ref:S,value:d?dateFns.format(d,"EEE, MMM d YYY hh:mm a"):t||"",className:`--input ${u?`--${u}`:""} flex`.trim(),style:w,onFocus:T,onInput:I,autoComplete:"new-password",onKeyDown:P=>{P.key=="Enter"&&i?.(P.currentTarget.value);},...h}),jsxRuntime.jsx(c,{"aria-hidden":!f,ref:g,fx:{from:{y:5,opacity:0},to:{y:0,opacity:1},when:f,duration:.05},as:`--date-picker-chooser flex aic ${u?`--${u}`:""}`,children:jsxRuntime.jsx(io,{defaultValue:d,onChange:P=>{b(P),p(false);}})})]})})});En.displayName="Zuz.DatePicker";var mm=En;var Bn=react.forwardRef((o,n)=>{let{icon:e,variant:r,position:t}=o;return jsxRuntime.jsx(z,{className:`--fab fixed --${r||W.Large} --${t||"bottomright"}`,children:e||O.plus})});Bn.displayName="Zuz.Fab";var fm=Bn;var Ln=o=>{let{names:n,strength:e}=o,r={[ct.Gooey]:t=>jsxRuntime.jsxs("filter",{id:"gooey",children:[jsxRuntime.jsx("feGaussianBlur",{in:"SourceGraphic",stdDeviation:t||10,result:"blur"}),jsxRuntime.jsx("feColorMatrix",{in:"blur",mode:"matrix",values:"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 18 -7",result:"goo"}),jsxRuntime.jsx("feBlend",{in:"SourceGraphic",in2:"goo"})]},`filter-${ct.Gooey}`)};return react.useEffect(()=>{},[n]),jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",children:jsxRuntime.jsx("defs",{children:(n||[ct.Gooey]).map(t=>r[t](e))})})};Ln.displayName="Zuz.Filters";var hm=Ln;var Te=null,ie=null,kn=react.forwardRef((o,n)=>{let{title:e,message:r,transition:t,curve:s,speed:u,type:l,actionPosition:m,spinner:i,loadingMessage:a,onShow:f,onHide:p,...d}=o,{className:b,style:w,rest:x}=R(d),[h,S]=react.useState(e||""),[g,v]=react.useState(r||""),[I,T]=react.useState(null),[P,N]=react.useState(l||me.Default),M=react.useMemo(()=>core.uuid(12),[]),[L,V]=react.useState(false),E=react.useRef(null),_=react.useRef(null),[U,k]=react.useState(false),[C,A]=react.useState(true),$=react.useRef(null),K=g;react.useImperativeHandle(n,()=>({setLoading(Z){k(Z);},showDialog(Z,q,te,j){Te&&(clearTimeout(Te),ie&&clearTimeout(ie),E.current.classList.remove("--wobble"),setTimeout(()=>E.current.classList.add("--wobble"),50),ie=setTimeout(()=>{E.current.classList.remove("--wobble"),ie=null;},500)),N(me.Dialog),q&&v(q),Z&&S(Z),te&&T(te.reduce((pe,de)=>(pe.push({...de,key:de.key||core.uuid(12)}),pe),[])),V(true),setTimeout(()=>j?j():()=>{},1e3);},dialog(Z,q,te,j){Te&&(clearTimeout(Te),ie&&clearTimeout(ie),E.current.classList.remove("--wobble"),setTimeout(()=>E.current.classList.add("--wobble"),50),ie=setTimeout(()=>{E.current.classList.remove("--wobble"),ie=null;},500)),N(me.Dialog),v(q),S(Z),te&&T(te.reduce((pe,de)=>(pe.push({...de,key:de.key||core.uuid(12)}),pe),[])),V(true),setTimeout(()=>j?j():()=>{},1e3);},error(Z,q){this.show(Z,q,me.Error);},warn(Z,q){this.show(Z,q,me.Warn);},success(Z,q){this.show(Z,q,me.Success);},show(Z,q,te){Te&&(clearTimeout(Te),ie&&clearTimeout(ie),_.current=E.current.style.transform,E.current.style.transform="",E.current.classList.remove("--wobble"),setTimeout(()=>{E.current.classList.add("--wobble"),E.current.style.transform=`${_.current} scale(.9)`.trim();},50),ie=setTimeout(()=>{E.current.classList.remove("--wobble"),E.current.style.transform=_.current||"",ie=null;},500)),Te=setTimeout(()=>{V(false),Te=null,ie=null;},(q||4)*1e3),N(te||me.Default),v(Z),V(true),f?.();},hide(){V(false),p?.();}}));let D=react.useMemo(()=>{let Z={when:L,duration:u||.3,delay:.1};if(P==me.Dialog){if(t){let{from:q,to:te}=We(t,20);return {from:q,to:te,curve:s||F.EaseInOut,...Z}}return {from:{scale:0,x:"-50%",y:"-50%",opacity:0},to:{scale:1,x:"-50%",y:"-50%",opacity:1},curve:F.Spring,...Z}}else return {from:{scale:0,x:"-50%",y:"-10vh",opacity:0},to:{scale:1,x:"-50%",y:0,opacity:1},curve:F.Spring,...Z}},[L,P]);return react.useEffect(()=>{$.current&&clearTimeout($.current),L?A(true):$.current=setTimeout(()=>A(false),1e3);},[L]),P==me.Dialog?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Ee,{when:L}),jsxRuntime.jsxs(c,{className:`--sheet --sheet-${P.toLowerCase()} ${L?"is-visible":""} ${b} fixed`.trim(),style:w,fx:D,...x,ref:E,children:[jsxRuntime.jsx(Ne,{when:U,spinner:i,message:a}),jsxRuntime.jsxs(c,{className:"--head flex aic rel",children:[jsxRuntime.jsx(c,{className:`--${h?"title":"dot"} flex aic rel`,children:h||""}),jsxRuntime.jsx(z,{onClick:Z=>V(false),className:"--closer abs",children:"\xD7"})]}),jsxRuntime.jsx(c,{className:`--body flex aic rel ${I?"":"--no-action"}`.trim(),children:C?K:null}),I&&jsxRuntime.jsx(c,{className:`--footer flex aic rel ${m?m==Lt.Center?"jcc":"":"jce"}`.trim(),children:I.map((Z,q)=>jsxRuntime.jsx(z,{onClick:te=>Z.handler?Z.handler():Z.onClick?Z.onClick():console.log("onClick Handler missing"),className:"--action",children:Z.label},`sheet-${M}-action-${Z.key}`))})]})]}):jsxRuntime.jsx(c,{className:`--sheet --sheet-${P.toLowerCase()} ${b} abs`.trim(),style:w,...x,fx:D,ref:E,children:L?g:null})}),nt=o=>typeof o=="object"&&o!=null&&"setLoading"in o&&"success"in o&&"error"in o;kn.displayName="Zuz.Sheet";var vm=kn;var On=({ref:o,...n})=>{let{name:e,cover:r,spinner:t,errors:s,action:u,children:l,withData:m,beforeSubmit:i,onSubmit:a,onError:f,onSuccess:p,resetOnSuccess:d,...b}=n,{className:w,style:x,rest:h}=R(b),[S,g]=react.useState(false),v=react.useRef(null),I=react.useRef(null),T=react.useRef(null),P=jt(),N=react.useCallback(C=>v.current?v.current.querySelectorAll(C):[],[v.current]),M=C=>({name:C.name||C.getAttribute("name")||C.getAttribute("data-name"),required:C.required?true:C.getAttribute("data-required")?C.getAttribute("data-required")=="true":false,with:C.with||C.getAttribute("with")}),L=C=>{let A=[];return C.querySelectorAll(".--input").forEach($=>{A.push($.value);}),A.join("")},V=react.useCallback(C=>{let{required:$}=M(C);if($){if(C.type=="checkbox"&&C.checked==false)return false;if(C.classList.contains("--otp")){let D=L(C);if(D==""||D.length<parseInt(C.getAttribute("data-size")))return false}if(C.classList.contains("--select")&&C.querySelector("button.--selected").dataset.value=="-1"||C.value=="")return false}if(C.getAttribute("with")){let D=C.getAttribute("with");switch(D.includes("@")&&(D=D.split("@")[0],D=="match"&&(D=be.MatchField)),D.toUpperCase()){case be.IPV4:return core._(C.value).isIPv4();case be.IPV6:return core._(C.value).isIPv6();case be.Email:return core._(C.value).isEmail();case be.Uri:try{return new URL(C.value),!0}catch{return false}case be.Password:return console.log("Add FORMVALIDATION.Password"),false;case be.MatchField:let[Z,q,te]=C.getAttribute("with").split("@"),j=document.querySelector(`[name=${q.trim()}]`);if(!j)return false;switch(te||"direct-match"){case "if-not-empty":if(j&&!core._(j.value).isEmpty()&&j.value!=C.value)return false;break;case "direct-match":if(j&&j.classList.contains("--otp")&&C.classList.contains("--otp")&&L(j)!=L(C))return false;if(j&&j.value!=C.value)return false;break}break;default:return true}}return true},[v.current]),E=react.useCallback(()=>{let C={},A={},$=null,K=null;if(Array.from(N("[name]")).forEach(D=>{let{name:Z,required:q,with:te}=M(D),j=true;(q||te)&&(j=V(D)),C[Z]={valid:j,value:D.type=="checkbox"?D.checked==true?D.value:false:D.classList.contains("--otp")?L(D):D.classList.contains("--select")?D.querySelector("button.--selected").dataset.value:D.value},A[Z]=D.type=="checkbox"?D.checked==true:D.classList.contains("--otp")?L(D):D.classList.contains("--select")?D.querySelector("button.--selected").dataset.value:D.value,j?D.classList.remove("input-with-error"):($==null&&s&&($=D,K=s[Z]),D.classList.add("input-with-error"));}),$){let D=$;if(D.classList.contains("--otp"))for(let Z of Array.from(D.querySelectorAll(".--input"))){let q=Z;if(q.value==""){q.focus();break}}else D.focus();}return {error:$!=null,errorMsg:K||"Fix errors to continue...",data:C,payload:A}},[v.current]),_=react.useCallback(()=>{let{error:C,errorMsg:A,payload:$}=E();C?P.error(A):u?react.startTransition(async()=>{i&&i($),nt(r)?r.setLoading(true):g(true),P.clearAll(),core.withPost(u,{...$,...m||{}}).then(K=>{let D=K;nt(r)?r.setLoading(false):g(false),d&&Array.from(N("[name]")).forEach(Z=>{Z instanceof HTMLInputElement&&(Z.value="");}),p?p(D):(P.clearAll(),P.success(D.message||"Redirecting..."));}).catch(K=>{nt(r)?r.setLoading(false):g(false),f?f(K):P.error(K.message||"We cannot process your request at this time.");});}):a&&a($);},[u,I.current,v.current]),U=react.useCallback(()=>{let C=N("[type=submit]");!C||C.length==0?console.warn("You should add at least 1 button with type=`SUBMIT`"):C.forEach(A=>{A.addEventListener("click",_);});},[v.current]),k=react.useMemo(()=>react$1.addPropsToChildren(l,C=>C.props.type=="submit",C=>({ref:T})),[l]);return react.useImperativeHandle(o,()=>({setLoading(C){if(C){I.current?.hide();try{P.clearAll();}catch{}}g(C);},showError(C){typeof C=="string"?P.error(C):I.current.error(C,4);},hideError(){I.current.hide();try{P.clearAll();}catch{}},init(){U();},submit(){_();}})),react.useEffect(U,[]),jsxRuntime.jsxs(c,{ref:v,style:x,className:`--form flex rel ${w} ${e?`--form-${e.replace(/\s+/g,"-")}`:""}`,propsToRemove:["withData","action","onSubmit","onSuccess","onError"],children:[!nt(r)&&jsxRuntime.jsx(Ne,{message:r?r.message||void 0:"working",spinner:t,color:r&&"color"in r?r.color:"#ffffff",when:S}),k]})};On.displayName="Zuz.Form";var Bm=On;var Dn=o=>{let {ref:n,cols:e,rows:r,gap:t,gapX:s,gapY:u,align:l,justify:m,inline:i,flow:a,autoCols:f,autoRows:p,template:d,...b}=o;react.useRef(null);let {className:x,style:h,rest:S}=R(b),g=I=>typeof I=="number"?`repeat(${I}, 1fr)`:I,v={display:i?"inline-grid":"grid",gridTemplateColumns:g(e),gridTemplateRows:g(r),gap:t,columnGap:s,rowGap:u,alignItems:l,justifyContent:m==="between"?"space-between":m==="around"?"space-around":m,gridAutoFlow:a,gridAutoColumns:f,gridAutoRows:p,gridTemplateAreas:d,...h};return jsxRuntime.jsx(c,{ref:n,as:`--grid ${x}`.trim(),style:v,...S})};Dn.displayName="Zuz.Grid";var Om=Dn;var Hn=o=>typeof o=="string"&&o.includes("+"),Vn={command:"\u2318",shift:"\u21E7",ctrl:"\u2303",option:"\u2325",enter:"\u21B5",delete:"\u232B",escape:"\u238B",tab:"\u21E5",capslock:"\u21EA",up:"\u2191",right:"\u2192",down:"\u2193",left:"\u2190",pageup:"\u21DE",pagedown:"\u21DF",home:"\u2196",end:"\u2198",help:"?",space:"\u2423",fn:"Fn",win:"\u2318",alt:"\u2325"},An={command:"Command",shift:"Shift",ctrl:"Control",option:"Option",enter:"Enter",delete:"Delete",escape:"Escape",tab:"Tab",capslock:"Caps Lock",up:"Up",right:"Right",down:"Down",left:"Left",pageup:"Page Up",pagedown:"Page Down",home:"Home",end:"End",help:"Help",space:"Space",fn:"Fn",win:"Win",alt:"Alt"};var zn=react.forwardRef(({children:o,keys:n,variant:e},r)=>{let t=react.useMemo(()=>{if(Hn(n)){let s=null;return {keys:String(n).split("+").reduce((l,m,i,a)=>(a[i+1]?l.push(m):s=m.toUpperCase(),l),[]),children:s}}return {keys:n,children:String(o).toUpperCase()}},[n]);return jsxRuntime.jsxs(c,{as:`--keyboard-keys --${e||W.Small} flex aic`,children:[(Array.isArray(t.keys)?t.keys:[t.keys]).map(s=>jsxRuntime.jsx("abbr",{title:An[s],children:Vn[s]},s)),jsxRuntime.jsx(J,{children:t?.children??o})]})});zn.displayName="Zuz.KeyboardKeys";var So=zn;var Fn=react.forwardRef((o,n)=>{let e=hooks.useNetworkStatus(),{onlineMessage:r,offlineMessage:t,variant:s}=o;return jsxRuntime.jsxs(c,{fx:{from:{x:"-50%",y:200,opacity:0},to:{x:"-50%",y:0,opacity:1},when:e==false,curve:F.Spring,duration:.5,delay:2},className:`--network-manager --${e==true?"online":"offline"} --${s||W.Small} fixed flex`,children:[jsxRuntime.jsx(c,{className:"--ico",children:e?O[le.Success]:O[le.Error]}),jsxRuntime.jsx(H,{as:"--message",children:e?r||"internet connection restored :)":t||"no internet connection"})]})});Fn.displayName="Zuz.NetWorkManager";var _m=Fn;var Co=(e=>(e.Table="table",e.Gooey="gooey",e))(Co||{});var Wn=react.forwardRef((o,n)=>{let{itemCount:e,itemsPerPage:r,startPage:t,pageRange:s,paginationStyle:u,breakLabel:l,prevLabel:m,nextLabel:i,hash:a,loading:f,seperator:p,renderOnZeroPageCount:d,onPageChange:b,...w}=o,x=react.useMemo(()=>core.toHash(core.numberInRange(4,8)),[]),h=react.useCallback(E=>`${core.toHash(E,a||6,x)}${p||""}${x}`,[x]),S=react.useMemo(()=>l||"...",[l]),[g,v]=react.useState({id:a?t?typeof t=="number"?h(t):t:1:t||1,label:t||1}),{style:I,className:T,rest:P}=R(w),N=react.useCallback(E=>typeof E=="number"?E:+E.label,[]);if(!e)throw new Error('"itemCount" prop is required');let M=react.useMemo(()=>Math.ceil(e/r),[e,r]),L=react.useMemo(()=>{let E=[],_=Math.max(N(g)-(s||2),1),U=Math.min(N(g)+(s||2),M);_>1&&E.push({id:a?h(1):1,label:1}),_>2&&E.push({id:-1,label:S});for(let k=_;k<=U;k++)E.push({id:a?h(k):k,label:k});return U<M-1&&E.push({id:-1,label:S}),U<M&&E.push({id:a?h(M):M,label:M}),E},[g]),V=react.useCallback(E=>{let _=E;+_.label<1||+_.label>M||(v(_),b?.(_));},[e,r,g]);return L.length<=1&&(d??false)===false?null:jsxRuntime.jsxs(c,{ref:n,as:`--pagination --pgt-${u||"table"} flex aic w:100% jcc ${T}`,children:[jsxRuntime.jsx(c,{as:"flex flex:1 aic --pgt-btns",children:(L.length>1?L:[{id:1,label:1},{id:-1,label:S}]).map((E,_,U)=>jsxRuntime.jsx(z,{disabled:E.id==-1||N(g)==+E.label,className:(typeof E=="string"?E:E.label)==N(g)?"--current-page":"",onClick:k=>V(E),children:typeof E=="string"?E:E.label},`--pg-${_}-${E.id}`))}),jsxRuntime.jsx(c,{as:"flex aic jcc flex:1 --pagination-label",children:[`Showing ${(N(g)-1)*r+1} - `,`${Math.min(N(g)*r,e)} of ${e} items`].join(" ")}),jsxRuntime.jsxs(c,{as:"flex aic jce flex:1 --pgt-btns --pgt-nav",children:[jsxRuntime.jsx(z,{disabled:N(g)<=1,onClick:E=>V({id:a?h(N(g)-1):N(g)-1,label:N(g)-1}),children:O.chevronLeftOutline}),jsxRuntime.jsx(z,{disabled:L.length<=1||N(g)==N(L[L.length-1]),onClick:E=>V({id:a?h(N(g)+1):N(g)+1,label:N(g)+1}),children:O.chevronRightOutline})]})]})});Wn.displayName="Zuz.Pagination";var Po=Wn;var Gn=react.forwardRef((o,n)=>{let{strenthMeter:e,onChange:r,...t}=o;"type"in t&&delete t.type;let{style:s,className:u,rest:l}=R(t),[m,i]=react.useState(false),[a,f]=react.useState(""),p=react.useMemo(()=>core.checkPasswordStrength(a),[a]),d=hooks.useDebounce(b=>{e&&f(b.target.value),r&&r(b);},100);return react.useEffect(()=>{},[]),jsxRuntime.jsxs(c,{as:"w:100% flex cols",children:[jsxRuntime.jsxs(c,{style:s,className:"--password flex aic rel",children:[jsxRuntime.jsx(oe,{ref:n,type:m?"text":"password",className:u,onChange:d,...l}),jsxRuntime.jsx(z,{tabIndex:-1,onClick:()=>i(b=>!b),className:"--toggle flex aic jcc abs",children:m?O.eye:O.eyeSlash})]}),e&&jsxRuntime.jsxs(c,{as:`flex aic --password-meter --pb-score-${p.score}`,style:s,children:[jsxRuntime.jsxs(c,{as:"--password-bars flex aic",children:[jsxRuntime.jsx(c,{as:`--pbar ${p.score>=1?"--pb-on":""}`.trim()}),jsxRuntime.jsx(c,{as:`--pbar ${p.score>=2?"--pb-on":""}`.trim()}),jsxRuntime.jsx(c,{as:`--pbar ${p.score>=3?"--pb-on":""}`.trim()}),jsxRuntime.jsx(c,{as:`--pbar ${p.score>=4?"--pb-on":""}`.trim()}),jsxRuntime.jsx(c,{as:`--pbar ${p.score>=5?"--pb-on":""}`.trim()})]}),jsxRuntime.jsx(H,{as:"--password-meter-label","aria-hidden":true,children:p.result})]})]})});Gn.displayName="Zuz.Password";var Qm=Gn;var Xn=react.forwardRef((o,n)=>{let{size:e,length:r,mask:t,...s}=o,u=react.useRef([]),l="pinput",m=false,i={};"with"in s&&(i={with:s.with},delete s.with),"type"in s&&delete s.type,"name"in s&&(l=s.name,delete s.name),"required"in s&&(m=true,delete s.required);let{style:a}=R(s),f=p=>{let d=p.currentTarget,b=u.current[parseInt(d.dataset.index)+1],w=u.current[parseInt(d.dataset.index)-1];d.value.length===1&&b?b.focus():d.value.length===0&&w&&w.focus();};return react.useEffect(()=>{u.current=u.current.slice(0,e||r);},[e||r]),jsxRuntime.jsx(c,{name:l,style:a,className:"--otp flex aic rel","data-required":m,"data-size":e||r||4,...i,children:Array(e||r||4).fill(1).map((p,d)=>jsxRuntime.jsx(oe,{autoComplete:"new-password","data-index":d,ref:b=>{u.current[d]=b;},numeric:true,onChange:f,maxLength:1,placeholder:t?"\xB7":"0",type:t?"password":"text",...s},`pin-${d}`))})});Xn.displayName="Zuz.PinInput";var tc=Xn;var Yn=react.forwardRef((o,n)=>{let{children:e,className:r,name:t,required:s,type:u,value:l,variant:m,checked:i,onSwitch:a,...f}=o,[p,d]=react.useState(i||false),{variant:b}=X(true),w=react.useRef(null);return jsxRuntime.jsxs(et,{className:`${r} --${(u||Mt.Default).toLowerCase()} --radio${!u||u==Mt.Default?"":"card"} --${m||b||W.Small} flex aic rel`.trim(),...f,children:[jsxRuntime.jsx(oe,{ref:w,defaultChecked:p,value:l||"rd",type:"radio",className:"abs",name:t,required:s||false,onChange:x=>{a&&a(x.target.checked,l||"cb"),d(x.target.checked);}}),jsxRuntime.jsx(c,{className:"--dot rel",children:jsxRuntime.jsx(c,{className:"--rod abs abc"})}),jsxRuntime.jsx(c,{className:"--value",children:e})]})});Yn.displayName="Zuz.Radio";var sc=Yn;var Qn=react.forwardRef((o,n)=>{let{fx:e,withStyle:r,as:t,reverse:s=false,searchIcon:u=O.search,hideSearchIcon:l=false,clearIcon:m=O.close,hideClearIcon:i=false,onChange:a,onClear:f,...p}=o,{style:d,className:b}=R({as:o.as}),[w,x]=react.useState(""),{variant:h}=X(true),S=react.useRef(null),g=react.useMemo(()=>jsxRuntime.jsx(z,{tabIndex:-1,onClick:T=>I(),className:"--send flex aic jcc",variant:o.variant||W.Small,children:w!==""?!i&&(typeof m=="string"?jsxRuntime.jsx(Y,{name:m,as:"--search-action"}):m):!l&&(typeof u=="string"?jsxRuntime.jsx(Y,{name:u,as:"--search-action"}):u)}),[s,u,i,m,l]);"type"in o&&delete o.type;let v=T=>{x(T.target.value),a?.(T.target.value);},I=T=>{w.trim()!==""&&(x(""),a?.(""),S.current&&(S.current.value="",o.onConfirm?.("")));};return react.useImperativeHandle(n,()=>({focus:()=>S.current?.focus(),value:()=>S.current?.value})),react.useEffect(()=>{},[]),jsxRuntime.jsxs(c,{style:d,className:`--search ${s?"--search-rev":""} --${o.variant||h||W.Medium} flex aic ${typeof o.as=="string"&&o.as.includes("abs")?"":"rel"} ${b}`.trim(),children:[s&&g,jsxRuntime.jsx(oe,{ref:S,onChange:v,...p}),o.shortcut&&jsxRuntime.jsx(So,{keys:o.shortcut,as:"abs"}),!s&&g]})});Qn.displayName="Zuz.Search";var fc=Qn;var jn=({value:o,updateValue:n,o:e})=>jsxRuntime.jsxs(z,{onClick:r=>n(e),as:"--select-option-item",className:o&&(typeof e=="string"?e:e.value)==(typeof o=="string"?o:o.value)?"selected":"",children:[e.icon&&jsxRuntime.jsx(Y,{name:e.icon,as:`--select-option-icon --icon-${e.value}`,color:e.iconColor||void 0}),jsxRuntime.jsx(H,{suppressHydrationWarning:true,children:typeof e=="string"?e:e.label})]});jn.displayName="Option";var es=jn;var os=({ref:o,...n})=>{let{selected:e,options:r,label:t,name:s,variant:u,search:l,searchPlaceholder:m,maxHeight:i,arrowDownIcon:a=O.arrowDown,arrowUpIcon:f=O.arrowUp,onChange:p,...d}=n,[b,w]=react.useState(e?typeof e=="string"?r.find(k=>k.value===e):e:r[0]),[x,h]=react.useState(false),[S,g]=react.useState(null),v=react.useRef(null),I=react.useRef(null),T=react.useRef(null),P=react.useId(),N=react.useMemo(()=>s||P,[]),{reposition:M}=Ue(T,{direction:Bt.Bottom,offset:2}),{variant:L}=X(true),{className:V,style:E,rest:_}=R(d),U=k=>{w(k),h(false),p&&p(k);};return react.useImperativeHandle(o,()=>({setSelected:k=>{if(typeof k=="string"){let C=r.find(A=>A.value===k);C&&w(C);}else w(k);},getValue:()=>b||null})),react.useEffect(()=>{if(!x)return;let k=()=>{M();};return window.addEventListener("scroll",k,true),window.addEventListener("resize",M),()=>{window.removeEventListener("scroll",M,true),window.removeEventListener("resize",M);}},[x,M]),react.useEffect(()=>{if(!x){I.current&&(I.current.value=""),g(null);return}I.current?.focus(),M();let k=A=>{T.current&&!T.current.contains(A.target)&&h(false);},C=setTimeout(()=>{document.addEventListener("click",k);},0);return ()=>{clearTimeout(C),document.removeEventListener("click",k);}},[x,M]),jsxRuntime.jsxs(c,{className:`--select --${u||L} ${s?`--${s}`:""} rel`.trim(),name:N,children:[jsxRuntime.jsxs(z,{ref:v,"data-value":b?typeof b=="string"?b:b.value:b||"-1",className:`--selected flex aic rel ${V}`.trim(),withLabel:false,style:E,onClick:k=>{k.stopPropagation(),h(C=>!C);},..._,children:[jsxRuntime.jsx(H,{className:"--label",children:b?typeof b=="string"?b:b.label:t||"Choose"}),jsxRuntime.jsx(c,{className:"--svg-arrow rel flex aic jcc",children:x?typeof f=="string"?jsxRuntime.jsx(Y,{name:f,as:"--search-action"}):f:typeof a=="string"?jsxRuntime.jsx(Y,{name:a,as:"--search-action"}):a})]}),jsxRuntime.jsxs(c,{id:N,className:"--options-list flex cols abs","aria-hidden":!x,style:{maxHeight:i||"auto"},ref:T,fx:{from:{y:5,opacity:0},to:{y:0,opacity:1},when:x,duration:.05},children:[l&&jsxRuntime.jsx(c,{as:"--select-search --sticky",children:jsxRuntime.jsx(oe,{ref:I,onChange:k=>{g(k.target.value==""?null:k.target.value);},className:"--search-input",placeholder:m||"Search..."})}),(S==null?r:r.filter(k=>k.label.toLowerCase().includes(S.toLowerCase())||k.value.toLowerCase().includes(S.toLowerCase()))).map(k=>jsxRuntime.jsx(es,{updateValue:U,value:b,o:k},`option-${(typeof k=="string"?k:k.label).replace(/\s+/g,"-")}-${typeof k=="string"?k:k.value}`))]})]})};os.displayName="Zuz.Select";var bc=os;var rs=react.forwardRef((o,n)=>jsxRuntime.jsx(tt,{type:ye.Switch,...o,ref:n}));rs.displayName="Zuz.Switch";var vc=rs;var ss=o=>{let{idx:n,id:e,as:r,weight:t,style:s,value:u,render:l,resize:m,sortBy:i,sortable:a,onSort:f}=o,[p,d]=react.useState(0),b=()=>{a&&(f?.(String(e),p==1?-1:1),d(w=>w==1?-1:1));};return jsxRuntime.jsxs(c,{style:{flex:t||1,...s},as:`--col flex aic ${r||""} ${a?"--sortable":""}`,onClick:b,children:[jsxRuntime.jsx(c,{children:u}),n==-1&&a&&i==e&&jsxRuntime.jsx(c,{as:"--arrow flex aib",children:p==1?O.arrowUp:O.arrowDown})]})};ss.displayName="Zuz.Column";var Ct=ss;var is=o=>{let{index:n,pubsub:e,schema:r,data:t,ids:s,styles:u,animate:l,sortBy:m,selectable:i,tableRef:a,loading:f,rowClassName:p,onSort:d,onRowClick:b,onSelect:w,onContextMenu:x}=o,h=hooks.useDelayed(),S=react.useMemo(()=>({transition:G.SlideInBottom,curve:F.EaseInOut,delay:.02*(n+1)}),[]),g=react.useRef(null),v=(T,P)=>{n==-1?e.emit(`ALL_ROWS_${T?"CHECKED":"UNCHECKED"}`,T):(w&&w(t,T),e.emit(`ROW_${T?"CHECKED":"UNCHECKED"}`,T,P));},I=(T,P,N)=>jsxRuntime.jsx(Ct,{idx:T,id:P,as:"--selector",pubsub:e,value:jsxRuntime.jsx(tt,{value:N,ref:g,onSwitch:v,type:ye.Default})});return react.useEffect(()=>{let T=(L,V)=>{g.current?.setChecked(L,false);},P=(L,V)=>{let E=false;a?.current&&a.current.querySelectorAll(".--row").forEach(_=>{let U=_;if(!U.classList.contains("--row-head")){let k=U.querySelector(".--selector input[type=checkbox]");k&&k.checked&&!E&&(E=k.checked);}}),g.current.setChecked(E,false);},N=L=>{g.current?.setChecked(L,false),w&&w(t,L);},M=L=>{g.current?.setChecked(L,false),w&&w(t,L);};return n==-1?(e.on("ROW_CHECKED",T),e.on("ROW_UNCHECKED",P),()=>{e.off("ROW_CHECKED",T),e.off("ROW_UNCHECKED",P);}):(e.on("ALL_ROWS_CHECKED",N),e.on("ALL_ROWS_UNCHECKED",M),()=>{e.off("ALL_ROWS_CHECKED",N),e.off("ALL_ROWS_UNCHECKED",M);})},[]),jsxRuntime.jsxs(c,{onContextMenu:T=>x?x(T,t):null,onClick:T=>b?b(T,o.data):()=>{},...l?{fx:{...S,when:h}}:{},as:`--row flex aic ${b?"--row-clickable":""} ${n==-1?"--row-head":""} ${p||""}`,children:[n==-1&&r.map((T,P)=>{let{renderWhenHeader:N,render:M,value:L,...V}=T;return jsxRuntime.jsxs(react.Fragment,{children:[i&&P==0&&I(-1,`--selector-${T.id}`,"all"),jsxRuntime.jsx(Ct,{idx:-1,onSort:d,sortBy:m,value:L,...V,pubsub:e,style:u[T.id]})]},`--col-${T.id}`)}),f&&n>-1&&jsxRuntime.jsx(c,{as:"--col",children:jsxRuntime.jsx(H,{as:"opacity:0",children:"..."})}),!f&&n>-1&&s&&t&&r.map((T,P)=>jsxRuntime.jsxs(react.Fragment,{children:[i&&P==0&&I(P,`--selector-${T.id}`,T.id.toString()),s.includes(String(T.id))?jsxRuntime.jsx(Ct,{pubsub:e,idx:P,id:String(T.id),style:u[String(T.id)],value:T.render?T.render(t,n):t[String(T.id).includes(".")?String(T.id).split(".").reverse()[0]:T.id]}):null]},`--${String(T.id)}-val-${P}`))]})};is.displayName="Zuz.Row";var Tt=is;var ps=(o,n)=>{let{schema:e,rows:r,rowCount:t,rowsPerPage:s,currentPage:u,pagination:l,paginationHash:m,showPaginationOnZeroPageCount:i,animateRows:a,header:f,rowClassName:p,selectableRows:d,hoverable:b,sortBy:w,loading:x,loadingRowCount:h,loadingMessage:S,spinner:g,emptyMessage:v,onSort:I,onRowClick:T,onRowSelectToggle:P,onPageChange:N,onRowContextMenu:M,...L}=o,V=react.useRef(null),E=react.useMemo(()=>e.reduce((ne,Q)=>(ne[Q.id]={flex:Q.weight||1,...Q.w&&{width:Q.w},...Q.maxW&&{maxWidth:Q.maxW},...Q.minW&&{minWidth:Q.minW},...Q.h&&{height:Q.h},...Q.maxH&&{maxHeight:Q.maxH},...Q.minH&&{minHeight:Q.minH}},ne),{}),[e]),_=react.useMemo(()=>Object.keys(E),[e]),U=react.useMemo(()=>f??true,[f]),{style:k,className:C,rest:A}=R(L),$=react.useRef(null),K=react.useMemo(()=>new core.PubSub,[]),D=react.useRef(r.map(()=>core.uuid(8))),[Z,q]=react.useState(w||null),[te,j]=react.useState(S||"loading"),pe=react.useMemo(()=>!x&&r&&r.length==0,[x,r]),de=react.useCallback(()=>v?typeof v=="function"?jsxRuntime.jsx(v,{}):v:jsxRuntime.jsx(H,{as:"tac s:18 mt:75",children:"No Record Found"}),[x,r]);react.useEffect(()=>{D.current=r.map(()=>core.uuid(8));},[r]);let It=(ne,Q)=>{q(ne),I?.(ne,Q);},Nt=(t||(r?r.length:0))/(s||10),Ie=react.useMemo(()=>i||Nt>1?jsxRuntime.jsx(Po,{hash:m,ref:V,renderOnZeroPageCount:i,onPageChange:N,paginationStyle:"table",startPage:u,itemCount:t||(r?r.length:0),itemsPerPage:s||10}):null,[u,t]);return react.useImperativeHandle(n,()=>({setLoading(ne){}})),jsxRuntime.jsxs(c,{as:`--table ${b??true?"--hoverable":""} flex cols rel ${C}`,ref:$,children:[U==true&&jsxRuntime.jsx(Tt,{sortBy:Z,onSort:It,tableRef:$,pubsub:K,selectable:d,index:-1,schema:e,loading:true,styles:E}),x&&jsxRuntime.jsxs(c,{as:"center-x flex aic --table-spinner",children:[jsxRuntime.jsx(ge,{type:g||re.Simple}),te&&jsxRuntime.jsx(H,{as:"--table-loading-message",children:te})]}),x&&Array(h||5).fill({}).map((ne,Q)=>jsxRuntime.jsx(Tt,{tableRef:$,index:Q,pubsub:K,schema:e,styles:E,loading:true,animate:a,onRowClick:T},`--trow-loading-${Q}-${e[0].id}`)),!x&&r&&r.map((ne,Q)=>jsxRuntime.jsx(Tt,{tableRef:$,pubsub:K,loading:false,index:Q,schema:e,ids:_,styles:E,animate:a,data:ne,onRowClick:T,rowClassName:p,selectable:d,onSelect:P,onContextMenu:M},`--trow-${D.current[Q]||Q}-${e[0].id}`)),pe&&de(),jsxRuntime.jsx(c,{"aria-hidden":!l||!Ie,...a?{fx:{transition:G.SlideInBottom,curve:F.EaseInOut,delay:.02*(r.length+1),when:!x&&r&&l&&Ie!=null}}:{},as:"--row flex aic --row-footer",children:l&&Ie?Ie:null})]})};ps.displayName="Zuz.Table";var Oc=react.forwardRef(ps),Dc=Oc;var Vc=({ref:o,...n})=>{let{title:e,items:r}=n,[t,s]=react.useState(0),u=(l,m,i)=>{l.preventDefault(),s(m),document.getElementById(i)?.scrollIntoView({behavior:"smooth"});};return jsxRuntime.jsxs(c,{ref:o,as:"--table-of-contents rel flex cols",children:[jsxRuntime.jsx(H,{as:"--toc-title",children:e}),jsxRuntime.jsx(Me,{items:r.map((l,m)=>jsxRuntime.jsx("a",{className:t==m?"--toc-active":"",style:{anchorName:t===m?"--toc-active":"none",color:t==m?"var(--table-of-contents-color-active)":"var(--table-of-contents-color)"},onClick:i=>u(i,m,l.tag),href:`#${l.tag}`,children:l.label}))})]})},Ac=Vc;var us=({isActive:o,transitionType:n,speed:e,width:r,render:t,content:s,onHeightChange:u})=>{let l=react.useRef(null),m=hooks.useResizeObserver(l);react.useEffect(()=>{o&&m.height>0&&u(m.height);},[o,m.height]);let i=react.useMemo(()=>{let a={flexShrink:0,height:"fit-content"};return n==="fade"?{...a,gridArea:"1 / 1 / 2 / 2",opacity:o?1:0,visibility:o?"visible":"hidden",transition:`opacity ${e}s ease-in-out`,zIndex:o?1:0}:n==="scale"?{...a,gridArea:"1 / 1 / 2 / 2",opacity:o?1:0,transform:`scale(${o?1:.95})`,transition:`all ${e}s cubic-bezier(0.34, 1.56, 0.64, 1)`,zIndex:o?1:0}:a},[o,n,r,e]);return jsxRuntime.jsx(c,{ref:l,style:{...i},className:"--content",children:t||o?s:null})};us.displayName="Zuz.TabBody";var fs=us;var hs=({ref:o,...n})=>{let{tabs:e,speed:r=.3,prerender:t=true,variant:s,tabStyle:u="fixed",onChange:l,transitionType:m="slide",...i}=n,[a,f]=react.useState(0),p=react.useRef(null),d=hooks.useResizeObserver(p),b=react.useMemo(()=>core.uuid(8),[]),[w,x]=react.useState("auto"),h=react.useMemo(()=>d.width>0,[d.width]);react.useImperativeHandle(o,()=>({setTab:P=>f(P)}));let S=react.useMemo(()=>e.map(P=>({...P,key:P.key||core.uuid(8)})),[e]),{style:g,className:v,rest:I}=R({as:`flex cols w-full no-overflow ${i.as||""}`,...i}),T=()=>{if(!h)return {opacity:0};switch(m){case "fade":return {display:"grid",gridTemplateColumns:"1fr"};case "scale":return {display:"grid",gridTemplateColumns:"1fr"};default:return {display:"flex",transform:`translate3d(-${a*d.width}px, 0, 0)`,transition:`transform ${r}s cubic-bezier(0.4, 0, 0.2, 1)`}}};return jsxRuntime.jsxs(c,{ref:p,style:g,className:`--tabview --${u} flex cols ${v}`,children:[jsxRuntime.jsx(ot,{as:"--tabview-head",onSwitch:P=>{f(P.index);let N=S.find(M=>M.tag==P.tag);N&&N.onSelect&&(N.onSelect(N,P.index),l?.(N,P.index));},selected:a,items:S.reduce((P,N,M)=>(P.push({icon:N.icon,index:M,label:N.label,tag:N.tag}),P),[])}),jsxRuntime.jsx(c,{className:"--tabview-body",as:"rel no-overflow w-full",style:{height:w,transition:h?`height ${r}s cubic-bezier(0.4, 0, 0.2, 1)`:"none",opacity:h?1:0},children:jsxRuntime.jsx(c,{className:"--track",style:{...T()},children:S.map((P,N)=>jsxRuntime.jsx(fs,{isActive:N===a,transitionType:m,speed:r,width:d.width,render:t||N===a,onHeightChange:M=>N===a&&x(M),content:P.body},`tab-body-${P.key||N}-${b}`))})})]})};hs.displayName="Zuz.TabView";var qc=hs;var Jc=({ref:o,commands:n,onCommand:e,welcomeMessage:r="Welcome to Zuz Terminal v1.0.0",prompt:t="zuz ~ ",variant:s,...u})=>{let[l,m]=react.useState([{type:"output",content:r}]),[i,a]=react.useState(""),f=react.useRef(null),p=react.useRef(null),{variant:d}=X(true);react.useEffect(()=>{f.current&&(f.current.scrollTop=f.current.scrollHeight);},[l]);let b=v=>{let I=typeof v=="string"?{type:"output",content:v}:v;m(T=>{let P=[...T,I];return P.length>1e3?P.slice(-1e3):P});},w=()=>m([]);react.useImperativeHandle(o,()=>({write:b,clear:w}));let x=async v=>{let[I,...T]=v.split(" "),P=I.toLowerCase();return n&&n[P]?await n[P](T):e?await e(v):`command not found: ${I}`},h=v=>{let I=/\u001b\[(\d+)m/g,T=[],P={31:"#ff5f56",32:"#27c93f",33:"#ffbd2e",34:"#007aff",35:"#ff79c6",36:"#8be9fd",39:"#d4d4d4"},N=0,M="#d4d4d4",L=false,V;for(;(V=I.exec(v))!==null;){let _=v.slice(N,V.index);_&&T.push({text:_,color:M,bold:L});let U=V[1];U==="0"?(M="#d4d4d4",L=false):U==="1"?L=true:P[U]&&(M=P[U]),N=I.lastIndex;}let E=v.slice(N);return E&&T.push({text:E,color:M,bold:L}),T},S=(v,I)=>v.includes("\x1B")?h(v).map((T,P)=>jsxRuntime.jsx(J,{style:{color:T.color||"#d4d4d4",fontWeight:T.bold?"bold":"normal"},children:T.text},`--terminal-msg-${P}-${T.text.replace(/\S+/g,"-")}`)):jsxRuntime.jsx(J,{style:{color:I==="error"?"#ff5f56":I==="command"?"#00ff00":"#d4d4d4"},children:v}),g=async v=>{if(v.key==="Enter"&&i.trim()){let I=i.trim(),T=[...l,{type:"command",content:`${t}${I}`}];a(""),m(T);let P=await x(I);m(N=>[...N,{type:"output",content:P}]);}};return jsxRuntime.jsxs(c,{as:`--zuz-terminal --${s||d||W.Medium} flex cols ${u.className}`,onClick:()=>p.current?.focus(),children:[jsxRuntime.jsx(c,{ref:f,className:"--terminal-log",children:l.map((v,I)=>jsxRuntime.jsx(c,{children:jsxRuntime.jsx(H,{children:S(v.content,v.type)})},I))}),jsxRuntime.jsxs(c,{as:"flex aic --terminal-input",children:[jsxRuntime.jsx(H,{as:"--terminal-prompt",children:t}),jsxRuntime.jsx(oe,{ref:p,className:"--zuz-term-input",autoFocus:true,value:i,variant:s||d||W.Medium,onChange:v=>a(v.target.value),onKeyDown:g})]})]})},jc=Jc;var ep=({meta:o})=>jsxRuntime.jsxs(z,{as:"flex aic --command-item",children:[o.icon&&jsxRuntime.jsx(Y,{name:o.icon,as:"--command-icon"}),jsxRuntime.jsx(H,{children:o.label})]}),tp=({position:o,onSelect:n,commands:e,visible:r})=>jsxRuntime.jsx(c,{"aria-hidden":!r,fx:{transition:G.SlideInBottom,duration:.1,when:r},className:"--command-box abs grid",style:{...o},children:e.map(t=>jsxRuntime.jsx(ep,{meta:t},`cmd-${t.label.replace(/\s+/,"-")}`))}),ws=tp;var Cs=react.forwardRef((o,n)=>{let{autoResize:e,maxHeight:r,variant:t,resize:s="none",command:u,commands:l,onInput:m,cmd:i,renderDropdown:a,value:f,defaultValue:p,...d}=o,b=react.useRef(null),w=react.useRef(null),{variant:x}=X(true),{style:h,className:S,rest:g}=R(d),{showDropdown:v,dropdownPosition:I,handleKeyDown:T,handleInput:P,handleCommandSelect:N}=hooks.useCommandActions({command:u,commands:l,cmd:i,ref:b}),M=react.useCallback(()=>{let V=b.current;!V||!e||(w.current&&cancelAnimationFrame(w.current),w.current=requestAnimationFrame(()=>{V.style.height="auto";let E=V.scrollHeight;if(r){let _=parseInt(r.toString(),10);isNaN(_)||(E=Math.min(E,_));}V.style.height=`${E}px`,V.style.overflowY=r&&E>=parseInt(r.toString(),10)?"auto":"hidden";}));},[e,r]),L=V=>{m?.(V),P(V),M();};return react.useEffect(()=>{M();},[f,p,M]),react.useEffect(()=>{e&&b.current&&M();},[e,M]),react.useEffect(()=>()=>{w.current&&cancelAnimationFrame(w.current);},[]),jsxRuntime.jsxs(c,{as:"rel",children:[jsxRuntime.jsx("textarea",{className:`--input --textarea --${t||x||W.Medium} flex ${S}`.trim(),style:{...h,resize:s,height:e?"auto":h?.height,overflow:"hidden",transition:e?"none":void 0},onKeyDown:T,onInput:L,ref:V=>{typeof n=="function"?n(V):n&&(n.current=V),b.current=V;},value:f,defaultValue:p,...g}),a?a({show:v,position:I,commands:l||[],onSelect:N}):l&&l.length>0&&jsxRuntime.jsx(ws,{visible:v,commands:l,onSelect:N,position:I})]})});Cs.displayName="Zuz.TextArea";var ap=Cs;var Ps=react.forwardRef((o,n)=>{let{as:e,value:r,color:t,direction:s,...u}=o,l=react.useRef(null),[m,i]=react.useState(r||0);return react.useImperativeHandle(n,()=>({updateValue(a){m.toString().length!==a.toString().length&&i(a);},setValue(a){if(this.updateValue(a),l.current){let f=a.toString().split("");l.current.querySelectorAll(".--wheel-char").forEach((p,d)=>{let b=f[d];if(p instanceof HTMLElement){p.setAttribute("data-value",b);let w=p.querySelector(".--wheel-char-track");w instanceof HTMLElement&&(w.style.setProperty("--v",b),w.offsetWidth);}});}}})),react.useEffect(()=>{i(r||0);},[r]),jsxRuntime.jsxs(c,{className:"--text-wheel flex aic rel","aria-hidden":true,as:e,ref:l,...u,children:[(m||0).toString().split("").map((a,f)=>isNaN(parseInt(a,10))?jsxRuntime.jsx(J,{className:"--wheel-char wheel-char-symbol grid",children:a},`wheel-char-symbol-${f}`):jsxRuntime.jsx(J,{"data-value":a,className:`--wheel-char grid ${f>(m||0).toString().length-3?"--wheel-fraction":""}`.trim(),children:jsxRuntime.jsxs(J,{className:`--wheel-char-track --wheel-track-${s||"down"} grid`,style:{"--v":a},children:[jsxRuntime.jsx(J,{children:!s||s==="down"?0:9}),(!s||s==="down"?[9,8,7,6,5,4,3,2,1,0]:[0,1,2,3,4,5,6,7,8,9]).map((p,d)=>jsxRuntime.jsx(J,{children:p},`${f}--${d}`)),jsxRuntime.jsx(J,{children:!s||s==="down"?9:0})]})},`wheel-char-${f}`)),t&&jsxRuntime.jsx(c,{className:"abs fillx",style:{zIndex:1,background:`linear-gradient(0deg, ${t}, transparent, transparent, transparent, ${t})`}})]})});Ps.displayName="Zuz.TextWheel";var fp=Ps;var Es=react.forwardRef((o,n)=>{let{title:e,position:r,margin:t,children:s,...u}=o,{style:l,className:m,rest:i}=R(u),[a,f]=react.useState(false),p=react.useMemo(()=>r||ee.Top,[]),d=react.useRef(null),b=react.useRef(null),w=g=>{},x=typeof ResizeObserver<"u"?new ResizeObserver(w):{observe:()=>{},unobserve:()=>{}},h=hooks.useDimensions(),S=react.useMemo(()=>{if(!b.current)return {left:0,top:0};let g=b.current.previousElementSibling;if(g){let v=g.getBoundingClientRect();switch(x.observe(g),p){case ee.Top:return {left:v.left+v.width/2,top:v.top-(t||25)};case ee.Bottom:return {left:v.left+v.width/2,top:v.top+(t||25)};case ee.Left:return {left:v.left-v.width/2,top:v.top+v.height/2};case ee.Right:return {left:v.right,top:v.top+v.height/2};default:return {left:0,top:0}}}},[b.current,h,x]);return react.useEffect(()=>{},[]),jsxRuntime.jsxs(c,{ref:d,className:"--with-tooltip rel",onMouseEnter:g=>f(true),onMouseLeave:g=>f(false),children:[s,jsxRuntime.jsx(c,{ref:b,style:{left:S?.left+"px",top:S?.top+"px"},className:`--tooltip --${r||ee.Top} fixed ${m}`.trim(),fx:{from:p==ee.Bottom||p==ee.Top?{opacity:0,x:"-50%",y:p==ee.Top?-5:5}:{opacity:0,y:"-50%",x:p==ee.Right?15:-25},to:p==ee.Bottom||p==ee.Top?{opacity:1,x:"-50%",y:0}:{opacity:1,y:"-50%",x:p==ee.Right?10:-20},curve:F.EaseInOut,when:a},children:jsxRuntime.jsx(H,{className:"--text rel",children:e})})]})});Es.displayName="Zuz.ToolTip";var yp=Es;var Do=react.forwardRef((o,n)=>{let{as:e,meta:r,nodes:t,icons:s,onSelect:u,treeTag:l,selected:m,roots:i,expanded:a,...f}=o,{tag:p,label:d,icon:b,under:w,isHead:x}=r,h=react.useMemo(()=>i.includes(p),[i]),[S,g]=react.useState(a),v=()=>{localStorage.setItem(`--tn${l}-${p}`,S?"0":"1"),g(!S);};react.useEffect(()=>{a||h&&!localStorage.getItem(`--tn${l}-${p}`)?(localStorage.setItem(`--tn${l}-${p}`,"1"),g(true)):g(localStorage.getItem(`--tn${l}-${p}`)=="1");},[]);let I=react.useMemo(()=>t.filter(T=>T.under==p),[t,p]);return jsxRuntime.jsxs(c,{className:`--treenode ${h?"--is-root":""} --treenode-${p} flex cols`,children:[jsxRuntime.jsxs(c,{className:`--node --node-${p} flex aic ${m==p?" --selected":""}`,children:[jsxRuntime.jsx(z,{skeleton:f.skeleton,onClick:v,className:"--node-aro-btn",disabled:I.length==0,children:s?.arrowClose&&s?.arrowOpen?jsxRuntime.jsx(Y,{skeleton:f.skeleton,className:"--node-aro-icon",name:I.length==0?s?.arrowDisabled||s?.arrowClose:S?s?.arrowOpen:s?.arrowClose}):I.length==0?O.chevronBottom:S?O.chevronBottom:O.chevronRight}),jsxRuntime.jsxs(z,{className:"--node-meta flex aic",onClick:T=>u(p),children:[(s?.nodeOpen&&s?.nodeClose||h&&s?.rootOpen&&s?.rootClose)&&jsxRuntime.jsx(Y,{skeleton:f.skeleton,className:`--node-icon ${h?"--icon-root":""}`,name:b||(S?h&&s?.rootOpen||s.nodeOpen:h&&s?.rootClose||s?.nodeClose)}),jsxRuntime.jsx(H,{className:`--node-label ${h?"--node-label-root":""}`.trim(),skeleton:f.skeleton,children:d})]})]}),S&&I.length>0&&jsxRuntime.jsx(c,{className:`--sub-node tree-sub-node-${p} flex cols`,children:I.map(T=>jsxRuntime.jsx(Do,{treeTag:l,selected:m,onSelect:u,icons:s,roots:i,expanded:T.expanded||false,meta:T,nodes:t},`--node-${T.tag}`))})]})});Do.displayName="TreeItem";var Ls=Do;var ks=react.forwardRef((o,n)=>{let{as:e,nodes:r,onNodeSelect:t,tag:s,icons:u,roots:l,selected:m,...i}=o,[a,f]=react.useState(m);react.useImperativeHandle(n,()=>({getSelected:()=>a}),[t]);let p=d=>{f(d),t&&t(d);};return react.useEffect(()=>{a!=m&&f(m);},[m]),jsxRuntime.jsx(c,{className:"--treeview flex cols",children:r.filter(d=>l.includes(d.tag)).map(d=>jsxRuntime.jsx(Ls,{treeTag:s?`-${s}`:"",selected:a,onSelect:b=>p(b),icons:u,meta:d,roots:l,expanded:d.expanded||false,skeleton:i.skeleton,nodes:r},`--node-${d.tag}`))})});ks.displayName="Zuz.TreeView";var Ip=ks;String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"").replace(/\s+/g," ")};
|
|
14
|
-
Object.defineProperty(exports,"PACKAGE_NAME",{enumerable:true,get:function(){return
|
|
14
|
+
Object.defineProperty(exports,"PACKAGE_NAME",{enumerable:true,get:function(){return chunkEDVIEQHU_cjs.f}});Object.defineProperty(exports,"cleanProps",{enumerable:true,get:function(){return chunkEDVIEQHU_cjs.g}});Object.defineProperty(exports,"splitAtoms",{enumerable:true,get:function(){return chunkEDVIEQHU_cjs.h}});exports.ALERT=le;exports.AVATAR=zo;exports.Accordion=li;exports.ActionBar=di;exports.Alert=xi;exports.AutoComplete=Di;exports.Avatar=Zi;exports.Badge=Wi;exports.Box=c;exports.Bubble=bl;exports.BubbleMediaType=rn;exports.BubbleStatus=on;exports.Button=z;exports.CHART=Jr;exports.CHECKBOX=ye;exports.COLORTHEME=Lp;exports.Calendar=io;exports.Chart=ul;exports.CheckBox=tt;exports.CodeBlock=Bl;exports.ColorScheme=Wl;exports.ContextMenu=_t;exports.CookiesConsent=Xl;exports.Cover=Ne;exports.CropShape=rm;exports.Cropper=tm;exports.Crumb=sm;exports.DATATYPE=Op;exports.DIALOG=He;exports.DIALOG_ACTION_POSITION=_o;exports.DRAWER_SIDE=se;exports.DatePicker=mm;exports.Dialog=Zt;exports.Drawer=Yt;exports.FILTER=ct;exports.FORMVALIDATION=be;exports.FORMVALIDATION_STYLE=Dp;exports.Fab=fm;exports.Filters=hm;exports.Form=Bm;exports.Grid=Om;exports.Group=Ft;exports.Icon=Y;exports.Image=Je;exports.Input=oe;exports.KeyboardKeys=So;exports.KeysLabelMap=An;exports.KeysMap=Vn;exports.Label=et;exports.LayersProvider=$t;exports.List=Me;exports.NetworkStatus=_m;exports.ORIGIN=Ke;exports.OriginType=Mp;exports.Overlay=Ee;exports.POSITION=Bt;exports.PROGRESS=Vp;exports.Pagination=Po;exports.PaginationStyle=Co;exports.Password=Qm;exports.PinInput=tc;exports.Position=ee;exports.ProgressBar=mo;exports.RADIO=Mt;exports.Radio=sc;exports.SHEET=me;exports.SHEET_ACTION_POSITION=Lt;exports.SKELETON=Bp;exports.SLIDER=mt;exports.SORT=kp;exports.SPINNER=re;exports.ScrollView=Wt;exports.Search=fc;exports.Select=bc;exports.SelectTabs=ot;exports.Sheet=vm;exports.Slider=go;exports.Span=J;exports.Spinner=ge;exports.Status=Hp;exports.Switch=vc;exports.TRANSITIONS=G;exports.TRANSITION_CURVES=F;exports.TabView=qc;exports.Table=Dc;exports.TableOfContents=Ac;exports.Terminal=jc;exports.Text=H;exports.TextWheel=fp;exports.Textarea=ap;exports.ThemeProvider=Us;exports.ToastDefaultTitle=Pr;exports.ToastProvider=Qt;exports.ToastType=Tr;exports.ToolTip=yp;exports.TreeView=Ip;exports.Variant=W;exports.animationTransition=We;exports.buildClassString=kt;exports.buildWithStyles=Ko;exports.css=ru;exports.getAnimationCurve=Ot;exports.getAnimationTransition=nu;exports.getZuzMap=Ds;exports.isKeyCombination=Hn;exports.setZuzMap=Zo;exports.useBase=R;exports.useContextMenu=oi;exports.useDialog=Wa;exports.useDrawer=Ya;exports.useFx=ae;exports.useMorph=ja;exports.usePosition=Ue;exports.useToast=jt;
|
package/dist/index.d.cts
CHANGED
|
@@ -5,17 +5,6 @@ import * as _zuzjs_hooks from '@zuzjs/hooks';
|
|
|
5
5
|
import { LineChartProps, Command } from '@zuzjs/hooks';
|
|
6
6
|
import { PubSub } from '@zuzjs/core';
|
|
7
7
|
|
|
8
|
-
/**
|
|
9
|
-
* Converts a "const object" into a union of its values.
|
|
10
|
-
* Equivalent to: typeof Obj[keyof typeof Obj]
|
|
11
|
-
*/
|
|
12
|
-
type ValueOf<T> = T[keyof T];
|
|
13
|
-
type dynamic = {
|
|
14
|
-
[x: string]: any;
|
|
15
|
-
};
|
|
16
|
-
type Props<T extends ElementType> = ZuzProps & Omit<ComponentPropsWithoutRef<T>, keyof ZuzProps>;
|
|
17
|
-
type FormInputs = HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement;
|
|
18
|
-
|
|
19
8
|
declare const AVATAR: {
|
|
20
9
|
readonly Circle: "CIRCLE";
|
|
21
10
|
readonly Square: "SQUARE";
|
|
@@ -171,6 +160,17 @@ declare const DRAWER_SIDE: {
|
|
|
171
160
|
readonly Bottom: "BOTTOM";
|
|
172
161
|
};
|
|
173
162
|
|
|
163
|
+
/**
|
|
164
|
+
* Converts a "const object" into a union of its values.
|
|
165
|
+
* Equivalent to: typeof Obj[keyof typeof Obj]
|
|
166
|
+
*/
|
|
167
|
+
type ValueOf<T> = T[keyof T];
|
|
168
|
+
type dynamic = {
|
|
169
|
+
[x: string]: any;
|
|
170
|
+
};
|
|
171
|
+
type Props<T extends ElementType> = ZuzProps & Omit<ComponentPropsWithoutRef<T>, keyof ZuzProps>;
|
|
172
|
+
type FormInputs = HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement;
|
|
173
|
+
|
|
174
174
|
declare const cssProps: dynamic;
|
|
175
175
|
declare const cssDirect: dynamic;
|
|
176
176
|
|
|
@@ -295,6 +295,10 @@ interface Skeleton {
|
|
|
295
295
|
/** Border radius for the skeleton, allowing rounded corners */
|
|
296
296
|
radius?: number | string;
|
|
297
297
|
}
|
|
298
|
+
interface LayerHandler {
|
|
299
|
+
id: number;
|
|
300
|
+
hide: () => void;
|
|
301
|
+
}
|
|
298
302
|
|
|
299
303
|
type AccordionProps = BoxProps & {
|
|
300
304
|
message?: string | ReactNode;
|
|
@@ -1807,10 +1811,7 @@ options?: PositionOptions) => {
|
|
|
1807
1811
|
|
|
1808
1812
|
declare const useDialog: () => {
|
|
1809
1813
|
clearAll: () => void;
|
|
1810
|
-
show: (pops: Omit<DialogProps, `id` | `onShow` | `onHide`>) =>
|
|
1811
|
-
id: number;
|
|
1812
|
-
hide: () => void;
|
|
1813
|
-
};
|
|
1814
|
+
show: (pops: Omit<DialogProps, `id` | `onShow` | `onHide`>) => LayerHandler;
|
|
1814
1815
|
hide: (id: number) => void;
|
|
1815
1816
|
};
|
|
1816
1817
|
|
|
@@ -1826,26 +1827,11 @@ declare const useToast: () => {
|
|
|
1826
1827
|
|
|
1827
1828
|
declare const useDrawer: () => {
|
|
1828
1829
|
clearAll: () => void;
|
|
1829
|
-
open: (child?: string | ReactNode | ReactNode[]) =>
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
id: number;
|
|
1835
|
-
hide: () => void;
|
|
1836
|
-
};
|
|
1837
|
-
left: (child?: string | ReactNode | ReactNode[]) => {
|
|
1838
|
-
id: number;
|
|
1839
|
-
hide: () => void;
|
|
1840
|
-
};
|
|
1841
|
-
top: (child?: string | ReactNode | ReactNode[]) => {
|
|
1842
|
-
id: number;
|
|
1843
|
-
hide: () => void;
|
|
1844
|
-
};
|
|
1845
|
-
bottom: (child?: string | ReactNode | ReactNode[]) => {
|
|
1846
|
-
id: number;
|
|
1847
|
-
hide: () => void;
|
|
1848
|
-
};
|
|
1830
|
+
open: (child?: string | ReactNode | ReactNode[]) => LayerHandler;
|
|
1831
|
+
right: (child?: string | ReactNode | ReactNode[]) => LayerHandler;
|
|
1832
|
+
left: (child?: string | ReactNode | ReactNode[]) => LayerHandler;
|
|
1833
|
+
top: (child?: string | ReactNode | ReactNode[]) => LayerHandler;
|
|
1834
|
+
bottom: (child?: string | ReactNode | ReactNode[]) => LayerHandler;
|
|
1849
1835
|
close: (id: number) => void;
|
|
1850
1836
|
};
|
|
1851
1837
|
|
|
@@ -1909,4 +1895,4 @@ declare const animationTransition: (transition: ValueOf<typeof TRANSITIONS>, off
|
|
|
1909
1895
|
};
|
|
1910
1896
|
declare const getAnimationTransition: (transition: ValueOf<typeof TRANSITIONS>, to?: boolean, from?: boolean) => dynamic;
|
|
1911
1897
|
|
|
1912
|
-
export { ALERT, AVATAR, Accordion, type AccordionHandler, type AccordionProps, ActionBar, type ActionBarHandler, type ActionBarItem, type ActionBarProps, Alert, type AlertHandler, type AlertProps, AutoComplete, type AutoCompleteProps, Avatar, type AvatarHandler, type AvatarProps, Badge, type BadgeProps, Box, type BoxProps, Bubble, BubbleMediaType, type BubbleProps, BubbleStatus, Button, type ButtonHandler, type ButtonProps, ButtonState, CHART, CHECKBOX, COLORTHEME, Calendar, type CalendarProps, Chart, type ChartProps, CheckBox, type CheckBoxProps, type CheckboxHandler, CodeBlock, type CodeBlockProps, ColorScheme$1 as ColorScheme, type Column, type ContextItem, ContextMenu, type ContextMenuHandler, type ContextMenuProps, type CookieConsentProps, CookiesConsent, Cover, type CoverProps, type CropHandler, CropShape, Cropper, type CropperProps, Crumb, type CrumbItem, type CrumbProps, DATATYPE, DIALOG, DIALOG_ACTION_POSITION, DRAWER_SIDE, DatePicker, Dialog, type DialogActionHandler, type DialogHandler, type DialogProps, Drawer, type DrawerHandler, type DrawerProps, FILTER, FORMVALIDATION, FORMVALIDATION_STYLE, Fab, type FabProps, type FilterProps, Filters, Form, type FormHandler, type FormInputs, type FormProps, Grid, type GridProps, Group, type GroupProps, Icon, type IconProps, Image, type ImageProps, Input, type InputProps, type KeyCombination, type KeyboardKey, type KeyboardKeyProps, KeyBoardKeys as KeyboardKeys, KeysLabelMap, KeysMap, Label, type LabelProps, LayersProvider, List, type ListItem, type ListItemObject, type ListProps, type MenuItemProps, type MorphOptions, type NetworkManagerprops, NetworkManager as NetworkStatus, ORIGIN, type Option, type OptionItemProps, OriginType, Overlay, type OverlayProps, PACKAGE_NAME, POSITION, PROGRESS, Pagination, type PaginationCallback, type PaginationPage, type PaginationPageItem, type PaginationProps, PaginationStyle, Password, type PasswordProps, PinInput, type PinInputProps, Position, ProgressBar, type ProgressBarProps, type ProgressHandler, type Props, RADIO, Radio, type RadioHandler, type RadioProps, type Row, type RowSelectCallback, SHEET, SHEET_ACTION_POSITION, SKELETON, SLIDER, SORT, SPINNER, ScrollView, type ScrollViewProps, Search, type SearchHandler, type SearchProps, type Segment, type SegmentController, type SegmentItemProps, type SegmentProps, Select, type SelectHandler, type SelectProps, Segmented as SelectTabs, Sheet, type SheetHandler, type SheetProps, type Skeleton, Slider, type SliderProps, Span, type SpanProps, Spinner, type SpinnerProps, Status, Switch, type CheckboxHandler as SwitchHandler, TRANSITIONS, TRANSITION_CURVES, type Tab, type TabBodyProps, type TabProps, TabView, type TabViewHandler, type TabViewProps, ForwardedTable as Table, type TableController, type TableOfContentItem, TableOfContents, type TableOfContentsProps, type TableProps, type TableSortCallback, Terminal, type TerminalCommandFn, type TerminalCommands, type TerminalHandler, type TerminalLine, type TerminalProps, Text, type TextAreaProps, TextWheel, type TextWheelHandler, type TextWheelProps, TextArea as Textarea, ThemeProvider, ToastDefaultTitle, type ToastProps, Toast as ToastProvider, ToastType, ToolTip, type ToolTipProps, type TreeItemHandler, type TreeItemProps, type TreeNode, type TreeNodeIcons, TreeView, type TreeViewHandler, type TreeViewProps, type Value, type ValueOf, Variant, type ZuzCommonValues, type ZuzProps, type ZuzStyleString, type animationProps, animationTransition, buildClassString, buildWithStyles, cleanProps, css, type cssShortKey, type cssShortKeys, type dynamic, getAnimationCurve, getAnimationTransition, getZuzMap, isKeyCombination, type parallaxEffectProps, setZuzMap, splitAtoms, useBase, useContextMenu, useDialog, useDrawer, useFx, useMorph, usePosition, useToast };
|
|
1898
|
+
export { ALERT, AVATAR, Accordion, type AccordionHandler, type AccordionProps, ActionBar, type ActionBarHandler, type ActionBarItem, type ActionBarProps, Alert, type AlertHandler, type AlertProps, AutoComplete, type AutoCompleteProps, Avatar, type AvatarHandler, type AvatarProps, Badge, type BadgeProps, Box, type BoxProps, Bubble, BubbleMediaType, type BubbleProps, BubbleStatus, Button, type ButtonHandler, type ButtonProps, ButtonState, CHART, CHECKBOX, COLORTHEME, Calendar, type CalendarProps, Chart, type ChartProps, CheckBox, type CheckBoxProps, type CheckboxHandler, CodeBlock, type CodeBlockProps, ColorScheme$1 as ColorScheme, type Column, type ContextItem, ContextMenu, type ContextMenuHandler, type ContextMenuProps, type CookieConsentProps, CookiesConsent, Cover, type CoverProps, type CropHandler, CropShape, Cropper, type CropperProps, Crumb, type CrumbItem, type CrumbProps, DATATYPE, DIALOG, DIALOG_ACTION_POSITION, DRAWER_SIDE, DatePicker, Dialog, type DialogActionHandler, type LayerHandler as DialogController, type DialogHandler, type DialogProps, Drawer, type LayerHandler as DrawerController, type DrawerHandler, type DrawerProps, FILTER, FORMVALIDATION, FORMVALIDATION_STYLE, Fab, type FabProps, type FilterProps, Filters, Form, type FormHandler, type FormInputs, type FormProps, Grid, type GridProps, Group, type GroupProps, Icon, type IconProps, Image, type ImageProps, Input, type InputProps, type KeyCombination, type KeyboardKey, type KeyboardKeyProps, KeyBoardKeys as KeyboardKeys, KeysLabelMap, KeysMap, Label, type LabelProps, type LayerHandler, LayersProvider, List, type ListItem, type ListItemObject, type ListProps, type MenuItemProps, type MorphOptions, type NetworkManagerprops, NetworkManager as NetworkStatus, ORIGIN, type Option, type OptionItemProps, OriginType, Overlay, type OverlayProps, PACKAGE_NAME, POSITION, PROGRESS, Pagination, type PaginationCallback, type PaginationPage, type PaginationPageItem, type PaginationProps, PaginationStyle, Password, type PasswordProps, PinInput, type PinInputProps, Position, ProgressBar, type ProgressBarProps, type ProgressHandler, type Props, RADIO, Radio, type RadioHandler, type RadioProps, type Row, type RowSelectCallback, SHEET, SHEET_ACTION_POSITION, SKELETON, SLIDER, SORT, SPINNER, ScrollView, type ScrollViewProps, Search, type SearchHandler, type SearchProps, type Segment, type SegmentController, type SegmentItemProps, type SegmentProps, Select, type SelectHandler, type SelectProps, Segmented as SelectTabs, Sheet, type SheetHandler, type SheetProps, type Skeleton, Slider, type SliderProps, Span, type SpanProps, Spinner, type SpinnerProps, Status, Switch, type CheckboxHandler as SwitchHandler, TRANSITIONS, TRANSITION_CURVES, type Tab, type TabBodyProps, type TabProps, TabView, type TabViewHandler, type TabViewProps, ForwardedTable as Table, type TableController, type TableOfContentItem, TableOfContents, type TableOfContentsProps, type TableProps, type TableSortCallback, Terminal, type TerminalCommandFn, type TerminalCommands, type TerminalHandler, type TerminalLine, type TerminalProps, Text, type TextAreaProps, TextWheel, type TextWheelHandler, type TextWheelProps, TextArea as Textarea, ThemeProvider, ToastDefaultTitle, type ToastProps, Toast as ToastProvider, ToastType, ToolTip, type ToolTipProps, type TreeItemHandler, type TreeItemProps, type TreeNode, type TreeNodeIcons, TreeView, type TreeViewHandler, type TreeViewProps, type Value, type ValueOf, Variant, type ZuzCommonValues, type ZuzProps, type ZuzStyleString, type animationProps, animationTransition, buildClassString, buildWithStyles, cleanProps, css, type cssShortKey, type cssShortKeys, type dynamic, getAnimationCurve, getAnimationTransition, getZuzMap, isKeyCombination, type parallaxEffectProps, setZuzMap, splitAtoms, useBase, useContextMenu, useDialog, useDrawer, useFx, useMorph, usePosition, useToast };
|
package/dist/index.d.ts
CHANGED
|
@@ -5,17 +5,6 @@ import * as _zuzjs_hooks from '@zuzjs/hooks';
|
|
|
5
5
|
import { LineChartProps, Command } from '@zuzjs/hooks';
|
|
6
6
|
import { PubSub } from '@zuzjs/core';
|
|
7
7
|
|
|
8
|
-
/**
|
|
9
|
-
* Converts a "const object" into a union of its values.
|
|
10
|
-
* Equivalent to: typeof Obj[keyof typeof Obj]
|
|
11
|
-
*/
|
|
12
|
-
type ValueOf<T> = T[keyof T];
|
|
13
|
-
type dynamic = {
|
|
14
|
-
[x: string]: any;
|
|
15
|
-
};
|
|
16
|
-
type Props<T extends ElementType> = ZuzProps & Omit<ComponentPropsWithoutRef<T>, keyof ZuzProps>;
|
|
17
|
-
type FormInputs = HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement;
|
|
18
|
-
|
|
19
8
|
declare const AVATAR: {
|
|
20
9
|
readonly Circle: "CIRCLE";
|
|
21
10
|
readonly Square: "SQUARE";
|
|
@@ -171,6 +160,17 @@ declare const DRAWER_SIDE: {
|
|
|
171
160
|
readonly Bottom: "BOTTOM";
|
|
172
161
|
};
|
|
173
162
|
|
|
163
|
+
/**
|
|
164
|
+
* Converts a "const object" into a union of its values.
|
|
165
|
+
* Equivalent to: typeof Obj[keyof typeof Obj]
|
|
166
|
+
*/
|
|
167
|
+
type ValueOf<T> = T[keyof T];
|
|
168
|
+
type dynamic = {
|
|
169
|
+
[x: string]: any;
|
|
170
|
+
};
|
|
171
|
+
type Props<T extends ElementType> = ZuzProps & Omit<ComponentPropsWithoutRef<T>, keyof ZuzProps>;
|
|
172
|
+
type FormInputs = HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement;
|
|
173
|
+
|
|
174
174
|
declare const cssProps: dynamic;
|
|
175
175
|
declare const cssDirect: dynamic;
|
|
176
176
|
|
|
@@ -295,6 +295,10 @@ interface Skeleton {
|
|
|
295
295
|
/** Border radius for the skeleton, allowing rounded corners */
|
|
296
296
|
radius?: number | string;
|
|
297
297
|
}
|
|
298
|
+
interface LayerHandler {
|
|
299
|
+
id: number;
|
|
300
|
+
hide: () => void;
|
|
301
|
+
}
|
|
298
302
|
|
|
299
303
|
type AccordionProps = BoxProps & {
|
|
300
304
|
message?: string | ReactNode;
|
|
@@ -1807,10 +1811,7 @@ options?: PositionOptions) => {
|
|
|
1807
1811
|
|
|
1808
1812
|
declare const useDialog: () => {
|
|
1809
1813
|
clearAll: () => void;
|
|
1810
|
-
show: (pops: Omit<DialogProps, `id` | `onShow` | `onHide`>) =>
|
|
1811
|
-
id: number;
|
|
1812
|
-
hide: () => void;
|
|
1813
|
-
};
|
|
1814
|
+
show: (pops: Omit<DialogProps, `id` | `onShow` | `onHide`>) => LayerHandler;
|
|
1814
1815
|
hide: (id: number) => void;
|
|
1815
1816
|
};
|
|
1816
1817
|
|
|
@@ -1826,26 +1827,11 @@ declare const useToast: () => {
|
|
|
1826
1827
|
|
|
1827
1828
|
declare const useDrawer: () => {
|
|
1828
1829
|
clearAll: () => void;
|
|
1829
|
-
open: (child?: string | ReactNode | ReactNode[]) =>
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
id: number;
|
|
1835
|
-
hide: () => void;
|
|
1836
|
-
};
|
|
1837
|
-
left: (child?: string | ReactNode | ReactNode[]) => {
|
|
1838
|
-
id: number;
|
|
1839
|
-
hide: () => void;
|
|
1840
|
-
};
|
|
1841
|
-
top: (child?: string | ReactNode | ReactNode[]) => {
|
|
1842
|
-
id: number;
|
|
1843
|
-
hide: () => void;
|
|
1844
|
-
};
|
|
1845
|
-
bottom: (child?: string | ReactNode | ReactNode[]) => {
|
|
1846
|
-
id: number;
|
|
1847
|
-
hide: () => void;
|
|
1848
|
-
};
|
|
1830
|
+
open: (child?: string | ReactNode | ReactNode[]) => LayerHandler;
|
|
1831
|
+
right: (child?: string | ReactNode | ReactNode[]) => LayerHandler;
|
|
1832
|
+
left: (child?: string | ReactNode | ReactNode[]) => LayerHandler;
|
|
1833
|
+
top: (child?: string | ReactNode | ReactNode[]) => LayerHandler;
|
|
1834
|
+
bottom: (child?: string | ReactNode | ReactNode[]) => LayerHandler;
|
|
1849
1835
|
close: (id: number) => void;
|
|
1850
1836
|
};
|
|
1851
1837
|
|
|
@@ -1909,4 +1895,4 @@ declare const animationTransition: (transition: ValueOf<typeof TRANSITIONS>, off
|
|
|
1909
1895
|
};
|
|
1910
1896
|
declare const getAnimationTransition: (transition: ValueOf<typeof TRANSITIONS>, to?: boolean, from?: boolean) => dynamic;
|
|
1911
1897
|
|
|
1912
|
-
export { ALERT, AVATAR, Accordion, type AccordionHandler, type AccordionProps, ActionBar, type ActionBarHandler, type ActionBarItem, type ActionBarProps, Alert, type AlertHandler, type AlertProps, AutoComplete, type AutoCompleteProps, Avatar, type AvatarHandler, type AvatarProps, Badge, type BadgeProps, Box, type BoxProps, Bubble, BubbleMediaType, type BubbleProps, BubbleStatus, Button, type ButtonHandler, type ButtonProps, ButtonState, CHART, CHECKBOX, COLORTHEME, Calendar, type CalendarProps, Chart, type ChartProps, CheckBox, type CheckBoxProps, type CheckboxHandler, CodeBlock, type CodeBlockProps, ColorScheme$1 as ColorScheme, type Column, type ContextItem, ContextMenu, type ContextMenuHandler, type ContextMenuProps, type CookieConsentProps, CookiesConsent, Cover, type CoverProps, type CropHandler, CropShape, Cropper, type CropperProps, Crumb, type CrumbItem, type CrumbProps, DATATYPE, DIALOG, DIALOG_ACTION_POSITION, DRAWER_SIDE, DatePicker, Dialog, type DialogActionHandler, type DialogHandler, type DialogProps, Drawer, type DrawerHandler, type DrawerProps, FILTER, FORMVALIDATION, FORMVALIDATION_STYLE, Fab, type FabProps, type FilterProps, Filters, Form, type FormHandler, type FormInputs, type FormProps, Grid, type GridProps, Group, type GroupProps, Icon, type IconProps, Image, type ImageProps, Input, type InputProps, type KeyCombination, type KeyboardKey, type KeyboardKeyProps, KeyBoardKeys as KeyboardKeys, KeysLabelMap, KeysMap, Label, type LabelProps, LayersProvider, List, type ListItem, type ListItemObject, type ListProps, type MenuItemProps, type MorphOptions, type NetworkManagerprops, NetworkManager as NetworkStatus, ORIGIN, type Option, type OptionItemProps, OriginType, Overlay, type OverlayProps, PACKAGE_NAME, POSITION, PROGRESS, Pagination, type PaginationCallback, type PaginationPage, type PaginationPageItem, type PaginationProps, PaginationStyle, Password, type PasswordProps, PinInput, type PinInputProps, Position, ProgressBar, type ProgressBarProps, type ProgressHandler, type Props, RADIO, Radio, type RadioHandler, type RadioProps, type Row, type RowSelectCallback, SHEET, SHEET_ACTION_POSITION, SKELETON, SLIDER, SORT, SPINNER, ScrollView, type ScrollViewProps, Search, type SearchHandler, type SearchProps, type Segment, type SegmentController, type SegmentItemProps, type SegmentProps, Select, type SelectHandler, type SelectProps, Segmented as SelectTabs, Sheet, type SheetHandler, type SheetProps, type Skeleton, Slider, type SliderProps, Span, type SpanProps, Spinner, type SpinnerProps, Status, Switch, type CheckboxHandler as SwitchHandler, TRANSITIONS, TRANSITION_CURVES, type Tab, type TabBodyProps, type TabProps, TabView, type TabViewHandler, type TabViewProps, ForwardedTable as Table, type TableController, type TableOfContentItem, TableOfContents, type TableOfContentsProps, type TableProps, type TableSortCallback, Terminal, type TerminalCommandFn, type TerminalCommands, type TerminalHandler, type TerminalLine, type TerminalProps, Text, type TextAreaProps, TextWheel, type TextWheelHandler, type TextWheelProps, TextArea as Textarea, ThemeProvider, ToastDefaultTitle, type ToastProps, Toast as ToastProvider, ToastType, ToolTip, type ToolTipProps, type TreeItemHandler, type TreeItemProps, type TreeNode, type TreeNodeIcons, TreeView, type TreeViewHandler, type TreeViewProps, type Value, type ValueOf, Variant, type ZuzCommonValues, type ZuzProps, type ZuzStyleString, type animationProps, animationTransition, buildClassString, buildWithStyles, cleanProps, css, type cssShortKey, type cssShortKeys, type dynamic, getAnimationCurve, getAnimationTransition, getZuzMap, isKeyCombination, type parallaxEffectProps, setZuzMap, splitAtoms, useBase, useContextMenu, useDialog, useDrawer, useFx, useMorph, usePosition, useToast };
|
|
1898
|
+
export { ALERT, AVATAR, Accordion, type AccordionHandler, type AccordionProps, ActionBar, type ActionBarHandler, type ActionBarItem, type ActionBarProps, Alert, type AlertHandler, type AlertProps, AutoComplete, type AutoCompleteProps, Avatar, type AvatarHandler, type AvatarProps, Badge, type BadgeProps, Box, type BoxProps, Bubble, BubbleMediaType, type BubbleProps, BubbleStatus, Button, type ButtonHandler, type ButtonProps, ButtonState, CHART, CHECKBOX, COLORTHEME, Calendar, type CalendarProps, Chart, type ChartProps, CheckBox, type CheckBoxProps, type CheckboxHandler, CodeBlock, type CodeBlockProps, ColorScheme$1 as ColorScheme, type Column, type ContextItem, ContextMenu, type ContextMenuHandler, type ContextMenuProps, type CookieConsentProps, CookiesConsent, Cover, type CoverProps, type CropHandler, CropShape, Cropper, type CropperProps, Crumb, type CrumbItem, type CrumbProps, DATATYPE, DIALOG, DIALOG_ACTION_POSITION, DRAWER_SIDE, DatePicker, Dialog, type DialogActionHandler, type LayerHandler as DialogController, type DialogHandler, type DialogProps, Drawer, type LayerHandler as DrawerController, type DrawerHandler, type DrawerProps, FILTER, FORMVALIDATION, FORMVALIDATION_STYLE, Fab, type FabProps, type FilterProps, Filters, Form, type FormHandler, type FormInputs, type FormProps, Grid, type GridProps, Group, type GroupProps, Icon, type IconProps, Image, type ImageProps, Input, type InputProps, type KeyCombination, type KeyboardKey, type KeyboardKeyProps, KeyBoardKeys as KeyboardKeys, KeysLabelMap, KeysMap, Label, type LabelProps, type LayerHandler, LayersProvider, List, type ListItem, type ListItemObject, type ListProps, type MenuItemProps, type MorphOptions, type NetworkManagerprops, NetworkManager as NetworkStatus, ORIGIN, type Option, type OptionItemProps, OriginType, Overlay, type OverlayProps, PACKAGE_NAME, POSITION, PROGRESS, Pagination, type PaginationCallback, type PaginationPage, type PaginationPageItem, type PaginationProps, PaginationStyle, Password, type PasswordProps, PinInput, type PinInputProps, Position, ProgressBar, type ProgressBarProps, type ProgressHandler, type Props, RADIO, Radio, type RadioHandler, type RadioProps, type Row, type RowSelectCallback, SHEET, SHEET_ACTION_POSITION, SKELETON, SLIDER, SORT, SPINNER, ScrollView, type ScrollViewProps, Search, type SearchHandler, type SearchProps, type Segment, type SegmentController, type SegmentItemProps, type SegmentProps, Select, type SelectHandler, type SelectProps, Segmented as SelectTabs, Sheet, type SheetHandler, type SheetProps, type Skeleton, Slider, type SliderProps, Span, type SpanProps, Spinner, type SpinnerProps, Status, Switch, type CheckboxHandler as SwitchHandler, TRANSITIONS, TRANSITION_CURVES, type Tab, type TabBodyProps, type TabProps, TabView, type TabViewHandler, type TabViewProps, ForwardedTable as Table, type TableController, type TableOfContentItem, TableOfContents, type TableOfContentsProps, type TableProps, type TableSortCallback, Terminal, type TerminalCommandFn, type TerminalCommands, type TerminalHandler, type TerminalLine, type TerminalProps, Text, type TextAreaProps, TextWheel, type TextWheelHandler, type TextWheelProps, TextArea as Textarea, ThemeProvider, ToastDefaultTitle, type ToastProps, Toast as ToastProvider, ToastType, ToolTip, type ToolTipProps, type TreeItemHandler, type TreeItemProps, type TreeNode, type TreeNodeIcons, TreeView, type TreeViewHandler, type TreeViewProps, type Value, type ValueOf, Variant, type ZuzCommonValues, type ZuzProps, type ZuzStyleString, type animationProps, animationTransition, buildClassString, buildWithStyles, cleanProps, css, type cssShortKey, type cssShortKeys, type dynamic, getAnimationCurve, getAnimationTransition, getZuzMap, isKeyCombination, type parallaxEffectProps, setZuzMap, splitAtoms, useBase, useContextMenu, useDialog, useDrawer, useFx, useMorph, usePosition, useToast };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {f,e,g,d,h,c as c$1}from'./chunk-
|
|
1
|
+
import {f,e,g,d,h,c as c$1}from'./chunk-BLXOZG3O.js';export{e as PACKAGE_NAME,f as cleanProps,g as splitAtoms}from'./chunk-BLXOZG3O.js';import {createContext,forwardRef,useMemo,Fragment,useEffect,useRef,useState,useCallback,createElement,isValidElement,useId,useImperativeHandle,useLayoutEffect,useContext,startTransition}from'react';import {useDelayed,useScrollbar,useDebounce,useImage,useResizeObserver,useLineChart,useImageCropper,CropShape,useNetworkStatus,useCommandActions,useDimensions,AnchorType,useAnchorPosition,KeyCode,useShortcuts}from'@zuzjs/hooks';import {createPortal}from'react-dom';import {jsx,jsxs,Fragment as Fragment$1}from'react/jsx-runtime';import {MD5,uuid,withPost,_ as _$1,clamp,timeSince,toHash,numberInRange,checkPasswordStrength,PubSub}from'@zuzjs/core';import {addPropsToChildren}from'@zuzjs/core/react';import {startOfMonth,endOfMonth,startOfWeek,endOfWeek,eachDayOfInterval,format,isSameMonth,isSameDay,isToday,addHours,addDays,addWeeks}from'date-fns';var _o={Circle:"CIRCLE",Square:"SQUARE"},Lp={Default:"DEFAULT",Circle:"CIRCLE"},Mp={Light:"light",Dark:"dark",System:"system"},be={Default:"DEFAULT",Switch:"SWITCH"},Lt={Auto:"auto",Top:"top",Bottom:"bottom",Left:"left",Right:"right"},te=Lt,We=AnchorType,kp=We,U={XSmall:"xs",Small:"sm",Medium:"md",Large:"lg",XLarge:"xl"},Op={Asc:"ASC",Desc:"DESC"},Dp={String:"STRING",Number:"NUMBER",Boolean:"BOOLEAN",Array:"ARRAY",Object:"OBJECT",Date:"DATE",Time:"TIME",DateTime:"DATETIME",File:"FILE"},Hp={Dots:"DOTS"},we={IPV4:"IPV4",IPV6:"IPV6",Email:"EMAIL",Uri:"URI",Password:"PASSWORD",MatchField:"MATCHFIELD",Pattern:"*",GreaterThan:"GREATER_THAN"},me={Success:"success",Error:"error",Warning:"warning",Info:"info"},Z={Spring:"SPRING",Liquid:"LIQUID",EaseInOut:"EASEINOUT",EaseOutBack:"EASEOUTBACK",Bounce:"BOUNCE"},q={FadeIn:"FADE_IN",ScaleIn:"SCALE_IN",SlideInTop:"SLIDE_FROM_TOP",SlideInRight:"SLIDE_FROM_RIGHT",SlideInBottom:"SLIDE_FROM_BOTTOM",SlideInLeft:"SLIDE_FROM_LEFT"},Vp={Success:"success",Error:"error",Idle:"idle",Dead:"dead"},ce={Dialog:"DIALOG",Default:"DEFAULT",Error:"ERROR",Success:"SUCCESS",Warn:"WARN",Promise:"PROMISE"},Ve=ce,Mt={Left:"LEFT",Right:"RIGHT",Center:"CENTER"},Fo=Mt,Ap={Bar:"BAR",Ring:"RING"},ct={Default:"range",Text:"number"},kt={Default:"DEFAULT",Card:"CARD"},pt={Gooey:"gooey"},ae={Left:"LEFT",Right:"RIGHT",Top:"TOP",Bottom:"BOTTOM"};var Zo=Symbol.for("zuz.global.map"),Ko=o=>{globalThis[Zo]=o;},Hs=()=>globalThis[Zo]||{},Ot=o=>{let n=Array.isArray(o)?o.join(" "):o;if(!n||typeof n!="string")return "";let e$1=Hs();return process.env.NODE_ENV==="development"&&Object.keys(e$1).length===0&&console.warn(`[${e}] No utility map detected. Classes will not be hashed. `,"Ensure you call setZuzMap() or use <ThemeProvider zuzMap={...} />."),g(n).filter(Boolean).map(t=>{let s=t.match(/^([&@][\w-]+)\((.*)\)$/);if(s){let[u,l,m]=s;return g(m).map(i=>{let a=`${l}(${i})`;return e$1[a]||i}).join(" ")}return e$1[t]||t}).join(" ")},nu=o=>{let n=Array.isArray(o)?o.join(" "):o;return !n||typeof n!="string"?"":Ot(n)},Wo=o=>{let n={};for(let e in o){let r=o[e];if(e.startsWith("--")){n[e]=r;continue}let t=d[e]?.toString()??e;if(t==="x"||t==="translateX"){let s=n.translate?.split(" ")??["0px","0px"];n.translate=`${h.addUnitsSafely(e,r)} ${s[1]??"0px"}`;}else if(t==="y"||t==="translateY"){let s=n.translate?.split(" ")??["0px","0px"];n.translate=`${s[0]??"0px"} ${h.addUnitsSafely(e,r)}`;}else c$1.includes(t)?n[t]=h.addUnitsSafely(e,r):n[t]=r;}return n},Dt=o=>{if(!o)return "linear";switch(o.toUpperCase()){case Z.Bounce:return "var(--bounce)";case Z.Liquid:return "var(--liquid)";case Z.Spring:return "var(--spring)";case Z.EaseInOut:return "ease-in-out";case Z.EaseOutBack:return "ease-out-back";default:return "linear"}},Ue=(o,n=0)=>{let e={},r={},t=n||20;switch(o){case q.SlideInLeft:case q.SlideInRight:e={"--fx-x":o===q.SlideInLeft?`-${t}px`:`${t}px`,opacity:0},r={"--fx-x":"0px",opacity:1};break;case q.SlideInTop:case q.SlideInBottom:e={"--fx-y":o===q.SlideInTop?`-${t}px`:`${t}px`,opacity:0},r={"--fx-y":"0px",opacity:1};break;case q.ScaleIn:e={scale:0,opacity:0},r={scale:1,opacity:1};break;case q.FadeIn:e={opacity:0},r={opacity:1};break}return {from:e,to:r}},su=(o,n,e)=>{let{from:r,to:t}=Ue(o);return n?{...r,...t}:e?r:t};var As=(o,n)=>{let e=useRef([]),r=useRef(false);return useEffect(()=>{o?.when||(r.current=false);},[o?.transition]),useEffect(()=>{let t=n?.current;if(!t||!o||!o.clearAtEnd)return;let s=u=>{e.current.includes(u.propertyName)&&o.clearAtEnd===true&&(t.style.transform="",t.style.filter="",e.current.forEach(l=>t.style.removeProperty(l)));};return t.addEventListener("transitionend",s),()=>t.removeEventListener("transitionend",s)},[o,n]),useEffect(()=>{if(typeof window>"u"||!n?.current)return;let t=n.current;(o?.scroll||o?.mouse)&&(t.style.willChange="transform",t.style.translate="var(--fx-x, 0px) var(--fx-y, 0px)",t.style.transition=`translate 0.1s ${o.curve?Dt(o.curve):"var(--spring)"}`);},[o,n]),useMemo(()=>{if(!o)return {style:{}};let{transition:t,from:s,to:u,exit:l,when:m,duration:i=.3,delay:a=0,curve:f,watch:p=[]}=o,d=m===false&&!r.current;m===true&&(r.current=true);let w={},{from:v,to:x}=t?Ue(t):{from:s||{},to:u||{}};w=m===void 0?{...v,...x}:m?{...x}:l||v;let h=Dt(f),C=[],g=Wo(w);e.current=Object.keys(g);let S={...g};return Object.keys(g).forEach(N=>{let P=N.startsWith("--")?"all":N;C.includes(P)||C.push(`${P} ${i}s ${h} ${a}s`);}),p.forEach(N=>{C.includes(N)||C.push(`${N} 0.1s ${h} 0s`);}),{style:{...S,transition:d?"none":C.join(", "),opacity:d?0:S.opacity,pointerEvents:d?"none":S.pointerEvents}}},[o,o?.when,o?.watch])},ie=As;var $s=(o,n)=>{let{as:e,fx:r,transition:t,skeleton:s,className:u,propsToRemove:l,style:m,...i}=o||{},a=t?{transition:t,duration:.3}:r||{},{style:f$1}=ie(a,n),p=Ot(e??"");return {style:{...m,...f$1},className:[u||"",p||"",s?.enabled?"--skeleton":""].join(" ").trim(),rest:{...f(i,l?[...l,"skeleton"]:["skeleton"])}}},I=$s;var Zs=(o,n={})=>{let{offset:e=8,direction:r="bottom",container:t=null,triggerRef:s=null}=n,u=useRef(null),l=useCallback(()=>{let m=o.current;if(!m)return;let i=s?.current||m.parentElement;if(!i){console.warn("usePosition: No trigger element found. Positioning may not work.");return}let a=m.getBoundingClientRect(),f=i.getBoundingClientRect(),p,d;t?(p=t.getBoundingClientRect(),d="absolute"):(window.getComputedStyle(m).position==="fixed"?d="fixed":d="absolute",d==="fixed"?p={top:0,left:0,right:window.innerWidth,bottom:window.innerHeight,width:window.innerWidth,height:window.innerHeight}:p={top:0,left:0,right:window.innerWidth,bottom:window.innerHeight,width:window.innerWidth,height:window.innerHeight}),m.style.position!==d&&(m.style.position=d),u.current=d;let x=0,h=0;switch(r){case "top":x=f.top-a.height-e,h=f.left,x<p.top&&f.bottom+a.height+e<=p.bottom&&(x=f.bottom+e);break;case "bottom":x=f.bottom+e,h=f.left,x+a.height>p.bottom&&f.top-a.height-e>=p.top&&(x=f.top-a.height-e);break;case "left":x=f.top,h=f.left-a.width-e,h<p.left&&f.right+a.width+e<=p.right&&(h=f.right+e);break;case "right":x=f.top,h=f.right+e,h+a.width>p.right&&f.left-a.width-e>=p.left&&(h=f.left-a.width-e);break}if(x=Math.max(p.top,Math.min(x,p.bottom-a.height)),h=Math.max(p.left,Math.min(h,p.right-a.width)),u.current==="fixed")m.style.top=`${x}px`,m.style.left=`${h}px`;else {let C;m.offsetParent?C=m.offsetParent.getBoundingClientRect():C={top:0,left:0};let g=x-C.top+window.scrollY,S=h-C.left+window.scrollX;m.style.top=`${g}px`,m.style.left=`${S}px`;}},[o,s,e,r,t]);return useEffect(()=>{let m=o.current;if(!m)return;let i=s?.current||m.parentElement;if(!i){console.warn("usePosition: No trigger element found. Positioning may not work.");return}let a=new ResizeObserver(l);return a.observe(m),i&&a.observe(i),l(),window.addEventListener("resize",l),window.addEventListener("scroll",l,true),()=>{a.disconnect(),i&&a.disconnect(),window.removeEventListener("resize",l),window.removeEventListener("scroll",l,true);}},[o,r,e,t,s]),{postion:u.current,reposition:l}},Ge=Zs;var qo="(prefers-color-scheme: dark)",Us=typeof window>"u",Yo=createContext(void 0),$t=o=>{let n=useContext(Yo);if(!n){if(o===true)return;throw new Error("useColorScheme must be used within a ThemeProvider")}return n},Y=$t,Gs=({children:o,storageKey:n="--ucs",forceTheme:e,zuzMap:r,...t})=>(r&&Ko(r),jsx(qs,{storageKey:n,forceTheme:e,...t,children:o})),qs=({children:o,storageKey:n,forceTheme:e,...r})=>{let[t,s]=useState(()=>e||Xo(n,"system")),[u,l]=useState(()=>e||Xo(n)),m=p=>(p||(p=window.matchMedia(qo)),p.matches?"dark":"light"),i=useCallback(p=>{let d=p=="system"?m():p,w=document.documentElement;w.setAttribute("color-scheme",d),w.style.colorScheme=d,l(d);},[m]),a=useCallback(p=>{s(p),localStorage.setItem(n,p),i(p);},[t]),f=useCallback(p=>{let d=m(p);l(d),t==="system"&&i("system");},[t]);return useEffect(()=>{t==null&&window.localStorage.getItem(n);},[t]),useEffect(()=>{window.matchMedia(qo).addEventListener("change",f);},[f]),useEffect(()=>{let p=d=>{d.key==n&&(d.newValue?a(d.newValue):a("system"));};return window.addEventListener("storage",p),()=>window.removeEventListener("storage",p)},[a]),useEffect(()=>{i(e||t||"system");},[t]),jsxs(Yo,{value:{colorScheme:t,resolvedScheme:u,setColorScheme:a,...r},children:[e?null:jsx("script",{suppressHydrationWarning:true,dangerouslySetInnerHTML:{__html:`const el = document.documentElement
|
|
2
2
|
const themes = ['light', 'dark']
|
|
3
3
|
let theme = localStorage.getItem(\`${n}\`) || "system";
|
|
4
4
|
if (theme === "system") {
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|