mirror of
https://github.com/dathere/ckan-devstaller.git
synced 2025-11-09 13:39:49 +00:00
feat(docs): update quick start page and add reference section
This commit is contained in:
parent
cbd0a6dfd9
commit
b984c3b5e0
12 changed files with 435 additions and 4 deletions
39
docs/components/ui/collapsible.tsx
Normal file
39
docs/components/ui/collapsible.tsx
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
'use client';
|
||||
import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
|
||||
import { forwardRef, useEffect, useState } from 'react';
|
||||
import { cn } from '../../lib/cn';
|
||||
|
||||
const Collapsible = CollapsiblePrimitive.Root;
|
||||
|
||||
const CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger;
|
||||
|
||||
const CollapsibleContent = forwardRef<
|
||||
HTMLDivElement,
|
||||
React.ComponentPropsWithoutRef<typeof CollapsiblePrimitive.CollapsibleContent>
|
||||
>(({ children, ...props }, ref) => {
|
||||
const [mounted, setMounted] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
setMounted(true);
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<CollapsiblePrimitive.CollapsibleContent
|
||||
ref={ref}
|
||||
{...props}
|
||||
className={cn(
|
||||
'overflow-hidden',
|
||||
mounted &&
|
||||
'data-[state=closed]:animate-fd-collapsible-up data-[state=open]:animate-fd-collapsible-down',
|
||||
props.className,
|
||||
)}
|
||||
>
|
||||
{children}
|
||||
</CollapsiblePrimitive.CollapsibleContent>
|
||||
);
|
||||
});
|
||||
|
||||
CollapsibleContent.displayName =
|
||||
CollapsiblePrimitive.CollapsibleContent.displayName;
|
||||
|
||||
export { Collapsible, CollapsibleTrigger, CollapsibleContent };
|
||||
Loading…
Add table
Add a link
Reference in a new issue