import { Box } from '@luke-ui/react/box'; import { Cluster } from '@luke-ui/react/cluster'; import { Stack } from '@luke-ui/react/stack'; import { Text } from '@luke-ui/react/text'; import { cx } from '@luke-ui/react/utils'; import type { TypeNode } from 'fumadocs-ui/components/type-table'; import { TypeTable } from 'fumadocs-ui/components/type-table'; import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from 'fumadocs-ui/components/ui/collapsible'; import type { ComponentProps } from 'react'; import { groupPropNames, NATIVE_PROPS_FORWARDING_KEY } from '../lib/component-prop-groups.js'; /** Grouped prop tables for a component guide's `## API` section. */ export function ComponentPropsTable({ className, id, type, ...props }: { id: string; type: Record; } & ComponentProps<'div'>) { const groups = groupPropNames(Object.keys(type)); const nativePropsNote = type[NATIVE_PROPS_FORWARDING_KEY]?.description; return ( {nativePropsNote !== undefined ? ( {nativePropsNote} ) : null} {groups.map((group) => ( ))} ); } function PropGroup({ group, type, }: { group: { defaultOpen: boolean; name: string; props: ReadonlyArray }; type: Record; }) { return ( } > } > {group.name} } > ); } function ChevronIcon() { return ( ); } function pickGroupProps( type: Record, names: ReadonlySet, ): Record { return Object.fromEntries(Object.entries(type).filter(([name]) => names.has(name))); }