@fumadocs/api-docs 0.0.4 → 0.1.0

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.
@@ -1 +1 @@
1
- @source inline("!isDefined *:data-[collapsible=true]:order-last *:min-w-0 --min-height --radix-popover-content-available-width -mx-3 -translate-x-1/2 -translate-y-1/2 @container @default @fuma-translate/react @fumari/stf @md:grid-cols-2 @param @radix-ui/react-accordion @radix-ui/react-dialog @radix-ui/react-select [&_svg]:size-3.5 a absolute accordion actual additionalProperties again ajv aliasName allOf always an anchor anchorIdStartsWith anchorSegments and animate-spin any anyFields anyOf applicable aria-label array as asSchema autoIds avoid backdrop-blur-sm be behavior bg-black/30 bg-fd-background/50 bg-fd-muted bg-fd-popover bg-fd-primary bg-fd-secondary binary block blocks body boolean border border-b border-fd-primary/20 border-t both button buttonVariants catch children class-variance-authority className client clientHeight closed cn code col-span-full collapsible collisionPadding color const content createContext ctx current currentValue cva dark:text-yellow-400 data-[disabled]:opacity-50 data-[disabled]:pointer-events-none data-[state=closed]:animate-fd-accordion-up data-[state=closed]:animate-fd-dialog-out data-[state=closed]:animate-fd-fade-out data-[state=open]:animate-fd-accordion-down data-[state=open]:animate-fd-dialog-in data-[state=open]:animate-fd-fade-in data-[state=open]:text-fd-accent-foreground data-collapsible data-object-search-input data-placeholder:text-fd-muted-foreground dataEngine decoded default defaultCode defaultValue deferredValue define delete deprecated depth dereference dereferenceShallow dereferenced description disabled:cursor-not-allowed disabled:opacity-50 display displayName div doc docRoot duplicated duration-200 dynamic element else empty empty:hidden end end-2 engine ensure enum example examples exclusiveMax exclusiveMin export extends fallback false fd-scroll-container field fieldData fieldLabelVariants fieldName fields file files filtered first first:border-t-0 firstItemRef fixed flex flex-1 flex-col flex-col-reverse flex-row flex-wrap focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-fd-ring focus-within:[&_svg]:text-fd-primary focus-within:ring-2 focus-within:ring-fd-ring focus:bg-fd-accent focus:outline-none focus:ring focus:ring-fd-ring focus:text-fd-accent-foreground font-medium font-mono font-semibold for format forwardRef from function gap-0.5 gap-1 gap-1.5 gap-2 gap-4 generate generateDefault generated ghost grid grid-cols-1 group-data-[state=open]/accordion:rotate-90 group/accordion h-10 h-9 h-[240px] h-px hash hidden hiddenProperties highlighted hook hover:bg-fd-accent hover:text-fd-accent-foreground hover:underline htmlFor i icon-sm icon-xs id idx if ignore import in in-popover include index indexItemMatch info infoTags initial inline-flex inlines input inset-0 instanceof integer interface invalid is isDefined isDuplicated isDynamic isLazy isNumber isRequired it item itemId items items-center j json justify-center key kind label labelVariants lang last:border-b-0 lazy leading-none left-1/2 length let line-through list-disc list-inside lucide-react marker:text-fd-muted-foreground matching max max-h-[460px] max-w-(--radix-popover-content-available-width) max-w-full max-w-lg mb-auto md me-auto members merge mergeAllOf mergeRefs min min-h-(--min-height,200px) min-w-0 ms-auto mt-2 multiple must mx-1 my-1 my-2 my-2! name namespace nested never new next node not-prose note null number object objectSearchOverrides objects of omit onChange onClick onKeyDown onOpenAutoFocus onOpenChange onScrollEnd onValueChange oneOf only opacity-80 open opts or order-last out outline outline-none overflow-hidden overflow-x-auto overflow-y-hidden overview p-1 p-1.5 p-2 p-4 param parentItem parentPathIndex part path pathIndex pathName pattern patternProperties pb-0 pe-2 peer-disabled:cursor-not-allowed peer-disabled:opacity-70 placeholder placeholder:text-fd-muted-foreground playground popover popoverRef position prev preventScroll primitive prop properties property props prose-no-margin ps-1 ps-2 ps-3 ps-6 pt-0 px px-2 px-3 px-4 py-0 py-1 py-1.5 py-2 py-4 quiet range raw rawRef rawSearch re-triggering react read readOnly ref refs remove removeItem render renderCodeblock renderMarkdown renderTypeInfoTrigger represents required resize-none resolver return role root rootId rotate-90 rounded-lg rounded-md rounded-sm rounded-xl s-highlight same sample satisfies schema schemaPropKeys schemaToString scroll scroll-m-20 scrollTop search secondary section segments select-none selected selectedType sep setError setInfo setNextName setPath setSearch setShow setValue shadow-lg shadow-md shadow-sm show showExample showSelect shrink-0 simplified single size size-3.5 size-4 skipNonRequired skipReadOnly slotType sm sm:flex-row sm:gap-2 sm:justify-end sm:text-start smooth stable states status step stf sticky store strict string stringifyFieldKey such svg t tab tabDepth tabValues tags target text text-[0.8125rem] text-center text-end text-fd-foreground text-fd-muted-foreground text-fd-muted-foreground/70 text-fd-popover-foreground text-fd-primary text-fd-primary-foreground text-fd-secondary-foreground text-lg text-orange-400 text-red-400 text-red-400/80 text-sm text-start text-xs text-yellow-600 that the tiem to toolbar top top-0 top-1/2 top-10 top-2 tracking-tight transition-colors transition-transform translations trigger true truncate try type typeName typeVariants typeof types undefined underline union unionField unknown updateInfo updated url use useAnchorId useCopyButton useFieldValue useMemo useNamespace useObject useRef useState useTranslations validateFormats validateSchema value valueSchema values variant variants w-0 w-[600px] w-fit w-full will with wrap-break-word write writeOnly x-playground-lazy z-20 z-50");
1
+ @source inline("!isDefined *:data-[collapsible=true]:order-last *:min-w-0 --anchor-width --available-height --available-width --collapsible-panel-height --min-height --transform-origin -mx-3 -translate-x-1/2 -translate-y-1/2 @container @default @fuma-translate/react @fumari/stf @md:grid-cols-2 @param [&[hidden]:not([hidden='until-found'])]:hidden [&_svg]:size-3.5 a absolute accordion actual additionalProperties again ajv aliasName align allOf always an anchor anchorIdStartsWith anchorSegments and animate-spin any anyFields anyOf applicable aria-label array as asSchema autoIds avoid backdrop-blur-lg backdrop-blur-sm be behavior bg-black/30 bg-fd-background/50 bg-fd-muted bg-fd-popover bg-fd-popover/60 bg-fd-primary bg-fd-secondary binary block blocks body boolean border border-b border-fd-primary/20 border-t both bottom button buttonVariants catch center children class-variance-authority className client clientHeight closed cn code col-span-full collapsible color const content createContext ctx current currentValue cva dark:text-yellow-400 data-[closed]:animate-fd-popover-out data-[disabled]:opacity-50 data-[disabled]:pointer-events-none data-[ending-style]:animate-fd-accordion-up data-[highlighted]:bg-fd-accent data-[highlighted]:text-fd-accent-foreground data-[open]:animate-fd-popover-in data-[popup-open]:text-fd-accent-foreground data-[starting-style]:animate-fd-accordion-down data-closed:animate-fd-dialog-out data-closed:animate-fd-fade-out data-collapsible data-ending-style:h-0 data-ending-style:opacity-0 data-object-search-input data-open:animate-fd-dialog-in data-open:animate-fd-fade-in data-placeholder:text-fd-muted-foreground data-starting-style:h-0 data-starting-style:opacity-0 dataEngine decoded default defaultCode defaultValue deferredValue define delete deprecated depth dereference dereferenceShallow dereferenced description disabled:cursor-not-allowed disabled:opacity-50 display div doc docRoot duplicated duration-200 dynamic element else empty empty:hidden end end-2 engine ensure enum example examples exclusiveMax exclusiveMin export extends fallback false fd-scroll-container field fieldData fieldLabelVariants fieldName fields file files filtered first first:border-t-0 firstItemRef fixed flex flex-1 flex-col flex-col-reverse flex-row flex-wrap focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-fd-ring focus-within:[&_svg]:text-fd-primary focus-within:ring-2 focus-within:ring-fd-ring focus:outline-none focus:ring focus:ring-fd-ring font-medium font-mono font-semibold for format from function gap-0.5 gap-1 gap-1.5 gap-2 gap-4 generate generateDefault generated ghost grid grid-cols-1 group-data-[panel-open]/accordion:rotate-90 group/accordion h-(--collapsible-panel-height) h-10 h-9 h-[240px] h-px hash hidden hiddenProperties highlighted hook hover:bg-fd-accent hover:text-fd-accent-foreground hover:underline htmlFor i icon-sm icon-xs id idx if ignore import in in-popover include index indexItemMatch info infoTags initial inline-flex inlines input inset-0 instanceof integer interface invalid is isDefined isDuplicated isDynamic isLazy isNumber isRequired it item itemId items items-center j json justify-center key kind label labelVariants lang last:border-b-0 lazy leading-none left-1/2 length let line-through list-disc list-inside lucide-react marker:text-fd-muted-foreground matching max max-h-(--available-height) max-h-[460px] max-w-(--available-width) max-w-[98vw] max-w-full max-w-lg mb-auto md me-auto members merge mergeAllOf mergeRefs min min-h-(--min-height,200px) min-w-(--anchor-width) min-w-0 min-w-[240px] ms-auto mt-2 multiple must mx-1 my-1 my-2 my-2! name namespace nested never new next node not-prose note null number object objectSearchOverrides objects of omit onChange onClick onKeyDown onOpenChange onScrollEnd onValueChange oneOf only opacity-80 open opts or order-last origin-(--transform-origin) out outline outline-none overflow-hidden overflow-x-auto overflow-y-auto overflow-y-hidden overview p-1 p-1.5 p-2 p-4 param parentItem parentPathIndex part path pathIndex pathName pattern patternProperties pb-0 pe-2 peer-disabled:cursor-not-allowed peer-disabled:opacity-70 placeholder placeholder:text-fd-muted-foreground playground popover popoverRef prev preventScroll primitive prop properties property props prose-no-margin ps-1 ps-2 ps-3 ps-6 pt-0 px px-2 px-3 px-4 py-0 py-1 py-1.5 py-2 py-4 querySelector quiet range raw rawRef rawSearch re-triggering react read readOnly ref refs remove removeItem render renderCodeblock renderMarkdown renderTypeInfoTrigger represents required resize-none resolver return role root rootId rotate-90 rounded-lg rounded-md rounded-sm rounded-xl s-highlight same sample satisfies schema schemaPropKeys schemaToString scroll scroll-m-20 scrollTop search secondary section segments select-none selected selectedType sep setError setInfo setNextName setPath setSearch setShow setValue shadow-lg shadow-md shadow-sm show showExample showSelect shrink-0 side sideOffset simplified single size size-3.5 size-4 skipNonRequired skipReadOnly slotType sm sm:flex-row sm:gap-2 sm:justify-end sm:text-start smooth stable start states status step stf sticky store strict string stringifyFieldKey such svg t tab tabDepth tabValues tags target text text-[0.8125rem] text-center text-end text-fd-foreground text-fd-muted-foreground text-fd-muted-foreground/70 text-fd-popover-foreground text-fd-primary text-fd-primary-foreground text-fd-secondary-foreground text-lg text-orange-400 text-red-400 text-red-400/80 text-sm text-start text-xs text-yellow-600 that the tiem to toolbar top top-0 top-1/2 top-10 top-2 tracking-tight transition-[height,opacity] transition-colors transition-transform translations trigger true truncate try type typeName typeVariants typeof types undefined underline union unionField unknown updateInfo updated url use useAnchorId useCopyButton useFieldValue useMemo useNamespace useObject useRef useState useTranslations v validateFormats validateSchema value valueSchema values variant variants w-0 w-[600px] w-fit w-full will with wrap-break-word write writeOnly x-playground-lazy z-20 z-50");
@@ -1,22 +1,25 @@
1
1
  import { ComponentProps } from "react";
2
- import * as Primitive from "@radix-ui/react-accordion";
2
+ import { Accordion } from "@base-ui/react/accordion";
3
3
 
4
4
  //#region src/components/accordion.d.ts
5
5
  declare function Accordions({
6
6
  type,
7
7
  defaultValue,
8
8
  ...props
9
- }: Omit<ComponentProps<typeof Primitive.Root>, 'value' | 'onValueChange'>): import("react").JSX.Element;
9
+ }: Omit<ComponentProps<typeof Accordion.Root>, 'value' | 'defaultValue' | 'onValueChange'> & {
10
+ type?: 'single' | 'multiple';
11
+ defaultValue?: string | string[];
12
+ }): import("react").JSX.Element;
10
13
  declare function AccordionItem({
11
14
  value,
12
15
  className,
13
16
  anchorSegments,
14
17
  ...props
15
- }: ComponentProps<typeof Primitive.Item> & {
18
+ }: ComponentProps<typeof Accordion.Item> & {
16
19
  /** define the accordion as an anchor section */anchorSegments?: string[];
17
20
  }): import("react").JSX.Element;
18
- declare function AccordionContent(props: ComponentProps<typeof Primitive.Content>): import("react").JSX.Element;
19
- declare function AccordionHeader(props: ComponentProps<typeof Primitive.Header>): import("react").JSX.Element;
20
- declare function AccordionTrigger(props: ComponentProps<typeof Primitive.Trigger>): import("react").JSX.Element;
21
+ declare function AccordionContent(props: ComponentProps<typeof Accordion.Panel>): import("react").JSX.Element;
22
+ declare function AccordionHeader(props: ComponentProps<typeof Accordion.Header>): import("react").JSX.Element;
23
+ declare function AccordionTrigger(props: ComponentProps<typeof Accordion.Trigger>): import("react").JSX.Element;
21
24
  //#endregion
22
25
  export { AccordionContent, AccordionHeader, AccordionItem, AccordionTrigger, Accordions };
@@ -4,19 +4,23 @@ import { AnchorSection, useAnchorId } from "../auto-anchor/client.js";
4
4
  import { cn } from "../utils/cn.js";
5
5
  import { createContext, use, useEffect, useMemo, useState } from "react";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
- import * as Primitive from "@radix-ui/react-accordion";
7
+ import { Accordion } from "@base-ui/react/accordion";
8
8
  import { ChevronRight } from "lucide-react";
9
9
  //#region src/components/accordion.tsx
10
10
  const Context = createContext(null);
11
- function Accordions({ type, defaultValue, ...props }) {
12
- const [value, setValue] = useState(() => type === "multiple" ? defaultValue ?? [] : defaultValue ?? "");
11
+ function Accordions({ type = "single", defaultValue, ...props }) {
12
+ const [value, setValue] = useState(() => {
13
+ if (Array.isArray(defaultValue)) return defaultValue;
14
+ if (defaultValue) return [defaultValue];
15
+ return [];
16
+ });
13
17
  return /* @__PURE__ */ jsx(Context, {
14
18
  value: useMemo(() => ({
15
19
  type,
16
20
  setValue
17
21
  }), [type]),
18
- children: /* @__PURE__ */ jsx(Primitive.Root, {
19
- type,
22
+ children: /* @__PURE__ */ jsx(Accordion.Root, {
23
+ multiple: type === "multiple",
20
24
  value,
21
25
  onValueChange: setValue,
22
26
  ...props
@@ -27,13 +31,13 @@ function AccordionItem({ value, className, anchorSegments, ...props }) {
27
31
  const ctx = use(Context);
28
32
  const id = useAnchorId(anchorSegments ?? false);
29
33
  useEffect(() => {
30
- if (id && anchorIdStartsWith(window.location.hash.slice(1), id)) ctx.setValue(ctx.type === "single" ? value : [value]);
34
+ if (id && anchorIdStartsWith(window.location.hash.slice(1), id)) ctx.setValue([value]);
31
35
  }, [
32
36
  value,
33
37
  id,
34
38
  ctx
35
39
  ]);
36
- const content = /* @__PURE__ */ jsx(Primitive.Item, {
40
+ const content = /* @__PURE__ */ jsx(Accordion.Item, {
37
41
  value,
38
42
  className: cn("scroll-m-20 border-b last:border-b-0", className),
39
43
  ...props
@@ -44,23 +48,23 @@ function AccordionItem({ value, className, anchorSegments, ...props }) {
44
48
  }) : content;
45
49
  }
46
50
  function AccordionContent(props) {
47
- return /* @__PURE__ */ jsx(Primitive.Content, {
51
+ return /* @__PURE__ */ jsx(Accordion.Panel, {
48
52
  ...props,
49
- className: cn("overflow-hidden data-[state=closed]:animate-fd-accordion-up data-[state=open]:animate-fd-accordion-down", props.className)
53
+ className: cn("overflow-hidden data-[ending-style]:animate-fd-accordion-up data-[starting-style]:animate-fd-accordion-down", props.className)
50
54
  });
51
55
  }
52
56
  function AccordionHeader(props) {
53
- return /* @__PURE__ */ jsx(Primitive.Header, {
57
+ return /* @__PURE__ */ jsx(Accordion.Header, {
54
58
  ...props,
55
59
  className: cn("not-prose flex text-fd-foreground font-medium", props.className),
56
60
  children: props.children
57
61
  });
58
62
  }
59
63
  function AccordionTrigger(props) {
60
- return /* @__PURE__ */ jsxs(Primitive.Trigger, {
64
+ return /* @__PURE__ */ jsxs(Accordion.Trigger, {
61
65
  ...props,
62
66
  className: cn("flex flex-1 items-center gap-1 text-start group/accordion py-2 focus-visible:outline-none", props.className),
63
- children: [/* @__PURE__ */ jsx(ChevronRight, { className: "size-3.5 text-fd-muted-foreground shrink-0 transition-transform group-data-[state=open]/accordion:rotate-90" }), props.children]
67
+ children: [/* @__PURE__ */ jsx(ChevronRight, { className: "size-3.5 text-fd-muted-foreground shrink-0 transition-transform group-data-[panel-open]/accordion:rotate-90" }), props.children]
64
68
  });
65
69
  }
66
70
  //#endregion
@@ -0,0 +1,16 @@
1
+ import { ComponentProps } from "react";
2
+ import { Collapsible as Collapsible$1 } from "@base-ui/react/collapsible";
3
+
4
+ //#region src/components/collapsible.d.ts
5
+ declare const Collapsible: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").CollapsibleRootProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
6
+ declare const CollapsibleTrigger: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").CollapsibleTriggerProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
7
+ declare function CollapsibleContent({
8
+ children,
9
+ className,
10
+ ...props
11
+ }: ComponentProps<typeof Collapsible$1.Panel>): import("react").JSX.Element;
12
+ type CollapsibleProps = Collapsible$1.Root.Props;
13
+ type CollapsibleContentProps = Collapsible$1.Panel.Props;
14
+ type CollapsibleTriggerProps = Collapsible$1.Trigger.Props;
15
+ //#endregion
16
+ export { Collapsible, CollapsibleContent, CollapsibleContentProps, CollapsibleProps, CollapsibleTrigger, CollapsibleTriggerProps };
@@ -0,0 +1,16 @@
1
+ "use client";
2
+ import { cn } from "../utils/cn.js";
3
+ import { jsx } from "react/jsx-runtime";
4
+ import { Collapsible as Collapsible$1 } from "@base-ui/react/collapsible";
5
+ //#region src/components/collapsible.tsx
6
+ const Collapsible = Collapsible$1.Root;
7
+ const CollapsibleTrigger = Collapsible$1.Trigger;
8
+ function CollapsibleContent({ children, className, ...props }) {
9
+ return /* @__PURE__ */ jsx(Collapsible$1.Panel, {
10
+ ...props,
11
+ className: (s) => cn("overflow-hidden [&[hidden]:not([hidden='until-found'])]:hidden h-(--collapsible-panel-height) transition-[height,opacity] data-starting-style:opacity-0 data-starting-style:h-0 data-ending-style:h-0 data-ending-style:opacity-0", typeof className === "function" ? className(s) : className),
12
+ children
13
+ });
14
+ }
15
+ //#endregion
16
+ export { Collapsible, CollapsibleContent, CollapsibleTrigger };
@@ -1,22 +1,22 @@
1
1
  import { ComponentProps } from "react";
2
- import * as DialogPrimitive from "@radix-ui/react-dialog";
2
+ import { Dialog as Dialog$1 } from "@base-ui/react/dialog";
3
3
 
4
4
  //#region src/components/dialog.d.ts
5
- declare const Dialog: import("react").FC<DialogPrimitive.DialogProps>;
6
- declare const DialogTrigger: import("react").ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
7
- declare const DialogPortal: import("react").FC<DialogPrimitive.DialogPortalProps>;
8
- declare const DialogClose: import("react").ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & import("react").RefAttributes<HTMLButtonElement>>;
5
+ declare const Dialog: typeof Dialog$1.Root;
6
+ declare const DialogTrigger: Dialog$1.Trigger;
7
+ declare const DialogPortal: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").AlertDialogPortalProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
8
+ declare const DialogClose: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").AlertDialogCloseProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
9
9
  declare function DialogOverlay({
10
10
  className,
11
11
  ref,
12
12
  ...props
13
- }: ComponentProps<typeof DialogPrimitive.Overlay>): import("react").JSX.Element;
13
+ }: ComponentProps<typeof Dialog$1.Backdrop>): import("react").JSX.Element;
14
14
  declare function DialogContent({
15
15
  className,
16
16
  children,
17
17
  ref,
18
18
  ...props
19
- }: ComponentProps<typeof DialogPrimitive.Content>): import("react").JSX.Element;
19
+ }: ComponentProps<typeof Dialog$1.Popup>): import("react").JSX.Element;
20
20
  declare function DialogHeader({
21
21
  className,
22
22
  ...props
@@ -29,11 +29,11 @@ declare function DialogTitle({
29
29
  className,
30
30
  ref,
31
31
  ...props
32
- }: ComponentProps<typeof DialogPrimitive.Title>): import("react").JSX.Element;
32
+ }: ComponentProps<typeof Dialog$1.Title>): import("react").JSX.Element;
33
33
  declare function DialogDescription({
34
34
  className,
35
35
  ref,
36
36
  ...props
37
- }: ComponentProps<typeof DialogPrimitive.Description>): import("react").JSX.Element;
37
+ }: ComponentProps<typeof Dialog$1.Description>): import("react").JSX.Element;
38
38
  //#endregion
39
39
  export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger };
@@ -2,26 +2,26 @@
2
2
  import { cn } from "../utils/cn.js";
3
3
  import { jsx, jsxs } from "react/jsx-runtime";
4
4
  import { X } from "lucide-react";
5
- import * as DialogPrimitive from "@radix-ui/react-dialog";
5
+ import { Dialog as Dialog$1 } from "@base-ui/react/dialog";
6
6
  import { buttonVariants } from "fumadocs-ui/components/ui/button";
7
7
  //#region src/components/dialog.tsx
8
- const Dialog = DialogPrimitive.Root;
9
- const DialogTrigger = DialogPrimitive.Trigger;
10
- const DialogPortal = DialogPrimitive.Portal;
11
- const DialogClose = DialogPrimitive.Close;
8
+ const Dialog = Dialog$1.Root;
9
+ const DialogTrigger = Dialog$1.Trigger;
10
+ const DialogPortal = Dialog$1.Portal;
11
+ const DialogClose = Dialog$1.Close;
12
12
  function DialogOverlay({ className, ref, ...props }) {
13
- return /* @__PURE__ */ jsx(DialogPrimitive.Overlay, {
13
+ return /* @__PURE__ */ jsx(Dialog$1.Backdrop, {
14
14
  ref,
15
- className: cn("fixed inset-0 z-50 bg-black/30 backdrop-blur-sm data-[state=open]:animate-fd-fade-in data-[state=closed]:animate-fd-fade-out", className),
15
+ className: cn("fixed inset-0 z-50 bg-black/30 backdrop-blur-sm data-open:animate-fd-fade-in data-closed:animate-fd-fade-out", className),
16
16
  ...props
17
17
  });
18
18
  }
19
19
  function DialogContent({ className, children, ref, ...props }) {
20
- return /* @__PURE__ */ jsxs(DialogPortal, { children: [/* @__PURE__ */ jsx(DialogOverlay, {}), /* @__PURE__ */ jsxs(DialogPrimitive.Content, {
20
+ return /* @__PURE__ */ jsxs(DialogPortal, { children: [/* @__PURE__ */ jsx(DialogOverlay, {}), /* @__PURE__ */ jsxs(Dialog$1.Popup, {
21
21
  ref,
22
- className: cn("fixed left-1/2 top-1/2 z-50 flex flex-col gap-4 w-full max-w-lg -translate-x-1/2 -translate-y-1/2 border bg-fd-popover p-4 shadow-lg rounded-xl duration-200 data-[state=open]:animate-fd-dialog-in data-[state=closed]:animate-fd-dialog-out focus-visible:outline-none", className),
22
+ className: cn("fixed left-1/2 top-1/2 z-50 flex flex-col gap-4 w-full max-w-lg -translate-x-1/2 -translate-y-1/2 border bg-fd-popover p-4 shadow-lg rounded-xl duration-200 data-open:animate-fd-dialog-in data-closed:animate-fd-dialog-out focus-visible:outline-none", className),
23
23
  ...props,
24
- children: [children, /* @__PURE__ */ jsx(DialogPrimitive.Close, {
24
+ children: [children, /* @__PURE__ */ jsx(Dialog$1.Close, {
25
25
  "aria-label": "Close",
26
26
  className: cn(buttonVariants({
27
27
  size: "icon-sm",
@@ -44,14 +44,14 @@ function DialogFooter({ className, ...props }) {
44
44
  });
45
45
  }
46
46
  function DialogTitle({ className, ref, ...props }) {
47
- return /* @__PURE__ */ jsx(DialogPrimitive.Title, {
47
+ return /* @__PURE__ */ jsx(Dialog$1.Title, {
48
48
  ref,
49
49
  className: cn("text-lg font-semibold leading-none tracking-tight", className),
50
50
  ...props
51
51
  });
52
52
  }
53
53
  function DialogDescription({ className, ref, ...props }) {
54
- return /* @__PURE__ */ jsx(DialogPrimitive.Description, {
54
+ return /* @__PURE__ */ jsx(Dialog$1.Description, {
55
55
  ref,
56
56
  className: cn("text-sm text-fd-muted-foreground", className),
57
57
  ...props
@@ -1,8 +1,13 @@
1
- import * as React$1 from "react";
1
+ import * as React from "react";
2
2
 
3
3
  //#region src/components/input.d.ts
4
- type InputProps = React$1.InputHTMLAttributes<HTMLInputElement>;
4
+ type InputProps = React.ComponentProps<'input'>;
5
5
  declare const labelVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
6
- declare const Input: React$1.ForwardRefExoticComponent<InputProps & React$1.RefAttributes<HTMLInputElement>>;
6
+ declare function Input({
7
+ className,
8
+ type,
9
+ ref,
10
+ ...props
11
+ }: InputProps): React.JSX.Element;
7
12
  //#endregion
8
13
  export { Input, InputProps, labelVariants };
@@ -1,17 +1,16 @@
1
1
  import { cn } from "../utils/cn.js";
2
- import * as React$1 from "react";
2
+ import "react";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  import { cva } from "class-variance-authority";
5
5
  //#region src/components/input.tsx
6
6
  const labelVariants = cva("text-xs font-medium text-fd-foreground peer-disabled:cursor-not-allowed peer-disabled:opacity-70");
7
- const Input = React$1.forwardRef(({ className, type, ...props }, ref) => {
7
+ function Input({ className, type, ref, ...props }) {
8
8
  return /* @__PURE__ */ jsx("input", {
9
9
  type,
10
10
  className: cn("flex h-9 w-full rounded-md border bg-fd-secondary px-2 py-1.5 text-[0.8125rem] text-fd-secondary-foreground transition-colors placeholder:text-fd-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-fd-ring disabled:cursor-not-allowed disabled:opacity-50", className),
11
11
  ref,
12
12
  ...props
13
13
  });
14
- });
15
- Input.displayName = "Input";
14
+ }
16
15
  //#endregion
17
16
  export { Input, labelVariants };
@@ -43,7 +43,7 @@ function ObjectInput({ field: _field, fieldName, ...props }) {
43
43
  children: [
44
44
  isLazy && hiddenProperties.length > 0 && /* @__PURE__ */ jsxs(Select, {
45
45
  value: "",
46
- onValueChange: onAppend,
46
+ onValueChange: (v) => v !== null && onAppend(v),
47
47
  children: [/* @__PURE__ */ jsx(SelectTrigger, {
48
48
  className: "col-span-full",
49
49
  children: /* @__PURE__ */ jsx(SelectValue, { placeholder: t("Show Property") })
@@ -160,50 +160,62 @@ function FieldInput({ field, fieldName, isRequired, ...props }) {
160
160
  })] });
161
161
  if (field.enum && field.enum.length > 0) {
162
162
  const idx = field.enum.indexOf(value);
163
+ const items = [...field.enum.map((item, i) => ({
164
+ value: String(i),
165
+ label: typeof item === "string" ? item : JSON.stringify(item, null, 2)
166
+ })), ...!isRequired ? [{
167
+ value: "-1",
168
+ label: /* @__PURE__ */ jsx("span", {
169
+ className: "text-fd-muted-foreground",
170
+ children: t("Unset")
171
+ })
172
+ }] : []];
163
173
  return /* @__PURE__ */ jsxs(Select, {
174
+ items,
164
175
  value: idx === -1 && isRequired ? "" : String(idx),
165
176
  onValueChange: (v) => setValue(field.enum[Number(v)]),
166
177
  children: [/* @__PURE__ */ jsx(SelectTrigger, {
167
178
  id,
168
179
  ...props,
169
180
  children: /* @__PURE__ */ jsx(SelectValue, { placeholder: t("Select") })
170
- }), /* @__PURE__ */ jsxs(SelectContent, { children: [field.enum.map((item, i) => /* @__PURE__ */ jsx(SelectItem, {
171
- value: String(i),
172
- children: typeof item === "string" ? item : JSON.stringify(item, null, 2)
173
- }, i)), !isRequired && /* @__PURE__ */ jsx(SelectItem, {
174
- value: "-1",
175
- children: /* @__PURE__ */ jsx("span", {
176
- className: "text-fd-muted-foreground",
177
- children: t("Unset")
178
- })
179
- })] })]
181
+ }), /* @__PURE__ */ jsx(SelectContent, { children: items.map((item) => /* @__PURE__ */ jsx(SelectItem, {
182
+ value: item.value,
183
+ children: item.label
184
+ }, item.value)) })]
180
185
  });
181
186
  }
182
- if (field.type === "boolean") return /* @__PURE__ */ jsxs(Select, {
183
- value: String(value),
184
- onValueChange: (value) => setValue(value === "undefined" ? void 0 : value === "true"),
185
- children: [/* @__PURE__ */ jsx(SelectTrigger, {
186
- id,
187
- ...props,
188
- children: /* @__PURE__ */ jsx(SelectValue, {})
189
- }), /* @__PURE__ */ jsxs(SelectContent, { children: [
190
- /* @__PURE__ */ jsx(SelectItem, {
187
+ if (field.type === "boolean") {
188
+ const items = [
189
+ {
191
190
  value: "true",
192
- children: "True"
193
- }),
194
- /* @__PURE__ */ jsx(SelectItem, {
191
+ label: "True"
192
+ },
193
+ {
195
194
  value: "false",
196
- children: "False"
197
- }),
198
- !isRequired && /* @__PURE__ */ jsx(SelectItem, {
195
+ label: "False"
196
+ },
197
+ ...!isRequired ? [{
199
198
  value: "undefined",
200
- children: /* @__PURE__ */ jsx("span", {
199
+ label: /* @__PURE__ */ jsx("span", {
201
200
  className: "text-fd-muted-foreground",
202
201
  children: t("Unset")
203
202
  })
204
- })
205
- ] })]
206
- });
203
+ }] : []
204
+ ];
205
+ return /* @__PURE__ */ jsxs(Select, {
206
+ items,
207
+ value: value === void 0 && isRequired ? "" : String(value),
208
+ onValueChange: (value) => setValue(value === "undefined" ? void 0 : value === "true"),
209
+ children: [/* @__PURE__ */ jsx(SelectTrigger, {
210
+ id,
211
+ ...props,
212
+ children: /* @__PURE__ */ jsx(SelectValue, {})
213
+ }), /* @__PURE__ */ jsx(SelectContent, { children: items.map((item) => /* @__PURE__ */ jsx(SelectItem, {
214
+ value: item.value,
215
+ children: item.label
216
+ }, item.value)) })]
217
+ });
218
+ }
207
219
  const isNumber = field.type === "integer" || field.type === "number";
208
220
  return /* @__PURE__ */ jsx(Input, {
209
221
  id,
@@ -0,0 +1,15 @@
1
+ import * as React from "react";
2
+ import { Popover as Popover$1 } from "@base-ui/react/popover";
3
+
4
+ //#region src/components/popover.d.ts
5
+ declare const Popover: typeof Popover$1.Root;
6
+ declare const PopoverTrigger: Popover$1.Trigger;
7
+ declare function PopoverContent({
8
+ className,
9
+ align,
10
+ sideOffset,
11
+ ...props
12
+ }: React.ComponentProps<typeof Popover$1.Popup> & Pick<Popover$1.Positioner.Props, 'sideOffset' | 'align'>): React.JSX.Element;
13
+ declare const PopoverClose: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").PopoverCloseProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
14
+ //#endregion
15
+ export { Popover, PopoverClose, PopoverContent, PopoverTrigger };
@@ -0,0 +1,23 @@
1
+ "use client";
2
+ import { cn } from "../utils/cn.js";
3
+ import "react";
4
+ import { jsx } from "react/jsx-runtime";
5
+ import { Popover as Popover$1 } from "@base-ui/react/popover";
6
+ //#region src/components/popover.tsx
7
+ const Popover = Popover$1.Root;
8
+ const PopoverTrigger = Popover$1.Trigger;
9
+ function PopoverContent({ className, align = "center", sideOffset = 4, ...props }) {
10
+ return /* @__PURE__ */ jsx(Popover$1.Portal, { children: /* @__PURE__ */ jsx(Popover$1.Positioner, {
11
+ align,
12
+ side: "bottom",
13
+ sideOffset,
14
+ className: "z-50",
15
+ children: /* @__PURE__ */ jsx(Popover$1.Popup, {
16
+ className: (s) => cn("z-50 origin-(--transform-origin) overflow-y-auto max-h-(--available-height) min-w-[240px] max-w-[98vw] rounded-xl border bg-fd-popover/60 backdrop-blur-lg p-2 text-sm text-fd-popover-foreground shadow-lg focus-visible:outline-none data-[closed]:animate-fd-popover-out data-[open]:animate-fd-popover-in", typeof className === "function" ? className(s) : className),
17
+ ...props
18
+ })
19
+ }) });
20
+ }
21
+ const PopoverClose = Popover$1.Close;
22
+ //#endregion
23
+ export { Popover, PopoverClose, PopoverContent, PopoverTrigger };
@@ -1,6 +1,7 @@
1
1
  "use client";
2
2
  import { useAnchorId } from "../../auto-anchor/client.js";
3
3
  import { cn } from "../../utils/cn.js";
4
+ import { Popover, PopoverContent, PopoverTrigger } from "../popover.js";
4
5
  import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../select.js";
5
6
  import { mergeRefs } from "../../utils/merge-refs.js";
6
7
  import { Fragment, Suspense, createContext, use, useCallback, useDeferredValue, useEffect, useMemo, useRef, useState } from "react";
@@ -9,10 +10,9 @@ import { CheckIcon, FilterIcon, LinkIcon } from "lucide-react";
9
10
  import { buttonVariants } from "fumadocs-ui/components/ui/button";
10
11
  import { cva } from "class-variance-authority";
11
12
  import { useTranslations } from "@fuma-translate/react";
12
- import { Popover, PopoverContent, PopoverTrigger } from "fumadocs-ui/components/ui/popover";
13
13
  import { useCopyButton } from "fumadocs-ui/utils/use-copy-button";
14
14
  //#region src/components/schema/client.tsx
15
- const typeVariants = cva("text-sm text-start text-fd-muted-foreground font-mono", { variants: { variant: { trigger: "underline hover:text-fd-accent-foreground data-[state=open]:text-fd-accent-foreground" } } });
15
+ const typeVariants = cva("text-sm text-start text-fd-muted-foreground font-mono", { variants: { variant: { trigger: "underline hover:text-fd-accent-foreground data-[popup-open]:text-fd-accent-foreground" } } });
16
16
  const Context = createContext(null);
17
17
  function useStates() {
18
18
  return use(Context);
@@ -68,17 +68,10 @@ function SchemaUI({ name, required = false, as = "property", generated }) {
68
68
  children
69
69
  }), /* @__PURE__ */ jsx(PopoverContent, {
70
70
  ref: popoverRef,
71
- collisionPadding: 10,
72
- className: "w-[600px] max-w-(--radix-popover-content-available-width) min-h-(--min-height,200px) fd-scroll-container max-h-[460px] px-3 pt-0",
71
+ className: "w-[600px] max-w-(--available-width) min-h-(--min-height,200px) fd-scroll-container max-h-[460px] px-3 pt-0",
73
72
  onScrollEnd: (e) => {
74
73
  path.at(-1).scrollTop = e.target.scrollTop;
75
74
  },
76
- onOpenAutoFocus: (e) => {
77
- const input = e.target.querySelector("input[data-object-search-input]");
78
- if (!(input instanceof HTMLInputElement)) return;
79
- input.focus({ preventScroll: true });
80
- e.preventDefault();
81
- },
82
75
  children: /* @__PURE__ */ jsx(SchemaUIPopover, {})
83
76
  })]
84
77
  })
@@ -195,8 +188,10 @@ function PathItemBody({ pathIndex, asSchema, tabDepth = 0, objectSearchOverrides
195
188
  value: item.$type
196
189
  }));
197
190
  return /* @__PURE__ */ jsxs(Select, {
191
+ items,
198
192
  value,
199
193
  onValueChange: (v) => {
194
+ if (!v) return;
200
195
  const next = [...path];
201
196
  (next[pathIndex].tabValues ??= []).splice(tabDepth, 1, v);
202
197
  setPath(next);
@@ -210,7 +205,7 @@ function PathItemBody({ pathIndex, asSchema, tabDepth = 0, objectSearchOverrides
210
205
  }),
211
206
  /* @__PURE__ */ jsx(SelectTrigger, {
212
207
  className: "not-prose w-fit min-w-0 mb-auto *:min-w-0",
213
- children: /* @__PURE__ */ jsx(SelectValue, { children: items.find((item) => item.value === value)?.label })
208
+ children: /* @__PURE__ */ jsx(SelectValue, {})
214
209
  }),
215
210
  /* @__PURE__ */ jsx(SelectContent, { children: items.map(({ label, value }) => /* @__PURE__ */ jsx(SelectItem, {
216
211
  value,
@@ -322,7 +317,11 @@ function BlockTag({ label, children }) {
322
317
  function SchemaUIPopover() {
323
318
  const states = useStates();
324
319
  const { path, setPath } = states;
325
- return /* @__PURE__ */ jsxs(Context, {
320
+ const ref = useRef(null);
321
+ useEffect(() => {
322
+ ref.current?.querySelector("input[data-object-search-input]")?.focus({ preventScroll: true });
323
+ }, [path]);
324
+ return /* @__PURE__ */ jsx(Context, {
326
325
  value: useMemo(() => ({
327
326
  ...states,
328
327
  renderTypeInfoTrigger: ({ $ref, pathName, children }) => /* @__PURE__ */ jsx("button", {
@@ -338,26 +337,29 @@ function SchemaUIPopover() {
338
337
  setPath,
339
338
  path
340
339
  ]),
341
- children: [/* @__PURE__ */ jsx("div", {
342
- className: "sticky top-0 -mx-3 flex overflow-x-auto overflow-y-hidden items-center text-sm font-medium font-mono bg-fd-secondary text-fd-secondary-foreground px-3 h-10 border-b z-20",
343
- children: path.map((item, i) => {
344
- if (i === 0) return;
345
- const isDuplicated = path.some((other, j) => j !== i && other.$ref === item.$ref);
346
- let text;
347
- const indexItemMatch = /^\[(\w+): (\w+)]$/.exec(item.name);
348
- if (indexItemMatch) text = `[${indexItemMatch[1]}]`;
349
- else if (i > 1) text = `.${item.name}`;
350
- else text = item.name;
351
- return /* @__PURE__ */ jsx("button", {
352
- onClick: () => setPath(path.slice(0, i + 1)),
353
- className: cn("hover:underline hover:text-fd-accent-foreground", isDuplicated && "text-orange-400"),
354
- children: text
355
- }, i);
356
- })
357
- }), /* @__PURE__ */ jsx(PathItemBody, {
358
- pathIndex: path.length - 1,
359
- objectSearchOverrides: { variant: "in-popover" }
360
- })]
340
+ children: /* @__PURE__ */ jsxs("div", {
341
+ ref,
342
+ children: [/* @__PURE__ */ jsx("div", {
343
+ className: "sticky top-0 -mx-3 flex overflow-x-auto overflow-y-hidden items-center text-sm font-medium font-mono bg-fd-secondary text-fd-secondary-foreground px-3 h-10 border-b z-20",
344
+ children: path.map((item, i) => {
345
+ if (i === 0) return;
346
+ const isDuplicated = path.some((other, j) => j !== i && other.$ref === item.$ref);
347
+ let text;
348
+ const indexItemMatch = /^\[(\w+): (\w+)]$/.exec(item.name);
349
+ if (indexItemMatch) text = `[${indexItemMatch[1]}]`;
350
+ else if (i > 1) text = `.${item.name}`;
351
+ else text = item.name;
352
+ return /* @__PURE__ */ jsx("button", {
353
+ onClick: () => setPath(path.slice(0, i + 1)),
354
+ className: cn("hover:underline hover:text-fd-accent-foreground", isDuplicated && "text-orange-400"),
355
+ children: text
356
+ }, i);
357
+ })
358
+ }), /* @__PURE__ */ jsx(PathItemBody, {
359
+ pathIndex: path.length - 1,
360
+ objectSearchOverrides: { variant: "in-popover" }
361
+ })]
362
+ })
361
363
  });
362
364
  }
363
365
  function TypeInfoTrigger({ pathName, $ref, children }) {
@@ -37,15 +37,13 @@ function SelectTab({ value, anchorSegments, ...props }) {
37
37
  function SelectTabTrigger({ items, className, placeholder, ...props }) {
38
38
  const { value, setValue } = use(Context);
39
39
  return /* @__PURE__ */ jsxs(Select, {
40
- value: value ?? "",
40
+ items,
41
+ value,
41
42
  onValueChange: setValue,
42
43
  children: [/* @__PURE__ */ jsx(SelectTrigger, {
43
44
  className: cn("not-prose w-fit min-w-0 *:min-w-0", className),
44
45
  ...props,
45
- children: /* @__PURE__ */ jsx(SelectValue, {
46
- placeholder,
47
- children: value && items.find((item) => item.value === value)?.label
48
- })
46
+ children: /* @__PURE__ */ jsx(SelectValue, { placeholder })
49
47
  }), /* @__PURE__ */ jsx(SelectContent, { children: items.map(({ label, value }) => /* @__PURE__ */ jsx(SelectItem, {
50
48
  value,
51
49
  children: label
@@ -1,16 +1,50 @@
1
- import React from "react";
2
- import * as SelectPrimitive from "@radix-ui/react-select";
1
+ import * as React from "react";
2
+ import { Select as Select$1 } from "@base-ui/react/select";
3
3
 
4
4
  //#region src/components/select.d.ts
5
- declare const Select: React.FC<SelectPrimitive.SelectProps>;
6
- declare const SelectGroup: React.ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & React.RefAttributes<HTMLDivElement>>;
7
- declare const SelectValue: React.ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & React.RefAttributes<HTMLSpanElement>>;
8
- declare const SelectTrigger: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
9
- declare const SelectScrollUpButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollUpButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
10
- declare const SelectScrollDownButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollDownButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
11
- declare const SelectContent: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
12
- declare const SelectLabel: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
13
- declare const SelectItem: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
14
- declare const SelectSeparator: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
5
+ declare const Select: typeof Select$1.Root;
6
+ declare const SelectGroup: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").SelectGroupProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
7
+ declare const SelectValue: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").SelectValueProps, "ref"> & React.RefAttributes<HTMLSpanElement>>;
8
+ declare function SelectTrigger({
9
+ className,
10
+ children,
11
+ ref,
12
+ ...props
13
+ }: React.ComponentProps<typeof Select$1.Trigger>): React.JSX.Element;
14
+ declare function SelectScrollUpButton({
15
+ className,
16
+ ref,
17
+ ...props
18
+ }: React.ComponentProps<typeof Select$1.ScrollUpArrow>): React.JSX.Element;
19
+ declare function SelectScrollDownButton({
20
+ className,
21
+ ref,
22
+ ...props
23
+ }: React.ComponentProps<typeof Select$1.ScrollDownArrow>): React.JSX.Element;
24
+ declare function SelectContent({
25
+ className,
26
+ children,
27
+ align,
28
+ side,
29
+ sideOffset,
30
+ ref,
31
+ ...props
32
+ }: React.ComponentProps<typeof Select$1.Popup> & Pick<React.ComponentProps<typeof Select$1.Positioner>, 'align' | 'side' | 'sideOffset'>): React.JSX.Element;
33
+ declare function SelectLabel({
34
+ className,
35
+ ref,
36
+ ...props
37
+ }: React.ComponentProps<typeof Select$1.GroupLabel>): React.JSX.Element;
38
+ declare function SelectItem({
39
+ className,
40
+ children,
41
+ ref,
42
+ ...props
43
+ }: React.ComponentProps<typeof Select$1.Item>): React.JSX.Element;
44
+ declare function SelectSeparator({
45
+ className,
46
+ ref,
47
+ ...props
48
+ }: React.ComponentProps<typeof Select$1.Separator>): React.JSX.Element;
15
49
  //#endregion
16
50
  export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue };
@@ -1,72 +1,84 @@
1
1
  import { cn } from "../utils/cn.js";
2
- import { forwardRef } from "react";
2
+ import "react";
3
3
  import { jsx, jsxs } from "react/jsx-runtime";
4
4
  import { Check, ChevronDown, ChevronUp } from "lucide-react";
5
- import * as SelectPrimitive from "@radix-ui/react-select";
5
+ import { Select as Select$1 } from "@base-ui/react/select";
6
6
  //#region src/components/select.tsx
7
- const Select = SelectPrimitive.Root;
8
- const SelectGroup = SelectPrimitive.Group;
9
- const SelectValue = SelectPrimitive.Value;
10
- const SelectTrigger = forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(SelectPrimitive.Trigger, {
11
- ref,
12
- className: cn("flex items-center w-full rounded-md border p-2 gap-2 text-start text-sm text-fd-secondary-foreground bg-fd-secondary hover:bg-fd-accent focus:outline-none focus:ring focus:ring-fd-ring disabled:cursor-not-allowed disabled:opacity-50 data-placeholder:text-fd-muted-foreground", className),
13
- ...props,
14
- children: [children, /* @__PURE__ */ jsx(SelectPrimitive.Icon, {
15
- asChild: true,
16
- children: /* @__PURE__ */ jsx(ChevronDown, { className: "ms-auto size-3.5 text-fd-muted-foreground shrink-0" })
17
- })]
18
- }));
19
- SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
20
- const SelectScrollUpButton = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(SelectPrimitive.ScrollUpButton, {
21
- ref,
22
- className: cn("flex items-center justify-center py-1", className),
23
- ...props,
24
- children: /* @__PURE__ */ jsx(ChevronUp, { className: "size-4" })
25
- }));
26
- SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
27
- const SelectScrollDownButton = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(SelectPrimitive.ScrollDownButton, {
28
- ref,
29
- className: cn("flex items-center justify-center py-1", className),
30
- ...props,
31
- children: /* @__PURE__ */ jsx(ChevronDown, { className: "size-4" })
32
- }));
33
- SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
34
- const SelectContent = forwardRef(({ className, children, position, ...props }, ref) => /* @__PURE__ */ jsx(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs(SelectPrimitive.Content, {
35
- ref,
36
- className: cn("z-50 overflow-hidden rounded-lg border bg-fd-popover text-fd-popover-foreground shadow-md", className),
37
- position,
38
- ...props,
39
- children: [
40
- /* @__PURE__ */ jsx(SelectScrollUpButton, {}),
41
- /* @__PURE__ */ jsx(SelectPrimitive.Viewport, {
42
- className: "p-1",
43
- children
44
- }),
45
- /* @__PURE__ */ jsx(SelectScrollDownButton, {})
46
- ]
47
- }) }));
48
- SelectContent.displayName = SelectPrimitive.Content.displayName;
49
- const SelectLabel = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(SelectPrimitive.Label, {
50
- ref,
51
- className: cn("py-1.5 pe-2 ps-6 text-sm font-semibold", className),
52
- ...props
53
- }));
54
- SelectLabel.displayName = SelectPrimitive.Label.displayName;
55
- const SelectItem = forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(SelectPrimitive.Item, {
56
- ref,
57
- className: cn("flex select-none flex-row items-center rounded-md py-1.5 px-2 text-sm outline-none focus:bg-fd-accent focus:text-fd-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className),
58
- ...props,
59
- children: [/* @__PURE__ */ jsx(SelectPrimitive.ItemText, { children }), /* @__PURE__ */ jsx(SelectPrimitive.ItemIndicator, {
60
- className: "ms-auto",
61
- children: /* @__PURE__ */ jsx(Check, { className: "size-3.5 text-fd-primary" })
62
- })]
63
- }));
64
- SelectItem.displayName = SelectPrimitive.Item.displayName;
65
- const SelectSeparator = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(SelectPrimitive.Separator, {
66
- ref,
67
- className: cn("my-1 h-px bg-fd-muted", className),
68
- ...props
69
- }));
70
- SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
7
+ const Select = Select$1.Root;
8
+ const SelectGroup = Select$1.Group;
9
+ const SelectValue = Select$1.Value;
10
+ function SelectTrigger({ className, children, ref, ...props }) {
11
+ return /* @__PURE__ */ jsxs(Select$1.Trigger, {
12
+ ref,
13
+ className: cn("flex items-center w-full rounded-md border p-2 gap-2 text-start text-sm text-fd-secondary-foreground bg-fd-secondary hover:bg-fd-accent focus:outline-none focus:ring focus:ring-fd-ring disabled:cursor-not-allowed disabled:opacity-50 data-placeholder:text-fd-muted-foreground", className),
14
+ ...props,
15
+ children: [children, /* @__PURE__ */ jsx(Select$1.Icon, {
16
+ className: "ms-auto text-fd-muted-foreground shrink-0",
17
+ children: /* @__PURE__ */ jsx(ChevronDown, { className: "size-3.5" })
18
+ })]
19
+ });
20
+ }
21
+ function SelectScrollUpButton({ className, ref, ...props }) {
22
+ return /* @__PURE__ */ jsx(Select$1.ScrollUpArrow, {
23
+ ref,
24
+ className: cn("flex items-center justify-center py-1", className),
25
+ ...props,
26
+ children: /* @__PURE__ */ jsx(ChevronUp, { className: "size-4" })
27
+ });
28
+ }
29
+ function SelectScrollDownButton({ className, ref, ...props }) {
30
+ return /* @__PURE__ */ jsx(Select$1.ScrollDownArrow, {
31
+ ref,
32
+ className: cn("flex items-center justify-center py-1", className),
33
+ ...props,
34
+ children: /* @__PURE__ */ jsx(ChevronDown, { className: "size-4" })
35
+ });
36
+ }
37
+ function SelectContent({ className, children, align = "start", side = "bottom", sideOffset = 4, ref, ...props }) {
38
+ return /* @__PURE__ */ jsx(Select$1.Portal, { children: /* @__PURE__ */ jsx(Select$1.Positioner, {
39
+ align,
40
+ side,
41
+ sideOffset,
42
+ className: "z-50",
43
+ children: /* @__PURE__ */ jsxs(Select$1.Popup, {
44
+ ref,
45
+ className: cn("z-50 min-w-(--anchor-width) overflow-hidden rounded-lg border bg-fd-popover text-fd-popover-foreground shadow-md", className),
46
+ ...props,
47
+ children: [
48
+ /* @__PURE__ */ jsx(SelectScrollUpButton, {}),
49
+ /* @__PURE__ */ jsx(Select$1.List, {
50
+ className: "p-1",
51
+ children
52
+ }),
53
+ /* @__PURE__ */ jsx(SelectScrollDownButton, {})
54
+ ]
55
+ })
56
+ }) });
57
+ }
58
+ function SelectLabel({ className, ref, ...props }) {
59
+ return /* @__PURE__ */ jsx(Select$1.GroupLabel, {
60
+ ref,
61
+ className: cn("py-1.5 pe-2 ps-6 text-sm font-semibold", className),
62
+ ...props
63
+ });
64
+ }
65
+ function SelectItem({ className, children, ref, ...props }) {
66
+ return /* @__PURE__ */ jsxs(Select$1.Item, {
67
+ ref,
68
+ className: cn("flex select-none flex-row items-center rounded-md py-1.5 px-2 text-sm outline-none data-[highlighted]:bg-fd-accent data-[highlighted]:text-fd-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className),
69
+ ...props,
70
+ children: [/* @__PURE__ */ jsx(Select$1.ItemText, { children }), /* @__PURE__ */ jsx(Select$1.ItemIndicator, {
71
+ className: "ms-auto",
72
+ children: /* @__PURE__ */ jsx(Check, { className: "size-3.5 text-fd-primary" })
73
+ })]
74
+ });
75
+ }
76
+ function SelectSeparator({ className, ref, ...props }) {
77
+ return /* @__PURE__ */ jsx(Select$1.Separator, {
78
+ ref,
79
+ className: cn("my-1 h-px bg-fd-muted", className),
80
+ ...props
81
+ });
82
+ }
71
83
  //#endregion
72
84
  export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue };
@@ -306,4 +306,4 @@ function isInsideIdScope(inventory, entry) {
306
306
  return false;
307
307
  }
308
308
  //#endregion
309
- export { bundle };
309
+ export { $RefParser, bundle };
@@ -38,4 +38,4 @@ function normalizeArgs(_args) {
38
38
  };
39
39
  }
40
40
  //#endregion
41
- export { normalizeArgs as default };
41
+ export { normalizeArgs as default, normalizeArgs };
@@ -25,4 +25,4 @@ interface $RefParserOptions<S extends object = JSONSchema> {
25
25
  }
26
26
  type ParserOptions<S extends object = JSONSchema> = DeepPartial<$RefParserOptions<S>>;
27
27
  //#endregion
28
- export { BundleOptions, ParserOptions };
28
+ export { $RefParserOptions, BundleOptions, DeepPartial, ParserOptions };
@@ -24,4 +24,4 @@ const getNewOptions = (options) => {
24
24
  return mergeDeep(defaults, options);
25
25
  };
26
26
  //#endregion
27
- export { getNewOptions };
27
+ export { getJsonSchemaRefParserDefaultOptions, getNewOptions };
@@ -188,7 +188,7 @@ var $Ref = class $Ref {
188
188
  * @param options - The options
189
189
  * @returns - Returns the dereferenced value
190
190
  */
191
- static dereference($ref, resolvedValue, options) {
191
+ static dereference($ref, resolvedValue, _options) {
192
192
  if (resolvedValue && typeof resolvedValue === "object" && $Ref.isExtended$Ref($ref)) {
193
193
  const merged = {};
194
194
  for (const key of Object.keys($ref)) if (key !== "$ref") merged[key] = $ref[key];
@@ -98,4 +98,4 @@ interface FileInfo {
98
98
  data: string | Buffer;
99
99
  }
100
100
  //#endregion
101
- export { JSONSchema$2 as JSONSchema, JSONSchemaObject, Plugin, ResolverOptions, SchemaCallback };
101
+ export { FileInfo, JSONSchema$2 as JSONSchema, JSONSchemaObject, Plugin, ResolverOptions, SchemaCallback };
@@ -125,4 +125,4 @@ function normalizeError(err) {
125
125
  return err;
126
126
  }
127
127
  //#endregion
128
- export { InvalidPointerError, JSONParserError, JSONParserErrorGroup, MissingPointerError, ParserError, ResolverError, UnmatchedParserError, UnmatchedResolverError, isHandledError, normalizeError };
128
+ export { InvalidPointerError, JSONParserError, JSONParserErrorGroup, MissingPointerError, ParserError, ResolverError, UnmatchedParserError, UnmatchedResolverError, getDeepKeys, isHandledError, normalizeError, toJSON };
@@ -203,4 +203,4 @@ function safePointerToPath(pointer) {
203
203
  return decodeInternalRef(pointer);
204
204
  }
205
205
  //#endregion
206
- export { cwd, fromFileSystemPath, getExtension, getHash, isFileSystemPath, resolve, safePointerToPath, stripHash, toFileSystemPath };
206
+ export { cwd, fromFileSystemPath, getExtension, getHash, getProtocol, isFileSystemPath, resolve, safePointerToPath, stripHash, stripQuery, toFileSystemPath };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fumadocs/api-docs",
3
- "version": "0.0.4",
3
+ "version": "0.1.0",
4
4
  "description": "Shared utils for API docs generation",
5
5
  "keywords": [
6
6
  "Docs",
@@ -23,10 +23,12 @@
23
23
  "./auto-anchor/client": "./dist/auto-anchor/client.js",
24
24
  "./codegen": "./dist/codegen.js",
25
25
  "./components/accordion": "./dist/components/accordion.js",
26
+ "./components/collapsible": "./dist/components/collapsible.js",
26
27
  "./components/dialog": "./dist/components/dialog.js",
27
28
  "./components/input": "./dist/components/input.js",
28
29
  "./components/playground/inputs": "./dist/components/playground/inputs.js",
29
30
  "./components/playground/schema": "./dist/components/playground/schema.js",
31
+ "./components/popover": "./dist/components/popover.js",
30
32
  "./components/schema": "./dist/components/schema/index.js",
31
33
  "./components/schema/client": "./dist/components/schema/client.js",
32
34
  "./components/select": "./dist/components/select.js",
@@ -50,28 +52,26 @@
50
52
  "access": "public"
51
53
  },
52
54
  "dependencies": {
55
+ "@base-ui/react": "^1.6.0",
53
56
  "@fuma-translate/react": "^1.0.2",
54
- "@radix-ui/react-accordion": "^1.2.14",
55
- "@radix-ui/react-dialog": "^1.1.17",
56
- "@radix-ui/react-select": "^2.3.1",
57
57
  "class-variance-authority": "^0.7.1",
58
58
  "cnfast": "^0.0.8",
59
59
  "github-slugger": "^2.0.0",
60
- "js-yaml": "^5.1.0",
61
- "lucide-react": "^1.21.0",
62
- "@fumari/stf": "1.0.5"
60
+ "js-yaml": "^5.2.1",
61
+ "lucide-react": "^1.23.0",
62
+ "@fumari/stf": "1.1.0"
63
63
  },
64
64
  "devDependencies": {
65
65
  "@fastify/deepmerge": "^3.2.1",
66
- "@tailwindcss/oxide": "^4.3.1",
67
- "@types/node": "26.0.0",
66
+ "@tailwindcss/oxide": "^4.3.2",
67
+ "@types/node": "26.1.0",
68
68
  "@types/react": "^19.2.17",
69
69
  "ajv": "^8.20.0",
70
70
  "json-schema-typed": "^8.0.2",
71
71
  "tsdown": "0.22.3",
72
- "tsconfig": "0.0.0",
73
- "fumadocs-core": "16.10.6",
74
- "fumadocs-ui": "16.10.6"
72
+ "fumadocs-core": "16.11.0",
73
+ "fumadocs-ui": "npm:@fumadocs/base-ui@16.11.0",
74
+ "tsconfig": "0.0.0"
75
75
  },
76
76
  "peerDependencies": {
77
77
  "@types/react": "*",