@tuwaio/docs-ui 0.0.10 → 0.0.12

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/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- 'use strict';var novaCore=require('@tuwaio/nova-core'),outline=require('@heroicons/react/24/outline'),jsxRuntime=require('react/jsx-runtime'),reactSyntaxHighlighter=require('react-syntax-highlighter'),prism=require('react-syntax-highlighter/dist/esm/styles/prism'),X=require('next/dynamic'),nextraThemeDocs=require('nextra-theme-docs'),et=require('react'),components=require('nextra/components');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var X__default=/*#__PURE__*/_interopDefault(X);var et__default=/*#__PURE__*/_interopDefault(et);function E({isCopied:t,onCopy:o}){return jsxRuntime.jsx("button",{onClick:o,type:"button",className:novaCore.cn("tuwadocs:h-6 tuwadocs:w-6 tuwadocs:cursor-pointer tuwadocs:transition-colors",t?"tuwadocs:text-[var(--tuwa-success-icon)]":"tuwadocs:text-[var(--tuwa-text-secondary)] tuwadocs:hover:text-[var(--tuwa-text-primary)]"),children:t?jsxRuntime.jsx(outline.CheckCircleIcon,{}):jsxRuntime.jsx(outline.Square2StackIcon,{})})}function V({title:t,titleIcons:o,children:e,textToCopy:r}){let{isCopied:a,copy:c}=novaCore.useCopyToClipboard(1500);return jsxRuntime.jsxs("div",{className:novaCore.cn("tuwadocs:group tuwadocs:overflow-hidden tuwadocs:rounded-[var(--tuwa-rounded-corners)] tuwadocs:border","tuwadocs:border-[var(--tuwa-border-secondary)] tuwadocs:bg-[var(--tuwa-bg-primary)]"),children:[jsxRuntime.jsxs("div",{className:novaCore.cn("tuwadocs:flex tuwadocs:items-center tuwadocs:justify-between tuwadocs:gap-4 tuwadocs:px-4 tuwadocs:py-2","tuwadocs:border-b tuwadocs:border-[var(--tuwa-border-secondary)] tuwadocs:bg-[var(--tuwa-bg-secondary)]"),children:[jsxRuntime.jsxs("div",{className:"tuwadocs:flex tuwadocs:items-center tuwadocs:gap-2",children:[jsxRuntime.jsx("div",{className:"tuwadocs:h-[20px] tuwadocs:w-[20px] tuwadocs:text-[var(--tuwa-text-secondary)]",children:o}),jsxRuntime.jsx("p",{className:"tuwadocs:text-sm tuwadocs:font-medium tuwadocs:text-[var(--tuwa-text-primary)]",children:t})]}),jsxRuntime.jsx("div",{className:"tuwadocs:transition tuwadocs:md:opacity-0 tuwadocs:group-hover:opacity-100",children:jsxRuntime.jsx(E,{isCopied:a,onCopy:()=>c(r)})})]}),e]})}var J=({children:t})=>jsxRuntime.jsx(jsxRuntime.Fragment,{children:t}),m=X__default.default(()=>Promise.resolve(J),{ssr:false});function H({children:t,language:o,resolvedTheme:e}){return jsxRuntime.jsx("div",{className:"tuwadocs:border-t tuwadocs:border-[var(--tuwa-border-secondary)]",children:jsxRuntime.jsx(m,{children:jsxRuntime.jsx(reactSyntaxHighlighter.Prism,{language:o??"bash",customStyle:{margin:0,background:"transparent"},style:e==="dark"?prism.materialOceanic:prism.materialLight,children:String(t).replace(/\n$/,"")})})})}function Ht({features:t}){return jsxRuntime.jsx("div",{className:"tuwadocs:grid tuwadocs:grid-cols-1 tuwadocs:md:grid-cols-3 tuwadocs:gap-6 tuwadocs:mt-12",children:t.map(o=>jsxRuntime.jsxs("div",{className:"tuwadocs:p-6 tuwadocs:border tuwadocs:rounded-[var(--tuwa-rounded-corners)] tuwadocs:hover:shadow-lg tuwadocs:transition-shadow",children:[jsxRuntime.jsx("div",{className:"tuwadocs:text-2xl tuwadocs:mb-3",children:o.icon}),jsxRuntime.jsx("h3",{className:"tuwadocs:text-lg tuwadocs:font-semibold tuwadocs:mb-2",children:o.title}),jsxRuntime.jsx("p",{className:"tuwadocs:text-[var(--tuwa-text-secondary)]",children:o.description})]},o.title))})}var F=[{title:"NPM",href:"https://npmjs.com/org/tuwaio",className:"tuwadocs:hover:text-red-600 tuwadocs:dark:hover:text-red-400",image:jsxRuntime.jsx("svg",{className:"tuwadocs:w-4 tuwadocs:h-4",fill:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{d:"M1.763 0C.786 0 0 .786 0 1.763v20.474C0 23.214.786 24 1.763 24h20.474c.977 0 1.763-.786 1.763-1.763V1.763C24 .786 23.214 0 22.237 0H1.763zM5.13 5.323l13.837.019-.009 13.836h-3.464l.01-10.382h-3.456L12.04 19.17H5.113l.017-13.847z"})})}],M=[{title:"NPM",href:"https://npmjs.com/org/tuwaio",className:"tuwa-footer-link--npm",image:jsxRuntime.jsx("svg",{className:"tuwadocs:w-4 tuwadocs:h-4",fill:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{d:"M1.763 0C.786 0 0 .786 0 1.763v20.474C0 23.214.786 24 1.763 24h20.474c.977 0 1.763-.786 1.763-1.763V1.763C24 .786 23.214 0 22.237 0H1.763zM5.13 5.323l13.837.019-.009 13.836h-3.464l.01-10.382h-3.456L12.04 19.17H5.113l.017-13.847z"})})},{title:"GitHub",href:"https://github.com/TuwaIO",className:"tuwa-footer-link--github",image:jsxRuntime.jsx("svg",{className:"tuwadocs:w-4 tuwadocs:h-4",fill:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{d:"M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"})})}];var rt="https://raw.githubusercontent.com/TuwaIO/workflows/refs/heads/main/preview/tuwa_v1.svg",S=null;function $(t){return t.replace(/-([a-z])/g,o=>o[1].toUpperCase())}function st(t){if(t==="class")return "className";if(t.includes(":")){let o=t.split(":");return o[0]+o[1].charAt(0).toUpperCase()+o[1].slice(1)}return $(t)}function ct(t){let o={};return t.split(";").forEach(e=>{let r=e.trim();if(!r)return;let a=r.indexOf(":");if(a===-1)return;let c=r.slice(0,a).trim(),s=r.slice(a+1).trim();c&&s&&(o[$(c)]=s);}),o}function G(t,o){if(t.nodeType===Node.TEXT_NODE)return t.nodeValue;if(t.nodeType===Node.ELEMENT_NODE){let e=t,r=e.tagName.toLowerCase(),a={};for(let s=0;s<e.attributes.length;s++){let i=e.attributes[s],l=st(i.name);l==="style"?a.style=ct(i.value):a[l]=i.value;}a.key=o;let c=[];for(let s=0;s<e.childNodes.length;s++){let i=G(e.childNodes[s],`${o||"node"}-${s}`);i!==null&&c.push(i);}return et__default.default.createElement(r,a,...c)}return null}function x({width:t=120,height:o=40,className:e,style:r,...a}){let[c,s]=et.useState(null),[i,l]=et.useState("0 0 620 238");et.useEffect(()=>{S||(S=fetch(rt).then(d=>{if(!d.ok)throw new Error("Failed to fetch SVG");return d.text()}).catch(d=>(console.error("Error fetching logo SVG:",d),"")));let f=true;return S.then(d=>{if(!(!f||!d))try{let g=new DOMParser().parseFromString(d,"image/svg+xml").querySelector("svg");if(g){let D=g.getAttribute("viewBox")||"0 0 620 238";l(D);let L=[];for(let v=0;v<g.childNodes.length;v++){let B=G(g.childNodes[v],`logo-child-${v}`);B!==null&&L.push(B);}s(L);}}catch(T){console.error("Error parsing logo SVG:",T);}}),()=>{f=false;}},[]);let y={height:r?.height||(o?typeof o=="number"?`${o}px`:o:"auto"),width:t?typeof t=="number"?`${t}px`:t:void 0,...r};return jsxRuntime.jsx("svg",{viewBox:i,className:e,style:y,...a,children:c})}function Yt({links:t}){return jsxRuntime.jsx(nextraThemeDocs.Footer,{children:jsxRuntime.jsxs("div",{className:"tuwadocs:flex tuwadocs:w-full tuwadocs:flex-col tuwadocs:items-center tuwadocs:sm:items-start tuwa-footer-border tuwadocs:pt-8",children:[jsxRuntime.jsxs("div",{className:"tuwadocs:mb-6 tuwadocs:flex tuwadocs:items-center tuwadocs:gap-4 tuwadocs:w-full tuwadocs:justify-between",children:[jsxRuntime.jsx("div",{className:"tuwadocs:flex tuwadocs:items-center",children:jsxRuntime.jsx(m,{children:jsxRuntime.jsx(x,{width:100,height:42,className:"tuwadocs:transition-opacity tuwadocs:duration-300"})})}),jsxRuntime.jsx("div",{className:"tuwadocs:flex tuwadocs:items-center tuwadocs:gap-4 tuwadocs:text-sm",children:(t??M).map(({title:o,href:e,image:r,className:a})=>jsxRuntime.jsxs("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:novaCore.cn("tuwa-footer-link tuwadocs:flex tuwadocs:items-center tuwadocs:gap-1",a),children:[r,jsxRuntime.jsx("span",{className:"tuwadocs:hidden tuwadocs:sm:inline",children:o})]},o))})]}),jsxRuntime.jsxs("div",{className:"tuwadocs:w-full tuwa-footer-border tuwadocs:pt-4",children:[jsxRuntime.jsxs("div",{className:"tuwadocs:flex tuwadocs:flex-col tuwadocs:sm:flex-row tuwadocs:justify-between tuwadocs:items-start tuwadocs:sm:items-center tuwadocs:gap-4",children:[jsxRuntime.jsxs("div",{className:"tuwadocs:flex-1",children:[jsxRuntime.jsx("p",{className:"tuwa-footer-description",children:"The modular, headless-first Web3 infrastructure. Build self-custodial applications with zero vendor lock-in."}),jsxRuntime.jsx("p",{className:"tuwa-footer-license",children:"Licensed under Apache 2.0. Open source and free to use."})]}),jsxRuntime.jsxs("div",{className:"tuwa-footer-copyright",children:["\xA9 2025 - ",new Date().getFullYear()," TUWA. All rights reserved."]})]}),jsxRuntime.jsx("div",{className:"tuwadocs:flex tuwadocs:flex-wrap tuwadocs:items-center tuwadocs:gap-3 tuwadocs:mt-4 tuwadocs:pt-4 tuwa-footer-border"})]})]})})}function oo({links:t}){return jsxRuntime.jsx(nextraThemeDocs.Navbar,{logo:jsxRuntime.jsx(m,{children:jsxRuntime.jsx(x,{width:105,height:45,className:"tuwadocs:transition-opacity tuwadocs:duration-300"})}),children:jsxRuntime.jsx("div",{className:"tuwadocs:flex tuwadocs:items-center tuwadocs:gap-3",children:(t??F).map(({title:o,href:e,image:r,className:a})=>jsxRuntime.jsxs("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:novaCore.cn("tuwadocs:hidden tuwadocs:sm:flex tuwadocs:items-center tuwadocs:gap-1 tuwadocs:px-3 tuwadocs:py-1.5 tuwadocs:text-sm tuwadocs:font-medium tuwadocs:transition-colors tuwadocs:text-[var(--tuwa-text-primary)]",a),children:[r,o]},o))})})}var _=[{title:"pnpm",command:"pnpm add"},{title:"bun",command:"bun add"},{title:"npm",command:"npm install"},{title:"yarn",command:"yarn add"}];function uo({packagesList:t,resolvedTheme:o}){return jsxRuntime.jsx("div",{className:"tuwadocs:my-4",children:jsxRuntime.jsx(components.Tabs,{items:_.map(e=>e.title),children:_.map(e=>jsxRuntime.jsx(components.Tabs.Tab,{children:jsxRuntime.jsx(V,{title:"Terminal",titleIcons:jsxRuntime.jsx(outline.CommandLineIcon,{}),textToCopy:`${e.command} ${t}`,children:jsxRuntime.jsx(H,{resolvedTheme:o,language:"bash",children:`${e.command} ${t}`})})},e.title))})})}function po({href:t,children:o}){return jsxRuntime.jsx("a",{className:novaCore.cn("tuwadocs:font-medium tuwadocs:text-[var(--tuwa-text-accent)]","tuwadocs:transition-all tuwadocs:hover:underline tuwadocs:underline-offset-4"),href:t,target:"_blank",rel:"noopener noreferrer",children:o})}var ho=({src:t,poster:o,autoplay:e=false,muted:r=false,loop:a=false,controls:c=true,className:s="",aspectRatio:i="aspect-video",onPlay:l,onPause:y,onEnded:f,"aria-label":d})=>jsxRuntime.jsx("div",{className:novaCore.cn("tuwadocs:relative tuwadocs:w-full tuwadocs:overflow-hidden tuwadocs:rounded-[var(--tuwa-rounded-corners)] tuwadocs:bg-black tuwadocs:my-4",i,s),children:jsxRuntime.jsxs("video",{src:t,poster:o,controls:c,autoPlay:e,muted:r,loop:a,className:novaCore.cn("tuwadocs:absolute tuwadocs:inset-0 tuwadocs:h-full tuwadocs:w-full tuwadocs:object-contain","tuwadocs:transition-opacity tuwadocs:duration-200","tuwadocs:focus:outline-none tuwadocs:focus:ring-[length:var(--tuwa-ring-width)] tuwadocs:focus:ring-[var(--tuwa-text-accent)] tuwadocs:focus:ring-offset-[length:var(--tuwa-ring-width)] tuwadocs:focus:ring-offset-[var(--tuwa-bg-primary)]"),onPlay:l,onPause:y,onEnded:f,"aria-label":d,preload:"metadata",children:[jsxRuntime.jsx("track",{kind:"captions"}),"Your browser does not support the video tag. Please"," ",jsxRuntime.jsx("a",{href:t,download:true,className:"tuwadocs:text-[var(--tuwa-text-accent)] tuwadocs:underline tuwadocs:hover:opacity-80",children:"download the video"})," ","to watch it."]})});
2
- exports.CodeBlock=V;exports.CodeHighlighter=H;exports.CopyIconButton=E;exports.Features=Ht;exports.Footer=Yt;exports.Logo=x;exports.Navbar=oo;exports.PackageInstallationTabs=uo;exports.StyledLink=po;exports.VideoPlayer=ho;exports.baseFooterLinks=M;exports.baseNavLinks=F;Object.keys(novaCore).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return novaCore[k]}})});
1
+ 'use strict';var novaCore=require('@tuwaio/nova-core'),outline=require('@heroicons/react/24/outline'),jsxRuntime=require('react/jsx-runtime'),reactSyntaxHighlighter=require('react-syntax-highlighter'),prism=require('react-syntax-highlighter/dist/esm/styles/prism'),J=require('next/dynamic'),nextraThemeDocs=require('nextra-theme-docs'),at=require('react'),components=require('nextra/components');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var J__default=/*#__PURE__*/_interopDefault(J);var at__default=/*#__PURE__*/_interopDefault(at);function V({isCopied:e,onCopy:o}){return jsxRuntime.jsx("button",{onClick:o,type:"button",className:novaCore.cn("tuwadocs:h-6 tuwadocs:w-6 tuwadocs:cursor-pointer tuwadocs:transition-colors",e?"tuwadocs:text-[var(--tuwa-success-icon)]":"tuwadocs:text-[var(--tuwa-text-secondary)] tuwadocs:hover:text-[var(--tuwa-text-primary)]"),children:e?jsxRuntime.jsx(outline.CheckCircleIcon,{}):jsxRuntime.jsx(outline.Square2StackIcon,{})})}function B({title:e,titleIcons:o,children:t,textToCopy:r}){let{isCopied:c,copy:a}=novaCore.useCopyToClipboard(1500);return jsxRuntime.jsxs("div",{className:novaCore.cn("tuwadocs:group tuwadocs:overflow-hidden tuwadocs:rounded-[var(--tuwa-rounded-corners)] tuwadocs:border","tuwadocs:border-[var(--tuwa-border-secondary)] tuwadocs:bg-[var(--tuwa-bg-primary)]"),children:[jsxRuntime.jsxs("div",{className:novaCore.cn("tuwadocs:flex tuwadocs:items-center tuwadocs:justify-between tuwadocs:gap-4 tuwadocs:px-4 tuwadocs:py-2","tuwadocs:border-b tuwadocs:border-[var(--tuwa-border-secondary)] tuwadocs:bg-[var(--tuwa-bg-secondary)]"),children:[jsxRuntime.jsxs("div",{className:"tuwadocs:flex tuwadocs:items-center tuwadocs:gap-2",children:[jsxRuntime.jsx("div",{className:"tuwadocs:h-[20px] tuwadocs:w-[20px] tuwadocs:text-[var(--tuwa-text-secondary)]",children:o}),jsxRuntime.jsx("p",{className:"tuwadocs:text-sm tuwadocs:font-medium tuwadocs:text-[var(--tuwa-text-primary)]",children:e})]}),jsxRuntime.jsx("div",{className:"tuwadocs:transition tuwadocs:md:opacity-0 tuwadocs:group-hover:opacity-100",children:jsxRuntime.jsx(V,{isCopied:c,onCopy:()=>a(r)})})]}),t]})}var K=({children:e})=>jsxRuntime.jsx(jsxRuntime.Fragment,{children:e}),p=J__default.default(()=>Promise.resolve(K),{ssr:false});function G({children:e,language:o,resolvedTheme:t}){return jsxRuntime.jsx("div",{className:"tuwadocs:border-t tuwadocs:border-[var(--tuwa-border-secondary)]",children:jsxRuntime.jsx(p,{children:jsxRuntime.jsx(reactSyntaxHighlighter.Prism,{language:o??"bash",customStyle:{margin:0,background:"transparent"},style:t==="dark"?prism.materialOceanic:prism.materialLight,children:String(e).replace(/\n$/,"")})})})}function Gt({features:e}){return jsxRuntime.jsx("div",{className:"tuwadocs:grid tuwadocs:grid-cols-1 tuwadocs:md:grid-cols-3 tuwadocs:gap-6 tuwadocs:mt-12",children:e.map(o=>jsxRuntime.jsxs("div",{className:"tuwadocs:p-6 tuwadocs:border tuwadocs:rounded-[var(--tuwa-rounded-corners)] tuwadocs:hover:shadow-lg tuwadocs:transition-shadow",children:[jsxRuntime.jsx("div",{className:"tuwadocs:text-2xl tuwadocs:mb-3",children:o.icon}),jsxRuntime.jsx("h3",{className:"tuwadocs:text-lg tuwadocs:font-semibold tuwadocs:mb-2",children:o.title}),jsxRuntime.jsx("p",{className:"tuwadocs:text-[var(--tuwa-text-secondary)]",children:o.description})]},o.title))})}var z=[{title:"NPM",href:"https://npmjs.com/org/tuwaio",className:"tuwadocs:hover:text-red-600 tuwadocs:dark:hover:text-red-400",image:jsxRuntime.jsx("svg",{className:"tuwadocs:w-4 tuwadocs:h-4",fill:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{d:"M1.763 0C.786 0 0 .786 0 1.763v20.474C0 23.214.786 24 1.763 24h20.474c.977 0 1.763-.786 1.763-1.763V1.763C24 .786 23.214 0 22.237 0H1.763zM5.13 5.323l13.837.019-.009 13.836h-3.464l.01-10.382h-3.456L12.04 19.17H5.113l.017-13.847z"})})}],A=[{title:"NPM",href:"https://npmjs.com/org/tuwaio",className:"tuwa-footer-link--npm",image:jsxRuntime.jsx("svg",{className:"tuwadocs:w-4 tuwadocs:h-4",fill:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{d:"M1.763 0C.786 0 0 .786 0 1.763v20.474C0 23.214.786 24 1.763 24h20.474c.977 0 1.763-.786 1.763-1.763V1.763C24 .786 23.214 0 22.237 0H1.763zM5.13 5.323l13.837.019-.009 13.836h-3.464l.01-10.382h-3.456L12.04 19.17H5.113l.017-13.847z"})})},{title:"GitHub",href:"https://github.com/TuwaIO",className:"tuwa-footer-link--github",image:jsxRuntime.jsx("svg",{className:"tuwadocs:w-4 tuwadocs:h-4",fill:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{d:"M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"})})}];var st="https://raw.githubusercontent.com/TuwaIO/workflows/refs/heads/main/preview/logo_v1.svg";function E(e){return e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase())}function rt(e){let o={};return e.split(";").forEach(t=>{let r=t.trim();if(!r)return;let c=r.indexOf(":");if(c===-1)return;let a=r.slice(0,c).trim(),s=r.slice(c+1).trim();a&&s&&(o[E(a)]=s);}),o}function F(e){if(e==="class")return "className";if(e.includes(":")){let[o,t]=e.split(":");return o+t.charAt(0).toUpperCase()+t.slice(1)}return E(e)}function ct(e){let o=[],t=[],r=/(<!--[\s\S]*?-->)|(<\s*\/\s*([a-zA-Z0-9:-]+)\s*>)|(<\s*([a-zA-Z0-9:-]+)([^>]*?)\/?>)|([^<]+)/g,c=/([a-zA-Z0-9:-]+)\s*=\s*(?:"([^"]*?)"|'([^']*?)')/g,a;for(;(a=r.exec(e))!==null;)if(!a[1]){if(a[2]){let s=a[3].toLowerCase(),n=[];for(;t.length>0&&t[t.length-1].tag!==s;)n.push(t.pop());if(t.length>0){let d=t.pop();d.children=[...n.reverse(),...d.children],t.length>0?t[t.length-1].children.push(d):o.push(d);}else for(;n.length>0;)t.push(n.pop());continue}if(a[4]){let s=a[5].toLowerCase(),n=a[6],d=a[4].endsWith("/>")||a[4].endsWith("/ >"),f={},i;for(;(i=c.exec(n))!==null;)f[i[1]]=i[2]||i[3]||"";let u={tag:s,attrs:f,children:[]};d?t.length>0?t[t.length-1].children.push(u):o.push(u):t.push(u);continue}if(a[7]){let s=a[7].trim();s&&(t.length>0?t[t.length-1].children.push(s):o.push(s));}}for(;t.length>0;){let s=t.pop();t.length>0?t[t.length-1].children.push(s):o.push(s);}return o.filter(s=>typeof s!="string")}function M(e,o){let t=e.tag;if(t==="script")return null;let r={key:o};for(let[a,s]of Object.entries(e.attrs)){let n=F(a);n==="style"?r.style=rt(s):r[n]=s;}let c=e.children.map((a,s)=>typeof a=="string"?a:M(a,`${o}-${s}`)).filter(Boolean);return at__default.default.createElement(t,r,...c)}async function x({url:e=st,className:o,style:t,...r}){let c=null,a={},s=false;try{let n=await fetch(e,{next:{revalidate:86400}});if(!n.ok)throw new Error(`Failed to fetch SVG from remote source: ${n.status}`);let i=(await n.text()).replace(/<!--[\s\S]*?-->/g,"").replace(/<\?xml[\s\S]*?\?>/g,"").trim().match(/<svg([^>]*?)>([\s\S]*?)<\/svg>/i);if(!i)throw new Error("Invalid or corrupted SVG layout payload");let u=i[1],U=i[2],T={},W=/([a-zA-Z0-9:-]+)\s*=\s*(?:"([^"]*?)"|'([^']*?)')/g,h;for(;(h=W.exec(u))!==null;){let y=h[1],S=h[2]||h[3]||"",C=F(y);C!=="className"&&C!=="style"&&(T[C]=S);}a=T,c=ct(U).map((y,S)=>M(y,`logo-node-${S}`));}catch(n){console.error("Core/UI Runtime Error fetching remote SVG:",n),s=true;}return s?jsxRuntime.jsx("svg",{className:o,style:t,...r}):jsxRuntime.jsx("svg",{...a,className:o,style:t,...r,children:c})}function qt({links:e}){return jsxRuntime.jsx(nextraThemeDocs.Footer,{children:jsxRuntime.jsxs("div",{className:"tuwadocs:flex tuwadocs:w-full tuwadocs:flex-col tuwadocs:items-center tuwadocs:sm:items-start tuwa-footer-border tuwadocs:pt-8",children:[jsxRuntime.jsxs("div",{className:"tuwadocs:mb-6 tuwadocs:flex tuwadocs:items-center tuwadocs:gap-4 tuwadocs:w-full tuwadocs:justify-between",children:[jsxRuntime.jsx("div",{className:"tuwadocs:flex tuwadocs:items-center",children:jsxRuntime.jsx(p,{children:jsxRuntime.jsx(x,{width:100,height:42,className:"tuwadocs:transition-opacity tuwadocs:duration-300"})})}),jsxRuntime.jsx("div",{className:"tuwadocs:flex tuwadocs:items-center tuwadocs:gap-4 tuwadocs:text-sm",children:(e??A).map(({title:o,href:t,image:r,className:c})=>jsxRuntime.jsxs("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:novaCore.cn("tuwa-footer-link tuwadocs:flex tuwadocs:items-center tuwadocs:gap-1",c),children:[r,jsxRuntime.jsx("span",{className:"tuwadocs:hidden tuwadocs:sm:inline",children:o})]},o))})]}),jsxRuntime.jsxs("div",{className:"tuwadocs:w-full tuwa-footer-border tuwadocs:pt-4",children:[jsxRuntime.jsxs("div",{className:"tuwadocs:flex tuwadocs:flex-col tuwadocs:sm:flex-row tuwadocs:justify-between tuwadocs:items-start tuwadocs:sm:items-center tuwadocs:gap-4",children:[jsxRuntime.jsxs("div",{className:"tuwadocs:flex-1",children:[jsxRuntime.jsx("p",{className:"tuwa-footer-description",children:"The modular, headless-first Web3 infrastructure. Build self-custodial applications with zero vendor lock-in."}),jsxRuntime.jsx("p",{className:"tuwa-footer-license",children:"Licensed under Apache 2.0. Open source and free to use."})]}),jsxRuntime.jsxs("div",{className:"tuwa-footer-copyright",children:["\xA9 2025 - ",new Date().getFullYear()," TUWA. All rights reserved."]})]}),jsxRuntime.jsx("div",{className:"tuwadocs:flex tuwadocs:flex-wrap tuwadocs:items-center tuwadocs:gap-3 tuwadocs:mt-4 tuwadocs:pt-4 tuwa-footer-border"})]})]})})}function to({links:e}){return jsxRuntime.jsx(nextraThemeDocs.Navbar,{logo:jsxRuntime.jsx(p,{children:jsxRuntime.jsx(x,{width:105,height:45,className:"tuwadocs:transition-opacity tuwadocs:duration-300"})}),children:jsxRuntime.jsx("div",{className:"tuwadocs:flex tuwadocs:items-center tuwadocs:gap-3",children:(e??z).map(({title:o,href:t,image:r,className:c})=>jsxRuntime.jsxs("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:novaCore.cn("tuwadocs:hidden tuwadocs:sm:flex tuwadocs:items-center tuwadocs:gap-1 tuwadocs:px-3 tuwadocs:py-1.5 tuwadocs:text-sm tuwadocs:font-medium tuwadocs:transition-colors tuwadocs:text-[var(--tuwa-text-primary)]",c),children:[r,o]},o))})})}var O=[{title:"pnpm",command:"pnpm add"},{title:"bun",command:"bun add"},{title:"npm",command:"npm install"},{title:"yarn",command:"yarn add"}];function io({packagesList:e,resolvedTheme:o}){return jsxRuntime.jsx("div",{className:"tuwadocs:my-4",children:jsxRuntime.jsx(components.Tabs,{items:O.map(t=>t.title),children:O.map(t=>jsxRuntime.jsx(components.Tabs.Tab,{children:jsxRuntime.jsx(B,{title:"Terminal",titleIcons:jsxRuntime.jsx(outline.CommandLineIcon,{}),textToCopy:`${t.command} ${e}`,children:jsxRuntime.jsx(G,{resolvedTheme:o,language:"bash",children:`${t.command} ${e}`})})},t.title))})})}function po({href:e,children:o}){return jsxRuntime.jsx("a",{className:novaCore.cn("tuwadocs:font-medium tuwadocs:text-[var(--tuwa-text-accent)]","tuwadocs:transition-all tuwadocs:hover:underline tuwadocs:underline-offset-4"),href:e,target:"_blank",rel:"noopener noreferrer",children:o})}var ho=({src:e,poster:o,autoplay:t=false,muted:r=false,loop:c=false,controls:a=true,className:s="",aspectRatio:n="aspect-video",onPlay:d,onPause:f,onEnded:i,"aria-label":u})=>jsxRuntime.jsx("div",{className:novaCore.cn("tuwadocs:relative tuwadocs:w-full tuwadocs:overflow-hidden tuwadocs:rounded-[var(--tuwa-rounded-corners)] tuwadocs:bg-black tuwadocs:my-4",n,s),children:jsxRuntime.jsxs("video",{src:e,poster:o,controls:a,autoPlay:t,muted:r,loop:c,className:novaCore.cn("tuwadocs:absolute tuwadocs:inset-0 tuwadocs:h-full tuwadocs:w-full tuwadocs:object-contain","tuwadocs:transition-opacity tuwadocs:duration-200","tuwadocs:focus:outline-none tuwadocs:focus:ring-[length:var(--tuwa-ring-width)] tuwadocs:focus:ring-[var(--tuwa-text-accent)] tuwadocs:focus:ring-offset-[length:var(--tuwa-ring-width)] tuwadocs:focus:ring-offset-[var(--tuwa-bg-primary)]"),onPlay:d,onPause:f,onEnded:i,"aria-label":u,preload:"metadata",children:[jsxRuntime.jsx("track",{kind:"captions"}),"Your browser does not support the video tag. Please"," ",jsxRuntime.jsx("a",{href:e,download:true,className:"tuwadocs:text-[var(--tuwa-text-accent)] tuwadocs:underline tuwadocs:hover:opacity-80",children:"download the video"})," ","to watch it."]})});
2
+ exports.CodeBlock=B;exports.CodeHighlighter=G;exports.CopyIconButton=V;exports.Features=Gt;exports.Footer=qt;exports.Navbar=to;exports.PackageInstallationTabs=io;exports.RemoteLogo=x;exports.StyledLink=po;exports.VideoPlayer=ho;exports.baseFooterLinks=A;exports.baseNavLinks=z;Object.keys(novaCore).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return novaCore[k]}})});
package/dist/index.d.cts CHANGED
@@ -52,11 +52,10 @@ declare function Navbar({ links }: NavProps): react.JSX.Element;
52
52
 
53
53
  declare function Footer({ links }: NavProps): react.JSX.Element;
54
54
 
55
- interface LogoProps extends react__default.SVGProps<SVGSVGElement> {
56
- width?: number | string;
57
- height?: number | string;
55
+ interface RemoteLogoProps extends react__default.SVGProps<SVGSVGElement> {
56
+ url?: string;
58
57
  }
59
- declare function Logo({ width, height, className, style, ...props }: LogoProps): react__default.JSX.Element;
58
+ declare function RemoteLogo({ url, className, style, ...props }: RemoteLogoProps): Promise<react__default.JSX.Element>;
60
59
 
61
60
  declare function PackageInstallationTabs({ packagesList, resolvedTheme, }: {
62
61
  packagesList: string;
@@ -136,4 +135,4 @@ declare const baseFooterLinks: {
136
135
  image: react.JSX.Element;
137
136
  }[];
138
137
 
139
- export { CodeBlock, CodeHighlighter, type CodeHighlighterProps, CopyIconButton, Features, Footer, Logo, type LogoProps, type NavProps, Navbar, PackageInstallationTabs, type SocialLink, StyledLink, VideoPlayer, type VideoPlayerProps, baseFooterLinks, baseNavLinks };
138
+ export { CodeBlock, CodeHighlighter, type CodeHighlighterProps, CopyIconButton, Features, Footer, type NavProps, Navbar, PackageInstallationTabs, RemoteLogo, type RemoteLogoProps, type SocialLink, StyledLink, VideoPlayer, type VideoPlayerProps, baseFooterLinks, baseNavLinks };
package/dist/index.d.ts CHANGED
@@ -52,11 +52,10 @@ declare function Navbar({ links }: NavProps): react.JSX.Element;
52
52
 
53
53
  declare function Footer({ links }: NavProps): react.JSX.Element;
54
54
 
55
- interface LogoProps extends react__default.SVGProps<SVGSVGElement> {
56
- width?: number | string;
57
- height?: number | string;
55
+ interface RemoteLogoProps extends react__default.SVGProps<SVGSVGElement> {
56
+ url?: string;
58
57
  }
59
- declare function Logo({ width, height, className, style, ...props }: LogoProps): react__default.JSX.Element;
58
+ declare function RemoteLogo({ url, className, style, ...props }: RemoteLogoProps): Promise<react__default.JSX.Element>;
60
59
 
61
60
  declare function PackageInstallationTabs({ packagesList, resolvedTheme, }: {
62
61
  packagesList: string;
@@ -136,4 +135,4 @@ declare const baseFooterLinks: {
136
135
  image: react.JSX.Element;
137
136
  }[];
138
137
 
139
- export { CodeBlock, CodeHighlighter, type CodeHighlighterProps, CopyIconButton, Features, Footer, Logo, type LogoProps, type NavProps, Navbar, PackageInstallationTabs, type SocialLink, StyledLink, VideoPlayer, type VideoPlayerProps, baseFooterLinks, baseNavLinks };
138
+ export { CodeBlock, CodeHighlighter, type CodeHighlighterProps, CopyIconButton, Features, Footer, type NavProps, Navbar, PackageInstallationTabs, RemoteLogo, type RemoteLogoProps, type SocialLink, StyledLink, VideoPlayer, type VideoPlayerProps, baseFooterLinks, baseNavLinks };
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import {cn,useCopyToClipboard}from'@tuwaio/nova-core';export*from'@tuwaio/nova-core';import {CheckCircleIcon,Square2StackIcon,CommandLineIcon}from'@heroicons/react/24/outline';import {jsx,Fragment,jsxs}from'react/jsx-runtime';import {Prism}from'react-syntax-highlighter';import {materialOceanic,materialLight}from'react-syntax-highlighter/dist/esm/styles/prism';import X from'next/dynamic';import {Footer,Navbar}from'nextra-theme-docs';import et,{useState,useEffect}from'react';import {Tabs}from'nextra/components';function E({isCopied:t,onCopy:o}){return jsx("button",{onClick:o,type:"button",className:cn("tuwadocs:h-6 tuwadocs:w-6 tuwadocs:cursor-pointer tuwadocs:transition-colors",t?"tuwadocs:text-[var(--tuwa-success-icon)]":"tuwadocs:text-[var(--tuwa-text-secondary)] tuwadocs:hover:text-[var(--tuwa-text-primary)]"),children:t?jsx(CheckCircleIcon,{}):jsx(Square2StackIcon,{})})}function V({title:t,titleIcons:o,children:e,textToCopy:r}){let{isCopied:a,copy:c}=useCopyToClipboard(1500);return jsxs("div",{className:cn("tuwadocs:group tuwadocs:overflow-hidden tuwadocs:rounded-[var(--tuwa-rounded-corners)] tuwadocs:border","tuwadocs:border-[var(--tuwa-border-secondary)] tuwadocs:bg-[var(--tuwa-bg-primary)]"),children:[jsxs("div",{className:cn("tuwadocs:flex tuwadocs:items-center tuwadocs:justify-between tuwadocs:gap-4 tuwadocs:px-4 tuwadocs:py-2","tuwadocs:border-b tuwadocs:border-[var(--tuwa-border-secondary)] tuwadocs:bg-[var(--tuwa-bg-secondary)]"),children:[jsxs("div",{className:"tuwadocs:flex tuwadocs:items-center tuwadocs:gap-2",children:[jsx("div",{className:"tuwadocs:h-[20px] tuwadocs:w-[20px] tuwadocs:text-[var(--tuwa-text-secondary)]",children:o}),jsx("p",{className:"tuwadocs:text-sm tuwadocs:font-medium tuwadocs:text-[var(--tuwa-text-primary)]",children:t})]}),jsx("div",{className:"tuwadocs:transition tuwadocs:md:opacity-0 tuwadocs:group-hover:opacity-100",children:jsx(E,{isCopied:a,onCopy:()=>c(r)})})]}),e]})}var J=({children:t})=>jsx(Fragment,{children:t}),m=X(()=>Promise.resolve(J),{ssr:false});function H({children:t,language:o,resolvedTheme:e}){return jsx("div",{className:"tuwadocs:border-t tuwadocs:border-[var(--tuwa-border-secondary)]",children:jsx(m,{children:jsx(Prism,{language:o??"bash",customStyle:{margin:0,background:"transparent"},style:e==="dark"?materialOceanic:materialLight,children:String(t).replace(/\n$/,"")})})})}function Ht({features:t}){return jsx("div",{className:"tuwadocs:grid tuwadocs:grid-cols-1 tuwadocs:md:grid-cols-3 tuwadocs:gap-6 tuwadocs:mt-12",children:t.map(o=>jsxs("div",{className:"tuwadocs:p-6 tuwadocs:border tuwadocs:rounded-[var(--tuwa-rounded-corners)] tuwadocs:hover:shadow-lg tuwadocs:transition-shadow",children:[jsx("div",{className:"tuwadocs:text-2xl tuwadocs:mb-3",children:o.icon}),jsx("h3",{className:"tuwadocs:text-lg tuwadocs:font-semibold tuwadocs:mb-2",children:o.title}),jsx("p",{className:"tuwadocs:text-[var(--tuwa-text-secondary)]",children:o.description})]},o.title))})}var F=[{title:"NPM",href:"https://npmjs.com/org/tuwaio",className:"tuwadocs:hover:text-red-600 tuwadocs:dark:hover:text-red-400",image:jsx("svg",{className:"tuwadocs:w-4 tuwadocs:h-4",fill:"currentColor",viewBox:"0 0 24 24",children:jsx("path",{d:"M1.763 0C.786 0 0 .786 0 1.763v20.474C0 23.214.786 24 1.763 24h20.474c.977 0 1.763-.786 1.763-1.763V1.763C24 .786 23.214 0 22.237 0H1.763zM5.13 5.323l13.837.019-.009 13.836h-3.464l.01-10.382h-3.456L12.04 19.17H5.113l.017-13.847z"})})}],M=[{title:"NPM",href:"https://npmjs.com/org/tuwaio",className:"tuwa-footer-link--npm",image:jsx("svg",{className:"tuwadocs:w-4 tuwadocs:h-4",fill:"currentColor",viewBox:"0 0 24 24",children:jsx("path",{d:"M1.763 0C.786 0 0 .786 0 1.763v20.474C0 23.214.786 24 1.763 24h20.474c.977 0 1.763-.786 1.763-1.763V1.763C24 .786 23.214 0 22.237 0H1.763zM5.13 5.323l13.837.019-.009 13.836h-3.464l.01-10.382h-3.456L12.04 19.17H5.113l.017-13.847z"})})},{title:"GitHub",href:"https://github.com/TuwaIO",className:"tuwa-footer-link--github",image:jsx("svg",{className:"tuwadocs:w-4 tuwadocs:h-4",fill:"currentColor",viewBox:"0 0 24 24",children:jsx("path",{d:"M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"})})}];var rt="https://raw.githubusercontent.com/TuwaIO/workflows/refs/heads/main/preview/tuwa_v1.svg",S=null;function $(t){return t.replace(/-([a-z])/g,o=>o[1].toUpperCase())}function st(t){if(t==="class")return "className";if(t.includes(":")){let o=t.split(":");return o[0]+o[1].charAt(0).toUpperCase()+o[1].slice(1)}return $(t)}function ct(t){let o={};return t.split(";").forEach(e=>{let r=e.trim();if(!r)return;let a=r.indexOf(":");if(a===-1)return;let c=r.slice(0,a).trim(),s=r.slice(a+1).trim();c&&s&&(o[$(c)]=s);}),o}function G(t,o){if(t.nodeType===Node.TEXT_NODE)return t.nodeValue;if(t.nodeType===Node.ELEMENT_NODE){let e=t,r=e.tagName.toLowerCase(),a={};for(let s=0;s<e.attributes.length;s++){let i=e.attributes[s],l=st(i.name);l==="style"?a.style=ct(i.value):a[l]=i.value;}a.key=o;let c=[];for(let s=0;s<e.childNodes.length;s++){let i=G(e.childNodes[s],`${o||"node"}-${s}`);i!==null&&c.push(i);}return et.createElement(r,a,...c)}return null}function x({width:t=120,height:o=40,className:e,style:r,...a}){let[c,s]=useState(null),[i,l]=useState("0 0 620 238");useEffect(()=>{S||(S=fetch(rt).then(d=>{if(!d.ok)throw new Error("Failed to fetch SVG");return d.text()}).catch(d=>(console.error("Error fetching logo SVG:",d),"")));let f=true;return S.then(d=>{if(!(!f||!d))try{let g=new DOMParser().parseFromString(d,"image/svg+xml").querySelector("svg");if(g){let D=g.getAttribute("viewBox")||"0 0 620 238";l(D);let L=[];for(let v=0;v<g.childNodes.length;v++){let B=G(g.childNodes[v],`logo-child-${v}`);B!==null&&L.push(B);}s(L);}}catch(T){console.error("Error parsing logo SVG:",T);}}),()=>{f=false;}},[]);let y={height:r?.height||(o?typeof o=="number"?`${o}px`:o:"auto"),width:t?typeof t=="number"?`${t}px`:t:void 0,...r};return jsx("svg",{viewBox:i,className:e,style:y,...a,children:c})}function Yt({links:t}){return jsx(Footer,{children:jsxs("div",{className:"tuwadocs:flex tuwadocs:w-full tuwadocs:flex-col tuwadocs:items-center tuwadocs:sm:items-start tuwa-footer-border tuwadocs:pt-8",children:[jsxs("div",{className:"tuwadocs:mb-6 tuwadocs:flex tuwadocs:items-center tuwadocs:gap-4 tuwadocs:w-full tuwadocs:justify-between",children:[jsx("div",{className:"tuwadocs:flex tuwadocs:items-center",children:jsx(m,{children:jsx(x,{width:100,height:42,className:"tuwadocs:transition-opacity tuwadocs:duration-300"})})}),jsx("div",{className:"tuwadocs:flex tuwadocs:items-center tuwadocs:gap-4 tuwadocs:text-sm",children:(t??M).map(({title:o,href:e,image:r,className:a})=>jsxs("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:cn("tuwa-footer-link tuwadocs:flex tuwadocs:items-center tuwadocs:gap-1",a),children:[r,jsx("span",{className:"tuwadocs:hidden tuwadocs:sm:inline",children:o})]},o))})]}),jsxs("div",{className:"tuwadocs:w-full tuwa-footer-border tuwadocs:pt-4",children:[jsxs("div",{className:"tuwadocs:flex tuwadocs:flex-col tuwadocs:sm:flex-row tuwadocs:justify-between tuwadocs:items-start tuwadocs:sm:items-center tuwadocs:gap-4",children:[jsxs("div",{className:"tuwadocs:flex-1",children:[jsx("p",{className:"tuwa-footer-description",children:"The modular, headless-first Web3 infrastructure. Build self-custodial applications with zero vendor lock-in."}),jsx("p",{className:"tuwa-footer-license",children:"Licensed under Apache 2.0. Open source and free to use."})]}),jsxs("div",{className:"tuwa-footer-copyright",children:["\xA9 2025 - ",new Date().getFullYear()," TUWA. All rights reserved."]})]}),jsx("div",{className:"tuwadocs:flex tuwadocs:flex-wrap tuwadocs:items-center tuwadocs:gap-3 tuwadocs:mt-4 tuwadocs:pt-4 tuwa-footer-border"})]})]})})}function oo({links:t}){return jsx(Navbar,{logo:jsx(m,{children:jsx(x,{width:105,height:45,className:"tuwadocs:transition-opacity tuwadocs:duration-300"})}),children:jsx("div",{className:"tuwadocs:flex tuwadocs:items-center tuwadocs:gap-3",children:(t??F).map(({title:o,href:e,image:r,className:a})=>jsxs("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:cn("tuwadocs:hidden tuwadocs:sm:flex tuwadocs:items-center tuwadocs:gap-1 tuwadocs:px-3 tuwadocs:py-1.5 tuwadocs:text-sm tuwadocs:font-medium tuwadocs:transition-colors tuwadocs:text-[var(--tuwa-text-primary)]",a),children:[r,o]},o))})})}var _=[{title:"pnpm",command:"pnpm add"},{title:"bun",command:"bun add"},{title:"npm",command:"npm install"},{title:"yarn",command:"yarn add"}];function uo({packagesList:t,resolvedTheme:o}){return jsx("div",{className:"tuwadocs:my-4",children:jsx(Tabs,{items:_.map(e=>e.title),children:_.map(e=>jsx(Tabs.Tab,{children:jsx(V,{title:"Terminal",titleIcons:jsx(CommandLineIcon,{}),textToCopy:`${e.command} ${t}`,children:jsx(H,{resolvedTheme:o,language:"bash",children:`${e.command} ${t}`})})},e.title))})})}function po({href:t,children:o}){return jsx("a",{className:cn("tuwadocs:font-medium tuwadocs:text-[var(--tuwa-text-accent)]","tuwadocs:transition-all tuwadocs:hover:underline tuwadocs:underline-offset-4"),href:t,target:"_blank",rel:"noopener noreferrer",children:o})}var ho=({src:t,poster:o,autoplay:e=false,muted:r=false,loop:a=false,controls:c=true,className:s="",aspectRatio:i="aspect-video",onPlay:l,onPause:y,onEnded:f,"aria-label":d})=>jsx("div",{className:cn("tuwadocs:relative tuwadocs:w-full tuwadocs:overflow-hidden tuwadocs:rounded-[var(--tuwa-rounded-corners)] tuwadocs:bg-black tuwadocs:my-4",i,s),children:jsxs("video",{src:t,poster:o,controls:c,autoPlay:e,muted:r,loop:a,className:cn("tuwadocs:absolute tuwadocs:inset-0 tuwadocs:h-full tuwadocs:w-full tuwadocs:object-contain","tuwadocs:transition-opacity tuwadocs:duration-200","tuwadocs:focus:outline-none tuwadocs:focus:ring-[length:var(--tuwa-ring-width)] tuwadocs:focus:ring-[var(--tuwa-text-accent)] tuwadocs:focus:ring-offset-[length:var(--tuwa-ring-width)] tuwadocs:focus:ring-offset-[var(--tuwa-bg-primary)]"),onPlay:l,onPause:y,onEnded:f,"aria-label":d,preload:"metadata",children:[jsx("track",{kind:"captions"}),"Your browser does not support the video tag. Please"," ",jsx("a",{href:t,download:true,className:"tuwadocs:text-[var(--tuwa-text-accent)] tuwadocs:underline tuwadocs:hover:opacity-80",children:"download the video"})," ","to watch it."]})});
2
- export{V as CodeBlock,H as CodeHighlighter,E as CopyIconButton,Ht as Features,Yt as Footer,x as Logo,oo as Navbar,uo as PackageInstallationTabs,po as StyledLink,ho as VideoPlayer,M as baseFooterLinks,F as baseNavLinks};
1
+ import {cn,useCopyToClipboard}from'@tuwaio/nova-core';export*from'@tuwaio/nova-core';import {CheckCircleIcon,Square2StackIcon,CommandLineIcon}from'@heroicons/react/24/outline';import {jsx,Fragment,jsxs}from'react/jsx-runtime';import {Prism}from'react-syntax-highlighter';import {materialOceanic,materialLight}from'react-syntax-highlighter/dist/esm/styles/prism';import J from'next/dynamic';import {Footer,Navbar}from'nextra-theme-docs';import at from'react';import {Tabs}from'nextra/components';function V({isCopied:e,onCopy:o}){return jsx("button",{onClick:o,type:"button",className:cn("tuwadocs:h-6 tuwadocs:w-6 tuwadocs:cursor-pointer tuwadocs:transition-colors",e?"tuwadocs:text-[var(--tuwa-success-icon)]":"tuwadocs:text-[var(--tuwa-text-secondary)] tuwadocs:hover:text-[var(--tuwa-text-primary)]"),children:e?jsx(CheckCircleIcon,{}):jsx(Square2StackIcon,{})})}function B({title:e,titleIcons:o,children:t,textToCopy:r}){let{isCopied:c,copy:a}=useCopyToClipboard(1500);return jsxs("div",{className:cn("tuwadocs:group tuwadocs:overflow-hidden tuwadocs:rounded-[var(--tuwa-rounded-corners)] tuwadocs:border","tuwadocs:border-[var(--tuwa-border-secondary)] tuwadocs:bg-[var(--tuwa-bg-primary)]"),children:[jsxs("div",{className:cn("tuwadocs:flex tuwadocs:items-center tuwadocs:justify-between tuwadocs:gap-4 tuwadocs:px-4 tuwadocs:py-2","tuwadocs:border-b tuwadocs:border-[var(--tuwa-border-secondary)] tuwadocs:bg-[var(--tuwa-bg-secondary)]"),children:[jsxs("div",{className:"tuwadocs:flex tuwadocs:items-center tuwadocs:gap-2",children:[jsx("div",{className:"tuwadocs:h-[20px] tuwadocs:w-[20px] tuwadocs:text-[var(--tuwa-text-secondary)]",children:o}),jsx("p",{className:"tuwadocs:text-sm tuwadocs:font-medium tuwadocs:text-[var(--tuwa-text-primary)]",children:e})]}),jsx("div",{className:"tuwadocs:transition tuwadocs:md:opacity-0 tuwadocs:group-hover:opacity-100",children:jsx(V,{isCopied:c,onCopy:()=>a(r)})})]}),t]})}var K=({children:e})=>jsx(Fragment,{children:e}),p=J(()=>Promise.resolve(K),{ssr:false});function G({children:e,language:o,resolvedTheme:t}){return jsx("div",{className:"tuwadocs:border-t tuwadocs:border-[var(--tuwa-border-secondary)]",children:jsx(p,{children:jsx(Prism,{language:o??"bash",customStyle:{margin:0,background:"transparent"},style:t==="dark"?materialOceanic:materialLight,children:String(e).replace(/\n$/,"")})})})}function Gt({features:e}){return jsx("div",{className:"tuwadocs:grid tuwadocs:grid-cols-1 tuwadocs:md:grid-cols-3 tuwadocs:gap-6 tuwadocs:mt-12",children:e.map(o=>jsxs("div",{className:"tuwadocs:p-6 tuwadocs:border tuwadocs:rounded-[var(--tuwa-rounded-corners)] tuwadocs:hover:shadow-lg tuwadocs:transition-shadow",children:[jsx("div",{className:"tuwadocs:text-2xl tuwadocs:mb-3",children:o.icon}),jsx("h3",{className:"tuwadocs:text-lg tuwadocs:font-semibold tuwadocs:mb-2",children:o.title}),jsx("p",{className:"tuwadocs:text-[var(--tuwa-text-secondary)]",children:o.description})]},o.title))})}var z=[{title:"NPM",href:"https://npmjs.com/org/tuwaio",className:"tuwadocs:hover:text-red-600 tuwadocs:dark:hover:text-red-400",image:jsx("svg",{className:"tuwadocs:w-4 tuwadocs:h-4",fill:"currentColor",viewBox:"0 0 24 24",children:jsx("path",{d:"M1.763 0C.786 0 0 .786 0 1.763v20.474C0 23.214.786 24 1.763 24h20.474c.977 0 1.763-.786 1.763-1.763V1.763C24 .786 23.214 0 22.237 0H1.763zM5.13 5.323l13.837.019-.009 13.836h-3.464l.01-10.382h-3.456L12.04 19.17H5.113l.017-13.847z"})})}],A=[{title:"NPM",href:"https://npmjs.com/org/tuwaio",className:"tuwa-footer-link--npm",image:jsx("svg",{className:"tuwadocs:w-4 tuwadocs:h-4",fill:"currentColor",viewBox:"0 0 24 24",children:jsx("path",{d:"M1.763 0C.786 0 0 .786 0 1.763v20.474C0 23.214.786 24 1.763 24h20.474c.977 0 1.763-.786 1.763-1.763V1.763C24 .786 23.214 0 22.237 0H1.763zM5.13 5.323l13.837.019-.009 13.836h-3.464l.01-10.382h-3.456L12.04 19.17H5.113l.017-13.847z"})})},{title:"GitHub",href:"https://github.com/TuwaIO",className:"tuwa-footer-link--github",image:jsx("svg",{className:"tuwadocs:w-4 tuwadocs:h-4",fill:"currentColor",viewBox:"0 0 24 24",children:jsx("path",{d:"M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"})})}];var st="https://raw.githubusercontent.com/TuwaIO/workflows/refs/heads/main/preview/logo_v1.svg";function E(e){return e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase())}function rt(e){let o={};return e.split(";").forEach(t=>{let r=t.trim();if(!r)return;let c=r.indexOf(":");if(c===-1)return;let a=r.slice(0,c).trim(),s=r.slice(c+1).trim();a&&s&&(o[E(a)]=s);}),o}function F(e){if(e==="class")return "className";if(e.includes(":")){let[o,t]=e.split(":");return o+t.charAt(0).toUpperCase()+t.slice(1)}return E(e)}function ct(e){let o=[],t=[],r=/(<!--[\s\S]*?-->)|(<\s*\/\s*([a-zA-Z0-9:-]+)\s*>)|(<\s*([a-zA-Z0-9:-]+)([^>]*?)\/?>)|([^<]+)/g,c=/([a-zA-Z0-9:-]+)\s*=\s*(?:"([^"]*?)"|'([^']*?)')/g,a;for(;(a=r.exec(e))!==null;)if(!a[1]){if(a[2]){let s=a[3].toLowerCase(),n=[];for(;t.length>0&&t[t.length-1].tag!==s;)n.push(t.pop());if(t.length>0){let d=t.pop();d.children=[...n.reverse(),...d.children],t.length>0?t[t.length-1].children.push(d):o.push(d);}else for(;n.length>0;)t.push(n.pop());continue}if(a[4]){let s=a[5].toLowerCase(),n=a[6],d=a[4].endsWith("/>")||a[4].endsWith("/ >"),f={},i;for(;(i=c.exec(n))!==null;)f[i[1]]=i[2]||i[3]||"";let u={tag:s,attrs:f,children:[]};d?t.length>0?t[t.length-1].children.push(u):o.push(u):t.push(u);continue}if(a[7]){let s=a[7].trim();s&&(t.length>0?t[t.length-1].children.push(s):o.push(s));}}for(;t.length>0;){let s=t.pop();t.length>0?t[t.length-1].children.push(s):o.push(s);}return o.filter(s=>typeof s!="string")}function M(e,o){let t=e.tag;if(t==="script")return null;let r={key:o};for(let[a,s]of Object.entries(e.attrs)){let n=F(a);n==="style"?r.style=rt(s):r[n]=s;}let c=e.children.map((a,s)=>typeof a=="string"?a:M(a,`${o}-${s}`)).filter(Boolean);return at.createElement(t,r,...c)}async function x({url:e=st,className:o,style:t,...r}){let c=null,a={},s=false;try{let n=await fetch(e,{next:{revalidate:86400}});if(!n.ok)throw new Error(`Failed to fetch SVG from remote source: ${n.status}`);let i=(await n.text()).replace(/<!--[\s\S]*?-->/g,"").replace(/<\?xml[\s\S]*?\?>/g,"").trim().match(/<svg([^>]*?)>([\s\S]*?)<\/svg>/i);if(!i)throw new Error("Invalid or corrupted SVG layout payload");let u=i[1],U=i[2],T={},W=/([a-zA-Z0-9:-]+)\s*=\s*(?:"([^"]*?)"|'([^']*?)')/g,h;for(;(h=W.exec(u))!==null;){let y=h[1],S=h[2]||h[3]||"",C=F(y);C!=="className"&&C!=="style"&&(T[C]=S);}a=T,c=ct(U).map((y,S)=>M(y,`logo-node-${S}`));}catch(n){console.error("Core/UI Runtime Error fetching remote SVG:",n),s=true;}return s?jsx("svg",{className:o,style:t,...r}):jsx("svg",{...a,className:o,style:t,...r,children:c})}function qt({links:e}){return jsx(Footer,{children:jsxs("div",{className:"tuwadocs:flex tuwadocs:w-full tuwadocs:flex-col tuwadocs:items-center tuwadocs:sm:items-start tuwa-footer-border tuwadocs:pt-8",children:[jsxs("div",{className:"tuwadocs:mb-6 tuwadocs:flex tuwadocs:items-center tuwadocs:gap-4 tuwadocs:w-full tuwadocs:justify-between",children:[jsx("div",{className:"tuwadocs:flex tuwadocs:items-center",children:jsx(p,{children:jsx(x,{width:100,height:42,className:"tuwadocs:transition-opacity tuwadocs:duration-300"})})}),jsx("div",{className:"tuwadocs:flex tuwadocs:items-center tuwadocs:gap-4 tuwadocs:text-sm",children:(e??A).map(({title:o,href:t,image:r,className:c})=>jsxs("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:cn("tuwa-footer-link tuwadocs:flex tuwadocs:items-center tuwadocs:gap-1",c),children:[r,jsx("span",{className:"tuwadocs:hidden tuwadocs:sm:inline",children:o})]},o))})]}),jsxs("div",{className:"tuwadocs:w-full tuwa-footer-border tuwadocs:pt-4",children:[jsxs("div",{className:"tuwadocs:flex tuwadocs:flex-col tuwadocs:sm:flex-row tuwadocs:justify-between tuwadocs:items-start tuwadocs:sm:items-center tuwadocs:gap-4",children:[jsxs("div",{className:"tuwadocs:flex-1",children:[jsx("p",{className:"tuwa-footer-description",children:"The modular, headless-first Web3 infrastructure. Build self-custodial applications with zero vendor lock-in."}),jsx("p",{className:"tuwa-footer-license",children:"Licensed under Apache 2.0. Open source and free to use."})]}),jsxs("div",{className:"tuwa-footer-copyright",children:["\xA9 2025 - ",new Date().getFullYear()," TUWA. All rights reserved."]})]}),jsx("div",{className:"tuwadocs:flex tuwadocs:flex-wrap tuwadocs:items-center tuwadocs:gap-3 tuwadocs:mt-4 tuwadocs:pt-4 tuwa-footer-border"})]})]})})}function to({links:e}){return jsx(Navbar,{logo:jsx(p,{children:jsx(x,{width:105,height:45,className:"tuwadocs:transition-opacity tuwadocs:duration-300"})}),children:jsx("div",{className:"tuwadocs:flex tuwadocs:items-center tuwadocs:gap-3",children:(e??z).map(({title:o,href:t,image:r,className:c})=>jsxs("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:cn("tuwadocs:hidden tuwadocs:sm:flex tuwadocs:items-center tuwadocs:gap-1 tuwadocs:px-3 tuwadocs:py-1.5 tuwadocs:text-sm tuwadocs:font-medium tuwadocs:transition-colors tuwadocs:text-[var(--tuwa-text-primary)]",c),children:[r,o]},o))})})}var O=[{title:"pnpm",command:"pnpm add"},{title:"bun",command:"bun add"},{title:"npm",command:"npm install"},{title:"yarn",command:"yarn add"}];function io({packagesList:e,resolvedTheme:o}){return jsx("div",{className:"tuwadocs:my-4",children:jsx(Tabs,{items:O.map(t=>t.title),children:O.map(t=>jsx(Tabs.Tab,{children:jsx(B,{title:"Terminal",titleIcons:jsx(CommandLineIcon,{}),textToCopy:`${t.command} ${e}`,children:jsx(G,{resolvedTheme:o,language:"bash",children:`${t.command} ${e}`})})},t.title))})})}function po({href:e,children:o}){return jsx("a",{className:cn("tuwadocs:font-medium tuwadocs:text-[var(--tuwa-text-accent)]","tuwadocs:transition-all tuwadocs:hover:underline tuwadocs:underline-offset-4"),href:e,target:"_blank",rel:"noopener noreferrer",children:o})}var ho=({src:e,poster:o,autoplay:t=false,muted:r=false,loop:c=false,controls:a=true,className:s="",aspectRatio:n="aspect-video",onPlay:d,onPause:f,onEnded:i,"aria-label":u})=>jsx("div",{className:cn("tuwadocs:relative tuwadocs:w-full tuwadocs:overflow-hidden tuwadocs:rounded-[var(--tuwa-rounded-corners)] tuwadocs:bg-black tuwadocs:my-4",n,s),children:jsxs("video",{src:e,poster:o,controls:a,autoPlay:t,muted:r,loop:c,className:cn("tuwadocs:absolute tuwadocs:inset-0 tuwadocs:h-full tuwadocs:w-full tuwadocs:object-contain","tuwadocs:transition-opacity tuwadocs:duration-200","tuwadocs:focus:outline-none tuwadocs:focus:ring-[length:var(--tuwa-ring-width)] tuwadocs:focus:ring-[var(--tuwa-text-accent)] tuwadocs:focus:ring-offset-[length:var(--tuwa-ring-width)] tuwadocs:focus:ring-offset-[var(--tuwa-bg-primary)]"),onPlay:d,onPause:f,onEnded:i,"aria-label":u,preload:"metadata",children:[jsx("track",{kind:"captions"}),"Your browser does not support the video tag. Please"," ",jsx("a",{href:e,download:true,className:"tuwadocs:text-[var(--tuwa-text-accent)] tuwadocs:underline tuwadocs:hover:opacity-80",children:"download the video"})," ","to watch it."]})});
2
+ export{B as CodeBlock,G as CodeHighlighter,V as CopyIconButton,Gt as Features,qt as Footer,to as Navbar,io as PackageInstallationTabs,x as RemoteLogo,po as StyledLink,ho as VideoPlayer,A as baseFooterLinks,z as baseNavLinks};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tuwaio/docs-ui",
3
- "version": "0.0.10",
3
+ "version": "0.0.12",
4
4
  "private": false,
5
5
  "author": "Oleksandr Tkach",
6
6
  "license": "Apache-2.0",