boltdocs 2.7.1 → 2.7.3
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/client/index.cjs +1 -1
- package/dist/client/index.d.ts +2 -2
- package/dist/client/index.js +1 -1
- package/dist/client/mdx.cjs +1 -1
- package/dist/client/mdx.d.ts +1 -1
- package/dist/client/mdx.js +1 -1
- package/dist/client/primitives.cjs +1 -1
- package/dist/client/primitives.d.ts +1 -1
- package/dist/client/primitives.js +1 -1
- package/dist/docs-layout-CCUDPQ8O.js +6 -0
- package/dist/docs-layout-CZVMDgr-.cjs +6 -0
- package/dist/icons-dev-B_RZIyxu.js +6 -0
- package/dist/icons-dev-BlV3wWFT.cjs +6 -0
- package/dist/image-BHhTvQzr.cjs +6 -0
- package/dist/image-CqKzYD8f.js +6 -0
- package/dist/mdx-DudBEac0.js +7 -0
- package/dist/mdx-r4cDQxWu.cjs +7 -0
- package/dist/node/cli-entry.cjs +1 -1
- package/dist/node/cli-entry.mjs +1 -1
- package/dist/node/index.cjs +1 -1
- package/dist/node/index.mjs +1 -1
- package/dist/{node-m6fKXXVs.mjs → node-B4l6Gy6w.mjs} +2 -2
- package/dist/{node-BzKYJJuY.cjs → node-DZ2zoj3e.cjs} +2 -2
- package/dist/{package-D1O_gJub.cjs → package-CVrquPhu.cjs} +1 -1
- package/dist/{package-2TVh81ZC.mjs → package-DK5Olmvh.mjs} +1 -1
- package/dist/search-dialog-B584t9ZF.js +6 -0
- package/dist/search-dialog-BvBopRsZ.cjs +6 -0
- package/dist/search-dialog-ByvGScjt.js +6 -0
- package/dist/{search-dialog-CGyrozZE.cjs → search-dialog-Cyko6TJm.cjs} +1 -1
- package/dist/search-dialog-D6BNohIJ.js +6 -0
- package/dist/search-dialog-DuYTIefy.cjs +6 -0
- package/package.json +2 -3
- package/src/client/app/scroll-handler.tsx +32 -12
- package/src/client/components/mdx/callout.tsx +1 -1
- package/src/client/components/mdx/code-block.tsx +1 -1
- package/src/client/components/primitives/breadcrumbs.tsx +1 -1
- package/src/client/components/primitives/heading.tsx +1 -1
- package/src/client/components/primitives/menu.tsx +1 -1
- package/src/client/components/primitives/navbar.tsx +1 -1
- package/src/client/components/primitives/page-nav.tsx +1 -1
- package/src/client/components/primitives/search-dialog.tsx +1 -1
- package/src/client/components/primitives/sidebar.tsx +3 -3
- package/src/client/components/ui-base/banner.tsx +1 -1
- package/src/client/components/ui-base/breadcrumbs.tsx +1 -1
- package/src/client/components/ui-base/copy-markdown.tsx +1 -1
- package/src/client/components/ui-base/icons.tsx +240 -0
- package/src/client/components/ui-base/navbar.tsx +1 -1
- package/src/client/components/ui-base/not-found.tsx +1 -1
- package/src/client/components/ui-base/on-this-page.tsx +1 -1
- package/src/client/components/ui-base/search-dialog.tsx +1 -1
- package/src/client/components/ui-base/sidebar.tsx +2 -2
- package/src/client/components/ui-base/tabs.tsx +6 -4
- package/src/client/components/ui-base/theme-toggle.tsx +1 -1
- package/src/client/components/ui-base/version-i18n.tsx +1 -1
- package/dist/docs-layout-BlDhcQRv.cjs +0 -6
- package/dist/docs-layout-BvAOWEJw.js +0 -6
- package/dist/icons-dev-CrQLjoQp.js +0 -6
- package/dist/icons-dev-rzdz6Lf3.cjs +0 -6
- package/dist/image-BkIfa9oo.js +0 -6
- package/dist/image-DIGjCPe6.cjs +0 -6
- package/dist/mdx-K0WYBAJ3.js +0 -7
- package/dist/mdx-hpErbRUe.cjs +0 -7
- package/dist/search-dialog-BACuzoVX.cjs +0 -6
- package/dist/search-dialog-BKagVT17.js +0 -6
- package/dist/search-dialog-C8w12eUx.js +0 -6
- package/dist/search-dialog-D26rUnJ_.cjs +0 -6
- /package/dist/{cards-BLoSiRuL.d.ts → cards-BakZPTz9.d.ts} +0 -0
- /package/dist/{sidebar-Dr1TiRIy.d.ts → sidebar-CbQtlYiz.d.ts} +0 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Boltdocs - https://boltdocs.vercel.app
|
|
3
|
+
* Copyright (c) 2026 Jesus Alcala
|
|
4
|
+
* Licensed under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
const e=require(`./icons-dev-BlV3wWFT.cjs`);let t=require(`react`),n=require(`react/jsx-runtime`),r=require(`react-aria-components`);r=e.rt(r);const i=({children:t,className:r,...i})=>(0,n.jsx)(`header`,{className:e.y(`boltdocs-navbar sticky top-0 z-50 w-full`,r),...i,children:t}),a=({children:t,className:r})=>(0,n.jsx)(`div`,{className:e.y(`mx-auto flex lg:h-navbar max-w-(--breakpoint-3xl) items-center justify-between px-4 md:px-6`,r),children:t}),o=({children:t,className:r})=>(0,n.jsx)(`div`,{className:e.y(`flex flex-1 items-center justify-start gap-4 min-w-0`,r),children:t}),s=({children:t,className:r})=>(0,n.jsx)(`div`,{className:e.y(`flex flex-1 items-center justify-end gap-2 md:gap-4 min-w-0`,r),children:t}),c=({children:t,className:r})=>(0,n.jsx)(`div`,{className:e.y(`hidden lg:flex flex-1 justify-center items-center gap-4 px-4 min-w-0 w-full`,r),children:t}),l=({src:t,alt:r,width:i=24,height:a=24,className:o,href:s=`/`})=>(0,n.jsx)(e._,{href:s,className:e.y(`flex items-center gap-2 shrink-0 outline-none`,o),children:t?(0,n.jsx)(`img`,{src:t,alt:r,width:i,height:a,className:`h-6 w-6 object-contain`}):null}),u=({children:t,className:r,href:i=`/`})=>(0,n.jsx)(e._,{href:i,children:(0,n.jsx)(`span`,{className:e.y(`text-lg font-bold tracking-tight hidden sm:inline-block`,r),children:t})}),d=({children:t,className:r})=>(0,n.jsx)(`nav`,{className:e.y(`hidden md:flex items-center gap-6 text-sm font-medium`,r),children:t}),f=({label:t,href:r,to:i,className:a})=>(0,n.jsxs)(e._,{href:r,target:i===`external`?`_blank`:void 0,className:e.y(`transition-all outline-none`,a),children:[t,i===`external`&&(0,n.jsx)(`span`,{className:`ml-1 inline-block`,children:(0,n.jsx)(e.j,{size:12})})]}),p=({label:r,className:i,children:a})=>{let[o,s]=(0,t.useState)(!1);return(0,n.jsxs)(`div`,{className:e.y(`relative`,i),onMouseEnter:()=>{s(!0)},onMouseLeave:()=>{s(!1)},children:[(0,n.jsxs)(`div`,{className:e.y(`flex items-center gap-1 outline-none cursor-pointer select-none font-medium text-muted hover:text-body transition-colors`),children:[r,(0,n.jsx)(`svg`,{className:e.y(`w-4 h-4 transition-transform`,o&&`rotate-180`),fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,children:(0,n.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M19 9l-7 7-7-7`})})]}),o&&(0,n.jsx)(`div`,{className:`absolute top-full left-0 pt-1 z-[9999]`,children:(0,n.jsx)(`div`,{className:`min-w-[180px] p-1 bg-surface border border-subtle rounded-md shadow-lg`,children:a})})]})},m=({href:t,label:r,className:i})=>(0,n.jsx)(e._,{href:t,className:e.y(`block px-2 py-1.5 rounded hover:bg-surface`,i),children:r}),h={Desktop:({className:t,onPress:i,children:a})=>(0,n.jsx)(r.Button,{onPress:i,className:e.y(`hidden lg:flex items-center justify-between gap-2 px-3 py-2 text-sm outline-none cursor-pointer w-full max-w-[720px]`,t),children:a}),Mobile:({className:t,onPress:i,children:a})=>(0,n.jsx)(r.Button,{onPress:i,className:e.y(`lg:hidden flex h-10 w-10 items-center justify-center outline-none cursor-pointer`,t),"aria-label":`Search`,children:a}),Kbd:({className:r})=>{let[i,a]=(0,t.useState)(!1),o=i&&/Mac|iPod|iPhone|iPad/.test(navigator.platform);return(0,t.useEffect)(()=>{a(!0)},[]),(0,n.jsxs)(`div`,{className:e.y(`hidden sm:flex items-center gap-1 pointer-events-none select-none`,r),children:[(0,n.jsx)(`kbd`,{className:`flex items-center justify-center font-mono text-[10px]`,children:o?`⌘`:`Ctrl`}),(0,n.jsx)(`kbd`,{className:`flex items-center justify-center font-mono text-[10px]`,children:`K`})]})}},g=({className:t,theme:i,onThemeChange:a})=>(0,n.jsx)(r.ToggleButton,{isSelected:i===`dark`,onChange:a,className:e.y(`outline-none cursor-pointer`,t),"aria-label":`Toggle theme`,children:i===`dark`?(0,n.jsx)(e.K,{size:20}):(0,n.jsx)(e.H,{size:20})}),_=({name:t})=>{if(t===`github`)return(0,n.jsx)(e.s,{});if(t===`discord`)return(0,n.jsx)(e.o,{});if(t===`x`)return(0,n.jsx)(e.h,{});if(t===`bluesky`)return(0,n.jsx)(e.t,{})};i.Root=i,i.Left=o,i.Right=s,i.Center=c,i.Logo=l,i.Title=u,i.Links=d,i.Link=f,i.Dropdown=p,i.DropdownItem=m,i.SearchTrigger=h,i.Theme=g,i.Socials=({icon:t,link:r,className:i})=>(0,n.jsx)(e._,{href:r,target:`_blank`,rel:`noopener noreferrer`,className:e.y(`outline-none`,i),children:(0,n.jsx)(_,{name:t})}),i.Split=({className:t})=>(0,n.jsx)(r.Separator,{orientation:`vertical`,className:e.y(`h-full w-px`,t)}),i.Content=a,i.More=({onPress:t,className:i})=>(0,n.jsx)(r.Button,{onPress:t,className:e.y(`md:hidden flex items-center justify-center outline-none cursor-pointer`,i),"aria-label":`More navigation`,children:(0,n.jsx)(e.U,{size:20})}),i.MobileMenu=({isOpen:t,onClose:i,children:a,className:o})=>(0,n.jsx)(r.ModalOverlay,{isOpen:t,onOpenChange:e=>!e&&i(),isDismissable:!0,className:e.y(`fixed inset-0 z-60 md:hidden transition-all duration-100`,o),children:(0,n.jsx)(r.Modal,{className:`fixed inset-0 outline-none`,children:(0,n.jsxs)(r.Dialog,{className:`relative h-full outline-none flex flex-col p-6 pt-[calc(1.5rem+env(safe-area-inset-top,0px))] pb-[calc(1.5rem+env(safe-area-inset-bottom,0px))] px-[calc(1.5rem+env(safe-area-inset-left,0px))]`,children:[(0,n.jsxs)(`div`,{className:`flex items-center justify-between mb-6`,children:[(0,n.jsx)(`span`,{}),(0,n.jsx)(r.Button,{onPress:i,className:`flex items-center justify-center outline-none cursor-pointer text-muted hover:text-body transition-colors`,"aria-label":`Close menu`,children:(0,n.jsx)(e.J,{size:24})})]}),(0,n.jsx)(`nav`,{className:`flex-1 overflow-y-auto flex flex-col gap-4`,children:a})]})})}),i.MobileLink=({label:t,href:r,to:i,onPress:a,className:o})=>(0,n.jsx)(e._,{href:r,target:i===`external`?`_blank`:void 0,onClick:a,className:e.y(`group flex items-center outline-none`,o),children:t});const v=({className:t,...i})=>(0,n.jsx)(r.ModalOverlay,{className:e.y(`fixed inset-0 z-100`,t),...i});v.Root=v,v.Overlay=v,v.Content=({className:t,...i})=>(0,n.jsx)(r.Modal,{className:e.y(t),...i}),v.Dialog=({className:t,...i})=>(0,n.jsx)(r.Dialog,{className:e.y(`flex flex-col focus:outline-none`,t),...i}),v.Autocomplete=({children:t,className:i,onSelectionChange:a,...o})=>{let s=r.Autocomplete;return(0,n.jsx)(`div`,{className:e.y(`flex-1 min-h-0`,i),children:(0,n.jsx)(s,{...o,onSelectionChange:a,className:`flex flex-col min-h-0`,children:t})})},v.List=({children:t,className:i,...a})=>(0,n.jsx)(r.ListBox,{...a,className:e.y(`flex-1 overflow-y-auto outline-none min-h-0`,i),children:t}),v.Input=Object.assign(({className:t,...i})=>(0,n.jsx)(r.SearchField,{className:e.y(`flex items-center`,t),...i}),{SearchInput:({className:t,...i})=>(0,n.jsx)(r.Input,{className:e.y(`w-full bg-transparent outline-none border-none`,t),...i}),Button:({className:t,...i})=>(0,n.jsx)(r.Button,{slot:`clear`,className:e.y(t),...i})}),v.Item=Object.assign(({children:t,className:i,...a})=>(0,n.jsx)(r.ListBoxItem,{...a,className:e.y(`group flex items-center outline-none cursor-pointer`,i),children:r=>(0,n.jsxs)(n.Fragment,{children:[t,(r.isFocused||r.isSelected)&&(0,n.jsxs)(`div`,{className:`ml-auto opacity-50 flex items-center gap-1`,children:[(0,n.jsx)(`span`,{className:`text-[10px]`,children:`Select`}),(0,n.jsx)(e.A,{size:10})]})]})}),{Icon:({isHeading:t,className:r})=>(0,n.jsx)(`div`,{className:e.y(`shrink-0`,r),children:t?(0,n.jsx)(e.P,{size:18}):(0,n.jsx)(e.N,{size:18})}),Title:({children:t,className:r})=>(0,n.jsx)(`span`,{className:e.y(`block truncate flex-1`,r),children:t}),Bio:({children:t,className:r})=>(0,n.jsx)(`span`,{className:e.y(`ml-2 truncate hidden sm:inline`,r),children:t})}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return v}});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Boltdocs - https://boltdocs.vercel.app
|
|
3
|
+
* Copyright (c) 2026 Jesus Alcala
|
|
4
|
+
* Licensed under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
import{A as e,H as t,J as n,K as r,N as i,P as a,U as o,_ as s,h as c,j as l,o as u,s as d,t as f,y as p}from"./icons-dev-B_RZIyxu.js";import{useEffect as m,useState as h}from"react";import{Fragment as g,jsx as _,jsxs as v}from"react/jsx-runtime";import*as y from"react-aria-components";import{Button as b,Dialog as x,Modal as S,ModalOverlay as C,Separator as w,ToggleButton as T}from"react-aria-components";const E=({children:e,className:t,...n})=>_(`header`,{className:p(`boltdocs-navbar sticky top-0 z-50 w-full`,t),...n,children:e}),D=({children:e,className:t})=>_(`div`,{className:p(`mx-auto flex lg:h-navbar max-w-(--breakpoint-3xl) items-center justify-between px-4 md:px-6`,t),children:e}),O=({children:e,className:t})=>_(`div`,{className:p(`flex flex-1 items-center justify-start gap-4 min-w-0`,t),children:e}),k=({children:e,className:t})=>_(`div`,{className:p(`flex flex-1 items-center justify-end gap-2 md:gap-4 min-w-0`,t),children:e}),A=({children:e,className:t})=>_(`div`,{className:p(`hidden lg:flex flex-1 justify-center items-center gap-4 px-4 min-w-0 w-full`,t),children:e}),j=({src:e,alt:t,width:n=24,height:r=24,className:i,href:a=`/`})=>_(s,{href:a,className:p(`flex items-center gap-2 shrink-0 outline-none`,i),children:e?_(`img`,{src:e,alt:t,width:n,height:r,className:`h-6 w-6 object-contain`}):null}),M=({children:e,className:t,href:n=`/`})=>_(s,{href:n,children:_(`span`,{className:p(`text-lg font-bold tracking-tight hidden sm:inline-block`,t),children:e})}),N=({children:e,className:t})=>_(`nav`,{className:p(`hidden md:flex items-center gap-6 text-sm font-medium`,t),children:e}),P=({label:e,href:t,to:n,className:r})=>v(s,{href:t,target:n===`external`?`_blank`:void 0,className:p(`transition-all outline-none`,r),children:[e,n===`external`&&_(`span`,{className:`ml-1 inline-block`,children:_(l,{size:12})})]}),F=({label:e,className:t,children:n})=>{let[r,i]=h(!1);return v(`div`,{className:p(`relative`,t),onMouseEnter:()=>{i(!0)},onMouseLeave:()=>{i(!1)},children:[v(`div`,{className:p(`flex items-center gap-1 outline-none cursor-pointer select-none font-medium text-muted hover:text-body transition-colors`),children:[e,_(`svg`,{className:p(`w-4 h-4 transition-transform`,r&&`rotate-180`),fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,children:_(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M19 9l-7 7-7-7`})})]}),r&&_(`div`,{className:`absolute top-full left-0 pt-1 z-[9999]`,children:_(`div`,{className:`min-w-[180px] p-1 bg-surface border border-subtle rounded-md shadow-lg`,children:n})})]})},I=({href:e,label:t,className:n})=>_(s,{href:e,className:p(`block px-2 py-1.5 rounded hover:bg-surface`,n),children:t}),L={Desktop:({className:e,onPress:t,children:n})=>_(b,{onPress:t,className:p(`hidden lg:flex items-center justify-between gap-2 px-3 py-2 text-sm outline-none cursor-pointer w-full max-w-[720px]`,e),children:n}),Mobile:({className:e,onPress:t,children:n})=>_(b,{onPress:t,className:p(`lg:hidden flex h-10 w-10 items-center justify-center outline-none cursor-pointer`,e),"aria-label":`Search`,children:n}),Kbd:({className:e})=>{let[t,n]=h(!1),r=t&&/Mac|iPod|iPhone|iPad/.test(navigator.platform);return m(()=>{n(!0)},[]),v(`div`,{className:p(`hidden sm:flex items-center gap-1 pointer-events-none select-none`,e),children:[_(`kbd`,{className:`flex items-center justify-center font-mono text-[10px]`,children:r?`⌘`:`Ctrl`}),_(`kbd`,{className:`flex items-center justify-center font-mono text-[10px]`,children:`K`})]})}},R=({className:e,theme:n,onThemeChange:i})=>_(T,{isSelected:n===`dark`,onChange:i,className:p(`outline-none cursor-pointer`,e),"aria-label":`Toggle theme`,children:_(n===`dark`?r:t,{size:20})}),z=({name:e})=>{if(e===`github`)return _(d,{});if(e===`discord`)return _(u,{});if(e===`x`)return _(c,{});if(e===`bluesky`)return _(f,{})};E.Root=E,E.Left=O,E.Right=k,E.Center=A,E.Logo=j,E.Title=M,E.Links=N,E.Link=P,E.Dropdown=F,E.DropdownItem=I,E.SearchTrigger=L,E.Theme=R,E.Socials=({icon:e,link:t,className:n})=>_(s,{href:t,target:`_blank`,rel:`noopener noreferrer`,className:p(`outline-none`,n),children:_(z,{name:e})}),E.Split=({className:e})=>_(w,{orientation:`vertical`,className:p(`h-full w-px`,e)}),E.Content=D,E.More=({onPress:e,className:t})=>_(b,{onPress:e,className:p(`md:hidden flex items-center justify-center outline-none cursor-pointer`,t),"aria-label":`More navigation`,children:_(o,{size:20})}),E.MobileMenu=({isOpen:e,onClose:t,children:r,className:i})=>_(C,{isOpen:e,onOpenChange:e=>!e&&t(),isDismissable:!0,className:p(`fixed inset-0 z-60 md:hidden transition-all duration-100`,i),children:_(S,{className:`fixed inset-0 outline-none`,children:v(x,{className:`relative h-full outline-none flex flex-col p-6 pt-[calc(1.5rem+env(safe-area-inset-top,0px))] pb-[calc(1.5rem+env(safe-area-inset-bottom,0px))] px-[calc(1.5rem+env(safe-area-inset-left,0px))]`,children:[v(`div`,{className:`flex items-center justify-between mb-6`,children:[_(`span`,{}),_(b,{onPress:t,className:`flex items-center justify-center outline-none cursor-pointer text-muted hover:text-body transition-colors`,"aria-label":`Close menu`,children:_(n,{size:24})})]}),_(`nav`,{className:`flex-1 overflow-y-auto flex flex-col gap-4`,children:r})]})})}),E.MobileLink=({label:e,href:t,to:n,onPress:r,className:i})=>_(s,{href:t,target:n===`external`?`_blank`:void 0,onClick:r,className:p(`group flex items-center outline-none`,i),children:e});const B=({className:e,...t})=>_(y.ModalOverlay,{className:p(`fixed inset-0 z-100`,e),...t});B.Root=B,B.Overlay=B,B.Content=({className:e,...t})=>_(y.Modal,{className:p(e),...t}),B.Dialog=({className:e,...t})=>_(y.Dialog,{className:p(`flex flex-col focus:outline-none`,e),...t}),B.Autocomplete=({children:e,className:t,onSelectionChange:n,...r})=>{let i=y.Autocomplete;return _(`div`,{className:p(`flex-1 min-h-0`,t),children:_(i,{...r,onSelectionChange:n,className:`flex flex-col min-h-0`,children:e})})},B.List=({children:e,className:t,...n})=>_(y.ListBox,{...n,className:p(`flex-1 overflow-y-auto outline-none min-h-0`,t),children:e}),B.Input=Object.assign(({className:e,...t})=>_(y.SearchField,{className:p(`flex items-center`,e),...t}),{SearchInput:({className:e,...t})=>_(y.Input,{className:p(`w-full bg-transparent outline-none border-none`,e),...t}),Button:({className:e,...t})=>_(y.Button,{slot:`clear`,className:p(e),...t})}),B.Item=Object.assign(({children:t,className:n,...r})=>_(y.ListBoxItem,{...r,className:p(`group flex items-center outline-none cursor-pointer`,n),children:n=>v(g,{children:[t,(n.isFocused||n.isSelected)&&v(`div`,{className:`ml-auto opacity-50 flex items-center gap-1`,children:[_(`span`,{className:`text-[10px]`,children:`Select`}),_(e,{size:10})]})]})}),{Icon:({isHeading:e,className:t})=>_(`div`,{className:p(`shrink-0`,t),children:_(e?a:i,{size:18})}),Title:({children:e,className:t})=>_(`span`,{className:p(`block truncate flex-1`,t),children:e}),Bio:({children:e,className:t})=>_(`span`,{className:p(`ml-2 truncate hidden sm:inline`,t),children:e})});export{E as n,B as t};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Boltdocs - https://boltdocs.vercel.app
|
|
3
|
+
* Copyright (c) 2026 Jesus Alcala
|
|
4
|
+
* Licensed under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
const e=require(`./icons-dev-BlV3wWFT.cjs`),t=require(`./search-dialog-BvBopRsZ.cjs`);let n=require(`react-router-dom`),r=require(`react`),i=require(`react/jsx-runtime`),a=require(`flexsearch`),o=require(`virtual:boltdocs-search`);o=e.rt(o);function s(t){let{currentLocale:n,currentVersion:i}=e.X(),[s,c]=(0,r.useState)(!1),[l,u]=(0,r.useState)(``),[d,f]=(0,r.useState)(null);(0,r.useEffect)(()=>{if(!s||d)return;let e=new a.Index({preset:`match`,tokenize:`full`,resolution:9,cache:!0});for(let t of o.default)e.add(t.id,`${t.title} ${t.content}`);f(e)},[s,d]);let p=(0,r.useMemo)(()=>{let e=new Map;for(let t of o.default)e.set(t.id,t);return e},[]);return{isOpen:s,setIsOpen:c,query:l,setQuery:u,list:(0,r.useMemo)(()=>{if(!l)return t.filter(e=>{let t=!n||e.locale===n,r=!i||e.version===i;return t&&r}).slice(0,10).map(e=>({id:e.path,title:e.title,path:e.path,bio:e.description||``,groupTitle:e.groupTitle}));if(!d)return[];let e=d.search(l,{limit:20,suggest:!0}),r=[],a=new Set;for(let t of e){let e=p.get(t);if(!e)continue;let o=!n||e.locale===n,s=!i||e.version===i;!o||!s||a.has(e.url)||(a.add(e.url),r.push({id:e.url,title:e.title,path:e.url,bio:e.display,groupTitle:e.display.split(` > `)[0],isHeading:e.url.includes(`#`)}))}return r.slice(0,10)},[l,d,n,i,t,p]),input:{value:l,onChange:e=>u(e.target.value)}}}function c({text:e,query:t}){if(!t||!e)return(0,i.jsx)(i.Fragment,{children:e});let n=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),r=RegExp(`(${n})`,`gi`);return(0,i.jsx)(i.Fragment,{children:e.split(r).map((e,t)=>r.test(e)?(0,i.jsx)(`mark`,{className:`bg-primary-500/20 text-primary-600 dark:text-primary-400 font-bold px-0.5 rounded-sm`,children:e},t):e)})}function l({routes:a}){let{isOpen:o,setIsOpen:l,query:u,setQuery:d,list:f}=s(a),p=(0,n.useNavigate)();(0,r.useEffect)(()=>{let e=e=>{(/Mac/.test(navigator.userAgent)?e.metaKey:e.ctrlKey)&&(e.key===`k`||e.key===`j`)&&(e.preventDefault(),l(e=>!e))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[l]);let m=(0,r.useCallback)(e=>{let t=String(e);l(!1);let[n,r]=t.split(`#`);p(`${n}${u?`?hl=${encodeURIComponent(u)}`:``}${r?`#${r}`:``}`),r&&setTimeout(()=>{let e=document.getElementById(r);e&&e.scrollIntoView({behavior:`smooth`})},100)},[p,l,u]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(t.n.SearchTrigger.Desktop,{onPress:()=>l(!0),className:`rounded-xl border border-subtle bg-surface text-muted transition-all duration-200 hover:border-primary-500/50 hover:text-body hover:bg-soft/50 hover:shadow-sm active:scale-[0.98] focus-visible:ring-2 focus-visible:ring-primary-500/30`,children:[(0,i.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,i.jsx)(e.G,{size:16}),(0,i.jsx)(`span`,{className:`hidden sm:inline-block`,children:`Search docs...`})]}),(0,i.jsx)(t.n.SearchTrigger.Kbd,{className:`[&_kbd]:bg-main [&_kbd]:border [&_kbd]:border-subtle [&_kbd]:rounded [&_kbd]:px-1.5 [&_kbd]:h-5 [&_kbd]:w-5`})]}),(0,i.jsx)(t.n.SearchTrigger.Mobile,{onPress:()=>l(!0),className:`rounded-xl text-muted transition-all duration-200 hover:text-body active:scale-95 focus-visible:ring-2 focus-visible:ring-primary-500/30`,children:(0,i.jsx)(e.G,{size:20})}),(0,i.jsx)(t.t.Overlay,{isOpen:o,isDismissable:!0,onOpenChange:()=>l(!1),className:`fixed inset-0 z-100 flex items-center justify-center p-4 bg-black/40 backdrop-blur-xs animate-fade-in`,children:(0,i.jsx)(t.t.Content,{className:`w-full max-w-lg bg-main border border-subtle shadow-md rounded-2xl overflow-hidden p-6`,children:(0,i.jsx)(t.t.Dialog,{"aria-label":`Search documentation`,className:`flex flex-col min-h-0 h-[450px]`,children:(0,i.jsxs)(t.t.Autocomplete,{onSelectionChange:m,className:`flex flex-col min-h-0`,children:[(0,i.jsxs)(t.t.Input,{value:u,onChange:d,className:`flex items-center gap-2 border border-subtle bg-surface px-4 py-2.5 rounded-xl focus-within:border-primary-500 mb-4`,children:[(0,i.jsx)(t.t.Input.SearchInput,{placeholder:`Search documentation...`,className:`w-full bg-transparent outline-none text-body text-sm`}),u&&(0,i.jsx)(t.t.Input.Button,{onPress:()=>d(``),className:`text-muted hover:text-body text-xs cursor-pointer select-none`,children:`✕`})]}),(0,i.jsx)(t.t.List,{items:f,children:e=>(0,i.jsxs)(t.t.Item,{onPress:()=>m(e.id),textValue:e.title,className:`flex items-center gap-3 px-4 py-2 rounded-xl group dark:hover:bg-primary-300/40 hover:bg-primary-200/50 transition-colors duration-100`,children:[(0,i.jsx)(t.t.Item.Icon,{isHeading:e.isHeading,className:`text-muted group-hover:text-primary-500 group-focus:text-primary-500`}),(0,i.jsxs)(`div`,{className:`flex flex-col justify-center min-w-0`,children:[(0,i.jsx)(t.t.Item.Title,{className:`text-sm font-medium text-body truncate dark:group-hover:text-primary-100`,children:(0,i.jsx)(c,{text:e.title,query:u})}),(0,i.jsx)(t.t.Item.Bio,{className:`text-xs text-muted truncate`,children:(0,i.jsx)(c,{text:e.bio,query:u})})]})]},e.id)})]})})})})]})}Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return l}});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "boltdocs",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.3",
|
|
4
4
|
"description": "A lightweight documentation generator for React projects.",
|
|
5
5
|
"main": "dist/node/index.mjs",
|
|
6
6
|
"module": "dist/node/index.mjs",
|
|
@@ -71,7 +71,6 @@
|
|
|
71
71
|
"github-slugger": "2.0.0",
|
|
72
72
|
"isomorphic-dompurify": "3.7.1",
|
|
73
73
|
"lru-cache": "^11.3.6",
|
|
74
|
-
"lucide-react": "1.16.0",
|
|
75
74
|
"picomatch": "^4.0.4",
|
|
76
75
|
"react-aria-components": "1.16.0",
|
|
77
76
|
"react-helmet-async": "^2.0.1",
|
|
@@ -88,7 +87,7 @@
|
|
|
88
87
|
"vite": "7.0.0 || 8.0.0",
|
|
89
88
|
"vite-plugin-image-optimizer": "2.0.3",
|
|
90
89
|
"zod": "4.3.6",
|
|
91
|
-
"@bdocs/ssg": "0.0.
|
|
90
|
+
"@bdocs/ssg": "0.0.2"
|
|
92
91
|
},
|
|
93
92
|
"peerDependencies": {
|
|
94
93
|
"react": "19.0.0",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useLayoutEffect } from 'react'
|
|
1
|
+
import { useEffect, useLayoutEffect } from 'react'
|
|
2
2
|
import { useLocation } from 'react-router-dom'
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -9,22 +9,20 @@ import { useLocation } from 'react-router-dom'
|
|
|
9
9
|
export function ScrollHandler() {
|
|
10
10
|
const { pathname, hash } = useLocation()
|
|
11
11
|
|
|
12
|
-
//
|
|
13
|
-
|
|
12
|
+
// Helper to handle scroll logic
|
|
13
|
+
const handleScroll = (behavior: ScrollBehavior = 'auto') => {
|
|
14
14
|
const container = document.querySelector('.boltdocs-content') || window
|
|
15
15
|
|
|
16
|
-
// Helper to get scroll top
|
|
17
16
|
const getScrollTop = () => {
|
|
18
17
|
if (container === window) return window.scrollY
|
|
19
18
|
return (container as HTMLElement).scrollTop
|
|
20
19
|
}
|
|
21
20
|
|
|
22
|
-
|
|
23
|
-
const scrollTo = (top: number, behavior: ScrollBehavior = 'auto') => {
|
|
21
|
+
const scrollTo = (top: number, scrollBehavior: ScrollBehavior) => {
|
|
24
22
|
if (container === window) {
|
|
25
|
-
window.scrollTo({ top, behavior })
|
|
23
|
+
window.scrollTo({ top, behavior: scrollBehavior })
|
|
26
24
|
} else {
|
|
27
|
-
;(container as HTMLElement).scrollTo({ top, behavior })
|
|
25
|
+
;(container as HTMLElement).scrollTo({ top, behavior: scrollBehavior })
|
|
28
26
|
}
|
|
29
27
|
}
|
|
30
28
|
|
|
@@ -41,14 +39,36 @@ export function ScrollHandler() {
|
|
|
41
39
|
const elementPosition = elementRect - containerTop
|
|
42
40
|
const offsetPosition = elementPosition - offset + getScrollTop()
|
|
43
41
|
|
|
44
|
-
scrollTo(offsetPosition,
|
|
45
|
-
return
|
|
42
|
+
scrollTo(offsetPosition, behavior)
|
|
43
|
+
return true
|
|
46
44
|
}
|
|
47
45
|
}
|
|
48
46
|
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
scrollTo(0, behavior)
|
|
48
|
+
return false
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// 1. Immediate sync scroll before paint
|
|
52
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: pathname is used as a trigger for scroll-to-top on navigation
|
|
53
|
+
useLayoutEffect(() => {
|
|
54
|
+
handleScroll('auto')
|
|
55
|
+
}, [pathname, hash])
|
|
56
|
+
|
|
57
|
+
// 2. Delayed async scroll as fallback/stabilizer after paint & passive effects
|
|
58
|
+
useEffect(() => {
|
|
59
|
+
// Immediate run after paint (helps override old component unmount/revert side effects)
|
|
60
|
+
handleScroll('auto')
|
|
61
|
+
|
|
62
|
+
// Double-check inside requestAnimationFrame to catch concurrent renders or dynamic layout recalculations
|
|
63
|
+
const rafId = requestAnimationFrame(() => {
|
|
64
|
+
handleScroll('auto')
|
|
65
|
+
// Dispatch resize event so external components/scroll libraries (like GSAP ScrollTrigger) recalculate trigger offsets
|
|
66
|
+
window.dispatchEvent(new Event('resize'))
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
return () => cancelAnimationFrame(rafId)
|
|
51
70
|
}, [pathname, hash])
|
|
52
71
|
|
|
53
72
|
return null
|
|
54
73
|
}
|
|
74
|
+
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Info, Lightbulb, AlertTriangle, AlertCircle } from '
|
|
1
|
+
import { Info, Lightbulb, AlertTriangle, AlertCircle } from '../ui-base/icons'
|
|
2
2
|
import { cn } from '../../utils/cn'
|
|
3
3
|
|
|
4
4
|
export type CalloutVariant = 'note' | 'tip' | 'warning' | 'danger' | 'info'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Button } from 'react-aria-components'
|
|
2
|
-
import { Copy, Check, File } from '
|
|
2
|
+
import { Copy, Check, File } from '../ui-base/icons'
|
|
3
3
|
import { cn } from '../../utils/cn'
|
|
4
4
|
import { reactToText } from '../../utils/react-to-text'
|
|
5
5
|
import { useCodeBlock } from './use-code-block'
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from 'react-aria-components'
|
|
5
5
|
import { Link } from './link'
|
|
6
6
|
import type { LinkProps } from 'react-aria-components'
|
|
7
|
-
import { ChevronRight } from '
|
|
7
|
+
import { ChevronRight } from '../ui-base/icons'
|
|
8
8
|
import { cn } from '../../utils/cn'
|
|
9
9
|
import type { ComponentBase } from './types'
|
|
10
10
|
|
|
@@ -11,7 +11,7 @@ import { Link } from './link'
|
|
|
11
11
|
import { Menu } from './menu'
|
|
12
12
|
import { Popover } from './popover'
|
|
13
13
|
import { cn } from '../../utils/cn'
|
|
14
|
-
import { Sun, Moon, ExternalLink, MoreVertical, X } from '
|
|
14
|
+
import { Sun, Moon, ExternalLink, MoreVertical, X } from '../ui-base/icons'
|
|
15
15
|
import * as IconsSocials from '../icons-dev'
|
|
16
16
|
import type { ComponentBase } from './types'
|
|
17
17
|
import type { BoltdocsSocialLink } from '../../../shared/types'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
3
|
import * as RAC from 'react-aria-components'
|
|
4
|
-
import { Hash, FileText, CornerDownLeft } from '
|
|
4
|
+
import { Hash, FileText, CornerDownLeft } from '../ui-base/icons'
|
|
5
5
|
import { cn } from '../../utils/cn'
|
|
6
6
|
import type { ComponentBase } from './types'
|
|
7
7
|
|
|
@@ -9,12 +9,12 @@ import * as RAC from 'react-aria-components'
|
|
|
9
9
|
import { cn } from '../../utils/cn'
|
|
10
10
|
import { useUI } from '../../app/ui-context'
|
|
11
11
|
import { Link } from './link'
|
|
12
|
-
import { ChevronRight } from '
|
|
12
|
+
import { ChevronRight } from '../ui-base/icons'
|
|
13
13
|
import type { ComponentBase } from './types'
|
|
14
14
|
import type { ComponentRoute } from '../../types'
|
|
15
15
|
import { useSidebar } from '../../hooks/use-sidebar'
|
|
16
16
|
import { useLocalizedTo } from '../../hooks/use-localized-to'
|
|
17
|
-
import * as
|
|
17
|
+
import * as DefaultIcons from '../ui-base/icons'
|
|
18
18
|
import virtualIcons from 'virtual:boltdocs-icons'
|
|
19
19
|
|
|
20
20
|
// Persistent scroll position across navigation (SPA)
|
|
@@ -22,7 +22,7 @@ let sidebarScrollPos = 0
|
|
|
22
22
|
|
|
23
23
|
function getIcon(iconName?: string): React.ElementType | undefined {
|
|
24
24
|
if (!iconName) return undefined
|
|
25
|
-
const icons = { ...
|
|
25
|
+
const icons = { ...DefaultIcons, ...virtualIcons } as unknown as Record<
|
|
26
26
|
string,
|
|
27
27
|
React.ElementType
|
|
28
28
|
>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useState } from 'react'
|
|
2
|
-
import { Copy, Check, ExternalLink, ChevronDown } from '
|
|
2
|
+
import { Copy, Check, ExternalLink, ChevronDown } from './icons'
|
|
3
3
|
import { Button } from '../primitives/button'
|
|
4
4
|
import { ButtonGroup } from '../primitives/button-group'
|
|
5
5
|
import { Menu } from '../primitives/menu'
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
export interface IconProps extends React.SVGProps<SVGSVGElement> {
|
|
4
|
+
size?: number | string
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
function createIcon(
|
|
8
|
+
displayName: string,
|
|
9
|
+
paths: React.ReactNode,
|
|
10
|
+
viewBox = '0 0 24 24',
|
|
11
|
+
) {
|
|
12
|
+
const Component = ({ size = 24, className, ...props }: IconProps) => {
|
|
13
|
+
return (
|
|
14
|
+
<svg
|
|
15
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
16
|
+
width={size}
|
|
17
|
+
height={size}
|
|
18
|
+
viewBox={viewBox}
|
|
19
|
+
fill="none"
|
|
20
|
+
stroke="currentColor"
|
|
21
|
+
strokeWidth="2"
|
|
22
|
+
strokeLinecap="round"
|
|
23
|
+
strokeLinejoin="round"
|
|
24
|
+
className={className}
|
|
25
|
+
{...props}
|
|
26
|
+
>
|
|
27
|
+
{paths}
|
|
28
|
+
</svg>
|
|
29
|
+
)
|
|
30
|
+
}
|
|
31
|
+
Component.displayName = displayName
|
|
32
|
+
return Component
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export const Info = createIcon('Info', (
|
|
36
|
+
<>
|
|
37
|
+
<circle cx="12" cy="12" r="10" />
|
|
38
|
+
<path d="M12 16v-4" />
|
|
39
|
+
<path d="M12 8h.01" />
|
|
40
|
+
</>
|
|
41
|
+
))
|
|
42
|
+
|
|
43
|
+
export const Lightbulb = createIcon('Lightbulb', (
|
|
44
|
+
<>
|
|
45
|
+
<path d="M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A5 5 0 0 0 8 8c0 1 .3 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5" />
|
|
46
|
+
<path d="M9 18h6" />
|
|
47
|
+
<path d="M10 22h4" />
|
|
48
|
+
</>
|
|
49
|
+
))
|
|
50
|
+
|
|
51
|
+
export const AlertTriangle = createIcon('AlertTriangle', (
|
|
52
|
+
<>
|
|
53
|
+
<path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z" />
|
|
54
|
+
<line x1="12" y1="9" x2="12" y2="13" />
|
|
55
|
+
<line x1="12" y1="17" x2="12.01" y2="17" />
|
|
56
|
+
</>
|
|
57
|
+
))
|
|
58
|
+
|
|
59
|
+
export const AlertCircle = createIcon('AlertCircle', (
|
|
60
|
+
<>
|
|
61
|
+
<circle cx="12" cy="12" r="10" />
|
|
62
|
+
<line x1="12" y1="8" x2="12" y2="12" />
|
|
63
|
+
<line x1="12" y1="16" x2="12.01" y2="16" />
|
|
64
|
+
</>
|
|
65
|
+
))
|
|
66
|
+
|
|
67
|
+
export const Copy = createIcon('Copy', (
|
|
68
|
+
<>
|
|
69
|
+
<rect width="14" height="14" x="8" y="8" rx="2" ry="2" />
|
|
70
|
+
<path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" />
|
|
71
|
+
</>
|
|
72
|
+
))
|
|
73
|
+
|
|
74
|
+
export const Check = createIcon('Check', (
|
|
75
|
+
<path d="M20 6 9 17l-5-5" />
|
|
76
|
+
))
|
|
77
|
+
|
|
78
|
+
export const File = createIcon('File', (
|
|
79
|
+
<>
|
|
80
|
+
<path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z" />
|
|
81
|
+
<path d="M14 2v4a2 2 0 0 0 2 2h4" />
|
|
82
|
+
</>
|
|
83
|
+
))
|
|
84
|
+
|
|
85
|
+
export const ArrowLeft = createIcon('ArrowLeft', (
|
|
86
|
+
<>
|
|
87
|
+
<path d="m12 19-7-7 7-7" />
|
|
88
|
+
<path d="M19 12H5" />
|
|
89
|
+
</>
|
|
90
|
+
))
|
|
91
|
+
|
|
92
|
+
export const Pencil = createIcon('Pencil', (
|
|
93
|
+
<>
|
|
94
|
+
<path d="M12 20h9" />
|
|
95
|
+
<path d="M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z" />
|
|
96
|
+
</>
|
|
97
|
+
))
|
|
98
|
+
|
|
99
|
+
export const CircleHelp = createIcon('CircleHelp', (
|
|
100
|
+
<>
|
|
101
|
+
<circle cx="12" cy="12" r="10" />
|
|
102
|
+
<path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" />
|
|
103
|
+
<path d="M12 17h.01" />
|
|
104
|
+
</>
|
|
105
|
+
))
|
|
106
|
+
|
|
107
|
+
export const TextAlignStart = createIcon('TextAlignStart', (
|
|
108
|
+
<>
|
|
109
|
+
<line x1="21" x2="3" y1="6" y2="6" />
|
|
110
|
+
<line x1="15" x2="3" y1="12" y2="12" />
|
|
111
|
+
<line x1="17" x2="3" y1="18" y2="18" />
|
|
112
|
+
</>
|
|
113
|
+
))
|
|
114
|
+
|
|
115
|
+
export const ExternalLink = createIcon('ExternalLink', (
|
|
116
|
+
<>
|
|
117
|
+
<path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" />
|
|
118
|
+
<polyline points="15 3 21 3 21 9" />
|
|
119
|
+
<line x1="10" y1="14" x2="21" y2="3" />
|
|
120
|
+
</>
|
|
121
|
+
))
|
|
122
|
+
|
|
123
|
+
export const ChevronDown = createIcon('ChevronDown', (
|
|
124
|
+
<path d="m6 9 6 6 6-6" />
|
|
125
|
+
))
|
|
126
|
+
|
|
127
|
+
export const Home = createIcon('Home', (
|
|
128
|
+
<>
|
|
129
|
+
<path d="m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" />
|
|
130
|
+
<polyline points="9 22 9 12 15 12 15 22" />
|
|
131
|
+
</>
|
|
132
|
+
))
|
|
133
|
+
|
|
134
|
+
export const Search = createIcon('Search', (
|
|
135
|
+
<>
|
|
136
|
+
<circle cx="11" cy="11" r="8" />
|
|
137
|
+
<path d="m21 21-4.3-4.3" />
|
|
138
|
+
</>
|
|
139
|
+
))
|
|
140
|
+
|
|
141
|
+
export const Sun = createIcon('Sun', (
|
|
142
|
+
<>
|
|
143
|
+
<circle cx="12" cy="12" r="4" />
|
|
144
|
+
<path d="M12 2v2" />
|
|
145
|
+
<path d="M12 20v2" />
|
|
146
|
+
<path d="m4.93 4.93 1.41 1.41" />
|
|
147
|
+
<path d="m17.66 17.66 1.41 1.41" />
|
|
148
|
+
<path d="M2 12h2" />
|
|
149
|
+
<path d="M20 12h2" />
|
|
150
|
+
<path d="m6.34 17.66-1.41 1.41" />
|
|
151
|
+
<path d="m19.07 4.93-1.41 1.41" />
|
|
152
|
+
</>
|
|
153
|
+
))
|
|
154
|
+
|
|
155
|
+
export const Moon = createIcon('Moon', (
|
|
156
|
+
<path d="M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z" />
|
|
157
|
+
))
|
|
158
|
+
|
|
159
|
+
export const Monitor = createIcon('Monitor', (
|
|
160
|
+
<>
|
|
161
|
+
<rect width="20" height="14" x="2" y="3" rx="2" />
|
|
162
|
+
<line x1="8" x2="16" y1="21" y2="21" />
|
|
163
|
+
<line x1="12" x2="12" y1="17" y2="21" />
|
|
164
|
+
</>
|
|
165
|
+
))
|
|
166
|
+
|
|
167
|
+
export const Languages = createIcon('Languages', (
|
|
168
|
+
<>
|
|
169
|
+
<path d="m5 8 6 6" />
|
|
170
|
+
<path d="m4 14 6-6 2-3" />
|
|
171
|
+
<path d="M2 5h12" />
|
|
172
|
+
<path d="M7 2h1" />
|
|
173
|
+
<path d="m22 22-5-10-5 10" />
|
|
174
|
+
<path d="M14 18h6" />
|
|
175
|
+
</>
|
|
176
|
+
))
|
|
177
|
+
|
|
178
|
+
export const Menu = createIcon('Menu', (
|
|
179
|
+
<>
|
|
180
|
+
<line x1="4" x2="20" y1="12" y2="12" />
|
|
181
|
+
<line x1="4" x2="20" y1="6" y2="6" />
|
|
182
|
+
<line x1="4" x2="20" y1="18" y2="18" />
|
|
183
|
+
</>
|
|
184
|
+
))
|
|
185
|
+
|
|
186
|
+
export const X = createIcon('X', (
|
|
187
|
+
<>
|
|
188
|
+
<path d="M18 6 6 18" />
|
|
189
|
+
<path d="m6 6 12 12" />
|
|
190
|
+
</>
|
|
191
|
+
))
|
|
192
|
+
|
|
193
|
+
export const Link = createIcon('Link', (
|
|
194
|
+
<>
|
|
195
|
+
<path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71" />
|
|
196
|
+
<path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71" />
|
|
197
|
+
</>
|
|
198
|
+
))
|
|
199
|
+
|
|
200
|
+
export const ChevronRight = createIcon('ChevronRight', (
|
|
201
|
+
<path d="m9 18 6-6-6-6" />
|
|
202
|
+
))
|
|
203
|
+
|
|
204
|
+
export const MoreVertical = createIcon('MoreVertical', (
|
|
205
|
+
<>
|
|
206
|
+
<circle cx="12" cy="12" r="1" />
|
|
207
|
+
<circle cx="12" cy="5" r="1" />
|
|
208
|
+
<circle cx="12" cy="19" r="1" />
|
|
209
|
+
</>
|
|
210
|
+
))
|
|
211
|
+
|
|
212
|
+
export const ChevronLeft = createIcon('ChevronLeft', (
|
|
213
|
+
<path d="m15 18-6-6 6-6" />
|
|
214
|
+
))
|
|
215
|
+
|
|
216
|
+
export const Hash = createIcon('Hash', (
|
|
217
|
+
<>
|
|
218
|
+
<line x1="4" x2="20" y1="9" y2="9" />
|
|
219
|
+
<line x1="4" x2="20" y1="15" y2="15" />
|
|
220
|
+
<line x1="10" x2="8" y1="3" y2="21" />
|
|
221
|
+
<line x1="16" x2="14" y1="3" y2="21" />
|
|
222
|
+
</>
|
|
223
|
+
))
|
|
224
|
+
|
|
225
|
+
export const FileText = createIcon('FileText', (
|
|
226
|
+
<>
|
|
227
|
+
<path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z" />
|
|
228
|
+
<path d="M14 2v4a2 2 0 0 0 2 2h4" />
|
|
229
|
+
<path d="M10 9H8" />
|
|
230
|
+
<path d="M16 13H8" />
|
|
231
|
+
<path d="M16 17H8" />
|
|
232
|
+
</>
|
|
233
|
+
))
|
|
234
|
+
|
|
235
|
+
export const CornerDownLeft = createIcon('CornerDownLeft', (
|
|
236
|
+
<>
|
|
237
|
+
<polyline points="9 10 4 15 9 20" />
|
|
238
|
+
<path d="M20 4v7a4 4 0 0 1-4 4H4" />
|
|
239
|
+
</>
|
|
240
|
+
))
|
|
@@ -9,7 +9,7 @@ import { Tabs } from './tabs'
|
|
|
9
9
|
import { useLocation } from 'react-router-dom'
|
|
10
10
|
import type { BoltdocsSocialLink } from '../../../shared/types'
|
|
11
11
|
import { Button } from '../primitives/button'
|
|
12
|
-
import { Menu as MenuIcon, X } from '
|
|
12
|
+
import { Menu as MenuIcon, X } from './icons'
|
|
13
13
|
import { useLocalizedTo } from '../../hooks/use-localized-to'
|
|
14
14
|
import type { NavbarLink as NavbarLinkType } from '../../types'
|
|
15
15
|
import { useUI } from '../../app/ui-context'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OnThisPage as OTP } from '../primitives/on-this-page'
|
|
2
2
|
import type { OnThisPageProps } from '../../types'
|
|
3
|
-
import { Pencil, CircleHelp, TextAlignStart } from '
|
|
3
|
+
import { Pencil, CircleHelp, TextAlignStart } from './icons'
|
|
4
4
|
|
|
5
5
|
export function OnThisPage({
|
|
6
6
|
headings = [],
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useEffect, useCallback } from 'react'
|
|
2
|
-
import { Search } from '
|
|
2
|
+
import { Search } from './icons'
|
|
3
3
|
import { useSearch } from '../../hooks/use-search'
|
|
4
4
|
import { SearchDialog as SearchDialogPrimitive } from '../primitives/search-dialog'
|
|
5
5
|
import Navbar from '../primitives/navbar'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Sidebar as SidebarPrimitive } from '../primitives/sidebar'
|
|
2
|
-
import
|
|
2
|
+
import { X } from './icons'
|
|
3
3
|
import type { ComponentRoute } from '../../types'
|
|
4
4
|
import type { BoltdocsConfig } from '../../../shared/types'
|
|
5
5
|
import { VersionSelector, I18nSelector } from './version-i18n'
|
|
@@ -54,7 +54,7 @@ function SidebarMain({ routes, config }: SidebarProps) {
|
|
|
54
54
|
className="h-9 w-9 flex items-center justify-center bg-transparent border-none outline-none select-none cursor-pointer rounded-xl hover:bg-primary-50/50 text-muted hover:text-body transition-colors"
|
|
55
55
|
aria-label="Close sidebar"
|
|
56
56
|
>
|
|
57
|
-
<
|
|
57
|
+
<X size={20} />
|
|
58
58
|
</Button>
|
|
59
59
|
</div>
|
|
60
60
|
</SidebarPrimitive.Header>
|
|
@@ -3,7 +3,8 @@ import { useTabs as useTabsHook } from '../../hooks/use-tabs'
|
|
|
3
3
|
import { Tabs as T } from '../primitives/tabs'
|
|
4
4
|
import { Link } from '../primitives/link'
|
|
5
5
|
import type { BoltdocsTab, ComponentRoute } from '../../types'
|
|
6
|
-
import * as
|
|
6
|
+
import * as DefaultIcons from './icons'
|
|
7
|
+
import virtualIcons from 'virtual:boltdocs-icons'
|
|
7
8
|
import { getTranslated } from '../../utils/i18n'
|
|
8
9
|
import { useRoutes } from '../../hooks/use-routes'
|
|
9
10
|
|
|
@@ -38,9 +39,10 @@ export function Tabs({
|
|
|
38
39
|
/>
|
|
39
40
|
)
|
|
40
41
|
}
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
const icons = { ...DefaultIcons, ...virtualIcons } as Record<string, any>
|
|
43
|
+
const TabIcon = icons[iconName] || icons[iconName + 'Icon']
|
|
44
|
+
if (TabIcon) {
|
|
45
|
+
return <TabIcon size={16} />
|
|
44
46
|
}
|
|
45
47
|
return <img src={iconName} alt="" className="h-4 w-4 object-contain" />
|
|
46
48
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useEffect, useState } from 'react'
|
|
2
|
-
import { Sun, Moon, Monitor } from '
|
|
2
|
+
import { Sun, Moon, Monitor } from './icons'
|
|
3
3
|
import { useTheme } from '../../app/theme-context'
|
|
4
4
|
import { Button } from 'react-aria-components'
|
|
5
5
|
import { Menu } from '../primitives/menu'
|
|
@@ -2,7 +2,7 @@ import { useVersion } from '../../hooks/use-version'
|
|
|
2
2
|
import { useI18n } from '../../hooks/use-i18n'
|
|
3
3
|
import { Menu } from '../primitives/menu'
|
|
4
4
|
import { Button } from '../primitives/button'
|
|
5
|
-
import { ChevronDown, Languages } from '
|
|
5
|
+
import { ChevronDown, Languages } from './icons'
|
|
6
6
|
import { cn } from '../../utils/cn'
|
|
7
7
|
|
|
8
8
|
export function VersionSelector({ className }: { className?: string }) {
|