@vercel/geistdocs 2.7.9 → 2.7.10
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/cli/index.js +1 -1
- package/dist/components/dialog.d.ts +2 -0
- package/dist/components/dialog.d.ts.map +1 -0
- package/dist/components/dialog.js +3 -0
- package/dist/internal/chat/message.d.ts.map +1 -1
- package/dist/internal/chat/message.js +2 -5
- package/dist/providers/public/components/dialog.d.ts +27 -0
- package/dist/providers/public/components/dialog.d.ts.map +1 -0
- package/dist/providers/public/components/dialog.js +17 -0
- package/docs/agents.md +2 -1
- package/docs/llms.txt +81 -1
- package/docs/manifest.json +10 -1
- package/docs/pages/components/dialog.md +74 -0
- package/docs/pages/components/index.md +1 -0
- package/docs/sitemap.md +1 -0
- package/package.json +5 -1
- package/public-foundation.css +12 -0
- package/template/components/geistdocs/dialog-demo.tsx +44 -0
- package/template/content/docs/components/dialog.mdx +70 -0
- package/template/content/docs/components/index.mdx +1 -0
- package/template/content/docs/components/meta.json +1 -0
- package/template/package.json +1 -1
- package/dist/providers/public/components/modal.d.ts +0 -22
- package/dist/providers/public/components/modal.d.ts.map +0 -1
- package/dist/providers/public/components/modal.js +0 -19
package/dist/cli/index.js
CHANGED
|
@@ -4,4 +4,4 @@ import{Option as Rn,program as A}from"commander";import{access as Ke,copyFile as
|
|
|
4
4
|
`);throw new AggregateError(i,`Mixedbread search sync did not complete:
|
|
5
5
|
${a}`)}return r},Ft=async({client:e,file:t,pollIntervalMs:n,pollTimeoutMs:r,sleep:i})=>{let s=t,o=Date.now()+r;for(;s.status==="pending"||s.status==="in_progress";){if(Date.now()>=o)throw new Error(`Mixedbread timed out while indexing file ${t.id}.`);await i(n),s=await e.retrieveStoreFile(t.id)}if(s.status!=="completed")throw new Error(`Mixedbread failed to index file ${t.id} (${s.status}).`);return s},Dt=async({client:e,desired:t,pollIntervalMs:n,pollTimeoutMs:r,sleep:i})=>{let s=await e.uploadFile({content:t.document.content,filename:`${U(t.document.id).slice(0,32)}.md`}),o;try{o=await e.createStoreFile({externalId:t.externalId,fileId:s,metadata:{...t.metadata,[g.rawFileId]:s}})}catch(a){try{await e.deleteFile(s)}catch(d){throw new AggregateError([a,d],`Mixedbread failed to attach and clean up raw file ${s}.`)}throw a}return Ft({client:e,file:o,pollIntervalMs:n,pollTimeoutMs:r,sleep:i})},Ie=async({client:e,concurrency:t=St,manifest:n,pollIntervalMs:r=_t,pollTimeoutMs:i=Tt,revision:s,revisionAncestors:o=[],revisionTimestamp:a,sleep:d=Rt})=>{let c=_e(n);if(c.provider!=="mixedbread")return{deleted:0,skipped:c.documents.length,uploaded:0};let u=c.siteId?.trim();if(!u)throw new Error("Mixedbread retrieval requires a non-empty siteId in geistdocs.tsx.");if(c.documents.length===0)throw new Error("The Geistdocs search export is empty. Refusing to remove indexed documents.");let l=c.documents.map(p=>At(p,u,s,o,a)),m=new Map(l.map(p=>[p.document.id,p])),h=(await be(e)).flatMap(p=>{let y=q(p.metadata);return y?.siteId===u?[{file:p,metadata:y}]:[]}),x=new Map,P=new Set;for(let p of h){W(p.metadata,s,a)&&P.add(p.metadata.documentId);let y=m.get(p.metadata.documentId);y&&p.metadata.contentHash===y.hash&&p.file.status==="completed"&&!x.has(p.metadata.documentId)&&x.set(p.metadata.documentId,p)}let _=l.filter(p=>!(x.has(p.document.id)||P.has(p.document.id)));await Ee(_,t,p=>Dt({client:e,desired:p,pollIntervalMs:r,pollTimeoutMs:i,sleep:d}));let b=(await be(e)).flatMap(p=>{let y=q(p.metadata);return y?.siteId===u?[{file:p,metadata:y}]:[]}),D=new Set(b.filter(({metadata:p})=>W(p,s,a)).map(({metadata:p})=>p.documentId)),ie=new Set;for(let p of l){if(D.has(p.document.id))continue;let ae=b.filter(({file:V,metadata:k})=>V.status==="completed"&&k.documentId===p.document.id&&k.contentHash===p.hash).sort((V,k)=>V.file.id.localeCompare(k.file.id))[0];ae&&ie.add(ae.file.id)}let oe=b.filter(({file:p,metadata:y})=>p.status!=="pending"&&p.status!=="in_progress"&&!W(y,s,a)&&Mt({currentRevision:s,currentRevisionAncestors:o,currentRevisionTimestamp:a,desired:m.get(y.documentId),metadata:y})&&!ie.has(p.id));return await Ee(oe,t,async({file:p,metadata:y})=>{await e.deleteFile(y.rawFileId??p.id),await e.deleteStoreFile(p.id)}),{deleted:oe.length,skipped:l.length-_.length,uploaded:_.length}};var Ot=50,$t=e=>`vercel integration add mixedbread --name docs-${e||"your-site-id"} --environment production`,ve=(e,t)=>kt("git",t,{cwd:e,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim(),Nt=e=>{let t=process.env.VERCEL_GIT_COMMIT_SHA?.trim(),n=[];try{n=ve(e,["rev-list",`--max-count=${Ot+1}`,t||"HEAD"]).split(`
|
|
6
6
|
`).filter(Boolean)}catch{n=[]}let r=t||n[0],i;for(let s of Array.from(new Set([r,"HEAD"].filter(Boolean))))try{let o=Number(ve(e,["show","-s","--format=%ct",s]));if(Number.isFinite(o)){i=o;break}}catch{}return{revision:r,revisionAncestors:n.filter(s=>s!==r),revisionTimestamp:i}},Pe=async({allowNonProduction:e=!1,dir:t=".next"}={})=>{let n=process.cwd();Ct.loadEnvConfig(n,!1);let r=process.env.MXBAI_API_KEY?.trim(),i=process.env.MXBAI_STORE_ID?.trim();if(process.env.VERCEL_ENV!=="production"&&!e){console.log("Geistdocs search sync skipped: this is not a production Vercel build.");return}if(!!r!=!!i)throw new Error("Mixedbread is partially configured. Set both MXBAI_API_KEY and MXBAI_STORE_ID.");let s;try{s=await Te({cwd:n,outputDirectory:t})}catch(a){if(!(r||i)){console.log("Geistdocs search sync skipped: no Mixedbread credentials or static search export were found.");return}throw a}if(s.provider!=="mixedbread"){console.log("Geistdocs search sync skipped: Ask AI uses local retrieval.");return}if(!(r&&i))throw new Error(["Mixedbread retrieval is enabled, but MXBAI_API_KEY or MXBAI_STORE_ID is missing.","From the root of this site's repository, linked to the correct Vercel project, run:",$t(s.siteId)].join(`
|
|
7
|
-
`));let o=await Ie({client:we({apiBaseUrl:process.env.MXBAI_BASE_URL,apiKey:r,storeId:i}),manifest:s,...Nt(n)});console.log(`Geistdocs search sync complete: ${o.uploaded} uploaded, ${o.deleted} deleted, ${o.skipped} unchanged.`)};import{readFileSync as Gt,writeFileSync as Ut}from"fs";import{mkdir as Lt,readFile as Z,writeFile as jt}from"fs/promises";import{dirname as Bt,extname as Vt,relative as Fe,resolve as j}from"path";import{intro as Jt,isCancel as Ht,log as I,multiselect as Xt,outro as L,spinner as Kt}from"@clack/prompts";import{glob as Yt}from"glob";import{Node as F,Project as qt,SyntaxKind as zt}from"ts-morph";var Wt="geistdocs.tsx",Qt="content/docs/**/*.mdx",ee=".translation-cache.json",Q=8,Ae=()=>({version:1,entries:{}}),Zt=async e=>{let t=await Z(e),{createHash:n}=await import("crypto");return n("sha256").update(t).digest("hex")},en=e=>{let t=j(process.cwd(),e);return Gt(t,"utf8")},Me=e=>F.isObjectLiteralExpression(e)?e.getProperties().flatMap(t=>{if(F.isPropertyAssignment(t)){let n=t.getNameNode();if(F.isIdentifier(n)||F.isStringLiteral(n))return[n.getText().replaceAll(/['"]/g,"")]}return[]}).filter(Boolean):[],tn=e=>{try{let t=new qt({compilerOptions:{allowJs:!0,jsx:4,module:99,target:10},skipAddingFilesFromTsConfig:!0,useInMemoryFileSystem:!0}),n=en(e),s=t.createSourceFile(e,n,{overwrite:!0}).getVariableDeclarations().find(a=>a.getName()==="translations")?.getInitializer();if(!s)return[];if(F.isObjectLiteralExpression(s))return Me(s);let o=s.getFirstDescendantByKind(zt.ObjectLiteralExpression);return o?Me(o):[]}catch(t){let n=t instanceof Error?t.message:`${t}`;return I.warn(`Failed to read locales from ${e}: ${n}`),[]}},nn=async()=>{let e=await Xt({message:"Which locales should be translated?",options:[{value:"cn",label:"Chinese (cn)"},{value:"jp",label:"Japanese (jp)"},{value:"es",label:"Spanish (es)"},{value:"fr",label:"French (fr)"},{value:"de",label:"German (de)"}],required:!0});return Ht(e)&&(L("Translation cancelled"),process.exit(0)),e},rn=async e=>(await Yt(e,{cwd:process.cwd(),absolute:!0,nodir:!0})).sort(),sn=async()=>{let e=j(process.cwd(),ee);try{let t=await Z(e,"utf8"),n=JSON.parse(t);return n.version!==1||!n.entries?Ae():{version:1,entries:n.entries}}catch{return Ae()}},Re=e=>{let t=j(process.cwd(),ee),n=JSON.stringify(e,null,2);Ut(t,n,"utf8")},on=async e=>{let t=await Promise.all(e.map(async n=>[n,await Zt(n)]));return Object.fromEntries(t)},an=(e,t)=>{let n=Vt(e);return`${e.slice(0,-n.length)}.${t}${n}`},De=(e,t)=>`${Fe(process.cwd(),e)}::${t}`,cn=(e,t,n,r,i=!1)=>{let s=[],o=0;for(let a of t){let d=n[a];for(let c of e){let u=an(a,c),l=De(a,c),m=r.entries[l];if(!i&&m?.hash===d){o+=1;continue}s.push({locale:c,sourceFile:a,sourceHash:d,targetFile:u})}}return{tasks:s,skippedCount:o}},dn=async e=>{await Lt(Bt(e),{recursive:!0})},ln=async(e,t,n)=>{let r=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:t,locale:n})});if(!r.ok){let s=await r.text();throw new Error(`API request failed (${r.status}): ${s}`)}let i=await r.json();if(!i.translation)throw new Error("API response did not include a translation");return i.translation},pn=async(e,t,n)=>{let r=await Z(e.sourceFile,"utf8"),i=await ln(t,r,e.locale);await dn(e.targetFile),await jt(e.targetFile,i,"utf8"),n.entries[De(e.sourceFile,e.locale)]={hash:e.sourceHash,updatedAt:new Date().toISOString()}},ke=async(e,t)=>{Jt("Translate MDX content");let n=e??Qt,r=t.url||process.env.GEISTDOCS_TRANSLATE_URL||"https://geistdocs.com/translate",i=tn(t.config??Wt),s=await rn(n);s.length===0&&(I.error(`No MDX files found matching pattern: ${n}`),L("Translation cancelled"),process.exit(1)),I.info(`Found ${s.length} MDX file(s) matching pattern`),i.length===0&&(i=await nn());let o=j(process.cwd(),ee),a=await sn();await Re(a),I.info(`Using cache: ${o}`);let d=await on(s),{tasks:c,skippedCount:u}=cn(i,s,d,a,t.force);if(c.length===0){I.success("All translations are up to date!"),L(`Skipped ${u} file(s) (unchanged)`);return}let l=[];for(let h=0;h<c.length;h+=Q)l.push(c.slice(h,h+Q));I.info(`Processing ${c.length} translation(s) in ${l.length} batch(es) of up to ${Q}`),u>0&&I.info(`Skipped ${u} translation(s) (unchanged)`);let m=Kt();m.start("Translating content...");let f=0;for(let h of l)await Promise.all(h.map(async x=>{await pn(x,r,a),f+=1,m.message(`Translated ${f}/${c.length}: ${Fe(process.cwd(),x.targetFile)}`)})),await Re(a);m.stop("Translation complete!"),L(`Created/updated ${c.length} file(s)`)};import{access as un,copyFile as gn,mkdir as Ne,rm as re}from"fs/promises";import{dirname as mn,join as v}from"path";import{intro as fn,log as w,outro as B,spinner as Ge}from"@clack/prompts";import{glob as hn}from"glob";var wn=["**/*"],yn=["content/docs/**"],te=".geistdocs-tmp",xn=async(e,t)=>{let n=v(e,t);await re(n,{recursive:!0,force:!0}),await Ne(n,{recursive:!0})},ne=async e=>await re(e,{recursive:!0,force:!0}),Ce=async(e,t,n)=>(await hn(e,{cwd:n,nodir:!0,dot:!0,ignore:[".git/**",...t]})).sort(),bn=async e=>{try{return await un(e),!0}catch{return!1}},En=async(e,t,n)=>{let r=v(t,e),i=v(n,e);return await bn(r)?(await gn(r,i),{success:!0}):{success:!1,error:`Source file not found: ${r}`}},Sn=async(e,t)=>{let n=v(t,e);return await re(n,{force:!0}),{success:!0}},Oe=20,$e=async(e,t,n)=>{let r=[];for(let i=0;i<e.length;i+=n){let s=e.slice(i,i+n),o=await Promise.all(s.map(t));r.push(...o)}return r},_n=async(e,t,n,r,i)=>{let s={success:[],deleted:[],failed:[]},o=[...new Set(e.map(d=>mn(v(r,d))))];i.message(`Creating ${o.length} directories...`),await Promise.all(o.map(d=>Ne(d,{recursive:!0}))),i.message(`Updating ${e.length} files...`);let a=await $e(e,async d=>{let c=await En(d,n,r);return{file:d,...c}},Oe);for(let{file:d,success:c,error:u}of a)c?s.success.push(d):s.failed.push({file:d,error:u??"Unknown error"});if(t.length>0){i.message(`Deleting ${t.length} files...`);let d=await $e(t,async c=>{try{return await Sn(c,r),{file:c,success:!0}}catch(u){let l=u instanceof Error?u.message:`${u}`;return{file:c,success:!1,error:l}}},Oe);for(let c of d)c.success?s.deleted.push(c.file):s.failed.push({file:c.file,error:c.error})}return s},Tn=e=>{if(e.success.length>0){w.success(`Successfully updated ${e.success.length} files:`);for(let t of e.success)w.info(` \u2713 ${t}`)}if(e.deleted.length>0){w.success(`Deleted ${e.deleted.length} files:`);for(let t of e.deleted)w.info(` \u{1F5D1} ${t}`)}if(e.failed.length>0){w.warn(`Failed to update ${e.failed.length} files:`);for(let{file:t,error:n}of e.failed)w.error(` \u2717 ${t}: ${n}`)}},In=e=>e.includes("canary")?"canary":"latest",vn=async e=>{let t=await fetch(`https://registry.npmjs.org/${encodeURIComponent(S)}`);if(!t.ok)throw new Error(`Failed to resolve ${S}@${e}`);let r=(await t.json())["dist-tags"]?.[e];if(!r)throw new Error(`Could not find dist-tag ${e} for ${S}`);return r},Pn=async e=>{let t=await M(e),n=J(t,S);if(!n)return{currentVersion:n,nextVersion:void 0,updated:!1};let r=In(n),i=await vn(r);return n===i?{currentVersion:n,nextVersion:i,updateTag:r,updated:!1}:($(t,S,i),await O(e,t),{currentVersion:n,nextVersion:i,updateTag:r,updated:!0})},An=async(e,t,n)=>{let r=await M(e);if(!le(r,S))return!1;t&&t.length>0&&w.warn("Ignoring file patterns for a package-based site. This update will bump the package version instead."),n?.sync&&w.warn("Ignoring --sync for a package-based site. Runtime updates now come from the package version.");let{currentVersion:i,nextVersion:s,updateTag:o,updated:a}=await Pn(e);if(!a)return w.success(i?`@vercel/geistdocs is already at ${s} (${o}).`:"No package version update was needed."),B("Package-based site is already up to date."),!0;w.info(`Bumping ${S} from ${i} to ${s} (${o})`);let d=Ge();return d.start("Installing updated package version..."),await T("pnpm",["install"],{cwd:e}),d.stop("Package update complete!"),B("Please review and test the upgraded package version."),!0},Mn=async(e,t,n,r,i)=>{let s=v(e,te),o=Ge(),a=i?.sync?s:t;o.start("Preparing template snapshot..."),i?.sync&&(await xn(e,te),await N(s)),o.message("Scanning for files...");let d=await Ce(n,r,a),c=[];if(i?.sync){o.message("Comparing with local files...");let l=await Ce(n,r,e),m=new Set(d);c=l.filter(f=>!m.has(f))}if(o.stop(`Found ${d.length} files to update`),d.length===0&&c.length===0){w.warn("No files matched the patterns. Nothing to update."),i?.sync&&await ne(s),B("Update cancelled.");return}w.info(`Patterns: ${n.length}`),w.info(`Files to update: ${d.length}`),i?.sync&&w.info(`Files to delete: ${c.length}`),o.start("Updating files...");let u=await _n(d,c,a,e,o);i?.sync&&(o.message("Cleaning up..."),await ne(s)),o.stop("Update complete!"),Tn(u),B("Please review and test the changes carefully.")},Ue=async(e,t)=>{let n=process.cwd(),r=H(),i=e&&e.length>0?e:wn,s=e&&e.length>0?[]:yn;try{if(fn("Let's update your Geistdocs project!"),await An(n,e,t))return;w.info("Template source: bundled package snapshot"),e&&e.length>0&&w.info(`Updating specific files: ${e.join(", ")}`),t?.sync&&w.info("Sync mode enabled: will delete files removed from template"),await Mn(n,r,i,s,t)}catch(o){let a=o instanceof Error?o.message:`${o}`;try{await ne(v(n,te))}catch{}w.error(`Failed to update project: ${a}`),process.exit(1)}};A.name("geistdocs").description("CLI for Geistdocs projects").version("2.7.9","-v, --version","Output the current version");A.command("init").description("Initialize a new Geistdocs project").option("--name <name>","Name of the project").addOption(new Rn("--brand <brand>","Navbar brand").choices(["vercel","labs"]).default("vercel")).option("--disable-git","Disable git initialization").action(he);A.command("update [files...]").description("Update a Geistdocs project (optionally specify files/patterns to update)").option("--sync","Delete local files that no longer exist in the template").action(Ue);A.command("translate [pattern]").description("Translate MDX file(s) to one or more locales (default: content/docs/**/*.mdx)").option("--config <path>","Path to config file to load locales from (defaults to geistdocs.tsx)").option("--url <url>","Custom translation API URL (defaults to GEISTDOCS_TRANSLATE_URL or https://geistdocs.com/translate)").option("--force","Force re-translation of all files, ignoring cache").action(ke);var Fn=A.command("search").description("Manage the external search index used by Ask AI");Fn.command("sync").description("Sync the latest static docs export to Mixedbread").option("--dir <path>","Next.js output directory",".next").option("--allow-non-production","Run outside a production Vercel build").action(Pe);await A.parseAsync(process.argv).catch(e=>{console.error(e instanceof Error?e.message:e),process.exitCode=1});
|
|
7
|
+
`));let o=await Ie({client:we({apiBaseUrl:process.env.MXBAI_BASE_URL,apiKey:r,storeId:i}),manifest:s,...Nt(n)});console.log(`Geistdocs search sync complete: ${o.uploaded} uploaded, ${o.deleted} deleted, ${o.skipped} unchanged.`)};import{readFileSync as Gt,writeFileSync as Ut}from"fs";import{mkdir as Lt,readFile as Z,writeFile as jt}from"fs/promises";import{dirname as Bt,extname as Vt,relative as Fe,resolve as j}from"path";import{intro as Jt,isCancel as Ht,log as I,multiselect as Xt,outro as L,spinner as Kt}from"@clack/prompts";import{glob as Yt}from"glob";import{Node as F,Project as qt,SyntaxKind as zt}from"ts-morph";var Wt="geistdocs.tsx",Qt="content/docs/**/*.mdx",ee=".translation-cache.json",Q=8,Ae=()=>({version:1,entries:{}}),Zt=async e=>{let t=await Z(e),{createHash:n}=await import("crypto");return n("sha256").update(t).digest("hex")},en=e=>{let t=j(process.cwd(),e);return Gt(t,"utf8")},Me=e=>F.isObjectLiteralExpression(e)?e.getProperties().flatMap(t=>{if(F.isPropertyAssignment(t)){let n=t.getNameNode();if(F.isIdentifier(n)||F.isStringLiteral(n))return[n.getText().replaceAll(/['"]/g,"")]}return[]}).filter(Boolean):[],tn=e=>{try{let t=new qt({compilerOptions:{allowJs:!0,jsx:4,module:99,target:10},skipAddingFilesFromTsConfig:!0,useInMemoryFileSystem:!0}),n=en(e),s=t.createSourceFile(e,n,{overwrite:!0}).getVariableDeclarations().find(a=>a.getName()==="translations")?.getInitializer();if(!s)return[];if(F.isObjectLiteralExpression(s))return Me(s);let o=s.getFirstDescendantByKind(zt.ObjectLiteralExpression);return o?Me(o):[]}catch(t){let n=t instanceof Error?t.message:`${t}`;return I.warn(`Failed to read locales from ${e}: ${n}`),[]}},nn=async()=>{let e=await Xt({message:"Which locales should be translated?",options:[{value:"cn",label:"Chinese (cn)"},{value:"jp",label:"Japanese (jp)"},{value:"es",label:"Spanish (es)"},{value:"fr",label:"French (fr)"},{value:"de",label:"German (de)"}],required:!0});return Ht(e)&&(L("Translation cancelled"),process.exit(0)),e},rn=async e=>(await Yt(e,{cwd:process.cwd(),absolute:!0,nodir:!0})).sort(),sn=async()=>{let e=j(process.cwd(),ee);try{let t=await Z(e,"utf8"),n=JSON.parse(t);return n.version!==1||!n.entries?Ae():{version:1,entries:n.entries}}catch{return Ae()}},Re=e=>{let t=j(process.cwd(),ee),n=JSON.stringify(e,null,2);Ut(t,n,"utf8")},on=async e=>{let t=await Promise.all(e.map(async n=>[n,await Zt(n)]));return Object.fromEntries(t)},an=(e,t)=>{let n=Vt(e);return`${e.slice(0,-n.length)}.${t}${n}`},De=(e,t)=>`${Fe(process.cwd(),e)}::${t}`,cn=(e,t,n,r,i=!1)=>{let s=[],o=0;for(let a of t){let d=n[a];for(let c of e){let u=an(a,c),l=De(a,c),m=r.entries[l];if(!i&&m?.hash===d){o+=1;continue}s.push({locale:c,sourceFile:a,sourceHash:d,targetFile:u})}}return{tasks:s,skippedCount:o}},dn=async e=>{await Lt(Bt(e),{recursive:!0})},ln=async(e,t,n)=>{let r=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:t,locale:n})});if(!r.ok){let s=await r.text();throw new Error(`API request failed (${r.status}): ${s}`)}let i=await r.json();if(!i.translation)throw new Error("API response did not include a translation");return i.translation},pn=async(e,t,n)=>{let r=await Z(e.sourceFile,"utf8"),i=await ln(t,r,e.locale);await dn(e.targetFile),await jt(e.targetFile,i,"utf8"),n.entries[De(e.sourceFile,e.locale)]={hash:e.sourceHash,updatedAt:new Date().toISOString()}},ke=async(e,t)=>{Jt("Translate MDX content");let n=e??Qt,r=t.url||process.env.GEISTDOCS_TRANSLATE_URL||"https://geistdocs.com/translate",i=tn(t.config??Wt),s=await rn(n);s.length===0&&(I.error(`No MDX files found matching pattern: ${n}`),L("Translation cancelled"),process.exit(1)),I.info(`Found ${s.length} MDX file(s) matching pattern`),i.length===0&&(i=await nn());let o=j(process.cwd(),ee),a=await sn();await Re(a),I.info(`Using cache: ${o}`);let d=await on(s),{tasks:c,skippedCount:u}=cn(i,s,d,a,t.force);if(c.length===0){I.success("All translations are up to date!"),L(`Skipped ${u} file(s) (unchanged)`);return}let l=[];for(let h=0;h<c.length;h+=Q)l.push(c.slice(h,h+Q));I.info(`Processing ${c.length} translation(s) in ${l.length} batch(es) of up to ${Q}`),u>0&&I.info(`Skipped ${u} translation(s) (unchanged)`);let m=Kt();m.start("Translating content...");let f=0;for(let h of l)await Promise.all(h.map(async x=>{await pn(x,r,a),f+=1,m.message(`Translated ${f}/${c.length}: ${Fe(process.cwd(),x.targetFile)}`)})),await Re(a);m.stop("Translation complete!"),L(`Created/updated ${c.length} file(s)`)};import{access as un,copyFile as gn,mkdir as Ne,rm as re}from"fs/promises";import{dirname as mn,join as v}from"path";import{intro as fn,log as w,outro as B,spinner as Ge}from"@clack/prompts";import{glob as hn}from"glob";var wn=["**/*"],yn=["content/docs/**"],te=".geistdocs-tmp",xn=async(e,t)=>{let n=v(e,t);await re(n,{recursive:!0,force:!0}),await Ne(n,{recursive:!0})},ne=async e=>await re(e,{recursive:!0,force:!0}),Ce=async(e,t,n)=>(await hn(e,{cwd:n,nodir:!0,dot:!0,ignore:[".git/**",...t]})).sort(),bn=async e=>{try{return await un(e),!0}catch{return!1}},En=async(e,t,n)=>{let r=v(t,e),i=v(n,e);return await bn(r)?(await gn(r,i),{success:!0}):{success:!1,error:`Source file not found: ${r}`}},Sn=async(e,t)=>{let n=v(t,e);return await re(n,{force:!0}),{success:!0}},Oe=20,$e=async(e,t,n)=>{let r=[];for(let i=0;i<e.length;i+=n){let s=e.slice(i,i+n),o=await Promise.all(s.map(t));r.push(...o)}return r},_n=async(e,t,n,r,i)=>{let s={success:[],deleted:[],failed:[]},o=[...new Set(e.map(d=>mn(v(r,d))))];i.message(`Creating ${o.length} directories...`),await Promise.all(o.map(d=>Ne(d,{recursive:!0}))),i.message(`Updating ${e.length} files...`);let a=await $e(e,async d=>{let c=await En(d,n,r);return{file:d,...c}},Oe);for(let{file:d,success:c,error:u}of a)c?s.success.push(d):s.failed.push({file:d,error:u??"Unknown error"});if(t.length>0){i.message(`Deleting ${t.length} files...`);let d=await $e(t,async c=>{try{return await Sn(c,r),{file:c,success:!0}}catch(u){let l=u instanceof Error?u.message:`${u}`;return{file:c,success:!1,error:l}}},Oe);for(let c of d)c.success?s.deleted.push(c.file):s.failed.push({file:c.file,error:c.error})}return s},Tn=e=>{if(e.success.length>0){w.success(`Successfully updated ${e.success.length} files:`);for(let t of e.success)w.info(` \u2713 ${t}`)}if(e.deleted.length>0){w.success(`Deleted ${e.deleted.length} files:`);for(let t of e.deleted)w.info(` \u{1F5D1} ${t}`)}if(e.failed.length>0){w.warn(`Failed to update ${e.failed.length} files:`);for(let{file:t,error:n}of e.failed)w.error(` \u2717 ${t}: ${n}`)}},In=e=>e.includes("canary")?"canary":"latest",vn=async e=>{let t=await fetch(`https://registry.npmjs.org/${encodeURIComponent(S)}`);if(!t.ok)throw new Error(`Failed to resolve ${S}@${e}`);let r=(await t.json())["dist-tags"]?.[e];if(!r)throw new Error(`Could not find dist-tag ${e} for ${S}`);return r},Pn=async e=>{let t=await M(e),n=J(t,S);if(!n)return{currentVersion:n,nextVersion:void 0,updated:!1};let r=In(n),i=await vn(r);return n===i?{currentVersion:n,nextVersion:i,updateTag:r,updated:!1}:($(t,S,i),await O(e,t),{currentVersion:n,nextVersion:i,updateTag:r,updated:!0})},An=async(e,t,n)=>{let r=await M(e);if(!le(r,S))return!1;t&&t.length>0&&w.warn("Ignoring file patterns for a package-based site. This update will bump the package version instead."),n?.sync&&w.warn("Ignoring --sync for a package-based site. Runtime updates now come from the package version.");let{currentVersion:i,nextVersion:s,updateTag:o,updated:a}=await Pn(e);if(!a)return w.success(i?`@vercel/geistdocs is already at ${s} (${o}).`:"No package version update was needed."),B("Package-based site is already up to date."),!0;w.info(`Bumping ${S} from ${i} to ${s} (${o})`);let d=Ge();return d.start("Installing updated package version..."),await T("pnpm",["install"],{cwd:e}),d.stop("Package update complete!"),B("Please review and test the upgraded package version."),!0},Mn=async(e,t,n,r,i)=>{let s=v(e,te),o=Ge(),a=i?.sync?s:t;o.start("Preparing template snapshot..."),i?.sync&&(await xn(e,te),await N(s)),o.message("Scanning for files...");let d=await Ce(n,r,a),c=[];if(i?.sync){o.message("Comparing with local files...");let l=await Ce(n,r,e),m=new Set(d);c=l.filter(f=>!m.has(f))}if(o.stop(`Found ${d.length} files to update`),d.length===0&&c.length===0){w.warn("No files matched the patterns. Nothing to update."),i?.sync&&await ne(s),B("Update cancelled.");return}w.info(`Patterns: ${n.length}`),w.info(`Files to update: ${d.length}`),i?.sync&&w.info(`Files to delete: ${c.length}`),o.start("Updating files...");let u=await _n(d,c,a,e,o);i?.sync&&(o.message("Cleaning up..."),await ne(s)),o.stop("Update complete!"),Tn(u),B("Please review and test the changes carefully.")},Ue=async(e,t)=>{let n=process.cwd(),r=H(),i=e&&e.length>0?e:wn,s=e&&e.length>0?[]:yn;try{if(fn("Let's update your Geistdocs project!"),await An(n,e,t))return;w.info("Template source: bundled package snapshot"),e&&e.length>0&&w.info(`Updating specific files: ${e.join(", ")}`),t?.sync&&w.info("Sync mode enabled: will delete files removed from template"),await Mn(n,r,i,s,t)}catch(o){let a=o instanceof Error?o.message:`${o}`;try{await ne(v(n,te))}catch{}w.error(`Failed to update project: ${a}`),process.exit(1)}};A.name("geistdocs").description("CLI for Geistdocs projects").version("2.7.10","-v, --version","Output the current version");A.command("init").description("Initialize a new Geistdocs project").option("--name <name>","Name of the project").addOption(new Rn("--brand <brand>","Navbar brand").choices(["vercel","labs"]).default("vercel")).option("--disable-git","Disable git initialization").action(he);A.command("update [files...]").description("Update a Geistdocs project (optionally specify files/patterns to update)").option("--sync","Delete local files that no longer exist in the template").action(Ue);A.command("translate [pattern]").description("Translate MDX file(s) to one or more locales (default: content/docs/**/*.mdx)").option("--config <path>","Path to config file to load locales from (defaults to geistdocs.tsx)").option("--url <url>","Custom translation API URL (defaults to GEISTDOCS_TRANSLATE_URL or https://geistdocs.com/translate)").option("--force","Force re-translation of all files, ignoring cache").action(ke);var Fn=A.command("search").description("Manage the external search index used by Ask AI");Fn.command("sync").description("Sync the latest static docs export to Mixedbread").option("--dir <path>","Next.js output directory",".next").option("--allow-non-production","Run outside a production Vercel build").action(Pe);await A.parseAsync(process.argv).catch(e=>{console.error(e instanceof Error?e.message:e),process.exitCode=1});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../src/components/dialog.tsx"],"names":[],"mappings":"AAGA,cAAc,iCAAiC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../src/internal/chat/message.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5D,OAAO,EAEL,UAAU,EAEX,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../src/internal/chat/message.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5D,OAAO,EAEL,UAAU,EAEX,MAAM,YAAY,CAAC;AAmMpB,MAAM,MAAM,YAAY,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IAC1D,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,WAAW,GAAG,MAAM,CAAC;CAChD,CAAC;AAEF,eAAO,MAAM,OAAO,GAAI,+BAA+B,YAAY,4CASlE,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAEjE,eAAO,MAAM,cAAc,GAAI,mCAI5B,mBAAmB,4CAqBrB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,cAAc,CAAC,OAAO,UAAU,CAAC,CAAC;AAErE,eAAO,MAAM,eAAe,gEACA,oBAAoB,6CAa/C,CAAC"}
|
|
@@ -5,17 +5,14 @@ import { memo, useState } from "react";
|
|
|
5
5
|
import { Streamdown, } from "streamdown";
|
|
6
6
|
import { IconArrowUpRightSmall } from "#geistdocs-assets/icons";
|
|
7
7
|
import { CodeBlock } from "#geistdocs-ui/components/code-block";
|
|
8
|
-
import {
|
|
8
|
+
import { Dialog, DialogAction, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, } from "#geistdocs-ui/components/dialog";
|
|
9
9
|
import { cn } from "#geistdocs-ui/utils";
|
|
10
10
|
import { useGeistdocsConfig } from "../config-context";
|
|
11
11
|
import { resolveLinkHref } from "../link-href";
|
|
12
12
|
const CODE_LANGUAGE_PATTERN = /language-([\w-]+)/;
|
|
13
13
|
const FILENAME_PATTERN = /filename="([^"]+)"/;
|
|
14
14
|
const LinkSafetyModal = ({ isOpen, onClose, onConfirm, url, }) => {
|
|
15
|
-
return (_jsxs(
|
|
16
|
-
background: "var(--ds-background-200)",
|
|
17
|
-
boxShadow: "var(--ds-shadow-modal)",
|
|
18
|
-
}, width: 448, children: [_jsxs(ModalBody, { className: "bg-background-200", padding: 24, children: [_jsxs(ModalHeader, { children: [_jsx(ModalTitle, { children: "Open external link?" }), _jsx(ModalSubtitle, { children: "You\u2019re about to visit an external website." })] }), _jsx("div", { className: "break-all rounded-md bg-gray-100 p-3 font-mono text-copy-13", children: url })] }), _jsxs(ModalActions, { children: [_jsx(ModalAction, { onClick: onClose, variant: "secondary", children: "Cancel" }), _jsx(ModalAction, { onClick: onConfirm, children: "Open link" })] })] }));
|
|
15
|
+
return (_jsxs(Dialog, { active: isOpen, drawer: false, onClickOutside: onClose, style: { background: "var(--ds-background-200)" }, width: 448, children: [_jsxs(DialogContent, { className: "bg-background-200", padding: 24, children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { children: "Open external link?" }), _jsx(DialogDescription, { children: "You\u2019re about to visit an external website." })] }), _jsx("div", { className: "break-all rounded-md bg-gray-100 p-3 font-mono text-copy-13", children: url })] }), _jsxs(DialogFooter, { children: [_jsx(DialogClose, { onClick: onClose, variant: "secondary", children: "Cancel" }), _jsx(DialogAction, { onClick: onConfirm, children: "Open link" })] })] }));
|
|
19
16
|
};
|
|
20
17
|
const ChatLink = ({ children, className, href, node: _node, rel, target, ...props }) => {
|
|
21
18
|
const [isOpen, setIsOpen] = useState(false);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Dialog as DialogPrimitive } from "radix-ui";
|
|
2
|
+
import type { ComponentProps, CSSProperties, ReactNode } from "react";
|
|
3
|
+
import { Button } from "./button";
|
|
4
|
+
interface DialogProps {
|
|
5
|
+
active: boolean;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
drawer?: boolean;
|
|
8
|
+
onClickOutside: () => void;
|
|
9
|
+
style?: CSSProperties;
|
|
10
|
+
width?: number | string;
|
|
11
|
+
}
|
|
12
|
+
export declare const Dialog: ({ active, children, onClickOutside, style, width, }: DialogProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare const DialogContent: ({ className, padding, style, ...props }: ComponentProps<"div"> & {
|
|
14
|
+
padding?: number | string | false;
|
|
15
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare const DialogHeader: ({ className, ...props }: ComponentProps<"header">) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare const DialogTitle: ({ className, ...props }: ComponentProps<typeof DialogPrimitive.Title>) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare const DialogDescription: ({ className, ...props }: ComponentProps<typeof DialogPrimitive.Description>) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare const DialogFooter: ({ as: Component, children, className, }: {
|
|
20
|
+
as?: "footer" | "form";
|
|
21
|
+
children: ReactNode;
|
|
22
|
+
className?: string;
|
|
23
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export declare const DialogAction: (props: ComponentProps<typeof Button>) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export declare const DialogClose: (props: ComponentProps<typeof DialogAction>) => import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=dialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../../../src/providers/public/components/dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,UAAU,WAAW;IACnB,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,SAAS,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB;AAED,eAAO,MAAM,MAAM,GAAI,qDAMpB,WAAW,4CAmBb,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,yCAK3B,cAAc,CAAC,KAAK,CAAC,GAAG;IAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,KAAK,CAAA;CAAE,4CAM/D,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,yBAG1B,cAAc,CAAC,QAAQ,CAAC,4CAE1B,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,yBAGzB,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,4CAK9C,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,yBAG/B,cAAc,CAAC,OAAO,eAAe,CAAC,WAAW,CAAC,4CAKpD,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,yCAI1B;IACD,EAAE,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IACvB,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,4CASA,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,OAAO,cAAc,CAAC,OAAO,MAAM,CAAC,4CAEhE,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,OAAO,cAAc,CAAC,OAAO,YAAY,CAAC,4CAErE,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Dialog as DialogPrimitive } from "radix-ui";
|
|
4
|
+
import { cn } from "../utils";
|
|
5
|
+
import { Button } from "./button";
|
|
6
|
+
export const Dialog = ({ active, children, onClickOutside, style, width = 540, }) => (_jsx(DialogPrimitive.Root, { onOpenChange: (open) => {
|
|
7
|
+
if (!open) {
|
|
8
|
+
onClickOutside();
|
|
9
|
+
}
|
|
10
|
+
}, open: active, children: _jsxs(DialogPrimitive.Portal, { children: [_jsx(DialogPrimitive.Overlay, { className: "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-60 bg-gray-100 opacity-80 duration-300 ease-[cubic-bezier(0.175,0.885,0.32,1.1)] data-[state=closed]:animate-out data-[state=open]:animate-in motion-reduce:animate-none dark:bg-background-200" }), _jsx(DialogPrimitive.Content, { className: "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-[0.96] data-[state=open]:zoom-in-[0.96] fixed top-1/2 left-1/2 z-70 max-h-[85dvh] w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 overflow-auto rounded-xl bg-background-100 shadow-[var(--ds-shadow-modal-elevated)] outline-none duration-300 ease-[cubic-bezier(0.175,0.885,0.32,1.1)] data-[state=closed]:animate-out data-[state=open]:animate-in motion-reduce:animate-none", style: { maxWidth: width, ...style }, children: children })] }) }));
|
|
11
|
+
export const DialogContent = ({ className, padding = 20, style, ...props }) => (_jsx("div", { className: cn("relative overflow-x-hidden", className), style: { padding: padding || 0, ...style }, ...props }));
|
|
12
|
+
export const DialogHeader = ({ className, ...props }) => (_jsx("header", { className: cn("mb-5 last:mb-0", className), ...props }));
|
|
13
|
+
export const DialogTitle = ({ className, ...props }) => (_jsx(DialogPrimitive.Title, { className: cn("text-gray-1000 text-heading-20", className), ...props }));
|
|
14
|
+
export const DialogDescription = ({ className, ...props }) => (_jsx(DialogPrimitive.Description, { className: cn("mt-2 mb-1 text-copy-14 text-gray-900", className), ...props }));
|
|
15
|
+
export const DialogFooter = ({ as: Component = "footer", children, className, }) => (_jsx(Component, { className: cn("sticky bottom-0 flex shrink-0 justify-between p-3 before:absolute before:bottom-full before:left-0 before:-z-10 before:h-3 before:w-full before:translate-y-[275%] before:bg-black/[0.075] before:blur-[3px] before:transition-transform before:duration-200 after:absolute after:inset-0 after:-z-10 after:rounded-none after:bg-background-200 after:shadow-[0_-1px_0_0_var(--ds-gray-alpha-400)] peer-[&]/sticky-bottom:before:translate-y-[75%] sm:after:rounded-b-xl dark-theme:before:bg-white/10 [&>div]:flex [&>div]:gap-4", className), children: children }));
|
|
16
|
+
export const DialogAction = (props) => (_jsx(Button, { ...props, size: "small" }));
|
|
17
|
+
export const DialogClose = (props) => (_jsx(DialogAction, { ...props }));
|
package/docs/agents.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Geistdocs Package Docs
|
|
2
2
|
|
|
3
|
-
These docs are bundled with `@vercel/geistdocs` 2.7.
|
|
3
|
+
These docs are bundled with `@vercel/geistdocs` 2.7.10 so agents can understand the installed package without web access.
|
|
4
4
|
They are generated from `apps/template/content/docs` during the package build.
|
|
5
5
|
|
|
6
6
|
## How to use these files
|
|
@@ -47,6 +47,7 @@ They are generated from `apps/template/content/docs` during the package build.
|
|
|
47
47
|
- [Configure sidebar navigation](pages/guides/nested-navigation.md): Configure sidebar order, section labels, folder landing pages, and deeply nested page trees with meta.json files.
|
|
48
48
|
- [Copy Prompt](pages/components/copy-prompt.md): Use CopyPrompt for reusable instructions that readers can send to an AI assistant.
|
|
49
49
|
- [Details](pages/components/details.md): Compose Details and Summary for accessible browser-native disclosures.
|
|
50
|
+
- [Dialog](pages/components/dialog.md): Compose Dialog primitives for modal search, chat, forms, and confirmations.
|
|
50
51
|
- [Dropdown Menu](pages/components/dropdown-menu.md): Compose DropdownMenu primitives for application-owned menus outside MDX.
|
|
51
52
|
- [Edit on GitHub](pages/edit-on-github.md): A direct link on every documentation page that lets readers propose changes through GitHub pull requests.
|
|
52
53
|
- [Feedback](pages/feedback.md): An interactive feedback widget that collects user sentiment and creates structured GitHub Issues automatically.
|
package/docs/llms.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Geistdocs Package Documentation
|
|
2
2
|
|
|
3
|
-
These docs are bundled with `@vercel/geistdocs` 2.7.
|
|
3
|
+
These docs are bundled with `@vercel/geistdocs` 2.7.10.
|
|
4
4
|
They describe how to build package-backed Geistdocs sites and how to use the package APIs from generated project adapters.
|
|
5
5
|
|
|
6
6
|
## Documentation Index
|
|
@@ -30,6 +30,7 @@ They describe how to build package-backed Geistdocs sites and how to use the pac
|
|
|
30
30
|
- [Configure sidebar navigation](pages/guides/nested-navigation.md): Configure sidebar order, section labels, folder landing pages, and deeply nested page trees with meta.json files.
|
|
31
31
|
- [Copy Prompt](pages/components/copy-prompt.md): Use CopyPrompt for reusable instructions that readers can send to an AI assistant.
|
|
32
32
|
- [Details](pages/components/details.md): Compose Details and Summary for accessible browser-native disclosures.
|
|
33
|
+
- [Dialog](pages/components/dialog.md): Compose Dialog primitives for modal search, chat, forms, and confirmations.
|
|
33
34
|
- [Dropdown Menu](pages/components/dropdown-menu.md): Compose DropdownMenu primitives for application-owned menus outside MDX.
|
|
34
35
|
- [Edit on GitHub](pages/edit-on-github.md): A direct link on every documentation page that lets readers propose changes through GitHub pull requests.
|
|
35
36
|
- [Feedback](pages/feedback.md): An interactive feedback widget that collects user sentiment and creates structured GitHub Issues automatically.
|
|
@@ -4310,6 +4311,7 @@ Internal projects using `@vercel/geistdocs-private` use the same component subpa
|
|
|
4310
4311
|
| [Tabs](/docs/components/tabs) | `components/tabs`, `components/tabs-with-children` | Tab navigation and mounted content panels |
|
|
4311
4312
|
| [Collapsible](/docs/components/collapsible) | `components/collapsible` | Expandable content regions |
|
|
4312
4313
|
| [Details](/docs/components/details) | `components/details` | Styled native disclosure elements |
|
|
4314
|
+
| [Dialog](/docs/components/dialog) | `components/dialog` | Modal search, chat, forms, and confirmations |
|
|
4313
4315
|
| [Callout](/docs/components/callout) | `components/callout` | Notices with optional titles and descriptions |
|
|
4314
4316
|
| [Code Block](/docs/components/code-block) | `components/code-block`, `components/code-block-tabs` | Highlighted code and tabbed code groups |
|
|
4315
4317
|
| [Command Prompt](/docs/components/command-prompt) | `components/command-prompt` | Command surfaces with copy support and alternatives |
|
|
@@ -4636,6 +4638,84 @@ export function Disclosure() {
|
|
|
4636
4638
|
`Details` and `Summary` are also included in the default MDX component map.
|
|
4637
4639
|
|
|
4638
4640
|
|
|
4641
|
+
---
|
|
4642
|
+
|
|
4643
|
+
---
|
|
4644
|
+
title: Dialog
|
|
4645
|
+
description: Display focused content in an accessible modal
|
|
4646
|
+
type: reference
|
|
4647
|
+
summary: Compose Dialog primitives for modal search, chat, forms, and confirmations.
|
|
4648
|
+
url: /docs/components/dialog
|
|
4649
|
+
source: apps/template/content/docs/components/dialog.mdx
|
|
4650
|
+
related:
|
|
4651
|
+
- /docs/components
|
|
4652
|
+
- /docs/components/button
|
|
4653
|
+
- /docs/components/popover
|
|
4654
|
+
---
|
|
4655
|
+
|
|
4656
|
+
# Dialog
|
|
4657
|
+
|
|
4658
|
+
import { DialogDemo } from "@/components/geistdocs/dialog-demo";
|
|
4659
|
+
|
|
4660
|
+
<div className="not-prose my-6 flex min-h-32 items-center justify-center rounded-lg border border-gray-400 bg-background-100 p-6">
|
|
4661
|
+
<DialogDemo />
|
|
4662
|
+
</div>
|
|
4663
|
+
|
|
4664
|
+
```tsx
|
|
4665
|
+
"use client";
|
|
4666
|
+
|
|
4667
|
+
import {
|
|
4668
|
+
Dialog,
|
|
4669
|
+
DialogAction,
|
|
4670
|
+
DialogClose,
|
|
4671
|
+
DialogContent,
|
|
4672
|
+
DialogDescription,
|
|
4673
|
+
DialogFooter,
|
|
4674
|
+
DialogHeader,
|
|
4675
|
+
DialogTitle,
|
|
4676
|
+
} from "@vercel/geistdocs/components/dialog";
|
|
4677
|
+
import { useState } from "react";
|
|
4678
|
+
|
|
4679
|
+
export function SearchDialog() {
|
|
4680
|
+
const [active, setActive] = useState(false);
|
|
4681
|
+
|
|
4682
|
+
return (
|
|
4683
|
+
<>
|
|
4684
|
+
<button onClick={() => setActive(true)}>Search</button>
|
|
4685
|
+
<Dialog
|
|
4686
|
+
active={active}
|
|
4687
|
+
drawer={false}
|
|
4688
|
+
onClickOutside={() => setActive(false)}
|
|
4689
|
+
>
|
|
4690
|
+
<DialogContent>
|
|
4691
|
+
<DialogHeader>
|
|
4692
|
+
<DialogTitle>Search documentation</DialogTitle>
|
|
4693
|
+
<DialogDescription>Type a query to find a page.</DialogDescription>
|
|
4694
|
+
</DialogHeader>
|
|
4695
|
+
{/* Search input and results */}
|
|
4696
|
+
</DialogContent>
|
|
4697
|
+
<DialogFooter>
|
|
4698
|
+
<DialogClose
|
|
4699
|
+
onClick={() => setActive(false)}
|
|
4700
|
+
variant="secondary"
|
|
4701
|
+
>
|
|
4702
|
+
Cancel
|
|
4703
|
+
</DialogClose>
|
|
4704
|
+
<DialogAction onClick={() => setActive(false)}>Search</DialogAction>
|
|
4705
|
+
</DialogFooter>
|
|
4706
|
+
</Dialog>
|
|
4707
|
+
</>
|
|
4708
|
+
);
|
|
4709
|
+
}
|
|
4710
|
+
```
|
|
4711
|
+
|
|
4712
|
+
`Dialog` is controlled through `active` and `onClickOutside`. Set `drawer={false}` for a centered dialog on every viewport, or omit it to allow mobile drawer behavior where supported.
|
|
4713
|
+
|
|
4714
|
+
Always provide a `DialogTitle` and `DialogDescription`. `DialogAction` and `DialogClose` render action buttons; call your close-state setter from `DialogClose.onClick`.
|
|
4715
|
+
|
|
4716
|
+
Import these components from `@vercel/geistdocs/components/dialog`. The public package provides a compatible implementation, while the private package aliases Geistcn's official Modal components under the same `Dialog*` names.
|
|
4717
|
+
|
|
4718
|
+
|
|
4639
4719
|
---
|
|
4640
4720
|
|
|
4641
4721
|
---
|
package/docs/manifest.json
CHANGED
|
@@ -233,6 +233,15 @@
|
|
|
233
233
|
"type": "reference",
|
|
234
234
|
"url": "/docs/components/details"
|
|
235
235
|
},
|
|
236
|
+
{
|
|
237
|
+
"description": "Display focused content in an accessible modal",
|
|
238
|
+
"path": "pages/components/dialog.md",
|
|
239
|
+
"source": "apps/template/content/docs/components/dialog.mdx",
|
|
240
|
+
"summary": "Compose Dialog primitives for modal search, chat, forms, and confirmations.",
|
|
241
|
+
"title": "Dialog",
|
|
242
|
+
"type": "reference",
|
|
243
|
+
"url": "/docs/components/dialog"
|
|
244
|
+
},
|
|
236
245
|
{
|
|
237
246
|
"description": "Render accessible action and selection menus",
|
|
238
247
|
"path": "pages/components/dropdown-menu.md",
|
|
@@ -449,5 +458,5 @@
|
|
|
449
458
|
}
|
|
450
459
|
],
|
|
451
460
|
"source": "apps/template/content/docs",
|
|
452
|
-
"version": "2.7.
|
|
461
|
+
"version": "2.7.10"
|
|
453
462
|
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Dialog
|
|
3
|
+
description: Display focused content in an accessible modal
|
|
4
|
+
type: reference
|
|
5
|
+
summary: Compose Dialog primitives for modal search, chat, forms, and confirmations.
|
|
6
|
+
url: /docs/components/dialog
|
|
7
|
+
source: apps/template/content/docs/components/dialog.mdx
|
|
8
|
+
related:
|
|
9
|
+
- /docs/components
|
|
10
|
+
- /docs/components/button
|
|
11
|
+
- /docs/components/popover
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Dialog
|
|
15
|
+
|
|
16
|
+
import { DialogDemo } from "@/components/geistdocs/dialog-demo";
|
|
17
|
+
|
|
18
|
+
<div className="not-prose my-6 flex min-h-32 items-center justify-center rounded-lg border border-gray-400 bg-background-100 p-6">
|
|
19
|
+
<DialogDemo />
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
"use client";
|
|
24
|
+
|
|
25
|
+
import {
|
|
26
|
+
Dialog,
|
|
27
|
+
DialogAction,
|
|
28
|
+
DialogClose,
|
|
29
|
+
DialogContent,
|
|
30
|
+
DialogDescription,
|
|
31
|
+
DialogFooter,
|
|
32
|
+
DialogHeader,
|
|
33
|
+
DialogTitle,
|
|
34
|
+
} from "@vercel/geistdocs/components/dialog";
|
|
35
|
+
import { useState } from "react";
|
|
36
|
+
|
|
37
|
+
export function SearchDialog() {
|
|
38
|
+
const [active, setActive] = useState(false);
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<>
|
|
42
|
+
<button onClick={() => setActive(true)}>Search</button>
|
|
43
|
+
<Dialog
|
|
44
|
+
active={active}
|
|
45
|
+
drawer={false}
|
|
46
|
+
onClickOutside={() => setActive(false)}
|
|
47
|
+
>
|
|
48
|
+
<DialogContent>
|
|
49
|
+
<DialogHeader>
|
|
50
|
+
<DialogTitle>Search documentation</DialogTitle>
|
|
51
|
+
<DialogDescription>Type a query to find a page.</DialogDescription>
|
|
52
|
+
</DialogHeader>
|
|
53
|
+
{/* Search input and results */}
|
|
54
|
+
</DialogContent>
|
|
55
|
+
<DialogFooter>
|
|
56
|
+
<DialogClose
|
|
57
|
+
onClick={() => setActive(false)}
|
|
58
|
+
variant="secondary"
|
|
59
|
+
>
|
|
60
|
+
Cancel
|
|
61
|
+
</DialogClose>
|
|
62
|
+
<DialogAction onClick={() => setActive(false)}>Search</DialogAction>
|
|
63
|
+
</DialogFooter>
|
|
64
|
+
</Dialog>
|
|
65
|
+
</>
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
`Dialog` is controlled through `active` and `onClickOutside`. Set `drawer={false}` for a centered dialog on every viewport, or omit it to allow mobile drawer behavior where supported.
|
|
71
|
+
|
|
72
|
+
Always provide a `DialogTitle` and `DialogDescription`. `DialogAction` and `DialogClose` render action buttons; call your close-state setter from `DialogClose.onClick`.
|
|
73
|
+
|
|
74
|
+
Import these components from `@vercel/geistdocs/components/dialog`. The public package provides a compatible implementation, while the private package aliases Geistcn's official Modal components under the same `Dialog*` names.
|
|
@@ -32,6 +32,7 @@ Internal projects using `@vercel/geistdocs-private` use the same component subpa
|
|
|
32
32
|
| [Tabs](/docs/components/tabs) | `components/tabs`, `components/tabs-with-children` | Tab navigation and mounted content panels |
|
|
33
33
|
| [Collapsible](/docs/components/collapsible) | `components/collapsible` | Expandable content regions |
|
|
34
34
|
| [Details](/docs/components/details) | `components/details` | Styled native disclosure elements |
|
|
35
|
+
| [Dialog](/docs/components/dialog) | `components/dialog` | Modal search, chat, forms, and confirmations |
|
|
35
36
|
| [Callout](/docs/components/callout) | `components/callout` | Notices with optional titles and descriptions |
|
|
36
37
|
| [Code Block](/docs/components/code-block) | `components/code-block`, `components/code-block-tabs` | Highlighted code and tabbed code groups |
|
|
37
38
|
| [Command Prompt](/docs/components/command-prompt) | `components/command-prompt` | Command surfaces with copy support and alternatives |
|
package/docs/sitemap.md
CHANGED
|
@@ -28,6 +28,7 @@ Use it to choose focused page files from `docs/pages/` before reading the full `
|
|
|
28
28
|
- [Configure sidebar navigation](pages/guides/nested-navigation.md) | URL: /docs/guides/nested-navigation | Type: guide | Summary: Configure sidebar order, section labels, folder landing pages, and deeply nested page trees with meta.json files.
|
|
29
29
|
- [Copy Prompt](pages/components/copy-prompt.md) | URL: /docs/components/copy-prompt | Type: reference | Summary: Use CopyPrompt for reusable instructions that readers can send to an AI assistant.
|
|
30
30
|
- [Details](pages/components/details.md) | URL: /docs/components/details | Type: reference | Summary: Compose Details and Summary for accessible browser-native disclosures.
|
|
31
|
+
- [Dialog](pages/components/dialog.md) | URL: /docs/components/dialog | Type: reference | Summary: Compose Dialog primitives for modal search, chat, forms, and confirmations.
|
|
31
32
|
- [Dropdown Menu](pages/components/dropdown-menu.md) | URL: /docs/components/dropdown-menu | Type: reference | Summary: Compose DropdownMenu primitives for application-owned menus outside MDX.
|
|
32
33
|
- [Edit on GitHub](pages/edit-on-github.md) | URL: /docs/edit-on-github | Type: integration | Summary: A direct link on every documentation page that lets readers propose changes through GitHub pull requests.
|
|
33
34
|
- [Feedback](pages/feedback.md) | URL: /docs/feedback | Type: integration | Summary: An interactive feedback widget that collects user sentiment and creates structured GitHub Issues automatically.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/geistdocs",
|
|
3
3
|
"description": "Runtime and CLI for Geistdocs projects.",
|
|
4
|
-
"version": "2.7.
|
|
4
|
+
"version": "2.7.10",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -235,6 +235,10 @@
|
|
|
235
235
|
"types": "./dist/components/details.d.ts",
|
|
236
236
|
"default": "./dist/components/details.js"
|
|
237
237
|
},
|
|
238
|
+
"./components/dialog": {
|
|
239
|
+
"types": "./dist/components/dialog.d.ts",
|
|
240
|
+
"default": "./dist/components/dialog.js"
|
|
241
|
+
},
|
|
238
242
|
"./components/image": {
|
|
239
243
|
"types": "./dist/components/image.d.ts",
|
|
240
244
|
"default": "./dist/components/image.js"
|
package/public-foundation.css
CHANGED
|
@@ -287,6 +287,12 @@
|
|
|
287
287
|
0px 8px 16px -4px rgba(0, 0, 0, 0.04),
|
|
288
288
|
0px 24px 32px -8px rgba(0, 0, 0, 0.06), var(--ds-shadow-background-border);
|
|
289
289
|
|
|
290
|
+
--ds-shadow-modal-elevated:
|
|
291
|
+
0px 0px 0px 1px rgba(0, 0, 0, 0.08),
|
|
292
|
+
0px 32px 72px -12px rgba(0, 0, 0, 0.06),
|
|
293
|
+
0px 8px 32px -12px rgba(0, 0, 0, 0.08),
|
|
294
|
+
0px 8px 24px -12px rgba(0, 0, 0, 0.12);
|
|
295
|
+
|
|
290
296
|
--ds-focus-ring:
|
|
291
297
|
0 0 0 2px var(--ds-background-100), 0 0 0 4px var(--ds-blue-700);
|
|
292
298
|
--ds-focus-border:
|
|
@@ -444,6 +450,12 @@
|
|
|
444
450
|
0px 8px 16px -4px rgba(0, 0, 0, 0.16),
|
|
445
451
|
0px 24px 32px -8px rgba(0, 0, 0, 0.24), var(--ds-shadow-background-border);
|
|
446
452
|
|
|
453
|
+
--ds-shadow-modal-elevated:
|
|
454
|
+
0 0 0 1px var(--ds-gray-alpha-400),
|
|
455
|
+
0px 32px 72px -12px rgba(0, 0, 0, 0.06),
|
|
456
|
+
0px 8px 32px -12px rgba(0, 0, 0, 0.08),
|
|
457
|
+
0px 8px 24px -12px rgba(0, 0, 0, 0.12);
|
|
458
|
+
|
|
447
459
|
--ds-shadow-fullscreen:
|
|
448
460
|
var(--ds-shadow-border-base), 0px 1px 1px rgba(0, 0, 0, 0.08),
|
|
449
461
|
0px 8px 16px -4px rgba(0, 0, 0, 0.16),
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { Button } from "@vercel/geistdocs/components/button";
|
|
4
|
+
import {
|
|
5
|
+
Dialog,
|
|
6
|
+
DialogClose,
|
|
7
|
+
DialogContent,
|
|
8
|
+
DialogDescription,
|
|
9
|
+
DialogFooter,
|
|
10
|
+
DialogHeader,
|
|
11
|
+
DialogTitle,
|
|
12
|
+
} from "@vercel/geistdocs/components/dialog";
|
|
13
|
+
import { useState } from "react";
|
|
14
|
+
|
|
15
|
+
export function DialogDemo() {
|
|
16
|
+
const [active, setActive] = useState(false);
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<>
|
|
20
|
+
<Button onClick={() => setActive(true)} variant="secondary">
|
|
21
|
+
Open dialog
|
|
22
|
+
</Button>
|
|
23
|
+
<Dialog
|
|
24
|
+
active={active}
|
|
25
|
+
drawer={false}
|
|
26
|
+
onClickOutside={() => setActive(false)}
|
|
27
|
+
>
|
|
28
|
+
<DialogContent>
|
|
29
|
+
<DialogHeader>
|
|
30
|
+
<DialogTitle>Search documentation</DialogTitle>
|
|
31
|
+
<DialogDescription>
|
|
32
|
+
Dialogs work for search, chat, forms, and focused decisions.
|
|
33
|
+
</DialogDescription>
|
|
34
|
+
</DialogHeader>
|
|
35
|
+
</DialogContent>
|
|
36
|
+
<DialogFooter>
|
|
37
|
+
<DialogClose onClick={() => setActive(false)} variant="secondary">
|
|
38
|
+
Done
|
|
39
|
+
</DialogClose>
|
|
40
|
+
</DialogFooter>
|
|
41
|
+
</Dialog>
|
|
42
|
+
</>
|
|
43
|
+
);
|
|
44
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Dialog
|
|
3
|
+
description: Display focused content in an accessible modal
|
|
4
|
+
type: reference
|
|
5
|
+
summary: Compose Dialog primitives for modal search, chat, forms, and confirmations.
|
|
6
|
+
related:
|
|
7
|
+
- /docs/components
|
|
8
|
+
- /docs/components/button
|
|
9
|
+
- /docs/components/popover
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
import { DialogDemo } from "@/components/geistdocs/dialog-demo";
|
|
13
|
+
|
|
14
|
+
<div className="not-prose my-6 flex min-h-32 items-center justify-center rounded-lg border border-gray-400 bg-background-100 p-6">
|
|
15
|
+
<DialogDemo />
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
```tsx
|
|
19
|
+
"use client";
|
|
20
|
+
|
|
21
|
+
import {
|
|
22
|
+
Dialog,
|
|
23
|
+
DialogAction,
|
|
24
|
+
DialogClose,
|
|
25
|
+
DialogContent,
|
|
26
|
+
DialogDescription,
|
|
27
|
+
DialogFooter,
|
|
28
|
+
DialogHeader,
|
|
29
|
+
DialogTitle,
|
|
30
|
+
} from "@vercel/geistdocs/components/dialog";
|
|
31
|
+
import { useState } from "react";
|
|
32
|
+
|
|
33
|
+
export function SearchDialog() {
|
|
34
|
+
const [active, setActive] = useState(false);
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<>
|
|
38
|
+
<button onClick={() => setActive(true)}>Search</button>
|
|
39
|
+
<Dialog
|
|
40
|
+
active={active}
|
|
41
|
+
drawer={false}
|
|
42
|
+
onClickOutside={() => setActive(false)}
|
|
43
|
+
>
|
|
44
|
+
<DialogContent>
|
|
45
|
+
<DialogHeader>
|
|
46
|
+
<DialogTitle>Search documentation</DialogTitle>
|
|
47
|
+
<DialogDescription>Type a query to find a page.</DialogDescription>
|
|
48
|
+
</DialogHeader>
|
|
49
|
+
{/* Search input and results */}
|
|
50
|
+
</DialogContent>
|
|
51
|
+
<DialogFooter>
|
|
52
|
+
<DialogClose
|
|
53
|
+
onClick={() => setActive(false)}
|
|
54
|
+
variant="secondary"
|
|
55
|
+
>
|
|
56
|
+
Cancel
|
|
57
|
+
</DialogClose>
|
|
58
|
+
<DialogAction onClick={() => setActive(false)}>Search</DialogAction>
|
|
59
|
+
</DialogFooter>
|
|
60
|
+
</Dialog>
|
|
61
|
+
</>
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
`Dialog` is controlled through `active` and `onClickOutside`. Set `drawer={false}` for a centered dialog on every viewport, or omit it to allow mobile drawer behavior where supported.
|
|
67
|
+
|
|
68
|
+
Always provide a `DialogTitle` and `DialogDescription`. `DialogAction` and `DialogClose` render action buttons; call your close-state setter from `DialogClose.onClick`.
|
|
69
|
+
|
|
70
|
+
Import these components from `@vercel/geistdocs/components/dialog`. The public package provides a compatible implementation, while the private package aliases Geistcn's official Modal components under the same `Dialog*` names.
|
|
@@ -28,6 +28,7 @@ Internal projects using `@vercel/geistdocs-private` use the same component subpa
|
|
|
28
28
|
| [Tabs](/docs/components/tabs) | `components/tabs`, `components/tabs-with-children` | Tab navigation and mounted content panels |
|
|
29
29
|
| [Collapsible](/docs/components/collapsible) | `components/collapsible` | Expandable content regions |
|
|
30
30
|
| [Details](/docs/components/details) | `components/details` | Styled native disclosure elements |
|
|
31
|
+
| [Dialog](/docs/components/dialog) | `components/dialog` | Modal search, chat, forms, and confirmations |
|
|
31
32
|
| [Callout](/docs/components/callout) | `components/callout` | Notices with optional titles and descriptions |
|
|
32
33
|
| [Code Block](/docs/components/code-block) | `components/code-block`, `components/code-block-tabs` | Highlighted code and tabbed code groups |
|
|
33
34
|
| [Command Prompt](/docs/components/command-prompt) | `components/command-prompt` | Command surfaces with copy support and alternatives |
|
package/template/package.json
CHANGED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Dialog } from "radix-ui";
|
|
2
|
-
import type { ComponentProps, CSSProperties, ReactNode } from "react";
|
|
3
|
-
import { Button } from "./button";
|
|
4
|
-
interface ModalProps {
|
|
5
|
-
active?: boolean;
|
|
6
|
-
children: ReactNode;
|
|
7
|
-
drawer?: boolean;
|
|
8
|
-
onClickOutside?: () => void;
|
|
9
|
-
style?: CSSProperties;
|
|
10
|
-
width?: number | string;
|
|
11
|
-
}
|
|
12
|
-
export declare const Modal: ({ active, children, onClickOutside, style, width, }: ModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
export declare const ModalBody: ({ className, padding, style, ...props }: ComponentProps<"div"> & {
|
|
14
|
-
padding?: number;
|
|
15
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
export declare const ModalHeader: (props: ComponentProps<"div">) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
-
export declare const ModalTitle: (props: ComponentProps<typeof Dialog.Title>) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
-
export declare const ModalSubtitle: (props: ComponentProps<typeof Dialog.Description>) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
-
export declare const ModalActions: (props: ComponentProps<"div">) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
-
export declare const ModalAction: ({ variant, ...props }: ComponentProps<typeof Button>) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
-
export {};
|
|
22
|
-
//# sourceMappingURL=modal.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../../../src/providers/public/components/modal.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,UAAU,UAAU;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,SAAS,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB;AAED,eAAO,MAAM,KAAK,GAAI,qDAMnB,UAAU,4CAuBZ,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,yCAKvB,cAAc,CAAC,KAAK,CAAC,GAAG;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,4CAE9C,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,OAAO,cAAc,CAAC,KAAK,CAAC,4CAEvD,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,OAAO,cAAc,CAAC,OAAO,MAAM,CAAC,KAAK,CAAC,4CAKpE,CAAC;AAEF,eAAO,MAAM,aAAa,GACxB,OAAO,cAAc,CAAC,OAAO,MAAM,CAAC,WAAW,CAAC,4CAMjD,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,OAAO,cAAc,CAAC,KAAK,CAAC,4CAQxD,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,uBAGzB,cAAc,CAAC,OAAO,MAAM,CAAC,4CAK/B,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { Dialog } from "radix-ui";
|
|
4
|
-
import { cn } from "../utils";
|
|
5
|
-
import { Button } from "./button";
|
|
6
|
-
export const Modal = ({ active, children, onClickOutside, style, width, }) => (_jsx(Dialog.Root, { onOpenChange: (open) => {
|
|
7
|
-
if (!open) {
|
|
8
|
-
onClickOutside?.();
|
|
9
|
-
}
|
|
10
|
-
}, open: active, children: _jsxs(Dialog.Portal, { children: [_jsx(Dialog.Overlay, { className: "fixed inset-0 z-60 bg-black/40" }), _jsx(Dialog.Content, { className: "fixed top-1/2 left-1/2 z-70 max-h-[85dvh] w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 overflow-auto rounded-xl bg-background-100 shadow-[var(--ds-shadow-modal)] outline-none", onPointerDownOutside: (event) => {
|
|
11
|
-
event.preventDefault();
|
|
12
|
-
onClickOutside?.();
|
|
13
|
-
}, style: { maxWidth: width, ...style }, children: children })] }) }));
|
|
14
|
-
export const ModalBody = ({ className, padding, style, ...props }) => (_jsx("div", { className: className, style: { padding, ...style }, ...props }));
|
|
15
|
-
export const ModalHeader = (props) => (_jsx("div", { className: cn("mb-5 space-y-1", props.className), ...props }));
|
|
16
|
-
export const ModalTitle = (props) => (_jsx(Dialog.Title, { className: cn("font-semibold text-heading-20", props.className), ...props }));
|
|
17
|
-
export const ModalSubtitle = (props) => (_jsx(Dialog.Description, { className: cn("text-copy-14 text-gray-900", props.className), ...props }));
|
|
18
|
-
export const ModalActions = (props) => (_jsx("div", { className: cn("flex justify-end gap-2 border-gray-400 border-t p-4", props.className), ...props }));
|
|
19
|
-
export const ModalAction = ({ variant, ...props }) => (_jsx(Button, { variant: variant === "secondary" ? "secondary" : "default", ...props }));
|