@fumadocs/base-ui 16.6.8 → 16.6.9

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.
@@ -816,6 +816,7 @@
816
816
  @source inline("rtl");
817
817
  @source inline("rtl:-scale-x-100");
818
818
  @source inline("rtl:rotate-180");
819
+ @source inline("rtl:rotate-90");
819
820
  @source inline("s");
820
821
  @source inline("scroll");
821
822
  @source inline("scroll-into-view-if-needed");
package/css/lib/base.css CHANGED
@@ -175,7 +175,7 @@
175
175
  @utility fd-steps {
176
176
  counter-reset: step;
177
177
  position: relative;
178
- @apply pl-6 ml-2 border-l sm:ml-4 sm:pl-7;
178
+ @apply ps-6 ms-2 border-s sm:ms-4 sm:ps-7;
179
179
  }
180
180
 
181
181
  @utility fd-step {
@@ -0,0 +1,22 @@
1
+ import { CodeBlockProps } from "./codeblock.js";
2
+ import * as react from "react";
3
+ import { HighlightOptions } from "fumadocs-core/highlight";
4
+
5
+ //#region src/components/codeblock.rsc.d.ts
6
+ type ServerCodeBlockProps = HighlightOptions & {
7
+ code: string;
8
+ /**
9
+ * Extra props for the underlying `<CodeBlock />` component.
10
+ *
11
+ * Ignored if you defined your own `pre` component in `components`.
12
+ */
13
+ codeblock?: CodeBlockProps;
14
+ };
15
+ declare function ServerCodeBlock({
16
+ code,
17
+ codeblock,
18
+ ...options
19
+ }: ServerCodeBlockProps): Promise<react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | Iterable<react.ReactNode> | (string | number | bigint | boolean | react.ReactPortal | react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | Iterable<react.ReactNode> | null | undefined)>;
20
+ //#endregion
21
+ export { ServerCodeBlock, ServerCodeBlockProps };
22
+ //# sourceMappingURL=codeblock.rsc.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codeblock.rsc.d.ts","names":[],"sources":["../../src/components/codeblock.rsc.tsx"],"mappings":";;;;;KAIY,oBAAA,GAAuB,gBAAA;EACjC,IAAA;;AADF;;;;EAQE,SAAA,GAAY,cAAA;AAAA;AAAA,iBAGQ,eAAA,CAAA;EAAkB,IAAA;EAAM,SAAA;EAAA,GAAc;AAAA,GAAW,oBAAA,GAAoB,OAAA,CAAA,KAAA,CAAA,YAAA,mBAAA,KAAA,CAAA,qBAAA,SAAA,QAAA,CAAA,KAAA,CAAA,SAAA,0CAAA,KAAA,CAAA,WAAA,GAAA,KAAA,CAAA,YAAA,mBAAA,KAAA,CAAA,qBAAA,SAAA,QAAA,CAAA,KAAA,CAAA,SAAA"}
@@ -0,0 +1,24 @@
1
+ import { cn } from "../utils/cn.js";
2
+ import { CodeBlock, Pre } from "./codeblock.js";
3
+ import { jsx } from "react/jsx-runtime";
4
+ import { highlight } from "fumadocs-core/highlight";
5
+
6
+ //#region src/components/codeblock.rsc.tsx
7
+ async function ServerCodeBlock({ code, codeblock, ...options }) {
8
+ return await highlight(code, {
9
+ ...options,
10
+ components: {
11
+ pre: (props) => {
12
+ CodeBlock, {
13
+ ...props,
14
+ ...codeblock
15
+ }, cn("my-0", props.className, codeblock?.className), Pre, props.children;
16
+ },
17
+ ...options.components
18
+ }
19
+ });
20
+ }
21
+
22
+ //#endregion
23
+ export { ServerCodeBlock };
24
+ //# sourceMappingURL=codeblock.rsc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codeblock.rsc.js","names":["Base.CodeBlock","Base.Pre"],"sources":["../../src/components/codeblock.rsc.tsx"],"sourcesContent":["import * as Base from './codeblock';\nimport { highlight, type HighlightOptions } from 'fumadocs-core/highlight';\nimport { cn } from '@/utils/cn';\n\nexport type ServerCodeBlockProps = HighlightOptions & {\n code: string;\n\n /**\n * Extra props for the underlying `<CodeBlock />` component.\n *\n * Ignored if you defined your own `pre` component in `components`.\n */\n codeblock?: Base.CodeBlockProps;\n};\n\nexport async function ServerCodeBlock({ code, codeblock, ...options }: ServerCodeBlockProps) {\n return await highlight(code, {\n ...options,\n components: {\n pre: (props) => {\n <Base.CodeBlock\n {...props}\n {...codeblock}\n className={cn('my-0', props.className, codeblock?.className)}\n >\n <Base.Pre>{props.children}</Base.Pre>\n </Base.CodeBlock>;\n },\n ...options.components,\n },\n });\n}\n"],"mappings":";;;;;;AAeA,eAAsB,gBAAgB,EAAE,MAAM,WAAW,GAAG,WAAiC;AAC3F,QAAO,MAAM,UAAU,MAAM;EAC3B,GAAG;EACH,YAAY;GACV,MAAM,UAAU;AACd,IAACA,WAGC;KAFA,GAAI;KACJ,GAAI;KACyD,EAAlD,GAAG,QAAQ,MAAM,WAAW,WAAW,UAAU,EAE3DC,KAAU,MAAM;;GAGrB,GAAG,QAAQ;GACZ;EACF,CAAC"}
@@ -2,8 +2,8 @@
2
2
 
3
3
  import { DynamicCodeBlock as DynamicCodeBlock$1 } from "./dynamic-codeblock.core.js";
4
4
  import { jsx } from "react/jsx-runtime";
5
- import { useShikiConfigOptional } from "fumadocs-core/highlight/core/client";
6
5
  import { configDefault } from "fumadocs-core/highlight";
6
+ import { useShikiConfigOptional } from "fumadocs-core/highlight/core/client";
7
7
 
8
8
  //#region src/components/dynamic-codeblock.tsx
9
9
  function DynamicCodeBlock(props) {
@@ -202,7 +202,7 @@ function SidebarFolderTrigger({ children, ...props }) {
202
202
  ...props,
203
203
  children: [children, /* @__PURE__ */ jsx(ChevronDown, {
204
204
  "data-icon": true,
205
- className: cn("ms-auto transition-transform", !open && "-rotate-90")
205
+ className: cn("ms-auto transition-transform", !open && "-rotate-90 rtl:rotate-90")
206
206
  })]
207
207
  });
208
208
  return /* @__PURE__ */ jsx("div", {
@@ -229,7 +229,7 @@ function SidebarFolderLink({ children, active = false, ...props }) {
229
229
  ...props,
230
230
  children: [children, collapsible && /* @__PURE__ */ jsx(ChevronDown, {
231
231
  "data-icon": true,
232
- className: cn("ms-auto transition-transform", !open && "-rotate-90")
232
+ className: cn("ms-auto transition-transform", !open && "-rotate-90 rtl:rotate-90")
233
233
  })]
234
234
  });
235
235
  }
@@ -1 +1 @@
1
- {"version":3,"file":"base.js","names":[],"sources":["../../../src/components/sidebar/base.tsx"],"sourcesContent":["'use client';\nimport { ChevronDown, ExternalLink } from 'lucide-react';\nimport {\n type ComponentProps,\n createContext,\n type PointerEvent,\n type ReactNode,\n type RefObject,\n use,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport Link, { type LinkProps } from 'fumadocs-core/link';\nimport { useOnChange } from 'fumadocs-core/utils/use-on-change';\nimport { cn } from '@/utils/cn';\nimport { ScrollArea, type ScrollAreaProps, ScrollViewport } from '@/components/ui/scroll-area';\nimport {\n Collapsible,\n CollapsibleContent,\n type CollapsibleContentProps,\n CollapsibleTrigger,\n type CollapsibleTriggerProps,\n} from '@/components/ui/collapsible';\nimport { useMediaQuery } from 'fumadocs-core/utils/use-media-query';\nimport scrollIntoView from 'scroll-into-view-if-needed';\nimport { usePathname } from 'fumadocs-core/framework';\nimport ReactDOM from 'react-dom';\n\ninterface SidebarContext {\n open: boolean;\n setOpen: React.Dispatch<React.SetStateAction<boolean>>;\n collapsed: boolean;\n setCollapsed: React.Dispatch<React.SetStateAction<boolean>>;\n\n /**\n * When set to false, don't close the sidebar when navigate to another page\n */\n closeOnRedirect: RefObject<boolean>;\n defaultOpenLevel: number;\n prefetch?: boolean;\n mode: Mode;\n}\n\nexport interface SidebarProviderProps {\n /**\n * Open folders by default if their level is lower or equal to a specific level\n * (Starting from 1)\n *\n * @defaultValue 0\n */\n defaultOpenLevel?: number;\n\n /**\n * Prefetch links, default behaviour depends on your React.js framework.\n */\n prefetch?: boolean;\n\n children?: ReactNode;\n}\n\ntype Mode = 'drawer' | 'full';\n\nconst SidebarContext = createContext<SidebarContext | null>(null);\n\nconst FolderContext = createContext<{\n open: boolean;\n setOpen: React.Dispatch<React.SetStateAction<boolean>>;\n depth: number;\n collapsible: boolean;\n} | null>(null);\n\nexport function SidebarProvider({\n defaultOpenLevel = 0,\n prefetch,\n children,\n}: SidebarProviderProps) {\n const closeOnRedirect = useRef(true);\n const [open, setOpen] = useState(false);\n const [collapsed, setCollapsed] = useState(false);\n const pathname = usePathname();\n const mode: Mode = useMediaQuery('(width < 768px)') ? 'drawer' : 'full';\n\n useOnChange(pathname, () => {\n if (closeOnRedirect.current) {\n setOpen(false);\n }\n closeOnRedirect.current = true;\n });\n\n return (\n <SidebarContext\n value={useMemo(\n () => ({\n open,\n setOpen,\n collapsed,\n setCollapsed,\n closeOnRedirect,\n defaultOpenLevel,\n prefetch,\n mode,\n }),\n [open, collapsed, defaultOpenLevel, prefetch, mode],\n )}\n >\n {children}\n </SidebarContext>\n );\n}\n\nexport function useSidebar(): SidebarContext {\n const ctx = use(SidebarContext);\n if (!ctx)\n throw new Error(\n 'Missing SidebarContext, make sure you have wrapped the component in <DocsLayout /> and the context is available.',\n );\n\n return ctx;\n}\n\nexport function useFolder() {\n return use(FolderContext);\n}\n\nexport function useFolderDepth() {\n return use(FolderContext)?.depth ?? 0;\n}\n\nexport function SidebarContent({\n children,\n}: {\n children: (state: {\n ref: RefObject<HTMLElement | null>;\n collapsed: boolean;\n hovered: boolean;\n onPointerEnter: (event: PointerEvent) => void;\n onPointerLeave: (event: PointerEvent) => void;\n }) => ReactNode;\n}) {\n const { collapsed, mode } = useSidebar();\n const [hover, setHover] = useState(false);\n const ref = useRef<HTMLElement>(null);\n const timerRef = useRef(0);\n\n useOnChange(collapsed, () => {\n if (collapsed) setHover(false);\n });\n\n if (mode !== 'full') return;\n\n function shouldIgnoreHover(e: PointerEvent): boolean {\n const element = ref.current;\n if (!element) return true;\n\n return !collapsed || e.pointerType === 'touch' || element.getAnimations().length > 0;\n }\n\n return children({\n ref,\n collapsed,\n hovered: hover,\n onPointerEnter(e) {\n if (shouldIgnoreHover(e)) return;\n window.clearTimeout(timerRef.current);\n setHover(true);\n },\n onPointerLeave(e) {\n if (shouldIgnoreHover(e)) return;\n window.clearTimeout(timerRef.current);\n\n timerRef.current = window.setTimeout(\n () => setHover(false),\n // if mouse is leaving the viewport, add a close delay\n Math.min(e.clientX, document.body.clientWidth - e.clientX) > 100 ? 0 : 500,\n );\n },\n });\n}\n\nexport function SidebarDrawerOverlay(props: ComponentProps<'div'>) {\n const { open, setOpen, mode } = useSidebar();\n const [hidden, setHidden] = useState(!open);\n\n if (open && hidden) setHidden(false);\n if (mode !== 'drawer' || hidden) return;\n return (\n <div\n data-state={open ? 'open' : 'closed'}\n onClick={() => setOpen(false)}\n onAnimationEnd={() => {\n if (!open) ReactDOM.flushSync(() => setHidden(true));\n }}\n {...props}\n />\n );\n}\n\nexport function SidebarDrawerContent({ className, children, ...props }: ComponentProps<'aside'>) {\n const { open, mode } = useSidebar();\n const [hidden, setHidden] = useState(!open);\n\n if (open && hidden) setHidden(false);\n if (mode !== 'drawer') return;\n return (\n <aside\n id=\"nd-sidebar-mobile\"\n data-state={open ? 'open' : 'closed'}\n className={cn(hidden && 'invisible', className)}\n onAnimationEnd={() => {\n if (!open) ReactDOM.flushSync(() => setHidden(true));\n }}\n {...props}\n >\n {children}\n </aside>\n );\n}\n\nexport function SidebarViewport({ className, ...props }: ScrollAreaProps) {\n return (\n <ScrollArea\n className={(s) =>\n cn('min-h-0 flex-1', typeof className === 'function' ? className(s) : className)\n }\n {...props}\n >\n <ScrollViewport\n className=\"p-4 overscroll-contain\"\n style={\n {\n maskImage:\n 'linear-gradient(to bottom, transparent, white 12px, white calc(100% - 12px), transparent)',\n } as object\n }\n >\n {props.children}\n </ScrollViewport>\n </ScrollArea>\n );\n}\n\nexport function SidebarSeparator(props: ComponentProps<'p'>) {\n const depth = useFolderDepth();\n return (\n <p\n {...props}\n className={cn(\n 'inline-flex items-center gap-2 mb-1.5 px-2 mt-6 empty:mb-0',\n depth === 0 && 'first:mt-0',\n props.className,\n )}\n >\n {props.children}\n </p>\n );\n}\n\nexport function SidebarItem({\n icon,\n active = false,\n children,\n ...props\n}: LinkProps & {\n active?: boolean;\n icon?: ReactNode;\n}) {\n const ref = useRef<HTMLAnchorElement>(null);\n const { prefetch } = useSidebar();\n\n useAutoScroll(active, ref);\n\n return (\n <Link ref={ref} data-active={active} prefetch={prefetch} {...props}>\n {icon ?? (props.external ? <ExternalLink /> : null)}\n {children}\n </Link>\n );\n}\n\nexport function SidebarFolder({\n defaultOpen: defaultOpenProp,\n collapsible = true,\n active = false,\n children,\n ...props\n}: ComponentProps<'div'> & {\n active?: boolean;\n defaultOpen?: boolean;\n collapsible?: boolean;\n}) {\n const { defaultOpenLevel } = useSidebar();\n const depth = useFolderDepth() + 1;\n const defaultOpen =\n collapsible === false || active || (defaultOpenProp ?? defaultOpenLevel >= depth);\n const [open, setOpen] = useState(defaultOpen);\n\n useOnChange(defaultOpen, (v) => {\n if (v) setOpen(v);\n });\n\n return (\n <Collapsible open={open} onOpenChange={setOpen} disabled={!collapsible} {...props}>\n <FolderContext\n value={useMemo(() => ({ open, setOpen, depth, collapsible }), [collapsible, depth, open])}\n >\n {children}\n </FolderContext>\n </Collapsible>\n );\n}\n\nexport function SidebarFolderTrigger({ children, ...props }: CollapsibleTriggerProps) {\n const { open, collapsible } = use(FolderContext)!;\n\n if (collapsible) {\n return (\n <CollapsibleTrigger {...props}>\n {children}\n <ChevronDown\n data-icon\n className={cn('ms-auto transition-transform', !open && '-rotate-90')}\n />\n </CollapsibleTrigger>\n );\n }\n\n return <div {...(props as ComponentProps<'div'>)}>{children}</div>;\n}\n\nexport function SidebarFolderLink({\n children,\n active = false,\n ...props\n}: LinkProps & {\n active?: boolean;\n}) {\n const ref = useRef<HTMLAnchorElement>(null);\n const { open, setOpen, collapsible } = use(FolderContext)!;\n const { prefetch } = useSidebar();\n\n useAutoScroll(active, ref);\n\n return (\n <Link\n ref={ref}\n data-active={active}\n onClick={(e) => {\n if (!collapsible) return;\n\n if (e.target instanceof Element && e.target.matches('[data-icon], [data-icon] *')) {\n setOpen(!open);\n e.preventDefault();\n } else {\n setOpen(active ? !open : true);\n }\n }}\n prefetch={prefetch}\n {...props}\n >\n {children}\n {collapsible && (\n <ChevronDown\n data-icon\n className={cn('ms-auto transition-transform', !open && '-rotate-90')}\n />\n )}\n </Link>\n );\n}\n\nexport function SidebarFolderContent(props: CollapsibleContentProps) {\n return <CollapsibleContent {...props}>{props.children}</CollapsibleContent>;\n}\n\nexport function SidebarTrigger({ children, ...props }: ComponentProps<'button'>) {\n const { setOpen } = useSidebar();\n\n return (\n <button aria-label=\"Open Sidebar\" onClick={() => setOpen((prev) => !prev)} {...props}>\n {children}\n </button>\n );\n}\n\nexport function SidebarCollapseTrigger(props: ComponentProps<'button'>) {\n const { collapsed, setCollapsed } = useSidebar();\n\n return (\n <button\n type=\"button\"\n aria-label=\"Collapse Sidebar\"\n data-collapsed={collapsed}\n onClick={() => {\n setCollapsed((prev) => !prev);\n }}\n {...props}\n >\n {props.children}\n </button>\n );\n}\n\n/**\n * scroll to the element if `active` is true\n */\nexport function useAutoScroll(active: boolean, ref: RefObject<HTMLElement | null>) {\n const { mode } = useSidebar();\n\n useEffect(() => {\n if (active && ref.current) {\n scrollIntoView(ref.current, {\n boundary: document.getElementById(mode === 'drawer' ? 'nd-sidebar-mobile' : 'nd-sidebar'),\n scrollMode: 'if-needed',\n });\n }\n }, [active, mode, ref]);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgEA,MAAM,iBAAiB,cAAqC,KAAK;AAEjE,MAAM,gBAAgB,cAKZ,KAAK;AAEf,SAAgB,gBAAgB,EAC9B,mBAAmB,GACnB,UACA,YACuB;CACvB,MAAM,kBAAkB,OAAO,KAAK;CACpC,MAAM,CAAC,MAAM,WAAW,SAAS,MAAM;CACvC,MAAM,CAAC,WAAW,gBAAgB,SAAS,MAAM;CACjD,MAAM,WAAW,aAAa;CAC9B,MAAM,OAAa,cAAc,kBAAkB,GAAG,WAAW;AAEjE,aAAY,gBAAgB;AAC1B,MAAI,gBAAgB,QAClB,SAAQ,MAAM;AAEhB,kBAAgB,UAAU;GAC1B;AAEF,QACE,oBAAC;EACC,OAAO,eACE;GACL;GACA;GACA;GACA;GACA;GACA;GACA;GAC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CAAC,QAAQ,aAAa;IACpE;GAEC;;AAIX,SAAgB,qBAAqB,OAAgC;AACnE,QAAO,oBAAC;EAAmB,GAAI;YAAQ,MAAM;GAA8B;;AAG7E,SAAgB,eAAe,EAAE,UAAU,GAAG,SAAmC;CAC/E,MAAM,EAAE,YAAY,YAAY;AAEhC,QACE,oBAAC;EAAO,cAAW;EAAe,eAAe,SAAS,SAAS,CAAC,KAAK;EAAE,GAAI;EAC5E;GACM;;AAIb,SAAgB,uBAAuB,OAAiC;CACtE,MAAM,EAAE,WAAW,iBAAiB,YAAY;AAEhD,QACE,oBAAC;EACC,MAAK;EACL,cAAW;EACX,kBAAgB;EAChB,eAAe;AACb,iBAAc,SAAS,CAAC,KAAK;;EAE/B,GAAI;YAEH,MAAM;GACA;;;;;AAOb,SAAgB,cAAc,QAAiB,KAAoC;CACjF,MAAM,EAAE,SAAS,YAAY;AAE7B,iBAAgB;AACd,MAAI,UAAU,IAAI,QAChB,gBAAe,IAAI,SAAS;GAC1B,UAAU,SAAS,eAAe,SAAS,WAAW,sBAAsB,aAAa;GACzF,YAAY;GACb,CAAC;IAEH;EAAC;EAAQ;EAAM;EAAI,CAAC"}
1
+ {"version":3,"file":"base.js","names":[],"sources":["../../../src/components/sidebar/base.tsx"],"sourcesContent":["'use client';\nimport { ChevronDown, ExternalLink } from 'lucide-react';\nimport {\n type ComponentProps,\n createContext,\n type PointerEvent,\n type ReactNode,\n type RefObject,\n use,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport Link, { type LinkProps } from 'fumadocs-core/link';\nimport { useOnChange } from 'fumadocs-core/utils/use-on-change';\nimport { cn } from '@/utils/cn';\nimport { ScrollArea, type ScrollAreaProps, ScrollViewport } from '@/components/ui/scroll-area';\nimport {\n Collapsible,\n CollapsibleContent,\n type CollapsibleContentProps,\n CollapsibleTrigger,\n type CollapsibleTriggerProps,\n} from '@/components/ui/collapsible';\nimport { useMediaQuery } from 'fumadocs-core/utils/use-media-query';\nimport scrollIntoView from 'scroll-into-view-if-needed';\nimport { usePathname } from 'fumadocs-core/framework';\nimport ReactDOM from 'react-dom';\n\ninterface SidebarContext {\n open: boolean;\n setOpen: React.Dispatch<React.SetStateAction<boolean>>;\n collapsed: boolean;\n setCollapsed: React.Dispatch<React.SetStateAction<boolean>>;\n\n /**\n * When set to false, don't close the sidebar when navigate to another page\n */\n closeOnRedirect: RefObject<boolean>;\n defaultOpenLevel: number;\n prefetch?: boolean;\n mode: Mode;\n}\n\nexport interface SidebarProviderProps {\n /**\n * Open folders by default if their level is lower or equal to a specific level\n * (Starting from 1)\n *\n * @defaultValue 0\n */\n defaultOpenLevel?: number;\n\n /**\n * Prefetch links, default behaviour depends on your React.js framework.\n */\n prefetch?: boolean;\n\n children?: ReactNode;\n}\n\ntype Mode = 'drawer' | 'full';\n\nconst SidebarContext = createContext<SidebarContext | null>(null);\n\nconst FolderContext = createContext<{\n open: boolean;\n setOpen: React.Dispatch<React.SetStateAction<boolean>>;\n depth: number;\n collapsible: boolean;\n} | null>(null);\n\nexport function SidebarProvider({\n defaultOpenLevel = 0,\n prefetch,\n children,\n}: SidebarProviderProps) {\n const closeOnRedirect = useRef(true);\n const [open, setOpen] = useState(false);\n const [collapsed, setCollapsed] = useState(false);\n const pathname = usePathname();\n const mode: Mode = useMediaQuery('(width < 768px)') ? 'drawer' : 'full';\n\n useOnChange(pathname, () => {\n if (closeOnRedirect.current) {\n setOpen(false);\n }\n closeOnRedirect.current = true;\n });\n\n return (\n <SidebarContext\n value={useMemo(\n () => ({\n open,\n setOpen,\n collapsed,\n setCollapsed,\n closeOnRedirect,\n defaultOpenLevel,\n prefetch,\n mode,\n }),\n [open, collapsed, defaultOpenLevel, prefetch, mode],\n )}\n >\n {children}\n </SidebarContext>\n );\n}\n\nexport function useSidebar(): SidebarContext {\n const ctx = use(SidebarContext);\n if (!ctx)\n throw new Error(\n 'Missing SidebarContext, make sure you have wrapped the component in <DocsLayout /> and the context is available.',\n );\n\n return ctx;\n}\n\nexport function useFolder() {\n return use(FolderContext);\n}\n\nexport function useFolderDepth() {\n return use(FolderContext)?.depth ?? 0;\n}\n\nexport function SidebarContent({\n children,\n}: {\n children: (state: {\n ref: RefObject<HTMLElement | null>;\n collapsed: boolean;\n hovered: boolean;\n onPointerEnter: (event: PointerEvent) => void;\n onPointerLeave: (event: PointerEvent) => void;\n }) => ReactNode;\n}) {\n const { collapsed, mode } = useSidebar();\n const [hover, setHover] = useState(false);\n const ref = useRef<HTMLElement>(null);\n const timerRef = useRef(0);\n\n useOnChange(collapsed, () => {\n if (collapsed) setHover(false);\n });\n\n if (mode !== 'full') return;\n\n function shouldIgnoreHover(e: PointerEvent): boolean {\n const element = ref.current;\n if (!element) return true;\n\n return !collapsed || e.pointerType === 'touch' || element.getAnimations().length > 0;\n }\n\n return children({\n ref,\n collapsed,\n hovered: hover,\n onPointerEnter(e) {\n if (shouldIgnoreHover(e)) return;\n window.clearTimeout(timerRef.current);\n setHover(true);\n },\n onPointerLeave(e) {\n if (shouldIgnoreHover(e)) return;\n window.clearTimeout(timerRef.current);\n\n timerRef.current = window.setTimeout(\n () => setHover(false),\n // if mouse is leaving the viewport, add a close delay\n Math.min(e.clientX, document.body.clientWidth - e.clientX) > 100 ? 0 : 500,\n );\n },\n });\n}\n\nexport function SidebarDrawerOverlay(props: ComponentProps<'div'>) {\n const { open, setOpen, mode } = useSidebar();\n const [hidden, setHidden] = useState(!open);\n\n if (open && hidden) setHidden(false);\n if (mode !== 'drawer' || hidden) return;\n return (\n <div\n data-state={open ? 'open' : 'closed'}\n onClick={() => setOpen(false)}\n onAnimationEnd={() => {\n if (!open) ReactDOM.flushSync(() => setHidden(true));\n }}\n {...props}\n />\n );\n}\n\nexport function SidebarDrawerContent({ className, children, ...props }: ComponentProps<'aside'>) {\n const { open, mode } = useSidebar();\n const [hidden, setHidden] = useState(!open);\n\n if (open && hidden) setHidden(false);\n if (mode !== 'drawer') return;\n return (\n <aside\n id=\"nd-sidebar-mobile\"\n data-state={open ? 'open' : 'closed'}\n className={cn(hidden && 'invisible', className)}\n onAnimationEnd={() => {\n if (!open) ReactDOM.flushSync(() => setHidden(true));\n }}\n {...props}\n >\n {children}\n </aside>\n );\n}\n\nexport function SidebarViewport({ className, ...props }: ScrollAreaProps) {\n return (\n <ScrollArea\n className={(s) =>\n cn('min-h-0 flex-1', typeof className === 'function' ? className(s) : className)\n }\n {...props}\n >\n <ScrollViewport\n className=\"p-4 overscroll-contain\"\n style={\n {\n maskImage:\n 'linear-gradient(to bottom, transparent, white 12px, white calc(100% - 12px), transparent)',\n } as object\n }\n >\n {props.children}\n </ScrollViewport>\n </ScrollArea>\n );\n}\n\nexport function SidebarSeparator(props: ComponentProps<'p'>) {\n const depth = useFolderDepth();\n return (\n <p\n {...props}\n className={cn(\n 'inline-flex items-center gap-2 mb-1.5 px-2 mt-6 empty:mb-0',\n depth === 0 && 'first:mt-0',\n props.className,\n )}\n >\n {props.children}\n </p>\n );\n}\n\nexport function SidebarItem({\n icon,\n active = false,\n children,\n ...props\n}: LinkProps & {\n active?: boolean;\n icon?: ReactNode;\n}) {\n const ref = useRef<HTMLAnchorElement>(null);\n const { prefetch } = useSidebar();\n\n useAutoScroll(active, ref);\n\n return (\n <Link ref={ref} data-active={active} prefetch={prefetch} {...props}>\n {icon ?? (props.external ? <ExternalLink /> : null)}\n {children}\n </Link>\n );\n}\n\nexport function SidebarFolder({\n defaultOpen: defaultOpenProp,\n collapsible = true,\n active = false,\n children,\n ...props\n}: ComponentProps<'div'> & {\n active?: boolean;\n defaultOpen?: boolean;\n collapsible?: boolean;\n}) {\n const { defaultOpenLevel } = useSidebar();\n const depth = useFolderDepth() + 1;\n const defaultOpen =\n collapsible === false || active || (defaultOpenProp ?? defaultOpenLevel >= depth);\n const [open, setOpen] = useState(defaultOpen);\n\n useOnChange(defaultOpen, (v) => {\n if (v) setOpen(v);\n });\n\n return (\n <Collapsible open={open} onOpenChange={setOpen} disabled={!collapsible} {...props}>\n <FolderContext\n value={useMemo(() => ({ open, setOpen, depth, collapsible }), [collapsible, depth, open])}\n >\n {children}\n </FolderContext>\n </Collapsible>\n );\n}\n\nexport function SidebarFolderTrigger({ children, ...props }: CollapsibleTriggerProps) {\n const { open, collapsible } = use(FolderContext)!;\n\n if (collapsible) {\n return (\n <CollapsibleTrigger {...props}>\n {children}\n <ChevronDown\n data-icon\n className={cn('ms-auto transition-transform', !open && '-rotate-90 rtl:rotate-90')}\n />\n </CollapsibleTrigger>\n );\n }\n\n return <div {...(props as ComponentProps<'div'>)}>{children}</div>;\n}\n\nexport function SidebarFolderLink({\n children,\n active = false,\n ...props\n}: LinkProps & {\n active?: boolean;\n}) {\n const ref = useRef<HTMLAnchorElement>(null);\n const { open, setOpen, collapsible } = use(FolderContext)!;\n const { prefetch } = useSidebar();\n\n useAutoScroll(active, ref);\n\n return (\n <Link\n ref={ref}\n data-active={active}\n onClick={(e) => {\n if (!collapsible) return;\n\n if (e.target instanceof Element && e.target.matches('[data-icon], [data-icon] *')) {\n setOpen(!open);\n e.preventDefault();\n } else {\n setOpen(active ? !open : true);\n }\n }}\n prefetch={prefetch}\n {...props}\n >\n {children}\n {collapsible && (\n <ChevronDown\n data-icon\n className={cn('ms-auto transition-transform', !open && '-rotate-90 rtl:rotate-90')}\n />\n )}\n </Link>\n );\n}\n\nexport function SidebarFolderContent(props: CollapsibleContentProps) {\n return <CollapsibleContent {...props}>{props.children}</CollapsibleContent>;\n}\n\nexport function SidebarTrigger({ children, ...props }: ComponentProps<'button'>) {\n const { setOpen } = useSidebar();\n\n return (\n <button aria-label=\"Open Sidebar\" onClick={() => setOpen((prev) => !prev)} {...props}>\n {children}\n </button>\n );\n}\n\nexport function SidebarCollapseTrigger(props: ComponentProps<'button'>) {\n const { collapsed, setCollapsed } = useSidebar();\n\n return (\n <button\n type=\"button\"\n aria-label=\"Collapse Sidebar\"\n data-collapsed={collapsed}\n onClick={() => {\n setCollapsed((prev) => !prev);\n }}\n {...props}\n >\n {props.children}\n </button>\n );\n}\n\n/**\n * scroll to the element if `active` is true\n */\nexport function useAutoScroll(active: boolean, ref: RefObject<HTMLElement | null>) {\n const { mode } = useSidebar();\n\n useEffect(() => {\n if (active && ref.current) {\n scrollIntoView(ref.current, {\n boundary: document.getElementById(mode === 'drawer' ? 'nd-sidebar-mobile' : 'nd-sidebar'),\n scrollMode: 'if-needed',\n });\n }\n }, [active, mode, ref]);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgEA,MAAM,iBAAiB,cAAqC,KAAK;AAEjE,MAAM,gBAAgB,cAKZ,KAAK;AAEf,SAAgB,gBAAgB,EAC9B,mBAAmB,GACnB,UACA,YACuB;CACvB,MAAM,kBAAkB,OAAO,KAAK;CACpC,MAAM,CAAC,MAAM,WAAW,SAAS,MAAM;CACvC,MAAM,CAAC,WAAW,gBAAgB,SAAS,MAAM;CACjD,MAAM,WAAW,aAAa;CAC9B,MAAM,OAAa,cAAc,kBAAkB,GAAG,WAAW;AAEjE,aAAY,gBAAgB;AAC1B,MAAI,gBAAgB,QAClB,SAAQ,MAAM;AAEhB,kBAAgB,UAAU;GAC1B;AAEF,QACE,oBAAC;EACC,OAAO,eACE;GACL;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD,GACD;GAAC;GAAM;GAAW;GAAkB;GAAU;GAAK,CACpD;EAEA;GACc;;AAIrB,SAAgB,aAA6B;CAC3C,MAAM,MAAM,IAAI,eAAe;AAC/B,KAAI,CAAC,IACH,OAAM,IAAI,MACR,mHACD;AAEH,QAAO;;AAGT,SAAgB,YAAY;AAC1B,QAAO,IAAI,cAAc;;AAG3B,SAAgB,iBAAiB;AAC/B,QAAO,IAAI,cAAc,EAAE,SAAS;;AAGtC,SAAgB,eAAe,EAC7B,YASC;CACD,MAAM,EAAE,WAAW,SAAS,YAAY;CACxC,MAAM,CAAC,OAAO,YAAY,SAAS,MAAM;CACzC,MAAM,MAAM,OAAoB,KAAK;CACrC,MAAM,WAAW,OAAO,EAAE;AAE1B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AI;YAEH,MAAM;GACA;;;;;AAOb,SAAgB,cAAc,QAAiB,KAAoC;CACjF,MAAM,EAAE,SAAS,YAAY;AAE7B,iBAAgB;AACd,MAAI,UAAU,IAAI,QAChB,gBAAe,IAAI,SAAS;GAC1B,UAAU,SAAS,eAAe,SAAS,WAAW,sBAAsB,aAAa;GACzF,YAAY;GACb,CAAC;IAEH;EAAC;EAAQ;EAAM;EAAI,CAAC"}
@@ -5,7 +5,7 @@ import * as class_variance_authority_types0 from "class-variance-authority/types
5
5
  declare const buttonVariants: (props?: ({
6
6
  variant?: "primary" | "outline" | "ghost" | "secondary" | null | undefined;
7
7
  color?: "primary" | "outline" | "ghost" | "secondary" | null | undefined;
8
- size?: "icon" | "sm" | "icon-sm" | "icon-xs" | null | undefined;
8
+ size?: "sm" | "icon" | "icon-sm" | "icon-xs" | null | undefined;
9
9
  } & class_variance_authority_types0.ClassProp) | undefined) => string;
10
10
  type ButtonProps = VariantProps<typeof buttonVariants>;
11
11
  //#endregion
@@ -4,7 +4,7 @@ import * as class_variance_authority_types0 from "class-variance-authority/types
4
4
 
5
5
  //#region src/layouts/home/client.d.ts
6
6
  declare const navItemVariants: (props?: ({
7
- variant?: "button" | "main" | "icon" | null | undefined;
7
+ variant?: "icon" | "button" | "main" | null | undefined;
8
8
  } & class_variance_authority_types0.ClassProp) | undefined) => string;
9
9
  declare function Header({
10
10
  nav,
package/dist/style.css CHANGED
@@ -252,15 +252,15 @@
252
252
  .fd-steps {
253
253
  counter-reset: step;
254
254
  position: relative;
255
- margin-left: calc(var(--spacing) * 2);
256
- border-left-style: var(--tw-border-style);
257
- border-left-width: 1px;
258
- padding-left: calc(var(--spacing) * 6);
255
+ margin-inline-start: calc(var(--spacing) * 2);
256
+ border-inline-start-style: var(--tw-border-style);
257
+ border-inline-start-width: 1px;
258
+ padding-inline-start: calc(var(--spacing) * 6);
259
259
  @media (width >= 40rem) {
260
- margin-left: calc(var(--spacing) * 4);
260
+ margin-inline-start: calc(var(--spacing) * 4);
261
261
  }
262
262
  @media (width >= 40rem) {
263
- padding-left: calc(var(--spacing) * 7);
263
+ padding-inline-start: calc(var(--spacing) * 7);
264
264
  }
265
265
  }
266
266
  .absolute {
@@ -2726,6 +2726,11 @@
2726
2726
  scale: var(--tw-scale-x) var(--tw-scale-y);
2727
2727
  }
2728
2728
  }
2729
+ .rtl\:rotate-90 {
2730
+ &:where(:dir(rtl), [dir="rtl"], [dir="rtl"] *) {
2731
+ rotate: 90deg;
2732
+ }
2733
+ }
2729
2734
  .rtl\:rotate-180 {
2730
2735
  &:where(:dir(rtl), [dir="rtl"], [dir="rtl"] *) {
2731
2736
  rotate: 180deg;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fumadocs/base-ui",
3
- "version": "16.6.8",
3
+ "version": "16.6.9",
4
4
  "description": "The Base UI version of Fumadocs UI",
5
5
  "keywords": [
6
6
  "Docs",
@@ -122,17 +122,17 @@
122
122
  "unified": "^11.0.5",
123
123
  "@fumadocs/cli": "1.2.5",
124
124
  "eslint-config-custom": "0.0.0",
125
- "fumadocs-core": "16.6.8",
125
+ "fumadocs-core": "16.6.9",
126
126
  "tsconfig": "0.0.0"
127
127
  },
128
128
  "peerDependencies": {
129
- "@takumi-rs/image-response": "^0.68.17",
129
+ "@takumi-rs/image-response": "*",
130
130
  "@types/react": "*",
131
131
  "next": "16.x.x",
132
132
  "react": "^19.2.0",
133
133
  "react-dom": "^19.2.0",
134
134
  "tailwindcss": "^4.0.0",
135
- "fumadocs-core": "16.6.8"
135
+ "fumadocs-core": "16.6.9"
136
136
  },
137
137
  "peerDependenciesMeta": {
138
138
  "next": {