import React, { useState } from 'react'; import '../css/custom.css'; import Layout from '@theme/Layout'; import { Label } from '../../../ui-next/src/components/Label'; import { Input } from '../../../ui-next/src/components/Input'; import { Separator } from '../../../ui-next/src/components/Separator'; import { Tabs, TabsList, TabsTrigger } from '../../../ui-next/src/components/Tabs'; import { Select, SelectTrigger, SelectContent, SelectItem, SelectValue, } from '../../../ui-next/src/components/Select'; import { Button } from '../../../ui-next/src/components/Button'; import { Switch } from '../../../ui-next/src/components/Switch'; import { Checkbox } from '../../../ui-next/src/components/Checkbox'; import { Toggle } from '../../../ui-next/src/components/Toggle'; import { Slider } from '../../../ui-next/src/components/Slider'; import { ScrollArea } from '../../../ui-next/src/components/ScrollArea'; import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, } from '../../../ui-next/src/components/DropdownMenu'; import { Icons } from '../../../ui-next/src/components/Icons'; import { Toaster, toast } from '../../../ui-next/src/components/Sonner'; import { DataRow } from '../../../ui-next/src/components/DataRow'; import DataRowExample from './patterns/DataRowExample'; import { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent, } from '../../../ui-next/src/components/Card'; interface ShowcaseRowProps { title: string; description?: string; children: React.ReactNode; code: string; } export default function ComponentShowcase() { // Handlers to trigger different types of toasts const triggerSuccess = () => { toast.success('This is a success toast!'); }; const triggerError = () => { toast.error('This is an error toast!'); }; const triggerInfo = () => { toast.info('This is an info toast!'); }; const triggerWarning = () => { toast.warning('This is a warning toast!'); }; // Handler to trigger a toast.promise example const triggerPromiseToast = () => { const promise = () => new Promise<{ name: string }>(resolve => setTimeout(() => resolve({ name: 'Segmentation 1' }), 3000) ); toast.promise(promise(), { loading: 'Loading Segmentation...', success: data => `${data.name} has been added`, error: 'Error', }); }; // Handler to trigger a toast with description const triggerDescriptionToast = () => { toast.success('Completed', { description: 'This is a detailed description of the success message.', }); }; // Handler to trigger a toast with an action button const triggerActionButtonToast = () => { toast.info('No active segmentation detected', { description: 'Create a segmentation before using the Brush', }); }; // Handler to trigger a toast with a cancel button const triggerCancelButtonToast = () => { toast.error('No active segmentation detected', { description: 'Create a segmentation before using the Brush', }); }; // Handler to trigger a toast with both action and cancel buttons const triggerCombinedToast = () => { toast.warning('Warning!', { description: 'This is a warning with both action and cancel buttons.', action: ( ), cancel: ( ), }); }; // Handler to trigger a loading toast using Toaster's default loading icon const showLoadingToast = () => { toast.loading('Loading your data...'); }; return (
Colors & Typography Color Palette and Typography Guidelines Components Essential UI Components with Variants Patterns Component-Based Layout Examples

Components

{/* Alphabetically Sorted ShowcaseRows */} Primary Button `} >
`} >
{/* Render the DataRowExample component */} Item 1 Item 2 Long name Item 3 Item 1 Item 2 Long name Item 3 Item 1 Item 2 Long name Item 3 console.debug('Item 1')}>Item 1 console.debug('Item 2')}>Item 2 console.debug('Item 3')}>Long name Item 3 `} >
Item 1 Item 2 Long name Item 3 Item 1 Item 2 Long name Item 3 Item 1 Item 2 Long name Item 3 console.debug('Item 1')}> Item 1 console.debug('Item 2')}> Item 2 console.debug('Item 3')}> Long name Item 3
`} >
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. `} > Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Light Dark System `} > `} >
`} > Circle Sphere Square `} > Circle Sphere Square {/* Toast Examples Section */} Simple message:
Message with details:
{/* Render the Toaster component */}
); } function ShowcaseRow({ title, description, children, code }: ShowcaseRowProps) { const [showCode, setShowCode] = useState(false); return (

{title}

{description &&

{description}

}
{children}
{showCode && (
          {code}
        
)}
); } // function ShowcaseRow({ title, description, children, code }: ShowcaseRowProps) { // const [showCode, setShowCode] = useState(false); // return ( //
//
//
//

{title}

// {description &&

{description}

} //
// //
//
{children}
// {showCode && ( //
//           {code}
//         
// )} //
// ); // }